lfortran-0.63.0/0000775000175000017500000000000015174404640013620 5ustar alastairalastairlfortran-0.63.0/build1.sh0000775000175000017500000000113015174404631015332 0ustar alastairalastair#!/usr/bin/env bash set -e set -x cmake \ -DCMAKE_BUILD_TYPE=Debug \ -DWITH_LLVM=yes \ -DLFORTRAN_BUILD_ALL=yes \ -DWITH_STACKTRACE=yes \ -DWITH_RUNTIME_STACKTRACE=yes \ -DWITH_LSP=no \ -DWITH_INTERNAL_ALLOC_CHECK=yes \ -DUSE_DYNAMIC_ZSTD=no \ -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX" \ -DCMAKE_INSTALL_LIBDIR=share/lfortran/lib \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_C_FLAGS="${CFLAGS} -fdiagnostics-color=always" \ -DCMAKE_CXX_FLAGS="${CXXFLAGS} -fdiagnostics-color=always" \ -G Ninja \ . cmake --build . lfortran-0.63.0/tests/0000775000175000017500000000000015174404631014762 5ustar alastairalastairlfortran-0.63.0/tests/preprocessor5.f900000664000175000017500000000045515174404631020121 0ustar alastairalastairprogram preprocessor5 implicit none #define X 5 #define Y #ifdef X print *, 1 #else print *, 2 #endif #ifndef X print *, 11 #else print *, 12 #endif #ifdef Y print *, 3 #else print *, 4 #endif #ifdef Z print *, 5 #else print *, 6 #endif #ifndef Z print *, 15 #else print *, 16 #endif end program lfortran-0.63.0/tests/program2.f900000664000175000017500000000017615174404631017037 0ustar alastairalastairprogram program2 implicit none call b call b() contains subroutine b() print *, "b" end subroutine end program lfortran-0.63.0/tests/do_concurrent2.f900000664000175000017500000000044515174404631020233 0ustar alastairalastairsubroutine do_concurrent2(a, b) real, intent(inout) :: a(:), b(:) integer :: i real :: x x = 1.0 do concurrent (i=1:10) shared(i) local(x) default(none) if (a(i) > 0) then x = sqrt(a(i)) a(i) = a(i) - x**2 end if b(i) = b(i) - a(i) end do print *, x end subroutine lfortran-0.63.0/tests/subroutine8.f900000664000175000017500000000035615174404631017575 0ustar alastairalastairrecursive pure subroutine a() end subroutine pure elemental subroutine b() end subroutine elemental pure subroutine c() end subroutine pure recursive subroutine d() end subroutine impure elemental module subroutine e() end subroutine lfortran-0.63.0/tests/interface3.f900000664000175000017500000000420615174404631017327 0ustar alastairalastairmodule interface3 implicit none !checks the syntax public :: x, y, z, assignment(=), operator(+), operator(.and.), operator(.in.) public :: operator(*) public :: operator(/) public :: operator(/ ) public :: operator(// ) interface module procedure sample end interface interface A module procedure :: sample end interface A INTERFACE ASSIGNMENT ( = ) SUBROUTINE LOGICAL_TO_NUMERIC (N, B) INTEGER, INTENT (OUT) :: N LOGICAL, INTENT (IN) :: B END SUBROUTINE LOGICAL_TO_NUMERIC END INTERFACE ASSIGNMENT ( = ) interface operator (+) module procedure union end interface operator (+) interface operator (-) module procedure difference end interface operator (-) interface operator (*) module procedure intersection end interface operator (*) interface operator ( / ) end interface operator ( / ) interface operator (/) end interface operator (/) interface operator (**) end interface operator (**) interface operator (==) end interface operator (==) interface operator (/=) end interface operator (/=) interface operator (>) end interface operator (>) interface operator (>=) end interface operator (>=) interface operator (<) end interface operator (<) interface operator (<=) module procedure subset end interface operator (<=) interface operator (.not.) end interface operator (.not.) interface operator (.and.) end interface operator (.and.) interface operator (.or.) end interface operator (.or.) interface operator (.eqv.) end interface operator (.eqv.) interface operator (.neqv.) end interface operator (.neqv.) abstract interface end interface public :: operator(//) interface operator (//) end interface operator (//) interface write(formatted) module procedure :: write_formatted end interface interface write(unformatted) module procedure :: write_unformatted end interface interface read(formatted) module procedure :: read_formatted end interface interface read(unformatted) module procedure :: read_unformatted end interface contains function f(operator) ! Currently parsed as an operator, but AST -> ASR phase can fix that: real, intent(in) :: operator (*) end function f end module lfortran-0.63.0/tests/array_op_simplifier_test.f900000664000175000017500000000020315174404631022373 0ustar alastairalastairprogram main implicit none real :: a(5, 5), b(5, 5), c real, allocatable :: d(:, :) allocate(d(5, 5)) d = a + b + c end program lfortran-0.63.0/tests/fixedform_doloop2.f0000664000175000017500000000041415174404631020551 0ustar alastairalastair program main integer k do k=1,10 print *, k end do do 80 k=1,10 print *, k 80 continue do 800 k=1,10 print *, k 800 continue do 8000 k=1,10 print *, k 8000 continue end program lfortran-0.63.0/tests/reference/0000775000175000017500000000000015174404631016720 5ustar alastairalastairlfortran-0.63.0/tests/reference/asr_openmp-openmp_45-1c0e790.stdout0000664000175000017500000055446115174404631025140 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), omp_lib: (Module (SymbolTable 8 { c_bool: (ExternalSymbol 8 c_bool 43 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 8 c_funptr 43 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 8 c_int 43 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 8 c_long 43 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 8 c_ptr 43 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (Function (SymbolTable 9 { }) gomp_atomic_end (FunctionType [] () BindC Interface "GOMP_atomic_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_atomic_start: (Function (SymbolTable 10 { }) gomp_atomic_start (FunctionType [] () BindC Interface "GOMP_atomic_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_barrier: (Function (SymbolTable 11 { }) gomp_barrier (FunctionType [] () BindC Interface "GOMP_barrier" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_end: (Function (SymbolTable 12 { }) gomp_critical_end (FunctionType [] () BindC Interface "GOMP_critical_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_start: (Function (SymbolTable 13 { }) gomp_critical_start (FunctionType [] () BindC Interface "GOMP_critical_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_auto_next: (Function (SymbolTable 14 { gomp_loop_auto_next: (Variable 14 gomp_loop_auto_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 14 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 14 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_auto_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_auto_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 14 istart) (Var 14 iend)] [] (Var 14 gomp_loop_auto_next) Public .false. .false. () ), gomp_loop_auto_start: (Function (SymbolTable 15 { end: (Variable 15 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_auto_start: (Variable 15 gomp_loop_auto_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 15 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 15 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 15 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 15 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_auto_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_auto_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 15 start) (Var 15 end) (Var 15 incr) (Var 15 istart) (Var 15 iend)] [] (Var 15 gomp_loop_auto_start) Public .false. .false. () ), gomp_loop_dynamic_next: (Function (SymbolTable 16 { gomp_loop_dynamic_next: (Variable 16 gomp_loop_dynamic_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 16 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 16 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_dynamic_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_dynamic_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 16 istart) (Var 16 iend)] [] (Var 16 gomp_loop_dynamic_next) Public .false. .false. () ), gomp_loop_dynamic_start: (Function (SymbolTable 17 { chunk: (Variable 17 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), end: (Variable 17 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_dynamic_start: (Variable 17 gomp_loop_dynamic_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 17 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 17 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 17 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 17 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_dynamic_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_dynamic_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 start) (Var 17 end) (Var 17 incr) (Var 17 chunk) (Var 17 istart) (Var 17 iend)] [] (Var 17 gomp_loop_dynamic_start) Public .false. .false. () ), gomp_loop_end: (Function (SymbolTable 18 { }) gomp_loop_end (FunctionType [] () BindC Interface "GOMP_loop_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_end_nowait: (Function (SymbolTable 19 { }) gomp_loop_end_nowait (FunctionType [] () BindC Interface "GOMP_loop_end_nowait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_guided_next: (Function (SymbolTable 20 { gomp_loop_guided_next: (Variable 20 gomp_loop_guided_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 20 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 20 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_guided_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_guided_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 istart) (Var 20 iend)] [] (Var 20 gomp_loop_guided_next) Public .false. .false. () ), gomp_loop_guided_start: (Function (SymbolTable 21 { chunk: (Variable 21 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), end: (Variable 21 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_guided_start: (Variable 21 gomp_loop_guided_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 21 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 21 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 21 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 21 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_guided_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_guided_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 21 start) (Var 21 end) (Var 21 incr) (Var 21 chunk) (Var 21 istart) (Var 21 iend)] [] (Var 21 gomp_loop_guided_start) Public .false. .false. () ), gomp_loop_runtime_next: (Function (SymbolTable 22 { gomp_loop_runtime_next: (Variable 22 gomp_loop_runtime_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 22 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 22 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_runtime_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_runtime_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 22 istart) (Var 22 iend)] [] (Var 22 gomp_loop_runtime_next) Public .false. .false. () ), gomp_loop_runtime_start: (Function (SymbolTable 23 { end: (Variable 23 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_runtime_start: (Variable 23 gomp_loop_runtime_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 23 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 23 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 23 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 23 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_runtime_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_runtime_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 23 start) (Var 23 end) (Var 23 incr) (Var 23 istart) (Var 23 iend)] [] (Var 23 gomp_loop_runtime_start) Public .false. .false. () ), gomp_loop_static_next: (Function (SymbolTable 24 { gomp_loop_static_next: (Variable 24 gomp_loop_static_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 24 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 24 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_static_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_static_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 24 istart) (Var 24 iend)] [] (Var 24 gomp_loop_static_next) Public .false. .false. () ), gomp_loop_static_start: (Function (SymbolTable 25 { chunk: (Variable 25 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), end: (Variable 25 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_static_start: (Variable 25 gomp_loop_static_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 25 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 25 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 25 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 25 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_static_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_static_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 25 start) (Var 25 end) (Var 25 incr) (Var 25 chunk) (Var 25 istart) (Var 25 iend)] [] (Var 25 gomp_loop_static_start) Public .false. .false. () ), gomp_parallel: (Function (SymbolTable 26 { data: (Variable 26 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), flags: (Variable 26 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), fn: (Variable 26 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), num_threads: (Variable 26 num_threads [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_parallel (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_parallel" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 26 fn) (Var 26 data) (Var 26 num_threads) (Var 26 flags)] [] () Public .false. .false. () ), gomp_sections_end: (Function (SymbolTable 27 { }) gomp_sections_end (FunctionType [] () BindC Interface "GOMP_sections_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_sections_next: (Function (SymbolTable 28 { gomp_sections_next: (Variable 28 gomp_sections_next [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_sections_next (FunctionType [] (Integer 4) BindC Interface "GOMP_sections_next" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 28 gomp_sections_next) Public .false. .false. () ), gomp_sections_start: (Function (SymbolTable 29 { count: (Variable 29 count [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_sections_start: (Variable 29 gomp_sections_start [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_sections_start (FunctionType [(Integer 4)] (Integer 4) BindC Interface "GOMP_sections_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 29 count)] [] (Var 29 gomp_sections_start) Public .false. .false. () ), gomp_task: (Function (SymbolTable 30 { arg_align: (Variable 30 arg_align [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), arg_size: (Variable 30 arg_size [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), cpyfn: (Variable 30 cpyfn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), data: (Variable 30 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), depend: (Variable 30 depend [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), flags: (Variable 30 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), fn: (Variable 30 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), if_clause: (Variable 30 if_clause [] Unspecified () () Default (Logical 1) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_task (FunctionType [(CPtr) (CPtr) (CPtr) (Integer 8) (Integer 8) (Logical 1) (Integer 4) (CPtr)] () BindC Interface "GOMP_task" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 30 fn) (Var 30 data) (Var 30 cpyfn) (Var 30 arg_size) (Var 30 arg_align) (Var 30 if_clause) (Var 30 flags) (Var 30 depend)] [] () Public .false. .false. () ), gomp_taskwait: (Function (SymbolTable 31 { }) gomp_taskwait (FunctionType [] () BindC Interface "GOMP_taskwait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_teams: (Function (SymbolTable 32 { data: (Variable 32 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), fn: (Variable 32 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), num_teams: (Variable 32 num_teams [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), thread_limit: (Variable 32 thread_limit [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_teams (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_teams_reg" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 32 fn) (Var 32 data) (Var 32 num_teams) (Var 32 thread_limit)] [] () Public .false. .false. () ), omp_get_max_threads: (Function (SymbolTable 33 { omp_get_max_threads: (Variable 33 omp_get_max_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_max_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_max_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 33 omp_get_max_threads) Public .false. .false. () ), omp_get_num_procs: (Function (SymbolTable 34 { omp_get_num_procs: (Variable 34 omp_get_num_procs [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_num_procs (FunctionType [] (Integer 4) BindC Interface "omp_get_num_procs" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 34 omp_get_num_procs) Public .false. .false. () ), omp_get_num_teams: (Function (SymbolTable 35 { omp_get_num_teams: (Variable 35 omp_get_num_teams [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_num_teams (FunctionType [] (Integer 4) BindC Interface "omp_get_num_teams" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 35 omp_get_num_teams) Public .false. .false. () ), omp_get_num_threads: (Function (SymbolTable 36 { omp_get_num_threads: (Variable 36 omp_get_num_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_num_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 36 omp_get_num_threads) Public .false. .false. () ), omp_get_team_num: (Function (SymbolTable 37 { omp_get_team_num: (Variable 37 omp_get_team_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_team_num (FunctionType [] (Integer 4) BindC Interface "omp_get_team_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 37 omp_get_team_num) Public .false. .false. () ), omp_get_team_size: (Function (SymbolTable 38 { level: (Variable 38 level [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), omp_get_team_size: (Variable 38 omp_get_team_size [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_team_size (FunctionType [(Integer 4)] (Integer 4) BindC Interface "omp_get_team_size" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 38 level)] [] (Var 38 omp_get_team_size) Public .false. .false. () ), omp_get_thread_num: (Function (SymbolTable 39 { omp_get_thread_num: (Variable 39 omp_get_thread_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_thread_num (FunctionType [] (Integer 4) BindC Interface "omp_get_thread_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 39 omp_get_thread_num) Public .false. .false. () ), omp_get_wtime: (Function (SymbolTable 40 { omp_get_wtime: (Variable 40 omp_get_wtime [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_wtime (FunctionType [] (Real 8) BindC Interface "omp_get_wtime" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 40 omp_get_wtime) Public .false. .false. () ), omp_set_num_threads: (Function (SymbolTable 41 { n: (Variable 41 n [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_set_num_threads (FunctionType [(Integer 4)] () BindC Interface "omp_set_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 41 n)] [] () Public .false. .false. () ) }) omp_lib () [iso_c_binding] .true. .false. .false. ), openmp_45: (Program (SymbolTable 6 { c_bool: (ExternalSymbol 6 c_bool 43 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 6 c_funptr 43 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 6 c_int 43 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 6 c_long 43 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 6 c_ptr 43 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), compute_a: (ExternalSymbol 6 compute_a 2 compute_a openmp_45_parallel_sections [] compute_a Public ), compute_b: (ExternalSymbol 6 compute_b 2 compute_b openmp_45_parallel_sections [] compute_b Public ), compute_c: (ExternalSymbol 6 compute_c 2 compute_c openmp_45_parallel_sections [] compute_c Public ), gomp_atomic_end: (ExternalSymbol 6 gomp_atomic_end 8 gomp_atomic_end omp_lib [] gomp_atomic_end Public ), gomp_atomic_start: (ExternalSymbol 6 gomp_atomic_start 8 gomp_atomic_start omp_lib [] gomp_atomic_start Public ), gomp_barrier: (ExternalSymbol 6 gomp_barrier 8 gomp_barrier omp_lib [] gomp_barrier Public ), gomp_critical_end: (ExternalSymbol 6 gomp_critical_end 8 gomp_critical_end omp_lib [] gomp_critical_end Public ), gomp_critical_start: (ExternalSymbol 6 gomp_critical_start 8 gomp_critical_start omp_lib [] gomp_critical_start Public ), gomp_loop_auto_next: (ExternalSymbol 6 gomp_loop_auto_next 8 gomp_loop_auto_next omp_lib [] gomp_loop_auto_next Public ), gomp_loop_auto_start: (ExternalSymbol 6 gomp_loop_auto_start 8 gomp_loop_auto_start omp_lib [] gomp_loop_auto_start Public ), gomp_loop_dynamic_next: (ExternalSymbol 6 gomp_loop_dynamic_next 8 gomp_loop_dynamic_next omp_lib [] gomp_loop_dynamic_next Public ), gomp_loop_dynamic_start: (ExternalSymbol 6 gomp_loop_dynamic_start 8 gomp_loop_dynamic_start omp_lib [] gomp_loop_dynamic_start Public ), gomp_loop_end: (ExternalSymbol 6 gomp_loop_end 8 gomp_loop_end omp_lib [] gomp_loop_end Public ), gomp_loop_end_nowait: (ExternalSymbol 6 gomp_loop_end_nowait 8 gomp_loop_end_nowait omp_lib [] gomp_loop_end_nowait Public ), gomp_loop_guided_next: (ExternalSymbol 6 gomp_loop_guided_next 8 gomp_loop_guided_next omp_lib [] gomp_loop_guided_next Public ), gomp_loop_guided_start: (ExternalSymbol 6 gomp_loop_guided_start 8 gomp_loop_guided_start omp_lib [] gomp_loop_guided_start Public ), gomp_loop_runtime_next: (ExternalSymbol 6 gomp_loop_runtime_next 8 gomp_loop_runtime_next omp_lib [] gomp_loop_runtime_next Public ), gomp_loop_runtime_start: (ExternalSymbol 6 gomp_loop_runtime_start 8 gomp_loop_runtime_start omp_lib [] gomp_loop_runtime_start Public ), gomp_loop_static_next: (ExternalSymbol 6 gomp_loop_static_next 8 gomp_loop_static_next omp_lib [] gomp_loop_static_next Public ), gomp_loop_static_start: (ExternalSymbol 6 gomp_loop_static_start 8 gomp_loop_static_start omp_lib [] gomp_loop_static_start Public ), gomp_parallel: (ExternalSymbol 6 gomp_parallel 8 gomp_parallel omp_lib [] gomp_parallel Public ), gomp_sections_end: (ExternalSymbol 6 gomp_sections_end 8 gomp_sections_end omp_lib [] gomp_sections_end Public ), gomp_sections_next: (ExternalSymbol 6 gomp_sections_next 8 gomp_sections_next omp_lib [] gomp_sections_next Public ), gomp_sections_start: (ExternalSymbol 6 gomp_sections_start 8 gomp_sections_start omp_lib [] gomp_sections_start Public ), gomp_task: (ExternalSymbol 6 gomp_task 8 gomp_task omp_lib [] gomp_task Public ), gomp_taskwait: (ExternalSymbol 6 gomp_taskwait 8 gomp_taskwait omp_lib [] gomp_taskwait Public ), gomp_teams: (ExternalSymbol 6 gomp_teams 8 gomp_teams omp_lib [] gomp_teams Public ), omp_get_max_threads: (ExternalSymbol 6 omp_get_max_threads 8 omp_get_max_threads omp_lib [] omp_get_max_threads Public ), omp_get_num_procs: (ExternalSymbol 6 omp_get_num_procs 8 omp_get_num_procs omp_lib [] omp_get_num_procs Public ), omp_get_num_teams: (ExternalSymbol 6 omp_get_num_teams 8 omp_get_num_teams omp_lib [] omp_get_num_teams Public ), omp_get_num_threads: (ExternalSymbol 6 omp_get_num_threads 8 omp_get_num_threads omp_lib [] omp_get_num_threads Public ), omp_get_team_num: (ExternalSymbol 6 omp_get_team_num 8 omp_get_team_num omp_lib [] omp_get_team_num Public ), omp_get_team_size: (ExternalSymbol 6 omp_get_team_size 8 omp_get_team_size omp_lib [] omp_get_team_size Public ), omp_get_thread_num: (ExternalSymbol 6 omp_get_thread_num 8 omp_get_thread_num omp_lib [] omp_get_thread_num Public ), omp_get_wtime: (ExternalSymbol 6 omp_get_wtime 8 omp_get_wtime omp_lib [] omp_get_wtime Public ), omp_set_num_threads: (ExternalSymbol 6 omp_set_num_threads 8 omp_set_num_threads omp_lib [] omp_set_num_threads Public ), tid: (Variable 6 tid [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) openmp_45 [omp_lib openmp_45_parallel_sections] [(OMPRegion ParallelSections [] [(OMPRegion Section [] [(SubroutineCall 6 compute_a () [] () .false. )] ) (OMPRegion Section [] [(SubroutineCall 6 compute_b () [] () .false. )] ) (OMPRegion Section [] [(SubroutineCall 6 compute_c () [] () .false. )] )] )] ), openmp_45_parallel_sections: (Module (SymbolTable 2 { compute_a: (Function (SymbolTable 3 { }) compute_a (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "Computing A" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), compute_b: (Function (SymbolTable 4 { }) compute_b (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "Computing B" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), compute_c: (Function (SymbolTable 5 { }) compute_c (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "Computing C" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ) }) openmp_45_parallel_sections () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-int_dp_param-19bf015.stdout0000664000175000017500000001237715174404631024403 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { int_dp_param: (Program (SymbolTable 2 { prec1: (Variable 2 prec1 [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), prec2: (Variable 2 prec2 [] Local (IntegerConstant 8 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u: (Variable 2 u [] Local (IntegerConstant 2147483647 (Integer 4) Decimal) (IntegerConstant 2147483647 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 2 v [] Local (Cast (IntegerConstant 2147483647 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 2147483647 (Integer 8) Decimal) () ) (IntegerConstant 2147483647 (Integer 8) Decimal) Save (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) int_dp_param [] [(Print (StringFormat () [(Var 2 u) (Var 2 v)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-global_scope1-dd9aaaa.stdout0000664000175000017500000000040615174404631024745 0ustar alastairalastair(TranslationUnit [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () )] ) lfortran-0.63.0/tests/reference/ast_f90-goto_02-48f3a02.json0000664000175000017500000000107415174404631023316 0ustar alastairalastair{ "basename": "ast_f90-goto_02-48f3a02", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/goto_02.f90", "infile_hash": "2bd2e5ad2c2506c3da506b82aa7d12c7877206410c2d7637f556d10b", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-goto_02-48f3a02.stdout", "stdout_hash": "8fb675472ef67d02eecf5f4995edbecbfcd987589eef60972fa4cc78", "stderr": "ast_f90-goto_02-48f3a02.stderr", "stderr_hash": "317795e3eb8121d18463c9531b060be0c248a0b34d70a2961d6d2047", "returncode": 0 }lfortran-0.63.0/tests/reference/fortran-complex_to_complex_cast_fortran_codegen-d2ad266.stdout0000664000175000017500000000061515174404631033036 0ustar alastairalastairprogram implicitcomplextocomplexdifferentkindexample implicit none complex(4) :: complexvalue1 complex(8) :: complexvalue2 complexvalue1 = cmplx(1.00000000e+00, 2.00000000e+00, kind=4) complexvalue2 = cmplx(complexvalue1, kind=8) print *, "Complex Value 1 (Default Kind):", complexvalue1 print *, "Complex Value 2 (Kind=8):", complexvalue2 end program implicitcomplextocomplexdifferentkindexample lfortran-0.63.0/tests/reference/llvm-subroutines_01-e2ed4a5.stdout0000664000175000017500000003743315174404631025157 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [6 x i8] c"I4,I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @17 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @21 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @23 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @25 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc28 = alloca %string_descriptor, align 8 %stringFormat_desc19 = alloca %string_descriptor, align 8 %stringFormat_desc10 = alloca %string_descriptor, align 8 %call_arg_value = alloca i32, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %j = alloca i32, align 4 store i32 1, i32* %i, align 4 store i32 1, i32* %j, align 4 %3 = load i32, i32* %j, align 4 %4 = icmp ne i32 %3, 1 br i1 %4, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then call void @f(i32* %i, i32* %j) %5 = alloca i64, align 8 %6 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info, i32 0, i32 0), i64* %5, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %i, i32* %j) %7 = load i64, i64* %5, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %6, i8** %8, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %7, i64* %9, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %11 = load i8*, i8** %10, align 8 %12 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %13 = load i64, i64* %12, align 8 %14 = trunc i64 %13 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %11, i32 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %15 = icmp eq i8* %6, null br i1 %15, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont call void @_lfortran_free_alloc(i8* %2, i8* %6) br label %free_done free_done: ; preds = %free_nonnull, %ifcont %16 = load i32, i32* %i, align 4 %17 = icmp ne i32 %16, 1 br i1 %17, label %then1, label %else2 then1: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont3 else2: ; preds = %free_done br label %ifcont3 ifcont3: ; preds = %else2, %then1 %18 = load i32, i32* %j, align 4 %19 = icmp ne i32 %18, 2 br i1 %19, label %then4, label %else5 then4: ; preds = %ifcont3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont6 else5: ; preds = %ifcont3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 store i32 1, i32* %j, align 4 %20 = load i32, i32* %j, align 4 %21 = icmp ne i32 %20, 1 br i1 %21, label %then7, label %else8 then7: ; preds = %ifcont6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 store i32 3, i32* %call_arg_value, align 4 call void @f(i32* %call_arg_value, i32* %j) %22 = alloca i64, align 8 %23 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %22, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %24 = load i64, i64* %22, align 8 %25 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 store i8* %23, i8** %25, align 8 %26 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 store i64 %24, i64* %26, align 8 %27 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 %28 = load i8*, i8** %27, align 8 %29 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 %30 = load i64, i64* %29, align 8 %31 = trunc i64 %30 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %28, i32 %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %32 = icmp eq i8* %23, null br i1 %32, label %free_done12, label %free_nonnull11 free_nonnull11: ; preds = %ifcont9 call void @_lfortran_free_alloc(i8* %2, i8* %23) br label %free_done12 free_done12: ; preds = %free_nonnull11, %ifcont9 %33 = load i32, i32* %j, align 4 %34 = icmp ne i32 %33, 4 br i1 %34, label %then13, label %else14 then13: ; preds = %free_done12 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont15 else14: ; preds = %free_done12 br label %ifcont15 ifcont15: ; preds = %else14, %then13 store i32 1, i32* %j, align 4 %35 = load i32, i32* %j, align 4 %36 = icmp ne i32 %35, 1 br i1 %36, label %then16, label %else17 then16: ; preds = %ifcont15 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont18 else17: ; preds = %ifcont15 br label %ifcont18 ifcont18: ; preds = %else17, %then16 store i32 3, i32* %call_arg_value, align 4 call void @f(i32* %call_arg_value, i32* %j) %37 = alloca i64, align 8 %38 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %37, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %39 = load i64, i64* %37, align 8 %40 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 store i8* %38, i8** %40, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 store i64 %39, i64* %41, align 8 %42 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 %43 = load i8*, i8** %42, align 8 %44 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 %45 = load i64, i64* %44, align 8 %46 = trunc i64 %45 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* %43, i32 %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0), i32 1) %47 = icmp eq i8* %38, null br i1 %47, label %free_done21, label %free_nonnull20 free_nonnull20: ; preds = %ifcont18 call void @_lfortran_free_alloc(i8* %2, i8* %38) br label %free_done21 free_done21: ; preds = %free_nonnull20, %ifcont18 %48 = load i32, i32* %j, align 4 %49 = icmp ne i32 %48, 4 br i1 %49, label %then22, label %else23 then22: ; preds = %free_done21 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont24 else23: ; preds = %free_done21 br label %ifcont24 ifcont24: ; preds = %else23, %then22 store i32 1, i32* %j, align 4 %50 = load i32, i32* %j, align 4 %51 = icmp ne i32 %50, 1 br i1 %51, label %then25, label %else26 then25: ; preds = %ifcont24 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont27 else26: ; preds = %ifcont24 br label %ifcont27 ifcont27: ; preds = %else26, %then25 %52 = load i32, i32* %i, align 4 %53 = add i32 %52, 2 store i32 %53, i32* %call_arg_value, align 4 call void @f(i32* %call_arg_value, i32* %j) %54 = alloca i64, align 8 %55 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.3, i32 0, i32 0), i64* %54, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %56 = load i64, i64* %54, align 8 %57 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc28, i32 0, i32 0 store i8* %55, i8** %57, align 8 %58 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc28, i32 0, i32 1 store i64 %56, i64* %58, align 8 %59 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc28, i32 0, i32 0 %60 = load i8*, i8** %59, align 8 %61 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc28, i32 0, i32 1 %62 = load i64, i64* %61, align 8 %63 = trunc i64 %62 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @23, i32 0, i32 0), i8* %60, i32 %63, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0), i32 1) %64 = icmp eq i8* %55, null br i1 %64, label %free_done30, label %free_nonnull29 free_nonnull29: ; preds = %ifcont27 call void @_lfortran_free_alloc(i8* %2, i8* %55) br label %free_done30 free_done30: ; preds = %free_nonnull29, %ifcont27 %65 = load i32, i32* %j, align 4 %66 = icmp ne i32 %65, 4 br i1 %66, label %then31, label %else32 then31: ; preds = %free_done30 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont33 else32: ; preds = %free_done30 br label %ifcont33 ifcont33: ; preds = %else32, %then31 br label %return return: ; preds = %ifcont33 br label %FINALIZE_SYMTABLE_subroutines_01 FINALIZE_SYMTABLE_subroutines_01: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } define void @f(i32* %a, i32* %b) { .entry: %0 = load i32, i32* %a, align 4 %1 = add i32 %0, 1 store i32 %1, i32* %b, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return ret void } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) lfortran-0.63.0/tests/reference/llvm-bits_02-925bde2.stdout0000664000175000017500000001421415174404631023452 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I8\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I8\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc4 = alloca %string_descriptor, align 8 %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %all_ones = alloca i64, align 8 store i64 -1, i64* %all_ones, align 8 %all_zeros = alloca i64, align 8 store i64 0, i64* %all_zeros, align 8 %block_size = alloca i32, align 4 store i32 64, i32* %block_size, align 4 %3 = alloca i64, align 8 %4 = alloca i32, align 4 store i32 64, i32* %4, align 4 %5 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %4) %6 = load i64, i64* %3, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %5, i8** %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %6, i64* %8, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %10 = load i8*, i8** %9, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %12 = load i64, i64* %11, align 8 %13 = trunc i64 %12 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %10, i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %14 = icmp eq i8* %5, null br i1 %14, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %5) br label %free_done free_done: ; preds = %free_nonnull, %.entry %15 = alloca i64, align 8 %16 = alloca i64, align 8 store i64 0, i64* %16, align 8 %17 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %15, i32 0, i32 0, i32 0, i32 0, i32 0, i64* %16) %18 = load i64, i64* %15, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %17, i8** %19, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %18, i64* %20, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %22 = load i8*, i8** %21, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %24 = load i64, i64* %23, align 8 %25 = trunc i64 %24 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %22, i32 %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %26 = icmp eq i8* %17, null br i1 %26, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %2, i8* %17) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %27 = alloca i64, align 8 %28 = alloca i64, align 8 store i64 -1, i64* %28, align 8 %29 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %27, i32 0, i32 0, i32 0, i32 0, i32 0, i64* %28) %30 = load i64, i64* %27, align 8 %31 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %29, i8** %31, align 8 %32 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %30, i64* %32, align 8 %33 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %34 = load i8*, i8** %33, align 8 %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %36 = load i64, i64* %35, align 8 %37 = trunc i64 %36 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %34, i32 %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %38 = icmp eq i8* %29, null br i1 %38, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free_alloc(i8* %2, i8* %29) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 br label %return return: ; preds = %free_done6 br label %FINALIZE_SYMTABLE_bits_02 FINALIZE_SYMTABLE_bits_02: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr_openmp-openmp_38-2731560.json0000664000175000017500000000077415174404631024421 0ustar alastairalastair{ "basename": "asr_openmp-openmp_38-2731560", "cmd": "lfortran --show-asr --no-color --openmp {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_38.f90", "infile_hash": "8e3b8810b1c59c6bcfb2111da045536db52041003a5491a5a87f3f73", "outfile": null, "outfile_hash": null, "stdout": "asr_openmp-openmp_38-2731560.stdout", "stdout_hash": "4a539904987aab06a297b139563379e695b47b536b9938526ad7c071", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-bin_op_real_dp-21bb7e8.stdout0000664000175000017500000002223115174404631024753 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bin_op_real_dp: (Program (SymbolTable 2 { u: (Variable 2 u [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 2 v [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zero: (Variable 2 zero [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) bin_op_real_dp [] [(Assignment (Var 2 zero) (RealBinOp (RealConstant 1.000000 (Real 4) ) Div (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) () ) (Real 4) (RealConstant 0.142857 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 u) (Cast (RealBinOp (RealConstant 1.000000 (Real 4) ) Div (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) () ) (Real 4) (RealConstant 0.142857 (Real 4) ) ) RealToReal (Real 8) (RealConstant 0.142857 (Real 8) ) () ) () .false. .false. ) (Assignment (Var 2 v) (RealBinOp (RealConstant 1.000000 (Real 8) ) Div (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 7.000000 (Real 8) ) () ) (Real 8) (RealConstant 0.142857 (Real 8) ) ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (RealConstant 1.000000 (Real 4) ) Div (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) () ) (Real 4) (RealConstant 0.142857 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 zero) (Var 2 v) (Var 2 x) (Var 2 u)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-implicit3-ffc1655.stdout0000664000175000017500000002713615174404631023732 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { a: (Variable 2 a [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 2 k [] Unspecified () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 2 m [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Unspecified () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a (FunctionType [(Real 4) (Real 4) (Complex 4) (Real 8)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 n) (Var 2 m) (Var 2 z) (Var 2 k)] [(Assignment (Var 2 n) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 m) (Cast (IntegerConstant 8 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 8.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 k) (Cast (RealConstant 9.230000 (Real 4) ) RealToReal (Real 8) (RealConstant 9.230000 (Real 8) ) () ) () .false. .false. ) (Assignment (Var 2 x) (ArrayConstant 20 [1, 2, 3, 4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 2 z) (ComplexConstructor (RealConstant 1.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) (Complex 4) (ComplexConstant 1.000000 2.000000 (Complex 4) ) ) () .false. .false. )] (Var 2 a) Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-dim_assgn_test-2643606.stdout0000664000175000017500000000625515174404631024612 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { dim_assgn_test: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) dim_assgn_test [] [] ) }) [] ) lfortran-0.63.0/tests/reference/asr-subroutine3-8086030.stdout0000664000175000017500000000410615174404631024060 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f: (Variable 2 f [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 f) (IntegerConstant 42 (Integer 4) Decimal) () .false. .false. )] (Var 2 f) Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-matrix_matmul_02-4e306e0.stderr0000664000175000017500000000035415174404631025102 0ustar alastairalastairsemantic error: The argument `matrix_b` in `matmul` must be of type Integer, Real or Complex if first matrix is of numeric type --> tests/errors/matrix_matmul_02.f90:5:24 | 5 | print *, matmul(b, a) | ^ lfortran-0.63.0/tests/reference/asr-functions_15-ce4c4bb.json0000664000175000017500000000075615174404631024127 0ustar alastairalastair{ "basename": "asr-functions_15-ce4c4bb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_15.f90", "infile_hash": "a12bb6ea6046f7462606bd7d550d6bc8a46655d6593d5a5e4425d051", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_15-ce4c4bb.stdout", "stdout_hash": "4aacbbacdf67544a20a02d6d3181ae354be6ea102088bfcd92b8865a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/c_target_cuda-openmp_72-c617edf.stdout0000664000175000017500000001463215174404631025717 0ustar alastairalastair#include #include #include #include #include #include #ifdef USE_GPU #include #else #include"cuda_cpu_runtime.h" #endif struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct r32 { float *data; struct dimension_descriptor dims[32]; int32_t n_dims; int32_t offset; bool is_allocated; }; // Implementations #ifdef USE_GPU __global__ #endif void compute_kernel_0(struct r32 *a, struct r32 *b, int i_n) { int i = blockIdx.x * blockDim.x + threadIdx.x + 1; if (i <= i_n) { a->data[((0 + (a->dims[0].stride * (i - a->dims[0].lower_bound))) + a->offset)] = (float)(i) + b->data[((0 + (b->dims[0].stride * (i - b->dims[0].lower_bound))) + b->offset)]*(float)(340); } } #ifndef USE_GPU void compute_kernel_0_wrapper(void **args) { struct r32 *a = *(struct r32**)args[0]; struct r32 *b = *(struct r32**)args[1]; int i_n = *(int*)args[2]; compute_kernel_0(a, b, i_n); } #endif #ifndef USE_GPU void compute_kernel_wrapper(void **args, void *func) { if (func == (void*)compute_kernel_0) { compute_kernel_0_wrapper(args); return; } fprintf(stderr, "Unknown kernel function\n"); exit(1); } #endif int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); int32_t __libasr_index_0_; struct r32 a_value; struct r32* a = &a_value; float *a_data; a->data = a_data; a->n_dims = 1; a->offset = 0; a->dims[0].lower_bound = 1; a->dims[0].length = 0; a->dims[0].stride = 1; struct r32 b_value; struct r32* b = &b_value; float *b_data; b->data = b_data; b->n_dims = 1; b->offset = 0; b->dims[0].lower_bound = 1; b->dims[0].length = 0; b->dims[0].stride = 1; int32_t i; a->n_dims = 1; a->dims[0].lower_bound = 1; a->dims[0].length = 10000000; a->dims[0].stride = 1; a->data = (float*) _lfortran_malloc_alloc(_lfortran_get_default_allocator(), 1*a->dims[0].length*sizeof(float)); a->is_allocated = true; b->n_dims = 1; b->dims[0].lower_bound = 1; b->dims[0].length = 10000000; b->dims[0].stride = 1; b->data = (float*) _lfortran_malloc_alloc(_lfortran_get_default_allocator(), 1*b->dims[0].length*sizeof(float)); b->is_allocated = true; for (__libasr_index_0_=((int32_t)b->dims[1-1].lower_bound); __libasr_index_0_<=((int32_t) b->dims[1-1].length + b->dims[1-1].lower_bound - 1); __libasr_index_0_++) { b->data[((0 + (b->dims[0].stride * (__libasr_index_0_ - b->dims[0].lower_bound))) + b->offset)] = (float)(5); } float *d_a_data = NULL; float *d_b_data = NULL; cudaError_t err; size_t a_data_size = a->dims[0].length * sizeof(float); err = cudaMalloc((void**)&d_a_data, a_data_size); if (err != cudaSuccess) { fprintf(stderr, "cudaMalloc failed for a_data: %s\n", cudaGetErrorString(err)); exit(1); } size_t b_data_size = b->dims[0].length * sizeof(float); err = cudaMalloc((void**)&d_b_data, b_data_size); if (err != cudaSuccess) { fprintf(stderr, "cudaMalloc failed for b_data: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(d_a_data, a->data, a_data_size, cudaMemcpyHostToDevice); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy H2D failed for a_data: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(d_b_data, b->data, b_data_size, cudaMemcpyHostToDevice); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy H2D failed for b_data: %s\n", cudaGetErrorString(err)); exit(1); } struct r32 h_a_copy = *a; h_a_copy.data = d_a_data; struct r32 h_b_copy = *b; h_b_copy.data = d_b_data; struct r32 *d_a_struct = NULL; err = cudaMalloc((void**)&d_a_struct, sizeof(struct r32)); if (err != cudaSuccess) { fprintf(stderr, "cudaMalloc failed for d_a_struct: %s\n", cudaGetErrorString(err)); exit(1); } struct r32 *d_b_struct = NULL; err = cudaMalloc((void**)&d_b_struct, sizeof(struct r32)); if (err != cudaSuccess) { fprintf(stderr, "cudaMalloc failed for d_b_struct: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(d_a_struct, &h_a_copy, sizeof(struct r32), cudaMemcpyHostToDevice); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy H2D failed for d_a_struct: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(d_b_struct, &h_b_copy, sizeof(struct r32), cudaMemcpyHostToDevice); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy H2D failed for d_b_struct: %s\n", cudaGetErrorString(err)); exit(1); } int i_n = 10000000; int threads_per_block = 256; int blocks = (i_n + threads_per_block - 1) / threads_per_block; dim3 grid_dim = {blocks, 1, 1}; dim3 block_dim = {threads_per_block, 1, 1}; void *kernel_args[] = {&d_a_struct, &d_b_struct, &i_n}; err = cudaLaunchKernel((void*)compute_kernel_0, grid_dim, block_dim, kernel_args, 0, NULL); if (err != cudaSuccess) { fprintf(stderr, "cudaLaunchKernel failed: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaDeviceSynchronize(); if (err != cudaSuccess) { fprintf(stderr, "cudaDeviceSynchronize failed: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(a->data, d_a_data, a_data_size, cudaMemcpyDeviceToHost); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy D2H failed for a_data: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(b->data, d_b_data, b_data_size, cudaMemcpyDeviceToHost); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy D2H failed for b_data: %s\n", cudaGetErrorString(err)); exit(1); } cudaFree(d_a_data); cudaFree(d_a_struct); cudaFree(d_b_data); cudaFree(d_b_struct); printf("%f%s%f\n", a->data[((0 + (a->dims[0].stride * (5 - a->dims[0].lower_bound))) + a->offset)], " ", b->data[((0 + (b->dims[0].stride * (5 - b->dims[0].lower_bound))) + b->offset)]); if (a->data[((0 + (a->dims[0].stride * (5 - a->dims[0].lower_bound))) + a->offset)] != (float)(1705)) { fprintf(stderr, "ERROR STOP"); exit(1); } if (b->data[((0 + (b->dims[0].stride * (5 - b->dims[0].lower_bound))) + b->offset)] != (float)(5)) { fprintf(stderr, "ERROR STOP"); exit(1); } return 0; } lfortran-0.63.0/tests/reference/ast-template_nested-35ad81a.json0000664000175000017500000000076715174404631024633 0ustar alastairalastair{ "basename": "ast-template_nested-35ad81a", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_nested.f90", "infile_hash": "b575d8ddebeed199be34078f7dfa99b5995ec81d1e730014775e9f5c", "outfile": null, "outfile_hash": null, "stdout": "ast-template_nested-35ad81a.stdout", "stdout_hash": "6f2e3863407264e4e29a16b1b32598e806ccd0dac6b3389cb967876a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-parameter1-e3995e7.stdout0000664000175000017500000000526215174404631024027 0ustar alastairalastair(TranslationUnit [(Subroutine dcstep [] [] () () [] [] [] [(Declaration (AttrType TypeDoublePrecision [] () () None ) [] [(zero [] [] () () None ()) (p66 [] [] () () None ()) (two [] [] () () None ()) (three [] [] () () None ()) (s [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrParameter )] [(zero [] [] () (Real "0.0d0") Equal ()) (p66 [] [] () (Real "0.66d0") Equal ()) (two [] [] () (Real "2.0d0") Equal ()) (three [] [] () (Real "3.0d0") Equal ())] () )] [(Assignment 0 s (FuncCallOrArray max [] [(() (FuncCallOrArray abs [] [(() three () 0)] [] [] [] ) () 0) (() (FuncCallOrArray abs [] [(() two () 0)] [] [] [] ) () 0) (() (FuncCallOrArray abs [] [(() p66 () 0)] [] [] [] ) () 0)] [] [] [] ) () )] [] [] )] ) lfortran-0.63.0/tests/reference/run-print_intrinsics-9b076f7.stdout0000664000175000017500000000013015174404631025363 0ustar alastairalastairpi=acos(-1.0_sp) =" 3.14159274 " pi=acos(-1.0_dp) =" 3.1415926535897931 " lfortran-0.63.0/tests/reference/asr-arrays_107-d961168.stderr0000664000175000017500000000067615174404631023551 0ustar alastairalastairsemantic error: Passing a scalar argument to an array dummy argument is not allowed. Use --legacy-array-sections to enable sequence association --> tests/../integration_tests/arrays_107.f90:4:18 | 4 | call testsub(x(1, 1)) | ^^^^^^^ scalar argument | 9 | subroutine testsub(x) | ^^^^^^^^^^^^^^^^^^^^^... ... | 12 | end subroutine testsub | ...^^^^^^^^^^^^^^^^^^^^^^^^^^ array dummy argument lfortran-0.63.0/tests/reference/obj-valid_array_assignment_same_length_different_start-9ec7ffc.json0000664000175000017500000000073615174404631034153 0ustar alastairalastair{ "basename": "obj-valid_array_assignment_same_length_different_start-9ec7ffc", "cmd": "lfortran --no-color -c {infile} -o output.o", "infile": "tests/../integration_tests/valid_array_assignment_same_length_different_start.f90", "infile_hash": "21b0a7101b9336ee2eded7884da2046247ffa00ddacad8003ce71fef", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-format_02-3deee60.json0000664000175000017500000000076015174404631024003 0ustar alastairalastair{ "basename": "ast_f90-format_02-3deee60", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/format_02.f90", "infile_hash": "dcd9a1c68ffaff4df93d7299219c47741479f92da85570eb771f05b3", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-format_02-3deee60.stdout", "stdout_hash": "2ac160dca83be0ef10e8016e9b55c05325da2d2065f62eeaf21d6059", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-continue_compilation_1-04b6d40.stderr0000664000175000017500000015727015174404631026367 0ustar alastairalastairsemantic error: `function` attribute of 'frexp' conflicts with `subroutine` attribute --> tests/errors/continue_compilation_1.f90:53:5 - 57:24 | 53 | subroutine frexp(x,n) | ^^^^^^^^^^^^^^^^^^^^^... ... | 57 | end subroutine frexp | ...^^^^^^^^^^^^^^^^^^^^^^^^ declared as subroutine here | 45 | function frexp(x,n) result(r) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... ... | 49 | end function frexp | ...~~~~~~~~~~~~~~~~~~~~~~ previously declared as function here semantic error: Derived type `another_undefined_type` is not defined --> tests/errors/continue_compilation_1.f90:79:9 | 79 | type(another_undefined_type) :: s3_in_subroutine | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type used here is not defined in any scope semantic error: c_char should have a length of 1 --> tests/errors/continue_compilation_1.f90:103:9 | 103 | character(len=2, kind=c_char), intent(in) :: c | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Dummy argument 'c' not defined --> tests/errors/continue_compilation_1.f90:101:5 - 104:20 | 101 | subroutine s(c) bind(c) | ^^^^^^^^^^^^^^^^^^^^^^^... ... | 104 | end subroutine s | ...^^^^^^^^^^^^^^^^^^^^ semantic error: Assumed-size '*' is only permitted in the last dimension --> tests/errors/continue_compilation_1.f90:117:31 | 117 | real, intent(in) :: a(*, 10) | ^ semantic error: Dummy argument 'a' not defined --> tests/errors/continue_compilation_1.f90:116:5 - 118:18 | 116 | subroutine assumed_size_star_pos_1(a) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 118 | end subroutine | ...^^^^^^^^^^^^^^^^^^ semantic error: Assumed-size '*' is only permitted in the last dimension --> tests/errors/continue_compilation_1.f90:121:19 | 121 | real :: a(*, 10) | ^ semantic error: Dummy argument 'a' not defined --> tests/errors/continue_compilation_1.f90:120:5 - 122:18 | 120 | subroutine assumed_size_star_pos_2(a) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 122 | end subroutine | ...^^^^^^^^^^^^^^^^^^ warning: non-standard Fortran 77-style initialization (extension) --> tests/errors/continue_compilation_1.f90:162:27 | 162 | enumerator :: red/1/ | ^^^^^^ Use modern syntax instead: integer :: red = 1 warning: non-standard Fortran 77-style initialization (extension) --> tests/errors/continue_compilation_1.f90:164:32 | 164 | type(MyClass), save :: slash_x/MyClass(1)/ | ^^^^^^^^^^^^^^^^^^^ Use modern syntax instead: integer :: slash_x = MyClass(1) warning: non-standard Fortran 77-style initialization (extension) --> tests/errors/continue_compilation_1.f90:165:26 | 165 | integer, save :: slash_y/2/ | ^^^^^^^^^^ Use modern syntax instead: integer :: slash_y = 2 semantic error: Procedure declarations without an explicit interface (procedure()) are not yet supported. Please use procedure(interface_name) or declare an interface block. --> tests/errors/continue_compilation_1.f90:179:9 | 179 | procedure(), pointer :: pf1 | ^^^^^^^^^^^ semantic error: Procedure 'op_clash_f' is already defined as an interface body --> tests/errors/continue_compilation_1.f90:186:5 - 190:27 | 186 | function op_clash_f(x) result(y) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 190 | end function op_clash_f | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 35 | function op_clash_f(x) result(y) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... ... | 38 | end function | ...~~~~~~~~~~~~~~~~~~~~ is already defined here semantic error: Defined assignment procedure must not return a value --> tests/errors/continue_compilation_1.f90:141:5 - 145:32 | 141 | integer function assign_func_bad(lhs, rhs) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 145 | end function assign_func_bad | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Defined assignment procedure must have exactly two arguments --> tests/errors/continue_compilation_1.f90:147:5 - 149:37 | 147 | subroutine assign_wrong_nargs(lhs) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 149 | end subroutine assign_wrong_nargs | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: First argument of defined assignment must have INTENT(OUT) or INTENT(INOUT) --> tests/errors/continue_compilation_1.f90:151:5 - 154:33 | 151 | subroutine assign_bad_lhs(lhs, rhs) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 154 | end subroutine assign_bad_lhs | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Second argument of defined assignment must have INTENT(IN) --> tests/errors/continue_compilation_1.f90:156:5 - 159:33 | 156 | subroutine assign_bad_rhs(lhs, rhs) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 159 | end subroutine assign_bad_rhs | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Interface 'f_missing' is referenced but not defined --> tests/errors/continue_compilation_1.f90:22:9 | 22 | procedure(f_missing), pointer, nopass :: fn => null() | ^^^^^^^^^^^^^^^^^^^^ Referenced here semantic error: Interface 'missing_global_interface' is referenced but not defined --> tests/errors/continue_compilation_1.f90:25:5 | 25 | procedure(missing_global_interface), pointer :: p => null() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Referenced here semantic error: Interface 'sub_test' is referenced but not defined --> tests/errors/continue_compilation_1.f90:182:9 | 182 | procedure(sub_test), pointer :: pf2 | ^^^^^^^^^^^^^^^^^^^ Referenced here semantic error: Implicit typing is not allowed, enable it by using --implicit-typing --> tests/errors/continue_compilation_1.f90:210:5 - 212:49 | 210 | implicit integer(a-f), real(e-z) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 212 | ! Put declarations below without empty lines | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: arguments of `repeat` intrinsic must be scalar --> tests/errors/continue_compilation_1.f90:233:38 | 233 | character(3), parameter :: ar1 = repeat(["abc", "#^1", "123"], [1, 2, 3]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Cannot convert LOGICAL to REAL --> tests/errors/continue_compilation_1.f90:236:20 | 236 | real :: adwf = .true. | ^^^^^^ semantic error: Symbol is already declared in the same scope --> tests/errors/continue_compilation_1.f90:240:31 | 240 | integer , dimension(3) :: array | ^^^^^ redeclaration | 239 | double precision array | ~~~~~ original declaration semantic error: Array members must me of the same type as the struct --> tests/errors/continue_compilation_1.f90:244:53 | 244 | type(MyClass), parameter :: myclass_array(2) = [1, MyClass(10)] | ^ semantic error: Initialization of `myclass_array2` must reduce to a compile time constant. --> tests/errors/continue_compilation_1.f90:245:66 | 245 | type(MyClass), parameter :: myclass_array2(2) = [MyClass(1), MyClass(q1)] | ^^^^^^^^^^^ semantic error: Syntax error in CHARACTER declaration: only 'len' and 'kind' are allowed as type parameters --> tests/errors/continue_compilation_1.f90:246:5 | 246 | character(width=10) :: str_c_1 | ^^^^^^^^^^^^^^^^^^^ semantic error: Syntax error in CHARACTER declaration: can't use a keyword argument more than once --> tests/errors/continue_compilation_1.f90:247:5 | 247 | character(len=10, len=20) :: str_c_2 | ^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Syntax error in CHARACTER declaration: positional type parameters cannot follow a keyword argument --> tests/errors/continue_compilation_1.f90:248:5 | 248 | character(len=10, 1) :: str_c_3 | ^^^^^^^^^^^^^^^^^^^^ semantic error: Syntax error in CHARACTER declaration: using only 'len' keyword argument after a positional type is invalid --> tests/errors/continue_compilation_1.f90:249:5 | 249 | character(1, len=20) :: str_c_4 | ^^^^^^^^^^^^^^^^^^^^ semantic error: Allocatable array 'x' must have a deferred shape or assumed rank --> tests/errors/continue_compilation_1.f90:250:34 | 250 | character(:), allocatable :: x(2) | ^^^^ semantic error: Expecting a scalar integer or parameter annotated integer variable --> tests/errors/continue_compilation_1.f90:252:26 | 252 | logical :: mask_size(size(arr_size)) | ^^^^^^^^^^^^^^ semantic error: `protected` attribute is only allowed in specification part of a module --> tests/errors/continue_compilation_1.f90:253:5 | 253 | integer, protected :: protected_attr_var | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `protected` attribute is only allowed in specification part of a module --> tests/errors/continue_compilation_1.f90:254:5 | 254 | integer, parameter, protected :: protected_parameter_var | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Variable `n` cannot appear in the expression as it is not a constant --> tests/errors/continue_compilation_1.f90:259:27 | 259 | integer :: elements(n) | ^ semantic error: Derived type `bspline_3d` is not defined --> tests/errors/continue_compilation_1.f90:261:5 | 261 | type(bspline_3d) :: s3_in_program | ^^^^^^^^^^^^^^^^ Type used here is not defined in any scope semantic error: BOZ literal constant cannot be used in binary operations --> tests/errors/continue_compilation_1.f90:263:19 | 263 | integer::tt = b'01' * 3 | ^^^^^^^^^ semantic error: An 'allocatable' variable cannot have an initialization expression --> tests/errors/continue_compilation_1.f90:265:29 | 265 | integer, allocatable :: allocate_int = 1 | ^^^^^^^^^^^^^^^^ semantic error: An 'allocatable' variable cannot have an initialization expression --> tests/errors/continue_compilation_1.f90:266:34 | 266 | character(:), allocatable :: allocate_char = "H" | ^^^^^^^^^^^^^^^^^^^ semantic error: Transformational intrinsic is not permitted in an initialization expression --> tests/errors/continue_compilation_1.f90:270:42 | 270 | integer, parameter :: param_minloc = minloc(param_arr, 1, [.false., .false., .false.]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Variable `uninitialized_param_local` with parameter attribute is not initialised --> tests/errors/continue_compilation_1.f90:278:5 | 278 | type(MyClass), parameter :: uninitialized_param_local | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Symbol not found: `non_existent_symbol` --> tests/errors/continue_compilation_1.f90:279:5 | 279 | type(MyClass) :: err_obj1 = non_existent_symbol | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Named initialization not supported with: my_func --> tests/errors/continue_compilation_1.f90:280:5 | 280 | type(MyClass) :: err_obj2 = my_func | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Initialization with non-constant variable `non_parameter_var` is not allowed --> tests/errors/continue_compilation_1.f90:282:5 | 282 | type(MyClass) :: err_obj3 = non_parameter_var | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 281 | integer :: non_parameter_var = 5 | ~~~~~~~~~~~~~~~~~~~~~ declared here semantic error: Named initialization with array parameter `myclass_array` is not supported yet --> tests/errors/continue_compilation_1.f90:283:5 | 283 | type(MyClass) :: err_obj4 = myclass_array | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 244 | type(MyClass), parameter :: myclass_array(2) = [1, MyClass(10)] | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ array parameter declared here semantic error: Symbol not found: `uninitialized_param_local` --> tests/errors/continue_compilation_1.f90:284:5 | 284 | type(MyClass) :: err_obj5 = uninitialized_param_local | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: CLASS variable 'inst_tt' must be dummy, allocatable or pointer --> tests/errors/continue_compilation_1.f90:295:5 | 295 | class(type_t) :: inst_tt | ^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Result of `erfc` underflows its kind --> tests/errors/continue_compilation_1.f90:296:40 | 296 | real(8), parameter :: erfc_param = erfc(40.12_8) | ^^^^^^^^^^^^^ semantic error: Contiguous attribute can only be applied to declared variables --> tests/errors/continue_compilation_1.f90:298:19 | 298 | contiguous :: contig_not_declared | ^^^^^^^^^^^^^^^^^^^ semantic error: Contiguous attribute can only be applied to variables --> tests/errors/continue_compilation_1.f90:299:19 | 299 | contiguous :: MyClass | ^^^^^^^ semantic error: Intent attribute can only be applied to procedure arguments --> tests/errors/continue_compilation_1.f90:614:14 | 614 | integer, intent(out) :: out_intent | ^^^^^^^^^^^ semantic error: Intent attribute can only be applied to procedure arguments --> tests/errors/continue_compilation_1.f90:615:14 | 615 | integer, intent(in) :: in_intent | ^^^^^^^^^^ semantic error: Parameterized derived type 'container' parameter 'ik' has no default value and must be specified --> tests/errors/continue_compilation_1.f90:626:5 | 626 | type(container(4)) :: obj1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Parameterized derived type 'container' parameter 'rk' has no default value and must be specified --> tests/errors/continue_compilation_1.f90:627:5 | 627 | type(container) :: obj2 | ^^^^^^^^^^^^^^^^^^^^^^^ semantic error: The shapes of the `array` and `mask` arguments of the `MinLoc` intrinsic must be the same --> tests/errors/continue_compilation_1.f90:630:47 | 630 | integer :: minloc_shape_mismatch = minloc([2, 1, 3], 1, [.true., .false.]) | ^^^^^^^^^ ^^^^^^^^^^^^^^^^^ `array` has shape [3], but `mask` has shape [2] semantic error: The shapes of the `array` and `mask` arguments of the `MaxLoc` intrinsic must be the same --> tests/errors/continue_compilation_1.f90:631:47 | 631 | integer :: maxloc_shape_mismatch = maxloc([2, 1, 3], 1, [.true., .false.]) | ^^^^^^^^^ ^^^^^^^^^^^^^^^^^ `array` has shape [3], but `mask` has shape [2] semantic error: variable cannot appear in character length expression --> tests/errors/continue_compilation_1.f90:638:21 | 638 | character(len = char_len_var) :: char_nonconst | ^^^^^^^^^^^^ semantic error: type mismatch in initialization: `string` cannot be assigned to `integer` --> tests/errors/continue_compilation_1.f90:643:32 | 643 | integer, parameter :: n2 = "abc" | ^^^^^ semantic error: Pointer initialization target `ptr_src_no_target` must have the `target` attribute --> tests/errors/continue_compilation_1.f90:645:5 | 645 | type(MyClass), pointer :: ptr_requires_target => ptr_src_no_target | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 644 | type(MyClass) :: ptr_src_no_target | ~~~~~~~~~~~~~~~~~ declared here semantic error: Type mismatch in pointer initialization of `ptr_type_mismatch` --> tests/errors/continue_compilation_1.f90:647:5 | 647 | type(MyClass), pointer :: ptr_type_mismatch => ptr_tgt_base | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 646 | type(Base), target :: ptr_tgt_base | ~~~~~~~~~~~~ target declared here semantic error: Cannot convert LOGICAL to REAL --> tests/errors/continue_compilation_1.f90:684:24 | 684 | real :: adwf = .true. | ^^^^^^ warning: Assuming implicit save attribute for variable declaration --> tests/errors/continue_compilation_1.f90:688:23 | 688 | integer(4) :: arr1(3) = [2471095, 820012001, 39024800] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement semantic error: Symbol 'undeclared_proc' not declared --> tests/errors/continue_compilation_1.f90:640:9 | 640 | module procedure undeclared_proc ! {Error} Symbol 'undeclared_proc' not declared | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: The upper bound of an assumed-size array's last dimension is not defined --> tests/errors/continue_compilation_1.f90:111:18 | 111 | print *, ubound(a, 1) | ^^^^^^^^^^^^ semantic error: The DIM argument must be present when calling UBOUND on an assumed-size array --> tests/errors/continue_compilation_1.f90:112:18 | 112 | print *, ubound(b) | ^^^^^^^^^ semantic error: The upper bound of an assumed-size array's last dimension is not defined --> tests/errors/continue_compilation_1.f90:113:18 | 113 | print *, ubound(c, 2) | ^^^^^^^^^^^^ semantic error: Character intrinsic 'trim' with class(*) argument must be inside 'type is (character(len=*))' guard --> tests/errors/continue_compilation_1.f90:135:18 | 135 | print *, trim(generic) | ^^^^^^^^^^^^^ invalid use of character intrinsic with polymorphic argument semantic error: Character intrinsic 'adjustl' with class(*) argument must be inside 'type is (character(len=*))' guard --> tests/errors/continue_compilation_1.f90:136:18 | 136 | print *, adjustl(generic) | ^^^^^^^^^^^^^^^^ invalid use of character intrinsic with polymorphic argument semantic error: Character intrinsic 'adjustr' with class(*) argument must be inside 'type is (character(len=*))' guard --> tests/errors/continue_compilation_1.f90:137:18 | 137 | print *, adjustr(generic) | ^^^^^^^^^^^^^^^^ invalid use of character intrinsic with polymorphic argument semantic error: Character intrinsic 'len_trim' with class(*) argument must be inside 'type is (character(len=*))' guard --> tests/errors/continue_compilation_1.f90:138:18 | 138 | print *, len_trim(generic) | ^^^^^^^^^^^^^^^^^ invalid use of character intrinsic with polymorphic argument semantic error: Variable 'pf1' is not declared --> tests/errors/continue_compilation_1.f90:180:9 | 180 | pf1 => dummy_sub | ^^^ 'pf1' is undeclared semantic error: Interface mismatch in procedure pointer assignment at (1): 'dummy_func' is not a subroutine --> tests/errors/continue_compilation_1.f90:183:9 | 183 | pf2 => dummy_func | ^^^^^^^^^^^^^^^^^ (1) semantic error: Intrinsic 'not_real' is not recognized --> tests/errors/continue_compilation_1.f90:268:14 | 268 | call sub(not_real) | ^^^^^^^^ 'not_real' is not a known intrinsic function semantic error: Array index 10 is out of bounds (1 to 3) in dimension 1 --> tests/errors/continue_compilation_1.f90:328:14 | 328 | print *, a(10) | ^^^^^ semantic error: Assignment to loop variable `i` is not allowed --> tests/errors/continue_compilation_1.f90:335:8 | 335 | i = i + 1 | ^ semantic error: first argument of `maskl` must be less than or equal to the BIT_SIZE of INTEGER(KIND=4) --> tests/errors/continue_compilation_1.f90:339:13 | 339 | print*, maskl(63) | ^^^^^^^^^ semantic error: first argument of `maskr` must be less than or equal to the BIT_SIZE of INTEGER(KIND=4) --> tests/errors/continue_compilation_1.f90:341:13 | 341 | print*, maskr(63) | ^^^^^^^^^ semantic error: first argument of `maskl` must be nonnegative --> tests/errors/continue_compilation_1.f90:343:13 | 343 | print*, maskl(-24) | ^^^^^^^^^^ semantic error: first argument of `maskr` must be nonnegative --> tests/errors/continue_compilation_1.f90:345:13 | 345 | print*, maskr(-24) | ^^^^^^^^^^ semantic error: The argument `matrix_a` in `matmul` must be of type Integer, Real, Complex or Logical --> tests/errors/continue_compilation_1.f90:347:21 | 347 | print *, matmul(a1, b1) | ^^ semantic error: The argument `matrix_b` in `matmul` must be of type Integer, Real or Complex if first matrix is of numeric type --> tests/errors/continue_compilation_1.f90:349:25 | 349 | print *, matmul(b1, a1) | ^^ semantic error: The `matmul` intrinsic doesn't handle logical type yet --> tests/errors/continue_compilation_1.f90:351:14 | 351 | print *, matmul(a2, b1) | ^^^^^^^^^^^^^^ semantic error: `matmul` accepts arrays of rank 1 or 2 only, provided an array with rank, 3 --> tests/errors/continue_compilation_1.f90:353:21 | 353 | print *, matmul(a3, b1) | ^^ semantic error: `matmul` accepts arrays of rank 1 or 2 only, provided an array with rank, 4 --> tests/errors/continue_compilation_1.f90:355:25 | 355 | print *, matmul(b1, b4) | ^^ semantic error: The argument `matrix_b` in `matmul` must be of rank 2, provided an array with rank, 1 --> tests/errors/continue_compilation_1.f90:357:24 | 357 | print *, matmul(a, b) | ^ semantic error: `transpose` accepts arrays of rank 2 only, provided an array with rank, 1 --> tests/errors/continue_compilation_1.f90:359:24 | 359 | print *, transpose(a) | ^ semantic error: Kind of all the arguments of Mergebits must be the same --> tests/errors/continue_compilation_1.f90:361:14 | 361 | print *, merge_bits(8, 12_8, 2) | ^^^^^^^^^^^^^^^^^^^^^^ semantic error: Kind of all the arguments of Mergebits must be the same --> tests/errors/continue_compilation_1.f90:363:14 | 363 | print *, merge_bits(a5, b5, c5) | ^^^^^^^^^^^^^^^^^^^^^^ semantic error: Second argument of modulo cannot be 0 --> tests/errors/continue_compilation_1.f90:379:14 | 379 | print *, modulo(1, 0) | ^^^^^^^^^^^^ semantic error: Procedure 'my_func' accepts 2 arguments, but 3 were provided --> tests/errors/continue_compilation_1.f90:381:5 | 381 | call my_func(y=1, x=2, z=1) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of arguments to 'my_func' semantic error: Result of `nint` overflows its kind(4) --> tests/errors/continue_compilation_1.f90:384:13 | 384 | print*, nint(1e12_8) | ^^^^^^^^^^^^ semantic error: Result of `nint` overflows its kind(4) --> tests/errors/continue_compilation_1.f90:385:13 | 385 | print*, nint(1000000000000.0000000000000000d0) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Invalid argument `hello` supplied --> tests/errors/continue_compilation_1.f90:387:5 | 387 | OPEN(file="numbers", hello="world") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Cannot assign to a constant variable --> tests/errors/continue_compilation_1.f90:389:5 | 389 | i1 = 3 | ^^^^^^ assignment here | 219 | integer, parameter :: i1 = 2 | ~~~~~~ declared as constant semantic error: Expected 0 or 1 arguments, got 2 arguments instead. --> tests/errors/continue_compilation_1.f90:391:5 | 391 | call FLUSH(1, 2) | ^^^^^^^^^^^^^^^^ semantic error: `kind` argument of `verify` intrinsic must be a scalar --> tests/errors/continue_compilation_1.f90:393:39 | 393 | print*, verify(string, set, kind= [4, 4] ) | ^^^^^^ semantic error: arguments of `and` intrinsic must be scalar --> tests/errors/continue_compilation_1.f90:394:14 | 394 | print *, and([1, 2, 3], [1, 2, 3]) | ^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: The shift argument of 'dshiftl' intrinsic must be less than or equal to the bit size of the integer --> tests/errors/continue_compilation_1.f90:396:28 | 396 | print *, dshiftl(1, 2, 34) | ^^ semantic error: The shift argument of 'dshiftl' intrinsic must be non-negative integer --> tests/errors/continue_compilation_1.f90:397:28 | 397 | print *, dshiftl(1, 2, -2) | ^^ semantic error: The shift argument of 'dshiftr' intrinsic must be less than or equal to the bit size of the integer --> tests/errors/continue_compilation_1.f90:399:28 | 399 | print *, dshiftr(1, 2, 34) | ^^ semantic error: The shift argument of 'dshiftr' intrinsic must be non-negative integer --> tests/errors/continue_compilation_1.f90:400:28 | 400 | print *, dshiftr(1, 2, -2) | ^^ semantic error: arguments of `selected_int_kind` intrinsic must be scalar --> tests/errors/continue_compilation_1.f90:402:14 | 402 | print *, selected_int_kind([1,2,3]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: arguments of `selected_real_kind` intrinsic must be scalar --> tests/errors/continue_compilation_1.f90:403:14 | 403 | print *, selected_real_kind([1,2,3]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: arguments of `selected_char_kind` intrinsic must be scalar --> tests/errors/continue_compilation_1.f90:404:14 | 404 | print *, selected_char_kind(['c', 'a', 'b']) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `dim` argument of the `Sum` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:413:30 | 413 | print *, sum(arr1, dim = 2) | ^ Must have 0 < dim <= 1 for array of rank 1 semantic error: `dim` argument of the `Sum` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:414:30 | 414 | print *, sum(arr1, dim = -1) | ^^ Must have 0 < dim <= 1 for array of rank 1 semantic error: `dim` argument of the `Sum` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:415:44 | 415 | print *, sum(arr1, mask = mask1, dim = 2) | ^ Must have 0 < dim <= 1 for array of rank 1 semantic error: `dim` argument of the `Sum` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:416:44 | 416 | print *, sum(arr1, mask = mask1, dim = -1) | ^^ Must have 0 < dim <= 1 for array of rank 1 semantic error: `dim` argument of the `Product` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:418:34 | 418 | print *, product(arr2, dim = 3) | ^ Must have 0 < dim <= 2 for array of rank 2 semantic error: `dim` argument of the `Product` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:419:34 | 419 | print *, product(arr2, dim = -1) | ^^ Must have 0 < dim <= 2 for array of rank 2 semantic error: `dim` argument of the `Product` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:420:48 | 420 | print *, product(arr2, mask = mask2, dim = 3) | ^ Must have 0 < dim <= 2 for array of rank 2 semantic error: `dim` argument of the `Product` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:421:48 | 421 | print *, product(arr2, mask = mask2, dim = -1) | ^^ Must have 0 < dim <= 2 for array of rank 2 semantic error: `dim` argument of the `Iparity` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:423:34 | 423 | print *, iparity(arr3, dim = 4) | ^ Must have 0 < dim <= 3 for array of rank 3 semantic error: `dim` argument of the `Iparity` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:424:34 | 424 | print *, iparity(arr3, dim = -1) | ^^ Must have 0 < dim <= 3 for array of rank 3 semantic error: `dim` argument of the `Iparity` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:425:48 | 425 | print *, iparity(arr3, mask = mask3, dim = 4) | ^ Must have 0 < dim <= 3 for array of rank 3 semantic error: `dim` argument of the `Iparity` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:426:48 | 426 | print *, iparity(arr3, mask = mask3, dim = -1) | ^^ Must have 0 < dim <= 3 for array of rank 3 semantic error: Expected logical expression in if statement, but recieved integer(4) instead --> tests/errors/continue_compilation_1.f90:428:9 | 428 | if (q1) q1 = 1 | ^^ integer(4) expression, expected logical semantic error: Expected logical expression in if statement, but recieved real(4) instead --> tests/errors/continue_compilation_1.f90:429:9 | 429 | if (r1) r1 = 1.0 | ^^ real(4) expression, expected logical semantic error: Expected logical expression in if statement, but recieved string instead --> tests/errors/continue_compilation_1.f90:430:9 | 430 | if (c1) c1 = 'a' | ^^ string expression, expected logical semantic error: The ranks of the `array` and `mask` arguments of the `Sum` intrinsic must be the same --> tests/errors/continue_compilation_1.f90:435:18 | 435 | print *, sum(arr1, mask2) | ^^^^ ^^^^^ `array` is rank 1, but `mask` is rank 2 semantic error: `dim` argument of `Sum` intrinsic must be INTEGER --> tests/errors/continue_compilation_1.f90:436:24 | 436 | print *, sum(arr2, mask3, 2) | ^^^^^ semantic error: The shapes of the `array` and `mask` arguments of the `Iparity` intrinsic must be the same --> tests/errors/continue_compilation_1.f90:437:22 | 437 | print *, iparity(arr2, mask4) | ^^^^ ^^^^^ `array` has shape [2,3], but `mask` has shape [3,2] semantic error: `dim` argument of `Iparity` intrinsic must be INTEGER --> tests/errors/continue_compilation_1.f90:438:28 | 438 | print *, iparity(arr3, mask5, 3) | ^^^^^ semantic error: Argument to 'present' must be a variable, but got an expression --> tests/errors/continue_compilation_1.f90:441:22 | 441 | print *, present(a + 1) | ^^^^^ Expected a variable here semantic error: Argument to 'present' must be an optional dummy argument --> tests/errors/continue_compilation_1.f90:444:22 | 444 | print *, present(a) | ^ This variable is not 'optional' semantic error: Different shape for arguments `array` and `mask` for pack intrinsic (3 and 4) --> tests/errors/continue_compilation_1.f90:446:30 | 446 | print *, pack([1, 2, 3], [.true., .true., .true., .true.]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: reshape accepts arrays for `source` argument, found string instead. --> tests/errors/continue_compilation_1.f90:448:22 | 448 | print *, reshape("hello", [2, 3]) | ^^^^^^^ semantic error: reshape accepts arrays for `source` argument, found logical instead. --> tests/errors/continue_compilation_1.f90:449:22 | 449 | print *, reshape(.true., [2, 3]) | ^^^^^^ semantic error: reshape accepts arrays for `shape` argument, found string instead. --> tests/errors/continue_compilation_1.f90:450:36 | 450 | print *, reshape([1, 2, 3, 4], "hello") | ^^^^^^^ semantic error: reshape accepts arrays for `shape` argument, found logical instead. --> tests/errors/continue_compilation_1.f90:451:36 | 451 | print *, reshape([1, 2, 3, 4], .false.) | ^^^^^^^ semantic error: reshape accepts `source` array with size greater than or equal to size specified by `shape` array --> tests/errors/continue_compilation_1.f90:453:14 | 453 | print *, reshape([1, 2, 3, 4], [2, 3]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `shape` specifies size of 6 which exceeds the `source` array size of 4 semantic error: Division by zero --> tests/errors/continue_compilation_1.f90:456:14 | 456 | print *, 1/0 | ^^^ semantic error: Division by zero --> tests/errors/continue_compilation_1.f90:457:14 | 457 | print *, x/zero | ^^^^^^ semantic error: Type mismatch in binary operator, the types must be compatible --> tests/errors/continue_compilation_1.f90:458:14 | 458 | print *, v**str | ^ ^^^ type mismatch (real and string) semantic error: Type mismatch in binary operator, the types must be compatible --> tests/errors/continue_compilation_1.f90:459:14 | 459 | print *, str**v | ^^^ ^ type mismatch (string and real) semantic error: The shift argument of 'shiftl' intrinsic must be less than or equal to the bit size of the integer --> tests/errors/continue_compilation_1.f90:461:24 | 461 | print *, shiftl(2, 34) | ^^ Shift value is 34, but bit size of integer is 32 semantic error: The shift argument of 'shiftl' intrinsic must be non-negative integer --> tests/errors/continue_compilation_1.f90:462:24 | 462 | print *, shiftl(2, -3) | ^^ semantic error: The shift argument of 'shiftr' intrinsic must be less than or equal to the bit size of the integer --> tests/errors/continue_compilation_1.f90:463:24 | 463 | print *, shiftr(2, 34) | ^^ Shift value is 34, but bit size of integer is 32 semantic error: The shift argument of 'shiftr' intrinsic must be non-negative integer --> tests/errors/continue_compilation_1.f90:464:24 | 464 | print *, shiftr(2, -3) | ^^ semantic error: The shift argument of 'rshift' intrinsic must be less than or equal to the bit size of the integer --> tests/errors/continue_compilation_1.f90:465:24 | 465 | print *, rshift(2, 34) | ^^ Shift value is 34, but bit size of integer is 32 semantic error: The shift argument of 'rshift' intrinsic must be non-negative integer --> tests/errors/continue_compilation_1.f90:466:24 | 466 | print *, rshift(2, -3) | ^^ semantic error: Input to `Sum` is expected to be numeric, but got string[:] --> tests/errors/continue_compilation_1.f90:468:18 | 468 | print *, sum([c1]) | ^^^^ must be integer, real or complex type semantic error: Input to `Product` is expected to be numeric, but got string[:] --> tests/errors/continue_compilation_1.f90:469:22 | 469 | print *, product([c1]) | ^^^^ must be integer, real or complex type semantic error: Input to `MinVal` is expected to be of integer, real or character type, but got complex[:] --> tests/errors/continue_compilation_1.f90:470:21 | 470 | print *, minval([c]) | ^^^ must be integer, real or character type semantic error: Input to `MaxVal` is expected to be of integer, real or character type, but got complex[:] --> tests/errors/continue_compilation_1.f90:471:21 | 471 | print *, maxval([c]) | ^^^ must be integer, real or character type semantic error: Argument to intrinsic `Sum` is expected to be an array, found: integer --> tests/errors/continue_compilation_1.f90:473:14 | 473 | print *, sum(q1) | ^^^^^^^ semantic error: Argument to intrinsic `Product` is expected to be an array, found: real --> tests/errors/continue_compilation_1.f90:474:14 | 474 | print *, product(r1) | ^^^^^^^^^^^ semantic error: Argument to intrinsic `MinVal` is expected to be an array, found: integer --> tests/errors/continue_compilation_1.f90:475:14 | 475 | print *, minval(q1) | ^^^^^^^^^^ semantic error: Argument to intrinsic `MaxVal` is expected to be an array, found: real --> tests/errors/continue_compilation_1.f90:476:14 | 476 | print *, maxval(r1) | ^^^^^^^^^^ semantic error: 'mask' argument of 'sum' intrinsic must be logical --> tests/errors/continue_compilation_1.f90:478:14 | 478 | print *, sum([1, 2, 3], mask = [1, 2, 3]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_1.f90:479:5 | 479 | z1 = y | ^^ ^ type mismatch (real and logical) semantic error: reshape accepts arrays for `pad` argument, found integer instead. --> tests/errors/continue_compilation_1.f90:481:50 | 481 | print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], 0) | ^ semantic error: reshape accepts arrays for `order` argument, found integer instead. --> tests/errors/continue_compilation_1.f90:482:55 | 482 | print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], [0], 0) | ^ semantic error: `pad` argument of reshape intrinsic must have same type and kind as `source` argument, found pad type real(4) source type integer(4) instead. --> tests/errors/continue_compilation_1.f90:483:50 | 483 | print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], [1.2]) | ^^^^^ semantic error: `pad` argument of reshape intrinsic must have same type and kind as `source` argument, found pad type integer(8) source type integer(4) instead. --> tests/errors/continue_compilation_1.f90:484:50 | 484 | print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], [0_8]) | ^^^^^ semantic error: reshape accepts `order` array with integer elements --> tests/errors/continue_compilation_1.f90:486:58 | 486 | print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], order = [1.0, 2.0]) | ^^^^^^^^^^ semantic error: reshape accepts `order` array as a permutation of elements from 1 to 2 --> tests/errors/continue_compilation_1.f90:487:58 | 487 | print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], order = [2, 3]) | ^^^^^^ semantic error: `mask` argument to `count` intrinsic must be a logical array --> tests/errors/continue_compilation_1.f90:489:20 | 489 | print *, count(1) | ^ semantic error: `mask` argument to `count` intrinsic must be a logical array --> tests/errors/continue_compilation_1.f90:490:20 | 490 | print *, count([2]) | ^^^ semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_1.f90:492:5 | 492 | a_real = [logical::] | ^^^^^^ ^^^^^^^^^^^ type mismatch (real[:] and logical[:]) semantic error: Input to `Iparity` is expected to be an integer, but got string[:] --> tests/errors/continue_compilation_1.f90:495:22 | 495 | print *, iparity(["a", "b"]) | ^^^^^^^^^^ must be of integer type semantic error: The `mask` argument to `parity` must be logical, but got string[:] --> tests/errors/continue_compilation_1.f90:496:21 | 496 | print *, parity(["a", "b"]) | ^^^^^^^^^^ must be logical type semantic error: `shape` array in reshape intrinsic should be of constant size --> tests/errors/continue_compilation_1.f90:499:30 | 499 | matrix = reshape(source, shape_, pad=[0]) | ^^^^^^ not a constant size array semantic error: Incompatible ranks 2 and 1 in assignment --> tests/errors/continue_compilation_1.f90:499:5 | 499 | matrix = reshape(source, shape_, pad=[0]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Complex variable 'c' only has %re, %im, and %kind members, not 'mymember' --> tests/errors/continue_compilation_1.f90:504:14 | 504 | print *, c%mymember | ^^^^^^^^^^ semantic error: Character variable 'c1' only has %len and %kind members, not 'mymember' --> tests/errors/continue_compilation_1.f90:506:14 | 506 | print *, c1%mymember | ^^^^^^^^^^^ semantic error: Incorrect number of arguments passed to the 'present' intrinsic. It accepts exactly 1 arguments. --> tests/errors/continue_compilation_1.f90:508:14 | 508 | print *, present(x,x) | ^^^^^^^^^^^^ semantic error: Incorrect number of arguments passed to the 'present' intrinsic. It accepts exactly 1 arguments. --> tests/errors/continue_compilation_1.f90:509:14 | 509 | print *, present() | ^^^^^^^^^ semantic error: Incorrect number of arguments passed to the 'ieor' intrinsic. It accepts exactly 2 arguments. --> tests/errors/continue_compilation_1.f90:510:14 | 510 | print *, ieor(x) | ^^^^^^^ semantic error: Incorrect number of arguments passed to the 'ieor' intrinsic. It accepts exactly 2 arguments. --> tests/errors/continue_compilation_1.f90:511:14 | 511 | print *, ieor() | ^^^^^^ semantic error: `exit` statements cannot be outside of loops or blocks --> tests/errors/continue_compilation_1.f90:513:5 | 513 | exit | ^^^^ semantic error: Required argument `y` at position 2 is missing in function call --> tests/errors/continue_compilation_1.f90:516:18 | 516 | call my_func(10) | ^^ semantic error: Required argument `x` is missing in function call --> tests/errors/continue_compilation_1.f90:517:5 | 517 | call my_func() | ^^^^^^^^^^^^^^ semantic error: Required argument `extra_arg` is missing in function call --> tests/errors/continue_compilation_1.f90:521:5 | 521 | call obj%display() | ^^^^^^^^^^^^^^^^^^ semantic error: Shape mismatch in `allocate` statement. --> tests/errors/continue_compilation_1.f90:523:14 | 523 | allocate(arr4(5), source=[1, 2, 3]) | ^^^^^^^ ^^^^^^^^^ shape mismatch in dimension 1 semantic error: Type mismatch: The `source` argument in `allocate` must have the same type as the allocated variable. Expected type: integer[:] allocatable, but got: real. --> tests/errors/continue_compilation_1.f90:524:14 | 524 | allocate(arr4(5), source=v) | ^^^^^^^ ^ incompatible types in `allocate` statement semantic error: Dimension mismatch in `allocate` statement. --> tests/errors/continue_compilation_1.f90:525:14 | 525 | allocate(arr4(3), source=reshape([1, 2, 3, 4, 5, 6], [2, 3])) | ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mismatch in dimensions between allocated variable and `source` semantic error: Cannot allocate an array from a scalar source. --> tests/errors/continue_compilation_1.f90:526:14 | 526 | allocate(arr4, source=7) | ^^^^ allocated variable is an array, but `source` is a scalar semantic error: Argument was not specified --> tests/errors/continue_compilation_1.f90:528:5 | 528 | call logger % add_log_file(filename=filename) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1-th argument not specified for add_log_file semantic error: Required argument `unit` is missing in function call --> tests/errors/continue_compilation_1.f90:529:5 | 529 | call logger % add_log_file() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `allocate` statement only accepts four keyword arguments: `stat`, `errmsg`, `source` and `mold` --> tests/errors/continue_compilation_1.f90:531:5 | 531 | allocate(arr5, status=q1) | ^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Different `character` lengths 2 and 3 in array constructor --> tests/errors/continue_compilation_1.f90:534:21 | 534 | print *, ["aa", "aaa"] | ^^^^^ semantic error: Different shape for array assignment on dimension 1(2 and 1) --> tests/errors/continue_compilation_1.f90:535:5 | 535 | cc_a3 = cc_temp3(cc_i0:cc_i0) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: The argument `mask` must be of rank 2, an array with rank 1 was provided. --> tests/errors/continue_compilation_1.f90:536:25 | 536 | print *, pack(arr2, mask1) | ^^^^^ semantic error: Variable protected_module_my_class_obj is PROTECTED and cannot appear in LHS of assignment --> tests/errors/continue_compilation_1.f90:539:5 | 539 | protected_module_my_class_obj%value = 42 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Different shape for array assignment on dimension 1(2 and 1) --> tests/errors/continue_compilation_1.f90:540:5 | 540 | cc_a4 = cc_temp4(cc_i1+1:cc_i1+1) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Invalid syntax of derived type for array constructor --> tests/errors/continue_compilation_1.f90:541:12 | 541 | arr = [type(MyClass) :: v1, v2, v3] | ^^^^^^^^^^^^^ help: use just the derived type name 'myclass', without the keyword 'type' semantic error: Class type `NonExistingType` is not defined --> tests/errors/continue_compilation_1.f90:543:11 | 543 | arr = [NonExistingType :: v1, v2, v3] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: DATA statement element count mismatch: 8 elements on left-hand side, 10 values on right-hand side --> tests/errors/continue_compilation_1.f90:546:5 | 546 | data j2, x2, (y2(i2), i2=1,3), k2 / 1,2,3,4,5,6,7,3*8 / | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: DO loop label 'q1' already defined --> tests/errors/continue_compilation_1.f90:548:9 - 550:10 | 548 | q1: do q1 = 1, 3 | ^^^^^^^^^^^^... ... | 550 | end do q1 | ...^^^^^^^^^^ semantic error: Assigned format (using integer variable as format specifier) is not supported. Use character variables instead. --> tests/errors/continue_compilation_1.f90:555:5 | 555 | WRITE (6, fmt_i1) | ^^^^^^^^^^^^^^^^^ semantic error: Assigned format (using integer variable as format specifier) is not supported. Use character variables instead. --> tests/errors/continue_compilation_1.f90:560:5 | 560 | print fmt_i2, "test" | ^^^^^^^^^^^^^^^^^^^^ semantic error: Assigned format (using integer variable as format specifier) is not supported. Use character variables instead. --> tests/errors/continue_compilation_1.f90:565:5 | 565 | read (5, fmt_i3) | ^^^^^^^^^^^^^^^^ semantic error: Type mismatch in argument `p`: expected a procedure but got `integer` --> tests/errors/continue_compilation_1.f90:568:21 | 568 | call proc_param(42) | ^^ semantic error: `end` must be a literal integer label --> tests/errors/continue_compilation_1.f90:571:18 | 571 | read (*, end=x) x | ^ semantic error: `end` must be a literal integer label --> tests/errors/continue_compilation_1.f90:572:18 | 572 | read (*, end=9011.0) x | ^^^^^^ semantic error: `err` must be a literal integer label --> tests/errors/continue_compilation_1.f90:574:18 | 574 | read (*, err=x) x | ^ semantic error: `err` must be a literal integer label --> tests/errors/continue_compilation_1.f90:575:18 | 575 | read (*, err=9013.0) x | ^^^^^^ semantic error: `end` is only supported for READ statements --> tests/errors/continue_compilation_1.f90:576:5 | 576 | write (*, end=9014) x | ^^^^^^^^^^^^^^^^^^^^^ semantic error: end= label 999 is not defined --> tests/errors/continue_compilation_1.f90:581:20 | 581 | read(*, *, end=999) x | ^^^ semantic error: err= label 500 is not defined --> tests/errors/continue_compilation_1.f90:582:20 | 582 | read(*, *, err=500) x | ^^^ semantic error: Duplicate value of `recl` found, it has already been specified via arguments or keyword arguments --> tests/errors/continue_compilation_1.f90:584:5 | 584 | OPEN(unit=10, recl=10, recl=20) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `recl` must be of type, Integer --> tests/errors/continue_compilation_1.f90:585:5 | 585 | OPEN(unit=10, recl=10.5) | ^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Invalid substring syntax: use lower:upper instead of lower,upper --> tests/errors/continue_compilation_1.f90:588:14 | 588 | print *, string(i,i) | ^^^^^^^^^^^ semantic error: Allocate should only be called with Allocatable or Pointer type inputs, found str --> tests/errors/continue_compilation_1.f90:590:14 | 590 | allocate(strx) | ^^^^ 'strx' is not allocatable or pointer semantic error: Type mismatch: allocatable character dummy argument 's' has length 5 but actual argument has length 10. --> tests/errors/continue_compilation_1.f90:592:32 | 592 | call modify_and_deallocate(strx) | ^^^^ dummy argument 's' declared here semantic error: Intrinsic `allocated` can be called only on allocatable argument --> tests/errors/continue_compilation_1.f90:593:14 | 593 | print *, allocated(strx) | ^^^^^^^^^^^^^^^ semantic error: Duplicate value of `encoding` found --> tests/errors/continue_compilation_1.f90:597:5 | 597 | OPEN(unit=10, encoding="UTF-8", encoding="UTF-8") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `encoding` must be of type, String or StringPointer --> tests/errors/continue_compilation_1.f90:598:5 | 598 | OPEN(unit=10, encoding=10) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `rec` specifier is not allowed for internal file I/O --> tests/errors/continue_compilation_1.f90:601:5 | 601 | read(str_var, rec=1) x | ^^^^^^^^^^^^^^^^^^^^^^ semantic error: `rec` specifier is not allowed for internal file I/O --> tests/errors/continue_compilation_1.f90:602:5 | 602 | write(str_var, rec=1) x | ^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Duplicate value of `rec` found, it has already been specified via arguments or keyword arguments --> tests/errors/continue_compilation_1.f90:603:5 | 603 | read(unit=10, rec=1, rec=2) y | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Duplicate value of `rec` found, it has already been specified via arguments or keyword arguments --> tests/errors/continue_compilation_1.f90:604:5 | 604 | write(unit=10, rec=1, rec=2) y | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `rec` must be of type, Integer --> tests/errors/continue_compilation_1.f90:605:5 | 605 | read(10, rec=1.5) y | ^^^^^^^^^^^^^^^^^^^ semantic error: `rec` must be of type, Integer --> tests/errors/continue_compilation_1.f90:606:5 | 606 | write(10, rec=2.5) y | ^^^^^^^^^^^^^^^^^^^^ semantic error: `bad` is not defined or imported --> tests/errors/continue_compilation_1.f90:609:13 | 609 | bad_x = .bad. 10 | ^^^^^^^^ semantic error: `op` is not defined or imported --> tests/errors/continue_compilation_1.f90:610:13 | 610 | bad_x = 5 .op. 3 | ^^^^^^^^ semantic error: Operands of comparison operator '==' are not comparable: ieee_class_type == ieee_class_type --> tests/errors/continue_compilation_1.f90:612:10 | 612 | b = (ieee_cls == ieee_quiet_nan) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_1.f90:612:5 | 612 | b = (ieee_cls == ieee_quiet_nan) | ^ ^^^^^^^^^^^^^^ type mismatch (integer[:] and ieee_class_type) semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_1.f90:617:5 | 617 | base_var = derived_var | ^^^^^^^^ ^^^^^^^^^^^ type mismatch (base and derived) semantic error: Implied DO loop must be enclosed within array constructor brackets [...]; expected '[( ... )]' in assignment --> tests/errors/continue_compilation_1.f90:629:15 | 629 | arr_idl = (i, i = 1, 4) | ^^^^^^^^^^^^^ semantic error: ADVANCE= specifier must have value = YES or NO --> tests/errors/continue_compilation_1.f90:632:30 | 632 | write (*, "(a)", advance="hello") "Dothraki culture" | ^^^^^^^ semantic error: 'dim' argument of 'sum' intrinsic must be INTEGER --> tests/errors/continue_compilation_1.f90:633:30 | 633 | print *, sum(arr1, dim = mask1) | ^^^^^ semantic error: 'ieee_is_nan' is not accessible in the current scope; add 'use, intrinsic :: ieee_arithmetic' to use it --> tests/errors/continue_compilation_1.f90:634:13 | 634 | print*, ieee_is_nan(1.0) | ^^^^^^^^^^^^^^^^ not in scope semantic error: `decimal` must be of type, String or StringPointer --> tests/errors/continue_compilation_1.f90:635:5 | 635 | open(unit=7, decimal=1, decimal="comma") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Duplicate value of `decimal` found --> tests/errors/continue_compilation_1.f90:636:5 | 636 | open(unit=7, decimal="POINT", decimal="comma") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Implicit casting from LOGICAL to INTEGER is not allowed by default. Use `--logical-casting` flag to enable it. --> tests/errors/continue_compilation_1.f90:648:5 | 648 | a(1) = .true. | ^^^^^^^^^^^^^ semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_1.f90:649:5 | 649 | derived_cls = base_var | ^^^^^^^^^^^ ^^^^^^^^ type mismatch (derived and base) semantic error: No matching `operator(-)` found for this operand type --> tests/errors/continue_compilation_1.f90:662:18 | 662 | print *, -tt | ^^^ semantic error: Variable 'k' is not declared --> tests/errors/continue_compilation_1.f90:678:12 | 678 | do k = 1, 3 | ^ 'k' is undeclared semantic error: Expected logical expression in if statement, but recieved logical[:] instead --> tests/errors/continue_compilation_1.f90:689:13 | 689 | if (abs(arr1)(1) /= 2471095) error stop | ^^^^^^^^^^^^^^^^^^^^^^^ logical[:] expression, expected logical lfortran-0.63.0/tests/reference/asr-incorrect_type_where_04-f7dffdb.stderr0000664000175000017500000000023715174404631026760 0ustar alastairalastairsemantic error: the argument to `where` must be an array --> tests/errors/incorrect_type_where_04.f90:11:10 | 11 | where(c) b = 12121 | ^ lfortran-0.63.0/tests/reference/asr-subroutine3b-4883d18.stdout0000664000175000017500000001410015174404631024310 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f: (Variable 2 f [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 f) (IntegerConstant 42 (Integer 4) Decimal) () .false. .false. )] (Var 2 f) Public .true. .true. () ), g: (Function (SymbolTable 3 { g: (Variable 3 g [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) g (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 g) (IntegerConstant 42 (Integer 4) Decimal) () .false. .false. )] (Var 3 g) Public .true. .true. () ), h: (Function (SymbolTable 4 { h: (Variable 4 h [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) h (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 4 h) (IntegerConstant 42 (Integer 4) Decimal) () .false. .false. )] (Var 4 h) Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/llvm-string_11-e6c763f.json0000664000175000017500000000075015174404631023455 0ustar alastairalastair{ "basename": "llvm-string_11-e6c763f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/string_11.f90", "infile_hash": "eb36fd203a74190c7d98eeff5e136b53c72959fe49b4fed6558763d3", "outfile": null, "outfile_hash": null, "stdout": "llvm-string_11-e6c763f.stdout", "stdout_hash": "ce24ee18105d8caa3880ad517f99425466f0a99ec352c8e807856498", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-arrays_04_func-9f59ad6.json0000664000175000017500000000076415174404631024311 0ustar alastairalastair{ "basename": "asr-arrays_04_func-9f59ad6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_04_func.f90", "infile_hash": "50eb699e803e7dace8da286ee49cdb7381ebe3141bff17ca374f1f02", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_04_func-9f59ad6.stdout", "stdout_hash": "6b331e91de79e79bb1753c8bfe8671fbf0709442f8163f70b7ed673e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit7-9099c07.stderr0000664000175000017500000000023315174404631023551 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/implicit7.f90:4:14 | 4 | implicit real*8 (k) | ^ help: write this as 'real(8)' lfortran-0.63.0/tests/reference/ast-forall1-50096b8.stdout0000664000175000017500000003611215174404631023227 0ustar alastairalastair(TranslationUnit [(Program forall1 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (Comment "! Only for Syntax check" ) (EndOfLine) (Comment "!>>>>>>>>>>>>> Single line statments <<<<<<<<<<<<<<" )] ) )] [] [(ForAllSingle 0 () [(ConcurrentControl i 1 n () )] () (Assignment 0 (FuncCallOrArray A [] [(() i () 0) (() i () 0)] [] [] [] ) (FuncCallOrArray B [] [(() i () 0)] [] [] [] ) () ) () ) (ForAllSingle 0 () [(ConcurrentControl i 1 n 3 ) (ConcurrentControl j 1 n 5 )] () (Assignment 0 (FuncCallOrArray A [] [(() i () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray SIN [] [(() (FuncCallOrArray A [] [(() j () 0) (() i () 0)] [] [] [] ) () 0)] [] [] [] ) () ) () ) (ForAllSingle 0 () [(ConcurrentControl i 1 n () ) (ConcurrentControl j 1 n () )] (/= i j) (Assignment 0 (FuncCallOrArray A [] [(() i () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray REAL [] [(() (+ i j) () 0)] [] [] [] ) () ) () ) (ForAllSingle 0 () [(ConcurrentControl i 1 n () ) (ConcurrentControl j 1 m () )] (/= (FuncCallOrArray A [] [(() i () 0) (() j () 0)] [] [] [] ) 0) (Assignment 0 (FuncCallOrArray A [] [(() i () 0) (() j () 0)] [] [] [] ) (/ 1 (FuncCallOrArray A [] [(() i () 0) (() j () 0)] [] [] [] )) () ) () ) (ForAllSingle 0 () [(ConcurrentControl i 1 1000 () ) (ConcurrentControl j 1 1000 () )] (/= i j) (Assignment 0 (FuncCallOrArray A [] [(() i () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray A [] [(() j () 0) (() i () 0)] [] [] [] ) () ) (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "!>>>>>>>>>>>>> Multipe line statements <<<<<<<<<<<<<<" )] ) ) (ForAll 0 () [(ConcurrentControl j 1 n () )] () [(ConcurrentShared [i] ) (ConcurrentLocal [x] ) (ConcurrentDefault)] [(ForAllSingle 0 () [(ConcurrentControl i 1 j () )] () (Assignment 0 (FuncCallOrArray A [] [(() i () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray B [] [(() i () 0)] [] [] [] ) () ) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (ForAll 0 () [(ConcurrentControl i 1 N () )] () [(ConcurrentReduce ReduceMul [s] )] [(Assignment 0 s (+ s (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (ForAll 0 () [(ConcurrentControl i 3 (+ N 1) () ) (ConcurrentControl j 3 (+ N 1) () )] () [] [(Assignment 0 (FuncCallOrArray C [] [(() i () 0) (() j () 0)] [] [] [] ) (+ (FuncCallOrArray C [] [(() i () 0) (() (+ j 2) () 0)] [] [] [] ) (FuncCallOrArray C [] [(() i () 0) (() (- j 2) () 0)] [] [] [] )) () ) (Assignment 0 (FuncCallOrArray D [] [(() i () 0) (() j () 0)] [] [] [] ) (+ (+ (FuncCallOrArray C [] [(() i () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray C [] [(() (+ i 2) () 0) (() j () 0)] [] [] [] )) (FuncCallOrArray C [] [(() (- i 2) () 0) (() j () 0)] [] [] [] )) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (ForAll 0 () [(ConcurrentControl x 1 100 () )] (> (FuncCallOrArray J [] [(() x () 0)] [] [] [] ) 0) [] [(Where 0 () (< (FuncCallOrArray I [] [(() x () 0) (() () 1 0)] [] [] [] ) 0) [(Assignment 0 (FuncCallOrArray I [] [(() x () 0) (() () 1 0)] [] [] [] ) 0 () )] [(Assignment 0 (FuncCallOrArray I [] [(() x () 0) (() () 1 0)] [] [] [] ) 1 () )] () () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (ForAll 0 outer [(ConcurrentControl i 1 100 () )] () [] [(ForAll 0 inner [(ConcurrentControl j 1 100 () )] (/= i j) [] [(Assignment 0 (FuncCallOrArray A [] [(() i () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray A [] [(() j () 0) (() i () 0)] [] [] [] ) () )] () () )] () () )] [] )] ) lfortran-0.63.0/tests/reference/pass_do_loops-doloop_01-f2f0442.json0000664000175000017500000000101115174404631025227 0ustar alastairalastair{ "basename": "pass_do_loops-doloop_01-f2f0442", "cmd": "lfortran --pass=do_loops --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_01.f90", "infile_hash": "14818f8f39c32bf890cf7906fe8a9692b270ad81a49bcdf0486f8e84", "outfile": null, "outfile_hash": null, "stdout": "pass_do_loops-doloop_01-f2f0442.stdout", "stdout_hash": "51fd0bc8ba8f25985f6c541330a019f35f8910c4ff9289711c8d6732", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-implicit_interface_04-9b6786e.json0000664000175000017500000000105015174404631025724 0ustar alastairalastair{ "basename": "llvm-implicit_interface_04-9b6786e", "cmd": "lfortran --show-llvm --implicit-typing --implicit-interface {infile} -o {outfile}", "infile": "tests/../integration_tests/implicit_interface_04.f90", "infile_hash": "1e053fba9f0cad92b7ae15056010bc8e173cf2b0f3ad9aad515de419", "outfile": null, "outfile_hash": null, "stdout": "llvm-implicit_interface_04-9b6786e.stdout", "stdout_hash": "2e0da382defc08fba824d8149312d767ab8d77533a5e67906f4d4910", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-cpp_err1-3303e2d.stderr0000664000175000017500000000025715174404631025675 0ustar alastairalastairC preprocessor error: factor(): The expression is not complete, expecting integer, name, +, - or ( --> tests/errors/cpp_err1.f90:4:13 | 4 | #if 2 < 1+2+ | ^ lfortran-0.63.0/tests/reference/asr-dreal_arg_error-91381bb.stderr0000664000175000017500000000025415174404631025051 0ustar alastairalastairsemantic error: Unexpected args, Dreal expects (complex64) as arguments --> tests/errors/dreal_arg_error.f90:4:14 | 4 | print *, dreal(a) | ^^^^^^^^ lfortran-0.63.0/tests/reference/llvm-callback_03-0f44942.json0000664000175000017500000000075615174404631023543 0ustar alastairalastair{ "basename": "llvm-callback_03-0f44942", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/callback_03.f90", "infile_hash": "ed8de8dc63a13125cc459d17776eb179835cd6860aa332449493c9e8", "outfile": null, "outfile_hash": null, "stdout": "llvm-callback_03-0f44942.stdout", "stdout_hash": "7d301935924f6c0036ca38da126606bdcfeb8bfee9e7fc9154d2071d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-subroutine6-f8dae3a.stdout0000664000175000017500000000056115174404631024766 0ustar alastairalastairfunction triad(a::Array{Float32, 1}, b::Array{Float32, 1}, scalar::Float32, c::Array{Float32, 1}) local i::Int32 local j::Int32 local n::Int32 local n2::Int32 n = length(a) n2 = length(b) Threads.@threads for i ∈ 1:n c[i] = a[i] + scalar * b[i] end Threads.@threads for j ∈ 1:n2 c[j] = b[j] + scalar end end lfortran-0.63.0/tests/reference/asr-derived_type_05-3836aa5.stderr0000664000175000017500000000074415174404631024714 0ustar alastairalastairsemantic error: Pass and NoPass attributes cannot be provided together --> tests/errors/derived_type_05.f90:7:49 | 7 | procedure(testing_interface), deferred, pass(my_object), nopass :: testing | ^^^^^^^^^^^^^^^ pass specified here | 7 | procedure(testing_interface), deferred, pass(my_object), nopass :: testing | ^^^^^^ nopass specified here lfortran-0.63.0/tests/reference/c-pragma2-a14de52.stdout0000664000175000017500000000255615174404631023010 0ustar alastairalastair #include #include #include #include #include struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct i32 { int32_t *data; struct dimension_descriptor dims[32]; int32_t n_dims; int32_t offset; bool is_allocated; }; struct r32 { float *data; struct dimension_descriptor dims[32]; int32_t n_dims; int32_t offset; bool is_allocated; }; // Implementations int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); const struct i32 __libasr_created__array_constant__value; struct i32* __libasr_created__array_constant_ = &__libasr_created__array_constant__value; int32_t __libasr_created__array_constant__data[1]; __libasr_created__array_constant_->data = __libasr_created__array_constant__data; __libasr_created__array_constant_->n_dims = 1; __libasr_created__array_constant_->offset = 0; __libasr_created__array_constant_->dims[0].lower_bound = 1; __libasr_created__array_constant_->dims[0].length = 1; __libasr_created__array_constant_->dims[0].stride = 1; float a __attribute__ (( vector_size(sizeof(float) * 8) )); a = (float __attribute__ (( vector_size(sizeof(float) * 8) ))) {(float)(1), (float)(1), (float)(1), (float)(1), (float)(1), (float)(1), (float)(1), (float)(1)}; return 0; } lfortran-0.63.0/tests/reference/asr-operator_overloading_12-b71f657.json0000664000175000017500000000101715174404631026122 0ustar alastairalastair{ "basename": "asr-operator_overloading_12-b71f657", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/operator_overloading_12.f90", "infile_hash": "b9247e0fddab7797b86957ed5aa99372f5a365d96b082feafccac339", "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_12-b71f657.stdout", "stdout_hash": "3b877fbb9656cae42f9d8e5d04f56a3c096df81422bc1fb6e9855084", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-continue_body_if_loop-670a23a.stdout0000664000175000017500000001421215174404631026300 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { implicit_program_lfortran: (Program (SymbolTable 2 { j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s: (Variable 2 s [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u: (Variable 2 u [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) implicit_program_lfortran [] [(Assignment (Var 2 s) (RealConstant 0.000000 (Real 4) ) () .false. .false. ) (DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) ()) [(Assignment (Var 2 s) (RealBinOp (Var 2 s) Add (ArrayItem (Var 2 u) [(() (Var 2 j) ())] (Real 4) ColMajor () ) (Real 4) () ) () .false. .false. ) (If () (RealCompare (Var 2 s) GtE (Cast (IntegerConstant 1000000 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1000000.000000 (Real 4) ) () ) (Logical 4) () ) [(GoTo 2 2 )] [] ) (GoToTarget 1 1 )] [] ) (Stop () ) (GoToTarget 2 2 )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-select_type_02-6e04a0b.json0000664000175000017500000000076415174404631024265 0ustar alastairalastair{ "basename": "asr-select_type_02-6e04a0b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/select_type_02.f90", "infile_hash": "67a97c746280c55753fa1c0adfc9813a240d797752915300d102f79e", "outfile": null, "outfile_hash": null, "stdout": "asr-select_type_02-6e04a0b.stdout", "stdout_hash": "4a16a59b3b2b18c9775fe66d0ae3958ecc773fb4e3cbc743556a23b0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-associate_04-8bcb3df.stdout0000664000175000017500000004460515174404631024447 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { associate_04: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), associate_block: (AssociateBlock (SymbolTable 3 { v: (Variable 3 v [] Local () () Default (Pointer (Real 4) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 3 z [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) associate_block [(Assignment (Var 3 z) (RealBinOp (RealUnaryMinus (RealBinOp (RealBinOp (Var 2 x) Mul (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) (Real 4) () ) Add (RealBinOp (Var 2 y) Mul (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) (Real 4) () ) (Real 4) () ) (Real 4) () ) Mul (IntrinsicElementalFunction Cos [(Var 2 theta)] 0 (Real 4) () ) (Real 4) () ) () .false. .false. ) (Associate (Var 3 v) (Var 2 myreal) ) (Print (StringFormat () [(RealBinOp (Var 2 a) Add (Var 3 z) (Real 4) () ) (RealBinOp (Var 2 a) Sub (Var 3 z) (Real 4) () ) (Var 3 v)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 3 v) (RealBinOp (Var 3 v) Mul (RealConstant 4.600000 (Real 4) ) (Pointer (Real 4) ) () ) () .false. .false. )] ), myreal: (Variable 2 myreal [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), theta: (Variable 2 theta [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) associate_04 [] [(Assignment (Var 2 x) (RealConstant 0.420000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 y) (RealConstant 0.350000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 myreal) (RealConstant 9.100000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 theta) (RealConstant 1.500000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 a) (RealConstant 0.400000 (Real 4) ) () .false. .false. ) (AssociateBlockCall 2 associate_block ) (Print (StringFormat () [(Var 2 myreal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (LogicalBinOp (RealCompare (RealBinOp (Var 2 myreal) Sub (RealConstant 41.860001 (Real 4) ) (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) Or (RealCompare (RealBinOp (Var 2 myreal) Sub (RealConstant 41.860001 (Real 4) ) (Real 4) () ) Lt (RealUnaryMinus (RealConstant 0.000010 (Real 4) ) (Real 4) (RealConstant -0.000010 (Real 4) ) ) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-implicit1-418fb10.json0000664000175000017500000000105715174404631023737 0ustar alastairalastair{ "basename": "ast_f90-implicit1-418fb10", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/implicit1.f90", "infile_hash": "8f316b7b5813cd7d2f663bd9aac929c0d2fdb42eccdc2ac798b0c3d5", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-implicit1-418fb10.stdout", "stdout_hash": "a74dec58fd0cb5acc6ae97e5a60469284b76a4453f4214a4916107fb", "stderr": "ast_f90-implicit1-418fb10.stderr", "stderr_hash": "7040f573fd98c40ed1387403ecf33f749ead9159a50668621b3fb8ca", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-assign_to1-a6b7599.stdout0000664000175000017500000000727215174404631024032 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { k: (Variable 2 k [] Local () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main [] [(GoToTarget 1000 1000 ) (If () (IntegerCompare (IntegerConstant 0 (Integer 4) Decimal) Lt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(Assignment (Var 2 k) (IntegerConstant 15 (Integer 4) Decimal) () .false. .false. )] [] ) (GoToTarget 100 100 ) (Select () (Var 2 k) [(CaseStmt [(IntegerConstant 100 (Integer 4) Decimal)] [(GoTo 100 100 )] .false. ) (CaseStmt [(IntegerConstant 1000 (Integer 4) Decimal)] [(GoTo 1000 1000 )] .false. ) (CaseStmt [(IntegerConstant 15 (Integer 4) Decimal)] [(GoTo 15 15 )] .false. )] [] .false. ) (GoToTarget 15 15 ) (Print (StringConstant "run" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr_enable_style_suggestion-style1-a2fdd22.json0000664000175000017500000000114215174404631027734 0ustar alastairalastair{ "basename": "asr_enable_style_suggestion-style1-a2fdd22", "cmd": "lfortran --std=f23 --style-suggestions --no-color {infile}", "infile": "tests/style1.f90", "infile_hash": "b37bbb3e24a2bceae58e25b574ccb9dea7fbe05441c08c9e4fa5add6", "outfile": null, "outfile_hash": null, "stdout": "asr_enable_style_suggestion-style1-a2fdd22.stdout", "stdout_hash": "b9b26c3fdb75ebc34cfc47d12c11351182a0284088440bead4ae1daf", "stderr": "asr_enable_style_suggestion-style1-a2fdd22.stderr", "stderr_hash": "0a91582db826ba18d127e9a1beca1da3483df9469fed545f6c902f35", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-external4-4e8bc7b.stdout0000664000175000017500000003566015174404631024023 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { dqc25s: (Function (SymbolTable 2 { centr: (Variable 2 centr [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dlog: (Variable 2 dlog [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dqk15w: (Function (SymbolTable 4 { }) dqk15w (FunctionType [(FunctionType [] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 f)] [] () Public .false. .false. () ), f: (Function (SymbolTable 6 { centr: (Variable 6 centr [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f_arg_0: (Variable 6 f_arg_0 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f_return_var_name: (Variable 6 f_return_var_name [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), hlgth: (Variable 6 hlgth [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Real 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 f_arg_0)] [] (Var 6 f_return_var_name) Public .false. .false. () ), hlgth: (Variable 2 hlgth [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) dqc25s (FunctionType [(FunctionType [(Real 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 f)] [(SubroutineCall 2 dqk15w () [((Var 2 f))] () .false. ) (Print (StringFormat () [(FunctionCall 2 f () [((RealBinOp (Var 2 hlgth) Add (Var 2 centr) (Real 4) () ))] (Real 8) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction Log [(RealConstant 2.000000 (Real 8) )] 0 (Real 8) (RealConstant 0.693147 (Real 8) ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/pass_inline_function_calls-functions_07-bb03cfd.json0000664000175000017500000000110015174404631030707 0ustar alastairalastair{ "basename": "pass_inline_function_calls-functions_07-bb03cfd", "cmd": "lfortran --pass=inline_function_calls --show-asr --no-color --fast {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_07.f90", "infile_hash": "4688c49c3c531f9e7dafd3b6a4ef2560b6e62ef554ea9df95ed61a8a", "outfile": null, "outfile_hash": null, "stdout": "pass_inline_function_calls-functions_07-bb03cfd.stdout", "stdout_hash": "4061dfebb75d1011d2db9ecadc56c6434eb6a74b876469ff9b83f93e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-write_12-63d1bdf.stdout0000664000175000017500000000001415174404631023544 0ustar alastairalastairx = 42 PASS lfortran-0.63.0/tests/reference/cpp-string_01-e28a827.json0000664000175000017500000000073015174404631023177 0ustar alastairalastair{ "basename": "cpp-string_01-e28a827", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/string_01.f90", "infile_hash": "e7d4974d8a9b9704bf0c02d7943d916b40c591de3c9e89d30de28d7d", "outfile": null, "outfile_hash": null, "stdout": "cpp-string_01-e28a827.stdout", "stdout_hash": "35a0e3a03b47f026b9e1d8219a96b2deeb8ee332bbae88c1f418746a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_27-4f64cb2.json0000664000175000017500000000075015174404631023430 0ustar alastairalastair{ "basename": "asr-modules_27-4f64cb2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_27.f90", "infile_hash": "30331196ee4a840d6aaf78770ddd668bf8779203aee238721cc32795", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_27-4f64cb2.stdout", "stdout_hash": "89dd6ceb36cdb47c71267fd05aab6b5017bc97423a5253ab6259f1fc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-integerStringInput-16e7ff7.stderr0000664000175000017500000000005415174404631025675 0ustar alastairalastairError: Invalid input for int32_t from file. lfortran-0.63.0/tests/reference/llvm-volatile_02-2beae13.json0000664000175000017500000000075615174404631024033 0ustar alastairalastair{ "basename": "llvm-volatile_02-2beae13", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/volatile_02.f90", "infile_hash": "8e1e2efa590937906428b5c80f2025a351c33f23a5a821a26341ba02", "outfile": null, "outfile_hash": null, "stdout": "llvm-volatile_02-2beae13.stdout", "stdout_hash": "9669ddb260e729da2bb6259f4290f084759ab8e587b8ab2e17405ead", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-common_05-f767179.stdout0000664000175000017500000010621415174404631023477 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { file_common_block_block_1: (Module (SymbolTable 3 { block_1: (Struct (SymbolTable 4 { a: (Variable 4 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 4 c [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) block_1 (StructType [] [] .true. .false. ) [] [a b c] [] Source Public .false. .false. [] () () [] ), struct_instance_block_1: (Variable 3 struct_instance_block_1 [] Local () () Default (StructType [] [] .true. .false. ) 3 block_1 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) file_common_block_block_1 () [] .false. .false. .false. ), main: (Program (SymbolTable 2 { 1_block_1_a: (ExternalSymbol 2 1_block_1_a 4 a block_1 [] a Public ), 1_block_1_b: (ExternalSymbol 2 1_block_1_b 4 b block_1 [] b Public ), 1_block_1_c: (ExternalSymbol 2 1_block_1_c 4 c block_1 [] c Public ), block_1: (ExternalSymbol 2 block_1 3 block_1 file_common_block_block_1 [] block_1 Public ), d: (Variable 2 d [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), struct_instance_block_1: (ExternalSymbol 2 struct_instance_block_1 3 struct_instance_block_1 file_common_block_block_1 [] struct_instance_block_1 Public ) }) main [] [(Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) (ArrayBroadcast (IntegerConstant 3 (Integer 4) Decimal) (ArrayConstant 4 [5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 20 [3, 3, 3, 3, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 2 d) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (Assignment (Var 2 d) (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Add (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Mul (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Gt (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Logical 4) () ) [(Assignment (Var 2 d) (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Add (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) Div (Var 2 d) (Integer 4) () ) (Integer 4) () ) () .false. .false. )] [(If () (IntegerCompare (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) Gt (Var 2 d) (Logical 4) () ) [(Assignment (Var 2 d) (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Sub (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Integer 4) () ) () .false. .false. )] [] )] ) (Select () (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) [(CaseStmt [(IntegerConstant 1 (Integer 4) Decimal)] [(Assignment (Var 2 d) (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Add (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Integer 4) () ) () .false. .false. )] .false. ) (CaseStmt [(IntegerConstant 2 (Integer 4) Decimal)] [(Assignment (Var 2 d) (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Sub (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Integer 4) () ) () .false. .false. )] .false. )] [(Assignment (Var 2 d) (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Mul (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Integer 4) () ) () .false. .false. )] .false. ) (WhileLoop () (IntegerCompare (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Gt (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Logical 4) () ) [(Assignment (Var 2 d) (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Add (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] ) (DoLoop () ((StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal)) [(Assignment (Var 2 d) (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Add (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Integer 4) () ) () .false. .false. )] [] ) (Print (StringFormat () [(StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) (Var 2 d)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) ()) [(If () (IntegerCompare (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] [] ) (If () (IntegerCompare (Var 2 d) NotEq (IntegerConstant 6 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-parameter_03-d4df941.json0000664000175000017500000000075615174404631023745 0ustar alastairalastair{ "basename": "asr-parameter_03-d4df941", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/parameter_03.f90", "infile_hash": "5f60b01824232c9c934cf71ae5b7f4f54e51457361dc9fefb28092a5", "outfile": null, "outfile_hash": null, "stdout": "asr-parameter_03-d4df941.stdout", "stdout_hash": "848c32bd3034f1a10cc8aafb7d338ac9f4109d36249d9dfa72581ae0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_09-2af35ec.stdout0000664000175000017500000000547215174404631024602 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_09: (Program (SymbolTable 2 { z: (Variable 2 z [] Local (RealConstant 0.000000 (Real 4) ) (RealConstant 0.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_09 [] [(If () (RealCompare (Var 2 z) Lt (TypeInquiry Tiny (Real 4) (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant 0.000000 (Real 4) ) ) (Logical 4) () ) [(Print (StringFormat () [(Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-team1-f0af498.stdout0000664000175000017500000001201715174404631023040 0ustar alastairalastair(TranslationUnit [(Program team1 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (Comment "! Syntax check only(AST)" ) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(n [] [] () 4 Equal ())] () ) (Declaration (AttrType TypeType [] () team_type None ) [] [(column [] [] () () None ()) (odd_even [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrCodimension [(1 n CodimensionExpr) (() () CodimensionStar)] )] [(co_array [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrDimension [(1 2 DimensionExpr)] )] [(my_cosubscripts [] [] () () None ())] () )] [(Assignment 0 (FuncCallOrArray my_cosubscripts [] [(() () 1 0)] [] [] [] ) (FuncCallOrArray this_image [] [(() co_array () 0)] [] [] [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (FormTeam 0 (FuncCallOrArray my_cosubscripts [] [(() 2 () 0)] [] [] [] ) column [(AttrNewIndex (FuncCallOrArray my_cosubscripts [] [(() 1 () 0)] [] [] [] ) )] () ) (SyncTeam 0 column [] () ) (ChangeTeam 0 () column [(CoarrayAssociation (CoarrayRef ca [] [] [] [(() () 1 CodimensionStar)] [] ) co_array )] [] [] (TriviaNode [] [(EndOfLine) (Comment "! segment 1" )] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] ) (FormTeam 0 (- 2 (FuncCallOrArray mod [] [(() (FuncCallOrArray this_image [] [] [] [] [] ) () 0) (() 2 () 0)] [] [] [] )) odd_even [] () ) (ChangeTeam 0 () odd_even [] [] [] (TriviaNode [] [(EndOfLine) (Comment "! segment 2" )] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] )] [] )] ) lfortran-0.63.0/tests/reference/llvm-nested_05-0252368.stdout0000664000175000017500000003036615174404631023561 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @__module___lcompilers_created__nested_context__b__x = global i32 0 @__module___lcompilers_created__nested_context__b__y = global float 0.000000e+00 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.4 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.5 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_nested_05_a_b() { .entry: %stringFormat_desc7 = alloca %string_descriptor, align 8 %stringFormat_desc4 = alloca %string_descriptor, align 8 %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %x = alloca i32, align 4 %y = alloca float, align 4 store i32 6, i32* %x, align 4 store float 5.500000e+00, float* %y, align 4 %1 = alloca i64, align 8 %2 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %1, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %x) %3 = load i64, i64* %1, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %2, i8** %4, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %3, i64* %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %7 = load i8*, i8** %6, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %9 = load i64, i64* %8, align 8 %10 = trunc i64 %9 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %7, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %11 = icmp eq i8* %2, null br i1 %11, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %2) br label %free_done free_done: ; preds = %free_nonnull, %.entry %12 = alloca i64, align 8 %13 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.3, i32 0, i32 0), i64* %12, i32 0, i32 0, i32 0, i32 0, i32 0, float* %y) %14 = load i64, i64* %12, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %13, i8** %15, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %14, i64* %16, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %18 = load i8*, i8** %17, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %20 = load i64, i64* %19, align 8 %21 = trunc i64 %20 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %18, i32 %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %22 = icmp eq i8* %13, null br i1 %22, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %0, i8* %13) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %23 = load i32, i32* %x, align 4 store i32 %23, i32* @__module___lcompilers_created__nested_context__b__x, align 4 %24 = load float, float* %y, align 4 store float %24, float* @__module___lcompilers_created__nested_context__b__y, align 4 call void @b.__module_nested_05_a_c() %25 = load i32, i32* @__module___lcompilers_created__nested_context__b__x, align 4 store i32 %25, i32* %x, align 4 %26 = load float, float* @__module___lcompilers_created__nested_context__b__y, align 4 store float %26, float* %y, align 4 %27 = alloca i64, align 8 %28 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.4, i32 0, i32 0), i64* %27, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %x) %29 = load i64, i64* %27, align 8 %30 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %28, i8** %30, align 8 %31 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %29, i64* %31, align 8 %32 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %33 = load i8*, i8** %32, align 8 %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %35 = load i64, i64* %34, align 8 %36 = trunc i64 %35 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %33, i32 %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %37 = icmp eq i8* %28, null br i1 %37, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free_alloc(i8* %0, i8* %28) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 %38 = alloca i64, align 8 %39 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.5, i32 0, i32 0), i64* %38, i32 0, i32 0, i32 0, i32 0, i32 0, float* %y) %40 = load i64, i64* %38, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 store i8* %39, i8** %41, align 8 %42 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 store i64 %40, i64* %42, align 8 %43 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 %44 = load i8*, i8** %43, align 8 %45 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 %46 = load i64, i64* %45, align 8 %47 = trunc i64 %46 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %44, i32 %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %48 = icmp eq i8* %39, null br i1 %48, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %free_done6 call void @_lfortran_free_alloc(i8* %0, i8* %39) br label %free_done9 free_done9: ; preds = %free_nonnull8, %free_done6 br label %return return: ; preds = %free_done9 br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return ret void } define void @b.__module_nested_05_a_c() { .entry: %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %1 = alloca i64, align 8 %2 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %1, i32 0, i32 0, i32 0, i32 0, i32 0, i32* @__module___lcompilers_created__nested_context__b__x) %3 = load i64, i64* %1, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %2, i8** %4, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %3, i64* %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %7 = load i8*, i8** %6, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %9 = load i64, i64* %8, align 8 %10 = trunc i64 %9 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %7, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %11 = icmp eq i8* %2, null br i1 %11, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %2) br label %free_done free_done: ; preds = %free_nonnull, %.entry %12 = alloca i64, align 8 %13 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %12, i32 0, i32 0, i32 0, i32 0, i32 0, float* @__module___lcompilers_created__nested_context__b__y) %14 = load i64, i64* %12, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %13, i8** %15, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %14, i64* %16, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %18 = load i8*, i8** %17, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %20 = load i64, i64* %19, align 8 %21 = trunc i64 %20 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %18, i32 %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %22 = icmp eq i8* %13, null br i1 %22, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %0, i8* %13) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done store i32 4, i32* @__module___lcompilers_created__nested_context__b__x, align 4 store float 3.500000e+00, float* @__module___lcompilers_created__nested_context__b__y, align 4 br label %return return: ; preds = %free_done3 br label %FINALIZE_SYMTABLE_c FINALIZE_SYMTABLE_c: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @__module_nested_05_a_b() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_nested_05 FINALIZE_SYMTABLE_nested_05: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/ast-types_08-c70036f.json0000664000175000017500000000074215174404631023044 0ustar alastairalastair{ "basename": "ast-types_08-c70036f", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_08.f90", "infile_hash": "022002fe0deb83e3961dc20b35dd2623d7f85f3a299f77323042cb29", "outfile": null, "outfile_hash": null, "stdout": "ast-types_08-c70036f.stdout", "stdout_hash": "5d4f7d4841a1ea61dee8586124196f13805169958f41449e3ecddf05", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-subroutines_04-a817e0c.stdout0000664000175000017500000000777715174404631024724 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { print_it: (Program (SymbolTable 2 { print_int: (Function (SymbolTable 3 { a: (Variable 3 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) print_int (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 a) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(Var 3 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) print_it [] [(SubroutineCall 2 print_int () [] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-where_01-cc363a1.stdout0000664000175000017500000001442715174404631023434 0ustar alastairalastair(TranslationUnit [(Program where_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [(1 10 DimensionExpr)] [] () () None ()) (b [(1 10 DimensionExpr)] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 a (u- 2) () ) (Assignment 0 (FuncCallOrArray a [] [(() 1 () 0)] [] [] [] ) 1 () ) (Assignment 0 (FuncCallOrArray a [] [(() 5 () 0)] [] [] [] ) 8 () ) (Assignment 0 b (u- 3) () ) (Where 0 () (>= a 0) [(Assignment 0 b 1 () )] [(Assignment 0 b 0 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Where 0 () (>= a 0) [(Assignment 0 b 1 () )] [(Assignment 0 b 0 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Where 0 () (>= a 0) [(Assignment 0 b 1 () )] [(Assignment 0 b 0 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (> (FuncCallOrArray abs [] [(() (- (FuncCallOrArray b [] [(() 1 () 0)] [] [] [] ) 1) () 0)] [] [] [] ) (Real "1e-6")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- (FuncCallOrArray b [] [(() 5 () 0)] [] [] [] ) 1) () 0)] [] [] [] ) (Real "1e-6")) [(ErrorStop 0 () () () )] [] () () () ) (DoLoop 0 () 0 i 2 4 () [(If 0 () (> (FuncCallOrArray abs [] [(() (- (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) 0) () 0)] [] [] [] ) (Real "1e-6")) [(ErrorStop 0 () () () )] [] () () () )] () () ) (DoLoop 0 () 0 i 6 10 () [(If 0 () (> (FuncCallOrArray abs [] [(() (- (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) 0) () 0)] [] [] [] ) (Real "1e-6")) [(ErrorStop 0 () () () )] [] () () () )] () () ) (Print 0 () [b] () ) (Print 0 () [a] () )] [] )] ) lfortran-0.63.0/tests/reference/pass_global_stmts-global_scope5-fb3716b.json0000664000175000017500000000101415174404631027113 0ustar alastairalastair{ "basename": "pass_global_stmts-global_scope5-fb3716b", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope5.f90", "infile_hash": "63e512d3fe5d83aa6195002b9c31ddc77e1a93ac37df38989f782ed7", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope5-fb3716b.stdout", "stdout_hash": "dee7dbb2c3be54a5672f3032849aadae3ba69d893fe5d779cd167aea", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-cpp2-a8d63da.json0000664000175000017500000000074415174404631024644 0ustar alastairalastair{ "basename": "asr_preprocess-cpp2-a8d63da", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp2.f90", "infile_hash": "e4f9f303812209a53776ca76314834165cd4c21ccb47e1443169ce53", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp2-a8d63da.stderr", "stderr_hash": "da316951a0c26667c46ff6d3551f43dbee0947389a62c1a8774be659", "returncode": 2 }lfortran-0.63.0/tests/reference/run-format_21-af89e92.json0000664000175000017500000000071515174404631023277 0ustar alastairalastair{ "basename": "run-format_21-af89e92", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_21.f90", "infile_hash": "2904f4fcdadb6f1a06d09e4134a55f9af19894ead3ce04beadb21afb", "outfile": null, "outfile_hash": null, "stdout": "run-format_21-af89e92.stdout", "stdout_hash": "ad2e37f369ec7b73dfd1f6dde8e11a82488123cced26b1699815d60f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-attributes1-25126f0.stdout0000664000175000017500000000135115174404631024601 0ustar alastairalastairprogram attributes1 ! test for AST(to fmt) only character(len=4) :: a, b character, intent(in) :: str*(*) character(len=1, kind=c_char), target, bind(C, name="_binary_fclKernels_cl_start") :: fclKernelStart character(len=3) :: c(2) integer, volatile :: d, e real, external :: g equivalence (a, c(1)), (b, c(2)) type :: details sequence integer :: age character(len=50) :: name contains procedure, pass :: name => sample end type details intrinsic :: sin, cos double precision, intent(in) :: x(..) type(real(4)), allocatable :: x(:) type(integer(4)), allocatable :: x(:) type(character(len=4)), allocatable :: x(:) type(logical(4)), allocatable :: x(:) type(complex(4)), allocatable :: x(:) save :: /zzrayc/ end program attributes1 lfortran-0.63.0/tests/reference/asr-external3-2aafcb3.json0000664000175000017500000000076715174404631023514 0ustar alastairalastair{ "basename": "asr-external3-2aafcb3", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/external3.f90", "infile_hash": "54099789ee8d301435db8814db171bc443101af05d6cb268f45fd815", "outfile": null, "outfile_hash": null, "stdout": "asr-external3-2aafcb3.stdout", "stdout_hash": "cfbbe66b03b0a7da1dcf1ddb51c15b0c22712ce74f87763f91951814", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fn_call1-7e6ba0b.json0000664000175000017500000000071515174404631023206 0ustar alastairalastair{ "basename": "ast-fn_call1-7e6ba0b", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fn_call1.f90", "infile_hash": "fd319232dcd65e8f2c7722a5f8da034557658cb0a081224347fd1de6", "outfile": null, "outfile_hash": null, "stdout": "ast-fn_call1-7e6ba0b.stdout", "stdout_hash": "2d97a6c127586c6ebbd91090700dbcbc9a8371fa558c763b88fa7c8d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-string_10-eb8bca7.json0000664000175000017500000000074515174404631023423 0ustar alastairalastair{ "basename": "asr-string_10-eb8bca7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_10.f90", "infile_hash": "bc81968bc899cbe447092923c9b089e1942c9ecf0bad33ee7145f2a9", "outfile": null, "outfile_hash": null, "stdout": "asr-string_10-eb8bca7.stdout", "stdout_hash": "f9da40b031d6ee87e976bc998c931e8d9339c848ade71b4ef218ee20", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-nested_03-2eacab7.stdout0000664000175000017500000001346215174404631024130 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @__module___lcompilers_created__nested_context__b__x = global float 0.000000e+00 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [3 x i8] c"b()" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data, i32 0, i32 0), i64 3 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_nested_03_a_b() { .entry: %x = alloca float, align 4 store float 6.000000e+00, float* %x, align 4 %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %0, i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %1 = load float, float* %x, align 4 store float %1, float* @__module___lcompilers_created__nested_context__b__x, align 4 call void @b.__module_nested_03_a_c() %2 = load float, float* @__module___lcompilers_created__nested_context__b__x, align 4 store float %2, float* %x, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return ret void } define void @b.__module_nested_03_a_c() { .entry: %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %1 = alloca i64, align 8 %2 = alloca i32, align 4 store i32 5, i32* %2, align 4 %3 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %1, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %2) %4 = load i64, i64* %1, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 8 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry %13 = alloca i64, align 8 %14 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %13, i32 0, i32 0, i32 0, i32 0, i32 0, float* @__module___lcompilers_created__nested_context__b__x) %15 = load i64, i64* %13, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %14, i8** %16, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %15, i64* %17, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %19 = load i8*, i8** %18, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %21 = load i64, i64* %20, align 8 %22 = trunc i64 %21 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %19, i32 %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %23 = icmp eq i8* %14, null br i1 %23, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %0, i8* %14) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done br label %return return: ; preds = %free_done3 br label %FINALIZE_SYMTABLE_c FINALIZE_SYMTABLE_c: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @__module_nested_03_a_b() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_nested_03 FINALIZE_SYMTABLE_nested_03: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/fortran-int_to_int_cast_fortran_codegen-913a36c.json0000664000175000017500000000103615174404631030652 0ustar alastairalastair{ "basename": "fortran-int_to_int_cast_fortran_codegen-913a36c", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/int_to_int_cast_fortran_codegen.f90", "infile_hash": "4993e4b5ba22668cdfb76bf75a291c41d074af44ea3bd1bd143dbcd0", "outfile": null, "outfile_hash": null, "stdout": "fortran-int_to_int_cast_fortran_codegen-913a36c.stdout", "stdout_hash": "1b62de2ca1ecadb88968755fa090fb1bd3bd1233abe3cce6070f669e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_vector-140858c.json0000664000175000017500000000076715174404631024517 0ustar alastairalastair{ "basename": "asr-template_vector-140858c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_vector.f90", "infile_hash": "3b7ffe3ced86a0dcf1875f22da3a7910133d0e11b7a2866865dca1fe", "outfile": null, "outfile_hash": null, "stdout": "asr-template_vector-140858c.stdout", "stdout_hash": "ee27b08c5561e1f5161d7c69a136018b434b9605429c3a63c8da8da5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-data_02-fe19614.stdout0000664000175000017500000002751315174404631023170 0ustar alastairalastair(TranslationUnit [(Program data2 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(j [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (iarx [(1 3 DimensionExpr) (1 1 DimensionExpr)] [] () () None ()) (iary [(1 3 DimensionExpr) (1 1 DimensionExpr)] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [j] [5] )] () ) (Print 0 () [(String "1" ()) j] () ) (If 0 () (Logical .true. ()) [(Print 0 () [(String "2" ())] () ) (DataStmt 0 [(DataStmtSet [(DataImpliedDo [(FuncCallOrArray iarx [] [(() i () 0) (() 1 () 0)] [] [] [] ) (FuncCallOrArray iary [] [(() i () 0) (() 1 () 0)] [] [] [] )] () i 1 3 () )] [1 9 1950 1350 4350 4] )] () ) (Print 0 () [(FuncCallOrArray iarx [] [(() 1 () 0) (() 1 () 0)] [] [] [] )] () ) (If 0 () (/= (FuncCallOrArray iarx [] [(() 1 () 0) (() 1 () 0)] [] [] [] ) 1) [(ErrorStop 0 () () () )] [] () () () ) (Print 0 () [(FuncCallOrArray iary [] [(() 1 () 0) (() 1 () 0)] [] [] [] )] () ) (If 0 () (/= (FuncCallOrArray iary [] [(() 1 () 0) (() 1 () 0)] [] [] [] ) 9) [(ErrorStop 0 () () () )] [] () () () ) (Print 0 () [(FuncCallOrArray iarx [] [(() 2 () 0) (() 1 () 0)] [] [] [] )] () ) (If 0 () (/= (FuncCallOrArray iarx [] [(() 2 () 0) (() 1 () 0)] [] [] [] ) 1950) [(ErrorStop 0 () () () )] [] () () () ) (Print 0 () [(FuncCallOrArray iary [] [(() 2 () 0) (() 1 () 0)] [] [] [] )] () ) (If 0 () (/= (FuncCallOrArray iary [] [(() 2 () 0) (() 1 () 0)] [] [] [] ) 1350) [(ErrorStop 0 () () () )] [] () () () ) (Print 0 () [(FuncCallOrArray iarx [] [(() 3 () 0) (() 1 () 0)] [] [] [] )] () ) (If 0 () (/= (FuncCallOrArray iarx [] [(() 3 () 0) (() 1 () 0)] [] [] [] ) 4350) [(ErrorStop 0 () () () )] [] () () () ) (Print 0 () [(FuncCallOrArray iary [] [(() 3 () 0) (() 1 () 0)] [] [] [] )] () ) (If 0 () (/= (FuncCallOrArray iary [] [(() 3 () 0) (() 1 () 0)] [] [] [] ) 4) [(ErrorStop 0 () () () )] [] () () () )] [(DataStmt 0 [(DataStmtSet [(DataImpliedDo [(FuncCallOrArray iarx [] [(() i () 0) (() 1 () 0)] [] [] [] ) (FuncCallOrArray iary [] [(() i () 0) (() 1 () 0)] [] [] [] )] () i 1 3 () )] [1 9 1950 1350 4350 4] )] () ) (Print 0 () [(String "3" ())] () )] () () () ) (Print 0 () [(String "4" ())] () ) (DataStmt 0 [(DataStmtSet [(DataImpliedDo [(FuncCallOrArray iary [] [(() i () 0) (() 1 () 0)] [] [] [] )] () i 1 3 () )] [1 9 1950] )] () ) (Print 0 () [(String "5" ())] () )] [] )] ) lfortran-0.63.0/tests/reference/wat-logical1-ef567ea.json0000664000175000017500000000072515174404631023243 0ustar alastairalastair{ "basename": "wat-logical1-ef567ea", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/logical1.f90", "infile_hash": "3768bda3700377afdf458a45ed70e2be9481e14ae76fda62adbe38e8", "outfile": null, "outfile_hash": null, "stdout": "wat-logical1-ef567ea.stdout", "stdout_hash": "cd583abecbaf0765bb5bcdafc4ed73f3b5a5b12eff48b3ff164bd75a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-case_05-a43ab42.stdout0000664000175000017500000000714015174404631023230 0ustar alastairalastair(TranslationUnit [(Program case_05 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! local variable declaration" )] ) )] [(Declaration (AttrType TypeCharacter [] () () None ) [] [(grade [] [] () (String "B" ()) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Select 0 () grade [(CaseStmt [(CaseCondExpr (String "A" ()) )] () [(Print 0 () [(String "Excellent!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondExpr (String "B" ()) )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] ) (CaseStmt [(CaseCondExpr (String "C" ()) )] () [(Print 0 () [(String "Well done" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondExpr (String "D" ()) )] () [(Print 0 () [(String "You passed" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondExpr (String "F" ()) )] () [(Print 0 () [(String "Better try again" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt_Default () [(Print 0 () [(String "Invalid grade" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [(String "Your grade is " ()) grade] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/asr-close_invalid_kwarg1-b38b499.stderr0000664000175000017500000000022215174404631026015 0ustar alastairalastairsemantic error: Invalid argument `end` supplied --> tests/errors/close_invalid_kwarg1.f90:4:5 | 4 | CLOSE(end=200) | ^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-allocate_02-3c0d7c8.stdout0000664000175000017500000015710415174404631024115 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { allocate_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ierr: (Variable 2 ierr [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), isource: (Variable 2 isource [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), whole_square: (Function (SymbolTable 3 { a: (Variable 3 a [] Unspecified () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a_2: (Variable 3 a_2 [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ab: (Variable 3 ab [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), abc: (Variable 3 abc [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] Unspecified () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b_2: (Variable 3 b_2 [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), bc: (Variable 3 bc [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 3 c [] Unspecified () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c_2: (Variable 3 c_2 [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ca: (Variable 3 ca [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 3 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), status: (Variable 3 status [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) whole_square (FunctionType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 c)] [(Assignment (Var 3 n) (ArraySize (Var 3 a) () (Integer 4) () ) () .false. .false. ) (Allocate [((Var 3 a_2) [((IntegerConstant 1 (Integer 4) Decimal) (Var 3 n))] () () ()) ((Var 3 b_2) [((IntegerConstant 1 (Integer 4) Decimal) (Var 3 n))] () () ()) ((Var 3 c_2) [((IntegerConstant 1 (Integer 4) Decimal) (Var 3 n))] () () ())] () () () ) (Allocate [((Var 3 ab) [((IntegerConstant 1 (Integer 4) Decimal) (Var 3 n))] () () ()) ((Var 3 bc) [((IntegerConstant 1 (Integer 4) Decimal) (Var 3 n))] () () ()) ((Var 3 ca) [((IntegerConstant 1 (Integer 4) Decimal) (Var 3 n))] () () ()) ((Var 3 abc) [((IntegerConstant 1 (Integer 4) Decimal) (Var 3 n))] () () ())] () () () ) (Assignment (Var 3 status) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 a_2) (IntegerBinOp (Var 3 a) Mul (Var 3 a) (Array (Integer 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 3 b_2) (IntegerBinOp (Var 3 b) Mul (Var 3 b) (Array (Integer 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 3 c_2) (IntegerBinOp (Var 3 c) Mul (Var 3 c) (Array (Integer 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 3 ab) (IntegerBinOp (IntegerBinOp (ArrayBroadcast (IntegerConstant 2 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 3 a)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) Mul (Var 3 a) (Array (Integer 4) [(() ())] DescriptorArray ) () ) Mul (Var 3 b) (Array (Integer 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 3 bc) (IntegerBinOp (IntegerBinOp (ArrayBroadcast (IntegerConstant 2 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 3 b)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) Mul (Var 3 b) (Array (Integer 4) [(() ())] DescriptorArray ) () ) Mul (Var 3 c) (Array (Integer 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 3 ca) (IntegerBinOp (IntegerBinOp (ArrayBroadcast (IntegerConstant 2 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 3 c)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) Mul (Var 3 c) (Array (Integer 4) [(() ())] DescriptorArray ) () ) Mul (Var 3 a) (Array (Integer 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 3 abc) (IntegerBinOp (IntegerBinOp (IntegerBinOp (ArrayBroadcast (IntegerConstant 2 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 3 a)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) Mul (Var 3 a) (Array (Integer 4) [(() ())] DescriptorArray ) () ) Mul (Var 3 b) (Array (Integer 4) [(() ())] DescriptorArray ) () ) Mul (Var 3 c) (Array (Integer 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 3 status) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. )] (Var 3 status) Public .true. .true. () ) }) allocate_01 [] [(Assignment (Var 2 n) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (Allocate [((Var 2 a) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] () () ()) ((Var 2 b) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] () () ()) ((Var 2 c) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] () () ())] (Var 2 ierr) () (Var 2 isource) ) (Assignment (Var 2 a) (Var 2 isource) () .false. .false. ) (Assignment (Var 2 b) (Var 2 isource) () .false. .false. ) (Assignment (Var 2 c) (Var 2 isource) () .false. .false. ) (Assignment (Var 2 a) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 2 a)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) () .false. .false. ) (Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 2 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 2 b)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) () .false. .false. ) (Assignment (Var 2 c) (ArrayBroadcast (IntegerConstant 3 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 2 c)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) () .false. .false. ) (Print (StringFormat () [(FunctionCall 2 whole_square () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/run-format_08-581c944.stdout0000664000175000017500000000007515174404631023506 0ustar alastairalastair 1 1 1 1 1 1 1 1 1 1 lfortran-0.63.0/tests/reference/fortran-expr_05-1df98eb.json0000664000175000017500000000075315174404631023713 0ustar alastairalastair{ "basename": "fortran-expr_05-1df98eb", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/expr_05.f90", "infile_hash": "ab6fcfdb7d7b127b347b822368c1a3d22c7241a82453de78dd535c05", "outfile": null, "outfile_hash": null, "stdout": "fortran-expr_05-1df98eb.stdout", "stdout_hash": "60e8f2848df482856cbe4de15d6d4c8f5af074491104be94623adf02", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-where_04-a7fce45.json0000664000175000017500000000074215174404631023152 0ustar alastairalastair{ "basename": "asr-where_04-a7fce45", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/where_04.f90", "infile_hash": "48449a9af8d215a5a118d0776d25e23b7b310df89b1775164ddfde5e", "outfile": null, "outfile_hash": null, "stdout": "asr-where_04-a7fce45.stdout", "stdout_hash": "12e033015aa807086badd15f2b75669e76cd480324bdbe451a467a70", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-logical1-ef567ea.stdout0000664000175000017500000001271315174404631023614 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i32) i32.const 1 local.set 0 i32.const 0 local.set 1 local.get 0 i64.extend_i32_s call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-0.63.0/tests/reference/asr-expr4-6c75096.stdout0000664000175000017500000000375315174404631022742 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { }) [(RealConstant 5.000000 (Real 4) ) (RealBinOp (RealConstant 5.000000 (Real 4) ) Add (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant 8.000000 (Real 4) ) ) (RealBinOp (RealBinOp (RealConstant 5.000000 (Real 4) ) Add (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant 8.000000 (Real 4) ) ) Mul (RealConstant 2.000000 (Real 4) ) (Real 4) (RealConstant 16.000000 (Real 4) ) ) (RealBinOp (RealConstant 5.000000 (Real 4) ) Add (RealBinOp (RealConstant 3.000000 (Real 4) ) Mul (RealConstant 2.000000 (Real 4) ) (Real 4) (RealConstant 6.000000 (Real 4) ) ) (Real 4) (RealConstant 11.000000 (Real 4) ) ) (RealBinOp (RealConstant 5.000000 (Real 4) ) Sub (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant 2.000000 (Real 4) ) ) (RealBinOp (RealConstant 4.000000 (Real 4) ) Pow (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant 64.000000 (Real 4) ) )] ) lfortran-0.63.0/tests/reference/asr-string_02-bc2a3b9.json0000664000175000017500000000074515174404631023336 0ustar alastairalastair{ "basename": "asr-string_02-bc2a3b9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_02.f90", "infile_hash": "249fc849c605e3aad0bd2c8a33e00523fdc2270b95caa69737801caa", "outfile": null, "outfile_hash": null, "stdout": "asr-string_02-bc2a3b9.stdout", "stdout_hash": "a25a4877d8987b5807864f88550dd8c17557757a3e419674c7317d57", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-case_01-cbdd0aa.stdout0000664000175000017500000000115015174404631023752 0ustar alastairalastairfunction main() local i::Int64 local out::Int64 i = 4 if i == 1 out = 10 println("1") elseif i == 2 out = 20 println("2") elseif i == 3 out = 30 println("3") elseif i == 4 out = 40 println("4") end if out ≠ 40 println(Base.stderr, "ERROR STOP") exit(1) end if i == 1 out = 11 println("1") elseif i == 2 || i == 3 || i == 4 out = 22 println("2,3,4") end if out ≠ 22 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-0.63.0/tests/reference/asr-nullify_04-a75db8a.stdout0000664000175000017500000002224415174404631024071 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { module_nullify_04: (Module (SymbolTable 2 { scaled_data_structure: (Struct (SymbolTable 3 { one_d_real_pointer: (Variable 3 one_d_real_pointer [] Local () () Default (Pointer (Array (Real 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) scaled_data_structure (StructType [(Pointer (Array (Real 4) [(() ())] DescriptorArray ) )] [] .true. .false. ) [] [one_d_real_pointer] [] Source Public .false. .false. [] () () [] ) }) module_nullify_04 () [] .false. .false. .false. ), nullify_04: (Program (SymbolTable 4 { 1_scaled_data_structure_one_d_real_pointer: (ExternalSymbol 4 1_scaled_data_structure_one_d_real_pointer 3 one_d_real_pointer scaled_data_structure [] one_d_real_pointer Public ), s: (Variable 4 s [] Local () () Default (StructType [(Pointer (Array (Real 4) [(() ())] DescriptorArray ) )] [] .true. .false. ) 4 scaled_data_structure Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s2: (Variable 4 s2 [] Local () () Default (StructType [(Pointer (Array (Real 4) [(() ())] DescriptorArray ) )] [] .true. .false. ) 4 scaled_data_structure Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), scaled_data_structure: (ExternalSymbol 4 scaled_data_structure 2 scaled_data_structure module_nullify_04 [] scaled_data_structure Public ) }) nullify_04 [module_nullify_04] [(Nullify [(StructInstanceMember (Var 4 s) 4 1_scaled_data_structure_one_d_real_pointer (Pointer (Array (Real 4) [(() ())] DescriptorArray ) ) () )] ) (Nullify [(StructInstanceMember (Var 4 s2) 4 1_scaled_data_structure_one_d_real_pointer (Pointer (Array (Real 4) [(() ())] DescriptorArray ) ) () )] )] ) }) [] ) lfortran-0.63.0/tests/reference/run-format_26-f627ed6.stdout0000664000175000017500000000002015174404631023636 0ustar alastairalastair 42 666 42 666 lfortran-0.63.0/tests/reference/asr-array_constructor_with_integer_real_array_types-c665202.json0000664000175000017500000000111115174404631033255 0ustar alastairalastair{ "basename": "asr-array_constructor_with_integer_real_array_types-c665202", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_constructor_with_integer_real_array_types.f90", "infile_hash": "17fbb7758226f84e587218354c221dad9ae645d719e685881fd7eea3", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_constructor_with_integer_real_array_types-c665202.stderr", "stderr_hash": "27ae450141135b7ff688eaef0b41422c1d2ace6ac28e8f3664a7f41e", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-global_scope3-57006df.json0000664000175000017500000000073415174404631024107 0ustar alastairalastair{ "basename": "asr-global_scope3-57006df", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope3.f90", "infile_hash": "60cea65abfbb2228d16f175ea192462ae2379d7a9da1601cb3de9f3a", "outfile": null, "outfile_hash": null, "stdout": "asr-global_scope3-57006df.stdout", "stdout_hash": "659a902c7dcf53edb71006bcaf782337934714cdb6bdfe70dea35f8e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit4-704272e.json0000664000175000017500000000106215174404631023203 0ustar alastairalastair{ "basename": "asr-implicit4-704272e", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit4.f90", "infile_hash": "e6c1d3c3a3a1035d1b04865b063a479380fdb2a911cb4e4c19c67ff8", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit4-704272e.stdout", "stdout_hash": "6ac73da5cc09a5ff615b37c1d5a8a9354d75092a915803eb451f6a44", "stderr": "asr-implicit4-704272e.stderr", "stderr_hash": "60e6b5b71dd6e647e2f6504b3951ff2c5958e4517113087b2a3a448e", "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-fmt1-c767956.stdout0000664000175000017500000000100115174404631023216 0ustar alastairalastairreal(c_float) :: r real(c_float) :: r character(kind=c_char) :: c character(len=*) :: c character(len=*) :: c character(len=*, kind=c_char) :: c character(len=*, kind=c_char) :: c character(len=*, kind=c_char) :: c character(len=:) :: c character(len=:) :: c character(len=:, kind=c_char) :: c character(len=:, kind=c_char) :: c character(len=:, kind=c_char) :: c character(len=n) :: c character(len=n) :: c character(len=n, kind=c_char) :: c character(len=n, kind=c_char) :: c character(len=n, kind=c_char) :: c lfortran-0.63.0/tests/reference/ast-forall1-50096b8.stderr0000664000175000017500000000057615174404631023215 0ustar alastairalastairstyle suggestion: Use '/=' instead of '.ne.' --> tests/forall1.f90:9:33 | 9 | forall (i=1:n, j=1:m, A(i,j).NE.0) & | ^^^^ help: write this as '/=' style suggestion: Use '/=' instead of '.ne.' --> tests/forall1.f90:36:34 | 36 | inner: forall (j=1:100, i.NE.j) | ^^^^ help: write this as '/=' lfortran-0.63.0/tests/reference/ast-double_complex1-2f3d83c.stdout0000664000175000017500000000105415174404631025105 0ustar alastairalastair(TranslationUnit [(Program test_double_complex () [] [] [(Declaration (AttrType TypeDoubleComplex [] () () None ) [] [(y [] [] () () None ()) (zwork [] [] () () None ())] () )] [] [] )] ) lfortran-0.63.0/tests/reference/pass_global_stmts-global_scope6-278bd63.json0000664000175000017500000000101415174404631027041 0ustar alastairalastair{ "basename": "pass_global_stmts-global_scope6-278bd63", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope6.f90", "infile_hash": "3f2dfa122b78175565b7baa8f4d0417cfb0ed5bbe26bbb5f0f1f6f2e", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope6-278bd63.stdout", "stdout_hash": "986932cfe85f5099195e9fe438a34d817d77bbca81830107b97a3a58", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-write7-6ba53a1.json0000664000175000017500000000070715174404631022663 0ustar alastairalastair{ "basename": "asr-write7-6ba53a1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/write7.f90", "infile_hash": "72e9fcaf8f4630dca63e67f6803d98543e8fdedc2ba0e20224168db8", "outfile": null, "outfile_hash": null, "stdout": "asr-write7-6ba53a1.stdout", "stdout_hash": "226ddb7c533d06d2a4cf8f2720924bf401842d5642cbfc0258edb6a0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-return_05-b1ab26b.stdout0000664000175000017500000000315515174404631024100 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [11 x i8] c"Hello world" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([11 x i8], [11 x i8]* @string_const_data, i32 0, i32 0), i64 11 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @f() { .entry: br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return ret void } define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) br label %return unreachable_after_return: ; No predecessors! %2 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %2, i32 11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %return return: ; preds = %unreachable_after_return, %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-types_06-58f9b18.stdout0000664000175000017500000005250715174404631023435 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { types_06: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 2 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) types_06 [] [(Assignment (Var 2 r) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 i) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (If () (IntegerCompare (Var 2 i) Lt (Var 2 i) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) Lt (Var 2 r) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) Lt (Cast (Var 2 i) IntegerToReal (Real 4) () () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (Var 2 i) IntegerToReal (Real 4) () () ) Lt (Var 2 r) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 i) Gt (Var 2 i) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) Gt (Var 2 r) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) Gt (Cast (Var 2 i) IntegerToReal (Real 4) () () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (Var 2 i) IntegerToReal (Real 4) () () ) Gt (Var 2 r) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 i) NotEq (Var 2 i) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) NotEq (Var 2 r) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) NotEq (Cast (Var 2 i) IntegerToReal (Real 4) () () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (Var 2 i) IntegerToReal (Real 4) () () ) NotEq (Var 2 r) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (Var 2 i) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (RealBinOp (Var 2 r) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) (Real 4) () ) LtE (Var 2 r) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (RealBinOp (Var 2 r) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) (Real 4) () ) LtE (Cast (Var 2 i) IntegerToReal (Real 4) () () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 4) () () ) LtE (Var 2 r) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 i) GtE (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) GtE (RealBinOp (Var 2 r) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) (Real 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) GtE (Cast (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 4) () () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (Var 2 i) IntegerToReal (Real 4) () () ) GtE (RealBinOp (Var 2 r) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) (Real 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 i) Eq (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) Eq (RealBinOp (Var 2 r) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) (Real 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) Eq (Cast (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 4) () () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (Var 2 i) IntegerToReal (Real 4) () () ) Eq (RealBinOp (Var 2 r) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) (Real 4) () ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-string_02-604c7cc.json0000664000175000017500000000074515174404631023264 0ustar alastairalastair{ "basename": "ast-string_02-604c7cc", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_02.f90", "infile_hash": "249fc849c605e3aad0bd2c8a33e00523fdc2270b95caa69737801caa", "outfile": null, "outfile_hash": null, "stdout": "ast-string_02-604c7cc.stdout", "stdout_hash": "4469a9a38b538092272266e660fde089c2aa73a8bf5c3d3ff6db64a6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-entry1-5f14c6d.stdout0000664000175000017500000000043115174404631023721 0ustar alastairalastairprogram entry1 real :: dummy dummy = 10 call x(dummy) call y(dummy) end program entry1 subroutine x(dummy) real :: dummy print *, "Printed using subroutine call: ", dummy dummy = 5.0 return entry y(dummy) print *, "Printed using entry statement: ", dummy return end subroutine x lfortran-0.63.0/tests/reference/asr-fixed_number_of_args-051b0f1.json0000664000175000017500000000077015174404631025525 0ustar alastairalastair{ "basename": "asr-fixed_number_of_args-051b0f1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/fixed_number_of_args.f90", "infile_hash": "1b3aa87f3b596e48a59fbdde7a0d087382fe86f59b16d140a9080f67", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-fixed_number_of_args-051b0f1.stderr", "stderr_hash": "0b27b7f5c19c3839e3d0a9d6780e620fc12356cfaf3e1f64acd9b7ba", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-sqrt_neg-5a20839.stderr0000664000175000017500000000023415174404631023462 0ustar alastairalastairsemantic error: Argument of `sqrt` has a negative argument --> tests/errors/sqrt_neg.f90:2:14 | 2 | print *, sqrt(-1.0) | ^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-program_without_line_03-02055a5.json0000664000175000017500000000100115174404631026032 0ustar alastairalastair{ "basename": "ast-program_without_line_03-02055a5", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/program_without_line_03.f90", "infile_hash": "c13c381753891f9763d89fca907d09d8b91fbeb4a75cea48bb067bd2", "outfile": null, "outfile_hash": null, "stdout": "ast-program_without_line_03-02055a5.stdout", "stdout_hash": "07d77481a3e5fd16c38342d0b79d66659db3518386c72f91bfb82432", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_14-75884fe.json0000664000175000017500000000077215174404631024566 0ustar alastairalastair{ "basename": "asr-derived_types_14-75884fe", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_14.f90", "infile_hash": "e48139c0e3c8b0587ad6aa57eb7d1790439bcf6b7b8318bdf1274c50", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_14-75884fe.stdout", "stdout_hash": "f87eeb0dcb1a58b5c650489e0aacdafbe2021c6cea2c9a92ba6721bb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format_51-f69fffa.stdout0000664000175000017500000000022415174404631024006 0ustar alastairalastairbinary 2: 00000000000000000000000000000010 binary 255: 11111111 binary -1: **************** binary 42: 101010 binary 7: 111 01111 100 PASSED lfortran-0.63.0/tests/reference/ast-loop_test5-d27e6d6.json0000664000175000017500000000073615174404631023562 0ustar alastairalastair{ "basename": "ast-loop_test5-d27e6d6", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/loop_test5.f", "infile_hash": "b0b55d75eb00726ea0683cc0829370dd7bb145ae4db703c5448b5e58", "outfile": null, "outfile_hash": null, "stdout": "ast-loop_test5-d27e6d6.stdout", "stdout_hash": "7afaa986dd75ab5b51ef4290815e8da71adfd6d305ece299f5b05863", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-incorrect_type_where_01-8974c02.stderr0000664000175000017500000000024415174404631026371 0ustar alastairalastairsemantic error: the argument to `where` must be an array --> tests/errors/incorrect_type_where_01.f90:5:10 | 5 | where(.true.) b = 12121 | ^^^^^^ lfortran-0.63.0/tests/reference/ast_f90-entry1-5f14c6d.json0000664000175000017500000000072215174404631023353 0ustar alastairalastair{ "basename": "ast_f90-entry1-5f14c6d", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/entry1.f90", "infile_hash": "ca0b3d63526c84c42bb3f45badc8a6393867586040e33d02c7a8561c", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-entry1-5f14c6d.stdout", "stdout_hash": "e121152a4ada136406c6f0cc3ea206189fc7fbea0cd3d5cb1a401bcf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-logical4-b4e6b33.stdout0000664000175000017500000000526715174404631023712 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [12 x i8] c"L32,L32,L32\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 store i32 1, i32* %a, align 4 store i32 1, i32* %b, align 4 store i32 0, i32* %c, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %a, i32* %b, i32* %c) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_logical4 FINALIZE_SYMTABLE_logical4: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/cpp-program4-1796cb6.json0000664000175000017500000000101715174404631023124 0ustar alastairalastair{ "basename": "cpp-program4-1796cb6", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/program4.f90", "infile_hash": "16adb5a498028ea668b9d513bb2ef0fa0b12e15bef4e2b5e30aa2740", "outfile": null, "outfile_hash": null, "stdout": "cpp-program4-1796cb6.stdout", "stdout_hash": "c3ba4a8ff33090c0ec2d1b3cea398b2206468ae7ac724191ce735d81", "stderr": "cpp-program4-1796cb6.stderr", "stderr_hash": "3e15ec8a328c3f581817cf479d93e1f7166d89865efb6fb03f1909b8", "returncode": 0 }lfortran-0.63.0/tests/reference/ast-do_concurrent_reduce-58dd849.json0000664000175000017500000000076115174404631025606 0ustar alastairalastair{ "basename": "ast-do_concurrent_reduce-58dd849", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do_concurrent_reduce.f90", "infile_hash": "44ebdebb05b853f4680c203c3b2b0e98e9285d1f3923ecbc255bc105", "outfile": null, "outfile_hash": null, "stdout": "ast-do_concurrent_reduce-58dd849.stdout", "stdout_hash": "7ed479c552c0ce3f4d28a00e6a9e87dfc161d764bef40fb9cfca3ee5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-associate_02-ca5c9ec.json0000664000175000017500000000075615174404631024074 0ustar alastairalastair{ "basename": "asr-associate_02-ca5c9ec", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/associate_02.f90", "infile_hash": "d3505eea2e17cbf463e707ee2faf24aedf12a13ebb06fee4a5a1adfb", "outfile": null, "outfile_hash": null, "stdout": "asr-associate_02-ca5c9ec.stdout", "stdout_hash": "506e906d8beafc4e354a7210695cb92f66f6f66d69d9832c71493b2e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor11-dc5b2d5.stdout0000664000175000017500000001475015174404631027241 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor11: (Program (SymbolTable 2 { }) preprocessor11 [] [(Print (StringFormat () [(IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Add (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Mul (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 15 (Integer 4) Decimal) ) (Integer 4) (IntegerConstant 16 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "X is 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X is not 2" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Not X is not 1" (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X is 1 and Y is 5" (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Not (X is 2 and Y is 5)" (String 1 (IntegerConstant 23 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X<3 and Y>3" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Not (X>3 and Y<3)" (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X is 3-2" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X is not 3-1" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Y is (6*5-5)/5" (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Y is not (6*5-6)/5" (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Y is (-5+6*5)/5" (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Y is not (-6+6*5)/5" (String 1 (IntegerConstant 19 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Y is (+5+6*5)/7" (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Y is not (+4+6*5)/7" (String 1 (IntegerConstant 19 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Y is (+5+6*Y)/7" (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Z is 16" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Y defined and 1 <= Y" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "A not defined or not 1 <= A" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr_enable_style_suggestion-style1-a2fdd22.stdout0000664000175000017500000000001015174404631030276 0ustar alastairalastair y is 1 lfortran-0.63.0/tests/reference/asr_preprocess-cpp3-1719443.stderr0000664000175000017500000000021615174404631024673 0ustar alastairalastairsemantic error: Variable 'xx' is not declared --> tests/errors/cpp3.f90:7:10 | 7 | print *, xx, X123, y | ^^ 'xx' is undeclared lfortran-0.63.0/tests/reference/ast-program_04-114a023.json0000664000175000017500000000075015174404631023245 0ustar alastairalastair{ "basename": "ast-program_04-114a023", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/program_04.f90", "infile_hash": "6d4faa951231e470e99cbc3ff617437048ceb99e3d92ba6e7810ef43", "outfile": null, "outfile_hash": null, "stdout": "ast-program_04-114a023.stdout", "stdout_hash": "7fc2eca3a57ac776159f26e1191c79ae6df28fa5ec3d0e53f2a49f5f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-subroutine2-2e9b84b.json0000664000175000017500000000073515174404631023741 0ustar alastairalastair{ "basename": "asr-subroutine2-2e9b84b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/subroutine2.f90", "infile_hash": "8d668071a906445fe0fbdca2d363b4a71347144c0a1c6c63893bd3b6", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-subroutine2-2e9b84b.stderr", "stderr_hash": "cdd6f5045d10d67292e10e561b3e3e368e46a987db60c98c39e16392", "returncode": 2 }lfortran-0.63.0/tests/reference/run-stop_03-897cacd.json0000664000175000017500000000070715174404631023050 0ustar alastairalastair{ "basename": "run-stop_03-897cacd", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/stop_03.f90", "infile_hash": "87d669b34b513b6802c7b254562f8ea915c2a166d298150441398562", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-stop_03-897cacd.stderr", "stderr_hash": "3e23cf1cb50e4b97d71757a6cc871271723a4247df92d3c07b24a0b0", "returncode": 0 }lfortran-0.63.0/tests/reference/ast-array9-fe1439d.stdout0000664000175000017500000001321015174404631023232 0ustar alastairalastair(TranslationUnit [(Program array9 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [(DerivedType varying_string [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Declaration (AttrType TypeCharacter [(len 1 Value)] () () None ) [(SimpleAttribute AttrAllocatable )] [(characters [(() () DimensionExpr)] [] () () None ())] () )] [] ) (Declaration (AttrType TypeType [] () varying_string None ) [] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () varying_string None ) [(SimpleAttribute AttrAllocatable )] [(a [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrAllocatable )] [(b [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrAllocatable )] [(c [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [(kind 4 Value)] () () None ) [(SimpleAttribute AttrAllocatable )] [(d [(() () DimensionExpr)] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 a (ArrayInitializer () varying_string [] ) () ) (Assignment 0 b (ArrayInitializer (AttrType TypeReal [] () () None ) () [] ) () ) (Assignment 0 b (ArrayInitializer (AttrType TypeInteger [] () () None ) () [] ) () ) (Assignment 0 d (ArrayInitializer (AttrType TypeReal [(kind 4 Value)] () () None ) () [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 a (ArrayInitializer () varying_string [x x] ) () ) (Assignment 0 b (ArrayInitializer (AttrType TypeReal [] () () None ) () [(Real "1.0") (Real "2.0")] ) () ) (Assignment 0 b (ArrayInitializer (AttrType TypeInteger [] () () None ) () [1 2] ) () ) (Assignment 0 d (ArrayInitializer (AttrType TypeReal [(kind 4 Value)] () () None ) () [(Real "1.0") (Real "2.0")] ) () )] [] )] ) lfortran-0.63.0/tests/reference/llvm-classes2-f926d51.json0000664000175000017500000000072015174404631023277 0ustar alastairalastair{ "basename": "llvm-classes2-f926d51", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/classes2.f90", "infile_hash": "2cfac3880e7182601f0b4be7f9818327edf969abff5d13be53cbf23d", "outfile": null, "outfile_hash": null, "stdout": "llvm-classes2-f926d51.stdout", "stdout_hash": "270522bb7919847769ed8c97ee45cb404c04fca7969124a93fa8ade2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_size_02-94fb4d3.stderr0000664000175000017500000000031415174404631024454 0ustar alastairalastairsemantic error: dim has already been specified as a positional/keyword argument to size --> tests/errors/array_size_02.f90:5:14 | 5 | size_a = size(a, 1, dim=1) | ^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor10-6279d1f.stdout0000664000175000017500000000655015174404631027111 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor10: (Program (SymbolTable 2 { }) preprocessor10 [] [(Print (StringConstant "X is defined" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Y is defined" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Z is not defined" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X and Y is defined" (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Z and Y is not defined" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Z or Y is defined" (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X and Y and Z is not defined" (String 1 (IntegerConstant 28 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X and Y or Z is defined" (String 1 (IntegerConstant 23 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X and Y or Z is defined" (String 1 (IntegerConstant 23 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X and !Y or !Z is defined" (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X and !(Y or Z) is not defined" (String 1 (IntegerConstant 30 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-modules_02-dc19c13.stdout0000664000175000017500000010153415174404631023773 0ustar alastairalastair(TranslationUnit [(Module random (TriviaNode [(EndOfLine) (EndOfLine)] [] ) [(Use [] types [(UseSymbol dp () )] .true. () ) (Use [] utils [(UseSymbol stop_error () )] .true. () )] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(randn [] [] () () None ()) (rand_gamma [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Interface (InterfaceHeaderName randn ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [randn_scalar] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [randn_vector] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [randn_matrix] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [randn_vector_n] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderName rand_gamma ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [rand_gamma_scalar] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [rand_gamma_vector] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [rand_gamma_matrix] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [rand_gamma_vector_n] [(SimpleAttribute AttrModule )] () )] )] [] [(Subroutine randn_scalar [(x)] [] () (TriviaNode [(EndOfLine) (Comment "! Returns a psuedorandom scalar drawn from the standard normal distribution." ) (Comment "!" ) (Comment "! [1] Marsaglia, G., & Bray, T. A. (1964). A Convenient Method for Generating" ) (Comment "! Normal Variables. SIAM Review, 6(3), 260-264." )] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [(SimpleAttribute AttrSave )] [(first [] [] () (Logical .true. ()) Equal ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrSave )] [(u [(1 2 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [] [(r2 [] [] () () None ())] () )] [(If 0 () first [(DoLoop 0 () 0 () () () () [(SubroutineCall 0 random_number [] [(() u () 0)] [] [] () ) (Assignment 0 u (- (* 2 u) 1) () ) (Assignment 0 r2 (FuncCallOrArray sum [] [(() (** u 2) () 0)] [] [] [] ) () ) (If 0 () (BoolOp (< r2 1) And (> r2 0) ) [(Exit 0 () () )] [] () () () )] () () ) (Assignment 0 u (* u (FuncCallOrArray sqrt [] [(() (/ (* (u- 2) (FuncCallOrArray log [] [(() r2 () 0)] [] [] [] )) r2) () 0)] [] [] [] )) () ) (Assignment 0 x (FuncCallOrArray u [] [(() 1 () 0)] [] [] [] ) () )] [(Assignment 0 x (FuncCallOrArray u [] [(() 2 () 0)] [] [] [] ) () )] () () () ) (Assignment 0 first (not first) () )] [] [] ) (Subroutine randn_vector_n [(n) (x)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(x [(1 n DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(DoLoop 0 () 0 i 1 (FuncCallOrArray size [] [(() x () 0)] [] [] [] ) () [(SubroutineCall 0 randn [] [(() (FuncCallOrArray x [] [(() i () 0)] [] [] [] ) () 0)] [] [] () )] () () )] [] [] ) (Subroutine randn_vector [(x)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(x [(() () DimensionExpr)] [] () () None ())] () )] [(SubroutineCall 0 randn_vector_n [] [(() (FuncCallOrArray size [] [(() x () 0)] [] [] [] ) () 0) (() x () 0)] [] [] () )] [] [] ) (Subroutine randn_matrix [(x)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(x [(() () DimensionExpr) (() () DimensionExpr)] [] () () None ())] () )] [(SubroutineCall 0 randn_vector_n [] [(() (FuncCallOrArray size [] [(() x () 0)] [] [] [] ) () 0) (() x () 0)] [] [] () )] [] [] ) (Subroutine rand_gamma0 [(a) (first) (fn_val)] [] () (TriviaNode [(EndOfLine) (Comment "! Returns a psuedorandom scalar drawn from the gamma distribution." ) (Comment "!" ) (Comment "! The shape parameter a >= 1." ) (Comment "!" ) (Comment "! [1] Marsaglia, G., & Tsang, W. W. (2000). A Simple Method for Generating" ) (Comment "! Gamma Variables. ACM Transactions on Mathematical Software (TOMS), 26(3)," ) (Comment "! 363-372." )] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [(AttrIntent In )] [(first [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(fn_val [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrSave )] [(c [] [] () () None ()) (d [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [] [(U [] [] () () None ()) (v [] [] () () None ()) (x [] [] () () None ())] () )] [(If 0 () (< a 1) [(SubroutineCall 0 stop_error [] [(() (String "Shape parameter must be >= 1" ()) () 0)] [] [] () )] [] () () () ) (If 0 () first [(Assignment 0 d (- a (/ (Real "1._dp") 3)) () ) (Assignment 0 c (/ 1 (FuncCallOrArray sqrt [] [(() (* 9 d) () 0)] [] [] [] )) () )] [] () () () ) (DoLoop 0 () 0 () () () () [(DoLoop 0 () 0 () () () () [(SubroutineCall 0 randn [] [(() x () 0)] [] [] () ) (Assignment 0 v (** (+ 1 (* c x)) 3) () ) (If 0 () (> v 0) [(Exit 0 () () )] [] () () () )] () () ) (SubroutineCall 0 random_number [] [(() U () 0)] [] [] (TriviaNode [] [(EndOfLine) (Comment "! Note: the number 0.0331 below is exact, see [1]." )] ) ) (If 0 () (< U (- 1 (* (Real "0.0331_dp") (** x 4)))) [(Assignment 0 fn_val (* d v) () ) (Exit 0 () () )] [(If 0 () (< (FuncCallOrArray log [] [(() U () 0)] [] [] [] ) (+ (/ (** x 2) 2) (* d (+ (- 1 v) (FuncCallOrArray log [] [(() v () 0)] [] [] [] ))))) [(Assignment 0 fn_val (* d v) () ) (Exit 0 () () )] [] () () () )] () () () )] () () )] [] [] ) (Subroutine rand_gamma_scalar [(a) (x)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(x [] [] () () None ())] () )] [(SubroutineCall 0 rand_gamma0 [] [(() a () 0) (() (Logical .true. ()) () 0) (() x () 0)] [] [] () )] [] [] ) (Subroutine rand_gamma_vector_n [(a) (n) (x)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(x [(1 n DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(SubroutineCall 0 rand_gamma0 [] [(() a () 0) (() (Logical .true. ()) () 0) (() (FuncCallOrArray x [] [(() 1 () 0)] [] [] [] ) () 0)] [] [] () ) (DoLoop 0 () 0 i 2 (FuncCallOrArray size [] [(() x () 0)] [] [] [] ) () [(SubroutineCall 0 rand_gamma0 [] [(() a () 0) (() (Logical .false. ()) () 0) (() (FuncCallOrArray x [] [(() i () 0)] [] [] [] ) () 0)] [] [] () )] () () )] [] [] ) (Subroutine rand_gamma_vector [(a) (x)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(x [(() () DimensionExpr)] [] () () None ())] () )] [(SubroutineCall 0 rand_gamma_vector_n [] [(() a () 0) (() (FuncCallOrArray size [] [(() x () 0)] [] [] [] ) () 0) (() x () 0)] [] [] () )] [] [] ) (Subroutine rand_gamma_matrix [(a) (x)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(x [(() () DimensionExpr) (() () DimensionExpr)] [] () () None ())] () )] [(SubroutineCall 0 rand_gamma_vector_n [] [(() a () 0) (() (FuncCallOrArray size [] [(() x () 0)] [] [] [] ) () 0) (() x () 0)] [] [] () )] [] [] )] )] ) lfortran-0.63.0/tests/reference/ast-program3-e2fc2d1.json0000664000175000017500000000071515174404631023261 0ustar alastairalastair{ "basename": "ast-program3-e2fc2d1", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/program3.f90", "infile_hash": "f5e4a3f2a2a6f406171d0aa3895b5d7342c4d87b73ffede073827f34", "outfile": null, "outfile_hash": null, "stdout": "ast-program3-e2fc2d1.stdout", "stdout_hash": "28e8f482d908b247c131cf7853fbb910625fa811fcaa5eb77dc81652", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_openmp-pragma1-25cfcb2.json0000664000175000017500000000074115174404631024432 0ustar alastairalastair{ "basename": "asr_openmp-pragma1-25cfcb2", "cmd": "lfortran --show-asr --no-color --openmp {infile} -o {outfile}", "infile": "tests/pragma1.f90", "infile_hash": "0b9eea06186cb7eb1866b55256263d4e562835c40920f35b92ed18ee", "outfile": null, "outfile_hash": null, "stdout": "asr_openmp-pragma1-25cfcb2.stdout", "stdout_hash": "9f8da5a6501cd3b0d5bd4bee9c4b7c18c31389466093e99fd5ec895d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-nullify_01-810c9d3.stdout0000664000175000017500000000165115174404631024112 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %p1 = alloca i32*, align 8 store i32* null, i32** %p1, align 8 %p2 = alloca i32*, align 8 store i32* null, i32** %p2, align 8 %t1 = alloca i32, align 4 store i32* %t1, i32** %p1, align 8 store i32* %t1, i32** %p2, align 8 %2 = load i32*, i32** %p1, align 8 store i32 1, i32* %2, align 4 store i32* null, i32** %p1, align 8 store i32* null, i32** %p2, align 8 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_nullify_01 FINALIZE_SYMTABLE_nullify_01: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-dfloat1-6063adb.json0000664000175000017500000000072115174404631022773 0ustar alastairalastair{ "basename": "asr-dfloat1-6063adb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dfloat1.f90", "infile_hash": "b50b81a63b232ce8b4801c6c435c827b7df71baf4217dd90f15762e4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dfloat1-6063adb.stderr", "stderr_hash": "de5d5c88ec7bf943a3b4746575d13c97cc97b9cd9b8f4c9866791a8b", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-continue_compilation_coarrays-85ccad8.stderr0000664000175000017500000000217015174404631030212 0ustar alastairalastairsemantic error: Variable 'x' is not a coarray; coindex notation [..] requires a codimension attribute --> tests/errors/continue_compilation_coarrays.f90:5:9 | 5 | x = x[1] | ^^^^ semantic error: Coarray 'b' has corank 2 but 1 coindices were provided --> tests/errors/continue_compilation_coarrays.f90:9:5 | 9 | B[1] = 5 | ^^^^ semantic error: Variable 's' is not a coarray; coindex notation [..] requires a codimension attribute --> tests/errors/continue_compilation_coarrays.f90:17:11 | 17 | s%x = s%x[1] | ^^^^^^ semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_coarrays.f90:17:5 | 17 | s%x = s%x[1] | ^^^ ^^^^^^ type mismatch (integer and t) semantic error: Coarray 's' has corank 2 but 1 coindices were provided --> tests/errors/continue_compilation_coarrays.f90:20:5 | 20 | s%y[1] = 5 | ^^^^^^ semantic error: Coarray coindices do not support step notation (e.g., [i:j:k]) --> tests/errors/continue_compilation_coarrays.f90:23:9 | 23 | a = z[1:5:2] | ^^^^^^^^ lfortran-0.63.0/tests/reference/cpp-expr_05-3b5ec63.json0000664000175000017500000000072215174404631022726 0ustar alastairalastair{ "basename": "cpp-expr_05-3b5ec63", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/expr_05.f90", "infile_hash": "ab6fcfdb7d7b127b347b822368c1a3d22c7241a82453de78dd535c05", "outfile": null, "outfile_hash": null, "stdout": "cpp-expr_05-3b5ec63.stdout", "stdout_hash": "254da958ec0be8bf0705deaed51b55584a214ae34951339e2f090e85", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fn3-5eccc1b.stdout0000664000175000017500000000464515174404631022653 0ustar alastairalastair(TranslationUnit [(Function a [] [(SimpleAttribute AttrRecursive ) (SimpleAttribute AttrPure ) (AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) (Function b [] [(SimpleAttribute AttrPure ) (AttrType TypeInteger [] () () None ) (SimpleAttribute AttrElemental )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) (Function c [] [(SimpleAttribute AttrElemental ) (SimpleAttribute AttrPure ) (AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) (Function cb [] [(SimpleAttribute AttrElemental ) (SimpleAttribute AttrPure )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(cb [] [] () () None ())] () )] [] [] [] ) (Function d [] [(AttrType TypeInteger [] () () None ) (SimpleAttribute AttrPure ) (SimpleAttribute AttrRecursive )] () () () [] [] [] [] [] [] [] )] ) lfortran-0.63.0/tests/reference/ast-derived_type_without_start_program-089810e.json0000664000175000017500000000104215174404631030523 0ustar alastairalastair{ "basename": "ast-derived_type_without_start_program-089810e", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/derived_type_without_start_program.f90", "infile_hash": "868e3167deeaa36d65490e0f0763100113cd37df9967c7a3773a3f1c", "outfile": null, "outfile_hash": null, "stdout": "ast-derived_type_without_start_program-089810e.stdout", "stdout_hash": "ba7b92d9ec5ddefee702708a00141c93e300cd5d0049cc1e64f61967", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-statement1-481e9b6.stdout0000664000175000017500000007716115174404631024050 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { statement1: (Program (SymbolTable 2 { dfloat: (Function (SymbolTable 4 { dfloat_return_var_name: (Variable 4 dfloat_return_var_name [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 4 i [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 4 j [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) dfloat (FunctionType [(Integer 4) (Integer 4)] (Real 8) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 i) (Var 4 j)] [(Assignment (Var 4 dfloat_return_var_name) (Cast (IntegerBinOp (Var 4 i) Add (Var 4 j) (Integer 4) () ) IntegerToReal (Real 8) () () ) () .false. .false. )] (Var 4 dfloat_return_var_name) Public .false. .true. () ), dp: (Variable 2 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ifloat: (Function (SymbolTable 5 { i: (Variable 5 i [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ifloat_return_var_name: (Variable 5 ifloat_return_var_name [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 5 j [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ifloat (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 5 i) (Var 5 j)] [(Assignment (Var 5 ifloat_return_var_name) (IntegerBinOp (Var 5 i) Add (Var 5 j) (Integer 4) () ) () .false. .false. )] (Var 5 ifloat_return_var_name) Public .false. .true. () ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sfloat: (Function (SymbolTable 3 { i: (Variable 3 i [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 3 j [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sfloat_return_var_name: (Variable 3 sfloat_return_var_name [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sfloat (FunctionType [(Integer 4) (Integer 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 3 i) (Var 3 j)] [(Assignment (Var 3 sfloat_return_var_name) (Cast (IntegerBinOp (Var 3 i) Mul (Var 3 j) (Integer 4) () ) IntegerToReal (Real 4) () () ) () .false. .false. )] (Var 3 sfloat_return_var_name) Public .false. .true. () ), sum: (Variable 2 sum [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ti: (Variable 2 ti [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) statement1 [] [(Assignment (Var 2 ti) (FunctionCall 2 sfloat () [((IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 8 (Integer 4) Decimal))] (Real 4) () () ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 ti) Sub (Cast (IntegerConstant 8 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 8.000000 (Real 4) ) () ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 sum) (RealBinOp (FunctionCall 2 sfloat () [((IntegerConstant 12 (Integer 4) Decimal)) ((IntegerConstant 9 (Integer 4) Decimal))] (Real 4) () () ) Add (RealConstant 12.420000 (Real 4) ) (Real 4) () ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 sum) Sub (RealConstant 120.419998 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (FunctionCall 2 dfloat () [((IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 4 (Integer 4) Decimal))] (Real 8) () () ) Sub (Cast (IntegerConstant 9 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 9.000000 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (FunctionCall 2 ifloat () [((IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 4 (Integer 4) Decimal))] (Integer 4) () () ) NotEq (IntegerConstant 9 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-array9-25daf13.json0000664000175000017500000000072215174404631023331 0ustar alastairalastair{ "basename": "ast_f90-array9-25daf13", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/array9.f90", "infile_hash": "7107510b84a7e22f82d8f1f61617c399bc53b8a0fb59a5453419889c", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-array9-25daf13.stdout", "stdout_hash": "6486b5f54278b27b328aaac980f8684d357725453a07c4497ca55640", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_where-where_04-2ee4397.stdout0000664000175000017500000005544615174404631024755 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { compare_solutions: (Function (SymbolTable 3 { absdiff: (Variable 3 absdiff [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), reldiff: (Variable 3 reldiff [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) compare_solutions (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [solution] [] [(Assignment (Var 3 reldiff) (ArrayConstant 8 [0.00000000e+00, 0.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 3 absdiff) (RealConstant 0.500000 (Real 4) ) () .false. .false. ) (If () (RealCompare (FunctionCall 2 solution () [] (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () () ) NotEq (RealConstant 0.000000 (Real 4) ) (Array (Logical 4) [(() ())] DescriptorArray ) () ) [(Assignment (Var 3 reldiff) (RealBinOp (ArrayBroadcast (Var 3 absdiff) (IntrinsicArrayFunction Shape [(IntrinsicElementalFunction Abs [(FunctionCall 2 solution () [] (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () () )] 0 (Array (Real 4) [(() ())] DescriptorArray ) () )] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 4) [(() ())] DescriptorArray ) () ) Div (IntrinsicElementalFunction Abs [(FunctionCall 2 solution () [] (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () () )] 0 (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 3 reldiff) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 5.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 3 reldiff) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 5.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 3 reldiff)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), solution: (Function (SymbolTable 4 { x: (Variable 4 x [] ReturnVar () () Default (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) solution (FunctionType [] (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 4 x) (ArrayConstant 8 [1.00000001e-01, 1.00000001e-01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. )] (Var 4 x) Public .true. .true. () ) }) main [] [(SubroutineCall 2 compare_solutions () [] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-associate_07-a296ccb.stdout0000664000175000017500000003541515174404631024367 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { associate_07: (Program (SymbolTable 2 { p1: (Variable 2 p1 [] Local (PointerNullConstant (Pointer (Integer 4) ) () ) (PointerNullConstant (Pointer (Integer 4) ) () ) Save (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p2: (Variable 2 p2 [] Local (PointerNullConstant (Pointer (Array (Real 8) [(() ()) (() ())] DescriptorArray ) ) () ) (PointerNullConstant (Pointer (Array (Real 8) [(() ()) (() ())] DescriptorArray ) ) () ) Save (Pointer (Array (Real 8) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p3: (Variable 2 p3 [] Local (PointerNullConstant (Pointer (Array (Complex 4) [(() ()) (() ())] DescriptorArray ) ) () ) (PointerNullConstant (Pointer (Array (Complex 4) [(() ()) (() ())] DescriptorArray ) ) () ) Save (Pointer (Array (Complex 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t1: (Variable 2 t1 [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), t2: (Variable 2 t2 [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), t3: (Variable 2 t3 [] Local () () Default (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ) }) associate_07 [] [(Associate (Var 2 p1) (Var 2 t1) ) (Associate (Var 2 p2) (ArrayPhysicalCast (Var 2 t2) FixedSizeArray DescriptorArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () ) ) (If () (LogicalNot (PointerAssociated (Var 2 p1) () (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalNot (PointerAssociated (Var 2 p2) () (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalNot (PointerAssociated (Var 2 p1) (Var 2 t1) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalNot (PointerAssociated (Var 2 p2) (Var 2 t2) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (PointerAssociated (Var 2 p3) () (Logical 4) () ) [(ErrorStop () )] [] ) (If () (PointerAssociated (Var 2 p3) (Var 2 t3) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-type_casting_01-4e8a892.stderr0000664000175000017500000000035415174404631024725 0ustar alastairalastairsemantic error: Type mismatch in array initialization. Enable logical casting by setting `--logical-casting = true` --> tests/errors/type_casting_01.f90:3:5 | 3 | logical :: x(3) = [1, 1, 0] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/julia-arrays_04_func-2fc0cbe.json0000664000175000017500000000075515174404631024745 0ustar alastairalastair{ "basename": "julia-arrays_04_func-2fc0cbe", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/arrays_04_func.f90", "infile_hash": "50eb699e803e7dace8da286ee49cdb7381ebe3141bff17ca374f1f02", "outfile": null, "outfile_hash": null, "stdout": "julia-arrays_04_func-2fc0cbe.stdout", "stdout_hash": "1e1f59588204d803f78587c90afb9a66f5b9d495b06ab6209166984b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format_50-7def206.json0000664000175000017500000000071515174404631023267 0ustar alastairalastair{ "basename": "run-format_50-7def206", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_50.f90", "infile_hash": "ced3f301a712574d64ae033d0ff783b3f28e4ca070ed93d0ebf669ec", "outfile": null, "outfile_hash": null, "stdout": "run-format_50-7def206.stdout", "stdout_hash": "709e50b018137e30ecbf20beeeb4837a1e7405fea3dc60e7960561d4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-error_stop_04-8f1e721.stderr0000664000175000017500000000001615174404631024440 0ustar alastairalastairERROR STOP hi lfortran-0.63.0/tests/reference/llvm-intrinsics_06-15c0eef.stdout0000664000175000017500000003135715174404631024765 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.4 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.5 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.6 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc16 = alloca %string_descriptor, align 8 %stringFormat_desc13 = alloca %string_descriptor, align 8 %stringFormat_desc10 = alloca %string_descriptor, align 8 %stringFormat_desc7 = alloca %string_descriptor, align 8 %stringFormat_desc4 = alloca %string_descriptor, align 8 %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %dp = alloca i32, align 4 store i32 8, i32* %dp, align 4 %x = alloca float, align 4 store float 0x3FEFFFFFE0000000, float* %x, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, float* %x) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry store float 0x3FEFFFFFE0000000, float* %x, align 4 %14 = alloca i64, align 8 %15 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %14, i32 0, i32 0, i32 0, i32 0, i32 0, float* %x) %16 = load i64, i64* %14, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %15, i8** %17, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %16, i64* %18, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %20 = load i8*, i8** %19, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %22 = load i64, i64* %21, align 8 %23 = trunc i64 %22 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %20, i32 %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %24 = icmp eq i8* %15, null br i1 %24, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %2, i8* %15) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done store float 1.000000e+00, float* %x, align 4 %25 = alloca i64, align 8 %26 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %25, i32 0, i32 0, i32 0, i32 0, i32 0, float* %x) %27 = load i64, i64* %25, align 8 %28 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %26, i8** %28, align 8 %29 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %27, i64* %29, align 8 %30 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %31 = load i8*, i8** %30, align 8 %32 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %33 = load i64, i64* %32, align 8 %34 = trunc i64 %33 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %31, i32 %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %35 = icmp eq i8* %26, null br i1 %35, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free_alloc(i8* %2, i8* %26) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 store float 1.000000e+00, float* %x, align 4 %36 = alloca i64, align 8 %37 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.3, i32 0, i32 0), i64* %36, i32 0, i32 0, i32 0, i32 0, i32 0, float* %x) %38 = load i64, i64* %36, align 8 %39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 store i8* %37, i8** %39, align 8 %40 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 store i64 %38, i64* %40, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 %42 = load i8*, i8** %41, align 8 %43 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 %44 = load i64, i64* %43, align 8 %45 = trunc i64 %44 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %42, i32 %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %46 = icmp eq i8* %37, null br i1 %46, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %free_done6 call void @_lfortran_free_alloc(i8* %2, i8* %37) br label %free_done9 free_done9: ; preds = %free_nonnull8, %free_done6 store float 1.000000e+00, float* %x, align 4 %47 = alloca i64, align 8 %48 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.4, i32 0, i32 0), i64* %47, i32 0, i32 0, i32 0, i32 0, i32 0, float* %x) %49 = load i64, i64* %47, align 8 %50 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 store i8* %48, i8** %50, align 8 %51 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 store i64 %49, i64* %51, align 8 %52 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 %53 = load i8*, i8** %52, align 8 %54 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 %55 = load i64, i64* %54, align 8 %56 = trunc i64 %55 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %53, i32 %56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %57 = icmp eq i8* %48, null br i1 %57, label %free_done12, label %free_nonnull11 free_nonnull11: ; preds = %free_done9 call void @_lfortran_free_alloc(i8* %2, i8* %48) br label %free_done12 free_done12: ; preds = %free_nonnull11, %free_done9 store float 0x3FEFFFFFE0000000, float* %x, align 4 %58 = alloca i64, align 8 %59 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.5, i32 0, i32 0), i64* %58, i32 0, i32 0, i32 0, i32 0, i32 0, float* %x) %60 = load i64, i64* %58, align 8 %61 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 store i8* %59, i8** %61, align 8 %62 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 store i64 %60, i64* %62, align 8 %63 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 %64 = load i8*, i8** %63, align 8 %65 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 %66 = load i64, i64* %65, align 8 %67 = trunc i64 %66 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %64, i32 %67, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %68 = icmp eq i8* %59, null br i1 %68, label %free_done15, label %free_nonnull14 free_nonnull14: ; preds = %free_done12 call void @_lfortran_free_alloc(i8* %2, i8* %59) br label %free_done15 free_done15: ; preds = %free_nonnull14, %free_done12 store float 1.000000e+00, float* %x, align 4 %69 = alloca i64, align 8 %70 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.6, i32 0, i32 0), i64* %69, i32 0, i32 0, i32 0, i32 0, i32 0, float* %x) %71 = load i64, i64* %69, align 8 %72 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 store i8* %70, i8** %72, align 8 %73 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 store i64 %71, i64* %73, align 8 %74 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 %75 = load i8*, i8** %74, align 8 %76 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 %77 = load i64, i64* %76, align 8 %78 = trunc i64 %77 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %75, i32 %78, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) %79 = icmp eq i8* %70, null br i1 %79, label %free_done18, label %free_nonnull17 free_nonnull17: ; preds = %free_done15 call void @_lfortran_free_alloc(i8* %2, i8* %70) br label %free_done18 free_done18: ; preds = %free_nonnull17, %free_done15 br label %return return: ; preds = %free_done18 br label %FINALIZE_SYMTABLE_intrinsics_06 FINALIZE_SYMTABLE_intrinsics_06: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-associate_03-bc2b027.json0000664000175000017500000000075615174404631023722 0ustar alastairalastair{ "basename": "asr-associate_03-bc2b027", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/associate_03.f90", "infile_hash": "54a0fef1ee3727e70478189b60d108081d8e7760cadd89e8c99a8378", "outfile": null, "outfile_hash": null, "stdout": "asr-associate_03-bc2b027.stdout", "stdout_hash": "cd50a575e8da5687562a98c23cdf09bacebd2866d2014e1d4eb4df94", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-array1-cceb5f3.json0000664000175000017500000000070715174404631023013 0ustar alastairalastair{ "basename": "ast-array1-cceb5f3", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/array1.f90", "infile_hash": "74ef23b0c6d49a710e5035ce53fa6899eb51ef5e5b693d15108744ca", "outfile": null, "outfile_hash": null, "stdout": "ast-array1-cceb5f3.stdout", "stdout_hash": "a9e4c3789a95cba14597a7b259d2e3edb7d8d63a7e22aad75e33e50f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor22-17078cd.json0000664000175000017500000000077315174404631026537 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor22-17078cd", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor22.f90", "infile_hash": "e389d649c7f9f50187334845e9058801aef996346232815c3a6a5304", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor22-17078cd.stdout", "stdout_hash": "59c0eb2534d3fe294ceb31c9d8eb3b993e640c1cc38c76b8ae061dca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-doloop_08-cf3820d.stdout0000664000175000017500000000144615174404631023623 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t i; i = 1; while (true) { i = i + 1; if (i == 10) { break; } } if (i != 10) { std::cerr << "ERROR STOP" << std::endl; exit(1); } } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/ast_f90-complex_01-e4954b1.stdout0000664000175000017500000000040115174404631024364 0ustar alastairalastairprogram complex_01 implicit none complex :: x = (1.0, -3.0) real, parameter :: a = 3.0, b = 4.0 complex :: y = (a, b) complex, parameter :: i_ = (0, 1) complex :: z = a + i_*b complex :: w = a + b + i_*(a - b) print *, x, y, z, w end program complex_01 lfortran-0.63.0/tests/reference/pass_fma-fma-071ac0d.stdout0000664000175000017500000015010715174404631023557 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { _lcompilers_optimization_fma_f32: (Function (SymbolTable 3 { _lcompilers_optimization_fma_f32: (Variable 3 _lcompilers_optimization_fma_f32 [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a: (Variable 3 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 3 c [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) _lcompilers_optimization_fma_f32 (FunctionType [(Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 c)] [(Assignment (Var 3 _lcompilers_optimization_fma_f32) (RealBinOp (Var 3 a) Add (RealBinOp (Var 3 b) Mul (Var 3 c) (Real 4) () ) (Real 4) () ) () .false. .false. )] (Var 3 _lcompilers_optimization_fma_f32) Public .false. .false. () ), _lcompilers_optimization_fma_f321: (Function (SymbolTable 4 { _lcompilers_optimization_fma_f321: (Variable 4 _lcompilers_optimization_fma_f321 [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a: (Variable 4 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 4 c [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) _lcompilers_optimization_fma_f321 (FunctionType [(Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a) (Var 4 b) (Var 4 c)] [(Assignment (Var 4 _lcompilers_optimization_fma_f321) (RealBinOp (Var 4 a) Add (RealBinOp (Var 4 b) Mul (Var 4 c) (Real 4) () ) (Real 4) () ) () .false. .false. )] (Var 4 _lcompilers_optimization_fma_f321) Public .false. .false. () ), _lcompilers_optimization_fma_f322: (Function (SymbolTable 6 { _lcompilers_optimization_fma_f322: (Variable 6 _lcompilers_optimization_fma_f322 [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a: (Variable 6 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 6 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 6 c [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) _lcompilers_optimization_fma_f322 (FunctionType [(Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 a) (Var 6 b) (Var 6 c)] [(Assignment (Var 6 _lcompilers_optimization_fma_f322) (RealBinOp (Var 6 a) Add (RealBinOp (Var 6 b) Mul (Var 6 c) (Real 4) () ) (Real 4) () ) () .false. .false. )] (Var 6 _lcompilers_optimization_fma_f322) Public .false. .false. () ), _lcompilers_optimization_fma_f323: (Function (SymbolTable 7 { _lcompilers_optimization_fma_f323: (Variable 7 _lcompilers_optimization_fma_f323 [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a: (Variable 7 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 7 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 7 c [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) _lcompilers_optimization_fma_f323 (FunctionType [(Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 a) (Var 7 b) (Var 7 c)] [(Assignment (Var 7 _lcompilers_optimization_fma_f323) (RealBinOp (Var 7 a) Add (RealBinOp (Var 7 b) Mul (Var 7 c) (Real 4) () ) (Real 4) () ) () .false. .false. )] (Var 7 _lcompilers_optimization_fma_f323) Public .false. .false. () ), _lcompilers_optimization_fma_f64: (Function (SymbolTable 5 { _lcompilers_optimization_fma_f64: (Variable 5 _lcompilers_optimization_fma_f64 [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a: (Variable 5 a [] In () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 5 b [] In () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 5 c [] In () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) _lcompilers_optimization_fma_f64 (FunctionType [(Real 8) (Real 8) (Real 8)] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 a) (Var 5 b) (Var 5 c)] [(Assignment (Var 5 _lcompilers_optimization_fma_f64) (RealBinOp (Var 5 a) Add (RealBinOp (Var 5 b) Mul (Var 5 c) (Real 8) () ) (Real 8) () ) () .false. .false. )] (Var 5 _lcompilers_optimization_fma_f64) Public .false. .false. () ), fma: (Program (SymbolTable 2 { b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pi: (Variable 2 pi [] Local (RealConstant 3.140000 (Real 4) ) (RealConstant 3.140000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 2 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s1: (Variable 2 s1 [] Local (Cast (RealConstant 1.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 1.000000 (Real 8) ) () ) (RealConstant 1.000000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s2: (Variable 2 s2 [] Local (Cast (RealConstant 2.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 2.000000 (Real 8) ) () ) (RealConstant 2.000000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local (RealConstant 4.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local (Cast (RealConstant 1.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 1.000000 (Real 8) ) () ) (RealConstant 1.000000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fma [] [(Assignment (Var 2 x) (FunctionCall 1 _lcompilers_optimization_fma_f321 1 _lcompilers_optimization_fma_f321 [((FunctionCall 1 _lcompilers_optimization_fma_f32 1 _lcompilers_optimization_fma_f32 [((RealBinOp (Var 2 x) Mul (Cast (IntegerConstant 4 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 4.000000 (Real 4) ) () ) (Real 4) () )) ((RealConstant 0.500000 (Real 4) )) ((IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (Var 2 x)] 0 (Real 4) () ))] (Real 4) () () )) ((RealUnaryMinus (Var 2 x) (Real 4) () )) ((Var 2 pi))] (Real 4) () () ) () .false. .false. ) (Assignment (Var 2 z) (FunctionCall 1 _lcompilers_optimization_fma_f64 1 _lcompilers_optimization_fma_f64 [((Var 2 s1)) ((Var 2 z)) ((Var 2 s2))] (Real 8) () () ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealConstant 3.940000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 z) Sub (Cast (RealConstant 3.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 3.000000 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000001 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000001 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 1, 1, ...., 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 2 r) (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntrinsicElementalFunction Nint [(IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (FunctionCall 1 _lcompilers_optimization_fma_f322 1 _lcompilers_optimization_fma_f322 [((Var 2 r)) ((Var 2 r)) ((Var 2 r))] (Real 4) () () )] 0 (Real 4) () )] 0 (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Cast (FunctionCall 1 _lcompilers_optimization_fma_f323 1 _lcompilers_optimization_fma_f323 [((Var 2 r)) ((RealUnaryMinus (Var 2 r) (Real 4) () )) ((Var 2 r))] (Real 4) () () ) RealToInteger (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/run-array14-c9f6829.stdout0000664000175000017500000000015415174404631023261 0ustar alastairalastair5.00000000 -1.00000000 3.00000000 4.00000000 2.00000000 5.00000000 -1.00000000 3.00000000 lfortran-0.63.0/tests/reference/asr-template_travel_02-4448a71.stdout0000664000175000017500000062024115174404631025357 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_travel_02: (Program (SymbolTable 26 { add_real: (ExternalSymbol 26 add_real 2 add_real template_travel_02_math [] add_real Public ), operations: (ExternalSymbol 26 operations 5 operations template_travel_02_travel [] operations Public ), slash_real: (ExternalSymbol 26 slash_real 2 slash_real template_travel_02_math [] slash_real Public ), test_template: (ExternalSymbol 26 test_template 23 test_template template_travel_02_m [] test_template Public ), travel_tmpl: (ExternalSymbol 26 travel_tmpl 5 travel_tmpl template_travel_02_travel [] travel_tmpl Public ), travel_tmpl2: (ExternalSymbol 26 travel_tmpl2 5 travel_tmpl2 template_travel_02_travel [] travel_tmpl2 Public ) }) template_travel_02 [template_travel_02_m template_travel_02_math template_travel_02_travel] [(SubroutineCall 26 test_template () [] () .false. )] ), template_travel_02_m: (Module (SymbolTable 23 { add_real: (ExternalSymbol 23 add_real 2 add_real template_travel_02_math [] add_real Public ), operations: (ExternalSymbol 23 operations 5 operations template_travel_02_travel [] operations Public ), slash_real: (ExternalSymbol 23 slash_real 2 slash_real template_travel_02_math [] slash_real Public ), test_template: (Function (SymbolTable 24 { __asr_avg_s_from_t: (Function (SymbolTable 27 { avg: (Variable 27 avg [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d1: (Variable 27 d1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d2: (Variable 27 d2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t1: (Variable 27 t1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t2: (Variable 27 t2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __asr_avg_s_from_t (FunctionType [(Real 4) (Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 27 d1) (Var 27 t1) (Var 27 d2) (Var 27 t2)] [(Assignment (Var 27 avg) (FunctionCall 23 slash_real () [((FunctionCall 23 add_real () [((Var 27 d1)) ((Var 27 d2))] (Real 4) () () )) ((FunctionCall 23 add_real () [((Var 27 t1)) ((Var 27 t2))] (Real 4) () () ))] (Real 4) () () ) () .false. .false. )] (Var 27 avg) Public .true. .true. () ), avg_real_s_from_s: (Function (SymbolTable 25 { avg: (Variable 25 avg [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d1: (Variable 25 d1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d2: (Variable 25 d2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s1: (Variable 25 s1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s2: (Variable 25 s2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) avg_real_s_from_s (FunctionType [(Real 4) (Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [__asr_avg_s_from_t] [(Var 25 d1) (Var 25 s1) (Var 25 d2) (Var 25 s2)] [(Assignment (Var 25 avg) (FunctionCall 24 __asr_avg_s_from_t () [((Var 25 d1)) ((FunctionCall 23 slash_real () [((Var 25 d1)) ((Var 25 s1))] (Real 4) () () )) ((Var 25 d2)) ((FunctionCall 23 slash_real () [((Var 25 d2)) ((Var 25 s2))] (Real 4) () () ))] (Real 4) () () ) () .false. .false. )] (Var 25 avg) Private .true. .true. () ), s: (Variable 24 s [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 24 s) (FunctionCall 24 avg_real_s_from_s () [((RealConstant 1.100000 (Real 4) )) ((RealConstant 0.500000 (Real 4) )) ((RealConstant 2.000000 (Real 4) )) ((RealConstant 0.750000 (Real 4) ))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "s=" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 24 s)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), travel_tmpl: (ExternalSymbol 23 travel_tmpl 5 travel_tmpl template_travel_02_travel [] travel_tmpl Public ), travel_tmpl2: (ExternalSymbol 23 travel_tmpl2 5 travel_tmpl2 template_travel_02_travel [] travel_tmpl2 Public ) }) template_travel_02_m () [template_travel_02_math template_travel_02_travel template_travel_02_m] .false. .false. .false. ), template_travel_02_math: (Module (SymbolTable 2 { add_real: (Function (SymbolTable 3 { total: (Variable 3 total [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 3 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 y)] [(Assignment (Var 3 total) (RealBinOp (Var 3 x) Add (Var 3 y) (Real 4) () ) () .false. .false. )] (Var 3 total) Public .true. .true. () ), slash_real: (Function (SymbolTable 4 { total: (Variable 4 total [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 4 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) slash_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 x) (Var 4 y)] [(Assignment (Var 4 total) (RealBinOp (Var 4 x) Div (Var 4 y) (Real 4) () ) () .false. .false. )] (Var 4 total) Public .true. .true. () ) }) template_travel_02_math () [] .false. .false. .false. ), template_travel_02_travel: (Module (SymbolTable 5 { add_real: (ExternalSymbol 5 add_real 2 add_real template_travel_02_math [] add_real Public ), operations: (Requirement (SymbolTable 6 { d: (Variable 6 d [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d_divided_by_s: (Function (SymbolTable 10 { d: (Variable 10 d [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 10 n [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), quotient: (Variable 10 quotient [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) d_divided_by_s (FunctionType [(TypeParameter d ) (TypeParameter s )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 10 n) (Var 10 d)] [] (Var 10 quotient) Private .true. .true. () ), d_divided_by_t: (Function (SymbolTable 9 { d: (Variable 9 d [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 9 n [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), quotient: (Variable 9 quotient [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) d_divided_by_t (FunctionType [(TypeParameter d ) (TypeParameter t )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 9 n) (Var 9 d)] [] (Var 9 quotient) Private .true. .true. () ), plus_d: (Function (SymbolTable 7 { l: (Variable 7 l [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 7 r [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), total: (Variable 7 total [] ReturnVar () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus_d (FunctionType [(TypeParameter d ) (TypeParameter d )] (TypeParameter d ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 7 l) (Var 7 r)] [] (Var 7 total) Private .true. .true. () ), plus_t: (Function (SymbolTable 8 { l: (Variable 8 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 8 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), total: (Variable 8 total [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 8 l) (Var 8 r)] [] (Var 8 total) Private .true. .true. () ), s: (Variable 6 s [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 6 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) operations [d t s plus_d plus_t d_divided_by_t d_divided_by_s] [] ), slash_real: (ExternalSymbol 5 slash_real 2 slash_real template_travel_02_math [] slash_real Public ), travel_tmpl: (Template (SymbolTable 11 { avg_s_from_s: (Function (SymbolTable 17 { avg: (Variable 17 avg [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d1: (Variable 17 d1 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d2: (Variable 17 d2 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s1: (Variable 17 s1 [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s2: (Variable 17 s2 [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) avg_s_from_s (FunctionType [(TypeParameter d ) (TypeParameter s ) (TypeParameter d ) (TypeParameter s )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [d_divided_by_s avg_s_from_t] [(Var 17 d1) (Var 17 s1) (Var 17 d2) (Var 17 s2)] [(Assignment (Var 17 avg) (FunctionCall 11 avg_s_from_t () [((Var 17 d1)) ((FunctionCall 11 d_divided_by_s () [((Var 17 d1)) ((Var 17 s1))] (TypeParameter t ) () () )) ((Var 17 d2)) ((FunctionCall 11 d_divided_by_s () [((Var 17 d2)) ((Var 17 s2))] (TypeParameter t ) () () ))] (TypeParameter s ) () () ) () .false. .false. )] (Var 17 avg) Private .true. .true. () ), avg_s_from_t: (Function (SymbolTable 16 { avg: (Variable 16 avg [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d1: (Variable 16 d1 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d2: (Variable 16 d2 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t1: (Variable 16 t1 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t2: (Variable 16 t2 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) avg_s_from_t (FunctionType [(TypeParameter d ) (TypeParameter t ) (TypeParameter d ) (TypeParameter t )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [plus_d plus_t d_divided_by_t] [(Var 16 d1) (Var 16 t1) (Var 16 d2) (Var 16 t2)] [(Assignment (Var 16 avg) (FunctionCall 11 d_divided_by_t () [((FunctionCall 11 plus_d () [((Var 16 d1)) ((Var 16 d2))] (TypeParameter d ) () () )) ((FunctionCall 11 plus_t () [((Var 16 t1)) ((Var 16 t2))] (TypeParameter t ) () () ))] (TypeParameter s ) () () ) () .false. .false. )] (Var 16 avg) Public .true. .true. () ), d: (Variable 11 d [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d_divided_by_s: (Function (SymbolTable 15 { d: (Variable 15 d [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 15 n [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), quotient: (Variable 15 quotient [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) d_divided_by_s (FunctionType [(TypeParameter d ) (TypeParameter s )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 15 n) (Var 15 d)] [] (Var 15 quotient) Private .true. .true. () ), d_divided_by_t: (Function (SymbolTable 14 { d: (Variable 14 d [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 14 n [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), quotient: (Variable 14 quotient [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) d_divided_by_t (FunctionType [(TypeParameter d ) (TypeParameter t )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 14 n) (Var 14 d)] [] (Var 14 quotient) Private .true. .true. () ), plus_d: (Function (SymbolTable 12 { l: (Variable 12 l [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 12 r [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), total: (Variable 12 total [] ReturnVar () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus_d (FunctionType [(TypeParameter d ) (TypeParameter d )] (TypeParameter d ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 12 l) (Var 12 r)] [] (Var 12 total) Private .true. .true. () ), plus_t: (Function (SymbolTable 13 { l: (Variable 13 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 13 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), total: (Variable 13 total [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 13 l) (Var 13 r)] [] (Var 13 total) Private .true. .true. () ), s: (Variable 11 s [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 11 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) travel_tmpl [d t s plus_d plus_t d_divided_by_t d_divided_by_s] [(Require operations [d t s plus_d plus_t d_divided_by_t d_divided_by_s] )] ), travel_tmpl2: (Template (SymbolTable 18 { avg_s_from_s: (Function (SymbolTable 21 { avg: (Variable 21 avg [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d1: (Variable 21 d1 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d2: (Variable 21 d2 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s1: (Variable 21 s1 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s2: (Variable 21 s2 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) avg_s_from_s (FunctionType [(TypeParameter t ) (TypeParameter t ) (TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [div avg_s_from_t] [(Var 21 d1) (Var 21 s1) (Var 21 d2) (Var 21 s2)] [(Assignment (Var 21 avg) (FunctionCall 18 avg_s_from_t () [((Var 21 d1)) ((FunctionCall 18 div () [((Var 21 d1)) ((Var 21 s1))] (TypeParameter t ) () () )) ((Var 21 d2)) ((FunctionCall 18 div () [((Var 21 d2)) ((Var 21 s2))] (TypeParameter t ) () () ))] (TypeParameter t ) () () ) () .false. .false. )] (Var 21 avg) Private .true. .true. () ), avg_s_from_t: (Function (SymbolTable 22 { avg: (Variable 22 avg [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d1: (Variable 22 d1 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d2: (Variable 22 d2 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t1: (Variable 22 t1 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t2: (Variable 22 t2 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) avg_s_from_t (FunctionType [(TypeParameter t ) (TypeParameter t ) (TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [plus div] [(Var 22 d1) (Var 22 t1) (Var 22 d2) (Var 22 t2)] [(Assignment (Var 22 avg) (FunctionCall 18 div () [((FunctionCall 18 plus () [((Var 22 d1)) ((Var 22 d2))] (TypeParameter t ) () () )) ((FunctionCall 18 plus () [((Var 22 t1)) ((Var 22 t2))] (TypeParameter t ) () () ))] (TypeParameter t ) () () ) () .false. .false. )] (Var 22 avg) Public .true. .true. () ), div: (Function (SymbolTable 20 { d: (Variable 20 d [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 20 n [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), quotient: (Variable 20 quotient [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) div (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 20 n) (Var 20 d)] [] (Var 20 quotient) Private .true. .true. () ), plus: (Function (SymbolTable 19 { l: (Variable 19 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 19 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), total: (Variable 19 total [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 19 l) (Var 19 r)] [] (Var 19 total) Private .true. .true. () ), t: (Variable 18 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) travel_tmpl2 [t plus div] [(Require operations [t plus div] )] ) }) template_travel_02_travel () [template_travel_02_math template_travel_02_travel] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-dimension_02-2fc38c6.json0000664000175000017500000000074015174404631023741 0ustar alastairalastair{ "basename": "asr-dimension_02-2fc38c6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dimension_02.f90", "infile_hash": "6f2688e5aabb8713f42f87a3cf9595b44940f71cea7b5947673e1355", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dimension_02-2fc38c6.stderr", "stderr_hash": "36369436635af024d38553b91e78f35d990be0fc8f5fe0defdaf7d5a", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-program_03-374e848.json0000664000175000017500000000075315174404631023465 0ustar alastairalastair{ "basename": "llvm-program_03-374e848", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/program_03.f90", "infile_hash": "66e74edaf380b88bc4d65b0f35934f6857a8e67080628b16bd0e935a", "outfile": null, "outfile_hash": null, "stdout": "llvm-program_03-374e848.stdout", "stdout_hash": "e2d568e0f8a1cc19cdd5c43b3d2af449e27176f2ae13ace6d4618644", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-goto_04-2487215.stdout0000664000175000017500000003420715174404631023062 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { goto_04: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) goto_04 [] [(Assignment (Var 2 n) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 a) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (Select () (IntegerBinOp (Var 2 n) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) [(CaseStmt [(IntegerConstant 1 (Integer 4) Decimal)] [(GoTo 1 1 )] .false. ) (CaseStmt [(IntegerConstant 2 (Integer 4) Decimal)] [(GoTo 2 2 )] .false. ) (CaseStmt [(IntegerConstant 3 (Integer 4) Decimal)] [(GoTo 3 3 )] .false. )] [] .false. ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (GoToTarget 1 1 ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (GoToTarget 2 2 ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 20 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (GoToTarget 3 3 ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 30 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 2 a) NotEq (IntegerConstant 70 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Select () (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) [(CaseStmt [(IntegerConstant 1 (Integer 4) Decimal)] [(GoTo 4 4 )] .false. ) (CaseStmt [(IntegerConstant 2 (Integer 4) Decimal)] [(GoTo 5 5 )] .false. ) (CaseStmt [(IntegerConstant 3 (Integer 4) Decimal)] [(GoTo 6 6 )] .false. )] [] .false. ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (GoToTarget 4 4 ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 40 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (GoToTarget 5 5 ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 50 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (GoToTarget 6 6 ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 60 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 2 a) NotEq (IntegerConstant 130 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Select () (IntegerBinOp (Var 2 n) Mul (Var 2 n) (Integer 4) () ) [(CaseStmt [(IntegerConstant 1 (Integer 4) Decimal)] [(GoTo 7 7 )] .false. ) (CaseStmt [(IntegerConstant 2 (Integer 4) Decimal)] [(GoTo 8 8 )] .false. ) (CaseStmt [(IntegerConstant 3 (Integer 4) Decimal)] [(GoTo 9 9 )] .false. )] [] .false. ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (GoToTarget 7 7 ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 70 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (GoToTarget 8 8 ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 80 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (GoToTarget 9 9 ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 90 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 2 a) NotEq (IntegerConstant 375 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-array8-f50328f.json0000664000175000017500000000072215174404631023260 0ustar alastairalastair{ "basename": "ast_f90-array8-f50328f", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/array8.f90", "infile_hash": "fee5e1c1b4525cfa5f4eb3102cbdfdb2959403009df4a8920e8d1347", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-array8-f50328f.stdout", "stdout_hash": "9dcbe3770b73ad4694a29832a42ae6f7afb5a9d740a1532d932ed0d8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-infer_mode_smoke_01-f9a09d6.json0000664000175000017500000000057415174404631025310 0ustar alastairalastair{ "basename": "run-infer_mode_smoke_01-f9a09d6", "cmd": "lfortran --no-color {infile}", "infile": "tests/infer_mode_smoke_01.f90", "infile_hash": "27f38709d506bc21c86a5e43a27e790423a9c88fe6f19eaaf8d6ebf4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-class_01-82031c0.json0000664000175000017500000000106515174404631023070 0ustar alastairalastair{ "basename": "llvm-class_01-82031c0", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/class_01.f90", "infile_hash": "d56b80167c24a798a3f70abbc77b31570b560e826ce6b96ab9476bab", "outfile": null, "outfile_hash": null, "stdout": "llvm-class_01-82031c0.stdout", "stdout_hash": "88ac839be3ea5c009ba0db861bf84f411376993f2b312c365dab3204", "stderr": "llvm-class_01-82031c0.stderr", "stderr_hash": "83b7bc133c115994c08e9afc99edb6e1e19ce354b399bf4374f7b855", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit8-03c7a90.json0000664000175000017500000000072015174404631023263 0ustar alastairalastair{ "basename": "asr-implicit8-03c7a90", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/implicit8.f90", "infile_hash": "5ab8320f5bd93962cbba1babe7f4f17779af2d5575f625095988f4d8", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit8-03c7a90.stderr", "stderr_hash": "6990d3cbec523ef3460ff0c8eeeb96a68cf69b77a943bd72383a7895", "returncode": 2 }lfortran-0.63.0/tests/reference/pass_flip_sign-expr_13-e24d940.json0000664000175000017500000000100615174404631025060 0ustar alastairalastair{ "basename": "pass_flip_sign-expr_13-e24d940", "cmd": "lfortran --pass=flip_sign --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/expr_13.f90", "infile_hash": "2eaa9b9631c66ea28ea4dc4ede8f1a3717f4a929a68455837525f54f", "outfile": null, "outfile_hash": null, "stdout": "pass_flip_sign-expr_13-e24d940.stdout", "stdout_hash": "59b9359ccb475269c36bd06ab4dfbf159e5f8b3e686ed520dbd8ea38", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-global_scope2-181c327.stdout0000664000175000017500000000050515174404631024372 0ustar alastairalastair(TranslationUnit [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () ) (Assignment 0 x 6 () )] ) lfortran-0.63.0/tests/reference/ast_f90-block_data1-f3dfb1f.stdout0000664000175000017500000000054715174404631025012 0ustar alastairalastairblock data init implicit integer (a-z) common /range/ x0, x1 data x0, x1/1, 10/ end block data init program block_data1 implicit integer (a-z) common /range/ x0, x1 print *, "Printing Even number in the Range: ", x0, " to ", x1 do i = x0, x1 if (mod(i, 2) /= 0) then cycle end if write(*, *) i end do end program block_data1 lfortran-0.63.0/tests/reference/llvm-return_06-ec98b0b.stdout0000664000175000017500000000123215174404631024110 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) br label %return unreachable_after_return: ; No predecessors! br label %return return: ; preds = %unreachable_after_return, %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-string_11-0e4b62c.stdout0000664000175000017500000001324615174404631023627 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_11: (Program (SymbolTable 2 { mystring: (Variable 2 mystring [] Local () () Default (String 1 (IntegerConstant 30 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), teststring: (Variable 2 teststring [] Local () () Default (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_11 [] [(Assignment (Var 2 mystring) (StringConstant "This is a test" (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 teststring) (StringConstant "test" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (If () (IntegerCompare (IntrinsicElementalFunction SubstrIndex [(Var 2 mystring) (Var 2 teststring) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Print (StringConstant "test is not found" (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringFormat () [(StringConstant "test is found at index: " (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (IntrinsicElementalFunction SubstrIndex [(Var 2 mystring) (Var 2 teststring) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-do2-1ec601e.json0000664000175000017500000000101015174404631022116 0ustar alastairalastair{ "basename": "ast-do2-1ec601e", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do2.f90", "infile_hash": "7f47b6b127565d836c9d83019e001f2160489c3d1243f1de7e93af71", "outfile": null, "outfile_hash": null, "stdout": "ast-do2-1ec601e.stdout", "stdout_hash": "0ab41435499b9bf55305b0895a7d74b7c79771cd7279d2868fdef093", "stderr": "ast-do2-1ec601e.stderr", "stderr_hash": "058e62ed95ffbe797f06eaf8d52e4ae850f39e6e94112c2895a35bdf", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_06-821cc56.json0000664000175000017500000000072315174404631023346 0ustar alastairalastair{ "basename": "asr-modules_06-821cc56", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/modules_06.f90", "infile_hash": "7699c2084686f687c1681ea9d088f613f3530b48449a37df5fc1cdce", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_06-821cc56.stdout", "stdout_hash": "211cfb23bf07fb5243b6e67220f7acd0eae38ab220ac0c87a0178e38", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixed_form_goto_select-6cc9882.stdout0000664000175000017500000000277015174404631026474 0ustar alastairalastair(TranslationUnit [(Program main () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(k [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(m [] [] () () None ()) (n [] [] () () None ())] () )] [(Assignment 0 k 1 () ) (Print 100 () [(String "hello" ())] () ) (Assignment 200 k (+ k 1) () ) (Assignment 0 m 1 () ) (Assignment 0 n 2 () ) (GoTo 0 () m [200 100] () ) (GoTo 0 () n [100 200] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-implicit_typing4-df7d614.json0000664000175000017500000000077615174404631024755 0ustar alastairalastair{ "basename": "asr-implicit_typing4-df7d614", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/errors/implicit_typing4.f90", "infile_hash": "21dfe09305df396a4254e7b1f818acbac4b158b5731a58805794efda", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit_typing4-df7d614.stderr", "stderr_hash": "0e5bf83cfac5959bd16ca0216ed0f276a9f0a153dbe877e08c0a04c9", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-redeclaration1-b66ed3a.json0000664000175000017500000000074615174404631024432 0ustar alastairalastair{ "basename": "asr-redeclaration1-b66ed3a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/redeclaration1.f90", "infile_hash": "4d6cab928e80a2d41ed8e5b4f018b5bd36eab2f6e7bf9572486280b2", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-redeclaration1-b66ed3a.stderr", "stderr_hash": "9065758617b52d0d612d6fb388037f17558d47874fc3409dbbf2c574", "returncode": 2 }lfortran-0.63.0/tests/reference/ast_f90-array6-d640983.json0000664000175000017500000000072215174404631023202 0ustar alastairalastair{ "basename": "ast_f90-array6-d640983", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/array6.f90", "infile_hash": "bd74956aa588e4b340d6de16fc0b67a51fbf31518393a6cb4e7d2901", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-array6-d640983.stdout", "stdout_hash": "84af996e58fc5ed590391ba06cd18f3d867424266b05f8b182b31dbf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-program_cmake_01-a9e6179.stdout0000664000175000017500000000113415174404631025060 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { testfortran: (Program (SymbolTable 2 { }) testfortran [] [(Print (StringConstant "Hello" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/pass_do_loops-doloop_04-749d5f0.json0000664000175000017500000000101115174404631025245 0ustar alastairalastair{ "basename": "pass_do_loops-doloop_04-749d5f0", "cmd": "lfortran --pass=do_loops --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_04.f90", "infile_hash": "d2027c560ba8546e31b7627200b8fb28695617c3238a8f1a086c62ef", "outfile": null, "outfile_hash": null, "stdout": "pass_do_loops-doloop_04-749d5f0.stdout", "stdout_hash": "8987dee24732b48fb046473cdf94e07dd4709df3787a73db0a392d31", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-arrays_08_func-ec93f58.stderr0000664000175000017500000000032315174404631025154 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/arrays_08_func.f90:29:27 | 29 | r = r .and. (a(i) .eq. b(i)) | ^^^^ help: write this as '==' lfortran-0.63.0/tests/reference/pass_global_stmts-expr6-a926072.stdout0000664000175000017500000000716115174404631025663 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f2: (Variable 2 f2 [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] (Real 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 f1) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 f2) (RealConstant 5.300000 (Real 4) ) () .false. .false. )] (Var 2 f2) Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-program_03-fbe20e8.json0000664000175000017500000000075015174404631023502 0ustar alastairalastair{ "basename": "asr-program_03-fbe20e8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/program_03.f90", "infile_hash": "66e74edaf380b88bc4d65b0f35934f6857a8e67080628b16bd0e935a", "outfile": null, "outfile_hash": null, "stdout": "asr-program_03-fbe20e8.stdout", "stdout_hash": "667322ce4eb6e974724c13d506a9dff4cbe79010c6460fb1fef7faf3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-module_struct_global_separate_compilation_01-043bc7f.stdout0000664000175000017500000000152715174404631033202 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %module_struct_global_separate_compilation_01.t = type { i32 } @__module_module_struct_global_separate_compilation_01_targets = global %module_struct_global_separate_compilation_01.t zeroinitializer define void @__module_module_struct_global_separate_compilation_01_set_targets(i32* %v) { .entry: %0 = load i32, i32* %v, align 4 store i32 %0, i32* getelementptr inbounds (%module_struct_global_separate_compilation_01.t, %module_struct_global_separate_compilation_01.t* @__module_module_struct_global_separate_compilation_01_targets, i32 0, i32 0), align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_set_targets FINALIZE_SYMTABLE_set_targets: ; preds = %return ret void } lfortran-0.63.0/tests/reference/tokens-subroutine1-c249ad5.stdout0000664000175000017500000000206015174404631025014 0ustar alastairalastair(KEYWORD "subroutine") (TOKEN "identifier" g) (TOKEN "(") (TOKEN ")") (NEWLINE) (KEYWORD "integer") (TOKEN "::") (TOKEN "identifier" x) (TOKEN ",") (TOKEN "identifier" i) (NEWLINE) (TOKEN "identifier" x) (TOKEN "=") (TOKEN "integer" 1) (NEWLINE) (KEYWORD "do") (TOKEN "identifier" i) (TOKEN "=") (TOKEN "integer" 1) (TOKEN ",") (TOKEN "integer" 10) (NEWLINE) (TOKEN "identifier" x) (TOKEN "=") (TOKEN "identifier" x) (TOKEN "*") (TOKEN "identifier" i) (NEWLINE) (KEYWORD "end do") (NEWLINE) (KEYWORD "end subroutine") (NEWLINE) (NEWLINE) (KEYWORD "subroutine") (TOKEN "identifier" h) (TOKEN "(") (TOKEN ")") (NEWLINE) (KEYWORD "integer") (TOKEN "::") (TOKEN "identifier" x) (TOKEN ",") (TOKEN "identifier" i) (NEWLINE) (TOKEN "identifier" x) (TOKEN "=") (TOKEN "integer" 1) (NEWLINE) (KEYWORD "do") (TOKEN "identifier" i) (TOKEN "=") (TOKEN "integer" 1) (TOKEN ",") (TOKEN "integer" 10) (NEWLINE) (TOKEN "identifier" x) (TOKEN "=") (TOKEN "identifier" i) (TOKEN "*") (TOKEN "identifier" x) (NEWLINE) (KEYWORD "end do") (NEWLINE) (KEYWORD "end subroutine") (NEWLINE) (EOF) lfortran-0.63.0/tests/reference/wat-doloop_02-1ee6409.stdout0000664000175000017500000002314615174404631023553 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i32 i32 i32 i32 i32) i32.const 0 local.set 5 i32.const 1 local.set 2 i32.const 10 local.set 3 local.get 3 local.set 0 local.get 2 i32.const 1 i32.sub local.set 4 loop local.get 4 i32.const 1 i32.add local.get 0 i32.le_s if local.get 4 i32.const 1 i32.add local.set 4 local.get 5 local.get 4 i32.add local.set 5 br 1 else end end local.get 5 i32.const 55 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 5 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 2 i32.const 1 i32.const 1 i32.sub local.set 4 loop local.get 4 i32.const 1 i32.add i32.const 10 i32.le_s if local.get 4 i32.const 1 i32.add local.set 4 i32.const 1 i32.const 1 i32.sub local.set 5 loop local.get 5 i32.const 1 i32.add i32.const 10 i32.le_s if local.get 5 i32.const 1 i32.add local.set 5 local.get 2 local.get 4 i32.const 1 i32.sub i32.const 10 i32.mul i32.add local.get 5 i32.add local.set 2 br 1 else end end br 1 else end end local.get 2 i32.const 5050 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 2 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 2 i32.const 1 i32.const 1 i32.sub local.set 4 loop local.get 4 i32.const 1 i32.add i32.const 10 i32.le_s if local.get 4 i32.const 1 i32.add local.set 4 local.get 4 local.set 1 i32.const 1 i32.const 1 i32.sub local.set 5 loop local.get 5 i32.const 1 i32.add local.get 1 i32.le_s if local.get 5 i32.const 1 i32.add local.set 5 local.get 2 local.get 5 i32.add local.set 2 br 1 else end end br 1 else end end local.get 2 i32.const 220 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 2 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\0b\00\00\00") (data (;35;) (i32.const 216) "ERROR STOP\n ") ) lfortran-0.63.0/tests/reference/llvm-types_05-aa71aa9.json0000664000175000017500000000074515174404631023363 0ustar alastairalastair{ "basename": "llvm-types_05-aa71aa9", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/types_05.f90", "infile_hash": "96f8e950abafbc42b9d0438efdca0a8355bb2bd7b4b168ee23063521", "outfile": null, "outfile_hash": null, "stdout": "llvm-types_05-aa71aa9.stdout", "stdout_hash": "88800bf784cd5c190b3c83236fffc5a988dc0f14237515a48b5caa08", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_global_stmts-global_scope7-d6ec187.json0000664000175000017500000000101415174404631027124 0ustar alastairalastair{ "basename": "pass_global_stmts-global_scope7-d6ec187", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope7.f90", "infile_hash": "b3d005db52f7a57b335928fc6d884d6fdee0654c64fc98c2e797e242", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope7-d6ec187.stdout", "stdout_hash": "db9084d53b569efb6b8101504f7545270bf21690c3425d5912683ab6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-allow_implicit_interface-68156ec.stdout0000664000175000017500000006421615174404631027007 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { prho: (Function (SymbolTable 2 { alnorm: (Function (SymbolTable 4 { alnorm_arg_0: (Variable 4 alnorm_arg_0 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), alnorm_arg_1: (Variable 4 alnorm_arg_1 [] Unspecified () () Default (Logical 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), alnorm_return_var_name: (Variable 4 alnorm_return_var_name [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) alnorm (FunctionType [(Real 8) (Logical 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 alnorm_arg_0) (Var 4 alnorm_arg_1)] [] (Var 4 alnorm_return_var_name) Public .false. .false. () ), b: (Variable 2 b [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dgetrf: (Function (SymbolTable 5 { dgetrf_arg_0: (Variable 5 dgetrf_arg_0 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dgetrf_arg_1: (Variable 5 dgetrf_arg_1 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dgetrf_arg_2: (Variable 5 dgetrf_arg_2 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) dgetrf (FunctionType [(Real 8) (Real 8) (Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 dgetrf_arg_0) (Var 5 dgetrf_arg_1) (Var 5 dgetrf_arg_2)] [] () Public .false. .false. () ), one: (Variable 2 one [] Local (RealConstant 1.000000 (Real 8) ) (RealConstant 1.000000 (Real 8) ) Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), prho: (Variable 2 prho [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), six: (Variable 2 six [] Local (RealConstant 6.000000 (Real 8) ) (RealConstant 6.000000 (Real 8) ) Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), two: (Variable 2 two [] Local (RealConstant 2.000000 (Real 8) ) (RealConstant 2.000000 (Real 8) ) Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u: (Variable 2 u [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zero: (Variable 2 zero [] Local (RealConstant 0.000000 (Real 8) ) (RealConstant 0.000000 (Real 8) ) Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) prho (FunctionType [] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 zero) (RealConstant 0.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 one) (RealConstant 1.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 two) (RealConstant 2.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 six) (RealConstant 6.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 prho) (RealBinOp (RealBinOp (Var 2 u) Div (IntrinsicElementalFunction Exp [(RealBinOp (Var 2 y) Div (Var 2 two) (Real 8) () )] 0 (Real 8) () ) (Real 8) () ) Add (FunctionCall 2 alnorm () [((Var 2 x)) ((LogicalConstant .true. (Logical 4) ))] (Real 8) () () ) (Real 8) () ) () .false. .false. ) (SubroutineCall 2 dgetrf () [((Var 2 x)) ((Var 2 y)) ((Var 2 u))] () .false. ) (If () (RealCompare (Var 2 prho) Lt (Var 2 zero) (Logical 4) () ) [(Assignment (Var 2 prho) (Var 2 zero) () .false. .false. )] [] ) (If () (RealCompare (Var 2 prho) Gt (Var 2 one) (Logical 4) () ) [(Assignment (Var 2 prho) (Var 2 one) () .false. .false. )] [] ) (Return)] (Var 2 prho) Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/tokens-expr8-00c1054.json0000664000175000017500000000071515174404631023057 0ustar alastairalastair{ "basename": "tokens-expr8-00c1054", "cmd": "lfortran --no-color --show-tokens {infile} -o {outfile}", "infile": "tests/expr8.f90", "infile_hash": "b0f7cfaa460c9319f7cc7b0fa470fbbce940f7f4eef3156b55897b51", "outfile": null, "outfile_hash": null, "stdout": "tokens-expr8-00c1054.stdout", "stdout_hash": "f7ec05a11cafd75b4ddbbe0cbb606e0da8c6cec70baad1b3647519f7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-types_14-79df2e1.json0000664000175000017500000000074215174404631023130 0ustar alastairalastair{ "basename": "asr-types_14-79df2e1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_14.f90", "infile_hash": "604dcedee00d3b6bd830fb4ca72cbd189f2daab1b1f19dd82cf8ccc0", "outfile": null, "outfile_hash": null, "stdout": "asr-types_14-79df2e1.stdout", "stdout_hash": "8ac07afba00139dcfebcf718a4e2c03d57e10e86bc5131fe492ab945", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-block1-f4e17ad.stdout0000664000175000017500000000103115174404631023726 0ustar alastairalastairprogram block1 implicit integer (a-z) integer :: B ! TODO: Fix this test case block ! use mod, only: example ! import, none ! !import, only: B B = 10 print *, B if (B == 10) then print *, "pass" end if end block end program block1 ! The variable B is implicitly declared in the scoping unit of the main program. ! The statement IMPORT, NONE makes B inaccessible in the BLOCK construct. ! If the IMPORT, NONE statement is replaced with the IMPORT statement in the ! comment, the program is conformant. lfortran-0.63.0/tests/reference/pass_nested_vars-nested_external_dedup_01-94a5d6b.json0000664000175000017500000000107715174404631031102 0ustar alastairalastair{ "basename": "pass_nested_vars-nested_external_dedup_01-94a5d6b", "cmd": "lfortran --pass=nested_vars --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_external_dedup_01.f90", "infile_hash": "2aab29c92da224e4546714887b85dfa6883b7ba509705159b438bf9a", "outfile": null, "outfile_hash": null, "stdout": "pass_nested_vars-nested_external_dedup_01-94a5d6b.stdout", "stdout_hash": "36175d1dce85b1e0f7c0756d6dcfdf1adf221d40d2d4d9bf728f1569", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-program_cmake_02-d8d8f4d.stderr0000664000175000017500000000040315174404631025202 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/program_cmake_02.f90:4:49 | 4 | integer stop ; stop = 1 ; do while ( stop .eq. 0 ) ; end do | ^^^^ help: write this as '==' lfortran-0.63.0/tests/reference/ast-common1-abbc59b.stdout0000664000175000017500000001204415174404631023530 0ustar alastairalastair(TranslationUnit [(Program common1 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Implicit [(ImplicitSpec (AttrType TypeReal [] () () None ) [(LetterSpec a z )] )] () )] [(Declaration (AttrType TypeReal [] () () None ) [] [(A [] [] () () None ()) (B [] [] () () None ())] () ) (Declaration () [(AttrCommon [(sample [(A [] [] () A None ()) (B [] [] () B None ())])] )] [] () ) (Declaration () [(AttrCommon [(c [(c [] [] () c None ())]) (b [(d [] [] () d None ()) (e [] [] () e None ()) (f [] [] () f None ())]) (c [(g [] [] () g None ()) (h [] [] () h None ()) (i [(1 5 DimensionExpr)] [] () (FuncCallOrArray i [] [(() 5 () 0)] [] [] [] ) None ())])] )] [] () ) (Declaration () [(AttrCommon [(() [(x [] [] () x None ()) (y [] [] () y None ()) (z [(1 10 DimensionExpr)] [] () (FuncCallOrArray z [] [(() 10 () 0)] [] [] [] ) None ())])] )] [] () )] [(Assignment 0 A 10 () ) (Assignment 0 B 20 () ) (SubroutineCall 0 pass [] [] [] [] () ) (Stop 0 () () () )] [] ) (Subroutine pass [] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [] [(A [] [] () () None ()) (B [] [] () () None ())] () ) (Declaration () [(AttrCommon [(sample [(A [] [] () A None ()) (B [] [] () B None ())])] )] [] () )] [(Print 0 () [A B] () ) (Return 0 () () )] [] [] )] ) lfortran-0.63.0/tests/reference/run-scalar_allocation_check_05-e3b524c.stderr0000664000175000017500000000025115174404631027125 0ustar alastairalastairruntime error: Argument 1 is unallocated. --> tests/errors/scalar_allocation_check_05.f90:10:14 | 10 | print *, m1%x | ^^^^ This is unallocated lfortran-0.63.0/tests/reference/ast-fixed_form_implicit1-5bea864.json0000664000175000017500000000077415174404631025561 0ustar alastairalastair{ "basename": "ast-fixed_form_implicit1-5bea864", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_implicit1.f", "infile_hash": "23368f2fe6f6771c71559e99af7296e68d793e5df5a6a69aa6c39f62", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_implicit1-5bea864.stdout", "stdout_hash": "9f2a92545fa9fef0e728a5105db787511732b5dfd0e291a9c7d1ec5e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_09-2af35ec.json0000664000175000017500000000076115174404631024225 0ustar alastairalastair{ "basename": "asr-intrinsics_09-2af35ec", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_09.f90", "infile_hash": "12c64a66c84a553de209e2227f56e1da90f0ce7e51cef682cb608cea", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_09-2af35ec.stdout", "stdout_hash": "113efd91a0da56141285bfb7b104a8afb48b6cbe3492fe702ea6510e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_transfer_01-3dca715.json0000664000175000017500000000075715174404631024776 0ustar alastairalastair{ "basename": "asr-array_transfer_01-3dca715", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_transfer_01.f90", "infile_hash": "98bc1c8f86b6df52afdc9b504d783677d18ac3c8df19a7f37745108e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_transfer_01-3dca715.stderr", "stderr_hash": "c9c6004b1c3700fc8c09a34a02aa902bc57cd47fe9164257e54395db", "returncode": 2 }lfortran-0.63.0/tests/reference/wat-types_01-c4e1000.stdout0000664000175000017500000000542715174404631023403 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local f32) f32.const 1.000000 local.set 0 f32.const 1.500000 local.set 0 f32.const 1.000000 local.set 0 f32.const 2.000000 local.set 0 f32.const 3.000000 local.set 0 i32.const 0 call 0 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-0.63.0/tests/reference/llvm-implicit_interface_04-9b6786e.stdout0000664000175000017500000010656515174404631026316 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [4 x i8] c"arr\00", align 1 @3 = private unnamed_addr constant [53 x i8] c"tests/../integration_tests/implicit_interface_04.f90\00", align 1 @4 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @5 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [5 x i8] c"arr1\00", align 1 @11 = private unnamed_addr constant [53 x i8] c"tests/../integration_tests/implicit_interface_04.f90\00", align 1 @12 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @13 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @16 = private unnamed_addr constant [5 x i8] c"arr1\00", align 1 @17 = private unnamed_addr constant [53 x i8] c"tests/../integration_tests/implicit_interface_04.f90\00", align 1 @18 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @19 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @21 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @22 = private unnamed_addr constant [5 x i8] c"arr1\00", align 1 @23 = private unnamed_addr constant [53 x i8] c"tests/../integration_tests/implicit_interface_04.f90\00", align 1 @24 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @25 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @27 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @main.b = internal global [3 x i32] zeroinitializer @main.n = internal global i32 3 @28 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @29 = private unnamed_addr constant [53 x i8] c"tests/../integration_tests/implicit_interface_04.f90\00", align 1 @30 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @31 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @32 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @33 = private unnamed_addr constant [53 x i8] c"tests/../integration_tests/implicit_interface_04.f90\00", align 1 @34 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @35 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @37 = private unnamed_addr constant [53 x i8] c"tests/../integration_tests/implicit_interface_04.f90\00", align 1 @38 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @39 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @40 = private unnamed_addr constant [7 x i8] c"driver\00", align 1 @41 = private unnamed_addr constant [53 x i8] c"tests/../integration_tests/implicit_interface_04.f90\00", align 1 @42 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @43 = private unnamed_addr constant [143 x i8] c"Runtime error: Array shape mismatch in subroutine '%s'\0A\0ATried to match size %d of dimension %d of argument number %d, but expected size is %d\0A\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %__1_k = alloca i32, align 4 store i32 1, i32* %__1_k, align 4 %3 = load i32, i32* %__1_k, align 4 %4 = sext i32 %3 to i64 %5 = sub i64 %4, 1 %6 = mul i64 1, %5 %7 = add i64 0, %6 %8 = icmp slt i64 %4, 1 %9 = icmp sgt i64 %4, 3 %10 = or i1 %8, %9 br i1 %10, label %then, label %ifcont then: ; preds = %.entry %11 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %12 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %13 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %12, i32 0, i32 0 %14 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %13, i32 0, i32 0 store i8* getelementptr inbounds ([53 x i8], [53 x i8]* @29, i32 0, i32 0), i8** %14, align 8 %15 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %13, i32 0, i32 1 store i32 3, i32* %15, align 4 %16 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %13, i32 0, i32 2 store i32 12, i32* %16, align 4 %17 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %13, i32 0, i32 3 store i32 3, i32* %17, align 4 %18 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %13, i32 0, i32 4 store i32 30, i32* %18, align 4 %19 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @30, i32 0, i32 0)) %20 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %11, i32 0, i32 0 %21 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %12, i32 0, i32 0 %22 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %20, i32 0, i32 2 %23 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %20, i32 0, i32 0 store i1 true, i1* %23, align 1 %24 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %20, i32 0, i32 1 store i8* %19, i8** %24, align 8 store { i8*, i32, i32, i32, i32 }* %21, { i8*, i32, i32, i32, i32 }** %22, align 8 %25 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %20, i32 0, i32 3 store i32 1, i32* %25, align 4 %26 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %11, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %26, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @31, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @28, i32 0, i32 0), i64 %4, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont: ; preds = %.entry %27 = getelementptr [3 x i32], [3 x i32]* @main.b, i32 0, i64 %7 store i32 10, i32* %27, align 4 store i32 2, i32* %__1_k, align 4 %28 = load i32, i32* %__1_k, align 4 %29 = sext i32 %28 to i64 %30 = sub i64 %29, 1 %31 = mul i64 1, %30 %32 = add i64 0, %31 %33 = icmp slt i64 %29, 1 %34 = icmp sgt i64 %29, 3 %35 = or i1 %33, %34 br i1 %35, label %then1, label %ifcont2 then1: ; preds = %ifcont %36 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %37 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %38 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %37, i32 0, i32 0 %39 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %38, i32 0, i32 0 store i8* getelementptr inbounds ([53 x i8], [53 x i8]* @33, i32 0, i32 0), i8** %39, align 8 %40 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %38, i32 0, i32 1 store i32 3, i32* %40, align 4 %41 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %38, i32 0, i32 2 store i32 12, i32* %41, align 4 %42 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %38, i32 0, i32 3 store i32 3, i32* %42, align 4 %43 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %38, i32 0, i32 4 store i32 30, i32* %43, align 4 %44 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @34, i32 0, i32 0)) %45 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %36, i32 0, i32 0 %46 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %37, i32 0, i32 0 %47 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %45, i32 0, i32 2 %48 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %45, i32 0, i32 0 store i1 true, i1* %48, align 1 %49 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %45, i32 0, i32 1 store i8* %44, i8** %49, align 8 store { i8*, i32, i32, i32, i32 }* %46, { i8*, i32, i32, i32, i32 }** %47, align 8 %50 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %45, i32 0, i32 3 store i32 1, i32* %50, align 4 %51 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %36, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %51, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @35, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @32, i32 0, i32 0), i64 %29, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont2: ; preds = %ifcont %52 = getelementptr [3 x i32], [3 x i32]* @main.b, i32 0, i64 %32 store i32 20, i32* %52, align 4 store i32 3, i32* %__1_k, align 4 %53 = load i32, i32* %__1_k, align 4 %54 = sext i32 %53 to i64 %55 = sub i64 %54, 1 %56 = mul i64 1, %55 %57 = add i64 0, %56 %58 = icmp slt i64 %54, 1 %59 = icmp sgt i64 %54, 3 %60 = or i1 %58, %59 br i1 %60, label %then3, label %ifcont4 then3: ; preds = %ifcont2 %61 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %62 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %63 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %62, i32 0, i32 0 %64 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %63, i32 0, i32 0 store i8* getelementptr inbounds ([53 x i8], [53 x i8]* @37, i32 0, i32 0), i8** %64, align 8 %65 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %63, i32 0, i32 1 store i32 3, i32* %65, align 4 %66 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %63, i32 0, i32 2 store i32 12, i32* %66, align 4 %67 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %63, i32 0, i32 3 store i32 3, i32* %67, align 4 %68 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %63, i32 0, i32 4 store i32 30, i32* %68, align 4 %69 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @38, i32 0, i32 0)) %70 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %61, i32 0, i32 0 %71 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %62, i32 0, i32 0 %72 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %70, i32 0, i32 2 %73 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %70, i32 0, i32 0 store i1 true, i1* %73, align 1 %74 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %70, i32 0, i32 1 store i8* %69, i8** %74, align 8 store { i8*, i32, i32, i32, i32 }* %71, { i8*, i32, i32, i32, i32 }** %72, align 8 %75 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %70, i32 0, i32 3 store i32 1, i32* %75, align 4 %76 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %61, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %76, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @39, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0), i64 %54, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont4: ; preds = %ifcont2 %77 = getelementptr [3 x i32], [3 x i32]* @main.b, i32 0, i64 %57 store i32 30, i32* %77, align 4 %78 = load i32, i32* @main.n, align 4 %79 = icmp slt i32 3, %78 br i1 %79, label %then5, label %ifcont6 then5: ; preds = %ifcont4 %80 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %81 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %82 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %81, i32 0, i32 0 %83 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %82, i32 0, i32 0 store i8* getelementptr inbounds ([53 x i8], [53 x i8]* @41, i32 0, i32 0), i8** %83, align 8 %84 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %82, i32 0, i32 1 store i32 6, i32* %84, align 4 %85 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %82, i32 0, i32 2 store i32 39, i32* %85, align 4 %86 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %82, i32 0, i32 3 store i32 6, i32* %86, align 4 %87 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %82, i32 0, i32 4 store i32 39, i32* %87, align 4 %88 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @42, i32 0, i32 0)) %89 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %80, i32 0, i32 0 %90 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %81, i32 0, i32 0 %91 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %89, i32 0, i32 2 %92 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %89, i32 0, i32 0 store i1 true, i1* %92, align 1 %93 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %89, i32 0, i32 1 store i8* %88, i8** %93, align 8 store { i8*, i32, i32, i32, i32 }* %90, { i8*, i32, i32, i32, i32 }** %91, align 8 %94 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %89, i32 0, i32 3 store i32 1, i32* %94, align 4 %95 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %80, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %95, i32 1, i8* getelementptr inbounds ([143 x i8], [143 x i8]* @43, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @40, i32 0, i32 0), i32 3, i32 1, i32 2, i32 %78) call void @exit(i32 1) unreachable ifcont6: ; preds = %ifcont4 call void @driver(void (i32*, i32*, i32*)* @implicit_interface_check, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @main.b, i32 0, i32 0), i32* @main.n) br label %return return: ; preds = %ifcont6 br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } define void @driver(void (i32*, i32*, i32*)* %fnc, i32* %arr, i32* %m) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %1 = alloca i64, align 8 %2 = alloca float, align 4 store float 1.000000e+00, float* %2, align 4 %3 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %1, i32 0, i32 0, i32 0, i32 0, i32 0, float* %2) %4 = load i64, i64* %1, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 8 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry %13 = load i32, i32* %m, align 4 %14 = sext i32 %13 to i64 %15 = add i64 1, %14 %16 = sub i64 %15, 1 %17 = icmp sgt i64 3, %16 %18 = or i1 false, %17 br i1 %18, label %then, label %ifcont then: ; preds = %free_done %19 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %20 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %21 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %20, i32 0, i32 0 %22 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %21, i32 0, i32 0 store i8* getelementptr inbounds ([53 x i8], [53 x i8]* @3, i32 0, i32 0), i8** %22, align 8 %23 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %21, i32 0, i32 1 store i32 13, i32* %23, align 4 %24 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %21, i32 0, i32 2 store i32 18, i32* %24, align 4 %25 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %21, i32 0, i32 3 store i32 13, i32* %25, align 4 %26 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %21, i32 0, i32 4 store i32 23, i32* %26, align 4 %27 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @4, i32 0, i32 0)) %28 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %19, i32 0, i32 0 %29 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %20, i32 0, i32 0 %30 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %28, i32 0, i32 2 %31 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %28, i32 0, i32 0 store i1 true, i1* %31, align 1 %32 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %28, i32 0, i32 1 store i8* %27, i8** %32, align 8 store { i8*, i32, i32, i32, i32 }* %29, { i8*, i32, i32, i32, i32 }** %30, align 8 %33 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %28, i32 0, i32 3 store i32 1, i32* %33, align 4 %34 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %19, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %34, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @2, i32 0, i32 0), i64 3, i32 1, i64 1, i64 %16) call void @exit(i32 1) unreachable ifcont: ; preds = %free_done %35 = mul i64 1, %14 %36 = getelementptr inbounds i32, i32* %arr, i64 2 call void %fnc(i32* %arr, i32* %m, i32* %36) br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_driver FINALIZE_SYMTABLE_driver: ; preds = %return ret void } declare void @fnc(i32*, i32*, i32*) define void @implicit_interface_check(i32* %arr1, i32* %m, i32* %c) { .entry: %0 = call i8* @_lfortran_get_default_allocator() %1 = load i32, i32* %m, align 4 %2 = icmp ne i32 %1, 3 br i1 %2, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %3 = load i32, i32* %c, align 4 %4 = icmp ne i32 %3, 30 br i1 %4, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %5 = load i32, i32* %m, align 4 %6 = sext i32 %5 to i64 %7 = add i64 1, %6 %8 = sub i64 %7, 1 %9 = icmp sgt i64 1, %8 %10 = or i1 false, %9 br i1 %10, label %then4, label %ifcont5 then4: ; preds = %ifcont3 %11 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %12 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %13 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %12, i32 0, i32 0 %14 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %13, i32 0, i32 0 store i8* getelementptr inbounds ([53 x i8], [53 x i8]* @11, i32 0, i32 0), i8** %14, align 8 %15 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %13, i32 0, i32 1 store i32 20, i32* %15, align 4 %16 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %13, i32 0, i32 2 store i32 5, i32* %16, align 4 %17 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %13, i32 0, i32 3 store i32 20, i32* %17, align 4 %18 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %13, i32 0, i32 4 store i32 11, i32* %18, align 4 %19 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @12, i32 0, i32 0)) %20 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %11, i32 0, i32 0 %21 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %12, i32 0, i32 0 %22 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %20, i32 0, i32 2 %23 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %20, i32 0, i32 0 store i1 true, i1* %23, align 1 %24 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %20, i32 0, i32 1 store i8* %19, i8** %24, align 8 store { i8*, i32, i32, i32, i32 }* %21, { i8*, i32, i32, i32, i32 }** %22, align 8 %25 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %20, i32 0, i32 3 store i32 1, i32* %25, align 4 %26 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %11, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %26, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @10, i32 0, i32 0), i64 1, i32 1, i64 1, i64 %8) call void @exit(i32 1) unreachable ifcont5: ; preds = %ifcont3 %27 = mul i64 1, %6 %28 = getelementptr inbounds i32, i32* %arr1, i64 0 %29 = load i32, i32* %28, align 4 %30 = icmp ne i32 %29, 10 br i1 %30, label %then6, label %else7 then6: ; preds = %ifcont5 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont8 else7: ; preds = %ifcont5 br label %ifcont8 ifcont8: ; preds = %else7, %then6 %31 = load i32, i32* %m, align 4 %32 = sext i32 %31 to i64 %33 = add i64 1, %32 %34 = sub i64 %33, 1 %35 = icmp sgt i64 2, %34 %36 = or i1 false, %35 br i1 %36, label %then9, label %ifcont10 then9: ; preds = %ifcont8 %37 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %38 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %39 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %38, i32 0, i32 0 %40 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %39, i32 0, i32 0 store i8* getelementptr inbounds ([53 x i8], [53 x i8]* @17, i32 0, i32 0), i8** %40, align 8 %41 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %39, i32 0, i32 1 store i32 21, i32* %41, align 4 %42 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %39, i32 0, i32 2 store i32 5, i32* %42, align 4 %43 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %39, i32 0, i32 3 store i32 21, i32* %43, align 4 %44 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %39, i32 0, i32 4 store i32 11, i32* %44, align 4 %45 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @18, i32 0, i32 0)) %46 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %37, i32 0, i32 0 %47 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %38, i32 0, i32 0 %48 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %46, i32 0, i32 2 %49 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %46, i32 0, i32 0 store i1 true, i1* %49, align 1 %50 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %46, i32 0, i32 1 store i8* %45, i8** %50, align 8 store { i8*, i32, i32, i32, i32 }* %47, { i8*, i32, i32, i32, i32 }** %48, align 8 %51 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %46, i32 0, i32 3 store i32 1, i32* %51, align 4 %52 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %37, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %52, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @16, i32 0, i32 0), i64 2, i32 1, i64 1, i64 %34) call void @exit(i32 1) unreachable ifcont10: ; preds = %ifcont8 %53 = mul i64 1, %32 %54 = getelementptr inbounds i32, i32* %arr1, i64 1 %55 = load i32, i32* %54, align 4 %56 = icmp ne i32 %55, 20 br i1 %56, label %then11, label %else12 then11: ; preds = %ifcont10 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont13 else12: ; preds = %ifcont10 br label %ifcont13 ifcont13: ; preds = %else12, %then11 %57 = load i32, i32* %m, align 4 %58 = sext i32 %57 to i64 %59 = add i64 1, %58 %60 = sub i64 %59, 1 %61 = icmp sgt i64 3, %60 %62 = or i1 false, %61 br i1 %62, label %then14, label %ifcont15 then14: ; preds = %ifcont13 %63 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %64 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %65 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %64, i32 0, i32 0 %66 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %65, i32 0, i32 0 store i8* getelementptr inbounds ([53 x i8], [53 x i8]* @23, i32 0, i32 0), i8** %66, align 8 %67 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %65, i32 0, i32 1 store i32 22, i32* %67, align 4 %68 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %65, i32 0, i32 2 store i32 5, i32* %68, align 4 %69 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %65, i32 0, i32 3 store i32 22, i32* %69, align 4 %70 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %65, i32 0, i32 4 store i32 11, i32* %70, align 4 %71 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @24, i32 0, i32 0)) %72 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %63, i32 0, i32 0 %73 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %64, i32 0, i32 0 %74 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %72, i32 0, i32 2 %75 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %72, i32 0, i32 0 store i1 true, i1* %75, align 1 %76 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %72, i32 0, i32 1 store i8* %71, i8** %76, align 8 store { i8*, i32, i32, i32, i32 }* %73, { i8*, i32, i32, i32, i32 }** %74, align 8 %77 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %72, i32 0, i32 3 store i32 1, i32* %77, align 4 %78 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %63, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %78, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @22, i32 0, i32 0), i64 3, i32 1, i64 1, i64 %60) call void @exit(i32 1) unreachable ifcont15: ; preds = %ifcont13 %79 = mul i64 1, %58 %80 = getelementptr inbounds i32, i32* %arr1, i64 2 %81 = load i32, i32* %80, align 4 %82 = icmp ne i32 %81, 30 br i1 %82, label %then16, label %else17 then16: ; preds = %ifcont15 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @27, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont18 else17: ; preds = %ifcont15 br label %ifcont18 ifcont18: ; preds = %else17, %then16 br label %return return: ; preds = %ifcont18 br label %FINALIZE_SYMTABLE_implicit_interface_check FINALIZE_SYMTABLE_implicit_interface_check: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare i8* @_lcompilers_snprintf_alloc(i8*, i8*, ...) declare void @_lcompilers_runtime_error(i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) declare void @exit(i32) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @_lpython_call_initial_functions(i32, i8**) lfortran-0.63.0/tests/reference/asr-modules_44-ec0baa3.stdout0000664000175000017500000005567015174404631024137 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_44: (Program (SymbolTable 9 { cmd_new: (ExternalSymbol 9 cmd_new 2 cmd_new modules_44_fpm_cmd_new [] cmd_new Public ), fpm_cmd_settings: (ExternalSymbol 9 fpm_cmd_settings 2 fpm_cmd_settings modules_44_fpm_cmd_new [] fpm_cmd_settings Public ), fpm_new_settings: (ExternalSymbol 9 fpm_new_settings 2 fpm_new_settings modules_44_fpm_cmd_new [] fpm_new_settings Public ), settings: (Variable 9 settings [] Local () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 9 fpm_new_settings Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), warnwrite: (ExternalSymbol 9 warnwrite 4 warnwrite modules_44_module_fpm_filesystem [] warnwrite Public ) }) modules_44 [modules_44_fpm_cmd_new modules_44_module_fpm_filesystem] [(SubroutineCall 9 cmd_new () [((Var 9 settings))] () .false. )] ), modules_44_fpm_cmd_new: (Module (SymbolTable 2 { cmd_new: (Function (SymbolTable 8 { 1_fpm_new_settings_name: (ExternalSymbol 8 1_fpm_new_settings_name 7 name fpm_new_settings [] name Public ), littlefile: (Variable 8 littlefile [] Local () () Default (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), settings: (Variable 8 settings [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 fpm_new_settings Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cmd_new (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 settings)] [(Assignment (Var 8 littlefile) (ArrayConstant 160 ["# ", "My cool new project! "] (Array (String 1 (IntegerConstant 80 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] PointerArray ) ColMajor ) () .false. .false. ) (SubroutineCall 2 warnwrite () [((StructInstanceMember (Var 8 settings) 8 1_fpm_new_settings_name (Allocatable (String 1 () DeferredLength DescriptorString) ) () )) ((Var 8 littlefile))] () .false. )] () Public .true. .true. () ), fpm_cmd_settings: (Struct (SymbolTable 6 { working_dir: (Variable 6 working_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fpm_cmd_settings (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [working_dir] [] Source Public .false. .true. [] () () [] ), fpm_new_settings: (Struct (SymbolTable 7 { name: (Variable 7 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fpm_new_settings (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [name] [] Source Public .false. .false. [] () 2 fpm_cmd_settings [] ), warnwrite: (ExternalSymbol 2 warnwrite 4 warnwrite modules_44_module_fpm_filesystem [] warnwrite Public ) }) modules_44_fpm_cmd_new () [modules_44_module_fpm_filesystem] .false. .false. .false. ), modules_44_module_fpm_filesystem: (Module (SymbolTable 4 { warnwrite: (Function (SymbolTable 5 { data: (Variable 5 data [] In () () Default (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), fname: (Variable 5 fname [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) warnwrite (FunctionType [(String 1 () AssumedLength DescriptorString) (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 fname) (Var 5 data)] [] () Public .true. .true. () ) }) modules_44_module_fpm_filesystem () [] .true. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-arrays_20-4b5a0e4.json0000664000175000017500000000074515174404631023250 0ustar alastairalastair{ "basename": "asr-arrays_20-4b5a0e4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_20.f90", "infile_hash": "9b510b477f3e38a2dd4c07f275793e897a598f8252fcfa0870a55899", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_20-4b5a0e4.stdout", "stdout_hash": "02a598b44e04e4927ef90e75a66fbdb820657b4e64edbe9552d9bf96", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-matrix_matmul_04-90da47c.stderr0000664000175000017500000000030515174404631025165 0ustar alastairalastairsemantic error: `matmul` accepts arrays of rank 1 or 2 only, provided an array with rank, 3 --> tests/errors/matrix_matmul_04.f90:5:21 | 5 | print *, matmul(a, b) | ^ lfortran-0.63.0/tests/reference/ast-where_01-cc363a1.json0000664000175000017500000000074215174404631023056 0ustar alastairalastair{ "basename": "ast-where_01-cc363a1", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/where_01.f90", "infile_hash": "b3e2251e4cd263f14db0266759a9af716dce48521dcd2f1e6eadce17", "outfile": null, "outfile_hash": null, "stdout": "ast-where_01-cc363a1.stdout", "stdout_hash": "eebceb97b9c4cc54625f9f2e2cebfba97056a8ecb0e41dae5f35ae3e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-struct_allocate-606e066.json0000664000175000017500000000076715174404631024512 0ustar alastairalastair{ "basename": "asr-struct_allocate-606e066", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/struct_allocate.f90", "infile_hash": "8f826ffcc557e1f998f9fb99e619bed6aa68bc3f5e45768ad8fa12a9", "outfile": null, "outfile_hash": null, "stdout": "asr-struct_allocate-606e066.stdout", "stdout_hash": "85646ee363a2eda1eb1a9c20797c6a7945c2fbf9b9721c7f2d8d4e50", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-fixed_form_implicit_check-94844d9.json0000664000175000017500000000106215174404631026475 0ustar alastairalastair{ "basename": "asr-fixed_form_implicit_check-94844d9", "cmd": "lfortran --fixed-form --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_implicit_check.f", "infile_hash": "4913776655a2aab98265358375f290eedb9b92a2ef7424536067345c", "outfile": null, "outfile_hash": null, "stdout": "asr-fixed_form_implicit_check-94844d9.stdout", "stdout_hash": "f5db4bb18322b5946f9b1b07708d5aa93abb8f40b7505b8050412bed", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-incompatible_dimension_assignment_arr1-28b49c0.json0000664000175000017500000000105615174404631031261 0ustar alastairalastair{ "basename": "asr-incompatible_dimension_assignment_arr1-28b49c0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incompatible_dimension_assignment_arr1.f90", "infile_hash": "daa395a32105f0f71dbd4c9d998fc201815d8af3bfc7999db517fa80", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incompatible_dimension_assignment_arr1-28b49c0.stderr", "stderr_hash": "490c2fa77a6d816d9cd7d8956aa9dde9d389f043b860bb92ddffa64d", "returncode": 2 }lfortran-0.63.0/tests/reference/pass_global_stmts-global_scope1-f174531.json0000664000175000017500000000101415174404631026747 0ustar alastairalastair{ "basename": "pass_global_stmts-global_scope1-f174531", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope1.f90", "infile_hash": "449b38487b6c79754deedb9991f1867bcf8c67d0d93019c2fe15854c", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope1-f174531.stdout", "stdout_hash": "e9237c35773ba071ef9c793fd62a1b27e7dd34deb647e9a2314ce3f1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-block_data1-33d76d9.json0000664000175000017500000000075415174404631023553 0ustar alastairalastair{ "basename": "ast-block_data1-33d76d9", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/block_data1.f", "infile_hash": "75a23d4519eec459620a61996f68ddb43af0b44cb2fb1a34861528f0", "outfile": null, "outfile_hash": null, "stdout": "ast-block_data1-33d76d9.stdout", "stdout_hash": "fa6fc46628f6fbca3fed9e33648c5c116898e59d1be2698a8d5ab91f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-interface_01-b750ffe.json0000664000175000017500000000077115174404631024457 0ustar alastairalastair{ "basename": "ast_f90-interface_01-b750ffe", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/interface_01.f90", "infile_hash": "56828a66265782f7acd20520a5d25ac6246d6d44dfb8fa758507ed63", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-interface_01-b750ffe.stdout", "stdout_hash": "4d0222747e3813824dcd952e71a74279b38a6a0c576406f624e11190", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-interface_01-587eedf.json0000664000175000017500000000075615174404631024015 0ustar alastairalastair{ "basename": "ast-interface_01-587eedf", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/interface_01.f90", "infile_hash": "56828a66265782f7acd20520a5d25ac6246d6d44dfb8fa758507ed63", "outfile": null, "outfile_hash": null, "stdout": "ast-interface_01-587eedf.stdout", "stdout_hash": "2ffc8cf3e1c71c2bdd5857a3526d2e43d601c1633c0de8678ba7a5ed", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-string_03-7320626.stdout0000664000175000017500000002740715174404631023420 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_03: (Program (SymbolTable 3 { combined: (Variable 3 combined [] Local () () Default (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), intro: (ExternalSymbol 3 intro 2 intro string_03_mod [] intro Public ), last_name: (Variable 3 last_name [] Local () () Default (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), posit: (Variable 3 posit [] Local () () Default (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), title: (Variable 3 title [] Local () () Default (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), verb: (Variable 3 verb [] Local () () Default (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_03 [string_03_mod] [(Assignment (Var 3 verb) (StringConstant "learned " (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 3 posit) (StringConstant "from " (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 3 title) (StringConstant "the " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 3 last_name) (StringConstant "best" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 3 combined) (IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(Var 3 intro) (Var 3 verb)] 0 (String 1 (IntegerConstant 13 (Integer 8) Decimal) ExpressionLength DescriptorString) () ) (Var 3 posit)] 0 (String 1 (IntegerConstant 18 (Integer 8) Decimal) ExpressionLength DescriptorString) () ) (Var 3 title)] 0 (String 1 (IntegerConstant 22 (Integer 8) Decimal) ExpressionLength DescriptorString) () ) (Var 3 last_name)] 0 (String 1 (IntegerConstant 29 (Integer 8) Decimal) ExpressionLength DescriptorString) () ) (StringConstant "." (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 30 (Integer 8) Decimal) ExpressionLength DescriptorString) () ) () .false. .false. ) (Print (Var 3 combined) )] ), string_03_mod: (Module (SymbolTable 2 { intro: (Variable 2 intro [] Local (StringConstant "I've " (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "I've " (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_03_mod () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-sole_intrinsic-3e826bd.json0000664000175000017500000000075215174404631024501 0ustar alastairalastair{ "basename": "asr-sole_intrinsic-3e826bd", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/sole_intrinsic.f", "infile_hash": "eb8dafc3736c80b83b7cc0b62cbe2fce5882fac022c391b7514607ea", "outfile": null, "outfile_hash": null, "stdout": "asr-sole_intrinsic-3e826bd.stdout", "stdout_hash": "505772e2aeabd33caf2a36dfa3ca6645277d340f11cfe9e259077519", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-kind_var_of_int-1199f59.stderr0000664000175000017500000000026015174404631025006 0ustar alastairalastairsemantic error: Parameter 'a' is a variable, which does not reduce to a constant expression --> tests/errors/kind_var_of_int.f90:4:10 | 4 | real(a) :: x | ^ lfortran-0.63.0/tests/reference/asr-save_03-1103dd0.json0000664000175000017500000000073715174404631022617 0ustar alastairalastair{ "basename": "asr-save_03-1103dd0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/save_03.f90", "infile_hash": "cf1d7642d08ac82732ef50230fcd5c6a2efe507a49d1bab6d5fc4d18", "outfile": null, "outfile_hash": null, "stdout": "asr-save_03-1103dd0.stdout", "stdout_hash": "bb647fb8cf00445adf236cb006dd2e39b6565c36d2db75dc7f244fab", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit11-95f56fd.json0000664000175000017500000000106615174404631023443 0ustar alastairalastair{ "basename": "asr-implicit11-95f56fd", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit11.f90", "infile_hash": "b6ee32da95ff9a5b2be776f4ad79d4d7f0e0c5360d106273583e2a78", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit11-95f56fd.stdout", "stdout_hash": "361100bcf583c7f217fcb8a59c427b095df4db76ee5c3a074e8ecbf8", "stderr": "asr-implicit11-95f56fd.stderr", "stderr_hash": "09a57b521bb707f6d839d4a343a1d55910508436649b6c66115d3c15", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-assign_01-2cf003f.json0000664000175000017500000000074715174404631023233 0ustar alastairalastair{ "basename": "asr-assign_01-2cf003f", "cmd": "lfortran --semantics-only --continue-compilation --no-color {infile}", "infile": "tests/errors/assign_01.f90", "infile_hash": "b3907bfc11ab4a5400099590f3d20715a7fed312e26241facae934fb", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-assign_01-2cf003f.stderr", "stderr_hash": "22926a0ca854e3a26213cee88788e52c189e7e6d275089ff0cdc971c", "returncode": 1 }lfortran-0.63.0/tests/reference/julia-expr_11-ab53b8f.stderr0000664000175000017500000000024215174404631023654 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/expr_11.f90:3:5 | 3 | real*8 x | ^^^^^^ help: write this as 'real(8)' lfortran-0.63.0/tests/reference/pass_inline_function_calls-functions_08-49d8a27.json0000664000175000017500000000110015174404631030507 0ustar alastairalastair{ "basename": "pass_inline_function_calls-functions_08-49d8a27", "cmd": "lfortran --pass=inline_function_calls --show-asr --no-color --fast {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_08.f90", "infile_hash": "625582953de25dfa6d54c1e44d22b6e19394212ca99c252ca13236e2", "outfile": null, "outfile_hash": null, "stdout": "pass_inline_function_calls-functions_08-49d8a27.stdout", "stdout_hash": "cb618c051f579377542518d3c3c4e9bda5dad7782de9878a87a02240", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-case_03-436c4e5.json0000664000175000017500000000075215174404631023272 0ustar alastairalastair{ "basename": "ast_f90-case_03-436c4e5", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/case_03.f90", "infile_hash": "4fc1bb48b2136f22bb44b7c69aaa05a43b4ed2e4b8464c433340295d", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-case_03-436c4e5.stdout", "stdout_hash": "e3af8a21921e8d450ecd592961b7ca7e412454698b1ddbcbb34c3800", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-character_parameter_padding_trimming-ea91653.json0000664000175000017500000000121415174404631030757 0ustar alastairalastair{ "basename": "asr-character_parameter_padding_trimming-ea91653", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/character_parameter_padding_trimming.f90", "infile_hash": "3ac17fa68feb60423eaa66ebbb88a3e18da1a72d0c7e8ed8ac8de022", "outfile": null, "outfile_hash": null, "stdout": "asr-character_parameter_padding_trimming-ea91653.stdout", "stdout_hash": "08d193f52d8d83809bd086cbf486db9fcd1f20283d75914a79fda712", "stderr": "asr-character_parameter_padding_trimming-ea91653.stderr", "stderr_hash": "dd1d526423717b4be7522ae77a4f0054f4ceee382d37bbf977ca3d2b", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_03-54c2520.stdout0000664000175000017500000001366115174404631023632 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { access_vars: (Module (SymbolTable 2 { print_vars: (Function (SymbolTable 3 { }) print_vars (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(StringConstant "priv = " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 priv)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "publ = " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 publ)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), priv: (Variable 2 priv [] Local (RealConstant 1.500000 (Real 4) ) (RealConstant 1.500000 (Real 4) ) Save (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), publ: (Variable 2 publ [] Local (RealConstant 2.500000 (Real 4) ) (RealConstant 2.500000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) access_vars () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/wat-types_04-054550e.stdout0000664000175000017500000001020515174404631023327 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 f32 f32) f32.const 1.500000 local.set 1 i32.const 2 local.set 0 local.get 0 local.get 0 i32.mul f32.convert_i32_s local.set 2 local.get 1 local.get 1 f32.mul local.set 2 local.get 0 f32.convert_i32_s local.get 1 f32.mul local.set 2 local.get 1 local.get 0 f32.convert_i32_s f32.mul local.set 2 local.get 0 local.get 0 i32.add f32.convert_i32_s local.set 2 local.get 1 local.get 1 f32.add local.set 2 local.get 1 local.get 0 f32.convert_i32_s f32.add local.set 2 local.get 0 f32.convert_i32_s local.get 1 f32.add local.set 2 local.get 0 local.get 0 i32.sub f32.convert_i32_s local.set 2 local.get 1 local.get 1 f32.sub local.set 2 local.get 1 local.get 0 f32.convert_i32_s f32.sub local.set 2 local.get 0 f32.convert_i32_s local.get 1 f32.sub local.set 2 local.get 0 local.get 0 i32.div_s f32.convert_i32_s local.set 2 local.get 1 local.get 1 f32.div local.set 2 local.get 0 f32.convert_i32_s local.get 1 f32.div local.set 2 local.get 1 local.get 0 f32.convert_i32_s f32.div local.set 2 i32.const 0 call 0 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-0.63.0/tests/reference/ast_f90-program_01-4418962.json0000664000175000017500000000076315174404631023672 0ustar alastairalastair{ "basename": "ast_f90-program_01-4418962", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/program_01.f90", "infile_hash": "917ed02637c7a6c4e5e5407a0ccf45b4ef6ff79355c5c080e53d97e9", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-program_01-4418962.stdout", "stdout_hash": "1767245198713f882b2140749109ed41af157da8e1982e95a1868f6a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit8-03c7a90.stderr0000664000175000017500000000033215174404631023614 0ustar alastairalastairsemantic error: m, n is/are used as dimensions but not declared --> tests/implicit8.f90:1:1 - 6:12 | 1 | integer function a(n,m) | ^^^^^^^^^^^^^^^^^^^^^^^... ... | 6 | end function | ...^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-template_05-fe28e11.stdout0000664000175000017500000103022215174404631024137 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_05: (Program (SymbolTable 16 { integer_minus: (Function (SymbolTable 27 { r: (Variable 27 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 27 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 27 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) integer_minus (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~sub_intrinsic] [(Var 27 x) (Var 27 y)] [(Assignment (Var 27 r) (FunctionCall 16 ~sub_intrinsic () [((Var 27 x)) ((Var 27 y))] (Integer 4) () () ) () .false. .false. )] (Var 27 r) Public .true. .true. () ), integer_plus: (Function (SymbolTable 18 { r: (Variable 18 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 18 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 18 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) integer_plus (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~add_intrinsic] [(Var 18 x) (Var 18 y)] [(Assignment (Var 18 r) (FunctionCall 16 ~add_intrinsic () [((Var 18 x)) ((Var 18 y))] (Integer 4) () () ) () .false. .false. )] (Var 18 r) Public .true. .true. () ), integer_tmp_minus: (Template (SymbolTable 19 { g_minus: (Function (SymbolTable 20 { r: (Variable 20 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 20 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 20 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) g_minus (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [minus] [(Var 20 x) (Var 20 y)] [(Assignment (Var 20 r) (FunctionCall 19 minus () [((Var 20 x)) ((Var 20 y))] (Integer 4) () () ) () .false. .false. )] (Var 20 r) Public .true. .true. () ), minus: (Function (SymbolTable 21 { r: (Variable 21 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 21 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 21 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) minus (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 21 x) (Var 21 y)] [] (Var 21 r) Public .true. .true. () ), t: (Variable 19 t [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp_mult: (Template (SymbolTable 22 { mult: (Function (SymbolTable 23 { r: (Variable 23 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 23 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 23 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mult (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 23 x) (Var 23 y)] [] (Var 23 r) Public .true. .true. () ), t: (Variable 22 t [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp_div: (Template (SymbolTable 24 { div: (Function (SymbolTable 25 { r: (Variable 25 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 25 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 25 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) div (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 25 x) (Var 25 y)] [] (Var 25 r) Public .true. .true. () ), t: (Variable 24 t [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) tmp_div [div] [(Require req [t div] )] ) }) tmp_mult [mult] [(Require req [t mult] )] ) }) integer_tmp_minus [minus] [(Require req [t minus] ) (Require req [t plus] )] ), integer_tmp_mult: (Template (SymbolTable 28 { mult: (Function (SymbolTable 29 { r: (Variable 29 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 29 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 29 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mult (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 29 x) (Var 29 y)] [] (Var 29 r) Public .true. .true. () ), t: (Variable 28 t [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp_div: (Template (SymbolTable 30 { div: (Function (SymbolTable 31 { r: (Variable 31 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 31 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 31 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) div (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 31 x) (Var 31 y)] [] (Var 31 r) Public .true. .true. () ), t: (Variable 30 t [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) tmp_div [div] [(Require req [t div] )] ) }) integer_tmp_mult [mult] [(Require req [t mult] )] ), real_minus: (Function (SymbolTable 42 { r: (Variable 42 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 42 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 42 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) real_minus (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~sub_intrinsic1] [(Var 42 x) (Var 42 y)] [(Assignment (Var 42 r) (FunctionCall 16 ~sub_intrinsic1 () [((Var 42 x)) ((Var 42 y))] (Real 4) () () ) () .false. .false. )] (Var 42 r) Public .true. .true. () ), real_plus: (Function (SymbolTable 33 { r: (Variable 33 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 33 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 33 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) real_plus (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~add_intrinsic1] [(Var 33 x) (Var 33 y)] [(Assignment (Var 33 r) (FunctionCall 16 ~add_intrinsic1 () [((Var 33 x)) ((Var 33 y))] (Real 4) () () ) () .false. .false. )] (Var 33 r) Public .true. .true. () ), real_tmp_minus: (Template (SymbolTable 34 { g_minus: (Function (SymbolTable 35 { r: (Variable 35 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 35 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 35 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) g_minus (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [minus] [(Var 35 x) (Var 35 y)] [(Assignment (Var 35 r) (FunctionCall 34 minus () [((Var 35 x)) ((Var 35 y))] (Real 4) () () ) () .false. .false. )] (Var 35 r) Public .true. .true. () ), minus: (Function (SymbolTable 36 { r: (Variable 36 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 36 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 36 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) minus (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 36 x) (Var 36 y)] [] (Var 36 r) Public .true. .true. () ), t: (Variable 34 t [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp_mult: (Template (SymbolTable 37 { mult: (Function (SymbolTable 38 { r: (Variable 38 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 38 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 38 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mult (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 38 x) (Var 38 y)] [] (Var 38 r) Public .true. .true. () ), t: (Variable 37 t [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp_div: (Template (SymbolTable 39 { div: (Function (SymbolTable 40 { r: (Variable 40 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 40 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 40 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) div (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 40 x) (Var 40 y)] [] (Var 40 r) Public .true. .true. () ), t: (Variable 39 t [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) tmp_div [div] [(Require req [t div] )] ) }) tmp_mult [mult] [(Require req [t mult] )] ) }) real_tmp_minus [minus] [(Require req [t minus] ) (Require req [t plus] )] ), real_tmp_mult: (Template (SymbolTable 43 { mult: (Function (SymbolTable 44 { r: (Variable 44 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 44 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 44 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mult (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 44 x) (Var 44 y)] [] (Var 44 r) Public .true. .true. () ), t: (Variable 43 t [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp_div: (Template (SymbolTable 45 { div: (Function (SymbolTable 46 { r: (Variable 46 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 46 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 46 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) div (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 46 x) (Var 46 y)] [] (Var 46 r) Public .true. .true. () ), t: (Variable 45 t [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) tmp_div [div] [(Require req [t div] )] ) }) real_tmp_mult [mult] [(Require req [t mult] )] ), req: (ExternalSymbol 16 req 2 req template_05_m [] req Public ), tmp: (ExternalSymbol 16 tmp 2 tmp template_05_m [] tmp Public ), ~add: (CustomOperator 16 ~add [16 ~add_intrinsic 16 ~add_intrinsic1] Public ), ~add_intrinsic: (Function (SymbolTable 17 { arg0: (Variable 17 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 17 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 17 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 17 arg0) (Var 17 arg1)] [(Assignment (Var 17 ret) (IntegerBinOp (Var 17 arg0) Add (Var 17 arg1) (Integer 4) () ) () .false. .false. )] (Var 17 ret) Public .true. .true. () ), ~add_intrinsic1: (Function (SymbolTable 32 { arg0: (Variable 32 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 32 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 32 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic1 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 32 arg0) (Var 32 arg1)] [(Assignment (Var 32 ret) (RealBinOp (Var 32 arg0) Add (Var 32 arg1) (Real 4) () ) () .false. .false. )] (Var 32 ret) Public .true. .true. () ), ~sub: (CustomOperator 16 ~sub [16 ~sub_intrinsic 16 ~sub_intrinsic1] Public ), ~sub_intrinsic: (Function (SymbolTable 26 { arg0: (Variable 26 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 26 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 26 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~sub_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 26 arg0) (Var 26 arg1)] [(Assignment (Var 26 ret) (IntegerBinOp (Var 26 arg0) Sub (Var 26 arg1) (Integer 4) () ) () .false. .false. )] (Var 26 ret) Public .true. .true. () ), ~sub_intrinsic1: (Function (SymbolTable 41 { arg0: (Variable 41 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 41 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 41 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~sub_intrinsic1 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 41 arg0) (Var 41 arg1)] [(Assignment (Var 41 ret) (RealBinOp (Var 41 arg0) Sub (Var 41 arg1) (Real 4) () ) () .false. .false. )] (Var 41 ret) Public .true. .true. () ) }) template_05 [template_05_m] [] ), template_05_m: (Module (SymbolTable 2 { req: (Requirement (SymbolTable 3 { op: (Function (SymbolTable 4 { r: (Variable 4 r [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) op (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 r) Public .true. .true. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) req [t op] [] ), tmp: (Template (SymbolTable 5 { g_plus: (Function (SymbolTable 15 { r: (Variable 15 r [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 15 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 15 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) g_plus (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [plus] [(Var 15 x) (Var 15 y)] [(Assignment (Var 15 r) (FunctionCall 5 plus () [((Var 15 x)) ((Var 15 y))] (TypeParameter t ) () () ) () .false. .false. )] (Var 15 r) Public .true. .true. () ), plus: (Function (SymbolTable 6 { r: (Variable 6 r [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 6 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 6 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 6 x) (Var 6 y)] [] (Var 6 r) Public .true. .true. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp_minus: (Template (SymbolTable 7 { g_minus: (Function (SymbolTable 14 { r: (Variable 14 r [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 14 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 14 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) g_minus (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [minus] [(Var 14 x) (Var 14 y)] [(Assignment (Var 14 r) (FunctionCall 7 minus () [((Var 14 x)) ((Var 14 y))] (TypeParameter t ) () () ) () .false. .false. )] (Var 14 r) Public .true. .true. () ), minus: (Function (SymbolTable 8 { r: (Variable 8 r [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 8 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 8 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) minus (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 8 x) (Var 8 y)] [] (Var 8 r) Public .true. .true. () ), plus: (Function (SymbolTable 9 { r: (Variable 9 r [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 9 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 9 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 9 x) (Var 9 y)] [] (Var 9 r) Public .true. .true. () ), t: (Variable 7 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp_mult: (Template (SymbolTable 10 { mult: (Function (SymbolTable 11 { r: (Variable 11 r [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 11 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 11 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mult (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 11 x) (Var 11 y)] [] (Var 11 r) Public .true. .true. () ), t: (Variable 10 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp_div: (Template (SymbolTable 12 { div: (Function (SymbolTable 13 { r: (Variable 13 r [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 13 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 13 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) div (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 13 x) (Var 13 y)] [] (Var 13 r) Public .true. .true. () ), t: (Variable 12 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) tmp_div [div] [(Require req [t div] )] ) }) tmp_mult [mult] [(Require req [t mult] )] ) }) tmp_minus [minus] [(Require req [t minus] ) (Require req [t plus] )] ) }) tmp [t plus] [(Require req [t plus] )] ) }) template_05_m () [template_05_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-string_14-861794e.stdout0000664000175000017500000007054615174404631023522 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_14: (Program (SymbolTable 6 { }) string_14 [] [] ), string_14_stdlib_string_type: (Module (SymbolTable 2 { read_formatted: (Function (SymbolTable 5 { iomsg: (Variable 5 iomsg [] InOut () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iostat: (Variable 5 iostat [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iotype: (Variable 5 iotype [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), line: (Variable 5 line [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 5 string [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), unit: (Variable 5 unit [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v_list: (Variable 5 v_list [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) read_formatted (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (Integer 4) (String 1 () AssumedLength DescriptorString) (Array (Integer 4) [(() ())] DescriptorArray ) (Integer 4) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 string) (Var 5 unit) (Var 5 iotype) (Var 5 v_list) (Var 5 iostat) (Var 5 iomsg)] [] () Public .true. .true. () ), string_type: (Struct (SymbolTable 3 { raw: (Variable 3 raw [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_type (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [raw] [] Source Private .false. .false. [] () () [] ), write_formatted: (Function (SymbolTable 4 { iomsg: (Variable 4 iomsg [] InOut () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iostat: (Variable 4 iostat [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iotype: (Variable 4 iotype [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 4 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), unit: (Variable 4 unit [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v_list: (Variable 4 v_list [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) write_formatted (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (Integer 4) (String 1 () AssumedLength DescriptorString) (Array (Integer 4) [(() ())] DescriptorArray ) (Integer 4) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 string) (Var 4 unit) (Var 4 iotype) (Var 4 v_list) (Var 4 iostat) (Var 4 iomsg)] [] () Public .true. .true. () ), ~read_formatted: (CustomOperator 2 ~read_formatted [2 read_formatted] Public ), ~write_formatted: (CustomOperator 2 ~write_formatted [2 write_formatted] Public ) }) string_14_stdlib_string_type () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-implicit_typing2-1e706a4.stderr0000664000175000017500000000020615174404631025201 0ustar alastairalastairsemantic error: Variable 'x' is not declared --> tests/errors/implicit_typing2.f90:6:5 | 6 | x = 1 | ^ 'x' is undeclared lfortran-0.63.0/tests/reference/c-pragma2-a14de52.json0000664000175000017500000000066715174404631022440 0ustar alastairalastair{ "basename": "c-pragma2-a14de52", "cmd": "lfortran --no-color --show-c {infile}", "infile": "tests/pragma2.f90", "infile_hash": "c76c30115a39aa0c98b24173c8517df1fb525bf101023b12dc38ca3e", "outfile": null, "outfile_hash": null, "stdout": "c-pragma2-a14de52.stdout", "stdout_hash": "a657ba049ef975e996c0b11ced85944ff0c0a5e3785154c82d55deff", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-write_22-368d6f8.json0000664000175000017500000000071215174404631023060 0ustar alastairalastair{ "basename": "run-write_22-368d6f8", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/write_22.f90", "infile_hash": "bb59757aca5431680883ad827dfcf64f91d2dc9e8ec0a32298308d61", "outfile": null, "outfile_hash": null, "stdout": "run-write_22-368d6f8.stdout", "stdout_hash": "bc6ca5445125237b82fe812b13f94a6233070ae3b070a1b5630bcf1c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixedform_subroutine2-805f758.stdout0000664000175000017500000000314715174404631026226 0ustar alastairalastair(TranslationUnit [(Program subr2 () [] [] [] [(SubroutineCall 0 my_subr [] [] [] [] () )] [] ) (Subroutine my_subr [] [] () () [] [] [] [] [(Print 0 () [(FuncCallOrArray sxvals [] [] [] [] [] )] () ) (If 0 () (/= (FuncCallOrArray sxvals [] [] [] [] [] ) 4) [(ErrorStop 0 () () () )] [] () () () ) (Return 0 () () )] [(Function sxvals [] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [] [(Assignment 0 sxvals 4 () ) (Return 0 () () )] [] [] )] [] )] ) lfortran-0.63.0/tests/reference/asr-assign_01-40d16c6.stderr0000664000175000017500000000035215174404631023501 0ustar alastairalastairsemantic error: Cannot assign to a constant variable --> tests/errors/assign_01.f90:5:5 | 5 | x = 1 | ^^^^^ assignment here | 4 | integer, parameter :: x = 2 | ~~~~~ declared as constant lfortran-0.63.0/tests/reference/asr_disable_warnings-style1-3d16af1.stderr0000664000175000017500000000046515174404631026614 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/style1.f90:4:11 | 4 | if (y .eq. 1) then | ^^^^ help: write this as '==' style suggestion: Use '==' instead of '.eq.' --> tests/style1.f90:10:15 | 10 | if (x .eq. 1) then | ^^^^ help: write this as '==' lfortran-0.63.0/tests/reference/asr-functions_09-1e51ac7.json0000664000175000017500000000075615174404631023772 0ustar alastairalastair{ "basename": "asr-functions_09-1e51ac7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_09.f90", "infile_hash": "050352bd7c3ecc846699ec79fe6e09ed5b9515fba210bdbbf66355b0", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_09-1e51ac7.stdout", "stdout_hash": "60489d5ae9a2e56a8ceb40d99d9c2896c834104ba598f8c3b4d9a4ec", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-dprod_01-80a930c.stderr0000664000175000017500000000026715174404631023332 0ustar alastairalastairsemantic error: first argument of `dprod` must have kind equal to 4 --> tests/errors/dprod_01.f90:2:13 | 2 | print*, dprod(4.23_8, 4.3_8) | ^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/llvm-modules_36-53c9a79.json0000664000175000017500000000075315174404631023552 0ustar alastairalastair{ "basename": "llvm-modules_36-53c9a79", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_36.f90", "infile_hash": "81bd7e21e30c46c3779cc4c928723fbf58bcc748333a96faee9d0b96", "outfile": null, "outfile_hash": null, "stdout": "llvm-modules_36-53c9a79.stdout", "stdout_hash": "c6bd38ed8c13709486b520ab653800cb092a7fdf2c3a9f47553a0347", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-allocated_05-d9e0943.stderr0000664000175000017500000000040115174404631024175 0ustar alastairalastairruntime error: Attempting to allocate already allocated variable 'arr' --> tests/errors/allocated_05.f90:6:14 | 6 | allocate(arr(20)) ! Error: double allocation of array | ^^^^^^^ Cannot allocate 'arr' because it is already allocated lfortran-0.63.0/tests/reference/ast-complex3-001609d.stdout0000664000175000017500000000450515174404631023410 0ustar alastairalastair(TranslationUnit [(Program complex3 () [] [] [(Declaration (AttrType TypeComplex [(() 8 Value)] () () None ) [] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeComplex [(() 8 Value)] () () None ) [] [(y [] [] () () None ())] () ) (Declaration (AttrType TypeComplex [(() 4 Value)] () () None ) [] [(z [] [] () () None ())] () ) (Declaration (AttrType TypeComplex [(() 4 Value)] () () None ) [] [(w [] [] () () None ())] () )] [(Assignment 0 x (Complex (Real "3.0_8") (Real "4.0_8")) () ) (Print 0 () [x] () ) (Assignment 0 y (Complex (Real "3.0_8") (Real "4.0_8")) () ) (Print 0 () [y] () ) (Assignment 0 z (Complex (Real "3.0_4") (Real "4.0_4")) () ) (Print 0 () [z] () ) (Assignment 0 w (Complex (Real "3.0_4") (Real "4.0_4")) () ) (Print 0 () [w] () )] [] )] ) lfortran-0.63.0/tests/reference/llvm-arrays_01_size-aaed99f.json0000664000175000017500000000076715174404631024650 0ustar alastairalastair{ "basename": "llvm-arrays_01_size-aaed99f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01_size.f90", "infile_hash": "cb58e1bbc81b8cb3e39e493299f8ce73339c3bfe6f97ec12ea102145", "outfile": null, "outfile_hash": null, "stdout": "llvm-arrays_01_size-aaed99f.stdout", "stdout_hash": "30c6e44be82350ae08109151db8952d910017f0d86f701a130bf6eee", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-team1-f402eac.json0000664000175000017500000000071715174404631023214 0ustar alastairalastair{ "basename": "ast_f90-team1-f402eac", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/team1.f90", "infile_hash": "c7d57807d2f91911de8beb317405307221c403b50c6abdec58484b8b", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-team1-f402eac.stdout", "stdout_hash": "7deb5f0a6d28fb6d9050ae9329cb75b57d169ba8671f27f26c2a2fb5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-subroutine9-8ecec78.json0000664000175000017500000000072615174404631024041 0ustar alastairalastair{ "basename": "ast-subroutine9-8ecec78", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine9.f90", "infile_hash": "7936a6a897f4c893828bca05987a6c387bcda279b2ac5f20199ffda3", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine9-8ecec78.stdout", "stdout_hash": "70ff4b1f1c748ff344c2f1067fb05b367850b7d510b15cec05c6a4c5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-close_invalid_kwarg1-b38b499.json0000664000175000017500000000077015174404631025473 0ustar alastairalastair{ "basename": "asr-close_invalid_kwarg1-b38b499", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/close_invalid_kwarg1.f90", "infile_hash": "296192ece06382b8ad7da3a6e8a9b36ec6a2d6b04dfd8d6a6e48fdf8", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-close_invalid_kwarg1-b38b499.stderr", "stderr_hash": "c25da8e5009596338b320d2df46e459e72d9d78b60d4d488724c3953", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-array_constructor_with_different_char_lengths-5ba8b29.stderr0000664000175000017500000000034715174404631033373 0ustar alastairalastairsemantic error: Different `character` lengths 1 and 4 in array constructor --> tests/errors/array_constructor_with_different_char_lengths.f90:2:25 | 2 | print *, ["a", "b", "ball", "cat"] | ^^^^^^ lfortran-0.63.0/tests/reference/asr-data_implied_do3-831f843.json0000664000175000017500000000075415174404631024503 0ustar alastairalastair{ "basename": "asr-data_implied_do3-831f843", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/data_implied_do3.f90", "infile_hash": "4c07155ba247fba917733abca349b0f913d94718d6f112b738a4b935", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-data_implied_do3-831f843.stderr", "stderr_hash": "60f5d377bcdf47e10bbe333081aa6b077dc3b4b637f3d42dee03fa97", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-bits_01-2906c1d.stdout0000664000175000017500000001601615174404631023202 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bits_01: (Program (SymbolTable 2 { int32: (ExternalSymbol 2 int32 4 int32 lfortran_intrinsic_iso_fortran_env [] int32 Public ), int64: (ExternalSymbol 2 int64 4 int64 lfortran_intrinsic_iso_fortran_env [] int64 Public ) }) bits_01 [iso_fortran_env] [(If () (IntegerCompare (IntrinsicElementalFunction Ibclr [(IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction Ibclr [(IntegerConstant 4 (Integer 8) Decimal) (IntegerConstant 1 (Integer 4) Decimal)] 0 (Integer 8) (IntegerConstant 4 (Integer 8) Decimal) ) NotEq (IntegerConstant 4 (Integer 8) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction Ibset [(IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction Ibset [(IntegerConstant 2 (Integer 8) Decimal) (IntegerConstant 3 (Integer 4) Decimal)] 0 (Integer 8) (IntegerConstant 10 (Integer 8) Decimal) ) NotEq (IntegerConstant 10 (Integer 8) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction Ieor [(IntegerConstant 16 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 18 (Integer 4) Decimal) ) NotEq (IntegerConstant 18 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction Ieor [(IntegerConstant 31 (Integer 8) Decimal) (IntegerConstant 3 (Integer 8) Decimal)] 0 (Integer 8) (IntegerConstant 28 (Integer 8) Decimal) ) NotEq (IntegerConstant 28 (Integer 8) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] )] ), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env) }) [] ) lfortran-0.63.0/tests/reference/wat-cpu_time_02_wasm-fa2b15f.stdout0000664000175000017500000000456115174404631025244 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-0.63.0/tests/reference/asr-array_transfer_01-3dca715.stderr0000664000175000017500000000032015174404631025312 0ustar alastairalastairsemantic error: size argument to `transfer` intrinsic must be of Integer type. --> tests/errors/array_transfer_01.f90:5:29 | 5 | print *, transfer(a, 1, size_a) | ^^^^^^ lfortran-0.63.0/tests/reference/asr-interface_08-1848d3c.stdout0000664000175000017500000001072615174404631024220 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { interface_08: (Module (SymbolTable 2 { sub: (Function (SymbolTable 3 { x: (Variable 3 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 3 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub (FunctionType [(Integer 4) (Integer 4)] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 y)] [] () Public .false. .false. () ) }) interface_08 () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/wat-empty-681c1d1.stdout0000664000175000017500000000456115174404631023106 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-0.63.0/tests/reference/asr-statement1-481e9b6.json0000664000175000017500000000075015174404631023465 0ustar alastairalastair{ "basename": "asr-statement1-481e9b6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/statement1.f90", "infile_hash": "e27125e5f5fdb977cddd49bc08366334cf6ed0375a909614296fbb14", "outfile": null, "outfile_hash": null, "stdout": "asr-statement1-481e9b6.stdout", "stdout_hash": "0218c05b1a88d031b503713c257878a77e8ad1dc7d6ea88392ce2507", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-common2-64c97b2.stdout0000664000175000017500000006703215174404631023327 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .true. .true. () ), file_common_block_block_1: (Module (SymbolTable 3 { block_1: (Struct (SymbolTable 4 { a: (Variable 4 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), h: (Variable 4 h [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) block_1 (StructType [] [] .true. .false. ) [] [a b h] [] Source Public .false. .false. [] () () [] ), struct_instance_block_1: (Variable 3 struct_instance_block_1 [] Local () () Default (StructType [] [] .true. .false. ) 3 block_1 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) file_common_block_block_1 () [] .false. .false. .false. ), file_common_block_block_2: (Module (SymbolTable 5 { block_2: (Struct (SymbolTable 6 { c: (Variable 6 c [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 6 d [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) block_2 (StructType [] [] .true. .false. ) [] [c d] [] Source Public .false. .false. [] () () [] ), struct_instance_block_2: (Variable 5 struct_instance_block_2 [] Local () () Default (StructType [] [] .true. .false. ) 5 block_2 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) file_common_block_block_2 () [] .false. .false. .false. ), file_common_block_block_3: (Module (SymbolTable 7 { block_3: (Struct (SymbolTable 8 { e: (Variable 8 e [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), g: (Variable 8 g [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) block_3 (StructType [] [] .true. .false. ) [] [e g] [] Source Public .false. .false. [] () () [] ), struct_instance_block_3: (Variable 7 struct_instance_block_3 [] Local () () Default (StructType [] [] .true. .false. ) 7 block_3 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) file_common_block_block_3 () [] .false. .false. .false. ), file_common_block_block_4: (Module (SymbolTable 9 { block_4: (Struct (SymbolTable 10 { i: (Variable 10 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) block_4 (StructType [] [] .true. .false. ) [] [i] [] Source Public .false. .false. [] () () [] ), struct_instance_block_4: (Variable 9 struct_instance_block_4 [] Local () () Default (StructType [] [] .true. .false. ) 9 block_4 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) file_common_block_block_4 () [] .false. .false. .false. ), file_common_block_block_5: (Module (SymbolTable 11 { block_5: (Struct (SymbolTable 12 { j: (Variable 12 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 12 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) block_5 (StructType [] [] .true. .false. ) [] [j k] [] Source Public .false. .false. [] () () [] ), struct_instance_block_5: (Variable 11 struct_instance_block_5 [] Local () () Default (StructType [] [] .true. .false. ) 11 block_5 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) file_common_block_block_5 () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/run-error_stop_04-8f1e721.json0000664000175000017500000000073115174404631024112 0ustar alastairalastair{ "basename": "run-error_stop_04-8f1e721", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/error_stop_04.f90", "infile_hash": "43fa904db7997988ab0d436e206706e0938feb0bf82ce0cbfec1fd67", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-error_stop_04-8f1e721.stderr", "stderr_hash": "03404f69d60aea2f0d4467699ed7e836de4bd9a3b4c7053c1419c68f", "returncode": 1 }lfortran-0.63.0/tests/reference/pass_where-where_03-00685f9.json0000664000175000017500000000077515174404631024315 0ustar alastairalastair{ "basename": "pass_where-where_03-00685f9", "cmd": "lfortran --pass=where --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/where_03.f90", "infile_hash": "987afee1a50b146dbe0bb5ebb0052fdc3bcef478e6a2409f78b5607f", "outfile": null, "outfile_hash": null, "stdout": "pass_where-where_03-00685f9.stdout", "stdout_hash": "76dbc09dc91b3003ca05db88418c379f4f43c7770bb1e9f1d6e83909", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-do4-f8e2956.stdout0000664000175000017500000000525315174404631022452 0ustar alastairalastair(TranslationUnit [(Program do4 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ()) (k [] [] () () None ())] () )] [(Assignment 0 j 0 () ) (DoLoop 0 () 15 i 1 5 () [(Assignment 0 j (+ j i) () ) (Continue 15 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 j 0 () ) (DoLoop 0 () 20 i 1 6 2 [(Assignment 0 j (+ j i) () ) (Continue 20 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 k 0 () ) (DoLoop 0 () 30 i 1 5 () [(DoLoop 0 () 35 j 1 5 () [(Assignment 0 k (+ k 1) () ) (Continue 31 () ) (Continue 35 () )] () () ) (Continue 33 () ) (Continue 30 () )] () () ) (Continue 40 () )] [] )] ) lfortran-0.63.0/tests/reference/asr-array_constructor_with_asterisk_in_type_spec-24efd03.json0000664000175000017500000000110015174404631032717 0ustar alastairalastair{ "basename": "asr-array_constructor_with_asterisk_in_type_spec-24efd03", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_constructor_with_asterisk_in_type_spec.f90", "infile_hash": "32cd88de1530bbe18208a1999a4a3eb975c5e679d7a5f417966d2507", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_constructor_with_asterisk_in_type_spec-24efd03.stderr", "stderr_hash": "a54c91b46642660539c1dc2e3abfad83c7c1b128c15b0bbcbec31518", "returncode": 2 }lfortran-0.63.0/tests/reference/run-format5-79b3b8f.json0000664000175000017500000000066215174404631023060 0ustar alastairalastair{ "basename": "run-format5-79b3b8f", "cmd": "lfortran --no-color {infile}", "infile": "tests/format5.f90", "infile_hash": "dfe2e9bd30c55ac5189bba5635ea01ad967e2729ac08c9e601cc6236", "outfile": null, "outfile_hash": null, "stdout": "run-format5-79b3b8f.stdout", "stdout_hash": "199447b2012d92e53ca72d105e8e6572d142454dff2dcbdd6e639c45", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_30-9f519b4.stdout0000664000175000017500000012320715174404631023727 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fpm_manifest_executable_modules_30: (Module (SymbolTable 7 { default_executable: (Function (SymbolTable 9 { 1_executable_config_main: (ExternalSymbol 9 1_executable_config_main 8 main executable_config [] main Public ), 1_executable_config_name: (ExternalSymbol 9 1_executable_config_name 8 name executable_config [] name Public ), 1_executable_config_source_dir: (ExternalSymbol 9 1_executable_config_source_dir 8 source_dir executable_config [] source_dir Public ), name: (Variable 9 name [] InOut () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 9 self [] Out () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 7 executable_config Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) default_executable (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 self) (Var 9 name)] [(Assignment (StructInstanceMember (Var 9 self) 9 1_executable_config_name (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 9 name) () .false. .false. ) (Assignment (StructInstanceMember (Var 9 self) 9 1_executable_config_source_dir (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (StringConstant "app" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 9 self) 9 1_executable_config_main (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (StringConstant "main.f90" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. )] () Public .true. .true. () ), executable_config: (Struct (SymbolTable 8 { main: (Variable 8 main [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), name: (Variable 8 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), source_dir: (Variable 8 source_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) executable_config (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [name source_dir main] [] Source Public .false. .false. [] () () [] ) }) fpm_manifest_executable_modules_30 () [] .true. .false. .false. ), fpm_manifest_modules_30: (Module (SymbolTable 2 { default_executable: (ExternalSymbol 2 default_executable 7 default_executable fpm_manifest_executable_modules_30 [] default_executable Public ), package_config_t: (ExternalSymbol 2 package_config_t 4 package_config_t fpm_manifest_package_modules_30 [] package_config_t Public ), package_defaults: (Function (SymbolTable 10 { 1_package_config_t_executable: (ExternalSymbol 10 1_package_config_t_executable 5 executable package_config_t [] executable Public ), 1_package_config_t_name: (ExternalSymbol 10 1_package_config_t_name 5 name package_config_t [] name Public ), package: (Variable 10 package [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .true. .false. ) 2 package_config_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), root: (Variable 10 root [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) package_defaults (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .true. .false. ) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 package) (Var 10 root)] [(Allocate [((StructInstanceMember (Var 10 package) 10 1_package_config_t_executable (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] () () ())] () () () ) (SubroutineCall 2 default_executable () [((ArrayItem (StructInstanceMember (Var 10 package) 10 1_package_config_t_executable (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () )) ((StructInstanceMember (Var 10 package) 10 1_package_config_t_name (Allocatable (String 1 () DeferredLength DescriptorString) ) () ))] () .false. )] () Public .true. .true. () ) }) fpm_manifest_modules_30 () [fpm_manifest_package_modules_30 fpm_manifest_executable_modules_30] .false. .false. .false. ), fpm_manifest_package_modules_30: (Module (SymbolTable 4 { executable_config: (ExternalSymbol 4 executable_config 7 executable_config fpm_manifest_executable_modules_30 [] executable_config Public ), package_config_t: (Struct (SymbolTable 5 { executable: (Variable 5 executable [] Local () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 4 executable_config Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), name: (Variable 5 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) package_config_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .true. .false. ) [] [name executable] [] Source Public .false. .false. [] () () [] ) }) fpm_manifest_package_modules_30 () [fpm_manifest_executable_modules_30] .true. .false. .false. ), modules_30: (Program (SymbolTable 11 { }) modules_30 [] [(Print (StringConstant "running modules_30 program" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-fmt1-c767956.json0000664000175000017500000000071415174404631022657 0ustar alastairalastair{ "basename": "ast_f90-fmt1-c767956", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/fmt1.f90", "infile_hash": "cc416a9bdea43f7844e35c44673a53dda17f3037acfc76ddef6f7c48", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-fmt1-c767956.stdout", "stdout_hash": "52971e2bba50a527abcf333d6f8b150a629a39dfac69b36c72587774", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-entry_05-f368f0e.json0000664000175000017500000000074215174404631023125 0ustar alastairalastair{ "basename": "asr-entry_05-f368f0e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/entry_05.f90", "infile_hash": "6ba013faf5b219ebe9941b538cdb0e7566fcd7389ab49f3e09971eeb", "outfile": null, "outfile_hash": null, "stdout": "asr-entry_05-f368f0e.stdout", "stdout_hash": "0bd6289396493dd82e4e4c0d14cfc1dd739e0b032a0dedb94b5dc664", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-mre_parameter-15f810f.json0000664000175000017500000000074215174404631024233 0ustar alastairalastair{ "basename": "run-mre_parameter-15f810f", "cmd": "lfortran --continue-compilation --no-color {infile}", "infile": "tests/errors/mre_parameter.f90", "infile_hash": "98f39f3110f80da2ce3dcae7c3d1a1bf53190249d4cb0d1f39f95e4e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-mre_parameter-15f810f.stderr", "stderr_hash": "01c4dff897b57fbb9191fb41026044183854c84d51c90c5b2231e15e", "returncode": 1 }lfortran-0.63.0/tests/reference/llvm-global_scope5-688b5a0.stdout0000664000175000017500000000153215174404631024646 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." @x = global i32 0 define i32 @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i32, align 4 %__lfortran_evaluate_12 = alloca i32, align 4 store i32 6, i32* @x, align 4 %0 = load i32, i32* @x, align 4 %1 = mul i32 2, %0 store i32 %1, i32* %__lfortran_evaluate_11, align 4 %2 = load i32, i32* @x, align 4 %3 = add i32 %2, 1 store i32 %3, i32* @x, align 4 %4 = load i32, i32* @x, align 4 %5 = mul i32 3, %4 store i32 %5, i32* %__lfortran_evaluate_12, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return %6 = load i32, i32* %__lfortran_evaluate_12, align 4 ret i32 %6 } lfortran-0.63.0/tests/reference/asr-nullify_02-1f0bd3a.json0000664000175000017500000000075015174404631023501 0ustar alastairalastair{ "basename": "asr-nullify_02-1f0bd3a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nullify_02.f90", "infile_hash": "8603bbfc07290d14f0828e12a8b04c3521c007c844a4c901b4bb7483", "outfile": null, "outfile_hash": null, "stdout": "asr-nullify_02-1f0bd3a.stdout", "stdout_hash": "0377356caa1e223a4d9b3c9a10c64fc73d6a68c520b71c52fbdf95be", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-min_01-aa661b0.json0000664000175000017500000000105115174404631022514 0ustar alastairalastair{ "basename": "asr-min_01-aa661b0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/min_01.f90", "infile_hash": "e952b62303ec12acafb074d8692d387259ce4ad18384b48667e9369f", "outfile": null, "outfile_hash": null, "stdout": "asr-min_01-aa661b0.stdout", "stdout_hash": "287d9a7eb1449c288ce0244da0fa86153ec06266ebb23813c60ae4a7", "stderr": "asr-min_01-aa661b0.stderr", "stderr_hash": "a02531d479d1f7f30892cce7008c18cfd36a995138e153c4e24dc068", "returncode": 0 }lfortran-0.63.0/tests/reference/pass_pass_array_by_data-modules_44-cd82150.stdout0000664000175000017500000006266215174404631030016 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_44: (Program (SymbolTable 9 { cmd_new: (ExternalSymbol 9 cmd_new 2 cmd_new modules_44_fpm_cmd_new [] cmd_new Public ), fpm_cmd_settings: (ExternalSymbol 9 fpm_cmd_settings 2 fpm_cmd_settings modules_44_fpm_cmd_new [] fpm_cmd_settings Public ), fpm_new_settings: (ExternalSymbol 9 fpm_new_settings 2 fpm_new_settings modules_44_fpm_cmd_new [] fpm_new_settings Public ), settings: (Variable 9 settings [] Local () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 9 fpm_new_settings Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) modules_44 [modules_44_fpm_cmd_new modules_44_module_fpm_filesystem] [(SubroutineCall 9 cmd_new () [((Var 9 settings))] () .false. )] ), modules_44_fpm_cmd_new: (Module (SymbolTable 2 { cmd_new: (Function (SymbolTable 8 { 1_fpm_new_settings_name: (ExternalSymbol 8 1_fpm_new_settings_name 7 name fpm_new_settings [] name Public ), littlefile: (Variable 8 littlefile [] Local () () Default (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), settings: (Variable 8 settings [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 fpm_new_settings Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cmd_new (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 settings)] [(Assignment (Var 8 littlefile) (ArrayConstant 160 ["# ", "My cool new project! "] (Array (String 1 (IntegerConstant 80 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] PointerArray ) ColMajor ) () .false. .false. ) (SubroutineCall 2 warnwrite_string____1 2 warnwrite_string____1 [((StructInstanceMember (Var 8 settings) 8 1_fpm_new_settings_name (Allocatable (String 1 () DeferredLength DescriptorString) ) () )) ((ArrayPhysicalCast (Var 8 littlefile) DescriptorArray PointerArray (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] PointerArray ) ) () )) ((ArraySize (Var 8 littlefile) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] () .false. )] () Public .true. .true. () ), fpm_cmd_settings: (Struct (SymbolTable 6 { working_dir: (Variable 6 working_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fpm_cmd_settings (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [working_dir] [] Source Public .false. .true. [] () () [] ), fpm_new_settings: (Struct (SymbolTable 7 { name: (Variable 7 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fpm_new_settings (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [name] [] Source Public .false. .false. [] () 2 fpm_cmd_settings [] ), warnwrite_string____1: (ExternalSymbol 2 warnwrite_string____1 4 warnwrite_string____1 modules_44_module_fpm_filesystem [] warnwrite_string____1 Public ) }) modules_44_fpm_cmd_new () [modules_44_module_fpm_filesystem] .false. .false. .false. ), modules_44_module_fpm_filesystem: (Module (SymbolTable 4 { warnwrite_string____1: (Function (SymbolTable 10 { __1data: (Variable 10 __1data [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), data: (Variable 10 data [__1data] In () () Default (Array (String 1 () AssumedLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (Var 10 __1data))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), fname: (Variable 10 fname [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) warnwrite_string____1 (FunctionType [(String 1 () AssumedLength DescriptorString) (Array (String 1 () AssumedLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray ) (Integer 4)] () Source Implementation "" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 fname) (Var 10 data) (Var 10 __1data)] [] () Public .false. .false. () ) }) modules_44_module_fpm_filesystem () [] .true. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_travel_01b-db46a56.json0000664000175000017500000000100315174404631025273 0ustar alastairalastair{ "basename": "asr-template_travel_01b-db46a56", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_travel_01b.f90", "infile_hash": "631939077e36e1bc6d2f3e96e19e4981f43579d944bacbb0fd542b69", "outfile": null, "outfile_hash": null, "stdout": "asr-template_travel_01b-db46a56.stdout", "stdout_hash": "1251b5accc5a4ac88a8a0d0159dc4bfe43cfbf29e505a9a434efd0a0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-functions_10-0449324.json0000664000175000017500000000075615174404631023545 0ustar alastairalastair{ "basename": "asr-functions_10-0449324", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_10.f90", "infile_hash": "fe4afd6d0a7065df5d59b482ad1bc0447df5303dc8246e85aa192fe0", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_10-0449324.stdout", "stdout_hash": "7145aa1341876f27610682f5be709b82af27d6c6faf627cdda87cb11", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-allocate_01-f3446f6.json0000664000175000017500000000075315174404631023467 0ustar alastairalastair{ "basename": "asr-allocate_01-f3446f6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/allocate_01.f90", "infile_hash": "1132bfc098d2bca743472b75141d3c99f1a387436ca5098352f0c757", "outfile": null, "outfile_hash": null, "stdout": "asr-allocate_01-f3446f6.stdout", "stdout_hash": "c513a075b2addeea341a9b91f3762d9ba4f5e8b360cad6514a275bc2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-do2-8eeb477.json0000664000175000017500000000072415174404631022152 0ustar alastairalastair{ "basename": "ast-do2-8eeb477", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/do2.f", "infile_hash": "004a5528e3fe66a7cc3f71ac1d14c359322161c682ed2d580f3de437", "outfile": null, "outfile_hash": null, "stdout": "ast-do2-8eeb477.stdout", "stdout_hash": "e20c32c7b24da96769d6bf8bf81ed2c7cffe6026f103cdbfe9c65e6c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-forallloop_01-d1e2bfa.json0000664000175000017500000000076115174404631024257 0ustar alastairalastair{ "basename": "ast-forallloop_01-d1e2bfa", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/forallloop_01.f90", "infile_hash": "d81387102a9ff31c123a828e4ead234d6971d67bca291dc5e40dc418", "outfile": null, "outfile_hash": null, "stdout": "ast-forallloop_01-d1e2bfa.stdout", "stdout_hash": "48cf8df7768c436b3f0e12b372d913c72075c901a90a83c2bc6fa213", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor2-1db2235.json0000664000175000017500000000077015174404631026437 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor2-1db2235", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor2.f90", "infile_hash": "0ad5c1e9977ab80f0d8872a378aa0927023ce0b47360bfedeea09364", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor2-1db2235.stdout", "stdout_hash": "722bb1529849e0e407452fc17cf930e258e907b1df18d87527b0c0ff", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-double_complex1-2f3d83c.json0000664000175000017500000000077015174404631024540 0ustar alastairalastair{ "basename": "ast-double_complex1-2f3d83c", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/double_complex1.f", "infile_hash": "67c79648ea8350e391b185e24698b65c09cdc201a298e72e7e59f992", "outfile": null, "outfile_hash": null, "stdout": "ast-double_complex1-2f3d83c.stdout", "stdout_hash": "7995ee30697dbb88bbc5b6b7f59a4a9c1606b126decbdcffe625af4c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-polymorphic_class_in_derived_type-15eb7b6.json0000664000175000017500000000103015174404631030424 0ustar alastairalastair{ "basename": "asr-polymorphic_class_in_derived_type-15eb7b6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/polymorphic_class_in_derived_type.f90", "infile_hash": "677dedbd26096d25f181bde9ec5de0e23794b2f2435c5ba79defa792", "outfile": null, "outfile_hash": null, "stdout": "asr-polymorphic_class_in_derived_type-15eb7b6.stdout", "stdout_hash": "da0e76dee8950ce0e062858ed7eb6af1bf885d498f52ed9441f6955b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-kind_01-6c675be.json0000664000175000017500000000072115174404631022702 0ustar alastairalastair{ "basename": "asr-kind_01-6c675be", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_01.f90", "infile_hash": "b5be2245f43395dd32e9fbc5f06c07ac6c70905e5b83bf65ca745c30", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_01-6c675be.stderr", "stderr_hash": "a4f46f313141003cd8a07b34744cfb6be4d780ac89b7bef22e149f74", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-global_scope1-786a363.json0000664000175000017500000000073415174404631024033 0ustar alastairalastair{ "basename": "asr-global_scope1-786a363", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope1.f90", "infile_hash": "449b38487b6c79754deedb9991f1867bcf8c67d0d93019c2fe15854c", "outfile": null, "outfile_hash": null, "stdout": "asr-global_scope1-786a363.stdout", "stdout_hash": "e9237c35773ba071ef9c793fd62a1b27e7dd34deb647e9a2314ce3f1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-do_concurrent_reduce3-9c6ccff.json0000664000175000017500000000076415174404631026106 0ustar alastairalastair{ "basename": "ast-do_concurrent_reduce3-9c6ccff", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do_concurrent_reduce3.f90", "infile_hash": "68244c7ec55a2abd3a98afa53cf637130918461cb0264902730a72b3", "outfile": null, "outfile_hash": null, "stdout": "ast-do_concurrent_reduce3-9c6ccff.stdout", "stdout_hash": "fedf187e13bfd5a66265908dbaf86807d3b5aaff55adbcfa82cf912c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-transfer_09-a440034.json0000664000175000017500000000075315174404631023434 0ustar alastairalastair{ "basename": "asr-transfer_09-a440034", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/transfer_09.f90", "infile_hash": "e76993559a0b5a14c872b6b2ee4229f7d830997c80a68a73a9a1ccad", "outfile": null, "outfile_hash": null, "stdout": "asr-transfer_09-a440034.stdout", "stdout_hash": "71e3ac33c34174c99368263a90dae8116bdb72585004cf83d8c3dfca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/c-expr_11-8e5ae80.stdout0000664000175000017500000000050615174404631022741 0ustar alastairalastair #include #include #include #include #include // Implementations int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); double x; x = ( 2.00000000000000000e+00*x + 1.00000000000000000e+00)/(x*(x + (double)(1))); return 0; } lfortran-0.63.0/tests/reference/asr-c_ptr_02-fce1b0e.json0000664000175000017500000000074215174404631023214 0ustar alastairalastair{ "basename": "asr-c_ptr_02-fce1b0e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/c_ptr_02.f90", "infile_hash": "b2f28a737ab24c02c4aa0fe0d88023004fbd708e506952f4c61b3211", "outfile": null, "outfile_hash": null, "stdout": "asr-c_ptr_02-fce1b0e.stdout", "stdout_hash": "c8201b82ae18e2e5d953320f951bc8f39c666673a4186823ae48086c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format6-f98f4d0.json0000664000175000017500000000066215174404631023061 0ustar alastairalastair{ "basename": "run-format6-f98f4d0", "cmd": "lfortran --no-color {infile}", "infile": "tests/format6.f90", "infile_hash": "45186df6d72a5fce9f892c48cdd3fe35ab0414b21dc36e8c2be45727", "outfile": null, "outfile_hash": null, "stdout": "run-format6-f98f4d0.stdout", "stdout_hash": "6933ced71c870e487ede5b388b933fbdfbf52c1e34fffd771dc611da", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-character2-bc7e2ce.stdout0000664000175000017500000001131115174404631024172 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { character2: (Program (SymbolTable 2 { char1: (Variable 2 char1 [] Local (StringConstant "Goat" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "Goat" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 4 (Integer 8) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), char2: (Variable 2 char2 [] Local () () Default (String 1 (IntegerConstant 4 (Integer 8) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), char_param: (Variable 2 char_param [] Local (StringConstant "App" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "App" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 3 (Integer 8) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) character2 [] [(Assignment (Var 2 char2) (StringConstant "Balle" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/c-expr_11-8e5ae80.stderr0000664000175000017500000000024215174404631022717 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/expr_11.f90:3:5 | 3 | real*8 x | ^^^^^^ help: write this as 'real(8)' lfortran-0.63.0/tests/reference/ast-do_concurrent2-80c03e1.json0000664000175000017500000000073715174404631024316 0ustar alastairalastair{ "basename": "ast-do_concurrent2-80c03e1", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do_concurrent2.f90", "infile_hash": "afe8788676d4b7be4b765236db5d9c60aa267325a08b714b35ba7eb6", "outfile": null, "outfile_hash": null, "stdout": "ast-do_concurrent2-80c03e1.stdout", "stdout_hash": "a70df883fcc6b8c546e8c45b808a98df215aba0e1c3d13042d58b833", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-bindc_06-1fdaca6.stdout0000664000175000017500000003426515174404631023550 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bindc_06: (Program (SymbolTable 13 { c_f_pointer: (ExternalSymbol 13 c_f_pointer 4 c_f_pointer lfortran_intrinsic_iso_c_binding [] c_f_pointer Public ), c_int: (ExternalSymbol 13 c_int 4 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_ptr: (ExternalSymbol 13 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), f_int4: (ExternalSymbol 13 f_int4 2 f_int4 bindc_06_mod [] f_int4 Public ), f_int8: (ExternalSymbol 13 f_int8 2 f_int8 bindc_06_mod [] f_int8 Public ), f_logical: (ExternalSymbol 13 f_logical 2 f_logical bindc_06_mod [] f_logical Public ), f_type_c_ptr: (ExternalSymbol 13 f_type_c_ptr 2 f_type_c_ptr bindc_06_mod [] f_type_c_ptr Public ), ptr_f_type_c_ptr: (Variable 13 ptr_f_type_c_ptr [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) bindc_06 [bindc_06_mod iso_c_binding] [(Print (StringFormat () [(StringConstant "f_int4: " (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 13 f_int4)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 13 f_int4) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(StringConstant "f_int8: " (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 13 f_int8)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 13 f_int8) NotEq (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 2 (Integer 8) Decimal) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(StringConstant "f_logical: " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 13 f_logical)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (LogicalBinOp (Var 13 f_logical) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (CPtrToPointer (Var 13 f_type_c_ptr) (Var 13 ptr_f_type_c_ptr) () () ) (Print (StringFormat () [(StringConstant "ptr_f_type_c_ptr: " (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 13 ptr_f_type_c_ptr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 13 ptr_f_type_c_ptr) NotEq (IntegerConstant 12 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), bindc_06_mod: (Module (SymbolTable 2 { c_ptr: (ExternalSymbol 2 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), f_int4: (Variable 2 f_int4 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. "c_int4" .false. .false. NotMethod () 0 ), f_int8: (Variable 2 f_int8 [] Local () () Default (Integer 8) () BindC Public Required .false. .false. .false. "c_int8" .false. .false. NotMethod () 0 ), f_logical: (Variable 2 f_logical [] Local () () Default (Logical 4) () BindC Public Required .false. .false. .false. "c_logical" .false. .false. NotMethod () 0 ), f_type_c_ptr: (Variable 2 f_type_c_ptr [] Local () () Default (CPtr) () BindC Public Required .false. .false. .false. "c_type_c_ptr" .false. .false. NotMethod () 0 ) }) bindc_06_mod () [iso_c_binding] .false. .false. .false. ), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding) }) [] ) lfortran-0.63.0/tests/reference/ast-string_03-fc56745.stdout0000664000175000017500000001070015174404631023560 0ustar alastairalastair(TranslationUnit [(Module string_03_mod (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeCharacter [(len 5 Value)] () () None ) [(SimpleAttribute AttrParameter )] [(intro [] [] () (String "I've " ()) Equal ())] () )] [] [] ) (Program string_03 () [(Use [] string_03_mod [(UseSymbol intro () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeCharacter [(len 8 Value)] () () None ) [] [(verb [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len 5 Value)] () () None ) [] [(posit [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len 4 Value)] () () None ) [] [(title [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len 7 Value)] () () None ) [] [(last_name [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len 29 Value)] () () None ) [] [(combined [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 verb (String "learned " ()) () ) (Assignment 0 posit (String "from " ()) () ) (Assignment 0 title (String "the " ()) () ) (Assignment 0 last_name (String "best" ()) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 combined (StrOp (StrOp (StrOp (StrOp (StrOp intro Concat verb ) Concat posit ) Concat title ) Concat last_name ) Concat (String "." ()) ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [combined] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/llvm-variables_03-4ba9d62.json0000664000175000017500000000076115174404631024112 0ustar alastairalastair{ "basename": "llvm-variables_03-4ba9d62", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/variables_03.f90", "infile_hash": "8d8aca80aa33efae3a67154a5d778388037b8ff8866bb59f1909be52", "outfile": null, "outfile_hash": null, "stdout": "llvm-variables_03-4ba9d62.stdout", "stdout_hash": "0398dacc81bfafd640e94d9963d430d47f185a697d84f00f38ac2787", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-variable1-8ec1519.stdout0000664000175000017500000005437215174404631023625 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { variable01: (Function (SymbolTable 2 { m: (Variable 2 m [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), matveca: (Function (SymbolTable 3 { matveca_arg_0: (Variable 3 matveca_arg_0 [] Unspecified () () Default (Array (Complex 4) [(() ())] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), matveca_arg_1: (Variable 3 matveca_arg_1 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), matveca_arg_2: (Variable 3 matveca_arg_2 [] Unspecified () () Default (Array (Complex 4) [(() ())] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), matveca_arg_3: (Variable 3 matveca_arg_3 [] Unspecified () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), matveca_arg_4: (Variable 3 matveca_arg_4 [] Unspecified () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), matveca_arg_5: (Variable 3 matveca_arg_5 [] Unspecified () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), matveca_arg_6: (Variable 3 matveca_arg_6 [] Unspecified () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) matveca (FunctionType [(Array (Complex 4) [(() ())] PointerArray ) (Integer 4) (Array (Complex 4) [(() ())] PointerArray ) (Complex 4) (Complex 4) (Complex 4) (Complex 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 matveca_arg_0) (Var 3 matveca_arg_1) (Var 3 matveca_arg_2) (Var 3 matveca_arg_3) (Var 3 matveca_arg_4) (Var 3 matveca_arg_5) (Var 3 matveca_arg_6)] [] () Public .false. .false. () ), n: (Variable 2 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p1: (Variable 2 p1 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p2: (Variable 2 p2 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p3: (Variable 2 p3 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p4: (Variable 2 p4 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [m] Local () () Default (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 m))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [n] Local () () Default (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) variable01 (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 m) (Var 2 n)] [(SubroutineCall 2 matveca () [((Var 2 x)) ((Var 2 m)) ((Var 2 y)) ((Var 2 p1)) ((Var 2 p2)) ((Var 2 p3)) ((Var 2 p4))] () .false. )] () Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/ast-flush1-09001c8.stdout0000664000175000017500000000140315174404631023053 0ustar alastairalastair(TranslationUnit [(Program flush1 (TriviaNode [(EndOfLine) (Comment "! Tests for syntax (AST only):" )] [] ) [] [] [] [(Flush 0 [10] [(IOSTAT n)] () ) (Flush 0 [20] [(IOMSG n)] () ) (Flush 0 [] [(ERR label)] () ) (Flush 0 [30] [(UNIT 40)] () ) (Flush 0 [50] [] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-subroutine5-e248afc.json0000664000175000017500000000072615174404631024021 0ustar alastairalastair{ "basename": "asr-subroutine5-e248afc", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/subroutine5.f90", "infile_hash": "88c62ffd8f005d7a511511e43da68f25e8fe795a75fec462baa25885", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutine5-e248afc.stdout", "stdout_hash": "74e7888da062465de492fc31d197720ba07c85f73c10273187e37a74", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-derived_type_06-2623a81.stderr0000664000175000017500000000027615174404631024650 0ustar alastairalastairsemantic error: The expression with derived types contains two or more arrays. --> tests/errors/derived_type_06.f90:14:5 | 14 | main_arr%arr_2%num = 22 | ^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-incorrect_number_args_function-1f6f6fa.json0000664000175000017500000000102615174404631030013 0ustar alastairalastair{ "basename": "asr-incorrect_number_args_function-1f6f6fa", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incorrect_number_args_function.f90", "infile_hash": "2ce169328c06c00519157a9d7abae8902aa7fa8d165958d8abe359f0", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incorrect_number_args_function-1f6f6fa.stderr", "stderr_hash": "80c5bdc2270b2db7e4e1ab8899c12c9c1352e1089d22984a21133c1c", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-preprocess_01-20f7efb.json0000664000175000017500000000107115174404631024213 0ustar alastairalastair{ "basename": "asr-preprocess_01-20f7efb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/warnings/preprocess_01.f90", "infile_hash": "8b0a43c23607be7c2557620c9ad10af23a6bcf0430bf1d5170b65303", "outfile": null, "outfile_hash": null, "stdout": "asr-preprocess_01-20f7efb.stdout", "stdout_hash": "a339c8cee0b9bfc659b6ceb6855167b02fed7a05bc732526ef2bde04", "stderr": "asr-preprocess_01-20f7efb.stderr", "stderr_hash": "add78f2a68b8c40d46c23122eeab18b258daae408143d3fb854b005d", "returncode": 0 }lfortran-0.63.0/tests/reference/ast-format_01-b8a6dbf.json0000664000175000017500000000074515174404631023410 0ustar alastairalastair{ "basename": "ast-format_01-b8a6dbf", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/format_01.f90", "infile_hash": "4cc04453f51b9adcf8108f25d26d048109fd69c30496888f6f560433", "outfile": null, "outfile_hash": null, "stdout": "ast-format_01-b8a6dbf.stdout", "stdout_hash": "985b7e32d6336a9c9632c673dcdb3545a977da8dabdf0ce724ca5023", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-expr9-ba35d31.stdout0000664000175000017500000000107015174404631023056 0ustar alastairalastair(TranslationUnit [(SubroutineCall 0 trigger [(ERROR_HANDLER [])] [] [(errors (DefUnaryOp "errors" rslt ))] [] () ) (DefUnaryOp "INVERSE" B ) (DefUnaryOp "INVERSE" (+ A B) ) (DefUnaryOp "anotherunary" 1 ) (DefUnaryOp "anotherunary" (+ 1 2) ) (DefUnaryOp "anotherunary" C ) (DefUnaryOp "anotherunary" (+ c d) )] ) lfortran-0.63.0/tests/reference/llvm-bindc1-345b88c.stdout0000664000175000017500000000135715174404631023300 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %p = alloca void*, align 8 %x = alloca i32*, align 8 store i32* null, i32** %x, align 8 %2 = load i32*, i32** %x, align 8 %3 = bitcast i32* %2 to void* store void* %3, void** %p, align 8 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_bindc1 FINALIZE_SYMTABLE_bindc1: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-array12-cb81afc.stdout0000664000175000017500000004654015174404631023446 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array12: (Module (SymbolTable 2 { c_associated: (ExternalSymbol 2 c_associated 4 c_associated lfortran_intrinsic_iso_c_binding [] c_associated Public ), c_char: (ExternalSymbol 2 c_char 4 c_char lfortran_intrinsic_iso_c_binding [] c_char Public ), c_int: (ExternalSymbol 2 c_int 4 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_ptr: (ExternalSymbol 2 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), get_current_directory: (Function (SymbolTable 14 { buffersize: (Variable 14 buffersize [] Local (IntegerConstant 1000 (Integer 4) Decimal) (IntegerConstant 1000 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), cpath: (Variable 14 cpath [] Local () () Default (Allocatable (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), path: (Variable 14 path [] Out () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 14 tmp [] Local () () Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_current_directory (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [getcwd] [(Var 14 path)] [(Allocate [((Var 14 cpath) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1000 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (Var 14 tmp) (FunctionCall 2 getcwd () [((ArrayPhysicalCast (Var 14 cpath) DescriptorArray StringArraySinglePointer (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] StringArraySinglePointer ) () )) ((Var 14 buffersize))] (CPtr) () () ) () .false. .false. ) (If () (PointerAssociated (Var 14 tmp) () (Logical 4) () ) [(Print (StringFormat () [(StringConstant "PWD: " (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 14 tmp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] () Public .false. .false. () ), getcwd: (Function (SymbolTable 13 { buf: (Variable 13 buf [] In () () Default (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength CChar) [(() ())] StringArraySinglePointer ) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), bufsize: (Variable 13 bufsize [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), path: (Variable 13 path [] ReturnVar () () Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) getcwd (FunctionType [(Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength CChar) [(() ())] StringArraySinglePointer ) (Integer 4)] (CPtr) BindC Interface "getcwd" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 buf) (Var 13 bufsize)] [] (Var 13 path) Public .false. .false. () ) }) array12 () [iso_c_binding array12] .false. .false. .false. ), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding) }) [] ) lfortran-0.63.0/tests/reference/llvm-doloop_02-9fcb598.stdout0000664000175000017500000003013515174404631024022 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc22 = alloca %string_descriptor, align 8 %stringFormat_desc10 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %__do_loop_end = alloca i32, align 4 %__do_loop_end1 = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 %i = alloca i32, align 4 %j = alloca i32, align 4 store i32 0, i32* %j, align 4 store i32 1, i32* %a, align 4 store i32 10, i32* %b, align 4 %3 = load i32, i32* %b, align 4 store i32 %3, i32* %__do_loop_end, align 4 %4 = load i32, i32* %a, align 4 %5 = sub i32 %4, 1 store i32 %5, i32* %i, align 4 br label %loop.head loop.head: ; preds = %loop.body, %.entry %6 = load i32, i32* %i, align 4 %7 = add i32 %6, 1 %8 = load i32, i32* %__do_loop_end, align 4 %9 = icmp sle i32 %7, %8 br i1 %9, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %10 = load i32, i32* %i, align 4 %11 = add i32 %10, 1 store i32 %11, i32* %i, align 4 %12 = load i32, i32* %j, align 4 %13 = load i32, i32* %i, align 4 %14 = add i32 %12, %13 store i32 %14, i32* %j, align 4 br label %loop.head loop.end: ; preds = %loop.head %15 = load i32, i32* %j, align 4 %16 = icmp ne i32 %15, 55 br i1 %16, label %then, label %else then: ; preds = %loop.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %loop.end br label %ifcont ifcont: ; preds = %else, %then %17 = alloca i64, align 8 %18 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %17, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %19 = load i64, i64* %17, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %18, i8** %20, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %19, i64* %21, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %23 = load i8*, i8** %22, align 8 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %25 = load i64, i64* %24, align 8 %26 = trunc i64 %25 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %23, i32 %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %27 = icmp eq i8* %18, null br i1 %27, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont call void @_lfortran_free_alloc(i8* %2, i8* %18) br label %free_done free_done: ; preds = %free_nonnull, %ifcont store i32 0, i32* %a, align 4 store i32 0, i32* %i, align 4 br label %loop.head1 loop.head1: ; preds = %loop.end5, %free_done %28 = load i32, i32* %i, align 4 %29 = add i32 %28, 1 %30 = icmp sle i32 %29, 10 br i1 %30, label %loop.body2, label %loop.end6 loop.body2: ; preds = %loop.head1 %31 = load i32, i32* %i, align 4 %32 = add i32 %31, 1 store i32 %32, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head3 loop.head3: ; preds = %loop.body4, %loop.body2 %33 = load i32, i32* %j, align 4 %34 = add i32 %33, 1 %35 = icmp sle i32 %34, 10 br i1 %35, label %loop.body4, label %loop.end5 loop.body4: ; preds = %loop.head3 %36 = load i32, i32* %j, align 4 %37 = add i32 %36, 1 store i32 %37, i32* %j, align 4 %38 = load i32, i32* %a, align 4 %39 = load i32, i32* %i, align 4 %40 = sub i32 %39, 1 %41 = mul i32 %40, 10 %42 = add i32 %38, %41 %43 = load i32, i32* %j, align 4 %44 = add i32 %42, %43 store i32 %44, i32* %a, align 4 br label %loop.head3 loop.end5: ; preds = %loop.head3 br label %loop.head1 loop.end6: ; preds = %loop.head1 %45 = load i32, i32* %a, align 4 %46 = icmp ne i32 %45, 5050 br i1 %46, label %then7, label %else8 then7: ; preds = %loop.end6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont9 else8: ; preds = %loop.end6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 %47 = alloca i64, align 8 %48 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %47, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %a) %49 = load i64, i64* %47, align 8 %50 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 store i8* %48, i8** %50, align 8 %51 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 store i64 %49, i64* %51, align 8 %52 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 %53 = load i8*, i8** %52, align 8 %54 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 %55 = load i64, i64* %54, align 8 %56 = trunc i64 %55 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %53, i32 %56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %57 = icmp eq i8* %48, null br i1 %57, label %free_done12, label %free_nonnull11 free_nonnull11: ; preds = %ifcont9 call void @_lfortran_free_alloc(i8* %2, i8* %48) br label %free_done12 free_done12: ; preds = %free_nonnull11, %ifcont9 store i32 0, i32* %a, align 4 store i32 0, i32* %i, align 4 br label %loop.head13 loop.head13: ; preds = %loop.end17, %free_done12 %58 = load i32, i32* %i, align 4 %59 = add i32 %58, 1 %60 = icmp sle i32 %59, 10 br i1 %60, label %loop.body14, label %loop.end18 loop.body14: ; preds = %loop.head13 %61 = load i32, i32* %i, align 4 %62 = add i32 %61, 1 store i32 %62, i32* %i, align 4 %63 = load i32, i32* %i, align 4 store i32 %63, i32* %__do_loop_end1, align 4 store i32 0, i32* %j, align 4 br label %loop.head15 loop.head15: ; preds = %loop.body16, %loop.body14 %64 = load i32, i32* %j, align 4 %65 = add i32 %64, 1 %66 = load i32, i32* %__do_loop_end1, align 4 %67 = icmp sle i32 %65, %66 br i1 %67, label %loop.body16, label %loop.end17 loop.body16: ; preds = %loop.head15 %68 = load i32, i32* %j, align 4 %69 = add i32 %68, 1 store i32 %69, i32* %j, align 4 %70 = load i32, i32* %a, align 4 %71 = load i32, i32* %j, align 4 %72 = add i32 %70, %71 store i32 %72, i32* %a, align 4 br label %loop.head15 loop.end17: ; preds = %loop.head15 br label %loop.head13 loop.end18: ; preds = %loop.head13 %73 = load i32, i32* %a, align 4 %74 = icmp ne i32 %73, 220 br i1 %74, label %then19, label %else20 then19: ; preds = %loop.end18 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont21 else20: ; preds = %loop.end18 br label %ifcont21 ifcont21: ; preds = %else20, %then19 %75 = alloca i64, align 8 %76 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %75, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %a) %77 = load i64, i64* %75, align 8 %78 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc22, i32 0, i32 0 store i8* %76, i8** %78, align 8 %79 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc22, i32 0, i32 1 store i64 %77, i64* %79, align 8 %80 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc22, i32 0, i32 0 %81 = load i8*, i8** %80, align 8 %82 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc22, i32 0, i32 1 %83 = load i64, i64* %82, align 8 %84 = trunc i64 %83 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %81, i32 %84, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %85 = icmp eq i8* %76, null br i1 %85, label %free_done24, label %free_nonnull23 free_nonnull23: ; preds = %ifcont21 call void @_lfortran_free_alloc(i8* %2, i8* %76) br label %free_done24 free_done24: ; preds = %free_nonnull23, %ifcont21 br label %return return: ; preds = %free_done24 br label %FINALIZE_SYMTABLE_doloop_02 FINALIZE_SYMTABLE_doloop_02: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) lfortran-0.63.0/tests/reference/ast-error_stop2-7d55ddf.stdout0000664000175000017500000000064615174404631024377 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [] [] [] [] [(If 0 () (Logical .true. ()) [(ErrorStop 0 () () () )] [] () () () )] [] [] )] ) lfortran-0.63.0/tests/reference/ast_f90-block1-f4e17ad.json0000664000175000017500000000072215174404631023363 0ustar alastairalastair{ "basename": "ast_f90-block1-f4e17ad", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/block1.f90", "infile_hash": "195aaf0b0ae556975d0d7c84d1ff451d793614e176384294a288b08c", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-block1-f4e17ad.stdout", "stdout_hash": "023d887b93d9b4e5408a600e5bc12cfd79b7d8d88960b4be25dc7a7b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-global_scope1-b0a630a.stdout0000664000175000017500000000014215174404631024675 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." @x = global i32 0 lfortran-0.63.0/tests/reference/pass_do_loops-loop_var_use_after_loop-e26183c.json0000664000175000017500000000106315174404631030355 0ustar alastairalastair{ "basename": "pass_do_loops-loop_var_use_after_loop-e26183c", "cmd": "lfortran --pass=do_loops --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/loop_var_use_after_loop.f90", "infile_hash": "7155c67c016a79ec0de4c65637bdec02203cd567e2d20a7676393d09", "outfile": null, "outfile_hash": null, "stdout": "pass_do_loops-loop_var_use_after_loop-e26183c.stdout", "stdout_hash": "edd658ce29ff24366b9eed1291618e2d482abb5c9bdbafc382778503", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixedform_assign_minimal-c4142fa.json0000664000175000017500000000101015174404631026467 0ustar alastairalastair{ "basename": "ast-fixedform_assign_minimal-c4142fa", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_assign_minimal.f", "infile_hash": "c859f6358c9852842503fc3e803177fd6c3f47e9c7cf4037bdf71919", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_assign_minimal-c4142fa.stdout", "stdout_hash": "d31667a5b1ec2ba542cc957c3644f3879fc650daf8ec7167cf6457e2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-common_04-b603709.stdout0000664000175000017500000006572715174404631023473 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { file_common_block_block_1: (Module (SymbolTable 3 { block_1: (Struct (SymbolTable 4 { a: (Variable 4 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 4 c [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) block_1 (StructType [] [] .true. .false. ) [] [a b c] [] Source Public .false. .false. [] () () [] ), struct_instance_block_1: (Variable 3 struct_instance_block_1 [] Local () () Default (StructType [] [] .true. .false. ) 3 block_1 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) file_common_block_block_1 () [] .false. .false. .false. ), main: (Program (SymbolTable 2 { 1_block_1_a: (ExternalSymbol 2 1_block_1_a 4 a block_1 [] a Public ), 1_block_1_b: (ExternalSymbol 2 1_block_1_b 4 b block_1 [] b Public ), 1_block_1_c: (ExternalSymbol 2 1_block_1_c 4 c block_1 [] c Public ), block_1: (ExternalSymbol 2 block_1 3 block_1 file_common_block_block_1 [] block_1 Public ), d: (Variable 2 d [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), struct_instance_block_1: (ExternalSymbol 2 struct_instance_block_1 3 struct_instance_block_1 file_common_block_block_1 [] struct_instance_block_1 Public ) }) main [] [(Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 d) (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) () .false. .false. ) (Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) (ArrayBroadcast (IntegerConstant 4 (Integer 4) Decimal) (ArrayConstant 4 [5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 20 [4, 4, 4, 4, 4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (If () (IntegerCompare (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 d) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Var 2 d)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-infer_first_assignment_conflict_01-a1c38bb.json0000664000175000017500000000104215174404631030437 0ustar alastairalastair{ "basename": "asr-infer_first_assignment_conflict_01-a1c38bb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/infer_first_assignment_conflict_01.f90", "infile_hash": "55571c5dde56eb57671e3a4a605a7f8951af2055b6117ca23ef90155", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-infer_first_assignment_conflict_01-a1c38bb.stderr", "stderr_hash": "9e612580f04066b3aa8d1a88fbe3560dde89fff0e4b321a48b906209", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-global_scope8-67fff8d.stdout0000664000175000017500000000146015174404631024641 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Var 1 x)] ) lfortran-0.63.0/tests/reference/pass_array_op-array15-079d0cd.stdout0000664000175000017500000000754615174404631025374 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array15: (Program (SymbolTable 2 { __libasr_index_0_: (Variable 2 __libasr_index_0_ [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) array15 [] [(DoLoop () ((Var 2 __libasr_index_0_) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Assignment (ArrayItem (Var 2 x) [(() (Var 2 __libasr_index_0_) ())] (Integer 4) ColMajor () ) (IntegerConstant 23 (Integer 4) Decimal) () .false. .false. )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-fixed_form_implicit_check-94844d9.stdout0000664000175000017500000000053315174404631027050 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { }) main [] [] ) }) [] ) lfortran-0.63.0/tests/reference/asr-intent_01-c1f267a.json0000664000175000017500000000074515174404631023254 0ustar alastairalastair{ "basename": "asr-intent_01-c1f267a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intent_01.f90", "infile_hash": "ecbce2d4b01a09bee24ec92ce8be335f75903e746d23a667806bf264", "outfile": null, "outfile_hash": null, "stdout": "asr-intent_01-c1f267a.stdout", "stdout_hash": "864606af42064fbc8bec6ff68d540ff8d5cfdeb0a20e57f19e4db68c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixed_form2-ad2afae.json0000664000175000017500000000074115174404631024067 0ustar alastairalastair{ "basename": "ast-fixed_form2-ad2afae", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form2.f", "infile_hash": "571cbfd198e5e5c217a11df963d0f4bda8786f94fc435927d45be679", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form2-ad2afae.stdout", "stdout_hash": "fb67dab9d7dcabe723b1c86b7fbb882257330ae5cd2f69ed9e73b683", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/lookup_name-lookup_name4-76fda17.json0000664000175000017500000000075415174404631025602 0ustar alastairalastair{ "basename": "lookup_name-lookup_name4-76fda17", "cmd": "lfortran --lookup-name --no-color {infile} -o {outfile}", "infile": "tests/lookup_name4.f90", "infile_hash": "4f94dd895f74a3603c2465f84044dc46c3156dbabcb01fbe69722e60", "outfile": null, "outfile_hash": null, "stdout": "lookup_name-lookup_name4-76fda17.stdout", "stdout_hash": "547f4cdcb68dbf0b977390e3ca98e359fb12dd3e018ddc10ef90db14", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_global_stmts-global_scope1-f174531.stdout0000664000175000017500000000124415174404631027325 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-expr7-b630493.json0000664000175000017500000000071715174404631023040 0ustar alastairalastair{ "basename": "ast_f90-expr7-b630493", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/expr7.f90", "infile_hash": "9b01fedf331316b08b35441cb9f4cb6f7808edd93b29c70e1caeea03", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-expr7-b630493.stdout", "stdout_hash": "6e75863362e53e9147fdfc66548bad38114442386f0d73f0a673409c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_01-3535389.json0000664000175000017500000000075015174404631023211 0ustar alastairalastair{ "basename": "asr-modules_01-3535389", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_01.f90", "infile_hash": "592921c14763dae70e205b1eaf8b9fd0b69df11eccc0a66d109e11b8", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_01-3535389.stdout", "stdout_hash": "a2d0a58174f3efdf8bb6aeecf43ececa36a10769642f182196bbb027", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_04-0d478be.json0000664000175000017500000000072315174404631023426 0ustar alastairalastair{ "basename": "asr-modules_04-0d478be", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/modules_04.f90", "infile_hash": "001166d3ec02d038539957e7b333b2f02902687e96980e325831c745", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_04-0d478be.stdout", "stdout_hash": "2dbb66e0186de1141c02b1428d0cd2f7014a656f1858b2c61c969922", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-incompatible_rank_assign-a69f7b4.stderr0000664000175000017500000000025315174404631027035 0ustar alastairalastairsemantic error: Incompatible ranks `0` and `1` in assignment --> tests/errors/incompatible_rank_assign.f90:2:1 | 2 | integer :: x = [1,2,3] | ^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-intrinsics_23-db1ffb5.stdout0000664000175000017500000002406715174404631024660 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_23: (Program (SymbolTable 2 { i32: (Variable 2 i32 [] Local (TypeInquiry Huge (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) (IntegerConstant 2147483647 (Integer 4) Decimal) ) (IntegerConstant 2147483647 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i64: (Variable 2 i64 [] Local (TypeInquiry Huge (Integer 8) (IntegerConstant 0 (Integer 8) Decimal) (Integer 8) (IntegerConstant 9223372036854775807 (Integer 8) Decimal) ) (IntegerConstant 9223372036854775807 (Integer 8) Decimal) Parameter (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local (TypeInquiry Huge (Real 4) (RealConstant 0.000000 (Real 4) ) (Real 4) (RealConstant 340282346638528859811704183484516925440.000000 (Real 4) ) ) (RealConstant 340282346638528859811704183484516925440.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local (TypeInquiry Huge (Real 8) (RealConstant 0.000000 (Real 8) ) (Real 8) (RealConstant 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (Real 8) ) ) (RealConstant 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (Real 8) ) Parameter (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_23 [] [(Print (StringFormat () [(Var 2 i32) (Var 2 i64) (Var 2 y) (Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(TypeInquiry Huge (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) (IntegerConstant 2147483647 (Integer 4) Decimal) ) (TypeInquiry Huge (Integer 8) (IntegerConstant 0 (Integer 8) Decimal) (Integer 8) (IntegerConstant 9223372036854775807 (Integer 8) Decimal) ) (TypeInquiry Huge (Real 4) (RealConstant 0.000000 (Real 4) ) (Real 4) (RealConstant 340282346638528859811704183484516925440.000000 (Real 4) ) ) (TypeInquiry Huge (Real 8) (RealConstant 0.000000 (Real 8) ) (Real 8) (RealConstant 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (Real 8) ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-associate1-6e54e23.stdout0000664000175000017500000000026415174404631024460 0ustar alastairalastairassociate (x => y) end associate associate (x => (y)) end associate associate (x => y + z) end associate associate (x => -y) end associate call some_subroutine(x, (x)) x = f((x)) lfortran-0.63.0/tests/reference/asr-entry2-a9679e0.stdout0000664000175000017500000001564715174404631023211 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { prin: (Function (SymbolTable 3 { }) prin (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [prini_main__lcompilers] [] [(SubroutineCall 1 prini_main__lcompilers 1 prini_main__lcompilers [((IntegerConstant 2 (Integer 4) Decimal))] () .false. )] () Public .true. .true. () ), prini: (Function (SymbolTable 2 { }) prini (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [prini_main__lcompilers] [] [(SubroutineCall 1 prini_main__lcompilers 1 prini_main__lcompilers [((IntegerConstant 1 (Integer 4) Decimal))] () .false. )] () Public .true. .true. () ), prini_main__lcompilers: (Function (SymbolTable 4 { entry__lcompilers: (Variable 4 entry__lcompilers [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), messpr: (Function (SymbolTable 5 { }) messpr (FunctionType [] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ) }) prini_main__lcompilers (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 entry__lcompilers)] [(If () (IntegerCompare (Var 4 entry__lcompilers) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 1 1 )] [] ) (If () (IntegerCompare (Var 4 entry__lcompilers) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 2 2 )] [] ) (GoToTarget 1 1 ) (Return) (GoToTarget 2 2 ) (SubroutineCall 4 messpr () [] () .false. ) (Return)] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/run-mre_parameter-15f810f.stderr0000664000175000017500000000065415174404631024567 0ustar alastairalastairsemantic error: arguments of `repeat` intrinsic must be scalar --> tests/errors/mre_parameter.f90:3:38 | 3 | character(3), parameter :: ar1 = repeat(["abc", "#^1", "123"], [1, 2, 3]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Variable 'ar1' is not declared --> tests/errors/mre_parameter.f90:4:14 | 4 | print *, ar1 | ^^^ 'ar1' is undeclared lfortran-0.63.0/tests/reference/llvm-real_dp_01-e53c6fb.json0000664000175000017500000000075315174404631023631 0ustar alastairalastair{ "basename": "llvm-real_dp_01-e53c6fb", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/real_dp_01.f90", "infile_hash": "96dcdc6844b049f189b110b997c4e4f840afa6ff1cd1da7e03f80d79", "outfile": null, "outfile_hash": null, "stdout": "llvm-real_dp_01-e53c6fb.stdout", "stdout_hash": "4bb7f5b8d1af1e7d61aa4c5b021977f25eaf14af5b4f226c1a82d3ce", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-test_backspace_01-cd469a1.stdout0000664000175000017500000003022115174404631025271 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { test_backspace_01: (Program (SymbolTable 2 { lfortran_iomsg: (Variable 2 lfortran_iomsg [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lfortran_iomsg1: (Variable 2 lfortran_iomsg1 [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lfortran_iomsg2: (Variable 2 lfortran_iomsg2 [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), line: (Variable 2 line [] Local () () Default (String 1 (IntegerConstant 80 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u: (Variable 2 u [] Local (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_backspace_01 [] [(FileOpen 0 (IntegerConstant 10 (Integer 4) Decimal) (StringConstant "file_01_data.txt" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "old" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () () () (StringConstant "read" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () () () () () () () () ) (FileRead 0 (Var 2 u) (StringConstant "(A)" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () () () () () [(Var 2 line)] () .true. () () () ) (FileWrite 0 (IntegerConstant 6 (Integer 4) Decimal) (Var 2 lfortran_iomsg) () () [(StringFormat (StringConstant "(A)" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(Var 2 line)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () () ) (FileBackspace 0 (Var 2 u) () () ) (FileRead 0 (Var 2 u) (StringConstant "(A)" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () () () () () [(Var 2 line)] () .true. () () () ) (FileWrite 0 (IntegerConstant 6 (Integer 4) Decimal) (Var 2 lfortran_iomsg1) () () [(StringFormat (StringConstant "(A)" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(StringConstant "Read and printed the same line again:" (String 1 (IntegerConstant 37 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () () ) (FileWrite 0 (IntegerConstant 6 (Integer 4) Decimal) (Var 2 lfortran_iomsg2) () () [(StringFormat (StringConstant "(A)" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(Var 2 line)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () () ) (If () (StringCompare (Var 2 line) NotEq (StringConstant "10130" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (FileClose 0 (Var 2 u) () () () () )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-int_01-72c2ff1.json0000664000175000017500000000073415174404631022544 0ustar alastairalastair{ "basename": "asr-int_01-72c2ff1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/int_01.f90", "infile_hash": "766d63f0b9cf518eb398acd6ceff8d8856637959cc0bf1890b03c89d", "outfile": null, "outfile_hash": null, "stdout": "asr-int_01-72c2ff1.stdout", "stdout_hash": "c8a9c64dff0542bf2dee31711f98aadb1c2c90ee29972238f722ceee", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-array_bounds_check_01-713dbcf.json0000664000175000017500000000074315174404631025675 0ustar alastairalastair{ "basename": "run-array_bounds_check_01-713dbcf", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_01.f90", "infile_hash": "e8570ec720776191802ff5d4d5cd6944a6b2e8730e5bf1bd8458dd83", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_01-713dbcf.stderr", "stderr_hash": "44dd938dd4e8e9ca17d3adcdafffb7e917336578424394a5196943c2", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-matrix_matmul_03-a99cdd1.json0000664000175000017500000000075415174404631024725 0ustar alastairalastair{ "basename": "asr-matrix_matmul_03-a99cdd1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/matrix_matmul_03.f90", "infile_hash": "0127d8b9682c6b1a587f586c811d7be9bd222c3459ce7916cdaa2f5e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-matrix_matmul_03-a99cdd1.stderr", "stderr_hash": "aa44194b2036aaa6754d00830b01c3e137396032ae25b19a86275e2b", "returncode": 2 }lfortran-0.63.0/tests/reference/cpp-program3-7ea69db.json0000664000175000017500000000070015174404631023261 0ustar alastairalastair{ "basename": "cpp-program3-7ea69db", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/program3.f90", "infile_hash": "f5e4a3f2a2a6f406171d0aa3895b5d7342c4d87b73ffede073827f34", "outfile": null, "outfile_hash": null, "stdout": "cpp-program3-7ea69db.stdout", "stdout_hash": "c8b8c040cfc07de1aadf3edbe34874ccf76b0eac3f663741f1adab33", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-types_13-76138b5.stdout0000664000175000017500000006037515174404631023350 0ustar alastairalastair(TranslationUnit [(Program types_13 () [(Use [] iso_c_binding [(UseSymbol c_int () ) (UseSymbol c_double () ) (UseSymbol c_char () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Interface (InterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceProc (Subroutine g [(d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeCharacter [] () () DoubleAsterisk ) [] [(d [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Subroutine g2 [(d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeCharacter [(len () Star)] () () None ) [] [(d [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Subroutine g3 [(d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [c_char] ImportDefault () )] [] [(Declaration (AttrType TypeCharacter [(len () Star) (kind c_char Value)] () () None ) [] [(d [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Subroutine g4 [(d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [c_char] ImportDefault () )] [] [(Declaration (AttrType TypeCharacter [(() () Star) (kind c_char Value)] () () None ) [] [(d [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Subroutine g5 [(d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [c_char] ImportDefault () )] [] [(Declaration (AttrType TypeCharacter [(kind c_char Value) (len () Star)] () () None ) [] [(d [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Subroutine g6 [(d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeCharacter [(() 5 Value)] () () None ) [] [(d [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Function f1 [(a) (b) (c) (d)] [(AttrType TypeInteger [(() c_int Value)] () () None )] r (Bind [c] [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [c_int c_double] ImportDefault () )] [] [(Declaration (AttrType TypeInteger [(() 4 Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() 8 Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [(() 4 Value)] () () None ) [] [(c [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Function f2 [(a) (b) (c) (d)] [(AttrType TypeInteger [(() c_int Value)] () () None )] r (Bind [c] [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [c_int c_double] ImportDefault () )] [] [(Declaration (AttrType TypeInteger [(() 4 Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() 8 Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [(() 4 Value)] () () None ) [] [(c [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Function f3 [(a) (b) (c) (d)] [] r (Bind [c] [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [c_int c_double] ImportDefault () )] [] [(Declaration (AttrType TypeInteger [(() c_int Value)] () () None ) [] [(r [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [(() 4 Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() 8 Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [(() 4 Value)] () () None ) [] [(c [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Function f4 [(a) (b) (c) (d)] [] r (Bind [c] [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [c_int c_double] ImportDefault () )] [] [(Declaration (AttrType TypeInteger [(() c_int Value)] () () None ) [] [(r [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [(() 4 Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() 8 Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [(() 4 Value)] () () None ) [] [(c [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Subroutine f5 [(a) (b) (c)] [] (Bind [C] [(name (String "_cf5" ()))] ) () [] [(Import [c_int] ImportDefault () ) (Import [c_double] ImportDefault () )] [] [(Declaration (AttrType TypeInteger [(() c_int Value)] () () None ) [] [(r [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [(() c_int Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() c_double Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [] [(c [] [] () () None ())] () )] [] [] [] ) )] )] [] [] )] ) lfortran-0.63.0/tests/reference/ast_f90-doloop_04-c0ab107.stdout0000664000175000017500000000135615174404631024266 0ustar alastairalastairprogram doloop_04 implicit none integer :: i, j, k j = 0 k = 2 do i = 1, 10, k j = j + i end do if (j /= 25) then error stop end if print *, j j = 0 k = -2 do i = 10, 1, k j = j + i end do if (j /= 30) then error stop end if print *, j j = 0 a: do i = 1, 10 j = j + i if (i == 2) then exit a end if end do a if (j /= 3) then error stop end if j = 0 b: do i = 1, 10, 2 j = j + i if (i == 3) then exit b end if end do b if (j /= 4) then error stop end if j = 0 i = 1 c: do j = j + i if (i == 2) then exit c end if i = i + 1 end do c if (j /= 3) then error stop end if !test-issue 746 k = 2 do i = 1, 10, k 100 continue end do end program doloop_04 lfortran-0.63.0/tests/reference/llvm-class_04-290b898.json0000664000175000017500000000074515174404631023124 0ustar alastairalastair{ "basename": "llvm-class_04-290b898", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/class_04.f90", "infile_hash": "0ddf2718f32dd9cfea8c4f4c9c384902ac023b5792e9fc8ec4a7648f", "outfile": null, "outfile_hash": null, "stdout": "llvm-class_04-290b898.stdout", "stdout_hash": "913044b2e897c2360cba8706bea105d2f71c70c34239a22ecc22ba0c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_26-f10d0e6.json0000664000175000017500000000076115174404631024141 0ustar alastairalastair{ "basename": "asr-intrinsics_26-f10d0e6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_26.f90", "infile_hash": "6f188062412b32185ec5b7c5db08e46b54f4d9614541bc7e7c7ae271", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_26-f10d0e6.stdout", "stdout_hash": "3407bdda964c6bc0e7c321a1b95a6a6fbfed83fb379f5a25393f9f3e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-polymorphic_arguments_02-bb6f3e2.stdout0000664000175000017500000005717615174404631027051 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { polymorphic_argument_02: (Program (SymbolTable 2 { c_value: (Variable 2 c_value [] Local (StringConstant "c" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "c" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i_value: (Variable 2 i_value [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l_value: (Variable 2 l_value [] Local (LogicalConstant .true. (Logical 4) ) (LogicalConstant .true. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r_value: (Variable 2 r_value [] Local (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) (RealConstant 1.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), str: (GenericProcedure 2 str [2 str_scalar] Public ), str_scalar: (Function (SymbolTable 3 { g1: (Variable 3 g1 [] In () () Default (StructType [] [] .false. .true. ) 3 ~unlimited_polymorphic_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), str_scalar: (Variable 3 str_scalar [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~unlimited_polymorphic_type: (Struct (SymbolTable 4 { }) ~unlimited_polymorphic_type (StructType [] [] .false. .true. ) [] [] [] Source Public .false. .true. [] () () [] ) }) str_scalar (FunctionType [(StructType [] [] .false. .true. )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 g1)] [(Assignment (Var 3 str_scalar) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 3 str_scalar) Public .true. .true. () ) }) polymorphic_argument_02 [] [(Print (StringFormat () [(FunctionCall 2 str_scalar 2 str [((Var 2 i_value))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (FunctionCall 2 str_scalar 2 str [((Var 2 i_value))] (Integer 4) () () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(FunctionCall 2 str_scalar 2 str [((Var 2 r_value))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (FunctionCall 2 str_scalar 2 str [((Var 2 r_value))] (Integer 4) () () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(FunctionCall 2 str_scalar 2 str [((Var 2 c_value))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (FunctionCall 2 str_scalar 2 str [((Var 2 c_value))] (Integer 4) () () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(FunctionCall 2 str_scalar 2 str [((Var 2 l_value))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (FunctionCall 2 str_scalar 2 str [((Var 2 l_value))] (Integer 4) () () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(FunctionCall 2 str_scalar () [((Var 2 i_value))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (FunctionCall 2 str_scalar () [((Var 2 i_value))] (Integer 4) () () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(FunctionCall 2 str_scalar () [((Var 2 r_value))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (FunctionCall 2 str_scalar () [((Var 2 r_value))] (Integer 4) () () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(FunctionCall 2 str_scalar () [((Var 2 c_value))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (FunctionCall 2 str_scalar () [((Var 2 c_value))] (Integer 4) () () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(FunctionCall 2 str_scalar () [((Var 2 l_value))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (FunctionCall 2 str_scalar () [((Var 2 l_value))] (Integer 4) () () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-optional_argument_subroutine_in_type-0d81d24.stdout0000664000175000017500000002275315174404631031501 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 5 { 1_test_type_test_subroutine: (ExternalSymbol 5 1_test_type_test_subroutine 3 test_subroutine test_type [] test_subroutine Public ), test_subroutine: (ExternalSymbol 5 test_subroutine 2 test_subroutine test_module [] test_subroutine Public ), test_type: (ExternalSymbol 5 test_type 2 test_type test_module [] test_type Public ), test_type_instance: (Variable 5 test_type_instance [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 5 test_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main [test_module] [(SubroutineCall 5 1_test_type_test_subroutine () [(())] (Var 5 test_type_instance) .false. )] ), test_module: (Module (SymbolTable 2 { test_subroutine: (Function (SymbolTable 4 { x: (Variable 4 x [] In () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_subroutine (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 x)] [(Print (StringConstant "Hello World" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), test_type: (Struct (SymbolTable 3 { test_real_value: (Variable 3 test_real_value [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), test_subroutine: (StructMethodDeclaration 3 test_subroutine () test_subroutine 2 test_subroutine Source .false. .true. ) }) test_type (StructType [(Real 4)] [] .true. .false. ) [] [test_real_value] [] Source Public .false. .false. [] () () [] ) }) test_module () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-subroutine6-a3aec97.json0000664000175000017500000000072615174404631024024 0ustar alastairalastair{ "basename": "ast-subroutine6-a3aec97", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine6.f90", "infile_hash": "1987bc648e7f4c6205190248a296d000e0f33cb57a996b6c2a6c4804", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine6-a3aec97.stdout", "stdout_hash": "4bece425307001572b06c85fe216838cc52f068a64ee07628af1c68c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-execute_command_line-0e9cd63.stdout0000664000175000017500000000615615174404631026366 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @string_const_data = private constant [18 x i8] c"echo \22Hello World\22" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([18 x i8], [18 x i8]* @string_const_data, i32 0, i32 0), i64 18 }> @string_const_data.1 = private constant [2 x i8] c"ls" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([2 x i8], [2 x i8]* @string_const_data.1, i32 0, i32 0), i64 2 }> define void @_lcompilers_execute_command_line_(%string_descriptor* %command, i32* %wait) { .entry: %_lcompilers_exit_status = alloca i32, align 4 %0 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 0 %1 = load i8*, i8** %0, align 8 %2 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 0 %3 = load i8*, i8** %2, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 1 %5 = load i64, i64* %4, align 8 %6 = trunc i64 %5 to i32 %7 = call i32 @_lfortran_exec_command(i8* %3, i32 %6) store i32 %7, i32* %_lcompilers_exit_status, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE__lcompilers_execute_command_line_ FINALIZE_SYMTABLE__lcompilers_execute_command_line_: ; preds = %return ret void } declare i32 @_lfortran_exec_command(i8*, i32) define void @_lcompilers_execute_command_line_1(%string_descriptor* %command, i32* %wait) { .entry: %_lcompilers_exit_status = alloca i32, align 4 %0 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 0 %1 = load i8*, i8** %0, align 8 %2 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 0 %3 = load i8*, i8** %2, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 1 %5 = load i64, i64* %4, align 8 %6 = trunc i64 %5 to i32 %7 = call i32 @_lfortran_exec_command(i8* %3, i32 %6) store i32 %7, i32* %_lcompilers_exit_status, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE__lcompilers_execute_command_line_1 FINALIZE_SYMTABLE__lcompilers_execute_command_line_1: ; preds = %return ret void } define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store i32 1, i32* %call_arg_value, align 4 call void @_lcompilers_execute_command_line_(%string_descriptor* @string_const, i32* %call_arg_value) store i32 1, i32* %call_arg_value, align 4 call void @_lcompilers_execute_command_line_1(%string_descriptor* @string_const.2, i32* %call_arg_value) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_execute_command_line FINALIZE_SYMTABLE_execute_command_line: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/ast_f90-do_concurrent2-9ec99ee.json0000664000175000017500000000075215174404631025162 0ustar alastairalastair{ "basename": "ast_f90-do_concurrent2-9ec99ee", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/do_concurrent2.f90", "infile_hash": "afe8788676d4b7be4b765236db5d9c60aa267325a08b714b35ba7eb6", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-do_concurrent2-9ec99ee.stdout", "stdout_hash": "d18cfdaa93af3c0230f5f79dcf10d429f0f0b3ac12c1af98c050ff2f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixed_form_line_limit-0a3f0f0.json0000664000175000017500000000077715174404631025777 0ustar alastairalastair{ "basename": "ast-fixed_form_line_limit-0a3f0f0", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_line_limit.f", "infile_hash": "474de788602ebc9fe11f04fe1962c667fa1ae3261c04710af3358dc9", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_line_limit-0a3f0f0.stdout", "stdout_hash": "98d3ac76ca5cd9f5bc59f2fe37b490c60bade2b2284d51dece724258", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-statement_01-00eefc8.stdout0000664000175000017500000001740215174404631024407 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { alnorm: (Function (SymbolTable 2 { alnorm: (Variable 2 alnorm [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zexp: (Function (SymbolTable 4 { z: (Variable 4 z [] In () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zexp_return_var_name: (Variable 4 zexp_return_var_name [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) zexp (FunctionType [(Real 8)] (Real 8) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 z)] [(Assignment (Var 4 zexp_return_var_name) (IntrinsicElementalFunction Exp [(Var 4 z)] 0 (Real 8) () ) () .false. .false. )] (Var 4 zexp_return_var_name) Public .false. .true. () ) }) alnorm (FunctionType [] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Return)] (Var 2 alnorm) Public .true. .true. () ), statement_01: (Program (SymbolTable 3 { }) statement_01 [] [] ) }) [] ) lfortran-0.63.0/tests/reference/asr-do_concurrent1-74bde45.stderr0000664000175000017500000000032415174404631024730 0ustar alastairalastairsemantic error: Do concurrent loop variable `j` cannot be part of local expression --> tests/errors/do_concurrent1.f90:5:26 | 5 | do concurrent (j = 1:Ny) local(i, j) | ^^^^^^^^^^^ lfortran-0.63.0/tests/reference/run-array_bounds_check_05-d584fab.stderr0000664000175000017500000000047315174404631026237 0ustar alastairalastairruntime error: Array shape mismatch in subroutine 'my'. Tried to match size 3 of dimension 1 of argument number 1, but expected size is 5 --> tests/errors/array_bounds_check_05.f90:7:13 | 7 | call my(x, 5) | ^ | 7 | call my(x, 5) | ~ Parameter is size 5, argument is size 3 lfortran-0.63.0/tests/reference/asr-maskr_incorrect_bit_size-0d2cb26.stderr0000664000175000017500000000032315174404631027043 0ustar alastairalastairsemantic error: first argument of `maskr` must be less than or equal to the BIT_SIZE of INTEGER(KIND=4) --> tests/errors/maskr_incorrect_bit_size.f90:2:12 | 2 | print*, maskr(63) | ^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-matrix_transpose_01-f8038ce.stderr0000664000175000017500000000031115174404631025703 0ustar alastairalastairsemantic error: `transpose` accepts arrays of rank 2 only, provided an array with rank, 1 --> tests/errors/matrix_transpose_01.f90:4:24 | 4 | print *, transpose(a) | ^ lfortran-0.63.0/tests/reference/asr-bin_op_complex_dp-26e149c.json0000664000175000017500000000077515174404631025062 0ustar alastairalastair{ "basename": "asr-bin_op_complex_dp-26e149c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bin_op_complex_dp.f90", "infile_hash": "9be1b396941b73e1466a46963ee3ade085440ce077b444ce7e2f6baf", "outfile": null, "outfile_hash": null, "stdout": "asr-bin_op_complex_dp-26e149c.stdout", "stdout_hash": "2d7292e75c0f3715049767c1ff2c392d0899fc61e739d5014fab8927", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-cmplx_03-6426707.stdout0000664000175000017500000000054315174404631023233 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cmplx_03: (Program (SymbolTable 2 { }) cmplx_03 [] [] ) }) [] ) lfortran-0.63.0/tests/reference/asr-matrix_matmul_06-d802f54.stderr0000664000175000017500000000032215174404631025107 0ustar alastairalastairsemantic error: The argument `matrix_b` in `matmul` must be of rank 2, provided an array with rank, 1 --> tests/errors/matrix_matmul_06.f90:5:24 | 5 | print *, matmul(a, b) | ^ lfortran-0.63.0/tests/reference/asr-where_03-a34eed8.json0000664000175000017500000000074215174404631023150 0ustar alastairalastair{ "basename": "asr-where_03-a34eed8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/where_03.f90", "infile_hash": "987afee1a50b146dbe0bb5ebb0052fdc3bcef478e6a2409f78b5607f", "outfile": null, "outfile_hash": null, "stdout": "asr-where_03-a34eed8.stdout", "stdout_hash": "b9c32146cfbc9fb7e2cc68498eb300d1d6c227e1a65e5be4b407eadb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-intrinsics_03-0771f1b.json0000664000175000017500000000076415174404631024246 0ustar alastairalastair{ "basename": "llvm-intrinsics_03-0771f1b", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_03.f90", "infile_hash": "e7fb61db3237594018e226a4236884f778bd41ae0848c5667da97462", "outfile": null, "outfile_hash": null, "stdout": "llvm-intrinsics_03-0771f1b.stdout", "stdout_hash": "c0a691677b320e98077e06350f60195b3f721682b801200f1ce1a86c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixed_form_3-53e9045.stderr0000664000175000017500000000020715174404631024211 0ustar alastairalastairsyntax error: Newline is unexpected here --> tests/errors/fixed_form_3.f:4:21 | 4 | 500 print *, sin(y | ^ lfortran-0.63.0/tests/reference/asr-intrinsics_35-10733ec.json0000664000175000017500000000076115174404631024061 0ustar alastairalastair{ "basename": "asr-intrinsics_35-10733ec", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_35.f90", "infile_hash": "e79df62a924c1199bf5e17b5ca059ae5ee9598aa94091ab14f6c083b", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_35-10733ec.stdout", "stdout_hash": "41a9014b3abf95a46f190a07bb1e92d5a389963f4abd5fcc5da8b81c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-types_03-e07ce23.stdout0000664000175000017500000001652015174404631023475 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (type (;4;) (func (param f64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 f32) f32.const 1.500000 local.set 1 local.get 1 f64.promote_f32 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 1 i32.trunc_f32_s local.set 0 local.get 0 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (func $4 (type 4) (param f64) (result) (local i64 i64 i64) local.get 0 f64.const 0.000000 f64.lt if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 f64.const -1.000000 f64.mul local.set 0 else end local.get 0 i64.trunc_f64_s call 3 i32.const 1 i32.const 40 i32.const 1 i32.const 0 call 1 drop local.get 0 local.get 0 i64.trunc_f64_s f64.convert_i64_s f64.sub f64.const 100000000.000000 f64.mul i64.trunc_f64_s local.set 2 local.get 2 local.set 3 i64.const 0 local.set 1 loop local.get 2 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 2 f64.convert_i64_s i64.const 10 f64.convert_i64_s f64.div i64.trunc_f64_s local.set 2 br 1 else end end loop local.get 1 i64.const 8 i64.lt_s if local.get 1 i64.const 1 i64.add local.set 1 i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop br 1 else end end local.get 3 call 3 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (export "print_f64" (func 4)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-0.63.0/tests/reference/run-array_bounds_check_15-9f619ed.json0000664000175000017500000000074315174404631025640 0ustar alastairalastair{ "basename": "run-array_bounds_check_15-9f619ed", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_15.f90", "infile_hash": "ae2dee1b53ed7b6e4496aca841d2401fbe69cfcc430f41676ed79607", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_15-9f619ed.stderr", "stderr_hash": "dc92d6b24db94a526144ec328182f49a021bad016b3d41e26e2cb196", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-parameter_03-d4df941.stdout0000664000175000017500000000427715174404631024320 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { parameter_03: (Program (SymbolTable 2 { l_knd: (Variable 2 l_knd [] Local (TypeInquiry Kind (Logical 4) (LogicalConstant .true. (Logical 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) parameter_03 [] [(Print (StringFormat () [(Var 2 l_knd)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/wat-if_04-1d3b97a.stderr0000664000175000017500000000023715174404631022711 0ustar alastairalastairstyle suggestion: Use 'end if' instead of 'endif' --> tests/../integration_tests/if_04.f90:25:1 | 25 | endif name | ^^^^^ help: write this as 'end if' lfortran-0.63.0/tests/reference/asr-derived_types_41-d6b8ce9.json0000664000175000017500000000077215174404631024720 0ustar alastairalastair{ "basename": "asr-derived_types_41-d6b8ce9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_41.f90", "infile_hash": "7159edfcbabeaa6b15ecf1918e77a04e8513664002ea1c2d083daf22", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_41-d6b8ce9.stdout", "stdout_hash": "cdc41c701bf0c7ed54214768341c4d210ae4a06143d5cd9f84190e88", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-kwargs_02-1588831.json0000664000175000017500000000074515174404631023042 0ustar alastairalastair{ "basename": "asr-kwargs_02-1588831", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/kwargs_02.f90", "infile_hash": "b134c269925633b5b9f943802cb7efd683082e7567d4ef0e90d9ed47", "outfile": null, "outfile_hash": null, "stdout": "asr-kwargs_02-1588831.stdout", "stdout_hash": "86429de8c391f87311e275b2b479a0087cbfc6bed2993ed696bedca9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit12-025d795.stderr0000664000175000017500000000224715174404631023627 0ustar alastairalastairstyle suggestion: Use integer(4) instead of integer*4 --> tests/implicit12.f90:3:17 | 3 | implicit integer*4 (d-e) | ^ help: write this as 'integer(4)' style suggestion: Use integer(8) instead of integer*8 --> tests/implicit12.f90:4:17 | 4 | implicit integer*8 (f-g) | ^ help: write this as 'integer(8)' style suggestion: Use real(4) instead of real*4 --> tests/implicit12.f90:6:14 | 6 | implicit real*4 (i-k) | ^ help: write this as 'real(4)' style suggestion: Use real(8) instead of real*8 --> tests/implicit12.f90:7:14 | 7 | implicit real*8 (l) | ^ help: write this as 'real(8)' style suggestion: Use complex(4) instead of complex*8 --> tests/implicit12.f90:9:17 | 9 | implicit complex*8 (o) | ^ help: write this as 'complex(4)' style suggestion: Use complex(8) instead of complex*16 --> tests/implicit12.f90:10:17 | 10 | implicit complex*16 (p) | ^ help: write this as 'complex(8)' semantic error: Implicit typing is not allowed, enable it by using --implicit-typing --> tests/implicit12.f90:2:1 | 2 | implicit integer (b-c) | ^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/run-format4-aaf60f4.json0000664000175000017500000000066215174404631023122 0ustar alastairalastair{ "basename": "run-format4-aaf60f4", "cmd": "lfortran --no-color {infile}", "infile": "tests/format4.f90", "infile_hash": "3c91cadf1851b5203fa5f2904ef5d6b588f591c535efa7325f1f2e13", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-format4-aaf60f4.stderr", "stderr_hash": "3c4c7e7bc1c826a3726a68d9ad6593d0426e0f2f724d5627ca76dab4", "returncode": 1 }lfortran-0.63.0/tests/reference/cpp-types_03-dc774f0.json0000664000175000017500000000072515174404631023121 0ustar alastairalastair{ "basename": "cpp-types_03-dc774f0", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/types_03.f90", "infile_hash": "388683b8609d91d174ceb8c24787c982bf1ea22d342e94d44457b861", "outfile": null, "outfile_hash": null, "stdout": "cpp-types_03-dc774f0.stdout", "stdout_hash": "1263bc24722b5a28a426bc3b9480c394cc2dbd0ba1ddd406d5176480", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-if2-0c3bb72.json0000664000175000017500000000071115174404631022575 0ustar alastairalastair{ "basename": "ast_f90-if2-0c3bb72", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/if2.f90", "infile_hash": "7e5997e7b3a28044e5c2899900ea795edfd628c1ed4530afdf1aea0d", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-if2-0c3bb72.stdout", "stdout_hash": "d505ab8f9410508730d2bcc0577d768fb7250379d8923bf3769b2cc6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-derived_types_45-ae31b1c.stdout0000664000175000017500000002103715174404631025432 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %derived_types_45_mod.myint = type { i32 } @0 = private unnamed_addr constant [4 x i8] c"ins\00", align 1 @1 = private unnamed_addr constant [48 x i8] c"tests/../integration_tests/derived_types_45.f90\00", align 1 @2 = private unnamed_addr constant [22 x i8] c"'%s' unallocated here\00", align 1 @3 = private unnamed_addr constant [52 x i8] c"Tried to access member of unallocated variable '%s'\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %ins = alloca %derived_types_45_mod.myint*, align 8 store %derived_types_45_mod.myint* null, %derived_types_45_mod.myint** %ins, align 8 %temp_struct_var__ = alloca %derived_types_45_mod.myint, align 8 %3 = getelementptr %derived_types_45_mod.myint, %derived_types_45_mod.myint* %temp_struct_var__, i32 0, i32 0 %4 = getelementptr %derived_types_45_mod.myint, %derived_types_45_mod.myint* %temp_struct_var__, i32 0, i32 0 store i32 44, i32* %4, align 4 %5 = load %derived_types_45_mod.myint*, %derived_types_45_mod.myint** %ins, align 8 %6 = icmp eq %derived_types_45_mod.myint* %5, null br i1 %6, label %then, label %else then: ; preds = %.entry %7 = call i8* @_lfortran_get_default_allocator() %8 = call i8* @_lfortran_malloc_alloc(i8* %7, i64 4) call void @llvm.memset.p0i8.i32(i8* %8, i8 0, i32 4, i1 false) %9 = bitcast i8* %8 to %derived_types_45_mod.myint* store %derived_types_45_mod.myint* %9, %derived_types_45_mod.myint** %ins, align 8 %10 = load %derived_types_45_mod.myint*, %derived_types_45_mod.myint** %ins, align 8 %11 = getelementptr %derived_types_45_mod.myint, %derived_types_45_mod.myint* %10, i32 0, i32 0 br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %12 = load %derived_types_45_mod.myint*, %derived_types_45_mod.myint** %ins, align 8 %13 = getelementptr %derived_types_45_mod.myint, %derived_types_45_mod.myint* %temp_struct_var__, i32 0, i32 0 %14 = load i32, i32* %13, align 4 %15 = getelementptr %derived_types_45_mod.myint, %derived_types_45_mod.myint* %12, i32 0, i32 0 br i1 true, label %then1, label %else2 then1: ; preds = %ifcont store i32 %14, i32* %15, align 4 br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %16 = load %derived_types_45_mod.myint*, %derived_types_45_mod.myint** %ins, align 8 %17 = ptrtoint %derived_types_45_mod.myint* %16 to i64 %18 = icmp eq i64 %17, 0 br i1 %18, label %then4, label %ifcont5 then4: ; preds = %ifcont3 %19 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %20 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %21 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %20, i32 0, i32 0 %22 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %21, i32 0, i32 0 store i8* getelementptr inbounds ([48 x i8], [48 x i8]* @1, i32 0, i32 0), i8** %22, align 8 %23 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %21, i32 0, i32 1 store i32 15, i32* %23, align 4 %24 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %21, i32 0, i32 2 store i32 9, i32* %24, align 4 %25 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %21, i32 0, i32 3 store i32 15, i32* %25, align 4 %26 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %21, i32 0, i32 4 store i32 13, i32* %26, align 4 %27 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @0, i32 0, i32 0)) %28 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %19, i32 0, i32 0 %29 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %20, i32 0, i32 0 %30 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %28, i32 0, i32 2 %31 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %28, i32 0, i32 0 store i1 true, i1* %31, align 1 %32 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %28, i32 0, i32 1 store i8* %27, i8** %32, align 8 store { i8*, i32, i32, i32, i32 }* %29, { i8*, i32, i32, i32, i32 }** %30, align 8 %33 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %28, i32 0, i32 3 store i32 1, i32* %33, align 4 %34 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %19, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %34, i32 1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont5: ; preds = %ifcont3 %35 = getelementptr %derived_types_45_mod.myint, %derived_types_45_mod.myint* %16, i32 0, i32 0 %36 = load i32, i32* %35, align 4 %37 = icmp ne i32 %36, 44 br i1 %37, label %then6, label %else7 then6: ; preds = %ifcont5 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont8 else7: ; preds = %ifcont5 br label %ifcont8 ifcont8: ; preds = %else7, %then6 br label %return return: ; preds = %ifcont8 br label %FINALIZE_SYMTABLE_derived_types_45 FINALIZE_SYMTABLE_derived_types_45: ; preds = %return br label %Finalize_Variable_ins Finalize_Variable_ins: ; preds = %FINALIZE_SYMTABLE_derived_types_45 %38 = load %derived_types_45_mod.myint*, %derived_types_45_mod.myint** %ins, align 8 call void @finalize_allocatable__StructType__myint_of_derived_types_45_mod(%derived_types_45_mod.myint* %38) call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc_alloc(i8*, i64) declare i8* @_lfortran_get_default_allocator() ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 declare i8* @_lcompilers_snprintf_alloc(i8*, i8*, ...) declare void @_lcompilers_runtime_error(i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) declare void @exit(i32) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() define internal void @finalize_allocatable__StructType__myint_of_derived_types_45_mod(%derived_types_45_mod.myint* %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = icmp ne %derived_types_45_mod.myint* %0, null br i1 %2, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %entry %3 = bitcast %derived_types_45_mod.myint* %0 to i8* call void @_lfortran_free_alloc(i8* %1, i8* %3) br label %is_allocated.ifcont is_allocated.else: ; preds = %entry br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %is_allocated.then ret void } declare void @_lfortran_free_alloc(i8*, i8*) attributes #0 = { argmemonly nounwind willreturn writeonly } lfortran-0.63.0/tests/reference/asr-intrinsics7-d1c02a1.stderr0000664000175000017500000000026615174404631024241 0ustar alastairalastairsemantic error: Kind of all the arguments of Hypot must be the same --> tests/errors/intrinsics7.f90:2:14 | 2 | print *, hypot(1.0, 2.7_8) | ^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-transfer_09-a440034.stdout0000664000175000017500000004756415174404631024020 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { transfer_09: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lhs: (Variable 2 lhs [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r1: (Variable 2 r1 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 2 rhs [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) transfer_09 [] [(Assignment (Var 2 rhs) (ArrayConstant 12 [10, 20, 30] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 2 a) (BitCast (ArrayItem (Var 2 rhs) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Var 2 a) () (Real 4) () ) () .false. .false. ) (Assignment (Var 2 b) (BitCast (ArrayItem (Var 2 rhs) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Var 2 b) () (Real 4) () ) () .false. .false. ) (Assignment (Var 2 c) (BitCast (ArrayItem (Var 2 rhs) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Var 2 c) () (Real 4) () ) () .false. .false. ) (Assignment (ArraySection (Var 2 r1) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] (Array (Real 4) [(() ())] DescriptorArray ) () ) (BitCast (Var 2 rhs) (Var 2 r1) () (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (Assignment (ArraySection (Var 2 lhs) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] (Array (Integer 4) [(() ())] DescriptorArray ) () ) (BitCast (Var 2 rhs) (Var 2 lhs) () (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Correct Values" (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 rhs) (Var 2 a) (Var 2 b) (Var 2 c)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "Transferred Values" (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 lhs) (Var 2 r1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (LogicalBinOp (LogicalBinOp (IntegerCompare (ArrayItem (Var 2 lhs) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (ArrayItem (Var 2 rhs) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Logical 4) () ) Or (IntegerCompare (ArrayItem (Var 2 lhs) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (ArrayItem (Var 2 rhs) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Logical 4) () ) (Logical 4) () ) Or (IntegerCompare (ArrayItem (Var 2 lhs) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (ArrayItem (Var 2 rhs) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (LogicalBinOp (RealCompare (ArrayItem (Var 2 r1) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) NotEq (Var 2 a) (Logical 4) () ) Or (RealCompare (ArrayItem (Var 2 r1) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) NotEq (Var 2 b) (Logical 4) () ) (Logical 4) () ) Or (RealCompare (ArrayItem (Var 2 r1) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) NotEq (Var 2 c) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-attributes1-25126f0.json0000664000175000017500000000074115174404631024232 0ustar alastairalastair{ "basename": "ast_f90-attributes1-25126f0", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/attributes1.f90", "infile_hash": "895bd51041a1a5b92a95e7ae70f7475a5b305fdd6f8fcd525a30f46a", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-attributes1-25126f0.stdout", "stdout_hash": "b9e16c4afd812d7ebbce72a3da771f01cf60036efb15d7e5e73e9cea", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-end_submodule_name-68b3188.stderr0000664000175000017500000000040415174404631025476 0ustar alastairalastairsyntax error: End submodule name does not match submodule name --> tests/errors/end_submodule_name.f90:17:1 - 24:17 | 17 | submodule (mother) daughter | ^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 24 | end submodule son | ...^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-implicit1-e201262.json0000664000175000017500000000104015174404631023165 0ustar alastairalastair{ "basename": "ast-implicit1-e201262", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/implicit1.f90", "infile_hash": "8f316b7b5813cd7d2f663bd9aac929c0d2fdb42eccdc2ac798b0c3d5", "outfile": null, "outfile_hash": null, "stdout": "ast-implicit1-e201262.stdout", "stdout_hash": "6f8c276efeb3e34064a8bea0f00cf4fe1e86341321e4026c644dec76", "stderr": "ast-implicit1-e201262.stderr", "stderr_hash": "7040f573fd98c40ed1387403ecf33f749ead9159a50668621b3fb8ca", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-expr1-e0e6d6b.json0000664000175000017500000000070415174404631022567 0ustar alastairalastair{ "basename": "asr-expr1-e0e6d6b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr1.f90", "infile_hash": "3c49cb3157ec3feaf0f97156e5c11dca0ffd6481c97bb1a5dffaa14f", "outfile": null, "outfile_hash": null, "stdout": "asr-expr1-e0e6d6b.stdout", "stdout_hash": "87e8c124dc6636b5850e9cb14d78e25a20a1837c2afe9f39fbce1a50", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-automatic_allocation_02-2a7afc4.stdout0000664000175000017500000011305215174404631026757 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %complex_4 = type <{ float, float }> @0 = private unnamed_addr constant [2 x i8] c"i\00", align 1 @1 = private unnamed_addr constant [55 x i8] c"tests/../integration_tests/automatic_allocation_02.f90\00", align 1 @2 = private unnamed_addr constant [53 x i8] c"Cannot allocate '%s' because it is already allocated\00", align 1 @3 = private unnamed_addr constant [55 x i8] c"Attempting to allocate already allocated variable '%s'\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"r\00", align 1 @5 = private unnamed_addr constant [55 x i8] c"tests/../integration_tests/automatic_allocation_02.f90\00", align 1 @6 = private unnamed_addr constant [53 x i8] c"Cannot allocate '%s' because it is already allocated\00", align 1 @7 = private unnamed_addr constant [55 x i8] c"Attempting to allocate already allocated variable '%s'\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @9 = private unnamed_addr constant [55 x i8] c"tests/../integration_tests/automatic_allocation_02.f90\00", align 1 @10 = private unnamed_addr constant [53 x i8] c"Cannot allocate '%s' because it is already allocated\00", align 1 @11 = private unnamed_addr constant [55 x i8] c"Attempting to allocate already allocated variable '%s'\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"l\00", align 1 @13 = private unnamed_addr constant [55 x i8] c"tests/../integration_tests/automatic_allocation_02.f90\00", align 1 @14 = private unnamed_addr constant [53 x i8] c"Cannot allocate '%s' because it is already allocated\00", align 1 @15 = private unnamed_addr constant [55 x i8] c"Attempting to allocate already allocated variable '%s'\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"i\00", align 1 @17 = private unnamed_addr constant [55 x i8] c"tests/../integration_tests/automatic_allocation_02.f90\00", align 1 @18 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @19 = private unnamed_addr constant [32 x i8] c"Variable '%s' is not allocated.\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @21 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"r\00", align 1 @23 = private unnamed_addr constant [55 x i8] c"tests/../integration_tests/automatic_allocation_02.f90\00", align 1 @24 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @25 = private unnamed_addr constant [32 x i8] c"Variable '%s' is not allocated.\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @27 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @28 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @29 = private unnamed_addr constant [55 x i8] c"tests/../integration_tests/automatic_allocation_02.f90\00", align 1 @30 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @31 = private unnamed_addr constant [32 x i8] c"Variable '%s' is not allocated.\00", align 1 @32 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @33 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @34 = private unnamed_addr constant [2 x i8] c"l\00", align 1 @35 = private unnamed_addr constant [55 x i8] c"tests/../integration_tests/automatic_allocation_02.f90\00", align 1 @36 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @37 = private unnamed_addr constant [32 x i8] c"Variable '%s' is not allocated.\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @39 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %c = alloca %complex_4*, align 8 store %complex_4* null, %complex_4** %c, align 8 %i = alloca i32*, align 8 store i32* null, i32** %i, align 8 %l = alloca i32*, align 8 store i32* null, i32** %l, align 8 %r = alloca float*, align 8 store float* null, float** %r, align 8 %3 = load i32*, i32** %i, align 8 %4 = icmp eq i32* %3, null br i1 %4, label %then, label %else then: ; preds = %.entry %5 = load i32*, i32** %i, align 8 %6 = ptrtoint i32* %5 to i64 %7 = icmp ne i64 %6, 0 br i1 %7, label %then1, label %ifcont then1: ; preds = %then %8 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %9 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %10 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %9, i32 0, i32 0 %11 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %10, i32 0, i32 0 store i8* getelementptr inbounds ([55 x i8], [55 x i8]* @1, i32 0, i32 0), i8** %11, align 8 %12 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %10, i32 0, i32 1 store i32 9, i32* %12, align 4 %13 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %10, i32 0, i32 2 store i32 5, i32* %13, align 4 %14 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %10, i32 0, i32 3 store i32 9, i32* %14, align 4 %15 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %10, i32 0, i32 4 store i32 5, i32* %15, align 4 %16 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @2, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) %17 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %8, i32 0, i32 0 %18 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %9, i32 0, i32 0 %19 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %17, i32 0, i32 2 %20 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %17, i32 0, i32 0 store i1 true, i1* %20, align 1 %21 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %17, i32 0, i32 1 store i8* %16, i8** %21, align 8 store { i8*, i32, i32, i32, i32 }* %18, { i8*, i32, i32, i32, i32 }** %19, align 8 %22 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %17, i32 0, i32 3 store i32 1, i32* %22, align 4 %23 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %8, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %23, i32 1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont: ; preds = %then %24 = call i8* @_lfortran_get_default_allocator() %25 = call i8* @_lfortran_malloc_alloc(i8* %24, i64 4) call void @llvm.memset.p0i8.i32(i8* %25, i8 0, i32 4, i1 false) %26 = bitcast i8* %25 to i32* store i32* %26, i32** %i, align 8 br label %ifcont2 else: ; preds = %.entry br label %ifcont2 ifcont2: ; preds = %else, %ifcont %27 = load i32*, i32** %i, align 8 store i32 10, i32* %27, align 4 %28 = load float*, float** %r, align 8 %29 = icmp eq float* %28, null br i1 %29, label %then3, label %else6 then3: ; preds = %ifcont2 %30 = load float*, float** %r, align 8 %31 = ptrtoint float* %30 to i64 %32 = icmp ne i64 %31, 0 br i1 %32, label %then4, label %ifcont5 then4: ; preds = %then3 %33 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %34 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %35 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %34, i32 0, i32 0 %36 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %35, i32 0, i32 0 store i8* getelementptr inbounds ([55 x i8], [55 x i8]* @5, i32 0, i32 0), i8** %36, align 8 %37 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %35, i32 0, i32 1 store i32 10, i32* %37, align 4 %38 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %35, i32 0, i32 2 store i32 5, i32* %38, align 4 %39 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %35, i32 0, i32 3 store i32 10, i32* %39, align 4 %40 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %35, i32 0, i32 4 store i32 5, i32* %40, align 4 %41 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @6, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) %42 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %33, i32 0, i32 0 %43 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %34, i32 0, i32 0 %44 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %42, i32 0, i32 2 %45 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %42, i32 0, i32 0 store i1 true, i1* %45, align 1 %46 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %42, i32 0, i32 1 store i8* %41, i8** %46, align 8 store { i8*, i32, i32, i32, i32 }* %43, { i8*, i32, i32, i32, i32 }** %44, align 8 %47 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %42, i32 0, i32 3 store i32 1, i32* %47, align 4 %48 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %33, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %48, i32 1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont5: ; preds = %then3 %49 = call i8* @_lfortran_get_default_allocator() %50 = call i8* @_lfortran_malloc_alloc(i8* %49, i64 4) call void @llvm.memset.p0i8.i32(i8* %50, i8 0, i32 4, i1 false) %51 = bitcast i8* %50 to float* store float* %51, float** %r, align 8 br label %ifcont7 else6: ; preds = %ifcont2 br label %ifcont7 ifcont7: ; preds = %else6, %ifcont5 %52 = load float*, float** %r, align 8 store float 0x40119999A0000000, float* %52, align 4 %53 = load %complex_4*, %complex_4** %c, align 8 %54 = icmp eq %complex_4* %53, null br i1 %54, label %then8, label %else11 then8: ; preds = %ifcont7 %55 = load %complex_4*, %complex_4** %c, align 8 %56 = ptrtoint %complex_4* %55 to i64 %57 = icmp ne i64 %56, 0 br i1 %57, label %then9, label %ifcont10 then9: ; preds = %then8 %58 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %59 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %60 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %59, i32 0, i32 0 %61 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %60, i32 0, i32 0 store i8* getelementptr inbounds ([55 x i8], [55 x i8]* @9, i32 0, i32 0), i8** %61, align 8 %62 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %60, i32 0, i32 1 store i32 11, i32* %62, align 4 %63 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %60, i32 0, i32 2 store i32 5, i32* %63, align 4 %64 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %60, i32 0, i32 3 store i32 11, i32* %64, align 4 %65 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %60, i32 0, i32 4 store i32 5, i32* %65, align 4 %66 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @10, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) %67 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %58, i32 0, i32 0 %68 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %59, i32 0, i32 0 %69 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %67, i32 0, i32 2 %70 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %67, i32 0, i32 0 store i1 true, i1* %70, align 1 %71 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %67, i32 0, i32 1 store i8* %66, i8** %71, align 8 store { i8*, i32, i32, i32, i32 }* %68, { i8*, i32, i32, i32, i32 }** %69, align 8 %72 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %67, i32 0, i32 3 store i32 1, i32* %72, align 4 %73 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %58, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %73, i32 1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont10: ; preds = %then8 %74 = call i8* @_lfortran_get_default_allocator() %75 = call i8* @_lfortran_malloc_alloc(i8* %74, i64 8) call void @llvm.memset.p0i8.i32(i8* %75, i8 0, i32 8, i1 false) %76 = bitcast i8* %75 to %complex_4* store %complex_4* %76, %complex_4** %c, align 8 br label %ifcont12 else11: ; preds = %ifcont7 br label %ifcont12 ifcont12: ; preds = %else11, %ifcont10 %77 = load %complex_4*, %complex_4** %c, align 8 store %complex_4 <{ float 1.000000e+00, float 2.000000e+00 }>, %complex_4* %77, align 1 %78 = load i32*, i32** %l, align 8 %79 = icmp eq i32* %78, null br i1 %79, label %then13, label %else16 then13: ; preds = %ifcont12 %80 = load i32*, i32** %l, align 8 %81 = ptrtoint i32* %80 to i64 %82 = icmp ne i64 %81, 0 br i1 %82, label %then14, label %ifcont15 then14: ; preds = %then13 %83 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %84 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %85 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %84, i32 0, i32 0 %86 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %85, i32 0, i32 0 store i8* getelementptr inbounds ([55 x i8], [55 x i8]* @13, i32 0, i32 0), i8** %86, align 8 %87 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %85, i32 0, i32 1 store i32 12, i32* %87, align 4 %88 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %85, i32 0, i32 2 store i32 5, i32* %88, align 4 %89 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %85, i32 0, i32 3 store i32 12, i32* %89, align 4 %90 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %85, i32 0, i32 4 store i32 5, i32* %90, align 4 %91 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @14, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) %92 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %83, i32 0, i32 0 %93 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %84, i32 0, i32 0 %94 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %92, i32 0, i32 2 %95 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %92, i32 0, i32 0 store i1 true, i1* %95, align 1 %96 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %92, i32 0, i32 1 store i8* %91, i8** %96, align 8 store { i8*, i32, i32, i32, i32 }* %93, { i8*, i32, i32, i32, i32 }** %94, align 8 %97 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %92, i32 0, i32 3 store i32 1, i32* %97, align 4 %98 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %83, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %98, i32 1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont15: ; preds = %then13 %99 = call i8* @_lfortran_get_default_allocator() %100 = call i8* @_lfortran_malloc_alloc(i8* %99, i64 4) call void @llvm.memset.p0i8.i32(i8* %100, i8 0, i32 4, i1 false) %101 = bitcast i8* %100 to i32* store i32* %101, i32** %l, align 8 br label %ifcont17 else16: ; preds = %ifcont12 br label %ifcont17 ifcont17: ; preds = %else16, %ifcont15 %102 = load i32*, i32** %l, align 8 store i32 1, i32* %102, align 4 %103 = load i32*, i32** %i, align 8 %104 = ptrtoint i32* %103 to i64 %105 = icmp eq i64 %104, 0 br i1 %105, label %then18, label %ifcont19 then18: ; preds = %ifcont17 %106 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %107 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %108 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %107, i32 0, i32 0 %109 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %108, i32 0, i32 0 store i8* getelementptr inbounds ([55 x i8], [55 x i8]* @17, i32 0, i32 0), i8** %109, align 8 %110 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %108, i32 0, i32 1 store i32 4, i32* %110, align 4 %111 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %108, i32 0, i32 2 store i32 29, i32* %111, align 4 %112 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %108, i32 0, i32 3 store i32 4, i32* %112, align 4 %113 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %108, i32 0, i32 4 store i32 29, i32* %113, align 4 %114 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @18, i32 0, i32 0)) %115 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %106, i32 0, i32 0 %116 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %107, i32 0, i32 0 %117 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %115, i32 0, i32 2 %118 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %115, i32 0, i32 0 store i1 true, i1* %118, align 1 %119 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %115, i32 0, i32 1 store i8* %114, i8** %119, align 8 store { i8*, i32, i32, i32, i32 }* %116, { i8*, i32, i32, i32, i32 }** %117, align 8 %120 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %115, i32 0, i32 3 store i32 1, i32* %120, align 4 %121 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %106, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %121, i32 1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont19: ; preds = %ifcont17 %122 = load i32*, i32** %i, align 8 %123 = load i32, i32* %122, align 4 %124 = icmp ne i32 %123, 10 br i1 %124, label %then20, label %else21 then20: ; preds = %ifcont19 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont22 else21: ; preds = %ifcont19 br label %ifcont22 ifcont22: ; preds = %else21, %then20 %125 = load float*, float** %r, align 8 %126 = ptrtoint float* %125 to i64 %127 = icmp eq i64 %126, 0 br i1 %127, label %then23, label %ifcont24 then23: ; preds = %ifcont22 %128 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %129 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %130 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %129, i32 0, i32 0 %131 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %130, i32 0, i32 0 store i8* getelementptr inbounds ([55 x i8], [55 x i8]* @23, i32 0, i32 0), i8** %131, align 8 %132 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %130, i32 0, i32 1 store i32 5, i32* %132, align 4 %133 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %130, i32 0, i32 2 store i32 26, i32* %133, align 4 %134 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %130, i32 0, i32 3 store i32 5, i32* %134, align 4 %135 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %130, i32 0, i32 4 store i32 26, i32* %135, align 4 %136 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @24, i32 0, i32 0)) %137 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %128, i32 0, i32 0 %138 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %129, i32 0, i32 0 %139 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %137, i32 0, i32 2 %140 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %137, i32 0, i32 0 store i1 true, i1* %140, align 1 %141 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %137, i32 0, i32 1 store i8* %136, i8** %141, align 8 store { i8*, i32, i32, i32, i32 }* %138, { i8*, i32, i32, i32, i32 }** %139, align 8 %142 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %137, i32 0, i32 3 store i32 1, i32* %142, align 4 %143 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %128, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %143, i32 1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont24: ; preds = %ifcont22 %144 = load float*, float** %r, align 8 %145 = load float, float* %144, align 4 %146 = fcmp une float %145, 0x40119999A0000000 br i1 %146, label %then25, label %else26 then25: ; preds = %ifcont24 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @27, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont27 else26: ; preds = %ifcont24 br label %ifcont27 ifcont27: ; preds = %else26, %then25 %147 = load %complex_4*, %complex_4** %c, align 8 %148 = ptrtoint %complex_4* %147 to i64 %149 = icmp eq i64 %148, 0 br i1 %149, label %then28, label %ifcont29 then28: ; preds = %ifcont27 %150 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %151 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %152 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %151, i32 0, i32 0 %153 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %152, i32 0, i32 0 store i8* getelementptr inbounds ([55 x i8], [55 x i8]* @29, i32 0, i32 0), i8** %153, align 8 %154 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %152, i32 0, i32 1 store i32 6, i32* %154, align 4 %155 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %152, i32 0, i32 2 store i32 29, i32* %155, align 4 %156 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %152, i32 0, i32 3 store i32 6, i32* %156, align 4 %157 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %152, i32 0, i32 4 store i32 29, i32* %157, align 4 %158 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @30, i32 0, i32 0)) %159 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %150, i32 0, i32 0 %160 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %151, i32 0, i32 0 %161 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %159, i32 0, i32 2 %162 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %159, i32 0, i32 0 store i1 true, i1* %162, align 1 %163 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %159, i32 0, i32 1 store i8* %158, i8** %163, align 8 store { i8*, i32, i32, i32, i32 }* %160, { i8*, i32, i32, i32, i32 }** %161, align 8 %164 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %159, i32 0, i32 3 store i32 1, i32* %164, align 4 %165 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %150, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %165, i32 1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @31, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @28, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont29: ; preds = %ifcont27 %166 = load %complex_4*, %complex_4** %c, align 8 %167 = load %complex_4, %complex_4* %166, align 1 %168 = extractvalue %complex_4 %167, 0 %169 = extractvalue %complex_4 %167, 1 %170 = fcmp one float %168, 1.000000e+00 %171 = fcmp one float %169, 2.000000e+00 %172 = or i1 %170, %171 br i1 %172, label %then30, label %else31 then30: ; preds = %ifcont29 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @33, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @32, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont32 else31: ; preds = %ifcont29 br label %ifcont32 ifcont32: ; preds = %else31, %then30 %173 = load i32*, i32** %l, align 8 %174 = ptrtoint i32* %173 to i64 %175 = icmp eq i64 %174, 0 br i1 %175, label %then33, label %ifcont34 then33: ; preds = %ifcont32 %176 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %177 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %178 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %177, i32 0, i32 0 %179 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %178, i32 0, i32 0 store i8* getelementptr inbounds ([55 x i8], [55 x i8]* @35, i32 0, i32 0), i8** %179, align 8 %180 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %178, i32 0, i32 1 store i32 7, i32* %180, align 4 %181 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %178, i32 0, i32 2 store i32 29, i32* %181, align 4 %182 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %178, i32 0, i32 3 store i32 7, i32* %182, align 4 %183 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %178, i32 0, i32 4 store i32 29, i32* %183, align 4 %184 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @36, i32 0, i32 0)) %185 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %176, i32 0, i32 0 %186 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %177, i32 0, i32 0 %187 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %185, i32 0, i32 2 %188 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %185, i32 0, i32 0 store i1 true, i1* %188, align 1 %189 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %185, i32 0, i32 1 store i8* %184, i8** %189, align 8 store { i8*, i32, i32, i32, i32 }* %186, { i8*, i32, i32, i32, i32 }** %187, align 8 %190 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %185, i32 0, i32 3 store i32 1, i32* %190, align 4 %191 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %176, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %191, i32 1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @37, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @34, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont34: ; preds = %ifcont32 %192 = load i32*, i32** %l, align 8 %193 = load i32, i32* %192, align 4 %194 = xor i32 %193, 1 %195 = icmp ne i32 %194, 0 br i1 %195, label %then35, label %else36 then35: ; preds = %ifcont34 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @39, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont37 else36: ; preds = %ifcont34 br label %ifcont37 ifcont37: ; preds = %else36, %then35 %196 = load i32*, i32** %i, align 8 %197 = ptrtoint i32* %196 to i64 %198 = icmp ne i64 %197, 0 br i1 %198, label %then38, label %else39 then38: ; preds = %ifcont37 %199 = alloca i8*, align 8 %200 = bitcast i32* %196 to i8* store i8* %200, i8** %199, align 8 %201 = load i8*, i8** %199, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %201) store i32* null, i32** %i, align 8 br label %ifcont40 else39: ; preds = %ifcont37 br label %ifcont40 ifcont40: ; preds = %else39, %then38 %202 = load float*, float** %r, align 8 %203 = ptrtoint float* %202 to i64 %204 = icmp ne i64 %203, 0 br i1 %204, label %then41, label %else42 then41: ; preds = %ifcont40 %205 = alloca i8*, align 8 %206 = bitcast float* %202 to i8* store i8* %206, i8** %205, align 8 %207 = load i8*, i8** %205, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %207) store float* null, float** %r, align 8 br label %ifcont43 else42: ; preds = %ifcont40 br label %ifcont43 ifcont43: ; preds = %else42, %then41 %208 = load %complex_4*, %complex_4** %c, align 8 %209 = ptrtoint %complex_4* %208 to i64 %210 = icmp ne i64 %209, 0 br i1 %210, label %then44, label %else45 then44: ; preds = %ifcont43 %211 = alloca i8*, align 8 %212 = bitcast %complex_4* %208 to i8* store i8* %212, i8** %211, align 8 %213 = load i8*, i8** %211, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %213) store %complex_4* null, %complex_4** %c, align 8 br label %ifcont46 else45: ; preds = %ifcont43 br label %ifcont46 ifcont46: ; preds = %else45, %then44 %214 = load i32*, i32** %l, align 8 %215 = ptrtoint i32* %214 to i64 %216 = icmp ne i64 %215, 0 br i1 %216, label %then47, label %else48 then47: ; preds = %ifcont46 %217 = alloca i8*, align 8 %218 = bitcast i32* %214 to i8* store i8* %218, i8** %217, align 8 %219 = load i8*, i8** %217, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %219) store i32* null, i32** %l, align 8 br label %ifcont49 else48: ; preds = %ifcont46 br label %ifcont49 ifcont49: ; preds = %else48, %then47 br label %return return: ; preds = %ifcont49 br label %FINALIZE_SYMTABLE_automatic_allocation_02 FINALIZE_SYMTABLE_automatic_allocation_02: ; preds = %return br label %Finalize_Variable_c Finalize_Variable_c: ; preds = %FINALIZE_SYMTABLE_automatic_allocation_02 %220 = load %complex_4*, %complex_4** %c, align 8 %221 = bitcast %complex_4* %220 to i8* call void @_lfortran_free_alloc(i8* %2, i8* %221) br label %Finalize_Variable_i Finalize_Variable_i: ; preds = %Finalize_Variable_c %222 = load i32*, i32** %i, align 8 %223 = bitcast i32* %222 to i8* call void @_lfortran_free_alloc(i8* %2, i8* %223) br label %Finalize_Variable_l Finalize_Variable_l: ; preds = %Finalize_Variable_i %224 = load i32*, i32** %l, align 8 %225 = bitcast i32* %224 to i8* call void @_lfortran_free_alloc(i8* %2, i8* %225) br label %Finalize_Variable_r Finalize_Variable_r: ; preds = %Finalize_Variable_l %226 = load float*, float** %r, align 8 %227 = bitcast float* %226 to i8* call void @_lfortran_free_alloc(i8* %2, i8* %227) call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_snprintf_alloc(i8*, i8*, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lcompilers_runtime_error(i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) declare void @exit(i32) declare i8* @_lfortran_malloc_alloc(i8*, i64) ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @_lfortran_free_alloc(i8*, i8*) attributes #0 = { argmemonly nounwind willreturn writeonly } lfortran-0.63.0/tests/reference/run-format_29-75ca0a0.stdout0000664000175000017500000000034315174404631023626 0ustar alastairalastair 1.2346 12.3456 123.4560 0.1235 0.0012 x=0.001234 0.001234 1.234000 x=123456.0 123456.00 1234.56 x=-9.876 -9.876 -987.600 0.1235 123.4567 12345.67 9.9999 99.9990 0.000010 0.100000 lfortran-0.63.0/tests/reference/asr-dimension_01-2172e76.json0000664000175000017500000000074015174404631023577 0ustar alastairalastair{ "basename": "asr-dimension_01-2172e76", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dimension_01.f90", "infile_hash": "0a6954d8790d6aca192ed8950554bda2671bec782ab05c87c7a74912", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dimension_01-2172e76.stderr", "stderr_hash": "9b74d99f78462b1b6e613732abfbf556364eb63270d82813b234b3d5", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-submodule_01-198736c.json0000664000175000017500000000074015174404631023620 0ustar alastairalastair{ "basename": "asr-submodule_01-198736c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/submodule_01.f90", "infile_hash": "e2738a16d41b50655f9aadcb09a0752dec5565a2ae749495d540d417", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-submodule_01-198736c.stderr", "stderr_hash": "6275283f1afb119c322a31f2e1fecdaa9a5f46e5070b2be671baba8f", "returncode": 2 }lfortran-0.63.0/tests/reference/cpp-case_05-96724df.json0000664000175000017500000000072215174404631022616 0ustar alastairalastair{ "basename": "cpp-case_05-96724df", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/case_05.f90", "infile_hash": "914477f4a376baf0341e522d2109b6108238cd1d9dfecf969283ab79", "outfile": null, "outfile_hash": null, "stdout": "cpp-case_05-96724df.stdout", "stdout_hash": "a15dd4d337a830a428e125ff53e362f981362b035d9606d9c75979aa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-allocatable_component_unnamed_unallocated_01-9346375.json0000664000175000017500000000106615174404631032171 0ustar alastairalastair{ "basename": "run-allocatable_component_unnamed_unallocated_01-9346375", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/allocatable_component_unnamed_unallocated_01.f90", "infile_hash": "30f5f138e7c36a574f6802a9710c25fce0150b498ad207715f686d9f", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-allocatable_component_unnamed_unallocated_01-9346375.stderr", "stderr_hash": "679704f58a59bf3bf873a19bfc3266310630f2e52caf8c3bf7885935", "returncode": 1 }lfortran-0.63.0/tests/reference/ast-line_continuation_01-17bec82.json0000664000175000017500000000100615174404631025467 0ustar alastairalastair{ "basename": "ast-line_continuation_01-17bec82", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/line_continuation_01.f90", "infile_hash": "2a3deedd84166a5c17971c7072fd910ec8e0ef6830db82f44f19a430", "outfile": null, "outfile_hash": null, "stdout": "ast-line_continuation_01-17bec82.stdout", "stdout_hash": "a646d1b0ab9cfa9627568937763dec1602a56de0bd2d945de144bc73", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_nested_vars-nested_namelist_01-c1be094.stdout0000664000175000017500000004174415174404631030262 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { __lcompilers_created__nested_context__outer_: (Module (SymbolTable 6 { i: (Variable 6 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), nml: (Namelist 6 nml [6 i 6 x] ), x: (Variable 6 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __lcompilers_created__nested_context__outer_ () [] .false. .false. .false. ), nested_namelist_01: (Program (SymbolTable 5 { outer: (ExternalSymbol 5 outer 2 outer nested_namelist_01_mod [] outer Public ) }) nested_namelist_01 [nested_namelist_01_mod] [(SubroutineCall 5 outer () [] () .false. )] ), nested_namelist_01_mod: (Module (SymbolTable 2 { outer: (Function (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i_nested_ctx: (ExternalSymbol 3 i_nested_ctx 6 i __lcompilers_created__nested_context__outer_ [] i Public ), inner: (Function (SymbolTable 4 { lfortran_iomsg: (Variable 4 lfortran_iomsg [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), nml: (ExternalSymbol 4 nml 6 nml __lcompilers_created__nested_context__outer_ [] nml Public ) }) inner (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(FileWrite 0 (IntegerConstant 6 (Integer 4) Decimal) (Var 4 lfortran_iomsg) () () [] () () () .false. 4 nml () () )] () Public .true. .true. () ), nml: (Namelist 3 nml [3 i 3 x] ), x: (Variable 3 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x_nested_ctx: (ExternalSymbol 3 x_nested_ctx 6 x __lcompilers_created__nested_context__outer_ [] x Public ) }) outer (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 i) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 x) (RealConstant 3.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 3 i_nested_ctx) (Var 3 i) () .false. .false. ) (Assignment (Var 3 x_nested_ctx) (Var 3 x) () .false. .false. ) (SubroutineCall 3 inner () [] () .false. ) (Assignment (Var 3 i) (Var 3 i_nested_ctx) () .false. .false. ) (Assignment (Var 3 x) (Var 3 x_nested_ctx) () .false. .false. )] () Public .true. .true. () ) }) nested_namelist_01_mod () [] .false. .false. .false. ) }) [] ) ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootlfortran-0.63.0/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-modules_39-906d6cb.stdoutlfortran-0.63.0/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-module0000664000175000017500000010301115174404631034771 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_39: (Program (SymbolTable 8 { build_model: (ExternalSymbol 8 build_model 2 build_model modules_39_fpm_39 [] build_model Public ), join_path: (ExternalSymbol 8 join_path 4 join_path modules_39_module_fpm_filesystem_39 [] join_path Public ) }) modules_39 [modules_39_fpm_39 modules_39_module_fpm_filesystem_39] [(SubroutineCall 8 build_model () [] () .false. ) (Print (StringConstant "executing modules_39" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ), modules_39_fpm_39: (Module (SymbolTable 2 { build_model: (Function (SymbolTable 7 { __libasr_created_variable_: (Variable 7 __libasr_created_variable_ [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_variable_1: (Variable 7 __libasr_created_variable_1 [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_variable_2: (Variable 7 __libasr_created_variable_2 [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) build_model (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(SubroutineCall 2 filewrite_string____1 2 filewrite_string____1 [((FunctionCall 2 join_path () [((StringConstant "build" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((StringConstant ".gitignore" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((Var 7 __libasr_created_variable_)) ((LogicalConstant .false. (Logical 4) )) ((Var 7 __libasr_created_variable_1)) ((LogicalConstant .false. (Logical 4) )) ((Var 7 __libasr_created_variable_2)) ((LogicalConstant .false. (Logical 4) ))] (Allocatable (String 1 () DeferredLength DescriptorString) ) () () )) ((ArrayConstant 1 ["*"] (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] PointerArray ) ColMajor )) ((IntegerConstant 1 (Integer 4) Decimal))] () .false. )] () Public .true. .true. () ), filewrite_string____1: (ExternalSymbol 2 filewrite_string____1 4 filewrite_string____1 modules_39_module_fpm_filesystem_39 [] filewrite_string____1 Public ), join_path: (ExternalSymbol 2 join_path 4 join_path modules_39_module_fpm_filesystem_39 [] join_path Public ) }) modules_39_fpm_39 () [modules_39_module_fpm_filesystem_39] .false. .false. .false. ), modules_39_module_fpm_filesystem_39: (Module (SymbolTable 4 { filewrite_string____1: (Function (SymbolTable 9 { __1filedata: (Variable 9 __1filedata [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), filedata: (Variable 9 filedata [__1filedata] In () () Default (Array (String 1 () AssumedLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (Var 9 __1filedata))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), filename: (Variable 9 filename [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) filewrite_string____1 (FunctionType [(String 1 () AssumedLength DescriptorString) (Array (String 1 () AssumedLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray ) (Integer 4)] () Source Implementation "" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 filename) (Var 9 filedata) (Var 9 __1filedata)] [] () Public .false. .false. () ), join_path: (Function (SymbolTable 6 { __libasr_is_present_a3: (Variable 6 __libasr_is_present_a3 [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_is_present_a4: (Variable 6 __libasr_is_present_a4 [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_is_present_a5: (Variable 6 __libasr_is_present_a5 [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a1: (Variable 6 a1 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a2: (Variable 6 a2 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a3: (Variable 6 a3 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a4: (Variable 6 a4 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a5: (Variable 6 a5 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), path: (Variable 6 path [] ReturnVar () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) join_path (FunctionType [(String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (Logical 4) (String 1 () AssumedLength DescriptorString) (Logical 4) (String 1 () AssumedLength DescriptorString) (Logical 4)] (Allocatable (String 1 () DeferredLength DescriptorString) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 a1) (Var 6 a2) (Var 6 a3) (Var 6 __libasr_is_present_a3) (Var 6 a4) (Var 6 __libasr_is_present_a4) (Var 6 a5) (Var 6 __libasr_is_present_a5)] [] (Var 6 path) Public .true. .true. () ) }) modules_39_module_fpm_filesystem_39 () [] .true. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-fixed_form_with_exit-0c669e6.stdout0000664000175000017500000000161715174404631026164 0ustar alastairalastair(TranslationUnit [(Subroutine example [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(DoLoop 0 () 0 i 2 8 () [(If 0 () (== i 2) [(Exit 0 () () )] [] () () () )] () () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-idint_real4-b5321a5.stderr0000664000175000017500000000025015174404631024103 0ustar alastairalastairsemantic error: first argument of `idint` must have kind equal to 8 --> tests/errors/idint_real4.f90:2:14 | 2 | print *, idint(4.5) | ^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-program_without_line_05-1440b57.json0000664000175000017500000000100115174404631026041 0ustar alastairalastair{ "basename": "ast-program_without_line_05-1440b57", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/program_without_line_05.f90", "infile_hash": "808db970dd0ce4b65d56b9efbf2954ddc7f7a1c09417a583b2fce88a", "outfile": null, "outfile_hash": null, "stdout": "ast-program_without_line_05-1440b57.stdout", "stdout_hash": "6ee9a73b40d16d6c1602f39dd4d1d697cb02c3cd8afa0b4285f7824f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-arrays_04_func-9f59ad6.stdout0000664000175000017500000005467115174404631024670 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_04_func: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), abs: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 4 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) abs (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a)] [(Print (StringConstant "abs" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (RealCompare (Var 4 a) Gt (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) () ) (Logical 4) () ) [(Assignment (Var 4 r) (Var 4 a) () .false. .false. )] [(Assignment (Var 4 r) (RealUnaryMinus (Var 4 a) (Real 4) () ) () .false. .false. )] )] (Var 4 r) Public .false. .false. () ), b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sum: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 3 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sum (FunctionType [(Array (Real 4) [(() ())] DescriptorArray )] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Print (StringConstant "sum" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Assignment (Var 3 r) (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) () ) () .false. .false. ) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 3 a) () (Integer 4) () ) ()) [(Assignment (Var 3 r) (RealBinOp (Var 3 r) Add (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Real 4) ColMajor () ) (Real 4) () ) () .false. .false. )] [] )] (Var 3 r) Public .false. .false. () ) }) arrays_04_func [] [(Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 b) (FunctionCall 2 sum () [((ArrayPhysicalCast (Var 2 a) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () ))] (Real 4) () () ) () .false. .false. ) (If () (RealCompare (FunctionCall 2 abs () [((RealBinOp (Var 2 b) Sub (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 6.000000 (Real 4) ) () ) (Real 4) () ))] (Real 4) () () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-intrinsics_03-ef06d46.json0000664000175000017500000000076115174404631024145 0ustar alastairalastair{ "basename": "asr-intrinsics_03-ef06d46", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_03.f90", "infile_hash": "e7fb61db3237594018e226a4236884f778bd41ae0848c5667da97462", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_03-ef06d46.stdout", "stdout_hash": "677ab02e7733807f1e901916b27c3d790e7b40e970e7468bf6768d57", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-dlgama_arg-bfbc025.stderr0000664000175000017500000000026015174404631024125 0ustar alastairalastairsemantic error: Argument 1 of dlgama must be of double precision real type --> tests/errors/dlgama_arg.f90:2:14 | 2 | print *, dlgama(2.7) | ^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast_f90-flush1-1eb6a16.json0000664000175000017500000000072215174404631023324 0ustar alastairalastair{ "basename": "ast_f90-flush1-1eb6a16", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/flush1.f90", "infile_hash": "d0c80e1628d5fabcef4bf73ec7d228e08c9d37462c1a3bd0f08481d8", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-flush1-1eb6a16.stdout", "stdout_hash": "a40a28bcf97c7b1f6b2fa764363a1ce06bdcccead4f89d7ecab10aaf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-dependency_test_02-6d588ae.json0000664000175000017500000000075315174404631025143 0ustar alastairalastair{ "basename": "asr-dependency_test_02-6d588ae", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/dependency_test_02.f90", "infile_hash": "90fabf0105e9eee8d7001500b590bff2970e15d4abc43074d77349f1", "outfile": null, "outfile_hash": null, "stdout": "asr-dependency_test_02-6d588ae.stdout", "stdout_hash": "a57a23ddf821b066ee733dc00f0b5a0de53e8d6e32dbc10191ab3d9b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-auxiliary_IO_1-36af6ad.stdout0000664000175000017500000000240215174404631024715 0ustar alastairalastair(TranslationUnit [(Subroutine xub [(nunit)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(nunit [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(DoLoop 0 () 0 i 1 5 () [(Backspace 0 [nunit] [] () ) (Rewind 0 [nunit] [] () )] () () )] [] [] ) (Program main () [] [] [] [] [] )] ) lfortran-0.63.0/tests/reference/pass_global_stmts-global_scope3-a36d20b.json0000664000175000017500000000101415174404631027100 0ustar alastairalastair{ "basename": "pass_global_stmts-global_scope3-a36d20b", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope3.f90", "infile_hash": "60cea65abfbb2228d16f175ea192462ae2379d7a9da1601cb3de9f3a", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope3-a36d20b.stdout", "stdout_hash": "1f112dbf67b04440766911a49d4bc9c0e23f100ab9518f52691e82f1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-use_statement-bb26ff2.stdout0000664000175000017500000001236215174404631024764 0ustar alastairalastair(TranslationUnit [(Program use_statement (TriviaNode [(EndOfLine) (Comment "! AST" ) (Comment "! Syntax check only" )] [] ) [(Use [(SimpleAttribute AttrIntrinsic )] example [(UseSymbol rename name ) (UseSymbol RENAME NAME )] .true. () ) (Use [(SimpleAttribute AttrIntrinsic )] example [(IntrinsicOperator POW )] .true. () ) (Use [(SimpleAttribute AttrIntrinsic )] example [(IntrinsicOperator NOT )] .true. () ) (Use [(SimpleAttribute AttrIntrinsic )] example [(DefinedOperator "in" )] .true. () ) (Use [(SimpleAttribute AttrIntrinsic )] example [(RenameOperator "plus" "add" )] .true. () ) (Use [(SimpleAttribute AttrNon_Intrinsic )] example [] .false. () ) (Use [(SimpleAttribute AttrNon_Intrinsic )] EXAMPLE [] .false. () ) (Use [(SimpleAttribute AttrNon_Intrinsic )] example [(UseAssignment)] .true. () ) (Use [(SimpleAttribute AttrNon_Intrinsic )] example [(IntrinsicOperator EQ )] .true. () ) (Use [(SimpleAttribute AttrNon_Intrinsic )] example [(IntrinsicOperator OR )] .true. () ) (Use [(SimpleAttribute AttrNon_Intrinsic )] example [(DefinedOperator "definedoperator" )] .true. () ) (Use [] example [(IntrinsicOperator PLUS )] .true. () ) (Use [] example [(UseSymbol sample () )] .true. () ) (Use [] example [(UseSymbol rename sample )] .true. () ) (Use [] example [(IntrinsicOperator STAR )] .true. () ) (Use [] example [(IntrinsicOperator DIV )] .true. () ) (Use [] example [(IntrinsicOperator DIV )] .true. () ) (Use [] example [(IntrinsicOperator NOTEQ )] .true. () ) (Use [] example [(IntrinsicOperator GT )] .true. () ) (Use [] example [(IntrinsicOperator LTE )] .true. () ) (Use [] example [(IntrinsicOperator AND )] .true. () ) (Use [] example [(IntrinsicOperator EQV )] .true. () ) (Use [] example [(DefinedOperator "dot" )] .true. () ) (Use [] example [(UseWrite formatted )] .true. () ) (Use [] example [(UseRead unformatted )] .true. () ) (Use [] example [] .true. () ) (Use [] example [(RenameOperator "localDefop" "useDefop" ) (UseSymbol b a )] .false. () )] [] [] [] [] )] ) lfortran-0.63.0/tests/reference/pass_global_stmts-expr4-eea496b.stdout0000664000175000017500000002731515174404631026111 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] Local () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f2: (Variable 2 f2 [] Local () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f3: (Variable 2 f3 [] Local () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f4: (Variable 2 f4 [] Local () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f5: (Variable 2 f5 [] Local () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f6: (Variable 2 f6 [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] (Real 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 f1) (RealConstant 5.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 f2) (RealBinOp (RealConstant 5.000000 (Real 4) ) Add (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant 8.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 f3) (RealBinOp (RealBinOp (RealConstant 5.000000 (Real 4) ) Add (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant 8.000000 (Real 4) ) ) Mul (RealConstant 2.000000 (Real 4) ) (Real 4) (RealConstant 16.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 f4) (RealBinOp (RealConstant 5.000000 (Real 4) ) Add (RealBinOp (RealConstant 3.000000 (Real 4) ) Mul (RealConstant 2.000000 (Real 4) ) (Real 4) (RealConstant 6.000000 (Real 4) ) ) (Real 4) (RealConstant 11.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 f5) (RealBinOp (RealConstant 5.000000 (Real 4) ) Sub (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant 2.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 f6) (RealBinOp (RealConstant 4.000000 (Real 4) ) Pow (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant 64.000000 (Real 4) ) ) () .false. .false. )] (Var 2 f6) Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_struct_01-c320d7d.stdout0000664000175000017500000024437315174404631025547 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_struct_01: (Program (SymbolTable 15 { r: (ExternalSymbol 15 r 2 r template_struct_01_m [] r Public ), struct_t: (ExternalSymbol 15 struct_t 2 struct_t template_struct_01_m [] struct_t Public ), test_template: (ExternalSymbol 15 test_template 2 test_template template_struct_01_m [] test_template Public ) }) template_struct_01 [template_struct_01_m] [(SubroutineCall 15 test_template () [] () .false. )] ), template_struct_01_m: (Module (SymbolTable 2 { r: (Requirement (SymbolTable 3 { t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) r [t] [] ), struct_t: (Template (SymbolTable 4 { get_fst: (Function (SymbolTable 6 { 1_tuple_fst: (ExternalSymbol 6 1_tuple_fst 5 fst tuple [] fst Public ), p: (Variable 6 p [] In () () Default (StructType [(TypeParameter t ) (TypeParameter t )] [] .true. .false. ) 4 tuple Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 6 r [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_fst (FunctionType [(StructType [(TypeParameter t ) (TypeParameter t )] [] .true. .false. )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 p)] [(Assignment (Var 6 r) (StructInstanceMember (Var 6 p) 6 1_tuple_fst (TypeParameter t ) () ) () .false. .false. )] (Var 6 r) Private .true. .true. () ), get_snd: (Function (SymbolTable 7 { 1_tuple_snd: (ExternalSymbol 7 1_tuple_snd 5 snd tuple [] snd Public ), p: (Variable 7 p [] In () () Default (StructType [(TypeParameter t ) (TypeParameter t )] [] .true. .false. ) 4 tuple Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 7 r [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_snd (FunctionType [(StructType [(TypeParameter t ) (TypeParameter t )] [] .true. .false. )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 p)] [(Assignment (Var 7 r) (StructInstanceMember (Var 7 p) 7 1_tuple_snd (TypeParameter t ) () ) () .false. .false. )] (Var 7 r) Private .true. .true. () ), t: (Variable 4 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tuple: (Struct (SymbolTable 5 { fst: (Variable 5 fst [] Local () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), snd: (Variable 5 snd [] Local () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) tuple (StructType [(TypeParameter t ) (TypeParameter t )] [] .true. .false. ) [] [fst snd] [] Source Private .false. .false. [] () () [] ) }) struct_t [t] [(Require r [t] )] ), test_template: (Function (SymbolTable 8 { 1_int_tuple_fst: (ExternalSymbol 8 1_int_tuple_fst 9 fst int_tuple [] fst Public ), 1_int_tuple_snd: (ExternalSymbol 8 1_int_tuple_snd 9 snd int_tuple [] snd Public ), 1_real_tuple_fst: (ExternalSymbol 8 1_real_tuple_fst 12 fst real_tuple [] fst Public ), 1_real_tuple_snd: (ExternalSymbol 8 1_real_tuple_snd 12 snd real_tuple [] snd Public ), get_int_fst: (Function (SymbolTable 10 { 1_int_tuple_fst: (ExternalSymbol 10 1_int_tuple_fst 9 fst int_tuple [] fst Public ), p: (Variable 10 p [] In () () Default (StructType [] [] .true. .false. ) 8 int_tuple Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 10 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_int_fst (FunctionType [(StructType [] [] .true. .false. )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 p)] [(Assignment (Var 10 r) (StructInstanceMember (Var 10 p) 10 1_int_tuple_fst (Integer 4) () ) () .false. .false. )] (Var 10 r) Private .true. .true. () ), get_int_snd: (Function (SymbolTable 11 { 1_int_tuple_snd: (ExternalSymbol 11 1_int_tuple_snd 9 snd int_tuple [] snd Public ), p: (Variable 11 p [] In () () Default (StructType [] [] .true. .false. ) 8 int_tuple Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 11 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_int_snd (FunctionType [(StructType [] [] .true. .false. )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 p)] [(Assignment (Var 11 r) (StructInstanceMember (Var 11 p) 11 1_int_tuple_snd (Integer 4) () ) () .false. .false. )] (Var 11 r) Private .true. .true. () ), get_real_fst: (Function (SymbolTable 13 { 1_real_tuple_fst: (ExternalSymbol 13 1_real_tuple_fst 12 fst real_tuple [] fst Public ), p: (Variable 13 p [] In () () Default (StructType [] [] .true. .false. ) 8 real_tuple Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 13 r [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_real_fst (FunctionType [(StructType [] [] .true. .false. )] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 p)] [(Assignment (Var 13 r) (StructInstanceMember (Var 13 p) 13 1_real_tuple_fst (Real 4) () ) () .false. .false. )] (Var 13 r) Private .true. .true. () ), get_real_snd: (Function (SymbolTable 14 { 1_real_tuple_snd: (ExternalSymbol 14 1_real_tuple_snd 12 snd real_tuple [] snd Public ), p: (Variable 14 p [] In () () Default (StructType [] [] .true. .false. ) 8 real_tuple Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 14 r [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_real_snd (FunctionType [(StructType [] [] .true. .false. )] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 14 p)] [(Assignment (Var 14 r) (StructInstanceMember (Var 14 p) 14 1_real_tuple_snd (Real 4) () ) () .false. .false. )] (Var 14 r) Private .true. .true. () ), int_tuple: (Struct (SymbolTable 9 { fst: (Variable 9 fst [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), snd: (Variable 9 snd [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) int_tuple (StructType [] [] .true. .false. ) [] [fst snd] [] Source Private .false. .false. [] () () [] ), real_tuple: (Struct (SymbolTable 12 { fst: (Variable 12 fst [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), snd: (Variable 12 snd [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) real_tuple (StructType [] [] .true. .false. ) [] [fst snd] [] Source Private .false. .false. [] () () [] ), ti: (Variable 8 ti [] Local () () Default (StructType [] [] .true. .false. ) 8 int_tuple Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tr: (Variable 8 tr [] Local () () Default (StructType [] [] .true. .false. ) 8 real_tuple Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (StructInstanceMember (Var 8 ti) 8 1_int_tuple_fst (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(StringConstant "First element: " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 8 get_int_fst () [((Var 8 ti))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (StructInstanceMember (Var 8 ti) 8 1_int_tuple_snd (Integer 4) () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(StringConstant "Second element: " (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 8 get_int_snd () [((Var 8 ti))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (StructInstanceMember (Var 8 tr) 8 1_real_tuple_fst (Real 4) () ) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "First element: " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 8 get_real_fst () [((Var 8 tr))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (StructInstanceMember (Var 8 tr) 8 1_real_tuple_snd (Real 4) () ) (RealConstant 2.000000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Second element: " (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 8 get_real_snd () [((Var 8 tr))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_struct_01_m () [template_struct_01_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/run-exit2-f1f3b2c.stdout0000664000175000017500000000001215174404631023136 0ustar alastairalastair1 2 3 4 5 lfortran-0.63.0/tests/reference/asr-arrays_02_size-ab6ee62.stdout0000664000175000017500000002643115174404631024741 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), size_a4: (Variable 2 size_a4 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), size_a8: (Variable 2 size_a8 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), size_b4: (Variable 2 size_b4 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), size_b8: (Variable 2 size_b8 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) arrays_01 [] [(Assignment (Var 2 size_a4) (ArraySize (Var 2 a) () (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 size_b4) (ArraySize (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 size_a8) (ArraySize (Var 2 a) () (Integer 8) (IntegerConstant 3 (Integer 8) Decimal) ) () .false. .false. ) (Assignment (Var 2 size_b8) (ArraySize (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 8) (IntegerConstant 4 (Integer 8) Decimal) ) () .false. .false. ) (If () (IntegerCompare (Var 2 size_a4) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 size_b4) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 size_a8) NotEq (IntegerConstant 3 (Integer 8) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 size_b8) NotEq (IntegerConstant 4 (Integer 8) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-subroutine7-58db221.json0000664000175000017500000000072615174404631023656 0ustar alastairalastair{ "basename": "asr-subroutine7-58db221", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/subroutine7.f90", "infile_hash": "3a15750c9d608f1988e0dd13f8d956be28a72297be5ef3137777cf2f", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutine7-58db221.stdout", "stdout_hash": "e317920133b63b325fc3648cc63d8f0c56862b60b54adc3a02f63151", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-subroutines_04-a817e0c.json0000664000175000017500000000076415174404631024340 0ustar alastairalastair{ "basename": "asr-subroutines_04-a817e0c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_04.f90", "infile_hash": "c7f14f3cfe8c42ebbf006f4e20a30b517c9e2775e5af0f8853ae05e1", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutines_04-a817e0c.stdout", "stdout_hash": "380050dd38132ed3e1aae3267ce5ed5be85731addbe4517c9eebc029", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-character_03-a7476e8.json0000664000175000017500000000106515174404631023641 0ustar alastairalastair{ "basename": "asr-character_03-a7476e8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/warnings/character_03.f90", "infile_hash": "9aebb511b0914d6e70395b36170f563c3388431dde62d3b371aea47f", "outfile": null, "outfile_hash": null, "stdout": "asr-character_03-a7476e8.stdout", "stdout_hash": "2429a9dae52c6949c08c59f57257db71bf1d3057de71605ae736a9df", "stderr": "asr-character_03-a7476e8.stderr", "stderr_hash": "87a0cbd848901a22fd44c9062f5c50b8c0ad5d98cfd40bbb1b98ca0c", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-incompatible_ranks_allocatable_arr1-5e5233d.json0000664000175000017500000000104515174404631030502 0ustar alastairalastair{ "basename": "asr-incompatible_ranks_allocatable_arr1-5e5233d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incompatible_ranks_allocatable_arr1.f90", "infile_hash": "4a722df84efd62e9189918fa08cc3c83b07a5e0212279b928445e50f", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incompatible_ranks_allocatable_arr1-5e5233d.stderr", "stderr_hash": "79c08e23704f47177db0d6beec0f93b54006a5567f44b3424dc148be", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-defop1-f87dd80.json0000664000175000017500000000070715174404631022644 0ustar alastairalastair{ "basename": "ast-defop1-f87dd80", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/defop1.f90", "infile_hash": "78b29077fdb7303bc8002ba7f16a36ffa13a981527f87df53bf268e3", "outfile": null, "outfile_hash": null, "stdout": "ast-defop1-f87dd80.stdout", "stdout_hash": "a407b773da29a71a0f9991ffecdf946ecee8d8126b3a17d7407ea861", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-derived_types_03-2ad875a.stdout0000664000175000017500000000105615174404631025652 0ustar alastairalastairprogram derived_types_03 ! AST only do nn = 1, ndiag ing = diag(nn)%len allocate(diag(nn)%cell_id(ing), STAT=ierr) if (ierr /= 0) then return end if ndpwds = ndpwds + SIZE(diag(nn)%cell_id) end do do k = 1, nz do j = 1, ny do i = 1, ichunk nn = i + j + k - 2 indx(nn) = indx(nn) + 1 ing = indx(nn) diag(nn)%cell_id(ing)%ic = i diag(nn)%cell_id(ing)%j = j diag(nn)%cell_id(ing)%k = k end do end do end do end program derived_types_03 lfortran-0.63.0/tests/reference/asr-intrinsics_29-d4080f2.json0000664000175000017500000000076115174404631024066 0ustar alastairalastair{ "basename": "asr-intrinsics_29-d4080f2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_29.f90", "infile_hash": "16c52115980fa652cd9e0ade7a55786421b6801d678964a37095afbb", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_29-d4080f2.stdout", "stdout_hash": "94596b63db2144dcf4127f584537da5b7ba51f4219a655c8a74484c6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-kind_star_of_int-3ed778d.stderr0000664000175000017500000000022415174404631025325 0ustar alastairalastairsemantic error: Expected initialization expression for kind --> tests/errors/kind_star_of_int.f90:3:13 | 3 | integer(*) a | ^ lfortran-0.63.0/tests/reference/pass_flip_sign-flip_sign-16b288c.stdout0000664000175000017500000002223615174404631026134 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { flip_sign: (Program (SymbolTable 2 { eps: (Variable 2 eps [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), number: (Variable 2 number [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) flip_sign [] [(Assignment (Var 2 number) (IntegerConstant 123 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 5.500000 (Real 4) ) () .false. .false. ) (If () (IntegerCompare (IntrinsicElementalFunction Modulo [(Var 2 number) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4) ) (Real 4) (RealConstant -5.500000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 number) (IntegerConstant 124 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 5.500000 (Real 4) ) () .false. .false. ) (If () (IntegerCompare (IntrinsicElementalFunction Modulo [(Var 2 number) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-recursion_01-95eb32d.stdout0000664000175000017500000001447115174404631024527 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @__module___lcompilers_created__nested_context__sub1__x = global i32 0 @__module_recursion_01_n = global i32 0 @__module_recursion_01_x = global i32 0 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [12 x i8] c"S-DESC-4,I4\00", align 1 @string_const_data = private constant [4 x i8] c"x = " @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_recursion_01_sub1(i32* %x) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %1 = load i32, i32* %x, align 4 %2 = load i32, i32* @__module_recursion_01_n, align 4 %3 = icmp slt i32 %1, %2 br i1 %3, label %then, label %else then: ; preds = %.entry %4 = load i32, i32* %x, align 4 %5 = add i32 %4, 1 store i32 %5, i32* %x, align 4 %6 = alloca i64, align 8 %7 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.1, i32 0, i32 0), i64* %6, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const, i32* %x) %8 = load i64, i64* %6, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %7, i8** %9, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %8, i64* %10, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %12 = load i8*, i8** %11, align 8 %13 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %14 = load i64, i64* %13, align 8 %15 = trunc i64 %14 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %12, i32 %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %16 = icmp eq i8* %7, null br i1 %16, label %free_done, label %free_nonnull free_nonnull: ; preds = %then call void @_lfortran_free_alloc(i8* %0, i8* %7) br label %free_done free_done: ; preds = %free_nonnull, %then %17 = load i32, i32* %x, align 4 store i32 %17, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 call void @sub1.__module_recursion_01_sub2() %18 = load i32, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 store i32 %18, i32* %x, align 4 call void @__module_recursion_01_sub1(i32* %x) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %free_done br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_sub1 FINALIZE_SYMTABLE_sub1: ; preds = %return ret void } define void @sub1.__module_recursion_01_sub2() { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %1 = load i32, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 %2 = add i32 %1, 1 store i32 %2, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, i32* @__module___lcompilers_created__nested_context__sub1__x) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @__module_recursion_01_sub1(i32* @__module___lcompilers_created__nested_context__sub1__x) br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_sub2 FINALIZE_SYMTABLE_sub2: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) store i32 10, i32* @__module_recursion_01_n, align 4 call void @__module_recursion_01_sub1(i32* @__module_recursion_01_x) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/ast_f90-nullify1-b3931cb.stdout0000664000175000017500000000014415174404631024235 0ustar alastairalastairprogram nullify1 ! Tests for syntax (AST) only: nullify(a) nullify(a, b, c, d) end program nullify1 lfortran-0.63.0/tests/reference/run-format_28-d8cdd42.stdout0000664000175000017500000000065415174404631023726 0ustar alastairalastair 0.100E+00 0.200E+00 0.300E+00 0.400E+00 (A,ES6.2E1) ****** (A,ES7.2E1) ******* (A,ES8.2E1) ******** (A,ES9.2E1) ********* ****** ******* 3.00E+20 ********* ********** *********** 0.E+0 1.E+1 3.E+0 3.E+5 1.E+10 -1.E+10 ******* ******* 1.230E-40 -1.230E-40 1.23E+2 1.23E+02 1.23E+002 1.00E+02 1.00E+00 9.99E+00 +1.23E+2 1.23E+2 **** ***** 0.0E+0 0.E+0 .29E+03 .29E+03 0.29E+03 .29E+00 0.12E+13 ******* lfortran-0.63.0/tests/reference/asr-loop_unroll_large-c6b628b.stdout0000664000175000017500000001547015174404631025546 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { loop_unroll_large: (Program (SymbolTable 2 { array: (Variable 2 array [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), first: (Variable 2 first [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), last: (Variable 2 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) loop_unroll_large [] [(Allocate [((Var 2 array) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 35 (Integer 4) Decimal))] () () ())] () () () ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 35 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 35 (Integer 4) Decimal) ()) [(Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-forall1-88e2780.stderr0000664000175000017500000000057615174404631023703 0ustar alastairalastairstyle suggestion: Use '/=' instead of '.ne.' --> tests/forall1.f90:9:33 | 9 | forall (i=1:n, j=1:m, A(i,j).NE.0) & | ^^^^ help: write this as '/=' style suggestion: Use '/=' instead of '.ne.' --> tests/forall1.f90:36:34 | 36 | inner: forall (j=1:100, i.NE.j) | ^^^^ help: write this as '/=' lfortran-0.63.0/tests/reference/llvm-intent_01-6d96ec5.stdout0000664000175000017500000000732415174404631024026 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_dflt_intent_foo(float* %c, float* %d) { .entry: %e = alloca float, align 4 %g = alloca float, align 4 %0 = call float @foo.__module_dflt_intent_f(float* %c) store float %0, float* %e, align 4 %1 = call float @foo.__module_dflt_intent_f(float* %d) store float %1, float* %g, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_foo FINALIZE_SYMTABLE_foo: ; preds = %return ret void } define float @foo.__module_dflt_intent_f(float* %x) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %f = alloca float, align 4 %1 = load float, float* %x, align 4 %2 = fmul float 2.000000e+00, %1 store float %2, float* %f, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, float* %f) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return %14 = load float, float* %f, align 4 ret float %14 } declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value1 = alloca float, align 4 %call_arg_value = alloca float, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store float 0.000000e+00, float* %call_arg_value, align 4 store float 2.000000e+00, float* %call_arg_value1, align 4 call void @__module_dflt_intent_foo(float* %call_arg_value, float* %call_arg_value1) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-arrays_10-2bab681.json0000664000175000017500000000074515174404631023250 0ustar alastairalastair{ "basename": "asr-arrays_10-2bab681", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_10.f90", "infile_hash": "b3c01631350539e1272452b14a2768c4f8473cddd5c40b7fed0905ad", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_10-2bab681.stdout", "stdout_hash": "2afc69e8f2783b6930583522a23853d32212b78f5057cc5ac5a47740", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-continue_compilation_walrus-f3d9bd0.stderr0000664000175000017500000000061015174404631027675 0ustar alastairalastairsemantic error: Variable 'x' is already declared; use `=` for assignment to existing variables --> tests/errors/continue_compilation_walrus.f90:4:5 | 4 | x := 5 | ^ already declared semantic error: Variable 'y' is already declared; use `=` for assignment to existing variables --> tests/errors/continue_compilation_walrus.f90:6:5 | 6 | y := 10 | ^ already declared lfortran-0.63.0/tests/reference/run-array_bounds_check_09-afed6c8.stderr0000664000175000017500000000074115174404631026324 0ustar alastairalastairruntime error: Array shape mismatch in binary operation with operands '__libasr_created__integer_binop_' and '__libasr_created_integer_binop_right_'. Tried to match size 3 of dimension 1 of '__libasr_created__integer_binop_' with size 2 of dimension 1 of '__libasr_created_integer_binop_right_'. --> tests/errors/array_bounds_check_09.f90:12:9 | 12 | e = a + b + f(a) | ^^^^^ LHS size is 3 | 12 | e = a + b + f(a) | ^^^^ RHS size is 2 lfortran-0.63.0/tests/reference/ast-string_01-9625208.stdout0000664000175000017500000000171515174404631023420 0ustar alastairalastair(TranslationUnit [(Program print_01 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeCharacter [(len 7 Value)] () () None ) [] [(my_name [] [] () (String "Dominic" ()) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Print 0 () [(String "My name is " ()) my_name] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/asr-global_scope8-67fff8d.json0000664000175000017500000000073415174404631024273 0ustar alastairalastair{ "basename": "asr-global_scope8-67fff8d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope8.f90", "infile_hash": "899df30dee274279a699110fb9af2afad0b826c0abc886f9e2460627", "outfile": null, "outfile_hash": null, "stdout": "asr-global_scope8-67fff8d.stdout", "stdout_hash": "2ce0bcd26ba8b06ad6d895dd7b197d097dde85f4acf64c5adea96a2d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit9-b56b139.stderr0000664000175000017500000000176015174404631023630 0ustar alastairalastairstyle suggestion: Use integer(4) instead of integer*4 --> tests/implicit9.f90:3:17 | 3 | implicit integer*4 (d-e) | ^ help: write this as 'integer(4)' style suggestion: Use integer(8) instead of integer*8 --> tests/implicit9.f90:4:17 | 4 | implicit integer*8 (f-g) | ^ help: write this as 'integer(8)' style suggestion: Use real(4) instead of real*4 --> tests/implicit9.f90:6:14 | 6 | implicit real*4 (i-k) | ^ help: write this as 'real(4)' style suggestion: Use real(8) instead of real*8 --> tests/implicit9.f90:7:14 | 7 | implicit real*8 (l) | ^ help: write this as 'real(8)' style suggestion: Use complex(4) instead of complex*8 --> tests/implicit9.f90:9:17 | 9 | implicit complex*8 (o) | ^ help: write this as 'complex(4)' style suggestion: Use complex(8) instead of complex*16 --> tests/implicit9.f90:10:17 | 10 | implicit complex*16 (p) | ^ help: write this as 'complex(8)' lfortran-0.63.0/tests/reference/asr-where_01-c45f2da.json0000664000175000017500000000074215174404631023141 0ustar alastairalastair{ "basename": "asr-where_01-c45f2da", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/where_01.f90", "infile_hash": "b3e2251e4cd263f14db0266759a9af716dce48521dcd2f1e6eadce17", "outfile": null, "outfile_hash": null, "stdout": "asr-where_01-c45f2da.stdout", "stdout_hash": "7797cd5fff65cb4e26ea645172e78bb687c2156d28deb7297d972dbd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-namelist_02-5bdbd75.json0000664000175000017500000000075315174404631023652 0ustar alastairalastair{ "basename": "asr-namelist_02-5bdbd75", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/namelist_02.f90", "infile_hash": "676c2a3a920ec86c6b8bc131b75e1c30f569d36d9777674a7e196b62", "outfile": null, "outfile_hash": null, "stdout": "asr-namelist_02-5bdbd75.stdout", "stdout_hash": "020c389df03a1216d84dc7111cc48fd83175489c98239596ad369e04", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-allow_implicit_interface-68156ec.json0000664000175000017500000000102215174404631026420 0ustar alastairalastair{ "basename": "asr-allow_implicit_interface-68156ec", "cmd": "lfortran --show-asr --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/allow_implicit_interface.f90", "infile_hash": "3d73fa8cc6b2a34329665b09295d1469f049597c7ab7f0c1039e4370", "outfile": null, "outfile_hash": null, "stdout": "asr-allow_implicit_interface-68156ec.stdout", "stdout_hash": "2c4a7eed857090bcc0e6fece9507469fd34a39b844d67a21da9e5c63", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-boz_01-dedad59.stderr0000664000175000017500000000037715174404631023246 0ustar alastairalastairwarning: BOZ literal constant with 'Z' prefix truncated to maximum 16 characters from left to fit data type --> tests/../integration_tests/boz_01.f90:12:13 | 12 | boz_5 = int(Z'2234567890abcdef1') | ^^^^^^^^^^^^^^^^^^^^ BOZ truncation lfortran-0.63.0/tests/reference/asr-modules_29-dc71c55.json0000664000175000017500000000075015174404631023433 0ustar alastairalastair{ "basename": "asr-modules_29-dc71c55", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_29.f90", "infile_hash": "2a9083651faf952ebe886324158cd55b4361b02439b525dd54c1935c", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_29-dc71c55.stdout", "stdout_hash": "67bb521b9fa4d71f0e1a9bab26db3efa7d85645c08b16b5b9d5467e7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_19-26385d4.stdout0000664000175000017500000005752215174404631025056 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_module_19: (Module (SymbolTable 4 { check_proc: (Function (SymbolTable 7 { array: (Variable 7 array [] Local () () Default (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) 4 child_value Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ptr: (Variable 7 ptr [] Local () () Default (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) ) 4 toml_value Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~select_type_block_: (Block (SymbolTable 8 { 1_child_value_ok: (ExternalSymbol 8 1_child_value_ok 5 ok child_value [] ok Public ) }) ~select_type_block_ [(If () (StructInstanceMember (Cast (Var 7 ptr) ClassToStruct (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) () (Var 4 child_value) ) 8 1_child_value_ok (Logical 4) () ) [(Associate (Var 7 array) (Cast (Var 7 ptr) ClassToStruct (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) () (Var 4 child_value) ) )] [(SubroutineCall 4 not_ok () [] () .false. ) (Return)] )] ), ~select_type_block_1: (Block (SymbolTable 9 { }) ~select_type_block_1 [(SubroutineCall 4 default_class () [] () .false. ) (Return)] ) }) check_proc (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [not_ok default_class] [] [(If () (PointerAssociated (Var 7 ptr) () (Logical 4) () ) [(SelectType (Var 7 ptr) () [(TypeStmtName 4 child_value [(BlockCall -1 7 ~select_type_block_ )] )] [(BlockCall -1 7 ~select_type_block_1 )] )] [] )] () Public .true. .true. () ), child_value: (Struct (SymbolTable 5 { ok: (Variable 5 ok [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) child_value (StructType [(Logical 4)] [] .true. .false. ) [] [ok] [] Source Public .false. .false. [] () 4 toml_value [] ), default_class: (Function (SymbolTable 10 { }) default_class (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "default class" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), new: (GenericProcedure 4 new [4 check_proc] Public ), not_ok: (Function (SymbolTable 11 { }) not_ok (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "not ok" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), toml_value: (Struct (SymbolTable 6 { key: (Variable 6 key [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_value (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [key] [] Source Public .false. .true. [] () () [] ) }) derived_types_module_19 () [] .true. .false. .false. ), derived_types_module_19_1: (Module (SymbolTable 2 { check_here: (Function (SymbolTable 12 { }) check_here (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(SubroutineCall 2 check_proc () [] () .false. )] () Public .true. .true. () ), check_proc: (ExternalSymbol 2 check_proc 4 check_proc derived_types_module_19 [] check_proc Public ) }) derived_types_module_19_1 () [derived_types_module_19] .false. .false. .false. ), main: (Program (SymbolTable 13 { }) main [] [(Print (StringConstant "running derived_types_19 main program" (String 1 (IntegerConstant 37 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-intrinsics1-8ebce32.stderr0000664000175000017500000000027615174404631024334 0ustar alastairalastairsemantic error: Unexpected args, Radix expects (int) or (real) as arguments --> tests/errors/intrinsics1.f90:3:14 | 3 | print *, radix((2.4, 1.0)) | ^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-character_03-a7476e8.stderr0000664000175000017500000000031415174404631024167 0ustar alastairalastairstyle suggestion: Use character() instead of character*() --> tests/warnings/character_03.f90:3:5 | 3 | character*(2+3) str | ^^^^^^^^^^^^^^^ help: write this as 'character()' lfortran-0.63.0/tests/reference/ast-subroutines_10-c3e0d28.stdout0000664000175000017500000000666615174404631024717 0ustar alastairalastair(TranslationUnit [(Program subroutines_10 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeReal [] () () None ) [] [(x [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(SubroutineCall 0 subroutines_10_sub [] [(() x () 0) (() 3 () 0) (() () () 100) (() () () 200)] [] [] () ) (If 0 () (BoolOp (< x 0) And (> x 10) ) [(ErrorStop 0 () () () )] [] () () () ) (Stop 0 () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 100 () [(String "Negative input value" ())] () ) (ErrorStop 0 () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 200 () [(String "Input value too large" ())] () ) (ErrorStop 0 () () () )] [] ) (Subroutine subroutines_10_sub [(x) (i) (()) (())] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(i [] [] () () None ())] () )] [(If 0 () (< i 0) [(Return 0 1 () )] [] () () () ) (If 0 () (> i 10) [(Return 0 2 () )] [] () () () ) (Assignment 0 x i () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr_preprocess-unterminated_comment_01-a351b61.json0000664000175000017500000000103515174404631030343 0ustar alastairalastair{ "basename": "asr_preprocess-unterminated_comment_01-a351b61", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/unterminated_comment_01.f90", "infile_hash": "e5e7342c0979e8c39e8c08bc57ecf06531f4805499dd5907b1e8a624", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-unterminated_comment_01-a351b61.stderr", "stderr_hash": "dfdd308020e62292d3bb7aee51486f999e21edf5a2376e9c4fb0308f", "returncode": 2 }lfortran-0.63.0/tests/reference/wat-logical4-64da104.stdout0000664000175000017500000001340015174404631023432 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i32 i32) i32.const 2 i32.eqz i32.eqz local.set 0 i32.const -1 i32.eqz i32.eqz local.set 1 i32.const 0 i32.eqz i32.eqz local.set 2 local.get 0 i64.extend_i32_s call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 2 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-0.63.0/tests/reference/pass_do_loops-doloop_01-f2f0442.stdout0000664000175000017500000011772715174404631025626 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { doloop_01: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) doloop_01 [] [(Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 55 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 10 (Integer 4) Decimal) Sub (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Integer 4) () ) GtE (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 55 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 9 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 25 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 9 (Integer 4) Decimal) Sub (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) (Integer 4) () ) GtE (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 25 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 25 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 22 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 10 (Integer 4) Decimal) Sub (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) (Integer 4) () ) GtE (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 22 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Integer 4) () ) GtE (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 0 (Integer 4) Decimal) Sub (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Integer 4) () ) GtE (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-fixed_form_call2-28c0b82.stdout0000664000175000017500000002077415174404631025146 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { idd_frm: (Function (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 2 m [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), prinf: (Function (SymbolTable 3 { prinf_arg_0: (Variable 3 prinf_arg_0 [] Unspecified () () Default (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), prinf_arg_1: (Variable 3 prinf_arg_1 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) prinf (FunctionType [(String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 prinf_arg_0) (Var 3 prinf_arg_1)] [] () Public .false. .false. () ) }) idd_frm (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 m)] [(Assignment (Var 2 a) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 2 prinf () [((StringConstant "lw = *" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((IntegerConstant 1 (Integer 4) Decimal))] () .false. ) (SubroutineCall 2 prinf () [((StringConstant "16m+70 = *" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((IntegerConstant 1 (Integer 4) Decimal))] () .false. ) (Assignment (Var 2 m) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Return)] () Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/ast-program_without_line_01-96f2648.json0000664000175000017500000000100115174404631026057 0ustar alastairalastair{ "basename": "ast-program_without_line_01-96f2648", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/program_without_line_01.f90", "infile_hash": "516860f9855615c6727a984cf5f5ac39055860c9659a3dc0a17b814b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-program_without_line_01-96f2648.stderr", "stderr_hash": "58d3c9474a5ef269a382a3679ad492f6e66bd22f092ed9d04b945f16", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-nullify_02-3c7ee61.json0000664000175000017500000000075315174404631023626 0ustar alastairalastair{ "basename": "llvm-nullify_02-3c7ee61", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/nullify_02.f90", "infile_hash": "8603bbfc07290d14f0828e12a8b04c3521c007c844a4c901b4bb7483", "outfile": null, "outfile_hash": null, "stdout": "llvm-nullify_02-3c7ee61.stdout", "stdout_hash": "959785ce821d576c3d9dca04193993ccbd089dfc97b1a907d770b500", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-array2-9a93c4d.stdout0000664000175000017500000000642115174404631023225 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct f32_5_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; f32_5_1(Kokkos::View* data_): data{data_} {}; }; struct i32_3_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; i32_3_1(Kokkos::View* data_): data{data_} {}; }; struct f32_2_3_2 { Kokkos::View* data; dimension_descriptor dims[2]; bool is_allocated; f32_2_3_2(Kokkos::View* data_): data{data_} {}; }; struct i32_3_4_2 { Kokkos::View* data; dimension_descriptor dims[2]; bool is_allocated; i32_3_4_2(Kokkos::View* data_): data{data_} {}; }; struct f32_2_3_4_3 { Kokkos::View* data; dimension_descriptor dims[3]; bool is_allocated; f32_2_3_4_3(Kokkos::View* data_): data{data_} {}; }; struct i32_3_4_3_3 { Kokkos::View* data; dimension_descriptor dims[3]; bool is_allocated; i32_3_4_3_3(Kokkos::View* data_): data{data_} {}; }; // Forward declarations namespace { } // Implementations namespace { void main2() { Kokkos::View a_data("a_data", 5); f32_5_1 a_value(&a_data); f32_5_1* a = &a_value; a->dims[0].lower_bound = 1; a->dims[0].length = 5; Kokkos::View b_data("b_data", 5); f32_5_1 b_value(&b_data); f32_5_1* b = &b_value; b->dims[0].lower_bound = 1; b->dims[0].length = 5; Kokkos::View c_data("c_data", 3); i32_3_1 c_value(&c_data); i32_3_1* c = &c_value; c->dims[0].lower_bound = 1; c->dims[0].length = 3; Kokkos::View& d; Kokkos::View e_data("e_data", 6); f32_2_3_2 e_value(&e_data); f32_2_3_2* e = &e_value; e->dims[0].lower_bound = 1; e->dims[0].length = 2; e->dims[1].lower_bound = 1; e->dims[1].length = 3; Kokkos::View f_data("f_data", 12); i32_3_4_2 f_value(&f_data); i32_3_4_2* f = &f_value; f->dims[0].lower_bound = 1; f->dims[0].length = 3; f->dims[1].lower_bound = 1; f->dims[1].length = 4; Kokkos::View& g; Kokkos::View h_data("h_data", 24); f32_2_3_4_3 h_value(&h_data); f32_2_3_4_3* h = &h_value; h->dims[0].lower_bound = 1; h->dims[0].length = 2; h->dims[1].lower_bound = 1; h->dims[1].length = 3; h->dims[2].lower_bound = 1; h->dims[2].length = 4; Kokkos::View i_data("i_data", 36); i32_3_4_3_3 i_value(&i_data); i32_3_4_3_3* i = &i_value; i->dims[0].lower_bound = 1; i->dims[0].length = 3; i->dims[1].lower_bound = 1; i->dims[1].length = 4; i->dims[2].lower_bound = 1; i->dims[2].length = 3; Kokkos::View& j; } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/asr-array12-cb81afc.json0000664000175000017500000000071215174404631023064 0ustar alastairalastair{ "basename": "asr-array12-cb81afc", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/array12.f90", "infile_hash": "b9b95dd8f4cf55a5f7617a1df8fcf515fb405c1cd64c198005f33617", "outfile": null, "outfile_hash": null, "stdout": "asr-array12-cb81afc.stdout", "stdout_hash": "2f3eb812fa0873bac9df9b9ac422499f2db9f1aebb803a6e747c8665", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-array_bounds_check_08-7f7acdd.json0000664000175000017500000000074315174404631025772 0ustar alastairalastair{ "basename": "run-array_bounds_check_08-7f7acdd", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_08.f90", "infile_hash": "5b4ee4c8e59df328ecfe694741c18176b47b4000ad17c194947834c4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_08-7f7acdd.stderr", "stderr_hash": "7fb62960dade1600e1cf0acd5b662e743ff3a0fd12ae711d0286a5f8", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-implied_do_loops3-1dce8fd.json0000664000175000017500000000077515174404631025227 0ustar alastairalastair{ "basename": "asr-implied_do_loops3-1dce8fd", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/implied_do_loops3.f90", "infile_hash": "77a6a1521629dd10e76d0ea911c82c418bdf86f5c4f6d7b45e9e7d23", "outfile": null, "outfile_hash": null, "stdout": "asr-implied_do_loops3-1dce8fd.stdout", "stdout_hash": "ec7b625dbac68ed01fbbbb3f2ec5079f7a9bacedfb207966ad9047f3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_02-f2b519f.json0000664000175000017500000000072415174404631023074 0ustar alastairalastair{ "basename": "asr-array_02-f2b519f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_02.f90", "infile_hash": "8a51160d53f16bf9016e09ee1d74a1b589515e57b37d097c26e52b1a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_02-f2b519f.stderr", "stderr_hash": "5b69fda59876bd0f57004f8ef6e27919bcdc33b5f3ca35c01fdad382", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-block_02-82f9e5f.json0000664000175000017500000000106115174404631023057 0ustar alastairalastair{ "basename": "ast-block_02-82f9e5f", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/block_02.f90", "infile_hash": "454b633240fa00d44de1b5374429d3d7edc1c37ccd92b8b93394d639", "outfile": null, "outfile_hash": null, "stdout": "ast-block_02-82f9e5f.stdout", "stdout_hash": "45b1d45576c28eacf2c4b9ef1ae02297750db8b8b742647b258304bf", "stderr": "ast-block_02-82f9e5f.stderr", "stderr_hash": "60488b7fcd202fd28a9fb7045091257667eed65fe1dec8040b9c2871", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-nested_struct_proc_01-3b9017b.stdout0000664000175000017500000026557315174404631026167 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { gftl2_integer32complex32orderedmap: (Module (SymbolTable 2 { atomic_int_kind: (ExternalSymbol 2 atomic_int_kind 4 atomic_int_kind lfortran_intrinsic_iso_fortran_env [] atomic_int_kind Public ), atomic_logical_kind: (ExternalSymbol 2 atomic_logical_kind 4 atomic_logical_kind lfortran_intrinsic_iso_fortran_env [] atomic_logical_kind Public ), character_kinds: (ExternalSymbol 2 character_kinds 4 character_kinds lfortran_intrinsic_iso_fortran_env [] character_kinds Public ), character_storage_size: (ExternalSymbol 2 character_storage_size 4 character_storage_size lfortran_intrinsic_iso_fortran_env [] character_storage_size Public ), compiler_options: (ExternalSymbol 2 compiler_options 4 compiler_options lfortran_intrinsic_iso_fortran_env [] compiler_options Public ), compiler_version: (ExternalSymbol 2 compiler_version 4 compiler_version lfortran_intrinsic_iso_fortran_env [] compiler_version Public ), current_team: (ExternalSymbol 2 current_team 4 current_team lfortran_intrinsic_iso_fortran_env [] current_team Public ), error_unit: (ExternalSymbol 2 error_unit 4 error_unit lfortran_intrinsic_iso_fortran_env [] error_unit Public ), file_storage_size: (ExternalSymbol 2 file_storage_size 4 file_storage_size lfortran_intrinsic_iso_fortran_env [] file_storage_size Public ), i32: (Variable 2 i32 [int32] Local (Var 2 int32) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), initial_team: (ExternalSymbol 2 initial_team 4 initial_team lfortran_intrinsic_iso_fortran_env [] initial_team Public ), input_unit: (ExternalSymbol 2 input_unit 4 input_unit lfortran_intrinsic_iso_fortran_env [] input_unit Public ), int16: (ExternalSymbol 2 int16 4 int16 lfortran_intrinsic_iso_fortran_env [] int16 Public ), int32: (ExternalSymbol 2 int32 4 int32 lfortran_intrinsic_iso_fortran_env [] int32 Public ), int64: (ExternalSymbol 2 int64 4 int64 lfortran_intrinsic_iso_fortran_env [] int64 Public ), int8: (ExternalSymbol 2 int8 4 int8 lfortran_intrinsic_iso_fortran_env [] int8 Public ), integer32complex32orderedmap: (Struct (SymbolTable 9 { insert: (GenericProcedure 9 insert [9 insert_key_value] Public ), insert_key_value: (StructMethodDeclaration 9 insert_key_value () omap_insert_key_value 2 omap_insert_key_value Source .false. .false. ), map: (Variable 9 map [] Local () () Default (StructType [(StructType [] [] .true. .false. ) (Complex 4)] [] .true. .false. ) 2 omap_map Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) integer32complex32orderedmap (StructType [(StructType [(StructType [] [] .true. .false. ) (Complex 4)] [] .true. .false. )] [] .true. .false. ) [omap_map] [map] [] Source Private .false. .false. [] () () [] ), integer_kinds: (ExternalSymbol 2 integer_kinds 4 integer_kinds lfortran_intrinsic_iso_fortran_env [] integer_kinds Public ), iostat_end: (ExternalSymbol 2 iostat_end 4 iostat_end lfortran_intrinsic_iso_fortran_env [] iostat_end Public ), iostat_eor: (ExternalSymbol 2 iostat_eor 4 iostat_eor lfortran_intrinsic_iso_fortran_env [] iostat_eor Public ), iostat_inquire_internal_unit: (ExternalSymbol 2 iostat_inquire_internal_unit 4 iostat_inquire_internal_unit lfortran_intrinsic_iso_fortran_env [] iostat_inquire_internal_unit Public ), logical16: (ExternalSymbol 2 logical16 4 logical16 lfortran_intrinsic_iso_fortran_env [] logical16 Public ), logical32: (ExternalSymbol 2 logical32 4 logical32 lfortran_intrinsic_iso_fortran_env [] logical32 Public ), logical64: (ExternalSymbol 2 logical64 4 logical64 lfortran_intrinsic_iso_fortran_env [] logical64 Public ), logical8: (ExternalSymbol 2 logical8 4 logical8 lfortran_intrinsic_iso_fortran_env [] logical8 Public ), logical_kinds: (ExternalSymbol 2 logical_kinds 4 logical_kinds lfortran_intrinsic_iso_fortran_env [] logical_kinds Public ), numeric_storage_size: (ExternalSymbol 2 numeric_storage_size 4 numeric_storage_size lfortran_intrinsic_iso_fortran_env [] numeric_storage_size Public ), omap_i_at_rc: (Function (SymbolTable 10 { 1_omap_map_stored_value: (ExternalSymbol 10 1_omap_map_stored_value 8 stored_value omap_map [] stored_value Public ), key: (Variable 10 key [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rc: (Variable 10 rc [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 10 res [] ReturnVar () () Default (Pointer (Complex 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), this: (Variable 10 this [] In () () Default (StructType [(StructType [] [] .true. .false. ) (Complex 4)] [] .false. .false. ) 2 omap_map Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ) }) omap_i_at_rc (FunctionType [(StructType [(StructType [] [] .true. .false. ) (Complex 4)] [] .false. .false. ) (Integer 4) (Integer 4)] (Pointer (Complex 4) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 this) (Var 10 key) (Var 10 rc)] [(Associate (Var 10 res) (StructInstanceMember (Var 10 this) 10 1_omap_map_stored_value (Complex 4) () ) ) (Assignment (Var 10 rc) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 10 res) Public .true. .true. () ), omap_i_set: (Struct (SymbolTable 7 { }) omap_i_set (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () () [] ), omap_insert_key_value: (Function (SymbolTable 11 { 1_integer32complex32orderedmap_map: (ExternalSymbol 11 1_integer32complex32orderedmap_map 9 map integer32complex32orderedmap [] map Public ), 1_omap_map_omap_i_at_rc: (ExternalSymbol 11 1_omap_map_omap_i_at_rc 8 at_rc omap_map [] at_rc Public ), 1_omap_map_stored_value: (ExternalSymbol 11 1_omap_map_stored_value 8 stored_value omap_map [] stored_value Public ), key: (Variable 11 key [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), status: (Variable 11 status [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), this: (Variable 11 this [] InOut () () Default (StructType [(StructType [(StructType [] [] .true. .false. ) (Complex 4)] [] .true. .false. )] [] .false. .false. ) 2 integer32complex32orderedmap Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 11 tmp [] Local () () Default (Pointer (Complex 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tol: (Variable 11 tol [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), value: (Variable 11 value [] In () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omap_insert_key_value (FunctionType [(StructType [(StructType [(StructType [] [] .true. .false. ) (Complex 4)] [] .true. .false. )] [] .false. .false. ) (Integer 4) (Complex 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 this) (Var 11 key) (Var 11 value)] [(Assignment (StructInstanceMember (StructInstanceMember (Var 11 this) 11 1_integer32complex32orderedmap_map (StructType [(StructType [] [] .true. .false. ) (Complex 4)] [] .true. .false. ) () ) 11 1_omap_map_stored_value (Complex 4) () ) (Var 11 value) () .false. .false. ) (Associate (Var 11 tmp) (FunctionCall 11 1_omap_map_omap_i_at_rc () [((StructInstanceMember (Var 11 this) 11 1_integer32complex32orderedmap_map (StructType [(StructType [] [] .true. .false. ) (Complex 4)] [] .true. .false. ) () )) ((Var 11 key)) ((Var 11 status))] (Pointer (Complex 4) ) () (StructInstanceMember (Var 11 this) 11 1_integer32complex32orderedmap_map (StructType [(StructType [] [] .true. .false. ) (Complex 4)] [] .true. .false. ) () ) ) ) (If () (LogicalBinOp (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Real [(Var 11 tmp)] 0 (Real 4) () ) Sub (IntrinsicElementalFunction Real [(Var 11 value)] 0 (Real 4) () ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 11 tol) (Logical 4) () ) Or (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Aimag [(Var 11 tmp)] 0 (Real 4) () ) Sub (IntrinsicElementalFunction Aimag [(Var 11 value)] 0 (Real 4) () ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 11 tol) (Logical 4) () ) (Logical 4) () ) [(Print (StringConstant "Test failed: tmp does not match value" (String 1 (IntegerConstant 37 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] [] )] () Public .false. .false. () ), omap_map: (Struct (SymbolTable 8 { at: (GenericProcedure 8 at [8 at_rc] Public ), at_rc: (StructMethodDeclaration 8 at_rc () omap_i_at_rc 2 omap_i_at_rc Source .false. .false. ), stored_value: (Variable 8 stored_value [] Local () () Default (Complex 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tree: (Variable 8 tree [] Local () () Default (StructType [] [] .true. .false. ) 2 omap_i_set Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omap_map (StructType [(StructType [] [] .true. .false. ) (Complex 4)] [] .true. .false. ) [omap_i_set] [tree stored_value] [] Source Private .false. .false. [] () () [] ), output_unit: (ExternalSymbol 2 output_unit 4 output_unit lfortran_intrinsic_iso_fortran_env [] output_unit Public ), parent_team: (ExternalSymbol 2 parent_team 4 parent_team lfortran_intrinsic_iso_fortran_env [] parent_team Public ), r32: (Variable 2 r32 [real32] Local (Var 2 real32) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), real128: (ExternalSymbol 2 real128 4 real128 lfortran_intrinsic_iso_fortran_env [] real128 Public ), real16: (ExternalSymbol 2 real16 4 real16 lfortran_intrinsic_iso_fortran_env [] real16 Public ), real32: (ExternalSymbol 2 real32 4 real32 lfortran_intrinsic_iso_fortran_env [] real32 Public ), real64: (ExternalSymbol 2 real64 4 real64 lfortran_intrinsic_iso_fortran_env [] real64 Public ), real_kinds: (ExternalSymbol 2 real_kinds 4 real_kinds lfortran_intrinsic_iso_fortran_env [] real_kinds Public ), stat_failed_image: (ExternalSymbol 2 stat_failed_image 4 stat_failed_image lfortran_intrinsic_iso_fortran_env [] stat_failed_image Public ), stat_locked: (ExternalSymbol 2 stat_locked 4 stat_locked lfortran_intrinsic_iso_fortran_env [] stat_locked Public ), stat_locked_other_image: (ExternalSymbol 2 stat_locked_other_image 4 stat_locked_other_image lfortran_intrinsic_iso_fortran_env [] stat_locked_other_image Public ), stat_stopped_image: (ExternalSymbol 2 stat_stopped_image 4 stat_stopped_image lfortran_intrinsic_iso_fortran_env [] stat_stopped_image Public ), stat_unlocked: (ExternalSymbol 2 stat_unlocked 4 stat_unlocked lfortran_intrinsic_iso_fortran_env [] stat_unlocked Public ), stat_unlocked_failed_image: (ExternalSymbol 2 stat_unlocked_failed_image 4 stat_unlocked_failed_image lfortran_intrinsic_iso_fortran_env [] stat_unlocked_failed_image Public ) }) gftl2_integer32complex32orderedmap () [iso_fortran_env gftl2_integer32complex32orderedmap] .false. .false. .false. ), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), nested_struct_proc_01: (Program (SymbolTable 12 { 1_insert: (ExternalSymbol 12 1_insert 9 insert integer32complex32orderedmap [] insert Private ), 1_integer32complex32orderedmap_omap_insert_key_value: (ExternalSymbol 12 1_integer32complex32orderedmap_omap_insert_key_value 9 insert_key_value integer32complex32orderedmap [] insert_key_value Public ), atomic_int_kind: (ExternalSymbol 12 atomic_int_kind 4 atomic_int_kind lfortran_intrinsic_iso_fortran_env [] atomic_int_kind Public ), atomic_logical_kind: (ExternalSymbol 12 atomic_logical_kind 4 atomic_logical_kind lfortran_intrinsic_iso_fortran_env [] atomic_logical_kind Public ), character_kinds: (ExternalSymbol 12 character_kinds 4 character_kinds lfortran_intrinsic_iso_fortran_env [] character_kinds Public ), character_storage_size: (ExternalSymbol 12 character_storage_size 4 character_storage_size lfortran_intrinsic_iso_fortran_env [] character_storage_size Public ), compiler_options: (ExternalSymbol 12 compiler_options 4 compiler_options lfortran_intrinsic_iso_fortran_env [] compiler_options Public ), compiler_version: (ExternalSymbol 12 compiler_version 4 compiler_version lfortran_intrinsic_iso_fortran_env [] compiler_version Public ), current_team: (ExternalSymbol 12 current_team 4 current_team lfortran_intrinsic_iso_fortran_env [] current_team Public ), error_unit: (ExternalSymbol 12 error_unit 4 error_unit lfortran_intrinsic_iso_fortran_env [] error_unit Public ), file_storage_size: (ExternalSymbol 12 file_storage_size 4 file_storage_size lfortran_intrinsic_iso_fortran_env [] file_storage_size Public ), i32: (ExternalSymbol 12 i32 2 i32 gftl2_integer32complex32orderedmap [] i32 Public ), initial_team: (ExternalSymbol 12 initial_team 4 initial_team lfortran_intrinsic_iso_fortran_env [] initial_team Public ), input_unit: (ExternalSymbol 12 input_unit 4 input_unit lfortran_intrinsic_iso_fortran_env [] input_unit Public ), int16: (ExternalSymbol 12 int16 4 int16 lfortran_intrinsic_iso_fortran_env [] int16 Public ), int32: (ExternalSymbol 12 int32 4 int32 lfortran_intrinsic_iso_fortran_env [] int32 Public ), int64: (ExternalSymbol 12 int64 4 int64 lfortran_intrinsic_iso_fortran_env [] int64 Public ), int8: (ExternalSymbol 12 int8 4 int8 lfortran_intrinsic_iso_fortran_env [] int8 Public ), integer32complex32orderedmap: (ExternalSymbol 12 integer32complex32orderedmap 2 integer32complex32orderedmap gftl2_integer32complex32orderedmap [] integer32complex32orderedmap Public ), integer_kinds: (ExternalSymbol 12 integer_kinds 4 integer_kinds lfortran_intrinsic_iso_fortran_env [] integer_kinds Public ), iostat_end: (ExternalSymbol 12 iostat_end 4 iostat_end lfortran_intrinsic_iso_fortran_env [] iostat_end Public ), iostat_eor: (ExternalSymbol 12 iostat_eor 4 iostat_eor lfortran_intrinsic_iso_fortran_env [] iostat_eor Public ), iostat_inquire_internal_unit: (ExternalSymbol 12 iostat_inquire_internal_unit 4 iostat_inquire_internal_unit lfortran_intrinsic_iso_fortran_env [] iostat_inquire_internal_unit Public ), key: (Variable 12 key [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), logical16: (ExternalSymbol 12 logical16 4 logical16 lfortran_intrinsic_iso_fortran_env [] logical16 Public ), logical32: (ExternalSymbol 12 logical32 4 logical32 lfortran_intrinsic_iso_fortran_env [] logical32 Public ), logical64: (ExternalSymbol 12 logical64 4 logical64 lfortran_intrinsic_iso_fortran_env [] logical64 Public ), logical8: (ExternalSymbol 12 logical8 4 logical8 lfortran_intrinsic_iso_fortran_env [] logical8 Public ), logical_kinds: (ExternalSymbol 12 logical_kinds 4 logical_kinds lfortran_intrinsic_iso_fortran_env [] logical_kinds Public ), my_map: (Variable 12 my_map [] Local () () Default (StructType [(StructType [(StructType [] [] .true. .false. ) (Complex 4)] [] .true. .false. )] [] .true. .false. ) 12 integer32complex32orderedmap Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), numeric_storage_size: (ExternalSymbol 12 numeric_storage_size 4 numeric_storage_size lfortran_intrinsic_iso_fortran_env [] numeric_storage_size Public ), omap_i_at_rc: (ExternalSymbol 12 omap_i_at_rc 2 omap_i_at_rc gftl2_integer32complex32orderedmap [] omap_i_at_rc Public ), omap_i_set: (ExternalSymbol 12 omap_i_set 2 omap_i_set gftl2_integer32complex32orderedmap [] omap_i_set Public ), omap_insert_key_value: (ExternalSymbol 12 omap_insert_key_value 2 omap_insert_key_value gftl2_integer32complex32orderedmap [] omap_insert_key_value Public ), omap_map: (ExternalSymbol 12 omap_map 2 omap_map gftl2_integer32complex32orderedmap [] omap_map Public ), output_unit: (ExternalSymbol 12 output_unit 4 output_unit lfortran_intrinsic_iso_fortran_env [] output_unit Public ), parent_team: (ExternalSymbol 12 parent_team 4 parent_team lfortran_intrinsic_iso_fortran_env [] parent_team Public ), r32: (ExternalSymbol 12 r32 2 r32 gftl2_integer32complex32orderedmap [] r32 Public ), real128: (ExternalSymbol 12 real128 4 real128 lfortran_intrinsic_iso_fortran_env [] real128 Public ), real16: (ExternalSymbol 12 real16 4 real16 lfortran_intrinsic_iso_fortran_env [] real16 Public ), real32: (ExternalSymbol 12 real32 4 real32 lfortran_intrinsic_iso_fortran_env [] real32 Public ), real64: (ExternalSymbol 12 real64 4 real64 lfortran_intrinsic_iso_fortran_env [] real64 Public ), real_kinds: (ExternalSymbol 12 real_kinds 4 real_kinds lfortran_intrinsic_iso_fortran_env [] real_kinds Public ), stat_failed_image: (ExternalSymbol 12 stat_failed_image 4 stat_failed_image lfortran_intrinsic_iso_fortran_env [] stat_failed_image Public ), stat_locked: (ExternalSymbol 12 stat_locked 4 stat_locked lfortran_intrinsic_iso_fortran_env [] stat_locked Public ), stat_locked_other_image: (ExternalSymbol 12 stat_locked_other_image 4 stat_locked_other_image lfortran_intrinsic_iso_fortran_env [] stat_locked_other_image Public ), stat_stopped_image: (ExternalSymbol 12 stat_stopped_image 4 stat_stopped_image lfortran_intrinsic_iso_fortran_env [] stat_stopped_image Public ), stat_unlocked: (ExternalSymbol 12 stat_unlocked 4 stat_unlocked lfortran_intrinsic_iso_fortran_env [] stat_unlocked Public ), stat_unlocked_failed_image: (ExternalSymbol 12 stat_unlocked_failed_image 4 stat_unlocked_failed_image lfortran_intrinsic_iso_fortran_env [] stat_unlocked_failed_image Public ), value: (Variable 12 value [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) nested_struct_proc_01 [gftl2_integer32complex32orderedmap] [(Assignment (Var 12 key) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 12 value) (ComplexConstructor (RealConstant 2.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) (Complex 4) (ComplexConstant 2.000000 4.000000 (Complex 4) ) ) () .false. .false. ) (SubroutineCall 12 1_integer32complex32orderedmap_omap_insert_key_value 12 1_insert [((Var 12 my_map)) ((Var 12 key)) ((Var 12 value))] (Var 12 my_map) .false. ) (Print (StringConstant "Test passed" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-do_concurrent2-80c03e1.stdout0000664000175000017500000001103715174404631024662 0ustar alastairalastair(TranslationUnit [(Subroutine do_concurrent2 [(a) (b)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent InOut )] [(a [(() () DimensionExpr)] [] () () None ()) (b [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(x [] [] () () None ())] () )] [(Assignment 0 x (Real "1.0") () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 10 () )] () [(ConcurrentShared [i] ) (ConcurrentLocal [x] ) (ConcurrentDefault)] [(If 0 () (> (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) 0) [(Assignment 0 x (FuncCallOrArray sqrt [] [(() (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) () 0)] [] [] [] ) () ) (Assignment 0 (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (- (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (** x 2)) () )] [] () () () ) (Assignment 0 (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) (- (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () ) (Print 0 () [x] () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-scopes1-502009a.json0000664000175000017500000000071215174404631022651 0ustar alastairalastair{ "basename": "asr-scopes1-502009a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/scopes1.f90", "infile_hash": "48ffe7d9bb1021077b7bec62634ec2682cbfc211123626d338ba0c9e", "outfile": null, "outfile_hash": null, "stdout": "asr-scopes1-502009a.stdout", "stdout_hash": "dc0114257cfa6ee0f446aaa583b4456b56e3f85df06347c039b8f2e9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-complex_01-e4954b1.json0000664000175000017500000000076315174404631024026 0ustar alastairalastair{ "basename": "ast_f90-complex_01-e4954b1", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/complex_01.f90", "infile_hash": "e94aebc987a1655b49e1e31229a6c24ccdbed83af0ebf6a0fb4684f2", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-complex_01-e4954b1.stdout", "stdout_hash": "9b5ef2a8f61a2e9ab570290bdd332045b33d0222f0b927bdf95114d7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-program_without_line_01-9cd45b3.stdout0000664000175000017500000000032715174404631026567 0ustar alastairalastair(TranslationUnit [(Program __xx_main () [] [] [] [(Print 0 () [(String "OK" ())] () )] [] )] ) lfortran-0.63.0/tests/reference/run-integerStringInput_64-3a7e5be.json0000664000175000017500000000074315174404631025727 0ustar alastairalastair{ "basename": "run-integerStringInput_64-3a7e5be", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/integerStringInput_64.f90", "infile_hash": "f64bda10179c74236d1e5aed88b279a5fa1d47231c976efa21b29044", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-integerStringInput_64-3a7e5be.stderr", "stderr_hash": "a8801ddcef42e2cf0df91ce1df2173349f8ccd709a87344df4d3b184", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-loop_test2-82d82ea.json0000664000175000017500000000073615174404631023551 0ustar alastairalastair{ "basename": "asr-loop_test2-82d82ea", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/loop_test2.f", "infile_hash": "b0c94f235f33da51d9037d0833df0c1ca4aaef4f3a3a29c9426ba51b", "outfile": null, "outfile_hash": null, "stdout": "asr-loop_test2-82d82ea.stdout", "stdout_hash": "358de19705659479759d4b735c641b40e43b581f27ca2e147bcf510c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-external_03-c3442bb.stdout0000664000175000017500000000641215174404631024324 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @a(float (float*)* %f) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %call_arg_value = alloca float, align 4 %r = alloca float, align 4 store float 2.000000e+00, float* %call_arg_value, align 4 %1 = call float %f(float* %call_arg_value) store float %1, float* %r, align 4 %2 = alloca i64, align 8 %3 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, i32 0, i32 0, i32 0, float* %r) %4 = load i64, i64* %2, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 8 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_a FINALIZE_SYMTABLE_a: ; preds = %return ret void } declare float @f(float*) define void @b() { .entry: call void @a(float (float*)* @f.1) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return ret void } declare float @f.1(float*) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @b() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_external_03 FINALIZE_SYMTABLE_external_03: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/ast-data_02-fe19614.json0000664000175000017500000000073715174404631022616 0ustar alastairalastair{ "basename": "ast-data_02-fe19614", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/data_02.f90", "infile_hash": "38cac3153aba0224cd8982c9326d700c6f0fa2425261d221953566e8", "outfile": null, "outfile_hash": null, "stdout": "ast-data_02-fe19614.stdout", "stdout_hash": "dc55022c2cd5a625c9bbb0a2aefa59ccf2efa42630ce0d5e90fc2609", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-cpp1-515bcd9.stderr0000664000175000017500000000024015174404631025106 0ustar alastairalastairsemantic error: Variable 'z12345678' is not declared --> tests/errors/cpp1.f90:7:13 | 7 | print *, x, X123, y | ^^^^ 'z12345678' is undeclared lfortran-0.63.0/tests/reference/llvm-print_01-63a0480.json0000664000175000017500000000074515174404631023130 0ustar alastairalastair{ "basename": "llvm-print_01-63a0480", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/print_01.f90", "infile_hash": "060acad8d292efd077defbe08288b2a97e3c32803df2e0d62edd5654", "outfile": null, "outfile_hash": null, "stdout": "llvm-print_01-63a0480.stdout", "stdout_hash": "bca6cea51335c5187634d6e542f0a229bad230ee8efda6c99b9b1591", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixed_form_1-3be6d43.json0000664000175000017500000000075315174404631024017 0ustar alastairalastair{ "basename": "ast-fixed_form_1-3be6d43", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/fixed_form_1.f", "infile_hash": "20f5de5731f83348f8c0c349bd114289e4a854a74f41d0a9a0d35903", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-fixed_form_1-3be6d43.stderr", "stderr_hash": "5e8f3c9a30fc2cf296386482a81ce2b336d5efbd98ead7d9521cfd2b", "returncode": 2 }lfortran-0.63.0/tests/reference/pass_where-where_04-2ee4397.json0000664000175000017500000000077515174404631024377 0ustar alastairalastair{ "basename": "pass_where-where_04-2ee4397", "cmd": "lfortran --pass=where --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/where_04.f90", "infile_hash": "48449a9af8d215a5a118d0776d25e23b7b310df89b1775164ddfde5e", "outfile": null, "outfile_hash": null, "stdout": "pass_where-where_04-2ee4397.stdout", "stdout_hash": "1220abfe9632375d362bfb0880d4d34c54e65d8387438c9d4c44c12a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-complex_mul_test-562260f.json0000664000175000017500000000077215174404631024677 0ustar alastairalastair{ "basename": "asr-complex_mul_test-562260f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_mul_test.f90", "infile_hash": "908ba75c567d6ff4ba0e42cba3e974999d00e5d24710f4649ac212d6", "outfile": null, "outfile_hash": null, "stdout": "asr-complex_mul_test-562260f.stdout", "stdout_hash": "b72b73465a19b3b9d42b12715e2745a07fdb11d48f8545028aa2f8e2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/obj-program_cmake_01-17bdeab.json0000664000175000017500000000063215174404631024676 0ustar alastairalastair{ "basename": "obj-program_cmake_01-17bdeab", "cmd": "lfortran --no-color -c {infile} -o output.o", "infile": "tests/../integration_tests/program_cmake_01.f90", "infile_hash": "0e854d9b2ed613d6193d78290dc20a45ec66f60ab17e1c0229c3febe", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-expr_09-838f740.json0000664000175000017500000000073015174404631023124 0ustar alastairalastair{ "basename": "julia-expr_09-838f740", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/expr_09.f90", "infile_hash": "3b99f849ef5412d7fbc16bc164307d14964150e05dd203596a3e6dd8", "outfile": null, "outfile_hash": null, "stdout": "julia-expr_09-838f740.stdout", "stdout_hash": "dfc8fad1ddd91697f4084288a8ab590e5ca80090ec727762d13c7977", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-wasm1-8a138d6.stdout0000664000175000017500000001653415174404631023012 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param i32 i32) (result i32))) (type (;3;) (func (param i64 i64) (result i64))) (type (;4;) (func (param i32) (result i32))) (type (;5;) (func (param i32 i32) (result i32))) (type (;6;) (func (param i32) (result i32))) (type (;7;) (func (param) (result))) (type (;8;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param i32 i32) (result i32) (local i32) local.get 0 local.get 1 i32.add local.set 2 local.get 2 return ) (func $3 (type 3) (param i64 i64) (result i64) (local i64) local.get 0 local.get 1 i64.add local.set 2 local.get 2 return ) (func $4 (type 4) (param i32) (result i32) (local i32 i32) i32.const 3 local.set 2 local.get 2 local.get 0 call 6 i32.mul local.set 1 local.get 1 return ) (func $5 (type 5) (param i32 i32) (result i32) (local i32) local.get 0 local.get 1 i32.add local.set 2 local.get 2 return ) (func $6 (type 6) (param i32) (result i32) (local i32) local.get 0 local.get 0 i32.mul local.set 1 local.get 1 return ) (func $7 (type 7) (param) (result) (local) i32.const 5 call 6 i64.extend_i32_s call 8 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 5 i32.const 4 call 2 i64.extend_i32_s call 8 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i64.const 4 i64.const 5 call 3 call 8 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 5 call 4 i64.extend_i32_s call 8 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 5 i32.const 4 call 5 i64.extend_i32_s call 8 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $8 (type 8) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "add" (func 2)) (export "add64" (func 3)) (export "computecirclearea" (func 4)) (export "my_add" (func 5)) (export "sqr" (func 6)) (export "_start" (func 7)) (export "print_i64" (func 8)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-0.63.0/tests/reference/asr-external_03-fe60427.json0000664000175000017500000000077515174404631023526 0ustar alastairalastair{ "basename": "asr-external_03-fe60427", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/external_03.f90", "infile_hash": "82ee198be6d031398277671c0c2f48a832124a1458e94c3317d080ba", "outfile": null, "outfile_hash": null, "stdout": "asr-external_03-fe60427.stdout", "stdout_hash": "d9c6b01ec94061f3e63647640650dccce7cbd4c64f396e34dcd9201a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_18-e69cac3.json0000664000175000017500000000077215174404631024715 0ustar alastairalastair{ "basename": "asr-derived_types_18-e69cac3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_18.f90", "infile_hash": "fe7b84ad65fd65a338c06a92b43e05adbdbc69fa945465295f9aefb7", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_18-e69cac3.stdout", "stdout_hash": "1560b667acfff5b96475b01e7312204561d7c63bfbfae4dee19fe515", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-type_casting_01-4e8a892.json0000664000175000017500000000075115174404631024374 0ustar alastairalastair{ "basename": "asr-type_casting_01-4e8a892", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/type_casting_01.f90", "infile_hash": "9385ba3715f01c20aaa23ba05b0a20383ed149344bc72e7ede478970", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-type_casting_01-4e8a892.stderr", "stderr_hash": "372b13217c84710fd3f0d667e77c8a2f2516da635a765fedc1858a4d", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-real_dp_param-3adbc5b.stdout0000664000175000017500000001674615174404631024754 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { real_dp_param: (Program (SymbolTable 2 { prec1: (Variable 2 prec1 [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), prec2: (Variable 2 prec2 [] Local (IntegerConstant 8 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u: (Variable 2 u [] Local (RealConstant 1.050000 (Real 4) ) (RealConstant 1.050000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 2 v [] Local (Cast (RealConstant 1.050000 (Real 4) ) RealToReal (Real 8) (RealConstant 1.050000 (Real 8) ) () ) (RealConstant 1.050000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zero: (Variable 2 zero [] Local (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) (RealConstant 0.000000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) real_dp_param [] [(Print (StringFormat () [(Var 2 u) (Var 2 v) (Var 2 zero)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr_preprocess-cpp_err5-38d12de.json0000664000175000017500000000076015174404631025435 0ustar alastairalastair{ "basename": "asr_preprocess-cpp_err5-38d12de", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp_err5.f90", "infile_hash": "01035d3623d53c8ebd4bc5480285bb86e44a0f1e138bea7619972dd4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp_err5-38d12de.stderr", "stderr_hash": "3966919982985df5bd5b492228a58d90a23ef0333b6d22b176851c3a", "returncode": 2 }lfortran-0.63.0/tests/reference/run-format_24-257ddde.json0000664000175000017500000000071515174404631023351 0ustar alastairalastair{ "basename": "run-format_24-257ddde", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_24.f90", "infile_hash": "99034e6786ee2c33055ce1a71b2d06c850dded80ec23526fd1c8f163", "outfile": null, "outfile_hash": null, "stdout": "run-format_24-257ddde.stdout", "stdout_hash": "225c3fe9aeeded2c6682e7ca99a99932020566417d99b4a4d179f30d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-real_dp_param-bac42bc.stdout0000664000175000017500000000556315174404631025131 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @real_dp_param.u = internal global float 0x3FF0CCCCC0000000 @real_dp_param.v = internal global double 0x3FF0CCCCC0000000 @real_dp_param.zero = internal global double 0.000000e+00 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [9 x i8] c"R4,R8,R8\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %prec1 = alloca i32, align 4 store i32 4, i32* %prec1, align 4 %prec2 = alloca i32, align 4 store i32 8, i32* %prec2, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, float* @real_dp_param.u, double* @real_dp_param.v, double* @real_dp_param.zero) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_real_dp_param FINALIZE_SYMTABLE_real_dp_param: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/run-format_40-9ce331f.stdout0000664000175000017500000000007615174404631023637 0ustar alastairalastair3.E+0 0.E+0 1.E+1 3.E+3 3.E+1 4.E+2 3.E+4 -5.E+0 1.E-5 1.E+11 lfortran-0.63.0/tests/reference/run-write_01-c968b4a.stderr0000664000175000017500000000012515174404631023455 0ustar alastairalastairRuntime Error: Format mismatch between OPEN statement and WRITE statement on unit 1. lfortran-0.63.0/tests/reference/llvm-operator_overloading_03-d9fd880.stdout0000664000175000017500000004664015174404631026760 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [13 x i8] c"S-DESC-4,L32\00", align 1 @string_const_data = private constant [4 x i8] c"T>T:" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [13 x i8] c"S-DESC-4,L32\00", align 1 @string_const_data.2 = private constant [4 x i8] c"T>F:" @string_const.3 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.2, i32 0, i32 0), i64 4 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.4 = private unnamed_addr constant [13 x i8] c"S-DESC-4,L32\00", align 1 @string_const_data.5 = private constant [4 x i8] c"F>T:" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.5, i32 0, i32 0), i64 4 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.7 = private unnamed_addr constant [13 x i8] c"S-DESC-4,L32\00", align 1 @string_const_data.8 = private constant [4 x i8] c"F>F:" @string_const.9 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.8, i32 0, i32 0), i64 4 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.10 = private unnamed_addr constant [13 x i8] c"S-DESC-4,L32\00", align 1 @string_const_data.11 = private constant [4 x i8] c"T @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.13 = private unnamed_addr constant [13 x i8] c"S-DESC-4,L32\00", align 1 @string_const_data.14 = private constant [4 x i8] c"T @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.16 = private unnamed_addr constant [13 x i8] c"S-DESC-4,L32\00", align 1 @string_const_data.17 = private constant [4 x i8] c"F @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.19 = private unnamed_addr constant [13 x i8] c"S-DESC-4,L32\00", align 1 @string_const_data.20 = private constant [4 x i8] c"F @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @__module_operator_overloading_01_overload_comp_m_greater_than_inverse(i32* %log1, i32* %log2) { .entry: %greater_than_inverse = alloca i32, align 4 %0 = load i32, i32* %log1, align 4 %1 = load i32, i32* %log2, align 4 %2 = and i32 1, %1 %3 = xor i32 %0, %2 %4 = xor i32 %3, 1 %5 = xor i32 %4, 0 %6 = xor i32 %5, 1 %7 = icmp ne i32 %6, 0 br i1 %7, label %then, label %else then: ; preds = %.entry store i32 1, i32* %greater_than_inverse, align 4 br label %ifcont else: ; preds = %.entry store i32 0, i32* %greater_than_inverse, align 4 br label %ifcont ifcont: ; preds = %else, %then br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_greater_than_inverse FINALIZE_SYMTABLE_greater_than_inverse: ; preds = %return %8 = load i32, i32* %greater_than_inverse, align 4 ret i32 %8 } define i32 @__module_operator_overloading_01_overload_comp_m_less_than_inverse(i32* %log1, i32* %log2) { .entry: %less_than_inverse = alloca i32, align 4 %0 = load i32, i32* %log1, align 4 %1 = load i32, i32* %log2, align 4 %2 = and i32 0, %1 %3 = xor i32 %0, %2 %4 = xor i32 %3, 1 %5 = xor i32 %4, 1 %6 = xor i32 %5, 1 %7 = icmp ne i32 %6, 0 br i1 %7, label %then, label %else then: ; preds = %.entry store i32 1, i32* %less_than_inverse, align 4 br label %ifcont else: ; preds = %.entry store i32 0, i32* %less_than_inverse, align 4 br label %ifcont ifcont: ; preds = %else, %then br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_less_than_inverse FINALIZE_SYMTABLE_less_than_inverse: ; preds = %return %8 = load i32, i32* %less_than_inverse, align 4 ret i32 %8 } define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc19 = alloca %string_descriptor, align 8 %stringFormat_desc16 = alloca %string_descriptor, align 8 %stringFormat_desc13 = alloca %string_descriptor, align 8 %stringFormat_desc10 = alloca %string_descriptor, align 8 %stringFormat_desc7 = alloca %string_descriptor, align 8 %stringFormat_desc4 = alloca %string_descriptor, align 8 %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %f = alloca i32, align 4 store i32 0, i32* %f, align 4 %t = alloca i32, align 4 store i32 1, i32* %t, align 4 %3 = alloca i64, align 8 %4 = call i32 @__module_operator_overloading_01_overload_comp_m_greater_than_inverse(i32* %t, i32* %t) %5 = alloca i32, align 4 store i32 %4, i32* %5, align 4 %6 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const, i32* %5) %7 = load i64, i64* %3, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %6, i8** %8, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %7, i64* %9, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %11 = load i8*, i8** %10, align 8 %12 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %13 = load i64, i64* %12, align 8 %14 = trunc i64 %13 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %11, i32 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %15 = icmp eq i8* %6, null br i1 %15, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %6) br label %free_done free_done: ; preds = %free_nonnull, %.entry %16 = alloca i64, align 8 %17 = call i32 @__module_operator_overloading_01_overload_comp_m_greater_than_inverse(i32* %t, i32* %f) %18 = alloca i32, align 4 store i32 %17, i32* %18, align 4 %19 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info.1, i32 0, i32 0), i64* %16, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.3, i32* %18) %20 = load i64, i64* %16, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %19, i8** %21, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %20, i64* %22, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %24 = load i8*, i8** %23, align 8 %25 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %26 = load i64, i64* %25, align 8 %27 = trunc i64 %26 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %24, i32 %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %28 = icmp eq i8* %19, null br i1 %28, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %2, i8* %19) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %29 = alloca i64, align 8 %30 = call i32 @__module_operator_overloading_01_overload_comp_m_greater_than_inverse(i32* %f, i32* %t) %31 = alloca i32, align 4 store i32 %30, i32* %31, align 4 %32 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info.4, i32 0, i32 0), i64* %29, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.6, i32* %31) %33 = load i64, i64* %29, align 8 %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %32, i8** %34, align 8 %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %33, i64* %35, align 8 %36 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %37 = load i8*, i8** %36, align 8 %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %39 = load i64, i64* %38, align 8 %40 = trunc i64 %39 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %37, i32 %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %41 = icmp eq i8* %32, null br i1 %41, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free_alloc(i8* %2, i8* %32) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 %42 = alloca i64, align 8 %43 = call i32 @__module_operator_overloading_01_overload_comp_m_greater_than_inverse(i32* %f, i32* %f) %44 = alloca i32, align 4 store i32 %43, i32* %44, align 4 %45 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info.7, i32 0, i32 0), i64* %42, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.9, i32* %44) %46 = load i64, i64* %42, align 8 %47 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 store i8* %45, i8** %47, align 8 %48 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 store i64 %46, i64* %48, align 8 %49 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 %50 = load i8*, i8** %49, align 8 %51 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 %52 = load i64, i64* %51, align 8 %53 = trunc i64 %52 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %50, i32 %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %54 = icmp eq i8* %45, null br i1 %54, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %free_done6 call void @_lfortran_free_alloc(i8* %2, i8* %45) br label %free_done9 free_done9: ; preds = %free_nonnull8, %free_done6 %55 = alloca i64, align 8 %56 = call i32 @__module_operator_overloading_01_overload_comp_m_less_than_inverse(i32* %t, i32* %t) %57 = alloca i32, align 4 store i32 %56, i32* %57, align 4 %58 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info.10, i32 0, i32 0), i64* %55, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.12, i32* %57) %59 = load i64, i64* %55, align 8 %60 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 store i8* %58, i8** %60, align 8 %61 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 store i64 %59, i64* %61, align 8 %62 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 %63 = load i8*, i8** %62, align 8 %64 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 %65 = load i64, i64* %64, align 8 %66 = trunc i64 %65 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %63, i32 %66, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %67 = icmp eq i8* %58, null br i1 %67, label %free_done12, label %free_nonnull11 free_nonnull11: ; preds = %free_done9 call void @_lfortran_free_alloc(i8* %2, i8* %58) br label %free_done12 free_done12: ; preds = %free_nonnull11, %free_done9 %68 = alloca i64, align 8 %69 = call i32 @__module_operator_overloading_01_overload_comp_m_less_than_inverse(i32* %t, i32* %f) %70 = alloca i32, align 4 store i32 %69, i32* %70, align 4 %71 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info.13, i32 0, i32 0), i64* %68, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.15, i32* %70) %72 = load i64, i64* %68, align 8 %73 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 store i8* %71, i8** %73, align 8 %74 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 store i64 %72, i64* %74, align 8 %75 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 %76 = load i8*, i8** %75, align 8 %77 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 %78 = load i64, i64* %77, align 8 %79 = trunc i64 %78 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %76, i32 %79, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %80 = icmp eq i8* %71, null br i1 %80, label %free_done15, label %free_nonnull14 free_nonnull14: ; preds = %free_done12 call void @_lfortran_free_alloc(i8* %2, i8* %71) br label %free_done15 free_done15: ; preds = %free_nonnull14, %free_done12 %81 = alloca i64, align 8 %82 = call i32 @__module_operator_overloading_01_overload_comp_m_less_than_inverse(i32* %f, i32* %t) %83 = alloca i32, align 4 store i32 %82, i32* %83, align 4 %84 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info.16, i32 0, i32 0), i64* %81, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.18, i32* %83) %85 = load i64, i64* %81, align 8 %86 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 store i8* %84, i8** %86, align 8 %87 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 store i64 %85, i64* %87, align 8 %88 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 %89 = load i8*, i8** %88, align 8 %90 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 %91 = load i64, i64* %90, align 8 %92 = trunc i64 %91 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %89, i32 %92, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) %93 = icmp eq i8* %84, null br i1 %93, label %free_done18, label %free_nonnull17 free_nonnull17: ; preds = %free_done15 call void @_lfortran_free_alloc(i8* %2, i8* %84) br label %free_done18 free_done18: ; preds = %free_nonnull17, %free_done15 %94 = alloca i64, align 8 %95 = call i32 @__module_operator_overloading_01_overload_comp_m_less_than_inverse(i32* %f, i32* %f) %96 = alloca i32, align 4 store i32 %95, i32* %96, align 4 %97 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info.19, i32 0, i32 0), i64* %94, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.21, i32* %96) %98 = load i64, i64* %94, align 8 %99 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 store i8* %97, i8** %99, align 8 %100 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 store i64 %98, i64* %100, align 8 %101 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 %102 = load i8*, i8** %101, align 8 %103 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 %104 = load i64, i64* %103, align 8 %105 = trunc i64 %104 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* %102, i32 %105, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 1) %106 = icmp eq i8* %97, null br i1 %106, label %free_done21, label %free_nonnull20 free_nonnull20: ; preds = %free_done18 call void @_lfortran_free_alloc(i8* %2, i8* %97) br label %free_done21 free_done21: ; preds = %free_nonnull20, %free_done18 br label %return return: ; preds = %free_done21 br label %FINALIZE_SYMTABLE_operator_overloading_01 FINALIZE_SYMTABLE_operator_overloading_01: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/llvm-global_scope7-69a167f.json0000664000175000017500000000073715174404631024313 0ustar alastairalastair{ "basename": "llvm-global_scope7-69a167f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/global_scope7.f90", "infile_hash": "b3d005db52f7a57b335928fc6d884d6fdee0654c64fc98c2e797e242", "outfile": null, "outfile_hash": null, "stdout": "llvm-global_scope7-69a167f.stdout", "stdout_hash": "3fff9b0cb1b64310f41a8590519bbf98c87a3b33c6472c43a7cb47fb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-save_03-1103dd0.stdout0000664000175000017500000032235015174404631023166 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { save_03: (Program (SymbolTable 13 { i: (Variable 13 i [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 13 j [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 13 k [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 13 l [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 13 m [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 13 n [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), o: (Variable 13 o [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) save_03 [] [] ), save_func: (Function (SymbolTable 6 { i: (Variable 6 i [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 6 j [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 6 k [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 6 l [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 6 m [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 6 n [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), o: (Variable 6 o [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), save_func: (Variable 6 save_func [] ReturnVar () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) save_func (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 6 save_func) Public .true. .true. () ), save_module_03: (Module (SymbolTable 10 { i: (Variable 10 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 10 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 10 k [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 10 l [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), save_func_mod: (Function (SymbolTable 12 { i: (Variable 12 i [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 12 j [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 12 k [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 12 l [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 12 m [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 12 n [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), o: (Variable 12 o [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), save_func_mod: (Variable 12 save_func_mod [] ReturnVar () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) save_func_mod (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 12 save_func_mod) Public .true. .true. () ), save_sub_mod: (Function (SymbolTable 11 { i: (Variable 11 i [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 11 j [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 11 k [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 11 l [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 11 m [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 11 n [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), o: (Variable 11 o [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) save_sub_mod (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .true. .true. () ) }) save_module_03 () [] .false. .false. .false. ), save_nested_func: (Function (SymbolTable 7 { i: (Variable 7 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 7 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), save_func: (Function (SymbolTable 8 { k: (Variable 8 k [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 8 l [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 8 m [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 8 n [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), o: (Variable 8 o [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), save_func: (Variable 8 save_func [] ReturnVar () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) save_func (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 8 save_func) Public .true. .true. () ), save_nested_func: (Variable 7 save_nested_func [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), save_sub: (Function (SymbolTable 9 { k: (Variable 9 k [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 9 l [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 9 m [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 9 n [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), o: (Variable 9 o [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) save_sub (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .true. .true. () ) }) save_nested_func (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 7 save_nested_func) Public .true. .true. () ), save_nested_sub: (Function (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 3 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), save_func: (Function (SymbolTable 5 { k: (Variable 5 k [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 5 l [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 5 m [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 5 n [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), o: (Variable 5 o [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), save_func: (Variable 5 save_func [] ReturnVar () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) save_func (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 5 save_func) Public .true. .true. () ), save_sub: (Function (SymbolTable 4 { k: (Variable 4 k [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 4 l [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 4 m [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 4 n [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), o: (Variable 4 o [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) save_sub (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .true. .true. () ) }) save_nested_sub (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .true. .true. () ), save_sub: (Function (SymbolTable 2 { i: (Variable 2 i [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 2 k [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 2 l [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 2 m [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), o: (Variable 2 o [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) save_sub (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-string_12-e72e066.stdout0000664000175000017500000005000315174404631023551 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_12: (Program (SymbolTable 2 { digits: (Variable 2 digits [hex_digits] Local (StringSection (Var 2 hex_digits) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "0123456789" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "0123456789" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), fullhex_digits: (Variable 2 fullhex_digits [] Local (StringConstant "0123456789ABCDEFabcdef" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "0123456789ABCDEFabcdef" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), hex_digits: (Variable 2 hex_digits [fullhex_digits] Local (StringSection (Var 2 fullhex_digits) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "0123456789ABCDEF" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "0123456789ABCDEF" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), letters: (Variable 2 letters [] Local (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" (String 1 (IntegerConstant 52 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" (String 1 (IntegerConstant 52 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 52 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lowercase: (Variable 2 lowercase [letters] Local (StringSection (Var 2 letters) (IntegerConstant 27 (Integer 4) Decimal) (StringLen (Var 2 letters) (Integer 4) (IntegerConstant 52 (Integer 4) Decimal) ) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "abcdefghijklmnopqrstuvwxyz" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "abcdefghijklmnopqrstuvwxyz" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lowerhex_digits: (Variable 2 lowerhex_digits [] Local (StringConstant "0123456789abcdef" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "0123456789abcdef" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), octal_digits: (Variable 2 octal_digits [digits] Local (StringSection (Var 2 digits) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "01234567" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "01234567" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 2 string [letters] Local (IntrinsicElementalFunction Char [(StringLen (Var 2 letters) (Integer 4) (IntegerConstant 52 (Integer 4) Decimal) )] 0 (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "4" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "4" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), uppercase: (Variable 2 uppercase [letters] Local (StringSection (Var 2 letters) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 26 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_12 [] [(Print (Var 2 fullhex_digits) ) (Print (Var 2 hex_digits) ) (Print (Var 2 lowerhex_digits) ) (Print (Var 2 digits) ) (Print (Var 2 octal_digits) ) (Print (Var 2 letters) ) (Print (Var 2 uppercase) ) (Print (Var 2 lowercase) ) (Print (StringFormat () [(StringConstant "char(" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringLen (Var 2 letters) (Integer 4) (IntegerConstant 52 (Integer 4) Decimal) ) (StringConstant ") = " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 string)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (StringCompare (Var 2 string) NotEq (StringConstant "4" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/run-format_58-475e064.json0000664000175000017500000000071515174404631023140 0ustar alastairalastair{ "basename": "run-format_58-475e064", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_58.f90", "infile_hash": "f2170db3134d59fbefa690522bab88fc5f052e8a29518b7ef3814a2c", "outfile": null, "outfile_hash": null, "stdout": "run-format_58-475e064.stdout", "stdout_hash": "01411717970a71554dc0f09da55c75313b0232b0051bb64cd1ea4a53", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_where-where_01-94e4416.json0000664000175000017500000000077515174404631024312 0ustar alastairalastair{ "basename": "pass_where-where_01-94e4416", "cmd": "lfortran --pass=where --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/where_01.f90", "infile_hash": "b3e2251e4cd263f14db0266759a9af716dce48521dcd2f1e6eadce17", "outfile": null, "outfile_hash": null, "stdout": "pass_where-where_01-94e4416.stdout", "stdout_hash": "c0cb15b50b85fea4d88f08904645f1d621129ab17b9253fd3363c8c2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-dimension_attr-1c00ad6.stdout0000664000175000017500000002056515174404631025032 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { a: (Variable 2 a [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 a)] [(Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), main: (Program (SymbolTable 3 { a: (Variable 3 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 3 d [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 3 z [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main [] [(SubroutineCall 1 f () [((IntegerConstant 1 (Integer 4) Decimal))] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-substring-73a0b8e.json0000664000175000017500000000073315174404631024150 0ustar alastairalastair{ "basename": "ast_f90-substring-73a0b8e", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/substring.f90", "infile_hash": "c8a378c73c450c69e6694f02f51b2e1706ee25ae2e9645c28fd98788", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-substring-73a0b8e.stdout", "stdout_hash": "12af24b0dac9f8a696bebaf4ff8b5fa0298864c7a410609252ed8a52", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixedform_module-3f800f0.json0000664000175000017500000000076015174404631024717 0ustar alastairalastair{ "basename": "ast-fixedform_module-3f800f0", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_module.f", "infile_hash": "032fb00debb25bd84eafae8de804901f317da59470d4206d18b7fad0", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_module-3f800f0.stdout", "stdout_hash": "2dc542642992285eb91bbfb115fcac0fdfbced5aa5f5e9fda8f7de40", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-expr_08-74f99b7.json0000664000175000017500000000072215174404631022703 0ustar alastairalastair{ "basename": "wat-expr_08-74f99b7", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/expr_08.f90", "infile_hash": "f460199051316c12de52e28e19545464f7a017f68a9a9db6a590a328", "outfile": null, "outfile_hash": null, "stdout": "wat-expr_08-74f99b7.stdout", "stdout_hash": "57b3bcf972234bcd4dc79435b60a32707804678200403c8bbe8aaebe", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-fn4-83c4d1a.stdout0000664000175000017500000000125515174404631023166 0ustar alastairalastairfunction conform(mold, val, dim) type(*), intent(in) :: mold(..) type(*), intent(in), optional :: val(..) integer, intent(in), optional :: dim logical :: conform if (present(val)) then if (present(dim)) then if (dim > 0 .and. dim <= rank(mold) .and. dim <= rank(val)) then conform = size(mold, dim=dim) == size(val, dim=dim) else error stop "Runtime error: Illegal dim argument provided in conform" end if else if (rank(val) == rank(mold)) then conform = all(shape(mold) == shape(val)) else conform = .false. end if end if else conform = .true. end if end function conform lfortran-0.63.0/tests/reference/asr-cmd_02-ba58262.json0000664000175000017500000000073415174404631022435 0ustar alastairalastair{ "basename": "asr-cmd_02-ba58262", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/cmd_02.f90", "infile_hash": "fc31fcafc39673c2cf4b192ea1cca649f864901bbc9b910f442cb5f9", "outfile": null, "outfile_hash": null, "stdout": "asr-cmd_02-ba58262.stdout", "stdout_hash": "8ba0fcdaeae1dbe91d238868d14cdcf54c8de7920aa8d88b9b06cf99", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-if_05-865c1b8.json0000664000175000017500000000071415174404631022306 0ustar alastairalastair{ "basename": "wat-if_05-865c1b8", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/if_05.f90", "infile_hash": "e17354307d88b9239319cbfd5ce6b117fd24e4aa2998deee3d8fe695", "outfile": null, "outfile_hash": null, "stdout": "wat-if_05-865c1b8.stdout", "stdout_hash": "5a6e95799d5aae339443d63295d7be6721472c9cdfaef1be882b86d4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_31-cd9bfef.json0000664000175000017500000000075015174404631023653 0ustar alastairalastair{ "basename": "asr-modules_31-cd9bfef", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_31.f90", "infile_hash": "871002e4224f4001cd7df45deab32b4ac08b22d4f6358d4965afddfe", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_31-cd9bfef.stdout", "stdout_hash": "8db33be87877b9461c8254df2103717055f7c9ae4051fc8bb9b8876f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-int_dp_param-19bf015.json0000664000175000017500000000075615174404631024030 0ustar alastairalastair{ "basename": "asr-int_dp_param-19bf015", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/int_dp_param.f90", "infile_hash": "bb7549fda78172a3f68b883fd1423773bf823a71a4dd2f89476886b5", "outfile": null, "outfile_hash": null, "stdout": "asr-int_dp_param-19bf015.stdout", "stdout_hash": "dd7b23b1d210f963207226923a48c8198d39404a2b6530ff646f19c8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/tokens-boz1-719113d.json0000664000175000017500000000071215174404631022676 0ustar alastairalastair{ "basename": "tokens-boz1-719113d", "cmd": "lfortran --no-color --show-tokens {infile} -o {outfile}", "infile": "tests/boz1.f90", "infile_hash": "5bb9dc97e57fb92acadcdcfd70ffe99dfcfd6d1be490f4c6766a2543", "outfile": null, "outfile_hash": null, "stdout": "tokens-boz1-719113d.stdout", "stdout_hash": "963956fa5618ed087ff96ab6c55004d1eeba847628743783a5c8898b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-coarrays_01-9ca4565.stdout0000664000175000017500000000331315174404631024550 0ustar alastairalastairprogram coarrays_01 ! This test should test most of coarray syntax: ! * declarations ! * allocations ! * coarray operations ! ! You can test the syntax manually with GFortran by: ! gfortran -fcoarray=lib -c coarrays_01.f90 -o a.o ! use iso_fortran_env, only: event_type implicit none ! Coarray Declarations real, dimension(100), codimension[*] :: A integer :: B[3,*] integer :: c[*] real :: D(100,2)[3,*] real :: E(1,2,3)[1,2,-1:3,*] real, allocatable :: F(:)[:] real, allocatable :: g(:,:,:)[:,:,:] real, dimension(20), codimension[20,*] :: h real, codimension[:], allocatable :: z(:,:) character :: r(20)[20,0:*] type(event_type) :: ok_to_overwrite[*] type(event_type), allocatable :: greeting_ready(:)[:] integer :: i, n ! Allocation n = 5 allocate(F(n)[*]) allocate(greeting_ready(num_images())[*]) allocate(g(50, 50, 50)[1:2, 1:2, *]) ! Array access, events, teams if (this_image() == 1) then do i = 2, num_images() c = c + c[i] event post (ok_to_overwrite[i]) end do else event wait (ok_to_overwrite) event post (greeting_ready(this_image())[1]) end if sync all sync all () sync all (stat = status) sync all (errmsg = status) event wait (variable, until_count = status) event wait (variable, until_count = status, errmsg = status) event wait (variable, errmsg = status) event wait (variable, stat = status) event post (done(sub(i))[parent(i)], stat = status) event post (variable, stat = status) event post (variable, errmsg = status) s%a(3)(4) = "S" s%b[3] = c[4] s%c(3)[4] = f(3)[4] c[3] = c[4] B[1, 2] = B[3, 4] D(99, 1)[3, 4] = D(1, 2)[1, 2] D(99, 1)[3, 3] = 5 D(:, 1)[3, 3] = 5 D(:, 1)[3, 3, team=3] = 5 D(:, 1)[3, 3, team=3, stat=i] = 5 D(:, 1)[3, 3, stat=i] = 5 end program coarrays_01 lfortran-0.63.0/tests/reference/llvm-associate_03-68dfbc7.stdout0000664000175000017500000001374515174404631024564 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @associate_03.t1 = internal global i32 2 @associate_03.t2 = internal global i32 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [6 x i8] c"I4,I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %p1 = alloca i32*, align 8 store i32* null, i32** %p1, align 8 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, i32* @associate_03.t1, i32* @associate_03.t2) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry %14 = load i32, i32* @associate_03.t1, align 4 %15 = load i32, i32* @associate_03.t2, align 4 %16 = icmp sgt i32 %14, %15 br i1 %16, label %then, label %else then: ; preds = %free_done store i32* @associate_03.t1, i32** %p1, align 8 br label %ifcont else: ; preds = %free_done store i32* @associate_03.t2, i32** %p1, align 8 br label %ifcont ifcont: ; preds = %else, %then %17 = alloca i64, align 8 %18 = load i32*, i32** %p1, align 8 %19 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %17, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %18) %20 = load i64, i64* %17, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %19, i8** %21, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %20, i64* %22, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %24 = load i8*, i8** %23, align 8 %25 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %26 = load i64, i64* %25, align 8 %27 = trunc i64 %26 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %24, i32 %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %28 = icmp eq i8* %19, null br i1 %28, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %ifcont call void @_lfortran_free_alloc(i8* %2, i8* %19) br label %free_done3 free_done3: ; preds = %free_nonnull2, %ifcont %29 = load i32*, i32** %p1, align 8 %30 = load i32, i32* %29, align 4 store i32 %30, i32* %i, align 4 %31 = load i32, i32* %i, align 4 %32 = load i32, i32* @associate_03.t2, align 4 %33 = icmp eq i32 %31, %32 br i1 %33, label %then4, label %else5 then4: ; preds = %free_done3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont6 else5: ; preds = %free_done3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 br label %return return: ; preds = %ifcont6 br label %FINALIZE_SYMTABLE_associate_03 FINALIZE_SYMTABLE_associate_03: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) lfortran-0.63.0/tests/reference/asr-subroutines_09-83ddd2b.json0000664000175000017500000000076415174404631024427 0ustar alastairalastair{ "basename": "asr-subroutines_09-83ddd2b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_09.f90", "infile_hash": "3f6ea6213db107e0cec3cc74bd308164cc52607efc6f85e7a7a389aa", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutines_09-83ddd2b.stdout", "stdout_hash": "3a9e852d129dcff755868eda2a97b67e179469548154643244e7c4d2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-character_02-56bfff3.stdout0000664000175000017500000000651415174404631024351 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { character_02: (Program (SymbolTable 2 { toml_base: (Variable 2 toml_base [] Local (ArrayConstant 4 ["1", "2", "3", "$"] (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray ) ColMajor ) (ArrayConstant 4 ["1", "2", "3", "$"] (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray ) ColMajor ) Parameter (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) character_02 [] [(Print (StringFormat () [(Var 2 toml_base)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-issue532-4bdd3b3.json0000664000175000017500000000071515174404631023106 0ustar alastairalastair{ "basename": "asr-issue532-4bdd3b3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/issue532.f90", "infile_hash": "75f4785bea0a877f7a902640ffcc5d276bd955349ff3df1639d6e6b7", "outfile": null, "outfile_hash": null, "stdout": "asr-issue532-4bdd3b3.stdout", "stdout_hash": "a4b058ac200e87a30281ea61ea7e815cdc96c9b97e75e7b08ab757ef", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-arrays_01-81f01a2.json0000664000175000017500000000073615174404631023504 0ustar alastairalastair{ "basename": "julia-arrays_01-81f01a2", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/arrays_01.f90", "infile_hash": "f7df4142feb383f836dfa072a60673922e8873b5695f893be8329b89", "outfile": null, "outfile_hash": null, "stdout": "julia-arrays_01-81f01a2.stdout", "stdout_hash": "bc2771e2dedd62f7531756913234c46ef6e75d6392e397abdb3df43f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-show_errors1-cc473c3.json0000664000175000017500000000075515174404631024111 0ustar alastairalastair{ "basename": "asr-show_errors1-cc473c3", "cmd": "lfortran --show-errors --continue-compilation --no-color {infile}", "infile": "tests/errors/show_errors1.f90", "infile_hash": "8170b98a784b460b9353a740f0f117160e3070b0f88fd4d9c98ebcaf", "outfile": null, "outfile_hash": null, "stdout": "asr-show_errors1-cc473c3.stdout", "stdout_hash": "50cedac153912dd18ac3a537a71a116e7a0d5281129eb7a670fa62b7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-do7-8069d7a.stdout0000664000175000017500000000320415174404631022624 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca i32, align 4 %i = alloca i32, align 4 store i32 0, i32* %i, align 4 br label %loop.head loop.head: ; preds = %loop.body, %.entry %2 = load i32, i32* %i, align 4 %3 = add i32 %2, 1 %4 = icmp sle i32 %3, 10 br i1 %4, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %5 = load i32, i32* %i, align 4 %6 = add i32 %5, 1 store i32 %6, i32* %i, align 4 store i32 5, i32* %call_arg_value, align 4 %7 = call i32 @f(i32* %call_arg_value) store i32 %7, i32* %a, align 4 br label %loop.head loop.end: ; preds = %loop.head br label %return return: ; preds = %loop.end br label %FINALIZE_SYMTABLE_do7 FINALIZE_SYMTABLE_do7: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } define i32 @f(i32* %a) { .entry: %f = alloca i32, align 4 %0 = load i32, i32* %a, align 4 %1 = add i32 %0, 1 store i32 %1, i32* %f, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return %2 = load i32, i32* %f, align 4 ret i32 %2 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/run-implicit_typing1-40bb07b.json0000664000175000017500000000077115174404631024745 0ustar alastairalastair{ "basename": "run-implicit_typing1-40bb07b", "cmd": "lfortran --implicit-typing --disable-implicit-typing --no-color {infile}", "infile": "tests/implicit_typing1.f90", "infile_hash": "e6d1a0c4cb70b6dec80c447e80d4567c3a25f29c7164e956ddfba662", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-implicit_typing1-40bb07b.stderr", "stderr_hash": "fb96f08b2d0e268a7652c10ceee84208546b1e2f786812f42c656613", "returncode": 1 }lfortran-0.63.0/tests/reference/ast-common2-1811464.json0000664000175000017500000000072515174404631022604 0ustar alastairalastair{ "basename": "ast-common2-1811464", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/common2.f", "infile_hash": "761ba9bcb69efc19ad1828c9ebc8deab710d02f98f6722736d6a4dd2", "outfile": null, "outfile_hash": null, "stdout": "ast-common2-1811464.stdout", "stdout_hash": "a4c08f6f4de3cee96ae4ee89d420bdeeaf16a21bb8a2d807bc848206", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-fixed_form_call3-8c7b642.json0000664000175000017500000000100515174404631024567 0ustar alastairalastair{ "basename": "asr-fixed_form_call3-8c7b642", "cmd": "lfortran --fixed-form --implicit-interface --show-asr --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_call3.f", "infile_hash": "d0980dc66f3d039f2f11de3b1dbb87c3c5e2db5a8ddcdcb480adfb6e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-fixed_form_call3-8c7b642.stderr", "stderr_hash": "ab1a497605476706e39b3a5cf0f850464574fd18ca9b34c4e74c999b", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-matmul_01-7b0b0c2.stdout0000664000175000017500000102631715174404631023615 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { matmul_01: (Program (SymbolTable 6 { a: (Variable 6 a [] Local () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 6 b [] Local () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 6 c [] Local () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c2: (Variable 6 c2 [] Local () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dp: (Variable 6 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), err: (Variable 6 err [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), fma_clock: (Variable 6 fma_clock [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), freq: (Variable 6 freq [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ghz: (Variable 6 ghz [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 6 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iter: (Variable 6 iter [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), matmul1: (ExternalSymbol 6 matmul1 2 matmul1 matmul_01_cpu [] matmul1 Public ), matmul2: (ExternalSymbol 6 matmul2 2 matmul2 matmul_01_cpu [] matmul2 Public ), measured: (Variable 6 measured [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 6 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), percent_peak: (Variable 6 percent_peak [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 6 t [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t1: (Variable 6 t1 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t2: (Variable 6 t2 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) matmul_01 [matmul_01_cpu] [(Assignment (Var 6 n) (IntegerConstant 96 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 6 iter) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(StringConstant "Size (n x n): n =" (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 n)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "Iter =" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 iter)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "Size MB:" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (RealBinOp (RealBinOp (RealBinOp (RealConstant 4.000000 (Real 8) ) Mul (Cast (Var 6 n) IntegerToReal (Real 8) () () ) (Real 8) () ) Mul (Cast (Var 6 n) IntegerToReal (Real 8) () () ) (Real 8) () ) Div (Cast (IntegerBinOp (IntegerConstant 1024 (Integer 4) Decimal) Pow (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 1048576 (Integer 4) Decimal) ) IntegerToReal (Real 8) (RealConstant 1048576.000000 (Real 8) ) () ) (Real 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Allocate [((Var 6 a) [((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n))] () () ()) ((Var 6 b) [((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n))] () () ()) ((Var 6 c) [((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n))] () () ()) ((Var 6 c2) [((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n))] () () ())] () () () ) (IntrinsicImpureSubroutine RandomNumber [(Var 6 a)] 0 ) (IntrinsicImpureSubroutine RandomNumber [(Var 6 b)] 0 ) (Print (StringConstant "Fortran intrinsic matmul:" (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (IntrinsicImpureSubroutine CpuTime [(Var 6 t1)] 0 ) (DoLoop () ((Var 6 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 6 iter) ()) [(Assignment (Var 6 c) (IntrinsicArrayFunction MatMul [(Var 6 a) (Var 6 b)] 3 (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () ) () .false. .false. )] [] ) (IntrinsicImpureSubroutine CpuTime [(Var 6 t2)] 0 ) (Assignment (Var 6 t) (RealBinOp (RealBinOp (Var 6 t2) Sub (Var 6 t1) (Real 8) () ) Div (Cast (Var 6 iter) IntegerToReal (Real 8) () () ) (Real 8) () ) () .false. .false. ) (Assignment (Var 6 ghz) (RealConstant 1000000000.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 6 fma_clock) (RealConstant 0.062500 (Real 8) ) () .false. .false. ) (Assignment (Var 6 freq) (RealBinOp (RealConstant 3.200000 (Real 8) ) Mul (Var 6 ghz) (Real 8) () ) () .false. .false. ) (Assignment (Var 6 measured) (RealBinOp (RealBinOp (Var 6 t) Mul (Var 6 freq) (Real 8) () ) Div (Cast (IntegerBinOp (Var 6 n) Pow (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () () ) (Real 8) () ) () .false. .false. ) (Assignment (Var 6 percent_peak) (RealBinOp (RealBinOp (Var 6 fma_clock) Div (Var 6 measured) (Real 8) () ) Mul (Cast (IntegerConstant 100 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 100.000000 (Real 8) ) () ) (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Time: " (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 t)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "Clock cycles per element:" (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(StringConstant "Theoretical performance peak:" (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 fma_clock) (StringConstant "cycles" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "Measured: " (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 measured) (StringConstant "cycles" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "Percent peak: " (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 percent_peak) (StringConstant "%" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "matmul2:" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (IntrinsicImpureSubroutine CpuTime [(Var 6 t1)] 0 ) (DoLoop () ((Var 6 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 6 iter) ()) [(SubroutineCall 6 matmul2 () [((Var 6 a)) ((Var 6 b)) ((Var 6 c2))] () .false. )] [] ) (IntrinsicImpureSubroutine CpuTime [(Var 6 t2)] 0 ) (Assignment (Var 6 err) (IntrinsicArrayFunction MaxVal [(IntrinsicElementalFunction Abs [(RealBinOp (Var 6 c) Sub (Var 6 c2) (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () )] 0 (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () )] 0 (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Error:" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 err)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 6 t) (RealBinOp (RealBinOp (Var 6 t2) Sub (Var 6 t1) (Real 8) () ) Div (Cast (Var 6 iter) IntegerToReal (Real 8) () () ) (Real 8) () ) () .false. .false. ) (Assignment (Var 6 ghz) (RealConstant 1000000000.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 6 fma_clock) (RealConstant 0.062500 (Real 8) ) () .false. .false. ) (Assignment (Var 6 freq) (RealBinOp (RealConstant 3.200000 (Real 8) ) Mul (Var 6 ghz) (Real 8) () ) () .false. .false. ) (Assignment (Var 6 measured) (RealBinOp (RealBinOp (Var 6 t) Mul (Var 6 freq) (Real 8) () ) Div (Cast (IntegerBinOp (Var 6 n) Pow (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () () ) (Real 8) () ) () .false. .false. ) (Assignment (Var 6 percent_peak) (RealBinOp (RealBinOp (Var 6 fma_clock) Div (Var 6 measured) (Real 8) () ) Mul (Cast (IntegerConstant 100 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 100.000000 (Real 8) ) () ) (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Time: " (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 t)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "Clock cycles per element:" (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(StringConstant "Theoretical performance peak:" (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 fma_clock) (StringConstant "cycles" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "Measured: " (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 measured) (StringConstant "cycles" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "Percent peak: " (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 percent_peak) (StringConstant "%" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (Var 6 err) Gt (RealConstant 0.001000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "matmul1:" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (IntrinsicImpureSubroutine CpuTime [(Var 6 t1)] 0 ) (DoLoop () ((Var 6 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 6 iter) ()) [(SubroutineCall 6 matmul1 () [((Var 6 a)) ((Var 6 b)) ((Var 6 c2))] () .false. )] [] ) (IntrinsicImpureSubroutine CpuTime [(Var 6 t2)] 0 ) (Assignment (Var 6 err) (IntrinsicArrayFunction MaxVal [(IntrinsicElementalFunction Abs [(RealBinOp (Var 6 c) Sub (Var 6 c2) (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () )] 0 (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () )] 0 (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Error:" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 err)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 6 t) (RealBinOp (RealBinOp (Var 6 t2) Sub (Var 6 t1) (Real 8) () ) Div (Cast (Var 6 iter) IntegerToReal (Real 8) () () ) (Real 8) () ) () .false. .false. ) (Assignment (Var 6 ghz) (RealConstant 1000000000.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 6 fma_clock) (RealConstant 0.062500 (Real 8) ) () .false. .false. ) (Assignment (Var 6 freq) (RealBinOp (RealConstant 3.200000 (Real 8) ) Mul (Var 6 ghz) (Real 8) () ) () .false. .false. ) (Assignment (Var 6 measured) (RealBinOp (RealBinOp (Var 6 t) Mul (Var 6 freq) (Real 8) () ) Div (Cast (IntegerBinOp (Var 6 n) Pow (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () () ) (Real 8) () ) () .false. .false. ) (Assignment (Var 6 percent_peak) (RealBinOp (RealBinOp (Var 6 fma_clock) Div (Var 6 measured) (Real 8) () ) Mul (Cast (IntegerConstant 100 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 100.000000 (Real 8) ) () ) (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Time: " (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 t)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "Clock cycles per element:" (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(StringConstant "Theoretical performance peak:" (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 fma_clock) (StringConstant "cycles" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "Measured: " (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 measured) (StringConstant "cycles" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "Percent peak: " (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 percent_peak) (StringConstant "%" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (Var 6 err) Gt (RealConstant 0.001000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ), matmul_01_cpu: (Module (SymbolTable 2 { kernel2: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a0: (Variable 4 a0 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a1: (Variable 4 a1 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a2: (Variable 4 a2 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a3: (Variable 4 a3 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a4: (Variable 4 a4 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a5: (Variable 4 a5 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 4 c [] Out () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i1: (Variable 4 i1 [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 4 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s1: (Variable 4 s1 [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u00: (Variable 4 u00 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u01: (Variable 4 u01 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u10: (Variable 4 u10 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u11: (Variable 4 u11 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u20: (Variable 4 u20 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u21: (Variable 4 u21 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u30: (Variable 4 u30 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u31: (Variable 4 u31 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u40: (Variable 4 u40 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u41: (Variable 4 u41 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u50: (Variable 4 u50 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u51: (Variable 4 u51 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 4 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) kernel2 (FunctionType [(Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Integer 4) (Integer 4) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 b) (Var 4 a) (Var 4 c) (Var 4 x) (Var 4 y) (Var 4 i1) (Var 4 s1)] [(Assignment (Var 4 u00) (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u01) (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u10) (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u11) (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u20) (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u21) (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u30) (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u31) (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u40) (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u41) (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u50) (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u51) (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (DoLoop () ((Var 4 k) (Var 4 i1) (IntegerBinOp (IntegerBinOp (Var 4 i1) Add (Var 4 s1) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(Assignment (Var 4 a0) (ArrayPhysicalCast (ArrayBroadcast (ArrayItem (Var 4 a) [(() (Var 4 k) ()) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 4) ColMajor () ) (ArrayConstant 4 [8] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray SIMDArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u00) (RealBinOp (Var 4 u00) Add (RealBinOp (Var 4 a0) Mul (ArraySection (Var 4 b) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u01) (RealBinOp (Var 4 u01) Add (RealBinOp (Var 4 a0) Mul (ArraySection (Var 4 b) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 a1) (ArrayPhysicalCast (ArrayBroadcast (ArrayItem (Var 4 a) [(() (Var 4 k) ()) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 4) ColMajor () ) (ArrayConstant 4 [8] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray SIMDArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u10) (RealBinOp (Var 4 u10) Add (RealBinOp (Var 4 a1) Mul (ArraySection (Var 4 b) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u11) (RealBinOp (Var 4 u11) Add (RealBinOp (Var 4 a1) Mul (ArraySection (Var 4 b) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 a2) (ArrayPhysicalCast (ArrayBroadcast (ArrayItem (Var 4 a) [(() (Var 4 k) ()) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 4) ColMajor () ) (ArrayConstant 4 [8] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray SIMDArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u20) (RealBinOp (Var 4 u20) Add (RealBinOp (Var 4 a2) Mul (ArraySection (Var 4 b) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u21) (RealBinOp (Var 4 u21) Add (RealBinOp (Var 4 a2) Mul (ArraySection (Var 4 b) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 a3) (ArrayPhysicalCast (ArrayBroadcast (ArrayItem (Var 4 a) [(() (Var 4 k) ()) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 4) ColMajor () ) (ArrayConstant 4 [8] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray SIMDArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u30) (RealBinOp (Var 4 u30) Add (RealBinOp (Var 4 a3) Mul (ArraySection (Var 4 b) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u31) (RealBinOp (Var 4 u31) Add (RealBinOp (Var 4 a3) Mul (ArraySection (Var 4 b) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 a4) (ArrayPhysicalCast (ArrayBroadcast (ArrayItem (Var 4 a) [(() (Var 4 k) ()) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 4) ColMajor () ) (ArrayConstant 4 [8] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray SIMDArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u40) (RealBinOp (Var 4 u40) Add (RealBinOp (Var 4 a4) Mul (ArraySection (Var 4 b) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u41) (RealBinOp (Var 4 u41) Add (RealBinOp (Var 4 a4) Mul (ArraySection (Var 4 b) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 a5) (ArrayPhysicalCast (ArrayBroadcast (ArrayItem (Var 4 a) [(() (Var 4 k) ()) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 4) ColMajor () ) (ArrayConstant 4 [8] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray SIMDArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u50) (RealBinOp (Var 4 u50) Add (RealBinOp (Var 4 a5) Mul (ArraySection (Var 4 b) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u51) (RealBinOp (Var 4 u51) Add (RealBinOp (Var 4 a5) Mul (ArraySection (Var 4 b) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. )] [] ) (Assignment (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u00) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u01) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u10) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u11) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u20) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u21) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u30) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u31) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u40) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u41) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u50) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u51) () .false. .false. )] () Public .true. .true. () ), matmul1: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 3 c [] Out () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 3 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 3 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 3 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) matmul1 (FunctionType [(Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 c)] [(Assignment (Var 3 n) (ArraySize (Var 3 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 3 c) (ArrayBroadcast (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) () ) (IntrinsicArrayFunction Shape [(Var 3 c)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () ) () .false. .false. ) (DoLoop () ((Var 3 j) (IntegerConstant 1 (Integer 4) Decimal) (Var 3 n) ()) [(DoLoop () ((Var 3 k) (IntegerConstant 1 (Integer 4) Decimal) (Var 3 n) ()) [(DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 3 n) ()) [(Assignment (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ())] (Real 4) ColMajor () ) (RealBinOp (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ())] (Real 4) ColMajor () ) Add (RealBinOp (ArrayItem (Var 3 a) [(() (Var 3 i) ()) (() (Var 3 k) ())] (Real 4) ColMajor () ) Mul (ArrayItem (Var 3 b) [(() (Var 3 k) ()) (() (Var 3 j) ())] (Real 4) ColMajor () ) (Real 4) () ) (Real 4) () ) () .false. .false. )] [] )] [] )] [] )] () Public .true. .true. () ), matmul2: (Function (SymbolTable 5 { a: (Variable 5 a [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 5 b [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 5 c [] Out () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i1: (Variable 5 i1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i2: (Variable 5 i2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i3: (Variable 5 i3 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 5 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s1: (Variable 5 s1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s2: (Variable 5 s2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s3: (Variable 5 s3 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 5 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 5 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) matmul2 (FunctionType [(Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [kernel2] [(Var 5 a) (Var 5 b) (Var 5 c)] [(Assignment (Var 5 n) (ArraySize (Var 5 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 5 s3) (IntegerConstant 48 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 5 s2) (IntegerConstant 12 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 5 s1) (IntegerConstant 24 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 5 c) (ArrayBroadcast (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) () ) (IntrinsicArrayFunction Shape [(Var 5 c)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () ) () .false. .false. ) (DoLoop () ((Var 5 i3) (IntegerConstant 1 (Integer 4) Decimal) (Var 5 n) (Var 5 s3)) [(DoLoop () ((Var 5 i2) (IntegerConstant 1 (Integer 4) Decimal) (Var 5 n) (Var 5 s2)) [(DoLoop () ((Var 5 i1) (IntegerConstant 1 (Integer 4) Decimal) (Var 5 n) (Var 5 s1)) [(DoLoop () ((Var 5 x) (Var 5 i2) (IntegerBinOp (IntegerBinOp (Var 5 i2) Add (Var 5 s2) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 6 (Integer 4) Decimal)) [(DoLoop () ((Var 5 y) (Var 5 i3) (IntegerBinOp (IntegerBinOp (Var 5 i3) Add (Var 5 s3) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 16 (Integer 4) Decimal)) [(SubroutineCall 2 kernel2 () [((ArrayPhysicalCast (Var 5 a) DescriptorArray DescriptorArray (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 5 b) DescriptorArray DescriptorArray (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 5 c) DescriptorArray DescriptorArray (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () )) ((Var 5 x)) ((Var 5 y)) ((Var 5 i1)) ((Var 5 s1))] () .false. )] [] )] [] )] [] )] [] )] [] )] () Public .true. .true. () ) }) matmul_01_cpu () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-func_arg_array-609769c.stderr0000664000175000017500000000027015174404631024636 0ustar alastairalastairsemantic error: Array passed into function has `6` elements but function expects `8`. --> tests/errors/func_arg_array.f90:4:14 | 4 | i = temp(myArray) | ^^^^^^^ lfortran-0.63.0/tests/reference/ast_disable_style_suggestion-implicit10-c95f35e.json0000664000175000017500000000103415174404631030604 0ustar alastairalastair{ "basename": "ast_disable_style_suggestion-implicit10-c95f35e", "cmd": "lfortran --show-ast --no-style-suggestions --no-color {infile} -o {outfile}", "infile": "tests/implicit10.f90", "infile_hash": "f0dec4633ec4724235e11ed6642f34f24f69c6f4dc41aab5ae903cfa", "outfile": null, "outfile_hash": null, "stdout": "ast_disable_style_suggestion-implicit10-c95f35e.stdout", "stdout_hash": "e766eabc3b601ac842b0fcd05655fbf683b50e15864c4e269840b3e6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-array2-456cd99.json0000664000175000017500000000070015174404631023117 0ustar alastairalastair{ "basename": "julia-array2-456cd99", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/array2.f90", "infile_hash": "ec67f153c5f506f6a12ef94b06d43c7e9e86b9fc33c9c196029183f0", "outfile": null, "outfile_hash": null, "stdout": "julia-array2-456cd99.stdout", "stdout_hash": "6626798dc1eb32ee609e58817932e55510893cdb5750ea30de9b8c7d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-block2-b06d9e1.stdout0000664000175000017500000001501515174404631023175 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { hybrd: (Function (SymbolTable 2 { delta: (Variable 2 delta [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), fcn: (Function (SymbolTable 3 { n: (Variable 3 n [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fcn (FunctionType [(Integer 4)] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 n)] [] () Public .false. .false. () ), main: (Block (SymbolTable 4 { }) main [(Assignment (Var 2 delta) (IntrinsicElementalFunction Abs [(Var 2 ratio)] 0 (Real 4) () ) () .false. .false. )] ), ratio: (Variable 2 ratio [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) hybrd (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(BlockCall -1 2 main )] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/llvm-string_02-c37e098.json0000664000175000017500000000075015174404631023374 0ustar alastairalastair{ "basename": "llvm-string_02-c37e098", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/string_02.f90", "infile_hash": "249fc849c605e3aad0bd2c8a33e00523fdc2270b95caa69737801caa", "outfile": null, "outfile_hash": null, "stdout": "llvm-string_02-c37e098.stdout", "stdout_hash": "bf1198c240a24b22f81b382ab14adda7c7f533cf65c3c32f3fab00b9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-subroutines_03-9a95e25.json0000664000175000017500000000076415174404631024274 0ustar alastairalastair{ "basename": "ast-subroutines_03-9a95e25", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_03.f90", "infile_hash": "432c4d3eb84ddddcc76b5371ed559a4688bf1e31676bb7e14c2aa3cf", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutines_03-9a95e25.stdout", "stdout_hash": "5e7f70a6ebdee01f46f90d984e09f330fe85044ed5d493cab4365d98", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-program1-29eca93.json0000664000175000017500000000072015174404631023367 0ustar alastairalastair{ "basename": "llvm-program1-29eca93", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/program1.f90", "infile_hash": "ec4ccdfed01d45648718ca57a9ceb3e5aa82e55e57d8906636902e7b", "outfile": null, "outfile_hash": null, "stdout": "llvm-program1-29eca93.stdout", "stdout_hash": "b890f45e1f991f70324ab531ea19d85370f161fc04d44a7ca2b4b813", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-functions_15-ce4c4bb.stdout0000664000175000017500000007660315174404631024504 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_15: (Program (SymbolTable 4 { a: (Variable 4 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Function (SymbolTable 5 { f: (Variable 5 f [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 5 x [] In () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Integer 4)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x)] [(Assignment (Var 5 f) (IntrinsicElementalFunction Present [(Var 5 x)] 0 (Logical 4) () ) () .false. .false. )] (Var 5 f) Public .true. .true. () ), sub_1: (ExternalSymbol 4 sub_1 2 sub_1 functions_15_module_1 [] sub_1 Public ) }) functions_15 [functions_15_module_1] [(Assignment (Var 4 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 4 b) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) () .false. .false. ) (SubroutineCall 4 sub_1 () [((Var 4 a)) ((Var 4 b)) ((LogicalConstant .true. (Logical 4) )) ((RealConstant 12.000000 (Real 4) )) ((IntegerConstant 5 (Integer 4) Decimal)) ((RealConstant 6.000000 (Real 4) ))] () .false. ) (SubroutineCall 4 sub_1 () [((Var 4 a)) ((Var 4 b)) ((LogicalConstant .false. (Logical 4) )) (()) (()) ((RealConstant 6.000000 (Real 4) ))] () .false. ) (SubroutineCall 4 sub_1 () [((Var 4 a)) ((Var 4 b)) ((LogicalConstant .true. (Logical 4) )) (()) ((IntegerConstant 78 (Integer 4) Decimal)) ((RealConstant 117.000000 (Real 4) ))] () .false. ) (SubroutineCall 4 sub_1 () [((Var 4 a)) ((Var 4 b)) ((LogicalConstant .false. (Logical 4) )) ((RealConstant 58.000000 (Real 4) )) (()) ((RealConstant 123.000000 (Real 4) ))] () .false. ) (Print (StringFormat () [(Var 4 a) (Var 4 b)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 4 a) NotEq (IntegerConstant 144288208 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 4 b) NotEq (RealConstant 1477476.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(FunctionCall 4 f () [(())] (Logical 4) () () ) (FunctionCall 4 f () [((IntegerConstant 42 (Integer 4) Decimal))] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), functions_15_module_1: (Module (SymbolTable 2 { sub_1: (Function (SymbolTable 3 { a: (Variable 3 a [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] InOut () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 3 c [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 3 d [] In () () Default (Real 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), e: (Variable 3 e [] In () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Variable 3 f [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub_1 (FunctionType [(Integer 4) (Real 4) (Logical 4) (Real 4) (Integer 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 c) (Var 3 d) (Var 3 e) (Var 3 f)] [(If () (IntrinsicElementalFunction Present [(Var 3 d)] 0 (Logical 4) () ) [(Assignment (Var 3 a) (Cast (RealBinOp (RealBinOp (Var 3 b) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) Add (Var 3 d) (Real 4) () ) RealToInteger (Integer 4) () () ) () .false. .false. ) (If () (IntrinsicElementalFunction Present [(Var 3 e)] 0 (Logical 4) () ) [(Assignment (Var 3 b) (RealBinOp (RealBinOp (Var 3 b) Mul (Var 3 f) (Real 4) () ) Add (Cast (Var 3 e) IntegerToReal (Real 4) () () ) (Real 4) () ) () .false. .false. )] [(Assignment (Var 3 b) (RealBinOp (Var 3 b) Mul (Var 3 f) (Real 4) () ) () .false. .false. )] )] [(Assignment (Var 3 a) (Cast (RealBinOp (Var 3 b) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) RealToInteger (Integer 4) () () ) () .false. .false. ) (If () (IntrinsicElementalFunction Present [(Var 3 e)] 0 (Logical 4) () ) [(Assignment (Var 3 b) (RealBinOp (RealBinOp (Var 3 b) Mul (Var 3 f) (Real 4) () ) Add (Cast (Var 3 e) IntegerToReal (Real 4) () () ) (Real 4) () ) () .false. .false. )] [(Assignment (Var 3 b) (RealBinOp (Var 3 b) Mul (Var 3 f) (Real 4) () ) () .false. .false. )] )] )] () Public .true. .true. () ) }) functions_15_module_1 () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/llvm-operator_overloading_02-adb886e.stdout0000664000175000017500000001256515174404631027031 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [13 x i8] c"S-DESC-5,L32\00", align 1 @string_const_data = private constant [5 x i8] c"tf=0:" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data, i32 0, i32 0), i64 5 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [13 x i8] c"S-DESC-5,L32\00", align 1 @string_const_data.2 = private constant [5 x i8] c"tf=1:" @string_const.3 = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data.2, i32 0, i32 0), i64 5 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_overload_assignment_m_logical_gets_integer(i32* %tf, i32* %i) { .entry: %0 = load i32, i32* %i, align 4 %1 = icmp eq i32 %0, 0 %2 = zext i1 %1 to i32 store i32 %2, i32* %tf, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_logical_gets_integer FINALIZE_SYMTABLE_logical_gets_integer: ; preds = %return ret void } define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() %call_arg_value = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %tf = alloca i32, align 4 store i32 0, i32* %call_arg_value, align 4 call void @__module_overload_assignment_m_logical_gets_integer(i32* %tf, i32* %call_arg_value) %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const, i32* %tf) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry store i32 1, i32* %call_arg_value, align 4 call void @__module_overload_assignment_m_logical_gets_integer(i32* %tf, i32* %call_arg_value) %14 = alloca i64, align 8 %15 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info.1, i32 0, i32 0), i64* %14, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.3, i32* %tf) %16 = load i64, i64* %14, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %15, i8** %17, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %16, i64* %18, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %20 = load i8*, i8** %19, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %22 = load i64, i64* %21, align 8 %23 = trunc i64 %22 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %20, i32 %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %24 = icmp eq i8* %15, null br i1 %24, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %2, i8* %15) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done br label %return return: ; preds = %free_done3 br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/ast-interface1-1906de3.stdout0000664000175000017500000000231515174404631023764 0ustar alastairalastair(TranslationUnit [(Module interface1 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Interface (InterfaceHeaderName randn ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [randn_scalar] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [randn_vector] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [randn_matrix] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [randn_vector_n] [(SimpleAttribute AttrModule )] () )] )] [] [] )] ) lfortran-0.63.0/tests/reference/run-file_open_06-cc72219.stdout0000664000175000017500000000001315174404631024215 0ustar alastairalastair +1.0 PASS lfortran-0.63.0/tests/reference/asr-cmd_01-e172099.stdout0000664000175000017500000001262415174404631022735 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { test_get_command_argument: (Program (SymbolTable 2 { arg: (Variable 2 arg [] Local () () Default (String 1 (IntegerConstant 32 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), count: (Variable 2 count [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_get_command_argument [] [(Assignment (Var 2 count) (IntrinsicElementalFunction CommandArgumentCount [] 0 (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "count: " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 count)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (IntrinsicImpureSubroutine GetCommandArgument [(Var 2 i) (Var 2 arg)] 1 ) (Print (StringFormat () [(IntrinsicElementalFunction StringTrim [(Var 2 arg)] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-format_01-b8a6dbf.stdout0000664000175000017500000001521415174404631023756 0ustar alastairalastair(TranslationUnit [(Program format_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(y [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(z [] [] () () None ())] () )] [(Format 1 "/,'BDF2 step ',i6,': T=',es12.5,', H=',es12.5,', ETAH=',es12.5" () ) (Format 2 "/ ,'BDF2 step ',i6,': T=',es12.5,', H=',es12.5,', ETAH=',es12.5" () ) (Format 3 " /,'BDF2 step ',i6,': T=',es12.5,', H=',es12.5,', ETAH=',es12.5" () ) (Format 4 "2x,'Preconditioner update FAILED at T=',es12.5,', ETAH=',es12.5" () ) (Format 5 "/" () ) (Format 6 "/ " () ) (Format 7 " /" () ) (Format 8 "i6, /" () ) (Format 9 "i6,/" () ) (Format 10 "/ , /" () ) (Format 121 " /, 80A, / " () ) (Format 122 " /, 80A, /" () ) (Format 123 "/, 80A, /" () ) (Format 124 "/, 80A, / " () ) (Format 130 " 10X, 'keyword Input Echo - Values from input or default', / ,80A, / " () ) (Format 131 " 10X, 'keyword Input Echo - Values from input or default', / ,80A, /" () ) (Format 158 " 4X, 'epsi = ', ES11.4, /, 4X, 'iitm = ', I3, /, 4X, 'oitm = ', I4, /, 4X, 'timedep = ', I1, /, 4X, 'swp_typ = ', I1, /, 4X, 'multiswp = ', I1, /, 4X, 'angcpy = ', I1, /, 4X, 'it_det = ', I1, /, 4X, 'soloutp = ', I1, /, 4X, 'kplane = ', I4, /, 4X, 'popout = ', I1, /, 4X, 'fluxp = ', I1, /, 4X, 'fixup = ', I1, / " () ) (Format 161 " 'slgg(nmat,nmom,ng,ng) echo', /, 'Column-order loops:',' Mats (fastest ), Moments, Groups, Groups (slowest)' " () ) (Format 162 " 2X, ES15.8, 2X, ES15.8, 2X, ES15.8, 2X, ES15.8 " () ) (Format 221 " 4X, 'Group ', I3, 4X, ' Inner ', I5, 4X, ' Dfmxi ', ES11.4, ' Fixup x/y/z/t ', 4(ES9.2,1x) " () ) (Format 306 " 2X, I4, 6(1X, ES11.4) " () ) (Format 324 " 4(2X, ES17.10) " () ) (Format 422 " /, 4X, 'Manufactured/Computed Solutions Max Diff=', ES13.6 " () ) (Format 500 " \"IARRAY =\", *( I0, :, \",\")" () ) (Format 501 "*( I0, :, \",\")" () ) (Format 510 "1X, F10.3, I5, F10.3, I5/F10.3, I5, F10.3, I5" () ) (Format 511 "3/,I5" () ) (Format 512 "3/" () ) (Format 513 "1x, A, 3/ 1x, 2(I10,F10.2) // 1x, 2E15.7" () ) (Format 520 "1X, I1, 1X, 'ISN''T', 1X, I1" () ) (Format 530 "1PE12.4, I10" () ) (Format 540 "I12, /, ' Dates: ', 2 (2I3, I5)" () ) (Format 550 "ES12.3, ES12.3E3, G3.4, G3.4E100" () ) (Format 600 "//,63x,'Internal',/, 1x,'Cell',3(5x,'Temp '), 7x,'P',8x,'Density',6x,'Energy', /,2x,'Num',6x,'(K)',7x,'(C)',7x,'(F)',6x,'(Pa)',6x, '(kg/m**3)',5x,'(J/kg)' " () ) (Format 610 "71('-'),/,(1x,i4,0p,3f10.1,1p,3e12.3)" () ) (Format 620 "(1x,i4,0p,3(2x,'|',2x,f5.1),1p, 3(1x,'|',1x,e9.3))" () ) (Format 630 " //,' Format Number ',i4" () ) (Format 631 "//,' Format Number ',i4" () ) (Format 640 "\"Table form of A\"/(2F8.2)" () ) (Format 650 " 5X, 'ng= ', I4, / 5X, 'mat_opt= ', I2, / 5X, 'src_opt= ', I2, / 5X, 'scatp= ', I2 " () ) (Format 660 "' Format Number ',0PF17.8,' Ry' " () ) (Format 670 "/'xx'" () ) (Format 680 "/\"xx\"" () ) (Format 690 "/ \"xx\"" () ) (Format 700 "/ 'xx'" () ) (Format 710 "/ i5, 'x'" () ) (Format 720 "// i5, 'x'" () ) (Format 730 "//" () ) (Assignment 0 x 5 () ) (Format 740 "/1X'(',I2,')', X, A" () )] [] )] ) lfortran-0.63.0/tests/reference/ast-fixedform_doloop2-16b2c78.json0000664000175000017500000000076315174404631025021 0ustar alastairalastair{ "basename": "ast-fixedform_doloop2-16b2c78", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_doloop2.f", "infile_hash": "1e901265b799422661c4ababbb8e255b94fd6cbcfd34827ccecd54d8", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_doloop2-16b2c78.stdout", "stdout_hash": "876d76d17f1dc1a1e5429b8ecf27d7e44afcfbe46e90a799cfe6c833", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-int_02-e7de6a7.stdout0000664000175000017500000001331315174404631023203 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_15: (Program (SymbolTable 2 { x1: (Variable 2 x1 [] Local (RealConstant 3.300000 (Real 4) ) (RealConstant 3.300000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x2: (Variable 2 x2 [] Local (IntegerConstant 7 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y1: (Variable 2 y1 [x1] Local (IntrinsicElementalFunction Int [(Var 2 x1)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y2: (Variable 2 y2 [x2] Local (IntrinsicElementalFunction Int [(Var 2 x2)] 0 (Integer 4) (IntegerConstant 7 (Integer 4) Decimal) ) (IntegerConstant 7 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_15 [] [(Print (StringFormat () [(Var 2 y1) (Var 2 y2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-fn_call1-fcd6b9c.json0000664000175000017500000000073015174404631023753 0ustar alastairalastair{ "basename": "ast_f90-fn_call1-fcd6b9c", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/fn_call1.f90", "infile_hash": "fd319232dcd65e8f2c7722a5f8da034557658cb0a081224347fd1de6", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-fn_call1-fcd6b9c.stdout", "stdout_hash": "5f339fc44ee209b660588ca293bd90211b6797a86f69eada7ae5ef71", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_type_03-a9e3c15.stderr0000664000175000017500000000037415174404631024771 0ustar alastairalastairsemantic error: Passed object dummy argument does not match function argument --> tests/errors/derived_type_03.f90:7:9 | 7 | procedure(testing_interface), deferred :: testing | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-global_scope4-1af6ab9.json0000664000175000017500000000073415174404631024246 0ustar alastairalastair{ "basename": "asr-global_scope4-1af6ab9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope4.f90", "infile_hash": "da0256e95ad866af376d9ded3cd439463cb1e47dffac6aa88c0bbadf", "outfile": null, "outfile_hash": null, "stdout": "asr-global_scope4-1af6ab9.stdout", "stdout_hash": "4d1df7c7c01ce42978150acbd5605e97a9ae5351a351207413d0d255", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_typing3-c82e537.json0000664000175000017500000000077615174404631024675 0ustar alastairalastair{ "basename": "asr-implicit_typing3-c82e537", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/errors/implicit_typing3.f90", "infile_hash": "52031ab41770ad4bad18b3bb531777da6ece1a5be640043d6a1605d4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit_typing3-c82e537.stderr", "stderr_hash": "515c19327a17d5b2120b4d1677df5f90ccc9eab0b82be69c50a5f1fc", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-ifix_01-ed76fb2.stderr0000664000175000017500000000024715174404631023327 0ustar alastairalastairsemantic error: first argument of `ifix` must have kind equal to 4 --> tests/errors/ifix_01.f90:2:14 | 2 | print *, ifix(4.23_8) | ^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-error_stop1-ccc2415.json0000664000175000017500000000075415174404631023727 0ustar alastairalastair{ "basename": "ast-error_stop1-ccc2415", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/error_stop1.f", "infile_hash": "4cc33f8c74237a43dc0babd1d81362d82c4e688fd2dfe008e32b73a2", "outfile": null, "outfile_hash": null, "stdout": "ast-error_stop1-ccc2415.stdout", "stdout_hash": "f00c7ead66b49ed45488f2d6a0c6824dae35ce6a5703f3c1fda6948f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor5-fdb91a5.json0000664000175000017500000000077015174404631026613 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor5-fdb91a5", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor5.f90", "infile_hash": "96309887c38d452524fc1048a69f630c58fd72edb53964e858ffd7dd", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor5-fdb91a5.stdout", "stdout_hash": "cd13e7af6dab54aa09d6f02c19a2258732ec4408cdf22f44a8563dc4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_interface2-5630d9d.stdout0000664000175000017500000002602615174404631025665 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { implicit_interface2: (Program (SymbolTable 2 { f: (Function (SymbolTable 3 { f_arg_0: (Variable 3 f_arg_0 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f_return_var_name: (Variable 3 f_return_var_name [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Integer 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 f_arg_0)] [] (Var 3 f_return_var_name) Public .false. .false. () ), g: (Function (SymbolTable 4 { g_arg_0: (Variable 4 g_arg_0 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), g_arg_1: (Variable 4 g_arg_1 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), g_return_var_name: (Variable 4 g_return_var_name [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) g (FunctionType [(Integer 4) (Real 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 g_arg_0) (Var 4 g_arg_1)] [] (Var 4 g_return_var_name) Public .false. .false. () ) }) implicit_interface2 [] [(Print (StringFormat () [(FunctionCall 2 f () [((IntegerConstant 5 (Integer 4) Decimal))] (Real 8) () () ) (FunctionCall 2 g () [((IntegerConstant 1 (Integer 4) Decimal)) ((RealConstant 3.000000 (Real 4) ))] (Real 8) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-implicit11-95f56fd.stdout0000664000175000017500000002143115174404631024012 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f1: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Unspecified () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Unspecified () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f1 (FunctionType [(Complex 8) (Complex 8)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 z) (Var 2 i)] [(Assignment (Var 2 z) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToComplex (Complex 8) (ComplexConstant 5.000000 0.000000 (Complex 8) ) () ) () .false. .false. ) (Print (StringFormat () [(IntrinsicElementalFunction Aimag [(Var 2 z)] 0 (Real 8) () ) (IntrinsicElementalFunction Aimag [(Var 2 i)] 0 (Real 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] (Var 2 f1) Public .false. .false. () ), f2: (Function (SymbolTable 3 { i: (Variable 3 i [] Unspecified () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 3 z [] Unspecified () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f2 (FunctionType [(Complex 8) (Complex 8)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 z) (Var 3 i)] [(Assignment (Var 3 z) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToComplex (Complex 8) (ComplexConstant 5.000000 0.000000 (Complex 8) ) () ) () .false. .false. )] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/ast-builtin1-1b5ca89.stdout0000664000175000017500000000664415174404631023564 0ustar alastairalastair(TranslationUnit [(Program builtin_01 (TriviaNode [(EndOfLine) (Comment "! AST only tests" )] [] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Inquire 0 [] [(unit n) (opened inuse)] [] () ) (Inquire 0 [] [(UNIT JOAN) (OPENED LOG_01) (NAMED LOG_02) (FORM CHAR_VAR) (IOSTAT IOS)] [] () ) (Inquire 0 [] [(IOLENGTH IOL)] [(FuncCallOrArray A [] [(1 N 1 0)] [] [] [] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Rewind 0 [s] [] () ) (Rewind 0 [s] [] () ) (Rewind 0 [10] [] () ) (Rewind 0 [] [(err label) (unit s)] () ) (Rewind 0 [(FuncCallOrArray iunit [] [(() 13 () 0)] [] [] [] )] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Backspace 0 [u] [] () ) (Backspace 0 [io_unit] [] () ) (Backspace 0 [10] [] () ) (Backspace 0 [10] [(IOSTAT N)] () ) (Backspace 0 [(FuncCallOrArray iunit [] [(() 13 () 0)] [] [] [] )] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Endfile 0 [K] [] () ) (Endfile 0 [5] [] () ) (Endfile 0 [k] [] () ) (Endfile 0 [10] [(iostat n)] () ) (Endfile 0 [] [(unit iout) (iostat ios) (iomsg msg)] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/ast-sync1-9624944.json0000664000175000017500000000070415174404631022301 0ustar alastairalastair{ "basename": "ast-sync1-9624944", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/sync1.f90", "infile_hash": "363462c860cc54ea57727a4d2ee43782f907dd682bcafcb8fa2017cb", "outfile": null, "outfile_hash": null, "stdout": "ast-sync1-9624944.stdout", "stdout_hash": "1b5fa1990ef0452d2709b23be0b5977d1c6e69a479a811b6bd8d81ab", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-subroutines_01-6bd865a.stdout0000664000175000017500000000236215174404631025230 0ustar alastairalastairfunction f(a::Int32, b::Base.RefValue{Int32}) b[] = a + 1 end function main() local i::Int32 local j::Int32 i = 1 j = 1 if j ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end __j_ref__= Ref(j) f(i, __j_ref__) j = __j_ref__[] println(i, " ", j) if i ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end if j ≠ 2 println(Base.stderr, "ERROR STOP") exit(1) end j = 1 if j ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end __j_ref__= Ref(j) f(Int32(3), __j_ref__) j = __j_ref__[] println(j) if j ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end j = 1 if j ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end __j_ref__= Ref(j) f(Int32(1 + 2), __j_ref__) j = __j_ref__[] println(j) if j ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end j = 1 if j ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end __j_ref__= Ref(j) f(Int32(i + 2), __j_ref__) j = __j_ref__[] println(j) if j ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-0.63.0/tests/reference/asr-kind2-191347a.json0000664000175000017500000000071315174404631022315 0ustar alastairalastair{ "basename": "asr-kind2-191347a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind2.f90", "infile_hash": "fe00584d15da135638cfe95fce629f431f82a273029cfb742ef534f3", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind2-191347a.stderr", "stderr_hash": "eaa6cf89bba5d3dfb23b915a22737aa52e0c11aa01eae1a4e3e3e2e0", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-allocate_01-ce7628b.json0000664000175000017500000000072615174404631023547 0ustar alastairalastair{ "basename": "ast-allocate_01-ce7628b", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/allocate_01.f90", "infile_hash": "7a28f6115b781d328be0829189ace20f4f862bf745740c6c78400225", "outfile": null, "outfile_hash": null, "stdout": "ast-allocate_01-ce7628b.stdout", "stdout_hash": "29fe560e6eae2987477bffd4880efd8abe5f9a4ba4b83312a889e625", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format7-5662bc0.json0000664000175000017500000000066215174404631022765 0ustar alastairalastair{ "basename": "run-format7-5662bc0", "cmd": "lfortran --no-color {infile}", "infile": "tests/format7.f90", "infile_hash": "2fa302a9dea408e1cee5ae34903a7ed59a6c729180d468f537a6caf5", "outfile": null, "outfile_hash": null, "stdout": "run-format7-5662bc0.stdout", "stdout_hash": "1953aa3f8f698f07a3be0ac613c646ed528adc664959cc638cabd693", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-arrays_02_size-ab6ee62.json0000664000175000017500000000076415174404631024371 0ustar alastairalastair{ "basename": "asr-arrays_02_size-ab6ee62", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_02_size.f90", "infile_hash": "38abe88ea3a7e82aa0d9dd390578cda301e16cccabaefeaab3650c5f", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_02_size-ab6ee62.stdout", "stdout_hash": "8bb9e07c0bd42b7ff7d764e86420e41b549d7214e60dd8d97fb7bab3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-loop_unroll_small-13135c0.json0000664000175000017500000000077515174404631025040 0ustar alastairalastair{ "basename": "asr-loop_unroll_small-13135c0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/loop_unroll_small.f90", "infile_hash": "5a308fd86dceda8d2b6a3c4fcb2412bf4d1b3f043105d06956960db8", "outfile": null, "outfile_hash": null, "stdout": "asr-loop_unroll_small-13135c0.stdout", "stdout_hash": "aa02154973be3584255ac2523db9c64633d2360f7eab3da25d8715b0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-case_03-b4597f9.json0000664000175000017500000000073015174404631023141 0ustar alastairalastair{ "basename": "julia-case_03-b4597f9", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/case_03.f90", "infile_hash": "4fc1bb48b2136f22bb44b7c69aaa05a43b4ed2e4b8464c433340295d", "outfile": null, "outfile_hash": null, "stdout": "julia-case_03-b4597f9.stdout", "stdout_hash": "459246866bf743d18ebaef865b8bdcf461382930e4a850f5fe9ae164", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-complex_07-71c3c47.json0000664000175000017500000000075015174404631023346 0ustar alastairalastair{ "basename": "asr-complex_07-71c3c47", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_07.f90", "infile_hash": "fb49a785b3424190cd1c321680f4566fa5dc0ea30569ab7624004d2f", "outfile": null, "outfile_hash": null, "stdout": "asr-complex_07-71c3c47.stdout", "stdout_hash": "048b891ab9091674c4b694e6602eec77ea0672fb7a1234b8c2be84a2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-subroutine6-265d498.json0000664000175000017500000000073515174404631023613 0ustar alastairalastair{ "basename": "asr-subroutine6-265d498", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/subroutine6.f90", "infile_hash": "5bc0c9df124afea67ceb9278de7bb1436d4f1b31ae40c6edddf5838c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-subroutine6-265d498.stderr", "stderr_hash": "42e57dd8f16b0aabba5ffbcdce0c8d55d48e2a88f797fd2bcd0ba90e", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-program1-caa9665.stdout0000664000175000017500000000133615174404631023560 0ustar alastairalastair(TranslationUnit [(Program program1 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(Assignment 0 i 5 () ) (Print 0 () [i] () ) (Print 0 () [(+ i 1)] () )] [] )] ) lfortran-0.63.0/tests/reference/ast_f90-program_04-4e711d5.json0000664000175000017500000000076315174404631024026 0ustar alastairalastair{ "basename": "ast_f90-program_04-4e711d5", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/program_04.f90", "infile_hash": "6d4faa951231e470e99cbc3ff617437048ceb99e3d92ba6e7810ef43", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-program_04-4e711d5.stdout", "stdout_hash": "50ee720f2d8e312d6a47c95d2456e67eb3c05a875b6192195957bdcc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-callback_05-c86f2cc.stdout0000664000175000017500000000762515174404631024342 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @main.x = internal global i32 5 define void @__module_callback_05_px_call1(i32* %x) { .entry: call void @__module_callback_05_px_call2(void (i32*)* @px_call1.__module_callback_05_printx, i32* %x) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_px_call1 FINALIZE_SYMTABLE_px_call1: ; preds = %return ret void } define void @px_call1.__module_callback_05_printx(i32* %x) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %1 = alloca i64, align 8 %2 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %1, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %x) %3 = load i64, i64* %1, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %2, i8** %4, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %3, i64* %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %7 = load i8*, i8** %6, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %9 = load i64, i64* %8, align 8 %10 = trunc i64 %9 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %7, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %11 = icmp eq i8* %2, null br i1 %11, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %2) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_printx FINALIZE_SYMTABLE_printx: ; preds = %return ret void } define void @__module_callback_05_px_call2(void (i32*)* %f, i32* %x) { .entry: call void @__module_callback_05_px_call3(void (i32*)* %f, i32* %x) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_px_call2 FINALIZE_SYMTABLE_px_call2: ; preds = %return ret void } declare void @f(i32*) define void @__module_callback_05_px_call3(void (i32*)* %f, i32* %x) { .entry: call void %f(i32* %x) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_px_call3 FINALIZE_SYMTABLE_px_call3: ; preds = %return ret void } declare void @f.1(i32*) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @__module_callback_05_px_call1(i32* @main.x) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootlfortran-0.63.0/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-modules_45-db3a04a.stdoutlfortran-0.63.0/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-module0000664000175000017500000041243515174404631035006 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_45: (Program (SymbolTable 7 { compiler_name: (Variable 7 compiler_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), file_scope_flag: (ExternalSymbol 7 file_scope_flag 2 file_scope_flag modules_45_fpm_manifest_profile [] file_scope_flag Public ), get_flags: (ExternalSymbol 7 get_flags 2 get_flags modules_45_fpm_manifest_profile [] get_flags Public ), new_profile: (ExternalSymbol 7 new_profile 2 new_profile modules_45_fpm_manifest_profile [] new_profile Public ), os_type: (Variable 7 os_type [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), os_valid: (Variable 7 os_valid [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), profile_config_t: (ExternalSymbol 7 profile_config_t 2 profile_config_t modules_45_fpm_manifest_profile [] profile_config_t Public ), profile_name: (Variable 7 profile_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), profiles: (Variable 7 profiles [] Local () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 7 profile_config_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), profindex: (Variable 7 profindex [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) modules_45 [modules_45_fpm_manifest_profile] [(Allocate [((Var 7 profile_name) [] (IntegerConstant 40 (Integer 4) Decimal) () (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString))] () () () ) (Allocate [((Var 7 compiler_name) [] (IntegerConstant 40 (Integer 4) Decimal) () (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString))] () () () ) (Allocate [((Var 7 profiles) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] () () ())] () () () ) (SubroutineCall 7 get_flags () [((Var 7 profile_name)) ((Var 7 compiler_name)) ((Var 7 os_type)) ((Var 7 profiles)) ((Var 7 profindex)) ((Var 7 os_valid))] () .false. )] ), modules_45_fpm_manifest_profile: (Module (SymbolTable 2 { file_scope_flag: (Struct (SymbolTable 3 { }) file_scope_flag (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () () [] ), get_flags: (Function (SymbolTable 6 { __libasr_created_dummy_variable_: (Variable 6 __libasr_created_dummy_variable_ [] Local () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_dummy_variable_1: (Variable 6 __libasr_created_dummy_variable_1 [] Local () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_dummy_variable_2: (Variable 6 __libasr_created_dummy_variable_2 [] Local () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_dummy_variable_3: (Variable 6 __libasr_created_dummy_variable_3 [] Local () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_dummy_variable_4: (Variable 6 __libasr_created_dummy_variable_4 [] Local () () Default (Array (StructType [] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) 2 file_scope_flag Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_variable_: (Variable 6 __libasr_created_variable_ [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_variable_pointer_: (Variable 6 __libasr_created_variable_pointer_ [] Local () () Default (Pointer (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_variable_pointer_1: (Variable 6 __libasr_created_variable_pointer_1 [] Local () () Default (Pointer (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_variable_pointer_2: (Variable 6 __libasr_created_variable_pointer_2 [] Local () () Default (Pointer (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_variable_pointer_3: (Variable 6 __libasr_created_variable_pointer_3 [] Local () () Default (Pointer (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_variable_pointer_4: (Variable 6 __libasr_created_variable_pointer_4 [] Local () () Default (Pointer (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 file_scope_flag Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c_flags: (Variable 6 c_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), compiler_name: (Variable 6 compiler_name [] In () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), cxx_flags: (Variable 6 cxx_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), err_message: (Variable 6 err_message [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), file_flags: (Variable 6 file_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), file_name: (Variable 6 file_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), file_scope_flags: (Variable 6 file_scope_flags [] Local () () Default (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 file_scope_flag Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), flags: (Variable 6 flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ifile: (Variable 6 ifile [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ikey: (Variable 6 ikey [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), is_valid: (Variable 6 is_valid [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), key_name: (Variable 6 key_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), link_time_flags: (Variable 6 link_time_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), os_type: (Variable 6 os_type [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), os_valid: (Variable 6 os_valid [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), profile_name: (Variable 6 profile_name [] In () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), profiles: (Variable 6 profiles [] InOut () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 profile_config_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), profindex: (Variable 6 profindex [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), stat: (Variable 6 stat [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_flags (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Integer 4) (Logical 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [new_profile] [(Var 6 profile_name) (Var 6 compiler_name) (Var 6 os_type) (Var 6 profiles) (Var 6 profindex) (Var 6 os_valid)] [(If () (IntrinsicImpureFunction Allocated [(Var 6 flags)] 0 (Logical 4) () ) [(Associate (Var 6 __libasr_created_variable_pointer_) (Var 6 flags) )] [(Associate (Var 6 __libasr_created_variable_pointer_) (Var 6 __libasr_created_dummy_variable_) )] ) (If () (IntrinsicImpureFunction Allocated [(Var 6 c_flags)] 0 (Logical 4) () ) [(Associate (Var 6 __libasr_created_variable_pointer_1) (Var 6 c_flags) )] [(Associate (Var 6 __libasr_created_variable_pointer_1) (Var 6 __libasr_created_dummy_variable_1) )] ) (If () (IntrinsicImpureFunction Allocated [(Var 6 cxx_flags)] 0 (Logical 4) () ) [(Associate (Var 6 __libasr_created_variable_pointer_2) (Var 6 cxx_flags) )] [(Associate (Var 6 __libasr_created_variable_pointer_2) (Var 6 __libasr_created_dummy_variable_2) )] ) (If () (IntrinsicImpureFunction Allocated [(Var 6 link_time_flags)] 0 (Logical 4) () ) [(Associate (Var 6 __libasr_created_variable_pointer_3) (Var 6 link_time_flags) )] [(Associate (Var 6 __libasr_created_variable_pointer_3) (Var 6 __libasr_created_dummy_variable_3) )] ) (If () (IntrinsicImpureFunction Allocated [(Var 6 file_scope_flags)] 0 (Logical 4) () ) [(Associate (Var 6 __libasr_created_variable_pointer_4) (Var 6 file_scope_flags) )] [(Associate (Var 6 __libasr_created_variable_pointer_4) (Var 6 __libasr_created_dummy_variable_4) )] ) (Assignment (ArrayItem (Var 6 profiles) [(() (Var 6 profindex) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Logical 4)] [] .true. .false. ) ColMajor () ) (FunctionCall 2 new_profile () [((Var 6 profile_name)) ((Var 6 compiler_name)) ((Var 6 os_type)) ((Var 6 __libasr_created_variable_pointer_)) ((LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 6 flags)] 0 (Logical 4) () ) And (LogicalConstant .true. (Logical 4) ) (Logical 4) () )) ((Var 6 __libasr_created_variable_pointer_1)) ((LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 6 c_flags)] 0 (Logical 4) () ) And (LogicalConstant .true. (Logical 4) ) (Logical 4) () )) ((Var 6 __libasr_created_variable_pointer_2)) ((LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 6 cxx_flags)] 0 (Logical 4) () ) And (LogicalConstant .true. (Logical 4) ) (Logical 4) () )) ((Var 6 __libasr_created_variable_pointer_3)) ((LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 6 link_time_flags)] 0 (Logical 4) () ) And (LogicalConstant .true. (Logical 4) ) (Logical 4) () )) ((Var 6 __libasr_created_variable_pointer_4)) ((LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 6 file_scope_flags)] 0 (Logical 4) () ) And (LogicalConstant .true. (Logical 4) ) (Logical 4) () )) ((Var 6 __libasr_created_variable_)) ((LogicalConstant .false. (Logical 4) ))] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Logical 4)] [] .true. .false. ) () () ) () .false. .false. ) (Assignment (Var 6 profindex) (IntegerBinOp (Var 6 profindex) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ), new_profile: (Function (SymbolTable 5 { __libasr_is_present_c_flags: (Variable 5 __libasr_is_present_c_flags [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_is_present_cxx_flags: (Variable 5 __libasr_is_present_cxx_flags [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_is_present_file_scope_flags: (Variable 5 __libasr_is_present_file_scope_flags [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_is_present_flags: (Variable 5 __libasr_is_present_flags [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_is_present_is_built_in: (Variable 5 __libasr_is_present_is_built_in [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_is_present_link_time_flags: (Variable 5 __libasr_is_present_link_time_flags [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c_flags: (Variable 5 c_flags [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), compiler: (Variable 5 compiler [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), cxx_flags: (Variable 5 cxx_flags [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), file_scope_flags: (Variable 5 file_scope_flags [] In () () Default (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) 2 file_scope_flag Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), flags: (Variable 5 flags [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), is_built_in: (Variable 5 is_built_in [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), link_time_flags: (Variable 5 link_time_flags [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), os_type: (Variable 5 os_type [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), profile: (Variable 5 profile [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Logical 4)] [] .true. .false. ) 2 profile_config_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), profile_name: (Variable 5 profile_name [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_profile (FunctionType [(String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (Integer 4) (String 1 () AssumedLength DescriptorString) (Logical 4) (String 1 () AssumedLength DescriptorString) (Logical 4) (String 1 () AssumedLength DescriptorString) (Logical 4) (String 1 () AssumedLength DescriptorString) (Logical 4) (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) (Logical 4) (Logical 4) (Logical 4)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Logical 4)] [] .true. .false. ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 profile_name) (Var 5 compiler) (Var 5 os_type) (Var 5 flags) (Var 5 __libasr_is_present_flags) (Var 5 c_flags) (Var 5 __libasr_is_present_c_flags) (Var 5 cxx_flags) (Var 5 __libasr_is_present_cxx_flags) (Var 5 link_time_flags) (Var 5 __libasr_is_present_link_time_flags) (Var 5 file_scope_flags) (Var 5 __libasr_is_present_file_scope_flags) (Var 5 is_built_in) (Var 5 __libasr_is_present_is_built_in)] [] (Var 5 profile) Public .true. .true. () ), profile_config_t: (Struct (SymbolTable 4 { c_flags: (Variable 4 c_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), compiler: (Variable 4 compiler [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), cxx_flags: (Variable 4 cxx_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), file_scope_flags: (Variable 4 file_scope_flags [] Local () () Default (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 file_scope_flag Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), flags: (Variable 4 flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), is_built_in: (Variable 4 is_built_in [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), link_time_flags: (Variable 4 link_time_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), os_type: (Variable 4 os_type [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), profile_name: (Variable 4 profile_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) profile_config_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Logical 4)] [] .true. .false. ) [] [profile_name compiler os_type flags c_flags cxx_flags link_time_flags file_scope_flags is_built_in] [] Source Public .false. .false. [] () () [] ) }) modules_45_fpm_manifest_profile () [modules_45_fpm_manifest_profile] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-subroutines_09-83ddd2b.stdout0000664000175000017500000006275715174404631025012 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 5 { a: (Variable 5 a [] Local (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Variable 5 f [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), get_elem_table@get_value: (ExternalSymbol 5 get_elem_table@get_value 2 get_elem_table subroutines_09_tomlf_build_array [] get_elem_table Public ), get_elem_value_string@get_value: (ExternalSymbol 5 get_elem_value_string@get_value 2 get_elem_value_string subroutines_09_tomlf_build_array [] get_elem_value_string Public ), get_value: (ExternalSymbol 5 get_value 2 get_value subroutines_09_tomlf_build_array [] get_value Public ), get_value@get_elem_table: (ExternalSymbol 5 get_value@get_elem_table 2 get_elem_table subroutines_09_tomlf_build_array [] get_elem_table Private ), get_value@get_elem_value_string: (ExternalSymbol 5 get_value@get_elem_value_string 2 get_elem_value_string subroutines_09_tomlf_build_array [] get_elem_value_string Private ), pos: (Variable 5 pos [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ptr: (Variable 5 ptr [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main [subroutines_09_tomlf_build_array] [(SubroutineCall 5 get_value@get_elem_table 5 get_value [((Var 5 a)) ((Var 5 pos)) ((Var 5 ptr)) ((Var 5 f))] () .false. ) (SubroutineCall 5 get_value@get_elem_value_string 5 get_value [((Var 5 f)) ((Var 5 pos)) ((Var 5 ptr)) (()) ((Var 5 f))] () .false. )] ), subroutines_09_tomlf_build_array: (Module (SymbolTable 2 { get_elem_table: (Function (SymbolTable 3 { array: (Variable 3 array [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pos: (Variable 3 pos [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ptr: (Variable 3 ptr [] Out () () Default (Pointer (Integer 4) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), stat: (Variable 3 stat [] Out () () Default (Logical 4) () Source Private Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_elem_table (FunctionType [(Integer 4) (Integer 4) (Pointer (Integer 4) ) (Logical 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 array) (Var 3 pos) (Var 3 ptr) (Var 3 stat)] [(Nullify [(Var 3 ptr)] ) (Assignment (Var 3 stat) (LogicalConstant .true. (Logical 4) ) () .false. .false. )] () Private .true. .true. () ), get_elem_value_string: (Function (SymbolTable 4 { array: (Variable 4 array [] InOut () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), def: (Variable 4 def [] Out () () Default (Integer 4) () Source Private Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), pos: (Variable 4 pos [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ptr: (Variable 4 ptr [] Out () () Default (Pointer (Integer 4) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), stat: (Variable 4 stat [] Out () () Default (Logical 4) () Source Private Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_elem_value_string (FunctionType [(Logical 4) (Integer 4) (Pointer (Integer 4) ) (Integer 4) (Logical 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 array) (Var 4 pos) (Var 4 ptr) (Var 4 def) (Var 4 stat)] [(Nullify [(Var 4 ptr)] ) (Assignment (Var 4 stat) (LogicalConstant .true. (Logical 4) ) () .false. .false. )] () Private .true. .true. () ), get_value: (GenericProcedure 2 get_value [2 get_elem_table 2 get_elem_value_string] Public ) }) subroutines_09_tomlf_build_array () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_array_01-691b151.stdout0000664000175000017500000020466615174404631025204 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_array_01: (Program (SymbolTable 10 { array_tmpl: (ExternalSymbol 10 array_tmpl 2 array_tmpl template_array_01_m [] array_tmpl Public ), r: (ExternalSymbol 10 r 2 r template_array_01_m [] r Public ), test_template: (ExternalSymbol 10 test_template 2 test_template template_array_01_m [] test_template Public ) }) template_array_01 [template_array_01_m] [(SubroutineCall 10 test_template () [] () .false. )] ), template_array_01_m: (Module (SymbolTable 2 { array_tmpl: (Template (SymbolTable 4 { insert_t: (Function (SymbolTable 5 { i: (Variable 5 i [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lst: (Variable 5 lst [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 5 r [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) insert_t (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 lst) (Var 5 i)] [(Assignment (ArrayItem (Var 5 lst) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) (Var 5 i) () .false. .false. ) (Assignment (Var 5 r) (ArrayItem (Var 5 lst) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) () .false. .false. )] (Var 5 r) Public .true. .true. () ), insert_t_n: (Function (SymbolTable 6 { i: (Variable 6 i [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lst: (Variable 6 lst [n] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 6 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 6 r [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) insert_t_n (FunctionType [(Integer 4) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 n) (Var 6 lst) (Var 6 i)] [(Assignment (ArrayItem (Var 6 lst) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) (Var 6 i) () .false. .false. ) (Assignment (Var 6 r) (ArrayItem (Var 6 lst) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) () .false. .false. )] (Var 6 r) Private .true. .true. () ), t: (Variable 4 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) array_tmpl [t] [(Require r [t] )] ), r: (Requirement (SymbolTable 3 { t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) r [t] [] ), test_template: (Function (SymbolTable 7 { a: (Variable 7 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 7 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), insert_int: (Function (SymbolTable 8 { i: (Variable 8 i [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lst: (Variable 8 lst [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 8 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) insert_int (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray ) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 lst) (Var 8 i)] [(Assignment (ArrayItem (Var 8 lst) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Var 8 i) () .false. .false. ) (Assignment (Var 8 r) (ArrayItem (Var 8 lst) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. )] (Var 8 r) Public .true. .true. () ), insert_int_n: (Function (SymbolTable 9 { i: (Variable 9 i [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lst: (Variable 9 lst [n] In () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 9 n))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 9 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 9 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) insert_int_n (FunctionType [(Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray ) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 n) (Var 9 lst) (Var 9 i)] [(Assignment (ArrayItem (Var 9 lst) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Var 9 i) () .false. .false. ) (Assignment (Var 9 r) (ArrayItem (Var 9 lst) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. )] (Var 9 r) Private .true. .true. () ), r: (Variable 7 r [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (ArrayItem (Var 7 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 7 i) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 7 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 7 r) (FunctionCall 7 insert_int () [((ArrayPhysicalCast (Var 7 a) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] DescriptorArray ) () )) ((Var 7 i))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 7 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (ArrayItem (Var 7 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 7 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 7 r) (FunctionCall 7 insert_int_n () [((ArraySize (Var 7 a) () (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) )) ((ArrayPhysicalCast (Var 7 a) FixedSizeArray PointerArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Mul (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () )) ((Var 7 i))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 7 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_array_01_m () [template_array_01_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/run-read2-7b581ec.stdout0000664000175000017500000000041615174404631023040 0ustar alastairalastairphifile: T F lfortran-0.63.0/tests/reference/asr-incompatible_dimension_assignment_arr2-3867783.json0000664000175000017500000000105615174404631031140 0ustar alastairalastair{ "basename": "asr-incompatible_dimension_assignment_arr2-3867783", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incompatible_dimension_assignment_arr2.f90", "infile_hash": "f3f2370b6a0b01d3cea561679f559769fc74d0a3e5100a33c249e0c7", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incompatible_dimension_assignment_arr2-3867783.stderr", "stderr_hash": "b774158a1115ef8b895a06920255e024b47c4d489e57b3642a65baf9", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-dim_assgn_test-4df3c08.stderr0000664000175000017500000000055015174404631025004 0ustar alastairalastairwarning: Dimensions are specified twice --> tests/errors/dim_assgn_test.f90:3:19 | 3 | integer, private, dimension(2,2) :: a(2,3) | ^^^^^^^^^^^^^^ ^^^^^^ help: consider specifying it just one way or the other semantic error: Variable 'x' is not declared --> tests/errors/dim_assgn_test.f90:5:1 | 5 | x = 5 | ^ 'x' is undeclared lfortran-0.63.0/tests/reference/ast-fixed_form_2-1350599.stderr0000664000175000017500000000021715174404631024132 0ustar alastairalastairsyntax error: Token 'x' (of type 'identifier') is unexpected here --> tests/errors/fixed_form_2.f:3:12 | 3 | y = 5x | ^ lfortran-0.63.0/tests/reference/run-allocatable_component_reshape_unallocated_01-15046b1.stderr0000664000175000017500000000050215174404631032553 0ustar alastairalastairruntime error: Array 'x%arr' is not allocated. Allocate it manually or use the '--realloc-lhs-arrays' option to allocate it automatically. --> tests/../integration_tests/allocatable_component_reshape_unallocated_01.f90:15:5 | 15 | x%arr = reshape(gradient, shape(input)) | ^^^^^ 'x%arr' not allocated here lfortran-0.63.0/tests/reference/ast-expr8-cb13ef4.json0000664000175000017500000000070415174404631022574 0ustar alastairalastair{ "basename": "ast-expr8-cb13ef4", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/expr8.f90", "infile_hash": "b0f7cfaa460c9319f7cc7b0fa470fbbce940f7f4eef3156b55897b51", "outfile": null, "outfile_hash": null, "stdout": "ast-expr8-cb13ef4.stdout", "stdout_hash": "a5bded52998d57e79faf66d869a9d90b00601c965ba1347a25764d38", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixed_form_5-f25edd8.json0000664000175000017500000000075315174404631024112 0ustar alastairalastair{ "basename": "ast-fixed_form_5-f25edd8", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/fixed_form_5.f", "infile_hash": "c978dce7f02ade3281b72a11001e4813cd7c3157f0efa065c8a137d2", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-fixed_form_5-f25edd8.stderr", "stderr_hash": "868271d79402bdfa652f8d86b11303134261ca5a7c28edbbd97bf884", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-array_01_transfer-125156e.stdout0000664000175000017500000001041315174404631025176 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array_01_transfer: (Program (SymbolTable 2 { m: (Variable 2 m [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), size: (Variable 2 size [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) array_01_transfer [] [(Assignment (Var 2 m) (ArrayConstant 24 [1, 0, 0, 0, 5, 0] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Print (StringFormat () [(BitCast (Var 2 m) (RealConstant 1.000000 (Real 4) ) (Var 2 size) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 size))] PointerArray ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-doloop_03-9c463c5.json0000664000175000017500000000074515174404631023200 0ustar alastairalastair{ "basename": "asr-doloop_03-9c463c5", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_03.f90", "infile_hash": "eafcb3d9dca52d81012b124f360aa148c946ed2e7ed8de07041aba1d", "outfile": null, "outfile_hash": null, "stdout": "asr-doloop_03-9c463c5.stdout", "stdout_hash": "e84cf37eb45532f7afac7291c565d96e00fc41ea929c2935b58dc8ee", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-modules_11-a28ab77.json0000664000175000017500000000075315174404631023612 0ustar alastairalastair{ "basename": "llvm-modules_11-a28ab77", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_11.f90", "infile_hash": "f19a5ba8d01ebaae3da78891afbae58462d711a364274aa3a5569fa1", "outfile": null, "outfile_hash": null, "stdout": "llvm-modules_11-a28ab77.stdout", "stdout_hash": "1da1c65c78dfcc912998868f650c67401887ccb6f5b2b9d058e3be5b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/lookup_name-lookup_name3-a06a374.stdout0000664000175000017500000000026415174404631026054 0ustar alastairalastair[{"kind":9,"location":{"range":{"start":{"character":40,"line":2},"end":{"character":41,"line":2}},"uri":"tests/lookup_name3.f90"},"name":"ec","filename":"tests/lookup_name3.f90"}]lfortran-0.63.0/tests/reference/run-format_08-581c944.json0000664000175000017500000000071515174404631023136 0ustar alastairalastair{ "basename": "run-format_08-581c944", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_08.f90", "infile_hash": "09be4bce42c0ceb75ad723d2c9c7615551fb01aeeb29e3432a11b1a4", "outfile": null, "outfile_hash": null, "stdout": "run-format_08-581c944.stdout", "stdout_hash": "c450011324a415cece37c9c2590c2a4b591dc1692b25e5272ad33e6a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/c-program4-d60edeb.json0000664000175000017500000000100715174404631022773 0ustar alastairalastair{ "basename": "c-program4-d60edeb", "cmd": "lfortran --no-color --show-c {infile}", "infile": "tests/program4.f90", "infile_hash": "16adb5a498028ea668b9d513bb2ef0fa0b12e15bef4e2b5e30aa2740", "outfile": null, "outfile_hash": null, "stdout": "c-program4-d60edeb.stdout", "stdout_hash": "7befb0f20ab89ee4ccd2058f0418cd68b66c99d768f7e6113de89be5", "stderr": "c-program4-d60edeb.stderr", "stderr_hash": "3e15ec8a328c3f581817cf479d93e1f7166d89865efb6fb03f1909b8", "returncode": 0 }lfortran-0.63.0/tests/reference/fortran-char1-046b501.stdout0000664000175000017500000000016315174404631023532 0ustar alastairalastairprogram char1 implicit none character(len=1, kind=1), parameter :: c_null_char = Char(0, kind=1) end program char1 lfortran-0.63.0/tests/reference/asr-substring_startidx-5fb6d57.stderr0000664000175000017500000000024315174404631025751 0ustar alastairalastairsemantic error: Substring start index at must be of type integer --> tests/errors/substring_startidx.f90:4:15 | 4 | print*, s(1.1:5) | ^^^ lfortran-0.63.0/tests/reference/asr-derived_types_05-35150cd.json0000664000175000017500000000077215174404631024540 0ustar alastairalastair{ "basename": "asr-derived_types_05-35150cd", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_05.f90", "infile_hash": "85f9d84172e5248d69383c57e1de14890ac154aec612e84a5253b502", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_05-35150cd.stdout", "stdout_hash": "ac80aa1b5746b96ea084c245cd314106855159fd57c5734ce40e4154", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/tokens-esub1-3e8b16d.json0000664000175000017500000000072415174404631023210 0ustar alastairalastair{ "basename": "tokens-esub1-3e8b16d", "cmd": "lfortran --no-color --show-tokens {infile} -o {outfile}", "infile": "tests/errors/esub1.f90", "infile_hash": "93b7d715c14f2da952a8945b7ea7b16817b269880b156f00497dd7b1", "outfile": null, "outfile_hash": null, "stdout": "tokens-esub1-3e8b16d.stdout", "stdout_hash": "e49e323dc4149a6e283aa7f33d649fd490c58f1f0f808ee0393a0fd0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-save2-63c8bcc.stdout0000664000175000017500000015107215174404631023126 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 7 { a: (Variable 7 a [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 7 b [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 7 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 7 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 7 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main [] [] ), save_fun: (Function (SymbolTable 3 { a: (Variable 3 a [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), save_fun: (Variable 3 save_fun [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 3 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 3 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) save_fun (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 3 save_fun) Public .true. .true. () ), save_module_2: (Module (SymbolTable 4 { a: (Variable 4 a [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), fun_save: (Function (SymbolTable 6 { a: (Variable 6 a [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 6 b [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), fun_save: (Variable 6 fun_save [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 6 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 6 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 6 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fun_save (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 6 fun_save) Public .true. .true. () ), sub_save: (Function (SymbolTable 5 { a: (Variable 5 a [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 5 b [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 5 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 5 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 5 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub_save (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .true. .true. () ), x: (Variable 4 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 4 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 4 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) save_module_2 () [] .false. .false. .false. ), save_sub: (Function (SymbolTable 2 { a: (Variable 2 a [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) save_sub (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-parameter_02-15e1701.stdout0000664000175000017500000000046215174404631024613 0ustar alastairalastairsubroutine a_proc() implicit none integer :: i parameter(i = 1) print *, i end subroutine a_proc module parameter_02_a implicit none integer :: i parameter(i = 2) end module parameter_02_a program parameter_02 use parameter_02_a, only: i implicit none call a_proc() print *, i end program parameter_02 lfortran-0.63.0/tests/reference/asr-logical2-e35f19c.stdout0000664000175000017500000000742615174404631023531 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { logical2: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) logical2 [] [(Assignment (Var 2 a) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (Assignment (Var 2 b) (LogicalConstant .false. (Logical 4) ) () .false. .false. ) (If () (LogicalBinOp (Var 2 a) And (Var 2 b) (Logical 4) () ) [(Print (StringConstant "Line 1 - Condition is true" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "Line 1 - Condition is false" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-common1-bbe229a.stderr0000664000175000017500000000024415174404631023425 0ustar alastairalastairsemantic error: Duplicate DIMENSION attribute specified --> tests/errors/common1.f90:3:20 | 3 | common /rowns/ rowns(209) | ^^^^^^^^^^ lfortran-0.63.0/tests/reference/run-integerStringInput-16e7ff7.json0000664000175000017500000000073215174404631025346 0ustar alastairalastair{ "basename": "run-integerStringInput-16e7ff7", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/integerStringInput.f90", "infile_hash": "04a4574d2a233b18a7a450ff6c9e574741495c363d9f3f355e8fcb6c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-integerStringInput-16e7ff7.stderr", "stderr_hash": "93103ec86aa429ca52c869eca8168e2a245d3dec573aec6aaf204e65", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-template_array_02-85b6b2e.stdout0000664000175000017500000037532615174404631025354 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_array_02: (Program (SymbolTable 19 { add_integer: (ExternalSymbol 19 add_integer 2 add_integer template_array_02_math [] add_integer Public ), add_real: (ExternalSymbol 19 add_real 2 add_real template_array_02_math [] add_real Public ), array_tmpl: (ExternalSymbol 19 array_tmpl 7 array_tmpl template_array_02_m [] array_tmpl Public ), operations: (ExternalSymbol 19 operations 7 operations template_array_02_m [] operations Public ), test_template: (ExternalSymbol 19 test_template 7 test_template template_array_02_m [] test_template Public ), zero_integer: (ExternalSymbol 19 zero_integer 2 zero_integer template_array_02_math [] zero_integer Public ), zero_real: (ExternalSymbol 19 zero_real 2 zero_real template_array_02_math [] zero_real Public ) }) template_array_02 [template_array_02_math template_array_02_m] [(SubroutineCall 19 test_template () [] () .false. )] ), template_array_02_m: (Module (SymbolTable 7 { add_integer: (ExternalSymbol 7 add_integer 2 add_integer template_array_02_math [] add_integer Public ), add_real: (ExternalSymbol 7 add_real 2 add_real template_array_02_math [] add_real Public ), array_tmpl: (Template (SymbolTable 11 { mysum_t: (Function (SymbolTable 14 { a: (Variable 14 a [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 14 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 14 r [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mysum_t (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [zero_t plus_t] [(Var 14 a)] [(Assignment (Var 14 r) (FunctionCall 11 zero_t () [((ArrayItem (Var 14 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) () .false. .false. ) (DoLoop () ((Var 14 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 14 a) () (Integer 4) () ) ()) [(Assignment (Var 14 r) (FunctionCall 11 plus_t () [((Var 14 r)) ((ArrayItem (Var 14 a) [(() (Var 14 i) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) () .false. .false. )] [] )] (Var 14 r) Public .true. .true. () ), mysum_t_n: (Function (SymbolTable 15 { a: (Variable 15 a [n] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 15 n))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 15 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 15 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 15 r [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mysum_t_n (FunctionType [(Integer 4) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [zero_t plus_t] [(Var 15 n) (Var 15 a)] [(Assignment (Var 15 r) (FunctionCall 11 zero_t () [((ArrayItem (Var 15 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) () .false. .false. ) (DoLoop () ((Var 15 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 15 a) () (Integer 4) () ) ()) [(Assignment (Var 15 r) (FunctionCall 11 plus_t () [((Var 15 r)) ((ArrayItem (Var 15 a) [(() (Var 15 i) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) () .false. .false. )] [] )] (Var 15 r) Private .true. .true. () ), plus_t: (Function (SymbolTable 12 { l: (Variable 12 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 12 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rs: (Variable 12 rs [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 12 l) (Var 12 r)] [] (Var 12 rs) Private .true. .true. () ), t: (Variable 11 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zero_t: (Function (SymbolTable 13 { l: (Variable 13 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rs: (Variable 13 rs [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) zero_t (FunctionType [(TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 13 l)] [] (Var 13 rs) Private .true. .true. () ) }) array_tmpl [t plus_t zero_t] [(Require operations [t plus_t zero_t] )] ), operations: (Requirement (SymbolTable 8 { plus_t: (Function (SymbolTable 9 { l: (Variable 9 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 9 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rs: (Variable 9 rs [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 9 l) (Var 9 r)] [] (Var 9 rs) Private .true. .true. () ), t: (Variable 8 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zero_t: (Function (SymbolTable 10 { l: (Variable 10 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rs: (Variable 10 rs [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) zero_t (FunctionType [(TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 10 l)] [] (Var 10 rs) Private .true. .true. () ) }) operations [t plus_t zero_t] [] ), test_template: (Function (SymbolTable 16 { a: (Variable 16 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 16 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 16 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), mysum_integer: (Function (SymbolTable 17 { a: (Variable 17 a [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 17 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 17 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mysum_integer (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 a)] [(Assignment (Var 17 r) (FunctionCall 7 zero_integer () [((ArrayItem (Var 17 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) () .false. .false. ) (DoLoop () ((Var 17 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 17 a) () (Integer 4) () ) ()) [(Assignment (Var 17 r) (FunctionCall 7 add_integer () [((Var 17 r)) ((ArrayItem (Var 17 a) [(() (Var 17 i) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) () .false. .false. )] [] )] (Var 17 r) Public .true. .true. () ), mysum_integer_n: (Function (SymbolTable 18 { a: (Variable 18 a [n] In () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 18 n))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 18 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 18 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 18 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mysum_integer_n (FunctionType [(Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 18 n) (Var 18 a)] [(Assignment (Var 18 r) (FunctionCall 7 zero_integer () [((ArrayItem (Var 18 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) () .false. .false. ) (DoLoop () ((Var 18 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 18 a) () (Integer 4) () ) ()) [(Assignment (Var 18 r) (FunctionCall 7 add_integer () [((Var 18 r)) ((ArrayItem (Var 18 a) [(() (Var 18 i) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) () .false. .false. )] [] )] (Var 18 r) Private .true. .true. () ), sa: (Variable 16 sa [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sb: (Variable 16 sb [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(DoLoop () ((Var 16 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 16 a) () (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) ) ()) [(Assignment (ArrayItem (Var 16 a) [(() (Var 16 i) ())] (Integer 4) ColMajor () ) (Var 16 i) () .false. .false. ) (Assignment (ArrayItem (Var 16 b) [(() (Var 16 i) ())] (Integer 4) ColMajor () ) (Var 16 i) () .false. .false. )] [] ) (Assignment (Var 16 sa) (FunctionCall 16 mysum_integer () [((ArrayPhysicalCast (Var 16 a) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 16 sb) (FunctionCall 16 mysum_integer_n () [((ArraySize (Var 16 b) () (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) )) ((ArrayPhysicalCast (Var 16 b) FixedSizeArray PointerArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Mul (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () ))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 16 sa)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 16 sb)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), zero_integer: (ExternalSymbol 7 zero_integer 2 zero_integer template_array_02_math [] zero_integer Public ), zero_real: (ExternalSymbol 7 zero_real 2 zero_real template_array_02_math [] zero_real Public ) }) template_array_02_m () [template_array_02_math template_array_02_m] .false. .false. .false. ), template_array_02_math: (Module (SymbolTable 2 { add_integer: (Function (SymbolTable 3 { r: (Variable 3 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 3 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 y)] [(Assignment (Var 3 r) (IntegerBinOp (Var 3 x) Add (Var 3 y) (Integer 4) () ) () .false. .false. )] (Var 3 r) Public .true. .true. () ), add_real: (Function (SymbolTable 5 { r: (Variable 5 r [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 5 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 5 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 5 x) (Var 5 y)] [(Assignment (Var 5 r) (RealBinOp (Var 5 x) Add (Var 5 y) (Real 4) () ) () .false. .false. )] (Var 5 r) Public .true. .true. () ), zero_integer: (Function (SymbolTable 4 { r: (Variable 4 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) zero_integer (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 x)] [(Assignment (Var 4 r) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 4 r) Public .true. .true. () ), zero_real: (Function (SymbolTable 6 { r: (Variable 6 r [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 6 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) zero_real (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 6 x)] [(Assignment (Var 6 r) (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) () ) () .false. .false. )] (Var 6 r) Public .true. .true. () ) }) template_array_02_math () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr_preprocess-unterminated_comment_01-a351b61.stderr0000664000175000017500000000023615174404631030677 0ustar alastairalastairC preprocessor error: Unterminated comment --> tests/errors/unterminated_comment_01.f90:3:8 | 3 | #endif /* unterminated comment starts here | ^ lfortran-0.63.0/tests/reference/ast-array5-2cde105.json0000664000175000017500000000070715174404631022650 0ustar alastairalastair{ "basename": "ast-array5-2cde105", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/array5.f90", "infile_hash": "33d963b417ddd6ec562edf7732f7c595264090883fd4b80011b7a39d", "outfile": null, "outfile_hash": null, "stdout": "ast-array5-2cde105.stdout", "stdout_hash": "d8d454a272d8513cb4631f98108ed86879f616d03bce1e5d92ddeaf3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics10-ccd6322.json0000664000175000017500000000074015174404631023771 0ustar alastairalastair{ "basename": "asr-intrinsics10-ccd6322", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics10.f90", "infile_hash": "71c18b1007f67b59ecfe255092d42f662d34cd9e53bd53b154b0017c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics10-ccd6322.stderr", "stderr_hash": "5c7e6496799d08eb1c9ff3b805df252814360ecbee2833394b6fd122", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-if_04-7f1b69d.json0000664000175000017500000000104515174404631022361 0ustar alastairalastair{ "basename": "ast-if_04-7f1b69d", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/if_04.f90", "infile_hash": "dc3029f2df7281746bd116d435ee39913201c693d801c2e53aca3886", "outfile": null, "outfile_hash": null, "stdout": "ast-if_04-7f1b69d.stdout", "stdout_hash": "600a6854a444ffce0dbf60489f9c9f924f43e1d9cb44fa151a35eb10", "stderr": "ast-if_04-7f1b69d.stderr", "stderr_hash": "8b854a8be811f407b5f543a37121d6b73b7265ed8b67dc1c76a42d63", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-arithmetic_if1-f119c2a.json0000664000175000017500000000074615174404631024341 0ustar alastairalastair{ "basename": "asr-arithmetic_if1-f119c2a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/arithmetic_if1.f90", "infile_hash": "41667893ffab9b073a6c0674e1821f3009b9c55fe383c44dd863ac77", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-arithmetic_if1-f119c2a.stderr", "stderr_hash": "a9af1739b20d99ec366498b705aeb4044956976d00d257546dada29a", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-implicit5-8745632.stdout0000664000175000017500000003133715174404631023515 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cpdsa: (Function (SymbolTable 2 { ca0: (Variable 2 ca0 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), cdn: (Variable 2 cdn [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), cpdsa: (Variable 2 cpdsa [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), eps: (Variable 2 eps [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pi: (Variable 2 pi [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), va0: (Variable 2 va0 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cpdsa (FunctionType [(Integer 4) (Real 4) (Real 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 n) (Var 2 z) (Var 2 cdn)] [(Assignment (Var 2 eps) (RealConstant 0.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 pi) (RealConstant 3.141593 (Real 8) ) () .false. .false. ) (Assignment (Var 2 ca0) (Cast (IntrinsicElementalFunction Exp [(RealBinOp (RealBinOp (RealUnaryMinus (RealConstant 0.250000 (Real 8) ) (Real 8) (RealConstant -0.250000 (Real 8) ) ) Mul (Cast (Var 2 z) RealToReal (Real 8) () () ) (Real 8) () ) Mul (Cast (Var 2 z) RealToReal (Real 8) () () ) (Real 8) () )] 0 (Real 8) () ) RealToReal (Real 4) () () ) () .false. .false. ) (Assignment (Var 2 va0) (RealBinOp (RealConstant 0.500000 (Real 8) ) Mul (RealBinOp (RealConstant 1.000000 (Real 8) ) Sub (Cast (Var 2 n) IntegerToReal (Real 8) () () ) (Real 8) () ) (Real 8) () ) () .false. .false. )] (Var 2 cpdsa) Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-implicit1-418fb10.stderr0000664000175000017500000000157015174404631024271 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/implicit1.f90:13:14 | 13 | implicit real*8 (a-h,o-z) | ^ help: write this as 'real(8)' style suggestion: Use integer(8) instead of integer*8 --> tests/implicit1.f90:25:17 | 25 | implicit integer*8 (i,j-l,m,n) | ^ help: write this as 'integer(8)' style suggestion: Use integer(4) instead of integer*4 --> tests/implicit1.f90:27:17 | 27 | IMPLICIT INTEGER*4 (C, D-x) | ^ help: write this as 'integer(4)' style suggestion: Use logical(4) instead of logical*4 --> tests/implicit1.f90:32:17 | 32 | implicit logical*4 (l, u-z) | ^ help: write this as 'logical(4)' style suggestion: Use complex(4) instead of complex*8 --> tests/implicit1.f90:38:17 | 38 | implicit complex*8 (z) | ^ help: write this as 'complex(4)' lfortran-0.63.0/tests/reference/ast-fn_call1-7e6ba0b.stdout0000664000175000017500000000601115174404631023552 0ustar alastairalastair(TranslationUnit [(FuncCallOrArray size [] [(() tvec () 0)] [(dim 2)] [] [] ) (FuncCallOrArray min [] [(() (FuncCallOrArray tvec [] [(() 2 () 0) (() i () 0)] [] [] [] ) () 0) (() (FuncCallOrArray tvec [] [(() 1 () 0) (() i () 0)] [] [] [] ) () 0)] [] [] [] ) (FuncCallOrArray a [] [(() 1 () 0) (() 2 () 0) (() 3 () 0)] [] [] [] ) (FuncCallOrArray f [] [(() a () 0) (() b () 0)] [(d (/ 5 2)) (c (+ 3 3))] [] [] ) (FuncCallOrArray A [] [(() i () 0) (() j () 0) (() k () 0)] [] [] [] ) (FuncCallOrArray X [] [(() i () 0)] [] [] [] ) (FuncCallOrArray X [] [(() () 1 0)] [] [] [] ) (FuncCallOrArray X [] [(a () 1 0)] [] [] [] ) (FuncCallOrArray X [] [(() b 1 0)] [] [] [] ) (FuncCallOrArray X [] [(a b 1 0)] [] [] [] ) (FuncCallOrArray X [] [(() () c 0)] [] [] [] ) (FuncCallOrArray X [] [(() () c 0)] [] [] [] ) (FuncCallOrArray X [] [(a () c 0)] [] [] [] ) (FuncCallOrArray X [] [(a () c 0)] [] [] [] ) (FuncCallOrArray X [] [(() b c 0)] [] [] [] ) (FuncCallOrArray X [] [(a b c 0)] [] [] [] ) (FuncCallOrArray X [] [(a b 1 0) (() () c 0) (a () 1 0) (a () c 0)] [] [] [] )] ) lfortran-0.63.0/tests/reference/asr-types_03-f0b782e.json0000664000175000017500000000074215174404631023122 0ustar alastairalastair{ "basename": "asr-types_03-f0b782e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_03.f90", "infile_hash": "388683b8609d91d174ceb8c24787c982bf1ea22d342e94d44457b861", "outfile": null, "outfile_hash": null, "stdout": "asr-types_03-f0b782e.stdout", "stdout_hash": "669949d23e670cc9f328d52251a11ef857bd88bd00b7ff95c1ae61fa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/c-case_02-eff3752.json0000664000175000017500000000071415174404631022330 0ustar alastairalastair{ "basename": "c-case_02-eff3752", "cmd": "lfortran --no-color --show-c {infile}", "infile": "tests/../integration_tests/case_02.f90", "infile_hash": "76d3020fba89787d565870ed03c1b5e8914d12b062cb9ca7a8c37550", "outfile": null, "outfile_hash": null, "stdout": "c-case_02-eff3752.stdout", "stdout_hash": "0c399d74c1e9da4150b7897617885c26efa6f50b999355381b02d7a5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-rand_01-5739aee.json0000664000175000017500000000104115174404631022676 0ustar alastairalastair{ "basename": "asr-rand_01-5739aee", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/warnings/rand_01.f90", "infile_hash": "52adc408e8be0fc19d7bcc8d16bd550a26e39637ff244dd87957335f", "outfile": null, "outfile_hash": null, "stdout": "asr-rand_01-5739aee.stdout", "stdout_hash": "3979416f71c9436767eedf1f8c52b70a450d1997693b62b4babc66e0", "stderr": "asr-rand_01-5739aee.stderr", "stderr_hash": "ce9fb38fdc5fdacd02522991309cc7d24272f37328734150c223153e", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-shiftl1-0ff5448.stdout0000664000175000017500000000725515174404631023330 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { shiftl1: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) shiftl1 [] [(Print (StringFormat () [(IntrinsicElementalFunction Shiftl [(IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction Shiftl [(Var 2 x) (Var 2 y)] 0 (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/run-array_bounds_check_05-d584fab.json0000664000175000017500000000074315174404631025705 0ustar alastairalastair{ "basename": "run-array_bounds_check_05-d584fab", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_05.f90", "infile_hash": "9ef4f46c35739ba9241c8707b603e057f3ec10d97212ae6dd2ec1796", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_05-d584fab.stderr", "stderr_hash": "866571113400c0410af025f9bcd1c42653650ddf22c1418a4c757e7c", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-class_01-704dee8.stdout0000664000175000017500000006050115174404631023434 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { circle_test: (Program (SymbolTable 6 { 1_circle_circle_print: (ExternalSymbol 6 1_circle_circle_print 3 print circle [] print Public ), 1_circle_radius: (ExternalSymbol 6 1_circle_radius 3 radius circle [] radius Public ), c: (Variable 6 c [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 6 circle Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), circle: (ExternalSymbol 6 circle 2 circle class_circle1 [] circle Public ) }) circle_test [class_circle1] [(Assignment (Var 6 c) (StructConstructor 6 circle [((RealConstant 1.500000 (Real 4) ))] (StructType [(Real 4)] [] .true. .false. ) () ) () .false. .false. ) (SubroutineCall 6 1_circle_circle_print () [((Var 6 c))] (Var 6 c) .false. ) (Assignment (StructInstanceMember (Var 6 c) 6 1_circle_radius (Real 4) () ) (RealConstant 2.000000 (Real 4) ) () .false. .false. ) (SubroutineCall 6 1_circle_circle_print () [((Var 6 c))] (Var 6 c) .false. )] ), class_circle1: (Module (SymbolTable 2 { circle: (Struct (SymbolTable 3 { area: (StructMethodDeclaration 3 area () circle_area 2 circle_area Source .false. .false. ), print: (StructMethodDeclaration 3 print () circle_print 2 circle_print Source .false. .false. ), radius: (Variable 3 radius [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) circle (StructType [(Real 4)] [] .true. .false. ) [] [radius] [] Source Private .false. .false. [] () () [] ), circle_area: (Function (SymbolTable 4 { 1_circle_radius: (ExternalSymbol 4 1_circle_radius 3 radius circle [] radius Public ), area: (Variable 4 area [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), this: (Variable 4 this [] In () () Default (StructType [(Real 4)] [] .false. .false. ) 2 circle Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) circle_area (FunctionType [(StructType [(Real 4)] [] .false. .false. )] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 this)] [(Assignment (Var 4 area) (RealBinOp (Var 2 pi) Mul (RealBinOp (StructInstanceMember (Var 4 this) 4 1_circle_radius (Real 4) () ) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) (Real 4) () ) () .false. .false. )] (Var 4 area) Private .true. .true. () ), circle_print: (Function (SymbolTable 5 { 1_circle_circle_area: (ExternalSymbol 5 1_circle_circle_area 3 area circle [] area Public ), 1_circle_radius: (ExternalSymbol 5 1_circle_radius 3 radius circle [] radius Public ), area: (Variable 5 area [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), this: (Variable 5 this [] In () () Default (StructType [(Real 4)] [] .false. .false. ) 2 circle Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) circle_print (FunctionType [(StructType [(Real 4)] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 this)] [(Assignment (Var 5 area) (FunctionCall 5 1_circle_circle_area () [((Var 5 this))] (Real 4) () (Var 5 this) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Circle: r = " (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StructInstanceMember (Var 5 this) 5 1_circle_radius (Real 4) () ) (StringConstant " area = " (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 5 area)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Private .false. .false. () ), pi: (Variable 2 pi [] Local (Cast (RealConstant 3.141593 (Real 8) ) RealToReal (Real 4) (RealConstant 3.141593 (Real 4) ) () ) (RealConstant 3.141593 (Real 4) ) Save (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) class_circle1 () [class_circle1] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-maskl_negative-c92502f.stderr0000664000175000017500000000024115174404631024706 0ustar alastairalastairsemantic error: first argument of `maskl` must be nonnegative --> tests/errors/maskl_negative.f90:2:12 | 2 | print*, maskl(-24) | ^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor9-641e112.json0000664000175000017500000000077015174404631026367 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor9-641e112", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor9.f90", "infile_hash": "29602fb21e7b99077fe13064a66d8d0d714141266b33059fd7f37cf2", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor9-641e112.stdout", "stdout_hash": "7654096527ea6f3df6bc9eda85f931b9ca2423918e32f726b6e3718d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-derived_types_03-268a4a4.json0000664000175000017500000000077215174404631024545 0ustar alastairalastair{ "basename": "ast-derived_types_03-268a4a4", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_03.f90", "infile_hash": "fd0a87db249f310cd20a90b39d5eb4627597acf774b62bdb8c4256c4", "outfile": null, "outfile_hash": null, "stdout": "ast-derived_types_03-268a4a4.stdout", "stdout_hash": "64d6e9c4eec135cc474600cd8f3a44aab8c56cef25247a747a25f881", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-array_bounds_check_12-4cdd01e.json0000664000175000017500000000074315174404631025672 0ustar alastairalastair{ "basename": "run-array_bounds_check_12-4cdd01e", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_12.f90", "infile_hash": "4c372157b9d4aa36edb76a7e8441fd140bf39e30bd585e97bd03da65", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_12-4cdd01e.stderr", "stderr_hash": "b9d05555fd308792d5cf18daea340ee12986d53b8aecf231f9f11b75", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-intrinsics14-5a6d04e.json0000664000175000017500000000074015174404631023777 0ustar alastairalastair{ "basename": "asr-intrinsics14-5a6d04e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics14.f90", "infile_hash": "e5abcb6a33f84a36c3412054dd1092db703e97cebdb5e26d69b29702", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics14-5a6d04e.stderr", "stderr_hash": "249e6e7185993869a1a130554f0fcf10c43c67fef75ae76089e4717c", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-template_add_01-56d8eff.stdout0000664000175000017500000022126715174404631025051 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_add_01: (Program (SymbolTable 13 { add_t: (ExternalSymbol 13 add_t 2 add_t template_add_01_m [] add_t Public ), r: (ExternalSymbol 13 r 2 r template_add_01_m [] r Public ), test_template: (ExternalSymbol 13 test_template 2 test_template template_add_01_m [] test_template Public ) }) template_add_01 [template_add_01_m] [(SubroutineCall 13 test_template () [] () .false. )] ), template_add_01_m: (Module (SymbolTable 2 { add_t: (Template (SymbolTable 5 { add_generic: (Function (SymbolTable 7 { x: (Variable 7 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 7 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 7 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_generic (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 7 x) (Var 7 y)] [(Assignment (Var 7 z) (FunctionCall 5 f () [((Var 7 x)) ((Var 7 y))] (TypeParameter t ) () () ) () .false. .false. )] (Var 7 z) Public .true. .true. () ), f: (Function (SymbolTable 6 { x: (Variable 6 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 6 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 6 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 6 x) (Var 6 y)] [] (Var 6 z) Private .true. .true. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_t [t f] [(Require r [t f] )] ), func_arg_int: (Function (SymbolTable 9 { x: (Variable 9 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 9 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 9 z [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) func_arg_int (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 x) (Var 9 y)] [(Assignment (Var 9 z) (IntegerBinOp (Var 9 x) Add (Var 9 y) (Integer 4) () ) () .false. .false. )] (Var 9 z) Private .true. .true. () ), func_arg_real: (Function (SymbolTable 8 { x: (Variable 8 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 8 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 8 z [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) func_arg_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 x) (Var 8 y)] [(Assignment (Var 8 z) (RealBinOp (Var 8 x) Add (Var 8 y) (Real 4) () ) () .false. .false. )] (Var 8 z) Private .true. .true. () ), r: (Requirement (SymbolTable 3 { f: (Function (SymbolTable 4 { x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 4 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 z) Private .true. .true. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) r [t f] [] ), test_template: (Function (SymbolTable 10 { a: (Variable 10 a [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), add_integer: (Function (SymbolTable 12 { x: (Variable 12 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 12 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 12 z [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [func_arg_int] [(Var 12 x) (Var 12 y)] [(Assignment (Var 12 z) (FunctionCall 2 func_arg_int () [((Var 12 x)) ((Var 12 y))] (Integer 4) () () ) () .false. .false. )] (Var 12 z) Public .true. .true. () ), add_real: (Function (SymbolTable 11 { x: (Variable 11 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 11 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 11 z [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [func_arg_real] [(Var 11 x) (Var 11 y)] [(Assignment (Var 11 z) (FunctionCall 2 func_arg_real () [((Var 11 x)) ((Var 11 y))] (Real 4) () () ) () .false. .false. )] (Var 11 z) Public .true. .true. () ), b: (Variable 10 b [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 10 x [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 10 y [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 10 x) (RealConstant 5.100000 (Real 4) ) () .false. .false. ) (Assignment (Var 10 y) (RealConstant 7.200000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "The result is " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 10 add_real () [((Var 10 x)) ((Var 10 y))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (FunctionCall 10 add_real () [((Var 10 x)) ((Var 10 y))] (Real 4) () () ) Sub (RealConstant 12.300000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 10 a) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 10 b) (IntegerConstant 9 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(StringConstant "The result is " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 10 add_integer () [((Var 10 a)) ((Var 10 b))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (FunctionCall 10 add_integer () [((Var 10 a)) ((Var 10 b))] (Integer 4) () () ) NotEq (IntegerConstant 14 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] () Public .false. .false. () ) }) template_add_01_m () [template_add_01_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/llvm-complex2-092502c.json0000664000175000017500000000072015174404631023215 0ustar alastairalastair{ "basename": "llvm-complex2-092502c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/complex2.f90", "infile_hash": "420a31c745b1be940871a88d76cfdc7432de5cbf6fe9f2e8bc87bf39", "outfile": null, "outfile_hash": null, "stdout": "llvm-complex2-092502c.stdout", "stdout_hash": "62ab3b90f3c1559bebd513732e5ffbc94c43248ccd558103fb7f134b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-doloop_02-13efa8f.json0000664000175000017500000000073615174404631023653 0ustar alastairalastair{ "basename": "julia-doloop_02-13efa8f", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/doloop_02.f90", "infile_hash": "3f887434509231f48fbbbda31f34778f17ddb6871b39c44626d54f2e", "outfile": null, "outfile_hash": null, "stdout": "julia-doloop_02-13efa8f.stdout", "stdout_hash": "5b604b185db4645137879631e1fee5d8c404f0a2182d0f8a7e0e0df8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/c-case_05-2fed69e.json0000664000175000017500000000071415174404631022416 0ustar alastairalastair{ "basename": "c-case_05-2fed69e", "cmd": "lfortran --no-color --show-c {infile}", "infile": "tests/../integration_tests/case_05.f90", "infile_hash": "914477f4a376baf0341e522d2109b6108238cd1d9dfecf969283ab79", "outfile": null, "outfile_hash": null, "stdout": "c-case_05-2fed69e.stdout", "stdout_hash": "e11494fc2fd6252c1afaec4ce466fe7d4c568c782f009dd1c96dd038", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-dprod_01-80a930c.json0000664000175000017500000000072415174404631022776 0ustar alastairalastair{ "basename": "asr-dprod_01-80a930c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dprod_01.f90", "infile_hash": "d1ce33c89bee90c6db80924ecb910e367598d14758aafaa9303aeeb1", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dprod_01-80a930c.stderr", "stderr_hash": "e2b330264207fb4416b7623e66f71d83926b820e67b727c487394dfd", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-callback_03-0f44942.stdout0000664000175000017500000001601015174404631024102 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define float @__module_callback_03_cb(float (float*)* %f, float* %a, float* %b) { .entry: %cb = alloca float, align 4 %0 = load float, float* %b, align 4 %1 = load float, float* %a, align 4 %2 = fsub float %0, %1 %3 = call float %f(float* %a) %4 = fadd float %2, %3 %5 = call float %f(float* %b) %6 = fadd float %4, %5 store float %6, float* %cb, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_cb FINALIZE_SYMTABLE_cb: ; preds = %return %7 = load float, float* %cb, align 4 ret float %7 } declare float @f(float*) define void @__module_callback_03_foo1(float* %c, float* %d) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %1 = alloca i64, align 8 %2 = call float @__module_callback_03_cb(float (float*)* @foo1.__module_callback_03_f, float* %c, float* %d) %3 = alloca float, align 4 store float %2, float* %3, align 4 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %1, i32 0, i32 0, i32 0, i32 0, i32 0, float* %3) %5 = load i64, i64* %1, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_foo1 FINALIZE_SYMTABLE_foo1: ; preds = %return ret void } define float @foo1.__module_callback_03_f(float* %x) { .entry: %f = alloca float, align 4 %0 = load float, float* %x, align 4 %1 = fmul float 2.000000e+00, %0 store float %1, float* %f, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return %2 = load float, float* %f, align 4 ret float %2 } define void @__module_callback_03_foo2(float* %c, float* %d) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %1 = alloca i64, align 8 %2 = call float @__module_callback_03_cb(float (float*)* @foo2.__module_callback_03_f, float* %c, float* %d) %3 = alloca float, align 4 store float %2, float* %3, align 4 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %1, i32 0, i32 0, i32 0, i32 0, i32 0, float* %3) %5 = load i64, i64* %1, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_foo2 FINALIZE_SYMTABLE_foo2: ; preds = %return ret void } define float @foo2.__module_callback_03_f(float* %x) { .entry: %f = alloca float, align 4 %0 = load float, float* %x, align 4 %1 = fmul float -2.000000e+00, %0 store float %1, float* %f, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return %2 = load float, float* %f, align 4 ret float %2 } declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value1 = alloca float, align 4 %call_arg_value = alloca float, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store float 1.500000e+00, float* %call_arg_value, align 4 store float 2.000000e+00, float* %call_arg_value1, align 4 call void @__module_callback_03_foo1(float* %call_arg_value, float* %call_arg_value1) store float 1.500000e+00, float* %call_arg_value, align 4 store float 2.000000e+00, float* %call_arg_value1, align 4 call void @__module_callback_03_foo2(float* %call_arg_value, float* %call_arg_value1) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/ast-types_13-76138b5.stderr0000664000175000017500000000474415174404631023327 0ustar alastairalastairstyle suggestion: Use character(5) instead of character*5 --> tests/../integration_tests/types_13.f90:30:5 | 30 | character*5 :: d | ^^^^^^^^^^^ help: write this as 'character(5)' style suggestion: Use integer(4) instead of integer*4 --> tests/../integration_tests/types_13.f90:36:5 | 36 | integer*4, value, intent(in) :: a | ^^^^^^^^^ help: write this as 'integer(4)' style suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/types_13.f90:37:5 | 37 | real*8, value, intent(in) :: b | ^^^^^^ help: write this as 'real(8)' style suggestion: Use logical(4) instead of logical*4 --> tests/../integration_tests/types_13.f90:38:5 | 38 | logical*4 :: c | ^^^^^^^^^ help: write this as 'logical(4)' style suggestion: Use integer(4) instead of integer*4 --> tests/../integration_tests/types_13.f90:43:5 | 43 | integer*4, value, intent(in) :: a | ^^^^^^^^^ help: write this as 'integer(4)' style suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/types_13.f90:44:5 | 44 | real*8, value, intent(in) :: b | ^^^^^^ help: write this as 'real(8)' style suggestion: Use logical(4) instead of logical*4 --> tests/../integration_tests/types_13.f90:45:5 | 45 | logical*4 :: c | ^^^^^^^^^ help: write this as 'logical(4)' style suggestion: Use integer(4) instead of integer*4 --> tests/../integration_tests/types_13.f90:51:5 | 51 | integer*4, value, intent(in) :: a | ^^^^^^^^^ help: write this as 'integer(4)' style suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/types_13.f90:52:5 | 52 | real*8, value, intent(in) :: b | ^^^^^^ help: write this as 'real(8)' style suggestion: Use logical(4) instead of logical*4 --> tests/../integration_tests/types_13.f90:53:5 | 53 | logical*4 :: c | ^^^^^^^^^ help: write this as 'logical(4)' style suggestion: Use integer(4) instead of integer*4 --> tests/../integration_tests/types_13.f90:59:5 | 59 | integer*4, value, intent(in) :: a | ^^^^^^^^^ help: write this as 'integer(4)' style suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/types_13.f90:60:5 | 60 | real*8, value, intent(in) :: b | ^^^^^^ help: write this as 'real(8)' style suggestion: Use logical(4) instead of logical*4 --> tests/../integration_tests/types_13.f90:61:5 | 61 | logical*4 :: c | ^^^^^^^^^ help: write this as 'logical(4)' lfortran-0.63.0/tests/reference/asr-program1-17e5471.stdout0000664000175000017500000000506115174404631023414 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { program1: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) program1 [] [(Assignment (Var 2 i) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr_preprocess-cpp_err6-47462f4.json0000664000175000017500000000076015174404631025304 0ustar alastairalastair{ "basename": "asr_preprocess-cpp_err6-47462f4", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp_err6.f90", "infile_hash": "ac85436de6965d6e21140cdd72302a260de0f86538d86bd9b064a919", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp_err6-47462f4.stderr", "stderr_hash": "2b28f63b4ba3586c56a0b11dbd7597d09387b24d0002fcf81e9f02ae", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-bindc3-91bce68.stdout0000664000175000017500000002214515174404631023174 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bindc3: (Program (SymbolTable 2 { c_f_pointer: (ExternalSymbol 2 c_f_pointer 4 c_f_pointer lfortran_intrinsic_iso_c_binding [] c_f_pointer Public ), c_intptr_t: (ExternalSymbol 2 c_intptr_t 4 c_intptr_t lfortran_intrinsic_iso_c_binding [] c_intptr_t Public ), c_loc: (ExternalSymbol 2 c_loc 4 c_loc lfortran_intrinsic_iso_c_binding [] c_loc Public ), c_ptr: (ExternalSymbol 2 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), idx: (Variable 2 idx [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), queries: (Variable 2 queries [] Local () () Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Pointer (Integer 2) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Integer 2) () Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ) }) bindc3 [iso_c_binding] [(CPtrToPointer (Var 2 queries) (Var 2 x) () () ) (Print (StringFormat () [(BitCast (PointerToCPtr (Var 2 x) (CPtr) () ) (IntegerConstant 0 (Integer 8) Decimal) () (Integer 8) () ) (BitCast (Var 2 queries) (IntegerConstant 0 (Integer 8) Decimal) () (Integer 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Associate (Var 2 x) (Var 2 y) ) (Print (StringFormat () [(BitCast (PointerToCPtr (Var 2 x) (CPtr) () ) (IntegerConstant 0 (Integer 8) Decimal) () (Integer 8) () ) (BitCast (PointerToCPtr (GetPointer (Var 2 y) (Pointer (Integer 2) ) () ) (CPtr) () ) (IntegerConstant 0 (Integer 8) Decimal) () (Integer 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding) }) [] ) lfortran-0.63.0/tests/reference/asr-modules_06-821cc56.stdout0000664000175000017500000001725115174404631023723 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_06_a: (Module (SymbolTable 4 { a: (Function (SymbolTable 5 { a: (Variable 5 a [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 5 a) (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Add (FunctionCall 4 b () [] (Integer 4) () () ) (Integer 4) () ) () .false. .false. )] (Var 5 a) Public .true. .true. () ), b: (ExternalSymbol 4 b 2 b modules_06_b [] b Public ) }) modules_06_a () [modules_06_b] .false. .false. .false. ), modules_06_b: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { b: (Variable 3 b [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) b (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 b) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. )] (Var 3 b) Public .true. .true. () ) }) modules_06_b () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-merge_bits_run-9579699.json0000664000175000017500000000074615174404631024274 0ustar alastairalastair{ "basename": "asr-merge_bits_run-9579699", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/merge_bits_run.f90", "infile_hash": "1af0976e21bea2f1804946c6fc9338f4a28f5ed426b33ffe3b79c6b5", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-merge_bits_run-9579699.stderr", "stderr_hash": "c2d5bf15339248ebc5a3de085cb8a04b5e8e755a24f9de55b60b8c76", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-derived_types_41-d6b8ce9.stdout0000664000175000017500000005445415174404631025277 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_41: (Program (SymbolTable 4 { 1_mytype_a: (ExternalSymbol 4 1_mytype_a 3 a mytype [] a Public ), 1_mytype_b: (ExternalSymbol 4 1_mytype_b 3 b mytype [] b Public ), 1_mytype_c: (ExternalSymbol 4 1_mytype_c 3 c mytype [] c Public ), mytype: (ExternalSymbol 4 mytype 2 mytype derived_types_41_mod [] mytype Public ), mytype_instance: (ExternalSymbol 4 mytype_instance 2 mytype_instance derived_types_41_mod [] mytype_instance Public ) }) derived_types_41 [derived_types_41_mod] [(If () (IntrinsicArrayFunction Any [(ArrayPhysicalCast (IntegerCompare (StructInstanceMember (Var 4 mytype_instance) 4 1_mytype_a (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) NotEq (ArrayConstant 8 [1, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (StructInstanceMember (Var 4 mytype_instance) 4 1_mytype_b (Integer 4) () ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntrinsicArrayFunction Any [(ArrayPhysicalCast (IntegerCompare (StructInstanceMember (Var 4 mytype_instance) 4 1_mytype_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) NotEq (ArrayConstant 8 [4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) () ) [(ErrorStop () )] [] )] ), derived_types_41_mod: (Module (SymbolTable 2 { mytype: (Struct (SymbolTable 3 { a: (Variable 3 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 3 c [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mytype (StructType [(Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray )] [] .true. .false. ) [] [a b c] [] Source Public .false. .false. [] () () [] ), mytype_instance: (Variable 2 mytype_instance [] Local (StructConstant 2 mytype [((ArrayConstant 8 [1, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor )) ((IntegerConstant 3 (Integer 4) Decimal)) ((ArrayConstant 8 [4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ))] (StructType [(Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray )] [] .true. .false. ) ) (StructConstant 2 mytype [((ArrayConstant 8 [1, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor )) ((IntegerConstant 3 (Integer 4) Decimal)) ((ArrayConstant 8 [4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ))] (StructType [(Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray )] [] .true. .false. ) ) Default (StructType [(Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray )] [] .true. .false. ) 2 mytype Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) derived_types_41_mod () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-if_04-7f1b69d.stderr0000664000175000017500000000023715174404631022715 0ustar alastairalastairstyle suggestion: Use 'end if' instead of 'endif' --> tests/../integration_tests/if_04.f90:25:1 | 25 | endif name | ^^^^^ help: write this as 'end if' lfortran-0.63.0/tests/reference/asr-kind2-191347a.stderr0000664000175000017500000000017215174404631022646 0ustar alastairalastairsemantic error: Expected initialization expression for kind --> tests/errors/kind2.f90:4:6 | 4 | real(*) a | ^ lfortran-0.63.0/tests/reference/llvm-return_01-495409d.stderr0000664000175000017500000000026115174404631023653 0ustar alastairalastairstyle suggestion: Use '>' instead of '.gt.' --> tests/../integration_tests/return_01.f90:9:15 | 9 | if (i .GT. 5) then | ^^^^ help: write this as '>' lfortran-0.63.0/tests/reference/asr-string_01-bda4726.stdout0000664000175000017500000000465315174404631023634 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { print_01: (Program (SymbolTable 2 { my_name: (Variable 2 my_name [] Local (StringConstant "Dominic" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "Dominic" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) print_01 [] [(Print (StringFormat () [(StringConstant "My name is " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 my_name)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr_indent-subroutine1-41f648b.stdout0000664000175000017500000001672715174404631025601 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { g: (Function (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) g (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (Var 2 x) (IntegerBinOp (Var 2 x) Mul (Var 2 i) (Integer 4) () ) () .false. .false. )] [] )] () Public .true. .true. () ), h: (Function (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) h (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 x) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (Var 3 x) (IntegerBinOp (Var 3 i) Mul (Var 3 x) (Integer 4) () ) () .false. .false. )] [] )] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-program_without_line_cc-b84ba02.stdout0000664000175000017500000000036715174404631026723 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { }) [(Print (StringConstant "OK" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) lfortran-0.63.0/tests/reference/run-print4-e3cf30b.stdout0000664000175000017500000000112715174404631023332 0ustar alastairalastair20000000000000000 22 33 F 1 1 1 1 1 1 1 1 1 1 (2.00000000,3.00000000) 1 1 1 1 1 1 1 1 1 1 HelloLFortran HelloLFortran HelloLFortran HelloLComp 20000000000000000 20000000000000000 20000000000000000 HelloLFortran HelloLFortranHelloLFortran med med med med med med med med med med 22 10.300000000000001 T T T T T T T T T F 10.3000002 F 232 stringstring 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 33 1 1 1 1 1 1 1 1 1 here HelloLFortranHelloLFortran F lfortran-0.63.0/tests/reference/run-format_35-3cec85a.json0000664000175000017500000000071515174404631023350 0ustar alastairalastair{ "basename": "run-format_35-3cec85a", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_35.f90", "infile_hash": "f896fc01b6e682902fd344315307e1e7d30628de4f084373e8661259", "outfile": null, "outfile_hash": null, "stdout": "run-format_35-3cec85a.stdout", "stdout_hash": "1eb4aa6672473c6d9a100da8d292060aacac62d946b7c74b373cd04c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-type_conflict1-5097f3a.stderr0000664000175000017500000000031715174404631024650 0ustar alastairalastairsemantic error: Parameter attribute cannot be used with Target attribute --> tests/errors/type_conflict1.f90:3:5 | 3 | integer, parameter, target :: foo=4 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-bin_op_real_dp-21bb7e8.json0000664000175000017500000000076415174404631024411 0ustar alastairalastair{ "basename": "asr-bin_op_real_dp-21bb7e8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bin_op_real_dp.f90", "infile_hash": "051ba0744595dc6c3079fa4dd5b8cf1ee0504f434ee5dd8eb64ad7cc", "outfile": null, "outfile_hash": null, "stdout": "asr-bin_op_real_dp-21bb7e8.stdout", "stdout_hash": "6d104247272f06ab6bf0b9b4a1dcbe7adf2d8224b3ff4819ceade49d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-allow_implicit_interface2-f4d4abc.stdout0000664000175000017500000002053015174404631027266 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fdjac1: (Function (SymbolTable 2 { fcn: (Function (SymbolTable 3 { fcn_arg_0: (Variable 3 fcn_arg_0 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), fcn_arg_1: (Variable 3 fcn_arg_1 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fcn (FunctionType [(Integer 4) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 fcn_arg_0) (Var 3 fcn_arg_1)] [] () Public .false. .false. () ), n: (Variable 2 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fdjac1 (FunctionType [(Real 4) (Integer 4) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 fcn) (Var 2 n) (Var 2 x) (Var 2 y)] [(SubroutineCall 2 fcn () [((Var 2 x)) ((Var 2 y))] () .false. )] () Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/ast-fixed_form_4-656a640.json0000664000175000017500000000075315174404631023663 0ustar alastairalastair{ "basename": "ast-fixed_form_4-656a640", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/fixed_form_4.f", "infile_hash": "ead212bbc34e4848d189561c4e6474149e4afb1bfeda6f7e46b90b12", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-fixed_form_4-656a640.stderr", "stderr_hash": "dd0de417e4cccdc2321f322a53b4aa0c212ae0ee3dbdaf980d13ec3a", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-parameter_05-916c4d8.json0000664000175000017500000000075615174404631023672 0ustar alastairalastair{ "basename": "asr-parameter_05-916c4d8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/parameter_05.f90", "infile_hash": "050c43a9cdbd3f792c1b0b750daa46584ebee4ee16bebe0333f92e9b", "outfile": null, "outfile_hash": null, "stdout": "asr-parameter_05-916c4d8.stdout", "stdout_hash": "72b3e637dd2b602662ef940c4de413a3e96744224d4eb7749402e8e3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-sync1-5d8b786.json0000664000175000017500000000071715174404631023125 0ustar alastairalastair{ "basename": "ast_f90-sync1-5d8b786", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/sync1.f90", "infile_hash": "363462c860cc54ea57727a4d2ee43782f907dd682bcafcb8fa2017cb", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-sync1-5d8b786.stdout", "stdout_hash": "6a7ee91dfaa1f073b34287cf672a38961de6950f061a815621778d54", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixedform_doloop3-d579f3c.json0000664000175000017500000000076315174404631025112 0ustar alastairalastair{ "basename": "ast-fixedform_doloop3-d579f3c", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_doloop3.f", "infile_hash": "ebd193385bf57e6d56e977b85546143c590e783d1f2b5bdea17ecdf9", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_doloop3-d579f3c.stdout", "stdout_hash": "359c9d820d5c7a6f090fe92de1ebc651158e6974e0e50b191458b82c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-common2-1811464.stdout0000664000175000017500000000615015174404631023153 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ()) (b [] [] () () None ()) (c [] [] () () None ()) (d [] [] () () None ()) (e [] [] () () None ()) (g [] [] () () None ()) (h [] [] () () None ()) (i [] [] () () None ()) (j [] [] () () None ()) (k [] [] () () None ())] () ) (Declaration () [(AttrCommon [(block_1 [(a [] [] () a None ()) (b [] [] () b None ()) (h [] [] () h None ())]) (block_2 [(c [] [] () c None ()) (d [] [] () d None ())]) (block_3 [(e [] [] () e None ()) (g [] [] () g None ())])] )] [] () ) (Declaration () [(AttrCommon [(block_4 [(i [] [] () i None ())]) (block_5 [(j [] [] () j None ()) (k [] [] () k None ())])] )] [] () )] [] [] [] )] ) lfortran-0.63.0/tests/reference/llvm-print_01-63a0480.stdout0000664000175000017500000001417415174404631023502 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [15 x i8] c"I4,I4,I4,I4,I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c" \00", align 1 @3 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [15 x i8] c"I4,I4,I4,I4,I4\00", align 1 @4 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() %lfortran_iomsg = alloca %string_descriptor, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store %string_descriptor zeroinitializer, %string_descriptor* %lfortran_iomsg, align 1 %3 = getelementptr %string_descriptor, %string_descriptor* %lfortran_iomsg, i32 0, i32 1 store i64 0, i64* %3, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %lfortran_iomsg, i32 0, i32 0 %5 = call i8* @_lfortran_get_default_allocator() %6 = call i8* @_lfortran_malloc_alloc(i8* %5, i64 1) store i8* %6, i8** %4, align 8 %x = alloca i32, align 4 store i32 25, i32* %x, align 4 %7 = alloca i64, align 8 %8 = alloca i32, align 4 store i32 1, i32* %8, align 4 %9 = alloca i32, align 4 store i32 3, i32* %9, align 4 %10 = load i32, i32* %x, align 4 %11 = add i32 25, %10 %12 = alloca i32, align 4 store i32 %11, i32* %12, align 4 %13 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @serialization_info, i32 0, i32 0), i64* %7, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %x, i32* %8, i32* %9, i32* %x, i32* %12) %14 = load i64, i64* %7, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %13, i8** %15, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %14, i64* %16, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %18 = load i8*, i8** %17, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %20 = load i64, i64* %19, align 8 %21 = trunc i64 %20 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %18, i32 %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %22 = icmp eq i8* %13, null br i1 %22, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %13) br label %free_done free_done: ; preds = %free_nonnull, %.entry %23 = alloca i32*, align 8 store i32* null, i32** %23, align 8 %24 = load i32*, i32** %23, align 8 %25 = call i32 @_lfortran_get_decimal_mode(i32 6) %26 = call i32 @_lfortran_get_sign_mode(i32 6) %27 = call i32 @_lfortran_get_round_mode(i32 6) %28 = alloca i64, align 8 %29 = alloca i32, align 4 store i32 1, i32* %29, align 4 %30 = alloca i32, align 4 store i32 3, i32* %30, align 4 %31 = load i32, i32* %x, align 4 %32 = add i32 25, %31 %33 = alloca i32, align 4 store i32 %32, i32* %33, align 4 %34 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @serialization_info.1, i32 0, i32 0), i64* %28, i32 0, i32 0, i32 %25, i32 %26, i32 %27, i32* %x, i32* %29, i32* %30, i32* %x, i32* %33) %35 = load i64, i64* %28, align 8 %36 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %34, i8** %36, align 8 %37 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %35, i64* %37, align 8 %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %39 = load i8*, i8** %38, align 8 %40 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %41 = load i64, i64* %40, align 8 call void (i32, i32*, i8*, i64, ...) @_lfortran_file_write(i32 6, i32* %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @4, i32 0, i32 0), i64 4, i8* %39, i64 %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @3, i32 0, i32 0), i64 1) %42 = icmp eq i8* %34, null br i1 %42, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %2, i8* %34) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done br label %return return: ; preds = %free_done3 br label %FINALIZE_SYMTABLE_print_01 FINALIZE_SYMTABLE_print_01: ; preds = %return br label %Finalize_Variable_lfortran_iomsg Finalize_Variable_lfortran_iomsg: ; preds = %FINALIZE_SYMTABLE_print_01 %43 = getelementptr %string_descriptor, %string_descriptor* %lfortran_iomsg, i32 0, i32 0 %44 = load i8*, i8** %43, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %44) call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc_alloc(i8*, i64) declare i8* @_lfortran_get_default_allocator() declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare i32 @_lfortran_get_decimal_mode(i32) declare i32 @_lfortran_get_sign_mode(i32) declare i32 @_lfortran_get_round_mode(i32) declare void @_lfortran_file_write(i32, i32*, i8*, i64, ...) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/llvm-legacy_array_sections_01-2515c0f.stdout0000664000175000017500000020113615174404631026773 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %array.1 = type { double*, i64, i32, i8, i8, i8, i8, i64, [1 x %dimension_descriptor] } %dimension_descriptor = type { i64, i64, i64 } %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [37 x i8] c"__libasr_created__subroutine_call_b1\00", align 1 @1 = private unnamed_addr constant [56 x i8] c"tests/../integration_tests/legacy_array_sections_01.f90\00", align 1 @2 = private unnamed_addr constant [53 x i8] c"Cannot allocate '%s' because it is already allocated\00", align 1 @3 = private unnamed_addr constant [55 x i8] c"Attempting to allocate already allocated variable '%s'\00", align 1 @4 = private unnamed_addr constant [37 x i8] c"__libasr_created__subroutine_call_b1\00", align 1 @5 = private unnamed_addr constant [56 x i8] c"tests/../integration_tests/legacy_array_sections_01.f90\00", align 1 @6 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @7 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @8 = private unnamed_addr constant [36 x i8] c"__libasr_created__subroutine_call_b\00", align 1 @9 = private unnamed_addr constant [56 x i8] c"tests/../integration_tests/legacy_array_sections_01.f90\00", align 1 @10 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @11 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @12 = private unnamed_addr constant [36 x i8] c"__libasr_created__subroutine_call_b\00", align 1 @13 = private unnamed_addr constant [56 x i8] c"tests/../integration_tests/legacy_array_sections_01.f90\00", align 1 @14 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @15 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @16 = private unnamed_addr constant [37 x i8] c"__libasr_created__subroutine_call_b1\00", align 1 @17 = private unnamed_addr constant [56 x i8] c"tests/../integration_tests/legacy_array_sections_01.f90\00", align 1 @18 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @19 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"w\00", align 1 @21 = private unnamed_addr constant [56 x i8] c"tests/../integration_tests/legacy_array_sections_01.f90\00", align 1 @22 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @23 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @25 = private unnamed_addr constant [56 x i8] c"tests/../integration_tests/legacy_array_sections_01.f90\00", align 1 @26 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @27 = private unnamed_addr constant [143 x i8] c"Runtime error: Array shape mismatch in subroutine '%s'\0A\0ATried to match size %d of dimension %d of argument number %d, but expected size is %d\0A\00", align 1 @28 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [5 x i8] c"[R8]\00", align 1 @29 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"w\00", align 1 @31 = private unnamed_addr constant [56 x i8] c"tests/../integration_tests/legacy_array_sections_01.f90\00", align 1 @32 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @33 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @34 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @35 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"w\00", align 1 @37 = private unnamed_addr constant [56 x i8] c"tests/../integration_tests/legacy_array_sections_01.f90\00", align 1 @38 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @39 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @40 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @41 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @a(double* %w) { .entry: %arr_desc17 = alloca %array.1, align 8 %0 = call i8* @_lfortran_get_default_allocator() %array_section_descriptor = alloca %array.1, align 8 %arr_desc1 = alloca %array.1, align 8 %arr_desc = alloca %array.1, align 8 %__do_loop_end = alloca i32, align 4 %__do_loop_end1 = alloca i32, align 4 %__lcompilers_i_0 = alloca i32, align 4 %__libasr_created__subroutine_call_b = alloca %array.1*, align 8 store %array.1* null, %array.1** %__libasr_created__subroutine_call_b, align 8 %1 = getelementptr %array.1, %array.1* %arr_desc, i32 0, i32 8 %2 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %1, i32 0, i32 0 %3 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %2, i32 0 %4 = getelementptr %dimension_descriptor, %dimension_descriptor* %3, i32 0, i32 0 store i64 1, i64* %4, align 8 %5 = getelementptr %dimension_descriptor, %dimension_descriptor* %3, i32 0, i32 1 store i64 1, i64* %5, align 8 %6 = getelementptr %dimension_descriptor, %dimension_descriptor* %3, i32 0, i32 2 store i64 0, i64* %6, align 8 %7 = getelementptr %array.1, %array.1* %arr_desc, i32 0, i32 3 store i8 1, i8* %7, align 1 %8 = getelementptr %array.1, %array.1* %arr_desc, i32 0, i32 0 store double* null, double** %8, align 8 store %array.1* %arr_desc, %array.1** %__libasr_created__subroutine_call_b, align 8 %__libasr_created__subroutine_call_b1 = alloca %array.1*, align 8 store %array.1* null, %array.1** %__libasr_created__subroutine_call_b1, align 8 %9 = getelementptr %array.1, %array.1* %arr_desc1, i32 0, i32 8 %10 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %9, i32 0, i32 0 %11 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %10, i32 0 %12 = getelementptr %dimension_descriptor, %dimension_descriptor* %11, i32 0, i32 0 store i64 1, i64* %12, align 8 %13 = getelementptr %dimension_descriptor, %dimension_descriptor* %11, i32 0, i32 1 store i64 1, i64* %13, align 8 %14 = getelementptr %dimension_descriptor, %dimension_descriptor* %11, i32 0, i32 2 store i64 0, i64* %14, align 8 %15 = getelementptr %array.1, %array.1* %arr_desc1, i32 0, i32 3 store i8 1, i8* %15, align 1 %16 = getelementptr %array.1, %array.1* %arr_desc1, i32 0, i32 0 store double* null, double** %16, align 8 store %array.1* %arr_desc1, %array.1** %__libasr_created__subroutine_call_b1, align 8 %icon = alloca i32, align 4 store i32 2, i32* %icon, align 4 %17 = load i32, i32* %icon, align 4 %18 = getelementptr %array.1, %array.1* %array_section_descriptor, i32 0, i32 8 %19 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %18, i32 0, i32 0 %20 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %19, i32 0 %21 = getelementptr %dimension_descriptor, %dimension_descriptor* %20, i32 0, i32 0 store i64 1, i64* %21, align 8 %22 = getelementptr %dimension_descriptor, %dimension_descriptor* %20, i32 0, i32 1 store i64 1, i64* %22, align 8 %23 = getelementptr %dimension_descriptor, %dimension_descriptor* %20, i32 0, i32 2 store i64 0, i64* %23, align 8 %24 = getelementptr %array.1, %array.1* %array_section_descriptor, i32 0, i32 3 store i8 1, i8* %24, align 1 %25 = sext i32 %17 to i64 %26 = sub i64 %25, 1 %27 = mul i64 1, %26 %28 = add i64 0, %27 %29 = getelementptr inbounds double, double* %w, i64 %28 %30 = getelementptr %array.1, %array.1* %array_section_descriptor, i32 0, i32 0 store double* %29, double** %30, align 8 %31 = getelementptr %array.1, %array.1* %array_section_descriptor, i32 0, i32 7 store i64 0, i64* %31, align 8 %32 = getelementptr %array.1, %array.1* %array_section_descriptor, i32 0, i32 8 %33 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %32, i32 0, i32 0 %34 = sext i32 %17 to i64 %35 = sub i64 5, %34 %36 = sdiv i64 %35, 1 %37 = add i64 %36, 1 %38 = icmp slt i64 5, %34 %39 = icmp sgt i64 5, %34 %40 = and i1 true, %38 %41 = and i1 false, %39 %42 = or i1 %40, %41 %43 = select i1 %42, i64 0, i64 %37 %44 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %33, i32 0 %45 = getelementptr %dimension_descriptor, %dimension_descriptor* %44, i32 0, i32 2 store i64 1, i64* %45, align 8 %46 = getelementptr %dimension_descriptor, %dimension_descriptor* %44, i32 0, i32 0 store i64 1, i64* %46, align 8 %47 = getelementptr %dimension_descriptor, %dimension_descriptor* %44, i32 0, i32 1 store i64 %43, i64* %47, align 8 %48 = getelementptr %array.1, %array.1* %array_section_descriptor, i32 0, i32 3 store i8 1, i8* %48, align 1 store %array.1* %array_section_descriptor, %array.1** %__libasr_created__subroutine_call_b, align 8 %49 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b, align 8 %50 = getelementptr %array.1, %array.1* %49, i32 0, i32 8 %51 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %50, i32 0, i32 0 %52 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %51, i32 0 %53 = getelementptr %dimension_descriptor, %dimension_descriptor* %52, i32 0, i32 0 %54 = load i64, i64* %53, align 8 %55 = getelementptr %dimension_descriptor, %dimension_descriptor* %52, i32 0, i32 2 %56 = load i64, i64* %55, align 8 %57 = icmp eq i64 %56, 1 %58 = and i1 true, %57 %59 = getelementptr %dimension_descriptor, %dimension_descriptor* %52, i32 0, i32 0 %60 = load i64, i64* %59, align 8 %61 = getelementptr %dimension_descriptor, %dimension_descriptor* %52, i32 0, i32 1 %62 = load i64, i64* %61, align 8 %63 = add i64 %62, %60 %64 = sub i64 %63, 1 %65 = sub i64 %64, %54 %66 = add i64 %65, 1 %67 = mul i64 1, %66 %68 = ptrtoint %array.1* %49 to i64 %69 = icmp eq i64 %68, 0 br i1 %69, label %merge_allocated, label %check_data check_data: ; preds = %.entry %70 = getelementptr %array.1, %array.1* %49, i32 0, i32 0 %71 = load double*, double** %70, align 8 %72 = ptrtoint double* %71 to i64 %73 = icmp ne i64 %72, 0 br label %merge_allocated merge_allocated: ; preds = %check_data, %.entry %is_allocated = phi i1 [ false, %.entry ], [ %73, %check_data ] %74 = xor i1 %is_allocated, true %75 = or i1 %58, %74 %76 = xor i1 %75, true br i1 %76, label %then, label %else15 then: ; preds = %merge_allocated %77 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b1, align 8 %78 = ptrtoint %array.1* %77 to i64 %79 = icmp eq i64 %78, 0 br i1 %79, label %merge_allocated3, label %check_data2 check_data2: ; preds = %then %80 = getelementptr %array.1, %array.1* %77, i32 0, i32 0 %81 = load double*, double** %80, align 8 %82 = ptrtoint double* %81 to i64 %83 = icmp ne i64 %82, 0 br label %merge_allocated3 merge_allocated3: ; preds = %check_data2, %then %is_allocated4 = phi i1 [ false, %then ], [ %83, %check_data2 ] br i1 %is_allocated4, label %then5, label %else then5: ; preds = %merge_allocated3 %84 = getelementptr %array.1, %array.1* %77, i32 0, i32 0 %85 = load double*, double** %84, align 8 %86 = bitcast double* %85 to i8* call void @_lfortran_free_alloc(i8* %0, i8* %86) %87 = getelementptr %array.1, %array.1* %77, i32 0, i32 0 store double* null, double** %87, align 8 br label %ifcont else: ; preds = %merge_allocated3 br label %ifcont ifcont: ; preds = %else, %then5 %88 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b1, align 8 %89 = ptrtoint %array.1* %88 to i64 %90 = icmp eq i64 %89, 0 br i1 %90, label %merge_allocated7, label %check_data6 check_data6: ; preds = %ifcont %91 = getelementptr %array.1, %array.1* %88, i32 0, i32 0 %92 = load double*, double** %91, align 8 %93 = ptrtoint double* %92 to i64 %94 = icmp ne i64 %93, 0 br label %merge_allocated7 merge_allocated7: ; preds = %check_data6, %ifcont %is_allocated8 = phi i1 [ false, %ifcont ], [ %94, %check_data6 ] br i1 %is_allocated8, label %then9, label %ifcont10 then9: ; preds = %merge_allocated7 %95 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %96 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %97 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %96, i32 0, i32 0 %98 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %97, i32 0, i32 0 store i8* getelementptr inbounds ([56 x i8], [56 x i8]* @1, i32 0, i32 0), i8** %98, align 8 %99 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %97, i32 0, i32 1 store i32 5, i32* %99, align 4 %100 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %97, i32 0, i32 2 store i32 8, i32* %100, align 4 %101 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %97, i32 0, i32 3 store i32 5, i32* %101, align 4 %102 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %97, i32 0, i32 4 store i32 14, i32* %102, align 4 %103 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @2, i32 0, i32 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @0, i32 0, i32 0)) %104 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %95, i32 0, i32 0 %105 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %96, i32 0, i32 0 %106 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %104, i32 0, i32 2 %107 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %104, i32 0, i32 0 store i1 true, i1* %107, align 1 %108 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %104, i32 0, i32 1 store i8* %103, i8** %108, align 8 store { i8*, i32, i32, i32, i32 }* %105, { i8*, i32, i32, i32, i32 }** %106, align 8 %109 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %104, i32 0, i32 3 store i32 1, i32* %109, align 4 %110 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %95, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %110, i32 1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont10: ; preds = %merge_allocated7 %111 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b, align 8 %112 = getelementptr %array.1, %array.1* %111, i32 0, i32 8 %113 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %112, i32 0, i32 0 %114 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %113, i32 0 %115 = getelementptr %dimension_descriptor, %dimension_descriptor* %114, i32 0, i32 0 %116 = load i64, i64* %115, align 8 %117 = getelementptr %dimension_descriptor, %dimension_descriptor* %114, i32 0, i32 1 %118 = load i64, i64* %117, align 8 %119 = add i64 %118, %116 %120 = sub i64 %119, 1 %121 = trunc i64 %120 to i32 %122 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b1, align 8 %123 = getelementptr %array.1, %array.1* %122, i32 0, i32 7 store i64 0, i64* %123, align 8 %124 = getelementptr %array.1, %array.1* %122, i32 0, i32 8 %125 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %124, i32 0, i32 0 %126 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %125, i32 0 %127 = getelementptr %dimension_descriptor, %dimension_descriptor* %126, i32 0, i32 2 %128 = getelementptr %dimension_descriptor, %dimension_descriptor* %126, i32 0, i32 0 %129 = getelementptr %dimension_descriptor, %dimension_descriptor* %126, i32 0, i32 1 %130 = sext i32 %121 to i64 %131 = icmp slt i64 %130, 0 %132 = select i1 %131, i64 0, i64 %130 store i64 1, i64* %127, align 8 store i64 1, i64* %128, align 8 store i64 %132, i64* %129, align 8 %133 = mul i64 1, %132 %134 = getelementptr %array.1, %array.1* %122, i32 0, i32 0 %135 = mul i64 %133, 8 %136 = call i8* @_lfortran_get_default_allocator() %137 = call i8* @_lfortran_malloc_alloc(i8* %136, i64 %135) %138 = bitcast i8* %137 to double* store double* %138, double** %134, align 8 %139 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b1, align 8 %140 = getelementptr %array.1, %array.1* %139, i32 0, i32 8 %141 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %140, i32 0, i32 0 %142 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %141, i32 0 %143 = getelementptr %dimension_descriptor, %dimension_descriptor* %142, i32 0, i32 0 %144 = load i64, i64* %143, align 8 %145 = getelementptr %dimension_descriptor, %dimension_descriptor* %142, i32 0, i32 1 %146 = load i64, i64* %145, align 8 %147 = add i64 %146, %144 %148 = sub i64 %147, 1 %149 = trunc i64 %148 to i32 store i32 %149, i32* %__do_loop_end, align 4 %150 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b1, align 8 %151 = getelementptr %array.1, %array.1* %150, i32 0, i32 8 %152 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %151, i32 0, i32 0 %153 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %152, i32 0 %154 = getelementptr %dimension_descriptor, %dimension_descriptor* %153, i32 0, i32 0 %155 = load i64, i64* %154, align 8 %156 = trunc i64 %155 to i32 %157 = sub i32 %156, 1 store i32 %157, i32* %__lcompilers_i_0, align 4 br label %loop.head loop.head: ; preds = %ifcont14, %ifcont10 %158 = load i32, i32* %__lcompilers_i_0, align 4 %159 = add i32 %158, 1 %160 = load i32, i32* %__do_loop_end, align 4 %161 = icmp sle i32 %159, %160 br i1 %161, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %162 = load i32, i32* %__lcompilers_i_0, align 4 %163 = add i32 %162, 1 store i32 %163, i32* %__lcompilers_i_0, align 4 %164 = load i32, i32* %__lcompilers_i_0, align 4 %165 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b1, align 8 %166 = getelementptr %array.1, %array.1* %165, i32 0, i32 8 %167 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %166, i32 0, i32 0 %168 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %167, i32 0 %169 = getelementptr %dimension_descriptor, %dimension_descriptor* %168, i32 0, i32 0 %170 = load i64, i64* %169, align 8 %171 = getelementptr %dimension_descriptor, %dimension_descriptor* %168, i32 0, i32 1 %172 = load i64, i64* %171, align 8 %173 = sext i32 %164 to i64 %174 = sub i64 %173, %170 %175 = add i64 %170, %172 %176 = sub i64 %175, 1 %177 = icmp slt i64 %173, %170 %178 = icmp sgt i64 %173, %176 %179 = or i1 %177, %178 br i1 %179, label %then11, label %ifcont12 then11: ; preds = %loop.body %180 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %181 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %182 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %181, i32 0, i32 0 %183 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %182, i32 0, i32 0 store i8* getelementptr inbounds ([56 x i8], [56 x i8]* @5, i32 0, i32 0), i8** %183, align 8 %184 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %182, i32 0, i32 1 store i32 5, i32* %184, align 4 %185 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %182, i32 0, i32 2 store i32 8, i32* %185, align 4 %186 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %182, i32 0, i32 3 store i32 5, i32* %186, align 4 %187 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %182, i32 0, i32 4 store i32 14, i32* %187, align 4 %188 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @6, i32 0, i32 0)) %189 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %180, i32 0, i32 0 %190 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %181, i32 0, i32 0 %191 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %189, i32 0, i32 2 %192 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %189, i32 0, i32 0 store i1 true, i1* %192, align 1 %193 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %189, i32 0, i32 1 store i8* %188, i8** %193, align 8 store { i8*, i32, i32, i32, i32 }* %190, { i8*, i32, i32, i32, i32 }** %191, align 8 %194 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %189, i32 0, i32 3 store i32 1, i32* %194, align 4 %195 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %180, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %195, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @4, i32 0, i32 0), i64 %173, i32 1, i64 %170, i64 %176) call void @exit(i32 1) unreachable ifcont12: ; preds = %loop.body %196 = getelementptr %dimension_descriptor, %dimension_descriptor* %168, i32 0, i32 2 %197 = load i64, i64* %196, align 8 %198 = mul i64 %197, %174 %199 = add i64 0, %198 %200 = getelementptr %array.1, %array.1* %165, i32 0, i32 7 %201 = load i64, i64* %200, align 8 %202 = add i64 %199, %201 %203 = getelementptr %array.1, %array.1* %165, i32 0, i32 0 %204 = load double*, double** %203, align 8 %205 = getelementptr inbounds double, double* %204, i64 %202 %206 = load i32, i32* %__lcompilers_i_0, align 4 %207 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b, align 8 %208 = getelementptr %array.1, %array.1* %207, i32 0, i32 8 %209 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %208, i32 0, i32 0 %210 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %209, i32 0 %211 = getelementptr %dimension_descriptor, %dimension_descriptor* %210, i32 0, i32 0 %212 = load i64, i64* %211, align 8 %213 = getelementptr %dimension_descriptor, %dimension_descriptor* %210, i32 0, i32 1 %214 = load i64, i64* %213, align 8 %215 = sext i32 %206 to i64 %216 = sub i64 %215, %212 %217 = add i64 %212, %214 %218 = sub i64 %217, 1 %219 = icmp slt i64 %215, %212 %220 = icmp sgt i64 %215, %218 %221 = or i1 %219, %220 br i1 %221, label %then13, label %ifcont14 then13: ; preds = %ifcont12 %222 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %223 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %224 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %223, i32 0, i32 0 %225 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %224, i32 0, i32 0 store i8* getelementptr inbounds ([56 x i8], [56 x i8]* @9, i32 0, i32 0), i8** %225, align 8 %226 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %224, i32 0, i32 1 store i32 5, i32* %226, align 4 %227 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %224, i32 0, i32 2 store i32 8, i32* %227, align 4 %228 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %224, i32 0, i32 3 store i32 5, i32* %228, align 4 %229 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %224, i32 0, i32 4 store i32 14, i32* %229, align 4 %230 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @10, i32 0, i32 0)) %231 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %222, i32 0, i32 0 %232 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %223, i32 0, i32 0 %233 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %231, i32 0, i32 2 %234 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %231, i32 0, i32 0 store i1 true, i1* %234, align 1 %235 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %231, i32 0, i32 1 store i8* %230, i8** %235, align 8 store { i8*, i32, i32, i32, i32 }* %232, { i8*, i32, i32, i32, i32 }** %233, align 8 %236 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %231, i32 0, i32 3 store i32 1, i32* %236, align 4 %237 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %222, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %237, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @8, i32 0, i32 0), i64 %215, i32 1, i64 %212, i64 %218) call void @exit(i32 1) unreachable ifcont14: ; preds = %ifcont12 %238 = getelementptr %dimension_descriptor, %dimension_descriptor* %210, i32 0, i32 2 %239 = load i64, i64* %238, align 8 %240 = mul i64 %239, %216 %241 = add i64 0, %240 %242 = getelementptr %array.1, %array.1* %207, i32 0, i32 7 %243 = load i64, i64* %242, align 8 %244 = add i64 %241, %243 %245 = getelementptr %array.1, %array.1* %207, i32 0, i32 0 %246 = load double*, double** %245, align 8 %247 = getelementptr inbounds double, double* %246, i64 %244 %248 = load double, double* %247, align 8 store double %248, double* %205, align 8 br label %loop.head loop.end: ; preds = %loop.head br label %ifcont20 else15: ; preds = %merge_allocated %249 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b, align 8 %250 = getelementptr %array.1, %array.1* %249, i32 0, i32 3 %251 = load i8, i8* %250, align 1 %252 = zext i8 %251 to i32 %253 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b1, align 8 %254 = icmp eq %array.1* %253, null br i1 %254, label %then16, label %else18 then16: ; preds = %else15 %255 = bitcast %array.1* %arr_desc17 to i8* call void @llvm.memset.p0i8.i64(i8* %255, i8 0, i64 8, i1 false) %256 = getelementptr %array.1, %array.1* %arr_desc17, i32 0, i32 3 %257 = trunc i32 %252 to i8 store i8 %257, i8* %256, align 1 store %array.1* %arr_desc17, %array.1** %__libasr_created__subroutine_call_b1, align 8 br label %ifcont19 else18: ; preds = %else15 br label %ifcont19 ifcont19: ; preds = %else18, %then16 %258 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b1, align 8 %259 = getelementptr %array.1, %array.1* %249, i32 0, i32 0 %260 = getelementptr %array.1, %array.1* %258, i32 0, i32 0 %261 = load double*, double** %259, align 8 store double* %261, double** %260, align 8 %262 = getelementptr %array.1, %array.1* %249, i32 0, i32 8 %263 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %262, i32 0, i32 0 %264 = getelementptr %array.1, %array.1* %258, i32 0, i32 8 %265 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %264, i32 0, i32 0 %266 = bitcast %dimension_descriptor* %265 to i8* %267 = bitcast %dimension_descriptor* %263 to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %266, i8* align 8 %267, i64 24, i1 false) %268 = getelementptr %array.1, %array.1* %258, i32 0, i32 3 %269 = trunc i32 %252 to i8 store i8 %269, i8* %268, align 1 %270 = getelementptr %array.1, %array.1* %249, i32 0, i32 7 %271 = load i64, i64* %270, align 8 %272 = getelementptr %array.1, %array.1* %258, i32 0, i32 7 store i64 %271, i64* %272, align 8 br label %ifcont20 ifcont20: ; preds = %ifcont19, %loop.end %273 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b1, align 8 %274 = getelementptr %array.1, %array.1* %273, i32 0, i32 0 %275 = load double*, double** %274, align 8 %276 = getelementptr %array.1, %array.1* %273, i32 0, i32 7 %277 = load i64, i64* %276, align 8 %278 = getelementptr inbounds double, double* %275, i64 %277 call void @b(double* %278) %279 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b, align 8 %280 = getelementptr %array.1, %array.1* %279, i32 0, i32 8 %281 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %280, i32 0, i32 0 %282 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %281, i32 0 %283 = getelementptr %dimension_descriptor, %dimension_descriptor* %282, i32 0, i32 0 %284 = load i64, i64* %283, align 8 %285 = getelementptr %dimension_descriptor, %dimension_descriptor* %282, i32 0, i32 2 %286 = load i64, i64* %285, align 8 %287 = icmp eq i64 %286, 1 %288 = and i1 true, %287 %289 = getelementptr %dimension_descriptor, %dimension_descriptor* %282, i32 0, i32 0 %290 = load i64, i64* %289, align 8 %291 = getelementptr %dimension_descriptor, %dimension_descriptor* %282, i32 0, i32 1 %292 = load i64, i64* %291, align 8 %293 = add i64 %292, %290 %294 = sub i64 %293, 1 %295 = sub i64 %294, %284 %296 = add i64 %295, 1 %297 = mul i64 1, %296 %298 = ptrtoint %array.1* %279 to i64 %299 = icmp eq i64 %298, 0 br i1 %299, label %merge_allocated22, label %check_data21 check_data21: ; preds = %ifcont20 %300 = getelementptr %array.1, %array.1* %279, i32 0, i32 0 %301 = load double*, double** %300, align 8 %302 = ptrtoint double* %301 to i64 %303 = icmp ne i64 %302, 0 br label %merge_allocated22 merge_allocated22: ; preds = %check_data21, %ifcont20 %is_allocated23 = phi i1 [ false, %ifcont20 ], [ %303, %check_data21 ] %304 = xor i1 %is_allocated23, true %305 = or i1 %288, %304 %306 = xor i1 %305, true br i1 %306, label %then24, label %else32 then24: ; preds = %merge_allocated22 %307 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b, align 8 %308 = getelementptr %array.1, %array.1* %307, i32 0, i32 8 %309 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %308, i32 0, i32 0 %310 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %309, i32 0 %311 = getelementptr %dimension_descriptor, %dimension_descriptor* %310, i32 0, i32 0 %312 = load i64, i64* %311, align 8 %313 = getelementptr %dimension_descriptor, %dimension_descriptor* %310, i32 0, i32 1 %314 = load i64, i64* %313, align 8 %315 = add i64 %314, %312 %316 = sub i64 %315, 1 %317 = trunc i64 %316 to i32 store i32 %317, i32* %__do_loop_end1, align 4 %318 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b, align 8 %319 = getelementptr %array.1, %array.1* %318, i32 0, i32 8 %320 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %319, i32 0, i32 0 %321 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %320, i32 0 %322 = getelementptr %dimension_descriptor, %dimension_descriptor* %321, i32 0, i32 0 %323 = load i64, i64* %322, align 8 %324 = trunc i64 %323 to i32 %325 = sub i32 %324, 1 store i32 %325, i32* %__lcompilers_i_0, align 4 br label %loop.head25 loop.head25: ; preds = %ifcont30, %then24 %326 = load i32, i32* %__lcompilers_i_0, align 4 %327 = add i32 %326, 1 %328 = load i32, i32* %__do_loop_end1, align 4 %329 = icmp sle i32 %327, %328 br i1 %329, label %loop.body26, label %loop.end31 loop.body26: ; preds = %loop.head25 %330 = load i32, i32* %__lcompilers_i_0, align 4 %331 = add i32 %330, 1 store i32 %331, i32* %__lcompilers_i_0, align 4 %332 = load i32, i32* %__lcompilers_i_0, align 4 %333 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b, align 8 %334 = getelementptr %array.1, %array.1* %333, i32 0, i32 8 %335 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %334, i32 0, i32 0 %336 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %335, i32 0 %337 = getelementptr %dimension_descriptor, %dimension_descriptor* %336, i32 0, i32 0 %338 = load i64, i64* %337, align 8 %339 = getelementptr %dimension_descriptor, %dimension_descriptor* %336, i32 0, i32 1 %340 = load i64, i64* %339, align 8 %341 = sext i32 %332 to i64 %342 = sub i64 %341, %338 %343 = add i64 %338, %340 %344 = sub i64 %343, 1 %345 = icmp slt i64 %341, %338 %346 = icmp sgt i64 %341, %344 %347 = or i1 %345, %346 br i1 %347, label %then27, label %ifcont28 then27: ; preds = %loop.body26 %348 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %349 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %350 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %349, i32 0, i32 0 %351 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %350, i32 0, i32 0 store i8* getelementptr inbounds ([56 x i8], [56 x i8]* @13, i32 0, i32 0), i8** %351, align 8 %352 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %350, i32 0, i32 1 store i32 5, i32* %352, align 4 %353 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %350, i32 0, i32 2 store i32 8, i32* %353, align 4 %354 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %350, i32 0, i32 3 store i32 5, i32* %354, align 4 %355 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %350, i32 0, i32 4 store i32 14, i32* %355, align 4 %356 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @14, i32 0, i32 0)) %357 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %348, i32 0, i32 0 %358 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %349, i32 0, i32 0 %359 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %357, i32 0, i32 2 %360 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %357, i32 0, i32 0 store i1 true, i1* %360, align 1 %361 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %357, i32 0, i32 1 store i8* %356, i8** %361, align 8 store { i8*, i32, i32, i32, i32 }* %358, { i8*, i32, i32, i32, i32 }** %359, align 8 %362 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %357, i32 0, i32 3 store i32 1, i32* %362, align 4 %363 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %348, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %363, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @12, i32 0, i32 0), i64 %341, i32 1, i64 %338, i64 %344) call void @exit(i32 1) unreachable ifcont28: ; preds = %loop.body26 %364 = getelementptr %dimension_descriptor, %dimension_descriptor* %336, i32 0, i32 2 %365 = load i64, i64* %364, align 8 %366 = mul i64 %365, %342 %367 = add i64 0, %366 %368 = getelementptr %array.1, %array.1* %333, i32 0, i32 7 %369 = load i64, i64* %368, align 8 %370 = add i64 %367, %369 %371 = getelementptr %array.1, %array.1* %333, i32 0, i32 0 %372 = load double*, double** %371, align 8 %373 = getelementptr inbounds double, double* %372, i64 %370 %374 = load i32, i32* %__lcompilers_i_0, align 4 %375 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b1, align 8 %376 = getelementptr %array.1, %array.1* %375, i32 0, i32 8 %377 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %376, i32 0, i32 0 %378 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %377, i32 0 %379 = getelementptr %dimension_descriptor, %dimension_descriptor* %378, i32 0, i32 0 %380 = load i64, i64* %379, align 8 %381 = getelementptr %dimension_descriptor, %dimension_descriptor* %378, i32 0, i32 1 %382 = load i64, i64* %381, align 8 %383 = sext i32 %374 to i64 %384 = sub i64 %383, %380 %385 = add i64 %380, %382 %386 = sub i64 %385, 1 %387 = icmp slt i64 %383, %380 %388 = icmp sgt i64 %383, %386 %389 = or i1 %387, %388 br i1 %389, label %then29, label %ifcont30 then29: ; preds = %ifcont28 %390 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %391 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %392 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %391, i32 0, i32 0 %393 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %392, i32 0, i32 0 store i8* getelementptr inbounds ([56 x i8], [56 x i8]* @17, i32 0, i32 0), i8** %393, align 8 %394 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %392, i32 0, i32 1 store i32 5, i32* %394, align 4 %395 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %392, i32 0, i32 2 store i32 8, i32* %395, align 4 %396 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %392, i32 0, i32 3 store i32 5, i32* %396, align 4 %397 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %392, i32 0, i32 4 store i32 14, i32* %397, align 4 %398 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @18, i32 0, i32 0)) %399 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %390, i32 0, i32 0 %400 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %391, i32 0, i32 0 %401 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %399, i32 0, i32 2 %402 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %399, i32 0, i32 0 store i1 true, i1* %402, align 1 %403 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %399, i32 0, i32 1 store i8* %398, i8** %403, align 8 store { i8*, i32, i32, i32, i32 }* %400, { i8*, i32, i32, i32, i32 }** %401, align 8 %404 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %399, i32 0, i32 3 store i32 1, i32* %404, align 4 %405 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %390, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %405, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @16, i32 0, i32 0), i64 %383, i32 1, i64 %380, i64 %386) call void @exit(i32 1) unreachable ifcont30: ; preds = %ifcont28 %406 = getelementptr %dimension_descriptor, %dimension_descriptor* %378, i32 0, i32 2 %407 = load i64, i64* %406, align 8 %408 = mul i64 %407, %384 %409 = add i64 0, %408 %410 = getelementptr %array.1, %array.1* %375, i32 0, i32 7 %411 = load i64, i64* %410, align 8 %412 = add i64 %409, %411 %413 = getelementptr %array.1, %array.1* %375, i32 0, i32 0 %414 = load double*, double** %413, align 8 %415 = getelementptr inbounds double, double* %414, i64 %412 %416 = load double, double* %415, align 8 store double %416, double* %373, align 8 br label %loop.head25 loop.end31: ; preds = %loop.head25 br label %ifcont33 else32: ; preds = %merge_allocated22 br label %ifcont33 ifcont33: ; preds = %else32, %loop.end31 %417 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b, align 8 %418 = getelementptr %array.1, %array.1* %417, i32 0, i32 8 %419 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %418, i32 0, i32 0 %420 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %419, i32 0 %421 = getelementptr %dimension_descriptor, %dimension_descriptor* %420, i32 0, i32 0 %422 = load i64, i64* %421, align 8 %423 = getelementptr %dimension_descriptor, %dimension_descriptor* %420, i32 0, i32 2 %424 = load i64, i64* %423, align 8 %425 = icmp eq i64 %424, 1 %426 = and i1 true, %425 %427 = getelementptr %dimension_descriptor, %dimension_descriptor* %420, i32 0, i32 0 %428 = load i64, i64* %427, align 8 %429 = getelementptr %dimension_descriptor, %dimension_descriptor* %420, i32 0, i32 1 %430 = load i64, i64* %429, align 8 %431 = add i64 %430, %428 %432 = sub i64 %431, 1 %433 = sub i64 %432, %422 %434 = add i64 %433, 1 %435 = mul i64 1, %434 %436 = ptrtoint %array.1* %417 to i64 %437 = icmp eq i64 %436, 0 br i1 %437, label %merge_allocated35, label %check_data34 check_data34: ; preds = %ifcont33 %438 = getelementptr %array.1, %array.1* %417, i32 0, i32 0 %439 = load double*, double** %438, align 8 %440 = ptrtoint double* %439 to i64 %441 = icmp ne i64 %440, 0 br label %merge_allocated35 merge_allocated35: ; preds = %check_data34, %ifcont33 %is_allocated36 = phi i1 [ false, %ifcont33 ], [ %441, %check_data34 ] %442 = xor i1 %is_allocated36, true %443 = or i1 %426, %442 br i1 %443, label %then37, label %else38 then37: ; preds = %merge_allocated35 %444 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b1, align 8 %445 = getelementptr %array.1, %array.1* %444, i32 0, i32 0 store double* null, double** %445, align 8 br label %ifcont45 else38: ; preds = %merge_allocated35 %446 = load %array.1*, %array.1** %__libasr_created__subroutine_call_b1, align 8 %447 = ptrtoint %array.1* %446 to i64 %448 = icmp eq i64 %447, 0 br i1 %448, label %merge_allocated40, label %check_data39 check_data39: ; preds = %else38 %449 = getelementptr %array.1, %array.1* %446, i32 0, i32 0 %450 = load double*, double** %449, align 8 %451 = ptrtoint double* %450 to i64 %452 = icmp ne i64 %451, 0 br label %merge_allocated40 merge_allocated40: ; preds = %check_data39, %else38 %is_allocated41 = phi i1 [ false, %else38 ], [ %452, %check_data39 ] br i1 %is_allocated41, label %then42, label %else43 then42: ; preds = %merge_allocated40 %453 = getelementptr %array.1, %array.1* %446, i32 0, i32 0 %454 = load double*, double** %453, align 8 %455 = bitcast double* %454 to i8* call void @_lfortran_free_alloc(i8* %0, i8* %455) %456 = getelementptr %array.1, %array.1* %446, i32 0, i32 0 store double* null, double** %456, align 8 br label %ifcont44 else43: ; preds = %merge_allocated40 br label %ifcont44 ifcont44: ; preds = %else43, %then42 br label %ifcont45 ifcont45: ; preds = %ifcont44, %then37 br label %return unreachable_after_return: ; No predecessors! br label %return return: ; preds = %unreachable_after_return, %ifcont45 br label %FINALIZE_SYMTABLE_a FINALIZE_SYMTABLE_a: ; preds = %return ret void } define void @b(double* %con) { .entry: %0 = getelementptr inbounds double, double* %con, i64 3 store double -4.830000e+00, double* %0, align 8 %1 = getelementptr inbounds double, double* %con, i64 2 store double 3.140000e+00, double* %1, align 8 br label %return unreachable_after_return: ; No predecessors! br label %return return: ; preds = %unreachable_after_return, %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return ret void } declare void @_lfortran_free_alloc(i8*, i8*) declare i8* @_lfortran_get_default_allocator() declare i8* @_lcompilers_snprintf_alloc(i8*, i8*, ...) declare void @_lcompilers_runtime_error(i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) declare void @exit(i32) declare i8* @_lfortran_malloc_alloc(i8*, i64) ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 ; Function Attrs: argmemonly nounwind willreturn declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() %array_bound1 = alloca i32, align 4 %array_bound = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %__do_loop_end = alloca i32, align 4 %__libasr_index_0_ = alloca i32, align 4 %w = alloca [5 x double], align 8 br i1 true, label %then, label %else then: ; preds = %.entry store i32 5, i32* %array_bound, align 4 br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %3 = load i32, i32* %array_bound, align 4 store i32 %3, i32* %__do_loop_end, align 4 br i1 true, label %then2, label %else3 then2: ; preds = %ifcont store i32 1, i32* %array_bound1, align 4 br label %ifcont4 else3: ; preds = %ifcont br label %ifcont4 ifcont4: ; preds = %else3, %then2 %4 = load i32, i32* %array_bound1, align 4 %5 = sub i32 %4, 1 store i32 %5, i32* %__libasr_index_0_, align 4 br label %loop.head loop.head: ; preds = %ifcont6, %ifcont4 %6 = load i32, i32* %__libasr_index_0_, align 4 %7 = add i32 %6, 1 %8 = load i32, i32* %__do_loop_end, align 4 %9 = icmp sle i32 %7, %8 br i1 %9, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %10 = load i32, i32* %__libasr_index_0_, align 4 %11 = add i32 %10, 1 store i32 %11, i32* %__libasr_index_0_, align 4 %12 = load i32, i32* %__libasr_index_0_, align 4 %13 = sext i32 %12 to i64 %14 = sub i64 %13, 1 %15 = mul i64 1, %14 %16 = add i64 0, %15 %17 = icmp slt i64 %13, 1 %18 = icmp sgt i64 %13, 5 %19 = or i1 %17, %18 br i1 %19, label %then5, label %ifcont6 then5: ; preds = %loop.body %20 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %21 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %22 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %21, i32 0, i32 0 %23 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %22, i32 0, i32 0 store i8* getelementptr inbounds ([56 x i8], [56 x i8]* @21, i32 0, i32 0), i8** %23, align 8 %24 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %22, i32 0, i32 1 store i32 18, i32* %24, align 4 %25 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %22, i32 0, i32 2 store i32 1, i32* %25, align 4 %26 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %22, i32 0, i32 3 store i32 18, i32* %26, align 4 %27 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %22, i32 0, i32 4 store i32 1, i32* %27, align 4 %28 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @22, i32 0, i32 0)) %29 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %20, i32 0, i32 0 %30 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %21, i32 0, i32 0 %31 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %29, i32 0, i32 2 %32 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %29, i32 0, i32 0 store i1 true, i1* %32, align 1 %33 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %29, i32 0, i32 1 store i8* %28, i8** %33, align 8 store { i8*, i32, i32, i32, i32 }* %30, { i8*, i32, i32, i32, i32 }** %31, align 8 %34 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %29, i32 0, i32 3 store i32 1, i32* %34, align 4 %35 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %20, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %35, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @23, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0), i64 %13, i32 1, i64 1, i64 5) call void @exit(i32 1) unreachable ifcont6: ; preds = %loop.body %36 = getelementptr [5 x double], [5 x double]* %w, i32 0, i64 %16 store double 1.390000e+00, double* %36, align 8 br label %loop.head loop.end: ; preds = %loop.head br i1 false, label %then7, label %ifcont8 then7: ; preds = %loop.end %37 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %38 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %39 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %38, i32 0, i32 0 %40 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %39, i32 0, i32 0 store i8* getelementptr inbounds ([56 x i8], [56 x i8]* @25, i32 0, i32 0), i8** %40, align 8 %41 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %39, i32 0, i32 1 store i32 19, i32* %41, align 4 %42 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %39, i32 0, i32 2 store i32 8, i32* %42, align 4 %43 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %39, i32 0, i32 3 store i32 19, i32* %43, align 4 %44 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %39, i32 0, i32 4 store i32 8, i32* %44, align 4 %45 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @26, i32 0, i32 0)) %46 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %37, i32 0, i32 0 %47 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %38, i32 0, i32 0 %48 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %46, i32 0, i32 2 %49 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %46, i32 0, i32 0 store i1 true, i1* %49, align 1 %50 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %46, i32 0, i32 1 store i8* %45, i8** %50, align 8 store { i8*, i32, i32, i32, i32 }* %47, { i8*, i32, i32, i32, i32 }** %48, align 8 %51 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %46, i32 0, i32 3 store i32 1, i32* %51, align 4 %52 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %37, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %52, i32 1, i8* getelementptr inbounds ([143 x i8], [143 x i8]* @27, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0), i32 5, i32 1, i32 1, i32 5) call void @exit(i32 1) unreachable ifcont8: ; preds = %loop.end %53 = getelementptr [5 x double], [5 x double]* %w, i32 0, i32 0 call void @a(double* %53) %54 = alloca i64, align 8 %55 = getelementptr [5 x double], [5 x double]* %w, i32 0, i32 0 %56 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @serialization_info, i32 0, i32 0), i64* %54, i32 1, i32 0, i32 0, i32 0, i32 0, i64 5, double* %55) %57 = load i64, i64* %54, align 8 %58 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %56, i8** %58, align 8 %59 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %57, i64* %59, align 8 %60 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %61 = load i8*, i8** %60, align 8 %62 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %63 = load i64, i64* %62, align 8 %64 = trunc i64 %63 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @29, i32 0, i32 0), i8* %61, i32 %64, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @28, i32 0, i32 0), i32 1) %65 = icmp eq i8* %56, null br i1 %65, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont8 call void @_lfortran_free_alloc(i8* %2, i8* %56) br label %free_done free_done: ; preds = %free_nonnull, %ifcont8 br i1 false, label %then9, label %ifcont10 then9: ; preds = %free_done %66 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %67 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %68 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %67, i32 0, i32 0 %69 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %68, i32 0, i32 0 store i8* getelementptr inbounds ([56 x i8], [56 x i8]* @31, i32 0, i32 0), i8** %69, align 8 %70 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %68, i32 0, i32 1 store i32 21, i32* %70, align 4 %71 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %68, i32 0, i32 2 store i32 9, i32* %71, align 4 %72 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %68, i32 0, i32 3 store i32 21, i32* %72, align 4 %73 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %68, i32 0, i32 4 store i32 12, i32* %73, align 4 %74 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @32, i32 0, i32 0)) %75 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %66, i32 0, i32 0 %76 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %67, i32 0, i32 0 %77 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %75, i32 0, i32 2 %78 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %75, i32 0, i32 0 store i1 true, i1* %78, align 1 %79 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %75, i32 0, i32 1 store i8* %74, i8** %79, align 8 store { i8*, i32, i32, i32, i32 }* %76, { i8*, i32, i32, i32, i32 }** %77, align 8 %80 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %75, i32 0, i32 3 store i32 1, i32* %80, align 4 %81 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %66, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %81, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @33, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0), i64 5, i32 1, i64 1, i64 5) call void @exit(i32 1) unreachable ifcont10: ; preds = %free_done %82 = getelementptr [5 x double], [5 x double]* %w, i32 0, i64 4 %83 = load double, double* %82, align 8 %84 = fsub double %83, -4.830000e+00 %85 = call double @llvm.fabs.f64(double %84) %86 = fcmp ogt double %85, 1.000000e-08 br i1 %86, label %then11, label %else12 then11: ; preds = %ifcont10 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @35, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @34, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont13 else12: ; preds = %ifcont10 br label %ifcont13 ifcont13: ; preds = %else12, %then11 br i1 false, label %then14, label %ifcont15 then14: ; preds = %ifcont13 %87 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %88 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %89 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %88, i32 0, i32 0 %90 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %89, i32 0, i32 0 store i8* getelementptr inbounds ([56 x i8], [56 x i8]* @37, i32 0, i32 0), i8** %90, align 8 %91 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %89, i32 0, i32 1 store i32 22, i32* %91, align 4 %92 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %89, i32 0, i32 2 store i32 9, i32* %92, align 4 %93 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %89, i32 0, i32 3 store i32 22, i32* %93, align 4 %94 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %89, i32 0, i32 4 store i32 12, i32* %94, align 4 %95 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @38, i32 0, i32 0)) %96 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %87, i32 0, i32 0 %97 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %88, i32 0, i32 0 %98 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %96, i32 0, i32 2 %99 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %96, i32 0, i32 0 store i1 true, i1* %99, align 1 %100 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %96, i32 0, i32 1 store i8* %95, i8** %100, align 8 store { i8*, i32, i32, i32, i32 }* %97, { i8*, i32, i32, i32, i32 }** %98, align 8 %101 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %96, i32 0, i32 3 store i32 1, i32* %101, align 4 %102 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %87, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %102, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @39, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0), i64 4, i32 1, i64 1, i64 5) call void @exit(i32 1) unreachable ifcont15: ; preds = %ifcont13 %103 = getelementptr [5 x double], [5 x double]* %w, i32 0, i64 3 %104 = load double, double* %103, align 8 %105 = fsub double %104, 3.140000e+00 %106 = call double @llvm.fabs.f64(double %105) %107 = fcmp ogt double %106, 1.000000e-10 br i1 %107, label %then16, label %else17 then16: ; preds = %ifcont15 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @40, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont18 else17: ; preds = %ifcont15 br label %ifcont18 ifcont18: ; preds = %else17, %then16 br label %return return: ; preds = %ifcont18 br label %FINALIZE_SYMTABLE_legacy_array_sections_01 FINALIZE_SYMTABLE_legacy_array_sections_01: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) ; Function Attrs: nounwind readnone speculatable willreturn declare double @llvm.fabs.f64(double) #2 declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() attributes #0 = { argmemonly nounwind willreturn writeonly } attributes #1 = { argmemonly nounwind willreturn } attributes #2 = { nounwind readnone speculatable willreturn } lfortran-0.63.0/tests/reference/asr-arrays_01_real-6cb0873.json0000664000175000017500000000076415174404631024203 0ustar alastairalastair{ "basename": "asr-arrays_01_real-6cb0873", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01_real.f90", "infile_hash": "52d4b470c5523650dead5fa570d62db7293b9ecd23758e3cc4ba28c2", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_01_real-6cb0873.stdout", "stdout_hash": "98387c0d9d336721f010c0635e2b544664ee9ae2aaa1588b6ba97443", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-conv_complex2real-0c17eca.json0000664000175000017500000000077515174404631025152 0ustar alastairalastair{ "basename": "asr-conv_complex2real-0c17eca", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/conv_complex2real.f90", "infile_hash": "45bd43af8695005b07db0e167445c8230cda8e3201e8ce644bf187d2", "outfile": null, "outfile_hash": null, "stdout": "asr-conv_complex2real-0c17eca.stdout", "stdout_hash": "6d4d1cdef0badf001ac1fb5642bdd8185c70aa4f372acb57dfc30705", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-if_05-2102585.json0000664000175000017500000000072215174404631022444 0ustar alastairalastair{ "basename": "julia-if_05-2102585", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/if_05.f90", "infile_hash": "e17354307d88b9239319cbfd5ce6b117fd24e4aa2998deee3d8fe695", "outfile": null, "outfile_hash": null, "stdout": "julia-if_05-2102585.stdout", "stdout_hash": "151c316fb5a19a14af5cced2a16b9efd1a65d8c4742084a5fe56fd9e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-case_01-09dad75.json0000664000175000017500000000074215174404631023054 0ustar alastairalastair{ "basename": "llvm-case_01-09dad75", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/case_01.f90", "infile_hash": "003a23367180e7f228e7e4ef5a6dfdb6749801b29ccf2002e2559e41", "outfile": null, "outfile_hash": null, "stdout": "llvm-case_01-09dad75.stdout", "stdout_hash": "611707f103a6b5fa9c7976c067bf0ea70c20155407837ad317b428e0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/rename_symbol-collect_occurence3-3737d89.json0000664000175000017500000000100415174404631027124 0ustar alastairalastair{ "basename": "rename_symbol-collect_occurence3-3737d89", "cmd": "lfortran --rename-symbol --no-color {infile} -o {outfile}", "infile": "tests/collect_occurence3.f90", "infile_hash": "64f44de76cd08c4e21e4f8e05bb2747574f998c95bcdb8d474c8c449", "outfile": null, "outfile_hash": null, "stdout": "rename_symbol-collect_occurence3-3737d89.stdout", "stdout_hash": "b3cdfcbdc16ad191eb06741f5a164c0b42530c8417c91b08ba740c03", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_vector-140858c.stdout0000664000175000017500000033004615174404631025064 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_vector: (Program (SymbolTable 11 { main: (ExternalSymbol 11 main 2 main template_vector_m [] main Public ), vector_t: (ExternalSymbol 11 vector_t 2 vector_t template_vector_m [] vector_t Public ) }) template_vector [template_vector_m] [(SubroutineCall 11 main () [] () .false. )] ), template_vector_m: (Module (SymbolTable 2 { main: (Function (SymbolTable 7 { 1_intvector___asr_push_back: (ExternalSymbol 7 1_intvector___asr_push_back 8 push_back intvector [] push_back Public ), 1_intvector_elements: (ExternalSymbol 7 1_intvector_elements 8 elements intvector [] elements Public ), __asr_push_back: (Function (SymbolTable 9 { 1_intvector_elements: (ExternalSymbol 9 1_intvector_elements 8 elements intvector [] elements Public ), 1_intvector_resize: (ExternalSymbol 9 1_intvector_resize 8 resize intvector [] resize Public ), 1_intvector_sz: (ExternalSymbol 9 1_intvector_sz 8 sz intvector [] sz Public ), item: (Variable 9 item [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), new_size: (Variable 9 new_size [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), this: (Variable 9 this [] In () () Default (StructType [] [] .false. .false. ) 7 intvector Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __asr_push_back (FunctionType [(StructType [] [] .false. .false. ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 this) (Var 9 item)] [(Assignment (Var 9 new_size) (IntegerBinOp (StructInstanceMember (Var 9 this) 9 1_intvector_sz (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 9 1_intvector_resize () [((Var 9 this)) ((Var 9 new_size))] (Var 9 this) .false. ) (Assignment (ArrayItem (StructInstanceMember (Var 9 this) 9 1_intvector_elements (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) [(() (Var 9 new_size) ())] (Integer 4) ColMajor () ) (Var 9 item) () .false. .false. ) (Assignment (StructInstanceMember (Var 9 this) 9 1_intvector_sz (Integer 4) () ) (Var 9 new_size) () .false. .false. )] () Private .true. .true. () ), __asr_resize: (Function (SymbolTable 10 { 1_intvector_elements: (ExternalSymbol 10 1_intvector_elements 8 elements intvector [] elements Public ), 1_intvector_sz: (ExternalSymbol 10 1_intvector_sz 8 sz intvector [] sz Public ), i: (Variable 10 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 10 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), this: (Variable 10 this [] InOut () () Default (StructType [] [] .false. .false. ) 7 intvector Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 10 tmp [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __asr_resize (FunctionType [(StructType [] [] .false. .false. ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 this) (Var 10 n)] [(If () (LogicalNot (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 10 this) 10 1_intvector_elements (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () )] 0 (Logical 4) () ) (Logical 4) () ) [(Allocate [((StructInstanceMember (Var 10 this) 10 1_intvector_elements (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 10 n))] () () ())] () () () ) (Return)] [] ) (If () (IntegerCompare (StructInstanceMember (Var 10 this) 10 1_intvector_sz (Integer 4) () ) GtE (Var 10 n) (Logical 4) () ) [(Return)] [] ) (Allocate [((Var 10 tmp) [((IntegerConstant 1 (Integer 4) Decimal) (StructInstanceMember (Var 10 this) 10 1_intvector_sz (Integer 4) () ))] () () ())] () () () ) (DoLoop () ((Var 10 i) (IntegerConstant 1 (Integer 4) Decimal) (StructInstanceMember (Var 10 this) 10 1_intvector_sz (Integer 4) () ) ()) [(Assignment (ArrayItem (Var 10 tmp) [(() (Var 10 i) ())] (Integer 4) ColMajor () ) (ArrayItem (StructInstanceMember (Var 10 this) 10 1_intvector_elements (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) [(() (Var 10 i) ())] (Integer 4) ColMajor () ) () .false. .false. )] [] ) (Allocate [((StructInstanceMember (Var 10 this) 10 1_intvector_elements (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 10 n))] () () ())] () () () ) (Assignment (ArraySection (StructInstanceMember (Var 10 this) 10 1_intvector_elements (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (StructInstanceMember (Var 10 this) 10 1_intvector_sz (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal))] (Array (Integer 4) [(() ())] DescriptorArray ) () ) (Var 10 tmp) () .false. .false. )] () Private .true. .true. () ), intvector: (Struct (SymbolTable 8 { elements: (Variable 8 elements [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), push_back: (StructMethodDeclaration 8 push_back () __asr_push_back 7 __asr_push_back Source .false. .false. ), resize: (StructMethodDeclaration 8 resize () __asr_resize 7 __asr_resize Source .false. .false. ), sz: (Variable 8 sz [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intvector (StructType [] [] .true. .false. ) [] [elements sz] [] Source Private .false. .false. [] () () [] ), v: (Variable 7 v [] Local () () Default (StructType [] [] .true. .false. ) 7 intvector Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(SubroutineCall 7 1_intvector___asr_push_back () [((Var 7 v)) ((IntegerConstant 10 (Integer 4) Decimal))] (Var 7 v) .false. ) (If () (IntegerCompare (ArrayItem (StructInstanceMember (Var 7 v) 7 1_intvector_elements (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] () Public .true. .true. () ), vector_t: (Template (SymbolTable 3 { push_back: (Function (SymbolTable 5 { 1_vector_elements: (ExternalSymbol 5 1_vector_elements 4 elements vector [] elements Public ), 1_vector_resize: (ExternalSymbol 5 1_vector_resize 4 resize vector [] resize Public ), 1_vector_sz: (ExternalSymbol 5 1_vector_sz 4 sz vector [] sz Public ), item: (Variable 5 item [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), new_size: (Variable 5 new_size [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), this: (Variable 5 this [] In () () Default (StructType [(Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) (Integer 4)] [] .false. .false. ) 3 vector Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) push_back (FunctionType [(StructType [(Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) (Integer 4)] [] .false. .false. ) (TypeParameter t )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 this) (Var 5 item)] [(Assignment (Var 5 new_size) (IntegerBinOp (StructInstanceMember (Var 5 this) 5 1_vector_sz (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 5 1_vector_resize () [((Var 5 this)) ((Var 5 new_size))] (Var 5 this) .false. ) (Assignment (ArrayItem (StructInstanceMember (Var 5 this) 5 1_vector_elements (Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) () ) [(() (Var 5 new_size) ())] (TypeParameter t ) ColMajor () ) (Var 5 item) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 this) 5 1_vector_sz (Integer 4) () ) (Var 5 new_size) () .false. .false. )] () Private .true. .true. () ), resize: (Function (SymbolTable 6 { 1_vector_elements: (ExternalSymbol 6 1_vector_elements 4 elements vector [] elements Public ), 1_vector_sz: (ExternalSymbol 6 1_vector_sz 4 sz vector [] sz Public ), i: (Variable 6 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 6 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), this: (Variable 6 this [] InOut () () Default (StructType [(Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) (Integer 4)] [] .false. .false. ) 3 vector Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 6 tmp [] Local () () Default (Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) resize (FunctionType [(StructType [(Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) (Integer 4)] [] .false. .false. ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 this) (Var 6 n)] [(If () (LogicalNot (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 6 this) 6 1_vector_elements (Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) () )] 0 (Logical 4) () ) (Logical 4) () ) [(Allocate [((StructInstanceMember (Var 6 this) 6 1_vector_elements (Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n))] () () ())] () () () ) (Return)] [] ) (If () (IntegerCompare (StructInstanceMember (Var 6 this) 6 1_vector_sz (Integer 4) () ) GtE (Var 6 n) (Logical 4) () ) [(Return)] [] ) (Allocate [((Var 6 tmp) [((IntegerConstant 1 (Integer 4) Decimal) (StructInstanceMember (Var 6 this) 6 1_vector_sz (Integer 4) () ))] () () ())] () () () ) (DoLoop () ((Var 6 i) (IntegerConstant 1 (Integer 4) Decimal) (StructInstanceMember (Var 6 this) 6 1_vector_sz (Integer 4) () ) ()) [(Assignment (ArrayItem (Var 6 tmp) [(() (Var 6 i) ())] (TypeParameter t ) ColMajor () ) (ArrayItem (StructInstanceMember (Var 6 this) 6 1_vector_elements (Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) () ) [(() (Var 6 i) ())] (TypeParameter t ) ColMajor () ) () .false. .false. )] [] ) (Allocate [((StructInstanceMember (Var 6 this) 6 1_vector_elements (Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n))] () () ())] () () () ) (Assignment (ArraySection (StructInstanceMember (Var 6 this) 6 1_vector_elements (Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (StructInstanceMember (Var 6 this) 6 1_vector_sz (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal))] (Array (TypeParameter t ) [(() ())] DescriptorArray ) () ) (Var 6 tmp) () .false. .false. )] () Private .true. .true. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), vector: (Struct (SymbolTable 4 { elements: (Variable 4 elements [] Local () () Default (Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), push_back: (StructMethodDeclaration 4 push_back () push_back 3 push_back Source .false. .false. ), resize: (StructMethodDeclaration 4 resize () resize 3 resize Source .false. .false. ), sz: (Variable 4 sz [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) vector (StructType [(Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) (Integer 4)] [] .true. .false. ) [] [elements sz] [] Source Private .false. .false. [] () () [] ) }) vector_t [t] [] ) }) template_vector_m () [template_vector_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-implicit_interface5-fbe2fe9.stdout0000664000175000017500000002517315174404631026116 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { implicit_interface5: (Function (SymbolTable 2 { a: (Variable 2 a [n] In () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [n] In () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), driver: (Function (SymbolTable 3 { driver_arg_0: (Variable 3 driver_arg_0 [] Unspecified () () Default (Array (Integer 4) [(() ())] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), driver_arg_1: (Variable 3 driver_arg_1 [] Unspecified () () Default (Array (Integer 4) [(() ())] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) driver (FunctionType [(Array (Integer 4) [(() ())] PointerArray ) (Array (Integer 4) [(() ())] PointerArray )] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 driver_arg_0) (Var 3 driver_arg_1)] [] () Public .false. .false. () ), n: (Variable 2 n [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) implicit_interface5 (FunctionType [(Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 a) (Var 2 b) (Var 2 n)] [(SubroutineCall 2 driver () [((Var 2 a)) ((Var 2 b))] () .false. )] () Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/llvm-class_02-82c2f9c.json0000664000175000017500000000106515174404631023251 0ustar alastairalastair{ "basename": "llvm-class_02-82c2f9c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/class_02.f90", "infile_hash": "d9600a16766ae051943b344e946afd7523b8f9d66250d6cd908135cc", "outfile": null, "outfile_hash": null, "stdout": "llvm-class_02-82c2f9c.stdout", "stdout_hash": "e7c60a6f51ea9e8193c3164ef47e5ce1f9c09407e2f0f5b48315cb24", "stderr": "llvm-class_02-82c2f9c.stderr", "stderr_hash": "cbe4c6f9d712b9d5ee417de42e2ce3b69d43ea5a0b463256ad71acfe", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-loop_test1-716ccb0.stdout0000664000175000017500000001667015174404631024115 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { do330i: (Variable 2 do330i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), kp: (Variable 2 kp [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main [] [(Assignment (Var 2 kp) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 kp) ()) [(DoLoop () ((Var 2 j) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Var 2 kp) ()) [(If () (IntegerCompare (IntegerConstant 0 (Integer 4) Decimal) Gt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringFormat () [(Var 2 i) (Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [(Print (StringFormat () [(Var 2 j) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) (GoToTarget 320 320 )] [] ) (GoToTarget 330 330 )] [] ) (Assignment (Var 2 do330i) (IntegerConstant 15 (Integer 4) Decimal) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-select_type1-767380c.json0000664000175000017500000000074415174404631024403 0ustar alastairalastair{ "basename": "ast_f90-select_type1-767380c", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/select_type1.f90", "infile_hash": "0484f169388676238c1bdf4ae9e9041b66ca05da7dc95a32c57a6003", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-select_type1-767380c.stdout", "stdout_hash": "7a06481b29b61eb38f12a018d320bf35f47ff7cf3624a9b23b1f2bdf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-close1-d682580.json0000664000175000017500000000070715174404631022510 0ustar alastairalastair{ "basename": "ast-close1-d682580", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/close1.f90", "infile_hash": "b6174b7e66a7b9dea6c59e0e40b1786dc0721bf2b248b292f3576c9c", "outfile": null, "outfile_hash": null, "stdout": "ast-close1-d682580.stdout", "stdout_hash": "df91f2f167a94a06284e0716e9ffb3c54cbc28b3ca4059cfb59ecbcf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit11-95f56fd.stderr0000664000175000017500000000053715174404631023777 0ustar alastairalastairstyle suggestion: Use complex(8) instead of complex*16 --> tests/implicit11.f90:2:17 | 2 | implicit complex*16 (z,i) | ^ help: write this as 'complex(8)' style suggestion: Use complex(8) instead of complex*16 --> tests/implicit11.f90:8:17 | 8 | implicit complex*16 (z,i) | ^ help: write this as 'complex(8)' lfortran-0.63.0/tests/reference/llvm-program1-29eca93.stdout0000664000175000017500000001044015174404631023740 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 store i32 5, i32* %i, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %i) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry %14 = alloca i64, align 8 %15 = load i32, i32* %i, align 4 %16 = add i32 %15, 1 %17 = alloca i32, align 4 store i32 %16, i32* %17, align 4 %18 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %14, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %17) %19 = load i64, i64* %14, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %18, i8** %20, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %19, i64* %21, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %23 = load i8*, i8** %22, align 8 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %25 = load i64, i64* %24, align 8 %26 = trunc i64 %25 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %23, i32 %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %27 = icmp eq i8* %18, null br i1 %27, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %2, i8* %18) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done br label %return return: ; preds = %free_done3 br label %FINALIZE_SYMTABLE_program1 FINALIZE_SYMTABLE_program1: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/ast-assign_to1-09e061a.json0000664000175000017500000000075015174404631023434 0ustar alastairalastair{ "basename": "ast-assign_to1-09e061a", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/assign_to1.f90", "infile_hash": "a8a83c753ee6f6e22b44441dbf0e5d8e7f180ca811bcbe45e810b869", "outfile": null, "outfile_hash": null, "stdout": "ast-assign_to1-09e061a.stdout", "stdout_hash": "28352d183ead36b8ad9ad210d30041867d24b98f61f5b89f0813f6ad", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-matrix_matmul_03-a99cdd1.stderr0000664000175000017500000000026415174404631025253 0ustar alastairalastairsemantic error: The `matmul` intrinsic doesn't handle logical type yet --> tests/errors/matrix_matmul_03.f90:5:14 | 5 | print *, matmul(a, b) | ^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-comments1-213c55a.json0000664000175000017500000000072015174404631023266 0ustar alastairalastair{ "basename": "ast-comments1-213c55a", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/comments1.f90", "infile_hash": "54490aafe8914e1e15517fbb3754ffa3d631fb2fd2241926a46aa79b", "outfile": null, "outfile_hash": null, "stdout": "ast-comments1-213c55a.stdout", "stdout_hash": "fcd83d753eb4d636130d6b1abe182f6aa5111fb30764419c1ad210e0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor5-fdb91a5.stdout0000664000175000017500000000473615174404631027172 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor5: (Program (SymbolTable 2 { }) preprocessor5 [] [(Print (StringFormat () [(IntegerConstant 1 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntegerConstant 12 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntegerConstant 3 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntegerConstant 6 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntegerConstant 15 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-parameter_01-746df62.stdout0000664000175000017500000000257415174404631024241 0ustar alastairalastair(TranslationUnit [(Program parameter_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ()) (k [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrParameter )] [(i [] [] () 1 Equal ())] () ) (Declaration () [(SimpleAttribute AttrParameter )] [(j [] [] () 2 Equal ()) (k [] [] () 3 Equal ())] () )] [(Print 0 () [i j k] () )] [] )] ) lfortran-0.63.0/tests/reference/llvm-arrays_01-91893af.json0000664000175000017500000000075015174404631023370 0ustar alastairalastair{ "basename": "llvm-arrays_01-91893af", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01.f90", "infile_hash": "f7df4142feb383f836dfa072a60673922e8873b5695f893be8329b89", "outfile": null, "outfile_hash": null, "stdout": "llvm-arrays_01-91893af.stdout", "stdout_hash": "59f5874dafb34f289bf6e87b5d87aaa547e059d167903900e0b6edb2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_global_stmts-global_scope2-64078e2.json0000664000175000017500000000101415174404631026755 0ustar alastairalastair{ "basename": "pass_global_stmts-global_scope2-64078e2", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope2.f90", "infile_hash": "e511f118b9a040b5e7a3ff2ad75cd7942dee08d3a21bd4ca5cd668b3", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope2-64078e2.stdout", "stdout_hash": "4275c4070b4d2ff4dd5339752c5e5a517cbb703195a8fb5219d29c25", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_12-ff7ce44.stdout0000664000175000017500000001453215174404631024603 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_12: (Program (SymbolTable 2 { }) intrinsics_12 [] [(Print (StringFormat () [(TypeInquiry Kind (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(TypeInquiry Kind (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(TypeInquiry Kind (Integer 8) (IntegerConstant 5 (Integer 8) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(TypeInquiry Kind (Real 4) (RealConstant 0.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(TypeInquiry Kind (Real 4) (RealConstant 5.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(TypeInquiry Kind (Real 8) (RealConstant 5.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(TypeInquiry Kind (Logical 4) (LogicalConstant .true. (Logical 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-recursion_02-20a7daf.stdout0000664000175000017500000010246515174404631024413 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 7 { r: (Variable 7 r [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), solver: (ExternalSymbol 7 solver 2 solver recursion_02 [] solver Public ), sub1: (ExternalSymbol 7 sub1 2 sub1 recursion_02 [] sub1 Public ) }) main [recursion_02] [(Assignment (Var 7 r) (FunctionCall 7 sub1 () [((IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 3 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "r =" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 7 r)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), recursion_02: (Module (SymbolTable 2 { solver: (Function (SymbolTable 3 { f: (Function (SymbolTable 4 { f: (Variable 4 f [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] (Integer 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 4 f) Public .false. .false. () ), f_val: (Variable 3 f_val [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iter: (Variable 3 iter [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), solver: (Variable 3 solver [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) solver (FunctionType [(FunctionType [] (Integer 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [sub1] [(Var 3 f) (Var 3 iter)] [(Assignment (Var 3 f_val) (FunctionCall 3 f () [] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "before:" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 3 f_val)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 3 solver) (FunctionCall 2 sub1 () [((IntegerConstant 2 (Integer 4) Decimal)) ((IntegerBinOp (Var 3 iter) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 3 f_val) (FunctionCall 3 f () [] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "after:" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 3 f_val)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] (Var 3 solver) Public .false. .false. () ), sub1: (Function (SymbolTable 5 { getx: (Function (SymbolTable 6 { getx: (Variable 6 getx [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) getx (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(StringConstant "x in getx" (String 1 (IntegerConstant 9 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 5 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 6 getx) (Var 5 x) () .false. .false. )] (Var 6 getx) Public .false. .false. () ), iter: (Variable 5 iter [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sub1: (Variable 5 sub1 [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 5 tmp [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 5 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 5 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub1 (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [solver] [(Var 5 y) (Var 5 iter)] [(Assignment (Var 5 x) (Var 5 y) () .false. .false. ) (Print (StringConstant "in sub1" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (IntegerCompare (Var 5 iter) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 5 sub1) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Return)] [] ) (Assignment (Var 5 tmp) (FunctionCall 5 getx () [] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 5 sub1) (FunctionCall 2 solver () [((Var 5 getx)) ((Var 5 iter))] (Integer 4) () () ) () .false. .false. )] (Var 5 sub1) Public .false. .false. () ) }) recursion_02 () [recursion_02] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-intrinsics_11-13a7587.stdout0000664000175000017500000000645215174404631024361 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_11: (Program (SymbolTable 2 { x: (Variable 2 x [] Local (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [x] Local (IntrinsicElementalFunction Real [(Var 2 x)] 0 (Real 4) (RealConstant 3.000000 (Real 4) ) ) (RealConstant 3.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_11 [] [(Print (StringFormat () [(Var 2 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-save1-7ce7ccf.stderr0000664000175000017500000000173115174404631023170 0ustar alastairalastairwarning: Assuming implicit save attribute for variable declaration --> tests/save1.f90:2:13 | 2 | real :: x = 5, z | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement warning: Assuming implicit save attribute for variable declaration --> tests/save1.f90:8:13 | 8 | real :: x = 5, z | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement warning: Assuming implicit save attribute for variable declaration --> tests/save1.f90:20:17 | 20 | real :: x = 5, z | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement warning: Assuming implicit save attribute for variable declaration --> tests/save1.f90:26:17 | 26 | real :: x = 5, z | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement lfortran-0.63.0/tests/reference/asr-kind_string_of_int-ed0ec70.json0000664000175000017500000000076215174404631025401 0ustar alastairalastair{ "basename": "asr-kind_string_of_int-ed0ec70", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_string_of_int.f90", "infile_hash": "89b2b88221d506d791bc4b592e7d73c1c2eebad1b47a0bcd8a388ba0", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_string_of_int-ed0ec70.stderr", "stderr_hash": "e7ad0c7055b862d2b628dbd827b39cac77dd6f3ef39025b02ff6a5fc", "returncode": 2 }lfortran-0.63.0/tests/reference/pass_array_op-arrays_op_10-be689f7.stdout0000664000175000017500000004170715174404631026424 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { compare_solutions: (Function (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) compare_solutions (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [solution] [] [(Print (StringFormat () [(ArraySize (FunctionCall 2 solution () [] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () () ) () (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionCall 2 solution () [] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () () ) () (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) ()) [(Assignment (ArrayItem (Var 3 x) [(() (Var 3 i) ())] (Real 4) ColMajor () ) (Cast (Var 3 i) IntegerToReal (Real 4) () () ) () .false. .false. )] [] ) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(Print (StringFormat () [(ArrayItem (Var 3 x) [(() (Var 3 i) ())] (Real 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (ArrayItem (Var 3 x) [(() (Var 3 i) ())] (Real 4) ColMajor () ) NotEq (Cast (Var 3 i) IntegerToReal (Real 4) () () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] () Public .false. .false. () ), solution: (Function (SymbolTable 4 { x: (Variable 4 x [] ReturnVar () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) solution (FunctionType [] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [] [(Assignment (ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 4 x) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 1.000000 (Real 4) ) () .false. .false. )] (Var 4 x) Public .true. .true. () ) }) main [] [(SubroutineCall 2 compare_solutions () [] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor9-641e112.stdout0000664000175000017500000001253715174404631026744 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor9: (Program (SymbolTable 2 { }) preprocessor9 [] [(Print (StringFormat () [(IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 6 (Integer 4) Decimal) ) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) ) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 15 (Integer 4) Decimal) ) Add (IntegerConstant 6 (Integer 4) Decimal) (Integer 4) (IntegerConstant 21 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 6 (Integer 4) Decimal) ) Add (IntegerBinOp (IntegerConstant 4 (Integer 4) Decimal) Mul (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (Integer 4) (IntegerConstant 12 (Integer 4) Decimal) ) (Integer 4) (IntegerConstant 18 (Integer 4) Decimal) ) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 23 (Integer 4) Decimal) ) Add (IntegerConstant 6 (Integer 4) Decimal) (Integer 4) (IntegerConstant 29 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/julia-doloop_02-13efa8f.stdout0000664000175000017500000000126015174404631024215 0ustar alastairalastairfunction main() local a::Int32 local b::Int32 local i::Int32 local j::Int32 j = 0 a = 1 b = 10 for i ∈ a:b j = j + i end if j ≠ 55 println(Base.stderr, "ERROR STOP") exit(1) end println(j) a = 0 for i ∈ 1:10 for j ∈ 1:10 a = a + (i - 1) * 10 + j end end if a ≠ 100 * 101 ÷ 2 println(Base.stderr, "ERROR STOP") exit(1) end println(a) a = 0 for i ∈ 1:10 for j ∈ 1:i a = a + j end end if a ≠ 220 println(Base.stderr, "ERROR STOP") exit(1) end println(a) end main() lfortran-0.63.0/tests/reference/asr-template_lapack_01-0d30f43.stdout0000664000175000017500000143427315174404631025374 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_lapack_01: (Program (SymbolTable 23 { cast_r: (ExternalSymbol 23 cast_r 2 cast_r template_lapack_01_m [] cast_r Public ), external_matmul_t: (ExternalSymbol 23 external_matmul_t 2 external_matmul_t template_lapack_01_m [] external_matmul_t Public ), gemm_r: (ExternalSymbol 23 gemm_r 2 gemm_r template_lapack_01_m [] gemm_r Public ), simple_external_matmul: (ExternalSymbol 23 simple_external_matmul 2 simple_external_matmul template_lapack_01_m [] simple_external_matmul Public ), test_template: (ExternalSymbol 23 test_template 2 test_template template_lapack_01_m [] test_template Public ) }) template_lapack_01 [template_lapack_01_m] [(SubroutineCall 23 test_template () [] () .false. )] ), template_lapack_01_m: (Module (SymbolTable 2 { cast_r: (Requirement (SymbolTable 5 { cast: (Function (SymbolTable 6 { arg: (Variable 6 arg [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 6 res [] ReturnVar () () Default (TypeParameter u ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast (FunctionType [(TypeParameter t )] (TypeParameter u ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 6 arg)] [] (Var 6 res) Private .true. .true. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u: (Variable 5 u [] In () () Default (TypeParameter u ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast_r [t u cast] [] ), external_matmul_t: (Template (SymbolTable 7 { cast_to_t: (Function (SymbolTable 9 { arg: (Variable 9 arg [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 9 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast_to_t (FunctionType [(Real 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 9 arg)] [] (Var 9 res) Private .true. .true. () ), gemm: (Function (SymbolTable 8 { a: (Variable 8 a [lda] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 8 lda)) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), alpha: (Variable 8 alpha [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 8 b [ldb] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 8 ldb)) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), beta: (Variable 8 beta [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 8 c [ldc] Out () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 8 ldc)) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 8 k [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lda: (Variable 8 lda [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ldb: (Variable 8 ldb [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ldc: (Variable 8 ldc [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 8 m [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 8 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), transa: (Variable 8 transa [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), transb: (Variable 8 transb [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gemm (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (Integer 4) (Integer 4) (Integer 4) (TypeParameter t ) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 7 (Integer 4) () )) (() ())] DescriptorArray ) (Integer 4) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 9 (Integer 4) () )) (() ())] DescriptorArray ) (Integer 4) (TypeParameter t ) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 12 (Integer 4) () )) (() ())] DescriptorArray ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 8 transa) (Var 8 transb) (Var 8 m) (Var 8 n) (Var 8 k) (Var 8 alpha) (Var 8 a) (Var 8 lda) (Var 8 b) (Var 8 ldb) (Var 8 beta) (Var 8 c) (Var 8 ldc)] [] () Private .true. .true. () ), nonsimple_external_matmul: (Function (SymbolTable 10 { a: (Variable 10 a [] In () () Default (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 10 b [] In () () Default (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 10 c [a b] ReturnVar () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 10 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 10 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 10 k [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 10 m [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 10 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) nonsimple_external_matmul (FunctionType [(Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray )] (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 0 (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 1 (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [cast_to_t gemm] [(Var 10 a) (Var 10 b)] [(Assignment (Var 10 m) (ArraySize (Var 10 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 10 n) (ArraySize (Var 10 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 10 k) (ArraySize (Var 10 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 7 gemm () [((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((Var 10 m)) ((Var 10 n)) ((Var 10 k)) ((FunctionCall 7 cast_to_t () [((RealConstant 1.000000 (Real 4) ))] (TypeParameter t ) () () )) ((ArrayPhysicalCast (Var 10 a) DescriptorArray DescriptorArray (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () )) ((Var 10 m)) ((ArrayPhysicalCast (Var 10 b) DescriptorArray DescriptorArray (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () )) ((Var 10 k)) ((FunctionCall 7 cast_to_t () [((RealConstant 0.000000 (Real 4) ))] (TypeParameter t ) () () )) ((ArrayPhysicalCast (Var 10 c) PointerArray DescriptorArray (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 10 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 10 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] DescriptorArray ) () )) ((Var 10 m))] () .false. )] (Var 10 c) Private .true. .true. () ), real: (Variable 7 real [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 7 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) external_matmul_t [t gemm cast_to_t] [(Require gemm_r [t gemm] ) (Require cast_r [real t cast_to_t] )] ), gemm_r: (Requirement (SymbolTable 3 { gemm: (Function (SymbolTable 4 { a: (Variable 4 a [lda] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 4 lda)) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), alpha: (Variable 4 alpha [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [ldb] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 4 ldb)) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), beta: (Variable 4 beta [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 4 c [ldc] Out () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 4 ldc)) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 4 k [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lda: (Variable 4 lda [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ldb: (Variable 4 ldb [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ldc: (Variable 4 ldc [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 4 m [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 4 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), transa: (Variable 4 transa [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), transb: (Variable 4 transb [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gemm (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (Integer 4) (Integer 4) (Integer 4) (TypeParameter t ) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 7 (Integer 4) () )) (() ())] DescriptorArray ) (Integer 4) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 9 (Integer 4) () )) (() ())] DescriptorArray ) (Integer 4) (TypeParameter t ) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 12 (Integer 4) () )) (() ())] DescriptorArray ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 transa) (Var 4 transb) (Var 4 m) (Var 4 n) (Var 4 k) (Var 4 alpha) (Var 4 a) (Var 4 lda) (Var 4 b) (Var 4 ldb) (Var 4 beta) (Var 4 c) (Var 4 ldc)] [] () Private .true. .true. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gemm_r [t gemm] [] ), my_cast_to_double: (Function (SymbolTable 14 { a: (Variable 14 a [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 14 b [] ReturnVar () () Default (Real 8) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dp: (Variable 14 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 1.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) my_cast_to_double (FunctionType [(Real 4)] (Real 8) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 14 a)] [(Assignment (Var 14 b) (Cast (Var 14 a) RealToReal (Real 8) () () ) () .false. .false. )] (Var 14 b) Private .true. .true. () ), my_cast_to_real: (Function (SymbolTable 13 { a: (Variable 13 a [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 13 b [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) my_cast_to_real (FunctionType [(Real 4)] (Real 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 13 a)] [(Assignment (Var 13 b) (Var 13 a) () .false. .false. )] (Var 13 b) Private .true. .true. () ), my_external_matmul: (Function (SymbolTable 15 { a: (Variable 15 a [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 15 b [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 15 c [a b] ReturnVar () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 15 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 15 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 15 k [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 15 m [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 15 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) my_external_matmul (FunctionType [(Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ())] DescriptorArray )] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 0 (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 1 (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [my_cast_to_real my_gemm_real] [(Var 15 a) (Var 15 b)] [(Assignment (Var 15 m) (ArraySize (Var 15 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 15 n) (ArraySize (Var 15 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 15 k) (ArraySize (Var 15 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 2 my_gemm_real () [((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((Var 15 m)) ((Var 15 n)) ((Var 15 k)) ((FunctionCall 2 my_cast_to_real () [((RealConstant 1.000000 (Real 4) ))] (Real 4) () () )) ((ArrayPhysicalCast (Var 15 a) DescriptorArray UnboundedPointerArray (Array (Real 4) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 15 m)) ((ArrayPhysicalCast (Var 15 b) DescriptorArray UnboundedPointerArray (Array (Real 4) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 15 k)) ((FunctionCall 2 my_cast_to_real () [((RealConstant 0.000000 (Real 4) ))] (Real 4) () () )) ((ArrayPhysicalCast (Var 15 c) PointerArray UnboundedPointerArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 15 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 15 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] UnboundedPointerArray ) () )) ((Var 15 m))] () .false. )] (Var 15 c) Private .true. .true. () ), my_gemm_double: (Function (SymbolTable 12 { a: (Variable 12 a [lda] In () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (Var 12 lda)) (() ())] UnboundedPointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), alpha: (Variable 12 alpha [] In () () Default (Real 8) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 12 b [ldb] In () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (Var 12 ldb)) (() ())] UnboundedPointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), beta: (Variable 12 beta [] In () () Default (Real 8) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 12 c [ldc] Out () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (Var 12 ldc)) (() ())] UnboundedPointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dp: (Variable 12 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 1.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 12 k [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lda: (Variable 12 lda [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ldb: (Variable 12 ldb [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ldc: (Variable 12 ldc [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 12 m [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 12 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), transa: (Variable 12 transa [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), transb: (Variable 12 transb [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) my_gemm_double (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (Integer 4) (Integer 4) (Integer 4) (Real 8) (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 7 (Integer 4) () )) (() ())] UnboundedPointerArray ) (Integer 4) (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 9 (Integer 4) () )) (() ())] UnboundedPointerArray ) (Integer 4) (Real 8) (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 12 (Integer 4) () )) (() ())] UnboundedPointerArray ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 transa) (Var 12 transb) (Var 12 m) (Var 12 n) (Var 12 k) (Var 12 alpha) (Var 12 a) (Var 12 lda) (Var 12 b) (Var 12 ldb) (Var 12 beta) (Var 12 c) (Var 12 ldc)] [] () Private .true. .true. () ), my_gemm_real: (Function (SymbolTable 11 { a: (Variable 11 a [lda] In () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 11 lda)) (() ())] UnboundedPointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), alpha: (Variable 11 alpha [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 11 b [ldb] In () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 11 ldb)) (() ())] UnboundedPointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), beta: (Variable 11 beta [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 11 c [ldc] Out () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 11 ldc)) (() ())] UnboundedPointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 11 k [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lda: (Variable 11 lda [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ldb: (Variable 11 ldb [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ldc: (Variable 11 ldc [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 11 m [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 11 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), transa: (Variable 11 transa [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), transb: (Variable 11 transb [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) my_gemm_real (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (Integer 4) (Integer 4) (Integer 4) (Real 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 7 (Integer 4) () )) (() ())] UnboundedPointerArray ) (Integer 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 9 (Integer 4) () )) (() ())] UnboundedPointerArray ) (Integer 4) (Real 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 12 (Integer 4) () )) (() ())] UnboundedPointerArray ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 transa) (Var 11 transb) (Var 11 m) (Var 11 n) (Var 11 k) (Var 11 alpha) (Var 11 a) (Var 11 lda) (Var 11 b) (Var 11 ldb) (Var 11 beta) (Var 11 c) (Var 11 ldc)] [] () Private .true. .true. () ), simple_external_matmul: (Template (SymbolTable 16 { cast_to_t: (Function (SymbolTable 18 { arg: (Variable 18 arg [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 18 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast_to_t (FunctionType [(Real 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 18 arg)] [] (Var 18 res) Private .true. .true. () ), gemm: (Function (SymbolTable 17 { a: (Variable 17 a [lda] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 17 lda)) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), alpha: (Variable 17 alpha [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 17 b [ldb] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 17 ldb)) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), beta: (Variable 17 beta [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 17 c [ldc] Out () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 17 ldc)) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 17 k [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lda: (Variable 17 lda [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ldb: (Variable 17 ldb [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ldc: (Variable 17 ldc [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 17 m [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 17 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), transa: (Variable 17 transa [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), transb: (Variable 17 transb [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gemm (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (Integer 4) (Integer 4) (Integer 4) (TypeParameter t ) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 7 (Integer 4) () )) (() ())] DescriptorArray ) (Integer 4) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 9 (Integer 4) () )) (() ())] DescriptorArray ) (Integer 4) (TypeParameter t ) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 12 (Integer 4) () )) (() ())] DescriptorArray ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 17 transa) (Var 17 transb) (Var 17 m) (Var 17 n) (Var 17 k) (Var 17 alpha) (Var 17 a) (Var 17 lda) (Var 17 b) (Var 17 ldb) (Var 17 beta) (Var 17 c) (Var 17 ldc)] [] () Private .true. .true. () ), real: (Variable 16 real [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), simple_external_matmul: (Function (SymbolTable 19 { a: (Variable 19 a [] In () () Default (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 19 b [] In () () Default (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 19 c [a b] ReturnVar () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 19 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 19 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 19 k [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 19 m [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 19 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) simple_external_matmul (FunctionType [(Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray )] (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 0 (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 1 (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [cast_to_t gemm] [(Var 19 a) (Var 19 b)] [(Assignment (Var 19 m) (ArraySize (Var 19 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 19 n) (ArraySize (Var 19 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 19 k) (ArraySize (Var 19 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 16 gemm () [((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((Var 19 m)) ((Var 19 n)) ((Var 19 k)) ((FunctionCall 16 cast_to_t () [((RealConstant 1.000000 (Real 4) ))] (TypeParameter t ) () () )) ((ArrayPhysicalCast (Var 19 a) DescriptorArray DescriptorArray (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () )) ((Var 19 m)) ((ArrayPhysicalCast (Var 19 b) DescriptorArray DescriptorArray (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () )) ((Var 19 k)) ((FunctionCall 16 cast_to_t () [((RealConstant 0.000000 (Real 4) ))] (TypeParameter t ) () () )) ((ArrayPhysicalCast (Var 19 c) PointerArray DescriptorArray (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 19 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 19 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] DescriptorArray ) () )) ((Var 19 m))] () .false. )] (Var 19 c) Private .true. .true. () ), t: (Variable 16 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) simple_external_matmul [t gemm cast_to_t] [(Require gemm_r [t gemm] ) (Require cast_r [real t cast_to_t] )] ), test_template: (Function (SymbolTable 20 { __instantiated_simple_external_matmul: (Function (SymbolTable 24 { a: (Variable 24 a [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 24 b [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 24 c [a b] ReturnVar () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 24 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 24 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 24 k [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 24 m [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 24 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __instantiated_simple_external_matmul (FunctionType [(Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ())] DescriptorArray )] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 0 (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 1 (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [my_cast_to_real my_gemm_real] [(Var 24 a) (Var 24 b)] [(Assignment (Var 24 m) (ArraySize (Var 24 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 24 n) (ArraySize (Var 24 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 24 k) (ArraySize (Var 24 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 2 my_gemm_real () [((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((Var 24 m)) ((Var 24 n)) ((Var 24 k)) ((FunctionCall 2 my_cast_to_real () [((RealConstant 1.000000 (Real 4) ))] (Real 4) () () )) ((ArrayPhysicalCast (Var 24 a) DescriptorArray UnboundedPointerArray (Array (Real 4) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 24 m)) ((ArrayPhysicalCast (Var 24 b) DescriptorArray UnboundedPointerArray (Array (Real 4) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 24 k)) ((FunctionCall 2 my_cast_to_real () [((RealConstant 0.000000 (Real 4) ))] (Real 4) () () )) ((ArrayPhysicalCast (Var 24 c) PointerArray UnboundedPointerArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 24 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 24 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] UnboundedPointerArray ) () )) ((Var 24 m))] () .false. )] (Var 24 c) Private .true. .true. () ), __instantiated_simple_external_matmul1: (Function (SymbolTable 25 { a: (Variable 25 a [] In () () Default (Array (Real 8) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 25 b [] In () () Default (Array (Real 8) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 25 c [a b] ReturnVar () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 25 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 25 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 25 k [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 25 m [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 25 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __instantiated_simple_external_matmul1 (FunctionType [(Array (Real 8) [(() ()) (() ())] DescriptorArray ) (Array (Real 8) [(() ()) (() ())] DescriptorArray )] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 0 (Array (Real 8) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 1 (Array (Real 8) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [my_cast_to_double my_gemm_double] [(Var 25 a) (Var 25 b)] [(Assignment (Var 25 m) (ArraySize (Var 25 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 25 n) (ArraySize (Var 25 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 25 k) (ArraySize (Var 25 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 2 my_gemm_double () [((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((Var 25 m)) ((Var 25 n)) ((Var 25 k)) ((FunctionCall 2 my_cast_to_double () [((RealConstant 1.000000 (Real 4) ))] (Real 8) () () )) ((ArrayPhysicalCast (Var 25 a) DescriptorArray UnboundedPointerArray (Array (Real 8) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 25 m)) ((ArrayPhysicalCast (Var 25 b) DescriptorArray UnboundedPointerArray (Array (Real 8) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 25 k)) ((FunctionCall 2 my_cast_to_double () [((RealConstant 0.000000 (Real 4) ))] (Real 8) () () )) ((ArrayPhysicalCast (Var 25 c) PointerArray UnboundedPointerArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 25 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 25 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] UnboundedPointerArray ) () )) ((Var 25 m))] () .false. )] (Var 25 c) Private .true. .true. () ), adp: (Variable 20 adp [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), asp: (Variable 20 asp [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), bdp: (Variable 20 bdp [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), bsp: (Variable 20 bsp [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), cdp: (Variable 20 cdp [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), csp: (Variable 20 csp [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dp: (Variable 20 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 1.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), nonsimple_external_matmul_double: (Function (SymbolTable 22 { a: (Variable 22 a [] In () () Default (Array (Real 8) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 22 b [] In () () Default (Array (Real 8) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 22 c [a b] ReturnVar () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 22 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 22 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 22 k [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 22 m [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 22 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) nonsimple_external_matmul_double (FunctionType [(Array (Real 8) [(() ()) (() ())] DescriptorArray ) (Array (Real 8) [(() ()) (() ())] DescriptorArray )] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 0 (Array (Real 8) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 1 (Array (Real 8) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [my_cast_to_double my_gemm_double] [(Var 22 a) (Var 22 b)] [(Assignment (Var 22 m) (ArraySize (Var 22 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 22 n) (ArraySize (Var 22 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 22 k) (ArraySize (Var 22 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 2 my_gemm_double () [((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((Var 22 m)) ((Var 22 n)) ((Var 22 k)) ((FunctionCall 2 my_cast_to_double () [((RealConstant 1.000000 (Real 4) ))] (Real 8) () () )) ((ArrayPhysicalCast (Var 22 a) DescriptorArray UnboundedPointerArray (Array (Real 8) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 22 m)) ((ArrayPhysicalCast (Var 22 b) DescriptorArray UnboundedPointerArray (Array (Real 8) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 22 k)) ((FunctionCall 2 my_cast_to_double () [((RealConstant 0.000000 (Real 4) ))] (Real 8) () () )) ((ArrayPhysicalCast (Var 22 c) PointerArray UnboundedPointerArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 22 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 22 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] UnboundedPointerArray ) () )) ((Var 22 m))] () .false. )] (Var 22 c) Private .true. .true. () ), nonsimple_external_matmul_real: (Function (SymbolTable 21 { a: (Variable 21 a [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 21 b [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 21 c [a b] ReturnVar () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 21 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 21 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 21 k [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 21 m [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 21 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) nonsimple_external_matmul_real (FunctionType [(Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ())] DescriptorArray )] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 0 (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 1 (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [my_cast_to_real my_gemm_real] [(Var 21 a) (Var 21 b)] [(Assignment (Var 21 m) (ArraySize (Var 21 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 21 n) (ArraySize (Var 21 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 21 k) (ArraySize (Var 21 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 2 my_gemm_real () [((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((Var 21 m)) ((Var 21 n)) ((Var 21 k)) ((FunctionCall 2 my_cast_to_real () [((RealConstant 1.000000 (Real 4) ))] (Real 4) () () )) ((ArrayPhysicalCast (Var 21 a) DescriptorArray UnboundedPointerArray (Array (Real 4) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 21 m)) ((ArrayPhysicalCast (Var 21 b) DescriptorArray UnboundedPointerArray (Array (Real 4) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 21 k)) ((FunctionCall 2 my_cast_to_real () [((RealConstant 0.000000 (Real 4) ))] (Real 4) () () )) ((ArrayPhysicalCast (Var 21 c) PointerArray UnboundedPointerArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 21 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 21 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] UnboundedPointerArray ) () )) ((Var 21 m))] () .false. )] (Var 21 c) Private .true. .true. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 20 csp) (FunctionCall 20 __instantiated_simple_external_matmul () [((ArrayPhysicalCast (Var 20 asp) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 20 bsp) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ))] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () () ) () .false. .false. ) (Assignment (Var 20 cdp) (FunctionCall 20 __instantiated_simple_external_matmul1 () [((ArrayPhysicalCast (Var 20 adp) FixedSizeArray DescriptorArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 20 bdp) FixedSizeArray DescriptorArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ))] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () () ) () .false. .false. )] () Public .true. .true. () ) }) template_lapack_01_m () [template_lapack_01_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/run-print_09-8516006.json0000664000175000017500000000071215174404631022710 0ustar alastairalastair{ "basename": "run-print_09-8516006", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/print_09.f90", "infile_hash": "cc0837a65a4cfcf29013298ba39bcabf2d6d192481f6217948058034", "outfile": null, "outfile_hash": null, "stdout": "run-print_09-8516006.stdout", "stdout_hash": "946c99fcda935631d1d36bf64ca15fc08dbe0ac895176ffeae67bd2d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-passing_array_01-b2bde68.json0000664000175000017500000000072415174404631024714 0ustar alastairalastair{ "basename": "run-passing_array_01-b2bde68", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/passing_array_01.f90", "infile_hash": "c4f23f8af4c7add1c1eeab42b957fd5885da76f668ca6b1b86660896", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-passing_array_01-b2bde68.stderr", "stderr_hash": "59aa29b7099f795300614c65d9ddb0c7314a7775a9d19e61a4c01e8d", "returncode": 1 }././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootlfortran-0.63.0/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-modules_37-1456cdb.stdoutlfortran-0.63.0/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-module0000664000175000017500000016064715174404631035013 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_37: (Program (SymbolTable 11 { }) modules_37 [] [(Print (StringConstant "executing modules_37" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ), modules_37_fpm_backend: (Module (SymbolTable 2 { build_package_build_target_ptr____0: (Function (SymbolTable 13 { 1_build_target_ptr_ptr: (ExternalSymbol 13 1_build_target_ptr_ptr 6 ptr build_target_ptr [] ptr Public ), __1targets: (Variable 13 __1targets [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), associate_block: (AssociateBlock (SymbolTable 14 { 1_build_target_t_output_dir: (ExternalSymbol 14 1_build_target_t_output_dir 7 output_dir build_target_t [] output_dir Public ), 1_string_t_s: (ExternalSymbol 14 1_string_t_s 5 s string_t [] s Public ), target: (Variable 14 target [] Local () () Default (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 2 build_target_t Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) associate_block [(Associate (Var 14 target) (StructInstanceMember (ArrayItem (Var 13 targets) [(() (Var 13 i) ())] (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) ColMajor () ) 9 1_build_target_ptr_ptr (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) ) (Assignment (StructInstanceMember (Var 13 temp) 12 1_string_t_s (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (StructInstanceMember (Var 14 target) 12 1_build_target_t_output_dir (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) () .false. .false. ) (Assignment (Var 13 build_dirs) (ArrayConstructor [(Var 13 build_dirs) (Var 13 temp)] (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) ())] DescriptorArray ) ) () ColMajor () ) () .false. .false. )] ), build_dirs: (Variable 13 build_dirs [] Local () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 string_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 13 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 13 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), model: (Variable 13 model [] In () () Default (StructType [] [] .true. .false. ) 2 fpm_model_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), targets: (Variable 13 targets [__1targets] InOut () () Default (Array (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 13 __1targets))] PointerArray ) 2 build_target_ptr Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), temp: (Variable 13 temp [] Local () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), verbose: (Variable 13 verbose [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) build_package_build_target_ptr____0 (FunctionType [(Array (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 1 (Integer 4) () ))] PointerArray ) (Integer 4) (StructType [] [] .true. .false. ) (Logical 4)] () Source Implementation "" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 targets) (Var 13 __1targets) (Var 13 model) (Var 13 verbose)] [(Allocate [((Var 13 build_dirs) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] () () ())] () () () ) (DoLoop () ((Var 13 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 13 targets) () (Integer 4) () ) ()) [(AssociateBlockCall 13 associate_block )] [] )] () Public .false. .false. () ), build_target_ptr: (Struct (SymbolTable 6 { ptr: (Variable 6 ptr [] Local (PointerNullConstant (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Var 6 ptr) ) (PointerNullConstant (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Var 6 ptr) ) Default (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 2 build_target_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) build_target_ptr (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [build_target_t] [ptr] [] Source Public .false. .false. [] () () [] ), build_target_t: (Struct (SymbolTable 7 { output_dir: (Variable 7 output_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) build_target_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [output_dir] [] Source Public .false. .false. [] () () [] ), cmd_build: (Function (SymbolTable 10 { 1_fpm_cmd_settings_verbose: (ExternalSymbol 10 1_fpm_cmd_settings_verbose 3 verbose fpm_cmd_settings [] verbose Public ), model: (Variable 10 model [] Local () () Default (StructType [] [] .true. .false. ) 2 fpm_model_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), settings: (Variable 10 settings [] In () () Default (StructType [] [] .true. .false. ) 2 fpm_build_settings Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), targets: (Variable 10 targets [] Local () () Default (Allocatable (Array (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 build_target_ptr Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cmd_build (FunctionType [(StructType [] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [build_package_build_target_ptr____0] [(Var 10 settings)] [(SubroutineCall 2 build_package_build_target_ptr____0 2 build_package_build_target_ptr____0 [((ArrayPhysicalCast (Var 10 targets) DescriptorArray PointerArray (Allocatable (Array (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [(() ())] PointerArray ) ) () )) ((ArraySize (Var 10 targets) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((Var 10 model)) ((StructInstanceMember (Var 10 settings) 10 1_fpm_cmd_settings_verbose (Logical 4) () ))] () .false. )] () Public .true. .true. () ), fpm_build_settings: (Struct (SymbolTable 4 { }) fpm_build_settings (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () 2 fpm_cmd_settings [] ), fpm_cmd_settings: (Struct (SymbolTable 3 { verbose: (Variable 3 verbose [] Local (LogicalConstant .true. (Logical 4) ) (LogicalConstant .true. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fpm_cmd_settings (StructType [(Logical 4)] [] .true. .false. ) [] [verbose] [] Source Public .false. .true. [] () () [] ), fpm_model_t: (Struct (SymbolTable 8 { }) fpm_model_t (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () () [] ), string_t: (Struct (SymbolTable 5 { s: (Variable 5 s [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [s] [] Source Public .false. .false. [] () () [] ) }) modules_37_fpm_backend () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/llvm-recursion_01-95eb32d.json0000664000175000017500000000076115174404631024153 0ustar alastairalastair{ "basename": "llvm-recursion_01-95eb32d", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/recursion_01.f90", "infile_hash": "1e4b2d3443a20a91f047ee86808b6d104c0f8bb11e930886d11978b5", "outfile": null, "outfile_hash": null, "stdout": "llvm-recursion_01-95eb32d.stdout", "stdout_hash": "fd992af00b868fe3898498f26fab3fda05aa9776db227cf15cc46ca4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-fn2-b585098.stdout0000664000175000017500000002536115174404631022365 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { a: (Variable 2 a [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 2 a) Public .true. .true. () ), b: (Function (SymbolTable 3 { b: (Variable 3 b [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) b (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 3 b) Public .true. .true. () ), c: (Function (SymbolTable 4 { c: (Variable 4 c [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) c (FunctionType [] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 4 c) Public .true. .true. () ), d: (Function (SymbolTable 5 { r: (Variable 5 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) d (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 5 r) Public .true. .true. () ), e: (Function (SymbolTable 6 { r: (Variable 6 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) e (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 6 r) Public .true. .true. () ), f: (Function (SymbolTable 7 { r: (Variable 7 r [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 7 r) Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/ast-namelist_01-032372e.stdout0000664000175000017500000000304515174404631023772 0ustar alastairalastair(TranslationUnit [(Program namelist1 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(N [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(t [] [] () () None ()) (x [] [] () () None ()) (Ecut [] [] () () None ())] () ) (Declaration () [(AttrNamelist domain )] [(N [] [] () () None ()) (t [] [] () () None ()) (x [] [] () () None ()) (Ecut [] [] () () None ())] () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-template_array_03-b7f9799.stderr0000664000175000017500000000167115174404631025266 0ustar alastairalastairwarning: Assuming implicit save attribute for variable declaration --> tests/../integration_tests/template_array_03.f90:87:24 | 87 | integer :: x = 1, y = 1, z = 1 | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement warning: Assuming implicit save attribute for variable declaration --> tests/../integration_tests/template_array_03.f90:87:31 | 87 | integer :: x = 1, y = 1, z = 1 | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement warning: Assuming implicit save attribute for variable declaration --> tests/../integration_tests/template_array_03.f90:87:38 | 87 | integer :: x = 1, y = 1, z = 1 | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement lfortran-0.63.0/tests/reference/ast_f90-fixed_form1-f592417.json0000664000175000017500000000075415174404631024206 0ustar alastairalastair{ "basename": "ast_f90-fixed_form1-f592417", "cmd": "lfortran --fixed-form --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/fixed_form1.f", "infile_hash": "a6774c19d8ae1f0ab04227a596e393ce26d84d1c0f796b7187a87f1a", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-fixed_form1-f592417.stdout", "stdout_hash": "6798fc0ebf9d89dc59d13a73af9fccd743a361d1b4906f49b78847de", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-array3-ab6fef3.json0000664000175000017500000000070015174404631023325 0ustar alastairalastair{ "basename": "julia-array3-ab6fef3", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/array3.f90", "infile_hash": "047ac01d7e3df52429d6889258f37213048937dae8611af6cbd9ecae", "outfile": null, "outfile_hash": null, "stdout": "julia-array3-ab6fef3.stdout", "stdout_hash": "a68ff46f328c8936947ca83ff6d0bfabfff1d8283334d9c403b6c9e6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-dimension_01-2172e76.stderr0000664000175000017500000000031615174404631024130 0ustar alastairalastairsemantic error: Expecting a scalar integer or parameter annotated integer variable --> tests/errors/dimension_01.f90:2:24 | 2 | integer, dimension("abcd") :: line | ^^^^^^ lfortran-0.63.0/tests/reference/ast-array2-7b9505c.stdout0000664000175000017500000001155715174404631023156 0ustar alastairalastair(TranslationUnit [(Program array2 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 5 DimensionExpr)] )] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrDimension [(1 3 DimensionExpr)] )] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [(AttrDimension [(1 2 DimensionExpr)] )] [(d [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 2 DimensionExpr) (1 3 DimensionExpr)] )] [(e [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrDimension [(1 3 DimensionExpr) (1 4 DimensionExpr)] )] [(f [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [(AttrDimension [(1 5 DimensionExpr) (1 2 DimensionExpr)] )] [(g [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 2 DimensionExpr) (1 3 DimensionExpr) (1 4 DimensionExpr)] )] [(h [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrDimension [(1 3 DimensionExpr) (1 4 DimensionExpr) (1 3 DimensionExpr)] )] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [(AttrDimension [(1 5 DimensionExpr) (1 2 DimensionExpr) (1 2 DimensionExpr)] )] [(j [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-pragma2-604d549.stdout0000664000175000017500000001033515174404631023217 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { pragma2: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) pragma2 [] [(Assignment (Var 2 a) (ArrayPhysicalCast (ArrayBroadcast (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) (ArrayConstant 4 [8] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 32 [1.00000000e+00, 1.00000000e+00, 1.00000000e+00, ...., 1.00000000e+00, 1.00000000e+00, 1.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) FixedSizeArray SIMDArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/run-implicit_argument_casting_01-0d962d9.stderr0000664000175000017500000000014015174404631027465 0ustar alastairalastairCannot use --disable-implicit-argument-casting and --implicit-argument-casting at the same time lfortran-0.63.0/tests/reference/asr-array_constructor_with_different_kind-80c5bf4.json0000664000175000017500000000105315174404631031317 0ustar alastairalastair{ "basename": "asr-array_constructor_with_different_kind-80c5bf4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_constructor_with_different_kind.f90", "infile_hash": "1c99a99dd08ea6e1a907a41a63108fa742ed6e2802d9f8be88f23732", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_constructor_with_different_kind-80c5bf4.stderr", "stderr_hash": "ffe5660a2ce99c0aa55533f42cbad5016f892774b54ab3ac611c3361", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-array_bound_1-b0c2255.json0000664000175000017500000000076115174404631024107 0ustar alastairalastair{ "basename": "asr-array_bound_1-b0c2255", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/array_bound_1.f90", "infile_hash": "38d2c1d99ad714fdaa387541310a78f8d3c4d7e19e93ed67a2dcf677", "outfile": null, "outfile_hash": null, "stdout": "asr-array_bound_1-b0c2255.stdout", "stdout_hash": "7d3460bfb60263c65565f19b71d593603b361e6a3a3bb2ed4669c9f7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_16_module-4aac273.stdout0000664000175000017500000004427415174404631026545 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_16: (Program (SymbolTable 5 { 1_fpm_run_settings_bool: (ExternalSymbol 5 1_fpm_run_settings_bool 3 bool fpm_run_settings [] bool Public ), 1_fpm_run_settings_float: (ExternalSymbol 5 1_fpm_run_settings_float 3 float fpm_run_settings [] float Public ), 1_fpm_run_settings_int: (ExternalSymbol 5 1_fpm_run_settings_int 3 int fpm_run_settings [] int Public ), fpm_run_settings: (ExternalSymbol 5 fpm_run_settings 2 fpm_run_settings fpm_command_line [] fpm_run_settings Public ), get_command_line_settings: (ExternalSymbol 5 get_command_line_settings 2 get_command_line_settings fpm_command_line [] get_command_line_settings Public ), settings: (Variable 5 settings [] Local () () Default (Allocatable (StructType [(Integer 4) (Real 4) (Logical 4)] [] .false. .false. ) ) 5 fpm_run_settings Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) derived_types_16 [fpm_command_line] [(Allocate [((Var 5 settings) [] () () ())] () () () ) (SubroutineCall 5 get_command_line_settings () [((Var 5 settings))] () .false. ) (If () (IntegerCompare (StructInstanceMember (Var 5 settings) 5 1_fpm_run_settings_int (Integer 4) () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (StructInstanceMember (Var 5 settings) 5 1_fpm_run_settings_float (Real 4) () ) Sub (RealConstant 1.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (StructInstanceMember (Var 5 settings) 5 1_fpm_run_settings_bool (Logical 4) () ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ), fpm_command_line: (Module (SymbolTable 2 { fpm_run_settings: (Struct (SymbolTable 3 { bool: (Variable 3 bool [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), float: (Variable 3 float [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), int: (Variable 3 int [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fpm_run_settings (StructType [(Integer 4) (Real 4) (Logical 4)] [] .true. .false. ) [] [int float bool] [] Source Public .false. .false. [] () () [] ), get_command_line_settings: (Function (SymbolTable 4 { cmd_settings: (Variable 4 cmd_settings [] Out () () Default (Allocatable (StructType [(Integer 4) (Real 4) (Logical 4)] [] .false. .false. ) ) 2 fpm_run_settings Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_command_line_settings (FunctionType [(Allocatable (StructType [(Integer 4) (Real 4) (Logical 4)] [] .false. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 cmd_settings)] [(Assignment (Var 4 cmd_settings) (StructConstructor 2 fpm_run_settings [((IntegerConstant 0 (Integer 4) Decimal)) ((RealConstant 1.000000 (Real 4) )) ((LogicalConstant .true. (Logical 4) ))] (StructType [(Integer 4) (Real 4) (Logical 4)] [] .true. .false. ) () ) () .false. .false. )] () Public .true. .true. () ) }) fpm_command_line () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-do_zero_increment-06c400d.stderr0000664000175000017500000000023615174404631025414 0ustar alastairalastairsemantic error: Step expression (Increment) in DO loop cannot be zero --> tests/errors/do_zero_increment.f90:4:14 | 4 | do i = 1, 5, 0 | ^ lfortran-0.63.0/tests/reference/ast-entry1-5b02d99.stdout0000664000175000017500000000404115174404631023166 0ustar alastairalastair(TranslationUnit [(Program entry1 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [(Declaration (AttrType TypeReal [] () () None ) [] [(dummy [] [] () () None ())] () )] [(Assignment 0 dummy 10 () ) (SubroutineCall 0 x [] [(() dummy () 0)] [] [] () ) (SubroutineCall 0 y [] [(() dummy () 0)] [] [] () )] [] ) (Subroutine x [(dummy)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [] [(dummy [] [] () () None ())] () )] [(Print 0 () [(String "Printed using subroutine call: " ()) dummy] () ) (Assignment 0 dummy (Real "5.0") () ) (Return 0 () () ) (Entry 0 y [(dummy)] () () () ) (Print 0 () [(String "Printed using entry statement: " ()) dummy] () ) (Return 0 () () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-array_02_pack-233bae0.json0000664000175000017500000000076115174404631024054 0ustar alastairalastair{ "basename": "asr-array_02_pack-233bae0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/array_02_pack.f90", "infile_hash": "8d58570ab351e8b1ec04ca39b9a3dd9c099cffdcdf4ea487fe742f35", "outfile": null, "outfile_hash": null, "stdout": "asr-array_02_pack-233bae0.stdout", "stdout_hash": "f15d22b22f53d2c5bda48761dcfbdd5dd2a64bd6061e1f86eb1e68f1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-subroutine7-e0b863b.json0000664000175000017500000000071715174404631024257 0ustar alastairalastair{ "basename": "julia-subroutine7-e0b863b", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/subroutine7.f90", "infile_hash": "3a15750c9d608f1988e0dd13f8d956be28a72297be5ef3137777cf2f", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutine7-e0b863b.stdout", "stdout_hash": "2399ab9cb3fe2b65500fd1f09c5ce34b0cfc6a0bc2d07ad844e98ba8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-subroutine1-b6656b7.json0000664000175000017500000000073515174404631023662 0ustar alastairalastair{ "basename": "asr-subroutine1-b6656b7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/subroutine1.f90", "infile_hash": "0c76f3b9c93978c48be3b338215eb0380706f094f8d28edce0da034e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-subroutine1-b6656b7.stderr", "stderr_hash": "6023ad3e9dde6734e3fcc03d3dc361690e636daec657440736485019", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-intrinsics8-6c1e53e.json0000664000175000017500000000073515174404631023731 0ustar alastairalastair{ "basename": "asr-intrinsics8-6c1e53e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics8.f90", "infile_hash": "9b631de39a99a46aa17f154cad0d2ee561c62e453115eb29cafebefe", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics8-6c1e53e.stderr", "stderr_hash": "44334de20cf2be954d250d152cf7c59ecf37feb09dbd68167e510713", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-team1-f0af498.json0000664000175000017500000000070415174404631022467 0ustar alastairalastair{ "basename": "ast-team1-f0af498", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/team1.f90", "infile_hash": "c7d57807d2f91911de8beb317405307221c403b50c6abdec58484b8b", "outfile": null, "outfile_hash": null, "stdout": "ast-team1-f0af498.stdout", "stdout_hash": "96941664a3ca5f8afe52665681990109cfa0177a2d3d54d515f0ebd5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_global_stmts-global_scope8-95c3673.json0000664000175000017500000000101415174404631026767 0ustar alastairalastair{ "basename": "pass_global_stmts-global_scope8-95c3673", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope8.f90", "infile_hash": "899df30dee274279a699110fb9af2afad0b826c0abc886f9e2460627", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope8-95c3673.stdout", "stdout_hash": "f96b3dd82d9b2b2d270bc9813015459c0dcc5e503bf226962f720fba", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-case_06-f84222d.json0000664000175000017500000000073715174404631022616 0ustar alastairalastair{ "basename": "asr-case_06-f84222d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_06.f90", "infile_hash": "3987983e4c8d162530bceffbbce0bd7d038b1f794655c222c47ad714", "outfile": null, "outfile_hash": null, "stdout": "asr-case_06-f84222d.stdout", "stdout_hash": "53c6614d3e1cdbe73ba3ab69863cda7b3347823e67ae9fc675b2665b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-derived_types_32-4684b97.stdout0000664000175000017500000004657315174404631025252 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c" \00", align 1 @1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [4 x i8] c"(g0)" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }> @serialization_info = private unnamed_addr constant [3 x i8] c"R8\00", align 1 @2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @__Wrong_allocation = private unnamed_addr constant [51 x i8] c"Attempting to allocate already allocated variable!\00", align 1 @string_const_data.1 = private constant [1 x i8] c" " @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.1, i32 0, i32 0), i64 1 }> @3 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [7 x i8] c"S-DESC\00", align 1 @4 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @string_const_data.4 = private constant [18 x i8] c"10.000000000000000" @string_const.5 = private global %string_descriptor <{ i8* getelementptr inbounds ([18 x i8], [18 x i8]* @string_const_data.4, i32 0, i32 0), i64 18 }> @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @5 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @6 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @_lcompilers_len_trim_str(%string_descriptor* %str) { .entry: %StringItem = alloca %string_descriptor, align 8 %result = alloca i32, align 4 %0 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 1 %1 = load i64, i64* %0, align 8 %2 = trunc i64 %1 to i32 store i32 %2, i32* %result, align 4 %3 = load i32, i32* %result, align 4 %4 = icmp ne i32 %3, 0 br i1 %4, label %then, label %else2 then: ; preds = %.entry br label %loop.head loop.head: ; preds = %ifcont, %then %5 = load i32, i32* %result, align 4 %6 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 0 %7 = load i8*, i8** %6, align 8 %8 = sext i32 %5 to i64 %9 = sub i64 %8, 1 %10 = getelementptr i8, i8* %7, i64 %9 %11 = getelementptr %string_descriptor, %string_descriptor* %StringItem, i32 0, i32 0 store i8* %10, i8** %11, align 8 %12 = getelementptr %string_descriptor, %string_descriptor* %StringItem, i32 0, i32 1 store i64 1, i64* %12, align 8 %13 = getelementptr %string_descriptor, %string_descriptor* %StringItem, i32 0, i32 0 %14 = load i8*, i8** %13, align 8 %15 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 %16 = load i8, i8* %14, align 1 %17 = load i8, i8* %15, align 1 %18 = icmp eq i8 %16, %17 br i1 %18, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %19 = load i32, i32* %result, align 4 %20 = sub i32 %19, 1 store i32 %20, i32* %result, align 4 %21 = load i32, i32* %result, align 4 %22 = icmp eq i32 %21, 0 br i1 %22, label %then1, label %else then1: ; preds = %loop.body br label %loop.end unreachable_after_exit: ; No predecessors! br label %ifcont else: ; preds = %loop.body br label %ifcont ifcont: ; preds = %else, %unreachable_after_exit br label %loop.head loop.end: ; preds = %then1, %loop.head br label %ifcont3 else2: ; preds = %.entry br label %ifcont3 ifcont3: ; preds = %else2, %loop.end br label %return return: ; preds = %ifcont3 br label %FINALIZE_SYMTABLE__lcompilers_len_trim_str FINALIZE_SYMTABLE__lcompilers_len_trim_str: ; preds = %return %23 = load i32, i32* %result, align 4 ret i32 %23 } define void @_lcompilers_trim_str(%string_descriptor* %str, %string_descriptor* %result) { .entry: %0 = call i8* @_lfortran_get_default_allocator() %StrSlice_StrView = alloca %string_descriptor, align 8 %1 = call i32 @_lcompilers_len_trim_str(%string_descriptor* %str) %2 = sext i32 %1 to i64 %3 = sub i64 %2, 1 %4 = add i64 %3, 1 %5 = icmp slt i64 %4, 0 %6 = select i1 %5, i64 0, i64 %4 %7 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %StrSliceGEP = getelementptr i8, i8* %8, i64 0 %9 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 store i8* %StrSliceGEP, i8** %9, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 store i64 %6, i64* %10, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %result, i32 0, i32 0 %12 = getelementptr %string_descriptor, %string_descriptor* %result, i32 0, i32 1 %13 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 %14 = load i8*, i8** %13, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 %16 = load i64, i64* %15, align 8 call void @_lfortran_strcpy_alloc(i8* %0, i8** %11, i64* %12, i8 0, i8 0, i8* %14, i64 %16) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE__lcompilers_trim_str FINALIZE_SYMTABLE__lcompilers_trim_str: ; preds = %return ret void } define void @__module_testdrive_derived_types_32_real_dp_to_string(double* %val, %string_descriptor* %string) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %lfortran_iomsg = alloca %string_descriptor, align 8 %buffer = alloca %string_descriptor, align 8 %__libasr__created__var__2_return_slot = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %__libasr__created__var__2_return_slot, align 1 store %string_descriptor zeroinitializer, %string_descriptor* %buffer, align 1 %1 = getelementptr %string_descriptor, %string_descriptor* %buffer, i32 0, i32 1 store i64 128, i64* %1, align 8 %2 = getelementptr %string_descriptor, %string_descriptor* %buffer, i32 0, i32 0 %3 = call i8* @_lfortran_get_default_allocator() %4 = call i8* @_lfortran_malloc_alloc(i8* %3, i64 128) store i8* %4, i8** %2, align 8 %buffer_len = alloca i32, align 4 store i32 128, i32* %buffer_len, align 4 store %string_descriptor zeroinitializer, %string_descriptor* %lfortran_iomsg, align 1 %5 = getelementptr %string_descriptor, %string_descriptor* %lfortran_iomsg, i32 0, i32 1 store i64 0, i64* %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %lfortran_iomsg, i32 0, i32 0 %7 = call i8* @_lfortran_get_default_allocator() %8 = call i8* @_lfortran_malloc_alloc(i8* %7, i64 1) store i8* %8, i8** %6, align 8 %9 = load %string_descriptor, %string_descriptor* %string, align 1 %10 = getelementptr %string_descriptor, %string_descriptor* %string, i32 0, i32 0 %11 = load i8*, i8** %10, align 8 %12 = icmp ne i8* %11, null br i1 %12, label %then, label %else then: ; preds = %.entry %13 = getelementptr %string_descriptor, %string_descriptor* %string, i32 0, i32 0 %14 = getelementptr %string_descriptor, %string_descriptor* %string, i32 0, i32 1 %15 = load i8*, i8** %13, align 8 call void @_lfortran_free_alloc(i8* %0, i8* %15) store i8* null, i8** %13, align 8 store i64 0, i64* %14, align 8 br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %16 = getelementptr %string_descriptor, %string_descriptor* %buffer, i32 0, i32 0 %17 = getelementptr %string_descriptor, %string_descriptor* %buffer, i32 0, i32 1 %18 = alloca i32*, align 8 store i32* null, i32** %18, align 8 %19 = load i32*, i32** %18, align 8 %20 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 %21 = alloca i64, align 8 %22 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* %20, i64 4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %21, i32 0, i32 0, i32 0, i32 0, i32 0, double* %val) %23 = load i64, i64* %21, align 8 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %22, i8** %24, align 8 %25 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %23, i64* %25, align 8 %26 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %27 = load i8*, i8** %26, align 8 %28 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %29 = load i64, i64* %28, align 8 call void (i8*, i8**, i8, i8, i8, i64, i64*, i32*, i8*, i64, ...) @_lfortran_string_write(i8* %0, i8** %16, i8 0, i8 0, i8 0, i64 1, i64* %17, i32* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @2, i32 0, i32 0), i64 2, i8* %27, i64 %29) %30 = icmp eq i8* %22, null br i1 %30, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont call void @_lfortran_free_alloc(i8* %0, i8* %22) br label %free_done free_done: ; preds = %free_nonnull, %ifcont %31 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 0 %32 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 1 %33 = load i8*, i8** %31, align 8 call void @_lfortran_free_alloc(i8* %0, i8* %33) store i8* null, i8** %31, align 8 store i64 0, i64* %32, align 8 %34 = call i32 @_lcompilers_len_trim_str(%string_descriptor* %buffer) %35 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 0 %36 = load i8*, i8** %35, align 8 %37 = icmp ne i8* %36, null br i1 %37, label %then1, label %else2 then1: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @__Wrong_allocation, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont3 else2: ; preds = %free_done br label %ifcont3 ifcont3: ; preds = %else2, %then1 %38 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 0 %39 = sext i32 %34 to i64 %40 = call i8* @_lfortran_get_default_allocator() %41 = call i8* @_lfortran_string_malloc_alloc(i8* %40, i64 %39) store i8* %41, i8** %38, align 8 %42 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 1 %43 = sext i32 %34 to i64 store i64 %43, i64* %42, align 8 call void @_lcompilers_trim_str(%string_descriptor* %buffer, %string_descriptor* %__libasr__created__var__2_return_slot) %44 = getelementptr %string_descriptor, %string_descriptor* %string, i32 0, i32 0 %45 = getelementptr %string_descriptor, %string_descriptor* %string, i32 0, i32 1 %46 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 0 %47 = load i8*, i8** %46, align 8 %48 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 1 %49 = load i64, i64* %48, align 8 call void @_lfortran_strcpy_alloc(i8* %0, i8** %44, i64* %45, i8 1, i8 1, i8* %47, i64 %49) br label %return return: ; preds = %ifcont3 br label %FINALIZE_SYMTABLE_real_dp_to_string FINALIZE_SYMTABLE_real_dp_to_string: ; preds = %return br label %Finalize_Variable___libasr__created__var__2_return_slot Finalize_Variable___libasr__created__var__2_return_slot: ; preds = %FINALIZE_SYMTABLE_real_dp_to_string %50 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 0 %51 = load i8*, i8** %50, align 8 call void @_lfortran_free_alloc(i8* %0, i8* %51) br label %Finalize_Variable_buffer Finalize_Variable_buffer: ; preds = %Finalize_Variable___libasr__created__var__2_return_slot %52 = getelementptr %string_descriptor, %string_descriptor* %buffer, i32 0, i32 0 %53 = load i8*, i8** %52, align 8 call void @_lfortran_free_alloc(i8* %0, i8* %53) br label %Finalize_Variable_lfortran_iomsg Finalize_Variable_lfortran_iomsg: ; preds = %Finalize_Variable_buffer %54 = getelementptr %string_descriptor, %string_descriptor* %lfortran_iomsg, i32 0, i32 0 %55 = load i8*, i8** %54, align 8 call void @_lfortran_free_alloc(i8* %0, i8* %55) ret void } declare i8* @_lfortran_malloc_alloc(i8*, i64) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_free_alloc(i8*, i8*) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare void @_lfortran_string_write(i8*, i8**, i8, i8, i8, i64, i64*, i32*, i8*, i64, ...) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare i8* @_lfortran_string_malloc_alloc(i8*, i64) declare void @_lfortran_strcpy_alloc(i8*, i8**, i64*, i8, i8, i8*, i64) define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() %__libasr__created__var__1_return_slot = alloca %string_descriptor, align 8 %__libasr__created__var__0_return_slot = alloca %string_descriptor, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store %string_descriptor zeroinitializer, %string_descriptor* %__libasr__created__var__0_return_slot, align 1 store %string_descriptor zeroinitializer, %string_descriptor* %__libasr__created__var__1_return_slot, align 1 %value = alloca double, align 8 store double 1.000000e+01, double* %value, align 8 %3 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0_return_slot, i32 0, i32 0 %4 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0_return_slot, i32 0, i32 1 %5 = load i8*, i8** %3, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %5) store i8* null, i8** %3, align 8 store i64 0, i64* %4, align 8 call void @__module_testdrive_derived_types_32_real_dp_to_string(double* %value, %string_descriptor* %__libasr__created__var__0_return_slot) %6 = alloca i64, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0_return_slot, i32 0, i32 1 %8 = load i64, i64* %7, align 8 %9 = load %string_descriptor, %string_descriptor* %__libasr__created__var__0_return_slot, align 1 %10 = alloca %string_descriptor, align 8 store %string_descriptor %9, %string_descriptor* %10, align 1 %11 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @serialization_info.3, i32 0, i32 0), i64* %6, i32 0, i32 1, i32 0, i32 0, i32 0, i64 %8, %string_descriptor* %10) %12 = load i64, i64* %6, align 8 %13 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %11, i8** %13, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %12, i64* %14, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %16 = load i8*, i8** %15, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %18 = load i64, i64* %17, align 8 %19 = trunc i64 %18 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @4, i32 0, i32 0), i8* %16, i32 %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @3, i32 0, i32 0), i32 1) %20 = icmp eq i8* %11, null br i1 %20, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %11) br label %free_done free_done: ; preds = %free_nonnull, %.entry %21 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__1_return_slot, i32 0, i32 0 %22 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__1_return_slot, i32 0, i32 1 %23 = load i8*, i8** %21, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %23) store i8* null, i8** %21, align 8 store i64 0, i64* %22, align 8 call void @__module_testdrive_derived_types_32_real_dp_to_string(double* %value, %string_descriptor* %__libasr__created__var__1_return_slot) %24 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__1_return_slot, i32 0, i32 0 %25 = load i8*, i8** %24, align 8 %26 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__1_return_slot, i32 0, i32 1 %27 = load i64, i64* %26, align 8 %28 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.5, i32 0, i32 0), align 8 %29 = call i32 @str_compare(i8* %25, i64 %27, i8* %28, i64 18) %30 = icmp ne i32 %29, 0 br i1 %30, label %then, label %else then: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @6, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @5, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %free_done br label %ifcont ifcont: ; preds = %else, %then br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return br label %Finalize_Variable___libasr__created__var__0_return_slot Finalize_Variable___libasr__created__var__0_return_slot: ; preds = %FINALIZE_SYMTABLE_main %31 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0_return_slot, i32 0, i32 0 %32 = load i8*, i8** %31, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %32) br label %Finalize_Variable___libasr__created__var__1_return_slot Finalize_Variable___libasr__created__var__1_return_slot: ; preds = %Finalize_Variable___libasr__created__var__0_return_slot %33 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__1_return_slot, i32 0, i32 0 %34 = load i8*, i8** %33, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %34) call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare i32 @str_compare(i8*, i64, i8*, i64) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/run-scalar_allocation_check_01-a82b6b0.stderr0000664000175000017500000000025415174404631027121 0ustar alastairalastairruntime error: Variable 'x' is not allocated. --> tests/errors/scalar_allocation_check_01.f90:4:29 | 4 | integer, allocatable :: x | ^ lfortran-0.63.0/tests/reference/asr-fixed_form_goto_select-a0c3483.json0000664000175000017500000000100215174404631026063 0ustar alastairalastair{ "basename": "asr-fixed_form_goto_select-a0c3483", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_goto_select.f", "infile_hash": "acbe51b93b613a469a6a95e544f8bf2480ad5ea75d6f5e369dcceb9a", "outfile": null, "outfile_hash": null, "stdout": "asr-fixed_form_goto_select-a0c3483.stdout", "stdout_hash": "346b50d36f271320957c47c14a50f75f871c4065ae90ec40c0a46e12", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-forall1-88e2780.stdout0000664000175000017500000000210515174404631023710 0ustar alastairalastairprogram forall1 implicit none ! Only for Syntax check !>>>>>>>>>>>>> Single line statments <<<<<<<<<<<<<< forall (i = 1:n) A(i, i) = B(i) end forall forall (i = 1:n:3, j = 1:n:5) A(i, j) = SIN(A(j, i)) end forall forall (i = 1:n, j = 1:n, i /= j) A(i, j) = REAL(i + j) end forall forall (i = 1:n, j = 1:m, A(i, j) /= 0) A(i, j) = 1/A(i, j) end forall forall (i = 1:1000, j = 1:1000, i /= j) A(i, j) = A(j, i) end forall !>>>>>>>>>>>>> Multipe line statements <<<<<<<<<<<<<< forall (j = 1:n) shared(i) local(x) default(none) forall (i = 1:j) A(i, j) = B(i) end forall end forall forall (i = 1:N) reduce(*: s) s = s + a(i) end forall forall (i = 3:N + 1, j = 3:N + 1) C(i, j) = C(i, j + 2) + C(i, j - 2) D(i, j) = C(i, j) + C(i + 2, j) + C(i - 2, j) end forall forall (x = 1:100, J(x) > 0) where (I(x, :) < 0) I(x, :) = 0 elsewhere I(x, :) = 1 end where end forall outer: forall (i = 1:100) inner: forall (j = 1:100, i /= j) A(i, j) = A(j, i) end forall inner end forall outer end program forall1 lfortran-0.63.0/tests/reference/asr-assign_01-2cf003f.stderr0000664000175000017500000000035215174404631023555 0ustar alastairalastairsemantic error: Cannot assign to a constant variable --> tests/errors/assign_01.f90:5:5 | 5 | x = 1 | ^^^^^ assignment here | 4 | integer, parameter :: x = 2 | ~~~~~ declared as constant lfortran-0.63.0/tests/reference/llvm-string_10-ef0078f.stdout0000664000175000017500000004232215174404631024022 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @c_data = private global [2 x i8] c"BC" @c = private global %string_descriptor <{ i8* getelementptr inbounds ([2 x i8], [2 x i8]* @c_data, i32 0, i32 0), i64 2 }> @string_const_data = private constant [1 x i8] c"A" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data, i32 0, i32 0), i64 1 }> @string_const_data.1 = private constant [1 x i8] c"Z" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.1, i32 0, i32 0), i64 1 }> @string_const_data.3 = private constant [1 x i8] c"a" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.3, i32 0, i32 0), i64 1 }> @string_const_data.5 = private constant [1 x i8] c"z" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.5, i32 0, i32 0), i64 1 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [4 x i8] c"L32\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @string_const_data.7 = private constant [2 x i8] c"@a" @string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([2 x i8], [2 x i8]* @string_const_data.7, i32 0, i32 0), i64 2 }> @string_const_data.9 = private constant [1 x i8] c"A" @string_const.10 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.9, i32 0, i32 0), i64 1 }> @string_const_data.11 = private constant [1 x i8] c"Z" @string_const.12 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.11, i32 0, i32 0), i64 1 }> @string_const_data.13 = private constant [1 x i8] c"a" @string_const.14 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.13, i32 0, i32 0), i64 1 }> @string_const_data.15 = private constant [1 x i8] c"z" @string_const.16 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.15, i32 0, i32 0), i64 1 }> @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.17 = private unnamed_addr constant [4 x i8] c"L32\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @string_const_data.18 = private constant [2 x i8] c"a@" @string_const.19 = private global %string_descriptor <{ i8* getelementptr inbounds ([2 x i8], [2 x i8]* @string_const_data.18, i32 0, i32 0), i64 2 }> @string_const_data.20 = private constant [1 x i8] c"A" @string_const.21 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.20, i32 0, i32 0), i64 1 }> @string_const_data.22 = private constant [1 x i8] c"Z" @string_const.23 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.22, i32 0, i32 0), i64 1 }> @string_const_data.24 = private constant [1 x i8] c"a" @string_const.25 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.24, i32 0, i32 0), i64 1 }> @string_const_data.26 = private constant [1 x i8] c"z" @string_const.27 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.26, i32 0, i32 0), i64 1 }> @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.28 = private unnamed_addr constant [4 x i8] c"L32\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @string_const_data.29 = private constant [3 x i8] c"sbs" @string_const.30 = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data.29, i32 0, i32 0), i64 3 }> @string_const_data.31 = private constant [3 x i8] c"sbs" @string_const.32 = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data.31, i32 0, i32 0), i64 3 }> @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %StrSlice_StrView = alloca %string_descriptor, align 8 %stringFormat_desc4 = alloca %string_descriptor, align 8 %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() %num = alloca %string_descriptor, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %is_alpha = alloca i32, align 4 store %string_descriptor zeroinitializer, %string_descriptor* %num, align 1 %3 = getelementptr %string_descriptor, %string_descriptor* %num, i32 0, i32 1 store i64 3, i64* %3, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %num, i32 0, i32 0 %5 = call i8* @_lfortran_get_default_allocator() %6 = call i8* @_lfortran_malloc_alloc(i8* %5, i64 3) store i8* %6, i8** %4, align 8 %7 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %8 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 %9 = call i32 @str_compare(i8* %7, i64 2, i8* %8, i64 1) %10 = icmp sge i32 %9, 0 %11 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %12 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 %13 = call i32 @str_compare(i8* %11, i64 2, i8* %12, i64 1) %14 = icmp sle i32 %13, 0 %15 = and i1 %10, %14 %16 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %17 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 %18 = call i32 @str_compare(i8* %16, i64 2, i8* %17, i64 1) %19 = icmp sge i32 %18, 0 %20 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %21 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.6, i32 0, i32 0), align 8 %22 = call i32 @str_compare(i8* %20, i64 2, i8* %21, i64 1) %23 = icmp sle i32 %22, 0 %24 = and i1 %19, %23 %25 = or i1 %15, %24 %26 = zext i1 %25 to i32 store i32 %26, i32* %is_alpha, align 4 %27 = alloca i64, align 8 %28 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @serialization_info, i32 0, i32 0), i64* %27, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %is_alpha) %29 = load i64, i64* %27, align 8 %30 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %28, i8** %30, align 8 %31 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %29, i64* %31, align 8 %32 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %33 = load i8*, i8** %32, align 8 %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %35 = load i64, i64* %34, align 8 %36 = trunc i64 %35 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %33, i32 %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %37 = icmp eq i8* %28, null br i1 %37, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %28) br label %free_done free_done: ; preds = %free_nonnull, %.entry %38 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.8, i32 0, i32 0), align 8 call void @_lfortran_strcpy_alloc(i8* %2, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), i64* getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 1), i8 0, i8 0, i8* %38, i64 2) %39 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %40 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.10, i32 0, i32 0), align 8 %41 = call i32 @str_compare(i8* %39, i64 2, i8* %40, i64 1) %42 = icmp sge i32 %41, 0 %43 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %44 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.12, i32 0, i32 0), align 8 %45 = call i32 @str_compare(i8* %43, i64 2, i8* %44, i64 1) %46 = icmp sle i32 %45, 0 %47 = and i1 %42, %46 %48 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %49 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.14, i32 0, i32 0), align 8 %50 = call i32 @str_compare(i8* %48, i64 2, i8* %49, i64 1) %51 = icmp sge i32 %50, 0 %52 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %53 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.16, i32 0, i32 0), align 8 %54 = call i32 @str_compare(i8* %52, i64 2, i8* %53, i64 1) %55 = icmp sle i32 %54, 0 %56 = and i1 %51, %55 %57 = or i1 %47, %56 %58 = zext i1 %57 to i32 store i32 %58, i32* %is_alpha, align 4 %59 = alloca i64, align 8 %60 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @serialization_info.17, i32 0, i32 0), i64* %59, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %is_alpha) %61 = load i64, i64* %59, align 8 %62 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %60, i8** %62, align 8 %63 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %61, i64* %63, align 8 %64 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %65 = load i8*, i8** %64, align 8 %66 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %67 = load i64, i64* %66, align 8 %68 = trunc i64 %67 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %65, i32 %68, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %69 = icmp eq i8* %60, null br i1 %69, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %2, i8* %60) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %70 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.19, i32 0, i32 0), align 8 call void @_lfortran_strcpy_alloc(i8* %2, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), i64* getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 1), i8 0, i8 0, i8* %70, i64 2) %71 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %72 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.21, i32 0, i32 0), align 8 %73 = call i32 @str_compare(i8* %71, i64 2, i8* %72, i64 1) %74 = icmp sge i32 %73, 0 %75 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %76 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.23, i32 0, i32 0), align 8 %77 = call i32 @str_compare(i8* %75, i64 2, i8* %76, i64 1) %78 = icmp sle i32 %77, 0 %79 = and i1 %74, %78 %80 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %81 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.25, i32 0, i32 0), align 8 %82 = call i32 @str_compare(i8* %80, i64 2, i8* %81, i64 1) %83 = icmp sge i32 %82, 0 %84 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %85 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.27, i32 0, i32 0), align 8 %86 = call i32 @str_compare(i8* %84, i64 2, i8* %85, i64 1) %87 = icmp sle i32 %86, 0 %88 = and i1 %83, %87 %89 = or i1 %79, %88 %90 = zext i1 %89 to i32 store i32 %90, i32* %is_alpha, align 4 %91 = alloca i64, align 8 %92 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @serialization_info.28, i32 0, i32 0), i64* %91, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %is_alpha) %93 = load i64, i64* %91, align 8 %94 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %92, i8** %94, align 8 %95 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %93, i64* %95, align 8 %96 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %97 = load i8*, i8** %96, align 8 %98 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %99 = load i64, i64* %98, align 8 %100 = trunc i64 %99 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %97, i32 %100, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %101 = icmp eq i8* %92, null br i1 %101, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free_alloc(i8* %2, i8* %92) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 %102 = getelementptr %string_descriptor, %string_descriptor* %num, i32 0, i32 0 %103 = load i8*, i8** %102, align 8 %StrSliceGEP = getelementptr i8, i8* %103, i64 0 %104 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 store i8* %StrSliceGEP, i8** %104, align 8 %105 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 store i64 3, i64* %105, align 8 %106 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 %107 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 %108 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.30, i32 0, i32 0), align 8 call void @_lfortran_strcpy_alloc(i8* %2, i8** %106, i64* %107, i8 0, i8 0, i8* %108, i64 3) %109 = getelementptr %string_descriptor, %string_descriptor* %num, i32 0, i32 0 %110 = load i8*, i8** %109, align 8 %111 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.32, i32 0, i32 0), align 8 %112 = call i32 @str_compare(i8* %110, i64 3, i8* %111, i64 3) %113 = icmp ne i32 %112, 0 br i1 %113, label %then, label %else then: ; preds = %free_done6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %free_done6 br label %ifcont ifcont: ; preds = %else, %then br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_string_10 FINALIZE_SYMTABLE_string_10: ; preds = %return br label %Finalize_Variable_num Finalize_Variable_num: ; preds = %FINALIZE_SYMTABLE_string_10 %114 = getelementptr %string_descriptor, %string_descriptor* %num, i32 0, i32 0 %115 = load i8*, i8** %114, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %115) call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc_alloc(i8*, i64) declare i8* @_lfortran_get_default_allocator() declare i32 @str_compare(i8*, i64, i8*, i64) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_strcpy_alloc(i8*, i8**, i64*, i8, i8, i8*, i64) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) lfortran-0.63.0/tests/reference/fortran-real_to_complex_cast_in_comparison-655651c.stdout0000664000175000017500000000057515174404631031666 0ustar alastairalastairprogram expr2 implicit none integer(4), parameter :: dp = Kind(0.0000000000000000e+00_8) real(8) :: zero zero = 0.0000000000000000e+00_8 contains elemental complex(8) function dabs(x) result(r) complex(8), intent(in) :: x if (x /= cmplx(zero, 0.0, kind=8)) then r = x else r = cmplx(0, 0.0, kind=8) - x end if end function dabs end program expr2 lfortran-0.63.0/tests/reference/ast-multi_error1-6934f65.stderr0000664000175000017500000000016615174404631024305 0ustar alastairalastairsyntax error: Newline is unexpected here --> tests/multi_error1.f90:3:15 | 3 | integer :: x = | ^ lfortran-0.63.0/tests/reference/asr-uppercase1-b7c06b1.stdout0000664000175000017500000001607415174404631024071 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { uppercase1: (Module (SymbolTable 2 { sub: (Function (SymbolTable 3 { a: (Variable 3 a [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Assignment (Var 3 a) (IntegerBinOp (IntegerBinOp (Var 3 a) Add (ArraySize (Var 2 x) () (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (Integer 4) () ) Add (ArraySize (Var 2 y) () (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ), x: (Variable 2 x [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) uppercase1 () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/pass_div_to_mul-div_to_mul-d0027c6.json0000664000175000017500000000102215174404631026117 0ustar alastairalastair{ "basename": "pass_div_to_mul-div_to_mul-d0027c6", "cmd": "lfortran --pass=div_to_mul --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/div_to_mul.f90", "infile_hash": "6c1d702f410e8db6aae79c37b446d7a2fd6295166902746ff799d239", "outfile": null, "outfile_hash": null, "stdout": "pass_div_to_mul-div_to_mul-d0027c6.stdout", "stdout_hash": "2e0d385df9189acce7a77008a17299552f9feb9905671023b8192f37", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-no_prescan_include2-121e523.stdout0000664000175000017500000000127615174404631025573 0ustar alastairalastair(TranslationUnit [(Program include2 () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () )] [(Assignment 0 x (* (+ 2 3) 5) () ) (Print 0 () [x] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/ast-program_without_line_06-58bbdbc.stdout0000664000175000017500000000030615174404631026725 0ustar alastairalastair(TranslationUnit [(Program __xx_main () [] [] [] [(Stop 0 () () () )] [] )] ) lfortran-0.63.0/tests/reference/asr-operator_overloading_02-6076a0f.stdout0000664000175000017500000003655115174404631026475 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 5 { logical_gets_integer@~assign: (ExternalSymbol 5 logical_gets_integer@~assign 2 logical_gets_integer overload_assignment_m [] logical_gets_integer Public ), tf: (Variable 5 tf [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~assign: (ExternalSymbol 5 ~assign 2 ~assign overload_assignment_m [] ~assign Public ) }) main [overload_assignment_m] [(Assignment (Var 5 tf) (IntegerConstant 0 (Integer 4) Decimal) (SubroutineCall 5 logical_gets_integer@~assign 5 logical_gets_integer@~assign [((Var 5 tf)) ((IntegerConstant 0 (Integer 4) Decimal))] () .false. ) .false. .false. ) (Print (StringFormat () [(StringConstant "tf=0:" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 5 tf)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 5 tf) (IntegerConstant 1 (Integer 4) Decimal) (SubroutineCall 5 logical_gets_integer@~assign 5 logical_gets_integer@~assign [((Var 5 tf)) ((IntegerConstant 1 (Integer 4) Decimal))] () .false. ) .false. .false. ) (Print (StringFormat () [(StringConstant "tf=1:" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 5 tf)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), overload_assignment_m: (Module (SymbolTable 2 { logical_gets_integer: (Function (SymbolTable 3 { i: (Variable 3 i [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tf: (Variable 3 tf [] Out () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) logical_gets_integer (FunctionType [(Logical 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 tf) (Var 3 i)] [(Assignment (Var 3 tf) (IntegerCompare (Var 3 i) Eq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) () .false. .false. )] () Private .true. .true. () ), logical_gets_integer_use: (Function (SymbolTable 4 { i: (Variable 4 i [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), logical_gets_integer: (ExternalSymbol 4 logical_gets_integer 2 logical_gets_integer overload_assignment_m [] logical_gets_integer Public ), tf: (Variable 4 tf [] Out () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) logical_gets_integer_use (FunctionType [(Logical 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 tf) (Var 4 i)] [(Assignment (Var 4 tf) (Var 4 i) (SubroutineCall 4 logical_gets_integer 4 logical_gets_integer [((Var 4 tf)) ((Var 4 i))] () .false. ) .false. .false. )] () Private .true. .true. () ), ~assign: (CustomOperator 2 ~assign [2 logical_gets_integer] Public ) }) overload_assignment_m () [overload_assignment_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/llvm-allocate_02-4f6b634.stdout0000664000175000017500000003504215174404631024221 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %array.1 = type { i32*, i64, i32, i8, i8, i8, i8, i64, [1 x %dimension_descriptor] } %dimension_descriptor = type { i64, i64, i64 } @0 = private unnamed_addr constant [4 x i8] c"arr\00", align 1 @1 = private unnamed_addr constant [22 x i8] c"tests/allocate_02.f90\00", align 1 @2 = private unnamed_addr constant [53 x i8] c"Cannot allocate '%s' because it is already allocated\00", align 1 @3 = private unnamed_addr constant [55 x i8] c"Attempting to allocate already allocated variable '%s'\00", align 1 @4 = private unnamed_addr constant [4 x i8] c"arr\00", align 1 @5 = private unnamed_addr constant [22 x i8] c"tests/allocate_02.f90\00", align 1 @6 = private unnamed_addr constant [53 x i8] c"Cannot allocate '%s' because it is already allocated\00", align 1 @7 = private unnamed_addr constant [55 x i8] c"Attempting to allocate already allocated variable '%s'\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %2 = call i8* @_lfortran_get_default_allocator() %arr_desc = alloca %array.1, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %arr = alloca %array.1*, align 8 store %array.1* null, %array.1** %arr, align 8 %3 = getelementptr %array.1, %array.1* %arr_desc, i32 0, i32 8 %4 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %3, i32 0, i32 0 %5 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %4, i32 0 %6 = getelementptr %dimension_descriptor, %dimension_descriptor* %5, i32 0, i32 0 store i64 1, i64* %6, align 8 %7 = getelementptr %dimension_descriptor, %dimension_descriptor* %5, i32 0, i32 1 store i64 1, i64* %7, align 8 %8 = getelementptr %dimension_descriptor, %dimension_descriptor* %5, i32 0, i32 2 store i64 0, i64* %8, align 8 %9 = getelementptr %array.1, %array.1* %arr_desc, i32 0, i32 3 store i8 1, i8* %9, align 1 %10 = getelementptr %array.1, %array.1* %arr_desc, i32 0, i32 0 store i32* null, i32** %10, align 8 store %array.1* %arr_desc, %array.1** %arr, align 8 %i = alloca i32, align 4 %11 = load %array.1*, %array.1** %arr, align 8 %12 = ptrtoint %array.1* %11 to i64 %13 = icmp eq i64 %12, 0 br i1 %13, label %merge_allocated, label %check_data check_data: ; preds = %.entry %14 = getelementptr %array.1, %array.1* %11, i32 0, i32 0 %15 = load i32*, i32** %14, align 8 %16 = ptrtoint i32* %15 to i64 %17 = icmp ne i64 %16, 0 br label %merge_allocated merge_allocated: ; preds = %check_data, %.entry %is_allocated = phi i1 [ false, %.entry ], [ %17, %check_data ] br i1 %is_allocated, label %then, label %ifcont then: ; preds = %merge_allocated %18 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %19 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %20 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %19, i32 0, i32 0 %21 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %20, i32 0, i32 0 store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @1, i32 0, i32 0), i8** %21, align 8 %22 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %20, i32 0, i32 1 store i32 5, i32* %22, align 4 %23 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %20, i32 0, i32 2 store i32 14, i32* %23, align 4 %24 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %20, i32 0, i32 3 store i32 5, i32* %24, align 4 %25 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %20, i32 0, i32 4 store i32 19, i32* %25, align 4 %26 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @0, i32 0, i32 0)) %27 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %18, i32 0, i32 0 %28 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %19, i32 0, i32 0 %29 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %27, i32 0, i32 2 %30 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %27, i32 0, i32 0 store i1 true, i1* %30, align 1 %31 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %27, i32 0, i32 1 store i8* %26, i8** %31, align 8 store { i8*, i32, i32, i32, i32 }* %28, { i8*, i32, i32, i32, i32 }** %29, align 8 %32 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %27, i32 0, i32 3 store i32 1, i32* %32, align 4 %33 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %18, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %33, i32 1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont: ; preds = %merge_allocated %34 = load %array.1*, %array.1** %arr, align 8 %35 = getelementptr %array.1, %array.1* %34, i32 0, i32 7 store i64 0, i64* %35, align 8 %36 = getelementptr %array.1, %array.1* %34, i32 0, i32 8 %37 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %36, i32 0, i32 0 %38 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %37, i32 0 %39 = getelementptr %dimension_descriptor, %dimension_descriptor* %38, i32 0, i32 2 %40 = getelementptr %dimension_descriptor, %dimension_descriptor* %38, i32 0, i32 0 %41 = getelementptr %dimension_descriptor, %dimension_descriptor* %38, i32 0, i32 1 store i64 1, i64* %39, align 8 store i64 1, i64* %40, align 8 store i64 1, i64* %41, align 8 %42 = getelementptr %array.1, %array.1* %34, i32 0, i32 0 %43 = call i8* @_lfortran_get_default_allocator() %44 = call i8* @_lfortran_malloc_alloc(i8* %43, i64 4) %45 = bitcast i8* %44 to i32* store i32* %45, i32** %42, align 8 store i32 0, i32* %i, align 4 br label %loop.head loop.head: ; preds = %ifcont10, %ifcont %46 = load i32, i32* %i, align 4 %47 = add i32 %46, 1 %48 = icmp sle i32 %47, 1000000 br i1 %48, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %49 = load i32, i32* %i, align 4 %50 = add i32 %49, 1 store i32 %50, i32* %i, align 4 %51 = load %array.1*, %array.1** %arr, align 8 %52 = ptrtoint %array.1* %51 to i64 %53 = icmp eq i64 %52, 0 br i1 %53, label %merge_allocated2, label %check_data1 check_data1: ; preds = %loop.body %54 = getelementptr %array.1, %array.1* %51, i32 0, i32 0 %55 = load i32*, i32** %54, align 8 %56 = ptrtoint i32* %55 to i64 %57 = icmp ne i64 %56, 0 br label %merge_allocated2 merge_allocated2: ; preds = %check_data1, %loop.body %is_allocated3 = phi i1 [ false, %loop.body ], [ %57, %check_data1 ] br i1 %is_allocated3, label %then4, label %else then4: ; preds = %merge_allocated2 %58 = getelementptr %array.1, %array.1* %51, i32 0, i32 0 %59 = load i32*, i32** %58, align 8 %60 = bitcast i32* %59 to i8* call void @_lfortran_free_alloc(i8* %2, i8* %60) %61 = getelementptr %array.1, %array.1* %51, i32 0, i32 0 store i32* null, i32** %61, align 8 br label %ifcont5 else: ; preds = %merge_allocated2 br label %ifcont5 ifcont5: ; preds = %else, %then4 %62 = load %array.1*, %array.1** %arr, align 8 %63 = ptrtoint %array.1* %62 to i64 %64 = icmp eq i64 %63, 0 br i1 %64, label %merge_allocated7, label %check_data6 check_data6: ; preds = %ifcont5 %65 = getelementptr %array.1, %array.1* %62, i32 0, i32 0 %66 = load i32*, i32** %65, align 8 %67 = ptrtoint i32* %66 to i64 %68 = icmp ne i64 %67, 0 br label %merge_allocated7 merge_allocated7: ; preds = %check_data6, %ifcont5 %is_allocated8 = phi i1 [ false, %ifcont5 ], [ %68, %check_data6 ] br i1 %is_allocated8, label %then9, label %ifcont10 then9: ; preds = %merge_allocated7 %69 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %70 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %71 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %70, i32 0, i32 0 %72 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %71, i32 0, i32 0 store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @5, i32 0, i32 0), i8** %72, align 8 %73 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %71, i32 0, i32 1 store i32 8, i32* %73, align 4 %74 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %71, i32 0, i32 2 store i32 18, i32* %74, align 4 %75 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %71, i32 0, i32 3 store i32 8, i32* %75, align 4 %76 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %71, i32 0, i32 4 store i32 23, i32* %76, align 4 %77 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @6, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @4, i32 0, i32 0)) %78 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %69, i32 0, i32 0 %79 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %70, i32 0, i32 0 %80 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %78, i32 0, i32 2 %81 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %78, i32 0, i32 0 store i1 true, i1* %81, align 1 %82 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %78, i32 0, i32 1 store i8* %77, i8** %82, align 8 store { i8*, i32, i32, i32, i32 }* %79, { i8*, i32, i32, i32, i32 }** %80, align 8 %83 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %78, i32 0, i32 3 store i32 1, i32* %83, align 4 %84 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %69, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %84, i32 1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont10: ; preds = %merge_allocated7 %85 = load %array.1*, %array.1** %arr, align 8 %86 = getelementptr %array.1, %array.1* %85, i32 0, i32 7 store i64 0, i64* %86, align 8 %87 = getelementptr %array.1, %array.1* %85, i32 0, i32 8 %88 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %87, i32 0, i32 0 %89 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %88, i32 0 %90 = getelementptr %dimension_descriptor, %dimension_descriptor* %89, i32 0, i32 2 %91 = getelementptr %dimension_descriptor, %dimension_descriptor* %89, i32 0, i32 0 %92 = getelementptr %dimension_descriptor, %dimension_descriptor* %89, i32 0, i32 1 store i64 1, i64* %90, align 8 store i64 1, i64* %91, align 8 store i64 1, i64* %92, align 8 %93 = getelementptr %array.1, %array.1* %85, i32 0, i32 0 %94 = call i8* @_lfortran_get_default_allocator() %95 = call i8* @_lfortran_malloc_alloc(i8* %94, i64 4) %96 = bitcast i8* %95 to i32* store i32* %96, i32** %93, align 8 br label %loop.head loop.end: ; preds = %loop.head br label %return return: ; preds = %loop.end br label %FINALIZE_SYMTABLE_allocate_02 FINALIZE_SYMTABLE_allocate_02: ; preds = %return br label %Finalize_Variable_arr Finalize_Variable_arr: ; preds = %FINALIZE_SYMTABLE_allocate_02 %97 = load %array.1*, %array.1** %arr, align 8 call void @finalize_allocatable__Array_1_i32(%array.1* %97) call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_snprintf_alloc(i8*, i8*, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lcompilers_runtime_error(i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) declare void @exit(i32) declare i8* @_lfortran_malloc_alloc(i8*, i64) declare void @_lfortran_free_alloc(i8*, i8*) define internal void @finalize_allocatable__Array_1_i32(%array.1* %0) { entry: %1 = icmp ne %array.1* %0, null br i1 %1, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %entry call void @finalize_descriptorArray_Array_1_i32(%array.1* %0) br label %is_allocated.ifcont is_allocated.else: ; preds = %entry br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %is_allocated.then ret void } define internal void @finalize_descriptorArray_Array_1_i32(%array.1* %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = getelementptr %array.1, %array.1* %0, i32 0, i32 0 %3 = load i32*, i32** %2, align 8 %4 = ptrtoint i32* %3 to i64 %5 = icmp ne i64 %4, 0 br i1 %5, label %then, label %else then: ; preds = %entry %6 = bitcast i32* %3 to i8* call void @_lfortran_free_alloc(i8* %1, i8* %6) br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then ret void } declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/llvm-complex1-0e93fa9.stdout0000664000175000017500000000131315174404631023740 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %complex_4 = type <{ float, float }> define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca %complex_4, align 8 store %complex_4 <{ float 3.000000e+00, float 4.000000e+00 }>, %complex_4* %x, align 1 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_complex1 FINALIZE_SYMTABLE_complex1: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/llvm-intrinsics_02-404e16e.json0000664000175000017500000000076415174404631024246 0ustar alastairalastair{ "basename": "llvm-intrinsics_02-404e16e", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_02.f90", "infile_hash": "9042eb55a868aba778eaccfaba75217700b9f99f157df367ffc005fd", "outfile": null, "outfile_hash": null, "stdout": "llvm-intrinsics_02-404e16e.stdout", "stdout_hash": "36d631646b2e0282357e06b935ae7114348892d5b7dc329ba2b3adbe", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-modules_01-da63075.json0000664000175000017500000000075015174404631023341 0ustar alastairalastair{ "basename": "ast-modules_01-da63075", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_01.f90", "infile_hash": "592921c14763dae70e205b1eaf8b9fd0b69df11eccc0a66d109e11b8", "outfile": null, "outfile_hash": null, "stdout": "ast-modules_01-da63075.stdout", "stdout_hash": "e69793d1058d360b1ba8c99a09834216a95939942da8317d7934bd88", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_03_transfer-4fcb3e2.json0000664000175000017500000000077515174404631025061 0ustar alastairalastair{ "basename": "asr-array_03_transfer-4fcb3e2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/array_03_transfer.f90", "infile_hash": "d554a75d7567a6aed407dae5c430c9dea3fa17c13fad6b7ffeecb8d0", "outfile": null, "outfile_hash": null, "stdout": "asr-array_03_transfer-4fcb3e2.stdout", "stdout_hash": "ae532b26cfd002e0fc68d58f9b71bdaa43323a04463eddd4bcc8c1f7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_error_01b-e284c9a.json0000664000175000017500000000076215174404631025146 0ustar alastairalastair{ "basename": "asr-template_error_01b-e284c9a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_01b.f90", "infile_hash": "5ec3c47e5ccee449eb4e86e635ac1544b93a6be86f7ce1c332c97ddd", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_01b-e284c9a.stderr", "stderr_hash": "78249ad975f5cc263d61ff3951e5c3f7eded7260e296bbabd430c29c", "returncode": 2 }lfortran-0.63.0/tests/reference/ast_f90-where1-5c3f533.json0000664000175000017500000000072215174404631023243 0ustar alastairalastair{ "basename": "ast_f90-where1-5c3f533", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/where1.f90", "infile_hash": "cd5e0b85aa90c2bb3dff3fdc1e1e563b601c361a4b57ba16db0bf051", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-where1-5c3f533.stdout", "stdout_hash": "c91657eeaef4fd0b4c18b234bc364630734714fd5b953b2c081c15b3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_35-5fba3e7.json0000664000175000017500000000075015174404631023511 0ustar alastairalastair{ "basename": "asr-modules_35-5fba3e7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_35.f90", "infile_hash": "5117017b03ab16e2fa34e13800ebd9e03539c4bd6ad2fafc1e543dbb", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_35-5fba3e7.stdout", "stdout_hash": "bd234ae7cf5224a75dcc89d5d834bc6af10c035f25c3ae958634e3cb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-complex_01-f07fa9a.stdout0000664000175000017500000000554215174404631024061 0ustar alastairalastair(TranslationUnit [(Program complex_01 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeComplex [] () () None ) [] [(x [] [] () (Complex (Real "1.0") (u- (Real "3.0"))) Equal ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrParameter )] [(a [] [] () (Real "3.0") Equal ()) (b [] [] () (Real "4.0") Equal ())] () ) (Declaration (AttrType TypeComplex [] () () None ) [] [(y [] [] () (Complex a b) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Declaration (AttrType TypeComplex [] () () None ) [(SimpleAttribute AttrParameter )] [(i_ [] [] () (Complex 0 1) Equal ())] () ) (Declaration (AttrType TypeComplex [] () () None ) [] [(z [] [] () (+ a (* i_ b)) Equal ())] () ) (Declaration (AttrType TypeComplex [] () () None ) [] [(w [] [] () (+ (+ a b) (* i_ (- a b))) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Print 0 () [x y z w] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/x86-program1-cd1a758.json0000664000175000017500000000057615174404631023050 0ustar alastairalastair{ "basename": "x86-program1-cd1a758", "cmd": "lfortran --no-color --backend=x86 {infile} -o output", "infile": "tests/program1.f90", "infile_hash": "ec4ccdfed01d45648718ca57a9ceb3e5aa82e55e57d8906636902e7b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-interface_04-9570e2b.json0000664000175000017500000000075615174404631023644 0ustar alastairalastair{ "basename": "asr-interface_04-9570e2b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/interface_04.f90", "infile_hash": "14368b65a65dffde9d8d8ed4bc45203d43a32e68739474d9f18fff8b", "outfile": null, "outfile_hash": null, "stdout": "asr-interface_04-9570e2b.stdout", "stdout_hash": "f33afb01cf577c2f2dfc8e1ecf790036eefa93565b3aaa2e411baa52", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics5-1cd2db1.json0000664000175000017500000000073515174404631023773 0ustar alastairalastair{ "basename": "asr-intrinsics5-1cd2db1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics5.f90", "infile_hash": "f6ab4986a500e1e177af025cc2991631cf382d103abca3355b09df16", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics5-1cd2db1.stderr", "stderr_hash": "a7047f36c61c7a014d95d8993c15357b96d5223f6cecfb844bd3d472", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-implicit_argument_casting_01-2274b4b.stdout0000664000175000017500000006250315174404631027465 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { idz_realcomp: (Function (SymbolTable 2 { a: (Variable 2 a [n] Unspecified () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dp: (Variable 2 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) idz_realcomp (FunctionType [(Integer 4) (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 n) (Var 2 a)] [(Assignment (Var 2 a) (ArrayBroadcast (RealConstant 12.500000 (Real 8) ) (IntrinsicArrayFunction Shape [(Var 2 a)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () ) () .false. .false. )] () Public .true. .true. () ), main: (Program (SymbolTable 3 { dp: (Variable 3 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), idzp_svd: (Function (SymbolTable 4 { isi: (Variable 4 isi [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ls: (Variable 4 ls [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), w: (Variable 4 w [] Unspecified () () Default (Array (Complex 8) [(() ())] UnboundedPointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), w_cast: (Variable 4 w_cast [] Local () () Default (Pointer (Array (Real 8) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) idzp_svd (FunctionType [(Integer 4) (Array (Complex 8) [(() ())] UnboundedPointerArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [idz_realcomp] [(Var 4 ls) (Var 4 w)] [(Assignment (Var 4 isi) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (CPtrToPointer (PointerToCPtr (GetPointer (ArrayItem (Var 4 w) [(() (Var 4 isi) ())] (Complex 8) ColMajor () ) (Pointer (Complex 8) ) () ) (CPtr) () ) (Var 4 w_cast) (ArrayConstant 4 [1000] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () ) (SubroutineCall 1 idz_realcomp () [((IntegerBinOp (Var 4 ls) Mul (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((ArrayPhysicalCast (Var 4 w_cast) DescriptorArray PointerArray (Pointer (Array (Real 8) [(() ())] PointerArray ) ) () ))] () .false. ) (Print (StringFormat () [(ArrayItem (Var 4 w) [(() (Var 4 isi) ())] (Complex 8) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Real [(ArrayItem (Var 4 w) [(() (Var 4 isi) ())] (Complex 8) ColMajor () )] 0 (Real 8) () ) Sub (RealConstant 12.500000 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] )] () Public .false. .false. () ), w: (Variable 3 w [] Local () () Default (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main [] [(SubroutineCall 3 idzp_svd () [((IntegerConstant 5 (Integer 4) Decimal)) ((ArrayPhysicalCast (Var 3 w) FixedSizeArray UnboundedPointerArray (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] UnboundedPointerArray ) () ))] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/run-format_28-d8cdd42.json0000664000175000017500000000071515174404631023353 0ustar alastairalastair{ "basename": "run-format_28-d8cdd42", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_28.f90", "infile_hash": "e12053da38efd01671849c2d7e7ff4188ea37725fd373fee0322018e", "outfile": null, "outfile_hash": null, "stdout": "run-format_28-d8cdd42.stdout", "stdout_hash": "5a623fd42274dea41223ab2fcd021cbd0ecbf208b1c2aa96782ade02", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-entry2-a9679e0.json0000664000175000017500000000075615174404631022633 0ustar alastairalastair{ "basename": "asr-entry2-a9679e0", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/entry2.f90", "infile_hash": "8a9990154b2df25acf24c7fec7a8d5c1a984523e505e71caacf27c61", "outfile": null, "outfile_hash": null, "stdout": "asr-entry2-a9679e0.stdout", "stdout_hash": "1806b55406ef57afe5bdf7ac65c091007044fa10d2f83c7d96a99e29", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixed_form4-a6a0e27.json0000664000175000017500000000074115174404631023653 0ustar alastairalastair{ "basename": "ast-fixed_form4-a6a0e27", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form4.f", "infile_hash": "4b4c0ab80a461abdbde1e862272b59c0a86b2fc7685d3b60379457f7", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form4-a6a0e27.stdout", "stdout_hash": "b71d4f8dfff81c774615aa2d502b4576e561b208b3d73998faa71da2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-return_03-3f7087d.json0000664000175000017500000000107115174404631023403 0ustar alastairalastair{ "basename": "llvm-return_03-3f7087d", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/return_03.f90", "infile_hash": "c190c174edf4f26a3f53eaf52dec0323754909c2495aedbf30d13753", "outfile": null, "outfile_hash": null, "stdout": "llvm-return_03-3f7087d.stdout", "stdout_hash": "43e95fe72656d8993d3ed7ef431b5b4b9e74ba65da00a4bae440aaee", "stderr": "llvm-return_03-3f7087d.stderr", "stderr_hash": "3a3e7d555e7082b1df762706047d54b39d0484046e5f72bf507b2a3b", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-merge_bits_run-9579699.stderr0000664000175000017500000000030115174404631024611 0ustar alastairalastairsemantic error: Kind of all the arguments of Mergebits must be the same --> tests/errors/merge_bits_run.f90:7:14 | 7 | print *, merge_bits(a, b, c) | ^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-template_sort_02-0aa4518.json0000664000175000017500000000077215174404631024550 0ustar alastairalastair{ "basename": "asr-template_sort_02-0aa4518", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_sort_02.f90", "infile_hash": "784d6d4e3ae91b1604cc477b388497c8298e6743c01bbefb61ecd409", "outfile": null, "outfile_hash": null, "stdout": "asr-template_sort_02-0aa4518.stdout", "stdout_hash": "9096bb7b6abc2f6a0bac9c426f3701f88fd7f9f970e5c2deb709cc1e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-rand_01-5739aee.stdout0000664000175000017500000000407715174404631023263 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { rand_01: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) rand_01 [] [(Assignment (Var 2 x) (IntrinsicElementalFunction Rand [] 0 (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-esub2-248f0df.stderr0000664000175000017500000000017315174404631023026 0ustar alastairalastairtokenizer error: Token '~' is not recognized --> tests/errors/esub2.f90:3:5 | 3 | x = ~1 | ^ token not recognized lfortran-0.63.0/tests/reference/c-program3-32749e4.json0000664000175000017500000000067215174404631022511 0ustar alastairalastair{ "basename": "c-program3-32749e4", "cmd": "lfortran --no-color --show-c {infile}", "infile": "tests/program3.f90", "infile_hash": "f5e4a3f2a2a6f406171d0aa3895b5d7342c4d87b73ffede073827f34", "outfile": null, "outfile_hash": null, "stdout": "c-program3-32749e4.stdout", "stdout_hash": "dca2659bdfaea8181b9d34cd7070e45eb52d551e9f4b5f4c40fd5529", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_28-7703b7d.json0000664000175000017500000000076115174404631024073 0ustar alastairalastair{ "basename": "asr-intrinsics_28-7703b7d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_28.f90", "infile_hash": "f45647d216365113f8bfc21ff79a6d9bad1d526431280aade87dd5b9", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_28-7703b7d.stdout", "stdout_hash": "39c931f2b6d09afe791fdd9a5f06bccb76ffa0b323cebf089b737546", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-subroutine4-e2840c9.stdout0000664000175000017500000000170615174404631024227 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations template void triad(T0* a, T1* b, float scalar, T2* c); // Implementations template void triad(T0* a, T1* b, float scalar, T2* c) { int32_t i; int32_t n; n = a->data->extent(0); Kokkos::parallel_for(Kokkos::RangePolicy(1, n+1), KOKKOS_LAMBDA(const long i) { c->data->operator[](i - c->dims[0].lower_bound) = a->data->operator[](i - a->dims[0].lower_bound) + scalar*b->data->operator[](i - b->dims[0].lower_bound); }); } lfortran-0.63.0/tests/reference/wat-types_03-e07ce23.json0000664000175000017500000000072515174404631023124 0ustar alastairalastair{ "basename": "wat-types_03-e07ce23", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/types_03.f90", "infile_hash": "388683b8609d91d174ceb8c24787c982bf1ea22d342e94d44457b861", "outfile": null, "outfile_hash": null, "stdout": "wat-types_03-e07ce23.stdout", "stdout_hash": "b71ee4ae0bfeeacb0aa6a6c97ed4444e801a15fb3e1eb2f71f81514c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-operator_overloading_01-9ec8e71.stdout0000664000175000017500000007322315174404631026565 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { operator_overloading_01: (Program (SymbolTable 5 { bin_add: (ExternalSymbol 5 bin_add 2 bin_add operator_overloading_01_overload_asterisk_m [] bin_add Public ), f: (Variable 5 f [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Parameter (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), logical_and: (ExternalSymbol 5 logical_and 2 logical_and operator_overloading_01_overload_asterisk_m [] logical_and Public ), t: (Variable 5 t [] Local (LogicalConstant .true. (Logical 4) ) (LogicalConstant .true. (Logical 4) ) Parameter (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~add: (ExternalSymbol 5 ~add 2 ~add operator_overloading_01_overload_asterisk_m [] ~add Public ), ~mul: (ExternalSymbol 5 ~mul 2 ~mul operator_overloading_01_overload_asterisk_m [] ~mul Public ) }) operator_overloading_01 [operator_overloading_01_overload_asterisk_m] [(Print (StringFormat () [(StringConstant "T*T:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedBinOp (Var 5 t) Mul (Var 5 t) (Logical 4) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 t)) ((Var 5 t))] (Logical 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "T*F:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedBinOp (Var 5 t) Mul (Var 5 f) (Logical 4) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 t)) ((Var 5 f))] (Logical 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "F*T:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedBinOp (Var 5 f) Mul (Var 5 t) (Logical 4) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 f)) ((Var 5 t))] (Logical 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "F*F:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedBinOp (Var 5 f) Mul (Var 5 f) (Logical 4) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 f)) ((Var 5 f))] (Logical 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "T+T:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedBinOp (Var 5 t) Add (Var 5 t) (Logical 4) () (FunctionCall 5 bin_add 5 ~add [((Var 5 t)) ((Var 5 t))] (Integer 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "T+F:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedBinOp (Var 5 t) Add (Var 5 f) (Logical 4) () (FunctionCall 5 bin_add 5 ~add [((Var 5 t)) ((Var 5 f))] (Integer 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "F+T:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedBinOp (Var 5 f) Add (Var 5 t) (Logical 4) () (FunctionCall 5 bin_add 5 ~add [((Var 5 f)) ((Var 5 t))] (Integer 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "F+F:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedBinOp (Var 5 f) Add (Var 5 f) (Logical 4) () (FunctionCall 5 bin_add 5 ~add [((Var 5 f)) ((Var 5 f))] (Integer 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), operator_overloading_01_overload_asterisk_m: (Module (SymbolTable 2 { bin_add: (Function (SymbolTable 4 { bin_add: (Variable 4 bin_add [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), log1: (Variable 4 log1 [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), log2: (Variable 4 log2 [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) bin_add (FunctionType [(Logical 4) (Logical 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 log1) (Var 4 log2)] [(If () (LogicalBinOp (Var 4 log1) And (Var 4 log2) (Logical 4) () ) [(Assignment (Var 4 bin_add) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. )] [(If () (LogicalBinOp (LogicalNot (Var 4 log1) (Logical 4) () ) And (LogicalNot (Var 4 log2) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 4 bin_add) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] [(Assignment (Var 4 bin_add) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. )] )] )] (Var 4 bin_add) Public .true. .true. () ), logical_and: (Function (SymbolTable 3 { log1: (Variable 3 log1 [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), log2: (Variable 3 log2 [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), logical_and: (Variable 3 logical_and [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) logical_and (FunctionType [(Logical 4) (Logical 4)] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 3 log1) (Var 3 log2)] [(Assignment (Var 3 logical_and) (LogicalBinOp (Var 3 log1) And (Var 3 log2) (Logical 4) () ) () .false. .false. )] (Var 3 logical_and) Public .true. .true. () ), ~add: (CustomOperator 2 ~add [2 bin_add] Public ), ~mul: (CustomOperator 2 ~mul [2 logical_and] Public ) }) operator_overloading_01_overload_asterisk_m () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-submodule_01-2524ba9.stdout0000664000175000017500000004723215174404631024246 0ustar alastairalastair(TranslationUnit [(Module m1 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [(DerivedType Base [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [] ) (Interface (InterfaceHeader) () [(InterfaceProc (Subroutine sub1 [(i) (b)] [(SimpleAttribute AttrModule )] () (TriviaNode [(EOLComment "! Module procedure interface body for sub1" )] [] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () Base None ) [(AttrIntent In )] [(b [] [] () () None ())] () )] [] [] [] ) )] )] [] [] ) (Module m2 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(Use [] m1 [] .false. (TriviaNode [] [(EOLComment "! Use association of module m1" ) (EndOfLine)] ) )] [] [(Interface (InterfaceHeader) () [(InterfaceProc (Function func1 [] [(AttrType TypeReal [] () () None ) (SimpleAttribute AttrModule )] () () (TriviaNode [(EOLComment "! Module procedure interface body for func1" )] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) ) (InterfaceProc (Function func2 [(b)] [(SimpleAttribute AttrModule )] () () (TriviaNode [(EOLComment "! Module procedure interface body for func2" )] [] ) [] [] [] [(Declaration (AttrType TypeType [] () Base None ) [] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () Base None ) [] [(func2 [] [] () () None ())] () )] [] [] [] ) )] )] [] [] ) (Module m4 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(Use [] m1 [] .false. (TriviaNode [] [(EOLComment "! Use association of module m1" )] ) )] [] [(DerivedType NewType [] () [(AttrExtends Base )] [(Declaration (AttrType TypeReal [] () () None ) [] [(j [] [] () () None ())] () )] [] )] [] [] ) (Submodule m1 () m1sub (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(Use [] m4 [] .false. (TriviaNode [] [(EOLComment "! Use association of module m4" ) (EndOfLine)] ) )] [] [] [] [(Subroutine sub1 [(i) (b)] [(SimpleAttribute AttrModule )] () (TriviaNode [(EOLComment "! Implementation of sub1 declared in m1" )] [] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () Base None ) [(AttrIntent In )] [(b [] [] () () None ())] () )] [(Print 0 () [(String "sub1" ()) i b] () )] [] [] )] ) (Submodule m2 () m2sub (TriviaNode [(EndOfLine) (EndOfLine)] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Function func1 [] [(AttrType TypeReal [] () () None ) (SimpleAttribute AttrModule )] () () (TriviaNode [(EOLComment "! Implementation of func1 declared in m2" )] [] ) [] [] [] [] [(Assignment 0 func1 20 () )] [] [] )] ) (Submodule m2 m2sub m2sub2 (TriviaNode [(EndOfLine) (EndOfLine)] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Function func2 [(b)] [(SimpleAttribute AttrModule )] () () (TriviaNode [(EOLComment "! Implementation of func2 declared in m2" )] [] ) [] [] [] [(Declaration (AttrType TypeType [] () Base None ) [] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () Base None ) [] [(func2 [] [] () () None ())] () )] [(Assignment 0 func2 b () )] [] [] )] ) (Module m3 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [(Interface (InterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceProc (Subroutine interfaceSub1 [(i) (b)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(Use [] m1 [] .false. () )] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () Base None ) [(AttrIntent In )] [(b [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Function interfaceFunc1 [] [(AttrType TypeReal [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) ) (InterfaceProc (Function interfaceFunc2 [(b)] [] () () () [(Use [] m1 [] .false. () )] [] [] [(Declaration (AttrType TypeType [] () Base None ) [] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () Base None ) [] [(interfaceFunc2 [] [] () () None ())] () )] [] [] [] ) )] ) (DerivedType Container [] () [] [(Declaration (AttrType TypeProcedure [] () interfaceSub1 None ) [(SimpleAttribute AttrNoPass ) (SimpleAttribute AttrPointer )] [(pp1 [] [] () () None ())] () ) (Declaration (AttrType TypeProcedure [] () interfaceFunc1 None ) [(SimpleAttribute AttrNoPass ) (SimpleAttribute AttrPointer )] [(pp2 [] [] () () None ())] () ) (Declaration (AttrType TypeProcedure [] () interfaceFunc2 None ) [(SimpleAttribute AttrNoPass ) (SimpleAttribute AttrPointer )] [(pp3 [] [] () () None ())] () )] [] )] [] [] ) (Program example () [(Use [] m1 [] .false. () ) (Use [] m2 [] .false. () ) (Use [] m3 [] .false. () )] [] [(Declaration (AttrType TypeType [] () Container None ) [] [(c1 [] [] () () None ())] () )] [(Associate 0 pp1 [(c1 [])] sub1 () ) (Associate 0 pp2 [(c1 [])] func1 () ) (Associate 0 pp3 [(c1 [])] func2 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SubroutineCall 0 pp1 [(c1 [])] [(() 10 () 0) (() (FuncCallOrArray Base [] [(() 11 () 0)] [] [] [] ) () 0)] [] [] () ) (Print 0 () [(String "func1" ()) (FuncCallOrArray int [] [(() (FuncCallOrArray pp2 [(c1 [])] [] [] [] [] ) () 0)] [] [] [] )] () ) (Print 0 () [(String "func2" ()) (FuncCallOrArray pp3 [(c1 [])] [(() (FuncCallOrArray Base [] [(() 5 () 0)] [] [] [] ) () 0)] [] [] [] )] () )] [] )] ) lfortran-0.63.0/tests/reference/ast-do_concurrent1-5fba0ee.json0000664000175000017500000000073715174404631024541 0ustar alastairalastair{ "basename": "ast-do_concurrent1-5fba0ee", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do_concurrent1.f90", "infile_hash": "455e5c83afb64c2316e774aadd27b3dbc48f7ee10948365b50d4e90f", "outfile": null, "outfile_hash": null, "stdout": "ast-do_concurrent1-5fba0ee.stdout", "stdout_hash": "10ac626ff924b2b7921c4bceaca4993b43897e130f39d66a0d89d947", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-types_02-48df0cb.stdout0000664000175000017500000000531115174404631023552 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 f32) i32.const 1 local.set 0 f32.const 1.000000 local.set 1 local.get 0 f32.convert_i32_s local.set 1 i32.const 0 call 0 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-0.63.0/tests/reference/ast-string_02-604c7cc.stdout0000664000175000017500000000470715174404631023637 0ustar alastairalastair(TranslationUnit [(Program string_02 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeCharacter [(len 15 Value)] () () None ) [] [(surname [] [] () () None ()) (firstname [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len 6 Value)] () () None ) [] [(title [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len 25 Value)] () () None ) [] [(greetings [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 title (String "Mr. " ()) () ) (Assignment 0 firstname (String "Rowan " ()) () ) (Assignment 0 surname (String "Atkinson" ()) () ) (Assignment 0 greetings (String "A big hello from Mr. Bean" ()) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [(String "Here is " ()) title firstname surname] () ) (Print 0 () [greetings] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/wat-wasm_bind_js-d9f341f.json0000664000175000017500000000071415174404631024123 0ustar alastairalastair{ "basename": "wat-wasm_bind_js-d9f341f", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/wasm_bind_js.f90", "infile_hash": "e26eef4b7e209dcce2ee67f743a603d31dacb3a2f880959d0520ab0b", "outfile": null, "outfile_hash": null, "stdout": "wat-wasm_bind_js-d9f341f.stdout", "stdout_hash": "f8931d739d3d15c5609c413d1b5281a677ff5825751ee9fc9c296062", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_global_stmts-global_scope2-64078e2.stdout0000664000175000017500000000332115174404631027331 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. )] () Public .false. .false. () ), x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) [] ) lfortran-0.63.0/tests/reference/julia-case_03-b4597f9.stdout0000664000175000017500000000101715174404631023511 0ustar alastairalastairfunction main() local a::Int32 = 1 local b::Int32 = 2 local marks::Int32 marks = 94 if marks ≥ 40 + b println("Pass!") elseif marks ≤ 39 - a println("Failed!") else println("Invalid marks") end println("Your marks are ", " ", marks) marks = -1 if marks ≥ 40 + b println("Pass!") elseif 0 ≤ marks ≤ 39 - a println("Failed!") else println("Invalid marks") end println("Your marks are ", " ", marks) end main() lfortran-0.63.0/tests/reference/julia-goto_01-f5b96fb.stdout0000664000175000017500000000015515174404631023700 0ustar alastairalastairfunction main() local a::Int32 a = 5 @goto label_1 @label label_1 println(a) end main() lfortran-0.63.0/tests/reference/asr-bits_01-2906c1d.json0000664000175000017500000000073715174404631022634 0ustar alastairalastair{ "basename": "asr-bits_01-2906c1d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bits_01.f90", "infile_hash": "4fdd6c630a9f2559417372a42cca1dc1c98fa7af4e4a5442ebf9ca96", "outfile": null, "outfile_hash": null, "stdout": "asr-bits_01-2906c1d.stdout", "stdout_hash": "cc11fd2915ee4a4307628d44a5216f208a71ff481cb5cf96019dcd4a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-end_sub_name-b8abc97.json0000664000175000017500000000074015174404631024153 0ustar alastairalastair{ "basename": "asr-end_sub_name-b8abc97", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/end_sub_name.f90", "infile_hash": "e009a66d5776bac360c38e64071c0d20593c8162a0c40cbf5bf4e5c2", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-end_sub_name-b8abc97.stderr", "stderr_hash": "8ae9de8fb9af77931f3d42b61fe8c02ed1ae3c97af115ef36c01cfec", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-block_data1-d563f39.stdout0000664000175000017500000000600115174404631024113 0ustar alastairalastair(TranslationUnit [(BlockData init (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Implicit [(ImplicitSpec (AttrType TypeInteger [] () () None ) [(LetterSpec a z )] )] () )] [(Declaration () [(AttrCommon [(range [(x0 [] [] () x0 None ()) (x1 [] [] () x1 None ())])] )] [] () )] [(DataStmt 0 [(DataStmtSet [x0 x1] [1 10] )] () )] ) (Program block_data1 () [] [(Implicit [(ImplicitSpec (AttrType TypeInteger [] () () None ) [(LetterSpec a z )] )] () )] [(Declaration () [(AttrCommon [(range [(x0 [] [] () x0 None ()) (x1 [] [] () x1 None ())])] )] [] () )] [(Print 0 () [(String "Printing Even number in the Range: " ()) x0 (String " to " ()) x1] () ) (DoLoop 0 () 0 i x0 x1 () [(If 0 () (/= (FuncCallOrArray mod [] [(() i () 0) (() 2 () 0)] [] [] [] ) 0) [(Cycle 0 () () )] [] () () () ) (Write 0 [(()) (())] [] [i] () )] () () )] [] )] ) lfortran-0.63.0/tests/reference/julia-arrays_03_func-7271066.json0000664000175000017500000000075515174404631024374 0ustar alastairalastair{ "basename": "julia-arrays_03_func-7271066", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/arrays_03_func.f90", "infile_hash": "9feab893fd240821f352bd8b0c12cb132cf39c706950d08f5a41cc54", "outfile": null, "outfile_hash": null, "stdout": "julia-arrays_03_func-7271066.stdout", "stdout_hash": "36668a9b901903a1f4bdf1ca84002218176776fbfd1b58563b5fbde4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-global_scope3-45d8bdc.json0000664000175000017500000000073415174404631024253 0ustar alastairalastair{ "basename": "ast-global_scope3-45d8bdc", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/global_scope3.f90", "infile_hash": "60cea65abfbb2228d16f175ea192462ae2379d7a9da1601cb3de9f3a", "outfile": null, "outfile_hash": null, "stdout": "ast-global_scope3-45d8bdc.stdout", "stdout_hash": "a4607a718fd06859a1e6c80fa4f797a17bd2900ba09788612fd76d33", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_35-5fba3e7.stdout0000664000175000017500000004764015174404631024073 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { m_cli2_21: (Module (SymbolTable 2 { get_args_fixed_length_a_array: (Function (SymbolTable 3 { place: (Variable 3 place [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), strings: (Variable 3 strings [] Unspecified () () Default (Allocatable (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), strings_a: (Variable 3 strings_a [] Local () () Default (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_args_fixed_length_a_array (FunctionType [(Allocatable (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 strings)] [(Allocate [((Var 3 strings_a) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] (IntegerConstant 5 (Integer 4) Decimal) () (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString))] () () () ) (If () (IntegerCompare (Var 3 place) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(If () (IntegerCompare (StringLen (ArrayItem (Var 3 strings_a) [(() (ArrayBound (Var 3 strings_a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () DeferredLength DescriptorString) ColMajor () ) (Integer 4) () ) LtE (StringLen (ArrayItem (Var 3 strings) [(() (ArrayBound (Var 3 strings) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () AssumedLength DescriptorString) ColMajor () ) (Integer 4) () ) (Logical 4) () ) [(Assignment (Var 3 strings) (Var 3 strings_a) () .false. .false. )] [(Assignment (Var 3 strings) (ArrayConstructor [] (Array (String 1 (StringLen (ArrayItem (Var 3 strings) [(() (ArrayBound (Var 3 strings) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () AssumedLength DescriptorString) ColMajor () ) (Integer 4) () ) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] PointerArray ) () ColMajor () ) () .false. .false. )] )] [] ) (If () (IntegerCompare (Var 3 place) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 3 strings) (ArrayConstructor [] (Array (String 1 (StringLen (ArrayItem (Var 3 strings) [(() (ArrayBound (Var 3 strings) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () AssumedLength DescriptorString) ColMajor () ) (Integer 4) () ) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] PointerArray ) () ColMajor () ) () .false. .false. )] [] )] () Public .true. .true. () ) }) m_cli2_21 () [] .false. .false. .false. ), modules_35: (Program (SymbolTable 4 { get_args_fixed_length_a_array: (ExternalSymbol 4 get_args_fixed_length_a_array 2 get_args_fixed_length_a_array m_cli2_21 [] get_args_fixed_length_a_array Public ), string: (Variable 4 string [] Local () () Default (Allocatable (Array (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) modules_35 [m_cli2_21] [(Allocate [((Var 4 string) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] () () ())] () () () ) (Print (StringConstant "executing modules_35" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (SubroutineCall 4 get_args_fixed_length_a_array () [((Var 4 string))] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-string_binop-415f1fa.stderr0000664000175000017500000000030515174404631024470 0ustar alastairalastairsemantic error: Binary numeric operators cannot be used on strings --> tests/errors/string_binop.f90:1:10 | 1 | print *, "a" + "b" | ^^^^^^^^^ help: use '//' for string concatenation lfortran-0.63.0/tests/reference/run-format_31-1180df5.stdout0000664000175000017500000000130615174404631023547 0ustar alastairalastair-------------------------------------------------------------------------------- value=4096, value(bits)=00000000000000000001000000000000 , trailz= 12 value= 1, value(bits)=00000000000000000000000000000001 , trailz= 0 00000000000000000001000000000000 0001000000000000 1000000000000 1000000000000 -------------------------------------------------------------------------------- value= 112, value(bits)=00000000000000000000000001110000 , trailz= 4 value= 7, value(bits)=00000000000000000000000000000111 , trailz= 0 00000000000000000001000000000000 0001000000000000 1000000000000 1000000000000 lfortran-0.63.0/tests/reference/ast-data_01-dc2d917.stdout0000664000175000017500000001763115174404631023245 0ustar alastairalastair(TranslationUnit [(Program data_01 () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ()) (td [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(y [] [] () () None ()) (z [] [] () () None ()) (c1 [(1 4 DimensionExpr)] [] () () None ()) (bf1 [] [] () () None ()) (xx90 [] [] () () None ()) (xx95 [] [] () () None ()) (b [] [] () () None ()) (p [] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [x td b] [1 4 3] )] () ) (DataStmt 0 [(DataStmtSet [y z] [(Real "2.0") (Real "3.0")] )] () ) (DataStmt 0 [(DataStmtSet [c1] [(Real "0.0") (Real "0.22") (u- (Real "0.14")) (u- (Real "0.21"))] )] () ) (DataStmt 0 [(DataStmtSet [bf1] [(Real "0.8")] ) (DataStmtSet [xx90 xx95] [(Real "0.55") (Real "0.62")] )] () ) (Print 0 () [x y z] () ) (If 0 () (/= x 1) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- y (Real "2.0")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- z (Real "3.0")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- (FuncCallOrArray c1 [] [(() 1 () 0)] [] [] [] ) (Real "0.0")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- (FuncCallOrArray c1 [] [(() 2 () 0)] [] [] [] ) (Real "0.22")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (> (FuncCallOrArray abs [] [(() (+ (FuncCallOrArray c1 [] [(() 4 () 0)] [] [] [] ) (Real "0.21")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- bf1 (Real "0.8")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- xx90 (Real "0.55")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- xx95 (Real "0.62")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () ) (Assignment 0 p (** b (- td 1)) () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- p (Real "27.0")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () )] [] )] ) lfortran-0.63.0/tests/reference/asr-types_14-79df2e1.stdout0000664000175000017500000000656015174404631023505 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), types_14: (Program (SymbolTable 2 { dp: (ExternalSymbol 2 dp 4 real64 lfortran_intrinsic_iso_fortran_env [] real64 Public ), r: (Variable 2 r [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s: (Variable 2 s [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) types_14 [iso_fortran_env] [(Assignment (Var 2 r) (RealConstant 1.000000 (Real 8) ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-continue_compilation_1-04b6d40.json0000664000175000017500000000101615174404631026017 0ustar alastairalastair{ "basename": "asr-continue_compilation_1-04b6d40", "cmd": "lfortran --semantics-only --continue-compilation --no-color {infile}", "infile": "tests/errors/continue_compilation_1.f90", "infile_hash": "112cd8bc2c463bf9679f92f039c52db9d626278461d3998736433346", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-continue_compilation_1-04b6d40.stderr", "stderr_hash": "f97c16a9fbce83ed245dbdc275233d6f213ccef310de7d3265cd6c58", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-modules_43-d01691f.stdout0000664000175000017500000007235215174404631023726 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_43: (Program (SymbolTable 5 { add_sources_from_dir: (ExternalSymbol 5 add_sources_from_dir 2 add_sources_from_dir modules_43_fpm_sources [] add_sources_from_dir Public ), sources: (Variable 5 sources [] Local () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 5 srcfile_t Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), srcfile_t: (ExternalSymbol 5 srcfile_t 2 srcfile_t modules_43_fpm_sources [] srcfile_t Public ) }) modules_43 [modules_43_fpm_sources] [(Allocate [((Var 5 sources) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] () () ())] () () () ) (SubroutineCall 5 add_sources_from_dir () [((Var 5 sources))] () .false. )] ), modules_43_fpm_sources: (Module (SymbolTable 2 { add_sources_from_dir: (Function (SymbolTable 4 { dir_sources: (Variable 4 dir_sources [] Local () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 srcfile_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), exclude_source: (Variable 4 exclude_source [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sources: (Variable 4 sources [] InOut () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 srcfile_t Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ) }) add_sources_from_dir (FunctionType [(Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) [(() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 sources)] [(Allocate [((Var 4 dir_sources) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] () () ())] () () () ) (If () (LogicalNot (IntrinsicImpureFunction Allocated [(Var 4 sources)] 0 (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 4 sources) (IntrinsicArrayFunction Pack [(Var 4 dir_sources) (ArrayPhysicalCast (LogicalNot (Var 4 exclude_source) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) () .false. .false. )] [(Assignment (Var 4 sources) (ArrayConstructor [(Var 4 sources) (IntrinsicArrayFunction Pack [(Var 4 dir_sources) (ArrayPhysicalCast (LogicalNot (Var 4 exclude_source) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () )] (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) ())] DescriptorArray ) ) () ColMajor () ) () .false. .false. )] )] () Public .true. .true. () ), srcfile_t: (Struct (SymbolTable 3 { digest: (Variable 3 digest [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), exe_name: (Variable 3 exe_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), file_name: (Variable 3 file_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) srcfile_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) [] [file_name exe_name digest] [] Source Public .false. .false. [] () () [] ) }) modules_43_fpm_sources () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-fixed_form1-7fa677f.stdout0000664000175000017500000012343415174404631024250 0ustar alastairalastair(TranslationUnit [(Subroutine dqawse [(f) (a) (b) (alfa) (beta) (integr) (epsabs) (epsrel) (limit) (result) (abserr) (neval) (ier) (alist) (blist) (rlist) (elist) (iord) (last)] [] () () [] [] [] [(Declaration (AttrType TypeDoublePrecision [] () () None ) [] [(a [] [] () () None ()) (abserr [] [] () () None ()) (alfa [] [] () () None ()) (alist [] [] () () None ()) (area [] [] () () None ()) (area1 [] [] () () None ()) (area12 [] [] () () None ()) (area2 [] [] () () None ()) (a1 [] [] () () None ()) (a2 [] [] () () None ()) (b [] [] () () None ()) (beta [] [] () () None ()) (blist [] [] () () None ()) (b1 [] [] () () None ()) (b2 [] [] () () None ()) (centre [] [] () () None ()) (dabs [] [] () () None ()) (dmax1 [] [] () () None ()) (d1mach [] [] () () None ()) (elist [] [] () () None ()) (epmach [] [] () () None ()) (epsabs [] [] () () None ()) (epsrel [] [] () () None ()) (errbnd [] [] () () None ()) (errmax [] [] () () None ()) (error1 [] [] () () None ()) (erro12 [] [] () () None ()) (error2 [] [] () () None ()) (errsum [] [] () () None ()) (f [] [] () () None ()) (resas1 [] [] () () None ()) (resas2 [] [] () () None ()) (result [] [] () () None ()) (rg [] [] () () None ()) (rh [] [] () () None ()) (ri [] [] () () None ()) (rj [] [] () () None ()) (rlist [] [] () () None ()) (uflow [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(ier [] [] () () None ()) (integr [] [] () () None ()) (iord [] [] () () None ()) (iroff1 [] [] () () None ()) (iroff2 [] [] () () None ()) (k [] [] () () None ()) (last [] [] () () None ()) (limit [] [] () () None ()) (maxerr [] [] () () None ()) (nev [] [] () () None ()) (neval [] [] () () None ()) (nrmax [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrExternal )] [(f [] [] () () None ())] () ) (Declaration () [(AttrDimension [] )] [(alist [(1 limit DimensionExpr)] [] () () None ()) (blist [(1 limit DimensionExpr)] [] () () None ()) (rlist [(1 limit DimensionExpr)] [] () () None ()) (elist [(1 limit DimensionExpr)] [] () () None ()) (iord [(1 limit DimensionExpr)] [] () () None ()) (ri [(1 25 DimensionExpr)] [] () () None ()) (rj [(1 25 DimensionExpr)] [] () () None ()) (rh [(1 25 DimensionExpr)] [] () () None ()) (rg [(1 25 DimensionExpr)] [] () () None ())] () )] [(Assignment 0 epmach (FuncCallOrArray d1mach [] [(() 4 () 0)] [] [] [] ) () ) (Assignment 0 uflow (FuncCallOrArray d1mach [] [(() 1 () 0)] [] [] [] ) () ) (Assignment 0 ier 6 () ) (Assignment 0 neval 0 () ) (Assignment 0 last 0 () ) (Assignment 0 (FuncCallOrArray rlist [] [(() 1 () 0)] [] [] [] ) (Real "0.0d+00") () ) (Assignment 0 (FuncCallOrArray elist [] [(() 1 () 0)] [] [] [] ) (Real "0.0d+00") () ) (Assignment 0 (FuncCallOrArray iord [] [(() 1 () 0)] [] [] [] ) 0 () ) (Assignment 0 result (Real "0.0d+00") () ) (Assignment 0 abserr (Real "0.0d+00") () ) (If 0 () (BoolOp (BoolOp (BoolOp (BoolOp (BoolOp (BoolOp (<= b a) Or (BoolOp (== epsabs (Real "0.0d+00")) And (< epsrel (FuncCallOrArray dmax1 [] [(() (* (Real "0.5d+02") epmach) () 0) (() (Real "0.5d-28") () 0)] [] [] [] )) ) ) Or (<= alfa (u- (Real "0.1d+01"))) ) Or (<= beta (u- (Real "0.1d+01"))) ) Or (< integr 1) ) Or (> integr 4) ) Or (< limit 2) ) [(GoTo 0 () 999 [] () )] [] () () () ) (Assignment 0 ier 0 () ) (SubroutineCall 0 dqmomo [] [(() alfa () 0) (() beta () 0) (() ri () 0) (() rj () 0) (() rg () 0) (() rh () 0) (() integr () 0)] [] [] () ) (Assignment 0 centre (* (Real "0.5d+00") (+ b a)) () ) (SubroutineCall 0 dqc25s [] [(() f () 0) (() a () 0) (() b () 0) (() a () 0) (() centre () 0) (() alfa () 0) (() beta () 0) (() ri () 0) (() rj () 0) (() rg () 0) (() rh () 0) (() area1 () 0) (() error1 () 0) (() resas1 () 0) (() integr () 0) (() nev () 0)] [] [] () ) (Assignment 0 neval nev () ) (SubroutineCall 0 dqc25s [] [(() f () 0) (() a () 0) (() b () 0) (() centre () 0) (() b () 0) (() alfa () 0) (() beta () 0) (() ri () 0) (() rj () 0) (() rg () 0) (() rh () 0) (() area2 () 0) (() error2 () 0) (() resas2 () 0) (() integr () 0) (() nev () 0)] [] [] () ) (Assignment 0 last 2 () ) (Assignment 0 neval (+ neval nev) () ) (Assignment 0 result (+ area1 area2) () ) (Assignment 0 abserr (+ error1 error2) () ) (Assignment 0 errbnd (FuncCallOrArray dmax1 [] [(() epsabs () 0) (() (* epsrel (FuncCallOrArray dabs [] [(() result () 0)] [] [] [] )) () 0)] [] [] [] ) () ) (If 0 () (> error2 error1) [(GoTo 0 () 10 [] () )] [] () () () ) (Assignment 0 (FuncCallOrArray alist [] [(() 1 () 0)] [] [] [] ) a () ) (Assignment 0 (FuncCallOrArray alist [] [(() 2 () 0)] [] [] [] ) centre () ) (Assignment 0 (FuncCallOrArray blist [] [(() 1 () 0)] [] [] [] ) centre () ) (Assignment 0 (FuncCallOrArray blist [] [(() 2 () 0)] [] [] [] ) b () ) (Assignment 0 (FuncCallOrArray rlist [] [(() 1 () 0)] [] [] [] ) area1 () ) (Assignment 0 (FuncCallOrArray rlist [] [(() 2 () 0)] [] [] [] ) area2 () ) (Assignment 0 (FuncCallOrArray elist [] [(() 1 () 0)] [] [] [] ) error1 () ) (Assignment 0 (FuncCallOrArray elist [] [(() 2 () 0)] [] [] [] ) error2 () ) (GoTo 0 () 20 [] () ) (Assignment 10 (FuncCallOrArray alist [] [(() 1 () 0)] [] [] [] ) centre () ) (Assignment 0 (FuncCallOrArray alist [] [(() 2 () 0)] [] [] [] ) a () ) (Assignment 0 (FuncCallOrArray blist [] [(() 1 () 0)] [] [] [] ) b () ) (Assignment 0 (FuncCallOrArray blist [] [(() 2 () 0)] [] [] [] ) centre () ) (Assignment 0 (FuncCallOrArray rlist [] [(() 1 () 0)] [] [] [] ) area2 () ) (Assignment 0 (FuncCallOrArray rlist [] [(() 2 () 0)] [] [] [] ) area1 () ) (Assignment 0 (FuncCallOrArray elist [] [(() 1 () 0)] [] [] [] ) error2 () ) (Assignment 0 (FuncCallOrArray elist [] [(() 2 () 0)] [] [] [] ) error1 () ) (Assignment 20 (FuncCallOrArray iord [] [(() 1 () 0)] [] [] [] ) 1 () ) (Assignment 0 (FuncCallOrArray iord [] [(() 2 () 0)] [] [] [] ) 2 () ) (If 0 () (== limit 2) [(Assignment 0 ier 1 () )] [] () () () ) (If 0 () (BoolOp (<= abserr errbnd) Or (== ier 1) ) [(GoTo 0 () 999 [] () )] [] () () () ) (Assignment 0 errmax (FuncCallOrArray elist [] [(() 1 () 0)] [] [] [] ) () ) (Assignment 0 maxerr 1 () ) (Assignment 0 nrmax 1 () ) (Assignment 0 area result () ) (Assignment 0 errsum abserr () ) (Assignment 0 iroff1 0 () ) (Assignment 0 iroff2 0 () ) (DoLoop 0 () 60 last 3 limit () [(Assignment 0 a1 (FuncCallOrArray alist [] [(() maxerr () 0)] [] [] [] ) () ) (Assignment 0 b1 (* (Real "0.5d+00") (+ (FuncCallOrArray alist [] [(() maxerr () 0)] [] [] [] ) (FuncCallOrArray blist [] [(() maxerr () 0)] [] [] [] ))) () ) (Assignment 0 a2 b1 () ) (Assignment 0 b2 (FuncCallOrArray blist [] [(() maxerr () 0)] [] [] [] ) () ) (SubroutineCall 0 dqc25s [] [(() f () 0) (() a () 0) (() b () 0) (() a1 () 0) (() b1 () 0) (() alfa () 0) (() beta () 0) (() ri () 0) (() rj () 0) (() rg () 0) (() rh () 0) (() area1 () 0) (() error1 () 0) (() resas1 () 0) (() integr () 0) (() nev () 0)] [] [] () ) (Assignment 0 neval (+ neval nev) () ) (SubroutineCall 0 dqc25s [] [(() f () 0) (() a () 0) (() b () 0) (() a2 () 0) (() b2 () 0) (() alfa () 0) (() beta () 0) (() ri () 0) (() rj () 0) (() rg () 0) (() rh () 0) (() area2 () 0) (() error2 () 0) (() resas2 () 0) (() integr () 0) (() nev () 0)] [] [] () ) (Assignment 0 neval (+ neval nev) () ) (Assignment 0 area12 (+ area1 area2) () ) (Assignment 0 erro12 (+ error1 error2) () ) (Assignment 0 errsum (- (+ errsum erro12) errmax) () ) (Assignment 0 area (- (+ area area12) (FuncCallOrArray rlist [] [(() maxerr () 0)] [] [] [] )) () ) (If 0 () (BoolOp (== a a1) Or (== b b2) ) [(GoTo 0 () 30 [] () )] [] () () () ) (If 0 () (BoolOp (== resas1 error1) Or (== resas2 error2) ) [(GoTo 0 () 30 [] () )] [] () () () ) (If 0 () (BoolOp (< (FuncCallOrArray dabs [] [(() (- (FuncCallOrArray rlist [] [(() maxerr () 0)] [] [] [] ) area12) () 0)] [] [] [] ) (* (Real "0.1d-04") (FuncCallOrArray dabs [] [(() area12 () 0)] [] [] [] ))) And (>= erro12 (* (Real "0.99d+00") errmax)) ) [(Assignment 0 iroff1 (+ iroff1 1) () )] [] () () () ) (If 0 () (BoolOp (> last 10) And (> erro12 errmax) ) [(Assignment 0 iroff2 (+ iroff2 1) () )] [] () () () ) (Assignment 30 (FuncCallOrArray rlist [] [(() maxerr () 0)] [] [] [] ) area1 () ) (Assignment 0 (FuncCallOrArray rlist [] [(() last () 0)] [] [] [] ) area2 () ) (Assignment 0 errbnd (FuncCallOrArray dmax1 [] [(() epsabs () 0) (() (* epsrel (FuncCallOrArray dabs [] [(() area () 0)] [] [] [] )) () 0)] [] [] [] ) () ) (If 0 () (<= errsum errbnd) [(GoTo 0 () 35 [] () )] [] () () () ) (If 0 () (== last limit) [(Assignment 0 ier 1 () )] [] () () () ) (If 0 () (BoolOp (>= iroff1 6) Or (>= iroff2 20) ) [(Assignment 0 ier 2 () )] [] () () () ) (If 0 () (<= (FuncCallOrArray dmax1 [] [(() (FuncCallOrArray dabs [] [(() a1 () 0)] [] [] [] ) () 0) (() (FuncCallOrArray dabs [] [(() b2 () 0)] [] [] [] ) () 0)] [] [] [] ) (* (+ (Real "0.1d+01") (* (Real "0.1d+03") epmach)) (+ (FuncCallOrArray dabs [] [(() a2 () 0)] [] [] [] ) (* (Real "0.1d+04") uflow)))) [(Assignment 0 ier 3 () )] [] () () () ) (If 35 () (> error2 error1) [(GoTo 0 () 40 [] () )] [] () () () ) (Assignment 0 (FuncCallOrArray alist [] [(() last () 0)] [] [] [] ) a2 () ) (Assignment 0 (FuncCallOrArray blist [] [(() maxerr () 0)] [] [] [] ) b1 () ) (Assignment 0 (FuncCallOrArray blist [] [(() last () 0)] [] [] [] ) b2 () ) (Assignment 0 (FuncCallOrArray elist [] [(() maxerr () 0)] [] [] [] ) error1 () ) (Assignment 0 (FuncCallOrArray elist [] [(() last () 0)] [] [] [] ) error2 () ) (GoTo 0 () 50 [] () ) (Assignment 40 (FuncCallOrArray alist [] [(() maxerr () 0)] [] [] [] ) a2 () ) (Assignment 0 (FuncCallOrArray alist [] [(() last () 0)] [] [] [] ) a1 () ) (Assignment 0 (FuncCallOrArray blist [] [(() last () 0)] [] [] [] ) b1 () ) (Assignment 0 (FuncCallOrArray rlist [] [(() maxerr () 0)] [] [] [] ) area2 () ) (Assignment 0 (FuncCallOrArray rlist [] [(() last () 0)] [] [] [] ) area1 () ) (Assignment 0 (FuncCallOrArray elist [] [(() maxerr () 0)] [] [] [] ) error2 () ) (Assignment 0 (FuncCallOrArray elist [] [(() last () 0)] [] [] [] ) error1 () ) (SubroutineCall 50 dqpsrt [] [(() limit () 0) (() last () 0) (() maxerr () 0) (() errmax () 0) (() elist () 0) (() iord () 0) (() nrmax () 0)] [] [] () ) (If 0 () (BoolOp (/= ier 0) Or (<= errsum errbnd) ) [(GoTo 0 () 70 [] () )] [] () () () ) (Continue 60 () )] () () ) (Assignment 70 result (Real "0.0d+00") () ) (DoLoop 0 () 80 k 1 last () [(Assignment 0 result (+ result (FuncCallOrArray rlist [] [(() k () 0)] [] [] [] )) () ) (Continue 80 () )] () () ) (Assignment 0 abserr errsum () ) (Return 999 () () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-arrays_01-5f1c776.json0000664000175000017500000000074515174404631023205 0ustar alastairalastair{ "basename": "asr-arrays_01-5f1c776", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01.f90", "infile_hash": "f7df4142feb383f836dfa072a60673922e8873b5695f893be8329b89", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_01-5f1c776.stdout", "stdout_hash": "46d404fbfb2d7ab50388f3d31a2e0b589f3ed5857e52e1284a07c8b4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-case_03-e03f722.json0000664000175000017500000000073715174404631022610 0ustar alastairalastair{ "basename": "asr-case_03-e03f722", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_03.f90", "infile_hash": "4fc1bb48b2136f22bb44b7c69aaa05a43b4ed2e4b8464c433340295d", "outfile": null, "outfile_hash": null, "stdout": "asr-case_03-e03f722.stdout", "stdout_hash": "bf43e4461240f73e66a0fff67adf0168b4bf81f774b3d5cf94b2cc99", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_openmp-pragma1-f8a3fde.json0000664000175000017500000000074115174404631024526 0ustar alastairalastair{ "basename": "ast_openmp-pragma1-f8a3fde", "cmd": "lfortran --show-ast --no-color --openmp {infile} -o {outfile}", "infile": "tests/pragma1.f90", "infile_hash": "0b9eea06186cb7eb1866b55256263d4e562835c40920f35b92ed18ee", "outfile": null, "outfile_hash": null, "stdout": "ast_openmp-pragma1-f8a3fde.stdout", "stdout_hash": "5fe83e4aa643e6315c760999d691cf2c8e2d454961a668974dbbd005", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_interface4-034a306.stdout0000664000175000017500000002767715174404631025606 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { driver: (Function (SymbolTable 2 { driver2: (Function (SymbolTable 4 { }) driver2 (FunctionType [(FunctionType [(Integer 4) (Real 4) (Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 f)] [] () Public .false. .false. () ), f: (Function (SymbolTable 3 { f_arg_0: (Variable 3 f_arg_0 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f_arg_1: (Variable 3 f_arg_1 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f_arg_2: (Variable 3 f_arg_2 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Integer 4) (Real 4) (Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 f_arg_0) (Var 3 f_arg_1) (Var 3 f_arg_2)] [] () Public .false. .false. () ), i: (Variable 2 i [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) driver (FunctionType [(Real 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 f) (Var 2 n)] [(SubroutineCall 2 f () [((Var 2 n)) ((Var 2 i)) ((Var 2 j))] () .false. ) (SubroutineCall 2 driver2 () [((Var 2 f))] () .false. )] () Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-dim_assgn_test-2643606.json0000664000175000017500000000107515174404631024234 0ustar alastairalastair{ "basename": "asr-dim_assgn_test-2643606", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/warnings/dim_assgn_test.f90", "infile_hash": "1aa9b8592b310c0a601a031ae7716b75aea5ee9f31645db207e99bee", "outfile": null, "outfile_hash": null, "stdout": "asr-dim_assgn_test-2643606.stdout", "stdout_hash": "7041d783fc2861a488d0650da9064fbd3888b6d5de74a6b8865e4fd6", "stderr": "asr-dim_assgn_test-2643606.stderr", "stderr_hash": "7f0949fe00196320d96335fc4ef87d1dfb2831ecbc544435e0b7f2ed", "returncode": 0 }lfortran-0.63.0/tests/reference/fortran-real_to_integer_cast_fortran_codegen-d0b1495.stdout0000664000175000017500000000043415174404631032217 0ustar alastairalastairprogram implicitrealtointcastexample implicit none integer(4) :: integervalue real(4) :: realnumber realnumber = 3.14000010e+00 integervalue = int(realnumber, kind=4) print *, "Real Number:", realnumber print *, "Integer Value:", integervalue end program implicitrealtointcastexample lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor18-618bfdc.stdout0000664000175000017500000000257015174404631027252 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor18: (Program (SymbolTable 2 { y: (Variable 2 y [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) preprocessor18 [] [] ) }) [] ) lfortran-0.63.0/tests/reference/asr-common1-bbe229a.json0000664000175000017500000000072115174404631023073 0ustar alastairalastair{ "basename": "asr-common1-bbe229a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/common1.f90", "infile_hash": "8f3a2e387c1b0481198ba4f773ea74e1bed5023a9fb121822a194e6e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-common1-bbe229a.stderr", "stderr_hash": "3cc7683d6060350e6774028f82341d10b6efd92fc722e7b5f71630cb", "returncode": 2 }lfortran-0.63.0/tests/reference/julia-subroutines_02-8f01adf.stdout0000664000175000017500000000200615174404631025276 0ustar alastairalastairfunction f(a::Int32, b::Base.RefValue{Int32}) b[] = a + 1 end function g(a::Int32, b::Base.RefValue{Int32}) b[] = a - 1 end function h(a::Int32, b::Base.RefValue{Int32}) g(a, b) end function main() local i::Int32 local j::Int32 i = 1 j = 1 __j_ref__= Ref(j) f(i, __j_ref__) j = __j_ref__[] println(i, " ", j) if i ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end if j ≠ 2 println(Base.stderr, "ERROR STOP") exit(1) end __j_ref__= Ref(j) g(i, __j_ref__) j = __j_ref__[] println(i, " ", j) if i ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end if j ≠ 0 println(Base.stderr, "ERROR STOP") exit(1) end __j_ref__= Ref(j) h(i, __j_ref__) j = __j_ref__[] println(i, " ", j) if i ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end if j ≠ 0 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-0.63.0/tests/reference/ast-subroutine1-fdc40b3.json0000664000175000017500000000072615174404631024010 0ustar alastairalastair{ "basename": "ast-subroutine1-fdc40b3", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine1.f90", "infile_hash": "e209c22328b423e75d6801f3c0ef19bc120936196435dff2cb19df31", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine1-fdc40b3.stdout", "stdout_hash": "522465bcf29ea6cee23fd91313c1d21c73a291d11690341df76680ca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_07-240b0d5.stdout0000664000175000017500000001713615174404631024430 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_07: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dp: (Variable 2 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sp: (Variable 2 sp [] Local (TypeInquiry Kind (Real 4) (RealConstant 0.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sp2: (Variable 2 sp2 [] Local (TypeInquiry Kind (Real 4) (RealConstant 0.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_07 [] [(Assignment (Var 2 a) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 b) (Cast (Var 2 a) RealToReal (Real 8) () () ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/run-print3-b6beca0.stdout0000664000175000017500000000004215174404631023401 0ustar alastairalastair x is 24 x is 24 ok ok lfortran-0.63.0/tests/reference/asr-implicit_interface3-4503c6d.json0000664000175000017500000000102515174404631025277 0ustar alastairalastair{ "basename": "asr-implicit_interface3-4503c6d", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/implicit_interface3.f90", "infile_hash": "6914373182ded05c9b4169762408bc670588735da361b66e2e7cfc2c", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_interface3-4503c6d.stdout", "stdout_hash": "47f3a987f0898b45109c82c2ad23bfc93b146d1e58e547b46d1bdc6e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-assign_to1-e0b6dcb.json0000664000175000017500000000075115174404631023655 0ustar alastairalastair{ "basename": "ast-assign_to1-e0b6dcb", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/assign_to1.f", "infile_hash": "9dbe8770330acd15438625f1425b45ce1f593b85ba08bc96601b1ddd", "outfile": null, "outfile_hash": null, "stdout": "ast-assign_to1-e0b6dcb.stdout", "stdout_hash": "875a120cceb0cdf1fba755f101bf72b2be5e73c537a021c671587708", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-arrays_05-f639a33.json0000664000175000017500000000073615174404631023524 0ustar alastairalastair{ "basename": "julia-arrays_05-f639a33", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/arrays_05.f90", "infile_hash": "09eac1191b2e8a76fafedf1307b2d1240ffbc5f632c08afa847df805", "outfile": null, "outfile_hash": null, "stdout": "julia-arrays_05-f639a33.stdout", "stdout_hash": "c610b43606aff8e273a85df76f3bb842651b5613e1fa718c57ee8ce6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-string_02-bc2a3b9.stdout0000664000175000017500000001561415174404631023710 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_02: (Program (SymbolTable 2 { firstname: (Variable 2 firstname [] Local () () Default (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), greetings: (Variable 2 greetings [] Local () () Default (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), surname: (Variable 2 surname [] Local () () Default (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), title: (Variable 2 title [] Local () () Default (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_02 [] [(Assignment (Var 2 title) (StringConstant "Mr. " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 firstname) (StringConstant "Rowan " (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 surname) (StringConstant "Atkinson" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 greetings) (StringConstant "A big hello from Mr. Bean" (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Here is " (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 title) (Var 2 firstname) (Var 2 surname)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (Var 2 greetings) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-intrinsics5-1cd2db1.stderr0000664000175000017500000000025015174404631024315 0ustar alastairalastairsemantic error: Kind of all the arguments of Ior must be the same --> tests/errors/intrinsics5.f90:2:14 | 2 | print *, ior(1, 1_8) | ^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-loop_test4-17c3803.stdout0000664000175000017500000001524115174404631023756 0ustar alastairalastair(TranslationUnit [(Program test () [] [] [] [(DoLoop 0 () 240 k (- (+ 1 (/ 1 2)) (** 3 4)) mp () [(Assignment 0 (FuncCallOrArray con [] [(() k () 0)] [] [] [] ) (u- (FuncCallOrArray datmat [] [(() k () 0) (() np () 0)] [] [] [] )) () ) (DoLoop 0 () 220 j (/ (FuncCallOrArray f [] [] [] [] [] ) 2) n () [(Assignment 220 (FuncCallOrArray w [] [(() j () 0)] [] [] [] ) (+ (FuncCallOrArray datmat [] [(() k () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray con [] [(() k () 0)] [] [] [] )) () )] () () ) (DoLoop 0 () 240 i (/ (FuncCallOrArray f [] [(() 2 () 0) (() 3 () 0)] [(x 5) (z (String "o\"k'(" ()))] [] [] ) 2) n () [(Assignment 0 temp (Real "0.0d0") () ) (DoLoop 0 () 230 j (+ (+ (+ 1 2) (/ (+ 1 3) 4)) (FuncCallOrArray f [] [(() (+ 3 2) () 0)] [(k (+ 4 (FuncCallOrArray sum [] [(() (FuncCallOrArray a [] [(() () 1 0) (() () 1 0) (() () 1 0) (() 4 () 0)] [] [] [] ) () 0)] [] [] [] )))] [] [] )) n () [(Assignment 230 temp (+ temp (* (FuncCallOrArray w [] [(() j () 0)] [] [] [] ) (FuncCallOrArray simi [] [(() j () 0) (() i () 0)] [] [] [] ))) () )] () () ) (If 0 () (== k mp) [(Assignment 0 temp (u- temp) () )] [] () () () ) (Assignment 240 (FuncCallOrArray a [] [(() i () 0) (() k () 0)] [] [] [] ) temp () )] () () )] () () )] [] )] ) lfortran-0.63.0/tests/reference/llvm-binop_03-d0adef1.stdout0000664000175000017500000001513015174404631023747 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I8\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"R8\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc2 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca i64, align 8 %y = alloca double, align 8 store i64 665663010, i64* %x, align 8 %3 = load i64, i64* %x, align 8 %simplified_pow_operation = mul i64 %3, %3 store i64 %simplified_pow_operation, i64* %x, align 8 %4 = alloca i64, align 8 %5 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %4, i32 0, i32 0, i32 0, i32 0, i32 0, i64* %x) %6 = load i64, i64* %4, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %5, i8** %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %6, i64* %8, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %10 = load i8*, i8** %9, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %12 = load i64, i64* %11, align 8 %13 = trunc i64 %12 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %10, i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %14 = icmp eq i8* %5, null br i1 %14, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %5) br label %free_done free_done: ; preds = %free_nonnull, %.entry %15 = load i64, i64* %x, align 8 %16 = icmp ne i64 %15, 443107242882260100 br i1 %16, label %then, label %else then: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %free_done br label %ifcont ifcont: ; preds = %else, %then store double 0x41C3D69B11000000, double* %y, align 8 %17 = load double, double* %y, align 8 %simplified_pow_operation1 = fmul double %17, %17 store double %simplified_pow_operation1, double* %y, align 8 %18 = alloca i64, align 8 %19 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %18, i32 0, i32 0, i32 0, i32 0, i32 0, double* %y) %20 = load i64, i64* %18, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0 store i8* %19, i8** %21, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 1 store i64 %20, i64* %22, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0 %24 = load i8*, i8** %23, align 8 %25 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 1 %26 = load i64, i64* %25, align 8 %27 = trunc i64 %26 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %24, i32 %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %28 = icmp eq i8* %19, null br i1 %28, label %free_done4, label %free_nonnull3 free_nonnull3: ; preds = %ifcont call void @_lfortran_free_alloc(i8* %2, i8* %19) br label %free_done4 free_done4: ; preds = %free_nonnull3, %ifcont %29 = load double, double* %y, align 8 %30 = fsub double %29, 0x439898EEC2459972 %31 = call double @llvm.fabs.f64(double %30) %32 = fcmp ogt double %31, 0x3BFD83C940000000 br i1 %32, label %then5, label %else6 then5: ; preds = %free_done4 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont7 else6: ; preds = %free_done4 br label %ifcont7 ifcont7: ; preds = %else6, %then5 br label %return return: ; preds = %ifcont7 br label %FINALIZE_SYMTABLE_binop_03 FINALIZE_SYMTABLE_binop_03: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) ; Function Attrs: nounwind readnone speculatable willreturn declare double @llvm.fabs.f64(double) #0 attributes #0 = { nounwind readnone speculatable willreturn } lfortran-0.63.0/tests/reference/asr-bindc4-22df995.json0000664000175000017500000000073415174404631022547 0ustar alastairalastair{ "basename": "asr-bindc4-22df995", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bindc4.f90", "infile_hash": "421dc94d9239b11a66352b4cd31b78bb82ad39b738ca161fe2192d35", "outfile": null, "outfile_hash": null, "stdout": "asr-bindc4-22df995.stdout", "stdout_hash": "23ca41f513e309dfbb63c01daae77ecf93b211fc25b1660d5442950f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-assign_to2-6015b09.stdout0000664000175000017500000000302415174404631023724 0ustar alastairalastair(TranslationUnit [(Program main () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (sum [] [] () () None ()) (ZERO [] [] () () None ())] () )] [(Assign 10 30 next () ) (Assignment 0 sum ZERO () ) (Assignment 0 i 1 () ) (GoTo 20 next () [30 50 70] () ) (If 30 () (< 0 1) [(GoTo 0 () 70 [] () )] [] () () () ) (Print 50 () [50] () ) (Assign 0 50 next () ) (Print 70 () [70] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-intrinsics_04-524ec3a.stdout0000664000175000017500000005144215174404631024511 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_04: (Program (SymbolTable 2 { dp: (ExternalSymbol 2 dp 4 real64 lfortran_intrinsic_iso_fortran_env [] real64 Public ), sp: (ExternalSymbol 2 sp 4 real32 lfortran_intrinsic_iso_fortran_env [] real32 Public ), x: (Variable 2 x [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_04 [iso_fortran_env] [(Assignment (Var 2 x) (RealConstant 1.500000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 x) (IntrinsicElementalFunction Tan [(Var 2 x)] 0 (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealConstant 14.101420 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (RealConstant 0.000000 (Real 8) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Tan [(RealConstant 1.500000 (Real 4) )] 0 (Real 4) (RealConstant 14.101420 (Real 4) ) ) Sub (RealConstant 14.101420 (Real 4) ) (Real 4) (RealConstant -0.000000 (Real 4) ) )] 0 (Real 4) (RealConstant 0.000000 (Real 4) ) ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Tan [(RealBinOp (Cast (IntrinsicElementalFunction Tan [(RealConstant 1.500000 (Real 4) )] 0 (Real 4) (RealConstant 14.101420 (Real 4) ) ) RealToReal (Real 8) (RealConstant 14.101420 (Real 8) ) () ) Add (IntrinsicElementalFunction Tan [(RealBinOp (Var 2 x) Add (IntrinsicElementalFunction Tan [(Var 2 x)] 0 (Real 8) () ) (Real 8) () )] 0 (Real 8) () ) (Real 8) () )] 0 (Real 8) () ) Sub (Cast (RealConstant 2.254825 (Real 4) ) RealToReal (Real 8) (RealConstant 2.254825 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000010 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000010 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 z) (ComplexConstructor (RealConstant 1.500000 (Real 8) ) (RealConstant 3.500000 (Real 8) ) (Complex 8) (ComplexConstant 1.500000 3.500000 (Complex 8) ) ) () .false. .false. ) (Assignment (Var 2 z) (IntrinsicElementalFunction Tan [(Var 2 z)] 0 (Complex 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Real [(Var 2 z)] 0 (Real 8) () ) Sub (RealConstant 0.000258 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (RealConstant 0.000000 (Real 8) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Real [(IntrinsicElementalFunction Tan [(ComplexConstructor (RealConstant 1.500000 (Real 4) ) (RealConstant 3.500000 (Real 4) ) (Complex 4) (ComplexConstant 1.500000 3.500000 (Complex 4) ) )] 0 (Complex 4) (ComplexConstant 0.000258 1.001807 (Complex 4) ) )] 0 (Real 4) (RealConstant 0.000258 (Real 4) ) ) Sub (RealConstant 0.000258 (Real 4) ) (Real 4) (RealConstant 0.000000 (Real 4) ) )] 0 (Real 4) (RealConstant 0.000000 (Real 4) ) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) Gt (RealConstant 0.000000 (Real 8) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Aimag [(Var 2 z)] 0 (Real 8) () ) Sub (RealConstant 1.001807 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (RealConstant 0.000000 (Real 8) ) (Logical 4) () ) [(ErrorStop () )] [] )] ), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env) }) [] ) lfortran-0.63.0/tests/reference/llvm-return_03-3f7087d.stdout0000664000175000017500000000704215174404631023760 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [12 x i8] c"early return" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([12 x i8], [12 x i8]* @string_const_data, i32 0, i32 0), i64 12 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [13 x i8] c"normal return" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([13 x i8], [13 x i8]* @string_const_data.1, i32 0, i32 0), i64 13 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @main.main_out = internal global i32 999 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.3 = private constant [12 x i8] c"main1 called" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([12 x i8], [12 x i8]* @string_const_data.3, i32 0, i32 0), i64 12 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @main1(i32* @main.main_out) %2 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %2, i32 12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } define void @main1(i32* %out_var) { .entry: %i = alloca i32, align 4 store i32 10, i32* %i, align 4 %0 = load i32, i32* %i, align 4 %1 = icmp sgt i32 %0, 5 br i1 %1, label %then, label %else then: ; preds = %.entry %2 = load i32, i32* %i, align 4 store i32 %2, i32* %out_var, align 4 %3 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %3, i32 12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %return unreachable_after_return: ; No predecessors! br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %unreachable_after_return %4 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %4, i32 13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %5 = load i32, i32* %i, align 4 store i32 %5, i32* %out_var, align 4 br label %return return: ; preds = %ifcont, %then br label %FINALIZE_SYMTABLE_main1 FINALIZE_SYMTABLE_main1: ; preds = %return ret void } declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/ast_f90-common1-ee77de6.stdout0000664000175000017500000000042515174404631024145 0ustar alastairalastairprogram common1 implicit real (a-z) real :: A, B common /sample/ A, B common /c/ c, /b/ d, e, f, /c/ g, h, i(5) common x, y, z(10) A = 10 B = 20 call pass() stop end program common1 subroutine pass() real :: A, B common /sample/ A, B print *, A, B return end subroutine pass lfortran-0.63.0/tests/reference/ast-program_02-2faf7cf.stdout0000664000175000017500000000271015174404631024135 0ustar alastairalastair(TranslationUnit [(Module program_02_mod (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [] [] [] ) (Program program_02 () [(Use [] program_02_mod [] .false. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [(Subroutine f1 [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) (Function f2 [] [(AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 f2 3 () )] [] [] )] )] ) lfortran-0.63.0/tests/reference/llvm-expr6-914a051.json0000664000175000017500000000070715174404631022535 0ustar alastairalastair{ "basename": "llvm-expr6-914a051", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/expr6.f90", "infile_hash": "722af2f789e614d9acf6975aae8260e4949a360066d5aa53a3f05944", "outfile": null, "outfile_hash": null, "stdout": "llvm-expr6-914a051.stdout", "stdout_hash": "8d9bac4bc2121dd065ef1e0e8ddd38e035922ff7112dd751e19ed9c4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-real_dp_01-e53c6fb.stdout0000664000175000017500000000540515174404631024201 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [9 x i8] c"R4,R8,R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %v = alloca double, align 8 %x = alloca float, align 4 %zero = alloca float, align 4 store float 0.000000e+00, float* %zero, align 4 store double 0x3FF0CCCCC0000000, double* %v, align 8 store float 0x3FF0CCCCC0000000, float* %x, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, float* %x, double* %v, float* %zero) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_real_dp_01 FINALIZE_SYMTABLE_real_dp_01: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-template_add_02-1dafc5f.stdout0000664000175000017500000021043215174404631025104 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_add_02: (Program (SymbolTable 13 { add_t: (ExternalSymbol 13 add_t 2 add_t template_add_02_m [] add_t Public ), func_arg_real: (ExternalSymbol 13 func_arg_real 2 func_arg_real template_add_02_m [] func_arg_real Public ), r: (ExternalSymbol 13 r 2 r template_add_02_m [] r Public ), test_template: (ExternalSymbol 13 test_template 2 test_template template_add_02_m [] test_template Public ), ~add: (ExternalSymbol 13 ~add 2 ~add template_add_02_m [] ~add Public ) }) template_add_02 [template_add_02_m] [(SubroutineCall 13 test_template () [] () .false. )] ), template_add_02_m: (Module (SymbolTable 2 { add_t: (Template (SymbolTable 5 { add_generic: (Function (SymbolTable 7 { x: (Variable 7 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 7 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 7 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_generic (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 7 x) (Var 7 y)] [(Assignment (Var 7 z) (FunctionCall 5 f () [((Var 7 x)) ((Var 7 y))] (TypeParameter t ) () () ) () .false. .false. )] (Var 7 z) Public .true. .true. () ), f: (Function (SymbolTable 6 { x: (Variable 6 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 6 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 6 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 6 x) (Var 6 y)] [] (Var 6 z) Private .true. .true. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_t [t f] [(Require r [t f] )] ), func_arg_int: (Function (SymbolTable 9 { x: (Variable 9 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 9 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 9 z [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) func_arg_int (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 x) (Var 9 y)] [(Assignment (Var 9 z) (IntegerBinOp (Var 9 x) Add (Var 9 y) (Integer 4) () ) () .false. .false. )] (Var 9 z) Private .true. .true. () ), func_arg_real: (Function (SymbolTable 8 { x: (Variable 8 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 8 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 8 z [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) func_arg_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 x) (Var 8 y)] [(Assignment (Var 8 z) (RealBinOp (Var 8 x) Add (Var 8 y) (Real 4) () ) () .false. .false. )] (Var 8 z) Private .true. .true. () ), r: (Requirement (SymbolTable 3 { f: (Function (SymbolTable 4 { x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 4 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 z) Private .true. .true. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) r [t f] [] ), test_template: (Function (SymbolTable 10 { add_real: (Function (SymbolTable 12 { x: (Variable 12 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 12 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 12 z [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~add_intrinsic] [(Var 12 x) (Var 12 y)] [(Assignment (Var 12 z) (FunctionCall 10 ~add_intrinsic () [((Var 12 x)) ((Var 12 y))] (Real 4) () () ) () .false. .false. )] (Var 12 z) Public .true. .true. () ), x: (Variable 10 x [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 10 y [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~add: (CustomOperator 10 ~add [10 ~add_intrinsic] Public ), ~add_intrinsic: (Function (SymbolTable 11 { arg0: (Variable 11 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 11 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 11 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 11 arg0) (Var 11 arg1)] [(Assignment (Var 11 ret) (RealBinOp (Var 11 arg0) Add (Var 11 arg1) (Real 4) () ) () .false. .false. )] (Var 11 ret) Public .true. .true. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 10 x) (RealConstant 5.100000 (Real 4) ) () .false. .false. ) (Assignment (Var 10 y) (RealConstant 7.200000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "The result is " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 10 add_real () [((Var 10 x)) ((Var 10 y))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (FunctionCall 10 add_real () [((Var 10 x)) ((Var 10 y))] (Real 4) () () ) Sub (RealConstant 12.300000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] () Public .false. .false. () ), ~add: (CustomOperator 2 ~add [2 func_arg_real] Public ) }) template_add_02_m () [template_add_02_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-assign_to2-127a642.json0000664000175000017500000000077215174404631023360 0ustar alastairalastair{ "basename": "asr-assign_to2-127a642", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/assign_to2.f90", "infile_hash": "a929e60f25d1d3c3b1ef485c7d9b5dca6f7bebcfffc66ed010f309d3", "outfile": null, "outfile_hash": null, "stdout": "asr-assign_to2-127a642.stdout", "stdout_hash": "9d3ee014761d14fe7020b704abeee54c3a2fe755be24427a3b6f35fe", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_06-8523892.json0000664000175000017500000000076115174404631023736 0ustar alastairalastair{ "basename": "asr-intrinsics_06-8523892", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_06.f90", "infile_hash": "c551ff5e24ea7b1b86a697b75ab52b3a9fb897ec0ff8d13f6a8afba5", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_06-8523892.stdout", "stdout_hash": "d1cf9102db04cb9d8e8bfa9c2b7e13a6919e259511324b8779302088", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_05-321b5d3.stderr0000664000175000017500000000033515174404631023334 0ustar alastairalastairsemantic error: Rank mismatch in array reference: the array `x` has rank `1`, but is referenced as rank `2` --> tests/errors/array_05.f90:12:14 | 12 | allocate(type_01%x(1, 2)) | ^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-do_concurrent_reduce2-1f96d95.stdout0000664000175000017500000000566615174404631026250 0ustar alastairalastair(TranslationUnit [(Subroutine sum_reduce [(a) (s) (t)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(s [] [] () () None ()) (t [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(N [] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 N (FuncCallOrArray size [] [(() a () 0)] [] [] [] ) () ) (Assignment 0 s 0 () ) (Assignment 0 t 0 () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () )] () [(ConcurrentReduce ReduceAdd [s t] )] [(Assignment 0 s (+ s (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () ) (Assignment 0 t (+ t (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () )] [] [] )] ) lfortran-0.63.0/tests/reference/ast_f90-implicit1-418fb10.stdout0000664000175000017500000000247515174404631024315 0ustar alastairalastairprogram implicit1 ! AST only implicit none implicit none implicit none implicit none (external) implicit none (type) implicit none (external, type) implicit none (type, external) implicit real (a-h,o-z) implicit real(dp) (a-h,o-z) implicit real(8) (a-h,o-z) implicit real(8) (a-h,o-z) implicit double precision (a-h,o-z) implicit character (c,o-z) implicit character(len=id) (a-z) implicit integer (i-n) implicit integer (i,j,k,l,m,n) implicit integer (i,j-l,m,n) implicit integer(dp) (a-h,o-z) implicit integer(8) (i,j-l,m,n) implicit integer (A,C) implicit integer(4) (C,D-x) implicit integer(4) (C,D-x) implicit logical (l,u-z) implicit logical(dp) (a-h,o-z) implicit logical(4) (l,u-z) implicit logical(4) (l,u-z) implicit complex (z) implicit complex(dp) (a-h,o-z) implicit complex (C) implicit complex(4) (z) implicit complex(4) (z) implicit type(BLOB) (A) implicit class(X) (A-b) implicit real(4) (a),real(4 + 4) (b),real(d) (d),real(d(2)) (a-z) implicit integer(4) (a),integer(4 + 4) (b),integer(d) (d),integer(d(2)) (a-z) implicit logical(4) (a),logical(4 + 4) (b),logical(d) (d),logical(d(2)) (a-z) implicit complex(4) (a),complex(4 + 4) (b),complex(d) (d),complex(d(2)) (a-z) implicit character(len=4, kind=c_char) (a) implicit character(len=4, kind=c_char) (a) implicit character(kind=c_char) (a) end program implicit1 lfortran-0.63.0/tests/reference/asr-logical3-b6316c6.stdout0000664000175000017500000003255315174404631023444 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { logical3: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) logical3 [] [(Assignment (Var 2 a) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (Assignment (Var 2 b) (LogicalConstant .false. (Logical 4) ) () .false. .false. ) (If () (LogicalBinOp (Var 2 a) And (Var 2 b) (Logical 4) () ) [(Print (StringConstant "Line 1 - Condition is true" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] [(Print (StringConstant "Line 1 - Condition is false" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (If () (LogicalBinOp (Var 2 a) Or (Var 2 b) (Logical 4) () ) [(Print (StringConstant "Line 2 - Condition is true" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "Line 2 - Condition is false" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] ) (If () (LogicalBinOp (Var 2 a) Xor (Var 2 b) (Logical 4) () ) [(Print (StringConstant "Line xor - Condition is true" (String 1 (IntegerConstant 28 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "Line xor - Condition is false" (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] ) (Assignment (Var 2 a) (LogicalConstant .false. (Logical 4) ) () .false. .false. ) (Assignment (Var 2 b) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (If () (LogicalNot (LogicalBinOp (Var 2 a) And (Var 2 b) (Logical 4) () ) (Logical 4) () ) [(Print (StringConstant "Line 3 - Condition is true" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "Line 3 - Condition is false" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] ) (If () (LogicalBinOp (Var 2 b) NEqv (Var 2 a) (Logical 4) () ) [(Print (StringConstant "Line 4 - Condition is true" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "Line 4 - Condition is false" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] ) (If () (LogicalBinOp (Var 2 b) Eqv (Var 2 a) (Logical 4) () ) [(Print (StringConstant "Line 5 - Condition is true" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] [(Print (StringConstant "Line 5 - Condition is false" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (Assignment (Var 2 a) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (Assignment (Var 2 b) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (If () (LogicalBinOp (Var 2 a) And (Var 2 b) (Logical 4) () ) [(Print (StringConstant "Line 6 - Condition is true" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "Line 6 - Condition is false" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] ) (If () (LogicalBinOp (Var 2 a) Or (Var 2 b) (Logical 4) () ) [(Print (StringConstant "Line 7 - Condition is true" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "Line 7 - Condition is false" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] ) (If () (LogicalBinOp (Var 2 a) Xor (Var 2 b) (Logical 4) () ) [(Print (StringConstant "Line 8 xor - Condition is true" (String 1 (IntegerConstant 30 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] [(Print (StringConstant "Line 8 xor - Condition is false" (String 1 (IntegerConstant 31 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] ) }) [] ) lfortran-0.63.0/tests/reference/run-format_24-257ddde.stdout0000664000175000017500000000067015174404631023722 0ustar alastairalastairtest: 1.0000 0.33333333333333331 12346. 0.12345669999999999E-7 123456789012345.00 1.2345678901234560 -42.000000000000000 0.0000000000000000 42 -1000 T F Hello G format! 1.2300000000000000 -4.5599999999999996 1.10000000000000012.20000000000000023.2999999999999998 0.12345678901234501E+19 -0.12345678901234500E+22 0.1234000E-4 1.000000 1.230000 1234568. 0.1234000E-03 1234568. 1.000000 1.230000 1234568. 0.1234000E-03 lfortran-0.63.0/tests/reference/asr-implicit_call_01-e42aa0d.json0000664000175000017500000000077615174404631024633 0ustar alastairalastair{ "basename": "asr-implicit_call_01-e42aa0d", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/errors/implicit_call_01.f90", "infile_hash": "2ed640dba2654e545e8e66737ea33f5e1c943c7d894d9cfcacab7225", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit_call_01-e42aa0d.stderr", "stderr_hash": "f9e8970a1b966caf17e63d203fe457cf7114d017867859c35849b3a9", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-select_type_02-6e04a0b.stdout0000664000175000017500000010224615174404631024634 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_type_collection: (Module (SymbolTable 2 { point: (Struct (SymbolTable 3 { x: (Variable 3 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 3 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) point (StructType [(Real 4) (Real 4)] [] .true. .false. ) [] [x y] [] Source Public .false. .false. [] () () [] ) }) derived_type_collection () [] .false. .false. .false. ), select_type_02: (Program (SymbolTable 4 { 1_color_point_color: (ExternalSymbol 4 1_color_point_color 6 color color_point [] color Public ), 1_point_3d_z: (ExternalSymbol 4 1_point_3d_z 5 z point_3d [] z Public ), 1_point_x: (ExternalSymbol 4 1_point_x 3 x point [] x Public ), 1_point_y: (ExternalSymbol 4 1_point_y 3 y point [] y Public ), color_point: (Struct (SymbolTable 6 { color: (Variable 6 color [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) color_point (StructType [(Integer 4)] [] .true. .false. ) [] [color] [] Source Public .false. .false. [] () 4 point [] ), cp: (Variable 4 cp [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 4 color_point Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), p: (Variable 4 p [] Local () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 4 point Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), p3d: (Variable 4 p3d [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 4 point_3d Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), p_or_cp: (Variable 4 p_or_cp [] Local () () Default (Pointer (StructType [(Real 4) (Real 4)] [] .false. .false. ) ) 4 point Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), point: (ExternalSymbol 4 point 2 point derived_type_collection [] point Public ), point_3d: (Struct (SymbolTable 5 { z: (Variable 5 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) point_3d (StructType [(Real 4)] [] .true. .false. ) [] [z] [] Source Public .false. .false. [] () 4 point [] ), ~select_type_block_: (Block (SymbolTable 7 { 1_point_x: (ExternalSymbol 7 1_point_x 3 x point [] x Public ), 1_point_y: (ExternalSymbol 7 1_point_y 3 y point [] y Public ), an: (Variable 7 an [] Local () () Default (Pointer (StructType [(Real 4) (Real 4)] [] .false. .false. ) ) 4 point Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~select_type_block_ [(Associate (Var 7 an) (Cast (Var 4 p_or_cp) ClassToClass (Pointer (StructType [(Real 4) (Real 4)] [] .false. .false. ) ) () (Var 7 an) ) ) (Print (StringFormat () [(StringConstant "point: " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StructInstanceMember (Var 7 an) 7 1_point_x (Real 4) () ) (StructInstanceMember (Var 7 an) 7 1_point_y (Real 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), ~select_type_block_1: (Block (SymbolTable 8 { 1_color_point_color: (ExternalSymbol 8 1_color_point_color 6 color color_point [] color Public ), 1_point_x: (ExternalSymbol 8 1_point_x 3 x point [] x Public ), 1_point_y: (ExternalSymbol 8 1_point_y 3 y point [] y Public ), an: (Variable 8 an [] Local () () Default (Pointer (StructType [(Integer 4)] [] .true. .false. ) ) 4 color_point Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~select_type_block_1 [(Associate (Var 8 an) (Cast (Var 4 p_or_cp) ClassToStruct (Pointer (StructType [(Integer 4)] [] .true. .false. ) ) () (Var 8 an) ) ) (Print (StringFormat () [(StringConstant "color_point: " (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StructInstanceMember (Var 8 an) 8 1_point_x (Real 4) () ) (StructInstanceMember (Var 8 an) 8 1_point_y (Real 4) () ) (StructInstanceMember (Var 8 an) 8 1_color_point_color (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) select_type_02 [derived_type_collection] [(Assignment (StructInstanceMember (Var 4 p) 4 1_point_x (Real 4) () ) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 4 p) 4 1_point_y (Real 4) () ) (RealConstant 2.000000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 4 p3d) 4 1_point_x (Real 4) () ) (RealConstant 3.000000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 4 p3d) 4 1_point_y (Real 4) () ) (RealConstant 4.000000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 4 p3d) 4 1_point_3d_z (Real 4) () ) (RealConstant 5.000000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 4 cp) 4 1_point_x (Real 4) () ) (RealConstant 6.000000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 4 cp) 4 1_point_y (Real 4) () ) (RealConstant 7.000000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 4 cp) 4 1_color_point_color (Integer 4) () ) (IntegerConstant 8 (Integer 4) Decimal) () .false. .false. ) (Associate (Var 4 p_or_cp) (Var 4 cp) ) (SelectType (Var 4 p_or_cp) an [(ClassStmt 4 point [(BlockCall -1 4 ~select_type_block_ )] ) (TypeStmtName 4 color_point [(BlockCall -1 4 ~select_type_block_1 )] )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-array_05_cc-37bfc03.stderr0000664000175000017500000000070115174404631024062 0ustar alastairalastairsemantic error: Rank mismatch in array reference: the array `x` has rank `1`, but is referenced as rank `2` --> tests/errors/array_05_cc.f90:12:14 | 12 | allocate(type_01%x(1, 2)) | ^^^^^^^^^^^^^^^ semantic error: Rank mismatch in array reference: the array `x` has rank `1`, but is referenced as rank `2` --> tests/errors/array_05_cc.f90:13:14 | 13 | allocate(type_01%x(2, 1)) | ^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-array6-fe9aa62.json0000664000175000017500000000070715174404631022743 0ustar alastairalastair{ "basename": "ast-array6-fe9aa62", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/array6.f90", "infile_hash": "bd74956aa588e4b340d6de16fc0b67a51fbf31518393a6cb4e7d2901", "outfile": null, "outfile_hash": null, "stdout": "ast-array6-fe9aa62.stdout", "stdout_hash": "daf1e34e185a4b9e4e5d6e2c747b92f7a3315250c853cd8f02ff356c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_add_01b-bd911f4.json0000664000175000017500000000077215174404631024541 0ustar alastairalastair{ "basename": "asr-template_add_01b-bd911f4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_add_01b.f90", "infile_hash": "49bc85b4565cd612b81222b7a375987b68351569f3e6e67914e6c505", "outfile": null, "outfile_hash": null, "stdout": "asr-template_add_01b-bd911f4.stdout", "stdout_hash": "6ceb11fc3b51dc8de752807eae7dd47d7d1f3e52f414688ffd13c0e7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-nested_05-00beea9.stdout0000664000175000017500000003151315174404631023663 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nested_05: (Program (SymbolTable 5 { b: (ExternalSymbol 5 b 2 b nested_05_a [] b Public ) }) nested_05 [nested_05_a] [(SubroutineCall 5 b () [] () .false. )] ), nested_05_a: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { c: (Function (SymbolTable 4 { }) c (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(Var 3 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 3 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 3 x) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 y) (RealConstant 3.500000 (Real 4) ) () .false. .false. )] () Public .false. .false. () ), x: (Variable 3 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 3 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) b (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 y) (RealConstant 5.500000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(Var 3 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 3 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 3 c () [] () .false. ) (Print (StringFormat () [(Var 3 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 3 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) nested_05_a () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/run-allocate_03-85e4091.stderr0000664000175000017500000000036615174404631023757 0ustar alastairalastairruntime error: allocate with source= requires an allocated/associated source expression --> tests/errors/allocate_03.f90:7:27 | 7 | allocate(obj, source = src) | ^^^ source expression is not allocated/associated lfortran-0.63.0/tests/reference/run-scalar_allocation_check_03-a66333c.json0000664000175000017500000000076215174404631026521 0ustar alastairalastair{ "basename": "run-scalar_allocation_check_03-a66333c", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/scalar_allocation_check_03.f90", "infile_hash": "bf42de38aa218f1c7ac50e28a2823b54baa8da6ffb1516e27b1b92b1", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-scalar_allocation_check_03-a66333c.stderr", "stderr_hash": "22ca5280865788e39acbde9fab7c5eb732c66b38f4f109ea597ff8ea", "returncode": 1 }lfortran-0.63.0/tests/reference/ast_f90-doconcurrentloop_02-2418c04.json0000664000175000017500000000101615174404631025657 0ustar alastairalastair{ "basename": "ast_f90-doconcurrentloop_02-2418c04", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/doconcurrentloop_02.f90", "infile_hash": "972a21c452523a0a3060e6b1a0c75e868f5dd660ea5763358ccade86", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-doconcurrentloop_02-2418c04.stdout", "stdout_hash": "1dac082ef96d3cdf03e2bdc4cce01528ddbcedb71c26845c26ac8bc7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-nint_overflow-bf5738b.json0000664000175000017500000000074315174404631024353 0ustar alastairalastair{ "basename": "asr-nint_overflow-bf5738b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/nint_overflow.f90", "infile_hash": "887b0d5e99be9d33310deee68d28e0b7207e7e7c2ac8ede95f302925", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-nint_overflow-bf5738b.stderr", "stderr_hash": "3dfc23e5fabee4c3980707d1c40d9c9f9e241ca9c769becaa9c86f13", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-array_06-5f5f77a.stderr0000664000175000017500000000031115174404631023430 0ustar alastairalastairsemantic error: Rank mismatch in array reference: the array `str` has rank `1`, but is referenced as rank `2` --> tests/errors/array_06.f90:5:5 | 5 | str(1, 2)(:) = '1234' | ^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/llvm-real_dp_param-bac42bc.json0000664000175000017500000000076415174404631024556 0ustar alastairalastair{ "basename": "llvm-real_dp_param-bac42bc", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/real_dp_param.f90", "infile_hash": "c3f349aae44d8efd8afc0b6bd017d9fdc88a0e652d6f7b3c35622828", "outfile": null, "outfile_hash": null, "stdout": "llvm-real_dp_param-bac42bc.stdout", "stdout_hash": "9723af18f23ec688a910302da5f76f73278111e445554b94d923f396", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-array_bounds_check_14-8de1244.stderr0000664000175000017500000000027015174404631026070 0ustar alastairalastairruntime error: Argument 1 of subroutine f_integer____0 is unallocated. --> tests/errors/array_bounds_check_14.f90:16:12 | 16 | call f(x) | ^ This is unallocated lfortran-0.63.0/tests/reference/pass_select_case-case_07-90772d0.json0000664000175000017500000000101415174404631025240 0ustar alastairalastair{ "basename": "pass_select_case-case_07-90772d0", "cmd": "lfortran --pass=select_case --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_07.f90", "infile_hash": "d24e71ceb6ad09214f850e8c025c9e3c26ca3ba21ee2f94dae6d8fed", "outfile": null, "outfile_hash": null, "stdout": "pass_select_case-case_07-90772d0.stdout", "stdout_hash": "a1e7ea2d03808c8a24ff6ef7191e5059d7ab171e2f2665b60ab9c704", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_global_stmts-global_scope4-2d4061d.json0000664000175000017500000000101415174404631027024 0ustar alastairalastair{ "basename": "pass_global_stmts-global_scope4-2d4061d", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope4.f90", "infile_hash": "da0256e95ad866af376d9ded3cd439463cb1e47dffac6aa88c0bbadf", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope4-2d4061d.stdout", "stdout_hash": "0a9a3e040653f7bf9af9d7075be9c4c2477d28d81cc872ec21ed0220", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-assign_to1-e0b6dcb.stdout0000664000175000017500000000031115174404631024216 0ustar alastairalastair(TranslationUnit [(Program assign1 () [] [] [] [(Assign 10 10 next () )] [] )] ) lfortran-0.63.0/tests/reference/asr-complex_sub_test-f54ef56.json0000664000175000017500000000077215174404631025045 0ustar alastairalastair{ "basename": "asr-complex_sub_test-f54ef56", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_sub_test.f90", "infile_hash": "9f572986fbed1d55d70fd8cd6941a7aaff7a29b92b0b8eada122ac20", "outfile": null, "outfile_hash": null, "stdout": "asr-complex_sub_test-f54ef56.stdout", "stdout_hash": "72a93cceb87fdfaf3b1e0d21fac1eb99d6b3c0d91c086742ca902366", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixedform_assignment-58b5a6f.stdout0000664000175000017500000000370215174404631026244 0ustar alastairalastair(TranslationUnit [(Program implicit_program_lfortran () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ()) (b [] [] () () None ()) (c [] [] () () None ()) (d [] [] () () None ()) (k [] [] () () None ())] () )] [(Assignment 0 a 1 () ) (Assignment 0 b 2 () ) (Assignment 0 c (/ (* a b) 2) () ) (Assignment 0 d (* c c) () ) (Print 0 () [a b c d] () ) (DoLoop 0 () 80 k 1 20 () [(Print 0 () [1] () )] () () ) (If 120 () (< a b) [(Assignment 0 a (* 2 b) () )] [(Assignment 0 b (* 33 c) () )] () () () )] [] )] ) lfortran-0.63.0/tests/reference/ast-fixed_form_interface-a8dfdb0.stdout0000664000175000017500000002257115174404631026330 0ustar alastairalastair(TranslationUnit [(Program fixed_form_interface () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (arr [(1 5 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(output_unit [] [] () () None ())] () ) (DerivedType element [] () [] [(Declaration (AttrType TypeCharacter [(len 2 Value)] () () None ) [] [(symbol [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(atomic_number [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(atomic_mass [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(quantity [] [] () () None ())] () )] [] ) (DerivedType chemical_compound [] () [] [(Declaration (AttrType TypeCharacter [(len 30 Value)] () () None ) [] [(name [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len 10 Value)] () () None ) [] [(formula [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(molecular_weight [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () element None ) [(SimpleAttribute AttrAllocatable ) (AttrDimension [(() () DimensionExpr)] )] [(elements [] [] () () None ())] () )] [] ) (Interface (InterfaceHeader) () [(InterfaceProc (Subroutine my_subroutine [(a)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(a [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Function my_function [(b)] [] res () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(res [] [] () () None ())] () )] [] [] [] ) )] ) (Declaration (AttrType TypeInteger [] () () None ) [] [(num [] [] () 2 Equal ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrDimension [(() () DimensionExpr)] ) (SimpleAttribute AttrAllocatable )] [(factors [] [] () () None ())] () )] [(Allocate 0 [(() (FuncCallOrArray factors [] [(() num () 0)] [] [] [] ) () 0)] [] () ) (Assignment 0 factors (ArrayInitializer () () [3 4] ) () ) (Deallocate 0 [(() factors () 0)] [] () ) (Format 1 "tr1,a" () ) (Print 0 1 [factors] () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 10 2 )] () [] [(Assignment 0 (FuncCallOrArray arr [] [(() i () 0)] [] [] [] ) i () )] () () ) (Flush 0 [output_unit] [] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-nullify_01-09aa501.json0000664000175000017500000000075015174404631023340 0ustar alastairalastair{ "basename": "asr-nullify_01-09aa501", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nullify_01.f90", "infile_hash": "5869e698f080612903a66a6001fa03b7b3390371a5a9eef3ca48a545", "outfile": null, "outfile_hash": null, "stdout": "asr-nullify_01-09aa501.stdout", "stdout_hash": "5c5ce30ed11cd1bd0a4e1e14b8f21a11b78cd52d88ea5863cfe52691", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-subroutines_06-1ab6665.json0000664000175000017500000000076415174404631024264 0ustar alastairalastair{ "basename": "asr-subroutines_06-1ab6665", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_06.f90", "infile_hash": "29e8f662721c0da49f12396843b768130d3ec0293c22c9b527c2c053", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutines_06-1ab6665.stdout", "stdout_hash": "d72fdc6e51c56a1f8f5cfbdc851c69f604c34dafa994712333005220", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-derived_types_02-2a5b79b.json0000664000175000017500000000076015174404631025301 0ustar alastairalastair{ "basename": "ast_f90-derived_types_02-2a5b79b", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/derived_types_02.f90", "infile_hash": "97982d2ac648e6b5260dc06a91a3e121668752f5b642ff81d4efba5f", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-derived_types_02-2a5b79b.stdout", "stdout_hash": "3dbdac0f60c4fc3563710a095e5a071aac2c72198db93e4c7ee8a1ca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_08-3680946.json0000664000175000017500000000077215174404631024422 0ustar alastairalastair{ "basename": "asr-derived_types_08-3680946", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_08.f90", "infile_hash": "4a51a56bca5f067223957705f8a8642e29e5decf9059e675b67d5df0", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_08-3680946.stdout", "stdout_hash": "145a852647c0262f19a1db516aa3bc87abb16440b15ed1ea1bafe9db", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-modules_04-e9ab16a.stdout0000664000175000017500000000057515174404631024537 0ustar alastairalastairmodule modules_04_a implicit none contains subroutine b() print *, "b()" end subroutine b end module modules_04_a program modules_04 use, intrinsic :: iso_fortran_env implicit none call f() contains subroutine f() use modules_04_a, only: b call b() end subroutine f integer function g() use modules_04_a, only: b call b() g = 5 end function g end program modules_04 lfortran-0.63.0/tests/reference/run-stdin_read_blank_lines_01-029176a.json0000664000175000017500000000061015174404631026276 0ustar alastairalastair{ "basename": "run-stdin_read_blank_lines_01-029176a", "cmd": "lfortran --no-color {infile}", "infile": "tests/stdin_read_blank_lines_01.f90", "infile_hash": "d9e3a87e9dbf9ed1dd379267bbfd108020fb16df86d961f6e2bd402e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-complex_div_test-0a2468c.json0000664000175000017500000000077515174404631025131 0ustar alastairalastair{ "basename": "llvm-complex_div_test-0a2468c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_div_test.f90", "infile_hash": "0bbb7100f12786a5fc5022ab6cfd9f97cc6ede016ed0bdab03eda670", "outfile": null, "outfile_hash": null, "stdout": "llvm-complex_div_test-0a2468c.stdout", "stdout_hash": "5087456b6dc1ab4106e3d337dd2986ad8a7a0c286bfade0719395077", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-program_cmake_02-d8d8f4d.stdout0000664000175000017500000000153315174404631025226 0ustar alastairalastair(TranslationUnit [(Program TESTFortran90 () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(stop [] [] () () None ())] (TriviaNode [] [(Semicolon)] ) )] [(Assignment 0 stop 1 (TriviaNode [] [(Semicolon)] ) ) (WhileLoop 0 () (== stop 0) [] (TriviaNode [] [(Semicolon)] ) () )] [] )] ) lfortran-0.63.0/tests/reference/asr_openmp-openmp_39-aaf2ba8.json0000664000175000017500000000077415174404631024777 0ustar alastairalastair{ "basename": "asr_openmp-openmp_39-aaf2ba8", "cmd": "lfortran --show-asr --no-color --openmp {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_39.f90", "infile_hash": "ad3526cfb8a0d0c158dce1e8db3e86ea6516fd68238496485fb00d1a", "outfile": null, "outfile_hash": null, "stdout": "asr_openmp-openmp_39-aaf2ba8.stdout", "stdout_hash": "a6fd9785466c273fecbc6774c2104b79e171e6231e8ddebe5dc8c53e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-global_scope6-3cbd5d2.stdout0000664000175000017500000000120515174404631024775 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." @x = global i32 0 define void @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i32, align 4 store i32 6, i32* @x, align 4 %0 = load i32, i32* @x, align 4 %1 = mul i32 2, %0 store i32 %1, i32* %__lfortran_evaluate_11, align 4 %2 = load i32, i32* @x, align 4 %3 = add i32 %2, 1 store i32 %3, i32* @x, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return ret void } lfortran-0.63.0/tests/reference/ast-do_concurrent_reduce3-9c6ccff.stdout0000664000175000017500000000730315174404631026453 0ustar alastairalastair(TranslationUnit [(Subroutine sum_reduce [(a) (s)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(s [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(N [] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 N (FuncCallOrArray size [] [(() a () 0)] [] [] [] ) () ) (Assignment 0 s 0 () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () )] () [(ConcurrentReduce ReduceMul [s] )] [(Assignment 0 s (+ s (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () )] () [(ConcurrentReduce ReduceMIN [s] )] [(Assignment 0 s (+ s (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () )] () [(ConcurrentReduce ReduceMAX [s] )] [(Assignment 0 s (+ s (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () )] [] [] )] ) lfortran-0.63.0/tests/reference/ast_f90-expr8-613d1f3.json0000664000175000017500000000071715174404631023116 0ustar alastairalastair{ "basename": "ast_f90-expr8-613d1f3", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/expr8.f90", "infile_hash": "b0f7cfaa460c9319f7cc7b0fa470fbbce940f7f4eef3156b55897b51", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-expr8-613d1f3.stdout", "stdout_hash": "b0f7cfaa460c9319f7cc7b0fa470fbbce940f7f4eef3156b55897b51", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-empty-7fa10d2.json0000664000175000017500000000070415174404631022601 0ustar alastairalastair{ "basename": "ast-empty-7fa10d2", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/empty.f90", "infile_hash": "d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f", "outfile": null, "outfile_hash": null, "stdout": "ast-empty-7fa10d2.stdout", "stdout_hash": "96f8556c9cb61453515e3955eedbbf2df06a14d49367a43b0ee0774e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-preprocess_01-20f7efb.stdout0000664000175000017500000000672015174404631024572 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocess_01: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) preprocess_01 [] [(Assignment (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) Mul (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 25 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 x) (IntegerConstant 18 (Integer 4) Decimal) () .false. .false. ) (Print (StringConstant "Else condition" (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Assignment (Var 2 x) (IntegerConstant 30 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (IntegerConstant 10000 (Integer 4) Decimal) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-program_without_line_05-1440b57.stdout0000664000175000017500000000142115174404631026420 0ustar alastairalastair(TranslationUnit [(Subroutine x [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) (Program __xx_main () [] [(ImplicitNone [] () )] [] [(SubroutineCall 0 y [] [] [] [] () )] [] ) (Subroutine y [] [] () () [] [] [] [] [(Print 0 () [(String "x" ())] () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-array_constructor_with_different_types-bffc811.json0000664000175000017500000000105615174404631031620 0ustar alastairalastair{ "basename": "asr-array_constructor_with_different_types-bffc811", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_constructor_with_different_types.f90", "infile_hash": "0e407db91aa33a696329aa0e1867057fce840c163fe57885fd109654", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_constructor_with_different_types-bffc811.stderr", "stderr_hash": "483a4f9a004ffdba3852458d072b3f6ef0251b068762beeec58c2a34", "returncode": 2 }lfortran-0.63.0/tests/reference/julia-arrays_05-f639a33.stdout0000664000175000017500000000053515174404631024072 0ustar alastairalastairfunction main() local i::Int32 local numbers::Array{Float32, 1} = [1.50000000e+00, 3.20000005e+00, 4.50000000e+00, 8.99999976e-01, 7.19999981e+00] for i ∈ 1:5 numbers[i] = Float32(i) * 2.00000000000000000e+00 end numbers .= [1.50000000e+00, 3.20000005e+00, 4.50000000e+00, 8.99999976e-01, 7.19999981e+00] end main() lfortran-0.63.0/tests/reference/ast-line_continuation_03-8570dc1.json0000664000175000017500000000100615174404631025411 0ustar alastairalastair{ "basename": "ast-line_continuation_03-8570dc1", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/line_continuation_03.f90", "infile_hash": "e87783d3a61e68a07124b8821a85b1916933fb83e5fbc63d09e3f32d", "outfile": null, "outfile_hash": null, "stdout": "ast-line_continuation_03-8570dc1.stdout", "stdout_hash": "384a6183b9e02125b7c7be63aee3413ec4216c8b7a21a07132c2daa7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run_dbg-runtime_stacktrace_01-c6f5e06.stderr0000664000175000017500000000044715174404631027033 0ustar alastairalastair File "tests/errors/runtime_stacktrace_01.f90", line 3 print *, main() File "tests/errors/runtime_stacktrace_01.f90", line 10 print *, g() File "tests/errors/runtime_stacktrace_01.f90", line 20 call f() File "tests/errors/runtime_stacktrace_01.f90", line 14 stop 1 STOP 1 lfortran-0.63.0/tests/reference/run-array_bounds_check_02-3ebca53.json0000664000175000017500000000074315174404631025672 0ustar alastairalastair{ "basename": "run-array_bounds_check_02-3ebca53", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_02.f90", "infile_hash": "eaa31b185f0a51c3937f0238d112eb0fc90b3e410e59da7fe194c389", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_02-3ebca53.stderr", "stderr_hash": "33f1e7c5644bec60a2a7b39185cfa26e49eee32b3634224e8110040c", "returncode": 1 }lfortran-0.63.0/tests/reference/ast_f90-common3-fab0cfa.stdout0000664000175000017500000000042515174404631024263 0ustar alastairalastairsubroutine test() implicit none real :: a, b, c, d common a, b common a, b common a, b common a, /b1/ c, d, // b common a, /b1/ c, d, // b common b(2:4) common b(:4) common b(4) common /b1/ c, d, // a, b common /b1/ c, d, // a, b common /b1/ c, d, // a, b end subroutine test lfortran-0.63.0/tests/reference/asr-common_05-f767179.json0000664000175000017500000000074515174404631023130 0ustar alastairalastair{ "basename": "asr-common_05-f767179", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/common_05.f90", "infile_hash": "103a9b01bea9140a57317be18066e13d520ad14dc9edf4c0ff39c458", "outfile": null, "outfile_hash": null, "stdout": "asr-common_05-f767179.stdout", "stdout_hash": "8e68958473b36dcd9f105b0dd48258d524af1706d2d10e1498bee3fd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-dimension_attr-1c00ad6.json0000664000175000017500000000075215174404631024455 0ustar alastairalastair{ "basename": "asr-dimension_attr-1c00ad6", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/dimension_attr.f", "infile_hash": "94df0a120cc268f419253b89bd601cc62c0c40b1ff86e8eb05849b4b", "outfile": null, "outfile_hash": null, "stdout": "asr-dimension_attr-1c00ad6.stdout", "stdout_hash": "6e8b7af4a9417cd4c926b503eab09b91babd12363030c79bbf2b45a6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-recursion_03-8300fac.stdout0000664000175000017500000012531715174404631024335 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 9 { r: (Variable 9 r [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), solver: (ExternalSymbol 9 solver 2 solver recursion_03 [] solver Public ), solver_caller: (ExternalSymbol 9 solver_caller 2 solver_caller recursion_03 [] solver_caller Public ), sub1: (ExternalSymbol 9 sub1 2 sub1 recursion_03 [] sub1 Public ) }) main [recursion_03] [(Assignment (Var 9 r) (FunctionCall 9 sub1 () [((IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 3 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "r =" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 9 r)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), recursion_03: (Module (SymbolTable 2 { solver: (Function (SymbolTable 5 { f: (Function (SymbolTable 6 { f: (Variable 6 f [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] (Integer 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 6 f) Public .false. .false. () ), f_val: (Variable 5 f_val [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iter: (Variable 5 iter [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), solver: (Variable 5 solver [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) solver (FunctionType [(FunctionType [] (Integer 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [sub1] [(Var 5 f) (Var 5 iter)] [(Assignment (Var 5 f_val) (FunctionCall 5 f () [] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "before:" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 5 f_val)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 5 solver) (FunctionCall 2 sub1 () [((IntegerConstant 2 (Integer 4) Decimal)) ((IntegerBinOp (Var 5 iter) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 5 f_val) (FunctionCall 5 f () [] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "after:" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 5 f_val)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] (Var 5 solver) Public .false. .false. () ), solver_caller: (Function (SymbolTable 3 { f: (Function (SymbolTable 4 { f: (Variable 4 f [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] (Integer 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 4 f) Public .false. .false. () ), iter: (Variable 3 iter [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), solver_caller: (Variable 3 solver_caller [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) solver_caller (FunctionType [(FunctionType [] (Integer 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [solver] [(Var 3 f) (Var 3 iter)] [(Assignment (Var 3 solver_caller) (FunctionCall 2 solver () [((Var 3 f)) ((Var 3 iter))] (Integer 4) () () ) () .false. .false. )] (Var 3 solver_caller) Public .true. .true. () ), sub1: (Function (SymbolTable 7 { getx: (Function (SymbolTable 8 { getx: (Variable 8 getx [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) getx (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(StringConstant "x in getx" (String 1 (IntegerConstant 9 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 7 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 8 getx) (Var 7 x) () .false. .false. )] (Var 8 getx) Public .false. .false. () ), iter: (Variable 7 iter [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sub1: (Variable 7 sub1 [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 7 tmp [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 7 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 7 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub1 (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [solver_caller] [(Var 7 y) (Var 7 iter)] [(Assignment (Var 7 x) (Var 7 y) () .false. .false. ) (Print (StringConstant "in sub1" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (IntegerCompare (Var 7 iter) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 7 sub1) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Return)] [] ) (Assignment (Var 7 tmp) (FunctionCall 7 getx () [] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 7 sub1) (FunctionCall 2 solver_caller () [((Var 7 getx)) ((Var 7 iter))] (Integer 4) () () ) () .false. .false. )] (Var 7 sub1) Public .false. .false. () ) }) recursion_03 () [recursion_03] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-block_02-82f9e5f.stderr0000664000175000017500000000026315174404631023414 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/block_02.f90:7:14 | 7 | IF (A.EQ.15) GO TO 1 | ^^^^ help: write this as '==' lfortran-0.63.0/tests/reference/run-write_01-c968b4a.json0000664000175000017500000000067415174404631023134 0ustar alastairalastair{ "basename": "run-write_01-c968b4a", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/write_01.f90", "infile_hash": "467bcb588e761b464036e6b211484c96b738855f975d3621d88ee707", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-write_01-c968b4a.stderr", "stderr_hash": "b65bc0d80ed3f38265702bfd48f891f579ea1c8ec54cef7c4f9f59ed", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-class_01-704dee8.stderr0000664000175000017500000000035015174404631023411 0ustar alastairalastairwarning: Change of value in conversion from 'real(8)' to 'real(4)' --> tests/../integration_tests/class_01.f90:4:16 | 4 | real :: pi = 3.1415926535897931d0 ! Class-wide private constant | ^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/fortran-real_to_integer_cast_fortran_codegen-d0b1495.json0000664000175000017500000000105515174404631031646 0ustar alastairalastair{ "basename": "fortran-real_to_integer_cast_fortran_codegen-d0b1495", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/real_to_integer_cast_fortran_codegen.f90", "infile_hash": "c22935c412aa471b719040d7dfe20e17562f068b634cfe1d80a82cbc", "outfile": null, "outfile_hash": null, "stdout": "fortran-real_to_integer_cast_fortran_codegen-d0b1495.stdout", "stdout_hash": "bde59f8f082b356562ffd4aa721dad8c382393f080a05256c953f59e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-string_01-bda4726.json0000664000175000017500000000074515174404631023261 0ustar alastairalastair{ "basename": "asr-string_01-bda4726", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_01.f90", "infile_hash": "e7d4974d8a9b9704bf0c02d7943d916b40c591de3c9e89d30de28d7d", "outfile": null, "outfile_hash": null, "stdout": "asr-string_01-bda4726.stdout", "stdout_hash": "6de5bdaa627f09c0dfb1dcf8c3b6a48c5bfdf560ede3d625da0724e6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format8-4e5a9c0.json0000664000175000017500000000066215174404631023051 0ustar alastairalastair{ "basename": "run-format8-4e5a9c0", "cmd": "lfortran --no-color {infile}", "infile": "tests/format8.f90", "infile_hash": "30908958fbdff81f81f462b9361840b83c87df049d3b81311709b494", "outfile": null, "outfile_hash": null, "stdout": "run-format8-4e5a9c0.stdout", "stdout_hash": "fa723c58541506da3d4ef67cccca0883504118610c2a5a645389c13f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-redeclaration1-b66ed3a.stderr0000664000175000017500000000034215174404631024754 0ustar alastairalastairsemantic error: Symbol is already declared in the same scope --> tests/errors/redeclaration1.f90:4:12 | 4 | real :: j, idx1 | ^^^^ redeclaration | 3 | integer :: idx1 | ~~~~ original declaration lfortran-0.63.0/tests/reference/asr-incompatible_ranks_allocatable_arr1-5e5233d.stderr0000664000175000017500000000025615174404631031037 0ustar alastairalastairsemantic error: Incompatible ranks 2 and 1 in assignment --> tests/errors/incompatible_ranks_allocatable_arr1.f90:8:5 | 8 | arr1 = [1, 2, 3] | ^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-string_binop-415f1fa.json0000664000175000017500000000074015174404631024141 0ustar alastairalastair{ "basename": "asr-string_binop-415f1fa", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/string_binop.f90", "infile_hash": "4e6301859ddd78b04a2a25c7024ec1a91d427fe1e12477c3d337dc6f", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-string_binop-415f1fa.stderr", "stderr_hash": "b5d483b65a65764781e8af477c3eecc912b46d8ad9eb26cdb8d29319", "returncode": 2 }lfortran-0.63.0/tests/reference/asr_preprocess-cpp_err6-47462f4.stderr0000664000175000017500000000021115174404631025625 0ustar alastairalastairC preprocessor error: Unexpected token '(', expected ')' --> tests/errors/cpp_err6.f90:2:13 | 2 | #if 1 + (1+2 ( | ^^^ lfortran-0.63.0/tests/reference/asr-intrinsics_28-7703b7d.stdout0000664000175000017500000003036515174404631024447 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { debug: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local (IntegerUnaryMinus (IntegerConstant 20 (Integer 4) Decimal) (Integer 4) (IntegerConstant -20 (Integer 4) Decimal) ) (IntegerConstant -20 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local (IntegerConstant 30 (Integer 4) Decimal) (IntegerConstant 30 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Local (IntegerUnaryMinus (IntegerConstant 40 (Integer 4) Decimal) (Integer 4) (IntegerConstant -40 (Integer 4) Decimal) ) (IntegerConstant -40 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), e: (Variable 2 e [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Variable 2 f [] Local (IntegerConstant 50 (Integer 4) Decimal) (IntegerConstant 50 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) debug [] [(If () (IntegerCompare (IntrinsicElementalFunction Min [(Var 2 a) (Var 2 b) (Var 2 c) (Var 2 d) (Var 2 e) (Var 2 f)] 0 (Integer 4) (IntegerConstant -40 (Integer 4) Decimal) ) NotEq (IntegerUnaryMinus (IntegerConstant 40 (Integer 4) Decimal) (Integer 4) (IntegerConstant -40 (Integer 4) Decimal) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction Max [(Var 2 a) (Var 2 b) (Var 2 c) (Var 2 d) (Var 2 e) (Var 2 f)] 0 (Integer 4) (IntegerConstant 50 (Integer 4) Decimal) ) NotEq (IntegerConstant 50 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction Max [(Var 2 a) (Var 2 b)] 0 (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) ) NotEq (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction Min [(Var 2 a) (Var 2 b)] 0 (Integer 4) (IntegerConstant -20 (Integer 4) Decimal) ) NotEq (IntegerUnaryMinus (IntegerConstant 20 (Integer 4) Decimal) (Integer 4) (IntegerConstant -20 (Integer 4) Decimal) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction Max [(Var 2 a) (Var 2 b) (Var 2 c)] 0 (Integer 4) (IntegerConstant 30 (Integer 4) Decimal) ) NotEq (IntegerConstant 30 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-fixed_form_if_variations-b4dcd1e.stdout0000664000175000017500000001376515174404631027226 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { a: (Variable 2 a [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 a)] [(Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), main: (Program (SymbolTable 3 { }) main [] [(If () (IntegerCompare (IntegerConstant 0 (Integer 4) Decimal) Lt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(Print (StringConstant "first branch" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (GoToTarget 10 10 )] [(Print (StringConstant "second branch" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (GoToTarget 50 50 ) (SubroutineCall 1 f () [((IntegerConstant 1 (Integer 4) Decimal))] () .false. ) (If () (IntegerCompare (IntegerConstant 0 (Integer 4) Decimal) Lt (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(Return)] [] ) (If () (IntegerCompare (IntegerConstant 0 (Integer 4) Decimal) Gt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(GoTo 50 50 )] [] ) (If () (IntegerCompare (IntegerConstant 0 (Integer 4) Decimal) Lt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(SubroutineCall 1 f () [((IntegerConstant 2 (Integer 4) Decimal))] () .false. )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr_clojure-subroutine1-be16026.json0000664000175000017500000000077415174404631025374 0ustar alastairalastair{ "basename": "asr_clojure-subroutine1-be16026", "cmd": "lfortran --show-asr --no-color --no-indent --clojure {infile} -o {outfile}", "infile": "tests/subroutine1.f90", "infile_hash": "e209c22328b423e75d6801f3c0ef19bc120936196435dff2cb19df31", "outfile": null, "outfile_hash": null, "stdout": "asr_clojure-subroutine1-be16026.stdout", "stdout_hash": "0e7e268076be4c2381265ecac0ce20b58b55a64e739cab857551cec9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-array9-fe1439d.json0000664000175000017500000000070715174404631022670 0ustar alastairalastair{ "basename": "ast-array9-fe1439d", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/array9.f90", "infile_hash": "7107510b84a7e22f82d8f1f61617c399bc53b8a0fb59a5453419889c", "outfile": null, "outfile_hash": null, "stdout": "ast-array9-fe1439d.stdout", "stdout_hash": "0713345f733a9e9bdd7064dcce8ae13e9748c685edbb5c44cd3deee5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-cpp4-0611905.json0000664000175000017500000000074415174404631024341 0ustar alastairalastair{ "basename": "asr_preprocess-cpp4-0611905", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp4.f90", "infile_hash": "cdfb40699075b2ba0ddb610fe1bc708cecd3e38d14adcc946b2ca70a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp4-0611905.stderr", "stderr_hash": "b215b344a6a7ea30b40d38cf92f756b1982a66068232a12de9e62cbc", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-private2-d3a4771.stderr0000664000175000017500000000022515174404631023453 0ustar alastairalastairsemantic error: Private variable `y` cannot be imported --> tests/errors/private2.f90:7:21 | 7 | use foo2, only: y | ^ lfortran-0.63.0/tests/reference/asr-callback_02-aec5457.json0000664000175000017500000000075315174404631023513 0ustar alastairalastair{ "basename": "asr-callback_02-aec5457", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/callback_02.f90", "infile_hash": "880452ed794b4467313ba9a87318b17fe757a084b2a39129209153d3", "outfile": null, "outfile_hash": null, "stdout": "asr-callback_02-aec5457.stdout", "stdout_hash": "e7fac09b20daee0b1b140ce9f90cfd9ca198cd71830b09b79563c28f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-print3-5f4fc26.json0000664000175000017500000000070715174404631022676 0ustar alastairalastair{ "basename": "asr-print3-5f4fc26", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/print3.f90", "infile_hash": "891fa35fc5d09524ef73c8c3b92bcd5a4bede01e35fdf0f116df99b2", "outfile": null, "outfile_hash": null, "stdout": "asr-print3-5f4fc26.stdout", "stdout_hash": "47c3cdf0c12e273514db85cca3ce1c90d3bb8fcd4e3e191fb55783cb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-string_13-8952a13.json0000664000175000017500000000075015174404631023310 0ustar alastairalastair{ "basename": "llvm-string_13-8952a13", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/string_13.f90", "infile_hash": "25354bac77715f94447d94e23c5c51c4ece9145b600155f8a5cb4c9f", "outfile": null, "outfile_hash": null, "stdout": "llvm-string_13-8952a13.stdout", "stdout_hash": "c0374a8fdcf48dc96584c24875b0c4256ad0b9fd5cfa618ff10bf548", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-subroutine5-272e7be.json0000664000175000017500000000071115174404631023731 0ustar alastairalastair{ "basename": "cpp-subroutine5-272e7be", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/subroutine5.f90", "infile_hash": "88c62ffd8f005d7a511511e43da68f25e8fe795a75fec462baa25885", "outfile": null, "outfile_hash": null, "stdout": "cpp-subroutine5-272e7be.stdout", "stdout_hash": "af1e1aa50982757b2781271f2e6bdfdf657c3dd0937a7da523277c0b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor16-b846504.json0000664000175000017500000000077315174404631026461 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor16-b846504", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor16.f90", "infile_hash": "706f1e5cb790684841189022e27d4df5631d981e6351e1c6fd390bcd", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor16-b846504.stdout", "stdout_hash": "23fa2d8fc374a24481d0ea1a812f9b1c3fc53a18ed15a8daf4741c3a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-cpp_err4-9f3b813.json0000664000175000017500000000076015174404631025361 0ustar alastairalastair{ "basename": "asr_preprocess-cpp_err4-9f3b813", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp_err4.f90", "infile_hash": "7562759fab91efdac8434ae7acf76334560c5235c769ef2c269782d9", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp_err4-9f3b813.stderr", "stderr_hash": "35a4de2e06089dca4cd7a5883ca6df059946058807125341cc995627", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-array_01-6a86c32.json0000664000175000017500000000072415174404631023011 0ustar alastairalastair{ "basename": "asr-array_01-6a86c32", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_01.f90", "infile_hash": "d8217a9cb0fccab262234a2cd78ace42dd2ef8ef8412a6d3de9012aa", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_01-6a86c32.stderr", "stderr_hash": "590ff828b48820966380e2e27f1e5af17dda38e3bb542aee4d7f6e6a", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-modules_11-1131557.stdout0000664000175000017500000000402515174404631023547 0ustar alastairalastair(TranslationUnit [(Module modules_11_module11 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () 1 Equal ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(j [] [] () 2 Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Subroutine access_internally [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "i = " ()) i] () )] [] [] )] ) (Program access_externally () [(Use [] modules_11_module11 [] .false. () )] [(ImplicitNone [] () )] [] [(Print 0 () [(String "j = " ()) j] () ) (SubroutineCall 0 access_internally [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/fortran-int_to_complex_cast_in_comparison-2b60771.json0000664000175000017500000000104415174404631031146 0ustar alastairalastair{ "basename": "fortran-int_to_complex_cast_in_comparison-2b60771", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/int_to_complex_cast_in_comparison.f90", "infile_hash": "d941d05c4d0af6960eed2a5e192da5e3b6cef03b0467f23682b10222", "outfile": null, "outfile_hash": null, "stdout": "fortran-int_to_complex_cast_in_comparison-2b60771.stdout", "stdout_hash": "a00d1e900fe5e7816b5ab2e4cb60fb660201b2c3ad3146b2a07eb7d7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-associate_01-4a4ac5c.stdout0000664000175000017500000002146515174404631024356 0ustar alastairalastair(TranslationUnit [(Program associate_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrAllocatable )] [(a [(() () DimensionExpr)] [] () () None ()) (b [(() () DimensionExpr) (() () DimensionExpr)] [] () () None ()) (c [(() () DimensionExpr) (() () DimensionExpr) (() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrPointer )] [(x [(() () DimensionExpr)] [] () () None ()) (y [(() () DimensionExpr) (() () DimensionExpr) (() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(a_1 [] [] () () None ()) (c_234 [] [] () () None ()) (c_121 [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(n [] [] () () None ())] () )] [(Assignment 0 a_1 0 () ) (Assignment 0 n 10 () ) (Allocate 0 [(() (FuncCallOrArray a [] [(() 5 () 0)] [] [] [] ) () 0)] [] () ) (Allocate 0 [(() (FuncCallOrArray b [] [(() n () 0) (() n () 0)] [] [] [] ) () 0) (() (FuncCallOrArray c [] [(() n () 0) (() 5 () 0) (() n () 0)] [] [] [] ) () 0)] [] () ) (AssociateBlock 1 loop [(x [] [] () a Arrow ()) (y [] [] () c Arrow ()) (z [] [] () (FuncCallOrArray c [] [(() () 1 0) (() 2 () 0) (() () 1 0)] [] [] [] ) Arrow ())] [(Assignment 0 (FuncCallOrArray x [] [(() 1 () 0)] [] [] [] ) (+ a_1 5) () ) (Assignment 0 (FuncCallOrArray y [] [(() 2 () 0) (() 3 () 0) (() 4 () 0)] [] [] [] ) 3 () ) (Assignment 0 (FuncCallOrArray z [] [(() 1 () 0) (() 1 () 0)] [] [] [] ) 17 () ) (If 0 () (/= (FuncCallOrArray size [] [(() z () 0)] [] [] [] ) 100) [(ErrorStop 0 () () () )] [] () () () )] () () ) (Assignment 0 a_1 (FuncCallOrArray a [] [(() 1 () 0)] [] [] [] ) () ) (If 0 () (== (FuncCallOrArray a [] [(() 1 () 0)] [] [] [] ) 5) [(GoTo 0 () 1 [] () )] [] () () () ) (Assignment 0 c_234 (FuncCallOrArray c [] [(() 2 () 0) (() 3 () 0) (() 4 () 0)] [] [] [] ) () ) (Assignment 0 c_121 (FuncCallOrArray c [] [(() 1 () 0) (() 2 () 0) (() 1 () 0)] [] [] [] ) () ) (If 0 () (/= a_1 (Real "10.")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (/= c_234 (Real "3.")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (/= c_121 (Real "17.")) [(ErrorStop 0 () () () )] [] () () () )] [] )] ) lfortran-0.63.0/tests/reference/asr-intrinsics_34-c5cfc20.stdout0000664000175000017500000003534015174404631024572 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_34: (Program (SymbolTable 2 { dp: (Variable 2 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local (RealConstant 3.143000 (Real 4) ) (RealConstant 3.143000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local (Cast (RealConstant 2.330000 (Real 4) ) RealToReal (Real 8) (RealConstant 2.330000 (Real 8) ) () ) (RealConstant 2.330000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_34 [] [(Print (StringFormat () [(TypeInquiry Epsilon (Real 4) (Var 2 x) (Real 4) (RealConstant 0.000000 (Real 4) ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(TypeInquiry Epsilon (Real 8) (Var 2 y) (Real 8) (RealConstant 0.000000 (Real 8) ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(RealBinOp (TypeInquiry Epsilon (Real 8) (RealConstant 1.000000 (Real 8) ) (Real 8) (RealConstant 0.000000 (Real 8) ) ) Pow (Cast (RealConstant 0.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.500000 (Real 8) ) () ) (Real 8) (RealConstant 0.000000 (Real 8) ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (TypeInquiry Epsilon (Real 4) (Var 2 x) (Real 4) (RealConstant 0.000000 (Real 4) ) ) Sub (RealConstant 0.000000 (Real 4) ) (Real 4) (RealConstant 0.000000 (Real 4) ) )] 0 (Real 4) (RealConstant 0.000000 (Real 4) ) ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (TypeInquiry Epsilon (Real 8) (Var 2 y) (Real 8) (RealConstant 0.000000 (Real 8) ) ) Sub (RealConstant 0.000000 (Real 8) ) (Real 8) (RealConstant 0.000000 (Real 8) ) )] 0 (Real 8) (RealConstant 0.000000 (Real 8) ) ) Gt (RealConstant 0.000000 (Real 8) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (TypeInquiry Epsilon (Real 8) (RealConstant 1.000000 (Real 8) ) (Real 8) (RealConstant 0.000000 (Real 8) ) ) Pow (RealConstant 0.500000 (Real 8) ) (Real 8) (RealConstant 0.000000 (Real 8) ) ) Sub (RealConstant 0.000000 (Real 8) ) (Real 8) (RealConstant 0.000000 (Real 8) ) )] 0 (Real 8) (RealConstant 0.000000 (Real 8) ) ) Gt (RealConstant 0.000000 (Real 8) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/rename_symbol-collect_occurence1-98d138a.json0000664000175000017500000000100415174404631027173 0ustar alastairalastair{ "basename": "rename_symbol-collect_occurence1-98d138a", "cmd": "lfortran --rename-symbol --no-color {infile} -o {outfile}", "infile": "tests/collect_occurence1.f90", "infile_hash": "acffed461dbe1cc05dfd5085fa5344e0c755f1139a7f9c24cb4656e1", "outfile": null, "outfile_hash": null, "stdout": "rename_symbol-collect_occurence1-98d138a.stdout", "stdout_hash": "fa4ac473422f7e302b0cbda18f562c23a9675d915087e0d2b7ff1e01", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_size_02-94fb4d3.json0000664000175000017500000000074315174404631024130 0ustar alastairalastair{ "basename": "asr-array_size_02-94fb4d3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_size_02.f90", "infile_hash": "dec46004e57793955ce8aada1f3ec5dd21b7f5abe9f436f1cd9a341d", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_size_02-94fb4d3.stderr", "stderr_hash": "954027eda0ea7fcdede13263e3b29773db3374152d90a6b0f455d1c0", "returncode": 2 }lfortran-0.63.0/tests/reference/run-format_22-e96df3d.stdout0000664000175000017500000000077115174404631023730 0ustar alastairalastairb format for integer(4) 10101 * ** *** **** 10101 10101 10101 10101 10101 10101 -1 in b32 format: "11111111111111111111111111111111" -1 in b0 format: "11111111111111111111111111111111" 10 in b32 format: " 1010" 11 in b0 format: "1011" 1100100 **** ***** 1100100 0 0 b format for integer(8) 11111 11111 1010 1010 0 0 b format for integer(1) 1011 1011 1010 1010 0 0 b format for integer(2) 1001 1001 **** ***** 0 0 lfortran-0.63.0/tests/reference/asr-fn2-b585098.json0000664000175000017500000000067615174404631022016 0ustar alastairalastair{ "basename": "asr-fn2-b585098", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/fn2.f90", "infile_hash": "9f61561c47397aa03014fe07094ac838ada4865e513025e384edae00", "outfile": null, "outfile_hash": null, "stdout": "asr-fn2-b585098.stdout", "stdout_hash": "90f959c6b1dbdb91bb6d7aaf159f67859a099a2e2f06429504d9aa42", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor18-618bfdc.json0000664000175000017500000000077315174404631026704 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor18-618bfdc", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor18.f90", "infile_hash": "9ad52cd56e9f372994097685554ad24df69eb9bf87e99ebf0a005fb2", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor18-618bfdc.stdout", "stdout_hash": "e8c7cbc05492b1852928c9b0d58363c492a9357533e4823b81f8963d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_global_stmts-global_scope7-d6ec187.stdout0000664000175000017500000000655415174404631027513 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 f1) (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () ) () .false. .false. ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ), x: (Variable 1 x [] Local (IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) [] ) lfortran-0.63.0/tests/reference/asr-string2-3425046.json0000664000175000017500000000071215174404631022613 0ustar alastairalastair{ "basename": "asr-string2-3425046", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/string2.f90", "infile_hash": "c88731a5e438f48d75ee2eb7b97ef6c1165c37ec28aa82b22ff6d49f", "outfile": null, "outfile_hash": null, "stdout": "asr-string2-3425046.stdout", "stdout_hash": "fe5001c2ec6eb5822ecd9c8d1c67519e213efd6c40eab3a9df2ddec2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor21-aded728.stdout0000664000175000017500000000234715174404631027247 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor21: (Program (SymbolTable 2 { }) preprocessor21 [] [(Print (StringConstant "Atleast one of VAR1 and VAR2 isn't defined" (String 1 (IntegerConstant 42 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Neither of VAR3 or VAR4 is defined" (String 1 (IntegerConstant 34 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Both VAR5 and VAR6 are defined or neither is defined." (String 1 (IntegerConstant 53 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-logical3-b6316c6.json0000664000175000017500000000106115174404631023061 0ustar alastairalastair{ "basename": "asr-logical3-b6316c6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/logical3.f90", "infile_hash": "d7f7994a85ee59f1b3b80060886eeeb7390f9733461bd9349e4bb7c0", "outfile": null, "outfile_hash": null, "stdout": "asr-logical3-b6316c6.stdout", "stdout_hash": "25392d8e05f73606f145c8c81cf934d0192d42475d36bede98895614", "stderr": "asr-logical3-b6316c6.stderr", "stderr_hash": "d7e28e54d198e14f86c18ab4c4ad128018b9bc6523fb945b05607a57", "returncode": 0 }lfortran-0.63.0/tests/reference/pass_init_expr-array13-db4fb0f.stdout0000664000175000017500000001452215174404631025704 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array13: (Program (SymbolTable 2 { __1_k: (Variable 2 __1_k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), numbers: (Variable 2 numbers [] Local () () Save (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) array13 [] [(Assignment (Var 2 __1_k) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 numbers) [(() (Var 2 __1_k) ())] (Integer 4) RowMajor () ) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 __1_k) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 numbers) [(() (Var 2 __1_k) ())] (Integer 4) RowMajor () ) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 __1_k) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 numbers) [(() (Var 2 __1_k) ())] (Integer 4) RowMajor () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 __1_k) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 numbers) [(() (Var 2 __1_k) ())] (Integer 4) RowMajor () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 __1_k) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 numbers) [(() (Var 2 __1_k) ())] (Integer 4) RowMajor () ) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-string_11-e6c763f.stdout0000664000175000017500000004644415174404631024040 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @string_const_data = private constant [14 x i8] c"This is a test" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([14 x i8], [14 x i8]* @string_const_data, i32 0, i32 0), i64 14 }> @string_const_data.1 = private constant [4 x i8] c"test" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.1, i32 0, i32 0), i64 4 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.3 = private constant [17 x i8] c"test is not found" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([17 x i8], [17 x i8]* @string_const_data.3, i32 0, i32 0), i64 17 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [13 x i8] c"S-DESC-24,I4\00", align 1 @string_const_data.5 = private constant [24 x i8] c"test is found at index: " @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([24 x i8], [24 x i8]* @string_const_data.5, i32 0, i32 0), i64 24 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @_lcompilers_index_str(%string_descriptor* %str, %string_descriptor* %substr, i32* %back, i32* %kind) { .entry: %StrSlice_StrView4 = alloca %string_descriptor, align 8 %StrSlice_StrView = alloca %string_descriptor, align 8 %_lcompilers_index_str = alloca i32, align 4 %found = alloca i32, align 4 %i = alloca i32, align 4 %j = alloca i32, align 4 %k = alloca i32, align 4 %pos = alloca i32, align 4 store i32 0, i32* %_lcompilers_index_str, align 4 store i32 1, i32* %i, align 4 store i32 1, i32* %found, align 4 %0 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 1 %1 = load i64, i64* %0, align 8 %2 = trunc i64 %1 to i32 %3 = getelementptr %string_descriptor, %string_descriptor* %substr, i32 0, i32 1 %4 = load i64, i64* %3, align 8 %5 = trunc i64 %4 to i32 %6 = icmp slt i32 %2, %5 br i1 %6, label %then, label %else then: ; preds = %.entry store i32 0, i32* %found, align 4 br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then br label %loop.head loop.head: ; preds = %ifcont10, %ifcont %7 = load i32, i32* %i, align 4 %8 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 1 %9 = load i64, i64* %8, align 8 %10 = trunc i64 %9 to i32 %11 = add i32 %10, 1 %12 = icmp slt i32 %7, %11 %13 = load i32, i32* %found, align 4 %14 = icmp eq i32 %13, 1 %15 = and i1 %12, %14 br i1 %15, label %loop.body, label %loop.end11 loop.body: ; preds = %loop.head store i32 0, i32* %k, align 4 store i32 1, i32* %j, align 4 br label %loop.head1 loop.head1: ; preds = %ifcont7, %loop.body %16 = load i32, i32* %j, align 4 %17 = getelementptr %string_descriptor, %string_descriptor* %substr, i32 0, i32 1 %18 = load i64, i64* %17, align 8 %19 = trunc i64 %18 to i32 %20 = icmp sle i32 %16, %19 %21 = load i32, i32* %found, align 4 %22 = icmp eq i32 %21, 1 %23 = and i1 %20, %22 br i1 %23, label %loop.body2, label %loop.end loop.body2: ; preds = %loop.head1 %24 = load i32, i32* %i, align 4 %25 = load i32, i32* %k, align 4 %26 = add i32 %24, %25 store i32 %26, i32* %pos, align 4 %27 = load i32, i32* %pos, align 4 %28 = load i32, i32* %pos, align 4 %29 = sext i32 %27 to i64 %30 = sext i32 %28 to i64 %31 = sub i64 %30, %29 %32 = add i64 %31, 1 %33 = icmp slt i64 %32, 0 %34 = select i1 %33, i64 0, i64 %32 %35 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 0 %36 = load i8*, i8** %35, align 8 %37 = sext i32 %27 to i64 %38 = sub i64 %37, 1 %StrSliceGEP = getelementptr i8, i8* %36, i64 %38 %39 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 store i8* %StrSliceGEP, i8** %39, align 8 %40 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 store i64 %34, i64* %40, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 %42 = load i8*, i8** %41, align 8 %43 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 %44 = load i64, i64* %43, align 8 %45 = load i32, i32* %j, align 4 %46 = load i32, i32* %j, align 4 %47 = sext i32 %45 to i64 %48 = sext i32 %46 to i64 %49 = sub i64 %48, %47 %50 = add i64 %49, 1 %51 = icmp slt i64 %50, 0 %52 = select i1 %51, i64 0, i64 %50 %53 = getelementptr %string_descriptor, %string_descriptor* %substr, i32 0, i32 0 %54 = load i8*, i8** %53, align 8 %55 = sext i32 %45 to i64 %56 = sub i64 %55, 1 %StrSliceGEP3 = getelementptr i8, i8* %54, i64 %56 %57 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView4, i32 0, i32 0 store i8* %StrSliceGEP3, i8** %57, align 8 %58 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView4, i32 0, i32 1 store i64 %52, i64* %58, align 8 %59 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView4, i32 0, i32 0 %60 = load i8*, i8** %59, align 8 %61 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView4, i32 0, i32 1 %62 = load i64, i64* %61, align 8 %63 = call i32 @str_compare(i8* %42, i64 %44, i8* %60, i64 %62) %64 = icmp ne i32 %63, 0 br i1 %64, label %then5, label %else6 then5: ; preds = %loop.body2 store i32 0, i32* %found, align 4 br label %ifcont7 else6: ; preds = %loop.body2 br label %ifcont7 ifcont7: ; preds = %else6, %then5 %65 = load i32, i32* %j, align 4 %66 = add i32 %65, 1 store i32 %66, i32* %j, align 4 %67 = load i32, i32* %k, align 4 %68 = add i32 %67, 1 store i32 %68, i32* %k, align 4 br label %loop.head1 loop.end: ; preds = %loop.head1 %69 = load i32, i32* %found, align 4 %70 = icmp eq i32 %69, 1 br i1 %70, label %then8, label %else9 then8: ; preds = %loop.end %71 = load i32, i32* %i, align 4 store i32 %71, i32* %_lcompilers_index_str, align 4 %72 = load i32, i32* %back, align 4 store i32 %72, i32* %found, align 4 br label %ifcont10 else9: ; preds = %loop.end store i32 1, i32* %found, align 4 br label %ifcont10 ifcont10: ; preds = %else9, %then8 %73 = load i32, i32* %i, align 4 %74 = add i32 %73, 1 store i32 %74, i32* %i, align 4 br label %loop.head loop.end11: ; preds = %loop.head br label %return return: ; preds = %loop.end11 br label %FINALIZE_SYMTABLE__lcompilers_index_str FINALIZE_SYMTABLE__lcompilers_index_str: ; preds = %return %75 = load i32, i32* %_lcompilers_index_str, align 4 ret i32 %75 } define i32 @_lcompilers_index_str1(%string_descriptor* %str, %string_descriptor* %substr, i32* %back, i32* %kind) { .entry: %StrSlice_StrView4 = alloca %string_descriptor, align 8 %StrSlice_StrView = alloca %string_descriptor, align 8 %_lcompilers_index_str1 = alloca i32, align 4 %found = alloca i32, align 4 %i = alloca i32, align 4 %j = alloca i32, align 4 %k = alloca i32, align 4 %pos = alloca i32, align 4 store i32 0, i32* %_lcompilers_index_str1, align 4 store i32 1, i32* %i, align 4 store i32 1, i32* %found, align 4 %0 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 1 %1 = load i64, i64* %0, align 8 %2 = trunc i64 %1 to i32 %3 = getelementptr %string_descriptor, %string_descriptor* %substr, i32 0, i32 1 %4 = load i64, i64* %3, align 8 %5 = trunc i64 %4 to i32 %6 = icmp slt i32 %2, %5 br i1 %6, label %then, label %else then: ; preds = %.entry store i32 0, i32* %found, align 4 br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then br label %loop.head loop.head: ; preds = %ifcont10, %ifcont %7 = load i32, i32* %i, align 4 %8 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 1 %9 = load i64, i64* %8, align 8 %10 = trunc i64 %9 to i32 %11 = add i32 %10, 1 %12 = icmp slt i32 %7, %11 %13 = load i32, i32* %found, align 4 %14 = icmp eq i32 %13, 1 %15 = and i1 %12, %14 br i1 %15, label %loop.body, label %loop.end11 loop.body: ; preds = %loop.head store i32 0, i32* %k, align 4 store i32 1, i32* %j, align 4 br label %loop.head1 loop.head1: ; preds = %ifcont7, %loop.body %16 = load i32, i32* %j, align 4 %17 = getelementptr %string_descriptor, %string_descriptor* %substr, i32 0, i32 1 %18 = load i64, i64* %17, align 8 %19 = trunc i64 %18 to i32 %20 = icmp sle i32 %16, %19 %21 = load i32, i32* %found, align 4 %22 = icmp eq i32 %21, 1 %23 = and i1 %20, %22 br i1 %23, label %loop.body2, label %loop.end loop.body2: ; preds = %loop.head1 %24 = load i32, i32* %i, align 4 %25 = load i32, i32* %k, align 4 %26 = add i32 %24, %25 store i32 %26, i32* %pos, align 4 %27 = load i32, i32* %pos, align 4 %28 = load i32, i32* %pos, align 4 %29 = sext i32 %27 to i64 %30 = sext i32 %28 to i64 %31 = sub i64 %30, %29 %32 = add i64 %31, 1 %33 = icmp slt i64 %32, 0 %34 = select i1 %33, i64 0, i64 %32 %35 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 0 %36 = load i8*, i8** %35, align 8 %37 = sext i32 %27 to i64 %38 = sub i64 %37, 1 %StrSliceGEP = getelementptr i8, i8* %36, i64 %38 %39 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 store i8* %StrSliceGEP, i8** %39, align 8 %40 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 store i64 %34, i64* %40, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 %42 = load i8*, i8** %41, align 8 %43 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 %44 = load i64, i64* %43, align 8 %45 = load i32, i32* %j, align 4 %46 = load i32, i32* %j, align 4 %47 = sext i32 %45 to i64 %48 = sext i32 %46 to i64 %49 = sub i64 %48, %47 %50 = add i64 %49, 1 %51 = icmp slt i64 %50, 0 %52 = select i1 %51, i64 0, i64 %50 %53 = getelementptr %string_descriptor, %string_descriptor* %substr, i32 0, i32 0 %54 = load i8*, i8** %53, align 8 %55 = sext i32 %45 to i64 %56 = sub i64 %55, 1 %StrSliceGEP3 = getelementptr i8, i8* %54, i64 %56 %57 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView4, i32 0, i32 0 store i8* %StrSliceGEP3, i8** %57, align 8 %58 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView4, i32 0, i32 1 store i64 %52, i64* %58, align 8 %59 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView4, i32 0, i32 0 %60 = load i8*, i8** %59, align 8 %61 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView4, i32 0, i32 1 %62 = load i64, i64* %61, align 8 %63 = call i32 @str_compare(i8* %42, i64 %44, i8* %60, i64 %62) %64 = icmp ne i32 %63, 0 br i1 %64, label %then5, label %else6 then5: ; preds = %loop.body2 store i32 0, i32* %found, align 4 br label %ifcont7 else6: ; preds = %loop.body2 br label %ifcont7 ifcont7: ; preds = %else6, %then5 %65 = load i32, i32* %j, align 4 %66 = add i32 %65, 1 store i32 %66, i32* %j, align 4 %67 = load i32, i32* %k, align 4 %68 = add i32 %67, 1 store i32 %68, i32* %k, align 4 br label %loop.head1 loop.end: ; preds = %loop.head1 %69 = load i32, i32* %found, align 4 %70 = icmp eq i32 %69, 1 br i1 %70, label %then8, label %else9 then8: ; preds = %loop.end %71 = load i32, i32* %i, align 4 store i32 %71, i32* %_lcompilers_index_str1, align 4 %72 = load i32, i32* %back, align 4 store i32 %72, i32* %found, align 4 br label %ifcont10 else9: ; preds = %loop.end store i32 1, i32* %found, align 4 br label %ifcont10 ifcont10: ; preds = %else9, %then8 %73 = load i32, i32* %i, align 4 %74 = add i32 %73, 1 store i32 %74, i32* %i, align 4 br label %loop.head loop.end11: ; preds = %loop.head br label %return return: ; preds = %loop.end11 br label %FINALIZE_SYMTABLE__lcompilers_index_str1 FINALIZE_SYMTABLE__lcompilers_index_str1: ; preds = %return %75 = load i32, i32* %_lcompilers_index_str1, align 4 ret i32 %75 } declare i32 @str_compare(i8*, i64, i8*, i64) define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %call_arg_value1 = alloca i32, align 4 %call_arg_value = alloca i32, align 4 %2 = call i8* @_lfortran_get_default_allocator() %teststring = alloca %string_descriptor, align 8 %mystring = alloca %string_descriptor, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store %string_descriptor zeroinitializer, %string_descriptor* %mystring, align 1 %3 = getelementptr %string_descriptor, %string_descriptor* %mystring, i32 0, i32 1 store i64 30, i64* %3, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %mystring, i32 0, i32 0 %5 = call i8* @_lfortran_get_default_allocator() %6 = call i8* @_lfortran_malloc_alloc(i8* %5, i64 30) store i8* %6, i8** %4, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %teststring, align 1 %7 = getelementptr %string_descriptor, %string_descriptor* %teststring, i32 0, i32 1 store i64 10, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %teststring, i32 0, i32 0 %9 = call i8* @_lfortran_get_default_allocator() %10 = call i8* @_lfortran_malloc_alloc(i8* %9, i64 10) store i8* %10, i8** %8, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %mystring, i32 0, i32 0 %12 = getelementptr %string_descriptor, %string_descriptor* %mystring, i32 0, i32 1 %13 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_strcpy_alloc(i8* %2, i8** %11, i64* %12, i8 0, i8 0, i8* %13, i64 14) %14 = getelementptr %string_descriptor, %string_descriptor* %teststring, i32 0, i32 0 %15 = getelementptr %string_descriptor, %string_descriptor* %teststring, i32 0, i32 1 %16 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_strcpy_alloc(i8* %2, i8** %14, i64* %15, i8 0, i8 0, i8* %16, i64 4) store i32 0, i32* %call_arg_value, align 4 store i32 4, i32* %call_arg_value1, align 4 %17 = call i32 @_lcompilers_index_str(%string_descriptor* %mystring, %string_descriptor* %teststring, i32* %call_arg_value, i32* %call_arg_value1) %18 = icmp eq i32 %17, 0 br i1 %18, label %then, label %else then: ; preds = %.entry %19 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %19, i32 17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %ifcont else: ; preds = %.entry %20 = alloca i64, align 8 store i32 0, i32* %call_arg_value, align 4 store i32 4, i32* %call_arg_value1, align 4 %21 = call i32 @_lcompilers_index_str1(%string_descriptor* %mystring, %string_descriptor* %teststring, i32* %call_arg_value, i32* %call_arg_value1) %22 = alloca i32, align 4 store i32 %21, i32* %22, align 4 %23 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info, i32 0, i32 0), i64* %20, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.6, i32* %22) %24 = load i64, i64* %20, align 8 %25 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %23, i8** %25, align 8 %26 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %24, i64* %26, align 8 %27 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %28 = load i8*, i8** %27, align 8 %29 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %30 = load i64, i64* %29, align 8 %31 = trunc i64 %30 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %28, i32 %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %32 = icmp eq i8* %23, null br i1 %32, label %free_done, label %free_nonnull free_nonnull: ; preds = %else call void @_lfortran_free_alloc(i8* %2, i8* %23) br label %free_done free_done: ; preds = %free_nonnull, %else br label %ifcont ifcont: ; preds = %free_done, %then br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_string_11 FINALIZE_SYMTABLE_string_11: ; preds = %return br label %Finalize_Variable_mystring Finalize_Variable_mystring: ; preds = %FINALIZE_SYMTABLE_string_11 %33 = getelementptr %string_descriptor, %string_descriptor* %mystring, i32 0, i32 0 %34 = load i8*, i8** %33, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %34) br label %Finalize_Variable_teststring Finalize_Variable_teststring: ; preds = %Finalize_Variable_mystring %35 = getelementptr %string_descriptor, %string_descriptor* %teststring, i32 0, i32 0 %36 = load i8*, i8** %35, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %36) call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc_alloc(i8*, i64) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_strcpy_alloc(i8*, i8**, i64*, i8, i8, i8*, i64) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/llvm-int_dp-9b89d9f.json0000664000175000017500000000073715174404631023143 0ustar alastairalastair{ "basename": "llvm-int_dp-9b89d9f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/int_dp.f90", "infile_hash": "f59edf2644a27d68d7127283dbb961288e4041e2de16284795b100de", "outfile": null, "outfile_hash": null, "stdout": "llvm-int_dp-9b89d9f.stdout", "stdout_hash": "1a77e40ae8be629218f6ff9992c46d80c83ce781db827783358aafcb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-select_type1-36bfefb.stdout0000664000175000017500000000764715174404631024603 0ustar alastairalastair(TranslationUnit [(Program select_type1 () [] [(ImplicitNone [] () )] [] [(SelectType 0 () uptr (FuncCallOrArray value [(iter [])] [] [] [] [] ) [(TypeStmtType (AttrType TypeInteger [] () () None ) () [(Print 0 () [(FuncCallOrArray key [(iter [])] [] [] [] [] ) (String " = " ()) uptr] () )] ) (TypeStmtType (AttrType TypeReal [] () () None ) () [(Print 0 () [(FuncCallOrArray key [(iter [])] [] [] [] [] ) (String " = " ()) uptr] () )] ) (TypeStmtType (AttrType TypeCharacter [(() () Star)] () () None ) () [(Print 0 () [(FuncCallOrArray key [(iter [])] [] [] [] [] ) (String " = " ()) uptr] () )] ) (TypeStmtName point () [(Print 0 () [(FuncCallOrArray key [(iter [])] [] [] [] [] ) (String " = " ()) uptr] () )] ) (ClassStmt point2 () [(Print 0 () [(FuncCallOrArray key [(iter [])] [] [] [] [] ) (String " = " ()) uptr] () )] ) (ClassDefault () [(Print 0 () [(FuncCallOrArray key [(iter [])] [] [] [] [] ) (String " = " ()) uptr] () )] )] () () )] [] )] ) lfortran-0.63.0/tests/reference/asr-bindc_06-1fdaca6.json0000664000175000017500000000074215174404631023170 0ustar alastairalastair{ "basename": "asr-bindc_06-1fdaca6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bindc_06.f90", "infile_hash": "440638103af48bc45af28612b54a8986473962b10a857a1054bf9450", "outfile": null, "outfile_hash": null, "stdout": "asr-bindc_06-1fdaca6.stdout", "stdout_hash": "2eee61dbe3e53140dde382cff7b0286aa578105401b0b73e4b70c500", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-class_02-b56b852.stdout0000664000175000017500000006601215174404631023355 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { circle_test: (Program (SymbolTable 7 { main: (ExternalSymbol 7 main 2 main class_circle2 [] main Public ) }) circle_test [class_circle2] [(SubroutineCall 7 main () [] () .false. )] ), class_circle2: (Module (SymbolTable 2 { circle: (Struct (SymbolTable 3 { circle_area: (StructMethodDeclaration 3 circle_area () circle_area 2 circle_area Source .false. .false. ), circle_print: (StructMethodDeclaration 3 circle_print () circle_print 2 circle_print Source .false. .false. ), radius: (Variable 3 radius [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) circle (StructType [(Real 4)] [] .true. .false. ) [] [radius] [] Source Private .false. .false. [] () () [] ), circle_area: (Function (SymbolTable 4 { 1_circle_radius: (ExternalSymbol 4 1_circle_radius 3 radius circle [] radius Public ), circle_area: (Variable 4 circle_area [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), this: (Variable 4 this [] In () () Default (StructType [(Real 4)] [] .false. .false. ) 2 circle Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) circle_area (FunctionType [(StructType [(Real 4)] [] .false. .false. )] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 this)] [(Assignment (Var 4 circle_area) (RealBinOp (Var 2 pi) Mul (RealBinOp (StructInstanceMember (Var 4 this) 4 1_circle_radius (Real 4) () ) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) (Real 4) () ) () .false. .false. )] (Var 4 circle_area) Private .true. .true. () ), circle_print: (Function (SymbolTable 5 { 1_circle_circle_area: (ExternalSymbol 5 1_circle_circle_area 3 circle_area circle [] circle_area Public ), 1_circle_radius: (ExternalSymbol 5 1_circle_radius 3 radius circle [] radius Public ), area: (Variable 5 area [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), this: (Variable 5 this [] In () () Default (StructType [(Real 4)] [] .false. .false. ) 2 circle Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) circle_print (FunctionType [(StructType [(Real 4)] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 this)] [(Assignment (Var 5 area) (FunctionCall 5 1_circle_circle_area () [((Var 5 this))] (Real 4) () (Var 5 this) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Circle: r = " (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StructInstanceMember (Var 5 this) 5 1_circle_radius (Real 4) () ) (StringConstant " area = " (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 5 area)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Private .false. .false. () ), main: (Function (SymbolTable 6 { 1_circle_circle_print: (ExternalSymbol 6 1_circle_circle_print 3 circle_print circle [] circle_print Public ), 1_circle_radius: (ExternalSymbol 6 1_circle_radius 3 radius circle [] radius Public ), c: (Variable 6 c [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 2 circle Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 6 c) (StructConstructor 2 circle [((RealConstant 1.000000 (Real 4) ))] (StructType [(Real 4)] [] .true. .false. ) () ) () .false. .false. ) (Assignment (StructInstanceMember (Var 6 c) 6 1_circle_radius (Real 4) () ) (RealConstant 1.500000 (Real 4) ) () .false. .false. ) (SubroutineCall 6 1_circle_circle_print () [((Var 6 c))] (Var 6 c) .false. )] () Public .true. .true. () ), pi: (Variable 2 pi [] Local (Cast (RealConstant 3.141593 (Real 8) ) RealToReal (Real 4) (RealConstant 3.141593 (Real 4) ) () ) (RealConstant 3.141593 (Real 4) ) Save (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) class_circle2 () [class_circle2] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-arrays_01_size-352da98.json0000664000175000017500000000076415174404631024235 0ustar alastairalastair{ "basename": "asr-arrays_01_size-352da98", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01_size.f90", "infile_hash": "cb58e1bbc81b8cb3e39e493299f8ce73339c3bfe6f97ec12ea102145", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_01_size-352da98.stdout", "stdout_hash": "575dcafcdbb1b0d369c00b4d476f08f8186e1b98fcbdde3650076242", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-character_parameter_padding_trimming-ea91653.stderr0000664000175000017500000000270415174404631031316 0ustar alastairalastairwarning: The LHS character len=2 and the RHS character len=5 are not equal. --> tests/character_parameter_padding_trimming.f90:16:5 | 16 | character(len=2), parameter :: x_trim = "apple" !> char length on right is 5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the RHS character len to match the LHS character len warning: The LHS character len=3 and the RHS character len=4 are not equal. --> tests/character_parameter_padding_trimming.f90:17:5 | 17 | character(len=3), parameter :: y_trim = "Ball" !> char length on right is 4 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the RHS character len to match the LHS character len warning: The LHS character len=5 and the RHS character len=7 are not equal. --> tests/character_parameter_padding_trimming.f90:18:5 | 18 | character(len=5), parameter :: z_trim = x_trim // y_trim // x_trim !> char length on right is 26 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the RHS character len to match the LHS character len warning: The LHS character len=1 and the RHS character len=2 are not equal. --> tests/character_parameter_padding_trimming.f90:19:5 | 19 | character(len=1), parameter :: p_trim(3) = "25" !> char length on right is 2 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the RHS character len to match the LHS character len lfortran-0.63.0/tests/reference/asr-func_arg_array-609769c.json0000664000175000017500000000074615174404631024314 0ustar alastairalastair{ "basename": "asr-func_arg_array-609769c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/func_arg_array.f90", "infile_hash": "585115ceaab8814376b2532bf714e97b7bfe97787c158d257d79b778", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-func_arg_array-609769c.stderr", "stderr_hash": "1c2ceda2d3debb6eeca06ba8de41d75291e63259a93986ffeae8b60a", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-implicit10-f531a25.stdout0000664000175000017500000007116615174404631023721 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { a: (Variable 2 a [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d1: (Variable 2 d1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), e: (Variable 2 e [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), e1: (Variable 2 e1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Variable 2 f [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f1: (Variable 2 f1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), g: (Variable 2 g [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), h: (Variable 2 h [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 2 k [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 2 l [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 2 m [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), o: (Variable 2 o [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p: (Variable 2 p [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [d1 e1 f1] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 d1)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e1)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 f1))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [e1] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e1))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (ArrayItem (Var 2 y) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 d) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 f) (Cast (IntegerConstant 4 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 4.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 h) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 5.000000 (Real 8) ) () ) () .false. .false. ) (Assignment (Var 2 i) (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 6.000000 (Real 8) ) () ) () .false. .false. ) (Assignment (Var 2 l) (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 7.000000 0.000000 (Complex 4) ) () ) () .false. .false. ) (Assignment (Var 2 m) (Cast (IntegerConstant 8 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 8.000000 0.000000 (Complex 4) ) () ) () .false. .false. ) (Assignment (Var 2 o) (Cast (IntegerConstant 9 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 9.000000 (Real 8) ) () ) () .false. .false. ) (Assignment (Var 2 p) (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 10.000000 (Real 8) ) () ) () .false. .false. )] (Var 2 a) Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/llvm-generic_name_01-d3550a6.json0000664000175000017500000000077215174404631024472 0ustar alastairalastair{ "basename": "llvm-generic_name_01-d3550a6", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/generic_name_01.f90", "infile_hash": "cf72bd4f491d240363b4f763c22fc7dbd88483b3a7e5303471f65b40", "outfile": null, "outfile_hash": null, "stdout": "llvm-generic_name_01-d3550a6.stdout", "stdout_hash": "8081fa76d8dc65d07d2e6044668ea9111bee359e32381081c53771c7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-do1-a0276c3.json0000664000175000017500000000072415174404631022051 0ustar alastairalastair{ "basename": "ast-do1-a0276c3", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/do1.f", "infile_hash": "1337b06bc7bd2e8399bbec53c3b338a85a7390b1ee48f071715f020d", "outfile": null, "outfile_hash": null, "stdout": "ast-do1-a0276c3.stdout", "stdout_hash": "f727fb2be7079f3997d8fd75836451ea1887280b56ada1535e2f374c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/fortran-enum_01-3bcfd6d.json0000664000175000017500000000075315174404631023746 0ustar alastairalastair{ "basename": "fortran-enum_01-3bcfd6d", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/enum_01.f90", "infile_hash": "5dba9f630102c9e10a43f8075bc95880e0892b33a7fb16524b5ea275", "outfile": null, "outfile_hash": null, "stdout": "fortran-enum_01-3bcfd6d.stdout", "stdout_hash": "61380be62dbeca8ee13ec945530ec15c3b2f906d1f23c631f3c487d5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_33-b589c22.stdout0000664000175000017500000034733615174404631023740 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fpm_cmd_install: (Module (SymbolTable 2 { build_model: (ExternalSymbol 2 build_model 4 build_model fpm_modules_33 [] build_model Public ) }) fpm_cmd_install () [fpm_modules_33] .false. .false. .false. ), fpm_dependency_modules_33: (Module (SymbolTable 7 { add_project: (Function (SymbolTable 13 { error: (Variable 13 error [] Out () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 7 error_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), package: (Variable 13 package [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 7 package_config_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 13 self [] InOut () () Default (StructType [(Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 7 dependency_tree_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_project (FunctionType [(StructType [(Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 self) (Var 13 package) (Var 13 error)] [] () Public .true. .true. () ), add_project_dependencies: (Function (SymbolTable 14 { error: (Variable 14 error [] Out () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 7 error_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), main: (Variable 14 main [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), root: (Variable 14 root [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 14 self [] InOut () () Default (StructType [(Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 7 dependency_tree_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_project_dependencies (FunctionType [(StructType [(Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) (String 1 () AssumedLength DescriptorString) (Logical 4) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 14 self) (Var 14 root) (Var 14 main) (Var 14 error)] [] () Public .true. .true. () ), dependency_config_t: (Struct (SymbolTable 8 { name: (Variable 8 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), path: (Variable 8 path [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) dependency_config_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [name path] [] Source Public .false. .false. [] () () [] ), dependency_node_t: (Struct (SymbolTable 9 { done: (Variable 9 done [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), proj_dir: (Variable 9 proj_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), revision: (Variable 9 revision [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), update: (Variable 9 update [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) dependency_node_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [] [proj_dir revision done update] [] Source Public .false. .false. [] () 7 dependency_config_t [] ), dependency_tree_t: (Struct (SymbolTable 10 { add: (GenericProcedure 10 add [10 add_project 10 add_project_dependencies] Public ), add_project: (StructMethodDeclaration 10 add_project () add_project 7 add_project Source .false. .false. ), add_project_dependencies: (StructMethodDeclaration 10 add_project_dependencies () add_project_dependencies 7 add_project_dependencies Source .false. .false. ), cache: (Variable 10 cache [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dep: (Variable 10 dep [] Local () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 7 dependency_node_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dep_dir: (Variable 10 dep_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ndep: (Variable 10 ndep [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), unit: (Variable 10 unit [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), update: (GenericProcedure 10 update [10 update_dependency] Public ), update_dependency: (StructMethodDeclaration 10 update_dependency () update_dependency 7 update_dependency Source .false. .false. ), verbosity: (Variable 10 verbosity [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) dependency_tree_t (StructType [(Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [unit verbosity dep_dir ndep dep cache] [] Source Public .false. .false. [] () () [] ), error_t: (Struct (SymbolTable 11 { message: (Variable 11 message [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) error_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [message] [] Source Public .false. .false. [] () () [] ), package_config_t: (Struct (SymbolTable 12 { name: (Variable 12 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) package_config_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [name] [] Source Public .false. .false. [] () () [] ), update_dependency: (Function (SymbolTable 15 { error: (Variable 15 error [] Out () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 7 error_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), name: (Variable 15 name [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 15 self [] InOut () () Default (StructType [(Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 7 dependency_tree_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) update_dependency (FunctionType [(StructType [(Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) (String 1 () AssumedLength DescriptorString) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 15 self) (Var 15 name) (Var 15 error)] [] () Public .true. .true. () ) }) fpm_dependency_modules_33 () [] .true. .false. .false. ), fpm_model_modules_33: (Module (SymbolTable 17 { dependency_tree_t: (ExternalSymbol 17 dependency_tree_t 7 dependency_tree_t fpm_dependency_modules_33 [] dependency_tree_t Public ), fpm_model_t: (Struct (SymbolTable 18 { build_prefix: (Variable 18 build_prefix [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c_compile_flags: (Variable 18 c_compile_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), cxx_compile_flags: (Variable 18 cxx_compile_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), deps: (Variable 18 deps [] Local () () Default (StructType [(Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 17 dependency_tree_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), fortran_compile_flags: (Variable 18 fortran_compile_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), include_tests: (Variable 18 include_tests [] Local (LogicalConstant .true. (Logical 4) ) (LogicalConstant .true. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), link_flags: (Variable 18 link_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), package_name: (Variable 18 package_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fpm_model_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (Logical 4)] [] .true. .false. ) [dependency_tree_t] [package_name fortran_compile_flags c_compile_flags cxx_compile_flags link_flags build_prefix deps include_tests] [] Source Public .false. .false. [] () () [] ) }) fpm_model_modules_33 () [fpm_dependency_modules_33] .true. .false. .false. ), fpm_modules_33: (Module (SymbolTable 4 { build_model: (Function (SymbolTable 5 { 1_add: (ExternalSymbol 5 1_add 10 add 1_dependency_tree_t [] add Private ), 1_dependency_tree_t: (ExternalSymbol 5 1_dependency_tree_t 7 dependency_tree_t fpm_dependency_modules_33 [] dependency_tree_t Private ), 1_dependency_tree_t_add_project: (ExternalSymbol 5 1_dependency_tree_t_add_project 10 add_project 1_dependency_tree_t [] add_project Public ), 1_fpm_model_t_deps: (ExternalSymbol 5 1_fpm_model_t_deps 18 deps fpm_model_t [] deps Public ), error: (Variable 5 error [] Out () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 4 error_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), model: (Variable 5 model [] Out () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (Logical 4)] [] .true. .false. ) 4 fpm_model_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), package: (Variable 5 package [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 4 package_config_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) build_model (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (Logical 4)] [] .true. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 model) (Var 5 package) (Var 5 error)] [(SubroutineCall 5 1_dependency_tree_t_add_project 5 1_add [((StructInstanceMember (Var 5 model) 5 1_fpm_model_t_deps (StructType [(Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) () )) ((Var 5 package)) ((Var 5 error))] (StructInstanceMember (Var 5 model) 5 1_fpm_model_t_deps (StructType [(Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) () ) .false. )] () Public .true. .true. () ), error_t: (ExternalSymbol 4 error_t 7 error_t fpm_dependency_modules_33 [] error_t Public ), fpm_model_t: (ExternalSymbol 4 fpm_model_t 17 fpm_model_t fpm_model_modules_33 [] fpm_model_t Public ), package_config_t: (ExternalSymbol 4 package_config_t 7 package_config_t fpm_dependency_modules_33 [] package_config_t Public ) }) fpm_modules_33 () [fpm_dependency_modules_33 fpm_model_modules_33] .true. .false. .false. ), modules_33: (Program (SymbolTable 19 { }) modules_33 [] [(Print (StringConstant "running modules_33 program" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-pragma2-604d549.json0000664000175000017500000000071215174404631022644 0ustar alastairalastair{ "basename": "asr-pragma2-604d549", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/pragma2.f90", "infile_hash": "c76c30115a39aa0c98b24173c8517df1fb525bf101023b12dc38ca3e", "outfile": null, "outfile_hash": null, "stdout": "asr-pragma2-604d549.stdout", "stdout_hash": "79c54dd4de0892c36e8712bc21bf22ad18595bce552888cdd121e9ae", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-dint_args-0823aa1.json0000664000175000017500000000072715174404631023333 0ustar alastairalastair{ "basename": "asr-dint_args-0823aa1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dint_args.f90", "infile_hash": "2070168962f7bf0a98cb987d443506650737beb6909ff2319b0ab779", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dint_args-0823aa1.stderr", "stderr_hash": "2ef1e87d1dd172a51e033ddada381c518c2e6f939ed7e3222a24225b", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-loop_unroll_large-c6b628b.json0000664000175000017500000000077515174404631025177 0ustar alastairalastair{ "basename": "asr-loop_unroll_large-c6b628b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/loop_unroll_large.f90", "infile_hash": "6dea35d299ef0d2baadd87d2ed6132d3e57e15e85a4bef2d609d1d22", "outfile": null, "outfile_hash": null, "stdout": "asr-loop_unroll_large-c6b628b.stdout", "stdout_hash": "32861f73f618c67283722fb16924c8ecc176b06cc6683d3cfb367c9b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-subroutine7-27bdbfe.json0000664000175000017500000000072615174404631024104 0ustar alastairalastair{ "basename": "ast-subroutine7-27bdbfe", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine7.f90", "infile_hash": "3a15750c9d608f1988e0dd13f8d956be28a72297be5ef3137777cf2f", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine7-27bdbfe.stdout", "stdout_hash": "9d2a2173aee6b279a7a3b6a420347b530471957afeb7c66b70719f76", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_34-c5cfc20.json0000664000175000017500000000076115174404631024220 0ustar alastairalastair{ "basename": "asr-intrinsics_34-c5cfc20", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_34.f90", "infile_hash": "b5ac9ea3ec2758f2b774401a5e70d007023974e74b9903bfb4bcb384", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_34-c5cfc20.stdout", "stdout_hash": "bc715f65fd2210e3bbb3e47a899a3a7cc912350c638065db95091884", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit9-b56b139.stdout0000664000175000017500000005773715174404631023666 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { a: (Variable 2 a [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), e: (Variable 2 e [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Variable 2 f [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), h: (Variable 2 h [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 2 l [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 2 m [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), o: (Variable 2 o [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p: (Variable 2 p [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), q: (Variable 2 q [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 2 r [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [d e] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 d)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [e] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 d) (Var 2 e)] [(Assignment (ArrayItem (Var 2 y) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 b) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 d) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 f) (Cast (IntegerConstant 4 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 4 (Integer 8) Decimal) () ) () .false. .false. ) (Assignment (Var 2 h) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 i) (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 6.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 l) (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 7.000000 (Real 8) ) () ) () .false. .false. ) (Assignment (Var 2 m) (Cast (IntegerConstant 8 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 8.000000 0.000000 (Complex 4) ) () ) () .false. .false. ) (Assignment (Var 2 o) (Cast (IntegerConstant 9 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 9.000000 0.000000 (Complex 4) ) () ) () .false. .false. ) (Assignment (Var 2 p) (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToComplex (Complex 8) (ComplexConstant 10.000000 0.000000 (Complex 8) ) () ) () .false. .false. ) (Assignment (Var 2 q) (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 11.000000 (Real 8) ) () ) () .false. .false. ) (Assignment (Var 2 r) (Cast (IntegerConstant 12 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 12.000000 (Real 8) ) () ) () .false. .false. )] (Var 2 a) Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-array10-1f60f5f.json0000664000175000017500000000071215174404631022730 0ustar alastairalastair{ "basename": "asr-array10-1f60f5f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/array10.f90", "infile_hash": "e8d36796501eef9e4d715dd3dbe300523148b047e92967b60757e132", "outfile": null, "outfile_hash": null, "stdout": "asr-array10-1f60f5f.stdout", "stdout_hash": "e1eb3a8691f06d47a8572110f9e6c94529841796da6c3b4d24656040", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-substring-59dd84f.json0000664000175000017500000000072015174404631023504 0ustar alastairalastair{ "basename": "ast-substring-59dd84f", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/substring.f90", "infile_hash": "c8a378c73c450c69e6694f02f51b2e1706ee25ae2e9645c28fd98788", "outfile": null, "outfile_hash": null, "stdout": "ast-substring-59dd84f.stdout", "stdout_hash": "5ce0edb1c1102420bfc100af59a72b8b5505be81563698c68d39067c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-nested_04-39da8f9.stdout0000664000175000017500000002052315174404631024010 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @__module___lcompilers_created__nested_context__b__y = global i32 0 @__module___lcompilers_created__nested_context__b__yy = global float 0.000000e+00 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [3 x i8] c"b()" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data, i32 0, i32 0), i64 3 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @__module_nested_04_a_b(i32* %x) { .entry: %call_arg_value = alloca i32, align 4 %b = alloca i32, align 4 %y = alloca i32, align 4 %yy = alloca float, align 4 store float 0x401A666660000000, float* %yy, align 4 %0 = load i32, i32* %x, align 4 store i32 %0, i32* %y, align 4 %1 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %1, i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %2 = load i32, i32* %y, align 4 store i32 %2, i32* @__module___lcompilers_created__nested_context__b__y, align 4 %3 = load float, float* %yy, align 4 store float %3, float* @__module___lcompilers_created__nested_context__b__yy, align 4 store i32 6, i32* %call_arg_value, align 4 %4 = call i32 @b.__module_nested_04_a_c(i32* %call_arg_value) store i32 %4, i32* %b, align 4 %5 = load i32, i32* @__module___lcompilers_created__nested_context__b__y, align 4 store i32 %5, i32* %y, align 4 %6 = load float, float* @__module___lcompilers_created__nested_context__b__yy, align 4 store float %6, float* %yy, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return %7 = load i32, i32* %b, align 4 ret i32 %7 } define i32 @b.__module_nested_04_a_c(i32* %z) { .entry: %stringFormat_desc4 = alloca %string_descriptor, align 8 %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %c = alloca i32, align 4 %1 = alloca i64, align 8 %2 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %1, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %z) %3 = load i64, i64* %1, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %2, i8** %4, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %3, i64* %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %7 = load i8*, i8** %6, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %9 = load i64, i64* %8, align 8 %10 = trunc i64 %9 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %7, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %11 = icmp eq i8* %2, null br i1 %11, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %2) br label %free_done free_done: ; preds = %free_nonnull, %.entry %12 = alloca i64, align 8 %13 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %12, i32 0, i32 0, i32 0, i32 0, i32 0, i32* @__module___lcompilers_created__nested_context__b__y) %14 = load i64, i64* %12, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %13, i8** %15, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %14, i64* %16, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %18 = load i8*, i8** %17, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %20 = load i64, i64* %19, align 8 %21 = trunc i64 %20 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %18, i32 %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %22 = icmp eq i8* %13, null br i1 %22, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %0, i8* %13) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %23 = alloca i64, align 8 %24 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %23, i32 0, i32 0, i32 0, i32 0, i32 0, float* @__module___lcompilers_created__nested_context__b__yy) %25 = load i64, i64* %23, align 8 %26 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %24, i8** %26, align 8 %27 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %25, i64* %27, align 8 %28 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %29 = load i8*, i8** %28, align 8 %30 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %31 = load i64, i64* %30, align 8 %32 = trunc i64 %31 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %29, i32 %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %33 = icmp eq i8* %24, null br i1 %33, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free_alloc(i8* %0, i8* %24) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 %34 = load i32, i32* %z, align 4 store i32 %34, i32* %c, align 4 br label %return return: ; preds = %free_done6 br label %FINALIZE_SYMTABLE_c FINALIZE_SYMTABLE_c: ; preds = %return %35 = load i32, i32* %c, align 4 ret i32 %35 } declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %test = alloca i32, align 4 store i32 5, i32* %call_arg_value, align 4 %2 = call i32 @__module_nested_04_a_b(i32* %call_arg_value) store i32 %2, i32* %test, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_nested_04 FINALIZE_SYMTABLE_nested_04: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-allocate_05-48fb994.json0000664000175000017500000000075315174404631023502 0ustar alastairalastair{ "basename": "asr-allocate_05-48fb994", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/allocate_05.f90", "infile_hash": "4aec5c0fcf89fa53670beb1afa8af66e589841696723e0f2f4d966ba", "outfile": null, "outfile_hash": null, "stdout": "asr-allocate_05-48fb994.stdout", "stdout_hash": "18c29153d873283dca5e9586ee0529acb24cb9e61a62344ee0c1f1b7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-int_dp_param-f284039.stdout0000664000175000017500000000537215174404631024515 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @int_dp_param.u = internal global i32 2147483647 @int_dp_param.v = internal global i64 2147483647 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [6 x i8] c"I4,I8\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %prec1 = alloca i32, align 4 store i32 4, i32* %prec1, align 4 %prec2 = alloca i32, align 4 store i32 8, i32* %prec2, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, i32* @int_dp_param.u, i64* @int_dp_param.v) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_int_dp_param FINALIZE_SYMTABLE_int_dp_param: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-submodule_02-9152b7b.json0000664000175000017500000000075615174404631023677 0ustar alastairalastair{ "basename": "asr-submodule_02-9152b7b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/submodule_02.f90", "infile_hash": "9ccb7a7264e9e91b29172a78a9dd1ba10f228c6d32082b5391653881", "outfile": null, "outfile_hash": null, "stdout": "asr-submodule_02-9152b7b.stdout", "stdout_hash": "d522dbcf9872b068bfc8f7e9438b9bf1668a250ffd1160c6c8826d99", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_14-302666f.stdout0000664000175000017500000010114115174404631024350 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_14: (Program (SymbolTable 2 { i1: (Variable 2 i1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k1: (Variable 2 k1 [] Local (IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 5 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k10: (Variable 2 k10 [] Local (IntrinsicElementalFunction SelectedCharKind [(StringConstant "default" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k11: (Variable 2 k11 [] Local (IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k12: (Variable 2 k12 [] Local (IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k2: (Variable 2 k2 [] Local (IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 5 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k3: (Variable 2 k3 [] Local (IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 5 (Integer 8) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k4: (Variable 2 k4 [] Local (IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 8 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k5: (Variable 2 k5 [] Local (IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 10 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k6: (Variable 2 k6 [] Local (IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k7: (Variable 2 k7 [] Local (IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k8: (Variable 2 k8 [] Local (IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 5 (Integer 8) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k9: (Variable 2 k9 [] Local (IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 8 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s1: (Variable 2 s1 [] Local () () Default (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_14 [] [(Assignment (Var 2 s1) (StringConstant "default" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 i1) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 5 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (Var 2 k1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 5 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (Var 2 k2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 5 (Integer 8) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (Var 2 k3)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 8 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (Var 2 k4)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 10 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (Var 2 k5)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (Var 2 k6)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (Var 2 k7)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 5 (Integer 8) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (Var 2 k8)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 8 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (Var 2 k9)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedCharKind [(StringConstant "default" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) (Var 2 k10)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedIntKind [(Var 2 i1)] 0 (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedRealKind [(Var 2 i1) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedCharKind [(Var 2 s1)] 0 (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (Var 2 k11)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (Var 2 k12)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_travel_01-cd2b445.stdout0000664000175000017500000052106615174404631025516 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_travel_01: (Program (SymbolTable 22 { add_real: (ExternalSymbol 22 add_real 2 add_real template_travel_01_math [] add_real Public ), operations: (ExternalSymbol 22 operations 5 operations template_travel_01_travel [] operations Public ), slash_real: (ExternalSymbol 22 slash_real 2 slash_real template_travel_01_math [] slash_real Public ), test_template: (ExternalSymbol 22 test_template 18 test_template template_travel_01_m [] test_template Public ), travel_tmpl: (ExternalSymbol 22 travel_tmpl 5 travel_tmpl template_travel_01_travel [] travel_tmpl Public ) }) template_travel_01 [template_travel_01_m template_travel_01_math template_travel_01_travel] [(SubroutineCall 22 test_template () [] () .false. )] ), template_travel_01_m: (Module (SymbolTable 18 { add_real: (ExternalSymbol 18 add_real 2 add_real template_travel_01_math [] add_real Public ), operations: (ExternalSymbol 18 operations 5 operations template_travel_01_travel [] operations Public ), slash_real: (ExternalSymbol 18 slash_real 2 slash_real template_travel_01_math [] slash_real Public ), test_template: (Function (SymbolTable 19 { __asr_avg_s_from_t: (Function (SymbolTable 23 { avg: (Variable 23 avg [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d1: (Variable 23 d1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d2: (Variable 23 d2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t1: (Variable 23 t1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t2: (Variable 23 t2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __asr_avg_s_from_t (FunctionType [(Real 4) (Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 23 d1) (Var 23 t1) (Var 23 d2) (Var 23 t2)] [(Assignment (Var 23 avg) (FunctionCall 18 slash_real () [((FunctionCall 18 add_real () [((Var 23 d1)) ((Var 23 d2))] (Real 4) () () )) ((FunctionCall 18 add_real () [((Var 23 t1)) ((Var 23 t2))] (Real 4) () () ))] (Real 4) () () ) () .false. .false. )] (Var 23 avg) Public .true. .true. () ), avg_real_s_from_s: (Function (SymbolTable 21 { avg: (Variable 21 avg [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d1: (Variable 21 d1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d2: (Variable 21 d2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s1: (Variable 21 s1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s2: (Variable 21 s2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) avg_real_s_from_s (FunctionType [(Real 4) (Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [__asr_avg_s_from_t] [(Var 21 d1) (Var 21 s1) (Var 21 d2) (Var 21 s2)] [(Assignment (Var 21 avg) (FunctionCall 19 __asr_avg_s_from_t () [((Var 21 d1)) ((FunctionCall 18 slash_real () [((Var 21 d1)) ((Var 21 s1))] (Real 4) () () )) ((Var 21 d2)) ((FunctionCall 18 slash_real () [((Var 21 d2)) ((Var 21 s2))] (Real 4) () () ))] (Real 4) () () ) () .false. .false. )] (Var 21 avg) Private .true. .true. () ), avg_real_s_from_t: (Function (SymbolTable 20 { avg: (Variable 20 avg [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d1: (Variable 20 d1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d2: (Variable 20 d2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t1: (Variable 20 t1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t2: (Variable 20 t2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) avg_real_s_from_t (FunctionType [(Real 4) (Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 20 d1) (Var 20 t1) (Var 20 d2) (Var 20 t2)] [(Assignment (Var 20 avg) (FunctionCall 18 slash_real () [((FunctionCall 18 add_real () [((Var 20 d1)) ((Var 20 d2))] (Real 4) () () )) ((FunctionCall 18 add_real () [((Var 20 t1)) ((Var 20 t2))] (Real 4) () () ))] (Real 4) () () ) () .false. .false. )] (Var 20 avg) Public .true. .true. () ), s1: (Variable 19 s1 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s2: (Variable 19 s2 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 19 s1) (FunctionCall 19 avg_real_s_from_t () [((RealConstant 1.000000 (Real 4) )) ((RealConstant 3.000000 (Real 4) )) ((RealConstant 1.500000 (Real 4) )) ((RealConstant 4.000000 (Real 4) ))] (Real 4) () () ) () .false. .false. ) (Assignment (Var 19 s2) (FunctionCall 19 avg_real_s_from_s () [((RealConstant 1.100000 (Real 4) )) ((RealConstant 0.500000 (Real 4) )) ((RealConstant 2.000000 (Real 4) )) ((RealConstant 0.750000 (Real 4) ))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "s1=" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 19 s1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "s2=" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 19 s2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), travel_tmpl: (ExternalSymbol 18 travel_tmpl 5 travel_tmpl template_travel_01_travel [] travel_tmpl Public ) }) template_travel_01_m () [template_travel_01_math template_travel_01_travel template_travel_01_m] .false. .false. .false. ), template_travel_01_math: (Module (SymbolTable 2 { add_real: (Function (SymbolTable 3 { total: (Variable 3 total [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 3 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 y)] [(Assignment (Var 3 total) (RealBinOp (Var 3 x) Add (Var 3 y) (Real 4) () ) () .false. .false. )] (Var 3 total) Public .true. .true. () ), slash_real: (Function (SymbolTable 4 { total: (Variable 4 total [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 4 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) slash_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 x) (Var 4 y)] [(Assignment (Var 4 total) (RealBinOp (Var 4 x) Div (Var 4 y) (Real 4) () ) () .false. .false. )] (Var 4 total) Public .true. .true. () ) }) template_travel_01_math () [] .false. .false. .false. ), template_travel_01_travel: (Module (SymbolTable 5 { add_real: (ExternalSymbol 5 add_real 2 add_real template_travel_01_math [] add_real Public ), operations: (Requirement (SymbolTable 6 { d: (Variable 6 d [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d_divided_by_s: (Function (SymbolTable 10 { d: (Variable 10 d [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 10 n [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), quotient: (Variable 10 quotient [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) d_divided_by_s (FunctionType [(TypeParameter d ) (TypeParameter s )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 10 n) (Var 10 d)] [] (Var 10 quotient) Private .true. .true. () ), d_divided_by_t: (Function (SymbolTable 9 { d: (Variable 9 d [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 9 n [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), quotient: (Variable 9 quotient [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) d_divided_by_t (FunctionType [(TypeParameter d ) (TypeParameter t )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 9 n) (Var 9 d)] [] (Var 9 quotient) Private .true. .true. () ), plus_d: (Function (SymbolTable 7 { l: (Variable 7 l [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 7 r [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), total: (Variable 7 total [] ReturnVar () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus_d (FunctionType [(TypeParameter d ) (TypeParameter d )] (TypeParameter d ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 7 l) (Var 7 r)] [] (Var 7 total) Private .true. .true. () ), plus_t: (Function (SymbolTable 8 { l: (Variable 8 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 8 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), total: (Variable 8 total [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 8 l) (Var 8 r)] [] (Var 8 total) Private .true. .true. () ), s: (Variable 6 s [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 6 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) operations [d t s plus_d plus_t d_divided_by_t d_divided_by_s] [] ), slash_real: (ExternalSymbol 5 slash_real 2 slash_real template_travel_01_math [] slash_real Public ), travel_tmpl: (Template (SymbolTable 11 { avg_s_from_s: (Function (SymbolTable 17 { avg: (Variable 17 avg [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d1: (Variable 17 d1 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d2: (Variable 17 d2 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s1: (Variable 17 s1 [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s2: (Variable 17 s2 [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) avg_s_from_s (FunctionType [(TypeParameter d ) (TypeParameter s ) (TypeParameter d ) (TypeParameter s )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [d_divided_by_s avg_s_from_t] [(Var 17 d1) (Var 17 s1) (Var 17 d2) (Var 17 s2)] [(Assignment (Var 17 avg) (FunctionCall 11 avg_s_from_t () [((Var 17 d1)) ((FunctionCall 11 d_divided_by_s () [((Var 17 d1)) ((Var 17 s1))] (TypeParameter t ) () () )) ((Var 17 d2)) ((FunctionCall 11 d_divided_by_s () [((Var 17 d2)) ((Var 17 s2))] (TypeParameter t ) () () ))] (TypeParameter s ) () () ) () .false. .false. )] (Var 17 avg) Private .true. .true. () ), avg_s_from_t: (Function (SymbolTable 16 { avg: (Variable 16 avg [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d1: (Variable 16 d1 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d2: (Variable 16 d2 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t1: (Variable 16 t1 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t2: (Variable 16 t2 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) avg_s_from_t (FunctionType [(TypeParameter d ) (TypeParameter t ) (TypeParameter d ) (TypeParameter t )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [plus_d plus_t d_divided_by_t] [(Var 16 d1) (Var 16 t1) (Var 16 d2) (Var 16 t2)] [(Assignment (Var 16 avg) (FunctionCall 11 d_divided_by_t () [((FunctionCall 11 plus_d () [((Var 16 d1)) ((Var 16 d2))] (TypeParameter d ) () () )) ((FunctionCall 11 plus_t () [((Var 16 t1)) ((Var 16 t2))] (TypeParameter t ) () () ))] (TypeParameter s ) () () ) () .false. .false. )] (Var 16 avg) Public .true. .true. () ), d: (Variable 11 d [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d_divided_by_s: (Function (SymbolTable 15 { d: (Variable 15 d [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 15 n [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), quotient: (Variable 15 quotient [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) d_divided_by_s (FunctionType [(TypeParameter d ) (TypeParameter s )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 15 n) (Var 15 d)] [] (Var 15 quotient) Private .true. .true. () ), d_divided_by_t: (Function (SymbolTable 14 { d: (Variable 14 d [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 14 n [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), quotient: (Variable 14 quotient [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) d_divided_by_t (FunctionType [(TypeParameter d ) (TypeParameter t )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 14 n) (Var 14 d)] [] (Var 14 quotient) Private .true. .true. () ), plus_d: (Function (SymbolTable 12 { l: (Variable 12 l [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 12 r [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), total: (Variable 12 total [] ReturnVar () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus_d (FunctionType [(TypeParameter d ) (TypeParameter d )] (TypeParameter d ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 12 l) (Var 12 r)] [] (Var 12 total) Private .true. .true. () ), plus_t: (Function (SymbolTable 13 { l: (Variable 13 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 13 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), total: (Variable 13 total [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 13 l) (Var 13 r)] [] (Var 13 total) Private .true. .true. () ), s: (Variable 11 s [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 11 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) travel_tmpl [d t s plus_d plus_t d_divided_by_t d_divided_by_s] [(Require operations [d t s plus_d plus_t d_divided_by_t d_divided_by_s] )] ) }) template_travel_01_travel () [template_travel_01_math template_travel_01_travel] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/llvm-boz_01-def9db5.stdout0000664000175000017500000002010415174404631023443 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [18 x i8] c"I4,I4,I4,I4,I4,R4\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %boz_1 = alloca i32, align 4 %boz_2 = alloca i32, align 4 %boz_3 = alloca i32, align 4 %boz_4 = alloca i32, align 4 %boz_5 = alloca i32, align 4 %boz_6 = alloca float, align 4 store i32 93, i32* %boz_1, align 4 store i32 1255, i32* %boz_2, align 4 store i32 2748, i32* %boz_3, align 4 store i32 180150001, i32* %boz_4, align 4 store i32 180150001, i32* %boz_5, align 4 store float 0x36DA000000000000, float* %boz_6, align 4 %3 = load i32, i32* %boz_4, align 4 %4 = load i32, i32* %boz_5, align 4 %5 = icmp ne i32 %3, %4 br i1 %5, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %6 = load i32, i32* %boz_1, align 4 %7 = icmp ne i32 %6, 93 br i1 %7, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %8 = load i32, i32* %boz_2, align 4 %9 = icmp ne i32 %8, 1255 br i1 %9, label %then4, label %else5 then4: ; preds = %ifcont3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont6 else5: ; preds = %ifcont3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 %10 = load i32, i32* %boz_3, align 4 %11 = icmp ne i32 %10, 2748 br i1 %11, label %then7, label %else8 then7: ; preds = %ifcont6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 %12 = load i32, i32* %boz_4, align 4 %13 = icmp ne i32 %12, 180150001 br i1 %13, label %then10, label %else11 then10: ; preds = %ifcont9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont12 else11: ; preds = %ifcont9 br label %ifcont12 ifcont12: ; preds = %else11, %then10 %14 = load i32, i32* %boz_5, align 4 %15 = icmp ne i32 %14, 180150001 br i1 %15, label %then13, label %else14 then13: ; preds = %ifcont12 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont15 else14: ; preds = %ifcont12 br label %ifcont15 ifcont15: ; preds = %else14, %then13 %16 = alloca i64, align 8 %17 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @serialization_info, i32 0, i32 0), i64* %16, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %boz_1, i32* %boz_2, i32* %boz_3, i32* %boz_4, i32* %boz_5, float* %boz_6) %18 = load i64, i64* %16, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %17, i8** %19, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %18, i64* %20, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %22 = load i8*, i8** %21, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %24 = load i64, i64* %23, align 8 %25 = trunc i64 %24 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %22, i32 %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) %26 = icmp eq i8* %17, null br i1 %26, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont15 call void @_lfortran_free_alloc(i8* %2, i8* %17) br label %free_done free_done: ; preds = %free_nonnull, %ifcont15 br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_boz_01 FINALIZE_SYMTABLE_boz_01: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) lfortran-0.63.0/tests/reference/asr-associate_05-4641244.json0000664000175000017500000000075615174404631023513 0ustar alastairalastair{ "basename": "asr-associate_05-4641244", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/associate_05.f90", "infile_hash": "d3e3285cba1bab5ce2798d7c376c75626b7e5d36b0e47dc62a16a0b1", "outfile": null, "outfile_hash": null, "stdout": "asr-associate_05-4641244.stdout", "stdout_hash": "d2cec3bc262e96c3156e05ad09900c87c983d5ca71b51f93777f948d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format_57-fd2be24.stdout0000664000175000017500000000055315174404631023722 0ustar alastairalastairkind sp dp ep epsilon: 0.119E-0006 0.222E-0015 0.222E-0015 tiny : 0.118E-0037 0.223E-0307 0.223E-0307 huge : 0.340E+0039 0.180E+0309 0.180E+0309 epsilon: 1.19E-0007 2.22E-0016 2.22E-0016 tiny : 1.18E-0038 2.23E-0308 2.23E-0308 huge : 3.40E+0038 1.80E+0308 1.80E+0308 "0.22222E-200" " 0.22222-200" "2.22222E-201" " 2.22222-201" lfortran-0.63.0/tests/reference/asr-write2-3444284.json0000664000175000017500000000070715174404631022450 0ustar alastairalastair{ "basename": "asr-write2-3444284", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/write2.f90", "infile_hash": "e32f4a7448b2f59536da5f9579270c896bf9d80ebadd03daccc928a1", "outfile": null, "outfile_hash": null, "stdout": "asr-write2-3444284.stdout", "stdout_hash": "97ac744f0dcb81e59ce534fd990ab748ed7c4f0046a6a3c5a4261b1d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-expr_07-d5a6b4c.json0000664000175000017500000000073015174404631023327 0ustar alastairalastair{ "basename": "julia-expr_07-d5a6b4c", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/expr_07.f90", "infile_hash": "3104b4735ed58e4c3d370db99249102fa43c866834c04484ea2b7bae", "outfile": null, "outfile_hash": null, "stdout": "julia-expr_07-d5a6b4c.stdout", "stdout_hash": "cf9271a274f8e200abd752d92c0c908cbb4982ca0c3f92352de65f84", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-doloop_03-9c463c5.stdout0000664000175000017500000002335415174404631023552 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { doloop_03: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) doloop_03 [] [(Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 2 i) Eq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [] [] ) (If () (IntegerCompare (Var 2 i) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Exit () )] [] )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(If () (IntegerCompare (Var 2 i) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Exit () )] [] ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(If () (IntegerCompare (Var 2 i) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Cycle () )] [] ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 53 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/run-write5-2f63ce9.stdout0000664000175000017500000000005215174404631023261 0ustar alastairalastairhibye first , last Hello world! lfortran-0.63.0/tests/reference/ast-data1-58e5b8d.json0000664000175000017500000000070415174404631022455 0ustar alastairalastair{ "basename": "ast-data1-58e5b8d", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/data1.f90", "infile_hash": "958a14b00f4c624f5f8c444b2e93bcf090a57ee3c44143ec6671b5f6", "outfile": null, "outfile_hash": null, "stdout": "ast-data1-58e5b8d.stdout", "stdout_hash": "8771085e2c96c4c9792a3dd6794b346bcc9318d13ed0ec3d91cc09f8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-print_intrinsics-8e5d219.stdout0000664000175000017500000001514415174404631025354 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { print_intrinsics: (Program (SymbolTable 2 { dp: (Variable 2 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 1.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sp: (Variable 2 sp [] Local (TypeInquiry Kind (Real 4) (RealConstant 1.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) print_intrinsics [] [(Print (StringFormat () [(StringConstant "pi=acos(-1.0_sp) =\"" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (IntrinsicElementalFunction Acos [(RealUnaryMinus (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant -1.000000 (Real 4) ) )] 0 (Real 4) (RealConstant 3.141593 (Real 4) ) ) (StringConstant "\"" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "pi=acos(-1.0_dp) =\"" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (IntrinsicElementalFunction Acos [(RealUnaryMinus (RealConstant 1.000000 (Real 8) ) (Real 8) (RealConstant -1.000000 (Real 8) ) )] 0 (Real 8) (RealConstant 3.141593 (Real 8) ) ) (StringConstant "\"" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-where_04-a7fce45.stdout0000664000175000017500000005537615174404631023540 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { compare_solutions: (Function (SymbolTable 3 { absdiff: (Variable 3 absdiff [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), reldiff: (Variable 3 reldiff [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) compare_solutions (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [solution] [] [(Assignment (Var 3 reldiff) (ArrayConstant 8 [0.00000000e+00, 0.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 3 absdiff) (RealConstant 0.500000 (Real 4) ) () .false. .false. ) (Where (RealCompare (FunctionCall 2 solution () [] (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () () ) NotEq (RealConstant 0.000000 (Real 4) ) (Array (Logical 4) [(() ())] DescriptorArray ) () ) [(Assignment (Var 3 reldiff) (RealBinOp (ArrayBroadcast (Var 3 absdiff) (IntrinsicArrayFunction Shape [(IntrinsicElementalFunction Abs [(FunctionCall 2 solution () [] (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () () )] 0 (Array (Real 4) [(() ())] DescriptorArray ) () )] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 4) [(() ())] DescriptorArray ) () ) Div (IntrinsicElementalFunction Abs [(FunctionCall 2 solution () [] (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () () )] 0 (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 3 reldiff) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 5.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 3 reldiff) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 5.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 3 reldiff)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), solution: (Function (SymbolTable 4 { x: (Variable 4 x [] ReturnVar () () Default (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) solution (FunctionType [] (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 4 x) (ArrayConstant 8 [1.00000001e-01, 1.00000001e-01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. )] (Var 4 x) Public .true. .true. () ) }) main [] [(SubroutineCall 2 compare_solutions () [] () .false. )] ) }) [] ) ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootlfortran-0.63.0/tests/reference/pass_transform_optional_argument_functions-functions_15-581089a.stdoutlfortran-0.63.0/tests/reference/pass_transform_optional_argument_functions-functions_15-581089a.stdo0000664000175000017500000012253515174404631034013 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_15: (Program (SymbolTable 4 { __libasr_created_variable_: (Variable 4 __libasr_created_variable_ [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_variable_1: (Variable 4 __libasr_created_variable_1 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_variable_2: (Variable 4 __libasr_created_variable_2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_variable_3: (Variable 4 __libasr_created_variable_3 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_variable_4: (Variable 4 __libasr_created_variable_4 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a: (Variable 4 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Function (SymbolTable 5 { __libasr_is_present_x: (Variable 5 __libasr_is_present_x [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Variable 5 f [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 5 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Integer 4) (Logical 4)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x) (Var 5 __libasr_is_present_x)] [(Assignment (Var 5 f) (Var 5 __libasr_is_present_x) () .false. .false. )] (Var 5 f) Public .true. .true. () ), sub_1: (ExternalSymbol 4 sub_1 2 sub_1 functions_15_module_1 [] sub_1 Public ) }) functions_15 [functions_15_module_1] [(Assignment (Var 4 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 4 b) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) () .false. .false. ) (SubroutineCall 4 sub_1 () [((Var 4 a)) ((Var 4 b)) ((LogicalConstant .true. (Logical 4) )) ((RealConstant 12.000000 (Real 4) )) ((LogicalConstant .true. (Logical 4) )) ((IntegerConstant 5 (Integer 4) Decimal)) ((LogicalConstant .true. (Logical 4) )) ((RealConstant 6.000000 (Real 4) ))] () .false. ) (SubroutineCall 4 sub_1 () [((Var 4 a)) ((Var 4 b)) ((LogicalConstant .false. (Logical 4) )) ((Var 4 __libasr_created_variable_1)) ((LogicalConstant .false. (Logical 4) )) ((Var 4 __libasr_created_variable_2)) ((LogicalConstant .false. (Logical 4) )) ((RealConstant 6.000000 (Real 4) ))] () .false. ) (SubroutineCall 4 sub_1 () [((Var 4 a)) ((Var 4 b)) ((LogicalConstant .true. (Logical 4) )) ((Var 4 __libasr_created_variable_3)) ((LogicalConstant .false. (Logical 4) )) ((IntegerConstant 78 (Integer 4) Decimal)) ((LogicalConstant .true. (Logical 4) )) ((RealConstant 117.000000 (Real 4) ))] () .false. ) (SubroutineCall 4 sub_1 () [((Var 4 a)) ((Var 4 b)) ((LogicalConstant .false. (Logical 4) )) ((RealConstant 58.000000 (Real 4) )) ((LogicalConstant .true. (Logical 4) )) ((Var 4 __libasr_created_variable_4)) ((LogicalConstant .false. (Logical 4) )) ((RealConstant 123.000000 (Real 4) ))] () .false. ) (Print (StringFormat () [(Var 4 a) (Var 4 b)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 4 a) NotEq (IntegerConstant 144288208 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 4 b) NotEq (RealConstant 1477476.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(FunctionCall 4 f () [((Var 4 __libasr_created_variable_)) ((LogicalConstant .false. (Logical 4) ))] (Logical 4) () () ) (FunctionCall 4 f () [((IntegerConstant 42 (Integer 4) Decimal)) ((LogicalConstant .true. (Logical 4) ))] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), functions_15_module_1: (Module (SymbolTable 2 { sub_1: (Function (SymbolTable 3 { __libasr_is_present_d: (Variable 3 __libasr_is_present_d [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_is_present_e: (Variable 3 __libasr_is_present_e [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a: (Variable 3 a [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] InOut () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 3 c [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 3 d [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), e: (Variable 3 e [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Variable 3 f [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub_1 (FunctionType [(Integer 4) (Real 4) (Logical 4) (Real 4) (Logical 4) (Integer 4) (Logical 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 c) (Var 3 d) (Var 3 __libasr_is_present_d) (Var 3 e) (Var 3 __libasr_is_present_e) (Var 3 f)] [(If () (Var 3 __libasr_is_present_d) [(Assignment (Var 3 a) (Cast (RealBinOp (RealBinOp (Var 3 b) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) Add (Var 3 d) (Real 4) () ) RealToInteger (Integer 4) () () ) () .false. .false. ) (If () (Var 3 __libasr_is_present_e) [(Assignment (Var 3 b) (RealBinOp (RealBinOp (Var 3 b) Mul (Var 3 f) (Real 4) () ) Add (Cast (Var 3 e) IntegerToReal (Real 4) () () ) (Real 4) () ) () .false. .false. )] [(Assignment (Var 3 b) (RealBinOp (Var 3 b) Mul (Var 3 f) (Real 4) () ) () .false. .false. )] )] [(Assignment (Var 3 a) (Cast (RealBinOp (Var 3 b) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) RealToInteger (Integer 4) () () ) () .false. .false. ) (If () (Var 3 __libasr_is_present_e) [(Assignment (Var 3 b) (RealBinOp (RealBinOp (Var 3 b) Mul (Var 3 f) (Real 4) () ) Add (Cast (Var 3 e) IntegerToReal (Real 4) () () ) (Real 4) () ) () .false. .false. )] [(Assignment (Var 3 b) (RealBinOp (Var 3 b) Mul (Var 3 f) (Real 4) () ) () .false. .false. )] )] )] () Public .true. .true. () ) }) functions_15_module_1 () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_error_01b-e284c9a.stderr0000664000175000017500000000055115174404631025474 0ustar alastairalastairsemantic error: Template argument plus_t has not been declared in template specification. --> tests/errors/template_error_01b.f90:19:5 - 41:1 | 19 | template travel_tmpl(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 41 | | ...^ lfortran-0.63.0/tests/reference/ast-parsing_02-740c1e5.stdout0000664000175000017500000002546715174404631023721 0ustar alastairalastair(TranslationUnit [(Module program_parsing_02_submodule (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(complex [] [] () 1 Equal ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [] [(true [] [] () (Logical .true. ()) Equal ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [] [(false [] [] () (Logical .false. ()) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DerivedType type [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Declaration (AttrType TypeType [] () type None ) [(SimpleAttribute AttrAllocatable )] [(types [(() () DimensionExpr)] [] () () None ())] () )] [] ) (Interface (InterfaceHeader) () [(InterfaceProc (Subroutine function [(integer) (real)] [(SimpleAttribute AttrModule )] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(integer [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent Out )] [(real [] [] () () None ())] () )] [] [] [] ) )] )] [] [] ) (Submodule program_parsing_02_submodule () program_parsing_02_module (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Procedure function [] [(SimpleAttribute AttrModule )] () [] [] [] [] [(Assignment 0 real (* 2 integer) () )] [] )] ) (Program program_parsing_02 (TriviaNode [(EndOfLine) (EndOfLine)] [] ) [(Use [] program_parsing_02_submodule [(UseSymbol complex character ) (UseSymbol function subroutine ) (UseSymbol true then ) (UseSymbol false else ) (UseSymbol type () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(integer [] [] () () None ()) (real [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () type None ) [] [(types [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 integer character (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Thanks to https://stackoverflow.com/a/57015100/1876449" )] ) ) (Assignment 0 types (FuncCallOrArray type [] [] [(types (ArrayInitializer () () [(FuncCallOrArray type [] [] [(types (ArrayInitializer () () [(FuncCallOrArray type [] [] [] [] [] ) (FuncCallOrArray type [] [] [] [] [] ) (FuncCallOrArray type [] [] [] [] [] )] ))] [] [] ) (FuncCallOrArray type [] [] [] [] [] )] ))] [] [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Block 0 block [] [] [(Declaration (AttrType TypeLogical [] () () None ) [] [(if [] [] () () None ())] () )] [(If 0 endif then [(Assignment 0 if then () )] [(If 0 () else [(Assignment 0 if else () )] [(Assignment 0 if (BoolOp (not (Parenthesis else )) And (not (Parenthesis if )) ) () )] () () () )] () () () ) (Print 0 () [if] () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (AssociateBlock 0 associate [(logical [] [] () character Arrow ()) (complex [] [] () real Arrow ())] [(SubroutineCall 0 subroutine [] [(() logical () 0) (() complex () 0)] [] [] () ) (Print 0 () [(Parenthesis complex )] () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/ast-program_without_line_04-1467181.stderr0000664000175000017500000000023415174404631026326 0ustar alastairalastairsyntax error: Statement or Declaration expected inside program, found Expression --> tests/errors/program_without_line_04.f90:2:1 | 2 | 2 + 2 | ^^^^^ lfortran-0.63.0/tests/reference/asr-array_size_04-dcfa313.json0000664000175000017500000000074315174404631024177 0ustar alastairalastair{ "basename": "asr-array_size_04-dcfa313", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_size_04.f90", "infile_hash": "2984c2c4ac5b8a12bef7a8728bf6614dd5ac8517764529aeaba03c7c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_size_04-dcfa313.stderr", "stderr_hash": "76e96b7d8e04f7a510ca8009d122eb4cc631ca43c2a2efae3e4d0b85", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-end_module_name-8436c0b.stderr0000664000175000017500000000032215174404631025031 0ustar alastairalastairsyntax error: End module name does not match module name --> tests/errors/end_module_name.f90:1:1 - 3:16 | 1 | module name1 | ^^^^^^^^^^^^... ... | 3 | end module name2 | ...^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-implicit_interface2-5630d9d.json0000664000175000017500000000100315174404631025300 0ustar alastairalastair{ "basename": "asr-implicit_interface2-5630d9d", "cmd": "lfortran --show-asr --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/implicit_interface2.f90", "infile_hash": "17d4faebf0f6b3174637c94c038202e4d7eb71b2311836c34fa78898", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_interface2-5630d9d.stdout", "stdout_hash": "e5ad87e10cd7a9f42f0ca09ec13a02a479c49309e3dd54e0d1b81848", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixed_form_line_limit-0a3f0f0.stdout0000664000175000017500000000217315174404631026340 0ustar alastairalastair(TranslationUnit [(Program test () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ())] () )] [(Print 0 () [(String "this is a test to see if the fixed form parser properly ignores text past column 72" ())] () ) (Print 0 () [(String "test that we can still see the quote in the last column" ())] () ) (Print 0 () [(String "test that we avoid double \" lookahead in col 73 " ())] () ) (Print 0 () [(String " end-of-line double \"" ())] () ) (Assignment 0 a (+ 5 3) () )] [] )] ) lfortran-0.63.0/tests/reference/run-implicit_typing1-40bb07b.stderr0000664000175000017500000000011415174404631025266 0ustar alastairalastairCannot use --disable-implicit-typing and --implicit-typing at the same time lfortran-0.63.0/tests/reference/ast-if2-65737e5.stdout0000664000175000017500000000352415174404631022360 0ustar alastairalastair(TranslationUnit [(Program expr2 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () )] [(Assignment 0 time 12 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (< time 10) [(Print 0 () [(String "Good morning" ())] () )] [(If 0 () (< time 20) [(Print 0 () [(String "Good day" ())] () )] [(Print 0 () [(String "Good evening" ())] () )] () (TriviaNode [(EOLComment "! Comment 2" )] [(EOLComment "! Comment 3" )] ) () )] (TriviaNode [] [(EOLComment "! Comment 1" )] ) () (TriviaNode [] [(EOLComment "! Comment 4" ) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/ast_f90-critical1-30285fa.stdout0000664000175000017500000000127715174404631024277 0ustar alastairalastairprogram critical1 implicit none integer :: joblist[*], job integer :: a, b integer :: IntegerSample character(len=50) :: Sample if (this_image() == 1) then read(*, *) joblist end if sync all do critical job = joblist[1] joblist[1] = job - 1 end critical ! >>>>>>>> Syntax check(AST) >>>>>>>> critical () IntegerSample = 0 end critical critical (stat = IntegerSample) Sample = "Error message" end critical critical (errmsg = Sample) Sample = "Error message" end critical ! <<<<<<<< Syntax check(AST) <<<<<<<< if (job > 0) then b = a**2 + b**2 else exit end if end do sync all end program critical1 lfortran-0.63.0/tests/reference/lookup_name-function_call1-c233951.stdout0000664000175000017500000000027515174404631026307 0ustar alastairalastair[{"kind":2,"location":{"range":{"start":{"character":5,"line":8},"end":{"character":24,"line":12}},"uri":"tests/function_call1.f90"},"name":"eval_1d","filename":"tests/function_call1.f90"}]lfortran-0.63.0/tests/reference/llvm-sin_03-14abee4.json0000664000175000017500000000073715174404631023010 0ustar alastairalastair{ "basename": "llvm-sin_03-14abee4", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/sin_03.f90", "infile_hash": "3c036b8aabdbfddc3c46fb69183c427f7991b105c361b785872acf59", "outfile": null, "outfile_hash": null, "stdout": "llvm-sin_03-14abee4.stdout", "stdout_hash": "c50727f98c1e334ffd1e50c3a8d805c734c6e1417a517e98e7a18901", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-nested_01-b01694c.stdout0000664000175000017500000000542115174404631023706 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [3 x i8] c"d()" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data, i32 0, i32 0), i64 3 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [3 x i8] c"b()" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data.1, i32 0, i32 0), i64 3 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @__module_nested_01_a_b() { .entry: %b = alloca i32, align 4 %e = alloca i32, align 4 %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %0, i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %1 = call i32 @b.__module_nested_01_a_d() store i32 %1, i32* %e, align 4 store i32 0, i32* %b, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return %2 = load i32, i32* %b, align 4 ret i32 %2 } define i32 @b.__module_nested_01_a_d() { .entry: %d = alloca i32, align 4 %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %0, i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) store i32 1, i32* %d, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_d FINALIZE_SYMTABLE_d: ; preds = %return %1 = load i32, i32* %d, align 4 ret i32 %1 } declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %c = alloca i32, align 4 %2 = call i32 @__module_nested_01_a_b() store i32 %2, i32* %c, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_nested_01 FINALIZE_SYMTABLE_nested_01: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/llvm-class_01-82031c0.stdout0000664000175000017500000002335315174404631023445 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> %class_circle1.circle_class = type <{ i32 (...)**, %class_circle1.circle* }> %class_circle1.circle = type { float } @__module_class_circle1_pi = global float 0x400921FB60000000 @_Name_circle = private unnamed_addr constant [7 x i8] c"circle\00", align 1 @_Type_Info_circle = linkonce_odr unnamed_addr constant { i8*, i8*, i8* } { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @_Name_circle, i32 0, i32 0), i8* inttoptr (i64 4 to i8*), i8* null }, align 8 @_VTable_circle = linkonce_odr unnamed_addr constant { [7 x i8*] } { [7 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_circle to i8*), i8* bitcast (void (i8*, i8*)* @_copy_class_circle1_circle to i8*), i8* bitcast (void (i8**)* @_allocate_struct_class_circle1_circle to i8*), i8* bitcast (void (i8*)* @finalize_StructType__circle_of_class_circle1_for_UPoly to i8*), i8* bitcast (float (%class_circle1.circle_class*)* @__module_class_circle1_circle_area to i8*), i8* bitcast (void (%class_circle1.circle_class*)* @__module_class_circle1_circle_print to i8*)] }, align 8 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [25 x i8] c"S-DESC-12,R4,S-DESC-8,R4\00", align 1 @string_const_data = private constant [12 x i8] c"Circle: r = " @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([12 x i8], [12 x i8]* @string_const_data, i32 0, i32 0), i64 12 }> @string_const_data.1 = private constant [8 x i8] c" area = " @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data.1, i32 0, i32 0), i64 8 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define float @__module_class_circle1_circle_area(%class_circle1.circle_class* %this) { .entry: %area = alloca float, align 4 %0 = load float, float* @__module_class_circle1_pi, align 4 %1 = getelementptr %class_circle1.circle_class, %class_circle1.circle_class* %this, i32 0, i32 1 %2 = load %class_circle1.circle*, %class_circle1.circle** %1, align 8 %3 = getelementptr %class_circle1.circle, %class_circle1.circle* %2, i32 0, i32 0 %4 = load float, float* %3, align 4 %simplified_pow_operation = fmul float %4, %4 %5 = fmul float %0, %simplified_pow_operation store float %5, float* %area, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_circle_area FINALIZE_SYMTABLE_circle_area: ; preds = %return %6 = load float, float* %area, align 4 ret float %6 } define void @__module_class_circle1_circle_print(%class_circle1.circle_class* %this) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %area = alloca float, align 4 %1 = bitcast %class_circle1.circle_class* %this to float (%class_circle1.circle_class*)*** %2 = load float (%class_circle1.circle_class*)**, float (%class_circle1.circle_class*)*** %1, align 8 %3 = getelementptr inbounds float (%class_circle1.circle_class*)*, float (%class_circle1.circle_class*)** %2, i32 3 %4 = load float (%class_circle1.circle_class*)*, float (%class_circle1.circle_class*)** %3, align 8 %5 = call float %4(%class_circle1.circle_class* %this) store float %5, float* %area, align 4 %6 = alloca i64, align 8 %7 = getelementptr %class_circle1.circle_class, %class_circle1.circle_class* %this, i32 0, i32 1 %8 = load %class_circle1.circle*, %class_circle1.circle** %7, align 8 %9 = getelementptr %class_circle1.circle, %class_circle1.circle* %8, i32 0, i32 0 %10 = load float, float* %9, align 4 %11 = alloca float, align 4 store float %10, float* %11, align 4 %12 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @serialization_info, i32 0, i32 0), i64* %6, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const, float* %11, %string_descriptor* @string_const.2, float* %area) %13 = load i64, i64* %6, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %12, i8** %14, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %13, i64* %15, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %17 = load i8*, i8** %16, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %19 = load i64, i64* %18, align 8 %20 = trunc i64 %19 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %17, i32 %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %21 = icmp eq i8* %12, null br i1 %21, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %12) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_circle_print FINALIZE_SYMTABLE_circle_print: ; preds = %return ret void } define linkonce_odr void @_copy_class_circle1_circle(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %class_circle1.circle* %3 = bitcast i8* %1 to %class_circle1.circle* %4 = getelementptr %class_circle1.circle, %class_circle1.circle* %2, i32 0, i32 0 %5 = load float, float* %4, align 4 %6 = getelementptr %class_circle1.circle, %class_circle1.circle* %3, i32 0, i32 0 br i1 true, label %then, label %else then: ; preds = %entry store float %5, float* %6, align 4 br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then ret void } define linkonce_odr void @_allocate_struct_class_circle1_circle(i8** %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = call i8* @_lfortran_malloc_alloc(i8* %1, i64 16) call void @llvm.memset.p0i8.i32(i8* %2, i8 0, i32 16, i1 false) store i8* %2, i8** %0, align 8 %3 = load i8*, i8** %0, align 8 %4 = bitcast i8* %3 to %class_circle1.circle_class* %5 = bitcast %class_circle1.circle_class* %4 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [7 x i8*] }, { [7 x i8*] }* @_VTable_circle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %5, align 8 %6 = getelementptr %class_circle1.circle_class, %class_circle1.circle_class* %4, i32 0, i32 1 %7 = call i8* @_lfortran_get_default_allocator() %8 = call i8* @_lfortran_malloc_alloc(i8* %7, i64 4) call void @llvm.memset.p0i8.i32(i8* %8, i8 0, i32 4, i1 false) %9 = bitcast i8* %8 to %class_circle1.circle* store %class_circle1.circle* %9, %class_circle1.circle** %6, align 8 %10 = getelementptr %class_circle1.circle, %class_circle1.circle* %9, i32 0, i32 0 ret void } define internal void @finalize_StructType__circle_of_class_circle1_for_UPoly(i8* %0) { entry: %1 = bitcast i8* %0 to %class_circle1.circle* ret void } declare i8* @_lfortran_malloc_alloc(i8*, i64) declare i8* @_lfortran_get_default_allocator() ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) define i32 @main(i32 %0, i8** %1) { .entry: %2 = alloca %class_circle1.circle_class, align 8 %3 = alloca %class_circle1.circle_class, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %c = alloca %class_circle1.circle, align 8 %4 = getelementptr %class_circle1.circle, %class_circle1.circle* %c, i32 0, i32 0 %5 = getelementptr %class_circle1.circle, %class_circle1.circle* %c, i32 0, i32 0 store float 1.500000e+00, float* %5, align 4 %6 = getelementptr %class_circle1.circle_class, %class_circle1.circle_class* %3, i32 0, i32 0 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [7 x i8*] }, { [7 x i8*] }* @_VTable_circle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %6, align 8 %7 = getelementptr %class_circle1.circle_class, %class_circle1.circle_class* %3, i32 0, i32 1 store %class_circle1.circle* %c, %class_circle1.circle** %7, align 8 call void @__module_class_circle1_circle_print(%class_circle1.circle_class* %3) %8 = getelementptr %class_circle1.circle, %class_circle1.circle* %c, i32 0, i32 0 store float 2.000000e+00, float* %8, align 4 %9 = getelementptr %class_circle1.circle_class, %class_circle1.circle_class* %2, i32 0, i32 0 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [7 x i8*] }, { [7 x i8*] }* @_VTable_circle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %9, align 8 %10 = getelementptr %class_circle1.circle_class, %class_circle1.circle_class* %2, i32 0, i32 1 store %class_circle1.circle* %c, %class_circle1.circle** %10, align 8 call void @__module_class_circle1_circle_print(%class_circle1.circle_class* %2) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_circle_test FINALIZE_SYMTABLE_circle_test: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() attributes #0 = { argmemonly nounwind willreturn writeonly } lfortran-0.63.0/tests/reference/asr_preprocess-cpp6-556419a.stderr0000664000175000017500000000022215174404631024755 0ustar alastairalastairsemantic error: Variable 'z12' is not declared --> tests/errors/cpp6.f90:3:1 | 3 | #include "cpp6.h" | ^^^^^^^^^^^^^^^^^ 'z12' is undeclared lfortran-0.63.0/tests/reference/asr-class_04-285a1df.json0000664000175000017500000000074215174404631023061 0ustar alastairalastair{ "basename": "asr-class_04-285a1df", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/class_04.f90", "infile_hash": "0ddf2718f32dd9cfea8c4f4c9c384902ac023b5792e9fc8ec4a7648f", "outfile": null, "outfile_hash": null, "stdout": "asr-class_04-285a1df.stdout", "stdout_hash": "658d5aa733a826ea4b10a111e8806a939f5c5b45af1a410ef3078f3f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-arrays_01_logical-13e0bd7.json0000664000175000017500000000077515174404631024745 0ustar alastairalastair{ "basename": "asr-arrays_01_logical-13e0bd7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01_logical.f90", "infile_hash": "494cd2aba8ceee4c9a0bddba4b51d7a4b0b3f817d92e8c0894e4b08b", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_01_logical-13e0bd7.stdout", "stdout_hash": "f1455bb3054520859c849cbc445824994866a2c5eda6cbeafe955318", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-expr5-3c9d655.stdout0000664000175000017500000000146015174404631023015 0ustar alastairalastair(TranslationUnit [(Program expr_05 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () )] [(Assignment 0 x (* (+ 2 3) 5) () ) (If 0 () (== x 25) [(ErrorStop 0 () () () )] [] () () () )] [] )] ) lfortran-0.63.0/tests/reference/asr_openmp-openmp_37-2c7ae83.stdout0000664000175000017500000056146415174404631025226 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), omp_lib: (Module (SymbolTable 4 { c_bool: (ExternalSymbol 4 c_bool 39 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 4 c_funptr 39 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 4 c_int 39 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 4 c_long 39 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 4 c_ptr 39 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (Function (SymbolTable 5 { }) gomp_atomic_end (FunctionType [] () BindC Interface "GOMP_atomic_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_atomic_start: (Function (SymbolTable 6 { }) gomp_atomic_start (FunctionType [] () BindC Interface "GOMP_atomic_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_barrier: (Function (SymbolTable 7 { }) gomp_barrier (FunctionType [] () BindC Interface "GOMP_barrier" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_end: (Function (SymbolTable 8 { }) gomp_critical_end (FunctionType [] () BindC Interface "GOMP_critical_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_start: (Function (SymbolTable 9 { }) gomp_critical_start (FunctionType [] () BindC Interface "GOMP_critical_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_auto_next: (Function (SymbolTable 10 { gomp_loop_auto_next: (Variable 10 gomp_loop_auto_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 10 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 10 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_auto_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_auto_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 istart) (Var 10 iend)] [] (Var 10 gomp_loop_auto_next) Public .false. .false. () ), gomp_loop_auto_start: (Function (SymbolTable 11 { end: (Variable 11 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_auto_start: (Variable 11 gomp_loop_auto_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 11 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 11 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 11 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 11 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_auto_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_auto_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 start) (Var 11 end) (Var 11 incr) (Var 11 istart) (Var 11 iend)] [] (Var 11 gomp_loop_auto_start) Public .false. .false. () ), gomp_loop_dynamic_next: (Function (SymbolTable 12 { gomp_loop_dynamic_next: (Variable 12 gomp_loop_dynamic_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 12 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 12 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_dynamic_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_dynamic_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 istart) (Var 12 iend)] [] (Var 12 gomp_loop_dynamic_next) Public .false. .false. () ), gomp_loop_dynamic_start: (Function (SymbolTable 13 { chunk: (Variable 13 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), end: (Variable 13 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_dynamic_start: (Variable 13 gomp_loop_dynamic_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 13 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 13 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 13 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 13 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_dynamic_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_dynamic_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 start) (Var 13 end) (Var 13 incr) (Var 13 chunk) (Var 13 istart) (Var 13 iend)] [] (Var 13 gomp_loop_dynamic_start) Public .false. .false. () ), gomp_loop_end: (Function (SymbolTable 14 { }) gomp_loop_end (FunctionType [] () BindC Interface "GOMP_loop_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_end_nowait: (Function (SymbolTable 15 { }) gomp_loop_end_nowait (FunctionType [] () BindC Interface "GOMP_loop_end_nowait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_guided_next: (Function (SymbolTable 16 { gomp_loop_guided_next: (Variable 16 gomp_loop_guided_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 16 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 16 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_guided_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_guided_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 16 istart) (Var 16 iend)] [] (Var 16 gomp_loop_guided_next) Public .false. .false. () ), gomp_loop_guided_start: (Function (SymbolTable 17 { chunk: (Variable 17 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), end: (Variable 17 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_guided_start: (Variable 17 gomp_loop_guided_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 17 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 17 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 17 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 17 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_guided_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_guided_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 start) (Var 17 end) (Var 17 incr) (Var 17 chunk) (Var 17 istart) (Var 17 iend)] [] (Var 17 gomp_loop_guided_start) Public .false. .false. () ), gomp_loop_runtime_next: (Function (SymbolTable 18 { gomp_loop_runtime_next: (Variable 18 gomp_loop_runtime_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 18 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 18 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_runtime_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_runtime_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 18 istart) (Var 18 iend)] [] (Var 18 gomp_loop_runtime_next) Public .false. .false. () ), gomp_loop_runtime_start: (Function (SymbolTable 19 { end: (Variable 19 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_runtime_start: (Variable 19 gomp_loop_runtime_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 19 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 19 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 19 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 19 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_runtime_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_runtime_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 19 start) (Var 19 end) (Var 19 incr) (Var 19 istart) (Var 19 iend)] [] (Var 19 gomp_loop_runtime_start) Public .false. .false. () ), gomp_loop_static_next: (Function (SymbolTable 20 { gomp_loop_static_next: (Variable 20 gomp_loop_static_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 20 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 20 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_static_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_static_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 istart) (Var 20 iend)] [] (Var 20 gomp_loop_static_next) Public .false. .false. () ), gomp_loop_static_start: (Function (SymbolTable 21 { chunk: (Variable 21 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), end: (Variable 21 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_static_start: (Variable 21 gomp_loop_static_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 21 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 21 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 21 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 21 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_static_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_static_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 21 start) (Var 21 end) (Var 21 incr) (Var 21 chunk) (Var 21 istart) (Var 21 iend)] [] (Var 21 gomp_loop_static_start) Public .false. .false. () ), gomp_parallel: (Function (SymbolTable 22 { data: (Variable 22 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), flags: (Variable 22 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), fn: (Variable 22 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), num_threads: (Variable 22 num_threads [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_parallel (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_parallel" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 22 fn) (Var 22 data) (Var 22 num_threads) (Var 22 flags)] [] () Public .false. .false. () ), gomp_sections_end: (Function (SymbolTable 23 { }) gomp_sections_end (FunctionType [] () BindC Interface "GOMP_sections_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_sections_next: (Function (SymbolTable 24 { gomp_sections_next: (Variable 24 gomp_sections_next [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_sections_next (FunctionType [] (Integer 4) BindC Interface "GOMP_sections_next" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 24 gomp_sections_next) Public .false. .false. () ), gomp_sections_start: (Function (SymbolTable 25 { count: (Variable 25 count [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_sections_start: (Variable 25 gomp_sections_start [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_sections_start (FunctionType [(Integer 4)] (Integer 4) BindC Interface "GOMP_sections_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 25 count)] [] (Var 25 gomp_sections_start) Public .false. .false. () ), gomp_task: (Function (SymbolTable 26 { arg_align: (Variable 26 arg_align [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), arg_size: (Variable 26 arg_size [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), cpyfn: (Variable 26 cpyfn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), data: (Variable 26 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), depend: (Variable 26 depend [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), flags: (Variable 26 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), fn: (Variable 26 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), if_clause: (Variable 26 if_clause [] Unspecified () () Default (Logical 1) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_task (FunctionType [(CPtr) (CPtr) (CPtr) (Integer 8) (Integer 8) (Logical 1) (Integer 4) (CPtr)] () BindC Interface "GOMP_task" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 26 fn) (Var 26 data) (Var 26 cpyfn) (Var 26 arg_size) (Var 26 arg_align) (Var 26 if_clause) (Var 26 flags) (Var 26 depend)] [] () Public .false. .false. () ), gomp_taskwait: (Function (SymbolTable 27 { }) gomp_taskwait (FunctionType [] () BindC Interface "GOMP_taskwait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_teams: (Function (SymbolTable 28 { data: (Variable 28 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), fn: (Variable 28 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), num_teams: (Variable 28 num_teams [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), thread_limit: (Variable 28 thread_limit [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_teams (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_teams_reg" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 28 fn) (Var 28 data) (Var 28 num_teams) (Var 28 thread_limit)] [] () Public .false. .false. () ), omp_get_max_threads: (Function (SymbolTable 29 { omp_get_max_threads: (Variable 29 omp_get_max_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_max_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_max_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 29 omp_get_max_threads) Public .false. .false. () ), omp_get_num_procs: (Function (SymbolTable 30 { omp_get_num_procs: (Variable 30 omp_get_num_procs [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_num_procs (FunctionType [] (Integer 4) BindC Interface "omp_get_num_procs" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 30 omp_get_num_procs) Public .false. .false. () ), omp_get_num_teams: (Function (SymbolTable 31 { omp_get_num_teams: (Variable 31 omp_get_num_teams [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_num_teams (FunctionType [] (Integer 4) BindC Interface "omp_get_num_teams" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 31 omp_get_num_teams) Public .false. .false. () ), omp_get_num_threads: (Function (SymbolTable 32 { omp_get_num_threads: (Variable 32 omp_get_num_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_num_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 32 omp_get_num_threads) Public .false. .false. () ), omp_get_team_num: (Function (SymbolTable 33 { omp_get_team_num: (Variable 33 omp_get_team_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_team_num (FunctionType [] (Integer 4) BindC Interface "omp_get_team_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 33 omp_get_team_num) Public .false. .false. () ), omp_get_team_size: (Function (SymbolTable 34 { level: (Variable 34 level [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), omp_get_team_size: (Variable 34 omp_get_team_size [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_team_size (FunctionType [(Integer 4)] (Integer 4) BindC Interface "omp_get_team_size" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 34 level)] [] (Var 34 omp_get_team_size) Public .false. .false. () ), omp_get_thread_num: (Function (SymbolTable 35 { omp_get_thread_num: (Variable 35 omp_get_thread_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_thread_num (FunctionType [] (Integer 4) BindC Interface "omp_get_thread_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 35 omp_get_thread_num) Public .false. .false. () ), omp_get_wtime: (Function (SymbolTable 36 { omp_get_wtime: (Variable 36 omp_get_wtime [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_wtime (FunctionType [] (Real 8) BindC Interface "omp_get_wtime" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 36 omp_get_wtime) Public .false. .false. () ), omp_set_num_threads: (Function (SymbolTable 37 { n: (Variable 37 n [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_set_num_threads (FunctionType [(Integer 4)] () BindC Interface "omp_set_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 37 n)] [] () Public .false. .false. () ) }) omp_lib () [iso_c_binding] .true. .false. .false. ), openmp_37: (Program (SymbolTable 2 { c_bool: (ExternalSymbol 2 c_bool 39 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 2 c_funptr 39 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 2 c_int 39 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 2 c_long 39 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 2 c_ptr 39 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (ExternalSymbol 2 gomp_atomic_end 4 gomp_atomic_end omp_lib [] gomp_atomic_end Public ), gomp_atomic_start: (ExternalSymbol 2 gomp_atomic_start 4 gomp_atomic_start omp_lib [] gomp_atomic_start Public ), gomp_barrier: (ExternalSymbol 2 gomp_barrier 4 gomp_barrier omp_lib [] gomp_barrier Public ), gomp_critical_end: (ExternalSymbol 2 gomp_critical_end 4 gomp_critical_end omp_lib [] gomp_critical_end Public ), gomp_critical_start: (ExternalSymbol 2 gomp_critical_start 4 gomp_critical_start omp_lib [] gomp_critical_start Public ), gomp_loop_auto_next: (ExternalSymbol 2 gomp_loop_auto_next 4 gomp_loop_auto_next omp_lib [] gomp_loop_auto_next Public ), gomp_loop_auto_start: (ExternalSymbol 2 gomp_loop_auto_start 4 gomp_loop_auto_start omp_lib [] gomp_loop_auto_start Public ), gomp_loop_dynamic_next: (ExternalSymbol 2 gomp_loop_dynamic_next 4 gomp_loop_dynamic_next omp_lib [] gomp_loop_dynamic_next Public ), gomp_loop_dynamic_start: (ExternalSymbol 2 gomp_loop_dynamic_start 4 gomp_loop_dynamic_start omp_lib [] gomp_loop_dynamic_start Public ), gomp_loop_end: (ExternalSymbol 2 gomp_loop_end 4 gomp_loop_end omp_lib [] gomp_loop_end Public ), gomp_loop_end_nowait: (ExternalSymbol 2 gomp_loop_end_nowait 4 gomp_loop_end_nowait omp_lib [] gomp_loop_end_nowait Public ), gomp_loop_guided_next: (ExternalSymbol 2 gomp_loop_guided_next 4 gomp_loop_guided_next omp_lib [] gomp_loop_guided_next Public ), gomp_loop_guided_start: (ExternalSymbol 2 gomp_loop_guided_start 4 gomp_loop_guided_start omp_lib [] gomp_loop_guided_start Public ), gomp_loop_runtime_next: (ExternalSymbol 2 gomp_loop_runtime_next 4 gomp_loop_runtime_next omp_lib [] gomp_loop_runtime_next Public ), gomp_loop_runtime_start: (ExternalSymbol 2 gomp_loop_runtime_start 4 gomp_loop_runtime_start omp_lib [] gomp_loop_runtime_start Public ), gomp_loop_static_next: (ExternalSymbol 2 gomp_loop_static_next 4 gomp_loop_static_next omp_lib [] gomp_loop_static_next Public ), gomp_loop_static_start: (ExternalSymbol 2 gomp_loop_static_start 4 gomp_loop_static_start omp_lib [] gomp_loop_static_start Public ), gomp_parallel: (ExternalSymbol 2 gomp_parallel 4 gomp_parallel omp_lib [] gomp_parallel Public ), gomp_sections_end: (ExternalSymbol 2 gomp_sections_end 4 gomp_sections_end omp_lib [] gomp_sections_end Public ), gomp_sections_next: (ExternalSymbol 2 gomp_sections_next 4 gomp_sections_next omp_lib [] gomp_sections_next Public ), gomp_sections_start: (ExternalSymbol 2 gomp_sections_start 4 gomp_sections_start omp_lib [] gomp_sections_start Public ), gomp_task: (ExternalSymbol 2 gomp_task 4 gomp_task omp_lib [] gomp_task Public ), gomp_taskwait: (ExternalSymbol 2 gomp_taskwait 4 gomp_taskwait omp_lib [] gomp_taskwait Public ), gomp_teams: (ExternalSymbol 2 gomp_teams 4 gomp_teams omp_lib [] gomp_teams Public ), ik: (Variable 2 ik [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ix: (Variable 2 ix [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iy: (Variable 2 iy [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), nk: (Variable 2 nk [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), nx: (Variable 2 nx [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ny: (Variable 2 ny [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), omp_get_max_threads: (ExternalSymbol 2 omp_get_max_threads 4 omp_get_max_threads omp_lib [] omp_get_max_threads Public ), omp_get_num_procs: (ExternalSymbol 2 omp_get_num_procs 4 omp_get_num_procs omp_lib [] omp_get_num_procs Public ), omp_get_num_teams: (ExternalSymbol 2 omp_get_num_teams 4 omp_get_num_teams omp_lib [] omp_get_num_teams Public ), omp_get_num_threads: (ExternalSymbol 2 omp_get_num_threads 4 omp_get_num_threads omp_lib [] omp_get_num_threads Public ), omp_get_team_num: (ExternalSymbol 2 omp_get_team_num 4 omp_get_team_num omp_lib [] omp_get_team_num Public ), omp_get_team_size: (ExternalSymbol 2 omp_get_team_size 4 omp_get_team_size omp_lib [] omp_get_team_size Public ), omp_get_thread_num: (ExternalSymbol 2 omp_get_thread_num 4 omp_get_thread_num omp_lib [] omp_get_thread_num Public ), omp_get_wtime: (ExternalSymbol 2 omp_get_wtime 4 omp_get_wtime omp_lib [] omp_get_wtime Public ), omp_set_num_threads: (ExternalSymbol 2 omp_set_num_threads 4 omp_set_num_threads omp_lib [] omp_set_num_threads Public ) }) openmp_37 [omp_lib] [(Assignment (Var 2 ny) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 nx) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 nk) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (OMPRegion ParallelDo [(OMPPrivate [(Var 2 iy) (Var 2 ix)] )] [(DoLoop () ((Var 2 iy) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 ny) ()) [(OMPRegion ParallelDo [(OMPCollapse (IntegerConstant 2 (Integer 4) Decimal) )] [(DoLoop () ((Var 2 ix) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nx) ()) [(DoLoop () ((Var 2 ik) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nk) ()) [(Print (StringFormat () [(StringConstant "iy->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 iy) (StringConstant "ix->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 ix)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] [] )] ) (OMPRegion ParallelDo [] [(DoLoop () ((Var 2 ix) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nx) ()) [(DoLoop () ((Var 2 ik) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nk) ()) [(Print (StringFormat () [(StringConstant "iy->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 iy) (StringConstant "ix->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 ix)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] [] )] )] [] )] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-fixedform_assign_minimal-c4142fa.stdout0000664000175000017500000000140015174404631027043 0ustar alastairalastair(TranslationUnit [(Program implicit_program_lfortran () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ()) (b [] [] () () None ()) (c [] [] () () None ()) (d [] [] () () None ())] () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-optional_argument_subroutine_in_type-0d81d24.json0000664000175000017500000000104115174404631031113 0ustar alastairalastair{ "basename": "asr-optional_argument_subroutine_in_type-0d81d24", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/optional_argument_subroutine_in_type.f90", "infile_hash": "95ac054a65cebfbc2df3708d0b697fb981e5a485008e8a79dc6ab79d", "outfile": null, "outfile_hash": null, "stdout": "asr-optional_argument_subroutine_in_type-0d81d24.stdout", "stdout_hash": "610a00771660987fe853d186f1fa40028cf16880f007a6fbca82b8b1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-callback_02-41bc7d7.stdout0000664000175000017500000001730615174404631024251 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @main.res = internal global float 0.000000e+00 define void @__module_callback_02_cb(float* %res, float* %a, float* %b, void (float*, float*)* %f) { .entry: %stringFormat_desc4 = alloca %string_descriptor, align 8 %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() call void %f(float* %a, float* %res) %1 = alloca i64, align 8 %2 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %1, i32 0, i32 0, i32 0, i32 0, i32 0, float* %res) %3 = load i64, i64* %1, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %2, i8** %4, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %3, i64* %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %7 = load i8*, i8** %6, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %9 = load i64, i64* %8, align 8 %10 = trunc i64 %9 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %7, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %11 = icmp eq i8* %2, null br i1 %11, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %2) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void %f(float* %b, float* %res) %12 = alloca i64, align 8 %13 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %12, i32 0, i32 0, i32 0, i32 0, i32 0, float* %res) %14 = load i64, i64* %12, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %13, i8** %15, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %14, i64* %16, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %18 = load i8*, i8** %17, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %20 = load i64, i64* %19, align 8 %21 = trunc i64 %20 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %18, i32 %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %22 = icmp eq i8* %13, null br i1 %22, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %0, i8* %13) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %23 = load float, float* %b, align 4 %24 = load float, float* %a, align 4 %25 = fsub float %23, %24 %26 = load float, float* %res, align 4 %27 = fmul float %25, %26 store float %27, float* %res, align 4 %28 = alloca i64, align 8 %29 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %28, i32 0, i32 0, i32 0, i32 0, i32 0, float* %res) %30 = load i64, i64* %28, align 8 %31 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %29, i8** %31, align 8 %32 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %30, i64* %32, align 8 %33 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %34 = load i8*, i8** %33, align 8 %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %36 = load i64, i64* %35, align 8 %37 = trunc i64 %36 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %34, i32 %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %38 = icmp eq i8* %29, null br i1 %38, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free_alloc(i8* %0, i8* %29) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 br label %return return: ; preds = %free_done6 br label %FINALIZE_SYMTABLE_cb FINALIZE_SYMTABLE_cb: ; preds = %return ret void } declare void @f(float*, float*) define float @__module_callback_02_foo(float* %c, float* %d, float* %res) { .entry: %foo = alloca float, align 4 call void @__module_callback_02_cb(float* %res, float* %c, float* %d, void (float*, float*)* @foo.__module_callback_02_f) %0 = load float, float* %res, align 4 store float %0, float* %foo, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_foo FINALIZE_SYMTABLE_foo: ; preds = %return %1 = load float, float* %foo, align 4 ret float %1 } define void @foo.__module_callback_02_f(float* %x, float* %res) { .entry: %0 = load float, float* %x, align 4 %1 = fmul float 2.000000e+00, %0 store float %1, float* %res, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value1 = alloca float, align 4 %call_arg_value = alloca float, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store float 1.500000e+00, float* %call_arg_value, align 4 store float 2.000000e+00, float* %call_arg_value1, align 4 %2 = call float @__module_callback_02_foo(float* %call_arg_value, float* %call_arg_value1, float* @main.res) store float %2, float* @main.res, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-array_05-321b5d3.json0000664000175000017500000000072415174404631023004 0ustar alastairalastair{ "basename": "asr-array_05-321b5d3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_05.f90", "infile_hash": "b86286701e5ed9406c3ba31672b09bcf91a452a95ac041a8b2d4c33a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_05-321b5d3.stderr", "stderr_hash": "8b515c9bd2f970b2082c5f32b22d33101955e1ee395fc49eab2a160c", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-derived_type1-c109ce6.stdout0000664000175000017500000002675215174404631024577 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_type1: (Module (SymbolTable 2 { 1_enum_escape_newline: (ExternalSymbol 2 1_enum_escape_newline 3 newline enum_escape [] newline Public ), enum_escape: (Struct (SymbolTable 3 { newline: (Variable 3 newline [] Local (IntrinsicElementalFunction Achar [(IntegerConstant 10 (Integer 4) Decimal)] 0 (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "\n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "\n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) enum_escape (StructType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] [] .true. .false. ) [] [newline] [] Source Public .false. .false. [] () () [] ), nl: (Variable 2 nl [toml_escape] Local (IntrinsicElementalFunction StringConcat [(StringConstant " " (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StructInstanceMember (Var 2 toml_escape) 2 1_enum_escape_newline (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "\n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] 0 (String 1 (IntegerConstant 2 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant " \n" (String 1 (IntegerConstant 2 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant " \n" (String 1 (IntegerConstant 2 (Integer 8) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 2 (Integer 8) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tfc: (Variable 2 tfc [] Local (IntrinsicElementalFunction SelectedCharKind [(StringConstant "DEFAULT" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), toml_escape: (Variable 2 toml_escape [] Local (StructConstant 2 enum_escape [((StringConstant "\n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (StructType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] [] .true. .false. ) ) (StructConstant 2 enum_escape [((StringConstant "\n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (StructType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] [] .true. .false. ) ) Parameter (StructType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] [] .true. .false. ) 2 enum_escape Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) derived_type1 () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor15-4cf95f9.json0000664000175000017500000000077315174404631026635 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor15-4cf95f9", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor15.f90", "infile_hash": "b47691d49753905026191cfe1a1aa17ab0a7652f8b0aea9e1b1639e5", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor15-4cf95f9.stdout", "stdout_hash": "c0f66587c53d15e184e1cfdb3aefd939f82dd63b39cab96ff58db69d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-intent_01-fd00f62.stdout0000664000175000017500000000747515174404631023634 0ustar alastairalastair(TranslationUnit [(Module dflt_intent (TriviaNode [(EndOfLine) (EndOfLine)] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Subroutine foo [(c) (d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [] [(c [] [] () () None ()) (d [] [] () () None ()) (e [] [] () () None ()) (g [] [] () () None ())] () )] [(Assignment 0 e (FuncCallOrArray f [] [(() c () 0)] [] [] [] ) () ) (Assignment 0 g (FuncCallOrArray f [] [(() d () 0)] [] [] [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Function f [(x)] [(AttrType TypeReal [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(x [] [] () () None ())] () )] [(Assignment 0 f (* 2 x) () ) (Print 0 () [f] () )] [] [] )] [] )] ) (Program main () [(Use [] dflt_intent [] .false. () )] [] [] [(SubroutineCall 0 foo [] [(() (Real "0.0") () 0) (() (Real "2.0") () 0)] [] [] () )] [] )] ) lfortran-0.63.0/tests/reference/ast-parameter_02-9547a35.stdout0000664000175000017500000000434715174404631024161 0ustar alastairalastair(TranslationUnit [(Subroutine a_proc [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrParameter )] [(i [] [] () 1 Equal ())] () )] [(Print 0 () [i] () )] [] [] ) (Module parameter_02_a (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrParameter )] [(i [] [] () 2 Equal ())] () )] [] [] ) (Program parameter_02 () [(Use [] parameter_02_a [(UseSymbol i () )] .true. () )] [(ImplicitNone [] () )] [] [(SubroutineCall 0 a_proc [] [] [] [] () ) (Print 0 () [i] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-external1-93d8653.json0000664000175000017500000000076715174404631023236 0ustar alastairalastair{ "basename": "asr-external1-93d8653", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/external1.f90", "infile_hash": "56b4ef88c341e64d20695ff19c022ba86a594ce1be597aa4624f694b", "outfile": null, "outfile_hash": null, "stdout": "asr-external1-93d8653.stdout", "stdout_hash": "6363dd1c7836408422e0e9b4b4c28241aecf5614b1964546ba73b256", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-dint_args-0823aa1.stderr0000664000175000017500000000023215174404631023654 0ustar alastairalastairsemantic error: Too many arguments to call `dint` --> tests/errors/dint_args.f90:2:13 | 2 | print*, dint(1.0_8, 8) | ^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-common_13-fa7cbf0.stdout0000664000175000017500000005554115174404631023762 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { 1_arrblock_myarr: (ExternalSymbol 1 1_arrblock_myarr 3 myarr arrblock [] myarr Public ), 1_myblock_myint: (ExternalSymbol 1 1_myblock_myint 5 myint myblock [] myint Public ), arrblock: (ExternalSymbol 1 arrblock 2 arrblock file_common_block_arrblock [] arrblock Public ), common_13: (Program (SymbolTable 6 { 1_myblock_myzero: (ExternalSymbol 6 1_myblock_myzero 5 myzero myblock [] myzero Public ) }) common_13 [] [(If () (IntegerCompare (StructInstanceMember (Var 1 struct_instance_myblock) 1 1_myblock_myint (Integer 4) () ) NotEq (IntegerConstant 44 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (StructInstanceMember (Var 1 struct_instance_myblock) 6 1_myblock_myzero (Integer 4) () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntrinsicArrayFunction Any [(ArrayPhysicalCast (IntegerCompare (StructInstanceMember (Var 1 struct_instance_arrblock) 1 1_arrblock_myarr (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) NotEq (ArrayConstant 40 [1, 2, 3, ...., 8, 9, 10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) () ) [(ErrorStop () )] [] )] ), file_common_block_arrblock: (Module (SymbolTable 2 { arrblock: (Struct (SymbolTable 3 { myarr: (Variable 3 myarr [] Local (ArrayConstant 40 [1, 2, 3, ...., 8, 9, 10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayConstant 40 [1, 2, 3, ...., 8, 9, 10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) arrblock (StructType [] [] .true. .false. ) [] [myarr] [] Source Public .false. .false. [] () () [] ), struct_instance_arrblock: (Variable 2 struct_instance_arrblock [] Local (StructConstant 2 arrblock [((ArrayConstant 40 [1, 2, 3, ...., 8, 9, 10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ))] (StructType [] [] .true. .false. ) ) (StructConstant 2 arrblock [((ArrayConstant 40 [1, 2, 3, ...., 8, 9, 10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ))] (StructType [] [] .true. .false. ) ) Default (StructType [] [] .true. .false. ) 2 arrblock Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) file_common_block_arrblock () [] .false. .false. .false. ), file_common_block_myblock: (Module (SymbolTable 4 { myblock: (Struct (SymbolTable 5 { myint: (Variable 5 myint [] Local (IntegerConstant 44 (Integer 4) Decimal) (IntegerConstant 44 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), myzero: (Variable 5 myzero [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) myblock (StructType [] [] .true. .false. ) [] [myint myzero] [] Source Public .false. .false. [] () () [] ), struct_instance_myblock: (Variable 4 struct_instance_myblock [] Local (StructConstant 4 myblock [((IntegerConstant 44 (Integer 4) Decimal)) (())] (StructType [] [] .true. .false. ) ) (StructConstant 4 myblock [((IntegerConstant 44 (Integer 4) Decimal)) (())] (StructType [] [] .true. .false. ) ) Default (StructType [] [] .true. .false. ) 4 myblock Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) file_common_block_myblock () [] .false. .false. .false. ), myarr: (Variable 1 myarr [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), myblock: (ExternalSymbol 1 myblock 4 myblock file_common_block_myblock [] myblock Public ), myint: (Variable 1 myint [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), myzero: (Variable 1 myzero [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), struct_instance_arrblock: (ExternalSymbol 1 struct_instance_arrblock 2 struct_instance_arrblock file_common_block_arrblock [] struct_instance_arrblock Public ), struct_instance_myblock: (ExternalSymbol 1 struct_instance_myblock 4 struct_instance_myblock file_common_block_myblock [] struct_instance_myblock Public ) }) [] ) lfortran-0.63.0/tests/reference/asr-bindc2-62a702e.stdout0000664000175000017500000006072515174404631023106 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bindc2: (Program (SymbolTable 2 { c_f_pointer: (ExternalSymbol 2 c_f_pointer 4 c_f_pointer lfortran_intrinsic_iso_c_binding [] c_f_pointer Public ), c_loc: (ExternalSymbol 2 c_loc 4 c_loc lfortran_intrinsic_iso_c_binding [] c_loc Public ), c_ptr: (ExternalSymbol 2 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), idx: (Variable 2 idx [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), newshape: (Variable 2 newshape [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), queries: (Variable 2 queries [] Local () () Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Pointer (Array (Integer 2) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), xv: (Variable 2 xv [] Local () () Default (Array (Integer 2) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ) }) bindc2 [iso_c_binding] [(Assignment (ArrayItem (Var 2 newshape) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 newshape) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Associate (Var 2 x) (ArrayPhysicalCast (Var 2 xv) FixedSizeArray DescriptorArray (Array (Integer 2) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () ) ) (If () (IntegerCompare (ArrayBound (Var 2 xv) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayBound (Var 2 xv) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 3 (Integer 4) Decimal) ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayBound (Var 2 xv) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayBound (Var 2 xv) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 4 (Integer 4) Decimal) ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArraySize (Var 2 xv) () (Integer 4) (IntegerConstant 12 (Integer 4) Decimal) ) NotEq (IntegerConstant 12 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (CPtrToPointer (Var 2 queries) (Var 2 x) (Var 2 newshape) () ) (If () (IntegerCompare (ArrayBound (Var 2 xv) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayBound (Var 2 xv) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 3 (Integer 4) Decimal) ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayBound (Var 2 xv) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayBound (Var 2 xv) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 4 (Integer 4) Decimal) ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArraySize (Var 2 xv) () (Integer 4) (IntegerConstant 12 (Integer 4) Decimal) ) NotEq (IntegerConstant 12 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArraySize (Var 2 x) () (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArraySize (Var 2 x) () (Integer 4) () ) NotEq (IntegerConstant 6 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding) }) [] ) lfortran-0.63.0/tests/reference/julia-array2-456cd99.stdout0000664000175000017500000000050315174404631023471 0ustar alastairalastairfunction main() local a::Array{Float32, 1} local b::Array{Float32, 1} local c::Array{Int32, 1} local d::Array{Bool, 1} local e::Array{Float32, 2} local f::Array{Int32, 2} local g::Array{Bool, 2} local h::Array{Float32, 3} local i::Array{Int32, 3} local j::Array{Bool, 3} end main() lfortran-0.63.0/tests/reference/asr-string_54-2dbd7b1.json0000664000175000017500000000074515174404631023345 0ustar alastairalastair{ "basename": "asr-string_54-2dbd7b1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_54.f90", "infile_hash": "ac362ebe23bff5072f61252724ef01399d95e4783cbf9330a49acf86", "outfile": null, "outfile_hash": null, "stdout": "asr-string_54-2dbd7b1.stdout", "stdout_hash": "c7a21eb764e847523cbcc0a89532f69e00f0ba39a7245fd2c6d1c7b1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_array_op-array15-079d0cd.json0000664000175000017500000000075615174404631025017 0ustar alastairalastair{ "basename": "pass_array_op-array15-079d0cd", "cmd": "lfortran --pass=array_op --show-asr --no-color {infile} -o {outfile}", "infile": "tests/array15.f90", "infile_hash": "18924f1dcd04103b427c1fe1321fa206ef73add7548a17e61ea10df2", "outfile": null, "outfile_hash": null, "stdout": "pass_array_op-array15-079d0cd.stdout", "stdout_hash": "e3ee1d6d5a51afbff25a15921bec45b72b87542cbc757d349e38790b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_json-modules_10-93cd62d.stdout0000664000175000017500000006572615174404631025044 0ustar alastairalastair{ "node": "TranslationUnit", "fields": { "symtab": { "node": "SymbolTable1", "fields": { "modules_10": { "node": "Module", "fields": { "symtab": { "node": "SymbolTable4", "fields": { "my_global": { "node": "ExternalSymbol", "fields": { "parent_symtab": 4, "name": "my_global", "external": "my_global (SymbolTable2)", "module_name": "my_other_module", "scope_names": [], "original_name": "my_global", "access": "Public" }, "loc": { "first": 197, "last": 205, "first_filename": "tests/modules_10.f90", "first_line": 10, "first_column": 32, "last_filename": "tests/modules_10.f90", "last_line": 10, "last_column": 40 } }, "my_proc": { "node": "Function", "fields": { "symtab": { "node": "SymbolTable5", "fields": { "my_other_proc": { "node": "ExternalSymbol", "fields": { "parent_symtab": 5, "name": "my_other_proc", "external": "my_other_proc (SymbolTable2)", "module_name": "my_other_module", "scope_names": [], "original_name": "my_other_proc", "access": "Public" }, "loc": { "first": 274, "last": 286, "first_filename": "tests/modules_10.f90", "first_line": 13, "first_column": 36, "last_filename": "tests/modules_10.f90", "last_line": 13, "last_column": 48 } } } }, "name": "my_proc", "function_signature": { "node": "FunctionType", "fields": { "arg_types": [], "return_var_type": [], "abi": "Source", "deftype": "Implementation", "bindc_name": [], "elemental": false, "pure": false, "module": false, "inline": false, "static": false, "restrictions": [], "is_restriction": false }, "loc": { "first": 220, "last": 333, "first_filename": "tests/modules_10.f90", "first_line": 12, "first_column": 5, "last_filename": "tests/modules_10.f90", "last_line": 16, "last_column": 18 } }, "dependencies": [], "args": [], "body": [ { "node": "SubroutineCall", "fields": { "name": "my_other_proc (SymbolTable5)", "original_name": [], "args": [], "dt": [], "strict_bounds_checking": false }, "loc": { "first": 297, "last": 314, "first_filename": "tests/modules_10.f90", "first_line": 15, "first_column": 9, "last_filename": "tests/modules_10.f90", "last_line": 15, "last_column": 26 } } ], "return_var": [], "access": "Public", "deterministic": false, "side_effect_free": false, "module_file": [] }, "loc": { "first": 220, "last": 333, "first_filename": "tests/modules_10.f90", "first_line": 12, "first_column": 5, "last_filename": "tests/modules_10.f90", "last_line": 16, "last_column": 18 } } } }, "name": "modules_10", "parent_module": [], "dependencies": [ "my_other_module" ], "loaded_from_mod": false, "intrinsic": false, "has_submodules": false }, "loc": { "first": 148, "last": 344, "first_filename": "tests/modules_10.f90", "first_line": 9, "first_column": 1, "last_filename": "tests/modules_10.f90", "last_line": 17, "last_column": 10 } }, "my_other_module": { "node": "Module", "fields": { "symtab": { "node": "SymbolTable2", "fields": { "my_global": { "node": "Variable", "fields": { "parent_symtab": 2, "name": "my_global", "dependencies": [], "intent": "Local", "symbolic_value": { "node": "IntegerConstant", "fields": { "n": 0, "type": { "node": "Integer", "fields": { "kind": 4 }, "loc": { "first": 50, "last": 50, "first_filename": "tests/modules_10.f90", "first_line": 2, "first_column": 28, "last_filename": "tests/modules_10.f90", "last_line": 2, "last_column": 28 } }, "intboz_type": "Decimal" }, "loc": { "first": 50, "last": 50, "first_filename": "tests/modules_10.f90", "first_line": 2, "first_column": 28, "last_filename": "tests/modules_10.f90", "last_line": 2, "last_column": 28 } }, "value": { "node": "IntegerConstant", "fields": { "n": 0, "type": { "node": "Integer", "fields": { "kind": 4 }, "loc": { "first": 50, "last": 50, "first_filename": "tests/modules_10.f90", "first_line": 2, "first_column": 28, "last_filename": "tests/modules_10.f90", "last_line": 2, "last_column": 28 } }, "intboz_type": "Decimal" }, "loc": { "first": 50, "last": 50, "first_filename": "tests/modules_10.f90", "first_line": 2, "first_column": 28, "last_filename": "tests/modules_10.f90", "last_line": 2, "last_column": 28 } }, "storage": "Save", "type": { "node": "Integer", "fields": { "kind": 4 }, "loc": { "first": 27, "last": 50, "first_filename": "tests/modules_10.f90", "first_line": 2, "first_column": 5, "last_filename": "tests/modules_10.f90", "last_line": 2, "last_column": 28 } }, "type_declaration": [], "abi": "Source", "access": "Public", "presence": "Required", "value_attr": false, "target_attr": false, "contiguous_attr": false, "bindc_name": [], "is_volatile": false, "is_protected": false, "pass_attr": "NotMethod", "self_argument": [], "corank": 0 }, "loc": { "first": 38, "last": 50, "first_filename": "tests/modules_10.f90", "first_line": 2, "first_column": 16, "last_filename": "tests/modules_10.f90", "last_line": 2, "last_column": 28 } }, "my_other_proc": { "node": "Function", "fields": { "symtab": { "node": "SymbolTable3", "fields": {} }, "name": "my_other_proc", "function_signature": { "node": "FunctionType", "fields": { "arg_types": [], "return_var_type": [], "abi": "Source", "deftype": "Implementation", "bindc_name": [], "elemental": false, "pure": false, "module": false, "inline": false, "static": false, "restrictions": [], "is_restriction": false }, "loc": { "first": 65, "last": 134, "first_filename": "tests/modules_10.f90", "first_line": 4, "first_column": 5, "last_filename": "tests/modules_10.f90", "last_line": 6, "last_column": 18 } }, "dependencies": [], "args": [], "body": [ { "node": "Print", "fields": { "text": { "node": "StringFormat", "fields": { "fmt": [], "args": [ { "node": "Var", "fields": { "v": "my_global (SymbolTable2)" }, "loc": { "first": 107, "last": 115, "first_filename": "tests/modules_10.f90", "first_line": 5, "first_column": 18, "last_filename": "tests/modules_10.f90", "last_line": 5, "last_column": 26 } } ], "kind": "FormatFortran", "type": { "node": "Allocatable", "fields": { "type": { "node": "String", "fields": { "kind": 1, "len": [], "len_kind": "DeferredLength", "physical_type": "DescriptorString" }, "loc": { "first": 98, "last": 115, "first_filename": "tests/modules_10.f90", "first_line": 5, "first_column": 9, "last_filename": "tests/modules_10.f90", "last_line": 5, "last_column": 26 } } }, "loc": { "first": 98, "last": 115, "first_filename": "tests/modules_10.f90", "first_line": 5, "first_column": 9, "last_filename": "tests/modules_10.f90", "last_line": 5, "last_column": 26 } }, "value": [] }, "loc": { "first": 98, "last": 115, "first_filename": "tests/modules_10.f90", "first_line": 5, "first_column": 9, "last_filename": "tests/modules_10.f90", "last_line": 5, "last_column": 26 } } }, "loc": { "first": 98, "last": 115, "first_filename": "tests/modules_10.f90", "first_line": 5, "first_column": 9, "last_filename": "tests/modules_10.f90", "last_line": 5, "last_column": 26 } } ], "return_var": [], "access": "Public", "deterministic": false, "side_effect_free": false, "module_file": [] }, "loc": { "first": 65, "last": 134, "first_filename": "tests/modules_10.f90", "first_line": 4, "first_column": 5, "last_filename": "tests/modules_10.f90", "last_line": 6, "last_column": 18 } } } }, "name": "my_other_module", "parent_module": [], "dependencies": [], "loaded_from_mod": false, "intrinsic": false, "has_submodules": false }, "loc": { "first": 0, "last": 145, "first_filename": "tests/modules_10.f90", "first_line": 1, "first_column": 1, "last_filename": "tests/modules_10.f90", "last_line": 7, "last_column": 10 } } } }, "items": [] }, "loc": { "first": 0, "last": 344, "first_filename": "tests/modules_10.f90", "first_line": 1, "first_column": 1, "last_filename": "tests/modules_10.f90", "last_line": 17, "last_column": 10 } } lfortran-0.63.0/tests/reference/asr-dimension_attr2-8fda690.json0000664000175000017500000000076415174404631024565 0ustar alastairalastair{ "basename": "asr-dimension_attr2-8fda690", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/dimension_attr2.f90", "infile_hash": "568a05015d6d94c3e3a22921a99746f77bf708b4e1f67e7f5f30296d", "outfile": null, "outfile_hash": null, "stdout": "asr-dimension_attr2-8fda690.stdout", "stdout_hash": "73a1e87e4212ef001bd87152fbf73beb65c0db064e90923ddb01a991", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-submodule_01-2524ba9.json0000664000175000017500000000075615174404631023675 0ustar alastairalastair{ "basename": "ast-submodule_01-2524ba9", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/submodule_01.f90", "infile_hash": "ed0ecc9003bb9cd8e6be1f4f77cd3e59f45d09f2ba2f64029dc3680e", "outfile": null, "outfile_hash": null, "stdout": "ast-submodule_01-2524ba9.stdout", "stdout_hash": "6b9e7e191e0c91ef601e0128b385676f8b1492b8e196073f9b3bd369", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-block_03-6c8fdd8.stdout0000664000175000017500000002335115174404631023513 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { block_02: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), loop: (Block (SymbolTable 4 { b: (Variable 4 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) loop [(Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 2 a) Eq (IntegerConstant 15 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 1 1 )] [] ) (Assignment (Var 4 b) (IntegerBinOp (Var 2 a) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 1 square () [((Var 4 b))] () .false. )] ) }) block_02 [] [(Assignment (Var 2 a) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (GoToTarget 1 1 ) (BlockCall -1 2 loop )] ), square: (Function (SymbolTable 3 { b: (Variable 3 b [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), result: (Variable 3 result [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) square (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 b)] [(Assignment (Var 3 result) (IntegerBinOp (Var 3 b) Mul (Var 3 b) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 3 result) NotEq (IntegerConstant 100 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 3 result)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/ast-template_03b-6812e13.json0000664000175000017500000000075615174404631023576 0ustar alastairalastair{ "basename": "ast-template_03b-6812e13", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_03b.f90", "infile_hash": "4285fa6069fdc8872b08ca46688ab8168abfe0c468a57c65818deeb6", "outfile": null, "outfile_hash": null, "stdout": "ast-template_03b-6812e13.stdout", "stdout_hash": "1abad015875ea997cf0f18b87b2c0022fd1bff651de2bd856c92e466", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixedform_doloop2-16b2c78.stdout0000664000175000017500000000326515174404631025372 0ustar alastairalastair(TranslationUnit [(Program main () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(k [] [] () () None ())] () )] [(DoLoop 0 () 0 k 1 10 () [(Print 0 () [k] () )] () () ) (DoLoop 0 () 80 k 1 10 () [(Print 0 () [k] () ) (Continue 80 () )] () () ) (DoLoop 0 () 800 k 1 10 () [(Print 0 () [k] () ) (Continue 800 () )] () () ) (DoLoop 0 () 8000 k 1 10 () [(Print 0 () [k] () ) (Continue 8000 () )] () () )] [] )] ) lfortran-0.63.0/tests/reference/asr-template_travel_01-cd2b445.json0000664000175000017500000000100015174404631025122 0ustar alastairalastair{ "basename": "asr-template_travel_01-cd2b445", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_travel_01.f90", "infile_hash": "49fd555855358466e9af6299db72ebf88c01a40bb93c00fefe71c2c7", "outfile": null, "outfile_hash": null, "stdout": "asr-template_travel_01-cd2b445.stdout", "stdout_hash": "f9a673aca0c18aa10ffb6b1406b78d3bcb4a6ba4fab39c1f87997f1f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-program4-ba26fd1.stderr0000664000175000017500000000040215174404631023602 0ustar alastairalastairwarning: Assuming implicit save attribute for variable declaration --> tests/program4.f90:30:13 | 30 | real :: saved1 = 2.0 | ^^^^^^^^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement lfortran-0.63.0/tests/reference/cpp-program4-1796cb6.stdout0000664000175000017500000000305015174404631023474 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { float func1(float a, float b); float func2(float a, float b); } // Implementations namespace { float func1(float a, float b) { float c; static float saved= 2.00000000000000000e+00; saved = saved + 1.00000000000000000e+00; c = c + a + b + saved; return c; } float func2(float a, float b) { float c; float d; static float saved1= 2.00000000000000000e+00; static float saved2; saved1 = saved1 + 1.00000000000000000e+00; c = d + c + a + b + saved1 + saved2; saved2 = saved2 + 1.00000000000000000e+00; d = d + 3.00000000000000000e+00; return c; } void main2() { float x; float y; float z; x = 1.00000000000000000e+00; y = 2.00000000000000000e+00; z = func1(x, y); std::cout << "6.0 == " << " " << z << std::endl; z = func1(x, y); std::cout << "7.0 == " << " " << z << std::endl; z = func2(x, y); std::cout << "6.0 == " << " " << z << std::endl; z = func2(x, y); std::cout << "8.0 == " << " " << z << std::endl; } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/asr-modules_02-74be421.stdout0000664000175000017500000001722115174404631023711 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_02: (Program (SymbolTable 7 { b: (ExternalSymbol 7 b 2 b modules_02_a [] b Public ), e: (ExternalSymbol 7 e 4 e modules_02_c [] e Public ), x: (ExternalSymbol 7 x 4 d modules_02_c [] d Public ) }) modules_02 [modules_02_a modules_02_c] [(SubroutineCall 7 b () [] () .false. ) (SubroutineCall 7 x () [] () .false. ) (SubroutineCall 7 e () [] () .false. )] ), modules_02_a: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { }) b (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "b()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ) }) modules_02_a () [] .false. .false. .false. ), modules_02_c: (Module (SymbolTable 4 { d: (Function (SymbolTable 5 { }) d (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "d()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), e: (Function (SymbolTable 6 { }) e (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "e()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ) }) modules_02_c () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-implicit_typing1-7a0ea7d.stderr0000664000175000017500000000016715174404631025347 0ustar alastairalastairsemantic error: Variable 'l' is not declared --> tests/implicit_typing1.f90:2:1 | 2 | L = 3 | ^ 'l' is undeclared lfortran-0.63.0/tests/reference/asr_disable_warnings-save4-99c3220.json0000664000175000017500000000112115174404631025717 0ustar alastairalastair{ "basename": "asr_disable_warnings-save4-99c3220", "cmd": "lfortran --show-asr --no-warnings --no-color {infile} -o {outfile}", "infile": "tests/save4.f90", "infile_hash": "8ad16d18b9282d4bb2812bf641878b7a6738e0e34c356b94ff01ef8a", "outfile": null, "outfile_hash": null, "stdout": "asr_disable_warnings-save4-99c3220.stdout", "stdout_hash": "77f1ae86facfa4d13db333a9bb1016ff2ee69bacf3ec17d9a5dec264", "stderr": "asr_disable_warnings-save4-99c3220.stderr", "stderr_hash": "e3013a477fb53db6747b4c2508286e403a3d023df3b260db13492ac4", "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-modules_04-d194daa.json0000664000175000017500000000073615174404631024164 0ustar alastairalastair{ "basename": "ast_f90-modules_04-d194daa", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/modules_04.f90", "infile_hash": "001166d3ec02d038539957e7b333b2f02902687e96980e325831c745", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-modules_04-d194daa.stdout", "stdout_hash": "a33aa109e8bf97d4a69f413dd829f073fc2fd561ccac6cd380513752", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-program_01-3f7a7b3.json0000664000175000017500000000075015174404631023423 0ustar alastairalastair{ "basename": "ast-program_01-3f7a7b3", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/program_01.f90", "infile_hash": "917ed02637c7a6c4e5e5407a0ccf45b4ef6ff79355c5c080e53d97e9", "outfile": null, "outfile_hash": null, "stdout": "ast-program_01-3f7a7b3.stdout", "stdout_hash": "b08a267e1b6a02696e7b1cd53bc5d1115953719d8eb6beb309d648fb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-write_22-368d6f8.stdout0000664000175000017500000000000415174404631023423 0ustar alastairalastairHHH lfortran-0.63.0/tests/reference/asr-modules_45-c69c75f.json0000664000175000017500000000075015174404631023444 0ustar alastairalastair{ "basename": "asr-modules_45-c69c75f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_45.f90", "infile_hash": "d68539c460764050c432f216e8ceed7eded8bf09258747500769b39e", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_45-c69c75f.stdout", "stdout_hash": "38875f0b6630e91e84ab4ca3a6676ed20f826d631e43872183b91152", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-continue_compilation_ff_2-9ba55e7.json0000664000175000017500000000121115174404631026566 0ustar alastairalastair{ "basename": "asr-continue_compilation_ff_2-9ba55e7", "cmd": "lfortran --fixed-form --continue-compilation --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/continue_compilation_ff_2.f", "infile_hash": "885df7aadcb0e8e8478ccad6225f17e5c3cf699a04ad8372958afeab", "outfile": null, "outfile_hash": null, "stdout": "asr-continue_compilation_ff_2-9ba55e7.stdout", "stdout_hash": "6b7a042fa48758883b644f18a35cafed9cdb47c21b5c3eb050c1d23a", "stderr": "asr-continue_compilation_ff_2-9ba55e7.stderr", "stderr_hash": "a325f18d048882d5c223d38beb948cb8c3f3e78347f0e46c3ef5f6d1", "returncode": 1 }lfortran-0.63.0/tests/reference/pass_global_stmts-global_scope6-278bd63.stdout0000664000175000017500000000703015174404631027416 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 f1) (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () ) () .false. .false. ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ), x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) [] ) lfortran-0.63.0/tests/reference/asr_disable_warnings-style1-3d16af1.stdout0000664000175000017500000001303415174404631026627 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { save4: (Program (SymbolTable 2 { f: (Function (SymbolTable 3 { x: (Variable 3 x [] Local (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(If () (IntegerCompare (Var 3 x) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Print (StringConstant "x is 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] () Public .false. .false. () ), y: (Variable 2 y [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) save4 [] [(If () (IntegerCompare (Var 2 y) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Print (StringConstant "y is 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-maskr_negative-89183d3.json0000664000175000017500000000074615174404631024325 0ustar alastairalastair{ "basename": "asr-maskr_negative-89183d3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/maskr_negative.f90", "infile_hash": "f49d8a5ebf8050f22484de61b993732e9fa5fab18faeee525c4579d1", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-maskr_negative-89183d3.stderr", "stderr_hash": "4002541c74a9445686f77ea75e6c0a357e9a4598a84578f7f81ad5ed", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-modules_05-c35e0ac.stdout0000664000175000017500000000436715174404631024060 0ustar alastairalastair(TranslationUnit [(Module modules_05_mod (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter ) (SimpleAttribute AttrPublic )] [(a [] [] () 5 Equal ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(b [] [] () 6 Equal ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(c [] [] () 7 Equal ())] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(c [] [] () () None ())] () )] [] [] ) (Program modules_05 () [(Use [] modules_05_mod [(UseSymbol a () ) (UseSymbol c () )] .true. () )] [] [] [(Print 0 () [a c] () )] [] )] ) lfortran-0.63.0/tests/reference/llvm-global_scope7-69a167f.stdout0000664000175000017500000000114515174404631024656 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." @x = global i32 6 define void @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i32, align 4 %0 = load i32, i32* @x, align 4 %1 = mul i32 2, %0 store i32 %1, i32* %__lfortran_evaluate_11, align 4 %2 = load i32, i32* @x, align 4 %3 = add i32 %2, 1 store i32 %3, i32* @x, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return ret void } lfortran-0.63.0/tests/reference/ast-do2-1ec601e.stderr0000664000175000017500000000040215174404631022454 0ustar alastairalastairstyle suggestion: Use 'end do' instead of 'enddo' --> tests/do2.f90:5:1 | 5 | enddo | ^^^^^ help: write this as 'end do' style suggestion: Use 'end do' instead of 'enddo' --> tests/do2.f90:10:1 | 10 | enddo | ^^^^^ help: write this as 'end do' lfortran-0.63.0/tests/reference/ast-template_travel_01-7f304df.json0000664000175000017500000000100015174404631025132 0ustar alastairalastair{ "basename": "ast-template_travel_01-7f304df", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_travel_01.f90", "infile_hash": "49fd555855358466e9af6299db72ebf88c01a40bb93c00fefe71c2c7", "outfile": null, "outfile_hash": null, "stdout": "ast-template_travel_01-7f304df.stdout", "stdout_hash": "7d7e682e5bef7a75c7acc83ee370a9bb2b7a0469f070542d407b0973", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-case_02-9e53b61.stdout0000664000175000017500000000504415174404631023157 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t marks; int32_t out; marks = 81; if (91 <= marks <= 100) { out = 0; std::cout<< "Excellent!"< tests/errors/esub1.f90:1:16 | 1 | subroutine g() r | ^ lfortran-0.63.0/tests/reference/run-format_50-7def206.stdout0000664000175000017500000000020715174404631023634 0ustar alastairalastairtiny = 2.225E-308 huge = 1.798E+308 test = 1.235E+010 test =12.346E+009 test = 0.123E+011 tiny = 2.225E-0308 test = 1.235E+0010 PASSED lfortran-0.63.0/tests/reference/asr-program4-ba26fd1.stdout0000664000175000017500000007672715174404631023650 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { program4: (Program (SymbolTable 2 { func1: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 3 c [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), saved: (Variable 3 saved [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) func1 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b)] [(Assignment (Var 3 saved) (RealBinOp (Var 3 saved) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (Var 3 c) (RealBinOp (RealBinOp (RealBinOp (Var 3 c) Add (Var 3 a) (Real 4) () ) Add (Var 3 b) (Real 4) () ) Add (Var 3 saved) (Real 4) () ) () .false. .false. )] (Var 3 c) Public .true. .true. () ), func2: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 4 c [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 4 d [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), saved1: (Variable 4 saved1 [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), saved2: (Variable 4 saved2 [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) func2 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a) (Var 4 b)] [(Assignment (Var 4 saved1) (RealBinOp (Var 4 saved1) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (Var 4 c) (RealBinOp (RealBinOp (RealBinOp (RealBinOp (RealBinOp (Var 4 d) Add (Var 4 c) (Real 4) () ) Add (Var 4 a) (Real 4) () ) Add (Var 4 b) (Real 4) () ) Add (Var 4 saved1) (Real 4) () ) Add (Var 4 saved2) (Real 4) () ) () .false. .false. ) (Assignment (Var 4 saved2) (RealBinOp (Var 4 saved2) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (Var 4 d) (RealBinOp (Var 4 d) Add (RealConstant 3.000000 (Real 4) ) (Real 4) () ) () .false. .false. )] (Var 4 c) Public .true. .true. () ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) program4 [] [(Assignment (Var 2 x) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 y) (RealConstant 2.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 z) (FunctionCall 2 func1 () [((Var 2 x)) ((Var 2 y))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "6.0 == " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 z) (FunctionCall 2 func1 () [((Var 2 x)) ((Var 2 y))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "7.0 == " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 z) (FunctionCall 2 func2 () [((Var 2 x)) ((Var 2 y))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "6.0 == " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 z) (FunctionCall 2 func2 () [((Var 2 x)) ((Var 2 y))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "8.0 == " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-Subroutine_Call1-5aa005c.stdout0000664000175000017500000000102215174404631025631 0ustar alastairalastairprogram Subroutine_Call1 implicit none ! Syntax check !Subroutine CALL call randn(x(i)) call randn(x) call random_number(U) call rand_gamma0(a, .true., x) call rand_gamma0(a, .true., x(1)) call rand_gamma0(a, .false., x(i)) call rand_gamma_vector_n(a, size(x), x) call f(a=4, b=6, c=i) call g(a(3:5, i:j), b(:)) call g(a(:5, i:j), b(1:)) call a%random_number(u) call a%b%random_number(u) call f(a=4, b=6, c=i) call x%f%e() call self%dependency(ii)%info(unit, pr - 1) call self%dep(:self%ndep)%done(a) end program Subroutine_Call1 lfortran-0.63.0/tests/reference/asr-string_19-d880475.json0000664000175000017500000000074515174404631023144 0ustar alastairalastair{ "basename": "asr-string_19-d880475", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_19.f90", "infile_hash": "d8a26562a756345bdab3a05085b09fadef2c3113a092b362b278b648", "outfile": null, "outfile_hash": null, "stdout": "asr-string_19-d880475.stdout", "stdout_hash": "7801b6fb69bc57936c748a4dc8b7b9454e1ec1849de6df72459ca55b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-shiftl1-0ff5448.json0000664000175000017500000000071215174404631022746 0ustar alastairalastair{ "basename": "asr-shiftl1-0ff5448", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/shiftl1.f90", "infile_hash": "c0c9708eb1b78ae3123b7f35e798bdaf8cac8feb729db248ae3045cb", "outfile": null, "outfile_hash": null, "stdout": "asr-shiftl1-0ff5448.stdout", "stdout_hash": "ead9953cd8ae62982d63ae793204a0b5a19d5de7a576bab208752c61", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-derived_types_09-0e83add.stdout0000664000175000017500000000065515174404631025263 0ustar alastairalastair(TranslationUnit [(Program type_parsing (TriviaNode [(EndOfLine) (EndOfLine)] [] ) [] [] [(DerivedType SomeType [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-continue_compilation_3-435a232.stderr0000664000175000017500000003717415174404631026311 0ustar alastairalastairsyntax error: Token '::' is unexpected here --> tests/errors/continue_compilation_3.f90:57:9 | 57 | rea :: test_real(12) | ^^ syntax error: Token ')' is unexpected here --> tests/errors/continue_compilation_3.f90:58:21 | 58 | real :: test_re() | ^ syntax error: The LFortran pragma !LF$ must be followed by a space --> tests/errors/continue_compilation_3.f90:171:9 | 171 | !LF$unroll 4 ! Error: Missing space after `!LF$` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Module 'continue_compilation_3_fake_module' modfile was not found --> tests/errors/continue_compilation_3.f90:48:5 | 48 | use continue_compilation_3_fake_module | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Explicit shaped array with nonconstant bounds --> tests/errors/continue_compilation_3.f90:67:23 | 67 | integer :: arr_nc(minval(abs(a))) | ^^^^^^^^^^^^^^ semantic error: Assumed-rank arrays are not supported in print statements --> tests/errors/continue_compilation_3.f90:30:18 | 30 | print *, x | ^ semantic error: Assumed rank arrays cannot be used as `source` argument to reshape intrinsic --> tests/errors/continue_compilation_3.f90:31:26 | 31 | print *, reshape(x, [size(x)]) | ^ semantic error: Assumed-rank array `x` cannot be accessed outside a select rank block --> tests/errors/continue_compilation_3.f90:32:18 | 32 | print *, x(1) | ^^^^ semantic error: Assumed-rank array 'x' must be a dummy argument --> tests/errors/continue_compilation_3.f90:33:6 | 33 | x = [1, 2] | ^ semantic error: Comparison operations are not allowed on assumed-rank arrays ('x') --> tests/errors/continue_compilation_3.f90:34:19 | 34 | print *, (x /= [1, 2]) | ^^^^^^^^^^^ semantic error: Non-variable expression in variable definition context (actual argument to INTENT = OUT/INOUT) --> tests/errors/continue_compilation_3.f90:68:26 | 68 | call intent_out_test(1) ! Error: literal constant with intent(out) | ^ semantic error: Non-variable expression in variable definition context (actual argument to INTENT = OUT/INOUT) --> tests/errors/continue_compilation_3.f90:69:26 | 69 | call intent_out_test(x + 1) ! Error: expression with intent(out) | ^^^^^ semantic error: Non-variable expression in variable definition context (actual argument to INTENT = OUT/INOUT) --> tests/errors/continue_compilation_3.f90:70:28 | 70 | call intent_inout_test(2) ! Error: literal constant with intent(inout) | ^ semantic error: Non-variable expression in variable definition context (actual argument to INTENT = OUT/INOUT) --> tests/errors/continue_compilation_3.f90:71:28 | 71 | call intent_inout_test(x * 2) ! Error: expression with intent(inout) | ^^^^^ semantic error: Type mismatch in argument `i`: expected `real(4)` but got `integer(4)` --> tests/errors/continue_compilation_3.f90:72:34 | 72 | call check_incompatible_type(i) ! Error: incompatible type passed | ^ semantic error: Argument 1 to Iachar must have length 1 --> tests/errors/continue_compilation_3.f90:74:14 | 74 | print *, iachar(s1) | ^^^^^^^^^^ semantic error: Empty array constructor is not allowed --> tests/errors/continue_compilation_3.f90:91:9 | 91 | a = [] | ^^ semantic error: Empty array constructor is not allowed --> tests/errors/continue_compilation_3.f90:93:16 | 93 | print *, [[[], [[]]], [[]], []] | ^^ semantic error: Empty array constructor is not allowed --> tests/errors/continue_compilation_3.f90:94:16 | 94 | print *, [[[], [[]]], []] | ^^ semantic error: Rank mismatch in array reference: the array `b` has rank `1`, but is referenced as rank `2` --> tests/errors/continue_compilation_3.f90:96:5 | 96 | b(:,:) = 1 | ^^^^^^ semantic error: Rank mismatch in array reference: the array `b` has rank `1`, but is referenced as rank `2` --> tests/errors/continue_compilation_3.f90:97:5 | 97 | b(:,:) = 2 | ^^^^^^ semantic error: Type member xx is not an array so it cannot be indexed. --> tests/errors/continue_compilation_3.f90:99:5 | 99 | y%xx(:) = 1 | ^^^^^^^ semantic error: Rank mismatch in array reference: the array `str` has rank `1`, but is referenced as rank `2` --> tests/errors/continue_compilation_3.f90:101:5 | 101 | str(1, 2)(:) = '1234' | ^^^^^^^^^^^^ semantic error: Rank mismatch in array reference: the array `str` has rank `1`, but is referenced as rank `3` --> tests/errors/continue_compilation_3.f90:102:5 | 102 | str(1,2,3)(:) = '1234' | ^^^^^^^^^^^^^ semantic error: Type-spec cannot contain an asterisk for a type parameter --> tests/errors/continue_compilation_3.f90:104:14 | 104 | print *, [character(*) :: "a", "b", "ball", "cat"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Type-spec cannot contain an asterisk for a type parameter --> tests/errors/continue_compilation_3.f90:105:14 | 105 | print *, [character(*) :: "a2", "b2", "ball2", "cat2"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Different shape for array assignment on dimension 1(3 and 2) --> tests/errors/continue_compilation_3.f90:107:5 | 107 | x1 = reshape([1,2,3,4],[2,2]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Different shape for array assignment on dimension 1(3 and 1) --> tests/errors/continue_compilation_3.f90:108:5 | 108 | x1 = reshape([1,2,3,4],[1,2]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Arithmetic if (x) requires an integer or real for `x` --> tests/errors/continue_compilation_3.f90:112:9 | 112 | if ("yy") 1, 2, 3 | ^^^^ semantic error: Incorrect number of arguments passed to the 'size' intrinsic. It accepts at least 1 and at most 3 arguments. --> tests/errors/continue_compilation_3.f90:119:9 | 119 | i = size(a1, 1, 4, kind=4) | ^^^^^^^^^^^^^^^^^^^^^^ semantic error: Incorrect number of arguments passed to the 'size' intrinsic. It accepts at least 1 and at most 3 arguments. --> tests/errors/continue_compilation_3.f90:120:9 | 120 | i = size() | ^^^^^^ semantic error: Cannot assign to a constant variable --> tests/errors/continue_compilation_3.f90:122:5 | 122 | x3 = 1 | ^^^^^^ assignment here | 55 | integer, parameter :: x3 = 2 | ~~~~~~ declared as constant semantic error: The end variable of the data implied do loop must be constants --> tests/errors/continue_compilation_3.f90:125:22 | 125 | data(a1(i), i=1, k) / 1, 2, 3 / | ^ semantic error: The increment variable of the data implied do loop must be a constant --> tests/errors/continue_compilation_3.f90:127:25 | 127 | data(a1(i), i=1, 3, k) / 1, 2, 3 / | ^ semantic error: The start variable of the data implied do loop must be constants --> tests/errors/continue_compilation_3.f90:129:19 | 129 | data(a1(i), i=k, 3) / 1, 2, 3 / | ^ semantic error: Variable 'foo' is not declared --> tests/errors/continue_compilation_3.f90:132:9 | 132 | i = foo | ^^^ 'foo' is undeclared semantic error: Invalid argument `end` supplied --> tests/errors/continue_compilation_3.f90:134:5 | 134 | rewind(end="world") | ^^^^^^^^^^^^^^^^^^^ semantic error: Kind of all the arguments of Sign must be the same --> tests/errors/continue_compilation_3.f90:138:14 | 138 | print *, sign(1, 1_8) | ^^^^^^^^^^^^ semantic error: Argument 1 of dabs must be of double precision real type --> tests/errors/continue_compilation_3.f90:140:13 | 140 | print*, dabs(1) | ^^^^^^^ semantic error: Argument of `sqrt` has a negative argument --> tests/errors/continue_compilation_3.f90:142:14 | 142 | print *, sqrt(-1.0) | ^^^^^^^^^^ semantic error: Binary numeric operators cannot be used on strings --> tests/errors/continue_compilation_3.f90:144:14 | 144 | print *, "a" + "b" | ^^^^^^^^^ help: use '//' for string concatenation semantic error: The first index in string section is less than 1 --> tests/errors/continue_compilation_3.f90:147:19 | 147 | print*, "s:", s(-1:4) | ^^^^^^^ semantic error: Substring `start` is less than one --> tests/errors/continue_compilation_3.f90:149:13 | 149 | print*, s1(-2:6) | ^^^^^^^^ semantic error: Substring end index exceeds the string length --> tests/errors/continue_compilation_3.f90:152:13 | 152 | print*, s1(1: 9) | ^^^^^^^^ semantic error: Substring end index at must be of type integer --> tests/errors/continue_compilation_3.f90:154:18 | 154 | print*, s1(1:5.2) | ^^^ semantic error: Substring start index at must be of type integer --> tests/errors/continue_compilation_3.f90:156:16 | 156 | print*, s1(1.1:5) | ^^^ semantic error: Substring stride must be of type integer --> tests/errors/continue_compilation_3.f90:158:19 | 158 | print*, s(1:5:2.2) | ^^^ semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_3.f90:160:5 | 160 | x = "x" | ^ ^^^ type mismatch (integer and string) semantic error: Type mismatch in binary operator, the types must be compatible --> tests/errors/continue_compilation_3.f90:162:9 | 162 | x = 5 + "x" | ^ ^^^ type mismatch (integer and string) semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_3.f90:162:5 | 162 | x = 5 + "x" | ^ ^^^ type mismatch (integer and string) semantic error: Subroutine `bpe` called as a function --> tests/errors/continue_compilation_3.f90:165:9 | 165 | i = bpe() | ^^^^^ semantic error: Variable 'xx' is not declared --> tests/errors/continue_compilation_3.f90:166:14 | 166 | print *, xx | ^^ 'xx' is undeclared semantic error: Variable 'test_re' is not declared --> tests/errors/continue_compilation_3.f90:167:5 | 167 | test_re = 1245.13 | ^^^^^^^ 'test_re' is undeclared semantic error: Array reference is not allowed on scalar variable --> tests/errors/continue_compilation_3.f90:168:5 | 168 | c(1) = 1 | ^^^^ semantic error: Kind of all the arguments of Mergebits must be the same --> tests/errors/continue_compilation_3.f90:176:14 | 176 | print *, merge_bits(1, 2, 3_8) | ^^^^^^^^^^^^^^^^^^^^^ semantic error: Kind of all the arguments of Mergebits must be the same --> tests/errors/continue_compilation_3.f90:177:14 | 177 | print *, merge_bits(merge_i,merge_j,merge_k) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:181:14 | 181 | print *, 5 .and. .true. | ^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:184:14 | 184 | print *, 3.14 .and. .false. | ^^^^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:187:14 | 187 | print *, 5 .and. 6 | ^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:190:14 | 190 | print *, 5 .or. 6 | ^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:191:14 | 191 | print *, 5 .eqv. 6 | ^ semantic error: Right operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:192:28 | 192 | print *, .true. .neqv. 6 | ^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:193:14 | 193 | print *, 3.14 .and. "abcd" | ^^^^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:194:14 | 194 | print *, "abcd" .neqv. "cdef" | ^^^^^^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:195:14 | 195 | print *, 1 .neqv. 2 | ^ semantic error: Left operand's array element type must be LOGICAL --> tests/errors/continue_compilation_3.f90:196:14 | 196 | print *, [1,2,3] .and. .true. | ^^^^^^^ semantic error: Left operand's array element type must be LOGICAL --> tests/errors/continue_compilation_3.f90:197:14 | 197 | print *, [1.0, 2.0] .or. [3.0, 4.0] | ^^^^^^^^^^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:198:14 | 198 | print *, "str1" .or. "str2" | ^^^^^^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:199:14 | 199 | print *, "x" .and. .false. | ^^^ semantic error: Operand of .not. operator is string --> tests/errors/continue_compilation_3.f90:200:14 | 200 | print *, .NOT. "lf" | ^^^^^^^^^^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:201:14 | 201 | print *, "8356" .or. 8356 | ^^^^^^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:202:14 | 202 | print *, "8356" .eqv. 8356.00 | ^^^^^^ semantic error: Left operand's array element type must be LOGICAL --> tests/errors/continue_compilation_3.f90:203:14 | 203 | print *, ['c', 'o', 'd', 'e'] .or. ['m', 'a', 's'] | ^^^^^^^^^^^^^^^^^^^^ semantic error: Different `character` lengths 7 and 2 in array constructor --> tests/errors/continue_compilation_3.f90:204:26 | 204 | print *, ["welcome", "to", "lf"] .and. "contributors" !even size diff of array element must be caught | ^^^^ semantic error: Different types of elements found in array constructor: string and integer(4) --> tests/errors/continue_compilation_3.f90:205:16 | 205 | print *, [( '*',i , i = 1, 10 )] | ^^^^^^^^^^^^^^^^^^^^^ semantic error: cannot pass unallocatable string to allocatable argument --> tests/errors/continue_compilation_3.f90:206:13 | 206 | call ss("hello") | ^^^^^^^ make this expression allocatable semantic error: Argument of 'size' must be an array --> tests/errors/continue_compilation_3.f90:209:23 | 209 | print *, size(bpe) | ^^^ semantic error: Variable 'd' is not declared --> tests/errors/continue_compilation_3.f90:210:15 | 210 | bpe = d | ^ 'd' is undeclared semantic error: Assignment to subroutine is not allowed --> tests/errors/continue_compilation_3.f90:210:9 | 210 | bpe = d | ^^^ lfortran-0.63.0/tests/reference/asr-global_scope9-f638dd0.json0000664000175000017500000000073415174404631024200 0ustar alastairalastair{ "basename": "asr-global_scope9-f638dd0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope9.f90", "infile_hash": "29e87c62bbe7f9efedd2e3cf348e80153367ecc0369b16de6f4db296", "outfile": null, "outfile_hash": null, "stdout": "asr-global_scope9-f638dd0.stdout", "stdout_hash": "99387dc596737f0bc8f29fe85ff1c6d87a6695f90aa907b803f67d7f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-program_04-114a023.stdout0000664000175000017500000000042515174404631023615 0ustar alastairalastair(TranslationUnit [(Program __xx_main () [] [(ImplicitNone [] () )] [] [(Print 0 () [(String "hello world" ())] () )] [] )] ) lfortran-0.63.0/tests/reference/llvm-intrinsics_05-5a73322.json0000664000175000017500000000076415174404631024167 0ustar alastairalastair{ "basename": "llvm-intrinsics_05-5a73322", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_05.f90", "infile_hash": "735edff1f9942ce107c1b84f9ddcf00e648e553327f54dacf7b8238c", "outfile": null, "outfile_hash": null, "stdout": "llvm-intrinsics_05-5a73322.stdout", "stdout_hash": "bb43d977b1176d148ea81b2971011450eac7982e7724d82bf7305924", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-parse_without_program_line-0b3170b.json0000664000175000017500000000100315174404631027001 0ustar alastairalastair{ "basename": "ast-parse_without_program_line-0b3170b", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parse_without_program_line.f90", "infile_hash": "c68088b59370c4f5a2dc3747e3ca0c7de19d0210a92e2043fb975b96", "outfile": null, "outfile_hash": null, "stdout": "ast-parse_without_program_line-0b3170b.stdout", "stdout_hash": "3b6396afa747e6c7fd70f4fcdd6cde6d058a00d2d9b63afad4c2e1c5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-goto_03-75b98c5.json0000664000175000017500000000073715174404631022665 0ustar alastairalastair{ "basename": "ast-goto_03-75b98c5", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/goto_03.f90", "infile_hash": "2a8829b6e334f6c1619d1d9c772f871874336138a9aa68816641754c", "outfile": null, "outfile_hash": null, "stdout": "ast-goto_03-75b98c5.stdout", "stdout_hash": "043b1d9edace238ac68f4735fded4d14956a8653ab79077ac8d1030e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-implied_do_loop1-1d0df34.stdout0000664000175000017500000000022215174404631025244 0ustar alastairalastair1 12.8999996 2 12.8999996 1 1 12.8999996 2 12.8999996 12.8999996 2 1 12.8999996 2 12.8999996 12.8999996 lfortran-0.63.0/tests/reference/ast_f90-interface2-82ff094.stdout0000664000175000017500000000063515174404631024455 0ustar alastairalastairmodule interface2 implicit none abstract interface subroutine read_params(this, params) import class(porous_drag_model), intent(inout) :: this type(parameter_list), pointer, intent(in) :: params end subroutine read_params end interface interface assignment (=) module procedure SomeProc procedure SomeProc2 procedure SomeProc3 end interface assignment (=) end module interface2 lfortran-0.63.0/tests/reference/asr-implicit3-016ebe4.stderr0000664000175000017500000000025415174404631023672 0ustar alastairalastairsemantic error: Implicit typing is not allowed, enable it by using --implicit-typing --> tests/errors/implicit3.f90:3:1 | 3 | implicit real (a) | ^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-modules_37-7eba027.json0000664000175000017500000000075015174404631023426 0ustar alastairalastair{ "basename": "asr-modules_37-7eba027", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_37.f90", "infile_hash": "38f6c4643686768ff7e53fc236694c9de56c70b63a8b18bc70765a20", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_37-7eba027.stdout", "stdout_hash": "e66e04c84bcc48c372de0bb148039d6770c0fc0df8759d22a93d2264", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-parameter_01-c88a516.stdout0000664000175000017500000000021115174404631024676 0ustar alastairalastairprogram parameter_01 implicit none integer :: i, j, k parameter(i = 1) parameter(j = 2, k = 3) print *, i, j, k end program parameter_01 lfortran-0.63.0/tests/reference/asr-array2-e7997a8.json0000664000175000017500000000070715174404631022615 0ustar alastairalastair{ "basename": "asr-array2-e7997a8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/array2.f90", "infile_hash": "ec67f153c5f506f6a12ef94b06d43c7e9e86b9fc33c9c196029183f0", "outfile": null, "outfile_hash": null, "stdout": "asr-array2-e7997a8.stdout", "stdout_hash": "de50a1bb60b4d4cbdc203ee7c9a2e7c1987f6b45f2a23029f42bea20", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-subroutines_05-1398db3.stdout0000664000175000017500000002402215174404631024630 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bugsize: (Program (SymbolTable 2 { f: (Function (SymbolTable 3 { e: (Variable 3 e [x] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 3 x) () (Integer 4) () ))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [(Assignment (Var 3 e) (Cast (Var 3 x) IntegerToReal (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 3 x) () (Integer 4) () ))] PointerArray ) () () ) () .false. .false. ) (Assignment (Var 3 e) (ArrayConstant 16 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00, 4.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray ) ColMajor ) () .false. .false. ) (Print (StringFormat () [(Var 3 e)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), x: (Variable 2 x [] Local () () Default (Pointer (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) bugsize [] [(Allocate [((Var 2 x) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] () () ())] () () () ) (SubroutineCall 2 f () [((Var 2 x))] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/cpp-array1-d75d040.stdout0000664000175000017500000000630415174404631023133 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct f32_5_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; f32_5_1(Kokkos::View* data_): data{data_} {}; }; struct f32_2_3_2 { Kokkos::View* data; dimension_descriptor dims[2]; bool is_allocated; f32_2_3_2(Kokkos::View* data_): data{data_} {}; }; struct f32_1_2_3_3 { Kokkos::View* data; dimension_descriptor dims[3]; bool is_allocated; f32_1_2_3_3(Kokkos::View* data_): data{data_} {}; }; struct i32_3_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; i32_3_1(Kokkos::View* data_): data{data_} {}; }; struct i32_6_3_2 { Kokkos::View* data; dimension_descriptor dims[2]; bool is_allocated; i32_6_3_2(Kokkos::View* data_): data{data_} {}; }; struct i32_4_3_2_3 { Kokkos::View* data; dimension_descriptor dims[3]; bool is_allocated; i32_4_3_2_3(Kokkos::View* data_): data{data_} {}; }; // Forward declarations namespace { } // Implementations namespace { void main2() { bool a; Kokkos::View& b; Kokkos::View& b2; Kokkos::View& b3; float d; Kokkos::View e_data("e_data", 5); f32_5_1 e_value(&e_data); f32_5_1* e = &e_value; e->dims[0].lower_bound = 1; e->dims[0].length = 5; Kokkos::View e2_data("e2_data", 6); f32_2_3_2 e2_value(&e2_data); f32_2_3_2* e2 = &e2_value; e2->dims[0].lower_bound = 1; e2->dims[0].length = 2; e2->dims[1].lower_bound = 1; e2->dims[1].length = 3; Kokkos::View e3_data("e3_data", 6); f32_1_2_3_3 e3_value(&e3_data); f32_1_2_3_3* e3 = &e3_value; e3->dims[0].lower_bound = 1; e3->dims[0].length = 1; e3->dims[1].lower_bound = 1; e3->dims[1].length = 2; e3->dims[2].lower_bound = 1; e3->dims[2].length = 3; int32_t f; Kokkos::View g_data("g_data", 3); i32_3_1 g_value(&g_data); i32_3_1* g = &g_value; g->dims[0].lower_bound = 1; g->dims[0].length = 3; Kokkos::View g2_data("g2_data", 18); i32_6_3_2 g2_value(&g2_data); i32_6_3_2* g2 = &g2_value; g2->dims[0].lower_bound = 1; g2->dims[0].length = 6; g2->dims[1].lower_bound = 1; g2->dims[1].length = 3; Kokkos::View g3_data("g3_data", 24); i32_4_3_2_3 g3_value(&g3_data); i32_4_3_2_3* g3 = &g3_value; g3->dims[0].lower_bound = 1; g3->dims[0].length = 4; g3->dims[1].lower_bound = 1; g3->dims[1].length = 3; g3->dims[2].lower_bound = 1; g3->dims[2].length = 2; } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/asr-template_array_03-b7f9799.json0000664000175000017500000000112515174404631024726 0ustar alastairalastair{ "basename": "asr-template_array_03-b7f9799", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_array_03.f90", "infile_hash": "0a5f1f988c49d757a19f81d842de7eea019605572d3da0afa04570aa", "outfile": null, "outfile_hash": null, "stdout": "asr-template_array_03-b7f9799.stdout", "stdout_hash": "f9d0010f79818d9c58c54870a22febcfda9933bab234ef1052688278", "stderr": "asr-template_array_03-b7f9799.stderr", "stderr_hash": "8e5e5eb3564a9c02c74e592aa5fdd1ce96bc1b68565e23b2b4ad7e98", "returncode": 0 }lfortran-0.63.0/tests/reference/asr_ignore_pragma-pragma2-ba96e35.json0000664000175000017500000000076615174404631025706 0ustar alastairalastair{ "basename": "asr_ignore_pragma-pragma2-ba96e35", "cmd": "lfortran --ignore-pragma --show-asr --no-color {infile} -o {outfile}", "infile": "tests/pragma2.f90", "infile_hash": "c76c30115a39aa0c98b24173c8517df1fb525bf101023b12dc38ca3e", "outfile": null, "outfile_hash": null, "stdout": "asr_ignore_pragma-pragma2-ba96e35.stdout", "stdout_hash": "9228ea5ad46e01a49db0616571486a0f911f28f25ca1fc1a5a91f58f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-expr_05-c1f66bd.stdout0000664000175000017500000002574015174404631023374 0ustar alastairalastair(TranslationUnit [(Program expr_05 (TriviaNode [(EndOfLine) (Comment "! Test parantheses in expressions" )] [] ) [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ()) (a [] [] () () None ()) (b [] [] () () None ()) (c [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [] [(l [] [] () () None ())] () )] [(Assignment 0 a 3 () ) (Assignment 0 b 4 () ) (Assignment 0 c 5 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 x (* 2 3) () ) (Assignment 0 x (* (u- 2) 3) () ) (Assignment 0 x (* 2 (u- 3)) () ) (Assignment 0 x (* (u- 2) (u- 3)) () ) (Assignment 0 x (* (u- 2) (u- 3)) () ) (Assignment 0 x (u- (** 2 3)) () ) (Assignment 0 x (u- (** 2 3)) () ) (Assignment 0 x (u- (* 2 3)) () ) (Assignment 0 x (** 2 (u- 3)) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 x a () ) (Assignment 0 x (Parenthesis a ) () ) (Assignment 0 x (* a b) () ) (Assignment 0 x (* (u- a) b) () ) (Assignment 0 x (u- (* a b)) () ) (Assignment 0 x (* a (u- b)) () ) (Assignment 0 x (* (u- a) (u- b)) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 x (* (* a b) c) () ) (Assignment 0 x (* (* (u- a) b) c) () ) (Assignment 0 x (* (* a (u- b)) c) () ) (Assignment 0 x (* (* a b) (u- c)) () ) (Assignment 0 x (* (* (u- a) (u- b)) (u- c)) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 x (+ 3 (* 4 5)) () ) (Assignment 0 x (* (+ 3 4) 5) () ) (Assignment 0 x (* a (+ b (* 5 (- c b)))) () ) (Assignment 0 x (* (- 3 (* (* 2 a) b)) 5) () ) (Assignment 0 x (* (+ (* (* (u- 2) a) b) 3) 5) () ) (Assignment 0 x (* (+ (* (* (u- 2) a) b) (* (* 3 b) a)) 5) () ) (Assignment 0 x (* (+ (* (u- 2) (/ a b)) (** (+ a (u- b)) 2)) 5) () ) (Assignment 0 x (* (+ (* (* (u+ 2) a) b) 3) 5) () ) (Assignment 0 x (+ (+ (** a 2) (* (* 2 a) b)) (** b 2)) () ) (Assignment 0 x (* (+ a b) (- a b)) () ) (Assignment 0 x (** (+ a b) 2) () ) (Assignment 0 x (* (+ a b) (+ (- (** a 2) (* a b)) (** b 2))) () ) (Assignment 0 x (* (* (- a b) (+ a b)) (+ (** a 2) (** b 2))) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 x (/ 1 (* a b)) () ) (Assignment 0 x (* (/ 1 a) b) () ) (Assignment 0 x (* (/ 1 a) b) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 x (/ 1 (+ (* a b) 1)) () ) (Assignment 0 x (+ (* (/ 1 a) b) 1) () ) (Assignment 0 x (+ (* (/ 1 a) b) 1) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 x (- 2 (u- 2)) () ) (Assignment 0 x (- a (- (u- b) c)) () ) (Assignment 0 x (- a (* (u- 2) b)) () ) (Assignment 0 x (- c (/ (u- 2) b)) () ) (Assignment 0 x (- a (+ (+ 2 3) 4)) () ) (Assignment 0 x (+ a (+ (+ 2 3) 4)) () ) (Assignment 0 x (- (+ (* 2 a) (* a b)) (+ (* a b) (* 2 a))) () ) (Assignment 0 x (- (+ (* 2 a) (* a b)) (- (* a b) (* 2 a))) () ) (Assignment 0 x (- a (- b (- c 1))) () ) (Assignment 0 x (- a b) () ) (Assignment 0 x (- a (- b c)) () ) (Assignment 0 x (- (- a b) c) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 x (u- (- a (+ (u- b) (- (u- b) (* (u- b) b))))) () ) (Assignment 0 x (u- (+ 3 5)) () ) (Assignment 0 x (u- (+ a 5)) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 l (BoolOp (BoolOp (<= (+ (* (** x 3) 4) a) 4) Or (BoolOp (< x 5) And (< x 6) ) ) Eqv (BoolOp (Logical .true. ()) Or (BoolOp (not (Logical .false. ())) And (Logical .true. ()) ) ) ) () ) (Assignment 0 l (BoolOp l Or (BoolOp l And l ) ) () ) (Assignment 0 l (BoolOp (BoolOp l Or l ) And l ) () ) (Assignment 0 l (BoolOp (BoolOp l And l ) Or l ) () ) (Assignment 0 l (BoolOp l And (BoolOp l Or l ) ) () ) (Assignment 0 l (BoolOp l Or (BoolOp (not l) And l ) ) () ) (Assignment 0 l (BoolOp l Or (BoolOp l And (not l) ) ) () ) (Assignment 0 l (BoolOp (BoolOp l And l ) Or (not l) ) () ) (Assignment 0 l (BoolOp (BoolOp l And (not l) ) Or l ) () ) (Assignment 0 l (BoolOp l And (not (BoolOp l Or l )) ) () )] [] )] ) lfortran-0.63.0/tests/reference/asr-derived_types_03-b1d32aa.stdout0000664000175000017500000004316615174404631025244 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_03: (Program (SymbolTable 2 { b: (Variable 2 b [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 x Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Struct (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) x (StructType [(Integer 4)] [] .true. .false. ) [] [i] [] Source Public .false. .false. [] () () [] ), y: (Function (SymbolTable 4 { a: (Struct (SymbolTable 5 { i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a (StructType [(Integer 4)] [] .true. .false. ) [] [i] [] Source Public .false. .false. [] () () [] ), b: (Variable 4 b [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 4 a Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) y (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .true. .true. () ), z: (Function (SymbolTable 6 { a: (Struct (SymbolTable 7 { i: (Variable 7 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a (StructType [(Integer 4)] [] .true. .false. ) [] [i] [] Source Public .false. .false. [] () () [] ), b: (Variable 6 b [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 6 a Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 6 z [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) z (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 6 z) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. )] (Var 6 z) Public .true. .true. () ) }) derived_types_03 [] [] ) }) [] ) lfortran-0.63.0/tests/reference/cpp-arrays_01-4fac8c3.json0000664000175000017500000000073015174404631023325 0ustar alastairalastair{ "basename": "cpp-arrays_01-4fac8c3", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/arrays_01.f90", "infile_hash": "f7df4142feb383f836dfa072a60673922e8873b5695f893be8329b89", "outfile": null, "outfile_hash": null, "stdout": "cpp-arrays_01-4fac8c3.stdout", "stdout_hash": "d080ea538291a00639415954ed47e7605f4a0e724c6d9c0a0d23d430", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-exit1-29ee7ce.json0000664000175000017500000000077015174404631022614 0ustar alastairalastair{ "basename": "run-exit1-29ee7ce", "cmd": "lfortran --no-color {infile}", "infile": "tests/exit1.f90", "infile_hash": "abc1b402ea4f1576938c8fde3e78af95360770c94eacad03f403f5d6", "outfile": null, "outfile_hash": null, "stdout": "run-exit1-29ee7ce.stdout", "stdout_hash": "61f0d87e355fe9206f69359bd0d77b9ac928ec3fdf45d6c625f90bce", "stderr": "run-exit1-29ee7ce.stderr", "stderr_hash": "95f484ba233b9e026fd67516cf7aa5435cfa13519766c6e935d45309", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-derived_types_14-75884fe.stdout0000664000175000017500000010640015174404631025132 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_14_module: (Module (SymbolTable 4 { enum_type: (Struct (SymbolTable 5 { boolean: (Variable 5 boolean [] Local (IntegerConstant 102 (Integer 4) Decimal) (IntegerConstant 102 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), datetime: (Variable 5 datetime [] Local (IntegerConstant 105 (Integer 4) Decimal) (IntegerConstant 105 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), float: (Variable 5 float [] Local (IntegerConstant 104 (Integer 4) Decimal) (IntegerConstant 104 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), int: (Variable 5 int [] Local (IntegerConstant 103 (Integer 4) Decimal) (IntegerConstant 103 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), invalid: (Variable 5 invalid [] Local (IntegerConstant 100 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 5 string [] Local (IntegerConstant 101 (Integer 4) Decimal) (IntegerConstant 101 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) enum_type (StructType [(Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) [] [invalid string boolean int float datetime] [] Source Private .false. .false. [] () () [] ), toml_type: (Variable 4 toml_type [] Local (StructConstant 4 enum_type [((IntegerConstant 100 (Integer 4) Decimal)) ((IntegerConstant 101 (Integer 4) Decimal)) ((IntegerConstant 102 (Integer 4) Decimal)) ((IntegerConstant 103 (Integer 4) Decimal)) ((IntegerConstant 104 (Integer 4) Decimal)) ((IntegerConstant 105 (Integer 4) Decimal))] (StructType [(Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) (StructConstant 4 enum_type [((IntegerConstant 100 (Integer 4) Decimal)) ((IntegerConstant 101 (Integer 4) Decimal)) ((IntegerConstant 102 (Integer 4) Decimal)) ((IntegerConstant 103 (Integer 4) Decimal)) ((IntegerConstant 104 (Integer 4) Decimal)) ((IntegerConstant 105 (Integer 4) Decimal))] (StructType [(Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) Parameter (StructType [(Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) 4 enum_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) derived_types_14_module () [] .true. .false. .false. ), derived_types_14_module1: (Module (SymbolTable 2 { check: (Function (SymbolTable 7 { raw: (Variable 7 raw [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 7 res [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) check (FunctionType [(String 1 () AssumedLength DescriptorString)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 raw)] [(Assignment (Var 7 res) (LogicalConstant .true. (Logical 4) ) () .false. .false. )] (Var 7 res) Public .true. .true. () ), enum_type: (ExternalSymbol 2 enum_type 4 enum_type derived_types_14_module [] enum_type Public ), toml_get_value_type: (Function (SymbolTable 6 { 1_enum_type_boolean: (ExternalSymbol 6 1_enum_type_boolean 5 boolean enum_type [] boolean Public ), 1_enum_type_datetime: (ExternalSymbol 6 1_enum_type_datetime 5 datetime enum_type [] datetime Public ), 1_enum_type_float: (ExternalSymbol 6 1_enum_type_float 5 float enum_type [] float Public ), 1_enum_type_int: (ExternalSymbol 6 1_enum_type_int 5 int enum_type [] int Public ), 1_enum_type_invalid: (ExternalSymbol 6 1_enum_type_invalid 5 invalid enum_type [] invalid Public ), 1_enum_type_string: (ExternalSymbol 6 1_enum_type_string 5 string enum_type [] string Public ), raw: (Variable 6 raw [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), vtype: (Variable 6 vtype [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_get_value_type (FunctionType [(String 1 () AssumedLength DescriptorString)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [check] [(Var 6 raw)] [(If () (FunctionCall 2 check () [((Var 6 raw))] (Logical 4) () () ) [(Assignment (Var 6 vtype) (StructInstanceMember (Var 2 toml_type) 6 1_enum_type_string (Integer 4) (IntegerConstant 101 (Integer 4) Decimal) ) () .false. .false. ) (Return)] [] ) (If () (FunctionCall 2 check () [((Var 6 raw))] (Logical 4) () () ) [(Assignment (Var 6 vtype) (StructInstanceMember (Var 2 toml_type) 6 1_enum_type_boolean (Integer 4) (IntegerConstant 102 (Integer 4) Decimal) ) () .false. .false. ) (Return)] [] ) (If () (FunctionCall 2 check () [((Var 6 raw))] (Logical 4) () () ) [(Assignment (Var 6 vtype) (StructInstanceMember (Var 2 toml_type) 6 1_enum_type_int (Integer 4) (IntegerConstant 103 (Integer 4) Decimal) ) () .false. .false. ) (Return)] [] ) (If () (FunctionCall 2 check () [((Var 6 raw))] (Logical 4) () () ) [(Assignment (Var 6 vtype) (StructInstanceMember (Var 2 toml_type) 6 1_enum_type_float (Integer 4) (IntegerConstant 104 (Integer 4) Decimal) ) () .false. .false. ) (Return)] [] ) (If () (FunctionCall 2 check () [((Var 6 raw))] (Logical 4) () () ) [(Assignment (Var 6 vtype) (StructInstanceMember (Var 2 toml_type) 6 1_enum_type_datetime (Integer 4) (IntegerConstant 105 (Integer 4) Decimal) ) () .false. .false. ) (Return)] [] ) (Assignment (Var 6 vtype) (StructInstanceMember (Var 2 toml_type) 6 1_enum_type_invalid (Integer 4) (IntegerConstant 100 (Integer 4) Decimal) ) () .false. .false. )] (Var 6 vtype) Public .true. .true. () ), toml_type: (ExternalSymbol 2 toml_type 4 toml_type derived_types_14_module [] toml_type Public ) }) derived_types_14_module1 () [derived_types_14_module derived_types_14_module1] .false. .false. .false. ), main: (Program (SymbolTable 8 { }) main [] [(Print (StringConstant "running derived_types_14 main program" (String 1 (IntegerConstant 37 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-case_04-60840db.stdout0000664000175000017500000000321615174404631023156 0ustar alastairalastair(TranslationUnit [(Program case_04 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(Assignment 0 i 4 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Select 0 () i [(CaseStmt [(CaseCondExpr 1 )] () [(Print 0 () [(String "1" ())] () )] ) (CaseStmt [(CaseCondExpr 2 ) (CaseCondRange 3 5 ) (CaseCondExpr 6 ) (CaseCondRange 8 10 )] () [(Print 0 () [(String "2,3:5,6,8:10" ())] () )] )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/llvm-nullify_01-810c9d3.json0000664000175000017500000000075315174404631023543 0ustar alastairalastair{ "basename": "llvm-nullify_01-810c9d3", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/nullify_01.f90", "infile_hash": "5869e698f080612903a66a6001fa03b7b3390371a5a9eef3ca48a545", "outfile": null, "outfile_hash": null, "stdout": "llvm-nullify_01-810c9d3.stdout", "stdout_hash": "41f61980362bc0970b2722586c3f9455bb780f49c030cbaad70c177a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-recursion_03-8300fac.json0000664000175000017500000000075615174404631023763 0ustar alastairalastair{ "basename": "asr-recursion_03-8300fac", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/recursion_03.f90", "infile_hash": "ca5d64a5bc86665cf6168763480264f56ea25b3bfcc7217348fb14c0", "outfile": null, "outfile_hash": null, "stdout": "asr-recursion_03-8300fac.stdout", "stdout_hash": "3ca56a29019e45384b3911d48788ce797dbf5c36c30e4a4538b74caf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-if_05-2102585.stdout0000664000175000017500000000162115174404631023014 0ustar alastairalastairfunction main() local x::Bool local y::Bool x = true y = false if x println("x: Single Line If") end if y println("y: Single Line If") end if x println("x: Multi Line If-Else: x is True") else println("x: Multi Line If-Else: x is False") end if y println("y: Multi Line If-Else: y is True") else println("y: Multi Line If-Else: y is False") end if x println("x: If part") else if x println("x: Else-If part") end end if y println("y: If part") else if x println("x: Else-If part") else println("Else part") end end if y println("y: If part") else if y println("y: Else-If part") else println("Else part") end end end main() lfortran-0.63.0/tests/reference/asr_clojure-functions_10-476558d.stdout0000664000175000017500000002210015174404631025721 0ustar alastairalastair(TranslationUnit (SymbolTable 1 {:kwarg_gp (Module (SymbolTable 2 {:mergegp (GenericProcedure 2 mergegp [2 mergei32 2 merger32 2 merger64] Public), :mergei32 (Function (SymbolTable 3 {:a (Variable 3 a [] Unspecified () () Default (Array (Integer 4) [(() ())] DescriptorArray) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0), :b (Variable 3 b [] Unspecified () () Default (Array (Integer 4) [(() ())] DescriptorArray) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0), :m (Variable 3 m [] Unspecified () () Default (Array (Integer 4) [(() ())] DescriptorArray) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0), :r (Variable 3 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0)}) mergei32 (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray) (Array (Integer 4) [(() ())] DescriptorArray) (Array (Integer 4) [(() ())] DescriptorArray)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false.) [] [(Var 3 a) (Var 3 b) (Var 3 m)] [] (Var 3 r) Public .true. .true. ()), :merger32 (Function (SymbolTable 4 {:a (Variable 4 a [] Unspecified () () Default (Array (Real 4) [(() ())] DescriptorArray) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0), :b (Variable 4 b [] Unspecified () () Default (Array (Real 4) [(() ())] DescriptorArray) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0), :m (Variable 4 m [] Unspecified () () Default (Array (Real 4) [(() ())] DescriptorArray) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0), :r (Variable 4 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0)}) merger32 (FunctionType [(Array (Real 4) [(() ())] DescriptorArray) (Array (Real 4) [(() ())] DescriptorArray) (Array (Real 4) [(() ())] DescriptorArray)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false.) [] [(Var 4 a) (Var 4 b) (Var 4 m)] [] (Var 4 r) Public .true. .true. ()), :merger64 (Function (SymbolTable 5 {:a (Variable 5 a [] Unspecified () () Default (Array (Real 8) [(() ())] DescriptorArray) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0), :b (Variable 5 b [] Unspecified () () Default (Array (Real 8) [(() ())] DescriptorArray) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0), :m (Variable 5 m [] Unspecified () () Default (Array (Real 8) [(() ())] DescriptorArray) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0), :r (Variable 5 r [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0)}) merger64 (FunctionType [(Array (Real 8) [(() ())] DescriptorArray) (Array (Real 8) [(() ())] DescriptorArray) (Array (Real 8) [(() ())] DescriptorArray)] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false.) [] [(Var 5 a) (Var 5 b) (Var 5 m)] [] (Var 5 r) Public .true. .true. ())}) kwarg_gp () [] .false. .false. .false.), :kwarg_use (Program (SymbolTable 6 {:a1 (Variable 6 a1 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0), :a2 (Variable 6 a2 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0), :b1 (Variable 6 b1 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0), :b2 (Variable 6 b2 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0), :m1 (Variable 6 m1 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0), :m2 (Variable 6 m2 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0), :mergegp (ExternalSymbol 6 mergegp 2 mergegp kwarg_gp [] mergegp Public), :mergegp/mergei32 (ExternalSymbol 6 mergegp/mergei32 2 mergei32 kwarg_gp [] mergei32 Private), :mergegp/merger32 (ExternalSymbol 6 mergegp/merger32 2 merger32 kwarg_gp [] merger32 Private), :mergei32 (ExternalSymbol 6 mergei32 2 mergei32 kwarg_gp [] mergei32 Public), :merger32 (ExternalSymbol 6 merger32 2 merger32 kwarg_gp [] merger32 Public), :merger64 (ExternalSymbol 6 merger64 2 merger64 kwarg_gp [] merger64 Public)}) kwarg_use [kwarg_gp] [(Print (StringFormat () [(FunctionCall 6 mergegp/mergei32 6 mergegp [((ArrayPhysicalCast (Var 6 a1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 b1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray) ())) (())] (Integer 4) () ())] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString)) ())) (Print (StringFormat () [(FunctionCall 6 mergegp/mergei32 6 mergegp [((ArrayPhysicalCast (Var 6 a1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 b1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 m1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray) ()))] (Integer 4) () ())] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString)) ())) (Print (StringFormat () [(FunctionCall 6 mergegp/mergei32 6 mergegp [((ArrayPhysicalCast (Var 6 a1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 b1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 m1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray) ()))] (Integer 4) () ())] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString)) ())) (Print (StringFormat () [(FunctionCall 6 mergegp/merger32 6 mergegp [((ArrayPhysicalCast (Var 6 a2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 b2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray) ())) (())] (Real 4) () ())] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString)) ())) (Print (StringFormat () [(FunctionCall 6 mergegp/merger32 6 mergegp [((ArrayPhysicalCast (Var 6 a2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 b2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 m2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray) ()))] (Real 4) () ())] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString)) ())) (Print (StringFormat () [(FunctionCall 6 mergegp/merger32 6 mergegp [((ArrayPhysicalCast (Var 6 a2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 b2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 m2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray) ()))] (Real 4) () ())] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString)) ()))])}) []) lfortran-0.63.0/tests/reference/asr-nested_01-290187e.stdout0000664000175000017500000003002715174404631023450 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nested_01: (Program (SymbolTable 5 { b: (ExternalSymbol 5 b 2 b nested_01_a [] b Public ), c: (Variable 5 c [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) nested_01 [nested_01_a] [(Assignment (Var 5 c) (FunctionCall 5 b () [] (Integer 4) () () ) () .false. .false. )] ), nested_01_a: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { b: (Variable 3 b [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Function (SymbolTable 4 { d: (Variable 4 d [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) d (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "d()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Assignment (Var 4 d) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. )] (Var 4 d) Public .false. .false. () ), e: (Variable 3 e [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) b (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "b()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Assignment (Var 3 e) (FunctionCall 3 d () [] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 3 b) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 3 b) Public .false. .false. () ) }) nested_01_a () [nested_01_a] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-dnint_args-3d72f4b.stderr0000664000175000017500000000023615174404631024132 0ustar alastairalastairsemantic error: Too many arguments to call `dnint` --> tests/errors/dnint_args.f90:2:13 | 2 | print*, dnint(1.0_8, 8) | ^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-statement_02-daaef34.stdout0000664000175000017500000001374615174404631024474 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { gscale: (Function (SymbolTable 2 { fpoint: (Function (SymbolTable 4 { fpoint_return_var_name: (Variable 4 fpoint_return_var_name [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 4 i [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fpoint (FunctionType [(Integer 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 i)] [(Assignment (Var 4 fpoint_return_var_name) (Cast (Var 4 i) IntegerToReal (Real 4) () () ) () .false. .false. )] (Var 4 fpoint_return_var_name) Public .false. .true. () ) }) gscale (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .true. .true. () ), statement_02: (Program (SymbolTable 3 { }) statement_02 [] [(SubroutineCall 1 gscale () [] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-complex_pow_test-c556b63.stdout0000664000175000017500000001307115174404631025337 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex2: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) complex2 [] [(Assignment (Var 2 x) (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 4.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 y) (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 2.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 z) (ComplexBinOp (Var 2 x) Pow (Var 2 y) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_travel_02-4448a71.json0000664000175000017500000000100015174404631024770 0ustar alastairalastair{ "basename": "asr-template_travel_02-4448a71", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_travel_02.f90", "infile_hash": "045f7caf874cd599c9a9fb7115ab3b9d0341395565a1387bdfdaf16b", "outfile": null, "outfile_hash": null, "stdout": "asr-template_travel_02-4448a71.stdout", "stdout_hash": "5ca89aaea978f3c9b0a082a688dd448475de3d2a696903fe8ea063e8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-return_06-ec98b0b.json0000664000175000017500000000075015174404631023543 0ustar alastairalastair{ "basename": "llvm-return_06-ec98b0b", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/return_06.f90", "infile_hash": "45589b7367a00e9dbec0cb3bfe91894d24c7914fda043a53043d4276", "outfile": null, "outfile_hash": null, "stdout": "llvm-return_06-ec98b0b.stdout", "stdout_hash": "2ac0b608df3a61128ee62d7fce3a0023d8c2f4225bc08208383f1fa3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_02-f2b519f.stderr0000664000175000017500000000022615174404631023423 0ustar alastairalastairsemantic error: Empty array constructor is not allowed --> tests/errors/array_02.f90:4:12 | 4 | print *, [[[], [[]]], [[]], []] | ^^ lfortran-0.63.0/tests/reference/ast-goto_01-d8652f5.stdout0000664000175000017500000000134315174404631023223 0ustar alastairalastair(TranslationUnit [(Program goto_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ())] () )] [(Assignment 0 a 5 () ) (GoTo 0 () 1 [] () ) (Print 1 () [a] () )] [] )] ) lfortran-0.63.0/tests/reference/run-write4-f453580.stdout0000664000175000017500000000004215174404631023114 0ustar alastairalastairhi, how are you? I am doing good lfortran-0.63.0/tests/reference/ast-comments1-213c55a.stdout0000664000175000017500000000166215174404631023645 0ustar alastairalastair(TranslationUnit [(Program comments1 (TriviaNode [(EndOfLine) (EndOfLine) (Comment "! Next line comment 0" )] [] ) [] [] [] [(Print 0 () [(String "1" ())] (TriviaNode [] [(EOLComment "! end of line comment 1" ) (Comment "! Next line comment 1" )] ) ) (Print 0 () [(String "2" ())] (TriviaNode [] [(EOLComment "! end of line comment 2" ) (Comment "! Next line comment 2" ) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/pass_global_stmts-expr1-213371d.json0000664000175000017500000000076415174404631025301 0ustar alastairalastair{ "basename": "pass_global_stmts-expr1-213371d", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr1.f90", "infile_hash": "3c49cb3157ec3feaf0f97156e5c11dca0ffd6481c97bb1a5dffaa14f", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-expr1-213371d.stdout", "stdout_hash": "69e060787e0d9f776613579535fcf55c460fa0a3a712b9d8784a7d2f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-volatile_02-2beae13.stdout0000664000175000017500000000520015174404631024371 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @volatile_02.iota_2 = internal global float 5.000000e-01 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) store volatile float 5.000000e-01, float* @volatile_02.iota_2, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, float* @volatile_02.iota_2) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_volatile_02 FINALIZE_SYMTABLE_volatile_02: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/llvm-class_04-290b898.stdout0000664000175000017500000002417015174404631023473 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> %main.foo_c = type { %main.foo_b, %main.bar_c } %main.foo_b = type { %main.foo_a, %main.bar_b } %main.foo_a = type { %main.bar_a } %main.bar_a = type { i32 } %main.bar_b = type { %main.bar_a, i32 } %main.bar_c = type { %main.bar_b, i32 } @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc4 = alloca %string_descriptor, align 8 %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %foo = alloca %main.foo_c, align 8 %3 = getelementptr %main.foo_c, %main.foo_c* %foo, i32 0, i32 1 %4 = getelementptr %main.bar_c, %main.bar_c* %3, i32 0, i32 1 %5 = getelementptr %main.bar_c, %main.bar_c* %3, i32 0, i32 0 %6 = getelementptr %main.bar_b, %main.bar_b* %5, i32 0, i32 1 %7 = getelementptr %main.bar_b, %main.bar_b* %5, i32 0, i32 0 %8 = getelementptr %main.bar_a, %main.bar_a* %7, i32 0, i32 0 %9 = getelementptr %main.foo_c, %main.foo_c* %foo, i32 0, i32 0 %10 = getelementptr %main.foo_b, %main.foo_b* %9, i32 0, i32 1 %11 = getelementptr %main.bar_b, %main.bar_b* %10, i32 0, i32 1 %12 = getelementptr %main.bar_b, %main.bar_b* %10, i32 0, i32 0 %13 = getelementptr %main.bar_a, %main.bar_a* %12, i32 0, i32 0 %14 = getelementptr %main.foo_b, %main.foo_b* %9, i32 0, i32 0 %15 = getelementptr %main.foo_a, %main.foo_a* %14, i32 0, i32 0 %16 = getelementptr %main.bar_a, %main.bar_a* %15, i32 0, i32 0 %17 = getelementptr %main.foo_c, %main.foo_c* %foo, i32 0, i32 0 %18 = getelementptr %main.foo_b, %main.foo_b* %17, i32 0, i32 0 %19 = getelementptr %main.foo_a, %main.foo_a* %18, i32 0, i32 0 %20 = getelementptr %main.bar_a, %main.bar_a* %19, i32 0, i32 0 store i32 -20, i32* %20, align 4 %21 = getelementptr %main.foo_c, %main.foo_c* %foo, i32 0, i32 0 %22 = getelementptr %main.foo_b, %main.foo_b* %21, i32 0, i32 1 %23 = getelementptr %main.bar_b, %main.bar_b* %22, i32 0, i32 1 store i32 9, i32* %23, align 4 %24 = getelementptr %main.foo_c, %main.foo_c* %foo, i32 0, i32 1 %25 = getelementptr %main.bar_c, %main.bar_c* %24, i32 0, i32 1 store i32 11, i32* %25, align 4 %26 = alloca i64, align 8 %27 = getelementptr %main.foo_c, %main.foo_c* %foo, i32 0, i32 0 %28 = getelementptr %main.foo_b, %main.foo_b* %27, i32 0, i32 0 %29 = getelementptr %main.foo_a, %main.foo_a* %28, i32 0, i32 0 %30 = getelementptr %main.bar_a, %main.bar_a* %29, i32 0, i32 0 %31 = load i32, i32* %30, align 4 %32 = alloca i32, align 4 store i32 %31, i32* %32, align 4 %33 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %26, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %32) %34 = load i64, i64* %26, align 8 %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %33, i8** %35, align 8 %36 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %34, i64* %36, align 8 %37 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %38 = load i8*, i8** %37, align 8 %39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %40 = load i64, i64* %39, align 8 %41 = trunc i64 %40 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %38, i32 %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %42 = icmp eq i8* %33, null br i1 %42, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %33) br label %free_done free_done: ; preds = %free_nonnull, %.entry %43 = alloca i64, align 8 %44 = getelementptr %main.foo_c, %main.foo_c* %foo, i32 0, i32 0 %45 = getelementptr %main.foo_b, %main.foo_b* %44, i32 0, i32 1 %46 = getelementptr %main.bar_b, %main.bar_b* %45, i32 0, i32 1 %47 = load i32, i32* %46, align 4 %48 = alloca i32, align 4 store i32 %47, i32* %48, align 4 %49 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %43, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %48) %50 = load i64, i64* %43, align 8 %51 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %49, i8** %51, align 8 %52 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %50, i64* %52, align 8 %53 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %54 = load i8*, i8** %53, align 8 %55 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %56 = load i64, i64* %55, align 8 %57 = trunc i64 %56 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %54, i32 %57, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %58 = icmp eq i8* %49, null br i1 %58, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %2, i8* %49) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %59 = alloca i64, align 8 %60 = getelementptr %main.foo_c, %main.foo_c* %foo, i32 0, i32 1 %61 = getelementptr %main.bar_c, %main.bar_c* %60, i32 0, i32 1 %62 = load i32, i32* %61, align 4 %63 = alloca i32, align 4 store i32 %62, i32* %63, align 4 %64 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %59, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %63) %65 = load i64, i64* %59, align 8 %66 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %64, i8** %66, align 8 %67 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %65, i64* %67, align 8 %68 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %69 = load i8*, i8** %68, align 8 %70 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %71 = load i64, i64* %70, align 8 %72 = trunc i64 %71 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %69, i32 %72, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %73 = icmp eq i8* %64, null br i1 %73, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free_alloc(i8* %2, i8* %64) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 %74 = getelementptr %main.foo_c, %main.foo_c* %foo, i32 0, i32 0 %75 = getelementptr %main.foo_b, %main.foo_b* %74, i32 0, i32 0 %76 = getelementptr %main.foo_a, %main.foo_a* %75, i32 0, i32 0 %77 = getelementptr %main.bar_a, %main.bar_a* %76, i32 0, i32 0 %78 = load i32, i32* %77, align 4 %79 = getelementptr %main.foo_c, %main.foo_c* %foo, i32 0, i32 0 %80 = getelementptr %main.foo_b, %main.foo_b* %79, i32 0, i32 1 %81 = getelementptr %main.bar_b, %main.bar_b* %80, i32 0, i32 1 %82 = load i32, i32* %81, align 4 %83 = add i32 %78, %82 %84 = getelementptr %main.foo_c, %main.foo_c* %foo, i32 0, i32 1 %85 = getelementptr %main.bar_c, %main.bar_c* %84, i32 0, i32 1 %86 = load i32, i32* %85, align 4 %87 = add i32 %83, %86 %88 = icmp ne i32 %87, 0 br i1 %88, label %then, label %else then: ; preds = %free_done6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %free_done6 br label %ifcont ifcont: ; preds = %else, %then br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) lfortran-0.63.0/tests/reference/ast-fn4-eaaa354.json0000664000175000017500000000067615174404631022221 0ustar alastairalastair{ "basename": "ast-fn4-eaaa354", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fn4.f90", "infile_hash": "35fb507c50c885547daa8eef3f01aa0be9b3eb6db98d824ad6f51bc9", "outfile": null, "outfile_hash": null, "stdout": "ast-fn4-eaaa354.stdout", "stdout_hash": "a538cf9f3d1fe83eae77e770b51b16c0ddee2104709ac16f11f4558c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/lookup_name-lookup_name1-9a3abcc.stdout0000664000175000017500000000026315174404631026271 0ustar alastairalastair[{"kind":9,"location":{"range":{"start":{"character":12,"line":3},"end":{"character":12,"line":3}},"uri":"tests/lookup_name1.f90"},"name":"x","filename":"tests/lookup_name1.f90"}]lfortran-0.63.0/tests/reference/asr-sign_from_value-b974070.stdout0000664000175000017500000011545615174404631025054 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { flip_sign: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arr: (Variable 2 arr [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) (IntegerConstant -3 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), epsidp: (Variable 2 epsidp [] Local (Cast (IntegerConstant 16 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 16 (Integer 8) Decimal) () ) (IntegerConstant 16 (Integer 8) Decimal) Save (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), epsisp: (Variable 2 epsisp [] Local (IntegerConstant 16 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), epsrdp: (Variable 2 epsrdp [] Local (Cast (RealConstant 0.000001 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000001 (Real 8) ) () ) (RealConstant 0.000001 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), epsrsp: (Variable 2 epsrsp [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ixdp: (Variable 2 ixdp [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 5 (Integer 8) Decimal) () ) (IntegerConstant 5 (Integer 8) Decimal) Save (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ixsp: (Variable 2 ixsp [] Local (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rxdp: (Variable 2 rxdp [] Local (Cast (RealConstant 5.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 5.500000 (Real 8) ) () ) (RealConstant 5.500000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rxsp: (Variable 2 rxsp [] Local (RealConstant 5.500000 (Real 4) ) (RealConstant 5.500000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local (Cast (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant -2.000000 (Real 4) ) () ) (RealConstant -2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local (Cast (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant -3.000000 (Real 4) ) () ) (RealConstant -3.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) flip_sign [] [(Assignment (Var 2 rxsp) (RealBinOp (Var 2 rxsp) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (Var 2 epsrsp)] 0 (Real 4) () ) (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 rxsp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 rxsp) Sub (RealConstant 5.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 epsrsp) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 rxsp) (RealBinOp (Var 2 rxsp) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (RealUnaryMinus (Var 2 epsrsp) (Real 4) () )] 0 (Real 4) () ) (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 rxsp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 rxsp) Add (RealConstant 5.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 epsrsp) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 rxdp) (RealBinOp (Var 2 rxdp) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 8) ) (Var 2 epsrdp)] 0 (Real 8) () ) (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 rxdp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 rxdp) Sub (Cast (RealConstant 5.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 5.500000 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) Gt (Var 2 epsrdp) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 ixsp) (IntegerBinOp (Var 2 ixsp) Mul (IntrinsicElementalFunction Sign [(IntegerConstant 1 (Integer 4) Decimal) (Var 2 epsisp)] 0 (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 ixsp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 ixsp) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 rxdp) (RealBinOp (Var 2 rxdp) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 8) ) (RealUnaryMinus (Var 2 epsrdp) (Real 8) () )] 0 (Real 8) () ) (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 rxdp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 rxdp) Add (Cast (RealConstant 5.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 5.500000 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) Gt (Var 2 epsrdp) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 ixdp) (IntegerBinOp (Var 2 ixdp) Mul (IntrinsicElementalFunction Sign [(IntegerConstant 1 (Integer 8) Decimal) (Var 2 epsidp)] 0 (Integer 8) () ) (Integer 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 ixdp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 ixdp) NotEq (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 5 (Integer 8) Decimal) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 c) (IntegerBinOp (Var 2 a) Mul (IntrinsicElementalFunction Sign [(IntegerConstant 1 (Integer 4) Decimal) (Var 2 b)] 0 (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 c)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 c) NotEq (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 arr) (ArrayConstant 20 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00, 4.00000000e+00, 5.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 2 z) (ArrayItem (Var 2 arr) [(() (IntrinsicElementalFunction Int [(RealBinOp (Var 2 x) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (Var 2 y)] 0 (Real 4) () ) (Real 4) () )] 0 (Integer 4) () ) ())] (Real 4) ColMajor () ) () .false. .false. ) (Print (StringFormat () [(Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (Var 2 z) NotEq (ArrayItem (Var 2 arr) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-do3-54790e3.json0000664000175000017500000000067615174404631022014 0ustar alastairalastair{ "basename": "ast-do3-54790e3", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do3.f90", "infile_hash": "d72fb0f1c786740923a8ad6646a4d581704710df3ddfd528b2c96564", "outfile": null, "outfile_hash": null, "stdout": "ast-do3-54790e3.stdout", "stdout_hash": "8fe38ca61c9279e373f238d0655a66f1d8cbee71be27a53d10a8cde5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-infer_mode_conflict_01-0752705.stderr0000664000175000017500000000005615174404631026067 0ustar alastairalastairCannot use --infer and --std at the same time lfortran-0.63.0/tests/reference/ast-include_01-55ce778.stdout0000664000175000017500000000203415174404631023700 0ustar alastairalastair(TranslationUnit [(Subroutine a [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "From B" ())] () ) (Print 0 () [(String "From C" ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) ) (Print 0 () [(String "From A" ())] () )] [] [] ) (Program include_01 () [] [] [] [(SubroutineCall 0 a [] [] [] [] () ) (Print 0 () [(String "From Main" ())] () )] [] )] ) lfortran-0.63.0/tests/reference/ast-integer16-eab0df9.json0000664000175000017500000000072715174404631023422 0ustar alastairalastair{ "basename": "ast-integer16-eab0df9", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/integer16.f90", "infile_hash": "baf6d6f3f106302b5334bdba9d405160f52d531ac537d6268cc984fb", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-integer16-eab0df9.stderr", "stderr_hash": "dc07b98205e0d06bb0c8691f4c1f3888b088c8c43f984be4fe7ea2f0", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-case_02-a38c2d8.json0000664000175000017500000000074215174404631023054 0ustar alastairalastair{ "basename": "llvm-case_02-a38c2d8", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/case_02.f90", "infile_hash": "76d3020fba89787d565870ed03c1b5e8914d12b062cb9ca7a8c37550", "outfile": null, "outfile_hash": null, "stdout": "llvm-case_02-a38c2d8.stdout", "stdout_hash": "aadaa25a27aa91b452cc8e12e3b5e58d09276a1b849ce815db2e16e2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-use_statement-bb26ff2.json0000664000175000017500000000073415174404631024413 0ustar alastairalastair{ "basename": "ast-use_statement-bb26ff2", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/use_statement.f90", "infile_hash": "84a9de2e41ec72897bdf0e9ab42eec3c608a26d3636a9e34c20430a1", "outfile": null, "outfile_hash": null, "stdout": "ast-use_statement-bb26ff2.stdout", "stdout_hash": "5ca4b60754373f47b413fe4ba555f64191106b6692c796a8a9f8b6f2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-array_bounds_check_04-2e3d8fb.stderr0000664000175000017500000000056015174404631026233 0ustar alastairalastairruntime error: Array shape mismatch in subroutine 'my'. Tried to match size 4 of dimension 2 of argument number 1, but expected size is 1 --> tests/errors/array_bounds_check_04.f90:5:13 | 5 | call my(x) | ^ | 10 | integer, intent(in) :: x(3, 1) | ~ Parameter is size 1, argument is size 4 lfortran-0.63.0/tests/reference/run-floatStringInput-95c963d.stderr0000664000175000017500000000004015174404631025261 0ustar alastairalastairError: Invalid input from file. lfortran-0.63.0/tests/reference/ast-program_cmake_02-d8d8f4d.json0000664000175000017500000000112115174404631024646 0ustar alastairalastair{ "basename": "ast-program_cmake_02-d8d8f4d", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/program_cmake_02.f90", "infile_hash": "c6368d319f7abf398750ad8860849dc5cb7712f0b79c55ee54604484", "outfile": null, "outfile_hash": null, "stdout": "ast-program_cmake_02-d8d8f4d.stdout", "stdout_hash": "12f0be51f073ad641e8e9ff1439a5a97b214abb1bb21188bf9647bb9", "stderr": "ast-program_cmake_02-d8d8f4d.stderr", "stderr_hash": "46bc7510f839ce095b554c75efdcb63bad2385e910d819d7305c5465", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_11-c169ea7.json0000664000175000017500000000077215174404631024630 0ustar alastairalastair{ "basename": "asr-derived_types_11-c169ea7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_11.f90", "infile_hash": "6c5517cdf157d0235d0883eb1261c38a9a4b1d783a4c550e52f6c553", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_11-c169ea7.stdout", "stdout_hash": "fc8366d11c5e3d7e9ffeef580fbc4b9ece1e54578e9eb3d1b71a887a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-string_slice2-473fb60.stderr0000664000175000017500000000023215174404631024465 0ustar alastairalastairsemantic error: Substring end index exceeds the string length --> tests/errors/string_slice2.f90:6:12 | 6 | print*, s(1: 9) | ^^^^^^^ lfortran-0.63.0/tests/reference/asr-program3-557dbe8.json0000664000175000017500000000071515174404631023214 0ustar alastairalastair{ "basename": "asr-program3-557dbe8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/program3.f90", "infile_hash": "f5e4a3f2a2a6f406171d0aa3895b5d7342c4d87b73ffede073827f34", "outfile": null, "outfile_hash": null, "stdout": "asr-program3-557dbe8.stdout", "stdout_hash": "6ca7e74d68015462a984971364bc70e695a1640927dc839dabb45605", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-exit2-f1f3b2c.json0000664000175000017500000000077015174404631022600 0ustar alastairalastair{ "basename": "run-exit2-f1f3b2c", "cmd": "lfortran --no-color {infile}", "infile": "tests/exit2.f90", "infile_hash": "c5a7d81e07c46ace9d368370add645b4ae661ce043a89520234f71ba", "outfile": null, "outfile_hash": null, "stdout": "run-exit2-f1f3b2c.stdout", "stdout_hash": "61f0d87e355fe9206f69359bd0d77b9ac928ec3fdf45d6c625f90bce", "stderr": "run-exit2-f1f3b2c.stderr", "stderr_hash": "d79d075de4df8ce8a4bfbf243c5b77607fb4811cdbeacd9fad5542f1", "returncode": 2 }lfortran-0.63.0/tests/reference/julia-case_01-cbdd0aa.json0000664000175000017500000000073015174404631023404 0ustar alastairalastair{ "basename": "julia-case_01-cbdd0aa", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/case_01.f90", "infile_hash": "003a23367180e7f228e7e4ef5a6dfdb6749801b29ccf2002e2559e41", "outfile": null, "outfile_hash": null, "stdout": "julia-case_01-cbdd0aa.stdout", "stdout_hash": "bceaf3bd0933e0a0cdc1c4e6075d0cef2a1ee608767d1fa2766106ca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-allocate_01-d7a2337.json0000664000175000017500000000070515174404631023473 0ustar alastairalastair{ "basename": "run-allocate_01-d7a2337", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/allocate_01.f90", "infile_hash": "140c96f4a8e85df7ace3fb207f9e2f00cf47f9b6798cb542f0784e07", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-allocate_01-d7a2337.stderr", "stderr_hash": "e7bb699ebf0e25f8c33f63bca4ca8c65e4f9113facef87a89e51c952", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-incorrect_array_type_where_02-b821d8c.stderr0000664000175000017500000000026115174404631027722 0ustar alastairalastairsemantic error: the first array argument to `where` must be of type logical --> tests/errors/incorrect_array_type_where_02.f90:8:10 | 8 | where(i1) b = 1 | ^^ lfortran-0.63.0/tests/reference/asr-matrix_matmul_01-6b086c6.json0000664000175000017500000000075415174404631024563 0ustar alastairalastair{ "basename": "asr-matrix_matmul_01-6b086c6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/matrix_matmul_01.f90", "infile_hash": "38df7f8926269bd945a6ff81bfa92300eb2d9fab68d567e96304260a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-matrix_matmul_01-6b086c6.stderr", "stderr_hash": "500c0bf01ba18c5f424435852718361858f3948e5e187c1ac18556da", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-derived_types_02-f576514.stdout0000664000175000017500000001531315174404631025042 0ustar alastairalastair(TranslationUnit [(Module derived_types_02_m (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(r8 [] [] () (FuncCallOrArray kind [] [(() (Real "0.d0") () 0)] [] [] [] ) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DerivedType B [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] ) (DerivedType C [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] ) (DerivedType X [] (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) [(AttrExtends B ) (SimpleAttribute AttrPublic )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration (AttrType TypeReal [(() r8 Value)] () () None ) [] [(r1 [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Declaration (AttrType TypeType [] () C None ) [(SimpleAttribute AttrPointer )] [(cc [] [] () (FuncCallOrArray null [] [] [] [] [] ) Arrow ())] () ) (Declaration (AttrType TypeReal [(() r8 Value)] () () None ) [(SimpleAttribute AttrPointer )] [(r2 [(() () DimensionExpr)] [] () (FuncCallOrArray null [] [] [] [] [] ) Arrow ()) (r3 [(() () DimensionExpr)] [] () (FuncCallOrArray null [] [] [] [] [] ) Arrow ())] () )] [(DerivedTypeProc () [(SimpleAttribute AttrPrivate )] [(UseSymbol p1 () )] () ) (DerivedTypeProc () [] [(UseSymbol p2 () )] () )] )] [] [(Subroutine p1 [(this)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeClass [] () X None ) [(AttrIntent Out )] [(this [] [] () () None ())] () )] [] [] [] ) (Subroutine p2 [(this)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeClass [] () X None ) [(AttrIntent InOut )] [(this [] [] () () None ())] () )] [] [] [] )] ) (Program derived_types_02 () [(Use [] derived_types_02_m [(UseSymbol X () )] .true. () )] [(ImplicitNone [] () )] [(Declaration (AttrType TypeType [] () X None ) [] [(b [] [] () () None ())] () )] [] [] )] ) lfortran-0.63.0/tests/reference/ast-types_08-c70036f.stdout0000664000175000017500000000710115174404631023411 0ustar alastairalastair(TranslationUnit [(Program types_08 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [(Subroutine f [(i) (j)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrOptional ) (AttrIntent In )] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(j [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrOptional )] [(j [] [] () () None ())] () )] [] [] [] ) (Subroutine g [(i) (j)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrOptional ) (AttrIntent In )] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(j [] [] () () None ())] () ) (Declaration () [(AttrIntent In )] [(j [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrOptional )] [(j [] [] () () None ())] () )] [] [] [] )] )] ) lfortran-0.63.0/tests/reference/ast-derived_types_02-35d66e0.stdout0000664000175000017500000002410215174404631025111 0ustar alastairalastair(TranslationUnit [(Module a () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(r8 [] [] () (FuncCallOrArray kind [] [(() (Real "0.d0") () 0)] [] [] [] ) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DerivedType B [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] ) (DerivedType C [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] ) (DerivedType X [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(AttrExtends B ) (SimpleAttribute AttrPublic )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration (AttrType TypeReal [(() r8 Value)] () () None ) [] [(r1 [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Declaration (AttrType TypeType [] () C None ) [(SimpleAttribute AttrPointer )] [(cc [] [] () (FuncCallOrArray null [] [] [] [] [] ) Arrow ())] () ) (Declaration (AttrType TypeReal [(() r8 Value)] () () None ) [(SimpleAttribute AttrPointer )] [(r2 [(() () DimensionExpr)] [] () (FuncCallOrArray null [] [] [] [] [] ) Arrow ()) (r3 [(() () DimensionExpr)] [] () (FuncCallOrArray null [] [] [] [] [] ) Arrow ())] () )] [(Private () ) (DerivedTypeProc () [(SimpleAttribute AttrPrivate )] [(UseSymbol p1 () )] () ) (DerivedTypeProc something [(SimpleAttribute AttrPrivate )] [(UseSymbol p1b () )] () ) (DerivedTypeProc () [(AttrPass self )] [(UseSymbol p2 () )] () ) (DerivedTypeProc () [] [(UseSymbol proc_1 () ) (UseSymbol proc_2 () )] () ) (GenericOperator [] NOTEQ [p5 p6] () ) (GenericOperator [] PLUS [p8] () ) (GenericDefinedOperator [] "in" [p7] () ) (GenericDefinedOperator [] "dot" [p10] () ) (GenericOperator [] DIV [p11] () ) (GenericAssignment [] [p9] () ) (GenericName [(SimpleAttribute AttrPublic )] calcCoeffs [calcCoeffsReal calcCoeffsKPoint] () ) (GenericName [(SimpleAttribute AttrPrivate )] name [sample] () ) (GenericName [] p1 [p2] (TriviaNode [] [(Semicolon) (EndOfLine)] ) ) (GenericWrite [(SimpleAttribute AttrPublic )] formatted [t_write] () ) (GenericRead [] unformatted [t_read] () ) (FinalName y () )] ) (DerivedType matrix [k b] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrKind )] [(k [] [] () 4 Equal ())] () ) (Declaration (AttrType TypeInteger [(() 8 Value)] () () None ) [(SimpleAttribute AttrLen )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() k Value)] () () None ) [] [(element [(1 b DimensionExpr) (1 b DimensionExpr)] [] () () None ())] () )] [] )] [] [(Subroutine p1 [(this)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeClass [] () X None ) [(AttrIntent Out )] [(this [] [] () () None ())] () )] [] [] [] ) (Subroutine p2 [(this)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeClass [] () X None ) [(AttrIntent InOut )] [(this [] [] () () None ())] () )] [] [] [] )] )] ) lfortran-0.63.0/tests/reference/asr-sizeof_01-9e0775c.stderr0000664000175000017500000000026715174404631023535 0ustar alastairalastairwarning: `sizeof` is an LFortran extension --> tests/warnings/sizeof_01.f90:6:9 | 6 | s = sizeof(x) | ^^^^^^^^^ use `c_sizeof` from `iso_c_binding` for portable code lfortran-0.63.0/tests/reference/julia-block_02-1362742.json0000664000175000017500000000105415174404631023136 0ustar alastairalastair{ "basename": "julia-block_02-1362742", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/block_02.f90", "infile_hash": "454b633240fa00d44de1b5374429d3d7edc1c37ccd92b8b93394d639", "outfile": null, "outfile_hash": null, "stdout": "julia-block_02-1362742.stdout", "stdout_hash": "59fcc1dd21572c0fc98eda4d9cded92ecfe679bd97aee86ad591cb61", "stderr": "julia-block_02-1362742.stderr", "stderr_hash": "60488b7fcd202fd28a9fb7045091257667eed65fe1dec8040b9c2871", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-specific_type_intrinsic-60c666c.json0000664000175000017500000000100115174404631026271 0ustar alastairalastair{ "basename": "asr-specific_type_intrinsic-60c666c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/specific_type_intrinsic.f90", "infile_hash": "442e8580aa683980ba51d19893cf7a3c1add2254bf3099797f242fe8", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-specific_type_intrinsic-60c666c.stderr", "stderr_hash": "19c488d38fbb043d34d051f0af173af9108e439e5af9da09ded06a59", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-crlf1-374a66c.stdout0000664000175000017500000000036415174404631022756 0ustar alastairalastair(TranslationUnit [(Program p () [] [] [] [(SubroutineCall 0 f [] [] [] [] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-fixed_form_call1-ad7fd7d.stdout0000664000175000017500000003430515174404631025370 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { idd_frm: (Function (SymbolTable 2 { lw: (Variable 2 lw [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 2 m [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), prinf: (Function (SymbolTable 3 { prinf_arg_0: (Variable 3 prinf_arg_0 [] Unspecified () () Default (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), prinf_arg_1: (Variable 3 prinf_arg_1 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), prinf_arg_2: (Variable 3 prinf_arg_2 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) prinf (FunctionType [(String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) (Integer 4) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 prinf_arg_0) (Var 3 prinf_arg_1) (Var 3 prinf_arg_2)] [] () Public .false. .false. () ), w: (Variable 2 w [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) idd_frm (FunctionType [(Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 m) (Var 2 n) (Var 2 w) (Var 2 x) (Var 2 y)] [(SubroutineCall 2 prinf () [((StringConstant "lw = *" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((Var 2 lw)) ((IntegerConstant 1 (Integer 4) Decimal))] () .false. ) (SubroutineCall 2 prinf () [((StringConstant "16m+70 = *" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((IntegerBinOp (IntegerBinOp (IntegerConstant 16 (Integer 4) Decimal) Mul (Var 2 m) (Integer 4) () ) Add (IntegerConstant 70 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal))] () .false. ) (Return)] () Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/julia-block_03-cf8537e.json0000664000175000017500000000073315174404631023376 0ustar alastairalastair{ "basename": "julia-block_03-cf8537e", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/block_03.f90", "infile_hash": "3271e019be3575ad1c8280a5b50d7fccb0534f39241680ad66e6bc50", "outfile": null, "outfile_hash": null, "stdout": "julia-block_03-cf8537e.stdout", "stdout_hash": "dc1a8b68264dd9da21563f4ce401332633d1142fec545c6381da785c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-goto_02-fc47ad0.stderr0000664000175000017500000000103115174404631023324 0ustar alastairalastairstyle suggestion: Use '>' instead of '.gt.' --> tests/../integration_tests/goto_02.f90:10:12 | 10 | if (A.GT.2) go to 95 | ^^^^ help: write this as '>' style suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/goto_02.f90:13:12 | 13 | if (A.EQ.1) go to 10 | ^^^^ help: write this as '==' style suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/goto_02.f90:25:12 | 25 | if (A.EQ.2) go to 99 | ^^^^ help: write this as '==' lfortran-0.63.0/tests/reference/run-scalar_allocation_check_01-a82b6b0.json0000664000175000017500000000076215174404631026573 0ustar alastairalastair{ "basename": "run-scalar_allocation_check_01-a82b6b0", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/scalar_allocation_check_01.f90", "infile_hash": "6fbed4236f624f5378290445365914265a7e928f30530ce1fc09c955", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-scalar_allocation_check_01-a82b6b0.stderr", "stderr_hash": "0f0daac2592abeb1d221a248f68e97b899399ba17a23332688bd1c6c", "returncode": 1 }lfortran-0.63.0/tests/reference/llvm-arrays_101-8ed52ae.json0000664000175000017500000000075315174404631023605 0ustar alastairalastair{ "basename": "llvm-arrays_101-8ed52ae", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_101.f90", "infile_hash": "2836e67268706a938da0f88016329436a3641b137b7f506855b0a304", "outfile": null, "outfile_hash": null, "stdout": "llvm-arrays_101-8ed52ae.stdout", "stdout_hash": "3d53bfb5fed0d2173e9785f585739f0dfa7fe8386a1dbfb4a227178f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-arrays_05-e6d3b50.stdout0000664000175000017500000001363415174404631023631 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_05: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), numbers: (Variable 2 numbers [] Local (ArrayConstant 20 [1.50000000e+00, 3.20000005e+00, 4.50000000e+00, 8.99999976e-01, 7.19999981e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayConstant 20 [1.50000000e+00, 3.20000005e+00, 4.50000000e+00, 8.99999976e-01, 7.19999981e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) arrays_05 [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 numbers) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (RealBinOp (Cast (Var 2 i) IntegerToReal (Real 4) () () ) Mul (RealConstant 2.000000 (Real 4) ) (Real 4) () ) () .false. .false. )] [] ) (Assignment (Var 2 numbers) (ArrayConstant 20 [1.50000000e+00, 3.20000005e+00, 4.50000000e+00, 8.99999976e-01, 7.19999981e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-flush_invalid_kwarg1-9fc0c7b.stderr0000664000175000017500000000025215174404631026165 0ustar alastairalastairsemantic error: Invalid argument `start` supplied --> tests/errors/flush_invalid_kwarg1.f90:3:5 | 3 | FLUSH(unit=10, start=100) | ^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor2-1db2235.stdout0000664000175000017500000000700515174404631027006 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor2: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) preprocessor2 [] [(Assignment (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) Mul (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 25 (Integer 4) Decimal) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x) (IntegerConstant 12345678 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/run-format8-4e5a9c0.stdout0000664000175000017500000000020215174404631023410 0ustar alastairalastair 0.10000000000000000E-09 0.10000000000000000E-99 0.10000000000000000E+01 0.10000000000000000E+11 0.10000000000000000+101 lfortran-0.63.0/tests/reference/pass_do_loops-loop_var_use_after_loop-e26183c.stdout0000664000175000017500000006647015174404631030743 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main [] [(Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "In loop 1 i =" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) Lt (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Exit () )] [] )] [] ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "After loop 1 i = " (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "In loop 2 i = " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) Lt (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Print (StringConstant "if (i < 2) then" (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Exit () )] )] [] ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "After loop 2 i = " (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 6 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "In loop 3 i = " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) LtE (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(If () (IntegerCompare (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Eq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(If () (IntegerCompare (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Exit () )] [] ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Exit () )] [] )] [] )] [] ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "After loop 3 i = " (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 6 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "In loop 4 i = " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) LtE (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(If () (IntegerCompare (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Eq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(If () (IntegerCompare (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Exit () )] [] ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Exit () )] [(Print (StringConstant "i - 1 /= 3" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [] )] [] ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "After loop 4 i = " (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-intrinsics_07-240b0d5.json0000664000175000017500000000076115174404631024053 0ustar alastairalastair{ "basename": "asr-intrinsics_07-240b0d5", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_07.f90", "infile_hash": "fb38a4369a15cd151941ce57b634ac91745bd83541722d9fbb171a18", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_07-240b0d5.stdout", "stdout_hash": "ceb889abb91ea9637780023fb52c43573c3db54b1b22fd41facfc9b3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_global_stmts-global_scope9-4cbbc3e.stdout0000664000175000017500000000615515174404631027636 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] ReturnVar () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] (Integer 8) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 1 x) (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 6 (Integer 8) Decimal) () ) () .false. .false. ) (Assignment (Var 2 f1) (Var 1 x) () .false. .false. )] (Var 2 f1) Public .false. .false. () ), x: (Variable 1 x [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) [] ) lfortran-0.63.0/tests/reference/asr-polymorphic_arguments_02-bb6f3e2.json0000664000175000017500000000102215174404631026453 0ustar alastairalastair{ "basename": "asr-polymorphic_arguments_02-bb6f3e2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/polymorphic_arguments_02.f90", "infile_hash": "56e8d7a53ae767686c5bb655fe9c19c37e8cf8112500fed026cd8dc1", "outfile": null, "outfile_hash": null, "stdout": "asr-polymorphic_arguments_02-bb6f3e2.stdout", "stdout_hash": "90d5880cf6b85ee74319f432384ad8b6ef0d05dcffd2210663d62de3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-open1-9127585.stdout0000664000175000017500000000065015174404631023314 0ustar alastairalastairprogram open1 ! Tests for syntax (AST) only: open(file="p_cc", newunit=u) open(task_lun, file=taskfile) open(unit=gmv_lun, FILE=fname, IOSTAT=ier, POSITION="rewind") open(newunit=this%lun, file=outfile, status="replace", iostat=ios) open(unit=10, file="test1.inp", position="rewind", action="read", status="old") open(UNIT=funit, FILE=tname, STATUS=fstat, ACCESS="SEQUENTIAL", ACTION=faction, IOSTAT=ierr) end program open1 lfortran-0.63.0/tests/reference/asr-arrays_107-d961168.json0000664000175000017500000000075015174404631023210 0ustar alastairalastair{ "basename": "asr-arrays_107-d961168", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_107.f90", "infile_hash": "6fe4735c981484adb5f98c1ede5b1b92c06ab299628061265adefc9d", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_107-d961168.stderr", "stderr_hash": "12c9d3bf8025057006e350a4763c076da6cdaf25c1a98f6005a58ad1", "returncode": 2 }lfortran-0.63.0/tests/reference/run-format_34-81f4937.json0000664000175000017500000000071515174404631023141 0ustar alastairalastair{ "basename": "run-format_34-81f4937", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_34.f90", "infile_hash": "f71b29e58cc9d9abb8bf7d458a509b83d1457839bb7b6d8ec3a51859", "outfile": null, "outfile_hash": null, "stdout": "run-format_34-81f4937.stdout", "stdout_hash": "aec31744f20adfa39680fe35eeb9097c6e60812f9bb44a0bf188bf7d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-specific_type_intrinsic-60c666c.stderr0000664000175000017500000000026115174404631026632 0ustar alastairalastairsemantic error: Argument 1 of dabs must be of double precision real type --> tests/errors/specific_type_intrinsic.f90:2:13 | 2 | print*, dabs(1) | ^^^^^^^ lfortran-0.63.0/tests/reference/llvm-global_scope9-bdf4288.json0000664000175000017500000000073715174404631024373 0ustar alastairalastair{ "basename": "llvm-global_scope9-bdf4288", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/global_scope9.f90", "infile_hash": "29e87c62bbe7f9efedd2e3cf348e80153367ecc0369b16de6f4db296", "outfile": null, "outfile_hash": null, "stdout": "llvm-global_scope9-bdf4288.stdout", "stdout_hash": "8e19a49eebedb89e1d18b5c154c1e7f5c353709f04de833b058b6d9b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-expr8-cb13ef4.stdout0000664000175000017500000000112015174404631023136 0ustar alastairalastair(TranslationUnit [(Assignment 0 i 123 () ) (Assignment 0 j 123456789824390874092509458720948720947502984752098457242092870987 () ) (Assignment 0 k (* 2 18446744073709551616) () ) (Assignment 0 i 123_i8 () ) (Assignment 0 j 123456789824390874092509458720948720947502984752098457242092870987_i8 () ) (Assignment 0 k (* 2 18446744073709551616_i8) () )] ) lfortran-0.63.0/tests/reference/asr-int_01-72c2ff1.stdout0000664000175000017500000000707315174404631023120 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { int_01: (Program (SymbolTable 2 { x: (Variable 2 x [] Local (RealConstant 3.300000 (Real 4) ) (RealConstant 3.300000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local (IntegerConstant 7 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) int_01 [] [(Print (StringFormat () [(IntrinsicElementalFunction Int [(Var 2 x)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (IntrinsicElementalFunction Int [(Var 2 y)] 0 (Integer 4) (IntegerConstant 7 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-bindc3-91bce68.json0000664000175000017500000000073415174404631022623 0ustar alastairalastair{ "basename": "asr-bindc3-91bce68", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bindc3.f90", "infile_hash": "5641a25203f2b4025ab042a931b5f7f5978dd812c10833abf34bfd73", "outfile": null, "outfile_hash": null, "stdout": "asr-bindc3-91bce68.stdout", "stdout_hash": "4acdcdbb123c1a515184e2eca81003edfc388d4c7a9bd65317b42680", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-kind_star_of_int-3ed778d.json0000664000175000017500000000075415174404631025003 0ustar alastairalastair{ "basename": "asr-kind_star_of_int-3ed778d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_star_of_int.f90", "infile_hash": "3abc16b6b262878a30ddb8a43eba007396a3a42b61d3c01340922b6b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_star_of_int-3ed778d.stderr", "stderr_hash": "4b09ff95a79239ed54dc548fef6cdabe3d5d6ccd9a88854b2fd3218b", "returncode": 2 }lfortran-0.63.0/tests/reference/cpp-arrays_04_func-68b1437.json0000664000175000017500000000074715174404631024136 0ustar alastairalastair{ "basename": "cpp-arrays_04_func-68b1437", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/arrays_04_func.f90", "infile_hash": "50eb699e803e7dace8da286ee49cdb7381ebe3141bff17ca374f1f02", "outfile": null, "outfile_hash": null, "stdout": "cpp-arrays_04_func-68b1437.stdout", "stdout_hash": "ddd04aef52e2c4430edf290f5f858a0e2eb8b3739714f9bd7aeaa55a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_17-17c3d46.stdout0000664000175000017500000004600715174404631025124 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_17: (Program (SymbolTable 8 { sub_2: (ExternalSymbol 8 sub_2 6 sub_2 derived_types_17_module_2 [] sub_2 Public ) }) derived_types_17 [derived_types_17_module_2] [(SubroutineCall 8 sub_2 () [] () .false. )] ), derived_types_17_module_1: (Module (SymbolTable 2 { add: (Function (SymbolTable 4 { 1_t_1_num: (ExternalSymbol 4 1_t_1_num 3 num t_1 [] num Public ), self: (Variable 4 self [] ReturnVar () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 t_1 Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add (FunctionType [] (StructType [(Integer 4)] [] .true. .false. ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (StructInstanceMember (Var 4 self) 4 1_t_1_num (Integer 4) () ) (IntegerBinOp (StructInstanceMember (Var 4 self) 4 1_t_1_num (Integer 4) () ) Add (StructInstanceMember (Var 4 self) 4 1_t_1_num (Integer 4) () ) (Integer 4) () ) () .false. .false. )] (Var 4 self) Public .true. .true. () ), subtract: (Function (SymbolTable 5 { 1_t_1_num: (ExternalSymbol 5 1_t_1_num 3 num t_1 [] num Public ), self: (Variable 5 self [] ReturnVar () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 t_1 Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) subtract (FunctionType [] (StructType [(Integer 4)] [] .true. .false. ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (StructInstanceMember (Var 5 self) 5 1_t_1_num (Integer 4) () ) (IntegerBinOp (StructInstanceMember (Var 5 self) 5 1_t_1_num (Integer 4) () ) Mul (StructInstanceMember (Var 5 self) 5 1_t_1_num (Integer 4) () ) (Integer 4) () ) () .false. .false. )] (Var 5 self) Public .true. .true. () ), t_1: (Struct (SymbolTable 3 { num: (Variable 3 num [] Local (IntegerConstant 100 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) t_1 (StructType [(Integer 4)] [] .true. .false. ) [] [num] [] Source Private .false. .false. [] () () [] ) }) derived_types_17_module_1 () [] .false. .false. .false. ), derived_types_17_module_2: (Module (SymbolTable 6 { add: (ExternalSymbol 6 add 2 add derived_types_17_module_1 [] add Public ), sub_2: (Function (SymbolTable 7 { }) sub_2 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(FunctionCall 6 subtract () [] (StructType [(Integer 4)] [] .true. .false. ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 6 add () [] (StructType [(Integer 4)] [] .true. .false. ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), subtract: (ExternalSymbol 6 subtract 2 subtract derived_types_17_module_1 [] subtract Public ) }) derived_types_17_module_2 () [derived_types_17_module_1] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-float1-817e0db.stderr0000664000175000017500000000021415174404631023163 0ustar alastairalastairsemantic error: Argument of intrinsic must be an integer --> tests/errors/float1.f90:3:10 | 3 | print *, float(y) | ^^^^^^^^ lfortran-0.63.0/tests/reference/asr-intrinsics9-4da86d0.stderr0000664000175000017500000000024715174404631024261 0ustar alastairalastairsemantic error: Kind of all the arguments of Iand must be the same --> tests/errors/intrinsics9.f90:4:14 | 4 | print *, iand(x, y) | ^^^^^^^^^^ lfortran-0.63.0/tests/reference/llvm-nested_06-fa1a99f.json0000664000175000017500000000075015174404631023512 0ustar alastairalastair{ "basename": "llvm-nested_06-fa1a99f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_06.f90", "infile_hash": "b94500b7f8becc154e61ec7d99e50e8c4cbbd4c0ca20bb262a670562", "outfile": null, "outfile_hash": null, "stdout": "llvm-nested_06-fa1a99f.stdout", "stdout_hash": "c4afe3527c18e0af0c9f276cc0fe8a9d477864773ec222c8217fd6f6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-optional_01-56b1b65.stdout0000664000175000017500000001161615174404631024071 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { optmod: (Module (SymbolTable 2 { optional_argument: (Function (SymbolTable 3 { name: (Variable 3 name [] In () () Default (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) optional_argument (FunctionType [(String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 name)] [(If () (IntrinsicElementalFunction Present [(Var 3 name)] 0 (Logical 4) () ) [(Print (IntrinsicElementalFunction StringConcat [(StringConstant "Hello " (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 3 name)] 0 (String 1 (IntegerConstant 16 (Integer 8) Decimal) ExpressionLength DescriptorString) () ) )] [(Print (StringConstant "Hello world!" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] () Public .false. .false. () ) }) optmod () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-fixed_form_without_newline-d50219b.json0000664000175000017500000000101615174404631027010 0ustar alastairalastair{ "basename": "ast-fixed_form_without_newline-d50219b", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_without_newline.f", "infile_hash": "55ed393261e352904304d4b561daa9acd2e4e713f6ea4ebcc20d39cd", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_without_newline-d50219b.stdout", "stdout_hash": "78334f346126e16891ab514171e49249fd443692e7cdf5ad4431e6fc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-block1-ff0f95d.stdout0000664000175000017500000000464715174404631023300 0ustar alastairalastair(TranslationUnit [(Program block1 (TriviaNode [] [(EndOfLine) (Comment "! The variable B is implicitly declared in the scoping unit of the main program." ) (Comment "! The statement IMPORT, NONE makes B inaccessible in the BLOCK construct." ) (Comment "! If the IMPORT, NONE statement is replaced with the IMPORT statement in the" ) (Comment "! comment, the program is conformant." )] ) [] [(Implicit [(ImplicitSpec (AttrType TypeInteger [] () () None ) [(LetterSpec a z )] )] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(B [] [] () () None ())] (TriviaNode [] [(EndOfLine) (Comment "! TODO: Fix this test case" )] ) )] [(Block 0 () [] [] [] [(Assignment 0 B 10 () ) (Print 0 () [B] () ) (If 0 () (== B 10) [(Print 0 () [(String "pass" ())] () )] [] () () () )] (TriviaNode [] [(EndOfLine) (Comment "! use mod, only: example" ) (Comment "! import, none" ) (Comment "! !import, only: B" )] ) () )] [] )] ) lfortran-0.63.0/tests/reference/asr-functions_04-ea50b75.stdout0000664000175000017500000002634415174404631024341 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_04: (Program (SymbolTable 4 { int: (Variable 4 int [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), to_negative: (ExternalSymbol 4 to_negative 2 to_negative stdlib_int [] to_negative Public ), to_negative@to_negative~genericprocedure: (ExternalSymbol 4 to_negative@to_negative~genericprocedure 2 to_negative~genericprocedure stdlib_int [] to_negative~genericprocedure Private ), to_negative~genericprocedure: (ExternalSymbol 4 to_negative~genericprocedure 2 to_negative~genericprocedure stdlib_int [] to_negative~genericprocedure Public ) }) functions_04 [stdlib_int] [(If () (IntegerCompare (FunctionCall 4 to_negative@to_negative~genericprocedure 4 to_negative [((Var 4 int))] (Integer 4) () () ) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 4 int) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) () .false. .false. ) (If () (IntegerCompare (FunctionCall 4 to_negative@to_negative~genericprocedure 4 to_negative [((Var 4 int))] (Integer 4) () () ) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] )] ), stdlib_int: (Module (SymbolTable 2 { to_negative: (GenericProcedure 2 to_negative [2 to_negative~genericprocedure] Public ), to_negative~genericprocedure: (Function (SymbolTable 3 { int: (Variable 3 int [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), neg_int: (Variable 3 neg_int [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) to_negative~genericprocedure (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 3 int)] [(If () (IntegerCompare (Var 3 int) GtE (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 3 neg_int) (IntegerUnaryMinus (Var 3 int) (Integer 4) () ) () .false. .false. )] [(Assignment (Var 3 neg_int) (Var 3 int) () .false. .false. )] )] (Var 3 neg_int) Public .true. .true. () ) }) stdlib_int () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-array_01-6a86c32.stderr0000664000175000017500000000016515174404631023342 0ustar alastairalastairsemantic error: Empty array constructor is not allowed --> tests/errors/array_01.f90:5:5 | 5 | a = [] | ^^ lfortran-0.63.0/tests/reference/asr-intent_01-c1f267a.stdout0000664000175000017500000004154015174404631023623 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { dflt_intent: (Module (SymbolTable 2 { foo: (Function (SymbolTable 3 { c: (Variable 3 c [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 3 d [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), e: (Variable 3 e [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Function (SymbolTable 4 { f: (Variable 4 f [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 x)] [(Assignment (Var 4 f) (RealBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) Mul (Var 4 x) (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 4 f)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] (Var 4 f) Public .false. .false. () ), g: (Variable 3 g [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) foo (FunctionType [(Real 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 c) (Var 3 d)] [(Assignment (Var 3 e) (FunctionCall 3 f () [((Var 3 c))] (Real 4) () () ) () .false. .false. ) (Assignment (Var 3 g) (FunctionCall 3 f () [((Var 3 d))] (Real 4) () () ) () .false. .false. )] () Public .true. .true. () ) }) dflt_intent () [dflt_intent] .false. .false. .false. ), main: (Program (SymbolTable 5 { foo: (ExternalSymbol 5 foo 2 foo dflt_intent [] foo Public ) }) main [dflt_intent] [(SubroutineCall 5 foo () [((RealConstant 0.000000 (Real 4) )) ((RealConstant 2.000000 (Real 4) ))] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-expr6-914a051.stdout0000664000175000017500000000117615174404631023107 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define float @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i32, align 4 %__lfortran_evaluate_12 = alloca float, align 4 store i32 8, i32* %__lfortran_evaluate_11, align 4 store float 0x4015333340000000, float* %__lfortran_evaluate_12, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return %0 = load float, float* %__lfortran_evaluate_12, align 4 ret float %0 } lfortran-0.63.0/tests/reference/asr-functions_07-2d29eab.stdout0000664000175000017500000005410115174404631024414 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_07: (Program (SymbolTable 8 { f_a: (ExternalSymbol 8 f_a 2 f_a functions_07_a [] f_a Public ), f_b: (ExternalSymbol 8 f_b 4 f_b functions_07_b [] f_b Public ), f_c: (ExternalSymbol 8 f_c 6 f_c functions_07_c [] f_c Public ), p: (Variable 8 p [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), q: (Variable 8 q [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) functions_07 [functions_07_c functions_07_a functions_07_b] [(Assignment (Var 8 q) (FunctionCall 8 f_c () [((Var 8 p))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 8 q)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), functions_07_a: (Module (SymbolTable 2 { f_a: (Function (SymbolTable 3 { u: (Variable 3 u [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 3 v [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_a (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 u)] [(Assignment (Var 3 v) (RealBinOp (Var 3 u) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. )] (Var 3 v) Public .true. .true. () ) }) functions_07_a () [] .false. .false. .false. ), functions_07_b: (Module (SymbolTable 4 { f_a: (ExternalSymbol 4 f_a 2 f_a functions_07_a [] f_a Public ), f_b: (Function (SymbolTable 5 { x: (Variable 5 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 5 y [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_b (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x)] [(Assignment (Var 5 y) (RealBinOp (FunctionCall 4 f_a () [((Var 5 x))] (Real 4) () () ) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. )] (Var 5 y) Public .true. .true. () ) }) functions_07_b () [functions_07_a] .false. .false. .false. ), functions_07_c: (Module (SymbolTable 6 { f_a: (ExternalSymbol 6 f_a 2 f_a functions_07_a [] f_a Public ), f_b: (ExternalSymbol 6 f_b 4 f_b functions_07_b [] f_b Public ), f_c: (Function (SymbolTable 7 { w: (Variable 7 w [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 7 z [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_c (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 w)] [(Assignment (Var 7 z) (RealBinOp (FunctionCall 6 f_b () [((Var 7 w))] (Real 4) () () ) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. )] (Var 7 z) Public .true. .true. () ) }) functions_07_c () [functions_07_b functions_07_a] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_add_03-43a00f9.json0000664000175000017500000000076715174404631024321 0ustar alastairalastair{ "basename": "asr-template_add_03-43a00f9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_add_03.f90", "infile_hash": "ea28185a5bc40e72bf2bb2f76bb2de4072cd321390f02993ae27aafe", "outfile": null, "outfile_hash": null, "stdout": "asr-template_add_03-43a00f9.stdout", "stdout_hash": "b4872158be3e8a0464660b5a04eb93a8b2e1a65eb738301d927699bc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-types_03-ce710b0.stdout0000664000175000017500000001047515174404631023650 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %r = alloca float, align 4 store float 1.500000e+00, float* %r, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, float* %r) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry %14 = load float, float* %r, align 4 %15 = fptosi float %14 to i32 store i32 %15, i32* %i, align 4 %16 = alloca i64, align 8 %17 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %16, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %i) %18 = load i64, i64* %16, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %17, i8** %19, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %18, i64* %20, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %22 = load i8*, i8** %21, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %24 = load i64, i64* %23, align 8 %25 = trunc i64 %24 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %22, i32 %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %26 = icmp eq i8* %17, null br i1 %26, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %2, i8* %17) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done br label %return return: ; preds = %free_done3 br label %FINALIZE_SYMTABLE_types_03 FINALIZE_SYMTABLE_types_03: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-block2-b06d9e1.json0000664000175000017500000000070715174404631022626 0ustar alastairalastair{ "basename": "asr-block2-b06d9e1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/block2.f90", "infile_hash": "f226e55b99771ba4b72596b4730aff7cc4a90424918f2b71111d33f1", "outfile": null, "outfile_hash": null, "stdout": "asr-block2-b06d9e1.stdout", "stdout_hash": "fdee4a870804f565d997cb925b76d9a814ac729a59a32ced8476ae45", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-stop1-c0d0295.json0000664000175000017500000000071715174404631023115 0ustar alastairalastair{ "basename": "ast_f90-stop1-c0d0295", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/stop1.f90", "infile_hash": "356601f3f1d56abfa1b7d00130c2067cbf3d450b3c563a900ff9ccd5", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-stop1-c0d0295.stdout", "stdout_hash": "f568222ca169cc7ad40eb4b3564c08a3d4ba845e0a5a141d4f0dcd3d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-bits_03-c7d2024.json0000664000175000017500000000073715174404631022633 0ustar alastairalastair{ "basename": "asr-bits_03-c7d2024", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bits_03.f90", "infile_hash": "cc34aad3be3fdea9a5462e9abfa5bdcfb6450d87092552dd633e7d63", "outfile": null, "outfile_hash": null, "stdout": "asr-bits_03-c7d2024.stdout", "stdout_hash": "87ae40b17effe40e0e463d028e690e6d1d7171ed14d19d9ae488480b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-cpp8-edc2b52.json0000664000175000017500000000074415174404631024646 0ustar alastairalastair{ "basename": "asr_preprocess-cpp8-edc2b52", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp8.f90", "infile_hash": "32cafa9cd5fee5b62915c116621f50932e4919a8929d18bf2d3c2913", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp8-edc2b52.stderr", "stderr_hash": "875cf3a037baf0520e8c8717c94b01e43f292a714725f9e4d09ff361", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-cmplx_03-6426707.json0000664000175000017500000000072415174404631022663 0ustar alastairalastair{ "basename": "asr-cmplx_03-6426707", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cmplx_03.f90", "infile_hash": "d3add6413f1936fbc8aed9a556247c1daceec2a468a4982648661973", "outfile": null, "outfile_hash": null, "stdout": "asr-cmplx_03-6426707.stdout", "stdout_hash": "df07bedff9fa5da2fedf067ac6c9fc6aae760e9d4947c5da87f9f891", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-modules_11-bb73359.json0000664000175000017500000000074115174404631023664 0ustar alastairalastair{ "basename": "julia-modules_11-bb73359", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/modules_11.f90", "infile_hash": "f19a5ba8d01ebaae3da78891afbae58462d711a364274aa3a5569fa1", "outfile": null, "outfile_hash": null, "stdout": "julia-modules_11-bb73359.stdout", "stdout_hash": "8f436714f9e8658e37c0d13431659a4b867a02ef2b2979d6a2aed8dc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-defop1-f87dd80.stdout0000664000175000017500000000337315174404631023217 0ustar alastairalastair(TranslationUnit [(Program defop1 (TriviaNode [(EndOfLine) (Comment "! Tests for syntax (AST) only:" )] [] ) [] [] [] [(Assignment 0 e (DefBinOp a "in" b ) () ) (Assignment 0 E (DefBinOp A "IN" B ) () ) (Assignment 0 e (DefBinOp s [(b [])] "op" (** 3 4) ) () ) (Assignment 0 E (DefBinOp S [(B [])] "OP" (** 3 4) ) () ) (Assignment 0 e (DefBinOp (+ a b) "x" (** y x) ) () ) (Assignment 0 e (DefBinOp (** x x) "x" (** x x) ) () ) (Assignment 0 E (DefBinOp (** X X) "X" (** X X) ) () ) (Assignment 0 e (** (DefBinOp (DefBinOp x "x" x ) "in" 3 ) 4) () )] [] )] ) lfortran-0.63.0/tests/reference/ast-critical1-98f603a.stdout0000664000175000017500000001241215174404631023622 0ustar alastairalastair(TranslationUnit [(Program critical1 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(joblist [] [(() () CodimensionStar)] () () None ()) (job [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(IntegerSample [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() 50 Value)] () () None ) [] [(Sample [] [] () () None ())] () )] [(If 0 () (== (FuncCallOrArray this_image [] [] [] [] [] ) 1) [(Read 0 () [(()) (())] [] [joblist] () )] [] () () () ) (SyncAll 0 [] () ) (DoLoop 0 () 0 () () () () [(Critical 0 () [] [(Assignment 0 job (CoarrayRef joblist [] [] [] [(() 1 () CodimensionExpr)] [] ) () ) (Assignment 0 (CoarrayRef joblist [] [] [] [(() 1 () CodimensionExpr)] [] ) (- job 1) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! >>>>>>>> Syntax check(AST) >>>>>>>>" )] ) ) (Critical 0 () [] [(Assignment 0 IntegerSample 0 () )] () () ) (Critical 0 () [(AttrStat IntegerSample )] [(Assignment 0 Sample (String "Error message" ()) () )] () () ) (Critical 0 () [(AttrErrmsg Sample )] [(Assignment 0 Sample (String "Error message" ()) () )] () (TriviaNode [] [(EndOfLine) (Comment "! <<<<<<<< Syntax check(AST) <<<<<<<<" ) (EndOfLine)] ) ) (If 0 () (> job 0) [(Assignment 0 b (+ (** a 2) (** b 2)) () )] [(Exit 0 () () )] () () () )] () () ) (SyncAll 0 [] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-incorrect_array_type_where_02-b821d8c.json0000664000175000017500000000102315174404631027365 0ustar alastairalastair{ "basename": "asr-incorrect_array_type_where_02-b821d8c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incorrect_array_type_where_02.f90", "infile_hash": "5668cc071e9f55f2ce6475dee614a22d075cea9d84e433197a7f0ac5", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incorrect_array_type_where_02-b821d8c.stderr", "stderr_hash": "283fe1c585d134850afe27d9f5cdaa5c07ffcfe890b4bb815dfdbf78", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-nested_06-fa1a99f.stdout0000664000175000017500000001355315174404631024070 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @__module___lcompilers_created__nested_context__b__x = global float 0.000000e+00 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [3 x i8] c"b()" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data, i32 0, i32 0), i64 3 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_nested_06_a_b(float* %x) { .entry: %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %0, i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %1 = load float, float* %x, align 4 store float %1, float* @__module___lcompilers_created__nested_context__b__x, align 4 call void @b.__module_nested_06_a_c() %2 = load float, float* @__module___lcompilers_created__nested_context__b__x, align 4 store float %2, float* %x, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return ret void } define void @b.__module_nested_06_a_c() { .entry: %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %1 = alloca i64, align 8 %2 = alloca i32, align 4 store i32 5, i32* %2, align 4 %3 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %1, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %2) %4 = load i64, i64* %1, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 8 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry %13 = alloca i64, align 8 %14 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %13, i32 0, i32 0, i32 0, i32 0, i32 0, float* @__module___lcompilers_created__nested_context__b__x) %15 = load i64, i64* %13, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %14, i8** %16, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %15, i64* %17, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %19 = load i8*, i8** %18, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %21 = load i64, i64* %20, align 8 %22 = trunc i64 %21 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %19, i32 %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %23 = icmp eq i8* %14, null br i1 %23, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %0, i8* %14) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done br label %return return: ; preds = %free_done3 br label %FINALIZE_SYMTABLE_c FINALIZE_SYMTABLE_c: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value = alloca float, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store float 6.000000e+00, float* %call_arg_value, align 4 call void @__module_nested_06_a_b(float* %call_arg_value) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_nested_06 FINALIZE_SYMTABLE_nested_06: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-template_array_02-85b6b2e.json0000664000175000017500000000077515174404631024774 0ustar alastairalastair{ "basename": "asr-template_array_02-85b6b2e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_array_02.f90", "infile_hash": "cf1525abcafcfb764aa16e653d8b360adbfaa355edeac751105feacf", "outfile": null, "outfile_hash": null, "stdout": "asr-template_array_02-85b6b2e.stdout", "stdout_hash": "d9f9482e4b6d72c3b05e2457efc23070e5d4104f7e9652ceaef5cad0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-Subroutine_Call1-8e53e13.json0000664000175000017500000000074515174404631024554 0ustar alastairalastair{ "basename": "ast-Subroutine_Call1-8e53e13", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/Subroutine_Call1.f90", "infile_hash": "bf7f51f810752b3f8e9381f1e100d0c9b3495c2f87cd120a6ee74148", "outfile": null, "outfile_hash": null, "stdout": "ast-Subroutine_Call1-8e53e13.stdout", "stdout_hash": "446f51993aaa4b3c0d0828e480f1da21aecded12c5e634fb90b64bad", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-bits_02-e48c6d3.json0000664000175000017500000000073715174404631022725 0ustar alastairalastair{ "basename": "asr-bits_02-e48c6d3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bits_02.f90", "infile_hash": "326043189040d63a64dac0f62cb9504336196a58ad139ffe70eeb884", "outfile": null, "outfile_hash": null, "stdout": "asr-bits_02-e48c6d3.stdout", "stdout_hash": "ace0cad64e8eca81fd3af2bd365c29f217cbd2e78e1a66c9bf29fc02", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-print1-a173a20.stdout0000664000175000017500000000021315174404631023614 0ustar alastairalastairprogram print1 implicit none real :: pi pi = 3.141592 print "(f6.3)", pi print *, pi print 10 10 format(3x, "print") end program print1 lfortran-0.63.0/tests/reference/pass_dead_code_removal-case_06-e7f007f.json0000664000175000017500000000103615174404631026547 0ustar alastairalastair{ "basename": "pass_dead_code_removal-case_06-e7f007f", "cmd": "lfortran --pass=dead_code_removal --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_06.f90", "infile_hash": "3987983e4c8d162530bceffbbce0bd7d038b1f794655c222c47ad714", "outfile": null, "outfile_hash": null, "stdout": "pass_dead_code_removal-case_06-e7f007f.stdout", "stdout_hash": "f9a48ffa0023201b9d719fcb611fbe28e3fadb094521ddc9bc6412bc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-format_02-1ba2faf.stdout0000664000175000017500000000207315174404631023744 0ustar alastairalastair(TranslationUnit [(Program format_02 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i6 [] [] () () None ()) (format [(1 3 DimensionExpr)] [] () () None ())] () )] [(Assignment 0 i6 2 () ) (Assignment 0 (FuncCallOrArray format [] [(() i6 () 0)] [] [] [] ) 3 () ) (Format 1 "i6" () )] [] )] ) lfortran-0.63.0/tests/reference/asr-kind_invalid_int_of_logical-6bf4989.stderr0000664000175000017500000000023515174404631027424 0ustar alastairalastairsemantic error: Kind 10 is not supported for Logical --> tests/errors/kind_invalid_int_of_logical.f90:3:13 | 3 | logical(10) :: x | ^^ lfortran-0.63.0/tests/reference/asr-do_loop_01-3b6a582.stderr0000664000175000017500000000021115174404631023645 0ustar alastairalastairsemantic error: Assignment to loop variable `i` is not allowed --> tests/errors/do_loop_01.f90:7:7 | 7 | i = j + 1 | ^ lfortran-0.63.0/tests/reference/ast-assign-262a444.json0000664000175000017500000000070715174404631022574 0ustar alastairalastair{ "basename": "ast-assign-262a444", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/assign.f90", "infile_hash": "67fee149907196a73ab4db43412dfbf29304c02aa5f1ce2da476423e", "outfile": null, "outfile_hash": null, "stdout": "ast-assign-262a444.stdout", "stdout_hash": "7834f54e99990470c7a931169941a9378eba8a918ffe30f18a5bab50", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-subroutines_02-83f1d9f.json0000664000175000017500000000076715174404631024542 0ustar alastairalastair{ "basename": "llvm-subroutines_02-83f1d9f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_02.f90", "infile_hash": "0da20d4528bff96e6ec7497805bf54f1744384b5ab8de197c3e75432", "outfile": null, "outfile_hash": null, "stdout": "llvm-subroutines_02-83f1d9f.stdout", "stdout_hash": "6b9b7cebc6c92c554cc4d835292472e8756a900e73ec1203eb54202e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array3-7b1ab3b.json0000664000175000017500000000070715174404631022722 0ustar alastairalastair{ "basename": "asr-array3-7b1ab3b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/array3.f90", "infile_hash": "047ac01d7e3df52429d6889258f37213048937dae8611af6cbd9ecae", "outfile": null, "outfile_hash": null, "stdout": "asr-array3-7b1ab3b.stdout", "stdout_hash": "e0b106e742a253129b7b83065cf28e2b114857c773231cc8eb4469a8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_where-where_01-94e4416.stdout0000664000175000017500000007312115174404631024656 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { where_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) where_01 [] [(Assignment (Var 2 a) (ArrayBroadcast (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [-2, -2, -2, ...., -2, -2, -2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 8 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 b) (ArrayBroadcast (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [-3, -3, -3, ...., -3, -3, -3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (If () (IntegerCompare (Var 2 a) GtE (IntegerConstant 0 (Integer 4) Decimal) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 1, 1, ...., 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 0 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [0, 0, 0, ...., 0, 0, 0] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] ) (If () (IntegerCompare (Var 2 a) GtE (IntegerConstant 0 (Integer 4) Decimal) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 1, 1, ...., 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 0 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [0, 0, 0, ...., 0, 0, 0] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] ) (If () (IntegerCompare (Var 2 a) GtE (IntegerConstant 0 (Integer 4) Decimal) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 1, 1, ...., 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 0 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [0, 0, 0, ...., 0, 0, 0] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] ) (If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) ()) [(If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] [] ) (Print (StringFormat () [(Var 2 b)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-print2-785df93.stdout0000664000175000017500000000011715174404631023653 0ustar alastairalastairprogram print2 print "(es11.5,3x " // "es11.5)", 1.d0, 2.d0 end program print2 lfortran-0.63.0/tests/reference/ast-allocate_01-ce7628b.stdout0000664000175000017500000000505315174404631024116 0ustar alastairalastair(TranslationUnit [(Program hello () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeCharacter [(() () Colon)] () () None ) [(SimpleAttribute AttrAllocatable )] [(cmd [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(cmdlen [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(ierr [] [] () () None ())] () )] [(SubroutineCall 0 get_command [] [] [(length cmdlen)] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (> cmdlen 0) [(Allocate 0 [((FuncCallOrArray character [] [(() cmdlen () 0)] [] [] [] ) () cmd 0)] [] () ) (SubroutineCall 0 get_command [] [(() cmd () 0)] [] [] () ) (Print 0 () [(String "hello " ()) cmd] () )] [] () () () ) (Deallocate 0 [(() cmd () 0)] [(stat ierr)] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-dim_assgn_test-2643606.stderr0000664000175000017500000000073315174404631024566 0ustar alastairalastairwarning: Dimensions are specified twice --> tests/warnings/dim_assgn_test.f90:2:19 | 2 | integer, private, dimension(2,2) :: a(2,2) | ^^^^^^^^^^^^^^ ^^^^^^ help: consider specifying it just one way or the other warning: Dimensions are specified twice --> tests/warnings/dim_assgn_test.f90:3:19 | 3 | integer, private, dimension(2,2) :: b(2,3) | ^^^^^^^^^^^^^^ ^^^^^^ help: consider specifying it just one way or the other lfortran-0.63.0/tests/reference/llvm-logical4-b4e6b33.json0000664000175000017500000000074515174404631023335 0ustar alastairalastair{ "basename": "llvm-logical4-b4e6b33", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/logical4.f90", "infile_hash": "ea18762e8bbd163cb8b30960c719f953e2dfae041020c2f1066b3a35", "outfile": null, "outfile_hash": null, "stdout": "llvm-logical4-b4e6b33.stdout", "stdout_hash": "9e730c767c7f4fc34113e53abef510521ba89f79afa835a1b0699bfa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-modules_06-03c75b2.json0000664000175000017500000000075315174404631023530 0ustar alastairalastair{ "basename": "llvm-modules_06-03c75b2", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_06.f90", "infile_hash": "ffed6acf9a41c361cf70e0d7be27fb220ad99d98ab607fce09d93992", "outfile": null, "outfile_hash": null, "stdout": "llvm-modules_06-03c75b2.stdout", "stdout_hash": "ec5c9e7b0e7118ce4db9231b8ae99b6178b83add3e4d9cfb2fb7c89b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_size_04-dcfa313.stderr0000664000175000017500000000032015174404631024520 0ustar alastairalastairsemantic error: Unrecognized keyword argument kind1 passed to size intrinsic. --> tests/errors/array_size_04.f90:5:14 | 5 | size_a = size(a, kind1=4, dim1=1) | ^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-max_01-415ceb0.stdout0000664000175000017500000000737215174404631023106 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { max_01: (Program (SymbolTable 2 { y: (Variable 2 y [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) max_01 [] [(Assignment (Var 2 y) (RealConstant 5.200000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 z) (RealConstant 9.000000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(IntrinsicElementalFunction Max [(Var 2 y) (Cast (Var 2 z) RealToReal (Real 8) () () )] 0 (Real 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/julia-subroutine6-f8dae3a.json0000664000175000017500000000071715174404631024420 0ustar alastairalastair{ "basename": "julia-subroutine6-f8dae3a", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/subroutine6.f90", "infile_hash": "1987bc648e7f4c6205190248a296d000e0f33cb57a996b6c2a6c4804", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutine6-f8dae3a.stdout", "stdout_hash": "67b45ec73b3f8ce1841dcbe0d123749cbd83278d65ab2b7d5da24430", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-empty-cb5d1b4.json0000664000175000017500000000070715174404631023047 0ustar alastairalastair{ "basename": "llvm-empty-cb5d1b4", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/empty.f90", "infile_hash": "d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f", "outfile": null, "outfile_hash": null, "stdout": "llvm-empty-cb5d1b4.stdout", "stdout_hash": "a146b393d2e0f35cf565405c5e6092f8b905119fa2d30272983cb44e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-ichar_01-a5284c8.json0000664000175000017500000000072415174404631022763 0ustar alastairalastair{ "basename": "asr-ichar_01-a5284c8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/ichar_01.f90", "infile_hash": "96e818fc8837a0604686a6414be1828c77eef5189d2cece2e0d130d9", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-ichar_01-a5284c8.stderr", "stderr_hash": "acd2bd0eb673fed1e139af2f060958c180fba50a2fa022469790cb0e", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-string_03-fc56745.json0000664000175000017500000000074515174404631023217 0ustar alastairalastair{ "basename": "ast-string_03-fc56745", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_03.f90", "infile_hash": "7815b8703dfd3a1c61cab40604e20693508878e8a90e450834ce592b", "outfile": null, "outfile_hash": null, "stdout": "ast-string_03-fc56745.stdout", "stdout_hash": "79fe0a00170474e0c40801f0d1861cf26afdfed4f29658e0a6075ee2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-incompatible_rank_assign-a69f7b4.json0000664000175000017500000000100415174404631026476 0ustar alastairalastair{ "basename": "asr-incompatible_rank_assign-a69f7b4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incompatible_rank_assign.f90", "infile_hash": "0e650e977c4ce7ce00bc5318fc2f65dcd9689f91a8fdd7e5d8cb1007", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incompatible_rank_assign-a69f7b4.stderr", "stderr_hash": "9f94b6c9d177478d0f450c91caf1b034b7706eee4978a80630f36d7d", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-character_01-e8e453d.stderr0000664000175000017500000000051615174404631024245 0ustar alastairalastairwarning: The LHS character len=1 and the RHS character len=4 are not equal. --> tests/warnings/character_01.f90:3:5 | 3 | character(len=1, kind=1), parameter :: c_null_char = "ball" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the RHS character len to match the LHS character len lfortran-0.63.0/tests/reference/run-print5-c57814b.stdout0000664000175000017500000000001015174404631023171 0ustar alastairalastairABCXYZ lfortran-0.63.0/tests/reference/ast_f90-critical1-30285fa.json0000664000175000017500000000073315174404631023722 0ustar alastairalastair{ "basename": "ast_f90-critical1-30285fa", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/critical1.f90", "infile_hash": "05948a8c6d4476986b19c2be2d0c40a9ebb19a2007eac02159ab9496", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-critical1-30285fa.stdout", "stdout_hash": "48974f54bfd4d0b18c37d27908777347b95b5905a24bb8b04ae0aaa9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-abort_01-7212a3d.stderr0000664000175000017500000000027115174404631023505 0ustar alastairalastairwarning: `abort` is an LFortran extension --> tests/../integration_tests/abort_01.f90:3:16 | 3 | if (.false.) call abort() | ^^^^^^^^^^^^ Use `error stop` instead lfortran-0.63.0/tests/reference/asr-intrinsics_open_close_read_write-a696eca.json0000664000175000017500000000105215174404631030330 0ustar alastairalastair{ "basename": "asr-intrinsics_open_close_read_write-a696eca", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_open_close_read_write.f90", "infile_hash": "8e24a004c0e3b808c25b3f9037daca1bd1f7581b98199f50f3404e2e", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_open_close_read_write-a696eca.stdout", "stdout_hash": "690dda011875ba5ee9268ee84fc17cd7224edc4665cc42dbcf1f24a5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-operator_overloading_01-33c47db.json0000664000175000017500000000116115174404631026355 0ustar alastairalastair{ "basename": "llvm-operator_overloading_01-33c47db", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/operator_overloading_01.f90", "infile_hash": "f44f3172b4b5235b41deb5a4d4eaadc61a6b7c51e002a983889cf38f", "outfile": null, "outfile_hash": null, "stdout": "llvm-operator_overloading_01-33c47db.stdout", "stdout_hash": "ff3c78f3c1639b0a0d775c2ea732d6b53a99a8884a166c75e264c7e4", "stderr": "llvm-operator_overloading_01-33c47db.stderr", "stderr_hash": "bc887b577bc8ccfc15f212c070a67ee8c67af8d343abdd0132e6b6fb", "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixedform_assignment-58b5a6f.json0000664000175000017500000000077415174404631025701 0ustar alastairalastair{ "basename": "ast-fixedform_assignment-58b5a6f", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_assignment.f", "infile_hash": "a5ce54b54cc0b1865c8561b13812ea8490888bb2807c4a7bddd5ba39", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_assignment-58b5a6f.stdout", "stdout_hash": "ebcb76376b470c899d2a26a11e4e649e9a3b30343bcb3be43053fd9f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/enable_disable_style_suggestion-style1-55a065c.stderr0000664000175000017500000000011315174404631030745 0ustar alastairalastairCannot use --no-style-suggestions and --style-suggestions at the same time lfortran-0.63.0/tests/reference/run-array_bounds_check_09-afed6c8.json0000664000175000017500000000074315174404631025774 0ustar alastairalastair{ "basename": "run-array_bounds_check_09-afed6c8", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_09.f90", "infile_hash": "a0763b8438157b6413dbda8eb34da783f57fcdb6f82be814b39f6a35", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_09-afed6c8.stderr", "stderr_hash": "a39767384e7aa938a9cee070458502f180e48eddeadb1e875a29e6bf", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-polymorphic_class_compare-e58def6.json0000664000175000017500000000102515174404631027000 0ustar alastairalastair{ "basename": "asr-polymorphic_class_compare-e58def6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/polymorphic_class_compare.f90", "infile_hash": "ed9ac85fcf47a406efa5f7672115ca698b4be28ba5c667c2371591fb", "outfile": null, "outfile_hash": null, "stdout": "asr-polymorphic_class_compare-e58def6.stdout", "stdout_hash": "f9df3378cbe340d025fb0c6c209a3bc2a3c2dcccc32298873626123a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_global_stmts-expr3-c9c0bd7.stdout0000664000175000017500000003174015174404631026101 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f2: (Variable 2 f2 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f3: (Variable 2 f3 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f4: (Variable 2 f4 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f5: (Variable 2 f5 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f6: (Variable 2 f6 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f7: (Variable 2 f7 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f8: (Variable 2 f8 [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] (Integer 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 f1) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 f2) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 f3) (IntegerBinOp (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) Mul (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 16 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 f4) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Mul (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 6 (Integer 4) Decimal) ) (Integer 4) (IntegerConstant 11 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 f5) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Sub (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 f6) (IntegerBinOp (IntegerConstant 4 (Integer 4) Decimal) Pow (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 64 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 f7) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 f8) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) () .false. .false. )] (Var 2 f8) Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-dependency_test_03-86dce2a.stdout0000664000175000017500000001516015174404631025563 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { m_cli2: (Module (SymbolTable 4 { check_commandline: (Function (SymbolTable 5 { default_help: (Function (SymbolTable 6 { ilength: (Variable 6 ilength [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) default_help (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(IntrinsicImpureSubroutine GetCommandArgument [(IntegerConstant 0 (Integer 4) Decimal) (Var 6 ilength)] 2 )] () Public .false. .false. () ) }) check_commandline (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(SubroutineCall 5 default_help () [] () .false. )] () Public .true. .true. () ) }) m_cli2 () [] .true. .false. .false. ), m_cli2_user: (Module (SymbolTable 2 { check_commandline: (ExternalSymbol 2 check_commandline 4 check_commandline m_cli2 [] check_commandline Public ) }) m_cli2_user () [m_cli2] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/pass_global_stmts-expr6-a926072.json0000664000175000017500000000076415174404631025314 0ustar alastairalastair{ "basename": "pass_global_stmts-expr6-a926072", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr6.f90", "infile_hash": "722af2f789e614d9acf6975aae8260e4949a360066d5aa53a3f05944", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-expr6-a926072.stdout", "stdout_hash": "fd57ffd974807cf56b7942fe87166962d72d63fea7f71c6fe3db26ef", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-types_11-696c3ee.stdout0000664000175000017500000000264215174404631023504 0ustar alastairalastair(TranslationUnit [(Program types_11 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Enum [(AttrBind (Bind [c] [] ) )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(Declaration () [(SimpleAttribute AttrEnumerator )] [(a [] [] () 1 Equal ())] () ) (Declaration () [(SimpleAttribute AttrEnumerator )] [(b [] [] () 2 Equal ())] () ) (Declaration () [(SimpleAttribute AttrEnumerator )] [(c [] [] () 3 Equal ())] () )] )] [] [] )] ) lfortran-0.63.0/tests/reference/ast_f90-expr9-c1303f2.json0000664000175000017500000000071715174404631023111 0ustar alastairalastair{ "basename": "ast_f90-expr9-c1303f2", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/expr9.f90", "infile_hash": "72b98645e78d4c2860107f173940315443535270bca4d18d631ea006", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-expr9-c1303f2.stdout", "stdout_hash": "d6888988904544626c2adaff83ce70adc5f226e814b3c3ab8430eca7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-expr5-f0a7df6.stdout0000664000175000017500000000502215174404631023144 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { expr_05: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) expr_05 [] [(Assignment (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) Mul (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 25 (Integer 4) Decimal) ) () .false. .false. ) (If () (IntegerCompare (Var 2 x) Eq (IntegerConstant 25 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-string_54-06ad64c.json0000664000175000017500000000075015174404631023450 0ustar alastairalastair{ "basename": "llvm-string_54-06ad64c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/string_54.f90", "infile_hash": "ac362ebe23bff5072f61252724ef01399d95e4783cbf9330a49acf86", "outfile": null, "outfile_hash": null, "stdout": "llvm-string_54-06ad64c.stdout", "stdout_hash": "ade750df89e7948b2e534bc2b7e77dadd75ef27dc6d16379a5e38c86", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-case_01-49038b7.stdout0000664000175000017500000000240515174404631023076 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int64_t i; int64_t out; i = 4; if (i == 1) { out = 10; std::cout<< "1"< tests/warnings/doloop_01.f90:4:12 | 4 | do i = 1.5, 10.5, 2.4 | ^^^ warning: End expression in DO loop must be integer --> tests/warnings/doloop_01.f90:4:17 | 4 | do i = 1.5, 10.5, 2.4 | ^^^^ warning: Step expression (increment) in DO loop must be integer --> tests/warnings/doloop_01.f90:4:23 | 4 | do i = 1.5, 10.5, 2.4 | ^^^ lfortran-0.63.0/tests/reference/asr-min_02-21863aa.json0000664000175000017500000000105115174404631022442 0ustar alastairalastair{ "basename": "asr-min_02-21863aa", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/min_02.f90", "infile_hash": "395cfc5a8d60d306a6e51a8c1619bb4e36adede48c2fc96880e6c260", "outfile": null, "outfile_hash": null, "stdout": "asr-min_02-21863aa.stdout", "stdout_hash": "ff35aff69fc6c38f06f2921808d48c17e0cf5eba7867ebcc60b13d39", "stderr": "asr-min_02-21863aa.stderr", "stderr_hash": "725c31c866b6247c13d41d88baca52f0557baea049805e460d55fa23", "returncode": 0 }lfortran-0.63.0/tests/reference/wat-doloop_01-4e94eaf.json0000664000175000017500000000073015174404631023337 0ustar alastairalastair{ "basename": "wat-doloop_01-4e94eaf", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/doloop_01.f90", "infile_hash": "14818f8f39c32bf890cf7906fe8a9692b270ad81a49bcdf0486f8e84", "outfile": null, "outfile_hash": null, "stdout": "wat-doloop_01-4e94eaf.stdout", "stdout_hash": "185a1f350c3f225982b7770df44453159d54798ec1a262b383159c53", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-private1-f9f97ce.stderr0000664000175000017500000000020315174404631023630 0ustar alastairalastairsemantic error: Variable 'x' is not declared --> tests/errors/private1.f90:21:5 | 21 | x = 5 | ^ 'x' is undeclared lfortran-0.63.0/tests/reference/ast_f90-arrays_02-d2f7107.stdout0000664000175000017500000000033415174404631024221 0ustar alastairalastairprogram arrays_02 implicit none integer, parameter :: dp = kind(0.d0) real(dp) :: a(3), b a(1) = 3._dp a(2) = 2._dp a(3) = 1._dp b = sum(a) if (abs(b - 6._dp) > 1e-12_dp) then error stop end if end program arrays_02 lfortran-0.63.0/tests/reference/asr-select_type_01-204dfa1.stdout0000664000175000017500000010302515174404631024627 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { select_type_01: (Program (SymbolTable 2 { 1_base_i: (ExternalSymbol 2 1_base_i 3 i base [] i Public ), 1_child_j: (ExternalSymbol 2 1_child_j 4 j child [] j Public ), base: (Struct (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) base (StructType [(Integer 4)] [] .true. .false. ) [] [i] [] Source Public .false. .false. [] () () [] ), base_target: (Variable 2 base_target [] Local (StructConstructor 2 base [((IntegerConstant 10 (Integer 4) Decimal))] (StructType [(Integer 4)] [] .true. .false. ) () ) () Default (StructType [(Integer 4)] [] .true. .false. ) 2 base Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), bptr: (Variable 2 bptr [] Local () () Default (Pointer (StructType [(Integer 4)] [] .false. .false. ) ) 2 base Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), child: (Struct (SymbolTable 4 { j: (Variable 4 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) child (StructType [(Integer 4)] [] .true. .false. ) [] [j] [] Source Public .false. .false. [] () 2 base [] ), child_target: (Variable 2 child_target [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 child Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), perform_select_type: (Function (SymbolTable 5 { bptr: (Variable 5 bptr [] Unspecified () () Default (Pointer (StructType [(Integer 4)] [] .false. .false. ) ) 2 base Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~select_type_block_: (Block (SymbolTable 6 { 1_base_i: (ExternalSymbol 6 1_base_i 3 i base [] i Public ) }) ~select_type_block_ [(Print (StringFormat () [(StringConstant "base type: component value: " (String 1 (IntegerConstant 28 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StructInstanceMember (Cast (Var 5 bptr) ClassToStruct (Pointer (StructType [(Integer 4)] [] .true. .false. ) ) () (Var 2 base) ) 6 1_base_i (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (StructInstanceMember (Cast (Var 5 bptr) ClassToStruct (Pointer (StructType [(Integer 4)] [] .true. .false. ) ) () (Var 2 base) ) 6 1_base_i (Integer 4) () ) NotEq (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), ~select_type_block_1: (Block (SymbolTable 7 { 1_base_i: (ExternalSymbol 7 1_base_i 3 i base [] i Public ), 1_child_j: (ExternalSymbol 7 1_child_j 4 j child [] j Public ) }) ~select_type_block_1 [(Print (StringFormat () [(StringConstant "child type: component values: " (String 1 (IntegerConstant 30 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StructInstanceMember (Cast (Var 5 bptr) ClassToStruct (Pointer (StructType [(Integer 4)] [] .true. .false. ) ) () (Var 2 child) ) 7 1_base_i (Integer 4) () ) (StructInstanceMember (Cast (Var 5 bptr) ClassToStruct (Pointer (StructType [(Integer 4)] [] .true. .false. ) ) () (Var 2 child) ) 7 1_child_j (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (StructInstanceMember (Cast (Var 5 bptr) ClassToStruct (Pointer (StructType [(Integer 4)] [] .true. .false. ) ) () (Var 2 child) ) 7 1_base_i (Integer 4) () ) NotEq (IntegerConstant 20 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (StructInstanceMember (Cast (Var 5 bptr) ClassToStruct (Pointer (StructType [(Integer 4)] [] .true. .false. ) ) () (Var 2 child) ) 7 1_child_j (Integer 4) () ) NotEq (IntegerConstant 30 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) perform_select_type (FunctionType [(Pointer (StructType [(Integer 4)] [] .false. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 bptr)] [(SelectType (Var 5 bptr) () [(TypeStmtName 2 base [(BlockCall -1 5 ~select_type_block_ )] ) (TypeStmtName 2 child [(BlockCall -1 5 ~select_type_block_1 )] )] [] )] () Public .false. .false. () ) }) select_type_01 [] [(Assignment (Var 2 child_target) (StructConstructor 2 child [((IntegerConstant 20 (Integer 4) Decimal)) ((IntegerConstant 30 (Integer 4) Decimal))] (StructType [(Integer 4)] [] .true. .false. ) () ) () .false. .false. ) (Print (StringFormat () [(StructInstanceMember (Var 2 base_target) 2 1_base_i (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StructInstanceMember (Var 2 child_target) 2 1_base_i (Integer 4) () ) (StructInstanceMember (Var 2 child_target) 2 1_child_j (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Associate (Var 2 bptr) (Var 2 child_target) ) (SubroutineCall 2 perform_select_type () [((Var 2 bptr))] () .false. ) (Associate (Var 2 bptr) (Var 2 base_target) ) (SubroutineCall 2 perform_select_type () [((Var 2 bptr))] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-max_02-646ff6d.json0000664000175000017500000000105115174404631022544 0ustar alastairalastair{ "basename": "asr-max_02-646ff6d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/max_02.f90", "infile_hash": "bd78accf5e71c42d049416709f9c7e4f8e68f8f78e66bb1a5a47834a", "outfile": null, "outfile_hash": null, "stdout": "asr-max_02-646ff6d.stdout", "stdout_hash": "6b682fa3702c588df50c08f8a8fa931bd11e3ec63d148057d1872fb0", "stderr": "asr-max_02-646ff6d.stderr", "stderr_hash": "64e91c42f66a3935616bfc089e1051357881a0b8abc49c7a30b8f46b", "returncode": 0 }lfortran-0.63.0/tests/reference/run-format_40-9ce331f.json0000664000175000017500000000071515174404631023266 0ustar alastairalastair{ "basename": "run-format_40-9ce331f", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_40.f90", "infile_hash": "f9b072b2e5d881b866bc93f150f89a0e537fc8cb5b7efe6bd3519a9a", "outfile": null, "outfile_hash": null, "stdout": "run-format_40-9ce331f.stdout", "stdout_hash": "d2b1f734863fed5c473c2fc70a409e7f4744908c27934abff1b94ebb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-parsing_01-c9b84fe.json0000664000175000017500000000075015174404631023507 0ustar alastairalastair{ "basename": "ast-parsing_01-c9b84fe", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/parsing_01.f90", "infile_hash": "def9551071d9aa0cfd8163560e96b69ad76bc67a9830f2531e6752a5", "outfile": null, "outfile_hash": null, "stdout": "ast-parsing_01-c9b84fe.stdout", "stdout_hash": "b4ea95da6854b7d12c06c8db17b4118ca84b5344a57ffb401305b1b8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_11-dd72b29.json0000664000175000017500000000075015174404631023424 0ustar alastairalastair{ "basename": "asr-modules_11-dd72b29", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_11.f90", "infile_hash": "f19a5ba8d01ebaae3da78891afbae58462d711a364274aa3a5569fa1", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_11-dd72b29.stdout", "stdout_hash": "5b7355d948765497ff9c87c7505e49e210524840dd80f7a335ed7bae", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-arrays_101-8ed52ae.stdout0000664000175000017500000010147115174404631024155 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [10 x i8] c"small_arr\00", align 1 @1 = private unnamed_addr constant [42 x i8] c"tests/../integration_tests/arrays_101.f90\00", align 1 @2 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @3 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @4 = private unnamed_addr constant [10 x i8] c"large_arr\00", align 1 @5 = private unnamed_addr constant [42 x i8] c"tests/../integration_tests/arrays_101.f90\00", align 1 @6 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @7 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @8 = private unnamed_addr constant [10 x i8] c"small_arr\00", align 1 @9 = private unnamed_addr constant [42 x i8] c"tests/../integration_tests/arrays_101.f90\00", align 1 @10 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @11 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [10 x i8] c"large_arr\00", align 1 @15 = private unnamed_addr constant [42 x i8] c"tests/../integration_tests/arrays_101.f90\00", align 1 @16 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @17 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @20 = private unnamed_addr constant [10 x i8] c"block_arr\00", align 1 @21 = private unnamed_addr constant [42 x i8] c"tests/../integration_tests/arrays_101.f90\00", align 1 @22 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @23 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @24 = private unnamed_addr constant [10 x i8] c"block_arr\00", align 1 @25 = private unnamed_addr constant [42 x i8] c"tests/../integration_tests/arrays_101.f90\00", align 1 @26 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @27 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @28 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @29 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [2 x i8] c"OK" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([2 x i8], [2 x i8]* @string_const_data, i32 0, i32 0), i64 2 }> @31 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define float @_lcompilers_real_i32(i32* %x) { .entry: %_lcompilers_real_i32 = alloca float, align 4 %0 = load i32, i32* %x, align 4 %1 = sitofp i32 %0 to float store float %1, float* %_lcompilers_real_i32, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE__lcompilers_real_i32 FINALIZE_SYMTABLE__lcompilers_real_i32: ; preds = %return %2 = load float, float* %_lcompilers_real_i32, align 4 ret float %2 } define i32 @main(i32 %0, i8** %1) { .entry: %array_bound38 = alloca i32, align 4 %array_bound34 = alloca i32, align 4 %array_bound11 = alloca i32, align 4 %array_bound7 = alloca i32, align 4 %2 = call i8* @_lfortran_get_default_allocator() %array_bound1 = alloca i32, align 4 %array_bound = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %__do_loop_end = alloca i32, align 4 %__do_loop_end1 = alloca i32, align 4 %__libasr_index_0_ = alloca i32, align 4 %__libasr_index_0_1 = alloca i32, align 4 %i = alloca i32, align 4 %3 = call i8* @_lfortran_get_default_allocator() %4 = call i8* @_lfortran_malloc_alloc(i8* %3, i64 8000) %5 = bitcast i8* %4 to [2000 x float]* %small_arr = alloca [100 x float], align 4 %sum = alloca float, align 4 br i1 true, label %then, label %else then: ; preds = %.entry store i32 100, i32* %array_bound, align 4 br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %6 = load i32, i32* %array_bound, align 4 store i32 %6, i32* %__do_loop_end, align 4 br i1 true, label %then2, label %else3 then2: ; preds = %ifcont store i32 1, i32* %array_bound1, align 4 br label %ifcont4 else3: ; preds = %ifcont br label %ifcont4 ifcont4: ; preds = %else3, %then2 %7 = load i32, i32* %array_bound1, align 4 %8 = sub i32 %7, 1 store i32 %8, i32* %__libasr_index_0_, align 4 br label %loop.head loop.head: ; preds = %ifcont6, %ifcont4 %9 = load i32, i32* %__libasr_index_0_, align 4 %10 = add i32 %9, 1 %11 = load i32, i32* %__do_loop_end, align 4 %12 = icmp sle i32 %10, %11 br i1 %12, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %13 = load i32, i32* %__libasr_index_0_, align 4 %14 = add i32 %13, 1 store i32 %14, i32* %__libasr_index_0_, align 4 %15 = load i32, i32* %__libasr_index_0_, align 4 %16 = sext i32 %15 to i64 %17 = sub i64 %16, 1 %18 = mul i64 1, %17 %19 = add i64 0, %18 %20 = icmp slt i64 %16, 1 %21 = icmp sgt i64 %16, 100 %22 = or i1 %20, %21 br i1 %22, label %then5, label %ifcont6 then5: ; preds = %loop.body %23 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %24 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %25 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %24, i32 0, i32 0 %26 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %25, i32 0, i32 0 store i8* getelementptr inbounds ([42 x i8], [42 x i8]* @1, i32 0, i32 0), i8** %26, align 8 %27 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %25, i32 0, i32 1 store i32 17, i32* %27, align 4 %28 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %25, i32 0, i32 2 store i32 5, i32* %28, align 4 %29 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %25, i32 0, i32 3 store i32 17, i32* %29, align 4 %30 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %25, i32 0, i32 4 store i32 13, i32* %30, align 4 %31 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @2, i32 0, i32 0)) %32 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %23, i32 0, i32 0 %33 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %24, i32 0, i32 0 %34 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %32, i32 0, i32 2 %35 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %32, i32 0, i32 0 store i1 true, i1* %35, align 1 %36 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %32, i32 0, i32 1 store i8* %31, i8** %36, align 8 store { i8*, i32, i32, i32, i32 }* %33, { i8*, i32, i32, i32, i32 }** %34, align 8 %37 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %32, i32 0, i32 3 store i32 1, i32* %37, align 4 %38 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %23, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %38, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @0, i32 0, i32 0), i64 %16, i32 1, i64 1, i64 100) call void @exit(i32 1) unreachable ifcont6: ; preds = %loop.body %39 = getelementptr [100 x float], [100 x float]* %small_arr, i32 0, i64 %19 store float 1.000000e+00, float* %39, align 4 br label %loop.head loop.end: ; preds = %loop.head br i1 true, label %then8, label %else9 then8: ; preds = %loop.end store i32 2000, i32* %array_bound7, align 4 br label %ifcont10 else9: ; preds = %loop.end br label %ifcont10 ifcont10: ; preds = %else9, %then8 %40 = load i32, i32* %array_bound7, align 4 store i32 %40, i32* %__do_loop_end1, align 4 br i1 true, label %then12, label %else13 then12: ; preds = %ifcont10 store i32 1, i32* %array_bound11, align 4 br label %ifcont14 else13: ; preds = %ifcont10 br label %ifcont14 ifcont14: ; preds = %else13, %then12 %41 = load i32, i32* %array_bound11, align 4 %42 = sub i32 %41, 1 store i32 %42, i32* %__libasr_index_0_1, align 4 br label %loop.head15 loop.head15: ; preds = %ifcont18, %ifcont14 %43 = load i32, i32* %__libasr_index_0_1, align 4 %44 = add i32 %43, 1 %45 = load i32, i32* %__do_loop_end1, align 4 %46 = icmp sle i32 %44, %45 br i1 %46, label %loop.body16, label %loop.end19 loop.body16: ; preds = %loop.head15 %47 = load i32, i32* %__libasr_index_0_1, align 4 %48 = add i32 %47, 1 store i32 %48, i32* %__libasr_index_0_1, align 4 %49 = load i32, i32* %__libasr_index_0_1, align 4 %50 = sext i32 %49 to i64 %51 = sub i64 %50, 1 %52 = mul i64 1, %51 %53 = add i64 0, %52 %54 = icmp slt i64 %50, 1 %55 = icmp sgt i64 %50, 2000 %56 = or i1 %54, %55 br i1 %56, label %then17, label %ifcont18 then17: ; preds = %loop.body16 %57 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %58 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %59 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %58, i32 0, i32 0 %60 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %59, i32 0, i32 0 store i8* getelementptr inbounds ([42 x i8], [42 x i8]* @5, i32 0, i32 0), i8** %60, align 8 %61 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %59, i32 0, i32 1 store i32 18, i32* %61, align 4 %62 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %59, i32 0, i32 2 store i32 5, i32* %62, align 4 %63 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %59, i32 0, i32 3 store i32 18, i32* %63, align 4 %64 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %59, i32 0, i32 4 store i32 13, i32* %64, align 4 %65 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @6, i32 0, i32 0)) %66 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %57, i32 0, i32 0 %67 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %58, i32 0, i32 0 %68 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %66, i32 0, i32 2 %69 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %66, i32 0, i32 0 store i1 true, i1* %69, align 1 %70 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %66, i32 0, i32 1 store i8* %65, i8** %70, align 8 store { i8*, i32, i32, i32, i32 }* %67, { i8*, i32, i32, i32, i32 }** %68, align 8 %71 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %66, i32 0, i32 3 store i32 1, i32* %71, align 4 %72 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %57, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %72, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @4, i32 0, i32 0), i64 %50, i32 1, i64 1, i64 2000) call void @exit(i32 1) unreachable ifcont18: ; preds = %loop.body16 %73 = getelementptr [2000 x float], [2000 x float]* %5, i32 0, i64 %53 store float 2.000000e+00, float* %73, align 4 br label %loop.head15 loop.end19: ; preds = %loop.head15 br i1 false, label %then20, label %ifcont21 then20: ; preds = %loop.end19 %74 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %75 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %76 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %75, i32 0, i32 0 %77 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %76, i32 0, i32 0 store i8* getelementptr inbounds ([42 x i8], [42 x i8]* @9, i32 0, i32 0), i8** %77, align 8 %78 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %76, i32 0, i32 1 store i32 21, i32* %78, align 4 %79 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %76, i32 0, i32 2 store i32 9, i32* %79, align 4 %80 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %76, i32 0, i32 3 store i32 21, i32* %80, align 4 %81 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %76, i32 0, i32 4 store i32 20, i32* %81, align 4 %82 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @10, i32 0, i32 0)) %83 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %74, i32 0, i32 0 %84 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %75, i32 0, i32 0 %85 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %83, i32 0, i32 2 %86 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %83, i32 0, i32 0 store i1 true, i1* %86, align 1 %87 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %83, i32 0, i32 1 store i8* %82, i8** %87, align 8 store { i8*, i32, i32, i32, i32 }* %84, { i8*, i32, i32, i32, i32 }** %85, align 8 %88 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %83, i32 0, i32 3 store i32 1, i32* %88, align 4 %89 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %74, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %89, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @8, i32 0, i32 0), i64 1, i32 1, i64 1, i64 100) call void @exit(i32 1) unreachable ifcont21: ; preds = %loop.end19 %90 = getelementptr [100 x float], [100 x float]* %small_arr, i32 0, i64 0 %91 = load float, float* %90, align 4 %92 = fcmp une float %91, 1.000000e+00 br i1 %92, label %then22, label %else23 then22: ; preds = %ifcont21 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont24 else23: ; preds = %ifcont21 br label %ifcont24 ifcont24: ; preds = %else23, %then22 br i1 false, label %then25, label %ifcont26 then25: ; preds = %ifcont24 %93 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %94 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %95 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %94, i32 0, i32 0 %96 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %95, i32 0, i32 0 store i8* getelementptr inbounds ([42 x i8], [42 x i8]* @15, i32 0, i32 0), i8** %96, align 8 %97 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %95, i32 0, i32 1 store i32 22, i32* %97, align 4 %98 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %95, i32 0, i32 2 store i32 9, i32* %98, align 4 %99 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %95, i32 0, i32 3 store i32 22, i32* %99, align 4 %100 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %95, i32 0, i32 4 store i32 20, i32* %100, align 4 %101 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @16, i32 0, i32 0)) %102 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %93, i32 0, i32 0 %103 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %94, i32 0, i32 0 %104 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %102, i32 0, i32 2 %105 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %102, i32 0, i32 0 store i1 true, i1* %105, align 1 %106 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %102, i32 0, i32 1 store i8* %101, i8** %106, align 8 store { i8*, i32, i32, i32, i32 }* %103, { i8*, i32, i32, i32, i32 }** %104, align 8 %107 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %102, i32 0, i32 3 store i32 1, i32* %107, align 4 %108 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %93, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %108, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @14, i32 0, i32 0), i64 1, i32 1, i64 1, i64 2000) call void @exit(i32 1) unreachable ifcont26: ; preds = %ifcont24 %109 = getelementptr [2000 x float], [2000 x float]* %5, i32 0, i64 0 %110 = load float, float* %109, align 4 %111 = fcmp une float %110, 2.000000e+00 br i1 %111, label %then27, label %else28 then27: ; preds = %ifcont26 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont29 else28: ; preds = %ifcont26 br label %ifcont29 ifcont29: ; preds = %else28, %then27 store float 0.000000e+00, float* %sum, align 4 store i32 0, i32* %i, align 4 br label %loop.head30 loop.head30: ; preds = %free_done, %ifcont29 %112 = load i32, i32* %i, align 4 %113 = add i32 %112, 1 %114 = icmp sle i32 %113, 1000 br i1 %114, label %loop.body31, label %loop.end49 loop.body31: ; preds = %loop.head30 %115 = load i32, i32* %i, align 4 %116 = add i32 %115, 1 store i32 %116, i32* %i, align 4 br label %block.start block.start: ; preds = %loop.body31 %117 = call i8* @llvm.stacksave() %__do_loop_end32 = alloca i32, align 4 %__libasr_index_0_33 = alloca i32, align 4 %118 = call i8* @_lfortran_get_default_allocator() %119 = call i8* @_lfortran_malloc_alloc(i8* %118, i64 2000) %120 = bitcast i8* %119 to [500 x float]* br i1 true, label %then35, label %else36 then35: ; preds = %block.start store i32 500, i32* %array_bound34, align 4 br label %ifcont37 else36: ; preds = %block.start br label %ifcont37 ifcont37: ; preds = %else36, %then35 %121 = load i32, i32* %array_bound34, align 4 store i32 %121, i32* %__do_loop_end32, align 4 br i1 true, label %then39, label %else40 then39: ; preds = %ifcont37 store i32 1, i32* %array_bound38, align 4 br label %ifcont41 else40: ; preds = %ifcont37 br label %ifcont41 ifcont41: ; preds = %else40, %then39 %122 = load i32, i32* %array_bound38, align 4 %123 = sub i32 %122, 1 store i32 %123, i32* %__libasr_index_0_33, align 4 br label %loop.head42 loop.head42: ; preds = %ifcont45, %ifcont41 %124 = load i32, i32* %__libasr_index_0_33, align 4 %125 = add i32 %124, 1 %126 = load i32, i32* %__do_loop_end32, align 4 %127 = icmp sle i32 %125, %126 br i1 %127, label %loop.body43, label %loop.end46 loop.body43: ; preds = %loop.head42 %128 = load i32, i32* %__libasr_index_0_33, align 4 %129 = add i32 %128, 1 store i32 %129, i32* %__libasr_index_0_33, align 4 %130 = load i32, i32* %__libasr_index_0_33, align 4 %131 = sext i32 %130 to i64 %132 = sub i64 %131, 1 %133 = mul i64 1, %132 %134 = add i64 0, %133 %135 = icmp slt i64 %131, 1 %136 = icmp sgt i64 %131, 500 %137 = or i1 %135, %136 br i1 %137, label %then44, label %ifcont45 then44: ; preds = %loop.body43 %138 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %139 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %140 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %139, i32 0, i32 0 %141 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %140, i32 0, i32 0 store i8* getelementptr inbounds ([42 x i8], [42 x i8]* @21, i32 0, i32 0), i8** %141, align 8 %142 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %140, i32 0, i32 1 store i32 30, i32* %142, align 4 %143 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %140, i32 0, i32 2 store i32 13, i32* %143, align 4 %144 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %140, i32 0, i32 3 store i32 30, i32* %144, align 4 %145 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %140, i32 0, i32 4 store i32 21, i32* %145, align 4 %146 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @22, i32 0, i32 0)) %147 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %138, i32 0, i32 0 %148 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %139, i32 0, i32 0 %149 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %147, i32 0, i32 2 %150 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %147, i32 0, i32 0 store i1 true, i1* %150, align 1 %151 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %147, i32 0, i32 1 store i8* %146, i8** %151, align 8 store { i8*, i32, i32, i32, i32 }* %148, { i8*, i32, i32, i32, i32 }** %149, align 8 %152 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %147, i32 0, i32 3 store i32 1, i32* %152, align 4 %153 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %138, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %153, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @23, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @20, i32 0, i32 0), i64 %131, i32 1, i64 1, i64 500) call void @exit(i32 1) unreachable ifcont45: ; preds = %loop.body43 %154 = getelementptr [500 x float], [500 x float]* %120, i32 0, i64 %134 %155 = call float @_lcompilers_real_i32(i32* %i) store float %155, float* %154, align 4 br label %loop.head42 loop.end46: ; preds = %loop.head42 %156 = load float, float* %sum, align 4 br i1 false, label %then47, label %ifcont48 then47: ; preds = %loop.end46 %157 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %158 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %159 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %158, i32 0, i32 0 %160 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %159, i32 0, i32 0 store i8* getelementptr inbounds ([42 x i8], [42 x i8]* @25, i32 0, i32 0), i8** %160, align 8 %161 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %159, i32 0, i32 1 store i32 31, i32* %161, align 4 %162 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %159, i32 0, i32 2 store i32 25, i32* %162, align 4 %163 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %159, i32 0, i32 3 store i32 31, i32* %163, align 4 %164 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %159, i32 0, i32 4 store i32 36, i32* %164, align 4 %165 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @26, i32 0, i32 0)) %166 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %157, i32 0, i32 0 %167 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %158, i32 0, i32 0 %168 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %166, i32 0, i32 2 %169 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %166, i32 0, i32 0 store i1 true, i1* %169, align 1 %170 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %166, i32 0, i32 1 store i8* %165, i8** %170, align 8 store { i8*, i32, i32, i32, i32 }* %167, { i8*, i32, i32, i32, i32 }** %168, align 8 %171 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %166, i32 0, i32 3 store i32 1, i32* %171, align 4 %172 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %157, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %172, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @27, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @24, i32 0, i32 0), i64 1, i32 1, i64 1, i64 500) call void @exit(i32 1) unreachable ifcont48: ; preds = %loop.end46 %173 = getelementptr [500 x float], [500 x float]* %120, i32 0, i64 0 %174 = load float, float* %173, align 4 %175 = fadd float %156, %174 store float %175, float* %sum, align 4 br label %block.end block.end: ; preds = %ifcont48 br label %FINALIZE_SYMTABLE_block FINALIZE_SYMTABLE_block: ; preds = %block.end %176 = icmp eq i8* %119, null br i1 %176, label %free_done, label %free_nonnull free_nonnull: ; preds = %FINALIZE_SYMTABLE_block call void @_lfortran_free_alloc(i8* %2, i8* %119) br label %free_done free_done: ; preds = %free_nonnull, %FINALIZE_SYMTABLE_block call void @llvm.stackrestore(i8* %117) br label %loop.head30 loop.end49: ; preds = %loop.head30 %177 = load float, float* %sum, align 4 %178 = fsub float %177, 5.005000e+05 %179 = call float @llvm.fabs.f32(float %178) %180 = fcmp ogt float %179, 0x3FB99999A0000000 br i1 %180, label %then50, label %else51 then50: ; preds = %loop.end49 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @29, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @28, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont52 else51: ; preds = %loop.end49 br label %ifcont52 ifcont52: ; preds = %else51, %then50 %181 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @31, i32 0, i32 0), i8* %181, i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0), i32 1) br label %return return: ; preds = %ifcont52 br label %FINALIZE_SYMTABLE_static_large_array FINALIZE_SYMTABLE_static_large_array: ; preds = %return %182 = icmp eq i8* %4, null br i1 %182, label %free_done54, label %free_nonnull53 free_nonnull53: ; preds = %FINALIZE_SYMTABLE_static_large_array call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done54 free_done54: ; preds = %free_nonnull53, %FINALIZE_SYMTABLE_static_large_array call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc_alloc(i8*, i64) declare i8* @_lfortran_get_default_allocator() declare i8* @_lcompilers_snprintf_alloc(i8*, i8*, ...) declare void @_lcompilers_runtime_error(i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) declare void @exit(i32) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() ; Function Attrs: nounwind declare i8* @llvm.stacksave() #0 declare void @_lfortran_free_alloc(i8*, i8*) ; Function Attrs: nounwind declare void @llvm.stackrestore(i8*) #0 ; Function Attrs: nounwind readnone speculatable willreturn declare float @llvm.fabs.f32(float) #1 declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) attributes #0 = { nounwind } attributes #1 = { nounwind readnone speculatable willreturn } lfortran-0.63.0/tests/reference/asr-continue_compilation_ff_2-9ba55e7.stderr0000664000175000017500000000027315174404631027127 0ustar alastairalastairtokenizer error: Expecting contains keyword before procedure definition --> tests/errors/continue_compilation_ff_2.f:3:7 | 3 | SUBROUTINE faulty_subroutine(a, b, c) | ^ lfortran-0.63.0/tests/reference/ast-fixed_form5-66fddbd.json0000664000175000017500000000074115174404631024026 0ustar alastairalastair{ "basename": "ast-fixed_form5-66fddbd", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form5.f", "infile_hash": "a40b468e72a8562746dc8711312f496a7635144b26f7cfca248cb16e", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form5-66fddbd.stdout", "stdout_hash": "2440a38ffa8af1e22b1ad974a551f85538dfa9bdeac0a333d0798817", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-subroutines_04-c6808b6.json0000664000175000017500000000075515174404631024607 0ustar alastairalastair{ "basename": "julia-subroutines_04-c6808b6", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/subroutines_04.f90", "infile_hash": "c7f14f3cfe8c42ebbf006f4e20a30b517c9e2775e5af0f8853ae05e1", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutines_04-c6808b6.stdout", "stdout_hash": "f1ab22a6c4a89d1dc7cfb972058622e224439bc1b109e78520e02e9c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/obj-program1-785a609.json0000664000175000017500000000056515174404631023042 0ustar alastairalastair{ "basename": "obj-program1-785a609", "cmd": "lfortran --no-color -c {infile} -o output.o", "infile": "tests/program1.f90", "infile_hash": "ec4ccdfed01d45648718ca57a9ceb3e5aa82e55e57d8906636902e7b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-const_kind_02-7c339b9.stdout0000664000175000017500000001533415174404631024412 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { const_kind_02: (Program (SymbolTable 2 { i1: (Variable 2 i1 [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i2: (Variable 2 i2 [] Local (IntegerConstant 1 (Integer 8) Decimal) (IntegerConstant 1 (Integer 8) Decimal) Parameter (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i3: (Variable 2 i3 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), int32: (Variable 2 int32 [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), int64: (Variable 2 int64 [] Local (IntegerConstant 8 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) const_kind_02 [] [(Assignment (Var 2 i3) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i3) (Cast (IntegerConstant 1 (Integer 8) Decimal) IntegerToInteger (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 int32) (Var 2 int64) (Var 2 i1) (Var 2 i2) (Var 2 i3)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_error_09-8d590f9.json0000664000175000017500000000075715174404631024751 0ustar alastairalastair{ "basename": "asr-template_error_09-8d590f9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_09.f90", "infile_hash": "773f4dded8e565f02f43e0b053439728820619a5f8d225f2badc429e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_09-8d590f9.stderr", "stderr_hash": "126101c2d657ed18e2d1e2362f8fec3a618565917fa77fd78e5c61d5", "returncode": 2 }lfortran-0.63.0/tests/reference/asr_preprocess-unterminated_if_01-6989548.stderr0000664000175000017500000000015115174404631027525 0ustar alastairalastairC preprocessor error: Unterminated #if --> tests/errors/unterminated_if_01.f90:1:1 | 1 | #if a | ^ lfortran-0.63.0/tests/reference/pass_nested_vars-nested_call_filter_01-5a87413.json0000664000175000017500000000106615174404631030213 0ustar alastairalastair{ "basename": "pass_nested_vars-nested_call_filter_01-5a87413", "cmd": "lfortran --pass=nested_vars --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_call_filter_01.f90", "infile_hash": "8cec6df4b177816ae0e3fe2e6e58db32e27ffa4afb6640cbeabd017e", "outfile": null, "outfile_hash": null, "stdout": "pass_nested_vars-nested_call_filter_01-5a87413.stdout", "stdout_hash": "de546ec78f4c8f982792791dd38b758f889ed1e569062feaec1f926b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-rewind_invalid_kwarg1-54e2b4f.stderr0000664000175000017500000000023515174404631026253 0ustar alastairalastairsemantic error: Invalid argument `end` supplied --> tests/errors/rewind_invalid_kwarg1.f90:3:5 | 3 | rewind(end="world") | ^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-implied_do_loops2-98464d0.json0000664000175000017500000000077515174404631024732 0ustar alastairalastair{ "basename": "asr-implied_do_loops2-98464d0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/implied_do_loops2.f90", "infile_hash": "52395150c001e73afe37bfe9d3ea099d5e75e2704bd1733457496ad2", "outfile": null, "outfile_hash": null, "stdout": "asr-implied_do_loops2-98464d0.stdout", "stdout_hash": "f34e4f61d11880c35fc6cccacf197553f6aa3f76b709a8caeeb76a1a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-case_05-0476e14.stdout0000664000175000017500000000065515174404631023564 0ustar alastairalastairprogram case_05 implicit none ! local variable declaration character :: grade = "B" select case (grade) case ("A") print *, "Excellent!" case ("B") case ("C") print *, "Well done" case ("D") print *, "You passed" case ("F") print *, "Better try again" case default print *, "Invalid grade" end select print *, "Your grade is ", grade end program case_05 lfortran-0.63.0/tests/reference/asr-derived_types_07-c5a29e3.json0000664000175000017500000000074515174404631024631 0ustar alastairalastair{ "basename": "asr-derived_types_07-c5a29e3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/derived_types_07.f90", "infile_hash": "1113bb8810a8cabbaa2deaee33aa216082f6086f7cc9b8b2f34fd466", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_07-c5a29e3.stdout", "stdout_hash": "7bd7b41f4b3d215bc03ad68a835e5bbc08ddb34aca74a36a189f1309", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-derived_types_03-1824805.json0000664000175000017500000000100515174404631025053 0ustar alastairalastair{ "basename": "ast_f90-derived_types_03-1824805", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/derived_types_03.f90", "infile_hash": "fd0a87db249f310cd20a90b39d5eb4627597acf774b62bdb8c4256c4", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-derived_types_03-1824805.stdout", "stdout_hash": "8f12723d8d2fb1e4c6890b2db2487fc67677b2fe12564be64ec454b9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-string_03-bda189f.stdout0000664000175000017500000000074515174404631024401 0ustar alastairalastairmodule string_03_mod implicit none character(len=5), parameter :: intro = "I've " end module string_03_mod program string_03 use string_03_mod, only: intro implicit none character(len=8) :: verb character(len=5) :: posit character(len=4) :: title character(len=7) :: last_name character(len=29) :: combined verb = "learned " posit = "from " title = "the " last_name = "best" combined = intro // verb // posit // title // last_name // "." print *, combined end program string_03 lfortran-0.63.0/tests/reference/llvm-complex_dp_param-5efce36.json0000664000175000017500000000077515174404631025244 0ustar alastairalastair{ "basename": "llvm-complex_dp_param-5efce36", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_dp_param.f90", "infile_hash": "0d4d9eaf5bcc2cee6a8b57ee6a66b5a10ced2edf6d64b5d2e2a0bcb8", "outfile": null, "outfile_hash": null, "stdout": "llvm-complex_dp_param-5efce36.stdout", "stdout_hash": "aa6de0c128626de468525684391f07ca3f513daba639c2463704e61a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-program1-5e4637e.stdout0000664000175000017500000000126215174404631023475 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t i; i = 5; std::cout << i << std::endl; std::cout << i + 1 << std::endl; } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/tokens-subroutine1-c249ad5.json0000664000175000017500000000073715174404631024454 0ustar alastairalastair{ "basename": "tokens-subroutine1-c249ad5", "cmd": "lfortran --no-color --show-tokens {infile} -o {outfile}", "infile": "tests/subroutine1.f90", "infile_hash": "e209c22328b423e75d6801f3c0ef19bc120936196435dff2cb19df31", "outfile": null, "outfile_hash": null, "stdout": "tokens-subroutine1-c249ad5.stdout", "stdout_hash": "e48e3d92e7b293dcc3b2c28a10054c5191a8c2bda04d3a63a8c1b50e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-rewind_invalid_kwarg1-54e2b4f.json0000664000175000017500000000077315174404631025730 0ustar alastairalastair{ "basename": "asr-rewind_invalid_kwarg1-54e2b4f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/rewind_invalid_kwarg1.f90", "infile_hash": "1a5966a45bdcff87457415865fdeba35d60b85be63db448a4c1203c9", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-rewind_invalid_kwarg1-54e2b4f.stderr", "stderr_hash": "e0c4f2ddc1407c75eeb039d0ad31c950720cdc8effb8614a4fe7ce51", "returncode": 2 }lfortran-0.63.0/tests/reference/run-implied_do_loop3-52d2c18.stdout0000664000175000017500000000005015174404631025170 0ustar alastairalastairHello Hello Hello HHH Hello Hello Hello lfortran-0.63.0/tests/reference/ast-sole_intrinsic-1ce1e44.stdout0000664000175000017500000000463115174404631025045 0ustar alastairalastair(TranslationUnit [(Program main () [] [] [(Declaration () [(SimpleAttribute AttrIntrinsic )] [(aimag [] [] () () None ()) (cmplx [] [] () () None ()) (real [] [] () () None ())] () ) (Declaration (AttrType TypeComplex [] () () None ) [] [(f [] [] () () None ())] () ) (Declaration (AttrType TypeComplex [] () () None ) [] [(x [] [] () (Complex (Real "1.0") (u- (Real "3.0"))) Equal ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(y [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrIntrinsic )] [(mod [] [] () () None ())] () )] [(Assignment 0 f (FuncCallOrArray cmplx [] [(() 3 () 0) (() 1 () 0)] [] [] [] ) () ) (Assignment 0 y (FuncCallOrArray aimag [] [(() x () 0)] [] [] [] ) () )] [] )] ) lfortran-0.63.0/tests/reference/ast-selectrank1-5d08637.stdout0000664000175000017500000001310715174404631024105 0ustar alastairalastair(TranslationUnit [(Subroutine process [(x)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [] [(x [(() () AssumedRank)] [] () () None ())] () )] [(SelectRank 0 () () x [(RankExpr 0 () [(Assignment 0 x 0 () )] ) (RankExpr 2 () [(If 0 () (>= (FuncCallOrArray size [] [(() x () 0) (() 2 () 0)] [] [] [] ) 2) [(Assignment 0 (FuncCallOrArray x [] [(() () 1 0) (() 2 () 0)] [] [] [] ) 2 () )] [] () () () )] ) (RankDefault () [(Print 0 () [(String "i did not expect rank" ()) (FuncCallOrArray rank [] [(() x () 0)] [] [] [] ) (String "shape" ()) (FuncCallOrArray shape [] [(() x () 0)] [] [] [] )] () ) (ErrorStop 0 (String "process bad arg" ()) () () )] )] () () ) (Return 0 () () )] [] [] ) (Subroutine initialize [(arg) (size)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrContiguous )] [(arg [(() () AssumedRank)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(size [] [] () () None ()) (i [] [] () () None ())] () )] [(SelectRank 0 () () arg [(RankExpr 0 (TriviaNode [] [(EOLComment "! special case the scalar case" )] ) [(Assignment 0 arg (Real "0.0") () )] ) (RankStar () [(DoLoop 0 () 0 i 1 size () [(Assignment 0 (FuncCallOrArray arg [] [(() i () 0)] [] [] [] ) (Real "0.0") () )] () () )] )] () () ) (Return 0 () () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-template_sort_02-0aa4518.stdout0000664000175000017500000106220715174404631025123 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_sort_02: (Program (SymbolTable 16 { lt_integer: (ExternalSymbol 16 lt_integer 5 lt_integer template_sort_02_m [] lt_integer Public ), lt_my_type: (ExternalSymbol 16 lt_my_type 2 lt_my_type template_sort_02_type [] lt_my_type Public ), lt_real: (ExternalSymbol 16 lt_real 5 lt_real template_sort_02_m [] lt_real Public ), my_type: (ExternalSymbol 16 my_type 2 my_type template_sort_02_type [] my_type Public ), op_r: (ExternalSymbol 16 op_r 5 op_r template_sort_02_m [] op_r Public ), quicksort: (ExternalSymbol 16 quicksort 5 quicksort template_sort_02_m [] quicksort Public ), swap: (ExternalSymbol 16 swap 5 swap template_sort_02_m [] swap Public ), test_template: (ExternalSymbol 16 test_template 5 test_template template_sort_02_m [] test_template Public ) }) template_sort_02 [template_sort_02_m template_sort_02_type] [(SubroutineCall 16 test_template () [] () .false. )] ), template_sort_02_m: (Module (SymbolTable 5 { lt_integer: (Function (SymbolTable 14 { lhs: (Variable 14 lhs [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 14 res [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 14 rhs [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) lt_integer (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 14 lhs) (Var 14 rhs)] [(Assignment (Var 14 res) (IntegerCompare (Var 14 lhs) Lt (Var 14 rhs) (Logical 4) () ) () .false. .false. )] (Var 14 res) Public .true. .true. () ), lt_my_type: (ExternalSymbol 5 lt_my_type 2 lt_my_type template_sort_02_type [] lt_my_type Public ), lt_real: (Function (SymbolTable 13 { lhs: (Variable 13 lhs [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 13 res [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 13 rhs [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) lt_real (FunctionType [(Real 4) (Real 4)] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 13 lhs) (Var 13 rhs)] [(Assignment (Var 13 res) (RealCompare (Var 13 lhs) Lt (Var 13 rhs) (Logical 4) () ) () .false. .false. )] (Var 13 res) Public .true. .true. () ), my_type: (ExternalSymbol 5 my_type 2 my_type template_sort_02_type [] my_type Public ), op_r: (Requirement (SymbolTable 6 { op_func: (Function (SymbolTable 7 { lhs: (Variable 7 lhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 7 res [] ReturnVar () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 7 rhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) op_func (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter v ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 7 lhs) (Var 7 rhs)] [] (Var 7 res) Public .true. .true. () ), t: (Variable 6 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u: (Variable 6 u [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 6 v [] In () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) op_r [t u v op_func] [] ), quicksort: (Template (SymbolTable 10 { __instantiated_swap: (Function (SymbolTable 17 { lhs: (Variable 17 lhs [] InOut () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 17 rhs [] InOut () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 17 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 17 tmp [] Local () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __instantiated_swap (FunctionType [(TypeParameter t ) (TypeParameter t )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 lhs) (Var 17 rhs)] [(Assignment (Var 17 tmp) (Var 17 lhs) () .false. .false. ) (Assignment (Var 17 lhs) (Var 17 rhs) () .false. .false. ) (Assignment (Var 17 rhs) (Var 17 tmp) () .false. .false. )] () Public .true. .true. () ), __instantiated_swap1: (Function (SymbolTable 18 { lhs: (Variable 18 lhs [] InOut () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 18 rhs [] InOut () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 18 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 18 tmp [] Local () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __instantiated_swap1 (FunctionType [(TypeParameter t ) (TypeParameter t )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 18 lhs) (Var 18 rhs)] [(Assignment (Var 18 tmp) (Var 18 lhs) () .false. .false. ) (Assignment (Var 18 lhs) (Var 18 rhs) () .false. .false. ) (Assignment (Var 18 rhs) (Var 18 tmp) () .false. .false. )] () Public .true. .true. () ), logical: (Variable 10 logical [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lt: (Function (SymbolTable 11 { lhs: (Variable 11 lhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 11 res [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 11 rhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) lt (FunctionType [(TypeParameter t ) (TypeParameter t )] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 11 lhs) (Var 11 rhs)] [] (Var 11 res) Public .true. .true. () ), quicksort: (Function (SymbolTable 12 { arr: (Variable 12 arr [] InOut () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), high: (Variable 12 high [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 12 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), last: (Variable 12 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), low: (Variable 12 low [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pivot: (Variable 12 pivot [] Local () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) quicksort (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray ) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [lt __instantiated_swap __instantiated_swap1 quicksort] [(Var 12 arr) (Var 12 low) (Var 12 high)] [(If () (IntegerCompare (Var 12 low) Lt (Var 12 high) (Logical 4) () ) [(Assignment (Var 12 pivot) (ArrayItem (Var 12 arr) [(() (Var 12 high) ())] (TypeParameter t ) ColMajor () ) () .false. .false. ) (Assignment (Var 12 last) (IntegerBinOp (Var 12 low) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (DoLoop () ((Var 12 i) (Var 12 low) (IntegerBinOp (Var 12 high) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(If () (FunctionCall 10 lt () [((ArrayItem (Var 12 arr) [(() (Var 12 i) ())] (TypeParameter t ) ColMajor () )) ((Var 12 pivot))] (Logical 4) () () ) [(Assignment (Var 12 last) (IntegerBinOp (Var 12 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 10 __instantiated_swap () [((ArrayItem (Var 12 arr) [(() (Var 12 last) ())] (TypeParameter t ) ColMajor () )) ((ArrayItem (Var 12 arr) [(() (Var 12 i) ())] (TypeParameter t ) ColMajor () ))] () .false. )] [] )] [] ) (SubroutineCall 10 __instantiated_swap1 () [((ArrayItem (Var 12 arr) [(() (IntegerBinOp (Var 12 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (TypeParameter t ) ColMajor () )) ((ArrayItem (Var 12 arr) [(() (Var 12 high) ())] (TypeParameter t ) ColMajor () ))] () .false. ) (SubroutineCall 10 quicksort () [((ArrayPhysicalCast (Var 12 arr) DescriptorArray DescriptorArray (Array (TypeParameter t ) [(() ())] DescriptorArray ) () )) ((Var 12 low)) ((Var 12 last))] () .false. ) (SubroutineCall 10 quicksort () [((ArrayPhysicalCast (Var 12 arr) DescriptorArray DescriptorArray (Array (TypeParameter t ) [(() ())] DescriptorArray ) () )) ((IntegerBinOp (Var 12 last) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((Var 12 high))] () .false. )] [] )] () Public .true. .true. () ), t: (Variable 10 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) quicksort [t lt] [(Require op_r [t logical lt] )] ), swap: (Template (SymbolTable 8 { swap: (Function (SymbolTable 9 { lhs: (Variable 9 lhs [] InOut () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 9 rhs [] InOut () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 9 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 9 tmp [] Local () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) swap (FunctionType [(TypeParameter t ) (TypeParameter t )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 lhs) (Var 9 rhs)] [(Assignment (Var 9 tmp) (Var 9 lhs) () .false. .false. ) (Assignment (Var 9 lhs) (Var 9 rhs) () .false. .false. ) (Assignment (Var 9 rhs) (Var 9 tmp) () .false. .false. )] () Public .true. .true. () ), t: (Variable 8 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) swap [t] [] ), test_template: (Function (SymbolTable 15 { __asr___instantiated_swap: (Function (SymbolTable 20 { lhs: (Variable 20 lhs [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 20 rhs [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 20 t [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 20 tmp [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __asr___instantiated_swap (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 lhs) (Var 20 rhs)] [(Assignment (Var 20 tmp) (Var 20 lhs) () .false. .false. ) (Assignment (Var 20 lhs) (Var 20 rhs) () .false. .false. ) (Assignment (Var 20 rhs) (Var 20 tmp) () .false. .false. )] () Public .true. .true. () ), __asr___instantiated_swap1: (Function (SymbolTable 21 { lhs: (Variable 21 lhs [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 21 rhs [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 21 t [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 21 tmp [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __asr___instantiated_swap1 (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 21 lhs) (Var 21 rhs)] [(Assignment (Var 21 tmp) (Var 21 lhs) () .false. .false. ) (Assignment (Var 21 lhs) (Var 21 rhs) () .false. .false. ) (Assignment (Var 21 rhs) (Var 21 tmp) () .false. .false. )] () Public .true. .true. () ), __asr___instantiated_swap11: (Function (SymbolTable 24 { lhs: (Variable 24 lhs [] InOut () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 24 rhs [] InOut () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 24 t [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 24 tmp [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __asr___instantiated_swap11 (FunctionType [(Real 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 24 lhs) (Var 24 rhs)] [(Assignment (Var 24 tmp) (Var 24 lhs) () .false. .false. ) (Assignment (Var 24 lhs) (Var 24 rhs) () .false. .false. ) (Assignment (Var 24 rhs) (Var 24 tmp) () .false. .false. )] () Public .true. .true. () ), __asr___instantiated_swap12: (Function (SymbolTable 27 { lhs: (Variable 27 lhs [] InOut () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 27 rhs [] InOut () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 27 t [] In () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 27 tmp [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __asr___instantiated_swap12 (FunctionType [(StructType [(Real 4)] [] .true. .false. ) (StructType [(Real 4)] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 27 lhs) (Var 27 rhs)] [(Assignment (Var 27 tmp) (Var 27 lhs) () .false. .false. ) (Assignment (Var 27 lhs) (Var 27 rhs) () .false. .false. ) (Assignment (Var 27 rhs) (Var 27 tmp) () .false. .false. )] () Public .true. .true. () ), __asr___instantiated_swap2: (Function (SymbolTable 23 { lhs: (Variable 23 lhs [] InOut () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 23 rhs [] InOut () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 23 t [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 23 tmp [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __asr___instantiated_swap2 (FunctionType [(Real 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 23 lhs) (Var 23 rhs)] [(Assignment (Var 23 tmp) (Var 23 lhs) () .false. .false. ) (Assignment (Var 23 lhs) (Var 23 rhs) () .false. .false. ) (Assignment (Var 23 rhs) (Var 23 tmp) () .false. .false. )] () Public .true. .true. () ), __asr___instantiated_swap3: (Function (SymbolTable 26 { lhs: (Variable 26 lhs [] InOut () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 26 rhs [] InOut () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 26 t [] In () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 26 tmp [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __asr___instantiated_swap3 (FunctionType [(StructType [(Real 4)] [] .true. .false. ) (StructType [(Real 4)] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 26 lhs) (Var 26 rhs)] [(Assignment (Var 26 tmp) (Var 26 lhs) () .false. .false. ) (Assignment (Var 26 lhs) (Var 26 rhs) () .false. .false. ) (Assignment (Var 26 rhs) (Var 26 tmp) () .false. .false. )] () Public .true. .true. () ), __instantiated_quicksort: (Function (SymbolTable 19 { arr: (Variable 19 arr [] InOut () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), high: (Variable 19 high [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 19 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), last: (Variable 19 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), low: (Variable 19 low [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pivot: (Variable 19 pivot [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __instantiated_quicksort (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray ) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [lt_integer __asr___instantiated_swap __asr___instantiated_swap1 __instantiated_quicksort] [(Var 19 arr) (Var 19 low) (Var 19 high)] [(If () (IntegerCompare (Var 19 low) Lt (Var 19 high) (Logical 4) () ) [(Assignment (Var 19 pivot) (ArrayItem (Var 19 arr) [(() (Var 19 high) ())] (Integer 4) ColMajor () ) () .false. .false. ) (Assignment (Var 19 last) (IntegerBinOp (Var 19 low) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (DoLoop () ((Var 19 i) (Var 19 low) (IntegerBinOp (Var 19 high) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(If () (FunctionCall 5 lt_integer () [((ArrayItem (Var 19 arr) [(() (Var 19 i) ())] (Integer 4) ColMajor () )) ((Var 19 pivot))] (Logical 4) () () ) [(Assignment (Var 19 last) (IntegerBinOp (Var 19 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 15 __asr___instantiated_swap () [((ArrayItem (Var 19 arr) [(() (Var 19 last) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 19 arr) [(() (Var 19 i) ())] (Integer 4) ColMajor () ))] () .false. )] [] )] [] ) (SubroutineCall 15 __asr___instantiated_swap1 () [((ArrayItem (Var 19 arr) [(() (IntegerBinOp (Var 19 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 19 arr) [(() (Var 19 high) ())] (Integer 4) ColMajor () ))] () .false. ) (SubroutineCall 15 __instantiated_quicksort () [((ArrayPhysicalCast (Var 19 arr) DescriptorArray DescriptorArray (Array (Integer 4) [(() ())] DescriptorArray ) () )) ((Var 19 low)) ((Var 19 last))] () .false. ) (SubroutineCall 15 __instantiated_quicksort () [((ArrayPhysicalCast (Var 19 arr) DescriptorArray DescriptorArray (Array (Integer 4) [(() ())] DescriptorArray ) () )) ((IntegerBinOp (Var 19 last) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((Var 19 high))] () .false. )] [] )] () Public .true. .true. () ), __instantiated_quicksort1: (Function (SymbolTable 22 { arr: (Variable 22 arr [] InOut () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), high: (Variable 22 high [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 22 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), last: (Variable 22 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), low: (Variable 22 low [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pivot: (Variable 22 pivot [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __instantiated_quicksort1 (FunctionType [(Array (Real 4) [(() ())] DescriptorArray ) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [lt_real __asr___instantiated_swap2 __asr___instantiated_swap11 __instantiated_quicksort1] [(Var 22 arr) (Var 22 low) (Var 22 high)] [(If () (IntegerCompare (Var 22 low) Lt (Var 22 high) (Logical 4) () ) [(Assignment (Var 22 pivot) (ArrayItem (Var 22 arr) [(() (Var 22 high) ())] (Real 4) ColMajor () ) () .false. .false. ) (Assignment (Var 22 last) (IntegerBinOp (Var 22 low) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (DoLoop () ((Var 22 i) (Var 22 low) (IntegerBinOp (Var 22 high) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(If () (FunctionCall 5 lt_real () [((ArrayItem (Var 22 arr) [(() (Var 22 i) ())] (Real 4) ColMajor () )) ((Var 22 pivot))] (Logical 4) () () ) [(Assignment (Var 22 last) (IntegerBinOp (Var 22 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 15 __asr___instantiated_swap2 () [((ArrayItem (Var 22 arr) [(() (Var 22 last) ())] (Real 4) ColMajor () )) ((ArrayItem (Var 22 arr) [(() (Var 22 i) ())] (Real 4) ColMajor () ))] () .false. )] [] )] [] ) (SubroutineCall 15 __asr___instantiated_swap11 () [((ArrayItem (Var 22 arr) [(() (IntegerBinOp (Var 22 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 4) ColMajor () )) ((ArrayItem (Var 22 arr) [(() (Var 22 high) ())] (Real 4) ColMajor () ))] () .false. ) (SubroutineCall 15 __instantiated_quicksort1 () [((ArrayPhysicalCast (Var 22 arr) DescriptorArray DescriptorArray (Array (Real 4) [(() ())] DescriptorArray ) () )) ((Var 22 low)) ((Var 22 last))] () .false. ) (SubroutineCall 15 __instantiated_quicksort1 () [((ArrayPhysicalCast (Var 22 arr) DescriptorArray DescriptorArray (Array (Real 4) [(() ())] DescriptorArray ) () )) ((IntegerBinOp (Var 22 last) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((Var 22 high))] () .false. )] [] )] () Public .true. .true. () ), __instantiated_quicksort2: (Function (SymbolTable 25 { arr: (Variable 25 arr [] InOut () () Default (Array (StructType [(Real 4)] [] .true. .false. ) [(() ())] DescriptorArray ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), high: (Variable 25 high [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 25 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), last: (Variable 25 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), low: (Variable 25 low [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pivot: (Variable 25 pivot [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __instantiated_quicksort2 (FunctionType [(Array (StructType [(Real 4)] [] .true. .false. ) [(() ())] DescriptorArray ) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [__asr___instantiated_swap3 __asr___instantiated_swap12 __instantiated_quicksort2] [(Var 25 arr) (Var 25 low) (Var 25 high)] [(If () (IntegerCompare (Var 25 low) Lt (Var 25 high) (Logical 4) () ) [(Assignment (Var 25 pivot) (ArrayItem (Var 25 arr) [(() (Var 25 high) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () ) () .false. .false. ) (Assignment (Var 25 last) (IntegerBinOp (Var 25 low) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (DoLoop () ((Var 25 i) (Var 25 low) (IntegerBinOp (Var 25 high) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(If () (FunctionCall 5 lt_my_type () [((ArrayItem (Var 25 arr) [(() (Var 25 i) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () )) ((Var 25 pivot))] (Logical 4) () () ) [(Assignment (Var 25 last) (IntegerBinOp (Var 25 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 15 __asr___instantiated_swap3 () [((ArrayItem (Var 25 arr) [(() (Var 25 last) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () )) ((ArrayItem (Var 25 arr) [(() (Var 25 i) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () ))] () .false. )] [] )] [] ) (SubroutineCall 15 __asr___instantiated_swap12 () [((ArrayItem (Var 25 arr) [(() (IntegerBinOp (Var 25 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () )) ((ArrayItem (Var 25 arr) [(() (Var 25 high) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () ))] () .false. ) (SubroutineCall 15 __instantiated_quicksort2 () [((ArrayPhysicalCast (Var 25 arr) DescriptorArray DescriptorArray (Array (StructType [(Real 4)] [] .true. .false. ) [(() ())] DescriptorArray ) () )) ((Var 25 low)) ((Var 25 last))] () .false. ) (SubroutineCall 15 __instantiated_quicksort2 () [((ArrayPhysicalCast (Var 25 arr) DescriptorArray DescriptorArray (Array (StructType [(Real 4)] [] .true. .false. ) [(() ())] DescriptorArray ) () )) ((IntegerBinOp (Var 25 last) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((Var 25 high))] () .false. )] [] )] () Public .true. .true. () ), i: (Variable 15 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), xi: (Variable 15 xi [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), xm: (Variable 15 xm [] Local () () Default (Array (StructType [(Real 4)] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), xr: (Variable 15 xr [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 15 xi) (ArrayConstant 40 [2, 4, 1, ...., 3, 42, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 15 xr) (ArrayConstant 40 [2.00000000e+00, 4.00000000e+00, 1.00000000e+00, ...., 3.00000000e+00, 4.20000000e+01, 2.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (DoLoop () ((Var 15 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 15 xm) [(() (Var 15 i) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () ) (StructConstructor 5 my_type [((ArrayItem (Var 15 xr) [(() (Var 15 i) ())] (Real 4) ColMajor () ))] (StructType [(Real 4)] [] .true. .false. ) () ) () .false. .false. )] [] ) (SubroutineCall 15 __instantiated_quicksort () [((ArrayPhysicalCast (Var 15 xi) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )) ((IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 10 (Integer 4) Decimal))] () .false. ) (SubroutineCall 15 __instantiated_quicksort1 () [((ArrayPhysicalCast (Var 15 xr) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )) ((IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 10 (Integer 4) Decimal))] () .false. ) (SubroutineCall 15 __instantiated_quicksort2 () [((ArrayPhysicalCast (Var 15 xm) FixedSizeArray DescriptorArray (Array (StructType [(Real 4)] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )) ((IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 10 (Integer 4) Decimal))] () .false. ) (Print (StringFormat () [(Var 15 xi)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 15 xr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 15 xm)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_sort_02_m () [template_sort_02_type template_sort_02_m] .false. .false. .false. ), template_sort_02_type: (Module (SymbolTable 2 { lt_my_type: (Function (SymbolTable 4 { 1_my_type_d: (ExternalSymbol 4 1_my_type_d 3 d my_type [] d Public ), lhs: (Variable 4 lhs [] In () () Default (StructType [(Real 4)] [] .true. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 4 res [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 4 rhs [] In () () Default (StructType [(Real 4)] [] .true. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) lt_my_type (FunctionType [(StructType [(Real 4)] [] .true. .false. ) (StructType [(Real 4)] [] .true. .false. )] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 4 lhs) (Var 4 rhs)] [(Assignment (Var 4 res) (RealCompare (StructInstanceMember (Var 4 lhs) 4 1_my_type_d (Real 4) () ) LtE (StructInstanceMember (Var 4 rhs) 4 1_my_type_d (Real 4) () ) (Logical 4) () ) () .false. .false. )] (Var 4 res) Public .true. .true. () ), my_type: (Struct (SymbolTable 3 { d: (Variable 3 d [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) my_type (StructType [(Real 4)] [] .true. .false. ) [] [d] [] Source Public .false. .false. [] () () [] ) }) template_sort_02_type () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/llvm-doloop_03-d4372bd.stdout0000664000175000017500000003031115174404631023777 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc29 = alloca %string_descriptor, align 8 %stringFormat_desc17 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %j = alloca i32, align 4 store i32 0, i32* %j, align 4 store i32 0, i32* %i, align 4 br label %loop.head loop.head: ; preds = %ifcont3, %.entry %3 = load i32, i32* %i, align 4 %4 = add i32 %3, 1 %5 = icmp sle i32 %4, 10 br i1 %5, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %6 = load i32, i32* %i, align 4 %7 = add i32 %6, 1 store i32 %7, i32* %i, align 4 %8 = load i32, i32* %j, align 4 %9 = load i32, i32* %i, align 4 %10 = add i32 %8, %9 store i32 %10, i32* %j, align 4 %11 = load i32, i32* %i, align 4 %12 = icmp eq i32 %11, 3 br i1 %12, label %then, label %else then: ; preds = %loop.body br label %ifcont else: ; preds = %loop.body br label %ifcont ifcont: ; preds = %else, %then %13 = load i32, i32* %i, align 4 %14 = icmp eq i32 %13, 2 br i1 %14, label %then1, label %else2 then1: ; preds = %ifcont br label %loop.end unreachable_after_exit: ; No predecessors! br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %unreachable_after_exit br label %loop.head loop.end: ; preds = %then1, %loop.head %15 = load i32, i32* %j, align 4 %16 = icmp ne i32 %15, 3 br i1 %16, label %then4, label %else5 then4: ; preds = %loop.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont6 else5: ; preds = %loop.end br label %ifcont6 ifcont6: ; preds = %else5, %then4 %17 = alloca i64, align 8 %18 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %17, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %19 = load i64, i64* %17, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %18, i8** %20, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %19, i64* %21, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %23 = load i8*, i8** %22, align 8 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %25 = load i64, i64* %24, align 8 %26 = trunc i64 %25 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %23, i32 %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %27 = icmp eq i8* %18, null br i1 %27, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont6 call void @_lfortran_free_alloc(i8* %2, i8* %18) br label %free_done free_done: ; preds = %free_nonnull, %ifcont6 store i32 0, i32* %j, align 4 store i32 0, i32* %i, align 4 br label %loop.head7 loop.head7: ; preds = %ifcont12, %free_done %28 = load i32, i32* %i, align 4 %29 = add i32 %28, 1 %30 = icmp sle i32 %29, 10 br i1 %30, label %loop.body8, label %loop.end13 loop.body8: ; preds = %loop.head7 %31 = load i32, i32* %i, align 4 %32 = add i32 %31, 1 store i32 %32, i32* %i, align 4 %33 = load i32, i32* %i, align 4 %34 = icmp eq i32 %33, 2 br i1 %34, label %then9, label %else11 then9: ; preds = %loop.body8 br label %loop.end13 unreachable_after_exit10: ; No predecessors! br label %ifcont12 else11: ; preds = %loop.body8 br label %ifcont12 ifcont12: ; preds = %else11, %unreachable_after_exit10 %35 = load i32, i32* %j, align 4 %36 = load i32, i32* %i, align 4 %37 = add i32 %35, %36 store i32 %37, i32* %j, align 4 br label %loop.head7 loop.end13: ; preds = %then9, %loop.head7 %38 = load i32, i32* %j, align 4 %39 = icmp ne i32 %38, 1 br i1 %39, label %then14, label %else15 then14: ; preds = %loop.end13 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont16 else15: ; preds = %loop.end13 br label %ifcont16 ifcont16: ; preds = %else15, %then14 %40 = alloca i64, align 8 %41 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %40, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %42 = load i64, i64* %40, align 8 %43 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc17, i32 0, i32 0 store i8* %41, i8** %43, align 8 %44 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc17, i32 0, i32 1 store i64 %42, i64* %44, align 8 %45 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc17, i32 0, i32 0 %46 = load i8*, i8** %45, align 8 %47 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc17, i32 0, i32 1 %48 = load i64, i64* %47, align 8 %49 = trunc i64 %48 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %46, i32 %49, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %50 = icmp eq i8* %41, null br i1 %50, label %free_done19, label %free_nonnull18 free_nonnull18: ; preds = %ifcont16 call void @_lfortran_free_alloc(i8* %2, i8* %41) br label %free_done19 free_done19: ; preds = %free_nonnull18, %ifcont16 store i32 0, i32* %j, align 4 store i32 0, i32* %i, align 4 br label %loop.head20 loop.head20: ; preds = %ifcont24, %then22, %free_done19 %51 = load i32, i32* %i, align 4 %52 = add i32 %51, 1 %53 = icmp sle i32 %52, 10 br i1 %53, label %loop.body21, label %loop.end25 loop.body21: ; preds = %loop.head20 %54 = load i32, i32* %i, align 4 %55 = add i32 %54, 1 store i32 %55, i32* %i, align 4 %56 = load i32, i32* %i, align 4 %57 = icmp eq i32 %56, 2 br i1 %57, label %then22, label %else23 then22: ; preds = %loop.body21 br label %loop.head20 unreachable_after_cycle: ; No predecessors! br label %ifcont24 else23: ; preds = %loop.body21 br label %ifcont24 ifcont24: ; preds = %else23, %unreachable_after_cycle %58 = load i32, i32* %j, align 4 %59 = load i32, i32* %i, align 4 %60 = add i32 %58, %59 store i32 %60, i32* %j, align 4 br label %loop.head20 loop.end25: ; preds = %loop.head20 %61 = load i32, i32* %j, align 4 %62 = icmp ne i32 %61, 53 br i1 %62, label %then26, label %else27 then26: ; preds = %loop.end25 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont28 else27: ; preds = %loop.end25 br label %ifcont28 ifcont28: ; preds = %else27, %then26 %63 = alloca i64, align 8 %64 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %63, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %65 = load i64, i64* %63, align 8 %66 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc29, i32 0, i32 0 store i8* %64, i8** %66, align 8 %67 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc29, i32 0, i32 1 store i64 %65, i64* %67, align 8 %68 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc29, i32 0, i32 0 %69 = load i8*, i8** %68, align 8 %70 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc29, i32 0, i32 1 %71 = load i64, i64* %70, align 8 %72 = trunc i64 %71 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %69, i32 %72, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %73 = icmp eq i8* %64, null br i1 %73, label %free_done31, label %free_nonnull30 free_nonnull30: ; preds = %ifcont28 call void @_lfortran_free_alloc(i8* %2, i8* %64) br label %free_done31 free_done31: ; preds = %free_nonnull30, %ifcont28 br label %return return: ; preds = %free_done31 br label %FINALIZE_SYMTABLE_doloop_03 FINALIZE_SYMTABLE_doloop_03: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) lfortran-0.63.0/tests/reference/asr-flush_invalid_kwarg1-9fc0c7b.json0000664000175000017500000000077015174404631025640 0ustar alastairalastair{ "basename": "asr-flush_invalid_kwarg1-9fc0c7b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/flush_invalid_kwarg1.f90", "infile_hash": "bdc773dad035cc26560f79155d871b9ca6c927b0f94ed47ab162d321", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-flush_invalid_kwarg1-9fc0c7b.stderr", "stderr_hash": "dba53e91602bf50354de524fc4de3525c7a64d318761b9fac931cfed", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-kind1-5b1b058.stderr0000664000175000017500000000017315174404631022723 0ustar alastairalastairsemantic error: Kind 3 is not supported for Real --> tests/errors/kind1.f90:4:10 | 4 | real(3) :: x | ^ lfortran-0.63.0/tests/reference/run-format_29-75ca0a0.json0000664000175000017500000000071515174404631023260 0ustar alastairalastair{ "basename": "run-format_29-75ca0a0", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_29.f90", "infile_hash": "aa0372ac3a2fd155e624df2b5e21032f0fea28f9b97dedb127fdaeb7", "outfile": null, "outfile_hash": null, "stdout": "run-format_29-75ca0a0.stdout", "stdout_hash": "4dab09a4ac764306403c70a659731bc69757ed28b130ef1d2d1f46d4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-types_04-513a7e4.json0000664000175000017500000000072515174404631023035 0ustar alastairalastair{ "basename": "cpp-types_04-513a7e4", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/types_04.f90", "infile_hash": "da21466af87608d5d323360a130e0a5542261d98fabaeebb5adc16d3", "outfile": null, "outfile_hash": null, "stdout": "cpp-types_04-513a7e4.stdout", "stdout_hash": "0da727ad563ef43d5a8a91a69c4e298aebf6ea8c22d103cf88493afe", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format_35-3cec85a.stdout0000664000175000017500000000006515174404631023717 0ustar alastairalastair a b c d e f g h i j k l m n o p q r s t u v w x y z lfortran-0.63.0/tests/reference/asr-complex_02-af31c89.stdout0000664000175000017500000002713415174404631024002 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex_02: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i_: (Variable 2 i_ [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), w: (Variable 2 w [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) complex_02 [] [(Assignment (Var 2 x) (ComplexConstructor (RealConstant 1.000000 (Real 4) ) (RealUnaryMinus (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant -3.000000 (Real 4) ) ) (Complex 4) (ComplexConstant 1.000000 -3.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 a) (RealConstant 3.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 b) (RealConstant 4.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 i_) (ComplexConstructor (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (Complex 4) (ComplexConstant 0.000000 1.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 z) (ComplexBinOp (Cast (Var 2 a) RealToComplex (Complex 4) () () ) Add (ComplexBinOp (Var 2 i_) Mul (Cast (Var 2 b) RealToComplex (Complex 4) () () ) (Complex 4) () ) (Complex 4) () ) () .false. .false. ) (Assignment (Var 2 w) (ComplexBinOp (Cast (RealBinOp (Var 2 a) Add (Var 2 b) (Real 4) () ) RealToComplex (Complex 4) () () ) Add (ComplexBinOp (Var 2 i_) Mul (Cast (RealBinOp (Var 2 a) Sub (Var 2 b) (Real 4) () ) RealToComplex (Complex 4) () () ) (Complex 4) () ) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x) (Var 2 z) (Var 2 w)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-intrinsics_13-07b50ad.json0000664000175000017500000000076115174404631024132 0ustar alastairalastair{ "basename": "asr-intrinsics_13-07b50ad", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_13.f90", "infile_hash": "71322461e1575230ec6b7f06378bb7a3d3f21a3575676307ac8ea762", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_13-07b50ad.stdout", "stdout_hash": "42b8af45cf4cfa98474597288a23a2a74ba539512071d91f2c92438b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-recursion_03-3285725.stdout0000664000175000017500000003167415174404631024317 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @__module___lcompilers_created__nested_context__sub1__x = global i32 0 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [12 x i8] c"S-DESC-7,I4\00", align 1 @string_const_data = private constant [7 x i8] c"before:" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([7 x i8], [7 x i8]* @string_const_data, i32 0, i32 0), i64 7 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [12 x i8] c"S-DESC-6,I4\00", align 1 @string_const_data.3 = private constant [6 x i8] c"after:" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([6 x i8], [6 x i8]* @string_const_data.3, i32 0, i32 0), i64 6 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.5 = private unnamed_addr constant [12 x i8] c"S-DESC-9,I4\00", align 1 @string_const_data.6 = private constant [9 x i8] c"x in getx" @string_const.7 = private global %string_descriptor <{ i8* getelementptr inbounds ([9 x i8], [9 x i8]* @string_const_data.6, i32 0, i32 0), i64 9 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.8 = private constant [7 x i8] c"in sub1" @string_const.9 = private global %string_descriptor <{ i8* getelementptr inbounds ([7 x i8], [7 x i8]* @string_const_data.8, i32 0, i32 0), i64 7 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.10 = private unnamed_addr constant [12 x i8] c"S-DESC-3,I4\00", align 1 @string_const_data.11 = private constant [3 x i8] c"r =" @string_const.12 = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data.11, i32 0, i32 0), i64 3 }> @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @__module_recursion_03_solver(i32 ()* %f, i32* %iter) { .entry: %stringFormat_desc2 = alloca %string_descriptor, align 8 %call_arg_value1 = alloca i32, align 4 %call_arg_value = alloca i32, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %f_val = alloca i32, align 4 %solver = alloca i32, align 4 %1 = call i32 %f() store i32 %1, i32* %f_val, align 4 %2 = alloca i64, align 8 %3 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const, i32* %f_val) %4 = load i64, i64* %2, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 8 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry store i32 2, i32* %call_arg_value, align 4 %13 = load i32, i32* %iter, align 4 %14 = sub i32 %13, 1 store i32 %14, i32* %call_arg_value1, align 4 %15 = call i32 @__module_recursion_03_sub1(i32* %call_arg_value, i32* %call_arg_value1) store i32 %15, i32* %solver, align 4 %16 = call i32 %f() store i32 %16, i32* %f_val, align 4 %17 = alloca i64, align 8 %18 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.2, i32 0, i32 0), i64* %17, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.4, i32* %f_val) %19 = load i64, i64* %17, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0 store i8* %18, i8** %20, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 1 store i64 %19, i64* %21, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0 %23 = load i8*, i8** %22, align 8 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 1 %25 = load i64, i64* %24, align 8 %26 = trunc i64 %25 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %23, i32 %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %27 = icmp eq i8* %18, null br i1 %27, label %free_done4, label %free_nonnull3 free_nonnull3: ; preds = %free_done call void @_lfortran_free_alloc(i8* %0, i8* %18) br label %free_done4 free_done4: ; preds = %free_nonnull3, %free_done br label %return return: ; preds = %free_done4 br label %FINALIZE_SYMTABLE_solver FINALIZE_SYMTABLE_solver: ; preds = %return %28 = load i32, i32* %solver, align 4 ret i32 %28 } declare i32 @f() define i32 @__module_recursion_03_solver_caller(i32 ()* %f, i32* %iter) { .entry: %solver_caller = alloca i32, align 4 %0 = call i32 @__module_recursion_03_solver(i32 ()* %f, i32* %iter) store i32 %0, i32* %solver_caller, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_solver_caller FINALIZE_SYMTABLE_solver_caller: ; preds = %return %1 = load i32, i32* %solver_caller, align 4 ret i32 %1 } declare i32 @f.1() define i32 @__module_recursion_03_sub1(i32* %y, i32* %iter) { .entry: %sub1 = alloca i32, align 4 %tmp = alloca i32, align 4 %x = alloca i32, align 4 %0 = load i32, i32* %y, align 4 store i32 %0, i32* %x, align 4 %1 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.9, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %1, i32 7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %2 = load i32, i32* %iter, align 4 %3 = icmp eq i32 %2, 1 br i1 %3, label %then, label %else then: ; preds = %.entry store i32 1, i32* %sub1, align 4 br label %return unreachable_after_return: ; No predecessors! br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %unreachable_after_return %4 = load i32, i32* %x, align 4 store i32 %4, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 %5 = call i32 @sub1.__module_recursion_03_getx() store i32 %5, i32* %tmp, align 4 %6 = load i32, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 store i32 %6, i32* %x, align 4 %7 = load i32, i32* %x, align 4 store i32 %7, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 %8 = call i32 @__module_recursion_03_solver_caller(i32 ()* @sub1.__module_recursion_03_getx, i32* %iter) store i32 %8, i32* %sub1, align 4 %9 = load i32, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 store i32 %9, i32* %x, align 4 br label %return return: ; preds = %ifcont, %then br label %FINALIZE_SYMTABLE_sub1 FINALIZE_SYMTABLE_sub1: ; preds = %return %10 = load i32, i32* %sub1, align 4 ret i32 %10 } define i32 @sub1.__module_recursion_03_getx() { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %getx = alloca i32, align 4 %1 = alloca i64, align 8 %2 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.5, i32 0, i32 0), i64* %1, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.7, i32* @__module___lcompilers_created__nested_context__sub1__x) %3 = load i64, i64* %1, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %2, i8** %4, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %3, i64* %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %7 = load i8*, i8** %6, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %9 = load i64, i64* %8, align 8 %10 = trunc i64 %9 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %7, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %11 = icmp eq i8* %2, null br i1 %11, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %2) br label %free_done free_done: ; preds = %free_nonnull, %.entry %12 = load i32, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 store i32 %12, i32* %getx, align 4 br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_getx FINALIZE_SYMTABLE_getx: ; preds = %return %13 = load i32, i32* %getx, align 4 ret i32 %13 } declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() %call_arg_value1 = alloca i32, align 4 %call_arg_value = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %r = alloca i32, align 4 store i32 3, i32* %call_arg_value, align 4 store i32 3, i32* %call_arg_value1, align 4 %3 = call i32 @__module_recursion_03_sub1(i32* %call_arg_value, i32* %call_arg_value1) store i32 %3, i32* %r, align 4 %4 = alloca i64, align 8 %5 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.10, i32 0, i32 0), i64* %4, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.12, i32* %r) %6 = load i64, i64* %4, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %5, i8** %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %6, i64* %8, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %10 = load i8*, i8** %9, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %12 = load i64, i64* %11, align 8 %13 = trunc i64 %12 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %10, i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %14 = icmp eq i8* %5, null br i1 %14, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %5) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/x86-program_cmake_01-fc45ca9.json0000664000175000017500000000064315174404631024504 0ustar alastairalastair{ "basename": "x86-program_cmake_01-fc45ca9", "cmd": "lfortran --no-color --backend=x86 {infile} -o output", "infile": "tests/../integration_tests/program_cmake_01.f90", "infile_hash": "0e854d9b2ed613d6193d78290dc20a45ec66f60ab17e1c0229c3febe", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_check-32a1dba.json0000664000175000017500000000100615174404631024455 0ustar alastairalastair{ "basename": "asr-implicit_check-32a1dba", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/implicit_check.f90", "infile_hash": "4913776655a2aab98265358375f290eedb9b92a2ef7424536067345c", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_check-32a1dba.stdout", "stdout_hash": "f5db4bb18322b5946f9b1b07708d5aa93abb8f40b7505b8050412bed", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-arrays_01_logical-f19a63d.json0000664000175000017500000000100015174404631025120 0ustar alastairalastair{ "basename": "llvm-arrays_01_logical-f19a63d", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01_logical.f90", "infile_hash": "494cd2aba8ceee4c9a0bddba4b51d7a4b0b3f817d92e8c0894e4b08b", "outfile": null, "outfile_hash": null, "stdout": "llvm-arrays_01_logical-f19a63d.stdout", "stdout_hash": "634c7c7cbfdcf0da8a22126a8a8d3cc204e97b8bb56e51368d4c36fa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_25-b0e87c0.json0000664000175000017500000000075015174404631023424 0ustar alastairalastair{ "basename": "asr-modules_25-b0e87c0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_25.f90", "infile_hash": "5354e419ff15c42c940ee6e22e7a2d6dd70b8aeba170fd2eb83da168", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_25-b0e87c0.stdout", "stdout_hash": "59bddaf57b526118969d62e4ba0caf52e2a37f67339c426c2c655971", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-print1-a173a20.json0000664000175000017500000000072215174404631023250 0ustar alastairalastair{ "basename": "ast_f90-print1-a173a20", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/print1.f90", "infile_hash": "b39169477bbb20a9f0fc581832d539c45122fbc253e90314075c6581", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-print1-a173a20.stdout", "stdout_hash": "e1464ab402d54ce71669c3f81dfcff8642f127a654b17ec4596b93f3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-continue_body_if_loop-406ed85.json0000664000175000017500000000077715174404631025760 0ustar alastairalastair{ "basename": "ast-continue_body_if_loop-406ed85", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/continue_body_if_loop.f", "infile_hash": "0b34e65df675e3b4009fe5659fbc93ca52002eb7781599ebb9fe7613", "outfile": null, "outfile_hash": null, "stdout": "ast-continue_body_if_loop-406ed85.stdout", "stdout_hash": "4cdc30468fe93f8116412ecdc38c76fdeb8e8f8326e500e4b9fae2d1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-iostat_constant_integer-4f6f5d4.stderr0000664000175000017500000000026415174404631026743 0ustar alastairalastairsemantic error: Non-variable expression for `iostat` --> tests/errors/iostat_constant_integer.f90:7:5 | 7 | read(buffer, *, iostat=ios) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-program_without_line_cc-78281a4.stdout0000664000175000017500000000015615174404631026575 0ustar alastairalastair(TranslationUnit [(Print 0 () [(String "OK" ())] () ) contains] ) lfortran-0.63.0/tests/reference/ast-program1-caa9665.json0000664000175000017500000000071515174404631023207 0ustar alastairalastair{ "basename": "ast-program1-caa9665", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/program1.f90", "infile_hash": "ec4ccdfed01d45648718ca57a9ceb3e5aa82e55e57d8906636902e7b", "outfile": null, "outfile_hash": null, "stdout": "ast-program1-caa9665.stdout", "stdout_hash": "0d118f67ddc1e7368ee04f80885a7ab69369f987486d8ea44a9ca808", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_open_close_read_write-a696eca.stdout0000664000175000017500000006134615174404631030715 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { open_close_read_write: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), lfortran_iomsg: (Variable 2 lfortran_iomsg [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lfortran_iomsg1: (Variable 2 lfortran_iomsg1 [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), msg: (Variable 2 msg [] Local (StringConstant "Some error occured" (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "Some error occured" (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p: (Variable 2 p [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), q: (Variable 2 q [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u: (Variable 2 u [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), u_ptr: (Variable 2 u_ptr [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) open_close_read_write [] [(Associate (Var 2 u_ptr) (Var 2 u) ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (RealBinOp (Cast (Var 2 i) IntegerToReal (Real 4) () () ) Mul (RealConstant 0.100000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 y) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (RealBinOp (IntrinsicElementalFunction Sin [(ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Real 4) ColMajor () )] 0 (Real 4) () ) Mul (RealBinOp (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) Sub (IntrinsicElementalFunction Cos [(RealBinOp (ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Real 4) ColMajor () ) Div (RealConstant 3.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) (Real 4) () ) (Real 4) () ) () .false. .false. )] [] ) (FileOpen 0 (Var 2 u_ptr) (StringConstant "open_close_read_write_data.dat" (String 1 (IntegerConstant 30 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "replace" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () () () () () () () () () () () () () ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) ()) [(FileWrite 0 (Var 2 u) (Var 2 lfortran_iomsg) () () [(StringFormat (StringConstant "(10F8.2)" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (ArrayItem (Var 2 y) [(() (Var 2 i) ())] (Real 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () () )] [] ) (FileClose 0 (IntegerConstant 1 (Integer 4) Decimal) (Var 2 u) (Var 2 msg) (IntegerConstant 999 (Integer 4) Decimal) () ) (GoToTarget 999 999 ) (FileOpen 999 (IntegerConstant 2 (Integer 4) Decimal) (StringConstant "open_close_read_write_data.dat" (String 1 (IntegerConstant 30 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "old" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () () () () () () () () () () () () () ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) ()) [(FileRead 0 (IntegerConstant 2 (Integer 4) Decimal) () () () () () () () [(ArrayItem (Var 2 p) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (ArrayItem (Var 2 q) [(() (Var 2 i) ())] (Real 4) ColMajor () )] () .true. () () () )] [] ) (FileClose 0 (IntegerConstant 2 (Integer 4) Decimal) () () () () ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) ()) [(FileWrite 0 (IntegerConstant 6 (Integer 4) Decimal) (Var 2 lfortran_iomsg1) () () [(StringFormat () [(ArrayItem (Var 2 p) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (ArrayItem (Var 2 q) [(() (Var 2 i) ())] (Real 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-external_01-6754623.stdout0000664000175000017500000001755715174404631023746 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { foo: (Function (SymbolTable 2 { a: (Variable 2 a [] Out () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] In () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Function (SymbolTable 5 { f_arg_0: (Variable 5 f_arg_0 [] Unspecified () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f_return_var_name: (Variable 5 f_return_var_name [] ReturnVar () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Complex 4)] (Complex 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 f_arg_0)] [] (Var 5 f_return_var_name) Public .false. .false. () ) }) foo (FunctionType [(Complex 4) (Complex 4) (FunctionType [(Complex 4)] (Complex 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 a) (Var 2 b) (Var 2 f)] [(Assignment (Var 2 a) (FunctionCall 2 f () [((Var 2 b))] (Complex 4) () () ) () .false. .false. )] () Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-interface_05-5639d22.stdout0000664000175000017500000004522415174404631024136 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { interface_05: (Program (SymbolTable 5 { a: (ExternalSymbol 5 a 2 a interface_05_mod [] a Public ), a1@a: (ExternalSymbol 5 a1@a 2 a1 interface_05_mod [] a1 Public ), a2@a: (ExternalSymbol 5 a2@a 2 a2 interface_05_mod [] a2 Public ), a@a1: (ExternalSymbol 5 a@a1 2 a1 interface_05_mod [] a1 Private ), a@a2: (ExternalSymbol 5 a@a2 2 a2 interface_05_mod [] a2 Private ), i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 5 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) interface_05 [interface_05_mod] [(Assignment (Var 5 i) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 5 i) (FunctionCall 5 a@a1 5 a [((Var 5 i))] (Integer 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 5 i) NotEq (IntegerConstant 6 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 5 r) (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 6.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 5 r) (FunctionCall 5 a@a2 5 a [((Var 5 r))] (Real 4) () () ) () .false. .false. ) (If () (RealCompare (Var 5 r) NotEq (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 5 i) (IntegerConstant 7 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 5 i) (FunctionCall 5 a@a1 5 a [((Var 5 i))] (Integer 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 5 i) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), interface_05_mod: (Module (SymbolTable 2 { a: (GenericProcedure 2 a [2 a1 2 a2] Public ), a1: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a1: (Variable 3 a1 [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a1 (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Assignment (Var 3 a1) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] (Var 3 a1) Public .true. .true. () ), a2: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a2: (Variable 4 a2 [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a2 (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a)] [(Assignment (Var 4 a2) (RealBinOp (Var 4 a) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) (Real 4) () ) () .false. .false. )] (Var 4 a2) Public .true. .true. () ) }) interface_05_mod () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-more_kwargs_than_acceptable_to_subroutine-a276855.json0000664000175000017500000000106715174404631031777 0ustar alastairalastair{ "basename": "asr-more_kwargs_than_acceptable_to_subroutine-a276855", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/more_kwargs_than_acceptable_to_subroutine.f90", "infile_hash": "53bcdc1ab7927132cd66432768e210576758731906f98e632f7d9874", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-more_kwargs_than_acceptable_to_subroutine-a276855.stderr", "stderr_hash": "17aa57c1237631cb4ad11a7f81f495e987f715d878fddd46a7b660c2", "returncode": 2 }lfortran-0.63.0/tests/reference/cpp-subroutine5-272e7be.stdout0000664000175000017500000000100615174404631024300 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations void add(float a, float b, float &c); // Implementations void add(float a, float b, float &c) { c = a + b; } lfortran-0.63.0/tests/reference/run-format_23-fdedfdb.json0000664000175000017500000000071515174404631023570 0ustar alastairalastair{ "basename": "run-format_23-fdedfdb", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_23.f90", "infile_hash": "ed10c322714afdc86cceeb03cfb60fce8c15d3b5e9c03df061e2ca56", "outfile": null, "outfile_hash": null, "stdout": "run-format_23-fdedfdb.stdout", "stdout_hash": "4a8f73290e4f60373242bec2b4360d8b5406de116f313eae712b6a57", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-array_bounds_check_11-83e9417.stderr0000664000175000017500000000053415174404631026021 0ustar alastairalastairruntime error: Array shape mismatch in assignment to 'e'. Tried to match size 4 of dimension 1 of LHS with size 2 of dimension 1 of RHS. Use '--realloc-lhs-arrays' option to reallocate LHS automatically. --> tests/errors/array_bounds_check_11.f90:9:5 | 9 | e = a + b | ^ LHS size is 4 | 9 | e = a + b | ^ RHS size is 2 lfortran-0.63.0/tests/reference/run-array16-b6f006f.json0000664000175000017500000000066215174404631022755 0ustar alastairalastair{ "basename": "run-array16-b6f006f", "cmd": "lfortran --no-color {infile}", "infile": "tests/array16.f90", "infile_hash": "dce0c722304d803515ce62f5177a5d6e6bb748f800cbfbd8cb90f9bb", "outfile": null, "outfile_hash": null, "stdout": "run-array16-b6f006f.stdout", "stdout_hash": "cd2eadef20041913d0b95e4c142d983932f1379d483b02b6f1764682", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-parsing_01-c9b84fe.stdout0000664000175000017500000001147015174404631024061 0ustar alastairalastair(TranslationUnit [(Module submodule (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(complex [] [] () 1 Equal ())] () ) (Interface (InterfaceHeader) () [(InterfaceProc (Subroutine function [(integer) (real)] [(SimpleAttribute AttrModule )] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(integer [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent Out )] [(real [] [] () () None ())] () )] [] [] [] ) )] )] [] [] ) (Submodule submodule () module (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Procedure function [] [(SimpleAttribute AttrModule )] () [] [] [] [] [(Assignment 0 real (* 2 integer) () )] [] )] ) (Program program (TriviaNode [(EndOfLine) (EndOfLine)] [] ) [(Use [] submodule [(UseSymbol complex character ) (UseSymbol function subroutine )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(integer [] [] () () None ()) (real [] [] () () None ())] () )] [(Assignment 0 integer character () ) (AssociateBlock 0 associate [(logical [] [] () character Arrow ()) (complex [] [] () real Arrow ())] [(SubroutineCall 0 subroutine [] [(() logical () 0) (() complex () 0)] [] [] () ) (Print 0 () [(Parenthesis complex )] () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/run-array_bounds_check_14-8de1244.json0000664000175000017500000000074315174404631025543 0ustar alastairalastair{ "basename": "run-array_bounds_check_14-8de1244", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_14.f90", "infile_hash": "903c2c243c58a9f5be4755cc907a5af3c34f90078c03dd8850a7e932", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_14-8de1244.stderr", "stderr_hash": "ea18e894d1ce9f5e6c92334962a28c33e8f34a265e597f38db4f15f5", "returncode": 1 }lfortran-0.63.0/tests/reference/llvm-write3-49c0266.json0000664000175000017500000000071215174404631022713 0ustar alastairalastair{ "basename": "llvm-write3-49c0266", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/write3.f90", "infile_hash": "18ea0138e234c907c606aa064960397fc7dd75f1f2fab0ca42f74c13", "outfile": null, "outfile_hash": null, "stdout": "llvm-write3-49c0266.stdout", "stdout_hash": "5ac63f8009c1144c7d0e4184260bf30246bad72199eae07f6f285481", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-loop_test3-f4e458f.json0000664000175000017500000000073615174404631023564 0ustar alastairalastair{ "basename": "ast-loop_test3-f4e458f", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/loop_test3.f", "infile_hash": "563e057e78a555b01f0ba784adcca08cd39669ac229fc2d62af5f13a", "outfile": null, "outfile_hash": null, "stdout": "ast-loop_test3-f4e458f.stdout", "stdout_hash": "c1ea5142131bb85d6cf2b1ae1d2c458f8b43166e8d2051b323404151", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_01_pack-6c829d9.json0000664000175000017500000000076115174404631024024 0ustar alastairalastair{ "basename": "asr-array_01_pack-6c829d9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/array_01_pack.f90", "infile_hash": "02d7dd22ece04cc492f6d7bb57b8d91a311419e3fab2294a2c809d22", "outfile": null, "outfile_hash": null, "stdout": "asr-array_01_pack-6c829d9.stdout", "stdout_hash": "b042f70f4da58b9e65f7c38a7997ddbc9ea2e437f4f4275b80e89954", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-block_02-1362742.stdout0000664000175000017500000000047415174404631023514 0ustar alastairalastairfunction square(b::Int32) local result::Int32 result = b * b println(result) end function main() local a::Int32 a = 10 @label label_1 let b::Int32 a = a + 5 if a == 15 @goto label_1 end b = a ÷ 2 square(b) end end main() lfortran-0.63.0/tests/reference/llvm-types_01-642cab3.json0000664000175000017500000000074515174404631023277 0ustar alastairalastair{ "basename": "llvm-types_01-642cab3", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/types_01.f90", "infile_hash": "1987d8bcc6219e1bf0134a0123e23d9e02a0a8efb6989074d1537f46", "outfile": null, "outfile_hash": null, "stdout": "llvm-types_01-642cab3.stdout", "stdout_hash": "497d05d87dbced2d3c9eb49cd730d4c8b5b51e6a95b4330dbb8bb43d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_op_simplifier_test-ba92920.stdout0000664000175000017500000002106615174404631027040 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Local () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main [] [(Allocate [((Var 2 d) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (Var 2 d) (RealBinOp (RealBinOp (Var 2 a) Add (Var 2 b) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) Add (ArrayBroadcast (Var 2 c) (ArrayConstant 8 [5, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-doconcurrentloop_01-ebe9543.json0000664000175000017500000000101615174404631026031 0ustar alastairalastair{ "basename": "ast_f90-doconcurrentloop_01-ebe9543", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/doconcurrentloop_01.f90", "infile_hash": "467f7dbdb5186badc19797a42685003effc780bd17088ab9fcc27efb", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-doconcurrentloop_01-ebe9543.stdout", "stdout_hash": "bbcd3ccdc8b250286bfc3b3c0766dea1f078a6e9bc5b3e732fc44e5d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-data_implied_do3-831f843.stderr0000664000175000017500000000030615174404631025026 0ustar alastairalastairsemantic error: The start variable of the data implied do loop must be constants --> tests/errors/data_implied_do3.f90:5:21 | 5 | data(iarx(i), i=k, 3) / 1, 2, 3 / | ^ lfortran-0.63.0/tests/reference/ast-case_02-cf1eb8d.json0000664000175000017500000000073715174404631023035 0ustar alastairalastair{ "basename": "ast-case_02-cf1eb8d", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_02.f90", "infile_hash": "76d3020fba89787d565870ed03c1b5e8914d12b062cb9ca7a8c37550", "outfile": null, "outfile_hash": null, "stdout": "ast-case_02-cf1eb8d.stdout", "stdout_hash": "2e5de1b8f68962eb6066ffec0ed52e76873db31cbbe5305b5104fac3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-complex_02-af31c89.json0000664000175000017500000000075015174404631023424 0ustar alastairalastair{ "basename": "asr-complex_02-af31c89", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_02.f90", "infile_hash": "c5e28327787e2c4dd5e42cc1c527749eb2e7b7f27623222a118f3bbe", "outfile": null, "outfile_hash": null, "stdout": "asr-complex_02-af31c89.stdout", "stdout_hash": "38e9ed7ca88f563f1a40d35e5adcfe649225367355cfb95b90846965", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-types_05-fa1bde9.json0000664000175000017500000000074215174404631023262 0ustar alastairalastair{ "basename": "asr-types_05-fa1bde9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_05.f90", "infile_hash": "96f8e950abafbc42b9d0438efdca0a8355bb2bd7b4b168ee23063521", "outfile": null, "outfile_hash": null, "stdout": "asr-types_05-fa1bde9.stdout", "stdout_hash": "e26c9b3e48b3845f53e8a2491d9d3e05353f632c0a369435efcaf577", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-flush2-9767ece.stdout0000664000175000017500000000412215174404631023240 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { flush2: (Program (SymbolTable 2 { }) flush2 [] [(Flush 0 (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) () () () ) (FileOpen 0 (IntegerConstant 10 (Integer 4) Decimal) (StringConstant "file_01_data.txt" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () () () () () () () () () () () () () () ) (Flush 0 (IntegerConstant 10 (Integer 4) Decimal) () () () ) (Flush 0 (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) () () () )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-implicit6-061f8e3.json0000664000175000017500000000106215174404631023267 0ustar alastairalastair{ "basename": "asr-implicit6-061f8e3", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit6.f90", "infile_hash": "ec52eac2f61928998941f6ef5395e23263fedec17cbec758e10e24ef", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit6-061f8e3.stdout", "stdout_hash": "2de2993c3ee9a76c83c8a925376c56e85b8627c087b57585295535ed", "stderr": "asr-implicit6-061f8e3.stderr", "stderr_hash": "3dae74d301e53effbbe322b0da76528b0a55ed4a7d3d784ca7da3e51", "returncode": 0 }lfortran-0.63.0/tests/reference/ast-call1-ae0bbbd.stdout0000664000175000017500000000507615174404631023232 0ustar alastairalastair(TranslationUnit [(Program call1 () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(callf [] [] () () None ())] () )] [(SubroutineCall 0 f [] [] [] [] () ) (SubroutineCall 0 f [] [] [] [] () ) (Assignment 0 callf 5 () ) (SubroutineCall 0 f_s [] [(() 3 () 0) (() 2 () 0)] [] [] () ) (Assignment 0 (FuncCallOrArray callf_s [] [(() 3 () 0) (() 2 () 0)] [] [] [] ) 5 () ) (SubroutineCall 0 f_s [] [(() 3 () 0) (() 2 () 0) (() (FuncCallOrArray f [] [(() (String "(" ()) () 0)] [] [] [] ) () 0)] [] [] () ) (Assignment 0 (FuncCallOrArray callf_s [] [(() 3 () 0) (() 2 () 0) (() (FuncCallOrArray f [] [(() (String "(" ()) () 0)] [] [] [] ) () 0)] [] [] [] ) 5 () )] [] )] ) lfortran-0.63.0/tests/reference/pass_insert_deallocate-finalize_01-3efebdd.json0000664000175000017500000000102515174404631027711 0ustar alastairalastair{ "basename": "pass_insert_deallocate-finalize_01-3efebdd", "cmd": "lfortran --pass=insert_deallocate --show-asr --no-color {infile} -o {outfile}", "infile": "tests/finalize_01.f90", "infile_hash": "81b1d43091ce29fff8f14e778b9a33030de61262f7c499b22c152b7e", "outfile": null, "outfile_hash": null, "stdout": "pass_insert_deallocate-finalize_01-3efebdd.stdout", "stdout_hash": "ef339173e5773998046932fbcbeae4b6de2e12b5bce544900b7929b6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_typing4-df7d614.stderr0000664000175000017500000000032615174404631025276 0ustar alastairalastairsemantic error: Dummy argument 'matvect' not defined --> tests/errors/implicit_typing4.f90:1:1 - 3:3 | 1 | subroutine iddr_rsvd(matvect) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 3 | end | ...^^^ lfortran-0.63.0/tests/reference/asr-intrinsics_02-1c20d1a.stdout0000664000175000017500000004446615174404631024504 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_02: (Program (SymbolTable 2 { x: (Variable 2 x [] Local (IntrinsicElementalFunction Sin [(RealConstant 1.500000 (Real 4) )] 0 (Real 4) (RealConstant 0.997495 (Real 4) ) ) (RealConstant 0.997495 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_02 [] [(Assignment (Var 2 y) (Cast (IntrinsicElementalFunction Sin [(RealConstant 1.500000 (Real 4) )] 0 (Real 4) (RealConstant 0.997495 (Real 4) ) ) RealToReal (Real 8) (RealConstant 0.997495 (Real 8) ) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x) (Var 2 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealConstant 0.997495 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Sin [(Var 2 x)] 0 (Real 4) () ) Sub (RealConstant 0.840115 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 y) Sub (Cast (RealConstant 0.997495 (Real 4) ) RealToReal (Real 8) (RealConstant 0.997495 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Sin [(RealBinOp (IntrinsicElementalFunction Sin [(RealConstant 1.500000 (Real 4) )] 0 (Real 4) (RealConstant 0.997495 (Real 4) ) ) Add (IntrinsicElementalFunction Sin [(RealBinOp (RealConstant 0.500000 (Real 4) ) Add (IntrinsicElementalFunction Sin [(RealConstant 0.500000 (Real 4) )] 0 (Real 4) (RealConstant 0.479426 (Real 4) ) ) (Real 4) (RealConstant 0.979426 (Real 4) ) )] 0 (Real 4) (RealConstant 0.830177 (Real 4) ) ) (Real 4) (RealConstant 1.827672 (Real 4) ) )] 0 (Real 4) (RealConstant 0.967188 (Real 4) ) ) Sub (RealConstant 0.967188 (Real 4) ) (Real 4) (RealConstant -0.000000 (Real 4) ) )] 0 (Real 4) (RealConstant 0.000000 (Real 4) ) ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Sin [(RealBinOp (IntrinsicElementalFunction Sin [(Var 2 y)] 0 (Real 8) () ) Add (Cast (IntrinsicElementalFunction Sin [(RealBinOp (Var 2 x) Add (IntrinsicElementalFunction Sin [(Var 2 x)] 0 (Real 4) () ) (Real 4) () )] 0 (Real 4) () ) RealToReal (Real 8) () () ) (Real 8) () )] 0 (Real 8) () ) Sub (Cast (RealConstant 0.972762 (Real 4) ) RealToReal (Real 8) (RealConstant 0.972762 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-unlimited_polymorphic_intrinsic_type_allocate-3e26601.json0000664000175000017500000000107715174404631033102 0ustar alastairalastair{ "basename": "llvm-unlimited_polymorphic_intrinsic_type_allocate-3e26601", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/unlimited_polymorphic_intrinsic_type_allocate.f90", "infile_hash": "5e3fd98f08d2d9173c3610e43114224b2865c77917c3c0faa1951861", "outfile": null, "outfile_hash": null, "stdout": "llvm-unlimited_polymorphic_intrinsic_type_allocate-3e26601.stdout", "stdout_hash": "fea3a863564b040e357b1928cf991a46a82a4edc35605f4780503b3d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-doloop_04-e25bf76.stdout0000664000175000017500000003727615174404631024030 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc7 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %__do_loop_inc = alloca i32, align 4 %__do_loop_inc1 = alloca i32, align 4 %__do_loop_inc2 = alloca i32, align 4 %i = alloca i32, align 4 %j = alloca i32, align 4 %k = alloca i32, align 4 store i32 0, i32* %j, align 4 store i32 2, i32* %k, align 4 %3 = load i32, i32* %k, align 4 store i32 %3, i32* %__do_loop_inc, align 4 %4 = load i32, i32* %__do_loop_inc, align 4 %5 = sub i32 1, %4 store i32 %5, i32* %i, align 4 br label %loop.head loop.head: ; preds = %loop.body, %.entry %6 = load i32, i32* %__do_loop_inc, align 4 %7 = icmp sgt i32 %6, 0 %8 = load i32, i32* %i, align 4 %9 = load i32, i32* %__do_loop_inc, align 4 %10 = add i32 %8, %9 %11 = icmp sle i32 %10, 10 %12 = and i1 %7, %11 %13 = load i32, i32* %__do_loop_inc, align 4 %14 = icmp sle i32 %13, 0 %15 = load i32, i32* %i, align 4 %16 = load i32, i32* %__do_loop_inc, align 4 %17 = add i32 %15, %16 %18 = icmp sge i32 %17, 10 %19 = and i1 %14, %18 %20 = or i1 %12, %19 br i1 %20, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %21 = load i32, i32* %i, align 4 %22 = load i32, i32* %__do_loop_inc, align 4 %23 = add i32 %21, %22 store i32 %23, i32* %i, align 4 %24 = load i32, i32* %j, align 4 %25 = load i32, i32* %i, align 4 %26 = add i32 %24, %25 store i32 %26, i32* %j, align 4 br label %loop.head loop.end: ; preds = %loop.head %27 = load i32, i32* %j, align 4 %28 = icmp ne i32 %27, 25 br i1 %28, label %then, label %else then: ; preds = %loop.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %loop.end br label %ifcont ifcont: ; preds = %else, %then %29 = alloca i64, align 8 %30 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %29, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %31 = load i64, i64* %29, align 8 %32 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %30, i8** %32, align 8 %33 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %31, i64* %33, align 8 %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %35 = load i8*, i8** %34, align 8 %36 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %37 = load i64, i64* %36, align 8 %38 = trunc i64 %37 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %35, i32 %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %39 = icmp eq i8* %30, null br i1 %39, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont call void @_lfortran_free_alloc(i8* %2, i8* %30) br label %free_done free_done: ; preds = %free_nonnull, %ifcont store i32 0, i32* %j, align 4 store i32 -2, i32* %k, align 4 %40 = load i32, i32* %k, align 4 store i32 %40, i32* %__do_loop_inc1, align 4 %41 = load i32, i32* %__do_loop_inc1, align 4 %42 = sub i32 10, %41 store i32 %42, i32* %i, align 4 br label %loop.head1 loop.head1: ; preds = %loop.body2, %free_done %43 = load i32, i32* %__do_loop_inc1, align 4 %44 = icmp sgt i32 %43, 0 %45 = load i32, i32* %i, align 4 %46 = load i32, i32* %__do_loop_inc1, align 4 %47 = add i32 %45, %46 %48 = icmp sle i32 %47, 1 %49 = and i1 %44, %48 %50 = load i32, i32* %__do_loop_inc1, align 4 %51 = icmp sle i32 %50, 0 %52 = load i32, i32* %i, align 4 %53 = load i32, i32* %__do_loop_inc1, align 4 %54 = add i32 %52, %53 %55 = icmp sge i32 %54, 1 %56 = and i1 %51, %55 %57 = or i1 %49, %56 br i1 %57, label %loop.body2, label %loop.end3 loop.body2: ; preds = %loop.head1 %58 = load i32, i32* %i, align 4 %59 = load i32, i32* %__do_loop_inc1, align 4 %60 = add i32 %58, %59 store i32 %60, i32* %i, align 4 %61 = load i32, i32* %j, align 4 %62 = load i32, i32* %i, align 4 %63 = add i32 %61, %62 store i32 %63, i32* %j, align 4 br label %loop.head1 loop.end3: ; preds = %loop.head1 %64 = load i32, i32* %j, align 4 %65 = icmp ne i32 %64, 30 br i1 %65, label %then4, label %else5 then4: ; preds = %loop.end3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont6 else5: ; preds = %loop.end3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 %66 = alloca i64, align 8 %67 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %66, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %68 = load i64, i64* %66, align 8 %69 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 store i8* %67, i8** %69, align 8 %70 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 store i64 %68, i64* %70, align 8 %71 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 %72 = load i8*, i8** %71, align 8 %73 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 %74 = load i64, i64* %73, align 8 %75 = trunc i64 %74 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %72, i32 %75, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %76 = icmp eq i8* %67, null br i1 %76, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %ifcont6 call void @_lfortran_free_alloc(i8* %2, i8* %67) br label %free_done9 free_done9: ; preds = %free_nonnull8, %ifcont6 store i32 0, i32* %j, align 4 store i32 0, i32* %i, align 4 br label %a.head a.head: ; preds = %ifcont12, %free_done9 %77 = load i32, i32* %i, align 4 %78 = add i32 %77, 1 %79 = icmp sle i32 %78, 10 br i1 %79, label %a.body, label %a.end a.body: ; preds = %a.head %80 = load i32, i32* %i, align 4 %81 = add i32 %80, 1 store i32 %81, i32* %i, align 4 %82 = load i32, i32* %j, align 4 %83 = load i32, i32* %i, align 4 %84 = add i32 %82, %83 store i32 %84, i32* %j, align 4 %85 = load i32, i32* %i, align 4 %86 = icmp eq i32 %85, 2 br i1 %86, label %then10, label %else11 then10: ; preds = %a.body br label %a.end unreachable_after_exit: ; No predecessors! br label %ifcont12 else11: ; preds = %a.body br label %ifcont12 ifcont12: ; preds = %else11, %unreachable_after_exit br label %a.head a.end: ; preds = %then10, %a.head %87 = load i32, i32* %j, align 4 %88 = icmp ne i32 %87, 3 br i1 %88, label %then13, label %else14 then13: ; preds = %a.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont15 else14: ; preds = %a.end br label %ifcont15 ifcont15: ; preds = %else14, %then13 store i32 0, i32* %j, align 4 store i32 -1, i32* %i, align 4 br label %b.head b.head: ; preds = %ifcont19, %ifcont15 %89 = load i32, i32* %i, align 4 %90 = add i32 %89, 2 %91 = icmp sle i32 %90, 10 br i1 %91, label %b.body, label %b.end b.body: ; preds = %b.head %92 = load i32, i32* %i, align 4 %93 = add i32 %92, 2 store i32 %93, i32* %i, align 4 %94 = load i32, i32* %j, align 4 %95 = load i32, i32* %i, align 4 %96 = add i32 %94, %95 store i32 %96, i32* %j, align 4 %97 = load i32, i32* %i, align 4 %98 = icmp eq i32 %97, 3 br i1 %98, label %then16, label %else18 then16: ; preds = %b.body br label %b.end unreachable_after_exit17: ; No predecessors! br label %ifcont19 else18: ; preds = %b.body br label %ifcont19 ifcont19: ; preds = %else18, %unreachable_after_exit17 br label %b.head b.end: ; preds = %then16, %b.head %99 = load i32, i32* %j, align 4 %100 = icmp ne i32 %99, 4 br i1 %100, label %then20, label %else21 then20: ; preds = %b.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont22 else21: ; preds = %b.end br label %ifcont22 ifcont22: ; preds = %else21, %then20 store i32 0, i32* %j, align 4 store i32 1, i32* %i, align 4 br label %c.head c.head: ; preds = %ifcont26, %ifcont22 br i1 true, label %c.body, label %c.end c.body: ; preds = %c.head %101 = load i32, i32* %j, align 4 %102 = load i32, i32* %i, align 4 %103 = add i32 %101, %102 store i32 %103, i32* %j, align 4 %104 = load i32, i32* %i, align 4 %105 = icmp eq i32 %104, 2 br i1 %105, label %then23, label %else25 then23: ; preds = %c.body br label %c.end unreachable_after_exit24: ; No predecessors! br label %ifcont26 else25: ; preds = %c.body br label %ifcont26 ifcont26: ; preds = %else25, %unreachable_after_exit24 %106 = load i32, i32* %i, align 4 %107 = add i32 %106, 1 store i32 %107, i32* %i, align 4 br label %c.head c.end: ; preds = %then23, %c.head %108 = load i32, i32* %j, align 4 %109 = icmp ne i32 %108, 3 br i1 %109, label %then27, label %else28 then27: ; preds = %c.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont29 else28: ; preds = %c.end br label %ifcont29 ifcont29: ; preds = %else28, %then27 store i32 2, i32* %k, align 4 %110 = load i32, i32* %k, align 4 store i32 %110, i32* %__do_loop_inc2, align 4 %111 = load i32, i32* %__do_loop_inc2, align 4 %112 = sub i32 1, %111 store i32 %112, i32* %i, align 4 br label %loop.head30 loop.head30: ; preds = %goto_target, %ifcont29 %113 = load i32, i32* %__do_loop_inc2, align 4 %114 = icmp sgt i32 %113, 0 %115 = load i32, i32* %i, align 4 %116 = load i32, i32* %__do_loop_inc2, align 4 %117 = add i32 %115, %116 %118 = icmp sle i32 %117, 10 %119 = and i1 %114, %118 %120 = load i32, i32* %__do_loop_inc2, align 4 %121 = icmp sle i32 %120, 0 %122 = load i32, i32* %i, align 4 %123 = load i32, i32* %__do_loop_inc2, align 4 %124 = add i32 %122, %123 %125 = icmp sge i32 %124, 10 %126 = and i1 %121, %125 %127 = or i1 %119, %126 br i1 %127, label %loop.body31, label %loop.end32 loop.body31: ; preds = %loop.head30 %128 = load i32, i32* %i, align 4 %129 = load i32, i32* %__do_loop_inc2, align 4 %130 = add i32 %128, %129 store i32 %130, i32* %i, align 4 br label %goto_target goto_target: ; preds = %loop.body31 br label %loop.head30 loop.end32: ; preds = %loop.head30 br label %return return: ; preds = %loop.end32 br label %FINALIZE_SYMTABLE_doloop_04 FINALIZE_SYMTABLE_doloop_04: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) lfortran-0.63.0/tests/reference/asr-associate_03-bc2b027.stdout0000664000175000017500000001471015174404631024266 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { associate_03: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p1: (Variable 2 p1 [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t1: (Variable 2 t1 [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), t2: (Variable 2 t2 [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ) }) associate_03 [] [(Print (StringFormat () [(Var 2 t1) (Var 2 t2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 t1) Gt (Var 2 t2) (Logical 4) () ) [(Associate (Var 2 p1) (Var 2 t1) )] [(Associate (Var 2 p1) (Var 2 t2) )] ) (Print (StringFormat () [(Var 2 p1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (Var 2 p1) () .false. .false. ) (If () (IntegerCompare (Var 2 i) Eq (Var 2 t2) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-derived_types_32-4684b97.json0000664000175000017500000000077515174404631024673 0ustar alastairalastair{ "basename": "llvm-derived_types_32-4684b97", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_32.f90", "infile_hash": "39d5cc6685aacdb41dd366f4a5147c66847cad929d59546701732401", "outfile": null, "outfile_hash": null, "stdout": "llvm-derived_types_32-4684b97.stdout", "stdout_hash": "db7ad155929d32fe7f870a782a86e38033160cb8331178b416febfb3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-open_notimplemented_kwarg1-24818cb.stdout0000664000175000017500000000275615174404631027273 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { open_notimplemented_kwargs: (Program (SymbolTable 2 { }) open_notimplemented_kwargs [] [(FileOpen 0 (IntegerConstant 10 (Integer 4) Decimal) (StringConstant "file_01_data.txt" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "old" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () () () (StringConstant "read" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () () () () () () () () )] ) }) [] ) lfortran-0.63.0/tests/reference/pass_loop_unroll-loop_unroll_large-8723774.stdout0000664000175000017500000025574215174404631030154 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { loop_unroll_large: (Program (SymbolTable 2 { array: (Variable 2 array [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), first: (Variable 2 first [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), last: (Variable 2 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) loop_unroll_large [] [(Allocate [((Var 2 array) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 35 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 32 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. )] [] ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 32 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/run-array_bounds_check_04-2e3d8fb.json0000664000175000017500000000074315174404631025704 0ustar alastairalastair{ "basename": "run-array_bounds_check_04-2e3d8fb", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_04.f90", "infile_hash": "daa672fe4c03715eb861e1221cb21768fb0b297213ccbe906ea2871c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_04-2e3d8fb.stderr", "stderr_hash": "f264953961ec266c4921c4bbb5029374f7c651c00180dfc87ce5fe18", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-idint_real4-b5321a5.json0000664000175000017500000000073515174404631023561 0ustar alastairalastair{ "basename": "asr-idint_real4-b5321a5", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/idint_real4.f90", "infile_hash": "bd122b4a77e689953e6ee65cb703713f546485a4104e5985208c98e0", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-idint_real4-b5321a5.stderr", "stderr_hash": "3eda84427fd2599286c76e6f20adfe2b7e1d404a35ec18616acefe58", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-maskr_incorrect_bit_size-0d2cb26.json0000664000175000017500000000100415174404631026506 0ustar alastairalastair{ "basename": "asr-maskr_incorrect_bit_size-0d2cb26", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/maskr_incorrect_bit_size.f90", "infile_hash": "55ab6743eeb879b04470a9eafcb50e5fc4b79731f759b1bb0f41d6b2", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-maskr_incorrect_bit_size-0d2cb26.stderr", "stderr_hash": "245a1c253a53c1c9b0e01daf29fa89c70f4bcea5c93cb74c0d1b0818", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-flush2-9767ece.json0000664000175000017500000000102415174404631022665 0ustar alastairalastair{ "basename": "asr-flush2-9767ece", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/flush2.f90", "infile_hash": "e4912e2bc379b34e493cdd9c89f76794bb32113af915d2ca96793675", "outfile": null, "outfile_hash": null, "stdout": "asr-flush2-9767ece.stdout", "stdout_hash": "69738ed25097d13bd45b4eda71aae06aa2a89339fd52112b9c05c2ea", "stderr": "asr-flush2-9767ece.stderr", "stderr_hash": "9a387f3a8657746f5eb56f5e5a03771cfe161a73d9fb1a50cc03e6ae", "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-allocate_03-495d621.json0000664000175000017500000000075615174404631023575 0ustar alastairalastair{ "basename": "llvm-allocate_03-495d621", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/allocate_03.f90", "infile_hash": "1f3440c7b139aaa793981c1458c516ddc41106d2950a39f47077b0f5", "outfile": null, "outfile_hash": null, "stdout": "llvm-allocate_03-495d621.stdout", "stdout_hash": "e153dc87d818da9882c3a292a8eac0b48715a8054926f049ca017345", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-logical2-94a2259.stdout0000664000175000017500000000471715174404631023556 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [26 x i8] c"Line 1 - Condition is true" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([26 x i8], [26 x i8]* @string_const_data, i32 0, i32 0), i64 26 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [27 x i8] c"Line 1 - Condition is false" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([27 x i8], [27 x i8]* @string_const_data.1, i32 0, i32 0), i64 27 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca i32, align 4 %b = alloca i32, align 4 store i32 1, i32* %a, align 4 store i32 0, i32* %b, align 4 %2 = load i32, i32* %a, align 4 %3 = load i32, i32* %b, align 4 %4 = and i32 %2, %3 %5 = icmp ne i32 %4, 0 br i1 %5, label %then, label %else then: ; preds = %.entry %6 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %6, i32 26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %ifcont else: ; preds = %.entry %7 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %7, i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) br label %ifcont ifcont: ; preds = %else, %then br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_logical2 FINALIZE_SYMTABLE_logical2: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/ast_f90-flush1-1eb6a16.stdout0000664000175000017500000000022615174404631023674 0ustar alastairalastairprogram flush1 ! Tests for syntax (AST only): flush(10, IOSTAT=n) flush(20, IOMSG=n) flush(ERR=label) flush(30, UNIT=40) flush(50) end program flush1 lfortran-0.63.0/tests/reference/ast-common1-abbc59b.json0000664000175000017500000000071215174404631023156 0ustar alastairalastair{ "basename": "ast-common1-abbc59b", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/common1.f90", "infile_hash": "d7a7a1f2f3dfe2e00668bce25dbd3dc8830df902ed2c7841ef1bc6e8", "outfile": null, "outfile_hash": null, "stdout": "ast-common1-abbc59b.stdout", "stdout_hash": "d3d7c74010f253585e6e6e08caef2d514f2df042adefcdfd197df655", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-incorrect_allocate_for_array-b52ea30.stderr0000664000175000017500000000041115174404631027663 0ustar alastairalastairsemantic error: Allocate for arrays should have dimensions specified, found only array variable with no dimensions --> tests/errors/incorrect_allocate_for_array.f90:3:14 | 3 | allocate(a) | ^ Array specification required in allocate statement lfortran-0.63.0/tests/reference/asr-incorrect_number_args_subroutine-126ac8b.json0000664000175000017500000000103415174404631030273 0ustar alastairalastair{ "basename": "asr-incorrect_number_args_subroutine-126ac8b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incorrect_number_args_subroutine.f90", "infile_hash": "9f8831c31b6db61388a9bd52b8dbbc41806e77a125bcd3988587b34b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incorrect_number_args_subroutine-126ac8b.stderr", "stderr_hash": "8a32ff11fe84eec3e2ceb96907bdfd6f0a07253dee9905138cbdadd9", "returncode": 2 }lfortran-0.63.0/tests/reference/pass_inline_function_calls-functions_05-5502cc1.json0000664000175000017500000000110015174404631030464 0ustar alastairalastair{ "basename": "pass_inline_function_calls-functions_05-5502cc1", "cmd": "lfortran --pass=inline_function_calls --show-asr --no-color --fast {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_05.f90", "infile_hash": "cf4cc8e65f95bcf5b5aacbb6d16d2aa40ef2f4c8442d1cb19b680a35", "outfile": null, "outfile_hash": null, "stdout": "pass_inline_function_calls-functions_05-5502cc1.stdout", "stdout_hash": "b5eb593e4c65f54766363adae85db36386824aa2bbc3db65bb0d1bba", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_07-ccfd81f.json0000664000175000017500000000077215174404631024774 0ustar alastairalastair{ "basename": "asr-derived_types_07-ccfd81f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_07.f90", "infile_hash": "33107b2d28cc81b22f81d3874dcb73e2941e7687400413569dd293e2", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_07-ccfd81f.stdout", "stdout_hash": "f9bdaf9ae217d6cd78274a5f810ccd60911d3be2e8aa0a3f6173e9fe", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-doloop_01-4e94eaf.stdout0000664000175000017500000003765415174404631023727 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i32) i32.const 0 local.set 1 i32.const 1 i32.const 1 i32.sub local.set 0 loop local.get 0 i32.const 1 i32.add i32.const 10 i32.le_s if local.get 0 i32.const 1 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 55 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 10 i32.const -1 i32.sub local.set 0 loop local.get 0 i32.const -1 i32.add i32.const 1 i32.ge_s if local.get 0 i32.const -1 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 55 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 1 i32.const 2 i32.sub local.set 0 loop local.get 0 i32.const 2 i32.add i32.const 9 i32.le_s if local.get 0 i32.const 2 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 25 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 9 i32.const -2 i32.sub local.set 0 loop local.get 0 i32.const -2 i32.add i32.const 1 i32.ge_s if local.get 0 i32.const -2 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 25 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 1 i32.const 2 i32.sub local.set 0 loop local.get 0 i32.const 2 i32.add i32.const 10 i32.le_s if local.get 0 i32.const 2 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 25 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 1 i32.const 3 i32.sub local.set 0 loop local.get 0 i32.const 3 i32.add i32.const 10 i32.le_s if local.get 0 i32.const 3 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 22 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 10 i32.const -3 i32.sub local.set 0 loop local.get 0 i32.const -3 i32.add i32.const 1 i32.ge_s if local.get 0 i32.const -3 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 22 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 1 i32.const 1 i32.sub local.set 0 loop local.get 0 i32.const 1 i32.add i32.const 1 i32.le_s if local.get 0 i32.const 1 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 1 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 1 i32.const -1 i32.sub local.set 0 loop local.get 0 i32.const -1 i32.add i32.const 1 i32.ge_s if local.get 0 i32.const -1 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 1 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 1 i32.const 1 i32.sub local.set 0 loop local.get 0 i32.const 1 i32.add i32.const 0 i32.le_s if local.get 0 i32.const 1 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 0 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 0 i32.const -1 i32.sub local.set 0 loop local.get 0 i32.const -1 i32.add i32.const 1 i32.ge_s if local.get 0 i32.const -1 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 0 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\0b\00\00\00") (data (;35;) (i32.const 216) "ERROR STOP\n ") ) lfortran-0.63.0/tests/reference/ast-return1-517cbf1.stderr0000664000175000017500000000071715174404631023405 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/return1.f90:8:11 | 8 | if (i .eq. a) return 1 | ^^^^ help: write this as '==' style suggestion: Use '==' instead of '.eq.' --> tests/return1.f90:9:11 | 9 | if (i .eq. b) return 2 | ^^^^ help: write this as '==' style suggestion: Use '==' instead of '.eq.' --> tests/return1.f90:10:11 | 10 | if (i .eq. c) return 3 | ^^^^ help: write this as '==' lfortran-0.63.0/tests/reference/asr-template_02-021cc51.stdout0000664000175000017500000033407315174404631024051 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_02: (Program (SymbolTable 8 { change_positions_chr: (Function (SymbolTable 12 { i: (Variable 12 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 12 j [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), mask: (Variable 12 mask [] ReturnVar () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 12 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pos: (Variable 12 pos [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), vec: (Variable 12 vec [] In () () Default (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) change_positions_chr (FunctionType [(Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray )] (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~neq_intrinsic1] [(Var 12 vec)] [(Assignment (Var 12 n) (ArraySize (Var 12 vec) () (Integer 4) () ) () .false. .false. ) (Allocate [((Var 12 pos) [((IntegerConstant 1 (Integer 4) Decimal) (Var 12 n))] () () ())] () () () ) (If () (IntegerCompare (Var 12 n) Lt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Return)] [] ) (Assignment (Var 12 pos) (ArrayBroadcast (IntegerConstant 0 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 12 pos)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) () .false. .false. ) (Assignment (ArrayItem (Var 12 pos) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 12 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 12 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 12 n) ()) [(If () (FunctionCall 8 ~neq_intrinsic1 () [((ArrayItem (Var 12 vec) [(() (Var 12 i) ())] (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () )) ((ArrayItem (Var 12 vec) [(() (IntegerBinOp (Var 12 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ))] (Logical 4) () () ) [(Assignment (Var 12 j) (IntegerBinOp (Var 12 j) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 12 pos) [(() (Var 12 j) ())] (Integer 4) ColMajor () ) (Var 12 i) () .false. .false. )] [] )] [] ) (Allocate [((Var 12 mask) [((IntegerConstant 1 (Integer 4) Decimal) (Var 12 j))] () () ())] () () () ) (DoLoop () ((Var 12 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 12 j) ()) [(Assignment (ArrayItem (Var 12 mask) [(() (Var 12 i) ())] (Integer 4) ColMajor () ) (ArrayItem (Var 12 pos) [(() (Var 12 i) ())] (Integer 4) ColMajor () ) () .false. .false. )] [] )] (Var 12 mask) Public .true. .true. () ), change_positions_int: (Function (SymbolTable 10 { i: (Variable 10 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 10 j [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), mask: (Variable 10 mask [] ReturnVar () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 10 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pos: (Variable 10 pos [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), vec: (Variable 10 vec [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) change_positions_int (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~neq_intrinsic] [(Var 10 vec)] [(Assignment (Var 10 n) (ArraySize (Var 10 vec) () (Integer 4) () ) () .false. .false. ) (Allocate [((Var 10 pos) [((IntegerConstant 1 (Integer 4) Decimal) (Var 10 n))] () () ())] () () () ) (If () (IntegerCompare (Var 10 n) Lt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Return)] [] ) (Assignment (Var 10 pos) (ArrayBroadcast (IntegerConstant 0 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 10 pos)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) () .false. .false. ) (Assignment (ArrayItem (Var 10 pos) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 10 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 10 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 10 n) ()) [(If () (FunctionCall 8 ~neq_intrinsic () [((ArrayItem (Var 10 vec) [(() (Var 10 i) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 10 vec) [(() (IntegerBinOp (Var 10 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Integer 4) ColMajor () ))] (Logical 4) () () ) [(Assignment (Var 10 j) (IntegerBinOp (Var 10 j) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 10 pos) [(() (Var 10 j) ())] (Integer 4) ColMajor () ) (Var 10 i) () .false. .false. )] [] )] [] ) (Allocate [((Var 10 mask) [((IntegerConstant 1 (Integer 4) Decimal) (Var 10 j))] () () ())] () () () ) (DoLoop () ((Var 10 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 10 j) ()) [(Assignment (ArrayItem (Var 10 mask) [(() (Var 10 i) ())] (Integer 4) ColMajor () ) (ArrayItem (Var 10 pos) [(() (Var 10 i) ())] (Integer 4) ColMajor () ) () .false. .false. )] [] )] (Var 10 mask) Public .true. .true. () ), change_positions_tmpl: (ExternalSymbol 8 change_positions_tmpl 2 change_positions_tmpl template_02_m [] change_positions_tmpl Public ), eq: (ExternalSymbol 8 eq 2 eq template_02_m [] eq Public ), ~neq: (CustomOperator 8 ~neq [8 ~neq_intrinsic 8 ~neq_intrinsic1] Public ), ~neq_intrinsic: (Function (SymbolTable 9 { arg0: (Variable 9 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 9 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 9 ret [] ReturnVar () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~neq_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 9 arg0) (Var 9 arg1)] [(Assignment (Var 9 ret) (IntegerCompare (Var 9 arg0) NotEq (Var 9 arg1) (Logical 4) () ) () .false. .false. )] (Var 9 ret) Public .true. .true. () ), ~neq_intrinsic1: (Function (SymbolTable 11 { arg0: (Variable 11 arg0 [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 11 arg1 [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 11 ret [] ReturnVar () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~neq_intrinsic1 (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 11 arg0) (Var 11 arg1)] [(Assignment (Var 11 ret) (StringCompare (Var 11 arg0) NotEq (Var 11 arg1) (Logical 4) () ) () .false. .false. )] (Var 11 ret) Public .true. .true. () ) }) template_02 [template_02_m] [(Print (StringFormat () [(FunctionCall 8 change_positions_int () [((ArrayPhysicalCast (ArrayConstant 28 [3, 3, 6, ...., 2, 2, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] DescriptorArray ) () ))] (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 8 change_positions_chr () [((ArrayPhysicalCast (ArrayConstant 7 ["a", "a", "b", ...., "p", "p", "o"] (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] PointerArray ) ColMajor ) PointerArray DescriptorArray (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] DescriptorArray ) () ))] (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), template_02_m: (Module (SymbolTable 2 { change_positions_tmpl: (Template (SymbolTable 5 { change_positions_t: (Function (SymbolTable 7 { i: (Variable 7 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 7 j [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), mask: (Variable 7 mask [] ReturnVar () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 7 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pos: (Variable 7 pos [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), vec: (Variable 7 vec [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) change_positions_t (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [ne] [(Var 7 vec)] [(Assignment (Var 7 n) (ArraySize (Var 7 vec) () (Integer 4) () ) () .false. .false. ) (Allocate [((Var 7 pos) [((IntegerConstant 1 (Integer 4) Decimal) (Var 7 n))] () () ())] () () () ) (If () (IntegerCompare (Var 7 n) Lt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Return)] [] ) (Assignment (Var 7 pos) (ArrayBroadcast (IntegerConstant 0 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 7 pos)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) () .false. .false. ) (Assignment (ArrayItem (Var 7 pos) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 7 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 7 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 7 n) ()) [(If () (FunctionCall 5 ne () [((ArrayItem (Var 7 vec) [(() (Var 7 i) ())] (TypeParameter t ) ColMajor () )) ((ArrayItem (Var 7 vec) [(() (IntegerBinOp (Var 7 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (TypeParameter t ) ColMajor () ))] (Logical 4) () () ) [(Assignment (Var 7 j) (IntegerBinOp (Var 7 j) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 7 pos) [(() (Var 7 j) ())] (Integer 4) ColMajor () ) (Var 7 i) () .false. .false. )] [] )] [] ) (Allocate [((Var 7 mask) [((IntegerConstant 1 (Integer 4) Decimal) (Var 7 j))] () () ())] () () () ) (DoLoop () ((Var 7 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 7 j) ()) [(Assignment (ArrayItem (Var 7 mask) [(() (Var 7 i) ())] (Integer 4) ColMajor () ) (ArrayItem (Var 7 pos) [(() (Var 7 i) ())] (Integer 4) ColMajor () ) () .false. .false. )] [] )] (Var 7 mask) Public .true. .true. () ), ne: (Function (SymbolTable 6 { lhs: (Variable 6 lhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ne: (Variable 6 ne [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 6 rhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ne (FunctionType [(TypeParameter t ) (TypeParameter t )] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 6 lhs) (Var 6 rhs)] [] (Var 6 ne) Public .true. .true. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) change_positions_tmpl [t ne] [(Require eq [t ne] )] ), eq: (Requirement (SymbolTable 3 { ne: (Function (SymbolTable 4 { lhs: (Variable 4 lhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ne: (Variable 4 ne [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 4 rhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ne (FunctionType [(TypeParameter t ) (TypeParameter t )] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 lhs) (Var 4 rhs)] [] (Var 4 ne) Public .true. .true. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) eq [t ne] [] ) }) template_02_m () [template_02_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/run-array_bounds_check_15-9f619ed.stderr0000664000175000017500000000023115174404631026162 0ustar alastairalastairruntime error: Argument 1 is unallocated. --> tests/errors/array_bounds_check_15.f90:6:14 | 6 | print *, x | ^ This is unallocated ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootlfortran-0.63.0/tests/reference/asr-incompatible_dimension_logical_arrays_logical_binop_02-5be1708.stderrlfortran-0.63.0/tests/reference/asr-incompatible_dimension_logical_arrays_logical_binop_02-5be1708.s0000664000175000017500000000031315174404631033625 0ustar alastairalastairsemantic error: Shapes for operands are not conformable --> tests/errors/incompatible_dimension_logical_arrays_logical_binop_02.f90:4:14 | 4 | print *, x1 .neqv. x2 | ^^ ^^ lfortran-0.63.0/tests/reference/ast_f90-substring-73a0b8e.stdout0000664000175000017500000000031515174404631024515 0ustar alastairalastairprogram substring implicit none character(len=5) :: str character(len=5), parameter :: s = "Hello World"(7:11) str = "12345"(2:4) print *, str print *, s print *, "SubString"(4:9) end program substring lfortran-0.63.0/tests/reference/asr-function_call1-0b992da.json0000664000175000017500000000073715174404631024356 0ustar alastairalastair{ "basename": "asr-function_call1-0b992da", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/function_call1.f90", "infile_hash": "45acf463b1d977f1bdf3d9420205c7979fc03de58d60260cb37fd0bc", "outfile": null, "outfile_hash": null, "stdout": "asr-function_call1-0b992da.stdout", "stdout_hash": "cf37fdb1b7654974b79318e199e2079ad798f18eed3ff7da68c815dc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-associate1-2443d15.stdout0000664000175000017500000000241715174404631023715 0ustar alastairalastair(TranslationUnit [(AssociateBlock 0 () [(x [] [] () y Arrow ())] [] () () ) (AssociateBlock 0 () [(x [] [] () (Parenthesis y ) Arrow ())] [] () () ) (AssociateBlock 0 () [(x [] [] () (+ y z) Arrow ())] [] () () ) (AssociateBlock 0 () [(x [] [] () (u- y) Arrow ())] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SubroutineCall 0 some_subroutine [] [(() x () 0) (() (Parenthesis x ) () 0)] [] [] () ) (Assignment 0 x (FuncCallOrArray f [] [(() (Parenthesis x ) () 0)] [] [] [] ) () )] ) lfortran-0.63.0/tests/reference/asr_enable_style_suggestion-style1-a2fdd22.stderr0000664000175000017500000000106015174404631030265 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/style1.f90:4:11 | 4 | if (y .eq. 1) then | ^^^^ help: write this as '==' style suggestion: Use '==' instead of '.eq.' --> tests/style1.f90:10:15 | 10 | if (x .eq. 1) then | ^^^^ help: write this as '==' warning: Assuming implicit save attribute for variable declaration --> tests/style1.f90:9:20 | 9 | integer :: x = 5 | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement lfortran-0.63.0/tests/reference/asr-func_parameter_type_02-cef1ab3.json0000664000175000017500000000106315174404631026135 0ustar alastairalastair{ "basename": "asr-func_parameter_type_02-cef1ab3", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/func_parameter_type_02.f90", "infile_hash": "ed02fab8e69756cf65ecfb2f1861cf6fb9628838d09b3ce6875e0ffd", "outfile": null, "outfile_hash": null, "stdout": "asr-func_parameter_type_02-cef1ab3.stdout", "stdout_hash": "a16ef159c3652f1c68354c5107b47cd535102df58133065e07864f30", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-arrays_01_real-6c5e850.json0000664000175000017500000000076715174404631024376 0ustar alastairalastair{ "basename": "llvm-arrays_01_real-6c5e850", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01_real.f90", "infile_hash": "52d4b470c5523650dead5fa570d62db7293b9ecd23758e3cc4ba28c2", "outfile": null, "outfile_hash": null, "stdout": "llvm-arrays_01_real-6c5e850.stdout", "stdout_hash": "678fb87712f28eea2eb2b5c0b36dbc7a8d590462d7f3faaa1faeaec4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-arrays_01_real-6cb0873.stdout0000664000175000017500000010600315174404631024545 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_01_real: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) arrays_01_real [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 8) ColMajor () ) (Cast (IntegerBinOp (Var 2 i) Add (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () () ) () .false. .false. )] [] ) (If () (RealCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 11.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 12 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 12.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 13 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 13.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 11 (Integer 4) Decimal) (IntegerConstant 14 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 b) [(() (IntegerBinOp (Var 2 i) Sub (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 8) ColMajor () ) (Cast (Var 2 i) IntegerToReal (Real 8) () () ) () .false. .false. )] [] ) (If () (RealCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 11.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 12 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 12.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 13 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 13.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 14 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 14.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Real 8) ColMajor () ) (RealBinOp (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 8) ColMajor () ) Sub (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 10.000000 (Real 8) ) () ) (Real 8) () ) () .false. .false. )] [] ) (If () (RealCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 1.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 2.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 3.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) (RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) Add (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) (Real 8) () ) Add (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) (Real 8) () ) Add (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) (Real 8) () ) () .false. .false. ) (If () (RealCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 17 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 17.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) () .false. .false. ) (If () (RealCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 11.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 8) ColMajor () ) (Cast (IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () ) Add (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () () ) () .false. .false. )] [] )] [] ) (If () (RealCompare (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 12 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 12.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 13 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 13.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 c) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 13 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 13.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 c) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 14 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 14.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-max_01-415ceb0.stderr0000664000175000017500000000036115174404631023056 0ustar alastairalastairwarning: Different kinds of args in max0 is a non-standard extension --> tests/../integration_tests/max_01.f90:6:14 | 6 | print *, max(y, z) | ^^^^^^^^^ help: ensure all arguments have the same kind to make it standard lfortran-0.63.0/tests/reference/run-integer_overflow-3cf26f8.stderr0000664000175000017500000000007315174404631025406 0ustar alastairalastairError: Value 2147483648 is out of integer(4) range (file). lfortran-0.63.0/tests/reference/asr-forall_01-11937e6.stdout0000664000175000017500000000732715174404631023454 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { forall_01: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivec: (Variable 2 ivec [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) forall_01 [] [(ForAllSingle ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) (Assignment (ArrayItem (Var 2 ivec) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) ) (Print (StringFormat () [(Var 2 ivec)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-intrinsics_13-07b50ad.stdout0000664000175000017500000004266215174404631024511 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_13: (Program (SymbolTable 2 { p: (Variable 2 p [] Local (TypeInquiry Kind (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p1: (Variable 2 p1 [] Local (TypeInquiry Kind (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p2: (Variable 2 p2 [] Local (TypeInquiry Kind (Integer 8) (IntegerConstant 5 (Integer 8) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p3: (Variable 2 p3 [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p4: (Variable 2 p4 [] Local (TypeInquiry Kind (Real 4) (RealConstant 0.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p5: (Variable 2 p5 [] Local (TypeInquiry Kind (Real 4) (RealConstant 5.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p6: (Variable 2 p6 [] Local (TypeInquiry Kind (Real 8) (RealConstant 5.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p7: (Variable 2 p7 [] Local (TypeInquiry Kind (Logical 4) (LogicalConstant .true. (Logical 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_13 [] [(If () (LogicalBinOp (LogicalBinOp (IntegerCompare (Var 2 p) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) And (IntegerCompare (Var 2 p1) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) And (IntegerCompare (Var 2 p2) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (LogicalBinOp (IntegerCompare (Var 2 p3) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) And (IntegerCompare (Var 2 p4) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) And (IntegerCompare (Var 2 p5) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntegerCompare (Var 2 p6) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) And (IntegerCompare (Var 2 p7) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-common_03-9052466.stdout0000664000175000017500000012150115174404631023376 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { common3: (Program (SymbolTable 5 { 1_b_e: (ExternalSymbol 5 1_b_e 7 e b [] e Public ), 1_sample_a: (ExternalSymbol 5 1_sample_a 4 a sample [] a Public ), 1_sample_b: (ExternalSymbol 5 1_sample_b 4 b sample [] b Public ), sample: (ExternalSymbol 5 sample 3 sample file_common_block_sample [] sample Public ), struct_instance_b: (ExternalSymbol 5 struct_instance_b 6 struct_instance_b file_common_block_b [] struct_instance_b Public ), struct_instance_sample: (ExternalSymbol 5 struct_instance_sample 3 struct_instance_sample file_common_block_sample [] struct_instance_sample Public ) }) common3 [] [(Assignment (StructInstanceMember (Var 5 struct_instance_sample) 5 1_sample_a (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) (ArrayConstant 8 [1.00000000e+01, 1.10000000e+01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 struct_instance_sample) 5 1_sample_b (Real 4) () ) (RealConstant 20.000000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 struct_instance_b) 5 1_b_e (Integer 4) () ) (IntegerConstant 123 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 1 pass () [] () .false. )] ), file_common_block_b: (Module (SymbolTable 6 { b: (Struct (SymbolTable 7 { d: (Variable 7 d [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), e: (Variable 7 e [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Variable 7 f [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) b (StructType [] [] .true. .false. ) [] [d e f] [] Source Public .false. .false. [] () () [] ), struct_instance_b: (Variable 6 struct_instance_b [] Local () () Default (StructType [] [] .true. .false. ) 6 b Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) file_common_block_b () [] .false. .false. .false. ), file_common_block_blank#block: (Module (SymbolTable 8 { blank#block: (Struct (SymbolTable 9 { z1: (Variable 9 z1 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z2: (Variable 9 z2 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) blank#block (StructType [] [] .true. .false. ) [] [z1 z2] [] Source Public .false. .false. [] () () [] ), struct_instance_blank#block: (Variable 8 struct_instance_blank#block [] Local () () Default (StructType [] [] .true. .false. ) 8 blank#block Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) file_common_block_blank#block () [] .false. .false. .false. ), file_common_block_c: (Module (SymbolTable 10 { c: (Struct (SymbolTable 11 { c: (Variable 11 c [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), g: (Variable 11 g [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), h: (Variable 11 h [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 11 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) c (StructType [] [] .true. .false. ) [] [c g h j] [] Source Public .false. .false. [] () () [] ), struct_instance_c: (Variable 10 struct_instance_c [] Local () () Default (StructType [] [] .true. .false. ) 10 c Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) file_common_block_c () [] .false. .false. .false. ), file_common_block_sample: (Module (SymbolTable 3 { sample: (Struct (SymbolTable 4 { a: (Variable 4 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 4 i [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sample (StructType [] [] .true. .false. ) [] [a b i] [] Source Public .false. .false. [] () () [] ), struct_instance_sample: (Variable 3 struct_instance_sample [] Local () () Default (StructType [] [] .true. .false. ) 3 sample Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) file_common_block_sample () [] .false. .false. .false. ), pass: (Function (SymbolTable 2 { 1_sample_a: (ExternalSymbol 2 1_sample_a 4 a sample [] a Public ), 1_sample_b: (ExternalSymbol 2 1_sample_b 4 b sample [] b Public ), e: (Variable 2 e [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sample: (ExternalSymbol 2 sample 3 sample file_common_block_sample [] sample Public ), struct_instance_sample: (ExternalSymbol 2 struct_instance_sample 3 struct_instance_sample file_common_block_sample [] struct_instance_sample Public ) }) pass (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (StructInstanceMember (Var 2 struct_instance_sample) 2 1_sample_a (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 10.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (StructInstanceMember (Var 2 struct_instance_sample) 2 1_sample_b (Real 4) () ) Sub (RealConstant 20.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(StructInstanceMember (Var 2 struct_instance_sample) 2 1_sample_a (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) (StructInstanceMember (Var 2 struct_instance_sample) 2 1_sample_b (Real 4) () ) (Var 2 e)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/julia-subroutine7-e0b863b.stdout0000664000175000017500000000014615174404631024624 0ustar alastairalastairfunction f(a::Base.RefValue{Int32}, b::Base.RefValue{Int32}) a[] = b[] + 1 b[] = a[] + 1 end lfortran-0.63.0/tests/reference/asr-intrinsics_12-ff7ce44.json0000664000175000017500000000076115174404631024231 0ustar alastairalastair{ "basename": "asr-intrinsics_12-ff7ce44", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_12.f90", "infile_hash": "7f3ef938f03d46035bb9c845b8ab1b15ac06b209b8b464f50486baf8", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_12-ff7ce44.stdout", "stdout_hash": "26e482501e820a6b861be4230bd5d6df4bd0d3ca03099b86ebf5336c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-forallloop_01-d1e2bfa.stdout0000664000175000017500000001606415174404631024633 0ustar alastairalastair(TranslationUnit [(Program forallloop_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 10000 DimensionExpr)] )] [(a [] [] () () None ()) (b [] [] () () None ()) (c [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(scalar [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (nsize [] [] () () None ())] () )] [(Assignment 0 scalar 10 () ) (Assignment 0 nsize (FuncCallOrArray size [] [(() a () 0)] [] [] [] ) () ) (ForAll 0 () [(ConcurrentControl i 1 nsize () )] () [] [(Assignment 0 (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) 5 () ) (Assignment 0 (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) 5 () )] () () ) (SubroutineCall 0 triad [] [(() a () 0) (() b () 0) (() scalar () 0) (() c () 0)] [] [] () ) (Print 0 () [(String "End Stream Triad" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Subroutine triad [(a) (b) (scalar) (c)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [(() () DimensionExpr)] [] () () None ()) (b [(() () DimensionExpr)] [] () () None ()) (scalar [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(c [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(N [] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 N (FuncCallOrArray size [] [(() a () 0)] [] [] [] ) () ) (ForAllSingle 0 () [(ConcurrentControl i 1 N () )] () (Assignment 0 (FuncCallOrArray c [] [(() i () 0)] [] [] [] ) (+ (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (* scalar (FuncCallOrArray b [] [(() i () 0)] [] [] [] ))) () ) () )] [] [] )] )] ) lfortran-0.63.0/tests/reference/llvm-finalize_01-5496007.stdout0000664000175000017500000004352715174404631024104 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %array.1 = type { i32*, i64, i32, i8, i8, i8, i8, i64, [1 x %dimension_descriptor] } %dimension_descriptor = type { i64, i64, i64 } %string_descriptor = type <{ i8*, i64 }> %array.2 = type { float*, i64, i32, i8, i8, i8, i8, i64, [2 x %dimension_descriptor] } @0 = private unnamed_addr constant [4 x i8] c"arr\00", align 1 @1 = private unnamed_addr constant [22 x i8] c"tests/finalize_01.f90\00", align 1 @2 = private unnamed_addr constant [53 x i8] c"Cannot allocate '%s' because it is already allocated\00", align 1 @3 = private unnamed_addr constant [55 x i8] c"Attempting to allocate already allocated variable '%s'\00", align 1 @__Wrong_allocation = private unnamed_addr constant [51 x i8] c"Attempting to allocate already allocated variable!\00", align 1 define void @__module_finalize_01_mod_ss() { .entry: %0 = call i8* @_lfortran_get_default_allocator() %arr_desc = alloca %array.1, align 8 %arr = alloca %array.1*, align 8 store %array.1* null, %array.1** %arr, align 8 %1 = getelementptr %array.1, %array.1* %arr_desc, i32 0, i32 8 %2 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %1, i32 0, i32 0 %3 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %2, i32 0 %4 = getelementptr %dimension_descriptor, %dimension_descriptor* %3, i32 0, i32 0 store i64 1, i64* %4, align 8 %5 = getelementptr %dimension_descriptor, %dimension_descriptor* %3, i32 0, i32 1 store i64 1, i64* %5, align 8 %6 = getelementptr %dimension_descriptor, %dimension_descriptor* %3, i32 0, i32 2 store i64 0, i64* %6, align 8 %7 = getelementptr %array.1, %array.1* %arr_desc, i32 0, i32 3 store i8 1, i8* %7, align 1 %8 = getelementptr %array.1, %array.1* %arr_desc, i32 0, i32 0 store i32* null, i32** %8, align 8 store %array.1* %arr_desc, %array.1** %arr, align 8 %9 = load %array.1*, %array.1** %arr, align 8 %10 = ptrtoint %array.1* %9 to i64 %11 = icmp eq i64 %10, 0 br i1 %11, label %merge_allocated, label %check_data check_data: ; preds = %.entry %12 = getelementptr %array.1, %array.1* %9, i32 0, i32 0 %13 = load i32*, i32** %12, align 8 %14 = ptrtoint i32* %13 to i64 %15 = icmp ne i64 %14, 0 br label %merge_allocated merge_allocated: ; preds = %check_data, %.entry %is_allocated = phi i1 [ false, %.entry ], [ %15, %check_data ] br i1 %is_allocated, label %then, label %ifcont then: ; preds = %merge_allocated %16 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %17 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %18 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %17, i32 0, i32 0 %19 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 0 store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @1, i32 0, i32 0), i8** %19, align 8 %20 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 1 store i32 15, i32* %20, align 4 %21 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 2 store i32 18, i32* %21, align 4 %22 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 3 store i32 15, i32* %22, align 4 %23 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 4 store i32 24, i32* %23, align 4 %24 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @0, i32 0, i32 0)) %25 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %16, i32 0, i32 0 %26 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %17, i32 0, i32 0 %27 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %25, i32 0, i32 2 %28 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %25, i32 0, i32 0 store i1 true, i1* %28, align 1 %29 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %25, i32 0, i32 1 store i8* %24, i8** %29, align 8 store { i8*, i32, i32, i32, i32 }* %26, { i8*, i32, i32, i32, i32 }** %27, align 8 %30 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %25, i32 0, i32 3 store i32 1, i32* %30, align 4 %31 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %16, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %31, i32 1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont: ; preds = %merge_allocated %32 = load %array.1*, %array.1** %arr, align 8 %33 = getelementptr %array.1, %array.1* %32, i32 0, i32 7 store i64 0, i64* %33, align 8 %34 = getelementptr %array.1, %array.1* %32, i32 0, i32 8 %35 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %34, i32 0, i32 0 %36 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %35, i32 0 %37 = getelementptr %dimension_descriptor, %dimension_descriptor* %36, i32 0, i32 2 %38 = getelementptr %dimension_descriptor, %dimension_descriptor* %36, i32 0, i32 0 %39 = getelementptr %dimension_descriptor, %dimension_descriptor* %36, i32 0, i32 1 store i64 1, i64* %37, align 8 store i64 1, i64* %38, align 8 store i64 10, i64* %39, align 8 %40 = getelementptr %array.1, %array.1* %32, i32 0, i32 0 %41 = call i8* @_lfortran_get_default_allocator() %42 = call i8* @_lfortran_malloc_alloc(i8* %41, i64 40) %43 = bitcast i8* %42 to i32* store i32* %43, i32** %40, align 8 br i1 true, label %then1, label %else then1: ; preds = %ifcont br label %return unreachable_after_return: ; No predecessors! br label %ifcont3 else: ; preds = %ifcont br label %return unreachable_after_return2: ; No predecessors! br label %ifcont3 ifcont3: ; preds = %unreachable_after_return2, %unreachable_after_return br label %return return: ; preds = %ifcont3, %else, %then1 br label %FINALIZE_SYMTABLE_ss FINALIZE_SYMTABLE_ss: ; preds = %return br label %Finalize_Variable_arr Finalize_Variable_arr: ; preds = %FINALIZE_SYMTABLE_ss %44 = load %array.1*, %array.1** %arr, align 8 call void @finalize_allocatable__Array_1_i32(%array.1* %44) ret void } declare i8* @_lcompilers_snprintf_alloc(i8*, i8*, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lcompilers_runtime_error(i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) declare void @exit(i32) declare i8* @_lfortran_malloc_alloc(i8*, i64) define internal void @finalize_allocatable__Array_1_i32(%array.1* %0) { entry: %1 = icmp ne %array.1* %0, null br i1 %1, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %entry call void @finalize_descriptorArray_Array_1_i32(%array.1* %0) br label %is_allocated.ifcont is_allocated.else: ; preds = %entry br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %is_allocated.then ret void } define internal void @finalize_descriptorArray_Array_1_i32(%array.1* %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = getelementptr %array.1, %array.1* %0, i32 0, i32 0 %3 = load i32*, i32** %2, align 8 %4 = ptrtoint i32* %3 to i64 %5 = icmp ne i64 %4, 0 br i1 %5, label %then, label %else then: ; preds = %entry %6 = bitcast i32* %3 to i8* call void @_lfortran_free_alloc(i8* %1, i8* %6) br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then ret void } declare void @_lfortran_free_alloc(i8*, i8*) define i32 @main(i32 %0, i8** %1) { .entry: %2 = call i8* @_lfortran_get_default_allocator() %str = alloca %string_descriptor, align 8 %arr_desc = alloca %array.1, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %arr = alloca %array.1*, align 8 store %array.1* null, %array.1** %arr, align 8 %3 = getelementptr %array.1, %array.1* %arr_desc, i32 0, i32 8 %4 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %3, i32 0, i32 0 %5 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %4, i32 0 %6 = getelementptr %dimension_descriptor, %dimension_descriptor* %5, i32 0, i32 0 store i64 1, i64* %6, align 8 %7 = getelementptr %dimension_descriptor, %dimension_descriptor* %5, i32 0, i32 1 store i64 1, i64* %7, align 8 %8 = getelementptr %dimension_descriptor, %dimension_descriptor* %5, i32 0, i32 2 store i64 0, i64* %8, align 8 %9 = getelementptr %array.1, %array.1* %arr_desc, i32 0, i32 3 store i8 1, i8* %9, align 1 %10 = getelementptr %array.1, %array.1* %arr_desc, i32 0, i32 0 store i32* null, i32** %10, align 8 store %array.1* %arr_desc, %array.1** %arr, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %str, align 1 %11 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 0 %12 = load i8*, i8** %11, align 8 %13 = icmp ne i8* %12, null br i1 %13, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @__Wrong_allocation, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %14 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 0 %15 = call i8* @_lfortran_get_default_allocator() %16 = call i8* @_lfortran_malloc_alloc(i8* %15, i64 10) store i8* %16, i8** %14, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 1 store i64 10, i64* %17, align 8 call void @__module_finalize_01_mod_ss() call void @internal_sub() br label %return unreachable_after_return: ; No predecessors! br label %return return: ; preds = %unreachable_after_return, %ifcont br label %FINALIZE_SYMTABLE_finalize_01 FINALIZE_SYMTABLE_finalize_01: ; preds = %return br label %Finalize_Variable_arr Finalize_Variable_arr: ; preds = %FINALIZE_SYMTABLE_finalize_01 %18 = load %array.1*, %array.1** %arr, align 8 call void @finalize_allocatable__Array_1_i32(%array.1* %18) br label %Finalize_Variable_str Finalize_Variable_str: ; preds = %Finalize_Variable_arr %19 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 0 %20 = load i8*, i8** %19, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %20) call void @_lfortran_internal_alloc_finalize() ret i32 0 } define void @internal_sub() { .entry: %0 = call i8* @_lfortran_get_default_allocator() %arr_desc1 = alloca %array.1, align 8 %str = alloca %string_descriptor, align 8 %arr_desc = alloca %array.2, align 8 %arr_real = alloca %array.2*, align 8 store %array.2* null, %array.2** %arr_real, align 8 %1 = getelementptr %array.2, %array.2* %arr_desc, i32 0, i32 8 %2 = getelementptr [2 x %dimension_descriptor], [2 x %dimension_descriptor]* %1, i32 0, i32 0 %3 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %2, i32 0 %4 = getelementptr %dimension_descriptor, %dimension_descriptor* %3, i32 0, i32 0 store i64 1, i64* %4, align 8 %5 = getelementptr %dimension_descriptor, %dimension_descriptor* %3, i32 0, i32 1 store i64 1, i64* %5, align 8 %6 = getelementptr %dimension_descriptor, %dimension_descriptor* %3, i32 0, i32 2 store i64 0, i64* %6, align 8 %7 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %2, i32 1 %8 = getelementptr %dimension_descriptor, %dimension_descriptor* %7, i32 0, i32 0 store i64 1, i64* %8, align 8 %9 = getelementptr %dimension_descriptor, %dimension_descriptor* %7, i32 0, i32 1 store i64 1, i64* %9, align 8 %10 = getelementptr %dimension_descriptor, %dimension_descriptor* %7, i32 0, i32 2 store i64 0, i64* %10, align 8 %11 = getelementptr %array.2, %array.2* %arr_desc, i32 0, i32 3 store i8 2, i8* %11, align 1 %12 = getelementptr %array.2, %array.2* %arr_desc, i32 0, i32 0 store float* null, float** %12, align 8 store %array.2* %arr_desc, %array.2** %arr_real, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %str, align 1 br label %bl.start bl.start: ; preds = %.entry %13 = call i8* @llvm.stacksave() %arr_in_block = alloca %array.1*, align 8 store %array.1* null, %array.1** %arr_in_block, align 8 %14 = getelementptr %array.1, %array.1* %arr_desc1, i32 0, i32 8 %15 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %14, i32 0, i32 0 %16 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %15, i32 0 %17 = getelementptr %dimension_descriptor, %dimension_descriptor* %16, i32 0, i32 0 store i64 1, i64* %17, align 8 %18 = getelementptr %dimension_descriptor, %dimension_descriptor* %16, i32 0, i32 1 store i64 1, i64* %18, align 8 %19 = getelementptr %dimension_descriptor, %dimension_descriptor* %16, i32 0, i32 2 store i64 0, i64* %19, align 8 %20 = getelementptr %array.1, %array.1* %arr_desc1, i32 0, i32 3 store i8 1, i8* %20, align 1 %21 = getelementptr %array.1, %array.1* %arr_desc1, i32 0, i32 0 store i32* null, i32** %21, align 8 store %array.1* %arr_desc1, %array.1** %arr_in_block, align 8 br label %bl.end unreachable_after_exit: ; No predecessors! br label %return unreachable_after_return: ; No predecessors! br label %bl.end bl.end: ; preds = %unreachable_after_return, %bl.start br label %FINALIZE_SYMTABLE_bl FINALIZE_SYMTABLE_bl: ; preds = %bl.end br label %Finalize_Variable_arr_in_block Finalize_Variable_arr_in_block: ; preds = %FINALIZE_SYMTABLE_bl %22 = load %array.1*, %array.1** %arr_in_block, align 8 call void @finalize_allocatable__Array_1_i32(%array.1* %22) call void @llvm.stackrestore(i8* %13) br label %loop.head loop.head: ; preds = %unreachable_after_return2, %Finalize_Variable_arr_in_block br i1 true, label %loop.body, label %loop.end loop.body: ; preds = %loop.head br label %return unreachable_after_return2: ; No predecessors! br label %loop.head loop.end: ; preds = %loop.head br label %return return: ; preds = %loop.end, %loop.body, %unreachable_after_exit br label %FINALIZE_SYMTABLE_internal_sub FINALIZE_SYMTABLE_internal_sub: ; preds = %return br label %Finalize_Variable_arr_real Finalize_Variable_arr_real: ; preds = %FINALIZE_SYMTABLE_internal_sub %23 = load %array.2*, %array.2** %arr_real, align 8 call void @finalize_allocatable__Array_2_r32(%array.2* %23) br label %Finalize_Variable_str Finalize_Variable_str: ; preds = %Finalize_Variable_arr_real %24 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 0 %25 = load i8*, i8** %24, align 8 call void @_lfortran_free_alloc(i8* %0, i8* %25) ret void } ; Function Attrs: nounwind declare i8* @llvm.stacksave() #0 ; Function Attrs: nounwind declare void @llvm.stackrestore(i8*) #0 define internal void @finalize_allocatable__Array_2_r32(%array.2* %0) { entry: %1 = icmp ne %array.2* %0, null br i1 %1, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %entry call void @finalize_descriptorArray_Array_2_r32(%array.2* %0) br label %is_allocated.ifcont is_allocated.else: ; preds = %entry br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %is_allocated.then ret void } define internal void @finalize_descriptorArray_Array_2_r32(%array.2* %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = getelementptr %array.2, %array.2* %0, i32 0, i32 0 %3 = load float*, float** %2, align 8 %4 = ptrtoint float* %3 to i64 %5 = icmp ne i64 %4, 0 br i1 %5, label %then, label %else then: ; preds = %entry %6 = bitcast float* %3 to i8* call void @_lfortran_free_alloc(i8* %1, i8* %6) br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then ret void } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() attributes #0 = { nounwind } lfortran-0.63.0/tests/reference/asr-derived_types_06-847ca73.stdout0000664000175000017500000040275615174404631025136 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { tomlf_datetime: (Module (SymbolTable 7 { date_to_string: (Function (SymbolTable 11 { 1_toml_date_day: (ExternalSymbol 11 1_toml_date_day 8 day toml_date [] day Public ), 1_toml_date_month: (ExternalSymbol 11 1_toml_date_month 8 month toml_date [] month Public ), 1_toml_date_year: (ExternalSymbol 11 1_toml_date_year 8 year toml_date [] year Public ), lfortran_iomsg: (Variable 11 lfortran_iomsg [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lhs: (Variable 11 lhs [] Out () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 11 rhs [] In () () Default (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .false. .false. ) 7 toml_date Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) date_to_string (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 lhs) (Var 11 rhs)] [(Allocate [((Var 11 lhs) [] (IntegerConstant 10 (Integer 4) Decimal) () (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString))] () () () ) (FileWrite 0 (Var 11 lhs) (Var 11 lfortran_iomsg) () () [(StringFormat (StringConstant "(i4.4,\"-\",i2.2,\"-\",i2.2)" (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(StructInstanceMember (Var 11 rhs) 11 1_toml_date_year (Integer 4) () ) (StructInstanceMember (Var 11 rhs) 11 1_toml_date_month (Integer 4) () ) (StructInstanceMember (Var 11 rhs) 11 1_toml_date_day (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () () )] () Private .true. .true. () ), datetime_to_string: (Function (SymbolTable 12 { 1_toml_date_date_to_string: (ExternalSymbol 12 1_toml_date_date_to_string 8 to_string toml_date [] to_string Public ), 1_toml_datetime_date: (ExternalSymbol 12 1_toml_datetime_date 9 date toml_datetime [] date Public ), 1_toml_datetime_time: (ExternalSymbol 12 1_toml_datetime_time 9 time toml_datetime [] time Public ), 1_toml_time_time_to_string: (ExternalSymbol 12 1_toml_time_time_to_string 10 to_string toml_time [] to_string Public ), lhs: (Variable 12 lhs [] Out () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 12 rhs [] In () () Default (StructType [(Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .false. .false. ) 7 toml_datetime Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), temporary: (Variable 12 temporary [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), time_to_string: (ExternalSymbol 12 time_to_string 7 time_to_string tomlf_datetime [] time_to_string Public ) }) datetime_to_string (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 lhs) (Var 12 rhs)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 12 rhs) 12 1_toml_datetime_date (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) () )] 0 (Logical 4) () ) [(SubroutineCall 12 1_toml_date_date_to_string () [((Var 12 lhs)) ((StructInstanceMember (Var 12 rhs) 12 1_toml_datetime_date (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) () ))] (StructInstanceMember (Var 12 rhs) 12 1_toml_datetime_date (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) () ) .false. ) (If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 12 rhs) 12 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () )] 0 (Logical 4) () ) [(SubroutineCall 12 1_toml_time_time_to_string () [((Var 12 temporary)) ((StructInstanceMember (Var 12 rhs) 12 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ))] (StructInstanceMember (Var 12 rhs) 12 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) .false. ) (Assignment (Var 12 lhs) (IntrinsicElementalFunction StringConcat [(Var 12 lhs) (Var 12 temporary)] 0 (String 1 () DeferredLength DescriptorString) () ) () .false. .false. )] [] )] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 12 rhs) 12 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () )] 0 (Logical 4) () ) [(Assignment (Var 12 lhs) (StructInstanceMember (Var 12 rhs) 12 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) (SubroutineCall 12 time_to_string 12 time_to_string [((Var 12 lhs)) ((StructInstanceMember (Var 12 rhs) 12 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ))] () .false. ) .false. .false. )] [] )] )] () Private .true. .true. () ), new_toml_time: (Function (SymbolTable 13 { 1_toml_time_hour: (ExternalSymbol 13 1_toml_time_hour 10 hour toml_time [] hour Public ), 1_toml_time_millisec: (ExternalSymbol 13 1_toml_time_millisec 10 millisec toml_time [] millisec Public ), 1_toml_time_minute: (ExternalSymbol 13 1_toml_time_minute 10 minute toml_time [] minute Public ), 1_toml_time_second: (ExternalSymbol 13 1_toml_time_second 10 second toml_time [] second Public ), 1_toml_time_zone: (ExternalSymbol 13 1_toml_time_zone 10 zone toml_time [] zone Public ), hour: (Variable 13 hour [] In () () Default (Integer 4) () Source Private Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), millisec: (Variable 13 millisec [] In () () Default (Integer 4) () Source Private Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), minute: (Variable 13 minute [] In () () Default (Integer 4) () Source Private Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), second: (Variable 13 second [] In () () Default (Integer 4) () Source Private Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 13 self [] ReturnVar () () Default (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 7 toml_time Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zone: (Variable 13 zone [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Private Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_toml_time (FunctionType [(Integer 4) (Integer 4) (Integer 4) (Integer 4) (String 1 () AssumedLength DescriptorString)] (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 13 hour) (Var 13 minute) (Var 13 second) (Var 13 millisec) (Var 13 zone)] [(If () (IntrinsicElementalFunction Present [(Var 13 hour)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 13 self) 13 1_toml_time_hour (Integer 4) () ) (Var 13 hour) () .false. .false. )] [] ) (If () (IntrinsicElementalFunction Present [(Var 13 minute)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 13 self) 13 1_toml_time_minute (Integer 4) () ) (Var 13 minute) () .false. .false. )] [] ) (If () (IntrinsicElementalFunction Present [(Var 13 second)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 13 self) 13 1_toml_time_second (Integer 4) () ) (Var 13 second) () .false. .false. )] [] ) (If () (IntrinsicElementalFunction Present [(Var 13 millisec)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 13 self) 13 1_toml_time_millisec (Allocatable (Integer 4) ) () ) (Var 13 millisec) () .false. .false. )] [] ) (If () (IntrinsicElementalFunction Present [(Var 13 zone)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 13 self) 13 1_toml_time_zone (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 13 zone) () .false. .false. )] [] )] (Var 13 self) Private .true. .true. () ), time_to_string: (Function (SymbolTable 14 { 1_toml_time_hour: (ExternalSymbol 14 1_toml_time_hour 10 hour toml_time [] hour Public ), 1_toml_time_millisec: (ExternalSymbol 14 1_toml_time_millisec 10 millisec toml_time [] millisec Public ), 1_toml_time_minute: (ExternalSymbol 14 1_toml_time_minute 10 minute toml_time [] minute Public ), 1_toml_time_second: (ExternalSymbol 14 1_toml_time_second 10 second toml_time [] second Public ), 1_toml_time_zone: (ExternalSymbol 14 1_toml_time_zone 10 zone toml_time [] zone Public ), lfortran_iomsg: (Variable 14 lfortran_iomsg [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lfortran_iomsg1: (Variable 14 lfortran_iomsg1 [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lhs: (Variable 14 lhs [] Out () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 14 rhs [] In () () Default (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 7 toml_time Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) time_to_string (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 14 lhs) (Var 14 rhs)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 14 rhs) 14 1_toml_time_millisec (Allocatable (Integer 4) ) () )] 0 (Logical 4) () ) [(Allocate [((Var 14 lhs) [] (IntegerConstant 12 (Integer 4) Decimal) () (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString))] () () () ) (FileWrite 0 (Var 14 lhs) (Var 14 lfortran_iomsg) () () [(StringFormat (StringConstant "(i2.2,\":\",i2.2,\":\",i2.2,\".\",i3.3)" (String 1 (IntegerConstant 33 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(StructInstanceMember (Var 14 rhs) 14 1_toml_time_hour (Integer 4) () ) (StructInstanceMember (Var 14 rhs) 14 1_toml_time_minute (Integer 4) () ) (StructInstanceMember (Var 14 rhs) 14 1_toml_time_second (Integer 4) () ) (StructInstanceMember (Var 14 rhs) 14 1_toml_time_millisec (Allocatable (Integer 4) ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () () )] [(Allocate [((Var 14 lhs) [] (IntegerConstant 8 (Integer 4) Decimal) () (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString))] () () () ) (FileWrite 0 (Var 14 lhs) (Var 14 lfortran_iomsg1) () () [(StringFormat (StringConstant "(i2.2,\":\",i2.2,\":\",i2.2)" (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(StructInstanceMember (Var 14 rhs) 14 1_toml_time_hour (Integer 4) () ) (StructInstanceMember (Var 14 rhs) 14 1_toml_time_minute (Integer 4) () ) (StructInstanceMember (Var 14 rhs) 14 1_toml_time_second (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () () )] ) (If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 14 rhs) 14 1_toml_time_zone (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(Assignment (Var 14 lhs) (IntrinsicElementalFunction StringConcat [(Var 14 lhs) (IntrinsicElementalFunction StringTrim [(StructInstanceMember (Var 14 rhs) 14 1_toml_time_zone (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (String 1 () DeferredLength DescriptorString) () ) () .false. .false. )] [] )] () Private .true. .true. () ), toml_date: (Struct (SymbolTable 8 { day: (Variable 8 day [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), month: (Variable 8 month [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), to_string: (StructMethodDeclaration 8 to_string rhs date_to_string 7 date_to_string Source .false. .false. ), year: (Variable 8 year [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~assign: (CustomOperator 8 ~assign [8 to_string] Public ) }) toml_date (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) [] [year month day] [] Source Private .false. .false. [] () () [] ), toml_datetime: (Struct (SymbolTable 9 { date: (Variable 9 date [] Local () () Default (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) 7 toml_date Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), time: (Variable 9 time [] Local () () Default (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 7 toml_time Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), to_string: (StructMethodDeclaration 9 to_string rhs datetime_to_string 7 datetime_to_string Source .false. .false. ), ~assign: (CustomOperator 9 ~assign [9 to_string] Public ) }) toml_datetime (StructType [(Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. ) [] [date time] [] Source Private .false. .false. [] () () [] ), toml_time: (Struct (SymbolTable 10 { hour: (Variable 10 hour [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), millisec: (Variable 10 millisec [] Local () () Default (Allocatable (Integer 4) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), minute: (Variable 10 minute [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), second: (Variable 10 second [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), to_string: (StructMethodDeclaration 10 to_string rhs time_to_string 7 time_to_string Source .false. .false. ), zone: (Variable 10 zone [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~assign: (CustomOperator 10 ~assign [10 to_string] Public ) }) toml_time (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [hour minute second millisec zone] [] Source Private .false. .false. [] () () [] ), ~toml_time: (GenericProcedure 7 ~toml_time [7 new_toml_time] Public ) }) tomlf_datetime () [tomlf_datetime] .true. .false. .false. ), tomlf_utils: (Module (SymbolTable 2 { convert_raw: (ExternalSymbol 2 convert_raw 4 convert_raw tomlf_utils_convert [] convert_raw Public ), new_toml_time@~toml_time: (ExternalSymbol 2 new_toml_time@~toml_time 7 new_toml_time tomlf_datetime [] new_toml_time Public ), toml_date: (ExternalSymbol 2 toml_date 7 toml_date tomlf_datetime [] toml_date Public ), toml_datetime: (ExternalSymbol 2 toml_datetime 7 toml_datetime tomlf_datetime [] toml_datetime Public ), toml_raw_to_timestamp: (ExternalSymbol 2 toml_raw_to_timestamp 4 toml_raw_to_timestamp tomlf_utils_convert [] toml_raw_to_timestamp Public ), toml_time: (ExternalSymbol 2 toml_time 7 toml_time tomlf_datetime [] toml_time Public ), ~toml_time: (ExternalSymbol 2 ~toml_time 7 ~toml_time tomlf_datetime [] ~toml_time Public ) }) tomlf_utils () [tomlf_utils_convert tomlf_datetime] .false. .false. .false. ), tomlf_utils_convert: (Module (SymbolTable 4 { convert_raw: (GenericProcedure 4 convert_raw [4 toml_raw_to_timestamp] Public ), new_toml_time@~toml_time: (ExternalSymbol 4 new_toml_time@~toml_time 7 new_toml_time tomlf_datetime [] new_toml_time Public ), toml_date: (ExternalSymbol 4 toml_date 7 toml_date tomlf_datetime [] toml_date Public ), toml_datetime: (ExternalSymbol 4 toml_datetime 7 toml_datetime tomlf_datetime [] toml_datetime Public ), toml_raw_to_timestamp: (Function (SymbolTable 5 { 1_toml_datetime_date: (ExternalSymbol 5 1_toml_datetime_date 9 date toml_datetime [] date Public ), dot_pos: (Variable 5 dot_pos [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), err: (Variable 5 err [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), first: (Variable 5 first [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), raw: (Variable 5 raw [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), stat: (Variable 5 stat [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), timestamp: (Variable 5 timestamp [] Out () () Default (StructType [(Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. ) 4 toml_datetime Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_raw_to_timestamp (FunctionType [(String 1 () AssumedLength DescriptorString) (StructType [(Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. )] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 raw) (Var 5 timestamp)] [(Assignment (Var 5 first) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 timestamp) 5 1_toml_datetime_date (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) () ) (StructConstructor 4 toml_date [((IntegerConstant 0 (Integer 4) Decimal)) ((IntegerConstant 0 (Integer 4) Decimal)) ((IntegerConstant 0 (Integer 4) Decimal))] (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) () ) () .false. .false. ) (Assignment (Var 5 stat) (IntegerCompare (Var 5 err) Eq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) () .false. .false. )] (Var 5 stat) Public .true. .true. () ), toml_time: (ExternalSymbol 4 toml_time 7 toml_time tomlf_datetime [] toml_time Public ), ~toml_time: (ExternalSymbol 4 ~toml_time 7 ~toml_time tomlf_datetime [] ~toml_time Public ) }) tomlf_utils_convert () [tomlf_datetime] .true. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-program_without_line_04-1467181.json0000664000175000017500000000100115174404631025765 0ustar alastairalastair{ "basename": "ast-program_without_line_04-1467181", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/program_without_line_04.f90", "infile_hash": "5dd71811b458116465222710dc3764ee1b6409e2319dd89a99e0bb1d", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-program_without_line_04-1467181.stderr", "stderr_hash": "22480cef181ec588afc64592b6fa0194336dc6923ce414c93fe29239", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-coarray_02-793f8b3.json0000664000175000017500000000073215174404631023344 0ustar alastairalastair{ "basename": "asr-coarray_02-793f8b3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/coarray_02.f90", "infile_hash": "44aa57421c584c7303ac985d318b599190ab1a634795e72cc1b3488a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-coarray_02-793f8b3.stderr", "stderr_hash": "08647c98a57c1f78ead31e8f8989aee8b6e65c75d38debbdf4739b7e", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-format_03-c54e532.json0000664000175000017500000000076015174404631023165 0ustar alastairalastair{ "basename": "ast-format_03-c54e532", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/format_03.f", "infile_hash": "107455615125bad6c1e6c16c87933b0eb35e24f89ade881088aa8acc", "outfile": null, "outfile_hash": null, "stdout": "ast-format_03-c54e532.stdout", "stdout_hash": "f6730381d2371bd1c655a9d3a7d35b47f4d6a952b429b6169f56fb37", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/fortran-int_to_int_cast_fortran_codegen-913a36c.stdout0000664000175000017500000000045715174404631031231 0ustar alastairalastairprogram implicitinttointcastexample implicit none integer(4) :: integervalue1 integer(8) :: integervalue2 integervalue1 = 10 integervalue2 = int(integervalue1, kind=8) print *, "Integer Value 1:", integervalue1 print *, "Integer Value 2 (Kind=8):", integervalue2 end program implicitinttointcastexample lfortran-0.63.0/tests/reference/asr-implied_do_loops3-1dce8fd.stdout0000664000175000017500000007004315174404631025573 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { implied_do_loop3: (Program (SymbolTable 2 { a: (Variable 2 a [j] Local (Cast (ArrayConstructor [(ImpliedDoLoop [(IntegerBinOp (Var 2 j) Mul (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () )] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [3, 6, 9] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) )] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [3, 6, 9] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ColMajor () ) IntegerToReal (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [3.00000000e+00, 6.00000000e+00, 9.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () ) (ArrayConstant 12 [3.00000000e+00, 6.00000000e+00, 9.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [j] Local (Cast (ArrayConstructor [(ImpliedDoLoop [(IntegerBinOp (Var 2 j) Mul (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [2, 4, 6] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) )] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [2, 4, 6] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ColMajor () ) IntegerToReal (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [2.00000000e+00, 4.00000000e+00, 6.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () ) (ArrayConstant 12 [2.00000000e+00, 4.00000000e+00, 6.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 2 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) implied_do_loop3 [] [(Print (StringConstant "Loop 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(ImpliedDoLoop [(Var 2 i) (ImpliedDoLoop [(IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4) () )] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Integer 4) () )] (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "Loop 2" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(ImpliedDoLoop [(ImpliedDoLoop [(RealBinOp (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 4) ColMajor () ) Mul (ArrayItem (Var 2 b) [(() (Var 2 j) ())] (Real 4) ColMajor () ) (Real 4) () )] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) () (Real 4) () )] (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Real 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "Loop 3" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(ImpliedDoLoop [(ImpliedDoLoop [(RealBinOp (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 4) ColMajor () ) Mul (ArrayItem (Var 2 b) [(() (Var 2 j) ())] (Real 4) ColMajor () ) (Real 4) () )] (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Real 4) () )] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) () (Real 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "Loop4" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(ImpliedDoLoop [(Var 2 i) (ImpliedDoLoop [(IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () ) (ImpliedDoLoop [(IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () ) Add (Var 2 k) (Integer 4) () )] (Var 2 k) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) () (Integer 4) () )] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) () (Integer 4) () )] (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "Loop5" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(ImpliedDoLoop [(Var 2 i) (ImpliedDoLoop [(IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4) () ) (ImpliedDoLoop [(IntegerBinOp (IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4) () ) Add (Var 2 k) (Integer 4) () )] (Var 2 k) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) () (Integer 4) () )] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) () (Integer 4) () )] (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/run-print_09-8516006.stdout0000664000175000017500000000040615174404631023261 0ustar alastairalastair0.140000001 123.456001 1.00000005E-03 1.49999996E-05 0.14000000000000001 456.78899999999999 1.0000000000000000E-004 0.140000001 123.456001 1.00000005E-03 1.49999996E-05 0.14000000000000001 456.78899999999999 1.0000000000000000E-004 lfortran-0.63.0/tests/reference/asr-fn6-a24010a.stdout0000664000175000017500000000012715174404631022406 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { }) [] ) lfortran-0.63.0/tests/reference/cpp-case_05-96724df.stdout0000664000175000017500000000206015174404631023164 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { static std::string grade="B"; if (grade == "A") { std::cout<< "Excellent!"< define i32 @__module_string_54_mod_double_(i32* %x) { .entry: %ret = alloca i32, align 4 %0 = load i32, i32* %x, align 4 %1 = mul i32 %0, 2 store i32 %1, i32* %ret, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_double_ FINALIZE_SYMTABLE_double_: ; preds = %return %2 = load i32, i32* %ret, align 4 ret i32 %2 } define void @__module_string_54_mod_foo_sub(i32* %x, %string_descriptor* %char) { .entry: br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_foo_sub FINALIZE_SYMTABLE_foo_sub: ; preds = %return ret void } define i32 @main(i32 %0, i8** %1) { .entry: %2 = call i8* @_lfortran_get_default_allocator() %char = alloca %string_descriptor, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store %string_descriptor zeroinitializer, %string_descriptor* %char, align 1 %3 = getelementptr %string_descriptor, %string_descriptor* %char, i32 0, i32 1 store i64 10, i64* %3, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %char, i32 0, i32 0 %5 = call i8* @_lfortran_get_default_allocator() %6 = call i8* @_lfortran_malloc_alloc(i8* %5, i64 10) store i8* %6, i8** %4, align 8 %x = alloca i32, align 4 store i32 10, i32* %x, align 4 call void @__module_string_54_mod_foo_sub(i32* %x, %string_descriptor* %char) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_string_54 FINALIZE_SYMTABLE_string_54: ; preds = %return br label %Finalize_Variable_char Finalize_Variable_char: ; preds = %FINALIZE_SYMTABLE_string_54 %7 = getelementptr %string_descriptor, %string_descriptor* %char, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %8) call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc_alloc(i8*, i64) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-array_01_transfer-125156e.json0000664000175000017500000000077515174404631024637 0ustar alastairalastair{ "basename": "asr-array_01_transfer-125156e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/array_01_transfer.f90", "infile_hash": "920caa9e18706045e10e552111ebbdee612fb11bdc829a77fcfa71ca", "outfile": null, "outfile_hash": null, "stdout": "asr-array_01_transfer-125156e.stdout", "stdout_hash": "43d58e11251898d4be1f41daaa9fd0b4d336c34f88c8826c19932c83", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-goto_02-48f3a02.stdout0000664000175000017500000000102115174404631023657 0ustar alastairalastairprogram goto2 implicit none integer :: A A = 0 1 continue write(*, *) A = A + 1 if (A > 2) then go to 95 end if write(*, *) "A =", A, " Starting" if (A == 1) then go to 10 end if go to 20 10 continue write(*, *) "A =", A, " Got to 10" go to 30 20 continue write(*, *) "A =", A, " Got to 20" 30 continue write(*, *) "A =", A, " Got to 30" if (A == 2) then go to 99 end if go to 1 95 continue write(*, *) "A =", A, " Got to 95" 99 continue write(*, *) "A =", A, " Got to 99" stop " " end program goto2 lfortran-0.63.0/tests/reference/asr-nested_06-1d576ad.json0000664000175000017500000000074515174404631023244 0ustar alastairalastair{ "basename": "asr-nested_06-1d576ad", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_06.f90", "infile_hash": "b94500b7f8becc154e61ec7d99e50e8c4cbbd4c0ca20bb262a670562", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_06-1d576ad.stdout", "stdout_hash": "8bde26a6d9289337390e1aa8de254283e8bd17042aa3076cd319c360", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-matrix_transpose_01-f8038ce.json0000664000175000017500000000076515174404631025366 0ustar alastairalastair{ "basename": "asr-matrix_transpose_01-f8038ce", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/matrix_transpose_01.f90", "infile_hash": "0c478df59b5d52e60f6b4056b366a18dcb7652c887a2edb4745bcf9d", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-matrix_transpose_01-f8038ce.stderr", "stderr_hash": "ee6e99f9b10deebcb64718039cba89686a12bc1bf0e1c39e58588ca9", "returncode": 2 }lfortran-0.63.0/tests/reference/run-implicit_argument_casting_01-0d962d9.json0000664000175000017500000000110615174404631027136 0ustar alastairalastair{ "basename": "run-implicit_argument_casting_01-0d962d9", "cmd": "lfortran --implicit-argument-casting --disable-implicit-argument-casting --no-color {infile}", "infile": "tests/../integration_tests/implicit_argument_casting_01.f90", "infile_hash": "3ed389916666e17233ec1aa288c9e7cfee00c97aacc83db1aeec5c7b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-implicit_argument_casting_01-0d962d9.stderr", "stderr_hash": "79cbdb3deeefc4c8dea93fb4b13541c2b274bce36ad244f5530895b1", "returncode": 1 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor3-1a6f5d9.stdout0000664000175000017500000000747715174404631027121 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor3: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) preprocessor3 [] [(Assignment (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) Mul (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 25 (Integer 4) Decimal) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x) (IntegerBinOp (IntegerConstant 12345678 (Integer 4) Decimal) Add (IntegerConstant 12345678 (Integer 4) Decimal) (Integer 4) (IntegerConstant 24691356 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-intrinsics4-113f724.json0000664000175000017500000000073515174404631023561 0ustar alastairalastair{ "basename": "asr-intrinsics4-113f724", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics4.f90", "infile_hash": "ed2175be9e9694d0cef36f97f3f74e236df03c8b2cc7ab3f155b5025", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics4-113f724.stderr", "stderr_hash": "e8e8ad6a3f7b8dcbe5c01b3b96feadc46c761a052df71a8522f71218", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-callback_01-facbb46.stdout0000664000175000017500000001042215174404631024374 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define float @__module_callback_01_cb(float (float*)* %f, float* %a, float* %b) { .entry: %cb = alloca float, align 4 %0 = load float, float* %b, align 4 %1 = load float, float* %a, align 4 %2 = fsub float %0, %1 %3 = call float %f(float* %a) %4 = fadd float %2, %3 %5 = call float %f(float* %b) %6 = fadd float %4, %5 store float %6, float* %cb, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_cb FINALIZE_SYMTABLE_cb: ; preds = %return %7 = load float, float* %cb, align 4 ret float %7 } declare float @f(float*) define void @__module_callback_01_foo(float* %c, float* %d) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %1 = alloca i64, align 8 %2 = call float @__module_callback_01_cb(float (float*)* @foo.__module_callback_01_f, float* %c, float* %d) %3 = alloca float, align 4 store float %2, float* %3, align 4 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %1, i32 0, i32 0, i32 0, i32 0, i32 0, float* %3) %5 = load i64, i64* %1, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_foo FINALIZE_SYMTABLE_foo: ; preds = %return ret void } define float @foo.__module_callback_01_f(float* %x) { .entry: %f = alloca float, align 4 %0 = load float, float* %x, align 4 %1 = fmul float 2.000000e+00, %0 store float %1, float* %f, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return %2 = load float, float* %f, align 4 ret float %2 } declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value1 = alloca float, align 4 %call_arg_value = alloca float, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store float 1.500000e+00, float* %call_arg_value, align 4 store float 2.000000e+00, float* %call_arg_value1, align 4 call void @__module_callback_01_foo(float* %call_arg_value, float* %call_arg_value1) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-incompatible_ranks_allocatable_arr2-699f9ab.json0000664000175000017500000000104515174404631030602 0ustar alastairalastair{ "basename": "asr-incompatible_ranks_allocatable_arr2-699f9ab", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incompatible_ranks_allocatable_arr2.f90", "infile_hash": "ffa862b282f0003e81ae019d774be1b094305f8afe7aa07a8c4fb663", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incompatible_ranks_allocatable_arr2-699f9ab.stderr", "stderr_hash": "859149ac9cbf256cb5a4318dc74776437006cbfc2044128a51f94db8", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-modules_52-5261d38.json0000664000175000017500000000075015174404631023270 0ustar alastairalastair{ "basename": "asr-modules_52-5261d38", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_52.f90", "infile_hash": "640dd46fb2d4c29ca80decea7bf1e44a075d14193b200b95c56cee89", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_52-5261d38.stdout", "stdout_hash": "415902ba998b1cf174ba3d62b4c71e7503a693b5f479ebfdb89cc7da", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-associate_01-4a4ac5c.stderr0000664000175000017500000000025615174404631024332 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/associate_01.f90:18:8 | 18 | if(a(1).EQ.5) GO TO 1 | ^^^^ help: write this as '==' lfortran-0.63.0/tests/reference/ast_f90-doloop_04-c0ab107.json0000664000175000017500000000076015174404631023713 0ustar alastairalastair{ "basename": "ast_f90-doloop_04-c0ab107", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/doloop_04.f90", "infile_hash": "d2027c560ba8546e31b7627200b8fb28695617c3238a8f1a086c62ef", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-doloop_04-c0ab107.stdout", "stdout_hash": "f873113b1563c79019ea37160fdf4055c707217c0becce3b009a70f6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_typing1-45de3a2.json0000664000175000017500000000077615174404631024742 0ustar alastairalastair{ "basename": "asr-implicit_typing1-45de3a2", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/errors/implicit_typing1.f90", "infile_hash": "023385ae1cffd8cc74cd969d2a2ea8fc4cbc958e5bb0ca340f5c6118", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit_typing1-45de3a2.stderr", "stderr_hash": "ae9589c5db61e45a67309453ee8e0d3425e569617b4e41104f5eb62d", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-complex_pow_test-2b160e8.json0000664000175000017500000000077515174404631025154 0ustar alastairalastair{ "basename": "llvm-complex_pow_test-2b160e8", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_pow_test.f90", "infile_hash": "cc3e566ed81771c2b1c24916ac5bcd29fde8fef80826cc84d56d72fa", "outfile": null, "outfile_hash": null, "stdout": "llvm-complex_pow_test-2b160e8.stdout", "stdout_hash": "004884fb21f8c88daddbb83cb0213ae6c820977883bdc0ee06df0d9f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-float1-817e0db.json0000664000175000017500000000071615174404631022640 0ustar alastairalastair{ "basename": "asr-float1-817e0db", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/float1.f90", "infile_hash": "55dfda74a97e804376ef0789c76876426844dc611542c0c6947ef9e0", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-float1-817e0db.stderr", "stderr_hash": "1f0f7eed328eb29e5c62b7944807320a02636a5cda8da98f08f2d582", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-entry_02-b8ee2e2.json0000664000175000017500000000074215174404631023175 0ustar alastairalastair{ "basename": "asr-entry_02-b8ee2e2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/entry_02.f90", "infile_hash": "b08199e4a4c1b3cec42730d5ef5520b9f0e1d547084894787c36d877", "outfile": null, "outfile_hash": null, "stdout": "asr-entry_02-b8ee2e2.stdout", "stdout_hash": "fd58d780eb9c2da8ac13ba83a5ebbe510fc4c65106e3e636ff333b0c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-data1-4f93542.stdout0000664000175000017500000000302115174404631022655 0ustar alastairalastair(TranslationUnit [(Program test_data () [] [] [(Declaration (AttrType TypeReal [(() 8 Value)] () () None ) [] [(coef [(1 10 DimensionExpr) (1 1 DimensionExpr)] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [(DataImpliedDo [(FuncCallOrArray coef [] [(() i () 0) (() 1 () 0)] [] [] [] )] () i 1 10 () )] [(Real "1.0d0") (Real "2.0d0") (Real "3.0d0") (Real "3.0d0") (Real "3.0d0") (Real "4.0d0") (Real "4.0d0") (Real "4.0d0") (Real "4.0d0") (Real "4.0d0")] )] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-template_sort_01-b412f73.json0000664000175000017500000000077215174404631024554 0ustar alastairalastair{ "basename": "asr-template_sort_01-b412f73", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_sort_01.f90", "infile_hash": "5e6f0ec6f2e9d533d188f1fa2a9b82e4c6f007962376a942c9e47b70", "outfile": null, "outfile_hash": null, "stdout": "asr-template_sort_01-b412f73.stdout", "stdout_hash": "37ea83bd8fb0e6314ee79f66f6717385e6dc0577782d7c38bd0c84d2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-where_01-c45f2da.stdout0000664000175000017500000007301115174404631023511 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { where_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) where_01 [] [(Assignment (Var 2 a) (ArrayBroadcast (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [-2, -2, -2, ...., -2, -2, -2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 8 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 b) (ArrayBroadcast (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [-3, -3, -3, ...., -3, -3, -3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Where (IntegerCompare (Var 2 a) GtE (IntegerConstant 0 (Integer 4) Decimal) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 1, 1, ...., 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 0 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [0, 0, 0, ...., 0, 0, 0] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] ) (Where (IntegerCompare (Var 2 a) GtE (IntegerConstant 0 (Integer 4) Decimal) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 1, 1, ...., 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 0 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [0, 0, 0, ...., 0, 0, 0] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] ) (Where (IntegerCompare (Var 2 a) GtE (IntegerConstant 0 (Integer 4) Decimal) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 1, 1, ...., 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 0 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [0, 0, 0, ...., 0, 0, 0] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] ) (If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) ()) [(If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] [] ) (Print (StringFormat () [(Var 2 b)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-intrinsics_23-db1ffb5.json0000664000175000017500000000076115174404631024302 0ustar alastairalastair{ "basename": "asr-intrinsics_23-db1ffb5", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_23.f90", "infile_hash": "3e162c296e5df394ddaea3689028b9cb97cd97e8bf9fdc0296eb6697", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_23-db1ffb5.stdout", "stdout_hash": "be970198682b6343eac5da1b15f08c6d27fcb7af473ccde21863a678", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_06-8523892.stdout0000664000175000017500000002467515174404631024321 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_06: (Program (SymbolTable 2 { dp: (Variable 2 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_06 [] [(Assignment (Var 2 x) (IntrinsicElementalFunction Asin [(RealConstant 0.841471 (Real 4) )] 0 (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (IntrinsicElementalFunction Acos [(RealConstant 0.540302 (Real 4) )] 0 (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (IntrinsicElementalFunction Atan [(RealConstant 1.557408 (Real 4) )] 0 (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (Cast (IntrinsicElementalFunction Atan [(RealConstant 1.557408 (Real 8) )] 0 (Real 8) (RealConstant 1.000000 (Real 8) ) ) RealToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (IntrinsicElementalFunction Asinh [(RealConstant 1.175201 (Real 4) )] 0 (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (IntrinsicElementalFunction Acosh [(RealConstant 1.543081 (Real 4) )] 0 (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (IntrinsicElementalFunction Atanh [(RealConstant 0.761594 (Real 4) )] 0 (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-types_12-e6251f2.stdout0000664000175000017500000000045415174404631024070 0ustar alastairalastairprogram types_12 use iso_c_binding, only: c_int, c_double implicit none interface integer(c_int) function f(a, b) result(r) import :: c_int, c_double integer(c_int), value, intent(in) :: a real(c_double), value, intent(in) :: b end function f end interface end program types_12 lfortran-0.63.0/tests/reference/run-scalar_allocation_check_02-b6aed2a.stderr0000664000175000017500000000033015174404631027255 0ustar alastairalastairruntime error: Tried to access member of unallocated variable 'var' --> tests/errors/scalar_allocation_check_02.f90:14:22 | 14 | print *, var%x | ^^^^^ 'var' unallocated here lfortran-0.63.0/tests/reference/run-file_53-1d4a0dc.json0000664000175000017500000000070715174404631022765 0ustar alastairalastair{ "basename": "run-file_53-1d4a0dc", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/file_53.f90", "infile_hash": "1937fd46d6c05258e36dfe4dbdd82dc619c68d2ba71c76a7944c142d", "outfile": null, "outfile_hash": null, "stdout": "run-file_53-1d4a0dc.stdout", "stdout_hash": "91e44f36e9c7d4fd09362ee3916db19e31bc82217699314c386977cc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-return_02-99fb0b3.stderr0000664000175000017500000000105215174404631024007 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/return_02.f90:13:15 | 13 | if (i .EQ. 1) then | ^^^^ help: write this as '==' style suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/return_02.f90:17:15 | 17 | if (i .EQ. 2) then | ^^^^ help: write this as '==' style suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/return_02.f90:21:15 | 21 | if (i .EQ. 3) then | ^^^^ help: write this as '==' lfortran-0.63.0/tests/reference/asr-template_simple_01-964c12e.json0000664000175000017500000000100015174404631025044 0ustar alastairalastair{ "basename": "asr-template_simple_01-964c12e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_simple_01.f90", "infile_hash": "52481db9c7b9e39192c8e234b6229517bfb5fb1ddc464a8bb4868784", "outfile": null, "outfile_hash": null, "stdout": "asr-template_simple_01-964c12e.stdout", "stdout_hash": "053beeee3784fab4c53feec6e612dc7e76fc00ef937b4fe4d6930253", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-interface_05-5639d22.json0000664000175000017500000000075615174404631023566 0ustar alastairalastair{ "basename": "asr-interface_05-5639d22", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/interface_05.f90", "infile_hash": "a6509198926e454d1aa09c90a70bf6760452f8ed5923cebde47a166f", "outfile": null, "outfile_hash": null, "stdout": "asr-interface_05-5639d22.stdout", "stdout_hash": "9902828ad7323672aedc830e0ebf14b09b9e1e870ab4a8f56e29bed6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-array_bounds_check_13-e4a94c8.stderr0000664000175000017500000000027715174404631026164 0ustar alastairalastairruntime error: Argument 1 of subroutine my is unallocated. --> tests/errors/array_bounds_check_13.f90:27:13 | 27 | call my(my_array, i) | ^^^^^^^^ This is unallocated lfortran-0.63.0/tests/reference/asr-modules_29-dc71c55.stdout0000664000175000017500000027077415174404631024023 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fpm_git1: (Module (SymbolTable 15 { git_target_branch: (Function (SymbolTable 17 { 1_git_target_t_object: (ExternalSymbol 17 1_git_target_t_object 16 object git_target_t [] object Public ), 1_git_target_t_url: (ExternalSymbol 17 1_git_target_t_url 16 url git_target_t [] url Public ), branch: (Variable 17 branch [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 17 self [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 15 git_target_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), url: (Variable 17 url [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) git_target_branch (FunctionType [(String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 url) (Var 17 branch)] [(Assignment (StructInstanceMember (Var 17 self) 17 1_git_target_t_url (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 17 url) () .false. .false. ) (Assignment (StructInstanceMember (Var 17 self) 17 1_git_target_t_object (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 17 branch) () .false. .false. )] (Var 17 self) Public .true. .true. () ), git_target_t: (Struct (SymbolTable 16 { object: (Variable 16 object [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), url: (Variable 16 url [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) git_target_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [url object] [] Source Public .false. .false. [] () () [] ) }) fpm_git1 () [] .true. .false. .false. ), fpm_manifest_dependency1: (Module (SymbolTable 8 { dependency_config_t: (Struct (SymbolTable 9 { git: (Variable 9 git [] Local () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 8 git_target_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), name: (Variable 9 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), path: (Variable 9 path [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) dependency_config_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. ) [] [name path git] [] Source Public .false. .false. [] () () [] ), error_t: (Struct (SymbolTable 10 { message: (Variable 10 message [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) error_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [message] [] Source Public .false. .false. [] () () [] ), git_target_branch: (ExternalSymbol 8 git_target_branch 15 git_target_branch fpm_git1 [] git_target_branch Public ), git_target_t: (ExternalSymbol 8 git_target_t 15 git_target_t fpm_git1 [] git_target_t Public ), new_dependencies: (Function (SymbolTable 12 { deps: (Variable 12 deps [] Out () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 8 dependency_config_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), error: (Variable 12 error [] Out () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 8 error_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), root: (Variable 12 root [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), table: (Variable 12 table [] InOut () () Default (StructType [(Logical 4)] [] .true. .false. ) 8 toml_table Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_dependencies (FunctionType [(Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (StructType [(Logical 4)] [] .true. .false. ) (String 1 () AssumedLength DescriptorString) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 deps) (Var 12 table) (Var 12 root) (Var 12 error)] [] () Public .true. .true. () ), new_dependency: (Function (SymbolTable 13 { 1_dependency_config_t_git: (ExternalSymbol 13 1_dependency_config_t_git 9 git dependency_config_t [] git Public ), obj: (Variable 13 obj [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 13 self [] Out () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. ) 8 dependency_config_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), url: (Variable 13 url [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_dependency (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 self)] [(If () (LogicalNot (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 13 self) 13 1_dependency_config_t_git (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () )] 0 (Logical 4) () ) (Logical 4) () ) [(Allocate [((StructInstanceMember (Var 13 self) 13 1_dependency_config_t_git (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) [] () () ())] () () () )] [] ) (Assignment (StructInstanceMember (Var 13 self) 13 1_dependency_config_t_git (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) (FunctionCall 8 git_target_branch () [((Var 13 url)) ((Var 13 obj))] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) () () ) () .false. .false. )] () Public .true. .true. () ), toml_table: (Struct (SymbolTable 11 { inline: (Variable 11 inline [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_table (StructType [(Logical 4)] [] .true. .false. ) [] [inline] [] Source Public .false. .false. [] () () [] ) }) fpm_manifest_dependency1 () [fpm_git1] .true. .false. .false. ), fpm_manifest_executable: (Module (SymbolTable 4 { dependency_config_t: (ExternalSymbol 4 dependency_config_t 8 dependency_config_t fpm_manifest_dependency1 [] dependency_config_t Public ), error_t: (ExternalSymbol 4 error_t 8 error_t fpm_manifest_dependency1 [] error_t Public ), executable_config_t: (Struct (SymbolTable 5 { dependency: (Variable 5 dependency [] Local () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 4 dependency_config_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), main: (Variable 5 main [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), name: (Variable 5 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), source_dir: (Variable 5 source_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) executable_config_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .true. .false. ) [] [name source_dir main dependency] [] Source Public .false. .false. [] () () [] ), new_dependencies: (ExternalSymbol 4 new_dependencies 8 new_dependencies fpm_manifest_dependency1 [] new_dependencies Public ), new_executable: (Function (SymbolTable 6 { 1_executable_config_t_dependency: (ExternalSymbol 6 1_executable_config_t_dependency 5 dependency executable_config_t [] dependency Public ), child: (Variable 6 child [] Local () () Default (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) 4 toml_table Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), error: (Variable 6 error [] Out () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 4 error_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 6 self [] Out () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .true. .false. ) 4 executable_config_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), table: (Variable 6 table [] InOut () () Default (StructType [(Logical 4)] [] .true. .false. ) 4 toml_table Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_executable (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .true. .false. ) (StructType [(Logical 4)] [] .true. .false. ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 self) (Var 6 table) (Var 6 error)] [(SubroutineCall 4 new_dependencies () [((StructInstanceMember (Var 6 self) 6 1_executable_config_t_dependency (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) () )) ((Var 6 child)) (()) ((Var 6 error))] () .false. )] () Public .true. .true. () ), toml_table: (ExternalSymbol 4 toml_table 8 toml_table fpm_manifest_dependency1 [] toml_table Public ) }) fpm_manifest_executable () [fpm_manifest_dependency1] .true. .false. .false. ), modules_29: (Program (SymbolTable 2 { dependency_config_t: (ExternalSymbol 2 dependency_config_t 8 dependency_config_t fpm_manifest_dependency1 [] dependency_config_t Public ), error_t: (ExternalSymbol 2 error_t 8 error_t fpm_manifest_dependency1 [] error_t Public ), executable_config_t: (ExternalSymbol 2 executable_config_t 4 executable_config_t fpm_manifest_executable [] executable_config_t Public ), new_dependencies: (ExternalSymbol 2 new_dependencies 8 new_dependencies fpm_manifest_dependency1 [] new_dependencies Public ), new_executable: (ExternalSymbol 2 new_executable 4 new_executable fpm_manifest_executable [] new_executable Public ), toml_table: (ExternalSymbol 2 toml_table 8 toml_table fpm_manifest_dependency1 [] toml_table Public ) }) modules_29 [fpm_manifest_executable fpm_manifest_dependency1] [(Print (StringConstant "running modules_29 program" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-bits1-e91f9ad.stdout0000664000175000017500000000736015174404631023137 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bits1: (Program (SymbolTable 2 { arr2: (Variable 2 arr2 [] Local (ArrayConstant 24 [1042890, 20, 30] (Array (Integer 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayConstant 24 [1042890, 20, 30] (Array (Integer 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Integer 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) bits1 [] [(Print (StringFormat () [(IntrinsicElementalFunction Ibits [(Var 2 arr2) (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Array (Integer 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-bin_op_complex_dp-8ead434.stdout0000664000175000017500000000624515174404631025675 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> %complex_8 = type <{ double, double }> %complex_4 = type <{ float, float }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [32 x i8] c"{R4,R4},{R8,R8},{R4,R4},{R8,R8}\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %u = alloca %complex_8, align 8 %v = alloca %complex_8, align 8 %x = alloca %complex_4, align 8 %zero = alloca %complex_4, align 8 store %complex_4 <{ float 0x3FC24924A0000000, float 0.000000e+00 }>, %complex_4* %zero, align 1 store %complex_8 <{ double 0x3FC2492492492492, double 0.000000e+00 }>, %complex_8* %u, align 1 store %complex_8 <{ double 0x3FC2492492492492, double 0.000000e+00 }>, %complex_8* %v, align 1 store %complex_4 <{ float 0x3FC24924A0000000, float 0.000000e+00 }>, %complex_4* %x, align 1 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, %complex_4* %zero, %complex_8* %v, %complex_4* %x, %complex_8* %u) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_bin_op_complex_dp FINALIZE_SYMTABLE_bin_op_complex_dp: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/cpp-types_05-06dea62.json0000664000175000017500000000072515174404631023114 0ustar alastairalastair{ "basename": "cpp-types_05-06dea62", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/types_05.f90", "infile_hash": "96f8e950abafbc42b9d0438efdca0a8355bb2bd7b4b168ee23063521", "outfile": null, "outfile_hash": null, "stdout": "cpp-types_05-06dea62.stdout", "stdout_hash": "a5794213f0c176d630f4d6bf958bdb932d7c8d293fa6eaddb5b62cfd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-external_03-c3442bb.json0000664000175000017500000000076515174404631023760 0ustar alastairalastair{ "basename": "llvm-external_03-c3442bb", "cmd": "lfortran --show-llvm --implicit-typing --implicit-interface {infile} -o {outfile}", "infile": "tests/external_03.f90", "infile_hash": "82ee198be6d031398277671c0c2f48a832124a1458e94c3317d080ba", "outfile": null, "outfile_hash": null, "stdout": "llvm-external_03-c3442bb.stdout", "stdout_hash": "326d816fcba3e1950dee57dfba2201f9889ab012b051a6a0cde7d03f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-modules_12-09f81d9.stdout0000664000175000017500000000022515174404631024241 0ustar alastairalastairmodule module_12 end function main() a[5] = 5 if a[5] ≠ 5 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-0.63.0/tests/reference/ast-loop_test3-f4e458f.stdout0000664000175000017500000001117315174404631024132 0ustar alastairalastair(TranslationUnit [(Program test () [] [] [] [(DoLoop 0 () 240 k 1 mp () [(Assignment 0 (FuncCallOrArray con [] [(() k () 0)] [] [] [] ) (u- (FuncCallOrArray datmat [] [(() k () 0) (() np () 0)] [] [] [] )) () ) (DoLoop 0 () 220 j 1 n () [(Assignment 220 (FuncCallOrArray w [] [(() j () 0)] [] [] [] ) (+ (FuncCallOrArray datmat [] [(() k () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray con [] [(() k () 0)] [] [] [] )) () )] () () ) (DoLoop 0 () 240 i 1 n () [(Assignment 0 temp (Real "0.0d0") () ) (DoLoop 0 () 230 j 1 n () [(Assignment 230 temp (+ temp (* (FuncCallOrArray w [] [(() j () 0)] [] [] [] ) (FuncCallOrArray simi [] [(() j () 0) (() i () 0)] [] [] [] ))) () )] () () ) (If 0 () (== k mp) [(Assignment 0 temp (u- temp) () )] [] () () () ) (Assignment 240 (FuncCallOrArray a [] [(() i () 0) (() k () 0)] [] [] [] ) temp () )] () () )] () () )] [] )] ) lfortran-0.63.0/tests/reference/wat-doloop_02-1ee6409.json0000664000175000017500000000073015174404631023174 0ustar alastairalastair{ "basename": "wat-doloop_02-1ee6409", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/doloop_02.f90", "infile_hash": "3f887434509231f48fbbbda31f34778f17ddb6871b39c44626d54f2e", "outfile": null, "outfile_hash": null, "stdout": "wat-doloop_02-1ee6409.stdout", "stdout_hash": "6a02db35e9677d082a117d78c0be5005628dbe232b47c35d41c6d258", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-implicit_check-4f0391f.stdout0000664000175000017500000000105315174404631024711 0ustar alastairalastair(TranslationUnit [(Program main () [] [(Implicit [(ImplicitSpec (AttrType TypeDoublePrecision [] () () None ) [(LetterSpec A H ) (LetterSpec O Z )] )] () )] [] [] [] )] ) lfortran-0.63.0/tests/reference/ast-types_10-8a81911.json0000664000175000017500000000074215174404631022761 0ustar alastairalastair{ "basename": "ast-types_10-8a81911", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_10.f90", "infile_hash": "2d1357260f2fc09e94884cf4955b12f3f35407dc0b74358b32019f36", "outfile": null, "outfile_hash": null, "stdout": "ast-types_10-8a81911.stdout", "stdout_hash": "c96bb9e0d18561beddb5d878554670fb27d7c30a97784bd252a11baa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/mod_to_asr-mod1-14-bb0bd17.stderr0000664000175000017500000000013315174404631024467 0ustar alastairalastairThe following argument was not expected: --no-indent Run with --help for more information. lfortran-0.63.0/tests/reference/ast-template_struct_01-f11e745.json0000664000175000017500000000100015174404631025100 0ustar alastairalastair{ "basename": "ast-template_struct_01-f11e745", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_struct_01.f90", "infile_hash": "f66f5d6abfb085636af3a1f278953ef2297f93f3a209002272e6d1f8", "outfile": null, "outfile_hash": null, "stdout": "ast-template_struct_01-f11e745.stdout", "stdout_hash": "c7e7f1e79dcb60b6a81cfaef5f9af653c36455b4b37c4bc73fd8a77b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-int_02-e7de6a7.json0000664000175000017500000000073415174404631022635 0ustar alastairalastair{ "basename": "asr-int_02-e7de6a7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/int_02.f90", "infile_hash": "e0a72e598a44c468855decece6cfbb029978d0775ad4aae887346aed", "outfile": null, "outfile_hash": null, "stdout": "asr-int_02-e7de6a7.stdout", "stdout_hash": "0275d4b75809877bff0de950f11879e58fc31549159589479058dd5d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-string_assignment_02-84c751f.stderr0000664000175000017500000000010615174404631026002 0ustar alastairalastairLFORTRAN ERROR: Run-time Error : Copying from unallocated RHS string. lfortran-0.63.0/tests/reference/asr-kokkos_program2-8391215.stdout0000664000175000017500000006534715174404631024732 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { kokkos_program2: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10000 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10000 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10000 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), nsize: (Variable 2 nsize [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), scalar: (Variable 2 scalar [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), triad: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 3 c [] Out () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 3 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), scalar: (Variable 3 scalar [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) triad (FunctionType [(Array (Real 4) [(() ())] DescriptorArray ) (Array (Real 4) [(() ())] DescriptorArray ) (Real 4) (Array (Real 4) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 scalar) (Var 3 c)] [(Assignment (Var 3 n) (ArraySize (Var 3 a) () (Integer 4) () ) () .false. .false. ) (DoConcurrentLoop [((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 3 n) ())] [] [] [] [(Assignment (ArrayItem (Var 3 c) [(() (Var 3 i) ())] (Real 4) ColMajor () ) (RealBinOp (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Real 4) ColMajor () ) Add (RealBinOp (Var 3 scalar) Mul (ArrayItem (Var 3 b) [(() (Var 3 i) ())] (Real 4) ColMajor () ) (Real 4) () ) (Real 4) () ) () .false. .false. )] )] () Public .true. .true. () ) }) kokkos_program2 [] [(Assignment (Var 2 scalar) (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 10.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 nsize) (ArraySize (Var 2 a) () (Integer 4) (IntegerConstant 10000 (Integer 4) Decimal) ) () .false. .false. ) (DoConcurrentLoop [((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nsize) ())] [] [] [] [(Assignment (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) () .false. .false. )] ) (SubroutineCall 2 triad () [((ArrayPhysicalCast (Var 2 a) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10000 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 2 b) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10000 (Integer 4) Decimal))] DescriptorArray ) () )) ((Var 2 scalar)) ((ArrayPhysicalCast (Var 2 c) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10000 (Integer 4) Decimal))] DescriptorArray ) () ))] () .false. ) (Print (StringConstant "End Stream Triad" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-sole_intrinsic-3e826bd.stdout0000664000175000017500000001326215174404631025052 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { f: (Variable 2 f [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local (ComplexConstructor (RealConstant 1.000000 (Real 4) ) (RealUnaryMinus (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant -3.000000 (Real 4) ) ) (Complex 4) (ComplexConstant 1.000000 -3.000000 (Complex 4) ) ) (ComplexConstant 1.000000 -3.000000 (Complex 4) ) Save (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main [] [(Assignment (Var 2 f) (IntrinsicElementalFunction Cmplx [(IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Complex 4) (ComplexConstant 3.000000 1.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 y) (IntrinsicElementalFunction Aimag [(Var 2 x)] 0 (Real 4) () ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/pass_openmp-do_concurrent_01-2a6df8c.stdout0000664000175000017500000005501315174404631027011 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { _lcompilers_mlir_gpu_offloading: (Module (SymbolTable 3 { _lcompilers_doconcurrent_replacer_func: (Function (SymbolTable 4 { i: (Variable 4 i [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 4 n [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] InOut () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) _lcompilers_doconcurrent_replacer_func (FunctionType [(Integer 4) (Integer 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray )] () BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 i) (Var 4 n) (Var 4 x)] [(DoConcurrentLoop [((Var 4 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 4 n) ())] [] [] [] [(Print (StringFormat () [(ArrayItem (Var 4 x) [(() (Var 4 i) ())] (Real 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 4 x) [(() (Var 4 i) ())] (Real 4) ColMajor () ) Sub (RealConstant 0.490000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] )] () Public .false. .false. () ) }) _lcompilers_mlir_gpu_offloading () [] .false. .false. .false. ), do_concurrent_01: (Program (SymbolTable 2 { _lcompilers_doconcurrent_replacer_func: (Function (SymbolTable 5 { i: (Variable 5 i [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 5 n [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 5 x [] InOut () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) _lcompilers_doconcurrent_replacer_func (FunctionType [(Integer 4) (Integer 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray )] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 i) (Var 5 n) (Var 5 x)] [] () Public .false. .false. () ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) do_concurrent_01 [] [(Assignment (Var 2 n) (IntegerConstant 12 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (ArrayBroadcast (RealConstant 0.490000 (Real 4) ) (ArrayConstant 4 [12] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 48 [4.90000010e-01, 4.90000010e-01, 4.90000010e-01, ...., 4.90000010e-01, 4.90000010e-01, 4.90000010e-01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (SubroutineCall 2 _lcompilers_doconcurrent_replacer_func 2 _lcompilers_doconcurrent_replacer_func [((Var 2 i)) ((Var 2 n)) ((Var 2 x))] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-cmplx_02-48bb125.stdout0000664000175000017500000000054315174404631023362 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cmplx_02: (Program (SymbolTable 2 { }) cmplx_02 [] [] ) }) [] ) lfortran-0.63.0/tests/reference/ast-assign_to2-d8aade7.json0000664000175000017500000000075115174404631023666 0ustar alastairalastair{ "basename": "ast-assign_to2-d8aade7", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/assign_to2.f", "infile_hash": "ee4e7d00ab3171c8b0f275f477b422d3a59370501dacc72ce4e11fc6", "outfile": null, "outfile_hash": null, "stdout": "ast-assign_to2-d8aade7.stdout", "stdout_hash": "7dd702e6ed1c8d800f06f85ac6b3116b756660e75872e846aec84fd5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-program4-c375e95.json0000664000175000017500000000071515174404631023140 0ustar alastairalastair{ "basename": "ast-program4-c375e95", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/program4.f90", "infile_hash": "16adb5a498028ea668b9d513bb2ef0fa0b12e15bef4e2b5e30aa2740", "outfile": null, "outfile_hash": null, "stdout": "ast-program4-c375e95.stdout", "stdout_hash": "6c5ae1776ad2be9c144a535ac45425320485db2f751a1001565917bd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-array6-fe9aa62.stdout0000664000175000017500000000626515174404631023321 0ustar alastairalastair(TranslationUnit [(Program array6 () [] [(ImplicitNone [] () )] [] [] [(Subroutine t [(n) (a) (b) (c) (d) (e)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(a [(() () DimensionStar)] [] () () None ()) (b [(3 () DimensionStar)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 3 DimensionExpr) (1 n DimensionExpr) (() () DimensionStar)] )] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 3 DimensionExpr) (1 n DimensionExpr) (4 () DimensionStar)] )] [(d [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(e [(n () DimensionStar)] [] () () None ())] () )] [] [] [] )] )] ) lfortran-0.63.0/tests/reference/asr-multi_error1-ed395f9.json0000664000175000017500000000075115174404631024113 0ustar alastairalastair{ "basename": "asr-multi_error1-ed395f9", "cmd": "lfortran --semantics-only --continue-compilation --no-color {infile}", "infile": "tests/multi_error1.f90", "infile_hash": "aae363b17603b231b2a906564a03365ce9a53952c754ea31187f352c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-multi_error1-ed395f9.stderr", "stderr_hash": "8e354c62a28f565b652876a84c5e566842065a5429ce01c56fea19e1", "returncode": 1 }lfortran-0.63.0/tests/reference/wat-types_05-884adc8.stdout0000664000175000017500000000622115174404631023507 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 f32) f32.const 2.000000 local.set 1 f32.const 2.000000 local.set 1 f32.const 8.000000 local.set 1 f32.const 4.000000 local.set 1 f32.const 0.000000 local.set 1 f32.const 0.500000 local.set 1 f32.const 0.500000 local.set 1 i32.const 2 local.set 0 i32.const 2 local.set 0 i32.const 8 local.set 0 i32.const 4 local.set 0 i32.const 0 local.set 0 i32.const 0 local.set 0 i32.const 0 local.set 0 i32.const 0 call 0 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-0.63.0/tests/reference/asr-complex_09-aca4085.stdout0000664000175000017500000001552515174404631024001 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex_09: (Program (SymbolTable 2 { i: (Variable 2 i [] Local (IntegerConstant 42 (Integer 4) Decimal) (IntegerConstant 42 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local (RealConstant 3.140000 (Real 4) ) (RealConstant 3.140000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z1: (Variable 2 z1 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z2: (Variable 2 z2 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) complex_09 [] [(Assignment (Var 2 z1) (IntrinsicElementalFunction Cmplx [(Var 2 i) (Var 2 x) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 z1) (IntrinsicElementalFunction Cmplx [(Var 2 x) (RealConstant 0.000000 (Real 4) ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Complex 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 z2) (Cast (IntrinsicElementalFunction Cmplx [(Var 2 z2) (RealConstant 0.000000 (Real 4) ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Complex 8) () ) ComplexToComplex (Complex 4) () () ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-types_04-92449d7.json0000664000175000017500000000074515174404631023164 0ustar alastairalastair{ "basename": "llvm-types_04-92449d7", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/types_04.f90", "infile_hash": "da21466af87608d5d323360a130e0a5542261d98fabaeebb5adc16d3", "outfile": null, "outfile_hash": null, "stdout": "llvm-types_04-92449d7.stdout", "stdout_hash": "55bb1dbba824699b8daad136d8a362046fa2f234d7a20bb41d3e30eb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-doloop_03-d4372bd.json0000664000175000017500000000075015174404631023432 0ustar alastairalastair{ "basename": "llvm-doloop_03-d4372bd", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_03.f90", "infile_hash": "eafcb3d9dca52d81012b124f360aa148c946ed2e7ed8de07041aba1d", "outfile": null, "outfile_hash": null, "stdout": "llvm-doloop_03-d4372bd.stdout", "stdout_hash": "035bc0136927213fe459bcb7d595aef9a4986c2f8893507d0ecbe4b4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-expr3-1bb382e.json0000664000175000017500000000070415174404631022506 0ustar alastairalastair{ "basename": "ast-expr3-1bb382e", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/expr3.f90", "infile_hash": "a4aed9754913f48e6b1982a698f85476db8324f2d2efe0b1a2de88f5", "outfile": null, "outfile_hash": null, "stdout": "ast-expr3-1bb382e.stdout", "stdout_hash": "5e6f771ec509f32363e9d5c294dce2af51c4c3705bbca45163ff612e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-return1-517cbf1.json0000664000175000017500000000103015174404631023040 0ustar alastairalastair{ "basename": "ast-return1-517cbf1", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/return1.f90", "infile_hash": "f77416f3b212e5cf5dddc4d2dee526355570f140dfa2dbc033bc84e7", "outfile": null, "outfile_hash": null, "stdout": "ast-return1-517cbf1.stdout", "stdout_hash": "d9595f897e3a19952b001c974bd21259e0872fd0ecaaebcdf29d91c6", "stderr": "ast-return1-517cbf1.stderr", "stderr_hash": "97e4ee7f017f858be24662871fe3e1ab033a7cd4bae84c20209d0502", "returncode": 0 }lfortran-0.63.0/tests/reference/julia-doloop_08-f0d8fe6.json0000664000175000017500000000073615174404631023666 0ustar alastairalastair{ "basename": "julia-doloop_08-f0d8fe6", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/doloop_08.f90", "infile_hash": "aa25755d672851ca060c0f7c42329e8ecb0444f7a037df60d525af51", "outfile": null, "outfile_hash": null, "stdout": "julia-doloop_08-f0d8fe6.stdout", "stdout_hash": "b8a7f17b6f37fec4c058c96909857db7668881ee3b78bd2f9815feb9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-common_04-b603709.json0000664000175000017500000000074515174404631023107 0ustar alastairalastair{ "basename": "asr-common_04-b603709", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/common_04.f90", "infile_hash": "b2b4a515f1cb59552a75dd35ac20fe972653540c29780d8c92214cbb", "outfile": null, "outfile_hash": null, "stdout": "asr-common_04-b603709.stdout", "stdout_hash": "e29ea22384950f9eeaac9a0ece68d5d5094eb1d7a11f9ec8a5b81ca9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-goto_04-ac607ff.json0000664000175000017500000000073015174404631023322 0ustar alastairalastair{ "basename": "julia-goto_04-ac607ff", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/goto_04.f90", "infile_hash": "302db59379e85ba1677034f61bec227f237c56085cea27ad7a1554b5", "outfile": null, "outfile_hash": null, "stdout": "julia-goto_04-ac607ff.stdout", "stdout_hash": "f80f754f041341dbbd44bde75ec93bc0ee429362cca23c59b9b1b285", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-integer_overflow-3cf26f8.stdout0000664000175000017500000000002615174404631025423 0ustar alastairalastairRead integer: 2719 lfortran-0.63.0/tests/reference/asr-nullify_03-e2c1d62.json0000664000175000017500000000075015174404631023430 0ustar alastairalastair{ "basename": "asr-nullify_03-e2c1d62", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nullify_03.f90", "infile_hash": "0208ba787353b8a7cb23824af4baf3aafbb3d05dcc246d54e91df0c9", "outfile": null, "outfile_hash": null, "stdout": "asr-nullify_03-e2c1d62.stdout", "stdout_hash": "c7ab76f3badd11c1c9b4f8148ff28a0d36b4c5ce6833ca6c0af812c3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_size_03-2036e61.stderr0000664000175000017500000000030015174404631024277 0ustar alastairalastairsemantic error: Unrecognized keyword argument kind1 passed to size intrinsic. --> tests/errors/array_size_03.f90:5:14 | 5 | size_a = size(a, kind1=4) | ^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-init_values-19dfa76.json0000664000175000017500000000075315174404631024004 0ustar alastairalastair{ "basename": "asr-init_values-19dfa76", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/init_values.f90", "infile_hash": "1cafced706fa2754f92f2d460867d6c84638fd10447df12f124fd419", "outfile": null, "outfile_hash": null, "stdout": "asr-init_values-19dfa76.stdout", "stdout_hash": "3293740a15b1609949a5a015d655e8ce962673d4037ff096d4a00207", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-array1-3c35261.stdout0000664000175000017500000000054415174404631023374 0ustar alastairalastairfunction main() local a::Bool local b::Array{Bool, 1} local b2::Array{Bool, 2} local b3::Array{Bool, 3} local d::Float32 local e::Array{Float32, 1} local e2::Array{Float32, 2} local e3::Array{Float32, 3} local f::Int32 local g::Array{Int32, 1} local g2::Array{Int32, 2} local g3::Array{Int32, 3} end main() lfortran-0.63.0/tests/reference/ast_f90-arrayelements1-55b6bd6.stdout0000664000175000017500000000175215174404631025443 0ustar alastairalastairmodule my_subs implicit none interface my_sum module procedure sum_real, sum_int end interface my_sum contains subroutine sum_real(array, tot) real, dimension(:), intent(in) :: array real, intent(out) :: tot integer :: i tot = 1.0 do i = 1, size(array) tot = tot*array(i) end do end subroutine sum_real subroutine sum_int(array, tot) integer, dimension(:), intent(in) :: array integer, intent(out) :: tot integer :: i tot = 0 do i = 1, size(array) tot = tot + array(i) end do end subroutine sum_int end module my_subs program test_dt use my_subs implicit none type :: my_type integer :: weight real :: length end type my_type type(my_type), dimension(:), allocatable :: people type(my_type) :: answer allocate(people(2)) people(1)%weight = 1 people(1)%length = 1.0 people(2)%weight = 2 people(2)%length = 2.0 call my_sum(people(:)%weight, answer%weight) write(*, *) answer%weight call my_sum(people(:)%length, answer%length) write(*, *) answer%length end program test_dt lfortran-0.63.0/tests/reference/ast-subroutine6-a3aec97.stdout0000664000175000017500000001067415174404631024400 0ustar alastairalastair(TranslationUnit [(Subroutine triad [(a) (b) (scalar) (c)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [(() () DimensionExpr)] [] () () None ()) (b [(() () DimensionExpr)] [] () () None ()) (scalar [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(c [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(N [] [] () () None ()) (N2 [] [] () () None ()) (i [] [] () () None ()) (j [] [] () () None ())] () )] [(Assignment 0 N (FuncCallOrArray size [] [(() a () 0)] [] [] [] ) () ) (Assignment 0 N2 (FuncCallOrArray size [] [(() b () 0)] [] [] [] ) () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () )] () [] [(Assignment 0 (FuncCallOrArray c [] [(() i () 0)] [] [] [] ) (+ (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (* scalar (FuncCallOrArray b [] [(() i () 0)] [] [] [] ))) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DoConcurrentLoop 0 () [(ConcurrentControl j 1 N2 () )] () [] [(Assignment 0 (FuncCallOrArray c [] [(() j () 0)] [] [] [] ) (+ (FuncCallOrArray b [] [(() j () 0)] [] [] [] ) scalar) () )] () () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-write7-6ba53a1.stdout0000664000175000017500000005704415174404631023242 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { write7_mod: (Module (SymbolTable 2 { person: (Struct (SymbolTable 3 { pwf: (StructMethodDeclaration 3 pwf () pwf 2 pwf Source .false. .false. ), pwunf: (StructMethodDeclaration 3 pwunf () pwunf 2 pwunf Source .false. .false. ), ~write_formatted: (GenericProcedure 3 ~write_formatted [3 pwf] Public ), ~write_unformatted: (GenericProcedure 3 ~write_unformatted [3 pwunf] Public ) }) person (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () () [] ), pwf: (Function (SymbolTable 4 { dtv: (Variable 4 dtv [] In () () Default (StructType [] [] .false. .false. ) 2 person Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iomsg: (Variable 4 iomsg [] InOut () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iostat: (Variable 4 iostat [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iotype: (Variable 4 iotype [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pfmt: (Variable 4 pfmt [] Local () () Default (String 1 (IntegerConstant 9 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), unit: (Variable 4 unit [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), vlist: (Variable 4 vlist [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) pwf (FunctionType [(StructType [] [] .false. .false. ) (Integer 4) (String 1 () AssumedLength DescriptorString) (Array (Integer 4) [(() ())] DescriptorArray ) (Integer 4) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 dtv) (Var 4 unit) (Var 4 iotype) (Var 4 vlist) (Var 4 iostat) (Var 4 iomsg)] [] () Public .true. .true. () ), pwunf: (Function (SymbolTable 5 { dtv: (Variable 5 dtv [] In () () Default (StructType [] [] .false. .false. ) 2 person Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iomsg: (Variable 5 iomsg [] InOut () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iostat: (Variable 5 iostat [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), unit: (Variable 5 unit [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) pwunf (FunctionType [(StructType [] [] .false. .false. ) (Integer 4) (Integer 4) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 dtv) (Var 5 unit) (Var 5 iostat) (Var 5 iomsg)] [] () Public .true. .true. () ) }) write7_mod () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-preprocess_01-20f7efb.stderr0000664000175000017500000000166015174404631024551 0ustar alastairalastairwarning: #ifdef ignored --> tests/warnings/preprocess_01.f90:6:1 | 6 | #ifdef pqr | ^^^^^^^^^^^ help: use the '--cpp' command line option to preprocess it warning: #elif ignored --> tests/warnings/preprocess_01.f90:8:1 | 8 | #elif mno == 18 | ^^^^^^^^^^^^^^^^ help: use the '--cpp' command line option to preprocess it warning: #else ignored --> tests/warnings/preprocess_01.f90:10:1 | 10 | #else | ^^^^^^ help: use the '--cpp' command line option to preprocess it warning: #endif ignored --> tests/warnings/preprocess_01.f90:13:1 | 13 | #endif | ^^^^^^^ help: use the '--cpp' command line option to preprocess it warning: #define ignored --> tests/warnings/preprocess_01.f90:16:1 | 16 | #define abc(m, n) m + n | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use the '--cpp' command line option to preprocess it warning: Unsupported macro --> tests/warnings/preprocess_01.f90:18:1 | 18 | #abcd | ^^^^^^ Ignored lfortran-0.63.0/tests/reference/pass_global_stmts-global_scope4-2d4061d.stdout0000664000175000017500000000705415174404631027407 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] (Integer 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 f1) (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () ) () .false. .false. )] (Var 2 f1) Public .false. .false. () ), x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) [] ) lfortran-0.63.0/tests/reference/asr_preprocess-cpp2-a8d63da.stderr0000664000175000017500000000022715174404631025172 0ustar alastairalastairsemantic error: Variable 'yy' is not declared --> tests/errors/cpp2.f90:7:19 | 7 | print *, x, X123, yy | ^^ 'yy' is undeclared lfortran-0.63.0/tests/reference/ast_f90-Subroutine_Call1-5aa005c.json0000664000175000017500000000076015174404631025270 0ustar alastairalastair{ "basename": "ast_f90-Subroutine_Call1-5aa005c", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/Subroutine_Call1.f90", "infile_hash": "bf7f51f810752b3f8e9381f1e100d0c9b3495c2f87cd120a6ee74148", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-Subroutine_Call1-5aa005c.stdout", "stdout_hash": "d7e18b9e02754303c8749a0cff1eeb8d6c0a9704c7e54509c003cec5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-modules_11-a28ab77.stdout0000664000175000017500000001216415174404631024162 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @__module_modules_11_module11_i = global i32 1 @__module_modules_11_module11_j = global i32 2 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [12 x i8] c"S-DESC-4,I4\00", align 1 @string_const_data = private constant [4 x i8] c"i = " @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [12 x i8] c"S-DESC-4,I4\00", align 1 @string_const_data.2 = private constant [4 x i8] c"j = " @string_const.3 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.2, i32 0, i32 0), i64 4 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_modules_11_module11_access_internally() { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %1 = alloca i64, align 8 %2 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info, i32 0, i32 0), i64* %1, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const, i32* @__module_modules_11_module11_i) %3 = load i64, i64* %1, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %2, i8** %4, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %3, i64* %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %7 = load i8*, i8** %6, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %9 = load i64, i64* %8, align 8 %10 = trunc i64 %9 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %7, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %11 = icmp eq i8* %2, null br i1 %11, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %2) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_access_internally FINALIZE_SYMTABLE_access_internally: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.1, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.3, i32* @__module_modules_11_module11_j) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @__module_modules_11_module11_access_internally() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_access_externally FINALIZE_SYMTABLE_access_externally: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-expr2-74c7f32.stdout0000664000175000017500000000043215174404631023003 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { }) [(IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) )] ) lfortran-0.63.0/tests/reference/run-string_allocation_01-8484aaf.json0000664000175000017500000000074015174404631025506 0ustar alastairalastair{ "basename": "run-string_allocation_01-8484aaf", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/string_allocation_01.f90", "infile_hash": "cd0f6232a42aa948f55971480a8894730237824e112755a510b37317", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-string_allocation_01-8484aaf.stderr", "stderr_hash": "798d42b98a53bf914ee8d9bb8714e1bc4fdf04128ec7028805b8eaed", "returncode": 1 }lfortran-0.63.0/tests/reference/ast-loop_test2-c76adc4.json0000664000175000017500000000073615174404631023631 0ustar alastairalastair{ "basename": "ast-loop_test2-c76adc4", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/loop_test2.f", "infile_hash": "b0c94f235f33da51d9037d0833df0c1ca4aaef4f3a3a29c9426ba51b", "outfile": null, "outfile_hash": null, "stdout": "ast-loop_test2-c76adc4.stdout", "stdout_hash": "54607d56e4f9e7cecf534af805800d237a40fdb146710607ee777577", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit13-56e851c.stdout0000664000175000017500000005773715174404631023746 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { a: (Variable 2 a [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), e: (Variable 2 e [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Variable 2 f [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), h: (Variable 2 h [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 2 l [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 2 m [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), o: (Variable 2 o [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p: (Variable 2 p [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), q: (Variable 2 q [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 2 r [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [d e] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 d)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [e] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 d) (Var 2 e)] [(Assignment (ArrayItem (Var 2 y) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 b) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 d) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 f) (Cast (IntegerConstant 4 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 4 (Integer 8) Decimal) () ) () .false. .false. ) (Assignment (Var 2 h) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 i) (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 6.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 l) (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 7.000000 (Real 8) ) () ) () .false. .false. ) (Assignment (Var 2 m) (Cast (IntegerConstant 8 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 8.000000 0.000000 (Complex 4) ) () ) () .false. .false. ) (Assignment (Var 2 o) (Cast (IntegerConstant 9 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 9.000000 0.000000 (Complex 4) ) () ) () .false. .false. ) (Assignment (Var 2 p) (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToComplex (Complex 8) (ComplexConstant 10.000000 0.000000 (Complex 8) ) () ) () .false. .false. ) (Assignment (Var 2 q) (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 11.000000 (Real 8) ) () ) () .false. .false. ) (Assignment (Var 2 r) (Cast (IntegerConstant 12 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 12.000000 (Real 8) ) () ) () .false. .false. )] (Var 2 a) Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/ast-fixedform_data-650e309.stdout0000664000175000017500000000231515174404631024637 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(one [] [] () () None ()) (two [] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [x] [1] )] () ) (DataStmt 0 [(DataStmtSet [one two] [(Real "1.0") (Real "2.0")] )] () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor22-17078cd.stdout0000664000175000017500000000233015174404631027077 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor22: (Program (SymbolTable 2 { }) preprocessor22 [] [(Print (StringConstant "Both VAR1 and VAR2 are defined." (String 1 (IntegerConstant 31 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "At least one of VAR3 or VAR4 is defined." (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Exactly one of VAR5 or VAR6 is not defined." (String 1 (IntegerConstant 43 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-nested_04-39da8f9.json0000664000175000017500000000075015174404631023437 0ustar alastairalastair{ "basename": "llvm-nested_04-39da8f9", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_04.f90", "infile_hash": "e1cee5ef2176599a2dccac3f59fc86ddc957a5f559f5edb7ddd710ca", "outfile": null, "outfile_hash": null, "stdout": "llvm-nested_04-39da8f9.stdout", "stdout_hash": "0d472c8777be37de9b86abc5deef93dffbd3fd26864ba241474eafca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-infer_first_assignment_01-ff9433c.stdout0000664000175000017500000001067015174404631027074 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { flag: (Variable 1 flag [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s: (Variable 1 s [] Local () () Default (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 1 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 1 z [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) [(Assignment (Var 1 x) (IntegerConstant 42 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 1 y) (RealConstant 3.140000 (Real 4) ) () .false. .false. ) (Assignment (Var 1 z) (ComplexConstructor (RealConstant 1.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) (Complex 4) (ComplexConstant 1.000000 2.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 1 flag) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (Assignment (Var 1 s) (StringConstant "hello" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] ) lfortran-0.63.0/tests/reference/wat-wasm_main_program-7a34895.json0000664000175000017500000000073315174404631025033 0ustar alastairalastair{ "basename": "wat-wasm_main_program-7a34895", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/wasm_main_program.f90", "infile_hash": "ab8926c68ae35c9f50cf6a99dd6afaf843e3439d51645de08baebead", "outfile": null, "outfile_hash": null, "stdout": "wat-wasm_main_program-7a34895.stdout", "stdout_hash": "a7508a90bd07a2ef1e5d18fa0c05221e91c752cdbaf22e3d55b317dc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-dim_float_02-2681d16.json0000664000175000017500000000074015174404631023547 0ustar alastairalastair{ "basename": "asr-dim_float_02-2681d16", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dim_float_02.f90", "infile_hash": "b3cd2311350bf6e756c4dbf5aa99b24d1e2a004738acea5f0080194a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dim_float_02-2681d16.stderr", "stderr_hash": "35efe71f901511015f849241c9f551bf8c3f89337d62956c1606c855", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-logical4-72c2657.json0000664000175000017500000000074215174404631023014 0ustar alastairalastair{ "basename": "asr-logical4-72c2657", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/logical4.f90", "infile_hash": "ea18762e8bbd163cb8b30960c719f953e2dfae041020c2f1066b3a35", "outfile": null, "outfile_hash": null, "stdout": "asr-logical4-72c2657.stdout", "stdout_hash": "4eae5bf1476ab4c1eb0e5cd9e8a3324187ead5cabc3ead7971ad24b7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_39-f721e16.json0000664000175000017500000000076115174404631024073 0ustar alastairalastair{ "basename": "asr-intrinsics_39-f721e16", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_39.f90", "infile_hash": "f27f54c8f7027443ffce72d800b4fe7abc183483b295523d83b32adf", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_39-f721e16.stdout", "stdout_hash": "d140376bfba3bfa33bae9524d641a4a4e65b65ffcc73e56c4cd1bfd2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-do_concurrent_reduce2-81246e2.json0000664000175000017500000000077715174404631026257 0ustar alastairalastair{ "basename": "ast_f90-do_concurrent_reduce2-81246e2", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/do_concurrent_reduce2.f90", "infile_hash": "bfbb329c50d12cea347c298fcc5ba3ee9f192b8b43de74deccf70615", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-do_concurrent_reduce2-81246e2.stdout", "stdout_hash": "bbcc42fbbf554322cc2fd456d8893449132415622bd147312ca1f7e4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_error_07a-fa85c7e.json0000664000175000017500000000076215174404631025236 0ustar alastairalastair{ "basename": "asr-template_error_07a-fa85c7e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_07a.f90", "infile_hash": "2d93392c48b94ce432551da534053cf051a4d2ff3aa403b134d4a8e8", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_07a-fa85c7e.stderr", "stderr_hash": "11da2965b8a8b8ea46fe1e8545830084b13b39cd574fa274f7361414", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-incorrect_type_where_04-f7dffdb.json0000664000175000017500000000100115174404631026414 0ustar alastairalastair{ "basename": "asr-incorrect_type_where_04-f7dffdb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incorrect_type_where_04.f90", "infile_hash": "42f8ace2a232052937d439ce0f429e27dd6d8ddf373aa4865c19e809", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incorrect_type_where_04-f7dffdb.stderr", "stderr_hash": "2f1dc154ac637fbd20a8df4e194b496ba7829d58b3555e4a08845759", "returncode": 2 }lfortran-0.63.0/tests/reference/run-string_assignment_02-84c751f.json0000664000175000017500000000074015174404631025454 0ustar alastairalastair{ "basename": "run-string_assignment_02-84c751f", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/string_assignment_02.f90", "infile_hash": "a08f7ec91c7fc4d516a9ec8775761fad679344425d3572773570b7aa", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-string_assignment_02-84c751f.stderr", "stderr_hash": "b2f51d8ac6543f4597d29821577e8450ba74eeabb233d240b63efed8", "returncode": 1 }lfortran-0.63.0/tests/reference/ast_f90-allocate_01-df1748d.json0000664000175000017500000000074115174404631024223 0ustar alastairalastair{ "basename": "ast_f90-allocate_01-df1748d", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/allocate_01.f90", "infile_hash": "7a28f6115b781d328be0829189ace20f4f862bf745740c6c78400225", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-allocate_01-df1748d.stdout", "stdout_hash": "e664086475b3e379ff22a16889c819f111434743957c3d4af54dd469", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-nested_03-57ffed2.json0000664000175000017500000000074515174404631023330 0ustar alastairalastair{ "basename": "asr-nested_03-57ffed2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_03.f90", "infile_hash": "690c7461fd0cb288a4f72f5fd09663a777ae1ba9f4a39dfdc5727c36", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_03-57ffed2.stdout", "stdout_hash": "be128abf92cbfc2b94759c67215e6f25cd06e80cc1cb2c0782d7004f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-data1-58e5b8d.stdout0000664000175000017500000004101015174404631023021 0ustar alastairalastair(TranslationUnit [(Program data1 () [] [] [(DerivedType person [] () [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(age [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() 20 Value)] () () None ) [] [(fullname [] [] () () None ())] () )] [] ) (Declaration (AttrType TypeCharacter [(len 10 Value)] () () None ) [] [(myname [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrDimension [(0 9 DimensionExpr)] )] [(miles [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 100 DimensionExpr) (1 100 DimensionExpr)] )] [(skew [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () person None ) [] [(yourname [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() 8 Value)] () () None ) [(SimpleAttribute AttrParameter )] [(sin3 [] [] () (FuncCallOrArray sin [] [(() (Real "3.d0") () 0)] [] [] [] ) Equal ())] () ) (Declaration (AttrType TypeReal [(() 8 Value)] () () None ) [(SimpleAttribute AttrParameter )] [(cos3 [] [] () (FuncCallOrArray cos [] [(() (Real "3.d0") () 0)] [] [] [] ) Equal ())] () ) (Declaration (AttrType TypeReal [(() 8 Value)] () () None ) [] [(s [(1 10 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(iarx [(1 3 DimensionExpr) (1 1 DimensionExpr)] [] () () None ()) (iary [(1 3 DimensionExpr) (1 1 DimensionExpr)] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(DataStmt 0 [(DataStmtSet [myname] [(String "xyz" ())] ) (DataStmtSet [miles] [0 0 0 0 0 0 0 0 0 0] )] () ) (DataStmt 0 [(DataStmtSet [age [(yourname [])] fullname [(yourname [])]] [35 (String "abc" ())] )] () ) (DataStmt 0 [(DataStmtSet [(DataImpliedDo [(DataImpliedDo [(FuncCallOrArray skew [] [(() k () 0) (() j () 0)] [] [] [] )] () j 1 k () )] (AttrType TypeInteger [(() 4 Value)] () () None ) k 1 10 () )] [(Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0")] )] () ) (DataStmt 0 [(DataStmtSet [(DataImpliedDo [(DataImpliedDo [(FuncCallOrArray skew [] [(() k () 0) (() j () 0)] [] [] [] )] () j 1 k k )] (AttrType TypeInteger [(() 4 Value)] () () None ) k 1 100 2 )] [(Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0")] )] () ) (DataStmt 0 [(DataStmtSet [(DataImpliedDo [(DataImpliedDo [(FuncCallOrArray skew [] [(() k () 0) (() j () 0)] [] [] [] )] () j (+ k 1) 10 () )] () k 1 3 () )] [(Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0")] )] () ) (DataStmt 0 [(DataStmtSet [(DataImpliedDo [(DataImpliedDo [(FuncCallOrArray skew [] [(() k () 0) (() j () 0)] [] [] [] )] () j (+ k 1) 10 k )] () k 1 3 1 )] [(Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0")] )] () ) (DataStmt 0 [(DataStmtSet [s] [(Real "1.d0") (u- (Real "1.d0")) (Real "0.d0") (Real "0.d0") (Real "0.d0") (u- (Real "1.d0")) sin3 cos3 (Real "0.d0") (u- (Real "1.d0"))] )] () ) (Print 0 () [(String "Your name is: " ()) fullname [(yourname [])]] () ) (Print 0 () [(String "Your age is: " ()) age [(yourname [])]] () ) (DataStmt 0 [(DataStmtSet [(DataImpliedDo [(FuncCallOrArray iarx [] [(() i () 0) (() 1 () 0)] [] [] [] ) (FuncCallOrArray iary [] [(() i () 0) (() 1 () 0)] [] [] [] )] () i 1 3 () )] [1 9 1950 1350 4350 4] )] () ) (Print 0 () [(String "My name is: " ()) myname] () ) (DataStmt 0 [(DataStmtSet [(DataImpliedDo [(FuncCallOrArray iary [] [(() i () 0) (() 1 () 0)] [] [] [] )] () i 1 3 () )] [1 9 1950] )] () )] [] )] ) lfortran-0.63.0/tests/reference/fortran-int_to_complex_cast_in_comparison-2b60771.stdout0000664000175000017500000000051215174404631031516 0ustar alastairalastairprogram expr2 implicit none integer(4), parameter :: dp = Kind(0.0000000000000000e+00_8) contains elemental complex(8) function dabs(x) result(r) complex(8), intent(in) :: x if (x /= cmplx(0, 0.0, kind=8)) then r = x else r = cmplx(0, 0.0, kind=8) - x end if end function dabs end program expr2 lfortran-0.63.0/tests/reference/run-read2-7b581ec.json0000664000175000017500000000065415174404631022473 0ustar alastairalastair{ "basename": "run-read2-7b581ec", "cmd": "lfortran --no-color {infile}", "infile": "tests/read2.f90", "infile_hash": "1d82aaea9497b527bc71286e7053079e21db7085521af2c81a4e6b6e", "outfile": null, "outfile_hash": null, "stdout": "run-read2-7b581ec.stdout", "stdout_hash": "6695bf11ba38f6db6b2fbe85b1969e451dc69f68ea2397fcba513e5f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-matmul_unallocated_01-39026d3.stderr0000664000175000017500000000030015174404631026022 0ustar alastairalastairruntime error: Argument 3 of subroutine _lcompilers_matmul_real_______2 is unallocated. --> tests/errors/matmul_unallocated_01.f90:10:1 | 10 | C = matmul(A, B) | ^ This is unallocated lfortran-0.63.0/tests/reference/ast-functions_41-1e43fd0.stdout0000664000175000017500000000371315174404631024335 0ustar alastairalastair(TranslationUnit [(Program functions_41 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(SubroutineCall 0 notrecursive_sub [] [] [] [] () ) (Print 0 () [(FuncCallOrArray notrecursive_fun [] [] [] [] [] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Subroutine notrecursive_sub [] [(SimpleAttribute AttrNonRecursive )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "This is a non-recursive subroutine" ())] () )] [] [] ) (Function notrecursive_fun [] [(SimpleAttribute AttrNonRecursive ) (AttrType TypeInteger [] () () None )] () () () [] [] [] [] [(Print 0 () [(String "This is a non-recursive function" ())] () ) (Assignment 0 notrecursive_fun 1 () )] [] [] )] )] ) lfortran-0.63.0/tests/reference/run-implied_do_loop2-a8638e0.json0000664000175000017500000000071515174404631024634 0ustar alastairalastair{ "basename": "run-implied_do_loop2-a8638e0", "cmd": "lfortran --no-color {infile}", "infile": "tests/implied_do_loop2.f90", "infile_hash": "9f1322fbfc43cf221a57e13012a98248cd6c507ae07b15388d5958d1", "outfile": null, "outfile_hash": null, "stdout": "run-implied_do_loop2-a8638e0.stdout", "stdout_hash": "a9f17503685a794018f6e4c58d9fe5e53f0228d2e8d0f7c23c7eaa42", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-subroutine3-952da2b.json0000664000175000017500000000071715174404631024252 0ustar alastairalastair{ "basename": "julia-subroutine3-952da2b", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/subroutine3.f90", "infile_hash": "174874c0a5fad40d608acbafefcc0c06c96379cc136126d3f05b63e5", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutine3-952da2b.stdout", "stdout_hash": "ce1171ffded74d916e60a8a0d1543285b051d49f34ef15b64c0810f2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-subroutines_10-779ade9.json0000664000175000017500000000077715174404631025042 0ustar alastairalastair{ "basename": "ast_f90-subroutines_10-779ade9", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/subroutines_10.f90", "infile_hash": "97868109f521b42642b328d8b79be02e7668b5819dc820880ec85da0", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-subroutines_10-779ade9.stdout", "stdout_hash": "77cac845f90c95ab93e41002c00fcc1be757d153ea2941c75c6690ae", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-modules_13-6b5ac80.stdout0000664000175000017500000000645515174404631024167 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @__module_module_13_f1() { .entry: %f1 = alloca i32, align 4 %0 = call i32 @__module_module_13_f2() store i32 %0, i32* %f1, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f1 FINALIZE_SYMTABLE_f1: ; preds = %return %1 = load i32, i32* %f1, align 4 ret i32 %1 } define i32 @__module_module_13_f2() { .entry: %f2 = alloca i32, align 4 store i32 5, i32* %f2, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f2 FINALIZE_SYMTABLE_f2: ; preds = %return %0 = load i32, i32* %f2, align 4 ret i32 %0 } define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %f = alloca i32, align 4 %3 = call i32 @__module_module_13_f1() store i32 %3, i32* %f, align 4 %4 = alloca i64, align 8 %5 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %4, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %f) %6 = load i64, i64* %4, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %5, i8** %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %6, i64* %8, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %10 = load i8*, i8** %9, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %12 = load i64, i64* %11, align 8 %13 = trunc i64 %12 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %10, i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %14 = icmp eq i8* %5, null br i1 %14, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %5) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-arrays_20-4b5a0e4.stdout0000664000175000017500000001662015174404631023620 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_20: (Program (SymbolTable 2 { list_character: (Variable 2 list_character [] Local () () Default (Allocatable (Array (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), list_integer: (Variable 2 list_integer [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), list_logical: (Variable 2 list_logical [] Local () () Default (Allocatable (Array (Logical 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) arrays_20 [] [(Assignment (Var 2 list_integer) (ArrayConstructor [] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] FixedSizeArray ) () ColMajor () ) () .false. .false. ) (Assignment (Var 2 list_logical) (ArrayConstructor [] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] FixedSizeArray ) () ColMajor () ) () .false. .false. ) (Assignment (Var 2 list_character) (ArrayConstructor [] (Array (String 1 (StringLen (ArrayItem (Var 2 list_character) [(() (ArrayBound (Var 2 list_character) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] PointerArray ) () ColMajor () ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-format_01-fa31fe9.json0000664000175000017500000000076015174404631024005 0ustar alastairalastair{ "basename": "ast_f90-format_01-fa31fe9", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/format_01.f90", "infile_hash": "4cc04453f51b9adcf8108f25d26d048109fd69c30496888f6f560433", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-format_01-fa31fe9.stdout", "stdout_hash": "1fb1912ba73b8d475f18a53cb6b3c88da84f8c2a44bea12ed347e9bb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format_25-0bdc4b7.stdout0000664000175000017500000000003015174404631023700 0ustar alastairalastair0.E+0 1.E+1 3.E+0 3.E+5 lfortran-0.63.0/tests/reference/asr-intrinsics_31-9b91cfb.json0000664000175000017500000000076115174404631024227 0ustar alastairalastair{ "basename": "asr-intrinsics_31-9b91cfb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_31.f90", "infile_hash": "f9db5457e09683e2b0afde876cbd0ddf85412c67117277ba413679af", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_31-9b91cfb.stdout", "stdout_hash": "e8a13f7e21bf1e857d4c2531d38c1298c1f8548610270cfa0a009ae4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-maskl_negative-c92502f.json0000664000175000017500000000074615174404631024366 0ustar alastairalastair{ "basename": "asr-maskl_negative-c92502f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/maskl_negative.f90", "infile_hash": "144605a5591f224661ccc2e7d6305d6654847c20157594f344d3bd7c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-maskl_negative-c92502f.stderr", "stderr_hash": "9a2147feaabf5d9848200d0e5b64655c2d4629c9fd23a58730edc2b8", "returncode": 2 }lfortran-0.63.0/tests/reference/run-write6-7442be9.json0000664000175000017500000000065715174404631022643 0ustar alastairalastair{ "basename": "run-write6-7442be9", "cmd": "lfortran --no-color {infile}", "infile": "tests/write6.f90", "infile_hash": "a4be2d1d5d03af3c83dd9f47c247c627e5f2f222cd527b3b0d781c14", "outfile": null, "outfile_hash": null, "stdout": "run-write6-7442be9.stdout", "stdout_hash": "59400cf5a52a85e7880d61e702843c2bba15a38ea7039cc42a52f7dc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_json-modules_10-93cd62d.json0000664000175000017500000000074515174404631024461 0ustar alastairalastair{ "basename": "asr_json-modules_10-93cd62d", "cmd": "lfortran --show-asr --no-indent --json {infile} -o {outfile}", "infile": "tests/modules_10.f90", "infile_hash": "82a7ff17209a0f99dc417848d6e080a46a74724bfdb4d50f5146ad7c", "outfile": null, "outfile_hash": null, "stdout": "asr_json-modules_10-93cd62d.stdout", "stdout_hash": "e12d37d1e2b5b8bca920d2134df42113a9acab125125cde616a57d1d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-where1-5c3f533.stdout0000664000175000017500000000112015174404631023605 0ustar alastairalastairprogram test implicit none integer :: x(2,2) = reshape([1, 2, 3, 4], [2, 2]) where (x == 1) x = 2 elsewhere where (x == 2) x = 3 elsewhere x = x*2 end where end where if (all(x == reshape([2, 3, 6, 8], [2, 2]))) then print *, "pass" else print *, "fail" end if where (x == 2) x = 3 elsewhere where (x == 3) x = 4 elsewhere where (x == 6) x = x*2 end where end where end where if (all(x == reshape([3, 4, 12, 8], [2, 2]))) then print *, "pass" else print *, "fail" end if end program test lfortran-0.63.0/tests/reference/ast-nullify_02-1c6befe.stdout0000664000175000017500000000460115174404631024146 0ustar alastairalastair(TranslationUnit [(Program nullify_02 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrPointer )] [(p1 [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrTarget )] [(t1 [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrPointer )] [(p2 [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrTarget )] [(t2 [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Associate 0 p1 t1 () ) (Assignment 0 p1 1 () ) (Associate 0 p2 t2 () ) (Assignment 0 p2 (Real "2.") () ) (Nullify 0 [p1 p2] [] (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/llvm-complex_dp-7286fd2.stdout0000664000175000017500000000575415174404631024301 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> %complex_8 = type <{ double, double }> %complex_4 = type <{ float, float }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [24 x i8] c"{R8,R8},{R4,R4},{R4,R4}\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %v = alloca %complex_8, align 8 %x = alloca %complex_4, align 8 %zero = alloca %complex_4, align 8 store %complex_4 zeroinitializer, %complex_4* %zero, align 1 store %complex_8 <{ double 0x3FF0CCCCC0000000, double 0x3FF0CCCCC0000000 }>, %complex_8* %v, align 1 store %complex_4 <{ float 0x3FF0CCCCC0000000, float 0x3FF0CCCCC0000000 }>, %complex_4* %x, align 1 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, %complex_8* %v, %complex_4* %x, %complex_4* %zero) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_complex_dp FINALIZE_SYMTABLE_complex_dp: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/llvm-external_04-30bc1c7.stdout0000664000175000017500000000065715174404631024331 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define void @a() { .entry: call void @b(float ()* @f, float ()* @g) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_a FINALIZE_SYMTABLE_a: ; preds = %return ret void } declare void @b(float ()*, float ()*) declare float @f() declare float @g() lfortran-0.63.0/tests/reference/asr_preprocess-cpp4-0611905.stderr0000664000175000017500000000024515174404631024667 0ustar alastairalastairsemantic error: Variable 'z12345678' is not declared --> tests/errors/cpp4.f90:11:13 | 11 | print *, x, C123, y | ^^^^ 'z12345678' is undeclared lfortran-0.63.0/tests/reference/asr-incorrect_number_args_subroutine-126ac8b.stderr0000664000175000017500000000026415174404631030631 0ustar alastairalastairsemantic error: More actual than formal arguments in procedure call --> tests/errors/incorrect_number_args_subroutine.f90:3:18 | 3 | call my_func(1) | ^ lfortran-0.63.0/tests/reference/asr-dimension_attr2-8fda690.stdout0000664000175000017500000001117615174404631025135 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f: (Variable 2 f [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Unspecified () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] PointerArray )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 x)] [] (Var 2 f) Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/ast-data_14-f20fec7.stdout0000664000175000017500000000345315174404631023325 0ustar alastairalastair(TranslationUnit [(Program data_14 () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(n [] [] () 4 Equal ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 n DimensionExpr)] )] [(arr [] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [(DataImpliedDo [(FuncCallOrArray arr [] [(() i () 0)] [] [] [] )] (AttrType TypeInteger [] () () None ) i 1 n () )] [(Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0")] )] () ) (Print 0 () [arr] () )] [] )] ) lfortran-0.63.0/tests/reference/pass_sign_from_value-sign_from_value-ba1c944.stdout0000664000175000017500000011545615174404631030627 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { flip_sign: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arr: (Variable 2 arr [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) (IntegerConstant -3 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), epsidp: (Variable 2 epsidp [] Local (Cast (IntegerConstant 16 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 16 (Integer 8) Decimal) () ) (IntegerConstant 16 (Integer 8) Decimal) Save (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), epsisp: (Variable 2 epsisp [] Local (IntegerConstant 16 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), epsrdp: (Variable 2 epsrdp [] Local (Cast (RealConstant 0.000001 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000001 (Real 8) ) () ) (RealConstant 0.000001 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), epsrsp: (Variable 2 epsrsp [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ixdp: (Variable 2 ixdp [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 5 (Integer 8) Decimal) () ) (IntegerConstant 5 (Integer 8) Decimal) Save (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ixsp: (Variable 2 ixsp [] Local (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rxdp: (Variable 2 rxdp [] Local (Cast (RealConstant 5.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 5.500000 (Real 8) ) () ) (RealConstant 5.500000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rxsp: (Variable 2 rxsp [] Local (RealConstant 5.500000 (Real 4) ) (RealConstant 5.500000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local (Cast (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant -2.000000 (Real 4) ) () ) (RealConstant -2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local (Cast (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant -3.000000 (Real 4) ) () ) (RealConstant -3.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) flip_sign [] [(Assignment (Var 2 rxsp) (RealBinOp (Var 2 rxsp) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (Var 2 epsrsp)] 0 (Real 4) () ) (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 rxsp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 rxsp) Sub (RealConstant 5.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 epsrsp) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 rxsp) (RealBinOp (Var 2 rxsp) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (RealUnaryMinus (Var 2 epsrsp) (Real 4) () )] 0 (Real 4) () ) (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 rxsp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 rxsp) Add (RealConstant 5.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 epsrsp) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 rxdp) (RealBinOp (Var 2 rxdp) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 8) ) (Var 2 epsrdp)] 0 (Real 8) () ) (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 rxdp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 rxdp) Sub (Cast (RealConstant 5.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 5.500000 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) Gt (Var 2 epsrdp) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 ixsp) (IntegerBinOp (Var 2 ixsp) Mul (IntrinsicElementalFunction Sign [(IntegerConstant 1 (Integer 4) Decimal) (Var 2 epsisp)] 0 (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 ixsp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 ixsp) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 rxdp) (RealBinOp (Var 2 rxdp) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 8) ) (RealUnaryMinus (Var 2 epsrdp) (Real 8) () )] 0 (Real 8) () ) (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 rxdp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 rxdp) Add (Cast (RealConstant 5.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 5.500000 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) Gt (Var 2 epsrdp) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 ixdp) (IntegerBinOp (Var 2 ixdp) Mul (IntrinsicElementalFunction Sign [(IntegerConstant 1 (Integer 8) Decimal) (Var 2 epsidp)] 0 (Integer 8) () ) (Integer 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 ixdp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 ixdp) NotEq (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 5 (Integer 8) Decimal) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 c) (IntegerBinOp (Var 2 a) Mul (IntrinsicElementalFunction Sign [(IntegerConstant 1 (Integer 4) Decimal) (Var 2 b)] 0 (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 c)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 c) NotEq (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 arr) (ArrayConstant 20 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00, 4.00000000e+00, 5.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 2 z) (ArrayItem (Var 2 arr) [(() (IntrinsicElementalFunction Int [(RealBinOp (Var 2 x) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (Var 2 y)] 0 (Real 4) () ) (Real 4) () )] 0 (Integer 4) () ) ())] (Real 4) ColMajor () ) () .false. .false. ) (Print (StringFormat () [(Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (Var 2 z) NotEq (ArrayItem (Var 2 arr) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-fixedform_subroutine2-805f758.json0000664000175000017500000000077715174404631025663 0ustar alastairalastair{ "basename": "ast-fixedform_subroutine2-805f758", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_subroutine2.f", "infile_hash": "2b76a52df280016afbeef3e6ca5d5168c57d6672be8c784021104759", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_subroutine2-805f758.stdout", "stdout_hash": "e3b630950ab6b4df198f9d85b549a913d8555e29c0ee6f195ac6ccdd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-array_bounds_check_01-713dbcf.stderr0000664000175000017500000000055615174404631026231 0ustar alastairalastairruntime error: Array shape mismatch in assignment to 'x'. Tried to match size 10 of dimension 1 of LHS with size 3 of dimension 1 of RHS. Use '--realloc-lhs-arrays' option to reallocate LHS automatically. --> tests/errors/array_bounds_check_01.f90:5:5 | 5 | x = [1, 2, 3] | ^ LHS size is 10 | 5 | x = [1, 2, 3] | ^^^^^^^^^ RHS size is 3 lfortran-0.63.0/tests/reference/cpp-kokkos_program2-43a2cc6.json0000664000175000017500000000072515174404631024554 0ustar alastairalastair{ "basename": "cpp-kokkos_program2-43a2cc6", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/kokkos_program2.f90", "infile_hash": "bba0b0329c504e01dd099058af96e20a7fe00294f66456fe3da634e0", "outfile": null, "outfile_hash": null, "stdout": "cpp-kokkos_program2-43a2cc6.stdout", "stdout_hash": "7610bc2855457732fca191fca696bc1823650600eac03109d40ce92c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-template_02-80b38d0.stdout0000664000175000017500000003226615174404631024064 0ustar alastairalastair(TranslationUnit [(Module template_02_m (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Requirement eq [t ne] [(DerivedType t [] () [(SimpleAttribute AttrDeferred )] [] [] )] [(Function ne [(lhs) (rhs)] [] () () () [] [] [] [(Declaration (AttrType TypeType [] () t None ) [(AttrIntent In )] [(lhs [] [] () () None ()) (rhs [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [] [(ne [] [] () () None ())] () )] [] [] [] )] ) (Template change_positions_tmpl [t ne] [(Require [(UnitRequire eq [(AttrNamelist t ) (AttrNamelist ne )] )] ) (Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(change_positions_t [] [] () () None ())] () )] [(Function change_positions_t [(vec)] [] mask () () [] [] [] [(Declaration (AttrType TypeType [] () t None ) [(AttrIntent In )] [(vec [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrAllocatable )] [(pos [(() () DimensionExpr)] [] () () None ()) (mask [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ()) (n [] [] () () None ())] () )] [(Assignment 0 n (FuncCallOrArray size [] [(() vec () 0)] [] [] [] ) () ) (Allocate 0 [(() (FuncCallOrArray pos [] [(() n () 0)] [] [] [] ) () 0)] [] () ) (If 0 () (< n 1) [(Return 0 () () )] [] () () () ) (Assignment 0 pos 0 () ) (Assignment 0 (FuncCallOrArray pos [] [(() 1 () 0)] [] [] [] ) 1 () ) (Assignment 0 j 1 () ) (DoLoop 0 () 0 i 2 n () [(If 0 () (FuncCallOrArray ne [] [(() (FuncCallOrArray vec [] [(() i () 0)] [] [] [] ) () 0) (() (FuncCallOrArray vec [] [(() (- i 1) () 0)] [] [] [] ) () 0)] [] [] [] ) [(Assignment 0 j (+ j 1) () ) (Assignment 0 (FuncCallOrArray pos [] [(() j () 0)] [] [] [] ) i () )] [] () () () )] () () ) (Allocate 0 [(() (FuncCallOrArray mask [] [(() j () 0)] [] [] [] ) () 0)] [] () ) (DoLoop 0 () 0 i 1 j () [(Assignment 0 (FuncCallOrArray mask [] [(() i () 0)] [] [] [] ) (FuncCallOrArray pos [] [(() i () 0)] [] [] [] ) () )] () () )] [] [] )] )] [] [] ) (Program template_02 () [(Use [] template_02_m [] .false. () )] [(ImplicitNone [] () )] [(Instantiate change_positions_tmpl [(AttrType TypeInteger [] () () None ) (AttrIntrinsicOperator NOTEQ )] [(UseSymbol change_positions_t change_positions_int )] ) (Instantiate change_positions_tmpl [(AttrType TypeCharacter [] () () None ) (AttrIntrinsicOperator NOTEQ )] [(UseSymbol change_positions_t change_positions_chr )] )] [(Print 0 () [(FuncCallOrArray change_positions_int [] [(() (ArrayInitializer () () [3 3 6 2 2 2 1] ) () 0)] [] [] [] )] () ) (Print 0 () [(FuncCallOrArray change_positions_chr [] [(() (ArrayInitializer () () [(String "a" ()) (String "a" ()) (String "b" ()) (String "p" ()) (String "p" ()) (String "p" ()) (String "o" ())] ) () 0)] [] [] [] )] () )] [] )] ) lfortran-0.63.0/tests/reference/llvm-intrinsics_02-404e16e.stdout0000664000175000017500000002222415174404631024612 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @intrinsics_02.x = internal global float 0x3FEFEB7AA0000000 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [6 x i8] c"R4,R8\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define float @_lcompilers_sin_f32(float* %x) { .entry: %_lcompilers_sin_f32 = alloca float, align 4 %0 = load float, float* %x, align 4 %1 = call float @_lfortran_ssin(float %0) store float %1, float* %_lcompilers_sin_f32, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE__lcompilers_sin_f32 FINALIZE_SYMTABLE__lcompilers_sin_f32: ; preds = %return %2 = load float, float* %_lcompilers_sin_f32, align 4 ret float %2 } declare float @_lfortran_ssin(float) define double @_lcompilers_sin_f64(double* %x) { .entry: %_lcompilers_sin_f64 = alloca double, align 8 %0 = load double, double* %x, align 8 %1 = call double @_lfortran_dsin(double %0) store double %1, double* %_lcompilers_sin_f64, align 8 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE__lcompilers_sin_f64 FINALIZE_SYMTABLE__lcompilers_sin_f64: ; preds = %return %2 = load double, double* %_lcompilers_sin_f64, align 8 ret double %2 } declare double @_lfortran_dsin(double) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value10 = alloca double, align 8 %call_arg_value = alloca float, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %y = alloca double, align 8 store double 0x3FEFEB7A9B2C6D8B, double* %y, align 8 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, float* @intrinsics_02.x, double* %y) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry %14 = load float, float* @intrinsics_02.x, align 4 %15 = fsub float %14, 0x3FEFEB7AA0000000 %16 = call float @llvm.fabs.f32(float %15) %17 = fcmp ogt float %16, 0x3EB0C6F7A0000000 br i1 %17, label %then, label %else then: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %free_done br label %ifcont ifcont: ; preds = %else, %then %18 = call float @_lcompilers_sin_f32(float* @intrinsics_02.x) %19 = fsub float %18, 0x3FEAE238A0000000 %20 = call float @llvm.fabs.f32(float %19) %21 = fcmp ogt float %20, 0x3EB0C6F7A0000000 br i1 %21, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %22 = load double, double* %y, align 8 %23 = fsub double %22, 0x3FEFEB7AA0000000 %24 = call double @llvm.fabs.f64(double %23) %25 = fcmp ogt double %24, 0x3E7AD7F2A0000000 br i1 %25, label %then4, label %else5 then4: ; preds = %ifcont3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont6 else5: ; preds = %ifcont3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 br i1 false, label %then7, label %else8 then7: ; preds = %ifcont6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 %26 = call double @_lcompilers_sin_f64(double* %y) %27 = load float, float* @intrinsics_02.x, align 4 %28 = call float @_lcompilers_sin_f32(float* @intrinsics_02.x) %29 = fadd float %27, %28 store float %29, float* %call_arg_value, align 4 %30 = call float @_lcompilers_sin_f32(float* %call_arg_value) %31 = fpext float %30 to double %32 = fadd double %26, %31 store double %32, double* %call_arg_value10, align 8 %33 = call double @_lcompilers_sin_f64(double* %call_arg_value10) %34 = fsub double %33, 0x3FEF20DD80000000 %35 = call double @llvm.fabs.f64(double %34) %36 = fcmp ogt double %35, 0x3E7AD7F2A0000000 br i1 %36, label %then11, label %else12 then11: ; preds = %ifcont9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont13 else12: ; preds = %ifcont9 br label %ifcont13 ifcont13: ; preds = %else12, %then11 br label %return return: ; preds = %ifcont13 br label %FINALIZE_SYMTABLE_intrinsics_02 FINALIZE_SYMTABLE_intrinsics_02: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) ; Function Attrs: nounwind readnone speculatable willreturn declare float @llvm.fabs.f32(float) #0 declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) ; Function Attrs: nounwind readnone speculatable willreturn declare double @llvm.fabs.f64(double) #0 attributes #0 = { nounwind readnone speculatable willreturn } lfortran-0.63.0/tests/reference/asr-implicit12-1826599.json0000664000175000017500000000106615174404631023223 0ustar alastairalastair{ "basename": "asr-implicit12-1826599", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit12.f90", "infile_hash": "b15934ce985f385fa987bbc85a37c711ad9f42818a7c50f8deeec4fc", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit12-1826599.stdout", "stdout_hash": "f061269791141538b1bfc968e801510e8e46782c46db7725c546a118", "stderr": "asr-implicit12-1826599.stderr", "stderr_hash": "cbfd053a67ccb4e4f31052c144534fb75f43bcc33820945c7b23af09", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-merge_bits_comp-23a3e67.stderr0000664000175000017500000000031015174404631025050 0ustar alastairalastairsemantic error: Kind of all the arguments of Mergebits must be the same --> tests/errors/merge_bits_comp.f90:2:14 | 2 | print *, merge_bits(8, 12_8, 2) | ^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/c-case_02-eff3752.stdout0000664000175000017500000000424015174404631022677 0ustar alastairalastair#include #include #include #include #include #include // Implementations int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); int32_t marks; int32_t out; marks = 81; if (91 <= marks <= 100) { out = 0; printf("%s\n","Excellent!"); } else if (81 <= marks <= 90) { out = 1; printf("%s\n","Very good!"); } else if (71 <= marks <= 80) { out = 2; printf("%s\n","Well done!"); } else if (61 <= marks <= 70) { out = 3; printf("%s\n","Not bad!"); } else if (41 <= marks <= 60) { out = 4; printf("%s\n","You passed!"); } else if (marks <= 40) { out = 5; printf("%s\n","Better try again!"); } else { out = 6; printf("%s\n","Invalid marks"); } printf("%s%s%d\n", "Your marks are ", " ", marks); if (out != 1) { fprintf(stderr, "ERROR STOP"); exit(1); } if (91 <= marks <= 100) { printf("%s\n","Excellent!"); } else if (81 <= marks <= 90) { printf("%s\n","Very good!"); } else if (71 <= marks <= 80) { printf("%s\n","Well done!"); } else if (61 <= marks <= 70) { printf("%s\n","Not bad!"); } else if (41 <= marks <= 60) { printf("%s\n","You passed!"); } else if (marks <= 40) { printf("%s\n","Better try again!"); } else { printf("%s\n","Invalid marks"); } printf("%s%s%d\n", "Your marks are ", " ", marks); if (91 <= marks <= 100) { printf("%s\n","Excellent!"); } else if (81 <= marks <= 90) { printf("%s\n","Very good!"); } else if (71 <= marks <= 80) { printf("%s\n","Well done!"); } else if (61 <= marks <= 70) { printf("%s\n","Not bad!"); } else if (41 <= marks <= 60) { printf("%s\n","You passed!"); } else if (marks <= 40) { printf("%s\n","Better try again!"); } else { printf("%s\n","Invalid marks"); } printf("%s%s%d\n", "Your marks are ", " ", marks); return 0; } lfortran-0.63.0/tests/reference/ast-while_02_fixed_form-524b922.stdout0000664000175000017500000001011515174404631025471 0ustar alastairalastair(TranslationUnit [(Program while_02 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ())] () )] [(Assignment 0 i 0 () ) (Assignment 0 j 0 () ) (WhileLoop 0 () (< i 10) [(Assignment 0 i (+ i 1) () ) (Assignment 0 j (+ j i) () )] () () ) (If 0 () (/= j 55) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (/= i 10) [(ErrorStop 0 () () () )] [] () () () ) (Assignment 0 i 0 () ) (Assignment 0 j 0 () ) (WhileLoop 0 () (< i 10) [(Assignment 0 i (+ i 1) () ) (If 0 () (== i 2) [(Exit 0 () () )] [] () () () ) (Assignment 0 j (+ j i) () )] () () ) (If 0 () (/= j 1) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (/= i 2) [(ErrorStop 0 () () () )] [] () () () ) (Assignment 0 i 0 () ) (Assignment 0 j 0 () ) (WhileLoop 0 () (< i 10) [(Assignment 0 i (+ i 1) () ) (If 0 () (== i 2) [(Cycle 0 () () )] [] () () () ) (Assignment 0 j (+ j i) () )] () () ) (If 0 () (/= j 53) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (/= i 10) [(ErrorStop 0 () () () )] [] () () () )] [] )] ) lfortran-0.63.0/tests/reference/asr-flush2-9767ece.stderr0000664000175000017500000000103115174404631023215 0ustar alastairalastairwarning: The 'flush' intrinsic function is an LFortran extension --> tests/flush2.f90:3:5 | 3 | call flush() | ^^^^^^^^^^^^ help: use the 'flush' statement instead warning: The 'flush' intrinsic function is an LFortran extension --> tests/flush2.f90:5:5 | 5 | call flush(10) | ^^^^^^^^^^^^^^ help: use the 'flush' statement instead warning: The 'flush' intrinsic function is an LFortran extension --> tests/flush2.f90:6:5 | 6 | call flush() | ^^^^^^^^^^^^ help: use the 'flush' statement instead lfortran-0.63.0/tests/reference/pass_do_loops-doloop_04-749d5f0.stdout0000664000175000017500000007474215174404631025643 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { doloop_04: (Program (SymbolTable 2 { __do_loop_inc: (Variable 2 __do_loop_inc [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __do_loop_inc1: (Variable 2 __do_loop_inc1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __do_loop_inc2: (Variable 2 __do_loop_inc2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 2 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) doloop_04 [] [(Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 k) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 __do_loop_inc) (Var 2 k) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (Var 2 __do_loop_inc) (Integer 4) () ) () .false. .false. ) (WhileLoop () (LogicalBinOp (LogicalBinOp (IntegerCompare (Var 2 __do_loop_inc) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) And (IntegerCompare (IntegerBinOp (Var 2 i) Add (Var 2 __do_loop_inc) (Integer 4) () ) LtE (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (IntegerCompare (Var 2 __do_loop_inc) LtE (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) And (IntegerCompare (IntegerBinOp (Var 2 i) Add (Var 2 __do_loop_inc) (Integer 4) () ) GtE (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (Var 2 __do_loop_inc) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 25 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 k) (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 __do_loop_inc1) (Var 2 k) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 10 (Integer 4) Decimal) Sub (Var 2 __do_loop_inc1) (Integer 4) () ) () .false. .false. ) (WhileLoop () (LogicalBinOp (LogicalBinOp (IntegerCompare (Var 2 __do_loop_inc1) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) And (IntegerCompare (IntegerBinOp (Var 2 i) Add (Var 2 __do_loop_inc1) (Integer 4) () ) LtE (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (IntegerCompare (Var 2 __do_loop_inc1) LtE (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) And (IntegerCompare (IntegerBinOp (Var 2 i) Add (Var 2 __do_loop_inc1) (Integer 4) () ) GtE (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (Var 2 __do_loop_inc1) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 30 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop a (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 2 i) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Exit a )] [] )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop b (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 2 i) Eq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(Exit b )] [] )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (WhileLoop c (LogicalConstant .true. (Logical 4) ) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 2 i) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Exit c )] [] ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 k) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 __do_loop_inc2) (Var 2 k) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (Var 2 __do_loop_inc2) (Integer 4) () ) () .false. .false. ) (WhileLoop () (LogicalBinOp (LogicalBinOp (IntegerCompare (Var 2 __do_loop_inc2) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) And (IntegerCompare (IntegerBinOp (Var 2 i) Add (Var 2 __do_loop_inc2) (Integer 4) () ) LtE (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (IntegerCompare (Var 2 __do_loop_inc2) LtE (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) And (IntegerCompare (IntegerBinOp (Var 2 i) Add (Var 2 __do_loop_inc2) (Integer 4) () ) GtE (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (Var 2 __do_loop_inc2) (Integer 4) () ) () .false. .false. ) (GoToTarget 100 100 )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr_preprocess-cpp5-4cb2070.stderr0000664000175000017500000000023515174404631025023 0ustar alastairalastairsemantic error: Variable 'z12345678' is not declared --> tests/errors/cpp5.f90:5:13 | 5 | print *, x, C123 | ^^^^ 'z12345678' is undeclared lfortran-0.63.0/tests/reference/llvm-class_01-82031c0.stderr0000664000175000017500000000035015174404631023416 0ustar alastairalastairwarning: Change of value in conversion from 'real(8)' to 'real(4)' --> tests/../integration_tests/class_01.f90:4:16 | 4 | real :: pi = 3.1415926535897931d0 ! Class-wide private constant | ^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-array_constructor_with_different_kind-80c5bf4.stderr0000664000175000017500000000030715174404631031652 0ustar alastairalastairsemantic error: Element in `real(8)` array constructor is `real(4)` --> tests/errors/array_constructor_with_different_kind.f90:4:18 | 4 | print *, [x, [1., 2.]] | ^^^^^^^^ lfortran-0.63.0/tests/reference/asr-operator_overloading_01-9ec8e71.json0000664000175000017500000000115515174404631026207 0ustar alastairalastair{ "basename": "asr-operator_overloading_01-9ec8e71", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/operator_overloading_01.f90", "infile_hash": "f44f3172b4b5235b41deb5a4d4eaadc61a6b7c51e002a983889cf38f", "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_01-9ec8e71.stdout", "stdout_hash": "32ad616e16c75978b9b2b255d8ea9ad3090d27ae30e4edb6e6ce66bb", "stderr": "asr-operator_overloading_01-9ec8e71.stderr", "stderr_hash": "bc887b577bc8ccfc15f212c070a67ee8c67af8d343abdd0132e6b6fb", "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-associate_02-558b0e6.stdout0000664000175000017500000003774315174404631024422 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %complex_4 = type <{ float, float }> %string_descriptor = type <{ i8*, i64 }> @associate_02.t1 = internal global i32 2 @associate_02.t2 = internal global double 2.000000e+00 @associate_02.t3 = internal global %complex_4 zeroinitializer @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.4 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.5 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.6 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.7 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc19 = alloca %string_descriptor, align 8 %stringFormat_desc16 = alloca %string_descriptor, align 8 %stringFormat_desc13 = alloca %string_descriptor, align 8 %stringFormat_desc10 = alloca %string_descriptor, align 8 %stringFormat_desc7 = alloca %string_descriptor, align 8 %stringFormat_desc4 = alloca %string_descriptor, align 8 %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %p1 = alloca i32*, align 8 store i32* null, i32** %p1, align 8 %p2 = alloca double*, align 8 store double* null, double** %p2, align 8 %p3 = alloca %complex_4*, align 8 store %complex_4* null, %complex_4** %p3, align 8 store %complex_4 <{ float 2.000000e+00, float 3.000000e+00 }>, %complex_4* @associate_02.t3, align 1 store i32* @associate_02.t1, i32** %p1, align 8 store double* @associate_02.t2, double** %p2, align 8 store %complex_4* @associate_02.t3, %complex_4** %p3, align 8 %3 = load i32*, i32** %p1, align 8 store i32 1, i32* %3, align 4 %4 = load double*, double** %p2, align 8 store double 4.000000e+00, double* %4, align 8 %5 = alloca i64, align 8 %6 = load i32*, i32** %p1, align 8 %7 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %5, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %6) %8 = load i64, i64* %5, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %7, i8** %9, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %8, i64* %10, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %12 = load i8*, i8** %11, align 8 %13 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %14 = load i64, i64* %13, align 8 %15 = trunc i64 %14 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %12, i32 %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %16 = icmp eq i8* %7, null br i1 %16, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %7) br label %free_done free_done: ; preds = %free_nonnull, %.entry %17 = alloca i64, align 8 %18 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %17, i32 0, i32 0, i32 0, i32 0, i32 0, i32* @associate_02.t1) %19 = load i64, i64* %17, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %18, i8** %20, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %19, i64* %21, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %23 = load i8*, i8** %22, align 8 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %25 = load i64, i64* %24, align 8 %26 = trunc i64 %25 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %23, i32 %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %27 = icmp eq i8* %18, null br i1 %27, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %2, i8* %18) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %28 = load double*, double** %p2, align 8 %29 = load double, double* %28, align 8 %30 = load i32*, i32** %p1, align 8 %31 = load i32, i32* %30, align 4 %32 = sitofp i32 %31 to double %33 = fadd double %29, %32 %34 = fptosi double %33 to i32 store i32 %34, i32* @associate_02.t1, align 4 %35 = alloca i64, align 8 %36 = load i32*, i32** %p1, align 8 %37 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %35, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %36) %38 = load i64, i64* %35, align 8 %39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %37, i8** %39, align 8 %40 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %38, i64* %40, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %42 = load i8*, i8** %41, align 8 %43 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %44 = load i64, i64* %43, align 8 %45 = trunc i64 %44 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %42, i32 %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %46 = icmp eq i8* %37, null br i1 %46, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free_alloc(i8* %2, i8* %37) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 %47 = alloca i64, align 8 %48 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.3, i32 0, i32 0), i64* %47, i32 0, i32 0, i32 0, i32 0, i32 0, i32* @associate_02.t1) %49 = load i64, i64* %47, align 8 %50 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 store i8* %48, i8** %50, align 8 %51 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 store i64 %49, i64* %51, align 8 %52 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 %53 = load i8*, i8** %52, align 8 %54 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 %55 = load i64, i64* %54, align 8 %56 = trunc i64 %55 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %53, i32 %56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %57 = icmp eq i8* %48, null br i1 %57, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %free_done6 call void @_lfortran_free_alloc(i8* %2, i8* %48) br label %free_done9 free_done9: ; preds = %free_nonnull8, %free_done6 store i32 8, i32* @associate_02.t1, align 4 %58 = alloca i64, align 8 %59 = load i32*, i32** %p1, align 8 %60 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.4, i32 0, i32 0), i64* %58, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %59) %61 = load i64, i64* %58, align 8 %62 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 store i8* %60, i8** %62, align 8 %63 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 store i64 %61, i64* %63, align 8 %64 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 %65 = load i8*, i8** %64, align 8 %66 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 %67 = load i64, i64* %66, align 8 %68 = trunc i64 %67 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %65, i32 %68, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %69 = icmp eq i8* %60, null br i1 %69, label %free_done12, label %free_nonnull11 free_nonnull11: ; preds = %free_done9 call void @_lfortran_free_alloc(i8* %2, i8* %60) br label %free_done12 free_done12: ; preds = %free_nonnull11, %free_done9 %70 = alloca i64, align 8 %71 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.5, i32 0, i32 0), i64* %70, i32 0, i32 0, i32 0, i32 0, i32 0, i32* @associate_02.t1) %72 = load i64, i64* %70, align 8 %73 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 store i8* %71, i8** %73, align 8 %74 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 store i64 %72, i64* %74, align 8 %75 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 %76 = load i8*, i8** %75, align 8 %77 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 %78 = load i64, i64* %77, align 8 %79 = trunc i64 %78 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %76, i32 %79, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %80 = icmp eq i8* %71, null br i1 %80, label %free_done15, label %free_nonnull14 free_nonnull14: ; preds = %free_done12 call void @_lfortran_free_alloc(i8* %2, i8* %71) br label %free_done15 free_done15: ; preds = %free_nonnull14, %free_done12 %81 = load %complex_4*, %complex_4** %p3, align 8 %82 = load %complex_4*, %complex_4** %p3, align 8 %83 = load %complex_4, %complex_4* %82, align 1 %84 = extractvalue %complex_4 %83, 0 %85 = extractvalue %complex_4 %83, 1 %86 = fmul float 2.000000e+00, %84 %87 = fmul float 0.000000e+00, %85 %88 = fmul float 2.000000e+00, %85 %89 = fmul float 0.000000e+00, %84 %90 = fsub float %86, %87 %91 = fadd float %88, %89 %92 = insertvalue %complex_4 undef, float %90, 0 %93 = insertvalue %complex_4 %92, float %91, 1 store %complex_4 %93, %complex_4* %81, align 1 %94 = alloca i64, align 8 %95 = load %complex_4*, %complex_4** %p3, align 8 %96 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.6, i32 0, i32 0), i64* %94, i32 0, i32 0, i32 0, i32 0, i32 0, %complex_4* %95) %97 = load i64, i64* %94, align 8 %98 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 store i8* %96, i8** %98, align 8 %99 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 store i64 %97, i64* %99, align 8 %100 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 %101 = load i8*, i8** %100, align 8 %102 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 %103 = load i64, i64* %102, align 8 %104 = trunc i64 %103 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %101, i32 %104, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) %105 = icmp eq i8* %96, null br i1 %105, label %free_done18, label %free_nonnull17 free_nonnull17: ; preds = %free_done15 call void @_lfortran_free_alloc(i8* %2, i8* %96) br label %free_done18 free_done18: ; preds = %free_nonnull17, %free_done15 %106 = alloca i64, align 8 %107 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.7, i32 0, i32 0), i64* %106, i32 0, i32 0, i32 0, i32 0, i32 0, %complex_4* @associate_02.t3) %108 = load i64, i64* %106, align 8 %109 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 store i8* %107, i8** %109, align 8 %110 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 store i64 %108, i64* %110, align 8 %111 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 %112 = load i8*, i8** %111, align 8 %113 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 %114 = load i64, i64* %113, align 8 %115 = trunc i64 %114 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* %112, i32 %115, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 1) %116 = icmp eq i8* %107, null br i1 %116, label %free_done21, label %free_nonnull20 free_nonnull20: ; preds = %free_done18 call void @_lfortran_free_alloc(i8* %2, i8* %107) br label %free_done21 free_done21: ; preds = %free_nonnull20, %free_done18 br label %return return: ; preds = %free_done21 br label %FINALIZE_SYMTABLE_associate_02 FINALIZE_SYMTABLE_associate_02: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-preprocessor17-f2d76bb.stdout0000664000175000017500000000700515174404631025001 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor1: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) preprocessor1 [] [(Assignment (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) Mul (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 25 (Integer 4) Decimal) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x) (IntegerConstant 12345678 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-implicit5-8745632.json0000664000175000017500000000074215174404631023140 0ustar alastairalastair{ "basename": "asr-implicit5-8745632", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit5.f90", "infile_hash": "57638dfdf42ed194d8b670c35ec4e43e74c3a6cf3a32f2cb553f5927", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit5-8745632.stdout", "stdout_hash": "9df10e7c5bee3c138dec36eade650fa045d7b4825c4414f3da367885", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_json-special_chars_json-219ee5a.json0000664000175000017500000000077515174404631026344 0ustar alastairalastair{ "basename": "ast_json-special_chars_json-219ee5a", "cmd": "lfortran --show-ast --no-indent --json {infile} -o {outfile}", "infile": "tests/special_chars_json.f90", "infile_hash": "f1aaa183ee7d224a4f0e158546c6f3077e139ee963f833a4c37394d5", "outfile": null, "outfile_hash": null, "stdout": "ast_json-special_chars_json-219ee5a.stdout", "stdout_hash": "0dbe25709b76c1d48d417076eca4cdc65f0a05ca07acc2b1ec206b68", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_transform_optional_argument_functions-optional_03-1316a5f.json0000664000175000017500000000112115174404631033657 0ustar alastairalastair{ "basename": "pass_transform_optional_argument_functions-optional_03-1316a5f", "cmd": "lfortran --pass=transform_optional_argument_functions --show-asr --no-color {infile} -o {outfile}", "infile": "tests/optional_03.f90", "infile_hash": "706b33a3f5e59ce5e07ca126a2b59cadd02456d4d1f759b068cb8ffe", "outfile": null, "outfile_hash": null, "stdout": "pass_transform_optional_argument_functions-optional_03-1316a5f.stdout", "stdout_hash": "086dad5e00c59fa926bb8862adb4787d5527b6fc6907bf83c0c38527", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-dfloat1-6063adb.stderr0000664000175000017500000000021715174404631023325 0ustar alastairalastairsemantic error: Argument of intrinsic must be an integer --> tests/errors/dfloat1.f90:3:10 | 3 | print *, dfloat(y) | ^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-intrinsics3-a8fd035.json0000664000175000017500000000073515174404631023723 0ustar alastairalastair{ "basename": "asr-intrinsics3-a8fd035", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics3.f90", "infile_hash": "4a1a87d1964e4fcaec28b46493e377b19c106ddf516e7eece19bf505", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics3-a8fd035.stderr", "stderr_hash": "9662b63070f3016d3239c26dc851585640cfeda7c75518af0882dae7", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-unlimited_polymorphic_intrinsic_type_allocate-3e26601.stdout0000664000175000017500000003225515174404631033455 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> %"~unlimited_polymorphic_type" = type <{ i32 (...)**, i8* }> @_Type_Info_integer_8 = linkonce_odr unnamed_addr constant { i8*, i8*, i8* } { i8* inttoptr (i32 8 to i8*), i8* inttoptr (i64 8 to i8*), i8* null }, align 8 @_VTable_integer_8 = linkonce_odr unnamed_addr constant { [5 x i8*] } { [5 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_integer_8 to i8*), i8* bitcast (void (i8*, i8*)* @_copy_integer_8 to i8*), i8* bitcast (void (i8**)* @_allocate_integer_8 to i8*), i8* bitcast (void (i8*)* @finalize_i64_for_UPoly to i8*)] }, align 8 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [10 x i8] c"integer(8)" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data, i32 0, i32 0), i64 10 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @_Type_Info_integer_4 = linkonce_odr unnamed_addr constant { i8*, i8*, i8* } { i8* inttoptr (i32 4 to i8*), i8* inttoptr (i64 4 to i8*), i8* null }, align 8 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [10 x i8] c"integer(4)" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data.1, i32 0, i32 0), i64 10 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @_Type_Info_real_4 = linkonce_odr unnamed_addr constant { i8*, i8*, i8* } { i8* inttoptr (i32 6 to i8*), i8* inttoptr (i64 4 to i8*), i8* null }, align 8 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.3 = private constant [4 x i8] c"real" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.3, i32 0, i32 0), i64 4 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.5 = private constant [7 x i8] c"default" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([7 x i8], [7 x i8]* @string_const_data.5, i32 0, i32 0), i64 7 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %var = alloca %"~unlimited_polymorphic_type"*, align 8 store %"~unlimited_polymorphic_type"* null, %"~unlimited_polymorphic_type"** %var, align 8 %x = alloca i64, align 8 store i64 10, i64* %x, align 8 %2 = call i8* @_lfortran_get_default_allocator() %3 = call i8* @_lfortran_malloc_alloc(i8* %2, i64 8) call void @llvm.memset.p0i8.i32(i8* %3, i8 0, i32 8, i1 false) %4 = call i8* @_lfortran_get_default_allocator() %5 = call i8* @_lfortran_malloc_alloc(i8* %4, i64 16) call void @llvm.memset.p0i8.i32(i8* %5, i8 0, i32 16, i1 false) %6 = bitcast i8* %5 to %"~unlimited_polymorphic_type"* store %"~unlimited_polymorphic_type"* %6, %"~unlimited_polymorphic_type"** %var, align 8 %7 = load %"~unlimited_polymorphic_type"*, %"~unlimited_polymorphic_type"** %var, align 8 %8 = getelementptr %"~unlimited_polymorphic_type", %"~unlimited_polymorphic_type"* %7, i32 0, i32 1 store i8* %3, i8** %8, align 8 %9 = load i8*, i8** %8, align 8 %10 = bitcast i8* %9 to i64* %11 = bitcast %"~unlimited_polymorphic_type"* %6 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_integer_8, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %11, align 8 %12 = load i64, i64* %x, align 8 store i64 %12, i64* %10, align 8 %13 = alloca i1, align 1 %14 = load %"~unlimited_polymorphic_type"*, %"~unlimited_polymorphic_type"** %var, align 8 %15 = bitcast %"~unlimited_polymorphic_type"* %14 to i8* %16 = call i8* @__lfortran_dynamic_cast(i8* %15, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_integer_8 to i8*), i1 true) %17 = icmp ne i8* %16, null store i1 %17, i1* %13, align 1 %18 = load i1, i1* %13, align 1 br i1 %18, label %then, label %else then: ; preds = %.entry br label %"~select_type_block_.start" "~select_type_block_.start": ; preds = %then %19 = call i8* @llvm.stacksave() %20 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %20, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %"~select_type_block_.end" "~select_type_block_.end": ; preds = %"~select_type_block_.start" br label %"FINALIZE_SYMTABLE_~select_type_block_" "FINALIZE_SYMTABLE_~select_type_block_": ; preds = %"~select_type_block_.end" call void @llvm.stackrestore(i8* %19) br label %ifcont else: ; preds = %.entry %21 = alloca i1, align 1 %22 = load %"~unlimited_polymorphic_type"*, %"~unlimited_polymorphic_type"** %var, align 8 %23 = bitcast %"~unlimited_polymorphic_type"* %22 to i8* %24 = call i8* @__lfortran_dynamic_cast(i8* %23, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_integer_4 to i8*), i1 true) %25 = icmp ne i8* %24, null store i1 %25, i1* %21, align 1 %26 = load i1, i1* %21, align 1 br i1 %26, label %then1, label %else2 then1: ; preds = %else br label %"~select_type_block_1.start" "~select_type_block_1.start": ; preds = %then1 %27 = call i8* @llvm.stacksave() %28 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %28, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) br label %"~select_type_block_1.end" "~select_type_block_1.end": ; preds = %"~select_type_block_1.start" br label %"FINALIZE_SYMTABLE_~select_type_block_1" "FINALIZE_SYMTABLE_~select_type_block_1": ; preds = %"~select_type_block_1.end" call void @llvm.stackrestore(i8* %27) br label %ifcont else2: ; preds = %else %29 = alloca i1, align 1 %30 = load %"~unlimited_polymorphic_type"*, %"~unlimited_polymorphic_type"** %var, align 8 %31 = bitcast %"~unlimited_polymorphic_type"* %30 to i8* %32 = call i8* @__lfortran_dynamic_cast(i8* %31, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_real_4 to i8*), i1 true) %33 = icmp ne i8* %32, null store i1 %33, i1* %29, align 1 %34 = load i1, i1* %29, align 1 br i1 %34, label %then3, label %else4 then3: ; preds = %else2 br label %"~select_type_block_2.start" "~select_type_block_2.start": ; preds = %then3 %35 = call i8* @llvm.stacksave() %36 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %36, i32 4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) br label %"~select_type_block_2.end" "~select_type_block_2.end": ; preds = %"~select_type_block_2.start" br label %"FINALIZE_SYMTABLE_~select_type_block_2" "FINALIZE_SYMTABLE_~select_type_block_2": ; preds = %"~select_type_block_2.end" call void @llvm.stackrestore(i8* %35) br label %ifcont else4: ; preds = %else2 br label %"~select_type_block_3.start" "~select_type_block_3.start": ; preds = %else4 %37 = call i8* @llvm.stacksave() %38 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.6, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %38, i32 7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) br label %"~select_type_block_3.end" "~select_type_block_3.end": ; preds = %"~select_type_block_3.start" br label %"FINALIZE_SYMTABLE_~select_type_block_3" "FINALIZE_SYMTABLE_~select_type_block_3": ; preds = %"~select_type_block_3.end" call void @llvm.stackrestore(i8* %37) br label %ifcont ifcont: ; preds = %"FINALIZE_SYMTABLE_~select_type_block_3", %"FINALIZE_SYMTABLE_~select_type_block_2", %"FINALIZE_SYMTABLE_~select_type_block_1", %"FINALIZE_SYMTABLE_~select_type_block_" br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_unlimited_polymorphic_intrinsic_type_allocate FINALIZE_SYMTABLE_unlimited_polymorphic_intrinsic_type_allocate: ; preds = %return br label %Finalize_Variable_var Finalize_Variable_var: ; preds = %FINALIZE_SYMTABLE_unlimited_polymorphic_intrinsic_type_allocate %39 = load %"~unlimited_polymorphic_type"*, %"~unlimited_polymorphic_type"** %var, align 8 call void @"finalize_allocatable__StructType_Class__~unlimited_polymorphic_type"(%"~unlimited_polymorphic_type"* %39) call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc_alloc(i8*, i64) declare i8* @_lfortran_get_default_allocator() ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 define linkonce_odr void @_copy_integer_8(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to i64* %3 = bitcast i8* %1 to i64* %4 = load i64, i64* %2, align 8 store i64 %4, i64* %3, align 8 ret void } define linkonce_odr void @_allocate_integer_8(i8** %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = call i8* @_lfortran_malloc_alloc(i8* %1, i64 16) call void @llvm.memset.p0i8.i32(i8* %2, i8 0, i32 16, i1 false) store i8* %2, i8** %0, align 8 %3 = bitcast i8* %2 to <{ i32 (...)**, i8* }>* %4 = bitcast <{ i32 (...)**, i8* }>* %3 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_integer_8, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %4, align 8 %5 = call i8* @_lfortran_get_default_allocator() %6 = call i8* @_lfortran_malloc_alloc(i8* %5, i64 8) call void @llvm.memset.p0i8.i32(i8* %6, i8 0, i32 8, i1 false) %7 = getelementptr <{ i32 (...)**, i8* }>, <{ i32 (...)**, i8* }>* %3, i32 0, i32 1 store i8* %6, i8** %7, align 8 ret void } define internal void @finalize_i64_for_UPoly(i8* %0) { entry: %1 = bitcast i8* %0 to i64* ret void } declare i8* @__lfortran_dynamic_cast(i8*, i8*, i1) ; Function Attrs: nounwind declare i8* @llvm.stacksave() #1 declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) ; Function Attrs: nounwind declare void @llvm.stackrestore(i8*) #1 define internal void @"finalize_allocatable__StructType_Class__~unlimited_polymorphic_type"(%"~unlimited_polymorphic_type"* %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = icmp ne %"~unlimited_polymorphic_type"* %0, null br i1 %2, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %entry call void @"finalize_StructType_Class__~unlimited_polymorphic_type"(%"~unlimited_polymorphic_type"* %0) %3 = bitcast %"~unlimited_polymorphic_type"* %0 to i8* call void @_lfortran_free_alloc(i8* %1, i8* %3) br label %is_allocated.ifcont is_allocated.else: ; preds = %entry br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %is_allocated.then ret void } define internal void @"finalize_StructType_Class__~unlimited_polymorphic_type"(%"~unlimited_polymorphic_type"* %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = getelementptr %"~unlimited_polymorphic_type", %"~unlimited_polymorphic_type"* %0, i32 0, i32 0 %3 = load i32 (...)**, i32 (...)*** %2, align 8 %4 = icmp ne i32 (...)** %3, null br i1 %4, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %entry %5 = getelementptr inbounds i32 (...)*, i32 (...)** %3, i32 2 %6 = load i8*, i32 (...)** %5, align 8 %7 = bitcast i8* %6 to void (i8*)* %8 = getelementptr %"~unlimited_polymorphic_type", %"~unlimited_polymorphic_type"* %0, i32 0, i32 1 %9 = load i8*, i8** %8, align 8 call void %7(i8* %9) br label %is_allocated.ifcont is_allocated.else: ; preds = %entry br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %is_allocated.then %10 = getelementptr %"~unlimited_polymorphic_type", %"~unlimited_polymorphic_type"* %0, i32 0, i32 1 %11 = load i8*, i8** %10, align 8 call void @_lfortran_free_alloc(i8* %1, i8* %11) ret void } declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() attributes #0 = { argmemonly nounwind willreturn writeonly } attributes #1 = { nounwind } lfortran-0.63.0/tests/reference/run-format_32-b407b58.json0000664000175000017500000000071515174404631023205 0ustar alastairalastair{ "basename": "run-format_32-b407b58", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_32.f90", "infile_hash": "385d84e335ddd90480fc23634cd59d26ffab47077a530930c9b040c4", "outfile": null, "outfile_hash": null, "stdout": "run-format_32-b407b58.stdout", "stdout_hash": "cc677e65d96a9b300f723460d58d5958810ec354b9c40c4d015aab9a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor1-7e98a71.stdout0000664000175000017500000000700515174404631027030 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor1: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) preprocessor1 [] [(Assignment (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) Mul (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 25 (Integer 4) Decimal) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x) (IntegerConstant 12345678 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-init_values-19dfa76.stdout0000664000175000017500000004414015174404631024353 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { init_values: (Program (SymbolTable 2 { a: (Variable 2 a [i j] Local (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [l] Local (LogicalBinOp (Var 2 l) Or (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) (LogicalConstant .true. (Logical 4) ) Parameter (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 4.000000 (Complex 4) ) ) (ComplexConstant 3.000000 4.000000 (Complex 4) ) Parameter (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local (Cast (RealConstant 1.000000 (Real 4) ) RealToInteger (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) () ) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local (Cast (RealConstant 2.000000 (Real 4) ) RealToInteger (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) () ) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 2 l [a] Local (IntegerCompare (Var 2 a) Eq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) (LogicalConstant .true. (Logical 4) ) Parameter (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 2 r [] Local (RealConstant 4.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r_minus: (Variable 2 r_minus [r] Local (RealUnaryMinus (Var 2 r) (Real 4) (RealConstant -4.000000 (Real 4) ) ) (RealConstant -4.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s: (Variable 2 s [s1 s2] Local (IntrinsicElementalFunction StringConcat [(Var 2 s1) (Var 2 s2)] 0 (String 1 (IntegerConstant 4 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "left" (String 1 (IntegerConstant 4 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "left" (String 1 (IntegerConstant 4 (Integer 8) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s1: (Variable 2 s1 [] Local (StringConstant "l" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "l" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s2: (Variable 2 s2 [] Local (StringConstant "eft" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "eft" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) init_values [] [(Print (StringFormat () [(Var 2 i) (Var 2 j) (Var 2 r) (Var 2 c) (Var 2 a) (Var 2 l) (Var 2 b) (Var 2 r_minus) (Var 2 s)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-types_12-025af39.stdout0000664000175000017500000000572515174404631023417 0ustar alastairalastair(TranslationUnit [(Program types_12 () [(Use [] iso_c_binding [(UseSymbol c_int () ) (UseSymbol c_double () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Interface (InterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceProc (Function f [(a) (b)] [(AttrType TypeInteger [(() c_int Value)] () () None )] r () () [] [(Import [c_int c_double] ImportDefault () )] [] [(Declaration (AttrType TypeInteger [(() c_int Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() c_double Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(b [] [] () () None ())] () )] [] [] [] ) )] )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-array10-1f60f5f.stdout0000664000175000017500000000613315174404631023304 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { const_arrays: (Program (SymbolTable 2 { x: (Variable 2 x [] Local (ArrayConstant 20 [4, 9, 6, 12, 13] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayConstant 20 [4, 9, 6, 12, 13] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) const_arrays [] [(Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-private1-d8bb7ee.stdout0000664000175000017500000002050315174404631023720 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { foo1: (Module (SymbolTable 2 { }) foo1 () [] .false. .false. .false. ), foo2: (Module (SymbolTable 3 { f: (Function (SymbolTable 4 { }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 y) (RealConstant 3.000000 (Real 4) ) () .false. .false. )] () Public .true. .true. () ), y: (Variable 3 y [] Local (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) (RealConstant 2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) foo2 () [] .false. .false. .false. ), test: (Program (SymbolTable 5 { f: (ExternalSymbol 5 f 3 f foo2 [] f Public ), y: (ExternalSymbol 5 y 3 y foo2 [] y Public ) }) test [foo2] [(Print (StringFormat () [(Var 5 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 5 y) Sub (RealConstant 2.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (SubroutineCall 5 f () [] () .false. ) (Print (StringFormat () [(Var 5 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 5 y) Sub (RealConstant 3.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-allocate_01-f3446f6.stdout0000664000175000017500000032142115174404631024036 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { allocate_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Allocatable (Array (Complex 4) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Local (ArrayConstant 20 [1, 2, 3, 4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayConstant 20 [1, 2, 3, 4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), e: (Variable 2 e [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Variable 2 f [] Local () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), g: (Variable 2 g [] Local () () Default (Allocatable (Array (Complex 4) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ierr: (Variable 2 ierr [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 2 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 2 r [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), reduce_sum: (Function (SymbolTable 4 { c: (Variable 4 c [] In () () Default (Array (Complex 4) [(() ()) (() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 4 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 4 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 4 r [] ReturnVar () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) reduce_sum (FunctionType [(Array (Complex 4) [(() ()) (() ()) (() ())] DescriptorArray )] (Complex 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 c)] [(Assignment (Var 4 r) (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 0.000000 0.000000 (Complex 4) ) () ) () .false. .false. ) (DoLoop () ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Assignment (Var 4 r) (ComplexBinOp (Var 4 r) Add (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Complex 4) ColMajor () ) (Complex 4) () ) () .false. .false. )] [] )] [] )] [] )] (Var 4 r) Public .true. .true. () ), sum: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] In () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 3 c [] Out () () Default (Allocatable (Array (Complex 4) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c_copy: (Variable 3 c_copy [] Local () () Default (Allocatable (Array (Complex 4) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 3 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 3 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sum (FunctionType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) (Allocatable (Array (Complex 4) [(() ()) (() ()) (() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 c)] [(Allocate [((Var 3 c_copy) [((ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) Sub (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) Sub (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) Sub (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] () () ())] () () () ) (Allocate [((Var 3 c) [((ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) Sub (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) Sub (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) Sub (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] () () ())] () () () ) (DoLoop () ((Var 3 i) (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 3 j) (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 3 k) (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Assignment (ArrayItem (Var 3 c_copy) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4) ColMajor () ) (Cast (RealBinOp (Cast (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4) ColMajor () ) IntegerToReal (Real 4) () () ) Add (ArrayItem (Var 3 b) [(() (Var 3 j) ()) (() (Var 3 k) ())] (Real 4) ColMajor () ) (Real 4) () ) RealToComplex (Complex 4) () () ) () .false. .false. ) (Assignment (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4) ColMajor () ) (Cast (RealBinOp (Cast (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4) ColMajor () ) IntegerToReal (Real 4) () () ) Add (ArrayItem (Var 3 b) [(() (Var 3 j) ()) (() (Var 3 k) ())] (Real 4) ColMajor () ) (Real 4) () ) RealToComplex (Complex 4) () () ) () .false. .false. )] [] )] [] )] [] ) (ExplicitDeallocate [(Var 3 c_copy)] )] () Public .true. .true. () ) }) allocate_01 [] [(Assignment (Var 2 n) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (Allocate [((Var 2 e) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] () () ())] () () (Var 2 d) ) (If () (IntegerCompare (ArraySize (Var 2 e) () (Integer 4) () ) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Allocate [((Var 2 a) [((ArrayBound (Var 2 e) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArraySize (Var 2 e) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] () () ())] () () (Var 2 e) ) (If () (IntegerCompare (ArraySize (Var 2 a) () (Integer 4) () ) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (ExplicitDeallocate [(Var 2 a)] ) (Allocate [((Var 2 b) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] () () ())] () () () ) (Allocate [((Var 2 f) [((ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArraySize (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArraySize (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] () () ())] () () (Var 2 b) ) (If () (LogicalBinOp (IntegerCompare (ArraySize (Var 2 f) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) Or (IntegerCompare (ArraySize (Var 2 f) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (ExplicitDeallocate [(Var 2 b)] ) (Allocate [((Var 2 c) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] () () ())] () () () ) (Allocate [((Var 2 g) [((ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArraySize (Var 2 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArraySize (Var 2 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) LBound () ) (ArraySize (Var 2 c) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ))] () () ())] () () (Var 2 c) ) (If () (LogicalBinOp (LogicalBinOp (IntegerCompare (ArraySize (Var 2 g) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) Or (IntegerCompare (ArraySize (Var 2 g) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) Or (IntegerCompare (ArraySize (Var 2 g) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (ExplicitDeallocate [(Var 2 c)] ) (Allocate [((Var 2 a) [((IntegerConstant 5 (Integer 4) Decimal) (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] () () ())] () () () ) (Allocate [((Var 2 b) [((Var 2 n) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 2 n) (Integer 4) () ) Sub (Var 2 n) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((Var 2 n) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Mul (Var 2 n) (Integer 4) () ) Sub (Var 2 n) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] () () ())] (Var 2 ierr) () () ) (If () (IntegerCompare (ArraySize (Var 2 a) () (Integer 4) () ) NotEq (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArraySize (Var 2 b) () (Integer 4) () ) NotEq (IntegerBinOp (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Mul (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 2 n) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Assignment (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. )] [] ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Assignment (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4) ColMajor () ) (Cast (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () ) IntegerToReal (Real 4) () () ) () .false. .false. )] [] )] [] ) (SubroutineCall 2 sum () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] () .false. ) (If () (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) NotEq (IntegerBinOp (Var 2 n) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) NotEq (Var 2 n) (Logical 4) () ) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) NotEq (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 2 n) (Integer 4) () ) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) LBound () ) NotEq (Var 2 n) (Logical 4) () ) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) UBound () ) NotEq (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Mul (Var 2 n) (Integer 4) () ) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(If () (IntegerCompare (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) NotEq (Var 2 i) (Logical 4) () ) [(ErrorStop () )] [] )] [] ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(If () (RealCompare (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4) ColMajor () ) NotEq (Cast (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () ) IntegerToReal (Real 4) () () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 2 k) (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(If () (ComplexCompare (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () ) Add (Var 2 k) (Integer 4) () ) IntegerToComplex (Complex 4) () () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] )] [] ) (Assignment (Var 2 r) (FunctionCall 2 reduce_sum () [((Var 2 c))] (Complex 4) () () ) () .false. .false. ) (If () (ComplexCompare (Var 2 r) NotEq (ComplexConstructor (RealConstant 114345.000000 (Real 4) ) (RealConstant 0.000000 (Real 4) ) (Complex 4) (ComplexConstant 114345.000000 0.000000 (Complex 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-goto_02-fc47ad0.json0000664000175000017500000000105515174404631023000 0ustar alastairalastair{ "basename": "ast-goto_02-fc47ad0", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/goto_02.f90", "infile_hash": "2bd2e5ad2c2506c3da506b82aa7d12c7877206410c2d7637f556d10b", "outfile": null, "outfile_hash": null, "stdout": "ast-goto_02-fc47ad0.stdout", "stdout_hash": "0f83a7c1c8ae99021a94f1cfaaccde9a8bdf15ac5a5be3db3227342d", "stderr": "ast-goto_02-fc47ad0.stderr", "stderr_hash": "317795e3eb8121d18463c9531b060be0c248a0b34d70a2961d6d2047", "returncode": 0 }lfortran-0.63.0/tests/reference/ast-if2-65737e5.json0000664000175000017500000000067615174404631022014 0ustar alastairalastair{ "basename": "ast-if2-65737e5", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/if2.f90", "infile_hash": "7e5997e7b3a28044e5c2899900ea795edfd628c1ed4530afdf1aea0d", "outfile": null, "outfile_hash": null, "stdout": "ast-if2-65737e5.stdout", "stdout_hash": "5f295305024fda59a316f3bd169220cb153cf59821bb21982878f459", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-doloop_01-d646475.stdout0000664000175000017500000000334015174404631024003 0ustar alastairalastairfunction main() local i::Int32 local j::Int32 j = 0 for i ∈ 1:10 j = j + i end if j ≠ 55 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 10:-1:1 j = j + i end if j ≠ 55 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 1:2:9 j = j + i end if j ≠ 25 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 9:-2:1 j = j + i end if j ≠ 25 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 1:2:10 j = j + i end if j ≠ 25 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 1:3:10 j = j + i end if j ≠ 22 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 10:-3:1 j = j + i end if j ≠ 22 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 1:1 j = j + i end if j ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 1:-1:1 j = j + i end if j ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 1:0 j = j + i end if j ≠ 0 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 0:-1:1 j = j + i end if j ≠ 0 println(Base.stderr, "ERROR STOP") exit(1) end println(j) end main() lfortran-0.63.0/tests/reference/ast-fixedform_subroutine-2711676.stdout0000664000175000017500000000361315174404631026051 0ustar alastairalastair(TranslationUnit [(Subroutine f [(a) (b) (c)] [] () () [] [] [] [] [(Print 0 () [4] () )] [] [] ) (Program implicit_program_lfortran () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(k [] [] () () None ()) (l [] [] () () None ())] () )] [(Assignment 0 k 100 () ) (DoLoop 0 () 80 k 1 10 () [(Print 0 () [k] () ) (Continue 80 () )] () () ) (If 0 () (<= k 10000) [(Print 0 () [k] () )] [(Print 0 () [(+ k 1)] () ) (DoLoop 0 () 0 l 1 10 () [(Print 0 () [(String "do" ())] () )] () () )] () () () )] [] )] ) lfortran-0.63.0/tests/reference/asr-template_add_04-1710dbc.json0000664000175000017500000000076715174404631024375 0ustar alastairalastair{ "basename": "asr-template_add_04-1710dbc", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_add_04.f90", "infile_hash": "3a87e933776c164b3f127859bb8ca5b6daabc9c6df7232173c427158", "outfile": null, "outfile_hash": null, "stdout": "asr-template_add_04-1710dbc.stdout", "stdout_hash": "629e9629383c3e9c05f63b048a01ea7164a3f160b80a2e570694198a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_10-526e3f4.stdout0000664000175000017500000012122415174404631025113 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { my_module: (Module (SymbolTable 2 { finalize: (Function (SymbolTable 5 { self: (Variable 5 self [] InOut () () Default (StructType [(Integer 4) (StructType [(Integer 4)] [] .true. .false. )] [] .true. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) finalize (FunctionType [(StructType [(Integer 4) (StructType [(Integer 4)] [] .true. .false. )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 self)] [] () Public .true. .true. () ), my_super_type: (Struct (SymbolTable 3 { x: (Variable 3 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) my_super_type (StructType [(Integer 4)] [] .true. .false. ) [] [x] [] Source Public .false. .false. [] () () [] ), my_type: (Struct (SymbolTable 4 { g_proc: (GenericProcedure 4 g_proc [4 plus 4 unary] Public ), plus: (StructMethodDeclaration 4 plus () plus 2 plus Source .false. .false. ), proc: (StructMethodDeclaration 4 proc () print_something 2 print_something Source .false. .false. ), super: (Variable 4 super [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 my_super_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), unary: (StructMethodDeclaration 4 unary () unary 2 unary Source .false. .false. ), x: (Variable 4 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~add: (CustomOperator 4 ~add [4 unary 4 plus] Public ) }) my_type (StructType [(Integer 4) (StructType [(Integer 4)] [] .true. .false. )] [] .true. .false. ) [my_super_type] [x super] [finalize] Source Public .false. .false. [] () () [] ), plus: (Function (SymbolTable 9 { plus: (Variable 9 plus [] ReturnVar () () Default (StructType [(Integer 4) (StructType [(Integer 4)] [] .true. .false. )] [] .true. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 9 self [] In () () Default (StructType [(Integer 4) (StructType [(Integer 4)] [] .true. .false. )] [] .false. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus (FunctionType [(StructType [(Integer 4) (StructType [(Integer 4)] [] .true. .false. )] [] .false. .false. )] (StructType [(Integer 4) (StructType [(Integer 4)] [] .true. .false. )] [] .true. .false. ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 9 self)] [] (Var 9 plus) Public .true. .true. () ), print_something: (Function (SymbolTable 6 { self: (Variable 6 self [] InOut () () Default (StructType [(Integer 4) (StructType [(Integer 4)] [] .true. .false. )] [] .false. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), str: (Variable 6 str [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) print_something (FunctionType [(StructType [(Integer 4) (StructType [(Integer 4)] [] .true. .false. )] [] .false. .false. ) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 self) (Var 6 str)] [(Print (Var 6 str) )] () Public .false. .false. () ), say_something: (Function (SymbolTable 7 { msg: (Variable 7 msg [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 7 self [] InOut () () Default (StructType [(Integer 4) (StructType [(Integer 4)] [] .true. .false. )] [] .false. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) say_something (FunctionType [(StructType [(Integer 4) (StructType [(Integer 4)] [] .true. .false. )] [] .false. .false. ) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 self) (Var 7 msg)] [(Print (Var 7 msg) )] () Public .false. .false. () ), unary: (Function (SymbolTable 8 { self: (Variable 8 self [] In () () Default (StructType [(Integer 4) (StructType [(Integer 4)] [] .true. .false. )] [] .false. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), unary: (Variable 8 unary [] ReturnVar () () Default (StructType [(Integer 4) (StructType [(Integer 4)] [] .true. .false. )] [] .true. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 8 x [] In () () Default (StructType [(Integer 4) (StructType [(Integer 4)] [] .true. .false. )] [] .false. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) unary (FunctionType [(StructType [(Integer 4) (StructType [(Integer 4)] [] .true. .false. )] [] .false. .false. ) (StructType [(Integer 4) (StructType [(Integer 4)] [] .true. .false. )] [] .false. .false. )] (StructType [(Integer 4) (StructType [(Integer 4)] [] .true. .false. )] [] .true. .false. ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 8 self) (Var 8 x)] [] (Var 8 unary) Public .true. .true. () ) }) my_module () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-arrays_01_complex-2513a51.json0000664000175000017500000000077515174404631024636 0ustar alastairalastair{ "basename": "asr-arrays_01_complex-2513a51", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01_complex.f90", "infile_hash": "2f81875039547fcf7eaa3375e4f99fbc8ef6d91ac2bb214c88cff999", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_01_complex-2513a51.stdout", "stdout_hash": "602dbc0f68cf09737578ed1a5021eadfcf08a971f09a2eca3adba81a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-empty-cb5d1b4.stdout0000664000175000017500000000011715174404631023413 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." lfortran-0.63.0/tests/reference/asr-derived_types_15-7fde02a.stdout0000664000175000017500000006427315174404631025264 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_15_module_1: (Module (SymbolTable 2 { multiply: (Function (SymbolTable 4 { 1_t_1_i: (ExternalSymbol 4 1_t_1_i 3 i t_1 [] i Public ), j: (Variable 4 j [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 4 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 4 self [] In () () Default (StructType [(Real 4)] [] .false. .false. ) 2 t_1 Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) multiply (FunctionType [(StructType [(Real 4)] [] .false. .false. ) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 self) (Var 4 j)] [(Assignment (Var 4 res) (RealBinOp (StructInstanceMember (Var 4 self) 4 1_t_1_i (Real 4) () ) Mul (Var 4 j) (Real 4) () ) () .false. .false. )] (Var 4 res) Private .true. .true. () ), sqrt_subtract: (Function (SymbolTable 5 { 1_t_1_i: (ExternalSymbol 5 1_t_1_i 3 i t_1 [] i Public ), j: (Variable 5 j [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 5 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 5 self [] In () () Default (StructType [(Real 4)] [] .false. .false. ) 2 t_1 Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sqrt_subtract (FunctionType [(StructType [(Real 4)] [] .false. .false. ) (Integer 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 self) (Var 5 j)] [(Assignment (Var 5 res) (RealBinOp (StructInstanceMember (Var 5 self) 5 1_t_1_i (Real 4) () ) Sub (RealBinOp (Cast (Var 5 j) IntegerToReal (Real 4) () () ) Pow (RealConstant 0.500000 (Real 4) ) (Real 4) () ) (Real 4) () ) () .false. .false. )] (Var 5 res) Private .true. .true. () ), t_1: (Struct (SymbolTable 3 { compute: (GenericProcedure 3 compute [3 multiply 3 sqrt_subtract] Public ), i: (Variable 3 i [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), multiply: (StructMethodDeclaration 3 multiply () multiply 2 multiply Source .false. .false. ), sqrt_subtract: (StructMethodDeclaration 3 sqrt_subtract () sqrt_subtract 2 sqrt_subtract Source .false. .false. ) }) t_1 (StructType [(Real 4)] [] .true. .false. ) [] [i] [] Source Private .false. .false. [] () () [] ) }) derived_types_15_module_1 () [] .false. .false. .false. ), name: (Program (SymbolTable 6 { 1_t_1_i: (ExternalSymbol 6 1_t_1_i 3 i t_1 [] i Public ), 1_t_1_multiply: (ExternalSymbol 6 1_t_1_multiply 3 multiply t_1 [] multiply Public ), 1_t_1_sqrt_subtract: (ExternalSymbol 6 1_t_1_sqrt_subtract 3 sqrt_subtract t_1 [] sqrt_subtract Public ), t_1: (ExternalSymbol 6 t_1 2 t_1 derived_types_15_module_1 [] t_1 Public ), type_1: (Variable 6 type_1 [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 6 t_1 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) name [derived_types_15_module_1] [(Assignment (StructInstanceMember (Var 6 type_1) 6 1_t_1_i (Real 4) () ) (RealConstant 100.000000 (Real 4) ) () .false. .false. ) (If () (RealCompare (FunctionCall 6 1_t_1_multiply () [((Var 6 type_1)) ((RealConstant 5.000000 (Real 4) ))] (Real 4) () (Var 6 type_1) ) NotEq (Cast (IntegerConstant 500 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 500.000000 (Real 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (FunctionCall 6 1_t_1_sqrt_subtract () [((Var 6 type_1)) ((IntegerConstant 2500 (Integer 4) Decimal))] (Real 4) () (Var 6 type_1) ) NotEq (Cast (IntegerConstant 50 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 50.000000 (Real 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/julia-doloop_08-f0d8fe6.stdout0000664000175000017500000000034615174404631024234 0ustar alastairalastairfunction main() local i::Int32 i = 1 while true i = i + 1 if i == 10 break end end if i ≠ 10 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-0.63.0/tests/reference/c-case_03-b50b4bf.stdout0000664000175000017500000000152115174404631022742 0ustar alastairalastair#include #include #include #include #include #include // Implementations int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); const int32_t a = 1; const int32_t b = 2; int32_t marks; marks = 94; if (marks >= 40 + b) { printf("%s\n","Pass!"); } else if (marks <= 39 - a) { printf("%s\n","Failed!"); } else { printf("%s\n","Invalid marks"); } printf("%s%s%d\n", "Your marks are ", " ", marks); marks = -1; if (marks >= 40 + b) { printf("%s\n","Pass!"); } else if (0 <= marks <= 39 - a) { printf("%s\n","Failed!"); } else { printf("%s\n","Invalid marks"); } printf("%s%s%d\n", "Your marks are ", " ", marks); return 0; } lfortran-0.63.0/tests/reference/ast-template_02-80b38d0.json0000664000175000017500000000075315174404631023507 0ustar alastairalastair{ "basename": "ast-template_02-80b38d0", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_02.f90", "infile_hash": "ced72b8e182313557b3b879bd14e860cc0d24eb74800baecbe858a70", "outfile": null, "outfile_hash": null, "stdout": "ast-template_02-80b38d0.stdout", "stdout_hash": "1af55dfe19c01438f38067b07640b9b320170a88e0a2242d0a1fbbc3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-bin_op_complex_dp-8ead434.json0000664000175000017500000000100015174404631025304 0ustar alastairalastair{ "basename": "llvm-bin_op_complex_dp-8ead434", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/bin_op_complex_dp.f90", "infile_hash": "9be1b396941b73e1466a46963ee3ade085440ce077b444ce7e2f6baf", "outfile": null, "outfile_hash": null, "stdout": "llvm-bin_op_complex_dp-8ead434.stdout", "stdout_hash": "9463fa88fb15879cfe8f677d825e6bd47eea351555b3b01a7e112904", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-incorrect_array_type_where_01-b613ee3.stderr0000664000175000017500000000031315174404631027714 0ustar alastairalastairsemantic error: the first array argument to `where` must be of type logical --> tests/errors/incorrect_array_type_where_01.f90:5:10 | 5 | where([1, 2, 3, 4, 5]) b = 1 | ^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-intrinsics_33-816caef.json0000664000175000017500000000076115174404631024227 0ustar alastairalastair{ "basename": "asr-intrinsics_33-816caef", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_33.f90", "infile_hash": "e4ea9f413d213dd8fd6f6e412957737676b193db450eac1eda9f422f", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_33-816caef.stdout", "stdout_hash": "4bcdc728e4632573254f06d232275d1370b44ccdb92a3c6f11275b4e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-subroutines_01-6bd865a.json0000664000175000017500000000075515174404631024663 0ustar alastairalastair{ "basename": "julia-subroutines_01-6bd865a", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/subroutines_01.f90", "infile_hash": "b2e2d562bcd951782b14a4d5cfe68f5ff7db528636d556aa7ea9230e", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutines_01-6bd865a.stdout", "stdout_hash": "1a10bfdbcc05571c7b053af46aa127b516726d5ebc056e1bddb222fc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-arrays_03_func-3a62608.stdout0000664000175000017500000000303115174404631024466 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct i32_10_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; i32_10_1(Kokkos::View* data_): data{data_} {}; }; // Forward declarations namespace { template int32_t mysum(T0* a); } // Implementations namespace { template int32_t mysum(T0* a) { int32_t i; int32_t r; r = 0; for (i=1; i<=a->data->extent(0); i++) { r = r + a->data->operator[](i - a->dims[0].lower_bound); } return r; } void main2() { int32_t i; int32_t s; Kokkos::View x_data("x_data", 10); i32_10_1 x_value(&x_data); i32_10_1* x = &x_value; x->dims[0].lower_bound = 1; x->dims[0].length = 10; for (i=1; i<=x->data->extent(0); i++) { x->data->operator[](i - x->dims[0].lower_bound) = i; } s = mysum(x); std::cout << s << std::endl; if (s != 55) { std::cerr << "ERROR STOP" << std::endl; exit(1); } } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/asr-string_04-2ebc0e6.json0000664000175000017500000000074515174404631023341 0ustar alastairalastair{ "basename": "asr-string_04-2ebc0e6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_04.f90", "infile_hash": "5dec930fb518a93b9004858a969c334193bb0a84dcadc023b57d5c10", "outfile": null, "outfile_hash": null, "stdout": "asr-string_04-2ebc0e6.stdout", "stdout_hash": "71aad62570488188625695749373593cc422b8d57b1964582fe14016", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/tokens-expr7-bf90751.json0000664000175000017500000000071515174404631023157 0ustar alastairalastair{ "basename": "tokens-expr7-bf90751", "cmd": "lfortran --no-color --show-tokens {infile} -o {outfile}", "infile": "tests/expr7.f90", "infile_hash": "9b01fedf331316b08b35441cb9f4cb6f7808edd93b29c70e1caeea03", "outfile": null, "outfile_hash": null, "stdout": "tokens-expr7-bf90751.stdout", "stdout_hash": "5e07b110d4feed247c9fb163c38f17f1ed469bcc3eb61a8302ac4826", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-case_04-42ea8ac.stdout0000664000175000017500000000027715174404631024000 0ustar alastairalastairprogram case_04 implicit none integer :: i i = 4 select case (i) case (1) print *, "1" case (2, 3:5, 6, 8:10) print *, "2,3:5,6,8:10" end select end program case_04 lfortran-0.63.0/tests/reference/ast-format_03-c54e532.stdout0000664000175000017500000000060115174404631023530 0ustar alastairalastair(TranslationUnit [(Program format_03 () [] [] [] [(Format 1000 "/' --- PROBLEM SIZE:'/' N = ',i5,' (NUMBER WITH NONZERO WEIGHT = ',i5,')'/' NQ = ',i5/' M = ',i5/' NP = ',i5,' (NUMBER UNFIXED = ',i5,')'" () )] [] )] ) lfortran-0.63.0/tests/reference/ast-expr2-52dd466.json0000664000175000017500000000070415174404631022435 0ustar alastairalastair{ "basename": "ast-expr2-52dd466", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/expr2.f90", "infile_hash": "d666975e3f2e2c0cc5c739b85bb21073accdf5692bcb64c9e0278d62", "outfile": null, "outfile_hash": null, "stdout": "ast-expr2-52dd466.stdout", "stdout_hash": "7fec7d309068cf92ea67d34387514bd37ec3365d54bb020dd1682f4f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-private2-d3a4771.json0000664000175000017500000000072415174404631023125 0ustar alastairalastair{ "basename": "asr-private2-d3a4771", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/private2.f90", "infile_hash": "34984962bf015cefb96abba7000799bbabd4618eb80e4484fb5ca4bd", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-private2-d3a4771.stderr", "stderr_hash": "98341ad40f302acd14f7188319321a9b5a620c529f9ce700ff28c1a3", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-functions_41-1e43fd0.json0000664000175000017500000000075615174404631023770 0ustar alastairalastair{ "basename": "ast-functions_41-1e43fd0", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_41.f90", "infile_hash": "85251751a2389037443a86b523b90e5db508759f889cdf5413aab330", "outfile": null, "outfile_hash": null, "stdout": "ast-functions_41-1e43fd0.stdout", "stdout_hash": "f35d6094905818061debe81c3afcc9d2fe65e2c68b6e559c180c31ce", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-subroutines_02-83f1d9f.stdout0000664000175000017500000002765415174404631025117 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [6 x i8] c"I4,I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [6 x i8] c"I4,I4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [6 x i8] c"I4,I4\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @17 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc13 = alloca %string_descriptor, align 8 %stringFormat_desc4 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %j = alloca i32, align 4 store i32 1, i32* %i, align 4 store i32 1, i32* %j, align 4 call void @f(i32* %i, i32* %j) %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %i, i32* %j) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry %14 = load i32, i32* %i, align 4 %15 = icmp ne i32 %14, 1 br i1 %15, label %then, label %else then: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %free_done br label %ifcont ifcont: ; preds = %else, %then %16 = load i32, i32* %j, align 4 %17 = icmp ne i32 %16, 2 br i1 %17, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 call void @g(i32* %i, i32* %j) %18 = alloca i64, align 8 %19 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info.1, i32 0, i32 0), i64* %18, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %i, i32* %j) %20 = load i64, i64* %18, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %19, i8** %21, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %20, i64* %22, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %24 = load i8*, i8** %23, align 8 %25 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %26 = load i64, i64* %25, align 8 %27 = trunc i64 %26 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %24, i32 %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %28 = icmp eq i8* %19, null br i1 %28, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %ifcont3 call void @_lfortran_free_alloc(i8* %2, i8* %19) br label %free_done6 free_done6: ; preds = %free_nonnull5, %ifcont3 %29 = load i32, i32* %i, align 4 %30 = icmp ne i32 %29, 1 br i1 %30, label %then7, label %else8 then7: ; preds = %free_done6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont9 else8: ; preds = %free_done6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 %31 = load i32, i32* %j, align 4 %32 = icmp ne i32 %31, 0 br i1 %32, label %then10, label %else11 then10: ; preds = %ifcont9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont12 else11: ; preds = %ifcont9 br label %ifcont12 ifcont12: ; preds = %else11, %then10 call void @h(i32* %i, i32* %j) %33 = alloca i64, align 8 %34 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info.2, i32 0, i32 0), i64* %33, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %i, i32* %j) %35 = load i64, i64* %33, align 8 %36 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 store i8* %34, i8** %36, align 8 %37 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 store i64 %35, i64* %37, align 8 %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 %39 = load i8*, i8** %38, align 8 %40 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 %41 = load i64, i64* %40, align 8 %42 = trunc i64 %41 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %39, i32 %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) %43 = icmp eq i8* %34, null br i1 %43, label %free_done15, label %free_nonnull14 free_nonnull14: ; preds = %ifcont12 call void @_lfortran_free_alloc(i8* %2, i8* %34) br label %free_done15 free_done15: ; preds = %free_nonnull14, %ifcont12 %44 = load i32, i32* %i, align 4 %45 = icmp ne i32 %44, 1 br i1 %45, label %then16, label %else17 then16: ; preds = %free_done15 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont18 else17: ; preds = %free_done15 br label %ifcont18 ifcont18: ; preds = %else17, %then16 %46 = load i32, i32* %j, align 4 %47 = icmp ne i32 %46, 0 br i1 %47, label %then19, label %else20 then19: ; preds = %ifcont18 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont21 else20: ; preds = %ifcont18 br label %ifcont21 ifcont21: ; preds = %else20, %then19 br label %return return: ; preds = %ifcont21 br label %FINALIZE_SYMTABLE_subroutines_02 FINALIZE_SYMTABLE_subroutines_02: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } define void @f(i32* %a, i32* %b) { .entry: %0 = load i32, i32* %a, align 4 %1 = add i32 %0, 1 store i32 %1, i32* %b, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return ret void } define void @g(i32* %a, i32* %b) { .entry: %0 = load i32, i32* %a, align 4 %1 = sub i32 %0, 1 store i32 %1, i32* %b, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_g FINALIZE_SYMTABLE_g: ; preds = %return ret void } define void @h(i32* %a, i32* %b) { .entry: call void @g(i32* %a, i32* %b) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_h FINALIZE_SYMTABLE_h: ; preds = %return ret void } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) lfortran-0.63.0/tests/reference/asr-array_bound_1-b0c2255.stdout0000664000175000017500000003745715174404631024474 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array_bound_1: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Array (Integer 4) [((IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) array_bound_1 [] [(Print (StringFormat () [(ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 2 (Integer 4) Decimal) ) (ArrayBound (Var 2 a) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 3 (Integer 4) Decimal) ) (ArrayBound (Var 2 a) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 5 (Integer 4) Decimal) ) (ArrayBound (Var 2 a) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 9 (Integer 4) Decimal) ) (ArrayBound (Var 2 a) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 7 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 2 (Integer 4) Decimal) ) (ArrayBound (Var 2 b) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 3 (Integer 4) Decimal) ) (ArrayBound (Var 2 b) (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 4 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 2 (Integer 4) Decimal) ) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 4 (Integer 4) Decimal) ) (ArrayBound (Var 2 b) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 6 (Integer 4) Decimal) ) (ArrayBound (Var 2 b) (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 7 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 6 (Integer 4) Decimal) ) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 10 (Integer 4) Decimal) ) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 7 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayBound (Var 2 d) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayBound (Var 2 d) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 4 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-document_symbols1-8238851.stdout0000664000175000017500000000404415174404631025260 0ustar alastairalastair[{"kind":2,"location":{"range":{"start":{"character":1,"line":1},"end":{"character":14,"line":2}},"uri":"uri"},"name":"add","filename":"tests/document_symbols1.f90"},{"kind":0,"location":{"range":{"start":{"character":1,"line":4},"end":{"character":11,"line":12}},"uri":"uri"},"name":"document_symbols1","filename":"tests/document_symbols1.f90"},{"kind":5,"location":{"range":{"start":{"character":1,"line":5},"end":{"character":14,"line":7}},"uri":"uri"},"name":"sub","filename":"tests/document_symbols1_module.f90"},{"kind":5,"location":{"range":{"start":{"character":1,"line":8},"end":{"character":14,"line":10}},"uri":"uri"},"name":"sub2","filename":"tests/document_symbols1_module.f90"},{"kind":9,"location":{"range":{"start":{"character":12,"line":7},"end":{"character":12,"line":7}},"uri":"uri"},"name":"x","filename":"tests/document_symbols1.f90"},{"kind":5,"location":{"range":{"start":{"character":16,"line":3},"end":{"character":17,"line":3}},"uri":"uri"},"name":"xy","filename":"tests/document_symbols1_module.f90"},{"kind":5,"location":{"range":{"start":{"character":20,"line":3},"end":{"character":21,"line":3}},"uri":"uri"},"name":"yz","filename":"tests/document_symbols1_module.f90"},{"kind":1,"location":{"range":{"start":{"character":1,"line":1},"end":{"character":35,"line":11}},"uri":"uri"},"name":"module_document_symbols1","filename":"tests/document_symbols1_module.f90"},{"kind":2,"location":{"range":{"start":{"character":1,"line":5},"end":{"character":14,"line":7}},"uri":"uri"},"name":"sub","filename":"tests/document_symbols1_module.f90"},{"kind":2,"location":{"range":{"start":{"character":1,"line":8},"end":{"character":14,"line":10}},"uri":"uri"},"name":"sub2","filename":"tests/document_symbols1_module.f90"},{"kind":9,"location":{"range":{"start":{"character":16,"line":3},"end":{"character":17,"line":3}},"uri":"uri"},"name":"xy","filename":"tests/document_symbols1_module.f90"},{"kind":9,"location":{"range":{"start":{"character":20,"line":3},"end":{"character":21,"line":3}},"uri":"uri"},"name":"yz","filename":"tests/document_symbols1_module.f90"}]lfortran-0.63.0/tests/reference/llvm-array2-4254183.json0000664000175000017500000000071215174404631022613 0ustar alastairalastair{ "basename": "llvm-array2-4254183", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/array2.f90", "infile_hash": "ec67f153c5f506f6a12ef94b06d43c7e9e86b9fc33c9c196029183f0", "outfile": null, "outfile_hash": null, "stdout": "llvm-array2-4254183.stdout", "stdout_hash": "f6bfd3d9f72c380281aea1dd07d1faf276bef83283d8a862f3142bc3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-complex_01-075c0b7.stderr0000664000175000017500000000034115174404631023662 0ustar alastairalastairsemantic error: The first argument of `cmplx` intrinsic is of complex type, the second argument in this case must be absent --> tests/errors/complex_01.f90:4:14 | 4 | print *, cmplx(z, 1) | ^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-incompatible_dimension_assignment_arr2-3867783.stderr0000664000175000017500000000026415174404631031472 0ustar alastairalastairsemantic error: Different shape for array assignment on dimension 3(1 and 2) --> tests/errors/incompatible_dimension_assignment_arr2.f90:10:5 | 10 | y = x | ^^^^^ lfortran-0.63.0/tests/reference/asr-modules_33-b589c22.json0000664000175000017500000000075015174404631023351 0ustar alastairalastair{ "basename": "asr-modules_33-b589c22", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_33.f90", "infile_hash": "223a997e090d900f7598fe1697a4edf3ea8e14342db03379fb7e7112", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_33-b589c22.stdout", "stdout_hash": "575a97e81fed3bf58b19b296a768c04741e4b35289cb267b7c27b60d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit9-5318b32.json0000664000175000017500000000072015174404631023205 0ustar alastairalastair{ "basename": "asr-implicit9-5318b32", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/implicit9.f90", "infile_hash": "8821b0b62f5857553eb0efe35ab8190a8b1c4fe82e623f1dae4e81b3", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit9-5318b32.stderr", "stderr_hash": "2537e65ee73bce5d64169c321e19ee4f107be96cc008abc67335b07e", "returncode": 2 }lfortran-0.63.0/tests/reference/rename_symbol-collect_occurence2-a095a33.stdout0000664000175000017500000000135315174404631027540 0ustar alastairalastair[{"kind":2,"location":{"range":{"start":{"character":10,"line":7},"end":{"character":15,"line":7}},"uri":"uri"},"name":"xyz"},{"kind":2,"location":{"range":{"start":{"character":15,"line":1},"end":{"character":18,"line":1}},"uri":"uri"},"name":"xyz"},{"kind":2,"location":{"range":{"start":{"character":14,"line":4},"end":{"character":17,"line":4}},"uri":"uri"},"name":"xyz"},{"kind":9,"location":{"range":{"start":{"character":1,"line":1},"end":{"character":17,"line":4}},"uri":"uri"},"name":"xyz"},{"kind":9,"location":{"range":{"start":{"character":1,"line":3},"end":{"character":4,"line":3}},"uri":"uri"},"name":"xyz"},{"kind":9,"location":{"range":{"start":{"character":1,"line":1},"end":{"character":17,"line":4}},"uri":"uri"},"name":"xyz"}]lfortran-0.63.0/tests/reference/ast-subroutines_04-cc5f6a4.json0000664000175000017500000000076415174404631024425 0ustar alastairalastair{ "basename": "ast-subroutines_04-cc5f6a4", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_04.f90", "infile_hash": "c7f14f3cfe8c42ebbf006f4e20a30b517c9e2775e5af0f8853ae05e1", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutines_04-cc5f6a4.stdout", "stdout_hash": "8167f4e8be92666208a33f67fc50e8bf10a53e0da6c50a8a004d2540", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_03-6afb845.json0000664000175000017500000000075315174404631023575 0ustar alastairalastair{ "basename": "asr-template_03-6afb845", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_03.f90", "infile_hash": "58b6ec4d6cf448b1aabceb4447e834d0d2e8f5a98058e37b48e86976", "outfile": null, "outfile_hash": null, "stdout": "asr-template_03-6afb845.stdout", "stdout_hash": "b2cea92c1037499af52077f3e4f3681549f76d50fdf8fbc1725e4db3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-nullify_02-1c6befe.json0000664000175000017500000000075015174404631023576 0ustar alastairalastair{ "basename": "ast-nullify_02-1c6befe", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nullify_02.f90", "infile_hash": "8603bbfc07290d14f0828e12a8b04c3521c007c844a4c901b4bb7483", "outfile": null, "outfile_hash": null, "stdout": "ast-nullify_02-1c6befe.stdout", "stdout_hash": "c34ed265adbd8eec2c077ab39fec677bcdf6a74575ee04339cd7ad87", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_openmp-openmp1-3056a3e.stdout0000664000175000017500000002343015174404631024672 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { increment_ctr: (Function (SymbolTable 2 { ctr: (Variable 2 ctr [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), local_ctr: (Variable 2 local_ctr [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) increment_ctr (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 n) (Var 2 ctr)] [(OMPRegion Parallel [(OMPPrivate [(Var 2 i)] ) (OMPReduction ReduceAdd [(Var 2 local_ctr)] )] [(OMPRegion Do [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 n) ()) [(Assignment (Var 2 local_ctr) (IntegerBinOp (Var 2 local_ctr) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] )] )] ) (Assignment (Var 2 ctr) (IntegerBinOp (Var 2 ctr) Add (Var 2 local_ctr) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ), openmp1: (Program (SymbolTable 3 { ctr: (Variable 3 ctr [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 3 n [] Local (IntegerConstant 1000000 (Integer 4) Decimal) (IntegerConstant 1000000 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) openmp1 [] [(Assignment (Var 3 ctr) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 1 increment_ctr () [((Var 3 n)) ((Var 3 ctr))] () .false. ) (Print (StringFormat () [(Var 3 ctr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-array_size_01-cdffaed.json0000664000175000017500000000074315174404631024424 0ustar alastairalastair{ "basename": "asr-array_size_01-cdffaed", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_size_01.f90", "infile_hash": "30589552e7b01a1e8ea7af0d40250a71b6da5ada13521c8a222d7e14", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_size_01-cdffaed.stderr", "stderr_hash": "87b541207ac6c6cd8813ae288cb7710355a4248161837047820cd9fd", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-array4-3d07222.json0000664000175000017500000000070715174404631022507 0ustar alastairalastair{ "basename": "ast-array4-3d07222", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/array4.f90", "infile_hash": "b2300c4e8589cce700b9cd43cbfb88576774e3262afa4c469c09b7d0", "outfile": null, "outfile_hash": null, "stdout": "ast-array4-3d07222.stdout", "stdout_hash": "b434ad8e2b33453b08d82ba52bc74d109ae1a42aa1a7b8ee06550ca0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-program_04-4e711d5.stdout0000664000175000017500000000011515174404631024366 0ustar alastairalastairprogram __xx_main implicit none print *, "hello world" end program __xx_main lfortran-0.63.0/tests/reference/asr-template_commutative-45a3ac0.stdout0000664000175000017500000041325015174404631026242 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_commutative_m: (Module (SymbolTable 2 { alt_commutative_prop: (Template (SymbolTable 10 { bin: (Function (SymbolTable 11 { bin: (Variable 11 bin [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 11 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 11 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) bin (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 11 x) (Var 11 y)] [] (Var 11 bin) Public .true. .true. () ), commutative_p: (Function (SymbolTable 13 { prop: (Variable 13 prop [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 13 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 13 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) commutative_p (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [bin equal] [(Var 13 x) (Var 13 y)] [(Assignment (Var 13 prop) (OverloadedCompare (FunctionCall 10 bin () [((Var 13 x)) ((Var 13 y))] (Integer 4) () () ) Eq (FunctionCall 10 bin () [((Var 13 y)) ((Var 13 x))] (Integer 4) () () ) (Logical 4) () (FunctionCall 10 equal 10 ~eq [((FunctionCall 10 bin () [((Var 13 x)) ((Var 13 y))] (Integer 4) () () )) ((FunctionCall 10 bin () [((Var 13 y)) ((Var 13 x))] (Integer 4) () () ))] (Logical 4) () () ) ) () .false. .false. )] (Var 13 prop) Public .true. .true. () ), equal: (Function (SymbolTable 12 { equal: (Variable 12 equal [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 12 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 12 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) equal (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 12 x) (Var 12 y)] [] (Var 12 equal) Public .true. .true. () ), integer: (Variable 10 integer [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~eq: (CustomOperator 10 ~eq [10 equal] Public ) }) alt_commutative_prop [bin equal] [(Require magma_r [integer bin equal] )] ), commutative_prop: (Template (SymbolTable 6 { bin: (Function (SymbolTable 7 { bin: (Variable 7 bin [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 7 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 7 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) bin (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 7 x) (Var 7 y)] [] (Var 7 bin) Public .true. .true. () ), commutative_p: (Function (SymbolTable 9 { prop: (Variable 9 prop [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 9 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 9 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) commutative_p (FunctionType [(TypeParameter t ) (TypeParameter t )] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [bin equal] [(Var 9 x) (Var 9 y)] [(Assignment (Var 9 prop) (OverloadedCompare (FunctionCall 6 bin () [((Var 9 x)) ((Var 9 y))] (TypeParameter t ) () () ) Eq (FunctionCall 6 bin () [((Var 9 y)) ((Var 9 x))] (TypeParameter t ) () () ) (Logical 4) () (FunctionCall 6 equal 6 ~eq [((FunctionCall 6 bin () [((Var 9 x)) ((Var 9 y))] (TypeParameter t ) () () )) ((FunctionCall 6 bin () [((Var 9 y)) ((Var 9 x))] (TypeParameter t ) () () ))] (Logical 4) () () ) ) () .false. .false. )] (Var 9 prop) Public .true. .true. () ), equal: (Function (SymbolTable 8 { equal: (Variable 8 equal [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 8 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 8 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) equal (FunctionType [(TypeParameter t ) (TypeParameter t )] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 8 x) (Var 8 y)] [] (Var 8 equal) Public .true. .true. () ), t: (Variable 6 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~eq: (CustomOperator 6 ~eq [6 equal] Public ) }) commutative_prop [t bin equal] [(Require magma_r [t bin equal] )] ), magma_r: (Requirement (SymbolTable 3 { bin: (Function (SymbolTable 4 { bin: (Variable 4 bin [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) bin (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 bin) Public .true. .true. () ), equal: (Function (SymbolTable 5 { equal: (Variable 5 equal [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 5 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 5 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) equal (FunctionType [(TypeParameter t ) (TypeParameter t )] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 5 x) (Var 5 y)] [] (Var 5 equal) Public .true. .true. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) magma_r [t bin equal] [] ) }) template_commutative_m () [template_commutative_m] .false. .false. .false. ), test_template_commutative_p: (Program (SymbolTable 14 { alt_commutative_prop: (ExternalSymbol 14 alt_commutative_prop 2 alt_commutative_prop template_commutative_m [] alt_commutative_prop Public ), commutative_prop: (ExternalSymbol 14 commutative_prop 2 commutative_prop template_commutative_m [] commutative_prop Public ), int_minus_comm: (Function (SymbolTable 21 { prop: (Variable 21 prop [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 21 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 21 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) int_minus_comm (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [~sub_intrinsic ~eq_intrinsic] [(Var 21 x) (Var 21 y)] [(Assignment (Var 21 prop) (OverloadedCompare (FunctionCall 14 ~sub_intrinsic () [((Var 21 x)) ((Var 21 y))] (Integer 4) () () ) Eq (FunctionCall 14 ~sub_intrinsic () [((Var 21 y)) ((Var 21 x))] (Integer 4) () () ) (Logical 4) () (FunctionCall 14 ~eq_intrinsic 6 ~eq [((FunctionCall 14 ~sub_intrinsic () [((Var 21 x)) ((Var 21 y))] (Integer 4) () () )) ((FunctionCall 14 ~sub_intrinsic () [((Var 21 y)) ((Var 21 x))] (Integer 4) () () ))] (Logical 4) () () ) ) () .false. .false. )] (Var 21 prop) Public .true. .true. () ), int_plus_comm: (Function (SymbolTable 18 { prop: (Variable 18 prop [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 18 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 18 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) int_plus_comm (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [~add_intrinsic ~eq_intrinsic] [(Var 18 x) (Var 18 y)] [(Assignment (Var 18 prop) (OverloadedCompare (FunctionCall 14 ~add_intrinsic () [((Var 18 x)) ((Var 18 y))] (Integer 4) () () ) Eq (FunctionCall 14 ~add_intrinsic () [((Var 18 y)) ((Var 18 x))] (Integer 4) () () ) (Logical 4) () (FunctionCall 14 ~eq_intrinsic 6 ~eq [((FunctionCall 14 ~add_intrinsic () [((Var 18 x)) ((Var 18 y))] (Integer 4) () () )) ((FunctionCall 14 ~add_intrinsic () [((Var 18 y)) ((Var 18 x))] (Integer 4) () () ))] (Logical 4) () () ) ) () .false. .false. )] (Var 18 prop) Public .true. .true. () ), magma_r: (ExternalSymbol 14 magma_r 2 magma_r template_commutative_m [] magma_r Public ), minus_comm: (Function (SymbolTable 20 { prop: (Variable 20 prop [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 20 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 20 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) minus_comm (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [~sub_intrinsic ~eq_intrinsic] [(Var 20 x) (Var 20 y)] [(Assignment (Var 20 prop) (OverloadedCompare (FunctionCall 14 ~sub_intrinsic () [((Var 20 x)) ((Var 20 y))] (Integer 4) () () ) Eq (FunctionCall 14 ~sub_intrinsic () [((Var 20 y)) ((Var 20 x))] (Integer 4) () () ) (Logical 4) () (FunctionCall 14 ~eq_intrinsic 10 ~eq [((FunctionCall 14 ~sub_intrinsic () [((Var 20 x)) ((Var 20 y))] (Integer 4) () () )) ((FunctionCall 14 ~sub_intrinsic () [((Var 20 y)) ((Var 20 x))] (Integer 4) () () ))] (Logical 4) () () ) ) () .false. .false. )] (Var 20 prop) Public .true. .true. () ), plus_comm: (Function (SymbolTable 17 { prop: (Variable 17 prop [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 17 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 17 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus_comm (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [~add_intrinsic ~eq_intrinsic] [(Var 17 x) (Var 17 y)] [(Assignment (Var 17 prop) (OverloadedCompare (FunctionCall 14 ~add_intrinsic () [((Var 17 x)) ((Var 17 y))] (Integer 4) () () ) Eq (FunctionCall 14 ~add_intrinsic () [((Var 17 y)) ((Var 17 x))] (Integer 4) () () ) (Logical 4) () (FunctionCall 14 ~eq_intrinsic 10 ~eq [((FunctionCall 14 ~add_intrinsic () [((Var 17 x)) ((Var 17 y))] (Integer 4) () () )) ((FunctionCall 14 ~add_intrinsic () [((Var 17 y)) ((Var 17 x))] (Integer 4) () () ))] (Logical 4) () () ) ) () .false. .false. )] (Var 17 prop) Public .true. .true. () ), ~add: (CustomOperator 14 ~add [14 ~add_intrinsic] Public ), ~add_intrinsic: (Function (SymbolTable 15 { arg0: (Variable 15 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 15 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 15 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 15 arg0) (Var 15 arg1)] [(Assignment (Var 15 ret) (IntegerBinOp (Var 15 arg0) Add (Var 15 arg1) (Integer 4) () ) () .false. .false. )] (Var 15 ret) Public .true. .true. () ), ~eq: (CustomOperator 14 ~eq [14 ~eq_intrinsic] Public ), ~eq_intrinsic: (Function (SymbolTable 16 { arg0: (Variable 16 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 16 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 16 ret [] ReturnVar () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~eq_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 16 arg0) (Var 16 arg1)] [(Assignment (Var 16 ret) (IntegerCompare (Var 16 arg0) Eq (Var 16 arg1) (Logical 4) () ) () .false. .false. )] (Var 16 ret) Public .true. .true. () ), ~sub: (CustomOperator 14 ~sub [14 ~sub_intrinsic] Public ), ~sub_intrinsic: (Function (SymbolTable 19 { arg0: (Variable 19 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 19 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 19 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~sub_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 19 arg0) (Var 19 arg1)] [(Assignment (Var 19 ret) (IntegerBinOp (Var 19 arg0) Sub (Var 19 arg1) (Integer 4) () ) () .false. .false. )] (Var 19 ret) Public .true. .true. () ) }) test_template_commutative_p [template_commutative_m] [(Print (StringConstant "test commutative" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(StringConstant "plus_comm: " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 14 plus_comm () [((IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 4 (Integer 4) Decimal))] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "int_plus_comm: " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 14 int_plus_comm () [((IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 4 (Integer 4) Decimal))] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "minus_comm: " (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 14 minus_comm () [((IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 4 (Integer 4) Decimal))] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "int_minus_comm: " (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 14 int_minus_comm () [((IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 4 (Integer 4) Decimal))] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-fixed_form_1-3be6d43.stderr0000664000175000017500000000021015174404631024335 0ustar alastairalastairtokenizer error: Expecting terminating symbol for program --> tests/errors/fixed_form_1.f:2:7 | 2 | xinteger :: y | ^ lfortran-0.63.0/tests/reference/asr-derived_types_01-960dafe.stdout0000664000175000017500000012574315174404631025265 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { 1_y: (ExternalSymbol 1 1_y 2 y derived_types_01_m_01 [] y Public ), derived_types_01: (Program (SymbolTable 8 { 1_x_i: (ExternalSymbol 8 1_x_i 3 i x [] i Public ), 1_x_r: (ExternalSymbol 8 1_x_r 3 r x [] r Public ), 1_y_d: (ExternalSymbol 8 1_y_d 4 d 1_y [] d Public ), 1_z_k: (ExternalSymbol 8 1_z_k 7 k z [] k Public ), 1_z_l: (ExternalSymbol 8 1_z_l 7 l z [] l Public ), b: (Variable 8 b [] Local () () Default (StructType [(Real 4) (Integer 4)] [] .true. .false. ) 8 x Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 8 c [] Local () () Default (StructType [(Complex 4) (StructType [(Complex 4) (StructType [(Real 4) (Integer 4)] [] .true. .false. )] [] .true. .false. )] [] .true. .false. ) 8 z Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), set: (ExternalSymbol 8 set 2 set derived_types_01_m_01 [] set Public ), x: (ExternalSymbol 8 x 2 x derived_types_01_m_01 [] x Public ), z: (ExternalSymbol 8 z 6 z derived_types_01_m_02 [] z Public ) }) derived_types_01 [derived_types_01_m_02 derived_types_01_m_01] [(Assignment (StructInstanceMember (Var 8 b) 8 1_x_i (Integer 4) () ) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 8 b) 8 1_x_r (Real 4) () ) (RealConstant 3.500000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(StructInstanceMember (Var 8 b) 8 1_x_i (Integer 4) () ) (StructInstanceMember (Var 8 b) 8 1_x_r (Real 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 8 set () [((Var 8 b))] () .false. ) (Print (StringFormat () [(StructInstanceMember (Var 8 b) 8 1_x_i (Integer 4) () ) (StructInstanceMember (Var 8 b) 8 1_x_r (Real 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (StructInstanceMember (StructInstanceMember (StructInstanceMember (Var 8 c) 8 1_z_l (StructType [(Complex 4) (StructType [(Real 4) (Integer 4)] [] .true. .false. )] [] .true. .false. ) () ) 8 1_y_d (StructType [(Real 4) (Integer 4)] [] .true. .false. ) () ) 8 1_x_r (Real 4) () ) (RealConstant 2.000000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (StructInstanceMember (StructInstanceMember (Var 8 c) 8 1_z_l (StructType [(Complex 4) (StructType [(Real 4) (Integer 4)] [] .true. .false. )] [] .true. .false. ) () ) 8 1_y_d (StructType [(Real 4) (Integer 4)] [] .true. .false. ) () ) 8 1_x_i (Integer 4) () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 8 c) 8 1_z_k (Complex 4) () ) (ComplexConstructor (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) (Complex 4) (ComplexConstant 2.000000 2.000000 (Complex 4) ) ) () .false. .false. ) (Print (StringFormat () [(StructInstanceMember (StructInstanceMember (StructInstanceMember (Var 8 c) 8 1_z_l (StructType [(Complex 4) (StructType [(Real 4) (Integer 4)] [] .true. .false. )] [] .true. .false. ) () ) 8 1_y_d (StructType [(Real 4) (Integer 4)] [] .true. .false. ) () ) 8 1_x_r (Real 4) () ) (StructInstanceMember (StructInstanceMember (StructInstanceMember (Var 8 c) 8 1_z_l (StructType [(Complex 4) (StructType [(Real 4) (Integer 4)] [] .true. .false. )] [] .true. .false. ) () ) 8 1_y_d (StructType [(Real 4) (Integer 4)] [] .true. .false. ) () ) 8 1_x_i (Integer 4) () ) (StructInstanceMember (Var 8 c) 8 1_z_k (Complex 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 8 set () [((StructInstanceMember (StructInstanceMember (Var 8 c) 8 1_z_l (StructType [(Complex 4) (StructType [(Real 4) (Integer 4)] [] .true. .false. )] [] .true. .false. ) () ) 8 1_y_d (StructType [(Real 4) (Integer 4)] [] .true. .false. ) () ))] () .false. ) (Print (StringFormat () [(StructInstanceMember (StructInstanceMember (StructInstanceMember (Var 8 c) 8 1_z_l (StructType [(Complex 4) (StructType [(Real 4) (Integer 4)] [] .true. .false. )] [] .true. .false. ) () ) 8 1_y_d (StructType [(Real 4) (Integer 4)] [] .true. .false. ) () ) 8 1_x_r (Real 4) () ) (StructInstanceMember (StructInstanceMember (StructInstanceMember (Var 8 c) 8 1_z_l (StructType [(Complex 4) (StructType [(Real 4) (Integer 4)] [] .true. .false. )] [] .true. .false. ) () ) 8 1_y_d (StructType [(Real 4) (Integer 4)] [] .true. .false. ) () ) 8 1_x_i (Integer 4) () ) (StructInstanceMember (Var 8 c) 8 1_z_k (Complex 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), derived_types_01_m_01: (Module (SymbolTable 2 { set: (Function (SymbolTable 5 { 1_x_i: (ExternalSymbol 5 1_x_i 3 i x [] i Public ), 1_x_r: (ExternalSymbol 5 1_x_r 3 r x [] r Public ), a: (Variable 5 a [] Out () () Default (StructType [(Real 4) (Integer 4)] [] .true. .false. ) 2 x Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) set (FunctionType [(StructType [(Real 4) (Integer 4)] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 a)] [(Assignment (StructInstanceMember (Var 5 a) 5 1_x_i (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 a) 5 1_x_r (Real 4) () ) (RealConstant 1.500000 (Real 4) ) () .false. .false. )] () Public .true. .true. () ), x: (Struct (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 3 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) x (StructType [(Real 4) (Integer 4)] [] .true. .false. ) [] [r i] [] Source Public .false. .false. [] () () [] ), y: (Struct (SymbolTable 4 { c: (Variable 4 c [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 4 d [] Local () () Default (StructType [(Real 4) (Integer 4)] [] .true. .false. ) 2 x Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) y (StructType [(Complex 4) (StructType [(Real 4) (Integer 4)] [] .true. .false. )] [] .true. .false. ) [x] [c d] [] Source Public .false. .false. [] () () [] ) }) derived_types_01_m_01 () [] .false. .false. .false. ), derived_types_01_m_02: (Module (SymbolTable 6 { y: (ExternalSymbol 6 y 2 y derived_types_01_m_01 [] y Public ), z: (Struct (SymbolTable 7 { k: (Variable 7 k [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 7 l [] Local () () Default (StructType [(Complex 4) (StructType [(Real 4) (Integer 4)] [] .true. .false. )] [] .true. .false. ) 6 y Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) z (StructType [(Complex 4) (StructType [(Complex 4) (StructType [(Real 4) (Integer 4)] [] .true. .false. )] [] .true. .false. )] [] .true. .false. ) [y] [k l] [] Source Public .false. .false. [] () () [] ) }) derived_types_01_m_02 () [derived_types_01_m_01] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-class_02-b56b852.stderr0000664000175000017500000000035015174404631023327 0ustar alastairalastairwarning: Change of value in conversion from 'real(8)' to 'real(4)' --> tests/../integration_tests/class_02.f90:5:16 | 5 | real :: pi = 3.1415926535897931d0 ! Class-wide private constant | ^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-nullify_03-e2c1d62.stdout0000664000175000017500000006102515174404631024003 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { module_nullify_03: (Module (SymbolTable 2 { mxdim: (Variable 2 mxdim [] Local (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rp1d: (Struct (SymbolTable 3 { f: (Variable 3 f [] Local () () Default (Pointer (Array (Real 8) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) rp1d (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [] [f] [] Source Public .false. .false. [] () () [] ), sds: (Struct (SymbolTable 4 { dims: (Variable 4 dims [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Variable 4 f [] Local () () Default (Pointer (Array (Real 8) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), hdf32: (Variable 4 hdf32 [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ndim: (Variable 4 ndim [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), scales: (Variable 4 scales [] Local () () Default (Array (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) 2 rp1d Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sds (StructType [(Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (Logical 4) (Array (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (Pointer (Array (Real 8) [(() ()) (() ()) (() ())] DescriptorArray ) )] [] .true. .false. ) [] [ndim dims hdf32 scales f] [] Source Public .false. .false. [] () () [] ) }) module_nullify_03 () [] .false. .false. .false. ), nullify_03: (Program (SymbolTable 5 { 1_rp1d_f: (ExternalSymbol 5 1_rp1d_f 3 f rp1d [] f Public ), 1_sds_scales: (ExternalSymbol 5 1_sds_scales 4 scales sds [] scales Public ), rp1d: (ExternalSymbol 5 rp1d 2 rp1d module_nullify_03 [] rp1d Public ), s: (Variable 5 s [] Local () () Default (StructType [(Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (Logical 4) (Array (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (Pointer (Array (Real 8) [(() ()) (() ()) (() ())] DescriptorArray ) )] [] .true. .false. ) 5 sds Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sds: (ExternalSymbol 5 sds 2 sds module_nullify_03 [] sds Public ) }) nullify_03 [module_nullify_03] [(Nullify [(StructInstanceMember (ArrayItem (StructInstanceMember (Var 5 s) 5 1_sds_scales (Array (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) ColMajor () ) 5 1_rp1d_f (Pointer (Array (Real 8) [(() ())] DescriptorArray ) ) () )] )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-arrays_01_size-aaed99f.stdout0000664000175000017500000026662515174404631025230 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @5 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @6 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @7 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @9 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @10 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @11 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @15 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @16 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @17 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @21 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @22 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @23 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @25 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @27 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @28 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @29 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @31 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @32 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @33 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @34 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @35 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @37 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @38 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @39 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @40 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @41 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @43 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @44 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @45 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @46 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @47 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @48 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @49 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @50 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @51 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @52 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @53 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @54 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @55 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @56 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @57 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @58 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @59 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @60 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @61 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @62 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @63 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @64 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @65 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @66 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @67 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @68 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @69 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @70 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @71 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @72 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @73 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @74 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @75 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @76 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @77 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @78 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @79 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @80 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @81 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @82 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @83 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @84 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @85 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @86 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @87 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @88 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @89 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @90 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @91 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @92 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @93 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @94 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @95 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @96 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @97 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @98 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @99 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @100 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @101 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @102 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @103 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @104 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @105 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @106 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @107 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @108 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @109 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @110 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @111 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @112 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @113 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @114 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @115 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_size.f90\00", align 1 @116 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @117 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @118 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @119 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %__do_loop_end = alloca i32, align 4 %__do_loop_end1 = alloca i32, align 4 %__do_loop_end2 = alloca i32, align 4 %a = alloca [3 x i32], align 4 %b = alloca [4 x i32], align 4 %i = alloca i32, align 4 %size_a = alloca i32, align 4 %size_b = alloca i32, align 4 store i32 3, i32* %size_a, align 4 store i32 4, i32* %size_b, align 4 %3 = load i32, i32* %size_a, align 4 %4 = icmp ne i32 %3, 3 br i1 %4, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %5 = load i32, i32* %size_b, align 4 %6 = icmp ne i32 %5, 4 br i1 %6, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %7 = load i32, i32* %size_a, align 4 store i32 %7, i32* %__do_loop_end, align 4 store i32 0, i32* %i, align 4 br label %loop.head loop.head: ; preds = %ifcont5, %ifcont3 %8 = load i32, i32* %i, align 4 %9 = add i32 %8, 1 %10 = load i32, i32* %__do_loop_end, align 4 %11 = icmp sle i32 %9, %10 br i1 %11, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %12 = load i32, i32* %i, align 4 %13 = add i32 %12, 1 store i32 %13, i32* %i, align 4 %14 = load i32, i32* %i, align 4 %15 = sext i32 %14 to i64 %16 = sub i64 %15, 1 %17 = mul i64 1, %16 %18 = add i64 0, %17 %19 = icmp slt i64 %15, 1 %20 = icmp sgt i64 %15, 3 %21 = or i1 %19, %20 br i1 %21, label %then4, label %ifcont5 then4: ; preds = %loop.body %22 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %23 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %24 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %23, i32 0, i32 0 %25 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %24, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @5, i32 0, i32 0), i8** %25, align 8 %26 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %24, i32 0, i32 1 store i32 13, i32* %26, align 4 %27 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %24, i32 0, i32 2 store i32 5, i32* %27, align 4 %28 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %24, i32 0, i32 3 store i32 13, i32* %28, align 4 %29 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %24, i32 0, i32 4 store i32 8, i32* %29, align 4 %30 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @6, i32 0, i32 0)) %31 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %22, i32 0, i32 0 %32 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %23, i32 0, i32 0 %33 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %31, i32 0, i32 2 %34 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %31, i32 0, i32 0 store i1 true, i1* %34, align 1 %35 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %31, i32 0, i32 1 store i8* %30, i8** %35, align 8 store { i8*, i32, i32, i32, i32 }* %32, { i8*, i32, i32, i32, i32 }** %33, align 8 %36 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %31, i32 0, i32 3 store i32 1, i32* %36, align 4 %37 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %22, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %37, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i64 %15, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont5: ; preds = %loop.body %38 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 %18 %39 = load i32, i32* %i, align 4 %40 = add i32 %39, 10 store i32 %40, i32* %38, align 4 br label %loop.head loop.end: ; preds = %loop.head br i1 false, label %then6, label %ifcont7 then6: ; preds = %loop.end %41 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %42 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %43 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %42, i32 0, i32 0 %44 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %43, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @9, i32 0, i32 0), i8** %44, align 8 %45 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %43, i32 0, i32 1 store i32 15, i32* %45, align 4 %46 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %43, i32 0, i32 2 store i32 5, i32* %46, align 4 %47 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %43, i32 0, i32 3 store i32 15, i32* %47, align 4 %48 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %43, i32 0, i32 4 store i32 8, i32* %48, align 4 %49 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @10, i32 0, i32 0)) %50 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %41, i32 0, i32 0 %51 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %42, i32 0, i32 0 %52 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %50, i32 0, i32 2 %53 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %50, i32 0, i32 0 store i1 true, i1* %53, align 1 %54 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %50, i32 0, i32 1 store i8* %49, i8** %54, align 8 store { i8*, i32, i32, i32, i32 }* %51, { i8*, i32, i32, i32, i32 }** %52, align 8 %55 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %50, i32 0, i32 3 store i32 1, i32* %55, align 4 %56 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %41, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %56, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i64 1, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont7: ; preds = %loop.end %57 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 0 %58 = load i32, i32* %57, align 4 %59 = icmp ne i32 %58, 11 br i1 %59, label %then8, label %else9 then8: ; preds = %ifcont7 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont10 else9: ; preds = %ifcont7 br label %ifcont10 ifcont10: ; preds = %else9, %then8 br i1 false, label %then11, label %ifcont12 then11: ; preds = %ifcont10 %60 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %61 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %62 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %61, i32 0, i32 0 %63 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %62, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @15, i32 0, i32 0), i8** %63, align 8 %64 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %62, i32 0, i32 1 store i32 16, i32* %64, align 4 %65 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %62, i32 0, i32 2 store i32 5, i32* %65, align 4 %66 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %62, i32 0, i32 3 store i32 16, i32* %66, align 4 %67 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %62, i32 0, i32 4 store i32 8, i32* %67, align 4 %68 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @16, i32 0, i32 0)) %69 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %60, i32 0, i32 0 %70 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %61, i32 0, i32 0 %71 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %69, i32 0, i32 2 %72 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %69, i32 0, i32 0 store i1 true, i1* %72, align 1 %73 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %69, i32 0, i32 1 store i8* %68, i8** %73, align 8 store { i8*, i32, i32, i32, i32 }* %70, { i8*, i32, i32, i32, i32 }** %71, align 8 %74 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %69, i32 0, i32 3 store i32 1, i32* %74, align 4 %75 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %60, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %75, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i64 2, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont12: ; preds = %ifcont10 %76 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 1 %77 = load i32, i32* %76, align 4 %78 = icmp ne i32 %77, 12 br i1 %78, label %then13, label %else14 then13: ; preds = %ifcont12 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont15 else14: ; preds = %ifcont12 br label %ifcont15 ifcont15: ; preds = %else14, %then13 br i1 false, label %then16, label %ifcont17 then16: ; preds = %ifcont15 %79 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %80 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %81 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %80, i32 0, i32 0 %82 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %81, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @21, i32 0, i32 0), i8** %82, align 8 %83 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %81, i32 0, i32 1 store i32 17, i32* %83, align 4 %84 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %81, i32 0, i32 2 store i32 5, i32* %84, align 4 %85 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %81, i32 0, i32 3 store i32 17, i32* %85, align 4 %86 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %81, i32 0, i32 4 store i32 8, i32* %86, align 4 %87 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @22, i32 0, i32 0)) %88 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %79, i32 0, i32 0 %89 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %80, i32 0, i32 0 %90 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %88, i32 0, i32 2 %91 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %88, i32 0, i32 0 store i1 true, i1* %91, align 1 %92 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %88, i32 0, i32 1 store i8* %87, i8** %92, align 8 store { i8*, i32, i32, i32, i32 }* %89, { i8*, i32, i32, i32, i32 }** %90, align 8 %93 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %88, i32 0, i32 3 store i32 1, i32* %93, align 4 %94 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %79, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %94, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @23, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0), i64 3, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont17: ; preds = %ifcont15 %95 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 2 %96 = load i32, i32* %95, align 4 %97 = icmp ne i32 %96, 13 br i1 %97, label %then18, label %else19 then18: ; preds = %ifcont17 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont20 else19: ; preds = %ifcont17 br label %ifcont20 ifcont20: ; preds = %else19, %then18 %98 = load i32, i32* %size_b, align 4 %99 = add i32 10, %98 store i32 %99, i32* %__do_loop_end1, align 4 store i32 10, i32* %i, align 4 br label %loop.head21 loop.head21: ; preds = %ifcont24, %ifcont20 %100 = load i32, i32* %i, align 4 %101 = add i32 %100, 1 %102 = load i32, i32* %__do_loop_end1, align 4 %103 = icmp sle i32 %101, %102 br i1 %103, label %loop.body22, label %loop.end25 loop.body22: ; preds = %loop.head21 %104 = load i32, i32* %i, align 4 %105 = add i32 %104, 1 store i32 %105, i32* %i, align 4 %106 = load i32, i32* %i, align 4 %107 = sub i32 %106, 10 %108 = sext i32 %107 to i64 %109 = sub i64 %108, 1 %110 = mul i64 1, %109 %111 = add i64 0, %110 %112 = icmp slt i64 %108, 1 %113 = icmp sgt i64 %108, 4 %114 = or i1 %112, %113 br i1 %114, label %then23, label %ifcont24 then23: ; preds = %loop.body22 %115 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %116 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %117 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %116, i32 0, i32 0 %118 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %117, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @27, i32 0, i32 0), i8** %118, align 8 %119 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %117, i32 0, i32 1 store i32 20, i32* %119, align 4 %120 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %117, i32 0, i32 2 store i32 5, i32* %120, align 4 %121 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %117, i32 0, i32 3 store i32 20, i32* %121, align 4 %122 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %117, i32 0, i32 4 store i32 11, i32* %122, align 4 %123 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @28, i32 0, i32 0)) %124 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %115, i32 0, i32 0 %125 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %116, i32 0, i32 0 %126 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %124, i32 0, i32 2 %127 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %124, i32 0, i32 0 store i1 true, i1* %127, align 1 %128 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %124, i32 0, i32 1 store i8* %123, i8** %128, align 8 store { i8*, i32, i32, i32, i32 }* %125, { i8*, i32, i32, i32, i32 }** %126, align 8 %129 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %124, i32 0, i32 3 store i32 1, i32* %129, align 4 %130 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %115, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %130, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @29, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0), i64 %108, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont24: ; preds = %loop.body22 %131 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 %111 %132 = load i32, i32* %i, align 4 store i32 %132, i32* %131, align 4 br label %loop.head21 loop.end25: ; preds = %loop.head21 br i1 false, label %then26, label %ifcont27 then26: ; preds = %loop.end25 %133 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %134 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %135 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %134, i32 0, i32 0 %136 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %135, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @31, i32 0, i32 0), i8** %136, align 8 %137 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %135, i32 0, i32 1 store i32 22, i32* %137, align 4 %138 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %135, i32 0, i32 2 store i32 5, i32* %138, align 4 %139 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %135, i32 0, i32 3 store i32 22, i32* %139, align 4 %140 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %135, i32 0, i32 4 store i32 8, i32* %140, align 4 %141 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @32, i32 0, i32 0)) %142 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %133, i32 0, i32 0 %143 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %134, i32 0, i32 0 %144 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %142, i32 0, i32 2 %145 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %142, i32 0, i32 0 store i1 true, i1* %145, align 1 %146 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %142, i32 0, i32 1 store i8* %141, i8** %146, align 8 store { i8*, i32, i32, i32, i32 }* %143, { i8*, i32, i32, i32, i32 }** %144, align 8 %147 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %142, i32 0, i32 3 store i32 1, i32* %147, align 4 %148 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %133, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %148, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @33, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0), i64 1, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont27: ; preds = %loop.end25 %149 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 0 %150 = load i32, i32* %149, align 4 %151 = icmp ne i32 %150, 11 br i1 %151, label %then28, label %else29 then28: ; preds = %ifcont27 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @35, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @34, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont30 else29: ; preds = %ifcont27 br label %ifcont30 ifcont30: ; preds = %else29, %then28 br i1 false, label %then31, label %ifcont32 then31: ; preds = %ifcont30 %152 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %153 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %154 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %153, i32 0, i32 0 %155 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %154, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @37, i32 0, i32 0), i8** %155, align 8 %156 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %154, i32 0, i32 1 store i32 23, i32* %156, align 4 %157 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %154, i32 0, i32 2 store i32 5, i32* %157, align 4 %158 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %154, i32 0, i32 3 store i32 23, i32* %158, align 4 %159 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %154, i32 0, i32 4 store i32 8, i32* %159, align 4 %160 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @38, i32 0, i32 0)) %161 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %152, i32 0, i32 0 %162 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %153, i32 0, i32 0 %163 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %161, i32 0, i32 2 %164 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %161, i32 0, i32 0 store i1 true, i1* %164, align 1 %165 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %161, i32 0, i32 1 store i8* %160, i8** %165, align 8 store { i8*, i32, i32, i32, i32 }* %162, { i8*, i32, i32, i32, i32 }** %163, align 8 %166 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %161, i32 0, i32 3 store i32 1, i32* %166, align 4 %167 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %152, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %167, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @39, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0), i64 2, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont32: ; preds = %ifcont30 %168 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 1 %169 = load i32, i32* %168, align 4 %170 = icmp ne i32 %169, 12 br i1 %170, label %then33, label %else34 then33: ; preds = %ifcont32 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @40, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont35 else34: ; preds = %ifcont32 br label %ifcont35 ifcont35: ; preds = %else34, %then33 br i1 false, label %then36, label %ifcont37 then36: ; preds = %ifcont35 %171 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %172 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %173 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %172, i32 0, i32 0 %174 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %173, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @43, i32 0, i32 0), i8** %174, align 8 %175 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %173, i32 0, i32 1 store i32 24, i32* %175, align 4 %176 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %173, i32 0, i32 2 store i32 5, i32* %176, align 4 %177 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %173, i32 0, i32 3 store i32 24, i32* %177, align 4 %178 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %173, i32 0, i32 4 store i32 8, i32* %178, align 4 %179 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @44, i32 0, i32 0)) %180 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %171, i32 0, i32 0 %181 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %172, i32 0, i32 0 %182 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %180, i32 0, i32 2 %183 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %180, i32 0, i32 0 store i1 true, i1* %183, align 1 %184 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %180, i32 0, i32 1 store i8* %179, i8** %184, align 8 store { i8*, i32, i32, i32, i32 }* %181, { i8*, i32, i32, i32, i32 }** %182, align 8 %185 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %180, i32 0, i32 3 store i32 1, i32* %185, align 4 %186 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %171, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %186, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @45, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0), i64 3, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont37: ; preds = %ifcont35 %187 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 2 %188 = load i32, i32* %187, align 4 %189 = icmp ne i32 %188, 13 br i1 %189, label %then38, label %else39 then38: ; preds = %ifcont37 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @47, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @46, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont40 else39: ; preds = %ifcont37 br label %ifcont40 ifcont40: ; preds = %else39, %then38 br i1 false, label %then41, label %ifcont42 then41: ; preds = %ifcont40 %190 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %191 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %192 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %191, i32 0, i32 0 %193 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %192, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @49, i32 0, i32 0), i8** %193, align 8 %194 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %192, i32 0, i32 1 store i32 25, i32* %194, align 4 %195 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %192, i32 0, i32 2 store i32 5, i32* %195, align 4 %196 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %192, i32 0, i32 3 store i32 25, i32* %196, align 4 %197 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %192, i32 0, i32 4 store i32 8, i32* %197, align 4 %198 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @50, i32 0, i32 0)) %199 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %190, i32 0, i32 0 %200 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %191, i32 0, i32 0 %201 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %199, i32 0, i32 2 %202 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %199, i32 0, i32 0 store i1 true, i1* %202, align 1 %203 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %199, i32 0, i32 1 store i8* %198, i8** %203, align 8 store { i8*, i32, i32, i32, i32 }* %200, { i8*, i32, i32, i32, i32 }** %201, align 8 %204 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %199, i32 0, i32 3 store i32 1, i32* %204, align 4 %205 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %190, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %205, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @51, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @48, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont42: ; preds = %ifcont40 %206 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 3 %207 = load i32, i32* %206, align 4 %208 = icmp ne i32 %207, 14 br i1 %208, label %then43, label %else44 then43: ; preds = %ifcont42 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @53, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @52, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont45 else44: ; preds = %ifcont42 br label %ifcont45 ifcont45: ; preds = %else44, %then43 %209 = load i32, i32* %size_a, align 4 store i32 %209, i32* %__do_loop_end2, align 4 store i32 0, i32* %i, align 4 br label %loop.head46 loop.head46: ; preds = %ifcont51, %ifcont45 %210 = load i32, i32* %i, align 4 %211 = add i32 %210, 1 %212 = load i32, i32* %__do_loop_end2, align 4 %213 = icmp sle i32 %211, %212 br i1 %213, label %loop.body47, label %loop.end52 loop.body47: ; preds = %loop.head46 %214 = load i32, i32* %i, align 4 %215 = add i32 %214, 1 store i32 %215, i32* %i, align 4 %216 = load i32, i32* %i, align 4 %217 = sext i32 %216 to i64 %218 = sub i64 %217, 1 %219 = mul i64 1, %218 %220 = add i64 0, %219 %221 = icmp slt i64 %217, 1 %222 = icmp sgt i64 %217, 4 %223 = or i1 %221, %222 br i1 %223, label %then48, label %ifcont49 then48: ; preds = %loop.body47 %224 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %225 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %226 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %225, i32 0, i32 0 %227 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %226, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @55, i32 0, i32 0), i8** %227, align 8 %228 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %226, i32 0, i32 1 store i32 28, i32* %228, align 4 %229 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %226, i32 0, i32 2 store i32 5, i32* %229, align 4 %230 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %226, i32 0, i32 3 store i32 28, i32* %230, align 4 %231 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %226, i32 0, i32 4 store i32 8, i32* %231, align 4 %232 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @56, i32 0, i32 0)) %233 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %224, i32 0, i32 0 %234 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %225, i32 0, i32 0 %235 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %233, i32 0, i32 2 %236 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %233, i32 0, i32 0 store i1 true, i1* %236, align 1 %237 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %233, i32 0, i32 1 store i8* %232, i8** %237, align 8 store { i8*, i32, i32, i32, i32 }* %234, { i8*, i32, i32, i32, i32 }** %235, align 8 %238 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %233, i32 0, i32 3 store i32 1, i32* %238, align 4 %239 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %224, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %239, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @57, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @54, i32 0, i32 0), i64 %217, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont49: ; preds = %loop.body47 %240 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 %220 %241 = load i32, i32* %i, align 4 %242 = sext i32 %241 to i64 %243 = sub i64 %242, 1 %244 = mul i64 1, %243 %245 = add i64 0, %244 %246 = icmp slt i64 %242, 1 %247 = icmp sgt i64 %242, 3 %248 = or i1 %246, %247 br i1 %248, label %then50, label %ifcont51 then50: ; preds = %ifcont49 %249 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %250 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %251 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %250, i32 0, i32 0 %252 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %251, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @59, i32 0, i32 0), i8** %252, align 8 %253 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %251, i32 0, i32 1 store i32 28, i32* %253, align 4 %254 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %251, i32 0, i32 2 store i32 12, i32* %254, align 4 %255 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %251, i32 0, i32 3 store i32 28, i32* %255, align 4 %256 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %251, i32 0, i32 4 store i32 15, i32* %256, align 4 %257 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @60, i32 0, i32 0)) %258 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %249, i32 0, i32 0 %259 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %250, i32 0, i32 0 %260 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %258, i32 0, i32 2 %261 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %258, i32 0, i32 0 store i1 true, i1* %261, align 1 %262 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %258, i32 0, i32 1 store i8* %257, i8** %262, align 8 store { i8*, i32, i32, i32, i32 }* %259, { i8*, i32, i32, i32, i32 }** %260, align 8 %263 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %258, i32 0, i32 3 store i32 1, i32* %263, align 4 %264 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %249, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %264, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @61, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @58, i32 0, i32 0), i64 %242, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont51: ; preds = %ifcont49 %265 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 %245 %266 = load i32, i32* %265, align 4 %267 = sub i32 %266, 10 store i32 %267, i32* %240, align 4 br label %loop.head46 loop.end52: ; preds = %loop.head46 br i1 false, label %then53, label %ifcont54 then53: ; preds = %loop.end52 %268 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %269 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %270 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %269, i32 0, i32 0 %271 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %270, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @63, i32 0, i32 0), i8** %271, align 8 %272 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %270, i32 0, i32 1 store i32 30, i32* %272, align 4 %273 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %270, i32 0, i32 2 store i32 5, i32* %273, align 4 %274 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %270, i32 0, i32 3 store i32 30, i32* %274, align 4 %275 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %270, i32 0, i32 4 store i32 8, i32* %275, align 4 %276 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @64, i32 0, i32 0)) %277 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %268, i32 0, i32 0 %278 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %269, i32 0, i32 0 %279 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %277, i32 0, i32 2 %280 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %277, i32 0, i32 0 store i1 true, i1* %280, align 1 %281 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %277, i32 0, i32 1 store i8* %276, i8** %281, align 8 store { i8*, i32, i32, i32, i32 }* %278, { i8*, i32, i32, i32, i32 }** %279, align 8 %282 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %277, i32 0, i32 3 store i32 1, i32* %282, align 4 %283 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %268, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %283, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @65, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @62, i32 0, i32 0), i64 1, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont54: ; preds = %loop.end52 %284 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 0 %285 = load i32, i32* %284, align 4 %286 = icmp ne i32 %285, 1 br i1 %286, label %then55, label %else56 then55: ; preds = %ifcont54 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @67, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @66, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont57 else56: ; preds = %ifcont54 br label %ifcont57 ifcont57: ; preds = %else56, %then55 br i1 false, label %then58, label %ifcont59 then58: ; preds = %ifcont57 %287 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %288 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %289 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %288, i32 0, i32 0 %290 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %289, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @69, i32 0, i32 0), i8** %290, align 8 %291 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %289, i32 0, i32 1 store i32 31, i32* %291, align 4 %292 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %289, i32 0, i32 2 store i32 5, i32* %292, align 4 %293 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %289, i32 0, i32 3 store i32 31, i32* %293, align 4 %294 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %289, i32 0, i32 4 store i32 8, i32* %294, align 4 %295 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @70, i32 0, i32 0)) %296 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %287, i32 0, i32 0 %297 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %288, i32 0, i32 0 %298 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %296, i32 0, i32 2 %299 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %296, i32 0, i32 0 store i1 true, i1* %299, align 1 %300 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %296, i32 0, i32 1 store i8* %295, i8** %300, align 8 store { i8*, i32, i32, i32, i32 }* %297, { i8*, i32, i32, i32, i32 }** %298, align 8 %301 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %296, i32 0, i32 3 store i32 1, i32* %301, align 4 %302 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %287, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %302, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @71, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @68, i32 0, i32 0), i64 2, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont59: ; preds = %ifcont57 %303 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 1 %304 = load i32, i32* %303, align 4 %305 = icmp ne i32 %304, 2 br i1 %305, label %then60, label %else61 then60: ; preds = %ifcont59 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @73, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @72, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont62 else61: ; preds = %ifcont59 br label %ifcont62 ifcont62: ; preds = %else61, %then60 br i1 false, label %then63, label %ifcont64 then63: ; preds = %ifcont62 %306 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %307 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %308 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %307, i32 0, i32 0 %309 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %308, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @75, i32 0, i32 0), i8** %309, align 8 %310 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %308, i32 0, i32 1 store i32 32, i32* %310, align 4 %311 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %308, i32 0, i32 2 store i32 5, i32* %311, align 4 %312 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %308, i32 0, i32 3 store i32 32, i32* %312, align 4 %313 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %308, i32 0, i32 4 store i32 8, i32* %313, align 4 %314 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @76, i32 0, i32 0)) %315 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %306, i32 0, i32 0 %316 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %307, i32 0, i32 0 %317 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %315, i32 0, i32 2 %318 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %315, i32 0, i32 0 store i1 true, i1* %318, align 1 %319 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %315, i32 0, i32 1 store i8* %314, i8** %319, align 8 store { i8*, i32, i32, i32, i32 }* %316, { i8*, i32, i32, i32, i32 }** %317, align 8 %320 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %315, i32 0, i32 3 store i32 1, i32* %320, align 4 %321 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %306, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %321, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @77, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @74, i32 0, i32 0), i64 3, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont64: ; preds = %ifcont62 %322 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 2 %323 = load i32, i32* %322, align 4 %324 = icmp ne i32 %323, 3 br i1 %324, label %then65, label %else66 then65: ; preds = %ifcont64 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @79, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @78, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont67 else66: ; preds = %ifcont64 br label %ifcont67 ifcont67: ; preds = %else66, %then65 br i1 false, label %then68, label %ifcont69 then68: ; preds = %ifcont67 %325 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %326 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %327 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %326, i32 0, i32 0 %328 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %327, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @81, i32 0, i32 0), i8** %328, align 8 %329 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %327, i32 0, i32 1 store i32 34, i32* %329, align 4 %330 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %327, i32 0, i32 2 store i32 1, i32* %330, align 4 %331 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %327, i32 0, i32 3 store i32 34, i32* %331, align 4 %332 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %327, i32 0, i32 4 store i32 4, i32* %332, align 4 %333 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @82, i32 0, i32 0)) %334 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %325, i32 0, i32 0 %335 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %326, i32 0, i32 0 %336 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %334, i32 0, i32 2 %337 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %334, i32 0, i32 0 store i1 true, i1* %337, align 1 %338 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %334, i32 0, i32 1 store i8* %333, i8** %338, align 8 store { i8*, i32, i32, i32, i32 }* %335, { i8*, i32, i32, i32, i32 }** %336, align 8 %339 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %334, i32 0, i32 3 store i32 1, i32* %339, align 4 %340 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %325, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %340, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @83, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @80, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont69: ; preds = %ifcont67 %341 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 3 br i1 false, label %then70, label %ifcont71 then70: ; preds = %ifcont69 %342 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %343 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %344 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %343, i32 0, i32 0 %345 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %344, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @85, i32 0, i32 0), i8** %345, align 8 %346 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %344, i32 0, i32 1 store i32 34, i32* %346, align 4 %347 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %344, i32 0, i32 2 store i32 8, i32* %347, align 4 %348 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %344, i32 0, i32 3 store i32 34, i32* %348, align 4 %349 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %344, i32 0, i32 4 store i32 11, i32* %349, align 4 %350 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @86, i32 0, i32 0)) %351 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %342, i32 0, i32 0 %352 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %343, i32 0, i32 0 %353 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %351, i32 0, i32 2 %354 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %351, i32 0, i32 0 store i1 true, i1* %354, align 1 %355 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %351, i32 0, i32 1 store i8* %350, i8** %355, align 8 store { i8*, i32, i32, i32, i32 }* %352, { i8*, i32, i32, i32, i32 }** %353, align 8 %356 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %351, i32 0, i32 3 store i32 1, i32* %356, align 4 %357 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %342, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %357, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @87, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @84, i32 0, i32 0), i64 1, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont71: ; preds = %ifcont69 %358 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 0 %359 = load i32, i32* %358, align 4 br i1 false, label %then72, label %ifcont73 then72: ; preds = %ifcont71 %360 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %361 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %362 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %361, i32 0, i32 0 %363 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %362, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @89, i32 0, i32 0), i8** %363, align 8 %364 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %362, i32 0, i32 1 store i32 34, i32* %364, align 4 %365 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %362, i32 0, i32 2 store i32 13, i32* %365, align 4 %366 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %362, i32 0, i32 3 store i32 34, i32* %366, align 4 %367 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %362, i32 0, i32 4 store i32 16, i32* %367, align 4 %368 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @90, i32 0, i32 0)) %369 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %360, i32 0, i32 0 %370 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %361, i32 0, i32 0 %371 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %369, i32 0, i32 2 %372 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %369, i32 0, i32 0 store i1 true, i1* %372, align 1 %373 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %369, i32 0, i32 1 store i8* %368, i8** %373, align 8 store { i8*, i32, i32, i32, i32 }* %370, { i8*, i32, i32, i32, i32 }** %371, align 8 %374 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %369, i32 0, i32 3 store i32 1, i32* %374, align 4 %375 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %360, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %375, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @91, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @88, i32 0, i32 0), i64 2, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont73: ; preds = %ifcont71 %376 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 1 %377 = load i32, i32* %376, align 4 %378 = add i32 %359, %377 br i1 false, label %then74, label %ifcont75 then74: ; preds = %ifcont73 %379 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %380 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %381 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %380, i32 0, i32 0 %382 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %381, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @93, i32 0, i32 0), i8** %382, align 8 %383 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %381, i32 0, i32 1 store i32 34, i32* %383, align 4 %384 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %381, i32 0, i32 2 store i32 18, i32* %384, align 4 %385 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %381, i32 0, i32 3 store i32 34, i32* %385, align 4 %386 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %381, i32 0, i32 4 store i32 21, i32* %386, align 4 %387 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @94, i32 0, i32 0)) %388 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %379, i32 0, i32 0 %389 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %380, i32 0, i32 0 %390 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %388, i32 0, i32 2 %391 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %388, i32 0, i32 0 store i1 true, i1* %391, align 1 %392 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %388, i32 0, i32 1 store i8* %387, i8** %392, align 8 store { i8*, i32, i32, i32, i32 }* %389, { i8*, i32, i32, i32, i32 }** %390, align 8 %393 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %388, i32 0, i32 3 store i32 1, i32* %393, align 4 %394 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %379, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %394, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @95, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @92, i32 0, i32 0), i64 3, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont75: ; preds = %ifcont73 %395 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 2 %396 = load i32, i32* %395, align 4 %397 = add i32 %378, %396 br i1 false, label %then76, label %ifcont77 then76: ; preds = %ifcont75 %398 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %399 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %400 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %399, i32 0, i32 0 %401 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %400, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @97, i32 0, i32 0), i8** %401, align 8 %402 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %400, i32 0, i32 1 store i32 34, i32* %402, align 4 %403 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %400, i32 0, i32 2 store i32 23, i32* %403, align 4 %404 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %400, i32 0, i32 3 store i32 34, i32* %404, align 4 %405 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %400, i32 0, i32 4 store i32 26, i32* %405, align 4 %406 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @98, i32 0, i32 0)) %407 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %398, i32 0, i32 0 %408 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %399, i32 0, i32 0 %409 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %407, i32 0, i32 2 %410 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %407, i32 0, i32 0 store i1 true, i1* %410, align 1 %411 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %407, i32 0, i32 1 store i8* %406, i8** %411, align 8 store { i8*, i32, i32, i32, i32 }* %408, { i8*, i32, i32, i32, i32 }** %409, align 8 %412 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %407, i32 0, i32 3 store i32 1, i32* %412, align 4 %413 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %398, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %413, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @99, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @96, i32 0, i32 0), i64 1, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont77: ; preds = %ifcont75 %414 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 0 %415 = load i32, i32* %414, align 4 %416 = add i32 %397, %415 store i32 %416, i32* %341, align 4 br i1 false, label %then78, label %ifcont79 then78: ; preds = %ifcont77 %417 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %418 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %419 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %418, i32 0, i32 0 %420 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %419, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @101, i32 0, i32 0), i8** %420, align 8 %421 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %419, i32 0, i32 1 store i32 35, i32* %421, align 4 %422 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %419, i32 0, i32 2 store i32 5, i32* %422, align 4 %423 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %419, i32 0, i32 3 store i32 35, i32* %423, align 4 %424 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %419, i32 0, i32 4 store i32 8, i32* %424, align 4 %425 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @102, i32 0, i32 0)) %426 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %417, i32 0, i32 0 %427 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %418, i32 0, i32 0 %428 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %426, i32 0, i32 2 %429 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %426, i32 0, i32 0 store i1 true, i1* %429, align 1 %430 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %426, i32 0, i32 1 store i8* %425, i8** %430, align 8 store { i8*, i32, i32, i32, i32 }* %427, { i8*, i32, i32, i32, i32 }** %428, align 8 %431 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %426, i32 0, i32 3 store i32 1, i32* %431, align 4 %432 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %417, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %432, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @103, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @100, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont79: ; preds = %ifcont77 %433 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 3 %434 = load i32, i32* %433, align 4 %435 = icmp ne i32 %434, 17 br i1 %435, label %then80, label %else81 then80: ; preds = %ifcont79 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @105, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @104, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont82 else81: ; preds = %ifcont79 br label %ifcont82 ifcont82: ; preds = %else81, %then80 br i1 false, label %then83, label %ifcont84 then83: ; preds = %ifcont82 %436 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %437 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %438 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %437, i32 0, i32 0 %439 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %438, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @107, i32 0, i32 0), i8** %439, align 8 %440 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %438, i32 0, i32 1 store i32 37, i32* %440, align 4 %441 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %438, i32 0, i32 2 store i32 1, i32* %441, align 4 %442 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %438, i32 0, i32 3 store i32 37, i32* %442, align 4 %443 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %438, i32 0, i32 4 store i32 4, i32* %443, align 4 %444 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @108, i32 0, i32 0)) %445 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %436, i32 0, i32 0 %446 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %437, i32 0, i32 0 %447 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %445, i32 0, i32 2 %448 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %445, i32 0, i32 0 store i1 true, i1* %448, align 1 %449 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %445, i32 0, i32 1 store i8* %444, i8** %449, align 8 store { i8*, i32, i32, i32, i32 }* %446, { i8*, i32, i32, i32, i32 }** %447, align 8 %450 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %445, i32 0, i32 3 store i32 1, i32* %450, align 4 %451 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %436, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %451, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @109, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @106, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont84: ; preds = %ifcont82 %452 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 3 br i1 false, label %then85, label %ifcont86 then85: ; preds = %ifcont84 %453 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %454 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %455 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %454, i32 0, i32 0 %456 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %455, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @111, i32 0, i32 0), i8** %456, align 8 %457 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %455, i32 0, i32 1 store i32 37, i32* %457, align 4 %458 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %455, i32 0, i32 2 store i32 8, i32* %458, align 4 %459 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %455, i32 0, i32 3 store i32 37, i32* %459, align 4 %460 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %455, i32 0, i32 4 store i32 11, i32* %460, align 4 %461 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @112, i32 0, i32 0)) %462 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %453, i32 0, i32 0 %463 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %454, i32 0, i32 0 %464 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %462, i32 0, i32 2 %465 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %462, i32 0, i32 0 store i1 true, i1* %465, align 1 %466 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %462, i32 0, i32 1 store i8* %461, i8** %466, align 8 store { i8*, i32, i32, i32, i32 }* %463, { i8*, i32, i32, i32, i32 }** %464, align 8 %467 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %462, i32 0, i32 3 store i32 1, i32* %467, align 4 %468 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %453, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %468, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @113, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @110, i32 0, i32 0), i64 1, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont86: ; preds = %ifcont84 %469 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 0 %470 = load i32, i32* %469, align 4 store i32 %470, i32* %452, align 4 br i1 false, label %then87, label %ifcont88 then87: ; preds = %ifcont86 %471 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %472 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %473 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %472, i32 0, i32 0 %474 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %473, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @115, i32 0, i32 0), i8** %474, align 8 %475 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %473, i32 0, i32 1 store i32 38, i32* %475, align 4 %476 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %473, i32 0, i32 2 store i32 5, i32* %476, align 4 %477 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %473, i32 0, i32 3 store i32 38, i32* %477, align 4 %478 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %473, i32 0, i32 4 store i32 8, i32* %478, align 4 %479 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @116, i32 0, i32 0)) %480 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %471, i32 0, i32 0 %481 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %472, i32 0, i32 0 %482 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %480, i32 0, i32 2 %483 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %480, i32 0, i32 0 store i1 true, i1* %483, align 1 %484 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %480, i32 0, i32 1 store i8* %479, i8** %484, align 8 store { i8*, i32, i32, i32, i32 }* %481, { i8*, i32, i32, i32, i32 }** %482, align 8 %485 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %480, i32 0, i32 3 store i32 1, i32* %485, align 4 %486 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %471, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %486, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @117, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @114, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont88: ; preds = %ifcont86 %487 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 3 %488 = load i32, i32* %487, align 4 %489 = icmp ne i32 %488, 11 br i1 %489, label %then89, label %else90 then89: ; preds = %ifcont88 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @119, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @118, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont91 else90: ; preds = %ifcont88 br label %ifcont91 ifcont91: ; preds = %else90, %then89 br label %return return: ; preds = %ifcont91 br label %FINALIZE_SYMTABLE_arrays_01 FINALIZE_SYMTABLE_arrays_01: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) declare i8* @_lcompilers_snprintf_alloc(i8*, i8*, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lcompilers_runtime_error(i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) lfortran-0.63.0/tests/reference/ast_f90-allocate_01-df1748d.stdout0000664000175000017500000000044715174404631024577 0ustar alastairalastairprogram hello implicit none character(len=:), allocatable :: cmd integer :: cmdlen integer :: ierr call get_command(length=cmdlen) if (cmdlen > 0) then allocate(character(cmdlen)::cmd) call get_command(cmd) print *, "hello ", cmd end if deallocate(cmd, stat=ierr) end program hello lfortran-0.63.0/tests/reference/asr-intrinsics_27-11ba39d.json0000664000175000017500000000076115174404631024141 0ustar alastairalastair{ "basename": "asr-intrinsics_27-11ba39d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_27.f90", "infile_hash": "eaa3c2bf4b96b7439c749f9241c0cd49e7c97bc0007423db62d81449", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_27-11ba39d.stdout", "stdout_hash": "f15789f004ef2044dbbe1a8cbe5642dcabdc4929437b73b64818d507", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-array1-3c35261.json0000664000175000017500000000070015174404631023015 0ustar alastairalastair{ "basename": "julia-array1-3c35261", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/array1.f90", "infile_hash": "74ef23b0c6d49a710e5035ce53fa6899eb51ef5e5b693d15108744ca", "outfile": null, "outfile_hash": null, "stdout": "julia-array1-3c35261.stdout", "stdout_hash": "a460fa50c8b0162a5bac418df385fdef90aa1887c86f143005893424", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-end_label-a678e8c.stdout0000664000175000017500000000243115174404631023741 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [] [] [] [] [(GoTo 0 () 1 [] () ) (Continue 1 () )] [] [] ) (Function h [] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [] [(Assignment 0 h 0 () ) (GoTo 0 () 1 [] () ) (Continue 1 () )] [] [] ) (Subroutine g [] [] () () [] [] [] [] [(If 0 () (Logical .true. ()) [(GoTo 0 () 1 [] () ) (Continue 1 () )] [] () () () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-floor_02-5b70ee6.stdout0000664000175000017500000005552715174404631023462 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { floor_02: (Program (SymbolTable 2 { a1: (Variable 2 a1 [] Local (RealConstant 3.300000 (Real 4) ) (RealConstant 3.300000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a2: (Variable 2 a2 [] Local (RealConstant 3.500000 (Real 4) ) (RealConstant 3.500000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a3: (Variable 2 a3 [] Local (RealConstant 3.700000 (Real 4) ) (RealConstant 3.700000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b1: (Variable 2 b1 [] Local (RealUnaryMinus (RealConstant 3.300000 (Real 4) ) (Real 4) (RealConstant -3.300000 (Real 4) ) ) (RealConstant -3.300000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b2: (Variable 2 b2 [] Local (RealUnaryMinus (RealConstant 3.500000 (Real 4) ) (Real 4) (RealConstant -3.500000 (Real 4) ) ) (RealConstant -3.500000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b3: (Variable 2 b3 [] Local (RealUnaryMinus (RealConstant 3.700000 (Real 4) ) (Real 4) (RealConstant -3.700000 (Real 4) ) ) (RealConstant -3.700000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x1: (Variable 2 x1 [a1] Local (IntrinsicElementalFunction Floor [(Var 2 a1)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x2: (Variable 2 x2 [a2] Local (IntrinsicElementalFunction Floor [(Var 2 a2)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x3: (Variable 2 x3 [a3] Local (IntrinsicElementalFunction Floor [(Var 2 a3)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y1: (Variable 2 y1 [b1] Local (IntrinsicElementalFunction Floor [(Var 2 b1)] 0 (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (IntegerConstant -4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y2: (Variable 2 y2 [b2] Local (IntrinsicElementalFunction Floor [(Var 2 b2)] 0 (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (IntegerConstant -4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y3: (Variable 2 y3 [b3] Local (IntrinsicElementalFunction Floor [(Var 2 b3)] 0 (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (IntegerConstant -4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) floor_02 [] [(If () (LogicalBinOp (LogicalBinOp (IntegerCompare (Var 2 x1) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) Or (IntegerCompare (Var 2 x2) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) Or (IntegerCompare (Var 2 x3) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (LogicalBinOp (IntegerCompare (Var 2 y1) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) Or (IntegerCompare (Var 2 y2) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) Or (IntegerCompare (Var 2 y3) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 x1) (Var 2 x2) (Var 2 x3)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 y1) (Var 2 y2) (Var 2 y3)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-kind_invalid_int_of_int-32727cf.stderr0000664000175000017500000000022615174404631026566 0ustar alastairalastairsemantic error: Kind 3 is not supported for Integer --> tests/errors/kind_invalid_int_of_int.f90:3:13 | 3 | integer(3) :: x | ^ lfortran-0.63.0/tests/reference/run-infer_realloc_disabled_01-25a8068.stderr0000664000175000017500000000036615174404631026622 0ustar alastairalastairruntime error: Array 'x' is not allocated. Allocate it manually or use the '--realloc-lhs-arrays' option to allocate it automatically. --> tests/errors/infer_realloc_disabled_01.f90:3:5 | 3 | x = [1, 2, 3] | ^ 'x' not allocated here lfortran-0.63.0/tests/reference/asr-arrays_01_logical-13e0bd7.stdout0000664000175000017500000007571215174404631025321 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_01_logical: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) arrays_01_logical [] [(Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Logical 4) ColMajor () ) (LogicalNot (ArrayItem (Var 2 a) [(() (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Logical 4) ColMajor () ) (Logical 4) () ) () .false. .false. )] [] ) (If () (LogicalNot (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) [(ErrorStop () )] [] ) (If () (LogicalNot (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (LogicalConstant .false. (Logical 4) ) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 12 (Integer 4) Decimal) (IntegerConstant 14 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 b) [(() (IntegerBinOp (Var 2 i) Sub (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) ())] (Logical 4) ColMajor () ) (LogicalNot (ArrayItem (Var 2 b) [(() (IntegerBinOp (IntegerBinOp (Var 2 i) Sub (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Logical 4) ColMajor () ) (Logical 4) () ) () .false. .false. )] [] ) (If () (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) [(ErrorStop () )] [] ) (If () (LogicalNot (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) [(ErrorStop () )] [] ) (If () (LogicalNot (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Logical 4) ColMajor () ) (LogicalBinOp (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Logical 4) ColMajor () ) And (LogicalConstant .false. (Logical 4) ) (Logical 4) () ) () .false. .false. )] [] ) (If () (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) [(ErrorStop () )] [] ) (If () (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) [(ErrorStop () )] [] ) (If () (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (LogicalBinOp (LogicalBinOp (LogicalBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) Or (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) Or (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) Or (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) () .false. .false. ) (If () (LogicalNot (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) () .false. .false. ) (If () (LogicalNot (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(If () (IntegerCompare (IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () ) Sub (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () ) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) (Integer 4) () ) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Logical 4) ColMajor () ) (LogicalConstant .true. (Logical 4) ) () .false. .false. )] [(Assignment (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Logical 4) ColMajor () ) (LogicalConstant .false. (Logical 4) ) () .false. .false. )] )] [] )] [] ) (If () (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) [(ErrorStop () )] [] ) (If () (LogicalNot (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalNot (ArrayItem (Var 2 c) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ArrayItem (Var 2 c) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-kind_invalid_int_of_complex-16f8004.stderr0000664000175000017500000000023215174404631027353 0ustar alastairalastairsemantic error: Kind 6 is not supported for Complex --> tests/errors/kind_invalid_int_of_complex.f90:3:13 | 3 | complex(6) :: x | ^ lfortran-0.63.0/tests/reference/ast_f90-subroutine4-97a10ca.json0000664000175000017500000000074115174404631024406 0ustar alastairalastair{ "basename": "ast_f90-subroutine4-97a10ca", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/subroutine4.f90", "infile_hash": "06ca8a1c322b25fe9280c43f558f6fa92e1a4843b6f6b77e206fdf4e", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-subroutine4-97a10ca.stdout", "stdout_hash": "7365a34e3119440421689d70b57349810f249c0b112f567e6eb81d38", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-character_parameter_padding_trimming-ea91653.stdout0000664000175000017500000004713115174404631031340 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { character_parameter_padding_trimming: (Program (SymbolTable 2 { p_pad: (Variable 2 p_pad [] Local (ArrayConstant 12 ["2 ", "2 ", "2 "] (Array (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] PointerArray ) ColMajor ) (ArrayConstant 12 ["2 ", "2 ", "2 "] (Array (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] PointerArray ) ColMajor ) Parameter (Array (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p_trim: (Variable 2 p_trim [] Local (ArrayConstant 3 ["2", "2", "2"] (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] PointerArray ) ColMajor ) (ArrayConstant 3 ["2", "2", "2"] (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] PointerArray ) ColMajor ) Parameter (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x_pad: (Variable 2 x_pad [] Local (StringConstant "apple" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "apple " (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x_trim: (Variable 2 x_trim [] Local (StringConstant "apple" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "ap" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y_pad: (Variable 2 y_pad [] Local (StringConstant "Ball" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "Ball " (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y_trim: (Variable 2 y_trim [] Local (StringConstant "Ball" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "Bal" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z_pad: (Variable 2 z_pad [x_pad y_pad] Local (IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(Var 2 x_pad) (Var 2 y_pad)] 0 (String 1 (IntegerConstant 18 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "apple Ball " (String 1 (IntegerConstant 18 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (Var 2 x_pad)] 0 (String 1 (IntegerConstant 26 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "apple Ball apple " (String 1 (IntegerConstant 26 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "apple Ball apple " (String 1 (IntegerConstant 30 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 30 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z_trim: (Variable 2 z_trim [x_trim y_trim] Local (IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(Var 2 x_trim) (Var 2 y_trim)] 0 (String 1 (IntegerConstant 5 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "apBal" (String 1 (IntegerConstant 5 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (Var 2 x_trim)] 0 (String 1 (IntegerConstant 7 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "apBalap" (String 1 (IntegerConstant 7 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "apBal" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) character_parameter_padding_trimming [] [(Print (IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(StringConstant "|" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 x_pad)] 0 (String 1 (IntegerConstant 9 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "|apple " (String 1 (IntegerConstant 9 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "|" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 10 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "|apple |" (String 1 (IntegerConstant 10 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) ) (Print (Var 2 y_pad) ) (Print (StringFormat () [(Var 2 p_pad)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (Var 2 x_trim) ) (Print (Var 2 y_trim) ) (Print (Var 2 z_trim) ) (Print (StringFormat () [(Var 2 p_trim)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-program_01-4418962.stdout0000664000175000017500000000150515174404631024236 0ustar alastairalastairprogram program_01 implicit none integer, parameter :: dp = kind(0.d0) real(dp) :: a integer :: i print *, "Normal random numbers:" do i = 1, 10 call rand(a) print *, a end do contains subroutine rand(x) ! Returns a psuedorandom scalar drawn from the standard normal distribution. ! ! [1] Marsaglia, G., & Bray, T. A. (1964). A Convenient Method for ! Generating Normal Variables. SIAM Review, 6(3), 260–264. real(dp), intent(out) :: x logical, save :: first = .true. real(dp), save :: u(2) real(dp) :: r2 if (first) then do call random_number(u) u = 2*u - 1 r2 = sum(u**2) if (r2 < 1 .and. r2 > 0) then exit end if end do u = u*sqrt((-2)*log(r2)/r2) x = u(1) else x = u(2) end if first = .not. first end subroutine rand end program program_01 lfortran-0.63.0/tests/reference/asr_preprocess-cpp8-edc2b52.stderr0000664000175000017500000000022615174404631025173 0ustar alastairalastairsemantic error: Variable 'abcx' is not declared --> tests/errors/cpp8.f90:12:12 | 12 | print *, abcx | ^^^^ 'abcx' is undeclared lfortran-0.63.0/tests/reference/llvm-expr5-00f7fd9.stdout0000664000175000017500000000305415174404631023256 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca i32, align 4 store i32 25, i32* %x, align 4 %2 = load i32, i32* %x, align 4 %3 = icmp eq i32 %2, 25 br i1 %3, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_expr_05 FINALIZE_SYMTABLE_expr_05: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) lfortran-0.63.0/tests/reference/asr-c_f_pointer_02-97865d6.stderr0000664000175000017500000000033615174404631024454 0ustar alastairalastairsemantic error: shape array passed to c_f_pointer must be of rank 1 but given rank is 2 --> tests/errors/c_f_pointer_02.f90:6:34 | 6 | call c_f_pointer(queries, x, shape) | ^^^^^ lfortran-0.63.0/tests/reference/llvm-bin_op_real_dp-224f1cf.stdout0000664000175000017500000000556615174404631025151 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [12 x i8] c"R4,R8,R4,R8\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %u = alloca double, align 8 %v = alloca double, align 8 %x = alloca float, align 4 %zero = alloca float, align 4 store float 0x3FC24924A0000000, float* %zero, align 4 store double 0x3FC2492492492492, double* %u, align 8 store double 0x3FC2492492492492, double* %v, align 8 store float 0x3FC24924A0000000, float* %x, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, float* %zero, double* %v, float* %x, double* %u) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_bin_op_real_dp FINALIZE_SYMTABLE_bin_op_real_dp: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/ast_f90-format_02-3deee60.stdout0000664000175000017500000000016215174404631024350 0ustar alastairalastairprogram format_02 implicit none integer :: i6, format(3) i6 = 2 format(i6) = 3 1 format(i6) end program format_02 lfortran-0.63.0/tests/reference/asr-implicit13-56e851c.json0000664000175000017500000000106615174404631023355 0ustar alastairalastair{ "basename": "asr-implicit13-56e851c", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit13.f90", "infile_hash": "846836e213592204557603a57b6f7420ebd88db79c59d7a369174c36", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit13-56e851c.stdout", "stdout_hash": "32504333e9ca41cf5b269b9ac9290e6bb85c10259ebe53dfe196eba2", "stderr": "asr-implicit13-56e851c.stderr", "stderr_hash": "1c317cb7ffa7ec9485863562f58b639bdf60dca66cc82b65e6a7c57b", "returncode": 0 }lfortran-0.63.0/tests/reference/c-case_06-ecc9f3c.json0000664000175000017500000000071415174404631022472 0ustar alastairalastair{ "basename": "c-case_06-ecc9f3c", "cmd": "lfortran --no-color --show-c {infile}", "infile": "tests/../integration_tests/case_06.f90", "infile_hash": "3987983e4c8d162530bceffbbce0bd7d038b1f794655c222c47ad714", "outfile": null, "outfile_hash": null, "stdout": "c-case_06-ecc9f3c.stdout", "stdout_hash": "8e19967ceedef2f6dbbf7f2e51a9ea288093f820c09e381d8822f3e7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-types_04-92449d7.stdout0000664000175000017500000000636315174404631023537 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %r = alloca float, align 4 %x = alloca float, align 4 store float 1.500000e+00, float* %r, align 4 store i32 2, i32* %i, align 4 %2 = load i32, i32* %i, align 4 %3 = load i32, i32* %i, align 4 %4 = mul i32 %2, %3 %5 = sitofp i32 %4 to float store float %5, float* %x, align 4 %6 = load float, float* %r, align 4 %7 = load float, float* %r, align 4 %8 = fmul float %6, %7 store float %8, float* %x, align 4 %9 = load i32, i32* %i, align 4 %10 = sitofp i32 %9 to float %11 = load float, float* %r, align 4 %12 = fmul float %10, %11 store float %12, float* %x, align 4 %13 = load float, float* %r, align 4 %14 = load i32, i32* %i, align 4 %15 = sitofp i32 %14 to float %16 = fmul float %13, %15 store float %16, float* %x, align 4 %17 = load i32, i32* %i, align 4 %18 = load i32, i32* %i, align 4 %19 = add i32 %17, %18 %20 = sitofp i32 %19 to float store float %20, float* %x, align 4 %21 = load float, float* %r, align 4 %22 = load float, float* %r, align 4 %23 = fadd float %21, %22 store float %23, float* %x, align 4 %24 = load float, float* %r, align 4 %25 = load i32, i32* %i, align 4 %26 = sitofp i32 %25 to float %27 = fadd float %24, %26 store float %27, float* %x, align 4 %28 = load i32, i32* %i, align 4 %29 = sitofp i32 %28 to float %30 = load float, float* %r, align 4 %31 = fadd float %29, %30 store float %31, float* %x, align 4 %32 = load i32, i32* %i, align 4 %33 = load i32, i32* %i, align 4 %34 = sub i32 %32, %33 %35 = sitofp i32 %34 to float store float %35, float* %x, align 4 %36 = load float, float* %r, align 4 %37 = load float, float* %r, align 4 %38 = fsub float %36, %37 store float %38, float* %x, align 4 %39 = load float, float* %r, align 4 %40 = load i32, i32* %i, align 4 %41 = sitofp i32 %40 to float %42 = fsub float %39, %41 store float %42, float* %x, align 4 %43 = load i32, i32* %i, align 4 %44 = sitofp i32 %43 to float %45 = load float, float* %r, align 4 %46 = fsub float %44, %45 store float %46, float* %x, align 4 %47 = load i32, i32* %i, align 4 %48 = load i32, i32* %i, align 4 %49 = sdiv i32 %47, %48 %50 = sitofp i32 %49 to float store float %50, float* %x, align 4 %51 = load float, float* %r, align 4 %52 = load float, float* %r, align 4 %53 = fdiv float %51, %52 store float %53, float* %x, align 4 %54 = load i32, i32* %i, align 4 %55 = sitofp i32 %54 to float %56 = load float, float* %r, align 4 %57 = fdiv float %55, %56 store float %57, float* %x, align 4 %58 = load float, float* %r, align 4 %59 = load i32, i32* %i, align 4 %60 = sitofp i32 %59 to float %61 = fdiv float %58, %60 store float %61, float* %x, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_types_04 FINALIZE_SYMTABLE_types_04: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-implicit_typing4-c338b90.json0000664000175000017500000000111615174404631024656 0ustar alastairalastair{ "basename": "asr-implicit_typing4-c338b90", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit_typing4.f90", "infile_hash": "d21435f596cf1ccd2166742ff835bedb255e7b9cd1df878a3b041834", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_typing4-c338b90.stdout", "stdout_hash": "67ee32a803bff7c0685f650a4132759d2a24f4416a3897fae30afa3a", "stderr": "asr-implicit_typing4-c338b90.stderr", "stderr_hash": "8ff5644fd7cfa11e1ae5b3467201231583bf45ab58a69e68bd1fd1e8", "returncode": 0 }././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootlfortran-0.63.0/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-modules_39-906d6cb.jsonlfortran-0.63.0/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-module0000664000175000017500000000123415174404631034775 0ustar alastairalastair{ "basename": "pass_pass_array_by_data_transform_optional_argument_functions-modules_39-906d6cb", "cmd": "lfortran --pass=pass_array_by_data,transform_optional_argument_functions --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_39.f90", "infile_hash": "f7ccaf8b5a3d38f726e5e5ea8fbd529c12fe8f7ce34e85944c882db7", "outfile": null, "outfile_hash": null, "stdout": "pass_pass_array_by_data_transform_optional_argument_functions-modules_39-906d6cb.stdout", "stdout_hash": "0888240fc9a9eb926a9bd2b090f99f7cc86c9434118765b5bb86d34c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-interface_01-587eedf.stdout0000664000175000017500000001271415174404631024363 0ustar alastairalastair(TranslationUnit [(Module interface_01_mod (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Interface (InterfaceHeaderName a ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [a1] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [a2] [(SimpleAttribute AttrModule )] () )] )] [] [(Subroutine a1 [(a)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () )] [(Assignment 0 a (+ a 1) () )] [] [] ) (Subroutine a2 [(a)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () )] [(Assignment 0 a (+ a 1) () )] [] [] )] ) (Program interface_01 () [(Use [] interface_01_mod [(UseSymbol a () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(r [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 i 5 () ) (SubroutineCall 0 a [] [(() i () 0)] [] [] () ) (If 0 () (/= i 6) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 r 6 () ) (SubroutineCall 0 a [] [(() r () 0)] [] [] () ) (If 0 () (/= r 7) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 i 7 () ) (SubroutineCall 0 a [] [(() i () 0)] [] [] () ) (If 0 () (/= i 8) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/asr-forall_01-11937e6.json0000664000175000017500000000074515174404631023100 0ustar alastairalastair{ "basename": "asr-forall_01-11937e6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/forall_01.f90", "infile_hash": "a482aaee28abbbe45149c269745483f2ede65c21ea57212e6a647019", "outfile": null, "outfile_hash": null, "stdout": "asr-forall_01-11937e6.stdout", "stdout_hash": "a9126ec8c4c0a1f69f042a80edf2bd1e22e8f101f7873827d4de1194", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-entry_06-b57385d.json0000664000175000017500000000074215174404631023046 0ustar alastairalastair{ "basename": "asr-entry_06-b57385d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/entry_06.f90", "infile_hash": "5135312696cc44e7912fe519e31778e0e4b2cb992cdd2c3c63bca0c9", "outfile": null, "outfile_hash": null, "stdout": "asr-entry_06-b57385d.stdout", "stdout_hash": "f898c6e323b923fc689cd3cc26d07765e535bc5c6b06e429c0c9459f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixed_form_without_newline-d50219b.stdout0000664000175000017500000000121315174404631027360 0ustar alastairalastair(TranslationUnit [(Program example () [] [] [(Declaration (AttrType TypeCharacter [(len 2 Value)] () () None ) [] [(x [] [] () () None ())] () )] [(Assignment 0 x (String "Hi" ()) () ) (Print 0 () [x] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-cmplx_01-89b858d.stderr0000664000175000017500000000023115174404631023360 0ustar alastairalastairsemantic error: Missing actual argument 'x' in call to 'cmplx' --> tests/errors/cmplx_01.f90:3:9 | 3 | a = cmplx(y = 2) | ^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-use1-56851d0.stdout0000664000175000017500000000230015174404631022533 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [(Use [] iso_c_binding [(UseSymbol c_loc () ) (UseSymbol c_f_pointer () )] .true. () )] [] [] [] [(Print 0 () [(String "OK" ())] () )] [] [] ) (Function g [] [(AttrType TypeInteger [] () () None )] () () () [(Use [] iso_c_binding [(UseSymbol c_loc () ) (UseSymbol c_f_pointer () )] .true. () )] [] [] [] [(Print 0 () [(String "OK" ())] () ) (Assignment 0 g 5 () )] [] [] )] ) lfortran-0.63.0/tests/reference/ast-contains1-58ed60a.json0000664000175000017500000000074615174404631023360 0ustar alastairalastair{ "basename": "ast-contains1-58ed60a", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/contains1.f", "infile_hash": "92f1f8d63ec16274e9b2680055f36a28bebc56ec8a04644d16c150ec", "outfile": null, "outfile_hash": null, "stdout": "ast-contains1-58ed60a.stdout", "stdout_hash": "021a035e85f816203564704e049a624ee2e494f3d750f54989570f07", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_simple_02-35381bd.stdout0000664000175000017500000043252315174404631025434 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_simple_02: (Program (SymbolTable 14 { cast_r: (ExternalSymbol 14 cast_r 2 cast_r template_simple_02_m [] cast_r Public ), generic_sum: (ExternalSymbol 14 generic_sum 2 generic_sum template_simple_02_m [] generic_sum Public ), operator_r: (ExternalSymbol 14 operator_r 2 operator_r template_simple_02_m [] operator_r Public ), test_template: (ExternalSymbol 14 test_template 2 test_template template_simple_02_m [] test_template Public ) }) template_simple_02 [template_simple_02_m] [(SubroutineCall 14 test_template () [] () .false. )] ), template_simple_02_m: (Module (SymbolTable 2 { cast_integer: (Function (SymbolTable 7 { arg: (Variable 7 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 7 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast_integer (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 7 arg)] [(Assignment (Var 7 res) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 7 res) Private .true. .true. () ), cast_r: (Requirement (SymbolTable 5 { cast: (Function (SymbolTable 6 { arg: (Variable 6 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 6 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 6 arg)] [] (Var 6 res) Private .true. .true. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast_r [t cast] [] ), cast_real: (Function (SymbolTable 8 { arg: (Variable 8 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 8 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast_real (FunctionType [(Integer 4)] (Real 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 8 arg)] [(Assignment (Var 8 res) (RealConstant 0.000000 (Real 4) ) () .false. .false. )] (Var 8 res) Private .true. .true. () ), generic_sum: (Template (SymbolTable 9 { add: (Function (SymbolTable 10 { lhs: (Variable 10 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 10 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 10 rhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 10 lhs) (Var 10 rhs)] [] (Var 10 res) Private .true. .true. () ), cast: (Function (SymbolTable 11 { arg: (Variable 11 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 11 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 11 arg)] [] (Var 11 res) Private .true. .true. () ), generic_sum: (Function (SymbolTable 12 { arr: (Variable 12 arr [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 12 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 12 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 12 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) generic_sum (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast add] [(Var 12 arr)] [(Assignment (Var 12 n) (ArraySize (Var 12 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 12 res) (FunctionCall 9 cast () [((IntegerConstant 0 (Integer 4) Decimal))] (TypeParameter t ) () () ) () .false. .false. ) (If () (IntegerCompare (Var 12 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 12 res) (ArrayItem (Var 12 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 12 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 12 n) ()) [(Assignment (Var 12 res) (FunctionCall 9 add () [((Var 12 res)) ((ArrayItem (Var 12 arr) [(() (Var 12 i) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) () .false. .false. )] [] )] [] )] (Var 12 res) Public .true. .true. () ), t: (Variable 9 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) generic_sum [t add cast] [(Require operator_r [t add] ) (Require cast_r [t cast] )] ), operator_r: (Requirement (SymbolTable 3 { binary_func: (Function (SymbolTable 4 { lhs: (Variable 4 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 4 res [] ReturnVar () () Default (TypeParameter v ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 4 rhs [] In () () Default (TypeParameter u ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) binary_func (FunctionType [(TypeParameter t ) (TypeParameter u )] (TypeParameter v ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 4 lhs) (Var 4 rhs)] [] (Var 4 res) Private .true. .true. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u: (Variable 3 u [] In () () Default (TypeParameter u ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 3 v [] In () () Default (TypeParameter v ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) operator_r [t u v binary_func] [] ), test_template: (Function (SymbolTable 13 { __instantiated_generic_sum: (Function (SymbolTable 16 { arr: (Variable 16 arr [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 16 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 16 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 16 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __instantiated_generic_sum (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_integer ~add_intrinsic] [(Var 16 arr)] [(Assignment (Var 16 n) (ArraySize (Var 16 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 16 res) (FunctionCall 2 cast_integer () [((IntegerConstant 0 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 16 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 16 res) (ArrayItem (Var 16 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 16 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 16 n) ()) [(Assignment (Var 16 res) (FunctionCall 13 ~add_intrinsic () [((Var 16 res)) ((ArrayItem (Var 16 arr) [(() (Var 16 i) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) () .false. .false. )] [] )] [] )] (Var 16 res) Public .true. .true. () ), __instantiated_generic_sum1: (Function (SymbolTable 18 { arr: (Variable 18 arr [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 18 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 18 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 18 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __instantiated_generic_sum1 (FunctionType [(Array (Real 4) [(() ())] DescriptorArray )] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_real ~add_intrinsic1] [(Var 18 arr)] [(Assignment (Var 18 n) (ArraySize (Var 18 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 18 res) (FunctionCall 2 cast_real () [((IntegerConstant 0 (Integer 4) Decimal))] (Real 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 18 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 18 res) (ArrayItem (Var 18 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 18 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 18 n) ()) [(Assignment (Var 18 res) (FunctionCall 13 ~add_intrinsic1 () [((Var 18 res)) ((ArrayItem (Var 18 arr) [(() (Var 18 i) ())] (Real 4) ColMajor () ))] (Real 4) () () ) () .false. .false. )] [] )] [] )] (Var 18 res) Public .true. .true. () ), __instantiated_generic_sum2: (Function (SymbolTable 19 { arr: (Variable 19 arr [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 19 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 19 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 19 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __instantiated_generic_sum2 (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_integer ~add_intrinsic] [(Var 19 arr)] [(Assignment (Var 19 n) (ArraySize (Var 19 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 19 res) (FunctionCall 2 cast_integer () [((IntegerConstant 0 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 19 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 19 res) (ArrayItem (Var 19 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 19 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 19 n) ()) [(Assignment (Var 19 res) (FunctionCall 13 ~add_intrinsic () [((Var 19 res)) ((ArrayItem (Var 19 arr) [(() (Var 19 i) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) () .false. .false. )] [] )] [] )] (Var 19 res) Public .true. .true. () ), a_i: (Variable 13 a_i [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a_r: (Variable 13 a_r [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 13 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s_i: (Variable 13 s_i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s_r: (Variable 13 s_r [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~add: (CustomOperator 13 ~add [13 ~add_intrinsic 13 ~add_intrinsic1] Public ), ~add_intrinsic: (Function (SymbolTable 15 { arg0: (Variable 15 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 15 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 15 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 15 arg0) (Var 15 arg1)] [(Assignment (Var 15 ret) (IntegerBinOp (Var 15 arg0) Add (Var 15 arg1) (Integer 4) () ) () .false. .false. )] (Var 15 ret) Public .false. .true. () ), ~add_intrinsic1: (Function (SymbolTable 17 { arg0: (Variable 17 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 17 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 17 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic1 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 17 arg0) (Var 17 arg1)] [(Assignment (Var 17 ret) (RealBinOp (Var 17 arg0) Add (Var 17 arg1) (Real 4) () ) () .false. .false. )] (Var 17 ret) Public .false. .true. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(DoLoop () ((Var 13 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 13 a_i) () (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) ) ()) [(Assignment (ArrayItem (Var 13 a_i) [(() (Var 13 i) ())] (Integer 4) ColMajor () ) (Var 13 i) () .false. .false. ) (Assignment (ArrayItem (Var 13 a_r) [(() (Var 13 i) ())] (Real 4) ColMajor () ) (Cast (Var 13 i) IntegerToReal (Real 4) () () ) () .false. .false. )] [] ) (Assignment (Var 13 s_i) (FunctionCall 13 __instantiated_generic_sum () [((ArrayPhysicalCast (Var 13 a_i) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 13 s_r) (FunctionCall 13 __instantiated_generic_sum1 () [((ArrayPhysicalCast (Var 13 a_r) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Real 4) () () ) () .false. .false. ) (Assignment (Var 13 s_i) (FunctionCall 13 __instantiated_generic_sum2 () [((ArrayPhysicalCast (Var 13 a_i) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 13 s_i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 13 s_r)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_simple_02_m () [template_simple_02_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor6-c43df4d.stdout0000664000175000017500000001025115174404631027160 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor6: (Program (SymbolTable 2 { }) preprocessor6 [] [(Print (StringConstant "1a" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1b" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "2a" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "2b" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1b" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "10" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1a0" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1ab" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1ac" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1c" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "10" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1a0" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1aa" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1ac" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1c" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-do_concurrent1-74bde45.json0000664000175000017500000000074615174404631024406 0ustar alastairalastair{ "basename": "asr-do_concurrent1-74bde45", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/do_concurrent1.f90", "infile_hash": "11d2f455926ea0469a0cefd4547a8df57c57d57a3c836c87f04ef3dc", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-do_concurrent1-74bde45.stderr", "stderr_hash": "9fd50196024a6f988e64b93331be1f4e244183f9b31b4ae5f3908653", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-program_without_line_cc-b84ba02.stderr0000664000175000017500000000052315174404631026676 0ustar alastairalastairsyntax error: Expected program end --> tests/errors/program_without_line_cc.f90:1:1 - 2:8 | 1 | print *, "OK" | ^^^^^^^^^^^^^... ... | 2 | contains | ...^^^^^^^^ semantic error: Variable 'contains' is not declared --> tests/errors/program_without_line_cc.f90:2:1 | 2 | contains | ^^^^^^^^ 'contains' is undeclared lfortran-0.63.0/tests/reference/asr-implicit_interface_allocatable_array-38d4afe.json0000664000175000017500000000106615174404631031110 0ustar alastairalastair{ "basename": "asr-implicit_interface_allocatable_array-38d4afe", "cmd": "lfortran --show-asr --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/implicit_interface_allocatable_array.f90", "infile_hash": "a9a653a2021fb69c16b0b6a01c642010adcbb420c5a2936c34ebd6a1", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_interface_allocatable_array-38d4afe.stdout", "stdout_hash": "fd3ace414274e77f8bb870d27d2f88fe954ced23ceadf16928507eea", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-subroutine5-0e48a69.stdout0000664000175000017500000000012515174404631024546 0ustar alastairalastairfunction add(a::Float32, b::Float32, c::Base.RefValue{Float32}) c[] = a + b end lfortran-0.63.0/tests/reference/cpp-kokkos_program1-1d79f7a.json0000664000175000017500000000072515174404631024570 0ustar alastairalastair{ "basename": "cpp-kokkos_program1-1d79f7a", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/kokkos_program1.f90", "infile_hash": "81575b3ab7fd1a2dc16c67f0a5ff241d9057fed389befd1c3084d6ea", "outfile": null, "outfile_hash": null, "stdout": "cpp-kokkos_program1-1d79f7a.stdout", "stdout_hash": "7ac638e8146f048bd5444436ee2b2ac4f85ffa7a1d791cf526adacb4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-print_12-a2450d8.json0000664000175000017500000000071215174404631023040 0ustar alastairalastair{ "basename": "run-print_12-a2450d8", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/print_12.f90", "infile_hash": "287e0dfc85f6da9fa31789b0458119a40f3b84c3d43c0a9365aeb3df", "outfile": null, "outfile_hash": null, "stdout": "run-print_12-a2450d8.stdout", "stdout_hash": "480bf8473b4a1ddaa2f81a261074b09a3b57b1948c8d423bbe1d7a4c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_call_01-e42aa0d.stderr0000664000175000017500000000034015174404631025150 0ustar alastairalastairsemantic error: Cannot call 'xub' as a procedure; it is a variable. Use --implicit-interface to enable implicit procedure interfaces. --> tests/errors/implicit_call_01.f90:4:5 | 4 | call xub (i) | ^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-infer_first_assignment_conflict_01-a1c38bb.stderr0000664000175000017500000000022415174404631030772 0ustar alastairalastairsemantic error: Only String Pointer can be assigned to String --> tests/errors/infer_first_assignment_conflict_01.f90:2:1 | 2 | x = 1 | ^^^^^ lfortran-0.63.0/tests/reference/run-read_40-72baf22.stdout0000664000175000017500000000002015174404631023237 0ustar alastairalastairProgram ending. lfortran-0.63.0/tests/reference/julia-block_02-1362742.stderr0000664000175000017500000000026315174404631023471 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/block_02.f90:7:14 | 7 | IF (A.EQ.15) GO TO 1 | ^^^^ help: write this as '==' lfortran-0.63.0/tests/reference/ast-array7-b9de38f.json0000664000175000017500000000070715174404631022753 0ustar alastairalastair{ "basename": "ast-array7-b9de38f", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/array7.f90", "infile_hash": "e8a4f12c21d75c3eee1ba6cc82227a262f41e146ccfd34c1ffb12612", "outfile": null, "outfile_hash": null, "stdout": "ast-array7-b9de38f.stdout", "stdout_hash": "deea556a927bab2a181ab718f525d699a049741fc3c5ef4ac5989a8b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/lookup_name-lookup_name3-a06a374.json0000664000175000017500000000075415174404631025507 0ustar alastairalastair{ "basename": "lookup_name-lookup_name3-a06a374", "cmd": "lfortran --lookup-name --no-color {infile} -o {outfile}", "infile": "tests/lookup_name3.f90", "infile_hash": "7181224f94a1ed635176c4414c3a6f8a8b82712a2f3834d4f9fb74b3", "outfile": null, "outfile_hash": null, "stdout": "lookup_name-lookup_name3-a06a374.stdout", "stdout_hash": "5ec01df86d0ab3ac57f61290c0bdd5a71dbcbcd60b159b1d7e39664f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-return1-517cbf1.stdout0000664000175000017500000000320315174404631023415 0ustar alastairalastair(TranslationUnit [(Subroutine example [(s)] [] () (TriviaNode [] [(EndOfLine) (Comment "! Syntax check only" )] ) [] [] [] [(Declaration (AttrType TypeCharacter [] () () None ) [] [(s [] [] 32 () Asterisk ())] () )] [(Write 0 [(()) (())] [] [s] () ) (Return 0 () () )] [] [] ) (Subroutine example1 [(i) (a) (b) (c)] [] () () [] [] [] [] [(If 0 () (== i a) [(Return 0 1 () )] [] () () () ) (If 0 () (== i b) [(Return 0 2 () )] [] () () () ) (If 0 () (== i c) [(Return 0 3 () )] [] () () () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-character1-8679f4b.stdout0000664000175000017500000001730615174404631024002 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { xerror: (Function (SymbolTable 2 { mess: (Variable 2 mess [] Unspecified () () Default (FunctionType [(Integer 4)] (String 1 () AssumedLength DescriptorString) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) 2 ~implicit_interface_mess_3 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~implicit_interface_mess_3: (Function (SymbolTable 3 { ~implicit_interface_mess_3_arg_0: (Variable 3 ~implicit_interface_mess_3_arg_0 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~implicit_interface_mess_3_return_var: (Variable 3 ~implicit_interface_mess_3_return_var [] ReturnVar () () Default (String 1 () AssumedLength DescriptorString) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~implicit_interface_mess_3 (FunctionType [(Integer 4)] (String 1 () AssumedLength DescriptorString) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 ~implicit_interface_mess_3_arg_0)] [] (Var 3 ~implicit_interface_mess_3_return_var) Public .false. .false. () ) }) xerror (FunctionType [(FunctionType [(Integer 4)] (String 1 () AssumedLength DescriptorString) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 mess)] [(Print (FunctionCall 2 mess () [((IntegerConstant 1 (Integer 4) Decimal))] (String 1 () AssumedLength DescriptorString) () () ) ) (Return)] () Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/julia-expr_07-d5a6b4c.stdout0000664000175000017500000000017015174404631023676 0ustar alastairalastairfunction main() local x::Float32 = 3.29999995231628418e+00 + 6.00000000000000000e+00 println(x) end main() lfortran-0.63.0/tests/reference/ast-global_scope3-45d8bdc.stdout0000664000175000017500000000061215174404631024617 0ustar alastairalastair(TranslationUnit [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () ) (Assignment 0 x 6 () ) (Assignment 0 x (+ x 1) () )] ) lfortran-0.63.0/tests/reference/asr_openmp-openmp_45-1c0e790.json0000664000175000017500000000077415174404631024560 0ustar alastairalastair{ "basename": "asr_openmp-openmp_45-1c0e790", "cmd": "lfortran --show-asr --no-color --openmp {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_45.f90", "infile_hash": "839bc36c5653bbe5c190abafd9760c2cfc94d2a5da73b93c480c61cd", "outfile": null, "outfile_hash": null, "stdout": "asr_openmp-openmp_45-1c0e790.stdout", "stdout_hash": "b24ec054cb9384bee8bd90534279e57d0b45c1190ef9e7f88030b0e5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-formatTesting-889403a.json0000664000175000017500000000071315174404631024162 0ustar alastairalastair{ "basename": "run-formatTesting-889403a", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/formatTesting.f90", "infile_hash": "fcb5d75f1257b518b8fb71e979444738eba9931484ba15fd671cb0db", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-formatTesting-889403a.stderr", "stderr_hash": "24057424695e00241a9c4cf96807eb8691d7e2e221931b4a7fef4d52", "returncode": 1 }lfortran-0.63.0/tests/reference/cpp-subroutine4-e2840c9.json0000664000175000017500000000071115174404631023651 0ustar alastairalastair{ "basename": "cpp-subroutine4-e2840c9", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/subroutine4.f90", "infile_hash": "06ca8a1c322b25fe9280c43f558f6fa92e1a4843b6f6b77e206fdf4e", "outfile": null, "outfile_hash": null, "stdout": "cpp-subroutine4-e2840c9.stdout", "stdout_hash": "6d5772b55884ee2a29331dc0be5f811a0a104070ba91471ca1670aa2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-string_negative_start_index-643e9c0.stderr0000664000175000017500000000026115174404631027516 0ustar alastairalastairsemantic error: The first index in string section is less than 1 --> tests/errors/string_negative_start_index.f90:5:15 | 5 | print*, "s:", s(-1:4) | ^^^^^^^ lfortran-0.63.0/tests/reference/ast-expr2-52dd466.stdout0000664000175000017500000000004115174404631023000 0ustar alastairalastair(TranslationUnit [(+ 5 3)] ) lfortran-0.63.0/tests/reference/asr-complex_dp_param-b21353f.json0000664000175000017500000000077215174404631024701 0ustar alastairalastair{ "basename": "asr-complex_dp_param-b21353f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_dp_param.f90", "infile_hash": "0d4d9eaf5bcc2cee6a8b57ee6a66b5a10ced2edf6d64b5d2e2a0bcb8", "outfile": null, "outfile_hash": null, "stdout": "asr-complex_dp_param-b21353f.stdout", "stdout_hash": "5baaba4e9175490abcd4eff65eed59accad3ef20c818065bb597d0f8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-case_01-929583e.json0000664000175000017500000000073715174404631022550 0ustar alastairalastair{ "basename": "ast-case_01-929583e", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_01.f90", "infile_hash": "003a23367180e7f228e7e4ef5a6dfdb6749801b29ccf2002e2559e41", "outfile": null, "outfile_hash": null, "stdout": "ast-case_01-929583e.stdout", "stdout_hash": "d8110d26d6efba1a8d1b7d7ee0ae2c5bb42a1a824d883f080b33d08e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_global_stmts-expr3-c9c0bd7.json0000664000175000017500000000076415174404631025532 0ustar alastairalastair{ "basename": "pass_global_stmts-expr3-c9c0bd7", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr3.f90", "infile_hash": "a4aed9754913f48e6b1982a698f85476db8324f2d2efe0b1a2de88f5", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-expr3-c9c0bd7.stdout", "stdout_hash": "d2171beaf4deaf8cf9f0505da229312d2a27e60c06145b65e58b46fe", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-global_scope9-bdf4288.stdout0000664000175000017500000000112015174404631024727 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." @x = global i64 0 define i64 @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i64, align 8 store i64 6, i64* @x, align 8 %0 = load i64, i64* @x, align 8 store i64 %0, i64* %__lfortran_evaluate_11, align 8 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return %1 = load i64, i64* %__lfortran_evaluate_11, align 8 ret i64 %1 } lfortran-0.63.0/tests/reference/ast-where1-c237415.json0000664000175000017500000000070715174404631022505 0ustar alastairalastair{ "basename": "ast-where1-c237415", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/where1.f90", "infile_hash": "cd5e0b85aa90c2bb3dff3fdc1e1e563b601c361a4b57ba16db0bf051", "outfile": null, "outfile_hash": null, "stdout": "ast-where1-c237415.stdout", "stdout_hash": "73fb69d0990b9844dd3d2849ea2807edf6b55e781d9ffa13031a226b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-do6-02ec641.json0000664000175000017500000000067615174404631022063 0ustar alastairalastair{ "basename": "ast-do6-02ec641", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do6.f90", "infile_hash": "47676f4b10ae9b305cb49d9ea4650d1e255a2b3506ab9001fc8f402c", "outfile": null, "outfile_hash": null, "stdout": "ast-do6-02ec641.stdout", "stdout_hash": "c607ebe43c0cb0237f5d50329ffa53b788ec4ca65e39c4d316eb8ecb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-derived_types_03-3580222.stdout0000664000175000017500000001230715174404631024747 0ustar alastairalastair(TranslationUnit [(Program derived_types_03 (TriviaNode [(EndOfLine) (Comment "! AST only" )] [] ) [] [] [] [(DoLoop 0 () 0 nn 1 ndiag () [(Assignment 0 ing len [(diag [(() nn () 0)])] () ) (Allocate 0 [(() (FuncCallOrArray cell_id [(diag [(() nn () 0)])] [(() ing () 0)] [] [] [] ) () 0)] [(STAT ierr)] () ) (If 0 () (/= ierr 0) [(Return 0 () () )] [] () () () ) (Assignment 0 ndpwds (+ ndpwds (FuncCallOrArray SIZE [] [(() cell_id [(diag [(() nn () 0)])] () 0)] [] [] [] )) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DoLoop 0 () 0 k 1 nz () [(DoLoop 0 () 0 j 1 ny () [(DoLoop 0 () 0 i 1 ichunk () [(Assignment 0 nn (- (+ (+ i j) k) 2) () ) (Assignment 0 (FuncCallOrArray indx [] [(() nn () 0)] [] [] [] ) (+ (FuncCallOrArray indx [] [(() nn () 0)] [] [] [] ) 1) () ) (Assignment 0 ing (FuncCallOrArray indx [] [(() nn () 0)] [] [] [] ) () ) (Assignment 0 ic [(diag [(() nn () 0)]) (cell_id [(() ing () 0)])] i () ) (Assignment 0 j [(diag [(() nn () 0)]) (cell_id [(() ing () 0)])] j () ) (Assignment 0 k [(diag [(() nn () 0)]) (cell_id [(() ing () 0)])] k () )] () () )] () () )] () () )] [] )] ) lfortran-0.63.0/tests/reference/ast-if1-6e771a0.stdout0000664000175000017500000000350215174404631022420 0ustar alastairalastair(TranslationUnit [(Program if1 () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(Assignment 0 i 5 () ) (If 0 () (== i 5) [(Print 0 () [(String "correct" ())] () )] [] () () () ) (If 0 () (== i 6) [(Print 0 () [(String "incorrect" ())] () )] [] () () () ) (Assignment 0 i (u- 2) () ) (Assignment 40 i (+ i 1) () ) (IfArithmetic 0 () i 50 60 70 () ) (Print 50 () [(String "i < 0" ())] () ) (GoTo 0 () 40 [] () ) (Print 60 () [(String "i == 0" ())] () ) (GoTo 0 () 40 [] () ) (Print 70 () [(String "i > 0" ())] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-modules_15b-09f8335.json0000664000175000017500000000075315174404631023441 0ustar alastairalastair{ "basename": "asr-modules_15b-09f8335", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_15b.f90", "infile_hash": "fbbd085f2ba045d9c713c3e0edf41b67cc3f20b94a53364bf3b9f51c", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_15b-09f8335.stdout", "stdout_hash": "b24b6ee4e32d6188f8e1a70a1e937276360f20fa66159769b77bb8a2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor10-6279d1f.json0000664000175000017500000000077315174404631026541 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor10-6279d1f", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor10.f90", "infile_hash": "128670b190f1e59f40192f15434c3b8d7a85c15fbc901a72e7f7ebc3", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor10-6279d1f.stdout", "stdout_hash": "8620f523932d44584173618faae87ae481b65da55c369ebcd19e1754", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_travel_01b-db46a56.stdout0000664000175000017500000055110415174404631025660 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_travel_01b: (Program (SymbolTable 21 { operation: (ExternalSymbol 21 operation 2 operation template_travel_01b_m [] operation Public ), test_template: (ExternalSymbol 21 test_template 2 test_template template_travel_01b_m [] test_template Public ), travel_tmpl: (ExternalSymbol 21 travel_tmpl 2 travel_tmpl template_travel_01b_m [] travel_tmpl Public ) }) template_travel_01b [template_travel_01b_m] [(SubroutineCall 21 test_template () [] () .false. )] ), template_travel_01b_m: (Module (SymbolTable 2 { operation: (Requirement (SymbolTable 3 { a: (Variable 3 a [] In () () Default (TypeParameter a ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] In () () Default (TypeParameter b ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 3 c [] In () () Default (TypeParameter c ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), op: (Function (SymbolTable 4 { l: (Variable 4 l [] In () () Default (TypeParameter a ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 4 r [] In () () Default (TypeParameter b ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 4 res [] ReturnVar () () Default (TypeParameter c ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) op (FunctionType [(TypeParameter a ) (TypeParameter b )] (TypeParameter c ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 4 l) (Var 4 r)] [] (Var 4 res) Private .true. .true. () ) }) operation [a b c op] [] ), test_template: (Function (SymbolTable 12 { avg_integer_s_from_s: (Function (SymbolTable 20 { avg: (Variable 20 avg [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d1: (Variable 20 d1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d2: (Variable 20 d2 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s1: (Variable 20 s1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s2: (Variable 20 s2 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) avg_integer_s_from_s (FunctionType [(Integer 4) (Integer 4) (Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [~div_intrinsic1 avg_integer_s_from_t] [(Var 20 d1) (Var 20 s1) (Var 20 d2) (Var 20 s2)] [(Assignment (Var 20 avg) (FunctionCall 12 avg_integer_s_from_t () [((Var 20 d1)) ((FunctionCall 12 ~div_intrinsic1 () [((Var 20 d1)) ((Var 20 s1))] (Integer 4) () () )) ((Var 20 d2)) ((FunctionCall 12 ~div_intrinsic1 () [((Var 20 d2)) ((Var 20 s2))] (Integer 4) () () ))] (Integer 4) () () ) () .false. .false. )] (Var 20 avg) Public .true. .true. () ), avg_integer_s_from_t: (Function (SymbolTable 19 { avg: (Variable 19 avg [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d1: (Variable 19 d1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d2: (Variable 19 d2 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t1: (Variable 19 t1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t2: (Variable 19 t2 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) avg_integer_s_from_t (FunctionType [(Integer 4) (Integer 4) (Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [~add_intrinsic1 ~div_intrinsic1] [(Var 19 d1) (Var 19 t1) (Var 19 d2) (Var 19 t2)] [(Assignment (Var 19 avg) (FunctionCall 12 ~div_intrinsic1 () [((FunctionCall 12 ~add_intrinsic1 () [((Var 19 d1)) ((Var 19 d2))] (Integer 4) () () )) ((FunctionCall 12 ~add_intrinsic1 () [((Var 19 t1)) ((Var 19 t2))] (Integer 4) () () ))] (Integer 4) () () ) () .false. .false. )] (Var 19 avg) Public .true. .true. () ), avg_real_s_from_s: (Function (SymbolTable 16 { avg: (Variable 16 avg [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d1: (Variable 16 d1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d2: (Variable 16 d2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s1: (Variable 16 s1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s2: (Variable 16 s2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) avg_real_s_from_s (FunctionType [(Real 4) (Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [~div_intrinsic avg_real_s_from_t] [(Var 16 d1) (Var 16 s1) (Var 16 d2) (Var 16 s2)] [(Assignment (Var 16 avg) (FunctionCall 12 avg_real_s_from_t () [((Var 16 d1)) ((FunctionCall 12 ~div_intrinsic () [((Var 16 d1)) ((Var 16 s1))] (Real 4) () () )) ((Var 16 d2)) ((FunctionCall 12 ~div_intrinsic () [((Var 16 d2)) ((Var 16 s2))] (Real 4) () () ))] (Real 4) () () ) () .false. .false. )] (Var 16 avg) Public .true. .true. () ), avg_real_s_from_t: (Function (SymbolTable 15 { avg: (Variable 15 avg [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d1: (Variable 15 d1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d2: (Variable 15 d2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t1: (Variable 15 t1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t2: (Variable 15 t2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) avg_real_s_from_t (FunctionType [(Real 4) (Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [~add_intrinsic ~div_intrinsic] [(Var 15 d1) (Var 15 t1) (Var 15 d2) (Var 15 t2)] [(Assignment (Var 15 avg) (FunctionCall 12 ~div_intrinsic () [((FunctionCall 12 ~add_intrinsic () [((Var 15 d1)) ((Var 15 d2))] (Real 4) () () )) ((FunctionCall 12 ~add_intrinsic () [((Var 15 t1)) ((Var 15 t2))] (Real 4) () () ))] (Real 4) () () ) () .false. .false. )] (Var 15 avg) Public .true. .true. () ), i1: (Variable 12 i1 [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i2: (Variable 12 i2 [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s1: (Variable 12 s1 [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s2: (Variable 12 s2 [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~add: (CustomOperator 12 ~add [12 ~add_intrinsic 12 ~add_intrinsic1] Public ), ~add_intrinsic: (Function (SymbolTable 13 { arg0: (Variable 13 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 13 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 13 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 13 arg0) (Var 13 arg1)] [(Assignment (Var 13 ret) (RealBinOp (Var 13 arg0) Add (Var 13 arg1) (Real 4) () ) () .false. .false. )] (Var 13 ret) Public .true. .true. () ), ~add_intrinsic1: (Function (SymbolTable 17 { arg0: (Variable 17 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 17 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 17 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic1 (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 17 arg0) (Var 17 arg1)] [(Assignment (Var 17 ret) (IntegerBinOp (Var 17 arg0) Add (Var 17 arg1) (Integer 4) () ) () .false. .false. )] (Var 17 ret) Public .true. .true. () ), ~div: (CustomOperator 12 ~div [12 ~div_intrinsic 12 ~div_intrinsic1] Public ), ~div_intrinsic: (Function (SymbolTable 14 { arg0: (Variable 14 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 14 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 14 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~div_intrinsic (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 14 arg0) (Var 14 arg1)] [(Assignment (Var 14 ret) (RealBinOp (Var 14 arg0) Div (Var 14 arg1) (Real 4) () ) () .false. .false. )] (Var 14 ret) Public .true. .true. () ), ~div_intrinsic1: (Function (SymbolTable 18 { arg0: (Variable 18 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 18 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 18 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~div_intrinsic1 (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 18 arg0) (Var 18 arg1)] [(Assignment (Var 18 ret) (IntegerBinOp (Var 18 arg0) Div (Var 18 arg1) (Integer 4) () ) () .false. .false. )] (Var 18 ret) Public .true. .true. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 12 s1) (FunctionCall 12 avg_real_s_from_t () [((RealConstant 1.000000 (Real 4) )) ((RealConstant 3.000000 (Real 4) )) ((RealConstant 1.500000 (Real 4) )) ((RealConstant 4.000000 (Real 4) ))] (Real 4) () () ) () .false. .false. ) (Assignment (Var 12 s2) (FunctionCall 12 avg_real_s_from_s () [((RealConstant 1.100000 (Real 4) )) ((Var 12 s1)) ((RealConstant 2.000000 (Real 4) )) ((Var 12 s1))] (Real 4) () () ) () .false. .false. ) (Assignment (Var 12 i1) (FunctionCall 12 avg_integer_s_from_t () [((IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 20 (Integer 4) Decimal)) ((IntegerConstant 4 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 12 i2) (FunctionCall 12 avg_integer_s_from_s () [((IntegerConstant 1 (Integer 4) Decimal)) ((Var 12 i1)) ((IntegerConstant 15 (Integer 4) Decimal)) ((Var 12 i1))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "s1=" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 12 s1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "s2=" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 12 s2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "i1=" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 12 i1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "i2=" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 12 i2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), travel_tmpl: (Template (SymbolTable 5 { avg_s_from_s: (Function (SymbolTable 11 { avg: (Variable 11 avg [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d1: (Variable 11 d1 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d2: (Variable 11 d2 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s1: (Variable 11 s1 [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s2: (Variable 11 s2 [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) avg_s_from_s (FunctionType [(TypeParameter d ) (TypeParameter s ) (TypeParameter d ) (TypeParameter s )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [d_divided_by_s avg_s_from_t] [(Var 11 d1) (Var 11 s1) (Var 11 d2) (Var 11 s2)] [(Assignment (Var 11 avg) (FunctionCall 5 avg_s_from_t () [((Var 11 d1)) ((FunctionCall 5 d_divided_by_s () [((Var 11 d1)) ((Var 11 s1))] (TypeParameter t ) () () )) ((Var 11 d2)) ((FunctionCall 5 d_divided_by_s () [((Var 11 d2)) ((Var 11 s2))] (TypeParameter t ) () () ))] (TypeParameter s ) () () ) () .false. .false. )] (Var 11 avg) Public .true. .true. () ), avg_s_from_t: (Function (SymbolTable 10 { avg: (Variable 10 avg [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d1: (Variable 10 d1 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d2: (Variable 10 d2 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t1: (Variable 10 t1 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t2: (Variable 10 t2 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) avg_s_from_t (FunctionType [(TypeParameter d ) (TypeParameter t ) (TypeParameter d ) (TypeParameter t )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [plus_d plus_t d_divided_by_t] [(Var 10 d1) (Var 10 t1) (Var 10 d2) (Var 10 t2)] [(Assignment (Var 10 avg) (FunctionCall 5 d_divided_by_t () [((FunctionCall 5 plus_d () [((Var 10 d1)) ((Var 10 d2))] (TypeParameter d ) () () )) ((FunctionCall 5 plus_t () [((Var 10 t1)) ((Var 10 t2))] (TypeParameter t ) () () ))] (TypeParameter s ) () () ) () .false. .false. )] (Var 10 avg) Public .true. .true. () ), d: (Variable 5 d [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d_divided_by_s: (Function (SymbolTable 9 { l: (Variable 9 l [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 9 r [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 9 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) d_divided_by_s (FunctionType [(TypeParameter d ) (TypeParameter s )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 9 l) (Var 9 r)] [] (Var 9 res) Private .true. .true. () ), d_divided_by_t: (Function (SymbolTable 8 { l: (Variable 8 l [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 8 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 8 res [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) d_divided_by_t (FunctionType [(TypeParameter d ) (TypeParameter t )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 8 l) (Var 8 r)] [] (Var 8 res) Private .true. .true. () ), plus_d: (Function (SymbolTable 6 { l: (Variable 6 l [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 6 r [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 6 res [] ReturnVar () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus_d (FunctionType [(TypeParameter d ) (TypeParameter d )] (TypeParameter d ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 6 l) (Var 6 r)] [] (Var 6 res) Private .true. .true. () ), plus_t: (Function (SymbolTable 7 { l: (Variable 7 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 7 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 7 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 7 l) (Var 7 r)] [] (Var 7 res) Private .true. .true. () ), s: (Variable 5 s [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) travel_tmpl [d t s plus_d plus_t d_divided_by_t d_divided_by_s] [(Require operation [d plus_d] ) (Require operation [t plus_t] ) (Require operation [d t s d_divided_by_t] ) (Require operation [d s t d_divided_by_s] )] ) }) template_travel_01b_m () [template_travel_01b_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-data1-01ffd6c.json0000664000175000017500000000071715174404631023204 0ustar alastairalastair{ "basename": "ast_f90-data1-01ffd6c", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/data1.f90", "infile_hash": "958a14b00f4c624f5f8c444b2e93bcf090a57ee3c44143ec6671b5f6", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-data1-01ffd6c.stdout", "stdout_hash": "21627f18756312556e43b286cdd1671677c03e63cdf6be55e0c5926c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-types_01-dfa3d3c.stdout0000664000175000017500000000136115174404631023616 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { float r; r = 1.00000000000000000e+00; r = 1.50000000000000000e+00; r = 1.00000000000000000e+00; r = (float)(2); r = (double)(3); } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/llvm-while_02-3db2b04.stdout0000664000175000017500000002077715174404631023620 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %j = alloca i32, align 4 store i32 0, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head loop.head: ; preds = %loop.body, %.entry %2 = load i32, i32* %i, align 4 %3 = icmp slt i32 %2, 10 br i1 %3, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %4 = load i32, i32* %i, align 4 %5 = add i32 %4, 1 store i32 %5, i32* %i, align 4 %6 = load i32, i32* %j, align 4 %7 = load i32, i32* %i, align 4 %8 = add i32 %6, %7 store i32 %8, i32* %j, align 4 br label %loop.head loop.end: ; preds = %loop.head %9 = load i32, i32* %j, align 4 %10 = icmp ne i32 %9, 55 br i1 %10, label %then, label %else then: ; preds = %loop.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %loop.end br label %ifcont ifcont: ; preds = %else, %then %11 = load i32, i32* %i, align 4 %12 = icmp ne i32 %11, 10 br i1 %12, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 store i32 0, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head4 loop.head4: ; preds = %ifcont8, %ifcont3 %13 = load i32, i32* %i, align 4 %14 = icmp slt i32 %13, 10 br i1 %14, label %loop.body5, label %loop.end9 loop.body5: ; preds = %loop.head4 %15 = load i32, i32* %i, align 4 %16 = add i32 %15, 1 store i32 %16, i32* %i, align 4 %17 = load i32, i32* %i, align 4 %18 = icmp eq i32 %17, 2 br i1 %18, label %then6, label %else7 then6: ; preds = %loop.body5 br label %loop.end9 unreachable_after_exit: ; No predecessors! br label %ifcont8 else7: ; preds = %loop.body5 br label %ifcont8 ifcont8: ; preds = %else7, %unreachable_after_exit %19 = load i32, i32* %j, align 4 %20 = load i32, i32* %i, align 4 %21 = add i32 %19, %20 store i32 %21, i32* %j, align 4 br label %loop.head4 loop.end9: ; preds = %then6, %loop.head4 %22 = load i32, i32* %j, align 4 %23 = icmp ne i32 %22, 1 br i1 %23, label %then10, label %else11 then10: ; preds = %loop.end9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont12 else11: ; preds = %loop.end9 br label %ifcont12 ifcont12: ; preds = %else11, %then10 %24 = load i32, i32* %i, align 4 %25 = icmp ne i32 %24, 2 br i1 %25, label %then13, label %else14 then13: ; preds = %ifcont12 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont15 else14: ; preds = %ifcont12 br label %ifcont15 ifcont15: ; preds = %else14, %then13 store i32 0, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head16 loop.head16: ; preds = %ifcont20, %then18, %ifcont15 %26 = load i32, i32* %i, align 4 %27 = icmp slt i32 %26, 10 br i1 %27, label %loop.body17, label %loop.end21 loop.body17: ; preds = %loop.head16 %28 = load i32, i32* %i, align 4 %29 = add i32 %28, 1 store i32 %29, i32* %i, align 4 %30 = load i32, i32* %i, align 4 %31 = icmp eq i32 %30, 2 br i1 %31, label %then18, label %else19 then18: ; preds = %loop.body17 br label %loop.head16 unreachable_after_cycle: ; No predecessors! br label %ifcont20 else19: ; preds = %loop.body17 br label %ifcont20 ifcont20: ; preds = %else19, %unreachable_after_cycle %32 = load i32, i32* %j, align 4 %33 = load i32, i32* %i, align 4 %34 = add i32 %32, %33 store i32 %34, i32* %j, align 4 br label %loop.head16 loop.end21: ; preds = %loop.head16 %35 = load i32, i32* %j, align 4 %36 = icmp ne i32 %35, 53 br i1 %36, label %then22, label %else23 then22: ; preds = %loop.end21 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont24 else23: ; preds = %loop.end21 br label %ifcont24 ifcont24: ; preds = %else23, %then22 %37 = load i32, i32* %i, align 4 %38 = icmp ne i32 %37, 10 br i1 %38, label %then25, label %else26 then25: ; preds = %ifcont24 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont27 else26: ; preds = %ifcont24 br label %ifcont27 ifcont27: ; preds = %else26, %then25 br label %return return: ; preds = %ifcont27 br label %FINALIZE_SYMTABLE_while_02 FINALIZE_SYMTABLE_while_02: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) lfortran-0.63.0/tests/reference/asr-template_add_03-43a00f9.stdout0000664000175000017500000015616115174404631024672 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_add_03: (Program (SymbolTable 11 { add_t: (ExternalSymbol 11 add_t 2 add_t template_add_03_m [] add_t Public ), r: (ExternalSymbol 11 r 2 r template_add_03_m [] r Public ), test_template: (ExternalSymbol 11 test_template 2 test_template template_add_03_m [] test_template Public ) }) template_add_03 [template_add_03_m] [(SubroutineCall 11 test_template () [] () .false. )] ), template_add_03_m: (Module (SymbolTable 2 { add_t: (Template (SymbolTable 5 { add_generic: (Function (SymbolTable 7 { x: (Variable 7 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 7 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 7 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_generic (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 7 x) (Var 7 y)] [(Assignment (Var 7 z) (FunctionCall 5 f () [((Var 7 x)) ((Var 7 y))] (TypeParameter t ) () () ) () .false. .false. )] (Var 7 z) Public .true. .true. () ), f: (Function (SymbolTable 6 { x: (Variable 6 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 6 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 6 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 6 x) (Var 6 y)] [] (Var 6 z) Private .true. .true. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_t [t f] [(Require r [t f] )] ), r: (Requirement (SymbolTable 3 { f: (Function (SymbolTable 4 { x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 4 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 z) Private .true. .true. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) r [t f] [] ), test_template: (Function (SymbolTable 8 { add_real: (Function (SymbolTable 10 { x: (Variable 10 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 10 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 10 z [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~add_intrinsic] [(Var 10 x) (Var 10 y)] [(Assignment (Var 10 z) (FunctionCall 8 ~add_intrinsic () [((Var 10 x)) ((Var 10 y))] (Real 4) () () ) () .false. .false. )] (Var 10 z) Public .true. .true. () ), x: (Variable 8 x [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 8 y [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~add: (CustomOperator 8 ~add [8 ~add_intrinsic] Public ), ~add_intrinsic: (Function (SymbolTable 9 { arg0: (Variable 9 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 9 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 9 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 9 arg0) (Var 9 arg1)] [(Assignment (Var 9 ret) (RealBinOp (Var 9 arg0) Add (Var 9 arg1) (Real 4) () ) () .false. .false. )] (Var 9 ret) Public .true. .true. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 8 x) (RealConstant 5.100000 (Real 4) ) () .false. .false. ) (Assignment (Var 8 y) (RealConstant 7.200000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "The result is " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 8 add_real () [((Var 8 x)) ((Var 8 y))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (FunctionCall 8 add_real () [((Var 8 x)) ((Var 8 y))] (Real 4) () () ) Sub (RealConstant 12.300000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] () Public .false. .false. () ) }) template_add_03_m () [template_add_03_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-fixedform_data-650e309.json0000664000175000017500000000075215174404631024271 0ustar alastairalastair{ "basename": "ast-fixedform_data-650e309", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_data.f", "infile_hash": "6fe89c2b6280304d8c329af8dade86a21e78f1189e2c58fe9cd6916b", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_data-650e309.stdout", "stdout_hash": "1d4c551e6cd8a923885aa6c3bfb8ef73afb84fcb771530fd8f296b7d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-print2-785df93.json0000664000175000017500000000072215174404631023304 0ustar alastairalastair{ "basename": "ast_f90-print2-785df93", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/print2.f90", "infile_hash": "6adc0ae191ec271ea11820e431167bc842948bb91bf0b54fe86090f7", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-print2-785df93.stdout", "stdout_hash": "339b33d70462d35147ac0857de0da142cbd503ec76403f1a13ce8546", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format_39-1b897aa.stdout0000664000175000017500000000010515174404631023637 0ustar alastairalastair3.E+0 0.E+0 10.E+0 3.E+3 30.E+0 391.E+0 31.E+3 -5.E+0 12.E-6 100.E+9 lfortran-0.63.0/tests/reference/asr-boz_01-dedad59.stdout0000664000175000017500000003126515174404631023265 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { boz_01: (Program (SymbolTable 2 { boz_1: (Variable 2 boz_1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), boz_2: (Variable 2 boz_2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), boz_3: (Variable 2 boz_3 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), boz_4: (Variable 2 boz_4 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), boz_5: (Variable 2 boz_5 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), boz_6: (Variable 2 boz_6 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) boz_01 [] [(Assignment (Var 2 boz_1) (IntrinsicElementalFunction Int [(IntegerConstant 93 (Integer 4) Binary)] 0 (Integer 4) (IntegerConstant 93 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 boz_2) (IntrinsicElementalFunction Int [(IntegerConstant 1255 (Integer 4) Octal)] 0 (Integer 4) (IntegerConstant 1255 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 boz_3) (IntrinsicElementalFunction Int [(IntegerConstant 2748 (Integer 4) Hex)] 0 (Integer 4) (IntegerConstant 2748 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 boz_4) (IntrinsicElementalFunction Int [(IntegerConstant 2541551403008843505 (Integer 4) Hex)] 0 (Integer 4) (IntegerConstant 2541551403008843505 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 boz_5) (IntrinsicElementalFunction Int [(IntegerConstant 2541551403008843505 (Integer 4) Hex)] 0 (Integer 4) (IntegerConstant 2541551403008843505 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 boz_6) (IntrinsicElementalFunction Real [(RealConstant 0.000000 (Real 4) )] 0 (Real 4) (RealConstant 0.000000 (Real 4) ) ) () .false. .false. ) (If () (IntegerCompare (Var 2 boz_4) NotEq (Var 2 boz_5) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 boz_1) NotEq (IntegerConstant 93 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 boz_2) NotEq (IntegerConstant 1255 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 boz_3) NotEq (IntegerConstant 2748 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 boz_4) NotEq (IntegerConstant 180150001 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 boz_5) NotEq (IntegerConstant 180150001 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 boz_1) (Var 2 boz_2) (Var 2 boz_3) (Var 2 boz_4) (Var 2 boz_5) (Var 2 boz_6)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-continue_compilation_ff_1-c2d5950.json0000664000175000017500000000121115174404631026477 0ustar alastairalastair{ "basename": "asr-continue_compilation_ff_1-c2d5950", "cmd": "lfortran --fixed-form --continue-compilation --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/continue_compilation_ff_1.f", "infile_hash": "47b9434d82b9f62214407204f5a77e005bbb6cdfbb117f341cb3bd4d", "outfile": null, "outfile_hash": null, "stdout": "asr-continue_compilation_ff_1-c2d5950.stdout", "stdout_hash": "d069df191d31c892d195ea086cf2c907dc5581e3ed165798844bc5d7", "stderr": "asr-continue_compilation_ff_1-c2d5950.stderr", "stderr_hash": "3ca681f4e3ed20bcdecafa1505112e5f90026b0b10633230bd11eb6f", "returncode": 1 }lfortran-0.63.0/tests/reference/llvm-execute_command_line-0e9cd63.json0000664000175000017500000000076415174404631026014 0ustar alastairalastair{ "basename": "llvm-execute_command_line-0e9cd63", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/execute_command_line.f90", "infile_hash": "7a0db461a1008c62034590b9709aea78a170f8cfe3b3d9181dddee66", "outfile": null, "outfile_hash": null, "stdout": "llvm-execute_command_line-0e9cd63.stdout", "stdout_hash": "f2ea6c742324a963e43e392fca6847b1dee12d61f139e39d0265ff19", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_typing1-7a0ea7d.json0000664000175000017500000000101115174404631025002 0ustar alastairalastair{ "basename": "asr-implicit_typing1-7a0ea7d", "cmd": "lfortran --std=f23 --show-asr --disable-implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit_typing1.f90", "infile_hash": "e6d1a0c4cb70b6dec80c447e80d4567c3a25f29c7164e956ddfba662", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit_typing1-7a0ea7d.stderr", "stderr_hash": "6341b8dd45d0fd22c074531e4e4fa272486a24c10288fb90b558cf7e", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-arrays_03_func-7c8d572.stdout0000664000175000017500000003441315174404631024573 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_03_func: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), mysum: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 3 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mysum (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Assignment (Var 3 r) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 3 a) () (Integer 4) () ) ()) [(Assignment (Var 3 r) (IntegerBinOp (Var 3 r) Add (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4) ColMajor () ) (Integer 4) () ) () .false. .false. )] [] )] (Var 3 r) Public .true. .true. () ), s: (Variable 2 s [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) arrays_03_func [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 2 x) () (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) ) ()) [(Assignment (ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. )] [] ) (Assignment (Var 2 s) (FunctionCall 2 mysum () [((ArrayPhysicalCast (Var 2 x) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 2 s)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 s) NotEq (IntegerConstant 55 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-init1-a99a704.stderr0000664000175000017500000000024615174404631022754 0ustar alastairalastairsyntax error: Invalid syntax for variable initialization (try inserting '::' after the type) --> tests/errors/init1.f90:2:1 | 2 | integer x = 1 | ^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-duplicate_module_procedures-3eaed23.stderr0000664000175000017500000000035415174404631027630 0ustar alastairalastairsemantic error: Entity test_01 is already present in the interface --> tests/errors/duplicate_module_procedures.f90:4:8 | 4 | module procedure test_01, test_01, test_01 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-operator_overloading_08-52825a6.stdout0000664000175000017500000004125015174404631026416 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { operator_overloading_08: (Program (SymbolTable 5 { 1_custom_int_value: (ExternalSymbol 5 1_custom_int_value 3 value custom_int [] value Public ), a: (Variable 5 a [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 5 custom_int Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), custom_div: (ExternalSymbol 5 custom_div 2 custom_div operator_overloading_08_mod1 [] custom_div Public ), custom_int: (ExternalSymbol 5 custom_int 2 custom_int operator_overloading_08_mod1 [] custom_int Public ), ~div: (ExternalSymbol 5 ~div 2 ~div operator_overloading_08_mod1 [] ~div Public ) }) operator_overloading_08 [operator_overloading_08_mod1] [(Assignment (StructInstanceMember (Var 5 a) 5 1_custom_int_value (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(OverloadedBinOp (Var 5 a) Div (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () (FunctionCall 5 custom_div 5 ~div [((Var 5 a)) ((IntegerConstant 0 (Integer 4) Decimal))] (StructType [(Integer 4)] [] .true. .false. ) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), operator_overloading_08_mod1: (Module (SymbolTable 2 { custom_div: (Function (SymbolTable 4 { 1_custom_int_value: (ExternalSymbol 4 1_custom_int_value 3 value custom_int [] value Public ), a: (Variable 4 a [] In () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 custom_int Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 4 res [] ReturnVar () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 custom_int Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) custom_div (FunctionType [(StructType [(Integer 4)] [] .true. .false. ) (Integer 4)] (StructType [(Integer 4)] [] .true. .false. ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a) (Var 4 b)] [(Assignment (StructInstanceMember (Var 4 res) 4 1_custom_int_value (Integer 4) () ) (IntegerBinOp (StructInstanceMember (Var 4 a) 4 1_custom_int_value (Integer 4) () ) Div (IntegerBinOp (Var 4 b) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) () .false. .false. )] (Var 4 res) Public .true. .true. () ), custom_int: (Struct (SymbolTable 3 { value: (Variable 3 value [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) custom_int (StructType [(Integer 4)] [] .true. .false. ) [] [value] [] Source Public .false. .false. [] () () [] ), ~div: (CustomOperator 2 ~div [2 custom_div] Public ) }) operator_overloading_08_mod1 () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-parameter_05-916c4d8.stdout0000664000175000017500000001256615174404631024245 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { paramter_05: (Program (SymbolTable 2 { x: (Variable 2 x [] Local (Cast (RealConstant 5.000000 (Real 4) ) RealToInteger (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) () ) (IntegerConstant 5 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (RealConstant 5.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 5.000000 (Real 8) ) () ) (RealConstant 5.000000 (Real 8) ) Parameter (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) paramter_05 [] [(Print (StringFormat () [(Var 2 x) (Var 2 y) (Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-goto_02-48f3a02.stderr0000664000175000017500000000103115174404631023641 0ustar alastairalastairstyle suggestion: Use '>' instead of '.gt.' --> tests/../integration_tests/goto_02.f90:10:12 | 10 | if (A.GT.2) go to 95 | ^^^^ help: write this as '>' style suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/goto_02.f90:13:12 | 13 | if (A.EQ.1) go to 10 | ^^^^ help: write this as '==' style suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/goto_02.f90:25:12 | 25 | if (A.EQ.2) go to 99 | ^^^^ help: write this as '==' lfortran-0.63.0/tests/reference/ast-format_02-1ba2faf.json0000664000175000017500000000074515174404631023377 0ustar alastairalastair{ "basename": "ast-format_02-1ba2faf", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/format_02.f90", "infile_hash": "dcd9a1c68ffaff4df93d7299219c47741479f92da85570eb771f05b3", "outfile": null, "outfile_hash": null, "stdout": "ast-format_02-1ba2faf.stdout", "stdout_hash": "2eb18974f199efd31646dad32db608facf4c98ec2efe98a90ff55349", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-types_04-054550e.json0000664000175000017500000000072515174404631022764 0ustar alastairalastair{ "basename": "wat-types_04-054550e", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/types_04.f90", "infile_hash": "da21466af87608d5d323360a130e0a5542261d98fabaeebb5adc16d3", "outfile": null, "outfile_hash": null, "stdout": "wat-types_04-054550e.stdout", "stdout_hash": "3c10352c3e82dc8c629b030759d05559b9519fcda9afa7bcfada5351", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-complex_dp-ec165b1.json0000664000175000017500000000075015174404631023576 0ustar alastairalastair{ "basename": "asr-complex_dp-ec165b1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_dp.f90", "infile_hash": "2ab8a19155ace703dc52c1f26d2ecea0db08a49637452b31871a40b2", "outfile": null, "outfile_hash": null, "stdout": "asr-complex_dp-ec165b1.stdout", "stdout_hash": "7557c5fd317fead1c925432412b7435c3e30de3de27923f4eb3b3d82", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-array_shape_05-429216b.json0000664000175000017500000000071615174404631024132 0ustar alastairalastair{ "basename": "run-array_shape_05-429216b", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_shape_05.f90", "infile_hash": "275313a71e6777c0d439f8f5c29d24c89ad089be510848d42db10643", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_shape_05-429216b.stderr", "stderr_hash": "9fe5da5f4eb7dafc7abe8435133ceacac60c0a1e45d192384fd6df61", "returncode": 1 }lfortran-0.63.0/tests/reference/llvm-global_scope2-ccffd68.stdout0000664000175000017500000000062015174404631025066 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." @x = global i32 0 define void @__lfortran_evaluate_1() { .entry: store i32 6, i32* @x, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return ret void } lfortran-0.63.0/tests/reference/ast-fixedform_doloop-d9fb32d.stdout0000664000175000017500000000343015174404631025443 0ustar alastairalastair(TranslationUnit [(Program main () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(k [] [] () () None ()) (l [] [] () () None ()) (m [] [] () () None ()) (n [] [] () () None ())] () )] [(DoLoop 0 () 0 k 1 10 () [(Print 0 () [k] () )] () () ) (DoLoop 0 () 80 l 1 10 () [(Print 0 () [l] () )] () () ) (DoLoop 0 () 800 m 1 10 () [(Print 0 () [m] () )] () () ) (DoLoop 0 () 8000 n 1 10 () [(Print 0 () [n] () )] () () )] [] )] ) lfortran-0.63.0/tests/reference/run-format3-ee61b31.json0000664000175000017500000000066215174404631023040 0ustar alastairalastair{ "basename": "run-format3-ee61b31", "cmd": "lfortran --no-color {infile}", "infile": "tests/format3.f90", "infile_hash": "416c1b82f5461120638fce27597e42a9721aed16668f49fc146f94d3", "outfile": null, "outfile_hash": null, "stdout": "run-format3-ee61b31.stdout", "stdout_hash": "478638af760ebc36887ce7aaca13365ca0500aceeeb8b18a1d915a5a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_array_01-691b151.json0000664000175000017500000000077515174404631024626 0ustar alastairalastair{ "basename": "asr-template_array_01-691b151", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_array_01.f90", "infile_hash": "6756a93056719ca3ede501254efbeec0d93fdeaf8378cddc308bb5b5", "outfile": null, "outfile_hash": null, "stdout": "asr-template_array_01-691b151.stdout", "stdout_hash": "47ab4ac7d6f5c6673cfce63d472ddc854c5960576ec7f3d27a589778", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_17-17c3d46.json0000664000175000017500000000077215174404631024552 0ustar alastairalastair{ "basename": "asr-derived_types_17-17c3d46", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_17.f90", "infile_hash": "28433c27ffce2fdaa063d1519081b83d3567a558abf87f26d64558dc", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_17-17c3d46.stdout", "stdout_hash": "76a8269f4b2a205cd38ee50cca4e16d2bd2c8e3bc42e8e671b44c623", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_array_04b-94baaad.stdout0000664000175000017500000007303715174404631025642 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_array_04b: (Program (SymbolTable 7 { default_behavior: (ExternalSymbol 7 default_behavior 2 default_behavior template_array_04b_m [] default_behavior Public ), swap: (ExternalSymbol 7 swap 2 swap template_array_04b_m [] swap Public ), test_reverse: (ExternalSymbol 7 test_reverse 2 test_reverse template_array_04b_m [] test_reverse Public ) }) template_array_04b [template_array_04b_m] [(SubroutineCall 7 test_reverse () [] () .false. )] ), template_array_04b_m: (Module (SymbolTable 2 { default_behavior: (Requirement (SymbolTable 3 { t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) default_behavior [t] [] ), swap: (Template (SymbolTable 4 { swap: (Function (SymbolTable 5 { tmp: (Variable 5 tmp [] Local () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 5 x [] InOut () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 5 y [] InOut () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) swap (FunctionType [(TypeParameter t ) (TypeParameter t )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x) (Var 5 y)] [(Assignment (Var 5 tmp) (Var 5 x) () .false. .false. ) (Assignment (Var 5 x) (Var 5 y) () .false. .false. ) (Assignment (Var 5 y) (Var 5 tmp) () .false. .false. )] () Private .true. .true. () ), t: (Variable 4 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) swap [t] [(Require default_behavior [t] )] ), test_reverse: (Function (SymbolTable 6 { __instantiated_swap: (Function (SymbolTable 8 { tmp: (Variable 8 tmp [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 8 x [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 8 y [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __instantiated_swap (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 x) (Var 8 y)] [(Assignment (Var 8 tmp) (Var 8 x) () .false. .false. ) (Assignment (Var 8 x) (Var 8 y) () .false. .false. ) (Assignment (Var 8 y) (Var 8 tmp) () .false. .false. )] () Private .true. .true. () ), a: (Variable 6 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_reverse (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 6 a) (ArrayConstant 8 [1, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Print (StringFormat () [(Var 6 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 6 __instantiated_swap () [((ArrayItem (Var 6 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 6 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ))] () .false. ) (Print (StringFormat () [(Var 6 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_array_04b_m () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/llvm-logical3-4bbf8ea.json0000664000175000017500000000106515174404631023473 0ustar alastairalastair{ "basename": "llvm-logical3-4bbf8ea", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/logical3.f90", "infile_hash": "d7f7994a85ee59f1b3b80060886eeeb7390f9733461bd9349e4bb7c0", "outfile": null, "outfile_hash": null, "stdout": "llvm-logical3-4bbf8ea.stdout", "stdout_hash": "51992588f6050e2b97ae924a6fffa0a2e49a9f8f71a97257b468051a", "stderr": "llvm-logical3-4bbf8ea.stderr", "stderr_hash": "d7e28e54d198e14f86c18ab4c4ad128018b9bc6523fb945b05607a57", "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-operator_overloading_03-d9fd880.json0000664000175000017500000000102215174404631026370 0ustar alastairalastair{ "basename": "llvm-operator_overloading_03-d9fd880", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/operator_overloading_03.f90", "infile_hash": "3340e64f6a134b16739a00f54087bb1816f1e6876ec32e6170275e19", "outfile": null, "outfile_hash": null, "stdout": "llvm-operator_overloading_03-d9fd880.stdout", "stdout_hash": "e49ea24acbbe3c5549c7b610b53425a27592f520ea6950adbcd8db47", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-common_13-fa7cbf0.json0000664000175000017500000000074515174404631023405 0ustar alastairalastair{ "basename": "asr-common_13-fa7cbf0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/common_13.f90", "infile_hash": "c06b84e80775a9b491a5bb86de409be83180247a70c7c75af9e92a4e", "outfile": null, "outfile_hash": null, "stdout": "asr-common_13-fa7cbf0.stdout", "stdout_hash": "60a80aec88002b6178d26a4c7af4966c57530efe544fa43bad1ce018", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-include1-f5bbd80.stdout0000664000175000017500000000321315174404631023604 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [] [] [] [] [(DoLoop 0 () 1 i 1 2 () [(DoLoop 0 () 2 j 1 3 () [(DoLoop 0 () 2 k 1 4 () [(Continue 2 () )] () () )] () () ) (Continue 1 () )] () () )] [] [] ) (Subroutine g [] [] () () [] [] [] [] [(DoLoop 0 () 0 i 1 2 () [(GoTo 0 () 1 [] () ) (Continue 1 () )] () () )] [] [] ) (Program main () [] [] [] [(SubroutineCall 0 f [] [] [] [] () )] [] )] ) lfortran-0.63.0/tests/reference/llvm-recursion_02-76da7b3.stdout0000664000175000017500000003065415174404631024531 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @__module___lcompilers_created__nested_context__sub1__x = global i32 0 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [12 x i8] c"S-DESC-7,I4\00", align 1 @string_const_data = private constant [7 x i8] c"before:" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([7 x i8], [7 x i8]* @string_const_data, i32 0, i32 0), i64 7 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [12 x i8] c"S-DESC-6,I4\00", align 1 @string_const_data.2 = private constant [6 x i8] c"after:" @string_const.3 = private global %string_descriptor <{ i8* getelementptr inbounds ([6 x i8], [6 x i8]* @string_const_data.2, i32 0, i32 0), i64 6 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.4 = private unnamed_addr constant [12 x i8] c"S-DESC-9,I4\00", align 1 @string_const_data.5 = private constant [9 x i8] c"x in getx" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([9 x i8], [9 x i8]* @string_const_data.5, i32 0, i32 0), i64 9 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.7 = private constant [7 x i8] c"in sub1" @string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([7 x i8], [7 x i8]* @string_const_data.7, i32 0, i32 0), i64 7 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.9 = private unnamed_addr constant [12 x i8] c"S-DESC-3,I4\00", align 1 @string_const_data.10 = private constant [3 x i8] c"r =" @string_const.11 = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data.10, i32 0, i32 0), i64 3 }> @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @__module_recursion_02_solver(i32 ()* %f, i32* %iter) { .entry: %stringFormat_desc2 = alloca %string_descriptor, align 8 %call_arg_value1 = alloca i32, align 4 %call_arg_value = alloca i32, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %f_val = alloca i32, align 4 %solver = alloca i32, align 4 %1 = call i32 %f() store i32 %1, i32* %f_val, align 4 %2 = alloca i64, align 8 %3 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const, i32* %f_val) %4 = load i64, i64* %2, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 8 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry store i32 2, i32* %call_arg_value, align 4 %13 = load i32, i32* %iter, align 4 %14 = sub i32 %13, 1 store i32 %14, i32* %call_arg_value1, align 4 %15 = call i32 @__module_recursion_02_sub1(i32* %call_arg_value, i32* %call_arg_value1) store i32 %15, i32* %solver, align 4 %16 = call i32 %f() store i32 %16, i32* %f_val, align 4 %17 = alloca i64, align 8 %18 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.1, i32 0, i32 0), i64* %17, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.3, i32* %f_val) %19 = load i64, i64* %17, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0 store i8* %18, i8** %20, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 1 store i64 %19, i64* %21, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0 %23 = load i8*, i8** %22, align 8 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 1 %25 = load i64, i64* %24, align 8 %26 = trunc i64 %25 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %23, i32 %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %27 = icmp eq i8* %18, null br i1 %27, label %free_done4, label %free_nonnull3 free_nonnull3: ; preds = %free_done call void @_lfortran_free_alloc(i8* %0, i8* %18) br label %free_done4 free_done4: ; preds = %free_nonnull3, %free_done br label %return return: ; preds = %free_done4 br label %FINALIZE_SYMTABLE_solver FINALIZE_SYMTABLE_solver: ; preds = %return %28 = load i32, i32* %solver, align 4 ret i32 %28 } declare i32 @f() define i32 @__module_recursion_02_sub1(i32* %y, i32* %iter) { .entry: %sub1 = alloca i32, align 4 %tmp = alloca i32, align 4 %x = alloca i32, align 4 %0 = load i32, i32* %y, align 4 store i32 %0, i32* %x, align 4 %1 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.8, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %1, i32 7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %2 = load i32, i32* %iter, align 4 %3 = icmp eq i32 %2, 1 br i1 %3, label %then, label %else then: ; preds = %.entry store i32 1, i32* %sub1, align 4 br label %return unreachable_after_return: ; No predecessors! br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %unreachable_after_return %4 = load i32, i32* %x, align 4 store i32 %4, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 %5 = call i32 @sub1.__module_recursion_02_getx() store i32 %5, i32* %tmp, align 4 %6 = load i32, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 store i32 %6, i32* %x, align 4 %7 = load i32, i32* %x, align 4 store i32 %7, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 %8 = call i32 @__module_recursion_02_solver(i32 ()* @sub1.__module_recursion_02_getx, i32* %iter) store i32 %8, i32* %sub1, align 4 %9 = load i32, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 store i32 %9, i32* %x, align 4 br label %return return: ; preds = %ifcont, %then br label %FINALIZE_SYMTABLE_sub1 FINALIZE_SYMTABLE_sub1: ; preds = %return %10 = load i32, i32* %sub1, align 4 ret i32 %10 } define i32 @sub1.__module_recursion_02_getx() { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %getx = alloca i32, align 4 %1 = alloca i64, align 8 %2 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.4, i32 0, i32 0), i64* %1, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.6, i32* @__module___lcompilers_created__nested_context__sub1__x) %3 = load i64, i64* %1, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %2, i8** %4, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %3, i64* %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %7 = load i8*, i8** %6, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %9 = load i64, i64* %8, align 8 %10 = trunc i64 %9 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %7, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %11 = icmp eq i8* %2, null br i1 %11, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %2) br label %free_done free_done: ; preds = %free_nonnull, %.entry %12 = load i32, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 store i32 %12, i32* %getx, align 4 br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_getx FINALIZE_SYMTABLE_getx: ; preds = %return %13 = load i32, i32* %getx, align 4 ret i32 %13 } declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() %call_arg_value1 = alloca i32, align 4 %call_arg_value = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %r = alloca i32, align 4 store i32 3, i32* %call_arg_value, align 4 store i32 3, i32* %call_arg_value1, align 4 %3 = call i32 @__module_recursion_02_sub1(i32* %call_arg_value, i32* %call_arg_value1) store i32 %3, i32* %r, align 4 %4 = alloca i64, align 8 %5 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.9, i32 0, i32 0), i64* %4, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.11, i32* %r) %6 = load i64, i64* %4, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %5, i8** %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %6, i64* %8, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %10 = load i8*, i8** %9, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %12 = load i64, i64* %11, align 8 %13 = trunc i64 %12 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %10, i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %14 = icmp eq i8* %5, null br i1 %14, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %5) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-types_04-056d321.stdout0000664000175000017500000003161715174404631023330 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { types_04: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 2 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) types_04 [] [(Assignment (Var 2 r) (RealConstant 1.500000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 i) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (Cast (IntegerBinOp (Var 2 i) Mul (Var 2 i) (Integer 4) () ) IntegerToReal (Real 4) () () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Var 2 r) Mul (Var 2 r) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Cast (Var 2 i) IntegerToReal (Real 4) () () ) Mul (Var 2 r) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Var 2 r) Mul (Cast (Var 2 i) IntegerToReal (Real 4) () () ) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (Cast (IntegerBinOp (Var 2 i) Add (Var 2 i) (Integer 4) () ) IntegerToReal (Real 4) () () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Var 2 r) Add (Var 2 r) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Var 2 r) Add (Cast (Var 2 i) IntegerToReal (Real 4) () () ) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Cast (Var 2 i) IntegerToReal (Real 4) () () ) Add (Var 2 r) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (Cast (IntegerBinOp (Var 2 i) Sub (Var 2 i) (Integer 4) () ) IntegerToReal (Real 4) () () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Var 2 r) Sub (Var 2 r) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Var 2 r) Sub (Cast (Var 2 i) IntegerToReal (Real 4) () () ) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Cast (Var 2 i) IntegerToReal (Real 4) () () ) Sub (Var 2 r) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (Cast (IntegerBinOp (Var 2 i) Div (Var 2 i) (Integer 4) () ) IntegerToReal (Real 4) () () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Var 2 r) Div (Var 2 r) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Cast (Var 2 i) IntegerToReal (Real 4) () () ) Div (Var 2 r) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Var 2 r) Div (Cast (Var 2 i) IntegerToReal (Real 4) () () ) (Real 4) () ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/run-format_25-0bdc4b7.json0000664000175000017500000000071515174404631023341 0ustar alastairalastair{ "basename": "run-format_25-0bdc4b7", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_25.f90", "infile_hash": "cb35907bcd56b0eb47a987a7dea054ef0a376978f17c94d49fa1b90f", "outfile": null, "outfile_hash": null, "stdout": "run-format_25-0bdc4b7.stdout", "stdout_hash": "c16842418a1b5859dc18ab87bcfdaac17a23e7073539f54a7f98378d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-fn4-83c4d1a.json0000664000175000017500000000071115174404631022611 0ustar alastairalastair{ "basename": "ast_f90-fn4-83c4d1a", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/fn4.f90", "infile_hash": "35fb507c50c885547daa8eef3f01aa0be9b3eb6db98d824ad6f51bc9", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-fn4-83c4d1a.stdout", "stdout_hash": "d3a07020fcd3d38933f01299e50000f5eae3e32ee3f21beccbea58b0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_openmp-pragma1-25cfcb2.stdout0000664000175000017500000004301415174404631025003 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a1: (Function (SymbolTable 2 { a: (Variable 2 a [n] In () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [n] Out () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a1 (FunctionType [(Integer 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 n) (Var 2 a) (Var 2 b)] [(OMPRegion ParallelDo [] [(DoLoop () ((Var 2 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 2 n) ()) [(Assignment (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (RealBinOp (RealBinOp (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 4) ColMajor () ) Add (ArrayItem (Var 2 a) [(() (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 4) ColMajor () ) (Real 4) () ) Div (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) (Real 4) () ) () .false. .false. )] [] )] )] () Public .true. .true. () ), parallel_sum: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 3 n [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), partial_sum: (Variable 3 partial_sum [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), total_sum: (Variable 3 total_sum [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) parallel_sum (FunctionType [(Integer 4) (Array (Integer 4) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 n) (Var 3 a)] [(Assignment (Var 3 partial_sum) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 total_sum) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (OMPRegion Parallel [(OMPPrivate [(Var 3 partial_sum)] ) (OMPShared [(Var 3 total_sum)] )] [(OMPRegion Do [] [(DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 3 n) ()) [(Assignment (Var 3 partial_sum) (IntegerBinOp (Var 3 partial_sum) Add (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4) ColMajor () ) (Integer 4) () ) () .false. .false. )] [] )] )] )] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/run-file_open_06-cc72219.json0000664000175000017500000000072615174404631023657 0ustar alastairalastair{ "basename": "run-file_open_06-cc72219", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/file_open_06.f90", "infile_hash": "38c29295a37c9aac5fa968468906167d4e5ae77bcf9aa7cce4be6d1b", "outfile": null, "outfile_hash": null, "stdout": "run-file_open_06-cc72219.stdout", "stdout_hash": "a8b3c28327d978bed230e9f55e67dc389ca40a82fbc5251d574c636e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-subroutine3-9c6f5d1.json0000664000175000017500000000073515174404631023744 0ustar alastairalastair{ "basename": "asr-subroutine3-9c6f5d1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/subroutine3.f90", "infile_hash": "7d760144ce6e5f0307d6d35c1d27ab357dc88df82f61cd5d6058d75f", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-subroutine3-9c6f5d1.stderr", "stderr_hash": "ffe0a4412cffe166df5f25b690125e6886c03e45343fb76b900fd1fa", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-entry_06-b57385d.stdout0000664000175000017500000010430215174404631023414 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { entry_06: (Program (SymbolTable 5 { mvndfn: (Function (SymbolTable 6 { mvndfn: (Variable 6 mvndfn [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), w: (Variable 6 w [] Unspecified () () Default (Array (Real 8) [(() ())] UnboundedPointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mvndfn (FunctionType [(Array (Real 8) [(() ())] UnboundedPointerArray )] (Real 8) Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 w)] [] (Var 6 mvndfn) Public .false. .false. () ), w: (Variable 5 w [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) entry_06 [] [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (FunctionCall 5 mvndfn () [((ArrayPhysicalCast (Var 5 w) FixedSizeArray UnboundedPointerArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] UnboundedPointerArray ) () ))] (Real 8) () () ) Sub (RealConstant 1.200000 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] )] ), mvndfn: (Function (SymbolTable 2 { mvndfn: (Variable 2 mvndfn [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), w: (Variable 2 w [] Unspecified () () Default (Array (Real 8) [(() ())] UnboundedPointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mvndfn (FunctionType [(Array (Real 8) [(() ())] UnboundedPointerArray )] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [mvndfn_main__lcompilers] [(Var 2 w)] [(Assignment (Var 2 mvndfn) (FunctionCall 1 mvndfn_main__lcompilers 1 mvndfn_main__lcompilers [((IntegerConstant 1 (Integer 4) Decimal)) ((Var 2 w))] (Real 8) () () ) () .false. .false. )] (Var 2 mvndfn) Public .true. .true. () ), mvndfn_main__lcompilers: (Function (SymbolTable 4 { entry__lcompilers: (Variable 4 entry__lcompilers [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), mvndfn: (Variable 4 mvndfn [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), mvndfn_main__lcompilers: (Variable 4 mvndfn_main__lcompilers [] ReturnVar () () Default (Real 8) 4 mvndfn Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), w: (Variable 4 w [] Unspecified () () Default (Array (Real 8) [(() ())] UnboundedPointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mvndfn_main__lcompilers (FunctionType [(Integer 4) (Array (Real 8) [(() ())] UnboundedPointerArray )] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 entry__lcompilers) (Var 4 w)] [(If () (IntegerCompare (Var 4 entry__lcompilers) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 1 1 )] [] ) (If () (IntegerCompare (Var 4 entry__lcompilers) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 2 2 )] [] ) (GoToTarget 1 1 ) (Assignment (ArrayItem (Var 4 w) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) (RealConstant 10.900000 (Real 8) ) () .false. .false. ) (Assignment (ArrayItem (Var 4 w) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) (RealConstant 10.900000 (Real 8) ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 4 w) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) Sub (RealConstant 10.900000 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 4 w) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) Sub (RealConstant 10.900000 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 4 mvndfn_main__lcompilers) (RealConstant 1.200000 (Real 8) ) () .false. .false. ) (GoToTarget 2 2 ) (Assignment (ArrayItem (Var 4 w) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) (RealConstant 10.900000 (Real 8) ) () .false. .false. ) (Assignment (ArrayItem (Var 4 w) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) (RealConstant 10.900000 (Real 8) ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 4 w) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) Sub (RealConstant 10.900000 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 4 w) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) Sub (RealConstant 10.900000 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 4 mvndfn_main__lcompilers) (RealConstant 1.200000 (Real 8) ) () .false. .false. )] (Var 4 mvndfn_main__lcompilers) Public .true. .true. () ), mvndnt: (Function (SymbolTable 3 { mvndfn: (Variable 3 mvndfn [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), mvndnt: (Variable 3 mvndnt [] ReturnVar () () Default (Real 8) 3 mvndfn Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), w: (Variable 3 w [] Local () () Default (Pointer (Array (Real 8) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mvndnt (FunctionType [] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [mvndfn_main__lcompilers] [] [(Assignment (Var 3 mvndnt) (FunctionCall 1 mvndfn_main__lcompilers 1 mvndfn_main__lcompilers [((IntegerConstant 2 (Integer 4) Decimal)) ((Var 3 w))] (Real 8) () () ) () .false. .false. )] (Var 3 mvndnt) Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_triple-54fa485.stdout0000664000175000017500000054437315174404631025157 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { math_integer_m: (Module (SymbolTable 2 { add_integer: (Function (SymbolTable 3 { result: (Variable 3 result [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 3 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 y)] [(Assignment (Var 3 result) (IntegerBinOp (Var 3 x) Add (Var 3 y) (Integer 4) () ) () .false. .false. )] (Var 3 result) Public .true. .true. () ), max_integer: (Function (SymbolTable 5 { result: (Variable 5 result [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 5 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 5 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) max_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 5 x) (Var 5 y)] [(Assignment (Var 5 result) (IntrinsicElementalFunction Max [(Var 5 x) (Var 5 y)] 0 (Integer 4) () ) () .false. .false. )] (Var 5 result) Public .true. .true. () ), min_integer: (Function (SymbolTable 6 { result: (Variable 6 result [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 6 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 6 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) min_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 6 x) (Var 6 y)] [(Assignment (Var 6 result) (IntrinsicElementalFunction Min [(Var 6 x) (Var 6 y)] 0 (Integer 4) () ) () .false. .false. )] (Var 6 result) Public .true. .true. () ), minus_integer: (Function (SymbolTable 4 { result: (Variable 4 result [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 4 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) minus_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 x) (Var 4 y)] [(Assignment (Var 4 result) (IntegerBinOp (Var 4 x) Sub (Var 4 y) (Integer 4) () ) () .false. .false. )] (Var 4 result) Public .true. .true. () ), one_integer: (Function (SymbolTable 8 { result: (Variable 8 result [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) one_integer (FunctionType [] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 8 result) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. )] (Var 8 result) Public .true. .true. () ), zero_integer: (Function (SymbolTable 7 { result: (Variable 7 result [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) zero_integer (FunctionType [] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 7 result) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 7 result) Public .true. .true. () ) }) math_integer_m () [] .false. .false. .false. ), math_real_m: (Module (SymbolTable 9 { add_real: (Function (SymbolTable 10 { result: (Variable 10 result [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 10 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 10 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 10 x) (Var 10 y)] [(Assignment (Var 10 result) (RealBinOp (Var 10 x) Add (Var 10 y) (Real 4) () ) () .false. .false. )] (Var 10 result) Public .true. .true. () ), max_real: (Function (SymbolTable 13 { result: (Variable 13 result [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 13 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 13 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) max_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 13 x) (Var 13 y)] [(Assignment (Var 13 result) (IntrinsicElementalFunction Max [(Var 13 x) (Var 13 y)] 0 (Real 4) () ) () .false. .false. )] (Var 13 result) Public .true. .true. () ), min_real: (Function (SymbolTable 14 { result: (Variable 14 result [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 14 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 14 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) min_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 14 x) (Var 14 y)] [(Assignment (Var 14 result) (IntrinsicElementalFunction Min [(Var 14 x) (Var 14 y)] 0 (Real 4) () ) () .false. .false. )] (Var 14 result) Public .true. .true. () ), minus_real: (Function (SymbolTable 11 { result: (Variable 11 result [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 11 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 11 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) minus_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 11 x) (Var 11 y)] [(Assignment (Var 11 result) (RealBinOp (Var 11 x) Sub (Var 11 y) (Real 4) () ) () .false. .false. )] (Var 11 result) Public .true. .true. () ), one_real: (Function (SymbolTable 16 { result: (Variable 16 result [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) one_real (FunctionType [] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 16 result) (RealConstant 1.000000 (Real 4) ) () .false. .false. )] (Var 16 result) Public .true. .true. () ), slash_real: (Function (SymbolTable 12 { result: (Variable 12 result [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 12 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 12 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) slash_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 12 x) (Var 12 y)] [(Assignment (Var 12 result) (RealBinOp (Var 12 x) Div (Var 12 y) (Real 4) () ) () .false. .false. )] (Var 12 result) Public .true. .true. () ), zero_real: (Function (SymbolTable 15 { result: (Variable 15 result [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) zero_real (FunctionType [] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 15 result) (RealConstant 0.000000 (Real 4) ) () .false. .false. )] (Var 15 result) Public .true. .true. () ) }) math_real_m () [] .false. .false. .false. ), template_triple: (Program (SymbolTable 34 { add_integer: (ExternalSymbol 34 add_integer 2 add_integer math_integer_m [] add_integer Public ), add_real: (ExternalSymbol 34 add_real 9 add_real math_real_m [] add_real Public ), magma_r: (ExternalSymbol 34 magma_r 17 magma_r triple_m [] magma_r Public ), max_integer: (ExternalSymbol 34 max_integer 2 max_integer math_integer_m [] max_integer Public ), max_real: (ExternalSymbol 34 max_real 9 max_real math_real_m [] max_real Public ), min_integer: (ExternalSymbol 34 min_integer 2 min_integer math_integer_m [] min_integer Public ), min_real: (ExternalSymbol 34 min_real 9 min_real math_real_m [] min_real Public ), minus_integer: (ExternalSymbol 34 minus_integer 2 minus_integer math_integer_m [] minus_integer Public ), minus_real: (ExternalSymbol 34 minus_real 9 minus_real math_real_m [] minus_real Public ), one_integer: (ExternalSymbol 34 one_integer 2 one_integer math_integer_m [] one_integer Public ), one_real: (ExternalSymbol 34 one_real 9 one_real math_real_m [] one_real Public ), slash_real: (ExternalSymbol 34 slash_real 9 slash_real math_real_m [] slash_real Public ), test_add_triples: (ExternalSymbol 34 test_add_triples 24 test_add_triples use_triple_m [] test_add_triples Public ), test_max_triples: (ExternalSymbol 34 test_max_triples 24 test_max_triples use_triple_m [] test_max_triples Public ), test_minus_triples: (ExternalSymbol 34 test_minus_triples 24 test_minus_triples use_triple_m [] test_minus_triples Public ), triple_tmpl: (ExternalSymbol 34 triple_tmpl 17 triple_tmpl triple_m [] triple_tmpl Public ), zero_integer: (ExternalSymbol 34 zero_integer 2 zero_integer math_integer_m [] zero_integer Public ), zero_real: (ExternalSymbol 34 zero_real 9 zero_real math_real_m [] zero_real Public ) }) template_triple [use_triple_m math_integer_m math_real_m triple_m] [(SubroutineCall 34 test_add_triples () [] () .false. ) (SubroutineCall 34 test_minus_triples () [] () .false. ) (SubroutineCall 34 test_max_triples () [] () .false. )] ), triple_m: (Module (SymbolTable 17 { magma_r: (Requirement (SymbolTable 18 { plus_t: (Function (SymbolTable 19 { l: (Variable 19 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 19 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), total: (Variable 19 total [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 19 l) (Var 19 r)] [] (Var 19 total) Private .true. .true. () ), t: (Variable 18 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) magma_r [t plus_t] [] ), triple_tmpl: (Template (SymbolTable 20 { plus_t: (Function (SymbolTable 21 { l: (Variable 21 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 21 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), total: (Variable 21 total [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 21 l) (Var 21 r)] [] (Var 21 total) Private .true. .true. () ), t: (Variable 20 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), triple_l: (Function (SymbolTable 22 { result: (Variable 22 result [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 22 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) triple_l (FunctionType [(TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [plus_t] [(Var 22 t)] [(Assignment (Var 22 result) (FunctionCall 20 plus_t () [((FunctionCall 20 plus_t () [((Var 22 t)) ((Var 22 t))] (TypeParameter t ) () () )) ((Var 22 t))] (TypeParameter t ) () () ) () .false. .false. )] (Var 22 result) Public .true. .true. () ), triple_r: (Function (SymbolTable 23 { result: (Variable 23 result [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 23 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) triple_r (FunctionType [(TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [plus_t] [(Var 23 t)] [(Assignment (Var 23 result) (FunctionCall 20 plus_t () [((Var 23 t)) ((FunctionCall 20 plus_t () [((Var 23 t)) ((Var 23 t))] (TypeParameter t ) () () ))] (TypeParameter t ) () () ) () .false. .false. )] (Var 23 result) Public .true. .true. () ) }) triple_tmpl [t plus_t] [(Require magma_r [t plus_t] )] ) }) triple_m () [triple_m] .false. .false. .false. ), use_triple_m: (Module (SymbolTable 24 { add_integer: (ExternalSymbol 24 add_integer 2 add_integer math_integer_m [] add_integer Public ), add_real: (ExternalSymbol 24 add_real 9 add_real math_real_m [] add_real Public ), magma_r: (ExternalSymbol 24 magma_r 17 magma_r triple_m [] magma_r Public ), max_integer: (ExternalSymbol 24 max_integer 2 max_integer math_integer_m [] max_integer Public ), max_real: (ExternalSymbol 24 max_real 9 max_real math_real_m [] max_real Public ), min_integer: (ExternalSymbol 24 min_integer 2 min_integer math_integer_m [] min_integer Public ), min_real: (ExternalSymbol 24 min_real 9 min_real math_real_m [] min_real Public ), minus_integer: (ExternalSymbol 24 minus_integer 2 minus_integer math_integer_m [] minus_integer Public ), minus_real: (ExternalSymbol 24 minus_real 9 minus_real math_real_m [] minus_real Public ), one_integer: (ExternalSymbol 24 one_integer 2 one_integer math_integer_m [] one_integer Public ), one_real: (ExternalSymbol 24 one_real 9 one_real math_real_m [] one_real Public ), slash_real: (ExternalSymbol 24 slash_real 9 slash_real math_real_m [] slash_real Public ), test_add_triples: (Function (SymbolTable 25 { tal: (Variable 25 tal [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tar: (Variable 25 tar [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), triple_add_l: (Function (SymbolTable 26 { result: (Variable 26 result [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 26 t [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) triple_add_l (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 26 t)] [(Assignment (Var 26 result) (FunctionCall 24 add_integer () [((FunctionCall 24 add_integer () [((Var 26 t)) ((Var 26 t))] (Integer 4) () () )) ((Var 26 t))] (Integer 4) () () ) () .false. .false. )] (Var 26 result) Public .true. .true. () ), triple_add_r: (Function (SymbolTable 27 { result: (Variable 27 result [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 27 t [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) triple_add_r (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 27 t)] [(Assignment (Var 27 result) (FunctionCall 24 add_integer () [((Var 27 t)) ((FunctionCall 24 add_integer () [((Var 27 t)) ((Var 27 t))] (Integer 4) () () ))] (Integer 4) () () ) () .false. .false. )] (Var 27 result) Public .true. .true. () ) }) test_add_triples (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 25 tal) (FunctionCall 25 triple_add_l () [((IntegerConstant 7 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 25 tar) (FunctionCall 25 triple_add_r () [((IntegerConstant 7 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "tal = " (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 25 tal) (StringConstant " tar = " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 25 tar)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), test_max_triples: (Function (SymbolTable 31 { tmaxl: (Variable 31 tmaxl [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmaxr: (Variable 31 tmaxr [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), triple_max_l: (Function (SymbolTable 32 { result: (Variable 32 result [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 32 t [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) triple_max_l (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 32 t)] [(Assignment (Var 32 result) (FunctionCall 24 max_real () [((FunctionCall 24 max_real () [((Var 32 t)) ((Var 32 t))] (Real 4) () () )) ((Var 32 t))] (Real 4) () () ) () .false. .false. )] (Var 32 result) Public .true. .true. () ), triple_max_r: (Function (SymbolTable 33 { result: (Variable 33 result [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 33 t [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) triple_max_r (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 33 t)] [(Assignment (Var 33 result) (FunctionCall 24 max_real () [((Var 33 t)) ((FunctionCall 24 max_real () [((Var 33 t)) ((Var 33 t))] (Real 4) () () ))] (Real 4) () () ) () .false. .false. )] (Var 33 result) Public .true. .true. () ) }) test_max_triples (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 31 tmaxl) (FunctionCall 31 triple_max_l () [((RealConstant 7.000000 (Real 4) ))] (Real 4) () () ) () .false. .false. ) (Assignment (Var 31 tmaxr) (FunctionCall 31 triple_max_r () [((RealConstant 7.000000 (Real 4) ))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "tmaxl =" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 31 tmaxl) (StringConstant " tmaxr =" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 31 tmaxr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), test_minus_triples: (Function (SymbolTable 28 { tml: (Variable 28 tml [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmr: (Variable 28 tmr [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), triple_minus_l: (Function (SymbolTable 29 { result: (Variable 29 result [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 29 t [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) triple_minus_l (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 29 t)] [(Assignment (Var 29 result) (FunctionCall 24 minus_real () [((FunctionCall 24 minus_real () [((Var 29 t)) ((Var 29 t))] (Real 4) () () )) ((Var 29 t))] (Real 4) () () ) () .false. .false. )] (Var 29 result) Public .true. .true. () ), triple_minus_r: (Function (SymbolTable 30 { result: (Variable 30 result [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 30 t [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) triple_minus_r (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 30 t)] [(Assignment (Var 30 result) (FunctionCall 24 minus_real () [((Var 30 t)) ((FunctionCall 24 minus_real () [((Var 30 t)) ((Var 30 t))] (Real 4) () () ))] (Real 4) () () ) () .false. .false. )] (Var 30 result) Public .true. .true. () ) }) test_minus_triples (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 28 tml) (FunctionCall 28 triple_minus_l () [((RealConstant 7.000000 (Real 4) ))] (Real 4) () () ) () .false. .false. ) (Assignment (Var 28 tmr) (FunctionCall 28 triple_minus_r () [((RealConstant 7.000000 (Real 4) ))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "tml = " (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 28 tml) (StringConstant " tmr = " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 28 tmr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), triple_tmpl: (ExternalSymbol 24 triple_tmpl 17 triple_tmpl triple_m [] triple_tmpl Public ), zero_integer: (ExternalSymbol 24 zero_integer 2 zero_integer math_integer_m [] zero_integer Public ), zero_real: (ExternalSymbol 24 zero_real 9 zero_real math_real_m [] zero_real Public ) }) use_triple_m () [math_integer_m math_real_m triple_m use_triple_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-derived_types_16_module-4aac273.json0000664000175000017500000000101715174404631026160 0ustar alastairalastair{ "basename": "asr-derived_types_16_module-4aac273", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_16_module.f90", "infile_hash": "81550c6abc6abf36b4e475e6f0297fe376befa5adbc94ae398f33526", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_16_module-4aac273.stdout", "stdout_hash": "b017dbd69de4f51c0c2190e6ef7ef46f8b112ee9ee9ef98a594e9bca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-arrays_01_size-b2012a6.stdout0000664000175000017500000000313015174404631025071 0ustar alastairalastairfunction main() local a::Array{Int32, 1} local b::Array{Int32, 1} local i::Int32 local size_a::Int32 local size_b::Int32 size_a = length(a) size_b = size(b)[1] if size_a ≠ 3 println(Base.stderr, "ERROR STOP") exit(1) end if size_b ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end for i ∈ 1:size_a a[i] = i + 10 end if a[1] ≠ 11 println(Base.stderr, "ERROR STOP") exit(1) end if a[2] ≠ 12 println(Base.stderr, "ERROR STOP") exit(1) end if a[3] ≠ 13 println(Base.stderr, "ERROR STOP") exit(1) end for i ∈ 11:10 + size_b b[i - 10] = i end if b[1] ≠ 11 println(Base.stderr, "ERROR STOP") exit(1) end if b[2] ≠ 12 println(Base.stderr, "ERROR STOP") exit(1) end if b[3] ≠ 13 println(Base.stderr, "ERROR STOP") exit(1) end if b[4] ≠ 14 println(Base.stderr, "ERROR STOP") exit(1) end for i ∈ 1:size_a b[i] = a[i] - 10 end if b[1] ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end if b[2] ≠ 2 println(Base.stderr, "ERROR STOP") exit(1) end if b[3] ≠ 3 println(Base.stderr, "ERROR STOP") exit(1) end b[4] = b[1] + b[2] + b[3] + a[1] if b[4] ≠ 17 println(Base.stderr, "ERROR STOP") exit(1) end b[4] = a[1] if b[4] ≠ 11 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-0.63.0/tests/reference/asr-intrinsics_05-4c31742.stdout0000664000175000017500000001064515174404631024353 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_05: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_05 [] [(Assignment (Var 2 x) (IntrinsicElementalFunction Sinh [(RealConstant 1.000000 (Real 4) )] 0 (Real 4) (RealConstant 1.175201 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (IntrinsicElementalFunction Cosh [(RealConstant 1.000000 (Real 4) )] 0 (Real 4) (RealConstant 1.543081 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (IntrinsicElementalFunction Tanh [(RealConstant 1.000000 (Real 4) )] 0 (Real 4) (RealConstant 0.761594 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/pass_global_stmts-expr1-213371d.stdout0000664000175000017500000000411115174404631025640 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] (Integer 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 f1) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. )] (Var 2 f1) Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-continue_compilation_2-a6145a1.json0000664000175000017500000000101615174404631026017 0ustar alastairalastair{ "basename": "asr-continue_compilation_2-a6145a1", "cmd": "lfortran --semantics-only --continue-compilation --no-color {infile}", "infile": "tests/errors/continue_compilation_2.f90", "infile_hash": "4484372b6ed718f6b991ab6b9e7d8be1e0994e334afb82d0ab6e15fc", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-continue_compilation_2-a6145a1.stderr", "stderr_hash": "4f61cb0b6a2b9952b3a562956c0e770c3ba59fb253c06593fdb4ffad", "returncode": 1 }lfortran-0.63.0/tests/reference/cpp-fn2-ff8ef37.stdout0000664000175000017500000000135315174404631022601 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations int32_t a(); float b(); bool c(); int32_t d(); float e(); bool f(); // Implementations int32_t a() { int32_t a; return a; } float b() { float b; return b; } bool c() { bool c; return c; } int32_t d() { int32_t r; return r; } float e() { float r; return r; } bool f() { bool r; return r; } lfortran-0.63.0/tests/reference/wat-if_04-1d3b97a.json0000664000175000017500000000103015174404631022347 0ustar alastairalastair{ "basename": "wat-if_04-1d3b97a", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/if_04.f90", "infile_hash": "dc3029f2df7281746bd116d435ee39913201c693d801c2e53aca3886", "outfile": null, "outfile_hash": null, "stdout": "wat-if_04-1d3b97a.stdout", "stdout_hash": "79a69e07bcecedfc95012ed1f1dcc4e012e1e7cbf351bd25c5f1ad20", "stderr": "wat-if_04-1d3b97a.stderr", "stderr_hash": "8b854a8be811f407b5f543a37121d6b73b7265ed8b67dc1c76a42d63", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-allocate_03-8219a72.json0000664000175000017500000000075315174404631023404 0ustar alastairalastair{ "basename": "asr-allocate_03-8219a72", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/allocate_03.f90", "infile_hash": "1f3440c7b139aaa793981c1458c516ddc41106d2950a39f47077b0f5", "outfile": null, "outfile_hash": null, "stdout": "asr-allocate_03-8219a72.stdout", "stdout_hash": "b8a0714d196d8668b7a25bb8b6d0da893c2cad525854170122e9aeb4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-nested_02-726d5e8.json0000664000175000017500000000075015174404631023352 0ustar alastairalastair{ "basename": "llvm-nested_02-726d5e8", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_02.f90", "infile_hash": "6ff700b8b837d9efad78b5ed4d8defc823333a19f8afa37c7da6899d", "outfile": null, "outfile_hash": null, "stdout": "llvm-nested_02-726d5e8.stdout", "stdout_hash": "8ed77d065ae8eff53ca5498af477f8ebe41609362434d7ce1e668639", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-module_struct_global_separate_compilation_01-043bc7f.json0000664000175000017500000000107415174404631032626 0ustar alastairalastair{ "basename": "llvm-module_struct_global_separate_compilation_01-043bc7f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/module_struct_global_separate_compilation_01.f90", "infile_hash": "08f54b36d504349558d92a29ac0ea311917967e95e6d32b9019a9574", "outfile": null, "outfile_hash": null, "stdout": "llvm-module_struct_global_separate_compilation_01-043bc7f.stdout", "stdout_hash": "b82ecf848076f71fba483f0cb5472ca2b80d316b04b57ada4171b6ed", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-incorrect_type_where_01-8974c02.json0000664000175000017500000000100115174404631026027 0ustar alastairalastair{ "basename": "asr-incorrect_type_where_01-8974c02", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incorrect_type_where_01.f90", "infile_hash": "b69410e8dc944d0748ba6ceb9a98bb46621c18dc322814e045286eeb", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incorrect_type_where_01-8974c02.stderr", "stderr_hash": "695ca61a08fc7f97084ebac3997c3cf7dc2a84c2a0a786ccd345b928", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-show_errors1-cc473c3.stdout0000664000175000017500000000123615174404631024455 0ustar alastairalastair{"uri":"file://tests/errors/show_errors1.f90","diagnostics":[{"source":"lpyth","range":{"start":{"line":9,"character":5},"end":{"line":9,"character":5}},"message":"Newline is unexpected here","severity":0},{"source":"lpyth","range":{"start":{"line":12,"character":10},"end":{"line":12,"character":11}},"message":"Variable 'xx' is not declared","severity":0},{"source":"lpyth","range":{"start":{"line":13,"character":10},"end":{"line":13,"character":11}},"message":"Variable 'xz' is not declared","severity":0},{"source":"lpyth","range":{"start":{"line":14,"character":10},"end":{"line":14,"character":18}},"message":"Variable 'fasldjkfh' is not declared","severity":0}]}lfortran-0.63.0/tests/reference/asr-assign_to1-a6b7599.json0000664000175000017500000000077215174404631023457 0ustar alastairalastair{ "basename": "asr-assign_to1-a6b7599", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/assign_to1.f90", "infile_hash": "a8a83c753ee6f6e22b44441dbf0e5d8e7f180ca811bcbe45e810b869", "outfile": null, "outfile_hash": null, "stdout": "asr-assign_to1-a6b7599.stdout", "stdout_hash": "09ab0cd711bdd1f06cf3e9606ae7245a9dbcf9c019c209d651269883", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-expr_06-78489bb.json0000664000175000017500000000073015174404631023205 0ustar alastairalastair{ "basename": "julia-expr_06-78489bb", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/expr_06.f90", "infile_hash": "86c5ce938c64e34b4a0d0c0005ed174ab091a74089c4e28d87f55945", "outfile": null, "outfile_hash": null, "stdout": "julia-expr_06-78489bb.stdout", "stdout_hash": "2ed657c315a9bd7fe376394fb43251634c6805d135d464da42d2218a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-fixed_form_implicit2-4d3e56c.json0000664000175000017500000000104315174404631025545 0ustar alastairalastair{ "basename": "asr-fixed_form_implicit2-4d3e56c", "cmd": "lfortran --fixed-form --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_implicit2.f", "infile_hash": "5300a387c8af9f01e109d5c3f7a9d8aa452020178f6e388e4bfcbce9", "outfile": null, "outfile_hash": null, "stdout": "asr-fixed_form_implicit2-4d3e56c.stdout", "stdout_hash": "f5db4bb18322b5946f9b1b07708d5aa93abb8f40b7505b8050412bed", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-operator_overloading_04-e28fb55.stdout0000664000175000017500000006751615174404631026573 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { operator_overloading_04_stdlib_string_type: (Module (SymbolTable 2 { assign_string_char: (Function (SymbolTable 4 { 1_string_type_raw: (ExternalSymbol 4 1_string_type_raw 3 raw string_type [] raw Public ), lhs: (Variable 4 lhs [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 4 rhs [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) assign_string_char (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 lhs) (Var 4 rhs)] [(Assignment (StructInstanceMember (Var 4 lhs) 4 1_string_type_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 4 rhs) () .false. .false. )] () Public .true. .true. () ), string_type: (Struct (SymbolTable 3 { raw: (Variable 3 raw [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_type (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [raw] [] Source Public .false. .false. [] () () [] ), trim_string: (Function (SymbolTable 5 { 1_string_type_raw: (ExternalSymbol 5 1_string_type_raw 3 raw string_type [] raw Public ), assign_string_char: (ExternalSymbol 5 assign_string_char 2 assign_string_char operator_overloading_04_stdlib_string_type [] assign_string_char Public ), string: (Variable 5 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), trimmed_string: (Variable 5 trimmed_string [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) trim_string (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 5 string)] [(Assignment (Var 5 trimmed_string) (StructInstanceMember (Var 5 string) 5 1_string_type_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (SubroutineCall 5 assign_string_char 5 assign_string_char [((Var 5 trimmed_string)) ((StructInstanceMember (Var 5 string) 5 1_string_type_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () ))] () .false. ) .false. .false. )] (Var 5 trimmed_string) Public .true. .true. () ), ~assign: (CustomOperator 2 ~assign [2 assign_string_char] Public ) }) operator_overloading_04_stdlib_string_type () [operator_overloading_04_stdlib_string_type] .false. .false. .false. ), operator_overloading_stdlib_string_use: (Module (SymbolTable 6 { chomp_string: (Function (SymbolTable 7 { assign_string_char@~assign: (ExternalSymbol 7 assign_string_char@~assign 2 assign_string_char operator_overloading_04_stdlib_string_type [] assign_string_char Public ), chomped_string: (Variable 7 chomped_string [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 6 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), last: (Variable 7 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 7 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 6 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~assign: (ExternalSymbol 7 ~assign 2 ~assign operator_overloading_04_stdlib_string_type [] ~assign Public ) }) chomp_string (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 7 string)] [] (Var 7 chomped_string) Public .true. .true. () ), string_type: (ExternalSymbol 6 string_type 2 string_type operator_overloading_04_stdlib_string_type [] string_type Public ) }) operator_overloading_stdlib_string_use () [operator_overloading_04_stdlib_string_type] .false. .false. .false. ), stdlib_string: (Program (SymbolTable 8 { }) stdlib_string [] [] ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_lapack_01-0d30f43.json0000664000175000017500000000100015174404631024774 0ustar alastairalastair{ "basename": "asr-template_lapack_01-0d30f43", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_lapack_01.f90", "infile_hash": "d79e24fee2aba2e6b98fffd327df1e6a264fdf9cc3e5ebc77b5822d0", "outfile": null, "outfile_hash": null, "stdout": "asr-template_lapack_01-0d30f43.stdout", "stdout_hash": "52556be0442f4360046cfc452f1e4b18422211d33fdb85bdde05bed2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-bits_04-d0f89f1.json0000664000175000017500000000073715174404631022730 0ustar alastairalastair{ "basename": "asr-bits_04-d0f89f1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bits_04.f90", "infile_hash": "1cf82954b9eed57d1f61a7b86cf2aaaf4cb3a8efdf960365bab23692", "outfile": null, "outfile_hash": null, "stdout": "asr-bits_04-d0f89f1.stdout", "stdout_hash": "c0fac706952f050773d0b767fb9e5dbc29a93923d223062bdfbe96de", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-types_11-696c3ee.json0000664000175000017500000000074215174404631023132 0ustar alastairalastair{ "basename": "ast-types_11-696c3ee", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_11.f90", "infile_hash": "ec77a687fe909a61a4d7e9edc0d249eb8fbcd372a60ff4c84d9d50ca", "outfile": null, "outfile_hash": null, "stdout": "ast-types_11-696c3ee.stdout", "stdout_hash": "133033e1bee41d47e922546395584ff57c6fe6b3408f737936d377bb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-matrix_matmul_05-c57a23d.stderr0000664000175000017500000000031015174404631025157 0ustar alastairalastairsemantic error: `matmul` accepts arrays of rank 1 or 2 only, provided an array with rank, 4 --> tests/errors/matrix_matmul_05.f90:5:24 | 5 | print *, matmul(a, b) | ^ lfortran-0.63.0/tests/reference/run-scalar_allocation_check_02-b6aed2a.json0000664000175000017500000000076215174404631026734 0ustar alastairalastair{ "basename": "run-scalar_allocation_check_02-b6aed2a", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/scalar_allocation_check_02.f90", "infile_hash": "334ddfdd17e21ad5f18931bde4b01c8463c16124c4f2b35f872b0bae", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-scalar_allocation_check_02-b6aed2a.stderr", "stderr_hash": "50fde05f32a37b3018afb50ffe4509b2f681682323043ff7957ffde3", "returncode": 1 }lfortran-0.63.0/tests/reference/ast-do1-0a89222.stderr0000664000175000017500000000020315174404631022315 0ustar alastairalastairstyle suggestion: Use 'end do' instead of 'enddo' --> tests/do1.f90:21:1 | 21 | enddo | ^^^^^ help: write this as 'end do' lfortran-0.63.0/tests/reference/ast_f90-associate_01-aa0fe46.stderr0000664000175000017500000000025615174404631025012 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/associate_01.f90:18:8 | 18 | if(a(1).EQ.5) GO TO 1 | ^^^^ help: write this as '==' lfortran-0.63.0/tests/reference/asr-types_03-f0b782e.stdout0000664000175000017500000000735515174404631023502 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { types_03: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 2 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) types_03 [] [(Assignment (Var 2 r) (RealConstant 1.500000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(Var 2 r)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (Cast (Var 2 r) RealToInteger (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/lookup_name-lookup_name1-9a3abcc.json0000664000175000017500000000075415174404631025725 0ustar alastairalastair{ "basename": "lookup_name-lookup_name1-9a3abcc", "cmd": "lfortran --lookup-name --no-color {infile} -o {outfile}", "infile": "tests/lookup_name1.f90", "infile_hash": "6040a3665d4455ccb812ccc763c7d458221ef5b0eb639ed341de0618", "outfile": null, "outfile_hash": null, "stdout": "lookup_name-lookup_name1-9a3abcc.stdout", "stdout_hash": "8df160638b3c83441d1ecd0dd1fdff905f4f006d492e805dc0041307", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-stop1-c0d0295.stdout0000664000175000017500000000131415174404631023460 0ustar alastairalastairprogram stop1 implicit none ! AST only(Syntax check) integer :: stop = 15 integer :: errstop = 25 if (stop /= 15) then stop else if (errstop /= 25) then error stop end if end if if (stop /= 15) then stop "message" else if (errstop /= 25) then error stop "message" end if end if if (stop /= 15) then stop 0 else if (errstop /= 25) then error stop 0 end if end if if (stop /= 15) then stop, quiet = .true. else if (errstop /= 25) then error stop, quiet = .true. end if end if if (stop /= 15) then stop 1, quiet = .false. else if (errstop /= 25) then error stop 1, quiet = .false. end if end if end program stop1 lfortran-0.63.0/tests/reference/asr-array1-20700fb.stdout0000664000175000017500000003774715174404631023146 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array1: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b2: (Variable 2 b2 [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b3: (Variable 2 b3 [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), e: (Variable 2 e [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), e2: (Variable 2 e2 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), e3: (Variable 2 e3 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Variable 2 f [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), g: (Variable 2 g [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), g2: (Variable 2 g2 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), g3: (Variable 2 g3 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) array1 [] [] ) }) [] ) lfortran-0.63.0/tests/reference/ast-subroutine2-c8b0b6f.stdout0000664000175000017500000003001015174404631024354 0ustar alastairalastair(TranslationUnit [(Subroutine g [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 x y () ) (Assignment 0 x (* 2 y) () )] [] [] ) (Subroutine g [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 x y (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 x (* 2 y) () )] [] [] ) (Subroutine g [] [] () (TriviaNode [(EndOfLine) (EndOfLine)] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 x y (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) ) (Assignment 0 x (* 2 y) (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine) (EndOfLine)] ) )] [] [] ) (Subroutine g [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 x y (TriviaNode [] [(EndOfLine) (Semicolon) (Semicolon) (Semicolon) (Semicolon) (Semicolon) (Semicolon) (Semicolon) (Semicolon) (Semicolon) (EndOfLine)] ) ) (Assignment 0 x (* 2 y) () )] [] [] ) (Subroutine g [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 x y (TriviaNode [] [(Semicolon) (EndOfLine)] ) ) (Assignment 0 x (* 2 y) (TriviaNode [] [(Semicolon) (EndOfLine)] ) )] [] [] ) (Subroutine g [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 x y (TriviaNode [] [(Semicolon) (Semicolon) (EndOfLine)] ) ) (Assignment 0 x (* 2 y) (TriviaNode [] [(Semicolon) (Semicolon) (Semicolon) (EndOfLine)] ) )] [] [] ) (Subroutine g [] [] () (TriviaNode [(Semicolon)] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 x y (TriviaNode [] [(Semicolon)] ) ) (Assignment 0 x (* 2 y) (TriviaNode [] [(Semicolon)] ) )] [] [] ) (Subroutine f [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 subroutine y () ) (Assignment 0 x (* 2 subroutine) () )] [] [] ) (Subroutine f [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () )] [] [] [] ) (Subroutine f [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () )] [] [] [] ) (Subroutine f [(a) (b) (c) (d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(c [] [] () () None ()) (d [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(z [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(y [] [] () () None ())] () )] [] [] [] ) (Subroutine f [(a) (b) (c) (d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent Out )] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent InOut )] [(c [] [] () () None ()) (d [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(z [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(y [] [] () () None ())] () )] [] [] [] ) (Subroutine saxpy [(n) (a) (x) (y)] [] () () [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent In )] [(x [(() () DimensionExpr)] [] () () None ()) (a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent InOut )] [(y [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(DoLoop 0 () 0 i 1 n () [(Assignment 0 (FuncCallOrArray y [] [(() i () 0)] [] [] [] ) (+ (* a (FuncCallOrArray x [] [(() i () 0)] [] [] [] )) (FuncCallOrArray y [] [(() i () 0)] [] [] [] )) () )] () () )] [] [] )] ) lfortran-0.63.0/tests/reference/run-integer_overflow-3cf26f8.json0000664000175000017500000000105315174404631025053 0ustar alastairalastair{ "basename": "run-integer_overflow-3cf26f8", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/integer_overflow.f90", "infile_hash": "99aeb8a8bec3fcc69c64e299272811526c026aaa3da667aca42d6776", "outfile": null, "outfile_hash": null, "stdout": "run-integer_overflow-3cf26f8.stdout", "stdout_hash": "0731a7507e03e34666eed16f15353a2ddbb05a501e36b5e5dcbaf348", "stderr": "run-integer_overflow-3cf26f8.stderr", "stderr_hash": "a4c99417a6e12ac2dd2b0053e6fd4fb8b98d15e5cb5d5fc27eb4ae7f", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-derived_type_05-3836aa5.json0000664000175000017500000000075115174404631024360 0ustar alastairalastair{ "basename": "asr-derived_type_05-3836aa5", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/derived_type_05.f90", "infile_hash": "5987fece6fa8c1cf630060bab7fdff85f72075755e9b3f64cad7ef86", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-derived_type_05-3836aa5.stderr", "stderr_hash": "8ab69b17b3f68e3089a6b8f9633424b69a4391d810104f78380ae35c", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-modules_04-0d478be.stdout0000664000175000017500000001366115174404631024004 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { access_vars: (Module (SymbolTable 2 { print_vars: (Function (SymbolTable 3 { }) print_vars (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(StringConstant "priv = " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 priv)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "publ = " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 publ)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), priv: (Variable 2 priv [] Local (RealConstant 1.500000 (Real 4) ) (RealConstant 1.500000 (Real 4) ) Save (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), publ: (Variable 2 publ [] Local (RealConstant 2.500000 (Real 4) ) (RealConstant 2.500000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) access_vars () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/julia-case_02-e255e0e.stdout0000664000175000017500000000316015174404631023552 0ustar alastairalastairfunction main() local marks::Int32 local out::Int32 marks = 81 if 91 ≤ marks ≤ 100 out = 0 println("Excellent!") elseif 81 ≤ marks ≤ 90 out = 1 println("Very good!") elseif 71 ≤ marks ≤ 80 out = 2 println("Well done!") elseif 61 ≤ marks ≤ 70 out = 3 println("Not bad!") elseif 41 ≤ marks ≤ 60 out = 4 println("You passed!") elseif marks ≤ 40 out = 5 println("Better try again!") else out = 6 println("Invalid marks") end println("Your marks are ", " ", marks) if out ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end if 91 ≤ marks ≤ 100 println("Excellent!") elseif 81 ≤ marks ≤ 90 println("Very good!") elseif 71 ≤ marks ≤ 80 println("Well done!") elseif 61 ≤ marks ≤ 70 println("Not bad!") elseif 41 ≤ marks ≤ 60 println("You passed!") elseif marks ≤ 40 println("Better try again!") else println("Invalid marks") end println("Your marks are ", " ", marks) if 91 ≤ marks ≤ 100 println("Excellent!") elseif 81 ≤ marks ≤ 90 println("Very good!") elseif 71 ≤ marks ≤ 80 println("Well done!") elseif 61 ≤ marks ≤ 70 println("Not bad!") elseif 41 ≤ marks ≤ 60 println("You passed!") elseif marks ≤ 40 println("Better try again!") else println("Invalid marks") end println("Your marks are ", " ", marks) end main() lfortran-0.63.0/tests/reference/ast_f90-format_01-fa31fe9.stdout0000664000175000017500000000536715174404631024366 0ustar alastairalastairprogram format_01 implicit none integer :: x integer :: y integer :: z 1 format(/,'BDF2 step ',i6,': T=',es12.5,', H=',es12.5,', ETAH=',es12.5) 2 format(/ ,'BDF2 step ',i6,': T=',es12.5,', H=',es12.5,', ETAH=',es12.5) 3 format( /,'BDF2 step ',i6,': T=',es12.5,', H=',es12.5,', ETAH=',es12.5) 4 format(2x,'Preconditioner update FAILED at T=',es12.5,', ETAH=',es12.5) 5 format(/) 6 format(/ ) 7 format( /) 8 format(i6, /) 9 format(i6,/) 10 format(/ , /) 121 format( /, 80A, / ) 122 format( /, 80A, /) 123 format(/, 80A, /) 124 format(/, 80A, / ) 130 format( 10X, 'keyword Input Echo - Values from input or default', / ,80A, / ) 131 format( 10X, 'keyword Input Echo - Values from input or default', / ,80A, /) 158 format( 4X, 'epsi = ', ES11.4, /, 4X, 'iitm = ', I3, /, 4X, 'oitm = ', I4, /, 4X, 'timedep = ', I1, /, 4X, 'swp_typ = ', I1, /, 4X, 'multiswp = ', I1, /, 4X, 'angcpy = ', I1, /, 4X, 'it_det = ', I1, /, 4X, 'soloutp = ', I1, /, 4X, 'kplane = ', I4, /, 4X, 'popout = ', I1, /, 4X, 'fluxp = ', I1, /, 4X, 'fixup = ', I1, / ) 161 format( 'slgg(nmat,nmom,ng,ng) echo', /, 'Column-order loops:',' Mats (fastest ), Moments, Groups, Groups (slowest)' ) 162 format( 2X, ES15.8, 2X, ES15.8, 2X, ES15.8, 2X, ES15.8 ) 221 format( 4X, 'Group ', I3, 4X, ' Inner ', I5, 4X, ' Dfmxi ', ES11.4, ' Fixup x/y/z/t ', 4(ES9.2,1x) ) 306 format( 2X, I4, 6(1X, ES11.4) ) 324 format( 4(2X, ES17.10) ) 422 format( /, 4X, 'Manufactured/Computed Solutions Max Diff=', ES13.6 ) 500 format( "IARRAY =", *( I0, :, ",")) 501 format(*( I0, :, ",")) 510 format(1X, F10.3, I5, F10.3, I5/F10.3, I5, F10.3, I5) 511 format(3/,I5) 512 format(3/) 513 format(1x, A, 3/ 1x, 2(I10,F10.2) // 1x, 2E15.7) 520 format(1X, I1, 1X, 'ISN''T', 1X, I1) 530 format(1PE12.4, I10) 540 format(I12, /, ' Dates: ', 2 (2I3, I5)) 550 format(ES12.3, ES12.3E3, G3.4, G3.4E100) 600 format(//,63x,'Internal',/, 1x,'Cell',3(5x,'Temp '), 7x,'P',8x,'Density',6x,'Energy', /,2x,'Num',6x,'(K)',7x,'(C)',7x,'(F)',6x,'(Pa)',6x, '(kg/m**3)',5x,'(J/kg)' ) 610 format(71('-'),/,(1x,i4,0p,3f10.1,1p,3e12.3)) 620 format((1x,i4,0p,3(2x,'|',2x,f5.1),1p, 3(1x,'|',1x,e9.3))) 630 format( //,' Format Number ',i4) 631 format(//,' Format Number ',i4) 640 format("Table form of A"/(2F8.2)) 650 format( 5X, 'ng= ', I4, / 5X, 'mat_opt= ', I2, / 5X, 'src_opt= ', I2, / 5X, 'scatp= ', I2 ) 660 format(' Format Number ',0PF17.8,' Ry' ) 670 format(/'xx') 680 format(/"xx") 690 format(/ "xx") 700 format(/ 'xx') 710 format(/ i5, 'x') 720 format(// i5, 'x') 730 format(//) x = 5 740 format(/1X'(',I2,')', X, A) end program format_01 lfortran-0.63.0/tests/reference/ast-subroutine5-d00e190.stdout0000664000175000017500000000210715174404631024215 0ustar alastairalastair(TranslationUnit [(Subroutine add [(a) (b) (c)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(c [] [] () () None ())] () )] [(Assignment 0 c (+ a b) () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-arrays_08_func-2759ced.stderr0000664000175000017500000000032315174404631024631 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/arrays_08_func.f90:29:27 | 29 | r = r .and. (a(i) .eq. b(i)) | ^^^^ help: write this as '==' lfortran-0.63.0/tests/reference/cpp-fn2-ff8ef37.json0000664000175000017500000000066115174404631022231 0ustar alastairalastair{ "basename": "cpp-fn2-ff8ef37", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/fn2.f90", "infile_hash": "9f61561c47397aa03014fe07094ac838ada4865e513025e384edae00", "outfile": null, "outfile_hash": null, "stdout": "cpp-fn2-ff8ef37.stdout", "stdout_hash": "2bb1359320b16c59d468f0223319c844dd9c3d60dce30003b9c67a42", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-expr1-e0e6d6b.stdout0000664000175000017500000000017615174404631023143 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { }) [(IntegerConstant 5 (Integer 4) Decimal)] ) lfortran-0.63.0/tests/reference/asr-nested_04-8423f42.stdout0000664000175000017500000004534315174404631023457 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nested_04: (Program (SymbolTable 5 { b: (ExternalSymbol 5 b 2 b nested_04_a [] b Public ), test: (Variable 5 test [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) nested_04 [nested_04_a] [(Assignment (Var 5 test) (FunctionCall 5 b () [((IntegerConstant 5 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. )] ), nested_04_a: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { b: (Variable 3 b [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Function (SymbolTable 4 { c: (Variable 4 c [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 4 z [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) c (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 z)] [(Print (StringFormat () [(Var 4 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 3 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 3 yy)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 4 c) (Var 4 z) () .false. .false. )] (Var 4 c) Public .false. .false. () ), x: (Variable 3 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 3 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), yy: (Variable 3 yy [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) b (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [(Assignment (Var 3 yy) (RealConstant 6.600000 (Real 4) ) () .false. .false. ) (Assignment (Var 3 y) (Var 3 x) () .false. .false. ) (Print (StringConstant "b()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Assignment (Var 3 b) (FunctionCall 3 c () [((IntegerConstant 6 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. )] (Var 3 b) Public .false. .false. () ) }) nested_04_a () [nested_04_a] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-reserved_02-a00a6f2.json0000664000175000017500000000076615174404631024244 0ustar alastairalastair{ "basename": "ast_f90-reserved_02-a00a6f2", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/reserved_02.f90", "infile_hash": "f602644fa98db53850a49c69394e3e9eb664cd1250f81f954484c85e", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-reserved_02-a00a6f2.stdout", "stdout_hash": "2cda8233c77ac420d2688c94e80e9c4fcfe12ab17c884a5d0f189929", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-submodule_04-987b68b.stdout0000664000175000017500000004474115174404631024272 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { mod_submodule_04: (Module (SymbolTable 2 { map_open_entry: (Function (SymbolTable 4 { key: (Variable 4 key [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), map: (Variable 4 map [] InOut () () Default (StructType [] [] .false. .false. ) 2 open_hashmap_type Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) map_open_entry (FunctionType [(StructType [] [] .false. .false. ) (Integer 4)] () Source Interface () .false. .false. .true. .false. .false. [] .false. ) [] [(Var 4 map) (Var 4 key)] [] () Private .false. .false. () ), open_hashmap_type: (Struct (SymbolTable 3 { map_entry: (StructMethodDeclaration 3 map_entry () map_open_entry 2 map_open_entry Source .false. .false. ) }) open_hashmap_type (StructType [] [] .true. .false. ) [] [] [] Source Private .false. .false. [] () () [] ) }) mod_submodule_04 () [] .false. .false. .true. ), submod_submodule_04: (Module (SymbolTable 5 { map_open_entry: (Function (SymbolTable 6 { i: (Variable 6 i [] Local (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), key: (Variable 6 key [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), map: (Variable 6 map [] InOut () () Default (StructType [] [] .false. .false. ) 5 open_hashmap_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) map_open_entry (FunctionType [(StructType [] [] .false. .false. ) (Integer 4)] () Source Implementation () .false. .false. .true. .false. .false. [] .false. ) [] [(Var 6 map) (Var 6 key)] [(Assignment (Var 6 key) (Var 6 i) () .false. .false. )] () Public .true. .true. () ), open_hashmap_type: (ExternalSymbol 5 open_hashmap_type 2 open_hashmap_type mod_submodule_04 [] open_hashmap_type Public ) }) submod_submodule_04 mod_submodule_04 [mod_submodule_04] .false. .false. .false. ), submodule_04: (Program (SymbolTable 7 { 1_open_hashmap_type_map_open_entry: (ExternalSymbol 7 1_open_hashmap_type_map_open_entry 3 map_entry open_hashmap_type [] map_entry Public ), key: (Variable 7 key [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), map: (Variable 7 map [] Local () () Default (StructType [] [] .true. .false. ) 7 open_hashmap_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), open_hashmap_type: (ExternalSymbol 7 open_hashmap_type 2 open_hashmap_type mod_submodule_04 [] open_hashmap_type Public ) }) submodule_04 [mod_submodule_04] [(SubroutineCall 7 1_open_hashmap_type_map_open_entry () [((Var 7 map)) ((Var 7 key))] (Var 7 map) .false. ) (Print (StringFormat () [(Var 7 key)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 7 key) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-fixed_form_if_variations-38b0c0a.stdout0000664000175000017500000000413515174404631027051 0ustar alastairalastair(TranslationUnit [(Subroutine f [(a)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ())] () )] [(Print 0 () [a] () )] [] [] ) (Program main () [] [] [] [(If 0 () (< 0 1) [(Print 0 () [(String "first branch" ())] () ) (Continue 10 () )] [(Print 0 () [(String "second branch" ())] () )] () () () ) (SubroutineCall 50 f [] [(() 1 () 0)] [] [] () ) (If 0 () (< 0 2) [(Return 0 () () )] [] () () () ) (If 0 () (> 0 1) [(GoTo 0 () 50 [] () )] [] () () () ) (If 0 () (< 0 1) [(SubroutineCall 0 f [] [(() 2 () 0)] [] [] () )] [] () () () )] [] )] ) lfortran-0.63.0/tests/reference/ast_f90-if1-6dc9fe3.json0000664000175000017500000000071115174404631022675 0ustar alastairalastair{ "basename": "ast_f90-if1-6dc9fe3", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/if1.f90", "infile_hash": "52db0c880c11effc03c530998302e40daa23a4e191ee0dbf7fa5e631", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-if1-6dc9fe3.stdout", "stdout_hash": "47476381af23935043a0e3a59021dcdb204b96dcad8a2fe9e345be7b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-goto_03-38b11b3.json0000664000175000017500000000075215174404631023315 0ustar alastairalastair{ "basename": "ast_f90-goto_03-38b11b3", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/goto_03.f90", "infile_hash": "2a8829b6e334f6c1619d1d9c772f871874336138a9aa68816641754c", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-goto_03-38b11b3.stdout", "stdout_hash": "87bacb0887ea120cb4930811b9bf2a93b1237134d50342241ad24cf5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-callback_01-21b53de.stdout0000664000175000017500000006560415174404631024061 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { callback_01: (Module (SymbolTable 2 { cb: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), cb: (Variable 3 cb [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Function (SymbolTable 4 { f: (Variable 4 f [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Real 4)] (Real 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 x)] [] (Var 4 f) Public .false. .false. () ) }) cb (FunctionType [(FunctionType [(Real 4)] (Real 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 f) (Var 3 a) (Var 3 b)] [(Assignment (Var 3 cb) (RealBinOp (RealBinOp (RealBinOp (Var 3 b) Sub (Var 3 a) (Real 4) () ) Add (FunctionCall 3 f () [((Var 3 a))] (Real 4) () () ) (Real 4) () ) Add (FunctionCall 3 f () [((Var 3 b))] (Real 4) () () ) (Real 4) () ) () .false. .false. )] (Var 3 cb) Public .false. .false. () ), foo: (Function (SymbolTable 5 { c: (Variable 5 c [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 5 d [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Function (SymbolTable 6 { f: (Variable 6 f [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 6 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 x)] [(Assignment (Var 6 f) (RealBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) Mul (Var 6 x) (Real 4) () ) () .false. .false. )] (Var 6 f) Public .true. .true. () ) }) foo (FunctionType [(Real 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [cb] [(Var 5 c) (Var 5 d)] [(Print (StringFormat () [(FunctionCall 2 cb () [((Var 5 f)) ((Var 5 c)) ((Var 5 d))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) callback_01 () [callback_01] .false. .false. .false. ), main: (Program (SymbolTable 7 { cb: (ExternalSymbol 7 cb 2 cb callback_01 [] cb Public ), foo: (ExternalSymbol 7 foo 2 foo callback_01 [] foo Public ) }) main [callback_01] [(SubroutineCall 7 foo () [((RealConstant 1.500000 (Real 4) )) ((RealConstant 2.000000 (Real 4) ))] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/run-format_27-3469667.stdout0000664000175000017500000000005015174404631023427 0ustar alastairalastair3.E+0 3.E+0 3.E+3 30.E+0 391.E+0 31.E+3 lfortran-0.63.0/tests/reference/asr_preprocess-cpp6-556419a.json0000664000175000017500000000074415174404631024434 0ustar alastairalastair{ "basename": "asr_preprocess-cpp6-556419a", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp6.f90", "infile_hash": "656ffe7987384117872854f94922370f2be857b4aacef14bc6c74347", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp6-556419a.stderr", "stderr_hash": "5f480c0402858952c8e06d5fdc12736b09db6c1aaafc4cc7a3f0c897", "returncode": 2 }lfortran-0.63.0/tests/reference/run-infer_realloc_disabled_01-25a8068.json0000664000175000017500000000075715174404631026274 0ustar alastairalastair{ "basename": "run-infer_realloc_disabled_01-25a8068", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/infer_realloc_disabled_01.f90", "infile_hash": "fe97c92f3a6b2f82c2bc6c67e08a1e1f7b9baec1974bf5f02afd0cbb", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-infer_realloc_disabled_01-25a8068.stderr", "stderr_hash": "cb8946869603ac1adefbf48a223c25305c3921c58de9c776de3ae908", "returncode": 1 }lfortran-0.63.0/tests/reference/rename_symbol-collect_occurence2-a095a33.json0000664000175000017500000000100415174404631027160 0ustar alastairalastair{ "basename": "rename_symbol-collect_occurence2-a095a33", "cmd": "lfortran --rename-symbol --no-color {infile} -o {outfile}", "infile": "tests/collect_occurence2.f90", "infile_hash": "64f44de76cd08c4e21e4f8e05bb2747574f998c95bcdb8d474c8c449", "outfile": null, "outfile_hash": null, "stdout": "rename_symbol-collect_occurence2-a095a33.stdout", "stdout_hash": "ceb3972a4c1cdd81d16bc86d83173dbab5f181773ce8f1b1defed487", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-procedure_with_type-4c8ea35.json0000664000175000017500000000076515174404631025546 0ustar alastairalastair{ "basename": "ast-procedure_with_type-4c8ea35", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/procedure_with_type.f90", "infile_hash": "a2cb3df55c455622783d0b209d9fd84633b8e67530cf4ca17030700e", "outfile": null, "outfile_hash": null, "stdout": "ast-procedure_with_type-4c8ea35.stdout", "stdout_hash": "49ddb23e13380a55dd5eea878d088309735ffe30d6a3cf012de19b4a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_type_01-d480dc4.json0000664000175000017500000000075115174404631024434 0ustar alastairalastair{ "basename": "asr-derived_type_01-d480dc4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/derived_type_01.f90", "infile_hash": "74c9f7ee5dfaf581b24988b384a68b11d6023d84b46344260436f624", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-derived_type_01-d480dc4.stderr", "stderr_hash": "d6731b078923ba1abe7454042289cdb0c47c5c22f7acb516b02d7d3f", "returncode": 2 }lfortran-0.63.0/tests/reference/ast_f90-derived_types_03-2ad875a.json0000664000175000017500000000076015174404631025302 0ustar alastairalastair{ "basename": "ast_f90-derived_types_03-2ad875a", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/derived_types_03.f90", "infile_hash": "0367caa646d88d9d311f2157b87aa8d37c7c09500fea94cc3adacbe3", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-derived_types_03-2ad875a.stdout", "stdout_hash": "7a98583ef0e15fc8e8f7780421a2615536df4045cfb6b7850739787f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-continue_compilation_walrus-f3d9bd0.json0000664000175000017500000000103515174404631027345 0ustar alastairalastair{ "basename": "asr-continue_compilation_walrus-f3d9bd0", "cmd": "lfortran --semantics-only --continue-compilation --no-color {infile}", "infile": "tests/errors/continue_compilation_walrus.f90", "infile_hash": "672fb70521a3deb2dbe36c76dc53e5b8c89ddd7cd63d75e1285544a9", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-continue_compilation_walrus-f3d9bd0.stderr", "stderr_hash": "62da63fd8d5cc6856482383675826dec3bd0678883779c524b7247d1", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-int_01-9bf3eb9.json0000664000175000017500000000071615174404631022635 0ustar alastairalastair{ "basename": "asr-int_01-9bf3eb9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/int_01.f90", "infile_hash": "e2571a39476234ffe13799808dd85a6cdda52b13f89171e4fc4c868e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-int_01-9bf3eb9.stderr", "stderr_hash": "c9e39d59ade877d2ab7ac42be2b43f28bfecc44ab58b204ffd1ab5ab", "returncode": 2 }lfortran-0.63.0/tests/reference/pass_where-where_03-00685f9.stdout0000664000175000017500000010204415174404631024656 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 3 { }) main [] [(SubroutineCall 1 where_03 () [] () .false. )] ), where_03: (Function (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) where_03 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 a) (ArrayConstant 16 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00, 4.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 2 b) (ArrayConstant 16 [-1.00000000e+00, -2.00000000e+00, 5.00000000e+00, 7.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (If () (RealCompare (Var 2 a) Gt (Var 2 b) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 a) (ArrayBroadcast (RealConstant 1.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [] ) (If () (RealCompare (Var 2 a) Eq (RealConstant 1.000000 (Real 4) ) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 a) (ArrayBroadcast (RealConstant 2.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [2.00000000e+00, 2.00000000e+00, 2.00000000e+00, 2.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(If () (RealCompare (Var 2 a) Eq (RealConstant 2.000000 (Real 4) ) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 b) (ArrayBroadcast (RealConstant 3.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [3.00000000e+00, 3.00000000e+00, 3.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(Assignment (Var 2 a) (RealBinOp (RealBinOp (RealBinOp (Var 2 b) Mul (ArrayBroadcast (RealConstant 2.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [2.00000000e+00, 2.00000000e+00, 2.00000000e+00, 2.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) Div (Var 2 a) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) Mul (ArrayBroadcast (RealConstant 3.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [3.00000000e+00, 3.00000000e+00, 3.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. )] )] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 2.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 2.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 10.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 10.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealUnaryMinus (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant -1.000000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealUnaryMinus (RealConstant 2.000000 (Real 4) ) (Real 4) (RealConstant -2.000000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 5.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 7.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 b)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/llvm-abort_01-7212a3d.stdout0000664000175000017500000000226415174404631023530 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define void @_lcompilers_abort_() { .entry: call void @_lfortran_abort() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE__lcompilers_abort_ FINALIZE_SYMTABLE__lcompilers_abort_: ; preds = %return ret void } declare void @_lfortran_abort() define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) br i1 false, label %then, label %else then: ; preds = %.entry call void @_lcompilers_abort_() br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_abort1 FINALIZE_SYMTABLE_abort1: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-print_intrinsics-8e5d219.json0000664000175000017500000000074515174404631025004 0ustar alastairalastair{ "basename": "asr-print_intrinsics-8e5d219", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/print_intrinsics.f90", "infile_hash": "a18c84b05282913a620d056c8183e7e7ee364fcb4accdbc21f4d0b63", "outfile": null, "outfile_hash": null, "stdout": "asr-print_intrinsics-8e5d219.stdout", "stdout_hash": "9bc6c57294973034974093c09aea0eed8d389411ed71b60b6cfb1c4f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-expr9-c1303f2.stdout0000664000175000017500000000022715174404631023456 0ustar alastairalastaircall ERROR_HANDLER%trigger(errors=.errors.rslt) .INVERSE.B .INVERSE.(A + B) .anotherunary.1 .anotherunary.(1 + 2) .anotherunary.C .anotherunary.(c + d)lfortran-0.63.0/tests/reference/llvm-select_type_13-f465d8c.stdout0000664000175000017500000023122615174404631025046 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %select_type_13_module.shape_class = type <{ i32 (...)**, %select_type_13_module.shape* }> %select_type_13_module.shape = type {} %string_descriptor = type <{ i8*, i64 }> %select_type_13_module.circle_class = type <{ i32 (...)**, %select_type_13_module.circle* }> %select_type_13_module.circle = type { %select_type_13_module.shape, float } %select_type_13_module.rectangle_class = type <{ i32 (...)**, %select_type_13_module.rectangle* }> %select_type_13_module.rectangle = type { %select_type_13_module.shape, float, float } @_Name_shape = private unnamed_addr constant [6 x i8] c"shape\00", align 1 @_Type_Info_shape = linkonce_odr unnamed_addr constant { i8*, i8*, i8* } { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @_Name_shape, i32 0, i32 0), i8* null, i8* null }, align 8 @_VTable_shape = linkonce_odr unnamed_addr constant { [6 x i8*] } { [6 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_shape to i8*), i8* bitcast (void (i8*, i8*)* @_copy_select_type_13_module_shape to i8*), i8* bitcast (void (i8**)* @_allocate_struct_select_type_13_module_shape to i8*), i8* bitcast (void (i8*)* @finalize_StructType__shape_of_select_type_13_module_for_UPoly to i8*), i8* null] }, align 8 @_Name_circle = private unnamed_addr constant [7 x i8] c"circle\00", align 1 @_Type_Info_circle = linkonce_odr unnamed_addr constant { i8*, i8*, i8* } { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @_Name_circle, i32 0, i32 0), i8* inttoptr (i64 4 to i8*), i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_shape to i8*) }, align 8 @_VTable_circle = linkonce_odr unnamed_addr constant { [6 x i8*] } { [6 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_circle to i8*), i8* bitcast (void (i8*, i8*)* @_copy_select_type_13_module_circle to i8*), i8* bitcast (void (i8**)* @_allocate_struct_select_type_13_module_circle to i8*), i8* bitcast (void (i8*)* @finalize_StructType__circle_of_select_type_13_module_for_UPoly to i8*), i8* bitcast (float (%select_type_13_module.circle_class*)* @__module_select_type_13_module_circle_area to i8*)] }, align 8 @_Name_rectangle = private unnamed_addr constant [10 x i8] c"rectangle\00", align 1 @_Type_Info_rectangle = linkonce_odr unnamed_addr constant { i8*, i8*, i8* } { i8* getelementptr inbounds ([10 x i8], [10 x i8]* @_Name_rectangle, i32 0, i32 0), i8* inttoptr (i64 8 to i8*), i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_shape to i8*) }, align 8 @_VTable_rectangle = linkonce_odr unnamed_addr constant { [6 x i8*] } { [6 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_rectangle to i8*), i8* bitcast (void (i8*, i8*)* @_copy_select_type_13_module_rectangle to i8*), i8* bitcast (void (i8**)* @_allocate_struct_select_type_13_module_rectangle to i8*), i8* bitcast (void (i8*)* @finalize_StructType__rectangle_of_select_type_13_module_for_UPoly to i8*), i8* bitcast (float (%select_type_13_module.rectangle_class*)* @__module_select_type_13_module_rectangle_area to i8*)] }, align 8 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [20 x i8] c"Matched as rectangle" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([20 x i8], [20 x i8]* @string_const_data, i32 0, i32 0), i64 20 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [17 x i8] c"Matched as circle" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([17 x i8], [17 x i8]* @string_const_data.1, i32 0, i32 0), i64 17 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [3 x i8] c"s1\00", align 1 @5 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/select_type_13.f90\00", align 1 @6 = private unnamed_addr constant [22 x i8] c"'%s' unallocated here\00", align 1 @7 = private unnamed_addr constant [52 x i8] c"Tried to access member of unallocated variable '%s'\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @9 = private unnamed_addr constant [3 x i8] c"s1\00", align 1 @10 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/select_type_13.f90\00", align 1 @11 = private unnamed_addr constant [22 x i8] c"'%s' unallocated here\00", align 1 @12 = private unnamed_addr constant [52 x i8] c"Tried to access member of unallocated variable '%s'\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [3 x i8] c"s1\00", align 1 @15 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/select_type_13.f90\00", align 1 @16 = private unnamed_addr constant [22 x i8] c"'%s' unallocated here\00", align 1 @17 = private unnamed_addr constant [52 x i8] c"Tried to access member of unallocated variable '%s'\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.3 = private constant [16 x i8] c"Matched as shape" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([16 x i8], [16 x i8]* @string_const_data.3, i32 0, i32 0), i64 16 }> @21 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.5 = private constant [17 x i8] c"Matched as circle" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([17 x i8], [17 x i8]* @string_const_data.5, i32 0, i32 0), i64 17 }> @23 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.7 = private constant [20 x i8] c"Matched as rectangle" @string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([20 x i8], [20 x i8]* @string_const_data.7, i32 0, i32 0), i64 20 }> @25 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @26 = private unnamed_addr constant [3 x i8] c"s2\00", align 1 @27 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/select_type_13.f90\00", align 1 @28 = private unnamed_addr constant [22 x i8] c"'%s' unallocated here\00", align 1 @29 = private unnamed_addr constant [52 x i8] c"Tried to access member of unallocated variable '%s'\00", align 1 @30 = private unnamed_addr constant [3 x i8] c"s2\00", align 1 @31 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/select_type_13.f90\00", align 1 @32 = private unnamed_addr constant [22 x i8] c"'%s' unallocated here\00", align 1 @33 = private unnamed_addr constant [52 x i8] c"Tried to access member of unallocated variable '%s'\00", align 1 @34 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.9 = private unnamed_addr constant [6 x i8] c"R4,R4\00", align 1 @35 = private unnamed_addr constant [3 x i8] c"s2\00", align 1 @36 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/select_type_13.f90\00", align 1 @37 = private unnamed_addr constant [22 x i8] c"'%s' unallocated here\00", align 1 @38 = private unnamed_addr constant [52 x i8] c"Tried to access member of unallocated variable '%s'\00", align 1 @39 = private unnamed_addr constant [3 x i8] c"s2\00", align 1 @40 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/select_type_13.f90\00", align 1 @41 = private unnamed_addr constant [22 x i8] c"'%s' unallocated here\00", align 1 @42 = private unnamed_addr constant [52 x i8] c"Tried to access member of unallocated variable '%s'\00", align 1 @43 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @44 = private unnamed_addr constant [3 x i8] c"s2\00", align 1 @45 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/select_type_13.f90\00", align 1 @46 = private unnamed_addr constant [22 x i8] c"'%s' unallocated here\00", align 1 @47 = private unnamed_addr constant [52 x i8] c"Tried to access member of unallocated variable '%s'\00", align 1 @48 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @49 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @50 = private unnamed_addr constant [3 x i8] c"s2\00", align 1 @51 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/select_type_13.f90\00", align 1 @52 = private unnamed_addr constant [22 x i8] c"'%s' unallocated here\00", align 1 @53 = private unnamed_addr constant [52 x i8] c"Tried to access member of unallocated variable '%s'\00", align 1 @54 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @55 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @56 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.10 = private constant [16 x i8] c"Matched as shape" @string_const.11 = private global %string_descriptor <{ i8* getelementptr inbounds ([16 x i8], [16 x i8]* @string_const_data.10, i32 0, i32 0), i64 16 }> @57 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define float @__module_select_type_13_module_circle_area(%select_type_13_module.circle_class* %this) { .entry: %circle_area = alloca float, align 4 %0 = getelementptr %select_type_13_module.circle_class, %select_type_13_module.circle_class* %this, i32 0, i32 1 %1 = load %select_type_13_module.circle*, %select_type_13_module.circle** %0, align 8 %2 = getelementptr %select_type_13_module.circle, %select_type_13_module.circle* %1, i32 0, i32 1 %3 = load float, float* %2, align 4 %4 = fmul float 0x400921FA00000000, %3 %5 = getelementptr %select_type_13_module.circle_class, %select_type_13_module.circle_class* %this, i32 0, i32 1 %6 = load %select_type_13_module.circle*, %select_type_13_module.circle** %5, align 8 %7 = getelementptr %select_type_13_module.circle, %select_type_13_module.circle* %6, i32 0, i32 1 %8 = load float, float* %7, align 4 %9 = fmul float %4, %8 store float %9, float* %circle_area, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_circle_area FINALIZE_SYMTABLE_circle_area: ; preds = %return %10 = load float, float* %circle_area, align 4 ret float %10 } define float @__module_select_type_13_module_rectangle_area(%select_type_13_module.rectangle_class* %this) { .entry: %rectangle_area = alloca float, align 4 %0 = getelementptr %select_type_13_module.rectangle_class, %select_type_13_module.rectangle_class* %this, i32 0, i32 1 %1 = load %select_type_13_module.rectangle*, %select_type_13_module.rectangle** %0, align 8 %2 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %1, i32 0, i32 1 %3 = load float, float* %2, align 4 %4 = getelementptr %select_type_13_module.rectangle_class, %select_type_13_module.rectangle_class* %this, i32 0, i32 1 %5 = load %select_type_13_module.rectangle*, %select_type_13_module.rectangle** %4, align 8 %6 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %5, i32 0, i32 2 %7 = load float, float* %6, align 4 %8 = fmul float %3, %7 store float %8, float* %rectangle_area, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_rectangle_area FINALIZE_SYMTABLE_rectangle_area: ; preds = %return %9 = load float, float* %rectangle_area, align 4 ret float %9 } define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc35 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %s1 = alloca %select_type_13_module.shape_class*, align 8 store %select_type_13_module.shape_class* null, %select_type_13_module.shape_class** %s1, align 8 %s2 = alloca %select_type_13_module.shape_class*, align 8 store %select_type_13_module.shape_class* null, %select_type_13_module.shape_class** %s2, align 8 %3 = call i8* @_lfortran_get_default_allocator() %4 = call i8* @_lfortran_malloc_alloc(i8* %3, i64 4) call void @llvm.memset.p0i8.i32(i8* %4, i8 0, i32 4, i1 false) %5 = call i8* @_lfortran_get_default_allocator() %6 = call i8* @_lfortran_malloc_alloc(i8* %5, i64 16) call void @llvm.memset.p0i8.i32(i8* %6, i8 0, i32 16, i1 false) %7 = bitcast i8* %6 to %select_type_13_module.shape_class* store %select_type_13_module.shape_class* %7, %select_type_13_module.shape_class** %s1, align 8 %8 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s1, align 8 %9 = getelementptr %select_type_13_module.shape_class, %select_type_13_module.shape_class* %8, i32 0, i32 1 %10 = bitcast i8* %4 to %select_type_13_module.shape* store %select_type_13_module.shape* %10, %select_type_13_module.shape** %9, align 8 %11 = load %select_type_13_module.shape*, %select_type_13_module.shape** %9, align 8 %12 = bitcast %select_type_13_module.shape* %11 to %select_type_13_module.circle* %13 = bitcast %select_type_13_module.shape_class* %7 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_circle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %13, align 8 %14 = getelementptr %select_type_13_module.circle, %select_type_13_module.circle* %12, i32 0, i32 1 %15 = getelementptr %select_type_13_module.circle, %select_type_13_module.circle* %12, i32 0, i32 0 %16 = alloca i1, align 1 %17 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s1, align 8 %18 = ptrtoint %select_type_13_module.shape_class* %17 to i64 %19 = icmp eq i64 %18, 0 br i1 %19, label %then1, label %else then: ; preds = %ifcont br label %"~select_type_block_.start" then1: ; preds = %.entry %20 = alloca i32 (...)**, align 8 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_shape, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %20, align 8 %21 = bitcast i32 (...)*** %20 to i8* %22 = call i8* @__lfortran_dynamic_cast(i8* %21, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_rectangle to i8*), i1 false) %23 = icmp ne i8* %22, null store i1 %23, i1* %16, align 1 br label %ifcont else: ; preds = %.entry %24 = bitcast %select_type_13_module.shape_class* %17 to i8* %25 = call i8* @__lfortran_dynamic_cast(i8* %24, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_rectangle to i8*), i1 false) %26 = icmp ne i8* %25, null store i1 %26, i1* %16, align 1 br label %ifcont ifcont: ; preds = %else, %then1 %27 = load i1, i1* %16, align 1 br i1 %27, label %then, label %else2 "~select_type_block_.start": ; preds = %then %28 = call i8* @llvm.stacksave() %29 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %29, i32 20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %"~select_type_block_.end" "~select_type_block_.end": ; preds = %"~select_type_block_.start" br label %"FINALIZE_SYMTABLE_~select_type_block_" "FINALIZE_SYMTABLE_~select_type_block_": ; preds = %"~select_type_block_.end" call void @llvm.stackrestore(i8* %28) br label %ifcont17 else2: ; preds = %ifcont %30 = alloca i1, align 1 %31 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s1, align 8 %32 = ptrtoint %select_type_13_module.shape_class* %31 to i64 %33 = icmp eq i64 %32, 0 br i1 %33, label %then4, label %else5 then3: ; preds = %ifcont6 br label %"~select_type_block_1.start" then4: ; preds = %else2 %34 = alloca i32 (...)**, align 8 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_shape, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %34, align 8 %35 = bitcast i32 (...)*** %34 to i8* %36 = call i8* @__lfortran_dynamic_cast(i8* %35, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_circle to i8*), i1 false) %37 = icmp ne i8* %36, null store i1 %37, i1* %30, align 1 br label %ifcont6 else5: ; preds = %else2 %38 = bitcast %select_type_13_module.shape_class* %31 to i8* %39 = call i8* @__lfortran_dynamic_cast(i8* %38, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_circle to i8*), i1 false) %40 = icmp ne i8* %39, null store i1 %40, i1* %30, align 1 br label %ifcont6 ifcont6: ; preds = %else5, %then4 %41 = load i1, i1* %30, align 1 br i1 %41, label %then3, label %else16 "~select_type_block_1.start": ; preds = %then3 %42 = call i8* @llvm.stacksave() %43 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %43, i32 17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %44 = load %select_type_13_module.shape_class**, %select_type_13_module.shape_class** %s1, align 8 %45 = ptrtoint %select_type_13_module.shape_class** %44 to i64 %46 = icmp eq i64 %45, 0 br i1 %46, label %then7, label %ifcont8 then7: ; preds = %"~select_type_block_1.start" %47 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %48 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %49 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %48, i32 0, i32 0 %50 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %49, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @5, i32 0, i32 0), i8** %50, align 8 %51 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %49, i32 0, i32 1 store i32 56, i32* %51, align 4 %52 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %49, i32 0, i32 2 store i32 7, i32* %52, align 4 %53 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %49, i32 0, i32 3 store i32 56, i32* %53, align 4 %54 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %49, i32 0, i32 4 store i32 10, i32* %54, align 4 %55 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @6, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @4, i32 0, i32 0)) %56 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %47, i32 0, i32 0 %57 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %48, i32 0, i32 0 %58 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %56, i32 0, i32 2 %59 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %56, i32 0, i32 0 store i1 true, i1* %59, align 1 %60 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %56, i32 0, i32 1 store i8* %55, i8** %60, align 8 store { i8*, i32, i32, i32, i32 }* %57, { i8*, i32, i32, i32, i32 }** %58, align 8 %61 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %56, i32 0, i32 3 store i32 1, i32* %61, align 4 %62 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %47, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %62, i32 1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont8: ; preds = %"~select_type_block_1.start" %63 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s1, align 8 %64 = load %select_type_13_module.shape_class, %select_type_13_module.shape_class* %63, align 1 %65 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s1, align 8 %66 = bitcast %select_type_13_module.shape_class* %65 to %select_type_13_module.circle_class* %67 = getelementptr %select_type_13_module.circle_class, %select_type_13_module.circle_class* %66, i32 0, i32 1 %68 = load %select_type_13_module.circle*, %select_type_13_module.circle** %67, align 8 %69 = getelementptr %select_type_13_module.circle, %select_type_13_module.circle* %68, i32 0, i32 1 store float 1.000000e+01, float* %69, align 4 %70 = alloca i64, align 8 %71 = load %select_type_13_module.shape_class**, %select_type_13_module.shape_class** %s1, align 8 %72 = ptrtoint %select_type_13_module.shape_class** %71 to i64 %73 = icmp eq i64 %72, 0 br i1 %73, label %then9, label %ifcont10 then9: ; preds = %ifcont8 %74 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %75 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %76 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %75, i32 0, i32 0 %77 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %76, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @10, i32 0, i32 0), i8** %77, align 8 %78 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %76, i32 0, i32 1 store i32 57, i32* %78, align 4 %79 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %76, i32 0, i32 2 store i32 16, i32* %79, align 4 %80 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %76, i32 0, i32 3 store i32 57, i32* %80, align 4 %81 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %76, i32 0, i32 4 store i32 19, i32* %81, align 4 %82 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @9, i32 0, i32 0)) %83 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %74, i32 0, i32 0 %84 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %75, i32 0, i32 0 %85 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %83, i32 0, i32 2 %86 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %83, i32 0, i32 0 store i1 true, i1* %86, align 1 %87 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %83, i32 0, i32 1 store i8* %82, i8** %87, align 8 store { i8*, i32, i32, i32, i32 }* %84, { i8*, i32, i32, i32, i32 }** %85, align 8 %88 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %83, i32 0, i32 3 store i32 1, i32* %88, align 4 %89 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %74, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %89, i32 1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @12, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @9, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont10: ; preds = %ifcont8 %90 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s1, align 8 %91 = load %select_type_13_module.shape_class, %select_type_13_module.shape_class* %90, align 1 %92 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s1, align 8 %93 = bitcast %select_type_13_module.shape_class* %92 to %select_type_13_module.circle_class* %94 = getelementptr %select_type_13_module.circle_class, %select_type_13_module.circle_class* %93, i32 0, i32 1 %95 = load %select_type_13_module.circle*, %select_type_13_module.circle** %94, align 8 %96 = getelementptr %select_type_13_module.circle, %select_type_13_module.circle* %95, i32 0, i32 1 %97 = load float, float* %96, align 4 %98 = alloca float, align 4 store float %97, float* %98, align 4 %99 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %70, i32 0, i32 0, i32 0, i32 0, i32 0, float* %98) %100 = load i64, i64* %70, align 8 %101 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %99, i8** %101, align 8 %102 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %100, i64* %102, align 8 %103 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %104 = load i8*, i8** %103, align 8 %105 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %106 = load i64, i64* %105, align 8 %107 = trunc i64 %106 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %104, i32 %107, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %108 = icmp eq i8* %99, null br i1 %108, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont10 call void @_lfortran_free_alloc(i8* %2, i8* %99) br label %free_done free_done: ; preds = %free_nonnull, %ifcont10 %109 = load %select_type_13_module.shape_class**, %select_type_13_module.shape_class** %s1, align 8 %110 = ptrtoint %select_type_13_module.shape_class** %109 to i64 %111 = icmp eq i64 %110, 0 br i1 %111, label %then11, label %ifcont12 then11: ; preds = %free_done %112 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %113 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %114 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %113, i32 0, i32 0 %115 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %114, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @15, i32 0, i32 0), i8** %115, align 8 %116 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %114, i32 0, i32 1 store i32 58, i32* %116, align 4 %117 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %114, i32 0, i32 2 store i32 11, i32* %117, align 4 %118 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %114, i32 0, i32 3 store i32 58, i32* %118, align 4 %119 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %114, i32 0, i32 4 store i32 14, i32* %119, align 4 %120 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @16, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @14, i32 0, i32 0)) %121 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %112, i32 0, i32 0 %122 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %113, i32 0, i32 0 %123 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %121, i32 0, i32 2 %124 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %121, i32 0, i32 0 store i1 true, i1* %124, align 1 %125 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %121, i32 0, i32 1 store i8* %120, i8** %125, align 8 store { i8*, i32, i32, i32, i32 }* %122, { i8*, i32, i32, i32, i32 }** %123, align 8 %126 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %121, i32 0, i32 3 store i32 1, i32* %126, align 4 %127 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %112, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %127, i32 1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @14, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont12: ; preds = %free_done %128 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s1, align 8 %129 = load %select_type_13_module.shape_class, %select_type_13_module.shape_class* %128, align 1 %130 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s1, align 8 %131 = bitcast %select_type_13_module.shape_class* %130 to %select_type_13_module.circle_class* %132 = getelementptr %select_type_13_module.circle_class, %select_type_13_module.circle_class* %131, i32 0, i32 1 %133 = load %select_type_13_module.circle*, %select_type_13_module.circle** %132, align 8 %134 = getelementptr %select_type_13_module.circle, %select_type_13_module.circle* %133, i32 0, i32 1 %135 = load float, float* %134, align 4 %136 = fcmp une float %135, 1.000000e+01 br i1 %136, label %then13, label %else14 then13: ; preds = %ifcont12 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont15 else14: ; preds = %ifcont12 br label %ifcont15 ifcont15: ; preds = %else14, %then13 br label %"~select_type_block_1.end" "~select_type_block_1.end": ; preds = %ifcont15 br label %"FINALIZE_SYMTABLE_~select_type_block_1" "FINALIZE_SYMTABLE_~select_type_block_1": ; preds = %"~select_type_block_1.end" call void @llvm.stackrestore(i8* %42) br label %ifcont17 else16: ; preds = %ifcont6 br label %"~select_type_block_2.start" "~select_type_block_2.start": ; preds = %else16 %137 = call i8* @llvm.stacksave() %138 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @21, i32 0, i32 0), i8* %138, i32 16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0), i32 1) br label %"~select_type_block_2.end" "~select_type_block_2.end": ; preds = %"~select_type_block_2.start" br label %"FINALIZE_SYMTABLE_~select_type_block_2" "FINALIZE_SYMTABLE_~select_type_block_2": ; preds = %"~select_type_block_2.end" call void @llvm.stackrestore(i8* %137) br label %ifcont17 ifcont17: ; preds = %"FINALIZE_SYMTABLE_~select_type_block_2", %"FINALIZE_SYMTABLE_~select_type_block_1", %"FINALIZE_SYMTABLE_~select_type_block_" %139 = call i8* @_lfortran_get_default_allocator() %140 = call i8* @_lfortran_malloc_alloc(i8* %139, i64 8) call void @llvm.memset.p0i8.i32(i8* %140, i8 0, i32 8, i1 false) %141 = call i8* @_lfortran_get_default_allocator() %142 = call i8* @_lfortran_malloc_alloc(i8* %141, i64 16) call void @llvm.memset.p0i8.i32(i8* %142, i8 0, i32 16, i1 false) %143 = bitcast i8* %142 to %select_type_13_module.shape_class* store %select_type_13_module.shape_class* %143, %select_type_13_module.shape_class** %s2, align 8 %144 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s2, align 8 %145 = getelementptr %select_type_13_module.shape_class, %select_type_13_module.shape_class* %144, i32 0, i32 1 %146 = bitcast i8* %140 to %select_type_13_module.shape* store %select_type_13_module.shape* %146, %select_type_13_module.shape** %145, align 8 %147 = load %select_type_13_module.shape*, %select_type_13_module.shape** %145, align 8 %148 = bitcast %select_type_13_module.shape* %147 to %select_type_13_module.rectangle* %149 = bitcast %select_type_13_module.shape_class* %143 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_rectangle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %149, align 8 %150 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %148, i32 0, i32 1 %151 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %148, i32 0, i32 2 %152 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %148, i32 0, i32 0 %153 = alloca i1, align 1 %154 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s2, align 8 %155 = ptrtoint %select_type_13_module.shape_class* %154 to i64 %156 = icmp eq i64 %155, 0 br i1 %156, label %then19, label %else20 then18: ; preds = %ifcont21 br label %"~select_type_block_3.start" then19: ; preds = %ifcont17 %157 = alloca i32 (...)**, align 8 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_shape, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %157, align 8 %158 = bitcast i32 (...)*** %157 to i8* %159 = call i8* @__lfortran_dynamic_cast(i8* %158, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_circle to i8*), i1 false) %160 = icmp ne i8* %159, null store i1 %160, i1* %153, align 1 br label %ifcont21 else20: ; preds = %ifcont17 %161 = bitcast %select_type_13_module.shape_class* %154 to i8* %162 = call i8* @__lfortran_dynamic_cast(i8* %161, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_circle to i8*), i1 false) %163 = icmp ne i8* %162, null store i1 %163, i1* %153, align 1 br label %ifcont21 ifcont21: ; preds = %else20, %then19 %164 = load i1, i1* %153, align 1 br i1 %164, label %then18, label %else22 "~select_type_block_3.start": ; preds = %then18 %165 = call i8* @llvm.stacksave() %166 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.6, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @23, i32 0, i32 0), i8* %166, i32 17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0), i32 1) br label %"~select_type_block_3.end" "~select_type_block_3.end": ; preds = %"~select_type_block_3.start" br label %"FINALIZE_SYMTABLE_~select_type_block_3" "FINALIZE_SYMTABLE_~select_type_block_3": ; preds = %"~select_type_block_3.end" call void @llvm.stackrestore(i8* %165) br label %ifcont49 else22: ; preds = %ifcont21 %167 = alloca i1, align 1 %168 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s2, align 8 %169 = ptrtoint %select_type_13_module.shape_class* %168 to i64 %170 = icmp eq i64 %169, 0 br i1 %170, label %then24, label %else25 then23: ; preds = %ifcont26 br label %"~select_type_block_4.start" then24: ; preds = %else22 %171 = alloca i32 (...)**, align 8 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_shape, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %171, align 8 %172 = bitcast i32 (...)*** %171 to i8* %173 = call i8* @__lfortran_dynamic_cast(i8* %172, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_rectangle to i8*), i1 false) %174 = icmp ne i8* %173, null store i1 %174, i1* %167, align 1 br label %ifcont26 else25: ; preds = %else22 %175 = bitcast %select_type_13_module.shape_class* %168 to i8* %176 = call i8* @__lfortran_dynamic_cast(i8* %175, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_rectangle to i8*), i1 false) %177 = icmp ne i8* %176, null store i1 %177, i1* %167, align 1 br label %ifcont26 ifcont26: ; preds = %else25, %then24 %178 = load i1, i1* %167, align 1 br i1 %178, label %then23, label %else48 "~select_type_block_4.start": ; preds = %then23 %179 = call i8* @llvm.stacksave() %180 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.8, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @25, i32 0, i32 0), i8* %180, i32 20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0), i32 1) %181 = load %select_type_13_module.shape_class**, %select_type_13_module.shape_class** %s2, align 8 %182 = ptrtoint %select_type_13_module.shape_class** %181 to i64 %183 = icmp eq i64 %182, 0 br i1 %183, label %then27, label %ifcont28 then27: ; preds = %"~select_type_block_4.start" %184 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %185 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %186 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %185, i32 0, i32 0 %187 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %186, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @27, i32 0, i32 0), i8** %187, align 8 %188 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %186, i32 0, i32 1 store i32 72, i32* %188, align 4 %189 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %186, i32 0, i32 2 store i32 7, i32* %189, align 4 %190 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %186, i32 0, i32 3 store i32 72, i32* %190, align 4 %191 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %186, i32 0, i32 4 store i32 10, i32* %191, align 4 %192 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @28, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @26, i32 0, i32 0)) %193 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %184, i32 0, i32 0 %194 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %185, i32 0, i32 0 %195 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %193, i32 0, i32 2 %196 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %193, i32 0, i32 0 store i1 true, i1* %196, align 1 %197 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %193, i32 0, i32 1 store i8* %192, i8** %197, align 8 store { i8*, i32, i32, i32, i32 }* %194, { i8*, i32, i32, i32, i32 }** %195, align 8 %198 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %193, i32 0, i32 3 store i32 1, i32* %198, align 4 %199 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %184, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %199, i32 1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @29, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @26, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont28: ; preds = %"~select_type_block_4.start" %200 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s2, align 8 %201 = load %select_type_13_module.shape_class, %select_type_13_module.shape_class* %200, align 1 %202 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s2, align 8 %203 = bitcast %select_type_13_module.shape_class* %202 to %select_type_13_module.rectangle_class* %204 = getelementptr %select_type_13_module.rectangle_class, %select_type_13_module.rectangle_class* %203, i32 0, i32 1 %205 = load %select_type_13_module.rectangle*, %select_type_13_module.rectangle** %204, align 8 %206 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %205, i32 0, i32 1 store float 5.000000e+00, float* %206, align 4 %207 = load %select_type_13_module.shape_class**, %select_type_13_module.shape_class** %s2, align 8 %208 = ptrtoint %select_type_13_module.shape_class** %207 to i64 %209 = icmp eq i64 %208, 0 br i1 %209, label %then29, label %ifcont30 then29: ; preds = %ifcont28 %210 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %211 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %212 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %211, i32 0, i32 0 %213 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %212, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @31, i32 0, i32 0), i8** %213, align 8 %214 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %212, i32 0, i32 1 store i32 73, i32* %214, align 4 %215 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %212, i32 0, i32 2 store i32 7, i32* %215, align 4 %216 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %212, i32 0, i32 3 store i32 73, i32* %216, align 4 %217 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %212, i32 0, i32 4 store i32 10, i32* %217, align 4 %218 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @32, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @30, i32 0, i32 0)) %219 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %210, i32 0, i32 0 %220 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %211, i32 0, i32 0 %221 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %219, i32 0, i32 2 %222 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %219, i32 0, i32 0 store i1 true, i1* %222, align 1 %223 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %219, i32 0, i32 1 store i8* %218, i8** %223, align 8 store { i8*, i32, i32, i32, i32 }* %220, { i8*, i32, i32, i32, i32 }** %221, align 8 %224 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %219, i32 0, i32 3 store i32 1, i32* %224, align 4 %225 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %210, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %225, i32 1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @33, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @30, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont30: ; preds = %ifcont28 %226 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s2, align 8 %227 = load %select_type_13_module.shape_class, %select_type_13_module.shape_class* %226, align 1 %228 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s2, align 8 %229 = bitcast %select_type_13_module.shape_class* %228 to %select_type_13_module.rectangle_class* %230 = getelementptr %select_type_13_module.rectangle_class, %select_type_13_module.rectangle_class* %229, i32 0, i32 1 %231 = load %select_type_13_module.rectangle*, %select_type_13_module.rectangle** %230, align 8 %232 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %231, i32 0, i32 2 store float 4.000000e+00, float* %232, align 4 %233 = alloca i64, align 8 %234 = load %select_type_13_module.shape_class**, %select_type_13_module.shape_class** %s2, align 8 %235 = ptrtoint %select_type_13_module.shape_class** %234 to i64 %236 = icmp eq i64 %235, 0 br i1 %236, label %then31, label %ifcont32 then31: ; preds = %ifcont30 %237 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %238 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %239 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %238, i32 0, i32 0 %240 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %239, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @36, i32 0, i32 0), i8** %240, align 8 %241 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %239, i32 0, i32 1 store i32 74, i32* %241, align 4 %242 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %239, i32 0, i32 2 store i32 16, i32* %242, align 4 %243 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %239, i32 0, i32 3 store i32 74, i32* %243, align 4 %244 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %239, i32 0, i32 4 store i32 19, i32* %244, align 4 %245 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @37, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @35, i32 0, i32 0)) %246 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %237, i32 0, i32 0 %247 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %238, i32 0, i32 0 %248 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %246, i32 0, i32 2 %249 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %246, i32 0, i32 0 store i1 true, i1* %249, align 1 %250 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %246, i32 0, i32 1 store i8* %245, i8** %250, align 8 store { i8*, i32, i32, i32, i32 }* %247, { i8*, i32, i32, i32, i32 }** %248, align 8 %251 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %246, i32 0, i32 3 store i32 1, i32* %251, align 4 %252 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %237, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %252, i32 1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @38, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @35, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont32: ; preds = %ifcont30 %253 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s2, align 8 %254 = load %select_type_13_module.shape_class, %select_type_13_module.shape_class* %253, align 1 %255 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s2, align 8 %256 = bitcast %select_type_13_module.shape_class* %255 to %select_type_13_module.rectangle_class* %257 = getelementptr %select_type_13_module.rectangle_class, %select_type_13_module.rectangle_class* %256, i32 0, i32 1 %258 = load %select_type_13_module.rectangle*, %select_type_13_module.rectangle** %257, align 8 %259 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %258, i32 0, i32 1 %260 = load float, float* %259, align 4 %261 = alloca float, align 4 store float %260, float* %261, align 4 %262 = load %select_type_13_module.shape_class**, %select_type_13_module.shape_class** %s2, align 8 %263 = ptrtoint %select_type_13_module.shape_class** %262 to i64 %264 = icmp eq i64 %263, 0 br i1 %264, label %then33, label %ifcont34 then33: ; preds = %ifcont32 %265 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %266 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %267 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %266, i32 0, i32 0 %268 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %267, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @40, i32 0, i32 0), i8** %268, align 8 %269 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %267, i32 0, i32 1 store i32 74, i32* %269, align 4 %270 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %267, i32 0, i32 2 store i32 22, i32* %270, align 4 %271 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %267, i32 0, i32 3 store i32 74, i32* %271, align 4 %272 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %267, i32 0, i32 4 store i32 25, i32* %272, align 4 %273 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @39, i32 0, i32 0)) %274 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %265, i32 0, i32 0 %275 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %266, i32 0, i32 0 %276 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %274, i32 0, i32 2 %277 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %274, i32 0, i32 0 store i1 true, i1* %277, align 1 %278 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %274, i32 0, i32 1 store i8* %273, i8** %278, align 8 store { i8*, i32, i32, i32, i32 }* %275, { i8*, i32, i32, i32, i32 }** %276, align 8 %279 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %274, i32 0, i32 3 store i32 1, i32* %279, align 4 %280 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %265, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %280, i32 1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @42, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @39, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont34: ; preds = %ifcont32 %281 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s2, align 8 %282 = load %select_type_13_module.shape_class, %select_type_13_module.shape_class* %281, align 1 %283 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s2, align 8 %284 = bitcast %select_type_13_module.shape_class* %283 to %select_type_13_module.rectangle_class* %285 = getelementptr %select_type_13_module.rectangle_class, %select_type_13_module.rectangle_class* %284, i32 0, i32 1 %286 = load %select_type_13_module.rectangle*, %select_type_13_module.rectangle** %285, align 8 %287 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %286, i32 0, i32 2 %288 = load float, float* %287, align 4 %289 = alloca float, align 4 store float %288, float* %289, align 4 %290 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info.9, i32 0, i32 0), i64* %233, i32 0, i32 0, i32 0, i32 0, i32 0, float* %261, float* %289) %291 = load i64, i64* %233, align 8 %292 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc35, i32 0, i32 0 store i8* %290, i8** %292, align 8 %293 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc35, i32 0, i32 1 store i64 %291, i64* %293, align 8 %294 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc35, i32 0, i32 0 %295 = load i8*, i8** %294, align 8 %296 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc35, i32 0, i32 1 %297 = load i64, i64* %296, align 8 %298 = trunc i64 %297 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @43, i32 0, i32 0), i8* %295, i32 %298, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @34, i32 0, i32 0), i32 1) %299 = icmp eq i8* %290, null br i1 %299, label %free_done37, label %free_nonnull36 free_nonnull36: ; preds = %ifcont34 call void @_lfortran_free_alloc(i8* %2, i8* %290) br label %free_done37 free_done37: ; preds = %free_nonnull36, %ifcont34 %300 = load %select_type_13_module.shape_class**, %select_type_13_module.shape_class** %s2, align 8 %301 = ptrtoint %select_type_13_module.shape_class** %300 to i64 %302 = icmp eq i64 %301, 0 br i1 %302, label %then38, label %ifcont39 then38: ; preds = %free_done37 %303 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %304 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %305 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %304, i32 0, i32 0 %306 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %305, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @45, i32 0, i32 0), i8** %306, align 8 %307 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %305, i32 0, i32 1 store i32 75, i32* %307, align 4 %308 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %305, i32 0, i32 2 store i32 11, i32* %308, align 4 %309 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %305, i32 0, i32 3 store i32 75, i32* %309, align 4 %310 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %305, i32 0, i32 4 store i32 14, i32* %310, align 4 %311 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @46, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @44, i32 0, i32 0)) %312 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %303, i32 0, i32 0 %313 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %304, i32 0, i32 0 %314 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %312, i32 0, i32 2 %315 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %312, i32 0, i32 0 store i1 true, i1* %315, align 1 %316 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %312, i32 0, i32 1 store i8* %311, i8** %316, align 8 store { i8*, i32, i32, i32, i32 }* %313, { i8*, i32, i32, i32, i32 }** %314, align 8 %317 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %312, i32 0, i32 3 store i32 1, i32* %317, align 4 %318 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %303, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %318, i32 1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @47, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @44, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont39: ; preds = %free_done37 %319 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s2, align 8 %320 = load %select_type_13_module.shape_class, %select_type_13_module.shape_class* %319, align 1 %321 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s2, align 8 %322 = bitcast %select_type_13_module.shape_class* %321 to %select_type_13_module.rectangle_class* %323 = getelementptr %select_type_13_module.rectangle_class, %select_type_13_module.rectangle_class* %322, i32 0, i32 1 %324 = load %select_type_13_module.rectangle*, %select_type_13_module.rectangle** %323, align 8 %325 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %324, i32 0, i32 1 %326 = load float, float* %325, align 4 %327 = fcmp une float %326, 5.000000e+00 br i1 %327, label %then40, label %else41 then40: ; preds = %ifcont39 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @49, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @48, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont42 else41: ; preds = %ifcont39 br label %ifcont42 ifcont42: ; preds = %else41, %then40 %328 = load %select_type_13_module.shape_class**, %select_type_13_module.shape_class** %s2, align 8 %329 = ptrtoint %select_type_13_module.shape_class** %328 to i64 %330 = icmp eq i64 %329, 0 br i1 %330, label %then43, label %ifcont44 then43: ; preds = %ifcont42 %331 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %332 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %333 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %332, i32 0, i32 0 %334 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %333, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @51, i32 0, i32 0), i8** %334, align 8 %335 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %333, i32 0, i32 1 store i32 76, i32* %335, align 4 %336 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %333, i32 0, i32 2 store i32 11, i32* %336, align 4 %337 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %333, i32 0, i32 3 store i32 76, i32* %337, align 4 %338 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %333, i32 0, i32 4 store i32 14, i32* %338, align 4 %339 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @52, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @50, i32 0, i32 0)) %340 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %331, i32 0, i32 0 %341 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %332, i32 0, i32 0 %342 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %340, i32 0, i32 2 %343 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %340, i32 0, i32 0 store i1 true, i1* %343, align 1 %344 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %340, i32 0, i32 1 store i8* %339, i8** %344, align 8 store { i8*, i32, i32, i32, i32 }* %341, { i8*, i32, i32, i32, i32 }** %342, align 8 %345 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %340, i32 0, i32 3 store i32 1, i32* %345, align 4 %346 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %331, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %346, i32 1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @53, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @50, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont44: ; preds = %ifcont42 %347 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s2, align 8 %348 = load %select_type_13_module.shape_class, %select_type_13_module.shape_class* %347, align 1 %349 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s2, align 8 %350 = bitcast %select_type_13_module.shape_class* %349 to %select_type_13_module.rectangle_class* %351 = getelementptr %select_type_13_module.rectangle_class, %select_type_13_module.rectangle_class* %350, i32 0, i32 1 %352 = load %select_type_13_module.rectangle*, %select_type_13_module.rectangle** %351, align 8 %353 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %352, i32 0, i32 2 %354 = load float, float* %353, align 4 %355 = fcmp une float %354, 4.000000e+00 br i1 %355, label %then45, label %else46 then45: ; preds = %ifcont44 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @55, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @54, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont47 else46: ; preds = %ifcont44 br label %ifcont47 ifcont47: ; preds = %else46, %then45 br label %"~select_type_block_4.end" "~select_type_block_4.end": ; preds = %ifcont47 br label %"FINALIZE_SYMTABLE_~select_type_block_4" "FINALIZE_SYMTABLE_~select_type_block_4": ; preds = %"~select_type_block_4.end" call void @llvm.stackrestore(i8* %179) br label %ifcont49 else48: ; preds = %ifcont26 br label %"~select_type_block_5.start" "~select_type_block_5.start": ; preds = %else48 %356 = call i8* @llvm.stacksave() %357 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.11, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @57, i32 0, i32 0), i8* %357, i32 16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @56, i32 0, i32 0), i32 1) br label %"~select_type_block_5.end" "~select_type_block_5.end": ; preds = %"~select_type_block_5.start" br label %"FINALIZE_SYMTABLE_~select_type_block_5" "FINALIZE_SYMTABLE_~select_type_block_5": ; preds = %"~select_type_block_5.end" call void @llvm.stackrestore(i8* %356) br label %ifcont49 ifcont49: ; preds = %"FINALIZE_SYMTABLE_~select_type_block_5", %"FINALIZE_SYMTABLE_~select_type_block_4", %"FINALIZE_SYMTABLE_~select_type_block_3" br label %return return: ; preds = %ifcont49 br label %FINALIZE_SYMTABLE_select_type_13 FINALIZE_SYMTABLE_select_type_13: ; preds = %return br label %Finalize_Variable_s1 Finalize_Variable_s1: ; preds = %FINALIZE_SYMTABLE_select_type_13 %358 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s1, align 8 call void @finalize_allocatable__StructType_Class__shape_of_select_type_13_module(%select_type_13_module.shape_class* %358) br label %Finalize_Variable_s2 Finalize_Variable_s2: ; preds = %Finalize_Variable_s1 %359 = load %select_type_13_module.shape_class*, %select_type_13_module.shape_class** %s2, align 8 call void @finalize_allocatable__StructType_Class__shape_of_select_type_13_module(%select_type_13_module.shape_class* %359) call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc_alloc(i8*, i64) declare i8* @_lfortran_get_default_allocator() ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 define linkonce_odr void @_copy_select_type_13_module_shape(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %select_type_13_module.shape* %3 = bitcast i8* %1 to %select_type_13_module.shape* ret void } define linkonce_odr void @_allocate_struct_select_type_13_module_shape(i8** %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = call i8* @_lfortran_malloc_alloc(i8* %1, i64 16) call void @llvm.memset.p0i8.i32(i8* %2, i8 0, i32 16, i1 false) store i8* %2, i8** %0, align 8 %3 = load i8*, i8** %0, align 8 %4 = bitcast i8* %3 to %select_type_13_module.shape_class* %5 = bitcast %select_type_13_module.shape_class* %4 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_shape, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %5, align 8 %6 = getelementptr %select_type_13_module.shape_class, %select_type_13_module.shape_class* %4, i32 0, i32 1 %7 = call i8* @_lfortran_get_default_allocator() %8 = call i8* @_lfortran_malloc_alloc(i8* %7, i64 0) call void @llvm.memset.p0i8.i32(i8* %8, i8 0, i32 0, i1 false) %9 = bitcast i8* %8 to %select_type_13_module.shape* store %select_type_13_module.shape* %9, %select_type_13_module.shape** %6, align 8 ret void } define internal void @finalize_StructType__shape_of_select_type_13_module_for_UPoly(i8* %0) { entry: %1 = bitcast i8* %0 to %select_type_13_module.shape* ret void } define linkonce_odr void @_copy_select_type_13_module_circle(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %select_type_13_module.circle* %3 = bitcast i8* %1 to %select_type_13_module.circle* %4 = getelementptr %select_type_13_module.circle, %select_type_13_module.circle* %2, i32 0, i32 1 %5 = load float, float* %4, align 4 %6 = getelementptr %select_type_13_module.circle, %select_type_13_module.circle* %3, i32 0, i32 1 br i1 true, label %then, label %else then: ; preds = %entry store float %5, float* %6, align 4 br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then %7 = getelementptr %select_type_13_module.circle, %select_type_13_module.circle* %2, i32 0, i32 0 %8 = getelementptr %select_type_13_module.circle, %select_type_13_module.circle* %3, i32 0, i32 0 ret void } define linkonce_odr void @_allocate_struct_select_type_13_module_circle(i8** %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = call i8* @_lfortran_malloc_alloc(i8* %1, i64 16) call void @llvm.memset.p0i8.i32(i8* %2, i8 0, i32 16, i1 false) store i8* %2, i8** %0, align 8 %3 = load i8*, i8** %0, align 8 %4 = bitcast i8* %3 to %select_type_13_module.circle_class* %5 = bitcast %select_type_13_module.circle_class* %4 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_circle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %5, align 8 %6 = getelementptr %select_type_13_module.circle_class, %select_type_13_module.circle_class* %4, i32 0, i32 1 %7 = call i8* @_lfortran_get_default_allocator() %8 = call i8* @_lfortran_malloc_alloc(i8* %7, i64 4) call void @llvm.memset.p0i8.i32(i8* %8, i8 0, i32 4, i1 false) %9 = bitcast i8* %8 to %select_type_13_module.circle* store %select_type_13_module.circle* %9, %select_type_13_module.circle** %6, align 8 %10 = getelementptr %select_type_13_module.circle, %select_type_13_module.circle* %9, i32 0, i32 1 %11 = getelementptr %select_type_13_module.circle, %select_type_13_module.circle* %9, i32 0, i32 0 ret void } define internal void @finalize_StructType__circle_of_select_type_13_module_for_UPoly(i8* %0) { entry: %1 = bitcast i8* %0 to %select_type_13_module.circle* ret void } define linkonce_odr void @_copy_select_type_13_module_rectangle(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %select_type_13_module.rectangle* %3 = bitcast i8* %1 to %select_type_13_module.rectangle* %4 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %2, i32 0, i32 1 %5 = load float, float* %4, align 4 %6 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %3, i32 0, i32 1 br i1 true, label %then, label %else then: ; preds = %entry store float %5, float* %6, align 4 br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then %7 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %2, i32 0, i32 2 %8 = load float, float* %7, align 4 %9 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %3, i32 0, i32 2 br i1 true, label %then1, label %else2 then1: ; preds = %ifcont store float %8, float* %9, align 4 br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %10 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %2, i32 0, i32 0 %11 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %3, i32 0, i32 0 ret void } define linkonce_odr void @_allocate_struct_select_type_13_module_rectangle(i8** %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = call i8* @_lfortran_malloc_alloc(i8* %1, i64 16) call void @llvm.memset.p0i8.i32(i8* %2, i8 0, i32 16, i1 false) store i8* %2, i8** %0, align 8 %3 = load i8*, i8** %0, align 8 %4 = bitcast i8* %3 to %select_type_13_module.rectangle_class* %5 = bitcast %select_type_13_module.rectangle_class* %4 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_rectangle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %5, align 8 %6 = getelementptr %select_type_13_module.rectangle_class, %select_type_13_module.rectangle_class* %4, i32 0, i32 1 %7 = call i8* @_lfortran_get_default_allocator() %8 = call i8* @_lfortran_malloc_alloc(i8* %7, i64 8) call void @llvm.memset.p0i8.i32(i8* %8, i8 0, i32 8, i1 false) %9 = bitcast i8* %8 to %select_type_13_module.rectangle* store %select_type_13_module.rectangle* %9, %select_type_13_module.rectangle** %6, align 8 %10 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %9, i32 0, i32 1 %11 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %9, i32 0, i32 2 %12 = getelementptr %select_type_13_module.rectangle, %select_type_13_module.rectangle* %9, i32 0, i32 0 ret void } define internal void @finalize_StructType__rectangle_of_select_type_13_module_for_UPoly(i8* %0) { entry: %1 = bitcast i8* %0 to %select_type_13_module.rectangle* ret void } declare i8* @__lfortran_dynamic_cast(i8*, i8*, i1) ; Function Attrs: nounwind declare i8* @llvm.stacksave() #1 declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) ; Function Attrs: nounwind declare void @llvm.stackrestore(i8*) #1 declare i8* @_lcompilers_snprintf_alloc(i8*, i8*, ...) declare void @_lcompilers_runtime_error(i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) declare void @exit(i32) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() define internal void @finalize_allocatable__StructType_Class__shape_of_select_type_13_module(%select_type_13_module.shape_class* %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = icmp ne %select_type_13_module.shape_class* %0, null br i1 %2, label %is_allocated.then, label %is_allocated.else2 is_allocated.then: ; preds = %entry call void @finalize_StructType_Class__shape_of_select_type_13_module(%select_type_13_module.shape_class* %0) %3 = getelementptr %select_type_13_module.shape_class, %select_type_13_module.shape_class* %0, i32 0, i32 1 %4 = load %select_type_13_module.shape*, %select_type_13_module.shape** %3, align 8 %5 = icmp ne %select_type_13_module.shape* %4, null br i1 %5, label %is_allocated.then1, label %is_allocated.else is_allocated.then1: ; preds = %is_allocated.then %6 = bitcast %select_type_13_module.shape* %4 to i8* call void @_lfortran_free_alloc(i8* %1, i8* %6) br label %is_allocated.ifcont is_allocated.else: ; preds = %is_allocated.then br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %is_allocated.then1 %7 = bitcast %select_type_13_module.shape_class* %0 to i8* call void @_lfortran_free_alloc(i8* %1, i8* %7) br label %is_allocated.ifcont3 is_allocated.else2: ; preds = %entry br label %is_allocated.ifcont3 is_allocated.ifcont3: ; preds = %is_allocated.else2, %is_allocated.ifcont ret void } define internal void @finalize_StructType_Class__shape_of_select_type_13_module(%select_type_13_module.shape_class* %0) { entry: %1 = getelementptr %select_type_13_module.shape_class, %select_type_13_module.shape_class* %0, i32 0, i32 0 %2 = load i32 (...)**, i32 (...)*** %1, align 8 %3 = getelementptr %select_type_13_module.shape_class, %select_type_13_module.shape_class* %0, i32 0, i32 1 %4 = load %select_type_13_module.shape**, %select_type_13_module.shape** %3, align 8 %5 = bitcast %select_type_13_module.shape** %4 to i8* %6 = icmp ne i32 (...)** %2, null br i1 %6, label %is_allocated.then, label %is_allocated.else2 is_allocated.then: ; preds = %entry %7 = getelementptr inbounds i32 (...)*, i32 (...)** %2, i32 2 %8 = load i8*, i32 (...)** %7, align 8 %9 = bitcast i8* %8 to void (i8*)* %10 = icmp ne i8* %5, null br i1 %10, label %is_allocated.then1, label %is_allocated.else is_allocated.then1: ; preds = %is_allocated.then call void %9(i8* %5) br label %is_allocated.ifcont is_allocated.else: ; preds = %is_allocated.then br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %is_allocated.then1 br label %is_allocated.ifcont3 is_allocated.else2: ; preds = %entry br label %is_allocated.ifcont3 is_allocated.ifcont3: ; preds = %is_allocated.else2, %is_allocated.ifcont ret void } attributes #0 = { argmemonly nounwind willreturn writeonly } attributes #1 = { nounwind } lfortran-0.63.0/tests/reference/run-exit1-29ee7ce.stderr0000664000175000017500000000044015174404631023140 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/exit1.f90:6:12 | 6 | if ( i .eq. 5 ) then | ^^^^ help: write this as '==' warning: Routine `exit` is a non-standard function --> tests/exit1.f90:7:9 | 7 | call exit(1) | ^^^^^^^^^^^^ STOP 1 lfortran-0.63.0/tests/reference/asr-intrinsics15-76ae493.stderr0000664000175000017500000000032315174404631024261 0ustar alastairalastairsemantic error: Unexpected args, SetExponent expects (real, int) as arguments --> tests/errors/intrinsics15.f90:2:14 | 2 | print *, set_exponent([1, 2, 3], 2) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-global_scope2-970a26a.stdout0000664000175000017500000000144215174404631024452 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. )] ) lfortran-0.63.0/tests/reference/ast-modules_04-a8954ed.json0000664000175000017500000000075015174404631023436 0ustar alastairalastair{ "basename": "ast-modules_04-a8954ed", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_04.f90", "infile_hash": "b04f80d4de5baea50808e962f08564088751c24a464b3d1d7c0c316f", "outfile": null, "outfile_hash": null, "stdout": "ast-modules_04-a8954ed.stdout", "stdout_hash": "2a048504489acee359b2e0fa29789c76861df057ef9d081a8374ac6a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_no_prescan-no_prescan_include2-420be52.json0000664000175000017500000000102115174404631027476 0ustar alastairalastair{ "basename": "ast_no_prescan-no_prescan_include2-420be52", "cmd": "lfortran --no-prescan --show-ast --no-color {infile} -o {outfile}", "infile": "tests/no_prescan_include2.f90", "infile_hash": "68cbbaed9ac272ba7009bc7e89270e6e2a12fd0c540413dc2a0a96eb", "outfile": null, "outfile_hash": null, "stdout": "ast_no_prescan-no_prescan_include2-420be52.stdout", "stdout_hash": "6bcff69480fdc91d83ab9a9df0af32ed41d9a9f594cb553bd8ca2ee7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format_58-475e064.stdout0000664000175000017500000000034615174404631023511 0ustar alastairalastairkind name sp dp ep kind: 4 8 8 epsilon: 1.19E-0007 2.22E-0016 2.22E-0016 tiny: 1.18E-0038 2.23E-0308 2.23E-0308 huge: 3.40E+0038 1.80E+0308 1.80E+0308 lfortran-0.63.0/tests/reference/asr-template_simple_01-964c12e.stdout0000664000175000017500000037144415174404631025443 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_simple_01: (Program (SymbolTable 18 { cast_r: (ExternalSymbol 18 cast_r 2 cast_r template_simple_01_m [] cast_r Public ), generic_sum: (ExternalSymbol 18 generic_sum 2 generic_sum template_simple_01_m [] generic_sum Public ), operator_r: (ExternalSymbol 18 operator_r 2 operator_r template_simple_01_m [] operator_r Public ), test_template: (ExternalSymbol 18 test_template 2 test_template template_simple_01_m [] test_template Public ) }) template_simple_01 [template_simple_01_m] [(SubroutineCall 18 test_template () [] () .false. )] ), template_simple_01_m: (Module (SymbolTable 2 { cast_integer: (Function (SymbolTable 7 { arg: (Variable 7 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 7 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast_integer (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 7 arg)] [(Assignment (Var 7 res) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 7 res) Private .true. .true. () ), cast_r: (Requirement (SymbolTable 5 { cast: (Function (SymbolTable 6 { arg: (Variable 6 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 6 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 6 arg)] [] (Var 6 res) Private .true. .true. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast_r [t cast] [] ), cast_real: (Function (SymbolTable 8 { arg: (Variable 8 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 8 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast_real (FunctionType [(Integer 4)] (Real 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 8 arg)] [(Assignment (Var 8 res) (RealConstant 0.000000 (Real 4) ) () .false. .false. )] (Var 8 res) Private .true. .true. () ), generic_sum: (Template (SymbolTable 9 { add: (Function (SymbolTable 10 { lhs: (Variable 10 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 10 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 10 rhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 10 lhs) (Var 10 rhs)] [] (Var 10 res) Private .true. .true. () ), cast: (Function (SymbolTable 11 { arg: (Variable 11 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 11 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 11 arg)] [] (Var 11 res) Private .true. .true. () ), generic_sum: (Function (SymbolTable 12 { arr: (Variable 12 arr [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 12 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 12 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 12 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) generic_sum (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast add] [(Var 12 arr)] [(Assignment (Var 12 n) (ArraySize (Var 12 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 12 res) (FunctionCall 9 cast () [((IntegerConstant 0 (Integer 4) Decimal))] (TypeParameter t ) () () ) () .false. .false. ) (If () (IntegerCompare (Var 12 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 12 res) (ArrayItem (Var 12 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 12 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 12 n) ()) [(Assignment (Var 12 res) (FunctionCall 9 add () [((Var 12 res)) ((ArrayItem (Var 12 arr) [(() (Var 12 i) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) () .false. .false. )] [] )] [] )] (Var 12 res) Public .true. .true. () ), t: (Variable 9 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) generic_sum [t add cast] [(Require operator_r [t add] ) (Require cast_r [t cast] )] ), operator_r: (Requirement (SymbolTable 3 { binary_func: (Function (SymbolTable 4 { lhs: (Variable 4 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 4 res [] ReturnVar () () Default (TypeParameter v ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 4 rhs [] In () () Default (TypeParameter u ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) binary_func (FunctionType [(TypeParameter t ) (TypeParameter u )] (TypeParameter v ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 4 lhs) (Var 4 rhs)] [] (Var 4 res) Private .true. .true. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u: (Variable 3 u [] In () () Default (TypeParameter u ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 3 v [] In () () Default (TypeParameter v ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) operator_r [t u v binary_func] [] ), test_template: (Function (SymbolTable 13 { a_i: (Variable 13 a_i [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a_r: (Variable 13 a_r [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), generic_sum_integer: (Function (SymbolTable 15 { arr: (Variable 15 arr [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 15 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 15 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 15 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) generic_sum_integer (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_integer ~add_intrinsic] [(Var 15 arr)] [(Assignment (Var 15 n) (ArraySize (Var 15 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 15 res) (FunctionCall 2 cast_integer () [((IntegerConstant 0 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 15 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 15 res) (ArrayItem (Var 15 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 15 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 15 n) ()) [(Assignment (Var 15 res) (FunctionCall 13 ~add_intrinsic () [((Var 15 res)) ((ArrayItem (Var 15 arr) [(() (Var 15 i) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) () .false. .false. )] [] )] [] )] (Var 15 res) Public .true. .true. () ), generic_sum_real: (Function (SymbolTable 17 { arr: (Variable 17 arr [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 17 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 17 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 17 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) generic_sum_real (FunctionType [(Array (Real 4) [(() ())] DescriptorArray )] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_real ~add_intrinsic1] [(Var 17 arr)] [(Assignment (Var 17 n) (ArraySize (Var 17 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 17 res) (FunctionCall 2 cast_real () [((IntegerConstant 0 (Integer 4) Decimal))] (Real 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 17 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 17 res) (ArrayItem (Var 17 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 17 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 17 n) ()) [(Assignment (Var 17 res) (FunctionCall 13 ~add_intrinsic1 () [((Var 17 res)) ((ArrayItem (Var 17 arr) [(() (Var 17 i) ())] (Real 4) ColMajor () ))] (Real 4) () () ) () .false. .false. )] [] )] [] )] (Var 17 res) Public .true. .true. () ), i: (Variable 13 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s_i: (Variable 13 s_i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s_r: (Variable 13 s_r [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~add: (CustomOperator 13 ~add [13 ~add_intrinsic 13 ~add_intrinsic1] Public ), ~add_intrinsic: (Function (SymbolTable 14 { arg0: (Variable 14 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 14 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 14 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 14 arg0) (Var 14 arg1)] [(Assignment (Var 14 ret) (IntegerBinOp (Var 14 arg0) Add (Var 14 arg1) (Integer 4) () ) () .false. .false. )] (Var 14 ret) Public .true. .true. () ), ~add_intrinsic1: (Function (SymbolTable 16 { arg0: (Variable 16 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 16 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 16 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic1 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 16 arg0) (Var 16 arg1)] [(Assignment (Var 16 ret) (RealBinOp (Var 16 arg0) Add (Var 16 arg1) (Real 4) () ) () .false. .false. )] (Var 16 ret) Public .true. .true. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(DoLoop () ((Var 13 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 13 a_i) () (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) ) ()) [(Assignment (ArrayItem (Var 13 a_i) [(() (Var 13 i) ())] (Integer 4) ColMajor () ) (Var 13 i) () .false. .false. ) (Assignment (ArrayItem (Var 13 a_r) [(() (Var 13 i) ())] (Real 4) ColMajor () ) (Cast (Var 13 i) IntegerToReal (Real 4) () () ) () .false. .false. )] [] ) (Assignment (Var 13 s_i) (FunctionCall 13 generic_sum_integer () [((ArrayPhysicalCast (Var 13 a_i) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 13 s_r) (FunctionCall 13 generic_sum_real () [((ArrayPhysicalCast (Var 13 a_r) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 13 s_i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 13 s_r)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_simple_01_m () [template_simple_01_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-global_scope1-dd9aaaa.json0000664000175000017500000000073415174404631024400 0ustar alastairalastair{ "basename": "ast-global_scope1-dd9aaaa", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/global_scope1.f90", "infile_hash": "449b38487b6c79754deedb9991f1867bcf8c67d0d93019c2fe15854c", "outfile": null, "outfile_hash": null, "stdout": "ast-global_scope1-dd9aaaa.stdout", "stdout_hash": "6fa8960cf7f538bc4b28ffb155c8afa72da87b32edf0fb758faffd2e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-write4-f453580.json0000664000175000017500000000065715174404631022557 0ustar alastairalastair{ "basename": "run-write4-f453580", "cmd": "lfortran --no-color {infile}", "infile": "tests/write4.f90", "infile_hash": "3ea1b036446d9c3c9948c04d5b3bba170d5163d80d23e55ae2249956", "outfile": null, "outfile_hash": null, "stdout": "run-write4-f453580.stdout", "stdout_hash": "53a3d179203f266f36431d4b08c3759a60fd29395f9c14e7097066d7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-statement1-60b7ed3.json0000664000175000017500000000072315174404631023535 0ustar alastairalastair{ "basename": "asr-statement1-60b7ed3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/statement1.f90", "infile_hash": "3d828667fda659d080d10043c790e05aa1fa73d1f920b2c4e38fe751", "outfile": null, "outfile_hash": null, "stdout": "asr-statement1-60b7ed3.stdout", "stdout_hash": "b331f48bedc36d2493a3edc257f18b7c94b2fed50891dd3881c4cd92", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format3-ee61b31.stdout0000664000175000017500000000014315174404631023403 0ustar alastairalastair 12.3457E+03 123.4568E-06 1.2346E+03 ********** ********** -1.2346E+03 -123.45679E-06 0.0000E+00 lfortran-0.63.0/tests/reference/ast-nested_02-68e8526.json0000664000175000017500000000074515174404631023116 0ustar alastairalastair{ "basename": "ast-nested_02-68e8526", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_02.f90", "infile_hash": "6ff700b8b837d9efad78b5ed4d8defc823333a19f8afa37c7da6899d", "outfile": null, "outfile_hash": null, "stdout": "ast-nested_02-68e8526.stdout", "stdout_hash": "d5993dd76c2694fb55579b390622320488c7a9f0ca5b6389020ee0b3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_indent-subroutine1-41f648b.json0000664000175000017500000000074415174404631025220 0ustar alastairalastair{ "basename": "asr_indent-subroutine1-41f648b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/subroutine1.f90", "infile_hash": "e209c22328b423e75d6801f3c0ef19bc120936196435dff2cb19df31", "outfile": null, "outfile_hash": null, "stdout": "asr_indent-subroutine1-41f648b.stdout", "stdout_hash": "0be9c015117454283e191a22ec1ec94524b6967eb1b92d1420978f67", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-auxiliary_IO_1-36af6ad.json0000664000175000017500000000076515174404631024356 0ustar alastairalastair{ "basename": "ast-auxiliary_IO_1-36af6ad", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/auxiliary_IO_1.f", "infile_hash": "6be10531c17bcd0a753784768cbd756393fcb08d05bae273201dbe30", "outfile": null, "outfile_hash": null, "stdout": "ast-auxiliary_IO_1-36af6ad.stdout", "stdout_hash": "11976ffa040614bba3d9fa046092e4b2a24f52a71271a9ae54b7f03d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_global_stmts-expr2-22f4149.stdout0000664000175000017500000000453515174404631025662 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] (Integer 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 f1) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) () .false. .false. )] (Var 2 f1) Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-arrays_23-a731033.json0000664000175000017500000000074515174404631023110 0ustar alastairalastair{ "basename": "asr-arrays_23-a731033", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_23.f90", "infile_hash": "c1df25817ea3eccb99df382b51ecfda76c3129aba44ff3492a1826d8", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_23-a731033.stdout", "stdout_hash": "8cad9092cb939a2c7b8cb29fa4abc8258bb35fc4852a887a7cd70b6d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-do2-8eeb477.stdout0000664000175000017500000000101115174404631022511 0ustar alastairalastair(TranslationUnit [(Subroutine g [] [] () () [] [] [] [] [(DoLoop 0 () 0 i 1 2 () [(GoTo 0 () 1 [] () ) (Continue 1 () )] () () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-complex_div_test-21dab13.stdout0000664000175000017500000001544315174404631025361 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex2: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) complex2 [] [(Assignment (Var 2 x) (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 4.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 x) (ComplexBinOp (Var 2 x) Div (Cast (RealConstant 4.000000 (Real 4) ) RealToComplex (Complex 4) (ComplexConstant 4.000000 0.000000 (Complex 4) ) () ) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (ComplexBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 2.000000 0.000000 (Complex 4) ) () ) Div (Var 2 x) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (ComplexBinOp (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 1.000000 0.000000 (Complex 4) ) () ) Div (ComplexBinOp (Var 2 x) Add (ComplexConstructor (RealConstant 0.000000 (Real 4) ) (RealConstant 3.000000 (Real 4) ) (Complex 4) (ComplexConstant 0.000000 3.000000 (Complex 4) ) ) (Complex 4) () ) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-allow_implicit_interface3-7ef92cc.json0000664000175000017500000000102515174404631026647 0ustar alastairalastair{ "basename": "asr-allow_implicit_interface3-7ef92cc", "cmd": "lfortran --show-asr --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/allow_implicit_interface3.f90", "infile_hash": "5fcc5115d2a0075d81d764ef81ce63c8e8445a36670e6425bdec8ded", "outfile": null, "outfile_hash": null, "stdout": "asr-allow_implicit_interface3-7ef92cc.stdout", "stdout_hash": "b7ce6bac7075970daaabe34315448a58033471ccfeacd91e0a5a2c22", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-do5-4355d03.stdout0000664000175000017500000000605215174404631022350 0ustar alastairalastair(TranslationUnit [(Program do5 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ()) (k [] [] () () None ()) (enddo [] [] () () None ())] () )] [(Assignment 0 j 0 () ) (DoLoop 0 () 15 i 1 5 () [(Assignment 15 j (+ j i) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 j 0 () ) (DoLoop 0 () 16 i 1 5 () [(Assignment 16 enddo 5 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 j 0 () ) (DoLoop 0 () 20 i 1 6 2 [(Assignment 20 j (+ j i) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 k 0 () ) (DoLoop 0 () 30 i 1 5 () [(DoLoop 0 () 35 j 1 5 () [(Continue 31 () ) (Assignment 35 k (+ k 1) () )] () () ) (Continue 33 () ) (Assignment 30 k (+ k 1) () )] () () ) (Continue 40 () )] [] )] ) lfortran-0.63.0/tests/reference/asr-submodule_04-987b68b.json0000664000175000017500000000075615174404631023717 0ustar alastairalastair{ "basename": "asr-submodule_04-987b68b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/submodule_04.f90", "infile_hash": "642c924ba406c1301d4f17d3aa23330c0c88836827e2ccc9a223fe50", "outfile": null, "outfile_hash": null, "stdout": "asr-submodule_04-987b68b.stdout", "stdout_hash": "15c0c8d1004504189678ff3db1a29823447f6ec8e6f06ae90fc48261", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format_23-fdedfdb.stdout0000664000175000017500000000137215174404631024141 0ustar alastairalastairBinary format for real(4): x1 (3.14): 1000000010010001111010111000011 x1 (3.14): ********** x1 (3.14): 1000000010010001111010111000011 y1 (-2.5): 11000000001000000000000000000000 y1 (-2.5): ********** y1 (-2.5): 11000000001000000000000000000000 z1 (0.0): 0 z1 (0.0): 0 Binary format for real(8): x8 (3.14): 100000000001001000111101011100001010001111010111000010100011111 x8 (3.14): ********** x8 (3.14): 100000000001001000111101011100001010001111010111000010100011111 y8 (-2.5): 1100000000000100000000000000000000000000000000000000000000000000 y8 (-2.5): ********** y8 (-2.5): 1100000000000100000000000000000000000000000000000000000000000000 z8 (0.0): 0 z8 (0.0): 0 lfortran-0.63.0/tests/reference/asr-derived_type1-c109ce6.json0000664000175000017500000000073415174404631024216 0ustar alastairalastair{ "basename": "asr-derived_type1-c109ce6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/derived_type1.f90", "infile_hash": "ed39e2004e29457f0f83e6a1badf6ecbee98749ca624594fc0160e52", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_type1-c109ce6.stdout", "stdout_hash": "55038a189dc996d054b80460943a84da45c62eb51d52e15f078d8866", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-modules_11-1131557.json0000664000175000017500000000075015174404631023177 0ustar alastairalastair{ "basename": "ast-modules_11-1131557", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_11.f90", "infile_hash": "f19a5ba8d01ebaae3da78891afbae58462d711a364274aa3a5569fa1", "outfile": null, "outfile_hash": null, "stdout": "ast-modules_11-1131557.stdout", "stdout_hash": "55df6502cfe05f7264ab8085c1865fa46d218804e1865d03caff299a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-parameter_without_start_program-a99ac57.json0000664000175000017500000000103115174404631030162 0ustar alastairalastair{ "basename": "ast-parameter_without_start_program-a99ac57", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/parameter_without_start_program.f90", "infile_hash": "2e9169dd781045b7103a73b5edc20a422355169a278a6bf1f7f8323d", "outfile": null, "outfile_hash": null, "stdout": "ast-parameter_without_start_program-a99ac57.stdout", "stdout_hash": "5df73fd7386389919b5b62e9f0083173af9e8f6fd9efb263eba84599", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format_22-e96df3d.json0000664000175000017500000000071515174404631023355 0ustar alastairalastair{ "basename": "run-format_22-e96df3d", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_22.f90", "infile_hash": "1dcaaa4dc928be3bf1cb4d6eb0c015f8a2f8b200f162c64edeb5d5ab", "outfile": null, "outfile_hash": null, "stdout": "run-format_22-e96df3d.stdout", "stdout_hash": "aaed5b96f9c6c47f2f0e9540ae90f1e75afcb8a8b0c66cfe9a278ed3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-allocate_05-48fb994.stdout0000664000175000017500000001416215174404631024052 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { allocate_05: (Program (SymbolTable 2 { num: (Variable 2 num [] Local () () Default (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 2 string [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) allocate_05 [] [(Allocate [((Var 2 string) [] (IntegerConstant 3 (Integer 4) Decimal) () (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString))] () () () ) (Assignment (Var 2 num) (StringConstant "abc" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 string) (Var 2 num) () .false. .false. ) (If () (StringCompare (Var 2 string) NotEq (StringConstant "abc" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (StringSection (Var 2 string) (IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 2 string) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerBinOp (IntegerBinOp (StringLen (Var 2 string) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ExpressionLength DescriptorString) () ) (Var 2 num) () .false. .false. ) (If () (StringCompare (Var 2 string) NotEq (StringConstant "abc" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/lookup_name-function_call1-c233951.json0000664000175000017500000000076215174404631025737 0ustar alastairalastair{ "basename": "lookup_name-function_call1-c233951", "cmd": "lfortran --lookup-name --no-color {infile} -o {outfile}", "infile": "tests/function_call1.f90", "infile_hash": "45acf463b1d977f1bdf3d9420205c7979fc03de58d60260cb37fd0bc", "outfile": null, "outfile_hash": null, "stdout": "lookup_name-function_call1-c233951.stdout", "stdout_hash": "be13f54e037b9595915fd749f61a34c9b319d2e2a8cc223684168ef8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-c_f_pointer_01-2d288d7.stderr0000664000175000017500000000033415174404631024517 0ustar alastairalastairsemantic error: shape argument specified in c_f_pointer even though fptr is not an array. --> tests/errors/c_f_pointer_01.f90:5:34 | 5 | call c_f_pointer(queries, x, [2]) | ^^^ lfortran-0.63.0/tests/reference/asr-kind_float_of_int-4b9cf53.json0000664000175000017500000000075715174404631025134 0ustar alastairalastair{ "basename": "asr-kind_float_of_int-4b9cf53", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_float_of_int.f90", "infile_hash": "1162ce1a917f4ce2b50df7b8f496c081a1570e76122108e2108dc009", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_float_of_int-4b9cf53.stderr", "stderr_hash": "cdacf7eb32e15977e7cac4f156b8c8608b50b11cc5506f0f564fd170", "returncode": 2 }././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootlfortran-0.63.0/tests/reference/pass_array_struct_temporary_array_op-array_op_simplifier_test-bb5013f.stdoutlfortran-0.63.0/tests/reference/pass_array_struct_temporary_array_op-array_op_simplifier_test-bb50130000664000175000017500000005032015174404631034377 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { __libasr_index_0_: (Variable 2 __libasr_index_0_ [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_index_0_1: (Variable 2 __libasr_index_0_1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_index_0_2: (Variable 2 __libasr_index_0_2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_index_1_: (Variable 2 __libasr_index_1_ [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_index_1_1: (Variable 2 __libasr_index_1_1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_index_1_2: (Variable 2 __libasr_index_1_2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Local () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main [] [(Allocate [((Var 2 d) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] () () ())] () () () ) (DebugCheckArrayBounds (Var 2 d) [(Var 2 a) (Var 2 b)] .false. ) (Assignment (Var 2 __libasr_index_1_1) (ArrayBound (Var 2 a) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) () .false. .false. ) (Assignment (Var 2 __libasr_index_1_2) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) () .false. .false. ) (DoLoop () ((Var 2 __libasr_index_1_) (ArrayBound (Var 2 d) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 d) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Assignment (Var 2 __libasr_index_0_1) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) () .false. .false. ) (Assignment (Var 2 __libasr_index_0_2) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) () .false. .false. ) (DoLoop () ((Var 2 __libasr_index_0_) (ArrayBound (Var 2 d) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 d) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Assignment (ArrayItem (Var 2 d) [(() (Var 2 __libasr_index_0_) ()) (() (Var 2 __libasr_index_1_) ())] (Real 4) ColMajor () ) (RealBinOp (RealBinOp (ArrayItem (Var 2 a) [(() (Var 2 __libasr_index_0_1) ()) (() (Var 2 __libasr_index_1_1) ())] (Real 4) ColMajor () ) Add (ArrayItem (Var 2 b) [(() (Var 2 __libasr_index_0_2) ()) (() (Var 2 __libasr_index_1_2) ())] (Real 4) ColMajor () ) (Real 4) () ) Add (Var 2 c) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 __libasr_index_0_1) (IntegerBinOp (Var 2 __libasr_index_0_1) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 __libasr_index_0_2) (IntegerBinOp (Var 2 __libasr_index_0_2) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] ) (Assignment (Var 2 __libasr_index_1_1) (IntegerBinOp (Var 2 __libasr_index_1_1) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 __libasr_index_1_2) (IntegerBinOp (Var 2 __libasr_index_1_2) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-write1-170ef53.stdout0000664000175000017500000001073715174404631023164 0ustar alastairalastair(TranslationUnit [(Program write_01 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Write 0 [(()) (())] [] [(String "a" ()) 2] () ) (Write 0 [(()) (())] [] [] () ) (Write 0 [(())] [] [a] () ) (Write 0 [(out_str) ((String "(\" Found index \", i9,\" but item is not in list.\")" ()))] [] [index] () ) (Write 0 [(out_string) (())] [] [(String "Scalar_in = " ()) scalar_in] () ) (Write 0 [(out_string) (10)] [] [int_src int_given int_expected] () ) (Write 0 [(string)] [(fmt (String "(f6.2)" ()))] [max_angle] () ) (Write 0 [(fmt) ((String "(\"(i\",i0,\".\",i0,\")\")" ()))] [] [n n] () ) (Write 0 [] [(unit ()) (fmt (String "(a)" ()))] [(StrOp (StrOp (FuncCallOrArray trim [] [(() prog () 0)] [] [] [] ) Concat (String ": " ()) ) Concat message )] () ) (Write 0 [] [(unit 0) (fmt (String "(a,i4.4)" ()))] [(StrOp (StrOp (String "Assertion failed at " ()) Concat file ) Concat (String ":" ()) ) line] () ) (Write 0 [(())] [(fmt (String "(a,l1)" ()))] [(String "exactly_conservative= " ()) exactly_conservative] () ) (Write 0 [] [(unit lun)] [vec] () ) (Write 0 [(()) ((String "(a,a)" ()))] [(advance (String "no" ()))] [(FuncCallOrArray trim [] [(() input_string () 0)] [] [] [] ) (String ": " ())] () ) (Write 0 [(ounit)] [(FMT 303) (ADVANCE (String "NO" ()))] [] () ) (Write 0 [(()) (201)] [] [(ImpliedDoLoop [star] i 1 80 () )] () ) (Write 0 [(()) ((String "(1X,A)" ()))] [] [(String "Success!" ())] () ) (Write 0 [(ounit) (())] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [(String "2" ())] () ) (Print 0 () [] () ) (Print 0 (String "(a, es22.14)" ()) [(String "Ekin: " ()) Ekin] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/cpp-array2-9a93c4d.json0000664000175000017500000000067215174404631022656 0ustar alastairalastair{ "basename": "cpp-array2-9a93c4d", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/array2.f90", "infile_hash": "ec67f153c5f506f6a12ef94b06d43c7e9e86b9fc33c9c196029183f0", "outfile": null, "outfile_hash": null, "stdout": "cpp-array2-9a93c4d.stdout", "stdout_hash": "7a8f06efc0b71df9d23c13d24415b8e1dcf6e05ab3e6ffd3d2e4606b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor21-aded728.json0000664000175000017500000000077315174404631026677 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor21-aded728", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor21.f90", "infile_hash": "c56b907f2bb83ae0b8a1d585925a2f710a26f6252ca5e6a21bce4e16", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor21-aded728.stdout", "stdout_hash": "af102ef1d62b93c93996abd59428860a56209cb00364d6833cf92f84", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-doloop_08-cf3820d.json0000664000175000017500000000073015174404631023245 0ustar alastairalastair{ "basename": "cpp-doloop_08-cf3820d", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/doloop_08.f90", "infile_hash": "aa25755d672851ca060c0f7c42329e8ecb0444f7a037df60d525af51", "outfile": null, "outfile_hash": null, "stdout": "cpp-doloop_08-cf3820d.stdout", "stdout_hash": "e5f10e195d3811512cfb841d70331a7a897ff20972582e2f72b1aa03", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-array3-a030743.json0000664000175000017500000000070715174404631022504 0ustar alastairalastair{ "basename": "ast-array3-a030743", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/array3.f90", "infile_hash": "047ac01d7e3df52429d6889258f37213048937dae8611af6cbd9ecae", "outfile": null, "outfile_hash": null, "stdout": "ast-array3-a030743.stdout", "stdout_hash": "cafa5a9c40c58eaa5ac75c6e901b6d75a9d9c33052274dd45be6c1ae", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-entry1-3075e81.stdout0000664000175000017500000003030215174404631023101 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { entry1: (Program (SymbolTable 2 { dummy: (Variable 2 dummy [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) entry1 [] [(Assignment (Var 2 dummy) (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 10.000000 (Real 4) ) () ) () .false. .false. ) (SubroutineCall 1 x () [((Var 2 dummy))] () .false. ) (SubroutineCall 1 y () [((Var 2 dummy))] () .false. )] ), x: (Function (SymbolTable 3 { dummy: (Variable 3 dummy [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) x (FunctionType [(Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [x_main__lcompilers] [(Var 3 dummy)] [(SubroutineCall 1 x_main__lcompilers 1 x_main__lcompilers [((IntegerConstant 1 (Integer 4) Decimal)) ((Var 3 dummy))] () .false. )] () Public .true. .true. () ), x_main__lcompilers: (Function (SymbolTable 5 { dummy: (Variable 5 dummy [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), entry__lcompilers: (Variable 5 entry__lcompilers [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) x_main__lcompilers (FunctionType [(Integer 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 entry__lcompilers) (Var 5 dummy)] [(If () (IntegerCompare (Var 5 entry__lcompilers) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 1 1 )] [] ) (If () (IntegerCompare (Var 5 entry__lcompilers) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 2 2 )] [] ) (GoToTarget 1 1 ) (Print (StringFormat () [(StringConstant "Printed using subroutine call: " (String 1 (IntegerConstant 31 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 5 dummy)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 5 dummy) (RealConstant 5.000000 (Real 4) ) () .false. .false. ) (Return) (GoToTarget 2 2 ) (Print (StringFormat () [(StringConstant "Printed using entry statement: " (String 1 (IntegerConstant 31 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 5 dummy)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Return)] () Public .true. .true. () ), y: (Function (SymbolTable 4 { dummy: (Variable 4 dummy [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) y (FunctionType [(Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [x_main__lcompilers] [(Var 4 dummy)] [(SubroutineCall 1 x_main__lcompilers 1 x_main__lcompilers [((IntegerConstant 2 (Integer 4) Decimal)) ((Var 4 dummy))] () .false. )] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/ast-subroutines_10-c3e0d28.json0000664000175000017500000000076415174404631024337 0ustar alastairalastair{ "basename": "ast-subroutines_10-c3e0d28", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_10.f90", "infile_hash": "97868109f521b42642b328d8b79be02e7668b5819dc820880ec85da0", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutines_10-c3e0d28.stdout", "stdout_hash": "c085bcf41cf64ac470b7cbdd70cf531c7eaf2e5e4858c4e4e339303a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_error_05-85bce3c.json0000664000175000017500000000075715174404631025071 0ustar alastairalastair{ "basename": "asr-template_error_05-85bce3c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_05.f90", "infile_hash": "d30f0b51c06d7edfa1071745f98110503353250d239694a17ffa3620", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_05-85bce3c.stderr", "stderr_hash": "348ee2447d9951d887bcc71ba1744ee9f44797c33a5b28ebd2d64bab", "returncode": 2 }lfortran-0.63.0/tests/reference/run-array_bounds_check_06-2986f6e.json0000664000175000017500000000074315174404631025562 0ustar alastairalastair{ "basename": "run-array_bounds_check_06-2986f6e", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_06.f90", "infile_hash": "8d6d28fe1c81ff7cba66afc6e853bd26e5b8716b40fd41942df789a8", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_06-2986f6e.stderr", "stderr_hash": "b709e6411ce7bd377609c4c8dcbf39aecc07cbaa46b5e9055efa7a67", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-nested_05-00beea9.json0000664000175000017500000000074515174404631023315 0ustar alastairalastair{ "basename": "asr-nested_05-00beea9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_05.f90", "infile_hash": "83b55ebf01581813bce973f49d745813499ef9e09fc0b0a2111f8386", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_05-00beea9.stdout", "stdout_hash": "0745dbd998ff3068312d494ca6e75499876639e832ada5c98506fa1f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-global_scope3-00a245c.json0000664000175000017500000000073715174404631024262 0ustar alastairalastair{ "basename": "llvm-global_scope3-00a245c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/global_scope3.f90", "infile_hash": "60cea65abfbb2228d16f175ea192462ae2379d7a9da1601cb3de9f3a", "outfile": null, "outfile_hash": null, "stdout": "llvm-global_scope3-00a245c.stdout", "stdout_hash": "87ccc9c2503be3395fea204167eecb6aa9d6f58c616c4930a185f1bb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixed_form_goto_select-6cc9882.json0000664000175000017500000000100215174404631026106 0ustar alastairalastair{ "basename": "ast-fixed_form_goto_select-6cc9882", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_goto_select.f", "infile_hash": "acbe51b93b613a469a6a95e544f8bf2480ad5ea75d6f5e369dcceb9a", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_goto_select-6cc9882.stdout", "stdout_hash": "d00834b66632f8c590999e8a3530f48d7249c7620377336fb120918e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-multi_error1-6934f65.json0000664000175000017500000000073115174404631023751 0ustar alastairalastair{ "basename": "ast-multi_error1-6934f65", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/multi_error1.f90", "infile_hash": "aae363b17603b231b2a906564a03365ce9a53952c754ea31187f352c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-multi_error1-6934f65.stderr", "stderr_hash": "05f5d41863982b1d7e082112c53b5ee1dece91489f6857e77a3c2e4e", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-init_values-b1d5491.json0000664000175000017500000000075615174404631024104 0ustar alastairalastair{ "basename": "llvm-init_values-b1d5491", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/init_values.f90", "infile_hash": "1cafced706fa2754f92f2d460867d6c84638fd10447df12f124fd419", "outfile": null, "outfile_hash": null, "stdout": "llvm-init_values-b1d5491.stdout", "stdout_hash": "a34bab8b37c5031da78f323242b24989ba12ec0a436834d5d48ab90a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-array3-a030743.stdout0000664000175000017500000000256215174404631023056 0ustar alastairalastair(TranslationUnit [(Program array3 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 3 DimensionExpr)] )] [(a [] [] () () None ()) (b [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 a (ArrayInitializer () () [1 2 3] ) () ) (Assignment 0 b (ArrayInitializer () () [1 2 3] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/llvm-functions_14-f13c087.json0000664000175000017500000000076115174404631024074 0ustar alastairalastair{ "basename": "llvm-functions_14-f13c087", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_14.f90", "infile_hash": "5ab87388a802f87070be6ddbb2f9d862b4ac4cf7c07c2eafff2287f1", "outfile": null, "outfile_hash": null, "stdout": "llvm-functions_14-f13c087.stdout", "stdout_hash": "95e4f6dd96236ef5b5b72b5526d44921bea3f812e11c629185112883", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-subroutine4-22dcb28.stdout0000664000175000017500000000035615174404631024621 0ustar alastairalastairfunction triad(a::Array{Float32, 1}, b::Array{Float32, 1}, scalar::Float32, c::Array{Float32, 1}) local i::Int32 local n::Int32 n = length(a) Threads.@threads for i ∈ 1:n c[i] = a[i] + scalar * b[i] end end lfortran-0.63.0/tests/reference/asr-complex_07-71c3c47.stdout0000664000175000017500000014007415174404631023723 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex_07: (Program (SymbolTable 2 { c1: (Variable 2 c1 [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local (IntegerConstant 42 (Integer 4) Decimal) (IntegerConstant 42 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), img_part: (Variable 2 img_part [] Local (RealConstant 3.140000 (Real 4) ) (RealConstant 3.140000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), real_part: (Variable 2 real_part [] Local (IntegerConstant 42 (Integer 4) Decimal) (IntegerConstant 42 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [real_part] Local (IntrinsicElementalFunction Cmplx [(Var 2 real_part) (RealConstant 0.000000 (Real 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Complex 4) (ComplexConstant 42.000000 0.000000 (Complex 4) ) ) (ComplexConstant 42.000000 0.000000 (Complex 4) ) Save (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x1: (Variable 2 x1 [] Local (RealConstant 3.140000 (Real 4) ) (RealConstant 3.140000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x2: (Variable 2 x2 [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [img_part] Local (IntrinsicElementalFunction Cmplx [(Var 2 img_part) (RealConstant 0.000000 (Real 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Complex 4) (ComplexConstant 3.140000 0.000000 (Complex 4) ) ) (ComplexConstant 3.140000 0.000000 (Complex 4) ) Save (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y2: (Variable 2 y2 [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [real_part img_part] Local (IntrinsicElementalFunction Cmplx [(Var 2 real_part) (Var 2 img_part) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Complex 4) (ComplexConstant 42.000000 3.140000 (Complex 4) ) ) (ComplexConstant 42.000000 3.140000 (Complex 4) ) Save (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z1: (Variable 2 z1 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z2: (Variable 2 z2 [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) complex_07 [] [(Assignment (Var 2 z1) (IntrinsicElementalFunction Cmplx [(Var 2 i) (Var 2 x1) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Complex 4) () ) () .false. .false. ) (Assignment (Var 2 c1) (Cast (ComplexConstructor (IntegerConstant 12 (Integer 4) Decimal) (IntegerConstant 24 (Integer 4) Decimal) (Complex 4) (ComplexConstant 12.000000 24.000000 (Complex 4) ) ) ComplexToComplex (Complex 8) (ComplexConstant 12.000000 24.000000 (Complex 8) ) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 c1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x2) (IntrinsicElementalFunction Cmplx [(Var 2 real_part) (RealConstant 0.000000 (Real 4) ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Complex 8) (ComplexConstant 42.000000 0.000000 (Complex 8) ) ) () .false. .false. ) (Assignment (Var 2 y2) (IntrinsicElementalFunction Cmplx [(Var 2 img_part) (RealConstant 0.000000 (Real 4) ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Complex 8) (ComplexConstant 3.140000 0.000000 (Complex 8) ) ) () .false. .false. ) (Assignment (Var 2 z2) (IntrinsicElementalFunction Cmplx [(Var 2 real_part) (Var 2 img_part) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Complex 8) (ComplexConstant 42.000000 3.140000 (Complex 8) ) ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(ComplexBinOp (Var 2 x) Sub (ComplexConstructor (Var 2 real_part) (IntegerConstant 0 (Integer 4) Decimal) (Complex 4) (ComplexConstant 42.000000 0.000000 (Complex 4) ) ) (Complex 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(ComplexBinOp (Var 2 y) Sub (ComplexConstructor (Var 2 img_part) (IntegerConstant 0 (Integer 4) Decimal) (Complex 4) (ComplexConstant 3.140000 0.000000 (Complex 4) ) ) (Complex 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(ComplexBinOp (Var 2 z) Sub (ComplexConstructor (Var 2 real_part) (Var 2 img_part) (Complex 4) (ComplexConstant 42.000000 3.140000 (Complex 4) ) ) (Complex 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(ComplexBinOp (Var 2 x2) Sub (Cast (ComplexConstructor (Var 2 real_part) (IntegerConstant 0 (Integer 4) Decimal) (Complex 4) (ComplexConstant 42.000000 0.000000 (Complex 4) ) ) ComplexToComplex (Complex 8) (ComplexConstant 42.000000 0.000000 (Complex 8) ) () ) (Complex 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000010 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000010 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(ComplexBinOp (Var 2 y2) Sub (Cast (ComplexConstructor (Var 2 img_part) (IntegerConstant 0 (Integer 4) Decimal) (Complex 4) (ComplexConstant 3.140000 0.000000 (Complex 4) ) ) ComplexToComplex (Complex 8) (ComplexConstant 3.140000 0.000000 (Complex 8) ) () ) (Complex 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000010 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000010 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(ComplexBinOp (Var 2 z2) Sub (Cast (ComplexConstructor (Var 2 real_part) (Var 2 img_part) (Complex 4) (ComplexConstant 42.000000 3.140000 (Complex 4) ) ) ComplexToComplex (Complex 8) (ComplexConstant 42.000000 3.140000 (Complex 8) ) () ) (Complex 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000010 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000010 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(IntrinsicElementalFunction Cmplx [(Var 2 i) (RealConstant 0.000000 (Real 4) ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Complex 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(ComplexBinOp (IntrinsicElementalFunction Cmplx [(Var 2 i) (RealConstant 0.000000 (Real 4) ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Complex 8) () ) Sub (Cast (ComplexConstructor (RealConstant 42.000000 (Real 4) ) (RealConstant 0.000000 (Real 4) ) (Complex 4) (ComplexConstant 42.000000 0.000000 (Complex 4) ) ) ComplexToComplex (Complex 8) (ComplexConstant 42.000000 0.000000 (Complex 8) ) () ) (Complex 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000010 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000010 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(IntrinsicElementalFunction Cmplx [(Var 2 x1) (RealConstant 0.000000 (Real 4) ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Complex 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(ComplexBinOp (IntrinsicElementalFunction Cmplx [(Var 2 x1) (RealConstant 0.000000 (Real 4) ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Complex 8) () ) Sub (Cast (ComplexConstructor (RealConstant 3.140000 (Real 4) ) (RealConstant 0.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.140000 0.000000 (Complex 4) ) ) ComplexToComplex (Complex 8) (ComplexConstant 3.140000 0.000000 (Complex 8) ) () ) (Complex 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000010 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000010 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(IntrinsicElementalFunction Cmplx [(Var 2 z1) (RealConstant 0.000000 (Real 4) ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Complex 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(ComplexBinOp (IntrinsicElementalFunction Cmplx [(Var 2 z1) (RealConstant 0.000000 (Real 4) ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Complex 8) () ) Sub (Cast (ComplexConstructor (RealConstant 42.000000 (Real 4) ) (RealConstant 3.140000 (Real 4) ) (Complex 4) (ComplexConstant 42.000000 3.140000 (Complex 4) ) ) ComplexToComplex (Complex 8) (ComplexConstant 42.000000 3.140000 (Complex 8) ) () ) (Complex 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000010 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000010 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(IntrinsicElementalFunction Cmplx [(Var 2 x1) (Var 2 i) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Complex 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(ComplexBinOp (IntrinsicElementalFunction Cmplx [(Var 2 x1) (Var 2 i) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Complex 8) () ) Sub (Cast (ComplexConstructor (RealConstant 3.140000 (Real 4) ) (RealConstant 42.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.140000 42.000000 (Complex 4) ) ) ComplexToComplex (Complex 8) (ComplexConstant 3.140000 42.000000 (Complex 8) ) () ) (Complex 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000010 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000010 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 x) (Var 2 y) (Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-arrays_01_complex-2513a51.stdout0000664000175000017500000011021515174404631025176 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_01_complex: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) arrays_01_complex [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Complex 4) ColMajor () ) (Cast (IntegerBinOp (Var 2 i) Add (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) IntegerToComplex (Complex 4) () () ) () .false. .false. )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 11.000000 0.000000 (Complex 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 12 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 12.000000 0.000000 (Complex 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 13 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 13.000000 0.000000 (Complex 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 11 (Integer 4) Decimal) (IntegerConstant 14 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 b) [(() (IntegerBinOp (Var 2 i) Sub (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) ())] (Complex 4) ColMajor () ) (Cast (Var 2 i) IntegerToComplex (Complex 4) () () ) () .false. .false. )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 11.000000 0.000000 (Complex 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 12 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 12.000000 0.000000 (Complex 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 13 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 13.000000 0.000000 (Complex 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 14 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 14.000000 0.000000 (Complex 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Complex 4) ColMajor () ) (ComplexBinOp (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Complex 4) ColMajor () ) Sub (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 10.000000 0.000000 (Complex 4) ) () ) (Complex 4) () ) () .false. .false. )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 1.000000 0.000000 (Complex 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 2.000000 0.000000 (Complex 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 3.000000 0.000000 (Complex 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) (ComplexBinOp (ComplexBinOp (ComplexBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) Add (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) (Complex 4) () ) Add (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) (Complex 4) () ) Add (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) (Complex 4) () ) () .false. .false. ) (If () (ComplexCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 17 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 17.000000 0.000000 (Complex 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) () .false. .false. ) (If () (ComplexCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 11.000000 0.000000 (Complex 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Complex 4) ColMajor () ) (Cast (IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () ) Add (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) IntegerToComplex (Complex 4) () () ) () .false. .false. )] [] )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 12 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 12.000000 0.000000 (Complex 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 13 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 13.000000 0.000000 (Complex 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 c) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 13 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 13.000000 0.000000 (Complex 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 c) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 14 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 14.000000 0.000000 (Complex 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-array_size_05-bc7d72f.stderr0000664000175000017500000000037115174404631024541 0ustar alastairalastairsemantic error: Only Integer literals or expressions which reduce to constant Integer are accepted as kind parameters. --> tests/errors/array_size_05.f90:6:27 | 6 | size_a = size(a, kind=kindvar, dim=1) | ^^^^^^^ lfortran-0.63.0/tests/reference/julia-subroutines_02-8f01adf.json0000664000175000017500000000075515174404631024736 0ustar alastairalastair{ "basename": "julia-subroutines_02-8f01adf", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/subroutines_02.f90", "infile_hash": "0da20d4528bff96e6ec7497805bf54f1744384b5ab8de197c3e75432", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutines_02-8f01adf.stdout", "stdout_hash": "8567773fe3abad3c9bdd0b49f8168d14a0f3f8dd89860ecacf65e7bf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-complex_01-f07fa9a.json0000664000175000017500000000075015174404631023504 0ustar alastairalastair{ "basename": "ast-complex_01-f07fa9a", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_01.f90", "infile_hash": "e94aebc987a1655b49e1e31229a6c24ccdbed83af0ebf6a0fb4684f2", "outfile": null, "outfile_hash": null, "stdout": "ast-complex_01-f07fa9a.stdout", "stdout_hash": "8fb68c50009aae86bea9902acccea31dd75f9372e349cfcc5986c104", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/tokens-array3-72b5447.json0000664000175000017500000000072015174404631023230 0ustar alastairalastair{ "basename": "tokens-array3-72b5447", "cmd": "lfortran --no-color --show-tokens {infile} -o {outfile}", "infile": "tests/array3.f90", "infile_hash": "047ac01d7e3df52429d6889258f37213048937dae8611af6cbd9ecae", "outfile": null, "outfile_hash": null, "stdout": "tokens-array3-72b5447.stdout", "stdout_hash": "850337689a6aff3dec0ad753b22b2ceb473efa75d4fee2587d579474", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-abort_01-7212a3d.json0000664000175000017500000000106515174404631023155 0ustar alastairalastair{ "basename": "llvm-abort_01-7212a3d", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/abort_01.f90", "infile_hash": "9b8982942d302b8eddf9045a7946fa1e69ed2f05b494320cef4823c2", "outfile": null, "outfile_hash": null, "stdout": "llvm-abort_01-7212a3d.stdout", "stdout_hash": "af197c3f92b3558b7df838df81d7def4c701eb5db5cace0c1c2b1daa", "stderr": "llvm-abort_01-7212a3d.stderr", "stderr_hash": "132e12d6d59905849ec72f4c5e5303920f043e68e199519ab136643f", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-dependency_test_03-86dce2a.json0000664000175000017500000000075315174404631025214 0ustar alastairalastair{ "basename": "asr-dependency_test_03-86dce2a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/dependency_test_03.f90", "infile_hash": "390ea7aa4152460550f66c9d9bab3621da4cb1b7c17e27f7efa9f0df", "outfile": null, "outfile_hash": null, "stdout": "asr-dependency_test_03-86dce2a.stdout", "stdout_hash": "8414a623c0f0b7cc08a496642381c976703fb810be4241a5810e8d64", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-case_05-8f778ac.json0000664000175000017500000000073715174404631022711 0ustar alastairalastair{ "basename": "asr-case_05-8f778ac", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_05.f90", "infile_hash": "914477f4a376baf0341e522d2109b6108238cd1d9dfecf969283ab79", "outfile": null, "outfile_hash": null, "stdout": "asr-case_05-8f778ac.stdout", "stdout_hash": "e9505a97ad696832a937b3ef0683fd0efde0cac5221e69d89bd1c04d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-interactive_parse_without_program_line-f2c0aaa.stdout0000664000175000017500000001123315174404631032174 0ustar alastairalastair(TranslationUnit [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrAllocatable )] [(a [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrPointer )] [(p [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (FuncCallOrArray allocate [] [(() (FuncCallOrArray a [] [(() 10 () 0)] [] [] [] ) () 0)] [] [] [] ) (FuncCallOrArray deallocate [] [(() a () 0)] [] [] [] ) (FuncCallOrArray open [] [] [(unit 10) (file (String "test.txt" ())) (status (String "old" ()))] [] [] ) (FuncCallOrArray flush [] [(() 10 () 0)] [] [] [] ) (FuncCallOrArray close [] [] [(unit 10)] [] [] ) (FuncCallOrArray nullify [] [(() p () 0)] [] [] [] ) exit cycle return continue (Print 0 () [exit] () ) (Print 0 () [cycle] () ) (Print 0 () [return] () ) (Print 0 () [continue] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SubroutineCall 0 exit [] [] [] [] () ) (SubroutineCall 0 cycle [] [] [] [] () ) (SubroutineCall 0 return [] [] [] [] () ) (SubroutineCall 0 continue [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) contains (Subroutine sub [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(DoLoop 0 () 0 i 1 10 () [(Print 0 () [i] () ) (If 0 () (== i 5) [(Exit 0 () () )] [] () () () ) (If 0 () (== i 7) [(Cycle 0 () () )] [] () () () ) (If 0 () (== i 9) [(Return 0 () () )] [] () () () ) (If 0 () (== i 2) [(Continue 0 () )] [] () () () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] ) end program] ) lfortran-0.63.0/tests/reference/asr-case_05-8f778ac.stdout0000664000175000017500000001332615174404631023260 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { case_05: (Program (SymbolTable 2 { grade: (Variable 2 grade [] Local (StringConstant "B" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "B" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) case_05 [] [(Select () (Var 2 grade) [(CaseStmt [(StringConstant "A" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [(Print (StringConstant "Excellent!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(StringConstant "B" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [] .false. ) (CaseStmt [(StringConstant "C" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [(Print (StringConstant "Well done" (String 1 (IntegerConstant 9 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(StringConstant "D" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [(Print (StringConstant "You passed" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(StringConstant "F" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [(Print (StringConstant "Better try again" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. )] [(Print (StringConstant "Invalid grade" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your grade is " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 grade)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-arrays_op_10-19bd9d9.json0000664000175000017500000000075615174404631023770 0ustar alastairalastair{ "basename": "asr-arrays_op_10-19bd9d9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_op_10.f90", "infile_hash": "b9f29a5f12342cf162fe90d308dfb51ffdf3b181b06f27fe34d52d26", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_op_10-19bd9d9.stdout", "stdout_hash": "bca6f5decd5b5e57343446ab885e7add7339cc15bf0173e4a455aef8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-modules_05-c35e0ac.json0000664000175000017500000000075015174404631023477 0ustar alastairalastair{ "basename": "ast-modules_05-c35e0ac", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_05.f90", "infile_hash": "eaea53640868ce2121656fd7b87e06fe464e05c8e9a0cf731a7a1dd9", "outfile": null, "outfile_hash": null, "stdout": "ast-modules_05-c35e0ac.stdout", "stdout_hash": "97a5d5fb477a65d5a96f3c9783f24c971e560937d0f6940b317646f8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_12-744ab27.stdout0000664000175000017500000000717515174404631023723 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { module_12: (Module (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) module_12 () [] .false. .false. .false. ), prog_module_12: (Program (SymbolTable 3 { a: (ExternalSymbol 3 a 2 a module_12 [] a Public ) }) prog_module_12 [module_12] [(Assignment (ArrayItem (Var 3 a) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (If () (IntegerCompare (ArrayItem (Var 3 a) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-derived_type_04-0a4f388.stderr0000664000175000017500000000044715174404631024716 0ustar alastairalastairsemantic error: Passed object dummy argument my_object not found in function arguments --> tests/errors/derived_type_04.f90:7:9 | 7 | procedure(testing_interface), deferred, pass(my_object) :: testing | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-expr_06-2de4136.stdout0000664000175000017500000000410215174404631023215 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { expr_06: (Program (SymbolTable 2 { x: (Variable 2 x [] Local (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Add (IntegerConstant 6 (Integer 4) Decimal) (Integer 4) (IntegerConstant 9 (Integer 4) Decimal) ) (IntegerConstant 9 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) expr_06 [] [(Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-sin_03-8490135.stdout0000664000175000017500000000552715174404631022706 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), sin_03: (Program (SymbolTable 2 { dp: (ExternalSymbol 2 dp 4 real64 lfortran_intrinsic_iso_fortran_env [] real64 Public ), x: (Variable 2 x [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sin_03 [iso_fortran_env] [(Assignment (Var 2 x) (IntrinsicElementalFunction Sin [(RealConstant 1.500000 (Real 8) )] 0 (Real 8) (RealConstant 0.997495 (Real 8) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-functions_13-3345127.stdout0000664000175000017500000005631415174404631024121 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { test_scan_module: (Module (SymbolTable 2 { test_scan_intrinsic: (Function (SymbolTable 3 { }) test_scan_intrinsic (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(If () (IntegerCompare (IntrinsicElementalFunction StringFindSet [(StringConstant "fortran" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "ao" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction StringFindSet [(StringConstant "fortran" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "ao" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (LogicalConstant .true. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 6 (Integer 4) Decimal) ) NotEq (IntegerConstant 6 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction StringFindSet [(StringConstant "fortran" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "c++" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] )] () Public .true. .true. () ) }) test_scan_module () [] .false. .false. .false. ), test_scan_verify: (Program (SymbolTable 4 { test_scan_intrinsic: (ExternalSymbol 4 test_scan_intrinsic 2 test_scan_intrinsic test_scan_module [] test_scan_intrinsic Public ), test_verify_intrinsic: (Function (SymbolTable 5 { r: (Variable 5 r [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_verify_intrinsic (FunctionType [] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(If () (IntegerCompare (IntrinsicElementalFunction StringContainsSet [(StringConstant "fortran" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "ao" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction StringContainsSet [(StringConstant "fortran" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "foo" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction StringContainsSet [(StringConstant "fortran" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "c++" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction StringContainsSet [(StringConstant "fortran" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "c++" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (LogicalConstant .true. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 7 (Integer 4) Decimal) ) NotEq (IntegerConstant 7 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction StringContainsSet [(StringConstant "fortran" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "fortran" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Assignment (Var 5 r) (LogicalConstant .true. (Logical 4) ) () .false. .false. )] (Var 5 r) Public .true. .true. () ) }) test_scan_verify [test_scan_module] [(SubroutineCall 4 test_scan_intrinsic () [] () .false. ) (Print (StringFormat () [(FunctionCall 4 test_verify_intrinsic () [] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-global_scope2-970a26a.json0000664000175000017500000000073415174404631024104 0ustar alastairalastair{ "basename": "asr-global_scope2-970a26a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope2.f90", "infile_hash": "e511f118b9a040b5e7a3ff2ad75cd7942dee08d3a21bd4ca5cd668b3", "outfile": null, "outfile_hash": null, "stdout": "asr-global_scope2-970a26a.stdout", "stdout_hash": "5a1f3e2da51aa4d68bcb84872f9d55c1ca869cb098047e8eef79018c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_45-c69c75f.stdout0000664000175000017500000030077215174404631024024 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_45: (Program (SymbolTable 7 { compiler_name: (Variable 7 compiler_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), file_scope_flag: (ExternalSymbol 7 file_scope_flag 2 file_scope_flag modules_45_fpm_manifest_profile [] file_scope_flag Public ), get_flags: (ExternalSymbol 7 get_flags 2 get_flags modules_45_fpm_manifest_profile [] get_flags Public ), new_profile: (ExternalSymbol 7 new_profile 2 new_profile modules_45_fpm_manifest_profile [] new_profile Public ), os_type: (Variable 7 os_type [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), os_valid: (Variable 7 os_valid [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), profile_config_t: (ExternalSymbol 7 profile_config_t 2 profile_config_t modules_45_fpm_manifest_profile [] profile_config_t Public ), profile_name: (Variable 7 profile_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), profiles: (Variable 7 profiles [] Local () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 7 profile_config_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), profindex: (Variable 7 profindex [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) modules_45 [modules_45_fpm_manifest_profile] [(Allocate [((Var 7 profile_name) [] (IntegerConstant 40 (Integer 4) Decimal) () (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString))] () () () ) (Allocate [((Var 7 compiler_name) [] (IntegerConstant 40 (Integer 4) Decimal) () (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString))] () () () ) (Allocate [((Var 7 profiles) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] () () ())] () () () ) (SubroutineCall 7 get_flags () [((Var 7 profile_name)) ((Var 7 compiler_name)) ((Var 7 os_type)) ((Var 7 profiles)) ((Var 7 profindex)) ((Var 7 os_valid))] () .false. )] ), modules_45_fpm_manifest_profile: (Module (SymbolTable 2 { file_scope_flag: (Struct (SymbolTable 3 { }) file_scope_flag (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () () [] ), get_flags: (Function (SymbolTable 6 { c_flags: (Variable 6 c_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), compiler_name: (Variable 6 compiler_name [] In () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), cxx_flags: (Variable 6 cxx_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), err_message: (Variable 6 err_message [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), file_flags: (Variable 6 file_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), file_name: (Variable 6 file_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), file_scope_flags: (Variable 6 file_scope_flags [] Local () () Default (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 file_scope_flag Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), flags: (Variable 6 flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ifile: (Variable 6 ifile [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ikey: (Variable 6 ikey [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), is_valid: (Variable 6 is_valid [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), key_name: (Variable 6 key_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), link_time_flags: (Variable 6 link_time_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), os_type: (Variable 6 os_type [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), os_valid: (Variable 6 os_valid [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), profile_name: (Variable 6 profile_name [] In () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), profiles: (Variable 6 profiles [] InOut () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 profile_config_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), profindex: (Variable 6 profindex [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), stat: (Variable 6 stat [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_flags (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Integer 4) (Logical 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [new_profile] [(Var 6 profile_name) (Var 6 compiler_name) (Var 6 os_type) (Var 6 profiles) (Var 6 profindex) (Var 6 os_valid)] [(Assignment (ArrayItem (Var 6 profiles) [(() (Var 6 profindex) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Logical 4)] [] .true. .false. ) ColMajor () ) (FunctionCall 2 new_profile () [((Var 6 profile_name)) ((Var 6 compiler_name)) ((Var 6 os_type)) ((Var 6 flags)) ((Var 6 c_flags)) ((Var 6 cxx_flags)) ((Var 6 link_time_flags)) ((Var 6 file_scope_flags)) (())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Logical 4)] [] .true. .false. ) () () ) () .false. .false. ) (Assignment (Var 6 profindex) (IntegerBinOp (Var 6 profindex) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ), new_profile: (Function (SymbolTable 5 { c_flags: (Variable 5 c_flags [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), compiler: (Variable 5 compiler [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), cxx_flags: (Variable 5 cxx_flags [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), file_scope_flags: (Variable 5 file_scope_flags [] In () () Default (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) 2 file_scope_flag Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), flags: (Variable 5 flags [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), is_built_in: (Variable 5 is_built_in [] In () () Default (Logical 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), link_time_flags: (Variable 5 link_time_flags [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), os_type: (Variable 5 os_type [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), profile: (Variable 5 profile [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Logical 4)] [] .true. .false. ) 2 profile_config_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), profile_name: (Variable 5 profile_name [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_profile (FunctionType [(String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (Integer 4) (String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) (Logical 4)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Logical 4)] [] .true. .false. ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 profile_name) (Var 5 compiler) (Var 5 os_type) (Var 5 flags) (Var 5 c_flags) (Var 5 cxx_flags) (Var 5 link_time_flags) (Var 5 file_scope_flags) (Var 5 is_built_in)] [] (Var 5 profile) Public .true. .true. () ), profile_config_t: (Struct (SymbolTable 4 { c_flags: (Variable 4 c_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), compiler: (Variable 4 compiler [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), cxx_flags: (Variable 4 cxx_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), file_scope_flags: (Variable 4 file_scope_flags [] Local () () Default (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 file_scope_flag Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), flags: (Variable 4 flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), is_built_in: (Variable 4 is_built_in [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), link_time_flags: (Variable 4 link_time_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), os_type: (Variable 4 os_type [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), profile_name: (Variable 4 profile_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) profile_config_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Logical 4)] [] .true. .false. ) [] [profile_name compiler os_type flags c_flags cxx_flags link_time_flags file_scope_flags is_built_in] [] Source Public .false. .false. [] () () [] ) }) modules_45_fpm_manifest_profile () [modules_45_fpm_manifest_profile] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-functions_06-83a7aca.stdout0000664000175000017500000007007015174404631024415 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_06: (Program (SymbolTable 6 { int_return: (ExternalSymbol 6 int_return 2 int_return functions_06_m [] int_return Public ), real_return: (ExternalSymbol 6 real_return 2 real_return functions_06_m [] real_return Public ), string: (Variable 6 string [] Local (StringConstant " abc" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant " abc" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), trim_wrapper: (ExternalSymbol 6 trim_wrapper 2 trim_wrapper functions_06_m [] trim_wrapper Public ) }) functions_06 [functions_06_m] [(Print (FunctionCall 6 trim_wrapper () [((Var 6 string))] (String 1 (StringLen (Var 6 string) (Integer 4) () ) ExpressionLength DescriptorString) () () ) ) (Print (StringFormat () [(FunctionCall 6 int_return () [((Var 6 string))] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 6 string) (Integer 4) () ))] PointerArray ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 6 real_return () [((Var 6 string))] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 6 string) (Integer 4) () ))] PointerArray ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), functions_06_m: (Module (SymbolTable 2 { int_return: (Function (SymbolTable 4 { i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 4 r [s] ReturnVar () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 4 s) (Integer 4) () ))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s: (Variable 4 s [] Unspecified () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) int_return (FunctionType [(String 1 () AssumedLength DescriptorString)] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (StringLen (FunctionParam 0 (String 1 () AssumedLength DescriptorString) () ) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 s)] [(DoLoop () ((Var 4 i) (IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 4 s) (Integer 4) () ) ()) [(Assignment (ArrayItem (Var 4 r) [(() (Var 4 i) ())] (Integer 4) ColMajor () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. )] [] )] (Var 4 r) Public .true. .true. () ), real_return: (Function (SymbolTable 5 { i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 5 r [s] ReturnVar () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 5 s) (Integer 4) () ))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s: (Variable 5 s [] Unspecified () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) real_return (FunctionType [(String 1 () AssumedLength DescriptorString)] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (StringLen (FunctionParam 0 (String 1 () AssumedLength DescriptorString) () ) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 s)] [(DoLoop () ((Var 5 i) (IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 5 s) (Integer 4) () ) ()) [(Assignment (ArrayItem (Var 5 r) [(() (Var 5 i) ())] (Real 4) ColMajor () ) (RealConstant 2.000000 (Real 4) ) () .false. .false. )] [] )] (Var 5 r) Public .true. .true. () ), trim_wrapper: (Function (SymbolTable 3 { r: (Variable 3 r [s] ReturnVar () () Default (String 1 (StringLen (Var 3 s) (Integer 4) () ) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s: (Variable 3 s [] Unspecified () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) trim_wrapper (FunctionType [(String 1 () AssumedLength DescriptorString)] (String 1 (StringLen (FunctionParam 0 (String 1 () AssumedLength DescriptorString) () ) (Integer 4) () ) ExpressionLength DescriptorString) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 s)] [(Assignment (Var 3 r) (IntrinsicElementalFunction StringTrim [(Var 3 s)] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) () .false. .false. )] (Var 3 r) Public .true. .true. () ) }) functions_06_m () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/run-array_bounds_check_08-7f7acdd.stderr0000664000175000017500000000062315174404631026321 0ustar alastairalastairruntime error: Array shape mismatch in subroutine 'ff'. Tried to match size 5 of dimension 1 of argument number 1, but expected size is 100000 --> tests/errors/array_bounds_check_08.f90:4:3 | 4 | arr = ff() | ^^^ | 8 | function ff() result(res) | ~~ Here | 9 | integer :: res(100000) | ~~~~~~ Parameter is size 100000, argument is size 5 lfortran-0.63.0/tests/reference/ast-close1-d682580.stdout0000664000175000017500000000141615174404631023057 0ustar alastairalastair(TranslationUnit [(Program close1 (TriviaNode [(EndOfLine) (Comment "! Tests for syntax (AST) only:" )] [] ) [] [] [] [(Close 0 [u] [] () ) (Close 0 [] [(unit gmv_lun)] () ) (Close 0 [] [(unit dunit [(dxf [])]) (status (String "delete" ()))] () ) (Close 0 [] [(UNIT funit) (IOSTAT ierr)] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-dim_float_01-74fa3d6.json0000664000175000017500000000074015174404631023711 0ustar alastairalastair{ "basename": "asr-dim_float_01-74fa3d6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dim_float_01.f90", "infile_hash": "b15ce785e0460bd8d3f111cc981afdabd70523ce10af75df7bed27d4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dim_float_01-74fa3d6.stderr", "stderr_hash": "f25e863cdd6617b222af5350e7cbc6422596e85cf3f9e51a79d4ea67", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-intrinsics7-d1c02a1.json0000664000175000017500000000073515174404631023710 0ustar alastairalastair{ "basename": "asr-intrinsics7-d1c02a1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics7.f90", "infile_hash": "3f4b8cbb7596de01d44dd95ec9e60be72c020b5be99fd530216fa5ce", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics7-d1c02a1.stderr", "stderr_hash": "ac7860439cf8bdc12a0648003dd2a87a48b560534a0b08d1db7e0663", "returncode": 2 }lfortran-0.63.0/tests/reference/pass_inline_function_calls-functions_08-49d8a27.stdout0000664000175000017500000005746615174404631031112 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { function_08_a: (Module (SymbolTable 2 { }) function_08_a () [] .false. .false. .false. ), functions_08: (Program (SymbolTable 3 { a: (Variable 3 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 3 c [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f_real] [(Var 4 a)] [(Assignment (Var 4 x) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 4 b) (RealBinOp (Var 4 a) Add (FunctionCall 3 f_real () [((RealConstant 0.000000 (Real 4) ))] (Real 4) () () ) (Real 4) () ) () .false. .false. )] (Var 4 b) Public .true. .true. () ), f_real: (Function (SymbolTable 5 { a: (Variable 5 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 5 b [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_real (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 5 a)] [(If () (RealCompare (Var 5 a) Eq (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(Assignment (Var 5 b) (RealConstant 2.000000 (Real 4) ) () .false. .false. )] [(Assignment (Var 5 b) (RealBinOp (Var 5 a) Add (FunctionCall 3 f () [((RealConstant 1.000000 (Real 4) ))] (Real 4) () () ) (Real 4) () ) () .false. .false. )] )] (Var 5 b) Public .true. .true. () ), p: (Variable 3 p [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), q: (Variable 3 q [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 3 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) functions_08 [] [(Assignment (Var 3 y) (FunctionCall 3 f () [((Var 3 x))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 3 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 3 q) (FunctionCall 3 f_real () [((Var 3 p))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 3 q)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/wat-expr_09-fa1b124.stdout0000664000175000017500000001520515174404631023304 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i64 i32 i64) i32.const 5 local.set 2 local.get 2 i32.const 2 drop local.get 2 i32.mul local.set 0 local.get 2 i64.extend_i32_s call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 0 i32.const 25 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end i64.const 5 local.set 3 local.get 3 i64.const 2 drop local.get 3 i64.mul local.set 1 local.get 3 call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 1 call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 1 i64.const 25 i64.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\0b\00\00\00") (data (;35;) (i32.const 216) "ERROR STOP\n ") ) lfortran-0.63.0/tests/reference/asr-array_op_simplifier_test-ba92920.json0000664000175000017500000000077515174404631026473 0ustar alastairalastair{ "basename": "asr-array_op_simplifier_test-ba92920", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/array_op_simplifier_test.f90", "infile_hash": "c0b02cecb6f724cd809c6ed591f08c805e9d87dc0635842a5eca99be", "outfile": null, "outfile_hash": null, "stdout": "asr-array_op_simplifier_test-ba92920.stdout", "stdout_hash": "3bd3730cfc29b35991ea6bc530fc59d26f58e72ec3831c98dd3ece7c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_01-3535389.stdout0000664000175000017500000000555515174404631023572 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_01: (Program (SymbolTable 4 { b: (ExternalSymbol 4 b 2 b modules_01_a [] b Public ) }) modules_01 [modules_01_a] [(SubroutineCall 4 b () [] () .false. )] ), modules_01_a: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { }) b (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "b()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ) }) modules_01_a () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-derived_types_02-2a5b79b.stdout0000664000175000017500000000212415174404631025646 0ustar alastairalastairmodule a implicit none integer, parameter :: r8 = kind(0.d0) type :: B end type B type :: C end type C type, extends(B), public :: X private real(r8) :: r1 type(C), pointer :: cc => null() real(r8), pointer :: r2(:) => null(), r3(:) => null() contains private procedure, private :: p1 procedure(something), private :: p1b procedure, pass(self) :: p2 procedure :: proc_1, proc_2 generic :: operator(/=) => p5, p6 generic :: operator(+) => p8 generic :: operator(.in.) => p7 generic :: operator(.dot.) => p10 generic :: operator(/) => p11 generic :: assignment(=) => p9 generic, public :: calcCoeffs => calcCoeffsReal, calcCoeffsKPoint generic, private :: name => sample generic :: p1 => p2; generic, public :: write(formatted) => t_write generic :: read(unformatted) => t_read final :: y end type X type :: matrix(k, b) integer, kind :: k = 4 integer(8), len :: b real(k) :: element(b,b) end type matrix contains subroutine p1(this) class(X), intent(out) :: this end subroutine p1 subroutine p2(this) class(X), intent(inout) :: this end subroutine p2 end module a lfortran-0.63.0/tests/reference/asr-functions_16-3e10090.stdout0000664000175000017500000026324615174404631024201 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_16: (Program (SymbolTable 9 { }) functions_16 [] [(Print (StringConstant "running functions_16 program" (String 1 (IntegerConstant 28 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ), tomlf_utils_sort: (Module (SymbolTable 2 { compare_keys_less: (Function (SymbolTable 8 { 1_toml_key_key: (ExternalSymbol 8 1_toml_key_key 3 key toml_key [] key Public ), less: (Variable 8 less [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lhs: (Variable 8 lhs [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 8 rhs [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) compare_keys_less (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 8 lhs) (Var 8 rhs)] [(Assignment (Var 8 less) (StringCompare (StructInstanceMember (Var 8 lhs) 8 1_toml_key_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) Lt (StructInstanceMember (Var 8 rhs) 8 1_toml_key_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Logical 4) () ) () .false. .false. )] (Var 8 less) Public .true. .true. () ), compare_less: (Function (SymbolTable 4 { less: (Variable 4 less [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lhs: (Variable 4 lhs [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 4 rhs [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) compare_less (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (Logical 4) Source Interface () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 lhs) (Var 4 rhs)] [] (Var 4 less) Public .false. .true. () ), quicksort: (Function (SymbolTable 6 { high: (Variable 6 high [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 6 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), idx: (Variable 6 idx [] InOut () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), last: (Variable 6 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), less: (Variable 6 less [] Unspecified () () Default (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (Logical 4) Source Interface () .false. .true. .false. .false. .false. [] .false. ) 2 compare_less Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), list: (Variable 6 list [] InOut () () Default (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), low: (Variable 6 low [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pivot: (Variable 6 pivot [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) quicksort (FunctionType [(Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) (Array (Integer 4) [(() ())] DescriptorArray ) (Integer 4) (Integer 4) (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (Logical 4) Source Interface () .false. .true. .false. .false. .false. [] .false. )] () Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [swap quicksort] [(Var 6 list) (Var 6 idx) (Var 6 low) (Var 6 high) (Var 6 less)] [(If () (IntegerCompare (Var 6 low) Lt (Var 6 high) (Logical 4) () ) [(SubroutineCall 2 swap () [((ArrayItem (Var 6 idx) [(() (Var 6 low) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 6 idx) [(() (IntegerBinOp (IntegerBinOp (Var 6 low) Add (Var 6 high) (Integer 4) () ) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) ())] (Integer 4) ColMajor () ))] () .false. ) (Assignment (Var 6 last) (Var 6 low) () .false. .false. ) (DoLoop () ((Var 6 i) (IntegerBinOp (Var 6 low) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Var 6 high) ()) [(If () (FunctionCall 6 less () [((ArrayItem (Var 6 list) [(() (ArrayItem (Var 6 idx) [(() (Var 6 i) ())] (Integer 4) ColMajor () ) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () )) ((ArrayItem (Var 6 list) [(() (ArrayItem (Var 6 idx) [(() (Var 6 low) ())] (Integer 4) ColMajor () ) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ))] (Logical 4) () () ) [(Assignment (Var 6 last) (IntegerBinOp (Var 6 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 2 swap () [((ArrayItem (Var 6 idx) [(() (Var 6 last) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 6 idx) [(() (Var 6 i) ())] (Integer 4) ColMajor () ))] () .false. )] [] )] [] ) (SubroutineCall 2 swap () [((ArrayItem (Var 6 idx) [(() (Var 6 low) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 6 idx) [(() (Var 6 last) ())] (Integer 4) ColMajor () ))] () .false. ) (Assignment (Var 6 pivot) (Var 6 last) () .false. .false. ) (SubroutineCall 2 quicksort () [((ArrayPhysicalCast (Var 6 list) DescriptorArray DescriptorArray (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 idx) DescriptorArray DescriptorArray (Array (Integer 4) [(() ())] DescriptorArray ) () )) ((Var 6 low)) ((IntegerBinOp (Var 6 pivot) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((Var 6 less))] () .false. ) (SubroutineCall 2 quicksort () [((ArrayPhysicalCast (Var 6 list) DescriptorArray DescriptorArray (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 idx) DescriptorArray DescriptorArray (Array (Integer 4) [(() ())] DescriptorArray ) () )) ((IntegerBinOp (Var 6 pivot) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((Var 6 high)) ((Var 6 less))] () .false. )] [] )] () Public .true. .true. () ), sort: (GenericProcedure 2 sort [2 sort_keys] Public ), sort_keys: (Function (SymbolTable 5 { compare: (Variable 5 compare [] Unspecified () () Default (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (Logical 4) Source Interface () .false. .true. .false. .false. .false. [] .false. ) 2 compare_less Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), high: (Variable 5 high [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), idx: (Variable 5 idx [] Out () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), indexarray: (Variable 5 indexarray [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), list: (Variable 5 list [] InOut () () Default (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), low: (Variable 5 low [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sorted: (Variable 5 sorted [] Local () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sort_keys (FunctionType [(Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) (Array (Integer 4) [(() ())] DescriptorArray ) (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (Logical 4) Source Interface () .false. .true. .false. .false. .false. [] .false. )] () Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [quicksort] [(Var 5 list) (Var 5 idx) (Var 5 compare)] [(Assignment (Var 5 low) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 5 high) (ArraySize (Var 5 list) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 5 sorted) (Var 5 list) () .false. .false. ) (Allocate [((Var 5 indexarray) [((IntegerConstant 1 (Integer 4) Decimal) (Var 5 high))] () () ())] () () (ArrayConstructor [(ImpliedDoLoop [(Var 5 i)] (Var 5 i) (Var 5 low) (Var 5 high) () (Integer 4) () )] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) ())] DescriptorArray ) () ColMajor () ) ) (Assignment (Var 5 indexarray) (ArrayConstructor [(ImpliedDoLoop [(Var 5 i)] (Var 5 i) (Var 5 low) (Var 5 high) () (Integer 4) () )] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) ())] DescriptorArray ) () ColMajor () ) () .false. .false. ) (If () (IntrinsicElementalFunction Present [(Var 5 compare)] 0 (Logical 4) () ) [(SubroutineCall 2 quicksort () [((Var 5 sorted)) ((Var 5 indexarray)) ((Var 5 low)) ((Var 5 high)) ((Var 5 compare))] () .false. )] [(SubroutineCall 2 quicksort () [((Var 5 sorted)) ((Var 5 indexarray)) ((Var 5 low)) ((Var 5 high)) ((Var 2 compare_keys_less))] () .false. )] ) (DoLoop () ((Var 5 i) (Var 5 low) (Var 5 high) ()) [(Assignment (ArrayItem (Var 5 list) [(() (Var 5 i) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ) (ArrayItem (Var 5 sorted) [(() (ArrayItem (Var 5 indexarray) [(() (Var 5 i) ())] (Integer 4) ColMajor () ) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ) () .false. .false. )] [] ) (If () (IntrinsicElementalFunction Present [(Var 5 idx)] 0 (Logical 4) () ) [(Assignment (Var 5 idx) (Var 5 indexarray) () .false. .false. )] [] )] () Public .true. .true. () ), swap: (Function (SymbolTable 7 { lhs: (Variable 7 lhs [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 7 rhs [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 7 tmp [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) swap (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 7 lhs) (Var 7 rhs)] [(Assignment (Var 7 tmp) (Var 7 lhs) () .false. .false. ) (Assignment (Var 7 lhs) (Var 7 rhs) () .false. .false. ) (Assignment (Var 7 rhs) (Var 7 tmp) () .false. .false. )] () Public .true. .true. () ), toml_key: (Struct (SymbolTable 3 { key: (Variable 3 key [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_key (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [key] [] Source Public .false. .false. [] () () [] ) }) tomlf_utils_sort () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-doconcurrentloop_02-b8757f0.json0000664000175000017500000000100315174404631025272 0ustar alastairalastair{ "basename": "ast-doconcurrentloop_02-b8757f0", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/doconcurrentloop_02.f90", "infile_hash": "972a21c452523a0a3060e6b1a0c75e868f5dd660ea5763358ccade86", "outfile": null, "outfile_hash": null, "stdout": "ast-doconcurrentloop_02-b8757f0.stdout", "stdout_hash": "275c444c1a61effae091b2ec68fa2755d9d06c128ddc326e3ed60b4c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_error_07c-901677a.json0000664000175000017500000000076215174404631025014 0ustar alastairalastair{ "basename": "asr-template_error_07c-901677a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_07c.f90", "infile_hash": "5a4d161fc22863d78263e4a5e4a34a63e5f5a73e4c894b4ac91ea35b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_07c-901677a.stderr", "stderr_hash": "26d480e92127e294998ca7f559ccb8d78bc7b057256d7baf17483da4", "returncode": 2 }lfortran-0.63.0/tests/reference/asr_clojure-subroutine1-be16026.stdout0000664000175000017500000000274015174404631025740 0ustar alastairalastair(TranslationUnit (SymbolTable 1 {:g (Function (SymbolTable 2 {:i (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0), :x (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0)}) g (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false.) [] [] [(Assignment (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false.) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (Var 2 x) (IntegerBinOp (Var 2 x) Mul (Var 2 i) (Integer 4) ()) () .false. .false.)] [])] () Public .true. .true. ()), :h (Function (SymbolTable 3 {:i (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0), :x (Variable 3 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0)}) h (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false.) [] [] [(Assignment (Var 3 x) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false.) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (Var 3 x) (IntegerBinOp (Var 3 i) Mul (Var 3 x) (Integer 4) ()) () .false. .false.)] [])] () Public .true. .true. ())}) []) lfortran-0.63.0/tests/reference/julia-block_03-cf8537e.stdout0000664000175000017500000000062515174404631023747 0ustar alastairalastairfunction square(b::Int32) local result::Int32 result = b * b if result ≠ 100 println(Base.stderr, "ERROR STOP") exit(1) end println(result) end function main() local a::Int32 a = 10 @label label_1 let b::Int32 a = a + 5 if a == 15 @goto label_1 end b = a ÷ 2 square(b) end end main() lfortran-0.63.0/tests/reference/asr-template_commutative-45a3ac0.json0000664000175000017500000000100615174404631025661 0ustar alastairalastair{ "basename": "asr-template_commutative-45a3ac0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_commutative.f90", "infile_hash": "17b44264286a23c913bfa477f02febff7dcd4db7d04cf26d8cf3c413", "outfile": null, "outfile_hash": null, "stdout": "asr-template_commutative-45a3ac0.stdout", "stdout_hash": "fe999d88721d00ac9fb81e24db4ccc0f62c0aed2914366f87a3e6c9e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-case_03-5c7be5c.stdout0000664000175000017500000000226215174404631023316 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t a=1; int32_t b=2; int32_t marks; marks = 94; if (marks >= 40 + b) { std::cout<< "Pass!"<= 40 + b) { std::cout<< "Pass!"< co_array) ! segment 1 end team form team(2 - mod(this_image(), 2), odd_even) change team(odd_even) ! segment 2 end team end program team1 lfortran-0.63.0/tests/reference/asr-data_implied_do_01-737a2b1.stdout0000664000175000017500000003327215174404631025340 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { data_implied_do_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) data_implied_do_01 [] [(Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 2.000000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 0.000000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 0.000000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 0.000000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 1.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 2.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 0.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 0.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 0.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-parameter1-e3995e7.json0000664000175000017500000000072315174404631023453 0ustar alastairalastair{ "basename": "ast-parameter1-e3995e7", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parameter1.f90", "infile_hash": "89e627eefd928ded810c79f57685b062a029d924767fffd996a7552d", "outfile": null, "outfile_hash": null, "stdout": "ast-parameter1-e3995e7.stdout", "stdout_hash": "cc8e9ed0aa3ba9688a32f03206cef43fa33a3c5f2d2d60121b541ffc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_error_07a-fa85c7e.stderr0000664000175000017500000000035515174404631025566 0ustar alastairalastairsemantic error: Symbol combine is not declared in semigroup's parameters --> tests/errors/template_error_07a.f90:6:5 - 13:1 | 6 | requirement semigroup(t) | ^^^^^^^^^^^^^^^^^^^^^^^^... ... | 13 | | ...^ lfortran-0.63.0/tests/reference/asr-modulo_01-b82bee9.stderr0000664000175000017500000000023415174404631023664 0ustar alastairalastairsemantic error: Second argument of modulo cannot be 0 --> tests/errors/modulo_01.f90:2:14 | 2 | print *, modulo(1, 0) | ^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-fixed_form_simple_continue-dbefb27.stdout0000664000175000017500000000027415174404631027564 0ustar alastairalastair(TranslationUnit [(Program implicit_program_lfortran () [] [] [] [(Continue 0 () )] [] )] ) lfortran-0.63.0/tests/reference/ast-assign_to1-09e061a.stdout0000664000175000017500000000105315174404631024002 0ustar alastairalastair(TranslationUnit [(Program main () [] [] [] [(If 1000 () (< 0 1) [(Assign 0 15 k () )] [] () () () ) (GoTo 100 k () [] () ) (Print 15 () [(String "run" ())] () )] [] )] ) lfortran-0.63.0/tests/reference/tokens-esub1-3e8b16d.stdout0000664000175000017500000000042515174404631023557 0ustar alastairalastair(KEYWORD "subroutine") (TOKEN "identifier" g) (TOKEN "(") (TOKEN ")") (TOKEN "identifier" r) (NEWLINE) (KEYWORD "integer") (TOKEN "::") (TOKEN "identifier" x) (NEWLINE) (TOKEN "identifier" x) (TOKEN "=") (TOKEN "integer" 1) (NEWLINE) (KEYWORD "end subroutine") (NEWLINE) (EOF) lfortran-0.63.0/tests/reference/julia-subroutine1-87ec3af.stdout0000664000175000017500000000033615174404631024706 0ustar alastairalastairfunction g() local i::Int32 local x::Int32 x = 1 for i ∈ 1:10 x = x * i end end function h() local i::Int32 local x::Int32 x = 1 for i ∈ 1:10 x = i * x end end lfortran-0.63.0/tests/reference/asr-nested_call_filter_01-2b1295b.stdout0000664000175000017500000002532715174404631026066 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nested_call_filter_01: (Program (SymbolTable 4 { modproc: (ExternalSymbol 4 modproc 2 modproc nested_call_filter_mod [] modproc Public ), outer: (Function (SymbolTable 5 { a: (Variable 5 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), inner: (Function (SymbolTable 6 { }) inner (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 5 a) (IntegerBinOp (Var 5 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ) }) outer (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 5 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 5 inner () [] () .false. ) (SubroutineCall 4 modproc () [((Var 5 a))] () .false. )] () Public .true. .true. () ) }) nested_call_filter_01 [nested_call_filter_mod] [(SubroutineCall 4 outer () [] () .false. )] ), nested_call_filter_mod: (Module (SymbolTable 2 { modproc: (Function (SymbolTable 3 { y: (Variable 3 y [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) modproc (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 y)] [(Assignment (Var 3 y) (IntegerBinOp (Var 3 y) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ) }) nested_call_filter_mod () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/run-read_40-72baf22.json0000664000175000017500000000070715174404631022702 0ustar alastairalastair{ "basename": "run-read_40-72baf22", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/read_40.f90", "infile_hash": "7e90dbd67eed6f847bc0f1bf39c5843a10df9b0dad28ea30c4119148", "outfile": null, "outfile_hash": null, "stdout": "run-read_40-72baf22.stdout", "stdout_hash": "cdde590c8ded40f768566f8fefa15e60f9573b153ea0fe4374d26240", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_typing4-c338b90.stderr0000664000175000017500000000027515174404631025215 0ustar alastairalastairstyle suggestion: Use complex(8) instead of complex*16 --> tests/implicit_typing4.f90:7:21 | 7 | IMPLICIT COMPLEX*16 (C,Z) | ^ help: write this as 'complex(8)' lfortran-0.63.0/tests/reference/asr-nested_namelist_01-7fc4952.stdout0000664000175000017500000002621315174404631025432 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nested_namelist_01: (Program (SymbolTable 5 { outer: (ExternalSymbol 5 outer 2 outer nested_namelist_01_mod [] outer Public ) }) nested_namelist_01 [nested_namelist_01_mod] [(SubroutineCall 5 outer () [] () .false. )] ), nested_namelist_01_mod: (Module (SymbolTable 2 { outer: (Function (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), inner: (Function (SymbolTable 4 { lfortran_iomsg: (Variable 4 lfortran_iomsg [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) inner (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(FileWrite 0 (IntegerConstant 6 (Integer 4) Decimal) (Var 4 lfortran_iomsg) () () [] () () () .false. 3 nml () () )] () Public .true. .true. () ), nml: (Namelist 3 nml [3 i 3 x] ), x: (Variable 3 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) outer (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 i) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 x) (RealConstant 3.000000 (Real 4) ) () .false. .false. ) (SubroutineCall 3 inner () [] () .false. )] () Public .true. .true. () ) }) nested_namelist_01_mod () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/llvm-array_bound_1-6741f43.stdout0000664000175000017500000003671415174404631024610 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [9 x i8] c"I4,I4,I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [9 x i8] c"I4,I4,I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [12 x i8] c"I4,I4,I4,I4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [12 x i8] c"I4,I4,I4,I4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.4 = private unnamed_addr constant [6 x i8] c"I4,I4\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.5 = private unnamed_addr constant [6 x i8] c"I4,I4\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.6 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.7 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc19 = alloca %string_descriptor, align 8 %stringFormat_desc16 = alloca %string_descriptor, align 8 %stringFormat_desc13 = alloca %string_descriptor, align 8 %stringFormat_desc10 = alloca %string_descriptor, align 8 %stringFormat_desc7 = alloca %string_descriptor, align 8 %stringFormat_desc4 = alloca %string_descriptor, align 8 %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca [196 x i32], align 4 %b = alloca [96 x i32], align 4 %c = alloca [35 x i32], align 4 %d = alloca [4 x i32], align 4 %3 = alloca i64, align 8 %4 = alloca i32, align 4 store i32 2, i32* %4, align 4 %5 = alloca i32, align 4 store i32 3, i32* %5, align 4 %6 = alloca i32, align 4 store i32 1, i32* %6, align 4 %7 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %4, i32* %5, i32* %6) %8 = load i64, i64* %3, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %7, i8** %9, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %8, i64* %10, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %12 = load i8*, i8** %11, align 8 %13 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %14 = load i64, i64* %13, align 8 %15 = trunc i64 %14 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %12, i32 %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %16 = icmp eq i8* %7, null br i1 %16, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %7) br label %free_done free_done: ; preds = %free_nonnull, %.entry %17 = alloca i64, align 8 %18 = alloca i32, align 4 store i32 5, i32* %18, align 4 %19 = alloca i32, align 4 store i32 9, i32* %19, align 4 %20 = alloca i32, align 4 store i32 7, i32* %20, align 4 %21 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @serialization_info.1, i32 0, i32 0), i64* %17, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %18, i32* %19, i32* %20) %22 = load i64, i64* %17, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %21, i8** %23, align 8 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %22, i64* %24, align 8 %25 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %26 = load i8*, i8** %25, align 8 %27 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %28 = load i64, i64* %27, align 8 %29 = trunc i64 %28 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %26, i32 %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %30 = icmp eq i8* %21, null br i1 %30, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %2, i8* %21) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %31 = alloca i64, align 8 %32 = alloca i32, align 4 store i32 1, i32* %32, align 4 %33 = alloca i32, align 4 store i32 2, i32* %33, align 4 %34 = alloca i32, align 4 store i32 3, i32* %34, align 4 %35 = alloca i32, align 4 store i32 4, i32* %35, align 4 %36 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.2, i32 0, i32 0), i64* %31, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %32, i32* %33, i32* %34, i32* %35) %37 = load i64, i64* %31, align 8 %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %36, i8** %38, align 8 %39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %37, i64* %39, align 8 %40 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %41 = load i8*, i8** %40, align 8 %42 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %43 = load i64, i64* %42, align 8 %44 = trunc i64 %43 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %41, i32 %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %45 = icmp eq i8* %36, null br i1 %45, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free_alloc(i8* %2, i8* %36) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 %46 = alloca i64, align 8 %47 = alloca i32, align 4 store i32 2, i32* %47, align 4 %48 = alloca i32, align 4 store i32 4, i32* %48, align 4 %49 = alloca i32, align 4 store i32 6, i32* %49, align 4 %50 = alloca i32, align 4 store i32 7, i32* %50, align 4 %51 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.3, i32 0, i32 0), i64* %46, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %47, i32* %48, i32* %49, i32* %50) %52 = load i64, i64* %46, align 8 %53 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 store i8* %51, i8** %53, align 8 %54 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 store i64 %52, i64* %54, align 8 %55 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 %56 = load i8*, i8** %55, align 8 %57 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 %58 = load i64, i64* %57, align 8 %59 = trunc i64 %58 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %56, i32 %59, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %60 = icmp eq i8* %51, null br i1 %60, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %free_done6 call void @_lfortran_free_alloc(i8* %2, i8* %51) br label %free_done9 free_done9: ; preds = %free_nonnull8, %free_done6 %61 = alloca i64, align 8 %62 = alloca i32, align 4 store i32 6, i32* %62, align 4 %63 = alloca i32, align 4 store i32 1, i32* %63, align 4 %64 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info.4, i32 0, i32 0), i64* %61, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %62, i32* %63) %65 = load i64, i64* %61, align 8 %66 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 store i8* %64, i8** %66, align 8 %67 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 store i64 %65, i64* %67, align 8 %68 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 %69 = load i8*, i8** %68, align 8 %70 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 %71 = load i64, i64* %70, align 8 %72 = trunc i64 %71 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %69, i32 %72, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %73 = icmp eq i8* %64, null br i1 %73, label %free_done12, label %free_nonnull11 free_nonnull11: ; preds = %free_done9 call void @_lfortran_free_alloc(i8* %2, i8* %64) br label %free_done12 free_done12: ; preds = %free_nonnull11, %free_done9 %74 = alloca i64, align 8 %75 = alloca i32, align 4 store i32 10, i32* %75, align 4 %76 = alloca i32, align 4 store i32 7, i32* %76, align 4 %77 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info.5, i32 0, i32 0), i64* %74, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %75, i32* %76) %78 = load i64, i64* %74, align 8 %79 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 store i8* %77, i8** %79, align 8 %80 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 store i64 %78, i64* %80, align 8 %81 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 %82 = load i8*, i8** %81, align 8 %83 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 %84 = load i64, i64* %83, align 8 %85 = trunc i64 %84 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %82, i32 %85, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %86 = icmp eq i8* %77, null br i1 %86, label %free_done15, label %free_nonnull14 free_nonnull14: ; preds = %free_done12 call void @_lfortran_free_alloc(i8* %2, i8* %77) br label %free_done15 free_done15: ; preds = %free_nonnull14, %free_done12 %87 = alloca i64, align 8 %88 = alloca i32, align 4 store i32 1, i32* %88, align 4 %89 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.6, i32 0, i32 0), i64* %87, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %88) %90 = load i64, i64* %87, align 8 %91 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 store i8* %89, i8** %91, align 8 %92 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 store i64 %90, i64* %92, align 8 %93 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 %94 = load i8*, i8** %93, align 8 %95 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 %96 = load i64, i64* %95, align 8 %97 = trunc i64 %96 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %94, i32 %97, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) %98 = icmp eq i8* %89, null br i1 %98, label %free_done18, label %free_nonnull17 free_nonnull17: ; preds = %free_done15 call void @_lfortran_free_alloc(i8* %2, i8* %89) br label %free_done18 free_done18: ; preds = %free_nonnull17, %free_done15 %99 = alloca i64, align 8 %100 = alloca i32, align 4 store i32 4, i32* %100, align 4 %101 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.7, i32 0, i32 0), i64* %99, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %100) %102 = load i64, i64* %99, align 8 %103 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 store i8* %101, i8** %103, align 8 %104 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 store i64 %102, i64* %104, align 8 %105 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 %106 = load i8*, i8** %105, align 8 %107 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 %108 = load i64, i64* %107, align 8 %109 = trunc i64 %108 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* %106, i32 %109, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 1) %110 = icmp eq i8* %101, null br i1 %110, label %free_done21, label %free_nonnull20 free_nonnull20: ; preds = %free_done18 call void @_lfortran_free_alloc(i8* %2, i8* %101) br label %free_done21 free_done21: ; preds = %free_nonnull20, %free_done18 br label %return return: ; preds = %free_done21 br label %FINALIZE_SYMTABLE_array_bound_1 FINALIZE_SYMTABLE_array_bound_1: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/llvm-recursion_02-76da7b3.json0000664000175000017500000000076115174404631024154 0ustar alastairalastair{ "basename": "llvm-recursion_02-76da7b3", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/recursion_02.f90", "infile_hash": "2935948fa13844b5a3b169f1d6df99e22cd1329310ef7c6d0f152583", "outfile": null, "outfile_hash": null, "stdout": "llvm-recursion_02-76da7b3.stdout", "stdout_hash": "9232fab42cb620824631803cac16762b2cddf28d140333101ce1e435", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-do_concurrent_reduce3-fc55bd2.json0000664000175000017500000000077715174404631026477 0ustar alastairalastair{ "basename": "ast_f90-do_concurrent_reduce3-fc55bd2", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/do_concurrent_reduce3.f90", "infile_hash": "68244c7ec55a2abd3a98afa53cf637130918461cb0264902730a72b3", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-do_concurrent_reduce3-fc55bd2.stdout", "stdout_hash": "ae638a94e59deec730a46c79af33d86ef2e155e208be9b1a81b43f8c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-case_05-0476e14.json0000664000175000017500000000075215174404631023211 0ustar alastairalastair{ "basename": "ast_f90-case_05-0476e14", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/case_05.f90", "infile_hash": "914477f4a376baf0341e522d2109b6108238cd1d9dfecf969283ab79", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-case_05-0476e14.stdout", "stdout_hash": "ce09baab9a9372905328040da2ec2d35d9c2521bacbd3ed6ea3752fe", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run_dbg-runtime_stacktrace_01-c6f5e06.json0000664000175000017500000000075615174404631026504 0ustar alastairalastair{ "basename": "run_dbg-runtime_stacktrace_01-c6f5e06", "cmd": "lfortran {infile} -g --no-color", "infile": "tests/errors/runtime_stacktrace_01.f90", "infile_hash": "3e65758e10744eea8d101be6437af3724c0ec32c832e29da968fc22d", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run_dbg-runtime_stacktrace_01-c6f5e06.stderr", "stderr_hash": "eb3c044e48ac8bbaa776077b6c9cef2ef164ade8cddef1d6a7f06792", "returncode": 1 }lfortran-0.63.0/tests/reference/ast-array4-3d07222.stdout0000664000175000017500000000164515174404631023062 0ustar alastairalastair(TranslationUnit [(Program array4 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 i a [(some_array [(() 5 () 0)])] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/asr-select_type_01-204dfa1.json0000664000175000017500000000076415174404631024264 0ustar alastairalastair{ "basename": "asr-select_type_01-204dfa1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/select_type_01.f90", "infile_hash": "4981b936f0ddf008f38b82c5717fa34093538455199276653661a08f", "outfile": null, "outfile_hash": null, "stdout": "asr-select_type_01-204dfa1.stdout", "stdout_hash": "5989d9b74df488927016e59cb077a28d971621dccbdf42d75f9e27b2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-interface2-98c9adf.stdout0000664000175000017500000000552115174404631024143 0ustar alastairalastair(TranslationUnit [(Module interface2 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Interface (AbstractInterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceProc (Subroutine read_params [(this) (params)] [] () () [] [(Import [] ImportDefault () )] [] [(Declaration (AttrType TypeClass [] () porous_drag_model None ) [(AttrIntent InOut )] [(this [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () parameter_list None ) [(SimpleAttribute AttrPointer ) (AttrIntent In )] [(params [] [] () () None ())] () )] [] [] [] ) )] ) (Interface (InterfaceHeaderAssignment) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [SomeProc] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [SomeProc2] [] () ) (InterfaceModuleProcedure [SomeProc3] [] () )] )] [] [] )] ) lfortran-0.63.0/tests/reference/ast-case_02-cf1eb8d.stdout0000664000175000017500000003101715174404631023401 0ustar alastairalastair(TranslationUnit [(Program case_02 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! local variable declaration" )] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(marks [] [] () () None ()) (out [] [] () () None ())] () )] [(Assignment 0 marks 81 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Select 0 () marks [(CaseStmt [(CaseCondRange 91 100 )] () [(Assignment 0 out 0 () ) (Print 0 () [(String "Excellent!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 81 90 )] () [(Assignment 0 out 1 () ) (Print 0 () [(String "Very good!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 71 80 )] () [(Assignment 0 out 2 () ) (Print 0 () [(String "Well done!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 61 70 )] () [(Assignment 0 out 3 () ) (Print 0 () [(String "Not bad!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 41 60 )] () [(Assignment 0 out 4 () ) (Print 0 () [(String "You passed!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange () 40 )] () [(Assignment 0 out 5 () ) (Print 0 () [(String "Better try again!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt_Default () [(Assignment 0 out 6 () ) (Print 0 () [(String "Invalid marks" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) () ) (Print 0 () [(String "Your marks are " ()) marks] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (/= out 1) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! case default at the top" )] ) ) (Select 0 () marks [(CaseStmt_Default () [(Print 0 () [(String "Invalid marks" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 91 100 )] () [(Print 0 () [(String "Excellent!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 81 90 )] () [(Print 0 () [(String "Very good!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 71 80 )] () [(Print 0 () [(String "Well done!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 61 70 )] () [(Print 0 () [(String "Not bad!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 41 60 )] () [(Print 0 () [(String "You passed!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange () 40 )] () [(Print 0 () [(String "Better try again!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) () ) (Print 0 () [(String "Your marks are " ()) marks] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! case default in the middle" )] ) ) (Select 0 () marks [(CaseStmt [(CaseCondRange 91 100 )] () [(Print 0 () [(String "Excellent!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 81 90 )] () [(Print 0 () [(String "Very good!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt_Default () [(Print 0 () [(String "Invalid marks" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 71 80 )] () [(Print 0 () [(String "Well done!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 61 70 )] () [(Print 0 () [(String "Not bad!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 41 60 )] () [(Print 0 () [(String "You passed!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange () 40 )] () [(Print 0 () [(String "Better try again!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) () ) (Print 0 () [(String "Your marks are " ()) marks] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/ast-arrays_09-5096a19.json0000664000175000017500000000074515174404631023133 0ustar alastairalastair{ "basename": "ast-arrays_09-5096a19", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_09.f90", "infile_hash": "4807239e4f9ca8eaee4604e98cad28c2a760cf3900a1e2018d304838", "outfile": null, "outfile_hash": null, "stdout": "ast-arrays_09-5096a19.stdout", "stdout_hash": "15dcb38cd14eb4bbf06cc6090201752843d2f94986b6054ac0500d45", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics13-349f6ac.stderr0000664000175000017500000000025415174404631024337 0ustar alastairalastairsemantic error: All arguments to min0 must be of the same type --> tests/errors/intrinsics13.f90:2:14 | 2 | print *, min(12, 13.94) | ^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-fixed_form_implicit2-f584754.stdout0000664000175000017500000000215515174404631025776 0ustar alastairalastair(TranslationUnit [(Program main () [] [(Implicit [(ImplicitSpec (AttrType TypeComplex [] () () None ) [(LetterSpec () a ) (LetterSpec () b ) (LetterSpec () c )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeCharacter [(() 4 Value)] () () None ) [(LetterSpec () k ) (LetterSpec () l )] )] () )] [] [] [] )] ) lfortran-0.63.0/tests/reference/cpp-program4-1796cb6.stderr0000664000175000017500000000040215174404631023453 0ustar alastairalastairwarning: Assuming implicit save attribute for variable declaration --> tests/program4.f90:30:13 | 30 | real :: saved1 = 2.0 | ^^^^^^^^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement lfortran-0.63.0/tests/reference/asr-merge_bits_comp-23a3e67.json0000664000175000017500000000075115174404631024527 0ustar alastairalastair{ "basename": "asr-merge_bits_comp-23a3e67", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/merge_bits_comp.f90", "infile_hash": "07da68f4c47a0ded636941ace875a8d1c0c31abec944e32405b95162", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-merge_bits_comp-23a3e67.stderr", "stderr_hash": "d1fab14201f28c9009c33c460571505646f71a4151917b273ffde9e3", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-matrix_02_matmul-d389302.json0000664000175000017500000000077215174404631024502 0ustar alastairalastair{ "basename": "asr-matrix_02_matmul-d389302", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/matrix_02_matmul.f90", "infile_hash": "d02f8fde32ffc602a3915e12a9e9cd79453989c6edcbe310a8dd7d76", "outfile": null, "outfile_hash": null, "stdout": "asr-matrix_02_matmul-d389302.stdout", "stdout_hash": "5efe6396b521cde3626d26d4397a2b88e74babaa089b295b3bad58d3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-bindc1-6cc9005.json0000664000175000017500000000073415174404631022531 0ustar alastairalastair{ "basename": "asr-bindc1-6cc9005", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bindc1.f90", "infile_hash": "b894bae3cff84c3540cc34d38c5e3e6c46197db6d93d5f0b48013a06", "outfile": null, "outfile_hash": null, "stdout": "asr-bindc1-6cc9005.stdout", "stdout_hash": "e478ad66a33cabe919b84dee0a3a026eef5eca0aacdd0d34a3fcd050", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-string_01-9625208.json0000664000175000017500000000074515174404631023051 0ustar alastairalastair{ "basename": "ast-string_01-9625208", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_01.f90", "infile_hash": "e7d4974d8a9b9704bf0c02d7943d916b40c591de3c9e89d30de28d7d", "outfile": null, "outfile_hash": null, "stdout": "ast-string_01-9625208.stdout", "stdout_hash": "0653853f1250c414f1009951e98da3be4d35f7a22a47fe599dc34198", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-program_cmake_01-caf8f48.stdout0000664000175000017500000000241715174404631025410 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [5 x i8] c"Hello" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data, i32 0, i32 0), i64 5 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %2 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %2, i32 5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_testfortran FINALIZE_SYMTABLE_testfortran: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/llvm-string_13-8952a13.stdout0000664000175000017500000001237215174404631023664 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [9 x i8] c"I4,I4,I4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %ia0 = alloca i32, align 4 store i32 48, i32* %ia0, align 4 %ia5 = alloca i32, align 4 store i32 53, i32* %ia5, align 4 %ia9 = alloca i32, align 4 store i32 57, i32* %ia9, align 4 br i1 false, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then br i1 false, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 br i1 false, label %then4, label %else5 then4: ; preds = %ifcont3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont6 else5: ; preds = %ifcont3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 %3 = alloca i64, align 8 %4 = alloca i32, align 4 store i32 48, i32* %4, align 4 %5 = alloca i32, align 4 store i32 53, i32* %5, align 4 %6 = alloca i32, align 4 store i32 57, i32* %6, align 4 %7 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %4, i32* %5, i32* %6) %8 = load i64, i64* %3, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %7, i8** %9, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %8, i64* %10, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %12 = load i8*, i8** %11, align 8 %13 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %14 = load i64, i64* %13, align 8 %15 = trunc i64 %14 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %12, i32 %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %16 = icmp eq i8* %7, null br i1 %16, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont6 call void @_lfortran_free_alloc(i8* %2, i8* %7) br label %free_done free_done: ; preds = %free_nonnull, %ifcont6 br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_string_13 FINALIZE_SYMTABLE_string_13: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) lfortran-0.63.0/tests/reference/ast-loop_test2-c76adc4.stdout0000664000175000017500000002443215174404631024201 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(nq [] [] () () None ()) (m [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(wrk5 [(1 5 DimensionExpr)] [] () () None ()) (v [(1 3 DimensionExpr) (1 4 DimensionExpr) (1 5 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(ve [(1 3 DimensionExpr) (1 4 DimensionExpr) (1 5 DimensionExpr)] [] () () None ()) (vev [(1 3 DimensionExpr) (1 4 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(zero [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(l1 [] [] () () None ()) (j [] [] () () None ()) (l2 [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(indx [] [] () () None ())] () )] [(DoLoop 0 () 140 l1 1 nq () [(DoLoop 0 () 110 j 1 m () [(Assignment 0 (FuncCallOrArray wrk5 [] [(() j () 0)] [] [] [] ) (FuncCallOrArray v [] [(() indx () 0) (() j () 0) (() l1 () 0)] [] [] [] ) () ) (Continue 110 () )] () () ) (DoLoop 0 () 120 j 1 m () [(Assignment 0 (FuncCallOrArray ve [] [(() indx () 0) (() l1 () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray wrk5 [] [(() j () 0)] [] [] [] ) () ) (Continue 120 () )] () () ) (Continue 140 () )] () () ) (Assignment 0 indx 1 () ) (Assignment 0 zero (Real "0.0d00") () ) (DoLoop 0 () 230 l1 1 nq () [(DoLoop 0 () 220 l2 1 l1 () [(Assignment 0 (FuncCallOrArray vev [] [(() l1 () 0) (() l2 () 0)] [] [] [] ) zero () ) (DoLoop 0 () 210 j 1 m () [(Assignment 0 (FuncCallOrArray vev [] [(() l1 () 0) (() l2 () 0)] [] [] [] ) (+ (FuncCallOrArray vev [] [(() l1 () 0) (() l2 () 0)] [] [] [] ) (* (FuncCallOrArray ve [] [(() indx () 0) (() l1 () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray ve [] [(() indx () 0) (() l2 () 0) (() j () 0)] [] [] [] ))) () ) (Continue 210 () )] () () ) (Assignment 0 (FuncCallOrArray vev [] [(() l2 () 0) (() l1 () 0)] [] [] [] ) (FuncCallOrArray vev [] [(() l1 () 0) (() l2 () 0)] [] [] [] ) () ) (Continue 220 () )] () () ) (Continue 230 () )] () () ) (Return 0 () () )] [] [] )] ) lfortran-0.63.0/tests/reference/ast-attributes1-9309f25.stdout0000664000175000017500000002176515174404631024152 0ustar alastairalastair(TranslationUnit [(Program attributes1 (TriviaNode [(EndOfLine) (Comment "! test for AST(to fmt) only" )] [] ) [] [] [(Declaration (AttrType TypeCharacter [(len 4 Value)] () () None ) [] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [] () () None ) [(AttrIntent In )] [(str [] [] () () DoubleAsterisk ())] () ) (Declaration (AttrType TypeCharacter [(len 1 Value) (kind c_char Value)] () () None ) [(SimpleAttribute AttrTarget ) (AttrBind (Bind [C] [(name (String "_binary_fclKernels_cl_start" ()))] ) )] [(fclKernelStart [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len 3 Value)] () () None ) [] [(c [(1 2 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrVolatile )] [(d [] [] () () None ()) (e [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrExternal )] [(g [] [] () () None ())] () ) (Declaration () [(AttrEquivalence [([a (FuncCallOrArray c [] [(() 1 () 0)] [] [] [] )]) ([b (FuncCallOrArray c [] [(() 2 () 0)] [] [] [] )])] )] [] () ) (DerivedType details [] () [] [(Declaration () [(SimpleAttribute AttrSequence )] [] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(age [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() 50 Value)] () () None ) [] [(name [] [] () () None ())] () )] [(DerivedTypeProc () [(AttrPass () )] [(UseSymbol sample name )] () )] ) (Declaration () [(SimpleAttribute AttrIntrinsic )] [(sin [] [] () () None ()) (cos [] [] () () None ())] () ) (Declaration (AttrType TypeDoublePrecision [] () () None ) [(AttrIntent In )] [(x [(() () AssumedRank)] [] () () None ())] () ) (Declaration (AttrType TypeType [] (AttrType TypeReal [(kind 4 Value)] () () None ) () None ) [(SimpleAttribute AttrAllocatable )] [(x [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeType [] (AttrType TypeInteger [(kind 4 Value)] () () None ) () None ) [(SimpleAttribute AttrAllocatable )] [(x [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeType [] (AttrType TypeCharacter [(len 4 Value)] () () None ) () None ) [(SimpleAttribute AttrAllocatable )] [(x [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeType [] (AttrType TypeLogical [(kind 4 Value)] () () None ) () None ) [(SimpleAttribute AttrAllocatable )] [(x [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeType [] (AttrType TypeComplex [(kind 4 Value)] () () None ) () None ) [(SimpleAttribute AttrAllocatable )] [(x [(() () DimensionExpr)] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrSave )] [(zzrayc [] [] () () Slash ())] () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr_openmp-openmp1-3056a3e.json0000664000175000017500000000074115174404631024321 0ustar alastairalastair{ "basename": "asr_openmp-openmp1-3056a3e", "cmd": "lfortran --show-asr --no-color --openmp {infile} -o {outfile}", "infile": "tests/openmp1.f90", "infile_hash": "646c17ebbdf68dc9e0ba68a1a56c2ffb73c029a9537622d13ca068b8", "outfile": null, "outfile_hash": null, "stdout": "asr_openmp-openmp1-3056a3e.stdout", "stdout_hash": "4a367b53912208b6e9b7e49409eb9f6b479e5dc435e52877b959c7c2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array2-e7997a8.stdout0000664000175000017500000003452515174404631023173 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array2: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), e: (Variable 2 e [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Variable 2 f [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), g: (Variable 2 g [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), h: (Variable 2 h [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) array2 [] [] ) }) [] ) lfortran-0.63.0/tests/reference/asr-cmd_01-e172099.json0000664000175000017500000000073415174404631022363 0ustar alastairalastair{ "basename": "asr-cmd_01-e172099", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/cmd_01.f90", "infile_hash": "11c7006f168f19f99bdf735051e716724b244773d6aff7c50eb77a7f", "outfile": null, "outfile_hash": null, "stdout": "asr-cmd_01-e172099.stdout", "stdout_hash": "7aabb42a4aaa1b21f2780b48c74d235608224bdb55da90bc67bc6180", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_04-5864f91.json0000664000175000017500000000072415174404631022746 0ustar alastairalastair{ "basename": "asr-array_04-5864f91", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_04.f90", "infile_hash": "49fb2152950af75eb4ccb7c32e09995c2b0a0d7139d2f3d795407d9b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_04-5864f91.stderr", "stderr_hash": "0b0d34dadf8e658122e619ddd91c15de32b84d034604dd745defbf69", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-global_scope9-f638dd0.stdout0000664000175000017500000000170415174404631024547 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) [(Assignment (Var 1 x) (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 6 (Integer 8) Decimal) () ) () .false. .false. ) (Var 1 x)] ) lfortran-0.63.0/tests/reference/asr-derived_type_04-0a4f388.json0000664000175000017500000000075115174404631024362 0ustar alastairalastair{ "basename": "asr-derived_type_04-0a4f388", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/derived_type_04.f90", "infile_hash": "54474d4d6ab8c7341f0bb594bc870769d53b24e5791a5f3dd8c26b57", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-derived_type_04-0a4f388.stderr", "stderr_hash": "89c06240e5acb5da3de35257174ab3f698788c40948fffdc135a39e0", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-incorrect_type_where_02-1746f84.json0000664000175000017500000000100115174404631026033 0ustar alastairalastair{ "basename": "asr-incorrect_type_where_02-1746f84", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incorrect_type_where_02.f90", "infile_hash": "4fbb3a440309d31eb008cd3fffcf541729477e6ac4fc23854bfa1f00", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incorrect_type_where_02-1746f84.stderr", "stderr_hash": "d8b1d8a2cb5740cc5f7d42b71949ed0ad6091a1b44477a4ddf915fde", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-fixedform_module-3f800f0.stdout0000664000175000017500000000041215174404631025262 0ustar alastairalastair(TranslationUnit [(Module e () [] [] [] [] [] ) (Program main () [] [(ImplicitNone [] () )] [] [] [] )] ) lfortran-0.63.0/tests/reference/asr-program1-17e5471.json0000664000175000017500000000071515174404631023044 0ustar alastairalastair{ "basename": "asr-program1-17e5471", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/program1.f90", "infile_hash": "ec4ccdfed01d45648718ca57a9ceb3e5aa82e55e57d8906636902e7b", "outfile": null, "outfile_hash": null, "stdout": "asr-program1-17e5471.stdout", "stdout_hash": "e560daacb987a169462e1d7e8e15cd7a5941c5dac0533a85e084d6a3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-contains1-58ed60a.stdout0000664000175000017500000002077515174404631023735 0ustar alastairalastair(TranslationUnit [(Program test23stars () [] [] [(Declaration (AttrType TypeCharacter [] () () None ) [] [(b [] [] () () None ()) (c [] [] () () None ()) (d [] [] () (String "?" ()) Equal ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(j [] [] () () None ()) (k [] [] () () None ()) (n [(1 2 DimensionExpr)] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [j k] [0 0] )] () ) (SubroutineCall 0 input [] [(() n () 0) (() (String "2*4" ()) () 0) (() b () 0) (() c () 0) (() d () 0) (() 666 () 0)] [] [] () ) (Write 0 [(()) ((String "(2i2,1x,a)" ()))] [] [(* (FuncCallOrArray n [] [(() 1 () 0)] [] [] [] ) j) (** (FuncCallOrArray n [] [(() 2 () 0)] [] [] [] ) k) b] () ) (Stop 0 () () () ) (Print 666 (String "(a)" ()) [(String " * error in n" ())] () ) (Print 0 (String "(*(i4))" ()) [n] () )] [(Subroutine input [(n) (a) (b) (c) (d) (r)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent Out )] [(n [(() () DimensionStar)] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [] () () None ) [(AttrIntent In )] [(a [] [] () () DoubleAsterisk ())] () ) (Declaration (AttrType TypeCharacter [] () () DoubleAsterisk ) [(AttrIntent Out )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () () Asterisk ) [(AttrIntent In )] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() 1 Value)] () () None ) [(AttrIntent In )] [(d [(() () AssumedRank)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [] () () None ) [] [(ch [] [] () () None ())] () ) (Declaration (AttrType TypeClass [] () () Asterisk ) [(SimpleAttribute AttrAllocatable )] [(e [(() () DimensionExpr)] [] () () None ())] () )] [(SelectRank 0 () () d [(RankStar () [(Print 0 (String "(a)" ()) [(String "This should not be printed!" ())] () )] )] () () ) (Read 0 () [(a) (())] [(iostat i)] [(FuncCallOrArray n [] [(() 1 () 0)] [] [] [] ) (FuncCallOrArray n [] [(() 2 () 0)] [] [] [] )] () ) (If 0 () (/= i 0) [(Return 0 1 () )] [] () () () ) (Print 0 (String "(a)" ()) [(String "Enter anything to continue." ())] () ) (Read 0 () [(()) ((String "(a)" ()))] [(iostat i)] [ch] () ) (Write 0 [(b) ((String "(i1)" ()))] [(iostat i)] [666] () )] [] [] )] )] ) lfortran-0.63.0/tests/reference/ast-subroutine7-27bdbfe.stdout0000664000175000017500000000206515174404631024453 0ustar alastairalastair(TranslationUnit [(Subroutine f [(a) (b)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent InOut )] [(b [] [] () () None ())] () )] [(Assignment 0 a (+ b 1) () ) (Assignment 0 b (+ a 1) () )] [] [] )] ) lfortran-0.63.0/tests/reference/run-array_bounds_check_12-4cdd01e.stderr0000664000175000017500000000045415174404631026223 0ustar alastairalastairruntime error: Array shape mismatch in subroutine 'f_integer____0'. Tried to match size 3 of dimension 1 of argument number 3, but expected size is 2 --> tests/errors/array_bounds_check_12.f90:8:5 | 8 | e = f(a) | ^ | 8 | e = f(a) | ~ Parameter is size 2, argument is size 3 lfortran-0.63.0/tests/reference/llvm-codegen_function_polymorphic-834d4d1.json0000664000175000017500000000101415174404631027506 0ustar alastairalastair{ "basename": "llvm-codegen_function_polymorphic-834d4d1", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/codegen_function_polymorphic.f90", "infile_hash": "e8a86676ac666387de5e3e9d38e5dffa7c2c79a5d045b662cb990fc8", "outfile": null, "outfile_hash": null, "stdout": "llvm-codegen_function_polymorphic-834d4d1.stdout", "stdout_hash": "1907be7508b7cc7c204edda52236f766d8b401cf53ef560c32aa4255", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-conv_complex2real-0c17eca.stdout0000664000175000017500000001145315174404631025516 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { conv_complex2real: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) conv_complex2real [] [(Assignment (Var 2 z) (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 4.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 x) (Cast (Cast (Var 2 z) ComplexToReal (Real 8) () () ) RealToReal (Real 4) () () ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealConstant 3.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/wat-types_15-abe4006.json0000664000175000017500000000072515174404631023120 0ustar alastairalastair{ "basename": "wat-types_15-abe4006", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/types_15.f90", "infile_hash": "f21a7fe2af97a1bb6a0750efddbb764348cdbf7a6c1c1b3354c96cf0", "outfile": null, "outfile_hash": null, "stdout": "wat-types_15-abe4006.stdout", "stdout_hash": "212f309195060625e637ed1db1c6b4bf9724038db7c3982c246d1a7e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_interface4-034a306.json0000664000175000017500000000102515174404631025210 0ustar alastairalastair{ "basename": "asr-implicit_interface4-034a306", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/implicit_interface4.f90", "infile_hash": "7cba05cff5b1be9768a73e4d33292b6af23b036642973fcef29a7069", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_interface4-034a306.stdout", "stdout_hash": "706ba15eff49e2778b18cc83873bb503ab08dffd5ecaa273be006938", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-goto_01-bab3e60.stdout0000664000175000017500000000013215174404631024013 0ustar alastairalastairprogram goto_01 implicit none integer :: a a = 5 go to 1 1 print *, a end program goto_01 lfortran-0.63.0/tests/reference/asr-entry_05-f368f0e.stdout0000664000175000017500000011312215174404631023473 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { dstzr: (Function (SymbolTable 3 { abstol: (Variable 3 abstol [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ftol: (Variable 3 ftol [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 3 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 3 r [] Local () () Default (Pointer (Array (Real 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), reltol: (Variable 3 reltol [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zx: (Variable 3 zx [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) dstzr (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [dzror_main__lcompilers] [] [(SubroutineCall 1 dzror_main__lcompilers 1 dzror_main__lcompilers [((IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 0 (Integer 4) Decimal)) ((ArrayPhysicalCast (Var 3 r) DescriptorArray PointerArray (Pointer (Array (Real 4) [(() ())] PointerArray ) ) () ))] () .false. )] () Public .true. .true. () ), dzror: (Function (SymbolTable 2 { abstol: (Variable 2 abstol [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ftol: (Variable 2 ftol [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 2 r [n] Unspecified () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), reltol: (Variable 2 reltol [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zx: (Variable 2 zx [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) dzror (FunctionType [(Integer 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [dzror_main__lcompilers] [(Var 2 n) (Var 2 r)] [(SubroutineCall 1 dzror_main__lcompilers 1 dzror_main__lcompilers [((IntegerConstant 1 (Integer 4) Decimal)) ((Var 2 n)) ((Var 2 r))] () .false. )] () Public .true. .true. () ), dzror_main__lcompilers: (Function (SymbolTable 4 { abstol: (Variable 4 abstol [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), entry__lcompilers: (Variable 4 entry__lcompilers [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ftol: (Function (SymbolTable 6 { ftol_return_var_name: (Variable 6 ftol_return_var_name [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zx: (Variable 6 zx [] In () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ftol (FunctionType [(Real 8)] (Real 8) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 6 zx)] [(Assignment (Var 6 ftol_return_var_name) (RealBinOp (RealConstant 0.500000 (Real 8) ) Mul (IntrinsicElementalFunction Max [(Var 4 abstol) (RealBinOp (Var 4 reltol) Mul (IntrinsicElementalFunction Abs [(Var 6 zx)] 0 (Real 8) () ) (Real 8) () )] 0 (Real 8) () ) (Real 8) () ) () .false. .false. )] (Var 6 ftol_return_var_name) Public .false. .true. () ), n: (Variable 4 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 4 r [n] Unspecified () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 4 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), reltol: (Variable 4 reltol [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zx: (Variable 4 zx [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) dzror_main__lcompilers (FunctionType [(Integer 4) (Integer 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 1 (Integer 4) () ))] PointerArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 entry__lcompilers) (Var 4 n) (Var 4 r)] [(If () (IntegerCompare (Var 4 entry__lcompilers) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 1 1 )] [] ) (If () (IntegerCompare (Var 4 entry__lcompilers) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 2 2 )] [] ) (GoToTarget 1 1 ) (Assignment (Var 4 r) (ArrayBroadcast (RealUnaryMinus (RealConstant 83.029999 (Real 4) ) (Real 4) (RealConstant -83.029999 (Real 4) ) ) (IntrinsicArrayFunction Shape [(Var 4 r)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 4 n))] PointerArray ) () ) () .false. .false. ) (Return) (GoToTarget 2 2 ) (Return)] () Public .true. .true. () ), entry_05: (Program (SymbolTable 5 { i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 5 r [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) entry_05 [] [(SubroutineCall 1 dzror () [((IntegerConstant 10 (Integer 4) Decimal)) ((ArrayPhysicalCast (Var 5 r) FixedSizeArray PointerArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] PointerArray ) () ))] () .false. ) (DoLoop () ((Var 5 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 5 r) [(() (Var 5 i) ())] (Real 4) ColMajor () ) Sub (RealUnaryMinus (RealConstant 83.029999 (Real 4) ) (Real 4) (RealConstant -83.029999 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] [] ) (Print (StringFormat () [(Var 5 r)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-complex_mul_test-5a74811.json0000664000175000017500000000077515174404631025067 0ustar alastairalastair{ "basename": "llvm-complex_mul_test-5a74811", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_mul_test.f90", "infile_hash": "908ba75c567d6ff4ba0e42cba3e974999d00e5d24710f4649ac212d6", "outfile": null, "outfile_hash": null, "stdout": "llvm-complex_mul_test-5a74811.stdout", "stdout_hash": "44d5dec9dc4da918de8df62ee311317c599c472c0c2978d0b672a464", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics10-ccd6322.stderr0000664000175000017500000000025015174404631024317 0ustar alastairalastairsemantic error: Kind of all the arguments of Ieor must be the same --> tests/errors/intrinsics10.f90:4:14 | 4 | print *, ieor(x, y) | ^^^^^^^^^^ lfortran-0.63.0/tests/reference/julia-doloop_03-6b5d1e0.json0000664000175000017500000000073615174404631023565 0ustar alastairalastair{ "basename": "julia-doloop_03-6b5d1e0", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/doloop_03.f90", "infile_hash": "eafcb3d9dca52d81012b124f360aa148c946ed2e7ed8de07041aba1d", "outfile": null, "outfile_hash": null, "stdout": "julia-doloop_03-6b5d1e0.stdout", "stdout_hash": "e5049a78686d8d34f28e845132e890ad2753d82aad418e8bb64f7314", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_call_02-00d0664.stderr0000664000175000017500000000030615174404631024736 0ustar alastairalastairsemantic error: Type mismatch in argument `x`: expected `integer(4)[:]` but got `integer(8)[:]` --> tests/errors/implicit_call_02.f90:9:19 | 9 | call test_sub(arr) | ^^^ lfortran-0.63.0/tests/reference/asr-implicit10-23a5156.stderr0000664000175000017500000000071715174404631023614 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/implicit10.f90:6:1 | 6 | real*8 :: g, h, i | ^^^^^^ help: write this as 'real(8)' style suggestion: Use complex(4) instead of complex*8 --> tests/implicit10.f90:8:1 | 8 | complex*8 :: l, m | ^^^^^^^^^ help: write this as 'complex(4)' style suggestion: Use complex(8) instead of complex*16 --> tests/implicit10.f90:9:1 | 9 | complex *16 :: n | ^^^^^^^^^^^ help: write this as 'complex(8)' lfortran-0.63.0/tests/reference/asr-derived_type_02-3e6510f.stderr0000664000175000017500000000037415174404631024707 0ustar alastairalastairsemantic error: Passed object dummy argument does not match function argument --> tests/errors/derived_type_02.f90:7:9 | 7 | procedure(testing_interface), deferred :: testing | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast_f90-block_02-bdd6766.stdout0000664000175000017500000000044515174404631024105 0ustar alastairalastairprogram Block_02 integer :: A A = 10 1 loop: block integer :: B A = A + 5 if (A == 15) then go to 1 end if B = A/2 call Square(B) end block loop end program Block_02 subroutine Square(B) integer :: B, Result Result = B*B print *, Result end subroutine Square lfortran-0.63.0/tests/reference/ast-nested_02-68e8526.stdout0000664000175000017500000000365215174404631023467 0ustar alastairalastair(TranslationUnit [(Module nested_02_a (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [(Subroutine b [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "b()" ())] () ) (SubroutineCall 0 c [] [] [] [] () )] [(Subroutine c [] [] () () [] [] [] [] [(Print 0 () [5] () )] [] [] )] [] )] ) (Program nested_02 () [(Use [] nested_02_a [(UseSymbol b () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(SubroutineCall 0 b [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/ast-program_without_line_02-250a492.stdout0000664000175000017500000000032715174404631026421 0ustar alastairalastair(TranslationUnit [(Program __xx_main () [] [] [] [(Print 0 () [(String "OK" ())] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-min_01-aa661b0.stdout0000664000175000017500000012167415174404631023103 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { min_min: (Program (SymbolTable 2 { int_inp1: (Variable 2 int_inp1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), int_inp2: (Variable 2 int_inp2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), output_amin0: (Variable 2 output_amin0 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), output_amin1: (Variable 2 output_amin1 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), output_dmin1: (Variable 2 output_dmin1 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), output_min: (Variable 2 output_min [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), output_min0: (Variable 2 output_min0 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), output_min1: (Variable 2 output_min1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), output_min_different_kinds: (Variable 2 output_min_different_kinds [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), real_inp1: (Variable 2 real_inp1 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), real_inp2: (Variable 2 real_inp2 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), real_inp3: (Variable 2 real_inp3 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), real_inp4: (Variable 2 real_inp4 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), real_inp5: (Variable 2 real_inp5 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), real_inp6: (Variable 2 real_inp6 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) min_min [] [(Assignment (Var 2 real_inp1) (RealConstant 5.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 real_inp2) (RealConstant 10.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 real_inp3) (RealConstant 5.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 real_inp4) (RealConstant 10.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 int_inp1) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 int_inp2) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 real_inp5) (RealConstant 5.200000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 real_inp6) (RealConstant 9.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 output_min) (IntrinsicElementalFunction Min [(Var 2 real_inp1) (Var 2 real_inp2)] 0 (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 output_min)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 output_min) Sub (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 5.000000 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) GtE (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (TypeInquiry Kind (Real 8) (Var 2 output_min) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop (StringConstant "Incorrect kind for min" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] ) (Assignment (Var 2 output_min0) (IntrinsicElementalFunction Min [(Var 2 int_inp1) (Var 2 int_inp2)] 0 (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 output_min0)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 output_min0) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (TypeInquiry Kind (Integer 4) (Var 2 output_min0) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop (StringConstant "Incorrect kind for min" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] ) (Assignment (Var 2 output_amin0) (Cast (IntrinsicElementalFunction Min [(Var 2 int_inp1) (Var 2 int_inp2)] 0 (Integer 4) () ) IntegerToReal (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 2 output_amin0)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 output_amin0) Sub (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (Real 4) () )] 0 (Real 4) () ) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (TypeInquiry Kind (Real 4) (Var 2 output_amin0) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop (StringConstant "Incorrect kind for min" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] ) (Assignment (Var 2 output_min1) (Cast (IntrinsicElementalFunction Min [(Var 2 real_inp3) (Var 2 real_inp4)] 0 (Real 4) () ) RealToInteger (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 2 output_min1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 output_min1) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (TypeInquiry Kind (Integer 4) (Var 2 output_min1) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop (StringConstant "Incorrect kind for min" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] ) (Assignment (Var 2 output_amin1) (IntrinsicElementalFunction Min [(Var 2 real_inp3) (Var 2 real_inp4)] 0 (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 output_amin1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 output_amin1) Sub (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (Real 4) () )] 0 (Real 4) () ) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (TypeInquiry Kind (Real 4) (Var 2 output_amin1) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop (StringConstant "Incorrect kind for min" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] ) (Assignment (Var 2 output_dmin1) (IntrinsicElementalFunction Min [(Var 2 real_inp1) (Var 2 real_inp1)] 0 (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 output_dmin1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 output_dmin1) Sub (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 5.000000 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) GtE (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (TypeInquiry Kind (Real 8) (Var 2 output_dmin1) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop (StringConstant "Incorrect kind for min" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] ) (Assignment (Var 2 output_min_different_kinds) (IntrinsicElementalFunction Min [(Var 2 real_inp5) (Cast (Var 2 real_inp6) RealToReal (Real 8) () () )] 0 (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 output_min_different_kinds)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 output_min_different_kinds) Sub (RealConstant 5.200000 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (TypeInquiry Kind (Real 8) (Var 2 output_min_different_kinds) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop (StringConstant "Incorrect kind for min" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/wat-doloop_03-e0c63db.json0000664000175000017500000000073015174404631023326 0ustar alastairalastair{ "basename": "wat-doloop_03-e0c63db", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/doloop_03.f90", "infile_hash": "eafcb3d9dca52d81012b124f360aa148c946ed2e7ed8de07041aba1d", "outfile": null, "outfile_hash": null, "stdout": "wat-doloop_03-e0c63db.stdout", "stdout_hash": "162a4ee496e349a909153844aebdce1115a94616b57e3229d1f0e894", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-statement_03-99c9cd3.json0000664000175000017500000000102515174404631023767 0ustar alastairalastair{ "basename": "asr-statement_03-99c9cd3", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/statement_03.f90", "infile_hash": "e697fc36c92b65627b5c34f4d10ea67c06141eba507c2700b01e24b8", "outfile": null, "outfile_hash": null, "stdout": "asr-statement_03-99c9cd3.stdout", "stdout_hash": "ca4c7e53f31afa9b095b4d7ab48eeb5d8ffcac677bfb44c76ae59de9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-kind_star_of_logical-8df9344.stderr0000664000175000017500000000023015174404631026062 0ustar alastairalastairsemantic error: Expected initialization expression for kind --> tests/errors/kind_star_of_logical.f90:3:13 | 3 | logical(*) a | ^ lfortran-0.63.0/tests/reference/ast_f90-parameter_01-c88a516.json0000664000175000017500000000077115174404631024340 0ustar alastairalastair{ "basename": "ast_f90-parameter_01-c88a516", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/parameter_01.f90", "infile_hash": "3488de8c55d194f309a915223114321d8596fba6f63399b39ac1ad68", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-parameter_01-c88a516.stdout", "stdout_hash": "e4d94bf2282323117c969d5a2af64550a874845922eb0dbb64ad48aa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-open_invalid_kwarg1-6af4cc2.stderr0000664000175000017500000000027515174404631026005 0ustar alastairalastairsemantic error: Invalid argument `hello` supplied --> tests/errors/open_invalid_kwarg1.f90:4:5 | 4 | OPEN(file="numbers", hello="world") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-subroutine5-d00e190.json0000664000175000017500000000072615174404631023651 0ustar alastairalastair{ "basename": "ast-subroutine5-d00e190", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine5.f90", "infile_hash": "88c62ffd8f005d7a511511e43da68f25e8fe795a75fec462baa25885", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine5-d00e190.stdout", "stdout_hash": "38c6bd29d447610e449fb3b1ff443b85a7bcda7848256da55a01262d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-bindc2-62a702e.json0000664000175000017500000000073415174404631022527 0ustar alastairalastair{ "basename": "asr-bindc2-62a702e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bindc2.f90", "infile_hash": "ac42ec8ae9572d40e2a2cff1d0f164d298724aaf2d6bc3644495919c", "outfile": null, "outfile_hash": null, "stdout": "asr-bindc2-62a702e.stdout", "stdout_hash": "50ea3b6cb01d6b11f151070e98aa8bade52824873e9ffce268e078f1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_02_transfer-1bcc806.stdout0000664000175000017500000000721015174404631025336 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array_02_transfer: (Program (SymbolTable 2 { m: (Variable 2 m [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) array_02_transfer [] [(Assignment (Var 2 m) (ArrayConstant 28 [1, 0, 0, ...., 5, 0, 0] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Print (StringFormat () [(BitCast (Var 2 m) (ArrayConstant 4 [1.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-data1-4f93542.json0000664000175000017500000000073215174404631022312 0ustar alastairalastair{ "basename": "ast-data1-4f93542", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/data1.f", "infile_hash": "1a4213099115ddfd47a4963a5aab51f70510f79ee1fa80eafa71d2ae", "outfile": null, "outfile_hash": null, "stdout": "ast-data1-4f93542.stdout", "stdout_hash": "5f8adfc0472681b6fd6fcad8969c7963f1a2e86b7a9974c9ae35c65b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_size_03-2036e61.json0000664000175000017500000000074315174404631023760 0ustar alastairalastair{ "basename": "asr-array_size_03-2036e61", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_size_03.f90", "infile_hash": "c8aac4225eeacbe1b0711e3af2f53ef4624804ff72cf20a07779f4bc", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_size_03-2036e61.stderr", "stderr_hash": "fc87c40d48513d8d37fa98067ac320488d5263a4a66ff6c16723f484", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-string_19-d880475.stdout0000664000175000017500000025714515174404631023525 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { stdlib_strings_use: (Program (SymbolTable 14 { char: (ExternalSymbol 14 char 2 char string_19_stdlib_string_type [] char Public ), char_string: (ExternalSymbol 14 char_string 2 char_string string_19_stdlib_string_type [] char_string Public ), compute_lps: (ExternalSymbol 14 compute_lps 6 compute_lps string_19_stdlib_strings [] compute_lps Public ), compute_lps_use: (ExternalSymbol 14 compute_lps_use 6 compute_lps_use string_19_stdlib_strings [] compute_lps_use Public ), compute_lps_use1: (ExternalSymbol 14 compute_lps_use1 6 compute_lps_use1 string_19_stdlib_strings [] compute_lps_use1 Public ), len: (ExternalSymbol 14 len 2 len string_19_stdlib_string_type [] len Public ), len_string: (ExternalSymbol 14 len_string 2 len_string string_19_stdlib_string_type [] len_string Public ), padl: (ExternalSymbol 14 padl 6 padl string_19_stdlib_strings [] padl Public ), padl_char_default: (ExternalSymbol 14 padl_char_default 6 padl_char_default string_19_stdlib_strings [] padl_char_default Public ), padl_char_pad_with: (ExternalSymbol 14 padl_char_pad_with 6 padl_char_pad_with string_19_stdlib_strings [] padl_char_pad_with Public ), padl_string_default: (ExternalSymbol 14 padl_string_default 6 padl_string_default string_19_stdlib_strings [] padl_string_default Public ), padl_string_pad_with: (ExternalSymbol 14 padl_string_pad_with 6 padl_string_pad_with string_19_stdlib_strings [] padl_string_pad_with Public ), string_type: (ExternalSymbol 14 string_type 2 string_type string_19_stdlib_string_type [] string_type Public ) }) stdlib_strings_use [string_19_stdlib_strings string_19_stdlib_string_type] [] ), string_19_stdlib_string_type: (Module (SymbolTable 2 { char: (GenericProcedure 2 char [2 char_string] Public ), char_string: (Function (SymbolTable 5 { character_string: (Variable 5 character_string [len_string string] ReturnVar () () Default (String 1 (FunctionCall 2 len_string 2 len [((Var 5 string))] (Integer 4) () () ) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 5 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) char_string (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (String 1 (FunctionCall 2 len_string 2 len [((FunctionParam 0 (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) () ))] (Integer 4) () () ) ExpressionLength DescriptorString) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [len_string] [(Var 5 string)] [] (Var 5 character_string) Public .true. .true. () ), len: (GenericProcedure 2 len [2 len_string] Public ), len_string: (Function (SymbolTable 4 { length: (Variable 4 length [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 4 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) len_string (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (Integer 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 4 string)] [] (Var 4 length) Public .true. .true. () ), string_type: (Struct (SymbolTable 3 { raw: (Variable 3 raw [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_type (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [raw] [] Source Public .false. .false. [] () () [] ) }) string_19_stdlib_string_type () [] .false. .false. .false. ), string_19_stdlib_strings: (Module (SymbolTable 6 { char: (ExternalSymbol 6 char 2 char string_19_stdlib_string_type [] char Public ), char_string: (ExternalSymbol 6 char_string 2 char_string string_19_stdlib_string_type [] char_string Public ), compute_lps: (Function (SymbolTable 7 { lps_array: (Variable 7 lps_array [string] ReturnVar () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 7 string) (Integer 4) () ))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 7 string [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) compute_lps (FunctionType [(String 1 () AssumedLength DescriptorString)] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (StringLen (FunctionParam 0 (String 1 () AssumedLength DescriptorString) () ) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 7 string)] [] (Var 7 lps_array) Public .true. .true. () ), compute_lps_use: (Function (SymbolTable 8 { l: (Variable 8 l [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 8 string [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) compute_lps_use (FunctionType [(String 1 () AssumedLength DescriptorString)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [compute_lps] [(Var 8 string)] [(Print (StringFormat () [(FunctionCall 6 compute_lps () [((Var 8 string))] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 8 string) (Integer 4) () ))] PointerArray ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] (Var 8 l) Public .false. .false. () ), compute_lps_use1: (Function (SymbolTable 9 { char@char_string: (ExternalSymbol 9 char@char_string 2 char_string string_19_stdlib_string_type [] char_string Private ), l: (Variable 9 l [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), len_string: (ExternalSymbol 9 len_string 2 len_string string_19_stdlib_string_type [] len_string Private ), string: (Variable 9 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 6 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) compute_lps_use1 (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 string)] [(Print (FunctionCall 9 char@char_string 6 char [((Var 9 string))] (String 1 (FunctionCall 9 len_string 6 len [((Var 9 string))] (Integer 4) () () ) ExpressionLength DescriptorString) () () ) )] (Var 9 l) Public .false. .false. () ), len: (ExternalSymbol 6 len 2 len string_19_stdlib_string_type [] len Public ), len_string: (ExternalSymbol 6 len_string 2 len_string string_19_stdlib_string_type [] len_string Public ), padl: (GenericProcedure 6 padl [6 padl_char_default 6 padl_char_pad_with] Public ), padl_char_default: (Function (SymbolTable 12 { output_length: (Variable 12 output_length [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 12 res [string] ReturnVar () () Default (String 1 (StringLen (Var 12 string) (Integer 4) () ) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 12 string [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) padl_char_default (FunctionType [(String 1 () AssumedLength DescriptorString) (Integer 4)] (String 1 (StringLen (FunctionParam 0 (String 1 () AssumedLength DescriptorString) () ) (Integer 4) () ) ExpressionLength DescriptorString) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [padl_char_pad_with] [(Var 12 string) (Var 12 output_length)] [(Assignment (Var 12 res) (FunctionCall 6 padl_char_pad_with 6 padl [((Var 12 string)) ((Var 12 output_length)) ((StringConstant " " (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (String 1 (IntrinsicElementalFunction Max [(StringLen (Var 12 string) (Integer 4) () ) (Var 12 output_length)] 0 (Integer 4) () ) ExpressionLength DescriptorString) () () ) () .false. .false. )] (Var 12 res) Public .true. .true. () ), padl_char_pad_with: (Function (SymbolTable 13 { output_length: (Variable 13 output_length [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pad_with: (Variable 13 pad_with [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 13 res [string output_length] ReturnVar () () Default (String 1 (IntrinsicElementalFunction Max [(StringLen (Var 13 string) (Integer 4) () ) (Var 13 output_length)] 0 (Integer 4) () ) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 13 string [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string_length: (Variable 13 string_length [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) padl_char_pad_with (FunctionType [(String 1 () AssumedLength DescriptorString) (Integer 4) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] (String 1 (IntrinsicElementalFunction Max [(StringLen (FunctionParam 0 (String 1 () AssumedLength DescriptorString) () ) (Integer 4) () ) (FunctionParam 1 (Integer 4) () )] 0 (Integer 4) () ) ExpressionLength DescriptorString) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 13 string) (Var 13 output_length) (Var 13 pad_with)] [] (Var 13 res) Public .true. .true. () ), padl_string_default: (Function (SymbolTable 10 { char@char_string: (ExternalSymbol 10 char@char_string 2 char_string string_19_stdlib_string_type [] char_string Private ), len_string: (ExternalSymbol 10 len_string 2 len_string string_19_stdlib_string_type [] len_string Private ), output_length: (Variable 10 output_length [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 10 res [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 6 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 10 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 6 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) padl_string_default (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (Integer 4)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [padl_char_pad_with] [(Var 10 string) (Var 10 output_length)] [(Assignment (Var 10 res) (StructConstructor 6 string_type [((FunctionCall 6 padl_char_pad_with 6 padl [((FunctionCall 10 char@char_string 6 char [((Var 10 string))] (String 1 (FunctionCall 10 len_string 6 len [((Var 10 string))] (Integer 4) () () ) ExpressionLength DescriptorString) () () )) ((Var 10 output_length)) ((StringConstant " " (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (String 1 (IntrinsicElementalFunction Max [(StringLen (FunctionCall 10 char@char_string 6 char [((Var 10 string))] (String 1 (FunctionCall 10 len_string 6 len [((Var 10 string))] (Integer 4) () () ) ExpressionLength DescriptorString) () () ) (Integer 4) () ) (Var 10 output_length)] 0 (Integer 4) () ) ExpressionLength DescriptorString) () () ))] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) () ) () .false. .false. )] (Var 10 res) Public .true. .true. () ), padl_string_pad_with: (Function (SymbolTable 11 { char@char_string: (ExternalSymbol 11 char@char_string 2 char_string string_19_stdlib_string_type [] char_string Private ), len_string: (ExternalSymbol 11 len_string 2 len_string string_19_stdlib_string_type [] len_string Private ), output_length: (Variable 11 output_length [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pad_with: (Variable 11 pad_with [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 11 res [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 6 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 11 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 6 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) padl_string_pad_with (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (Integer 4) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [padl_char_pad_with] [(Var 11 string) (Var 11 output_length) (Var 11 pad_with)] [(Assignment (Var 11 res) (StructConstructor 6 string_type [((FunctionCall 6 padl_char_pad_with 6 padl [((FunctionCall 11 char@char_string 6 char [((Var 11 string))] (String 1 (FunctionCall 11 len_string 6 len [((Var 11 string))] (Integer 4) () () ) ExpressionLength DescriptorString) () () )) ((Var 11 output_length)) ((Var 11 pad_with))] (String 1 (IntrinsicElementalFunction Max [(StringLen (FunctionCall 11 char@char_string 6 char [((Var 11 string))] (String 1 (FunctionCall 11 len_string 6 len [((Var 11 string))] (Integer 4) () () ) ExpressionLength DescriptorString) () () ) (Integer 4) () ) (Var 11 output_length)] 0 (Integer 4) () ) ExpressionLength DescriptorString) () () ))] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) () ) () .false. .false. )] (Var 11 res) Public .true. .true. () ), string_type: (ExternalSymbol 6 string_type 2 string_type string_19_stdlib_string_type [] string_type Public ) }) string_19_stdlib_strings () [string_19_stdlib_string_type string_19_stdlib_strings] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-modules_32-ca5fb91.json0000664000175000017500000000075015174404631023504 0ustar alastairalastair{ "basename": "asr-modules_32-ca5fb91", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_32.f90", "infile_hash": "221fc91ff53022d8a5c646c4a5ffa56eca2b1cbdf7a1f1474bbd3d18", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_32-ca5fb91.stdout", "stdout_hash": "b4baead6a73e6da08e5fbb27d78437da63e69e9c50578841101ff7ff", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-coarrays_01-2b1221b.json0000664000175000017500000000072615174404631023501 0ustar alastairalastair{ "basename": "ast-coarrays_01-2b1221b", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/coarrays_01.f90", "infile_hash": "933ef6b85aed33b834bb7b03ae1f635e2b6e4fd18eb8ec999593251f", "outfile": null, "outfile_hash": null, "stdout": "ast-coarrays_01-2b1221b.stdout", "stdout_hash": "b2b13730276747e55d35e91410f84c6cf5852e03a309ab14642bf85f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-subroutines_03-dde7b37.stdout0000664000175000017500000000160315174404631025307 0ustar alastairalastairfunction f(a::Int32, b::Base.RefValue{Int32}, c::Int32, d::Int32) b[] = a + 1 + c + d end function main() local i::Int32 local j::Int32 local k::Int32 local l::Int32 i = 1 j = 1 k = 1 l = 1 __j_ref__= Ref(j) f(i, __j_ref__, k, l) j = __j_ref__[] println(j) if j ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end __j_ref__= Ref(j) f(i, __j_ref__, k, l) j = __j_ref__[] println(j) if j ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end __j_ref__= Ref(j) f(i, __j_ref__, k, l) j = __j_ref__[] println(j) if j ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end __j_ref__= Ref(j) f(i, __j_ref__, k, l) j = __j_ref__[] println(j) if j ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-0.63.0/tests/reference/pass_class_constructor-multiple_objects_args-2d1007e.stdout0000664000175000017500000004036115174404631032326 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { 1_circle_radius: (ExternalSymbol 2 1_circle_radius 3 radius circle [] radius Public ), circle: (Struct (SymbolTable 3 { radius: (Variable 3 radius [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) circle (StructType [(Real 4)] [] .true. .false. ) [] [radius] [] Source Public .false. .false. [] () () [] ), print_radius: (Function (SymbolTable 4 { 1_circle_radius: (ExternalSymbol 4 1_circle_radius 3 radius circle [] radius Public ), m: (Variable 4 m [] In () () Default (StructType [(Real 4)] [] .true. .false. ) 2 circle Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 4 n [] In () () Default (StructType [(Real 4)] [] .true. .false. ) 2 circle Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) print_radius (FunctionType [(StructType [(Real 4)] [] .true. .false. ) (StructType [(Real 4)] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 m) (Var 4 n)] [(Print (StringFormat () [(StructInstanceMember (Var 4 m) 4 1_circle_radius (Real 4) () ) (StructInstanceMember (Var 4 n) 4 1_circle_radius (Real 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 was_called) (LogicalConstant .true. (Logical 4) ) () .false. .false. )] () Public .false. .false. () ), temp_struct_var__: (Variable 2 temp_struct_var__ [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 2 circle Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), temp_struct_var__1: (Variable 2 temp_struct_var__1 [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 2 circle Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), was_called: (Variable 2 was_called [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main [] [(Assignment (StructInstanceMember (Var 2 temp_struct_var__) 2 1_circle_radius (Real 4) () ) (RealConstant 1.500000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 2 temp_struct_var__1) 2 1_circle_radius (Real 4) () ) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (SubroutineCall 2 print_radius () [((Var 2 temp_struct_var__)) ((Var 2 temp_struct_var__1))] () .false. ) (If () (LogicalNot (Var 2 was_called) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-dimension_attr-12e0f2a.json0000664000175000017500000000075215174404631024461 0ustar alastairalastair{ "basename": "ast-dimension_attr-12e0f2a", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/dimension_attr.f", "infile_hash": "94df0a120cc268f419253b89bd601cc62c0c40b1ff86e8eb05849b4b", "outfile": null, "outfile_hash": null, "stdout": "ast-dimension_attr-12e0f2a.stdout", "stdout_hash": "50d574deca5876e963df776cd6c716b9a6a7283d8ab2d9528e4004ec", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-program_cmake_01-4e6752a.stdout0000664000175000017500000000033415174404631025053 0ustar alastairalastair(TranslationUnit [(Program TESTFortran () [] [] [] [(Print 0 () [(String "Hello" ())] () )] [] )] ) lfortran-0.63.0/tests/reference/llvm-bits_02-925bde2.json0000664000175000017500000000074215174404631023102 0ustar alastairalastair{ "basename": "llvm-bits_02-925bde2", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/bits_02.f90", "infile_hash": "326043189040d63a64dac0f62cb9504336196a58ad139ffe70eeb884", "outfile": null, "outfile_hash": null, "stdout": "llvm-bits_02-925bde2.stdout", "stdout_hash": "0493419a432257b0ee42df53b0d406a7960b36f2306a5e49db58e867", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_dead_code_removal-case_06-e7f007f.stdout0000664000175000017500000004534615174404631027134 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cond_03: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ap: (Variable 2 ap [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), bp: (Variable 2 bp [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), cp: (Variable 2 cp [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dp: (Variable 2 dp [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), grade_fixed: (Variable 2 grade_fixed [] Local (StringConstant "B" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "B" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), marks: (Variable 2 marks [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), marks_fixed: (Variable 2 marks_fixed [] Local (IntegerConstant 94 (Integer 4) Decimal) (IntegerConstant 94 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cond_03 [] [(If () (IntegerCompare (Var 2 a) Eq (Var 2 b) (Logical 4) () ) [(Print (StringConstant "a == b" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "ap == cp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (Print (StringFormat () [(StringConstant "Your grade is " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 grade_fixed)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 marks) (IntegerConstant 94 (Integer 4) Decimal) () .false. .false. ) (Select () (Var 2 marks) [(CaseStmt_Range (IntegerBinOp (IntegerConstant 40 (Integer 4) Decimal) Add (Var 2 bp) (Integer 4) (IntegerConstant 42 (Integer 4) Decimal) ) () [(Print (StringConstant "Pass!" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range () (IntegerBinOp (IntegerConstant 39 (Integer 4) Decimal) Sub (Var 2 ap) (Integer 4) (IntegerConstant 38 (Integer 4) Decimal) ) [(Print (StringConstant "Failed!" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(Print (StringConstant "Invalid marks" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your marks are " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 marks)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "Pass!" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(StringConstant "Your marks are " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 marks)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/pass_global_stmts-expr4-eea496b.json0000664000175000017500000000076415174404631025537 0ustar alastairalastair{ "basename": "pass_global_stmts-expr4-eea496b", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr4.f90", "infile_hash": "104847f7b62623d6e9d6d752ab2c6c58a31b70bc70a9cae0b5809241", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-expr4-eea496b.stdout", "stdout_hash": "1753bebefa4aa63992781780fde0baf4ce75635671444e123f072414", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-modules_01-da63075.stdout0000664000175000017500000000262015174404631023710 0ustar alastairalastair(TranslationUnit [(Module modules_01_a (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [(Subroutine b [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "b()" ())] () )] [] [] )] ) (Program modules_01 () [(Use [] modules_01_a [(UseSymbol b () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(SubroutineCall 0 b [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/asr-array_constructor_with_different_types-bffc811.stderr0000664000175000017500000000027715174404631032156 0ustar alastairalastairsemantic error: Element in `integer(4)` array constructor is `real(4)` --> tests/errors/array_constructor_with_different_types.f90:2:18 | 2 | print *, [1, 2.] | ^^ lfortran-0.63.0/tests/reference/ast-types_09-e7605c9.json0000664000175000017500000000074215174404631023057 0ustar alastairalastair{ "basename": "ast-types_09-e7605c9", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_09.f90", "infile_hash": "57d771f754443897c504c6507554917133b64bfc0c8c352317f63b2f", "outfile": null, "outfile_hash": null, "stdout": "ast-types_09-e7605c9.stdout", "stdout_hash": "a16eb108929c270be04a6362936aab1e8cca962e95fcea40035ba618", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_call_02-acc6d43.json0000664000175000017500000000100115174404631024621 0ustar alastairalastair{ "basename": "asr-implicit_call_02-acc6d43", "cmd": "lfortran --show-asr --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/errors/implicit_call_02.f90", "infile_hash": "24e50b64e17b6d3a7a46f02ffb24d18897a171a4e81a77686a72a5d4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit_call_02-acc6d43.stderr", "stderr_hash": "87fac225c2b103ecdb9cbd2fc4001bcdedd8065e39e4fbf48073b9c2", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-derived_type_03-a9e3c15.json0000664000175000017500000000075115174404631024436 0ustar alastairalastair{ "basename": "asr-derived_type_03-a9e3c15", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/derived_type_03.f90", "infile_hash": "f6dd480af400f08cea170112f8ab92301acab80856807fb65b5cf387", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-derived_type_03-a9e3c15.stderr", "stderr_hash": "909ba5fc73d1e33bd4e352e590aff0bb2c6fcc0deb2d33eff3fbe2f0", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-class_02-82c2f9c.stderr0000664000175000017500000000035015174404631023577 0ustar alastairalastairwarning: Change of value in conversion from 'real(8)' to 'real(4)' --> tests/../integration_tests/class_02.f90:5:16 | 5 | real :: pi = 3.1415926535897931d0 ! Class-wide private constant | ^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-implicit_interface_allocatable_array-38d4afe.stdout0000664000175000017500000003443215174404631031464 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { implicit_interface_allocatable_array: (Function (SymbolTable 2 { r_g: (Variable 2 r_g [] Local () () Default (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r_t: (Variable 2 r_t [] Local () () Default (Pointer (Array (Real 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sub1: (Function (SymbolTable 3 { sub1_arg_0: (Variable 3 sub1_arg_0 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sub1_arg_1: (Variable 3 sub1_arg_1 [] Unspecified () () Default (Array (Real 4) [(() ())] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub1 (FunctionType [(Integer 4) (Array (Real 4) [(() ())] PointerArray )] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 sub1_arg_0) (Var 3 sub1_arg_1)] [] () Public .false. .false. () ), sub2: (Function (SymbolTable 4 { sub2_arg_0: (Variable 4 sub2_arg_0 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sub2_arg_1: (Variable 4 sub2_arg_1 [] Unspecified () () Default (Array (Real 4) [(() ())] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub2 (FunctionType [(Integer 4) (Array (Real 4) [(() ())] PointerArray )] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 sub2_arg_0) (Var 4 sub2_arg_1)] [] () Public .false. .false. () ) }) implicit_interface_allocatable_array (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(SubroutineCall 2 sub1 () [((IntegerConstant 1 (Integer 4) Decimal)) ((ArrayPhysicalCast (Var 2 r_g) DescriptorArray PointerArray (Array (Real 4) [(() ())] PointerArray ) () ))] () .false. ) (SubroutineCall 2 sub2 () [((IntegerConstant 1 (Integer 4) Decimal)) ((ArrayPhysicalCast (Var 2 r_t) DescriptorArray PointerArray (Pointer (Array (Real 4) [(() ())] PointerArray ) ) () ))] () .false. )] () Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-global_scope7-70d8b93.json0000664000175000017500000000073415174404631024120 0ustar alastairalastair{ "basename": "asr-global_scope7-70d8b93", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope7.f90", "infile_hash": "b3d005db52f7a57b335928fc6d884d6fdee0654c64fc98c2e797e242", "outfile": null, "outfile_hash": null, "stdout": "asr-global_scope7-70d8b93.stdout", "stdout_hash": "7d9a335d5684af03928af5107584a5d685439fa0b5cdd7ddca5fc461", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_typing1-45de3a2.stderr0000664000175000017500000000017615174404631025266 0ustar alastairalastairsemantic error: Variable 'x' is not declared --> tests/errors/implicit_typing1.f90:3:1 | 3 | x = 1 | ^ 'x' is undeclared lfortran-0.63.0/tests/reference/ast_f90-common3-fab0cfa.json0000664000175000017500000000072515174404631023715 0ustar alastairalastair{ "basename": "ast_f90-common3-fab0cfa", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/common3.f90", "infile_hash": "113991d796f59c8f9cb2babe7720663be887616a5ce127bf58767997", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-common3-fab0cfa.stdout", "stdout_hash": "267b484b68f32da42b53258c88c7f3edffc8a133474555d8ba7245d8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-end_sub_name-b8abc97.stderr0000664000175000017500000000036515174404631024510 0ustar alastairalastairsyntax error: End subroutine name does not match subroutine name --> tests/errors/end_sub_name.f90:1:1 - 7:22 | 1 | subroutine swap(x, y) | ^^^^^^^^^^^^^^^^^^^^^... ... | 7 | end subroutine reverse | ...^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/llvm-global_scope4-10fa534.stdout0000664000175000017500000000127515174404631024637 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." @x = global i32 0 define i32 @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i32, align 4 store i32 6, i32* @x, align 4 %0 = load i32, i32* @x, align 4 %1 = add i32 %0, 1 store i32 %1, i32* @x, align 4 %2 = load i32, i32* @x, align 4 %3 = mul i32 3, %2 store i32 %3, i32* %__lfortran_evaluate_11, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return %4 = load i32, i32* %__lfortran_evaluate_11, align 4 ret i32 %4 } lfortran-0.63.0/tests/reference/ast-assign-262a444.stdout0000664000175000017500000000243015174404631023140 0ustar alastairalastair(TranslationUnit [(Program assign () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(y [] [] () () None ())] () )] [(Format 10 "'(i3)'" () ) (Assign 0 10 x () ) (Assign 20 10 x () ) (Assign 0 10 x () ) (Assign 30 10 y (TriviaNode [] [(EOLComment "! An integer variable is required in this context." )] ) )] [] )] ) lfortran-0.63.0/tests/reference/asr-char_arr_assignment-1f9a875.json0000664000175000017500000000075615174404631025421 0ustar alastairalastair{ "basename": "asr-char_arr_assignment-1f9a875", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/char_arr_assignment.f90", "infile_hash": "637e9e1637e9afbc3bcbf797c587b2b064dcf67eb215ce9f22fe5ade", "outfile": null, "outfile_hash": null, "stdout": "asr-char_arr_assignment-1f9a875.stdout", "stdout_hash": "cde2d075257460c235d5260b94e50fe87187495794b4fde4fa5cc662", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-interface_01-9dc98da.stdout0000664000175000017500000003635515174404631024366 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { interface_01: (Program (SymbolTable 5 { a: (ExternalSymbol 5 a 2 a interface_01_mod [] a Public ), a1@a: (ExternalSymbol 5 a1@a 2 a1 interface_01_mod [] a1 Public ), a2@a: (ExternalSymbol 5 a2@a 2 a2 interface_01_mod [] a2 Public ), a@a1: (ExternalSymbol 5 a@a1 2 a1 interface_01_mod [] a1 Private ), a@a2: (ExternalSymbol 5 a@a2 2 a2 interface_01_mod [] a2 Private ), i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 5 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) interface_01 [interface_01_mod] [(Assignment (Var 5 i) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 5 a@a1 5 a [((Var 5 i))] () .false. ) (If () (IntegerCompare (Var 5 i) NotEq (IntegerConstant 6 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 5 r) (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 6.000000 (Real 4) ) () ) () .false. .false. ) (SubroutineCall 5 a@a2 5 a [((Var 5 r))] () .false. ) (If () (RealCompare (Var 5 r) NotEq (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 5 i) (IntegerConstant 7 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 5 a@a1 5 a [((Var 5 i))] () .false. ) (If () (IntegerCompare (Var 5 i) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), interface_01_mod: (Module (SymbolTable 2 { a: (GenericProcedure 2 a [2 a1 2 a2] Public ), a1: (Function (SymbolTable 3 { a: (Variable 3 a [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a1 (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Assignment (Var 3 a) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ), a2: (Function (SymbolTable 4 { a: (Variable 4 a [] InOut () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a2 (FunctionType [(Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a)] [(Assignment (Var 4 a) (RealBinOp (Var 4 a) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) (Real 4) () ) () .false. .false. )] () Public .true. .true. () ) }) interface_01_mod () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-subroutine4-97a10ca.stdout0000664000175000017500000000032115174404631024751 0ustar alastairalastairsubroutine triad(a, b, scalar, c) real, intent(in) :: a(:), b(:), scalar real, intent(out) :: c(:) integer :: N, i N = size(a) do concurrent (i = 1:N) c(i) = a(i) + scalar*b(i) end do end subroutine triad lfortran-0.63.0/tests/reference/ast_f90-modules_04-d194daa.stdout0000664000175000017500000000036615174404631024534 0ustar alastairalastairmodule access_vars implicit none private public :: print_vars real :: priv = 1.5 real, public :: publ = 2.5 contains subroutine print_vars() print *, "priv = ", priv print *, "publ = ", publ end subroutine print_vars end module access_vars lfortran-0.63.0/tests/reference/asr-template_02-021cc51.json0000664000175000017500000000075315174404631023473 0ustar alastairalastair{ "basename": "asr-template_02-021cc51", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_02.f90", "infile_hash": "ced72b8e182313557b3b879bd14e860cc0d24eb74800baecbe858a70", "outfile": null, "outfile_hash": null, "stdout": "asr-template_02-021cc51.stdout", "stdout_hash": "d82079d6a3b36a131e7d4d087d0ebf830cba58e0130a97817a78aa8b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-bindc1-345b88c.json0000664000175000017500000000073715174404631022730 0ustar alastairalastair{ "basename": "llvm-bindc1-345b88c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/bindc1.f90", "infile_hash": "b894bae3cff84c3540cc34d38c5e3e6c46197db6d93d5f0b48013a06", "outfile": null, "outfile_hash": null, "stdout": "llvm-bindc1-345b88c.stdout", "stdout_hash": "448437a91e56972bb6c3bf99afdc98f8f6696775ee01062d423583b8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-expr1-32e30b1.json0000664000175000017500000000070415174404631022415 0ustar alastairalastair{ "basename": "ast-expr1-32e30b1", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/expr1.f90", "infile_hash": "3c49cb3157ec3feaf0f97156e5c11dca0ffd6481c97bb1a5dffaa14f", "outfile": null, "outfile_hash": null, "stdout": "ast-expr1-32e30b1.stdout", "stdout_hash": "f557132e49ac8751a23035bac82421ab5ad2213a75f4cdfafd10b1dc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-allow_implicit_interface2-f4d4abc.json0000664000175000017500000000104715174404631026717 0ustar alastairalastair{ "basename": "asr-allow_implicit_interface2-f4d4abc", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/allow_implicit_interface2.f90", "infile_hash": "1f457aff9cece7a1bae818adeed2dfdb5998c30ee4ff92f4cb11c692", "outfile": null, "outfile_hash": null, "stdout": "asr-allow_implicit_interface2-f4d4abc.stdout", "stdout_hash": "260df52189152f477102c9c580e443e88e6d513a0d3d34330f262d41", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-logical2-3eb78d2.json0000664000175000017500000000072515174404631023160 0ustar alastairalastair{ "basename": "wat-logical2-3eb78d2", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/logical2.f90", "infile_hash": "5b01ca4533da32f0fa6292eeb511d007181a316ce112af8ff858c9c0", "outfile": null, "outfile_hash": null, "stdout": "wat-logical2-3eb78d2.stdout", "stdout_hash": "9f6a7ec0c7ce13ff0c127f744b65c94c58a44a42a8941216b85c0b56", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-while_02_fixed_form-524b922.json0000664000175000017500000000100415174404631025115 0ustar alastairalastair{ "basename": "ast-while_02_fixed_form-524b922", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/while_02_fixed_form.f", "infile_hash": "dc82d303d9e0ec0bcec914bfa5a12ca5ed78d48eb85510d241f414b0", "outfile": null, "outfile_hash": null, "stdout": "ast-while_02_fixed_form-524b922.stdout", "stdout_hash": "d84932a8b5c7900c459aee1b654d3de889a030953760314e13476df2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-arrays_02_size-395cc3f.json0000664000175000017500000000075515174404631024635 0ustar alastairalastair{ "basename": "julia-arrays_02_size-395cc3f", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/arrays_02_size.f90", "infile_hash": "38abe88ea3a7e82aa0d9dd390578cda301e16cccabaefeaab3650c5f", "outfile": null, "outfile_hash": null, "stdout": "julia-arrays_02_size-395cc3f.stdout", "stdout_hash": "1f0182af0a9d25042159e7bcd0d3ab266d9dd2fc11e5422a96353c91", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-global_scope3-57006df.stdout0000664000175000017500000000202615174404631024454 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] ) lfortran-0.63.0/tests/reference/llvm-doloop_01-a6563cb.json0000664000175000017500000000075015174404631023430 0ustar alastairalastair{ "basename": "llvm-doloop_01-a6563cb", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_01.f90", "infile_hash": "14818f8f39c32bf890cf7906fe8a9692b270ad81a49bcdf0486f8e84", "outfile": null, "outfile_hash": null, "stdout": "llvm-doloop_01-a6563cb.stdout", "stdout_hash": "194d4a29b465876298b30033a439532c54f895842c3fde439fcbb01e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-expr_05-a129dce.json0000664000175000017500000000075215174404631023472 0ustar alastairalastair{ "basename": "ast_f90-expr_05-a129dce", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/expr_05.f90", "infile_hash": "ab6fcfdb7d7b127b347b822368c1a3d22c7241a82453de78dd535c05", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-expr_05-a129dce.stdout", "stdout_hash": "2957ca40f869a624fe3f7198d976ffcc7a41397dd18c512dd9288ac9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-wasm_unary_minus-81a29ff.stdout0000664000175000017500000001522315174404631025436 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param i32) (result i32))) (type (;3;) (func (param i64) (result i64))) (type (;4;) (func (param) (result i64))) (type (;5;) (func (param) (result))) (type (;6;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param i32) (result i32) (local i32) i32.const 0 local.get 0 i32.sub local.set 1 local.get 1 return ) (func $3 (type 3) (param i64) (result i64) (local i64) i64.const 0 local.get 0 i64.sub local.set 1 local.get 1 return ) (func $4 (type 4) (param) (result i64) (local i64) i64.const 1000000000000 local.set 0 local.get 0 return ) (func $5 (type 5) (param) (result) (local) i32.const 13 call 2 i64.extend_i32_s call 6 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop i64.const 130000000000000000 call 3 call 6 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const -13 call 2 i64.extend_i32_s call 6 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop i64.const -130000000000000000 call 3 call 6 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop call 4 call 6 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $6 (type 6) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "get_num_neg_i32" (func 2)) (export "get_num_neg_i64" (func 3)) (export "test_unary_minus" (func 4)) (export "_start" (func 5)) (export "print_i64" (func 6)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-0.63.0/tests/reference/julia-arrays_02_size-395cc3f.stdout0000664000175000017500000000121715174404631025200 0ustar alastairalastairfunction main() local a::Array{Int32, 1} local b::Array{Int32, 1} local i::Int32 local size_a4::Int32 local size_a8::Int64 local size_b4::Int32 local size_b8::Int64 size_a4 = length(a) size_b4 = size(b)[1] size_a8 = length(a) size_b8 = size(b)[1] if size_a4 ≠ 3 println(Base.stderr, "ERROR STOP") exit(1) end if size_b4 ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end if size_a8 ≠ 3 println(Base.stderr, "ERROR STOP") exit(1) end if size_b8 ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-0.63.0/tests/reference/asr-where_02-95cf592.json0000664000175000017500000000074215174404631023020 0ustar alastairalastair{ "basename": "asr-where_02-95cf592", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/where_02.f90", "infile_hash": "d77bcdf887423550fb6073875746e6b4af104d344e645f7f3753eb1d", "outfile": null, "outfile_hash": null, "stdout": "asr-where_02-95cf592.stdout", "stdout_hash": "3592eea53dbec9621f9f31230c6b0a4239a0b6f7b1586f4d5d6bd6ee", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-intrinsics_03-0771f1b.stdout0000664000175000017500000002216215174404631024613 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @intrinsics_03.i = internal global i32 -12 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define double @_lcompilers_cos_f64(double* %x) { .entry: %_lcompilers_cos_f64 = alloca double, align 8 %0 = load double, double* %x, align 8 %1 = call double @_lfortran_dcos(double %0) store double %1, double* %_lcompilers_cos_f64, align 8 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE__lcompilers_cos_f64 FINALIZE_SYMTABLE__lcompilers_cos_f64: ; preds = %return %2 = load double, double* %_lcompilers_cos_f64, align 8 ret double %2 } declare double @_lfortran_dcos(double) define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() %call_arg_value4 = alloca double, align 8 %call_arg_value = alloca double, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca double, align 8 %r1 = alloca double, align 8 %r2 = alloca double, align 8 %x = alloca float, align 4 store double 4.200000e+00, double* %a, align 8 store float 0xBFEFE8D5A0000000, float* %x, align 4 %3 = load float, float* %x, align 4 %4 = fadd float %3, 0x3FEFE8D5A0000000 %5 = call float @llvm.fabs.f32(float %4) %6 = fcmp ogt float %5, 0x3E7AD7F2A0000000 br i1 %6, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %7 = call double @_lcompilers_cos_f64(double* %a) %8 = fadd double %7, 0x3FDF606EE0000000 %9 = call double @llvm.fabs.f64(double %8) %10 = fcmp ogt double %9, 0x3E7AD7F2A0000000 br i1 %10, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %11 = load double, double* %a, align 8 %12 = call double @_lcompilers_cos_f64(double* %a) %13 = fadd double %11, %12 store double %13, double* %call_arg_value, align 8 %14 = call double @_lcompilers_cos_f64(double* %call_arg_value) %15 = fadd double 0x3FB21BD54FC5F9A7, %14 store double %15, double* %call_arg_value4, align 8 %16 = call double @_lcompilers_cos_f64(double* %call_arg_value4) %17 = fsub double %16, 0x3FE6ECC720000000 %18 = call double @llvm.fabs.f64(double %17) %19 = fcmp ogt double %18, 0x3E7AD7F2A0000000 br i1 %19, label %then5, label %else6 then5: ; preds = %ifcont3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont7 else6: ; preds = %ifcont3 br label %ifcont7 ifcont7: ; preds = %else6, %then5 %20 = call double @_lcompilers_cos_f64(double* %a) store double %20, double* %r1, align 8 store double 0xBFDF606EEC8AC71E, double* %r2, align 8 %21 = load double, double* %r1, align 8 %22 = load double, double* %r2, align 8 %23 = fsub double %21, %22 %24 = call double @llvm.fabs.f64(double %23) %25 = fcmp ogt double %24, 1.000000e-15 br i1 %25, label %then8, label %else9 then8: ; preds = %ifcont7 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont10 else9: ; preds = %ifcont7 br label %ifcont10 ifcont10: ; preds = %else9, %then8 %26 = alloca i64, align 8 %27 = load i32, i32* @intrinsics_03.i, align 4 %28 = sub i32 0, %27 %29 = icmp sge i32 %27, 0 %30 = select i1 %29, i32 %27, i32 %28 %31 = alloca i32, align 4 store i32 %30, i32* %31, align 4 %32 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %26, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %31) %33 = load i64, i64* %26, align 8 %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %32, i8** %34, align 8 %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %33, i64* %35, align 8 %36 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %37 = load i8*, i8** %36, align 8 %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %39 = load i64, i64* %38, align 8 %40 = trunc i64 %39 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %37, i32 %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %41 = icmp eq i8* %32, null br i1 %41, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont10 call void @_lfortran_free_alloc(i8* %2, i8* %32) br label %free_done free_done: ; preds = %free_nonnull, %ifcont10 %42 = load i32, i32* @intrinsics_03.i, align 4 %43 = sub i32 0, %42 %44 = icmp sge i32 %42, 0 %45 = select i1 %44, i32 %42, i32 %43 %46 = icmp ne i32 %45, 12 br i1 %46, label %then11, label %else12 then11: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont13 else12: ; preds = %free_done br label %ifcont13 ifcont13: ; preds = %else12, %then11 br label %return return: ; preds = %ifcont13 br label %FINALIZE_SYMTABLE_intrinsics_03 FINALIZE_SYMTABLE_intrinsics_03: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) ; Function Attrs: nounwind readnone speculatable willreturn declare float @llvm.fabs.f32(float) #0 declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) ; Function Attrs: nounwind readnone speculatable willreturn declare double @llvm.fabs.f64(double) #0 declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) attributes #0 = { nounwind readnone speculatable willreturn } lfortran-0.63.0/tests/reference/asr-iostat_non_scalar_value-7d45a6f.stderr0000664000175000017500000000026115174404631026703 0ustar alastairalastairsemantic error: `iostat` must be scalar --> tests/errors/iostat_non_scalar_value.f90:7:5 | 7 | read(buffer, *, iostat=ios(1:1)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-array_03_transfer-4fcb3e2.stdout0000664000175000017500000000414215174404631025422 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array_03_transfer: (Program (SymbolTable 2 { x: (Variable 2 x [] Local (IntegerConstant 21432 (Integer 4) Decimal) (IntegerConstant 21432 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) array_03_transfer [] [(Print (StringFormat () [(BitCast (Var 2 x) (RealConstant 1.000000 (Real 4) ) () (Real 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-subroutine6-265d498.stderr0000664000175000017500000000033015174404631024134 0ustar alastairalastairsemantic error: Dummy argument 'array' not defined --> tests/errors/subroutine6.f90:1:1 - 3:14 | 1 | subroutine sub (array) | ^^^^^^^^^^^^^^^^^^^^^^... ... | 3 | end subroutine | ...^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-intrinsics_26-f10d0e6.stdout0000664000175000017500000003033215174404631024507 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_26: (Program (SymbolTable 4 { all_set: (ExternalSymbol 4 all_set 2 all_set stdlib_bitsets_64 [] all_set Public ), i: (Variable 4 i [] Local (IntegerConstant 31 (Integer 4) Decimal) (IntegerConstant 31 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_26 [stdlib_bitsets_64] [(Print (StringFormat () [(FunctionCall 4 all_set () [((Var 4 i)) ((IntegerConstant 5 (Integer 4) Decimal))] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), stdlib_bitsets_64: (Module (SymbolTable 2 { all_set: (Function (SymbolTable 3 { num_bits: (Variable 3 num_bits [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pos: (Variable 3 pos [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 3 res [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) all_set (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 num_bits)] [(Assignment (Var 3 res) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (DoLoop () ((Var 3 pos) (IntegerConstant 0 (Integer 4) Decimal) (IntegerBinOp (Var 3 num_bits) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(If () (LogicalNot (IntrinsicElementalFunction Btest [(Var 3 x) (Var 3 pos)] 0 (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 3 res) (LogicalConstant .false. (Logical 4) ) () .false. .false. )] [] )] [] )] (Var 3 res) Public .true. .true. () ) }) stdlib_bitsets_64 () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-subroutine5-24e8434.stderr0000664000175000017500000000020515174404631024124 0ustar alastairalastairsemantic error: Variable 'd' is not declared --> tests/errors/subroutine5.f90:4:9 | 4 | c = a + d | ^ 'd' is undeclared lfortran-0.63.0/tests/reference/wat-wasm1-8a138d6.json0000664000175000017500000000066715174404631022441 0ustar alastairalastair{ "basename": "wat-wasm1-8a138d6", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/wasm1.f90", "infile_hash": "23d205c649ffca4c7d77e3b0e23240fbf79e99247a00dfa0d96efc81", "outfile": null, "outfile_hash": null, "stdout": "wat-wasm1-8a138d6.stdout", "stdout_hash": "fc133e774eade4347cc44a2fa4caff9fdbbe21c41a053790183574c4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-loop_test-5d89970.stderr0000664000175000017500000000021215174404631023662 0ustar alastairalastairsemantic error: Assignment to loop variable `i` is not allowed --> tests/errors/loop_test.f90:4:8 | 4 | i = i + 1 | ^ lfortran-0.63.0/tests/reference/ast_f90-derived_types_01-2ba20d5.stdout0000664000175000017500000000145015174404631025632 0ustar alastairalastairmodule derived_types_01_m_01 implicit none type :: X real :: r integer :: i end type X type :: Y complex :: c type(X) :: d end type Y contains subroutine set(a) type(X), intent(out) :: a a%i = 1 a%r = 1.5 end subroutine set end module derived_types_01_m_01 module derived_types_01_m_02 use derived_types_01_m_01, only: Y implicit none type :: Z complex :: k type(Y) :: l end type Z end module derived_types_01_m_02 program derived_types_01 use derived_types_01_m_02, only: Z use derived_types_01_m_01, only: X, set implicit none type(X) :: b type(Z) :: c b%i = 5 b%r = 3.5 print *, b%i, b%r call set(b) print *, b%i, b%r c%l%d%r = 2.0 c%l%d%i = 2 c%k = (2.0, 2.0) print *, c%l%d%r, c%l%d%i, c%k call set(c%l%d) print *, c%l%d%r, c%l%d%i, c%k end program derived_types_01 lfortran-0.63.0/tests/reference/asr-intent1-4e0feb8.json0000664000175000017500000000072115174404631023113 0ustar alastairalastair{ "basename": "asr-intent1-4e0feb8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intent1.f90", "infile_hash": "d12d1e1612c16f772abbbbdc87df9a7c395c4065223d4a66508ac667", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intent1-4e0feb8.stderr", "stderr_hash": "4350f78ca55c871c699300a9e29e5191b4b7f4e8f9c1015704c2d88d", "returncode": 2 }lfortran-0.63.0/tests/reference/run-format_26-f627ed6.json0000664000175000017500000000071515174404631023300 0ustar alastairalastair{ "basename": "run-format_26-f627ed6", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_26.f90", "infile_hash": "f23f69602a3b407cc16f2cb4f36c6689ff6b1b9576f58eed6497ad1a", "outfile": null, "outfile_hash": null, "stdout": "run-format_26-f627ed6.stdout", "stdout_hash": "5b8b4b7e16f70f3be2f5ae9c568f973a2cd4d80527db4ad8b10bbe36", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-subroutine7-58db221.stdout0000664000175000017500000000736715174404631024237 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { a: (Variable 2 a [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 a) (Var 2 b)] [(Assignment (Var 2 a) (IntegerBinOp (Var 2 b) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 b) (IntegerBinOp (Var 2 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/run-exit1-29ee7ce.stdout0000664000175000017500000000001215174404631023152 0ustar alastairalastair1 2 3 4 5 lfortran-0.63.0/tests/reference/asr_disable_warnings-save4-99c3220.stderr0000664000175000017500000000046315174404631026261 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/save4.f90:4:11 | 4 | if (y .eq. 1) then | ^^^^ help: write this as '==' style suggestion: Use '==' instead of '.eq.' --> tests/save4.f90:10:15 | 10 | if (x .eq. 1) then | ^^^^ help: write this as '==' lfortran-0.63.0/tests/reference/llvm-types_02-b5bfe0b.stdout0000664000175000017500000000142615174404631024007 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %r = alloca float, align 4 store i32 1, i32* %i, align 4 store float 1.000000e+00, float* %r, align 4 %2 = load i32, i32* %i, align 4 %3 = sitofp i32 %2 to float store float %3, float* %r, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_types_02 FINALIZE_SYMTABLE_types_02: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-global_scope7-70d8b93.stdout0000664000175000017500000000213715174404631024470 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local (IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) [(IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] ) lfortran-0.63.0/tests/reference/ast-entry1-5b02d99.json0000664000175000017500000000070715174404631022622 0ustar alastairalastair{ "basename": "ast-entry1-5b02d99", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/entry1.f90", "infile_hash": "ca0b3d63526c84c42bb3f45badc8a6393867586040e33d02c7a8561c", "outfile": null, "outfile_hash": null, "stdout": "ast-entry1-5b02d99.stdout", "stdout_hash": "4c6a6e641b9d3ef172165d5ac73a9e8738a7ade595603197659a17e6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-function_call1-0b992da.stdout0000664000175000017500000005213115174404631024722 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { module_function_call1: (Module (SymbolTable 2 { eval_1d: (Function (SymbolTable 4 { res: (Variable 4 res [x] ReturnVar () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 4 x) () (Integer 4) () ))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 4 self [] In () () Default (StructType [] [] .false. .false. ) 2 softmax Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) eval_1d (FunctionType [(StructType [] [] .false. .false. ) (Array (Real 4) [(() ())] DescriptorArray )] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 1 (Array (Real 4) [(() ())] DescriptorArray ) () ) () (Integer 4) () ))] PointerArray ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 self) (Var 4 x)] [] (Var 4 res) Public .true. .true. () ), eval_1d_prime: (Function (SymbolTable 5 { 1_softmax_eval_1d: (ExternalSymbol 5 1_softmax_eval_1d 3 eval_1d softmax [] eval_1d Public ), res: (Variable 5 res [x] ReturnVar () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 5 x) () (Integer 4) () ))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 5 self [] In () () Default (StructType [] [] .false. .false. ) 2 softmax Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 5 x [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) eval_1d_prime (FunctionType [(StructType [] [] .false. .false. ) (Array (Real 4) [(() ())] DescriptorArray )] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 1 (Array (Real 4) [(() ())] DescriptorArray ) () ) () (Integer 4) () ))] PointerArray ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 5 self) (Var 5 x)] [(Assignment (Var 5 res) (FunctionCall 5 1_softmax_eval_1d () [((Var 5 self)) ((ArrayPhysicalCast (Var 5 x) DescriptorArray DescriptorArray (Array (Real 4) [(() ())] DescriptorArray ) () ))] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 5 x) () (Integer 4) () ))] PointerArray ) () (Var 5 self) ) () .false. .false. )] (Var 5 res) Public .true. .true. () ), softmax: (Struct (SymbolTable 3 { eval_1d: (StructMethodDeclaration 3 eval_1d () eval_1d 2 eval_1d Source .false. .false. ) }) softmax (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () () [] ) }) module_function_call1 () [module_function_call1] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-subroutines_05-1398db3.json0000664000175000017500000000076415174404631024266 0ustar alastairalastair{ "basename": "asr-subroutines_05-1398db3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_05.f90", "infile_hash": "ebc35a303d7f8c4ccb4f617a439a6e897e997f69d8f7654730af4676", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutines_05-1398db3.stdout", "stdout_hash": "a69a159ceaec8b666479be5d36e1abe9a673a8482a686895b7059fb8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-nested_external_dedup_01-90fba38.stdout0000664000175000017500000002241715174404631026674 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nested_external_dedup_01: (Program (SymbolTable 2 { outer: (Function (SymbolTable 3 { a: (Variable 3 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), inner1: (Function (SymbolTable 4 { }) inner1 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 a) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ), inner2: (Function (SymbolTable 5 { }) inner2 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 a) (IntegerBinOp (Var 3 a) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ) }) outer (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 a) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 3 inner1 () [] () .false. ) (SubroutineCall 3 inner2 () [] () .false. )] () Public .true. .true. () ) }) nested_external_dedup_01 [] [(SubroutineCall 2 outer () [] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/pass_loop_unroll-loop_unroll_small-462d647.json0000664000175000017500000000105215174404631027653 0ustar alastairalastair{ "basename": "pass_loop_unroll-loop_unroll_small-462d647", "cmd": "lfortran --pass=loop_unroll --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/loop_unroll_small.f90", "infile_hash": "5a308fd86dceda8d2b6a3c4fcb2412bf4d1b3f043105d06956960db8", "outfile": null, "outfile_hash": null, "stdout": "pass_loop_unroll-loop_unroll_small-462d647.stdout", "stdout_hash": "aa02154973be3584255ac2523db9c64633d2360f7eab3da25d8715b0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-assign_01-40d16c6.json0000664000175000017500000000072715174404631023155 0ustar alastairalastair{ "basename": "asr-assign_01-40d16c6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/assign_01.f90", "infile_hash": "b3907bfc11ab4a5400099590f3d20715a7fed312e26241facae934fb", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-assign_01-40d16c6.stderr", "stderr_hash": "22926a0ca854e3a26213cee88788e52c189e7e6d275089ff0cdc971c", "returncode": 2 }lfortran-0.63.0/tests/reference/run-format_21-af89e92.stdout0000664000175000017500000000011215174404631023637 0ustar alastairalastair42 42 is the answer 42 43 The touch is 42 degrees The touch is 42 lfortran-0.63.0/tests/reference/llvm-const_real_dp-e0fca56.stdout0000664000175000017500000000555115174404631025105 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [12 x i8] c"R4,R8,R4,R8\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %u = alloca double, align 8 %v = alloca double, align 8 %x = alloca float, align 4 %zero = alloca float, align 4 store float 0.000000e+00, float* %zero, align 4 store double 0x3FF0CCCCC0000000, double* %u, align 8 store double 1.050000e+00, double* %v, align 8 store float 0x3FF0CCCCC0000000, float* %x, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, float* %zero, double* %v, float* %x, double* %u) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_const_real_dp FINALIZE_SYMTABLE_const_real_dp: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/llvm-sin_03-14abee4.stdout0000664000175000017500000000507615174404631023362 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R8\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca double, align 8 store double 0x3FEFEB7A9B2C6D8B, double* %x, align 8 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, double* %x) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_sin_03 FINALIZE_SYMTABLE_sin_03: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-complex_pow_test-c556b63.json0000664000175000017500000000077215174404631024772 0ustar alastairalastair{ "basename": "asr-complex_pow_test-c556b63", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_pow_test.f90", "infile_hash": "cc3e566ed81771c2b1c24916ac5bcd29fde8fef80826cc84d56d72fa", "outfile": null, "outfile_hash": null, "stdout": "asr-complex_pow_test-c556b63.stdout", "stdout_hash": "f5e81a5f916a201628254aa005ceed9438fc7c2c35f4a096348fdcdd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-case_06-f84222d.stdout0000664000175000017500000006772415174404631023200 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cond_03: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ap: (Variable 2 ap [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), bp: (Variable 2 bp [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), cp: (Variable 2 cp [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dp: (Variable 2 dp [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), grade_fixed: (Variable 2 grade_fixed [] Local (StringConstant "B" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "B" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), marks: (Variable 2 marks [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), marks_fixed: (Variable 2 marks_fixed [] Local (IntegerConstant 94 (Integer 4) Decimal) (IntegerConstant 94 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cond_03 [] [(Select () (Var 2 grade_fixed) [(CaseStmt [(StringConstant "A" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [(Print (StringConstant "Excellent!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(StringConstant "B" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [(If () (IntegerCompare (Var 2 a) Eq (Var 2 b) (Logical 4) () ) [(Print (StringConstant "a == b" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (IntegerCompare (Var 2 ap) Eq (Var 2 bp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "ap == bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(If () (RealCompare (Cast (Var 2 ap) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) Eq (Var 2 cp) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(Print (StringConstant "ap == cp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (RealCompare (Var 2 cp) Eq (Var 2 dp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "cp == dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(If () (RealCompare (Var 2 c) Eq (Var 2 d) (Logical 4) () ) [(Print (StringConstant "c == d" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] )] )] .false. ) (CaseStmt [(StringConstant "C" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [(Print (StringConstant "Well done" (String 1 (IntegerConstant 9 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(StringConstant "D" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [(Print (StringConstant "You passed" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(StringConstant "F" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [(Print (StringConstant "Better try again" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. )] [(Print (StringConstant "Invalid grade" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your grade is " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 grade_fixed)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 marks) (IntegerConstant 94 (Integer 4) Decimal) () .false. .false. ) (Select () (Var 2 marks) [(CaseStmt_Range (IntegerBinOp (IntegerConstant 40 (Integer 4) Decimal) Add (Var 2 bp) (Integer 4) (IntegerConstant 42 (Integer 4) Decimal) ) () [(Print (StringConstant "Pass!" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range () (IntegerBinOp (IntegerConstant 39 (Integer 4) Decimal) Sub (Var 2 ap) (Integer 4) (IntegerConstant 38 (Integer 4) Decimal) ) [(Print (StringConstant "Failed!" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(Print (StringConstant "Invalid marks" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your marks are " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 marks)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Select () (Var 2 marks_fixed) [(CaseStmt_Range (IntegerBinOp (IntegerConstant 40 (Integer 4) Decimal) Add (Var 2 bp) (Integer 4) (IntegerConstant 42 (Integer 4) Decimal) ) () [(Print (StringConstant "Pass!" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 0 (Integer 4) Decimal) (IntegerBinOp (IntegerConstant 39 (Integer 4) Decimal) Sub (Var 2 ap) (Integer 4) (IntegerConstant 38 (Integer 4) Decimal) ) [(Print (StringConstant "Failed!" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(Print (StringConstant "Invalid marks" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your marks are " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 marks)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-fixed_form_simple_continue-1cd55c6.stdout0000664000175000017500000000060515174404631027417 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { implicit_program_lfortran: (Program (SymbolTable 2 { }) implicit_program_lfortran [] [] ) }) [] ) lfortran-0.63.0/tests/reference/pass_flip_sign-flip_sign-16b288c.json0000664000175000017500000000101415174404631025552 0ustar alastairalastair{ "basename": "pass_flip_sign-flip_sign-16b288c", "cmd": "lfortran --pass=flip_sign --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/flip_sign.f90", "infile_hash": "12739178c354710c6f6bbeb834508a7932ae385c1340b0c08bca8b8d", "outfile": null, "outfile_hash": null, "stdout": "pass_flip_sign-flip_sign-16b288c.stdout", "stdout_hash": "63d10a290f482b8ae0fd3427b55cc42f8e98535bc3cf4b056772005f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-data_12-3198178.stdout0000664000175000017500000002321615174404631023032 0ustar alastairalastair(TranslationUnit [(Module data_12_module (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ()) (td [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(y [] [] () () None ()) (z [] [] () () None ()) (c1 [(1 4 DimensionExpr)] [] () () None ()) (bf1 [] [] () () None ()) (xx90 [] [] () () None ()) (xx95 [] [] () () None ()) (b [] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [x td b] [1 4 3] )] () ) (DataStmt 0 [(DataStmtSet [y z] [(Real "2.0") (Real "3.0")] )] () ) (DataStmt 0 [(DataStmtSet [c1] [(Real "0.0") (Real "0.22") (u- (Real "0.14")) (u- (Real "0.21"))] )] () ) (DataStmt 0 [(DataStmtSet [bf1] [(Real "0.8")] ) (DataStmtSet [xx90 xx95] [(Real "0.55") (Real "0.62")] )] () )] [] ) (Program data_12_program () [(Use [] data_12_module [] .false. () )] [(ImplicitNone [] () )] [] [(Print 0 () [x] () ) (If 0 () (/= x 1) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [y] () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- y (Real "2.0")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [z] () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- z (Real "3.0")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [(FuncCallOrArray c1 [] [(() 1 () 0)] [] [] [] )] () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- (FuncCallOrArray c1 [] [(() 1 () 0)] [] [] [] ) (Real "0.0")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [(FuncCallOrArray c1 [] [(() 2 () 0)] [] [] [] )] () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- (FuncCallOrArray c1 [] [(() 2 () 0)] [] [] [] ) (Real "0.22")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [(FuncCallOrArray c1 [] [(() 4 () 0)] [] [] [] )] () ) (If 0 () (> (FuncCallOrArray abs [] [(() (+ (FuncCallOrArray c1 [] [(() 4 () 0)] [] [] [] ) (Real "0.21")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [bf1] () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- bf1 (Real "0.8")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [xx90] () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- xx90 (Real "0.55")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [xx95] () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- xx95 (Real "0.62")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () )] [] )] ) lfortran-0.63.0/tests/reference/asr-subroutines_21-82bc946.stderr0000664000175000017500000000066715174404631024624 0ustar alastairalastairsemantic error: Passing a scalar argument to an array dummy argument is not allowed. Use --legacy-array-sections to enable sequence association --> tests/../integration_tests/subroutines_21.f90:21:17 | 21 | call sum_n(4, work(3), res) | ^^^^^^^ scalar argument | 3 | subroutine sum_n(n, x, s) | ^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 12 | end subroutine | ...^^^^^^^^^^^^^^ array dummy argument lfortran-0.63.0/tests/reference/asr-external2-e21d7a5.json0000664000175000017500000000076715174404631023362 0ustar alastairalastair{ "basename": "asr-external2-e21d7a5", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/external2.f90", "infile_hash": "dfe22f031dc3f7982626b0de475e61ab3c4ffd0ecc03aa05e86937a7", "outfile": null, "outfile_hash": null, "stdout": "asr-external2-e21d7a5.stdout", "stdout_hash": "2e5a9750ec863f25253afa90a8bd138fbc7497572a121be4a1d5155a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-print2-1ac10f6.json0000664000175000017500000000070715174404631022661 0ustar alastairalastair{ "basename": "ast-print2-1ac10f6", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/print2.f90", "infile_hash": "6adc0ae191ec271ea11820e431167bc842948bb91bf0b54fe86090f7", "outfile": null, "outfile_hash": null, "stdout": "ast-print2-1ac10f6.stdout", "stdout_hash": "5131850329ed8a65d5585da1be7220b608694d1d6c739756c7c8e9a0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-generic_name_01-d3550a6.stdout0000664000175000017500000005011015174404631025032 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> %complex_module.complextype_class = type <{ i32 (...)**, %complex_module.complextype* }> %complex_module.complextype = type { float, float } @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [27 x i8] c"Calling integer_add_subrout" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([27 x i8], [27 x i8]* @string_const_data, i32 0, i32 0), i64 27 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [24 x i8] c"Calling real_add_subrout" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([24 x i8], [24 x i8]* @string_const_data.1, i32 0, i32 0), i64 24 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @_Name_complextype = private unnamed_addr constant [12 x i8] c"complextype\00", align 1 @_Type_Info_complextype = linkonce_odr unnamed_addr constant { i8*, i8*, i8* } { i8* getelementptr inbounds ([12 x i8], [12 x i8]* @_Name_complextype, i32 0, i32 0), i8* inttoptr (i64 8 to i8*), i8* null }, align 8 @_VTable_complextype = linkonce_odr unnamed_addr constant { [7 x i8*] } { [7 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_complextype to i8*), i8* bitcast (void (i8*, i8*)* @_copy_complex_module_complextype to i8*), i8* bitcast (void (i8**)* @_allocate_struct_complex_module_complextype to i8*), i8* bitcast (void (i8*)* @finalize_StructType__complextype_of_complex_module_for_UPoly to i8*), i8* bitcast (void (%complex_module.complextype_class*, i32*, i32*, %complex_module.complextype*)* @__module_complex_module_integer_add_subrout to i8*), i8* bitcast (void (%complex_module.complextype_class*, float*, float*, %complex_module.complextype*)* @__module_complex_module_real_add_subrout to i8*)] }, align 8 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [6 x i8] c"R4,R4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [6 x i8] c"R4,R4\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_complex_module_integer_add_subrout(%complex_module.complextype_class* %this, i32* %r, i32* %i, %complex_module.complextype* %sum) { .entry: %0 = getelementptr %complex_module.complextype, %complex_module.complextype* %sum, i32 0, i32 1 %1 = getelementptr %complex_module.complextype, %complex_module.complextype* %sum, i32 0, i32 0 %2 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %2, i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %3 = getelementptr %complex_module.complextype, %complex_module.complextype* %sum, i32 0, i32 0 %4 = getelementptr %complex_module.complextype_class, %complex_module.complextype_class* %this, i32 0, i32 1 %5 = load %complex_module.complextype*, %complex_module.complextype** %4, align 8 %6 = getelementptr %complex_module.complextype, %complex_module.complextype* %5, i32 0, i32 0 %7 = load float, float* %6, align 4 %8 = load i32, i32* %r, align 4 %9 = sitofp i32 %8 to float %10 = fadd float %7, %9 store float %10, float* %3, align 4 %11 = getelementptr %complex_module.complextype, %complex_module.complextype* %sum, i32 0, i32 1 %12 = getelementptr %complex_module.complextype_class, %complex_module.complextype_class* %this, i32 0, i32 1 %13 = load %complex_module.complextype*, %complex_module.complextype** %12, align 8 %14 = getelementptr %complex_module.complextype, %complex_module.complextype* %13, i32 0, i32 1 %15 = load float, float* %14, align 4 %16 = load i32, i32* %i, align 4 %17 = sitofp i32 %16 to float %18 = fadd float %15, %17 store float %18, float* %11, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_integer_add_subrout FINALIZE_SYMTABLE_integer_add_subrout: ; preds = %return ret void } define void @__module_complex_module_real_add_subrout(%complex_module.complextype_class* %this, float* %r, float* %i, %complex_module.complextype* %sum) { .entry: %0 = getelementptr %complex_module.complextype, %complex_module.complextype* %sum, i32 0, i32 1 %1 = getelementptr %complex_module.complextype, %complex_module.complextype* %sum, i32 0, i32 0 %2 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %2, i32 24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %3 = getelementptr %complex_module.complextype, %complex_module.complextype* %sum, i32 0, i32 0 %4 = getelementptr %complex_module.complextype_class, %complex_module.complextype_class* %this, i32 0, i32 1 %5 = load %complex_module.complextype*, %complex_module.complextype** %4, align 8 %6 = getelementptr %complex_module.complextype, %complex_module.complextype* %5, i32 0, i32 0 %7 = load float, float* %6, align 4 %8 = load float, float* %r, align 4 %9 = fadd float %7, %8 store float %9, float* %3, align 4 %10 = getelementptr %complex_module.complextype, %complex_module.complextype* %sum, i32 0, i32 1 %11 = getelementptr %complex_module.complextype_class, %complex_module.complextype_class* %this, i32 0, i32 1 %12 = load %complex_module.complextype*, %complex_module.complextype** %11, align 8 %13 = getelementptr %complex_module.complextype, %complex_module.complextype* %12, i32 0, i32 1 %14 = load float, float* %13, align 4 %15 = load float, float* %i, align 4 %16 = fadd float %14, %15 store float %16, float* %10, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_real_add_subrout FINALIZE_SYMTABLE_real_add_subrout: ; preds = %return ret void } declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc4 = alloca %string_descriptor, align 8 %2 = alloca %complex_module.complextype_class, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %3 = call i8* @_lfortran_get_default_allocator() %4 = alloca %complex_module.complextype_class, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca %complex_module.complextype, align 8 %5 = getelementptr %complex_module.complextype, %complex_module.complextype* %a, i32 0, i32 1 %6 = getelementptr %complex_module.complextype, %complex_module.complextype* %a, i32 0, i32 0 %c = alloca %complex_module.complextype, align 8 %7 = getelementptr %complex_module.complextype, %complex_module.complextype* %c, i32 0, i32 1 %8 = getelementptr %complex_module.complextype, %complex_module.complextype* %c, i32 0, i32 0 %fpone = alloca float, align 4 %fptwo = alloca float, align 4 %fpzero = alloca float, align 4 %ione = alloca i32, align 4 %izero = alloca i32, align 4 %negfpone = alloca float, align 4 store float 1.000000e+00, float* %fpone, align 4 store float 2.000000e+00, float* %fptwo, align 4 store float 0.000000e+00, float* %fpzero, align 4 store i32 1, i32* %ione, align 4 store i32 0, i32* %izero, align 4 store float -1.000000e+00, float* %negfpone, align 4 %9 = getelementptr %complex_module.complextype, %complex_module.complextype* %c, i32 0, i32 0 %10 = load float, float* %fpone, align 4 store float %10, float* %9, align 4 %11 = getelementptr %complex_module.complextype, %complex_module.complextype* %c, i32 0, i32 1 %12 = load float, float* %fptwo, align 4 store float %12, float* %11, align 4 %13 = getelementptr %complex_module.complextype_class, %complex_module.complextype_class* %4, i32 0, i32 0 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [7 x i8*] }, { [7 x i8*] }* @_VTable_complextype, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %13, align 8 %14 = getelementptr %complex_module.complextype_class, %complex_module.complextype_class* %4, i32 0, i32 1 store %complex_module.complextype* %c, %complex_module.complextype** %14, align 8 call void @__module_complex_module_integer_add_subrout(%complex_module.complextype_class* %4, i32* %ione, i32* %izero, %complex_module.complextype* %a) %15 = alloca i64, align 8 %16 = getelementptr %complex_module.complextype, %complex_module.complextype* %a, i32 0, i32 0 %17 = load float, float* %16, align 4 %18 = alloca float, align 4 store float %17, float* %18, align 4 %19 = getelementptr %complex_module.complextype, %complex_module.complextype* %a, i32 0, i32 1 %20 = load float, float* %19, align 4 %21 = alloca float, align 4 store float %20, float* %21, align 4 %22 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %3, i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info, i32 0, i32 0), i64* %15, i32 0, i32 0, i32 0, i32 0, i32 0, float* %18, float* %21) %23 = load i64, i64* %15, align 8 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %22, i8** %24, align 8 %25 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %23, i64* %25, align 8 %26 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %27 = load i8*, i8** %26, align 8 %28 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %29 = load i64, i64* %28, align 8 %30 = trunc i64 %29 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %27, i32 %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %31 = icmp eq i8* %22, null br i1 %31, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %3, i8* %22) br label %free_done free_done: ; preds = %free_nonnull, %.entry %32 = getelementptr %complex_module.complextype, %complex_module.complextype* %a, i32 0, i32 0 %33 = load float, float* %32, align 4 %34 = fcmp une float %33, 2.000000e+00 br i1 %34, label %then, label %else then: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %free_done br label %ifcont ifcont: ; preds = %else, %then %35 = getelementptr %complex_module.complextype, %complex_module.complextype* %a, i32 0, i32 1 %36 = load float, float* %35, align 4 %37 = fcmp une float %36, 2.000000e+00 br i1 %37, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %38 = getelementptr %complex_module.complextype_class, %complex_module.complextype_class* %2, i32 0, i32 0 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [7 x i8*] }, { [7 x i8*] }* @_VTable_complextype, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %38, align 8 %39 = getelementptr %complex_module.complextype_class, %complex_module.complextype_class* %2, i32 0, i32 1 store %complex_module.complextype* %c, %complex_module.complextype** %39, align 8 call void @__module_complex_module_real_add_subrout(%complex_module.complextype_class* %2, float* %fpzero, float* %negfpone, %complex_module.complextype* %a) %40 = alloca i64, align 8 %41 = getelementptr %complex_module.complextype, %complex_module.complextype* %a, i32 0, i32 0 %42 = load float, float* %41, align 4 %43 = alloca float, align 4 store float %42, float* %43, align 4 %44 = getelementptr %complex_module.complextype, %complex_module.complextype* %a, i32 0, i32 1 %45 = load float, float* %44, align 4 %46 = alloca float, align 4 store float %45, float* %46, align 4 %47 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %3, i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info.3, i32 0, i32 0), i64* %40, i32 0, i32 0, i32 0, i32 0, i32 0, float* %43, float* %46) %48 = load i64, i64* %40, align 8 %49 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %47, i8** %49, align 8 %50 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %48, i64* %50, align 8 %51 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %52 = load i8*, i8** %51, align 8 %53 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %54 = load i64, i64* %53, align 8 %55 = trunc i64 %54 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %52, i32 %55, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %56 = icmp eq i8* %47, null br i1 %56, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %ifcont3 call void @_lfortran_free_alloc(i8* %3, i8* %47) br label %free_done6 free_done6: ; preds = %free_nonnull5, %ifcont3 %57 = getelementptr %complex_module.complextype, %complex_module.complextype* %a, i32 0, i32 0 %58 = load float, float* %57, align 4 %59 = fcmp une float %58, 1.000000e+00 br i1 %59, label %then7, label %else8 then7: ; preds = %free_done6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont9 else8: ; preds = %free_done6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 %60 = getelementptr %complex_module.complextype, %complex_module.complextype* %a, i32 0, i32 1 %61 = load float, float* %60, align 4 %62 = fcmp une float %61, 1.000000e+00 br i1 %62, label %then10, label %else11 then10: ; preds = %ifcont9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont12 else11: ; preds = %ifcont9 br label %ifcont12 ifcont12: ; preds = %else11, %then10 br label %return return: ; preds = %ifcont12 br label %FINALIZE_SYMTABLE_generic_name_01 FINALIZE_SYMTABLE_generic_name_01: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) define linkonce_odr void @_copy_complex_module_complextype(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %complex_module.complextype* %3 = bitcast i8* %1 to %complex_module.complextype* %4 = getelementptr %complex_module.complextype, %complex_module.complextype* %2, i32 0, i32 0 %5 = load float, float* %4, align 4 %6 = getelementptr %complex_module.complextype, %complex_module.complextype* %3, i32 0, i32 0 br i1 true, label %then, label %else then: ; preds = %entry store float %5, float* %6, align 4 br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then %7 = getelementptr %complex_module.complextype, %complex_module.complextype* %2, i32 0, i32 1 %8 = load float, float* %7, align 4 %9 = getelementptr %complex_module.complextype, %complex_module.complextype* %3, i32 0, i32 1 br i1 true, label %then1, label %else2 then1: ; preds = %ifcont store float %8, float* %9, align 4 br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 ret void } define linkonce_odr void @_allocate_struct_complex_module_complextype(i8** %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = call i8* @_lfortran_malloc_alloc(i8* %1, i64 16) call void @llvm.memset.p0i8.i32(i8* %2, i8 0, i32 16, i1 false) store i8* %2, i8** %0, align 8 %3 = load i8*, i8** %0, align 8 %4 = bitcast i8* %3 to %complex_module.complextype_class* %5 = bitcast %complex_module.complextype_class* %4 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [7 x i8*] }, { [7 x i8*] }* @_VTable_complextype, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %5, align 8 %6 = getelementptr %complex_module.complextype_class, %complex_module.complextype_class* %4, i32 0, i32 1 %7 = call i8* @_lfortran_get_default_allocator() %8 = call i8* @_lfortran_malloc_alloc(i8* %7, i64 8) call void @llvm.memset.p0i8.i32(i8* %8, i8 0, i32 8, i1 false) %9 = bitcast i8* %8 to %complex_module.complextype* store %complex_module.complextype* %9, %complex_module.complextype** %6, align 8 %10 = getelementptr %complex_module.complextype, %complex_module.complextype* %9, i32 0, i32 1 %11 = getelementptr %complex_module.complextype, %complex_module.complextype* %9, i32 0, i32 0 ret void } define internal void @finalize_StructType__complextype_of_complex_module_for_UPoly(i8* %0) { entry: %1 = bitcast i8* %0 to %complex_module.complextype* ret void } declare i8* @_lfortran_malloc_alloc(i8*, i64) declare i8* @_lfortran_get_default_allocator() ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) attributes #0 = { argmemonly nounwind willreturn writeonly } lfortran-0.63.0/tests/reference/c-expr_11-8e5ae80.json0000664000175000017500000000103015174404631022361 0ustar alastairalastair{ "basename": "c-expr_11-8e5ae80", "cmd": "lfortran --no-color --show-c {infile}", "infile": "tests/../integration_tests/expr_11.f90", "infile_hash": "1d3eee7b6af3504909d82d761867baf90d2f74b36edc4a6eac4e341f", "outfile": null, "outfile_hash": null, "stdout": "c-expr_11-8e5ae80.stdout", "stdout_hash": "dd596dbc5192adba6b87e2421cae2cc8c34423c7a3bfda7930d35f92", "stderr": "c-expr_11-8e5ae80.stderr", "stderr_hash": "3982eb2e7c64c27254305941b9a7f4d9f69369c801f76c5dece5e3dd", "returncode": 0 }lfortran-0.63.0/tests/reference/wat-doloop_03-e0c63db.stdout0000664000175000017500000002131415174404631023700 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i32) i32.const 0 local.set 1 i32.const 1 i32.const 1 i32.sub local.set 0 loop local.get 0 i32.const 1 i32.add i32.const 10 i32.le_s if local.get 0 i32.const 1 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 local.get 0 i32.const 3 i32.eq if else end local.get 0 i32.const 2 i32.eq if br 1 else end br 1 else end end local.get 1 i32.const 3 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 1 i32.const 1 i32.sub local.set 0 loop local.get 0 i32.const 1 i32.add i32.const 10 i32.le_s if local.get 0 i32.const 1 i32.add local.set 0 local.get 0 i32.const 2 i32.eq if br 1 else end local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 1 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 1 i32.const 1 i32.sub local.set 0 loop local.get 0 i32.const 1 i32.add i32.const 10 i32.le_s if local.get 0 i32.const 1 i32.add local.set 0 local.get 0 i32.const 2 i32.eq if br 2 else end local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 53 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\0b\00\00\00") (data (;35;) (i32.const 216) "ERROR STOP\n ") ) lfortran-0.63.0/tests/reference/asr-continue_compilation_simd-4dab78a.stderr0000664000175000017500000000222415174404631027316 0ustar alastairalastairsemantic error: SIMD arrays must be 1 dimensional, but `simd_2d` has 2 dimensions --> tests/errors/continue_compilation_simd.f90:5:13 | 5 | real :: simd_2d(8, 8) | ^^^^^^^^^^^^^ semantic error: SIMD arrays cannot be allocatable: `simd_alloc` --> tests/errors/continue_compilation_simd.f90:6:26 | 6 | real, allocatable :: simd_alloc(:) | ^^^^^^^^^^^^^ semantic error: SIMD arrays cannot be pointers: `simd_ptr` --> tests/errors/continue_compilation_simd.f90:7:22 | 7 | real, pointer :: simd_ptr(:) | ^^^^^^^^^^^ semantic error: The SIMD variable `simd_scalar` must be an array --> tests/errors/continue_compilation_simd.f90:8:13 | 8 | real :: simd_scalar | ^^^^^^^^^^^ semantic error: SIMD arrays must have Real or Integer element type, but `simd_char` has an incompatible type --> tests/errors/continue_compilation_simd.f90:9:18 | 9 | character :: simd_char(8) | ^^^^^^^^^^^^ semantic error: The SIMD variable `x` must be an array --> tests/errors/continue_compilation_simd.f90:10:13 | 10 | real :: x | ^ lfortran-0.63.0/tests/reference/wat-if_05-865c1b8.stdout0000664000175000017500000002062415174404631022661 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i32) i32.const 1 local.set 0 i32.const 0 local.set 1 local.get 0 if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else end local.get 1 if i32.const 1 i32.const 236 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else end local.get 0 if i32.const 1 i32.const 264 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 304 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop end local.get 1 if i32.const 1 i32.const 348 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 388 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop end local.get 0 if i32.const 1 i32.const 432 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else local.get 0 if i32.const 1 i32.const 452 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else end end local.get 1 if i32.const 1 i32.const 476 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else local.get 0 if i32.const 1 i32.const 452 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 496 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop end end local.get 1 if i32.const 1 i32.const 476 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else local.get 1 if i32.const 1 i32.const 516 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 496 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop end end i32.const 0 call 0 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\11\00\00\00") (data (;35;) (i32.const 216) "x: Single Line If ") (data (;36;) (i32.const 236) "\f4\00\00\00\11\00\00\00") (data (;37;) (i32.const 244) "y: Single Line If ") (data (;38;) (i32.const 264) "\10\01\00\00\20\00\00\00") (data (;39;) (i32.const 272) "x: Multi Line If-Else: x is True") (data (;40;) (i32.const 304) "\38\01\00\00\21\00\00\00") (data (;41;) (i32.const 312) "x: Multi Line If-Else: x is False ") (data (;42;) (i32.const 348) "\64\01\00\00\20\00\00\00") (data (;43;) (i32.const 356) "y: Multi Line If-Else: y is True") (data (;44;) (i32.const 388) "\8c\01\00\00\21\00\00\00") (data (;45;) (i32.const 396) "y: Multi Line If-Else: y is False ") (data (;46;) (i32.const 432) "\b8\01\00\00\0a\00\00\00") (data (;47;) (i32.const 440) "x: If part ") (data (;48;) (i32.const 452) "\cc\01\00\00\0f\00\00\00") (data (;49;) (i32.const 460) "x: Else-If part ") (data (;50;) (i32.const 476) "\e4\01\00\00\0a\00\00\00") (data (;51;) (i32.const 484) "y: If part ") (data (;52;) (i32.const 496) "\f8\01\00\00\09\00\00\00") (data (;53;) (i32.const 504) "Else part ") (data (;54;) (i32.const 516) "\0c\02\00\00\0f\00\00\00") (data (;55;) (i32.const 524) "y: Else-If part ") ) lfortran-0.63.0/tests/reference/asr-matrix_matmul_02-4e306e0.json0000664000175000017500000000075415174404631024554 0ustar alastairalastair{ "basename": "asr-matrix_matmul_02-4e306e0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/matrix_matmul_02.f90", "infile_hash": "79a17a2ff70856ec0617d9c468558fc401abfb6732095095410408e3", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-matrix_matmul_02-4e306e0.stderr", "stderr_hash": "a3d0256f40ab6b1b00a04f00667f02e4aa265d08754118958a1d920c", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-derived_types_01-b50f880.stdout0000664000175000017500000001726215174404631025121 0ustar alastairalastair(TranslationUnit [(Module derived_types_01_m_01 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(DerivedType X [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Declaration (AttrType TypeReal [] () () None ) [] [(r [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [] ) (DerivedType Y [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Declaration (AttrType TypeComplex [] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () X None ) [] [(d [] [] () () None ())] () )] [] )] [] [(Subroutine set [(a)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeType [] () X None ) [(AttrIntent Out )] [(a [] [] () () None ())] () )] [(Assignment 0 i [(a [])] 1 () ) (Assignment 0 r [(a [])] (Real "1.5") () )] [] [] )] ) (Module derived_types_01_m_02 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(Use [] derived_types_01_m_01 [(UseSymbol Y () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(DerivedType Z [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Declaration (AttrType TypeComplex [] () () None ) [] [(k [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () Y None ) [] [(l [] [] () () None ())] () )] [] )] [] [] ) (Program derived_types_01 () [(Use [] derived_types_01_m_02 [(UseSymbol Z () )] .true. () ) (Use [] derived_types_01_m_01 [(UseSymbol X () ) (UseSymbol set () )] .true. () )] [(ImplicitNone [] () )] [(Declaration (AttrType TypeType [] () X None ) [] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () Z None ) [] [(c [] [] () () None ())] () )] [(Assignment 0 i [(b [])] 5 () ) (Assignment 0 r [(b [])] (Real "3.5") () ) (Print 0 () [i [(b [])] r [(b [])]] () ) (SubroutineCall 0 set [] [(() b () 0)] [] [] () ) (Print 0 () [i [(b [])] r [(b [])]] () ) (Assignment 0 r [(c []) (l []) (d [])] (Real "2.0") () ) (Assignment 0 i [(c []) (l []) (d [])] 2 () ) (Assignment 0 k [(c [])] (Complex (Real "2.0") (Real "2.0")) () ) (Print 0 () [r [(c []) (l []) (d [])] i [(c []) (l []) (d [])] k [(c [])]] () ) (SubroutineCall 0 set [] [(() d [(c []) (l [])] () 0)] [] [] () ) (Print 0 () [r [(c []) (l []) (d [])] i [(c []) (l []) (d [])] k [(c [])]] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-character_01-e8e453d.json0000664000175000017500000000106515174404631023713 0ustar alastairalastair{ "basename": "asr-character_01-e8e453d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/warnings/character_01.f90", "infile_hash": "f952599c29229b99c5aca49cbb1e3ee4ff0dbd778b07ce826549ff4d", "outfile": null, "outfile_hash": null, "stdout": "asr-character_01-e8e453d.stdout", "stdout_hash": "cc71aef5ab397c56b4cb8adb18a7dabe9b46cffb82bdf322ae74c451", "stderr": "asr-character_01-e8e453d.stderr", "stderr_hash": "c65e821fd013fdfacc225b26b767527afdb4d228d8e60841a7d0349c", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-types_01-a91206c.stdout0000664000175000017500000000722215174404631023401 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { types_01: (Program (SymbolTable 2 { r: (Variable 2 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) types_01 [] [(Assignment (Var 2 r) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 r) (RealConstant 1.500000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 r) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 r) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 r) (Cast (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 3.000000 (Real 8) ) () ) RealToReal (Real 4) (RealConstant 3.000000 (Real 4) ) () ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/run-format_34-81f4937.stdout0000664000175000017500000000005015174404631023502 0ustar alastairalastairmainline k = -1 2 3 internal k = -1 2 3 lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor8-b01de63.stdout0000664000175000017500000000600715174404631027077 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor8: (Program (SymbolTable 2 { }) preprocessor8 [] [(Print (StringFormat () [(IntegerConstant 1 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "__VERSION__ present" (String 1 (IntegerConstant 19 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "__LFORTRAN_MAJOR__ present" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "__LFORTRAN_MINOR__ present" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "__LFORTRAN_PATCHLEVEL__ present" (String 1 (IntegerConstant 31 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "tests/preprocessor8.f90" (String 1 (IntegerConstant 23 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(IntegerConstant 19 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntegerConstant 20 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-func_parameter_type-a49e846.json0000664000175000017500000000076515174404631025444 0ustar alastairalastair{ "basename": "asr-func_parameter_type-a49e846", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/func_parameter_type.f90", "infile_hash": "34a08bb396e7c713157f35ee281ae8abc109b6b7378aa438f2aaef2c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-func_parameter_type-a49e846.stderr", "stderr_hash": "42c29ae4c0fa02414233148c3ed651b3c30db275c556cb725fed9fa9", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-array2-4254183.stdout0000664000175000017500000000157715174404631023176 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca [5 x float], align 4 %b = alloca [5 x float], align 4 %c = alloca [3 x i32], align 4 %d = alloca [2 x i32], align 4 %e = alloca [6 x float], align 4 %f = alloca [12 x i32], align 4 %g = alloca [10 x i32], align 4 %h = alloca [24 x float], align 4 %i = alloca [36 x i32], align 4 %j = alloca [20 x i32], align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_array2 FINALIZE_SYMTABLE_array2: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/llvm-complex2-092502c.stdout0000664000175000017500000001631015174404631023570 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> %complex_4 = type <{ float, float }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc4 = alloca %string_descriptor, align 8 %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca %complex_4, align 8 store %complex_4 <{ float 3.000000e+00, float 4.000000e+00 }>, %complex_4* %x, align 1 %3 = load %complex_4, %complex_4* %x, align 1 %4 = extractvalue %complex_4 %3, 0 %5 = extractvalue %complex_4 %3, 1 %6 = fadd float %4, 4.000000e+00 %7 = fadd float %5, 0.000000e+00 %8 = insertvalue %complex_4 undef, float %6, 0 %9 = insertvalue %complex_4 %8, float %7, 1 store %complex_4 %9, %complex_4* %x, align 1 %10 = alloca i64, align 8 %11 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info, i32 0, i32 0), i64* %10, i32 0, i32 0, i32 0, i32 0, i32 0, %complex_4* %x) %12 = load i64, i64* %10, align 8 %13 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %11, i8** %13, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %12, i64* %14, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %16 = load i8*, i8** %15, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %18 = load i64, i64* %17, align 8 %19 = trunc i64 %18 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %16, i32 %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %20 = icmp eq i8* %11, null br i1 %20, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %11) br label %free_done free_done: ; preds = %free_nonnull, %.entry %21 = load %complex_4, %complex_4* %x, align 1 %22 = extractvalue %complex_4 %21, 0 %23 = extractvalue %complex_4 %21, 1 %24 = fadd float 2.000000e+00, %22 %25 = fadd float 0.000000e+00, %23 %26 = insertvalue %complex_4 undef, float %24, 0 %27 = insertvalue %complex_4 %26, float %25, 1 store %complex_4 %27, %complex_4* %x, align 1 %28 = alloca i64, align 8 %29 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.1, i32 0, i32 0), i64* %28, i32 0, i32 0, i32 0, i32 0, i32 0, %complex_4* %x) %30 = load i64, i64* %28, align 8 %31 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %29, i8** %31, align 8 %32 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %30, i64* %32, align 8 %33 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %34 = load i8*, i8** %33, align 8 %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %36 = load i64, i64* %35, align 8 %37 = trunc i64 %36 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %34, i32 %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %38 = icmp eq i8* %29, null br i1 %38, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %2, i8* %29) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %39 = load %complex_4, %complex_4* %x, align 1 %40 = extractvalue %complex_4 %39, 0 %41 = extractvalue %complex_4 %39, 1 %42 = fadd float 2.000000e+00, %40 %43 = fadd float 0.000000e+00, %41 %44 = insertvalue %complex_4 undef, float %42, 0 %45 = insertvalue %complex_4 %44, float %43, 1 %46 = extractvalue %complex_4 %45, 0 %47 = extractvalue %complex_4 %45, 1 %48 = fadd float %46, 0.000000e+00 %49 = fadd float %47, 3.000000e+00 %50 = insertvalue %complex_4 undef, float %48, 0 %51 = insertvalue %complex_4 %50, float %49, 1 store %complex_4 %51, %complex_4* %x, align 1 %52 = alloca i64, align 8 %53 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.2, i32 0, i32 0), i64* %52, i32 0, i32 0, i32 0, i32 0, i32 0, %complex_4* %x) %54 = load i64, i64* %52, align 8 %55 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %53, i8** %55, align 8 %56 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %54, i64* %56, align 8 %57 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %58 = load i8*, i8** %57, align 8 %59 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %60 = load i64, i64* %59, align 8 %61 = trunc i64 %60 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %58, i32 %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %62 = icmp eq i8* %53, null br i1 %62, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free_alloc(i8* %2, i8* %53) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 br label %return return: ; preds = %free_done6 br label %FINALIZE_SYMTABLE_complex2 FINALIZE_SYMTABLE_complex2: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/ast-call1-ae0bbbd.json0000664000175000017500000000073215174404631022653 0ustar alastairalastair{ "basename": "ast-call1-ae0bbbd", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/call1.f", "infile_hash": "1a410f5dd9da71aa4f4cc221b229a0c01746d7bf0b414facc7fcf202", "outfile": null, "outfile_hash": null, "stdout": "ast-call1-ae0bbbd.stdout", "stdout_hash": "736a094b443b0315b39fa3fdccbdd106da08af7beff755ef3abd78f7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-callback_02-aec5457.stdout0000664000175000017500000010177215174404631024067 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { callback_02: (Module (SymbolTable 2 { cb: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Function (SymbolTable 4 { res: (Variable 4 res [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Real 4) (Real 4)] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 x) (Var 4 res)] [] () Public .false. .false. () ), res: (Variable 3 res [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cb (FunctionType [(Real 4) (Real 4) (Real 4) (FunctionType [(Real 4) (Real 4)] () Source Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 res) (Var 3 a) (Var 3 b) (Var 3 f)] [(SubroutineCall 3 f () [((Var 3 a)) ((Var 3 res))] () .false. ) (Print (StringFormat () [(Var 3 res)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 3 f () [((Var 3 b)) ((Var 3 res))] () .false. ) (Print (StringFormat () [(Var 3 res)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 3 res) (RealBinOp (RealBinOp (Var 3 b) Sub (Var 3 a) (Real 4) () ) Mul (Var 3 res) (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 3 res)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), foo: (Function (SymbolTable 5 { c: (Variable 5 c [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 5 d [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Function (SymbolTable 6 { res: (Variable 6 res [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 6 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Real 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 x) (Var 6 res)] [(Assignment (Var 6 res) (RealBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) Mul (Var 6 x) (Real 4) () ) () .false. .false. )] () Public .true. .true. () ), foo: (Variable 5 foo [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 5 res [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) foo (FunctionType [(Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [cb] [(Var 5 c) (Var 5 d) (Var 5 res)] [(SubroutineCall 2 cb () [((Var 5 res)) ((Var 5 c)) ((Var 5 d)) ((Var 5 f))] () .false. ) (Assignment (Var 5 foo) (Var 5 res) () .false. .false. )] (Var 5 foo) Public .false. .false. () ) }) callback_02 () [] .false. .false. .false. ), main: (Program (SymbolTable 7 { cb: (ExternalSymbol 7 cb 2 cb callback_02 [] cb Public ), foo: (ExternalSymbol 7 foo 2 foo callback_02 [] foo Public ), res: (Variable 7 res [] Local (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) () ) (RealConstant 0.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main [callback_02] [(Assignment (Var 7 res) (FunctionCall 7 foo () [((RealConstant 1.500000 (Real 4) )) ((RealConstant 2.000000 (Real 4) )) ((Var 7 res))] (Real 4) () () ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-program_without_line_06-58bbdbc.json0000664000175000017500000000100115174404631026345 0ustar alastairalastair{ "basename": "ast-program_without_line_06-58bbdbc", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/program_without_line_06.f90", "infile_hash": "20fbd1c400593343e3e6af74e9efb41a4d86f95050261626266a26ac", "outfile": null, "outfile_hash": null, "stdout": "ast-program_without_line_06-58bbdbc.stdout", "stdout_hash": "2c96f51cbf4cd83b0f3aa8877487ee2934df2ac013a5e41697b9abaa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-expr_05-ee2fdac.stdout0000664000175000017500000000324015174404631024036 0ustar alastairalastairfunction main() local a::Int32 local b::Int32 local c::Int32 local l::Bool local x::Int32 a = 3 b = 4 c = 5 x = 2 * 3 x = (-2) * 3 x = 2 * (-3) x = (-2) * (-3) x = (-2) * (-3) x = -2 ^ 3 x = -2 ^ 3 x = -(2 * 3) x = 2 ^ (-3) x = a x = a x = a * b x = (-a) * b x = -(a * b) x = a * (-b) x = (-a) * (-b) x = a * b * c x = (-a) * b * c x = a * (-b) * c x = a * b * (-c) x = (-a) * (-b) * (-c) x = 3 + 4 * 5 x = (3 + 4) * 5 x = a * (b + 5 * (c - b)) x = (3 - 2 * a * b) * 5 x = ((-2) * a * b + 3) * 5 x = ((-2) * a * b + 3 * b * a) * 5 x = ((-2) * a ÷ b + ((a + (-b)) ^ 2)) * 5 x = (2 * a * b + 3) * 5 x = (a ^ 2) + 2 * a * b + (b ^ 2) x = (a + b) * (a - b) x = (a + b) ^ 2 x = (a + b) * ((a ^ 2) - a * b + (b ^ 2)) x = (a - b) * (a + b) * ((a ^ 2) + (b ^ 2)) x = 1 ÷ (a * b) x = 1 ÷ a * b x = 1 ÷ a * b x = 1 ÷ (a * b + 1) x = 1 ÷ a * b + 1 x = 1 ÷ a * b + 1 x = 2 - (-2) x = a - ((-b) - c) x = a - (-2) * b x = c - (-2) ÷ b x = a - (2 + 3 + 4) x = a + 2 + 3 + 4 x = 2 * a + a * b - (a * b + 2 * a) x = 2 * a + a * b - (a * b - 2 * a) x = a - (b - (c - 1)) x = a - b x = a - (b - c) x = a - b - c x = -(a - ((-b) + (-b) - (-b) * b)) x = -(3 + 5) x = -(a + 5) l = ((x ^ 3) * 4 + a ≤ 4 || x < 5 && x < 6) == (true || !false && true) l = l || l && l l = (l || l) && l l = l && l || l l = l && (l || l) l = l || !l && l l = l || l && !l l = l && l || !l l = l && !l || l l = l && !(l || l) end main() lfortran-0.63.0/tests/reference/asr-implicit_call_02-00d0664.json0000664000175000017500000000101015174404631024375 0ustar alastairalastair{ "basename": "asr-implicit_call_02-00d0664", "cmd": "lfortran --show-asr --implicit-argument-casting --no-color {infile} -o {outfile}", "infile": "tests/errors/implicit_call_02.f90", "infile_hash": "24e50b64e17b6d3a7a46f02ffb24d18897a171a4e81a77686a72a5d4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit_call_02-00d0664.stderr", "stderr_hash": "87fac225c2b103ecdb9cbd2fc4001bcdedd8065e39e4fbf48073b9c2", "returncode": 2 }lfortran-0.63.0/tests/reference/pass_sign_from_value-sign_from_value-ba1c944.json0000664000175000017500000000106015174404631030237 0ustar alastairalastair{ "basename": "pass_sign_from_value-sign_from_value-ba1c944", "cmd": "lfortran --pass=sign_from_value --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/sign_from_value.f90", "infile_hash": "8dbaf3021ce3488c9846d4b6f9ffca21e9d2a2e6f4dfaa10cf7a844c", "outfile": null, "outfile_hash": null, "stdout": "pass_sign_from_value-sign_from_value-ba1c944.stdout", "stdout_hash": "2e622aaf3c4942f9588e2a652fd4458c87ecc56d4c23c4c4858fbe5b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-callback_02-41bc7d7.json0000664000175000017500000000075615174404631023701 0ustar alastairalastair{ "basename": "llvm-callback_02-41bc7d7", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/callback_02.f90", "infile_hash": "880452ed794b4467313ba9a87318b17fe757a084b2a39129209153d3", "outfile": null, "outfile_hash": null, "stdout": "llvm-callback_02-41bc7d7.stdout", "stdout_hash": "0c801165daab85dfb27beaf23cf5ec7f5d3f78c06b310cab4d40d0fc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-case_02-386b648.json0000664000175000017500000000075215174404631023220 0ustar alastairalastair{ "basename": "ast_f90-case_02-386b648", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/case_02.f90", "infile_hash": "76d3020fba89787d565870ed03c1b5e8914d12b062cb9ca7a8c37550", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-case_02-386b648.stdout", "stdout_hash": "287601388e018816a37bd53d489512a90322f78a6e2c91eee795bd68", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-class_procedure_extra_args-543ebdc.stderr0000664000175000017500000000035315174404631027454 0ustar alastairalastairsemantic error: More actual than formal arguments in procedure call --> tests/errors/class_procedure_extra_args.f90:30:33 | 30 | call myCircle%calculateArea(circleArea, 12) | ^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/pass_global_stmts-global_scope9-4cbbc3e.json0000664000175000017500000000101415174404631027252 0ustar alastairalastair{ "basename": "pass_global_stmts-global_scope9-4cbbc3e", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope9.f90", "infile_hash": "29e87c62bbe7f9efedd2e3cf348e80153367ecc0369b16de6f4db296", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope9-4cbbc3e.stdout", "stdout_hash": "0a728f2046f2525e31f0aa247f298b49fa505515de703f83aa036468", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-global_scope6-3cbd5d2.json0000664000175000017500000000073715174404631024435 0ustar alastairalastair{ "basename": "llvm-global_scope6-3cbd5d2", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/global_scope6.f90", "infile_hash": "3f2dfa122b78175565b7baa8f4d0417cfb0ed5bbe26bbb5f0f1f6f2e", "outfile": null, "outfile_hash": null, "stdout": "llvm-global_scope6-3cbd5d2.stdout", "stdout_hash": "53a0e38cc51b49f1c77cd6ab043b12afa96b0b3046e4d37e9a4c60a3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-arrays_08_func-ec93f58.stdout0000664000175000017500000000124015174404631025172 0ustar alastairalastairfunction copy_from_to(a::Array{Int32, 1}, b::Array{Int32, 1}) local i::Int32 for i ∈ 1:length(a) b[i] = a[i] end end function verify(a::Array{Int32, 1}, b::Array{Int32, 1})::Bool local i::Int32 local r::Bool r = true for i ∈ 1:length(a) r = r && a[i] == b[i] end return r end function main() local i::Int32 local r::Bool local x::Array{Int32, 1} local y::Array{Int32, 1} for i ∈ 1:length(x) x[i] = i end copy_from_to(Int32(x), Int32(y)) r = verify(Int32(x), Int32(y)) println(r) if !r println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-0.63.0/tests/reference/llvm-logical3-4bbf8ea.stdout0000664000175000017500000005151615174404631024052 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [26 x i8] c"Line 1 - Condition is true" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([26 x i8], [26 x i8]* @string_const_data, i32 0, i32 0), i64 26 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [27 x i8] c"Line 1 - Condition is false" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([27 x i8], [27 x i8]* @string_const_data.1, i32 0, i32 0), i64 27 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.3 = private constant [26 x i8] c"Line 2 - Condition is true" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([26 x i8], [26 x i8]* @string_const_data.3, i32 0, i32 0), i64 26 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.5 = private constant [27 x i8] c"Line 2 - Condition is false" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([27 x i8], [27 x i8]* @string_const_data.5, i32 0, i32 0), i64 27 }> @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.7 = private constant [28 x i8] c"Line xor - Condition is true" @string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([28 x i8], [28 x i8]* @string_const_data.7, i32 0, i32 0), i64 28 }> @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.9 = private constant [29 x i8] c"Line xor - Condition is false" @string_const.10 = private global %string_descriptor <{ i8* getelementptr inbounds ([29 x i8], [29 x i8]* @string_const_data.9, i32 0, i32 0), i64 29 }> @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @17 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.11 = private constant [26 x i8] c"Line 3 - Condition is true" @string_const.12 = private global %string_descriptor <{ i8* getelementptr inbounds ([26 x i8], [26 x i8]* @string_const_data.11, i32 0, i32 0), i64 26 }> @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.13 = private constant [27 x i8] c"Line 3 - Condition is false" @string_const.14 = private global %string_descriptor <{ i8* getelementptr inbounds ([27 x i8], [27 x i8]* @string_const_data.13, i32 0, i32 0), i64 27 }> @21 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @23 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.15 = private constant [26 x i8] c"Line 4 - Condition is true" @string_const.16 = private global %string_descriptor <{ i8* getelementptr inbounds ([26 x i8], [26 x i8]* @string_const_data.15, i32 0, i32 0), i64 26 }> @25 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.17 = private constant [27 x i8] c"Line 4 - Condition is false" @string_const.18 = private global %string_descriptor <{ i8* getelementptr inbounds ([27 x i8], [27 x i8]* @string_const_data.17, i32 0, i32 0), i64 27 }> @27 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @28 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @29 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.19 = private constant [26 x i8] c"Line 5 - Condition is true" @string_const.20 = private global %string_descriptor <{ i8* getelementptr inbounds ([26 x i8], [26 x i8]* @string_const_data.19, i32 0, i32 0), i64 26 }> @31 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @32 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @33 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @34 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.21 = private constant [27 x i8] c"Line 5 - Condition is false" @string_const.22 = private global %string_descriptor <{ i8* getelementptr inbounds ([27 x i8], [27 x i8]* @string_const_data.21, i32 0, i32 0), i64 27 }> @35 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.23 = private constant [26 x i8] c"Line 6 - Condition is true" @string_const.24 = private global %string_descriptor <{ i8* getelementptr inbounds ([26 x i8], [26 x i8]* @string_const_data.23, i32 0, i32 0), i64 26 }> @37 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.25 = private constant [27 x i8] c"Line 6 - Condition is false" @string_const.26 = private global %string_descriptor <{ i8* getelementptr inbounds ([27 x i8], [27 x i8]* @string_const_data.25, i32 0, i32 0), i64 27 }> @39 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @40 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @41 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.27 = private constant [26 x i8] c"Line 7 - Condition is true" @string_const.28 = private global %string_descriptor <{ i8* getelementptr inbounds ([26 x i8], [26 x i8]* @string_const_data.27, i32 0, i32 0), i64 26 }> @43 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @44 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.29 = private constant [27 x i8] c"Line 7 - Condition is false" @string_const.30 = private global %string_descriptor <{ i8* getelementptr inbounds ([27 x i8], [27 x i8]* @string_const_data.29, i32 0, i32 0), i64 27 }> @45 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @46 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @47 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @48 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.31 = private constant [30 x i8] c"Line 8 xor - Condition is true" @string_const.32 = private global %string_descriptor <{ i8* getelementptr inbounds ([30 x i8], [30 x i8]* @string_const_data.31, i32 0, i32 0), i64 30 }> @49 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @50 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @51 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @52 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.33 = private constant [31 x i8] c"Line 8 xor - Condition is false" @string_const.34 = private global %string_descriptor <{ i8* getelementptr inbounds ([31 x i8], [31 x i8]* @string_const_data.33, i32 0, i32 0), i64 31 }> @53 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca i32, align 4 %b = alloca i32, align 4 store i32 1, i32* %a, align 4 store i32 0, i32* %b, align 4 %2 = load i32, i32* %a, align 4 %3 = load i32, i32* %b, align 4 %4 = and i32 %2, %3 %5 = icmp ne i32 %4, 0 br i1 %5, label %then, label %else then: ; preds = %.entry %6 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %6, i32 26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %.entry %7 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %7, i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) br label %ifcont ifcont: ; preds = %else, %then %8 = load i32, i32* %a, align 4 %9 = load i32, i32* %b, align 4 %10 = or i32 %8, %9 %11 = icmp ne i32 %10, 0 br i1 %11, label %then1, label %else2 then1: ; preds = %ifcont %12 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %12, i32 26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) br label %ifcont3 else2: ; preds = %ifcont %13 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.6, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %13, i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont3 ifcont3: ; preds = %else2, %then1 %14 = load i32, i32* %a, align 4 %15 = load i32, i32* %b, align 4 %16 = xor i32 %14, %15 %17 = icmp ne i32 %16, 0 br i1 %17, label %then4, label %else5 then4: ; preds = %ifcont3 %18 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.8, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %18, i32 28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) br label %ifcont6 else5: ; preds = %ifcont3 %19 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.10, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* %19, i32 29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 1) call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont6 ifcont6: ; preds = %else5, %then4 store i32 0, i32* %a, align 4 store i32 1, i32* %b, align 4 %20 = load i32, i32* %a, align 4 %21 = load i32, i32* %b, align 4 %22 = and i32 %20, %21 %23 = xor i32 %22, 1 %24 = icmp ne i32 %23, 0 br i1 %24, label %then7, label %else8 then7: ; preds = %ifcont6 %25 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.12, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* %25, i32 26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0), i32 1) br label %ifcont9 else8: ; preds = %ifcont6 %26 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.14, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @21, i32 0, i32 0), i8* %26, i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0), i32 1) call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @23, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont9 ifcont9: ; preds = %else8, %then7 %27 = load i32, i32* %b, align 4 %28 = load i32, i32* %a, align 4 %29 = xor i32 %27, %28 %30 = icmp ne i32 %29, 0 br i1 %30, label %then10, label %else11 then10: ; preds = %ifcont9 %31 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.16, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @25, i32 0, i32 0), i8* %31, i32 26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0), i32 1) br label %ifcont12 else11: ; preds = %ifcont9 %32 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.18, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @27, i32 0, i32 0), i8* %32, i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0), i32 1) call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @29, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @28, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont12 ifcont12: ; preds = %else11, %then10 %33 = load i32, i32* %b, align 4 %34 = load i32, i32* %a, align 4 %35 = xor i32 %33, %34 %36 = xor i32 %35, 1 %37 = icmp ne i32 %36, 0 br i1 %37, label %then13, label %else14 then13: ; preds = %ifcont12 %38 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.20, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @31, i32 0, i32 0), i8* %38, i32 26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0), i32 1) call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @33, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @32, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont15 else14: ; preds = %ifcont12 %39 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.22, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @35, i32 0, i32 0), i8* %39, i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @34, i32 0, i32 0), i32 1) br label %ifcont15 ifcont15: ; preds = %else14, %then13 store i32 1, i32* %a, align 4 store i32 1, i32* %b, align 4 %40 = load i32, i32* %a, align 4 %41 = load i32, i32* %b, align 4 %42 = and i32 %40, %41 %43 = icmp ne i32 %42, 0 br i1 %43, label %then16, label %else17 then16: ; preds = %ifcont15 %44 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.24, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @37, i32 0, i32 0), i8* %44, i32 26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0), i32 1) br label %ifcont18 else17: ; preds = %ifcont15 %45 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.26, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @39, i32 0, i32 0), i8* %45, i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0), i32 1) call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @40, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont18 ifcont18: ; preds = %else17, %then16 %46 = load i32, i32* %a, align 4 %47 = load i32, i32* %b, align 4 %48 = or i32 %46, %47 %49 = icmp ne i32 %48, 0 br i1 %49, label %then19, label %else20 then19: ; preds = %ifcont18 %50 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.28, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @43, i32 0, i32 0), i8* %50, i32 26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0), i32 1) br label %ifcont21 else20: ; preds = %ifcont18 %51 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.30, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @45, i32 0, i32 0), i8* %51, i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @44, i32 0, i32 0), i32 1) call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @47, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @46, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont21 ifcont21: ; preds = %else20, %then19 %52 = load i32, i32* %a, align 4 %53 = load i32, i32* %b, align 4 %54 = xor i32 %52, %53 %55 = icmp ne i32 %54, 0 br i1 %55, label %then22, label %else23 then22: ; preds = %ifcont21 %56 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.32, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @49, i32 0, i32 0), i8* %56, i32 30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @48, i32 0, i32 0), i32 1) call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @51, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @50, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont24 else23: ; preds = %ifcont21 %57 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.34, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @53, i32 0, i32 0), i8* %57, i32 31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @52, i32 0, i32 0), i32 1) br label %ifcont24 ifcont24: ; preds = %else23, %then22 br label %return return: ; preds = %ifcont24 br label %FINALIZE_SYMTABLE_logical3 FINALIZE_SYMTABLE_logical3: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) lfortran-0.63.0/tests/reference/cpp-program3-7ea69db.stdout0000664000175000017500000000220015174404631023627 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { float func1(float a, float b); float func2(float a, float b); } // Implementations namespace { float func1(float a, float b) { float c; c = a + b; c = func2(c, c); return c; } float func2(float a, float b) { float c; c = a*b; return c; } void main2() { float x; float y; float z; x = 5.00000000000000000e+00; y = 2.00000000000000000e+00; z = x*y; std::cout << "10.0 ==" << " " << z << std::endl; z = func1(x, y); std::cout << "49.0 ==" << " " << z << std::endl; z = func2(x, y); std::cout << "10.0 ==" << " " << z << std::endl; } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/asr-string_slice2-473fb60.json0000664000175000017500000000074315174404631024142 0ustar alastairalastair{ "basename": "asr-string_slice2-473fb60", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/string_slice2.f90", "infile_hash": "f3995fe57e4845b075c37fa64078352880de67388d65b1a68c666e31", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-string_slice2-473fb60.stderr", "stderr_hash": "c3a382633b8a93827775482c6d6739623eddd1e010dcf1598d8f8a5d", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-modules_11-dd72b29.stdout0000664000175000017500000001577115174404631024006 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { access_externally: (Program (SymbolTable 4 { access_internally: (ExternalSymbol 4 access_internally 2 access_internally modules_11_module11 [] access_internally Public ), i: (ExternalSymbol 4 i 2 i modules_11_module11 [] i Public ), j: (ExternalSymbol 4 j 2 j modules_11_module11 [] j Public ) }) access_externally [modules_11_module11] [(Print (StringFormat () [(StringConstant "j = " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 4 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 4 access_internally () [] () .false. )] ), modules_11_module11: (Module (SymbolTable 2 { access_internally: (Function (SymbolTable 3 { }) access_internally (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(StringConstant "i = " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), i: (Variable 2 i [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) modules_11_module11 () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-open1-9127585.json0000664000175000017500000000071715174404631022747 0ustar alastairalastair{ "basename": "ast_f90-open1-9127585", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/open1.f90", "infile_hash": "932467cb6b7bcbf97a0b9a7c90ea1ca8074bde26145accfc0bb252c2", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-open1-9127585.stdout", "stdout_hash": "6d193dc22ef86174299ec315108e34a1ae76e1b5ddcf0f3dbeef4567", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-functions_05-adf0d8b.json0000664000175000017500000000075615174404631024130 0ustar alastairalastair{ "basename": "asr-functions_05-adf0d8b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_05.f90", "infile_hash": "cf4cc8e65f95bcf5b5aacbb6d16d2aa40ef2f4c8442d1cb19b680a35", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_05-adf0d8b.stdout", "stdout_hash": "581fef0ce23daf3419da10581d68be61a8450ed0a9e512e7ca4c4a6e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_where-where_02-1839d96.json0000664000175000017500000000077515174404631024322 0ustar alastairalastair{ "basename": "pass_where-where_02-1839d96", "cmd": "lfortran --pass=where --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/where_02.f90", "infile_hash": "d77bcdf887423550fb6073875746e6b4af104d344e645f7f3753eb1d", "outfile": null, "outfile_hash": null, "stdout": "pass_where-where_02-1839d96.stdout", "stdout_hash": "b475162a7c4e8d07f6ad6c86702aeb6deda05380715ea1edcf58dc56", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-subroutine4-a425266.json0000664000175000017500000000072615174404631023575 0ustar alastairalastair{ "basename": "asr-subroutine4-a425266", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/subroutine4.f90", "infile_hash": "06ca8a1c322b25fe9280c43f558f6fa92e1a4843b6f6b77e206fdf4e", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutine4-a425266.stdout", "stdout_hash": "dbecb387f33ac5c1f6884026635dc1b9340846e6e640758dd04ed630", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_typing2-1e706a4.json0000664000175000017500000000077615174404631024663 0ustar alastairalastair{ "basename": "asr-implicit_typing2-1e706a4", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/errors/implicit_typing2.f90", "infile_hash": "36b4bb1882db636cc72a4e0b458d197bd21563dac2e0aa0640803ca9", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit_typing2-1e706a4.stderr", "stderr_hash": "5a5d770bfc817e1cddf9a5567f3b695bcb88dffa5b3ffb694c57df41", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-kind_star_of_complex-445a788.stderr0000664000175000017500000000023015174404631026036 0ustar alastairalastairsemantic error: Expected initialization expression for kind --> tests/errors/kind_star_of_complex.f90:3:13 | 3 | complex(*) a | ^ lfortran-0.63.0/tests/reference/ast-program_without_line_01-9cd45b3.json0000664000175000017500000000100115174404631026204 0ustar alastairalastair{ "basename": "ast-program_without_line_01-9cd45b3", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/program_without_line_01.f90", "infile_hash": "16c0177d21a94c7cdb24606167def8b7d93e9c927778d13b8ec1ae92", "outfile": null, "outfile_hash": null, "stdout": "ast-program_without_line_01-9cd45b3.stdout", "stdout_hash": "cecb5013af867fa1849c74cf81134bb3505379e5153c7e8839a48508", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-loop_test-5d89970.json0000664000175000017500000000072715174404631023343 0ustar alastairalastair{ "basename": "asr-loop_test-5d89970", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/loop_test.f90", "infile_hash": "aed46db1607054f287d564d1050191e11ff8d7af86462aa07aeb685b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-loop_test-5d89970.stderr", "stderr_hash": "b7b3840a887c92453850d954f2bb22da6f6c1301b87b7681a2ded5e6", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-substring_endidx-0f7e2c9.stderr0000664000175000017500000000024115174404631025355 0ustar alastairalastairsemantic error: Substring end index at must be of type integer --> tests/errors/substring_endidx.f90:4:17 | 4 | print*, s(1:5.2) | ^^^ lfortran-0.63.0/tests/reference/asr-implicit3-ffc1655.json0000664000175000017500000000106215174404631023347 0ustar alastairalastair{ "basename": "asr-implicit3-ffc1655", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit3.f90", "infile_hash": "d420be5e23fbf051820b7bfefbf122bf9a2386da38e30d985d425f92", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit3-ffc1655.stdout", "stdout_hash": "210db36bd5288699084a6f59deb25e4e7c45defacdc0a305b21c5715", "stderr": "asr-implicit3-ffc1655.stderr", "stderr_hash": "1a25b547a57dfefeb2ed4a563a1ef4bbac1be585cdb54cf977279ba1", "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-logical3-4bbf8ea.stderr0000664000175000017500000000047715174404631024033 0ustar alastairalastairwarning: .xor. is an LFortran extension --> tests/../integration_tests/logical3.f90:24:5 | 24 | if (a .xor. b) then | ^^^^^^^^^ LFortran extension warning: .xor. is an LFortran extension --> tests/../integration_tests/logical3.f90:74:5 | 74 | if (a .xor. b) then | ^^^^^^^^^ LFortran extension lfortran-0.63.0/tests/reference/llvm-nested_03-2eacab7.json0000664000175000017500000000075015174404631023553 0ustar alastairalastair{ "basename": "llvm-nested_03-2eacab7", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_03.f90", "infile_hash": "690c7461fd0cb288a4f72f5fd09663a777ae1ba9f4a39dfdc5727c36", "outfile": null, "outfile_hash": null, "stdout": "llvm-nested_03-2eacab7.stdout", "stdout_hash": "eca11ccd1c7f628d09fcda6fbc8ae87c1e36098840cc7b78f277d448", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor7-4734850.json0000664000175000017500000000077015174404631026320 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor7-4734850", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor7.f90", "infile_hash": "67aeb717d19dca60cfa9d8bb49195e781ef549a0abd3b08f5d09771b", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor7-4734850.stdout", "stdout_hash": "310c4c62acb4d50c9ebec1fb6e6937ccf2d324e807bccbd08206c7e4", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootlfortran-0.63.0/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-modules_45-db3a04a.jsonlfortran-0.63.0/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-module0000664000175000017500000000123415174404631034775 0ustar alastairalastair{ "basename": "pass_pass_array_by_data_transform_optional_argument_functions-modules_45-db3a04a", "cmd": "lfortran --pass=pass_array_by_data,transform_optional_argument_functions --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_45.f90", "infile_hash": "d68539c460764050c432f216e8ceed7eded8bf09258747500769b39e", "outfile": null, "outfile_hash": null, "stdout": "pass_pass_array_by_data_transform_optional_argument_functions-modules_45-db3a04a.stdout", "stdout_hash": "c168665542e4f9d538e338a5d79cc6cbadbdaf7ea3f4b66494c930b9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-subroutine8-af54645.stdout0000664000175000017500000000327215174404631024240 0ustar alastairalastair(TranslationUnit [(Subroutine a [] [(SimpleAttribute AttrRecursive ) (SimpleAttribute AttrPure )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) (Subroutine b [] [(SimpleAttribute AttrPure ) (SimpleAttribute AttrElemental )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) (Subroutine c [] [(SimpleAttribute AttrElemental ) (SimpleAttribute AttrPure )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) (Subroutine d [] [(SimpleAttribute AttrPure ) (SimpleAttribute AttrRecursive )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) (Subroutine e [] [(SimpleAttribute AttrImpure ) (SimpleAttribute AttrElemental ) (SimpleAttribute AttrModule )] () () [] [] [] [] [] [] [] )] ) lfortran-0.63.0/tests/reference/asr-template_error_03-b5d4715.stderr0000664000175000017500000000041515174404631025247 0ustar alastairalastairsemantic error: The restriction argument func_arg_real should have a return value --> tests/errors/template_error_03.f90:33:33 | 33 | instantiate add_t(real, func_arg_real), only: add_real => add_generic | ^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/tokens-expr7-bf90751.stdout0000664000175000017500000000026515174404631023530 0ustar alastairalastair(TOKEN "integer" 5_int32) (NEWLINE) (TOKEN "integer" 5_int64) (NEWLINE) (TOKEN "integer" 5_l) (NEWLINE) (TOKEN "integer" 5__l_3) (NEWLINE) (TOKEN "integer" 5__l_3_) (NEWLINE) (EOF) lfortran-0.63.0/tests/reference/asr-statement1-60b7ed3.stdout0000664000175000017500000002600315174404631024105 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { statement1: (Function (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), q: (Function (SymbolTable 3 { q_return_var_name: (Variable 3 q_return_var_name [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] In () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) q (FunctionType [(Real 8)] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [(Assignment (Var 3 q_return_var_name) (LogicalNot (LogicalBinOp (RealCompare (Var 2 a) Eq (Var 2 b) (Logical 4) () ) And (RealCompare (Var 2 c) Eq (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) () .false. .false. )] (Var 3 q_return_var_name) Public .false. .true. () ), x: (Variable 2 x [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) statement1 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/ast-modules_04-a8954ed.stdout0000664000175000017500000000570115174404631024010 0ustar alastairalastair(TranslationUnit [(Module modules_04_a (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [(Subroutine b [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "b()" ())] () )] [] [] )] ) (Program modules_04 () [(Use [(SimpleAttribute AttrIntrinsic )] iso_fortran_env [] .false. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(SubroutineCall 0 f [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Subroutine f [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(Use [] modules_04_a [(UseSymbol b () )] .true. () )] [] [] [] [(SubroutineCall 0 b [] [] [] [] () )] [] [] ) (Function g [] [(AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(Use [] modules_04_a [(UseSymbol b () )] .true. () )] [] [] [] [(SubroutineCall 0 b [] [] [] [] () ) (Assignment 0 g 5 () )] [] [] )] )] ) lfortran-0.63.0/tests/reference/wat-empty-681c1d1.json0000664000175000017500000000066715174404631022540 0ustar alastairalastair{ "basename": "wat-empty-681c1d1", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/empty.f90", "infile_hash": "d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f", "outfile": null, "outfile_hash": null, "stdout": "wat-empty-681c1d1.stdout", "stdout_hash": "0ca4269517c69a129d718045702784b3fb3462d6f70b3e15e0a1ce75", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-implied_do_loop1-1d0df34.json0000664000175000017500000000071515174404631024702 0ustar alastairalastair{ "basename": "run-implied_do_loop1-1d0df34", "cmd": "lfortran --no-color {infile}", "infile": "tests/implied_do_loop1.f90", "infile_hash": "7443c3a7fc3b197f6fc90dcb12fac71feecd7e3895b3b32b0c6fad91", "outfile": null, "outfile_hash": null, "stdout": "run-implied_do_loop1-1d0df34.stdout", "stdout_hash": "ace582716591b04fdfc6236ef01b77a190242deeba1acaed9a726244", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-write_12-63d1bdf.json0000664000175000017500000000071215174404631023200 0ustar alastairalastair{ "basename": "run-write_12-63d1bdf", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/write_12.f90", "infile_hash": "42394d54c876f13509a1b5262f4795cab9e6250def7e7a2ff587ae06", "outfile": null, "outfile_hash": null, "stdout": "run-write_12-63d1bdf.stdout", "stdout_hash": "fe139915db32be5a897a8db16036fbc9bddccb6ce448c78ea2562a0f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_error_07b-d39ea05.stderr0000664000175000017500000000034015174404631025471 0ustar alastairalastairwarning: Parameter combine is unused in semigroup --> tests/errors/template_error_07b.f90:6:5 - 9:1 | 6 | requirement semigroup(t, combine) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 9 | | ...^ lfortran-0.63.0/tests/reference/ast-real8_1-0d3012c.stdout0000664000175000017500000000050115174404631023152 0ustar alastairalastair(TranslationUnit [(Function f [] [(AttrType TypeReal [(() 8 Value)] () () None )] () () () [] [] [] [] [] [] [] )] ) lfortran-0.63.0/tests/reference/ast-data_stmt_with_implied_do_loop-476da0f.json0000664000175000017500000000104115174404631027676 0ustar alastairalastair{ "basename": "ast-data_stmt_with_implied_do_loop-476da0f", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/data_stmt_with_implied_do_loop.f", "infile_hash": "ca1800c3b10a5aa2cddbafc00386d21ebc63b87593eb73986802f802", "outfile": null, "outfile_hash": null, "stdout": "ast-data_stmt_with_implied_do_loop-476da0f.stdout", "stdout_hash": "67fa9708e363358480f7ad635e454859e57fa459fe74015475a99688", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_global_stmts-expr2-22f4149.json0000664000175000017500000000076415174404631025311 0ustar alastairalastair{ "basename": "pass_global_stmts-expr2-22f4149", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr2.f90", "infile_hash": "d666975e3f2e2c0cc5c739b85bb21073accdf5692bcb64c9e0278d62", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-expr2-22f4149.stdout", "stdout_hash": "70869329417ac6dc7ab0c9e0c5fd32bb6274531f213d19390d4895f2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-allow_implicit_interface3-7ef92cc.stdout0000664000175000017500000002647415174404631027237 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { ssyr2: (Function (SymbolTable 2 { info: (Variable 2 info [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lsame: (Function (SymbolTable 5 { lsame_arg_0: (Variable 5 lsame_arg_0 [] Unspecified () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lsame_arg_1: (Variable 5 lsame_arg_1 [] Unspecified () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lsame_return_var_name: (Variable 5 lsame_return_var_name [] ReturnVar () () Default (Logical 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) lsame (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] (Logical 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 lsame_arg_0) (Var 5 lsame_arg_1)] [] (Var 5 lsame_return_var_name) Public .false. .false. () ), uplo: (Variable 2 uplo [] Unspecified () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ssyr2 (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 uplo)] [(Assignment (Var 2 info) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (If () (LogicalBinOp (LogicalNot (FunctionCall 2 lsame () [((Var 2 uplo)) ((StringConstant "U" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (Logical 4) () () ) (Logical 4) () ) And (LogicalNot (FunctionCall 2 lsame () [((Var 2 uplo)) ((StringConstant "L" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (Logical 4) () () ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 2 info) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. )] [(Assignment (Var 2 info) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. )] ) (Return)] () Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/llvm-issue532-d63b703.json0000664000175000017500000000072015174404631023132 0ustar alastairalastair{ "basename": "llvm-issue532-d63b703", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/issue532.f90", "infile_hash": "75f4785bea0a877f7a902640ffcc5d276bd955349ff3df1639d6e6b7", "outfile": null, "outfile_hash": null, "stdout": "llvm-issue532-d63b703.stdout", "stdout_hash": "0e306cadb7a93ad7b7a90f688ed68c3b5c752ec2cbf65bf6a830b45a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_18-e69cac3.stdout0000664000175000017500000003141515174404631025264 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_10: (Program (SymbolTable 5 { 1_t_1_i: (ExternalSymbol 5 1_t_1_i 3 i t_1 [] i Public ), 1_t_1_t_1: (ExternalSymbol 5 1_t_1_t_1 2 t_1 derived_types_18_module_1 [] t_1 Public ), 1_t_2_r: (ExternalSymbol 5 1_t_2_r 4 r t_2 [] r Public ), t_1: (ExternalSymbol 5 t_1 2 t_1 derived_types_18_module_1 [] t_1 Public ), t_2: (ExternalSymbol 5 t_2 2 t_2 derived_types_18_module_1 [] t_2 Public ), type_1: (Variable 5 type_1 [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 5 t_1 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), type_2: (Variable 5 type_2 [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 5 t_2 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) derived_types_10 [derived_types_18_module_1] [(Assignment (StructInstanceMember (Var 5 type_1) 5 1_t_1_i (Integer 4) () ) (IntegerConstant 123 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 type_2) 5 1_t_1_t_1 (StructType [(Integer 4)] [] .true. .false. ) () ) (Var 5 type_1) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 type_2) 5 1_t_2_r (Real 4) () ) (RealConstant 10.000000 (Real 4) ) () .false. .false. ) (If () (IntegerCompare (StructInstanceMember (Var 5 type_2) 5 1_t_1_i (Integer 4) () ) NotEq (IntegerConstant 123 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (StructInstanceMember (Var 5 type_2) 5 1_t_2_r (Real 4) () ) NotEq (RealConstant 10.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ), derived_types_18_module_1: (Module (SymbolTable 2 { t_1: (Struct (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) t_1 (StructType [(Integer 4)] [] .true. .false. ) [] [i] [] Source Public .false. .false. [] () () [] ), t_2: (Struct (SymbolTable 4 { r: (Variable 4 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) t_2 (StructType [(Real 4)] [] .true. .false. ) [] [r] [] Source Public .false. .false. [] () 2 t_1 [] ) }) derived_types_18_module_1 () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-modules_24-996af24.json0000664000175000017500000000075015174404631023357 0ustar alastairalastair{ "basename": "asr-modules_24-996af24", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_24.f90", "infile_hash": "cc2ada95991347eeecc7b723bd8553ddb59fa5da19b420154a4d66bc", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_24-996af24.stdout", "stdout_hash": "40d6c370292e0df0e06b9af2ad93b38077ff80c80468026b9ec419a9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-fixed_form_implicit2-4d3e56c.stdout0000664000175000017500000000053315174404631026121 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { }) main [] [] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-derived_types_03-1824805.stdout0000664000175000017500000000047115174404631025432 0ustar alastairalastairprogram derived_types_03 implicit none type :: X integer :: i end type X type(X) :: b contains subroutine Y() type :: A integer :: i end type A type(A) :: b end subroutine Y integer function Z() type :: A integer :: i end type A type(A) :: b Z = 5 end function Z end program derived_types_03 lfortran-0.63.0/tests/reference/asr-real_dp_01-b41f13e.stdout0000664000175000017500000001165615174404631023731 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { real_dp_01: (Program (SymbolTable 2 { v: (Variable 2 v [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zero: (Variable 2 zero [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) real_dp_01 [] [(Assignment (Var 2 zero) (RealConstant 0.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 v) (Cast (RealConstant 1.050000 (Real 4) ) RealToReal (Real 8) (RealConstant 1.050000 (Real 8) ) () ) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 1.050000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x) (Var 2 v) (Var 2 zero)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/run-array_bounds_check_10-b69c804.json0000664000175000017500000000074315174404631025543 0ustar alastairalastair{ "basename": "run-array_bounds_check_10-b69c804", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_10.f90", "infile_hash": "fd720e812db110a0b31e5f164979aceb42e7238f0e242337197a4883", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_10-b69c804.stderr", "stderr_hash": "0cd32dea58af769d15c852180e003467770100200014ebbbedf6a2ab", "returncode": 1 }lfortran-0.63.0/tests/reference/asr_preprocess-cpp1-515bcd9.json0000664000175000017500000000074415174404631024565 0ustar alastairalastair{ "basename": "asr_preprocess-cpp1-515bcd9", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp1.f90", "infile_hash": "ac5c43ef61efaf9750763941c8ee309b88d00bdfc414901bcd6d4fbe", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp1-515bcd9.stderr", "stderr_hash": "4ad2be665b1c2eb37d4740ec8df289a5635a32c470fa121e66ab853d", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-derived_types_02-35d66e0.json0000664000175000017500000000074515174404631024547 0ustar alastairalastair{ "basename": "ast-derived_types_02-35d66e0", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/derived_types_02.f90", "infile_hash": "97982d2ac648e6b5260dc06a91a3e121668752f5b642ff81d4efba5f", "outfile": null, "outfile_hash": null, "stdout": "ast-derived_types_02-35d66e0.stdout", "stdout_hash": "20fd9b173cf3da467ad0ece417b92d024a9cb71adca5409494f60163", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_disable_style_suggestion_and_warnings-save4-4eccf46.stdout0000664000175000017500000001303415174404631033032 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { save4: (Program (SymbolTable 2 { f: (Function (SymbolTable 3 { x: (Variable 3 x [] Local (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(If () (IntegerCompare (Var 3 x) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Print (StringConstant "x is 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] () Public .false. .false. () ), y: (Variable 2 y [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) save4 [] [(If () (IntegerCompare (Var 2 y) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Print (StringConstant "y is 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-nested_02-726d5e8.stdout0000664000175000017500000000734415174404631023731 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [3 x i8] c"b()" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data, i32 0, i32 0), i64 3 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_nested_02_a_b() { .entry: %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %0, i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) call void @b.__module_nested_02_a_c() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return ret void } define void @b.__module_nested_02_a_c() { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %1 = alloca i64, align 8 %2 = alloca i32, align 4 store i32 5, i32* %2, align 4 %3 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %1, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %2) %4 = load i64, i64* %1, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 8 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_c FINALIZE_SYMTABLE_c: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @__module_nested_02_a_b() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_nested_02 FINALIZE_SYMTABLE_nested_02: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-save3-025da43.stdout0000664000175000017500000000416715174404631022760 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { var: (Variable 2 var [] Local (RealConstant 0.000000 (Real 4) ) (RealConstant 0.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/llvm-return_03-3f7087d.stderr0000664000175000017500000000026615174404631023742 0ustar alastairalastairstyle suggestion: Use '>' instead of '.gt.' --> tests/../integration_tests/return_03.f90:10:15 | 10 | if (i .GT. 5) then | ^^^^ help: write this as '>' lfortran-0.63.0/tests/reference/julia-expr_11-ab53b8f.json0000664000175000017500000000105015174404631023320 0ustar alastairalastair{ "basename": "julia-expr_11-ab53b8f", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/expr_11.f90", "infile_hash": "1d3eee7b6af3504909d82d761867baf90d2f74b36edc4a6eac4e341f", "outfile": null, "outfile_hash": null, "stdout": "julia-expr_11-ab53b8f.stdout", "stdout_hash": "da36777fb96cf532038d909e0d70c196fb8d519c9f86d86e7e903336", "stderr": "julia-expr_11-ab53b8f.stderr", "stderr_hash": "3982eb2e7c64c27254305941b9a7f4d9f69369c801f76c5dece5e3dd", "returncode": 0 }lfortran-0.63.0/tests/reference/ast-subroutine9-8ecec78.stdout0000664000175000017500000000446715174404631024420 0ustar alastairalastair(TranslationUnit [(Subroutine a [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [] ImportNone () )] [(ImplicitNone [] () )] [] [] [] [] ) (Subroutine b [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [] ImportAll () )] [(ImplicitNone [] () )] [] [] [] [] ) (Subroutine c [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [a b] ImportDefault () )] [(ImplicitNone [] () )] [] [] [] [] ) (Subroutine d [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [a b] ImportDefault () )] [(ImplicitNone [] () )] [] [] [] [] ) (Subroutine e [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [a b] ImportOnly () )] [(ImplicitNone [] () )] [] [] [] [] ) (Subroutine f [] [] () () [] [(Import [a b] ImportDefault () ) (Import [c] ImportDefault () ) (Import [d e f] ImportDefault () )] [(ImplicitNone [] () )] [] [] [] [] )] ) lfortran-0.63.0/tests/reference/fortran-expr_05-1df98eb.stdout0000664000175000017500000000247115174404631024263 0ustar alastairalastairprogram expr_05 implicit none integer(4) :: a integer(4) :: b integer(4) :: c logical(4) :: l integer(4) :: x a = 3 b = 4 c = 5 x = 2*3 x = (-2)*3 x = 2*(-3) x = (-2)*(-3) x = (-2)*(-3) x = -2**3 x = -2**3 x = -2*3 x = 2**(-3) x = a x = a x = a*b x = (-a)*b x = -a*b x = a*(-b) x = (-a)*(-b) x = a*b*c x = (-a)*b*c x = a*(-b)*c x = a*b*(-c) x = (-a)*(-b)*(-c) x = 3 + 4*5 x = (3 + 4)*5 x = a*(b + 5*(c - b)) x = (3 - 2*a*b)*5 x = ((-2)*a*b + 3)*5 x = ((-2)*a*b + 3*b*a)*5 x = ((-2)*a/b + (a + (-b))**2)*5 x = (2*a*b + 3)*5 x = a**2 + 2*a*b + b**2 x = (a + b)*(a - b) x = (a + b)**2 x = (a + b)*(a**2 - a*b + b**2) x = (a - b)*(a + b)*(a**2 + b**2) x = 1/(a*b) x = 1/a*b x = 1/a*b x = 1/((a*b + 1)) x = 1/a*b + 1 x = 1/a*b + 1 x = 2 - (-2) x = a - ((-b) - c) x = a - (-2)*b x = c - (-2)/b x = a - (2 + 3 + 4) x = a + 2 + 3 + 4 x = 2*a + a*b - (a*b + 2*a) x = 2*a + a*b - (a*b - 2*a) x = a - (b - (c - 1)) x = a - b x = a - (b - c) x = a - b - c x = -(a - ((-b) + (-b) - (-b)*b)) x = -(3 + 5) x = -(a + 5) l = x**3*4 + a <= 4 .or. x < 5 .and. x < 6 .eqv. .true. .or. .not. .false. .and. .true. l = l .or. l .and. l l = (l .or. l) .and. l l = l .and. l .or. l l = l .and. (l .or. l) l = l .or. .not. l .and. l l = l .or. l .and. .not. l l = l .and. l .or. .not. l l = l .and. .not. l .or. l l = l .and. .not. (l .or. l) end program expr_05 lfortran-0.63.0/tests/reference/ast_f90-subroutines_10-779ade9.stdout0000664000175000017500000000073315174404631025403 0ustar alastairalastairprogram subroutines_10 implicit none real :: x call subroutines_10_sub(x, 3, *100, *200) if (x < 0 .and. x > 10) then error stop end if stop 100 print *, "Negative input value" error stop 200 print *, "Input value too large" error stop end program subroutines_10 subroutine subroutines_10_sub(x, i, *, *) real, intent(out) :: x integer, intent(in) :: i if (i < 0) then return 1 end if if (i > 10) then return 2 end if x = i end subroutine subroutines_10_sub lfortran-0.63.0/tests/reference/asr-expr_07-ec2c3a6.stdout0000664000175000017500000000502515174404631023361 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { expr_07: (Program (SymbolTable 2 { x: (Variable 2 x [] Local (RealBinOp (RealConstant 3.300000 (Real 4) ) Add (RealConstant 6.000000 (Real 4) ) (Real 4) (RealConstant 9.300000 (Real 4) ) ) (RealConstant 9.300000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) expr_07 [] [(Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_openmp-pragma1-f8a3fde.stdout0000664000175000017500000001433515174404631025103 0ustar alastairalastair(TranslationUnit [(Subroutine a1 [(n) (A) (B)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(A [(1 n DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(B [(1 n DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(Pragma 0 OMPPragma .false. "parallel do" [] () ) (DoLoop 0 () 0 i 2 N () [(Assignment 0 (FuncCallOrArray B [] [(() i () 0)] [] [] [] ) (/ (+ (FuncCallOrArray A [] [(() i () 0)] [] [] [] ) (FuncCallOrArray A [] [(() (- i 1) () 0)] [] [] [] )) 2) () )] () () ) (Pragma 0 OMPPragma .true. "parallel do" [] () )] [] [] ) (Subroutine parallel_sum [(n) (a)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(a [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(partial_sum [] [] () () None ()) (total_sum [] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 partial_sum 0 () ) (Assignment 0 total_sum 0 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Pragma 0 OMPPragma .false. "parallel" [(String "private(partial_sum)" ()) (String "shared(total_sum)" ())] () ) (Pragma 0 OMPPragma .false. "do" [] () ) (DoLoop 0 () 0 i 1 n () [(Assignment 0 partial_sum (+ partial_sum (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () ) (Pragma 0 OMPPragma .true. "do" [] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! TODO:" ) (Comment "! !$omp critical" ) (Comment "! total_sum = total_sum + partial_sum" ) (Comment "! !$omp end critical" )] ) ) (Pragma 0 OMPPragma .true. "parallel" [] () )] [] [] )] ) lfortran-0.63.0/tests/reference/ast-enum_decl_without_start_program-9ae6425.json0000664000175000017500000000103115174404631030052 0ustar alastairalastair{ "basename": "ast-enum_decl_without_start_program-9ae6425", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/enum_decl_without_start_program.f90", "infile_hash": "909085f2f597ac1a26957705cc3df72bd7773cebc9abb83269f1fea3", "outfile": null, "outfile_hash": null, "stdout": "ast-enum_decl_without_start_program-9ae6425.stdout", "stdout_hash": "ace71891d74fa8904e1c67e993d35d3b1e3a20bde48971021a537e3c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-associate_04-8bcb3df.json0000664000175000017500000000075615174404631024075 0ustar alastairalastair{ "basename": "asr-associate_04-8bcb3df", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/associate_04.f90", "infile_hash": "902a12c91e1df67575c96534b3b5a55ca93e85aa0777e689ecc1334c", "outfile": null, "outfile_hash": null, "stdout": "asr-associate_04-8bcb3df.stdout", "stdout_hash": "06f50949825297b26b9e42dc21e4edab39421da5dcbc8ba406265737", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-allocate_02-4f6b634.json0000664000175000017500000000073115174404631023645 0ustar alastairalastair{ "basename": "llvm-allocate_02-4f6b634", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/allocate_02.f90", "infile_hash": "ad03592673976aa7fa7af3ba41187e932e00cba7473a89be8b00403d", "outfile": null, "outfile_hash": null, "stdout": "llvm-allocate_02-4f6b634.stdout", "stdout_hash": "fd368afc409f3a67704e9b5b20b631829c48750e3fadb7f9d3483392", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/rename_symbol-collect_occurence1-98d138a.stdout0000664000175000017500000000175215174404631027556 0ustar alastairalastair[{"kind":9,"location":{"range":{"start":{"character":12,"line":9},"end":{"character":20,"line":9}},"uri":"uri"},"name":"abc"},{"kind":9,"location":{"range":{"start":{"character":1,"line":10},"end":{"character":4,"line":10}},"uri":"uri"},"name":"abc"},{"kind":9,"location":{"range":{"start":{"character":7,"line":10},"end":{"character":10,"line":10}},"uri":"uri"},"name":"abc"},{"kind":9,"location":{"range":{"start":{"character":10,"line":11},"end":{"character":13,"line":11}},"uri":"uri"},"name":"abc"},{"kind":9,"location":{"range":{"start":{"character":12,"line":2},"end":{"character":15,"line":2}},"uri":"uri"},"name":"abc"},{"kind":9,"location":{"range":{"start":{"character":10,"line":3},"end":{"character":13,"line":3}},"uri":"uri"},"name":"abc"},{"kind":9,"location":{"range":{"start":{"character":1,"line":4},"end":{"character":4,"line":4}},"uri":"uri"},"name":"abc"},{"kind":9,"location":{"range":{"start":{"character":10,"line":5},"end":{"character":13,"line":5}},"uri":"uri"},"name":"abc"}]lfortran-0.63.0/tests/reference/pass_array_op-modules_43-6930881.json0000664000175000017500000000101415174404631025265 0ustar alastairalastair{ "basename": "pass_array_op-modules_43-6930881", "cmd": "lfortran --pass=array_op --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_43.f90", "infile_hash": "ee51c0425b99849f984c011dfe475584384af4099c822103232f5b9f", "outfile": null, "outfile_hash": null, "stdout": "pass_array_op-modules_43-6930881.stdout", "stdout_hash": "f87b15530b1aa116682607a25e03a27877a09ded5ec7be4c7553e996", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-associate_08-570ac7d.stdout0000664000175000017500000015332715174404631024314 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { associate2: (Program (SymbolTable 7 { 1_t_1_i: (ExternalSymbol 7 1_t_1_i 3 i t_1 [] i Public ), 1_t_2_type_2: (ExternalSymbol 7 1_t_2_type_2 4 type_2 t_2 [] type_2 Public ), sub_1: (ExternalSymbol 7 sub_1 2 sub_1 associate_08_module_1 [] sub_1 Public ), sub_2: (ExternalSymbol 7 sub_2 2 sub_2 associate_08_module_1 [] sub_2 Public ), t_1: (ExternalSymbol 7 t_1 2 t_1 associate_08_module_1 [] t_1 Public ), t_2: (ExternalSymbol 7 t_2 2 t_2 associate_08_module_1 [] t_2 Public ), t_2_array: (Variable 7 t_2_array [] Local () () Default (Allocatable (Array (StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .false. .false. ) [(() ())] DescriptorArray ) ) 7 t_2 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), type_1: (Variable 7 type_1 [] Local () () Default (StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .true. .false. ) 7 t_2 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) associate2 [associate_08_module_1] [(SubroutineCall 7 sub_1 () [((Var 7 type_1)) ((IntegerConstant 123 (Integer 4) Decimal))] () .false. ) (If () (IntegerCompare (StructInstanceMember (ArrayItem (StructInstanceMember (Var 7 type_1) 7 1_t_2_type_2 (Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Integer 4)] [] .true. .false. ) ColMajor () ) 7 1_t_1_i (Integer 4) () ) NotEq (IntegerConstant 123 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(StructInstanceMember (ArrayItem (StructInstanceMember (Var 7 type_1) 7 1_t_2_type_2 (Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Integer 4)] [] .true. .false. ) ColMajor () ) 7 1_t_1_i (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (ExplicitDeallocate [(StructInstanceMember (Var 7 type_1) 7 1_t_2_type_2 (Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () )] )] ), associate_08_module_1: (Module (SymbolTable 2 { sub_1: (Function (SymbolTable 5 { 1_t_1_i: (ExternalSymbol 5 1_t_1_i 3 i t_1 [] i Public ), 1_t_2_type_2: (ExternalSymbol 5 1_t_2_type_2 4 type_2 t_2 [] type_2 Public ), associate_block: (AssociateBlock (SymbolTable 8 { target: (Variable 8 target [] Local () () Default (Pointer (Integer 4) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) associate_block [(Associate (Var 8 target) (StructInstanceMember (ArrayItem (StructInstanceMember (Var 5 type_1) 5 1_t_2_type_2 (Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Integer 4)] [] .true. .false. ) ColMajor () ) 5 1_t_1_i (Integer 4) () ) ) (Assignment (Var 8 target) (Var 5 i) () .false. .false. )] ), i: (Variable 5 i [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), type_1: (Variable 5 type_1 [] InOut () () Default (StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .false. .false. ) 2 t_2 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub_1 (FunctionType [(StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .false. .false. ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 type_1) (Var 5 i)] [(Allocate [((StructInstanceMember (Var 5 type_1) 5 1_t_2_type_2 (Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] () () ())] () () () ) (AssociateBlockCall 5 associate_block )] () Public .true. .true. () ), sub_2: (Function (SymbolTable 6 { 1_t_2_type_2: (ExternalSymbol 6 1_t_2_type_2 4 type_2 t_2 [] type_2 Public ), associate_block: (AssociateBlock (SymbolTable 9 { 1_t_1_i: (ExternalSymbol 9 1_t_1_i 3 i t_1 [] i Public ), 1_t_2_type_2: (ExternalSymbol 9 1_t_2_type_2 4 type_2 t_2 [] type_2 Public ), target: (Variable 9 target [] Local () () Default (Pointer (StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .false. .false. ) ) 2 t_2 Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) associate_block [(Associate (Var 9 target) (ArrayItem (Var 6 progress) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .false. .false. ) ColMajor () ) ) (Assignment (StructInstanceMember (ArrayItem (StructInstanceMember (Var 9 target) 9 1_t_2_type_2 (Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Integer 4)] [] .true. .false. ) ColMajor () ) 9 1_t_1_i (Integer 4) () ) (IntegerConstant 345 (Integer 4) Decimal) () .false. .false. )] ), progress: (Variable 6 progress [] InOut () () Default (Allocatable (Array (StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .false. .false. ) [(() ())] DescriptorArray ) ) 2 t_2 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub_2 (FunctionType [(Allocatable (Array (StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .false. .false. ) [(() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 progress)] [(Allocate [((Var 6 progress) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] () () ())] () () () ) (Allocate [((StructInstanceMember (ArrayItem (Var 6 progress) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .false. .false. ) ColMajor () ) 6 1_t_2_type_2 (Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] () () ())] () () () ) (AssociateBlockCall 6 associate_block )] () Public .true. .true. () ), t_1: (Struct (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) t_1 (StructType [(Integer 4)] [] .true. .false. ) [] [i] [] Source Public .false. .false. [] () () [] ), t_2: (Struct (SymbolTable 4 { type_2: (Variable 4 type_2 [] Local () () Default (Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 t_1 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) t_2 (StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .true. .false. ) [] [type_2] [] Source Public .false. .false. [] () () [] ) }) associate_08_module_1 () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-expr1-32e30b1.stdout0000664000175000017500000000003315174404631022761 0ustar alastairalastair(TranslationUnit [5] ) lfortran-0.63.0/tests/reference/asr_clojure-functions_10-476558d.json0000664000175000017500000000102415174404631025352 0ustar alastairalastair{ "basename": "asr_clojure-functions_10-476558d", "cmd": "lfortran --show-asr --no-color --no-indent --clojure {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_10.f90", "infile_hash": "fe4afd6d0a7065df5d59b482ad1bc0447df5303dc8246e85aa192fe0", "outfile": null, "outfile_hash": null, "stdout": "asr_clojure-functions_10-476558d.stdout", "stdout_hash": "69ff6d8ae63dfa4efe489e562a63ff2bb9753bddee5b145606b55dc6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-classes1-d55a38c.json0000664000175000017500000000072015174404631023352 0ustar alastairalastair{ "basename": "llvm-classes1-d55a38c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/classes1.f90", "infile_hash": "2854104a42f1abb2d3573afedab08ac340e19b7d5151166ce3291182", "outfile": null, "outfile_hash": null, "stdout": "llvm-classes1-d55a38c.stdout", "stdout_hash": "8737a3c7e0e786a9126411fb4708d24b970ce7489186852434c90e70", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-subroutine3-fb7e0b8.stdout0000664000175000017500000000062415174404631024553 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define i32 @f() { .entry: %f = alloca i32, align 4 store i32 42, i32* %f, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return %0 = load i32, i32* %f, align 4 ret i32 %0 } lfortran-0.63.0/tests/reference/asr-nested_call_filter_01-2b1295b.json0000664000175000017500000000101115174404631025475 0ustar alastairalastair{ "basename": "asr-nested_call_filter_01-2b1295b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_call_filter_01.f90", "infile_hash": "8cec6df4b177816ae0e3fe2e6e58db32e27ffa4afb6640cbeabd017e", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_call_filter_01-2b1295b.stdout", "stdout_hash": "4187f93ea824817937355410871065d7e19cd2a046e9a5c0419fc047", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-intrinsics_05-5a73322.stdout0000664000175000017500000001366615174404631024545 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc4 = alloca %string_descriptor, align 8 %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca float, align 4 store float 0x3FF2CD9FC0000000, float* %x, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, float* %x) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry store float 0x3FF8B07560000000, float* %x, align 4 %14 = alloca i64, align 8 %15 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %14, i32 0, i32 0, i32 0, i32 0, i32 0, float* %x) %16 = load i64, i64* %14, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %15, i8** %17, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %16, i64* %18, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %20 = load i8*, i8** %19, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %22 = load i64, i64* %21, align 8 %23 = trunc i64 %22 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %20, i32 %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %24 = icmp eq i8* %15, null br i1 %24, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %2, i8* %15) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done store float 0x3FE85EFAC0000000, float* %x, align 4 %25 = alloca i64, align 8 %26 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %25, i32 0, i32 0, i32 0, i32 0, i32 0, float* %x) %27 = load i64, i64* %25, align 8 %28 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %26, i8** %28, align 8 %29 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %27, i64* %29, align 8 %30 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %31 = load i8*, i8** %30, align 8 %32 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %33 = load i64, i64* %32, align 8 %34 = trunc i64 %33 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %31, i32 %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %35 = icmp eq i8* %26, null br i1 %35, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free_alloc(i8* %2, i8* %26) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 br label %return return: ; preds = %free_done6 br label %FINALIZE_SYMTABLE_intrinsics_05 FINALIZE_SYMTABLE_intrinsics_05: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/llvm-complex_pow_test-2b160e8.stdout0000664000175000017500000000700215174404631025513 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> %complex_4 = type <{ float, float }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() %3 = alloca %complex_4, align 8 %4 = alloca %complex_4, align 8 %5 = alloca %complex_4, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca %complex_4, align 8 %y = alloca %complex_4, align 8 %z = alloca %complex_4, align 8 store %complex_4 <{ float 3.000000e+00, float 4.000000e+00 }>, %complex_4* %x, align 1 store %complex_4 <{ float 3.000000e+00, float 2.000000e+00 }>, %complex_4* %y, align 1 %6 = load %complex_4, %complex_4* %x, align 1 %7 = load %complex_4, %complex_4* %y, align 1 %8 = extractvalue %complex_4 %6, 0 %9 = extractvalue %complex_4 %6, 1 %10 = extractvalue %complex_4 %7, 0 %11 = extractvalue %complex_4 %7, 1 store %complex_4 %6, %complex_4* %5, align 1 store %complex_4 %7, %complex_4* %4, align 1 call void @_lfortran_complex_pow_32(%complex_4* %5, %complex_4* %4, %complex_4* %3) %12 = load %complex_4, %complex_4* %3, align 1 store %complex_4 %12, %complex_4* %z, align 1 %13 = alloca i64, align 8 %14 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info, i32 0, i32 0), i64* %13, i32 0, i32 0, i32 0, i32 0, i32 0, %complex_4* %z) %15 = load i64, i64* %13, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %14, i8** %16, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %15, i64* %17, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %19 = load i8*, i8** %18, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %21 = load i64, i64* %20, align 8 %22 = trunc i64 %21 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %19, i32 %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %23 = icmp eq i8* %14, null br i1 %23, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %14) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_complex2 FINALIZE_SYMTABLE_complex2: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_complex_pow_32(%complex_4*, %complex_4*, %complex_4*) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-incompatible_dimension_assignment_arr1-28b49c0.stderr0000664000175000017500000000030515174404631031607 0ustar alastairalastairsemantic error: Different shape for array assignment on dimension 1(1 and 3) --> tests/errors/incompatible_dimension_assignment_arr1.f90:7:5 | 7 | arr1 = [1, 2, 3] | ^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-continue_compilation_2-a6145a1.stderr0000664000175000017500000010436315174404631026362 0ustar alastairalastairsyntax error: End module name does not match module name --> tests/errors/continue_compilation_2.f90:20:1 - 22:28 | 20 | module my_module | ^^^^^^^^^^^^^^^^... ... | 22 | end module wrong_module_name | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^ syntax error: End subroutine name does not match subroutine name --> tests/errors/continue_compilation_2.f90:44:5 - 46:33 | 44 | subroutine my_subroutine1() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 46 | end subroutine different_name | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ syntax error: End function name does not match function name --> tests/errors/continue_compilation_2.f90:48:5 - 51:32 | 48 | function my_function() result(res) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 51 | end function not_my_function | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ syntax error: End subroutine name does not match subroutine name --> tests/errors/continue_compilation_2.f90:53:5 - 55:33 | 53 | subroutine my_subroutine2() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 55 | end subroutine different_name | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ syntax error: Invalid syntax for variable initialization (try inserting '::' after the type) --> tests/errors/continue_compilation_2.f90:137:5 | 137 | integer init_x = 1 | ^^^^^^^^^^^^^^^^^^ syntax error: kind 16 is not supported yet. --> tests/errors/continue_compilation_2.f90:227:5 | 227 | real*16 :: unsupported_kind | ^^^^^^^ tokenizer error: Token '?' is not recognized --> tests/errors/continue_compilation_2.f90:233:17 | 233 | integer :: ? tokenizer_error | ^ token not recognized tokenizer error: Token '@' is not recognized in `format` statement --> tests/errors/continue_compilation_2.f90:499:21 | 499 | 100 FORMAT(A10, @) | ^ semantic error: Global name is already being used --> tests/errors/continue_compilation_2.f90:24:1 - 25:21 | 24 | subroutine myname | ^^^^^^^^^^^^^^^^^... ... | 25 | end subroutine myname | ...^^^^^^^^^^^^^^^^^^^^^ 'myname' defined here | 27 | block data myname | ^^^^^^^^^^^^^^^^^... ... | 29 | | ...^ 'myname' defined here again semantic error: Duplicate DIMENSION attribute specified --> tests/errors/continue_compilation_2.f90:35:24 | 35 | common /rowns/ rowns(209) | ^^^^^^^^^^ semantic error: Intent attribute can only be applied to procedure arguments --> tests/errors/continue_compilation_2.f90:58:18 | 58 | INTEGER, INTENT(IN) :: sub_a | ^^^^^^^^^^ semantic error: Dummy argument 'a' not defined --> tests/errors/continue_compilation_2.f90:57:5 - 59:36 | 57 | SUBROUTINE faulty_subroutine(a, b, c) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 59 | END SUBROUTINE faulty_subroutine | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Dummy argument 'b' not defined --> tests/errors/continue_compilation_2.f90:57:5 - 59:36 | 57 | SUBROUTINE faulty_subroutine(a, b, c) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 59 | END SUBROUTINE faulty_subroutine | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Dummy argument 'c' not defined --> tests/errors/continue_compilation_2.f90:57:5 - 59:36 | 57 | SUBROUTINE faulty_subroutine(a, b, c) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 59 | END SUBROUTINE faulty_subroutine | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Assumed-rank variable 'x' must not have any dimensions specified. --> tests/errors/continue_compilation_2.f90:82:20 | 82 | integer :: x(.., 5) | ^^^^^^^^ semantic error: Dummy argument 'x' not defined --> tests/errors/continue_compilation_2.f90:81:5 - 83:24 | 81 | subroutine arank(x) | ^^^^^^^^^^^^^^^^^^^... ... | 83 | end subroutine arank | ...^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: OPTIONAL dummy argument 'n' cannot be used for array bounds declaration --> tests/errors/continue_compilation_2.f90:107:21 | 107 | real :: arr(n) | ^ hint: use a non-optional argument, or declare the array as `allocatable` semantic error: Implicit typing is not allowed, enable it by using --implicit-typing --> tests/errors/continue_compilation_2.f90:132:5 - 134:49 | 132 | implicit real(a-z) | ^^^^^^^^^^^^^^^^^^... ... | 134 | ! Put declarations below without empty lines | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `parameter` attribute conflicts with `pointer` attribute --> tests/errors/continue_compilation_2.f90:135:5 | 135 | integer, pointer, parameter :: v => null() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `parameter` attribute conflicts with `allocatable` attribute --> tests/errors/continue_compilation_2.f90:136:5 | 136 | integer, allocatable, parameter :: v=1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `kind` argument of `int` intrinsic must be a scalar --> tests/errors/continue_compilation_2.f90:197:54 | 197 | integer(8), parameter :: ar1(3) = int([1, 2, 3], [8, 8, 8]) | ^^^^^^^^^ semantic error: `kind` argument of `int` intrinsic must be a scalar --> tests/errors/continue_compilation_2.f90:199:54 | 199 | integer(8), parameter :: ar2(3) = int([1, 2, 3], [8, 8, 8]) | ^^^^^^^^^ semantic error: Only Integer literals or expressions which reduce to constant Integer are accepted as kind parameters --> tests/errors/continue_compilation_2.f90:201:13 | 201 | integer(4.2) :: ifoix | ^^^ semantic error: Kind 6 is not supported for Complex --> tests/errors/continue_compilation_2.f90:203:13 | 203 | complex(6) :: iiocx | ^ semantic error: Kind 3 is not supported for Integer --> tests/errors/continue_compilation_2.f90:205:13 | 205 | integer(3) :: iifix | ^ semantic error: Kind 10 is not supported for Logical --> tests/errors/continue_compilation_2.f90:207:13 | 207 | logical(10) :: iiolx | ^^ semantic error: Expected initialization expression for kind --> tests/errors/continue_compilation_2.f90:209:13 | 209 | complex(*) :: ksoca | ^ semantic error: Expected initialization expression for kind --> tests/errors/continue_compilation_2.f90:211:13 | 211 | integer(*) :: ksoia | ^ semantic error: Expected initialization expression for kind --> tests/errors/continue_compilation_2.f90:213:13 | 213 | logical(*) :: ksola | ^ semantic error: Only Integer literals or expressions which reduce to constant Integer are accepted as kind parameters --> tests/errors/continue_compilation_2.f90:215:13 | 215 | integer('a') :: ksoix | ^^^ semantic error: Parameter 'kvoia' is a variable, which does not reduce to a constant expression --> tests/errors/continue_compilation_2.f90:218:10 | 218 | real(kvoia) :: kvoix | ^^^^^ semantic error: Symbol is already declared in the same scope --> tests/errors/continue_compilation_2.f90:220:16 | 220 | real(3) :: x | ^ redeclaration | 145 | integer, parameter :: x = 2 | ~~~~~ original declaration semantic error: Expected initialization expression for kind --> tests/errors/continue_compilation_2.f90:222:10 | 222 | real(*) kind2_a | ^ semantic error: Parameter attribute cannot be used with Target attribute --> tests/errors/continue_compilation_2.f90:224:5 | 224 | integer, parameter, target :: foo=4 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Kind 16 is not supported for Real --> tests/errors/continue_compilation_2.f90:227:5 | 227 | real*16 :: unsupported_kind | ^^^^^^^ semantic error: Argument was not specified --> tests/errors/continue_compilation_2.f90:229:33 | 229 | type(Circle) :: myCircle2 = Circle() | ^^^^^^^^ Argument 'radius' not specified for circle semantic error: Keyword argument not found --> tests/errors/continue_compilation_2.f90:231:33 | 231 | type(Circle) :: myCircle3 = Circle(mykeyword=10) | ^^^^^^^^^^^^^^^^^^^^ 'mykeyword' keyword argument not found semantic error: Incompatible ranks 2 and 1 in assignment --> tests/errors/continue_compilation_2.f90:234:36 | 234 | integer, dimension(3,2) :: m = [ 1, 0, 0, 2, 4, 6 ] | ^^^^^^^^^^^^^^^^^^^^ semantic error: Assumed-rank variable 'aRank1' must be a dummy argument. --> tests/errors/continue_compilation_2.f90:250:16 | 250 | integer :: aRank1(..) | ^^^^^^^^^^ semantic error: Array 'a_deferred' with a deferred shape cannot be a local variable; it must be a dummy argument, allocatable, or pointer --> tests/errors/continue_compilation_2.f90:256:16 | 256 | integer :: a_deferred(:) | ^^^^^^^^^^^^^ semantic error: More than one main program found --> tests/errors/continue_compilation_2.f90:127:1 - 574:11 | 127 | program continue_compilation_2 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 574 | end program | ...^^^^^^^^^^^ first main program defined here | 577 | program second_program_test | ^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 580 | end program second_program_test | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ second main program defined here semantic error: Unexpected args, SetExponent expects (real, int) as arguments --> tests/errors/continue_compilation_2.f90:36:18 | 36 | print *, set_exponent([1, 2, 3], 2) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Cannot assign to an intent(in) variable `y` --> tests/errors/continue_compilation_2.f90:41:9 | 41 | y = 99 | ^ semantic error: Argument `val_a` with intent(in) passed to a dummy argument with modifying intent --> tests/errors/continue_compilation_2.f90:63:20 | 63 | call sub_b(val_a) | ^^^^^ semantic error: Argument `val_a` with intent(in) passed to a dummy argument with modifying intent --> tests/errors/continue_compilation_2.f90:73:26 | 73 | res = inner_func(val_a) | ^^^^^ semantic error: Dummy argument 'this' has `intent(out)` and cannot be used for array bounds declaration --> tests/errors/continue_compilation_2.f90:98:27 | 98 | real :: array(this%n) | ^^^^^^ hint: use `intent(in/inout)` or `allocatable` for 'this', or pass the size as a separate `intent(in)` argument semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_2.f90:100:13 | 100 | array = [ (i,i = 1,this%n) ] | ^^^^^ ^^^^^^^^^^^^^^^^^^^^ type mismatch (`integer` and `integer[:]`) semantic error: PRINT statement is not allowed inside a PURE procedure --> tests/errors/continue_compilation_2.f90:117:9 | 117 | print "(A,I0)", 'b = ', b | ^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Deferred-length CHARACTER variable must be allocated with a character length `character(..)` --> tests/errors/continue_compilation_2.f90:295:14 | 295 | allocate(str1(i)) | ^^^^^^^ semantic error: No custom operator exists for this expression --> tests/errors/continue_compilation_2.f90:298:15 | 298 | str_t_2 = prefix // 10 | ^^^^^^^^^^^^ semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_2.f90:298:5 | 298 | str_t_2 = prefix // 10 | ^^^^^^^ ^^ type mismatch (string_t and integer) semantic error: No custom operator exists for this expression --> tests/errors/continue_compilation_2.f90:299:15 | 299 | str_t_2 = prefix // str_t_1 | ^^^^^^^^^^^^^^^^^ semantic error: shape argument specified in c_f_pointer even though fptr is not an array. --> tests/errors/continue_compilation_2.f90:301:38 | 301 | call c_f_pointer(queries_1, y_1, [2]) | ^^^ semantic error: shape array passed to c_f_pointer must be of rank 1 but given rank is 2 --> tests/errors/continue_compilation_2.f90:303:38 | 303 | call c_f_pointer(queries_2, y_2, shape) | ^^^^^ semantic error: Cannot assign to a constant variable --> tests/errors/continue_compilation_2.f90:305:5 | 305 | x = 1 | ^^^^^ assignment here | 145 | integer, parameter :: x = 2 | ~~~~~ declared as constant semantic error: More actual than formal arguments in procedure call --> tests/errors/continue_compilation_2.f90:308:33 | 308 | call myCircle%calculateArea(circleArea, 12) | ^^^^^^^^^^^^^^ semantic error: Invalid argument `end` supplied --> tests/errors/continue_compilation_2.f90:310:5 | 310 | CLOSE(end=200) | ^^^^^^^^^^^^^^ semantic error: Missing actual argument 'x' in call to 'cmplx' --> tests/errors/continue_compilation_2.f90:312:14 | 312 | print *, cmplx(y = 2) | ^^^^^^^^^^^^ semantic error: Only a literal constant or a named constant is allowed as part of a complex literal constant --> tests/errors/continue_compilation_2.f90:314:20 | 314 | print*, cmplx((real(1, kind=4), 0.00000000), kind=8) | ^^^^^^^^^^^^^^^ semantic error: Only a literal constant or a named constant is allowed as part of a complex literal constant --> tests/errors/continue_compilation_2.f90:316:32 | 316 | print*, cmplx((1.00000000, real(0, kind=4)), kind=8) | ^^^^^^^^^^^^^^^ semantic error: Coarrays are not supported yet --> tests/errors/continue_compilation_2.f90:324:5 | 324 | call event_query(1, 1, 1) | ^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Operands of comparison operator are of different types --> tests/errors/continue_compilation_2.f90:328:9 | 328 | if (i > x_2) then | ^^^^^^^ semantic error: dim has already been specified as a positional/keyword argument to size --> tests/errors/continue_compilation_2.f90:332:14 | 332 | size_a = size(a_2, 1, dim=1) | ^^^^^^^^^^^^^^^^^^^ semantic error: dim has already been specified as a positional/keyword argument to size --> tests/errors/continue_compilation_2.f90:333:14 | 333 | size_a = size(a_2, dim = 1, 1) | ^^^^^^^^^^^^^^^^^^^^^ semantic error: Only Integer literals or expressions which reduce to constant Integer are accepted as kind parameters. --> tests/errors/continue_compilation_2.f90:335:31 | 335 | size_a_2 = size(a_3, kind=kindvar, dim=1) | ^^^^^^^ semantic error: Only Integer literals or expressions which reduce to constant Integer are accepted as kind parameters. --> tests/errors/continue_compilation_2.f90:336:31 | 336 | size_a_2 = size(a_3, kind=kindvar) | ^^^^^^^ semantic error: Atomic operations are not supported yet --> tests/errors/continue_compilation_2.f90:338:5 | 338 | call atomic_add (atom[1], this_image()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Atomic operations are not supported yet --> tests/errors/continue_compilation_2.f90:339:5 | 339 | call atomic_add (atom[2], this_image()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Type-spec cannot contain an asterisk for a type parameter --> tests/errors/continue_compilation_2.f90:341:14 | 341 | print *, [character(*) :: "a", "b", "ball", "cat"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Different `character` lengths 1 and 4 in array constructor --> tests/errors/continue_compilation_2.f90:343:25 | 343 | print *, ["a", "b", "ball", "cat"] | ^^^^^^ semantic error: Different `character` lengths 2 and 5 in array constructor --> tests/errors/continue_compilation_2.f90:344:27 | 344 | print *, ["a1", "b1", "ball1", "cat1"] | ^^^^^^^ semantic error: Element in `real(8)` array constructor is `real(4)` --> tests/errors/continue_compilation_2.f90:347:20 | 347 | print *, [x_3, [1., 2.]] | ^^^^^^^^ semantic error: Element in `integer(4)` array constructor is `real(4)` --> tests/errors/continue_compilation_2.f90:349:18 | 349 | print *, [1, 2.] | ^^ semantic error: Element in `integer(4)` array constructor is `real(4)` --> tests/errors/continue_compilation_2.f90:351:18 | 351 | print *, [1, [1., 2.]] | ^^^^^^^^ semantic error: Argument of intrinsic must be an integer --> tests/errors/continue_compilation_2.f90:353:14 | 353 | print *, dfloat(y_3) | ^^^^^^^^^^^ semantic error: `dim` argument of `Sum` intrinsic must be INTEGER --> tests/errors/continue_compilation_2.f90:355:29 | 355 | print *, sum([1, 2, 3], 1.1) | ^^^ semantic error: `mask` argument to `Sum` must be a scalar or array of logical type --> tests/errors/continue_compilation_2.f90:357:32 | 357 | print *, sum([1, 2, 3], 1, 1.1) | ^^^ semantic error: `dim` argument of `Sum` intrinsic must be INTEGER --> tests/errors/continue_compilation_2.f90:359:29 | 359 | print *, sum([1, 2, 3], .true., 1.1) | ^^^^^^ semantic error: Too many arguments to call `dint` --> tests/errors/continue_compilation_2.f90:361:13 | 361 | print*, dint(1.0_8, 8) | ^^^^^^^^^^^^^^ semantic error: Too many arguments to call `dint` --> tests/errors/continue_compilation_2.f90:362:13 | 362 | if (abs(dint(1.0_8, 8) - 1.0_8) > 10e-5 ) error stop | ^^^^^^^^^^^^^^ semantic error: Argument 1 of dlgama must be of double precision real type --> tests/errors/continue_compilation_2.f90:364:14 | 364 | print *, dlgama(2.7) | ^^^^^^^^^^^ semantic error: Too many arguments to call `dnint` --> tests/errors/continue_compilation_2.f90:366:13 | 366 | print*, dnint(1.0_8, 8) | ^^^^^^^^^^^^^^^ semantic error: Too many arguments to call `dnint` --> tests/errors/continue_compilation_2.f90:367:13 | 367 | if (abs(dnint(1.0_8, 8) - 1.0_8) > 10e-5 ) error stop | ^^^^^^^^^^^^^^^ semantic error: Do concurrent loop variable `j` cannot be part of local expression --> tests/errors/continue_compilation_2.f90:369:30 | 369 | do concurrent (j = 1:Ny) local(i_1, j) | ^^^^^^^^^^^^^ semantic error: Assignment to loop variable `i_2` is not allowed --> tests/errors/continue_compilation_2.f90:376:9 | 376 | i_2 = j_1 + 1 | ^^^ semantic error: Step expression (Increment) in DO loop cannot be zero --> tests/errors/continue_compilation_2.f90:382:20 | 382 | do i_2 = 1, 5, 0 | ^ semantic error: first argument of `dprod` must have kind equal to 4 --> tests/errors/continue_compilation_2.f90:386:13 | 386 | print*, dprod(4.23_8, 4.3_8) | ^^^^^^^^^^^^^^^^^^^^ semantic error: Unexpected args, Dreal expects (complex64) as arguments --> tests/errors/continue_compilation_2.f90:389:14 | 389 | print *, dreal(a_4) | ^^^^^^^^^^ semantic error: Incorrect number of arguments passed to the 'complex' intrinsic. It accepts exactly 2 arguments. --> tests/errors/continue_compilation_2.f90:391:11 | 391 | a_5 = complex(1) | ^^^^^^^^^^ semantic error: Argument of intrinsic must be an integer --> tests/errors/continue_compilation_2.f90:393:14 | 393 | print *, float(y_4) | ^^^^^^^^^^ semantic error: Invalid argument `start` supplied --> tests/errors/continue_compilation_2.f90:395:5 | 395 | FLUSH(unit=10, start=100) | ^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Type mismatch in argument `x`: expected `integer(4)` but got `real(4)`. --> tests/errors/continue_compilation_2.f90:397:16 | 397 | print *, f(42.9) | ^^^^ semantic error: Argument 1 to Ichar must have length 1 --> tests/errors/continue_compilation_2.f90:399:13 | 399 | print*, ichar("okay") | ^^^^^^^^^^^^^ semantic error: first argument of `idint` must have kind equal to 8 --> tests/errors/continue_compilation_2.f90:401:14 | 401 | print *, idint(4.5) | ^^^^^^^^^^ semantic error: first argument of `ifix` must have kind equal to 4 --> tests/errors/continue_compilation_2.f90:403:14 | 403 | print *, ifix(4.23_8) | ^^^^^^^^^^^^ semantic error: Different shape for array assignment on dimension 1(1 and 3) --> tests/errors/continue_compilation_2.f90:406:5 | 406 | arr1 = [1, 2, 3] | ^^^^^^^^^^^^^^^^ semantic error: Different shape for array assignment on dimension 3(1 and 2) --> tests/errors/continue_compilation_2.f90:410:5 | 410 | idaa2_y = idaa2_x | ^^^^^^^^^^^^^^^^^ semantic error: Shapes for operands are not conformable --> tests/errors/continue_compilation_2.f90:412:14 | 412 | print *, idlalb1_x .neqv. [.true., .true.] | ^^^^^^^^^ ^^^^^^^^^^^^^^^^ semantic error: Shapes for operands are not conformable --> tests/errors/continue_compilation_2.f90:414:14 | 414 | print *, idlalb2_x1 .neqv. idlalb2_x2 | ^^^^^^^^^^ ^^^^^^^^^^ semantic error: Incompatible ranks 2 and 1 in assignment --> tests/errors/continue_compilation_2.f90:416:5 | 416 | iraa1_arr1 = [1, 2, 3] | ^^^^^^^^^^^^^^^^^^^^^^ semantic error: Incompatible ranks 1 and 3 in assignment --> tests/errors/continue_compilation_2.f90:418:5 | 418 | iraa2_arr3 = iraa2_arr1 | ^^^^^^^^^^^^^^^^^^^^^^^ semantic error: the first array argument to `where` must be of type logical --> tests/errors/continue_compilation_2.f90:420:11 | 420 | where([1, 2, 3, 4, 5]) iatw1_b = 1 | ^^^^^^^^^^^^^^^ semantic error: the first array argument to `where` must be of type logical --> tests/errors/continue_compilation_2.f90:425:11 | 425 | where(iatw2_i1) iatw2_b = 1 | ^^^^^^^^ semantic error: the argument to `where` must be an array --> tests/errors/continue_compilation_2.f90:429:11 | 429 | where(.true.) itw1_b = 12121 | ^^^^^^ semantic error: the argument to `where` must be an array --> tests/errors/continue_compilation_2.f90:432:11 | 432 | where(1) itw2_b = 12121 | ^ semantic error: the argument to `where` must be an array --> tests/errors/continue_compilation_2.f90:435:11 | 435 | where(max(1.33, 2.67)) itw3_b = 12121 | ^^^^^^^^^^^^^^^ semantic error: Unexpected args, Radix expects (int) or (real) as arguments --> tests/errors/continue_compilation_2.f90:441:14 | 441 | print *, radix((2.4, 1.0)) | ^^^^^^^^^^^^^^^^^ semantic error: datan2 was declared as a variable, it can't be called as a function --> tests/errors/continue_compilation_2.f90:445:14 | 445 | print *, datan2(x,y) | ^^^^^^^^^^^ help: use the compiler option "--implicit-interface" to use intrinsic functions semantic error: datan2 was declared as a variable, it can't be called as a function --> tests/errors/continue_compilation_2.f90:446:12 | 446 | if(abs(datan2(x,y) - 0.59941916594660438) > 1d-6) error stop | ^^^^^^^^^^^ help: use the compiler option "--implicit-interface" to use intrinsic functions semantic error: `pos` argument of `ibclr` intrinsic must be non-negative --> tests/errors/continue_compilation_2.f90:448:14 | 448 | print *, ibclr(1, -2) | ^^^^^^^^^^^^ semantic error: Kind of all the arguments of Dshiftl must be the same --> tests/errors/continue_compilation_2.f90:450:14 | 450 | print *, dshiftl(1, 1_8, 1) | ^^^^^^^^^^^^^^^^^^ semantic error: Kind of all the arguments of Ior must be the same --> tests/errors/continue_compilation_2.f90:452:14 | 452 | print *, ior(1, 1_8) | ^^^^^^^^^^^ semantic error: Kind of all the arguments of Ieor must be the same --> tests/errors/continue_compilation_2.f90:454:14 | 454 | print *, ieor(1, 1_8) | ^^^^^^^^^^^^ semantic error: Kind of all the arguments of Hypot must be the same --> tests/errors/continue_compilation_2.f90:456:14 | 456 | print *, hypot(1.0, 2.7_8) | ^^^^^^^^^^^^^^^^^ semantic error: Kind of all the arguments of Ior must be the same --> tests/errors/continue_compilation_2.f90:458:14 | 458 | print *, ior(intr8_x, intr8_y) | ^^^^^^^^^^^^^^^^^^^^^ semantic error: Kind of all the arguments of Iand must be the same --> tests/errors/continue_compilation_2.f90:460:14 | 460 | print *, iand(intr9_x, intr9_y) | ^^^^^^^^^^^^^^^^^^^^^^ semantic error: Kind of all the arguments of Ieor must be the same --> tests/errors/continue_compilation_2.f90:462:14 | 462 | print *, ieor(intr10_x, intr10_y) | ^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Kind of all the arguments of Hypot must be the same --> tests/errors/continue_compilation_2.f90:466:14 | 466 | print *, hypot(intr11_x, intr11_y) | ^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: All arguments to max0 must be of the same type --> tests/errors/continue_compilation_2.f90:468:14 | 468 | print *, max(12, 13.94) | ^^^^^^^^^^^^^^ semantic error: All arguments to min0 must be of the same type --> tests/errors/continue_compilation_2.f90:470:14 | 470 | print *, min(12, 13.94) | ^^^^^^^^^^^^^^ semantic error: Unexpected args, Scale expects (real, int) as arguments --> tests/errors/continue_compilation_2.f90:472:14 | 472 | print *, scale([1, 2, 3], 2) | ^^^^^^^^^^^^^^^^^^^ semantic error: Unexpected args, SetExponent expects (real, int) as arguments --> tests/errors/continue_compilation_2.f90:474:14 | 474 | print *, set_exponent([1, 2, 3], 2) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Non-variable expression for `iostat` --> tests/errors/continue_compilation_2.f90:477:5 | 477 | read(ici_buffer, *, iostat=ici_ios) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `iostat` must be scalar --> tests/errors/continue_compilation_2.f90:480:5 | 480 | read(insv_buffer, *, iostat=insv_ios(1:1)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: The SHIFT argument must be less than or equal to the of SIZE argument --> tests/errors/continue_compilation_2.f90:482:14 | 482 | print *, ishftc(10, 6, 4) | ^^^^^^^^^^^^^^^^ semantic error: The first argument of `cmplx` intrinsic is of complex type, the second argument in this case must be absent --> tests/errors/continue_compilation_2.f90:484:14 | 484 | print *, cmplx(complex_z , 1) | ^^^^^^^^^^^^^^^^^^^^ semantic error: `kind` argument of `aint` intrinsic must be a scalar --> tests/errors/continue_compilation_2.f90:486:36 | 486 | print *, aint([1.0, 2.0, 3.0], [4, 4]) | ^^^^^^ semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_2.f90:488:5 | 488 | tm1_x = "x" | ^^^^^ ^^^ type mismatch (integer and string) semantic error: Type mismatch in binary operator, the types must be compatible --> tests/errors/continue_compilation_2.f90:490:13 | 490 | tm2_x = 5 + "x" | ^ ^^^ type mismatch (integer and string) semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_2.f90:490:5 | 490 | tm2_x = 5 + "x" | ^^^^^ ^^^ type mismatch (integer and string) semantic error: Variable 'mycircle' doesn't have any member named, 'mymember'. --> tests/errors/continue_compilation_2.f90:497:14 | 497 | print *, myCircle%mymember | ^^^^^^^^^^^^^^^^^ semantic error: Unequal character lengths in MERGE intrinsic --> tests/errors/continue_compilation_2.f90:501:13 | 501 | print*, merge("okay", "ok", .true.) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: first argument of `idint` must have kind equal to 8 --> tests/errors/continue_compilation_2.f90:503:14 | 503 | print *, idint(4.23) | ^^^^^^^^^^^ semantic error: first argument of `idint` must have kind equal to 8 --> tests/errors/continue_compilation_2.f90:504:14 | 504 | print *, idint(idint_kind_mismatch) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Argument 1 to Ichar must have length 1 --> tests/errors/continue_compilation_2.f90:506:14 | 506 | print *, ichar(ichar_runtime) | ^^^^^^^^^^^^^^^^^^^^ semantic error: first argument of `dprod` must have kind equal to 4 --> tests/errors/continue_compilation_2.f90:508:14 | 508 | print *, dprod(dprod_1, dprod_2) | ^^^^^^^^^^^^^^^^^^^^^^^ semantic error: second argument of `dprod` must have kind equal to 4 --> tests/errors/continue_compilation_2.f90:509:14 | 509 | print *, dprod(dprod_3, dprod_2) | ^^^^^^^^^^^^^^^^^^^^^^^ semantic error: first argument of `idnint` must have kind equal to 8 --> tests/errors/continue_compilation_2.f90:511:14 | 511 | print *, idnint(3.5) | ^^^^^^^^^^^ semantic error: first argument of `idnint` must have kind equal to 8 --> tests/errors/continue_compilation_2.f90:512:14 | 512 | print *, idnint(idnint_runtime) | ^^^^^^^^^^^^^^^^^^^^^^ semantic error: first argument of `ifix` must have kind equal to 4 --> tests/errors/continue_compilation_2.f90:514:14 | 514 | print *, ifix(4.23_8) | ^^^^^^^^^^^^ semantic error: first argument of `ifix` must have kind equal to 4 --> tests/errors/continue_compilation_2.f90:515:14 | 515 | print *, ifix(ifix_runtime) | ^^^^^^^^^^^^^^^^^^ semantic error: Arguments to min0 must be of real, integer or character type --> tests/errors/continue_compilation_2.f90:517:14 | 517 | print *, min(.true., .false.) | ^^^^^^^^^^^^^^^^^^^^ semantic error: Arguments to min0 must be of real, integer or character type --> tests/errors/continue_compilation_2.f90:518:14 | 518 | print *, min(min_max, min_max) | ^^^^^^^^^^^^^^^^^^^^^ semantic error: Arguments to min0 must be of real, integer or character type --> tests/errors/continue_compilation_2.f90:520:14 | 520 | print *, max(.true., .false.) | ^^^^^^^^^^^^^^^^^^^^ semantic error: Arguments to min0 must be of real, integer or character type --> tests/errors/continue_compilation_2.f90:521:14 | 521 | print *, max(min_max, min_max) | ^^^^^^^^^^^^^^^^^^^^^ semantic error: Argument of 'size' must be an array --> tests/errors/continue_compilation_2.f90:526:19 | 526 | print *, size(ichar_runtime) | ^^^^^^^^^^^^^ semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_2.f90:527:5 | 527 | lhs = rhs | ^^^ ^^^ type mismatch (`string` and `string[:]`) semantic error: Missing actual argument 'string' in call to 'index' --> tests/errors/continue_compilation_2.f90:528:14 | 528 | print *, index( substring = 'de', back = .true. ) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Function 'compiler_options' not found (not user defined nor intrinsic) --> tests/errors/continue_compilation_2.f90:529:14 | 529 | print *, compiler_options() | ^^^^^^^^^^^^^^^^^^ warning: Format string missing comma between descriptors (F2023 constraint C1302) --> tests/errors/continue_compilation_2.f90:530:11 | 530 | print "(AF9.6)", 'pi =', 4*atan(1.0) | ^^^^^^^^^ warning: Format string missing comma between descriptors (F2023 constraint C1302) --> tests/errors/continue_compilation_2.f90:531:14 | 531 | write (*,"(ai0)", iostat=ierr) "hi", 3 | ^^^^^^^ warning: Format string missing comma between descriptors (F2023 constraint C1302) --> tests/errors/continue_compilation_2.f90:533:14 | 533 | write (*,badfmt_p) "hi", 3 | ^^^^^^^^ warning: Format string missing comma between descriptors (F2023 constraint C1302) --> tests/errors/continue_compilation_2.f90:534:14 | 534 | write (*,badfmt_s) "hi", 3 | ^^^^^^^^ semantic error: Function 'add_parens' not found (not user defined nor intrinsic) --> tests/errors/continue_compilation_2.f90:535:15 | 535 | write (*, add_parens (badfmt_s)) "hi", 3 | ^^^^^^^^^^^^^^^^^^^^^ warning: Format string missing comma between descriptors (F2023 constraint C1302) --> tests/errors/continue_compilation_2.f90:537:11 | 537 | print "(aai6)", a,"hi",15 | ^^^^^^^^ warning: Format string missing comma between descriptors (F2023 constraint C1302) --> tests/errors/continue_compilation_2.f90:537:11 | 537 | print "(aai6)", a,"hi",15 | ^^^^^^^^ warning: `sleep` is a non-standard extension --> tests/errors/continue_compilation_2.f90:538:5 | 538 | call sleep(1) | ^^^^^^^^^^^^^ not part of the Fortran standard semantic error: Missing actual argument 'x' in call to 'cmplx' --> tests/errors/continue_compilation_2.f90:539:9 | 539 | a = cmplx(y = 2) | ^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-end_label-a678e8c.json0000664000175000017500000000074615174404631023377 0ustar alastairalastair{ "basename": "ast-end_label-a678e8c", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/end_label.f", "infile_hash": "4e27c022f4b317fda199421736ff4444472c7c5f1bd220726699bcc7", "outfile": null, "outfile_hash": null, "stdout": "ast-end_label-a678e8c.stdout", "stdout_hash": "971a0b594936cbd21f7c3c09789bc841698953a943cbaa58a9a9e1ba", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit9-5318b32.stderr0000664000175000017500000000224415174404631023542 0ustar alastairalastairstyle suggestion: Use integer(4) instead of integer*4 --> tests/implicit9.f90:3:17 | 3 | implicit integer*4 (d-e) | ^ help: write this as 'integer(4)' style suggestion: Use integer(8) instead of integer*8 --> tests/implicit9.f90:4:17 | 4 | implicit integer*8 (f-g) | ^ help: write this as 'integer(8)' style suggestion: Use real(4) instead of real*4 --> tests/implicit9.f90:6:14 | 6 | implicit real*4 (i-k) | ^ help: write this as 'real(4)' style suggestion: Use real(8) instead of real*8 --> tests/implicit9.f90:7:14 | 7 | implicit real*8 (l) | ^ help: write this as 'real(8)' style suggestion: Use complex(4) instead of complex*8 --> tests/implicit9.f90:9:17 | 9 | implicit complex*8 (o) | ^ help: write this as 'complex(4)' style suggestion: Use complex(8) instead of complex*16 --> tests/implicit9.f90:10:17 | 10 | implicit complex*16 (p) | ^ help: write this as 'complex(8)' semantic error: Implicit typing is not allowed, enable it by using --implicit-typing --> tests/implicit9.f90:2:1 | 2 | implicit integer (a,b-c) | ^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast_f90-parameter_02-15e1701.json0000664000175000017500000000077115174404631024245 0ustar alastairalastair{ "basename": "ast_f90-parameter_02-15e1701", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/parameter_02.f90", "infile_hash": "09e4b92d73bf1ea50001dc2926c14f213a0c8eda2c2e399f78df895e", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-parameter_02-15e1701.stdout", "stdout_hash": "6bdc06efa3421a6ae06c297a90810eb3d2ad2a9a25ac05eec9bdd6a1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-coarray_02-793f8b3.stderr0000664000175000017500000000023515174404631023674 0ustar alastairalastairsemantic error: Coarrays are not supported yet --> tests/errors/coarray_02.f90:2:5 | 2 | call event_query(1, 1, 1) | ^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-intrinsics_47-bdbe527.json0000664000175000017500000000076115174404631024231 0ustar alastairalastair{ "basename": "asr-intrinsics_47-bdbe527", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_47.f90", "infile_hash": "e72c8435df70e13e7d473f70c58ee55796a7f234125dd71264bf94cf", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_47-bdbe527.stdout", "stdout_hash": "4861bb20af6e5b2b6d6a321b9397947cd70173d8e4b69241afc59e20", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-case_01-09dad75.stdout0000664000175000017500000002136115174404631023425 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [1 x i8] c"1" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data, i32 0, i32 0), i64 1 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [1 x i8] c"2" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.1, i32 0, i32 0), i64 1 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.3 = private constant [1 x i8] c"3" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.3, i32 0, i32 0), i64 1 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.5 = private constant [1 x i8] c"4" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.5, i32 0, i32 0), i64 1 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.7 = private constant [1 x i8] c"1" @string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.7, i32 0, i32 0), i64 1 }> @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.9 = private constant [5 x i8] c"2,3,4" @string_const.10 = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data.9, i32 0, i32 0), i64 5 }> @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i64, align 8 %out = alloca i64, align 8 store i64 4, i64* %i, align 8 %2 = load i64, i64* %i, align 8 %3 = icmp eq i64 %2, 1 br i1 %3, label %then, label %else then: ; preds = %.entry store i64 10, i64* %out, align 8 %4 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %4, i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %ifcont9 else: ; preds = %.entry %5 = load i64, i64* %i, align 8 %6 = icmp eq i64 %5, 2 br i1 %6, label %then1, label %else2 then1: ; preds = %else store i64 20, i64* %out, align 8 %7 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %7, i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) br label %ifcont8 else2: ; preds = %else %8 = load i64, i64* %i, align 8 %9 = icmp eq i64 %8, 3 br i1 %9, label %then3, label %else4 then3: ; preds = %else2 store i64 30, i64* %out, align 8 %10 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %10, i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) br label %ifcont7 else4: ; preds = %else2 %11 = load i64, i64* %i, align 8 %12 = icmp eq i64 %11, 4 br i1 %12, label %then5, label %else6 then5: ; preds = %else4 store i64 40, i64* %out, align 8 %13 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.6, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %13, i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) br label %ifcont else6: ; preds = %else4 br label %ifcont ifcont: ; preds = %else6, %then5 br label %ifcont7 ifcont7: ; preds = %ifcont, %then3 br label %ifcont8 ifcont8: ; preds = %ifcont7, %then1 br label %ifcont9 ifcont9: ; preds = %ifcont8, %then %14 = load i64, i64* %out, align 8 %15 = icmp ne i64 %14, 40 br i1 %15, label %then10, label %else11 then10: ; preds = %ifcont9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont12 else11: ; preds = %ifcont9 br label %ifcont12 ifcont12: ; preds = %else11, %then10 %16 = load i64, i64* %i, align 8 %17 = icmp eq i64 %16, 1 br i1 %17, label %then13, label %else14 then13: ; preds = %ifcont12 store i64 11, i64* %out, align 8 %18 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.8, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %18, i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) br label %ifcont18 else14: ; preds = %ifcont12 %19 = load i64, i64* %i, align 8 %20 = icmp eq i64 %19, 2 %21 = load i64, i64* %i, align 8 %22 = icmp eq i64 %21, 3 %23 = or i1 %20, %22 %24 = load i64, i64* %i, align 8 %25 = icmp eq i64 %24, 4 %26 = or i1 %23, %25 br i1 %26, label %then15, label %else16 then15: ; preds = %else14 store i64 22, i64* %out, align 8 %27 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.10, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %27, i32 5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) br label %ifcont17 else16: ; preds = %else14 br label %ifcont17 ifcont17: ; preds = %else16, %then15 br label %ifcont18 ifcont18: ; preds = %ifcont17, %then13 %28 = load i64, i64* %out, align 8 %29 = icmp ne i64 %28, 22 br i1 %29, label %then19, label %else20 then19: ; preds = %ifcont18 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont21 else20: ; preds = %ifcont18 br label %ifcont21 ifcont21: ; preds = %else20, %then19 br label %return return: ; preds = %ifcont21 br label %FINALIZE_SYMTABLE_case_01 FINALIZE_SYMTABLE_case_01: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) lfortran-0.63.0/tests/reference/asr-intrinsics_33-816caef.stdout0000664000175000017500000000545015174404631024600 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_29: (Program (SymbolTable 2 { }) intrinsics_29 [] [(Print (IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(StringConstant "This is record 1." (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (TypeInquiry NewLine (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "A" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "\n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] 0 (String 1 (IntegerConstant 18 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "This is record 1.\n" (String 1 (IntegerConstant 18 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "This is record 2." (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 35 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "This is record 1.\nThis is record 2." (String 1 (IntegerConstant 35 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-implicit_check-4f0391f.json0000664000175000017500000000073715174404631024350 0ustar alastairalastair{ "basename": "ast-implicit_check-4f0391f", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/implicit_check.f90", "infile_hash": "4913776655a2aab98265358375f290eedb9b92a2ef7424536067345c", "outfile": null, "outfile_hash": null, "stdout": "ast-implicit_check-4f0391f.stdout", "stdout_hash": "cf1c71b539cc3253680fa426242e31cd3f34bdf3f01d96a66c479b21", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixed_form1-7fa677f.json0000664000175000017500000000074115174404631023672 0ustar alastairalastair{ "basename": "ast-fixed_form1-7fa677f", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form1.f", "infile_hash": "a6774c19d8ae1f0ab04227a596e393ce26d84d1c0f796b7187a87f1a", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form1-7fa677f.stdout", "stdout_hash": "df87735dcdbe5b242827a4b47e5d9b7fea700b78b11f0a4b5835b17a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-forall1-50096b8.json0000664000175000017500000000103015174404631022645 0ustar alastairalastair{ "basename": "ast-forall1-50096b8", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/forall1.f90", "infile_hash": "c0bc2a81b478acca60180152012de1e4011f235afde816cb91804fb9", "outfile": null, "outfile_hash": null, "stdout": "ast-forall1-50096b8.stdout", "stdout_hash": "c323ece1ee8c9f36314ce9f04a847d34b9bad6f8b9c28971a85820a4", "stderr": "ast-forall1-50096b8.stderr", "stderr_hash": "4d905b6e8f90b9042def4e125077632dced461f1a0aeea1763458479", "returncode": 0 }lfortran-0.63.0/tests/reference/ast-arrays_09-5096a19.stdout0000664000175000017500000000256315174404631023504 0ustar alastairalastair(TranslationUnit [(Program arrays_09 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeCharacter [(() 10 Value)] () () None ) [] [(a [(1 1 DimensionExpr)] [] () () None ())] () )] [(Assignment 0 (FuncCallOrArray a [] [(() 1 () 0)] [] [] [] ) (String "Substring" ()) () ) (If 0 () (/= (FuncCallOrArray a [] [(() 1 () 0)] [] [(4 9 1 0)] [] ) (String "string" ())) [(ErrorStop 0 () () () )] [] () () () )] [] )] ) lfortran-0.63.0/tests/reference/ast-fixed_form5-66fddbd.stdout0000664000175000017500000000305315174404631024376 0ustar alastairalastair(TranslationUnit [(Function zdotc [(n) (d1x)] [(AttrType TypeComplex [(() 8 Value)] () () None )] () () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeComplex [(() 8 Value)] () () None ) [] [(d1x [(() () DimensionStar)] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() 2 Value)] () () None ) [] [(d2v [] [] () () None ())] () )] [(Assignment 0 d2v (String "AB" ()) () ) (Return 0 () () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-derived_types_01-960dafe.json0000664000175000017500000000077215174404631024706 0ustar alastairalastair{ "basename": "asr-derived_types_01-960dafe", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_01.f90", "infile_hash": "d5361dd7a0436fd13655dcc3ad47c98f3ce6966934537f5e9cc001c5", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_01-960dafe.stdout", "stdout_hash": "9525d98c8623f5a3091cd831a022ad2a8b102b48d02cdbc8f97c502b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-matmul_01-7b0b0c2.json0000664000175000017500000000074515174404631023240 0ustar alastairalastair{ "basename": "asr-matmul_01-7b0b0c2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/matmul_01.f90", "infile_hash": "ec3292a2c15be93d0603a137188615c65b2ac61e21b928e5ac85740b", "outfile": null, "outfile_hash": null, "stdout": "asr-matmul_01-7b0b0c2.stdout", "stdout_hash": "1512d74fa9540d083ce6b8267d24dc63b87c4b4d35eecd8c19e9b39f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-operator_overloading_01-33c47db.stdout0000664000175000017500000004635415174404631026743 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [13 x i8] c"S-DESC-4,L32\00", align 1 @string_const_data = private constant [4 x i8] c"T*T:" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [13 x i8] c"S-DESC-4,L32\00", align 1 @string_const_data.2 = private constant [4 x i8] c"T*F:" @string_const.3 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.2, i32 0, i32 0), i64 4 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.4 = private unnamed_addr constant [13 x i8] c"S-DESC-4,L32\00", align 1 @string_const_data.5 = private constant [4 x i8] c"F*T:" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.5, i32 0, i32 0), i64 4 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.7 = private unnamed_addr constant [13 x i8] c"S-DESC-4,L32\00", align 1 @string_const_data.8 = private constant [4 x i8] c"F*F:" @string_const.9 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.8, i32 0, i32 0), i64 4 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.10 = private unnamed_addr constant [12 x i8] c"S-DESC-4,I4\00", align 1 @string_const_data.11 = private constant [4 x i8] c"T+T:" @string_const.12 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.11, i32 0, i32 0), i64 4 }> @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.13 = private unnamed_addr constant [12 x i8] c"S-DESC-4,I4\00", align 1 @string_const_data.14 = private constant [4 x i8] c"T+F:" @string_const.15 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.14, i32 0, i32 0), i64 4 }> @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.16 = private unnamed_addr constant [12 x i8] c"S-DESC-4,I4\00", align 1 @string_const_data.17 = private constant [4 x i8] c"F+T:" @string_const.18 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.17, i32 0, i32 0), i64 4 }> @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.19 = private unnamed_addr constant [12 x i8] c"S-DESC-4,I4\00", align 1 @string_const_data.20 = private constant [4 x i8] c"F+F:" @string_const.21 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.20, i32 0, i32 0), i64 4 }> @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @__module_operator_overloading_01_overload_asterisk_m_bin_add(i32* %log1, i32* %log2) { .entry: %bin_add = alloca i32, align 4 %0 = load i32, i32* %log1, align 4 %1 = load i32, i32* %log2, align 4 %2 = and i32 %0, %1 %3 = icmp ne i32 %2, 0 br i1 %3, label %then, label %else then: ; preds = %.entry store i32 2, i32* %bin_add, align 4 br label %ifcont3 else: ; preds = %.entry %4 = load i32, i32* %log1, align 4 %5 = xor i32 %4, 1 %6 = load i32, i32* %log2, align 4 %7 = xor i32 %6, 1 %8 = and i32 %5, %7 %9 = icmp ne i32 %8, 0 br i1 %9, label %then1, label %else2 then1: ; preds = %else store i32 0, i32* %bin_add, align 4 br label %ifcont else2: ; preds = %else store i32 1, i32* %bin_add, align 4 br label %ifcont ifcont: ; preds = %else2, %then1 br label %ifcont3 ifcont3: ; preds = %ifcont, %then br label %return return: ; preds = %ifcont3 br label %FINALIZE_SYMTABLE_bin_add FINALIZE_SYMTABLE_bin_add: ; preds = %return %10 = load i32, i32* %bin_add, align 4 ret i32 %10 } define i32 @__module_operator_overloading_01_overload_asterisk_m_logical_and(i32* %log1, i32* %log2) { .entry: %logical_and = alloca i32, align 4 %0 = load i32, i32* %log1, align 4 %1 = load i32, i32* %log2, align 4 %2 = and i32 %0, %1 store i32 %2, i32* %logical_and, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_logical_and FINALIZE_SYMTABLE_logical_and: ; preds = %return %3 = load i32, i32* %logical_and, align 4 ret i32 %3 } define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc19 = alloca %string_descriptor, align 8 %stringFormat_desc16 = alloca %string_descriptor, align 8 %stringFormat_desc13 = alloca %string_descriptor, align 8 %stringFormat_desc10 = alloca %string_descriptor, align 8 %stringFormat_desc7 = alloca %string_descriptor, align 8 %stringFormat_desc4 = alloca %string_descriptor, align 8 %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %f = alloca i32, align 4 store i32 0, i32* %f, align 4 %t = alloca i32, align 4 store i32 1, i32* %t, align 4 %3 = alloca i64, align 8 %4 = call i32 @__module_operator_overloading_01_overload_asterisk_m_logical_and(i32* %t, i32* %t) %5 = alloca i32, align 4 store i32 %4, i32* %5, align 4 %6 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const, i32* %5) %7 = load i64, i64* %3, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %6, i8** %8, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %7, i64* %9, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %11 = load i8*, i8** %10, align 8 %12 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %13 = load i64, i64* %12, align 8 %14 = trunc i64 %13 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %11, i32 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %15 = icmp eq i8* %6, null br i1 %15, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %6) br label %free_done free_done: ; preds = %free_nonnull, %.entry %16 = alloca i64, align 8 %17 = call i32 @__module_operator_overloading_01_overload_asterisk_m_logical_and(i32* %t, i32* %f) %18 = alloca i32, align 4 store i32 %17, i32* %18, align 4 %19 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info.1, i32 0, i32 0), i64* %16, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.3, i32* %18) %20 = load i64, i64* %16, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %19, i8** %21, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %20, i64* %22, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %24 = load i8*, i8** %23, align 8 %25 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %26 = load i64, i64* %25, align 8 %27 = trunc i64 %26 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %24, i32 %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %28 = icmp eq i8* %19, null br i1 %28, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %2, i8* %19) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %29 = alloca i64, align 8 %30 = call i32 @__module_operator_overloading_01_overload_asterisk_m_logical_and(i32* %f, i32* %t) %31 = alloca i32, align 4 store i32 %30, i32* %31, align 4 %32 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info.4, i32 0, i32 0), i64* %29, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.6, i32* %31) %33 = load i64, i64* %29, align 8 %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %32, i8** %34, align 8 %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %33, i64* %35, align 8 %36 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %37 = load i8*, i8** %36, align 8 %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %39 = load i64, i64* %38, align 8 %40 = trunc i64 %39 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %37, i32 %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %41 = icmp eq i8* %32, null br i1 %41, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free_alloc(i8* %2, i8* %32) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 %42 = alloca i64, align 8 %43 = call i32 @__module_operator_overloading_01_overload_asterisk_m_logical_and(i32* %f, i32* %f) %44 = alloca i32, align 4 store i32 %43, i32* %44, align 4 %45 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info.7, i32 0, i32 0), i64* %42, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.9, i32* %44) %46 = load i64, i64* %42, align 8 %47 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 store i8* %45, i8** %47, align 8 %48 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 store i64 %46, i64* %48, align 8 %49 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 %50 = load i8*, i8** %49, align 8 %51 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 %52 = load i64, i64* %51, align 8 %53 = trunc i64 %52 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %50, i32 %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %54 = icmp eq i8* %45, null br i1 %54, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %free_done6 call void @_lfortran_free_alloc(i8* %2, i8* %45) br label %free_done9 free_done9: ; preds = %free_nonnull8, %free_done6 %55 = alloca i64, align 8 %56 = call i32 @__module_operator_overloading_01_overload_asterisk_m_bin_add(i32* %t, i32* %t) %57 = alloca i32, align 4 store i32 %56, i32* %57, align 4 %58 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.10, i32 0, i32 0), i64* %55, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.12, i32* %57) %59 = load i64, i64* %55, align 8 %60 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 store i8* %58, i8** %60, align 8 %61 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 store i64 %59, i64* %61, align 8 %62 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 %63 = load i8*, i8** %62, align 8 %64 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 %65 = load i64, i64* %64, align 8 %66 = trunc i64 %65 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %63, i32 %66, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %67 = icmp eq i8* %58, null br i1 %67, label %free_done12, label %free_nonnull11 free_nonnull11: ; preds = %free_done9 call void @_lfortran_free_alloc(i8* %2, i8* %58) br label %free_done12 free_done12: ; preds = %free_nonnull11, %free_done9 %68 = alloca i64, align 8 %69 = call i32 @__module_operator_overloading_01_overload_asterisk_m_bin_add(i32* %t, i32* %f) %70 = alloca i32, align 4 store i32 %69, i32* %70, align 4 %71 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.13, i32 0, i32 0), i64* %68, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.15, i32* %70) %72 = load i64, i64* %68, align 8 %73 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 store i8* %71, i8** %73, align 8 %74 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 store i64 %72, i64* %74, align 8 %75 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 %76 = load i8*, i8** %75, align 8 %77 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 %78 = load i64, i64* %77, align 8 %79 = trunc i64 %78 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %76, i32 %79, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %80 = icmp eq i8* %71, null br i1 %80, label %free_done15, label %free_nonnull14 free_nonnull14: ; preds = %free_done12 call void @_lfortran_free_alloc(i8* %2, i8* %71) br label %free_done15 free_done15: ; preds = %free_nonnull14, %free_done12 %81 = alloca i64, align 8 %82 = call i32 @__module_operator_overloading_01_overload_asterisk_m_bin_add(i32* %f, i32* %t) %83 = alloca i32, align 4 store i32 %82, i32* %83, align 4 %84 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.16, i32 0, i32 0), i64* %81, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.18, i32* %83) %85 = load i64, i64* %81, align 8 %86 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 store i8* %84, i8** %86, align 8 %87 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 store i64 %85, i64* %87, align 8 %88 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 %89 = load i8*, i8** %88, align 8 %90 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 %91 = load i64, i64* %90, align 8 %92 = trunc i64 %91 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %89, i32 %92, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) %93 = icmp eq i8* %84, null br i1 %93, label %free_done18, label %free_nonnull17 free_nonnull17: ; preds = %free_done15 call void @_lfortran_free_alloc(i8* %2, i8* %84) br label %free_done18 free_done18: ; preds = %free_nonnull17, %free_done15 %94 = alloca i64, align 8 %95 = call i32 @__module_operator_overloading_01_overload_asterisk_m_bin_add(i32* %f, i32* %f) %96 = alloca i32, align 4 store i32 %95, i32* %96, align 4 %97 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.19, i32 0, i32 0), i64* %94, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.21, i32* %96) %98 = load i64, i64* %94, align 8 %99 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 store i8* %97, i8** %99, align 8 %100 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 store i64 %98, i64* %100, align 8 %101 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 %102 = load i8*, i8** %101, align 8 %103 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 %104 = load i64, i64* %103, align 8 %105 = trunc i64 %104 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* %102, i32 %105, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 1) %106 = icmp eq i8* %97, null br i1 %106, label %free_done21, label %free_nonnull20 free_nonnull20: ; preds = %free_done18 call void @_lfortran_free_alloc(i8* %2, i8* %97) br label %free_done21 free_done21: ; preds = %free_nonnull20, %free_done18 br label %return return: ; preds = %free_done21 br label %FINALIZE_SYMTABLE_operator_overloading_01 FINALIZE_SYMTABLE_operator_overloading_01: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-implied_do_loops1-25d26db.json0000664000175000017500000000077515174404631025057 0ustar alastairalastair{ "basename": "asr-implied_do_loops1-25d26db", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/implied_do_loops1.f90", "infile_hash": "68e55531db4ca34fe61a1670dec525834de529c9d8ade7bac01f4046", "outfile": null, "outfile_hash": null, "stdout": "asr-implied_do_loops1-25d26db.stdout", "stdout_hash": "9232d3c4a655e0a701234791e095e4ddd938327d6ba929e6210b7d63", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-arrays_01-81f01a2.stdout0000664000175000017500000000247015174404631024052 0ustar alastairalastairfunction main() local a::Array{Int32, 1} local b::Array{Int32, 1} local i::Int32 for i ∈ 1:3 a[i] = i + 10 end if a[1] ≠ 11 println(Base.stderr, "ERROR STOP") exit(1) end if a[2] ≠ 12 println(Base.stderr, "ERROR STOP") exit(1) end if a[3] ≠ 13 println(Base.stderr, "ERROR STOP") exit(1) end for i ∈ 11:14 b[i - 10] = i end if b[1] ≠ 11 println(Base.stderr, "ERROR STOP") exit(1) end if b[2] ≠ 12 println(Base.stderr, "ERROR STOP") exit(1) end if b[3] ≠ 13 println(Base.stderr, "ERROR STOP") exit(1) end if b[4] ≠ 14 println(Base.stderr, "ERROR STOP") exit(1) end for i ∈ 1:3 b[i] = a[i] - 10 end if b[1] ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end if b[2] ≠ 2 println(Base.stderr, "ERROR STOP") exit(1) end if b[3] ≠ 3 println(Base.stderr, "ERROR STOP") exit(1) end b[4] = b[1] + b[2] + b[3] + a[1] if b[4] ≠ 17 println(Base.stderr, "ERROR STOP") exit(1) end b[4] = a[1] if b[4] ≠ 11 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-0.63.0/tests/reference/llvm-bindc3-d064ff7.stdout0000664000175000017500000001323515174404631023360 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @bindc3.idx = internal global i32 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [6 x i8] c"I8,I8\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [6 x i8] c"I8,I8\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc4 = alloca %string_descriptor, align 8 %bitcast_cptr_source3 = alloca void*, align 8 %bitcast_cptr_source2 = alloca void*, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() %bitcast_cptr_source1 = alloca void*, align 8 %bitcast_cptr_source = alloca void*, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %queries = alloca void*, align 8 %x = alloca i16*, align 8 store i16* null, i16** %x, align 8 %y = alloca i16, align 2 %3 = load void*, void** %queries, align 8 %4 = bitcast void* %3 to i16* store i16* %4, i16** %x, align 8 %5 = alloca i64, align 8 %6 = load i16*, i16** %x, align 8 %7 = bitcast i16* %6 to void* store void* %7, void** %bitcast_cptr_source, align 8 %8 = bitcast void** %bitcast_cptr_source to i64* %9 = load i64, i64* %8, align 8 %10 = alloca i64, align 8 store i64 %9, i64* %10, align 8 %11 = load void*, void** %queries, align 8 store void* %11, void** %bitcast_cptr_source1, align 8 %12 = bitcast void** %bitcast_cptr_source1 to i64* %13 = load i64, i64* %12, align 8 %14 = alloca i64, align 8 store i64 %13, i64* %14, align 8 %15 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info, i32 0, i32 0), i64* %5, i32 0, i32 0, i32 0, i32 0, i32 0, i64* %10, i64* %14) %16 = load i64, i64* %5, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %15, i8** %17, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %16, i64* %18, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %20 = load i8*, i8** %19, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %22 = load i64, i64* %21, align 8 %23 = trunc i64 %22 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %20, i32 %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %24 = icmp eq i8* %15, null br i1 %24, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %15) br label %free_done free_done: ; preds = %free_nonnull, %.entry store i16* %y, i16** %x, align 8 %25 = alloca i64, align 8 %26 = load i16*, i16** %x, align 8 %27 = bitcast i16* %26 to void* store void* %27, void** %bitcast_cptr_source2, align 8 %28 = bitcast void** %bitcast_cptr_source2 to i64* %29 = load i64, i64* %28, align 8 %30 = alloca i64, align 8 store i64 %29, i64* %30, align 8 %31 = bitcast i16* %y to void* store void* %31, void** %bitcast_cptr_source3, align 8 %32 = bitcast void** %bitcast_cptr_source3 to i64* %33 = load i64, i64* %32, align 8 %34 = alloca i64, align 8 store i64 %33, i64* %34, align 8 %35 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info.1, i32 0, i32 0), i64* %25, i32 0, i32 0, i32 0, i32 0, i32 0, i64* %30, i64* %34) %36 = load i64, i64* %25, align 8 %37 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %35, i8** %37, align 8 %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %36, i64* %38, align 8 %39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %40 = load i8*, i8** %39, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %42 = load i64, i64* %41, align 8 %43 = trunc i64 %42 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %40, i32 %43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %44 = icmp eq i8* %35, null br i1 %44, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done call void @_lfortran_free_alloc(i8* %2, i8* %35) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done br label %return return: ; preds = %free_done6 br label %FINALIZE_SYMTABLE_bindc3 FINALIZE_SYMTABLE_bindc3: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-string_slice-e254cc2.stderr0000664000175000017500000000022015174404631024454 0ustar alastairalastairsemantic error: Substring `start` is less than one --> tests/errors/string_slice.f90:4:13 | 4 | print*, s(-2:6) | ^^^^^^^ lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor12-94ccea0.stdout0000664000175000017500000004663415174404631027250 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor12: (Program (SymbolTable 2 { f90_assert: (Function (SymbolTable 4 { file: (Variable 4 file [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), line: (Variable 4 line [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f90_assert (FunctionType [(String 1 () AssumedLength DescriptorString) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 file) (Var 4 line)] [(Print (StringFormat () [(IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(StringConstant "Assertion failed at " (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 4 file)] 0 (String 1 () DeferredLength DescriptorString) () ) (StringConstant ":" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 () DeferredLength DescriptorString) () ) (Var 4 line)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (ErrorStop () )] () Public .false. .false. () ), fn: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), fn: (Variable 3 fn [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fn (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b)] [(Assignment (Var 3 fn) (IntegerCompare (Var 3 a) Lt (Var 3 b) (Logical 4) () ) () .false. .false. )] (Var 3 fn) Public .true. .true. () ) }) preprocessor12 [] [(If () (LogicalNot (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(SubroutineCall 2 f90_assert () [((StringConstant "tests/preprocessor12.f90" (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((IntegerConstant 7 (Integer 4) Decimal))] () .false. )] [] ) (If () (LogicalNot (IntegerCompare (IntegerConstant 5 (Integer 4) Decimal) Gt (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(SubroutineCall 2 f90_assert () [((StringConstant "tests/preprocessor12.f90" (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((IntegerConstant 8 (Integer 4) Decimal))] () .false. )] [] ) (If () (LogicalNot (IntegerCompare (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Mul (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) (IntegerConstant 24 (Integer 4) Decimal) ) (Integer 4) (IntegerConstant 29 (Integer 4) Decimal) ) Gt (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(SubroutineCall 2 f90_assert () [((StringConstant "tests/preprocessor12.f90" (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((IntegerConstant 9 (Integer 4) Decimal))] () .false. )] [] ) (If () (LogicalNot (FunctionCall 2 fn () [((IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 5 (Integer 4) Decimal))] (Logical 4) () () ) (Logical 4) () ) [(SubroutineCall 2 f90_assert () [((StringConstant "tests/preprocessor12.f90" (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((IntegerConstant 11 (Integer 4) Decimal))] () .false. )] [] ) (If () (LogicalNot (IntegerCompare (IntegerConstant 5 (Integer 4) Decimal) Lt (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(SubroutineCall 2 f90_assert () [((StringConstant "tests/preprocessor12.f90" (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((IntegerConstant 13 (Integer 4) Decimal))] () .false. )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-continue_compilation_3-435a232.json0000664000175000017500000000101615174404631025741 0ustar alastairalastair{ "basename": "asr-continue_compilation_3-435a232", "cmd": "lfortran --semantics-only --continue-compilation --no-color {infile}", "infile": "tests/errors/continue_compilation_3.f90", "infile_hash": "057c89ebeb5920942745c9d81fdcc2861237ee6488d983c0b5e67a69", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-continue_compilation_3-435a232.stderr", "stderr_hash": "dcd777f7178be2c3c1aee35b9a3f113a0b7fdb5b475767d89221590c", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-empty-6449c98.stdout0000664000175000017500000000012715174404631023035 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { }) [] ) lfortran-0.63.0/tests/reference/asr-derived_types_05-35150cd.stdout0000664000175000017500000013077715174404631025122 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_type_05: (Program (SymbolTable 13 { }) derived_type_05 [] [] ), derived_types_05_stdlib_string_type: (Module (SymbolTable 2 { new_string: (Function (SymbolTable 4 { new: (Variable 4 new [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 4 string [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_string (FunctionType [(String 1 () AssumedLength DescriptorString)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Interface () .true. .true. .true. .false. .false. [] .false. ) [] [(Var 4 string)] [] (Var 4 new) Public .false. .true. () ), new_string_from_integer_int32: (Function (SymbolTable 5 { new: (Variable 5 new [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), val: (Variable 5 val [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_string_from_integer_int32 (FunctionType [(Integer 4)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Interface () .true. .true. .true. .false. .false. [] .false. ) [] [(Var 5 val)] [] (Var 5 new) Public .false. .true. () ), new_string_from_integer_int64: (Function (SymbolTable 6 { new: (Variable 6 new [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), val: (Variable 6 val [] In () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_string_from_integer_int64 (FunctionType [(Integer 8)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Interface () .true. .true. .true. .false. .false. [] .false. ) [] [(Var 6 val)] [] (Var 6 new) Public .false. .true. () ), new_string_from_logical_lk: (Function (SymbolTable 7 { new: (Variable 7 new [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), val: (Variable 7 val [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_string_from_logical_lk (FunctionType [(Logical 4)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Interface () .true. .true. .true. .false. .false. [] .false. ) [] [(Var 7 val)] [] (Var 7 new) Public .false. .true. () ), string_type: (Struct (SymbolTable 3 { raw: (Variable 3 raw [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_type (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [raw] [] Source Public .false. .false. [] () () [] ), ~string_type: (GenericProcedure 2 ~string_type [2 new_string 2 new_string_from_integer_int32 2 new_string_from_integer_int64 2 new_string_from_logical_lk] Public ) }) derived_types_05_stdlib_string_type () [] .false. .false. .true. ), stdlib_string_type_constructor: (Module (SymbolTable 8 { new_string: (Function (SymbolTable 9 { new: (Variable 9 new [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 8 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 9 string [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_string (FunctionType [(String 1 () AssumedLength DescriptorString)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .true. .false. .true. .false. .false. [] .false. ) [] [(Var 9 string)] [] (Var 9 new) Public .true. .true. () ), new_string_from_integer_int32: (Function (SymbolTable 10 { new: (Variable 10 new [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 8 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), val: (Variable 10 val [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_string_from_integer_int32 (FunctionType [(Integer 4)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .true. .false. .true. .false. .false. [] .false. ) [] [(Var 10 val)] [] (Var 10 new) Public .true. .true. () ), new_string_from_integer_int64: (Function (SymbolTable 11 { new: (Variable 11 new [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 8 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), val: (Variable 11 val [] In () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_string_from_integer_int64 (FunctionType [(Integer 8)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .true. .false. .true. .false. .false. [] .false. ) [] [(Var 11 val)] [] (Var 11 new) Public .true. .true. () ), new_string_from_logical_lk: (Function (SymbolTable 12 { new: (Variable 12 new [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 8 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), val: (Variable 12 val [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_string_from_logical_lk (FunctionType [(Logical 4)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .true. .false. .true. .false. .false. [] .false. ) [] [(Var 12 val)] [] (Var 12 new) Public .true. .true. () ), string_type: (ExternalSymbol 8 string_type 2 string_type derived_types_05_stdlib_string_type [] string_type Public ), ~string_type: (ExternalSymbol 8 ~string_type 2 ~string_type derived_types_05_stdlib_string_type [] ~string_type Public ) }) stdlib_string_type_constructor derived_types_05_stdlib_string_type [derived_types_05_stdlib_string_type] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_array_04-ed63449.json0000664000175000017500000000077515174404631024723 0ustar alastairalastair{ "basename": "asr-template_array_04-ed63449", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_array_04.f90", "infile_hash": "4baecd1a31a51c75bc2200f740db7ffb3605fff739876acd7ca4b65b", "outfile": null, "outfile_hash": null, "stdout": "asr-template_array_04-ed63449.stdout", "stdout_hash": "ccdd68e54bb316143dbbb167d52bf130b50eb80d9cb417be1be30a2b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-where1-c237415.stdout0000664000175000017500000001264415174404631023061 0ustar alastairalastair(TranslationUnit [(Program test () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [(1 2 DimensionExpr) (1 2 DimensionExpr)] [] () (FuncCallOrArray reshape [] [(() (ArrayInitializer () () [1 2 3 4] ) () 0) (() (ArrayInitializer () () [2 2] ) () 0)] [] [] [] ) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Where 0 () (== x 1) [(Assignment 0 x 2 () )] [(Where 0 () (== x 2) [(Assignment 0 x 3 () )] [(Assignment 0 x (* x 2) () )] () () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (FuncCallOrArray all [] [(() (== x (FuncCallOrArray reshape [] [(() (ArrayInitializer () () [2 3 6 8] ) () 0) (() (ArrayInitializer () () [2 2] ) () 0)] [] [] [] )) () 0)] [] [] [] ) [(Print 0 () [(String "pass" ())] () )] [(Print 0 () [(String "fail" ())] () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Where 0 () (== x 2) [(Assignment 0 x 3 () )] [(Where 0 () (== x 3) [(Assignment 0 x 4 () )] [(Where 0 () (== x 6) [(Assignment 0 x (* x 2) () )] [] () () )] () () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (FuncCallOrArray all [] [(() (== x (FuncCallOrArray reshape [] [(() (ArrayInitializer () () [3 4 12 8] ) () 0) (() (ArrayInitializer () () [2 2] ) () 0)] [] [] [] )) () 0)] [] [] [] ) [(Print 0 () [(String "pass" ())] () )] [(Print 0 () [(String "fail" ())] () )] () () () )] [] )] ) lfortran-0.63.0/tests/reference/asr-array_04-5864f91.stderr0000664000175000017500000000021115174404631023267 0ustar alastairalastairsemantic error: Type member a is not an array so it cannot be indexed. --> tests/errors/array_04.f90:8:1 | 8 | b%a(:) = 1 | ^^^^^^ lfortran-0.63.0/tests/reference/ast-program_without_line_cc-78281a4.json0000664000175000017500000000115115174404631026220 0ustar alastairalastair{ "basename": "ast-program_without_line_cc-78281a4", "cmd": "lfortran --continue-compilation --show-ast --no-color {infile}", "infile": "tests/errors/program_without_line_cc.f90", "infile_hash": "516860f9855615c6727a984cf5f5ac39055860c9659a3dc0a17b814b", "outfile": null, "outfile_hash": null, "stdout": "ast-program_without_line_cc-78281a4.stdout", "stdout_hash": "c2d16e91f6a6c5b3aa27c0c453b0c32588ea7993f7dfcbf97ad3eef5", "stderr": "ast-program_without_line_cc-78281a4.stderr", "stderr_hash": "3a3b524012a2e28a46d7903cb16364e434d6d222f2babe9d4a003ff0", "returncode": 1 }lfortran-0.63.0/tests/reference/ast-nullify_01-24b8fbc.stdout0000664000175000017500000000321715174404631024066 0ustar alastairalastair(TranslationUnit [(Program nullify_01 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrPointer )] [(p1 [] [] () () None ()) (p2 [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrTarget )] [(t1 [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Associate 0 p1 t1 () ) (Associate 0 p2 t1 () ) (Assignment 0 p1 1 () ) (Nullify 0 [p1 p2] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/ast-Subroutine_Call1-8e53e13.stdout0000664000175000017500000001423015174404631025117 0ustar alastairalastair(TranslationUnit [(Program Subroutine_Call1 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (Comment "! Syntax check" ) (Comment "!Subroutine CALL" )] ) )] [] [(SubroutineCall 0 randn [] [(() (FuncCallOrArray x [] [(() i () 0)] [] [] [] ) () 0)] [] [] () ) (SubroutineCall 0 randn [] [(() x () 0)] [] [] () ) (SubroutineCall 0 random_number [] [(() U () 0)] [] [] () ) (SubroutineCall 0 rand_gamma0 [] [(() a () 0) (() (Logical .true. ()) () 0) (() x () 0)] [] [] () ) (SubroutineCall 0 rand_gamma0 [] [(() a () 0) (() (Logical .true. ()) () 0) (() (FuncCallOrArray x [] [(() 1 () 0)] [] [] [] ) () 0)] [] [] () ) (SubroutineCall 0 rand_gamma0 [] [(() a () 0) (() (Logical .false. ()) () 0) (() (FuncCallOrArray x [] [(() i () 0)] [] [] [] ) () 0)] [] [] () ) (SubroutineCall 0 rand_gamma_vector_n [] [(() a () 0) (() (FuncCallOrArray size [] [(() x () 0)] [] [] [] ) () 0) (() x () 0)] [] [] () ) (SubroutineCall 0 f [] [] [(a 4) (b 6) (c i)] [] () ) (SubroutineCall 0 g [] [(() (FuncCallOrArray a [] [(3 5 1 0) (i j 1 0)] [] [] [] ) () 0) (() (FuncCallOrArray b [] [(() () 1 0)] [] [] [] ) () 0)] [] [] () ) (SubroutineCall 0 g [] [(() (FuncCallOrArray a [] [(() 5 1 0) (i j 1 0)] [] [] [] ) () 0) (() (FuncCallOrArray b [] [(1 () 1 0)] [] [] [] ) () 0)] [] [] () ) (SubroutineCall 0 random_number [(a [])] [(() u () 0)] [] [] () ) (SubroutineCall 0 random_number [(a []) (b [])] [(() u () 0)] [] [] () ) (SubroutineCall 0 f [] [] [(a 4) (b 6) (c i)] [] () ) (SubroutineCall 0 e [(x []) (f [])] [] [] [] () ) (SubroutineCall 0 info [(self []) (dependency [(() ii () 0)])] [(() unit () 0) (() (- pr 1) () 0)] [] [] () ) (SubroutineCall 0 done [(self []) (dep [(() ndep [(self [])] 1 0)])] [(() a () 0)] [] [] () )] [] )] ) lfortran-0.63.0/tests/reference/run-scalar_allocation_check_06-2a9502c.stderr0000664000175000017500000000023615174404631027047 0ustar alastairalastairruntime error: Argument 1 is unallocated. --> tests/errors/scalar_allocation_check_06.f90:6:14 | 6 | print *, x | ^ This is unallocated lfortran-0.63.0/tests/reference/run-array_bounds_check_07-f220d33.stderr0000664000175000017500000000050215174404631026060 0ustar alastairalastairruntime error: Array shape mismatch in binary operation with operands 'x' and 'y'. Tried to match size 3 of dimension 1 of 'x' with size 4 of dimension 1 of 'y'. --> tests/errors/array_bounds_check_07.f90:12:9 | 12 | z = x + y | ^ LHS size is 3 | 12 | z = x + y | ^ RHS size is 4 lfortran-0.63.0/tests/reference/asr-implicit6-061f8e3.stdout0000664000175000017500000001317215174404631023645 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { ch12n: (Function (SymbolTable 2 { ch12n: (Variable 2 ch12n [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ci: (Variable 2 ci [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Unspecified () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ch12n (FunctionType [(Integer 4) (Complex 8)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 n) (Var 2 z)] [(Assignment (Var 2 ci) (ComplexConstructor (RealConstant 0.000000 (Real 8) ) (RealConstant 1.000000 (Real 8) ) (Complex 8) (ComplexConstant 0.000000 1.000000 (Complex 8) ) ) () .false. .false. )] (Var 2 ch12n) Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/run-print5-c57814b.json0000664000175000017500000000065715174404631022641 0ustar alastairalastair{ "basename": "run-print5-c57814b", "cmd": "lfortran --no-color {infile}", "infile": "tests/print5.f90", "infile_hash": "c7ecd7e820fbd2c3b434da8df807991ee8fea817267da5645ec00ade", "outfile": null, "outfile_hash": null, "stdout": "run-print5-c57814b.stdout", "stdout_hash": "adc8db165d335320aa3947351bd6577e658800b43f152e3aaaa5e376", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-expr4-6c75096.json0000664000175000017500000000070415174404631022362 0ustar alastairalastair{ "basename": "asr-expr4-6c75096", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr4.f90", "infile_hash": "104847f7b62623d6e9d6d752ab2c6c58a31b70bc70a9cae0b5809241", "outfile": null, "outfile_hash": null, "stdout": "asr-expr4-6c75096.stdout", "stdout_hash": "165f0be894fdc0bd46d8f7239c2179d258224f3ff0efc5dda62a6775", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-expr2-74c7f32.json0000664000175000017500000000070415174404631022434 0ustar alastairalastair{ "basename": "asr-expr2-74c7f32", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr2.f90", "infile_hash": "d666975e3f2e2c0cc5c739b85bb21073accdf5692bcb64c9e0278d62", "outfile": null, "outfile_hash": null, "stdout": "asr-expr2-74c7f32.stdout", "stdout_hash": "779df0dc56c4f27596ee9aa22ba65b5c6579804be8c7d869981fe28d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-classes2-f926d51.stdout0000664000175000017500000002653615174404631023665 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %defs.point_class = type <{ i32 (...)**, %defs.point* }> %defs.point = type {} %defs.point2d_class = type <{ i32 (...)**, %defs.point2d* }> %defs.point2d = type { %defs.point, float, float } @_Name_point = private unnamed_addr constant [6 x i8] c"point\00", align 1 @_Type_Info_point = linkonce_odr unnamed_addr constant { i8*, i8*, i8* } { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @_Name_point, i32 0, i32 0), i8* null, i8* null }, align 8 @_VTable_point = linkonce_odr unnamed_addr constant { [6 x i8*] } { [6 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_point to i8*), i8* bitcast (void (i8*, i8*)* @_copy_defs_point to i8*), i8* bitcast (void (i8**)* @_allocate_struct_defs_point to i8*), i8* bitcast (void (i8*)* @finalize_StructType__point_of_defs_for_UPoly to i8*), i8* null] }, align 8 @_Name_point2d = private unnamed_addr constant [8 x i8] c"point2d\00", align 1 @_Type_Info_point2d = linkonce_odr unnamed_addr constant { i8*, i8*, i8* } { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @_Name_point2d, i32 0, i32 0), i8* inttoptr (i64 8 to i8*), i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_point to i8*) }, align 8 @_VTable_point2d = linkonce_odr unnamed_addr constant { [6 x i8*] } { [6 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_point2d to i8*), i8* bitcast (void (i8*, i8*)* @_copy_defs_point2d to i8*), i8* bitcast (void (i8**)* @_allocate_struct_defs_point2d to i8*), i8* bitcast (void (i8*)* @finalize_StructType__point2d_of_defs_for_UPoly to i8*), i8* bitcast (float (%defs.point2d_class*)* @__module_defs_r2d to i8*)] }, align 8 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define float @__module_defs_r2d(%defs.point2d_class* %this) { .entry: %r2d = alloca float, align 4 %0 = getelementptr %defs.point2d_class, %defs.point2d_class* %this, i32 0, i32 1 %1 = load %defs.point2d*, %defs.point2d** %0, align 8 %2 = getelementptr %defs.point2d, %defs.point2d* %1, i32 0, i32 1 %3 = load float, float* %2, align 4 %simplified_pow_operation = fmul float %3, %3 %4 = getelementptr %defs.point2d_class, %defs.point2d_class* %this, i32 0, i32 1 %5 = load %defs.point2d*, %defs.point2d** %4, align 8 %6 = getelementptr %defs.point2d, %defs.point2d* %5, i32 0, i32 2 %7 = load float, float* %6, align 4 %simplified_pow_operation1 = fmul float %7, %7 %8 = fadd float %simplified_pow_operation, %simplified_pow_operation1 %9 = call float @llvm.sqrt.f32(float %8) store float %9, float* %r2d, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_r2d FINALIZE_SYMTABLE_r2d: ; preds = %return %10 = load float, float* %r2d, align 4 ret float %10 } ; Function Attrs: nounwind readnone speculatable willreturn declare float @llvm.sqrt.f32(float) #0 define i32 @main(i32 %0, i8** %1) { .entry: %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %p2d = alloca %defs.point2d, align 8 %3 = getelementptr %defs.point2d, %defs.point2d* %p2d, i32 0, i32 1 %4 = getelementptr %defs.point2d, %defs.point2d* %p2d, i32 0, i32 2 %5 = getelementptr %defs.point2d, %defs.point2d* %p2d, i32 0, i32 0 %ptr = alloca %defs.point_class*, align 8 store %defs.point_class* null, %defs.point_class** %ptr, align 8 %res = alloca float, align 4 %6 = getelementptr %defs.point2d, %defs.point2d* %p2d, i32 0, i32 1 store float 3.000000e+00, float* %6, align 4 %7 = getelementptr %defs.point2d, %defs.point2d* %p2d, i32 0, i32 2 store float 4.000000e+00, float* %7, align 4 %8 = load %defs.point_class*, %defs.point_class** %ptr, align 8 %9 = icmp eq %defs.point_class* %8, null br i1 %9, label %then, label %else then: ; preds = %.entry %10 = call i8* @_lfortran_get_default_allocator() %11 = call i8* @_lfortran_malloc_alloc(i8* %10, i64 16) call void @llvm.memset.p0i8.i32(i8* %11, i8 0, i32 16, i1 false) %12 = bitcast i8* %11 to %defs.point_class* store %defs.point_class* %12, %defs.point_class** %ptr, align 8 br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %13 = load %defs.point_class*, %defs.point_class** %ptr, align 8 %14 = bitcast %defs.point_class* %13 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_point2d, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %14, align 8 %15 = getelementptr %defs.point_class, %defs.point_class* %13, i32 0, i32 1 %16 = bitcast %defs.point2d* %p2d to %defs.point* store %defs.point* %16, %defs.point** %15, align 8 %17 = load %defs.point_class*, %defs.point_class** %ptr, align 8 %18 = bitcast %defs.point_class* %17 to float (%defs.point_class*)*** %19 = load float (%defs.point_class*)**, float (%defs.point_class*)*** %18, align 8 %20 = getelementptr inbounds float (%defs.point_class*)*, float (%defs.point_class*)** %19, i32 3 %21 = load float (%defs.point_class*)*, float (%defs.point_class*)** %20, align 8 %22 = call float %21(%defs.point_class* %17) store float %22, float* %res, align 4 %23 = load float, float* %res, align 4 %24 = fcmp une float %23, 5.000000e+00 br i1 %24, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 br label %return return: ; preds = %ifcont3 br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return br label %Finalize_Variable_ptr Finalize_Variable_ptr: ; preds = %FINALIZE_SYMTABLE_main %25 = load %defs.point_class*, %defs.point_class** %ptr, align 8 %26 = icmp ne %defs.point_class* %25, null br i1 %26, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %Finalize_Variable_ptr %27 = bitcast %defs.point_class* %25 to i8* call void @_lfortran_free_alloc(i8* %2, i8* %27) br label %is_allocated.ifcont is_allocated.else: ; preds = %Finalize_Variable_ptr br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %is_allocated.then call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc_alloc(i8*, i64) declare i8* @_lfortran_get_default_allocator() ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #1 define linkonce_odr void @_copy_defs_point(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %defs.point* %3 = bitcast i8* %1 to %defs.point* ret void } define linkonce_odr void @_allocate_struct_defs_point(i8** %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = call i8* @_lfortran_malloc_alloc(i8* %1, i64 16) call void @llvm.memset.p0i8.i32(i8* %2, i8 0, i32 16, i1 false) store i8* %2, i8** %0, align 8 %3 = load i8*, i8** %0, align 8 %4 = bitcast i8* %3 to %defs.point_class* %5 = bitcast %defs.point_class* %4 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_point, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %5, align 8 %6 = getelementptr %defs.point_class, %defs.point_class* %4, i32 0, i32 1 %7 = call i8* @_lfortran_get_default_allocator() %8 = call i8* @_lfortran_malloc_alloc(i8* %7, i64 0) call void @llvm.memset.p0i8.i32(i8* %8, i8 0, i32 0, i1 false) %9 = bitcast i8* %8 to %defs.point* store %defs.point* %9, %defs.point** %6, align 8 ret void } define internal void @finalize_StructType__point_of_defs_for_UPoly(i8* %0) { entry: %1 = bitcast i8* %0 to %defs.point* ret void } define linkonce_odr void @_copy_defs_point2d(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %defs.point2d* %3 = bitcast i8* %1 to %defs.point2d* %4 = getelementptr %defs.point2d, %defs.point2d* %2, i32 0, i32 1 %5 = load float, float* %4, align 4 %6 = getelementptr %defs.point2d, %defs.point2d* %3, i32 0, i32 1 br i1 true, label %then, label %else then: ; preds = %entry store float %5, float* %6, align 4 br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then %7 = getelementptr %defs.point2d, %defs.point2d* %2, i32 0, i32 2 %8 = load float, float* %7, align 4 %9 = getelementptr %defs.point2d, %defs.point2d* %3, i32 0, i32 2 br i1 true, label %then1, label %else2 then1: ; preds = %ifcont store float %8, float* %9, align 4 br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %10 = getelementptr %defs.point2d, %defs.point2d* %2, i32 0, i32 0 %11 = getelementptr %defs.point2d, %defs.point2d* %3, i32 0, i32 0 ret void } define linkonce_odr void @_allocate_struct_defs_point2d(i8** %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = call i8* @_lfortran_malloc_alloc(i8* %1, i64 16) call void @llvm.memset.p0i8.i32(i8* %2, i8 0, i32 16, i1 false) store i8* %2, i8** %0, align 8 %3 = load i8*, i8** %0, align 8 %4 = bitcast i8* %3 to %defs.point2d_class* %5 = bitcast %defs.point2d_class* %4 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_point2d, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %5, align 8 %6 = getelementptr %defs.point2d_class, %defs.point2d_class* %4, i32 0, i32 1 %7 = call i8* @_lfortran_get_default_allocator() %8 = call i8* @_lfortran_malloc_alloc(i8* %7, i64 8) call void @llvm.memset.p0i8.i32(i8* %8, i8 0, i32 8, i1 false) %9 = bitcast i8* %8 to %defs.point2d* store %defs.point2d* %9, %defs.point2d** %6, align 8 %10 = getelementptr %defs.point2d, %defs.point2d* %9, i32 0, i32 1 %11 = getelementptr %defs.point2d, %defs.point2d* %9, i32 0, i32 2 %12 = getelementptr %defs.point2d, %defs.point2d* %9, i32 0, i32 0 ret void } define internal void @finalize_StructType__point2d_of_defs_for_UPoly(i8* %0) { entry: %1 = bitcast i8* %0 to %defs.point2d* ret void } declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) declare void @_lfortran_free_alloc(i8*, i8*) attributes #0 = { nounwind readnone speculatable willreturn } attributes #1 = { argmemonly nounwind willreturn writeonly } lfortran-0.63.0/tests/reference/ast-loop_test1-7800c18.stdout0000664000175000017500000000425315174404631023756 0ustar alastairalastair(TranslationUnit [(Program main () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(kp [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ()) (do330i [] [] () () None ())] () )] [(Assignment 0 kp 10 () ) (DoLoop 0 () 330 i 1 kp () [(DoLoop 0 () 320 j (+ i 1) kp () [(If 0 () (> 0 1) [(Print 0 () [i j] () )] [(Print 0 () [j i] () )] () () () ) (Continue 320 () )] () () ) (Continue 330 () )] () () ) (Assignment 0 do330i 15 () )] [] )] ) lfortran-0.63.0/tests/reference/asr-intrinsics_02-1c20d1a.json0000664000175000017500000000076115174404631024121 0ustar alastairalastair{ "basename": "asr-intrinsics_02-1c20d1a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_02.f90", "infile_hash": "9042eb55a868aba778eaccfaba75217700b9f99f157df367ffc005fd", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_02-1c20d1a.stdout", "stdout_hash": "4e76f9652a3d5b6bd501ac01d62b68d2946107528e9f26d61f71a730", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-types_13-76138b5.json0000664000175000017500000000106115174404631022762 0ustar alastairalastair{ "basename": "ast-types_13-76138b5", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_13.f90", "infile_hash": "0386b3b949293ae071687d72cec51980cbdce80908080fa69e19a807", "outfile": null, "outfile_hash": null, "stdout": "ast-types_13-76138b5.stdout", "stdout_hash": "f39de7cbaea94bff362cd2cad976e8c04c930150c7a0b8049ca5fd87", "stderr": "ast-types_13-76138b5.stderr", "stderr_hash": "44623a78eb46ca78c3622e964b0d57198c877bd80dad64fca178c250", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_52-5261d38.stdout0000664000175000017500000011235215174404631023643 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { module_52_fpm_cmd_new: (Module (SymbolTable 2 { validate_toml_data: (Function (SymbolTable 3 { input: (Variable 3 input [] In () () Default (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), table: (Variable 3 table [] Local () () Default (Allocatable (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) 3 toml_table Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), toml_parse: (ExternalSymbol 3 toml_parse 5 toml_parse module_52_tomlf_de [] toml_parse Public ), toml_parse@toml_parse_string: (ExternalSymbol 3 toml_parse@toml_parse_string 5 toml_parse_string module_52_tomlf_de [] toml_parse_string Private ), toml_parse_string@toml_parse: (ExternalSymbol 3 toml_parse_string@toml_parse 5 toml_parse_string module_52_tomlf_de [] toml_parse_string Public ), toml_parse_unit@toml_parse: (ExternalSymbol 3 toml_parse_unit@toml_parse 5 toml_parse_unit module_52_tomlf_de [] toml_parse_unit Public ), toml_table: (ExternalSymbol 3 toml_table 12 toml_table module_52_tomlf_type [] toml_table Public ) }) validate_toml_data (FunctionType [(Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 input)] [(If () (IntrinsicImpureFunction Allocated [(Var 3 table)] 0 (Logical 4) () ) [(ExplicitDeallocate [(Var 3 table)] )] [] ) (SubroutineCall 3 toml_parse@toml_parse_string 3 toml_parse [((Var 3 table)) ((Var 3 input)) (())] () .false. )] () Public .true. .true. () ) }) module_52_fpm_cmd_new () [module_52_tomlf_de module_52_tomlf_type] .false. .false. .false. ), module_52_tomlf_de: (Module (SymbolTable 5 { toml_error: (ExternalSymbol 5 toml_error 9 toml_error module_52_tomlf_error [] toml_error Public ), toml_parse: (GenericProcedure 5 toml_parse [5 toml_parse_unit 5 toml_parse_string] Public ), toml_parse_string: (Function (SymbolTable 6 { conf: (Variable 6 conf [] In () () Default (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray ) () Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), error: (Variable 6 error [] Out () () Default (Allocatable (StructType [(Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 5 toml_error Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), table: (Variable 6 table [] Out () () Default (Allocatable (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) 5 toml_table Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_parse_string (FunctionType [(Allocatable (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray ) (Allocatable (StructType [(Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 table) (Var 6 conf) (Var 6 error)] [] () Public .true. .true. () ), toml_parse_unit: (Function (SymbolTable 7 { error: (Variable 7 error [] Out () () Default (Allocatable (StructType [(Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 5 toml_error Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), table: (Variable 7 table [] Out () () Default (Allocatable (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) 5 toml_table Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), unit: (Variable 7 unit [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_parse_unit (FunctionType [(Allocatable (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) (Integer 4) (Allocatable (StructType [(Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 table) (Var 7 unit) (Var 7 error)] [] () Public .true. .true. () ), toml_table: (ExternalSymbol 5 toml_table 12 toml_table module_52_tomlf_type [] toml_table Public ) }) module_52_tomlf_de () [module_52_tomlf_error module_52_tomlf_type] .true. .false. .false. ), module_52_tomlf_error: (Module (SymbolTable 9 { toml_error: (Struct (SymbolTable 10 { message: (Variable 10 message [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), stat: (Variable 10 stat [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_error (StructType [(Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [stat message] [] Source Public .false. .false. [] () () [] ) }) module_52_tomlf_error () [] .true. .false. .false. ), module_52_tomlf_type: (Module (SymbolTable 12 { toml_table: (Struct (SymbolTable 13 { implicit: (Variable 13 implicit [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), inline: (Variable 13 inline [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_table (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) [] [implicit inline] [] Source Public .false. .false. [] () () [] ) }) module_52_tomlf_type () [] .true. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/run-print3-b6beca0.json0000664000175000017500000000065715174404631023044 0ustar alastairalastair{ "basename": "run-print3-b6beca0", "cmd": "lfortran --no-color {infile}", "infile": "tests/print3.f90", "infile_hash": "891fa35fc5d09524ef73c8c3b92bcd5a4bede01e35fdf0f116df99b2", "outfile": null, "outfile_hash": null, "stdout": "run-print3-b6beca0.stdout", "stdout_hash": "b7a8e92f3ad654f0db00b67a50310de56893a8ef6bcf296f40cdece5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/lookup_name-lookup_name2-458b8c9.stdout0000664000175000017500000000026315174404631026073 0ustar alastairalastair[{"kind":9,"location":{"range":{"start":{"character":12,"line":3},"end":{"character":12,"line":3}},"uri":"tests/lookup_name2.f90"},"name":"x","filename":"tests/lookup_name2.f90"}]lfortran-0.63.0/tests/reference/ast-derived_types_09-0e83add.json0000664000175000017500000000074515174404631024712 0ustar alastairalastair{ "basename": "ast-derived_types_09-0e83add", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/derived_types_09.f90", "infile_hash": "d527015d1a945260af61c70d3ae6288e719154a453713f2aa9eb4072", "outfile": null, "outfile_hash": null, "stdout": "ast-derived_types_09-0e83add.stdout", "stdout_hash": "9ed2f47ace8c6ae137ffa8c4fd6b2e084fb8af287bce887934eb511e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-string_14-861794e.json0000664000175000017500000000074515174404631023143 0ustar alastairalastair{ "basename": "asr-string_14-861794e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_14.f90", "infile_hash": "5cc44728083840d1d00b687489a0ef17523de1d11209ccb39b49f42f", "outfile": null, "outfile_hash": null, "stdout": "asr-string_14-861794e.stdout", "stdout_hash": "2649c950f3f48e402ca26198155d7aa8e65e568072685323c1d05124", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-goto_02-fc47ad0.stdout0000664000175000017500000001042415174404631023351 0ustar alastairalastair(TranslationUnit [(Program goto2 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(A [] [] () () None ())] () )] [(Assignment 0 A 0 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Continue 1 () ) (Write 0 [(()) (())] [] [] () ) (Assignment 0 A (+ A 1) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (> A 2) [(GoTo 0 () 95 [] () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Write 0 [(()) (())] [] [(String "A =" ()) A (String " Starting" ())] () ) (If 0 () (== A 1) [(GoTo 0 () 10 [] () )] [] () () () ) (GoTo 0 () 20 [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Continue 10 () ) (Write 0 [(()) (())] [] [(String "A =" ()) A (String " Got to 10" ())] () ) (GoTo 0 () 30 [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Continue 20 () ) (Write 0 [(()) (())] [] [(String "A =" ()) A (String " Got to 20" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Continue 30 () ) (Write 0 [(()) (())] [] [(String "A =" ()) A (String " Got to 30" ())] () ) (If 0 () (== A 2) [(GoTo 0 () 99 [] () )] [] () () () ) (GoTo 0 () 1 [] (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) ) (Continue 95 () ) (Write 0 [(()) (())] [] [(String "A =" ()) A (String " Got to 95" ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) ) (Continue 99 () ) (Write 0 [(()) (())] [] [(String "A =" ()) A (String " Got to 99" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Stop 0 (String " " ()) () () )] [] )] ) lfortran-0.63.0/tests/reference/asr-parameter_01-ee9f18c.stderr0000664000175000017500000000035515174404631024355 0ustar alastairalastairsemantic error: Cannot assign to a constant variable --> tests/errors/parameter_01.f90:3:5 | 3 | i = 3 | ^^^^^ assignment here | 2 | integer, parameter :: i = 2 | ~~~~~ declared as constant lfortran-0.63.0/tests/reference/asr-protected_01-1f0c640.stderr0000664000175000017500000000024415174404631024202 0ustar alastairalastairsemantic error: Variable temp_c is PROTECTED and cannot appear in LHS of assignment --> tests/errors/protected_01.f90:19:3 | 19 | temp_c = 10 | ^^^^^^ lfortran-0.63.0/tests/reference/asr_preprocess-unterminated_ifndef_01-1761667.stderr0000664000175000017500000000016515174404631030350 0ustar alastairalastairC preprocessor error: Unterminated #ifndef --> tests/errors/unterminated_ifndef_01.f90:1:1 | 1 | #ifndef a | ^ lfortran-0.63.0/tests/reference/asr-intrinsics_27-11ba39d.stdout0000664000175000017500000001520115174404631024505 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_27: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_27 [] [(Print (StringFormat () [(IntrinsicArrayFunction Shape [(ArrayPhysicalCast (Var 2 a) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 8 [3, 4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArraySize (IntrinsicArrayFunction Shape [(IntegerConstant 42 (Integer 4) Decimal)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstructor [] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] FixedSizeArray ) () ColMajor () ) ) () (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_error_07b-d39ea05.stdout0000664000175000017500000001052215174404631025513 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_01: (Program (SymbolTable 5 { semigroup: (ExternalSymbol 5 semigroup 2 semigroup template_01_m [] semigroup Public ) }) template_01 [template_01_m] [] ), template_01_m: (Module (SymbolTable 2 { semigroup: (Requirement (SymbolTable 3 { t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) semigroup [t combine] [] ), test_template: (Function (SymbolTable 4 { }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Private .true. .true. () ) }) template_01_m () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/wat-abs_03-5d62cca.json0000664000175000017500000000071715174404631022605 0ustar alastairalastair{ "basename": "wat-abs_03-5d62cca", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/abs_03.f90", "infile_hash": "ffb5c4ae935fc9de02705f53a5f1fe41b7acf18c9371f871897b63f4", "outfile": null, "outfile_hash": null, "stdout": "wat-abs_03-5d62cca.stdout", "stdout_hash": "6e37cfb34c5bc1bf29aebc6c4cd5120c46a8c96a4192330b73d8b011", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics9-4da86d0.json0000664000175000017500000000073515174404631023731 0ustar alastairalastair{ "basename": "asr-intrinsics9-4da86d0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics9.f90", "infile_hash": "8294de283855321ea1d1c2b9a944c6beaf51fe1891a8a08cb8dec654", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics9-4da86d0.stderr", "stderr_hash": "b9a8671e623444b8fd1abbf855824ec278aaa06a74993ae4faedfed4", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-class_02-b56b852.json0000664000175000017500000000106115174404631022775 0ustar alastairalastair{ "basename": "asr-class_02-b56b852", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/class_02.f90", "infile_hash": "d9600a16766ae051943b344e946afd7523b8f9d66250d6cd908135cc", "outfile": null, "outfile_hash": null, "stdout": "asr-class_02-b56b852.stdout", "stdout_hash": "e2d2707f1a51a4fa3a711749b2eec07632938c6efad87c7d0871ae6a", "stderr": "asr-class_02-b56b852.stderr", "stderr_hash": "cbe4c6f9d712b9d5ee417de42e2ce3b69d43ea5a0b463256ad71acfe", "returncode": 0 }lfortran-0.63.0/tests/reference/ast-interface_03-c3dfda4.stdout0000664000175000017500000001253415174404631024426 0ustar alastairalastair(TranslationUnit [(Program interface_03 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Interface (InterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceProc (Subroutine a1 [(a)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () )] [] [] [] ) )] ) (Interface (InterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceProc (Subroutine a2 [(a)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Subroutine a3 [(a)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () )] [] [] [] ) )] ) (Declaration (AttrType TypeProcedure [] () a1 None ) [] [(sub [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Subroutine X [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Interface (InterfaceHeader) () [(InterfaceProc (Subroutine a4 [(a)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () )] [] [] [] ) )] )] [] [] [] )] )] ) lfortran-0.63.0/tests/reference/asr-case_03-e03f722.stdout0000664000175000017500000002217715174404631023163 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { case03: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), marks: (Variable 2 marks [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) case03 [] [(Assignment (Var 2 marks) (IntegerConstant 94 (Integer 4) Decimal) () .false. .false. ) (Select () (Var 2 marks) [(CaseStmt_Range (IntegerBinOp (IntegerConstant 40 (Integer 4) Decimal) Add (Var 2 b) (Integer 4) (IntegerConstant 42 (Integer 4) Decimal) ) () [(Print (StringConstant "Pass!" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range () (IntegerBinOp (IntegerConstant 39 (Integer 4) Decimal) Sub (Var 2 a) (Integer 4) (IntegerConstant 38 (Integer 4) Decimal) ) [(Print (StringConstant "Failed!" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(Print (StringConstant "Invalid marks" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your marks are " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 marks)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 marks) (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) () .false. .false. ) (Select () (Var 2 marks) [(CaseStmt_Range (IntegerBinOp (IntegerConstant 40 (Integer 4) Decimal) Add (Var 2 b) (Integer 4) (IntegerConstant 42 (Integer 4) Decimal) ) () [(Print (StringConstant "Pass!" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 0 (Integer 4) Decimal) (IntegerBinOp (IntegerConstant 39 (Integer 4) Decimal) Sub (Var 2 a) (Integer 4) (IntegerConstant 38 (Integer 4) Decimal) ) [(Print (StringConstant "Failed!" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(Print (StringConstant "Invalid marks" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your marks are " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 marks)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-fixed_form_implicit3-7f279ac.stdout0000664000175000017500000001166715174404631026143 0ustar alastairalastair(TranslationUnit [(Function c0 [(a)] [(AttrType TypeCharacter [] () () None )] () () () [] [] [] [] [] [] [] ) (Function c1 [(a)] [(AttrType TypeCharacter [(() 1 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function c11 [(a)] [(AttrType TypeCharacter [(() 11 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function c111 [(a)] [(AttrType TypeCharacter [(() 111 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function cstar [(a)] [(AttrType TypeCharacter [] () () DoubleAsterisk )] () () () [] [] [] [] [] [] [] ) (Function i0 [(a)] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [] [] [] [] ) (Function i4 [(a)] [(AttrType TypeInteger [(() 4 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function i8 [(a)] [(AttrType TypeInteger [(() 8 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function r0 [(a)] [(AttrType TypeReal [] () () None )] () () () [] [] [] [] [] [] [] ) (Function r4 [(a)] [(AttrType TypeReal [(() 4 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function r8 [(a)] [(AttrType TypeReal [(() 8 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function cm0 [(a)] [(AttrType TypeComplex [] () () None )] () () () [] [] [] [] [] [] [] ) (Function cm4 [(a)] [(AttrType TypeComplex [(() 4 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function cm8 [(a)] [(AttrType TypeComplex [(() 8 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function l0 [(a)] [(AttrType TypeLogical [] () () None )] () () () [] [] [] [] [] [] [] ) (Function l1 [(a)] [(AttrType TypeLogical [(() 1 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function l4 [(a)] [(AttrType TypeLogical [(() 4 Value)] () () None )] () () () [] [] [] [] [] [] [] )] ) lfortran-0.63.0/tests/reference/ast-subroutine3b-98faad7.json0000664000175000017500000000073115174404631024166 0ustar alastairalastair{ "basename": "ast-subroutine3b-98faad7", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine3b.f90", "infile_hash": "0726b3cb8b3ba1a2fc624a4215146065a6ce9a6a0b460ebe40c172a5", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine3b-98faad7.stdout", "stdout_hash": "9871ce47e692f7a9d3f9f9effc38643f3e9c812b5fdfc430c711e1cd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-string_slice-e254cc2.json0000664000175000017500000000074015174404631024131 0ustar alastairalastair{ "basename": "asr-string_slice-e254cc2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/string_slice.f90", "infile_hash": "aaca6852e69f3ef20f618e36d1c1e75e52528c5ff757dd6d30538c13", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-string_slice-e254cc2.stderr", "stderr_hash": "eb2f724d3e0930b420e4c4636c9056fcd134db92d78b8abe91fbbd5e", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-block1-ff0f95d.json0000664000175000017500000000070715174404631022720 0ustar alastairalastair{ "basename": "ast-block1-ff0f95d", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/block1.f90", "infile_hash": "195aaf0b0ae556975d0d7c84d1ff451d793614e176384294a288b08c", "outfile": null, "outfile_hash": null, "stdout": "ast-block1-ff0f95d.stdout", "stdout_hash": "af9b8a5af97f436f569bdda60c8632377c70b1bd1126c9086e2f62b4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_06-5ae916e.json0000664000175000017500000000077215174404631024634 0ustar alastairalastair{ "basename": "asr-derived_types_06-5ae916e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_06.f90", "infile_hash": "755cad69ac7bfd9d2d069a753b811e2f76bec02faf78f74031b9f2c1", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_06-5ae916e.stdout", "stdout_hash": "1d1e5431a7f28c59df768d5a1ed56dd8ad53eae7057285aa89294372", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-binop_03-d0adef1.json0000664000175000017500000000074515174404631023404 0ustar alastairalastair{ "basename": "llvm-binop_03-d0adef1", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/binop_03.f90", "infile_hash": "40773874fce64382337a961de0452b96aa45b51534cabb1e1f791341", "outfile": null, "outfile_hash": null, "stdout": "llvm-binop_03-d0adef1.stdout", "stdout_hash": "f3e3083a1639935d2ac46adc550ed153fa34df4a6741292b3024a999", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-dim_float_03-ba04334.stderr0000664000175000017500000000027515174404631024152 0ustar alastairalastairsemantic error: `dim` argument of `Sum` intrinsic must be INTEGER --> tests/errors/dim_float_03.f90:2:26 | 2 | print *, sum([1, 2, 3], .true., 1.1) | ^^^^^^ lfortran-0.63.0/tests/reference/asr-atomic_01-1c877f0.json0000664000175000017500000000072715174404631023155 0ustar alastairalastair{ "basename": "asr-atomic_01-1c877f0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/atomic_01.f90", "infile_hash": "e5001ac4b903b55446e4522c9f89e7d9b9553efe2a29fbcbf5e28ec4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-atomic_01-1c877f0.stderr", "stderr_hash": "b5425aecd23bfaf3bcfc835e65dcb28e6209073ae0db8de396bc47dd", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-coarrays_02-ea9dc2c.json0000664000175000017500000000072615174404631023741 0ustar alastairalastair{ "basename": "ast-coarrays_02-ea9dc2c", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/coarrays_02.f90", "infile_hash": "b8a582ffc5b086c98bf8f601c32831d648b199fc53bb272628421da9", "outfile": null, "outfile_hash": null, "stdout": "ast-coarrays_02-ea9dc2c.stdout", "stdout_hash": "9379d9b17be1929c55ce40dc9fda706fcf87f3a926136690d45dda81", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-reserved_02-a00a6f2.stdout0000664000175000017500000000037015174404631024604 0ustar alastairalastairprogram reserved_02 implicit none if (integer() /= 1) then error stop end if contains integer function integer() integer :: function function = 5 function = function/function integer = function end function integer end program reserved_02 lfortran-0.63.0/tests/reference/asr-subroutines_01-d48abaa.json0000664000175000017500000000076415174404631024471 0ustar alastairalastair{ "basename": "asr-subroutines_01-d48abaa", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_01.f90", "infile_hash": "b2e2d562bcd951782b14a4d5cfe68f5ff7db528636d556aa7ea9230e", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutines_01-d48abaa.stdout", "stdout_hash": "f1124cb45fdfe3761c95ccbe56229c26e4374f354d0236c7831ffc0e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-program4-c375e95.stdout0000664000175000017500000001767015174404631023521 0ustar alastairalastair(TranslationUnit [(Program program4 () [] [] [(Declaration (AttrType TypeReal [] () () None ) [] [(x [] [] () () None ()) (y [] [] () () None ()) (z [] [] () () None ())] () )] [(Assignment 0 x (Real "1.0") () ) (Assignment 0 y (Real "2.0") (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 z (FuncCallOrArray func1 [] [(() x () 0) (() y () 0)] [] [] [] ) () ) (Print 0 () [(String "6.0 == " ()) z] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 z (FuncCallOrArray func1 [] [(() x () 0) (() y () 0)] [] [] [] ) () ) (Print 0 () [(String "7.0 == " ()) z] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 z (FuncCallOrArray func2 [] [(() x () 0) (() y () 0)] [] [] [] ) () ) (Print 0 () [(String "6.0 == " ()) z] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 z (FuncCallOrArray func2 [] [(() x () 0) (() y () 0)] [] [] [] ) () ) (Print 0 () [(String "8.0 == " ()) z] () )] [(Function func1 [(a) (b)] [] c () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrSave )] [(saved [] [] () (Real "2.0") Equal ())] () )] [(Assignment 0 saved (+ saved (Real "1.0")) () ) (Assignment 0 c (+ (+ (+ c a) b) saved) () )] [] [] ) (Function func2 [(a) (b)] [] c () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(saved1 [] [] () (Real "2.0") Equal ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrSave )] [(saved2 [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(d [] [] () () None ())] () )] [(Assignment 0 saved1 (+ saved1 (Real "1.0")) () ) (Assignment 0 c (+ (+ (+ (+ (+ d c) a) b) saved1) saved2) () ) (Assignment 0 saved2 (+ saved2 (Real "1.0")) () ) (Assignment 0 d (+ d (Real "3.0")) () )] [] [] )] )] ) lfortran-0.63.0/tests/reference/asr-template_add_01c-a5654a9.json0000664000175000017500000000077215174404631024466 0ustar alastairalastair{ "basename": "asr-template_add_01c-a5654a9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_add_01c.f90", "infile_hash": "8506b19e196f32a246b465b8b7184bb300101d2d4accb7616c130c4d", "outfile": null, "outfile_hash": null, "stdout": "asr-template_add_01c-a5654a9.stdout", "stdout_hash": "a7372b991913d779cc0c0c783a8543c87f4395a9373479952b74e080", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-boz_01-def9db5.stderr0000664000175000017500000000037715174404631023436 0ustar alastairalastairwarning: BOZ literal constant with 'Z' prefix truncated to maximum 16 characters from left to fit data type --> tests/../integration_tests/boz_01.f90:12:13 | 12 | boz_5 = int(Z'2234567890abcdef1') | ^^^^^^^^^^^^^^^^^^^^ BOZ truncation lfortran-0.63.0/tests/reference/llvm-callback_04-0d9515f.stdout0000664000175000017500000000574215174404631024176 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [4 x i8] c"Dr. " @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [7 x i8] c"Fortran" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([7 x i8], [7 x i8]* @string_const_data.1, i32 0, i32 0), i64 7 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_dr_fortran_cb_print_dr() { .entry: %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %0, i32 4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_print_dr FINALIZE_SYMTABLE_print_dr: ; preds = %return ret void } define void @__module_dr_fortran_cb_print_dr_fortran(void ()* %title_or_name) { .entry: call void %title_or_name() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_print_dr_fortran FINALIZE_SYMTABLE_print_dr_fortran: ; preds = %return ret void } declare void @title_or_name() define void @__module_dr_fortran_cb_print_fortran() { .entry: %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %0, i32 7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_print_fortran FINALIZE_SYMTABLE_print_fortran: ; preds = %return ret void } declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @__module_dr_fortran_cb_print_dr_fortran(void ()* @__module_dr_fortran_cb_print_dr) call void @__module_dr_fortran_cb_print_dr_fortran(void ()* @__module_dr_fortran_cb_print_fortran) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-fma-8bc0756.stdout0000664000175000017500000006031015174404631022506 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fma: (Program (SymbolTable 2 { b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pi: (Variable 2 pi [] Local (RealConstant 3.140000 (Real 4) ) (RealConstant 3.140000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 2 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s1: (Variable 2 s1 [] Local (Cast (RealConstant 1.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 1.000000 (Real 8) ) () ) (RealConstant 1.000000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s2: (Variable 2 s2 [] Local (Cast (RealConstant 2.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 2.000000 (Real 8) ) () ) (RealConstant 2.000000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local (RealConstant 4.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local (Cast (RealConstant 1.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 1.000000 (Real 8) ) () ) (RealConstant 1.000000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fma [] [(Assignment (Var 2 x) (RealBinOp (RealBinOp (RealBinOp (Var 2 x) Mul (Cast (IntegerConstant 4 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 4.000000 (Real 4) ) () ) (Real 4) () ) Add (RealBinOp (RealConstant 0.500000 (Real 4) ) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (Var 2 x)] 0 (Real 4) () ) (Real 4) () ) (Real 4) () ) Sub (RealBinOp (Var 2 x) Mul (Var 2 pi) (Real 4) () ) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 z) (RealBinOp (Var 2 s1) Add (RealBinOp (Var 2 z) Mul (Var 2 s2) (Real 8) () ) (Real 8) () ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealConstant 3.940000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 z) Sub (Cast (RealConstant 3.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 3.000000 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000001 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000001 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 1, 1, ...., 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 2 r) (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntrinsicElementalFunction Nint [(IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (RealBinOp (Var 2 r) Add (RealBinOp (Var 2 r) Mul (Var 2 r) (Real 4) () ) (Real 4) () )] 0 (Real 4) () )] 0 (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Cast (RealBinOp (Var 2 r) Sub (RealBinOp (Var 2 r) Mul (Var 2 r) (Real 4) () ) (Real 4) () ) RealToInteger (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-intrinsics6-1d3a4b4.stderr0000664000175000017500000000025315174404631024243 0ustar alastairalastairsemantic error: Kind of all the arguments of Ieor must be the same --> tests/errors/intrinsics6.f90:2:14 | 2 | print *, ieor(1, 1_8) | ^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-subroutines_06-1ab6665.stdout0000664000175000017500000005332215174404631024633 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { subroutines_06: (Program (SymbolTable 7 { assign_large: (ExternalSymbol 7 assign_large 2 assign_large subroutines_06_bitset [] assign_large Public ), assign_logint8_large: (ExternalSymbol 7 assign_logint8_large 2 assign_logint8_large subroutines_06_bitset [] assign_logint8_large Public ), error_handler: (ExternalSymbol 7 error_handler 2 error_handler subroutines_06_bitset [] error_handler Public ), error_handler~genericprocedure: (ExternalSymbol 7 error_handler~genericprocedure 2 error_handler~genericprocedure subroutines_06_bitset [] error_handler~genericprocedure Public ), ~assign: (ExternalSymbol 7 ~assign 2 ~assign subroutines_06_bitset [] ~assign Public ) }) subroutines_06 [subroutines_06_bitset] [] ), subroutines_06_bitset: (Module (SymbolTable 2 { assign_large: (Function (SymbolTable 3 { set1: (Variable 3 set1 [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), set2: (Variable 3 set2 [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) assign_large (FunctionType [(Integer 4) (Integer 4)] () Source Interface () .false. .true. .true. .false. .false. [] .false. ) [] [(Var 3 set1) (Var 3 set2)] [] () Public .false. .true. () ), assign_logint8_large: (Function (SymbolTable 4 { logical_vector: (Variable 4 logical_vector [] In () () Default (Array (Logical 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 4 self [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) assign_logint8_large (FunctionType [(Integer 4) (Array (Logical 4) [(() ())] DescriptorArray )] () Source Interface () .false. .true. .true. .false. .false. [] .false. ) [] [(Var 4 self) (Var 4 logical_vector)] [] () Public .false. .true. () ), error_handler: (GenericProcedure 2 error_handler [2 error_handler~genericprocedure] Public ), error_handler~genericprocedure: (Function (SymbolTable 6 { error: (Variable 6 error [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), message: (Variable 6 message [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), module: (Variable 6 module [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), procedure: (Variable 6 procedure [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), status: (Variable 6 status [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) error_handler~genericprocedure (FunctionType [(String 1 () AssumedLength DescriptorString) (Integer 4) (Integer 4) (String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .false. .true. .false. .false. [] .false. ) [] [(Var 6 message) (Var 6 error) (Var 6 status) (Var 6 module) (Var 6 procedure)] [(Print (StringFormat () [(Var 6 error) (Var 6 status)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), ~assign: (CustomOperator 2 ~assign [2 assign_large 2 assign_logint8_large] Public ) }) subroutines_06_bitset () [] .false. .false. .true. ) }) [] ) lfortran-0.63.0/tests/reference/asr-intrinsics11-7200632.json0000664000175000017500000000074015174404631023547 0ustar alastairalastair{ "basename": "asr-intrinsics11-7200632", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics11.f90", "infile_hash": "a1421b32cc55564ceeab263ddf15d4e31e93c87c30ac8acc8e8948b0", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics11-7200632.stderr", "stderr_hash": "31c7c19f850d3ab5ef6c98b67f6612aa86499f43eda5cc1949bd4beb", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-modules_28-9506bba.stdout0000664000175000017500000017025115174404631024004 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fpm_git: (Module (SymbolTable 11 { git_target_branch: (Function (SymbolTable 13 { 1_git_target_t_object: (ExternalSymbol 13 1_git_target_t_object 12 object git_target_t [] object Public ), 1_git_target_t_url: (ExternalSymbol 13 1_git_target_t_url 12 url git_target_t [] url Public ), branch: (Variable 13 branch [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 13 self [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 11 git_target_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), url: (Variable 13 url [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) git_target_branch (FunctionType [(String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 url) (Var 13 branch)] [(Assignment (StructInstanceMember (Var 13 self) 13 1_git_target_t_url (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 13 url) () .false. .false. ) (Assignment (StructInstanceMember (Var 13 self) 13 1_git_target_t_object (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 13 branch) () .false. .false. )] (Var 13 self) Public .true. .true. () ), git_target_t: (Struct (SymbolTable 12 { object: (Variable 12 object [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), url: (Variable 12 url [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) git_target_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [url object] [] Source Public .false. .false. [] () () [] ) }) fpm_git () [] .true. .false. .false. ), fpm_manifest_dependency: (Module (SymbolTable 4 { dependency_config_t: (Struct (SymbolTable 5 { git: (Variable 5 git [] Local () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 4 git_target_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), name: (Variable 5 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), path: (Variable 5 path [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) dependency_config_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. ) [] [name path git] [] Source Public .false. .false. [] () () [] ), error_t: (Struct (SymbolTable 6 { message: (Variable 6 message [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) error_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [message] [] Source Public .false. .false. [] () () [] ), git_target_branch: (ExternalSymbol 4 git_target_branch 11 git_target_branch fpm_git [] git_target_branch Public ), git_target_t: (ExternalSymbol 4 git_target_t 11 git_target_t fpm_git [] git_target_t Public ), new_dependencies: (Function (SymbolTable 8 { deps: (Variable 8 deps [] Out () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 4 dependency_config_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), error: (Variable 8 error [] Out () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 4 error_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), root: (Variable 8 root [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), table: (Variable 8 table [] InOut () () Default (StructType [(Logical 4)] [] .true. .false. ) 4 toml_table Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_dependencies (FunctionType [(Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (StructType [(Logical 4)] [] .true. .false. ) (String 1 () AssumedLength DescriptorString) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 deps) (Var 8 table) (Var 8 root) (Var 8 error)] [] () Public .true. .true. () ), new_dependency: (Function (SymbolTable 9 { 1_dependency_config_t_git: (ExternalSymbol 9 1_dependency_config_t_git 5 git dependency_config_t [] git Public ), obj: (Variable 9 obj [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 9 self [] Out () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. ) 4 dependency_config_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), url: (Variable 9 url [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_dependency (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 self)] [(If () (LogicalNot (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 9 self) 9 1_dependency_config_t_git (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () )] 0 (Logical 4) () ) (Logical 4) () ) [(Allocate [((StructInstanceMember (Var 9 self) 9 1_dependency_config_t_git (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) [] () () ())] () () () )] [] ) (Assignment (StructInstanceMember (Var 9 self) 9 1_dependency_config_t_git (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) (FunctionCall 4 git_target_branch () [((Var 9 url)) ((Var 9 obj))] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) () () ) () .false. .false. )] () Public .true. .true. () ), toml_table: (Struct (SymbolTable 7 { inline: (Variable 7 inline [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_table (StructType [(Logical 4)] [] .true. .false. ) [] [inline] [] Source Public .false. .false. [] () () [] ) }) fpm_manifest_dependency () [fpm_git] .true. .false. .false. ), modules_28: (Program (SymbolTable 2 { dependency_config_t: (ExternalSymbol 2 dependency_config_t 4 dependency_config_t fpm_manifest_dependency [] dependency_config_t Public ), error_t: (ExternalSymbol 2 error_t 4 error_t fpm_manifest_dependency [] error_t Public ), git_target_branch: (ExternalSymbol 2 git_target_branch 11 git_target_branch fpm_git [] git_target_branch Public ), git_target_t: (ExternalSymbol 2 git_target_t 11 git_target_t fpm_git [] git_target_t Public ), new_dependencies: (ExternalSymbol 2 new_dependencies 4 new_dependencies fpm_manifest_dependency [] new_dependencies Public ), new_dependency: (ExternalSymbol 2 new_dependency 4 new_dependency fpm_manifest_dependency [] new_dependency Public ), toml_table: (ExternalSymbol 2 toml_table 4 toml_table fpm_manifest_dependency [] toml_table Public ) }) modules_28 [fpm_manifest_dependency fpm_git] [(Print (StringConstant "running modules_28 program" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-complex_sub_test-7959339.json0000664000175000017500000000077515174404631025025 0ustar alastairalastair{ "basename": "llvm-complex_sub_test-7959339", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_sub_test.f90", "infile_hash": "9f572986fbed1d55d70fd8cd6941a7aaff7a29b92b0b8eada122ac20", "outfile": null, "outfile_hash": null, "stdout": "llvm-complex_sub_test-7959339.stdout", "stdout_hash": "d6421afd327db58bbc727e3a1bf0f600222763dff8ff4e2dfd554a99", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-print2-1ac10f6.stdout0000664000175000017500000000054415174404631023231 0ustar alastairalastair(TranslationUnit [(Program print2 () [] [] [] [(Print 0 (StrOp (String "(es11.5,3x " ()) Concat (String "es11.5)" ()) ) [(Real "1.d0") (Real "2.d0")] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-fixed_number_of_args-051b0f1.stderr0000664000175000017500000000032315174404631026051 0ustar alastairalastairsemantic error: Incorrect number of arguments passed to the 'complex' intrinsic. It accepts exactly 2 arguments. --> tests/errors/fixed_number_of_args.f90:3:9 | 3 | a = complex(1) | ^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-array3-7b1ab3b.stdout0000664000175000017500000001024015174404631023264 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array3: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) array3 [] [(Assignment (Var 2 a) (ArrayConstant 12 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 2 b) (ArrayConstant 12 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-string1-f6332d9.json0000664000175000017500000000071215174404631022763 0ustar alastairalastair{ "basename": "asr-string1-f6332d9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/string1.f90", "infile_hash": "1040f26c6305caccd70cc05aafb7f084fe9c817cc6b906ca40223634", "outfile": null, "outfile_hash": null, "stdout": "asr-string1-f6332d9.stdout", "stdout_hash": "b14a054c1f08b42f241668d05154e89555f3e1ea4f21d1ac9d408a9d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-write1-6827691.json0000664000175000017500000000072215174404631023136 0ustar alastairalastair{ "basename": "ast_f90-write1-6827691", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/write1.f90", "infile_hash": "75eba9b93bd747fb18efbf173e1d35340019e1c62f38efc3a4cbcf22", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-write1-6827691.stdout", "stdout_hash": "b7350e07cee74319a8cc97e0ef84988f663a50cc1f3785a676127c46", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_24-996af24.stdout0000664000175000017500000005311215174404631023730 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_24: (Program (SymbolTable 7 { parse_select: (ExternalSymbol 7 parse_select 2 parse_select tomlf_de_tokenizer_24 [] parse_select Public ), tokenizer: (Variable 7 tokenizer [] Local () () Default (StructType [] [] .true. .false. ) 7 toml_tokenizer_ Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), tokenizer_ptr: (Variable 7 tokenizer_ptr [] Local () () Default (Pointer (StructType [(Pointer (StructType [(Logical 4)] [] .true. .false. ) )] [] .false. .false. ) ) 7 toml_tokenizer Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), toml_table: (ExternalSymbol 7 toml_table 2 toml_table tomlf_de_tokenizer_24 [] toml_table Public ), toml_tokenizer: (ExternalSymbol 7 toml_tokenizer 2 toml_tokenizer tomlf_de_tokenizer_24 [] toml_tokenizer Public ), toml_tokenizer_: (ExternalSymbol 7 toml_tokenizer_ 2 toml_tokenizer_ tomlf_de_tokenizer_24 [] toml_tokenizer_ Public ) }) modules_24 [tomlf_de_tokenizer_24] [(Associate (Var 7 tokenizer_ptr) (Var 7 tokenizer) ) (SubroutineCall 7 parse_select () [((Var 7 tokenizer))] () .false. )] ), tomlf_de_tokenizer_24: (Module (SymbolTable 2 { parse_select: (Function (SymbolTable 6 { 1_toml_tokenizer_current: (ExternalSymbol 6 1_toml_tokenizer_current 4 current toml_tokenizer [] current Public ), de: (Variable 6 de [] InOut () () Default (StructType [(Pointer (StructType [(Logical 4)] [] .true. .false. ) )] [] .false. .false. ) 2 toml_tokenizer Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), table: (Variable 6 table [] Local () () Default (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) 2 toml_table Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) parse_select (FunctionType [(StructType [(Pointer (StructType [(Logical 4)] [] .true. .false. ) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 de)] [(Nullify [(Var 6 table)] ) (Associate (StructInstanceMember (Var 6 de) 6 1_toml_tokenizer_current (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) () ) (Var 6 table) )] () Public .true. .true. () ), toml_table: (Struct (SymbolTable 3 { inline: (Variable 3 inline [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_table (StructType [(Logical 4)] [] .true. .false. ) [] [inline] [] Source Public .false. .false. [] () () [] ), toml_tokenizer: (Struct (SymbolTable 4 { current: (Variable 4 current [] Local (PointerNullConstant (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) (Var 4 current) ) (PointerNullConstant (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) (Var 4 current) ) Default (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) 2 toml_table Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_tokenizer (StructType [(Pointer (StructType [(Logical 4)] [] .true. .false. ) )] [] .true. .false. ) [toml_table] [current] [] Source Public .false. .true. [] () () [] ), toml_tokenizer_: (Struct (SymbolTable 5 { }) toml_tokenizer_ (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () 2 toml_tokenizer [] ) }) tomlf_de_tokenizer_24 () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-fixed_form_implicit_check-62ffca3.stdout0000664000175000017500000000105315174404631027251 0ustar alastairalastair(TranslationUnit [(Program main () [] [(Implicit [(ImplicitSpec (AttrType TypeDoublePrecision [] () () None ) [(LetterSpec a h ) (LetterSpec o z )] )] () )] [] [] [] )] ) lfortran-0.63.0/tests/reference/pass_transform_optional_argument_functions-optional_02-e4f5f31.json0000664000175000017500000000112115174404631033745 0ustar alastairalastair{ "basename": "pass_transform_optional_argument_functions-optional_02-e4f5f31", "cmd": "lfortran --pass=transform_optional_argument_functions --show-asr --no-color {infile} -o {outfile}", "infile": "tests/optional_02.f90", "infile_hash": "f70cf57f95d77734e476563b856205456df72bd576aaacc1ab8fa85a", "outfile": null, "outfile_hash": null, "stdout": "pass_transform_optional_argument_functions-optional_02-e4f5f31.stdout", "stdout_hash": "278449e47230afaf7ee48d18c971db210c1e0d4ffa20a7ff440831e2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-sole_intrinsic-1ce1e44.json0000664000175000017500000000075215174404631024474 0ustar alastairalastair{ "basename": "ast-sole_intrinsic-1ce1e44", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/sole_intrinsic.f", "infile_hash": "eb8dafc3736c80b83b7cc0b62cbe2fce5882fac022c391b7514607ea", "outfile": null, "outfile_hash": null, "stdout": "ast-sole_intrinsic-1ce1e44.stdout", "stdout_hash": "1d82f87da296398b2778dd0a2947f9d7eb09c4b643dc4b443fa23df5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fn4-eaaa354.stdout0000664000175000017500000001571215174404631022567 0ustar alastairalastair(TranslationUnit [(Function conform [(mold) (val) (dim)] [] () () () [] [] [] [(Declaration (AttrType TypeType [] () () Asterisk ) [(AttrIntent In )] [(mold [(() () AssumedRank)] [] () () None ())] () ) (Declaration (AttrType TypeType [] () () Asterisk ) [(AttrIntent In ) (SimpleAttribute AttrOptional )] [(val [(() () AssumedRank)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In ) (SimpleAttribute AttrOptional )] [(dim [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [] [(conform [] [] () () None ())] () )] [(If 0 () (FuncCallOrArray present [] [(() val () 0)] [] [] [] ) [(If 0 () (FuncCallOrArray present [] [(() dim () 0)] [] [] [] ) [(If 0 () (BoolOp (BoolOp (> dim 0) And (<= dim (FuncCallOrArray rank [] [(() mold () 0)] [] [] [] )) ) And (<= dim (FuncCallOrArray rank [] [(() val () 0)] [] [] [] )) ) [(Assignment 0 conform (== (FuncCallOrArray size [] [(() mold () 0)] [(dim dim)] [] [] ) (FuncCallOrArray size [] [(() val () 0)] [(dim dim)] [] [] )) () )] [(ErrorStop 0 (String "Runtime error: Illegal dim argument provided in conform" ()) () () )] () () () )] [(If 0 () (== (FuncCallOrArray rank [] [(() val () 0)] [] [] [] ) (FuncCallOrArray rank [] [(() mold () 0)] [] [] [] )) [(Assignment 0 conform (FuncCallOrArray all [] [(() (== (FuncCallOrArray shape [] [(() mold () 0)] [] [] [] ) (FuncCallOrArray shape [] [(() val () 0)] [] [] [] )) () 0)] [] [] [] ) () )] [(Assignment 0 conform (Logical .false. ()) () )] () () () )] () () () )] [(Assignment 0 conform (Logical .true. ()) () )] () () () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-loop_test1-716ccb0.json0000664000175000017500000000073615174404631023540 0ustar alastairalastair{ "basename": "asr-loop_test1-716ccb0", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/loop_test1.f", "infile_hash": "149b2f607c4d8b4b89d207ac9353585e75ab55fd9c2520f7da02ffee", "outfile": null, "outfile_hash": null, "stdout": "asr-loop_test1-716ccb0.stdout", "stdout_hash": "a1eb1f78f4ffe306c374c071889565948b4aea14b6b54f2dd0cc08bf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/fortran-integer_to_real_cast_in_comparison-a6f3411.json0000664000175000017500000000104715174404631031345 0ustar alastairalastair{ "basename": "fortran-integer_to_real_cast_in_comparison-a6f3411", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/integer_to_real_cast_in_comparison.f90", "infile_hash": "d37d05e6da1fa8914cd0341fe2b8cd998a8b48328c9b01acd16f7d79", "outfile": null, "outfile_hash": null, "stdout": "fortran-integer_to_real_cast_in_comparison-a6f3411.stdout", "stdout_hash": "75e954cf5a9893f7ada84b0b1378fc1077a95d0ea2db55dbac6756c3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-return_05-b1ab26b.json0000664000175000017500000000075015174404631023525 0ustar alastairalastair{ "basename": "llvm-return_05-b1ab26b", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/return_05.f90", "infile_hash": "d9114cec325b855f8ac7853b0cb0e9438d43c6ae5e3d6872a59aa6b6", "outfile": null, "outfile_hash": null, "stdout": "llvm-return_05-b1ab26b.stdout", "stdout_hash": "a3c0e131e2e7ebcf54a6c96b0d26f76ccbd2978344290e974d147b54", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format7-5662bc0.stdout0000664000175000017500000000003315174404631023326 0ustar alastairalastair(es15.8e2) 1.00000000E+00 lfortran-0.63.0/tests/reference/tokens-boz1-719113d.stdout0000664000175000017500000000107415174404631023251 0ustar alastairalastair(TOKEN "BOZ constant" b'101') (NEWLINE) (TOKEN "BOZ constant" B'101') (NEWLINE) (TOKEN "BOZ constant" b"101") (NEWLINE) (TOKEN "BOZ constant" B"101") (NEWLINE) (TOKEN "BOZ constant" o'174') (NEWLINE) (TOKEN "BOZ constant" O'106') (NEWLINE) (TOKEN "BOZ constant" o"151") (NEWLINE) (TOKEN "BOZ constant" O"131") (NEWLINE) (TOKEN "BOZ constant" z'194a') (NEWLINE) (TOKEN "BOZ constant" Z'b108') (NEWLINE) (TOKEN "BOZ constant" z"f161") (NEWLINE) (TOKEN "BOZ constant" Z"1d31") (NEWLINE) (TOKEN "BOZ constant" z"C1B1") (NEWLINE) (TOKEN "BOZ constant" Z"1E3A") (NEWLINE) (EOF) lfortran-0.63.0/tests/reference/ast_f90-types_13-ddae644.json0000664000175000017500000000110015174404631023646 0ustar alastairalastair{ "basename": "ast_f90-types_13-ddae644", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/types_13.f90", "infile_hash": "0386b3b949293ae071687d72cec51980cbdce80908080fa69e19a807", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-types_13-ddae644.stdout", "stdout_hash": "ee7a7331545300956ac247f224c390a27caf81b3752a68562c6eff59", "stderr": "ast_f90-types_13-ddae644.stderr", "stderr_hash": "44623a78eb46ca78c3622e964b0d57198c877bd80dad64fca178c250", "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fmt1-3196894.json0000664000175000017500000000070115174404631022112 0ustar alastairalastair{ "basename": "ast-fmt1-3196894", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fmt1.f90", "infile_hash": "cc416a9bdea43f7844e35c44673a53dda17f3037acfc76ddef6f7c48", "outfile": null, "outfile_hash": null, "stdout": "ast-fmt1-3196894.stdout", "stdout_hash": "dfa5deb7f2db1f1d78856e3a6b1bc68b92705643f3a3206dbdc1fc30", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-subroutine4-63e648f.stdout0000664000175000017500000000600715174404631024242 0ustar alastairalastair(TranslationUnit [(Subroutine triad [(a) (b) (scalar) (c)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [(() () DimensionExpr)] [] () () None ()) (b [(() () DimensionExpr)] [] () () None ()) (scalar [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(c [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(N [] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 N (FuncCallOrArray size [] [(() a () 0)] [] [] [] ) () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () )] () [] [(Assignment 0 (FuncCallOrArray c [] [(() i () 0)] [] [] [] ) (+ (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (* scalar (FuncCallOrArray b [] [(() i () 0)] [] [] [] ))) () )] () () )] [] [] )] ) lfortran-0.63.0/tests/reference/ast-fixed_form_2-1350599.json0000664000175000017500000000075315174404631023605 0ustar alastairalastair{ "basename": "ast-fixed_form_2-1350599", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/fixed_form_2.f", "infile_hash": "f8b865a6a1e302e28e80c6e5011c5559aaf98bbee4447a5c81881224", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-fixed_form_2-1350599.stderr", "stderr_hash": "7b184dd4766acb5cdb47e17fdcd61853d6f051afe375e80522e62bbf", "returncode": 2 }././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootlfortran-0.63.0/tests/reference/pass_array_struct_temporary_array_op-array_op_simplifier_test-bb5013f.jsonlfortran-0.63.0/tests/reference/pass_array_struct_temporary_array_op-array_op_simplifier_test-bb50130000664000175000017500000000114615174404631034401 0ustar alastairalastair{ "basename": "pass_array_struct_temporary_array_op-array_op_simplifier_test-bb5013f", "cmd": "lfortran --pass=array_struct_temporary,array_op --show-asr --no-color {infile} -o {outfile}", "infile": "tests/array_op_simplifier_test.f90", "infile_hash": "c0b02cecb6f724cd809c6ed591f08c805e9d87dc0635842a5eca99be", "outfile": null, "outfile_hash": null, "stdout": "pass_array_struct_temporary_array_op-array_op_simplifier_test-bb5013f.stdout", "stdout_hash": "74082d005e1ffc98aab522ed97f0975ce08e5f560b788ea712e66bbb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-complex1-0e93fa9.json0000664000175000017500000000072015174404631023370 0ustar alastairalastair{ "basename": "llvm-complex1-0e93fa9", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/complex1.f90", "infile_hash": "3243c29c947c9700891971aae8780afac25cd01387e0307063f3928a", "outfile": null, "outfile_hash": null, "stdout": "llvm-complex1-0e93fa9.stdout", "stdout_hash": "25adedfdc3484f838d0bc9fac6ffa8f1cc723366f034bbbe8cf0c151", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-nested_01-a37fe7e.stdout0000664000175000017500000000636015174404631023677 0ustar alastairalastair(TranslationUnit [(Module nested_01_a (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [(Function b [] [(AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(e [] [] () () None ())] () )] [(Print 0 () [(String "b()" ())] () ) (Assignment 0 e (FuncCallOrArray d [] [] [] [] [] ) () ) (Assignment 0 b 0 () )] [(Function d [] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [] [(Print 0 () [(String "d()" ())] () ) (Assignment 0 d 1 () )] [] [] )] [] )] ) (Program nested_01 () [(Use [] nested_01_a [(UseSymbol b () )] .true. () )] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(c [] [] () () None ())] () )] [(Assignment 0 c (FuncCallOrArray b [] [] [] [] [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/ast_f90-forall1-88e2780.json0000664000175000017500000000104715174404631023343 0ustar alastairalastair{ "basename": "ast_f90-forall1-88e2780", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/forall1.f90", "infile_hash": "c0bc2a81b478acca60180152012de1e4011f235afde816cb91804fb9", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-forall1-88e2780.stdout", "stdout_hash": "ccf3473772b8382892f8cf67b7b955e79e4d3a1b4cd10ce34730b582", "stderr": "ast_f90-forall1-88e2780.stderr", "stderr_hash": "4d905b6e8f90b9042def4e125077632dced461f1a0aeea1763458479", "returncode": 0 }lfortran-0.63.0/tests/reference/c-case_05-2fed69e.stdout0000664000175000017500000000126015174404631022764 0ustar alastairalastair #include #include #include #include #include // Implementations int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); static char * grade = "B"; if (grade == "A") { printf("%s\n","Excellent!"); } else if (grade == "B") { } else if (grade == "C") { printf("%s\n","Well done"); } else if (grade == "D") { printf("%s\n","You passed"); } else if (grade == "F") { printf("%s\n","Better try again"); } else { printf("%s\n","Invalid grade"); } printf("%s%s%s\n", "Your grade is ", " ", grade); return 0; } lfortran-0.63.0/tests/reference/run-array_bounds_check_10-b69c804.stderr0000664000175000017500000000047215174404631026074 0ustar alastairalastairruntime error: Array shape mismatch in binary operation with operands 'a' and 'b'. Tried to match size 2 of dimension 2 of 'a' with size 3 of dimension 2 of 'b'. --> tests/errors/array_bounds_check_10.f90:9:9 | 9 | e = a + b | ^ LHS size is 2 | 9 | e = a + b | ^ RHS size is 3 lfortran-0.63.0/tests/reference/llvm-allocate_03-495d621.stdout0000664000175000017500000067724315174404631024161 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> %array.3 = type { i32*, i64, i32, i8, i8, i8, i8, i64, [3 x %dimension_descriptor] } %dimension_descriptor = type { i64, i64, i64 } @0 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @1 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @2 = private unnamed_addr constant [53 x i8] c"Cannot allocate '%s' because it is already allocated\00", align 1 @3 = private unnamed_addr constant [55 x i8] c"Attempting to allocate already allocated variable '%s'\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @5 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @6 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @7 = private unnamed_addr constant [41 x i8] c"Array '%s' is indexed but not allocated.\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @9 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @10 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @11 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @13 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @14 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @15 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @17 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @18 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @19 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @21 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @22 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @23 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @24 = private unnamed_addr constant [41 x i8] c"Array '%s' is indexed but not allocated.\00", align 1 @25 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @26 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @27 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @28 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @29 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @30 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @31 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @32 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @33 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @34 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @35 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @36 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @37 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @39 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @40 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @41 = private unnamed_addr constant [41 x i8] c"Array '%s' is indexed but not allocated.\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @43 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @44 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @45 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @46 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @47 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @48 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @49 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @50 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @51 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @52 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @53 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @54 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @55 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @56 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @57 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @58 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @59 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @60 = private unnamed_addr constant [41 x i8] c"Array '%s' is indexed but not allocated.\00", align 1 @61 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @62 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @63 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @64 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @65 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @66 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @67 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @68 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @69 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @70 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @71 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @72 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @73 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @74 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @75 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @76 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @77 = private unnamed_addr constant [41 x i8] c"Array '%s' is indexed but not allocated.\00", align 1 @78 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @79 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @80 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @81 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @82 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @83 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @84 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @85 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @86 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @87 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @88 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @89 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @90 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @91 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @92 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @93 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @94 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @95 = private unnamed_addr constant [41 x i8] c"Array '%s' is indexed but not allocated.\00", align 1 @96 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @97 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @98 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @99 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @100 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @101 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @102 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @103 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @104 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @105 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @106 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @107 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @108 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @109 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @110 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @111 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @112 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @113 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @114 = private unnamed_addr constant [41 x i8] c"Array '%s' is indexed but not allocated.\00", align 1 @115 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @116 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @117 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @118 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @119 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @120 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @121 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @122 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @123 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @124 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @125 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @126 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @127 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @128 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @129 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @130 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @131 = private unnamed_addr constant [41 x i8] c"Array '%s' is indexed but not allocated.\00", align 1 @132 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @133 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @134 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @135 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @136 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @137 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @138 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @139 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @140 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @141 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @142 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @143 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @144 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @145 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @146 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @147 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @148 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @149 = private unnamed_addr constant [41 x i8] c"Array '%s' is indexed but not allocated.\00", align 1 @150 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @151 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @152 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @153 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @154 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @155 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @156 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @157 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @158 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @159 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @160 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @161 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @162 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @163 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @164 = private unnamed_addr constant [53 x i8] c"Cannot allocate '%s' because it is already allocated\00", align 1 @165 = private unnamed_addr constant [55 x i8] c"Attempting to allocate already allocated variable '%s'\00", align 1 @166 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @167 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @168 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @169 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @170 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @171 = private unnamed_addr constant [41 x i8] c"Array '%s' is indexed but not allocated.\00", align 1 @172 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @173 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @174 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @175 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @176 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @177 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @178 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @179 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @180 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @181 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @182 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @183 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @184 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @185 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @186 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @187 = private unnamed_addr constant [41 x i8] c"Array '%s' is indexed but not allocated.\00", align 1 @188 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @189 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @190 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @191 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @192 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @193 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @194 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @195 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @196 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @197 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @198 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @199 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @200 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @201 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @202 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @203 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @204 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @205 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @206 = private unnamed_addr constant [41 x i8] c"Array '%s' is indexed but not allocated.\00", align 1 @207 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @208 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @209 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @210 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @211 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @212 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @213 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @214 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @215 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @216 = private unnamed_addr constant [43 x i8] c"tests/../integration_tests/allocate_03.f90\00", align 1 @217 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @218 = private unnamed_addr constant [103 x i8] c"Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @219 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() %arr_desc = alloca %array.3, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %c = alloca %array.3*, align 8 store %array.3* null, %array.3** %c, align 8 %3 = getelementptr %array.3, %array.3* %arr_desc, i32 0, i32 8 %4 = getelementptr [3 x %dimension_descriptor], [3 x %dimension_descriptor]* %3, i32 0, i32 0 %5 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %4, i32 0 %6 = getelementptr %dimension_descriptor, %dimension_descriptor* %5, i32 0, i32 0 store i64 1, i64* %6, align 8 %7 = getelementptr %dimension_descriptor, %dimension_descriptor* %5, i32 0, i32 1 store i64 1, i64* %7, align 8 %8 = getelementptr %dimension_descriptor, %dimension_descriptor* %5, i32 0, i32 2 store i64 0, i64* %8, align 8 %9 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %4, i32 1 %10 = getelementptr %dimension_descriptor, %dimension_descriptor* %9, i32 0, i32 0 store i64 1, i64* %10, align 8 %11 = getelementptr %dimension_descriptor, %dimension_descriptor* %9, i32 0, i32 1 store i64 1, i64* %11, align 8 %12 = getelementptr %dimension_descriptor, %dimension_descriptor* %9, i32 0, i32 2 store i64 0, i64* %12, align 8 %13 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %4, i32 2 %14 = getelementptr %dimension_descriptor, %dimension_descriptor* %13, i32 0, i32 0 store i64 1, i64* %14, align 8 %15 = getelementptr %dimension_descriptor, %dimension_descriptor* %13, i32 0, i32 1 store i64 1, i64* %15, align 8 %16 = getelementptr %dimension_descriptor, %dimension_descriptor* %13, i32 0, i32 2 store i64 0, i64* %16, align 8 %17 = getelementptr %array.3, %array.3* %arr_desc, i32 0, i32 3 store i8 3, i8* %17, align 1 %18 = getelementptr %array.3, %array.3* %arr_desc, i32 0, i32 0 store i32* null, i32** %18, align 8 store %array.3* %arr_desc, %array.3** %c, align 8 %r = alloca i32, align 4 %stat = alloca i32, align 4 store i32 1, i32* %stat, align 4 %19 = load %array.3*, %array.3** %c, align 8 %20 = ptrtoint %array.3* %19 to i64 %21 = icmp eq i64 %20, 0 br i1 %21, label %merge_allocated, label %check_data check_data: ; preds = %.entry %22 = getelementptr %array.3, %array.3* %19, i32 0, i32 0 %23 = load i32*, i32** %22, align 8 %24 = ptrtoint i32* %23 to i64 %25 = icmp ne i64 %24, 0 br label %merge_allocated merge_allocated: ; preds = %check_data, %.entry %is_allocated = phi i1 [ false, %.entry ], [ %25, %check_data ] br i1 %is_allocated, label %then, label %ifcont then: ; preds = %merge_allocated %26 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %27 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %28 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %27, i32 0, i32 0 %29 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %28, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @163, i32 0, i32 0), i8** %29, align 8 %30 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %28, i32 0, i32 1 store i32 8, i32* %30, align 4 %31 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %28, i32 0, i32 2 store i32 14, i32* %31, align 4 %32 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %28, i32 0, i32 3 store i32 8, i32* %32, align 4 %33 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %28, i32 0, i32 4 store i32 23, i32* %33, align 4 %34 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @164, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @162, i32 0, i32 0)) %35 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %26, i32 0, i32 0 %36 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %27, i32 0, i32 0 %37 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %35, i32 0, i32 2 %38 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %35, i32 0, i32 0 store i1 true, i1* %38, align 1 %39 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %35, i32 0, i32 1 store i8* %34, i8** %39, align 8 store { i8*, i32, i32, i32, i32 }* %36, { i8*, i32, i32, i32, i32 }** %37, align 8 %40 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %35, i32 0, i32 3 store i32 1, i32* %40, align 4 %41 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %26, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %41, i32 1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @165, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @162, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont: ; preds = %merge_allocated %42 = load %array.3*, %array.3** %c, align 8 %43 = getelementptr %array.3, %array.3* %42, i32 0, i32 7 store i64 0, i64* %43, align 8 %44 = getelementptr %array.3, %array.3* %42, i32 0, i32 8 %45 = getelementptr [3 x %dimension_descriptor], [3 x %dimension_descriptor]* %44, i32 0, i32 0 %46 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %45, i32 0 %47 = getelementptr %dimension_descriptor, %dimension_descriptor* %46, i32 0, i32 2 %48 = getelementptr %dimension_descriptor, %dimension_descriptor* %46, i32 0, i32 0 %49 = getelementptr %dimension_descriptor, %dimension_descriptor* %46, i32 0, i32 1 store i64 1, i64* %47, align 8 store i64 1, i64* %48, align 8 store i64 3, i64* %49, align 8 %50 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %45, i32 1 %51 = getelementptr %dimension_descriptor, %dimension_descriptor* %50, i32 0, i32 2 %52 = getelementptr %dimension_descriptor, %dimension_descriptor* %50, i32 0, i32 0 %53 = getelementptr %dimension_descriptor, %dimension_descriptor* %50, i32 0, i32 1 store i64 3, i64* %51, align 8 store i64 1, i64* %52, align 8 store i64 3, i64* %53, align 8 %54 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %45, i32 2 %55 = getelementptr %dimension_descriptor, %dimension_descriptor* %54, i32 0, i32 2 %56 = getelementptr %dimension_descriptor, %dimension_descriptor* %54, i32 0, i32 0 %57 = getelementptr %dimension_descriptor, %dimension_descriptor* %54, i32 0, i32 1 store i64 9, i64* %55, align 8 store i64 1, i64* %56, align 8 store i64 3, i64* %57, align 8 %58 = getelementptr %array.3, %array.3* %42, i32 0, i32 0 %59 = call i8* @_lfortran_get_default_allocator() %60 = call i8* @_lfortran_malloc_alloc(i8* %59, i64 108) %61 = bitcast i8* %60 to i32* store i32* %61, i32** %58, align 8 store i32 0, i32* %stat, align 4 %62 = load i32, i32* %stat, align 4 %63 = icmp ne i32 %62, 0 br i1 %63, label %then1, label %else then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @167, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @166, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont2 else: ; preds = %ifcont br label %ifcont2 ifcont2: ; preds = %else, %then1 %64 = load %array.3*, %array.3** %c, align 8 %65 = ptrtoint %array.3* %64 to i64 %66 = icmp eq i64 %65, 0 br i1 %66, label %merge_allocated4, label %check_data3 check_data3: ; preds = %ifcont2 %67 = getelementptr %array.3, %array.3* %64, i32 0, i32 0 %68 = load i32*, i32** %67, align 8 %69 = ptrtoint i32* %68 to i64 %70 = icmp ne i64 %69, 0 br label %merge_allocated4 merge_allocated4: ; preds = %check_data3, %ifcont2 %is_allocated5 = phi i1 [ false, %ifcont2 ], [ %70, %check_data3 ] %71 = xor i1 %is_allocated5, true br i1 %71, label %then6, label %ifcont7 then6: ; preds = %merge_allocated4 %72 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %73 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %74 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %73, i32 0, i32 0 %75 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %74, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @169, i32 0, i32 0), i8** %75, align 8 %76 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %74, i32 0, i32 1 store i32 10, i32* %76, align 4 %77 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %74, i32 0, i32 2 store i32 5, i32* %77, align 4 %78 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %74, i32 0, i32 3 store i32 10, i32* %78, align 4 %79 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %74, i32 0, i32 4 store i32 14, i32* %79, align 4 %80 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @170, i32 0, i32 0)) %81 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %72, i32 0, i32 0 %82 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %73, i32 0, i32 0 %83 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %81, i32 0, i32 2 %84 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %81, i32 0, i32 0 store i1 true, i1* %84, align 1 %85 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %81, i32 0, i32 1 store i8* %80, i8** %85, align 8 store { i8*, i32, i32, i32, i32 }* %82, { i8*, i32, i32, i32, i32 }** %83, align 8 %86 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %81, i32 0, i32 3 store i32 1, i32* %86, align 4 %87 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %72, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %87, i32 1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @171, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @168, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont7: ; preds = %merge_allocated4 %88 = getelementptr %array.3, %array.3* %64, i32 0, i32 8 %89 = getelementptr [3 x %dimension_descriptor], [3 x %dimension_descriptor]* %88, i32 0, i32 0 %90 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %89, i32 0 %91 = getelementptr %dimension_descriptor, %dimension_descriptor* %90, i32 0, i32 0 %92 = load i64, i64* %91, align 8 %93 = getelementptr %dimension_descriptor, %dimension_descriptor* %90, i32 0, i32 1 %94 = load i64, i64* %93, align 8 %95 = sub i64 1, %92 %96 = add i64 %92, %94 %97 = sub i64 %96, 1 %98 = icmp slt i64 1, %92 %99 = icmp sgt i64 1, %97 %100 = or i1 %98, %99 br i1 %100, label %then8, label %ifcont9 then8: ; preds = %ifcont7 %101 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %102 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %103 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %102, i32 0, i32 0 %104 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %103, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @173, i32 0, i32 0), i8** %104, align 8 %105 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %103, i32 0, i32 1 store i32 10, i32* %105, align 4 %106 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %103, i32 0, i32 2 store i32 5, i32* %106, align 4 %107 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %103, i32 0, i32 3 store i32 10, i32* %107, align 4 %108 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %103, i32 0, i32 4 store i32 14, i32* %108, align 4 %109 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @174, i32 0, i32 0)) %110 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %101, i32 0, i32 0 %111 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %102, i32 0, i32 0 %112 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %110, i32 0, i32 2 %113 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %110, i32 0, i32 0 store i1 true, i1* %113, align 1 %114 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %110, i32 0, i32 1 store i8* %109, i8** %114, align 8 store { i8*, i32, i32, i32, i32 }* %111, { i8*, i32, i32, i32, i32 }** %112, align 8 %115 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %110, i32 0, i32 3 store i32 1, i32* %115, align 4 %116 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %101, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %116, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @175, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @172, i32 0, i32 0), i64 1, i32 1, i64 %92, i64 %97) call void @exit(i32 1) unreachable ifcont9: ; preds = %ifcont7 %117 = getelementptr %dimension_descriptor, %dimension_descriptor* %90, i32 0, i32 2 %118 = load i64, i64* %117, align 8 %119 = mul i64 %118, %95 %120 = add i64 0, %119 %121 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %89, i32 1 %122 = getelementptr %dimension_descriptor, %dimension_descriptor* %121, i32 0, i32 0 %123 = load i64, i64* %122, align 8 %124 = getelementptr %dimension_descriptor, %dimension_descriptor* %121, i32 0, i32 1 %125 = load i64, i64* %124, align 8 %126 = sub i64 1, %123 %127 = add i64 %123, %125 %128 = sub i64 %127, 1 %129 = icmp slt i64 1, %123 %130 = icmp sgt i64 1, %128 %131 = or i1 %129, %130 br i1 %131, label %then10, label %ifcont11 then10: ; preds = %ifcont9 %132 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %133 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %134 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %133, i32 0, i32 0 %135 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %134, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @177, i32 0, i32 0), i8** %135, align 8 %136 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %134, i32 0, i32 1 store i32 10, i32* %136, align 4 %137 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %134, i32 0, i32 2 store i32 5, i32* %137, align 4 %138 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %134, i32 0, i32 3 store i32 10, i32* %138, align 4 %139 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %134, i32 0, i32 4 store i32 14, i32* %139, align 4 %140 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @178, i32 0, i32 0)) %141 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %132, i32 0, i32 0 %142 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %133, i32 0, i32 0 %143 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %141, i32 0, i32 2 %144 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %141, i32 0, i32 0 store i1 true, i1* %144, align 1 %145 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %141, i32 0, i32 1 store i8* %140, i8** %145, align 8 store { i8*, i32, i32, i32, i32 }* %142, { i8*, i32, i32, i32, i32 }** %143, align 8 %146 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %141, i32 0, i32 3 store i32 1, i32* %146, align 4 %147 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %132, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %147, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @179, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @176, i32 0, i32 0), i64 1, i32 2, i64 %123, i64 %128) call void @exit(i32 1) unreachable ifcont11: ; preds = %ifcont9 %148 = getelementptr %dimension_descriptor, %dimension_descriptor* %121, i32 0, i32 2 %149 = load i64, i64* %148, align 8 %150 = mul i64 %149, %126 %151 = add i64 %120, %150 %152 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %89, i32 2 %153 = getelementptr %dimension_descriptor, %dimension_descriptor* %152, i32 0, i32 0 %154 = load i64, i64* %153, align 8 %155 = getelementptr %dimension_descriptor, %dimension_descriptor* %152, i32 0, i32 1 %156 = load i64, i64* %155, align 8 %157 = sub i64 1, %154 %158 = add i64 %154, %156 %159 = sub i64 %158, 1 %160 = icmp slt i64 1, %154 %161 = icmp sgt i64 1, %159 %162 = or i1 %160, %161 br i1 %162, label %then12, label %ifcont13 then12: ; preds = %ifcont11 %163 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %164 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %165 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %164, i32 0, i32 0 %166 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %165, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @181, i32 0, i32 0), i8** %166, align 8 %167 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %165, i32 0, i32 1 store i32 10, i32* %167, align 4 %168 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %165, i32 0, i32 2 store i32 5, i32* %168, align 4 %169 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %165, i32 0, i32 3 store i32 10, i32* %169, align 4 %170 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %165, i32 0, i32 4 store i32 14, i32* %170, align 4 %171 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @182, i32 0, i32 0)) %172 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %163, i32 0, i32 0 %173 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %164, i32 0, i32 0 %174 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %172, i32 0, i32 2 %175 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %172, i32 0, i32 0 store i1 true, i1* %175, align 1 %176 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %172, i32 0, i32 1 store i8* %171, i8** %176, align 8 store { i8*, i32, i32, i32, i32 }* %173, { i8*, i32, i32, i32, i32 }** %174, align 8 %177 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %172, i32 0, i32 3 store i32 1, i32* %177, align 4 %178 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %163, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %178, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @183, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @180, i32 0, i32 0), i64 1, i32 3, i64 %154, i64 %159) call void @exit(i32 1) unreachable ifcont13: ; preds = %ifcont11 %179 = getelementptr %dimension_descriptor, %dimension_descriptor* %152, i32 0, i32 2 %180 = load i64, i64* %179, align 8 %181 = mul i64 %180, %157 %182 = add i64 %151, %181 %183 = getelementptr %array.3, %array.3* %64, i32 0, i32 7 %184 = load i64, i64* %183, align 8 %185 = add i64 %182, %184 %186 = getelementptr %array.3, %array.3* %64, i32 0, i32 0 %187 = load i32*, i32** %186, align 8 %188 = getelementptr inbounds i32, i32* %187, i64 %185 store i32 3, i32* %188, align 4 call void @h(%array.3** %c) %189 = call i32 @g(%array.3** %c) store i32 %189, i32* %r, align 4 %190 = load %array.3*, %array.3** %c, align 8 %191 = ptrtoint %array.3* %190 to i64 %192 = icmp eq i64 %191, 0 br i1 %192, label %merge_allocated15, label %check_data14 check_data14: ; preds = %ifcont13 %193 = getelementptr %array.3, %array.3* %190, i32 0, i32 0 %194 = load i32*, i32** %193, align 8 %195 = ptrtoint i32* %194 to i64 %196 = icmp ne i64 %195, 0 br label %merge_allocated15 merge_allocated15: ; preds = %check_data14, %ifcont13 %is_allocated16 = phi i1 [ false, %ifcont13 ], [ %196, %check_data14 ] %197 = xor i1 %is_allocated16, true br i1 %197, label %then17, label %ifcont18 then17: ; preds = %merge_allocated15 %198 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %199 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %200 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %199, i32 0, i32 0 %201 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %200, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @185, i32 0, i32 0), i8** %201, align 8 %202 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %200, i32 0, i32 1 store i32 13, i32* %202, align 4 %203 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %200, i32 0, i32 2 store i32 9, i32* %203, align 4 %204 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %200, i32 0, i32 3 store i32 13, i32* %204, align 4 %205 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %200, i32 0, i32 4 store i32 18, i32* %205, align 4 %206 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @186, i32 0, i32 0)) %207 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %198, i32 0, i32 0 %208 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %199, i32 0, i32 0 %209 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %207, i32 0, i32 2 %210 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %207, i32 0, i32 0 store i1 true, i1* %210, align 1 %211 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %207, i32 0, i32 1 store i8* %206, i8** %211, align 8 store { i8*, i32, i32, i32, i32 }* %208, { i8*, i32, i32, i32, i32 }** %209, align 8 %212 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %207, i32 0, i32 3 store i32 1, i32* %212, align 4 %213 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %198, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %213, i32 1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @187, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @184, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont18: ; preds = %merge_allocated15 %214 = getelementptr %array.3, %array.3* %190, i32 0, i32 8 %215 = getelementptr [3 x %dimension_descriptor], [3 x %dimension_descriptor]* %214, i32 0, i32 0 %216 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %215, i32 0 %217 = getelementptr %dimension_descriptor, %dimension_descriptor* %216, i32 0, i32 0 %218 = load i64, i64* %217, align 8 %219 = getelementptr %dimension_descriptor, %dimension_descriptor* %216, i32 0, i32 1 %220 = load i64, i64* %219, align 8 %221 = sub i64 1, %218 %222 = add i64 %218, %220 %223 = sub i64 %222, 1 %224 = icmp slt i64 1, %218 %225 = icmp sgt i64 1, %223 %226 = or i1 %224, %225 br i1 %226, label %then19, label %ifcont20 then19: ; preds = %ifcont18 %227 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %228 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %229 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %228, i32 0, i32 0 %230 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %229, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @189, i32 0, i32 0), i8** %230, align 8 %231 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %229, i32 0, i32 1 store i32 13, i32* %231, align 4 %232 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %229, i32 0, i32 2 store i32 9, i32* %232, align 4 %233 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %229, i32 0, i32 3 store i32 13, i32* %233, align 4 %234 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %229, i32 0, i32 4 store i32 18, i32* %234, align 4 %235 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @190, i32 0, i32 0)) %236 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %227, i32 0, i32 0 %237 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %228, i32 0, i32 0 %238 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %236, i32 0, i32 2 %239 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %236, i32 0, i32 0 store i1 true, i1* %239, align 1 %240 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %236, i32 0, i32 1 store i8* %235, i8** %240, align 8 store { i8*, i32, i32, i32, i32 }* %237, { i8*, i32, i32, i32, i32 }** %238, align 8 %241 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %236, i32 0, i32 3 store i32 1, i32* %241, align 4 %242 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %227, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %242, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @191, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @188, i32 0, i32 0), i64 1, i32 1, i64 %218, i64 %223) call void @exit(i32 1) unreachable ifcont20: ; preds = %ifcont18 %243 = getelementptr %dimension_descriptor, %dimension_descriptor* %216, i32 0, i32 2 %244 = load i64, i64* %243, align 8 %245 = mul i64 %244, %221 %246 = add i64 0, %245 %247 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %215, i32 1 %248 = getelementptr %dimension_descriptor, %dimension_descriptor* %247, i32 0, i32 0 %249 = load i64, i64* %248, align 8 %250 = getelementptr %dimension_descriptor, %dimension_descriptor* %247, i32 0, i32 1 %251 = load i64, i64* %250, align 8 %252 = sub i64 1, %249 %253 = add i64 %249, %251 %254 = sub i64 %253, 1 %255 = icmp slt i64 1, %249 %256 = icmp sgt i64 1, %254 %257 = or i1 %255, %256 br i1 %257, label %then21, label %ifcont22 then21: ; preds = %ifcont20 %258 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %259 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %260 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %259, i32 0, i32 0 %261 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %260, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @193, i32 0, i32 0), i8** %261, align 8 %262 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %260, i32 0, i32 1 store i32 13, i32* %262, align 4 %263 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %260, i32 0, i32 2 store i32 9, i32* %263, align 4 %264 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %260, i32 0, i32 3 store i32 13, i32* %264, align 4 %265 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %260, i32 0, i32 4 store i32 18, i32* %265, align 4 %266 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @194, i32 0, i32 0)) %267 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %258, i32 0, i32 0 %268 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %259, i32 0, i32 0 %269 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %267, i32 0, i32 2 %270 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %267, i32 0, i32 0 store i1 true, i1* %270, align 1 %271 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %267, i32 0, i32 1 store i8* %266, i8** %271, align 8 store { i8*, i32, i32, i32, i32 }* %268, { i8*, i32, i32, i32, i32 }** %269, align 8 %272 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %267, i32 0, i32 3 store i32 1, i32* %272, align 4 %273 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %258, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %273, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @195, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @192, i32 0, i32 0), i64 1, i32 2, i64 %249, i64 %254) call void @exit(i32 1) unreachable ifcont22: ; preds = %ifcont20 %274 = getelementptr %dimension_descriptor, %dimension_descriptor* %247, i32 0, i32 2 %275 = load i64, i64* %274, align 8 %276 = mul i64 %275, %252 %277 = add i64 %246, %276 %278 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %215, i32 2 %279 = getelementptr %dimension_descriptor, %dimension_descriptor* %278, i32 0, i32 0 %280 = load i64, i64* %279, align 8 %281 = getelementptr %dimension_descriptor, %dimension_descriptor* %278, i32 0, i32 1 %282 = load i64, i64* %281, align 8 %283 = sub i64 1, %280 %284 = add i64 %280, %282 %285 = sub i64 %284, 1 %286 = icmp slt i64 1, %280 %287 = icmp sgt i64 1, %285 %288 = or i1 %286, %287 br i1 %288, label %then23, label %ifcont24 then23: ; preds = %ifcont22 %289 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %290 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %291 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %290, i32 0, i32 0 %292 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %291, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @197, i32 0, i32 0), i8** %292, align 8 %293 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %291, i32 0, i32 1 store i32 13, i32* %293, align 4 %294 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %291, i32 0, i32 2 store i32 9, i32* %294, align 4 %295 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %291, i32 0, i32 3 store i32 13, i32* %295, align 4 %296 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %291, i32 0, i32 4 store i32 18, i32* %296, align 4 %297 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @198, i32 0, i32 0)) %298 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %289, i32 0, i32 0 %299 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %290, i32 0, i32 0 %300 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %298, i32 0, i32 2 %301 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %298, i32 0, i32 0 store i1 true, i1* %301, align 1 %302 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %298, i32 0, i32 1 store i8* %297, i8** %302, align 8 store { i8*, i32, i32, i32, i32 }* %299, { i8*, i32, i32, i32, i32 }** %300, align 8 %303 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %298, i32 0, i32 3 store i32 1, i32* %303, align 4 %304 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %289, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %304, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @199, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @196, i32 0, i32 0), i64 1, i32 3, i64 %280, i64 %285) call void @exit(i32 1) unreachable ifcont24: ; preds = %ifcont22 %305 = getelementptr %dimension_descriptor, %dimension_descriptor* %278, i32 0, i32 2 %306 = load i64, i64* %305, align 8 %307 = mul i64 %306, %283 %308 = add i64 %277, %307 %309 = getelementptr %array.3, %array.3* %190, i32 0, i32 7 %310 = load i64, i64* %309, align 8 %311 = add i64 %308, %310 %312 = getelementptr %array.3, %array.3* %190, i32 0, i32 0 %313 = load i32*, i32** %312, align 8 %314 = getelementptr inbounds i32, i32* %313, i64 %311 %315 = load i32, i32* %314, align 4 %316 = icmp ne i32 %315, 8 br i1 %316, label %then25, label %else26 then25: ; preds = %ifcont24 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @201, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @200, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont27 else26: ; preds = %ifcont24 br label %ifcont27 ifcont27: ; preds = %else26, %then25 %317 = alloca i64, align 8 %318 = load %array.3*, %array.3** %c, align 8 %319 = ptrtoint %array.3* %318 to i64 %320 = icmp eq i64 %319, 0 br i1 %320, label %merge_allocated29, label %check_data28 check_data28: ; preds = %ifcont27 %321 = getelementptr %array.3, %array.3* %318, i32 0, i32 0 %322 = load i32*, i32** %321, align 8 %323 = ptrtoint i32* %322 to i64 %324 = icmp ne i64 %323, 0 br label %merge_allocated29 merge_allocated29: ; preds = %check_data28, %ifcont27 %is_allocated30 = phi i1 [ false, %ifcont27 ], [ %324, %check_data28 ] %325 = xor i1 %is_allocated30, true br i1 %325, label %then31, label %ifcont32 then31: ; preds = %merge_allocated29 %326 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %327 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %328 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %327, i32 0, i32 0 %329 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %328, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @204, i32 0, i32 0), i8** %329, align 8 %330 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %328, i32 0, i32 1 store i32 14, i32* %330, align 4 %331 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %328, i32 0, i32 2 store i32 14, i32* %331, align 4 %332 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %328, i32 0, i32 3 store i32 14, i32* %332, align 4 %333 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %328, i32 0, i32 4 store i32 23, i32* %333, align 4 %334 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @205, i32 0, i32 0)) %335 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %326, i32 0, i32 0 %336 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %327, i32 0, i32 0 %337 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %335, i32 0, i32 2 %338 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %335, i32 0, i32 0 store i1 true, i1* %338, align 1 %339 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %335, i32 0, i32 1 store i8* %334, i8** %339, align 8 store { i8*, i32, i32, i32, i32 }* %336, { i8*, i32, i32, i32, i32 }** %337, align 8 %340 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %335, i32 0, i32 3 store i32 1, i32* %340, align 4 %341 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %326, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %341, i32 1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @206, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @203, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont32: ; preds = %merge_allocated29 %342 = getelementptr %array.3, %array.3* %318, i32 0, i32 8 %343 = getelementptr [3 x %dimension_descriptor], [3 x %dimension_descriptor]* %342, i32 0, i32 0 %344 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %343, i32 0 %345 = getelementptr %dimension_descriptor, %dimension_descriptor* %344, i32 0, i32 0 %346 = load i64, i64* %345, align 8 %347 = getelementptr %dimension_descriptor, %dimension_descriptor* %344, i32 0, i32 1 %348 = load i64, i64* %347, align 8 %349 = sub i64 1, %346 %350 = add i64 %346, %348 %351 = sub i64 %350, 1 %352 = icmp slt i64 1, %346 %353 = icmp sgt i64 1, %351 %354 = or i1 %352, %353 br i1 %354, label %then33, label %ifcont34 then33: ; preds = %ifcont32 %355 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %356 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %357 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %356, i32 0, i32 0 %358 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %357, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @208, i32 0, i32 0), i8** %358, align 8 %359 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %357, i32 0, i32 1 store i32 14, i32* %359, align 4 %360 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %357, i32 0, i32 2 store i32 14, i32* %360, align 4 %361 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %357, i32 0, i32 3 store i32 14, i32* %361, align 4 %362 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %357, i32 0, i32 4 store i32 23, i32* %362, align 4 %363 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @209, i32 0, i32 0)) %364 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %355, i32 0, i32 0 %365 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %356, i32 0, i32 0 %366 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %364, i32 0, i32 2 %367 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %364, i32 0, i32 0 store i1 true, i1* %367, align 1 %368 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %364, i32 0, i32 1 store i8* %363, i8** %368, align 8 store { i8*, i32, i32, i32, i32 }* %365, { i8*, i32, i32, i32, i32 }** %366, align 8 %369 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %364, i32 0, i32 3 store i32 1, i32* %369, align 4 %370 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %355, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %370, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @210, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @207, i32 0, i32 0), i64 1, i32 1, i64 %346, i64 %351) call void @exit(i32 1) unreachable ifcont34: ; preds = %ifcont32 %371 = getelementptr %dimension_descriptor, %dimension_descriptor* %344, i32 0, i32 2 %372 = load i64, i64* %371, align 8 %373 = mul i64 %372, %349 %374 = add i64 0, %373 %375 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %343, i32 1 %376 = getelementptr %dimension_descriptor, %dimension_descriptor* %375, i32 0, i32 0 %377 = load i64, i64* %376, align 8 %378 = getelementptr %dimension_descriptor, %dimension_descriptor* %375, i32 0, i32 1 %379 = load i64, i64* %378, align 8 %380 = sub i64 1, %377 %381 = add i64 %377, %379 %382 = sub i64 %381, 1 %383 = icmp slt i64 1, %377 %384 = icmp sgt i64 1, %382 %385 = or i1 %383, %384 br i1 %385, label %then35, label %ifcont36 then35: ; preds = %ifcont34 %386 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %387 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %388 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %387, i32 0, i32 0 %389 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %388, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @212, i32 0, i32 0), i8** %389, align 8 %390 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %388, i32 0, i32 1 store i32 14, i32* %390, align 4 %391 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %388, i32 0, i32 2 store i32 14, i32* %391, align 4 %392 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %388, i32 0, i32 3 store i32 14, i32* %392, align 4 %393 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %388, i32 0, i32 4 store i32 23, i32* %393, align 4 %394 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @213, i32 0, i32 0)) %395 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %386, i32 0, i32 0 %396 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %387, i32 0, i32 0 %397 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %395, i32 0, i32 2 %398 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %395, i32 0, i32 0 store i1 true, i1* %398, align 1 %399 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %395, i32 0, i32 1 store i8* %394, i8** %399, align 8 store { i8*, i32, i32, i32, i32 }* %396, { i8*, i32, i32, i32, i32 }** %397, align 8 %400 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %395, i32 0, i32 3 store i32 1, i32* %400, align 4 %401 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %386, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %401, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @214, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @211, i32 0, i32 0), i64 1, i32 2, i64 %377, i64 %382) call void @exit(i32 1) unreachable ifcont36: ; preds = %ifcont34 %402 = getelementptr %dimension_descriptor, %dimension_descriptor* %375, i32 0, i32 2 %403 = load i64, i64* %402, align 8 %404 = mul i64 %403, %380 %405 = add i64 %374, %404 %406 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %343, i32 2 %407 = getelementptr %dimension_descriptor, %dimension_descriptor* %406, i32 0, i32 0 %408 = load i64, i64* %407, align 8 %409 = getelementptr %dimension_descriptor, %dimension_descriptor* %406, i32 0, i32 1 %410 = load i64, i64* %409, align 8 %411 = sub i64 1, %408 %412 = add i64 %408, %410 %413 = sub i64 %412, 1 %414 = icmp slt i64 1, %408 %415 = icmp sgt i64 1, %413 %416 = or i1 %414, %415 br i1 %416, label %then37, label %ifcont38 then37: ; preds = %ifcont36 %417 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %418 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %419 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %418, i32 0, i32 0 %420 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %419, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @216, i32 0, i32 0), i8** %420, align 8 %421 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %419, i32 0, i32 1 store i32 14, i32* %421, align 4 %422 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %419, i32 0, i32 2 store i32 14, i32* %422, align 4 %423 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %419, i32 0, i32 3 store i32 14, i32* %423, align 4 %424 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %419, i32 0, i32 4 store i32 23, i32* %424, align 4 %425 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @217, i32 0, i32 0)) %426 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %417, i32 0, i32 0 %427 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %418, i32 0, i32 0 %428 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %426, i32 0, i32 2 %429 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %426, i32 0, i32 0 store i1 true, i1* %429, align 1 %430 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %426, i32 0, i32 1 store i8* %425, i8** %430, align 8 store { i8*, i32, i32, i32, i32 }* %427, { i8*, i32, i32, i32, i32 }** %428, align 8 %431 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %426, i32 0, i32 3 store i32 1, i32* %431, align 4 %432 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %417, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %432, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @218, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @215, i32 0, i32 0), i64 1, i32 3, i64 %408, i64 %413) call void @exit(i32 1) unreachable ifcont38: ; preds = %ifcont36 %433 = getelementptr %dimension_descriptor, %dimension_descriptor* %406, i32 0, i32 2 %434 = load i64, i64* %433, align 8 %435 = mul i64 %434, %411 %436 = add i64 %405, %435 %437 = getelementptr %array.3, %array.3* %318, i32 0, i32 7 %438 = load i64, i64* %437, align 8 %439 = add i64 %436, %438 %440 = getelementptr %array.3, %array.3* %318, i32 0, i32 0 %441 = load i32*, i32** %440, align 8 %442 = getelementptr inbounds i32, i32* %441, i64 %439 %443 = load i32, i32* %442, align 4 %444 = alloca i32, align 4 store i32 %443, i32* %444, align 4 %445 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.3, i32 0, i32 0), i64* %317, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %444) %446 = load i64, i64* %317, align 8 %447 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %445, i8** %447, align 8 %448 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %446, i64* %448, align 8 %449 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %450 = load i8*, i8** %449, align 8 %451 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %452 = load i64, i64* %451, align 8 %453 = trunc i64 %452 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @219, i32 0, i32 0), i8* %450, i32 %453, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @202, i32 0, i32 0), i32 1) %454 = icmp eq i8* %445, null br i1 %454, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont38 call void @_lfortran_free_alloc(i8* %2, i8* %445) br label %free_done free_done: ; preds = %free_nonnull, %ifcont38 br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_allocate_03 FINALIZE_SYMTABLE_allocate_03: ; preds = %return br label %Finalize_Variable_c Finalize_Variable_c: ; preds = %FINALIZE_SYMTABLE_allocate_03 %455 = load %array.3*, %array.3** %c, align 8 call void @finalize_allocatable__Array_3_i32(%array.3* %455) call void @_lfortran_internal_alloc_finalize() ret i32 0 } define void @f(%array.3** %c) { .entry: %0 = call i8* @_lfortran_get_default_allocator() %1 = load %array.3*, %array.3** %c, align 8 %2 = load %array.3*, %array.3** %c, align 8 %3 = ptrtoint %array.3* %2 to i64 %4 = icmp eq i64 %3, 0 br i1 %4, label %merge_allocated, label %check_data check_data: ; preds = %.entry %5 = getelementptr %array.3, %array.3* %2, i32 0, i32 0 %6 = load i32*, i32** %5, align 8 %7 = ptrtoint i32* %6 to i64 %8 = icmp ne i64 %7, 0 br label %merge_allocated merge_allocated: ; preds = %check_data, %.entry %is_allocated = phi i1 [ false, %.entry ], [ %8, %check_data ] br i1 %is_allocated, label %then, label %else5 then: ; preds = %merge_allocated %9 = load %array.3*, %array.3** %c, align 8 %10 = ptrtoint %array.3* %9 to i64 %11 = icmp eq i64 %10, 0 br i1 %11, label %merge_allocated2, label %check_data1 check_data1: ; preds = %then %12 = getelementptr %array.3, %array.3* %9, i32 0, i32 0 %13 = load i32*, i32** %12, align 8 %14 = ptrtoint i32* %13 to i64 %15 = icmp ne i64 %14, 0 br label %merge_allocated2 merge_allocated2: ; preds = %check_data1, %then %is_allocated3 = phi i1 [ false, %then ], [ %15, %check_data1 ] br i1 %is_allocated3, label %then4, label %else then4: ; preds = %merge_allocated2 %16 = getelementptr %array.3, %array.3* %9, i32 0, i32 0 %17 = load i32*, i32** %16, align 8 %18 = bitcast i32* %17 to i8* call void @_lfortran_free_alloc(i8* %0, i8* %18) %19 = getelementptr %array.3, %array.3* %9, i32 0, i32 0 store i32* null, i32** %19, align 8 br label %ifcont else: ; preds = %merge_allocated2 br label %ifcont ifcont: ; preds = %else, %then4 br label %ifcont6 else5: ; preds = %merge_allocated br label %ifcont6 ifcont6: ; preds = %else5, %ifcont %20 = load %array.3*, %array.3** %c, align 8 %21 = ptrtoint %array.3* %20 to i64 %22 = icmp eq i64 %21, 0 br i1 %22, label %merge_allocated8, label %check_data7 check_data7: ; preds = %ifcont6 %23 = getelementptr %array.3, %array.3* %20, i32 0, i32 0 %24 = load i32*, i32** %23, align 8 %25 = ptrtoint i32* %24 to i64 %26 = icmp ne i64 %25, 0 br label %merge_allocated8 merge_allocated8: ; preds = %check_data7, %ifcont6 %is_allocated9 = phi i1 [ false, %ifcont6 ], [ %26, %check_data7 ] br i1 %is_allocated9, label %then10, label %ifcont11 then10: ; preds = %merge_allocated8 %27 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %28 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %29 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %28, i32 0, i32 0 %30 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %29, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @1, i32 0, i32 0), i8** %30, align 8 %31 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %29, i32 0, i32 1 store i32 20, i32* %31, align 4 %32 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %29, i32 0, i32 2 store i32 14, i32* %32, align 4 %33 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %29, i32 0, i32 3 store i32 20, i32* %33, align 4 %34 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %29, i32 0, i32 4 store i32 23, i32* %34, align 4 %35 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @2, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) %36 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %27, i32 0, i32 0 %37 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %28, i32 0, i32 0 %38 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %36, i32 0, i32 2 %39 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %36, i32 0, i32 0 store i1 true, i1* %39, align 1 %40 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %36, i32 0, i32 1 store i8* %35, i8** %40, align 8 store { i8*, i32, i32, i32, i32 }* %37, { i8*, i32, i32, i32, i32 }** %38, align 8 %41 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %36, i32 0, i32 3 store i32 1, i32* %41, align 4 %42 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %27, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %42, i32 1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont11: ; preds = %merge_allocated8 %43 = load %array.3*, %array.3** %c, align 8 %44 = ptrtoint %array.3* %43 to i64 %45 = icmp eq i64 %44, 0 br i1 %45, label %then12, label %else13 then12: ; preds = %ifcont11 %46 = call i8* @_lfortran_get_default_allocator() %47 = call i8* @_lfortran_malloc_alloc(i8* %46, i64 104) %48 = bitcast i8* %47 to %array.3* %49 = getelementptr %array.3, %array.3* %48, i32 0, i32 3 store i8 3, i8* %49, align 1 %50 = getelementptr %array.3, %array.3* %48, i32 0, i32 0 store i32* null, i32** %50, align 8 store %array.3* %48, %array.3** %c, align 8 br label %ifcont14 else13: ; preds = %ifcont11 br label %ifcont14 ifcont14: ; preds = %else13, %then12 %51 = load %array.3*, %array.3** %c, align 8 %52 = getelementptr %array.3, %array.3* %51, i32 0, i32 7 store i64 0, i64* %52, align 8 %53 = getelementptr %array.3, %array.3* %51, i32 0, i32 8 %54 = getelementptr [3 x %dimension_descriptor], [3 x %dimension_descriptor]* %53, i32 0, i32 0 %55 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %54, i32 0 %56 = getelementptr %dimension_descriptor, %dimension_descriptor* %55, i32 0, i32 2 %57 = getelementptr %dimension_descriptor, %dimension_descriptor* %55, i32 0, i32 0 %58 = getelementptr %dimension_descriptor, %dimension_descriptor* %55, i32 0, i32 1 store i64 1, i64* %56, align 8 store i64 1, i64* %57, align 8 store i64 3, i64* %58, align 8 %59 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %54, i32 1 %60 = getelementptr %dimension_descriptor, %dimension_descriptor* %59, i32 0, i32 2 %61 = getelementptr %dimension_descriptor, %dimension_descriptor* %59, i32 0, i32 0 %62 = getelementptr %dimension_descriptor, %dimension_descriptor* %59, i32 0, i32 1 store i64 3, i64* %60, align 8 store i64 1, i64* %61, align 8 store i64 3, i64* %62, align 8 %63 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %54, i32 2 %64 = getelementptr %dimension_descriptor, %dimension_descriptor* %63, i32 0, i32 2 %65 = getelementptr %dimension_descriptor, %dimension_descriptor* %63, i32 0, i32 0 %66 = getelementptr %dimension_descriptor, %dimension_descriptor* %63, i32 0, i32 1 store i64 9, i64* %64, align 8 store i64 1, i64* %65, align 8 store i64 3, i64* %66, align 8 %67 = getelementptr %array.3, %array.3* %51, i32 0, i32 0 %68 = call i8* @_lfortran_get_default_allocator() %69 = call i8* @_lfortran_malloc_alloc(i8* %68, i64 108) %70 = bitcast i8* %69 to i32* store i32* %70, i32** %67, align 8 %71 = load %array.3*, %array.3** %c, align 8 %72 = ptrtoint %array.3* %71 to i64 %73 = icmp eq i64 %72, 0 br i1 %73, label %merge_allocated16, label %check_data15 check_data15: ; preds = %ifcont14 %74 = getelementptr %array.3, %array.3* %71, i32 0, i32 0 %75 = load i32*, i32** %74, align 8 %76 = ptrtoint i32* %75 to i64 %77 = icmp ne i64 %76, 0 br label %merge_allocated16 merge_allocated16: ; preds = %check_data15, %ifcont14 %is_allocated17 = phi i1 [ false, %ifcont14 ], [ %77, %check_data15 ] %78 = xor i1 %is_allocated17, true br i1 %78, label %then18, label %ifcont19 then18: ; preds = %merge_allocated16 %79 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %80 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %81 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %80, i32 0, i32 0 %82 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %81, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @5, i32 0, i32 0), i8** %82, align 8 %83 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %81, i32 0, i32 1 store i32 21, i32* %83, align 4 %84 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %81, i32 0, i32 2 store i32 5, i32* %84, align 4 %85 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %81, i32 0, i32 3 store i32 21, i32* %85, align 4 %86 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %81, i32 0, i32 4 store i32 14, i32* %86, align 4 %87 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @6, i32 0, i32 0)) %88 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %79, i32 0, i32 0 %89 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %80, i32 0, i32 0 %90 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %88, i32 0, i32 2 %91 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %88, i32 0, i32 0 store i1 true, i1* %91, align 1 %92 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %88, i32 0, i32 1 store i8* %87, i8** %92, align 8 store { i8*, i32, i32, i32, i32 }* %89, { i8*, i32, i32, i32, i32 }** %90, align 8 %93 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %88, i32 0, i32 3 store i32 1, i32* %93, align 4 %94 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %79, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %94, i32 1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont19: ; preds = %merge_allocated16 %95 = getelementptr %array.3, %array.3* %71, i32 0, i32 8 %96 = getelementptr [3 x %dimension_descriptor], [3 x %dimension_descriptor]* %95, i32 0, i32 0 %97 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %96, i32 0 %98 = getelementptr %dimension_descriptor, %dimension_descriptor* %97, i32 0, i32 0 %99 = load i64, i64* %98, align 8 %100 = getelementptr %dimension_descriptor, %dimension_descriptor* %97, i32 0, i32 1 %101 = load i64, i64* %100, align 8 %102 = sub i64 1, %99 %103 = add i64 %99, %101 %104 = sub i64 %103, 1 %105 = icmp slt i64 1, %99 %106 = icmp sgt i64 1, %104 %107 = or i1 %105, %106 br i1 %107, label %then20, label %ifcont21 then20: ; preds = %ifcont19 %108 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %109 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %110 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %109, i32 0, i32 0 %111 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %110, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @9, i32 0, i32 0), i8** %111, align 8 %112 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %110, i32 0, i32 1 store i32 21, i32* %112, align 4 %113 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %110, i32 0, i32 2 store i32 5, i32* %113, align 4 %114 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %110, i32 0, i32 3 store i32 21, i32* %114, align 4 %115 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %110, i32 0, i32 4 store i32 14, i32* %115, align 4 %116 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @10, i32 0, i32 0)) %117 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %108, i32 0, i32 0 %118 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %109, i32 0, i32 0 %119 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %117, i32 0, i32 2 %120 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %117, i32 0, i32 0 store i1 true, i1* %120, align 1 %121 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %117, i32 0, i32 1 store i8* %116, i8** %121, align 8 store { i8*, i32, i32, i32, i32 }* %118, { i8*, i32, i32, i32, i32 }** %119, align 8 %122 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %117, i32 0, i32 3 store i32 1, i32* %122, align 4 %123 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %108, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %123, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i64 1, i32 1, i64 %99, i64 %104) call void @exit(i32 1) unreachable ifcont21: ; preds = %ifcont19 %124 = getelementptr %dimension_descriptor, %dimension_descriptor* %97, i32 0, i32 2 %125 = load i64, i64* %124, align 8 %126 = mul i64 %125, %102 %127 = add i64 0, %126 %128 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %96, i32 1 %129 = getelementptr %dimension_descriptor, %dimension_descriptor* %128, i32 0, i32 0 %130 = load i64, i64* %129, align 8 %131 = getelementptr %dimension_descriptor, %dimension_descriptor* %128, i32 0, i32 1 %132 = load i64, i64* %131, align 8 %133 = sub i64 1, %130 %134 = add i64 %130, %132 %135 = sub i64 %134, 1 %136 = icmp slt i64 1, %130 %137 = icmp sgt i64 1, %135 %138 = or i1 %136, %137 br i1 %138, label %then22, label %ifcont23 then22: ; preds = %ifcont21 %139 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %140 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %141 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %140, i32 0, i32 0 %142 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %141, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @13, i32 0, i32 0), i8** %142, align 8 %143 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %141, i32 0, i32 1 store i32 21, i32* %143, align 4 %144 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %141, i32 0, i32 2 store i32 5, i32* %144, align 4 %145 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %141, i32 0, i32 3 store i32 21, i32* %145, align 4 %146 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %141, i32 0, i32 4 store i32 14, i32* %146, align 4 %147 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @14, i32 0, i32 0)) %148 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %139, i32 0, i32 0 %149 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %140, i32 0, i32 0 %150 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %148, i32 0, i32 2 %151 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %148, i32 0, i32 0 store i1 true, i1* %151, align 1 %152 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %148, i32 0, i32 1 store i8* %147, i8** %152, align 8 store { i8*, i32, i32, i32, i32 }* %149, { i8*, i32, i32, i32, i32 }** %150, align 8 %153 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %148, i32 0, i32 3 store i32 1, i32* %153, align 4 %154 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %139, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %154, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i64 1, i32 2, i64 %130, i64 %135) call void @exit(i32 1) unreachable ifcont23: ; preds = %ifcont21 %155 = getelementptr %dimension_descriptor, %dimension_descriptor* %128, i32 0, i32 2 %156 = load i64, i64* %155, align 8 %157 = mul i64 %156, %133 %158 = add i64 %127, %157 %159 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %96, i32 2 %160 = getelementptr %dimension_descriptor, %dimension_descriptor* %159, i32 0, i32 0 %161 = load i64, i64* %160, align 8 %162 = getelementptr %dimension_descriptor, %dimension_descriptor* %159, i32 0, i32 1 %163 = load i64, i64* %162, align 8 %164 = sub i64 1, %161 %165 = add i64 %161, %163 %166 = sub i64 %165, 1 %167 = icmp slt i64 1, %161 %168 = icmp sgt i64 1, %166 %169 = or i1 %167, %168 br i1 %169, label %then24, label %ifcont25 then24: ; preds = %ifcont23 %170 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %171 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %172 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %171, i32 0, i32 0 %173 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %172, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @17, i32 0, i32 0), i8** %173, align 8 %174 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %172, i32 0, i32 1 store i32 21, i32* %174, align 4 %175 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %172, i32 0, i32 2 store i32 5, i32* %175, align 4 %176 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %172, i32 0, i32 3 store i32 21, i32* %176, align 4 %177 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %172, i32 0, i32 4 store i32 14, i32* %177, align 4 %178 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @18, i32 0, i32 0)) %179 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %170, i32 0, i32 0 %180 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %171, i32 0, i32 0 %181 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %179, i32 0, i32 2 %182 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %179, i32 0, i32 0 store i1 true, i1* %182, align 1 %183 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %179, i32 0, i32 1 store i8* %178, i8** %183, align 8 store { i8*, i32, i32, i32, i32 }* %180, { i8*, i32, i32, i32, i32 }** %181, align 8 %184 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %179, i32 0, i32 3 store i32 1, i32* %184, align 4 %185 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %170, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %185, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0), i64 1, i32 3, i64 %161, i64 %166) call void @exit(i32 1) unreachable ifcont25: ; preds = %ifcont23 %186 = getelementptr %dimension_descriptor, %dimension_descriptor* %159, i32 0, i32 2 %187 = load i64, i64* %186, align 8 %188 = mul i64 %187, %164 %189 = add i64 %158, %188 %190 = getelementptr %array.3, %array.3* %71, i32 0, i32 7 %191 = load i64, i64* %190, align 8 %192 = add i64 %189, %191 %193 = getelementptr %array.3, %array.3* %71, i32 0, i32 0 %194 = load i32*, i32** %193, align 8 %195 = getelementptr inbounds i32, i32* %194, i64 %192 store i32 99, i32* %195, align 4 br label %return return: ; preds = %ifcont25 br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return ret void } define i32 @g(%array.3** %x) { .entry: %stringFormat_desc31 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %r = alloca i32, align 4 %1 = alloca i64, align 8 %2 = load %array.3*, %array.3** %x, align 8 %3 = ptrtoint %array.3* %2 to i64 %4 = icmp eq i64 %3, 0 br i1 %4, label %merge_allocated, label %check_data check_data: ; preds = %.entry %5 = getelementptr %array.3, %array.3* %2, i32 0, i32 0 %6 = load i32*, i32** %5, align 8 %7 = ptrtoint i32* %6 to i64 %8 = icmp ne i64 %7, 0 br label %merge_allocated merge_allocated: ; preds = %check_data, %.entry %is_allocated = phi i1 [ false, %.entry ], [ %8, %check_data ] %9 = xor i1 %is_allocated, true br i1 %9, label %then, label %ifcont then: ; preds = %merge_allocated %10 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %11 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %12 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %11, i32 0, i32 0 %13 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %12, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @22, i32 0, i32 0), i8** %13, align 8 %14 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %12, i32 0, i32 1 store i32 27, i32* %14, align 4 %15 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %12, i32 0, i32 2 store i32 14, i32* %15, align 4 %16 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %12, i32 0, i32 3 store i32 27, i32* %16, align 4 %17 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %12, i32 0, i32 4 store i32 23, i32* %17, align 4 %18 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @23, i32 0, i32 0)) %19 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %10, i32 0, i32 0 %20 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %11, i32 0, i32 0 %21 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %19, i32 0, i32 2 %22 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %19, i32 0, i32 0 store i1 true, i1* %22, align 1 %23 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %19, i32 0, i32 1 store i8* %18, i8** %23, align 8 store { i8*, i32, i32, i32, i32 }* %20, { i8*, i32, i32, i32, i32 }** %21, align 8 %24 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %19, i32 0, i32 3 store i32 1, i32* %24, align 4 %25 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %10, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %25, i32 1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @24, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @21, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont: ; preds = %merge_allocated %26 = getelementptr %array.3, %array.3* %2, i32 0, i32 8 %27 = getelementptr [3 x %dimension_descriptor], [3 x %dimension_descriptor]* %26, i32 0, i32 0 %28 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %27, i32 0 %29 = getelementptr %dimension_descriptor, %dimension_descriptor* %28, i32 0, i32 0 %30 = load i64, i64* %29, align 8 %31 = getelementptr %dimension_descriptor, %dimension_descriptor* %28, i32 0, i32 1 %32 = load i64, i64* %31, align 8 %33 = sub i64 1, %30 %34 = add i64 %30, %32 %35 = sub i64 %34, 1 %36 = icmp slt i64 1, %30 %37 = icmp sgt i64 1, %35 %38 = or i1 %36, %37 br i1 %38, label %then1, label %ifcont2 then1: ; preds = %ifcont %39 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %40 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %41 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %40, i32 0, i32 0 %42 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %41, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @26, i32 0, i32 0), i8** %42, align 8 %43 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %41, i32 0, i32 1 store i32 27, i32* %43, align 4 %44 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %41, i32 0, i32 2 store i32 14, i32* %44, align 4 %45 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %41, i32 0, i32 3 store i32 27, i32* %45, align 4 %46 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %41, i32 0, i32 4 store i32 23, i32* %46, align 4 %47 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @27, i32 0, i32 0)) %48 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %39, i32 0, i32 0 %49 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %40, i32 0, i32 0 %50 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %48, i32 0, i32 2 %51 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %48, i32 0, i32 0 store i1 true, i1* %51, align 1 %52 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %48, i32 0, i32 1 store i8* %47, i8** %52, align 8 store { i8*, i32, i32, i32, i32 }* %49, { i8*, i32, i32, i32, i32 }** %50, align 8 %53 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %48, i32 0, i32 3 store i32 1, i32* %53, align 4 %54 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %39, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %54, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @28, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @25, i32 0, i32 0), i64 1, i32 1, i64 %30, i64 %35) call void @exit(i32 1) unreachable ifcont2: ; preds = %ifcont %55 = getelementptr %dimension_descriptor, %dimension_descriptor* %28, i32 0, i32 2 %56 = load i64, i64* %55, align 8 %57 = mul i64 %56, %33 %58 = add i64 0, %57 %59 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %27, i32 1 %60 = getelementptr %dimension_descriptor, %dimension_descriptor* %59, i32 0, i32 0 %61 = load i64, i64* %60, align 8 %62 = getelementptr %dimension_descriptor, %dimension_descriptor* %59, i32 0, i32 1 %63 = load i64, i64* %62, align 8 %64 = sub i64 1, %61 %65 = add i64 %61, %63 %66 = sub i64 %65, 1 %67 = icmp slt i64 1, %61 %68 = icmp sgt i64 1, %66 %69 = or i1 %67, %68 br i1 %69, label %then3, label %ifcont4 then3: ; preds = %ifcont2 %70 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %71 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %72 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %71, i32 0, i32 0 %73 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %72, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @30, i32 0, i32 0), i8** %73, align 8 %74 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %72, i32 0, i32 1 store i32 27, i32* %74, align 4 %75 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %72, i32 0, i32 2 store i32 14, i32* %75, align 4 %76 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %72, i32 0, i32 3 store i32 27, i32* %76, align 4 %77 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %72, i32 0, i32 4 store i32 23, i32* %77, align 4 %78 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @31, i32 0, i32 0)) %79 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %70, i32 0, i32 0 %80 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %71, i32 0, i32 0 %81 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %79, i32 0, i32 2 %82 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %79, i32 0, i32 0 store i1 true, i1* %82, align 1 %83 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %79, i32 0, i32 1 store i8* %78, i8** %83, align 8 store { i8*, i32, i32, i32, i32 }* %80, { i8*, i32, i32, i32, i32 }** %81, align 8 %84 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %79, i32 0, i32 3 store i32 1, i32* %84, align 4 %85 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %70, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %85, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @32, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @29, i32 0, i32 0), i64 1, i32 2, i64 %61, i64 %66) call void @exit(i32 1) unreachable ifcont4: ; preds = %ifcont2 %86 = getelementptr %dimension_descriptor, %dimension_descriptor* %59, i32 0, i32 2 %87 = load i64, i64* %86, align 8 %88 = mul i64 %87, %64 %89 = add i64 %58, %88 %90 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %27, i32 2 %91 = getelementptr %dimension_descriptor, %dimension_descriptor* %90, i32 0, i32 0 %92 = load i64, i64* %91, align 8 %93 = getelementptr %dimension_descriptor, %dimension_descriptor* %90, i32 0, i32 1 %94 = load i64, i64* %93, align 8 %95 = sub i64 1, %92 %96 = add i64 %92, %94 %97 = sub i64 %96, 1 %98 = icmp slt i64 1, %92 %99 = icmp sgt i64 1, %97 %100 = or i1 %98, %99 br i1 %100, label %then5, label %ifcont6 then5: ; preds = %ifcont4 %101 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %102 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %103 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %102, i32 0, i32 0 %104 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %103, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @34, i32 0, i32 0), i8** %104, align 8 %105 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %103, i32 0, i32 1 store i32 27, i32* %105, align 4 %106 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %103, i32 0, i32 2 store i32 14, i32* %106, align 4 %107 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %103, i32 0, i32 3 store i32 27, i32* %107, align 4 %108 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %103, i32 0, i32 4 store i32 23, i32* %108, align 4 %109 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @35, i32 0, i32 0)) %110 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %101, i32 0, i32 0 %111 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %102, i32 0, i32 0 %112 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %110, i32 0, i32 2 %113 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %110, i32 0, i32 0 store i1 true, i1* %113, align 1 %114 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %110, i32 0, i32 1 store i8* %109, i8** %114, align 8 store { i8*, i32, i32, i32, i32 }* %111, { i8*, i32, i32, i32, i32 }** %112, align 8 %115 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %110, i32 0, i32 3 store i32 1, i32* %115, align 4 %116 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %101, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %116, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @36, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @33, i32 0, i32 0), i64 1, i32 3, i64 %92, i64 %97) call void @exit(i32 1) unreachable ifcont6: ; preds = %ifcont4 %117 = getelementptr %dimension_descriptor, %dimension_descriptor* %90, i32 0, i32 2 %118 = load i64, i64* %117, align 8 %119 = mul i64 %118, %95 %120 = add i64 %89, %119 %121 = getelementptr %array.3, %array.3* %2, i32 0, i32 7 %122 = load i64, i64* %121, align 8 %123 = add i64 %120, %122 %124 = getelementptr %array.3, %array.3* %2, i32 0, i32 0 %125 = load i32*, i32** %124, align 8 %126 = getelementptr inbounds i32, i32* %125, i64 %123 %127 = load i32, i32* %126, align 4 %128 = alloca i32, align 4 store i32 %127, i32* %128, align 4 %129 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %1, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %128) %130 = load i64, i64* %1, align 8 %131 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %129, i8** %131, align 8 %132 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %130, i64* %132, align 8 %133 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %134 = load i8*, i8** %133, align 8 %135 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %136 = load i64, i64* %135, align 8 %137 = trunc i64 %136 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @37, i32 0, i32 0), i8* %134, i32 %137, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0), i32 1) %138 = icmp eq i8* %129, null br i1 %138, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont6 call void @_lfortran_free_alloc(i8* %0, i8* %129) br label %free_done free_done: ; preds = %free_nonnull, %ifcont6 %139 = load %array.3*, %array.3** %x, align 8 %140 = ptrtoint %array.3* %139 to i64 %141 = icmp eq i64 %140, 0 br i1 %141, label %merge_allocated8, label %check_data7 check_data7: ; preds = %free_done %142 = getelementptr %array.3, %array.3* %139, i32 0, i32 0 %143 = load i32*, i32** %142, align 8 %144 = ptrtoint i32* %143 to i64 %145 = icmp ne i64 %144, 0 br label %merge_allocated8 merge_allocated8: ; preds = %check_data7, %free_done %is_allocated9 = phi i1 [ false, %free_done ], [ %145, %check_data7 ] %146 = xor i1 %is_allocated9, true br i1 %146, label %then10, label %ifcont11 then10: ; preds = %merge_allocated8 %147 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %148 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %149 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %148, i32 0, i32 0 %150 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %149, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @39, i32 0, i32 0), i8** %150, align 8 %151 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %149, i32 0, i32 1 store i32 28, i32* %151, align 4 %152 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %149, i32 0, i32 2 store i32 9, i32* %152, align 4 %153 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %149, i32 0, i32 3 store i32 28, i32* %153, align 4 %154 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %149, i32 0, i32 4 store i32 18, i32* %154, align 4 %155 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @40, i32 0, i32 0)) %156 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %147, i32 0, i32 0 %157 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %148, i32 0, i32 0 %158 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %156, i32 0, i32 2 %159 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %156, i32 0, i32 0 store i1 true, i1* %159, align 1 %160 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %156, i32 0, i32 1 store i8* %155, i8** %160, align 8 store { i8*, i32, i32, i32, i32 }* %157, { i8*, i32, i32, i32, i32 }** %158, align 8 %161 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %156, i32 0, i32 3 store i32 1, i32* %161, align 4 %162 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %147, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %162, i32 1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont11: ; preds = %merge_allocated8 %163 = getelementptr %array.3, %array.3* %139, i32 0, i32 8 %164 = getelementptr [3 x %dimension_descriptor], [3 x %dimension_descriptor]* %163, i32 0, i32 0 %165 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %164, i32 0 %166 = getelementptr %dimension_descriptor, %dimension_descriptor* %165, i32 0, i32 0 %167 = load i64, i64* %166, align 8 %168 = getelementptr %dimension_descriptor, %dimension_descriptor* %165, i32 0, i32 1 %169 = load i64, i64* %168, align 8 %170 = sub i64 1, %167 %171 = add i64 %167, %169 %172 = sub i64 %171, 1 %173 = icmp slt i64 1, %167 %174 = icmp sgt i64 1, %172 %175 = or i1 %173, %174 br i1 %175, label %then12, label %ifcont13 then12: ; preds = %ifcont11 %176 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %177 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %178 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %177, i32 0, i32 0 %179 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %178, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @43, i32 0, i32 0), i8** %179, align 8 %180 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %178, i32 0, i32 1 store i32 28, i32* %180, align 4 %181 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %178, i32 0, i32 2 store i32 9, i32* %181, align 4 %182 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %178, i32 0, i32 3 store i32 28, i32* %182, align 4 %183 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %178, i32 0, i32 4 store i32 18, i32* %183, align 4 %184 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @44, i32 0, i32 0)) %185 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %176, i32 0, i32 0 %186 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %177, i32 0, i32 0 %187 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %185, i32 0, i32 2 %188 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %185, i32 0, i32 0 store i1 true, i1* %188, align 1 %189 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %185, i32 0, i32 1 store i8* %184, i8** %189, align 8 store { i8*, i32, i32, i32, i32 }* %186, { i8*, i32, i32, i32, i32 }** %187, align 8 %190 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %185, i32 0, i32 3 store i32 1, i32* %190, align 4 %191 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %176, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %191, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @45, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0), i64 1, i32 1, i64 %167, i64 %172) call void @exit(i32 1) unreachable ifcont13: ; preds = %ifcont11 %192 = getelementptr %dimension_descriptor, %dimension_descriptor* %165, i32 0, i32 2 %193 = load i64, i64* %192, align 8 %194 = mul i64 %193, %170 %195 = add i64 0, %194 %196 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %164, i32 1 %197 = getelementptr %dimension_descriptor, %dimension_descriptor* %196, i32 0, i32 0 %198 = load i64, i64* %197, align 8 %199 = getelementptr %dimension_descriptor, %dimension_descriptor* %196, i32 0, i32 1 %200 = load i64, i64* %199, align 8 %201 = sub i64 1, %198 %202 = add i64 %198, %200 %203 = sub i64 %202, 1 %204 = icmp slt i64 1, %198 %205 = icmp sgt i64 1, %203 %206 = or i1 %204, %205 br i1 %206, label %then14, label %ifcont15 then14: ; preds = %ifcont13 %207 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %208 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %209 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %208, i32 0, i32 0 %210 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %209, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @47, i32 0, i32 0), i8** %210, align 8 %211 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %209, i32 0, i32 1 store i32 28, i32* %211, align 4 %212 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %209, i32 0, i32 2 store i32 9, i32* %212, align 4 %213 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %209, i32 0, i32 3 store i32 28, i32* %213, align 4 %214 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %209, i32 0, i32 4 store i32 18, i32* %214, align 4 %215 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @48, i32 0, i32 0)) %216 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %207, i32 0, i32 0 %217 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %208, i32 0, i32 0 %218 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %216, i32 0, i32 2 %219 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %216, i32 0, i32 0 store i1 true, i1* %219, align 1 %220 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %216, i32 0, i32 1 store i8* %215, i8** %220, align 8 store { i8*, i32, i32, i32, i32 }* %217, { i8*, i32, i32, i32, i32 }** %218, align 8 %221 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %216, i32 0, i32 3 store i32 1, i32* %221, align 4 %222 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %207, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %222, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @49, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @46, i32 0, i32 0), i64 1, i32 2, i64 %198, i64 %203) call void @exit(i32 1) unreachable ifcont15: ; preds = %ifcont13 %223 = getelementptr %dimension_descriptor, %dimension_descriptor* %196, i32 0, i32 2 %224 = load i64, i64* %223, align 8 %225 = mul i64 %224, %201 %226 = add i64 %195, %225 %227 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %164, i32 2 %228 = getelementptr %dimension_descriptor, %dimension_descriptor* %227, i32 0, i32 0 %229 = load i64, i64* %228, align 8 %230 = getelementptr %dimension_descriptor, %dimension_descriptor* %227, i32 0, i32 1 %231 = load i64, i64* %230, align 8 %232 = sub i64 1, %229 %233 = add i64 %229, %231 %234 = sub i64 %233, 1 %235 = icmp slt i64 1, %229 %236 = icmp sgt i64 1, %234 %237 = or i1 %235, %236 br i1 %237, label %then16, label %ifcont17 then16: ; preds = %ifcont15 %238 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %239 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %240 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %239, i32 0, i32 0 %241 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %240, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @51, i32 0, i32 0), i8** %241, align 8 %242 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %240, i32 0, i32 1 store i32 28, i32* %242, align 4 %243 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %240, i32 0, i32 2 store i32 9, i32* %243, align 4 %244 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %240, i32 0, i32 3 store i32 28, i32* %244, align 4 %245 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %240, i32 0, i32 4 store i32 18, i32* %245, align 4 %246 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @52, i32 0, i32 0)) %247 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %238, i32 0, i32 0 %248 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %239, i32 0, i32 0 %249 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %247, i32 0, i32 2 %250 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %247, i32 0, i32 0 store i1 true, i1* %250, align 1 %251 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %247, i32 0, i32 1 store i8* %246, i8** %251, align 8 store { i8*, i32, i32, i32, i32 }* %248, { i8*, i32, i32, i32, i32 }** %249, align 8 %252 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %247, i32 0, i32 3 store i32 1, i32* %252, align 4 %253 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %238, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %253, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @53, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @50, i32 0, i32 0), i64 1, i32 3, i64 %229, i64 %234) call void @exit(i32 1) unreachable ifcont17: ; preds = %ifcont15 %254 = getelementptr %dimension_descriptor, %dimension_descriptor* %227, i32 0, i32 2 %255 = load i64, i64* %254, align 8 %256 = mul i64 %255, %232 %257 = add i64 %226, %256 %258 = getelementptr %array.3, %array.3* %139, i32 0, i32 7 %259 = load i64, i64* %258, align 8 %260 = add i64 %257, %259 %261 = getelementptr %array.3, %array.3* %139, i32 0, i32 0 %262 = load i32*, i32** %261, align 8 %263 = getelementptr inbounds i32, i32* %262, i64 %260 %264 = load i32, i32* %263, align 4 %265 = icmp ne i32 %264, 8 br i1 %265, label %then18, label %else then18: ; preds = %ifcont17 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @55, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @54, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont19 else: ; preds = %ifcont17 br label %ifcont19 ifcont19: ; preds = %else, %then18 call void @f(%array.3** %x) %266 = alloca i64, align 8 %267 = load %array.3*, %array.3** %x, align 8 %268 = ptrtoint %array.3* %267 to i64 %269 = icmp eq i64 %268, 0 br i1 %269, label %merge_allocated21, label %check_data20 check_data20: ; preds = %ifcont19 %270 = getelementptr %array.3, %array.3* %267, i32 0, i32 0 %271 = load i32*, i32** %270, align 8 %272 = ptrtoint i32* %271 to i64 %273 = icmp ne i64 %272, 0 br label %merge_allocated21 merge_allocated21: ; preds = %check_data20, %ifcont19 %is_allocated22 = phi i1 [ false, %ifcont19 ], [ %273, %check_data20 ] %274 = xor i1 %is_allocated22, true br i1 %274, label %then23, label %ifcont24 then23: ; preds = %merge_allocated21 %275 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %276 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %277 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %276, i32 0, i32 0 %278 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %277, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @58, i32 0, i32 0), i8** %278, align 8 %279 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %277, i32 0, i32 1 store i32 30, i32* %279, align 4 %280 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %277, i32 0, i32 2 store i32 14, i32* %280, align 4 %281 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %277, i32 0, i32 3 store i32 30, i32* %281, align 4 %282 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %277, i32 0, i32 4 store i32 23, i32* %282, align 4 %283 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @59, i32 0, i32 0)) %284 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %275, i32 0, i32 0 %285 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %276, i32 0, i32 0 %286 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %284, i32 0, i32 2 %287 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %284, i32 0, i32 0 store i1 true, i1* %287, align 1 %288 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %284, i32 0, i32 1 store i8* %283, i8** %288, align 8 store { i8*, i32, i32, i32, i32 }* %285, { i8*, i32, i32, i32, i32 }** %286, align 8 %289 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %284, i32 0, i32 3 store i32 1, i32* %289, align 4 %290 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %275, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %290, i32 1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @60, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @57, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont24: ; preds = %merge_allocated21 %291 = getelementptr %array.3, %array.3* %267, i32 0, i32 8 %292 = getelementptr [3 x %dimension_descriptor], [3 x %dimension_descriptor]* %291, i32 0, i32 0 %293 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %292, i32 0 %294 = getelementptr %dimension_descriptor, %dimension_descriptor* %293, i32 0, i32 0 %295 = load i64, i64* %294, align 8 %296 = getelementptr %dimension_descriptor, %dimension_descriptor* %293, i32 0, i32 1 %297 = load i64, i64* %296, align 8 %298 = sub i64 1, %295 %299 = add i64 %295, %297 %300 = sub i64 %299, 1 %301 = icmp slt i64 1, %295 %302 = icmp sgt i64 1, %300 %303 = or i1 %301, %302 br i1 %303, label %then25, label %ifcont26 then25: ; preds = %ifcont24 %304 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %305 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %306 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %305, i32 0, i32 0 %307 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %306, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @62, i32 0, i32 0), i8** %307, align 8 %308 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %306, i32 0, i32 1 store i32 30, i32* %308, align 4 %309 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %306, i32 0, i32 2 store i32 14, i32* %309, align 4 %310 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %306, i32 0, i32 3 store i32 30, i32* %310, align 4 %311 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %306, i32 0, i32 4 store i32 23, i32* %311, align 4 %312 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @63, i32 0, i32 0)) %313 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %304, i32 0, i32 0 %314 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %305, i32 0, i32 0 %315 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %313, i32 0, i32 2 %316 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %313, i32 0, i32 0 store i1 true, i1* %316, align 1 %317 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %313, i32 0, i32 1 store i8* %312, i8** %317, align 8 store { i8*, i32, i32, i32, i32 }* %314, { i8*, i32, i32, i32, i32 }** %315, align 8 %318 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %313, i32 0, i32 3 store i32 1, i32* %318, align 4 %319 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %304, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %319, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @64, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @61, i32 0, i32 0), i64 1, i32 1, i64 %295, i64 %300) call void @exit(i32 1) unreachable ifcont26: ; preds = %ifcont24 %320 = getelementptr %dimension_descriptor, %dimension_descriptor* %293, i32 0, i32 2 %321 = load i64, i64* %320, align 8 %322 = mul i64 %321, %298 %323 = add i64 0, %322 %324 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %292, i32 1 %325 = getelementptr %dimension_descriptor, %dimension_descriptor* %324, i32 0, i32 0 %326 = load i64, i64* %325, align 8 %327 = getelementptr %dimension_descriptor, %dimension_descriptor* %324, i32 0, i32 1 %328 = load i64, i64* %327, align 8 %329 = sub i64 1, %326 %330 = add i64 %326, %328 %331 = sub i64 %330, 1 %332 = icmp slt i64 1, %326 %333 = icmp sgt i64 1, %331 %334 = or i1 %332, %333 br i1 %334, label %then27, label %ifcont28 then27: ; preds = %ifcont26 %335 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %336 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %337 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %336, i32 0, i32 0 %338 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %337, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @66, i32 0, i32 0), i8** %338, align 8 %339 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %337, i32 0, i32 1 store i32 30, i32* %339, align 4 %340 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %337, i32 0, i32 2 store i32 14, i32* %340, align 4 %341 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %337, i32 0, i32 3 store i32 30, i32* %341, align 4 %342 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %337, i32 0, i32 4 store i32 23, i32* %342, align 4 %343 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @67, i32 0, i32 0)) %344 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %335, i32 0, i32 0 %345 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %336, i32 0, i32 0 %346 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %344, i32 0, i32 2 %347 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %344, i32 0, i32 0 store i1 true, i1* %347, align 1 %348 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %344, i32 0, i32 1 store i8* %343, i8** %348, align 8 store { i8*, i32, i32, i32, i32 }* %345, { i8*, i32, i32, i32, i32 }** %346, align 8 %349 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %344, i32 0, i32 3 store i32 1, i32* %349, align 4 %350 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %335, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %350, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @68, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @65, i32 0, i32 0), i64 1, i32 2, i64 %326, i64 %331) call void @exit(i32 1) unreachable ifcont28: ; preds = %ifcont26 %351 = getelementptr %dimension_descriptor, %dimension_descriptor* %324, i32 0, i32 2 %352 = load i64, i64* %351, align 8 %353 = mul i64 %352, %329 %354 = add i64 %323, %353 %355 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %292, i32 2 %356 = getelementptr %dimension_descriptor, %dimension_descriptor* %355, i32 0, i32 0 %357 = load i64, i64* %356, align 8 %358 = getelementptr %dimension_descriptor, %dimension_descriptor* %355, i32 0, i32 1 %359 = load i64, i64* %358, align 8 %360 = sub i64 1, %357 %361 = add i64 %357, %359 %362 = sub i64 %361, 1 %363 = icmp slt i64 1, %357 %364 = icmp sgt i64 1, %362 %365 = or i1 %363, %364 br i1 %365, label %then29, label %ifcont30 then29: ; preds = %ifcont28 %366 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %367 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %368 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %367, i32 0, i32 0 %369 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %368, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @70, i32 0, i32 0), i8** %369, align 8 %370 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %368, i32 0, i32 1 store i32 30, i32* %370, align 4 %371 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %368, i32 0, i32 2 store i32 14, i32* %371, align 4 %372 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %368, i32 0, i32 3 store i32 30, i32* %372, align 4 %373 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %368, i32 0, i32 4 store i32 23, i32* %373, align 4 %374 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @71, i32 0, i32 0)) %375 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %366, i32 0, i32 0 %376 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %367, i32 0, i32 0 %377 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %375, i32 0, i32 2 %378 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %375, i32 0, i32 0 store i1 true, i1* %378, align 1 %379 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %375, i32 0, i32 1 store i8* %374, i8** %379, align 8 store { i8*, i32, i32, i32, i32 }* %376, { i8*, i32, i32, i32, i32 }** %377, align 8 %380 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %375, i32 0, i32 3 store i32 1, i32* %380, align 4 %381 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %366, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %381, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @72, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @69, i32 0, i32 0), i64 1, i32 3, i64 %357, i64 %362) call void @exit(i32 1) unreachable ifcont30: ; preds = %ifcont28 %382 = getelementptr %dimension_descriptor, %dimension_descriptor* %355, i32 0, i32 2 %383 = load i64, i64* %382, align 8 %384 = mul i64 %383, %360 %385 = add i64 %354, %384 %386 = getelementptr %array.3, %array.3* %267, i32 0, i32 7 %387 = load i64, i64* %386, align 8 %388 = add i64 %385, %387 %389 = getelementptr %array.3, %array.3* %267, i32 0, i32 0 %390 = load i32*, i32** %389, align 8 %391 = getelementptr inbounds i32, i32* %390, i64 %388 %392 = load i32, i32* %391, align 4 %393 = alloca i32, align 4 store i32 %392, i32* %393, align 4 %394 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %266, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %393) %395 = load i64, i64* %266, align 8 %396 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc31, i32 0, i32 0 store i8* %394, i8** %396, align 8 %397 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc31, i32 0, i32 1 store i64 %395, i64* %397, align 8 %398 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc31, i32 0, i32 0 %399 = load i8*, i8** %398, align 8 %400 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc31, i32 0, i32 1 %401 = load i64, i64* %400, align 8 %402 = trunc i64 %401 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @73, i32 0, i32 0), i8* %399, i32 %402, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @56, i32 0, i32 0), i32 1) %403 = icmp eq i8* %394, null br i1 %403, label %free_done33, label %free_nonnull32 free_nonnull32: ; preds = %ifcont30 call void @_lfortran_free_alloc(i8* %0, i8* %394) br label %free_done33 free_done33: ; preds = %free_nonnull32, %ifcont30 %404 = load %array.3*, %array.3** %x, align 8 %405 = ptrtoint %array.3* %404 to i64 %406 = icmp eq i64 %405, 0 br i1 %406, label %merge_allocated35, label %check_data34 check_data34: ; preds = %free_done33 %407 = getelementptr %array.3, %array.3* %404, i32 0, i32 0 %408 = load i32*, i32** %407, align 8 %409 = ptrtoint i32* %408 to i64 %410 = icmp ne i64 %409, 0 br label %merge_allocated35 merge_allocated35: ; preds = %check_data34, %free_done33 %is_allocated36 = phi i1 [ false, %free_done33 ], [ %410, %check_data34 ] %411 = xor i1 %is_allocated36, true br i1 %411, label %then37, label %ifcont38 then37: ; preds = %merge_allocated35 %412 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %413 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %414 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %413, i32 0, i32 0 %415 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %414, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @75, i32 0, i32 0), i8** %415, align 8 %416 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %414, i32 0, i32 1 store i32 31, i32* %416, align 4 %417 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %414, i32 0, i32 2 store i32 9, i32* %417, align 4 %418 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %414, i32 0, i32 3 store i32 31, i32* %418, align 4 %419 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %414, i32 0, i32 4 store i32 18, i32* %419, align 4 %420 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @76, i32 0, i32 0)) %421 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %412, i32 0, i32 0 %422 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %413, i32 0, i32 0 %423 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %421, i32 0, i32 2 %424 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %421, i32 0, i32 0 store i1 true, i1* %424, align 1 %425 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %421, i32 0, i32 1 store i8* %420, i8** %425, align 8 store { i8*, i32, i32, i32, i32 }* %422, { i8*, i32, i32, i32, i32 }** %423, align 8 %426 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %421, i32 0, i32 3 store i32 1, i32* %426, align 4 %427 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %412, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %427, i32 1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @77, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @74, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont38: ; preds = %merge_allocated35 %428 = getelementptr %array.3, %array.3* %404, i32 0, i32 8 %429 = getelementptr [3 x %dimension_descriptor], [3 x %dimension_descriptor]* %428, i32 0, i32 0 %430 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %429, i32 0 %431 = getelementptr %dimension_descriptor, %dimension_descriptor* %430, i32 0, i32 0 %432 = load i64, i64* %431, align 8 %433 = getelementptr %dimension_descriptor, %dimension_descriptor* %430, i32 0, i32 1 %434 = load i64, i64* %433, align 8 %435 = sub i64 1, %432 %436 = add i64 %432, %434 %437 = sub i64 %436, 1 %438 = icmp slt i64 1, %432 %439 = icmp sgt i64 1, %437 %440 = or i1 %438, %439 br i1 %440, label %then39, label %ifcont40 then39: ; preds = %ifcont38 %441 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %442 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %443 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %442, i32 0, i32 0 %444 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %443, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @79, i32 0, i32 0), i8** %444, align 8 %445 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %443, i32 0, i32 1 store i32 31, i32* %445, align 4 %446 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %443, i32 0, i32 2 store i32 9, i32* %446, align 4 %447 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %443, i32 0, i32 3 store i32 31, i32* %447, align 4 %448 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %443, i32 0, i32 4 store i32 18, i32* %448, align 4 %449 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @80, i32 0, i32 0)) %450 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %441, i32 0, i32 0 %451 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %442, i32 0, i32 0 %452 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %450, i32 0, i32 2 %453 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %450, i32 0, i32 0 store i1 true, i1* %453, align 1 %454 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %450, i32 0, i32 1 store i8* %449, i8** %454, align 8 store { i8*, i32, i32, i32, i32 }* %451, { i8*, i32, i32, i32, i32 }** %452, align 8 %455 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %450, i32 0, i32 3 store i32 1, i32* %455, align 4 %456 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %441, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %456, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @81, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @78, i32 0, i32 0), i64 1, i32 1, i64 %432, i64 %437) call void @exit(i32 1) unreachable ifcont40: ; preds = %ifcont38 %457 = getelementptr %dimension_descriptor, %dimension_descriptor* %430, i32 0, i32 2 %458 = load i64, i64* %457, align 8 %459 = mul i64 %458, %435 %460 = add i64 0, %459 %461 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %429, i32 1 %462 = getelementptr %dimension_descriptor, %dimension_descriptor* %461, i32 0, i32 0 %463 = load i64, i64* %462, align 8 %464 = getelementptr %dimension_descriptor, %dimension_descriptor* %461, i32 0, i32 1 %465 = load i64, i64* %464, align 8 %466 = sub i64 1, %463 %467 = add i64 %463, %465 %468 = sub i64 %467, 1 %469 = icmp slt i64 1, %463 %470 = icmp sgt i64 1, %468 %471 = or i1 %469, %470 br i1 %471, label %then41, label %ifcont42 then41: ; preds = %ifcont40 %472 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %473 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %474 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %473, i32 0, i32 0 %475 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %474, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @83, i32 0, i32 0), i8** %475, align 8 %476 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %474, i32 0, i32 1 store i32 31, i32* %476, align 4 %477 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %474, i32 0, i32 2 store i32 9, i32* %477, align 4 %478 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %474, i32 0, i32 3 store i32 31, i32* %478, align 4 %479 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %474, i32 0, i32 4 store i32 18, i32* %479, align 4 %480 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @84, i32 0, i32 0)) %481 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %472, i32 0, i32 0 %482 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %473, i32 0, i32 0 %483 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %481, i32 0, i32 2 %484 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %481, i32 0, i32 0 store i1 true, i1* %484, align 1 %485 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %481, i32 0, i32 1 store i8* %480, i8** %485, align 8 store { i8*, i32, i32, i32, i32 }* %482, { i8*, i32, i32, i32, i32 }** %483, align 8 %486 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %481, i32 0, i32 3 store i32 1, i32* %486, align 4 %487 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %472, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %487, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @85, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @82, i32 0, i32 0), i64 1, i32 2, i64 %463, i64 %468) call void @exit(i32 1) unreachable ifcont42: ; preds = %ifcont40 %488 = getelementptr %dimension_descriptor, %dimension_descriptor* %461, i32 0, i32 2 %489 = load i64, i64* %488, align 8 %490 = mul i64 %489, %466 %491 = add i64 %460, %490 %492 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %429, i32 2 %493 = getelementptr %dimension_descriptor, %dimension_descriptor* %492, i32 0, i32 0 %494 = load i64, i64* %493, align 8 %495 = getelementptr %dimension_descriptor, %dimension_descriptor* %492, i32 0, i32 1 %496 = load i64, i64* %495, align 8 %497 = sub i64 1, %494 %498 = add i64 %494, %496 %499 = sub i64 %498, 1 %500 = icmp slt i64 1, %494 %501 = icmp sgt i64 1, %499 %502 = or i1 %500, %501 br i1 %502, label %then43, label %ifcont44 then43: ; preds = %ifcont42 %503 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %504 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %505 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %504, i32 0, i32 0 %506 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %505, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @87, i32 0, i32 0), i8** %506, align 8 %507 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %505, i32 0, i32 1 store i32 31, i32* %507, align 4 %508 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %505, i32 0, i32 2 store i32 9, i32* %508, align 4 %509 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %505, i32 0, i32 3 store i32 31, i32* %509, align 4 %510 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %505, i32 0, i32 4 store i32 18, i32* %510, align 4 %511 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @88, i32 0, i32 0)) %512 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %503, i32 0, i32 0 %513 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %504, i32 0, i32 0 %514 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %512, i32 0, i32 2 %515 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %512, i32 0, i32 0 store i1 true, i1* %515, align 1 %516 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %512, i32 0, i32 1 store i8* %511, i8** %516, align 8 store { i8*, i32, i32, i32, i32 }* %513, { i8*, i32, i32, i32, i32 }** %514, align 8 %517 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %512, i32 0, i32 3 store i32 1, i32* %517, align 4 %518 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %503, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %518, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @89, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @86, i32 0, i32 0), i64 1, i32 3, i64 %494, i64 %499) call void @exit(i32 1) unreachable ifcont44: ; preds = %ifcont42 %519 = getelementptr %dimension_descriptor, %dimension_descriptor* %492, i32 0, i32 2 %520 = load i64, i64* %519, align 8 %521 = mul i64 %520, %497 %522 = add i64 %491, %521 %523 = getelementptr %array.3, %array.3* %404, i32 0, i32 7 %524 = load i64, i64* %523, align 8 %525 = add i64 %522, %524 %526 = getelementptr %array.3, %array.3* %404, i32 0, i32 0 %527 = load i32*, i32** %526, align 8 %528 = getelementptr inbounds i32, i32* %527, i64 %525 %529 = load i32, i32* %528, align 4 %530 = icmp ne i32 %529, 99 br i1 %530, label %then45, label %else46 then45: ; preds = %ifcont44 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @91, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @90, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont47 else46: ; preds = %ifcont44 br label %ifcont47 ifcont47: ; preds = %else46, %then45 %531 = load %array.3*, %array.3** %x, align 8 %532 = ptrtoint %array.3* %531 to i64 %533 = icmp eq i64 %532, 0 br i1 %533, label %merge_allocated49, label %check_data48 check_data48: ; preds = %ifcont47 %534 = getelementptr %array.3, %array.3* %531, i32 0, i32 0 %535 = load i32*, i32** %534, align 8 %536 = ptrtoint i32* %535 to i64 %537 = icmp ne i64 %536, 0 br label %merge_allocated49 merge_allocated49: ; preds = %check_data48, %ifcont47 %is_allocated50 = phi i1 [ false, %ifcont47 ], [ %537, %check_data48 ] %538 = xor i1 %is_allocated50, true br i1 %538, label %then51, label %ifcont52 then51: ; preds = %merge_allocated49 %539 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %540 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %541 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %540, i32 0, i32 0 %542 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %541, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @93, i32 0, i32 0), i8** %542, align 8 %543 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %541, i32 0, i32 1 store i32 32, i32* %543, align 4 %544 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %541, i32 0, i32 2 store i32 5, i32* %544, align 4 %545 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %541, i32 0, i32 3 store i32 32, i32* %545, align 4 %546 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %541, i32 0, i32 4 store i32 14, i32* %546, align 4 %547 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @94, i32 0, i32 0)) %548 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %539, i32 0, i32 0 %549 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %540, i32 0, i32 0 %550 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %548, i32 0, i32 2 %551 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %548, i32 0, i32 0 store i1 true, i1* %551, align 1 %552 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %548, i32 0, i32 1 store i8* %547, i8** %552, align 8 store { i8*, i32, i32, i32, i32 }* %549, { i8*, i32, i32, i32, i32 }** %550, align 8 %553 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %548, i32 0, i32 3 store i32 1, i32* %553, align 4 %554 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %539, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %554, i32 1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @95, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @92, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont52: ; preds = %merge_allocated49 %555 = getelementptr %array.3, %array.3* %531, i32 0, i32 8 %556 = getelementptr [3 x %dimension_descriptor], [3 x %dimension_descriptor]* %555, i32 0, i32 0 %557 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %556, i32 0 %558 = getelementptr %dimension_descriptor, %dimension_descriptor* %557, i32 0, i32 0 %559 = load i64, i64* %558, align 8 %560 = getelementptr %dimension_descriptor, %dimension_descriptor* %557, i32 0, i32 1 %561 = load i64, i64* %560, align 8 %562 = sub i64 1, %559 %563 = add i64 %559, %561 %564 = sub i64 %563, 1 %565 = icmp slt i64 1, %559 %566 = icmp sgt i64 1, %564 %567 = or i1 %565, %566 br i1 %567, label %then53, label %ifcont54 then53: ; preds = %ifcont52 %568 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %569 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %570 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %569, i32 0, i32 0 %571 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %570, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @97, i32 0, i32 0), i8** %571, align 8 %572 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %570, i32 0, i32 1 store i32 32, i32* %572, align 4 %573 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %570, i32 0, i32 2 store i32 5, i32* %573, align 4 %574 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %570, i32 0, i32 3 store i32 32, i32* %574, align 4 %575 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %570, i32 0, i32 4 store i32 14, i32* %575, align 4 %576 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @98, i32 0, i32 0)) %577 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %568, i32 0, i32 0 %578 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %569, i32 0, i32 0 %579 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %577, i32 0, i32 2 %580 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %577, i32 0, i32 0 store i1 true, i1* %580, align 1 %581 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %577, i32 0, i32 1 store i8* %576, i8** %581, align 8 store { i8*, i32, i32, i32, i32 }* %578, { i8*, i32, i32, i32, i32 }** %579, align 8 %582 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %577, i32 0, i32 3 store i32 1, i32* %582, align 4 %583 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %568, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %583, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @99, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @96, i32 0, i32 0), i64 1, i32 1, i64 %559, i64 %564) call void @exit(i32 1) unreachable ifcont54: ; preds = %ifcont52 %584 = getelementptr %dimension_descriptor, %dimension_descriptor* %557, i32 0, i32 2 %585 = load i64, i64* %584, align 8 %586 = mul i64 %585, %562 %587 = add i64 0, %586 %588 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %556, i32 1 %589 = getelementptr %dimension_descriptor, %dimension_descriptor* %588, i32 0, i32 0 %590 = load i64, i64* %589, align 8 %591 = getelementptr %dimension_descriptor, %dimension_descriptor* %588, i32 0, i32 1 %592 = load i64, i64* %591, align 8 %593 = sub i64 1, %590 %594 = add i64 %590, %592 %595 = sub i64 %594, 1 %596 = icmp slt i64 1, %590 %597 = icmp sgt i64 1, %595 %598 = or i1 %596, %597 br i1 %598, label %then55, label %ifcont56 then55: ; preds = %ifcont54 %599 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %600 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %601 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %600, i32 0, i32 0 %602 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %601, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @101, i32 0, i32 0), i8** %602, align 8 %603 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %601, i32 0, i32 1 store i32 32, i32* %603, align 4 %604 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %601, i32 0, i32 2 store i32 5, i32* %604, align 4 %605 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %601, i32 0, i32 3 store i32 32, i32* %605, align 4 %606 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %601, i32 0, i32 4 store i32 14, i32* %606, align 4 %607 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @102, i32 0, i32 0)) %608 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %599, i32 0, i32 0 %609 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %600, i32 0, i32 0 %610 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %608, i32 0, i32 2 %611 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %608, i32 0, i32 0 store i1 true, i1* %611, align 1 %612 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %608, i32 0, i32 1 store i8* %607, i8** %612, align 8 store { i8*, i32, i32, i32, i32 }* %609, { i8*, i32, i32, i32, i32 }** %610, align 8 %613 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %608, i32 0, i32 3 store i32 1, i32* %613, align 4 %614 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %599, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %614, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @103, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @100, i32 0, i32 0), i64 1, i32 2, i64 %590, i64 %595) call void @exit(i32 1) unreachable ifcont56: ; preds = %ifcont54 %615 = getelementptr %dimension_descriptor, %dimension_descriptor* %588, i32 0, i32 2 %616 = load i64, i64* %615, align 8 %617 = mul i64 %616, %593 %618 = add i64 %587, %617 %619 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %556, i32 2 %620 = getelementptr %dimension_descriptor, %dimension_descriptor* %619, i32 0, i32 0 %621 = load i64, i64* %620, align 8 %622 = getelementptr %dimension_descriptor, %dimension_descriptor* %619, i32 0, i32 1 %623 = load i64, i64* %622, align 8 %624 = sub i64 1, %621 %625 = add i64 %621, %623 %626 = sub i64 %625, 1 %627 = icmp slt i64 1, %621 %628 = icmp sgt i64 1, %626 %629 = or i1 %627, %628 br i1 %629, label %then57, label %ifcont58 then57: ; preds = %ifcont56 %630 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %631 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %632 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %631, i32 0, i32 0 %633 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %632, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @105, i32 0, i32 0), i8** %633, align 8 %634 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %632, i32 0, i32 1 store i32 32, i32* %634, align 4 %635 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %632, i32 0, i32 2 store i32 5, i32* %635, align 4 %636 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %632, i32 0, i32 3 store i32 32, i32* %636, align 4 %637 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %632, i32 0, i32 4 store i32 14, i32* %637, align 4 %638 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @106, i32 0, i32 0)) %639 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %630, i32 0, i32 0 %640 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %631, i32 0, i32 0 %641 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %639, i32 0, i32 2 %642 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %639, i32 0, i32 0 store i1 true, i1* %642, align 1 %643 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %639, i32 0, i32 1 store i8* %638, i8** %643, align 8 store { i8*, i32, i32, i32, i32 }* %640, { i8*, i32, i32, i32, i32 }** %641, align 8 %644 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %639, i32 0, i32 3 store i32 1, i32* %644, align 4 %645 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %630, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %645, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @107, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @104, i32 0, i32 0), i64 1, i32 3, i64 %621, i64 %626) call void @exit(i32 1) unreachable ifcont58: ; preds = %ifcont56 %646 = getelementptr %dimension_descriptor, %dimension_descriptor* %619, i32 0, i32 2 %647 = load i64, i64* %646, align 8 %648 = mul i64 %647, %624 %649 = add i64 %618, %648 %650 = getelementptr %array.3, %array.3* %531, i32 0, i32 7 %651 = load i64, i64* %650, align 8 %652 = add i64 %649, %651 %653 = getelementptr %array.3, %array.3* %531, i32 0, i32 0 %654 = load i32*, i32** %653, align 8 %655 = getelementptr inbounds i32, i32* %654, i64 %652 store i32 8, i32* %655, align 4 store i32 0, i32* %r, align 4 br label %return return: ; preds = %ifcont58 br label %FINALIZE_SYMTABLE_g FINALIZE_SYMTABLE_g: ; preds = %return %656 = load i32, i32* %r, align 4 ret i32 %656 } define void @h(%array.3** %c) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %1 = load %array.3*, %array.3** %c, align 8 %2 = load %array.3*, %array.3** %c, align 8 %3 = ptrtoint %array.3* %2 to i64 %4 = icmp eq i64 %3, 0 br i1 %4, label %merge_allocated, label %check_data check_data: ; preds = %.entry %5 = getelementptr %array.3, %array.3* %2, i32 0, i32 0 %6 = load i32*, i32** %5, align 8 %7 = ptrtoint i32* %6 to i64 %8 = icmp ne i64 %7, 0 br label %merge_allocated merge_allocated: ; preds = %check_data, %.entry %is_allocated = phi i1 [ false, %.entry ], [ %8, %check_data ] br i1 %is_allocated, label %then, label %else5 then: ; preds = %merge_allocated %9 = load %array.3*, %array.3** %c, align 8 %10 = ptrtoint %array.3* %9 to i64 %11 = icmp eq i64 %10, 0 br i1 %11, label %merge_allocated2, label %check_data1 check_data1: ; preds = %then %12 = getelementptr %array.3, %array.3* %9, i32 0, i32 0 %13 = load i32*, i32** %12, align 8 %14 = ptrtoint i32* %13 to i64 %15 = icmp ne i64 %14, 0 br label %merge_allocated2 merge_allocated2: ; preds = %check_data1, %then %is_allocated3 = phi i1 [ false, %then ], [ %15, %check_data1 ] br i1 %is_allocated3, label %then4, label %else then4: ; preds = %merge_allocated2 %16 = getelementptr %array.3, %array.3* %9, i32 0, i32 0 %17 = load i32*, i32** %16, align 8 %18 = bitcast i32* %17 to i8* call void @_lfortran_free_alloc(i8* %0, i8* %18) %19 = getelementptr %array.3, %array.3* %9, i32 0, i32 0 store i32* null, i32** %19, align 8 br label %ifcont else: ; preds = %merge_allocated2 br label %ifcont ifcont: ; preds = %else, %then4 br label %ifcont6 else5: ; preds = %merge_allocated br label %ifcont6 ifcont6: ; preds = %else5, %ifcont %20 = load %array.3*, %array.3** %c, align 8 %21 = load %array.3*, %array.3** %c, align 8 %22 = ptrtoint %array.3* %21 to i64 %23 = icmp eq i64 %22, 0 br i1 %23, label %merge_allocated8, label %check_data7 check_data7: ; preds = %ifcont6 %24 = getelementptr %array.3, %array.3* %21, i32 0, i32 0 %25 = load i32*, i32** %24, align 8 %26 = ptrtoint i32* %25 to i64 %27 = icmp ne i64 %26, 0 br label %merge_allocated8 merge_allocated8: ; preds = %check_data7, %ifcont6 %is_allocated9 = phi i1 [ false, %ifcont6 ], [ %27, %check_data7 ] br i1 %is_allocated9, label %then10, label %else11 then10: ; preds = %merge_allocated8 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @109, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @108, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont12 else11: ; preds = %merge_allocated8 br label %ifcont12 ifcont12: ; preds = %else11, %then10 call void @f(%array.3** %c) %28 = alloca i64, align 8 %29 = load %array.3*, %array.3** %c, align 8 %30 = ptrtoint %array.3* %29 to i64 %31 = icmp eq i64 %30, 0 br i1 %31, label %merge_allocated14, label %check_data13 check_data13: ; preds = %ifcont12 %32 = getelementptr %array.3, %array.3* %29, i32 0, i32 0 %33 = load i32*, i32** %32, align 8 %34 = ptrtoint i32* %33 to i64 %35 = icmp ne i64 %34, 0 br label %merge_allocated14 merge_allocated14: ; preds = %check_data13, %ifcont12 %is_allocated15 = phi i1 [ false, %ifcont12 ], [ %35, %check_data13 ] %36 = xor i1 %is_allocated15, true br i1 %36, label %then16, label %ifcont17 then16: ; preds = %merge_allocated14 %37 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %38 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %39 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %38, i32 0, i32 0 %40 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %39, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @112, i32 0, i32 0), i8** %40, align 8 %41 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %39, i32 0, i32 1 store i32 40, i32* %41, align 4 %42 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %39, i32 0, i32 2 store i32 14, i32* %42, align 4 %43 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %39, i32 0, i32 3 store i32 40, i32* %43, align 4 %44 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %39, i32 0, i32 4 store i32 23, i32* %44, align 4 %45 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @113, i32 0, i32 0)) %46 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %37, i32 0, i32 0 %47 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %38, i32 0, i32 0 %48 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %46, i32 0, i32 2 %49 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %46, i32 0, i32 0 store i1 true, i1* %49, align 1 %50 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %46, i32 0, i32 1 store i8* %45, i8** %50, align 8 store { i8*, i32, i32, i32, i32 }* %47, { i8*, i32, i32, i32, i32 }** %48, align 8 %51 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %46, i32 0, i32 3 store i32 1, i32* %51, align 4 %52 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %37, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %52, i32 1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @114, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @111, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont17: ; preds = %merge_allocated14 %53 = getelementptr %array.3, %array.3* %29, i32 0, i32 8 %54 = getelementptr [3 x %dimension_descriptor], [3 x %dimension_descriptor]* %53, i32 0, i32 0 %55 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %54, i32 0 %56 = getelementptr %dimension_descriptor, %dimension_descriptor* %55, i32 0, i32 0 %57 = load i64, i64* %56, align 8 %58 = getelementptr %dimension_descriptor, %dimension_descriptor* %55, i32 0, i32 1 %59 = load i64, i64* %58, align 8 %60 = sub i64 1, %57 %61 = add i64 %57, %59 %62 = sub i64 %61, 1 %63 = icmp slt i64 1, %57 %64 = icmp sgt i64 1, %62 %65 = or i1 %63, %64 br i1 %65, label %then18, label %ifcont19 then18: ; preds = %ifcont17 %66 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %67 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %68 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %67, i32 0, i32 0 %69 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %68, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @116, i32 0, i32 0), i8** %69, align 8 %70 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %68, i32 0, i32 1 store i32 40, i32* %70, align 4 %71 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %68, i32 0, i32 2 store i32 14, i32* %71, align 4 %72 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %68, i32 0, i32 3 store i32 40, i32* %72, align 4 %73 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %68, i32 0, i32 4 store i32 23, i32* %73, align 4 %74 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @117, i32 0, i32 0)) %75 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %66, i32 0, i32 0 %76 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %67, i32 0, i32 0 %77 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %75, i32 0, i32 2 %78 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %75, i32 0, i32 0 store i1 true, i1* %78, align 1 %79 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %75, i32 0, i32 1 store i8* %74, i8** %79, align 8 store { i8*, i32, i32, i32, i32 }* %76, { i8*, i32, i32, i32, i32 }** %77, align 8 %80 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %75, i32 0, i32 3 store i32 1, i32* %80, align 4 %81 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %66, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %81, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @118, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @115, i32 0, i32 0), i64 1, i32 1, i64 %57, i64 %62) call void @exit(i32 1) unreachable ifcont19: ; preds = %ifcont17 %82 = getelementptr %dimension_descriptor, %dimension_descriptor* %55, i32 0, i32 2 %83 = load i64, i64* %82, align 8 %84 = mul i64 %83, %60 %85 = add i64 0, %84 %86 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %54, i32 1 %87 = getelementptr %dimension_descriptor, %dimension_descriptor* %86, i32 0, i32 0 %88 = load i64, i64* %87, align 8 %89 = getelementptr %dimension_descriptor, %dimension_descriptor* %86, i32 0, i32 1 %90 = load i64, i64* %89, align 8 %91 = sub i64 1, %88 %92 = add i64 %88, %90 %93 = sub i64 %92, 1 %94 = icmp slt i64 1, %88 %95 = icmp sgt i64 1, %93 %96 = or i1 %94, %95 br i1 %96, label %then20, label %ifcont21 then20: ; preds = %ifcont19 %97 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %98 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %99 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %98, i32 0, i32 0 %100 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %99, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @120, i32 0, i32 0), i8** %100, align 8 %101 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %99, i32 0, i32 1 store i32 40, i32* %101, align 4 %102 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %99, i32 0, i32 2 store i32 14, i32* %102, align 4 %103 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %99, i32 0, i32 3 store i32 40, i32* %103, align 4 %104 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %99, i32 0, i32 4 store i32 23, i32* %104, align 4 %105 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @121, i32 0, i32 0)) %106 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %97, i32 0, i32 0 %107 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %98, i32 0, i32 0 %108 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %106, i32 0, i32 2 %109 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %106, i32 0, i32 0 store i1 true, i1* %109, align 1 %110 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %106, i32 0, i32 1 store i8* %105, i8** %110, align 8 store { i8*, i32, i32, i32, i32 }* %107, { i8*, i32, i32, i32, i32 }** %108, align 8 %111 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %106, i32 0, i32 3 store i32 1, i32* %111, align 4 %112 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %97, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %112, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @122, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @119, i32 0, i32 0), i64 1, i32 2, i64 %88, i64 %93) call void @exit(i32 1) unreachable ifcont21: ; preds = %ifcont19 %113 = getelementptr %dimension_descriptor, %dimension_descriptor* %86, i32 0, i32 2 %114 = load i64, i64* %113, align 8 %115 = mul i64 %114, %91 %116 = add i64 %85, %115 %117 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %54, i32 2 %118 = getelementptr %dimension_descriptor, %dimension_descriptor* %117, i32 0, i32 0 %119 = load i64, i64* %118, align 8 %120 = getelementptr %dimension_descriptor, %dimension_descriptor* %117, i32 0, i32 1 %121 = load i64, i64* %120, align 8 %122 = sub i64 1, %119 %123 = add i64 %119, %121 %124 = sub i64 %123, 1 %125 = icmp slt i64 1, %119 %126 = icmp sgt i64 1, %124 %127 = or i1 %125, %126 br i1 %127, label %then22, label %ifcont23 then22: ; preds = %ifcont21 %128 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %129 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %130 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %129, i32 0, i32 0 %131 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %130, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @124, i32 0, i32 0), i8** %131, align 8 %132 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %130, i32 0, i32 1 store i32 40, i32* %132, align 4 %133 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %130, i32 0, i32 2 store i32 14, i32* %133, align 4 %134 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %130, i32 0, i32 3 store i32 40, i32* %134, align 4 %135 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %130, i32 0, i32 4 store i32 23, i32* %135, align 4 %136 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @125, i32 0, i32 0)) %137 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %128, i32 0, i32 0 %138 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %129, i32 0, i32 0 %139 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %137, i32 0, i32 2 %140 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %137, i32 0, i32 0 store i1 true, i1* %140, align 1 %141 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %137, i32 0, i32 1 store i8* %136, i8** %141, align 8 store { i8*, i32, i32, i32, i32 }* %138, { i8*, i32, i32, i32, i32 }** %139, align 8 %142 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %137, i32 0, i32 3 store i32 1, i32* %142, align 4 %143 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %128, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %143, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @126, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @123, i32 0, i32 0), i64 1, i32 3, i64 %119, i64 %124) call void @exit(i32 1) unreachable ifcont23: ; preds = %ifcont21 %144 = getelementptr %dimension_descriptor, %dimension_descriptor* %117, i32 0, i32 2 %145 = load i64, i64* %144, align 8 %146 = mul i64 %145, %122 %147 = add i64 %116, %146 %148 = getelementptr %array.3, %array.3* %29, i32 0, i32 7 %149 = load i64, i64* %148, align 8 %150 = add i64 %147, %149 %151 = getelementptr %array.3, %array.3* %29, i32 0, i32 0 %152 = load i32*, i32** %151, align 8 %153 = getelementptr inbounds i32, i32* %152, i64 %150 %154 = load i32, i32* %153, align 4 %155 = alloca i32, align 4 store i32 %154, i32* %155, align 4 %156 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %28, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %155) %157 = load i64, i64* %28, align 8 %158 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %156, i8** %158, align 8 %159 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %157, i64* %159, align 8 %160 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %161 = load i8*, i8** %160, align 8 %162 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %163 = load i64, i64* %162, align 8 %164 = trunc i64 %163 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @127, i32 0, i32 0), i8* %161, i32 %164, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @110, i32 0, i32 0), i32 1) %165 = icmp eq i8* %156, null br i1 %165, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont23 call void @_lfortran_free_alloc(i8* %0, i8* %156) br label %free_done free_done: ; preds = %free_nonnull, %ifcont23 %166 = load %array.3*, %array.3** %c, align 8 %167 = ptrtoint %array.3* %166 to i64 %168 = icmp eq i64 %167, 0 br i1 %168, label %merge_allocated25, label %check_data24 check_data24: ; preds = %free_done %169 = getelementptr %array.3, %array.3* %166, i32 0, i32 0 %170 = load i32*, i32** %169, align 8 %171 = ptrtoint i32* %170 to i64 %172 = icmp ne i64 %171, 0 br label %merge_allocated25 merge_allocated25: ; preds = %check_data24, %free_done %is_allocated26 = phi i1 [ false, %free_done ], [ %172, %check_data24 ] %173 = xor i1 %is_allocated26, true br i1 %173, label %then27, label %ifcont28 then27: ; preds = %merge_allocated25 %174 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %175 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %176 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %175, i32 0, i32 0 %177 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %176, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @129, i32 0, i32 0), i8** %177, align 8 %178 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %176, i32 0, i32 1 store i32 41, i32* %178, align 4 %179 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %176, i32 0, i32 2 store i32 9, i32* %179, align 4 %180 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %176, i32 0, i32 3 store i32 41, i32* %180, align 4 %181 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %176, i32 0, i32 4 store i32 18, i32* %181, align 4 %182 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @130, i32 0, i32 0)) %183 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %174, i32 0, i32 0 %184 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %175, i32 0, i32 0 %185 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %183, i32 0, i32 2 %186 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %183, i32 0, i32 0 store i1 true, i1* %186, align 1 %187 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %183, i32 0, i32 1 store i8* %182, i8** %187, align 8 store { i8*, i32, i32, i32, i32 }* %184, { i8*, i32, i32, i32, i32 }** %185, align 8 %188 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %183, i32 0, i32 3 store i32 1, i32* %188, align 4 %189 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %174, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %189, i32 1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @131, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @128, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont28: ; preds = %merge_allocated25 %190 = getelementptr %array.3, %array.3* %166, i32 0, i32 8 %191 = getelementptr [3 x %dimension_descriptor], [3 x %dimension_descriptor]* %190, i32 0, i32 0 %192 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %191, i32 0 %193 = getelementptr %dimension_descriptor, %dimension_descriptor* %192, i32 0, i32 0 %194 = load i64, i64* %193, align 8 %195 = getelementptr %dimension_descriptor, %dimension_descriptor* %192, i32 0, i32 1 %196 = load i64, i64* %195, align 8 %197 = sub i64 1, %194 %198 = add i64 %194, %196 %199 = sub i64 %198, 1 %200 = icmp slt i64 1, %194 %201 = icmp sgt i64 1, %199 %202 = or i1 %200, %201 br i1 %202, label %then29, label %ifcont30 then29: ; preds = %ifcont28 %203 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %204 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %205 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %204, i32 0, i32 0 %206 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %205, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @133, i32 0, i32 0), i8** %206, align 8 %207 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %205, i32 0, i32 1 store i32 41, i32* %207, align 4 %208 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %205, i32 0, i32 2 store i32 9, i32* %208, align 4 %209 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %205, i32 0, i32 3 store i32 41, i32* %209, align 4 %210 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %205, i32 0, i32 4 store i32 18, i32* %210, align 4 %211 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @134, i32 0, i32 0)) %212 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %203, i32 0, i32 0 %213 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %204, i32 0, i32 0 %214 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %212, i32 0, i32 2 %215 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %212, i32 0, i32 0 store i1 true, i1* %215, align 1 %216 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %212, i32 0, i32 1 store i8* %211, i8** %216, align 8 store { i8*, i32, i32, i32, i32 }* %213, { i8*, i32, i32, i32, i32 }** %214, align 8 %217 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %212, i32 0, i32 3 store i32 1, i32* %217, align 4 %218 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %203, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %218, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @135, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @132, i32 0, i32 0), i64 1, i32 1, i64 %194, i64 %199) call void @exit(i32 1) unreachable ifcont30: ; preds = %ifcont28 %219 = getelementptr %dimension_descriptor, %dimension_descriptor* %192, i32 0, i32 2 %220 = load i64, i64* %219, align 8 %221 = mul i64 %220, %197 %222 = add i64 0, %221 %223 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %191, i32 1 %224 = getelementptr %dimension_descriptor, %dimension_descriptor* %223, i32 0, i32 0 %225 = load i64, i64* %224, align 8 %226 = getelementptr %dimension_descriptor, %dimension_descriptor* %223, i32 0, i32 1 %227 = load i64, i64* %226, align 8 %228 = sub i64 1, %225 %229 = add i64 %225, %227 %230 = sub i64 %229, 1 %231 = icmp slt i64 1, %225 %232 = icmp sgt i64 1, %230 %233 = or i1 %231, %232 br i1 %233, label %then31, label %ifcont32 then31: ; preds = %ifcont30 %234 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %235 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %236 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %235, i32 0, i32 0 %237 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %236, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @137, i32 0, i32 0), i8** %237, align 8 %238 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %236, i32 0, i32 1 store i32 41, i32* %238, align 4 %239 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %236, i32 0, i32 2 store i32 9, i32* %239, align 4 %240 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %236, i32 0, i32 3 store i32 41, i32* %240, align 4 %241 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %236, i32 0, i32 4 store i32 18, i32* %241, align 4 %242 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @138, i32 0, i32 0)) %243 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %234, i32 0, i32 0 %244 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %235, i32 0, i32 0 %245 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %243, i32 0, i32 2 %246 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %243, i32 0, i32 0 store i1 true, i1* %246, align 1 %247 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %243, i32 0, i32 1 store i8* %242, i8** %247, align 8 store { i8*, i32, i32, i32, i32 }* %244, { i8*, i32, i32, i32, i32 }** %245, align 8 %248 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %243, i32 0, i32 3 store i32 1, i32* %248, align 4 %249 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %234, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %249, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @139, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @136, i32 0, i32 0), i64 1, i32 2, i64 %225, i64 %230) call void @exit(i32 1) unreachable ifcont32: ; preds = %ifcont30 %250 = getelementptr %dimension_descriptor, %dimension_descriptor* %223, i32 0, i32 2 %251 = load i64, i64* %250, align 8 %252 = mul i64 %251, %228 %253 = add i64 %222, %252 %254 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %191, i32 2 %255 = getelementptr %dimension_descriptor, %dimension_descriptor* %254, i32 0, i32 0 %256 = load i64, i64* %255, align 8 %257 = getelementptr %dimension_descriptor, %dimension_descriptor* %254, i32 0, i32 1 %258 = load i64, i64* %257, align 8 %259 = sub i64 1, %256 %260 = add i64 %256, %258 %261 = sub i64 %260, 1 %262 = icmp slt i64 1, %256 %263 = icmp sgt i64 1, %261 %264 = or i1 %262, %263 br i1 %264, label %then33, label %ifcont34 then33: ; preds = %ifcont32 %265 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %266 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %267 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %266, i32 0, i32 0 %268 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %267, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @141, i32 0, i32 0), i8** %268, align 8 %269 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %267, i32 0, i32 1 store i32 41, i32* %269, align 4 %270 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %267, i32 0, i32 2 store i32 9, i32* %270, align 4 %271 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %267, i32 0, i32 3 store i32 41, i32* %271, align 4 %272 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %267, i32 0, i32 4 store i32 18, i32* %272, align 4 %273 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @142, i32 0, i32 0)) %274 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %265, i32 0, i32 0 %275 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %266, i32 0, i32 0 %276 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %274, i32 0, i32 2 %277 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %274, i32 0, i32 0 store i1 true, i1* %277, align 1 %278 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %274, i32 0, i32 1 store i8* %273, i8** %278, align 8 store { i8*, i32, i32, i32, i32 }* %275, { i8*, i32, i32, i32, i32 }** %276, align 8 %279 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %274, i32 0, i32 3 store i32 1, i32* %279, align 4 %280 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %265, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %280, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @143, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @140, i32 0, i32 0), i64 1, i32 3, i64 %256, i64 %261) call void @exit(i32 1) unreachable ifcont34: ; preds = %ifcont32 %281 = getelementptr %dimension_descriptor, %dimension_descriptor* %254, i32 0, i32 2 %282 = load i64, i64* %281, align 8 %283 = mul i64 %282, %259 %284 = add i64 %253, %283 %285 = getelementptr %array.3, %array.3* %166, i32 0, i32 7 %286 = load i64, i64* %285, align 8 %287 = add i64 %284, %286 %288 = getelementptr %array.3, %array.3* %166, i32 0, i32 0 %289 = load i32*, i32** %288, align 8 %290 = getelementptr inbounds i32, i32* %289, i64 %287 %291 = load i32, i32* %290, align 4 %292 = icmp ne i32 %291, 99 br i1 %292, label %then35, label %else36 then35: ; preds = %ifcont34 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @145, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @144, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont37 else36: ; preds = %ifcont34 br label %ifcont37 ifcont37: ; preds = %else36, %then35 %293 = load %array.3*, %array.3** %c, align 8 %294 = ptrtoint %array.3* %293 to i64 %295 = icmp eq i64 %294, 0 br i1 %295, label %merge_allocated39, label %check_data38 check_data38: ; preds = %ifcont37 %296 = getelementptr %array.3, %array.3* %293, i32 0, i32 0 %297 = load i32*, i32** %296, align 8 %298 = ptrtoint i32* %297 to i64 %299 = icmp ne i64 %298, 0 br label %merge_allocated39 merge_allocated39: ; preds = %check_data38, %ifcont37 %is_allocated40 = phi i1 [ false, %ifcont37 ], [ %299, %check_data38 ] %300 = xor i1 %is_allocated40, true br i1 %300, label %then41, label %ifcont42 then41: ; preds = %merge_allocated39 %301 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %302 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %303 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %302, i32 0, i32 0 %304 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %303, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @147, i32 0, i32 0), i8** %304, align 8 %305 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %303, i32 0, i32 1 store i32 42, i32* %305, align 4 %306 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %303, i32 0, i32 2 store i32 5, i32* %306, align 4 %307 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %303, i32 0, i32 3 store i32 42, i32* %307, align 4 %308 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %303, i32 0, i32 4 store i32 14, i32* %308, align 4 %309 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @148, i32 0, i32 0)) %310 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %301, i32 0, i32 0 %311 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %302, i32 0, i32 0 %312 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %310, i32 0, i32 2 %313 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %310, i32 0, i32 0 store i1 true, i1* %313, align 1 %314 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %310, i32 0, i32 1 store i8* %309, i8** %314, align 8 store { i8*, i32, i32, i32, i32 }* %311, { i8*, i32, i32, i32, i32 }** %312, align 8 %315 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %310, i32 0, i32 3 store i32 1, i32* %315, align 4 %316 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %301, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %316, i32 1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @149, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @146, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont42: ; preds = %merge_allocated39 %317 = getelementptr %array.3, %array.3* %293, i32 0, i32 8 %318 = getelementptr [3 x %dimension_descriptor], [3 x %dimension_descriptor]* %317, i32 0, i32 0 %319 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %318, i32 0 %320 = getelementptr %dimension_descriptor, %dimension_descriptor* %319, i32 0, i32 0 %321 = load i64, i64* %320, align 8 %322 = getelementptr %dimension_descriptor, %dimension_descriptor* %319, i32 0, i32 1 %323 = load i64, i64* %322, align 8 %324 = sub i64 1, %321 %325 = add i64 %321, %323 %326 = sub i64 %325, 1 %327 = icmp slt i64 1, %321 %328 = icmp sgt i64 1, %326 %329 = or i1 %327, %328 br i1 %329, label %then43, label %ifcont44 then43: ; preds = %ifcont42 %330 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %331 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %332 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %331, i32 0, i32 0 %333 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %332, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @151, i32 0, i32 0), i8** %333, align 8 %334 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %332, i32 0, i32 1 store i32 42, i32* %334, align 4 %335 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %332, i32 0, i32 2 store i32 5, i32* %335, align 4 %336 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %332, i32 0, i32 3 store i32 42, i32* %336, align 4 %337 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %332, i32 0, i32 4 store i32 14, i32* %337, align 4 %338 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @152, i32 0, i32 0)) %339 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %330, i32 0, i32 0 %340 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %331, i32 0, i32 0 %341 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %339, i32 0, i32 2 %342 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %339, i32 0, i32 0 store i1 true, i1* %342, align 1 %343 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %339, i32 0, i32 1 store i8* %338, i8** %343, align 8 store { i8*, i32, i32, i32, i32 }* %340, { i8*, i32, i32, i32, i32 }** %341, align 8 %344 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %339, i32 0, i32 3 store i32 1, i32* %344, align 4 %345 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %330, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %345, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @153, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @150, i32 0, i32 0), i64 1, i32 1, i64 %321, i64 %326) call void @exit(i32 1) unreachable ifcont44: ; preds = %ifcont42 %346 = getelementptr %dimension_descriptor, %dimension_descriptor* %319, i32 0, i32 2 %347 = load i64, i64* %346, align 8 %348 = mul i64 %347, %324 %349 = add i64 0, %348 %350 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %318, i32 1 %351 = getelementptr %dimension_descriptor, %dimension_descriptor* %350, i32 0, i32 0 %352 = load i64, i64* %351, align 8 %353 = getelementptr %dimension_descriptor, %dimension_descriptor* %350, i32 0, i32 1 %354 = load i64, i64* %353, align 8 %355 = sub i64 1, %352 %356 = add i64 %352, %354 %357 = sub i64 %356, 1 %358 = icmp slt i64 1, %352 %359 = icmp sgt i64 1, %357 %360 = or i1 %358, %359 br i1 %360, label %then45, label %ifcont46 then45: ; preds = %ifcont44 %361 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %362 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %363 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %362, i32 0, i32 0 %364 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %363, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @155, i32 0, i32 0), i8** %364, align 8 %365 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %363, i32 0, i32 1 store i32 42, i32* %365, align 4 %366 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %363, i32 0, i32 2 store i32 5, i32* %366, align 4 %367 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %363, i32 0, i32 3 store i32 42, i32* %367, align 4 %368 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %363, i32 0, i32 4 store i32 14, i32* %368, align 4 %369 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @156, i32 0, i32 0)) %370 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %361, i32 0, i32 0 %371 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %362, i32 0, i32 0 %372 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %370, i32 0, i32 2 %373 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %370, i32 0, i32 0 store i1 true, i1* %373, align 1 %374 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %370, i32 0, i32 1 store i8* %369, i8** %374, align 8 store { i8*, i32, i32, i32, i32 }* %371, { i8*, i32, i32, i32, i32 }** %372, align 8 %375 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %370, i32 0, i32 3 store i32 1, i32* %375, align 4 %376 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %361, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %376, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @157, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @154, i32 0, i32 0), i64 1, i32 2, i64 %352, i64 %357) call void @exit(i32 1) unreachable ifcont46: ; preds = %ifcont44 %377 = getelementptr %dimension_descriptor, %dimension_descriptor* %350, i32 0, i32 2 %378 = load i64, i64* %377, align 8 %379 = mul i64 %378, %355 %380 = add i64 %349, %379 %381 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %318, i32 2 %382 = getelementptr %dimension_descriptor, %dimension_descriptor* %381, i32 0, i32 0 %383 = load i64, i64* %382, align 8 %384 = getelementptr %dimension_descriptor, %dimension_descriptor* %381, i32 0, i32 1 %385 = load i64, i64* %384, align 8 %386 = sub i64 1, %383 %387 = add i64 %383, %385 %388 = sub i64 %387, 1 %389 = icmp slt i64 1, %383 %390 = icmp sgt i64 1, %388 %391 = or i1 %389, %390 br i1 %391, label %then47, label %ifcont48 then47: ; preds = %ifcont46 %392 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %393 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %394 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %393, i32 0, i32 0 %395 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %394, i32 0, i32 0 store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @159, i32 0, i32 0), i8** %395, align 8 %396 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %394, i32 0, i32 1 store i32 42, i32* %396, align 4 %397 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %394, i32 0, i32 2 store i32 5, i32* %397, align 4 %398 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %394, i32 0, i32 3 store i32 42, i32* %398, align 4 %399 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %394, i32 0, i32 4 store i32 14, i32* %399, align 4 %400 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @160, i32 0, i32 0)) %401 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %392, i32 0, i32 0 %402 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %393, i32 0, i32 0 %403 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %401, i32 0, i32 2 %404 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %401, i32 0, i32 0 store i1 true, i1* %404, align 1 %405 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %401, i32 0, i32 1 store i8* %400, i8** %405, align 8 store { i8*, i32, i32, i32, i32 }* %402, { i8*, i32, i32, i32, i32 }** %403, align 8 %406 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %401, i32 0, i32 3 store i32 1, i32* %406, align 4 %407 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %392, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %407, i32 1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @161, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @158, i32 0, i32 0), i64 1, i32 3, i64 %383, i64 %388) call void @exit(i32 1) unreachable ifcont48: ; preds = %ifcont46 %408 = getelementptr %dimension_descriptor, %dimension_descriptor* %381, i32 0, i32 2 %409 = load i64, i64* %408, align 8 %410 = mul i64 %409, %386 %411 = add i64 %380, %410 %412 = getelementptr %array.3, %array.3* %293, i32 0, i32 7 %413 = load i64, i64* %412, align 8 %414 = add i64 %411, %413 %415 = getelementptr %array.3, %array.3* %293, i32 0, i32 0 %416 = load i32*, i32** %415, align 8 %417 = getelementptr inbounds i32, i32* %416, i64 %414 store i32 8, i32* %417, align 4 br label %return return: ; preds = %ifcont48 br label %FINALIZE_SYMTABLE_h FINALIZE_SYMTABLE_h: ; preds = %return ret void } declare void @_lfortran_free_alloc(i8*, i8*) declare i8* @_lfortran_get_default_allocator() declare i8* @_lcompilers_snprintf_alloc(i8*, i8*, ...) declare void @_lcompilers_runtime_error(i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) declare void @exit(i32) declare i8* @_lfortran_malloc_alloc(i8*, i64) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @_lpython_call_initial_functions(i32, i8**) define internal void @finalize_allocatable__Array_3_i32(%array.3* %0) { entry: %1 = icmp ne %array.3* %0, null br i1 %1, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %entry call void @finalize_descriptorArray_Array_3_i32(%array.3* %0) br label %is_allocated.ifcont is_allocated.else: ; preds = %entry br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %is_allocated.then ret void } define internal void @finalize_descriptorArray_Array_3_i32(%array.3* %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = getelementptr %array.3, %array.3* %0, i32 0, i32 0 %3 = load i32*, i32** %2, align 8 %4 = ptrtoint i32* %3 to i64 %5 = icmp ne i64 %4, 0 br i1 %5, label %then, label %else then: ; preds = %entry %6 = bitcast i32* %3 to i8* call void @_lfortran_free_alloc(i8* %1, i8* %6) br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then ret void } lfortran-0.63.0/tests/reference/cpp-string_01-e28a827.stdout0000664000175000017500000000127315174404631023553 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { static std::string my_name="Dominic"; std::cout << "My name is " << " " << my_name << std::endl; } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/asr-do_zero_increment-06c400d.json0000664000175000017500000000075715174404631025072 0ustar alastairalastair{ "basename": "asr-do_zero_increment-06c400d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/do_zero_increment.f90", "infile_hash": "184258b59d1072b68cc129fef224f764dab47fd1087e4c7530b6de19", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-do_zero_increment-06c400d.stderr", "stderr_hash": "efaea8ebdf0ebe9f7e0393a80fd6a81698b3c5bef9f5ae6f35c5590c", "returncode": 2 }lfortran-0.63.0/tests/reference/run-realloc_lhs_20-ef3baef.json0000664000175000017500000000073415174404631024502 0ustar alastairalastair{ "basename": "run-realloc_lhs_20-ef3baef", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/realloc_lhs_20.f90", "infile_hash": "de77388fdd7d7f1ea737734ca2a9e2b38f49015aefd54379e0c2dd5a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-realloc_lhs_20-ef3baef.stderr", "stderr_hash": "cd90e7a73795c4d91de7ad88218f33a80869be40bb49c6d545c246f9", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-bits_04-d0f89f1.stdout0000664000175000017500000021346415174404631023304 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bits_04: (Program (SymbolTable 2 { }) bits_04 [] [(If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerConstant 10 (Integer 4) Decimal) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerConstant 0 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerConstant 10 (Integer 8) Decimal) (IntegerConstant 4 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerConstant 10 (Integer 8) Decimal) (IntegerUnaryMinus (IntegerConstant 4 (Integer 8) Decimal) (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerConstant 4 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerUnaryMinus (IntegerConstant 4 (Integer 8) Decimal) (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerConstant 10 (Integer 8) Decimal) (IntegerConstant 0 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerConstant 0 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerConstant 10 (Integer 4) Decimal) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerConstant 0 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerConstant 10 (Integer 8) Decimal) (IntegerConstant 4 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerConstant 10 (Integer 8) Decimal) (IntegerUnaryMinus (IntegerConstant 4 (Integer 8) Decimal) (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerConstant 4 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerUnaryMinus (IntegerConstant 4 (Integer 8) Decimal) (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerConstant 10 (Integer 8) Decimal) (IntegerConstant 0 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerConstant 0 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerConstant 10 (Integer 4) Decimal) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerConstant 0 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerConstant 10 (Integer 8) Decimal) (IntegerConstant 4 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerConstant 10 (Integer 8) Decimal) (IntegerUnaryMinus (IntegerConstant 4 (Integer 8) Decimal) (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerConstant 4 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerUnaryMinus (IntegerConstant 4 (Integer 8) Decimal) (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerConstant 10 (Integer 8) Decimal) (IntegerConstant 0 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerConstant 0 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerConstant 10 (Integer 4) Decimal) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerConstant 0 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerConstant 10 (Integer 8) Decimal) (IntegerConstant 4 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerConstant 10 (Integer 8) Decimal) (IntegerUnaryMinus (IntegerConstant 4 (Integer 8) Decimal) (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerConstant 4 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerUnaryMinus (IntegerConstant 4 (Integer 8) Decimal) (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerConstant 10 (Integer 8) Decimal) (IntegerConstant 0 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerConstant 0 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/cpp-types_02-0b28cb7.json0000664000175000017500000000072515174404631023111 0ustar alastairalastair{ "basename": "cpp-types_02-0b28cb7", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/types_02.f90", "infile_hash": "6b9728dd8c74663d697504a17537aef00ed9210bf24fae6e7e0468bc", "outfile": null, "outfile_hash": null, "stdout": "cpp-types_02-0b28cb7.stdout", "stdout_hash": "8038845f96b485395508247d09b1e57a55077e9804005492b68ca8cf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-nested_02-8302041.json0000664000175000017500000000074515174404631023006 0ustar alastairalastair{ "basename": "asr-nested_02-8302041", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_02.f90", "infile_hash": "6ff700b8b837d9efad78b5ed4d8defc823333a19f8afa37c7da6899d", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_02-8302041.stdout", "stdout_hash": "a005ffb3e2ffa723299e793bc1e88bb05dd9a74b525341d9fe4ba74c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/rename_symbol-collect_occurence4-9f1ef3e.json0000664000175000017500000000100415174404631027337 0ustar alastairalastair{ "basename": "rename_symbol-collect_occurence4-9f1ef3e", "cmd": "lfortran --rename-symbol --no-color {infile} -o {outfile}", "infile": "tests/collect_occurence4.f90", "infile_hash": "9afb71d90a3901adaa0f6dc5dd1a11af7cd850f992eedebc11d0ad73", "outfile": null, "outfile_hash": null, "stdout": "rename_symbol-collect_occurence4-9f1ef3e.stdout", "stdout_hash": "e4e89a608ac6b98ca5b9e76bc4aafe802122c88190eb01a182b089be", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor11-dc5b2d5.json0000664000175000017500000000077315174404631026670 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor11-dc5b2d5", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor11.f90", "infile_hash": "dd7b363224d526463b7ce535007b839ea7d9264d1b28f7bf7bbf6e7b", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor11-dc5b2d5.stdout", "stdout_hash": "5ffb62fac3e94cd76864d0780e3a1ac21008c453de524da9f97860b6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/obj-expr2-6573591.json0000664000175000017500000000055715174404631022273 0ustar alastairalastair{ "basename": "obj-expr2-6573591", "cmd": "lfortran --no-color -c {infile} -o output.o", "infile": "tests/expr2.f90", "infile_hash": "d666975e3f2e2c0cc5c739b85bb21073accdf5692bcb64c9e0278d62", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-select_type1-36bfefb.json0000664000175000017500000000073115174404631024215 0ustar alastairalastair{ "basename": "ast-select_type1-36bfefb", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/select_type1.f90", "infile_hash": "0484f169388676238c1bdf4ae9e9041b66ca05da7dc95a32c57a6003", "outfile": null, "outfile_hash": null, "stdout": "ast-select_type1-36bfefb.stdout", "stdout_hash": "65b4ce109adc6c3ca4a840222c8d64fd5bc1a2cfe1d5b421f481bacd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-allocatable_component_unnamed_unallocated_01-9346375.stderr0000664000175000017500000000044615174404631032524 0ustar alastairalastairruntime error: Array is not allocated. Allocate it manually or use the '--realloc-lhs-arrays' option to allocate it automatically. --> tests/../integration_tests/allocatable_component_unnamed_unallocated_01.f90:10:5 | 10 | x(1)%arr = [1, 2, 3] | ^^^^^^^^ LHS not allocated here lfortran-0.63.0/tests/reference/ast-line_continuation_03-8570dc1.stdout0000664000175000017500000001214315174404631025766 0ustar alastairalastair(TranslationUnit [(Program line_continuation_03 (TriviaNode [(EndOfLine) (Comment "! The same as line_continuation_02, but we do use & to split a token" )] [] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Here are the rules for & based on the § 6.3.2.4 (\"Free form statement" ) (Comment "! continuation\") in Fortran 2018 standard." ) (EndOfLine) (Comment "! The & character in a comment has no effect" ) (EndOfLine) (Comment "! The & character can be used to continue a line like this:" ) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! If it is used between tokens, then one can, but does not have to put another &" ) (Comment "! on the next line:" ) (EndOfLine)] ) ) (Declaration (AttrType TypeInteger [] () () None ) [] [(k [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) )] [(Assignment 0 i 5 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [i] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! One can continue strings also by treating them as tokens:" ) (EndOfLine)] ) ) (Print 0 () [(String "some string is continued" ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Unless the & is at the end of the line, it can be used as a regular" ) (Comment "! character in a string:" ) (EndOfLine)] ) ) (Print 0 () [(String "some string can contain & as a regular character is continued" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [(String "Even here: && <- there will be two &" ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! One can put arbitrary comments and empty lines after & that will be skipped:" ) (EndOfLine)] ) ) (Print 0 () [i] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [i] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [i] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! In strings the comment cannot be after the first &, but it can be on" ) (Comment "! subsequent lines:" ) (EndOfLine)] ) ) (Print 0 () [(String "some string is continued" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [(String "*t" ()) (String "" ())] (TriviaNode [] [(EndOfLine) (Comment "!! call set_args ( \\' &" ) (Comment "!! & \\n" ) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/asr-intrinsics3-a8fd035.stderr0000664000175000017500000000026115174404631024247 0ustar alastairalastairsemantic error: `pos` argument of `ibclr` intrinsic must be non-negative --> tests/errors/intrinsics3.f90:2:14 | 2 | print *, ibclr(1, -2) | ^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-operator_overloading_02-6076a0f.json0000664000175000017500000000101715174404631026111 0ustar alastairalastair{ "basename": "asr-operator_overloading_02-6076a0f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/operator_overloading_02.f90", "infile_hash": "d3f6f9065ea2f75dd235a6384cdd3f82769eb16971fac839a39430b6", "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_02-6076a0f.stdout", "stdout_hash": "c2a2f25e9c98d7424ee0824fd509e2f7f70e366135481a28c27831ab", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-program_cmake_01-caf8f48.json0000664000175000017500000000077515174404631025044 0ustar alastairalastair{ "basename": "llvm-program_cmake_01-caf8f48", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/program_cmake_01.f90", "infile_hash": "0e854d9b2ed613d6193d78290dc20a45ec66f60ab17e1c0229c3febe", "outfile": null, "outfile_hash": null, "stdout": "llvm-program_cmake_01-caf8f48.stdout", "stdout_hash": "68da5f40052eada8ecf691dd18194540d300a0a1c2220dc74faccd0b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/fortran-enum_01-3bcfd6d.stdout0000664000175000017500000000077015174404631024316 0ustar alastairalastairprogram enum_01 implicit none enum, bind(c) enumerator :: blue = 3 enumerator :: red = 0 enumerator :: yellow = 4 end enum enum, bind(c) enumerator :: green = 10 enumerator :: purple = 11 end enum integer(4), parameter :: compiler_enum = Kind(red) if (red /= 0) then error stop end if if (blue /= 3) then error stop end if if (yellow /= 4) then error stop end if if (green /= 10) then error stop end if if (purple /= 11) then error stop end if end program enum_01 lfortran-0.63.0/tests/reference/asr-open_notimplemented_kwarg1-24818cb.json0000664000175000017500000000101415174404631026704 0ustar alastairalastair{ "basename": "asr-open_notimplemented_kwarg1-24818cb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/warnings/open_notimplemented_kwarg1.f90", "infile_hash": "7571e57fc2000c98f3c9509df26eb64375f1393ab142090b7a86e7a2", "outfile": null, "outfile_hash": null, "stdout": "asr-open_notimplemented_kwarg1-24818cb.stdout", "stdout_hash": "ac12eb5ad1f8846ddf7926d9d49ef169a2a8204d5a0afb6fd342cfaa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/tokens-expr8-00c1054.stdout0000664000175000017500000000120115174404631023417 0ustar alastairalastair(TOKEN "identifier" i) (TOKEN "=") (TOKEN "integer" 123) (NEWLINE) (TOKEN "identifier" j) (TOKEN "=") (TOKEN "integer" 123456789824390874092509458720948720947502984752098457242092870987) (NEWLINE) (TOKEN "identifier" k) (TOKEN "=") (TOKEN "integer" 2) (TOKEN "*") (TOKEN "integer" 18446744073709551616) (NEWLINE) (TOKEN "identifier" i) (TOKEN "=") (TOKEN "integer" 123_i8) (NEWLINE) (TOKEN "identifier" j) (TOKEN "=") (TOKEN "integer" 123456789824390874092509458720948720947502984752098457242092870987_i8) (NEWLINE) (TOKEN "identifier" k) (TOKEN "=") (TOKEN "integer" 2) (TOKEN "*") (TOKEN "integer" 18446744073709551616_i8) (NEWLINE) (EOF) lfortran-0.63.0/tests/reference/run-array_bounds_check_13-e4a94c8.json0000664000175000017500000000074315174404631025630 0ustar alastairalastair{ "basename": "run-array_bounds_check_13-e4a94c8", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_13.f90", "infile_hash": "23ed573cd7e5506c5ef4cb8c5ae9b56bb5d63342912e2ced76bb3674", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_13-e4a94c8.stderr", "stderr_hash": "cc22e1ad7ce1960c816f693013b79d5fc99e2254ab0813fdf543b76c", "returncode": 1 }lfortran-0.63.0/tests/reference/ast-selectrank1-5d08637.json0000664000175000017500000000072615174404631023537 0ustar alastairalastair{ "basename": "ast-selectrank1-5d08637", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/selectrank1.f90", "infile_hash": "7bd5ab94da79a773b306a0b17ac6754bf7d5bb9dc2df46631d00593c", "outfile": null, "outfile_hash": null, "stdout": "ast-selectrank1-5d08637.stdout", "stdout_hash": "0f653c82bd65995c75cb2be0a4de50116b04e3e7666d21709e1816e1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_07-c5a29e3.stdout0000664000175000017500000025717615174404631025216 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { tomlf_structure_vector: (Module (SymbolTable 9 { find: (Function (SymbolTable 13 { 1_toml_node_val: (ExternalSymbol 13 1_toml_node_val 10 val toml_node [] val Public ), 1_toml_value_match_key: (ExternalSymbol 13 1_toml_value_match_key 3 match_key toml_value [] match_key Public ), 1_toml_vector_lst: (ExternalSymbol 13 1_toml_vector_lst 11 lst toml_vector [] lst Public ), 1_toml_vector_n: (ExternalSymbol 13 1_toml_vector_n 11 n toml_vector [] n Public ), i: (Variable 13 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), key: (Variable 13 key [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ptr: (Variable 13 ptr [] Out () () Default (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) ) 9 toml_value Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 13 self [] InOut () () Default (StructType [(Integer 4) (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .false. .false. ) 9 toml_vector Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ) }) find (FunctionType [(StructType [(Integer 4) (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .false. .false. ) (String 1 () AssumedLength DescriptorString) (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 self) (Var 13 key) (Var 13 ptr)] [(Nullify [(Var 13 ptr)] ) (DoLoop () ((Var 13 i) (IntegerConstant 1 (Integer 4) Decimal) (StructInstanceMember (Var 13 self) 13 1_toml_vector_n (Integer 4) () ) ()) [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (ArrayItem (StructInstanceMember (Var 13 self) 13 1_toml_vector_lst (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [(() (Var 13 i) ())] (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) ColMajor () ) 13 1_toml_node_val (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) ) () )] 0 (Logical 4) () ) [(If () (FunctionCall 13 1_toml_value_match_key () [((StructInstanceMember (ArrayItem (StructInstanceMember (Var 13 self) 13 1_toml_vector_lst (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [(() (Var 13 i) ())] (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) ColMajor () ) 13 1_toml_node_val (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) ) () )) ((Var 13 key))] (Logical 4) () (StructInstanceMember (ArrayItem (StructInstanceMember (Var 13 self) 13 1_toml_vector_lst (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [(() (Var 13 i) ())] (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) ColMajor () ) 13 1_toml_node_val (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) ) () ) ) [(Associate (Var 13 ptr) (StructInstanceMember (ArrayItem (StructInstanceMember (Var 13 self) 13 1_toml_vector_lst (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [(() (Var 13 i) ())] (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) ColMajor () ) 13 1_toml_node_val (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) ) () ) ) (Exit () )] [] )] [] )] [] )] () Public .true. .true. () ), new_vector: (Function (SymbolTable 12 { 1_toml_vector_lst: (ExternalSymbol 12 1_toml_vector_lst 11 lst toml_vector [] lst Public ), 1_toml_vector_n: (ExternalSymbol 12 1_toml_vector_n 11 n toml_vector [] n Public ), n: (Variable 12 n [] In () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 12 self [] Out () () Default (StructType [(Integer 4) (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .true. .false. ) 9 toml_vector Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_vector (FunctionType [(StructType [(Integer 4) (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .true. .false. ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 self) (Var 12 n)] [(Assignment (StructInstanceMember (Var 12 self) 12 1_toml_vector_n (Integer 4) () ) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (If () (IntrinsicElementalFunction Present [(Var 12 n)] 0 (Logical 4) () ) [(Allocate [((StructInstanceMember (Var 12 self) 12 1_toml_vector_lst (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (IntrinsicElementalFunction Min [(IntegerConstant 1 (Integer 4) Decimal) (Var 12 n)] 0 (Integer 4) () ))] () () ())] () () () )] [] )] () Public .true. .true. () ), toml_node: (Struct (SymbolTable 10 { val: (Variable 10 val [] Local () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) ) 9 toml_value Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_node (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [] [val] [] Source Public .false. .false. [] () () [] ), toml_value: (ExternalSymbol 9 toml_value 2 toml_value tomlf_type_value [] toml_value Public ), toml_vector: (Struct (SymbolTable 11 { lst: (Variable 11 lst [] Local () () Default (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 9 toml_node Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 11 n [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_vector (StructType [(Integer 4) (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .true. .false. ) [] [n lst] [] Source Public .false. .false. [] () () [] ) }) tomlf_structure_vector () [tomlf_type_value] .false. .false. .false. ), tomlf_type_keyval: (Module (SymbolTable 6 { destroy: (Function (SymbolTable 8 { 1_toml_keyval_raw: (ExternalSymbol 8 1_toml_keyval_raw 7 raw toml_keyval [] raw Public ), 1_toml_value_key: (ExternalSymbol 8 1_toml_value_key 3 key toml_value [] key Public ), self: (Variable 8 self [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 6 toml_keyval Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) destroy (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 self)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 8 self) 8 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(ExplicitDeallocate [(StructInstanceMember (Var 8 self) 8 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] )] [] ) (If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 8 self) 8 1_toml_keyval_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(ExplicitDeallocate [(StructInstanceMember (Var 8 self) 8 1_toml_keyval_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] )] [] )] () Public .true. .true. () ), toml_keyval: (Struct (SymbolTable 7 { destroy: (StructMethodDeclaration 7 destroy () destroy 6 destroy Source .false. .false. ), raw: (Variable 7 raw [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_keyval (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [raw] [] Source Public .false. .false. [] () 6 toml_value [] ), toml_value: (ExternalSymbol 6 toml_value 2 toml_value tomlf_type_value [] toml_value Public ) }) tomlf_type_keyval () [tomlf_type_value] .false. .false. .false. ), tomlf_type_value: (Module (SymbolTable 2 { destroy: (Function (SymbolTable 4 { self: (Variable 4 self [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 2 toml_value Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) destroy (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. )] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 self)] [] () Public .false. .false. () ), match_key: (Function (SymbolTable 5 { 1_toml_value_key: (ExternalSymbol 5 1_toml_value_key 3 key toml_value [] key Public ), key: (Variable 5 key [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), match: (Variable 5 match [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 5 self [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 2 toml_value Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) match_key (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) (String 1 () AssumedLength DescriptorString)] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 5 self) (Var 5 key)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 5 self) 5 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(Assignment (Var 5 match) (StringCompare (Var 5 key) Eq (StructInstanceMember (Var 5 self) 5 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Logical 4) () ) () .false. .false. )] [(Assignment (Var 5 match) (LogicalConstant .false. (Logical 4) ) () .false. .false. )] )] (Var 5 match) Public .true. .true. () ), toml_value: (Struct (SymbolTable 3 { destroy: (StructMethodDeclaration 3 destroy () destroy 2 destroy Source .true. .false. ), key: (Variable 3 key [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), match_key: (StructMethodDeclaration 3 match_key () match_key 2 match_key Source .false. .false. ) }) toml_value (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [key] [] Source Public .false. .true. [] () () [] ) }) tomlf_type_value () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-modules_60-baa1105.stdout0000664000175000017500000002162315174404631023760 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bobyqa_exmp: (Program (SymbolTable 6 { is_finite: (ExternalSymbol 6 is_finite 2 is_finite inf_mod_1 [] is_finite Public ), is_finite_1: (ExternalSymbol 6 is_finite_1 4 is_finite_1 infnan_mod_1 [] is_finite_1 Public ), is_finite_1@is_finite: (ExternalSymbol 6 is_finite_1@is_finite 2 is_finite_1 inf_mod_1 [] is_finite_1 Public ) }) bobyqa_exmp [infnan_mod_1 inf_mod_1] [(SubroutineCall 6 is_finite_1 () [((IntegerConstant 1 (Integer 4) Decimal))] () .false. )] ), inf_mod_1: (Module (SymbolTable 2 { is_finite: (GenericProcedure 2 is_finite [2 is_finite_1] Public ), is_finite_1: (Function (SymbolTable 3 { }) is_finite_1 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .true. .true. () ) }) inf_mod_1 () [] .false. .false. .false. ), infnan_mod_1: (Module (SymbolTable 4 { is_finite: (ExternalSymbol 4 is_finite 2 is_finite inf_mod_1 [] is_finite Public ), is_finite_1: (Function (SymbolTable 5 { x: (Variable 5 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) is_finite_1 (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x)] [(Print (StringFormat () [(Var 5 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 5 x) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] () Public .false. .false. () ), is_finite_1@is_finite: (ExternalSymbol 4 is_finite_1@is_finite 2 is_finite_1 inf_mod_1 [] is_finite_1 Public ) }) infnan_mod_1 () [inf_mod_1] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/run-format_53-2d03c61.stdout0000664000175000017500000000021315174404631023541 0ustar alastairalastair"efghijkl " "efghijkl " "efghijkl " "abcdefghijkl" "defg" "efghijkl " "abcdefghijkl" "defg" "efghijkl" "defg" All tests passed lfortran-0.63.0/tests/reference/asr-dependency_test_01-280d5b3.stdout0000664000175000017500000014712515174404631025423 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fpm_dependency: (Module (SymbolTable 2 { add_dependency: (Function (SymbolTable 6 { 1_dependency_tree_t_find_dependency: (ExternalSymbol 6 1_dependency_tree_t_find_dependency 5 find_dependency dependency_tree_t [] find_dependency Public ), dependency: (Variable 6 dependency [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 dependency_config_t Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), id: (Variable 6 id [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 6 self [] InOut () () Default (StructType [(Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 2 dependency_tree_t Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_dependency (FunctionType [(StructType [(Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] () Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 6 self) (Var 6 dependency)] [(Assignment (Var 6 id) (FunctionCall 6 1_dependency_tree_t_find_dependency () [((Var 6 self)) ((Var 6 dependency))] (Integer 4) () (Var 6 self) ) () .false. .false. )] () Private .true. .true. () ), dependency_config_t: (Struct (SymbolTable 3 { name: (Variable 3 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), path: (Variable 3 path [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) dependency_config_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [name path] [] Source Private .false. .false. [] () () [] ), dependency_node_t: (Struct (SymbolTable 4 { done: (Variable 4 done [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), proj_dir: (Variable 4 proj_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), revision: (Variable 4 revision [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), update: (Variable 4 update [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) dependency_node_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [] [proj_dir revision done update] [] Source Private .false. .false. [] () () [] ), dependency_tree_t: (Struct (SymbolTable 5 { add: (GenericProcedure 5 add [5 add_dependency] Public ), add_dependency: (StructMethodDeclaration 5 add_dependency () add_dependency 2 add_dependency Source .false. .false. ), cache: (Variable 5 cache [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dep: (Variable 5 dep [] Local () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 dependency_node_t Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dep_dir: (Variable 5 dep_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), find: (GenericProcedure 5 find [5 find_dependency] Public ), find_dependency: (StructMethodDeclaration 5 find_dependency () find_dependency 2 find_dependency Source .false. .false. ), ndep: (Variable 5 ndep [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), unit: (Variable 5 unit [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), verbosity: (Variable 5 verbosity [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) dependency_tree_t (StructType [(Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [unit verbosity dep_dir ndep dep cache] [] Source Private .false. .false. [] () () [] ), find_dependency: (Function (SymbolTable 7 { dependency: (Variable 7 dependency [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 2 dependency_config_t Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pos: (Variable 7 pos [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 7 self [] In () () Default (StructType [(Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 2 dependency_tree_t Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) find_dependency (FunctionType [(StructType [(Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. )] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 7 self) (Var 7 dependency)] [] (Var 7 pos) Private .true. .true. () ) }) fpm_dependency () [fpm_dependency] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-init1-a99a704.json0000664000175000017500000000071315174404631022421 0ustar alastairalastair{ "basename": "ast-init1-a99a704", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/init1.f90", "infile_hash": "9ec670cb5b8c7f2baae3997ae0911acdd19199100666c44da310ff4f", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-init1-a99a704.stderr", "stderr_hash": "201d19c7bf14660170792288e575568c171f968dfe1987869b73324b", "returncode": 2 }lfortran-0.63.0/tests/reference/c_target_cuda-openmp_71-261df19.stdout0000664000175000017500000001463215174404631025553 0ustar alastairalastair#include #include #include #include #include #include #ifdef USE_GPU #include #else #include"cuda_cpu_runtime.h" #endif struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct r32 { float *data; struct dimension_descriptor dims[32]; int32_t n_dims; int32_t offset; bool is_allocated; }; // Implementations #ifdef USE_GPU __global__ #endif void compute_kernel_0(struct r32 *a, struct r32 *b, int i_n) { int i = blockIdx.x * blockDim.x + threadIdx.x + 1; if (i <= i_n) { a->data[((0 + (a->dims[0].stride * (i - a->dims[0].lower_bound))) + a->offset)] = (float)(i) + b->data[((0 + (b->dims[0].stride * (i - b->dims[0].lower_bound))) + b->offset)]*(float)(340); } } #ifndef USE_GPU void compute_kernel_0_wrapper(void **args) { struct r32 *a = *(struct r32**)args[0]; struct r32 *b = *(struct r32**)args[1]; int i_n = *(int*)args[2]; compute_kernel_0(a, b, i_n); } #endif #ifndef USE_GPU void compute_kernel_wrapper(void **args, void *func) { if (func == (void*)compute_kernel_0) { compute_kernel_0_wrapper(args); return; } fprintf(stderr, "Unknown kernel function\n"); exit(1); } #endif int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); int32_t __libasr_index_0_; struct r32 a_value; struct r32* a = &a_value; float *a_data; a->data = a_data; a->n_dims = 1; a->offset = 0; a->dims[0].lower_bound = 1; a->dims[0].length = 0; a->dims[0].stride = 1; struct r32 b_value; struct r32* b = &b_value; float *b_data; b->data = b_data; b->n_dims = 1; b->offset = 0; b->dims[0].lower_bound = 1; b->dims[0].length = 0; b->dims[0].stride = 1; int32_t i; a->n_dims = 1; a->dims[0].lower_bound = 1; a->dims[0].length = 10000000; a->dims[0].stride = 1; a->data = (float*) _lfortran_malloc_alloc(_lfortran_get_default_allocator(), 1*a->dims[0].length*sizeof(float)); a->is_allocated = true; b->n_dims = 1; b->dims[0].lower_bound = 1; b->dims[0].length = 10000000; b->dims[0].stride = 1; b->data = (float*) _lfortran_malloc_alloc(_lfortran_get_default_allocator(), 1*b->dims[0].length*sizeof(float)); b->is_allocated = true; for (__libasr_index_0_=((int32_t)b->dims[1-1].lower_bound); __libasr_index_0_<=((int32_t) b->dims[1-1].length + b->dims[1-1].lower_bound - 1); __libasr_index_0_++) { b->data[((0 + (b->dims[0].stride * (__libasr_index_0_ - b->dims[0].lower_bound))) + b->offset)] = (float)(5); } float *d_a_data = NULL; float *d_b_data = NULL; cudaError_t err; size_t a_data_size = a->dims[0].length * sizeof(float); err = cudaMalloc((void**)&d_a_data, a_data_size); if (err != cudaSuccess) { fprintf(stderr, "cudaMalloc failed for a_data: %s\n", cudaGetErrorString(err)); exit(1); } size_t b_data_size = b->dims[0].length * sizeof(float); err = cudaMalloc((void**)&d_b_data, b_data_size); if (err != cudaSuccess) { fprintf(stderr, "cudaMalloc failed for b_data: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(d_a_data, a->data, a_data_size, cudaMemcpyHostToDevice); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy H2D failed for a_data: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(d_b_data, b->data, b_data_size, cudaMemcpyHostToDevice); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy H2D failed for b_data: %s\n", cudaGetErrorString(err)); exit(1); } struct r32 h_a_copy = *a; h_a_copy.data = d_a_data; struct r32 h_b_copy = *b; h_b_copy.data = d_b_data; struct r32 *d_a_struct = NULL; err = cudaMalloc((void**)&d_a_struct, sizeof(struct r32)); if (err != cudaSuccess) { fprintf(stderr, "cudaMalloc failed for d_a_struct: %s\n", cudaGetErrorString(err)); exit(1); } struct r32 *d_b_struct = NULL; err = cudaMalloc((void**)&d_b_struct, sizeof(struct r32)); if (err != cudaSuccess) { fprintf(stderr, "cudaMalloc failed for d_b_struct: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(d_a_struct, &h_a_copy, sizeof(struct r32), cudaMemcpyHostToDevice); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy H2D failed for d_a_struct: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(d_b_struct, &h_b_copy, sizeof(struct r32), cudaMemcpyHostToDevice); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy H2D failed for d_b_struct: %s\n", cudaGetErrorString(err)); exit(1); } int i_n = 10000000; int threads_per_block = 256; int blocks = (i_n + threads_per_block - 1) / threads_per_block; dim3 grid_dim = {blocks, 1, 1}; dim3 block_dim = {threads_per_block, 1, 1}; void *kernel_args[] = {&d_a_struct, &d_b_struct, &i_n}; err = cudaLaunchKernel((void*)compute_kernel_0, grid_dim, block_dim, kernel_args, 0, NULL); if (err != cudaSuccess) { fprintf(stderr, "cudaLaunchKernel failed: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaDeviceSynchronize(); if (err != cudaSuccess) { fprintf(stderr, "cudaDeviceSynchronize failed: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(a->data, d_a_data, a_data_size, cudaMemcpyDeviceToHost); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy D2H failed for a_data: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(b->data, d_b_data, b_data_size, cudaMemcpyDeviceToHost); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy D2H failed for b_data: %s\n", cudaGetErrorString(err)); exit(1); } cudaFree(d_a_data); cudaFree(d_a_struct); cudaFree(d_b_data); cudaFree(d_b_struct); printf("%f%s%f\n", a->data[((0 + (a->dims[0].stride * (5 - a->dims[0].lower_bound))) + a->offset)], " ", b->data[((0 + (b->dims[0].stride * (5 - b->dims[0].lower_bound))) + b->offset)]); if (a->data[((0 + (a->dims[0].stride * (5 - a->dims[0].lower_bound))) + a->offset)] != (float)(1705)) { fprintf(stderr, "ERROR STOP"); exit(1); } if (b->data[((0 + (b->dims[0].stride * (5 - b->dims[0].lower_bound))) + b->offset)] != (float)(5)) { fprintf(stderr, "ERROR STOP"); exit(1); } return 0; } lfortran-0.63.0/tests/reference/fortran-real_to_complex_cast_in_comparison-655651c.json0000664000175000017500000000104715174404631031310 0ustar alastairalastair{ "basename": "fortran-real_to_complex_cast_in_comparison-655651c", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/real_to_complex_cast_in_comparison.f90", "infile_hash": "b24f703e12ad69de41d2e7963f95416d6e78e2a032b22b228316972c", "outfile": null, "outfile_hash": null, "stdout": "fortran-real_to_complex_cast_in_comparison-655651c.stdout", "stdout_hash": "ecee5224ae351907abe8b6e69e6f32a3042d6a5e2f61a01fa559af87", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-builtin1-1b5ca89.json0000664000175000017500000000071515174404631023204 0ustar alastairalastair{ "basename": "ast-builtin1-1b5ca89", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/builtin1.f90", "infile_hash": "8c200e5b6fa38354dabbf5be7d12f548fa4e99f58ac9225f50a77c8c", "outfile": null, "outfile_hash": null, "stdout": "ast-builtin1-1b5ca89.stdout", "stdout_hash": "69ba0334bff0c89334b301f51dabd047f3bcd3269c7b395add55f37c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-matrix_02_matmul-d389302.stdout0000664000175000017500000005356515174404631025063 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { matrix_02_matmul: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), centry: (Variable 2 centry [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), cmat: (Variable 2 cmat [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 2 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) matrix_02_matmul [] [(Assignment (Var 2 a) (ArrayReshape (ArrayConstant 48 [1, 2, 3, ...., 10, 11, 12] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayPhysicalCast (ArrayConstant 8 [3, 4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) () () (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 48 [1, 2, 3, ...., 10, 11, 12] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 2 b) (ArrayReshape (ArrayConstant 48 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00, ...., 1.00000000e+01, 1.10000000e+01, 1.20000000e+01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayPhysicalCast (ArrayConstant 8 [4, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) () () (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 48 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00, ...., 1.00000000e+01, 1.10000000e+01, 1.20000000e+01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 2 cmat) (IntrinsicArrayFunction MatMul [(ArrayPhysicalCast (Var 2 a) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () ) (ArrayPhysicalCast (Var 2 b) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () )] 3 (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (Var 2 centry) (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) () ) () .false. .false. ) (DoLoop () ((Var 2 k) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) ()) [(Assignment (Var 2 centry) (RealBinOp (Var 2 centry) Add (RealBinOp (Cast (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 k) ())] (Integer 4) ColMajor () ) IntegerToReal (Real 4) () () ) Mul (ArrayItem (Var 2 b) [(() (Var 2 k) ()) (() (Var 2 j) ())] (Real 4) ColMajor () ) (Real 4) () ) (Real 4) () ) () .false. .false. )] [] ) (If () (RealCompare (ArrayItem (Var 2 cmat) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4) ColMajor () ) NotEq (Var 2 centry) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/run-mre_segfault-52f14b4.stderr0000664000175000017500000000046215174404631024413 0ustar alastairalastairsemantic error: Dimension mismatch in `allocate` statement. --> tests/errors/mre_segfault.f90:6:14 | 6 | allocate(arr4(3), source=reshape([1, 2, 3, 4, 5, 6], [2, 3])) | ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mismatch in dimensions between allocated variable and `source` lfortran-0.63.0/tests/reference/rename_symbol-collect_occurence3-3737d89.stdout0000664000175000017500000000037415174404631027506 0ustar alastairalastair[{"kind":0,"location":{"range":{"start":{"character":9,"line":6},"end":{"character":13,"line":6}},"uri":"uri"},"name":"main"},{"kind":0,"location":{"range":{"start":{"character":13,"line":8},"end":{"character":17,"line":8}},"uri":"uri"},"name":"main"}]lfortran-0.63.0/tests/reference/asr-interface_01-3aedbb0.json0000664000175000017500000000074015174404631024035 0ustar alastairalastair{ "basename": "asr-interface_01-3aedbb0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/interface_01.f90", "infile_hash": "b3cc26ccc2bc7a873737daead40905324f4677aa4bb62d5d61c3f1f7", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-interface_01-3aedbb0.stderr", "stderr_hash": "b82b55a33db6f80c8687298540f92911fb30386f8e21b81c75ae1a15", "returncode": 2 }lfortran-0.63.0/tests/reference/pass_nested_vars-nested_call_filter_01-5a87413.stdout0000664000175000017500000003624315174404631030571 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { __lcompilers_created__nested_context__outer_: (Module (SymbolTable 7 { a: (Variable 7 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __lcompilers_created__nested_context__outer_ () [] .false. .false. .false. ), nested_call_filter_01: (Program (SymbolTable 4 { modproc: (ExternalSymbol 4 modproc 2 modproc nested_call_filter_mod [] modproc Public ), outer: (Function (SymbolTable 5 { a: (Variable 5 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a1: (ExternalSymbol 5 a1 7 a __lcompilers_created__nested_context__outer_ [] a Public ), a2: (ExternalSymbol 5 a2 7 a __lcompilers_created__nested_context__outer_ [] a Public ), a_nested_ctx: (ExternalSymbol 5 a_nested_ctx 7 a __lcompilers_created__nested_context__outer_ [] a Public ), inner: (Function (SymbolTable 6 { a: (ExternalSymbol 6 a 7 a __lcompilers_created__nested_context__outer_ [] a Public ) }) inner (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 6 a) (IntegerBinOp (Var 6 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ) }) outer (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 5 a1) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 5 a_nested_ctx) (Var 5 a) () .false. .false. ) (SubroutineCall 5 inner () [] () .false. ) (Assignment (Var 5 a) (Var 5 a_nested_ctx) () .false. .false. ) (SubroutineCall 4 modproc () [((Var 5 a2))] () .false. )] () Public .true. .true. () ) }) nested_call_filter_01 [nested_call_filter_mod] [(SubroutineCall 4 outer () [] () .false. )] ), nested_call_filter_mod: (Module (SymbolTable 2 { modproc: (Function (SymbolTable 3 { y: (Variable 3 y [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) modproc (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 y)] [(Assignment (Var 3 y) (IntegerBinOp (Var 3 y) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ) }) nested_call_filter_mod () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-continue_body_if_loop-670a23a.json0000664000175000017500000000077715174404631025742 0ustar alastairalastair{ "basename": "asr-continue_body_if_loop-670a23a", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/continue_body_if_loop.f", "infile_hash": "0b34e65df675e3b4009fe5659fbc93ca52002eb7781599ebb9fe7613", "outfile": null, "outfile_hash": null, "stdout": "asr-continue_body_if_loop-670a23a.stdout", "stdout_hash": "de38d3678a72bfdc7f58250a3fcae4cec780864e28b7ad2dfd6b67b2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/lookup_name-lookup_name4-76fda17.stdout0000664000175000017500000000027215174404631026146 0ustar alastairalastair[{"kind":9,"location":{"range":{"start":{"character":11,"line":4},"end":{"character":24,"line":4}},"uri":"tests/lookup_name4.f90"},"name":"tparset_","filename":"tests/lookup_name4.f90"}]lfortran-0.63.0/tests/reference/asr-matrix_01_transpose-fb3276a.json0000664000175000017500000000100315174404631025342 0ustar alastairalastair{ "basename": "asr-matrix_01_transpose-fb3276a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/matrix_01_transpose.f90", "infile_hash": "c9aabbf171aad175f8ee167db7f8b9191537d7e2afe04ef4c669d615", "outfile": null, "outfile_hash": null, "stdout": "asr-matrix_01_transpose-fb3276a.stdout", "stdout_hash": "e13482a2f9fd98e21ae5b20efcc6635518e9da9a4b08a3de08491588", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-program_03-374e848.stdout0000664000175000017500000001071115174404631024031 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @__module___lcompilers_created__nested_context__closuretest__z = global i32 0 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() %call_arg_value = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %z = alloca i32, align 4 store i32 0, i32* %z, align 4 br label %loop.head loop.head: ; preds = %free_done, %.entry %3 = load i32, i32* %z, align 4 %4 = add i32 %3, 1 %5 = icmp sle i32 %4, 10 br i1 %5, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %6 = load i32, i32* %z, align 4 %7 = add i32 %6, 1 store i32 %7, i32* %z, align 4 %8 = load i32, i32* %z, align 4 store i32 %8, i32* @__module___lcompilers_created__nested_context__closuretest__z, align 4 %9 = alloca i64, align 8 store i32 1, i32* %call_arg_value, align 4 %10 = call i32 @apply(i32 (i32*)* @add_z, i32* %call_arg_value) %11 = alloca i32, align 4 store i32 %10, i32* %11, align 4 %12 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %9, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %11) %13 = load i64, i64* %9, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %12, i8** %14, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %13, i64* %15, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %17 = load i8*, i8** %16, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %19 = load i64, i64* %18, align 8 %20 = trunc i64 %19 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %17, i32 %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %21 = icmp eq i8* %12, null br i1 %21, label %free_done, label %free_nonnull free_nonnull: ; preds = %loop.body call void @_lfortran_free_alloc(i8* %2, i8* %12) br label %free_done free_done: ; preds = %free_nonnull, %loop.body %22 = load i32, i32* @__module___lcompilers_created__nested_context__closuretest__z, align 4 store i32 %22, i32* %z, align 4 br label %loop.head loop.end: ; preds = %loop.head br label %return return: ; preds = %loop.end br label %FINALIZE_SYMTABLE_closuretest FINALIZE_SYMTABLE_closuretest: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } define i32 @add_z(i32* %x) { .entry: %y = alloca i32, align 4 %0 = load i32, i32* %x, align 4 %1 = load i32, i32* @__module___lcompilers_created__nested_context__closuretest__z, align 4 %2 = add i32 %0, %1 store i32 %2, i32* %y, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_add_z FINALIZE_SYMTABLE_add_z: ; preds = %return %3 = load i32, i32* %y, align 4 ret i32 %3 } define i32 @apply(i32 (i32*)* %fun, i32* %x) { .entry: %y = alloca i32, align 4 %0 = call i32 %fun(i32* %x) store i32 %0, i32* %y, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_apply FINALIZE_SYMTABLE_apply: ; preds = %return %1 = load i32, i32* %y, align 4 ret i32 %1 } declare i32 @fun(i32*) declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/cpp-case_01-49038b7.json0000664000175000017500000000072215174404631022525 0ustar alastairalastair{ "basename": "cpp-case_01-49038b7", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/case_01.f90", "infile_hash": "003a23367180e7f228e7e4ef5a6dfdb6749801b29ccf2002e2559e41", "outfile": null, "outfile_hash": null, "stdout": "cpp-case_01-49038b7.stdout", "stdout_hash": "b22c3de85f810846a99eafc3497de1ba9ea408da0b550fd2fe63cf68", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-program_without_line_03-e127d69.json0000664000175000017500000000100115174404631026132 0ustar alastairalastair{ "basename": "ast-program_without_line_03-e127d69", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/program_without_line_03.f90", "infile_hash": "7f24b4f0125a80a40ddb1a2d400619fe7762e4b6f9ef34337b19964f", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-program_without_line_03-e127d69.stderr", "stderr_hash": "ae510b2f7bc81b4d0514bd7324e09fb2de2c85892cc529293c7f3154", "returncode": 2 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor20-4100cdf.json0000664000175000017500000000077315174404631026601 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor20-4100cdf", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor20.f90", "infile_hash": "92d5833a5aa287f9dcaba4d229be92cebb43f929bdf60abf94329359", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor20-4100cdf.stdout", "stdout_hash": "2a725a8c93f610ba9081cde29a9c307c33f520092ed551b935df8ccb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor12-94ccea0.json0000664000175000017500000000077315174404631026671 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor12-94ccea0", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor12.f90", "infile_hash": "b445441cd8d1932e9ebd830003869fd98c73c8153b90a1fa71029316", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor12-94ccea0.stdout", "stdout_hash": "454a677c21a35dad27795428d07d25ccaa596ee7b8794c2bc3d27846", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-expr3-3036522.stdout0000664000175000017500000000230015174404631023012 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define i32 @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i32, align 4 %__lfortran_evaluate_12 = alloca i32, align 4 %__lfortran_evaluate_13 = alloca i32, align 4 %__lfortran_evaluate_14 = alloca i32, align 4 %__lfortran_evaluate_15 = alloca i32, align 4 %__lfortran_evaluate_16 = alloca i32, align 4 %__lfortran_evaluate_17 = alloca i32, align 4 %__lfortran_evaluate_18 = alloca i32, align 4 store i32 5, i32* %__lfortran_evaluate_11, align 4 store i32 8, i32* %__lfortran_evaluate_12, align 4 store i32 16, i32* %__lfortran_evaluate_13, align 4 store i32 11, i32* %__lfortran_evaluate_14, align 4 store i32 2, i32* %__lfortran_evaluate_15, align 4 store i32 64, i32* %__lfortran_evaluate_16, align 4 store i32 8, i32* %__lfortran_evaluate_17, align 4 store i32 8, i32* %__lfortran_evaluate_18, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return %0 = load i32, i32* %__lfortran_evaluate_18, align 4 ret i32 %0 } lfortran-0.63.0/tests/reference/asr-template_error_07c-901677a.stderr0000664000175000017500000000031215174404631025335 0ustar alastairalastairsemantic error: Parameter 'scombine' was not declared --> tests/errors/template_error_07c.f90:15:20 | 15 | require :: semigroup(t, scombine) | ^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-implicit10-23a5156.stdout0000664000175000017500000007116615174404631023641 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { a: (Variable 2 a [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d1: (Variable 2 d1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), e: (Variable 2 e [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), e1: (Variable 2 e1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Variable 2 f [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f1: (Variable 2 f1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), g: (Variable 2 g [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), h: (Variable 2 h [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 2 k [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 2 l [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 2 m [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), o: (Variable 2 o [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p: (Variable 2 p [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [d1 e1 f1] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 d1)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e1)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 f1))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [e1] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e1))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (ArrayItem (Var 2 y) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 d) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 f) (Cast (IntegerConstant 4 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 4.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 h) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 5.000000 (Real 8) ) () ) () .false. .false. ) (Assignment (Var 2 i) (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 6.000000 (Real 8) ) () ) () .false. .false. ) (Assignment (Var 2 l) (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 7.000000 0.000000 (Complex 4) ) () ) () .false. .false. ) (Assignment (Var 2 m) (Cast (IntegerConstant 8 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 8.000000 0.000000 (Complex 4) ) () ) () .false. .false. ) (Assignment (Var 2 o) (Cast (IntegerConstant 9 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 9.000000 (Real 8) ) () ) () .false. .false. ) (Assignment (Var 2 p) (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 10.000000 (Real 8) ) () ) () .false. .false. )] (Var 2 a) Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/pass_global_stmts-global_scope8-95c3673.stdout0000664000175000017500000000557115174404631027354 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] (Integer 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 f1) (Var 1 x) () .false. .false. )] (Var 2 f1) Public .false. .false. () ), x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) [] ) lfortran-0.63.0/tests/reference/asr_preprocess-cpp3-1719443.json0000664000175000017500000000074415174404631024347 0ustar alastairalastair{ "basename": "asr_preprocess-cpp3-1719443", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp3.f90", "infile_hash": "8b42a312082ab5a08623b751910516f3fa8bcc464dce36d988e4bdfe", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp3-1719443.stderr", "stderr_hash": "c0b7018b71bb4510119ff690e45d7a2c7eff32436b3d6b25ef7dc105", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-complex_dp_param-5efce36.stdout0000664000175000017500000000646515174404631025617 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %complex_4 = type <{ float, float }> %complex_8 = type <{ double, double }> %string_descriptor = type <{ i8*, i64 }> @complex_dp_param.u = internal global %complex_4 zeroinitializer @complex_dp_param.v = internal global %complex_8 zeroinitializer @complex_dp_param.zero = internal global %complex_8 zeroinitializer @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [24 x i8] c"{R4,R4},{R8,R8},{R8,R8}\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %prec1 = alloca i32, align 4 store i32 4, i32* %prec1, align 4 %prec2 = alloca i32, align 4 store i32 8, i32* %prec2, align 4 store %complex_4 <{ float 0x3FF0CCCCC0000000, float 0x3FF0CCCCC0000000 }>, %complex_4* @complex_dp_param.u, align 1 store %complex_8 <{ double 0x3FF0CCCCC0000000, double 1.050000e+00 }>, %complex_8* @complex_dp_param.v, align 1 store %complex_8 zeroinitializer, %complex_8* @complex_dp_param.zero, align 1 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, %complex_4* @complex_dp_param.u, %complex_8* @complex_dp_param.v, %complex_8* @complex_dp_param.zero) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_complex_dp_param FINALIZE_SYMTABLE_complex_dp_param: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/julia-modules_12-09f81d9.json0000664000175000017500000000074115174404631023673 0ustar alastairalastair{ "basename": "julia-modules_12-09f81d9", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/modules_12.f90", "infile_hash": "aba2ca12e578c5e6c071c1baf18c66272a5c54a88a9c73d8f05e6196", "outfile": null, "outfile_hash": null, "stdout": "julia-modules_12-09f81d9.stdout", "stdout_hash": "33e927aeaa053a17848b2ec23f8f983d294e794d8f1fcbe8941cb829", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-data3-0afaffe.json0000664000175000017500000000070415174404631022661 0ustar alastairalastair{ "basename": "asr-data3-0afaffe", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/data3.f90", "infile_hash": "b4838a394f3b26e78e6092c67193187a539ff83b61c12d3468a6a030", "outfile": null, "outfile_hash": null, "stdout": "asr-data3-0afaffe.stdout", "stdout_hash": "3dbce3019e49c9a8b6346a814a3d6ff015e3802b2285993526ca58fc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_error_02-a3d3b4c.json0000664000175000017500000000075715174404631025055 0ustar alastairalastair{ "basename": "asr-template_error_02-a3d3b4c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_02.f90", "infile_hash": "336ede84eb90fd5b1a04f02a060fda99e866119e2ab06e47f6ed4ce1", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_02-a3d3b4c.stderr", "stderr_hash": "e78b35ca24bdaf12ae1591f787465311852265876ed2389cdc1166df", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-types_01-a91206c.json0000664000175000017500000000074215174404631023030 0ustar alastairalastair{ "basename": "asr-types_01-a91206c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_01.f90", "infile_hash": "1987d8bcc6219e1bf0134a0123e23d9e02a0a8efb6989074d1537f46", "outfile": null, "outfile_hash": null, "stdout": "asr-types_01-a91206c.stdout", "stdout_hash": "957c09350f3a306ee3cdf7647bf0bc0c35b4062c33640c5f18260d61", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-legacy_array_sections_01-2515c0f.json0000664000175000017500000000102515174404631026415 0ustar alastairalastair{ "basename": "llvm-legacy_array_sections_01-2515c0f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/legacy_array_sections_01.f90", "infile_hash": "90cec79afc88ad4e171e9ff3c6f8612e820b4906e444054346abdf34", "outfile": null, "outfile_hash": null, "stdout": "llvm-legacy_array_sections_01-2515c0f.stdout", "stdout_hash": "b35b436633eb95c1d17ef95c309515a138887ff348f5f4c7bfdd39ca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-parameter_02-9547a35.json0000664000175000017500000000075615174404631023610 0ustar alastairalastair{ "basename": "ast-parameter_02-9547a35", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/parameter_02.f90", "infile_hash": "09e4b92d73bf1ea50001dc2926c14f213a0c8eda2c2e399f78df895e", "outfile": null, "outfile_hash": null, "stdout": "ast-parameter_02-9547a35.stdout", "stdout_hash": "a3c063bfbcd58db7a82a814ce3c9e77a11891489dec04ea2ae535b75", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-doloop_05-9e48e13.json0000664000175000017500000000073615174404631023523 0ustar alastairalastair{ "basename": "julia-doloop_05-9e48e13", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/doloop_05.f90", "infile_hash": "d6c2b01c1169dbde9ecbd05ebec2c3267e3d77d027cff03dc7361d78", "outfile": null, "outfile_hash": null, "stdout": "julia-doloop_05-9e48e13.stdout", "stdout_hash": "58f0432f021762b21c03b887da30de908897a0723ddb09945dd508f7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-loop_test5-d27e6d6.stdout0000664000175000017500000000151515174404631024127 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [] [] [] [] [(DoLoop 0 () 1 i 1 n () [(DoLoop 0 () 1 j 1 n () [(Continue 1 () )] () () )] () () ) (DoLoop 0 () 2 i 1 n () [(Continue 2 () )] () () )] [] [] )] ) lfortran-0.63.0/tests/reference/ast-print1-b2e5cea.stdout0000664000175000017500000000231515174404631023373 0ustar alastairalastair(TranslationUnit [(Program print1 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeReal [] () () None ) [] [(pi [] [] () () None ())] () )] [(Assignment 0 pi (Real "3.141592") (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 (String "(f6.3)" ()) [pi] () ) (Print 0 () [pi] () ) (Print 0 10 [] () ) (Format 10 "3x, \"print\"" (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/asr-case_02-8557909.stdout0000664000175000017500000004247415174404631023046 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { case_02: (Program (SymbolTable 2 { marks: (Variable 2 marks [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), out: (Variable 2 out [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) case_02 [] [(Assignment (Var 2 marks) (IntegerConstant 81 (Integer 4) Decimal) () .false. .false. ) (Select () (Var 2 marks) [(CaseStmt_Range (IntegerConstant 91 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) [(Assignment (Var 2 out) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Print (StringConstant "Excellent!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 81 (Integer 4) Decimal) (IntegerConstant 90 (Integer 4) Decimal) [(Assignment (Var 2 out) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Print (StringConstant "Very good!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 71 (Integer 4) Decimal) (IntegerConstant 80 (Integer 4) Decimal) [(Assignment (Var 2 out) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Print (StringConstant "Well done!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 61 (Integer 4) Decimal) (IntegerConstant 70 (Integer 4) Decimal) [(Assignment (Var 2 out) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Print (StringConstant "Not bad!" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 41 (Integer 4) Decimal) (IntegerConstant 60 (Integer 4) Decimal) [(Assignment (Var 2 out) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Print (StringConstant "You passed!" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range () (IntegerConstant 40 (Integer 4) Decimal) [(Assignment (Var 2 out) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Print (StringConstant "Better try again!" (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(Assignment (Var 2 out) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Print (StringConstant "Invalid marks" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your marks are " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 marks)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 out) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Select () (Var 2 marks) [(CaseStmt_Range (IntegerConstant 91 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) [(Print (StringConstant "Excellent!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 81 (Integer 4) Decimal) (IntegerConstant 90 (Integer 4) Decimal) [(Print (StringConstant "Very good!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 71 (Integer 4) Decimal) (IntegerConstant 80 (Integer 4) Decimal) [(Print (StringConstant "Well done!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 61 (Integer 4) Decimal) (IntegerConstant 70 (Integer 4) Decimal) [(Print (StringConstant "Not bad!" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 41 (Integer 4) Decimal) (IntegerConstant 60 (Integer 4) Decimal) [(Print (StringConstant "You passed!" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range () (IntegerConstant 40 (Integer 4) Decimal) [(Print (StringConstant "Better try again!" (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(Print (StringConstant "Invalid marks" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your marks are " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 marks)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Select () (Var 2 marks) [(CaseStmt_Range (IntegerConstant 91 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) [(Print (StringConstant "Excellent!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 81 (Integer 4) Decimal) (IntegerConstant 90 (Integer 4) Decimal) [(Print (StringConstant "Very good!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 71 (Integer 4) Decimal) (IntegerConstant 80 (Integer 4) Decimal) [(Print (StringConstant "Well done!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 61 (Integer 4) Decimal) (IntegerConstant 70 (Integer 4) Decimal) [(Print (StringConstant "Not bad!" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 41 (Integer 4) Decimal) (IntegerConstant 60 (Integer 4) Decimal) [(Print (StringConstant "You passed!" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range () (IntegerConstant 40 (Integer 4) Decimal) [(Print (StringConstant "Better try again!" (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(Print (StringConstant "Invalid marks" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your marks are " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 marks)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/fortran-real_to_real_cast_fortran_codegen-b969b0f.stdout0000664000175000017500000000034315174404631031575 0ustar alastairalastairprogram implicitrealtorealdifferentkindexample implicit none real(4) :: realnumber1 real(8) :: realnumber2 realnumber1 = 3.14000010e+00 realnumber2 = real(realnumber1, kind=8) end program implicitrealtorealdifferentkindexample lfortran-0.63.0/tests/reference/julia-case_05-f054494.stdout0000664000175000017500000000060715174404631023425 0ustar alastairalastairfunction main() local grade::String = "B" if grade == "A" println("Excellent!") elseif grade == "B" elseif grade == "C" println("Well done") elseif grade == "D" println("You passed") elseif grade == "F" println("Better try again") else println("Invalid grade") end println("Your grade is ", " ", grade) end main() lfortran-0.63.0/tests/reference/asr-kind_invalid_int_of_logical-6bf4989.json0000664000175000017500000000101515174404631027067 0ustar alastairalastair{ "basename": "asr-kind_invalid_int_of_logical-6bf4989", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_invalid_int_of_logical.f90", "infile_hash": "444c16d3b37a92613ff4136513d5b51910e6f9f2e75fd0347f1aec68", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_invalid_int_of_logical-6bf4989.stderr", "stderr_hash": "0703b2ebce8bb17026ed4528f568db013a8eda1f67d5b461d8e6fb3a", "returncode": 2 }lfortran-0.63.0/tests/reference/pass_dead_code_removal-cond_02-69b6d7d.stdout0000664000175000017500000002663715174404631027151 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cond_02: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ap: (Variable 2 ap [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), bp: (Variable 2 bp [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), cp: (Variable 2 cp [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dp: (Variable 2 dp [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cond_02 [] [(Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (IntegerCompare (Var 2 a) Eq (Var 2 b) (Logical 4) () ) [(Print (StringConstant "a == b" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "ap == cp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-fixed_form3-1e78b3b.json0000664000175000017500000000074115174404631023660 0ustar alastairalastair{ "basename": "ast-fixed_form3-1e78b3b", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form3.f", "infile_hash": "fe46caff97c3a0f7399147dbe980a74d686d086dbc36b076f30d17df", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form3-1e78b3b.stdout", "stdout_hash": "65c3bbc021c20afde386d4f160263645f0c62e5476649fd2548cac44", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-program_variable-066cc64.stderr0000664000175000017500000000021615174404631025234 0ustar alastairalastairsemantic error: Variable 'foo' is not declared --> tests/errors/program_variable.f90:3:7 | 3 | bar = foo | ^^^ 'foo' is undeclared lfortran-0.63.0/tests/reference/ast_f90-coarrays_02-6690b13.json0000664000175000017500000000074115174404631024114 0ustar alastairalastair{ "basename": "ast_f90-coarrays_02-6690b13", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/coarrays_02.f90", "infile_hash": "b8a582ffc5b086c98bf8f601c32831d648b199fc53bb272628421da9", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-coarrays_02-6690b13.stdout", "stdout_hash": "31bedb4ad1e3124de8ff9221a5a7aa018f658570aba47133daf1d5b9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-global_scope5-a66d166.stdout0000664000175000017500000000244015174404631024460 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () )] ) lfortran-0.63.0/tests/reference/ast-dimension_attr-12e0f2a.stdout0000664000175000017500000000526515174404631025036 0ustar alastairalastair(TranslationUnit [(Subroutine f [(a)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ())] () )] [(Print 0 () [a] () )] [] [] ) (Program main () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrDimension [(1 3 DimensionExpr) (1 3 DimensionExpr)] )] [(z [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration () [(AttrDimension [] )] [(a [(1 2 DimensionExpr) (1 2 DimensionExpr)] [] () () None ()) (b [(1 10 DimensionExpr) (1 10 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrDimension [(1 2 DimensionExpr) (1 2 DimensionExpr)] )] [(d [] [] () () None ())] () )] [(SubroutineCall 0 f [] [(() 1 () 0)] [] [] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-save2-63c8bcc.stderr0000664000175000017500000000173615174404631023110 0ustar alastairalastairwarning: Assuming implicit save attribute for variable declaration --> tests/save2.f90:2:13 | 2 | real :: x = 5, z | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement warning: Assuming implicit save attribute for variable declaration --> tests/save2.f90:10:13 | 10 | real :: x = 5, z | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement warning: Assuming implicit save attribute for variable declaration --> tests/save2.f90:26:17 | 26 | real :: x = 5, z | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement warning: Assuming implicit save attribute for variable declaration --> tests/save2.f90:34:17 | 34 | real :: x = 5, z | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement lfortran-0.63.0/tests/reference/run-write6-7442be9.stdout0000664000175000017500000000003315174404631023200 0ustar alastairalastair12345 0002 -003 file04.txt lfortran-0.63.0/tests/reference/ast_no_prescan-no_prescan_include1-40f0957.stdout0000664000175000017500000000011715174404631030006 0ustar alastairalastair(TranslationUnit [(Include 0 "if1.f90" () )] ) lfortran-0.63.0/tests/reference/ast-expr4-2704d50.json0000664000175000017500000000070415174404631022346 0ustar alastairalastair{ "basename": "ast-expr4-2704d50", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/expr4.f90", "infile_hash": "104847f7b62623d6e9d6d752ab2c6c58a31b70bc70a9cae0b5809241", "outfile": null, "outfile_hash": null, "stdout": "ast-expr4-2704d50.stdout", "stdout_hash": "c8fbb30ee5363d9bffb89512e41746ad1608c82d2fc923afcaf7c83a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-data_12-3198178.json0000664000175000017500000000073715174404631022464 0ustar alastairalastair{ "basename": "ast-data_12-3198178", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/data_12.f90", "infile_hash": "80710a15ea7a648779263ef05c92564bd17392b333fcaeeef1880a91", "outfile": null, "outfile_hash": null, "stdout": "ast-data_12-3198178.stdout", "stdout_hash": "0c461794e6998f5ea8c2ada897af16902dcf4a3c5c7558be05af24b8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-selectrank1-ee68c35.json0000664000175000017500000000074115174404631024354 0ustar alastairalastair{ "basename": "ast_f90-selectrank1-ee68c35", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/selectrank1.f90", "infile_hash": "7bd5ab94da79a773b306a0b17ac6754bf7d5bb9dc2df46631d00593c", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-selectrank1-ee68c35.stdout", "stdout_hash": "b37b4872e11fd46535a1981e2881d9fb333e9bb5b5af51529b854fcf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_error_02-a3d3b4c.stderr0000664000175000017500000000136215174404631025400 0ustar alastairalastairsemantic error: Number of arguments mismatch, restriction expects a function with 2 parameters, but a function with 3 parameters is provided --> tests/errors/template_error_02.f90:34:33 | 34 | instantiate add_t(real, func_arg_real), only: add_real => add_generic | ^^^^^^^^^^^^^ func_arg_real has 3 parameters | 28 | real function func_arg_real(x, y, a) result(z) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 31 | end function | ...^^^^^^^^^^^^^^^^ func_arg_real has 3 parameters | 8 | function F(x, y) result(z) | ^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 11 | end function | ...^^^^^^^^^^^^^^^^^^^^ f has 2 parameters lfortran-0.63.0/tests/reference/ast_f90-namelist_01-a0d2302.json0000664000175000017500000000076615174404631024154 0ustar alastairalastair{ "basename": "ast_f90-namelist_01-a0d2302", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/namelist_01.f90", "infile_hash": "82b81ebf89597c4cee2bae25cbe602a58d7d628cf9dec14337630861", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-namelist_01-a0d2302.stdout", "stdout_hash": "8296480953775e34afb70a88ee0b8d0244707eba18ad4f86d1c4c1d6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-types_16-57fa580.json0000664000175000017500000000072515174404631023057 0ustar alastairalastair{ "basename": "wat-types_16-57fa580", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/types_16.f90", "infile_hash": "c130af47594694449f9ae111b8985bb8567fd26e86979d127d34257b", "outfile": null, "outfile_hash": null, "stdout": "wat-types_16-57fa580.stdout", "stdout_hash": "e7efdb76ed1f94383db835c81d3ec1480fcda1d05021e936889732f2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-expr6-7f62240.stdout0000664000175000017500000000052415174404631022724 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { }) [(IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (RealConstant 5.300000 (Real 4) )] ) lfortran-0.63.0/tests/reference/asr-kind_01-6c675be.stderr0000664000175000017500000000031215174404631023230 0ustar alastairalastairsemantic error: `kind` argument of `aint` intrinsic must be a scalar --> tests/errors/kind_01.f90:3:36 | 3 | print *, aint([1.0, 2.0, 3.0], [4, 4]) | ^^^^^^ lfortran-0.63.0/tests/reference/asr-more_kwargs_than_acceptable_to_subroutine-a276855.stderr0000664000175000017500000000041015174404631032320 0ustar alastairalastairsemantic error: Procedure 'my_func' accepts 2 arguments, but 3 were provided --> tests/errors/more_kwargs_than_acceptable_to_subroutine.f90:4:5 | 4 | call my_func(y=1, x=2, z=1) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of arguments to 'my_func' lfortran-0.63.0/tests/reference/ast-fixed_form4-a6a0e27.stdout0000664000175000017500000000117615174404631024227 0ustar alastairalastair(TranslationUnit [(Program x () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(y [] [] () () None ())] () )] [(Assignment 0 y 5 () ) (Print 500 () [y] () )] [] )] ) lfortran-0.63.0/tests/reference/ast_f90-do_concurrent2-9ec99ee.stdout0000664000175000017500000000046615174404631025535 0ustar alastairalastairsubroutine do_concurrent2(a, b) real, intent(inout) :: a(:), b(:) integer :: i real :: x x = 1.0 do concurrent (i = 1:10) shared(i) local(x) default(none) if (a(i) > 0) then x = sqrt(a(i)) a(i) = a(i) - x**2 end if b(i) = b(i) - a(i) end do print *, x end subroutine do_concurrent2 lfortran-0.63.0/tests/reference/ast_f90-arrays_09-721986f.json0000664000175000017500000000076015174404631023616 0ustar alastairalastair{ "basename": "ast_f90-arrays_09-721986f", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/arrays_09.f90", "infile_hash": "4807239e4f9ca8eaee4604e98cad28c2a760cf3900a1e2018d304838", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-arrays_09-721986f.stdout", "stdout_hash": "e891b0d0e74e6ca48c1cb1f73d2049aff561f1fea36353cb17f1c9aa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-program_01-3f7a7b3.stdout0000664000175000017500000002045515174404631024000 0ustar alastairalastair(TranslationUnit [(Program program_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(dp [] [] () (FuncCallOrArray kind [] [(() (Real "0.d0") () 0)] [] [] [] ) Equal ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(Print 0 () [(String "Normal random numbers:" ())] () ) (DoLoop 0 () 0 i 1 10 () [(SubroutineCall 0 rand [] [(() a () 0)] [] [] () ) (Print 0 () [a] () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Subroutine rand [(x)] [] () (TriviaNode [(EndOfLine) (Comment "! Returns a psuedorandom scalar drawn from the standard normal distribution." ) (Comment "!" ) (Comment "! [1] Marsaglia, G., & Bray, T. A. (1964). A Convenient Method for" ) (Comment "! Generating Normal Variables. SIAM Review, 6(3), 260–264." )] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [(SimpleAttribute AttrSave )] [(first [] [] () (Logical .true. ()) Equal ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrSave )] [(u [(1 2 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [] [(r2 [] [] () () None ())] () )] [(If 0 () first [(DoLoop 0 () 0 () () () () [(SubroutineCall 0 random_number [] [(() u () 0)] [] [] () ) (Assignment 0 u (- (* 2 u) 1) () ) (Assignment 0 r2 (FuncCallOrArray sum [] [(() (** u 2) () 0)] [] [] [] ) () ) (If 0 () (BoolOp (< r2 1) And (> r2 0) ) [(Exit 0 () () )] [] () () () )] () () ) (Assignment 0 u (* u (FuncCallOrArray sqrt [] [(() (/ (* (u- 2) (FuncCallOrArray log [] [(() r2 () 0)] [] [] [] )) r2) () 0)] [] [] [] )) () ) (Assignment 0 x (FuncCallOrArray u [] [(() 1 () 0)] [] [] [] ) () )] [(Assignment 0 x (FuncCallOrArray u [] [(() 2 () 0)] [] [] [] ) () )] () () () ) (Assignment 0 first (not first) () )] [] [] )] )] ) lfortran-0.63.0/tests/reference/ast-do4-f8e2956.json0000664000175000017500000000067615174404631022105 0ustar alastairalastair{ "basename": "ast-do4-f8e2956", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do4.f90", "infile_hash": "34663c8b85b65aed5d3129e8a34a70dbf48fd845aab8935fe666b75e", "outfile": null, "outfile_hash": null, "stdout": "ast-do4-f8e2956.stdout", "stdout_hash": "cddb489a5d3ec9c8d0af2a34245100a3427d4ed315f8f5dc58db17dc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-fixed_form_implicit1-7817d96.stdout0000664000175000017500000000421315174404631025773 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main [] [(Assignment (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (If () (IntegerCompare (Var 2 a) LtE (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Print (StringConstant "h" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-type_mismatch1-550e457.stderr0000664000175000017500000000026215174404631024573 0ustar alastairalastairsemantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/type_mismatch1.f90:4:1 | 4 | x = "x" | ^ ^^^ type mismatch (integer and string) lfortran-0.63.0/tests/reference/ast-derived_type_without_start_program-089810e.stdout0000664000175000017500000000114115174404631031074 0ustar alastairalastair(TranslationUnit [(Program __xx_main () [] [] [(DerivedType test_t [] () [] [(Declaration (AttrType TypeReal [] () () None ) [] [(a [] [] () () None ())] () )] [] )] [] [] )] ) lfortran-0.63.0/tests/reference/wat-types_15-abe4006.stdout0000664000175000017500000002611515174404631023472 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (type (;4;) (func (param f64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i64 i64 i32 i32 f64 f64 f32 f32) i32.const 8 local.set 0 i32.const 2 local.set 4 i64.const 2 local.set 2 f32.const 3.140000 local.set 8 f64.const 3.140000 local.set 6 local.get 4 i64.extend_i32_s call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 2 call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 8 f64.promote_f32 call 4 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 6 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 4 local.set 3 local.get 2 local.set 1 local.get 8 local.set 7 local.get 6 local.set 5 local.get 3 i64.extend_i32_s call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 1 call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 7 f64.promote_f32 call 4 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 5 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 2 i32.wrap_i64 local.set 3 local.get 8 i64.trunc_f32_s local.set 1 local.get 6 f32.demote_f64 local.set 7 local.get 4 f64.convert_i32_s local.set 5 local.get 3 i64.extend_i32_s call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 1 call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 7 f64.promote_f32 call 4 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 5 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 8 i32.trunc_f32_s local.set 3 local.get 6 i64.trunc_f64_s local.set 1 local.get 4 f32.convert_i32_s local.set 7 local.get 2 f64.convert_i64_s local.set 5 local.get 3 i64.extend_i32_s call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 1 call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 7 f64.promote_f32 call 4 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 5 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 6 i32.trunc_f64_s local.set 3 local.get 4 i64.extend_i32_s local.set 1 local.get 2 f32.convert_i64_s local.set 7 local.get 8 f64.promote_f32 local.set 5 local.get 3 i64.extend_i32_s call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 1 call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 7 f64.promote_f32 call 4 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 5 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (func $4 (type 4) (param f64) (result) (local i64 i64 i64) local.get 0 f64.const 0.000000 f64.lt if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 f64.const -1.000000 f64.mul local.set 0 else end local.get 0 i64.trunc_f64_s call 3 i32.const 1 i32.const 40 i32.const 1 i32.const 0 call 1 drop local.get 0 local.get 0 i64.trunc_f64_s f64.convert_i64_s f64.sub f64.const 100000000.000000 f64.mul i64.trunc_f64_s local.set 2 local.get 2 local.set 3 i64.const 0 local.set 1 loop local.get 2 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 2 f64.convert_i64_s i64.const 10 f64.convert_i64_s f64.div i64.trunc_f64_s local.set 2 br 1 else end end loop local.get 1 i64.const 8 i64.lt_s if local.get 1 i64.const 1 i64.add local.set 1 i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop br 1 else end end local.get 3 call 3 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (export "print_f64" (func 4)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-0.63.0/tests/reference/asr-modules3-8936416.json0000664000175000017500000000071515174404631022776 0ustar alastairalastair{ "basename": "asr-modules3-8936416", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/modules3.f90", "infile_hash": "048400a36375e708ad5f14c9f8b07ff0063f29e758b77290cbbfbd29", "outfile": null, "outfile_hash": null, "stdout": "asr-modules3-8936416.stdout", "stdout_hash": "edbfb5cc060fe9cff10b7ea4d3c11a3b08c38f914a78c7958b5fdb2d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-nested_05-0252368.json0000664000175000017500000000075015174404631023202 0ustar alastairalastair{ "basename": "llvm-nested_05-0252368", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_05.f90", "infile_hash": "83b55ebf01581813bce973f49d745813499ef9e09fc0b0a2111f8386", "outfile": null, "outfile_hash": null, "stdout": "llvm-nested_05-0252368.stdout", "stdout_hash": "214fddad051e18f16d0549cf236b7bb194c302a4e64796824bc806d1", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootlfortran-0.63.0/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-modules_40-2830409.jsonlfortran-0.63.0/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-module0000664000175000017500000000123415174404631034775 0ustar alastairalastair{ "basename": "pass_pass_array_by_data_transform_optional_argument_functions-modules_40-2830409", "cmd": "lfortran --pass=pass_array_by_data,transform_optional_argument_functions --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_40.f90", "infile_hash": "ac67135d17b966d74eb1c00c48de647510f0b5ae38596bce67d52958", "outfile": null, "outfile_hash": null, "stdout": "pass_pass_array_by_data_transform_optional_argument_functions-modules_40-2830409.stdout", "stdout_hash": "9b136563c96f27028023a3880f2f04ac65bbcc33f2f604414f4e6987", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-doloop_05-1dc897c.json0000664000175000017500000000076015174404631023741 0ustar alastairalastair{ "basename": "ast_f90-doloop_05-1dc897c", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/doloop_05.f90", "infile_hash": "d6c2b01c1169dbde9ecbd05ebec2c3267e3d77d027cff03dc7361d78", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-doloop_05-1dc897c.stdout", "stdout_hash": "c1d752f2d90e0bdbedd94a6eaacd00d9b71f03a56ea0cbe2650c7658", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_array_op-modules_43-6930881.stdout0000664000175000017500000013502115174404631025644 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_43: (Program (SymbolTable 5 { add_sources_from_dir: (ExternalSymbol 5 add_sources_from_dir 2 add_sources_from_dir modules_43_fpm_sources [] add_sources_from_dir Public ), sources: (Variable 5 sources [] Local () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 5 srcfile_t Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), srcfile_t: (ExternalSymbol 5 srcfile_t 2 srcfile_t modules_43_fpm_sources [] srcfile_t Public ) }) modules_43 [modules_43_fpm_sources] [(Allocate [((Var 5 sources) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] () () ())] () () () ) (SubroutineCall 5 add_sources_from_dir () [((Var 5 sources))] () .false. )] ), modules_43_fpm_sources: (Module (SymbolTable 2 { add_sources_from_dir: (Function (SymbolTable 4 { __1__libasr_index_: (Variable 4 __1__libasr_index_ [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __1_t: (Variable 4 __1_t [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dir_sources: (Variable 4 dir_sources [] Local () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 srcfile_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), exclude_source: (Variable 4 exclude_source [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sources: (Variable 4 sources [] InOut () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 srcfile_t Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ) }) add_sources_from_dir (FunctionType [(Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) [(() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 sources)] [(Allocate [((Var 4 dir_sources) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] () () ())] () () () ) (If () (LogicalNot (IntrinsicImpureFunction Allocated [(Var 4 sources)] 0 (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 4 sources) (IntrinsicArrayFunction Pack [(Var 4 dir_sources) (ArrayPhysicalCast (LogicalNot (Var 4 exclude_source) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) () .false. .false. )] [(Assignment (Var 4 __1__libasr_index_) (ArrayBound (Var 4 sources) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) () .false. .false. ) (DoLoop () ((Var 4 __1_t) (ArrayBound (Var 4 sources) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 4 sources) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Assignment (ArrayItem (Var 4 sources) [(() (Var 4 __1__libasr_index_) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) RowMajor () ) (ArrayItem (Var 4 sources) [(() (Var 4 __1_t) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) RowMajor () ) () .false. .false. ) (Assignment (Var 4 __1__libasr_index_) (IntegerBinOp (Var 4 __1__libasr_index_) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] ) (Assignment (ArraySection (Var 4 sources) [((Var 4 __1__libasr_index_) (IntegerBinOp (IntegerBinOp (Var 4 __1__libasr_index_) Add (ArraySize (IntrinsicArrayFunction Pack [(Var 4 dir_sources) (ArrayPhysicalCast (LogicalNot (Var 4 exclude_source) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) () (Integer 4) () ) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal))] (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 4 dir_sources) () (Integer 4) () ))] PointerArray ) () ) (IntrinsicArrayFunction Pack [(Var 4 dir_sources) (ArrayPhysicalCast (LogicalNot (Var 4 exclude_source) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) () .false. .false. ) (Assignment (Var 4 __1__libasr_index_) (IntegerBinOp (Var 4 __1__libasr_index_) Add (ArraySize (IntrinsicArrayFunction Pack [(Var 4 dir_sources) (ArrayPhysicalCast (LogicalNot (Var 4 exclude_source) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) () (Integer 4) () ) (Integer 4) () ) () .false. .false. )] )] () Public .true. .true. () ), srcfile_t: (Struct (SymbolTable 3 { digest: (Variable 3 digest [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), exe_name: (Variable 3 exe_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), file_name: (Variable 3 file_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) srcfile_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 8)] [] .true. .false. ) [] [file_name exe_name digest] [] Source Public .false. .false. [] () () [] ) }) modules_43_fpm_sources () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-scopes1-502009a.stdout0000664000175000017500000001362415174404631023230 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { scopes1: (Program (SymbolTable 2 { f: (Function (SymbolTable 3 { b: (Variable 3 b [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 b)] [(Assignment (Var 3 b) (IntegerBinOp (Var 2 j) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) scopes1 [] [(Assignment (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 2 f () [((Var 2 i))] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/cpp-array3-a2f045b.stdout0000664000175000017500000000225715174404631023214 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct f32_3_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; f32_3_1(Kokkos::View* data_): data{data_} {}; }; // Forward declarations namespace { } // Implementations namespace { void main2() { Kokkos::View a_data("a_data", 3); f32_3_1 a_value(&a_data); f32_3_1* a = &a_value; a->dims[0].lower_bound = 1; a->dims[0].length = 3; Kokkos::View b_data("b_data", 3); f32_3_1 b_value(&b_data); f32_3_1* b = &b_value; b->dims[0].lower_bound = 1; b->dims[0].length = 3; a->data = &r; b->data = &r; } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/ast-expr_05-c1f66bd.json0000664000175000017500000000073715174404631023022 0ustar alastairalastair{ "basename": "ast-expr_05-c1f66bd", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/expr_05.f90", "infile_hash": "ab6fcfdb7d7b127b347b822368c1a3d22c7241a82453de78dd535c05", "outfile": null, "outfile_hash": null, "stdout": "ast-expr_05-c1f66bd.stdout", "stdout_hash": "a90bd25bc6ba9dd8829b689a6463e4b6e18b8796add7d3ec37feebf8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-int_03-924441d.stdout0000664000175000017500000004164315174404631022764 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { int_03: (Program (SymbolTable 2 { ans: (Variable 2 ans [] Local () () Default (Array (Integer 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dp: (Variable 2 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i4: (Variable 2 i4 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i8: (Variable 2 i8 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), w4: (Variable 2 w4 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), w8: (Variable 2 w8 [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) int_03 [] [(Assignment (ArrayItem (Var 2 ans) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 8) ColMajor () ) (IntegerConstant 8524933037632333570 (Integer 8) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 ans) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 8) ColMajor () ) (IntegerUnaryMinus (IntegerConstant 1069250973542918798 (Integer 8) Decimal) (Integer 8) (IntegerConstant -1069250973542918798 (Integer 8) Decimal) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 ans) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 8) ColMajor () ) (IntegerUnaryMinus (IntegerConstant 5123867065024149335 (Integer 8) Decimal) (Integer 8) (IntegerConstant -5123867065024149335 (Integer 8) Decimal) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 ans) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 8) ColMajor () ) (IntegerConstant 7303655603304982073 (Integer 8) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 ans) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 8) ColMajor () ) (IntegerConstant 5108441843522503546 (Integer 8) Decimal) () .false. .false. ) (Print (StringFormat () [(Var 2 ans)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 w8) (ComplexConstructor (RealConstant 7.700000 (Real 8) ) (RealConstant 5.000000 (Real 8) ) (Complex 8) (ComplexConstant 7.700000 5.000000 (Complex 8) ) ) () .false. .false. ) (Assignment (Var 2 i4) (Cast (Var 2 w8) ComplexToInteger (Integer 4) () () ) () .false. .false. ) (Assignment (Var 2 i8) (Cast (Var 2 w8) ComplexToInteger (Integer 8) () () ) () .false. .false. ) (Print (StringFormat () [(Var 2 i4) (Var 2 i8)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i4) NotEq (IntegerConstant 7 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 i8) NotEq (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 7 (Integer 8) Decimal) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 w4) (ComplexConstructor (RealConstant 7.700000 (Real 4) ) (RealConstant 5.000000 (Real 4) ) (Complex 4) (ComplexConstant 7.700000 5.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 i4) (Cast (Var 2 w4) ComplexToInteger (Integer 4) () () ) () .false. .false. ) (Assignment (Var 2 i8) (Cast (Var 2 w4) ComplexToInteger (Integer 8) () () ) () .false. .false. ) (Print (StringFormat () [(Var 2 i4) (Var 2 i8)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i4) NotEq (IntegerConstant 7 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 i8) NotEq (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 7 (Integer 8) Decimal) () ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-nullify_04-a75db8a.json0000664000175000017500000000075015174404631023516 0ustar alastairalastair{ "basename": "asr-nullify_04-a75db8a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nullify_04.f90", "infile_hash": "40ca9241d7f57af3585301c6674e765dc78d3c06008da214079103a0", "outfile": null, "outfile_hash": null, "stdout": "asr-nullify_04-a75db8a.stdout", "stdout_hash": "f0a972d1a2bb4fdf6c1068b395149d3b56e55ebbef24405dce7b7587", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/mod_to_asr-mod1-14-bb0bd17.json0000664000175000017500000000074515174404631024146 0ustar alastairalastair{ "basename": "mod_to_asr-mod1-14-bb0bd17", "cmd": "lfortran mod --show-asr --no-indent --no-color {infile}", "infile": "tests/interop/mod1-14.mod", "infile_hash": "00dfd17351427824dd19adcb6958a8bbbd932547448a184c8ad952bc", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "mod_to_asr-mod1-14-bb0bd17.stderr", "stderr_hash": "55ed9d251dff9521e02e51d9efa988c5e5b5748a24baa78b387de7f6", "returncode": 109 }lfortran-0.63.0/tests/reference/asr-const_real_dp-fa55d4d.stdout0000664000175000017500000001435715174404631024727 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { const_real_dp: (Program (SymbolTable 2 { u: (Variable 2 u [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 2 v [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zero: (Variable 2 zero [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) const_real_dp [] [(Assignment (Var 2 zero) (RealConstant 0.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 u) (Cast (RealConstant 1.050000 (Real 4) ) RealToReal (Real 8) (RealConstant 1.050000 (Real 8) ) () ) () .false. .false. ) (Assignment (Var 2 v) (RealConstant 1.050000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 1.050000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(Var 2 zero) (Var 2 v) (Var 2 x) (Var 2 u)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-assign_to3-fc49dae.stdout0000664000175000017500000000170215174404631024237 0ustar alastairalastair(TranslationUnit [(Program assign3 () [] [] [] [(Assign 10 30 next () ) (GoTo 20 next () [30 50 70 110] () ) (Assign 0 50 next () ) (Assign 0 70 next () ) (Assign 0 110 next () ) (Print 30 () [30] () ) (Print 50 () [50] () ) (Print 70 () [70] () ) (Print 110 () [110] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-incompatible_ranks_allocatable_arr2-699f9ab.stderr0000664000175000017500000000025115174404631031132 0ustar alastairalastairsemantic error: Incompatible ranks 1 and 3 in assignment --> tests/errors/incompatible_ranks_allocatable_arr2.f90:10:5 | 10 | arr3 = arr1 | ^^^^^^^^^^^ lfortran-0.63.0/tests/reference/llvm-string_10-ef0078f.json0000664000175000017500000000075015174404631023450 0ustar alastairalastair{ "basename": "llvm-string_10-ef0078f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/string_10.f90", "infile_hash": "bc81968bc899cbe447092923c9b089e1942c9ecf0bad33ee7145f2a9", "outfile": null, "outfile_hash": null, "stdout": "llvm-string_10-ef0078f.stdout", "stdout_hash": "50abb758d7baf2a6dec1d4a1b43aa1ab35aa0293c59ba0bec0ade119", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-namelist_01-032372e.json0000664000175000017500000000075315174404631023424 0ustar alastairalastair{ "basename": "ast-namelist_01-032372e", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/namelist_01.f90", "infile_hash": "82b81ebf89597c4cee2bae25cbe602a58d7d628cf9dec14337630861", "outfile": null, "outfile_hash": null, "stdout": "ast-namelist_01-032372e.stdout", "stdout_hash": "dbc63b7acc68b1eb32fe028442d79c0ee03117051d4e35550f74d2b6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-doloop_01-5cd8bf1.json0000664000175000017500000000074515174404631023332 0ustar alastairalastair{ "basename": "asr-doloop_01-5cd8bf1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_01.f90", "infile_hash": "14818f8f39c32bf890cf7906fe8a9692b270ad81a49bcdf0486f8e84", "outfile": null, "outfile_hash": null, "stdout": "asr-doloop_01-5cd8bf1.stdout", "stdout_hash": "445780a83cb8844ffd68f6a80b649fd93808ba8c858f5f3a4d2734df", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-allocate_01-d7a2337.stderr0000664000175000017500000000006215174404631024021 0ustar alastairalastairAttempting to allocate already allocated variable!lfortran-0.63.0/tests/reference/ast-program_without_line_04-bf080aa.stdout0000664000175000017500000000121615174404631026634 0ustar alastairalastair(TranslationUnit [(Subroutine sub [] [] () (TriviaNode [(Semicolon)] [(Semicolon)] ) [] [] [] [] [] [] [] ) (Program __xx_main () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-where_02-95cf592.stdout0000664000175000017500000002622715174404631023377 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main [] [(Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 2.000000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 0.500000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 3.500000 (Real 4) ) () .false. .false. ) (Where (RealCompare (Var 2 a) Gt (Var 2 b) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 a) (ArrayBroadcast (RealConstant 1.500000 (Real 4) ) (ArrayConstant 4 [2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 8 [1.50000000e+00, 1.50000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [] ) (Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 1.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 2.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-select_type1-767380c.stdout0000664000175000017500000000074215174404631024752 0ustar alastairalastairprogram select_type1 implicit none select type (uptr=>iter%value()) type is (integer) print *, iter%key(), " = ", uptr type is (real) print *, iter%key(), " = ", uptr type is (character(len=*)) print *, iter%key(), " = ", uptr type is (point) print *, iter%key(), " = ", uptr class is (point2) print *, iter%key(), " = ", uptr class default print *, iter%key(), " = ", uptr end select end program select_type1 lfortran-0.63.0/tests/reference/run-print_12-a2450d8.stdout0000664000175000017500000000003015174404631023402 0ustar alastairalastairHello = Ni Hao = 你好 lfortran-0.63.0/tests/reference/ast-infer_global_scope_file_01-1659622.json0000664000175000017500000000100315174404631026341 0ustar alastairalastair{ "basename": "ast-infer_global_scope_file_01-1659622", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/infer_global_scope_file_01.f90", "infile_hash": "daffc25b17c13f93571ecd2fcb6dc1781bd53fe58ca64660265375aa", "outfile": null, "outfile_hash": null, "stdout": "ast-infer_global_scope_file_01-1659622.stdout", "stdout_hash": "4200eb2752cc7cba946f763d6c67efe4f32429f97e17dfe7e1b03112", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_interface_01-07d787f.json0000664000175000017500000000101115174404631025526 0ustar alastairalastair{ "basename": "asr-template_interface_01-07d787f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_interface_01.f90", "infile_hash": "22d5402109d63586d3e6f850a5c5fb6cfb5bd8ecfde6fc55ddbd335e", "outfile": null, "outfile_hash": null, "stdout": "asr-template_interface_01-07d787f.stdout", "stdout_hash": "1fa09b12282f83b0fd0a15763667f6ab9b32bf6961fdeadc0ac63de2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-variable1-8ec1519.json0000664000175000017500000000074515174404631023247 0ustar alastairalastair{ "basename": "asr-variable1-8ec1519", "cmd": "lfortran --show-asr --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/variable1.f90", "infile_hash": "3c85fb2081cc769c834a0275f205cd79f767550a1cfa6e14eee6d48b", "outfile": null, "outfile_hash": null, "stdout": "asr-variable1-8ec1519.stdout", "stdout_hash": "639ef66fa6fd597a298b2c1d2c3bf09de3355556e551b23bc6db9bf8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_08-3680946.stdout0000664000175000017500000011415115174404631024770 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_08: (Program (SymbolTable 6 { 1_rectangle_length: (ExternalSymbol 6 1_rectangle_length 4 length rectangle [] length Public ), 1_rectangle_width: (ExternalSymbol 6 1_rectangle_width 4 width rectangle [] width Public ), 1_shape_color: (ExternalSymbol 6 1_shape_color 3 color shape [] color Public ), 1_shape_filled: (ExternalSymbol 6 1_shape_filled 3 filled shape [] filled Public ), 1_shape_initialize_subrout: (ExternalSymbol 6 1_shape_initialize_subrout 3 initialize shape [] initialize Public ), 1_shape_x: (ExternalSymbol 6 1_shape_x 3 x shape [] x Public ), 1_shape_y: (ExternalSymbol 6 1_shape_y 3 y shape [] y Public ), initialize_subrout: (ExternalSymbol 6 initialize_subrout 2 initialize_subrout shape_mod [] initialize_subrout Public ), rect: (Variable 6 rect [] Local () () Default (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) 6 rectangle Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rectangle: (ExternalSymbol 6 rectangle 2 rectangle shape_mod [] rectangle Public ), shape: (ExternalSymbol 6 shape 2 shape shape_mod [] shape Public ), shp: (Variable 6 shp [] Local () () Default (StructType [(Integer 4) (Logical 4) (Integer 4) (Integer 4)] [] .true. .false. ) 6 shape Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) derived_types_08 [shape_mod] [(SubroutineCall 6 1_shape_initialize_subrout () [((Var 6 shp)) ((IntegerConstant 1 (Integer 4) Decimal)) ((LogicalConstant .true. (Logical 4) )) ((IntegerConstant 10 (Integer 4) Decimal)) ((IntegerConstant 20 (Integer 4) Decimal))] (Var 6 shp) .false. ) (SubroutineCall 6 1_shape_initialize_subrout () [((Var 6 rect)) ((IntegerConstant 2 (Integer 4) Decimal)) ((LogicalConstant .false. (Logical 4) )) ((IntegerConstant 100 (Integer 4) Decimal)) ((IntegerConstant 200 (Integer 4) Decimal))] (Var 6 rect) .false. ) (Print (StringFormat () [(StructInstanceMember (Var 6 shp) 6 1_shape_color (Integer 4) () ) (StructInstanceMember (Var 6 shp) 6 1_shape_filled (Logical 4) () ) (StructInstanceMember (Var 6 shp) 6 1_shape_x (Integer 4) () ) (StructInstanceMember (Var 6 shp) 6 1_shape_y (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StructInstanceMember (Var 6 rect) 6 1_shape_color (Integer 4) () ) (StructInstanceMember (Var 6 rect) 6 1_shape_filled (Logical 4) () ) (StructInstanceMember (Var 6 rect) 6 1_shape_x (Integer 4) () ) (StructInstanceMember (Var 6 rect) 6 1_shape_y (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (StructInstanceMember (Var 6 rect) 6 1_rectangle_length (Integer 4) () ) (IntegerConstant 100 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 6 rect) 6 1_rectangle_width (Integer 4) () ) (IntegerConstant 200 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(StructInstanceMember (Var 6 rect) 6 1_rectangle_length (Integer 4) () ) (StructInstanceMember (Var 6 rect) 6 1_rectangle_width (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), shape_mod: (Module (SymbolTable 2 { initialize_subrout: (Function (SymbolTable 5 { 1_shape_color: (ExternalSymbol 5 1_shape_color 3 color shape [] color Public ), 1_shape_filled: (ExternalSymbol 5 1_shape_filled 3 filled shape [] filled Public ), 1_shape_x: (ExternalSymbol 5 1_shape_x 3 x shape [] x Public ), 1_shape_y: (ExternalSymbol 5 1_shape_y 3 y shape [] y Public ), color: (Variable 5 color [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), filled: (Variable 5 filled [] Unspecified () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sh: (Variable 5 sh [] Unspecified () () Default (StructType [(Integer 4) (Logical 4) (Integer 4) (Integer 4)] [] .false. .false. ) 2 shape Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 5 x [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 5 y [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) initialize_subrout (FunctionType [(StructType [(Integer 4) (Logical 4) (Integer 4) (Integer 4)] [] .false. .false. ) (Integer 4) (Logical 4) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 sh) (Var 5 color) (Var 5 filled) (Var 5 x) (Var 5 y)] [(Assignment (StructInstanceMember (Var 5 sh) 5 1_shape_color (Integer 4) () ) (Var 5 color) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 sh) 5 1_shape_filled (Logical 4) () ) (Var 5 filled) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 sh) 5 1_shape_x (Integer 4) () ) (Var 5 x) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 sh) 5 1_shape_y (Integer 4) () ) (Var 5 y) () .false. .false. )] () Public .true. .true. () ), rectangle: (Struct (SymbolTable 4 { length: (Variable 4 length [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), width: (Variable 4 width [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) rectangle (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) [] [length width] [] Source Public .false. .false. [] () 2 shape [] ), shape: (Struct (SymbolTable 3 { color: (Variable 3 color [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), filled: (Variable 3 filled [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), initialize: (StructMethodDeclaration 3 initialize () initialize_subrout 2 initialize_subrout Source .false. .false. ), x: (Variable 3 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 3 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) shape (StructType [(Integer 4) (Logical 4) (Integer 4) (Integer 4)] [] .true. .false. ) [] [color filled x y] [] Source Public .false. .false. [] () () [] ) }) shape_mod () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/llvm-int_dp-9b89d9f.stdout0000664000175000017500000000512615174404631023511 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @int_dp.u = internal global i32 2147483647 @int_dp.v = internal global i64 2147483647 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [6 x i8] c"I4,I8\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, i32* @int_dp.u, i64* @int_dp.v) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_int_dp FINALIZE_SYMTABLE_int_dp: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/cpp-intrinsics_02-707a51a.json0000664000175000017500000000074415174404631024051 0ustar alastairalastair{ "basename": "cpp-intrinsics_02-707a51a", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/intrinsics_02.f90", "infile_hash": "9042eb55a868aba778eaccfaba75217700b9f99f157df367ffc005fd", "outfile": null, "outfile_hash": null, "stdout": "cpp-intrinsics_02-707a51a.stdout", "stdout_hash": "9a3bf311b75e2c5f76f116336e7822db7d9fe7334f7ff92abd41ff46", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-abs_03-5d62cca.stdout0000664000175000017500000001420315174404631023151 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32) i32.const 2 local.set 0 local.get 0 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 0 i32.const 0 i32.lt_s if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end i32.const 2 local.set 0 local.get 0 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 0 i32.const 0 i32.lt_s if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\0b\00\00\00") (data (;35;) (i32.const 216) "ERROR STOP\n ") ) lfortran-0.63.0/tests/reference/cpp-types_04-513a7e4.stdout0000664000175000017500000000176515174404631023413 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t i; float r; float x; r = 1.50000000000000000e+00; i = 2; x = (float)(i*i); x = r*r; x = (float)(i)*r; x = r*(float)(i); x = (float)(i + i); x = r + r; x = r + (float)(i); x = (float)(i) + r; x = (float)(i - i); x = r - r; x = r - (float)(i); x = (float)(i) - r; x = (float)(i/i); x = r/r; x = (float)(i)/r; x = r/(float)(i); } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/asr-substring_startidx-5fb6d57.json0000664000175000017500000000076215174404631025425 0ustar alastairalastair{ "basename": "asr-substring_startidx-5fb6d57", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/substring_startidx.f90", "infile_hash": "fcff3742bb69cbe950f45a39c1dca614325666b260ee503f8862cfdf", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-substring_startidx-5fb6d57.stderr", "stderr_hash": "564b4a23bb9dc1c50abb4282ce068b3666966efc9fd6fa9de268b987", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-program3-e2fc2d1.stdout0000664000175000017500000001325515174404631023635 0ustar alastairalastair(TranslationUnit [(Program program3 () [] [] [(Declaration (AttrType TypeReal [] () () None ) [] [(x [] [] () () None ()) (y [] [] () () None ()) (z [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 x (Real "5.0") () ) (Assignment 0 y (Real "2.0") () ) (Assignment 0 z (* x y) () ) (Print 0 () [(String "10.0 ==" ()) z] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 z (FuncCallOrArray func1 [] [(() x () 0) (() y () 0)] [] [] [] ) () ) (Print 0 () [(String "49.0 ==" ()) z] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 z (FuncCallOrArray func2 [] [(() x () 0) (() y () 0)] [] [] [] ) () ) (Print 0 () [(String "10.0 ==" ()) z] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Function func1 [(a) (b)] [] c () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(c [] [] () () None ())] () )] [(Assignment 0 c (+ a b) () ) (Assignment 0 c (FuncCallOrArray func2 [] [(() c () 0) (() c () 0)] [] [] [] ) () )] [] [] ) (Function func2 [(a) (b)] [] c () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(c [] [] () () None ())] () )] [(Assignment 0 c (* a b) (TriviaNode [] [(EndOfLine) (Comment "! c = func1(c, c)" )] ) )] [] [] )] )] ) lfortran-0.63.0/tests/reference/cpp-case_06-57ebc6f.stdout0000664000175000017500000000472115174404631023327 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { static int32_t a=1; int32_t ap=1; static int32_t b=2; int32_t bp=2; static float c= 1.00000000000000000e+00; float cp= 1.00000000000000000e+00; static float d= 2.00000000000000000e+00; float dp= 2.00000000000000000e+00; std::string grade_fixed="B"; int32_t marks; int32_t marks_fixed=94; if (grade_fixed == "A") { std::cout<< "Excellent!"<= 40 + bp) { std::cout<< "Pass!"<= 40 + bp) { std::cout<< "Pass!"< tests/implicit12.f90:3:17 | 3 | implicit integer*4 (d-e) | ^ help: write this as 'integer(4)' style suggestion: Use integer(8) instead of integer*8 --> tests/implicit12.f90:4:17 | 4 | implicit integer*8 (f-g) | ^ help: write this as 'integer(8)' style suggestion: Use real(4) instead of real*4 --> tests/implicit12.f90:6:14 | 6 | implicit real*4 (i-k) | ^ help: write this as 'real(4)' style suggestion: Use real(8) instead of real*8 --> tests/implicit12.f90:7:14 | 7 | implicit real*8 (l) | ^ help: write this as 'real(8)' style suggestion: Use complex(4) instead of complex*8 --> tests/implicit12.f90:9:17 | 9 | implicit complex*8 (o) | ^ help: write this as 'complex(4)' style suggestion: Use complex(8) instead of complex*16 --> tests/implicit12.f90:10:17 | 10 | implicit complex*16 (p) | ^ help: write this as 'complex(8)' lfortran-0.63.0/tests/reference/julia-case_02-e255e0e.json0000664000175000017500000000073015174404631023201 0ustar alastairalastair{ "basename": "julia-case_02-e255e0e", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/case_02.f90", "infile_hash": "76d3020fba89787d565870ed03c1b5e8914d12b062cb9ca7a8c37550", "outfile": null, "outfile_hash": null, "stdout": "julia-case_02-e255e0e.stdout", "stdout_hash": "b2e881f17018dd9a8a90b5a6a42e2df58a22fd7b70b6e85eff85a6f0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-expr4-ffedfc3.json0000664000175000017500000000070715174404631023127 0ustar alastairalastair{ "basename": "llvm-expr4-ffedfc3", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/expr4.f90", "infile_hash": "104847f7b62623d6e9d6d752ab2c6c58a31b70bc70a9cae0b5809241", "outfile": null, "outfile_hash": null, "stdout": "llvm-expr4-ffedfc3.stdout", "stdout_hash": "a71366c6410823314eb942b37c6b612003d9c0fc2f547adc6fa208be", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-logical1-d46903b.stdout0000664000175000017500000000515415174404631023625 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [8 x i8] c"L32,L32\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca i32, align 4 %b = alloca i32, align 4 store i32 1, i32* %a, align 4 store i32 0, i32* %b, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %a, i32* %b) %5 = load i64, i64* %3, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 8 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_logical1 FINALIZE_SYMTABLE_logical1: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/llvm-string_01-deb8ed3.json0000664000175000017500000000075015174404631023607 0ustar alastairalastair{ "basename": "llvm-string_01-deb8ed3", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/string_01.f90", "infile_hash": "e7d4974d8a9b9704bf0c02d7943d916b40c591de3c9e89d30de28d7d", "outfile": null, "outfile_hash": null, "stdout": "llvm-string_01-deb8ed3.stdout", "stdout_hash": "ef565379c291259557abd75e1d70bbb69f5fce45f416d03cd7c670f0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-types_05-fa1bde9.stdout0000664000175000017500000005176715174404631023650 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { types_05: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 2 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) types_05 [] [(Assignment (Var 2 r) (RealBinOp (RealConstant 1.000000 (Real 4) ) Mul (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) (Real 4) (RealConstant 2.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 r) (RealBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) Mul (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant 2.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 r) (RealBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) Mul (RealBinOp (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) () ) Add (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant 4.000000 (Real 4) ) ) (Real 4) (RealConstant 8.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 r) (RealBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) Mul (RealBinOp (RealConstant 3.000000 (Real 4) ) Sub (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) (Real 4) (RealConstant 2.000000 (Real 4) ) ) (Real 4) (RealConstant 4.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 r) (Cast (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 r) (RealBinOp (RealConstant 1.000000 (Real 4) ) Div (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) (Real 4) (RealConstant 0.500000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 r) (RealBinOp (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) Div (RealConstant 2.000000 (Real 4) ) (Real 4) (RealConstant 0.500000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 i) (Cast (RealBinOp (RealConstant 1.000000 (Real 4) ) Mul (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) (Real 4) (RealConstant 2.000000 (Real 4) ) ) RealToInteger (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) () ) () .false. .false. ) (Assignment (Var 2 i) (Cast (RealBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) Mul (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant 2.000000 (Real 4) ) ) RealToInteger (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) () ) () .false. .false. ) (Assignment (Var 2 i) (Cast (RealBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) Mul (RealBinOp (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) () ) Add (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant 4.000000 (Real 4) ) ) (Real 4) (RealConstant 8.000000 (Real 4) ) ) RealToInteger (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) () ) () .false. .false. ) (Assignment (Var 2 i) (Cast (RealBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) Mul (RealBinOp (RealConstant 3.000000 (Real 4) ) Sub (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) (Real 4) (RealConstant 2.000000 (Real 4) ) ) (Real 4) (RealConstant 4.000000 (Real 4) ) ) RealToInteger (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) () ) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 i) (Cast (RealBinOp (RealConstant 1.000000 (Real 4) ) Div (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) (Real 4) (RealConstant 0.500000 (Real 4) ) ) RealToInteger (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) () ) () .false. .false. ) (Assignment (Var 2 i) (Cast (RealBinOp (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) Div (RealConstant 2.000000 (Real 4) ) (Real 4) (RealConstant 0.500000 (Real 4) ) ) RealToInteger (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) () ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/run-format_12-43152e4.json0000664000175000017500000000071515174404631023117 0ustar alastairalastair{ "basename": "run-format_12-43152e4", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_12.f90", "infile_hash": "c8b55fbf08e13910eba0e4a0676ce1ee33948fa588da1276816d610c", "outfile": null, "outfile_hash": null, "stdout": "run-format_12-43152e4.stdout", "stdout_hash": "8a11ee5189b3301b56878c592eba22999b95feb0926ef081c2e37cf8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-doloop_04-6ff18c8.json0000664000175000017500000000074515174404631023266 0ustar alastairalastair{ "basename": "asr-doloop_04-6ff18c8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_04.f90", "infile_hash": "d2027c560ba8546e31b7627200b8fb28695617c3238a8f1a086c62ef", "outfile": null, "outfile_hash": null, "stdout": "asr-doloop_04-6ff18c8.stdout", "stdout_hash": "e35e33f45103248ba394d95c48365da7aa3d22155e3ba04096240ace", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-recursion_03-3285725.json0000664000175000017500000000076115174404631023737 0ustar alastairalastair{ "basename": "llvm-recursion_03-3285725", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/recursion_03.f90", "infile_hash": "ca5d64a5bc86665cf6168763480264f56ea25b3bfcc7217348fb14c0", "outfile": null, "outfile_hash": null, "stdout": "llvm-recursion_03-3285725.stdout", "stdout_hash": "508319cf165bb4d7fab359538ba157367a6ea3c12486bc061140eb1d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-interface_02-c56d91f.stdout0000664000175000017500000001023415174404631024271 0ustar alastairalastair(TranslationUnit [(Module interface_02_mod (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Interface (InterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceProc (Subroutine a1 [(a)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () )] [] [] [] ) )] ) (Interface (InterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceProc (Subroutine a2 [(a)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Subroutine a3 [(a)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () )] [] [] [] ) )] )] [] [] ) (Program interface_02 () [(Use [] interface_02_mod [(UseSymbol a1 () ) (UseSymbol a2 () ) (UseSymbol a3 () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [] )] ) lfortran-0.63.0/tests/reference/wat-wasm_unary_minus-81a29ff.json0000664000175000017500000000073015174404631025062 0ustar alastairalastair{ "basename": "wat-wasm_unary_minus-81a29ff", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/wasm_unary_minus.f90", "infile_hash": "37a1e4bd375869b0066f69a42ebd7681d5ff210b6489d1ed19d7ea9b", "outfile": null, "outfile_hash": null, "stdout": "wat-wasm_unary_minus-81a29ff.stdout", "stdout_hash": "b0a8f50bbcece95d91807549aa3108b81b7b8eca743953e847483d75", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-scalar_allocation_check_03-a66333c.stderr0000664000175000017500000000031015174404631027040 0ustar alastairalastairruntime error: Tried to access member of unallocated variable 'var' --> tests/errors/scalar_allocation_check_03.f90:10:14 | 10 | print *, var%x | ^^^^^ 'var' unallocated here lfortran-0.63.0/tests/reference/llvm-associate_03-68dfbc7.json0000664000175000017500000000076115174404631024205 0ustar alastairalastair{ "basename": "llvm-associate_03-68dfbc7", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/associate_03.f90", "infile_hash": "54a0fef1ee3727e70478189b60d108081d8e7760cadd89e8c99a8378", "outfile": null, "outfile_hash": null, "stdout": "llvm-associate_03-68dfbc7.stdout", "stdout_hash": "380481401a2ff635fc6249287ed6082e86892b6feee99b7da4fe9c19", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-associate_08-570ac7d.json0000664000175000017500000000075615174404631023740 0ustar alastairalastair{ "basename": "asr-associate_08-570ac7d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/associate_08.f90", "infile_hash": "17961496c368f350ad83975979fbb27d1cb619e296fa3eb51018e127", "outfile": null, "outfile_hash": null, "stdout": "asr-associate_08-570ac7d.stdout", "stdout_hash": "58de9d8a11b38be768012b9f82fb18d69baa56ed95be918094b7180f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-floatStringInput-95c963d.json0000664000175000017500000000072415174404631024740 0ustar alastairalastair{ "basename": "run-floatStringInput-95c963d", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/floatStringInput.f90", "infile_hash": "4db92554a429fc93f7f3eb205946ec7b7539f4f4b3cf7674cb9e3434", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-floatStringInput-95c963d.stderr", "stderr_hash": "50500727736157906e3452986874952b0eb79fa95622309fae659c69", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-write2-3444284.stdout0000664000175000017500000001137115174404631023020 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { write2: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lfortran_iomsg: (Variable 2 lfortran_iomsg [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) write2 [] [(FileWrite 0 (IntegerConstant 6 (Integer 4) Decimal) (Var 2 lfortran_iomsg) () () [(StringFormat (StringConstant "(a)" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(StringConstant "Some text: " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .true. () () () ) (FileRead 0 () () () () () () () () [(Var 2 i)] () .false. () () () ) (Print (StringFormat () [(StringConstant "Got: " (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/julia-subroutines_03-dde7b37.json0000664000175000017500000000075515174404631024745 0ustar alastairalastair{ "basename": "julia-subroutines_03-dde7b37", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/subroutines_03.f90", "infile_hash": "432c4d3eb84ddddcc76b5371ed559a4688bf1e31676bb7e14c2aa3cf", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutines_03-dde7b37.stdout", "stdout_hash": "9e1b9f51357f697e89ce60e9a3a9772190dda70e5515ffd1862c6ff8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_28-9506bba.json0000664000175000017500000000075015174404631023427 0ustar alastairalastair{ "basename": "asr-modules_28-9506bba", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_28.f90", "infile_hash": "0fe02444ac1b5b30e62b86a49a930b9480573b556960f066ba59133d", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_28-9506bba.stdout", "stdout_hash": "3f6841de833d2a7f7c53bc058f68b57ae55533b8c67912a5933f627f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-modules_01-1b129c3.json0000664000175000017500000000075315174404631023522 0ustar alastairalastair{ "basename": "llvm-modules_01-1b129c3", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_01.f90", "infile_hash": "592921c14763dae70e205b1eaf8b9fd0b69df11eccc0a66d109e11b8", "outfile": null, "outfile_hash": null, "stdout": "llvm-modules_01-1b129c3.stdout", "stdout_hash": "7bdd8efae069739778feb85d65790478673d26231b9109f2b1a5ca61", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-block_data1-d563f39.json0000664000175000017500000000072615174404631023552 0ustar alastairalastair{ "basename": "ast-block_data1-d563f39", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/block_data1.f90", "infile_hash": "18c095bb88a2f3528ab34c788fd6a66b9294d38866605cfec26b8dfd", "outfile": null, "outfile_hash": null, "stdout": "ast-block_data1-d563f39.stdout", "stdout_hash": "092152a27734c4bdce8c776f9a24f659bf13eb70522dc54baecc3f53", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-allow_implicit_interface4-4615450.json0000664000175000017500000000104715174404631026342 0ustar alastairalastair{ "basename": "asr-allow_implicit_interface4-4615450", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/allow_implicit_interface4.f90", "infile_hash": "9992b1e5744f5c2000e5692928e1413fc28b7542424999502e928afd", "outfile": null, "outfile_hash": null, "stdout": "asr-allow_implicit_interface4-4615450.stdout", "stdout_hash": "e053a3ec4192cbbdc57e57f53ee45829eeec333abc05fe6ac3557b12", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-int_dp-41a64fa.stdout0000664000175000017500000000622515174404631023275 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { int_dp: (Program (SymbolTable 2 { u: (Variable 2 u [] Local (IntegerConstant 2147483647 (Integer 4) Decimal) (IntegerConstant 2147483647 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 2 v [] Local (Cast (IntegerConstant 2147483647 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 2147483647 (Integer 8) Decimal) () ) (IntegerConstant 2147483647 (Integer 8) Decimal) Save (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) int_dp [] [(Print (StringFormat () [(Var 2 u) (Var 2 v)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-expr_07-ec2c3a6.json0000664000175000017500000000073715174404631023015 0ustar alastairalastair{ "basename": "asr-expr_07-ec2c3a6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/expr_07.f90", "infile_hash": "3104b4735ed58e4c3d370db99249102fa43c866834c04484ea2b7bae", "outfile": null, "outfile_hash": null, "stdout": "asr-expr_07-ec2c3a6.stdout", "stdout_hash": "7c3f8633790be46eb2d87334ffd5a6026d15d8ca8c7bac90a9067842", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-block_03-6c8fdd8.json0000664000175000017500000000074215174404631023141 0ustar alastairalastair{ "basename": "asr-block_03-6c8fdd8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/block_03.f90", "infile_hash": "3271e019be3575ad1c8280a5b50d7fccb0534f39241680ad66e6bc50", "outfile": null, "outfile_hash": null, "stdout": "asr-block_03-6c8fdd8.stdout", "stdout_hash": "af962a20ca223485d8a0180287699b657679a8da418b9c5d302ac3b3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-arrays_01-4fac8c3.stdout0000664000175000017500000000715215174404631023703 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct i32_3_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; i32_3_1(Kokkos::View* data_): data{data_} {}; }; struct i32_4_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; i32_4_1(Kokkos::View* data_): data{data_} {}; }; // Forward declarations namespace { } // Implementations namespace { void main2() { Kokkos::View a_data("a_data", 3); i32_3_1 a_value(&a_data); i32_3_1* a = &a_value; a->dims[0].lower_bound = 1; a->dims[0].length = 3; Kokkos::View b_data("b_data", 4); i32_4_1 b_value(&b_data); i32_4_1* b = &b_value; b->dims[0].lower_bound = 1; b->dims[0].length = 4; int32_t i; for (i=1; i<=3; i++) { a->data->operator[](i - a->dims[0].lower_bound) = i + 10; } if (a->data->operator[](1 - a->dims[0].lower_bound) != 11) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (a->data->operator[](2 - a->dims[0].lower_bound) != 12) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (a->data->operator[](3 - a->dims[0].lower_bound) != 13) { std::cerr << "ERROR STOP" << std::endl; exit(1); } for (i=11; i<=14; i++) { b->data->operator[](i - 10 - b->dims[0].lower_bound) = i; } if (b->data->operator[](1 - b->dims[0].lower_bound) != 11) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (b->data->operator[](2 - b->dims[0].lower_bound) != 12) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (b->data->operator[](3 - b->dims[0].lower_bound) != 13) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (b->data->operator[](4 - b->dims[0].lower_bound) != 14) { std::cerr << "ERROR STOP" << std::endl; exit(1); } for (i=1; i<=3; i++) { b->data->operator[](i - b->dims[0].lower_bound) = a->data->operator[](i - a->dims[0].lower_bound) - 10; } if (b->data->operator[](1 - b->dims[0].lower_bound) != 1) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (b->data->operator[](2 - b->dims[0].lower_bound) != 2) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (b->data->operator[](3 - b->dims[0].lower_bound) != 3) { std::cerr << "ERROR STOP" << std::endl; exit(1); } b->data->operator[](4 - b->dims[0].lower_bound) = b->data->operator[](1 - b->dims[0].lower_bound) + b->data->operator[](2 - b->dims[0].lower_bound) + b->data->operator[](3 - b->dims[0].lower_bound) + a->data->operator[](1 - a->dims[0].lower_bound); if (b->data->operator[](4 - b->dims[0].lower_bound) != 17) { std::cerr << "ERROR STOP" << std::endl; exit(1); } b->data->operator[](4 - b->dims[0].lower_bound) = a->data->operator[](1 - a->dims[0].lower_bound); if (b->data->operator[](4 - b->dims[0].lower_bound) != 11) { std::cerr << "ERROR STOP" << std::endl; exit(1); } } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/llvm-complex_sub_test-7959339.stdout0000664000175000017500000001645115174404631025374 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> %complex_4 = type <{ float, float }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc4 = alloca %string_descriptor, align 8 %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca %complex_4, align 8 store %complex_4 <{ float 3.000000e+00, float 4.000000e+00 }>, %complex_4* %x, align 1 %3 = load %complex_4, %complex_4* %x, align 1 %4 = extractvalue %complex_4 %3, 0 %5 = extractvalue %complex_4 %3, 1 %6 = fsub float %4, 4.000000e+00 %7 = fsub float %5, 0.000000e+00 %8 = insertvalue %complex_4 undef, float %6, 0 %9 = insertvalue %complex_4 %8, float %7, 1 store %complex_4 %9, %complex_4* %x, align 1 %10 = load %complex_4, %complex_4* %x, align 1 %11 = extractvalue %complex_4 %10, 0 %12 = extractvalue %complex_4 %10, 1 %13 = fsub float 4.000000e+00, %11 %14 = fsub float 0.000000e+00, %12 %15 = insertvalue %complex_4 undef, float %13, 0 %16 = insertvalue %complex_4 %15, float %14, 1 store %complex_4 %16, %complex_4* %x, align 1 %17 = alloca i64, align 8 %18 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info, i32 0, i32 0), i64* %17, i32 0, i32 0, i32 0, i32 0, i32 0, %complex_4* %x) %19 = load i64, i64* %17, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %18, i8** %20, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %19, i64* %21, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %23 = load i8*, i8** %22, align 8 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %25 = load i64, i64* %24, align 8 %26 = trunc i64 %25 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %23, i32 %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %27 = icmp eq i8* %18, null br i1 %27, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %18) br label %free_done free_done: ; preds = %free_nonnull, %.entry %28 = load %complex_4, %complex_4* %x, align 1 %29 = extractvalue %complex_4 %28, 0 %30 = extractvalue %complex_4 %28, 1 %31 = fsub float 2.000000e+00, %29 %32 = fsub float 0.000000e+00, %30 %33 = insertvalue %complex_4 undef, float %31, 0 %34 = insertvalue %complex_4 %33, float %32, 1 store %complex_4 %34, %complex_4* %x, align 1 %35 = alloca i64, align 8 %36 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.1, i32 0, i32 0), i64* %35, i32 0, i32 0, i32 0, i32 0, i32 0, %complex_4* %x) %37 = load i64, i64* %35, align 8 %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %36, i8** %38, align 8 %39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %37, i64* %39, align 8 %40 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %41 = load i8*, i8** %40, align 8 %42 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %43 = load i64, i64* %42, align 8 %44 = trunc i64 %43 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %41, i32 %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %45 = icmp eq i8* %36, null br i1 %45, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %2, i8* %36) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %46 = load %complex_4, %complex_4* %x, align 1 %47 = extractvalue %complex_4 %46, 0 %48 = extractvalue %complex_4 %46, 1 %49 = fsub float %47, 0.000000e+00 %50 = fsub float %48, 3.000000e+00 %51 = insertvalue %complex_4 undef, float %49, 0 %52 = insertvalue %complex_4 %51, float %50, 1 store %complex_4 %52, %complex_4* %x, align 1 %53 = alloca i64, align 8 %54 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.2, i32 0, i32 0), i64* %53, i32 0, i32 0, i32 0, i32 0, i32 0, %complex_4* %x) %55 = load i64, i64* %53, align 8 %56 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %54, i8** %56, align 8 %57 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %55, i64* %57, align 8 %58 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %59 = load i8*, i8** %58, align 8 %60 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %61 = load i64, i64* %60, align 8 %62 = trunc i64 %61 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %59, i32 %62, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %63 = icmp eq i8* %54, null br i1 %63, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free_alloc(i8* %2, i8* %54) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 br label %return return: ; preds = %free_done6 br label %FINALIZE_SYMTABLE_complex2 FINALIZE_SYMTABLE_complex2: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-arrays_08_func-2759ced.stdout0000664000175000017500000007075315174404631024666 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_08_func: (Program (SymbolTable 2 { copy_from_to: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] Out () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) copy_from_to (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray ) (Array (Integer 4) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b)] [(DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 3 a) () (Integer 4) () ) ()) [(Assignment (ArrayItem (Var 3 b) [(() (Var 3 i) ())] (Integer 4) ColMajor () ) (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4) ColMajor () ) () .false. .false. )] [] )] () Public .true. .true. () ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 2 r [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), verify: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 4 r [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) verify (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray ) (Array (Integer 4) [(() ())] DescriptorArray )] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a) (Var 4 b)] [(Assignment (Var 4 r) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (DoLoop () ((Var 4 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 4 a) () (Integer 4) () ) ()) [(Assignment (Var 4 r) (LogicalBinOp (Var 4 r) And (IntegerCompare (ArrayItem (Var 4 a) [(() (Var 4 i) ())] (Integer 4) ColMajor () ) Eq (ArrayItem (Var 4 b) [(() (Var 4 i) ())] (Integer 4) ColMajor () ) (Logical 4) () ) (Logical 4) () ) () .false. .false. )] [] )] (Var 4 r) Public .true. .true. () ), x: (Variable 2 x [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) arrays_08_func [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 2 x) () (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) ) ()) [(Assignment (ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. )] [] ) (SubroutineCall 2 copy_from_to () [((ArrayPhysicalCast (Var 2 x) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 2 y) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] () .false. ) (Assignment (Var 2 r) (FunctionCall 2 verify () [((ArrayPhysicalCast (Var 2 x) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 2 y) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Logical 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 2 r)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (LogicalNot (Var 2 r) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-class_04-285a1df.stdout0000664000175000017500000007227115174404631023440 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { 1_bar_a_a: (ExternalSymbol 2 1_bar_a_a 3 a bar_a [] a Public ), 1_bar_b_b: (ExternalSymbol 2 1_bar_b_b 5 b bar_b [] b Public ), 1_bar_c_c: (ExternalSymbol 2 1_bar_c_c 6 c bar_c [] c Public ), 1_foo_a_m_bar_a: (ExternalSymbol 2 1_foo_a_m_bar_a 4 m_bar_a foo_a [] m_bar_a Public ), 1_foo_b_m_bar_b: (ExternalSymbol 2 1_foo_b_m_bar_b 7 m_bar_b foo_b [] m_bar_b Public ), 1_foo_c_m_bar_c: (ExternalSymbol 2 1_foo_c_m_bar_c 8 m_bar_c foo_c [] m_bar_c Public ), bar_a: (Struct (SymbolTable 3 { a: (Variable 3 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) bar_a (StructType [(Integer 4)] [] .true. .false. ) [] [a] [] Source Public .false. .false. [] () () [] ), bar_b: (Struct (SymbolTable 5 { b: (Variable 5 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) bar_b (StructType [(Integer 4)] [] .true. .false. ) [] [b] [] Source Public .false. .false. [] () 2 bar_a [] ), bar_c: (Struct (SymbolTable 6 { c: (Variable 6 c [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) bar_c (StructType [(Integer 4)] [] .true. .false. ) [] [c] [] Source Public .false. .false. [] () 2 bar_b [] ), foo: (Variable 2 foo [] Local () () Default (StructType [(StructType [(Integer 4)] [] .true. .false. )] [] .true. .false. ) 2 foo_c Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), foo_a: (Struct (SymbolTable 4 { m_bar_a: (Variable 4 m_bar_a [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 bar_a Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) foo_a (StructType [(StructType [(Integer 4)] [] .true. .false. )] [] .true. .false. ) [bar_a] [m_bar_a] [] Source Public .false. .false. [] () () [] ), foo_b: (Struct (SymbolTable 7 { m_bar_b: (Variable 7 m_bar_b [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 bar_b Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) foo_b (StructType [(StructType [(Integer 4)] [] .true. .false. )] [] .true. .false. ) [bar_b] [m_bar_b] [] Source Public .false. .false. [] () 2 foo_a [] ), foo_c: (Struct (SymbolTable 8 { m_bar_c: (Variable 8 m_bar_c [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 bar_c Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) foo_c (StructType [(StructType [(Integer 4)] [] .true. .false. )] [] .true. .false. ) [bar_c] [m_bar_c] [] Source Public .false. .false. [] () 2 foo_b [] ) }) main [] [(Assignment (StructInstanceMember (StructInstanceMember (Var 2 foo) 2 1_foo_a_m_bar_a (StructType [(Integer 4)] [] .true. .false. ) () ) 2 1_bar_a_a (Integer 4) () ) (IntegerUnaryMinus (IntegerConstant 20 (Integer 4) Decimal) (Integer 4) (IntegerConstant -20 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (StructInstanceMember (StructInstanceMember (Var 2 foo) 2 1_foo_b_m_bar_b (StructType [(Integer 4)] [] .true. .false. ) () ) 2 1_bar_b_b (Integer 4) () ) (IntegerConstant 9 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (StructInstanceMember (Var 2 foo) 2 1_foo_c_m_bar_c (StructType [(Integer 4)] [] .true. .false. ) () ) 2 1_bar_c_c (Integer 4) () ) (IntegerConstant 11 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(StructInstanceMember (StructInstanceMember (Var 2 foo) 2 1_foo_a_m_bar_a (StructType [(Integer 4)] [] .true. .false. ) () ) 2 1_bar_a_a (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StructInstanceMember (StructInstanceMember (Var 2 foo) 2 1_foo_b_m_bar_b (StructType [(Integer 4)] [] .true. .false. ) () ) 2 1_bar_b_b (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StructInstanceMember (StructInstanceMember (Var 2 foo) 2 1_foo_c_m_bar_c (StructType [(Integer 4)] [] .true. .false. ) () ) 2 1_bar_c_c (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (IntegerBinOp (IntegerBinOp (StructInstanceMember (StructInstanceMember (Var 2 foo) 2 1_foo_a_m_bar_a (StructType [(Integer 4)] [] .true. .false. ) () ) 2 1_bar_a_a (Integer 4) () ) Add (StructInstanceMember (StructInstanceMember (Var 2 foo) 2 1_foo_b_m_bar_b (StructType [(Integer 4)] [] .true. .false. ) () ) 2 1_bar_b_b (Integer 4) () ) (Integer 4) () ) Add (StructInstanceMember (StructInstanceMember (Var 2 foo) 2 1_foo_c_m_bar_c (StructType [(Integer 4)] [] .true. .false. ) () ) 2 1_bar_c_c (Integer 4) () ) (Integer 4) () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-template_travel_01-7f304df.stdout0000664000175000017500000006555415174404631025533 0ustar alastairalastair(TranslationUnit [(Module template_travel_01_math (TriviaNode [(EndOfLine) (EndOfLine)] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(add_real [] [] () () None ()) (slash_real [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Function add_real [(x) (y)] [(SimpleAttribute AttrPure )] total () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(x [] [] () () None ()) (y [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(total [] [] () () None ())] () )] [(Assignment 0 total (+ x y) () )] [] [] ) (Function slash_real [(x) (y)] [(SimpleAttribute AttrPure )] total () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(x [] [] () () None ()) (y [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(total [] [] () () None ())] () )] [(Assignment 0 total (/ x y) () )] [] [] )] ) (Module template_travel_01_travel (TriviaNode [(EndOfLine) (EndOfLine)] [(EndOfLine) (EndOfLine)] ) [(Use [] template_travel_01_math [] .false. () )] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(travel_tmpl [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Requirement operations [D T S plus_D plus_T D_divided_by_T D_divided_by_S] [(DerivedType D [] () [(SimpleAttribute AttrDeferred )] [] [] ) (DerivedType T [] () [(SimpleAttribute AttrDeferred )] [] [] ) (DerivedType S [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(SimpleAttribute AttrDeferred )] [] [] )] [(Function plus_D [(l) (r)] [(SimpleAttribute AttrPure )] total () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeType [] () D None ) [(AttrIntent In )] [(l [] [] () () None ()) (R [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () D None ) [] [(total [] [] () () None ())] () )] [] [] [] ) (Function plus_T [(l) (r)] [(SimpleAttribute AttrPure )] total () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeType [] () T None ) [(AttrIntent In )] [(l [] [] () () None ()) (R [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () T None ) [] [(total [] [] () () None ())] () )] [] [] [] ) (Function D_divided_by_T [(n) (d)] [(SimpleAttribute AttrPure )] quotient () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeType [] () D None ) [(AttrIntent In )] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () T None ) [(AttrIntent In )] [(d [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () S None ) [] [(quotient [] [] () () None ())] () )] [] [] [] ) (Function D_divided_by_S [(n) (d)] [(SimpleAttribute AttrPure )] quotient () () [] [] [] [(Declaration (AttrType TypeType [] () D None ) [(AttrIntent In )] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () S None ) [(AttrIntent In )] [(d [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () T None ) [] [(quotient [] [] () () None ())] () )] [] [] [] )] ) (Template travel_tmpl [D T S plus_D plus_T D_divided_by_T D_divided_by_S] [(Require [(UnitRequire operations [(AttrNamelist D ) (AttrNamelist T ) (AttrNamelist S ) (AttrNamelist plus_D ) (AttrNamelist plus_T ) (AttrNamelist D_divided_by_T ) (AttrNamelist D_divided_by_S )] )] ) (Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(avg_S_from_T [] [] () () None ())] () )] [(Function avg_S_from_T [(d1) (t1) (d2) (t2)] [(SimpleAttribute AttrPure )] avg () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeType [] () D None ) [(AttrIntent In )] [(d1 [] [] () () None ()) (d2 [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () T None ) [(AttrIntent In )] [(t1 [] [] () () None ()) (t2 [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () S None ) [] [(avg [] [] () () None ())] () )] [(Assignment 0 avg (FuncCallOrArray D_divided_by_T [] [(() (FuncCallOrArray plus_D [] [(() d1 () 0) (() d2 () 0)] [] [] [] ) () 0) (() (FuncCallOrArray plus_T [] [(() t1 () 0) (() t2 () 0)] [] [] [] ) () 0)] [] [] [] ) () )] [] [] ) (Function avg_S_from_S [(d1) (s1) (d2) (s2)] [(SimpleAttribute AttrPure )] avg () () [] [] [] [(Declaration (AttrType TypeType [] () D None ) [(AttrIntent In )] [(d1 [] [] () () None ()) (d2 [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () S None ) [(AttrIntent In )] [(s1 [] [] () () None ()) (s2 [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () S None ) [] [(avg [] [] () () None ())] () )] [(Assignment 0 avg (FuncCallOrArray avg_S_from_T [] [(() d1 () 0) (() (FuncCallOrArray D_divided_by_S [] [(() d1 () 0) (() s1 () 0)] [] [] [] ) () 0) (() d2 () 0) (() (FuncCallOrArray D_divided_by_S [] [(() d2 () 0) (() s2 () 0)] [] [] [] ) () 0)] [] [] [] ) () )] [] [] )] )] [] [] ) (Module template_travel_01_m (TriviaNode [(EndOfLine) (EndOfLine)] [(EndOfLine) (EndOfLine)] ) [(Use [] template_travel_01_math [] .false. () ) (Use [] template_travel_01_travel [] .false. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [(Subroutine test_template [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Instantiate travel_tmpl [(AttrType TypeReal [] () () None ) (AttrType TypeReal [] () () None ) (AttrType TypeReal [] () () None ) (AttrNamelist add_real ) (AttrNamelist add_real ) (AttrNamelist slash_real ) (AttrNamelist slash_real )] [(UseSymbol avg_S_from_T avg_real_S_from_T )] ) (Instantiate travel_tmpl [(AttrType TypeReal [] () () None ) (AttrType TypeReal [] () () None ) (AttrType TypeReal [] () () None ) (AttrNamelist add_real ) (AttrNamelist add_real ) (AttrNamelist slash_real ) (AttrNamelist slash_real )] [(UseSymbol avg_S_from_S avg_real_S_from_S )] ) (Declaration (AttrType TypeReal [] () () None ) [] [(s1 [] [] () () None ()) (s2 [] [] () () None ())] () )] [(Assignment 0 s1 (FuncCallOrArray avg_real_S_from_T [] [(() (Real "1.0") () 0) (() (Real "3.0") () 0) (() (Real "1.5") () 0) (() (Real "4.0") () 0)] [] [] [] ) () ) (Assignment 0 s2 (FuncCallOrArray avg_real_S_from_S [] [(() (Real "1.1") () 0) (() (Real "0.5") () 0) (() (Real "2.0") () 0) (() (Real "0.75") () 0)] [] [] [] ) () ) (Print 0 () [(String "s1=" ()) s1] () ) (Print 0 () [(String "s2=" ()) s2] () )] [] [] )] ) (Program template_travel_01 () [(Use [] template_travel_01_m [] .false. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(SubroutineCall 0 test_template [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/asr-implicit6-061f8e3.stderr0000664000175000017500000000025615174404631023625 0ustar alastairalastairstyle suggestion: Use complex(8) instead of complex*16 --> tests/implicit6.f90:3:17 | 3 | IMPLICIT COMPLEX*16 (C,Z) | ^ help: write this as 'complex(8)' lfortran-0.63.0/tests/reference/asr-cond_02-373a22a.stdout0000664000175000017500000004044415174404631023161 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cond_02: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ap: (Variable 2 ap [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), bp: (Variable 2 bp [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), cp: (Variable 2 cp [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dp: (Variable 2 dp [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cond_02 [] [(If () (IntegerCompare (Var 2 ap) Eq (Var 2 bp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "ap == bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (If () (RealCompare (Var 2 cp) Eq (Var 2 dp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "cp == dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (If () (IntegerCompare (Var 2 a) Eq (Var 2 b) (Logical 4) () ) [(Print (StringConstant "a == b" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (IntegerCompare (Var 2 ap) Eq (Var 2 bp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "ap == bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(If () (RealCompare (Cast (Var 2 ap) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) Eq (Var 2 cp) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(Print (StringConstant "ap == cp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (RealCompare (Var 2 cp) Eq (Var 2 dp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "cp == dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(If () (RealCompare (Var 2 c) Eq (Var 2 d) (Logical 4) () ) [(Print (StringConstant "c == d" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] )] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-global_scope5-a66d166.json0000664000175000017500000000073415174404631024113 0ustar alastairalastair{ "basename": "asr-global_scope5-a66d166", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope5.f90", "infile_hash": "63e512d3fe5d83aa6195002b9c31ddc77e1a93ac37df38989f782ed7", "outfile": null, "outfile_hash": null, "stdout": "asr-global_scope5-a66d166.stdout", "stdout_hash": "12c98c60b7f6bb801e736105508a465acb28152d55546ce4e4c1f369", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/c-program3-32749e4.stdout0000664000175000017500000000135715174404631023063 0ustar alastairalastair #include #include #include #include #include float func2(float a, float b); float func1(float a, float b); // Implementations float func2(float a, float b) { float c; c = a*b; return c; } float func1(float a, float b) { float c; c = a + b; c = func2(c, c); return c; } int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); float x; float y; float z; x = 5.00000000000000000e+00; y = 2.00000000000000000e+00; z = x*y; printf("%s%s%f\n", "10.0 ==", " ", z); z = func1(x, y); printf("%s%s%f\n", "49.0 ==", " ", z); z = func2(x, y); printf("%s%s%f\n", "10.0 ==", " ", z); return 0; } lfortran-0.63.0/tests/reference/asr-case_02-8557909.json0000664000175000017500000000073715174404631022471 0ustar alastairalastair{ "basename": "asr-case_02-8557909", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_02.f90", "infile_hash": "76d3020fba89787d565870ed03c1b5e8914d12b062cb9ca7a8c37550", "outfile": null, "outfile_hash": null, "stdout": "asr-case_02-8557909.stdout", "stdout_hash": "168cae4fe0864f6472e7bcfed0b4d907094ab53112d4f821f86d3078", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-scalar_allocation_check_06-2a9502c.json0000664000175000017500000000076215174404631026521 0ustar alastairalastair{ "basename": "run-scalar_allocation_check_06-2a9502c", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/scalar_allocation_check_06.f90", "infile_hash": "23810657fc4e5777acd91a7cce76b5b3bb2e5e3ff87d25d44e4d80fa", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-scalar_allocation_check_06-2a9502c.stderr", "stderr_hash": "3c197fa443d7537e7d1d998f10c5d6a42f04bf6446b1302b0ef50077", "returncode": 1 }lfortran-0.63.0/tests/reference/llvm-types_02-b5bfe0b.json0000664000175000017500000000074515174404631023441 0ustar alastairalastair{ "basename": "llvm-types_02-b5bfe0b", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/types_02.f90", "infile_hash": "6b9728dd8c74663d697504a17537aef00ed9210bf24fae6e7e0468bc", "outfile": null, "outfile_hash": null, "stdout": "llvm-types_02-b5bfe0b.stdout", "stdout_hash": "e60e0140a59db2b5e59c3411ba8fa6b6d01e71704875d19e03e567a4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-real8_1-0d3012c.json0000664000175000017500000000074015174404631022606 0ustar alastairalastair{ "basename": "ast-real8_1-0d3012c", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/real8_1.f", "infile_hash": "be9ee08ef54c70bc74135fbbf926577a888f76aac13a389a473443e0", "outfile": null, "outfile_hash": null, "stdout": "ast-real8_1-0d3012c.stdout", "stdout_hash": "cc6dd5bf201f435e156c3d2b2b24105dddb3c8bfbce24357c0ee2788", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_48-6cf0505.stdout0000664000175000017500000031547215174404631023734 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_48: (Program (SymbolTable 8 { 1_string_t_s: (ExternalSymbol 8 1_string_t_s 3 s string_t [] s Public ), cat_str_alloc: (Variable 8 cat_str_alloc [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), char_str: (Variable 8 char_str [] Local () () Default (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), char_str_alloc: (Variable 8 char_str_alloc [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), char_str_hash1: (Variable 8 char_str_hash1 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), char_str_hash2: (Variable 8 char_str_hash2 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), char_str_hash3: (Variable 8 char_str_hash3 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), char_str_hash4: (Variable 8 char_str_hash4 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), fnv_1a: (ExternalSymbol 8 fnv_1a 2 fnv_1a modules_48_fpm_strings [] fnv_1a Public ), fnv_1a@fnv_1a_char: (ExternalSymbol 8 fnv_1a@fnv_1a_char 2 fnv_1a_char modules_48_fpm_strings [] fnv_1a_char Private ), fnv_1a_char: (ExternalSymbol 8 fnv_1a_char 2 fnv_1a_char modules_48_fpm_strings [] fnv_1a_char Public ), fnv_1a_string_t: (ExternalSymbol 8 fnv_1a_string_t 2 fnv_1a_string_t modules_48_fpm_strings [] fnv_1a_string_t Public ), is_fortran_name: (ExternalSymbol 8 is_fortran_name 2 is_fortran_name modules_48_fpm_strings [] is_fortran_name Public ), string_cat: (ExternalSymbol 8 string_cat 2 string_cat modules_48_fpm_strings [] string_cat Public ), string_t: (ExternalSymbol 8 string_t 2 string_t modules_48_fpm_strings [] string_t Public ), string_var: (Variable 8 string_var [] Local () () Default (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) 8 string_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) modules_48 [modules_48_fpm_strings] [(Allocate [((Var 8 char_str_alloc) [] (IntegerConstant 40 (Integer 4) Decimal) () (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString))] () () () ) (Assignment (Var 8 char_str_alloc) (StringConstant "runningmodules_48_1" (String 1 (IntegerConstant 19 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (StructInstanceMember (ArrayItem (Var 8 string_var) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ) 8 1_string_t_s (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 8 char_str_alloc) () .false. .false. ) (Assignment (Var 8 char_str) (StringConstant "runningmodules_48_2" (String 1 (IntegerConstant 19 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (StructInstanceMember (ArrayItem (Var 8 string_var) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ) 8 1_string_t_s (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 8 char_str) () .false. .false. ) (Assignment (Var 8 char_str_hash1) (FunctionCall 8 fnv_1a@fnv_1a_char 8 fnv_1a [((Var 8 char_str)) ((IntegerConstant 2166136261 (Integer 8) Decimal))] (Integer 8) () () ) () .false. .false. ) (Assignment (Var 8 char_str_hash2) (FunctionCall 8 fnv_1a@fnv_1a_char 8 fnv_1a [((Var 8 char_str)) (())] (Integer 8) () () ) () .false. .false. ) (Print (StringFormat () [(Var 8 char_str_hash1) (Var 8 char_str_hash2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 8 char_str_hash1) NotEq (Var 8 char_str_hash2) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 8 char_str_hash3) (FunctionCall 8 fnv_1a_string_t () [((ArrayPhysicalCast (Var 8 string_var) FixedSizeArray DescriptorArray (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )) ((IntegerConstant 2166136261 (Integer 8) Decimal))] (Integer 8) () () ) () .false. .false. ) (Assignment (Var 8 char_str_hash4) (FunctionCall 8 fnv_1a_string_t () [((ArrayPhysicalCast (Var 8 string_var) FixedSizeArray DescriptorArray (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )) (())] (Integer 8) () () ) () .false. .false. ) (Print (StringFormat () [(Var 8 char_str_hash3) (Var 8 char_str_hash4)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 8 char_str_hash3) NotEq (Var 8 char_str_hash4) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 8 cat_str_alloc) (FunctionCall 8 string_cat () [((ArrayPhysicalCast (Var 8 string_var) FixedSizeArray DescriptorArray (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )) ((StringConstant ":" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (Allocatable (String 1 () DeferredLength DescriptorString) ) () () ) () .false. .false. ) (Print (StringFormat () [(Var 8 cat_str_alloc) (FunctionCall 8 is_fortran_name () [((Var 8 cat_str_alloc))] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (StringCompare (Var 8 cat_str_alloc) NotEq (StringConstant "runningmodules_48_1:runningmodules_48_2" (String 1 (IntegerConstant 39 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (FunctionCall 8 is_fortran_name () [((Var 8 cat_str_alloc))] (Logical 4) () () ) [(ErrorStop () )] [] ) (Assignment (Var 8 cat_str_alloc) (FunctionCall 8 string_cat () [((ArrayPhysicalCast (Var 8 string_var) FixedSizeArray DescriptorArray (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )) (())] (Allocatable (String 1 () DeferredLength DescriptorString) ) () () ) () .false. .false. ) (Print (StringFormat () [(Var 8 cat_str_alloc) (FunctionCall 8 is_fortran_name () [((Var 8 cat_str_alloc))] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (StringCompare (Var 8 cat_str_alloc) NotEq (StringConstant "runningmodules_48_1runningmodules_48_2" (String 1 (IntegerConstant 38 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalNot (FunctionCall 8 is_fortran_name () [((Var 8 cat_str_alloc))] (Logical 4) () () ) (Logical 4) () ) [(ErrorStop () )] [] )] ), modules_48_fpm_strings: (Module (SymbolTable 2 { fnv_1a: (GenericProcedure 2 fnv_1a [2 fnv_1a_char 2 fnv_1a_string_t] Public ), fnv_1a_char: (Function (SymbolTable 4 { fnv_offset_32: (Variable 4 fnv_offset_32 [] Local (IntegerConstant 2166136261 (Integer 8) Decimal) (IntegerConstant 2166136261 (Integer 8) Decimal) Parameter (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), fnv_prime_32: (Variable 4 fnv_prime_32 [] Local (IntegerConstant 16777619 (Integer 8) Decimal) (IntegerConstant 16777619 (Integer 8) Decimal) Parameter (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), hash: (Variable 4 hash [] ReturnVar () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), input: (Variable 4 input [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), seed: (Variable 4 seed [] In () () Default (Integer 8) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fnv_1a_char (FunctionType [(String 1 () AssumedLength DescriptorString) (Integer 8)] (Integer 8) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 input) (Var 4 seed)] [(If () (IntrinsicElementalFunction Present [(Var 4 seed)] 0 (Logical 4) () ) [(Assignment (Var 4 hash) (Var 4 seed) () .false. .false. )] [(Assignment (Var 4 hash) (Var 4 fnv_offset_32) () .false. .false. )] ) (DoLoop () ((Var 4 i) (IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 4 input) (Integer 4) () ) ()) [(Assignment (Var 4 hash) (IntegerBinOp (IntrinsicElementalFunction Ieor [(Var 4 hash) (IntrinsicElementalFunction Iachar [(StringItem (Var 4 input) (Var 4 i) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () )] 0 (Integer 8) () )] 0 (Integer 8) () ) Mul (Var 4 fnv_prime_32) (Integer 8) () ) () .false. .false. )] [] )] (Var 4 hash) Public .true. .true. () ), fnv_1a_string_t: (Function (SymbolTable 5 { 1_string_t_s: (ExternalSymbol 5 1_string_t_s 3 s string_t [] s Public ), hash: (Variable 5 hash [] ReturnVar () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), input: (Variable 5 input [] In () () Default (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) 2 string_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), seed: (Variable 5 seed [] In () () Default (Integer 8) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fnv_1a_string_t (FunctionType [(Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) (Integer 8)] (Integer 8) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [fnv_1a_char] [(Var 5 input) (Var 5 seed)] [(Assignment (Var 5 hash) (FunctionCall 2 fnv_1a_char 2 fnv_1a [((StructInstanceMember (ArrayItem (Var 5 input) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ) 5 1_string_t_s (Allocatable (String 1 () DeferredLength DescriptorString) ) () )) ((Var 5 seed))] (Integer 8) () () ) () .false. .false. ) (DoLoop () ((Var 5 i) (IntegerConstant 2 (Integer 4) Decimal) (ArraySize (Var 5 input) () (Integer 4) () ) ()) [(Assignment (Var 5 hash) (FunctionCall 2 fnv_1a_char 2 fnv_1a [((StructInstanceMember (ArrayItem (Var 5 input) [(() (Var 5 i) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ) 5 1_string_t_s (Allocatable (String 1 () DeferredLength DescriptorString) ) () )) ((Var 5 hash))] (Integer 8) () () ) () .false. .false. )] [] )] (Var 5 hash) Public .true. .true. () ), is_fortran_name: (Function (SymbolTable 6 { allowed: (Variable 6 allowed [upper lower int] Local (IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(Var 6 upper) (Var 6 lower)] 0 (String 1 (IntegerConstant 52 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" (String 1 (IntegerConstant 52 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (Var 6 int)] 0 (String 1 (IntegerConstant 62 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" (String 1 (IntegerConstant 62 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "_" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 63 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_" (String 1 (IntegerConstant 63 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_" (String 1 (IntegerConstant 63 (Integer 8) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 63 (Integer 8) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), int: (Variable 6 int [] Local (StringConstant "0123456789" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "0123456789" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), line: (Variable 6 line [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lout: (Variable 6 lout [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lower: (Variable 6 lower [] Local (StringConstant "abcdefghijklmnopqrstuvwxyz" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "abcdefghijklmnopqrstuvwxyz" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), name: (Variable 6 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), upper: (Variable 6 upper [] Local (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) is_fortran_name (FunctionType [(String 1 () AssumedLength DescriptorString)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 line)] [(Assignment (Var 6 name) (IntrinsicElementalFunction StringTrim [(Var 6 line)] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) () .false. .false. ) (If () (IntegerCompare (StringLen (Var 6 name) (Integer 4) () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 6 lout) (LogicalBinOp (LogicalBinOp (LogicalBinOp (LogicalConstant .true. (Logical 4) ) And (IntegerCompare (IntrinsicElementalFunction StringContainsSet [(StringSection (Var 6 name) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () ) (IntrinsicElementalFunction StringConcat [(Var 6 lower) (Var 6 upper)] 0 (String 1 (IntegerConstant 52 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" (String 1 (IntegerConstant 52 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) And (IntegerCompare (IntrinsicElementalFunction StringContainsSet [(Var 6 name) (Var 6 allowed) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) And (IntegerCompare (StringLen (Var 6 name) (Integer 4) () ) LtE (IntegerConstant 63 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) () .false. .false. )] [(Assignment (Var 6 lout) (LogicalConstant .false. (Logical 4) ) () .false. .false. )] )] (Var 6 lout) Public .true. .true. () ), string_cat: (Function (SymbolTable 7 { 1_string_t_s: (ExternalSymbol 7 1_string_t_s 3 s string_t [] s Public ), cat: (Variable 7 cat [] ReturnVar () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), delim: (Variable 7 delim [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), delim_str: (Variable 7 delim_str [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 7 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), strings: (Variable 7 strings [] In () () Default (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) 2 string_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_cat (FunctionType [(Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) (String 1 () AssumedLength DescriptorString)] (Allocatable (String 1 () DeferredLength DescriptorString) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 strings) (Var 7 delim)] [(If () (IntegerCompare (ArraySize (Var 7 strings) () (Integer 4) () ) Lt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 7 cat) (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Return)] [] ) (If () (IntrinsicElementalFunction Present [(Var 7 delim)] 0 (Logical 4) () ) [(Assignment (Var 7 delim_str) (Var 7 delim) () .false. .false. )] [(Assignment (Var 7 delim_str) (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. )] ) (Assignment (Var 7 cat) (StructInstanceMember (ArrayItem (Var 7 strings) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ) 7 1_string_t_s (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) () .false. .false. ) (DoLoop () ((Var 7 i) (IntegerConstant 2 (Integer 4) Decimal) (ArraySize (Var 7 strings) () (Integer 4) () ) ()) [(Assignment (Var 7 cat) (IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(Var 7 cat) (Var 7 delim_str)] 0 (String 1 () DeferredLength DescriptorString) () ) (StructInstanceMember (ArrayItem (Var 7 strings) [(() (Var 7 i) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ) 7 1_string_t_s (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (String 1 () DeferredLength DescriptorString) () ) () .false. .false. )] [] )] (Var 7 cat) Public .true. .true. () ), string_t: (Struct (SymbolTable 3 { s: (Variable 3 s [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [s] [] Source Public .false. .false. [] () () [] ) }) modules_48_fpm_strings () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-arrays_reshape_14-913f34e.stdout0000664000175000017500000040401115174404631025257 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array_reshape_14: (Program (SymbolTable 2 { i23: (Variable 2 i23 [] Local (ArrayReshape (ArrayConstant 24 [-14, 3, 0, -2, 19, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayPhysicalCast (ArrayConstant 8 [2, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) () () (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 24 [-14, 3, 0, -2, 19, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (ArrayConstant 24 [-14, 3, 0, -2, 19, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), test_1d_to_nd: (Function (SymbolTable 4 { a: (Variable 4 a [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 256 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 4 c [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 4 d [] Unspecified () () Default (Array (Real 8) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), eps: (Variable 4 eps [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 4 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 4 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 4 l [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), newshape: (Variable 4 newshape [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), newshape1: (Variable 4 newshape1 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_1d_to_nd (FunctionType [(Array (Real 8) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 d)] [(Assignment (Var 4 eps) (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) () .false. .false. ) (DoLoop () ((Var 4 k) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 256 (Integer 4) Decimal) ()) [(Assignment (Var 4 i) (IntegerBinOp (IntegerBinOp (Var 4 k) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Div (IntegerConstant 16 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 4 j) (IntegerBinOp (IntegerBinOp (Var 4 k) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerBinOp (Var 4 i) Mul (IntegerConstant 16 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 4 b) [(() (Var 4 k) ())] (Real 8) ColMajor () ) (Cast (RealBinOp (Cast (IntegerBinOp (Var 4 i) Add (Var 4 j) (Integer 4) () ) IntegerToReal (Real 4) () () ) Add (RealConstant 0.500000 (Real 4) ) (Real 4) () ) RealToReal (Real 8) () () ) () .false. .false. )] [] ) (Assignment (ArrayItem (Var 4 newshape) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 16 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 4 newshape) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 16 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 4 a) (ArrayReshape (Var 4 b) (ArrayPhysicalCast (Var 4 newshape) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) () () (Array (Real 8) [(() ()) (() ())] FixedSizeArray ) () ) () .false. .false. ) (DoLoop () ((Var 4 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(DoLoop () ((Var 4 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 4 a) [(() (Var 4 i) ()) (() (Var 4 j) ())] (Real 8) ColMajor () ) Sub (Cast (IntegerBinOp (Var 4 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () () ) (Real 8) () ) Sub (Cast (IntegerBinOp (Var 4 j) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () () ) (Real 8) () ) Sub (Cast (RealConstant 0.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.500000 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) Gt (Var 4 eps) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] ) (Assignment (ArrayItem (Var 4 newshape1) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 16 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 4 newshape1) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 16 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 4 newshape1) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 16 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 4 c) (ArrayReshape (Var 4 d) (ArrayPhysicalCast (Var 4 newshape1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () ) () () (Array (Real 8) [(() ()) (() ()) (() ())] DescriptorArray ) () ) () .false. .false. ) (DoLoop () ((Var 4 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(DoLoop () ((Var 4 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(DoLoop () ((Var 4 k) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 8) ColMajor () ) Sub (Cast (IntegerBinOp (Var 4 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () () ) (Real 8) () ) Sub (Cast (IntegerBinOp (Var 4 j) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () () ) (Real 8) () ) Sub (Cast (IntegerBinOp (Var 4 k) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () () ) (Real 8) () ) Sub (Cast (RealConstant 0.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.500000 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) Gt (Var 4 eps) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] )] [] )] () Public .true. .true. () ), test_nd_to_1d: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Array (Real 8) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 256 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 3 c [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 3 d [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4096 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), eps: (Variable 3 eps [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 3 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 3 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 3 l [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), newshape: (Variable 3 newshape [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), newshape1: (Variable 3 newshape1 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_nd_to_1d (FunctionType [(Array (Real 8) [(() ()) (() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Assignment (Var 3 eps) (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) () .false. .false. ) (Assignment (ArrayItem (Var 3 newshape) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 256 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 b) (ArrayReshape (Var 3 a) (ArrayPhysicalCast (Var 3 newshape) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] DescriptorArray ) () ) () () (Array (Real 8) [(() ())] DescriptorArray ) () ) () .false. .false. ) (DoLoop () ((Var 3 k) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 256 (Integer 4) Decimal) ()) [(Assignment (Var 3 i) (IntegerBinOp (IntegerBinOp (Var 3 k) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Div (IntegerConstant 16 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 3 j) (IntegerBinOp (IntegerBinOp (Var 3 k) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerBinOp (Var 3 i) Mul (IntegerConstant 16 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 3 b) [(() (Var 3 k) ())] (Real 8) ColMajor () ) Sub (Cast (Var 3 i) IntegerToReal (Real 8) () () ) (Real 8) () ) Sub (Cast (Var 3 j) IntegerToReal (Real 8) () () ) (Real 8) () ) Sub (Cast (RealConstant 0.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.500000 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) Gt (Var 3 eps) (Logical 4) () ) [(ErrorStop () )] [] )] [] ) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(DoLoop () ((Var 3 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(DoLoop () ((Var 3 k) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Real 8) ColMajor () ) (Cast (RealBinOp (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Add (IntegerBinOp (Var 3 j) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) Add (IntegerBinOp (Var 3 k) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) IntegerToReal (Real 4) () () ) Add (RealConstant 0.500000 (Real 4) ) (Real 4) () ) RealToReal (Real 8) () () ) () .false. .false. )] [] )] [] )] [] ) (Assignment (ArrayItem (Var 3 newshape1) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 4096 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 d) (ArrayReshape (Var 3 c) (ArrayPhysicalCast (Var 3 newshape1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] DescriptorArray ) () ) () () (Array (Real 8) [(() ())] FixedSizeArray ) () ) () .false. .false. ) (DoLoop () ((Var 3 l) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4096 (Integer 4) Decimal) ()) [(Assignment (Var 3 i) (IntegerBinOp (IntegerBinOp (Var 3 l) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Div (IntegerConstant 256 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 3 j) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 l) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerBinOp (Var 3 i) Mul (IntegerConstant 256 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) Div (IntegerConstant 16 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 3 k) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 l) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerBinOp (Var 3 i) Mul (IntegerConstant 256 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) Sub (IntegerBinOp (Var 3 j) Mul (IntegerConstant 16 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 3 d) [(() (Var 3 l) ())] (Real 8) ColMajor () ) Sub (Cast (Var 3 i) IntegerToReal (Real 8) () () ) (Real 8) () ) Sub (Cast (Var 3 j) IntegerToReal (Real 8) () () ) (Real 8) () ) Sub (Cast (Var 3 k) IntegerToReal (Real 8) () () ) (Real 8) () ) Sub (Cast (RealConstant 0.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.500000 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) Gt (Var 3 eps) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] () Public .true. .true. () ), test_reshape_with_argument: (Function (SymbolTable 5 { a: (Variable 5 a [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 5 d [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4096 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 5 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 5 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 5 l [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_reshape_with_argument (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [test_nd_to_1d test_1d_to_nd] [] [(DoLoop () ((Var 5 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(DoLoop () ((Var 5 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 5 a) [(() (Var 5 i) ()) (() (Var 5 j) ())] (Real 8) ColMajor () ) (Cast (RealBinOp (Cast (IntegerBinOp (IntegerBinOp (Var 5 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Add (IntegerBinOp (Var 5 j) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) IntegerToReal (Real 4) () () ) Add (RealConstant 0.500000 (Real 4) ) (Real 4) () ) RealToReal (Real 8) () () ) () .false. .false. )] [] )] [] ) (SubroutineCall 2 test_nd_to_1d () [((ArrayPhysicalCast (Var 5 a) FixedSizeArray DescriptorArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal))] DescriptorArray ) () ))] () .false. ) (DoLoop () ((Var 5 l) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4096 (Integer 4) Decimal) ()) [(Assignment (Var 5 i) (IntegerBinOp (IntegerBinOp (Var 5 l) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Div (IntegerConstant 256 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 5 j) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 5 l) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerBinOp (Var 5 i) Mul (IntegerConstant 256 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) Div (IntegerConstant 16 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 5 k) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 5 l) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerBinOp (Var 5 i) Mul (IntegerConstant 256 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) Sub (IntegerBinOp (Var 5 j) Mul (IntegerConstant 16 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 5 d) [(() (Var 5 l) ())] (Real 8) ColMajor () ) (Cast (RealBinOp (Cast (IntegerBinOp (IntegerBinOp (Var 5 i) Add (Var 5 j) (Integer 4) () ) Add (Var 5 k) (Integer 4) () ) IntegerToReal (Real 4) () () ) Add (RealConstant 0.500000 (Real 4) ) (Real 4) () ) RealToReal (Real 8) () () ) () .false. .false. )] [] ) (SubroutineCall 2 test_1d_to_nd () [((ArrayPhysicalCast (Var 5 d) FixedSizeArray DescriptorArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4096 (Integer 4) Decimal))] DescriptorArray ) () ))] () .false. )] () Public .true. .true. () ) }) array_reshape_14 [] [(Print (StringFormat () [(Var 2 i23)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 2 test_reshape_with_argument () [] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-modules_06-609dd30.json0000664000175000017500000000075015174404631023344 0ustar alastairalastair{ "basename": "asr-modules_06-609dd30", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_06.f90", "infile_hash": "ffed6acf9a41c361cf70e0d7be27fb220ad99d98ab607fce09d93992", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_06-609dd30.stdout", "stdout_hash": "78d303b88a7db29d7d8066f5a61c8923beeaf4a4aac33947dec05c74", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-matmul_unallocated_01-39026d3.json0000664000175000017500000000074315174404631025503 0ustar alastairalastair{ "basename": "run-matmul_unallocated_01-39026d3", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/matmul_unallocated_01.f90", "infile_hash": "69fa6b271c924d4944c45f3f5d8f6a569ff838a441c57aa9cbb649e0", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-matmul_unallocated_01-39026d3.stderr", "stderr_hash": "c1863601fd5b1eee893a7be2d65ef39d8dfbff4f681c8816d8750826", "returncode": 1 }lfortran-0.63.0/tests/reference/run-array_shape_05-429216b.stderr0000664000175000017500000000045215174404631024461 0ustar alastairalastairruntime error: Array shape mismatch in assignment to 'a'. Tried to match size 2 of dimension 1 of LHS with size 1 of dimension 1 of RHS. --> tests/errors/array_shape_05.f90:10:5 | 10 | a = temp(i:j) | ^ LHS size is 2 | 10 | a = temp(i:j) | ^^^^^^^^^ RHS size is 1 lfortran-0.63.0/tests/reference/asr-template_03b-0778e50.json0000664000175000017500000000075615174404631023602 0ustar alastairalastair{ "basename": "asr-template_03b-0778e50", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_03b.f90", "infile_hash": "4285fa6069fdc8872b08ca46688ab8168abfe0c468a57c65818deeb6", "outfile": null, "outfile_hash": null, "stdout": "asr-template_03b-0778e50.stdout", "stdout_hash": "bf4b413abec9f438cee8009c228d337100ebf891eae6e44074ca7e64", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-min_01-aa661b0.stderr0000664000175000017500000000047615174404631023060 0ustar alastairalastairwarning: Different kinds of args in max0 is a non-standard extension --> tests/../integration_tests/min_01.f90:58:34 | 58 | output_min_different_kinds = min(real_inp5, real_inp6) | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: ensure all arguments have the same kind to make it standard lfortran-0.63.0/tests/reference/llvm-modules_13-6b5ac80.json0000664000175000017500000000075315174404631023611 0ustar alastairalastair{ "basename": "llvm-modules_13-6b5ac80", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_13.f90", "infile_hash": "4781335f29ad38af698fbda1884929e97755c6c34f445e65b30a36ed", "outfile": null, "outfile_hash": null, "stdout": "llvm-modules_13-6b5ac80.stdout", "stdout_hash": "34910404e9c193d158d695c0da043e1815c747512e40f3de8886eb3d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_39-f721e16.stdout0000664000175000017500000002262715174404631024451 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { test_time_and_date: (Program (SymbolTable 2 { date: (Variable 2 date [] Local () () Default (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), time: (Variable 2 time [] Local () () Default (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), values: (Variable 2 values [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zone: (Variable 2 zone [] Local () () Default (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_time_and_date [] [(IntrinsicImpureSubroutine DateAndTime [(Var 2 date) (Var 2 time) (Var 2 zone) (Var 2 values)] 0 ) (IntrinsicImpureSubroutine DateAndTime [(RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) )] 0 ) (IntrinsicImpureSubroutine DateAndTime [(Var 2 date) (RealConstant 1.000000 (Real 4) ) (Var 2 zone) (RealConstant 1.000000 (Real 4) )] 0 ) (IntrinsicImpureSubroutine DateAndTime [(RealConstant 1.000000 (Real 4) ) (Var 2 time) (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) )] 0 ) (IntrinsicImpureSubroutine DateAndTime [(RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) (Var 2 zone) (RealConstant 1.000000 (Real 4) )] 0 ) (IntrinsicImpureSubroutine DateAndTime [(Var 2 date) (Var 2 time) (Var 2 zone) (Var 2 values)] 0 ) (IntrinsicImpureSubroutine DateAndTime [(RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) (Var 2 values)] 0 ) (Print (StringFormat (StringConstant "(a,2x,a,2x,a)" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(Var 2 date) (Var 2 time) (Var 2 zone)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat (StringConstant "(8i5)" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(Var 2 values)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-external2-e21d7a5.stdout0000664000175000017500000001473115174404631023727 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { sub2: (Function (SymbolTable 4 { sub2_arg_0: (Variable 4 sub2_arg_0 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub2 (FunctionType [(Real 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 sub2_arg_0)] [] () Public .false. .false. () ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(FunctionType [] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 sub2)] [(SubroutineCall 2 sub2 () [((Var 2 x))] () .false. )] () Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-kind1-5b1b058.json0000664000175000017500000000071315174404631022371 0ustar alastairalastair{ "basename": "asr-kind1-5b1b058", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind1.f90", "infile_hash": "0371199c5e18fe208acf627b9787e9b7af72a2a6cccec7c29d42d866", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind1-5b1b058.stderr", "stderr_hash": "7e1ce52c707fb3ba57006a1526151811ab0ccd83c63e67f6901a17e0", "returncode": 2 }lfortran-0.63.0/tests/reference/wat-wasm_i64-3afdb24.json0000664000175000017500000000070015174404631023155 0ustar alastairalastair{ "basename": "wat-wasm_i64-3afdb24", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/wasm_i64.f90", "infile_hash": "9793bf432037540bb08d6e1429b2967f40f93c61e08901b587d2df2d", "outfile": null, "outfile_hash": null, "stdout": "wat-wasm_i64-3afdb24.stdout", "stdout_hash": "34529083b448f9f2c2b1d54e950f0dd60a6328bd40301a3e1ec1c19b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-string_54-2dbd7b1.stdout0000664000175000017500000003477515174404631023730 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_54: (Program (SymbolTable 5 { char: (Variable 5 char [] Local () () Default (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), double: (ExternalSymbol 5 double 2 double string_54_mod [] double Public ), double_: (ExternalSymbol 5 double_ 2 double_ string_54_mod [] double_ Public ), foo_sub: (ExternalSymbol 5 foo_sub 2 foo_sub string_54_mod [] foo_sub Public ), x: (Variable 5 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_54 [string_54_mod] [(Assignment (Var 5 x) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 5 foo_sub () [((Var 5 x)) ((Var 5 char))] () .false. )] ), string_54_mod: (Module (SymbolTable 2 { double: (GenericProcedure 2 double [2 double_] Public ), double_: (Function (SymbolTable 3 { ret: (Variable 3 ret [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) double_ (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [(Assignment (Var 3 ret) (IntegerBinOp (Var 3 x) Mul (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] (Var 3 ret) Public .true. .true. () ), foo_sub: (Function (SymbolTable 4 { char: (Variable 4 char [double_ x] Unspecified () () Default (String 1 (FunctionCall 2 double_ 2 double [((Var 4 x))] (Integer 4) () () ) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) foo_sub (FunctionType [(Integer 4) (String 1 (FunctionCall 2 double_ 2 double [((FunctionParam 0 (Integer 4) () ))] (Integer 4) () () ) ExpressionLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [double_] [(Var 4 x) (Var 4 char)] [] () Public .true. .true. () ) }) string_54_mod () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/llvm-subroutines_04-ba99aa1.json0000664000175000017500000000076715174404631024607 0ustar alastairalastair{ "basename": "llvm-subroutines_04-ba99aa1", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_04.f90", "infile_hash": "c7f14f3cfe8c42ebbf006f4e20a30b517c9e2775e5af0f8853ae05e1", "outfile": null, "outfile_hash": null, "stdout": "llvm-subroutines_04-ba99aa1.stdout", "stdout_hash": "031ff2f5f8a12f177dec0f17eb151b44d8212cd7fdd2ab251e04889d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-goto_01-f5b96fb.json0000664000175000017500000000073015174404631023326 0ustar alastairalastair{ "basename": "julia-goto_01-f5b96fb", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/goto_01.f90", "infile_hash": "a5108e90af7ae9a352b6ef368d3ccf4f3af85127a5ea50c9a937fe49", "outfile": null, "outfile_hash": null, "stdout": "julia-goto_01-f5b96fb.stdout", "stdout_hash": "3e679354658381502dd866afecd80e6005d5626b3ceb27253364e7b4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-where_03-a34eed8.stdout0000664000175000017500000010173015174404631023520 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 3 { }) main [] [(SubroutineCall 1 where_03 () [] () .false. )] ), where_03: (Function (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) where_03 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 a) (ArrayConstant 16 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00, 4.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 2 b) (ArrayConstant 16 [-1.00000000e+00, -2.00000000e+00, 5.00000000e+00, 7.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Where (RealCompare (Var 2 a) Gt (Var 2 b) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 a) (ArrayBroadcast (RealConstant 1.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [] ) (Where (RealCompare (Var 2 a) Eq (RealConstant 1.000000 (Real 4) ) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 a) (ArrayBroadcast (RealConstant 2.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [2.00000000e+00, 2.00000000e+00, 2.00000000e+00, 2.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(Where (RealCompare (Var 2 a) Eq (RealConstant 2.000000 (Real 4) ) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 b) (ArrayBroadcast (RealConstant 3.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [3.00000000e+00, 3.00000000e+00, 3.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(Assignment (Var 2 a) (RealBinOp (RealBinOp (RealBinOp (Var 2 b) Mul (ArrayBroadcast (RealConstant 2.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [2.00000000e+00, 2.00000000e+00, 2.00000000e+00, 2.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) Div (Var 2 a) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) Mul (ArrayBroadcast (RealConstant 3.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [3.00000000e+00, 3.00000000e+00, 3.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. )] )] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 2.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 2.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 10.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 10.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealUnaryMinus (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant -1.000000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealUnaryMinus (RealConstant 2.000000 (Real 4) ) (Real 4) (RealConstant -2.000000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 5.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 7.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 b)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/ast-interactive_parse_without_program_line-f2c0aaa.json0000664000175000017500000000104715174404631031625 0ustar alastairalastair{ "basename": "ast-interactive_parse_without_program_line-f2c0aaa", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/interactive_parse_without_program_line.f90", "infile_hash": "c68088b59370c4f5a2dc3747e3ca0c7de19d0210a92e2043fb975b96", "outfile": null, "outfile_hash": null, "stdout": "ast-interactive_parse_without_program_line-f2c0aaa.stdout", "stdout_hash": "c5cd726198fbd61cca4cda6b959996173a445e2640f44b18f7511de0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-doloop_01-a6563cb.stdout0000664000175000017500000010757115174404631024012 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @17 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.4 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @21 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.5 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @23 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @25 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.6 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @27 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @28 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @29 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.7 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @31 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @32 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @33 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @34 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.8 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @35 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @37 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.9 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @39 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @40 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @41 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.10 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @43 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc88 = alloca %string_descriptor, align 8 %stringFormat_desc79 = alloca %string_descriptor, align 8 %stringFormat_desc70 = alloca %string_descriptor, align 8 %stringFormat_desc61 = alloca %string_descriptor, align 8 %stringFormat_desc52 = alloca %string_descriptor, align 8 %stringFormat_desc43 = alloca %string_descriptor, align 8 %stringFormat_desc34 = alloca %string_descriptor, align 8 %stringFormat_desc25 = alloca %string_descriptor, align 8 %stringFormat_desc16 = alloca %string_descriptor, align 8 %stringFormat_desc7 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %j = alloca i32, align 4 store i32 0, i32* %j, align 4 store i32 0, i32* %i, align 4 br label %loop.head loop.head: ; preds = %loop.body, %.entry %3 = load i32, i32* %i, align 4 %4 = add i32 %3, 1 %5 = icmp sle i32 %4, 10 br i1 %5, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %6 = load i32, i32* %i, align 4 %7 = add i32 %6, 1 store i32 %7, i32* %i, align 4 %8 = load i32, i32* %j, align 4 %9 = load i32, i32* %i, align 4 %10 = add i32 %8, %9 store i32 %10, i32* %j, align 4 br label %loop.head loop.end: ; preds = %loop.head %11 = load i32, i32* %j, align 4 %12 = icmp ne i32 %11, 55 br i1 %12, label %then, label %else then: ; preds = %loop.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %loop.end br label %ifcont ifcont: ; preds = %else, %then %13 = alloca i64, align 8 %14 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %13, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %15 = load i64, i64* %13, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %14, i8** %16, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %15, i64* %17, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %19 = load i8*, i8** %18, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %21 = load i64, i64* %20, align 8 %22 = trunc i64 %21 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %19, i32 %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %23 = icmp eq i8* %14, null br i1 %23, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont call void @_lfortran_free_alloc(i8* %2, i8* %14) br label %free_done free_done: ; preds = %free_nonnull, %ifcont store i32 0, i32* %j, align 4 store i32 11, i32* %i, align 4 br label %loop.head1 loop.head1: ; preds = %loop.body2, %free_done %24 = load i32, i32* %i, align 4 %25 = add i32 %24, -1 %26 = icmp sge i32 %25, 1 br i1 %26, label %loop.body2, label %loop.end3 loop.body2: ; preds = %loop.head1 %27 = load i32, i32* %i, align 4 %28 = add i32 %27, -1 store i32 %28, i32* %i, align 4 %29 = load i32, i32* %j, align 4 %30 = load i32, i32* %i, align 4 %31 = add i32 %29, %30 store i32 %31, i32* %j, align 4 br label %loop.head1 loop.end3: ; preds = %loop.head1 %32 = load i32, i32* %j, align 4 %33 = icmp ne i32 %32, 55 br i1 %33, label %then4, label %else5 then4: ; preds = %loop.end3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont6 else5: ; preds = %loop.end3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 %34 = alloca i64, align 8 %35 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %34, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %36 = load i64, i64* %34, align 8 %37 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 store i8* %35, i8** %37, align 8 %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 store i64 %36, i64* %38, align 8 %39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 %40 = load i8*, i8** %39, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 %42 = load i64, i64* %41, align 8 %43 = trunc i64 %42 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %40, i32 %43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %44 = icmp eq i8* %35, null br i1 %44, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %ifcont6 call void @_lfortran_free_alloc(i8* %2, i8* %35) br label %free_done9 free_done9: ; preds = %free_nonnull8, %ifcont6 store i32 0, i32* %j, align 4 store i32 -1, i32* %i, align 4 br label %loop.head10 loop.head10: ; preds = %loop.body11, %free_done9 %45 = load i32, i32* %i, align 4 %46 = add i32 %45, 2 %47 = icmp sle i32 %46, 9 br i1 %47, label %loop.body11, label %loop.end12 loop.body11: ; preds = %loop.head10 %48 = load i32, i32* %i, align 4 %49 = add i32 %48, 2 store i32 %49, i32* %i, align 4 %50 = load i32, i32* %j, align 4 %51 = load i32, i32* %i, align 4 %52 = add i32 %50, %51 store i32 %52, i32* %j, align 4 br label %loop.head10 loop.end12: ; preds = %loop.head10 %53 = load i32, i32* %j, align 4 %54 = icmp ne i32 %53, 25 br i1 %54, label %then13, label %else14 then13: ; preds = %loop.end12 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont15 else14: ; preds = %loop.end12 br label %ifcont15 ifcont15: ; preds = %else14, %then13 %55 = alloca i64, align 8 %56 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %55, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %57 = load i64, i64* %55, align 8 %58 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 store i8* %56, i8** %58, align 8 %59 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 store i64 %57, i64* %59, align 8 %60 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 %61 = load i8*, i8** %60, align 8 %62 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 %63 = load i64, i64* %62, align 8 %64 = trunc i64 %63 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %61, i32 %64, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %65 = icmp eq i8* %56, null br i1 %65, label %free_done18, label %free_nonnull17 free_nonnull17: ; preds = %ifcont15 call void @_lfortran_free_alloc(i8* %2, i8* %56) br label %free_done18 free_done18: ; preds = %free_nonnull17, %ifcont15 store i32 0, i32* %j, align 4 store i32 11, i32* %i, align 4 br label %loop.head19 loop.head19: ; preds = %loop.body20, %free_done18 %66 = load i32, i32* %i, align 4 %67 = add i32 %66, -2 %68 = icmp sge i32 %67, 1 br i1 %68, label %loop.body20, label %loop.end21 loop.body20: ; preds = %loop.head19 %69 = load i32, i32* %i, align 4 %70 = add i32 %69, -2 store i32 %70, i32* %i, align 4 %71 = load i32, i32* %j, align 4 %72 = load i32, i32* %i, align 4 %73 = add i32 %71, %72 store i32 %73, i32* %j, align 4 br label %loop.head19 loop.end21: ; preds = %loop.head19 %74 = load i32, i32* %j, align 4 %75 = icmp ne i32 %74, 25 br i1 %75, label %then22, label %else23 then22: ; preds = %loop.end21 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont24 else23: ; preds = %loop.end21 br label %ifcont24 ifcont24: ; preds = %else23, %then22 %76 = alloca i64, align 8 %77 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.3, i32 0, i32 0), i64* %76, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %78 = load i64, i64* %76, align 8 %79 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc25, i32 0, i32 0 store i8* %77, i8** %79, align 8 %80 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc25, i32 0, i32 1 store i64 %78, i64* %80, align 8 %81 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc25, i32 0, i32 0 %82 = load i8*, i8** %81, align 8 %83 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc25, i32 0, i32 1 %84 = load i64, i64* %83, align 8 %85 = trunc i64 %84 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* %82, i32 %85, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 1) %86 = icmp eq i8* %77, null br i1 %86, label %free_done27, label %free_nonnull26 free_nonnull26: ; preds = %ifcont24 call void @_lfortran_free_alloc(i8* %2, i8* %77) br label %free_done27 free_done27: ; preds = %free_nonnull26, %ifcont24 store i32 0, i32* %j, align 4 store i32 -1, i32* %i, align 4 br label %loop.head28 loop.head28: ; preds = %loop.body29, %free_done27 %87 = load i32, i32* %i, align 4 %88 = add i32 %87, 2 %89 = icmp sle i32 %88, 10 br i1 %89, label %loop.body29, label %loop.end30 loop.body29: ; preds = %loop.head28 %90 = load i32, i32* %i, align 4 %91 = add i32 %90, 2 store i32 %91, i32* %i, align 4 %92 = load i32, i32* %j, align 4 %93 = load i32, i32* %i, align 4 %94 = add i32 %92, %93 store i32 %94, i32* %j, align 4 br label %loop.head28 loop.end30: ; preds = %loop.head28 %95 = load i32, i32* %j, align 4 %96 = icmp ne i32 %95, 25 br i1 %96, label %then31, label %else32 then31: ; preds = %loop.end30 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont33 else32: ; preds = %loop.end30 br label %ifcont33 ifcont33: ; preds = %else32, %then31 %97 = alloca i64, align 8 %98 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.4, i32 0, i32 0), i64* %97, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %99 = load i64, i64* %97, align 8 %100 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc34, i32 0, i32 0 store i8* %98, i8** %100, align 8 %101 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc34, i32 0, i32 1 store i64 %99, i64* %101, align 8 %102 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc34, i32 0, i32 0 %103 = load i8*, i8** %102, align 8 %104 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc34, i32 0, i32 1 %105 = load i64, i64* %104, align 8 %106 = trunc i64 %105 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* %103, i32 %106, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0), i32 1) %107 = icmp eq i8* %98, null br i1 %107, label %free_done36, label %free_nonnull35 free_nonnull35: ; preds = %ifcont33 call void @_lfortran_free_alloc(i8* %2, i8* %98) br label %free_done36 free_done36: ; preds = %free_nonnull35, %ifcont33 store i32 0, i32* %j, align 4 store i32 -2, i32* %i, align 4 br label %loop.head37 loop.head37: ; preds = %loop.body38, %free_done36 %108 = load i32, i32* %i, align 4 %109 = add i32 %108, 3 %110 = icmp sle i32 %109, 10 br i1 %110, label %loop.body38, label %loop.end39 loop.body38: ; preds = %loop.head37 %111 = load i32, i32* %i, align 4 %112 = add i32 %111, 3 store i32 %112, i32* %i, align 4 %113 = load i32, i32* %j, align 4 %114 = load i32, i32* %i, align 4 %115 = add i32 %113, %114 store i32 %115, i32* %j, align 4 br label %loop.head37 loop.end39: ; preds = %loop.head37 %116 = load i32, i32* %j, align 4 %117 = icmp ne i32 %116, 22 br i1 %117, label %then40, label %else41 then40: ; preds = %loop.end39 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont42 else41: ; preds = %loop.end39 br label %ifcont42 ifcont42: ; preds = %else41, %then40 %118 = alloca i64, align 8 %119 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.5, i32 0, i32 0), i64* %118, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %120 = load i64, i64* %118, align 8 %121 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc43, i32 0, i32 0 store i8* %119, i8** %121, align 8 %122 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc43, i32 0, i32 1 store i64 %120, i64* %122, align 8 %123 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc43, i32 0, i32 0 %124 = load i8*, i8** %123, align 8 %125 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc43, i32 0, i32 1 %126 = load i64, i64* %125, align 8 %127 = trunc i64 %126 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @23, i32 0, i32 0), i8* %124, i32 %127, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0), i32 1) %128 = icmp eq i8* %119, null br i1 %128, label %free_done45, label %free_nonnull44 free_nonnull44: ; preds = %ifcont42 call void @_lfortran_free_alloc(i8* %2, i8* %119) br label %free_done45 free_done45: ; preds = %free_nonnull44, %ifcont42 store i32 0, i32* %j, align 4 store i32 13, i32* %i, align 4 br label %loop.head46 loop.head46: ; preds = %loop.body47, %free_done45 %129 = load i32, i32* %i, align 4 %130 = add i32 %129, -3 %131 = icmp sge i32 %130, 1 br i1 %131, label %loop.body47, label %loop.end48 loop.body47: ; preds = %loop.head46 %132 = load i32, i32* %i, align 4 %133 = add i32 %132, -3 store i32 %133, i32* %i, align 4 %134 = load i32, i32* %j, align 4 %135 = load i32, i32* %i, align 4 %136 = add i32 %134, %135 store i32 %136, i32* %j, align 4 br label %loop.head46 loop.end48: ; preds = %loop.head46 %137 = load i32, i32* %j, align 4 %138 = icmp ne i32 %137, 22 br i1 %138, label %then49, label %else50 then49: ; preds = %loop.end48 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont51 else50: ; preds = %loop.end48 br label %ifcont51 ifcont51: ; preds = %else50, %then49 %139 = alloca i64, align 8 %140 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.6, i32 0, i32 0), i64* %139, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %141 = load i64, i64* %139, align 8 %142 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc52, i32 0, i32 0 store i8* %140, i8** %142, align 8 %143 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc52, i32 0, i32 1 store i64 %141, i64* %143, align 8 %144 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc52, i32 0, i32 0 %145 = load i8*, i8** %144, align 8 %146 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc52, i32 0, i32 1 %147 = load i64, i64* %146, align 8 %148 = trunc i64 %147 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @27, i32 0, i32 0), i8* %145, i32 %148, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0), i32 1) %149 = icmp eq i8* %140, null br i1 %149, label %free_done54, label %free_nonnull53 free_nonnull53: ; preds = %ifcont51 call void @_lfortran_free_alloc(i8* %2, i8* %140) br label %free_done54 free_done54: ; preds = %free_nonnull53, %ifcont51 store i32 0, i32* %j, align 4 store i32 0, i32* %i, align 4 br label %loop.head55 loop.head55: ; preds = %loop.body56, %free_done54 %150 = load i32, i32* %i, align 4 %151 = add i32 %150, 1 %152 = icmp sle i32 %151, 1 br i1 %152, label %loop.body56, label %loop.end57 loop.body56: ; preds = %loop.head55 %153 = load i32, i32* %i, align 4 %154 = add i32 %153, 1 store i32 %154, i32* %i, align 4 %155 = load i32, i32* %j, align 4 %156 = load i32, i32* %i, align 4 %157 = add i32 %155, %156 store i32 %157, i32* %j, align 4 br label %loop.head55 loop.end57: ; preds = %loop.head55 %158 = load i32, i32* %j, align 4 %159 = icmp ne i32 %158, 1 br i1 %159, label %then58, label %else59 then58: ; preds = %loop.end57 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @29, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @28, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont60 else59: ; preds = %loop.end57 br label %ifcont60 ifcont60: ; preds = %else59, %then58 %160 = alloca i64, align 8 %161 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.7, i32 0, i32 0), i64* %160, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %162 = load i64, i64* %160, align 8 %163 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc61, i32 0, i32 0 store i8* %161, i8** %163, align 8 %164 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc61, i32 0, i32 1 store i64 %162, i64* %164, align 8 %165 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc61, i32 0, i32 0 %166 = load i8*, i8** %165, align 8 %167 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc61, i32 0, i32 1 %168 = load i64, i64* %167, align 8 %169 = trunc i64 %168 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @31, i32 0, i32 0), i8* %166, i32 %169, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0), i32 1) %170 = icmp eq i8* %161, null br i1 %170, label %free_done63, label %free_nonnull62 free_nonnull62: ; preds = %ifcont60 call void @_lfortran_free_alloc(i8* %2, i8* %161) br label %free_done63 free_done63: ; preds = %free_nonnull62, %ifcont60 store i32 0, i32* %j, align 4 store i32 2, i32* %i, align 4 br label %loop.head64 loop.head64: ; preds = %loop.body65, %free_done63 %171 = load i32, i32* %i, align 4 %172 = add i32 %171, -1 %173 = icmp sge i32 %172, 1 br i1 %173, label %loop.body65, label %loop.end66 loop.body65: ; preds = %loop.head64 %174 = load i32, i32* %i, align 4 %175 = add i32 %174, -1 store i32 %175, i32* %i, align 4 %176 = load i32, i32* %j, align 4 %177 = load i32, i32* %i, align 4 %178 = add i32 %176, %177 store i32 %178, i32* %j, align 4 br label %loop.head64 loop.end66: ; preds = %loop.head64 %179 = load i32, i32* %j, align 4 %180 = icmp ne i32 %179, 1 br i1 %180, label %then67, label %else68 then67: ; preds = %loop.end66 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @33, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @32, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont69 else68: ; preds = %loop.end66 br label %ifcont69 ifcont69: ; preds = %else68, %then67 %181 = alloca i64, align 8 %182 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.8, i32 0, i32 0), i64* %181, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %183 = load i64, i64* %181, align 8 %184 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc70, i32 0, i32 0 store i8* %182, i8** %184, align 8 %185 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc70, i32 0, i32 1 store i64 %183, i64* %185, align 8 %186 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc70, i32 0, i32 0 %187 = load i8*, i8** %186, align 8 %188 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc70, i32 0, i32 1 %189 = load i64, i64* %188, align 8 %190 = trunc i64 %189 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @35, i32 0, i32 0), i8* %187, i32 %190, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @34, i32 0, i32 0), i32 1) %191 = icmp eq i8* %182, null br i1 %191, label %free_done72, label %free_nonnull71 free_nonnull71: ; preds = %ifcont69 call void @_lfortran_free_alloc(i8* %2, i8* %182) br label %free_done72 free_done72: ; preds = %free_nonnull71, %ifcont69 store i32 0, i32* %j, align 4 store i32 0, i32* %i, align 4 br label %loop.head73 loop.head73: ; preds = %loop.body74, %free_done72 %192 = load i32, i32* %i, align 4 %193 = add i32 %192, 1 %194 = icmp sle i32 %193, 0 br i1 %194, label %loop.body74, label %loop.end75 loop.body74: ; preds = %loop.head73 %195 = load i32, i32* %i, align 4 %196 = add i32 %195, 1 store i32 %196, i32* %i, align 4 %197 = load i32, i32* %j, align 4 %198 = load i32, i32* %i, align 4 %199 = add i32 %197, %198 store i32 %199, i32* %j, align 4 br label %loop.head73 loop.end75: ; preds = %loop.head73 %200 = load i32, i32* %j, align 4 %201 = icmp ne i32 %200, 0 br i1 %201, label %then76, label %else77 then76: ; preds = %loop.end75 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @37, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont78 else77: ; preds = %loop.end75 br label %ifcont78 ifcont78: ; preds = %else77, %then76 %202 = alloca i64, align 8 %203 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.9, i32 0, i32 0), i64* %202, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %204 = load i64, i64* %202, align 8 %205 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc79, i32 0, i32 0 store i8* %203, i8** %205, align 8 %206 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc79, i32 0, i32 1 store i64 %204, i64* %206, align 8 %207 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc79, i32 0, i32 0 %208 = load i8*, i8** %207, align 8 %209 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc79, i32 0, i32 1 %210 = load i64, i64* %209, align 8 %211 = trunc i64 %210 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @39, i32 0, i32 0), i8* %208, i32 %211, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0), i32 1) %212 = icmp eq i8* %203, null br i1 %212, label %free_done81, label %free_nonnull80 free_nonnull80: ; preds = %ifcont78 call void @_lfortran_free_alloc(i8* %2, i8* %203) br label %free_done81 free_done81: ; preds = %free_nonnull80, %ifcont78 store i32 0, i32* %j, align 4 store i32 1, i32* %i, align 4 br label %loop.head82 loop.head82: ; preds = %loop.body83, %free_done81 %213 = load i32, i32* %i, align 4 %214 = add i32 %213, -1 %215 = icmp sge i32 %214, 1 br i1 %215, label %loop.body83, label %loop.end84 loop.body83: ; preds = %loop.head82 %216 = load i32, i32* %i, align 4 %217 = add i32 %216, -1 store i32 %217, i32* %i, align 4 %218 = load i32, i32* %j, align 4 %219 = load i32, i32* %i, align 4 %220 = add i32 %218, %219 store i32 %220, i32* %j, align 4 br label %loop.head82 loop.end84: ; preds = %loop.head82 %221 = load i32, i32* %j, align 4 %222 = icmp ne i32 %221, 0 br i1 %222, label %then85, label %else86 then85: ; preds = %loop.end84 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @40, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont87 else86: ; preds = %loop.end84 br label %ifcont87 ifcont87: ; preds = %else86, %then85 %223 = alloca i64, align 8 %224 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.10, i32 0, i32 0), i64* %223, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j) %225 = load i64, i64* %223, align 8 %226 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc88, i32 0, i32 0 store i8* %224, i8** %226, align 8 %227 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc88, i32 0, i32 1 store i64 %225, i64* %227, align 8 %228 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc88, i32 0, i32 0 %229 = load i8*, i8** %228, align 8 %230 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc88, i32 0, i32 1 %231 = load i64, i64* %230, align 8 %232 = trunc i64 %231 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @43, i32 0, i32 0), i8* %229, i32 %232, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0), i32 1) %233 = icmp eq i8* %224, null br i1 %233, label %free_done90, label %free_nonnull89 free_nonnull89: ; preds = %ifcont87 call void @_lfortran_free_alloc(i8* %2, i8* %224) br label %free_done90 free_done90: ; preds = %free_nonnull89, %ifcont87 br label %return return: ; preds = %free_done90 br label %FINALIZE_SYMTABLE_doloop_01 FINALIZE_SYMTABLE_doloop_01: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) lfortran-0.63.0/tests/reference/ast-doloop_04-4703a43.stdout0000664000175000017500000001414415174404631023457 0ustar alastairalastair(TranslationUnit [(Program doloop_04 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ()) (k [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 j 0 () ) (Assignment 0 k 2 () ) (DoLoop 0 () 0 i 1 10 k [(Assignment 0 j (+ j i) () )] () () ) (If 0 () (/= j 25) [(ErrorStop 0 () () () )] [] () () () ) (Print 0 () [j] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 j 0 () ) (Assignment 0 k (u- 2) () ) (DoLoop 0 () 0 i 10 1 k [(Assignment 0 j (+ j i) () )] () () ) (If 0 () (/= j 30) [(ErrorStop 0 () () () )] [] () () () ) (Print 0 () [j] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 j 0 () ) (DoLoop 0 a 0 i 1 10 () [(Assignment 0 j (+ j i) () ) (If 0 () (== i 2) [(Exit 0 a () )] [] () () () )] () () ) (If 0 () (/= j 3) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 j 0 () ) (DoLoop 0 b 0 i 1 10 2 [(Assignment 0 j (+ j i) () ) (If 0 () (== i 3) [(Exit 0 b () )] [] () () () )] () () ) (If 0 () (/= j 4) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 j 0 () ) (Assignment 0 i 1 () ) (DoLoop 0 c 0 () () () () [(Assignment 0 j (+ j i) () ) (If 0 () (== i 2) [(Exit 0 c () )] [] () () () ) (Assignment 0 i (+ i 1) () )] () () ) (If 0 () (/= j 3) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "!test-issue 746" ) (EndOfLine)] ) ) (Assignment 0 k 2 () ) (DoLoop 0 () 0 i 1 10 k [(Continue 100 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/asr-openmp_36-256dd0e.stdout0000664000175000017500000001162415174404631023630 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { openmp_36: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 2 res [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) openmp_36 [] [(DoConcurrentLoop [((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) ()) ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ())] [] [] [] [(Assignment (Var 2 res) (IntegerBinOp (Var 2 res) Add (IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4) () ) (Integer 4) () ) () .false. .false. )] ) (Print (StringFormat () [(Var 2 res)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-floor_02-5b70ee6.json0000664000175000017500000000074215174404631023076 0ustar alastairalastair{ "basename": "asr-floor_02-5b70ee6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/floor_02.f90", "infile_hash": "491234f50f51c45988216c1d0dc82e2493ae2de4b40cf8c85e31ed16", "outfile": null, "outfile_hash": null, "stdout": "asr-floor_02-5b70ee6.stdout", "stdout_hash": "df1f211aecca03f0b6d5e6aa4b4b53762b7a876c259822e17f91ebf9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_shape_01-214f2d0.stderr0000664000175000017500000000027515174404631024512 0ustar alastairalastairsemantic error: Different shape for array assignment on dimension 1(3 and 2) --> tests/errors/array_shape_01.f90:3:1 | 3 | x = reshape([1,2,3,4],[2,2]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast_f90-array6-d640983.stdout0000664000175000017500000000034315174404631023552 0ustar alastairalastairprogram array6 implicit none contains subroutine t(n, a, b, c, d, e) integer, intent(in) :: n real :: a(*), b(3:*) real, dimension(3,n,*) :: c real, dimension(3,n,4:*) :: d real :: e(n:*) end subroutine t end program array6 lfortran-0.63.0/tests/reference/ast-fixed_form_interface-a8dfdb0.json0000664000175000017500000000077415174404631025760 0ustar alastairalastair{ "basename": "ast-fixed_form_interface-a8dfdb0", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_interface.f", "infile_hash": "9848fe137b898d800534fae81911bcb039a52295d010b55bca47cdc2", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_interface-a8dfdb0.stdout", "stdout_hash": "d248372139adf9d7e84d3bcb74e631c8e691f7f3ee4ed3de7dd58a17", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-assign_to2-6015b09.json0000664000175000017500000000075015174404631023356 0ustar alastairalastair{ "basename": "ast-assign_to2-6015b09", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/assign_to2.f90", "infile_hash": "a929e60f25d1d3c3b1ef485c7d9b5dca6f7bebcfffc66ed010f309d3", "outfile": null, "outfile_hash": null, "stdout": "ast-assign_to2-6015b09.stdout", "stdout_hash": "21c3cc594ba3e21409d2c1ec75ac79c2d3f35a6c37b3b0a8fb83979f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-subroutine9-60500c5.stdout0000664000175000017500000000062515174404631024622 0ustar alastairalastairsubroutine a() import, none implicit none end subroutine a subroutine b() import, all implicit none end subroutine b subroutine c() import :: a, b implicit none end subroutine c subroutine d() import :: a, b implicit none end subroutine d subroutine e() import, only: a, b implicit none end subroutine e subroutine f() import :: a, b import :: c import :: d, e, f implicit none end subroutine f lfortran-0.63.0/tests/reference/asr-implicit_typing2-d87e21a.json0000664000175000017500000000076715174404631024747 0ustar alastairalastair{ "basename": "asr-implicit_typing2-d87e21a", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit_typing2.f90", "infile_hash": "9bb19041ce5948de790924b6961da8d628b025835f6e14ff43c577c8", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_typing2-d87e21a.stdout", "stdout_hash": "b38b14929104a53c3c0fdb157609b460e48223bc7eaa60fe220a7f28", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/c-case_01-2ff47e6.json0000664000175000017500000000071415174404631022331 0ustar alastairalastair{ "basename": "c-case_01-2ff47e6", "cmd": "lfortran --no-color --show-c {infile}", "infile": "tests/../integration_tests/case_01.f90", "infile_hash": "003a23367180e7f228e7e4ef5a6dfdb6749801b29ccf2002e2559e41", "outfile": null, "outfile_hash": null, "stdout": "c-case_01-2ff47e6.stdout", "stdout_hash": "e47d0d678fec6d42d2bd1b503b34991411d09633fb062004f371c8ef", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-namelist_02-5bdbd75.stdout0000664000175000017500000002022615174404631024220 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { namelist_01: (Program (SymbolTable 2 { config: (Namelist 2 config [2 count 2 max_iter 2 tolerance 2 factor 2 verbose 2 method] ), count: (Variable 2 count [] Local (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), factor: (Variable 2 factor [] Local (RealConstant 1.500000 (Real 4) ) (RealConstant 1.500000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), max_iter: (Variable 2 max_iter [] Local (IntegerConstant 100 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), method: (Variable 2 method [] Local (StringConstant "default" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "default" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 30 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tolerance: (Variable 2 tolerance [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), verbose: (Variable 2 verbose [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) namelist_01 [] [] ) }) [] ) lfortran-0.63.0/tests/reference/ast-do_concurrent_reduce-58dd849.stdout0000664000175000017500000000455715174404631026166 0ustar alastairalastair(TranslationUnit [(Subroutine sum_reduce [(a) (s)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(s [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(N [] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 N (FuncCallOrArray size [] [(() a () 0)] [] [] [] ) () ) (Assignment 0 s 0 () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () )] () [(ConcurrentReduce ReduceAdd [s] )] [(Assignment 0 s (+ s (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () )] [] [] )] ) lfortran-0.63.0/tests/reference/ast-fixed_form_4-656a640.stderr0000664000175000017500000000021115174404631024202 0ustar alastairalastairsyntax error: Token ')' is unexpected here --> tests/errors/fixed_form_4.f:4:19 | 4 | 500 print *, sin), y | ^ lfortran-0.63.0/tests/reference/asr-kokkos_program2-8391215.json0000664000175000017500000000074215174404631024345 0ustar alastairalastair{ "basename": "asr-kokkos_program2-8391215", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/kokkos_program2.f90", "infile_hash": "bba0b0329c504e01dd099058af96e20a7fe00294f66456fe3da634e0", "outfile": null, "outfile_hash": null, "stdout": "asr-kokkos_program2-8391215.stdout", "stdout_hash": "9ebb51de2e431e3920a21cb23dac719ce51cf7c92bb44c4c114f2ce8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-case_03-b14adab.stdout0000664000175000017500000001143715174404631023370 0ustar alastairalastair(TranslationUnit [(Program case03 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! local variable declaration" )] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(marks [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(a [] [] () 1 Equal ()) (b [] [] () 2 Equal ())] () )] [(Assignment 0 marks 94 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Select 0 () marks [(CaseStmt [(CaseCondRange (+ 40 b) () )] () [(Print 0 () [(String "Pass!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange () (- 39 a) )] () [(Print 0 () [(String "Failed!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt_Default () [(Print 0 () [(String "Invalid marks" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) () ) (Print 0 () [(String "Your marks are " ()) marks] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 marks (u- 1) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Select 0 () marks [(CaseStmt [(CaseCondRange (+ 40 b) () )] () [(Print 0 () [(String "Pass!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 0 (- 39 a) )] () [(Print 0 () [(String "Failed!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt_Default () [(Print 0 () [(String "Invalid marks" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) () ) (Print 0 () [(String "Your marks are " ()) marks] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/ast-parse_without_program_line-0b3170b.stdout0000664000175000017500000001341015174404631027357 0ustar alastairalastair(TranslationUnit [(Program __xx_main () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrAllocatable )] [(a [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrPointer )] [(p [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Allocate 0 [(() (FuncCallOrArray a [] [(() 10 () 0)] [] [] [] ) () 0)] [] () ) (Deallocate 0 [(() a () 0)] [] () ) (Open 0 [] [(unit 10) (file (String "test.txt" ())) (status (String "old" ()))] () ) (Flush 0 [10] [] () ) (Close 0 [] [(unit 10)] () ) (Nullify 0 [p] [] () ) (Exit 0 exit () ) (Cycle 0 cycle () ) (Return 0 () () ) (Continue 0 () ) (Print 0 () [exit] () ) (Print 0 () [cycle] () ) (Print 0 () [return] () ) (Print 0 () [continue] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SubroutineCall 0 exit [] [] [] [] () ) (SubroutineCall 0 cycle [] [] [] [] () ) (SubroutineCall 0 return [] [] [] [] () ) (SubroutineCall 0 continue [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Subroutine sub [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(DoLoop 0 () 0 i 1 10 () [(Print 0 () [i] () ) (If 0 () (== i 5) [(Exit 0 () () )] [] () () () ) (If 0 () (== i 7) [(Cycle 0 () () )] [] () () () ) (If 0 () (== i 9) [(Return 0 () () )] [] () () () ) (If 0 () (== i 2) [(Continue 0 () )] [] () () () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] )] )] ) lfortran-0.63.0/tests/reference/ast-fixedform_return2-597f864.stdout0000664000175000017500000000224215174404631025347 0ustar alastairalastair(TranslationUnit [(Subroutine f [(a) (b) (c)] [] () () [] [] [] [] [(Print 0 () [a] () ) (GoTo 0 () 1 [] () ) (Return 0 () () ) (Print 1 () [b] () ) (Return 0 () () )] [] [] ) (Function g [(a) (b) (c)] [] () () () [] [] [] [] [(Print 0 () [a] () ) (GoTo 0 () 2 [] () ) (Return 0 () () ) (Print 2 () [b] () ) (Return 0 () () )] [] [] )] ) lfortran-0.63.0/tests/reference/ast_f90-array7-6a2e4ab.json0000664000175000017500000000072215174404631023406 0ustar alastairalastair{ "basename": "ast_f90-array7-6a2e4ab", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/array7.f90", "infile_hash": "e8a4f12c21d75c3eee1ba6cc82227a262f41e146ccfd34c1ffb12612", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-array7-6a2e4ab.stdout", "stdout_hash": "576a988220de9b163a11b5a0101125bf2aad2be88ea6913e24c10d45", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_type_01-d480dc4.stderr0000664000175000017500000000034315174404631024763 0ustar alastairalastairsemantic error: Interface must be specified for DEFERRED binding --> tests/errors/derived_type_01.f90:7:39 | 7 | procedure(testing_interface), deferred :: testing | ^^^^^^^^ lfortran-0.63.0/tests/reference/llvm-nested_01-b01694c.json0000664000175000017500000000075015174404631023335 0ustar alastairalastair{ "basename": "llvm-nested_01-b01694c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_01.f90", "infile_hash": "a7e6c8b63a220874358dba8c3f5052714bbc579c945d1d96474842a7", "outfile": null, "outfile_hash": null, "stdout": "llvm-nested_01-b01694c.stdout", "stdout_hash": "e861d6924e569c02e76513df234cf56daa5ab7da4f44f216c8ba57c1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-interface_10-e9eb6ea.json0000664000175000017500000000075615174404631024064 0ustar alastairalastair{ "basename": "asr-interface_10-e9eb6ea", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/interface_10.f90", "infile_hash": "8465656b7ce46b783d3db81b21e7bd48594e95e99839534c7e50cad8", "outfile": null, "outfile_hash": null, "stdout": "asr-interface_10-e9eb6ea.stdout", "stdout_hash": "97232a7e4e02ce5a707ba84ef1bb62c3244a945c43610cf2b7adcea1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor13-d951787.json0000664000175000017500000000077315174404631026472 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor13-d951787", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor13.f90", "infile_hash": "a846ad5320eb7082135106ba078c94cc21b41c4365d735839474f3ed", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor13-d951787.stdout", "stdout_hash": "a9bd047597c370cc1016aa2932f3ca2bae71c65f2d13b8d593f360bc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-while_01-3496096.stdout0000664000175000017500000001705715174404631023420 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %j = alloca i32, align 4 store i32 1, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head loop.head: ; preds = %loop.body, %.entry %2 = load i32, i32* %i, align 4 %3 = icmp slt i32 %2, 11 br i1 %3, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %4 = load i32, i32* %j, align 4 %5 = load i32, i32* %i, align 4 %6 = add i32 %4, %5 store i32 %6, i32* %j, align 4 %7 = load i32, i32* %i, align 4 %8 = add i32 %7, 1 store i32 %8, i32* %i, align 4 br label %loop.head loop.end: ; preds = %loop.head %9 = load i32, i32* %j, align 4 %10 = icmp ne i32 %9, 55 br i1 %10, label %then, label %else then: ; preds = %loop.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %loop.end br label %ifcont ifcont: ; preds = %else, %then %11 = load i32, i32* %i, align 4 %12 = icmp ne i32 %11, 11 br i1 %12, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 store i32 1, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head4 loop.head4: ; preds = %loop.body5, %ifcont3 %13 = load i32, i32* %i, align 4 %14 = icmp sle i32 %13, 10 br i1 %14, label %loop.body5, label %loop.end6 loop.body5: ; preds = %loop.head4 %15 = load i32, i32* %j, align 4 %16 = load i32, i32* %i, align 4 %17 = add i32 %15, %16 store i32 %17, i32* %j, align 4 %18 = load i32, i32* %i, align 4 %19 = add i32 %18, 1 store i32 %19, i32* %i, align 4 br label %loop.head4 loop.end6: ; preds = %loop.head4 %20 = load i32, i32* %j, align 4 %21 = icmp ne i32 %20, 55 br i1 %21, label %then7, label %else8 then7: ; preds = %loop.end6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont9 else8: ; preds = %loop.end6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 %22 = load i32, i32* %i, align 4 %23 = icmp ne i32 %22, 11 br i1 %23, label %then10, label %else11 then10: ; preds = %ifcont9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont12 else11: ; preds = %ifcont9 br label %ifcont12 ifcont12: ; preds = %else11, %then10 store i32 1, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head13 loop.head13: ; preds = %loop.body14, %ifcont12 %24 = load i32, i32* %i, align 4 %25 = icmp slt i32 %24, 1 br i1 %25, label %loop.body14, label %loop.end15 loop.body14: ; preds = %loop.head13 %26 = load i32, i32* %j, align 4 %27 = load i32, i32* %i, align 4 %28 = add i32 %26, %27 store i32 %28, i32* %j, align 4 %29 = load i32, i32* %i, align 4 %30 = add i32 %29, 1 store i32 %30, i32* %i, align 4 br label %loop.head13 loop.end15: ; preds = %loop.head13 %31 = load i32, i32* %j, align 4 %32 = icmp ne i32 %31, 0 br i1 %32, label %then16, label %else17 then16: ; preds = %loop.end15 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont18 else17: ; preds = %loop.end15 br label %ifcont18 ifcont18: ; preds = %else17, %then16 %33 = load i32, i32* %i, align 4 %34 = icmp ne i32 %33, 1 br i1 %34, label %then19, label %else20 then19: ; preds = %ifcont18 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont21 else20: ; preds = %ifcont18 br label %ifcont21 ifcont21: ; preds = %else20, %then19 br label %return return: ; preds = %ifcont21 br label %FINALIZE_SYMTABLE_while_01 FINALIZE_SYMTABLE_while_01: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) lfortran-0.63.0/tests/reference/ast-types_12-025af39.json0000664000175000017500000000074215174404631023040 0ustar alastairalastair{ "basename": "ast-types_12-025af39", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_12.f90", "infile_hash": "d5db9207ff7ebb121312ebf448d4b591da2b645185b23095e2558455", "outfile": null, "outfile_hash": null, "stdout": "ast-types_12-025af39.stdout", "stdout_hash": "276add62a512cac401d26a5b58d3cf079a8fa2fca888526d60042a44", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-operator_overloading_03-f7a6efe.stdout0000664000175000017500000011767715174404631026741 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { operator_overloading_01: (Program (SymbolTable 6 { f: (Variable 6 f [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Parameter (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), greater_than_inverse: (ExternalSymbol 6 greater_than_inverse 2 greater_than_inverse operator_overloading_01_overload_comp_m [] greater_than_inverse Public ), less_than_inverse: (ExternalSymbol 6 less_than_inverse 2 less_than_inverse operator_overloading_01_overload_comp_m [] less_than_inverse Public ), less_than_overload_use: (ExternalSymbol 6 less_than_overload_use 2 less_than_overload_use operator_overloading_01_overload_comp_m [] less_than_overload_use Public ), t: (Variable 6 t [] Local (LogicalConstant .true. (Logical 4) ) (LogicalConstant .true. (Logical 4) ) Parameter (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~gt: (ExternalSymbol 6 ~gt 2 ~gt operator_overloading_01_overload_comp_m [] ~gt Public ), ~lt: (ExternalSymbol 6 ~lt 2 ~lt operator_overloading_01_overload_comp_m [] ~lt Public ) }) operator_overloading_01 [operator_overloading_01_overload_comp_m] [(Print (StringFormat () [(StringConstant "T>T:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedCompare (Var 6 t) Gt (Var 6 t) (Logical 4) (LogicalConstant .false. (Logical 4) ) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 t)) ((Var 6 t))] (Logical 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "T>F:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedCompare (Var 6 t) Gt (Var 6 f) (Logical 4) (LogicalConstant .true. (Logical 4) ) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 t)) ((Var 6 f))] (Logical 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "F>T:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedCompare (Var 6 f) Gt (Var 6 t) (Logical 4) (LogicalConstant .false. (Logical 4) ) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 f)) ((Var 6 t))] (Logical 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "F>F:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedCompare (Var 6 f) Gt (Var 6 f) (Logical 4) (LogicalConstant .false. (Logical 4) ) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 f)) ((Var 6 f))] (Logical 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "T tests/../integration_tests/logical3.f90:24:5 | 24 | if (a .xor. b) then | ^^^^^^^^^ LFortran extension warning: .xor. is an LFortran extension --> tests/../integration_tests/logical3.f90:74:5 | 74 | if (a .xor. b) then | ^^^^^^^^^ LFortran extension lfortran-0.63.0/tests/reference/asr_disable_warnings-style1-3d16af1.json0000664000175000017500000000112515174404631026254 0ustar alastairalastair{ "basename": "asr_disable_warnings-style1-3d16af1", "cmd": "lfortran --show-asr --no-warnings --no-color {infile} -o {outfile}", "infile": "tests/style1.f90", "infile_hash": "b37bbb3e24a2bceae58e25b574ccb9dea7fbe05441c08c9e4fa5add6", "outfile": null, "outfile_hash": null, "stdout": "asr_disable_warnings-style1-3d16af1.stdout", "stdout_hash": "77f1ae86facfa4d13db333a9bb1016ff2ee69bacf3ec17d9a5dec264", "stderr": "asr_disable_warnings-style1-3d16af1.stderr", "stderr_hash": "7e4725fb2dcc881cc51b72f969ee1447e25fc88c5da229c04b2ed016", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-end_program_name-2d38a01.stderr0000664000175000017500000000032715174404631025207 0ustar alastairalastairsyntax error: End program name does not match program name --> tests/errors/end_program_name.f90:1:1 - 2:17 | 1 | program name | ^^^^^^^^^^^^... ... | 2 | end program name2 | ...^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/llvm-class_02-82c2f9c.stdout0000664000175000017500000002305415174404631023624 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> %class_circle2.circle_class = type <{ i32 (...)**, %class_circle2.circle* }> %class_circle2.circle = type { float } @__module_class_circle2_pi = global float 0x400921FB60000000 @_Name_circle = private unnamed_addr constant [7 x i8] c"circle\00", align 1 @_Type_Info_circle = linkonce_odr unnamed_addr constant { i8*, i8*, i8* } { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @_Name_circle, i32 0, i32 0), i8* inttoptr (i64 4 to i8*), i8* null }, align 8 @_VTable_circle = linkonce_odr unnamed_addr constant { [7 x i8*] } { [7 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_circle to i8*), i8* bitcast (void (i8*, i8*)* @_copy_class_circle2_circle to i8*), i8* bitcast (void (i8**)* @_allocate_struct_class_circle2_circle to i8*), i8* bitcast (void (i8*)* @finalize_StructType__circle_of_class_circle2_for_UPoly to i8*), i8* bitcast (float (%class_circle2.circle_class*)* @__module_class_circle2_circle_area to i8*), i8* bitcast (void (%class_circle2.circle_class*)* @__module_class_circle2_circle_print to i8*)] }, align 8 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [25 x i8] c"S-DESC-12,R4,S-DESC-8,R4\00", align 1 @string_const_data = private constant [12 x i8] c"Circle: r = " @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([12 x i8], [12 x i8]* @string_const_data, i32 0, i32 0), i64 12 }> @string_const_data.1 = private constant [8 x i8] c" area = " @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data.1, i32 0, i32 0), i64 8 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define float @__module_class_circle2_circle_area(%class_circle2.circle_class* %this) { .entry: %circle_area = alloca float, align 4 %0 = load float, float* @__module_class_circle2_pi, align 4 %1 = getelementptr %class_circle2.circle_class, %class_circle2.circle_class* %this, i32 0, i32 1 %2 = load %class_circle2.circle*, %class_circle2.circle** %1, align 8 %3 = getelementptr %class_circle2.circle, %class_circle2.circle* %2, i32 0, i32 0 %4 = load float, float* %3, align 4 %simplified_pow_operation = fmul float %4, %4 %5 = fmul float %0, %simplified_pow_operation store float %5, float* %circle_area, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_circle_area FINALIZE_SYMTABLE_circle_area: ; preds = %return %6 = load float, float* %circle_area, align 4 ret float %6 } define void @__module_class_circle2_circle_print(%class_circle2.circle_class* %this) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %area = alloca float, align 4 %1 = bitcast %class_circle2.circle_class* %this to float (%class_circle2.circle_class*)*** %2 = load float (%class_circle2.circle_class*)**, float (%class_circle2.circle_class*)*** %1, align 8 %3 = getelementptr inbounds float (%class_circle2.circle_class*)*, float (%class_circle2.circle_class*)** %2, i32 3 %4 = load float (%class_circle2.circle_class*)*, float (%class_circle2.circle_class*)** %3, align 8 %5 = call float %4(%class_circle2.circle_class* %this) store float %5, float* %area, align 4 %6 = alloca i64, align 8 %7 = getelementptr %class_circle2.circle_class, %class_circle2.circle_class* %this, i32 0, i32 1 %8 = load %class_circle2.circle*, %class_circle2.circle** %7, align 8 %9 = getelementptr %class_circle2.circle, %class_circle2.circle* %8, i32 0, i32 0 %10 = load float, float* %9, align 4 %11 = alloca float, align 4 store float %10, float* %11, align 4 %12 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @serialization_info, i32 0, i32 0), i64* %6, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const, float* %11, %string_descriptor* @string_const.2, float* %area) %13 = load i64, i64* %6, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %12, i8** %14, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %13, i64* %15, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %17 = load i8*, i8** %16, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %19 = load i64, i64* %18, align 8 %20 = trunc i64 %19 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %17, i32 %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %21 = icmp eq i8* %12, null br i1 %21, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %12) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_circle_print FINALIZE_SYMTABLE_circle_print: ; preds = %return ret void } define void @__module_class_circle2__xx_lcompilers_changed_main_xx() { .entry: %0 = alloca %class_circle2.circle_class, align 8 %c = alloca %class_circle2.circle, align 8 %1 = getelementptr %class_circle2.circle, %class_circle2.circle* %c, i32 0, i32 0 %2 = getelementptr %class_circle2.circle, %class_circle2.circle* %c, i32 0, i32 0 store float 1.000000e+00, float* %2, align 4 %3 = getelementptr %class_circle2.circle, %class_circle2.circle* %c, i32 0, i32 0 store float 1.500000e+00, float* %3, align 4 %4 = getelementptr %class_circle2.circle_class, %class_circle2.circle_class* %0, i32 0, i32 0 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [7 x i8*] }, { [7 x i8*] }* @_VTable_circle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %4, align 8 %5 = getelementptr %class_circle2.circle_class, %class_circle2.circle_class* %0, i32 0, i32 1 store %class_circle2.circle* %c, %class_circle2.circle** %5, align 8 call void @__module_class_circle2_circle_print(%class_circle2.circle_class* %0) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret void } define linkonce_odr void @_copy_class_circle2_circle(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %class_circle2.circle* %3 = bitcast i8* %1 to %class_circle2.circle* %4 = getelementptr %class_circle2.circle, %class_circle2.circle* %2, i32 0, i32 0 %5 = load float, float* %4, align 4 %6 = getelementptr %class_circle2.circle, %class_circle2.circle* %3, i32 0, i32 0 br i1 true, label %then, label %else then: ; preds = %entry store float %5, float* %6, align 4 br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then ret void } define linkonce_odr void @_allocate_struct_class_circle2_circle(i8** %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = call i8* @_lfortran_malloc_alloc(i8* %1, i64 16) call void @llvm.memset.p0i8.i32(i8* %2, i8 0, i32 16, i1 false) store i8* %2, i8** %0, align 8 %3 = load i8*, i8** %0, align 8 %4 = bitcast i8* %3 to %class_circle2.circle_class* %5 = bitcast %class_circle2.circle_class* %4 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [7 x i8*] }, { [7 x i8*] }* @_VTable_circle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %5, align 8 %6 = getelementptr %class_circle2.circle_class, %class_circle2.circle_class* %4, i32 0, i32 1 %7 = call i8* @_lfortran_get_default_allocator() %8 = call i8* @_lfortran_malloc_alloc(i8* %7, i64 4) call void @llvm.memset.p0i8.i32(i8* %8, i8 0, i32 4, i1 false) %9 = bitcast i8* %8 to %class_circle2.circle* store %class_circle2.circle* %9, %class_circle2.circle** %6, align 8 %10 = getelementptr %class_circle2.circle, %class_circle2.circle* %9, i32 0, i32 0 ret void } define internal void @finalize_StructType__circle_of_class_circle2_for_UPoly(i8* %0) { entry: %1 = bitcast i8* %0 to %class_circle2.circle* ret void } declare i8* @_lfortran_malloc_alloc(i8*, i64) declare i8* @_lfortran_get_default_allocator() ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @__module_class_circle2__xx_lcompilers_changed_main_xx() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_circle_test FINALIZE_SYMTABLE_circle_test: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() attributes #0 = { argmemonly nounwind willreturn writeonly } lfortran-0.63.0/tests/reference/llvm-complex_div_test-0a2468c.stdout0000664000175000017500000002532215174404631025475 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> %complex_4 = type <{ float, float }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc10 = alloca %string_descriptor, align 8 %stringFormat_desc4 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca %complex_4, align 8 store %complex_4 <{ float 3.000000e+00, float 4.000000e+00 }>, %complex_4* %x, align 1 %3 = load %complex_4, %complex_4* %x, align 1 %4 = extractvalue %complex_4 %3, 0 %5 = extractvalue %complex_4 %3, 1 %6 = call float @llvm.fabs.f32(float 4.000000e+00) %7 = call float @llvm.fabs.f32(float 0.000000e+00) %8 = fcmp oge float %6, %7 br i1 %8, label %complex_div_r_ge_s, label %complex_div_r_lt_s complex_div_r_ge_s: ; preds = %.entry %9 = fmul float %5, 0.000000e+00 %10 = fadd float %4, %9 %11 = fmul float %4, 0.000000e+00 %12 = fsub float %5, %11 %13 = fdiv float %10, 4.000000e+00 %14 = fdiv float %12, 4.000000e+00 br label %complex_div_cont complex_div_r_lt_s: ; preds = %.entry %15 = fmul float %4, 0x7FF0000000000000 %16 = fadd float %15, %5 %17 = fmul float %5, 0x7FF0000000000000 %18 = fsub float %17, %4 %19 = fdiv float %16, 0x7FF0000000000000 %20 = fdiv float %18, 0x7FF0000000000000 br label %complex_div_cont complex_div_cont: ; preds = %complex_div_r_lt_s, %complex_div_r_ge_s %21 = phi float [ %13, %complex_div_r_ge_s ], [ %19, %complex_div_r_lt_s ] %22 = phi float [ %14, %complex_div_r_ge_s ], [ %20, %complex_div_r_lt_s ] %23 = insertvalue %complex_4 undef, float %21, 0 %24 = insertvalue %complex_4 %23, float %22, 1 store %complex_4 %24, %complex_4* %x, align 1 %25 = alloca i64, align 8 %26 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info, i32 0, i32 0), i64* %25, i32 0, i32 0, i32 0, i32 0, i32 0, %complex_4* %x) %27 = load i64, i64* %25, align 8 %28 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %26, i8** %28, align 8 %29 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %27, i64* %29, align 8 %30 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %31 = load i8*, i8** %30, align 8 %32 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %33 = load i64, i64* %32, align 8 %34 = trunc i64 %33 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %31, i32 %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %35 = icmp eq i8* %26, null br i1 %35, label %free_done, label %free_nonnull free_nonnull: ; preds = %complex_div_cont call void @_lfortran_free_alloc(i8* %2, i8* %26) br label %free_done free_done: ; preds = %free_nonnull, %complex_div_cont %36 = load %complex_4, %complex_4* %x, align 1 %37 = extractvalue %complex_4 %36, 0 %38 = extractvalue %complex_4 %36, 1 %39 = call float @llvm.fabs.f32(float %37) %40 = call float @llvm.fabs.f32(float %38) %41 = fcmp oge float %39, %40 br i1 %41, label %complex_div_r_ge_s1, label %complex_div_r_lt_s2 complex_div_r_ge_s1: ; preds = %free_done %42 = fdiv float %38, %37 %43 = fmul float %38, %42 %44 = fadd float %37, %43 %45 = fmul float 0.000000e+00, %42 %46 = fadd float 2.000000e+00, %45 %47 = fmul float 2.000000e+00, %42 %48 = fsub float 0.000000e+00, %47 %49 = fdiv float %46, %44 %50 = fdiv float %48, %44 br label %complex_div_cont3 complex_div_r_lt_s2: ; preds = %free_done %51 = fdiv float %37, %38 %52 = fmul float %37, %51 %53 = fadd float %38, %52 %54 = fmul float 2.000000e+00, %51 %55 = fadd float %54, 0.000000e+00 %56 = fmul float 0.000000e+00, %51 %57 = fsub float %56, 2.000000e+00 %58 = fdiv float %55, %53 %59 = fdiv float %57, %53 br label %complex_div_cont3 complex_div_cont3: ; preds = %complex_div_r_lt_s2, %complex_div_r_ge_s1 %60 = phi float [ %49, %complex_div_r_ge_s1 ], [ %58, %complex_div_r_lt_s2 ] %61 = phi float [ %50, %complex_div_r_ge_s1 ], [ %59, %complex_div_r_lt_s2 ] %62 = insertvalue %complex_4 undef, float %60, 0 %63 = insertvalue %complex_4 %62, float %61, 1 store %complex_4 %63, %complex_4* %x, align 1 %64 = alloca i64, align 8 %65 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.1, i32 0, i32 0), i64* %64, i32 0, i32 0, i32 0, i32 0, i32 0, %complex_4* %x) %66 = load i64, i64* %64, align 8 %67 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %65, i8** %67, align 8 %68 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %66, i64* %68, align 8 %69 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %70 = load i8*, i8** %69, align 8 %71 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %72 = load i64, i64* %71, align 8 %73 = trunc i64 %72 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %70, i32 %73, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %74 = icmp eq i8* %65, null br i1 %74, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %complex_div_cont3 call void @_lfortran_free_alloc(i8* %2, i8* %65) br label %free_done6 free_done6: ; preds = %free_nonnull5, %complex_div_cont3 %75 = load %complex_4, %complex_4* %x, align 1 %76 = extractvalue %complex_4 %75, 0 %77 = extractvalue %complex_4 %75, 1 %78 = fadd float %76, 0.000000e+00 %79 = fadd float %77, 3.000000e+00 %80 = insertvalue %complex_4 undef, float %78, 0 %81 = insertvalue %complex_4 %80, float %79, 1 %82 = extractvalue %complex_4 %81, 0 %83 = extractvalue %complex_4 %81, 1 %84 = call float @llvm.fabs.f32(float %82) %85 = call float @llvm.fabs.f32(float %83) %86 = fcmp oge float %84, %85 br i1 %86, label %complex_div_r_ge_s7, label %complex_div_r_lt_s8 complex_div_r_ge_s7: ; preds = %free_done6 %87 = fdiv float %83, %82 %88 = fmul float %83, %87 %89 = fadd float %82, %88 %90 = fmul float 0.000000e+00, %87 %91 = fadd float 1.000000e+00, %90 %92 = fmul float 1.000000e+00, %87 %93 = fsub float 0.000000e+00, %92 %94 = fdiv float %91, %89 %95 = fdiv float %93, %89 br label %complex_div_cont9 complex_div_r_lt_s8: ; preds = %free_done6 %96 = fdiv float %82, %83 %97 = fmul float %82, %96 %98 = fadd float %83, %97 %99 = fmul float 1.000000e+00, %96 %100 = fadd float %99, 0.000000e+00 %101 = fmul float 0.000000e+00, %96 %102 = fsub float %101, 1.000000e+00 %103 = fdiv float %100, %98 %104 = fdiv float %102, %98 br label %complex_div_cont9 complex_div_cont9: ; preds = %complex_div_r_lt_s8, %complex_div_r_ge_s7 %105 = phi float [ %94, %complex_div_r_ge_s7 ], [ %103, %complex_div_r_lt_s8 ] %106 = phi float [ %95, %complex_div_r_ge_s7 ], [ %104, %complex_div_r_lt_s8 ] %107 = insertvalue %complex_4 undef, float %105, 0 %108 = insertvalue %complex_4 %107, float %106, 1 store %complex_4 %108, %complex_4* %x, align 1 %109 = alloca i64, align 8 %110 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.2, i32 0, i32 0), i64* %109, i32 0, i32 0, i32 0, i32 0, i32 0, %complex_4* %x) %111 = load i64, i64* %109, align 8 %112 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 store i8* %110, i8** %112, align 8 %113 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 store i64 %111, i64* %113, align 8 %114 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 %115 = load i8*, i8** %114, align 8 %116 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 %117 = load i64, i64* %116, align 8 %118 = trunc i64 %117 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %115, i32 %118, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %119 = icmp eq i8* %110, null br i1 %119, label %free_done12, label %free_nonnull11 free_nonnull11: ; preds = %complex_div_cont9 call void @_lfortran_free_alloc(i8* %2, i8* %110) br label %free_done12 free_done12: ; preds = %free_nonnull11, %complex_div_cont9 br label %return return: ; preds = %free_done12 br label %FINALIZE_SYMTABLE_complex2 FINALIZE_SYMTABLE_complex2: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) ; Function Attrs: nounwind readnone speculatable willreturn declare float @llvm.fabs.f32(float) #0 declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() attributes #0 = { nounwind readnone speculatable willreturn } lfortran-0.63.0/tests/reference/asr-polymorphic_class_compare-e58def6.stdout0000664000175000017500000006627615174404631027374 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { gftl2_integer32complex32map: (Module (SymbolTable 2 { map_s_iter_equal: (Function (SymbolTable 4 { 1_map_setiterator_i: (ExternalSymbol 4 1_map_setiterator_i 3 i map_setiterator [] i Public ), a: (Variable 4 a [] In () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 map_setiterator Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] In () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 map_setiterator Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), eq: (Variable 4 eq [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) map_s_iter_equal (FunctionType [(StructType [(Integer 4)] [] .true. .false. ) (StructType [(Integer 4)] [] .true. .false. )] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a) (Var 4 b)] [(Assignment (Var 4 eq) (IntegerCompare (StructInstanceMember (Var 4 a) 4 1_map_setiterator_i (Integer 4) () ) Eq (StructInstanceMember (Var 4 b) 4 1_map_setiterator_i (Integer 4) () ) (Logical 4) () ) () .false. .false. )] (Var 4 eq) Public .true. .true. () ), map_s_iter_not_equal: (Function (SymbolTable 5 { a: (Variable 5 a [] In () () Default (StructType [(Integer 4)] [] .false. .false. ) 2 map_setiterator Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 5 b [] In () () Default (StructType [(Integer 4)] [] .false. .false. ) 2 map_setiterator Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ne: (Variable 5 ne [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) map_s_iter_not_equal (FunctionType [(StructType [(Integer 4)] [] .false. .false. ) (StructType [(Integer 4)] [] .false. .false. )] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [map_s_iter_equal] [(Var 5 a) (Var 5 b)] [(Assignment (Var 5 ne) (OverloadedCompare (Var 5 a) Eq (Var 5 b) (Logical 4) () (FunctionCall 2 map_s_iter_equal 2 ~eq [((Var 5 a)) ((Var 5 b))] (Logical 4) () () ) ) () .false. .false. ) (Assignment (Var 5 ne) (LogicalNot (Var 5 ne) (Logical 4) () ) () .false. .false. )] (Var 5 ne) Public .true. .true. () ), map_setiterator: (Struct (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) map_setiterator (StructType [(Integer 4)] [] .true. .false. ) [] [i] [] Source Public .false. .false. [] () () [] ), ~eq: (CustomOperator 2 ~eq [2 map_s_iter_equal] Public ), ~noteq: (CustomOperator 2 ~noteq [2 map_s_iter_not_equal] Public ) }) gftl2_integer32complex32map () [] .false. .false. .false. ), polymorphic_class_compare: (Program (SymbolTable 6 { 1_map_setiterator_i: (ExternalSymbol 6 1_map_setiterator_i 3 i map_setiterator [] i Public ), iter1: (Variable 6 iter1 [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 6 map_setiterator Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iter2: (Variable 6 iter2 [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 6 map_setiterator Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), map_s_iter_equal: (ExternalSymbol 6 map_s_iter_equal 2 map_s_iter_equal gftl2_integer32complex32map [] map_s_iter_equal Public ), map_s_iter_not_equal: (ExternalSymbol 6 map_s_iter_not_equal 2 map_s_iter_not_equal gftl2_integer32complex32map [] map_s_iter_not_equal Public ), map_setiterator: (ExternalSymbol 6 map_setiterator 2 map_setiterator gftl2_integer32complex32map [] map_setiterator Public ), ~eq: (ExternalSymbol 6 ~eq 2 ~eq gftl2_integer32complex32map [] ~eq Public ), ~noteq: (ExternalSymbol 6 ~noteq 2 ~noteq gftl2_integer32complex32map [] ~noteq Public ) }) polymorphic_class_compare [gftl2_integer32complex32map] [(Assignment (StructInstanceMember (Var 6 iter1) 6 1_map_setiterator_i (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 6 iter2) 6 1_map_setiterator_i (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (If () (OverloadedCompare (Var 6 iter1) NotEq (Var 6 iter2) (Logical 4) () (FunctionCall 6 map_s_iter_not_equal 6 ~noteq [((Var 6 iter1)) ((Var 6 iter2))] (Logical 4) () () ) ) [(ErrorStop (StringConstant "Error: iter1 and iter2 should be equal" (String 1 (IntegerConstant 38 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_error_06-1cbc8a9.json0000664000175000017500000000075715174404631025070 0ustar alastairalastair{ "basename": "asr-template_error_06-1cbc8a9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_06.f90", "infile_hash": "2b64257bcef60714fb0f3ffe6eac5832664b957c001fdfad2238c161", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_06-1cbc8a9.stderr", "stderr_hash": "bb2807cb7bd5ec770c93e19e96535a404d5ffd6277814d2f741d1b06", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-fixed_form_goto_select-a0c3483.stdout0000664000175000017500000001452215174404631026447 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { k: (Variable 2 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 2 m [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main [] [(Assignment (Var 2 k) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (GoToTarget 100 100 ) (Print (StringConstant "hello" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (GoToTarget 200 200 ) (Assignment (Var 2 k) (IntegerBinOp (Var 2 k) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 m) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 n) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Select () (Var 2 m) [(CaseStmt [(IntegerConstant 1 (Integer 4) Decimal)] [(GoTo 200 200 )] .false. ) (CaseStmt [(IntegerConstant 2 (Integer 4) Decimal)] [(GoTo 100 100 )] .false. )] [] .false. ) (Select () (Var 2 n) [(CaseStmt [(IntegerConstant 1 (Integer 4) Decimal)] [(GoTo 100 100 )] .false. ) (CaseStmt [(IntegerConstant 2 (Integer 4) Decimal)] [(GoTo 200 200 )] .false. )] [] .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-block_02-bdd6766.json0000664000175000017500000000110015174404631023521 0ustar alastairalastair{ "basename": "ast_f90-block_02-bdd6766", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/block_02.f90", "infile_hash": "454b633240fa00d44de1b5374429d3d7edc1c37ccd92b8b93394d639", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-block_02-bdd6766.stdout", "stdout_hash": "a32e429d8baa7f7afbb9aa01eb34fe290749104aaadd2e42f87d20d8", "stderr": "ast_f90-block_02-bdd6766.stderr", "stderr_hash": "60488b7fcd202fd28a9fb7045091257667eed65fe1dec8040b9c2871", "returncode": 0 }lfortran-0.63.0/tests/reference/ast-modules_02-dc19c13.json0000664000175000017500000000072315174404631023420 0ustar alastairalastair{ "basename": "ast-modules_02-dc19c13", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/modules_02.f90", "infile_hash": "ca174c023f6a46f31eb8ac10ec968019baffb0a012c5211dc6e65ec4", "outfile": null, "outfile_hash": null, "stdout": "ast-modules_02-dc19c13.stdout", "stdout_hash": "02640e5ed5afc0852140eeca68ee98bda73bc03c80c5b80debb64a8e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-derived_types_45-ae31b1c.json0000664000175000017500000000077515174404631025067 0ustar alastairalastair{ "basename": "llvm-derived_types_45-ae31b1c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_45.f90", "infile_hash": "e7e4e87444a93ff6319b6d19dac06c02b600da19c934e28fdc831374", "outfile": null, "outfile_hash": null, "stdout": "llvm-derived_types_45-ae31b1c.stdout", "stdout_hash": "8a49d8523bcb24fdf258ce3ac1a4cdf962f28da86732d0e54e1d422d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-external_02-99f90be.json0000664000175000017500000000076515174404631024003 0ustar alastairalastair{ "basename": "llvm-external_02-99f90be", "cmd": "lfortran --show-llvm --implicit-typing --implicit-interface {infile} -o {outfile}", "infile": "tests/external_02.f90", "infile_hash": "229cee9d64d77be22b3786ec7d91c285922a45bcd94b40f9d7e0d2b9", "outfile": null, "outfile_hash": null, "stdout": "llvm-external_02-99f90be.stdout", "stdout_hash": "4e5dde64a2f5c6ebd5f77afc8fce74f898b79d4753132cce6fd005ce", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-program3-557dbe8.stdout0000664000175000017500000004731715174404631023576 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { program3: (Program (SymbolTable 2 { func1: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 3 c [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) func1 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [func2] [(Var 3 a) (Var 3 b)] [(Assignment (Var 3 c) (RealBinOp (Var 3 a) Add (Var 3 b) (Real 4) () ) () .false. .false. ) (Assignment (Var 3 c) (FunctionCall 2 func2 () [((Var 3 c)) ((Var 3 c))] (Real 4) () () ) () .false. .false. )] (Var 3 c) Public .true. .true. () ), func2: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 4 c [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) func2 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a) (Var 4 b)] [(Assignment (Var 4 c) (RealBinOp (Var 4 a) Mul (Var 4 b) (Real 4) () ) () .false. .false. )] (Var 4 c) Public .true. .true. () ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) program3 [] [(Assignment (Var 2 x) (RealConstant 5.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 y) (RealConstant 2.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 z) (RealBinOp (Var 2 x) Mul (Var 2 y) (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "10.0 ==" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 z) (FunctionCall 2 func1 () [((Var 2 x)) ((Var 2 y))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "49.0 ==" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 z) (FunctionCall 2 func2 () [((Var 2 x)) ((Var 2 y))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "10.0 ==" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-data_implied_do2-fc94c6e.stderr0000664000175000017500000000032415174404631025250 0ustar alastairalastairsemantic error: The increment variable of the data implied do loop must be a constant --> tests/errors/data_implied_do2.f90:5:27 | 5 | data(iarx(i), i=1, 3, k) / 1, 2, 3 / | ^ lfortran-0.63.0/tests/reference/ast-procedure_with_type-4c8ea35.stdout0000664000175000017500000001000215174404631026100 0ustar alastairalastair(TranslationUnit [(Program procedure_with_type () [] [] [(Declaration (AttrType TypeProcedure [] () () None ) [(SimpleAttribute AttrPointer )] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeProcedure [] () () None ) [(SimpleAttribute AttrPointer )] [(y [] [] () () None ())] () ) (Declaration (AttrType TypeProcedure [] () doubleprecision None ) [(SimpleAttribute AttrPointer )] [(yb [] [] () () None ())] () ) (Declaration (AttrType TypeProcedure [] () integer None ) [(SimpleAttribute AttrPointer )] [(z [] [] () () None ())] () ) (Declaration (AttrType TypeProcedure [] () real None ) [(SimpleAttribute AttrPointer )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeProcedure [] () complex None ) [(SimpleAttribute AttrPointer )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeProcedure [] () () None ) [(SimpleAttribute AttrPointer )] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(dp [] [] () (FuncCallOrArray kind [] [(() (Real "0.d0") () 0)] [] [] [] ) Equal ())] () ) (Declaration (AttrType TypeProcedure [] () () None ) [(SimpleAttribute AttrPointer )] [(d [] [] () () None ())] () ) (Declaration (AttrType TypeProcedure [] () () None ) [(SimpleAttribute AttrPointer )] [(e [] [] () () None ())] () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr_openmp-openmp_44-1c0f6fe.stdout0000664000175000017500000056746515174404631025311 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), omp_lib: (Module (SymbolTable 8 { c_bool: (ExternalSymbol 8 c_bool 43 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 8 c_funptr 43 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 8 c_int 43 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 8 c_long 43 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 8 c_ptr 43 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (Function (SymbolTable 9 { }) gomp_atomic_end (FunctionType [] () BindC Interface "GOMP_atomic_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_atomic_start: (Function (SymbolTable 10 { }) gomp_atomic_start (FunctionType [] () BindC Interface "GOMP_atomic_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_barrier: (Function (SymbolTable 11 { }) gomp_barrier (FunctionType [] () BindC Interface "GOMP_barrier" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_end: (Function (SymbolTable 12 { }) gomp_critical_end (FunctionType [] () BindC Interface "GOMP_critical_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_start: (Function (SymbolTable 13 { }) gomp_critical_start (FunctionType [] () BindC Interface "GOMP_critical_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_auto_next: (Function (SymbolTable 14 { gomp_loop_auto_next: (Variable 14 gomp_loop_auto_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 14 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 14 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_auto_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_auto_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 14 istart) (Var 14 iend)] [] (Var 14 gomp_loop_auto_next) Public .false. .false. () ), gomp_loop_auto_start: (Function (SymbolTable 15 { end: (Variable 15 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_auto_start: (Variable 15 gomp_loop_auto_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 15 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 15 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 15 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 15 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_auto_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_auto_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 15 start) (Var 15 end) (Var 15 incr) (Var 15 istart) (Var 15 iend)] [] (Var 15 gomp_loop_auto_start) Public .false. .false. () ), gomp_loop_dynamic_next: (Function (SymbolTable 16 { gomp_loop_dynamic_next: (Variable 16 gomp_loop_dynamic_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 16 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 16 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_dynamic_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_dynamic_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 16 istart) (Var 16 iend)] [] (Var 16 gomp_loop_dynamic_next) Public .false. .false. () ), gomp_loop_dynamic_start: (Function (SymbolTable 17 { chunk: (Variable 17 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), end: (Variable 17 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_dynamic_start: (Variable 17 gomp_loop_dynamic_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 17 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 17 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 17 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 17 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_dynamic_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_dynamic_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 start) (Var 17 end) (Var 17 incr) (Var 17 chunk) (Var 17 istart) (Var 17 iend)] [] (Var 17 gomp_loop_dynamic_start) Public .false. .false. () ), gomp_loop_end: (Function (SymbolTable 18 { }) gomp_loop_end (FunctionType [] () BindC Interface "GOMP_loop_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_end_nowait: (Function (SymbolTable 19 { }) gomp_loop_end_nowait (FunctionType [] () BindC Interface "GOMP_loop_end_nowait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_guided_next: (Function (SymbolTable 20 { gomp_loop_guided_next: (Variable 20 gomp_loop_guided_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 20 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 20 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_guided_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_guided_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 istart) (Var 20 iend)] [] (Var 20 gomp_loop_guided_next) Public .false. .false. () ), gomp_loop_guided_start: (Function (SymbolTable 21 { chunk: (Variable 21 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), end: (Variable 21 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_guided_start: (Variable 21 gomp_loop_guided_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 21 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 21 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 21 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 21 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_guided_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_guided_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 21 start) (Var 21 end) (Var 21 incr) (Var 21 chunk) (Var 21 istart) (Var 21 iend)] [] (Var 21 gomp_loop_guided_start) Public .false. .false. () ), gomp_loop_runtime_next: (Function (SymbolTable 22 { gomp_loop_runtime_next: (Variable 22 gomp_loop_runtime_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 22 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 22 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_runtime_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_runtime_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 22 istart) (Var 22 iend)] [] (Var 22 gomp_loop_runtime_next) Public .false. .false. () ), gomp_loop_runtime_start: (Function (SymbolTable 23 { end: (Variable 23 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_runtime_start: (Variable 23 gomp_loop_runtime_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 23 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 23 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 23 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 23 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_runtime_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_runtime_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 23 start) (Var 23 end) (Var 23 incr) (Var 23 istart) (Var 23 iend)] [] (Var 23 gomp_loop_runtime_start) Public .false. .false. () ), gomp_loop_static_next: (Function (SymbolTable 24 { gomp_loop_static_next: (Variable 24 gomp_loop_static_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 24 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 24 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_static_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_static_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 24 istart) (Var 24 iend)] [] (Var 24 gomp_loop_static_next) Public .false. .false. () ), gomp_loop_static_start: (Function (SymbolTable 25 { chunk: (Variable 25 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), end: (Variable 25 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_static_start: (Variable 25 gomp_loop_static_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 25 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 25 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 25 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 25 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_static_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_static_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 25 start) (Var 25 end) (Var 25 incr) (Var 25 chunk) (Var 25 istart) (Var 25 iend)] [] (Var 25 gomp_loop_static_start) Public .false. .false. () ), gomp_parallel: (Function (SymbolTable 26 { data: (Variable 26 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), flags: (Variable 26 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), fn: (Variable 26 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), num_threads: (Variable 26 num_threads [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_parallel (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_parallel" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 26 fn) (Var 26 data) (Var 26 num_threads) (Var 26 flags)] [] () Public .false. .false. () ), gomp_sections_end: (Function (SymbolTable 27 { }) gomp_sections_end (FunctionType [] () BindC Interface "GOMP_sections_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_sections_next: (Function (SymbolTable 28 { gomp_sections_next: (Variable 28 gomp_sections_next [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_sections_next (FunctionType [] (Integer 4) BindC Interface "GOMP_sections_next" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 28 gomp_sections_next) Public .false. .false. () ), gomp_sections_start: (Function (SymbolTable 29 { count: (Variable 29 count [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_sections_start: (Variable 29 gomp_sections_start [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_sections_start (FunctionType [(Integer 4)] (Integer 4) BindC Interface "GOMP_sections_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 29 count)] [] (Var 29 gomp_sections_start) Public .false. .false. () ), gomp_task: (Function (SymbolTable 30 { arg_align: (Variable 30 arg_align [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), arg_size: (Variable 30 arg_size [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), cpyfn: (Variable 30 cpyfn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), data: (Variable 30 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), depend: (Variable 30 depend [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), flags: (Variable 30 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), fn: (Variable 30 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), if_clause: (Variable 30 if_clause [] Unspecified () () Default (Logical 1) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_task (FunctionType [(CPtr) (CPtr) (CPtr) (Integer 8) (Integer 8) (Logical 1) (Integer 4) (CPtr)] () BindC Interface "GOMP_task" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 30 fn) (Var 30 data) (Var 30 cpyfn) (Var 30 arg_size) (Var 30 arg_align) (Var 30 if_clause) (Var 30 flags) (Var 30 depend)] [] () Public .false. .false. () ), gomp_taskwait: (Function (SymbolTable 31 { }) gomp_taskwait (FunctionType [] () BindC Interface "GOMP_taskwait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_teams: (Function (SymbolTable 32 { data: (Variable 32 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), fn: (Variable 32 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), num_teams: (Variable 32 num_teams [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), thread_limit: (Variable 32 thread_limit [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_teams (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_teams_reg" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 32 fn) (Var 32 data) (Var 32 num_teams) (Var 32 thread_limit)] [] () Public .false. .false. () ), omp_get_max_threads: (Function (SymbolTable 33 { omp_get_max_threads: (Variable 33 omp_get_max_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_max_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_max_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 33 omp_get_max_threads) Public .false. .false. () ), omp_get_num_procs: (Function (SymbolTable 34 { omp_get_num_procs: (Variable 34 omp_get_num_procs [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_num_procs (FunctionType [] (Integer 4) BindC Interface "omp_get_num_procs" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 34 omp_get_num_procs) Public .false. .false. () ), omp_get_num_teams: (Function (SymbolTable 35 { omp_get_num_teams: (Variable 35 omp_get_num_teams [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_num_teams (FunctionType [] (Integer 4) BindC Interface "omp_get_num_teams" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 35 omp_get_num_teams) Public .false. .false. () ), omp_get_num_threads: (Function (SymbolTable 36 { omp_get_num_threads: (Variable 36 omp_get_num_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_num_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 36 omp_get_num_threads) Public .false. .false. () ), omp_get_team_num: (Function (SymbolTable 37 { omp_get_team_num: (Variable 37 omp_get_team_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_team_num (FunctionType [] (Integer 4) BindC Interface "omp_get_team_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 37 omp_get_team_num) Public .false. .false. () ), omp_get_team_size: (Function (SymbolTable 38 { level: (Variable 38 level [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), omp_get_team_size: (Variable 38 omp_get_team_size [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_team_size (FunctionType [(Integer 4)] (Integer 4) BindC Interface "omp_get_team_size" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 38 level)] [] (Var 38 omp_get_team_size) Public .false. .false. () ), omp_get_thread_num: (Function (SymbolTable 39 { omp_get_thread_num: (Variable 39 omp_get_thread_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_thread_num (FunctionType [] (Integer 4) BindC Interface "omp_get_thread_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 39 omp_get_thread_num) Public .false. .false. () ), omp_get_wtime: (Function (SymbolTable 40 { omp_get_wtime: (Variable 40 omp_get_wtime [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_wtime (FunctionType [] (Real 8) BindC Interface "omp_get_wtime" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 40 omp_get_wtime) Public .false. .false. () ), omp_set_num_threads: (Function (SymbolTable 41 { n: (Variable 41 n [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_set_num_threads (FunctionType [(Integer 4)] () BindC Interface "omp_set_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 41 n)] [] () Public .false. .false. () ) }) omp_lib () [iso_c_binding] .true. .false. .false. ), openmp_44: (Program (SymbolTable 6 { c_bool: (ExternalSymbol 6 c_bool 43 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 6 c_funptr 43 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 6 c_int 43 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 6 c_long 43 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 6 c_ptr 43 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), compute_a: (ExternalSymbol 6 compute_a 2 compute_a openmp_44_parallel_sections [] compute_a Public ), compute_b: (ExternalSymbol 6 compute_b 2 compute_b openmp_44_parallel_sections [] compute_b Public ), compute_c: (ExternalSymbol 6 compute_c 2 compute_c openmp_44_parallel_sections [] compute_c Public ), gomp_atomic_end: (ExternalSymbol 6 gomp_atomic_end 8 gomp_atomic_end omp_lib [] gomp_atomic_end Public ), gomp_atomic_start: (ExternalSymbol 6 gomp_atomic_start 8 gomp_atomic_start omp_lib [] gomp_atomic_start Public ), gomp_barrier: (ExternalSymbol 6 gomp_barrier 8 gomp_barrier omp_lib [] gomp_barrier Public ), gomp_critical_end: (ExternalSymbol 6 gomp_critical_end 8 gomp_critical_end omp_lib [] gomp_critical_end Public ), gomp_critical_start: (ExternalSymbol 6 gomp_critical_start 8 gomp_critical_start omp_lib [] gomp_critical_start Public ), gomp_loop_auto_next: (ExternalSymbol 6 gomp_loop_auto_next 8 gomp_loop_auto_next omp_lib [] gomp_loop_auto_next Public ), gomp_loop_auto_start: (ExternalSymbol 6 gomp_loop_auto_start 8 gomp_loop_auto_start omp_lib [] gomp_loop_auto_start Public ), gomp_loop_dynamic_next: (ExternalSymbol 6 gomp_loop_dynamic_next 8 gomp_loop_dynamic_next omp_lib [] gomp_loop_dynamic_next Public ), gomp_loop_dynamic_start: (ExternalSymbol 6 gomp_loop_dynamic_start 8 gomp_loop_dynamic_start omp_lib [] gomp_loop_dynamic_start Public ), gomp_loop_end: (ExternalSymbol 6 gomp_loop_end 8 gomp_loop_end omp_lib [] gomp_loop_end Public ), gomp_loop_end_nowait: (ExternalSymbol 6 gomp_loop_end_nowait 8 gomp_loop_end_nowait omp_lib [] gomp_loop_end_nowait Public ), gomp_loop_guided_next: (ExternalSymbol 6 gomp_loop_guided_next 8 gomp_loop_guided_next omp_lib [] gomp_loop_guided_next Public ), gomp_loop_guided_start: (ExternalSymbol 6 gomp_loop_guided_start 8 gomp_loop_guided_start omp_lib [] gomp_loop_guided_start Public ), gomp_loop_runtime_next: (ExternalSymbol 6 gomp_loop_runtime_next 8 gomp_loop_runtime_next omp_lib [] gomp_loop_runtime_next Public ), gomp_loop_runtime_start: (ExternalSymbol 6 gomp_loop_runtime_start 8 gomp_loop_runtime_start omp_lib [] gomp_loop_runtime_start Public ), gomp_loop_static_next: (ExternalSymbol 6 gomp_loop_static_next 8 gomp_loop_static_next omp_lib [] gomp_loop_static_next Public ), gomp_loop_static_start: (ExternalSymbol 6 gomp_loop_static_start 8 gomp_loop_static_start omp_lib [] gomp_loop_static_start Public ), gomp_parallel: (ExternalSymbol 6 gomp_parallel 8 gomp_parallel omp_lib [] gomp_parallel Public ), gomp_sections_end: (ExternalSymbol 6 gomp_sections_end 8 gomp_sections_end omp_lib [] gomp_sections_end Public ), gomp_sections_next: (ExternalSymbol 6 gomp_sections_next 8 gomp_sections_next omp_lib [] gomp_sections_next Public ), gomp_sections_start: (ExternalSymbol 6 gomp_sections_start 8 gomp_sections_start omp_lib [] gomp_sections_start Public ), gomp_task: (ExternalSymbol 6 gomp_task 8 gomp_task omp_lib [] gomp_task Public ), gomp_taskwait: (ExternalSymbol 6 gomp_taskwait 8 gomp_taskwait omp_lib [] gomp_taskwait Public ), gomp_teams: (ExternalSymbol 6 gomp_teams 8 gomp_teams omp_lib [] gomp_teams Public ), omp_get_max_threads: (ExternalSymbol 6 omp_get_max_threads 8 omp_get_max_threads omp_lib [] omp_get_max_threads Public ), omp_get_num_procs: (ExternalSymbol 6 omp_get_num_procs 8 omp_get_num_procs omp_lib [] omp_get_num_procs Public ), omp_get_num_teams: (ExternalSymbol 6 omp_get_num_teams 8 omp_get_num_teams omp_lib [] omp_get_num_teams Public ), omp_get_num_threads: (ExternalSymbol 6 omp_get_num_threads 8 omp_get_num_threads omp_lib [] omp_get_num_threads Public ), omp_get_team_num: (ExternalSymbol 6 omp_get_team_num 8 omp_get_team_num omp_lib [] omp_get_team_num Public ), omp_get_team_size: (ExternalSymbol 6 omp_get_team_size 8 omp_get_team_size omp_lib [] omp_get_team_size Public ), omp_get_thread_num: (ExternalSymbol 6 omp_get_thread_num 8 omp_get_thread_num omp_lib [] omp_get_thread_num Public ), omp_get_wtime: (ExternalSymbol 6 omp_get_wtime 8 omp_get_wtime omp_lib [] omp_get_wtime Public ), omp_set_num_threads: (ExternalSymbol 6 omp_set_num_threads 8 omp_set_num_threads omp_lib [] omp_set_num_threads Public ), tid: (Variable 6 tid [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) openmp_44 [omp_lib openmp_44_parallel_sections] [(OMPRegion ParallelSections [(OMPReduction ReduceAdd [(Var 6 tid)] )] [(OMPRegion Section [] [(SubroutineCall 6 compute_a () [] () .false. ) (Assignment (Var 6 tid) (IntegerBinOp (Var 6 tid) Add (FunctionCall 6 omp_get_thread_num () [] (Integer 4) () () ) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Thread ID:" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 tid)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) (OMPRegion Section [] [(SubroutineCall 6 compute_b () [] () .false. ) (Assignment (Var 6 tid) (IntegerBinOp (Var 6 tid) Add (FunctionCall 6 omp_get_thread_num () [] (Integer 4) () () ) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Thread ID:" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 tid)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) (OMPRegion Section [] [(SubroutineCall 6 compute_c () [] () .false. ) (Assignment (Var 6 tid) (IntegerBinOp (Var 6 tid) Add (FunctionCall 6 omp_get_thread_num () [] (Integer 4) () () ) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Thread ID:" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 tid)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] )] ) (Print (StringFormat () [(StringConstant "Final Thread ID:" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 tid)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), openmp_44_parallel_sections: (Module (SymbolTable 2 { compute_a: (Function (SymbolTable 3 { }) compute_a (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "Computing A" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), compute_b: (Function (SymbolTable 4 { }) compute_b (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "Computing B" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), compute_c: (Function (SymbolTable 5 { }) compute_c (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "Computing C" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ) }) openmp_44_parallel_sections () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-incorrect_type_where_03-a95b1f2.stderr0000664000175000017500000000026615174404631026530 0ustar alastairalastairsemantic error: the argument to `where` must be an array --> tests/errors/incorrect_type_where_03.f90:5:10 | 5 | where(max(1.33, 2.67)) b = 12121 | ^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-template_add_04-1710dbc.stdout0000664000175000017500000022700715174404631024744 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_add_04: (Program (SymbolTable 12 { add_t: (ExternalSymbol 12 add_t 2 add_t template_add_04_m [] add_t Public ), r: (ExternalSymbol 12 r 2 r template_add_04_m [] r Public ), test_template: (ExternalSymbol 12 test_template 2 test_template template_add_04_m [] test_template Public ) }) template_add_04 [template_add_04_m] [(SubroutineCall 12 test_template () [] () .false. )] ), template_add_04_m: (Module (SymbolTable 2 { add_t: (Template (SymbolTable 5 { add_generic: (Function (SymbolTable 7 { i: (Variable 7 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lfortran_tmp: (Variable 7 lfortran_tmp [] Local () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 7 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 7 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 7 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_generic (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 7 x) (Var 7 y)] [(Assignment (Var 7 z) (FunctionCall 5 f () [((Var 7 x)) ((Var 7 y))] (TypeParameter t ) () () ) () .false. .false. ) (DoLoop () ((Var 7 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerBinOp (Var 5 mult) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(Assignment (Var 7 lfortran_tmp) (FunctionCall 5 f () [((Var 7 x)) ((Var 7 y))] (TypeParameter t ) () () ) () .false. .false. ) (Assignment (Var 7 z) (FunctionCall 5 f () [((Var 7 z)) ((Var 7 lfortran_tmp))] (TypeParameter t ) () () ) () .false. .false. )] [] )] (Var 7 z) Public .true. .true. () ), f: (Function (SymbolTable 6 { x: (Variable 6 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 6 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 6 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 6 x) (Var 6 y)] [] (Var 6 z) Private .true. .true. () ), mult: (Variable 5 mult [] Unspecified () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_t [t f mult] [(Require r [t f] )] ), func_arg_int: (Function (SymbolTable 9 { x: (Variable 9 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 9 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 9 z [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) func_arg_int (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 x) (Var 9 y)] [(Assignment (Var 9 z) (IntegerBinOp (Var 9 x) Add (Var 9 y) (Integer 4) () ) () .false. .false. )] (Var 9 z) Private .true. .true. () ), func_arg_real: (Function (SymbolTable 8 { x: (Variable 8 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 8 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 8 z [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) func_arg_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 x) (Var 8 y)] [(Assignment (Var 8 z) (RealBinOp (Var 8 x) Add (Var 8 y) (Real 4) () ) () .false. .false. )] (Var 8 z) Private .true. .true. () ), r: (Requirement (SymbolTable 3 { f: (Function (SymbolTable 4 { x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 4 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 z) Private .true. .true. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) r [t f] [] ), test_template: (Function (SymbolTable 10 { a: (Variable 10 a [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), add_real: (Function (SymbolTable 11 { i: (Variable 11 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lfortran_tmp: (Variable 11 lfortran_tmp [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 11 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 11 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 11 z [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [func_arg_real] [(Var 11 x) (Var 11 y)] [(Assignment (Var 11 z) (FunctionCall 2 func_arg_real () [((Var 11 x)) ((Var 11 y))] (Real 4) () () ) () .false. .false. ) (DoLoop () ((Var 11 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerBinOp (Var 10 n) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(Assignment (Var 11 lfortran_tmp) (FunctionCall 2 func_arg_real () [((Var 11 x)) ((Var 11 y))] (Real 4) () () ) () .false. .false. ) (Assignment (Var 11 z) (FunctionCall 2 func_arg_real () [((Var 11 z)) ((Var 11 lfortran_tmp))] (Real 4) () () ) () .false. .false. )] [] )] (Var 11 z) Public .true. .true. () ), b: (Variable 10 b [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 10 n [] Local (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 10 x [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 10 y [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 10 x) (RealConstant 5.100000 (Real 4) ) () .false. .false. ) (Assignment (Var 10 y) (RealConstant 7.200000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "The result is " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 10 add_real () [((Var 10 x)) ((Var 10 y))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_add_04_m () [template_add_04_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/run-scalar_allocation_check_05-e3b524c.json0000664000175000017500000000076215174404631026602 0ustar alastairalastair{ "basename": "run-scalar_allocation_check_05-e3b524c", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/scalar_allocation_check_05.f90", "infile_hash": "91825bf77fdb8c4fefb42a24592cd3e1e2f6039bbe91ba027bcd061e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-scalar_allocation_check_05-e3b524c.stderr", "stderr_hash": "7a791bcbc0fe2eaebbfcb3eeb7b4d05515c7fdaec61368bd9455155a", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-logical1-fd6d5c4.json0000664000175000017500000000074215174404631023231 0ustar alastairalastair{ "basename": "asr-logical1-fd6d5c4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/logical1.f90", "infile_hash": "3768bda3700377afdf458a45ed70e2be9481e14ae76fda62adbe38e8", "outfile": null, "outfile_hash": null, "stdout": "asr-logical1-fd6d5c4.stdout", "stdout_hash": "7b22c390a52a3fb5761602c8076c466314466d3252abfb8e223b7ca4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics1-8ebce32.json0000664000175000017500000000073515174404631024002 0ustar alastairalastair{ "basename": "asr-intrinsics1-8ebce32", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics1.f90", "infile_hash": "c17e977183f2f0697725d766de0a9760cc2c8dfe7876932015490368", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics1-8ebce32.stderr", "stderr_hash": "a69fa16bae643b9253b934b298aae5af0979d43539549ac688767051", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-callback_01-21b53de.json0000664000175000017500000000075315174404631023502 0ustar alastairalastair{ "basename": "asr-callback_01-21b53de", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/callback_01.f90", "infile_hash": "d2c103564620acefc4245ff5eb5dfe84478276bead512800823259da", "outfile": null, "outfile_hash": null, "stdout": "asr-callback_01-21b53de.stdout", "stdout_hash": "4c33fe4a9dfc4457cfdcc7181ade4ef678193dc8b94daf0bd4d3f445", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-subroutine5-0e48a69.json0000664000175000017500000000071715174404631024204 0ustar alastairalastair{ "basename": "julia-subroutine5-0e48a69", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/subroutine5.f90", "infile_hash": "88c62ffd8f005d7a511511e43da68f25e8fe795a75fec462baa25885", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutine5-0e48a69.stdout", "stdout_hash": "94186e6ae5072480bdc1f2f5268b910b4d4e8380628a8b2a738c3f6b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/fortran-complex_to_complex_cast_fortran_codegen-d2ad266.json0000664000175000017500000000106615174404631032466 0ustar alastairalastair{ "basename": "fortran-complex_to_complex_cast_fortran_codegen-d2ad266", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/complex_to_complex_cast_fortran_codegen.f90", "infile_hash": "afdf4c4f3cfefb63f73acbec98dbc6286bca79bdc47f1e0649f737c4", "outfile": null, "outfile_hash": null, "stdout": "fortran-complex_to_complex_cast_fortran_codegen-d2ad266.stdout", "stdout_hash": "b5e097995d8f158928cc036dbfab1380f8b8b28e45702be6beb9c159", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-string_01-deb8ed3.stdout0000664000175000017500000000615515174404631024165 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @my_name_data = private global [7 x i8] c"Dominic" @my_name = private global %string_descriptor <{ i8* getelementptr inbounds ([7 x i8], [7 x i8]* @my_name_data, i32 0, i32 0), i64 7 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [19 x i8] c"S-DESC-11,S-DESC-7\00", align 1 @string_const_data = private constant [11 x i8] c"My name is " @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([11 x i8], [11 x i8]* @string_const_data, i32 0, i32 0), i64 11 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %3 = alloca i64, align 8 %4 = load %string_descriptor, %string_descriptor* @my_name, align 1 %5 = alloca %string_descriptor, align 8 store %string_descriptor %4, %string_descriptor* %5, align 1 %6 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const, %string_descriptor* %5) %7 = load i64, i64* %3, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %6, i8** %8, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %7, i64* %9, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %11 = load i8*, i8** %10, align 8 %12 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %13 = load i64, i64* %12, align 8 %14 = trunc i64 %13 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %11, i32 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %15 = icmp eq i8* %6, null br i1 %15, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %6) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_print_01 FINALIZE_SYMTABLE_print_01: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/run-format_27-3469667.json0000664000175000017500000000071515174404631023066 0ustar alastairalastair{ "basename": "run-format_27-3469667", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_27.f90", "infile_hash": "2abc6c4108f92794b81644eadaa44c6542867b7dac138f276656fb6d", "outfile": null, "outfile_hash": null, "stdout": "run-format_27-3469667.stdout", "stdout_hash": "9d7266b9f5fd59e7fc3ba208639b54e6de527c3cc5590951ecf4973e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-maskl_incorrect_bit_size-62a84b0.stderr0000664000175000017500000000032415174404631026762 0ustar alastairalastairsemantic error: first argument of `maskl` must be less than or equal to the BIT_SIZE of INTEGER(KIND=4) --> tests/errors/maskl_incorrect_bit_size.f90:2:12 | 2 | print*, maskl(63) | ^^^^^^^^^ lfortran-0.63.0/tests/reference/fortran-real_to_real_cast_fortran_codegen-b969b0f.json0000664000175000017500000000104415174404631031223 0ustar alastairalastair{ "basename": "fortran-real_to_real_cast_fortran_codegen-b969b0f", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/real_to_real_cast_fortran_codegen.f90", "infile_hash": "101385afd4eb558d127d1dad0192c160bee2cfc84bb2413cf32f4196", "outfile": null, "outfile_hash": null, "stdout": "fortran-real_to_real_cast_fortran_codegen-b969b0f.stdout", "stdout_hash": "2eaca20b156b3b2e94e081a2df0601da4e228ad42d663a51a40594ab", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-fixed_form_call3-8c7b642.stderr0000664000175000017500000000026315174404631025126 0ustar alastairalastairsyntax error: Token ')' is unexpected here --> tests/fixed_form_call3.f:5:43 | 5 | call prinf('16m+70 = *',16*m+70,1)) | ^ lfortran-0.63.0/tests/reference/ast-sync1-9624944.stdout0000664000175000017500000000635015174404631022655 0ustar alastairalastair(TranslationUnit [(Program sync1 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(iam [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(x [] [(() () CodimensionStar)] () () None ())] () )] [(Assignment 0 iam (FuncCallOrArray this_image [] [] [] [] [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (== iam 1) [(Assignment 0 x (Real "1.0") () )] [] () () () ) (SyncMemory 0 [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SubroutineCall 0 external_sync [] [] [] [] () ) (SyncMemory 0 [(AttrStat status )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (== iam 2) [(Write 0 [(()) (())] [] [(CoarrayRef x [] [] [] [(() 1 () CodimensionExpr)] [] )] () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (== (FuncCallOrArray this_image [] [] [] [] [] ) 1) [(SyncImages 0 () Asterisk [] () )] [(SyncImages 0 1 None [(AttrStat status )] () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/asr-intrinsics_11-13a7587.json0000664000175000017500000000076115174404631024005 0ustar alastairalastair{ "basename": "asr-intrinsics_11-13a7587", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_11.f90", "infile_hash": "22ac1dd1527a39d35236a50e3b1afe37ab40b0970f22d259a077800f", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_11-13a7587.stdout", "stdout_hash": "fcdca398c6d1e824167364391195cce79b3a1702b5a9158b46550250", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-complex_mul_test-562260f.stdout0000664000175000017500000001407715174404631025253 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex2: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) complex2 [] [(Assignment (Var 2 x) (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 4.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 x) (ComplexBinOp (Var 2 x) Mul (Cast (RealConstant 4.000000 (Real 4) ) RealToComplex (Complex 4) (ComplexConstant 4.000000 0.000000 (Complex 4) ) () ) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (ComplexBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 2.000000 0.000000 (Complex 4) ) () ) Mul (Var 2 x) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (ComplexBinOp (Var 2 x) Mul (ComplexConstructor (RealConstant 0.000000 (Real 4) ) (RealConstant 3.000000 (Real 4) ) (Complex 4) (ComplexConstant 0.000000 3.000000 (Complex 4) ) ) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-global_scope2-181c327.json0000664000175000017500000000073415174404631024025 0ustar alastairalastair{ "basename": "ast-global_scope2-181c327", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/global_scope2.f90", "infile_hash": "e511f118b9a040b5e7a3ff2ad75cd7942dee08d3a21bd4ca5cd668b3", "outfile": null, "outfile_hash": null, "stdout": "ast-global_scope2-181c327.stdout", "stdout_hash": "325fc3cf71aa455627445d19cd3444cf82fb01c030dda2c15eaa02cf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-arrays_op_6-030b24e.stdout0000664000175000017500000014336415174404631024163 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array_op_5: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), asquare: (Function (SymbolTable 3 { a: (Variable 3 a [] Unspecified () () Default (Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] Unspecified () () Default (Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 3 c [] Unspecified () () Default (Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 3 d [] ReturnVar () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) asquare (FunctionType [(Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray )] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 c)] [(Assignment (Var 3 d) (RealBinOp (RealBinOp (Var 3 a) Add (Var 3 b) (Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray ) () ) Add (Var 3 c) (Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray ) () ) () .false. .false. )] (Var 3 d) Public .true. .true. () ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), check: (Function (SymbolTable 4 { c: (Variable 4 c [] In () () Default (Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 4 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 4 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) check (FunctionType [(Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 c)] [(DoLoop () ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(If () (RealCompare (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 4) ColMajor () ) NotEq (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 4 i) Add (Var 4 j) (Integer 4) () ) Add (Var 4 k) (Integer 4) () ) Pow (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 4) () () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] )] [] )] () Public .true. .true. () ), d: (Variable 2 d [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 2 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) array_op_5 [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(DoLoop () ((Var 2 k) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4) ColMajor () ) (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 2 i) Mul (Var 2 i) (Integer 4) () ) Add (IntegerBinOp (Var 2 j) Mul (Var 2 j) (Integer 4) () ) (Integer 4) () ) Add (IntegerBinOp (Var 2 k) Mul (Var 2 k) (Integer 4) () ) (Integer 4) () ) IntegerToReal (Real 4) () () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4) ColMajor () ) (Cast (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4) () ) Add (IntegerBinOp (Var 2 j) Mul (Var 2 k) (Integer 4) () ) (Integer 4) () ) Add (IntegerBinOp (Var 2 i) Mul (Var 2 k) (Integer 4) () ) (Integer 4) () ) (Integer 4) () ) IntegerToReal (Real 4) () () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) () ) () .false. .false. )] [] )] [] )] [] ) (Assignment (Var 2 d) (FunctionCall 2 asquare () [((ArrayPhysicalCast (Var 2 a) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 2 b) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 2 c) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ))] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () () ) () .false. .false. ) (SubroutineCall 2 check () [((ArrayPhysicalCast (Var 2 d) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ))] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-nested_external_dedup_01-90fba38.json0000664000175000017500000000102215174404631026310 0ustar alastairalastair{ "basename": "asr-nested_external_dedup_01-90fba38", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_external_dedup_01.f90", "infile_hash": "2aab29c92da224e4546714887b85dfa6883b7ba509705159b438bf9a", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_external_dedup_01-90fba38.stdout", "stdout_hash": "58245ae7a6654579be690ffdb168058d7491ef4f6eb548abc050446b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-real_dp_param-3adbc5b.json0000664000175000017500000000076115174404631024371 0ustar alastairalastair{ "basename": "asr-real_dp_param-3adbc5b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/real_dp_param.f90", "infile_hash": "c3f349aae44d8efd8afc0b6bd017d9fdc88a0e652d6f7b3c35622828", "outfile": null, "outfile_hash": null, "stdout": "asr-real_dp_param-3adbc5b.stdout", "stdout_hash": "bcaecc0ae618c072b4abbcd7feeb2bc2a9cb336cadcc08784b79efa8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-cpp_err3-a7ea818.json0000664000175000017500000000076015174404631025437 0ustar alastairalastair{ "basename": "asr_preprocess-cpp_err3-a7ea818", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp_err3.f90", "infile_hash": "c5d782ebbaa6d2e7fef698e841091485950442443d6ea8cd0ac62351", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp_err3-a7ea818.stderr", "stderr_hash": "c4a230a12908daec8eab609f7b5a75011ec1d76b04a8d3e8fbf0cd61", "returncode": 2 }lfortran-0.63.0/tests/reference/ast_f90-interface2-82ff094.json0000664000175000017500000000073615174404631024106 0ustar alastairalastair{ "basename": "ast_f90-interface2-82ff094", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/interface2.f90", "infile_hash": "708e539c3b559554e522379a3dd84fbbef89eb01ea66bf9ded4a5fcb", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-interface2-82ff094.stdout", "stdout_hash": "7e23320a7fc6cd85194949f6a850d479e22a6cc211c4a87c9e81a031", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-arrays_10-2bab681.stdout0000664000175000017500000000531015174404631023612 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_10: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Pointer (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) arrays_10 [] [(Allocate [((Var 2 x) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (Var 2 x) (ArrayConstant 4 [1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (ExplicitDeallocate [(Var 2 x)] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr_openmp-openmp_46-1b93fa8.stdout0000664000175000017500000056051315174404631025221 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), omp_lib: (Module (SymbolTable 4 { c_bool: (ExternalSymbol 4 c_bool 39 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 4 c_funptr 39 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 4 c_int 39 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 4 c_long 39 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 4 c_ptr 39 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (Function (SymbolTable 5 { }) gomp_atomic_end (FunctionType [] () BindC Interface "GOMP_atomic_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_atomic_start: (Function (SymbolTable 6 { }) gomp_atomic_start (FunctionType [] () BindC Interface "GOMP_atomic_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_barrier: (Function (SymbolTable 7 { }) gomp_barrier (FunctionType [] () BindC Interface "GOMP_barrier" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_end: (Function (SymbolTable 8 { }) gomp_critical_end (FunctionType [] () BindC Interface "GOMP_critical_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_start: (Function (SymbolTable 9 { }) gomp_critical_start (FunctionType [] () BindC Interface "GOMP_critical_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_auto_next: (Function (SymbolTable 10 { gomp_loop_auto_next: (Variable 10 gomp_loop_auto_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 10 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 10 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_auto_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_auto_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 istart) (Var 10 iend)] [] (Var 10 gomp_loop_auto_next) Public .false. .false. () ), gomp_loop_auto_start: (Function (SymbolTable 11 { end: (Variable 11 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_auto_start: (Variable 11 gomp_loop_auto_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 11 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 11 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 11 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 11 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_auto_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_auto_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 start) (Var 11 end) (Var 11 incr) (Var 11 istart) (Var 11 iend)] [] (Var 11 gomp_loop_auto_start) Public .false. .false. () ), gomp_loop_dynamic_next: (Function (SymbolTable 12 { gomp_loop_dynamic_next: (Variable 12 gomp_loop_dynamic_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 12 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 12 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_dynamic_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_dynamic_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 istart) (Var 12 iend)] [] (Var 12 gomp_loop_dynamic_next) Public .false. .false. () ), gomp_loop_dynamic_start: (Function (SymbolTable 13 { chunk: (Variable 13 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), end: (Variable 13 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_dynamic_start: (Variable 13 gomp_loop_dynamic_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 13 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 13 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 13 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 13 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_dynamic_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_dynamic_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 start) (Var 13 end) (Var 13 incr) (Var 13 chunk) (Var 13 istart) (Var 13 iend)] [] (Var 13 gomp_loop_dynamic_start) Public .false. .false. () ), gomp_loop_end: (Function (SymbolTable 14 { }) gomp_loop_end (FunctionType [] () BindC Interface "GOMP_loop_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_end_nowait: (Function (SymbolTable 15 { }) gomp_loop_end_nowait (FunctionType [] () BindC Interface "GOMP_loop_end_nowait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_guided_next: (Function (SymbolTable 16 { gomp_loop_guided_next: (Variable 16 gomp_loop_guided_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 16 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 16 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_guided_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_guided_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 16 istart) (Var 16 iend)] [] (Var 16 gomp_loop_guided_next) Public .false. .false. () ), gomp_loop_guided_start: (Function (SymbolTable 17 { chunk: (Variable 17 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), end: (Variable 17 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_guided_start: (Variable 17 gomp_loop_guided_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 17 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 17 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 17 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 17 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_guided_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_guided_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 start) (Var 17 end) (Var 17 incr) (Var 17 chunk) (Var 17 istart) (Var 17 iend)] [] (Var 17 gomp_loop_guided_start) Public .false. .false. () ), gomp_loop_runtime_next: (Function (SymbolTable 18 { gomp_loop_runtime_next: (Variable 18 gomp_loop_runtime_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 18 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 18 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_runtime_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_runtime_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 18 istart) (Var 18 iend)] [] (Var 18 gomp_loop_runtime_next) Public .false. .false. () ), gomp_loop_runtime_start: (Function (SymbolTable 19 { end: (Variable 19 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_runtime_start: (Variable 19 gomp_loop_runtime_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 19 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 19 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 19 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 19 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_runtime_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_runtime_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 19 start) (Var 19 end) (Var 19 incr) (Var 19 istart) (Var 19 iend)] [] (Var 19 gomp_loop_runtime_start) Public .false. .false. () ), gomp_loop_static_next: (Function (SymbolTable 20 { gomp_loop_static_next: (Variable 20 gomp_loop_static_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 20 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 20 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_static_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_static_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 istart) (Var 20 iend)] [] (Var 20 gomp_loop_static_next) Public .false. .false. () ), gomp_loop_static_start: (Function (SymbolTable 21 { chunk: (Variable 21 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), end: (Variable 21 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_static_start: (Variable 21 gomp_loop_static_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 21 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 21 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 21 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 21 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_static_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_static_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 21 start) (Var 21 end) (Var 21 incr) (Var 21 chunk) (Var 21 istart) (Var 21 iend)] [] (Var 21 gomp_loop_static_start) Public .false. .false. () ), gomp_parallel: (Function (SymbolTable 22 { data: (Variable 22 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), flags: (Variable 22 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), fn: (Variable 22 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), num_threads: (Variable 22 num_threads [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_parallel (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_parallel" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 22 fn) (Var 22 data) (Var 22 num_threads) (Var 22 flags)] [] () Public .false. .false. () ), gomp_sections_end: (Function (SymbolTable 23 { }) gomp_sections_end (FunctionType [] () BindC Interface "GOMP_sections_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_sections_next: (Function (SymbolTable 24 { gomp_sections_next: (Variable 24 gomp_sections_next [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_sections_next (FunctionType [] (Integer 4) BindC Interface "GOMP_sections_next" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 24 gomp_sections_next) Public .false. .false. () ), gomp_sections_start: (Function (SymbolTable 25 { count: (Variable 25 count [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_sections_start: (Variable 25 gomp_sections_start [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_sections_start (FunctionType [(Integer 4)] (Integer 4) BindC Interface "GOMP_sections_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 25 count)] [] (Var 25 gomp_sections_start) Public .false. .false. () ), gomp_task: (Function (SymbolTable 26 { arg_align: (Variable 26 arg_align [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), arg_size: (Variable 26 arg_size [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), cpyfn: (Variable 26 cpyfn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), data: (Variable 26 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), depend: (Variable 26 depend [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), flags: (Variable 26 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), fn: (Variable 26 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), if_clause: (Variable 26 if_clause [] Unspecified () () Default (Logical 1) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_task (FunctionType [(CPtr) (CPtr) (CPtr) (Integer 8) (Integer 8) (Logical 1) (Integer 4) (CPtr)] () BindC Interface "GOMP_task" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 26 fn) (Var 26 data) (Var 26 cpyfn) (Var 26 arg_size) (Var 26 arg_align) (Var 26 if_clause) (Var 26 flags) (Var 26 depend)] [] () Public .false. .false. () ), gomp_taskwait: (Function (SymbolTable 27 { }) gomp_taskwait (FunctionType [] () BindC Interface "GOMP_taskwait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_teams: (Function (SymbolTable 28 { data: (Variable 28 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), fn: (Variable 28 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), num_teams: (Variable 28 num_teams [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), thread_limit: (Variable 28 thread_limit [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_teams (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_teams_reg" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 28 fn) (Var 28 data) (Var 28 num_teams) (Var 28 thread_limit)] [] () Public .false. .false. () ), omp_get_max_threads: (Function (SymbolTable 29 { omp_get_max_threads: (Variable 29 omp_get_max_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_max_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_max_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 29 omp_get_max_threads) Public .false. .false. () ), omp_get_num_procs: (Function (SymbolTable 30 { omp_get_num_procs: (Variable 30 omp_get_num_procs [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_num_procs (FunctionType [] (Integer 4) BindC Interface "omp_get_num_procs" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 30 omp_get_num_procs) Public .false. .false. () ), omp_get_num_teams: (Function (SymbolTable 31 { omp_get_num_teams: (Variable 31 omp_get_num_teams [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_num_teams (FunctionType [] (Integer 4) BindC Interface "omp_get_num_teams" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 31 omp_get_num_teams) Public .false. .false. () ), omp_get_num_threads: (Function (SymbolTable 32 { omp_get_num_threads: (Variable 32 omp_get_num_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_num_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 32 omp_get_num_threads) Public .false. .false. () ), omp_get_team_num: (Function (SymbolTable 33 { omp_get_team_num: (Variable 33 omp_get_team_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_team_num (FunctionType [] (Integer 4) BindC Interface "omp_get_team_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 33 omp_get_team_num) Public .false. .false. () ), omp_get_team_size: (Function (SymbolTable 34 { level: (Variable 34 level [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), omp_get_team_size: (Variable 34 omp_get_team_size [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_team_size (FunctionType [(Integer 4)] (Integer 4) BindC Interface "omp_get_team_size" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 34 level)] [] (Var 34 omp_get_team_size) Public .false. .false. () ), omp_get_thread_num: (Function (SymbolTable 35 { omp_get_thread_num: (Variable 35 omp_get_thread_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_thread_num (FunctionType [] (Integer 4) BindC Interface "omp_get_thread_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 35 omp_get_thread_num) Public .false. .false. () ), omp_get_wtime: (Function (SymbolTable 36 { omp_get_wtime: (Variable 36 omp_get_wtime [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_wtime (FunctionType [] (Real 8) BindC Interface "omp_get_wtime" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 36 omp_get_wtime) Public .false. .false. () ), omp_set_num_threads: (Function (SymbolTable 37 { n: (Variable 37 n [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_set_num_threads (FunctionType [(Integer 4)] () BindC Interface "omp_set_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 37 n)] [] () Public .false. .false. () ) }) omp_lib () [iso_c_binding] .true. .false. .false. ), omp_task_mre: (Program (SymbolTable 2 { array: (Variable 2 array [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c_bool: (ExternalSymbol 2 c_bool 39 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 2 c_funptr 39 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 2 c_int 39 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 2 c_long 39 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 2 c_ptr 39 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (ExternalSymbol 2 gomp_atomic_end 4 gomp_atomic_end omp_lib [] gomp_atomic_end Public ), gomp_atomic_start: (ExternalSymbol 2 gomp_atomic_start 4 gomp_atomic_start omp_lib [] gomp_atomic_start Public ), gomp_barrier: (ExternalSymbol 2 gomp_barrier 4 gomp_barrier omp_lib [] gomp_barrier Public ), gomp_critical_end: (ExternalSymbol 2 gomp_critical_end 4 gomp_critical_end omp_lib [] gomp_critical_end Public ), gomp_critical_start: (ExternalSymbol 2 gomp_critical_start 4 gomp_critical_start omp_lib [] gomp_critical_start Public ), gomp_loop_auto_next: (ExternalSymbol 2 gomp_loop_auto_next 4 gomp_loop_auto_next omp_lib [] gomp_loop_auto_next Public ), gomp_loop_auto_start: (ExternalSymbol 2 gomp_loop_auto_start 4 gomp_loop_auto_start omp_lib [] gomp_loop_auto_start Public ), gomp_loop_dynamic_next: (ExternalSymbol 2 gomp_loop_dynamic_next 4 gomp_loop_dynamic_next omp_lib [] gomp_loop_dynamic_next Public ), gomp_loop_dynamic_start: (ExternalSymbol 2 gomp_loop_dynamic_start 4 gomp_loop_dynamic_start omp_lib [] gomp_loop_dynamic_start Public ), gomp_loop_end: (ExternalSymbol 2 gomp_loop_end 4 gomp_loop_end omp_lib [] gomp_loop_end Public ), gomp_loop_end_nowait: (ExternalSymbol 2 gomp_loop_end_nowait 4 gomp_loop_end_nowait omp_lib [] gomp_loop_end_nowait Public ), gomp_loop_guided_next: (ExternalSymbol 2 gomp_loop_guided_next 4 gomp_loop_guided_next omp_lib [] gomp_loop_guided_next Public ), gomp_loop_guided_start: (ExternalSymbol 2 gomp_loop_guided_start 4 gomp_loop_guided_start omp_lib [] gomp_loop_guided_start Public ), gomp_loop_runtime_next: (ExternalSymbol 2 gomp_loop_runtime_next 4 gomp_loop_runtime_next omp_lib [] gomp_loop_runtime_next Public ), gomp_loop_runtime_start: (ExternalSymbol 2 gomp_loop_runtime_start 4 gomp_loop_runtime_start omp_lib [] gomp_loop_runtime_start Public ), gomp_loop_static_next: (ExternalSymbol 2 gomp_loop_static_next 4 gomp_loop_static_next omp_lib [] gomp_loop_static_next Public ), gomp_loop_static_start: (ExternalSymbol 2 gomp_loop_static_start 4 gomp_loop_static_start omp_lib [] gomp_loop_static_start Public ), gomp_parallel: (ExternalSymbol 2 gomp_parallel 4 gomp_parallel omp_lib [] gomp_parallel Public ), gomp_sections_end: (ExternalSymbol 2 gomp_sections_end 4 gomp_sections_end omp_lib [] gomp_sections_end Public ), gomp_sections_next: (ExternalSymbol 2 gomp_sections_next 4 gomp_sections_next omp_lib [] gomp_sections_next Public ), gomp_sections_start: (ExternalSymbol 2 gomp_sections_start 4 gomp_sections_start omp_lib [] gomp_sections_start Public ), gomp_task: (ExternalSymbol 2 gomp_task 4 gomp_task omp_lib [] gomp_task Public ), gomp_taskwait: (ExternalSymbol 2 gomp_taskwait 4 gomp_taskwait omp_lib [] gomp_taskwait Public ), gomp_teams: (ExternalSymbol 2 gomp_teams 4 gomp_teams omp_lib [] gomp_teams Public ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Local (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), omp_get_max_threads: (ExternalSymbol 2 omp_get_max_threads 4 omp_get_max_threads omp_lib [] omp_get_max_threads Public ), omp_get_num_procs: (ExternalSymbol 2 omp_get_num_procs 4 omp_get_num_procs omp_lib [] omp_get_num_procs Public ), omp_get_num_teams: (ExternalSymbol 2 omp_get_num_teams 4 omp_get_num_teams omp_lib [] omp_get_num_teams Public ), omp_get_num_threads: (ExternalSymbol 2 omp_get_num_threads 4 omp_get_num_threads omp_lib [] omp_get_num_threads Public ), omp_get_team_num: (ExternalSymbol 2 omp_get_team_num 4 omp_get_team_num omp_lib [] omp_get_team_num Public ), omp_get_team_size: (ExternalSymbol 2 omp_get_team_size 4 omp_get_team_size omp_lib [] omp_get_team_size Public ), omp_get_thread_num: (ExternalSymbol 2 omp_get_thread_num 4 omp_get_thread_num omp_lib [] omp_get_thread_num Public ), omp_get_wtime: (ExternalSymbol 2 omp_get_wtime 4 omp_get_wtime omp_lib [] omp_get_wtime Public ), omp_set_num_threads: (ExternalSymbol 2 omp_set_num_threads 4 omp_set_num_threads omp_lib [] omp_set_num_threads Public ) }) omp_task_mre [omp_lib] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 n) ()) [(Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (IntrinsicElementalFunction Real [(Var 2 i)] 0 (Real 4) () ) () .false. .false. )] [] ) (OMPRegion ParallelSections [(OMPShared [(Var 2 array)] )] [(OMPRegion Section [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 n) ()) [(OMPRegion Task [(OMPFirstPrivate [(Var 2 i)] ) (OMPShared [(Var 2 array)] )] [(Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (RealBinOp (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Real 4) ColMajor () ) Mul (IntrinsicElementalFunction Real [(Var 2 i)] 0 (Real 4) () ) (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Task: i = " (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i) (StringConstant ", computed by thread " (String 1 (IntegerConstant 21 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 2 omp_get_thread_num () [] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] )] [] )] ) (OMPRegion Section [] [(Print (StringConstant "All tasks submitted. Waiting for completion." (String 1 (IntegerConstant 44 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] ) (Print (StringConstant "Updated array:" (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 n) ()) [(Print (StringFormat () [(StringConstant "array(" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i) (StringConstant ") = " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Real 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-max_02-646ff6d.stdout0000664000175000017500000000622215174404631023122 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { max_02: (Program (SymbolTable 2 { y: (Variable 2 y [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) max_02 [] [(Print (StringFormat () [(IntrinsicElementalFunction Max [(Var 2 y) (Cast (Var 2 z) IntegerToInteger (Integer 8) () () )] 0 (Integer 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/run-format_37-20d0238.stdout0000664000175000017500000000021115174404631023461 0ustar alastairalastairThe answer is 42 Test 1: The answer is 42 43 44 45 Test 2: 43 44 45 A B 10 20 C D 30 40 Test 3: A B 10 20 C D 30 40 All tests passed! lfortran-0.63.0/tests/reference/asr-program_without_line_cc-b84ba02.json0000664000175000017500000000115115174404631026342 0ustar alastairalastair{ "basename": "asr-program_without_line_cc-b84ba02", "cmd": "lfortran --continue-compilation --show-asr --no-color {infile}", "infile": "tests/errors/program_without_line_cc.f90", "infile_hash": "516860f9855615c6727a984cf5f5ac39055860c9659a3dc0a17b814b", "outfile": null, "outfile_hash": null, "stdout": "asr-program_without_line_cc-b84ba02.stdout", "stdout_hash": "838a4952fcd6181858c1341cb3b521ce7fa43e9990d1bd2c1a5e902a", "stderr": "asr-program_without_line_cc-b84ba02.stderr", "stderr_hash": "5bf23eca2f01a20110dbbe0e400d96bb19ea04c284afe403a158d374", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-global_scope6-b11d04e.stdout0000664000175000017500000000223315174404631024524 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] ) lfortran-0.63.0/tests/reference/asr-stop-c3f410b.json0000664000175000017500000000070115174404631022421 0ustar alastairalastair{ "basename": "asr-stop-c3f410b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/stop.f90", "infile_hash": "4992b783d9f3aeee0fc682e7600ed3b3e57f5d9e8ea4ef63ab0bbb4d", "outfile": null, "outfile_hash": null, "stdout": "asr-stop-c3f410b.stdout", "stdout_hash": "1b3e989f9a1b4388ea47ee58c63b73315cdf1cb7f23a8a651dbfc615", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-data2-10e42d7.stdout0000664000175000017500000001727615174404631022743 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 3 { factor: (Variable 3 factor [] Local (RealConstant 100.000000 (Real 8) ) (RealConstant 100.000000 (Real 8) ) Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zero: (Variable 3 zero [] Local (RealConstant 0.000000 (Real 8) ) (RealConstant 0.000000 (Real 8) ) Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [b] [] [(Assignment (Var 3 factor) (RealConstant 100.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 3 zero) (RealConstant 0.000000 (Real 8) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "factor in a:" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 3 factor)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 1 b () [((Var 3 factor))] () .false. )] () Public .false. .false. () ), b: (Function (SymbolTable 4 { factor: (Variable 4 factor [] Unspecified () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) b (FunctionType [(Real 8)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 factor)] [(Print (StringFormat () [(StringConstant "factor: " (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 4 factor)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), main: (Program (SymbolTable 2 { }) main [] [(SubroutineCall 1 a () [] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-expr3-99b2959.json0000664000175000017500000000070415174404631022372 0ustar alastairalastair{ "basename": "asr-expr3-99b2959", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr3.f90", "infile_hash": "a4aed9754913f48e6b1982a698f85476db8324f2d2efe0b1a2de88f5", "outfile": null, "outfile_hash": null, "stdout": "asr-expr3-99b2959.stdout", "stdout_hash": "b4791977bbea408043148e197076e234e97174afb7ec92e59bfa538a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-functions_14-f13c087.stdout0000664000175000017500000000150415174404631024441 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define void @find_fit(i32 ()* %expr) { .entry: br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_find_fit FINALIZE_SYMTABLE_find_fit: ; preds = %return ret void } declare i32 @expr() define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_functions_14 FINALIZE_SYMTABLE_functions_14: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/pass_where-where_02-1839d96.stdout0000664000175000017500000002625715174404631024676 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main [] [(Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 2.000000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 0.500000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 3.500000 (Real 4) ) () .false. .false. ) (If () (RealCompare (Var 2 a) Gt (Var 2 b) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 a) (ArrayBroadcast (RealConstant 1.500000 (Real 4) ) (ArrayConstant 4 [2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 8 [1.50000000e+00, 1.50000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [] ) (Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 1.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 2.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-arrays_01_real-6c5e850.stdout0000664000175000017500000037656215174404631024760 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." @0 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @1 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @2 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @3 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @5 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @6 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @7 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @11 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @12 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @13 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @17 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @18 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @19 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @21 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @23 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @24 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @25 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @27 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @28 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @29 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @31 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @32 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @33 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @34 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @35 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @37 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @39 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @40 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @41 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @43 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @44 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @45 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @46 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @47 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @48 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @49 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @50 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @51 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @52 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @53 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @54 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @55 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @56 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @57 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @58 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @59 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @60 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @61 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @62 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @63 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @64 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @65 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @66 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @67 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @68 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @69 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @70 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @71 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @72 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @73 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @74 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @75 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @76 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @77 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @78 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @79 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @80 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @81 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @82 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @83 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @84 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @85 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @86 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @87 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @88 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @89 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @90 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @91 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @92 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @93 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @94 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @95 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @96 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @97 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @98 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @99 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @100 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @101 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @102 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @103 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @104 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @105 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @106 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @107 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @108 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @109 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @110 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @111 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @112 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @113 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @114 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @115 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @116 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @117 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @118 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @119 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @120 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @121 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @122 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @123 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @124 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @125 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @126 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @127 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @128 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @129 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @130 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @131 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @132 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @133 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @134 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @135 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @136 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @137 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @138 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @139 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @140 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @141 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @142 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @143 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @144 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @145 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @146 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @147 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @148 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @149 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @150 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @151 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @152 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @153 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @154 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @155 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @156 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @157 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @158 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @159 = private unnamed_addr constant [46 x i8] c"tests/../integration_tests/arrays_01_real.f90\00", align 1 @160 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @161 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @162 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @163 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca [3 x double], align 8 %b = alloca [4 x double], align 8 %c = alloca [4 x double], align 8 %i = alloca i32, align 4 %j = alloca i32, align 4 store i32 0, i32* %i, align 4 br label %loop.head loop.head: ; preds = %ifcont, %.entry %3 = load i32, i32* %i, align 4 %4 = add i32 %3, 1 %5 = icmp sle i32 %4, 3 br i1 %5, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %6 = load i32, i32* %i, align 4 %7 = add i32 %6, 1 store i32 %7, i32* %i, align 4 %8 = load i32, i32* %i, align 4 %9 = sext i32 %8 to i64 %10 = sub i64 %9, 1 %11 = mul i64 1, %10 %12 = add i64 0, %11 %13 = icmp slt i64 %9, 1 %14 = icmp sgt i64 %9, 3 %15 = or i1 %13, %14 br i1 %15, label %then, label %ifcont then: ; preds = %loop.body %16 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %17 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %18 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %17, i32 0, i32 0 %19 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @1, i32 0, i32 0), i8** %19, align 8 %20 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 1 store i32 6, i32* %20, align 4 %21 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 2 store i32 5, i32* %21, align 4 %22 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 3 store i32 6, i32* %22, align 4 %23 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 4 store i32 8, i32* %23, align 4 %24 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @2, i32 0, i32 0)) %25 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %16, i32 0, i32 0 %26 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %17, i32 0, i32 0 %27 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %25, i32 0, i32 2 %28 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %25, i32 0, i32 0 store i1 true, i1* %28, align 1 %29 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %25, i32 0, i32 1 store i8* %24, i8** %29, align 8 store { i8*, i32, i32, i32, i32 }* %26, { i8*, i32, i32, i32, i32 }** %27, align 8 %30 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %25, i32 0, i32 3 store i32 1, i32* %30, align 4 %31 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %16, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %31, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i64 %9, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont: ; preds = %loop.body %32 = getelementptr [3 x double], [3 x double]* %a, i32 0, i64 %12 %33 = load i32, i32* %i, align 4 %34 = add i32 %33, 10 %35 = sitofp i32 %34 to double store double %35, double* %32, align 8 br label %loop.head loop.end: ; preds = %loop.head br i1 false, label %then1, label %ifcont2 then1: ; preds = %loop.end %36 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %37 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %38 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %37, i32 0, i32 0 %39 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %38, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @5, i32 0, i32 0), i8** %39, align 8 %40 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %38, i32 0, i32 1 store i32 8, i32* %40, align 4 %41 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %38, i32 0, i32 2 store i32 5, i32* %41, align 4 %42 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %38, i32 0, i32 3 store i32 8, i32* %42, align 4 %43 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %38, i32 0, i32 4 store i32 8, i32* %43, align 4 %44 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @6, i32 0, i32 0)) %45 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %36, i32 0, i32 0 %46 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %37, i32 0, i32 0 %47 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %45, i32 0, i32 2 %48 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %45, i32 0, i32 0 store i1 true, i1* %48, align 1 %49 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %45, i32 0, i32 1 store i8* %44, i8** %49, align 8 store { i8*, i32, i32, i32, i32 }* %46, { i8*, i32, i32, i32, i32 }** %47, align 8 %50 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %45, i32 0, i32 3 store i32 1, i32* %50, align 4 %51 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %36, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %51, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i64 1, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont2: ; preds = %loop.end %52 = getelementptr [3 x double], [3 x double]* %a, i32 0, i64 0 %53 = load double, double* %52, align 8 %54 = fcmp une double %53, 1.100000e+01 br i1 %54, label %then3, label %else then3: ; preds = %ifcont2 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont4 else: ; preds = %ifcont2 br label %ifcont4 ifcont4: ; preds = %else, %then3 br i1 false, label %then5, label %ifcont6 then5: ; preds = %ifcont4 %55 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %56 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %57 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %56, i32 0, i32 0 %58 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %57, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @11, i32 0, i32 0), i8** %58, align 8 %59 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %57, i32 0, i32 1 store i32 9, i32* %59, align 4 %60 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %57, i32 0, i32 2 store i32 5, i32* %60, align 4 %61 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %57, i32 0, i32 3 store i32 9, i32* %61, align 4 %62 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %57, i32 0, i32 4 store i32 8, i32* %62, align 4 %63 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @12, i32 0, i32 0)) %64 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %55, i32 0, i32 0 %65 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %56, i32 0, i32 0 %66 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %64, i32 0, i32 2 %67 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %64, i32 0, i32 0 store i1 true, i1* %67, align 1 %68 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %64, i32 0, i32 1 store i8* %63, i8** %68, align 8 store { i8*, i32, i32, i32, i32 }* %65, { i8*, i32, i32, i32, i32 }** %66, align 8 %69 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %64, i32 0, i32 3 store i32 1, i32* %69, align 4 %70 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %55, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %70, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i64 2, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont6: ; preds = %ifcont4 %71 = getelementptr [3 x double], [3 x double]* %a, i32 0, i64 1 %72 = load double, double* %71, align 8 %73 = fcmp une double %72, 1.200000e+01 br i1 %73, label %then7, label %else8 then7: ; preds = %ifcont6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 br i1 false, label %then10, label %ifcont11 then10: ; preds = %ifcont9 %74 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %75 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %76 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %75, i32 0, i32 0 %77 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %76, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @17, i32 0, i32 0), i8** %77, align 8 %78 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %76, i32 0, i32 1 store i32 10, i32* %78, align 4 %79 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %76, i32 0, i32 2 store i32 5, i32* %79, align 4 %80 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %76, i32 0, i32 3 store i32 10, i32* %80, align 4 %81 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %76, i32 0, i32 4 store i32 8, i32* %81, align 4 %82 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @18, i32 0, i32 0)) %83 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %74, i32 0, i32 0 %84 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %75, i32 0, i32 0 %85 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %83, i32 0, i32 2 %86 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %83, i32 0, i32 0 store i1 true, i1* %86, align 1 %87 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %83, i32 0, i32 1 store i8* %82, i8** %87, align 8 store { i8*, i32, i32, i32, i32 }* %84, { i8*, i32, i32, i32, i32 }** %85, align 8 %88 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %83, i32 0, i32 3 store i32 1, i32* %88, align 4 %89 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %74, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %89, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0), i64 3, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont11: ; preds = %ifcont9 %90 = getelementptr [3 x double], [3 x double]* %a, i32 0, i64 2 %91 = load double, double* %90, align 8 %92 = fcmp une double %91, 1.300000e+01 br i1 %92, label %then12, label %else13 then12: ; preds = %ifcont11 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont14 else13: ; preds = %ifcont11 br label %ifcont14 ifcont14: ; preds = %else13, %then12 store i32 10, i32* %i, align 4 br label %loop.head15 loop.head15: ; preds = %ifcont18, %ifcont14 %93 = load i32, i32* %i, align 4 %94 = add i32 %93, 1 %95 = icmp sle i32 %94, 14 br i1 %95, label %loop.body16, label %loop.end19 loop.body16: ; preds = %loop.head15 %96 = load i32, i32* %i, align 4 %97 = add i32 %96, 1 store i32 %97, i32* %i, align 4 %98 = load i32, i32* %i, align 4 %99 = sub i32 %98, 10 %100 = sext i32 %99 to i64 %101 = sub i64 %100, 1 %102 = mul i64 1, %101 %103 = add i64 0, %102 %104 = icmp slt i64 %100, 1 %105 = icmp sgt i64 %100, 4 %106 = or i1 %104, %105 br i1 %106, label %then17, label %ifcont18 then17: ; preds = %loop.body16 %107 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %108 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %109 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %108, i32 0, i32 0 %110 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %109, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @23, i32 0, i32 0), i8** %110, align 8 %111 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %109, i32 0, i32 1 store i32 13, i32* %111, align 4 %112 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %109, i32 0, i32 2 store i32 5, i32* %112, align 4 %113 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %109, i32 0, i32 3 store i32 13, i32* %113, align 4 %114 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %109, i32 0, i32 4 store i32 11, i32* %114, align 4 %115 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @24, i32 0, i32 0)) %116 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %107, i32 0, i32 0 %117 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %108, i32 0, i32 0 %118 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %116, i32 0, i32 2 %119 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %116, i32 0, i32 0 store i1 true, i1* %119, align 1 %120 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %116, i32 0, i32 1 store i8* %115, i8** %120, align 8 store { i8*, i32, i32, i32, i32 }* %117, { i8*, i32, i32, i32, i32 }** %118, align 8 %121 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %116, i32 0, i32 3 store i32 1, i32* %121, align 4 %122 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %107, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %122, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0), i64 %100, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont18: ; preds = %loop.body16 %123 = getelementptr [4 x double], [4 x double]* %b, i32 0, i64 %103 %124 = load i32, i32* %i, align 4 %125 = sitofp i32 %124 to double store double %125, double* %123, align 8 br label %loop.head15 loop.end19: ; preds = %loop.head15 br i1 false, label %then20, label %ifcont21 then20: ; preds = %loop.end19 %126 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %127 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %128 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %127, i32 0, i32 0 %129 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %128, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @27, i32 0, i32 0), i8** %129, align 8 %130 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %128, i32 0, i32 1 store i32 15, i32* %130, align 4 %131 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %128, i32 0, i32 2 store i32 5, i32* %131, align 4 %132 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %128, i32 0, i32 3 store i32 15, i32* %132, align 4 %133 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %128, i32 0, i32 4 store i32 8, i32* %133, align 4 %134 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @28, i32 0, i32 0)) %135 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %126, i32 0, i32 0 %136 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %127, i32 0, i32 0 %137 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %135, i32 0, i32 2 %138 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %135, i32 0, i32 0 store i1 true, i1* %138, align 1 %139 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %135, i32 0, i32 1 store i8* %134, i8** %139, align 8 store { i8*, i32, i32, i32, i32 }* %136, { i8*, i32, i32, i32, i32 }** %137, align 8 %140 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %135, i32 0, i32 3 store i32 1, i32* %140, align 4 %141 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %126, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %141, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @29, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0), i64 1, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont21: ; preds = %loop.end19 %142 = getelementptr [4 x double], [4 x double]* %b, i32 0, i64 0 %143 = load double, double* %142, align 8 %144 = fcmp une double %143, 1.100000e+01 br i1 %144, label %then22, label %else23 then22: ; preds = %ifcont21 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @31, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont24 else23: ; preds = %ifcont21 br label %ifcont24 ifcont24: ; preds = %else23, %then22 br i1 false, label %then25, label %ifcont26 then25: ; preds = %ifcont24 %145 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %146 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %147 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %146, i32 0, i32 0 %148 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %147, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @33, i32 0, i32 0), i8** %148, align 8 %149 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %147, i32 0, i32 1 store i32 16, i32* %149, align 4 %150 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %147, i32 0, i32 2 store i32 5, i32* %150, align 4 %151 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %147, i32 0, i32 3 store i32 16, i32* %151, align 4 %152 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %147, i32 0, i32 4 store i32 8, i32* %152, align 4 %153 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @34, i32 0, i32 0)) %154 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %145, i32 0, i32 0 %155 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %146, i32 0, i32 0 %156 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %154, i32 0, i32 2 %157 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %154, i32 0, i32 0 store i1 true, i1* %157, align 1 %158 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %154, i32 0, i32 1 store i8* %153, i8** %158, align 8 store { i8*, i32, i32, i32, i32 }* %155, { i8*, i32, i32, i32, i32 }** %156, align 8 %159 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %154, i32 0, i32 3 store i32 1, i32* %159, align 4 %160 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %145, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %160, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @35, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @32, i32 0, i32 0), i64 2, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont26: ; preds = %ifcont24 %161 = getelementptr [4 x double], [4 x double]* %b, i32 0, i64 1 %162 = load double, double* %161, align 8 %163 = fcmp une double %162, 1.200000e+01 br i1 %163, label %then27, label %else28 then27: ; preds = %ifcont26 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @37, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont29 else28: ; preds = %ifcont26 br label %ifcont29 ifcont29: ; preds = %else28, %then27 br i1 false, label %then30, label %ifcont31 then30: ; preds = %ifcont29 %164 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %165 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %166 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %165, i32 0, i32 0 %167 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %166, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @39, i32 0, i32 0), i8** %167, align 8 %168 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %166, i32 0, i32 1 store i32 17, i32* %168, align 4 %169 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %166, i32 0, i32 2 store i32 5, i32* %169, align 4 %170 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %166, i32 0, i32 3 store i32 17, i32* %170, align 4 %171 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %166, i32 0, i32 4 store i32 8, i32* %171, align 4 %172 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @40, i32 0, i32 0)) %173 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %164, i32 0, i32 0 %174 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %165, i32 0, i32 0 %175 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %173, i32 0, i32 2 %176 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %173, i32 0, i32 0 store i1 true, i1* %176, align 1 %177 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %173, i32 0, i32 1 store i8* %172, i8** %177, align 8 store { i8*, i32, i32, i32, i32 }* %174, { i8*, i32, i32, i32, i32 }** %175, align 8 %178 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %173, i32 0, i32 3 store i32 1, i32* %178, align 4 %179 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %164, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %179, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0), i64 3, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont31: ; preds = %ifcont29 %180 = getelementptr [4 x double], [4 x double]* %b, i32 0, i64 2 %181 = load double, double* %180, align 8 %182 = fcmp une double %181, 1.300000e+01 br i1 %182, label %then32, label %else33 then32: ; preds = %ifcont31 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @43, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont34 else33: ; preds = %ifcont31 br label %ifcont34 ifcont34: ; preds = %else33, %then32 br i1 false, label %then35, label %ifcont36 then35: ; preds = %ifcont34 %183 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %184 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %185 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %184, i32 0, i32 0 %186 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %185, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @45, i32 0, i32 0), i8** %186, align 8 %187 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %185, i32 0, i32 1 store i32 18, i32* %187, align 4 %188 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %185, i32 0, i32 2 store i32 5, i32* %188, align 4 %189 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %185, i32 0, i32 3 store i32 18, i32* %189, align 4 %190 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %185, i32 0, i32 4 store i32 8, i32* %190, align 4 %191 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @46, i32 0, i32 0)) %192 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %183, i32 0, i32 0 %193 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %184, i32 0, i32 0 %194 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %192, i32 0, i32 2 %195 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %192, i32 0, i32 0 store i1 true, i1* %195, align 1 %196 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %192, i32 0, i32 1 store i8* %191, i8** %196, align 8 store { i8*, i32, i32, i32, i32 }* %193, { i8*, i32, i32, i32, i32 }** %194, align 8 %197 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %192, i32 0, i32 3 store i32 1, i32* %197, align 4 %198 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %183, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %198, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @47, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @44, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont36: ; preds = %ifcont34 %199 = getelementptr [4 x double], [4 x double]* %b, i32 0, i64 3 %200 = load double, double* %199, align 8 %201 = fcmp une double %200, 1.400000e+01 br i1 %201, label %then37, label %else38 then37: ; preds = %ifcont36 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @49, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @48, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont39 else38: ; preds = %ifcont36 br label %ifcont39 ifcont39: ; preds = %else38, %then37 store i32 0, i32* %i, align 4 br label %loop.head40 loop.head40: ; preds = %ifcont45, %ifcont39 %202 = load i32, i32* %i, align 4 %203 = add i32 %202, 1 %204 = icmp sle i32 %203, 3 br i1 %204, label %loop.body41, label %loop.end46 loop.body41: ; preds = %loop.head40 %205 = load i32, i32* %i, align 4 %206 = add i32 %205, 1 store i32 %206, i32* %i, align 4 %207 = load i32, i32* %i, align 4 %208 = sext i32 %207 to i64 %209 = sub i64 %208, 1 %210 = mul i64 1, %209 %211 = add i64 0, %210 %212 = icmp slt i64 %208, 1 %213 = icmp sgt i64 %208, 4 %214 = or i1 %212, %213 br i1 %214, label %then42, label %ifcont43 then42: ; preds = %loop.body41 %215 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %216 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %217 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %216, i32 0, i32 0 %218 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %217, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @51, i32 0, i32 0), i8** %218, align 8 %219 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %217, i32 0, i32 1 store i32 21, i32* %219, align 4 %220 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %217, i32 0, i32 2 store i32 5, i32* %220, align 4 %221 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %217, i32 0, i32 3 store i32 21, i32* %221, align 4 %222 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %217, i32 0, i32 4 store i32 8, i32* %222, align 4 %223 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @52, i32 0, i32 0)) %224 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %215, i32 0, i32 0 %225 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %216, i32 0, i32 0 %226 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %224, i32 0, i32 2 %227 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %224, i32 0, i32 0 store i1 true, i1* %227, align 1 %228 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %224, i32 0, i32 1 store i8* %223, i8** %228, align 8 store { i8*, i32, i32, i32, i32 }* %225, { i8*, i32, i32, i32, i32 }** %226, align 8 %229 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %224, i32 0, i32 3 store i32 1, i32* %229, align 4 %230 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %215, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %230, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @53, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @50, i32 0, i32 0), i64 %208, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont43: ; preds = %loop.body41 %231 = getelementptr [4 x double], [4 x double]* %b, i32 0, i64 %211 %232 = load i32, i32* %i, align 4 %233 = sext i32 %232 to i64 %234 = sub i64 %233, 1 %235 = mul i64 1, %234 %236 = add i64 0, %235 %237 = icmp slt i64 %233, 1 %238 = icmp sgt i64 %233, 3 %239 = or i1 %237, %238 br i1 %239, label %then44, label %ifcont45 then44: ; preds = %ifcont43 %240 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %241 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %242 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %241, i32 0, i32 0 %243 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %242, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @55, i32 0, i32 0), i8** %243, align 8 %244 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %242, i32 0, i32 1 store i32 21, i32* %244, align 4 %245 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %242, i32 0, i32 2 store i32 12, i32* %245, align 4 %246 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %242, i32 0, i32 3 store i32 21, i32* %246, align 4 %247 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %242, i32 0, i32 4 store i32 15, i32* %247, align 4 %248 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @56, i32 0, i32 0)) %249 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %240, i32 0, i32 0 %250 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %241, i32 0, i32 0 %251 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %249, i32 0, i32 2 %252 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %249, i32 0, i32 0 store i1 true, i1* %252, align 1 %253 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %249, i32 0, i32 1 store i8* %248, i8** %253, align 8 store { i8*, i32, i32, i32, i32 }* %250, { i8*, i32, i32, i32, i32 }** %251, align 8 %254 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %249, i32 0, i32 3 store i32 1, i32* %254, align 4 %255 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %240, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %255, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @57, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @54, i32 0, i32 0), i64 %233, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont45: ; preds = %ifcont43 %256 = getelementptr [3 x double], [3 x double]* %a, i32 0, i64 %236 %257 = load double, double* %256, align 8 %258 = fsub double %257, 1.000000e+01 store double %258, double* %231, align 8 br label %loop.head40 loop.end46: ; preds = %loop.head40 br i1 false, label %then47, label %ifcont48 then47: ; preds = %loop.end46 %259 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %260 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %261 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %260, i32 0, i32 0 %262 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %261, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @59, i32 0, i32 0), i8** %262, align 8 %263 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %261, i32 0, i32 1 store i32 23, i32* %263, align 4 %264 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %261, i32 0, i32 2 store i32 5, i32* %264, align 4 %265 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %261, i32 0, i32 3 store i32 23, i32* %265, align 4 %266 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %261, i32 0, i32 4 store i32 8, i32* %266, align 4 %267 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @60, i32 0, i32 0)) %268 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %259, i32 0, i32 0 %269 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %260, i32 0, i32 0 %270 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %268, i32 0, i32 2 %271 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %268, i32 0, i32 0 store i1 true, i1* %271, align 1 %272 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %268, i32 0, i32 1 store i8* %267, i8** %272, align 8 store { i8*, i32, i32, i32, i32 }* %269, { i8*, i32, i32, i32, i32 }** %270, align 8 %273 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %268, i32 0, i32 3 store i32 1, i32* %273, align 4 %274 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %259, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %274, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @61, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @58, i32 0, i32 0), i64 1, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont48: ; preds = %loop.end46 %275 = getelementptr [4 x double], [4 x double]* %b, i32 0, i64 0 %276 = load double, double* %275, align 8 %277 = fcmp une double %276, 1.000000e+00 br i1 %277, label %then49, label %else50 then49: ; preds = %ifcont48 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @63, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @62, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont51 else50: ; preds = %ifcont48 br label %ifcont51 ifcont51: ; preds = %else50, %then49 br i1 false, label %then52, label %ifcont53 then52: ; preds = %ifcont51 %278 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %279 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %280 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %279, i32 0, i32 0 %281 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %280, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @65, i32 0, i32 0), i8** %281, align 8 %282 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %280, i32 0, i32 1 store i32 24, i32* %282, align 4 %283 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %280, i32 0, i32 2 store i32 5, i32* %283, align 4 %284 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %280, i32 0, i32 3 store i32 24, i32* %284, align 4 %285 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %280, i32 0, i32 4 store i32 8, i32* %285, align 4 %286 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @66, i32 0, i32 0)) %287 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %278, i32 0, i32 0 %288 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %279, i32 0, i32 0 %289 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %287, i32 0, i32 2 %290 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %287, i32 0, i32 0 store i1 true, i1* %290, align 1 %291 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %287, i32 0, i32 1 store i8* %286, i8** %291, align 8 store { i8*, i32, i32, i32, i32 }* %288, { i8*, i32, i32, i32, i32 }** %289, align 8 %292 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %287, i32 0, i32 3 store i32 1, i32* %292, align 4 %293 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %278, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %293, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @67, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @64, i32 0, i32 0), i64 2, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont53: ; preds = %ifcont51 %294 = getelementptr [4 x double], [4 x double]* %b, i32 0, i64 1 %295 = load double, double* %294, align 8 %296 = fcmp une double %295, 2.000000e+00 br i1 %296, label %then54, label %else55 then54: ; preds = %ifcont53 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @69, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @68, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont56 else55: ; preds = %ifcont53 br label %ifcont56 ifcont56: ; preds = %else55, %then54 br i1 false, label %then57, label %ifcont58 then57: ; preds = %ifcont56 %297 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %298 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %299 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %298, i32 0, i32 0 %300 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %299, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @71, i32 0, i32 0), i8** %300, align 8 %301 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %299, i32 0, i32 1 store i32 25, i32* %301, align 4 %302 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %299, i32 0, i32 2 store i32 5, i32* %302, align 4 %303 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %299, i32 0, i32 3 store i32 25, i32* %303, align 4 %304 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %299, i32 0, i32 4 store i32 8, i32* %304, align 4 %305 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @72, i32 0, i32 0)) %306 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %297, i32 0, i32 0 %307 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %298, i32 0, i32 0 %308 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %306, i32 0, i32 2 %309 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %306, i32 0, i32 0 store i1 true, i1* %309, align 1 %310 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %306, i32 0, i32 1 store i8* %305, i8** %310, align 8 store { i8*, i32, i32, i32, i32 }* %307, { i8*, i32, i32, i32, i32 }** %308, align 8 %311 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %306, i32 0, i32 3 store i32 1, i32* %311, align 4 %312 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %297, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %312, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @73, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @70, i32 0, i32 0), i64 3, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont58: ; preds = %ifcont56 %313 = getelementptr [4 x double], [4 x double]* %b, i32 0, i64 2 %314 = load double, double* %313, align 8 %315 = fcmp une double %314, 3.000000e+00 br i1 %315, label %then59, label %else60 then59: ; preds = %ifcont58 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @75, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @74, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont61 else60: ; preds = %ifcont58 br label %ifcont61 ifcont61: ; preds = %else60, %then59 br i1 false, label %then62, label %ifcont63 then62: ; preds = %ifcont61 %316 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %317 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %318 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %317, i32 0, i32 0 %319 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %318, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @77, i32 0, i32 0), i8** %319, align 8 %320 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %318, i32 0, i32 1 store i32 27, i32* %320, align 4 %321 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %318, i32 0, i32 2 store i32 1, i32* %321, align 4 %322 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %318, i32 0, i32 3 store i32 27, i32* %322, align 4 %323 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %318, i32 0, i32 4 store i32 4, i32* %323, align 4 %324 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @78, i32 0, i32 0)) %325 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %316, i32 0, i32 0 %326 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %317, i32 0, i32 0 %327 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %325, i32 0, i32 2 %328 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %325, i32 0, i32 0 store i1 true, i1* %328, align 1 %329 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %325, i32 0, i32 1 store i8* %324, i8** %329, align 8 store { i8*, i32, i32, i32, i32 }* %326, { i8*, i32, i32, i32, i32 }** %327, align 8 %330 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %325, i32 0, i32 3 store i32 1, i32* %330, align 4 %331 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %316, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %331, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @79, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @76, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont63: ; preds = %ifcont61 %332 = getelementptr [4 x double], [4 x double]* %b, i32 0, i64 3 br i1 false, label %then64, label %ifcont65 then64: ; preds = %ifcont63 %333 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %334 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %335 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %334, i32 0, i32 0 %336 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %335, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @81, i32 0, i32 0), i8** %336, align 8 %337 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %335, i32 0, i32 1 store i32 27, i32* %337, align 4 %338 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %335, i32 0, i32 2 store i32 8, i32* %338, align 4 %339 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %335, i32 0, i32 3 store i32 27, i32* %339, align 4 %340 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %335, i32 0, i32 4 store i32 11, i32* %340, align 4 %341 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @82, i32 0, i32 0)) %342 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %333, i32 0, i32 0 %343 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %334, i32 0, i32 0 %344 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %342, i32 0, i32 2 %345 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %342, i32 0, i32 0 store i1 true, i1* %345, align 1 %346 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %342, i32 0, i32 1 store i8* %341, i8** %346, align 8 store { i8*, i32, i32, i32, i32 }* %343, { i8*, i32, i32, i32, i32 }** %344, align 8 %347 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %342, i32 0, i32 3 store i32 1, i32* %347, align 4 %348 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %333, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %348, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @83, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @80, i32 0, i32 0), i64 1, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont65: ; preds = %ifcont63 %349 = getelementptr [4 x double], [4 x double]* %b, i32 0, i64 0 %350 = load double, double* %349, align 8 br i1 false, label %then66, label %ifcont67 then66: ; preds = %ifcont65 %351 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %352 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %353 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %352, i32 0, i32 0 %354 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %353, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @85, i32 0, i32 0), i8** %354, align 8 %355 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %353, i32 0, i32 1 store i32 27, i32* %355, align 4 %356 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %353, i32 0, i32 2 store i32 13, i32* %356, align 4 %357 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %353, i32 0, i32 3 store i32 27, i32* %357, align 4 %358 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %353, i32 0, i32 4 store i32 16, i32* %358, align 4 %359 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @86, i32 0, i32 0)) %360 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %351, i32 0, i32 0 %361 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %352, i32 0, i32 0 %362 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %360, i32 0, i32 2 %363 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %360, i32 0, i32 0 store i1 true, i1* %363, align 1 %364 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %360, i32 0, i32 1 store i8* %359, i8** %364, align 8 store { i8*, i32, i32, i32, i32 }* %361, { i8*, i32, i32, i32, i32 }** %362, align 8 %365 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %360, i32 0, i32 3 store i32 1, i32* %365, align 4 %366 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %351, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %366, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @87, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @84, i32 0, i32 0), i64 2, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont67: ; preds = %ifcont65 %367 = getelementptr [4 x double], [4 x double]* %b, i32 0, i64 1 %368 = load double, double* %367, align 8 %369 = fadd double %350, %368 br i1 false, label %then68, label %ifcont69 then68: ; preds = %ifcont67 %370 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %371 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %372 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %371, i32 0, i32 0 %373 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %372, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @89, i32 0, i32 0), i8** %373, align 8 %374 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %372, i32 0, i32 1 store i32 27, i32* %374, align 4 %375 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %372, i32 0, i32 2 store i32 18, i32* %375, align 4 %376 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %372, i32 0, i32 3 store i32 27, i32* %376, align 4 %377 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %372, i32 0, i32 4 store i32 21, i32* %377, align 4 %378 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @90, i32 0, i32 0)) %379 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %370, i32 0, i32 0 %380 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %371, i32 0, i32 0 %381 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %379, i32 0, i32 2 %382 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %379, i32 0, i32 0 store i1 true, i1* %382, align 1 %383 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %379, i32 0, i32 1 store i8* %378, i8** %383, align 8 store { i8*, i32, i32, i32, i32 }* %380, { i8*, i32, i32, i32, i32 }** %381, align 8 %384 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %379, i32 0, i32 3 store i32 1, i32* %384, align 4 %385 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %370, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %385, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @91, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @88, i32 0, i32 0), i64 3, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont69: ; preds = %ifcont67 %386 = getelementptr [4 x double], [4 x double]* %b, i32 0, i64 2 %387 = load double, double* %386, align 8 %388 = fadd double %369, %387 br i1 false, label %then70, label %ifcont71 then70: ; preds = %ifcont69 %389 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %390 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %391 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %390, i32 0, i32 0 %392 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %391, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @93, i32 0, i32 0), i8** %392, align 8 %393 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %391, i32 0, i32 1 store i32 27, i32* %393, align 4 %394 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %391, i32 0, i32 2 store i32 23, i32* %394, align 4 %395 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %391, i32 0, i32 3 store i32 27, i32* %395, align 4 %396 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %391, i32 0, i32 4 store i32 26, i32* %396, align 4 %397 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @94, i32 0, i32 0)) %398 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %389, i32 0, i32 0 %399 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %390, i32 0, i32 0 %400 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %398, i32 0, i32 2 %401 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %398, i32 0, i32 0 store i1 true, i1* %401, align 1 %402 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %398, i32 0, i32 1 store i8* %397, i8** %402, align 8 store { i8*, i32, i32, i32, i32 }* %399, { i8*, i32, i32, i32, i32 }** %400, align 8 %403 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %398, i32 0, i32 3 store i32 1, i32* %403, align 4 %404 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %389, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %404, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @95, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @92, i32 0, i32 0), i64 1, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont71: ; preds = %ifcont69 %405 = getelementptr [3 x double], [3 x double]* %a, i32 0, i64 0 %406 = load double, double* %405, align 8 %407 = fadd double %388, %406 store double %407, double* %332, align 8 br i1 false, label %then72, label %ifcont73 then72: ; preds = %ifcont71 %408 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %409 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %410 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %409, i32 0, i32 0 %411 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %410, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @97, i32 0, i32 0), i8** %411, align 8 %412 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %410, i32 0, i32 1 store i32 28, i32* %412, align 4 %413 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %410, i32 0, i32 2 store i32 5, i32* %413, align 4 %414 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %410, i32 0, i32 3 store i32 28, i32* %414, align 4 %415 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %410, i32 0, i32 4 store i32 8, i32* %415, align 4 %416 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @98, i32 0, i32 0)) %417 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %408, i32 0, i32 0 %418 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %409, i32 0, i32 0 %419 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %417, i32 0, i32 2 %420 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %417, i32 0, i32 0 store i1 true, i1* %420, align 1 %421 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %417, i32 0, i32 1 store i8* %416, i8** %421, align 8 store { i8*, i32, i32, i32, i32 }* %418, { i8*, i32, i32, i32, i32 }** %419, align 8 %422 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %417, i32 0, i32 3 store i32 1, i32* %422, align 4 %423 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %408, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %423, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @99, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @96, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont73: ; preds = %ifcont71 %424 = getelementptr [4 x double], [4 x double]* %b, i32 0, i64 3 %425 = load double, double* %424, align 8 %426 = fcmp une double %425, 1.700000e+01 br i1 %426, label %then74, label %else75 then74: ; preds = %ifcont73 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @101, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @100, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont76 else75: ; preds = %ifcont73 br label %ifcont76 ifcont76: ; preds = %else75, %then74 br i1 false, label %then77, label %ifcont78 then77: ; preds = %ifcont76 %427 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %428 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %429 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %428, i32 0, i32 0 %430 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %429, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @103, i32 0, i32 0), i8** %430, align 8 %431 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %429, i32 0, i32 1 store i32 30, i32* %431, align 4 %432 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %429, i32 0, i32 2 store i32 1, i32* %432, align 4 %433 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %429, i32 0, i32 3 store i32 30, i32* %433, align 4 %434 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %429, i32 0, i32 4 store i32 4, i32* %434, align 4 %435 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @104, i32 0, i32 0)) %436 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %427, i32 0, i32 0 %437 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %428, i32 0, i32 0 %438 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %436, i32 0, i32 2 %439 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %436, i32 0, i32 0 store i1 true, i1* %439, align 1 %440 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %436, i32 0, i32 1 store i8* %435, i8** %440, align 8 store { i8*, i32, i32, i32, i32 }* %437, { i8*, i32, i32, i32, i32 }** %438, align 8 %441 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %436, i32 0, i32 3 store i32 1, i32* %441, align 4 %442 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %427, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %442, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @105, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @102, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont78: ; preds = %ifcont76 %443 = getelementptr [4 x double], [4 x double]* %b, i32 0, i64 3 br i1 false, label %then79, label %ifcont80 then79: ; preds = %ifcont78 %444 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %445 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %446 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %445, i32 0, i32 0 %447 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %446, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @107, i32 0, i32 0), i8** %447, align 8 %448 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %446, i32 0, i32 1 store i32 30, i32* %448, align 4 %449 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %446, i32 0, i32 2 store i32 8, i32* %449, align 4 %450 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %446, i32 0, i32 3 store i32 30, i32* %450, align 4 %451 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %446, i32 0, i32 4 store i32 11, i32* %451, align 4 %452 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @108, i32 0, i32 0)) %453 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %444, i32 0, i32 0 %454 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %445, i32 0, i32 0 %455 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %453, i32 0, i32 2 %456 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %453, i32 0, i32 0 store i1 true, i1* %456, align 1 %457 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %453, i32 0, i32 1 store i8* %452, i8** %457, align 8 store { i8*, i32, i32, i32, i32 }* %454, { i8*, i32, i32, i32, i32 }** %455, align 8 %458 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %453, i32 0, i32 3 store i32 1, i32* %458, align 4 %459 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %444, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %459, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @109, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @106, i32 0, i32 0), i64 1, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont80: ; preds = %ifcont78 %460 = getelementptr [3 x double], [3 x double]* %a, i32 0, i64 0 %461 = load double, double* %460, align 8 store double %461, double* %443, align 8 br i1 false, label %then81, label %ifcont82 then81: ; preds = %ifcont80 %462 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %463 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %464 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %463, i32 0, i32 0 %465 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %464, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @111, i32 0, i32 0), i8** %465, align 8 %466 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %464, i32 0, i32 1 store i32 31, i32* %466, align 4 %467 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %464, i32 0, i32 2 store i32 5, i32* %467, align 4 %468 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %464, i32 0, i32 3 store i32 31, i32* %468, align 4 %469 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %464, i32 0, i32 4 store i32 8, i32* %469, align 4 %470 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @112, i32 0, i32 0)) %471 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %462, i32 0, i32 0 %472 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %463, i32 0, i32 0 %473 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %471, i32 0, i32 2 %474 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %471, i32 0, i32 0 store i1 true, i1* %474, align 1 %475 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %471, i32 0, i32 1 store i8* %470, i8** %475, align 8 store { i8*, i32, i32, i32, i32 }* %472, { i8*, i32, i32, i32, i32 }** %473, align 8 %476 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %471, i32 0, i32 3 store i32 1, i32* %476, align 4 %477 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %462, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %477, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @113, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @110, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont82: ; preds = %ifcont80 %478 = getelementptr [4 x double], [4 x double]* %b, i32 0, i64 3 %479 = load double, double* %478, align 8 %480 = fcmp une double %479, 1.100000e+01 br i1 %480, label %then83, label %else84 then83: ; preds = %ifcont82 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @115, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @114, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont85 else84: ; preds = %ifcont82 br label %ifcont85 ifcont85: ; preds = %else84, %then83 store i32 0, i32* %i, align 4 br label %loop.head86 loop.head86: ; preds = %loop.end94, %ifcont85 %481 = load i32, i32* %i, align 4 %482 = add i32 %481, 1 %483 = icmp sle i32 %482, 2 br i1 %483, label %loop.body87, label %loop.end95 loop.body87: ; preds = %loop.head86 %484 = load i32, i32* %i, align 4 %485 = add i32 %484, 1 store i32 %485, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head88 loop.head88: ; preds = %ifcont93, %loop.body87 %486 = load i32, i32* %j, align 4 %487 = add i32 %486, 1 %488 = icmp sle i32 %487, 2 br i1 %488, label %loop.body89, label %loop.end94 loop.body89: ; preds = %loop.head88 %489 = load i32, i32* %j, align 4 %490 = add i32 %489, 1 store i32 %490, i32* %j, align 4 %491 = load i32, i32* %i, align 4 %492 = load i32, i32* %j, align 4 %493 = sext i32 %491 to i64 %494 = sub i64 %493, 1 %495 = mul i64 1, %494 %496 = add i64 0, %495 %497 = icmp slt i64 %493, 1 %498 = icmp sgt i64 %493, 2 %499 = or i1 %497, %498 br i1 %499, label %then90, label %ifcont91 then90: ; preds = %loop.body89 %500 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %501 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %502 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %501, i32 0, i32 0 %503 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %502, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @117, i32 0, i32 0), i8** %503, align 8 %504 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %502, i32 0, i32 1 store i32 35, i32* %504, align 4 %505 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %502, i32 0, i32 2 store i32 9, i32* %505, align 4 %506 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %502, i32 0, i32 3 store i32 35, i32* %506, align 4 %507 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %502, i32 0, i32 4 store i32 15, i32* %507, align 4 %508 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @118, i32 0, i32 0)) %509 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %500, i32 0, i32 0 %510 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %501, i32 0, i32 0 %511 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %509, i32 0, i32 2 %512 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %509, i32 0, i32 0 store i1 true, i1* %512, align 1 %513 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %509, i32 0, i32 1 store i8* %508, i8** %513, align 8 store { i8*, i32, i32, i32, i32 }* %510, { i8*, i32, i32, i32, i32 }** %511, align 8 %514 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %509, i32 0, i32 3 store i32 1, i32* %514, align 4 %515 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %500, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %515, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @119, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @116, i32 0, i32 0), i64 %493, i32 1, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont91: ; preds = %loop.body89 %516 = sext i32 %492 to i64 %517 = sub i64 %516, 1 %518 = mul i64 2, %517 %519 = add i64 %496, %518 %520 = icmp slt i64 %516, 1 %521 = icmp sgt i64 %516, 2 %522 = or i1 %520, %521 br i1 %522, label %then92, label %ifcont93 then92: ; preds = %ifcont91 %523 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %524 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %525 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %524, i32 0, i32 0 %526 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %525, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @121, i32 0, i32 0), i8** %526, align 8 %527 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %525, i32 0, i32 1 store i32 35, i32* %527, align 4 %528 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %525, i32 0, i32 2 store i32 9, i32* %528, align 4 %529 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %525, i32 0, i32 3 store i32 35, i32* %529, align 4 %530 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %525, i32 0, i32 4 store i32 15, i32* %530, align 4 %531 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @122, i32 0, i32 0)) %532 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %523, i32 0, i32 0 %533 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %524, i32 0, i32 0 %534 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %532, i32 0, i32 2 %535 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %532, i32 0, i32 0 store i1 true, i1* %535, align 1 %536 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %532, i32 0, i32 1 store i8* %531, i8** %536, align 8 store { i8*, i32, i32, i32, i32 }* %533, { i8*, i32, i32, i32, i32 }** %534, align 8 %537 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %532, i32 0, i32 3 store i32 1, i32* %537, align 4 %538 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %523, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %538, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @123, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @120, i32 0, i32 0), i64 %516, i32 2, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont93: ; preds = %ifcont91 %539 = getelementptr [4 x double], [4 x double]* %c, i32 0, i64 %519 %540 = load i32, i32* %i, align 4 %541 = load i32, i32* %j, align 4 %542 = add i32 %540, %541 %543 = add i32 %542, 10 %544 = sitofp i32 %543 to double store double %544, double* %539, align 8 br label %loop.head88 loop.end94: ; preds = %loop.head88 br label %loop.head86 loop.end95: ; preds = %loop.head86 br i1 false, label %then96, label %ifcont97 then96: ; preds = %loop.end95 %545 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %546 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %547 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %546, i32 0, i32 0 %548 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %547, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @125, i32 0, i32 0), i8** %548, align 8 %549 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %547, i32 0, i32 1 store i32 38, i32* %549, align 4 %550 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %547, i32 0, i32 2 store i32 5, i32* %550, align 4 %551 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %547, i32 0, i32 3 store i32 38, i32* %551, align 4 %552 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %547, i32 0, i32 4 store i32 11, i32* %552, align 4 %553 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @126, i32 0, i32 0)) %554 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %545, i32 0, i32 0 %555 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %546, i32 0, i32 0 %556 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %554, i32 0, i32 2 %557 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %554, i32 0, i32 0 store i1 true, i1* %557, align 1 %558 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %554, i32 0, i32 1 store i8* %553, i8** %558, align 8 store { i8*, i32, i32, i32, i32 }* %555, { i8*, i32, i32, i32, i32 }** %556, align 8 %559 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %554, i32 0, i32 3 store i32 1, i32* %559, align 4 %560 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %545, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %560, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @127, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @124, i32 0, i32 0), i64 1, i32 1, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont97: ; preds = %loop.end95 br i1 false, label %then98, label %ifcont99 then98: ; preds = %ifcont97 %561 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %562 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %563 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %562, i32 0, i32 0 %564 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %563, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @129, i32 0, i32 0), i8** %564, align 8 %565 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %563, i32 0, i32 1 store i32 38, i32* %565, align 4 %566 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %563, i32 0, i32 2 store i32 5, i32* %566, align 4 %567 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %563, i32 0, i32 3 store i32 38, i32* %567, align 4 %568 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %563, i32 0, i32 4 store i32 11, i32* %568, align 4 %569 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @130, i32 0, i32 0)) %570 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %561, i32 0, i32 0 %571 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %562, i32 0, i32 0 %572 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %570, i32 0, i32 2 %573 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %570, i32 0, i32 0 store i1 true, i1* %573, align 1 %574 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %570, i32 0, i32 1 store i8* %569, i8** %574, align 8 store { i8*, i32, i32, i32, i32 }* %571, { i8*, i32, i32, i32, i32 }** %572, align 8 %575 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %570, i32 0, i32 3 store i32 1, i32* %575, align 4 %576 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %561, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %576, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @131, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @128, i32 0, i32 0), i64 1, i32 2, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont99: ; preds = %ifcont97 %577 = getelementptr [4 x double], [4 x double]* %c, i32 0, i64 0 %578 = load double, double* %577, align 8 %579 = fcmp une double %578, 1.200000e+01 br i1 %579, label %then100, label %else101 then100: ; preds = %ifcont99 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @133, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @132, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont102 else101: ; preds = %ifcont99 br label %ifcont102 ifcont102: ; preds = %else101, %then100 br i1 false, label %then103, label %ifcont104 then103: ; preds = %ifcont102 %580 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %581 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %582 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %581, i32 0, i32 0 %583 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %582, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @135, i32 0, i32 0), i8** %583, align 8 %584 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %582, i32 0, i32 1 store i32 39, i32* %584, align 4 %585 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %582, i32 0, i32 2 store i32 5, i32* %585, align 4 %586 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %582, i32 0, i32 3 store i32 39, i32* %586, align 4 %587 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %582, i32 0, i32 4 store i32 11, i32* %587, align 4 %588 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @136, i32 0, i32 0)) %589 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %580, i32 0, i32 0 %590 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %581, i32 0, i32 0 %591 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %589, i32 0, i32 2 %592 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %589, i32 0, i32 0 store i1 true, i1* %592, align 1 %593 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %589, i32 0, i32 1 store i8* %588, i8** %593, align 8 store { i8*, i32, i32, i32, i32 }* %590, { i8*, i32, i32, i32, i32 }** %591, align 8 %594 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %589, i32 0, i32 3 store i32 1, i32* %594, align 4 %595 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %580, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %595, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @137, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @134, i32 0, i32 0), i64 1, i32 1, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont104: ; preds = %ifcont102 br i1 false, label %then105, label %ifcont106 then105: ; preds = %ifcont104 %596 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %597 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %598 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %597, i32 0, i32 0 %599 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %598, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @139, i32 0, i32 0), i8** %599, align 8 %600 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %598, i32 0, i32 1 store i32 39, i32* %600, align 4 %601 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %598, i32 0, i32 2 store i32 5, i32* %601, align 4 %602 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %598, i32 0, i32 3 store i32 39, i32* %602, align 4 %603 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %598, i32 0, i32 4 store i32 11, i32* %603, align 4 %604 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @140, i32 0, i32 0)) %605 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %596, i32 0, i32 0 %606 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %597, i32 0, i32 0 %607 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %605, i32 0, i32 2 %608 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %605, i32 0, i32 0 store i1 true, i1* %608, align 1 %609 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %605, i32 0, i32 1 store i8* %604, i8** %609, align 8 store { i8*, i32, i32, i32, i32 }* %606, { i8*, i32, i32, i32, i32 }** %607, align 8 %610 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %605, i32 0, i32 3 store i32 1, i32* %610, align 4 %611 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %596, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %611, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @141, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @138, i32 0, i32 0), i64 2, i32 2, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont106: ; preds = %ifcont104 %612 = getelementptr [4 x double], [4 x double]* %c, i32 0, i64 2 %613 = load double, double* %612, align 8 %614 = fcmp une double %613, 1.300000e+01 br i1 %614, label %then107, label %else108 then107: ; preds = %ifcont106 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @143, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @142, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont109 else108: ; preds = %ifcont106 br label %ifcont109 ifcont109: ; preds = %else108, %then107 br i1 false, label %then110, label %ifcont111 then110: ; preds = %ifcont109 %615 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %616 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %617 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %616, i32 0, i32 0 %618 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %617, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @145, i32 0, i32 0), i8** %618, align 8 %619 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %617, i32 0, i32 1 store i32 40, i32* %619, align 4 %620 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %617, i32 0, i32 2 store i32 5, i32* %620, align 4 %621 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %617, i32 0, i32 3 store i32 40, i32* %621, align 4 %622 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %617, i32 0, i32 4 store i32 11, i32* %622, align 4 %623 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @146, i32 0, i32 0)) %624 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %615, i32 0, i32 0 %625 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %616, i32 0, i32 0 %626 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %624, i32 0, i32 2 %627 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %624, i32 0, i32 0 store i1 true, i1* %627, align 1 %628 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %624, i32 0, i32 1 store i8* %623, i8** %628, align 8 store { i8*, i32, i32, i32, i32 }* %625, { i8*, i32, i32, i32, i32 }** %626, align 8 %629 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %624, i32 0, i32 3 store i32 1, i32* %629, align 4 %630 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %615, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %630, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @147, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @144, i32 0, i32 0), i64 2, i32 1, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont111: ; preds = %ifcont109 br i1 false, label %then112, label %ifcont113 then112: ; preds = %ifcont111 %631 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %632 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %633 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %632, i32 0, i32 0 %634 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %633, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @149, i32 0, i32 0), i8** %634, align 8 %635 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %633, i32 0, i32 1 store i32 40, i32* %635, align 4 %636 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %633, i32 0, i32 2 store i32 5, i32* %636, align 4 %637 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %633, i32 0, i32 3 store i32 40, i32* %637, align 4 %638 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %633, i32 0, i32 4 store i32 11, i32* %638, align 4 %639 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @150, i32 0, i32 0)) %640 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %631, i32 0, i32 0 %641 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %632, i32 0, i32 0 %642 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %640, i32 0, i32 2 %643 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %640, i32 0, i32 0 store i1 true, i1* %643, align 1 %644 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %640, i32 0, i32 1 store i8* %639, i8** %644, align 8 store { i8*, i32, i32, i32, i32 }* %641, { i8*, i32, i32, i32, i32 }** %642, align 8 %645 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %640, i32 0, i32 3 store i32 1, i32* %645, align 4 %646 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %631, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %646, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @151, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @148, i32 0, i32 0), i64 1, i32 2, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont113: ; preds = %ifcont111 %647 = getelementptr [4 x double], [4 x double]* %c, i32 0, i64 1 %648 = load double, double* %647, align 8 %649 = fcmp une double %648, 1.300000e+01 br i1 %649, label %then114, label %else115 then114: ; preds = %ifcont113 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @153, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @152, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont116 else115: ; preds = %ifcont113 br label %ifcont116 ifcont116: ; preds = %else115, %then114 br i1 false, label %then117, label %ifcont118 then117: ; preds = %ifcont116 %650 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %651 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %652 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %651, i32 0, i32 0 %653 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %652, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @155, i32 0, i32 0), i8** %653, align 8 %654 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %652, i32 0, i32 1 store i32 41, i32* %654, align 4 %655 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %652, i32 0, i32 2 store i32 5, i32* %655, align 4 %656 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %652, i32 0, i32 3 store i32 41, i32* %656, align 4 %657 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %652, i32 0, i32 4 store i32 11, i32* %657, align 4 %658 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @156, i32 0, i32 0)) %659 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %650, i32 0, i32 0 %660 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %651, i32 0, i32 0 %661 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %659, i32 0, i32 2 %662 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %659, i32 0, i32 0 store i1 true, i1* %662, align 1 %663 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %659, i32 0, i32 1 store i8* %658, i8** %663, align 8 store { i8*, i32, i32, i32, i32 }* %660, { i8*, i32, i32, i32, i32 }** %661, align 8 %664 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %659, i32 0, i32 3 store i32 1, i32* %664, align 4 %665 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %650, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %665, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @157, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @154, i32 0, i32 0), i64 2, i32 1, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont118: ; preds = %ifcont116 br i1 false, label %then119, label %ifcont120 then119: ; preds = %ifcont118 %666 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %667 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %668 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %667, i32 0, i32 0 %669 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %668, i32 0, i32 0 store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @159, i32 0, i32 0), i8** %669, align 8 %670 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %668, i32 0, i32 1 store i32 41, i32* %670, align 4 %671 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %668, i32 0, i32 2 store i32 5, i32* %671, align 4 %672 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %668, i32 0, i32 3 store i32 41, i32* %672, align 4 %673 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %668, i32 0, i32 4 store i32 11, i32* %673, align 4 %674 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @160, i32 0, i32 0)) %675 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %666, i32 0, i32 0 %676 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %667, i32 0, i32 0 %677 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %675, i32 0, i32 2 %678 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %675, i32 0, i32 0 store i1 true, i1* %678, align 1 %679 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %675, i32 0, i32 1 store i8* %674, i8** %679, align 8 store { i8*, i32, i32, i32, i32 }* %676, { i8*, i32, i32, i32, i32 }** %677, align 8 %680 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %675, i32 0, i32 3 store i32 1, i32* %680, align 4 %681 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %666, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %681, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @161, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @158, i32 0, i32 0), i64 2, i32 2, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont120: ; preds = %ifcont118 %682 = getelementptr [4 x double], [4 x double]* %c, i32 0, i64 3 %683 = load double, double* %682, align 8 %684 = fcmp une double %683, 1.400000e+01 br i1 %684, label %then121, label %else122 then121: ; preds = %ifcont120 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @163, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @162, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont123 else122: ; preds = %ifcont120 br label %ifcont123 ifcont123: ; preds = %else122, %then121 br label %return return: ; preds = %ifcont123 br label %FINALIZE_SYMTABLE_arrays_01_real FINALIZE_SYMTABLE_arrays_01_real: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_snprintf_alloc(i8*, i8*, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lcompilers_runtime_error(i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) declare void @exit(i32) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/c-program4-d60edeb.stderr0000664000175000017500000000040215174404631023323 0ustar alastairalastairwarning: Assuming implicit save attribute for variable declaration --> tests/program4.f90:30:13 | 30 | real :: saved1 = 2.0 | ^^^^^^^^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement lfortran-0.63.0/tests/reference/llvm-logical2-94a2259.json0000664000175000017500000000074515174404631023202 0ustar alastairalastair{ "basename": "llvm-logical2-94a2259", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/logical2.f90", "infile_hash": "5b01ca4533da32f0fa6292eeb511d007181a316ce112af8ff858c9c0", "outfile": null, "outfile_hash": null, "stdout": "llvm-logical2-94a2259.stdout", "stdout_hash": "09e8c8ce2adf703ca0837b5e6f859cd99c2838d6bae31d8bed24d6a5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsic_implicit-b5b124f.json0000664000175000017500000000102215174404631025330 0ustar alastairalastair{ "basename": "asr-intrinsic_implicit-b5b124f", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/intrinsic_implicit.f90", "infile_hash": "ed6e88f0a941ebc8981bfc8f0218c8633c52270b3d5c8f94028eb980", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsic_implicit-b5b124f.stdout", "stdout_hash": "59f13aaa6ba55bdceb4ec5ea0b6667f220c78000d4715bf0dd5181c9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-cmplx_02-48bb125.json0000664000175000017500000000072415174404631023012 0ustar alastairalastair{ "basename": "asr-cmplx_02-48bb125", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cmplx_02.f90", "infile_hash": "2638b55f2204102e3c6df348aba6ab5405453fc87f2db6c8b5b6b28e", "outfile": null, "outfile_hash": null, "stdout": "asr-cmplx_02-48bb125.stdout", "stdout_hash": "ac4ba70f6eda0e09e57834045a44409b2bfd2cd26e048309319e4831", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-complex1-322879a.stdout0000664000175000017500000000405115174404631023414 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex1: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) complex1 [] [(Assignment (Var 2 x) (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 4.000000 (Complex 4) ) ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-modules2-98d8120.stdout0000664000175000017500000011021115174404631023412 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { tomlf_structure: (Module (SymbolTable 8 { toml_ordered: (ExternalSymbol 8 toml_ordered 10 toml_ordered tomlf_structure_base [] toml_ordered Public ) }) tomlf_structure () [tomlf_structure_base] .true. .false. .false. ), tomlf_structure_base: (Module (SymbolTable 10 { destroy: (Function (SymbolTable 13 { self: (Variable 13 self [] InOut () () Default (StructType [] [] .false. .false. ) 10 toml_structure Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), toml_value: (ExternalSymbol 13 toml_value 4 toml_value tomlf_type_value [] toml_value Public ) }) destroy (FunctionType [(StructType [] [] .false. .false. )] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 self)] [] () Public .false. .false. () ), toml_ordered: (Struct (SymbolTable 11 { }) toml_ordered (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .true. [] () 10 toml_structure [] ), toml_structure: (Struct (SymbolTable 12 { destroy: (StructMethodDeclaration 12 destroy () destroy 10 destroy Source .true. .false. ) }) toml_structure (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .true. [] () () [] ) }) tomlf_structure_base () [tomlf_type_value] .true. .false. .false. ), tomlf_type_array: (Module (SymbolTable 2 { destroy: (Function (SymbolTable 15 { 1_toml_array_list: (ExternalSymbol 15 1_toml_array_list 14 list toml_array [] list Public ), 1_toml_structure: (ExternalSymbol 15 1_toml_structure 10 toml_structure tomlf_structure_base [] toml_structure Public ), 1_toml_structure_destroy: (ExternalSymbol 15 1_toml_structure_destroy 12 destroy 1_toml_structure [] destroy Public ), 1_toml_value_key: (ExternalSymbol 15 1_toml_value_key 5 key toml_value [] key Public ), self: (Variable 15 self [] InOut () () Default (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .false. .false. ) 2 toml_array Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) destroy (FunctionType [(StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 15 self)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 15 self) 15 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(ExplicitDeallocate [(StructInstanceMember (Var 15 self) 15 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] )] [] ) (If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 15 self) 15 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () )] 0 (Logical 4) () ) [(SubroutineCall 15 1_toml_structure_destroy () [((StructInstanceMember (Var 15 self) 15 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () ))] (StructInstanceMember (Var 15 self) 15 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () ) .false. ) (ExplicitDeallocate [(StructInstanceMember (Var 15 self) 15 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () )] )] [] )] () Public .true. .true. () ), new: (GenericProcedure 2 new [2 new_array] Public ), new_array: (Function (SymbolTable 16 { self: (Variable 16 self [] Out () () Default (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. ) 2 toml_array Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_array (FunctionType [(StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 16 self)] [] () Public .true. .true. () ), toml_array: (Struct (SymbolTable 14 { destroy: (StructMethodDeclaration 14 destroy () destroy 2 destroy Source .false. .false. ), list: (Variable 14 list [] Local () () Default (Allocatable (StructType [] [] .false. .false. ) ) 2 toml_ordered Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_array (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. ) [] [list] [] Source Public .false. .false. [] () 2 toml_value [] ), toml_ordered: (ExternalSymbol 2 toml_ordered 10 toml_ordered tomlf_structure_base [] toml_ordered Public ), toml_value: (ExternalSymbol 2 toml_value 4 toml_value tomlf_type_value [] toml_value Public ) }) tomlf_type_array () [tomlf_type_value tomlf_structure tomlf_structure_base] .false. .false. .false. ), tomlf_type_value: (Module (SymbolTable 4 { destroy: (Function (SymbolTable 6 { self: (Variable 6 self [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 4 toml_value Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) destroy (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. )] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 self)] [] () Private .false. .false. () ), toml_value: (Struct (SymbolTable 5 { destroy: (StructMethodDeclaration 5 destroy () destroy 4 destroy Source .true. .false. ), key: (Variable 5 key [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_value (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [key] [] Source Private .false. .true. [] () () [] ) }) tomlf_type_value () [] .true. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-protected_01-1f0c640.json0000664000175000017500000000074015174404631023651 0ustar alastairalastair{ "basename": "asr-protected_01-1f0c640", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/protected_01.f90", "infile_hash": "9926eecf56b25df5b111bb3788582f7f19d3aa5d834dade6ba8af123", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-protected_01-1f0c640.stderr", "stderr_hash": "dcbbda8d04894671e4e9444e4dde7d89c4878b38df53c130b1d0a731", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-modules_60-baa1105.json0000664000175000017500000000075015174404631023405 0ustar alastairalastair{ "basename": "asr-modules_60-baa1105", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_60.f90", "infile_hash": "568155f82ef97833e2766041c53cec7324de6bf8d2c418af15782fa3", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_60-baa1105.stdout", "stdout_hash": "989beb09dee671503f24f5ac5def6a9b56c6b381ffa603cd9a0a2a45", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-line_continuation_01-17bec82.stdout0000664000175000017500000000300215174404631026036 0ustar alastairalastair(TranslationUnit [(Program line_continuation_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(Assignment 0 i 5 () ) (If 0 () (< i 4) [(Print 0 () [i] () )] [] () () () ) (If 0 () (> i 4) [(Print 0 () [i] () )] [] () () () ) (If 0 () (> i 4) [(Print 0 () [i] () )] [] () () () ) (If 0 () (> i 4) [(Print 0 () [i] () )] [] () () () )] [] )] ) lfortran-0.63.0/tests/reference/asr-constant_kinds-b9382b6.json0000664000175000017500000000073715174404631024423 0ustar alastairalastair{ "basename": "asr-constant_kinds-b9382b6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/constant_kinds.f90", "infile_hash": "c0be463eb7c2d21d76249ef9357c41398b5f61eb3c9fc1821e01469f", "outfile": null, "outfile_hash": null, "stdout": "asr-constant_kinds-b9382b6.stdout", "stdout_hash": "ac7803721a2b075d158f713242ae6c7d8e54c339ead67efddb8bb5c1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-case_02-9e53b61.json0000664000175000017500000000072215174404631022604 0ustar alastairalastair{ "basename": "cpp-case_02-9e53b61", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/case_02.f90", "infile_hash": "76d3020fba89787d565870ed03c1b5e8914d12b062cb9ca7a8c37550", "outfile": null, "outfile_hash": null, "stdout": "cpp-case_02-9e53b61.stdout", "stdout_hash": "37e4c809436c9ce441b1aa757236a5b39d80b8a9fc078beb14b97fe9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-continue_compilation_coarrays-85ccad8.json0000664000175000017500000000104315174404631027656 0ustar alastairalastair{ "basename": "asr-continue_compilation_coarrays-85ccad8", "cmd": "lfortran --semantics-only --continue-compilation --no-color {infile}", "infile": "tests/errors/continue_compilation_coarrays.f90", "infile_hash": "4e5d3354fcb402d4aa121947087df422d9dfa25504f3766f6a86e3fe", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-continue_compilation_coarrays-85ccad8.stderr", "stderr_hash": "f24e76ff5d7c1d26af15a126b06fb119b74e0a678ee123c2c379f42c", "returncode": 1 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor19-6d76e11.stdout0000664000175000017500000000055715174404631027116 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor19: (Program (SymbolTable 2 { }) preprocessor19 [] [] ) }) [] ) lfortran-0.63.0/tests/reference/asr-derived_types_04-da02dd9.stdout0000664000175000017500000032416715174404631025262 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { tomlf_datetime: (Module (SymbolTable 2 { date_to_string: (Function (SymbolTable 6 { 1_toml_date_day: (ExternalSymbol 6 1_toml_date_day 4 day toml_date [] day Public ), 1_toml_date_month: (ExternalSymbol 6 1_toml_date_month 4 month toml_date [] month Public ), 1_toml_date_year: (ExternalSymbol 6 1_toml_date_year 4 year toml_date [] year Public ), lfortran_iomsg: (Variable 6 lfortran_iomsg [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lhs: (Variable 6 lhs [] Out () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 6 rhs [] In () () Default (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .false. .false. ) 2 toml_date Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) date_to_string (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 lhs) (Var 6 rhs)] [(Allocate [((Var 6 lhs) [] (IntegerConstant 10 (Integer 4) Decimal) () (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString))] () () () ) (FileWrite 0 (Var 6 lhs) (Var 6 lfortran_iomsg) () () [(StringFormat (StringConstant "(i4.4,\"-\",i2.2,\"-\",i2.2)" (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(StructInstanceMember (Var 6 rhs) 6 1_toml_date_year (Integer 4) () ) (StructInstanceMember (Var 6 rhs) 6 1_toml_date_month (Integer 4) () ) (StructInstanceMember (Var 6 rhs) 6 1_toml_date_day (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () () )] () Private .true. .true. () ), datetime_to_string: (Function (SymbolTable 8 { 1_toml_date_date_to_string: (ExternalSymbol 8 1_toml_date_date_to_string 4 to_string toml_date [] to_string Public ), 1_toml_datetime_date: (ExternalSymbol 8 1_toml_datetime_date 5 date toml_datetime [] date Public ), 1_toml_datetime_time: (ExternalSymbol 8 1_toml_datetime_time 5 time toml_datetime [] time Public ), 1_toml_time_time_to_string: (ExternalSymbol 8 1_toml_time_time_to_string 3 to_string toml_time [] to_string Public ), lhs: (Variable 8 lhs [] Out () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 8 rhs [] In () () Default (StructType [(Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .false. .false. ) 2 toml_datetime Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), temporary: (Variable 8 temporary [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), time_to_string: (ExternalSymbol 8 time_to_string 2 time_to_string tomlf_datetime [] time_to_string Public ) }) datetime_to_string (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 lhs) (Var 8 rhs)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 8 rhs) 8 1_toml_datetime_date (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) () )] 0 (Logical 4) () ) [(SubroutineCall 8 1_toml_date_date_to_string () [((Var 8 lhs)) ((StructInstanceMember (Var 8 rhs) 8 1_toml_datetime_date (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) () ))] (StructInstanceMember (Var 8 rhs) 8 1_toml_datetime_date (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) () ) .false. ) (If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 8 rhs) 8 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () )] 0 (Logical 4) () ) [(SubroutineCall 8 1_toml_time_time_to_string () [((Var 8 temporary)) ((StructInstanceMember (Var 8 rhs) 8 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ))] (StructInstanceMember (Var 8 rhs) 8 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) .false. ) (Assignment (Var 8 lhs) (IntrinsicElementalFunction StringConcat [(Var 8 lhs) (Var 8 temporary)] 0 (String 1 () DeferredLength DescriptorString) () ) () .false. .false. )] [] )] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 8 rhs) 8 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () )] 0 (Logical 4) () ) [(Assignment (Var 8 lhs) (StructInstanceMember (Var 8 rhs) 8 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) (SubroutineCall 8 time_to_string 8 time_to_string [((Var 8 lhs)) ((StructInstanceMember (Var 8 rhs) 8 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ))] () .false. ) .false. .false. )] [] )] )] () Private .true. .true. () ), new_toml_time: (Function (SymbolTable 9 { 1_toml_time_hour: (ExternalSymbol 9 1_toml_time_hour 3 hour toml_time [] hour Public ), 1_toml_time_millisec: (ExternalSymbol 9 1_toml_time_millisec 3 millisec toml_time [] millisec Public ), 1_toml_time_minute: (ExternalSymbol 9 1_toml_time_minute 3 minute toml_time [] minute Public ), 1_toml_time_second: (ExternalSymbol 9 1_toml_time_second 3 second toml_time [] second Public ), 1_toml_time_zone: (ExternalSymbol 9 1_toml_time_zone 3 zone toml_time [] zone Public ), hour: (Variable 9 hour [] In () () Default (Integer 4) () Source Private Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), millisec: (Variable 9 millisec [] In () () Default (Integer 4) () Source Private Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), minute: (Variable 9 minute [] In () () Default (Integer 4) () Source Private Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), second: (Variable 9 second [] In () () Default (Integer 4) () Source Private Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 9 self [] ReturnVar () () Default (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 toml_time Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zone: (Variable 9 zone [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Private Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_toml_time (FunctionType [(Integer 4) (Integer 4) (Integer 4) (Integer 4) (String 1 () AssumedLength DescriptorString)] (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 9 hour) (Var 9 minute) (Var 9 second) (Var 9 millisec) (Var 9 zone)] [(If () (IntrinsicElementalFunction Present [(Var 9 hour)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 9 self) 9 1_toml_time_hour (Integer 4) () ) (Var 9 hour) () .false. .false. )] [] ) (If () (IntrinsicElementalFunction Present [(Var 9 minute)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 9 self) 9 1_toml_time_minute (Integer 4) () ) (Var 9 minute) () .false. .false. )] [] ) (If () (IntrinsicElementalFunction Present [(Var 9 second)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 9 self) 9 1_toml_time_second (Integer 4) () ) (Var 9 second) () .false. .false. )] [] ) (If () (IntrinsicElementalFunction Present [(Var 9 millisec)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 9 self) 9 1_toml_time_millisec (Allocatable (Integer 4) ) () ) (Var 9 millisec) () .false. .false. )] [] ) (If () (IntrinsicElementalFunction Present [(Var 9 zone)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 9 self) 9 1_toml_time_zone (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 9 zone) () .false. .false. )] [] )] (Var 9 self) Private .true. .true. () ), time_to_string: (Function (SymbolTable 7 { 1_toml_time_hour: (ExternalSymbol 7 1_toml_time_hour 3 hour toml_time [] hour Public ), 1_toml_time_millisec: (ExternalSymbol 7 1_toml_time_millisec 3 millisec toml_time [] millisec Public ), 1_toml_time_minute: (ExternalSymbol 7 1_toml_time_minute 3 minute toml_time [] minute Public ), 1_toml_time_second: (ExternalSymbol 7 1_toml_time_second 3 second toml_time [] second Public ), 1_toml_time_zone: (ExternalSymbol 7 1_toml_time_zone 3 zone toml_time [] zone Public ), lfortran_iomsg: (Variable 7 lfortran_iomsg [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lfortran_iomsg1: (Variable 7 lfortran_iomsg1 [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lhs: (Variable 7 lhs [] Out () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 7 rhs [] In () () Default (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 2 toml_time Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) time_to_string (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 lhs) (Var 7 rhs)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 7 rhs) 7 1_toml_time_millisec (Allocatable (Integer 4) ) () )] 0 (Logical 4) () ) [(Allocate [((Var 7 lhs) [] (IntegerConstant 12 (Integer 4) Decimal) () (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString))] () () () ) (FileWrite 0 (Var 7 lhs) (Var 7 lfortran_iomsg) () () [(StringFormat (StringConstant "(i2.2,\":\",i2.2,\":\",i2.2,\".\",i3.3)" (String 1 (IntegerConstant 33 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(StructInstanceMember (Var 7 rhs) 7 1_toml_time_hour (Integer 4) () ) (StructInstanceMember (Var 7 rhs) 7 1_toml_time_minute (Integer 4) () ) (StructInstanceMember (Var 7 rhs) 7 1_toml_time_second (Integer 4) () ) (StructInstanceMember (Var 7 rhs) 7 1_toml_time_millisec (Allocatable (Integer 4) ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () () )] [(Allocate [((Var 7 lhs) [] (IntegerConstant 8 (Integer 4) Decimal) () (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString))] () () () ) (FileWrite 0 (Var 7 lhs) (Var 7 lfortran_iomsg1) () () [(StringFormat (StringConstant "(i2.2,\":\",i2.2,\":\",i2.2)" (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(StructInstanceMember (Var 7 rhs) 7 1_toml_time_hour (Integer 4) () ) (StructInstanceMember (Var 7 rhs) 7 1_toml_time_minute (Integer 4) () ) (StructInstanceMember (Var 7 rhs) 7 1_toml_time_second (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () () )] ) (If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 7 rhs) 7 1_toml_time_zone (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(Assignment (Var 7 lhs) (IntrinsicElementalFunction StringConcat [(Var 7 lhs) (IntrinsicElementalFunction StringTrim [(StructInstanceMember (Var 7 rhs) 7 1_toml_time_zone (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (String 1 () DeferredLength DescriptorString) () ) () .false. .false. )] [] )] () Private .true. .true. () ), toml_date: (Struct (SymbolTable 4 { day: (Variable 4 day [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), month: (Variable 4 month [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), to_string: (StructMethodDeclaration 4 to_string rhs date_to_string 2 date_to_string Source .false. .false. ), year: (Variable 4 year [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~assign: (CustomOperator 4 ~assign [4 to_string] Public ) }) toml_date (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) [] [year month day] [] Source Private .false. .false. [] () () [] ), toml_datetime: (Struct (SymbolTable 5 { date: (Variable 5 date [] Local () () Default (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) 2 toml_date Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), time: (Variable 5 time [] Local () () Default (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 2 toml_time Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), to_string: (StructMethodDeclaration 5 to_string rhs datetime_to_string 2 datetime_to_string Source .false. .false. ), ~assign: (CustomOperator 5 ~assign [5 to_string] Public ) }) toml_datetime (StructType [(Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. ) [] [date time] [] Source Private .false. .false. [] () () [] ), toml_time: (Struct (SymbolTable 3 { hour: (Variable 3 hour [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), millisec: (Variable 3 millisec [] Local () () Default (Allocatable (Integer 4) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), minute: (Variable 3 minute [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), second: (Variable 3 second [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), to_string: (StructMethodDeclaration 3 to_string rhs time_to_string 2 time_to_string Source .false. .false. ), zone: (Variable 3 zone [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~assign: (CustomOperator 3 ~assign [3 to_string] Public ) }) toml_time (StructType [(Integer 4) (Integer 4) (Integer 4) (Allocatable (Integer 4) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [hour minute second millisec zone] [] Source Private .false. .false. [] () () [] ), ~toml_time: (GenericProcedure 2 ~toml_time [2 new_toml_time] Public ) }) tomlf_datetime () [tomlf_datetime] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/c_target_cuda-openmp_72-c617edf.json0000664000175000017500000000100615174404631025335 0ustar alastairalastair{ "basename": "c_target_cuda-openmp_72-c617edf", "cmd": "lfortran --show-c --openmp --target-offload {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_72.f90", "infile_hash": "64bbe1fef035f476516ca9529c5898c21d8fa429b426a7ff8dee7411", "outfile": null, "outfile_hash": null, "stdout": "c_target_cuda-openmp_72-c617edf.stdout", "stdout_hash": "81081e8992cc71273d0108c505e65a0361e66d4ffaa43033582041ff", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-unterminated_ifdef_01-f746dbf.json0000664000175000017500000000102715174404631030137 0ustar alastairalastair{ "basename": "asr_preprocess-unterminated_ifdef_01-f746dbf", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/unterminated_ifdef_01.f90", "infile_hash": "0911d913e173386c6ba5ddf05ff36c3c493ad69ab57bbb0c3a6e34dd", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-unterminated_ifdef_01-f746dbf.stderr", "stderr_hash": "1fd14f9256751ff3811111609342770a2754315951e5a34a932b52c7", "returncode": 2 }lfortran-0.63.0/tests/reference/julia-array3-ab6fef3.stdout0000664000175000017500000000031615174404631023701 0ustar alastairalastairfunction main() local a::Array{Float32, 1} local b::Array{Float32, 1} a .= [1.00000000e+00, 2.00000000e+00, 3.00000000e+00] b .= [1.00000000e+00, 2.00000000e+00, 3.00000000e+00] end main() lfortran-0.63.0/tests/reference/llvm-doloop_02-9fcb598.json0000664000175000017500000000075015174404631023451 0ustar alastairalastair{ "basename": "llvm-doloop_02-9fcb598", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_02.f90", "infile_hash": "3f887434509231f48fbbbda31f34778f17ddb6871b39c44626d54f2e", "outfile": null, "outfile_hash": null, "stdout": "llvm-doloop_02-9fcb598.stdout", "stdout_hash": "6ee9a8bd660f873376ea08d67fda4f71e6c0f7dc92807e327f4126ab", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-end_module_name-8436c0b.json0000664000175000017500000000075115174404631024505 0ustar alastairalastair{ "basename": "ast-end_module_name-8436c0b", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/end_module_name.f90", "infile_hash": "6afa73a63a26aac4e984bf10bda60bd5aeaa1cbc187f7239fa4e1c16", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-end_module_name-8436c0b.stderr", "stderr_hash": "0ed62e2f3e592782fe92886b47d10ad2a86c85f2619430b5242bf434", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-character_03-a7476e8.stdout0000664000175000017500000000423515174404631024214 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { character_03: (Program (SymbolTable 2 { str: (Variable 2 str [] Local () () Default (String 1 (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) character_03 [] [(Assignment (Var 2 str) (StringConstant "hello" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Print (Var 2 str) )] ) }) [] ) lfortran-0.63.0/tests/reference/c-program4-d60edeb.stdout0000664000175000017500000000222115174404631023343 0ustar alastairalastair #include #include #include #include #include float func1(float a, float b); float func2(float a, float b); // Implementations float func1(float a, float b) { float c; static float saved = 2.00000000000000000e+00; saved = saved + 1.00000000000000000e+00; c = c + a + b + saved; return c; } float func2(float a, float b) { float c; float d; static float saved1 = 2.00000000000000000e+00; static float saved2; saved1 = saved1 + 1.00000000000000000e+00; c = d + c + a + b + saved1 + saved2; saved2 = saved2 + 1.00000000000000000e+00; d = d + 3.00000000000000000e+00; return c; } int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); float x; float y; float z; x = 1.00000000000000000e+00; y = 2.00000000000000000e+00; z = func1(x, y); printf("%s%s%f\n", "6.0 == ", " ", z); z = func1(x, y); printf("%s%s%f\n", "7.0 == ", " ", z); z = func2(x, y); printf("%s%s%f\n", "6.0 == ", " ", z); z = func2(x, y); printf("%s%s%f\n", "8.0 == ", " ", z); return 0; } lfortran-0.63.0/tests/reference/llvm-types_01-642cab3.stdout0000664000175000017500000000146215174404631023645 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %r = alloca float, align 4 store float 1.000000e+00, float* %r, align 4 store float 1.500000e+00, float* %r, align 4 store float 1.000000e+00, float* %r, align 4 store float 2.000000e+00, float* %r, align 4 store float 3.000000e+00, float* %r, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_types_01 FINALIZE_SYMTABLE_types_01: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/cpp-types_05-06dea62.stdout0000664000175000017500000000246715174404631023472 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t i; float r; r = 1.00000000000000000e+00*(float)(2); r = (float)(2)* 1.00000000000000000e+00; r = (float)(2)*((float)(3) + 1.00000000000000000e+00); r = (float)(2)*( 3.00000000000000000e+00 - (float)(1)); r = (float)(1/2); r = 1.00000000000000000e+00/(float)(2); r = (float)(1)/ 2.00000000000000000e+00; i = (int32_t)( 1.00000000000000000e+00*(float)(2)); i = (int32_t)((float)(2)* 1.00000000000000000e+00); i = (int32_t)((float)(2)*((float)(3) + 1.00000000000000000e+00)); i = (int32_t)((float)(2)*( 3.00000000000000000e+00 - (float)(1))); i = 1/2; i = (int32_t)( 1.00000000000000000e+00/(float)(2)); i = (int32_t)((float)(1)/ 2.00000000000000000e+00); } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/run-format4-aaf60f4.stderr0000664000175000017500000000012515174404631023446 0ustar alastairalastairRuntime Error : Got argument of type (CHARACTER), while the format specifier is (I) lfortran-0.63.0/tests/reference/asr-modules_03-54c2520.json0000664000175000017500000000072315174404631023254 0ustar alastairalastair{ "basename": "asr-modules_03-54c2520", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/modules_03.f90", "infile_hash": "5d89fb6b763fc2ed81c7a0ebc21a9db4055f35adfb6c631054a0aab9", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_03-54c2520.stdout", "stdout_hash": "2dbb66e0186de1141c02b1428d0cd2f7014a656f1858b2c61c969922", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-floor_01-9103fc5.stdout0000664000175000017500000004523015174404631023364 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { floor_01: (Program (SymbolTable 2 { x1: (Variable 2 x1 [] Local (RealConstant 3.300000 (Real 4) ) (RealConstant 3.300000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x2: (Variable 2 x2 [] Local (RealConstant 3.500000 (Real 4) ) (RealConstant 3.500000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x3: (Variable 2 x3 [] Local (RealConstant 3.700000 (Real 4) ) (RealConstant 3.700000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y1: (Variable 2 y1 [] Local (RealUnaryMinus (RealConstant 3.300000 (Real 4) ) (Real 4) (RealConstant -3.300000 (Real 4) ) ) (RealConstant -3.300000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y2: (Variable 2 y2 [] Local (RealUnaryMinus (RealConstant 3.500000 (Real 4) ) (Real 4) (RealConstant -3.500000 (Real 4) ) ) (RealConstant -3.500000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y3: (Variable 2 y3 [] Local (RealUnaryMinus (RealConstant 3.700000 (Real 4) ) (Real 4) (RealConstant -3.700000 (Real 4) ) ) (RealConstant -3.700000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) floor_01 [] [(If () (LogicalBinOp (LogicalBinOp (IntegerCompare (IntrinsicElementalFunction Floor [(Var 2 x1)] 0 (Integer 8) (IntegerConstant 3 (Integer 8) Decimal) ) NotEq (IntegerConstant 3 (Integer 8) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) Or (IntegerCompare (IntrinsicElementalFunction Floor [(Var 2 x2)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) Or (IntegerCompare (IntrinsicElementalFunction Floor [(Var 2 x3)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (LogicalBinOp (IntegerCompare (IntrinsicElementalFunction Floor [(Var 2 y1)] 0 (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) Or (IntegerCompare (IntrinsicElementalFunction Floor [(Var 2 y2)] 0 (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) Or (IntegerCompare (IntrinsicElementalFunction Floor [(Var 2 y3)] 0 (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) ) NotEq (Cast (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) IntegerToInteger (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) () ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(IntrinsicElementalFunction Floor [(Var 2 x1)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (IntrinsicElementalFunction Floor [(Var 2 x2)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (IntrinsicElementalFunction Floor [(Var 2 x3)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction Floor [(Var 2 y1)] 0 (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (IntrinsicElementalFunction Floor [(Var 2 y2)] 0 (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (IntrinsicElementalFunction Floor [(Var 2 y3)] 0 (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-goto_01-bab3e60.json0000664000175000017500000000075215174404631023452 0ustar alastairalastair{ "basename": "ast_f90-goto_01-bab3e60", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/goto_01.f90", "infile_hash": "a5108e90af7ae9a352b6ef368d3ccf4f3af85127a5ea50c9a937fe49", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-goto_01-bab3e60.stdout", "stdout_hash": "b7f05dcc2bee04b12eabf40a0d67c5983a88496688f4f397245ad01a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-string_04-2ebc0e6.stdout0000664000175000017500000004026115174404631023707 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_04: (Program (SymbolTable 2 { greetings: (Variable 2 greetings [] Local () () Default (Allocatable (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), str: (Variable 2 str [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), user_data: (Variable 2 user_data [] Local () () Default (Allocatable (Array (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_04 [] [(Allocate [((Var 2 user_data) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (ArrayItem (Var 2 user_data) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (StringConstant "Mr. " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 user_data) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (StringConstant "Rowan " (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 user_data) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (StringConstant "Atkinson" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Allocate [((Var 2 greetings) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (ArrayItem (Var 2 greetings) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (StringConstant "h" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 greetings) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (StringConstant "e" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 greetings) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (StringConstant "l" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 greetings) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (StringConstant "l" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 greetings) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (StringConstant "o" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Here is " (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (ArrayItem (Var 2 user_data) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (ArrayItem (Var 2 user_data) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (ArrayItem (Var 2 user_data) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 greetings)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Allocate [((Var 2 str) [] (IntegerConstant 8 (Integer 4) Decimal) () (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString))] () () () ) (Assignment (Var 2 str) (StringConstant "abcd" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (If () (IntegerCompare (StringLen (StringSection (Var 2 str) (IntegerConstant 2 (Integer 4) Decimal) (StringLen (Var 2 str) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerBinOp (IntegerBinOp (StringLen (Var 2 str) (Integer 4) () ) Sub (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ExpressionLength DescriptorString) () ) (Integer 4) () ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-program_without_line_02-87b589b.stderr0000664000175000017500000000024615174404631026504 0ustar alastairalastairsyntax error: Expected function, subroutine, procedure in program contains --> tests/errors/program_without_line_02.f90:3:1 | 3 | print *, "OK" | ^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-parameter1-1a7ed3b.stdout0000664000175000017500000002106415174404631024137 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { dcstep: (Function (SymbolTable 2 { p66: (Variable 2 p66 [] Local (RealConstant 0.660000 (Real 8) ) (RealConstant 0.660000 (Real 8) ) Parameter (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s: (Variable 2 s [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), three: (Variable 2 three [] Local (RealConstant 3.000000 (Real 8) ) (RealConstant 3.000000 (Real 8) ) Parameter (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), two: (Variable 2 two [] Local (RealConstant 2.000000 (Real 8) ) (RealConstant 2.000000 (Real 8) ) Parameter (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zero: (Variable 2 zero [] Local (RealConstant 0.000000 (Real 8) ) (RealConstant 0.000000 (Real 8) ) Parameter (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) dcstep (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 s) (IntrinsicElementalFunction Max [(IntrinsicElementalFunction Abs [(Var 2 three)] 0 (Real 8) (RealConstant 3.000000 (Real 8) ) ) (IntrinsicElementalFunction Abs [(Var 2 two)] 0 (Real 8) (RealConstant 2.000000 (Real 8) ) ) (IntrinsicElementalFunction Abs [(Var 2 p66)] 0 (Real 8) (RealConstant 0.660000 (Real 8) ) )] 0 (Real 8) (RealConstant 3.000000 (Real 8) ) ) () .false. .false. )] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/llvm-return_01-495409d.stdout0000664000175000017500000000715115174404631023677 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [12 x i8] c"early return" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([12 x i8], [12 x i8]* @string_const_data, i32 0, i32 0), i64 12 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [13 x i8] c"normal return" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([13 x i8], [13 x i8]* @string_const_data.1, i32 0, i32 0), i64 13 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.3 = private constant [12 x i8] c"main1 called" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([12 x i8], [12 x i8]* @string_const_data.3, i32 0, i32 0), i64 12 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %main_out = alloca i32, align 4 %2 = call i32 @main1() store i32 %2, i32* %main_out, align 4 %3 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %3, i32 12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } define i32 @main1() { .entry: %i = alloca i32, align 4 %main1 = alloca i32, align 4 store i32 10, i32* %i, align 4 %0 = load i32, i32* %i, align 4 %1 = icmp sgt i32 %0, 5 br i1 %1, label %then, label %else then: ; preds = %.entry %2 = load i32, i32* %i, align 4 store i32 %2, i32* %main1, align 4 %3 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %3, i32 12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %return unreachable_after_return: ; No predecessors! br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %unreachable_after_return %4 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %4, i32 13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %5 = load i32, i32* %i, align 4 store i32 %5, i32* %main1, align 4 br label %return return: ; preds = %ifcont, %then br label %FINALIZE_SYMTABLE_main1 FINALIZE_SYMTABLE_main1: ; preds = %return %6 = load i32, i32* %main1, align 4 ret i32 %6 } declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-modules_39-89c7d0d.json0000664000175000017500000000075015174404631023443 0ustar alastairalastair{ "basename": "asr-modules_39-89c7d0d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_39.f90", "infile_hash": "f7ccaf8b5a3d38f726e5e5ea8fbd529c12fe8f7ce34e85944c882db7", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_39-89c7d0d.stdout", "stdout_hash": "7ff2414030ef37fb72a36d19f63a9935a1789b65580b5566e81c9419", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-program4-ba26fd1.json0000664000175000017500000000103415174404631023252 0ustar alastairalastair{ "basename": "asr-program4-ba26fd1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/program4.f90", "infile_hash": "16adb5a498028ea668b9d513bb2ef0fa0b12e15bef4e2b5e30aa2740", "outfile": null, "outfile_hash": null, "stdout": "asr-program4-ba26fd1.stdout", "stdout_hash": "5a7a022bf6f93cfe2bd7e395a609524d373a84ebd75e10c75a3320b1", "stderr": "asr-program4-ba26fd1.stderr", "stderr_hash": "3e15ec8a328c3f581817cf479d93e1f7166d89865efb6fb03f1909b8", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-doloop_01-bb1c596.json0000664000175000017500000000105115174404631023240 0ustar alastairalastair{ "basename": "asr-doloop_01-bb1c596", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/warnings/doloop_01.f90", "infile_hash": "adc11707fe019fef57cc344303ffe42ac706e339e13d094b7d65afc2", "outfile": null, "outfile_hash": null, "stdout": "asr-doloop_01-bb1c596.stdout", "stdout_hash": "5c82f29fb6503f52dfa227c8ef444330ef6fce1b1cabd5594d44b7f5", "stderr": "asr-doloop_01-bb1c596.stderr", "stderr_hash": "e892e763cb5e312237fbc866f00da5aceb0f88f0aeddcaa489856b2b", "returncode": 0 }lfortran-0.63.0/tests/reference/ast-array2-7b9505c.json0000664000175000017500000000070715174404631022600 0ustar alastairalastair{ "basename": "ast-array2-7b9505c", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/array2.f90", "infile_hash": "ec67f153c5f506f6a12ef94b06d43c7e9e86b9fc33c9c196029183f0", "outfile": null, "outfile_hash": null, "stdout": "ast-array2-7b9505c.stdout", "stdout_hash": "9b1a35b08f61c89abd685321a6482493ea4b443085071fb54118cf14", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-expr_11-ab53b8f.stdout0000664000175000017500000000021615174404631023674 0ustar alastairalastairfunction main() local x::Float64 x = ( 2.00000000000000000e+00 * x + 1.00000000000000000e+00) / (x * (x + Float64(1))) end main() lfortran-0.63.0/tests/reference/ast-interface_02-c56d91f.json0000664000175000017500000000075615174404631023730 0ustar alastairalastair{ "basename": "ast-interface_02-c56d91f", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/interface_02.f90", "infile_hash": "9a92d595f0a6e12d0a6033700f6b34403f12830b47fe3115eee2b5f1", "outfile": null, "outfile_hash": null, "stdout": "ast-interface_02-c56d91f.stdout", "stdout_hash": "2d3de6b70cc6299c5dff95b205590d76dbff0b3dba2d26b260b28e3c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fmt1-3196894.stdout0000664000175000017500000001270415174404631022471 0ustar alastairalastair(TranslationUnit [(Declaration (AttrType TypeReal [(kind c_float Value)] () () None ) [] [(r [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() c_float Value)] () () None ) [] [(r [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(kind c_char Value)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() () Star)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len () Star)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len () Star) (kind c_char Value)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() () Star) (kind c_char Value)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(kind c_char Value) (len () Star)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() () Colon)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len () Colon)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len () Colon) (kind c_char Value)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() () Colon) (kind c_char Value)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(kind c_char Value) (len () Colon)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() n Value)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len n Value)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len n Value) (kind c_char Value)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() n Value) (kind c_char Value)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(kind c_char Value) (len n Value)] () () None ) [] [(c [] [] () () None ())] () )] ) lfortran-0.63.0/tests/reference/asr-fixed_form_implicit1-7817d96.json0000664000175000017500000000077415174404631025432 0ustar alastairalastair{ "basename": "asr-fixed_form_implicit1-7817d96", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_implicit1.f", "infile_hash": "23368f2fe6f6771c71559e99af7296e68d793e5df5a6a69aa6c39f62", "outfile": null, "outfile_hash": null, "stdout": "asr-fixed_form_implicit1-7817d96.stdout", "stdout_hash": "16d720d9180e00a757a5895001de2fb51775b0a9d41681ebbbf8dbff", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-realloc_lhs_22-3d95c80.json0000664000175000017500000000073415174404631024210 0ustar alastairalastair{ "basename": "run-realloc_lhs_22-3d95c80", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/realloc_lhs_22.f90", "infile_hash": "28900e4e4991c00dc94be19eb041df7c1f3bee4fb38dac3ff0527918", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-realloc_lhs_22-3d95c80.stderr", "stderr_hash": "223c59c67b6ca97dd0e9af2c43aa7461a78e7d5c92541106ad287846", "returncode": 1 }lfortran-0.63.0/tests/reference/asr_preprocess-cpp_err2-aa1ccd3.json0000664000175000017500000000076015174404631025557 0ustar alastairalastair{ "basename": "asr_preprocess-cpp_err2-aa1ccd3", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp_err2.f90", "infile_hash": "008e95f545b9763c8060a2b4a9866ced9e1ebba05b0520dabee43dbb", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp_err2-aa1ccd3.stderr", "stderr_hash": "bd0c715e440fc2ec42c75a09729a7fafb8c0a561845212a55fdb113f", "returncode": 2 }lfortran-0.63.0/tests/reference/julia-subroutine1-87ec3af.json0000664000175000017500000000071715174404631024340 0ustar alastairalastair{ "basename": "julia-subroutine1-87ec3af", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/subroutine1.f90", "infile_hash": "e209c22328b423e75d6801f3c0ef19bc120936196435dff2cb19df31", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutine1-87ec3af.stdout", "stdout_hash": "15113c36159149e36d4535dab345b908dda98baa5e81565b2a8354cd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-types_02-0b28cb7.stdout0000664000175000017500000000124115174404631023454 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t i; float r; i = 1; r = (float)(1); r = (float)(i); } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/asr-const_real_dp-fa55d4d.json0000664000175000017500000000076115174404631024350 0ustar alastairalastair{ "basename": "asr-const_real_dp-fa55d4d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/const_real_dp.f90", "infile_hash": "636cd3c6b6c703b943b251bba6439b2675cd69fb82cd65a43513e971", "outfile": null, "outfile_hash": null, "stdout": "asr-const_real_dp-fa55d4d.stdout", "stdout_hash": "66713de268d5dccfdf8225dcfbf002139c70b13a5dcf4271ce2bae8f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-string_10-eb8bca7.stdout0000664000175000017500000003646515174404631024004 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_10: (Program (SymbolTable 2 { c: (Variable 2 c [] Local (StringConstant "BC" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "BC" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), is_alpha: (Variable 2 is_alpha [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), num: (Variable 2 num [] Local () () Default (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_10 [] [(Assignment (Var 2 is_alpha) (LogicalBinOp (LogicalBinOp (StringCompare (Var 2 c) GtE (StringConstant "A" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) And (StringCompare (Var 2 c) LtE (StringConstant "Z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (StringCompare (Var 2 c) GtE (StringConstant "a" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) And (StringCompare (Var 2 c) LtE (StringConstant "z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 is_alpha)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 c) (StringConstant "@a" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 is_alpha) (LogicalBinOp (LogicalBinOp (StringCompare (Var 2 c) GtE (StringConstant "A" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) And (StringCompare (Var 2 c) LtE (StringConstant "Z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (StringCompare (Var 2 c) GtE (StringConstant "a" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) And (StringCompare (Var 2 c) LtE (StringConstant "z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 is_alpha)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 c) (StringConstant "a@" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 is_alpha) (LogicalBinOp (LogicalBinOp (StringCompare (Var 2 c) GtE (StringConstant "A" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) And (StringCompare (Var 2 c) LtE (StringConstant "Z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (StringCompare (Var 2 c) GtE (StringConstant "a" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) And (StringCompare (Var 2 c) LtE (StringConstant "z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 is_alpha)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (StringSection (Var 2 num) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) () ) (StringConstant "sbs" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (If () (StringCompare (Var 2 num) NotEq (StringConstant "sbs" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-subroutines_04-ba99aa1.stdout0000664000175000017500000000545615174404631025160 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @print_int() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_print_it FINALIZE_SYMTABLE_print_it: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } define void @print_int() { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %a = alloca i32, align 4 store i32 5, i32* %a, align 4 %1 = alloca i64, align 8 %2 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %1, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %a) %3 = load i64, i64* %1, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %2, i8** %4, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %3, i64* %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %7 = load i8*, i8** %6, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %9 = load i64, i64* %8, align 8 %10 = trunc i64 %9 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %7, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %11 = icmp eq i8* %2, null br i1 %11, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %2) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_print_int FINALIZE_SYMTABLE_print_int: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-document_symbols1-8238851.json0000664000175000017500000000075015174404631024707 0ustar alastairalastair{ "basename": "asr-document_symbols1-8238851", "cmd": "lfortran --show-document-symbols --no-color {infile}", "infile": "tests/document_symbols1.f90", "infile_hash": "63380b78f4939eb6236957b3c4c2a2b1beb2627acae189b56c7bb109", "outfile": null, "outfile_hash": null, "stdout": "asr-document_symbols1-8238851.stdout", "stdout_hash": "713efa6ddb19614bb35fe1992fbc3a4cf70dcb3bcb9d383f6e322246", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_48-6cf0505.json0000664000175000017500000000075015174404631023351 0ustar alastairalastair{ "basename": "asr-modules_48-6cf0505", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_48.f90", "infile_hash": "83255edc16b2873de5a0b7431a7679c296d40c86424c2a7f1ca81fff", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_48-6cf0505.stdout", "stdout_hash": "67d1ab35db2d056eaecf287b8653d7eb904d1d9fc8dd252cf6d02e31", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-array7-6a2e4ab.stdout0000664000175000017500000000023015174404631023751 0ustar alastairalastairprogram array7 implicit double precision (A-H,O-Z) implicit integer (I-N) integer, parameter :: n = 10 dimension :: SJ(0:N), DJ(0:N) end program array7 lfortran-0.63.0/tests/reference/llvm-call_subroutine_without_type_01-1c100d1.json0000664000175000017500000000105215174404631030046 0ustar alastairalastair{ "basename": "llvm-call_subroutine_without_type_01-1c100d1", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/call_subroutine_without_type_01.f90", "infile_hash": "ce99f763025dfbf26699804852ec0efd7bd0dca27e30830aded2fa9a", "outfile": null, "outfile_hash": null, "stdout": "llvm-call_subroutine_without_type_01-1c100d1.stdout", "stdout_hash": "ce2d2e2d0cdf7e1604a234c19118bde16fb3483e80bc148aa733da3a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-functions_10-0449324.stdout0000664000175000017500000014446215174404631024121 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { kwarg_gp: (Module (SymbolTable 2 { mergegp: (GenericProcedure 2 mergegp [2 mergei32 2 merger32 2 merger64] Public ), mergei32: (Function (SymbolTable 3 { a: (Variable 3 a [] Unspecified () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] Unspecified () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 3 m [] Unspecified () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 3 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mergei32 (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray ) (Array (Integer 4) [(() ())] DescriptorArray ) (Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 m)] [] (Var 3 r) Public .true. .true. () ), merger32: (Function (SymbolTable 4 { a: (Variable 4 a [] Unspecified () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] Unspecified () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 4 m [] Unspecified () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 4 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) merger32 (FunctionType [(Array (Real 4) [(() ())] DescriptorArray ) (Array (Real 4) [(() ())] DescriptorArray ) (Array (Real 4) [(() ())] DescriptorArray )] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a) (Var 4 b) (Var 4 m)] [] (Var 4 r) Public .true. .true. () ), merger64: (Function (SymbolTable 5 { a: (Variable 5 a [] Unspecified () () Default (Array (Real 8) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 5 b [] Unspecified () () Default (Array (Real 8) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 5 m [] Unspecified () () Default (Array (Real 8) [(() ())] DescriptorArray ) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 5 r [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) merger64 (FunctionType [(Array (Real 8) [(() ())] DescriptorArray ) (Array (Real 8) [(() ())] DescriptorArray ) (Array (Real 8) [(() ())] DescriptorArray )] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 a) (Var 5 b) (Var 5 m)] [] (Var 5 r) Public .true. .true. () ) }) kwarg_gp () [] .false. .false. .false. ), kwarg_use: (Program (SymbolTable 6 { a1: (Variable 6 a1 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a2: (Variable 6 a2 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b1: (Variable 6 b1 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b2: (Variable 6 b2 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m1: (Variable 6 m1 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m2: (Variable 6 m2 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), mergegp: (ExternalSymbol 6 mergegp 2 mergegp kwarg_gp [] mergegp Public ), mergegp@mergei32: (ExternalSymbol 6 mergegp@mergei32 2 mergei32 kwarg_gp [] mergei32 Private ), mergegp@merger32: (ExternalSymbol 6 mergegp@merger32 2 merger32 kwarg_gp [] merger32 Private ), mergei32: (ExternalSymbol 6 mergei32 2 mergei32 kwarg_gp [] mergei32 Public ), merger32: (ExternalSymbol 6 merger32 2 merger32 kwarg_gp [] merger32 Public ), merger64: (ExternalSymbol 6 merger64 2 merger64 kwarg_gp [] merger64 Public ) }) kwarg_use [kwarg_gp] [(Print (StringFormat () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((ArrayPhysicalCast (Var 6 a1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 b1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )) (())] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((ArrayPhysicalCast (Var 6 a1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 b1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 m1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((ArrayPhysicalCast (Var 6 a1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 b1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 m1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 6 mergegp@merger32 6 mergegp [((ArrayPhysicalCast (Var 6 a2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 b2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () )) (())] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 6 mergegp@merger32 6 mergegp [((ArrayPhysicalCast (Var 6 a2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 b2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 m2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () ))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 6 mergegp@merger32 6 mergegp [((ArrayPhysicalCast (Var 6 a2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 b2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 m2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () ))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootlfortran-0.63.0/tests/reference/asr-incompatible_dimension_logical_arrays_logical_binop_01-4cfbf39.jsonlfortran-0.63.0/tests/reference/asr-incompatible_dimension_logical_arrays_logical_binop_01-4cfbf39.j0000664000175000017500000000113615174404631033764 0ustar alastairalastair{ "basename": "asr-incompatible_dimension_logical_arrays_logical_binop_01-4cfbf39", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incompatible_dimension_logical_arrays_logical_binop_01.f90", "infile_hash": "4f0393569eb2e0f4081875d3cbd2cfe5df6ae707a7e7dc5c425a43d1", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incompatible_dimension_logical_arrays_logical_binop_01-4cfbf39.stderr", "stderr_hash": "54eeb4568bab318f2a36a8096992246f0856e7b292b55677a43d73a9", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-implicit_interface3-4503c6d.stdout0000664000175000017500000001137515174404631025661 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { driver: (Function (SymbolTable 2 { f: (Function (SymbolTable 3 { f_arg_0: (Variable 3 f_arg_0 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 f_arg_0)] [] () Public .false. .false. () ), n: (Variable 2 n [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) driver (FunctionType [(Real 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 f) (Var 2 n)] [(SubroutineCall 2 f () [((Var 2 n))] () .false. )] () Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-dnint_args-3d72f4b.json0000664000175000017500000000073215174404631023601 0ustar alastairalastair{ "basename": "asr-dnint_args-3d72f4b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dnint_args.f90", "infile_hash": "42430aca5c0789f759c918d3059f349331b047bc5ec628b428866496", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dnint_args-3d72f4b.stderr", "stderr_hash": "c95bfb2fbc2094b2f71e308f5166e79619d2d3d0284f62b5425679ee", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-template_error_01a-13d8554.stderr0000664000175000017500000000111715174404631025330 0ustar alastairalastairsemantic error: Type mismatch in function call, the function expects 't' but 's' was provided --> tests/errors/template_error_01a.f90:74:55 | 74 | avg = avg_S_from_T(d1, D_divided_by_T(d1, s1), d2, D_divided_by_S(d2, s2)) | ^^ type 't' expected, but 's' provided | 45 | pure function D_divided_by_T(n, d) result(quotient) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 49 | end function | ...^^^^^^^^^^^^^^^^^^^^ function definition has parameter type 't' lfortran-0.63.0/tests/reference/wat-types_05-884adc8.json0000664000175000017500000000072515174404631023141 0ustar alastairalastair{ "basename": "wat-types_05-884adc8", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/types_05.f90", "infile_hash": "96f8e950abafbc42b9d0438efdca0a8355bb2bd7b4b168ee23063521", "outfile": null, "outfile_hash": null, "stdout": "wat-types_05-884adc8.stdout", "stdout_hash": "d71de8325c328b52541209526dc333fa1b2ac78d7ba72fe38166c57a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-associate1-6e54e23.json0000664000175000017500000000073615174404631024113 0ustar alastairalastair{ "basename": "ast_f90-associate1-6e54e23", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/associate1.f90", "infile_hash": "1f90b3ef799fb354098ee524279bb2b71bf3813b43f2269fb014ec0d", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-associate1-6e54e23.stdout", "stdout_hash": "3010424cbebfcb66eb3ba928c4072d2c8b2e4cdeb594252569fd102a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_08-9988b1f.stdout0000664000175000017500000002022515174404631024454 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_08: (Program (SymbolTable 2 { b: (Variable 2 b [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local (TypeInquiry Tiny (Real 4) (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant 0.000000 (Real 4) ) ) (RealConstant 0.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [b] Local (TypeInquiry Tiny (Real 8) (Var 2 b) (Real 8) (RealConstant 0.000000 (Real 8) ) ) (RealConstant 0.000000 (Real 8) ) Parameter (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local (TypeInquiry Tiny (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 8 [1.00000000e+00, 2.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Real 4) (RealConstant 0.000000 (Real 4) ) ) (RealConstant 0.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_08 [] [(Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-subroutine4-63e648f.json0000664000175000017500000000072615174404631023673 0ustar alastairalastair{ "basename": "ast-subroutine4-63e648f", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine4.f90", "infile_hash": "06ca8a1c322b25fe9280c43f558f6fa92e1a4843b6f6b77e206fdf4e", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine4-63e648f.stdout", "stdout_hash": "4a6262a6903ff0921272bbf98080c74b0039eed748f7eaacc59655c6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-while_02-3db2b04.json0000664000175000017500000000074515174404631023240 0ustar alastairalastair{ "basename": "llvm-while_02-3db2b04", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/while_02.f90", "infile_hash": "a905fa7d48385e1df9ac039aabeadb0362aa1b11587096303c0839b2", "outfile": null, "outfile_hash": null, "stdout": "llvm-while_02-3db2b04.stdout", "stdout_hash": "2ab35fbe15e4be254f95dbd358833ce20a432ddbe7bde1a562e0a6a5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-complex2-5384cb2.json0000664000175000017500000000071515174404631023122 0ustar alastairalastair{ "basename": "asr-complex2-5384cb2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/complex2.f90", "infile_hash": "420a31c745b1be940871a88d76cfdc7432de5cbf6fe9f2e8bc87bf39", "outfile": null, "outfile_hash": null, "stdout": "asr-complex2-5384cb2.stdout", "stdout_hash": "8e2b5e7e0d121ca46ae19da4bf043eb7b22e0c5cdfcb68f6c12b2093", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixedform_subroutine-2711676.json0000664000175000017500000000077415174404631025505 0ustar alastairalastair{ "basename": "ast-fixedform_subroutine-2711676", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_subroutine.f", "infile_hash": "5c2507d7f1f64444900c29417a17016db42b0546f696a6f523c53f0e", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_subroutine-2711676.stdout", "stdout_hash": "0182961eb112dbe5c268c36f4de0166f743db890cacf13ed192f7337", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_class_constructor-multiple_objects_args-2d1007e.json0000664000175000017500000000111015174404631031742 0ustar alastairalastair{ "basename": "pass_class_constructor-multiple_objects_args-2d1007e", "cmd": "lfortran --pass=class_constructor --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/multiple_objects_args.f90", "infile_hash": "08d1551d4b73ca92d0a09c318304281b80bb8e069e38b45ffc41f5b9", "outfile": null, "outfile_hash": null, "stdout": "pass_class_constructor-multiple_objects_args-2d1007e.stdout", "stdout_hash": "cc035225c0749c58a8662b72d546a8ad2dcbdb03b6a439f6ac0de2cf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-bin_op_real_dp-224f1cf.json0000664000175000017500000000076715174404631024576 0ustar alastairalastair{ "basename": "llvm-bin_op_real_dp-224f1cf", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/bin_op_real_dp.f90", "infile_hash": "051ba0744595dc6c3079fa4dd5b8cf1ee0504f434ee5dd8eb64ad7cc", "outfile": null, "outfile_hash": null, "stdout": "llvm-bin_op_real_dp-224f1cf.stdout", "stdout_hash": "625b88edc6e0fccc466cc14993612bc977bfde820d4030b93fef9795", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixed_form_implicit2-f584754.json0000664000175000017500000000077415174404631025432 0ustar alastairalastair{ "basename": "ast-fixed_form_implicit2-f584754", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_implicit2.f", "infile_hash": "5300a387c8af9f01e109d5c3f7a9d8aa452020178f6e388e4bfcbce9", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_implicit2-f584754.stdout", "stdout_hash": "ec75ab5349993d3fbd8408b235e5fdd9c2d897b60b7d3d144b6d62d3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-incorrect_number_args_function-1f6f6fa.stderr0000664000175000017500000000031215174404631030342 0ustar alastairalastairsemantic error: More actual than formal arguments in procedure call --> tests/errors/incorrect_number_args_function.f90:3:25 | 3 | print *, helloWorld(5.1, 2) | ^^^^^^ lfortran-0.63.0/tests/reference/llvm-case_03-c3a5078.json0000664000175000017500000000074215174404631022773 0ustar alastairalastair{ "basename": "llvm-case_03-c3a5078", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/case_03.f90", "infile_hash": "4fc1bb48b2136f22bb44b7c69aaa05a43b4ed2e4b8464c433340295d", "outfile": null, "outfile_hash": null, "stdout": "llvm-case_03-c3a5078.stdout", "stdout_hash": "7be68fac3906f3700b0f4511e9e251bf898da3384a2450631cd04b51", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit7-9099c07.json0000664000175000017500000000106215174404631023220 0ustar alastairalastair{ "basename": "asr-implicit7-9099c07", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit7.f90", "infile_hash": "f389525fdeb3f01a6e2f3902da259e8c9b117370a482a4d4bc9d1b01", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit7-9099c07.stdout", "stdout_hash": "d89e39d9acba71cad189a2c5c53e0744c53711fddfd0d9a40c2df8aa", "stderr": "asr-implicit7-9099c07.stderr", "stderr_hash": "990f7ef15c8d2c60ec8d73a265e14bb411465d30f296b633a274ad4f", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-c_ptr_02-fce1b0e.stdout0000664000175000017500000007460515174404631023576 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), test_c_ptr_02: (Program (SymbolTable 2 { 1_test_obj_ptr: (ExternalSymbol 2 1_test_obj_ptr 13 ptr test_obj [] ptr Public ), c_alert: (ExternalSymbol 2 c_alert 4 c_alert lfortran_intrinsic_iso_c_binding [] c_alert Public ), c_arr: (Variable 2 c_arr [] Local () () Default (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), c_associated: (ExternalSymbol 2 c_associated 4 c_associated lfortran_intrinsic_iso_c_binding [] c_associated Public ), c_backspace: (ExternalSymbol 2 c_backspace 4 c_backspace lfortran_intrinsic_iso_c_binding [] c_backspace Public ), c_bool: (ExternalSymbol 2 c_bool 4 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_carriage_return: (ExternalSymbol 2 c_carriage_return 4 c_carriage_return lfortran_intrinsic_iso_c_binding [] c_carriage_return Public ), c_char: (ExternalSymbol 2 c_char 4 c_char lfortran_intrinsic_iso_c_binding [] c_char Public ), c_double: (ExternalSymbol 2 c_double 4 c_double lfortran_intrinsic_iso_c_binding [] c_double Public ), c_double_complex: (ExternalSymbol 2 c_double_complex 4 c_double_complex lfortran_intrinsic_iso_c_binding [] c_double_complex Public ), c_f_pointer: (ExternalSymbol 2 c_f_pointer 4 c_f_pointer lfortran_intrinsic_iso_c_binding [] c_f_pointer Public ), c_f_procpointer: (ExternalSymbol 2 c_f_procpointer 4 c_f_procpointer lfortran_intrinsic_iso_c_binding [] c_f_procpointer Public ), c_float: (ExternalSymbol 2 c_float 4 c_float lfortran_intrinsic_iso_c_binding [] c_float Public ), c_float_complex: (ExternalSymbol 2 c_float_complex 4 c_float_complex lfortran_intrinsic_iso_c_binding [] c_float_complex Public ), c_form_feed: (ExternalSymbol 2 c_form_feed 4 c_form_feed lfortran_intrinsic_iso_c_binding [] c_form_feed Public ), c_funloc: (ExternalSymbol 2 c_funloc 4 c_funloc lfortran_intrinsic_iso_c_binding [] c_funloc Public ), c_funptr: (ExternalSymbol 2 c_funptr 4 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_horizontal_tab: (ExternalSymbol 2 c_horizontal_tab 4 c_horizontal_tab lfortran_intrinsic_iso_c_binding [] c_horizontal_tab Public ), c_int: (ExternalSymbol 2 c_int 4 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_int16_t: (ExternalSymbol 2 c_int16_t 4 c_int16_t lfortran_intrinsic_iso_c_binding [] c_int16_t Public ), c_int32_t: (ExternalSymbol 2 c_int32_t 4 c_int32_t lfortran_intrinsic_iso_c_binding [] c_int32_t Public ), c_int64_t: (ExternalSymbol 2 c_int64_t 4 c_int64_t lfortran_intrinsic_iso_c_binding [] c_int64_t Public ), c_int8_t: (ExternalSymbol 2 c_int8_t 4 c_int8_t lfortran_intrinsic_iso_c_binding [] c_int8_t Public ), c_intmax_t: (ExternalSymbol 2 c_intmax_t 4 c_intmax_t lfortran_intrinsic_iso_c_binding [] c_intmax_t Public ), c_intptr_t: (ExternalSymbol 2 c_intptr_t 4 c_intptr_t lfortran_intrinsic_iso_c_binding [] c_intptr_t Public ), c_loc: (ExternalSymbol 2 c_loc 4 c_loc lfortran_intrinsic_iso_c_binding [] c_loc Public ), c_long: (ExternalSymbol 2 c_long 4 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_long_double: (ExternalSymbol 2 c_long_double 4 c_long_double lfortran_intrinsic_iso_c_binding [] c_long_double Public ), c_long_double_complex: (ExternalSymbol 2 c_long_double_complex 4 c_long_double_complex lfortran_intrinsic_iso_c_binding [] c_long_double_complex Public ), c_long_long: (ExternalSymbol 2 c_long_long 4 c_long_long lfortran_intrinsic_iso_c_binding [] c_long_long Public ), c_new_line: (ExternalSymbol 2 c_new_line 4 c_new_line lfortran_intrinsic_iso_c_binding [] c_new_line Public ), c_null_char: (ExternalSymbol 2 c_null_char 4 c_null_char lfortran_intrinsic_iso_c_binding [] c_null_char Public ), c_null_funptr: (ExternalSymbol 2 c_null_funptr 4 c_null_funptr lfortran_intrinsic_iso_c_binding [] c_null_funptr Public ), c_null_ptr: (ExternalSymbol 2 c_null_ptr 4 c_null_ptr lfortran_intrinsic_iso_c_binding [] c_null_ptr Public ), c_ptr: (ExternalSymbol 2 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), c_ptrdiff_t: (ExternalSymbol 2 c_ptrdiff_t 4 c_ptrdiff_t lfortran_intrinsic_iso_c_binding [] c_ptrdiff_t Public ), c_short: (ExternalSymbol 2 c_short 4 c_short lfortran_intrinsic_iso_c_binding [] c_short Public ), c_signed_char: (ExternalSymbol 2 c_signed_char 4 c_signed_char lfortran_intrinsic_iso_c_binding [] c_signed_char Public ), c_size_t: (ExternalSymbol 2 c_size_t 4 c_size_t lfortran_intrinsic_iso_c_binding [] c_size_t Public ), c_sizeof: (ExternalSymbol 2 c_sizeof 4 c_sizeof lfortran_intrinsic_iso_c_binding [] c_sizeof Public ), c_vertical_tab: (ExternalSymbol 2 c_vertical_tab 4 c_vertical_tab lfortran_intrinsic_iso_c_binding [] c_vertical_tab Public ), instance: (Variable 2 instance [] Local () () Default (StructType [(CPtr)] [] .true. .false. ) 2 test_obj Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r_ptr: (Variable 2 r_ptr [] Local () () Default (Pointer (Array (Real 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), temp_ptr: (Variable 2 temp_ptr [] Local () () Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), test_obj: (Struct (SymbolTable 13 { ptr: (Variable 13 ptr [] Local (PointerNullConstant (CPtr) () ) (PointerNullConstant (CPtr) () ) Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_obj (StructType [(CPtr)] [] .true. .false. ) [] [ptr] [] Source Public .false. .false. [] () () [] ) }) test_c_ptr_02 [iso_c_binding] [(Assignment (Var 2 temp_ptr) (StructInstanceMember (Var 2 instance) 2 1_test_obj_ptr (CPtr) () ) () .false. .false. ) (Assignment (Var 2 c_arr) (ArrayBroadcast (ComplexConstructor (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Complex 4) (ComplexConstant 1.000000 2.000000 (Complex 4) ) ) (ArrayConstant 4 [2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (CPtrToPointer (PointerToCPtr (GetPointer (Var 2 c_arr) (Pointer (Array (Complex 4) [(() ())] DescriptorArray ) ) () ) (CPtr) () ) (Var 2 r_ptr) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] PointerArray ) ColMajor ) () ) (Print (StringFormat () [(Var 2 c_arr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 r_ptr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (LogicalBinOp (PointerAssociated (Var 2 temp_ptr) () (Logical 4) () ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-common_03-9052466.json0000664000175000017500000000074515174404631023033 0ustar alastairalastair{ "basename": "asr-common_03-9052466", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/common_03.f90", "infile_hash": "c7d42ede7ccad177a6c3e7543d3db6f5812f3305a1059d85bf47952c", "outfile": null, "outfile_hash": null, "stdout": "asr-common_03-9052466.stdout", "stdout_hash": "dfe6c58432bba373fda206d6cc4b4b88cf2f466d5f3f4fc5f4c63613", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_disable_style_suggestion_and_warnings-save4-4eccf46.json0000664000175000017500000000106515174404631032462 0ustar alastairalastair{ "basename": "asr_disable_style_suggestion_and_warnings-save4-4eccf46", "cmd": "lfortran --show-asr --no-style-suggestions --no-warnings --no-color {infile} -o {outfile}", "infile": "tests/save4.f90", "infile_hash": "8ad16d18b9282d4bb2812bf641878b7a6738e0e34c356b94ff01ef8a", "outfile": null, "outfile_hash": null, "stdout": "asr_disable_style_suggestion_and_warnings-save4-4eccf46.stdout", "stdout_hash": "77f1ae86facfa4d13db333a9bb1016ff2ee69bacf3ec17d9a5dec264", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-string1-f6332d9.stdout0000664000175000017500000006775515174404631023360 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fpm_strings: (Module (SymbolTable 2 { c_char: (ExternalSymbol 2 c_char 4 c_char lfortran_intrinsic_iso_c_binding [] c_char Public ), c_ptr: (ExternalSymbol 2 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), c_size_t: (ExternalSymbol 2 c_size_t 4 c_size_t lfortran_intrinsic_iso_c_binding [] c_size_t Public ), f_string: (GenericProcedure 2 f_string [2 f_string~genericprocedure 2 f_string_cptr 2 f_string_cptr_n] Public ), f_string_cptr: (Function (SymbolTable 15 { c_strlen: (Function (SymbolTable 16 { r: (Variable 16 r [] ReturnVar () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s: (Variable 16 s [] In () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) c_strlen (FunctionType [(CPtr)] (Integer 8) BindC Interface "strlen" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 16 s)] [] (Var 16 r) Public .false. .false. () ), cptr: (Variable 15 cptr [] In () () Default (CPtr) () Source Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), lfortran_tmp: (Variable 15 lfortran_tmp [] Local () () Default (Integer 8) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s: (Variable 15 s [] ReturnVar () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_string_cptr (FunctionType [(CPtr)] (Allocatable (String 1 () DeferredLength DescriptorString) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f_string_cptr_n] [(Var 15 cptr)] [(Assignment (Var 15 lfortran_tmp) (FunctionCall 15 c_strlen () [((Var 15 cptr))] (Integer 8) () () ) () .false. .false. ) (Assignment (Var 15 s) (FunctionCall 2 f_string_cptr_n () [((Var 15 cptr)) ((Var 15 lfortran_tmp))] (String 1 (Var 15 lfortran_tmp) ExpressionLength DescriptorString) () () ) () .false. .false. )] (Var 15 s) Public .false. .false. () ), f_string_cptr_n: (Function (SymbolTable 17 { cptr: (Variable 17 cptr [] In () () Default (CPtr) () Source Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 17 n [] In () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s: (Variable 17 s [n] ReturnVar () () Default (String 1 (Var 17 n) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_string_cptr_n (FunctionType [(CPtr) (Integer 8)] (String 1 (FunctionParam 1 (Integer 8) () ) ExpressionLength DescriptorString) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 cptr) (Var 17 n)] [] (Var 17 s) Public .true. .true. () ), f_string~genericprocedure: (Function (SymbolTable 14 { c_string: (Variable 14 c_string [] In () () Default (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f_string: (Variable 14 f_string [] ReturnVar () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_string~genericprocedure (FunctionType [(Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray )] (Allocatable (String 1 () DeferredLength DescriptorString) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 14 c_string)] [] (Var 14 f_string) Public .true. .true. () ), string_t: (Struct (SymbolTable 13 { s: (Variable 13 s [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [s] [] Source Public .false. .false. [] () () [] ) }) fpm_strings () [iso_c_binding fpm_strings] .false. .false. .false. ), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding) }) [] ) lfortran-0.63.0/tests/reference/asr-continue_compilation_simd-4dab78a.json0000664000175000017500000000102715174404631026764 0ustar alastairalastair{ "basename": "asr-continue_compilation_simd-4dab78a", "cmd": "lfortran --semantics-only --continue-compilation --no-color {infile}", "infile": "tests/errors/continue_compilation_simd.f90", "infile_hash": "bcbf2032f14e24bf22ad1f9c443f7511fbb94f8d8053425a5ac5512f", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-continue_compilation_simd-4dab78a.stderr", "stderr_hash": "532e8662b9443ad4ca33c7e9949d4baf710a2dbf2220870530159759", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-implied_do_loops2-98464d0.stdout0000664000175000017500000001714315174404631025300 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { implied_do_loop2: (Program (SymbolTable 2 { array: (Variable 2 array [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) implied_do_loop2 [] [(Assignment (Var 2 array) (ArrayReshape (ArrayConstructor [(ImpliedDoLoop [(Var 2 i) (ImpliedDoLoop [(IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () )] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) () (Integer 4) () )] (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Integer 4) () )] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) ())] DescriptorArray ) () ColMajor () ) (ArrayPhysicalCast (ArrayConstant 8 [3, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) () () (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 array)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-intrinsics15-76ae493.json0000664000175000017500000000074015174404631023732 0ustar alastairalastair{ "basename": "asr-intrinsics15-76ae493", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics15.f90", "infile_hash": "afc1933e8bca77d3f9caf7d466f010a578d93125b222309c194480a8", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics15-76ae493.stderr", "stderr_hash": "ef97af68d4eb0d2d985d19d15914e508a21c6a3a4615b9c686359ae1", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-open1-df87f77.stdout0000664000175000017500000000320515174404631023065 0ustar alastairalastair(TranslationUnit [(Program open1 (TriviaNode [(EndOfLine) (Comment "! Tests for syntax (AST) only:" )] [] ) [] [] [] [(Open 0 [] [(file (String "p_cc" ())) (newunit u)] () ) (Open 0 [task_lun] [(file taskfile)] () ) (Open 0 [] [(unit gmv_lun) (FILE fname) (IOSTAT ier) (POSITION (String "rewind" ()))] () ) (Open 0 [] [(newunit lun [(this [])]) (file outfile) (status (String "replace" ())) (iostat ios)] () ) (Open 0 [] [(unit 10) (file (String "test1.inp" ())) (position (String "rewind" ())) (action (String "read" ())) (status (String "old" ()))] () ) (Open 0 [] [(UNIT funit) (FILE tname) (STATUS fstat) (ACCESS (String "SEQUENTIAL" ())) (ACTION faction) (IOSTAT ierr)] () )] [] )] ) lfortran-0.63.0/tests/reference/pass_inline_function_calls-functions_05-5502cc1.stdout0000664000175000017500000014530015174404631031050 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a1: (Variable 2 a1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b1: (Variable 2 b1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Assignment (Var 3 x) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 b) (IntegerBinOp (Var 3 a) Add (Var 3 x) (Integer 4) () ) () .false. .false. )] (Var 3 b) Public .true. .true. () ), f_real: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 4 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 4 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_real (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a)] [(Assignment (Var 4 x) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 4 y) (Var 4 a) () .false. .false. ) (Assignment (Var 4 r) (Var 4 x) () .false. .false. ) (If () (LogicalBinOp (LogicalBinOp (RealCompare (Var 4 x) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) And (RealCompare (Var 4 y) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (RealCompare (Var 4 x) LtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) And (RealCompare (Var 4 y) LtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 4 r) (Var 4 x) () .false. .false. )] [(Assignment (Var 4 r) (RealUnaryMinus (Var 4 x) (Real 4) () ) () .false. .false. )] ) (Assignment (Var 4 b) (RealBinOp (Var 4 a) Add (Var 4 r) (Real 4) () ) () .false. .false. )] (Var 4 b) Public .true. .true. () ), p: (Variable 2 p [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), q: (Variable 2 q [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 2 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), signr32: (Function (SymbolTable 5 { r: (Variable 5 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 5 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 5 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) signr32 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x) (Var 5 y)] [(Assignment (Var 5 r) (Var 5 x) () .false. .false. ) (If () (LogicalBinOp (LogicalBinOp (RealCompare (Var 5 x) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) And (RealCompare (Var 5 y) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (RealCompare (Var 5 x) LtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) And (RealCompare (Var 5 y) LtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 5 r) (Var 5 x) () .false. .false. )] [(Assignment (Var 5 r) (RealUnaryMinus (Var 5 x) (Real 4) () ) () .false. .false. )] )] (Var 5 r) Public .true. .true. () ), x: (Variable 2 x [] Local (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x1: (Variable 2 x1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x2: (Variable 2 x2 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y1: (Variable 2 y1 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) functions_01 [] [(Assignment (Var 2 a1) (Var 2 x) () .false. .false. ) (Assignment (Var 2 x1) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 b1) (IntegerBinOp (Var 2 a1) Add (Var 2 x1) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 y) (Var 2 b1) () .false. .false. ) (Print (StringFormat () [(Var 2 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 q) (FunctionCall 2 f_real () [((Var 2 p))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 2 q)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 a) (RealConstant 20.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 b) (RealUnaryMinus (RealConstant 30.000000 (Real 4) ) (Real 4) (RealConstant -30.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 x2) (Var 2 a) () .false. .false. ) (Assignment (Var 2 y1) (Var 2 b) () .false. .false. ) (Assignment (Var 2 r) (Var 2 x2) () .false. .false. ) (If () (LogicalBinOp (LogicalBinOp (RealCompare (Var 2 x2) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) And (RealCompare (Var 2 y1) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (RealCompare (Var 2 x2) LtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) And (RealCompare (Var 2 y1) LtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 2 r) (Var 2 x2) () .false. .false. )] [(Assignment (Var 2 r) (RealUnaryMinus (Var 2 x2) (Real 4) () ) () .false. .false. )] ) (Assignment (Var 2 c) (Var 2 r) () .false. .false. ) (Print (StringFormat () [(Var 2 c)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-continue_compilation_ff_1-c2d5950.stderr0000664000175000017500000000706015174404631027041 0ustar alastairalastairtokenizer error: Unexpected token after the condition of the if statement --> tests/errors/continue_compilation_ff_1.f:120:27 | 120 | IF (i == ICHAR(x_2))) error stop | ^ syntax error: Newline is unexpected here --> tests/errors/continue_compilation_ff_1.f:93:14 | 93 | I == 10 | ^ syntax error: Token '.5' (of type 'real') is unexpected here --> tests/errors/continue_compilation_ff_1.f:94:14 | 94 | J = 20..5 | ^^ syntax error: Token 'i' (of type 'identifier') is unexpected here --> tests/errors/continue_compilation_ff_1.f:95:32 | 95 | PRINT *, "Value of I is" I | ^ syntax error: Invalid syntax for variable initialization (try inserting '::' after the type) --> tests/errors/continue_compilation_ff_1.f:96:7 | 96 | CHARACTER*10 STR = 'Hello ' | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ syntax error: Token 'format' (of type 'identifier') is unexpected here --> tests/errors/continue_compilation_ff_1.f:97:18 | 97 | WRITE(*,10 FORMAT(A)) | ^^^^^^ syntax error: Token '*' is unexpected here --> tests/errors/continue_compilation_ff_1.f:98:16 | 98 | A = B + * C | ^ syntax error: Token '.5' (of type 'real') is unexpected here --> tests/errors/continue_compilation_ff_1.f:101:20 | 101 | REAL X Y Z 10.5 | ^^ syntax error: Newline is unexpected here --> tests/errors/continue_compilation_ff_1.f:102:27 | 102 | COMPLEX C = (1.0,2.0 | ^ syntax error: Token '=' is unexpected here --> tests/errors/continue_compilation_ff_1.f:103:11 | 103 | I === 10 | ^ syntax error: Token 'e' (of type 'identifier') is unexpected here --> tests/errors/continue_compilation_ff_1.f:104:14 | 104 | J = .20E | ^ syntax error: Token '.45' (of type 'real') is unexpected here --> tests/errors/continue_compilation_ff_1.f:105:22 | 105 | REAL*8 A = 1.23.45 | ^^^ syntax error: Token 'thenprint' (of type 'identifier') is unexpected here --> tests/errors/continue_compilation_ff_1.f:118:20 | 118 | IF I .EQ. 10 THEN PRINT *, "Ten" | ^^^^^^^^^^ syntax error: Newline is unexpected here --> tests/errors/continue_compilation_ff_1.f:119:23 | 119 | CALL FUNC( 5, 6, | ^ warning: non-standard Fortran 77-style initialization (extension) --> tests/errors/continue_compilation_ff_1.f:106:17 | 106 | INTEGER*4 VAR/5/ | ^^^^^^ Use modern syntax instead: integer :: var = 5 semantic error: Symbol is already declared in the same scope --> tests/errors/continue_compilation_ff_1.f:107:17 | 107 | INTEGER*4 VAR/5/ | ^^^^^^ redeclaration | 106 | INTEGER*4 VAR/5/ | ~~~~~~ original declaration warning: This equivalence statement is not implemented yet, for now we will ignore it --> tests/errors/continue_compilation_ff_1.f:108:7 | 108 | EQUIVALENCE (X Y) | ^^^^^^^^^^^^^^^^^ ignored for now semantic error: Variable 'integerklm' is not declared --> tests/errors/continue_compilation_ff_1.f:99:7 | 99 | INTEGER K L M = 5 | ^^^^^^^^^^^^^ 'integerklm' is undeclared semantic error: Variable 'n5' is not declared --> tests/errors/continue_compilation_ff_1.f:100:15 | 100 | READ *, N 5 | ^^^ 'n5' is undeclared lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor4-0e1d0e4.json0000664000175000017500000000077015174404631026521 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor4-0e1d0e4", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor4.f90", "infile_hash": "3cb054641f93241f08e6335f76da31e95f6046107067226629d80dc8", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor4-0e1d0e4.stdout", "stdout_hash": "92bc7a414483bc88b5aa6618540dd7d7a41f565ef23b60d6ae34875e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-rand_01-5739aee.stderr0000664000175000017500000000022315174404631023231 0ustar alastairalastairwarning: `rand` is an LFortran extension --> tests/warnings/rand_01.f90:3:9 | 3 | x = rand() | ^^^^^^ Use `random_number` instead lfortran-0.63.0/tests/reference/run-array_bounds_check_03-15fcd63.stderr0000664000175000017500000000036215174404631026150 0ustar alastairalastairruntime error: Array 'x' is not allocated. Allocate it manually or use the '--realloc-lhs-arrays' option to allocate it automatically. --> tests/errors/array_bounds_check_03.f90:4:5 | 4 | x = [1, 2, 3] | ^ 'x' not allocated here lfortran-0.63.0/tests/reference/llvm-volatile_03-914e4e5.json0000664000175000017500000000075615174404631023712 0ustar alastairalastair{ "basename": "llvm-volatile_03-914e4e5", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/volatile_03.f90", "infile_hash": "3b3be17b65561543509ed16a60574cc3a3e7c9f0f574b21b8b02c026", "outfile": null, "outfile_hash": null, "stdout": "llvm-volatile_03-914e4e5.stdout", "stdout_hash": "38d8b06b238a21df048b50d877156a0f61cca26c905cd3c93a76c774", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-modules_11-bb73359.stdout0000664000175000017500000000034215174404631024232 0ustar alastairalastairmodule modules_11_module11 function access_internally() println("i = ", " ", i) end end using Main.modules_11_module11: access_internally function main() println("j = ", " ", j) access_internally() end main() lfortran-0.63.0/tests/reference/c-case_06-ecc9f3c.stdout0000664000175000017500000000431015174404631023037 0ustar alastairalastair#include #include #include #include #include #include // Implementations int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); static int32_t a = 1; const int32_t ap = 1; static int32_t b = 2; const int32_t bp = 2; static float c = 1.00000000000000000e+00; const float cp = 1.00000000000000000e+00; static float d = 2.00000000000000000e+00; const float dp = 2.00000000000000000e+00; const char* grade_fixed = "B"; int32_t marks; const int32_t marks_fixed = 94; if (grade_fixed == "A") { printf("%s\n","Excellent!"); } else if (grade_fixed == "B") { if (a == b) { printf("%s\n","a == b"); if (ap == bp) { printf("%s\n","ap == bp"); } else { printf("%s\n","ap /= bp"); } } else { if ((float)(ap) == cp) { printf("%s\n","ap == cp"); if (cp == dp) { printf("%s\n","cp == dp"); } else { printf("%s\n","cp /= dp"); } } else { if (c == d) { printf("%s\n","c == d"); } } } } else if (grade_fixed == "C") { printf("%s\n","Well done"); } else if (grade_fixed == "D") { printf("%s\n","You passed"); } else if (grade_fixed == "F") { printf("%s\n","Better try again"); } else { printf("%s\n","Invalid grade"); } printf("%s%s%s\n", "Your grade is ", " ", grade_fixed); marks = 94; if (marks >= 40 + bp) { printf("%s\n","Pass!"); } else if (marks <= 39 - ap) { printf("%s\n","Failed!"); } else { printf("%s\n","Invalid marks"); } printf("%s%s%d\n", "Your marks are ", " ", marks); if (marks_fixed >= 40 + bp) { printf("%s\n","Pass!"); } else if (0 <= marks_fixed <= 39 - ap) { printf("%s\n","Failed!"); } else { printf("%s\n","Invalid marks"); } printf("%s%s%d\n", "Your marks are ", " ", marks); return 0; } lfortran-0.63.0/tests/reference/asr-implicit10-23a5156.json0000664000175000017500000000104415174404631023254 0ustar alastairalastair{ "basename": "asr-implicit10-23a5156", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/implicit10.f90", "infile_hash": "f0dec4633ec4724235e11ed6642f34f24f69c6f4dc41aab5ae903cfa", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit10-23a5156.stdout", "stdout_hash": "d17241040f21363b7e20bc8642a8f862eb48b2fff817a14ba2c3cd61", "stderr": "asr-implicit10-23a5156.stderr", "stderr_hash": "5e0f52ad16423091b73b5dc0c5de3f43847ef3bf23e99f74475d49f6", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-block_01-98c37d0.json0000664000175000017500000000074215174404631022772 0ustar alastairalastair{ "basename": "asr-block_01-98c37d0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/block_01.f90", "infile_hash": "e1008df68ca08f26a1d9f91a68ee7ec4e7744837a022b483c129a5c1", "outfile": null, "outfile_hash": null, "stdout": "asr-block_01-98c37d0.stdout", "stdout_hash": "8252e8939ac4cb387b32a411d0f0ddc5f8611109b10abce3ca5f0266", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/fortran-expr5-3a279bb.stdout0000664000175000017500000000017015174404631023745 0ustar alastairalastairprogram expr_05 implicit none integer(4) :: x x = (2 + 3)*5 if (x == 25) then error stop end if end program expr_05 lfortran-0.63.0/tests/reference/ast-program_without_line_02-250a492.json0000664000175000017500000000100115174404631026036 0ustar alastairalastair{ "basename": "ast-program_without_line_02-250a492", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/program_without_line_02.f90", "infile_hash": "9879692314d25d3cb4e64d2849069dfde5f8bc21c8003300119e80b2", "outfile": null, "outfile_hash": null, "stdout": "ast-program_without_line_02-250a492.stdout", "stdout_hash": "cecb5013af867fa1849c74cf81134bb3505379e5153c7e8839a48508", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-program1-5e4637e.json0000664000175000017500000000070015174404631023120 0ustar alastairalastair{ "basename": "cpp-program1-5e4637e", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/program1.f90", "infile_hash": "ec4ccdfed01d45648718ca57a9ceb3e5aa82e55e57d8906636902e7b", "outfile": null, "outfile_hash": null, "stdout": "cpp-program1-5e4637e.stdout", "stdout_hash": "073746662932e0ce2e600c25a715615fe4b74026be4ae139ed0708aa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-subroutine1-b6656b7.stderr0000664000175000017500000000020715174404631024206 0ustar alastairalastairsemantic error: Assignment to subroutine is not allowed --> tests/errors/subroutine1.f90:5:9 | 5 | bpe = 1 | ^^^ lfortran-0.63.0/tests/reference/run-realloc_lhs_22-3d95c80.stderr0000664000175000017500000000037115174404631024537 0ustar alastairalastairruntime error: Array 'x' is not allocated. Allocate it manually or use the '--realloc-lhs-arrays' option to allocate it automatically. --> tests/../integration_tests/realloc_lhs_22.f90:5:5 | 5 | x = [1, 2, 3] | ^ 'x' not allocated here lfortran-0.63.0/tests/reference/tokens-esub2-4cb444d.json0000664000175000017500000000072415174404631023205 0ustar alastairalastair{ "basename": "tokens-esub2-4cb444d", "cmd": "lfortran --no-color --show-tokens {infile} -o {outfile}", "infile": "tests/errors/esub2.f90", "infile_hash": "fb45951fe73ff1605633612371af0d19b7036b3aef93d6b084c33823", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "tokens-esub2-4cb444d.stderr", "stderr_hash": "f34c7ceeeaa22d1c9075e3ff71d51db6bdcd53ddb1f0b3c39e05fc33", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-flip_sign-a0cebd4.stdout0000664000175000017500000002223615174404631024126 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { flip_sign: (Program (SymbolTable 2 { eps: (Variable 2 eps [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), number: (Variable 2 number [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) flip_sign [] [(Assignment (Var 2 number) (IntegerConstant 123 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 5.500000 (Real 4) ) () .false. .false. ) (If () (IntegerCompare (IntrinsicElementalFunction Modulo [(Var 2 number) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4) ) (Real 4) (RealConstant -5.500000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 number) (IntegerConstant 124 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 5.500000 (Real 4) ) () .false. .false. ) (If () (IntegerCompare (IntrinsicElementalFunction Modulo [(Var 2 number) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-defop1-57f175e.stdout0000664000175000017500000000027415174404631023611 0ustar alastairalastairprogram defop1 ! Tests for syntax (AST) only: e = a.in.b E = A.IN.B e = b%s.op.3**4 E = B%S.OP.3**4 e = a + b.x.y**x e = x**x.x.x**x E = X**X.X.X**X e = (x.x.x.in.3)**4 end program defop1 lfortran-0.63.0/tests/reference/pass_implied_do_loops-modules_35-c089638.stdout0000664000175000017500000007012715174404631027441 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { m_cli2_21: (Module (SymbolTable 2 { get_args_fixed_length_a_array: (Function (SymbolTable 3 { __1__libasr_index_: (Variable 3 __1__libasr_index_ [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __1__libasr_index_1: (Variable 3 __1__libasr_index_1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr__created__var__0__array_constructor_: (Variable 3 __libasr__created__var__0__array_constructor_ [] Local () () Default (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr__created__var__1__array_constructor_: (Variable 3 __libasr__created__var__1__array_constructor_ [] Local () () Default (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), place: (Variable 3 place [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), strings: (Variable 3 strings [] Unspecified () () Default (Allocatable (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), strings_a: (Variable 3 strings_a [] Local () () Default (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_args_fixed_length_a_array (FunctionType [(Allocatable (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 strings)] [(Allocate [((Var 3 strings_a) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] (IntegerConstant 5 (Integer 4) Decimal) () (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString))] () () () ) (If () (IntegerCompare (Var 3 place) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(If () (IntegerCompare (StringLen (ArrayItem (Var 3 strings_a) [(() (ArrayBound (Var 3 strings_a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () DeferredLength DescriptorString) ColMajor () ) (Integer 4) () ) LtE (StringLen (ArrayItem (Var 3 strings) [(() (ArrayBound (Var 3 strings) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () AssumedLength DescriptorString) ColMajor () ) (Integer 4) () ) (Logical 4) () ) [(Assignment (Var 3 strings) (Var 3 strings_a) () .false. .false. )] [(ExplicitDeallocate [(Var 3 __libasr__created__var__0__array_constructor_)] ) (Allocate [((Var 3 __libasr__created__var__0__array_constructor_) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] (StringLen (ArrayItem (Var 3 strings) [(() (ArrayBound (Var 3 strings) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () AssumedLength DescriptorString) ColMajor () ) (Integer 4) () ) () ())] () () () ) (Assignment (Var 3 __1__libasr_index_) (ArrayBound (Var 3 __libasr__created__var__0__array_constructor_) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) () .false. .false. ) (Assignment (Var 3 strings) (Var 3 __libasr__created__var__0__array_constructor_) () .false. .false. )] )] [] ) (If () (IntegerCompare (Var 3 place) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ExplicitDeallocate [(Var 3 __libasr__created__var__1__array_constructor_)] ) (Allocate [((Var 3 __libasr__created__var__1__array_constructor_) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] (StringLen (ArrayItem (Var 3 strings) [(() (ArrayBound (Var 3 strings) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () AssumedLength DescriptorString) ColMajor () ) (Integer 4) () ) () ())] () () () ) (Assignment (Var 3 __1__libasr_index_1) (ArrayBound (Var 3 __libasr__created__var__1__array_constructor_) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) () .false. .false. ) (Assignment (Var 3 strings) (Var 3 __libasr__created__var__1__array_constructor_) () .false. .false. )] [] )] () Public .true. .true. () ) }) m_cli2_21 () [] .false. .false. .false. ), modules_35: (Program (SymbolTable 4 { get_args_fixed_length_a_array: (ExternalSymbol 4 get_args_fixed_length_a_array 2 get_args_fixed_length_a_array m_cli2_21 [] get_args_fixed_length_a_array Public ), string: (Variable 4 string [] Local () () Default (Allocatable (Array (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) modules_35 [m_cli2_21] [(Allocate [((Var 4 string) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] () () ())] () () () ) (Print (StringConstant "executing modules_35" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (SubroutineCall 4 get_args_fixed_length_a_array () [((Var 4 string))] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr_ignore_pragma-pragma2-ba96e35.stdout0000664000175000017500000000714515174404631026255 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { pragma2: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) pragma2 [] [(Assignment (Var 2 a) (ArrayBroadcast (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) (ArrayConstant 4 [8] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 32 [1.00000000e+00, 1.00000000e+00, 1.00000000e+00, ...., 1.00000000e+00, 1.00000000e+00, 1.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-nullify_02-1f0bd3a.stdout0000664000175000017500000001346215174404631024056 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nullify_02: (Program (SymbolTable 2 { p1: (Variable 2 p1 [] Local () () Default (Pointer (Real 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p2: (Variable 2 p2 [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t1: (Variable 2 t1 [] Local () () Default (Real 4) () Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), t2: (Variable 2 t2 [] Local () () Default (Integer 4) () Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ) }) nullify_02 [] [(Associate (Var 2 p1) (Var 2 t1) ) (Assignment (Var 2 p1) (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) () .false. .false. ) (Associate (Var 2 p2) (Var 2 t2) ) (Assignment (Var 2 p2) (Cast (RealConstant 2.000000 (Real 4) ) RealToInteger (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) () ) () .false. .false. ) (Nullify [(Var 2 p1) (Var 2 p2)] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-case_04-42ea8ac.json0000664000175000017500000000075215174404631023425 0ustar alastairalastair{ "basename": "ast_f90-case_04-42ea8ac", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/case_04.f90", "infile_hash": "55392e5b3b536591894e60672e49e61f8c579e20edb5d007f1f1afae", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-case_04-42ea8ac.stdout", "stdout_hash": "fe42f48018828361259c0869c5760e8b8e41559b2015ca9ed6c10efa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-entry1-3075e81.json0000664000175000017500000000075615174404631022542 0ustar alastairalastair{ "basename": "asr-entry1-3075e81", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/entry1.f90", "infile_hash": "ca0b3d63526c84c42bb3f45badc8a6393867586040e33d02c7a8561c", "outfile": null, "outfile_hash": null, "stdout": "asr-entry1-3075e81.stdout", "stdout_hash": "5d8e0e3d2d98b8d2384f00dc6a1ade93c800ad708cd7d84305ba1334", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-block_data1-33d76d9.stdout0000664000175000017500000000016515174404631024120 0ustar alastairalastair(TranslationUnit [(BlockData block_data1 () [] [] [] [] )] ) lfortran-0.63.0/tests/reference/asr-arrays_08_func-2759ced.json0000664000175000017500000000111115174404631024273 0ustar alastairalastair{ "basename": "asr-arrays_08_func-2759ced", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_08_func.f90", "infile_hash": "31dc0eac87716ea184d20ac42f94636f0a25c0ee00022272c2b1327d", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_08_func-2759ced.stdout", "stdout_hash": "93cc6ada2c6c25f82e0561f8359abd26d34ed070a1ddae7015890d53", "stderr": "asr-arrays_08_func-2759ced.stderr", "stderr_hash": "d70481e5625f20fa12d3e8bdad4a5dfa6912ac62ade8fc840a5da64b", "returncode": 0 }lfortran-0.63.0/tests/reference/run-write_02-795afbb.stderr0000664000175000017500000000012515174404631023535 0ustar alastairalastairRuntime Error: Format mismatch between OPEN statement and WRITE statement on unit 1. lfortran-0.63.0/tests/reference/run-format1-04216cf.stdout0000664000175000017500000000402115174404631023317 0ustar alastairalastairokb okb okb Success! Hello World! Success! Hello World! Success! Hello World! danc in themoon danc in themoon danc in themoon ab cdef ghi jkl qwerty 12 ab cdef ghi jkl qwerty 12 ab cdef ghi jkl qwerty 12 123 00456 012345 *** 123 00456 012345 *** 123 00456 012345 *** 0.12D+03 -0.123457D+03 0.12D+02 ******* 0.12D+03 -0.123457D+03 0.12D+02 ******* 0.12D+03 -0.123457D+03 0.12D+02 ******* -1.23D+02 12.34568D+01 -1.23D+01 1.23D+02 -1.23D+02 12.34568D+01 -1.23D+01 1.23D+02 -1.23D+02 12.34568D+01 -1.23D+01 1.23D+02 -0.01E+04 0.001235E+05 -1.23E+01 1.23E+02 -0.01E+04 0.001235E+05 -1.23E+01 1.23E+02 -0.01E+04 0.001235E+05 -1.23E+01 1.23E+02 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 hello 5 6 7 8 hello 9 10 11 12 hello 13 14 1 2 3 4 hello 5 6 7 8 hello 9 10 11 12 hello 13 14 12345 -12345 12345 -12345 0.D+3 0.1D+3 0.12D+2 0.D+3 0.1D+3 0.12D+2 0.D+3 0.1D+3 0.12D+2 -0.D+3 -0.1D+3 -0.12D+2 -0.D+3 -0.1D+3 -0.12D+2 Hello 12345678.000 23.567801 .35 12345678.000 23.567801 .35 12345678.000 23.567801 .35 -12345678.000 ********* -.35 -12345678.000 ********* -.35 2.000000E+00 0.000000E+00 2.000000E+00 0.000000E+00 0.0000000000000000000012345 0.0000000000000000000012345 x:1.12 y:4.5E+00 x:1.12 y:4.5E+00 x:1.12 y:4.5E+00 x: 9.99E-01 x: 1.00E-01 x: 9.99E-01 x: 1.00E-01 x: 1.02212E-01 x: 1.02212E-01 -1.70139E+38 -1.25381E+38 8.69780E+37 -1.40706E+37 1.11501E+37 -9.56332E+37 -1.70139E+38 -1.25381E+38 8.69780E+37 -1.40706E+37 1.11501E+37 -9.56332E+37 -1.70139E+38 -1.25381E+38 8.69780E+37 -1.40706E+37 1.11501E+37 -9.56332E+37 0.000 0.000 -0.000 -0.000 -0.000 100.000000 100.000 "0." 19 21 19 21 19 21 19 21 19 21 foobar foobar foobar 19 Dates: 20 22 21 23 19 Dates: 20 22 21 23 19 Dates: 20 22 21 23 19 Dates: 20 22 21 23 lfortran-0.63.0/tests/reference/ast-arrays_02-bc13aa6.json0000664000175000017500000000074515174404631023326 0ustar alastairalastair{ "basename": "ast-arrays_02-bc13aa6", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_02.f90", "infile_hash": "b5b3a6833fd727f5cce92c3c4886c4e20117f33710a1ec8b1016d8f6", "outfile": null, "outfile_hash": null, "stdout": "ast-arrays_02-bc13aa6.stdout", "stdout_hash": "4b2ebaa19b588121daa2e7e2ef5c16c5cfd2a058a451e3c051ae5f02", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-reserved_01-566a18c.json0000664000175000017500000000076615174404631024201 0ustar alastairalastair{ "basename": "ast_f90-reserved_01-566a18c", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/reserved_01.f90", "infile_hash": "8f2d369e0f1a924d90eacfcc549441b5c9e0b56d89b4fda9164c8a84", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-reserved_01-566a18c.stdout", "stdout_hash": "1c7b4aef3fe18355b47331689f63c8c3a466a0d1d3fc8473bc6d4cba", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-continue_compilation_ff_2-9ba55e7.stdout0000664000175000017500000000121215174404631027140 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { continue_compilation_ff_2: (Program (SymbolTable 2 { }) continue_compilation_ff_2 [] [(Print (StringConstant "This is a test program" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-data_12-af356bd.json0000664000175000017500000000073715174404631022750 0ustar alastairalastair{ "basename": "asr-data_12-af356bd", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/data_12.f90", "infile_hash": "80710a15ea7a648779263ef05c92564bd17392b333fcaeeef1880a91", "outfile": null, "outfile_hash": null, "stdout": "asr-data_12-af356bd.stdout", "stdout_hash": "67ba8f625c7633242731f810113e057d3c24a864c85ed6bfad3f3d34", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-int_01-9bf3eb9.stderr0000664000175000017500000000036215174404631023164 0ustar alastairalastairsemantic error: `kind` argument of `int` intrinsic must be a scalar --> tests/errors/int_01.f90:2:54 | 2 | integer(8), parameter :: ar1(3) = int([1, 2, 3], [8, 8, 8]) | ^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-do1-a0276c3.stdout0000664000175000017500000000166515174404631022427 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [] [] [] [] [(DoLoop 0 () 1 i 1 2 () [(DoLoop 0 () 2 j 1 3 () [(DoLoop 0 () 2 k 1 4 () [(Continue 2 () )] () () )] () () ) (Continue 1 () )] () () )] [] [] )] ) lfortran-0.63.0/tests/reference/run-implied_do_loop2-a8638e0.stdout0000664000175000017500000000002015174404631025172 0ustar alastairalastairHelloHelloHello lfortran-0.63.0/tests/reference/llvm-finalize_02-cfb24d5.stdout0000664000175000017500000004361515174404631024376 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> %array.1.1 = type { %string_descriptor*, i64, i32, i8, i8, i8, i8, i64, [1 x %dimension_descriptor] } %dimension_descriptor = type { i64, i64, i64 } %array.1.0 = type { i32*, i64, i32, i8, i8, i8, i8, i64, [1 x %dimension_descriptor] } %array.1 = type { %finalize_02.tt*, i64, i32, i8, i8, i8, i8, i64, [1 x %dimension_descriptor] } %finalize_02.tt = type { float, %finalize_02.t } %finalize_02.t = type { i32 } @deep_0 = internal global i32 0 define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store i32 200, i32* %call_arg_value, align 4 call void @ss(i32* %call_arg_value) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_finalize_02 FINALIZE_SYMTABLE_finalize_02: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } define void @ss(i32* %nang) { .entry: %0 = call i8* @_lfortran_get_default_allocator() %1 = call i8* @_lfortran_get_default_allocator() %arr_desc_str_desc5 = alloca %string_descriptor, align 8 %arr_desc4 = alloca %array.1.1, align 8 %arr_07 = alloca %string_descriptor, align 8 %arr_desc3 = alloca %array.1.0, align 8 %arr_05 = alloca %string_descriptor, align 8 %arr_desc_str_desc = alloca %string_descriptor, align 8 %arr_desc2 = alloca %array.1.1, align 8 %arr_desc1 = alloca %array.1.0, align 8 %arr_desc = alloca %array.1, align 8 %arr_01 = alloca %array.1*, align 8 store %array.1* null, %array.1** %arr_01, align 8 %2 = getelementptr %array.1, %array.1* %arr_desc, i32 0, i32 8 %3 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %2, i32 0, i32 0 %4 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %3, i32 0 %5 = getelementptr %dimension_descriptor, %dimension_descriptor* %4, i32 0, i32 0 store i64 1, i64* %5, align 8 %6 = getelementptr %dimension_descriptor, %dimension_descriptor* %4, i32 0, i32 1 store i64 1, i64* %6, align 8 %7 = getelementptr %dimension_descriptor, %dimension_descriptor* %4, i32 0, i32 2 store i64 0, i64* %7, align 8 %8 = getelementptr %array.1, %array.1* %arr_desc, i32 0, i32 3 store i8 1, i8* %8, align 1 %9 = getelementptr %array.1, %array.1* %arr_desc, i32 0, i32 0 store %finalize_02.tt* null, %finalize_02.tt** %9, align 8 store %array.1* %arr_desc, %array.1** %arr_01, align 8 %arr_02 = alloca %array.1.0*, align 8 store %array.1.0* null, %array.1.0** %arr_02, align 8 %10 = getelementptr %array.1.0, %array.1.0* %arr_desc1, i32 0, i32 8 %11 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %10, i32 0, i32 0 %12 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %11, i32 0 %13 = getelementptr %dimension_descriptor, %dimension_descriptor* %12, i32 0, i32 0 store i64 1, i64* %13, align 8 %14 = getelementptr %dimension_descriptor, %dimension_descriptor* %12, i32 0, i32 1 store i64 1, i64* %14, align 8 %15 = getelementptr %dimension_descriptor, %dimension_descriptor* %12, i32 0, i32 2 store i64 0, i64* %15, align 8 %16 = getelementptr %array.1.0, %array.1.0* %arr_desc1, i32 0, i32 3 store i8 1, i8* %16, align 1 %17 = getelementptr %array.1.0, %array.1.0* %arr_desc1, i32 0, i32 0 store i32* null, i32** %17, align 8 store %array.1.0* %arr_desc1, %array.1.0** %arr_02, align 8 %arr_03 = alloca i32*, align 8 store i32* null, i32** %arr_03, align 8 %arr_04 = alloca %array.1.1*, align 8 store %array.1.1* null, %array.1.1** %arr_04, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %arr_desc_str_desc, i32 0, i32 0 store i8* null, i8** %18, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %arr_desc_str_desc, i32 0, i32 1 store i64 0, i64* %19, align 8 %20 = getelementptr %array.1.1, %array.1.1* %arr_desc2, i32 0, i32 0 store %string_descriptor* %arr_desc_str_desc, %string_descriptor** %20, align 8 %21 = getelementptr %array.1.1, %array.1.1* %arr_desc2, i32 0, i32 8 %22 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %21, i32 0, i32 0 %23 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %22, i32 0 %24 = getelementptr %dimension_descriptor, %dimension_descriptor* %23, i32 0, i32 0 store i64 1, i64* %24, align 8 %25 = getelementptr %dimension_descriptor, %dimension_descriptor* %23, i32 0, i32 1 store i64 1, i64* %25, align 8 %26 = getelementptr %dimension_descriptor, %dimension_descriptor* %23, i32 0, i32 2 store i64 0, i64* %26, align 8 %27 = getelementptr %array.1.1, %array.1.1* %arr_desc2, i32 0, i32 3 store i8 1, i8* %27, align 1 store %array.1.1* %arr_desc2, %array.1.1** %arr_04, align 8 %28 = getelementptr %string_descriptor, %string_descriptor* %arr_05, i32 0, i32 0 store i8* null, i8** %28, align 8 %29 = getelementptr %string_descriptor, %string_descriptor* %arr_05, i32 0, i32 1 store i64 0, i64* %29, align 8 %30 = getelementptr %string_descriptor, %string_descriptor* %arr_05, i32 0, i32 1 store i64 20, i64* %30, align 8 %31 = call i8* @_lfortran_get_default_allocator() %32 = call i8* @_lfortran_malloc_alloc(i8* %31, i64 100) %33 = getelementptr %string_descriptor, %string_descriptor* %arr_05, i32 0, i32 0 store i8* %32, i8** %33, align 8 %arr_06 = alloca %array.1.0*, align 8 store %array.1.0* null, %array.1.0** %arr_06, align 8 %34 = getelementptr %array.1.0, %array.1.0* %arr_desc3, i32 0, i32 8 %35 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %34, i32 0, i32 0 %36 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %35, i32 0 %37 = getelementptr %dimension_descriptor, %dimension_descriptor* %36, i32 0, i32 0 store i64 1, i64* %37, align 8 %38 = getelementptr %dimension_descriptor, %dimension_descriptor* %36, i32 0, i32 1 store i64 1, i64* %38, align 8 %39 = getelementptr %dimension_descriptor, %dimension_descriptor* %36, i32 0, i32 2 store i64 0, i64* %39, align 8 %40 = getelementptr %array.1.0, %array.1.0* %arr_desc3, i32 0, i32 3 store i8 1, i8* %40, align 1 %41 = getelementptr %array.1.0, %array.1.0* %arr_desc3, i32 0, i32 0 store i32* null, i32** %41, align 8 store %array.1.0* %arr_desc3, %array.1.0** %arr_06, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %arr_07, align 1 %arr_08 = alloca %array.1.1*, align 8 store %array.1.1* null, %array.1.1** %arr_08, align 8 %42 = getelementptr %string_descriptor, %string_descriptor* %arr_desc_str_desc5, i32 0, i32 0 store i8* null, i8** %42, align 8 %43 = getelementptr %string_descriptor, %string_descriptor* %arr_desc_str_desc5, i32 0, i32 1 store i64 0, i64* %43, align 8 %44 = getelementptr %array.1.1, %array.1.1* %arr_desc4, i32 0, i32 0 store %string_descriptor* %arr_desc_str_desc5, %string_descriptor** %44, align 8 %45 = getelementptr %array.1.1, %array.1.1* %arr_desc4, i32 0, i32 8 %46 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %45, i32 0, i32 0 %47 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %46, i32 0 %48 = getelementptr %dimension_descriptor, %dimension_descriptor* %47, i32 0, i32 0 store i64 1, i64* %48, align 8 %49 = getelementptr %dimension_descriptor, %dimension_descriptor* %47, i32 0, i32 1 store i64 1, i64* %49, align 8 %50 = getelementptr %dimension_descriptor, %dimension_descriptor* %47, i32 0, i32 2 store i64 0, i64* %50, align 8 %51 = getelementptr %array.1.1, %array.1.1* %arr_desc4, i32 0, i32 3 store i8 1, i8* %51, align 1 store %array.1.1* %arr_desc4, %array.1.1** %arr_08, align 8 %52 = load i32, i32* %nang, align 4 store i32 %52, i32* @deep_0, align 4 %53 = load i32, i32* @deep_0, align 4 %54 = mul i32 1, %53 %55 = mul i32 %54, 4 %56 = sext i32 %55 to i64 %57 = call i8* @_lfortran_get_default_allocator() %58 = call i8* @_lfortran_malloc_alloc(i8* %57, i64 %56) %59 = bitcast i8* %58 to i32* br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_ss FINALIZE_SYMTABLE_ss: ; preds = %return br label %Finalize_Variable_arr_01 Finalize_Variable_arr_01: ; preds = %FINALIZE_SYMTABLE_ss %60 = load %array.1*, %array.1** %arr_01, align 8 call void @finalize_allocatable__Array_1_StructType__tt(%array.1* %60) br label %Finalize_Variable_arr_02 Finalize_Variable_arr_02: ; preds = %Finalize_Variable_arr_01 %61 = load %array.1.0*, %array.1.0** %arr_02, align 8 call void @finalize_allocatable__Array_1_i32(%array.1.0* %61) br label %Finalize_Variable_arr_03 Finalize_Variable_arr_03: ; preds = %Finalize_Variable_arr_02 %62 = load i32*, i32** %arr_03, align 8 %63 = bitcast i32* %62 to i8* call void @_lfortran_free_alloc(i8* %1, i8* %63) br label %Finalize_Variable_arr_04 Finalize_Variable_arr_04: ; preds = %Finalize_Variable_arr_03 %64 = load %array.1.1*, %array.1.1** %arr_04, align 8 call void @finalize_allocatable__Array_1_str(%array.1.1* %64) br label %Finalize_Variable_arr_05 Finalize_Variable_arr_05: ; preds = %Finalize_Variable_arr_04 %65 = getelementptr %string_descriptor, %string_descriptor* %arr_05, i32 0, i32 0 %66 = load i8*, i8** %65, align 8 call void @_lfortran_free_alloc(i8* %0, i8* %66) %67 = ptrtoint %string_descriptor* %arr_05 to i64 %68 = icmp ne i64 %67, 0 br i1 %68, label %then, label %else then: ; preds = %Finalize_Variable_arr_05 br label %ifcont else: ; preds = %Finalize_Variable_arr_05 br label %ifcont ifcont: ; preds = %else, %then br label %Finalize_Variable_arr_06 Finalize_Variable_arr_06: ; preds = %ifcont %69 = load %array.1.0*, %array.1.0** %arr_06, align 8 call void @finalize_allocatable__Array_1_i32(%array.1.0* %69) br label %Finalize_Variable_arr_07 Finalize_Variable_arr_07: ; preds = %Finalize_Variable_arr_06 %70 = getelementptr %string_descriptor, %string_descriptor* %arr_07, i32 0, i32 0 %71 = load i8*, i8** %70, align 8 call void @_lfortran_free_alloc(i8* %0, i8* %71) br label %Finalize_Variable_arr_08 Finalize_Variable_arr_08: ; preds = %Finalize_Variable_arr_07 %72 = load %array.1.1*, %array.1.1** %arr_08, align 8 call void @finalize_allocatable__Array_1_str(%array.1.1* %72) br label %Finalize_Variable_arr_09 Finalize_Variable_arr_09: ; preds = %Finalize_Variable_arr_08 %73 = ptrtoint i32* %59 to i64 %74 = icmp ne i64 %73, 0 br i1 %74, label %then6, label %else7 then6: ; preds = %Finalize_Variable_arr_09 %75 = bitcast i32* %59 to i8* call void @_lfortran_free_alloc(i8* %0, i8* %75) br label %ifcont8 else7: ; preds = %Finalize_Variable_arr_09 br label %ifcont8 ifcont8: ; preds = %else7, %then6 ret void } declare i8* @_lfortran_malloc_alloc(i8*, i64) declare i8* @_lfortran_get_default_allocator() define internal void @finalize_allocatable__Array_1_StructType__tt(%array.1* %0) { entry: %1 = icmp ne %array.1* %0, null br i1 %1, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %entry call void @finalize_descriptorArray_Array_1_StructType__tt(%array.1* %0) br label %is_allocated.ifcont is_allocated.else: ; preds = %entry br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %is_allocated.then ret void } define internal void @finalize_descriptorArray_Array_1_StructType__tt(%array.1* %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = alloca i32, align 4 %3 = alloca i64, align 8 %4 = getelementptr %array.1, %array.1* %0, i32 0, i32 0 %5 = load %finalize_02.tt*, %finalize_02.tt** %4, align 8 %6 = icmp ne %finalize_02.tt* %5, null br i1 %6, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %entry br label %Calculate_arraySize Calculate_arraySize: ; preds = %is_allocated.then %7 = getelementptr %array.1, %array.1* %0, i32 0, i32 8 %8 = getelementptr [1 x %dimension_descriptor], [1 x %dimension_descriptor]* %7, i32 0, i32 0 %9 = getelementptr %array.1, %array.1* %0, i32 0, i32 3 %10 = load i8, i8* %9, align 1 %11 = zext i8 %10 to i32 store i64 1, i64* %3, align 8 store i32 0, i32* %2, align 4 br label %loop.head loop.head: ; preds = %loop.body, %Calculate_arraySize %12 = load i32, i32* %2, align 4 %13 = icmp slt i32 %12, %11 br i1 %13, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %14 = load i32, i32* %2, align 4 %15 = load i64, i64* %3, align 8 %16 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %8, i32 %14 %17 = getelementptr %dimension_descriptor, %dimension_descriptor* %16, i32 0, i32 1 %18 = load i64, i64* %17, align 8 %19 = mul i64 %15, %18 store i64 %19, i64* %3, align 8 %20 = add i32 %14, 1 store i32 %20, i32* %2, align 4 br label %loop.head loop.end: ; preds = %loop.head %21 = load i64, i64* %3, align 8 call void @finalize_array_data_StructType__tt(%finalize_02.tt* %5, i64 %21) br label %is_allocated.ifcont is_allocated.else: ; preds = %entry br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %loop.end %22 = ptrtoint %finalize_02.tt* %5 to i64 %23 = icmp ne i64 %22, 0 br i1 %23, label %then, label %else then: ; preds = %is_allocated.ifcont %24 = bitcast %finalize_02.tt* %5 to i8* call void @_lfortran_free_alloc(i8* %1, i8* %24) br label %ifcont else: ; preds = %is_allocated.ifcont br label %ifcont ifcont: ; preds = %else, %then ret void } define internal void @finalize_array_data_StructType__tt(%finalize_02.tt* %0, i64 %1) { entry: %arrSize_iter = alloca i64, align 8 store i64 -1, i64* %arrSize_iter, align 8 br label %Finalize_array_of_structs.head Finalize_array_of_structs.head: ; preds = %Finalize_array_of_structs.body, %entry %2 = load i64, i64* %arrSize_iter, align 8 %3 = add i64 %2, 1 store i64 %3, i64* %arrSize_iter, align 8 %4 = icmp slt i64 %3, %1 br i1 %4, label %Finalize_array_of_structs.body, label %Finalize_array_of_structs.end Finalize_array_of_structs.body: ; preds = %Finalize_array_of_structs.head %5 = load i64, i64* %arrSize_iter, align 8 %6 = getelementptr inbounds %finalize_02.tt, %finalize_02.tt* %0, i64 %5 br label %Finalize_array_of_structs.head Finalize_array_of_structs.end: ; preds = %Finalize_array_of_structs.head ret void } declare void @_lfortran_free_alloc(i8*, i8*) define internal void @finalize_allocatable__Array_1_i32(%array.1.0* %0) { entry: %1 = icmp ne %array.1.0* %0, null br i1 %1, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %entry call void @finalize_descriptorArray_Array_1_i32(%array.1.0* %0) br label %is_allocated.ifcont is_allocated.else: ; preds = %entry br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %is_allocated.then ret void } define internal void @finalize_descriptorArray_Array_1_i32(%array.1.0* %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = getelementptr %array.1.0, %array.1.0* %0, i32 0, i32 0 %3 = load i32*, i32** %2, align 8 %4 = ptrtoint i32* %3 to i64 %5 = icmp ne i64 %4, 0 br i1 %5, label %then, label %else then: ; preds = %entry %6 = bitcast i32* %3 to i8* call void @_lfortran_free_alloc(i8* %1, i8* %6) br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then ret void } define internal void @finalize_allocatable__Array_1_str(%array.1.1* %0) { entry: %1 = icmp ne %array.1.1* %0, null br i1 %1, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %entry call void @finalize_descriptorArray_Array_1_str(%array.1.1* %0) br label %is_allocated.ifcont is_allocated.else: ; preds = %entry br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %is_allocated.then ret void } define internal void @finalize_descriptorArray_Array_1_str(%array.1.1* %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = getelementptr %array.1.1, %array.1.1* %0, i32 0, i32 0 %3 = load %string_descriptor*, %string_descriptor** %2, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %3, i32 0, i32 0 %5 = load i8*, i8** %4, align 8 call void @_lfortran_free_alloc(i8* %1, i8* %5) %6 = ptrtoint %string_descriptor* %3 to i64 %7 = icmp ne i64 %6, 0 br i1 %7, label %then, label %else then: ; preds = %entry br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then ret void } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/ast-do_concurrent_reduce2-1f96d95.json0000664000175000017500000000076415174404631025671 0ustar alastairalastair{ "basename": "ast-do_concurrent_reduce2-1f96d95", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do_concurrent_reduce2.f90", "infile_hash": "bfbb329c50d12cea347c298fcc5ba3ee9f192b8b43de74deccf70615", "outfile": null, "outfile_hash": null, "stdout": "ast-do_concurrent_reduce2-1f96d95.stdout", "stdout_hash": "0526bbede1282ffb3dc2d117dfb3ad0c5d4fe1c60e1f5a486173c266", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_simple_03-17a83b7.json0000664000175000017500000000100015174404631025045 0ustar alastairalastair{ "basename": "asr-template_simple_03-17a83b7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_simple_03.f90", "infile_hash": "4b9fce92a050c8b14e32eac9f65dc1f46314f8397d313b4bd772f0d4", "outfile": null, "outfile_hash": null, "stdout": "asr-template_simple_03-17a83b7.stdout", "stdout_hash": "9d21dfc4c215bb56c2fc50bc42a7858fd108d407e46c0a97dfd3a4e6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-select_type_03-f21585a.json0000664000175000017500000000076415174404631024220 0ustar alastairalastair{ "basename": "asr-select_type_03-f21585a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/select_type_03.f90", "infile_hash": "decbcd228b2684e48b773166bdb84b545e301f4480a87f7bbc9bd762", "outfile": null, "outfile_hash": null, "stdout": "asr-select_type_03-f21585a.stdout", "stdout_hash": "1f5b7c268af73432e2bb51fedf31d798a386d0744235b716ec6b5760", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixedform_doloop-d9fb32d.json0000664000175000017500000000076015174404631025075 0ustar alastairalastair{ "basename": "ast-fixedform_doloop-d9fb32d", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_doloop.f", "infile_hash": "bfd5fbdf93e7063f71ab6aa6aa5b1ba62a5c49b82aaef0ecaaf14ab2", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_doloop-d9fb32d.stdout", "stdout_hash": "98c17b871e5c7c0259a7114389fa7c2e397881db2ff1df744d16461c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-dim_float_01-74fa3d6.stderr0000664000175000017500000000026215174404631024242 0ustar alastairalastairsemantic error: `dim` argument of `Sum` intrinsic must be INTEGER --> tests/errors/dim_float_01.f90:2:26 | 2 | print *, sum([1, 2, 3], 1.1) | ^^^ lfortran-0.63.0/tests/reference/cpp-case_03-5c7be5c.json0000664000175000017500000000072215174404631022744 0ustar alastairalastair{ "basename": "cpp-case_03-5c7be5c", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/case_03.f90", "infile_hash": "4fc1bb48b2136f22bb44b7c69aaa05a43b4ed2e4b8464c433340295d", "outfile": null, "outfile_hash": null, "stdout": "cpp-case_03-5c7be5c.stdout", "stdout_hash": "d27dc54101c6ffce41ad661c4c5023ce1e202d9440de3309d579a13b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-kind_float_of_int-4b9cf53.stderr0000664000175000017500000000032615174404631025456 0ustar alastairalastairsemantic error: Only Integer literals or expressions which reduce to constant Integer are accepted as kind parameters --> tests/errors/kind_float_of_int.f90:3:13 | 3 | integer(4.2) :: x | ^^^ lfortran-0.63.0/tests/reference/llvm-array_bound_1-6741f43.json0000664000175000017500000000076415174404631024233 0ustar alastairalastair{ "basename": "llvm-array_bound_1-6741f43", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/array_bound_1.f90", "infile_hash": "38d2c1d99ad714fdaa387541310a78f8d3c4d7e19e93ed67a2dcf677", "outfile": null, "outfile_hash": null, "stdout": "llvm-array_bound_1-6741f43.stdout", "stdout_hash": "68867feda0934cf6db70b84ef1c11f045219d92ff9d08aa3d1b270cf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics14-5a6d04e.stderr0000664000175000017500000000027715174404631024336 0ustar alastairalastairsemantic error: Unexpected args, Scale expects (real, int) as arguments --> tests/errors/intrinsics14.f90:2:14 | 2 | print *, scale([1, 2, 3], 2) | ^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-associate_02-ca5c9ec.stdout0000664000175000017500000003426015174404631024442 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { associate_02: (Program (SymbolTable 2 { p1: (Variable 2 p1 [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p2: (Variable 2 p2 [] Local () () Default (Pointer (Real 8) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p3: (Variable 2 p3 [] Local () () Default (Pointer (Complex 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t1: (Variable 2 t1 [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), t2: (Variable 2 t2 [] Local (RealConstant 2.000000 (Real 8) ) (RealConstant 2.000000 (Real 8) ) Save (Real 8) () Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), t3: (Variable 2 t3 [] Local (ComplexConstructor (RealConstant 2.000000 (Real 4) ) (RealConstant 3.000000 (Real 4) ) (Complex 4) (ComplexConstant 2.000000 3.000000 (Complex 4) ) ) (ComplexConstant 2.000000 3.000000 (Complex 4) ) Save (Complex 4) () Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ) }) associate_02 [] [(Associate (Var 2 p1) (Var 2 t1) ) (Associate (Var 2 p2) (Var 2 t2) ) (Associate (Var 2 p3) (Var 2 t3) ) (Assignment (Var 2 p1) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 p2) (Cast (RealConstant 4.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 4.000000 (Real 8) ) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 p1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 t1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 t1) (Cast (RealBinOp (Var 2 p2) Add (Cast (Var 2 p1) IntegerToReal (Real 8) () () ) (Pointer (Real 8) ) () ) RealToInteger (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 2 p1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 t1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 t1) (IntegerConstant 8 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(Var 2 p1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 t1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 p3) (ComplexBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 2.000000 0.000000 (Complex 4) ) () ) Mul (Var 2 p3) (Pointer (Complex 4) ) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 p3)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 t3)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-interface_12-2e5ecb8.json0000664000175000017500000000076115174404631024164 0ustar alastairalastair{ "basename": "llvm-interface_12-2e5ecb8", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/interface_12.f90", "infile_hash": "800cf79ed2c17c44073c43bc8ae9453e21c3858b328a398f3246061f", "outfile": null, "outfile_hash": null, "stdout": "llvm-interface_12-2e5ecb8.stdout", "stdout_hash": "2e534532eeb5b3bed3140b2707f3687ad2ed6e493cf91d9c421e634c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-expr_05-a129dce.stdout0000664000175000017500000000246615174404631024047 0ustar alastairalastairprogram expr_05 ! Test parantheses in expressions implicit none integer :: x, a, b, c logical :: l a = 3 b = 4 c = 5 x = 2*3 x = (-2)*3 x = 2*(-3) x = (-2)*(-3) x = (-2)*(-3) x = -2**3 x = -2**3 x = -2*3 x = 2**(-3) x = a x = (a) x = a*b x = (-a)*b x = -a*b x = a*(-b) x = (-a)*(-b) x = a*b*c x = (-a)*b*c x = a*(-b)*c x = a*b*(-c) x = (-a)*(-b)*(-c) x = 3 + 4*5 x = (3 + 4)*5 x = a*(b + 5*(c - b)) x = (3 - 2*a*b)*5 x = ((-2)*a*b + 3)*5 x = ((-2)*a*b + 3*b*a)*5 x = ((-2)*a/b + (a + (-b))**2)*5 x = (2*a*b + 3)*5 x = a**2 + 2*a*b + b**2 x = (a + b)*(a - b) x = (a + b)**2 x = (a + b)*(a**2 - a*b + b**2) x = (a - b)*(a + b)*(a**2 + b**2) x = 1/(a*b) x = 1/a*b x = 1/a*b x = 1/(a*b + 1) x = 1/a*b + 1 x = 1/a*b + 1 x = 2 - (-2) x = a - ((-b) - c) x = a - (-2)*b x = c - (-2)/b x = a - (2 + 3 + 4) x = a + 2 + 3 + 4 x = 2*a + a*b - (a*b + 2*a) x = 2*a + a*b - (a*b - 2*a) x = a - (b - (c - 1)) x = a - b x = a - (b - c) x = a - b - c x = -(a - ((-b) + (-b) - (-b)*b)) x = -(3 + 5) x = -(a + 5) l = x**3*4 + a <= 4 .or. x < 5 .and. x < 6 .eqv. .true. .or. .not. .false. .and. .true. l = l .or. l .and. l l = (l .or. l) .and. l l = l .and. l .or. l l = l .and. (l .or. l) l = l .or. .not. l .and. l l = l .or. l .and. .not. l l = l .and. l .or. .not. l l = l .and. .not. l .or. l l = l .and. .not.(l .or. l) end program expr_05 lfortran-0.63.0/tests/reference/asr-matrix_matmul_04-90da47c.json0000664000175000017500000000075415174404631024643 0ustar alastairalastair{ "basename": "asr-matrix_matmul_04-90da47c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/matrix_matmul_04.f90", "infile_hash": "38edd0d6e98b512c930dbab4f7f9ea5105e907a6a21c64315a0bbd50", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-matrix_matmul_04-90da47c.stderr", "stderr_hash": "28ff92dfbfe961c9d2241688ba8b7152296287813291c6805dbf75e7", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-modules_27-4f64cb2.stdout0000664000175000017500000012357615174404631024015 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_27: (Program (SymbolTable 12 { }) modules_27 [] [(Print (StringConstant "running modules_27 program" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ), tomlf_build: (Module (SymbolTable 2 { get_elem_array@get_value: (ExternalSymbol 2 get_elem_array@get_value 4 get_elem_array tomlf_build_array [] get_elem_array Public ), get_elem_keyval@get_value: (ExternalSymbol 2 get_elem_keyval@get_value 4 get_elem_keyval tomlf_build_array [] get_elem_keyval Public ), get_elem_table@get_value: (ExternalSymbol 2 get_elem_table@get_value 4 get_elem_table tomlf_build_array [] get_elem_table Public ), get_value: (GenericProcedure 2 get_value [2 get_elem_table@get_value 2 get_elem_array@get_value 2 get_elem_keyval@get_value 2 get_value_float_sp@get_value 2 get_value_float_dp@get_value] Public ), get_value_float_dp@get_value: (ExternalSymbol 2 get_value_float_dp@get_value 9 get_value_float_dp tomlf_build_keyval [] get_value_float_dp Public ), get_value_float_sp@get_value: (ExternalSymbol 2 get_value_float_sp@get_value 9 get_value_float_sp tomlf_build_keyval [] get_value_float_sp Public ) }) tomlf_build () [tomlf_build_array tomlf_build_keyval] .false. .false. .false. ), tomlf_build_array: (Module (SymbolTable 4 { get_elem_array: (Function (SymbolTable 5 { array: (Variable 5 array [] InOut () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pos: (Variable 5 pos [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ptr: (Variable 5 ptr [] Out () () Default (Pointer (Real 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), stat: (Variable 5 stat [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_elem_array (FunctionType [(Complex 4) (Integer 4) (Pointer (Real 4) ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 array) (Var 5 pos) (Var 5 ptr) (Var 5 stat)] [] () Public .true. .true. () ), get_elem_keyval: (Function (SymbolTable 6 { array: (Variable 6 array [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pos: (Variable 6 pos [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ptr: (Variable 6 ptr [] Out () () Default (Pointer (Complex 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), stat: (Variable 6 stat [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_elem_keyval (FunctionType [(Integer 4) (Integer 4) (Pointer (Complex 4) ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 array) (Var 6 pos) (Var 6 ptr) (Var 6 stat)] [] () Public .true. .true. () ), get_elem_table: (Function (SymbolTable 7 { array: (Variable 7 array [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pos: (Variable 7 pos [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ptr: (Variable 7 ptr [] Out () () Default (Pointer (Real 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), stat: (Variable 7 stat [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_elem_table (FunctionType [(Integer 4) (Integer 4) (Pointer (Real 4) ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 array) (Var 7 pos) (Var 7 ptr) (Var 7 stat)] [(Assignment (Var 4 global_var) (RealConstant 1.000000 (Real 4) ) () .false. .false. )] () Public .true. .true. () ), get_value: (GenericProcedure 4 get_value [4 get_elem_table 4 get_elem_array 4 get_elem_keyval 4 get_value_float_sp 4 get_value_float_dp] Public ), get_value_float_dp: (ExternalSymbol 4 get_value_float_dp 9 get_value_float_dp tomlf_build_keyval [] get_value_float_dp Public ), get_value_float_dp@get_value: (ExternalSymbol 4 get_value_float_dp@get_value 9 get_value_float_dp tomlf_build_keyval [] get_value_float_dp Public ), get_value_float_sp: (ExternalSymbol 4 get_value_float_sp 9 get_value_float_sp tomlf_build_keyval [] get_value_float_sp Public ), get_value_float_sp@get_value: (ExternalSymbol 4 get_value_float_sp@get_value 9 get_value_float_sp tomlf_build_keyval [] get_value_float_sp Public ), global_var: (ExternalSymbol 4 global_var 9 global_var tomlf_build_keyval [] global_var Public ) }) tomlf_build_array () [tomlf_build_keyval] .true. .false. .false. ), tomlf_build_keyval: (Module (SymbolTable 9 { get_value: (GenericProcedure 9 get_value [9 get_value_float_sp 9 get_value_float_dp] Public ), get_value_float_dp: (Function (SymbolTable 10 { self: (Variable 10 self [] In () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), stat: (Variable 10 stat [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), val: (Variable 10 val [] Out () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_value_float_dp (FunctionType [(Complex 4) (Real 8) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 self) (Var 10 val) (Var 10 stat)] [] () Public .true. .true. () ), get_value_float_sp: (Function (SymbolTable 11 { self: (Variable 11 self [] In () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), stat: (Variable 11 stat [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), val: (Variable 11 val [] Out () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_value_float_sp (FunctionType [(Complex 4) (Real 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 self) (Var 11 val) (Var 11 stat)] [] () Public .true. .true. () ), global_var: (Variable 9 global_var [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) tomlf_build_keyval () [] .true. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-do1-0a89222.json0000664000175000017500000000101015174404631021760 0ustar alastairalastair{ "basename": "ast-do1-0a89222", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do1.f90", "infile_hash": "d9f8fb8e2d3070078083b102420c5c27b9506873e1619343c90b8203", "outfile": null, "outfile_hash": null, "stdout": "ast-do1-0a89222.stdout", "stdout_hash": "9a6853d51ccec7ce1da61514e34be31c0e8fc545a1e106e4ec8883e5", "stderr": "ast-do1-0a89222.stderr", "stderr_hash": "821ed2d044760c06f9001637b4d80b3e0e930dccb08480b8b3f588b5", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-func_parameter_type-a49e846.stderr0000664000175000017500000000027115174404631025766 0ustar alastairalastairsemantic error: Type mismatch in argument `x`: expected `integer(4)` but got `real(4)`. --> tests/errors/func_parameter_type.f90:2:14 | 2 | print *, f(42.9) | ^^^^ lfortran-0.63.0/tests/reference/asr_openmp-openmp_38-2731560.stdout0000664000175000017500000055536315174404631025003 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), omp_lib: (Module (SymbolTable 4 { c_bool: (ExternalSymbol 4 c_bool 39 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 4 c_funptr 39 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 4 c_int 39 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 4 c_long 39 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 4 c_ptr 39 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (Function (SymbolTable 5 { }) gomp_atomic_end (FunctionType [] () BindC Interface "GOMP_atomic_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_atomic_start: (Function (SymbolTable 6 { }) gomp_atomic_start (FunctionType [] () BindC Interface "GOMP_atomic_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_barrier: (Function (SymbolTable 7 { }) gomp_barrier (FunctionType [] () BindC Interface "GOMP_barrier" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_end: (Function (SymbolTable 8 { }) gomp_critical_end (FunctionType [] () BindC Interface "GOMP_critical_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_start: (Function (SymbolTable 9 { }) gomp_critical_start (FunctionType [] () BindC Interface "GOMP_critical_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_auto_next: (Function (SymbolTable 10 { gomp_loop_auto_next: (Variable 10 gomp_loop_auto_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 10 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 10 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_auto_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_auto_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 istart) (Var 10 iend)] [] (Var 10 gomp_loop_auto_next) Public .false. .false. () ), gomp_loop_auto_start: (Function (SymbolTable 11 { end: (Variable 11 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_auto_start: (Variable 11 gomp_loop_auto_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 11 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 11 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 11 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 11 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_auto_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_auto_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 start) (Var 11 end) (Var 11 incr) (Var 11 istart) (Var 11 iend)] [] (Var 11 gomp_loop_auto_start) Public .false. .false. () ), gomp_loop_dynamic_next: (Function (SymbolTable 12 { gomp_loop_dynamic_next: (Variable 12 gomp_loop_dynamic_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 12 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 12 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_dynamic_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_dynamic_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 istart) (Var 12 iend)] [] (Var 12 gomp_loop_dynamic_next) Public .false. .false. () ), gomp_loop_dynamic_start: (Function (SymbolTable 13 { chunk: (Variable 13 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), end: (Variable 13 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_dynamic_start: (Variable 13 gomp_loop_dynamic_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 13 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 13 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 13 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 13 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_dynamic_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_dynamic_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 start) (Var 13 end) (Var 13 incr) (Var 13 chunk) (Var 13 istart) (Var 13 iend)] [] (Var 13 gomp_loop_dynamic_start) Public .false. .false. () ), gomp_loop_end: (Function (SymbolTable 14 { }) gomp_loop_end (FunctionType [] () BindC Interface "GOMP_loop_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_end_nowait: (Function (SymbolTable 15 { }) gomp_loop_end_nowait (FunctionType [] () BindC Interface "GOMP_loop_end_nowait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_guided_next: (Function (SymbolTable 16 { gomp_loop_guided_next: (Variable 16 gomp_loop_guided_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 16 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 16 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_guided_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_guided_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 16 istart) (Var 16 iend)] [] (Var 16 gomp_loop_guided_next) Public .false. .false. () ), gomp_loop_guided_start: (Function (SymbolTable 17 { chunk: (Variable 17 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), end: (Variable 17 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_guided_start: (Variable 17 gomp_loop_guided_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 17 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 17 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 17 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 17 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_guided_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_guided_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 start) (Var 17 end) (Var 17 incr) (Var 17 chunk) (Var 17 istart) (Var 17 iend)] [] (Var 17 gomp_loop_guided_start) Public .false. .false. () ), gomp_loop_runtime_next: (Function (SymbolTable 18 { gomp_loop_runtime_next: (Variable 18 gomp_loop_runtime_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 18 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 18 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_runtime_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_runtime_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 18 istart) (Var 18 iend)] [] (Var 18 gomp_loop_runtime_next) Public .false. .false. () ), gomp_loop_runtime_start: (Function (SymbolTable 19 { end: (Variable 19 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_runtime_start: (Variable 19 gomp_loop_runtime_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 19 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 19 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 19 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 19 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_runtime_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_runtime_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 19 start) (Var 19 end) (Var 19 incr) (Var 19 istart) (Var 19 iend)] [] (Var 19 gomp_loop_runtime_start) Public .false. .false. () ), gomp_loop_static_next: (Function (SymbolTable 20 { gomp_loop_static_next: (Variable 20 gomp_loop_static_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 20 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 20 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_static_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_static_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 istart) (Var 20 iend)] [] (Var 20 gomp_loop_static_next) Public .false. .false. () ), gomp_loop_static_start: (Function (SymbolTable 21 { chunk: (Variable 21 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), end: (Variable 21 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_static_start: (Variable 21 gomp_loop_static_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 21 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 21 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 21 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 21 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_static_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_static_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 21 start) (Var 21 end) (Var 21 incr) (Var 21 chunk) (Var 21 istart) (Var 21 iend)] [] (Var 21 gomp_loop_static_start) Public .false. .false. () ), gomp_parallel: (Function (SymbolTable 22 { data: (Variable 22 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), flags: (Variable 22 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), fn: (Variable 22 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), num_threads: (Variable 22 num_threads [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_parallel (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_parallel" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 22 fn) (Var 22 data) (Var 22 num_threads) (Var 22 flags)] [] () Public .false. .false. () ), gomp_sections_end: (Function (SymbolTable 23 { }) gomp_sections_end (FunctionType [] () BindC Interface "GOMP_sections_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_sections_next: (Function (SymbolTable 24 { gomp_sections_next: (Variable 24 gomp_sections_next [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_sections_next (FunctionType [] (Integer 4) BindC Interface "GOMP_sections_next" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 24 gomp_sections_next) Public .false. .false. () ), gomp_sections_start: (Function (SymbolTable 25 { count: (Variable 25 count [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_sections_start: (Variable 25 gomp_sections_start [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_sections_start (FunctionType [(Integer 4)] (Integer 4) BindC Interface "GOMP_sections_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 25 count)] [] (Var 25 gomp_sections_start) Public .false. .false. () ), gomp_task: (Function (SymbolTable 26 { arg_align: (Variable 26 arg_align [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), arg_size: (Variable 26 arg_size [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), cpyfn: (Variable 26 cpyfn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), data: (Variable 26 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), depend: (Variable 26 depend [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), flags: (Variable 26 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), fn: (Variable 26 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), if_clause: (Variable 26 if_clause [] Unspecified () () Default (Logical 1) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_task (FunctionType [(CPtr) (CPtr) (CPtr) (Integer 8) (Integer 8) (Logical 1) (Integer 4) (CPtr)] () BindC Interface "GOMP_task" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 26 fn) (Var 26 data) (Var 26 cpyfn) (Var 26 arg_size) (Var 26 arg_align) (Var 26 if_clause) (Var 26 flags) (Var 26 depend)] [] () Public .false. .false. () ), gomp_taskwait: (Function (SymbolTable 27 { }) gomp_taskwait (FunctionType [] () BindC Interface "GOMP_taskwait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_teams: (Function (SymbolTable 28 { data: (Variable 28 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), fn: (Variable 28 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), num_teams: (Variable 28 num_teams [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), thread_limit: (Variable 28 thread_limit [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_teams (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_teams_reg" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 28 fn) (Var 28 data) (Var 28 num_teams) (Var 28 thread_limit)] [] () Public .false. .false. () ), omp_get_max_threads: (Function (SymbolTable 29 { omp_get_max_threads: (Variable 29 omp_get_max_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_max_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_max_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 29 omp_get_max_threads) Public .false. .false. () ), omp_get_num_procs: (Function (SymbolTable 30 { omp_get_num_procs: (Variable 30 omp_get_num_procs [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_num_procs (FunctionType [] (Integer 4) BindC Interface "omp_get_num_procs" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 30 omp_get_num_procs) Public .false. .false. () ), omp_get_num_teams: (Function (SymbolTable 31 { omp_get_num_teams: (Variable 31 omp_get_num_teams [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_num_teams (FunctionType [] (Integer 4) BindC Interface "omp_get_num_teams" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 31 omp_get_num_teams) Public .false. .false. () ), omp_get_num_threads: (Function (SymbolTable 32 { omp_get_num_threads: (Variable 32 omp_get_num_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_num_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 32 omp_get_num_threads) Public .false. .false. () ), omp_get_team_num: (Function (SymbolTable 33 { omp_get_team_num: (Variable 33 omp_get_team_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_team_num (FunctionType [] (Integer 4) BindC Interface "omp_get_team_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 33 omp_get_team_num) Public .false. .false. () ), omp_get_team_size: (Function (SymbolTable 34 { level: (Variable 34 level [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), omp_get_team_size: (Variable 34 omp_get_team_size [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_team_size (FunctionType [(Integer 4)] (Integer 4) BindC Interface "omp_get_team_size" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 34 level)] [] (Var 34 omp_get_team_size) Public .false. .false. () ), omp_get_thread_num: (Function (SymbolTable 35 { omp_get_thread_num: (Variable 35 omp_get_thread_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_thread_num (FunctionType [] (Integer 4) BindC Interface "omp_get_thread_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 35 omp_get_thread_num) Public .false. .false. () ), omp_get_wtime: (Function (SymbolTable 36 { omp_get_wtime: (Variable 36 omp_get_wtime [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_wtime (FunctionType [] (Real 8) BindC Interface "omp_get_wtime" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 36 omp_get_wtime) Public .false. .false. () ), omp_set_num_threads: (Function (SymbolTable 37 { n: (Variable 37 n [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_set_num_threads (FunctionType [(Integer 4)] () BindC Interface "omp_set_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 37 n)] [] () Public .false. .false. () ) }) omp_lib () [iso_c_binding] .true. .false. .false. ), openmp_38: (Program (SymbolTable 2 { c_bool: (ExternalSymbol 2 c_bool 39 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 2 c_funptr 39 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 2 c_int 39 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 2 c_long 39 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 2 c_ptr 39 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (ExternalSymbol 2 gomp_atomic_end 4 gomp_atomic_end omp_lib [] gomp_atomic_end Public ), gomp_atomic_start: (ExternalSymbol 2 gomp_atomic_start 4 gomp_atomic_start omp_lib [] gomp_atomic_start Public ), gomp_barrier: (ExternalSymbol 2 gomp_barrier 4 gomp_barrier omp_lib [] gomp_barrier Public ), gomp_critical_end: (ExternalSymbol 2 gomp_critical_end 4 gomp_critical_end omp_lib [] gomp_critical_end Public ), gomp_critical_start: (ExternalSymbol 2 gomp_critical_start 4 gomp_critical_start omp_lib [] gomp_critical_start Public ), gomp_loop_auto_next: (ExternalSymbol 2 gomp_loop_auto_next 4 gomp_loop_auto_next omp_lib [] gomp_loop_auto_next Public ), gomp_loop_auto_start: (ExternalSymbol 2 gomp_loop_auto_start 4 gomp_loop_auto_start omp_lib [] gomp_loop_auto_start Public ), gomp_loop_dynamic_next: (ExternalSymbol 2 gomp_loop_dynamic_next 4 gomp_loop_dynamic_next omp_lib [] gomp_loop_dynamic_next Public ), gomp_loop_dynamic_start: (ExternalSymbol 2 gomp_loop_dynamic_start 4 gomp_loop_dynamic_start omp_lib [] gomp_loop_dynamic_start Public ), gomp_loop_end: (ExternalSymbol 2 gomp_loop_end 4 gomp_loop_end omp_lib [] gomp_loop_end Public ), gomp_loop_end_nowait: (ExternalSymbol 2 gomp_loop_end_nowait 4 gomp_loop_end_nowait omp_lib [] gomp_loop_end_nowait Public ), gomp_loop_guided_next: (ExternalSymbol 2 gomp_loop_guided_next 4 gomp_loop_guided_next omp_lib [] gomp_loop_guided_next Public ), gomp_loop_guided_start: (ExternalSymbol 2 gomp_loop_guided_start 4 gomp_loop_guided_start omp_lib [] gomp_loop_guided_start Public ), gomp_loop_runtime_next: (ExternalSymbol 2 gomp_loop_runtime_next 4 gomp_loop_runtime_next omp_lib [] gomp_loop_runtime_next Public ), gomp_loop_runtime_start: (ExternalSymbol 2 gomp_loop_runtime_start 4 gomp_loop_runtime_start omp_lib [] gomp_loop_runtime_start Public ), gomp_loop_static_next: (ExternalSymbol 2 gomp_loop_static_next 4 gomp_loop_static_next omp_lib [] gomp_loop_static_next Public ), gomp_loop_static_start: (ExternalSymbol 2 gomp_loop_static_start 4 gomp_loop_static_start omp_lib [] gomp_loop_static_start Public ), gomp_parallel: (ExternalSymbol 2 gomp_parallel 4 gomp_parallel omp_lib [] gomp_parallel Public ), gomp_sections_end: (ExternalSymbol 2 gomp_sections_end 4 gomp_sections_end omp_lib [] gomp_sections_end Public ), gomp_sections_next: (ExternalSymbol 2 gomp_sections_next 4 gomp_sections_next omp_lib [] gomp_sections_next Public ), gomp_sections_start: (ExternalSymbol 2 gomp_sections_start 4 gomp_sections_start omp_lib [] gomp_sections_start Public ), gomp_task: (ExternalSymbol 2 gomp_task 4 gomp_task omp_lib [] gomp_task Public ), gomp_taskwait: (ExternalSymbol 2 gomp_taskwait 4 gomp_taskwait omp_lib [] gomp_taskwait Public ), gomp_teams: (ExternalSymbol 2 gomp_teams 4 gomp_teams omp_lib [] gomp_teams Public ), ix: (Variable 2 ix [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iy: (Variable 2 iy [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iz: (Variable 2 iz [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), nx: (Variable 2 nx [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ny: (Variable 2 ny [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), nz: (Variable 2 nz [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), omp_get_max_threads: (ExternalSymbol 2 omp_get_max_threads 4 omp_get_max_threads omp_lib [] omp_get_max_threads Public ), omp_get_num_procs: (ExternalSymbol 2 omp_get_num_procs 4 omp_get_num_procs omp_lib [] omp_get_num_procs Public ), omp_get_num_teams: (ExternalSymbol 2 omp_get_num_teams 4 omp_get_num_teams omp_lib [] omp_get_num_teams Public ), omp_get_num_threads: (ExternalSymbol 2 omp_get_num_threads 4 omp_get_num_threads omp_lib [] omp_get_num_threads Public ), omp_get_team_num: (ExternalSymbol 2 omp_get_team_num 4 omp_get_team_num omp_lib [] omp_get_team_num Public ), omp_get_team_size: (ExternalSymbol 2 omp_get_team_size 4 omp_get_team_size omp_lib [] omp_get_team_size Public ), omp_get_thread_num: (ExternalSymbol 2 omp_get_thread_num 4 omp_get_thread_num omp_lib [] omp_get_thread_num Public ), omp_get_wtime: (ExternalSymbol 2 omp_get_wtime 4 omp_get_wtime omp_lib [] omp_get_wtime Public ), omp_set_num_threads: (ExternalSymbol 2 omp_set_num_threads 4 omp_set_num_threads omp_lib [] omp_set_num_threads Public ) }) openmp_38 [omp_lib] [(Assignment (Var 2 ny) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 nx) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 nz) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (OMPRegion ParallelDo [(OMPCollapse (IntegerConstant 3 (Integer 4) Decimal) ) (OMPPrivate [(Var 2 iy) (Var 2 ix) (Var 2 iz)] )] [(DoLoop () ((Var 2 iy) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 ny) ()) [(DoLoop () ((Var 2 ix) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nx) ()) [(DoLoop () ((Var 2 iz) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nz) ()) [(Print (StringFormat () [(StringConstant "iy->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 iy) (StringConstant "ix->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 ix) (StringConstant "iz->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 iz)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] [] )] [] )] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-rewind_inquire_flush-72b7f97.stdout0000664000175000017500000002601015174404631026200 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { rewind_inquire_flush: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ext: (Variable 2 ext [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), fm: (Variable 2 fm [] Local () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ios: (Variable 2 ios [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), len: (Variable 2 len [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) rewind_inquire_flush [] [(FileRewind 0 (IntegerConstant 9 (Integer 4) Decimal) (Var 2 ios) (IntegerConstant 10 (Integer 4) Decimal) () ) (FileInquire 0 () (StringConstant "file_b" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () (Var 2 ext) () () () () () () () () () () () () () () () () () () () () () () () () () () () [] () () () () () () () () ) (FileInquire 0 (IntegerConstant 4 (Integer 4) Decimal) () (Var 2 ios) (IntegerConstant 20 (Integer 4) Decimal) () () () () () () () () (Var 2 fm) () () () () () () () () () () () () () () () () () () () [] () () () () () () () () ) (FileInquire 0 () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () (Var 2 len) [(Var 2 a) (Var 2 b)] () () () () () () () () ) (GoToTarget 10 10 ) (Print (StringConstant "err rewind" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (GoToTarget 20 20 ) (Print (StringConstant "err inquire" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-modules_02-ed49715.json0000664000175000017500000000075015174404631023353 0ustar alastairalastair{ "basename": "ast-modules_02-ed49715", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_02.f90", "infile_hash": "a52fdcb19f500c43afdd1fde1f90d5df8d34f2283a39704ab599a87c", "outfile": null, "outfile_hash": null, "stdout": "ast-modules_02-ed49715.stdout", "stdout_hash": "92242308d096d2217f9fccf7a789dea9f4e60d97bc080dbc142f6b8e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_constructor_with_different_char_lengths-5ba8b29.json0000664000175000017500000000110315174404631033030 0ustar alastairalastair{ "basename": "asr-array_constructor_with_different_char_lengths-5ba8b29", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_constructor_with_different_char_lengths.f90", "infile_hash": "61dc3cb74e4af0fdc0ee167225903f7143b7f920c38c4f7c5c4bfc3a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_constructor_with_different_char_lengths-5ba8b29.stderr", "stderr_hash": "646eae0030ddaf3e0ef573ad8a04e67a143812eae6c2ff7e3a9e363c", "returncode": 2 }lfortran-0.63.0/tests/reference/cpp-types_06-a5c2d06.json0000664000175000017500000000072515174404631023112 0ustar alastairalastair{ "basename": "cpp-types_06-a5c2d06", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/types_06.f90", "infile_hash": "821a3f29390ed022c7e72bdf2e4f9bace059d335abe1d1b729ac6d22", "outfile": null, "outfile_hash": null, "stdout": "cpp-types_06-a5c2d06.stdout", "stdout_hash": "df6601b7c7cd957da0568ab0bff6f60e37caec621cb495454b8cc71d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-submodule_01-198736c.stderr0000664000175000017500000000035115174404631024150 0ustar alastairalastairsemantic error: Procedure 'func' must be declared within a generic module interface --> tests/errors/submodule_01.f90:14:3 - 16:1 | 14 | module procedure func | ^^^^^^^^^^^^^^^^^^^^^... ... | 16 | | ...^ lfortran-0.63.0/tests/reference/llvm-subroutines_01-e2ed4a5.json0000664000175000017500000000076715174404631024606 0ustar alastairalastair{ "basename": "llvm-subroutines_01-e2ed4a5", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_01.f90", "infile_hash": "b2e2d562bcd951782b14a4d5cfe68f5ff7db528636d556aa7ea9230e", "outfile": null, "outfile_hash": null, "stdout": "llvm-subroutines_01-e2ed4a5.stdout", "stdout_hash": "fa09ec2a09177717110be16b2dcc56cc10348e274ba3f79e8c7750a3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-subroutine2-2e9b84b.stderr0000664000175000017500000000020515174404631024263 0ustar alastairalastairsemantic error: Subroutine `bpe` called as a function --> tests/errors/subroutine2.f90:3:9 | 3 | i = bpe() | ^^^^^ lfortran-0.63.0/tests/reference/asr-derived_types_04-b960162.json0000664000175000017500000000077215174404631024464 0ustar alastairalastair{ "basename": "asr-derived_types_04-b960162", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_04.f90", "infile_hash": "13c015af7c2b6f870262990e64fc99bf67a725899bea8a9164aef657", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_04-b960162.stdout", "stdout_hash": "51c8f4da9fcdf3be3f512f90acc76c15d1ff1096988441ae02624061", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format_11-72f8b07.stderr0000664000175000017500000000000515174404631023530 0ustar alastairalastairSTOP lfortran-0.63.0/tests/reference/asr-modules_25-b0e87c0.stdout0000664000175000017500000010276115174404631024002 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { module_25: (Program (SymbolTable 2 { toml_character_tokenizer: (ExternalSymbol 2 toml_character_tokenizer 4 toml_character_tokenizer tomlf_de_character [] toml_character_tokenizer Public ) }) module_25 [tomlf_de_character] [(Print (StringConstant "running module_25 program" (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ), tomlf_de_character: (Module (SymbolTable 4 { next_token: (Function (SymbolTable 6 { de: (Variable 6 de [] InOut () () Default (StructType [(Pointer (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 4 toml_character_tokenizer Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dot_is_token: (Variable 6 dot_is_token [] In () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) next_token (FunctionType [(StructType [(Pointer (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) (Logical 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 de) (Var 6 dot_is_token)] [] () Private .true. .true. () ), toml_character_tokenizer: (Struct (SymbolTable 5 { conf: (Variable 5 conf [] Local () () Default (Pointer (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), next_token: (StructMethodDeclaration 5 next_token () next_token 4 next_token Source .false. .false. ) }) toml_character_tokenizer (StructType [(Pointer (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [conf] [] Source Private .false. .false. [] () 4 toml_tokenizer [] ), toml_table: (ExternalSymbol 4 toml_table 8 toml_table tomlf_de_tokenizer_25 [] toml_table Private ), toml_tokenizer: (ExternalSymbol 4 toml_tokenizer 8 toml_tokenizer tomlf_de_tokenizer_25 [] toml_tokenizer Private ), toml_tokenizer_: (ExternalSymbol 4 toml_tokenizer_ 8 toml_tokenizer_ tomlf_de_tokenizer_25 [] toml_tokenizer_ Private ) }) tomlf_de_character () [tomlf_de_tokenizer_25] .true. .false. .false. ), tomlf_de_tokenizer_25: (Module (SymbolTable 8 { next_token: (Function (SymbolTable 12 { de: (Variable 12 de [] InOut () () Default (StructType [(Pointer (StructType [(Logical 4)] [] .true. .false. ) )] [] .false. .false. ) 8 toml_tokenizer Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dot_is_token: (Variable 12 dot_is_token [] In () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) next_token (FunctionType [(StructType [(Pointer (StructType [(Logical 4)] [] .true. .false. ) )] [] .false. .false. ) (Logical 4)] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 de) (Var 12 dot_is_token)] [] () Private .false. .false. () ), parse_select: (Function (SymbolTable 13 { 1_toml_tokenizer_current: (ExternalSymbol 13 1_toml_tokenizer_current 10 current toml_tokenizer [] current Public ), de: (Variable 13 de [] InOut () () Default (StructType [(Pointer (StructType [(Logical 4)] [] .true. .false. ) )] [] .false. .false. ) 8 toml_tokenizer Source Private Required .false. .true. .false. () .false. .false. NotMethod () 0 ), table: (Variable 13 table [] Local () () Default (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) 8 toml_table Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) parse_select (FunctionType [(StructType [(Pointer (StructType [(Logical 4)] [] .true. .false. ) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 de)] [(Nullify [(Var 13 table)] ) (Associate (StructInstanceMember (Var 13 de) 13 1_toml_tokenizer_current (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) () ) (Var 13 table) )] () Private .true. .true. () ), toml_table: (Struct (SymbolTable 9 { inline: (Variable 9 inline [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_table (StructType [(Logical 4)] [] .true. .false. ) [] [inline] [] Source Private .false. .false. [] () () [] ), toml_tokenizer: (Struct (SymbolTable 10 { current: (Variable 10 current [] Local (PointerNullConstant (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) (Var 10 current) ) (PointerNullConstant (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) (Var 10 current) ) Default (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) 8 toml_table Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), next_token: (StructMethodDeclaration 10 next_token () next_token 8 next_token Source .true. .false. ) }) toml_tokenizer (StructType [(Pointer (StructType [(Logical 4)] [] .true. .false. ) )] [] .true. .false. ) [toml_table] [current] [] Source Private .false. .true. [] () () [] ), toml_tokenizer_: (Struct (SymbolTable 11 { }) toml_tokenizer_ (StructType [] [] .true. .false. ) [] [] [] Source Private .false. .true. [] () 8 toml_tokenizer [] ) }) tomlf_de_tokenizer_25 () [] .true. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-string_13-ae4df53.json0000664000175000017500000000074515174404631023346 0ustar alastairalastair{ "basename": "asr-string_13-ae4df53", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_13.f90", "infile_hash": "25354bac77715f94447d94e23c5c51c4ece9145b600155f8a5cb4c9f", "outfile": null, "outfile_hash": null, "stdout": "asr-string_13-ae4df53.stdout", "stdout_hash": "c09e20e6fcec2d466132b429353d9b4f0454b09a6afa49d070984846", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-test_backspace_01-cd469a1.json0000664000175000017500000000077515174404631024733 0ustar alastairalastair{ "basename": "asr-test_backspace_01-cd469a1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/test_backspace_01.f90", "infile_hash": "951cbd3df9edfd9ca3e2005dc3cc09a6f6597e6e3ad00db4e2b1edb4", "outfile": null, "outfile_hash": null, "stdout": "asr-test_backspace_01-cd469a1.stdout", "stdout_hash": "d0b7bb249edfd3e0863b2607c74787d27cd39c7598e6db742b9a6538", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-preprocessor17-f2d76bb.json0000664000175000017500000000073715174404631024435 0ustar alastairalastair{ "basename": "asr-preprocessor17-f2d76bb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor17.F90", "infile_hash": "a07132d08deb1a0de21dd365371df337fe07652c9d42aa4c0a7e19ab", "outfile": null, "outfile_hash": null, "stdout": "asr-preprocessor17-f2d76bb.stdout", "stdout_hash": "31456897c33d1a10fd0c548b359debc7a7ac6bebfd2173287faa2205", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-allocated_04-b4ea2f8.stderr0000664000175000017500000000036215174404631024334 0ustar alastairalastairruntime error: Attempting to allocate already allocated variable 'x' --> tests/errors/allocated_04.f90:6:14 | 6 | allocate(x) ! Error: double allocation of scalar | ^ Cannot allocate 'x' because it is already allocated lfortran-0.63.0/tests/reference/ast-program_cmake_01-4e6752a.json0000664000175000017500000000077215174404631024510 0ustar alastairalastair{ "basename": "ast-program_cmake_01-4e6752a", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/program_cmake_01.f90", "infile_hash": "0e854d9b2ed613d6193d78290dc20a45ec66f60ab17e1c0229c3febe", "outfile": null, "outfile_hash": null, "stdout": "ast-program_cmake_01-4e6752a.stdout", "stdout_hash": "8260abebd05f66a55fddeb2aad67140d716d0f191966276b4a29b4bd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_36-1cb3d03.stdout0000664000175000017500000005023615174404631024507 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_36: (Program (SymbolTable 2 { all_spaces: (Variable 2 all_spaces [] Local (IntrinsicElementalFunction Adjustl [(StringConstant " " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant " " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant " " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), empty: (Variable 2 empty [] Local (IntrinsicElementalFunction Adjustl [(StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), simple: (Variable 2 simple [] Local (IntrinsicElementalFunction Adjustl [(StringConstant "gfortran" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "gfortran" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "gfortran" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), space_at_end: (Variable 2 space_at_end [] Local (IntrinsicElementalFunction Adjustl [(StringConstant "gfortran " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "gfortran " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "gfortran " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), space_at_start: (Variable 2 space_at_start [] Local (IntrinsicElementalFunction Adjustl [(StringConstant " gfortran" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "gfortran " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "gfortran " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), space_in_between: (Variable 2 space_in_between [] Local (IntrinsicElementalFunction Adjustl [(StringConstant " g for tran " (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "g for tran " (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "g for tran " (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), spaces_with_symbols: (Variable 2 spaces_with_symbols [] Local (IntrinsicElementalFunction Adjustl [(StringConstant " # gfor* t $ ran & " (String 1 (IntegerConstant 23 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 23 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "# gfor* t $ ran & " (String 1 (IntegerConstant 23 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "# gfor* t $ ran & " (String 1 (IntegerConstant 23 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_36 [] [(Print (Var 2 empty) ) (If () (StringCompare (Var 2 empty) NotEq (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (Var 2 all_spaces) ) (If () (StringCompare (Var 2 all_spaces) NotEq (StringConstant " " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (Var 2 simple) ) (If () (StringCompare (Var 2 simple) NotEq (StringConstant "gfortran" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (Var 2 space_at_start) ) (If () (StringCompare (Var 2 space_at_start) NotEq (StringConstant "gfortran " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (Var 2 space_at_end) ) (If () (StringCompare (Var 2 space_at_end) NotEq (StringConstant "gfortran " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (Var 2 space_in_between) ) (If () (StringCompare (Var 2 space_in_between) NotEq (StringConstant "g for tran " (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (Var 2 spaces_with_symbols) ) (If () (StringCompare (Var 2 spaces_with_symbols) NotEq (StringConstant "# gfor* t $ ran & " (String 1 (IntegerConstant 23 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-end_program_name-2d38a01.json0000664000175000017500000000075415174404631024661 0ustar alastairalastair{ "basename": "asr-end_program_name-2d38a01", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/end_program_name.f90", "infile_hash": "c8dd05d93a8414678b7776ec03c0db5605698346532b03217a190c19", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-end_program_name-2d38a01.stderr", "stderr_hash": "16baaceda38c9b9273efe534c7c70122646b4c1ac9e3b414eb0406e8", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-implicit_interface5-fbe2fe9.json0000664000175000017500000000100315174404631025527 0ustar alastairalastair{ "basename": "asr-implicit_interface5-fbe2fe9", "cmd": "lfortran --show-asr --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/implicit_interface5.f90", "infile_hash": "d64e1ffc56e56861a453e4bb44844ddf1f61a1f8da9eedc4fcd3098e", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_interface5-fbe2fe9.stdout", "stdout_hash": "61687e4f5292d0adf69572429bce74d2433e22e9f52f69244cf3006a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_04-b960162.stdout0000664000175000017500000002046515174404631025036 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { debug: (Program (SymbolTable 5 { }) debug [] [] ), derived_types_04_bitset: (Module (SymbolTable 2 { all_abstract: (Function (SymbolTable 4 { all: (Variable 4 all [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 4 self [] In () () Default (StructType [(Integer 8)] [] .false. .false. ) 2 bitset_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) all_abstract (FunctionType [(StructType [(Integer 8)] [] .false. .false. )] (Logical 4) Source Interface () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 4 self)] [] (Var 4 all) Public .false. .true. () ), bitset_type: (Struct (SymbolTable 3 { all: (StructMethodDeclaration 3 all self all_abstract 2 all_abstract Source .true. .false. ), num_bits: (Variable 3 num_bits [] Local () () Default (Integer 8) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) bitset_type (StructType [(Integer 8)] [] .true. .false. ) [] [num_bits] [] Source Private .false. .true. [] () () [] ) }) derived_types_04_bitset () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-fixedform_nestedloop_implicit-7cd720b.stdout0000664000175000017500000000174115174404631030133 0ustar alastairalastair(TranslationUnit [(Program implicit_program_lfortran () [] [] [] [(Print 20 () [1] () ) (DoLoop 0 () 0 k 1 10 () [(DoLoop 0 () 0 l 1 10 () [(Print 0 () [k l] () )] () () )] () () ) (If 0 () (> 0 1) [(GoTo 0 () 20 [] () )] [] () () () )] [] )] ) lfortran-0.63.0/tests/reference/asr-string_negative_start_index-643e9c0.json0000664000175000017500000000101515174404631027162 0ustar alastairalastair{ "basename": "asr-string_negative_start_index-643e9c0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/string_negative_start_index.f90", "infile_hash": "09f10d0a9225824440f331a87871a73e5536466c5984c305fbd1f982", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-string_negative_start_index-643e9c0.stderr", "stderr_hash": "32ee9a500a2be64222519c960c441f35d27a3057d5b1289fc1b22172", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-expr4-2704d50.stdout0000664000175000017500000000034615174404631022721 0ustar alastairalastair(TranslationUnit [(Real "5.") (+ (Real "5.") (Real "3.")) (* (+ (Real "5.") (Real "3.")) (Real "2.")) (+ (Real "5.") (* (Real "3.") (Real "2."))) (- (Real "5.") (Real "3.")) (** (Real "4.") (Real "3."))] ) lfortran-0.63.0/tests/reference/asr-fn5-3d75eb7.stdout0000664000175000017500000015207415174404631022526 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fn5: (Module (SymbolTable 2 { atleast: (Function (SymbolTable 3 { length: (Variable 3 length [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), line: (Variable 3 line [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pattern: (Variable 3 pattern [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), strout: (Variable 3 strout [length line] ReturnVar () () Default (String 1 (IntrinsicElementalFunction Max [(Var 3 length) (IntrinsicElementalFunction StringLenTrim [(Var 3 line)] 0 (Integer 4) () )] 0 (Integer 4) () ) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) atleast (FunctionType [(String 1 () AssumedLength DescriptorString) (Integer 4) (String 1 () AssumedLength DescriptorString)] (String 1 (IntrinsicElementalFunction Max [(FunctionParam 1 (Integer 4) () ) (IntrinsicElementalFunction StringLenTrim [(FunctionParam 0 (String 1 () AssumedLength DescriptorString) () )] 0 (Integer 4) () )] 0 (Integer 4) () ) ExpressionLength DescriptorString) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 line) (Var 3 length) (Var 3 pattern)] [(If () (IntrinsicElementalFunction Present [(Var 3 pattern)] 0 (Logical 4) () ) [(Assignment (Var 3 strout) (IntrinsicElementalFunction StringConcat [(Var 3 line) (IntrinsicElementalFunction Repeat [(Var 3 pattern) (IntegerBinOp (IntegerBinOp (StringLen (Var 3 strout) (Integer 4) () ) Div (StringLen (Var 3 pattern) (Integer 4) () ) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (String 1 () DeferredLength DescriptorString) () ) () .false. .false. )] [(Assignment (Var 3 strout) (Var 3 line) () .false. .false. )] )] (Var 3 strout) Public .true. .true. () ), print_dictionary: (Function (SymbolTable 4 { header: (Variable 4 header [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), keywords: (Variable 4 keywords [] Local () () Save (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lfortran_iomsg: (Variable 4 lfortran_iomsg [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lfortran_iomsg1: (Variable 4 lfortran_iomsg1 [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), present_in: (Variable 4 present_in [] Local () () Save (Allocatable (Array (Logical 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), shorts: (Variable 4 shorts [] Local () () Save (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), stop: (Variable 4 stop [] In () () Default (Logical 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), values: (Variable 4 values [] Local () () Save (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) print_dictionary (FunctionType [(String 1 () AssumedLength DescriptorString) (Logical 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [atleast] [(Var 4 header) (Var 4 stop)] [(FileWrite 0 (IntegerConstant 6 (Integer 4) Decimal) (Var 4 lfortran_iomsg) () () [(StringFormat (StringConstant "(a,1x,a,1x,a,1x,a)" (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(FunctionCall 2 atleast () [((StringConstant "KEYWORD" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((IntrinsicElementalFunction Max [(StringLen (ArrayItem (Var 4 keywords) [(() (ArrayBound (Var 4 keywords) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () DeferredLength DescriptorString) ColMajor () ) (Integer 4) () ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Integer 4) () )) (())] (String 1 (IntrinsicElementalFunction Max [(IntrinsicElementalFunction Max [(StringLen (ArrayItem (Var 4 keywords) [(() (ArrayBound (Var 4 keywords) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () DeferredLength DescriptorString) ColMajor () ) (Integer 4) () ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Integer 4) () ) (IntrinsicElementalFunction StringLenTrim [(StringConstant "KEYWORD" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (Integer 4) () )] 0 (Integer 4) () ) ExpressionLength DescriptorString) () () ) (StringConstant "SHORT" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "PRESENT" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "VALUE" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () () ) (FileWrite 0 (IntegerConstant 6 (Integer 4) Decimal) (Var 4 lfortran_iomsg1) () () [(StringFormat (StringConstant "(*(a,1x,a5,1x,l1,8x,\"[\",a,\"]\",/))" (String 1 (IntegerConstant 33 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(ImpliedDoLoop [(FunctionCall 2 atleast () [((ArrayItem (Var 4 keywords) [(() (Var 4 i) ())] (String 1 () DeferredLength DescriptorString) ColMajor () )) ((IntrinsicElementalFunction Max [(StringLen (ArrayItem (Var 4 keywords) [(() (ArrayBound (Var 4 keywords) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () DeferredLength DescriptorString) ColMajor () ) (Integer 4) () ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Integer 4) () )) (())] (String 1 (IntrinsicElementalFunction Max [(IntrinsicElementalFunction Max [(StringLen (ArrayItem (Var 4 keywords) [(() (ArrayBound (Var 4 keywords) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () DeferredLength DescriptorString) ColMajor () ) (Integer 4) () ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Integer 4) () ) (IntrinsicElementalFunction StringLenTrim [(ArrayItem (Var 4 keywords) [(() (Var 4 i) ())] (String 1 () DeferredLength DescriptorString) ColMajor () )] 0 (Integer 4) () )] 0 (Integer 4) () ) ExpressionLength DescriptorString) () () ) (ArrayItem (Var 4 shorts) [(() (Var 4 i) ())] (String 1 () DeferredLength DescriptorString) ColMajor () ) (ArrayItem (Var 4 present_in) [(() (Var 4 i) ())] (Logical 4) ColMajor () ) (StringSection (ArrayItem (Var 4 values) [(() (Var 4 i) ())] (String 1 () DeferredLength DescriptorString) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 4 values) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerBinOp (IntegerBinOp (StringLen (Var 4 values) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ExpressionLength DescriptorString) () )] (Var 4 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 4 keywords) () (Integer 4) () ) () (Tuple [(String 1 (IntrinsicElementalFunction Max [(IntrinsicElementalFunction Max [(StringLen (ArrayItem (Var 4 keywords) [(() (ArrayBound (Var 4 keywords) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () DeferredLength DescriptorString) ColMajor () ) (Integer 4) () ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Integer 4) () ) (IntrinsicElementalFunction StringLenTrim [(ArrayItem (Var 4 keywords) [(() (Var 4 i) ())] (String 1 () DeferredLength DescriptorString) ColMajor () )] 0 (Integer 4) () )] 0 (Integer 4) () ) ExpressionLength DescriptorString) (String 1 () DeferredLength DescriptorString) (Logical 4) (String 1 (IntegerBinOp (IntegerBinOp (StringLen (Var 4 values) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ExpressionLength DescriptorString)] ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () () )] () Public .true. .true. () ) }) fn5 () [fn5] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-goto_04-2487215.json0000664000175000017500000000073715174404631022512 0ustar alastairalastair{ "basename": "asr-goto_04-2487215", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/goto_04.f90", "infile_hash": "302db59379e85ba1677034f61bec227f237c56085cea27ad7a1554b5", "outfile": null, "outfile_hash": null, "stdout": "asr-goto_04-2487215.stdout", "stdout_hash": "bcc418a82c1a7b1a6d73774ce444e28717e7d45813df7ab3a1a4bdc1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-subroutines_03-9a95e25.stdout0000664000175000017500000001276115174404631024645 0ustar alastairalastair(TranslationUnit [(Program subroutines_03 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ()) (k [] [] () () None ()) (l [] [] () () None ())] () )] [(Assignment 0 i 1 () ) (Assignment 0 j 1 () ) (Assignment 0 k 1 () ) (Assignment 0 l 1 () ) (SubroutineCall 0 f [] [(() i () 0) (() j () 0) (() k () 0) (() l () 0)] [] [] () ) (Print 0 () [j] () ) (If 0 () (/= j 4) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SubroutineCall 0 f [] [(() i () 0) (() j () 0)] [(d l) (c k)] [] () ) (Print 0 () [j] () ) (If 0 () (/= j 4) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SubroutineCall 0 f [] [] [(a i) (b j) (d l) (c k)] [] () ) (Print 0 () [j] () ) (If 0 () (/= j 4) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SubroutineCall 0 f [] [] [(b j) (a i) (c k) (d l)] [] () ) (Print 0 () [j] () ) (If 0 () (/= j 4) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Subroutine f [(a) (b) (c) (d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(a [] [] () () None ()) (c [] [] () () None ()) (d [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent Out )] [(b [] [] () () None ())] () )] [(Assignment 0 b (+ (+ (+ a 1) c) d) () )] [] [] )] )] ) lfortran-0.63.0/tests/reference/llvm-volatile_03-914e4e5.stdout0000664000175000017500000000410715174404631024255 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @y_data = private global [1 x i8] c"2" @y = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @y_data, i32 0, i32 0), i64 1 }> define i32 @main(i32 %0, i8** %1) { .entry: %2 = call i8* @_lfortran_get_default_allocator() %x = alloca %string_descriptor, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store %string_descriptor zeroinitializer, %string_descriptor* %x, align 1 %3 = getelementptr %string_descriptor, %string_descriptor* %x, i32 0, i32 1 store i64 1, i64* %3, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %x, i32 0, i32 0 %5 = call i8* @_lfortran_get_default_allocator() %6 = call i8* @_lfortran_malloc_alloc(i8* %5, i64 1) store i8* %6, i8** %4, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %x, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 call void @_lfortran_strcpy_alloc(i8* %2, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @y, i32 0, i32 0), i64* getelementptr inbounds (%string_descriptor, %string_descriptor* @y, i32 0, i32 1), i8 0, i8 0, i8* %8, i64 1) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_volatile_03 FINALIZE_SYMTABLE_volatile_03: ; preds = %return br label %Finalize_Variable_x Finalize_Variable_x: ; preds = %FINALIZE_SYMTABLE_volatile_03 %9 = getelementptr %string_descriptor, %string_descriptor* %x, i32 0, i32 0 %10 = load i8*, i8** %9, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %10) call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc_alloc(i8*, i64) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_strcpy_alloc(i8*, i8**, i64*, i8, i8, i8*, i64) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-associate_05-4641244.stdout0000664000175000017500000012027515174404631024063 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { associate_05: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), associate_block: (AssociateBlock (SymbolTable 3 { v: (Variable 3 v [] Local () () Default (Pointer (Array (Real 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 3 z [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) associate_block [(Assignment (Var 3 z) (RealBinOp (RealUnaryMinus (RealBinOp (RealBinOp (Var 2 x) Mul (ArrayBroadcast (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [2.00000000e+00, 2.00000000e+00, 2.00000000e+00, ...., 2.00000000e+00, 2.00000000e+00, 2.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) Add (RealBinOp (Var 2 y) Mul (ArrayBroadcast (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [2.00000000e+00, 2.00000000e+00, 2.00000000e+00, ...., 2.00000000e+00, 2.00000000e+00, 2.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) Mul (Var 2 theta) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (Associate (Var 3 v) (Var 2 myreal) ) (Assignment (Var 3 v) (RealBinOp (Var 2 a) Add (Var 3 z) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (Assignment (ArrayItem (Var 3 v) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealBinOp (ArrayItem (Var 3 v) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Mul (RealConstant 4.600000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (ArraySection (Var 3 v) [((IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] (Array (Real 4) [(() ())] DescriptorArray ) () ) (RealBinOp (ArraySection (Var 3 v) [((IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] (Array (Real 4) [(() ())] DescriptorArray ) () ) Mul (ArraySection (Var 3 v) [((IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (ArraySection (Var 3 v) [((IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] (Array (Real 4) [(() ())] DescriptorArray ) () ) (RealBinOp (ArraySection (Var 3 v) [((IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] (Array (Real 4) [(() ())] DescriptorArray ) () ) Mul (ArrayBroadcast (RealConstant 2.600000 (Real 4) ) (IntrinsicArrayFunction Shape [(ArraySection (Var 3 v) [((IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] (Array (Real 4) [(() ())] DescriptorArray ) () )] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. )] ), myreal: (Variable 2 myreal [] Local () () Default (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), theta: (Variable 2 theta [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) associate_05 [] [(Allocate [((Var 2 myreal) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (Var 2 x) (ArrayBroadcast (RealConstant 0.420000 (Real 4) ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [4.19999987e-01, 4.19999987e-01, 4.19999987e-01, ...., 4.19999987e-01, 4.19999987e-01, 4.19999987e-01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 2 y) (ArrayBroadcast (RealConstant 0.350000 (Real 4) ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [3.49999994e-01, 3.49999994e-01, 3.49999994e-01, ...., 3.49999994e-01, 3.49999994e-01, 3.49999994e-01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 2 myreal) (ArrayBroadcast (RealConstant 9.100000 (Real 4) ) (IntrinsicArrayFunction Shape [(Var 2 myreal)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () ) () .false. .false. ) (Assignment (Var 2 theta) (ArrayBroadcast (RealConstant 1.500000 (Real 4) ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1.50000000e+00, 1.50000000e+00, 1.50000000e+00, ...., 1.50000000e+00, 1.50000000e+00, 1.50000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 2 a) (ArrayBroadcast (RealConstant 0.400000 (Real 4) ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [4.00000006e-01, 4.00000006e-01, 4.00000006e-01, ...., 4.00000006e-01, 4.00000006e-01, 4.00000006e-01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (AssociateBlockCall 2 associate_block ) (Print (StringFormat () [(Var 2 myreal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-assign1-9565114.json0000664000175000017500000000074015174404631022602 0ustar alastairalastair{ "basename": "ast-assign1-9565114", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/assign1.f", "infile_hash": "fd0e9e89daf1180a598a34cec5b9ee4f3825428369188648ab3db4d1", "outfile": null, "outfile_hash": null, "stdout": "ast-assign1-9565114.stdout", "stdout_hash": "0c47ecfc2429b62c912fc9f1768ba159046eacbeb189e3b7ed51414b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixedform_return2-597f864.json0000664000175000017500000000076315174404631025004 0ustar alastairalastair{ "basename": "ast-fixedform_return2-597f864", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_return2.f", "infile_hash": "6f658841ac27efc9dc2d982f71ac53b36dbb27285a65c77b6d4ba3e7", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_return2-597f864.stdout", "stdout_hash": "a45713b76a4b8b39ab0a7d692b56859c738acf9fdb18beec1b7ea780", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-interface2-98c9adf.json0000664000175000017500000000072315174404631023571 0ustar alastairalastair{ "basename": "ast-interface2-98c9adf", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/interface2.f90", "infile_hash": "708e539c3b559554e522379a3dd84fbbef89eb01ea66bf9ded4a5fcb", "outfile": null, "outfile_hash": null, "stdout": "ast-interface2-98c9adf.stdout", "stdout_hash": "99b25f11bb30c1682ee9de59c3f1a104a40540dcb55bd25ad90b9c1d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format_52-f04ddb1.json0000664000175000017500000000071515174404631023340 0ustar alastairalastair{ "basename": "run-format_52-f04ddb1", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_52.f90", "infile_hash": "2fe42a1ad98491fc272744dce3b07613c18da43661f2cff64f05771d", "outfile": null, "outfile_hash": null, "stdout": "run-format_52-f04ddb1.stdout", "stdout_hash": "67159b9946be8549559c52ca058592480baa7fc355f699832914bb3e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_03-b1d32aa.json0000664000175000017500000000077215174404631024667 0ustar alastairalastair{ "basename": "asr-derived_types_03-b1d32aa", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_03.f90", "infile_hash": "fd0a87db249f310cd20a90b39d5eb4627597acf774b62bdb8c4256c4", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_03-b1d32aa.stdout", "stdout_hash": "431f88220826dcd11000927b4c696bf39deb840a29d6fe832bf7acd0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-complex_sub_test-f54ef56.stdout0000664000175000017500000001600315174404631025410 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex2: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) complex2 [] [(Assignment (Var 2 x) (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 4.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 x) (ComplexBinOp (Var 2 x) Sub (Cast (RealConstant 4.000000 (Real 4) ) RealToComplex (Complex 4) (ComplexConstant 4.000000 0.000000 (Complex 4) ) () ) (Complex 4) () ) () .false. .false. ) (Assignment (Var 2 x) (ComplexBinOp (Cast (RealConstant 4.000000 (Real 4) ) RealToComplex (Complex 4) (ComplexConstant 4.000000 0.000000 (Complex 4) ) () ) Sub (Var 2 x) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (ComplexBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 2.000000 0.000000 (Complex 4) ) () ) Sub (Var 2 x) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (ComplexBinOp (Var 2 x) Sub (ComplexConstructor (RealConstant 0.000000 (Real 4) ) (RealConstant 3.000000 (Real 4) ) (Complex 4) (ComplexConstant 0.000000 3.000000 (Complex 4) ) ) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-doloop_01-5cd8bf1.stdout0000664000175000017500000005735315174404631023712 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { doloop_01: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) doloop_01 [] [(Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 55 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) )) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 55 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 9 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 25 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 9 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) )) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 25 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 25 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 22 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) )) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 22 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) ()) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) )) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) ()) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) )) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/run-format_39-1b897aa.json0000664000175000017500000000071515174404631023275 0ustar alastairalastair{ "basename": "run-format_39-1b897aa", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_39.f90", "infile_hash": "21ae932dead2ee7e13dbde215b3dafb82cd29ab48a0a3abe183e8c8d", "outfile": null, "outfile_hash": null, "stdout": "run-format_39-1b897aa.stdout", "stdout_hash": "0b239ec77538859ed5cc3e7eae13f060c35b0ec15fedabf79f07379c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_07-ccfd81f.stdout0000664000175000017500000003740415174404631025347 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_05: (Program (SymbolTable 5 { }) derived_types_05 [] [] ), derived_types_07_stdlib_logger: (Module (SymbolTable 2 { final_logger: (Function (SymbolTable 4 { iostat: (Variable 4 iostat [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), message: (Variable 4 message [] Local () () Default (String 1 (IntegerConstant 256 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 4 self [] In () () Default (StructType [(Logical 4) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) (Integer 4)] [] .true. .false. ) 2 logger_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), unit: (Variable 4 unit [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) final_logger (FunctionType [(StructType [(Logical 4) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) (Integer 4)] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 self)] [] () Public .true. .true. () ), logger_type: (Struct (SymbolTable 3 { add_blank_line: (Variable 3 add_blank_line [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), log_units: (Variable 3 log_units [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), max_width: (Variable 3 max_width [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) logger_type (StructType [(Logical 4) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) (Integer 4)] [] .true. .false. ) [] [add_blank_line log_units max_width] [final_logger] Source Private .false. .false. [] () () [] ) }) derived_types_07_stdlib_logger () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-arithmetic_if1-f119c2a.stderr0000664000175000017500000000022715174404631024665 0ustar alastairalastairsemantic error: Arithmetic if (x) requires an integer or real for `x` --> tests/errors/arithmetic_if1.f90:5:5 | 5 | if ("yy") 1, 2, 3 | ^^^^ lfortran-0.63.0/tests/reference/cpp-types_06-a5c2d06.stdout0000664000175000017500000000565715174404631023474 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t i; float r; r = (float)(2); i = 2; if (i < i) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r < r) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r < (float)(i)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if ((float)(i) < r) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (i > i) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r > r) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r > (float)(i)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if ((float)(i) > r) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (i != i) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r != r) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r != (float)(i)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if ((float)(i) != r) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (i + 1 <= i) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r + (float)(1) <= r) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r + (float)(1) <= (float)(i)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if ((float)(i + 1) <= r) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (i >= i + 1) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r >= r + (float)(1)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r >= (float)(i + 1)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if ((float)(i) >= r + (float)(1)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (i == i + 1) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r == r + (float)(1)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r == (float)(i + 1)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if ((float)(i) == r + (float)(1)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/ast_f90-subroutine9-60500c5.json0000664000175000017500000000074115174404631024250 0ustar alastairalastair{ "basename": "ast_f90-subroutine9-60500c5", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/subroutine9.f90", "infile_hash": "7936a6a897f4c893828bca05987a6c387bcda279b2ac5f20199ffda3", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-subroutine9-60500c5.stdout", "stdout_hash": "dd9805b45fe88710ed0323934c97a79aeacfb32782cf2a1cb9f6540c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-do_concurrent1-5fba0ee.stdout0000664000175000017500000004030115174404631025101 0ustar alastairalastair(TranslationUnit [(Subroutine dc1 [(a) (b)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent InOut )] [(a [(() () DimensionExpr) (() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(N [] [] () () None ()) (i [] [] () () None ()) (j [] [] () () None ())] () )] [(Assignment 0 N (FuncCallOrArray size [] [(() a () 0)] [] [] [] ) () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () ) (ConcurrentControl j 1 N () )] (< i j) [] [(Assignment 0 (FuncCallOrArray a [] [(() i () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray a [] [(() j () 0) (() i () 0)] [] [] [] ) () )] () () )] [] [] ) (Subroutine dc2 [(a) (b)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent InOut )] [(a [(() () DimensionExpr)] [] () () None ()) (b [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(x [] [] () () None ())] () )] [(Assignment 0 x (Real "1.0") () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 10 () )] () [(ConcurrentLocal [x] )] [(If 0 () (> (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) 0) [(Assignment 0 x (FuncCallOrArray sqrt [] [(() (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) () 0)] [] [] [] ) () ) (Assignment 0 (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (- (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (** x 2)) () )] [] () () () ) (Assignment 0 (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) (- (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () ) (Print 0 () [x] () )] [] [] ) (Subroutine dc3 [(a) (b)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent InOut )] [(a [(() () DimensionExpr)] [] () () None ()) (b [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(x [] [] () () None ())] () )] [(Assignment 0 x (Real "1.0") () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 10 () )] () [(ConcurrentShared [i] ) (ConcurrentLocal [x] ) (ConcurrentDefault)] [(If 0 () (> (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) 0) [(Assignment 0 x (FuncCallOrArray sqrt [] [(() (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) () 0)] [] [] [] ) () ) (Assignment 0 (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (- (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (** x 2)) () )] [] () () () ) (Assignment 0 (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) (- (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () ) (Print 0 () [x] () )] [] [] ) (Subroutine dc4 [(a) (b)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent InOut )] [(a [(() () DimensionExpr)] [] () () None ()) (b [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(x [] [] () () None ())] () )] [(Assignment 0 x (Real "1.0") () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 10 () )] () [(ConcurrentDefault) (ConcurrentLocal [x] ) (ConcurrentShared [i] )] [(If 0 () (> (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) 0) [(Assignment 0 x (FuncCallOrArray sqrt [] [(() (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) () 0)] [] [] [] ) () ) (Assignment 0 (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (- (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (** x 2)) () )] [] () () () ) (Assignment 0 (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) (- (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () ) (Print 0 () [x] () )] [] [] )] ) lfortran-0.63.0/tests/reference/llvm-modules_06-03c75b2.stdout0000664000175000017500000000705115174404631024077 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [3 x i8] c"b()" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data, i32 0, i32 0), i64 3 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @__module_modules_06_a_b() { .entry: %r = alloca i32, align 4 %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %0, i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) store i32 5, i32* %r, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return %1 = load i32, i32* %r, align 4 ret i32 %1 } declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %3 = call i32 @__module_modules_06_a_b() store i32 %3, i32* %i, align 4 %4 = alloca i64, align 8 %5 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %4, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %i) %6 = load i64, i64* %4, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %5, i8** %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %6, i64* %8, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %10 = load i8*, i8** %9, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %12 = load i64, i64* %11, align 8 %13 = trunc i64 %12 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %10, i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %14 = icmp eq i8* %5, null br i1 %14, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %5) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_modules_06 FINALIZE_SYMTABLE_modules_06: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-intrinsics_03-ef06d46.stdout0000664000175000017500000004462315174404631024523 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_03: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dp: (ExternalSymbol 2 dp 4 real64 lfortran_intrinsic_iso_fortran_env [] real64 Public ), i: (Variable 2 i [] Local (IntegerUnaryMinus (IntegerConstant 12 (Integer 4) Decimal) (Integer 4) (IntegerConstant -12 (Integer 4) Decimal) ) (IntegerConstant -12 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r1: (Variable 2 r1 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r2: (Variable 2 r2 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_03 [iso_fortran_env] [(Assignment (Var 2 a) (RealConstant 4.200000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 x) (IntrinsicElementalFunction Cos [(RealConstant 9.500000 (Real 4) )] 0 (Real 4) (RealConstant -0.997172 (Real 4) ) ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Add (RealConstant 0.997172 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Cos [(Var 2 a)] 0 (Real 8) () ) Add (Cast (RealConstant 0.490261 (Real 4) ) RealToReal (Real 8) (RealConstant 0.490261 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Cos [(RealBinOp (Cast (IntrinsicElementalFunction Cos [(RealConstant 1.500000 (Real 4) )] 0 (Real 4) (RealConstant 0.070737 (Real 4) ) ) RealToReal (Real 8) (RealConstant 0.070737 (Real 8) ) () ) Add (IntrinsicElementalFunction Cos [(RealBinOp (Var 2 a) Add (IntrinsicElementalFunction Cos [(Var 2 a)] 0 (Real 8) () ) (Real 8) () )] 0 (Real 8) () ) (Real 8) () )] 0 (Real 8) () ) Sub (Cast (RealConstant 0.716404 (Real 4) ) RealToReal (Real 8) (RealConstant 0.716404 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 r1) (IntrinsicElementalFunction Cos [(Var 2 a)] 0 (Real 8) () ) () .false. .false. ) (Assignment (Var 2 r2) (RealUnaryMinus (RealConstant 0.490261 (Real 8) ) (Real 8) (RealConstant -0.490261 (Real 8) ) ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 r1) Sub (Var 2 r2) (Real 8) () )] 0 (Real 8) () ) Gt (RealConstant 0.000000 (Real 8) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(IntrinsicElementalFunction Abs [(Var 2 i)] 0 (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (IntrinsicElementalFunction Abs [(Var 2 i)] 0 (Integer 4) () ) NotEq (IntegerConstant 12 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env) }) [] ) lfortran-0.63.0/tests/reference/asr-logical3-b6316c6.stderr0000664000175000017500000000047715174404631023425 0ustar alastairalastairwarning: .xor. is an LFortran extension --> tests/../integration_tests/logical3.f90:24:5 | 24 | if (a .xor. b) then | ^^^^^^^^^ LFortran extension warning: .xor. is an LFortran extension --> tests/../integration_tests/logical3.f90:74:5 | 74 | if (a .xor. b) then | ^^^^^^^^^ LFortran extension lfortran-0.63.0/tests/reference/ast-continue_body_if_loop-406ed85.stdout0000664000175000017500000000436115174404631026322 0ustar alastairalastair(TranslationUnit [(Program implicit_program_lfortran () [] [] [(Declaration (AttrType TypeReal [] () () None ) [] [(u [] [] () () None ()) (s [] [] () () None ())] () ) (Declaration () [(AttrDimension [] )] [(u [(1 100 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(j [] [] () () None ())] () )] [(Assignment 0 s (Real "0.0") () ) (DoLoop 0 () 1 j 1 100 () [(Assignment 0 s (+ s (FuncCallOrArray u [] [(() j () 0)] [] [] [] )) () ) (If 0 () (>= s 1000000) [(GoTo 0 () 2 [] () )] [] () () () ) (Continue 1 () )] () () ) (Stop 0 () () () ) (Continue 2 () )] [] )] ) lfortran-0.63.0/tests/reference/cpp-do_concurrent_reduce-373b02e.json0000664000175000017500000000074415174404631025556 0ustar alastairalastair{ "basename": "cpp-do_concurrent_reduce-373b02e", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/do_concurrent_reduce.f90", "infile_hash": "44ebdebb05b853f4680c203c3b2b0e98e9285d1f3923ecbc255bc105", "outfile": null, "outfile_hash": null, "stdout": "cpp-do_concurrent_reduce-373b02e.stdout", "stdout_hash": "1c4394e166dc4bdd6b8f8af01fcf008a75fbeaa37aa849cd762d4e57", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-subroutine3-d7c057c.json0000664000175000017500000000072615174404631023741 0ustar alastairalastair{ "basename": "ast-subroutine3-d7c057c", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine3.f90", "infile_hash": "174874c0a5fad40d608acbafefcc0c06c96379cc136126d3f05b63e5", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine3-d7c057c.stdout", "stdout_hash": "e10b35153f788c6b07c98ddad95846e8698fe1545e286262d93ae39a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format6-f98f4d0.stdout0000664000175000017500000000025715174404631023432 0ustar alastairalastair +12.1+122.1 122.1 +011 +011 +11 +11 -11 -1111 *** 11 +0.1234567871D+05 +0.12345678910111198970867447229396098431025025677514E-61 +12.3457E+03 +12.8E+03 +1.0 lfortran-0.63.0/tests/reference/fortran-integer_to_real_cast_in_comparison-a6f3411.stdout0000664000175000017500000000046715174404631031723 0ustar alastairalastairprogram expr2 implicit none integer(4), parameter :: dp = Kind(0.0000000000000000e+00_8) contains elemental real(8) function dabs(x) result(r) real(8), intent(in) :: x if (x > real(0, kind=8)) then r = x else r = real(0, kind=8) - x end if end function dabs end program expr2 lfortran-0.63.0/tests/reference/ast-program_without_line_04-bf080aa.json0000664000175000017500000000100115174404631026253 0ustar alastairalastair{ "basename": "ast-program_without_line_04-bf080aa", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/program_without_line_04.f90", "infile_hash": "2472f436e81a455036413e097c9177de811e6eeb2b78579076e00bee", "outfile": null, "outfile_hash": null, "stdout": "ast-program_without_line_04-bf080aa.stdout", "stdout_hash": "07d77481a3e5fd16c38342d0b79d66659db3518386c72f91bfb82432", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-abs_01-0c0b4df.stdout0000664000175000017500000001777715174404631023165 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (type (;4;) (func (param f64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local f32) f32.const 1.500000 local.set 0 local.get 0 f64.promote_f32 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 0 f32.const 0.000000 f32.lt if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end f32.const 1.500000 local.set 0 local.get 0 f64.promote_f32 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 0 f32.const 0.000000 f32.lt if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (func $4 (type 4) (param f64) (result) (local i64 i64 i64) local.get 0 f64.const 0.000000 f64.lt if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 f64.const -1.000000 f64.mul local.set 0 else end local.get 0 i64.trunc_f64_s call 3 i32.const 1 i32.const 40 i32.const 1 i32.const 0 call 1 drop local.get 0 local.get 0 i64.trunc_f64_s f64.convert_i64_s f64.sub f64.const 100000000.000000 f64.mul i64.trunc_f64_s local.set 2 local.get 2 local.set 3 i64.const 0 local.set 1 loop local.get 2 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 2 f64.convert_i64_s i64.const 10 f64.convert_i64_s f64.div i64.trunc_f64_s local.set 2 br 1 else end end loop local.get 1 i64.const 8 i64.lt_s if local.get 1 i64.const 1 i64.add local.set 1 i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop br 1 else end end local.get 3 call 3 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (export "print_f64" (func 4)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\0b\00\00\00") (data (;35;) (i32.const 216) "ERROR STOP\n ") ) lfortran-0.63.0/tests/reference/llvm-associate_04-97f4e70.stdout0000664000175000017500000001771615174404631024431 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [9 x i8] c"R4,R4,R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define float @_lcompilers_cos_f32(float* %x) { .entry: %_lcompilers_cos_f32 = alloca float, align 4 %0 = load float, float* %x, align 4 %1 = call float @_lfortran_scos(float %0) store float %1, float* %_lcompilers_cos_f32, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE__lcompilers_cos_f32 FINALIZE_SYMTABLE__lcompilers_cos_f32: ; preds = %return %2 = load float, float* %_lcompilers_cos_f32, align 4 ret float %2 } declare float @_lfortran_scos(float) define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca float, align 4 %myreal = alloca float, align 4 %theta = alloca float, align 4 %x = alloca float, align 4 %y = alloca float, align 4 store float 0x3FDAE147A0000000, float* %x, align 4 store float 0x3FD6666660000000, float* %y, align 4 store float 0x4022333340000000, float* %myreal, align 4 store float 1.500000e+00, float* %theta, align 4 store float 0x3FD99999A0000000, float* %a, align 4 br label %associate_block_start associate_block_start: ; preds = %.entry %3 = call i8* @llvm.stacksave() %v = alloca float*, align 8 store float* null, float** %v, align 8 %z = alloca float, align 4 %4 = load float, float* %x, align 4 %5 = fmul float %4, 2.000000e+00 %6 = load float, float* %y, align 4 %7 = fmul float %6, 2.000000e+00 %8 = fadd float %5, %7 %9 = fneg float %8 %10 = call float @_lcompilers_cos_f32(float* %theta) %11 = fmul float %9, %10 store float %11, float* %z, align 4 store float* %myreal, float** %v, align 8 %12 = alloca i64, align 8 %13 = load float, float* %a, align 4 %14 = load float, float* %z, align 4 %15 = fadd float %13, %14 %16 = alloca float, align 4 store float %15, float* %16, align 4 %17 = load float, float* %a, align 4 %18 = load float, float* %z, align 4 %19 = fsub float %17, %18 %20 = alloca float, align 4 store float %19, float* %20, align 4 %21 = load float*, float** %v, align 8 %22 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @serialization_info, i32 0, i32 0), i64* %12, i32 0, i32 0, i32 0, i32 0, i32 0, float* %16, float* %20, float* %21) %23 = load i64, i64* %12, align 8 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %22, i8** %24, align 8 %25 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %23, i64* %25, align 8 %26 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %27 = load i8*, i8** %26, align 8 %28 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %29 = load i64, i64* %28, align 8 %30 = trunc i64 %29 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %27, i32 %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %31 = icmp eq i8* %22, null br i1 %31, label %free_done, label %free_nonnull free_nonnull: ; preds = %associate_block_start call void @_lfortran_free_alloc(i8* %2, i8* %22) br label %free_done free_done: ; preds = %free_nonnull, %associate_block_start %32 = load float*, float** %v, align 8 %33 = load float*, float** %v, align 8 %34 = load float, float* %33, align 4 %35 = fmul float %34, 0x4012666660000000 store float %35, float* %32, align 4 br label %associate_block_end associate_block_end: ; preds = %free_done br label %FINALIZE_SYMTABLE_associate_block FINALIZE_SYMTABLE_associate_block: ; preds = %associate_block_end call void @llvm.stackrestore(i8* %3) %36 = alloca i64, align 8 %37 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %36, i32 0, i32 0, i32 0, i32 0, i32 0, float* %myreal) %38 = load i64, i64* %36, align 8 %39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %37, i8** %39, align 8 %40 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %38, i64* %40, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %42 = load i8*, i8** %41, align 8 %43 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %44 = load i64, i64* %43, align 8 %45 = trunc i64 %44 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %42, i32 %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %46 = icmp eq i8* %37, null br i1 %46, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %FINALIZE_SYMTABLE_associate_block call void @_lfortran_free_alloc(i8* %2, i8* %37) br label %free_done3 free_done3: ; preds = %free_nonnull2, %FINALIZE_SYMTABLE_associate_block %47 = load float, float* %myreal, align 4 %48 = fsub float %47, 0x4044EE1480000000 %49 = fcmp ogt float %48, 0x3EE4F8B580000000 %50 = load float, float* %myreal, align 4 %51 = fsub float %50, 0x4044EE1480000000 %52 = fcmp olt float %51, 0xBEE4F8B580000000 %53 = or i1 %49, %52 br i1 %53, label %then, label %else then: ; preds = %free_done3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %free_done3 br label %ifcont ifcont: ; preds = %else, %then br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_associate_04 FINALIZE_SYMTABLE_associate_04: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) ; Function Attrs: nounwind declare i8* @llvm.stacksave() #0 declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) ; Function Attrs: nounwind declare void @llvm.stackrestore(i8*) #0 declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) attributes #0 = { nounwind } lfortran-0.63.0/tests/reference/asr_openmp-openmp_37-2c7ae83.json0000664000175000017500000000077415174404631024645 0ustar alastairalastair{ "basename": "asr_openmp-openmp_37-2c7ae83", "cmd": "lfortran --show-asr --no-color --openmp {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_37.f90", "infile_hash": "700b2c6afb1ba72344e8c45cd51aa4bc69919c5b06c79e07cc73ca04", "outfile": null, "outfile_hash": null, "stdout": "asr_openmp-openmp_37-2c7ae83.stdout", "stdout_hash": "63dff644d8b8c2cb1fef088c82102d20dfbd7a4cda17c5235d2544a2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics4-113f724.stderr0000664000175000017500000000027215174404631024107 0ustar alastairalastairsemantic error: Kind of all the arguments of Dshiftl must be the same --> tests/errors/intrinsics4.f90:2:14 | 2 | print *, dshiftl(1, 1_8, 1) | ^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-intrinsics13-349f6ac.json0000664000175000017500000000074015174404631024005 0ustar alastairalastair{ "basename": "asr-intrinsics13-349f6ac", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics13.f90", "infile_hash": "d8cd233c3150d185f9e9e6c6f89d70471bb5b362d82cf142a51d0b82", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics13-349f6ac.stderr", "stderr_hash": "a5688f270ca65cae87f17411d2cbda408ffc88927b5f76033ad4b0ff", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-block_01-98c37d0.stdout0000664000175000017500000003546515174404631023355 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { block_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), associate_block: (AssociateBlock (SymbolTable 3 { block: (Block (SymbolTable 4 { b: (Variable 4 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 4 c [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) block [(Assignment (Var 4 b) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 4 c) (Cast (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant -3.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 d) (Cast (IntrinsicElementalFunction Cos [(RealBinOp (Var 4 b) Add (Var 4 c) (Real 4) () )] 0 (Real 4) () ) RealToInteger (Integer 4) () () ) () .false. .false. )] ), n: (Variable 3 n [] Local () () Default (Pointer (Integer 4) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) associate_block [(Associate (Var 3 n) (Var 2 a) ) (BlockCall -1 3 block )] ), b: (Variable 2 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) block_01 [] [(Assignment (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (AssociateBlockCall 2 associate_block ) (If () (IntegerCompare (Var 2 b) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 d) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-arrays_01-5f1c776.stdout0000664000175000017500000005060215174404631023553 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) arrays_01 [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (IntegerBinOp (Var 2 i) Add (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 11 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 12 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 13 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 11 (Integer 4) Decimal) (IntegerConstant 14 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 b) [(() (IntegerBinOp (Var 2 i) Sub (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 11 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 12 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 13 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 14 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (IntegerBinOp (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerBinOp (IntegerBinOp (IntegerBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) Add (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Integer 4) () ) Add (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Integer 4) () ) Add (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 17 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 11 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_sort_01-b412f73.stdout0000664000175000017500000065664215174404631025142 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_sort_01: (Program (SymbolTable 18 { my_type: (ExternalSymbol 18 my_type 2 my_type template_sort_01_type [] my_type Public ), op_r: (ExternalSymbol 18 op_r 5 op_r template_sort_01_m [] op_r Public ), qsort_t: (ExternalSymbol 18 qsort_t 5 qsort_t template_sort_01_m [] qsort_t Public ), test_template: (ExternalSymbol 18 test_template 5 test_template template_sort_01_m [] test_template Public ) }) template_sort_01 [template_sort_01_m template_sort_01_type] [(SubroutineCall 18 test_template () [] () .false. )] ), template_sort_01_m: (Module (SymbolTable 5 { lt_integer: (Function (SymbolTable 13 { lhs: (Variable 13 lhs [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 13 res [] ReturnVar () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 13 rhs [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) lt_integer (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 13 lhs) (Var 13 rhs)] [(Assignment (Var 13 res) (IntegerCompare (Var 13 lhs) Lt (Var 13 rhs) (Logical 4) () ) () .false. .false. )] (Var 13 res) Private .true. .true. () ), lt_my_type: (ExternalSymbol 5 lt_my_type 2 lt_my_type template_sort_01_type [] lt_my_type Private ), lt_real: (Function (SymbolTable 12 { lhs: (Variable 12 lhs [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 12 res [] ReturnVar () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 12 rhs [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) lt_real (FunctionType [(Real 4) (Real 4)] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 12 lhs) (Var 12 rhs)] [(Assignment (Var 12 res) (RealCompare (Var 12 lhs) Lt (Var 12 rhs) (Logical 4) () ) () .false. .false. )] (Var 12 res) Private .true. .true. () ), my_type: (ExternalSymbol 5 my_type 2 my_type template_sort_01_type [] my_type Public ), op_r: (Requirement (SymbolTable 6 { op_func: (Function (SymbolTable 7 { lhs: (Variable 7 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 7 res [] ReturnVar () () Default (TypeParameter v ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 7 rhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) op_func (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter v ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 7 lhs) (Var 7 rhs)] [] (Var 7 res) Private .true. .true. () ), t: (Variable 6 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u: (Variable 6 u [] In () () Default (TypeParameter u ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 6 v [] In () () Default (TypeParameter v ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) op_r [t u v op_func] [] ), qsort_t: (Template (SymbolTable 8 { logical: (Variable 8 logical [] In () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lt: (Function (SymbolTable 9 { lhs: (Variable 9 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 9 res [] ReturnVar () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 9 rhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) lt (FunctionType [(TypeParameter t ) (TypeParameter t )] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 9 lhs) (Var 9 rhs)] [] (Var 9 res) Private .true. .true. () ), qs: (Function (SymbolTable 11 { arr: (Variable 11 arr [] InOut () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), high: (Variable 11 high [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 11 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), last: (Variable 11 last [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), low: (Variable 11 low [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pivot: (Variable 11 pivot [] Local () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) qs (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray ) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [lt swp qs] [(Var 11 arr) (Var 11 low) (Var 11 high)] [(If () (IntegerCompare (Var 11 low) Lt (Var 11 high) (Logical 4) () ) [(Assignment (Var 11 pivot) (ArrayItem (Var 11 arr) [(() (Var 11 high) ())] (TypeParameter t ) ColMajor () ) () .false. .false. ) (Assignment (Var 11 last) (IntegerBinOp (Var 11 low) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (DoLoop () ((Var 11 i) (Var 11 low) (IntegerBinOp (Var 11 high) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(If () (FunctionCall 8 lt () [((ArrayItem (Var 11 arr) [(() (Var 11 i) ())] (TypeParameter t ) ColMajor () )) ((Var 11 pivot))] (Logical 4) () () ) [(Assignment (Var 11 last) (IntegerBinOp (Var 11 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 8 swp () [((ArrayItem (Var 11 arr) [(() (Var 11 last) ())] (TypeParameter t ) ColMajor () )) ((ArrayItem (Var 11 arr) [(() (Var 11 i) ())] (TypeParameter t ) ColMajor () ))] () .false. )] [] )] [] ) (SubroutineCall 8 swp () [((ArrayItem (Var 11 arr) [(() (IntegerBinOp (Var 11 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (TypeParameter t ) ColMajor () )) ((ArrayItem (Var 11 arr) [(() (Var 11 high) ())] (TypeParameter t ) ColMajor () ))] () .false. ) (SubroutineCall 8 qs () [((ArrayPhysicalCast (Var 11 arr) DescriptorArray DescriptorArray (Array (TypeParameter t ) [(() ())] DescriptorArray ) () )) ((Var 11 low)) ((Var 11 last))] () .false. ) (SubroutineCall 8 qs () [((ArrayPhysicalCast (Var 11 arr) DescriptorArray DescriptorArray (Array (TypeParameter t ) [(() ())] DescriptorArray ) () )) ((IntegerBinOp (Var 11 last) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((Var 11 high))] () .false. )] [] )] () Private .true. .true. () ), swp: (Function (SymbolTable 10 { lhs: (Variable 10 lhs [] InOut () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 10 rhs [] InOut () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 10 tmp [] Local () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) swp (FunctionType [(TypeParameter t ) (TypeParameter t )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 lhs) (Var 10 rhs)] [(Assignment (Var 10 tmp) (Var 10 lhs) () .false. .false. ) (Assignment (Var 10 lhs) (Var 10 rhs) () .false. .false. ) (Assignment (Var 10 rhs) (Var 10 tmp) () .false. .false. )] () Private .true. .true. () ), t: (Variable 8 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) qsort_t [t lt] [(Require op_r [t logical lt] )] ), test_template: (Function (SymbolTable 14 { __asr_swp: (Function (SymbolTable 19 { lhs: (Variable 19 lhs [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 19 rhs [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 19 tmp [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __asr_swp (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 19 lhs) (Var 19 rhs)] [(Assignment (Var 19 tmp) (Var 19 lhs) () .false. .false. ) (Assignment (Var 19 lhs) (Var 19 rhs) () .false. .false. ) (Assignment (Var 19 rhs) (Var 19 tmp) () .false. .false. )] () Private .true. .true. () ), __asr_swp1: (Function (SymbolTable 20 { lhs: (Variable 20 lhs [] InOut () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 20 rhs [] InOut () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 20 tmp [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __asr_swp1 (FunctionType [(Real 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 lhs) (Var 20 rhs)] [(Assignment (Var 20 tmp) (Var 20 lhs) () .false. .false. ) (Assignment (Var 20 lhs) (Var 20 rhs) () .false. .false. ) (Assignment (Var 20 rhs) (Var 20 tmp) () .false. .false. )] () Private .true. .true. () ), __asr_swp2: (Function (SymbolTable 21 { lhs: (Variable 21 lhs [] InOut () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 21 rhs [] InOut () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 21 tmp [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __asr_swp2 (FunctionType [(StructType [(Real 4)] [] .true. .false. ) (StructType [(Real 4)] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 21 lhs) (Var 21 rhs)] [(Assignment (Var 21 tmp) (Var 21 lhs) () .false. .false. ) (Assignment (Var 21 lhs) (Var 21 rhs) () .false. .false. ) (Assignment (Var 21 rhs) (Var 21 tmp) () .false. .false. )] () Private .true. .true. () ), i: (Variable 14 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), qsort_integer: (Function (SymbolTable 15 { arr: (Variable 15 arr [] InOut () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), high: (Variable 15 high [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 15 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), last: (Variable 15 last [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), low: (Variable 15 low [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pivot: (Variable 15 pivot [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) qsort_integer (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray ) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [lt_integer __asr_swp qsort_integer] [(Var 15 arr) (Var 15 low) (Var 15 high)] [(If () (IntegerCompare (Var 15 low) Lt (Var 15 high) (Logical 4) () ) [(Assignment (Var 15 pivot) (ArrayItem (Var 15 arr) [(() (Var 15 high) ())] (Integer 4) ColMajor () ) () .false. .false. ) (Assignment (Var 15 last) (IntegerBinOp (Var 15 low) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (DoLoop () ((Var 15 i) (Var 15 low) (IntegerBinOp (Var 15 high) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(If () (FunctionCall 5 lt_integer () [((ArrayItem (Var 15 arr) [(() (Var 15 i) ())] (Integer 4) ColMajor () )) ((Var 15 pivot))] (Logical 4) () () ) [(Assignment (Var 15 last) (IntegerBinOp (Var 15 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 14 __asr_swp () [((ArrayItem (Var 15 arr) [(() (Var 15 last) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 15 arr) [(() (Var 15 i) ())] (Integer 4) ColMajor () ))] () .false. )] [] )] [] ) (SubroutineCall 14 __asr_swp () [((ArrayItem (Var 15 arr) [(() (IntegerBinOp (Var 15 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 15 arr) [(() (Var 15 high) ())] (Integer 4) ColMajor () ))] () .false. ) (SubroutineCall 14 qsort_integer () [((ArrayPhysicalCast (Var 15 arr) DescriptorArray DescriptorArray (Array (Integer 4) [(() ())] DescriptorArray ) () )) ((Var 15 low)) ((Var 15 last))] () .false. ) (SubroutineCall 14 qsort_integer () [((ArrayPhysicalCast (Var 15 arr) DescriptorArray DescriptorArray (Array (Integer 4) [(() ())] DescriptorArray ) () )) ((IntegerBinOp (Var 15 last) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((Var 15 high))] () .false. )] [] )] () Private .true. .true. () ), qsort_my_type: (Function (SymbolTable 17 { arr: (Variable 17 arr [] InOut () () Default (Array (StructType [(Real 4)] [] .true. .false. ) [(() ())] DescriptorArray ) 5 my_type Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), high: (Variable 17 high [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 17 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), last: (Variable 17 last [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), low: (Variable 17 low [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pivot: (Variable 17 pivot [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) qsort_my_type (FunctionType [(Array (StructType [(Real 4)] [] .true. .false. ) [(() ())] DescriptorArray ) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [__asr_swp2 qsort_my_type] [(Var 17 arr) (Var 17 low) (Var 17 high)] [(If () (IntegerCompare (Var 17 low) Lt (Var 17 high) (Logical 4) () ) [(Assignment (Var 17 pivot) (ArrayItem (Var 17 arr) [(() (Var 17 high) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () ) () .false. .false. ) (Assignment (Var 17 last) (IntegerBinOp (Var 17 low) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (DoLoop () ((Var 17 i) (Var 17 low) (IntegerBinOp (Var 17 high) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(If () (FunctionCall 5 lt_my_type () [((ArrayItem (Var 17 arr) [(() (Var 17 i) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () )) ((Var 17 pivot))] (Logical 4) () () ) [(Assignment (Var 17 last) (IntegerBinOp (Var 17 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 14 __asr_swp2 () [((ArrayItem (Var 17 arr) [(() (Var 17 last) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () )) ((ArrayItem (Var 17 arr) [(() (Var 17 i) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () ))] () .false. )] [] )] [] ) (SubroutineCall 14 __asr_swp2 () [((ArrayItem (Var 17 arr) [(() (IntegerBinOp (Var 17 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () )) ((ArrayItem (Var 17 arr) [(() (Var 17 high) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () ))] () .false. ) (SubroutineCall 14 qsort_my_type () [((ArrayPhysicalCast (Var 17 arr) DescriptorArray DescriptorArray (Array (StructType [(Real 4)] [] .true. .false. ) [(() ())] DescriptorArray ) () )) ((Var 17 low)) ((Var 17 last))] () .false. ) (SubroutineCall 14 qsort_my_type () [((ArrayPhysicalCast (Var 17 arr) DescriptorArray DescriptorArray (Array (StructType [(Real 4)] [] .true. .false. ) [(() ())] DescriptorArray ) () )) ((IntegerBinOp (Var 17 last) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((Var 17 high))] () .false. )] [] )] () Private .true. .true. () ), qsort_real: (Function (SymbolTable 16 { arr: (Variable 16 arr [] InOut () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), high: (Variable 16 high [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 16 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), last: (Variable 16 last [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), low: (Variable 16 low [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pivot: (Variable 16 pivot [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) qsort_real (FunctionType [(Array (Real 4) [(() ())] DescriptorArray ) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [lt_real __asr_swp1 qsort_real] [(Var 16 arr) (Var 16 low) (Var 16 high)] [(If () (IntegerCompare (Var 16 low) Lt (Var 16 high) (Logical 4) () ) [(Assignment (Var 16 pivot) (ArrayItem (Var 16 arr) [(() (Var 16 high) ())] (Real 4) ColMajor () ) () .false. .false. ) (Assignment (Var 16 last) (IntegerBinOp (Var 16 low) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (DoLoop () ((Var 16 i) (Var 16 low) (IntegerBinOp (Var 16 high) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(If () (FunctionCall 5 lt_real () [((ArrayItem (Var 16 arr) [(() (Var 16 i) ())] (Real 4) ColMajor () )) ((Var 16 pivot))] (Logical 4) () () ) [(Assignment (Var 16 last) (IntegerBinOp (Var 16 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 14 __asr_swp1 () [((ArrayItem (Var 16 arr) [(() (Var 16 last) ())] (Real 4) ColMajor () )) ((ArrayItem (Var 16 arr) [(() (Var 16 i) ())] (Real 4) ColMajor () ))] () .false. )] [] )] [] ) (SubroutineCall 14 __asr_swp1 () [((ArrayItem (Var 16 arr) [(() (IntegerBinOp (Var 16 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 4) ColMajor () )) ((ArrayItem (Var 16 arr) [(() (Var 16 high) ())] (Real 4) ColMajor () ))] () .false. ) (SubroutineCall 14 qsort_real () [((ArrayPhysicalCast (Var 16 arr) DescriptorArray DescriptorArray (Array (Real 4) [(() ())] DescriptorArray ) () )) ((Var 16 low)) ((Var 16 last))] () .false. ) (SubroutineCall 14 qsort_real () [((ArrayPhysicalCast (Var 16 arr) DescriptorArray DescriptorArray (Array (Real 4) [(() ())] DescriptorArray ) () )) ((IntegerBinOp (Var 16 last) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((Var 16 high))] () .false. )] [] )] () Private .true. .true. () ), xi: (Variable 14 xi [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), xm: (Variable 14 xm [] Local () () Default (Array (StructType [(Real 4)] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) 5 my_type Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), xr: (Variable 14 xr [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 14 xi) (ArrayConstant 40 [2, 4, 1, ...., 3, 42, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 14 xr) (ArrayConstant 40 [2.00000000e+00, 4.00000000e+00, 1.00000000e+00, ...., 3.00000000e+00, 4.20000000e+01, 2.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (DoLoop () ((Var 14 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 14 xm) [(() (Var 14 i) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () ) (StructConstructor 5 my_type [((ArrayItem (Var 14 xr) [(() (Var 14 i) ())] (Real 4) ColMajor () ))] (StructType [(Real 4)] [] .true. .false. ) () ) () .false. .false. )] [] ) (SubroutineCall 14 qsort_integer () [((ArrayPhysicalCast (Var 14 xi) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )) ((IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 10 (Integer 4) Decimal))] () .false. ) (SubroutineCall 14 qsort_real () [((ArrayPhysicalCast (Var 14 xr) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )) ((IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 10 (Integer 4) Decimal))] () .false. ) (SubroutineCall 14 qsort_my_type () [((ArrayPhysicalCast (Var 14 xm) FixedSizeArray DescriptorArray (Array (StructType [(Real 4)] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )) ((IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 10 (Integer 4) Decimal))] () .false. ) (Print (StringFormat () [(Var 14 xi)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 14 xr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 14 xm)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_sort_01_m () [template_sort_01_type template_sort_01_m] .false. .false. .false. ), template_sort_01_type: (Module (SymbolTable 2 { lt_my_type: (Function (SymbolTable 4 { 1_my_type_d: (ExternalSymbol 4 1_my_type_d 3 d my_type [] d Public ), lhs: (Variable 4 lhs [] In () () Default (StructType [(Real 4)] [] .true. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 4 res [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 4 rhs [] In () () Default (StructType [(Real 4)] [] .true. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) lt_my_type (FunctionType [(StructType [(Real 4)] [] .true. .false. ) (StructType [(Real 4)] [] .true. .false. )] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 4 lhs) (Var 4 rhs)] [(Assignment (Var 4 res) (RealCompare (StructInstanceMember (Var 4 lhs) 4 1_my_type_d (Real 4) () ) Lt (StructInstanceMember (Var 4 rhs) 4 1_my_type_d (Real 4) () ) (Logical 4) () ) () .false. .false. )] (Var 4 res) Public .true. .true. () ), my_type: (Struct (SymbolTable 3 { d: (Variable 3 d [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) my_type (StructType [(Real 4)] [] .true. .false. ) [] [d] [] Source Public .false. .false. [] () () [] ) }) template_sort_01_type () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast_indent-subroutine1-fdc40b3.json0000664000175000017500000000074415174404631025351 0ustar alastairalastair{ "basename": "ast_indent-subroutine1-fdc40b3", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine1.f90", "infile_hash": "e209c22328b423e75d6801f3c0ef19bc120936196435dff2cb19df31", "outfile": null, "outfile_hash": null, "stdout": "ast_indent-subroutine1-fdc40b3.stdout", "stdout_hash": "522465bcf29ea6cee23fd91313c1d21c73a291d11690341df76680ca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_implied_do_loops-modules_35-c089638.json0000664000175000017500000000104415174404631027060 0ustar alastairalastair{ "basename": "pass_implied_do_loops-modules_35-c089638", "cmd": "lfortran --pass=implied_do_loops --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_35.f90", "infile_hash": "5117017b03ab16e2fa34e13800ebd9e03539c4bd6ad2fafc1e543dbb", "outfile": null, "outfile_hash": null, "stdout": "pass_implied_do_loops-modules_35-c089638.stdout", "stdout_hash": "cd16feca969f1f19e2b88e007e056a57afee420800138f475130466e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-case_02-386b648.stdout0000664000175000017500000000302415174404631023564 0ustar alastairalastairprogram case_02 implicit none ! local variable declaration integer :: marks, out marks = 81 select case (marks) case (91:100) out = 0 print *, "Excellent!" case (81:90) out = 1 print *, "Very good!" case (71:80) out = 2 print *, "Well done!" case (61:70) out = 3 print *, "Not bad!" case (41:60) out = 4 print *, "You passed!" case (:40) out = 5 print *, "Better try again!" case default out = 6 print *, "Invalid marks" end select print *, "Your marks are ", marks if (out /= 1) then error stop end if ! case default at the top select case (marks) case default print *, "Invalid marks" case (91:100) print *, "Excellent!" case (81:90) print *, "Very good!" case (71:80) print *, "Well done!" case (61:70) print *, "Not bad!" case (41:60) print *, "You passed!" case (:40) print *, "Better try again!" end select print *, "Your marks are ", marks ! case default in the middle select case (marks) case (91:100) print *, "Excellent!" case (81:90) print *, "Very good!" case default print *, "Invalid marks" case (71:80) print *, "Well done!" case (61:70) print *, "Not bad!" case (41:60) print *, "You passed!" case (:40) print *, "Better try again!" end select print *, "Your marks are ", marks end program case_02 lfortran-0.63.0/tests/reference/asr-expr3-99b2959.stdout0000664000175000017500000000354115174404631022745 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { }) [(IntegerConstant 5 (Integer 4) Decimal) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerBinOp (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) Mul (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 16 (Integer 4) Decimal) ) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Mul (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 6 (Integer 4) Decimal) ) (Integer 4) (IntegerConstant 11 (Integer 4) Decimal) ) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Sub (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) (IntegerBinOp (IntegerConstant 4 (Integer 4) Decimal) Pow (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 64 (Integer 4) Decimal) ) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) )] ) lfortran-0.63.0/tests/reference/asr-fixed_form_call2-28c0b82.json0000664000175000017500000000100515174404631024557 0ustar alastairalastair{ "basename": "asr-fixed_form_call2-28c0b82", "cmd": "lfortran --fixed-form --implicit-interface --show-asr --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_call2.f", "infile_hash": "94899bb360f6a9205dc9fe3c76e28e8c04775b011747845b84950eb3", "outfile": null, "outfile_hash": null, "stdout": "asr-fixed_form_call2-28c0b82.stdout", "stdout_hash": "47d2cf12e36ac5d8f41be7281f9075fb08341d6be58c34367b474efa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-finalize_02-cfb24d5.json0000664000175000017500000000073115174404631024015 0ustar alastairalastair{ "basename": "llvm-finalize_02-cfb24d5", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/finalize_02.f90", "infile_hash": "fcf0784c9f9bddbeb187dc2ba6d322c3b6549c31c52ec7d83adff23d", "outfile": null, "outfile_hash": null, "stdout": "llvm-finalize_02-cfb24d5.stdout", "stdout_hash": "504aa53a3a06f9705390ad06fa074bf51adc109735a23e148dfb40f0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-cpp5-4cb2070.json0000664000175000017500000000074415174404631024476 0ustar alastairalastair{ "basename": "asr_preprocess-cpp5-4cb2070", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp5.f90", "infile_hash": "832e876e424e62ff86e263b3f4b23c6915146d7945e1ffab15b38295", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp5-4cb2070.stderr", "stderr_hash": "d82165bd15ac925ce36d0a305b55e0ef8d8fc2ea38ad7aac95b0635c", "returncode": 2 }lfortran-0.63.0/tests/reference/run-format_51-f69fffa.json0000664000175000017500000000071515174404631023442 0ustar alastairalastair{ "basename": "run-format_51-f69fffa", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_51.f90", "infile_hash": "a86b05c0e19461c4304d9f0bf1565f20cefa37495545476172f2485f", "outfile": null, "outfile_hash": null, "stdout": "run-format_51-f69fffa.stdout", "stdout_hash": "4e3a0f2dd04795c0f8bb0bebb173a9fbe57b062f953e36553f0d2a0d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/obj-empty-d0abeda.json0000664000175000017500000000055715174404631023006 0ustar alastairalastair{ "basename": "obj-empty-d0abeda", "cmd": "lfortran --no-color -c {infile} -o output.o", "infile": "tests/empty.f90", "infile_hash": "d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-select_type_04-e8b402f.json0000664000175000017500000000076415174404631024300 0ustar alastairalastair{ "basename": "asr-select_type_04-e8b402f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/select_type_04.f90", "infile_hash": "901a8af19672501e52484cba169d1249539f51e0a8f928a0851445dc", "outfile": null, "outfile_hash": null, "stdout": "asr-select_type_04-e8b402f.stdout", "stdout_hash": "106e7316dc103d820eb2b46da976fb47a22327735f8b017fef8be231", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-array_bounds_check_06-2986f6e.stderr0000664000175000017500000000043115174404631026106 0ustar alastairalastairruntime error: Array shape mismatch in assignment to 'x'. Tried to match size 3 of dimension 1 of LHS with size 4 of dimension 1 of RHS. --> tests/errors/array_bounds_check_06.f90:10:5 | 10 | x = y | ^ LHS size is 3 | 10 | x = y | ^ RHS size is 4 lfortran-0.63.0/tests/reference/asr-boz_01-dedad59.json0000664000175000017500000000105115174404631022702 0ustar alastairalastair{ "basename": "asr-boz_01-dedad59", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/boz_01.f90", "infile_hash": "58477e3f0fbdc7b41b5892cc6f876abfc5b434abe4884789d60b2d68", "outfile": null, "outfile_hash": null, "stdout": "asr-boz_01-dedad59.stdout", "stdout_hash": "87c7fe86f86670b98bbefbb7989a6d14d2e776893f0c4a34fb421f2f", "stderr": "asr-boz_01-dedad59.stderr", "stderr_hash": "2c1014e4f04672dfbcc83dde266587a98d7dc9651f6401dcaab51839", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-subroutines_07-4a9f44e.json0000664000175000017500000000076415174404631024353 0ustar alastairalastair{ "basename": "asr-subroutines_07-4a9f44e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_07.f90", "infile_hash": "8467217fadf16e3376047c00527af5bf50d1bf7077f84d1e380c393c", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutines_07-4a9f44e.stdout", "stdout_hash": "24c02f7e26b10c24bdd6c17632020b04dfddcaf8ad306db0e1e307c7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-intent_01-6d96ec5.json0000664000175000017500000000075015174404631023451 0ustar alastairalastair{ "basename": "llvm-intent_01-6d96ec5", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/intent_01.f90", "infile_hash": "ecbce2d4b01a09bee24ec92ce8be335f75903e746d23a667806bf264", "outfile": null, "outfile_hash": null, "stdout": "llvm-intent_01-6d96ec5.stdout", "stdout_hash": "b076c288c6704e82f7170cd1f2c88c4c60a7fadb933f6a0dd343bbfe", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_47-bdbe527.stdout0000664000175000017500000004213315174404631024601 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_47: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (ArrayConstant 12 [.true., .true., .true.] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayConstant 12 [.true., .true., .true.] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 2 l [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_47 [] [(Assignment (Var 2 l) (IntrinsicArrayFunction All [(ArrayPhysicalCast (ArrayConstant 8 [.true., .true.] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) () .false. .false. ) (Assignment (Var 2 l) (IntrinsicArrayFunction All [(ArrayPhysicalCast (ArrayConstant 8 [.true., .false.] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) () .false. .false. ) (Assignment (Var 2 l) (IntrinsicArrayFunction All [(ArrayPhysicalCast (ArrayConstant 4 [.false.] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) () .false. .false. ) (Assignment (Var 2 l) (IntrinsicArrayFunction All [(ArrayPhysicalCast (ArrayConstant 4 [.true.] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) () .false. .false. ) (Assignment (Var 2 l) (IntrinsicArrayFunction All [(ArrayPhysicalCast (Var 2 a) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) () ) () .false. .false. ) (Assignment (Var 2 l) (IntrinsicArrayFunction All [(ArrayPhysicalCast (ArrayConstructor [(IntegerCompare (IntegerConstant 1 (Integer 4) Decimal) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (IntegerCompare (IntegerConstant 0 (Integer 4) Decimal) Eq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) (LogicalConstant .true. (Logical 4) ) )] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 8 [.false., .true.] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ColMajor () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) () .false. .false. ) (Assignment (Var 2 l) (IntrinsicArrayFunction All [(ArrayPhysicalCast (ArrayConstructor [(Var 2 l)] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ColMajor () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) () ) () .false. .false. ) (Assignment (Var 2 l) (IntrinsicArrayFunction All [(ArrayConstructor [(LogicalConstant .false. (Logical 4) ) (Var 2 a) (LogicalConstant .true. (Logical 4) )] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) ())] DescriptorArray ) () ColMajor () )] 0 (Logical 4) () ) () .false. .false. ) (If () (Var 2 l) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-dimension_02-2fc38c6.stderr0000664000175000017500000000032415174404631024271 0ustar alastairalastairsemantic error: Expecting a scalar integer or parameter annotated integer variable --> tests/errors/dimension_02.f90:3:26 | 3 | character, dimension(linelen) :: line | ^^^^^^^ lfortran-0.63.0/tests/reference/asr-template_error_08-b380a57.stderr0000664000175000017500000000027215174404631025253 0ustar alastairalastairsemantic error: Operator `+` undefined for the types in the expression `t + t` --> tests/errors/template_error_08.f90:22:17 | 22 | z = x + y | ^^^^^ ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootlfortran-0.63.0/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-modules_37-1456cdb.jsonlfortran-0.63.0/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-module0000664000175000017500000000123415174404631034775 0ustar alastairalastair{ "basename": "pass_pass_array_by_data_transform_optional_argument_functions-modules_37-1456cdb", "cmd": "lfortran --pass=pass_array_by_data,transform_optional_argument_functions --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_37.f90", "infile_hash": "38f6c4643686768ff7e53fc236694c9de56c70b63a8b18bc70765a20", "outfile": null, "outfile_hash": null, "stdout": "pass_pass_array_by_data_transform_optional_argument_functions-modules_37-1456cdb.stdout", "stdout_hash": "e479df25ac0600696c4d05a2022ffa028d0907754fd7be382bb5cf65", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics2-68bbd81.json0000664000175000017500000000073515174404631023726 0ustar alastairalastair{ "basename": "asr-intrinsics2-68bbd81", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics2.f90", "infile_hash": "18272eb7d4e7827d39741404a0836223588b55b664a5f942dbe32bc8", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics2-68bbd81.stderr", "stderr_hash": "9e1ca345c4d17cce3276faba38665c173144e3509b768eed5c3ebf92", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-fn6-a24010a.json0000664000175000017500000000067615174404631022046 0ustar alastairalastair{ "basename": "asr-fn6-a24010a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/fn6.f90", "infile_hash": "635454a138db38c61d94f257c35b7c909eb0b9603372d17c77f7e1fd", "outfile": null, "outfile_hash": null, "stdout": "asr-fn6-a24010a.stdout", "stdout_hash": "664052099c78bf886fd473a09a261db8d03b9b161f9627f50671569c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_error_04-16c03e5.stderr0000664000175000017500000000124715174404631025247 0ustar alastairalastairsemantic error: Restriction type mismatch with provided function argument --> tests/errors/template_error_04.f90:34:33 | 34 | instantiate add_t(real, func_arg_real), only: add_real => add_generic | ^^^^^^^^^^^^^ | 8 | function F(x, y) result(z) | ^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 11 | end function | ...^^^^^^^^^^^^^^^^^^^^ Restriction's parameter x of type real | 28 | real function func_arg_real(x, y) result(z) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 31 | end function | ...^^^^^^^^^^^^^^^^ Function's parameter x of type integer lfortran-0.63.0/tests/reference/asr-doloop_01-bb1c596.stdout0000664000175000017500000000576415174404631023630 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { doloop_01: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) doloop_01 [] [(DoLoop () ((Var 2 i) (Cast (RealConstant 1.500000 (Real 4) ) RealToInteger (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) () ) (Cast (RealConstant 10.500000 (Real 4) ) RealToInteger (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) () ) (Cast (RealConstant 2.400000 (Real 4) ) RealToInteger (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) () )) [(Print (StringFormat () [(Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-reserved_01-566a18c.stdout0000664000175000017500000000060615174404631024543 0ustar alastairalastairprogram reserved_01 implicit none if (end(1, 2) /= 2) then error stop end if if (end(2, 1) /= 2) then error stop end if contains integer function end(return, integer) result(function); ; ; ; integer :: integer, return; ; ; ; ; ; ; ; function = return; if (return > integer) then return end if; ; ; ; ; function = integer; ; end function end; ; ; ; end program reserved_01 lfortran-0.63.0/tests/reference/asr-max_01-415ceb0.json0000664000175000017500000000105115174404631022521 0ustar alastairalastair{ "basename": "asr-max_01-415ceb0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/max_01.f90", "infile_hash": "96c2be2ccab6e4a1ed29b0d707ac35303f33d40c3f1fd2aace27dc62", "outfile": null, "outfile_hash": null, "stdout": "asr-max_01-415ceb0.stdout", "stdout_hash": "d0125dcea7e87527d1213552b57b6fe239860e48ae6777cefb8824ae", "stderr": "asr-max_01-415ceb0.stderr", "stderr_hash": "1f989072f5c997289f323424f4c36e74085a65b04506fffae9cb88fa", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-substring_endidx-0f7e2c9.json0000664000175000017500000000075415174404631025034 0ustar alastairalastair{ "basename": "asr-substring_endidx-0f7e2c9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/substring_endidx.f90", "infile_hash": "822fddebe2c138bf6639648f87d91376999e080c3364c20e939b4b35", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-substring_endidx-0f7e2c9.stderr", "stderr_hash": "0364385c1f5a421621582c1588a156629243fa24183e1913f217c691", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-subroutine1-fdc40b3.stdout0000664000175000017500000000362715174404631024364 0ustar alastairalastair(TranslationUnit [(Subroutine g [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 x 1 () ) (DoLoop 0 () 0 i 1 10 () [(Assignment 0 x (* x i) () )] () () )] [] [] ) (Subroutine h [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 x 1 () ) (DoLoop 0 () 0 i 1 10 () [(Assignment 0 x (* i x) () )] () () )] [] [] )] ) lfortran-0.63.0/tests/reference/ast_f90-read1-a5fe5d5.json0000664000175000017500000000071715174404631023213 0ustar alastairalastair{ "basename": "ast_f90-read1-a5fe5d5", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/read1.f90", "infile_hash": "a8601ffbfb4ea0a84892d205a776a40b585951d3e69794b2b29d399a", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-read1-a5fe5d5.stdout", "stdout_hash": "d21ac25095b1858a691f3256d5fe45e74fb0d90dec0a928044d0d1dd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_14-302666f.json0000664000175000017500000000076115174404631024005 0ustar alastairalastair{ "basename": "asr-intrinsics_14-302666f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_14.f90", "infile_hash": "0017e2b1ddd0667501a325653a7ff399ca299155a4493562918f53e9", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_14-302666f.stdout", "stdout_hash": "eadbf9539f13c5071bd36a8a00e92331db9b590269d6d3f23801da17", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_02_transfer-1bcc806.json0000664000175000017500000000077515174404631024776 0ustar alastairalastair{ "basename": "asr-array_02_transfer-1bcc806", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/array_02_transfer.f90", "infile_hash": "39a7e9746d898ab639aea38fe0e86585c820af2c036e57e4b1f1e556", "outfile": null, "outfile_hash": null, "stdout": "asr-array_02_transfer-1bcc806.stdout", "stdout_hash": "3f74752320f3efcf3ee083165c124f75ded02daa278447964840c6f1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_11-c169ea7.stdout0000664000175000017500000003202115174404631025171 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_11: (Module (SymbolTable 2 { 1_y_backslash: (ExternalSymbol 2 1_y_backslash 3 backslash y [] backslash Public ), type_y: (Variable 2 type_y [] Local (StructConstant 2 y [((StringConstant "\\" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (StructType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] [] .true. .false. ) ) (StructConstant 2 y [((StringConstant "\\" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (StructType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] [] .true. .false. ) ) Parameter (StructType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] [] .true. .false. ) 2 y Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [type_y] Local (IntrinsicElementalFunction StringConcat [(StringConstant "lf" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StructInstanceMember (Var 2 type_y) 2 1_y_backslash (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "\\" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] 0 (String 1 (IntegerConstant 3 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "lf\\" (String 1 (IntegerConstant 3 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "lf\\" (String 1 (IntegerConstant 3 (Integer 8) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Struct (SymbolTable 3 { backslash: (Variable 3 backslash [] Local (StringConstant "\\" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "\\" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) y (StructType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] [] .true. .false. ) [] [backslash] [] Source Public .false. .false. [] () () [] ) }) derived_types_11 () [] .false. .false. .false. ), main: (Program (SymbolTable 4 { 1_y_backslash: (ExternalSymbol 4 1_y_backslash 3 backslash y [] backslash Public ), type_y: (ExternalSymbol 4 type_y 2 type_y derived_types_11 [] type_y Public ), x: (ExternalSymbol 4 x 2 x derived_types_11 [] x Public ), y: (ExternalSymbol 4 y 2 y derived_types_11 [] y Public ) }) main [derived_types_11] [(If () (StringCompare (StructInstanceMember (Var 4 type_y) 4 1_y_backslash (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "\\" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) NotEq (StringConstant "\\" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (StringCompare (Var 4 x) NotEq (StringConstant "lf\\" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-case_02-a38c2d8.stdout0000664000175000017500000007264315174404631023436 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [10 x i8] c"Excellent!" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data, i32 0, i32 0), i64 10 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [10 x i8] c"Very good!" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data.1, i32 0, i32 0), i64 10 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.3 = private constant [10 x i8] c"Well done!" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data.3, i32 0, i32 0), i64 10 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.5 = private constant [8 x i8] c"Not bad!" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data.5, i32 0, i32 0), i64 8 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.7 = private constant [11 x i8] c"You passed!" @string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([11 x i8], [11 x i8]* @string_const_data.7, i32 0, i32 0), i64 11 }> @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.9 = private constant [17 x i8] c"Better try again!" @string_const.10 = private global %string_descriptor <{ i8* getelementptr inbounds ([17 x i8], [17 x i8]* @string_const_data.9, i32 0, i32 0), i64 17 }> @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.11 = private constant [13 x i8] c"Invalid marks" @string_const.12 = private global %string_descriptor <{ i8* getelementptr inbounds ([13 x i8], [13 x i8]* @string_const_data.11, i32 0, i32 0), i64 13 }> @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [13 x i8] c"S-DESC-15,I4\00", align 1 @string_const_data.13 = private constant [15 x i8] c"Your marks are " @string_const.14 = private global %string_descriptor <{ i8* getelementptr inbounds ([15 x i8], [15 x i8]* @string_const_data.13, i32 0, i32 0), i64 15 }> @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @17 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.15 = private constant [10 x i8] c"Excellent!" @string_const.16 = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data.15, i32 0, i32 0), i64 10 }> @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.17 = private constant [10 x i8] c"Very good!" @string_const.18 = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data.17, i32 0, i32 0), i64 10 }> @21 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.19 = private constant [10 x i8] c"Well done!" @string_const.20 = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data.19, i32 0, i32 0), i64 10 }> @23 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.21 = private constant [8 x i8] c"Not bad!" @string_const.22 = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data.21, i32 0, i32 0), i64 8 }> @25 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.23 = private constant [11 x i8] c"You passed!" @string_const.24 = private global %string_descriptor <{ i8* getelementptr inbounds ([11 x i8], [11 x i8]* @string_const_data.23, i32 0, i32 0), i64 11 }> @27 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @28 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.25 = private constant [17 x i8] c"Better try again!" @string_const.26 = private global %string_descriptor <{ i8* getelementptr inbounds ([17 x i8], [17 x i8]* @string_const_data.25, i32 0, i32 0), i64 17 }> @29 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.27 = private constant [13 x i8] c"Invalid marks" @string_const.28 = private global %string_descriptor <{ i8* getelementptr inbounds ([13 x i8], [13 x i8]* @string_const_data.27, i32 0, i32 0), i64 13 }> @31 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @32 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.29 = private unnamed_addr constant [13 x i8] c"S-DESC-15,I4\00", align 1 @string_const_data.30 = private constant [15 x i8] c"Your marks are " @string_const.31 = private global %string_descriptor <{ i8* getelementptr inbounds ([15 x i8], [15 x i8]* @string_const_data.30, i32 0, i32 0), i64 15 }> @33 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @34 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.32 = private constant [10 x i8] c"Excellent!" @string_const.33 = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data.32, i32 0, i32 0), i64 10 }> @35 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.34 = private constant [10 x i8] c"Very good!" @string_const.35 = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data.34, i32 0, i32 0), i64 10 }> @37 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.36 = private constant [10 x i8] c"Well done!" @string_const.37 = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data.36, i32 0, i32 0), i64 10 }> @39 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @40 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.38 = private constant [8 x i8] c"Not bad!" @string_const.39 = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data.38, i32 0, i32 0), i64 8 }> @41 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.40 = private constant [11 x i8] c"You passed!" @string_const.41 = private global %string_descriptor <{ i8* getelementptr inbounds ([11 x i8], [11 x i8]* @string_const_data.40, i32 0, i32 0), i64 11 }> @43 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @44 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.42 = private constant [17 x i8] c"Better try again!" @string_const.43 = private global %string_descriptor <{ i8* getelementptr inbounds ([17 x i8], [17 x i8]* @string_const_data.42, i32 0, i32 0), i64 17 }> @45 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @46 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.44 = private constant [13 x i8] c"Invalid marks" @string_const.45 = private global %string_descriptor <{ i8* getelementptr inbounds ([13 x i8], [13 x i8]* @string_const_data.44, i32 0, i32 0), i64 13 }> @47 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @48 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.46 = private unnamed_addr constant [13 x i8] c"S-DESC-15,I4\00", align 1 @string_const_data.47 = private constant [15 x i8] c"Your marks are " @string_const.48 = private global %string_descriptor <{ i8* getelementptr inbounds ([15 x i8], [15 x i8]* @string_const_data.47, i32 0, i32 0), i64 15 }> @49 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc58 = alloca %string_descriptor, align 8 %stringFormat_desc37 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %marks = alloca i32, align 4 %out = alloca i32, align 4 store i32 81, i32* %marks, align 4 %3 = load i32, i32* %marks, align 4 %4 = icmp sle i32 91, %3 %5 = load i32, i32* %marks, align 4 %6 = icmp sle i32 %5, 100 %7 = and i1 %4, %6 br i1 %7, label %then, label %else then: ; preds = %.entry store i32 0, i32* %out, align 4 %8 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %ifcont15 else: ; preds = %.entry %9 = load i32, i32* %marks, align 4 %10 = icmp sle i32 81, %9 %11 = load i32, i32* %marks, align 4 %12 = icmp sle i32 %11, 90 %13 = and i1 %10, %12 br i1 %13, label %then1, label %else2 then1: ; preds = %else store i32 1, i32* %out, align 4 %14 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %14, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) br label %ifcont14 else2: ; preds = %else %15 = load i32, i32* %marks, align 4 %16 = icmp sle i32 71, %15 %17 = load i32, i32* %marks, align 4 %18 = icmp sle i32 %17, 80 %19 = and i1 %16, %18 br i1 %19, label %then3, label %else4 then3: ; preds = %else2 store i32 2, i32* %out, align 4 %20 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %20, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) br label %ifcont13 else4: ; preds = %else2 %21 = load i32, i32* %marks, align 4 %22 = icmp sle i32 61, %21 %23 = load i32, i32* %marks, align 4 %24 = icmp sle i32 %23, 70 %25 = and i1 %22, %24 br i1 %25, label %then5, label %else6 then5: ; preds = %else4 store i32 3, i32* %out, align 4 %26 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.6, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %26, i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) br label %ifcont12 else6: ; preds = %else4 %27 = load i32, i32* %marks, align 4 %28 = icmp sle i32 41, %27 %29 = load i32, i32* %marks, align 4 %30 = icmp sle i32 %29, 60 %31 = and i1 %28, %30 br i1 %31, label %then7, label %else8 then7: ; preds = %else6 store i32 4, i32* %out, align 4 %32 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.8, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %32, i32 11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) br label %ifcont11 else8: ; preds = %else6 %33 = load i32, i32* %marks, align 4 %34 = icmp sle i32 %33, 40 br i1 %34, label %then9, label %else10 then9: ; preds = %else8 store i32 5, i32* %out, align 4 %35 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.10, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %35, i32 17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) br label %ifcont else10: ; preds = %else8 store i32 6, i32* %out, align 4 %36 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.12, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %36, i32 13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) br label %ifcont ifcont: ; preds = %else10, %then9 br label %ifcont11 ifcont11: ; preds = %ifcont, %then7 br label %ifcont12 ifcont12: ; preds = %ifcont11, %then5 br label %ifcont13 ifcont13: ; preds = %ifcont12, %then3 br label %ifcont14 ifcont14: ; preds = %ifcont13, %then1 br label %ifcont15 ifcont15: ; preds = %ifcont14, %then %37 = alloca i64, align 8 %38 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info, i32 0, i32 0), i64* %37, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.14, i32* %marks) %39 = load i64, i64* %37, align 8 %40 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %38, i8** %40, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %39, i64* %41, align 8 %42 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %43 = load i8*, i8** %42, align 8 %44 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %45 = load i64, i64* %44, align 8 %46 = trunc i64 %45 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* %43, i32 %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 1) %47 = icmp eq i8* %38, null br i1 %47, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont15 call void @_lfortran_free_alloc(i8* %2, i8* %38) br label %free_done free_done: ; preds = %free_nonnull, %ifcont15 %48 = load i32, i32* %out, align 4 %49 = icmp ne i32 %48, 1 br i1 %49, label %then16, label %else17 then16: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont18 else17: ; preds = %free_done br label %ifcont18 ifcont18: ; preds = %else17, %then16 %50 = load i32, i32* %marks, align 4 %51 = icmp sle i32 91, %50 %52 = load i32, i32* %marks, align 4 %53 = icmp sle i32 %52, 100 %54 = and i1 %51, %53 br i1 %54, label %then19, label %else20 then19: ; preds = %ifcont18 %55 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.16, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* %55, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0), i32 1) br label %ifcont36 else20: ; preds = %ifcont18 %56 = load i32, i32* %marks, align 4 %57 = icmp sle i32 81, %56 %58 = load i32, i32* %marks, align 4 %59 = icmp sle i32 %58, 90 %60 = and i1 %57, %59 br i1 %60, label %then21, label %else22 then21: ; preds = %else20 %61 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.18, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @21, i32 0, i32 0), i8* %61, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0), i32 1) br label %ifcont35 else22: ; preds = %else20 %62 = load i32, i32* %marks, align 4 %63 = icmp sle i32 71, %62 %64 = load i32, i32* %marks, align 4 %65 = icmp sle i32 %64, 80 %66 = and i1 %63, %65 br i1 %66, label %then23, label %else24 then23: ; preds = %else22 %67 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.20, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @23, i32 0, i32 0), i8* %67, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0), i32 1) br label %ifcont34 else24: ; preds = %else22 %68 = load i32, i32* %marks, align 4 %69 = icmp sle i32 61, %68 %70 = load i32, i32* %marks, align 4 %71 = icmp sle i32 %70, 70 %72 = and i1 %69, %71 br i1 %72, label %then25, label %else26 then25: ; preds = %else24 %73 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.22, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @25, i32 0, i32 0), i8* %73, i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0), i32 1) br label %ifcont33 else26: ; preds = %else24 %74 = load i32, i32* %marks, align 4 %75 = icmp sle i32 41, %74 %76 = load i32, i32* %marks, align 4 %77 = icmp sle i32 %76, 60 %78 = and i1 %75, %77 br i1 %78, label %then27, label %else28 then27: ; preds = %else26 %79 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.24, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @27, i32 0, i32 0), i8* %79, i32 11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0), i32 1) br label %ifcont32 else28: ; preds = %else26 %80 = load i32, i32* %marks, align 4 %81 = icmp sle i32 %80, 40 br i1 %81, label %then29, label %else30 then29: ; preds = %else28 %82 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.26, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @29, i32 0, i32 0), i8* %82, i32 17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @28, i32 0, i32 0), i32 1) br label %ifcont31 else30: ; preds = %else28 %83 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.28, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @31, i32 0, i32 0), i8* %83, i32 13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0), i32 1) br label %ifcont31 ifcont31: ; preds = %else30, %then29 br label %ifcont32 ifcont32: ; preds = %ifcont31, %then27 br label %ifcont33 ifcont33: ; preds = %ifcont32, %then25 br label %ifcont34 ifcont34: ; preds = %ifcont33, %then23 br label %ifcont35 ifcont35: ; preds = %ifcont34, %then21 br label %ifcont36 ifcont36: ; preds = %ifcont35, %then19 %84 = alloca i64, align 8 %85 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info.29, i32 0, i32 0), i64* %84, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.31, i32* %marks) %86 = load i64, i64* %84, align 8 %87 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc37, i32 0, i32 0 store i8* %85, i8** %87, align 8 %88 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc37, i32 0, i32 1 store i64 %86, i64* %88, align 8 %89 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc37, i32 0, i32 0 %90 = load i8*, i8** %89, align 8 %91 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc37, i32 0, i32 1 %92 = load i64, i64* %91, align 8 %93 = trunc i64 %92 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @33, i32 0, i32 0), i8* %90, i32 %93, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @32, i32 0, i32 0), i32 1) %94 = icmp eq i8* %85, null br i1 %94, label %free_done39, label %free_nonnull38 free_nonnull38: ; preds = %ifcont36 call void @_lfortran_free_alloc(i8* %2, i8* %85) br label %free_done39 free_done39: ; preds = %free_nonnull38, %ifcont36 %95 = load i32, i32* %marks, align 4 %96 = icmp sle i32 91, %95 %97 = load i32, i32* %marks, align 4 %98 = icmp sle i32 %97, 100 %99 = and i1 %96, %98 br i1 %99, label %then40, label %else41 then40: ; preds = %free_done39 %100 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.33, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @35, i32 0, i32 0), i8* %100, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @34, i32 0, i32 0), i32 1) br label %ifcont57 else41: ; preds = %free_done39 %101 = load i32, i32* %marks, align 4 %102 = icmp sle i32 81, %101 %103 = load i32, i32* %marks, align 4 %104 = icmp sle i32 %103, 90 %105 = and i1 %102, %104 br i1 %105, label %then42, label %else43 then42: ; preds = %else41 %106 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.35, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @37, i32 0, i32 0), i8* %106, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0), i32 1) br label %ifcont56 else43: ; preds = %else41 %107 = load i32, i32* %marks, align 4 %108 = icmp sle i32 71, %107 %109 = load i32, i32* %marks, align 4 %110 = icmp sle i32 %109, 80 %111 = and i1 %108, %110 br i1 %111, label %then44, label %else45 then44: ; preds = %else43 %112 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.37, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @39, i32 0, i32 0), i8* %112, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0), i32 1) br label %ifcont55 else45: ; preds = %else43 %113 = load i32, i32* %marks, align 4 %114 = icmp sle i32 61, %113 %115 = load i32, i32* %marks, align 4 %116 = icmp sle i32 %115, 70 %117 = and i1 %114, %116 br i1 %117, label %then46, label %else47 then46: ; preds = %else45 %118 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.39, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @41, i32 0, i32 0), i8* %118, i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @40, i32 0, i32 0), i32 1) br label %ifcont54 else47: ; preds = %else45 %119 = load i32, i32* %marks, align 4 %120 = icmp sle i32 41, %119 %121 = load i32, i32* %marks, align 4 %122 = icmp sle i32 %121, 60 %123 = and i1 %120, %122 br i1 %123, label %then48, label %else49 then48: ; preds = %else47 %124 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.41, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @43, i32 0, i32 0), i8* %124, i32 11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0), i32 1) br label %ifcont53 else49: ; preds = %else47 %125 = load i32, i32* %marks, align 4 %126 = icmp sle i32 %125, 40 br i1 %126, label %then50, label %else51 then50: ; preds = %else49 %127 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.43, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @45, i32 0, i32 0), i8* %127, i32 17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @44, i32 0, i32 0), i32 1) br label %ifcont52 else51: ; preds = %else49 %128 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.45, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @47, i32 0, i32 0), i8* %128, i32 13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @46, i32 0, i32 0), i32 1) br label %ifcont52 ifcont52: ; preds = %else51, %then50 br label %ifcont53 ifcont53: ; preds = %ifcont52, %then48 br label %ifcont54 ifcont54: ; preds = %ifcont53, %then46 br label %ifcont55 ifcont55: ; preds = %ifcont54, %then44 br label %ifcont56 ifcont56: ; preds = %ifcont55, %then42 br label %ifcont57 ifcont57: ; preds = %ifcont56, %then40 %129 = alloca i64, align 8 %130 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info.46, i32 0, i32 0), i64* %129, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.48, i32* %marks) %131 = load i64, i64* %129, align 8 %132 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc58, i32 0, i32 0 store i8* %130, i8** %132, align 8 %133 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc58, i32 0, i32 1 store i64 %131, i64* %133, align 8 %134 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc58, i32 0, i32 0 %135 = load i8*, i8** %134, align 8 %136 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc58, i32 0, i32 1 %137 = load i64, i64* %136, align 8 %138 = trunc i64 %137 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @49, i32 0, i32 0), i8* %135, i32 %138, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @48, i32 0, i32 0), i32 1) %139 = icmp eq i8* %130, null br i1 %139, label %free_done60, label %free_nonnull59 free_nonnull59: ; preds = %ifcont57 call void @_lfortran_free_alloc(i8* %2, i8* %130) br label %free_done60 free_done60: ; preds = %free_nonnull59, %ifcont57 br label %return return: ; preds = %free_done60 br label %FINALIZE_SYMTABLE_case_02 FINALIZE_SYMTABLE_case_02: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) lfortran-0.63.0/tests/reference/asr-string_17-29e01e3.stdout0000664000175000017500000005072315174404631023561 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_17_string_module: (Module (SymbolTable 2 { len: (GenericProcedure 2 len [2 len_string] Public ), len_string: (Function (SymbolTable 4 { 1_string_type_raw: (ExternalSymbol 4 1_string_type_raw 3 raw string_type [] raw Public ), length: (Variable 4 length [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 4 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) len_string (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (Integer 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 4 string)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 4 string) 4 1_string_type_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(Assignment (Var 4 length) (StringLen (StructInstanceMember (Var 4 string) 4 1_string_type_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Integer 4) () ) () .false. .false. )] [(Assignment (Var 4 length) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] )] (Var 4 length) Public .true. .true. () ), maybe: (Function (SymbolTable 5 { 1_string_type_raw: (ExternalSymbol 5 1_string_type_raw 3 raw string_type [] raw Public ), maybe_string: (Variable 5 maybe_string [len_string string] ReturnVar () () Default (String 1 (FunctionCall 2 len_string 2 len [((Var 5 string))] (Integer 4) () () ) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 5 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) maybe (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (String 1 (FunctionCall 2 len_string 2 len [((FunctionParam 0 (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) () ))] (Integer 4) () () ) ExpressionLength DescriptorString) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [len_string] [(Var 5 string)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 5 string) 5 1_string_type_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(Assignment (Var 5 maybe_string) (StructInstanceMember (Var 5 string) 5 1_string_type_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) () .false. .false. )] [(Assignment (Var 5 maybe_string) (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. )] )] (Var 5 maybe_string) Public .true. .true. () ), string_type: (Struct (SymbolTable 3 { raw: (Variable 3 raw [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_type (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [raw] [] Source Private .false. .false. [] () () [] ) }) string_17_string_module () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-operator_overloading_01-9ec8e71.stderr0000664000175000017500000000027415174404631026542 0ustar alastairalastairstyle suggestion: Use 'end if' instead of 'endif' --> tests/../integration_tests/operator_overloading_01.f90:28:9 | 28 | endif | ^^^^^ help: write this as 'end if' lfortran-0.63.0/tests/reference/ast-end_function_name_not_match-92ee1a1.json0000664000175000017500000000101515174404631027151 0ustar alastairalastair{ "basename": "ast-end_function_name_not_match-92ee1a1", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/end_function_name_not_match.f90", "infile_hash": "ed621e4ffbbbee94623f8abf5905f7f11b268363b61d47ff11f9e71e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-end_function_name_not_match-92ee1a1.stderr", "stderr_hash": "55a956b2feb6a8f68ece932ff14efd3e402ce9c3105c27e31c6715b5", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-modules_06-609dd30.stdout0000664000175000017500000001416215174404631023717 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_06: (Program (SymbolTable 4 { b: (ExternalSymbol 4 b 2 b modules_06_a [] b Public ), i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) modules_06 [modules_06_a] [(Assignment (Var 4 i) (FunctionCall 4 b () [] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 4 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), modules_06_a: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { r: (Variable 3 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) b (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "b()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Assignment (Var 3 r) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. )] (Var 3 r) Public .false. .false. () ) }) modules_06_a () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-multi_error1-ed395f9.stderr0000664000175000017500000000075315174404631024447 0ustar alastairalastairsyntax error: Newline is unexpected here --> tests/multi_error1.f90:3:15 | 3 | integer :: x = | ^ syntax error: Newline is unexpected here --> tests/multi_error1.f90:5:15 | 5 | integer :: y = | ^ syntax error: Newline is unexpected here --> tests/multi_error1.f90:6:13 | 6 | print *, x + | ^ syntax error: Token 'y' (of type 'identifier') is unexpected here --> tests/multi_error1.f90:7:12 | 7 | print *, x y | ^ lfortran-0.63.0/tests/reference/wat-types_16-57fa580.stdout0000664000175000017500000002244215174404631023430 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param f32 f32) (result f32))) (type (;3;) (func (param f64) (result f64))) (type (;4;) (func (param) (result f32))) (type (;5;) (func (param) (result f32))) (type (;6;) (func (param) (result f64))) (type (;7;) (func (param f64) (result f64))) (type (;8;) (func (param) (result))) (type (;9;) (func (param i64) (result))) (type (;10;) (func (param f64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param f32 f32) (result f32) (local f32) local.get 0 local.get 1 f32.add local.set 2 local.get 2 return ) (func $3 (type 3) (param f64) (result f64) (local f64 f64) call 6 local.set 2 local.get 2 local.get 0 call 7 f64.mul local.set 1 local.get 1 return ) (func $4 (type 4) (param) (result f32) (local f32) f32.const -2.500000 local.set 0 local.get 0 return ) (func $5 (type 5) (param) (result f32) (local f32) f32.const 3.140000 local.set 0 local.get 0 return ) (func $6 (type 6) (param) (result f64) (local f64) f64.const 3.140000 local.set 0 local.get 0 return ) (func $7 (type 7) (param f64) (result f64) (local f64) local.get 0 local.get 0 f64.mul local.set 1 local.get 1 return ) (func $8 (type 8) (param) (result) (local i32) i32.const 8 local.set 0 f32.const -2.300000 f32.const 5.600000 call 2 f64.promote_f32 call 10 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop call 4 f64.promote_f32 call 10 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop call 5 f64.promote_f32 call 10 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop call 6 call 10 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop f64.const 5.000000 call 3 call 10 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $9 (type 9) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (func $10 (type 10) (param f64) (result) (local i64 i64 i64) local.get 0 f64.const 0.000000 f64.lt if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 f64.const -1.000000 f64.mul local.set 0 else end local.get 0 i64.trunc_f64_s call 9 i32.const 1 i32.const 40 i32.const 1 i32.const 0 call 1 drop local.get 0 local.get 0 i64.trunc_f64_s f64.convert_i64_s f64.sub f64.const 100000000.000000 f64.mul i64.trunc_f64_s local.set 2 local.get 2 local.set 3 i64.const 0 local.set 1 loop local.get 2 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 2 f64.convert_i64_s i64.const 10 f64.convert_i64_s f64.div i64.trunc_f64_s local.set 2 br 1 else end end loop local.get 1 i64.const 8 i64.lt_s if local.get 1 i64.const 1 i64.add local.set 1 i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop br 1 else end end local.get 3 call 9 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "add_floats" (func 2)) (export "computecirclearea" (func 3)) (export "get_neg_f32" (func 4)) (export "get_pi" (func 5)) (export "get_pi_64" (func 6)) (export "sqr" (func 7)) (export "_start" (func 8)) (export "print_i64" (func 9)) (export "print_f64" (func 10)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-0.63.0/tests/reference/asr-external_02-ab2b90d.json0000664000175000017500000000077515174404631023653 0ustar alastairalastair{ "basename": "asr-external_02-ab2b90d", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/external_02.f90", "infile_hash": "229cee9d64d77be22b3786ec7d91c285922a45bcd94b40f9d7e0d2b9", "outfile": null, "outfile_hash": null, "stdout": "asr-external_02-ab2b90d.stdout", "stdout_hash": "5b382631e6a76b2da5d9e1a0ac396c919728cb0d8017f68d36d768b6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-subroutines_21-82bc946.json0000664000175000017500000000076415174404631024270 0ustar alastairalastair{ "basename": "asr-subroutines_21-82bc946", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_21.f90", "infile_hash": "04fe1a30f170cbe03d1dd125f1d902a80d04bc36fff09c85ffb32868", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-subroutines_21-82bc946.stderr", "stderr_hash": "0f4d9fa597409c496dd060d39082e2d9d6bd065f0323432c0b05fc66", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-constant_kinds-b9382b6.stdout0000664000175000017500000003457315174404631025001 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { constant_kinds: (Program (SymbolTable 2 { i1: (Variable 2 i1 [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i2: (Variable 2 i2 [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i3: (Variable 2 i3 [] Local (Cast (IntegerConstant 1 (Integer 8) Decimal) IntegerToInteger (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) () ) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r1: (Variable 2 r1 [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r2: (Variable 2 r2 [] Local (Cast (RealConstant 1.000000 (Real 8) ) RealToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r3: (Variable 2 r3 [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r4: (Variable 2 r4 [] Local (Cast (RealConstant 1.000000 (Real 8) ) RealToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) constant_kinds [] [(Assignment (Var 2 y) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 y) (Cast (RealConstant 1.000000 (Real 8) ) RealToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 y) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 y) (Cast (RealConstant 1.000000 (Real 8) ) RealToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (Cast (IntegerConstant 1 (Integer 8) Decimal) IntegerToInteger (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) () ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_nested-5858841.stdout0000664000175000017500000022071615174404631025000 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_nested: (Program (SymbolTable 12 { add_t: (ExternalSymbol 12 add_t 2 add_t template_nested_m [] add_t Public ), r: (ExternalSymbol 12 r 2 r template_nested_m [] r Public ), test_template: (ExternalSymbol 12 test_template 2 test_template template_nested_m [] test_template Public ) }) template_nested [template_nested_m] [(SubroutineCall 12 test_template () [] () .false. )] ), template_nested_m: (Module (SymbolTable 2 { add_t: (Template (SymbolTable 5 { add_generic: (Function (SymbolTable 7 { x: (Variable 7 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 7 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 7 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_generic (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 7 x) (Var 7 y)] [(Assignment (Var 7 z) (FunctionCall 5 f () [((Var 7 x)) ((Var 7 y))] (TypeParameter t ) () () ) () .false. .false. )] (Var 7 z) Public .true. .true. () ), call_add_generic: (Function (SymbolTable 8 { x: (Variable 8 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 8 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 8 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) call_add_generic (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [add_generic] [(Var 8 x) (Var 8 y)] [(Assignment (Var 8 z) (FunctionCall 5 add_generic () [((Var 8 x)) ((Var 8 y))] (TypeParameter t ) () () ) () .false. .false. )] (Var 8 z) Private .true. .true. () ), f: (Function (SymbolTable 6 { x: (Variable 6 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 6 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 6 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 6 x) (Var 6 y)] [] (Var 6 z) Private .true. .true. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_t [t f] [(Require r [t f] )] ), func_arg_real: (Function (SymbolTable 9 { x: (Variable 9 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 9 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 9 z [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) func_arg_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 x) (Var 9 y)] [(Assignment (Var 9 z) (RealBinOp (Var 9 x) Add (Var 9 y) (Real 4) () ) () .false. .false. )] (Var 9 z) Private .true. .true. () ), r: (Requirement (SymbolTable 3 { f: (Function (SymbolTable 4 { x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 4 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 z) Private .true. .true. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) r [t f] [] ), test_template: (Function (SymbolTable 10 { __asr_add_generic: (Function (SymbolTable 13 { x: (Variable 13 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 13 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 13 z [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __asr_add_generic (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [func_arg_real] [(Var 13 x) (Var 13 y)] [(Assignment (Var 13 z) (FunctionCall 2 func_arg_real () [((Var 13 x)) ((Var 13 y))] (Real 4) () () ) () .false. .false. )] (Var 13 z) Public .true. .true. () ), a: (Variable 10 a [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), add_real: (Function (SymbolTable 11 { x: (Variable 11 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 11 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 11 z [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [__asr_add_generic] [(Var 11 x) (Var 11 y)] [(Assignment (Var 11 z) (FunctionCall 10 __asr_add_generic () [((Var 11 x)) ((Var 11 y))] (Real 4) () () ) () .false. .false. )] (Var 11 z) Private .true. .true. () ), b: (Variable 10 b [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 10 x [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 10 y [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 10 x) (RealConstant 5.100000 (Real 4) ) () .false. .false. ) (Assignment (Var 10 y) (RealConstant 7.200000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "The result is " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 10 add_real () [((Var 10 x)) ((Var 10 y))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (FunctionCall 10 add_real () [((Var 10 x)) ((Var 10 y))] (Real 4) () () ) Sub (RealConstant 12.300000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] () Public .false. .false. () ) }) template_nested_m () [template_nested_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-implicit2-d78b357.stderr0000664000175000017500000000026115174404631023624 0ustar alastairalastairsemantic error: Implicit typing is not allowed, enable it by using --implicit-typing --> tests/implicit2.f90:2:1 | 2 | implicit real (a,b,c,d) | ^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/llvm-global_scope5-688b5a0.json0000664000175000017500000000073715174404631024303 0ustar alastairalastair{ "basename": "llvm-global_scope5-688b5a0", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/global_scope5.f90", "infile_hash": "63e512d3fe5d83aa6195002b9c31ddc77e1a93ac37df38989f782ed7", "outfile": null, "outfile_hash": null, "stdout": "llvm-global_scope5-688b5a0.stdout", "stdout_hash": "e653139ebfa6e172da0b75425f42ce70d0f0671c3fd5ec8a8f98d190", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-complex_div_test-21dab13.json0000664000175000017500000000077215174404631025007 0ustar alastairalastair{ "basename": "asr-complex_div_test-21dab13", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_div_test.f90", "infile_hash": "0bbb7100f12786a5fc5022ab6cfd9f97cc6ede016ed0bdab03eda670", "outfile": null, "outfile_hash": null, "stdout": "asr-complex_div_test-21dab13.stdout", "stdout_hash": "8c3dd2ff51f194bbe7b2227b9bd186f773fb715bc8c7ef47d5b5be2b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-bits_03-c7d2024.stdout0000664000175000017500000004550015174404631023201 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bits_03: (Program (SymbolTable 2 { from: (Variable 2 from [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), from8: (Variable 2 from8 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), to: (Variable 2 to [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), to8: (Variable 2 to8 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) bits_03 [] [(Assignment (Var 2 from) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 to) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 from8) (IntegerConstant 10 (Integer 8) Decimal) () .false. .false. ) (Assignment (Var 2 to8) (IntegerConstant 4 (Integer 8) Decimal) () .false. .false. ) (IntrinsicImpureSubroutine Mvbits [(Var 2 from) (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Var 2 to) (IntegerConstant 0 (Integer 4) Decimal)] 0 ) (If () (IntegerCompare (Var 2 from) NotEq (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 to) NotEq (IntegerConstant 6 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (IntrinsicImpureSubroutine Mvbits [(Var 2 from8) (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Var 2 to8) (IntegerConstant 0 (Integer 4) Decimal)] 0 ) (If () (IntegerCompare (Var 2 from8) NotEq (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 10 (Integer 8) Decimal) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 to8) NotEq (IntegerConstant 6 (Integer 8) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (IntrinsicImpureSubroutine Mvbits [(Var 2 from) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Var 2 to) (IntegerConstant 2 (Integer 4) Decimal)] 0 ) (If () (IntegerCompare (Var 2 from) NotEq (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 to) NotEq (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (IntrinsicImpureSubroutine Mvbits [(Var 2 from8) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Var 2 to8) (IntegerConstant 2 (Integer 4) Decimal)] 0 ) (If () (IntegerCompare (Var 2 from8) NotEq (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 10 (Integer 8) Decimal) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 to8) NotEq (IntegerConstant 10 (Integer 8) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 from) (IntegerUnaryMinus (IntegerConstant 20 (Integer 4) Decimal) (Integer 4) (IntegerConstant -20 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 to) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 from8) (IntegerUnaryMinus (IntegerConstant 20 (Integer 8) Decimal) (Integer 8) (IntegerConstant -20 (Integer 8) Decimal) ) () .false. .false. ) (Assignment (Var 2 to8) (IntegerConstant 4 (Integer 8) Decimal) () .false. .false. ) (IntrinsicImpureSubroutine Mvbits [(Var 2 from) (IntegerConstant 29 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Var 2 to) (IntegerConstant 2 (Integer 4) Decimal)] 0 ) (If () (IntegerCompare (Var 2 from) NotEq (IntegerUnaryMinus (IntegerConstant 20 (Integer 4) Decimal) (Integer 4) (IntegerConstant -20 (Integer 4) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 to) NotEq (IntegerConstant 12 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (IntrinsicImpureSubroutine Mvbits [(Var 2 from8) (IntegerConstant 29 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Var 2 to8) (IntegerConstant 2 (Integer 4) Decimal)] 0 ) (If () (IntegerCompare (Var 2 from8) NotEq (Cast (IntegerUnaryMinus (IntegerConstant 20 (Integer 4) Decimal) (Integer 4) (IntegerConstant -20 (Integer 4) Decimal) ) IntegerToInteger (Integer 8) (IntegerConstant -20 (Integer 8) Decimal) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 to8) NotEq (IntegerConstant 12 (Integer 8) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (IntrinsicImpureSubroutine Mvbits [(Var 2 from) (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Var 2 to) (IntegerConstant 29 (Integer 4) Decimal)] 0 ) (If () (IntegerCompare (Var 2 from) NotEq (IntegerUnaryMinus (IntegerConstant 20 (Integer 4) Decimal) (Integer 4) (IntegerConstant -20 (Integer 4) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 to) NotEq (IntegerConstant 1610612748 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (IntrinsicImpureSubroutine Mvbits [(Var 2 from8) (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Var 2 to8) (IntegerConstant 29 (Integer 4) Decimal)] 0 ) (If () (IntegerCompare (Var 2 from8) NotEq (Cast (IntegerUnaryMinus (IntegerConstant 20 (Integer 4) Decimal) (Integer 4) (IntegerConstant -20 (Integer 4) Decimal) ) IntegerToInteger (Integer 8) (IntegerConstant -20 (Integer 8) Decimal) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 to8) NotEq (IntegerConstant 1610612748 (Integer 8) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/run-array_bounds_check_02-3ebca53.stderr0000664000175000017500000000050115174404631026214 0ustar alastairalastairruntime error: Array shape mismatch in assignment to 'y'. Tried to match size 4 of dimension 1 of LHS with size 3 of dimension 1 of RHS. --> tests/errors/array_bounds_check_02.f90:11:9 | 11 | y = [1, 2, 3] | ^ LHS size is 4 | 11 | y = [1, 2, 3] | ^^^^^^^^^ RHS size is 3 lfortran-0.63.0/tests/reference/asr-external1-e4cf9f2.json0000664000175000017500000000072715174404631023447 0ustar alastairalastair{ "basename": "asr-external1-e4cf9f2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/external1.f90", "infile_hash": "9a5c10d0c66199b1b204cf09800f3d42e148bbab537f5a633773a951", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-external1-e4cf9f2.stderr", "stderr_hash": "737052a65c4800908a370339dc8f81c9bd214d0f5bd40545ada41b35", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-interface_04-9570e2b.stdout0000664000175000017500000001764215174404631024217 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { interface_04: (Program (SymbolTable 5 { a: (GenericProcedure 5 a [5 a1@a] Public ), a1@a: (ExternalSymbol 5 a1@a 2 a1 interface_04_mod1 [] a1 Public ), i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) interface_04 [interface_04_mod2 interface_04_mod1] [(Assignment (Var 5 i) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 5 a1@a 5 a [((Var 5 i))] () .false. ) (If () (IntegerCompare (Var 5 i) NotEq (IntegerConstant 6 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), interface_04_mod1: (Module (SymbolTable 2 { a: (GenericProcedure 2 a [2 a1] Public ), a1: (Function (SymbolTable 3 { a: (Variable 3 a [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a1 (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Assignment (Var 3 a) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ) }) interface_04_mod1 () [] .false. .false. .false. ), interface_04_mod2: (Module (SymbolTable 4 { a: (ExternalSymbol 4 a 2 a interface_04_mod1 [] a Public ), a1: (ExternalSymbol 4 a1 2 a1 interface_04_mod1 [] a1 Public ) }) interface_04_mod2 () [interface_04_mod1] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-expr8-613d1f3.stdout0000664000175000017500000000033515174404631023463 0ustar alastairalastairi = 123 j = 123456789824390874092509458720948720947502984752098457242092870987 k = 2*18446744073709551616 i = 123_i8 j = 123456789824390874092509458720948720947502984752098457242092870987_i8 k = 2*18446744073709551616_i8 lfortran-0.63.0/tests/reference/asr-fixed_form_simple_continue-1cd55c6.json0000664000175000017500000000101615174404631027043 0ustar alastairalastair{ "basename": "asr-fixed_form_simple_continue-1cd55c6", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_simple_continue.f", "infile_hash": "3568a4d42a544d5d2bee64f245d7408d7dc0ff795fba79436c728937", "outfile": null, "outfile_hash": null, "stdout": "asr-fixed_form_simple_continue-1cd55c6.stdout", "stdout_hash": "e85c13ea23fe836b62dbb2a6c830735a74165d3cce70f650e7fd2b69", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-rewind_inquire_flush-72b7f97.json0000664000175000017500000000100615174404631025625 0ustar alastairalastair{ "basename": "asr-rewind_inquire_flush-72b7f97", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/rewind_inquire_flush.f90", "infile_hash": "8a55dc820362b5ab028d6f06d1edc7476b8b0f03a76e7d87655825ad", "outfile": null, "outfile_hash": null, "stdout": "asr-rewind_inquire_flush-72b7f97.stdout", "stdout_hash": "73c246b1918a90a7e5ad2c1a8e333726c8396fde98d186b56641df5e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-arrays_01-91893af.stdout0000664000175000017500000026167515174404631023760 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." @0 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @1 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @2 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @3 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @5 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @6 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @7 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @11 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @12 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @13 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @17 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @18 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @19 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @21 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @23 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @24 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @25 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @27 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @28 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @29 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @31 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @32 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @33 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @34 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @35 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @37 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @39 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @40 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @41 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @43 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @44 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @45 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @46 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @47 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @48 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @49 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @50 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @51 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @52 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @53 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @54 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @55 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @56 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @57 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @58 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @59 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @60 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @61 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @62 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @63 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @64 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @65 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @66 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @67 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @68 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @69 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @70 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @71 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @72 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @73 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @74 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @75 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @76 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @77 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @78 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @79 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @80 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @81 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @82 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @83 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @84 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @85 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @86 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @87 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @88 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @89 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @90 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @91 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @92 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @93 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @94 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @95 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @96 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @97 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @98 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @99 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @100 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @101 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @102 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @103 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @104 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @105 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @106 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @107 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @108 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @109 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @110 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @111 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/arrays_01.f90\00", align 1 @112 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @113 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @114 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @115 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca [3 x i32], align 4 %b = alloca [4 x i32], align 4 %i = alloca i32, align 4 store i32 0, i32* %i, align 4 br label %loop.head loop.head: ; preds = %ifcont, %.entry %3 = load i32, i32* %i, align 4 %4 = add i32 %3, 1 %5 = icmp sle i32 %4, 3 br i1 %5, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %6 = load i32, i32* %i, align 4 %7 = add i32 %6, 1 store i32 %7, i32* %i, align 4 %8 = load i32, i32* %i, align 4 %9 = sext i32 %8 to i64 %10 = sub i64 %9, 1 %11 = mul i64 1, %10 %12 = add i64 0, %11 %13 = icmp slt i64 %9, 1 %14 = icmp sgt i64 %9, 3 %15 = or i1 %13, %14 br i1 %15, label %then, label %ifcont then: ; preds = %loop.body %16 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %17 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %18 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %17, i32 0, i32 0 %19 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @1, i32 0, i32 0), i8** %19, align 8 %20 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 1 store i32 5, i32* %20, align 4 %21 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 2 store i32 5, i32* %21, align 4 %22 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 3 store i32 5, i32* %22, align 4 %23 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 4 store i32 8, i32* %23, align 4 %24 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @2, i32 0, i32 0)) %25 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %16, i32 0, i32 0 %26 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %17, i32 0, i32 0 %27 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %25, i32 0, i32 2 %28 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %25, i32 0, i32 0 store i1 true, i1* %28, align 1 %29 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %25, i32 0, i32 1 store i8* %24, i8** %29, align 8 store { i8*, i32, i32, i32, i32 }* %26, { i8*, i32, i32, i32, i32 }** %27, align 8 %30 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %25, i32 0, i32 3 store i32 1, i32* %30, align 4 %31 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %16, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %31, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i64 %9, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont: ; preds = %loop.body %32 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 %12 %33 = load i32, i32* %i, align 4 %34 = add i32 %33, 10 store i32 %34, i32* %32, align 4 br label %loop.head loop.end: ; preds = %loop.head br i1 false, label %then1, label %ifcont2 then1: ; preds = %loop.end %35 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %36 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %37 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %36, i32 0, i32 0 %38 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %37, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @5, i32 0, i32 0), i8** %38, align 8 %39 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %37, i32 0, i32 1 store i32 7, i32* %39, align 4 %40 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %37, i32 0, i32 2 store i32 5, i32* %40, align 4 %41 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %37, i32 0, i32 3 store i32 7, i32* %41, align 4 %42 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %37, i32 0, i32 4 store i32 8, i32* %42, align 4 %43 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @6, i32 0, i32 0)) %44 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %35, i32 0, i32 0 %45 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %36, i32 0, i32 0 %46 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %44, i32 0, i32 2 %47 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %44, i32 0, i32 0 store i1 true, i1* %47, align 1 %48 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %44, i32 0, i32 1 store i8* %43, i8** %48, align 8 store { i8*, i32, i32, i32, i32 }* %45, { i8*, i32, i32, i32, i32 }** %46, align 8 %49 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %44, i32 0, i32 3 store i32 1, i32* %49, align 4 %50 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %35, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %50, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i64 1, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont2: ; preds = %loop.end %51 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 0 %52 = load i32, i32* %51, align 4 %53 = icmp ne i32 %52, 11 br i1 %53, label %then3, label %else then3: ; preds = %ifcont2 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont4 else: ; preds = %ifcont2 br label %ifcont4 ifcont4: ; preds = %else, %then3 br i1 false, label %then5, label %ifcont6 then5: ; preds = %ifcont4 %54 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %55 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %56 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %55, i32 0, i32 0 %57 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %56, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @11, i32 0, i32 0), i8** %57, align 8 %58 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %56, i32 0, i32 1 store i32 8, i32* %58, align 4 %59 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %56, i32 0, i32 2 store i32 5, i32* %59, align 4 %60 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %56, i32 0, i32 3 store i32 8, i32* %60, align 4 %61 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %56, i32 0, i32 4 store i32 8, i32* %61, align 4 %62 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @12, i32 0, i32 0)) %63 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %54, i32 0, i32 0 %64 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %55, i32 0, i32 0 %65 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %63, i32 0, i32 2 %66 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %63, i32 0, i32 0 store i1 true, i1* %66, align 1 %67 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %63, i32 0, i32 1 store i8* %62, i8** %67, align 8 store { i8*, i32, i32, i32, i32 }* %64, { i8*, i32, i32, i32, i32 }** %65, align 8 %68 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %63, i32 0, i32 3 store i32 1, i32* %68, align 4 %69 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %54, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %69, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i64 2, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont6: ; preds = %ifcont4 %70 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 1 %71 = load i32, i32* %70, align 4 %72 = icmp ne i32 %71, 12 br i1 %72, label %then7, label %else8 then7: ; preds = %ifcont6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 br i1 false, label %then10, label %ifcont11 then10: ; preds = %ifcont9 %73 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %74 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %75 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %74, i32 0, i32 0 %76 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %75, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @17, i32 0, i32 0), i8** %76, align 8 %77 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %75, i32 0, i32 1 store i32 9, i32* %77, align 4 %78 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %75, i32 0, i32 2 store i32 5, i32* %78, align 4 %79 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %75, i32 0, i32 3 store i32 9, i32* %79, align 4 %80 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %75, i32 0, i32 4 store i32 8, i32* %80, align 4 %81 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @18, i32 0, i32 0)) %82 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %73, i32 0, i32 0 %83 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %74, i32 0, i32 0 %84 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %82, i32 0, i32 2 %85 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %82, i32 0, i32 0 store i1 true, i1* %85, align 1 %86 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %82, i32 0, i32 1 store i8* %81, i8** %86, align 8 store { i8*, i32, i32, i32, i32 }* %83, { i8*, i32, i32, i32, i32 }** %84, align 8 %87 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %82, i32 0, i32 3 store i32 1, i32* %87, align 4 %88 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %73, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %88, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0), i64 3, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont11: ; preds = %ifcont9 %89 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 2 %90 = load i32, i32* %89, align 4 %91 = icmp ne i32 %90, 13 br i1 %91, label %then12, label %else13 then12: ; preds = %ifcont11 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont14 else13: ; preds = %ifcont11 br label %ifcont14 ifcont14: ; preds = %else13, %then12 store i32 10, i32* %i, align 4 br label %loop.head15 loop.head15: ; preds = %ifcont18, %ifcont14 %92 = load i32, i32* %i, align 4 %93 = add i32 %92, 1 %94 = icmp sle i32 %93, 14 br i1 %94, label %loop.body16, label %loop.end19 loop.body16: ; preds = %loop.head15 %95 = load i32, i32* %i, align 4 %96 = add i32 %95, 1 store i32 %96, i32* %i, align 4 %97 = load i32, i32* %i, align 4 %98 = sub i32 %97, 10 %99 = sext i32 %98 to i64 %100 = sub i64 %99, 1 %101 = mul i64 1, %100 %102 = add i64 0, %101 %103 = icmp slt i64 %99, 1 %104 = icmp sgt i64 %99, 4 %105 = or i1 %103, %104 br i1 %105, label %then17, label %ifcont18 then17: ; preds = %loop.body16 %106 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %107 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %108 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %107, i32 0, i32 0 %109 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %108, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @23, i32 0, i32 0), i8** %109, align 8 %110 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %108, i32 0, i32 1 store i32 12, i32* %110, align 4 %111 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %108, i32 0, i32 2 store i32 5, i32* %111, align 4 %112 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %108, i32 0, i32 3 store i32 12, i32* %112, align 4 %113 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %108, i32 0, i32 4 store i32 11, i32* %113, align 4 %114 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @24, i32 0, i32 0)) %115 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %106, i32 0, i32 0 %116 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %107, i32 0, i32 0 %117 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %115, i32 0, i32 2 %118 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %115, i32 0, i32 0 store i1 true, i1* %118, align 1 %119 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %115, i32 0, i32 1 store i8* %114, i8** %119, align 8 store { i8*, i32, i32, i32, i32 }* %116, { i8*, i32, i32, i32, i32 }** %117, align 8 %120 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %115, i32 0, i32 3 store i32 1, i32* %120, align 4 %121 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %106, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %121, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0), i64 %99, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont18: ; preds = %loop.body16 %122 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 %102 %123 = load i32, i32* %i, align 4 store i32 %123, i32* %122, align 4 br label %loop.head15 loop.end19: ; preds = %loop.head15 br i1 false, label %then20, label %ifcont21 then20: ; preds = %loop.end19 %124 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %125 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %126 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %125, i32 0, i32 0 %127 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %126, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @27, i32 0, i32 0), i8** %127, align 8 %128 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %126, i32 0, i32 1 store i32 14, i32* %128, align 4 %129 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %126, i32 0, i32 2 store i32 5, i32* %129, align 4 %130 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %126, i32 0, i32 3 store i32 14, i32* %130, align 4 %131 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %126, i32 0, i32 4 store i32 8, i32* %131, align 4 %132 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @28, i32 0, i32 0)) %133 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %124, i32 0, i32 0 %134 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %125, i32 0, i32 0 %135 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %133, i32 0, i32 2 %136 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %133, i32 0, i32 0 store i1 true, i1* %136, align 1 %137 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %133, i32 0, i32 1 store i8* %132, i8** %137, align 8 store { i8*, i32, i32, i32, i32 }* %134, { i8*, i32, i32, i32, i32 }** %135, align 8 %138 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %133, i32 0, i32 3 store i32 1, i32* %138, align 4 %139 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %124, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %139, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @29, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0), i64 1, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont21: ; preds = %loop.end19 %140 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 0 %141 = load i32, i32* %140, align 4 %142 = icmp ne i32 %141, 11 br i1 %142, label %then22, label %else23 then22: ; preds = %ifcont21 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @31, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont24 else23: ; preds = %ifcont21 br label %ifcont24 ifcont24: ; preds = %else23, %then22 br i1 false, label %then25, label %ifcont26 then25: ; preds = %ifcont24 %143 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %144 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %145 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %144, i32 0, i32 0 %146 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %145, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @33, i32 0, i32 0), i8** %146, align 8 %147 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %145, i32 0, i32 1 store i32 15, i32* %147, align 4 %148 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %145, i32 0, i32 2 store i32 5, i32* %148, align 4 %149 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %145, i32 0, i32 3 store i32 15, i32* %149, align 4 %150 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %145, i32 0, i32 4 store i32 8, i32* %150, align 4 %151 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @34, i32 0, i32 0)) %152 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %143, i32 0, i32 0 %153 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %144, i32 0, i32 0 %154 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %152, i32 0, i32 2 %155 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %152, i32 0, i32 0 store i1 true, i1* %155, align 1 %156 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %152, i32 0, i32 1 store i8* %151, i8** %156, align 8 store { i8*, i32, i32, i32, i32 }* %153, { i8*, i32, i32, i32, i32 }** %154, align 8 %157 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %152, i32 0, i32 3 store i32 1, i32* %157, align 4 %158 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %143, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %158, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @35, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @32, i32 0, i32 0), i64 2, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont26: ; preds = %ifcont24 %159 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 1 %160 = load i32, i32* %159, align 4 %161 = icmp ne i32 %160, 12 br i1 %161, label %then27, label %else28 then27: ; preds = %ifcont26 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @37, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont29 else28: ; preds = %ifcont26 br label %ifcont29 ifcont29: ; preds = %else28, %then27 br i1 false, label %then30, label %ifcont31 then30: ; preds = %ifcont29 %162 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %163 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %164 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %163, i32 0, i32 0 %165 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %164, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @39, i32 0, i32 0), i8** %165, align 8 %166 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %164, i32 0, i32 1 store i32 16, i32* %166, align 4 %167 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %164, i32 0, i32 2 store i32 5, i32* %167, align 4 %168 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %164, i32 0, i32 3 store i32 16, i32* %168, align 4 %169 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %164, i32 0, i32 4 store i32 8, i32* %169, align 4 %170 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @40, i32 0, i32 0)) %171 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %162, i32 0, i32 0 %172 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %163, i32 0, i32 0 %173 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %171, i32 0, i32 2 %174 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %171, i32 0, i32 0 store i1 true, i1* %174, align 1 %175 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %171, i32 0, i32 1 store i8* %170, i8** %175, align 8 store { i8*, i32, i32, i32, i32 }* %172, { i8*, i32, i32, i32, i32 }** %173, align 8 %176 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %171, i32 0, i32 3 store i32 1, i32* %176, align 4 %177 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %162, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %177, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0), i64 3, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont31: ; preds = %ifcont29 %178 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 2 %179 = load i32, i32* %178, align 4 %180 = icmp ne i32 %179, 13 br i1 %180, label %then32, label %else33 then32: ; preds = %ifcont31 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @43, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont34 else33: ; preds = %ifcont31 br label %ifcont34 ifcont34: ; preds = %else33, %then32 br i1 false, label %then35, label %ifcont36 then35: ; preds = %ifcont34 %181 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %182 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %183 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %182, i32 0, i32 0 %184 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %183, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @45, i32 0, i32 0), i8** %184, align 8 %185 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %183, i32 0, i32 1 store i32 17, i32* %185, align 4 %186 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %183, i32 0, i32 2 store i32 5, i32* %186, align 4 %187 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %183, i32 0, i32 3 store i32 17, i32* %187, align 4 %188 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %183, i32 0, i32 4 store i32 8, i32* %188, align 4 %189 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @46, i32 0, i32 0)) %190 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %181, i32 0, i32 0 %191 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %182, i32 0, i32 0 %192 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %190, i32 0, i32 2 %193 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %190, i32 0, i32 0 store i1 true, i1* %193, align 1 %194 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %190, i32 0, i32 1 store i8* %189, i8** %194, align 8 store { i8*, i32, i32, i32, i32 }* %191, { i8*, i32, i32, i32, i32 }** %192, align 8 %195 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %190, i32 0, i32 3 store i32 1, i32* %195, align 4 %196 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %181, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %196, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @47, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @44, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont36: ; preds = %ifcont34 %197 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 3 %198 = load i32, i32* %197, align 4 %199 = icmp ne i32 %198, 14 br i1 %199, label %then37, label %else38 then37: ; preds = %ifcont36 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @49, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @48, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont39 else38: ; preds = %ifcont36 br label %ifcont39 ifcont39: ; preds = %else38, %then37 store i32 0, i32* %i, align 4 br label %loop.head40 loop.head40: ; preds = %ifcont45, %ifcont39 %200 = load i32, i32* %i, align 4 %201 = add i32 %200, 1 %202 = icmp sle i32 %201, 3 br i1 %202, label %loop.body41, label %loop.end46 loop.body41: ; preds = %loop.head40 %203 = load i32, i32* %i, align 4 %204 = add i32 %203, 1 store i32 %204, i32* %i, align 4 %205 = load i32, i32* %i, align 4 %206 = sext i32 %205 to i64 %207 = sub i64 %206, 1 %208 = mul i64 1, %207 %209 = add i64 0, %208 %210 = icmp slt i64 %206, 1 %211 = icmp sgt i64 %206, 4 %212 = or i1 %210, %211 br i1 %212, label %then42, label %ifcont43 then42: ; preds = %loop.body41 %213 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %214 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %215 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %214, i32 0, i32 0 %216 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %215, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @51, i32 0, i32 0), i8** %216, align 8 %217 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %215, i32 0, i32 1 store i32 20, i32* %217, align 4 %218 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %215, i32 0, i32 2 store i32 5, i32* %218, align 4 %219 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %215, i32 0, i32 3 store i32 20, i32* %219, align 4 %220 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %215, i32 0, i32 4 store i32 8, i32* %220, align 4 %221 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @52, i32 0, i32 0)) %222 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %213, i32 0, i32 0 %223 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %214, i32 0, i32 0 %224 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %222, i32 0, i32 2 %225 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %222, i32 0, i32 0 store i1 true, i1* %225, align 1 %226 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %222, i32 0, i32 1 store i8* %221, i8** %226, align 8 store { i8*, i32, i32, i32, i32 }* %223, { i8*, i32, i32, i32, i32 }** %224, align 8 %227 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %222, i32 0, i32 3 store i32 1, i32* %227, align 4 %228 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %213, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %228, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @53, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @50, i32 0, i32 0), i64 %206, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont43: ; preds = %loop.body41 %229 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 %209 %230 = load i32, i32* %i, align 4 %231 = sext i32 %230 to i64 %232 = sub i64 %231, 1 %233 = mul i64 1, %232 %234 = add i64 0, %233 %235 = icmp slt i64 %231, 1 %236 = icmp sgt i64 %231, 3 %237 = or i1 %235, %236 br i1 %237, label %then44, label %ifcont45 then44: ; preds = %ifcont43 %238 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %239 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %240 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %239, i32 0, i32 0 %241 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %240, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @55, i32 0, i32 0), i8** %241, align 8 %242 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %240, i32 0, i32 1 store i32 20, i32* %242, align 4 %243 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %240, i32 0, i32 2 store i32 12, i32* %243, align 4 %244 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %240, i32 0, i32 3 store i32 20, i32* %244, align 4 %245 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %240, i32 0, i32 4 store i32 15, i32* %245, align 4 %246 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @56, i32 0, i32 0)) %247 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %238, i32 0, i32 0 %248 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %239, i32 0, i32 0 %249 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %247, i32 0, i32 2 %250 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %247, i32 0, i32 0 store i1 true, i1* %250, align 1 %251 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %247, i32 0, i32 1 store i8* %246, i8** %251, align 8 store { i8*, i32, i32, i32, i32 }* %248, { i8*, i32, i32, i32, i32 }** %249, align 8 %252 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %247, i32 0, i32 3 store i32 1, i32* %252, align 4 %253 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %238, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %253, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @57, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @54, i32 0, i32 0), i64 %231, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont45: ; preds = %ifcont43 %254 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 %234 %255 = load i32, i32* %254, align 4 %256 = sub i32 %255, 10 store i32 %256, i32* %229, align 4 br label %loop.head40 loop.end46: ; preds = %loop.head40 br i1 false, label %then47, label %ifcont48 then47: ; preds = %loop.end46 %257 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %258 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %259 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %258, i32 0, i32 0 %260 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %259, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @59, i32 0, i32 0), i8** %260, align 8 %261 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %259, i32 0, i32 1 store i32 22, i32* %261, align 4 %262 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %259, i32 0, i32 2 store i32 5, i32* %262, align 4 %263 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %259, i32 0, i32 3 store i32 22, i32* %263, align 4 %264 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %259, i32 0, i32 4 store i32 8, i32* %264, align 4 %265 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @60, i32 0, i32 0)) %266 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %257, i32 0, i32 0 %267 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %258, i32 0, i32 0 %268 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %266, i32 0, i32 2 %269 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %266, i32 0, i32 0 store i1 true, i1* %269, align 1 %270 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %266, i32 0, i32 1 store i8* %265, i8** %270, align 8 store { i8*, i32, i32, i32, i32 }* %267, { i8*, i32, i32, i32, i32 }** %268, align 8 %271 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %266, i32 0, i32 3 store i32 1, i32* %271, align 4 %272 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %257, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %272, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @61, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @58, i32 0, i32 0), i64 1, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont48: ; preds = %loop.end46 %273 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 0 %274 = load i32, i32* %273, align 4 %275 = icmp ne i32 %274, 1 br i1 %275, label %then49, label %else50 then49: ; preds = %ifcont48 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @63, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @62, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont51 else50: ; preds = %ifcont48 br label %ifcont51 ifcont51: ; preds = %else50, %then49 br i1 false, label %then52, label %ifcont53 then52: ; preds = %ifcont51 %276 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %277 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %278 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %277, i32 0, i32 0 %279 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %278, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @65, i32 0, i32 0), i8** %279, align 8 %280 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %278, i32 0, i32 1 store i32 23, i32* %280, align 4 %281 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %278, i32 0, i32 2 store i32 5, i32* %281, align 4 %282 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %278, i32 0, i32 3 store i32 23, i32* %282, align 4 %283 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %278, i32 0, i32 4 store i32 8, i32* %283, align 4 %284 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @66, i32 0, i32 0)) %285 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %276, i32 0, i32 0 %286 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %277, i32 0, i32 0 %287 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %285, i32 0, i32 2 %288 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %285, i32 0, i32 0 store i1 true, i1* %288, align 1 %289 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %285, i32 0, i32 1 store i8* %284, i8** %289, align 8 store { i8*, i32, i32, i32, i32 }* %286, { i8*, i32, i32, i32, i32 }** %287, align 8 %290 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %285, i32 0, i32 3 store i32 1, i32* %290, align 4 %291 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %276, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %291, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @67, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @64, i32 0, i32 0), i64 2, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont53: ; preds = %ifcont51 %292 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 1 %293 = load i32, i32* %292, align 4 %294 = icmp ne i32 %293, 2 br i1 %294, label %then54, label %else55 then54: ; preds = %ifcont53 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @69, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @68, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont56 else55: ; preds = %ifcont53 br label %ifcont56 ifcont56: ; preds = %else55, %then54 br i1 false, label %then57, label %ifcont58 then57: ; preds = %ifcont56 %295 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %296 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %297 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %296, i32 0, i32 0 %298 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %297, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @71, i32 0, i32 0), i8** %298, align 8 %299 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %297, i32 0, i32 1 store i32 24, i32* %299, align 4 %300 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %297, i32 0, i32 2 store i32 5, i32* %300, align 4 %301 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %297, i32 0, i32 3 store i32 24, i32* %301, align 4 %302 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %297, i32 0, i32 4 store i32 8, i32* %302, align 4 %303 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @72, i32 0, i32 0)) %304 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %295, i32 0, i32 0 %305 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %296, i32 0, i32 0 %306 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %304, i32 0, i32 2 %307 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %304, i32 0, i32 0 store i1 true, i1* %307, align 1 %308 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %304, i32 0, i32 1 store i8* %303, i8** %308, align 8 store { i8*, i32, i32, i32, i32 }* %305, { i8*, i32, i32, i32, i32 }** %306, align 8 %309 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %304, i32 0, i32 3 store i32 1, i32* %309, align 4 %310 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %295, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %310, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @73, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @70, i32 0, i32 0), i64 3, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont58: ; preds = %ifcont56 %311 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 2 %312 = load i32, i32* %311, align 4 %313 = icmp ne i32 %312, 3 br i1 %313, label %then59, label %else60 then59: ; preds = %ifcont58 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @75, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @74, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont61 else60: ; preds = %ifcont58 br label %ifcont61 ifcont61: ; preds = %else60, %then59 br i1 false, label %then62, label %ifcont63 then62: ; preds = %ifcont61 %314 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %315 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %316 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %315, i32 0, i32 0 %317 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %316, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @77, i32 0, i32 0), i8** %317, align 8 %318 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %316, i32 0, i32 1 store i32 26, i32* %318, align 4 %319 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %316, i32 0, i32 2 store i32 1, i32* %319, align 4 %320 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %316, i32 0, i32 3 store i32 26, i32* %320, align 4 %321 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %316, i32 0, i32 4 store i32 4, i32* %321, align 4 %322 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @78, i32 0, i32 0)) %323 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %314, i32 0, i32 0 %324 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %315, i32 0, i32 0 %325 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %323, i32 0, i32 2 %326 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %323, i32 0, i32 0 store i1 true, i1* %326, align 1 %327 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %323, i32 0, i32 1 store i8* %322, i8** %327, align 8 store { i8*, i32, i32, i32, i32 }* %324, { i8*, i32, i32, i32, i32 }** %325, align 8 %328 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %323, i32 0, i32 3 store i32 1, i32* %328, align 4 %329 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %314, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %329, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @79, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @76, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont63: ; preds = %ifcont61 %330 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 3 br i1 false, label %then64, label %ifcont65 then64: ; preds = %ifcont63 %331 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %332 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %333 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %332, i32 0, i32 0 %334 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %333, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @81, i32 0, i32 0), i8** %334, align 8 %335 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %333, i32 0, i32 1 store i32 26, i32* %335, align 4 %336 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %333, i32 0, i32 2 store i32 8, i32* %336, align 4 %337 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %333, i32 0, i32 3 store i32 26, i32* %337, align 4 %338 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %333, i32 0, i32 4 store i32 11, i32* %338, align 4 %339 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @82, i32 0, i32 0)) %340 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %331, i32 0, i32 0 %341 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %332, i32 0, i32 0 %342 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %340, i32 0, i32 2 %343 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %340, i32 0, i32 0 store i1 true, i1* %343, align 1 %344 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %340, i32 0, i32 1 store i8* %339, i8** %344, align 8 store { i8*, i32, i32, i32, i32 }* %341, { i8*, i32, i32, i32, i32 }** %342, align 8 %345 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %340, i32 0, i32 3 store i32 1, i32* %345, align 4 %346 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %331, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %346, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @83, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @80, i32 0, i32 0), i64 1, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont65: ; preds = %ifcont63 %347 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 0 %348 = load i32, i32* %347, align 4 br i1 false, label %then66, label %ifcont67 then66: ; preds = %ifcont65 %349 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %350 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %351 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %350, i32 0, i32 0 %352 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %351, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @85, i32 0, i32 0), i8** %352, align 8 %353 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %351, i32 0, i32 1 store i32 26, i32* %353, align 4 %354 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %351, i32 0, i32 2 store i32 13, i32* %354, align 4 %355 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %351, i32 0, i32 3 store i32 26, i32* %355, align 4 %356 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %351, i32 0, i32 4 store i32 16, i32* %356, align 4 %357 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @86, i32 0, i32 0)) %358 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %349, i32 0, i32 0 %359 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %350, i32 0, i32 0 %360 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %358, i32 0, i32 2 %361 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %358, i32 0, i32 0 store i1 true, i1* %361, align 1 %362 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %358, i32 0, i32 1 store i8* %357, i8** %362, align 8 store { i8*, i32, i32, i32, i32 }* %359, { i8*, i32, i32, i32, i32 }** %360, align 8 %363 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %358, i32 0, i32 3 store i32 1, i32* %363, align 4 %364 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %349, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %364, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @87, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @84, i32 0, i32 0), i64 2, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont67: ; preds = %ifcont65 %365 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 1 %366 = load i32, i32* %365, align 4 %367 = add i32 %348, %366 br i1 false, label %then68, label %ifcont69 then68: ; preds = %ifcont67 %368 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %369 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %370 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %369, i32 0, i32 0 %371 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %370, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @89, i32 0, i32 0), i8** %371, align 8 %372 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %370, i32 0, i32 1 store i32 26, i32* %372, align 4 %373 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %370, i32 0, i32 2 store i32 18, i32* %373, align 4 %374 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %370, i32 0, i32 3 store i32 26, i32* %374, align 4 %375 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %370, i32 0, i32 4 store i32 21, i32* %375, align 4 %376 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @90, i32 0, i32 0)) %377 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %368, i32 0, i32 0 %378 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %369, i32 0, i32 0 %379 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %377, i32 0, i32 2 %380 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %377, i32 0, i32 0 store i1 true, i1* %380, align 1 %381 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %377, i32 0, i32 1 store i8* %376, i8** %381, align 8 store { i8*, i32, i32, i32, i32 }* %378, { i8*, i32, i32, i32, i32 }** %379, align 8 %382 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %377, i32 0, i32 3 store i32 1, i32* %382, align 4 %383 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %368, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %383, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @91, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @88, i32 0, i32 0), i64 3, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont69: ; preds = %ifcont67 %384 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 2 %385 = load i32, i32* %384, align 4 %386 = add i32 %367, %385 br i1 false, label %then70, label %ifcont71 then70: ; preds = %ifcont69 %387 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %388 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %389 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %388, i32 0, i32 0 %390 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %389, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @93, i32 0, i32 0), i8** %390, align 8 %391 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %389, i32 0, i32 1 store i32 26, i32* %391, align 4 %392 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %389, i32 0, i32 2 store i32 23, i32* %392, align 4 %393 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %389, i32 0, i32 3 store i32 26, i32* %393, align 4 %394 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %389, i32 0, i32 4 store i32 26, i32* %394, align 4 %395 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @94, i32 0, i32 0)) %396 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %387, i32 0, i32 0 %397 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %388, i32 0, i32 0 %398 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %396, i32 0, i32 2 %399 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %396, i32 0, i32 0 store i1 true, i1* %399, align 1 %400 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %396, i32 0, i32 1 store i8* %395, i8** %400, align 8 store { i8*, i32, i32, i32, i32 }* %397, { i8*, i32, i32, i32, i32 }** %398, align 8 %401 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %396, i32 0, i32 3 store i32 1, i32* %401, align 4 %402 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %387, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %402, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @95, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @92, i32 0, i32 0), i64 1, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont71: ; preds = %ifcont69 %403 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 0 %404 = load i32, i32* %403, align 4 %405 = add i32 %386, %404 store i32 %405, i32* %330, align 4 br i1 false, label %then72, label %ifcont73 then72: ; preds = %ifcont71 %406 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %407 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %408 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %407, i32 0, i32 0 %409 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %408, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @97, i32 0, i32 0), i8** %409, align 8 %410 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %408, i32 0, i32 1 store i32 27, i32* %410, align 4 %411 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %408, i32 0, i32 2 store i32 5, i32* %411, align 4 %412 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %408, i32 0, i32 3 store i32 27, i32* %412, align 4 %413 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %408, i32 0, i32 4 store i32 8, i32* %413, align 4 %414 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @98, i32 0, i32 0)) %415 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %406, i32 0, i32 0 %416 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %407, i32 0, i32 0 %417 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %415, i32 0, i32 2 %418 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %415, i32 0, i32 0 store i1 true, i1* %418, align 1 %419 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %415, i32 0, i32 1 store i8* %414, i8** %419, align 8 store { i8*, i32, i32, i32, i32 }* %416, { i8*, i32, i32, i32, i32 }** %417, align 8 %420 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %415, i32 0, i32 3 store i32 1, i32* %420, align 4 %421 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %406, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %421, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @99, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @96, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont73: ; preds = %ifcont71 %422 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 3 %423 = load i32, i32* %422, align 4 %424 = icmp ne i32 %423, 17 br i1 %424, label %then74, label %else75 then74: ; preds = %ifcont73 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @101, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @100, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont76 else75: ; preds = %ifcont73 br label %ifcont76 ifcont76: ; preds = %else75, %then74 br i1 false, label %then77, label %ifcont78 then77: ; preds = %ifcont76 %425 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %426 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %427 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %426, i32 0, i32 0 %428 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %427, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @103, i32 0, i32 0), i8** %428, align 8 %429 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %427, i32 0, i32 1 store i32 29, i32* %429, align 4 %430 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %427, i32 0, i32 2 store i32 1, i32* %430, align 4 %431 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %427, i32 0, i32 3 store i32 29, i32* %431, align 4 %432 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %427, i32 0, i32 4 store i32 4, i32* %432, align 4 %433 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @104, i32 0, i32 0)) %434 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %425, i32 0, i32 0 %435 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %426, i32 0, i32 0 %436 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %434, i32 0, i32 2 %437 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %434, i32 0, i32 0 store i1 true, i1* %437, align 1 %438 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %434, i32 0, i32 1 store i8* %433, i8** %438, align 8 store { i8*, i32, i32, i32, i32 }* %435, { i8*, i32, i32, i32, i32 }** %436, align 8 %439 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %434, i32 0, i32 3 store i32 1, i32* %439, align 4 %440 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %425, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %440, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @105, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @102, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont78: ; preds = %ifcont76 %441 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 3 br i1 false, label %then79, label %ifcont80 then79: ; preds = %ifcont78 %442 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %443 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %444 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %443, i32 0, i32 0 %445 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %444, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @107, i32 0, i32 0), i8** %445, align 8 %446 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %444, i32 0, i32 1 store i32 29, i32* %446, align 4 %447 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %444, i32 0, i32 2 store i32 8, i32* %447, align 4 %448 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %444, i32 0, i32 3 store i32 29, i32* %448, align 4 %449 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %444, i32 0, i32 4 store i32 11, i32* %449, align 4 %450 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @108, i32 0, i32 0)) %451 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %442, i32 0, i32 0 %452 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %443, i32 0, i32 0 %453 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %451, i32 0, i32 2 %454 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %451, i32 0, i32 0 store i1 true, i1* %454, align 1 %455 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %451, i32 0, i32 1 store i8* %450, i8** %455, align 8 store { i8*, i32, i32, i32, i32 }* %452, { i8*, i32, i32, i32, i32 }** %453, align 8 %456 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %451, i32 0, i32 3 store i32 1, i32* %456, align 4 %457 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %442, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %457, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @109, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @106, i32 0, i32 0), i64 1, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont80: ; preds = %ifcont78 %458 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 0 %459 = load i32, i32* %458, align 4 store i32 %459, i32* %441, align 4 br i1 false, label %then81, label %ifcont82 then81: ; preds = %ifcont80 %460 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %461 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %462 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %461, i32 0, i32 0 %463 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %462, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @111, i32 0, i32 0), i8** %463, align 8 %464 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %462, i32 0, i32 1 store i32 30, i32* %464, align 4 %465 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %462, i32 0, i32 2 store i32 5, i32* %465, align 4 %466 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %462, i32 0, i32 3 store i32 30, i32* %466, align 4 %467 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %462, i32 0, i32 4 store i32 8, i32* %467, align 4 %468 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @112, i32 0, i32 0)) %469 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %460, i32 0, i32 0 %470 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %461, i32 0, i32 0 %471 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %469, i32 0, i32 2 %472 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %469, i32 0, i32 0 store i1 true, i1* %472, align 1 %473 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %469, i32 0, i32 1 store i8* %468, i8** %473, align 8 store { i8*, i32, i32, i32, i32 }* %470, { i8*, i32, i32, i32, i32 }** %471, align 8 %474 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %469, i32 0, i32 3 store i32 1, i32* %474, align 4 %475 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %460, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %475, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @113, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @110, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont82: ; preds = %ifcont80 %476 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 3 %477 = load i32, i32* %476, align 4 %478 = icmp ne i32 %477, 11 br i1 %478, label %then83, label %else84 then83: ; preds = %ifcont82 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @115, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @114, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont85 else84: ; preds = %ifcont82 br label %ifcont85 ifcont85: ; preds = %else84, %then83 br label %return return: ; preds = %ifcont85 br label %FINALIZE_SYMTABLE_arrays_01 FINALIZE_SYMTABLE_arrays_01: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_snprintf_alloc(i8*, i8*, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lcompilers_runtime_error(i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) declare void @exit(i32) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/ast_f90-associate_01-aa0fe46.stdout0000664000175000017500000000120015174404631025017 0ustar alastairalastairprogram associate_01 implicit none real, allocatable :: a(:), b(:,:), c(:,:,:) real, pointer :: x(:), y(:,:,:) real :: a_1, c_234, c_121 integer :: n a_1 = 0 n = 10 allocate(a(5)) allocate(b(n, n), c(n, 5, n)) 1 loop: associate (x => a, y => c, z => c(:, 2, :)) x(1) = a_1 + 5 y(2, 3, 4) = 3 z(1, 1) = 17 if (size(z) /= 100) then error stop end if end associate loop a_1 = a(1) if (a(1) == 5) then go to 1 end if c_234 = c(2, 3, 4) c_121 = c(1, 2, 1) if (a_1 /= 10.) then error stop end if if (c_234 /= 3.) then error stop end if if (c_121 /= 17.) then error stop end if end program associate_01 lfortran-0.63.0/tests/reference/asr-derived_types_06-847ca73.json0000664000175000017500000000074515174404631024555 0ustar alastairalastair{ "basename": "asr-derived_types_06-847ca73", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/derived_types_06.f90", "infile_hash": "79e9585ecc476ad45f2a511049814969a07a1fd17d61eb8f49f59f64", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_06-847ca73.stdout", "stdout_hash": "a3d22d03c1748f0e36a093fdafae20e08ce513af0be7f5db343b1890", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-return_02-99fb0b3.json0000664000175000017500000000107115174404631023456 0ustar alastairalastair{ "basename": "llvm-return_02-99fb0b3", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/return_02.f90", "infile_hash": "e5f24828e2cdf4070fa9095cd731b2eb065bd9c3cbb2885c825f0655", "outfile": null, "outfile_hash": null, "stdout": "llvm-return_02-99fb0b3.stdout", "stdout_hash": "ccb974cc5e56c7d89d77ef0505cc0d06421601827f05c5c43be3829f", "stderr": "llvm-return_02-99fb0b3.stderr", "stderr_hash": "efcbccc2e2e71c4026b6ef48d5fa977b7432890f8fc2395640038aa4", "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-global_scope1-b0a630a.json0000664000175000017500000000073715174404631024336 0ustar alastairalastair{ "basename": "llvm-global_scope1-b0a630a", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/global_scope1.f90", "infile_hash": "449b38487b6c79754deedb9991f1867bcf8c67d0d93019c2fe15854c", "outfile": null, "outfile_hash": null, "stdout": "llvm-global_scope1-b0a630a.stdout", "stdout_hash": "e0db7383318d561c1a3f21ae469ae39fe06ed9586268cf23ae8e7b7f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-complex2-5384cb2.stdout0000664000175000017500000001573115174404631023477 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex2: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) complex2 [] [(Assignment (Var 2 x) (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 4.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 x) (ComplexBinOp (Var 2 x) Add (Cast (RealConstant 4.000000 (Real 4) ) RealToComplex (Complex 4) (ComplexConstant 4.000000 0.000000 (Complex 4) ) () ) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (ComplexBinOp (Cast (RealConstant 2.000000 (Real 4) ) RealToComplex (Complex 4) (ComplexConstant 2.000000 0.000000 (Complex 4) ) () ) Add (Var 2 x) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (ComplexBinOp (ComplexBinOp (Cast (RealConstant 2.000000 (Real 4) ) RealToComplex (Complex 4) (ComplexConstant 2.000000 0.000000 (Complex 4) ) () ) Add (Var 2 x) (Complex 4) () ) Add (ComplexConstructor (RealConstant 0.000000 (Real 4) ) (RealConstant 3.000000 (Real 4) ) (Complex 4) (ComplexConstant 0.000000 3.000000 (Complex 4) ) ) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/pass_select_case-case_07-90772d0.stdout0000664000175000017500000005170615174404631025626 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { case_07: (Program (SymbolTable 2 { test_case: (Function (SymbolTable 3 { c: (Variable 3 c [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 3 res [] ReturnVar () () Default (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_case (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 c)] [(If () (LogicalBinOp (StringCompare (StringConstant "a" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) LtE (Var 3 c) (Logical 4) () ) And (StringCompare (Var 3 c) LtE (StringConstant "j" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 3 res) (StringConstant "a:j" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Print (StringConstant "one of the first ten letters" (String 1 (IntegerConstant 28 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(If () (LogicalBinOp (StringCompare (StringConstant "l" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) LtE (Var 3 c) (Logical 4) () ) And (StringCompare (Var 3 c) LtE (StringConstant "p" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 3 res) (StringConstant "l:p" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Print (StringConstant "one of l, m, n, o, p" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(If () (StringCompare (Var 3 c) Eq (StringConstant "z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(Assignment (Var 3 res) (StringConstant "z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Print (StringConstant "one of z" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Assignment (Var 3 res) (StringConstant "not found" (String 1 (IntegerConstant 9 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Print (StringConstant "other characters, which may not be letters" (String 1 (IntegerConstant 42 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] )] )] (Var 3 res) Public .false. .false. () ) }) case_07 [] [(If () (StringCompare (FunctionCall 2 test_case () [((StringConstant "a" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () () ) NotEq (StringConstant "a:j" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (StringCompare (FunctionCall 2 test_case () [((StringConstant "d" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () () ) NotEq (StringConstant "a:j" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (StringCompare (FunctionCall 2 test_case () [((StringConstant "l" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () () ) NotEq (StringConstant "l:p" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (StringCompare (FunctionCall 2 test_case () [((StringConstant "p" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () () ) NotEq (StringConstant "l:p" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (StringCompare (FunctionCall 2 test_case () [((StringConstant "z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () () ) NotEq (StringConstant "z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (StringCompare (FunctionCall 2 test_case () [((StringConstant "k" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () () ) NotEq (StringConstant "not found" (String 1 (IntegerConstant 9 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (StringCompare (FunctionCall 2 test_case () [((StringConstant "r" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () () ) NotEq (StringConstant "not found" (String 1 (IntegerConstant 9 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-close1-0f44a73.stdout0000664000175000017500000000024415174404631023603 0ustar alastairalastairprogram close1 ! Tests for syntax (AST) only: close(u) close(unit=gmv_lun) close(unit=dxf%dunit, status="delete") close(UNIT=funit, IOSTAT=ierr) end program close1 lfortran-0.63.0/tests/reference/ast-fixed_form_implicit_check-62ffca3.json0000664000175000017500000000101315174404631026674 0ustar alastairalastair{ "basename": "ast-fixed_form_implicit_check-62ffca3", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_implicit_check.f", "infile_hash": "4913776655a2aab98265358375f290eedb9b92a2ef7424536067345c", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_implicit_check-62ffca3.stdout", "stdout_hash": "0623f030fb96bf3fd397948f5c177d108aa3a0990e6602016668cd99", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-interface_01-3aedbb0.stderr0000664000175000017500000000040315174404631024363 0ustar alastairalastairsemantic error: Argument(s) or return type mismatch in interface and implementation --> tests/errors/interface_01.f90:13:3 - 17:14 | 13 | module function e(x) | ^^^^^^^^^^^^^^^^^^^^... ... | 17 | end function | ...^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor8-b01de63.json0000664000175000017500000000077015174404631026527 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor8-b01de63", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor8.f90", "infile_hash": "cd1d06b72c00ca0a67e83e5e20cfae7cbea5e5cf00ae46f81604d3b3", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor8-b01de63.stdout", "stdout_hash": "ad8945752c3e0b938f835b24a8dad599a1497216003cc543e5bc6c86", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-assign_to3-fc49dae.json0000664000175000017500000000075115174404631023671 0ustar alastairalastair{ "basename": "ast-assign_to3-fc49dae", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/assign_to3.f", "infile_hash": "cef165b367ac19491dbe0628a23d1843039e77602c05b5554ae12997", "outfile": null, "outfile_hash": null, "stdout": "ast-assign_to3-fc49dae.stdout", "stdout_hash": "9419113ae2af72c6d911bf4e43dd06834b22bb98ae2adedbb1d407aa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit12-1826599.stdout0000664000175000017500000005523315174404631023601 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), e: (Variable 2 e [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Variable 2 f [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), h: (Variable 2 h [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 2 l [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 2 m [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), o: (Variable 2 o [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p: (Variable 2 p [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), q: (Variable 2 q [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 2 r [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [d e] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 d)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [e] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (ArrayItem (Var 2 y) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 b) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 d) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 f) (Cast (IntegerConstant 4 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 4 (Integer 8) Decimal) () ) () .false. .false. ) (Assignment (Var 2 h) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 i) (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 6.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 l) (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 7.000000 (Real 8) ) () ) () .false. .false. ) (Assignment (Var 2 m) (Cast (IntegerConstant 8 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 8.000000 0.000000 (Complex 4) ) () ) () .false. .false. ) (Assignment (Var 2 o) (Cast (IntegerConstant 9 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 9.000000 0.000000 (Complex 4) ) () ) () .false. .false. ) (Assignment (Var 2 p) (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToComplex (Complex 8) (ComplexConstant 10.000000 0.000000 (Complex 8) ) () ) () .false. .false. ) (Assignment (Var 2 q) (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 11.000000 (Real 8) ) () ) () .false. .false. ) (Assignment (Var 2 r) (Cast (IntegerConstant 12 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 12.000000 (Real 8) ) () ) () .false. .false. )] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-parameter1-1a7ed3b.json0000664000175000017500000000072315174404631023565 0ustar alastairalastair{ "basename": "asr-parameter1-1a7ed3b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/parameter1.f90", "infile_hash": "89e627eefd928ded810c79f57685b062a029d924767fffd996a7552d", "outfile": null, "outfile_hash": null, "stdout": "asr-parameter1-1a7ed3b.stdout", "stdout_hash": "4abd4cb6f3d64fc1f5a118e316f350f88dcc8c6c720b6c9bc7d0195b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-external3-2aafcb3.stdout0000664000175000017500000003357515174404631024070 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { brcmp1: (Function (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), bcorr: (Function (SymbolTable 5 { a: (Variable 5 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 5 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), bcorr_arg_0: (Variable 5 bcorr_arg_0 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), bcorr_arg_1: (Variable 5 bcorr_arg_1 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), bcorr_return_var_name: (Variable 5 bcorr_return_var_name [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) bcorr (FunctionType [(Real 4) (Real 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 bcorr_arg_0) (Var 5 bcorr_arg_1)] [] (Var 5 bcorr_return_var_name) Public .false. .false. () ), brcmp1: (Variable 2 brcmp1 [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), exp: (Variable 2 exp [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) brcmp1 (FunctionType [] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 brcmp1) (IntrinsicElementalFunction Exp [(RealUnaryMinus (FunctionCall 2 bcorr () [((Var 2 a)) ((Var 2 b))] (Real 8) () () ) (Real 8) () )] 0 (Real 8) () ) () .false. .false. ) (Return)] (Var 2 brcmp1) Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/ast-types_09-e7605c9.stdout0000664000175000017500000001230115174404631023422 0ustar alastairalastair(TranslationUnit [(Program types_09 () [(Use [] iso_c_binding [(UseSymbol c_char () )] .true. () )] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(ucs4 [] [] () (FuncCallOrArray selected_char_kind [] [(() (String "ISO_10646" ()) () 0)] [] [] [] ) Equal ())] () ) (Declaration (AttrType TypeCharacter [(() 1 Value) (() ucs4 Value)] () () None ) [(SimpleAttribute AttrParameter )] [(nen [] [] () (FuncCallOrArray char [] [(() (FuncCallOrArray int [] [(() (BOZ "Z'5e74'" ) () 0)] [] [] [] ) () 0) (() ucs4 () 0)] [] [] [] ) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Subroutine f [(s) (s2)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeCharacter [(kind c_char Value) (len () Colon)] () () None ) [(SimpleAttribute AttrAllocatable ) (AttrIntent In )] [(s [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len () Colon)] () () None ) [(SimpleAttribute AttrAllocatable ) (AttrIntent In )] [(s2 [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(kind 1 Value) (len () Star)] () () None ) [(SimpleAttribute AttrParameter )] [(lowercase [] [] () (String "abcdefghijklmnopqrstuvwxyz" ()) Equal ())] () )] [] [] [] ) (Subroutine s [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(Use [(SimpleAttribute AttrIntrinsic )] iso_fortran_env [(UseSymbol int32 () )] .true. () )] [] [] [(Declaration (AttrType TypeInteger [(() int32 Value)] () () None ) [] [(x [] [] () 1 Equal ())] () )] [] [] [] )] )] ) lfortran-0.63.0/tests/reference/asr_json-special_chars_json-70bba3a.json0000664000175000017500000000077515174404631026406 0ustar alastairalastair{ "basename": "asr_json-special_chars_json-70bba3a", "cmd": "lfortran --show-asr --no-indent --json {infile} -o {outfile}", "infile": "tests/special_chars_json.f90", "infile_hash": "f1aaa183ee7d224a4f0e158546c6f3077e139ee963f833a4c37394d5", "outfile": null, "outfile_hash": null, "stdout": "asr_json-special_chars_json-70bba3a.stdout", "stdout_hash": "1220d7a3aaa9c0feee952d20634489974241fed8588099d2eb109e43", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-bin_op_complex_dp-26e149c.stdout0000664000175000017500000002507615174404631025434 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bin_op_complex_dp: (Program (SymbolTable 2 { u: (Variable 2 u [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 2 v [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zero: (Variable 2 zero [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) bin_op_complex_dp [] [(Assignment (Var 2 zero) (Cast (RealBinOp (RealConstant 1.000000 (Real 4) ) Div (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) () ) (Real 4) (RealConstant 0.142857 (Real 4) ) ) RealToComplex (Complex 4) (ComplexConstant 0.142857 0.000000 (Complex 4) ) () ) () .false. .false. ) (Assignment (Var 2 u) (Cast (RealBinOp (RealConstant 1.000000 (Real 4) ) Div (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) () ) (Real 4) (RealConstant 0.142857 (Real 4) ) ) RealToComplex (Complex 8) (ComplexConstant 0.142857 0.000000 (Complex 8) ) () ) () .false. .false. ) (Assignment (Var 2 v) (Cast (RealBinOp (RealConstant 1.000000 (Real 8) ) Div (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 7.000000 (Real 8) ) () ) (Real 8) (RealConstant 0.142857 (Real 8) ) ) RealToComplex (Complex 8) (ComplexConstant 0.142857 0.000000 (Complex 8) ) () ) () .false. .false. ) (Assignment (Var 2 x) (Cast (RealBinOp (RealConstant 1.000000 (Real 4) ) Div (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) () ) (Real 4) (RealConstant 0.142857 (Real 4) ) ) RealToComplex (Complex 4) (ComplexConstant 0.142857 0.000000 (Complex 4) ) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 zero) (Var 2 v) (Var 2 x) (Var 2 u)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-error_stop1-ccc2415.stdout0000664000175000017500000000037515174404631024277 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [] [] [] [] [(ErrorStop 0 () () () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-template_add_02-1dafc5f.json0000664000175000017500000000076715174404631024543 0ustar alastairalastair{ "basename": "asr-template_add_02-1dafc5f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_add_02.f90", "infile_hash": "95dedcde4510d21053421bad8c1396a6d11065c339bbbed7132de2e1", "outfile": null, "outfile_hash": null, "stdout": "asr-template_add_02-1dafc5f.stdout", "stdout_hash": "6bf92c8aaed83373f1bfb5f52282a2a2928b9d6f70ed1c19012f394b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-modules_06-7f94d73.json0000664000175000017500000000072315174404631023364 0ustar alastairalastair{ "basename": "ast-modules_06-7f94d73", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/modules_06.f90", "infile_hash": "7699c2084686f687c1681ea9d088f613f3530b48449a37df5fc1cdce", "outfile": null, "outfile_hash": null, "stdout": "ast-modules_06-7f94d73.stdout", "stdout_hash": "c0ee9e8b3a3b67c56ad2253ff4960b01353bf58c0c8433d1b1199f3f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-kokkos_program2-43a2cc6.stdout0000664000175000017500000000450415174404631025124 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct f32_10000_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; f32_10000_1(Kokkos::View* data_): data{data_} {}; }; // Forward declarations namespace { template void triad(T0* a, T1* b, float scalar, T2* c); } // Implementations namespace { template void triad(T0* a, T1* b, float scalar, T2* c) { int32_t i; int32_t n; n = a->data->extent(0); Kokkos::parallel_for(Kokkos::RangePolicy(1, n+1), KOKKOS_LAMBDA(const long i) { c->data->operator[](i - c->dims[0].lower_bound) = a->data->operator[](i - a->dims[0].lower_bound) + scalar*b->data->operator[](i - b->dims[0].lower_bound); }); } void main2() { Kokkos::View a_data("a_data", 10000); f32_10000_1 a_value(&a_data); f32_10000_1* a = &a_value; a->dims[0].lower_bound = 1; a->dims[0].length = 10000; Kokkos::View b_data("b_data", 10000); f32_10000_1 b_value(&b_data); f32_10000_1* b = &b_value; b->dims[0].lower_bound = 1; b->dims[0].length = 10000; Kokkos::View c_data("c_data", 10000); f32_10000_1 c_value(&c_data); f32_10000_1* c = &c_value; c->dims[0].lower_bound = 1; c->dims[0].length = 10000; int32_t i; int32_t nsize; float scalar; scalar = (float)(10); nsize = a->data->extent(0); Kokkos::parallel_for(Kokkos::RangePolicy(1, nsize+1), KOKKOS_LAMBDA(const long i) { a->data->operator[](i - a->dims[0].lower_bound) = (float)(5); b->data->operator[](i - b->dims[0].lower_bound) = (float)(5); }); triad(a, b, scalar, c); std::cout<< "End Stream Triad"<. Period required in format specifier lfortran-0.63.0/tests/reference/run-stop_03-897cacd.stderr0000664000175000017500000000001015174404631023365 0ustar alastairalastairSTOP hi lfortran-0.63.0/tests/reference/ast-end_function_name_not_match-92ee1a1.stderr0000664000175000017500000000040615174404631027506 0ustar alastairalastairsyntax error: End function name does not match function name --> tests/errors/end_function_name_not_match.f90:1:1 - 6:23 | 1 | real function square(x) | ^^^^^^^^^^^^^^^^^^^^^^^... ... | 6 | end function square_int | ...^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/fortran-expr5-3a279bb.json0000664000175000017500000000072015174404631023375 0ustar alastairalastair{ "basename": "fortran-expr5-3a279bb", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/expr5.f90", "infile_hash": "030f3f956944c6d24d536fd1f434f877d95bf12aac6f367d2ad1827e", "outfile": null, "outfile_hash": null, "stdout": "fortran-expr5-3a279bb.stdout", "stdout_hash": "01e46e3df753a89e5a8a3a918a3cc4ab862b85e839c8ac5b078cf896", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-string_03-7320626.json0000664000175000017500000000074515174404631023043 0ustar alastairalastair{ "basename": "asr-string_03-7320626", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_03.f90", "infile_hash": "7815b8703dfd3a1c61cab40604e20693508878e8a90e450834ce592b", "outfile": null, "outfile_hash": null, "stdout": "asr-string_03-7320626.stdout", "stdout_hash": "7c674e041907a82298d2707623a2c2691d2f401608ad327455043dc3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-program_without_line_07-3e4ee40.json0000664000175000017500000000100115174404631026206 0ustar alastairalastair{ "basename": "ast-program_without_line_07-3e4ee40", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/program_without_line_07.f90", "infile_hash": "308bb5317a98bf3331bb13ff5e833a995f95bd6e2ebf622ee1406299", "outfile": null, "outfile_hash": null, "stdout": "ast-program_without_line_07-3e4ee40.stdout", "stdout_hash": "7618d8207246aa9ade0eb2f57f4763e1edc8f6c6534ec3fb149b963d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-return_01-495409d.json0000664000175000017500000000107115174404631023321 0ustar alastairalastair{ "basename": "llvm-return_01-495409d", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/return_01.f90", "infile_hash": "a2ba2932ff6e67ee7972619b545d6fbf6d4e3987a09beff2296d6295", "outfile": null, "outfile_hash": null, "stdout": "llvm-return_01-495409d.stdout", "stdout_hash": "e9961a7d4a2f26118382139e90818d37716291e7becd252c96ff264b", "stderr": "llvm-return_01-495409d.stderr", "stderr_hash": "98d80e924c656c0c4a14372c1012a5da09682be3684f582f50255347", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-string2-3425046.stdout0000664000175000017500000013404315174404631023171 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fpm_filesystem: (Module (SymbolTable 2 { c_associated: (ExternalSymbol 2 c_associated 11 c_associated lfortran_intrinsic_iso_c_binding [] c_associated Public ), c_ptr: (ExternalSymbol 2 c_ptr 11 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), f_string: (ExternalSymbol 2 f_string 4 f_string fpm_strings [] f_string Public ), f_string_cptr@f_string: (ExternalSymbol 2 f_string_cptr@f_string 4 f_string_cptr fpm_strings [] f_string_cptr Public ), f_string_cptr_n@f_string: (ExternalSymbol 2 f_string_cptr_n@f_string 4 f_string_cptr_n fpm_strings [] f_string_cptr_n Public ), f_string~genericprocedure@f_string: (ExternalSymbol 2 f_string~genericprocedure@f_string 4 f_string~genericprocedure fpm_strings [] f_string~genericprocedure Public ), get_temp_filename: (Function (SymbolTable 21 { c_tempfile: (Variable 21 c_tempfile [] Local () () Default (Pointer (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f_string@f_string~genericprocedure: (ExternalSymbol 21 f_string@f_string~genericprocedure 4 f_string~genericprocedure fpm_strings [] f_string~genericprocedure Private ), tempfile: (Variable 21 tempfile [] ReturnVar () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) get_temp_filename (FunctionType [] (Allocatable (String 1 () DeferredLength DescriptorString) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 21 tempfile) (FunctionCall 21 f_string@f_string~genericprocedure 2 f_string [((Var 21 c_tempfile))] (Allocatable (String 1 () DeferredLength DescriptorString) ) () () ) () .false. .false. )] (Var 21 tempfile) Public .true. .true. () ), list_files: (Function (SymbolTable 20 { dir_entry_c: (Variable 20 dir_entry_c [] Local () () Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dir_handle: (Variable 20 dir_handle [] Local () () Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f_string@f_string_cptr: (ExternalSymbol 20 f_string@f_string_cptr 4 f_string_cptr fpm_strings [] f_string_cptr Private ), string_fortran: (Variable 20 string_fortran [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) list_files (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(WhileLoop () (LogicalConstant .true. (Logical 4) ) [(If () (LogicalNot (PointerAssociated (Var 20 dir_entry_c) () (Logical 4) () ) (Logical 4) () ) [(Exit () )] [(Assignment (Var 20 string_fortran) (FunctionCall 20 f_string@f_string_cptr 2 f_string [((Var 20 dir_entry_c))] (Allocatable (String 1 () DeferredLength DescriptorString) ) () () ) () .false. .false. )] )] [] )] () Public .true. .true. () ), string_t: (ExternalSymbol 2 string_t 4 string_t fpm_strings [] string_t Public ) }) fpm_filesystem () [fpm_strings iso_c_binding] .false. .false. .false. ), fpm_strings: (Module (SymbolTable 4 { c_char: (ExternalSymbol 4 c_char 11 c_char lfortran_intrinsic_iso_c_binding [] c_char Public ), c_ptr: (ExternalSymbol 4 c_ptr 11 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), c_size_t: (ExternalSymbol 4 c_size_t 11 c_size_t lfortran_intrinsic_iso_c_binding [] c_size_t Public ), f_string: (GenericProcedure 4 f_string [4 f_string~genericprocedure 4 f_string_cptr 4 f_string_cptr_n] Public ), f_string_cptr: (Function (SymbolTable 6 { c_strlen: (Function (SymbolTable 7 { r: (Variable 7 r [] ReturnVar () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s: (Variable 7 s [] In () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) c_strlen (FunctionType [(CPtr)] (Integer 8) BindC Interface "strlen" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 s)] [] (Var 7 r) Public .false. .false. () ), cptr: (Variable 6 cptr [] In () () Default (CPtr) () Source Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), lfortran_tmp: (Variable 6 lfortran_tmp [] Local () () Default (Integer 8) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s: (Variable 6 s [] ReturnVar () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_string_cptr (FunctionType [(CPtr)] (Allocatable (String 1 () DeferredLength DescriptorString) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f_string_cptr_n] [(Var 6 cptr)] [(Assignment (Var 6 lfortran_tmp) (FunctionCall 6 c_strlen () [((Var 6 cptr))] (Integer 8) () () ) () .false. .false. ) (Assignment (Var 6 s) (FunctionCall 4 f_string_cptr_n () [((Var 6 cptr)) ((Var 6 lfortran_tmp))] (String 1 (Var 6 lfortran_tmp) ExpressionLength DescriptorString) () () ) () .false. .false. )] (Var 6 s) Public .false. .false. () ), f_string_cptr_n: (Function (SymbolTable 8 { cptr: (Variable 8 cptr [] In () () Default (CPtr) () Source Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 8 n [] In () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s: (Variable 8 s [n] ReturnVar () () Default (String 1 (Var 8 n) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_string_cptr_n (FunctionType [(CPtr) (Integer 8)] (String 1 (FunctionParam 1 (Integer 8) () ) ExpressionLength DescriptorString) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 cptr) (Var 8 n)] [] (Var 8 s) Public .true. .true. () ), f_string~genericprocedure: (Function (SymbolTable 9 { c_string: (Variable 9 c_string [] In () () Default (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f_string: (Variable 9 f_string [] ReturnVar () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_string~genericprocedure (FunctionType [(Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray )] (Allocatable (String 1 () DeferredLength DescriptorString) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 c_string)] [] (Var 9 f_string) Public .true. .true. () ), string_t: (Struct (SymbolTable 5 { s: (Variable 5 s [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [s] [] Source Public .false. .false. [] () () [] ) }) fpm_strings () [iso_c_binding fpm_strings] .true. .false. .false. ), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding) }) [] ) lfortran-0.63.0/tests/reference/asr-uppercase1-b7c06b1.json0000664000175000017500000000072315174404631023512 0ustar alastairalastair{ "basename": "asr-uppercase1-b7c06b1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/uppercase1.f90", "infile_hash": "5a65afa41100952259b9009c4fba9ad49c4090de264c0e38fcb37834", "outfile": null, "outfile_hash": null, "stdout": "asr-uppercase1-b7c06b1.stdout", "stdout_hash": "9c7df7e3ea56a21a569fd1d282557cf8bd1bd7c7aa1dbce6edadd8dc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-case_03-c3a5078.stdout0000664000175000017500000002433015174404631023343 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [5 x i8] c"Pass!" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data, i32 0, i32 0), i64 5 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [7 x i8] c"Failed!" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([7 x i8], [7 x i8]* @string_const_data.1, i32 0, i32 0), i64 7 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.3 = private constant [13 x i8] c"Invalid marks" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([13 x i8], [13 x i8]* @string_const_data.3, i32 0, i32 0), i64 13 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [13 x i8] c"S-DESC-15,I4\00", align 1 @string_const_data.5 = private constant [15 x i8] c"Your marks are " @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([15 x i8], [15 x i8]* @string_const_data.5, i32 0, i32 0), i64 15 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.7 = private constant [5 x i8] c"Pass!" @string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data.7, i32 0, i32 0), i64 5 }> @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.9 = private constant [7 x i8] c"Failed!" @string_const.10 = private global %string_descriptor <{ i8* getelementptr inbounds ([7 x i8], [7 x i8]* @string_const_data.9, i32 0, i32 0), i64 7 }> @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.11 = private constant [13 x i8] c"Invalid marks" @string_const.12 = private global %string_descriptor <{ i8* getelementptr inbounds ([13 x i8], [13 x i8]* @string_const_data.11, i32 0, i32 0), i64 13 }> @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.13 = private unnamed_addr constant [13 x i8] c"S-DESC-15,I4\00", align 1 @string_const_data.14 = private constant [15 x i8] c"Your marks are " @string_const.15 = private global %string_descriptor <{ i8* getelementptr inbounds ([15 x i8], [15 x i8]* @string_const_data.14, i32 0, i32 0), i64 15 }> @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc10 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca i32, align 4 store i32 1, i32* %a, align 4 %b = alloca i32, align 4 store i32 2, i32* %b, align 4 %marks = alloca i32, align 4 store i32 94, i32* %marks, align 4 %3 = load i32, i32* %marks, align 4 %4 = icmp sle i32 42, %3 br i1 %4, label %then, label %else then: ; preds = %.entry %5 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %5, i32 5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %ifcont3 else: ; preds = %.entry %6 = load i32, i32* %marks, align 4 %7 = icmp sle i32 %6, 38 br i1 %7, label %then1, label %else2 then1: ; preds = %else %8 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %8, i32 7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) br label %ifcont else2: ; preds = %else %9 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %9, i32 13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) br label %ifcont ifcont: ; preds = %else2, %then1 br label %ifcont3 ifcont3: ; preds = %ifcont, %then %10 = alloca i64, align 8 %11 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info, i32 0, i32 0), i64* %10, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.6, i32* %marks) %12 = load i64, i64* %10, align 8 %13 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %11, i8** %13, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %12, i64* %14, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %16 = load i8*, i8** %15, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %18 = load i64, i64* %17, align 8 %19 = trunc i64 %18 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %16, i32 %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %20 = icmp eq i8* %11, null br i1 %20, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont3 call void @_lfortran_free_alloc(i8* %2, i8* %11) br label %free_done free_done: ; preds = %free_nonnull, %ifcont3 store i32 -1, i32* %marks, align 4 %21 = load i32, i32* %marks, align 4 %22 = icmp sle i32 42, %21 br i1 %22, label %then4, label %else5 then4: ; preds = %free_done %23 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.8, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %23, i32 5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) br label %ifcont9 else5: ; preds = %free_done %24 = load i32, i32* %marks, align 4 %25 = icmp sle i32 0, %24 %26 = load i32, i32* %marks, align 4 %27 = icmp sle i32 %26, 38 %28 = and i1 %25, %27 br i1 %28, label %then6, label %else7 then6: ; preds = %else5 %29 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.10, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %29, i32 7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) br label %ifcont8 else7: ; preds = %else5 %30 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.12, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %30, i32 13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) br label %ifcont8 ifcont8: ; preds = %else7, %then6 br label %ifcont9 ifcont9: ; preds = %ifcont8, %then4 %31 = alloca i64, align 8 %32 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info.13, i32 0, i32 0), i64* %31, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.15, i32* %marks) %33 = load i64, i64* %31, align 8 %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 store i8* %32, i8** %34, align 8 %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 store i64 %33, i64* %35, align 8 %36 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 %37 = load i8*, i8** %36, align 8 %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 %39 = load i64, i64* %38, align 8 %40 = trunc i64 %39 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* %37, i32 %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 1) %41 = icmp eq i8* %32, null br i1 %41, label %free_done12, label %free_nonnull11 free_nonnull11: ; preds = %ifcont9 call void @_lfortran_free_alloc(i8* %2, i8* %32) br label %free_done12 free_done12: ; preds = %free_nonnull11, %ifcont9 br label %return return: ; preds = %free_done12 br label %FINALIZE_SYMTABLE_case03 FINALIZE_SYMTABLE_case03: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/llvm-codegen_function_polymorphic-834d4d1.stdout0000664000175000017500000001247215174404631030071 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %codegen_function_polymorphic.abstype_class = type <{ i32 (...)**, %codegen_function_polymorphic.abstype* }> %codegen_function_polymorphic.abstype = type {} define void @__module_codegen_function_polymorphic_my_func(%codegen_function_polymorphic.abstype_class** %obj) { .entry: %0 = call i8* @_lfortran_get_default_allocator() %1 = load %codegen_function_polymorphic.abstype_class*, %codegen_function_polymorphic.abstype_class** %obj, align 8 %2 = ptrtoint %codegen_function_polymorphic.abstype_class* %1 to i64 %3 = icmp ne i64 %2, 0 br i1 %3, label %then, label %else2 then: ; preds = %.entry %4 = load %codegen_function_polymorphic.abstype_class*, %codegen_function_polymorphic.abstype_class** %obj, align 8 %5 = load %codegen_function_polymorphic.abstype_class*, %codegen_function_polymorphic.abstype_class** %obj, align 8 %6 = ptrtoint %codegen_function_polymorphic.abstype_class* %5 to i64 %7 = icmp ne i64 %6, 0 br i1 %7, label %then1, label %else then1: ; preds = %then call void @finalize_allocatable__StructType_Class__abstype_of_codegen_function_polymorphic(%codegen_function_polymorphic.abstype_class* %5) store %codegen_function_polymorphic.abstype_class* null, %codegen_function_polymorphic.abstype_class** %obj, align 8 br label %ifcont else: ; preds = %then br label %ifcont ifcont: ; preds = %else, %then1 br label %ifcont3 else2: ; preds = %.entry br label %ifcont3 ifcont3: ; preds = %else2, %ifcont br label %return return: ; preds = %ifcont3 br label %FINALIZE_SYMTABLE_my_func FINALIZE_SYMTABLE_my_func: ; preds = %return ret void } declare void @_lfortran_free_alloc(i8*, i8*) declare i8* @_lfortran_get_default_allocator() define internal void @finalize_allocatable__StructType_Class__abstype_of_codegen_function_polymorphic(%codegen_function_polymorphic.abstype_class* %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = icmp ne %codegen_function_polymorphic.abstype_class* %0, null br i1 %2, label %is_allocated.then, label %is_allocated.else2 is_allocated.then: ; preds = %entry call void @finalize_StructType_Class__abstype_of_codegen_function_polymorphic(%codegen_function_polymorphic.abstype_class* %0) %3 = getelementptr %codegen_function_polymorphic.abstype_class, %codegen_function_polymorphic.abstype_class* %0, i32 0, i32 1 %4 = load %codegen_function_polymorphic.abstype*, %codegen_function_polymorphic.abstype** %3, align 8 %5 = icmp ne %codegen_function_polymorphic.abstype* %4, null br i1 %5, label %is_allocated.then1, label %is_allocated.else is_allocated.then1: ; preds = %is_allocated.then %6 = bitcast %codegen_function_polymorphic.abstype* %4 to i8* call void @_lfortran_free_alloc(i8* %1, i8* %6) br label %is_allocated.ifcont is_allocated.else: ; preds = %is_allocated.then br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %is_allocated.then1 %7 = bitcast %codegen_function_polymorphic.abstype_class* %0 to i8* call void @_lfortran_free_alloc(i8* %1, i8* %7) br label %is_allocated.ifcont3 is_allocated.else2: ; preds = %entry br label %is_allocated.ifcont3 is_allocated.ifcont3: ; preds = %is_allocated.else2, %is_allocated.ifcont ret void } define internal void @finalize_StructType_Class__abstype_of_codegen_function_polymorphic(%codegen_function_polymorphic.abstype_class* %0) { entry: %1 = getelementptr %codegen_function_polymorphic.abstype_class, %codegen_function_polymorphic.abstype_class* %0, i32 0, i32 0 %2 = load i32 (...)**, i32 (...)*** %1, align 8 %3 = getelementptr %codegen_function_polymorphic.abstype_class, %codegen_function_polymorphic.abstype_class* %0, i32 0, i32 1 %4 = load %codegen_function_polymorphic.abstype**, %codegen_function_polymorphic.abstype** %3, align 8 %5 = bitcast %codegen_function_polymorphic.abstype** %4 to i8* %6 = icmp ne i32 (...)** %2, null br i1 %6, label %is_allocated.then, label %is_allocated.else2 is_allocated.then: ; preds = %entry %7 = getelementptr inbounds i32 (...)*, i32 (...)** %2, i32 2 %8 = load i8*, i32 (...)** %7, align 8 %9 = bitcast i8* %8 to void (i8*)* %10 = icmp ne i8* %5, null br i1 %10, label %is_allocated.then1, label %is_allocated.else is_allocated.then1: ; preds = %is_allocated.then call void %9(i8* %5) br label %is_allocated.ifcont is_allocated.else: ; preds = %is_allocated.then br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %is_allocated.then1 br label %is_allocated.ifcont3 is_allocated.else2: ; preds = %entry br label %is_allocated.ifcont3 is_allocated.ifcont3: ; preds = %is_allocated.else2, %is_allocated.ifcont ret void } lfortran-0.63.0/tests/reference/asr-arrays_23-a731033.stdout0000664000175000017500000007075715174404631023473 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_23: (Module (SymbolTable 2 { add_context: (Function (SymbolTable 4 { 1_toml_context_num: (ExternalSymbol 4 1_toml_context_num 3 num toml_context [] num Public ), 1_toml_context_ptr: (ExternalSymbol 4 1_toml_context_ptr 3 ptr toml_context [] ptr Public ), context: (Variable 4 context [] In () () Default (StructType [(Integer 4) (Integer 4) (Pointer (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 toml_context Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lfortran_iomsg: (Variable 4 lfortran_iomsg [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), line_break: (Variable 4 line_break [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), message: (Variable 4 message [] InOut () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), num: (Variable 4 num [] Local () () Default (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_context (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Integer 4) (Integer 4) (Pointer (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 message) (Var 4 context)] [(If () (IntegerCompare (StructInstanceMember (Var 4 context) 4 1_toml_context_num (Integer 4) () ) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(FileWrite 0 (Var 4 num) (Var 4 lfortran_iomsg) () () [(StringFormat (StringConstant "(\"line\",1x,i0,\":\")" (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(StructInstanceMember (Var 4 context) 4 1_toml_context_num (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () () ) (Assignment (Var 4 message) (IntrinsicElementalFunction StringConcat [(StringSection (Var 4 num) (IntegerConstant 1 (Integer 4) Decimal) (IntegerBinOp (IntrinsicElementalFunction StringLenTrim [(Var 4 num)] 0 (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntrinsicElementalFunction StringLenTrim [(Var 4 num)] 0 (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ExpressionLength DescriptorString) () ) (Var 4 message)] 0 (String 1 () DeferredLength DescriptorString) () ) () .false. .false. )] [] ) (Assignment (Var 4 message) (IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(Var 4 message) (StringConstant " | " (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 () DeferredLength DescriptorString) () ) (StringSection (StructInstanceMember (Var 4 context) 4 1_toml_context_ptr (Pointer (String 1 () DeferredLength DescriptorString) ) () ) (IntegerConstant 1 (Integer 4) Decimal) (Var 4 line_break) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerBinOp (IntegerBinOp (Var 4 line_break) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ExpressionLength DescriptorString) () )] 0 (String 1 () DeferredLength DescriptorString) () ) (StringConstant " |" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 () DeferredLength DescriptorString) () ) () .false. .false. )] () Public .true. .true. () ), toml_context: (Struct (SymbolTable 3 { num: (Variable 3 num [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pos: (Variable 3 pos [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ptr: (Variable 3 ptr [] Local () () Default (Pointer (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_context (StructType [(Integer 4) (Integer 4) (Pointer (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [pos num ptr] [] Source Public .false. .false. [] () () [] ) }) arrays_23 () [] .false. .false. .false. ), main: (Program (SymbolTable 5 { add_context: (ExternalSymbol 5 add_context 2 add_context arrays_23 [] add_context Public ), toml_context: (ExternalSymbol 5 toml_context 2 toml_context arrays_23 [] toml_context Public ) }) main [arrays_23] [(Print (StringConstant "working" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/run-format_30-3cec484.stdout0000664000175000017500000000122015174404631023626 0ustar alastairalastair 0.100E+01 0.200E+01 1.192E-07 1.192E-07 1.2345 2.3456 3.4567 123.000E+00 456.000E+00 1.192E-07 1.192E-07 0.119E-06 0.222E-15 1.E+10 3.333333333333333E+199 +0.12345678910111198970867447229396098431025025677514E-61 0.E+0 1.E+1 3.E+0 3.E+5 3.000000000000000E-100 1.E+0 1.E+00 2.22507386E-308 1.79769313E+308 0.0000000E+00 lfortran-0.63.0/tests/reference/ast-enum_decl_without_start_program-9ae6425.stdout0000664000175000017500000000111515174404631030426 0ustar alastairalastair(TranslationUnit [(Program __xx_main () [] [] [(Enum [(AttrBind (Bind [c] [] ) )] () [(Declaration () [(SimpleAttribute AttrEnumerator )] [(yellow [] [] () () None ())] () )] )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-kind_invalid_int_of_int-32727cf.json0000664000175000017500000000100115174404631026224 0ustar alastairalastair{ "basename": "asr-kind_invalid_int_of_int-32727cf", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_invalid_int_of_int.f90", "infile_hash": "88f2a854337ac8e0390be39e5b44c18975e0f856ea3890c6fae450f1", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_invalid_int_of_int-32727cf.stderr", "stderr_hash": "6369be31933d4052db4ff550d8bbcdebb553b26b36f166f0ff7c9f2e", "returncode": 2 }lfortran-0.63.0/tests/reference/ast_f90-goto_03-38b11b3.stdout0000664000175000017500000000045115174404631023662 0ustar alastairalastairprogram goto_03 implicit none integer :: a, n n = 2 a = 10 go to (1, 2, 3), n 1 a = a + 10 2 a = a + 20 3 a = a + 30 if (a /= 60) then error stop end if assign 30 to n go to n, (10, 20, 30) 10 a = a*a 20 a = a + a 30 a = a - a if (a /= 0) then error stop end if end program goto_03 lfortran-0.63.0/tests/reference/ast_f90-block_data1-f3dfb1f.json0000664000175000017500000000074115174404631024435 0ustar alastairalastair{ "basename": "ast_f90-block_data1-f3dfb1f", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/block_data1.f90", "infile_hash": "18c095bb88a2f3528ab34c788fd6a66b9294d38866605cfec26b8dfd", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-block_data1-f3dfb1f.stdout", "stdout_hash": "e3f8296b8f94947d2df24e8ed679b5829e79a281be4b05efb60de201", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_array_03-b7f9799.stdout0000664000175000017500000053420715174404631025313 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_array_03: (Program (SymbolTable 21 { add_integer: (ExternalSymbol 21 add_integer 2 add_integer template_array_03_math [] add_integer Public ), add_real: (ExternalSymbol 21 add_real 2 add_real template_array_03_math [] add_real Public ), array_tmpl: (ExternalSymbol 21 array_tmpl 9 array_tmpl template_array_03_m [] array_tmpl Public ), mult_integer: (ExternalSymbol 21 mult_integer 2 mult_integer template_array_03_math [] mult_integer Public ), mult_real: (ExternalSymbol 21 mult_real 2 mult_real template_array_03_math [] mult_real Public ), operations: (ExternalSymbol 21 operations 9 operations template_array_03_m [] operations Public ), test_template: (ExternalSymbol 21 test_template 9 test_template template_array_03_m [] test_template Public ), zero_integer: (ExternalSymbol 21 zero_integer 2 zero_integer template_array_03_math [] zero_integer Public ), zero_real: (ExternalSymbol 21 zero_real 2 zero_real template_array_03_math [] zero_real Public ) }) template_array_03 [template_array_03_m template_array_03_math] [(SubroutineCall 21 test_template () [] () .false. )] ), template_array_03_m: (Module (SymbolTable 9 { add_integer: (ExternalSymbol 9 add_integer 2 add_integer template_array_03_math [] add_integer Public ), add_real: (ExternalSymbol 9 add_real 2 add_real template_array_03_math [] add_real Public ), array_tmpl: (Template (SymbolTable 14 { mult_t: (Function (SymbolTable 17 { l: (Variable 17 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 17 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), result: (Variable 17 result [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mult_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 17 l) (Var 17 r)] [] (Var 17 result) Private .true. .true. () ), mymatmul_t: (Function (SymbolTable 18 { a: (Variable 18 a [i j] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 18 i)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 18 j))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 18 b [j k] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 18 j)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 18 k))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), elem: (Variable 18 elem [] Local () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 18 i [] In () () Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 18 j [] In () () Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 18 k [] In () () Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 18 r [i k] Unspecified () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 18 i)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 18 k))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 18 x [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 18 y [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 18 z [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mymatmul_t (FunctionType [(Integer 4) (Integer 4) (Integer 4) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 1 (Integer 4) () ))] PointerArray ) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 1 (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray ) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [zero_t mult_t plus_t] [(Var 18 i) (Var 18 j) (Var 18 k) (Var 18 a) (Var 18 b) (Var 18 r)] [(DoLoop () ((Var 18 x) (IntegerConstant 1 (Integer 4) Decimal) (Var 18 i) ()) [(DoLoop () ((Var 18 z) (IntegerConstant 1 (Integer 4) Decimal) (Var 18 k) ()) [(Assignment (Var 18 elem) (FunctionCall 14 zero_t () [((ArrayItem (Var 18 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) () .false. .false. ) (DoLoop () ((Var 18 y) (IntegerConstant 1 (Integer 4) Decimal) (Var 18 j) ()) [(Assignment (Var 18 elem) (FunctionCall 14 plus_t () [((Var 18 elem)) ((FunctionCall 14 mult_t () [((ArrayItem (Var 18 a) [(() (Var 18 x) ()) (() (Var 18 y) ())] (TypeParameter t ) ColMajor () )) ((ArrayItem (Var 18 b) [(() (Var 18 y) ()) (() (Var 18 z) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ))] (TypeParameter t ) () () ) () .false. .false. )] [] ) (Assignment (ArrayItem (Var 18 r) [(() (Var 18 x) ()) (() (Var 18 z) ())] (TypeParameter t ) ColMajor () ) (Var 18 elem) () .false. .false. )] [] )] [] )] () Public .true. .true. () ), plus_t: (Function (SymbolTable 15 { l: (Variable 15 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 15 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), result: (Variable 15 result [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 15 l) (Var 15 r)] [] (Var 15 result) Private .true. .true. () ), t: (Variable 14 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zero_t: (Function (SymbolTable 16 { result: (Variable 16 result [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 16 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) zero_t (FunctionType [(TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 16 x)] [] (Var 16 result) Private .true. .true. () ) }) array_tmpl [t plus_t zero_t mult_t] [(Require operations [t plus_t zero_t mult_t] )] ), mult_integer: (ExternalSymbol 9 mult_integer 2 mult_integer template_array_03_math [] mult_integer Public ), mult_real: (ExternalSymbol 9 mult_real 2 mult_real template_array_03_math [] mult_real Public ), operations: (Requirement (SymbolTable 10 { mult_t: (Function (SymbolTable 13 { l: (Variable 13 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 13 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), result: (Variable 13 result [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mult_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 13 l) (Var 13 r)] [] (Var 13 result) Private .true. .true. () ), plus_t: (Function (SymbolTable 11 { l: (Variable 11 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 11 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), result: (Variable 11 result [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 11 l) (Var 11 r)] [] (Var 11 result) Private .true. .true. () ), t: (Variable 10 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zero_t: (Function (SymbolTable 12 { result: (Variable 12 result [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 12 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) zero_t (FunctionType [(TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 12 x)] [] (Var 12 result) Private .true. .true. () ) }) operations [t plus_t zero_t mult_t] [] ), test_template: (Function (SymbolTable 19 { arr: (Variable 19 arr [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), mymatmul_int: (Function (SymbolTable 20 { a: (Variable 20 a [i j] In () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 20 i)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 20 j))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 20 b [j k] In () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 20 j)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 20 k))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), elem: (Variable 20 elem [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 20 i [] In () () Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 20 j [] In () () Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 20 k [] In () () Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 20 r [i k] Unspecified () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 20 i)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 20 k))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 20 x [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 20 y [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 20 z [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mymatmul_int (FunctionType [(Integer 4) (Integer 4) (Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 1 (Integer 4) () ))] PointerArray ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 1 (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 i) (Var 20 j) (Var 20 k) (Var 20 a) (Var 20 b) (Var 20 r)] [(DoLoop () ((Var 20 x) (IntegerConstant 1 (Integer 4) Decimal) (Var 20 i) ()) [(DoLoop () ((Var 20 z) (IntegerConstant 1 (Integer 4) Decimal) (Var 20 k) ()) [(Assignment (Var 20 elem) (FunctionCall 9 zero_integer () [((ArrayItem (Var 20 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) () .false. .false. ) (DoLoop () ((Var 20 y) (IntegerConstant 1 (Integer 4) Decimal) (Var 20 j) ()) [(Assignment (Var 20 elem) (FunctionCall 9 add_integer () [((Var 20 elem)) ((FunctionCall 9 mult_integer () [((ArrayItem (Var 20 a) [(() (Var 20 x) ()) (() (Var 20 y) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 20 b) [(() (Var 20 y) ()) (() (Var 20 z) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ))] (Integer 4) () () ) () .false. .false. )] [] ) (Assignment (ArrayItem (Var 20 r) [(() (Var 20 x) ()) (() (Var 20 z) ())] (Integer 4) ColMajor () ) (Var 20 elem) () .false. .false. )] [] )] [] )] () Public .true. .true. () ), r: (Variable 19 r [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (ArrayItem (Var 19 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 19 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 19 arr) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 19 arr) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 19 mymatmul_int () [((IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 2 (Integer 4) Decimal)) ((ArrayPhysicalCast (Var 19 arr) FixedSizeArray PointerArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] PointerArray ) () )) ((ArrayPhysicalCast (Var 19 arr) FixedSizeArray PointerArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] PointerArray ) () )) ((ArrayPhysicalCast (Var 19 r) FixedSizeArray PointerArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] PointerArray ) () ))] () .false. ) (Print (StringFormat () [(ArrayItem (Var 19 r) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayItem (Var 19 r) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayItem (Var 19 r) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayItem (Var 19 r) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), zero_integer: (ExternalSymbol 9 zero_integer 2 zero_integer template_array_03_math [] zero_integer Public ), zero_real: (ExternalSymbol 9 zero_real 2 zero_real template_array_03_math [] zero_real Public ) }) template_array_03_m () [template_array_03_math template_array_03_m] .false. .false. .false. ), template_array_03_math: (Module (SymbolTable 2 { add_integer: (Function (SymbolTable 3 { r: (Variable 3 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 3 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 y)] [(Assignment (Var 3 r) (IntegerBinOp (Var 3 x) Add (Var 3 y) (Integer 4) () ) () .false. .false. )] (Var 3 r) Public .true. .true. () ), add_real: (Function (SymbolTable 6 { r: (Variable 6 r [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 6 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 6 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 6 x) (Var 6 y)] [(Assignment (Var 6 r) (RealBinOp (Var 6 x) Add (Var 6 y) (Real 4) () ) () .false. .false. )] (Var 6 r) Public .true. .true. () ), mult_integer: (Function (SymbolTable 5 { r: (Variable 5 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 5 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 5 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mult_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 5 x) (Var 5 y)] [(Assignment (Var 5 r) (IntegerBinOp (Var 5 x) Mul (Var 5 y) (Integer 4) () ) () .false. .false. )] (Var 5 r) Public .true. .true. () ), mult_real: (Function (SymbolTable 8 { r: (Variable 8 r [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 8 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 8 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) mult_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 8 x) (Var 8 y)] [(Assignment (Var 8 r) (RealBinOp (Var 8 x) Mul (Var 8 y) (Real 4) () ) () .false. .false. )] (Var 8 r) Public .true. .true. () ), zero_integer: (Function (SymbolTable 4 { r: (Variable 4 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) zero_integer (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 x)] [(Assignment (Var 4 r) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 4 r) Public .true. .true. () ), zero_real: (Function (SymbolTable 7 { r: (Variable 7 r [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 7 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) zero_real (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 7 x)] [(Assignment (Var 7 r) (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) () ) () .false. .false. )] (Var 7 r) Public .true. .true. () ) }) template_array_03_math () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-modules4-22712cd.stdout0000664000175000017500000016212015174404631023467 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { tomlf_structure: (Module (SymbolTable 13 { toml_ordered: (ExternalSymbol 13 toml_ordered 15 toml_ordered tomlf_structure_base [] toml_ordered Public ) }) tomlf_structure () [tomlf_structure_base] .true. .false. .false. ), tomlf_structure_base: (Module (SymbolTable 15 { destroy: (Function (SymbolTable 18 { self: (Variable 18 self [] InOut () () Default (StructType [] [] .false. .false. ) 15 toml_structure Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), toml_value: (ExternalSymbol 18 toml_value 9 toml_value tomlf_type_value [] toml_value Public ) }) destroy (FunctionType [(StructType [] [] .false. .false. )] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 18 self)] [] () Public .false. .false. () ), toml_ordered: (Struct (SymbolTable 16 { }) toml_ordered (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .true. [] () 15 toml_structure [] ), toml_structure: (Struct (SymbolTable 17 { destroy: (StructMethodDeclaration 17 destroy () destroy 15 destroy Source .true. .false. ) }) toml_structure (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .true. [] () () [] ) }) tomlf_structure_base () [tomlf_type_value] .true. .false. .false. ), tomlf_type: (Module (SymbolTable 2 { new: (GenericProcedure 2 new [2 new_array 2 new_keyval 2 new_keyval] Public ), new_array: (ExternalSymbol 2 new_array 4 new_array tomlf_type_array [] new_array Public ), new_keyval: (ExternalSymbol 2 new_keyval 20 new_keyval tomlf_type_keyval [] new_keyval Public ), toml_array: (ExternalSymbol 2 toml_array 4 toml_array tomlf_type_array [] toml_array Public ), toml_keyval: (ExternalSymbol 2 toml_keyval 20 toml_keyval tomlf_type_keyval [] toml_keyval Public ) }) tomlf_type () [tomlf_type_array tomlf_type_keyval] .false. .false. .false. ), tomlf_type_array: (Module (SymbolTable 4 { destroy: (Function (SymbolTable 6 { 1_toml_array_list: (ExternalSymbol 6 1_toml_array_list 5 list toml_array [] list Public ), 1_toml_structure: (ExternalSymbol 6 1_toml_structure 15 toml_structure tomlf_structure_base [] toml_structure Public ), 1_toml_structure_destroy: (ExternalSymbol 6 1_toml_structure_destroy 17 destroy 1_toml_structure [] destroy Public ), 1_toml_value_key: (ExternalSymbol 6 1_toml_value_key 10 key toml_value [] key Public ), self: (Variable 6 self [] InOut () () Default (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .false. .false. ) 4 toml_array Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) destroy (FunctionType [(StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 self)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 6 self) 6 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(ExplicitDeallocate [(StructInstanceMember (Var 6 self) 6 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] )] [] ) (If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 6 self) 6 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () )] 0 (Logical 4) () ) [(SubroutineCall 6 1_toml_structure_destroy () [((StructInstanceMember (Var 6 self) 6 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () ))] (StructInstanceMember (Var 6 self) 6 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () ) .false. ) (ExplicitDeallocate [(StructInstanceMember (Var 6 self) 6 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () )] )] [] )] () Public .true. .true. () ), new: (GenericProcedure 4 new [4 new_array] Public ), new_array: (Function (SymbolTable 7 { self: (Variable 7 self [] Out () () Default (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. ) 4 toml_array Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_array (FunctionType [(StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 self)] [] () Public .true. .true. () ), toml_array: (Struct (SymbolTable 5 { destroy: (StructMethodDeclaration 5 destroy () destroy 4 destroy Source .false. .false. ), list: (Variable 5 list [] Local () () Default (Allocatable (StructType [] [] .false. .false. ) ) 4 toml_ordered Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_array (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. ) [] [list] [] Source Public .false. .false. [] () 4 toml_value [] ), toml_ordered: (ExternalSymbol 4 toml_ordered 15 toml_ordered tomlf_structure_base [] toml_ordered Public ), toml_value: (ExternalSymbol 4 toml_value 9 toml_value tomlf_type_value [] toml_value Public ) }) tomlf_type_array () [tomlf_type_value tomlf_structure tomlf_structure_base] .true. .false. .false. ), tomlf_type_keyval: (Module (SymbolTable 20 { destroy: (Function (SymbolTable 23 { 1_toml_keyval_raw: (ExternalSymbol 23 1_toml_keyval_raw 21 raw toml_keyval [] raw Public ), 1_toml_value_key: (ExternalSymbol 23 1_toml_value_key 22 key toml_value [] key Public ), self: (Variable 23 self [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 20 toml_keyval Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) destroy (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 23 self)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 23 self) 23 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(ExplicitDeallocate [(StructInstanceMember (Var 23 self) 23 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] )] [] ) (If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 23 self) 23 1_toml_keyval_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(ExplicitDeallocate [(StructInstanceMember (Var 23 self) 23 1_toml_keyval_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] )] [] )] () Public .true. .true. () ), new: (GenericProcedure 20 new [20 new_keyval] Public ), new_keyval: (Function (SymbolTable 24 { self: (Variable 24 self [] Out () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 20 toml_keyval Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_keyval (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 24 self)] [] () Public .true. .true. () ), toml_keyval: (Struct (SymbolTable 21 { destroy: (StructMethodDeclaration 21 destroy () destroy 20 destroy Source .false. .false. ), raw: (Variable 21 raw [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_keyval (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [raw] [] Source Public .false. .false. [] () 20 toml_value [] ), toml_value: (Struct (SymbolTable 22 { destroy: (StructMethodDeclaration 22 destroy () destroy 20 destroy Source .true. .false. ), key: (Variable 22 key [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_value (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [key] [] Source Public .false. .true. [] () () [] ) }) tomlf_type_keyval () [] .true. .false. .false. ), tomlf_type_value: (Module (SymbolTable 9 { destroy: (Function (SymbolTable 11 { self: (Variable 11 self [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 9 toml_value Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) destroy (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. )] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 self)] [] () Private .false. .false. () ), toml_value: (Struct (SymbolTable 10 { destroy: (StructMethodDeclaration 10 destroy () destroy 9 destroy Source .true. .false. ), key: (Variable 10 key [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_value (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [key] [] Source Private .false. .true. [] () () [] ) }) tomlf_type_value () [] .true. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-subroutines_07-4a9f44e.stdout0000664000175000017500000004264515174404631024730 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { subroutines_07: (Program (SymbolTable 4 { f: (ExternalSymbol 4 f 2 f subroutines_07_mod [] f Public ), f_int: (ExternalSymbol 4 f_int 2 f_int subroutines_07_mod [] f_int Public ), f_int@f: (ExternalSymbol 4 f_int@f 2 f subroutines_07_mod [] f Private ), i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 4 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), k: (Variable 4 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 4 l [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) subroutines_07 [subroutines_07_mod] [(Assignment (Var 4 i) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 4 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 4 k) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 4 l) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 4 f_int@f 4 f_int [((Var 4 i)) ((Var 4 j)) ((Var 4 k)) ((Var 4 l)) (())] () .false. ) (If () (IntegerCompare (Var 4 j) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), subroutines_07_mod: (Module (SymbolTable 2 { f: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 3 c [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 3 d [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), kind: (Variable 3 kind [] In () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 c) (Var 3 d) (Var 3 kind)] [(Assignment (Var 3 b) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Add (Var 3 c) (Integer 4) () ) Add (Var 3 d) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ), f_int: (GenericProcedure 2 f_int [2 f] Public ) }) subroutines_07_mod () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-types_04-056d321.json0000664000175000017500000000074215174404631022752 0ustar alastairalastair{ "basename": "asr-types_04-056d321", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_04.f90", "infile_hash": "da21466af87608d5d323360a130e0a5542261d98fabaeebb5adc16d3", "outfile": null, "outfile_hash": null, "stdout": "asr-types_04-056d321.stdout", "stdout_hash": "4cc36bf21f53e5d874bee119e9ccc0c7e052be2039022839c744dd03", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-interface_03-c3dfda4.json0000664000175000017500000000075615174404631024060 0ustar alastairalastair{ "basename": "ast-interface_03-c3dfda4", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/interface_03.f90", "infile_hash": "23a67d0f38f0787a9de82a2324e52305487cfa1700eb928a728547f1", "outfile": null, "outfile_hash": null, "stdout": "ast-interface_03-c3dfda4.stdout", "stdout_hash": "d19fd36deb8655aab26e728403cb6294eb1a20c7b842cc27e0dbec72", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-sign_from_value-b974070.json0000664000175000017500000000076715174404631024501 0ustar alastairalastair{ "basename": "asr-sign_from_value-b974070", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/sign_from_value.f90", "infile_hash": "8dbaf3021ce3488c9846d4b6f9ffca21e9d2a2e6f4dfaa10cf7a844c", "outfile": null, "outfile_hash": null, "stdout": "asr-sign_from_value-b974070.stdout", "stdout_hash": "2e622aaf3c4942f9588e2a652fd4458c87ecc56d4c23c4c4858fbe5b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-data_14-f20fec7.json0000664000175000017500000000073715174404631022756 0ustar alastairalastair{ "basename": "ast-data_14-f20fec7", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/data_14.f90", "infile_hash": "4e987e678805662bd06e097ae563cdf8ca232328721a0a707bf3557b", "outfile": null, "outfile_hash": null, "stdout": "ast-data_14-f20fec7.stdout", "stdout_hash": "677d4c10432f6b2e66b12eec93e4f1c9e0a61600d27237231a76a962", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-case_06-57ebc6f.json0000664000175000017500000000072215174404631022753 0ustar alastairalastair{ "basename": "cpp-case_06-57ebc6f", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/case_06.f90", "infile_hash": "3987983e4c8d162530bceffbbce0bd7d038b1f794655c222c47ad714", "outfile": null, "outfile_hash": null, "stdout": "cpp-case_06-57ebc6f.stdout", "stdout_hash": "05b1836d726e8b5e20a9bbf2bd15a6abb7c8b94a6cb980b8a71b2651", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-stop1-ed69fc4.json0000664000175000017500000000070415174404631022611 0ustar alastairalastair{ "basename": "ast-stop1-ed69fc4", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/stop1.f90", "infile_hash": "356601f3f1d56abfa1b7d00130c2067cbf3d450b3c563a900ff9ccd5", "outfile": null, "outfile_hash": null, "stdout": "ast-stop1-ed69fc4.stdout", "stdout_hash": "a7ab44ef0c0efa20e61fa2916af8723c319eaab3bbaf705d97527a80", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_fma-fma-071ac0d.json0000664000175000017500000000075015174404631023204 0ustar alastairalastair{ "basename": "pass_fma-fma-071ac0d", "cmd": "lfortran --pass=fma --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/fma.f90", "infile_hash": "e251a7a68d3ac5b04630dacfdd015452826bc4e6954b51124d815868", "outfile": null, "outfile_hash": null, "stdout": "pass_fma-fma-071ac0d.stdout", "stdout_hash": "fb28be32908d03f21ceccdf49843006fb8000eaef8b9db5ccddd7065", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-div_to_mul-3aaf3c0.stdout0000664000175000017500000003311315174404631024227 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { div_to_mul: (Program (SymbolTable 2 { eps: (Variable 2 eps [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pi: (Variable 2 pi [] Local (RealConstant 3.140000 (Real 4) ) (RealConstant 3.140000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local (RealConstant 3.140000 (Real 4) ) (RealConstant 3.140000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) div_to_mul [] [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (Var 2 x) Div (Var 2 pi) (Real 4) () ) Sub (RealConstant 1.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (Var 2 x) Div (RealConstant 2.000000 (Real 4) ) (Real 4) () ) Sub (RealConstant 1.570000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (Cast (Var 2 x) RealToReal (Real 8) () () ) Div (RealConstant 2.000000 (Real 8) ) (Real 8) () ) Sub (Cast (RealConstant 1.570000 (Real 4) ) RealToReal (Real 8) (RealConstant 1.570000 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (Var 2 eps) RealToReal (Real 8) () () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (Var 2 x) Div (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) (Real 4) () ) Sub (RealConstant 1.570000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (IntegerBinOp (Var 2 y) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-nullify_01-24b8fbc.json0000664000175000017500000000075015174404631023514 0ustar alastairalastair{ "basename": "ast-nullify_01-24b8fbc", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nullify_01.f90", "infile_hash": "5869e698f080612903a66a6001fa03b7b3390371a5a9eef3ca48a545", "outfile": null, "outfile_hash": null, "stdout": "ast-nullify_01-24b8fbc.stdout", "stdout_hash": "3151e82d536a6ad5b4eae1384c401db1ca05db8acddf071442b86dcb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-coarray_01-5f111e4.json0000664000175000017500000000073215174404631023324 0ustar alastairalastair{ "basename": "asr-coarray_01-5f111e4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/coarray_01.f90", "infile_hash": "29a734e25fedee38f4866f94dd2b329d1fa657ca46f397d6d4918b7a", "outfile": null, "outfile_hash": null, "stdout": "asr-coarray_01-5f111e4.stdout", "stdout_hash": "36c6a6bac04f0c832ace0900bc476cb2de87338ce2d5376f0285fd0d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-nint_overflow-bf5738b.stderr0000664000175000017500000000023715174404631024703 0ustar alastairalastairsemantic error: Result of `nint` overflows its kind(4) --> tests/errors/nint_overflow.f90:2:13 | 2 | print*, nint(1e12_8) | ^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr_preprocess-cpp_err4-9f3b813.stderr0000664000175000017500000000037215174404631025712 0ustar alastairalastairC preprocessor error: Include file 'does_not_exist.inc' not found. If an include path is available, please use the `-I` option to specify it. --> tests/errors/cpp_err4.f90:2:11 | 2 | #include "does_not_exist.inc" | ^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-derived_types_03-268a4a4.stdout0000664000175000017500000000771515174404631025122 0ustar alastairalastair(TranslationUnit [(Program derived_types_03 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(DerivedType X [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [] ) (Declaration (AttrType TypeType [] () X None ) [] [(b [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Subroutine Y [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(DerivedType A [] () [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [] ) (Declaration (AttrType TypeType [] () A None ) [] [(b [] [] () () None ())] () )] [] [] [] ) (Function Z [] [(AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(DerivedType A [] () [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [] ) (Declaration (AttrType TypeType [] () A None ) [] [(b [] [] () () None ())] () )] [(Assignment 0 Z 5 () )] [] [] )] )] ) lfortran-0.63.0/tests/reference/asr-kind_var_of_int-1199f59.json0000664000175000017500000000075115174404631024461 0ustar alastairalastair{ "basename": "asr-kind_var_of_int-1199f59", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_var_of_int.f90", "infile_hash": "c331e081883c4bb4f2213b9796727af46dfc4feb20a04ab7b4a87881", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_var_of_int-1199f59.stderr", "stderr_hash": "3f3a6b545dd15d259068cc59f9c6cd48f042c7a99cebbf83d6f74e15", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-modules_40-d3a41b5.json0000664000175000017500000000075015174404631023414 0ustar alastairalastair{ "basename": "asr-modules_40-d3a41b5", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_40.f90", "infile_hash": "ac67135d17b966d74eb1c00c48de647510f0b5ae38596bce67d52958", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_40-d3a41b5.stdout", "stdout_hash": "f88ef2e946e8d8f1b4a2e1bfd9ee6895db8b215eded916b8f5cc7476", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit7-2fc9cda.stderr0000664000175000017500000000050115174404631024036 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/implicit7.f90:4:14 | 4 | implicit real*8 (k) | ^ help: write this as 'real(8)' semantic error: Implicit typing is not allowed, enable it by using --implicit-typing --> tests/implicit7.f90:2:1 | 2 | implicit real (n) | ^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-empty-6449c98.json0000664000175000017500000000070415174404631022465 0ustar alastairalastair{ "basename": "asr-empty-6449c98", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/empty.f90", "infile_hash": "d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f", "outfile": null, "outfile_hash": null, "stdout": "asr-empty-6449c98.stdout", "stdout_hash": "664052099c78bf886fd473a09a261db8d03b9b161f9627f50671569c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-arrays_02-d2f7107.json0000664000175000017500000000076015174404631023653 0ustar alastairalastair{ "basename": "ast_f90-arrays_02-d2f7107", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/arrays_02.f90", "infile_hash": "b5b3a6833fd727f5cce92c3c4886c4e20117f33710a1ec8b1016d8f6", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-arrays_02-d2f7107.stdout", "stdout_hash": "65298bf1c791719ae945300789a142c77cab89d2789f78665cbfab04", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-interface_01-b750ffe.stdout0000664000175000017500000000111315174404631025017 0ustar alastairalastairmodule interface_01_mod implicit none interface a module procedure a1 module procedure a2 end interface a contains subroutine a1(a) integer, intent(inout) :: a a = a + 1 end subroutine a1 subroutine a2(a) real, intent(inout) :: a a = a + 1 end subroutine a2 end module interface_01_mod program interface_01 use interface_01_mod, only: a implicit none integer :: i real :: r i = 5 call a(i) if (i /= 6) then error stop end if r = 6 call a(r) if (r /= 7) then error stop end if i = 7 call a(i) if (i /= 8) then error stop end if end program interface_01 lfortran-0.63.0/tests/reference/asr-nested_03-57ffed2.stdout0000664000175000017500000002100315174404631023667 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nested_03: (Program (SymbolTable 5 { b: (ExternalSymbol 5 b 2 b nested_03_a [] b Public ) }) nested_03 [nested_03_a] [(SubroutineCall 5 b () [] () .false. )] ), nested_03_a: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { c: (Function (SymbolTable 4 { }) c (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(IntegerConstant 5 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 3 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), x: (Variable 3 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) b (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 x) (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 6.000000 (Real 4) ) () ) () .false. .false. ) (Print (StringConstant "b()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (SubroutineCall 3 c () [] () .false. )] () Public .false. .false. () ) }) nested_03_a () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-incorrect_type_where_02-1746f84.stderr0000664000175000017500000000023215174404631026372 0ustar alastairalastairsemantic error: the argument to `where` must be an array --> tests/errors/incorrect_type_where_02.f90:5:10 | 5 | where(1) b = 12121 | ^ lfortran-0.63.0/tests/reference/asr-template_error_03-b5d4715.json0000664000175000017500000000075715174404631024726 0ustar alastairalastair{ "basename": "asr-template_error_03-b5d4715", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_03.f90", "infile_hash": "4743dafccb75c38c0fc3dca110e00f7f4b196d13ddafa738fb452c2e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_03-b5d4715.stderr", "stderr_hash": "6095d56945a69f5d4751e71a00a7c318bcfff1c3eeb59cf1fa742bdb", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-expr5-3c9d655.json0000664000175000017500000000070415174404631022444 0ustar alastairalastair{ "basename": "ast-expr5-3c9d655", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/expr5.f90", "infile_hash": "030f3f956944c6d24d536fd1f434f877d95bf12aac6f367d2ad1827e", "outfile": null, "outfile_hash": null, "stdout": "ast-expr5-3c9d655.stdout", "stdout_hash": "8626e1d712d0239ce42b57162895d1011f9ef06bf475c4a6f5450154", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-do5-4355d03.json0000664000175000017500000000067615174404631022005 0ustar alastairalastair{ "basename": "ast-do5-4355d03", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do5.f90", "infile_hash": "40afe61b24ba33f887c21814d38e1b5657ee19b58338522032a6b678", "outfile": null, "outfile_hash": null, "stdout": "ast-do5-4355d03.stdout", "stdout_hash": "f97e9376b8c615b0d020dabd59ec1cf6b0dfd57186c80e9f3fa2cba7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_openmp-openmp_39-aaf2ba8.stdout0000664000175000017500000056557515174404631025367 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), omp_lib: (Module (SymbolTable 4 { c_bool: (ExternalSymbol 4 c_bool 39 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 4 c_funptr 39 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 4 c_int 39 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 4 c_long 39 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 4 c_ptr 39 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (Function (SymbolTable 5 { }) gomp_atomic_end (FunctionType [] () BindC Interface "GOMP_atomic_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_atomic_start: (Function (SymbolTable 6 { }) gomp_atomic_start (FunctionType [] () BindC Interface "GOMP_atomic_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_barrier: (Function (SymbolTable 7 { }) gomp_barrier (FunctionType [] () BindC Interface "GOMP_barrier" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_end: (Function (SymbolTable 8 { }) gomp_critical_end (FunctionType [] () BindC Interface "GOMP_critical_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_start: (Function (SymbolTable 9 { }) gomp_critical_start (FunctionType [] () BindC Interface "GOMP_critical_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_auto_next: (Function (SymbolTable 10 { gomp_loop_auto_next: (Variable 10 gomp_loop_auto_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 10 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 10 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_auto_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_auto_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 istart) (Var 10 iend)] [] (Var 10 gomp_loop_auto_next) Public .false. .false. () ), gomp_loop_auto_start: (Function (SymbolTable 11 { end: (Variable 11 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_auto_start: (Variable 11 gomp_loop_auto_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 11 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 11 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 11 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 11 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_auto_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_auto_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 start) (Var 11 end) (Var 11 incr) (Var 11 istart) (Var 11 iend)] [] (Var 11 gomp_loop_auto_start) Public .false. .false. () ), gomp_loop_dynamic_next: (Function (SymbolTable 12 { gomp_loop_dynamic_next: (Variable 12 gomp_loop_dynamic_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 12 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 12 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_dynamic_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_dynamic_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 istart) (Var 12 iend)] [] (Var 12 gomp_loop_dynamic_next) Public .false. .false. () ), gomp_loop_dynamic_start: (Function (SymbolTable 13 { chunk: (Variable 13 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), end: (Variable 13 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_dynamic_start: (Variable 13 gomp_loop_dynamic_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 13 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 13 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 13 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 13 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_dynamic_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_dynamic_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 start) (Var 13 end) (Var 13 incr) (Var 13 chunk) (Var 13 istart) (Var 13 iend)] [] (Var 13 gomp_loop_dynamic_start) Public .false. .false. () ), gomp_loop_end: (Function (SymbolTable 14 { }) gomp_loop_end (FunctionType [] () BindC Interface "GOMP_loop_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_end_nowait: (Function (SymbolTable 15 { }) gomp_loop_end_nowait (FunctionType [] () BindC Interface "GOMP_loop_end_nowait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_guided_next: (Function (SymbolTable 16 { gomp_loop_guided_next: (Variable 16 gomp_loop_guided_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 16 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 16 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_guided_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_guided_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 16 istart) (Var 16 iend)] [] (Var 16 gomp_loop_guided_next) Public .false. .false. () ), gomp_loop_guided_start: (Function (SymbolTable 17 { chunk: (Variable 17 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), end: (Variable 17 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_guided_start: (Variable 17 gomp_loop_guided_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 17 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 17 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 17 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 17 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_guided_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_guided_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 start) (Var 17 end) (Var 17 incr) (Var 17 chunk) (Var 17 istart) (Var 17 iend)] [] (Var 17 gomp_loop_guided_start) Public .false. .false. () ), gomp_loop_runtime_next: (Function (SymbolTable 18 { gomp_loop_runtime_next: (Variable 18 gomp_loop_runtime_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 18 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 18 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_runtime_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_runtime_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 18 istart) (Var 18 iend)] [] (Var 18 gomp_loop_runtime_next) Public .false. .false. () ), gomp_loop_runtime_start: (Function (SymbolTable 19 { end: (Variable 19 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_runtime_start: (Variable 19 gomp_loop_runtime_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 19 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 19 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 19 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 19 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_runtime_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_runtime_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 19 start) (Var 19 end) (Var 19 incr) (Var 19 istart) (Var 19 iend)] [] (Var 19 gomp_loop_runtime_start) Public .false. .false. () ), gomp_loop_static_next: (Function (SymbolTable 20 { gomp_loop_static_next: (Variable 20 gomp_loop_static_next [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 20 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 20 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_static_next (FunctionType [(Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_static_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 istart) (Var 20 iend)] [] (Var 20 gomp_loop_static_next) Public .false. .false. () ), gomp_loop_static_start: (Function (SymbolTable 21 { chunk: (Variable 21 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), end: (Variable 21 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_loop_static_start: (Variable 21 gomp_loop_static_start [] ReturnVar () () Default (Logical 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iend: (Variable 21 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), incr: (Variable 21 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), istart: (Variable 21 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), start: (Variable 21 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_loop_static_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 1) BindC Interface "GOMP_loop_static_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 21 start) (Var 21 end) (Var 21 incr) (Var 21 chunk) (Var 21 istart) (Var 21 iend)] [] (Var 21 gomp_loop_static_start) Public .false. .false. () ), gomp_parallel: (Function (SymbolTable 22 { data: (Variable 22 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), flags: (Variable 22 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), fn: (Variable 22 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), num_threads: (Variable 22 num_threads [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_parallel (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_parallel" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 22 fn) (Var 22 data) (Var 22 num_threads) (Var 22 flags)] [] () Public .false. .false. () ), gomp_sections_end: (Function (SymbolTable 23 { }) gomp_sections_end (FunctionType [] () BindC Interface "GOMP_sections_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_sections_next: (Function (SymbolTable 24 { gomp_sections_next: (Variable 24 gomp_sections_next [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_sections_next (FunctionType [] (Integer 4) BindC Interface "GOMP_sections_next" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 24 gomp_sections_next) Public .false. .false. () ), gomp_sections_start: (Function (SymbolTable 25 { count: (Variable 25 count [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), gomp_sections_start: (Variable 25 gomp_sections_start [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_sections_start (FunctionType [(Integer 4)] (Integer 4) BindC Interface "GOMP_sections_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 25 count)] [] (Var 25 gomp_sections_start) Public .false. .false. () ), gomp_task: (Function (SymbolTable 26 { arg_align: (Variable 26 arg_align [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), arg_size: (Variable 26 arg_size [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), cpyfn: (Variable 26 cpyfn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), data: (Variable 26 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), depend: (Variable 26 depend [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), flags: (Variable 26 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), fn: (Variable 26 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), if_clause: (Variable 26 if_clause [] Unspecified () () Default (Logical 1) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_task (FunctionType [(CPtr) (CPtr) (CPtr) (Integer 8) (Integer 8) (Logical 1) (Integer 4) (CPtr)] () BindC Interface "GOMP_task" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 26 fn) (Var 26 data) (Var 26 cpyfn) (Var 26 arg_size) (Var 26 arg_align) (Var 26 if_clause) (Var 26 flags) (Var 26 depend)] [] () Public .false. .false. () ), gomp_taskwait: (Function (SymbolTable 27 { }) gomp_taskwait (FunctionType [] () BindC Interface "GOMP_taskwait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_teams: (Function (SymbolTable 28 { data: (Variable 28 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), fn: (Variable 28 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), num_teams: (Variable 28 num_teams [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), thread_limit: (Variable 28 thread_limit [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) gomp_teams (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_teams_reg" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 28 fn) (Var 28 data) (Var 28 num_teams) (Var 28 thread_limit)] [] () Public .false. .false. () ), omp_get_max_threads: (Function (SymbolTable 29 { omp_get_max_threads: (Variable 29 omp_get_max_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_max_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_max_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 29 omp_get_max_threads) Public .false. .false. () ), omp_get_num_procs: (Function (SymbolTable 30 { omp_get_num_procs: (Variable 30 omp_get_num_procs [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_num_procs (FunctionType [] (Integer 4) BindC Interface "omp_get_num_procs" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 30 omp_get_num_procs) Public .false. .false. () ), omp_get_num_teams: (Function (SymbolTable 31 { omp_get_num_teams: (Variable 31 omp_get_num_teams [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_num_teams (FunctionType [] (Integer 4) BindC Interface "omp_get_num_teams" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 31 omp_get_num_teams) Public .false. .false. () ), omp_get_num_threads: (Function (SymbolTable 32 { omp_get_num_threads: (Variable 32 omp_get_num_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_num_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 32 omp_get_num_threads) Public .false. .false. () ), omp_get_team_num: (Function (SymbolTable 33 { omp_get_team_num: (Variable 33 omp_get_team_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_team_num (FunctionType [] (Integer 4) BindC Interface "omp_get_team_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 33 omp_get_team_num) Public .false. .false. () ), omp_get_team_size: (Function (SymbolTable 34 { level: (Variable 34 level [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), omp_get_team_size: (Variable 34 omp_get_team_size [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_team_size (FunctionType [(Integer 4)] (Integer 4) BindC Interface "omp_get_team_size" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 34 level)] [] (Var 34 omp_get_team_size) Public .false. .false. () ), omp_get_thread_num: (Function (SymbolTable 35 { omp_get_thread_num: (Variable 35 omp_get_thread_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_thread_num (FunctionType [] (Integer 4) BindC Interface "omp_get_thread_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 35 omp_get_thread_num) Public .false. .false. () ), omp_get_wtime: (Function (SymbolTable 36 { omp_get_wtime: (Variable 36 omp_get_wtime [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_get_wtime (FunctionType [] (Real 8) BindC Interface "omp_get_wtime" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 36 omp_get_wtime) Public .false. .false. () ), omp_set_num_threads: (Function (SymbolTable 37 { n: (Variable 37 n [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) omp_set_num_threads (FunctionType [(Integer 4)] () BindC Interface "omp_set_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 37 n)] [] () Public .false. .false. () ) }) omp_lib () [iso_c_binding] .true. .false. .false. ), openmp_39: (Program (SymbolTable 2 { c_bool: (ExternalSymbol 2 c_bool 39 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 2 c_funptr 39 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 2 c_int 39 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 2 c_long 39 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 2 c_ptr 39 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (ExternalSymbol 2 gomp_atomic_end 4 gomp_atomic_end omp_lib [] gomp_atomic_end Public ), gomp_atomic_start: (ExternalSymbol 2 gomp_atomic_start 4 gomp_atomic_start omp_lib [] gomp_atomic_start Public ), gomp_barrier: (ExternalSymbol 2 gomp_barrier 4 gomp_barrier omp_lib [] gomp_barrier Public ), gomp_critical_end: (ExternalSymbol 2 gomp_critical_end 4 gomp_critical_end omp_lib [] gomp_critical_end Public ), gomp_critical_start: (ExternalSymbol 2 gomp_critical_start 4 gomp_critical_start omp_lib [] gomp_critical_start Public ), gomp_loop_auto_next: (ExternalSymbol 2 gomp_loop_auto_next 4 gomp_loop_auto_next omp_lib [] gomp_loop_auto_next Public ), gomp_loop_auto_start: (ExternalSymbol 2 gomp_loop_auto_start 4 gomp_loop_auto_start omp_lib [] gomp_loop_auto_start Public ), gomp_loop_dynamic_next: (ExternalSymbol 2 gomp_loop_dynamic_next 4 gomp_loop_dynamic_next omp_lib [] gomp_loop_dynamic_next Public ), gomp_loop_dynamic_start: (ExternalSymbol 2 gomp_loop_dynamic_start 4 gomp_loop_dynamic_start omp_lib [] gomp_loop_dynamic_start Public ), gomp_loop_end: (ExternalSymbol 2 gomp_loop_end 4 gomp_loop_end omp_lib [] gomp_loop_end Public ), gomp_loop_end_nowait: (ExternalSymbol 2 gomp_loop_end_nowait 4 gomp_loop_end_nowait omp_lib [] gomp_loop_end_nowait Public ), gomp_loop_guided_next: (ExternalSymbol 2 gomp_loop_guided_next 4 gomp_loop_guided_next omp_lib [] gomp_loop_guided_next Public ), gomp_loop_guided_start: (ExternalSymbol 2 gomp_loop_guided_start 4 gomp_loop_guided_start omp_lib [] gomp_loop_guided_start Public ), gomp_loop_runtime_next: (ExternalSymbol 2 gomp_loop_runtime_next 4 gomp_loop_runtime_next omp_lib [] gomp_loop_runtime_next Public ), gomp_loop_runtime_start: (ExternalSymbol 2 gomp_loop_runtime_start 4 gomp_loop_runtime_start omp_lib [] gomp_loop_runtime_start Public ), gomp_loop_static_next: (ExternalSymbol 2 gomp_loop_static_next 4 gomp_loop_static_next omp_lib [] gomp_loop_static_next Public ), gomp_loop_static_start: (ExternalSymbol 2 gomp_loop_static_start 4 gomp_loop_static_start omp_lib [] gomp_loop_static_start Public ), gomp_parallel: (ExternalSymbol 2 gomp_parallel 4 gomp_parallel omp_lib [] gomp_parallel Public ), gomp_sections_end: (ExternalSymbol 2 gomp_sections_end 4 gomp_sections_end omp_lib [] gomp_sections_end Public ), gomp_sections_next: (ExternalSymbol 2 gomp_sections_next 4 gomp_sections_next omp_lib [] gomp_sections_next Public ), gomp_sections_start: (ExternalSymbol 2 gomp_sections_start 4 gomp_sections_start omp_lib [] gomp_sections_start Public ), gomp_task: (ExternalSymbol 2 gomp_task 4 gomp_task omp_lib [] gomp_task Public ), gomp_taskwait: (ExternalSymbol 2 gomp_taskwait 4 gomp_taskwait omp_lib [] gomp_taskwait Public ), gomp_teams: (ExternalSymbol 2 gomp_teams 4 gomp_teams omp_lib [] gomp_teams Public ), ik: (Variable 2 ik [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ix: (Variable 2 ix [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iy: (Variable 2 iy [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iz: (Variable 2 iz [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), nk: (Variable 2 nk [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), nx: (Variable 2 nx [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ny: (Variable 2 ny [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), nz: (Variable 2 nz [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), omp_get_max_threads: (ExternalSymbol 2 omp_get_max_threads 4 omp_get_max_threads omp_lib [] omp_get_max_threads Public ), omp_get_num_procs: (ExternalSymbol 2 omp_get_num_procs 4 omp_get_num_procs omp_lib [] omp_get_num_procs Public ), omp_get_num_teams: (ExternalSymbol 2 omp_get_num_teams 4 omp_get_num_teams omp_lib [] omp_get_num_teams Public ), omp_get_num_threads: (ExternalSymbol 2 omp_get_num_threads 4 omp_get_num_threads omp_lib [] omp_get_num_threads Public ), omp_get_team_num: (ExternalSymbol 2 omp_get_team_num 4 omp_get_team_num omp_lib [] omp_get_team_num Public ), omp_get_team_size: (ExternalSymbol 2 omp_get_team_size 4 omp_get_team_size omp_lib [] omp_get_team_size Public ), omp_get_thread_num: (ExternalSymbol 2 omp_get_thread_num 4 omp_get_thread_num omp_lib [] omp_get_thread_num Public ), omp_get_wtime: (ExternalSymbol 2 omp_get_wtime 4 omp_get_wtime omp_lib [] omp_get_wtime Public ), omp_set_num_threads: (ExternalSymbol 2 omp_set_num_threads 4 omp_set_num_threads omp_lib [] omp_set_num_threads Public ) }) openmp_39 [omp_lib] [(Assignment (Var 2 ny) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 nx) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 nz) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 nk) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (OMPRegion ParallelDo [(OMPCollapse (IntegerConstant 2 (Integer 4) Decimal) ) (OMPPrivate [(Var 2 iy) (Var 2 ix) (Var 2 iz)] )] [(DoLoop () ((Var 2 ix) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nx) ()) [(DoLoop () ((Var 2 iy) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 ny) ()) [(Print (StringFormat () [(StringConstant "iy->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 iy) (StringConstant "ix->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 ix)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (DoLoop () ((Var 2 iz) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nz) ()) [(DoLoop () ((Var 2 ik) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nk) ()) [(Print (StringFormat () [(StringConstant "iy->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 iy) (StringConstant "ix->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 ix) (StringConstant "iz->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 iz) (StringConstant "ik->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 ik)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] [] )] [] )] [] )] )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-external_04-30bc1c7.json0000664000175000017500000000076515174404631023760 0ustar alastairalastair{ "basename": "llvm-external_04-30bc1c7", "cmd": "lfortran --show-llvm --implicit-typing --implicit-interface {infile} -o {outfile}", "infile": "tests/external_04.f90", "infile_hash": "a5c33c0669ed285af4ed4856e01d35a773adcd4be529adc807f976c5", "outfile": null, "outfile_hash": null, "stdout": "llvm-external_04-30bc1c7.stdout", "stdout_hash": "b2a2d7d11049e1890bd87d1d3801d224c2d47c1f2b9fade964fc84e0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/fortran-char1-046b501.json0000664000175000017500000000072015174404631023160 0ustar alastairalastair{ "basename": "fortran-char1-046b501", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/char1.f90", "infile_hash": "78e727aecb70503bac5e780ad046d418a533f576cf7b276702bb6be1", "outfile": null, "outfile_hash": null, "stdout": "fortran-char1-046b501.stdout", "stdout_hash": "0cfff190b9bc6faa04d49564977f2c4b9ce679079123ba496b90a194", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_03-a79d86f.json0000664000175000017500000000072415174404631023107 0ustar alastairalastair{ "basename": "asr-array_03-a79d86f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_03.f90", "infile_hash": "19770180604e3013e99175b497b5992be18301c5f8a91174421a9141", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_03-a79d86f.stderr", "stderr_hash": "051376a2fbb500d15ca55738c4ada5da3d63802af41092985da8580c", "returncode": 2 }lfortran-0.63.0/tests/reference/run-format_11-72f8b07.stdout0000664000175000017500000000011015174404631023544 0ustar alastairalastairtest writing a logical formatted write T F using print T F lfortran-0.63.0/tests/reference/pass_div_to_mul-div_to_mul-d0027c6.stdout0000664000175000017500000003261015174404631026477 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { div_to_mul: (Program (SymbolTable 2 { eps: (Variable 2 eps [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pi: (Variable 2 pi [] Local (RealConstant 3.140000 (Real 4) ) (RealConstant 3.140000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local (RealConstant 3.140000 (Real 4) ) (RealConstant 3.140000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) div_to_mul [] [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (Var 2 x) Mul (RealConstant 0.318471 (Real 4) ) (Real 4) () ) Sub (RealConstant 1.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (Var 2 x) Mul (RealConstant 0.500000 (Real 4) ) (Real 4) () ) Sub (RealConstant 1.570000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (Cast (Var 2 x) RealToReal (Real 8) () () ) Mul (RealConstant 0.500000 (Real 8) ) (Real 8) () ) Sub (Cast (RealConstant 1.570000 (Real 4) ) RealToReal (Real 8) (RealConstant 1.570000 (Real 8) ) () ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (Var 2 eps) RealToReal (Real 8) () () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (Var 2 x) Mul (RealConstant 0.500000 (Real 4) ) (Real 4) () ) Sub (RealConstant 1.570000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (IntegerBinOp (Var 2 y) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-loop_unroll_small-13135c0.stdout0000664000175000017500000003372515174404631025412 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { loop_unroll_small: (Program (SymbolTable 2 { array: (Variable 2 array [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), first: (Variable 2 first [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), last: (Variable 2 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), print_subrout: (Function (SymbolTable 3 { x: (Variable 3 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) print_subrout (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [(Print (StringFormat () [(Var 3 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) loop_unroll_small [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. )] [] ) (Assignment (Var 2 first) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 last) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (Var 2 first) (Var 2 last) ()) [(Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (IntegerBinOp (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) ()) [(Assignment (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) () .false. .false. ) (SubroutineCall 2 print_subrout () [((Var 2 x))] () .false. )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) ()) [(Assignment (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) () .false. .false. ) (If () (IntegerCompare (Var 2 x) NotEq (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 2 i) (Integer 4) () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/wat-logical3-ce72150.json0000664000175000017500000000104415174404631023064 0ustar alastairalastair{ "basename": "wat-logical3-ce72150", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/logical3.f90", "infile_hash": "d7f7994a85ee59f1b3b80060886eeeb7390f9733461bd9349e4bb7c0", "outfile": null, "outfile_hash": null, "stdout": "wat-logical3-ce72150.stdout", "stdout_hash": "0df3e13f4cffdb0b2d0fb9e7b841d761ccca090c557b1399e6307440", "stderr": "wat-logical3-ce72150.stderr", "stderr_hash": "d7e28e54d198e14f86c18ab4c4ad128018b9bc6523fb945b05607a57", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-nested_06-1d576ad.stdout0000664000175000017500000001752615174404631023622 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nested_06: (Program (SymbolTable 5 { b: (ExternalSymbol 5 b 2 b nested_06_a [] b Public ) }) nested_06 [nested_06_a] [(SubroutineCall 5 b () [((RealConstant 6.000000 (Real 4) ))] () .false. )] ), nested_06_a: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { c: (Function (SymbolTable 4 { }) c (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(IntegerConstant 5 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 3 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), x: (Variable 3 x [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) b (FunctionType [(Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [(Print (StringConstant "b()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (SubroutineCall 3 c () [] () .false. )] () Public .false. .false. () ) }) nested_06_a () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-recursion_02-20a7daf.json0000664000175000017500000000075615174404631024042 0ustar alastairalastair{ "basename": "asr-recursion_02-20a7daf", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/recursion_02.f90", "infile_hash": "2935948fa13844b5a3b169f1d6df99e22cd1329310ef7c6d0f152583", "outfile": null, "outfile_hash": null, "stdout": "asr-recursion_02-20a7daf.stdout", "stdout_hash": "af3a1a87e513bb22a7e6adfdb3d13382cdaa2d467d374c149d8e0de2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-subroutines_04-c6808b6.stdout0000664000175000017500000000016215174404631025150 0ustar alastairalastairfunction print_int() local a::Int32 a = 5 println(a) end function main() print_int() end main() lfortran-0.63.0/tests/reference/asr-intrinsics11-7200632.stderr0000664000175000017500000000025315174404631024100 0ustar alastairalastairsemantic error: Kind of all the arguments of Hypot must be the same --> tests/errors/intrinsics11.f90:4:14 | 4 | print *, hypot(x, y) | ^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast_json-special_chars_json-219ee5a.stdout0000664000175000017500000001241515174404631026707 0ustar alastairalastair{ "node": "TranslationUnit", "fields": { "items": [ { "node": "Program", "fields": { "name": "special_chars_json", "trivia": { "node": "TriviaNode", "fields": { "inside": [ { "node": "EndOfLine", "fields": {}, "loc": { "first": 26, "last": 26, "first_filename": "tests/special_chars_json.f90", "first_line": 1, "first_column": 27, "last_filename": "tests/special_chars_json.f90", "last_line": 1, "last_column": 27 } }, { "node": "Comment", "fields": { "comment": "! A \"comment\"." }, "loc": { "first": 31, "last": 45, "first_filename": "tests/special_chars_json.f90", "first_line": 2, "first_column": 5, "last_filename": "tests/special_chars_json.f90", "last_line": 2, "last_column": 19 } } ], "after": [] }, "loc": { "first": 0, "last": 77, "first_filename": "tests/special_chars_json.f90", "first_line": 1, "first_column": 1, "last_filename": "tests/special_chars_json.f90", "last_line": 4, "last_column": 3 } }, "use": [], "implicit": [], "decl": [], "body": [ { "node": "Print", "fields": { "label": 0, "fmt": [], "values": [ { "node": "String", "fields": { "s": "A \"string\".", "kind": [] }, "loc": { "first": 59, "last": 73, "first_filename": "tests/special_chars_json.f90", "first_line": 3, "first_column": 14, "last_filename": "tests/special_chars_json.f90", "last_line": 3, "last_column": 28 } } ], "trivia": [] }, "loc": { "first": 50, "last": 73, "first_filename": "tests/special_chars_json.f90", "first_line": 3, "first_column": 5, "last_filename": "tests/special_chars_json.f90", "last_line": 3, "last_column": 28 } } ], "contains": [] }, "loc": { "first": 0, "last": 77, "first_filename": "tests/special_chars_json.f90", "first_line": 1, "first_column": 1, "last_filename": "tests/special_chars_json.f90", "last_line": 4, "last_column": 3 } } ] }, "loc": { "first": 0, "last": 77, "first_filename": "tests/special_chars_json.f90", "first_line": 1, "first_column": 1, "last_filename": "tests/special_chars_json.f90", "last_line": 4, "last_column": 3 } } lfortran-0.63.0/tests/reference/asr-dim_float_03-ba04334.json0000664000175000017500000000074015174404631023615 0ustar alastairalastair{ "basename": "asr-dim_float_03-ba04334", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dim_float_03.f90", "infile_hash": "6ab0d9c80a8018b90b40b497e17a141b9c4deaec85ab09280876a6dc", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dim_float_03-ba04334.stderr", "stderr_hash": "0995a1c8968ea0a5c97822ab5a4828b8c8d9c4c3c0d5a15f0a8c9739", "returncode": 2 }lfortran-0.63.0/tests/reference/ast_f90-types_13-ddae644.stdout0000664000175000017500000000330315174404631024226 0ustar alastairalastairprogram types_13 use iso_c_binding, only: c_int, c_double, c_char implicit none interface subroutine g(d) character*(*) :: d end subroutine g subroutine g2(d) character(len=*) :: d end subroutine g2 subroutine g3(d) import :: c_char character(len=*, kind=c_char) :: d end subroutine g3 subroutine g4(d) import :: c_char character(len=*, kind=c_char) :: d end subroutine g4 subroutine g5(d) import :: c_char character(len=*, kind=c_char) :: d end subroutine g5 subroutine g6(d) character(len=5) :: d end subroutine g6 integer(c_int) function f1(a, b, c, d) result(r) bind(c) import :: c_int, c_double integer(4), value, intent(in) :: a real(8), value, intent(in) :: b logical(4) :: c end function f1 integer(c_int) function f2(a, b, c, d) result(r) bind(c) import :: c_int, c_double integer(4), value, intent(in) :: a real(8), value, intent(in) :: b logical(4) :: c end function f2 function f3(a, b, c, d) result(r) bind(c) import :: c_int, c_double integer(c_int) :: r integer(4), value, intent(in) :: a real(8), value, intent(in) :: b logical(4) :: c end function f3 function f4(a, b, c, d) result(r) bind(c) import :: c_int, c_double integer(c_int) :: r integer(4), value, intent(in) :: a real(8), value, intent(in) :: b logical(4) :: c end function f4 subroutine f5(a, b, c) bind(C, name="_cf5") import :: c_int import :: c_double integer(c_int) :: r integer(c_int), value, intent(in) :: a real(c_double), value, intent(in) :: b logical :: c end subroutine f5 end interface end program types_13 lfortran-0.63.0/tests/reference/ast_f90-nullify1-b3931cb.json0000664000175000017500000000073015174404631023665 0ustar alastairalastair{ "basename": "ast_f90-nullify1-b3931cb", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/nullify1.f90", "infile_hash": "f996667719f3f2215e2bf25d7fe502ab13f032f4d8b29b0a3f1329d1", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-nullify1-b3931cb.stdout", "stdout_hash": "a87cb1b05a7d04e6a08460e5e2c0abc36d3edd72ff3a2ccc357b74ec", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-case_03-b14adab.json0000664000175000017500000000073715174404631023020 0ustar alastairalastair{ "basename": "ast-case_03-b14adab", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_03.f90", "infile_hash": "4fc1bb48b2136f22bb44b7c69aaa05a43b4ed2e4b8464c433340295d", "outfile": null, "outfile_hash": null, "stdout": "ast-case_03-b14adab.stdout", "stdout_hash": "a895e1d914824f244fa736829111ef96d85f691b942756c0d4eaaf6a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-init_values-b1d5491.stdout0000664000175000017500000001076415174404631024455 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> %complex_4 = type <{ float, float }> @s_data = private global [4 x i8] c"left" @s = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @s_data, i32 0, i32 0), i64 4 }> @s1_data = private global [1 x i8] c"l" @s1 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @s1_data, i32 0, i32 0), i64 1 }> @s2_data = private global [3 x i8] c"eft" @s2 = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @s2_data, i32 0, i32 0), i64 3 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [40 x i8] c"I4,I4,R4,{R4,R4},I4,L32,L32,R4,S-DESC-4\00", align 1 @string_const_data = private constant [4 x i8] c"left" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 store i32 1, i32* %i, align 4 %j = alloca i32, align 4 store i32 2, i32* %j, align 4 %a = alloca i32, align 4 store i32 3, i32* %a, align 4 %l = alloca i32, align 4 store i32 1, i32* %l, align 4 %b = alloca i32, align 4 store i32 1, i32* %b, align 4 %c = alloca %complex_4, align 8 store %complex_4 <{ float 3.000000e+00, float 4.000000e+00 }>, %complex_4* %c, align 1 %r = alloca float, align 4 store float 4.000000e+00, float* %r, align 4 %r_minus = alloca float, align 4 store float -4.000000e+00, float* %r_minus, align 4 %3 = alloca i64, align 8 %4 = alloca i32, align 4 store i32 1, i32* %4, align 4 %5 = alloca i32, align 4 store i32 2, i32* %5, align 4 %6 = alloca float, align 4 store float 4.000000e+00, float* %6, align 4 %7 = alloca %complex_4, align 8 store %complex_4 <{ float 3.000000e+00, float 4.000000e+00 }>, %complex_4* %7, align 1 %8 = alloca i32, align 4 store i32 3, i32* %8, align 4 %9 = alloca i32, align 4 store i32 1, i32* %9, align 4 %10 = alloca i32, align 4 store i32 1, i32* %10, align 4 %11 = alloca float, align 4 store float -4.000000e+00, float* %11, align 4 %12 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %4, i32* %5, float* %6, %complex_4* %7, i32* %8, i32* %9, i32* %10, float* %11, %string_descriptor* @string_const) %13 = load i64, i64* %3, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %12, i8** %14, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %13, i64* %15, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %17 = load i8*, i8** %16, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %19 = load i64, i64* %18, align 8 %20 = trunc i64 %19 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %17, i32 %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %21 = icmp eq i8* %12, null br i1 %21, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %12) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_init_values FINALIZE_SYMTABLE_init_values: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-redeclaration1-9d7c988.json0000664000175000017500000000076115174404631024314 0ustar alastairalastair{ "basename": "asr-redeclaration1-9d7c988", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/redeclaration1.f90", "infile_hash": "ff81dd9b45f6ed6a45cc24ac800b39403510201002affa3577c4216a", "outfile": null, "outfile_hash": null, "stdout": "asr-redeclaration1-9d7c988.stdout", "stdout_hash": "003d707ad7dbcf600458c2ccacb2b0f924aa573efe87182f28b68406", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-goto_04-ac607ff.stdout0000664000175000017500000000210615174404631023672 0ustar alastairalastairfunction main() local a::Int32 local n::Int32 n = 2 a = 10 if n - 1 == 1 @goto label_1 elseif n - 1 == 2 @goto label_2 elseif n - 1 == 3 @goto label_3 end a = a + 5 @label label_1 a = a + 10 @label label_2 a = a + 20 @label label_3 a = a + 30 if a ≠ 70 println(Base.stderr, "ERROR STOP") exit(1) end if n + 1 == 1 @goto label_4 elseif n + 1 == 2 @goto label_5 elseif n + 1 == 3 @goto label_6 end a = a + 5 @label label_4 a = a + 40 @label label_5 a = a + 50 @label label_6 a = a + 60 if a ≠ 130 println(Base.stderr, "ERROR STOP") exit(1) end if n * n == 1 @goto label_7 elseif n * n == 2 @goto label_8 elseif n * n == 3 @goto label_9 end a = a + 5 @label label_7 a = a + 70 @label label_8 a = a + 80 @label label_9 a = a + 90 if a ≠ 375 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-0.63.0/tests/reference/asr-intrinsics_20-771801a.json0000664000175000017500000000076115174404631023776 0ustar alastairalastair{ "basename": "asr-intrinsics_20-771801a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_20.f90", "infile_hash": "3ea299463f57ee7d2281d80a1fd624c38fd727a70415dda79ee12d6b", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_20-771801a.stdout", "stdout_hash": "2513ce37b2ec5a7b64c45f5bc9efdc8233d806933506f7c81c8301d9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-data_implied_do2-fc94c6e.json0000664000175000017500000000075415174404631024725 0ustar alastairalastair{ "basename": "asr-data_implied_do2-fc94c6e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/data_implied_do2.f90", "infile_hash": "4d1460374ba43c05e4fe5c98325127f075dba71e6caf69b8ad00e706", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-data_implied_do2-fc94c6e.stderr", "stderr_hash": "abf35a8c715ce96aa96eabb23d0bcdbedc417b1fc9dba47bdcb3bc77", "returncode": 2 }lfortran-0.63.0/tests/reference/pass_loop_unroll-loop_unroll_large-8723774.json0000664000175000017500000000105215174404631027562 0ustar alastairalastair{ "basename": "pass_loop_unroll-loop_unroll_large-8723774", "cmd": "lfortran --pass=loop_unroll --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/loop_unroll_large.f90", "infile_hash": "6dea35d299ef0d2baadd87d2ed6132d3e57e15e85a4bef2d609d1d22", "outfile": null, "outfile_hash": null, "stdout": "pass_loop_unroll-loop_unroll_large-8723774.stdout", "stdout_hash": "885acaa07f43d9e1149a61a4d4db8b2cc45eb4e699eb76329372bf36", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor3-1a6f5d9.json0000664000175000017500000000077015174404631026535 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor3-1a6f5d9", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor3.f90", "infile_hash": "58f83679f37f6f12b4b6df79723a6938e7bf118e3f12170ffe46a2d4", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor3-1a6f5d9.stdout", "stdout_hash": "041f705ee156f17db30ff2e077f12ad682661871b5ddf02c5ac2d7e0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_334-6d740cf.stdout0000664000175000017500000011732415174404631024610 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_334: (Program (SymbolTable 2 { 1_toml_value_x: (ExternalSymbol 2 1_toml_value_x 4 x toml_value [] x Public ), base: (Struct (SymbolTable 3 { id: (Variable 3 id [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) base (StructType [(Integer 4)] [] .true. .false. ) [] [id] [] Source Public .false. .true. [] () () [] ), from: (Variable 2 from [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), struct_from: (Variable 2 struct_from [] Local () () Default (Allocatable (StructType [(Integer 4)] [] .true. .false. ) ) 2 toml_value Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), struct_from2: (Variable 2 struct_from2 [] Local () () Default (Allocatable (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 toml_value Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), struct_from3: (Variable 2 struct_from3 [] Local () () Default (Allocatable (StructType [(Integer 4)] [] .false. .false. ) ) 2 toml_value Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), struct_to: (Variable 2 struct_to [] Local () () Default (Allocatable (StructType [(Integer 4)] [] .true. .false. ) ) 2 toml_value Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), struct_to2: (Variable 2 struct_to2 [] Local () () Default (Allocatable (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 toml_value Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), struct_to3: (Variable 2 struct_to3 [] Local () () Default (Allocatable (StructType [(Integer 4)] [] .false. .false. ) ) 2 base Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), to: (Variable 2 to [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), toml_value: (Struct (SymbolTable 4 { x: (Variable 4 x [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_value (StructType [(Integer 4)] [] .true. .false. ) [] [x] [] Source Public .false. .false. [] () 2 base [] ), ~select_type_block_: (Block (SymbolTable 5 { 1_toml_value_x: (ExternalSymbol 5 1_toml_value_x 4 x toml_value [] x Public ) }) ~select_type_block_ [(If () (IntegerCompare (StructInstanceMember (Cast (Var 2 struct_to3) ClassToStruct (StructType [(Integer 4)] [] .true. .false. ) () (Var 2 toml_value) ) 5 1_toml_value_x (Integer 4) () ) NotEq (IntegerConstant 123 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), ~select_type_block_1: (Block (SymbolTable 6 { 1_toml_value_x: (ExternalSymbol 6 1_toml_value_x 4 x toml_value [] x Public ) }) ~select_type_block_1 [(If () (IntegerCompare (StructInstanceMember (Cast (Var 2 struct_to3) ClassToStruct (StructType [(Integer 4)] [] .true. .false. ) () (Var 2 toml_value) ) 6 1_toml_value_x (Integer 4) () ) NotEq (IntegerConstant 42 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), ~select_type_block_2: (Block (SymbolTable 7 { }) ~select_type_block_2 [(ErrorStop () )] ) }) intrinsics_334 [] [(Allocate [((Var 2 from) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (Var 2 from) (ArrayConstant 20 [1, 2, 3, 4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Allocate [((Var 2 to) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] () () ())] () () () ) (IntrinsicImpureSubroutine MoveAlloc [(Var 2 from) (Var 2 to)] 0 ) (Print (StringFormat () [(Var 2 to)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntrinsicArrayFunction Any [(IntegerCompare (Var 2 to) NotEq (ArrayConstant 20 [1, 2, 3, 4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Logical 4) [(() ())] DescriptorArray ) () )] 0 (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(IntrinsicImpureFunction Allocated [(Var 2 from)] 0 (Logical 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 2 from)] 0 (Logical 4) () ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Allocate [((Var 2 struct_from) [] () () ())] () () () ) (Assignment (StructInstanceMember (Var 2 struct_from) 2 1_toml_value_x (Integer 4) () ) (IntegerConstant 42 (Integer 4) Decimal) () .false. .false. ) (IntrinsicImpureSubroutine MoveAlloc [(Var 2 struct_from) (Var 2 struct_to)] 0 ) (If () (IntrinsicImpureFunction Allocated [(Var 2 struct_to)] 0 (Logical 4) () ) [(If () (IntegerCompare (StructInstanceMember (Var 2 struct_to) 2 1_toml_value_x (Integer 4) () ) NotEq (IntegerConstant 42 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] [(ErrorStop () )] ) (If () (IntrinsicImpureFunction Allocated [(Var 2 struct_from)] 0 (Logical 4) () ) [(ErrorStop () )] [] ) (Allocate [((Var 2 struct_from2) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] () () ())] () () () ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (StructInstanceMember (ArrayItem (Var 2 struct_from2) [(() (Var 2 i) ())] (StructType [(Integer 4)] [] .true. .false. ) ColMajor () ) 2 1_toml_value_x (Integer 4) () ) (IntegerBinOp (Var 2 i) Mul (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] ) (IntrinsicImpureSubroutine MoveAlloc [(Var 2 struct_from2) (Var 2 struct_to2)] 0 ) (If () (IntrinsicImpureFunction Allocated [(Var 2 struct_from2)] 0 (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntrinsicImpureFunction Allocated [(Var 2 struct_to2)] 0 (Logical 4) () ) [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 2 struct_to2) () (Integer 4) () ) ()) [(If () (IntegerCompare (StructInstanceMember (ArrayItem (Var 2 struct_to2) [(() (Var 2 i) ())] (StructType [(Integer 4)] [] .true. .false. ) ColMajor () ) 2 1_toml_value_x (Integer 4) () ) NotEq (IntegerBinOp (Var 2 i) Mul (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [(ErrorStop () )] ) (Allocate [((Var 2 struct_from3) [] () 2 toml_value (StructType [(Integer 4)] [] .true. .false. ))] () () () ) (Assignment (StructInstanceMember (Var 2 struct_from3) 2 1_toml_value_x (Integer 4) () ) (IntegerConstant 123 (Integer 4) Decimal) () .false. .false. ) (IntrinsicImpureSubroutine MoveAlloc [(Var 2 struct_from3) (Var 2 struct_to3)] 0 ) (If () (IntrinsicImpureFunction Allocated [(Var 2 struct_from3)] 0 (Logical 4) () ) [(ErrorStop () )] [] ) (SelectType (Var 2 struct_to3) () [(TypeStmtName 2 toml_value [(BlockCall -1 2 ~select_type_block_ )] )] [] ) (Allocate [((Var 2 struct_from) [] () () ())] () () () ) (Assignment (StructInstanceMember (Var 2 struct_from) 2 1_toml_value_x (Integer 4) () ) (IntegerConstant 42 (Integer 4) Decimal) () .false. .false. ) (IntrinsicImpureSubroutine MoveAlloc [(Var 2 struct_from) (Var 2 struct_to3)] 0 ) (If () (IntrinsicImpureFunction Allocated [(Var 2 struct_from)] 0 (Logical 4) () ) [(ErrorStop () )] [] ) (SelectType (Var 2 struct_to3) () [(TypeStmtName 2 toml_value [(BlockCall -1 2 ~select_type_block_1 )] )] [(BlockCall -1 2 ~select_type_block_2 )] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-operator_overloading_08-52825a6.json0000664000175000017500000000101715174404631026042 0ustar alastairalastair{ "basename": "asr-operator_overloading_08-52825a6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/operator_overloading_08.f90", "infile_hash": "5acb071582afc132942154d54a27349e2c92072962ccc8e3699a6187", "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_08-52825a6.stdout", "stdout_hash": "9530f58634db51048ed0447504bbce9c0077288d857039584b46d603", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-arrayelements1-55b6bd6.json0000664000175000017500000000075215174404631025071 0ustar alastairalastair{ "basename": "ast_f90-arrayelements1-55b6bd6", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/arrayelements1.f90", "infile_hash": "aee653e314f2bace5cb65c7ffd4c015a8ca517a00eeab179a2d74a15", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-arrayelements1-55b6bd6.stdout", "stdout_hash": "b11a0ebd3f59a28ec286b85430edf68c667644e9e5b9e04848d598c4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-subroutine3b-7e4c8ab.json0000664000175000017500000000072215174404631024475 0ustar alastairalastair{ "basename": "julia-subroutine3b-7e4c8ab", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/subroutine3b.f90", "infile_hash": "0726b3cb8b3ba1a2fc624a4215146065a6ce9a6a0b460ebe40c172a5", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutine3b-7e4c8ab.stdout", "stdout_hash": "b9e4b2cd4c60ca38d65caeade2362911283f0dce306905bb2bff712f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-kind_star_of_logical-8df9344.json0000664000175000017500000000077015174404631025541 0ustar alastairalastair{ "basename": "asr-kind_star_of_logical-8df9344", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_star_of_logical.f90", "infile_hash": "846e56ce5f99321a473bb4424f13b70823958a7ddfca4c59c0e8b621", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_star_of_logical-8df9344.stderr", "stderr_hash": "c1ab6c3a4e54b2e0ea74d0814ff410713ab98d3e41ebdfd4af89ce34", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-expr4-ffedfc3.stdout0000664000175000017500000000214115174404631023472 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define float @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca float, align 4 %__lfortran_evaluate_12 = alloca float, align 4 %__lfortran_evaluate_13 = alloca float, align 4 %__lfortran_evaluate_14 = alloca float, align 4 %__lfortran_evaluate_15 = alloca float, align 4 %__lfortran_evaluate_16 = alloca float, align 4 store float 5.000000e+00, float* %__lfortran_evaluate_11, align 4 store float 8.000000e+00, float* %__lfortran_evaluate_12, align 4 store float 1.600000e+01, float* %__lfortran_evaluate_13, align 4 store float 1.100000e+01, float* %__lfortran_evaluate_14, align 4 store float 2.000000e+00, float* %__lfortran_evaluate_15, align 4 store float 6.400000e+01, float* %__lfortran_evaluate_16, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return %0 = load float, float* %__lfortran_evaluate_16, align 4 ret float %0 } lfortran-0.63.0/tests/reference/wat-types_02-48df0cb.json0000664000175000017500000000072515174404631023205 0ustar alastairalastair{ "basename": "wat-types_02-48df0cb", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/types_02.f90", "infile_hash": "6b9728dd8c74663d697504a17537aef00ed9210bf24fae6e7e0468bc", "outfile": null, "outfile_hash": null, "stdout": "wat-types_02-48df0cb.stdout", "stdout_hash": "dd5bb6346ac6911980ea47e229beebfc73f7682c073add34af7d29f7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-stop1-ed69fc4.stdout0000664000175000017500000001043715174404631023166 0ustar alastairalastair(TranslationUnit [(Program stop1 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (Comment "! AST only(Syntax check)" )] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(stop [] [] () 15 Equal ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(errstop [] [] () 25 Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(If 0 () (/= stop 15) [(Stop 0 () () () )] [(If 0 () (/= errstop 25) [(ErrorStop 0 () () () )] [] () () () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (/= stop 15) [(Stop 0 (String "message" ()) () () )] [(If 0 () (/= errstop 25) [(ErrorStop 0 (String "message" ()) () () )] [] () () () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (/= stop 15) [(Stop 0 0 () () )] [(If 0 () (/= errstop 25) [(ErrorStop 0 0 () () )] [] () () () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (/= stop 15) [(Stop 0 () (Logical .true. ()) () )] [(If 0 () (/= errstop 25) [(ErrorStop 0 () (Logical .true. ()) () )] [] () () () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (/= stop 15) [(Stop 0 1 (Logical .false. ()) () )] [(If 0 () (/= errstop 25) [(ErrorStop 0 1 (Logical .false. ()) () )] [] () () () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/asr-entry_02-b8ee2e2.stdout0000664000175000017500000004061115174404631023545 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { entry_02: (Program (SymbolTable 5 { dummy: (Variable 5 dummy [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) entry_02 [] [(Assignment (Var 5 dummy) (RealConstant 10.000000 (Real 4) ) () .false. .false. ) (SubroutineCall 1 x () [((Var 5 dummy))] () .false. ) (Assignment (Var 5 dummy) (RealConstant 5.000000 (Real 4) ) () .false. .false. ) (SubroutineCall 1 y () [((Var 5 dummy))] () .false. )] ), x: (Function (SymbolTable 2 { dummy: (Variable 2 dummy [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) x (FunctionType [(Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [x_main__lcompilers] [(Var 2 dummy)] [(SubroutineCall 1 x_main__lcompilers 1 x_main__lcompilers [((IntegerConstant 1 (Integer 4) Decimal)) ((Var 2 dummy))] () .false. )] () Public .true. .true. () ), x_main__lcompilers: (Function (SymbolTable 4 { dummy: (Variable 4 dummy [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), entry__lcompilers: (Variable 4 entry__lcompilers [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) x_main__lcompilers (FunctionType [(Integer 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 entry__lcompilers) (Var 4 dummy)] [(If () (IntegerCompare (Var 4 entry__lcompilers) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 1 1 )] [] ) (If () (IntegerCompare (Var 4 entry__lcompilers) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 2 2 )] [] ) (GoToTarget 1 1 ) (Print (StringFormat () [(StringConstant "Printed using subroutine call: " (String 1 (IntegerConstant 31 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 4 dummy)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 4 dummy) Sub (RealConstant 10.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 4 dummy) (RealConstant 5.000000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Printed using entry statement: " (String 1 (IntegerConstant 31 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 4 dummy)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 4 dummy) Sub (RealConstant 5.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Return) (GoToTarget 2 2 ) (Print (StringFormat () [(StringConstant "Printed using entry statement: " (String 1 (IntegerConstant 31 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 4 dummy)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 4 dummy) Sub (RealConstant 5.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Return)] () Public .true. .true. () ), y: (Function (SymbolTable 3 { dummy: (Variable 3 dummy [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) y (FunctionType [(Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [x_main__lcompilers] [(Var 3 dummy)] [(SubroutineCall 1 x_main__lcompilers 1 x_main__lcompilers [((IntegerConstant 2 (Integer 4) Decimal)) ((Var 3 dummy))] () .false. )] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/llvm-callback_01-facbb46.json0000664000175000017500000000075615174404631024034 0ustar alastairalastair{ "basename": "llvm-callback_01-facbb46", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/callback_01.f90", "infile_hash": "d2c103564620acefc4245ff5eb5dfe84478276bead512800823259da", "outfile": null, "outfile_hash": null, "stdout": "llvm-callback_01-facbb46.stdout", "stdout_hash": "f313ecad99265bb798aeff16da0f56728d812c9781680fe5db4db752", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-while_01-3496096.json0000664000175000017500000000074515174404631023043 0ustar alastairalastair{ "basename": "llvm-while_01-3496096", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/while_01.f90", "infile_hash": "41dfb6c31552489d495806f20788fe3012284c0d6afbbc686d400c42", "outfile": null, "outfile_hash": null, "stdout": "llvm-while_01-3496096.stdout", "stdout_hash": "55e8503ea43270257a2eee56413799ce2accaf46cf04ba51552e8d9e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-data_implied_do1-87a7869.stderr0000664000175000017500000000030715174404631025042 0ustar alastairalastairsemantic error: The end variable of the data implied do loop must be constants --> tests/errors/data_implied_do1.f90:5:24 | 5 | data(iarx(i), i=1, k) / 1, 2, 3 / | ^ lfortran-0.63.0/tests/reference/rename_symbol-collect_occurence4-9f1ef3e.stdout0000664000175000017500000000017615174404631027721 0ustar alastairalastair[{"kind":9,"location":{"range":{"start":{"character":12,"line":9},"end":{"character":15,"line":9}},"uri":"uri"},"name":"abc"}]lfortran-0.63.0/tests/reference/asr-min_02-21863aa.stderr0000664000175000017500000000036115174404631022777 0ustar alastairalastairwarning: Different kinds of args in max0 is a non-standard extension --> tests/../integration_tests/min_02.f90:4:14 | 4 | print *, min(y, z) | ^^^^^^^^^ help: ensure all arguments have the same kind to make it standard lfortran-0.63.0/tests/reference/julia-case_06-3550f46.json0000664000175000017500000000073015174404631023047 0ustar alastairalastair{ "basename": "julia-case_06-3550f46", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/case_06.f90", "infile_hash": "3987983e4c8d162530bceffbbce0bd7d038b1f794655c222c47ad714", "outfile": null, "outfile_hash": null, "stdout": "julia-case_06-3550f46.stdout", "stdout_hash": "9e8bf3e13ad760e57b03f3633c68d025586c89ee46283869c692b604", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor13-d951787.stdout0000664000175000017500000000737515174404631027050 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { __xx_main: (Program (SymbolTable 2 { }) __xx_main [] [(Print (StringConstant "1 LFortran" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "2 LFortran 1" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "3 LFortran 1" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "4 LFortran 1" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "42 LFortran 1" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X is 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1 Y is 1" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X is 2" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "2 Y is 3" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X is 4" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "4 Y is 4" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X is not 1-4" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "5 Y is not 1-4" (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-block_02-bdd6766.stderr0000664000175000017500000000026315174404631024064 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/block_02.f90:7:14 | 7 | IF (A.EQ.15) GO TO 1 | ^^^^ help: write this as '==' lfortran-0.63.0/tests/reference/ast_f90-string-0f0b404.stdout0000664000175000017500000000064415174404631023716 0ustar alastairalastairprogram string implicit none character(len=50) :: str str = "Hi, I'm using string" str = 'Use "Double" "quote"' str = "'random'' ab''cd""fg''h'ij""klmno'pqr's'''" str = 'random'' a"b''cd""fg""hij"kl"mno"p"qr"s''' str = """equal''" str = """Double"" 'Quote'" str = "'Single' ""Quote""" print *, "Hi, I'm using string" print *, 'This is a "sting"' print *, "'random'' ab''cd""fg''h'ij""klmno'pqr's'''" end program string lfortran-0.63.0/tests/reference/asr-program_variable-066cc64.json0000664000175000017500000000075415174404631024711 0ustar alastairalastair{ "basename": "asr-program_variable-066cc64", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/program_variable.f90", "infile_hash": "705c0c3c0189cc5dffc2065ba2a142997de885b15b886bb127ec0180", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-program_variable-066cc64.stderr", "stderr_hash": "0e44a8a9d9774693baa8d86077a5a2cabd62602a6931a100bcb3cd43", "returncode": 2 }lfortran-0.63.0/tests/reference/pass_dead_code_removal-cond_02-69b6d7d.json0000664000175000017500000000103615174404631026562 0ustar alastairalastair{ "basename": "pass_dead_code_removal-cond_02-69b6d7d", "cmd": "lfortran --pass=dead_code_removal --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/cond_02.f90", "infile_hash": "fc70f7e7943dfe505736cca5b8ff39a034a4a1a7f441d9bdf0a82662", "outfile": null, "outfile_hash": null, "stdout": "pass_dead_code_removal-cond_02-69b6d7d.stdout", "stdout_hash": "94a16f4dff10c4320d3bb7fb6385d46e400e5c3a09434ee09fdc1822", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_array_op-arrays_op_10-be689f7.json0000664000175000017500000000102215174404631026035 0ustar alastairalastair{ "basename": "pass_array_op-arrays_op_10-be689f7", "cmd": "lfortran --pass=array_op --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_op_10.f90", "infile_hash": "b9f29a5f12342cf162fe90d308dfb51ffdf3b181b06f27fe34d52d26", "outfile": null, "outfile_hash": null, "stdout": "pass_array_op-arrays_op_10-be689f7.stdout", "stdout_hash": "9ed79e2095558e51da360cd8a55ab2f2b16678bf4833f37023a97ee1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-variables_03-4ba9d62.stdout0000664000175000017500000001112415174404631024456 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %b = alloca i32, align 4 %x = alloca i32, align 4 store i32 2, i32* %x, align 4 %2 = load i32, i32* %x, align 4 %3 = icmp ne i32 %2, 2 %4 = zext i1 %3 to i32 store i32 %4, i32* %b, align 4 %5 = load i32, i32* %b, align 4 %6 = icmp ne i32 %5, 0 br i1 %6, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %7 = load i32, i32* %x, align 4 %8 = icmp eq i32 %7, 2 %9 = zext i1 %8 to i32 store i32 %9, i32* %b, align 4 %10 = load i32, i32* %b, align 4 %11 = xor i32 %10, 1 %12 = icmp ne i32 %11, 0 br i1 %12, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %13 = load i32, i32* %x, align 4 %14 = icmp eq i32 %13, 2 %15 = xor i1 %14, true %16 = zext i1 %15 to i32 store i32 %16, i32* %b, align 4 %17 = load i32, i32* %b, align 4 %18 = icmp ne i32 %17, 0 br i1 %18, label %then4, label %else5 then4: ; preds = %ifcont3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont6 else5: ; preds = %ifcont3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 %19 = load i32, i32* %x, align 4 %20 = icmp eq i32 %19, 2 %21 = zext i1 %20 to i32 store i32 %21, i32* %b, align 4 %22 = load i32, i32* %b, align 4 %23 = xor i32 %22, 1 store i32 %23, i32* %b, align 4 %24 = load i32, i32* %b, align 4 %25 = icmp ne i32 %24, 0 br i1 %25, label %then7, label %else8 then7: ; preds = %ifcont6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 br label %return return: ; preds = %ifcont9 br label %FINALIZE_SYMTABLE_variables_03 FINALIZE_SYMTABLE_variables_03: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) lfortran-0.63.0/tests/reference/asr-cmd_02-ba58262.stdout0000664000175000017500000000575715174404631023020 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { test_exec: (Program (SymbolTable 2 { homedir: (Variable 2 homedir [] Local () () Default (String 1 (IntegerConstant 255 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_exec [] [(IntrinsicImpureSubroutine GetEnvironmentVariable [(StringConstant "HOME" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 homedir)] 1 ) (Print (StringFormat () [(IntrinsicElementalFunction StringTrim [(Var 2 homedir)] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (IntrinsicImpureSubroutine ExecuteCommandLine [(StringConstant "printenv" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (LogicalConstant .true. (Logical 4) )] 0 )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-const_kind_01-90eb6ef.json0000664000175000017500000000076115174404631024173 0ustar alastairalastair{ "basename": "asr-const_kind_01-90eb6ef", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/const_kind_01.f90", "infile_hash": "d4c0af9b90708f58d944586c06c948bea50408175f8b6edf852dd5c0", "outfile": null, "outfile_hash": null, "stdout": "asr-const_kind_01-90eb6ef.stdout", "stdout_hash": "92d53d1d63d528dbe7c954d8593bff9c1009d30a1d4bdf2514d607f5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_typing4-c338b90.stdout0000664000175000017500000001477615174404631025247 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { clqmn: (Function (SymbolTable 3 { ls: (Variable 3 ls [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 3 z [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) clqmn (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(If () (RealCompare (IntrinsicElementalFunction Aimag [(Var 3 z)] 0 (Real 8) () ) Eq (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) (Logical 4) () ) [(Assignment (Var 3 ls) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. )] [] )] () Public .true. .true. () ), dnan: (Function (SymbolTable 2 { dnan: (Variable 2 dnan [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) dnan (FunctionType [] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 dnan) (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) () .false. .false. )] (Var 2 dnan) Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/ast-derived_types_01-b50f880.json0000664000175000017500000000077215174404631024546 0ustar alastairalastair{ "basename": "ast-derived_types_01-b50f880", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_01.f90", "infile_hash": "d5361dd7a0436fd13655dcc3ad47c98f3ce6966934537f5e9cc001c5", "outfile": null, "outfile_hash": null, "stdout": "ast-derived_types_01-b50f880.stdout", "stdout_hash": "9ad1a427d553d75dee4ed8aaec8980903a8cb169804e15a0a7d308e1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_02-74be421.json0000664000175000017500000000075015174404631023337 0ustar alastairalastair{ "basename": "asr-modules_02-74be421", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_02.f90", "infile_hash": "a52fdcb19f500c43afdd1fde1f90d5df8d34f2283a39704ab599a87c", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_02-74be421.stdout", "stdout_hash": "0fb91745245218333b297913e1e41b6aba0a609bc64857ebd3a0e1b5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-functions_05-adf0d8b.stdout0000664000175000017500000010055415174404631024476 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Assignment (Var 3 x) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 b) (IntegerBinOp (Var 3 a) Add (Var 3 x) (Integer 4) () ) () .false. .false. )] (Var 3 b) Public .true. .true. () ), f_real: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_real (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [signr32] [(Var 4 a)] [(Assignment (Var 4 b) (RealBinOp (Var 4 a) Add (FunctionCall 2 signr32 () [((RealConstant 1.000000 (Real 4) )) ((Var 4 a))] (Real 4) () () ) (Real 4) () ) () .false. .false. )] (Var 4 b) Public .true. .true. () ), p: (Variable 2 p [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), q: (Variable 2 q [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), signr32: (Function (SymbolTable 5 { r: (Variable 5 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 5 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 5 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) signr32 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x) (Var 5 y)] [(Assignment (Var 5 r) (Var 5 x) () .false. .false. ) (If () (LogicalBinOp (LogicalBinOp (RealCompare (Var 5 x) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) And (RealCompare (Var 5 y) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (RealCompare (Var 5 x) LtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) And (RealCompare (Var 5 y) LtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 5 r) (Var 5 x) () .false. .false. )] [(Assignment (Var 5 r) (RealUnaryMinus (Var 5 x) (Real 4) () ) () .false. .false. )] )] (Var 5 r) Public .true. .true. () ), x: (Variable 2 x [] Local (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) functions_01 [] [(Assignment (Var 2 y) (FunctionCall 2 f () [((Var 2 x))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 2 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 q) (FunctionCall 2 f_real () [((Var 2 p))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 2 q)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 a) (RealConstant 20.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 b) (RealUnaryMinus (RealConstant 30.000000 (Real 4) ) (Real 4) (RealConstant -30.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 c) (FunctionCall 2 signr32 () [((Var 2 a)) ((Var 2 b))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 2 c)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr_preprocess-unterminated_if_01-6989548.json0000664000175000017500000000101615174404631027174 0ustar alastairalastair{ "basename": "asr_preprocess-unterminated_if_01-6989548", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/unterminated_if_01.f90", "infile_hash": "6ba01febd1bb652d6b58e8814b8d9c3b50c046aaf52e9408ad8460d8", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-unterminated_if_01-6989548.stderr", "stderr_hash": "a040d9cf52405419b555ef9d5260111307594adc4e5da23e24993d6b", "returncode": 2 }lfortran-0.63.0/tests/reference/run-print4-e3cf30b.json0000664000175000017500000000065715174404631022770 0ustar alastairalastair{ "basename": "run-print4-e3cf30b", "cmd": "lfortran --no-color {infile}", "infile": "tests/print4.f90", "infile_hash": "0235f98a0db81de70f604eae7df934c9cd8b7818f613d6c807d5cc45", "outfile": null, "outfile_hash": null, "stdout": "run-print4-e3cf30b.stdout", "stdout_hash": "69c6a178808ecbbc6e2105fd098b837d0137e42f3a7cb1948070e67b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-subroutine3-952da2b.stdout0000664000175000017500000000010415174404631024611 0ustar alastairalastairfunction f()::Int32 local f::Int32 f = 42 return f end lfortran-0.63.0/tests/reference/asr-sin_03-8490135.json0000664000175000017500000000073415174404631022330 0ustar alastairalastair{ "basename": "asr-sin_03-8490135", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/sin_03.f90", "infile_hash": "3c036b8aabdbfddc3c46fb69183c427f7991b105c361b785872acf59", "outfile": null, "outfile_hash": null, "stdout": "asr-sin_03-8490135.stdout", "stdout_hash": "fda7868dbe5633fa7ece9696e98954e0d8c265388fcad90945eb05e7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_34-f98f7e3.stdout0000664000175000017500000012637315174404631024032 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fpm_cmd_install_modules_34: (Module (SymbolTable 2 { build_model: (ExternalSymbol 2 build_model 4 build_model fpm_modules_34 [] build_model Public ) }) fpm_cmd_install_modules_34 () [fpm_modules_34] .false. .false. .false. ), fpm_manifest_modules_34: (Module (SymbolTable 8 { package_config_t: (ExternalSymbol 8 package_config_t 10 package_config_t fpm_manifest_package_modules_34 [] package_config_t Public ) }) fpm_manifest_modules_34 () [fpm_manifest_package_modules_34] .true. .false. .false. ), fpm_manifest_package_modules_34: (Module (SymbolTable 10 { package_config_t: (Struct (SymbolTable 11 { name: (Variable 11 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), version: (Variable 11 version [] Local () () Default (StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .true. .false. ) 10 version_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) package_config_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .true. .false. )] [] .true. .false. ) [version_t] [name version] [] Source Public .false. .false. [] () () [] ), version_t: (ExternalSymbol 10 version_t 13 version_t fpm_versioning_modules_34 [] version_t Public ) }) fpm_manifest_package_modules_34 () [fpm_versioning_modules_34] .true. .false. .false. ), fpm_modules_34: (Module (SymbolTable 4 { build_model: (Function (SymbolTable 5 { associate_block: (AssociateBlock (SymbolTable 6 { 1_package_config_t_version: (ExternalSymbol 6 1_package_config_t_version 11 version package_config_t [] version Public ), 1_version_t: (ExternalSymbol 6 1_version_t 13 version_t fpm_versioning_modules_34 [] version_t Public ), 1_version_t_to_string: (ExternalSymbol 6 1_version_t_to_string 14 to_string 1_version_t [] to_string Public ), ii: (Variable 6 ii [] Local () () Default (Pointer (Integer 4) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) associate_block [(Associate (Var 6 ii) (Var 5 i) ) (Print (StringFormat () [(Var 6 ii)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 6 1_version_t_to_string () [((StructInstanceMember (Var 5 package) 6 1_package_config_t_version (StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .true. .false. ) () )) ((Var 5 version))] (StructInstanceMember (Var 5 package) 6 1_package_config_t_version (StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .true. .false. ) () ) .false. )] ), i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), package: (Variable 5 package [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .true. .false. )] [] .true. .false. ) 4 package_config_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), version: (Variable 5 version [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) build_model (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .true. .false. )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 package)] [(AssociateBlockCall 5 associate_block )] () Public .false. .false. () ), package_config_t: (ExternalSymbol 4 package_config_t 10 package_config_t fpm_manifest_package_modules_34 [] package_config_t Public ) }) fpm_modules_34 () [fpm_manifest_modules_34 fpm_manifest_package_modules_34 fpm_versioning_modules_34] .true. .false. .false. ), fpm_versioning_modules_34: (Module (SymbolTable 13 { as_string: (Function (SymbolTable 15 { 1_version_t_to_string: (ExternalSymbol 15 1_version_t_to_string 14 to_string version_t [] to_string Public ), self: (Variable 15 self [] In () () Default (StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .false. .false. ) 13 version_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 15 string [] ReturnVar () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) as_string (FunctionType [(StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .false. .false. )] (Allocatable (String 1 () DeferredLength DescriptorString) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 15 self)] [(SubroutineCall 15 1_version_t_to_string () [((Var 15 self)) ((Var 15 string))] (Var 15 self) .false. )] (Var 15 string) Public .true. .true. () ), char: (GenericProcedure 13 char [13 as_string] Public ), to_string: (Function (SymbolTable 16 { self: (Variable 16 self [] In () () Default (StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .false. .false. ) 13 version_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 16 string [] Out () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) to_string (FunctionType [(StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .false. .false. ) (Allocatable (String 1 () DeferredLength DescriptorString) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 16 self) (Var 16 string)] [] () Public .true. .true. () ), version_t: (Struct (SymbolTable 14 { num: (Variable 14 num [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), to_string: (StructMethodDeclaration 14 to_string () to_string 13 to_string Source .false. .false. ) }) version_t (StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .true. .false. ) [] [num] [] Source Public .false. .false. [] () () [] ) }) fpm_versioning_modules_34 () [fpm_versioning_modules_34] .true. .false. .false. ), modules_34: (Program (SymbolTable 17 { }) modules_34 [] [(Print (StringConstant "running modules_34 program" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/run-format_37-20d0238.json0000664000175000017500000000071515174404631023121 0ustar alastairalastair{ "basename": "run-format_37-20d0238", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_37.f90", "infile_hash": "94b93a59d013f07a2eed519c774d916f389d9b7ab823c410a833ddbf", "outfile": null, "outfile_hash": null, "stdout": "run-format_37-20d0238.stdout", "stdout_hash": "21ce5dc962c37b53cb1844c4625f8d5b5d980eebe5efa33e4c214af6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-expr_06-2de4136.json0000664000175000017500000000073715174404631022656 0ustar alastairalastair{ "basename": "asr-expr_06-2de4136", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/expr_06.f90", "infile_hash": "86c5ce938c64e34b4a0d0c0005ed174ab091a74089c4e28d87f55945", "outfile": null, "outfile_hash": null, "stdout": "asr-expr_06-2de4136.stdout", "stdout_hash": "d5486a623dab79dd20ad799d9b55366154d214d727bd5e3967d9d39b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-parameter_01-ee9f18c.json0000664000175000017500000000074015174404631024021 0ustar alastairalastair{ "basename": "asr-parameter_01-ee9f18c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/parameter_01.f90", "infile_hash": "8d4764b6b83f24e950d8f2709419b896803acb57091452ca32556286", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-parameter_01-ee9f18c.stderr", "stderr_hash": "2f32e2b239e5c97e091d4539c43eb798b2ed5f05625ab24110edbdd3", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-int_dp_param-f284039.json0000664000175000017500000000076115174404631024141 0ustar alastairalastair{ "basename": "llvm-int_dp_param-f284039", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/int_dp_param.f90", "infile_hash": "bb7549fda78172a3f68b883fd1423773bf823a71a4dd2f89476886b5", "outfile": null, "outfile_hash": null, "stdout": "llvm-int_dp_param-f284039.stdout", "stdout_hash": "3bd9af05fdb28d24753ae39ec9b05abbca79b32b2231f0766dc45354", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_05-f939cc6.stdout0000664000175000017500000002462015174404631024013 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { access_vars: (Module (SymbolTable 2 { print_vars: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), print_vars: (Variable 3 print_vars [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) print_vars (FunctionType [(Real 4) (Real 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b)] [(Print (StringFormat () [(StringConstant "priv = " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 3 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "publ = " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 3 b)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 3 print_vars) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. )] (Var 3 print_vars) Private .false. .false. () ), priv: (Variable 2 priv [] Local (RealConstant 1.500000 (Real 4) ) (RealConstant 1.500000 (Real 4) ) Save (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), publ: (Variable 2 publ [] Local (RealConstant 2.500000 (Real 4) ) (RealConstant 2.500000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) access_vars () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/wat-wasm_bind_js-d9f341f.stdout0000664000175000017500000000554515174404631024503 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param i32 i32 i32) (result))) (type (;3;) (func (param) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (import "js" "show_img" (func (;2;) (type 2))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $3 (type 3) (param) (result) (local i32 i32 i32) i32.const 600 local.set 0 i32.const 208 local.set 1 i32.const 450 local.set 2 local.get 2 local.get 0 local.get 1 call 2 i32.const 0 call 0 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 3)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-0.63.0/tests/reference/run-format1-04216cf.json0000664000175000017500000000066215174404631022755 0ustar alastairalastair{ "basename": "run-format1-04216cf", "cmd": "lfortran --no-color {infile}", "infile": "tests/format1.f90", "infile_hash": "fa70c35913626736c8443dee08f1e2c9c39523470d040297c1e59259", "outfile": null, "outfile_hash": null, "stdout": "run-format1-04216cf.stdout", "stdout_hash": "6141c1682ee1fd69947cf5e53251cbbefd47775d10d9d8d7229d5208", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-coarrays_01-9ca4565.json0000664000175000017500000000074115174404631024201 0ustar alastairalastair{ "basename": "ast_f90-coarrays_01-9ca4565", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/coarrays_01.f90", "infile_hash": "933ef6b85aed33b834bb7b03ae1f635e2b6e4fd18eb8ec999593251f", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-coarrays_01-9ca4565.stdout", "stdout_hash": "0265ac1072c55f5283c9fe82bac7a361de3c6e094dd3dbd9490d75d1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-program2-c0dd48f.stdout0000664000175000017500000000166715174404631023646 0ustar alastairalastair(TranslationUnit [(Program program2 () [] [(ImplicitNone [] () )] [] [(SubroutineCall 0 b [] [] [] [] () ) (SubroutineCall 0 b [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Subroutine b [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "b" ())] () )] [] [] )] )] ) lfortran-0.63.0/tests/reference/asr-bindc4-22df995.stdout0000664000175000017500000010336615174404631023125 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bindc4: (Program (SymbolTable 2 { c_associated: (ExternalSymbol 2 c_associated 4 c_associated lfortran_intrinsic_iso_c_binding [] c_associated Public ), c_f_pointer: (ExternalSymbol 2 c_f_pointer 4 c_f_pointer lfortran_intrinsic_iso_c_binding [] c_f_pointer Public ), c_intptr_t: (ExternalSymbol 2 c_intptr_t 4 c_intptr_t lfortran_intrinsic_iso_c_binding [] c_intptr_t Public ), c_loc: (ExternalSymbol 2 c_loc 4 c_loc lfortran_intrinsic_iso_c_binding [] c_loc Public ), c_null_ptr: (ExternalSymbol 2 c_null_ptr 4 c_null_ptr lfortran_intrinsic_iso_c_binding [] c_null_ptr Public ), c_ptr: (ExternalSymbol 2 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), newshape: (Variable 2 newshape [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), queries: (Variable 2 queries [] Local () () Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), queries2: (Variable 2 queries2 [] Local (PointerNullConstant (CPtr) () ) (PointerNullConstant (CPtr) () ) Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Pointer (Array (Integer 2) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), xv: (Variable 2 xv [] Local () () Default (Array (Integer 2) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Pointer (Array (Integer 2) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), yv: (Variable 2 yv [] Local () () Default (Array (Integer 2) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ) }) bindc4 [iso_c_binding] [(Assignment (ArrayItem (Var 2 newshape) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 newshape) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Associate (Var 2 x) (ArrayPhysicalCast (Var 2 xv) FixedSizeArray DescriptorArray (Array (Integer 2) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () ) ) (Associate (Var 2 y) (ArrayPhysicalCast (Var 2 yv) FixedSizeArray DescriptorArray (Array (Integer 2) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () ) ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Print (StringFormat () [(Var 2 i) (Var 2 j) (BitCast (PointerToCPtr (GetPointer (ArrayItem (Var 2 x) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Integer 2) ColMajor () ) (Pointer (Integer 2) ) () ) (CPtr) () ) (IntegerConstant 0 (Integer 8) Decimal) () (Integer 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] [] ) (CPtrToPointer (Var 2 queries) (Var 2 x) (Var 2 newshape) () ) (Print (StringFormat () [(BitCast (PointerToCPtr (Var 2 x) (CPtr) () ) (IntegerConstant 0 (Integer 8) Decimal) () (Integer 8) () ) (BitCast (Var 2 queries) (IntegerConstant 0 (Integer 8) Decimal) () (Integer 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Print (StringFormat () [(Var 2 i) (Var 2 j) (BitCast (PointerToCPtr (GetPointer (ArrayItem (Var 2 x) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Integer 2) ColMajor () ) (Pointer (Integer 2) ) () ) (CPtr) () ) (IntegerConstant 0 (Integer 8) Decimal) () (Integer 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] [] ) (CPtrToPointer (Var 2 queries) (Var 2 x) (ArrayConstant 8 [3, 4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] PointerArray ) ColMajor ) () ) (Print (StringFormat () [(BitCast (PointerToCPtr (Var 2 x) (CPtr) () ) (IntegerConstant 0 (Integer 8) Decimal) () (Integer 8) () ) (BitCast (Var 2 queries) (IntegerConstant 0 (Integer 8) Decimal) () (Integer 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Print (StringFormat () [(Var 2 i) (Var 2 j) (BitCast (PointerToCPtr (GetPointer (ArrayItem (Var 2 x) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Integer 2) ColMajor () ) (Pointer (Integer 2) ) () ) (CPtr) () ) (IntegerConstant 0 (Integer 8) Decimal) () (Integer 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] [] ) (If () (LogicalNot (PointerAssociated (Var 2 queries) (PointerToCPtr (GetPointer (ArrayItem (Var 2 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 2) ColMajor () ) (Pointer (Integer 2) ) () ) (CPtr) () ) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalNot (PointerAssociated (Var 2 queries) (PointerToCPtr (Var 2 x) (CPtr) () ) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (PointerAssociated (Var 2 queries) (PointerToCPtr (Var 2 y) (CPtr) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (PointerAssociated (Var 2 queries2) () (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 queries) (PointerNullConstant (CPtr) () ) () .false. .false. )] ), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding) }) [] ) lfortran-0.63.0/tests/reference/asr-declaration1-880025a.json0000664000175000017500000000073115174404631023652 0ustar alastairalastair{ "basename": "asr-declaration1-880025a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/declaration1.f90", "infile_hash": "cd7f955f4afa5639a06727dad7fd12ea533d7de45b0159dc213a6490", "outfile": null, "outfile_hash": null, "stdout": "asr-declaration1-880025a.stdout", "stdout_hash": "a1bd2bcc1c9b54b3f79952934da20b90b2aec1afe7ddc862dc04833a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-arrays_op_10-19bd9d9.stdout0000664000175000017500000004013615174404631024335 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { compare_solutions: (Function (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) compare_solutions (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [solution] [] [(Print (StringFormat () [(ArraySize (FunctionCall 2 solution () [] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () () ) () (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionCall 2 solution () [] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () () ) () (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) ()) [(Assignment (ArrayItem (Var 3 x) [(() (Var 3 i) ())] (Real 4) ColMajor () ) (Cast (Var 3 i) IntegerToReal (Real 4) () () ) () .false. .false. )] [] ) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(Print (StringFormat () [(ArrayItem (Var 3 x) [(() (Var 3 i) ())] (Real 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (ArrayItem (Var 3 x) [(() (Var 3 i) ())] (Real 4) ColMajor () ) NotEq (Cast (Var 3 i) IntegerToReal (Real 4) () () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] () Public .false. .false. () ), solution: (Function (SymbolTable 4 { x: (Variable 4 x [] ReturnVar () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) solution (FunctionType [] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 4 x) (ArrayConstant 8 [1.00000000e+00, 1.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. )] (Var 4 x) Public .true. .true. () ) }) main [] [(SubroutineCall 2 compare_solutions () [] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/c-doloop_08-2839ed5.json0000664000175000017500000000072215174404631022640 0ustar alastairalastair{ "basename": "c-doloop_08-2839ed5", "cmd": "lfortran --no-color --show-c {infile}", "infile": "tests/../integration_tests/doloop_08.f90", "infile_hash": "aa25755d672851ca060c0f7c42329e8ecb0444f7a037df60d525af51", "outfile": null, "outfile_hash": null, "stdout": "c-doloop_08-2839ed5.stdout", "stdout_hash": "c41a66f6056c1229519d3bbf24fde5ffb0fca0f3c789d00b43e422f4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_01_pack-6c829d9.stdout0000664000175000017500000002722415174404631024400 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array_01_pack: (Program (SymbolTable 2 { m: (Variable 2 m [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p: (Variable 2 p [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s: (Variable 2 s [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) array_01_pack [] [(Assignment (Var 2 m) (ArrayConstant 24 [1, 0, 0, 0, 5, 0] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 2 p) (IntrinsicArrayFunction Pack [(ArrayPhysicalCast (Var 2 m) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] DescriptorArray ) () ) (ArrayPhysicalCast (IntegerCompare (Var 2 m) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) () .false. .false. ) (Assignment (Var 2 s) (IntrinsicArrayFunction Shape [(IntrinsicArrayFunction Pack [(ArrayPhysicalCast (Var 2 m) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] DescriptorArray ) () ) (ArrayPhysicalCast (IntegerCompare (Var 2 m) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () )] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 s) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayItem (Var 2 s) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-array1-cceb5f3.stdout0000664000175000017500000000563215174404631023366 0ustar alastairalastair(TranslationUnit [(Program array1 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeReal [] () () None ) [] [(d [] [] () () None ()) (e [(1 5 DimensionExpr)] [] () () None ()) (e2 [(1 2 DimensionExpr) (1 3 DimensionExpr)] [] () () None ()) (e3 [(1 1 DimensionExpr) (1 2 DimensionExpr) (1 3 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(f [] [] () () None ()) (g [(1 3 DimensionExpr)] [] () () None ()) (g2 [(1 6 DimensionExpr) (1 3 DimensionExpr)] [] () () None ()) (g3 [(1 4 DimensionExpr) (1 3 DimensionExpr) (1 2 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [] [(a [] [] () () None ()) (b [(1 2 DimensionExpr)] [] () () None ()) (b2 [(1 3 DimensionExpr) (1 2 DimensionExpr)] [] () () None ()) (b3 [(1 2 DimensionExpr) (1 1 DimensionExpr) (1 2 DimensionExpr)] [] () () None ())] () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr_preprocess-unterminated_ifndef_01-1761667.json0000664000175000017500000000103215174404631030010 0ustar alastairalastair{ "basename": "asr_preprocess-unterminated_ifndef_01-1761667", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/unterminated_ifndef_01.f90", "infile_hash": "15182e05ae273d1a1ffd40280ce783bc0df2bf57f3ad7ed102fc71f0", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-unterminated_ifndef_01-1761667.stderr", "stderr_hash": "c2c3a02d83fdb5ea648eead71bf83e6460c22d1a43ece2fa084e3fc2", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-intrinsics_05-4c31742.json0000664000175000017500000000076115174404631024000 0ustar alastairalastair{ "basename": "asr-intrinsics_05-4c31742", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_05.f90", "infile_hash": "735edff1f9942ce107c1b84f9ddcf00e648e553327f54dacf7b8238c", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_05-4c31742.stdout", "stdout_hash": "7db24a24676ac33311bc2d6c52618d1b46568412fd21bf2887fd4452", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-expr3-3036522.json0000664000175000017500000000070715174404631022452 0ustar alastairalastair{ "basename": "llvm-expr3-3036522", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/expr3.f90", "infile_hash": "a4aed9754913f48e6b1982a698f85476db8324f2d2efe0b1a2de88f5", "outfile": null, "outfile_hash": null, "stdout": "llvm-expr3-3036522.stdout", "stdout_hash": "11b57bb4bfb4c057730cf8856e19522dd975d1ab859bb8b0430b9a51", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-do2-1ec601e.stdout0000664000175000017500000000632115174404631022501 0ustar alastairalastair(TranslationUnit [(Subroutine a [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(DoLoop 0 () 0 () () () () [(Assignment 0 a (+ a i) () ) (Assignment 0 b 3 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DoLoop 0 () 0 () () () () [(Assignment 0 do (+ a i) () ) (Assignment 0 enddo 3 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DoLoop 0 () 0 () () () () [(Assignment 0 a (+ a i) (TriviaNode [] [(Semicolon)] ) ) (Assignment 0 b 3 (TriviaNode [] [(Semicolon)] ) )] (TriviaNode [] [(Semicolon)] ) () )] [] [] ) (Subroutine a [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(DoLoop 0 () 0 () () () () [(Assignment 0 x 1 () )] () () )] [] [] ) (Subroutine a [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(DoLoop 0 () 0 i 1 5 () [(Assignment 0 x (+ x i) () )] () () )] [] [] ) (Subroutine a [] [] () () [] [] [] [] [(DoLoop 0 () 0 i 1 5 (u- 1) [(Assignment 0 x i () )] () () )] [] [] )] ) lfortran-0.63.0/tests/reference/ast_f90-doloop_05-1dc897c.stdout0000664000175000017500000000034415174404631024310 0ustar alastairalastairprogram doloop_05 implicit none integer :: i, j 1 j = 0 2 I_LOOP: do i = 1, 10 3 if (i == 2) then cycle I_loop end if 4 j = j + i end do I_LOOP 6 if (j /= 53) then error stop end if end program doloop_05 lfortran-0.63.0/tests/reference/asr-const_kind_01-90eb6ef.stdout0000664000175000017500000001654615174404631024554 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { const_kind_01: (Program (SymbolTable 2 { dp: (Variable 2 dp [] Local (IntegerConstant 8 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r1: (Variable 2 r1 [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r2: (Variable 2 r2 [] Local (RealConstant 1.000000 (Real 8) ) (RealConstant 1.000000 (Real 8) ) Parameter (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r3: (Variable 2 r3 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sp: (Variable 2 sp [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) const_kind_01 [] [(Assignment (Var 2 r3) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 r3) (Cast (RealConstant 1.000000 (Real 8) ) RealToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 sp) (Var 2 dp) (Var 2 r1) (Var 2 r2) (Var 2 r3)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-read1-a5fe5d5.stdout0000664000175000017500000000047515174404631023565 0ustar alastairalastairprogram read1 ! AST only tests read(*, *) a, b read(unit=*, fmt=*) a, b read(*, fmt=*) a, b read(*) b read(zone(1:3), "(i3)") hour read(u) b read(u, fmt=x) b, c, e read(*, fmt=x) b, c, e read(iunit, NML=invar, IOSTAT=ierr) read(UNIT=iunit, NML=invar, IOSTAT=ierr) read 10 read 10, A, B read *, size end program read1 lfortran-0.63.0/tests/reference/run-scalar_allocation_check_04-024d591.json0000664000175000017500000000076215174404631026442 0ustar alastairalastair{ "basename": "run-scalar_allocation_check_04-024d591", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/scalar_allocation_check_04.f90", "infile_hash": "4e99063a92f0acb60e7d3a84548c218f7c962ff15af9f4b29f819eb3", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-scalar_allocation_check_04-024d591.stderr", "stderr_hash": "b6e35339932fc5acd8461e2c7d69d7058543ce4bdc1db26ad0fab442", "returncode": 1 }lfortran-0.63.0/tests/reference/ast_f90-do_concurrent_reduce3-fc55bd2.stdout0000664000175000017500000000050315174404631027033 0ustar alastairalastairsubroutine sum_reduce(a, s) real, intent(in) :: a(:) real, intent(out) :: s integer :: N, i N = size(a) s = 0 do concurrent (i = 1:N) reduce(*: s) s = s + a(i) end do do concurrent (i = 1:N) reduce(min: s) s = s + a(i) end do do concurrent (i = 1:N) reduce(max: s) s = s + a(i) end do end subroutine sum_reduce lfortran-0.63.0/tests/reference/ast-fixed_form_if_variations-38b0c0a.json0000664000175000017500000000101015174404631026465 0ustar alastairalastair{ "basename": "ast-fixed_form_if_variations-38b0c0a", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_if_variations.f", "infile_hash": "4a650d13a10da613323a06d614f3a9342a07afcae9d662a2584c8e52", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_if_variations-38b0c0a.stdout", "stdout_hash": "0086d36f69fc14fa1d602ae97df48c747b871fb6da9bd83cd6c5b76f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_334-6d740cf.json0000664000175000017500000000076415174404631024236 0ustar alastairalastair{ "basename": "asr-intrinsics_334-6d740cf", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_334.f90", "infile_hash": "9d3c71d960ed15ecd218cd0ba4b7bc62d11c3da94757e5cab5ffff7a", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_334-6d740cf.stdout", "stdout_hash": "5e74f829e3d9affe2527525aa0725f23f0d9434e1be352f3709c3096", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules4-22712cd.json0000664000175000017500000000071515174404631023117 0ustar alastairalastair{ "basename": "asr-modules4-22712cd", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/modules4.f90", "infile_hash": "c257e4129464d80726be06e42e231c7266fb7675d48f7926c60c5199", "outfile": null, "outfile_hash": null, "stdout": "asr-modules4-22712cd.stdout", "stdout_hash": "5c15193c0f94a67a45ac3ed1dbd921af9b8d901079b7a3668bb99f3c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-issue532-4bdd3b3.stdout0000664000175000017500000002775415174404631023473 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { issue532: (Program (SymbolTable 5 { }) issue532 [] [] ), issue532_mod: (Module (SymbolTable 2 { imodulo: (Function (SymbolTable 4 { r: (Variable 4 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 4 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) imodulo (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [sfloor] [(Var 4 x) (Var 4 y)] [(Assignment (Var 4 r) (IntegerBinOp (FunctionCall 2 sfloor () [((IntrinsicElementalFunction Real [(Var 4 x)] 0 (Real 4) () ))] (Integer 4) () () ) Mul (Var 4 y) (Integer 4) () ) () .false. .false. )] (Var 4 r) Public .true. .true. () ), sfloor: (Function (SymbolTable 3 { r: (Variable 3 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sfloor (FunctionType [(Real 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [(Assignment (Var 3 r) (Cast (Var 3 x) RealToInteger (Integer 4) () () ) () .false. .false. )] (Var 3 r) Public .true. .true. () ) }) issue532_mod () [issue532_mod] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-sizeof_01-9e0775c.json0000664000175000017500000000105115174404631023173 0ustar alastairalastair{ "basename": "asr-sizeof_01-9e0775c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/warnings/sizeof_01.f90", "infile_hash": "86071170f964364faf88b5375e6fe96e90875a39486075b394efdd5e", "outfile": null, "outfile_hash": null, "stdout": "asr-sizeof_01-9e0775c.stdout", "stdout_hash": "45eb6d1b4fa501df013632a95b1b73a1ed49c0e113969f23938cb4ab", "stderr": "asr-sizeof_01-9e0775c.stderr", "stderr_hash": "37f448eb33d6ccc76ae5d1960db2fe93c9c3d8c3132b405870d5f6f1", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_15-7fde02a.json0000664000175000017500000000077215174404631024705 0ustar alastairalastair{ "basename": "asr-derived_types_15-7fde02a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_15.f90", "infile_hash": "4a9c6de3f501d516ab583d590255d6ee6fa4080e40b889d5444eaf34", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_15-7fde02a.stdout", "stdout_hash": "b3318f2c29c3786d463e07df97c7062251a3e7a86932faae9a6c1e15", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-subroutine4-a425266.stdout0000664000175000017500000002460115174404631024144 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { triad: (Function (SymbolTable 2 { a: (Variable 2 a [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Out () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), scalar: (Variable 2 scalar [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) triad (FunctionType [(Array (Real 4) [(() ())] DescriptorArray ) (Array (Real 4) [(() ())] DescriptorArray ) (Real 4) (Array (Real 4) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 a) (Var 2 b) (Var 2 scalar) (Var 2 c)] [(Assignment (Var 2 n) (ArraySize (Var 2 a) () (Integer 4) () ) () .false. .false. ) (DoConcurrentLoop [((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 n) ())] [] [] [] [(Assignment (ArrayItem (Var 2 c) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (RealBinOp (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 4) ColMajor () ) Add (RealBinOp (Var 2 scalar) Mul (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (Real 4) () ) (Real 4) () ) () .false. .false. )] )] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/llvm-operator_overloading_01-33c47db.stderr0000664000175000017500000000027415174404631026713 0ustar alastairalastairstyle suggestion: Use 'end if' instead of 'endif' --> tests/../integration_tests/operator_overloading_01.f90:28:9 | 28 | endif | ^^^^^ help: write this as 'end if' lfortran-0.63.0/tests/reference/asr_preprocess-unterminated_ifdef_01-f746dbf.stderr0000664000175000017500000000016215174404631030470 0ustar alastairalastairC preprocessor error: Unterminated #ifdef --> tests/errors/unterminated_ifdef_01.f90:1:1 | 1 | #ifdef a | ^ lfortran-0.63.0/tests/reference/asr-derived_types_10-526e3f4.json0000664000175000017500000000074515174404631024546 0ustar alastairalastair{ "basename": "asr-derived_types_10-526e3f4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/derived_types_10.f90", "infile_hash": "bef962bd9d9eddd888790f26dbec99567806aa15d47cac1ab04cc225", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_10-526e3f4.stdout", "stdout_hash": "3aed4fb28a14072a1626028a6a63d181013ef5a59aa283072f874dfa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-interface_generic_procedure_same_name-708e46e.stdout0000664000175000017500000001430315174404631031461 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { interface_generic_procedure_same_name: (Module (SymbolTable 2 { frexp: (GenericProcedure 2 frexp [2 frexp~genericprocedure] Public ), frexp~genericprocedure: (Function (SymbolTable 3 { n: (Variable 3 n [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 3 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] In () () Default (Real 4) () Source Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ) }) frexp~genericprocedure (FunctionType [(Real 4) (Integer 4)] (Real 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 n)] [] (Var 3 r) Public .false. .false. () ) }) interface_generic_procedure_same_name () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-infer_first_assignment_01-ff9433c.json0000664000175000017500000000100015174404631026506 0ustar alastairalastair{ "basename": "asr-infer_first_assignment_01-ff9433c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/infer_first_assignment_01.f90", "infile_hash": "327046201e4c2ef72b36fe2d078d25aba03769d996fe5538d48af78d", "outfile": null, "outfile_hash": null, "stdout": "asr-infer_first_assignment_01-ff9433c.stdout", "stdout_hash": "b7881a11d3a71b903778ab57f1b38c78b242f17e9ca575f8ca78d2fa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-subroutines_02-597f5e1.json0000664000175000017500000000076415174404631024273 0ustar alastairalastair{ "basename": "asr-subroutines_02-597f5e1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_02.f90", "infile_hash": "0da20d4528bff96e6ec7497805bf54f1744384b5ab8de197c3e75432", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutines_02-597f5e1.stdout", "stdout_hash": "a6b2c25f7189f2b4918a1d2b88bf1acbb8091073891e116c62791388", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-expr7-68a8628.json0000664000175000017500000000070415174404631022372 0ustar alastairalastair{ "basename": "ast-expr7-68a8628", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/expr7.f90", "infile_hash": "9b01fedf331316b08b35441cb9f4cb6f7808edd93b29c70e1caeea03", "outfile": null, "outfile_hash": null, "stdout": "ast-expr7-68a8628.stdout", "stdout_hash": "081b61f601296b450572df4283c1f362c9ad2f18905737400d3b2d71", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_struct_01-c320d7d.json0000664000175000017500000000100015174404631025150 0ustar alastairalastair{ "basename": "asr-template_struct_01-c320d7d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_struct_01.f90", "infile_hash": "f66f5d6abfb085636af3a1f278953ef2297f93f3a209002272e6d1f8", "outfile": null, "outfile_hash": null, "stdout": "asr-template_struct_01-c320d7d.stdout", "stdout_hash": "3dd8052d346f2526d8d15f4a1be08514bc39aab07be3e9783dad9ee0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-const_kind_02-7c339b9.json0000664000175000017500000000076115174404631024037 0ustar alastairalastair{ "basename": "asr-const_kind_02-7c339b9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/const_kind_02.f90", "infile_hash": "34f9ee65cf6d3992d028dd2cb7b90c3150acc9bdc0c9d0f6cbdfb6ab", "outfile": null, "outfile_hash": null, "stdout": "asr-const_kind_02-7c339b9.stdout", "stdout_hash": "34693082fe3feda087614ff93f8e01a4076357c9ddfb211145b6367d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-functions_07-2d29eab.json0000664000175000017500000000075615174404631024052 0ustar alastairalastair{ "basename": "asr-functions_07-2d29eab", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_07.f90", "infile_hash": "4688c49c3c531f9e7dafd3b6a4ef2560b6e62ef554ea9df95ed61a8a", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_07-2d29eab.stdout", "stdout_hash": "b1a57f64cda385b74db84aaba35f9354d13b39940bd4e171234e24bf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_03b-0778e50.stdout0000664000175000017500000037426515174404631024164 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_03: (Program (SymbolTable 2 { axpy_tmpl: (Template (SymbolTable 5 { axpy: (Function (SymbolTable 8 { a: (Variable 8 a [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 8 x [] In () () Default (Array (TypeParameter u ) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 8 y [] InOut () () Default (Array (TypeParameter v ) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) axpy (FunctionType [(TypeParameter t ) (Array (TypeParameter u ) [(() ())] DescriptorArray ) (Array (TypeParameter v ) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [times plus] [(Var 8 a) (Var 8 x) (Var 8 y)] [(Assignment (Var 8 y) (FunctionCall 5 plus () [((Var 8 y)) ((FunctionCall 5 times () [((Var 8 a)) ((Var 8 x))] (Array (TypeParameter w ) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 8 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] DescriptorArray ) () () ))] (Array (TypeParameter v ) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 8 y) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] DescriptorArray ) () () ) () .false. .false. )] () Public .true. .true. () ), plus: (Function (SymbolTable 6 { a: (Variable 6 a [] In () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 6 b [] In () () Default (TypeParameter w ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), op: (Variable 6 op [] ReturnVar () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus (FunctionType [(TypeParameter v ) (TypeParameter w )] (TypeParameter v ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 6 a) (Var 6 b)] [] (Var 6 op) Public .true. .true. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), times: (Function (SymbolTable 7 { a: (Variable 7 a [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 7 b [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), op: (Variable 7 op [] ReturnVar () () Default (TypeParameter w ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) times (FunctionType [(TypeParameter t ) (TypeParameter u )] (TypeParameter w ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 7 a) (Var 7 b)] [] (Var 7 op) Public .true. .true. () ), u: (Variable 5 u [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 5 v [] In () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), w: (Variable 5 w [] In () () Default (TypeParameter w ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) axpy_tmpl [t u v w plus times] [(Require op [v w plus] ) (Require op [t u w times] )] ), f: (Function (SymbolTable 12 { a: (Variable 12 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), axpy: (Function (SymbolTable 15 { a: (Variable 15 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 15 x [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 15 y [] InOut () () Default (Array (Real 8) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) axpy (FunctionType [(Real 4) (Array (Integer 4) [(() ())] DescriptorArray ) (Array (Real 8) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~mul_intrinsic ~add_intrinsic] [(Var 15 a) (Var 15 x) (Var 15 y)] [(Assignment (Var 15 y) (FunctionCall 12 ~add_intrinsic () [((Var 15 y)) ((FunctionCall 12 ~mul_intrinsic () [((Var 15 a)) ((Var 15 x))] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 15 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () () ))] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 15 y) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () () ) () .false. .false. )] () Public .true. .true. () ), dp: (Variable 12 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 1.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sp: (Variable 12 sp [] Local (TypeInquiry Kind (Real 4) (RealConstant 1.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 12 x [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 12 y [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~add: (CustomOperator 12 ~add [12 ~add_intrinsic] Public ), ~add_intrinsic: (Function (SymbolTable 13 { arg0: (Variable 13 arg0 [] In () () Default (Real 8) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 13 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 13 ret [] ReturnVar () () Default (Real 8) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic (FunctionType [(Real 8) (Real 4)] (Real 8) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 13 arg0) (Var 13 arg1)] [(Assignment (Var 13 ret) (RealBinOp (Var 13 arg0) Add (Cast (Var 13 arg1) RealToReal (Real 8) () () ) (Real 8) () ) () .false. .false. )] (Var 13 ret) Public .true. .true. () ), ~mul: (CustomOperator 12 ~mul [12 ~mul_intrinsic] Public ), ~mul_intrinsic: (Function (SymbolTable 14 { arg0: (Variable 14 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 14 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 14 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~mul_intrinsic (FunctionType [(Real 4) (Integer 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 14 arg0) (Var 14 arg1)] [(Assignment (Var 14 ret) (RealBinOp (Var 14 arg0) Mul (Cast (Var 14 arg1) IntegerToReal (Real 4) () () ) (Real 4) () ) () .false. .false. )] (Var 14 ret) Public .true. .true. () ) }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 12 a) (RealConstant 0.500000 (Real 4) ) () .false. .false. ) (Assignment (Var 12 x) (ArrayBroadcast (IntegerConstant 2 (Integer 4) Decimal) (ArrayConstant 4 [3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [2, 2, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 12 y) (ArrayBroadcast (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 2.000000 (Real 8) ) () ) (ArrayConstant 4 [3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 24 [2.0000000000000000e+00, 2.0000000000000000e+00, 2.0000000000000000e+00] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (SubroutineCall 12 axpy () [((Var 12 a)) ((ArrayPhysicalCast (Var 12 x) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 12 y) FixedSizeArray DescriptorArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () ))] () .false. )] () Public .true. .true. () ), my_add: (Function (SymbolTable 10 { a: (Variable 10 a [] In () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 10 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dp: (Variable 10 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 1.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), op: (Variable 10 op [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sp: (Variable 10 sp [] Local (TypeInquiry Kind (Real 4) (RealConstant 1.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) my_add (FunctionType [(Real 8) (Real 4)] (Real 8) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 10 a) (Var 10 b)] [(Assignment (Var 10 op) (RealBinOp (Var 10 a) Add (Cast (Var 10 b) RealToReal (Real 8) () () ) (Real 8) () ) () .false. .false. )] (Var 10 op) Public .true. .true. () ), my_axpy: (Function (SymbolTable 11 { a: (Variable 11 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dp: (Variable 11 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 1.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sp: (Variable 11 sp [] Local (TypeInquiry Kind (Real 4) (RealConstant 1.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 11 x [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 11 y [] InOut () () Default (Array (Real 8) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) my_axpy (FunctionType [(Real 4) (Array (Integer 4) [(() ())] DescriptorArray ) (Array (Real 8) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [my_mul my_add] [(Var 11 a) (Var 11 x) (Var 11 y)] [(Assignment (Var 11 y) (FunctionCall 2 my_add () [((Var 11 y)) ((FunctionCall 2 my_mul () [((Var 11 a)) ((Var 11 x))] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 11 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] DescriptorArray ) () () ))] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 11 y) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] DescriptorArray ) () () ) () .false. .false. )] () Public .true. .true. () ), my_mul: (Function (SymbolTable 9 { a: (Variable 9 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 9 b [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), op: (Variable 9 op [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sp: (Variable 9 sp [] Local (TypeInquiry Kind (Real 4) (RealConstant 1.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) my_mul (FunctionType [(Real 4) (Integer 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 9 a) (Var 9 b)] [(Assignment (Var 9 op) (RealBinOp (Var 9 a) Mul (Cast (Var 9 b) IntegerToReal (Real 4) () () ) (Real 4) () ) () .false. .false. )] (Var 9 op) Public .true. .true. () ), op: (Requirement (SymbolTable 3 { op: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), op: (Variable 4 op [] ReturnVar () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) op (FunctionType [(TypeParameter t ) (TypeParameter u )] (TypeParameter v ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 4 a) (Var 4 b)] [] (Var 4 op) Public .true. .true. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u: (Variable 3 u [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 3 v [] In () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) op [t u v op] [] ) }) template_03 [] [(SubroutineCall 2 f () [] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-assign_to2-d8aade7.stdout0000664000175000017500000000124415174404631024235 0ustar alastairalastair(TranslationUnit [(Program assign2 () [] [] [] [(If 100 () (< 0 1) [(Assign 0 101 k () )] [] () () () ) (GoTo 0 k () [100 101] () ) (Print 0 () [(String "no" ())] () ) (Print 101 () [(String "yes" ())] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-type_mismatch2-79a25db.json0000664000175000017500000000074615174404631024410 0ustar alastairalastair{ "basename": "asr-type_mismatch2-79a25db", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/type_mismatch2.f90", "infile_hash": "6a0df64a4e21aca5923478788fd0b478a851e53939d6742cf2c96476", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-type_mismatch2-79a25db.stderr", "stderr_hash": "5d0d17d02357b96f4843fa53d93fa104ab9bcbeb55b06e8b29403085", "returncode": 2 }lfortran-0.63.0/tests/reference/julia-doloop_01-d646475.json0000664000175000017500000000073615174404631023440 0ustar alastairalastair{ "basename": "julia-doloop_01-d646475", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/doloop_01.f90", "infile_hash": "14818f8f39c32bf890cf7906fe8a9692b270ad81a49bcdf0486f8e84", "outfile": null, "outfile_hash": null, "stdout": "julia-doloop_01-d646475.stdout", "stdout_hash": "4463f4b217ca66cb02b92e602bbc6c93123245c65bf6f976c0fdc52f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-func_parameter_type_02-cef1ab3.stdout0000664000175000017500000005002415174404631026507 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 5 { f: (Variable 5 f [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 5 x [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x)] [(Assignment (Var 5 f) (Var 5 x) () .false. .false. )] (Var 5 f) Public .true. .true. () ), hinit853: (Function (SymbolTable 4 { f: (Variable 4 f [] Unspecified () () Default (FunctionType [(Real 4)] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) 4 ~implicit_interface_f_8 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), hinit853: (Variable 4 hinit853 [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~implicit_interface_f_8: (Function (SymbolTable 8 { ~implicit_interface_f_8_arg_0: (Variable 8 ~implicit_interface_f_8_arg_0 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~implicit_interface_f_8_return_var: (Variable 8 ~implicit_interface_f_8_return_var [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~implicit_interface_f_8 (FunctionType [(Real 4)] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 ~implicit_interface_f_8_arg_0)] [] (Var 8 ~implicit_interface_f_8_return_var) Public .false. .false. () ) }) hinit853 (FunctionType [(FunctionType [(Real 4)] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 f)] [(Assignment (Var 4 hinit853) (FunctionCall 4 f () [((RealConstant 3.000000 (Real 4) ))] (Real 4) () () ) () .false. .false. )] (Var 4 hinit853) Public .true. .true. () ), main: (Program (SymbolTable 6 { f: (Function (SymbolTable 7 { f_return_var_name: (Variable 7 f_return_var_name [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 7 f_return_var_name) Public .false. .false. () ) }) main [] [(SubroutineCall 1 sub () [((Var 6 f))] () .false. )] ), sub: (Function (SymbolTable 2 { f: (Function (SymbolTable 3 { f_return_var_name: (Variable 3 f_return_var_name [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 3 f_return_var_name) Public .false. .false. () ), h: (Variable 2 h [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub (FunctionType [(FunctionType [] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [hinit853] [(Var 2 f)] [(Assignment (Var 2 h) (FunctionCall 1 hinit853 () [((Var 2 f))] (Real 4) () () ) () .false. .false. ) (Return)] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/asr_preprocess-cpp7-cec734d.stderr0000664000175000017500000000025415174404631025201 0ustar alastairalastairsemantic error: Variable 'z12' is not declared --> tests/errors/cpp7.f90:116:21 | 116 | print *, "1aa", z12, 5 | ^^^ 'z12' is undeclared lfortran-0.63.0/tests/reference/asr-logical2-e35f19c.json0000664000175000017500000000074215174404631023152 0ustar alastairalastair{ "basename": "asr-logical2-e35f19c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/logical2.f90", "infile_hash": "5b01ca4533da32f0fa6292eeb511d007181a316ce112af8ff858c9c0", "outfile": null, "outfile_hash": null, "stdout": "asr-logical2-e35f19c.stdout", "stdout_hash": "cdee06a8e138e477c159ce7b769e903b27db7a70765063e9fde0a161", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-write1-6827691.stdout0000664000175000017500000000144315174404631023510 0ustar alastairalastairprogram write_01 implicit none write(*, *) "a", 2 write(*, *) write(*) a write(out_str, '(" Found index ", i9," but item is not in list.")') index write(out_string, *) "Scalar_in = ", scalar_in write(out_string, 10) int_src, int_given, int_expected write(string, fmt="(f6.2)") max_angle write(fmt, '("(i",i0,".",i0,")")') n, n write(unit=*, fmt="(a)") trim(prog) // ": " // message write(unit=0, fmt="(a,i4.4)") "Assertion failed at " // file // ":", line write(*, fmt="(a,l1)") "exactly_conservative= ", exactly_conservative write(unit=lun) vec write(*, "(a,a)", advance="no") trim(input_string), ": " write(ounit, FMT=303, ADVANCE="NO") write(*, 201) (star, i = 1, 80) write(*, "(1X,A)") "Success!" write(ounit, *) print *, "2" print * print "(a, es22.14)", "Ekin: ", Ekin end program write_01 lfortran-0.63.0/tests/reference/ast_f90-derived_types_01-2ba20d5.json0000664000175000017500000000100515174404631025255 0ustar alastairalastair{ "basename": "ast_f90-derived_types_01-2ba20d5", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/derived_types_01.f90", "infile_hash": "d5361dd7a0436fd13655dcc3ad47c98f3ce6966934537f5e9cc001c5", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-derived_types_01-2ba20d5.stdout", "stdout_hash": "cdba8e3acfcc8bdc1a07b64f9bb6e8f938fc04d924b9b8f2f00d5dd7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-file_53-1d4a0dc.stdout0000664000175000017500000000024715174404631023335 0ustar alastairalastair 1 2 39999 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ----------- 1 2 39999101201102 202103203 104204105 205106206 107207108 208109209 110210 lfortran-0.63.0/tests/reference/asr-template_simple_03-17a83b7.stdout0000664000175000017500000067431015174404631025442 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_simple_03: (Program (SymbolTable 21 { cast_r: (ExternalSymbol 21 cast_r 2 cast_r template_simple_03_m [] cast_r Public ), generic_avg: (ExternalSymbol 21 generic_avg 2 generic_avg template_simple_03_m [] generic_avg Public ), generic_sum: (ExternalSymbol 21 generic_sum 2 generic_sum template_simple_03_m [] generic_sum Public ), operator_r: (ExternalSymbol 21 operator_r 2 operator_r template_simple_03_m [] operator_r Public ), test_template: (ExternalSymbol 21 test_template 2 test_template template_simple_03_m [] test_template Public ) }) template_simple_03 [template_simple_03_m] [(SubroutineCall 21 test_template () [] () .false. )] ), template_simple_03_m: (Module (SymbolTable 2 { cast_integer: (Function (SymbolTable 7 { arg: (Variable 7 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 7 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast_integer (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 7 arg)] [(Assignment (Var 7 res) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 7 res) Private .true. .true. () ), cast_r: (Requirement (SymbolTable 5 { cast: (Function (SymbolTable 6 { arg: (Variable 6 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 6 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 6 arg)] [] (Var 6 res) Private .true. .true. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast_r [t cast] [] ), cast_real: (Function (SymbolTable 8 { arg: (Variable 8 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 8 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast_real (FunctionType [(Integer 4)] (Real 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 8 arg)] [(Assignment (Var 8 res) (RealConstant 0.000000 (Real 4) ) () .false. .false. )] (Var 8 res) Private .true. .true. () ), div_integer: (Function (SymbolTable 9 { lhs: (Variable 9 lhs [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 9 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 9 rhs [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) div_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 9 lhs) (Var 9 rhs)] [(Assignment (Var 9 res) (IntegerBinOp (Var 9 lhs) Div (Var 9 rhs) (Integer 4) () ) () .false. .false. )] (Var 9 res) Private .true. .true. () ), div_real: (Function (SymbolTable 10 { lhs: (Variable 10 lhs [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 10 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 10 rhs [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) div_real (FunctionType [(Real 4) (Integer 4)] (Real 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 10 lhs) (Var 10 rhs)] [(Assignment (Var 10 res) (RealBinOp (Var 10 lhs) Div (Cast (Var 10 rhs) IntegerToReal (Real 4) () () ) (Real 4) () ) () .false. .false. )] (Var 10 res) Private .true. .true. () ), generic_avg: (Template (SymbolTable 15 { __instantiated_generic_sum: (Function (SymbolTable 22 { arr: (Variable 22 arr [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 22 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 22 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 22 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __instantiated_generic_sum (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast add] [(Var 22 arr)] [(Assignment (Var 22 n) (ArraySize (Var 22 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 22 res) (FunctionCall 15 cast () [((IntegerConstant 0 (Integer 4) Decimal))] (TypeParameter t ) () () ) () .false. .false. ) (If () (IntegerCompare (Var 22 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 22 res) (ArrayItem (Var 22 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 22 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 22 n) ()) [(Assignment (Var 22 res) (FunctionCall 15 add () [((Var 22 res)) ((ArrayItem (Var 22 arr) [(() (Var 22 i) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) () .false. .false. )] [] )] [] )] (Var 22 res) Public .true. .true. () ), add: (Function (SymbolTable 16 { lhs: (Variable 16 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 16 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 16 rhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 16 lhs) (Var 16 rhs)] [] (Var 16 res) Private .true. .true. () ), cast: (Function (SymbolTable 17 { arg: (Variable 17 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 17 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 17 arg)] [] (Var 17 res) Private .true. .true. () ), div: (Function (SymbolTable 18 { lhs: (Variable 18 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 18 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 18 rhs [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) div (FunctionType [(TypeParameter t ) (Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 18 lhs) (Var 18 rhs)] [] (Var 18 res) Private .true. .true. () ), generic_avg: (Function (SymbolTable 19 { arr: (Variable 19 arr [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 19 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 19 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 19 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) generic_avg (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [__instantiated_generic_sum div cast] [(Var 19 arr)] [(Assignment (Var 19 n) (ArraySize (Var 19 arr) () (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 19 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 19 res) (FunctionCall 15 div () [((FunctionCall 15 __instantiated_generic_sum () [((ArrayPhysicalCast (Var 19 arr) DescriptorArray DescriptorArray (Array (TypeParameter t ) [(() ())] DescriptorArray ) () ))] (TypeParameter t ) () () )) ((Var 19 n))] (TypeParameter t ) () () ) () .false. .false. )] [(Assignment (Var 19 res) (FunctionCall 15 cast () [((IntegerConstant 0 (Integer 4) Decimal))] (TypeParameter t ) () () ) () .false. .false. )] )] (Var 19 res) Private .true. .true. () ), integer: (Variable 15 integer [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t: (Variable 15 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) generic_avg [t add cast div] [(Require operator_r [t add] ) (Require cast_r [t cast] ) (Require operator_r [t integer div] )] ), generic_sum: (Template (SymbolTable 11 { add: (Function (SymbolTable 12 { lhs: (Variable 12 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 12 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 12 rhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 12 lhs) (Var 12 rhs)] [] (Var 12 res) Private .true. .true. () ), cast: (Function (SymbolTable 13 { arg: (Variable 13 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 13 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 13 arg)] [] (Var 13 res) Private .true. .true. () ), generic_sum: (Function (SymbolTable 14 { arr: (Variable 14 arr [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 14 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 14 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 14 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) generic_sum (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast add] [(Var 14 arr)] [(Assignment (Var 14 n) (ArraySize (Var 14 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 14 res) (FunctionCall 11 cast () [((IntegerConstant 0 (Integer 4) Decimal))] (TypeParameter t ) () () ) () .false. .false. ) (If () (IntegerCompare (Var 14 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 14 res) (ArrayItem (Var 14 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 14 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 14 n) ()) [(Assignment (Var 14 res) (FunctionCall 11 add () [((Var 14 res)) ((ArrayItem (Var 14 arr) [(() (Var 14 i) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) () .false. .false. )] [] )] [] )] (Var 14 res) Public .true. .true. () ), t: (Variable 11 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) generic_sum [t add cast] [(Require operator_r [t add] ) (Require cast_r [t cast] )] ), operator_r: (Requirement (SymbolTable 3 { binary_func: (Function (SymbolTable 4 { lhs: (Variable 4 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 4 res [] ReturnVar () () Default (TypeParameter v ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 4 rhs [] In () () Default (TypeParameter u ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) binary_func (FunctionType [(TypeParameter t ) (TypeParameter u )] (TypeParameter v ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 4 lhs) (Var 4 rhs)] [] (Var 4 res) Private .true. .true. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u: (Variable 3 u [] In () () Default (TypeParameter u ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 3 v [] In () () Default (TypeParameter v ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) operator_r [t u v binary_func] [] ), test_template: (Function (SymbolTable 20 { __asr___instantiated_generic_sum: (Function (SymbolTable 25 { arr: (Variable 25 arr [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 25 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 25 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 25 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __asr___instantiated_generic_sum (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_integer ~add_intrinsic] [(Var 25 arr)] [(Assignment (Var 25 n) (ArraySize (Var 25 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 25 res) (FunctionCall 2 cast_integer () [((IntegerConstant 0 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 25 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 25 res) (ArrayItem (Var 25 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 25 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 25 n) ()) [(Assignment (Var 25 res) (FunctionCall 20 ~add_intrinsic () [((Var 25 res)) ((ArrayItem (Var 25 arr) [(() (Var 25 i) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) () .false. .false. )] [] )] [] )] (Var 25 res) Public .true. .true. () ), __asr___instantiated_generic_sum1: (Function (SymbolTable 28 { arr: (Variable 28 arr [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 28 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 28 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 28 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __asr___instantiated_generic_sum1 (FunctionType [(Array (Real 4) [(() ())] DescriptorArray )] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_real ~add_intrinsic1] [(Var 28 arr)] [(Assignment (Var 28 n) (ArraySize (Var 28 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 28 res) (FunctionCall 2 cast_real () [((IntegerConstant 0 (Integer 4) Decimal))] (Real 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 28 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 28 res) (ArrayItem (Var 28 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 28 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 28 n) ()) [(Assignment (Var 28 res) (FunctionCall 20 ~add_intrinsic1 () [((Var 28 res)) ((ArrayItem (Var 28 arr) [(() (Var 28 i) ())] (Real 4) ColMajor () ))] (Real 4) () () ) () .false. .false. )] [] )] [] )] (Var 28 res) Public .true. .true. () ), __instantiated_generic_avg: (Function (SymbolTable 24 { arr: (Variable 24 arr [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 24 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 24 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 24 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __instantiated_generic_avg (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [__asr___instantiated_generic_sum div_integer cast_integer] [(Var 24 arr)] [(Assignment (Var 24 n) (ArraySize (Var 24 arr) () (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 24 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 24 res) (FunctionCall 2 div_integer () [((FunctionCall 20 __asr___instantiated_generic_sum () [((ArrayPhysicalCast (Var 24 arr) DescriptorArray DescriptorArray (Array (Integer 4) [(() ())] DescriptorArray ) () ))] (Integer 4) () () )) ((Var 24 n))] (Integer 4) () () ) () .false. .false. )] [(Assignment (Var 24 res) (FunctionCall 2 cast_integer () [((IntegerConstant 0 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. )] )] (Var 24 res) Private .true. .true. () ), __instantiated_generic_avg1: (Function (SymbolTable 27 { arr: (Variable 27 arr [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 27 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 27 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 27 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __instantiated_generic_avg1 (FunctionType [(Array (Real 4) [(() ())] DescriptorArray )] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [__asr___instantiated_generic_sum1 div_real cast_real] [(Var 27 arr)] [(Assignment (Var 27 n) (ArraySize (Var 27 arr) () (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 27 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 27 res) (FunctionCall 2 div_real () [((FunctionCall 20 __asr___instantiated_generic_sum1 () [((ArrayPhysicalCast (Var 27 arr) DescriptorArray DescriptorArray (Array (Real 4) [(() ())] DescriptorArray ) () ))] (Real 4) () () )) ((Var 27 n))] (Real 4) () () ) () .false. .false. )] [(Assignment (Var 27 res) (FunctionCall 2 cast_real () [((IntegerConstant 0 (Integer 4) Decimal))] (Real 4) () () ) () .false. .false. )] )] (Var 27 res) Private .true. .true. () ), a_i: (Variable 20 a_i [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a_r: (Variable 20 a_r [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 20 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s_i: (Variable 20 s_i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s_r: (Variable 20 s_r [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~add: (CustomOperator 20 ~add [20 ~add_intrinsic 20 ~add_intrinsic1] Public ), ~add_intrinsic: (Function (SymbolTable 23 { arg0: (Variable 23 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 23 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 23 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 23 arg0) (Var 23 arg1)] [(Assignment (Var 23 ret) (IntegerBinOp (Var 23 arg0) Add (Var 23 arg1) (Integer 4) () ) () .false. .false. )] (Var 23 ret) Public .false. .true. () ), ~add_intrinsic1: (Function (SymbolTable 26 { arg0: (Variable 26 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 26 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 26 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic1 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 26 arg0) (Var 26 arg1)] [(Assignment (Var 26 ret) (RealBinOp (Var 26 arg0) Add (Var 26 arg1) (Real 4) () ) () .false. .false. )] (Var 26 ret) Public .false. .true. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(DoLoop () ((Var 20 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 20 a_i) () (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) ) ()) [(Assignment (ArrayItem (Var 20 a_i) [(() (Var 20 i) ())] (Integer 4) ColMajor () ) (Var 20 i) () .false. .false. ) (Assignment (ArrayItem (Var 20 a_r) [(() (Var 20 i) ())] (Real 4) ColMajor () ) (Cast (Var 20 i) IntegerToReal (Real 4) () () ) () .false. .false. )] [] ) (Assignment (Var 20 s_i) (FunctionCall 20 __instantiated_generic_avg () [((ArrayPhysicalCast (Var 20 a_i) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 20 s_r) (FunctionCall 20 __instantiated_generic_avg1 () [((ArrayPhysicalCast (Var 20 a_r) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 20 s_i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_simple_03_m () [template_simple_03_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/llvm-stop-866225f.stdout0000664000175000017500000000302015174404631023034 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." @STOP = private unnamed_addr constant [5 x i8] c"STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca i32, align 4 store i32 25, i32* %x, align 4 %2 = load i32, i32* %x, align 4 %3 = icmp eq i32 %2, 25 br i1 %3, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @STOP, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 0) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_stop FINALIZE_SYMTABLE_stop: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) lfortran-0.63.0/tests/reference/ast_f90-case_01-dcc012a.stdout0000664000175000017500000000103015174404631023747 0ustar alastairalastairprogram case_01 implicit none integer(8) :: i, out i = 4 select case (i) case (1) out = 10 print *, "1" case (2) out = 20 print *, "2" case (3) out = 30 print *, "3" case (4) out = 40 print *, "4" end select if (out /= 40) then error stop end if select case (i) case (1) out = 11 print *, "1" case (2, 3, 4) out = 22 print *, "2,3,4" end select if (out /= 22) then error stop end if end program case_01 lfortran-0.63.0/tests/reference/asr-array_03-a79d86f.stderr0000664000175000017500000000025615174404631023441 0ustar alastairalastairsemantic error: Rank mismatch in array reference: the array `a` has rank `1`, but is referenced as rank `2` --> tests/errors/array_03.f90:5:1 | 5 | a(:,:) = 1 | ^^^^^^ lfortran-0.63.0/tests/reference/asr-allocate_04-68facec.json0000664000175000017500000000075315174404631023707 0ustar alastairalastair{ "basename": "asr-allocate_04-68facec", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/allocate_04.f90", "infile_hash": "ae79e641a2ff12bf6ee5ec9a5d86305d62fc6cddef0454fe759962e0", "outfile": null, "outfile_hash": null, "stdout": "asr-allocate_04-68facec.stdout", "stdout_hash": "b3c8617e28527a3689b8afab3205aa06313a240397e2d821285e09f9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-expr1-03e6c2a.stdout0000664000175000017500000000077215174404631023242 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define i32 @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i32, align 4 store i32 5, i32* %__lfortran_evaluate_11, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return %0 = load i32, i32* %__lfortran_evaluate_11, align 4 ret i32 %0 } lfortran-0.63.0/tests/reference/asr-dependency_test_02-6d588ae.stdout0000664000175000017500000001173015174404631025511 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { m_cli2: (Module (SymbolTable 2 { a2d: (Function (SymbolTable 3 { ivalu: (Variable 3 ivalu [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), valu: (Variable 3 valu [] Out () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a2d (FunctionType [(Real 8)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 valu)] [(Assignment (Var 3 valu) (IntrinsicElementalFunction Real [(Var 3 ivalu)] 0 (Real 8) () ) () .false. .false. )] () Public .true. .true. () ) }) m_cli2 () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-dreal_arg_error-91381bb.json0000664000175000017500000000075115174404631024521 0ustar alastairalastair{ "basename": "asr-dreal_arg_error-91381bb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dreal_arg_error.f90", "infile_hash": "b3eef179f8004efffebeb00ee2a7cccd1d2c6c90cfaa04973a3e8d50", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dreal_arg_error-91381bb.stderr", "stderr_hash": "ab0ace5f803a78c7790287d4b8d2a54073815a3bb40e830cee3164f5", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-types_06-6f66d2c.json0000664000175000017500000000074515174404631023320 0ustar alastairalastair{ "basename": "llvm-types_06-6f66d2c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/types_06.f90", "infile_hash": "821a3f29390ed022c7e72bdf2e4f9bace059d335abe1d1b729ac6d22", "outfile": null, "outfile_hash": null, "stdout": "llvm-types_06-6f66d2c.stdout", "stdout_hash": "03d2db6633b763abb0490b54e28bdfede1fdc7d516e3440a0c5037d3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-arrays_09-721986f.stdout0000664000175000017500000000023115174404631024160 0ustar alastairalastairprogram arrays_09 implicit none character(len=10) :: a(1) a(1) = "Substring" if (a(1)(4:9) /= "string") then error stop end if end program arrays_09 lfortran-0.63.0/tests/reference/asr_json-special_chars_json-70bba3a.stdout0000664000175000017500000001533415174404631026754 0ustar alastairalastair{ "node": "TranslationUnit", "fields": { "symtab": { "node": "SymbolTable1", "fields": { "special_chars_json": { "node": "Program", "fields": { "symtab": { "node": "SymbolTable2", "fields": {} }, "name": "special_chars_json", "dependencies": [], "body": [ { "node": "Print", "fields": { "text": { "node": "StringConstant", "fields": { "s": "A \"string\".", "type": { "node": "String", "fields": { "kind": 1, "len": { "node": "IntegerConstant", "fields": { "n": 11, "type": { "node": "Integer", "fields": { "kind": 4 }, "loc": { "first": 59, "last": 73, "first_filename": "tests/special_chars_json.f90", "first_line": 3, "first_column": 14, "last_filename": "tests/special_chars_json.f90", "last_line": 3, "last_column": 28 } }, "intboz_type": "Decimal" }, "loc": { "first": 59, "last": 73, "first_filename": "tests/special_chars_json.f90", "first_line": 3, "first_column": 14, "last_filename": "tests/special_chars_json.f90", "last_line": 3, "last_column": 28 } }, "len_kind": "ExpressionLength", "physical_type": "DescriptorString" }, "loc": { "first": 59, "last": 73, "first_filename": "tests/special_chars_json.f90", "first_line": 3, "first_column": 14, "last_filename": "tests/special_chars_json.f90", "last_line": 3, "last_column": 28 } } }, "loc": { "first": 59, "last": 73, "first_filename": "tests/special_chars_json.f90", "first_line": 3, "first_column": 14, "last_filename": "tests/special_chars_json.f90", "last_line": 3, "last_column": 28 } } }, "loc": { "first": 50, "last": 73, "first_filename": "tests/special_chars_json.f90", "first_line": 3, "first_column": 5, "last_filename": "tests/special_chars_json.f90", "last_line": 3, "last_column": 28 } } ] }, "loc": { "first": 0, "last": 77, "first_filename": "tests/special_chars_json.f90", "first_line": 1, "first_column": 1, "last_filename": "tests/special_chars_json.f90", "last_line": 4, "last_column": 3 } } } }, "items": [] }, "loc": { "first": 0, "last": 77, "first_filename": "tests/special_chars_json.f90", "first_line": 1, "first_column": 1, "last_filename": "tests/special_chars_json.f90", "last_line": 4, "last_column": 3 } } lfortran-0.63.0/tests/reference/asr-select_type_04-e8b402f.stdout0000664000175000017500000012326615174404631024654 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { class_default_select_type: (Module (SymbolTable 12 { enum_stat: (Struct (SymbolTable 13 { fatal: (Variable 13 fatal [] Local (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (IntegerConstant -1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), success: (Variable 13 success [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) enum_stat (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) [] [success fatal] [] Source Public .false. .false. [] () () [] ), toml_stat: (Variable 12 toml_stat [] Local (StructConstant 12 enum_stat [((IntegerConstant 0 (Integer 4) Decimal)) ((IntegerConstant -1 (Integer 4) Decimal))] (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) ) (StructConstant 12 enum_stat [((IntegerConstant 0 (Integer 4) Decimal)) ((IntegerConstant -1 (Integer 4) Decimal))] (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) ) Parameter (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) 12 enum_stat Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) class_default_select_type () [] .true. .false. .false. ), class_default_select_type_user: (Module (SymbolTable 4 { 1_enum_stat: (ExternalSymbol 4 1_enum_stat 12 enum_stat class_default_select_type [] enum_stat Public ), check_table: (Function (SymbolTable 7 { tab: (Variable 7 tab [] Out () () Default (StructType [(Logical 4) (Logical 4)] [] .false. .false. ) 4 toml_table Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) check_table (FunctionType [(StructType [(Logical 4) (Logical 4)] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 tab)] [(Print (StringConstant "inside check_table" (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), get_table: (Function (SymbolTable 8 { ptr: (Variable 8 ptr [] Out () () Default (Pointer (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) 4 toml_table Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), stat: (Variable 8 stat [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), table: (Variable 8 table [] InOut () () Default (StructType [(Logical 4) (Logical 4)] [] .false. .false. ) 4 toml_table Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 8 tmp [] Local () () Default (Pointer (StructType [(Integer 4) (Real 4)] [] .false. .false. ) ) 4 toml_value Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~select_type_block_: (Block (SymbolTable 9 { 1_enum_stat_success: (ExternalSymbol 9 1_enum_stat_success 13 success 1_enum_stat [] success Public ) }) ~select_type_block_ [(Associate (Var 8 ptr) (Cast (Var 8 tmp) ClassToStruct (Pointer (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) () (Var 4 toml_table) ) ) (If () (IntrinsicElementalFunction Present [(Var 8 stat)] 0 (Logical 4) () ) [(Assignment (Var 8 stat) (StructInstanceMember (Var 4 toml_stat) 9 1_enum_stat_success (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) ) () .false. .false. )] [] )] ), ~select_type_block_1: (Block (SymbolTable 10 { 1_enum_stat_fatal: (ExternalSymbol 10 1_enum_stat_fatal 13 fatal 1_enum_stat [] fatal Public ) }) ~select_type_block_1 [(If () (IntrinsicElementalFunction Present [(Var 8 stat)] 0 (Logical 4) () ) [(Assignment (Var 8 stat) (StructInstanceMember (Var 4 toml_stat) 10 1_enum_stat_fatal (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) () .false. .false. )] [] )] ) }) get_table (FunctionType [(StructType [(Logical 4) (Logical 4)] [] .false. .false. ) (Pointer (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [check_table] [(Var 8 table) (Var 8 ptr) (Var 8 stat)] [(Nullify [(Var 8 ptr)] ) (If () (PointerAssociated (Var 8 tmp) () (Logical 4) () ) [(SelectType (Var 8 tmp) () [(TypeStmtName 4 toml_table [(BlockCall -1 8 ~select_type_block_ )] )] [(BlockCall -1 8 ~select_type_block_1 )] )] [(SubroutineCall 4 check_table () [((Var 8 table))] () .false. )] )] () Public .true. .true. () ), toml_stat: (ExternalSymbol 4 toml_stat 12 toml_stat class_default_select_type [] toml_stat Public ), toml_table: (Struct (SymbolTable 5 { implicit: (Variable 5 implicit [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), inline: (Variable 5 inline [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_table (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) [] [implicit inline] [] Source Public .false. .false. [] () 4 toml_value [] ), toml_value: (Struct (SymbolTable 6 { float: (Variable 6 float [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), int: (Variable 6 int [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_value (StructType [(Integer 4) (Real 4)] [] .true. .false. ) [] [int float] [] Source Public .false. .false. [] () () [] ) }) class_default_select_type_user () [class_default_select_type] .true. .false. .false. ), class_default_select_type_user1: (Module (SymbolTable 2 { 1_enum_stat: (ExternalSymbol 2 1_enum_stat 12 enum_stat class_default_select_type [] enum_stat Public ), check_table: (ExternalSymbol 2 check_table 4 check_table class_default_select_type_user [] check_table Public ), get_table: (ExternalSymbol 2 get_table 4 get_table class_default_select_type_user [] get_table Public ), toml_stat: (ExternalSymbol 2 toml_stat 12 toml_stat class_default_select_type [] toml_stat Public ), toml_table: (ExternalSymbol 2 toml_table 4 toml_table class_default_select_type_user [] toml_table Public ), toml_value: (ExternalSymbol 2 toml_value 4 toml_value class_default_select_type_user [] toml_value Public ) }) class_default_select_type_user1 () [class_default_select_type_user class_default_select_type] .false. .false. .false. ), select_type4: (Program (SymbolTable 14 { }) select_type4 [] [(Print (StringConstant "running select_type4 main program" (String 1 (IntegerConstant 33 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-operator_overloading_02-adb886e.json0000664000175000017500000000102215174404631026442 0ustar alastairalastair{ "basename": "llvm-operator_overloading_02-adb886e", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/operator_overloading_02.f90", "infile_hash": "d3f6f9065ea2f75dd235a6384cdd3f82769eb16971fac839a39430b6", "outfile": null, "outfile_hash": null, "stdout": "llvm-operator_overloading_02-adb886e.stdout", "stdout_hash": "0690f1aeaee036054b51aeffa394de8a5e49124bf7985e881da61633", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-subroutines_02-597f5e1.stdout0000664000175000017500000005231215174404631024640 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { subroutines_02: (Program (SymbolTable 2 { f: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b)] [(Assignment (Var 3 b) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ), g: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) g (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a) (Var 4 b)] [(Assignment (Var 4 b) (IntegerBinOp (Var 4 a) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ), h: (Function (SymbolTable 5 { a: (Variable 5 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 5 b [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) h (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [g] [(Var 5 a) (Var 5 b)] [(SubroutineCall 2 g () [((Var 5 a)) ((Var 5 b))] () .false. )] () Public .true. .true. () ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) subroutines_02 [] [(Assignment (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 2 f () [((Var 2 i)) ((Var 2 j))] () .false. ) (Print (StringFormat () [(Var 2 i) (Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (SubroutineCall 2 g () [((Var 2 i)) ((Var 2 j))] () .false. ) (Print (StringFormat () [(Var 2 i) (Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (SubroutineCall 2 h () [((Var 2 i)) ((Var 2 j))] () .false. ) (Print (StringFormat () [(Var 2 i) (Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-int_dp-41a64fa.json0000664000175000017500000000073415174404631022723 0ustar alastairalastair{ "basename": "asr-int_dp-41a64fa", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/int_dp.f90", "infile_hash": "f59edf2644a27d68d7127283dbb961288e4041e2de16284795b100de", "outfile": null, "outfile_hash": null, "stdout": "asr-int_dp-41a64fa.stdout", "stdout_hash": "dcff39c6486e88d3ef496dfda6e4fce525e04acb9d4f16be27720c61", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-esub1-15eb690.json0000664000175000017500000000071315174404631022411 0ustar alastairalastair{ "basename": "ast-esub1-15eb690", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/esub1.f90", "infile_hash": "93b7d715c14f2da952a8945b7ea7b16817b269880b156f00497dd7b1", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-esub1-15eb690.stderr", "stderr_hash": "48b8d74bcdf39ea72135c4853146fdfde7142e5f9ce448b9553d2c1a", "returncode": 2 }././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootlfortran-0.63.0/tests/reference/asr-incompatible_dimension_logical_arrays_logical_binop_02-5be1708.jsonlfortran-0.63.0/tests/reference/asr-incompatible_dimension_logical_arrays_logical_binop_02-5be1708.j0000664000175000017500000000113615174404631033620 0ustar alastairalastair{ "basename": "asr-incompatible_dimension_logical_arrays_logical_binop_02-5be1708", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incompatible_dimension_logical_arrays_logical_binop_02.f90", "infile_hash": "c26b31652036dcebc000ad9bfe9d5aae3fac2441958efe2268f46d19", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incompatible_dimension_logical_arrays_logical_binop_02-5be1708.stderr", "stderr_hash": "51654ae3483b5cb57d2295f9bf6b7501f2f1f8d1250b8a09f4c5e924", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-fixed_form2-ad2afae.stdout0000664000175000017500000000264515174404631024445 0ustar alastairalastair(TranslationUnit [(Program fixed_form2 () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ())] () )] [(Print 0 () [(String "OK1" ()) (String "OK2" ())] () ) (Print 0 () [(String "OK1" ()) (String "OK2" ()) (String "OK3" ()) (String "OK4" ())] () ) (Print 0 () [(String "1" ())] () ) (Print 0 () [(String "2" ())] () ) (Print 0 () [(String "1" ()) (String "1 ! not comment finish string" ())] () ) (Print 0 () [(String "1" ()) (String "1 \" ' 2 \"\" 3 ! also not comment finish string" ())] () ) (Print 0 () [(String "1" ()) (String "1 ' \" 2 '' 3 ! also not comment finish string" ())] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-implicit7-2fc9cda.json0000664000175000017500000000072015174404631023507 0ustar alastairalastair{ "basename": "asr-implicit7-2fc9cda", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/implicit7.f90", "infile_hash": "f389525fdeb3f01a6e2f3902da259e8c9b117370a482a4d4bc9d1b01", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit7-2fc9cda.stderr", "stderr_hash": "c103dd0c1aad2b4cb0598bc98db32afd7c75270493322c6e09ab08bf", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-modules2-98d8120.json0000664000175000017500000000071515174404631023050 0ustar alastairalastair{ "basename": "asr-modules2-98d8120", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/modules2.f90", "infile_hash": "3f2cf619d97820f4371479e1b19d3aaeddb359d806107c1761fb7cfb", "outfile": null, "outfile_hash": null, "stdout": "asr-modules2-98d8120.stdout", "stdout_hash": "2e24b74b5125670497370a9605402aa175f2d7e6c88657b33445a8bb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_error_06-1cbc8a9.stderr0000664000175000017500000000027115174404631025411 0ustar alastairalastairsemantic error: Type parameter 'g' is not specified in any requirements --> tests/errors/template_error_06.f90:16:11 | 16 | type(g) :: fst | ^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-compare_01-c98905f.stderr0000664000175000017500000000023315174404631023661 0ustar alastairalastairsemantic error: Operands of comparison operator are of different types --> tests/errors/compare_01.f90:6:9 | 6 | if (i > x) then | ^^^^^ lfortran-0.63.0/tests/reference/asr-allocate_03-8219a72.stdout0000664000175000017500000011012115174404631023744 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { allocate_03: (Program (SymbolTable 2 { c: (Variable 2 c [] Local () () Default (Allocatable (Array (Integer 4) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Function (SymbolTable 3 { c: (Variable 3 c [] Out () () Default (Allocatable (Array (Integer 4) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Allocatable (Array (Integer 4) [(() ()) (() ()) (() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 c)] [(Allocate [((Var 3 c) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (ArrayItem (Var 3 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 99 (Integer 4) Decimal) () .false. .false. )] () Public .true. .true. () ), g: (Function (SymbolTable 4 { r: (Variable 4 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] Unspecified () () Default (Allocatable (Array (Integer 4) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) g (FunctionType [(Allocatable (Array (Integer 4) [(() ()) (() ()) (() ())] DescriptorArray ) )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 4 x)] [(Print (StringFormat () [(ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (SubroutineCall 2 f () [((Var 4 x))] () .false. ) (Print (StringFormat () [(ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 99 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 8 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 4 r) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 4 r) Public .false. .false. () ), h: (Function (SymbolTable 5 { c: (Variable 5 c [] Out () () Default (Allocatable (Array (Integer 4) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) h (FunctionType [(Allocatable (Array (Integer 4) [(() ()) (() ()) (() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 5 c)] [(If () (IntrinsicImpureFunction Allocated [(Var 5 c)] 0 (Logical 4) () ) [(ErrorStop () )] [] ) (SubroutineCall 2 f () [((Var 5 c))] () .false. ) (Print (StringFormat () [(ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 99 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 8 (Integer 4) Decimal) () .false. .false. )] () Public .false. .false. () ), r: (Variable 2 r [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), stat: (Variable 2 stat [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) allocate_03 [] [(Assignment (Var 2 stat) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Allocate [((Var 2 c) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] () () ())] (Var 2 stat) () () ) (If () (IntegerCompare (Var 2 stat) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 2 h () [((Var 2 c))] () .false. ) (Assignment (Var 2 r) (FunctionCall 2 g () [((Var 2 c))] (Integer 4) () () ) () .false. .false. ) (If () (IntegerCompare (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/cpp-array3-a2f045b.json0000664000175000017500000000067215174404631022642 0ustar alastairalastair{ "basename": "cpp-array3-a2f045b", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/array3.f90", "infile_hash": "047ac01d7e3df52429d6889258f37213048937dae8611af6cbd9ecae", "outfile": null, "outfile_hash": null, "stdout": "cpp-array3-a2f045b.stdout", "stdout_hash": "6770dd465ff4e4bf33927119661219194533beaa7d767bc85cb4faab", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-nullify1-aaf5456.stdout0000664000175000017500000000073215174404631023567 0ustar alastairalastair(TranslationUnit [(Program nullify1 (TriviaNode [(EndOfLine) (Comment "! Tests for syntax (AST) only:" )] [] ) [] [] [] [(Nullify 0 [a] [] () ) (Nullify 0 [a b c d] [] () )] [] )] ) lfortran-0.63.0/tests/reference/ast_f90-defop1-57f175e.json0000664000175000017500000000072215174404631023236 0ustar alastairalastair{ "basename": "ast_f90-defop1-57f175e", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/defop1.f90", "infile_hash": "78b29077fdb7303bc8002ba7f16a36ffa13a981527f87df53bf268e3", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-defop1-57f175e.stdout", "stdout_hash": "29fa60c533348137b692bebe3c5345e95ac566bb5372d55e8d5ac217", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-arrays_03_func-3a62608.json0000664000175000017500000000074715174404631024130 0ustar alastairalastair{ "basename": "cpp-arrays_03_func-3a62608", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/arrays_03_func.f90", "infile_hash": "9feab893fd240821f352bd8b0c12cb132cf39c706950d08f5a41cc54", "outfile": null, "outfile_hash": null, "stdout": "cpp-arrays_03_func-3a62608.stdout", "stdout_hash": "dbff11115ecae844c9306d5ca561714e81131856182683512bb3c5ee", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-types_07-54d4a85.json0000664000175000017500000000074215174404631023051 0ustar alastairalastair{ "basename": "ast-types_07-54d4a85", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_07.f90", "infile_hash": "a918662a55a6896275936f024c6c39132fd389d478f71afb080995a0", "outfile": null, "outfile_hash": null, "stdout": "ast-types_07-54d4a85.stdout", "stdout_hash": "1a189b481ef5f05df33a2f9155d98535aef122b91ab033808708fea1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-generic_name_01-9f2fd25.json0000664000175000017500000000076715174404631024403 0ustar alastairalastair{ "basename": "asr-generic_name_01-9f2fd25", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/generic_name_01.f90", "infile_hash": "cf72bd4f491d240363b4f763c22fc7dbd88483b3a7e5303471f65b40", "outfile": null, "outfile_hash": null, "stdout": "asr-generic_name_01-9f2fd25.stdout", "stdout_hash": "6ff69e57aa38bd9529032868156c0747f75f55e4e4774f27f0764691", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-string-0f0b404.json0000664000175000017500000000072215174404631023342 0ustar alastairalastair{ "basename": "ast_f90-string-0f0b404", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/string.f90", "infile_hash": "427cf41e07ff6d1217b77bfd2d033fbd8447ad0a4358727fdac3264d", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-string-0f0b404.stdout", "stdout_hash": "d39423f35652c86c3df032820a4219f60d161614cd39e8eaa48a4b6b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-c_f_pointer_01-2d288d7.json0000664000175000017500000000074615174404631024174 0ustar alastairalastair{ "basename": "asr-c_f_pointer_01-2d288d7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/c_f_pointer_01.f90", "infile_hash": "39fe25b56ce582c423fda91853a1bffd5b71f5f9065cf09aa23af814", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-c_f_pointer_01-2d288d7.stderr", "stderr_hash": "84951e59d35ac63d34db2a64736eb998f4e43b2cdbcd2b79aa63207d", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-modules_30-9f519b4.json0000664000175000017500000000075015174404631023353 0ustar alastairalastair{ "basename": "asr-modules_30-9f519b4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_30.f90", "infile_hash": "67f0b94d2f606b63e519e78e67c92749de98b41c7af3df2d959e9df6", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_30-9f519b4.stdout", "stdout_hash": "a122e194dbe91fd8400bb704890aa09956c81cc232d26eb1e690fe7c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixedform_nestedloop_implicit-7cd720b.json0000664000175000017500000000102715174404631027557 0ustar alastairalastair{ "basename": "ast-fixedform_nestedloop_implicit-7cd720b", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_nestedloop_implicit.f", "infile_hash": "5d7a5783286aa1c1fea858b0adca8da970b6e65cbb756e056792ca02", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_nestedloop_implicit-7cd720b.stdout", "stdout_hash": "8cde7a95e3239322c22dbcb3ff489e30a0369aa3e91dfeaa9f162898", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-derived_types_03-3580222.json0000664000175000017500000000074515174404631024401 0ustar alastairalastair{ "basename": "ast-derived_types_03-3580222", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/derived_types_03.f90", "infile_hash": "0367caa646d88d9d311f2157b87aa8d37c7c09500fea94cc3adacbe3", "outfile": null, "outfile_hash": null, "stdout": "ast-derived_types_03-3580222.stdout", "stdout_hash": "ab37b4ff1e004fad6ff7076b8d170d77dca7854f74fd23eba69bed18", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-interface3-6416a61.json0000664000175000017500000000072315174404631023333 0ustar alastairalastair{ "basename": "ast-interface3-6416a61", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/interface3.f90", "infile_hash": "9c989830fc31137b020ceb346dcbee1b2c6d5da1795c1eebfb9ce039", "outfile": null, "outfile_hash": null, "stdout": "ast-interface3-6416a61.stdout", "stdout_hash": "fab9199efee44cc0cd905080c9f249113e50fad833b8d6ab521055a2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-character_02-56bfff3.json0000664000175000017500000000106515174404631023774 0ustar alastairalastair{ "basename": "asr-character_02-56bfff3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/warnings/character_02.f90", "infile_hash": "8b839a8298fb3bcdf423c536b31f178985f93f1b62740bd3bb83aa8a", "outfile": null, "outfile_hash": null, "stdout": "asr-character_02-56bfff3.stdout", "stdout_hash": "8b3f8c08ed91b1c64ec151e3504271c37310c939d33c9a52a7313581", "stderr": "asr-character_02-56bfff3.stderr", "stderr_hash": "b0d10fe88df62b1beb62226a5ac184ff6ef81b681425a016d9ee014f", "returncode": 0 }lfortran-0.63.0/tests/reference/ast-template_nested-35ad81a.stdout0000664000175000017500000003021315174404631025171 0ustar alastairalastair(TranslationUnit [(Module template_nested_m (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(add_t [] [] () () None ()) (test_template [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Requirement R [T F] [(DerivedType T [] () [(SimpleAttribute AttrDeferred )] [] [] )] [(Function F [(x) (y)] [] z () () [] [] [] [(Declaration (AttrType TypeType [] () T None ) [(AttrIntent In )] [(x [] [] () () None ()) (y [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () T None ) [] [(z [] [] () () None ())] () )] [] [] [] )] ) (Template add_t [T F] [(Require [(UnitRequire R [(AttrNamelist T ) (AttrNamelist F )] )] ) (Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(add_generic [] [] () () None ())] () )] [(Function add_generic [(x) (y)] [] z () () [] [] [] [(Declaration (AttrType TypeType [] () T None ) [(AttrIntent In )] [(x [] [] () () None ()) (y [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () T None ) [] [(z [] [] () () None ())] () )] [(Assignment 0 z (FuncCallOrArray F [] [(() x () 0) (() y () 0)] [] [] [] ) () )] [] [] ) (Function call_add_generic [(x) (y)] [] z () () [] [] [] [(Declaration (AttrType TypeType [] () T None ) [(AttrIntent In )] [(x [] [] () () None ()) (y [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () T None ) [] [(z [] [] () () None ())] () )] [(Assignment 0 z (FuncCallOrArray add_generic [] [(() x () 0) (() y () 0)] [] [] [] ) () )] [] [] )] )] [] [(Function func_arg_real [(x) (y)] [(AttrType TypeReal [] () () None )] z () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(x [] [] () () None ()) (y [] [] () () None ())] () )] [(Assignment 0 z (+ x y) () )] [] [] ) (Subroutine test_template [] [] () () [] [] [] [(Instantiate add_t [(AttrType TypeReal [] () () None ) (AttrNamelist func_arg_real )] [(UseSymbol call_add_generic add_real )] ) (Declaration (AttrType TypeReal [] () () None ) [] [(x [] [] () () None ()) (y [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ()) (b [] [] () () None ())] () )] [(Assignment 0 x (Real "5.1") () ) (Assignment 0 y (Real "7.2") () ) (Print 0 () [(String "The result is " ()) (FuncCallOrArray add_real [] [(() x () 0) (() y () 0)] [] [] [] )] () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- (FuncCallOrArray add_real [] [(() x () 0) (() y () 0)] [] [] [] ) (Real "12.3")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () )] [] [] )] ) (Program template_nested () [(Use [] template_nested_m [] .false. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(SubroutineCall 0 test_template [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/ast-program_without_line_01-96f2648.stderr0000664000175000017500000000026515174404631026424 0ustar alastairalastairsyntax error: Expected program end --> tests/errors/program_without_line_01.f90:1:1 - 2:8 | 1 | print *, "OK" | ^^^^^^^^^^^^^... ... | 2 | contains | ...^^^^^^^^ lfortran-0.63.0/tests/reference/ast_f90-if1-6dc9fe3.stdout0000664000175000017500000000040415174404631023245 0ustar alastairalastairprogram if1 integer :: i i = 5 if (i == 5) then print *, "correct" end if if (i == 6) then print *, "incorrect" end if i = -2 40 i = i + 1 if (i) 50, 60, 70 50 print *, "i < 0" go to 40 60 print *, "i == 0" go to 40 70 print *, "i > 0" end program if1 lfortran-0.63.0/tests/reference/asr-openmp_36-256dd0e.json0000664000175000017500000000074515174404631023261 0ustar alastairalastair{ "basename": "asr-openmp_36-256dd0e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_36.f90", "infile_hash": "f48dc6ec6f143a79f095e90fb2647aa59956956c87447239da79a2d2", "outfile": null, "outfile_hash": null, "stdout": "asr-openmp_36-256dd0e.stdout", "stdout_hash": "d8743b47519cf70b10263ceb5071108b7fcbf798abf73a8abccd40ab", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-block_02-82f9e5f.stdout0000664000175000017500000000512715174404631023437 0ustar alastairalastair(TranslationUnit [(Program Block_02 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(A [] [] () () None ())] () )] [(Assignment 0 A 10 () ) (Block 1 loop [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(B [] [] () () None ())] () )] [(Assignment 0 A (+ A 5) () ) (If 0 () (== A 15) [(GoTo 0 () 1 [] () )] [] () () () ) (Assignment 0 B (/ A 2) () ) (SubroutineCall 0 Square [] [(() B () 0)] [] [] () )] () () )] [] ) (Subroutine Square [(B)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(B [] [] () () None ()) (Result [] [] () () None ())] () )] [(Assignment 0 Result (* B B) () ) (Print 0 () [Result] () )] [] [] )] ) lfortran-0.63.0/tests/reference/ast-interface1-1906de3.json0000664000175000017500000000072315174404631023414 0ustar alastairalastair{ "basename": "ast-interface1-1906de3", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/interface1.f90", "infile_hash": "de0a5bbd21c52cab270f135c27423c8570be3157fb3657b170136708", "outfile": null, "outfile_hash": null, "stdout": "ast-interface1-1906de3.stdout", "stdout_hash": "ba1400ae14c77b1c774d8a9e69ff52e8df653762105c8c458239cb0b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-return_02-99fb0b3.stdout0000664000175000017500000002554415174404631024042 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [9 x i8] c"calling b" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([9 x i8], [9 x i8]* @string_const_data, i32 0, i32 0), i64 9 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @__module_many_returns_b(i32* %a) { .entry: %b = alloca i32, align 4 %e = alloca i32, align 4 %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %0, i32 9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %1 = call i32 @b.__module_many_returns_d(i32* %a) store i32 %1, i32* %b, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return %2 = load i32, i32* %b, align 4 ret i32 %2 } define i32 @b.__module_many_returns_d(i32* %i) { .entry: %d = alloca i32, align 4 %0 = load i32, i32* %i, align 4 %1 = icmp eq i32 %0, 1 br i1 %1, label %then, label %else then: ; preds = %.entry store i32 1, i32* %d, align 4 br label %return unreachable_after_return: ; No predecessors! br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %unreachable_after_return %2 = load i32, i32* %i, align 4 %3 = icmp eq i32 %2, 2 br i1 %3, label %then1, label %else3 then1: ; preds = %ifcont store i32 2, i32* %d, align 4 br label %return unreachable_after_return2: ; No predecessors! br label %ifcont4 else3: ; preds = %ifcont br label %ifcont4 ifcont4: ; preds = %else3, %unreachable_after_return2 %4 = load i32, i32* %i, align 4 %5 = icmp eq i32 %4, 3 br i1 %5, label %then5, label %else7 then5: ; preds = %ifcont4 store i32 3, i32* %d, align 4 br label %return unreachable_after_return6: ; No predecessors! br label %ifcont8 else7: ; preds = %ifcont4 br label %ifcont8 ifcont8: ; preds = %else7, %unreachable_after_return6 store i32 999, i32* %d, align 4 br label %return return: ; preds = %ifcont8, %then5, %then1, %then br label %FINALIZE_SYMTABLE_d FINALIZE_SYMTABLE_d: ; preds = %return %6 = load i32, i32* %d, align 4 ret i32 %6 } declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc7 = alloca %string_descriptor, align 8 %stringFormat_desc4 = alloca %string_descriptor, align 8 %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() %call_arg_value = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %c = alloca i32, align 4 store i32 1, i32* %call_arg_value, align 4 %3 = call i32 @__module_many_returns_b(i32* %call_arg_value) store i32 %3, i32* %c, align 4 %4 = alloca i64, align 8 %5 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %4, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %c) %6 = load i64, i64* %4, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %5, i8** %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %6, i64* %8, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %10 = load i8*, i8** %9, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %12 = load i64, i64* %11, align 8 %13 = trunc i64 %12 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %10, i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %14 = icmp eq i8* %5, null br i1 %14, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %5) br label %free_done free_done: ; preds = %free_nonnull, %.entry store i32 2, i32* %call_arg_value, align 4 %15 = call i32 @__module_many_returns_b(i32* %call_arg_value) store i32 %15, i32* %c, align 4 %16 = alloca i64, align 8 %17 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %16, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %c) %18 = load i64, i64* %16, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %17, i8** %19, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %18, i64* %20, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %22 = load i8*, i8** %21, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %24 = load i64, i64* %23, align 8 %25 = trunc i64 %24 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %22, i32 %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %26 = icmp eq i8* %17, null br i1 %26, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %2, i8* %17) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done store i32 3, i32* %call_arg_value, align 4 %27 = call i32 @__module_many_returns_b(i32* %call_arg_value) store i32 %27, i32* %c, align 4 %28 = alloca i64, align 8 %29 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %28, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %c) %30 = load i64, i64* %28, align 8 %31 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %29, i8** %31, align 8 %32 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %30, i64* %32, align 8 %33 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %34 = load i8*, i8** %33, align 8 %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %36 = load i64, i64* %35, align 8 %37 = trunc i64 %36 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %34, i32 %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %38 = icmp eq i8* %29, null br i1 %38, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free_alloc(i8* %2, i8* %29) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 store i32 4, i32* %call_arg_value, align 4 %39 = call i32 @__module_many_returns_b(i32* %call_arg_value) store i32 %39, i32* %c, align 4 %40 = alloca i64, align 8 %41 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.3, i32 0, i32 0), i64* %40, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %c) %42 = load i64, i64* %40, align 8 %43 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 store i8* %41, i8** %43, align 8 %44 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 store i64 %42, i64* %44, align 8 %45 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 %46 = load i8*, i8** %45, align 8 %47 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 %48 = load i64, i64* %47, align 8 %49 = trunc i64 %48 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %46, i32 %49, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %50 = icmp eq i8* %41, null br i1 %50, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %free_done6 call void @_lfortran_free_alloc(i8* %2, i8* %41) br label %free_done9 free_done9: ; preds = %free_nonnull8, %free_done6 br label %return return: ; preds = %free_done9 br label %FINALIZE_SYMTABLE_returns FINALIZE_SYMTABLE_returns: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/llvm-arrays_01_complex-c90dbdd.json0000664000175000017500000000100015174404631025311 0ustar alastairalastair{ "basename": "llvm-arrays_01_complex-c90dbdd", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01_complex.f90", "infile_hash": "2f81875039547fcf7eaa3375e4f99fbc8ef6d91ac2bb214c88cff999", "outfile": null, "outfile_hash": null, "stdout": "llvm-arrays_01_complex-c90dbdd.stdout", "stdout_hash": "9169292ca46bfc786582326f122bdb1981b78b5577c45e1d2760d09a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-subroutine3-9c6f5d1.stderr0000664000175000017500000000022115174404631024264 0ustar alastairalastairsemantic error: Argument of 'size' must be an array --> tests/errors/subroutine3.f90:5:19 | 5 | print *, size(f) | ^ lfortran-0.63.0/tests/reference/asr-string_11-0e4b62c.json0000664000175000017500000000074515174404631023256 0ustar alastairalastair{ "basename": "asr-string_11-0e4b62c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_11.f90", "infile_hash": "eb36fd203a74190c7d98eeff5e136b53c72959fe49b4fed6558763d3", "outfile": null, "outfile_hash": null, "stdout": "asr-string_11-0e4b62c.stdout", "stdout_hash": "2649d1cd24c75ec634e04d9458900ca1c714035aaebb2c89d27a3d5e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-types_02-7a95ae7.stdout0000664000175000017500000000665315174404631023506 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { types_02: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 2 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) types_02 [] [(Assignment (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 r) (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 r) (Cast (Var 2 i) IntegerToReal (Real 4) () () ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-complex_mul_test-5a74811.stdout0000664000175000017500000001652015174404631025433 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> %complex_4 = type <{ float, float }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc4 = alloca %string_descriptor, align 8 %stringFormat_desc1 = alloca %string_descriptor, align 8 %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca %complex_4, align 8 store %complex_4 <{ float 3.000000e+00, float 4.000000e+00 }>, %complex_4* %x, align 1 %3 = load %complex_4, %complex_4* %x, align 1 %4 = extractvalue %complex_4 %3, 0 %5 = extractvalue %complex_4 %3, 1 %6 = fmul float %4, 4.000000e+00 %7 = fmul float %5, 0.000000e+00 %8 = fmul float %4, 0.000000e+00 %9 = fmul float %5, 4.000000e+00 %10 = fsub float %6, %7 %11 = fadd float %8, %9 %12 = insertvalue %complex_4 undef, float %10, 0 %13 = insertvalue %complex_4 %12, float %11, 1 store %complex_4 %13, %complex_4* %x, align 1 %14 = alloca i64, align 8 %15 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info, i32 0, i32 0), i64* %14, i32 0, i32 0, i32 0, i32 0, i32 0, %complex_4* %x) %16 = load i64, i64* %14, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %15, i8** %17, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %16, i64* %18, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %20 = load i8*, i8** %19, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %22 = load i64, i64* %21, align 8 %23 = trunc i64 %22 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %20, i32 %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %24 = icmp eq i8* %15, null br i1 %24, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %15) br label %free_done free_done: ; preds = %free_nonnull, %.entry %25 = load %complex_4, %complex_4* %x, align 1 %26 = extractvalue %complex_4 %25, 0 %27 = extractvalue %complex_4 %25, 1 %28 = fmul float 2.000000e+00, %26 %29 = fmul float 0.000000e+00, %27 %30 = fmul float 2.000000e+00, %27 %31 = fmul float 0.000000e+00, %26 %32 = fsub float %28, %29 %33 = fadd float %30, %31 %34 = insertvalue %complex_4 undef, float %32, 0 %35 = insertvalue %complex_4 %34, float %33, 1 store %complex_4 %35, %complex_4* %x, align 1 %36 = alloca i64, align 8 %37 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.1, i32 0, i32 0), i64* %36, i32 0, i32 0, i32 0, i32 0, i32 0, %complex_4* %x) %38 = load i64, i64* %36, align 8 %39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %37, i8** %39, align 8 %40 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %38, i64* %40, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %42 = load i8*, i8** %41, align 8 %43 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %44 = load i64, i64* %43, align 8 %45 = trunc i64 %44 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %42, i32 %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %46 = icmp eq i8* %37, null br i1 %46, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free_alloc(i8* %2, i8* %37) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %47 = load %complex_4, %complex_4* %x, align 1 %48 = extractvalue %complex_4 %47, 0 %49 = extractvalue %complex_4 %47, 1 %50 = fmul float %48, 0.000000e+00 %51 = fmul float %49, 3.000000e+00 %52 = fmul float %48, 3.000000e+00 %53 = fmul float %49, 0.000000e+00 %54 = fsub float %50, %51 %55 = fadd float %52, %53 %56 = insertvalue %complex_4 undef, float %54, 0 %57 = insertvalue %complex_4 %56, float %55, 1 store %complex_4 %57, %complex_4* %x, align 1 %58 = alloca i64, align 8 %59 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.2, i32 0, i32 0), i64* %58, i32 0, i32 0, i32 0, i32 0, i32 0, %complex_4* %x) %60 = load i64, i64* %58, align 8 %61 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %59, i8** %61, align 8 %62 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %60, i64* %62, align 8 %63 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %64 = load i8*, i8** %63, align 8 %65 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %66 = load i64, i64* %65, align 8 %67 = trunc i64 %66 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %64, i32 %67, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %68 = icmp eq i8* %59, null br i1 %68, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free_alloc(i8* %2, i8* %59) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 br label %return return: ; preds = %free_done6 br label %FINALIZE_SYMTABLE_complex2 FINALIZE_SYMTABLE_complex2: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-implicit12-025d795.json0000664000175000017500000000072315174404631023272 0ustar alastairalastair{ "basename": "asr-implicit12-025d795", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/implicit12.f90", "infile_hash": "b15934ce985f385fa987bbc85a37c711ad9f42818a7c50f8deeec4fc", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit12-025d795.stderr", "stderr_hash": "d96c32c29baa2b317c2b6f3cc6e6f5078f33a1f353146bb8bef2ca9e", "returncode": 2 }lfortran-0.63.0/tests/reference/ast_f90-case_01-dcc012a.json0000664000175000017500000000075215174404631023410 0ustar alastairalastair{ "basename": "ast_f90-case_01-dcc012a", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/case_01.f90", "infile_hash": "003a23367180e7f228e7e4ef5a6dfdb6749801b29ccf2002e2559e41", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-case_01-dcc012a.stdout", "stdout_hash": "5d1a88408262f9ce060b4a02827cd3b0ebdce3bb954de1839d2bce89", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-doconcurrentloop_02-2418c04.stdout0000664000175000017500000000063015174404631026231 0ustar alastairalastairprogram doconcurrentloop_02 implicit none real, dimension(10) :: a real :: sum integer :: N, i N = size(a) sum = 0 do concurrent (i = 1:N) a(i) = a(i - 1) + 5 end do call arraySum(a, sum) contains subroutine arraySum(a, sum) real, intent(in) :: a(:) real, intent(out) :: sum do concurrent (i = 1:N) reduce(+: s) sum = sum + a(i) end do end subroutine arraySum end program doconcurrentloop_02 lfortran-0.63.0/tests/reference/pass_insert_deallocate-finalize_01-3efebdd.stdout0000664000175000017500000005400515174404631030270 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { finalize_01: (Program (SymbolTable 5 { arr: (Variable 5 arr [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), internal_sub: (Function (SymbolTable 6 { arr_real: (Variable 6 arr_real [] Local () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), bl: (Block (SymbolTable 7 { arr_in_block: (Variable 7 arr_in_block [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) bl [(Exit bl ) (Return)] ), str: (Variable 6 str [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) internal_sub (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(BlockCall -1 6 bl ) (WhileLoop () (LogicalConstant .true. (Logical 4) ) [(Return)] [] )] () Public .true. .true. () ), ss: (ExternalSymbol 5 ss 2 ss finalize_01_mod [] ss Public ), str: (Variable 5 str [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), test_01: (ExternalSymbol 5 test_01 2 test_01 finalize_01_mod [] test_01 Public ) }) finalize_01 [finalize_01_mod] [(Allocate [((Var 5 str) [] (IntegerConstant 10 (Integer 4) Decimal) () (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString))] () () () ) (SubroutineCall 5 ss () [] () .false. ) (SubroutineCall 5 internal_sub () [] () .false. ) (Return)] ), finalize_01_mod: (Module (SymbolTable 2 { ss: (Function (SymbolTable 4 { arr: (Variable 4 arr [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ss (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Allocate [((Var 4 arr) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] () () ())] () () () ) (If () (LogicalConstant .true. (Logical 4) ) [(Return)] [(Return)] )] () Public .true. .true. () ), test_01: (Function (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), str: (Variable 3 str [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_01 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Allocate [((Var 3 str) [] (IntegerConstant 10 (Integer 4) Decimal) () (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString))] () () () ) (Return) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(Return)] [] )] () Public .true. .true. () ) }) finalize_01_mod () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr_disable_warnings-save4-99c3220.stdout0000664000175000017500000001303415174404631026276 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { save4: (Program (SymbolTable 2 { f: (Function (SymbolTable 3 { x: (Variable 3 x [] Local (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(If () (IntegerCompare (Var 3 x) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Print (StringConstant "x is 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] () Public .false. .false. () ), y: (Variable 2 y [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) save4 [] [(If () (IntegerCompare (Var 2 y) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Print (StringConstant "y is 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_error_01a-13d8554.json0000664000175000017500000000076215174404631025003 0ustar alastairalastair{ "basename": "asr-template_error_01a-13d8554", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_01a.f90", "infile_hash": "eb62f3418f54acc1174eb48b2fc68021207b031559d22e799d553b84", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_01a-13d8554.stderr", "stderr_hash": "dd98a1db76604d0f2c418b95c03b2f25d08af7e0be2bda152b5f494f", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-format2-ed47ddb.json0000664000175000017500000000071515174404631023353 0ustar alastairalastair{ "basename": "llvm-format2-ed47ddb", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/format2.f90", "infile_hash": "24f2535488697afb5dd3d24d9f313087fe8386df6028895aea8bed12", "outfile": null, "outfile_hash": null, "stdout": "llvm-format2-ed47ddb.stdout", "stdout_hash": "f6d0cffc76f3c1ba18ebda3cbfc5e81804c95a26ec1c63b3e5fba250", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-write_02-795afbb.json0000664000175000017500000000067415174404631023214 0ustar alastairalastair{ "basename": "run-write_02-795afbb", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/write_02.f90", "infile_hash": "7c59eecee1e7e7127571ea73b91b4e0e10077295f6dbb75f94aef687", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-write_02-795afbb.stderr", "stderr_hash": "b65bc0d80ed3f38265702bfd48f891f579ea1c8ec54cef7c4f9f59ed", "returncode": 1 }lfortran-0.63.0/tests/reference/run-derived_type_06-2623a81.json0000664000175000017500000000072115174404631024311 0ustar alastairalastair{ "basename": "run-derived_type_06-2623a81", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/derived_type_06.f90", "infile_hash": "002cfbfb5901ee3c9f0d5e33285543863528f17c4b8096e1a0e49134", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-derived_type_06-2623a81.stderr", "stderr_hash": "ff1b27fa36db7d6c70413cdaa96430864bfe071a1a93dfa74637034d", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-subroutine3b-4883d18.json0000664000175000017500000000073115174404631023744 0ustar alastairalastair{ "basename": "asr-subroutine3b-4883d18", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/subroutine3b.f90", "infile_hash": "0726b3cb8b3ba1a2fc624a4215146065a6ce9a6a0b460ebe40c172a5", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutine3b-4883d18.stdout", "stdout_hash": "b0fe23a13baa970421ca11c6a248d61cd0ee58fbd03f6b005ed87e69", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-expr_09-838f740.stdout0000664000175000017500000000057415174404631023503 0ustar alastairalastairfunction main() local x4::Int32 local x8::Int64 local y4::Int32 local y8::Int64 y4 = 5 x4 = y4 ^ 2 println(y4, " ", x4) if x4 ≠ 25 println(Base.stderr, "ERROR STOP") exit(1) end y8 = 5 x8 = y8 ^ 2 println(y8, " ", x8) if x8 ≠ 25 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-0.63.0/tests/reference/julia-subroutine3b-7e4c8ab.stdout0000664000175000017500000000031415174404631025043 0ustar alastairalastairfunction f()::Int32 local f::Int32 f = 42 return f end function g()::Int32 local g::Int32 g = 42 return g end function h()::Int32 local h::Int32 h = 42 return h end lfortran-0.63.0/tests/reference/llvm-arrays_01_logical-f19a63d.stdout0000664000175000017500000045034015174404631025510 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." @0 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @1 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @2 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @3 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @5 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @6 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @7 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @9 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @10 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @11 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @13 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @14 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @15 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @17 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @19 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @20 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @21 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @23 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @25 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @26 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @27 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @28 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @29 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @31 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @32 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @33 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @34 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @35 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @36 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @37 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @39 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @40 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @41 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @43 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @44 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @45 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @46 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @47 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @48 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @49 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @50 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @51 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @52 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @53 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @54 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @55 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @56 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @57 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @58 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @59 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @60 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @61 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @62 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @63 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @64 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @65 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @66 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @67 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @68 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @69 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @70 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @71 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @72 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @73 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @74 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @75 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @76 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @77 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @78 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @79 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @80 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @81 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @82 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @83 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @84 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @85 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @86 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @87 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @88 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @89 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @90 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @91 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @92 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @93 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @94 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @95 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @96 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @97 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @98 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @99 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @100 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @101 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @102 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @103 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @104 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @105 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @106 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @107 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @108 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @109 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @110 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @111 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @112 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @113 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @114 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @115 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @116 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @117 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @118 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @119 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @120 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @121 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @122 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @123 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @124 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @125 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @126 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @127 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @128 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @129 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @130 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @131 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @132 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @133 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @134 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @135 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @136 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @137 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @138 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @139 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @140 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @141 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @142 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @143 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @144 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @145 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @146 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @147 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @148 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @149 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @150 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @151 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @152 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @153 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @154 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @155 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @156 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @157 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @158 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @159 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @160 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @161 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @162 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @163 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @164 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @165 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @166 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @167 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @168 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @169 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @170 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @171 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @172 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @173 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @174 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @175 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @176 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @177 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @178 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @179 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @180 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @181 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @182 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @183 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_logical.f90\00", align 1 @184 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @185 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @186 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @187 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca [3 x i32], align 4 %b = alloca [4 x i32], align 4 %c = alloca [4 x i32], align 4 %i = alloca i32, align 4 %j = alloca i32, align 4 br i1 false, label %then, label %ifcont then: ; preds = %.entry %3 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %4 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %5 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %4, i32 0, i32 0 %6 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %5, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @1, i32 0, i32 0), i8** %6, align 8 %7 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %5, i32 0, i32 1 store i32 6, i32* %7, align 4 %8 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %5, i32 0, i32 2 store i32 1, i32* %8, align 4 %9 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %5, i32 0, i32 3 store i32 6, i32* %9, align 4 %10 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %5, i32 0, i32 4 store i32 4, i32* %10, align 4 %11 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @2, i32 0, i32 0)) %12 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %3, i32 0, i32 0 %13 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %4, i32 0, i32 0 %14 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %12, i32 0, i32 2 %15 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %12, i32 0, i32 0 store i1 true, i1* %15, align 1 %16 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %12, i32 0, i32 1 store i8* %11, i8** %16, align 8 store { i8*, i32, i32, i32, i32 }* %13, { i8*, i32, i32, i32, i32 }** %14, align 8 %17 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %12, i32 0, i32 3 store i32 1, i32* %17, align 4 %18 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %3, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %18, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i64 1, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont: ; preds = %.entry %19 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 0 store i32 1, i32* %19, align 4 store i32 1, i32* %i, align 4 br label %loop.head loop.head: ; preds = %ifcont4, %ifcont %20 = load i32, i32* %i, align 4 %21 = add i32 %20, 1 %22 = icmp sle i32 %21, 3 br i1 %22, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %23 = load i32, i32* %i, align 4 %24 = add i32 %23, 1 store i32 %24, i32* %i, align 4 %25 = load i32, i32* %i, align 4 %26 = sext i32 %25 to i64 %27 = sub i64 %26, 1 %28 = mul i64 1, %27 %29 = add i64 0, %28 %30 = icmp slt i64 %26, 1 %31 = icmp sgt i64 %26, 3 %32 = or i1 %30, %31 br i1 %32, label %then1, label %ifcont2 then1: ; preds = %loop.body %33 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %34 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %35 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %34, i32 0, i32 0 %36 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %35, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @5, i32 0, i32 0), i8** %36, align 8 %37 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %35, i32 0, i32 1 store i32 8, i32* %37, align 4 %38 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %35, i32 0, i32 2 store i32 5, i32* %38, align 4 %39 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %35, i32 0, i32 3 store i32 8, i32* %39, align 4 %40 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %35, i32 0, i32 4 store i32 8, i32* %40, align 4 %41 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @6, i32 0, i32 0)) %42 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %33, i32 0, i32 0 %43 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %34, i32 0, i32 0 %44 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %42, i32 0, i32 2 %45 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %42, i32 0, i32 0 store i1 true, i1* %45, align 1 %46 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %42, i32 0, i32 1 store i8* %41, i8** %46, align 8 store { i8*, i32, i32, i32, i32 }* %43, { i8*, i32, i32, i32, i32 }** %44, align 8 %47 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %42, i32 0, i32 3 store i32 1, i32* %47, align 4 %48 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %33, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %48, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i64 %26, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont2: ; preds = %loop.body %49 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 %29 %50 = load i32, i32* %i, align 4 %51 = sub i32 %50, 1 %52 = sext i32 %51 to i64 %53 = sub i64 %52, 1 %54 = mul i64 1, %53 %55 = add i64 0, %54 %56 = icmp slt i64 %52, 1 %57 = icmp sgt i64 %52, 3 %58 = or i1 %56, %57 br i1 %58, label %then3, label %ifcont4 then3: ; preds = %ifcont2 %59 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %60 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %61 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %60, i32 0, i32 0 %62 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %61, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @9, i32 0, i32 0), i8** %62, align 8 %63 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %61, i32 0, i32 1 store i32 8, i32* %63, align 4 %64 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %61, i32 0, i32 2 store i32 18, i32* %64, align 4 %65 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %61, i32 0, i32 3 store i32 8, i32* %65, align 4 %66 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %61, i32 0, i32 4 store i32 25, i32* %66, align 4 %67 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @10, i32 0, i32 0)) %68 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %59, i32 0, i32 0 %69 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %60, i32 0, i32 0 %70 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %68, i32 0, i32 2 %71 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %68, i32 0, i32 0 store i1 true, i1* %71, align 1 %72 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %68, i32 0, i32 1 store i8* %67, i8** %72, align 8 store { i8*, i32, i32, i32, i32 }* %69, { i8*, i32, i32, i32, i32 }** %70, align 8 %73 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %68, i32 0, i32 3 store i32 1, i32* %73, align 4 %74 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %59, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %74, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i64 %52, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont4: ; preds = %ifcont2 %75 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 %55 %76 = load i32, i32* %75, align 4 %77 = xor i32 %76, 1 store i32 %77, i32* %49, align 4 br label %loop.head loop.end: ; preds = %loop.head br i1 false, label %then5, label %ifcont6 then5: ; preds = %loop.end %78 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %79 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %80 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %79, i32 0, i32 0 %81 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %80, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @13, i32 0, i32 0), i8** %81, align 8 %82 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %80, i32 0, i32 1 store i32 10, i32* %82, align 4 %83 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %80, i32 0, i32 2 store i32 11, i32* %83, align 4 %84 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %80, i32 0, i32 3 store i32 10, i32* %84, align 4 %85 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %80, i32 0, i32 4 store i32 14, i32* %85, align 4 %86 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @14, i32 0, i32 0)) %87 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %78, i32 0, i32 0 %88 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %79, i32 0, i32 0 %89 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %87, i32 0, i32 2 %90 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %87, i32 0, i32 0 store i1 true, i1* %90, align 1 %91 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %87, i32 0, i32 1 store i8* %86, i8** %91, align 8 store { i8*, i32, i32, i32, i32 }* %88, { i8*, i32, i32, i32, i32 }** %89, align 8 %92 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %87, i32 0, i32 3 store i32 1, i32* %92, align 4 %93 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %78, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %93, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i64 1, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont6: ; preds = %loop.end %94 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 0 %95 = load i32, i32* %94, align 4 %96 = xor i32 %95, 1 %97 = icmp ne i32 %96, 0 br i1 %97, label %then7, label %else then7: ; preds = %ifcont6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont8 else: ; preds = %ifcont6 br label %ifcont8 ifcont8: ; preds = %else, %then7 br i1 false, label %then9, label %ifcont10 then9: ; preds = %ifcont8 %98 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %99 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %100 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %99, i32 0, i32 0 %101 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %100, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @19, i32 0, i32 0), i8** %101, align 8 %102 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %100, i32 0, i32 1 store i32 11, i32* %102, align 4 %103 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %100, i32 0, i32 2 store i32 5, i32* %103, align 4 %104 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %100, i32 0, i32 3 store i32 11, i32* %104, align 4 %105 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %100, i32 0, i32 4 store i32 8, i32* %105, align 4 %106 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @20, i32 0, i32 0)) %107 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %98, i32 0, i32 0 %108 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %99, i32 0, i32 0 %109 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %107, i32 0, i32 2 %110 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %107, i32 0, i32 0 store i1 true, i1* %110, align 1 %111 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %107, i32 0, i32 1 store i8* %106, i8** %111, align 8 store { i8*, i32, i32, i32, i32 }* %108, { i8*, i32, i32, i32, i32 }** %109, align 8 %112 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %107, i32 0, i32 3 store i32 1, i32* %112, align 4 %113 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %98, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %113, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0), i64 2, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont10: ; preds = %ifcont8 %114 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 1 %115 = load i32, i32* %114, align 4 %116 = icmp ne i32 %115, 0 br i1 %116, label %then11, label %else12 then11: ; preds = %ifcont10 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @23, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont13 else12: ; preds = %ifcont10 br label %ifcont13 ifcont13: ; preds = %else12, %then11 br i1 false, label %then14, label %ifcont15 then14: ; preds = %ifcont13 %117 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %118 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %119 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %118, i32 0, i32 0 %120 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %119, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @25, i32 0, i32 0), i8** %120, align 8 %121 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %119, i32 0, i32 1 store i32 12, i32* %121, align 4 %122 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %119, i32 0, i32 2 store i32 11, i32* %122, align 4 %123 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %119, i32 0, i32 3 store i32 12, i32* %123, align 4 %124 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %119, i32 0, i32 4 store i32 14, i32* %124, align 4 %125 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @26, i32 0, i32 0)) %126 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %117, i32 0, i32 0 %127 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %118, i32 0, i32 0 %128 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %126, i32 0, i32 2 %129 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %126, i32 0, i32 0 store i1 true, i1* %129, align 1 %130 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %126, i32 0, i32 1 store i8* %125, i8** %130, align 8 store { i8*, i32, i32, i32, i32 }* %127, { i8*, i32, i32, i32, i32 }** %128, align 8 %131 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %126, i32 0, i32 3 store i32 1, i32* %131, align 4 %132 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %117, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %132, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @27, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0), i64 3, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont15: ; preds = %ifcont13 %133 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 2 %134 = load i32, i32* %133, align 4 %135 = xor i32 %134, 1 %136 = icmp ne i32 %135, 0 br i1 %136, label %then16, label %else17 then16: ; preds = %ifcont15 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @29, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @28, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont18 else17: ; preds = %ifcont15 br label %ifcont18 ifcont18: ; preds = %else17, %then16 br i1 false, label %then19, label %ifcont20 then19: ; preds = %ifcont18 %137 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %138 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %139 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %138, i32 0, i32 0 %140 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %139, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @31, i32 0, i32 0), i8** %140, align 8 %141 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %139, i32 0, i32 1 store i32 14, i32* %141, align 4 %142 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %139, i32 0, i32 2 store i32 1, i32* %142, align 4 %143 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %139, i32 0, i32 3 store i32 14, i32* %143, align 4 %144 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %139, i32 0, i32 4 store i32 4, i32* %144, align 4 %145 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @32, i32 0, i32 0)) %146 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %137, i32 0, i32 0 %147 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %138, i32 0, i32 0 %148 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %146, i32 0, i32 2 %149 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %146, i32 0, i32 0 store i1 true, i1* %149, align 1 %150 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %146, i32 0, i32 1 store i8* %145, i8** %150, align 8 store { i8*, i32, i32, i32, i32 }* %147, { i8*, i32, i32, i32, i32 }** %148, align 8 %151 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %146, i32 0, i32 3 store i32 1, i32* %151, align 4 %152 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %137, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %152, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @33, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0), i64 1, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont20: ; preds = %ifcont18 %153 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 0 store i32 0, i32* %153, align 4 store i32 11, i32* %i, align 4 br label %loop.head21 loop.head21: ; preds = %ifcont26, %ifcont20 %154 = load i32, i32* %i, align 4 %155 = add i32 %154, 1 %156 = icmp sle i32 %155, 14 br i1 %156, label %loop.body22, label %loop.end27 loop.body22: ; preds = %loop.head21 %157 = load i32, i32* %i, align 4 %158 = add i32 %157, 1 store i32 %158, i32* %i, align 4 %159 = load i32, i32* %i, align 4 %160 = sub i32 %159, 10 %161 = sext i32 %160 to i64 %162 = sub i64 %161, 1 %163 = mul i64 1, %162 %164 = add i64 0, %163 %165 = icmp slt i64 %161, 1 %166 = icmp sgt i64 %161, 4 %167 = or i1 %165, %166 br i1 %167, label %then23, label %ifcont24 then23: ; preds = %loop.body22 %168 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %169 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %170 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %169, i32 0, i32 0 %171 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %170, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @35, i32 0, i32 0), i8** %171, align 8 %172 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %170, i32 0, i32 1 store i32 16, i32* %172, align 4 %173 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %170, i32 0, i32 2 store i32 5, i32* %173, align 4 %174 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %170, i32 0, i32 3 store i32 16, i32* %174, align 4 %175 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %170, i32 0, i32 4 store i32 11, i32* %175, align 4 %176 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @36, i32 0, i32 0)) %177 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %168, i32 0, i32 0 %178 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %169, i32 0, i32 0 %179 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %177, i32 0, i32 2 %180 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %177, i32 0, i32 0 store i1 true, i1* %180, align 1 %181 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %177, i32 0, i32 1 store i8* %176, i8** %181, align 8 store { i8*, i32, i32, i32, i32 }* %178, { i8*, i32, i32, i32, i32 }** %179, align 8 %182 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %177, i32 0, i32 3 store i32 1, i32* %182, align 4 %183 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %168, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %183, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @37, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @34, i32 0, i32 0), i64 %161, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont24: ; preds = %loop.body22 %184 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 %164 %185 = load i32, i32* %i, align 4 %186 = sub i32 %185, 10 %187 = sub i32 %186, 1 %188 = sext i32 %187 to i64 %189 = sub i64 %188, 1 %190 = mul i64 1, %189 %191 = add i64 0, %190 %192 = icmp slt i64 %188, 1 %193 = icmp sgt i64 %188, 4 %194 = or i1 %192, %193 br i1 %194, label %then25, label %ifcont26 then25: ; preds = %ifcont24 %195 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %196 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %197 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %196, i32 0, i32 0 %198 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %197, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @39, i32 0, i32 0), i8** %198, align 8 %199 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %197, i32 0, i32 1 store i32 16, i32* %199, align 4 %200 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %197, i32 0, i32 2 store i32 21, i32* %200, align 4 %201 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %197, i32 0, i32 3 store i32 16, i32* %201, align 4 %202 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %197, i32 0, i32 4 store i32 33, i32* %202, align 4 %203 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @40, i32 0, i32 0)) %204 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %195, i32 0, i32 0 %205 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %196, i32 0, i32 0 %206 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %204, i32 0, i32 2 %207 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %204, i32 0, i32 0 store i1 true, i1* %207, align 1 %208 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %204, i32 0, i32 1 store i8* %203, i8** %208, align 8 store { i8*, i32, i32, i32, i32 }* %205, { i8*, i32, i32, i32, i32 }** %206, align 8 %209 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %204, i32 0, i32 3 store i32 1, i32* %209, align 4 %210 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %195, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %210, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0), i64 %188, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont26: ; preds = %ifcont24 %211 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 %191 %212 = load i32, i32* %211, align 4 %213 = xor i32 %212, 1 store i32 %213, i32* %184, align 4 br label %loop.head21 loop.end27: ; preds = %loop.head21 br i1 false, label %then28, label %ifcont29 then28: ; preds = %loop.end27 %214 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %215 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %216 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %215, i32 0, i32 0 %217 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %216, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @43, i32 0, i32 0), i8** %217, align 8 %218 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %216, i32 0, i32 1 store i32 18, i32* %218, align 4 %219 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %216, i32 0, i32 2 store i32 5, i32* %219, align 4 %220 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %216, i32 0, i32 3 store i32 18, i32* %220, align 4 %221 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %216, i32 0, i32 4 store i32 8, i32* %221, align 4 %222 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @44, i32 0, i32 0)) %223 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %214, i32 0, i32 0 %224 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %215, i32 0, i32 0 %225 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %223, i32 0, i32 2 %226 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %223, i32 0, i32 0 store i1 true, i1* %226, align 1 %227 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %223, i32 0, i32 1 store i8* %222, i8** %227, align 8 store { i8*, i32, i32, i32, i32 }* %224, { i8*, i32, i32, i32, i32 }** %225, align 8 %228 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %223, i32 0, i32 3 store i32 1, i32* %228, align 4 %229 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %214, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %229, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @45, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0), i64 1, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont29: ; preds = %loop.end27 %230 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 0 %231 = load i32, i32* %230, align 4 %232 = icmp ne i32 %231, 0 br i1 %232, label %then30, label %else31 then30: ; preds = %ifcont29 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @47, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @46, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont32 else31: ; preds = %ifcont29 br label %ifcont32 ifcont32: ; preds = %else31, %then30 br i1 false, label %then33, label %ifcont34 then33: ; preds = %ifcont32 %233 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %234 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %235 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %234, i32 0, i32 0 %236 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %235, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @49, i32 0, i32 0), i8** %236, align 8 %237 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %235, i32 0, i32 1 store i32 19, i32* %237, align 4 %238 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %235, i32 0, i32 2 store i32 11, i32* %238, align 4 %239 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %235, i32 0, i32 3 store i32 19, i32* %239, align 4 %240 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %235, i32 0, i32 4 store i32 14, i32* %240, align 4 %241 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @50, i32 0, i32 0)) %242 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %233, i32 0, i32 0 %243 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %234, i32 0, i32 0 %244 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %242, i32 0, i32 2 %245 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %242, i32 0, i32 0 store i1 true, i1* %245, align 1 %246 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %242, i32 0, i32 1 store i8* %241, i8** %246, align 8 store { i8*, i32, i32, i32, i32 }* %243, { i8*, i32, i32, i32, i32 }** %244, align 8 %247 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %242, i32 0, i32 3 store i32 1, i32* %247, align 4 %248 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %233, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %248, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @51, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @48, i32 0, i32 0), i64 2, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont34: ; preds = %ifcont32 %249 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 1 %250 = load i32, i32* %249, align 4 %251 = xor i32 %250, 1 %252 = icmp ne i32 %251, 0 br i1 %252, label %then35, label %else36 then35: ; preds = %ifcont34 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @53, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @52, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont37 else36: ; preds = %ifcont34 br label %ifcont37 ifcont37: ; preds = %else36, %then35 br i1 false, label %then38, label %ifcont39 then38: ; preds = %ifcont37 %253 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %254 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %255 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %254, i32 0, i32 0 %256 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %255, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @55, i32 0, i32 0), i8** %256, align 8 %257 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %255, i32 0, i32 1 store i32 20, i32* %257, align 4 %258 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %255, i32 0, i32 2 store i32 5, i32* %258, align 4 %259 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %255, i32 0, i32 3 store i32 20, i32* %259, align 4 %260 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %255, i32 0, i32 4 store i32 8, i32* %260, align 4 %261 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @56, i32 0, i32 0)) %262 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %253, i32 0, i32 0 %263 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %254, i32 0, i32 0 %264 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %262, i32 0, i32 2 %265 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %262, i32 0, i32 0 store i1 true, i1* %265, align 1 %266 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %262, i32 0, i32 1 store i8* %261, i8** %266, align 8 store { i8*, i32, i32, i32, i32 }* %263, { i8*, i32, i32, i32, i32 }** %264, align 8 %267 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %262, i32 0, i32 3 store i32 1, i32* %267, align 4 %268 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %253, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %268, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @57, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @54, i32 0, i32 0), i64 3, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont39: ; preds = %ifcont37 %269 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 2 %270 = load i32, i32* %269, align 4 %271 = icmp ne i32 %270, 0 br i1 %271, label %then40, label %else41 then40: ; preds = %ifcont39 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @59, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @58, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont42 else41: ; preds = %ifcont39 br label %ifcont42 ifcont42: ; preds = %else41, %then40 br i1 false, label %then43, label %ifcont44 then43: ; preds = %ifcont42 %272 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %273 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %274 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %273, i32 0, i32 0 %275 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %274, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @61, i32 0, i32 0), i8** %275, align 8 %276 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %274, i32 0, i32 1 store i32 21, i32* %276, align 4 %277 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %274, i32 0, i32 2 store i32 11, i32* %277, align 4 %278 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %274, i32 0, i32 3 store i32 21, i32* %278, align 4 %279 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %274, i32 0, i32 4 store i32 14, i32* %279, align 4 %280 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @62, i32 0, i32 0)) %281 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %272, i32 0, i32 0 %282 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %273, i32 0, i32 0 %283 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %281, i32 0, i32 2 %284 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %281, i32 0, i32 0 store i1 true, i1* %284, align 1 %285 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %281, i32 0, i32 1 store i8* %280, i8** %285, align 8 store { i8*, i32, i32, i32, i32 }* %282, { i8*, i32, i32, i32, i32 }** %283, align 8 %286 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %281, i32 0, i32 3 store i32 1, i32* %286, align 4 %287 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %272, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %287, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @63, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @60, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont44: ; preds = %ifcont42 %288 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 3 %289 = load i32, i32* %288, align 4 %290 = xor i32 %289, 1 %291 = icmp ne i32 %290, 0 br i1 %291, label %then45, label %else46 then45: ; preds = %ifcont44 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @65, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @64, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont47 else46: ; preds = %ifcont44 br label %ifcont47 ifcont47: ; preds = %else46, %then45 store i32 0, i32* %i, align 4 br label %loop.head48 loop.head48: ; preds = %ifcont53, %ifcont47 %292 = load i32, i32* %i, align 4 %293 = add i32 %292, 1 %294 = icmp sle i32 %293, 3 br i1 %294, label %loop.body49, label %loop.end54 loop.body49: ; preds = %loop.head48 %295 = load i32, i32* %i, align 4 %296 = add i32 %295, 1 store i32 %296, i32* %i, align 4 %297 = load i32, i32* %i, align 4 %298 = sext i32 %297 to i64 %299 = sub i64 %298, 1 %300 = mul i64 1, %299 %301 = add i64 0, %300 %302 = icmp slt i64 %298, 1 %303 = icmp sgt i64 %298, 4 %304 = or i1 %302, %303 br i1 %304, label %then50, label %ifcont51 then50: ; preds = %loop.body49 %305 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %306 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %307 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %306, i32 0, i32 0 %308 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %307, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @67, i32 0, i32 0), i8** %308, align 8 %309 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %307, i32 0, i32 1 store i32 24, i32* %309, align 4 %310 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %307, i32 0, i32 2 store i32 5, i32* %310, align 4 %311 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %307, i32 0, i32 3 store i32 24, i32* %311, align 4 %312 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %307, i32 0, i32 4 store i32 8, i32* %312, align 4 %313 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @68, i32 0, i32 0)) %314 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %305, i32 0, i32 0 %315 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %306, i32 0, i32 0 %316 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %314, i32 0, i32 2 %317 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %314, i32 0, i32 0 store i1 true, i1* %317, align 1 %318 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %314, i32 0, i32 1 store i8* %313, i8** %318, align 8 store { i8*, i32, i32, i32, i32 }* %315, { i8*, i32, i32, i32, i32 }** %316, align 8 %319 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %314, i32 0, i32 3 store i32 1, i32* %319, align 4 %320 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %305, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %320, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @69, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @66, i32 0, i32 0), i64 %298, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont51: ; preds = %loop.body49 %321 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 %301 %322 = load i32, i32* %i, align 4 %323 = sext i32 %322 to i64 %324 = sub i64 %323, 1 %325 = mul i64 1, %324 %326 = add i64 0, %325 %327 = icmp slt i64 %323, 1 %328 = icmp sgt i64 %323, 3 %329 = or i1 %327, %328 br i1 %329, label %then52, label %ifcont53 then52: ; preds = %ifcont51 %330 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %331 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %332 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %331, i32 0, i32 0 %333 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %332, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @71, i32 0, i32 0), i8** %333, align 8 %334 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %332, i32 0, i32 1 store i32 24, i32* %334, align 4 %335 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %332, i32 0, i32 2 store i32 12, i32* %335, align 4 %336 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %332, i32 0, i32 3 store i32 24, i32* %336, align 4 %337 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %332, i32 0, i32 4 store i32 15, i32* %337, align 4 %338 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @72, i32 0, i32 0)) %339 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %330, i32 0, i32 0 %340 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %331, i32 0, i32 0 %341 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %339, i32 0, i32 2 %342 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %339, i32 0, i32 0 store i1 true, i1* %342, align 1 %343 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %339, i32 0, i32 1 store i8* %338, i8** %343, align 8 store { i8*, i32, i32, i32, i32 }* %340, { i8*, i32, i32, i32, i32 }** %341, align 8 %344 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %339, i32 0, i32 3 store i32 1, i32* %344, align 4 %345 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %330, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %345, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @73, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @70, i32 0, i32 0), i64 %323, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont53: ; preds = %ifcont51 %346 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 %326 %347 = load i32, i32* %346, align 4 %348 = and i32 %347, 0 store i32 %348, i32* %321, align 4 br label %loop.head48 loop.end54: ; preds = %loop.head48 br i1 false, label %then55, label %ifcont56 then55: ; preds = %loop.end54 %349 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %350 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %351 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %350, i32 0, i32 0 %352 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %351, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @75, i32 0, i32 0), i8** %352, align 8 %353 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %351, i32 0, i32 1 store i32 26, i32* %353, align 4 %354 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %351, i32 0, i32 2 store i32 5, i32* %354, align 4 %355 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %351, i32 0, i32 3 store i32 26, i32* %355, align 4 %356 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %351, i32 0, i32 4 store i32 8, i32* %356, align 4 %357 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @76, i32 0, i32 0)) %358 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %349, i32 0, i32 0 %359 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %350, i32 0, i32 0 %360 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %358, i32 0, i32 2 %361 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %358, i32 0, i32 0 store i1 true, i1* %361, align 1 %362 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %358, i32 0, i32 1 store i8* %357, i8** %362, align 8 store { i8*, i32, i32, i32, i32 }* %359, { i8*, i32, i32, i32, i32 }** %360, align 8 %363 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %358, i32 0, i32 3 store i32 1, i32* %363, align 4 %364 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %349, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %364, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @77, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @74, i32 0, i32 0), i64 1, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont56: ; preds = %loop.end54 %365 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 0 %366 = load i32, i32* %365, align 4 %367 = icmp ne i32 %366, 0 br i1 %367, label %then57, label %else58 then57: ; preds = %ifcont56 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @79, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @78, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont59 else58: ; preds = %ifcont56 br label %ifcont59 ifcont59: ; preds = %else58, %then57 br i1 false, label %then60, label %ifcont61 then60: ; preds = %ifcont59 %368 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %369 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %370 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %369, i32 0, i32 0 %371 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %370, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @81, i32 0, i32 0), i8** %371, align 8 %372 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %370, i32 0, i32 1 store i32 27, i32* %372, align 4 %373 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %370, i32 0, i32 2 store i32 5, i32* %373, align 4 %374 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %370, i32 0, i32 3 store i32 27, i32* %374, align 4 %375 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %370, i32 0, i32 4 store i32 8, i32* %375, align 4 %376 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @82, i32 0, i32 0)) %377 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %368, i32 0, i32 0 %378 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %369, i32 0, i32 0 %379 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %377, i32 0, i32 2 %380 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %377, i32 0, i32 0 store i1 true, i1* %380, align 1 %381 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %377, i32 0, i32 1 store i8* %376, i8** %381, align 8 store { i8*, i32, i32, i32, i32 }* %378, { i8*, i32, i32, i32, i32 }** %379, align 8 %382 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %377, i32 0, i32 3 store i32 1, i32* %382, align 4 %383 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %368, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %383, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @83, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @80, i32 0, i32 0), i64 2, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont61: ; preds = %ifcont59 %384 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 1 %385 = load i32, i32* %384, align 4 %386 = icmp ne i32 %385, 0 br i1 %386, label %then62, label %else63 then62: ; preds = %ifcont61 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @85, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @84, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont64 else63: ; preds = %ifcont61 br label %ifcont64 ifcont64: ; preds = %else63, %then62 br i1 false, label %then65, label %ifcont66 then65: ; preds = %ifcont64 %387 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %388 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %389 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %388, i32 0, i32 0 %390 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %389, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @87, i32 0, i32 0), i8** %390, align 8 %391 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %389, i32 0, i32 1 store i32 28, i32* %391, align 4 %392 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %389, i32 0, i32 2 store i32 5, i32* %392, align 4 %393 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %389, i32 0, i32 3 store i32 28, i32* %393, align 4 %394 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %389, i32 0, i32 4 store i32 8, i32* %394, align 4 %395 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @88, i32 0, i32 0)) %396 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %387, i32 0, i32 0 %397 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %388, i32 0, i32 0 %398 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %396, i32 0, i32 2 %399 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %396, i32 0, i32 0 store i1 true, i1* %399, align 1 %400 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %396, i32 0, i32 1 store i8* %395, i8** %400, align 8 store { i8*, i32, i32, i32, i32 }* %397, { i8*, i32, i32, i32, i32 }** %398, align 8 %401 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %396, i32 0, i32 3 store i32 1, i32* %401, align 4 %402 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %387, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %402, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @89, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @86, i32 0, i32 0), i64 3, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont66: ; preds = %ifcont64 %403 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 2 %404 = load i32, i32* %403, align 4 %405 = icmp ne i32 %404, 0 br i1 %405, label %then67, label %else68 then67: ; preds = %ifcont66 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @91, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @90, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont69 else68: ; preds = %ifcont66 br label %ifcont69 ifcont69: ; preds = %else68, %then67 br i1 false, label %then70, label %ifcont71 then70: ; preds = %ifcont69 %406 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %407 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %408 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %407, i32 0, i32 0 %409 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %408, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @93, i32 0, i32 0), i8** %409, align 8 %410 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %408, i32 0, i32 1 store i32 30, i32* %410, align 4 %411 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %408, i32 0, i32 2 store i32 1, i32* %411, align 4 %412 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %408, i32 0, i32 3 store i32 30, i32* %412, align 4 %413 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %408, i32 0, i32 4 store i32 4, i32* %413, align 4 %414 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @94, i32 0, i32 0)) %415 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %406, i32 0, i32 0 %416 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %407, i32 0, i32 0 %417 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %415, i32 0, i32 2 %418 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %415, i32 0, i32 0 store i1 true, i1* %418, align 1 %419 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %415, i32 0, i32 1 store i8* %414, i8** %419, align 8 store { i8*, i32, i32, i32, i32 }* %416, { i8*, i32, i32, i32, i32 }** %417, align 8 %420 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %415, i32 0, i32 3 store i32 1, i32* %420, align 4 %421 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %406, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %421, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @95, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @92, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont71: ; preds = %ifcont69 %422 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 3 br i1 false, label %then72, label %ifcont73 then72: ; preds = %ifcont71 %423 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %424 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %425 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %424, i32 0, i32 0 %426 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %425, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @97, i32 0, i32 0), i8** %426, align 8 %427 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %425, i32 0, i32 1 store i32 30, i32* %427, align 4 %428 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %425, i32 0, i32 2 store i32 8, i32* %428, align 4 %429 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %425, i32 0, i32 3 store i32 30, i32* %429, align 4 %430 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %425, i32 0, i32 4 store i32 11, i32* %430, align 4 %431 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @98, i32 0, i32 0)) %432 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %423, i32 0, i32 0 %433 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %424, i32 0, i32 0 %434 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %432, i32 0, i32 2 %435 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %432, i32 0, i32 0 store i1 true, i1* %435, align 1 %436 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %432, i32 0, i32 1 store i8* %431, i8** %436, align 8 store { i8*, i32, i32, i32, i32 }* %433, { i8*, i32, i32, i32, i32 }** %434, align 8 %437 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %432, i32 0, i32 3 store i32 1, i32* %437, align 4 %438 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %423, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %438, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @99, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @96, i32 0, i32 0), i64 1, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont73: ; preds = %ifcont71 %439 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 0 %440 = load i32, i32* %439, align 4 br i1 false, label %then74, label %ifcont75 then74: ; preds = %ifcont73 %441 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %442 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %443 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %442, i32 0, i32 0 %444 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %443, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @101, i32 0, i32 0), i8** %444, align 8 %445 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %443, i32 0, i32 1 store i32 30, i32* %445, align 4 %446 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %443, i32 0, i32 2 store i32 18, i32* %446, align 4 %447 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %443, i32 0, i32 3 store i32 30, i32* %447, align 4 %448 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %443, i32 0, i32 4 store i32 21, i32* %448, align 4 %449 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @102, i32 0, i32 0)) %450 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %441, i32 0, i32 0 %451 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %442, i32 0, i32 0 %452 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %450, i32 0, i32 2 %453 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %450, i32 0, i32 0 store i1 true, i1* %453, align 1 %454 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %450, i32 0, i32 1 store i8* %449, i8** %454, align 8 store { i8*, i32, i32, i32, i32 }* %451, { i8*, i32, i32, i32, i32 }** %452, align 8 %455 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %450, i32 0, i32 3 store i32 1, i32* %455, align 4 %456 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %441, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %456, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @103, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @100, i32 0, i32 0), i64 2, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont75: ; preds = %ifcont73 %457 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 1 %458 = load i32, i32* %457, align 4 %459 = or i32 %440, %458 br i1 false, label %then76, label %ifcont77 then76: ; preds = %ifcont75 %460 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %461 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %462 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %461, i32 0, i32 0 %463 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %462, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @105, i32 0, i32 0), i8** %463, align 8 %464 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %462, i32 0, i32 1 store i32 30, i32* %464, align 4 %465 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %462, i32 0, i32 2 store i32 28, i32* %465, align 4 %466 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %462, i32 0, i32 3 store i32 30, i32* %466, align 4 %467 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %462, i32 0, i32 4 store i32 31, i32* %467, align 4 %468 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @106, i32 0, i32 0)) %469 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %460, i32 0, i32 0 %470 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %461, i32 0, i32 0 %471 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %469, i32 0, i32 2 %472 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %469, i32 0, i32 0 store i1 true, i1* %472, align 1 %473 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %469, i32 0, i32 1 store i8* %468, i8** %473, align 8 store { i8*, i32, i32, i32, i32 }* %470, { i8*, i32, i32, i32, i32 }** %471, align 8 %474 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %469, i32 0, i32 3 store i32 1, i32* %474, align 4 %475 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %460, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %475, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @107, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @104, i32 0, i32 0), i64 3, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont77: ; preds = %ifcont75 %476 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 2 %477 = load i32, i32* %476, align 4 %478 = or i32 %459, %477 br i1 false, label %then78, label %ifcont79 then78: ; preds = %ifcont77 %479 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %480 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %481 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %480, i32 0, i32 0 %482 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %481, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @109, i32 0, i32 0), i8** %482, align 8 %483 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %481, i32 0, i32 1 store i32 30, i32* %483, align 4 %484 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %481, i32 0, i32 2 store i32 38, i32* %484, align 4 %485 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %481, i32 0, i32 3 store i32 30, i32* %485, align 4 %486 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %481, i32 0, i32 4 store i32 41, i32* %486, align 4 %487 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @110, i32 0, i32 0)) %488 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %479, i32 0, i32 0 %489 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %480, i32 0, i32 0 %490 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %488, i32 0, i32 2 %491 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %488, i32 0, i32 0 store i1 true, i1* %491, align 1 %492 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %488, i32 0, i32 1 store i8* %487, i8** %492, align 8 store { i8*, i32, i32, i32, i32 }* %489, { i8*, i32, i32, i32, i32 }** %490, align 8 %493 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %488, i32 0, i32 3 store i32 1, i32* %493, align 4 %494 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %479, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %494, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @111, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @108, i32 0, i32 0), i64 1, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont79: ; preds = %ifcont77 %495 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 0 %496 = load i32, i32* %495, align 4 %497 = or i32 %478, %496 store i32 %497, i32* %422, align 4 br i1 false, label %then80, label %ifcont81 then80: ; preds = %ifcont79 %498 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %499 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %500 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %499, i32 0, i32 0 %501 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %500, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @113, i32 0, i32 0), i8** %501, align 8 %502 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %500, i32 0, i32 1 store i32 31, i32* %502, align 4 %503 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %500, i32 0, i32 2 store i32 11, i32* %503, align 4 %504 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %500, i32 0, i32 3 store i32 31, i32* %504, align 4 %505 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %500, i32 0, i32 4 store i32 14, i32* %505, align 4 %506 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @114, i32 0, i32 0)) %507 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %498, i32 0, i32 0 %508 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %499, i32 0, i32 0 %509 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %507, i32 0, i32 2 %510 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %507, i32 0, i32 0 store i1 true, i1* %510, align 1 %511 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %507, i32 0, i32 1 store i8* %506, i8** %511, align 8 store { i8*, i32, i32, i32, i32 }* %508, { i8*, i32, i32, i32, i32 }** %509, align 8 %512 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %507, i32 0, i32 3 store i32 1, i32* %512, align 4 %513 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %498, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %513, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @115, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @112, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont81: ; preds = %ifcont79 %514 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 3 %515 = load i32, i32* %514, align 4 %516 = xor i32 %515, 1 %517 = icmp ne i32 %516, 0 br i1 %517, label %then82, label %else83 then82: ; preds = %ifcont81 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @117, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @116, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont84 else83: ; preds = %ifcont81 br label %ifcont84 ifcont84: ; preds = %else83, %then82 br i1 false, label %then85, label %ifcont86 then85: ; preds = %ifcont84 %518 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %519 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %520 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %519, i32 0, i32 0 %521 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %520, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @119, i32 0, i32 0), i8** %521, align 8 %522 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %520, i32 0, i32 1 store i32 33, i32* %522, align 4 %523 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %520, i32 0, i32 2 store i32 1, i32* %523, align 4 %524 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %520, i32 0, i32 3 store i32 33, i32* %524, align 4 %525 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %520, i32 0, i32 4 store i32 4, i32* %525, align 4 %526 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @120, i32 0, i32 0)) %527 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %518, i32 0, i32 0 %528 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %519, i32 0, i32 0 %529 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %527, i32 0, i32 2 %530 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %527, i32 0, i32 0 store i1 true, i1* %530, align 1 %531 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %527, i32 0, i32 1 store i8* %526, i8** %531, align 8 store { i8*, i32, i32, i32, i32 }* %528, { i8*, i32, i32, i32, i32 }** %529, align 8 %532 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %527, i32 0, i32 3 store i32 1, i32* %532, align 4 %533 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %518, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %533, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @121, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @118, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont86: ; preds = %ifcont84 %534 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 3 br i1 false, label %then87, label %ifcont88 then87: ; preds = %ifcont86 %535 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %536 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %537 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %536, i32 0, i32 0 %538 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %537, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @123, i32 0, i32 0), i8** %538, align 8 %539 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %537, i32 0, i32 1 store i32 33, i32* %539, align 4 %540 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %537, i32 0, i32 2 store i32 8, i32* %540, align 4 %541 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %537, i32 0, i32 3 store i32 33, i32* %541, align 4 %542 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %537, i32 0, i32 4 store i32 11, i32* %542, align 4 %543 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @124, i32 0, i32 0)) %544 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %535, i32 0, i32 0 %545 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %536, i32 0, i32 0 %546 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %544, i32 0, i32 2 %547 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %544, i32 0, i32 0 store i1 true, i1* %547, align 1 %548 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %544, i32 0, i32 1 store i8* %543, i8** %548, align 8 store { i8*, i32, i32, i32, i32 }* %545, { i8*, i32, i32, i32, i32 }** %546, align 8 %549 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %544, i32 0, i32 3 store i32 1, i32* %549, align 4 %550 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %535, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %550, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @125, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @122, i32 0, i32 0), i64 1, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont88: ; preds = %ifcont86 %551 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i64 0 %552 = load i32, i32* %551, align 4 store i32 %552, i32* %534, align 4 br i1 false, label %then89, label %ifcont90 then89: ; preds = %ifcont88 %553 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %554 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %555 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %554, i32 0, i32 0 %556 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %555, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @127, i32 0, i32 0), i8** %556, align 8 %557 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %555, i32 0, i32 1 store i32 34, i32* %557, align 4 %558 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %555, i32 0, i32 2 store i32 11, i32* %558, align 4 %559 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %555, i32 0, i32 3 store i32 34, i32* %559, align 4 %560 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %555, i32 0, i32 4 store i32 14, i32* %560, align 4 %561 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @128, i32 0, i32 0)) %562 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %553, i32 0, i32 0 %563 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %554, i32 0, i32 0 %564 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %562, i32 0, i32 2 %565 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %562, i32 0, i32 0 store i1 true, i1* %565, align 1 %566 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %562, i32 0, i32 1 store i8* %561, i8** %566, align 8 store { i8*, i32, i32, i32, i32 }* %563, { i8*, i32, i32, i32, i32 }** %564, align 8 %567 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %562, i32 0, i32 3 store i32 1, i32* %567, align 4 %568 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %553, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %568, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @129, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @126, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont90: ; preds = %ifcont88 %569 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i64 3 %570 = load i32, i32* %569, align 4 %571 = xor i32 %570, 1 %572 = icmp ne i32 %571, 0 br i1 %572, label %then91, label %else92 then91: ; preds = %ifcont90 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @131, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @130, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont93 else92: ; preds = %ifcont90 br label %ifcont93 ifcont93: ; preds = %else92, %then91 store i32 0, i32* %i, align 4 br label %loop.head94 loop.head94: ; preds = %loop.end109, %ifcont93 %573 = load i32, i32* %i, align 4 %574 = add i32 %573, 1 %575 = icmp sle i32 %574, 2 br i1 %575, label %loop.body95, label %loop.end110 loop.body95: ; preds = %loop.head94 %576 = load i32, i32* %i, align 4 %577 = add i32 %576, 1 store i32 %577, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head96 loop.head96: ; preds = %ifcont108, %loop.body95 %578 = load i32, i32* %j, align 4 %579 = add i32 %578, 1 %580 = icmp sle i32 %579, 2 br i1 %580, label %loop.body97, label %loop.end109 loop.body97: ; preds = %loop.head96 %581 = load i32, i32* %j, align 4 %582 = add i32 %581, 1 store i32 %582, i32* %j, align 4 %583 = load i32, i32* %i, align 4 %584 = load i32, i32* %j, align 4 %585 = add i32 %583, %584 %586 = load i32, i32* %i, align 4 %587 = load i32, i32* %j, align 4 %588 = add i32 %586, %587 %589 = sdiv i32 %588, 2 %590 = mul i32 2, %589 %591 = sub i32 %585, %590 %592 = icmp eq i32 %591, 1 br i1 %592, label %then98, label %else103 then98: ; preds = %loop.body97 %593 = load i32, i32* %i, align 4 %594 = load i32, i32* %j, align 4 %595 = sext i32 %593 to i64 %596 = sub i64 %595, 1 %597 = mul i64 1, %596 %598 = add i64 0, %597 %599 = icmp slt i64 %595, 1 %600 = icmp sgt i64 %595, 2 %601 = or i1 %599, %600 br i1 %601, label %then99, label %ifcont100 then99: ; preds = %then98 %602 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %603 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %604 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %603, i32 0, i32 0 %605 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %604, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @133, i32 0, i32 0), i8** %605, align 8 %606 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %604, i32 0, i32 1 store i32 39, i32* %606, align 4 %607 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %604, i32 0, i32 2 store i32 13, i32* %607, align 4 %608 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %604, i32 0, i32 3 store i32 39, i32* %608, align 4 %609 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %604, i32 0, i32 4 store i32 19, i32* %609, align 4 %610 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @134, i32 0, i32 0)) %611 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %602, i32 0, i32 0 %612 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %603, i32 0, i32 0 %613 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %611, i32 0, i32 2 %614 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %611, i32 0, i32 0 store i1 true, i1* %614, align 1 %615 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %611, i32 0, i32 1 store i8* %610, i8** %615, align 8 store { i8*, i32, i32, i32, i32 }* %612, { i8*, i32, i32, i32, i32 }** %613, align 8 %616 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %611, i32 0, i32 3 store i32 1, i32* %616, align 4 %617 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %602, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %617, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @135, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @132, i32 0, i32 0), i64 %595, i32 1, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont100: ; preds = %then98 %618 = sext i32 %594 to i64 %619 = sub i64 %618, 1 %620 = mul i64 2, %619 %621 = add i64 %598, %620 %622 = icmp slt i64 %618, 1 %623 = icmp sgt i64 %618, 2 %624 = or i1 %622, %623 br i1 %624, label %then101, label %ifcont102 then101: ; preds = %ifcont100 %625 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %626 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %627 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %626, i32 0, i32 0 %628 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %627, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @137, i32 0, i32 0), i8** %628, align 8 %629 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %627, i32 0, i32 1 store i32 39, i32* %629, align 4 %630 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %627, i32 0, i32 2 store i32 13, i32* %630, align 4 %631 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %627, i32 0, i32 3 store i32 39, i32* %631, align 4 %632 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %627, i32 0, i32 4 store i32 19, i32* %632, align 4 %633 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @138, i32 0, i32 0)) %634 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %625, i32 0, i32 0 %635 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %626, i32 0, i32 0 %636 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %634, i32 0, i32 2 %637 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %634, i32 0, i32 0 store i1 true, i1* %637, align 1 %638 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %634, i32 0, i32 1 store i8* %633, i8** %638, align 8 store { i8*, i32, i32, i32, i32 }* %635, { i8*, i32, i32, i32, i32 }** %636, align 8 %639 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %634, i32 0, i32 3 store i32 1, i32* %639, align 4 %640 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %625, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %640, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @139, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @136, i32 0, i32 0), i64 %618, i32 2, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont102: ; preds = %ifcont100 %641 = getelementptr [4 x i32], [4 x i32]* %c, i32 0, i64 %621 store i32 1, i32* %641, align 4 br label %ifcont108 else103: ; preds = %loop.body97 %642 = load i32, i32* %i, align 4 %643 = load i32, i32* %j, align 4 %644 = sext i32 %642 to i64 %645 = sub i64 %644, 1 %646 = mul i64 1, %645 %647 = add i64 0, %646 %648 = icmp slt i64 %644, 1 %649 = icmp sgt i64 %644, 2 %650 = or i1 %648, %649 br i1 %650, label %then104, label %ifcont105 then104: ; preds = %else103 %651 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %652 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %653 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %652, i32 0, i32 0 %654 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %653, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @141, i32 0, i32 0), i8** %654, align 8 %655 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %653, i32 0, i32 1 store i32 41, i32* %655, align 4 %656 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %653, i32 0, i32 2 store i32 13, i32* %656, align 4 %657 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %653, i32 0, i32 3 store i32 41, i32* %657, align 4 %658 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %653, i32 0, i32 4 store i32 19, i32* %658, align 4 %659 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @142, i32 0, i32 0)) %660 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %651, i32 0, i32 0 %661 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %652, i32 0, i32 0 %662 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %660, i32 0, i32 2 %663 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %660, i32 0, i32 0 store i1 true, i1* %663, align 1 %664 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %660, i32 0, i32 1 store i8* %659, i8** %664, align 8 store { i8*, i32, i32, i32, i32 }* %661, { i8*, i32, i32, i32, i32 }** %662, align 8 %665 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %660, i32 0, i32 3 store i32 1, i32* %665, align 4 %666 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %651, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %666, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @143, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @140, i32 0, i32 0), i64 %644, i32 1, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont105: ; preds = %else103 %667 = sext i32 %643 to i64 %668 = sub i64 %667, 1 %669 = mul i64 2, %668 %670 = add i64 %647, %669 %671 = icmp slt i64 %667, 1 %672 = icmp sgt i64 %667, 2 %673 = or i1 %671, %672 br i1 %673, label %then106, label %ifcont107 then106: ; preds = %ifcont105 %674 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %675 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %676 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %675, i32 0, i32 0 %677 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %676, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @145, i32 0, i32 0), i8** %677, align 8 %678 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %676, i32 0, i32 1 store i32 41, i32* %678, align 4 %679 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %676, i32 0, i32 2 store i32 13, i32* %679, align 4 %680 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %676, i32 0, i32 3 store i32 41, i32* %680, align 4 %681 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %676, i32 0, i32 4 store i32 19, i32* %681, align 4 %682 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @146, i32 0, i32 0)) %683 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %674, i32 0, i32 0 %684 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %675, i32 0, i32 0 %685 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %683, i32 0, i32 2 %686 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %683, i32 0, i32 0 store i1 true, i1* %686, align 1 %687 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %683, i32 0, i32 1 store i8* %682, i8** %687, align 8 store { i8*, i32, i32, i32, i32 }* %684, { i8*, i32, i32, i32, i32 }** %685, align 8 %688 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %683, i32 0, i32 3 store i32 1, i32* %688, align 4 %689 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %674, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %689, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @147, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @144, i32 0, i32 0), i64 %667, i32 2, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont107: ; preds = %ifcont105 %690 = getelementptr [4 x i32], [4 x i32]* %c, i32 0, i64 %670 store i32 0, i32* %690, align 4 br label %ifcont108 ifcont108: ; preds = %ifcont107, %ifcont102 br label %loop.head96 loop.end109: ; preds = %loop.head96 br label %loop.head94 loop.end110: ; preds = %loop.head94 br i1 false, label %then111, label %ifcont112 then111: ; preds = %loop.end110 %691 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %692 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %693 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %692, i32 0, i32 0 %694 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %693, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @149, i32 0, i32 0), i8** %694, align 8 %695 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %693, i32 0, i32 1 store i32 45, i32* %695, align 4 %696 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %693, i32 0, i32 2 store i32 5, i32* %696, align 4 %697 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %693, i32 0, i32 3 store i32 45, i32* %697, align 4 %698 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %693, i32 0, i32 4 store i32 11, i32* %698, align 4 %699 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @150, i32 0, i32 0)) %700 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %691, i32 0, i32 0 %701 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %692, i32 0, i32 0 %702 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %700, i32 0, i32 2 %703 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %700, i32 0, i32 0 store i1 true, i1* %703, align 1 %704 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %700, i32 0, i32 1 store i8* %699, i8** %704, align 8 store { i8*, i32, i32, i32, i32 }* %701, { i8*, i32, i32, i32, i32 }** %702, align 8 %705 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %700, i32 0, i32 3 store i32 1, i32* %705, align 4 %706 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %691, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %706, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @151, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @148, i32 0, i32 0), i64 1, i32 1, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont112: ; preds = %loop.end110 br i1 false, label %then113, label %ifcont114 then113: ; preds = %ifcont112 %707 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %708 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %709 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %708, i32 0, i32 0 %710 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %709, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @153, i32 0, i32 0), i8** %710, align 8 %711 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %709, i32 0, i32 1 store i32 45, i32* %711, align 4 %712 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %709, i32 0, i32 2 store i32 5, i32* %712, align 4 %713 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %709, i32 0, i32 3 store i32 45, i32* %713, align 4 %714 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %709, i32 0, i32 4 store i32 11, i32* %714, align 4 %715 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @154, i32 0, i32 0)) %716 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %707, i32 0, i32 0 %717 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %708, i32 0, i32 0 %718 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %716, i32 0, i32 2 %719 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %716, i32 0, i32 0 store i1 true, i1* %719, align 1 %720 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %716, i32 0, i32 1 store i8* %715, i8** %720, align 8 store { i8*, i32, i32, i32, i32 }* %717, { i8*, i32, i32, i32, i32 }** %718, align 8 %721 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %716, i32 0, i32 3 store i32 1, i32* %721, align 4 %722 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %707, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %722, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @155, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @152, i32 0, i32 0), i64 1, i32 2, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont114: ; preds = %ifcont112 %723 = getelementptr [4 x i32], [4 x i32]* %c, i32 0, i64 0 %724 = load i32, i32* %723, align 4 %725 = icmp ne i32 %724, 0 br i1 %725, label %then115, label %else116 then115: ; preds = %ifcont114 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @157, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @156, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont117 else116: ; preds = %ifcont114 br label %ifcont117 ifcont117: ; preds = %else116, %then115 br i1 false, label %then118, label %ifcont119 then118: ; preds = %ifcont117 %726 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %727 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %728 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %727, i32 0, i32 0 %729 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %728, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @159, i32 0, i32 0), i8** %729, align 8 %730 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %728, i32 0, i32 1 store i32 46, i32* %730, align 4 %731 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %728, i32 0, i32 2 store i32 11, i32* %731, align 4 %732 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %728, i32 0, i32 3 store i32 46, i32* %732, align 4 %733 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %728, i32 0, i32 4 store i32 17, i32* %733, align 4 %734 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @160, i32 0, i32 0)) %735 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %726, i32 0, i32 0 %736 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %727, i32 0, i32 0 %737 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %735, i32 0, i32 2 %738 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %735, i32 0, i32 0 store i1 true, i1* %738, align 1 %739 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %735, i32 0, i32 1 store i8* %734, i8** %739, align 8 store { i8*, i32, i32, i32, i32 }* %736, { i8*, i32, i32, i32, i32 }** %737, align 8 %740 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %735, i32 0, i32 3 store i32 1, i32* %740, align 4 %741 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %726, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %741, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @161, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @158, i32 0, i32 0), i64 1, i32 1, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont119: ; preds = %ifcont117 br i1 false, label %then120, label %ifcont121 then120: ; preds = %ifcont119 %742 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %743 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %744 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %743, i32 0, i32 0 %745 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %744, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @163, i32 0, i32 0), i8** %745, align 8 %746 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %744, i32 0, i32 1 store i32 46, i32* %746, align 4 %747 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %744, i32 0, i32 2 store i32 11, i32* %747, align 4 %748 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %744, i32 0, i32 3 store i32 46, i32* %748, align 4 %749 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %744, i32 0, i32 4 store i32 17, i32* %749, align 4 %750 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @164, i32 0, i32 0)) %751 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %742, i32 0, i32 0 %752 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %743, i32 0, i32 0 %753 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %751, i32 0, i32 2 %754 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %751, i32 0, i32 0 store i1 true, i1* %754, align 1 %755 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %751, i32 0, i32 1 store i8* %750, i8** %755, align 8 store { i8*, i32, i32, i32, i32 }* %752, { i8*, i32, i32, i32, i32 }** %753, align 8 %756 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %751, i32 0, i32 3 store i32 1, i32* %756, align 4 %757 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %742, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %757, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @165, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @162, i32 0, i32 0), i64 2, i32 2, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont121: ; preds = %ifcont119 %758 = getelementptr [4 x i32], [4 x i32]* %c, i32 0, i64 2 %759 = load i32, i32* %758, align 4 %760 = xor i32 %759, 1 %761 = icmp ne i32 %760, 0 br i1 %761, label %then122, label %else123 then122: ; preds = %ifcont121 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @167, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @166, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont124 else123: ; preds = %ifcont121 br label %ifcont124 ifcont124: ; preds = %else123, %then122 br i1 false, label %then125, label %ifcont126 then125: ; preds = %ifcont124 %762 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %763 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %764 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %763, i32 0, i32 0 %765 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %764, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @169, i32 0, i32 0), i8** %765, align 8 %766 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %764, i32 0, i32 1 store i32 47, i32* %766, align 4 %767 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %764, i32 0, i32 2 store i32 11, i32* %767, align 4 %768 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %764, i32 0, i32 3 store i32 47, i32* %768, align 4 %769 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %764, i32 0, i32 4 store i32 17, i32* %769, align 4 %770 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @170, i32 0, i32 0)) %771 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %762, i32 0, i32 0 %772 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %763, i32 0, i32 0 %773 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %771, i32 0, i32 2 %774 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %771, i32 0, i32 0 store i1 true, i1* %774, align 1 %775 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %771, i32 0, i32 1 store i8* %770, i8** %775, align 8 store { i8*, i32, i32, i32, i32 }* %772, { i8*, i32, i32, i32, i32 }** %773, align 8 %776 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %771, i32 0, i32 3 store i32 1, i32* %776, align 4 %777 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %762, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %777, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @171, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @168, i32 0, i32 0), i64 2, i32 1, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont126: ; preds = %ifcont124 br i1 false, label %then127, label %ifcont128 then127: ; preds = %ifcont126 %778 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %779 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %780 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %779, i32 0, i32 0 %781 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %780, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @173, i32 0, i32 0), i8** %781, align 8 %782 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %780, i32 0, i32 1 store i32 47, i32* %782, align 4 %783 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %780, i32 0, i32 2 store i32 11, i32* %783, align 4 %784 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %780, i32 0, i32 3 store i32 47, i32* %784, align 4 %785 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %780, i32 0, i32 4 store i32 17, i32* %785, align 4 %786 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @174, i32 0, i32 0)) %787 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %778, i32 0, i32 0 %788 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %779, i32 0, i32 0 %789 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %787, i32 0, i32 2 %790 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %787, i32 0, i32 0 store i1 true, i1* %790, align 1 %791 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %787, i32 0, i32 1 store i8* %786, i8** %791, align 8 store { i8*, i32, i32, i32, i32 }* %788, { i8*, i32, i32, i32, i32 }** %789, align 8 %792 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %787, i32 0, i32 3 store i32 1, i32* %792, align 4 %793 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %778, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %793, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @175, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @172, i32 0, i32 0), i64 1, i32 2, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont128: ; preds = %ifcont126 %794 = getelementptr [4 x i32], [4 x i32]* %c, i32 0, i64 1 %795 = load i32, i32* %794, align 4 %796 = xor i32 %795, 1 %797 = icmp ne i32 %796, 0 br i1 %797, label %then129, label %else130 then129: ; preds = %ifcont128 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @177, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @176, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont131 else130: ; preds = %ifcont128 br label %ifcont131 ifcont131: ; preds = %else130, %then129 br i1 false, label %then132, label %ifcont133 then132: ; preds = %ifcont131 %798 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %799 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %800 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %799, i32 0, i32 0 %801 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %800, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @179, i32 0, i32 0), i8** %801, align 8 %802 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %800, i32 0, i32 1 store i32 48, i32* %802, align 4 %803 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %800, i32 0, i32 2 store i32 5, i32* %803, align 4 %804 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %800, i32 0, i32 3 store i32 48, i32* %804, align 4 %805 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %800, i32 0, i32 4 store i32 11, i32* %805, align 4 %806 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @180, i32 0, i32 0)) %807 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %798, i32 0, i32 0 %808 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %799, i32 0, i32 0 %809 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %807, i32 0, i32 2 %810 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %807, i32 0, i32 0 store i1 true, i1* %810, align 1 %811 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %807, i32 0, i32 1 store i8* %806, i8** %811, align 8 store { i8*, i32, i32, i32, i32 }* %808, { i8*, i32, i32, i32, i32 }** %809, align 8 %812 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %807, i32 0, i32 3 store i32 1, i32* %812, align 4 %813 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %798, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %813, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @181, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @178, i32 0, i32 0), i64 2, i32 1, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont133: ; preds = %ifcont131 br i1 false, label %then134, label %ifcont135 then134: ; preds = %ifcont133 %814 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %815 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %816 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %815, i32 0, i32 0 %817 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %816, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @183, i32 0, i32 0), i8** %817, align 8 %818 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %816, i32 0, i32 1 store i32 48, i32* %818, align 4 %819 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %816, i32 0, i32 2 store i32 5, i32* %819, align 4 %820 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %816, i32 0, i32 3 store i32 48, i32* %820, align 4 %821 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %816, i32 0, i32 4 store i32 11, i32* %821, align 4 %822 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @184, i32 0, i32 0)) %823 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %814, i32 0, i32 0 %824 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %815, i32 0, i32 0 %825 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %823, i32 0, i32 2 %826 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %823, i32 0, i32 0 store i1 true, i1* %826, align 1 %827 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %823, i32 0, i32 1 store i8* %822, i8** %827, align 8 store { i8*, i32, i32, i32, i32 }* %824, { i8*, i32, i32, i32, i32 }** %825, align 8 %828 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %823, i32 0, i32 3 store i32 1, i32* %828, align 4 %829 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %814, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %829, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @185, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @182, i32 0, i32 0), i64 2, i32 2, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont135: ; preds = %ifcont133 %830 = getelementptr [4 x i32], [4 x i32]* %c, i32 0, i64 3 %831 = load i32, i32* %830, align 4 %832 = icmp ne i32 %831, 0 br i1 %832, label %then136, label %else137 then136: ; preds = %ifcont135 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @187, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @186, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont138 else137: ; preds = %ifcont135 br label %ifcont138 ifcont138: ; preds = %else137, %then136 br label %return return: ; preds = %ifcont138 br label %FINALIZE_SYMTABLE_arrays_01_logical FINALIZE_SYMTABLE_arrays_01_logical: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_snprintf_alloc(i8*, i8*, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lcompilers_runtime_error(i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) declare void @exit(i32) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/ast-modules_03-6fa1dfa.json0000664000175000017500000000075015174404631023562 0ustar alastairalastair{ "basename": "ast-modules_03-6fa1dfa", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_03.f90", "infile_hash": "0c943eab704cb3c04401d75522945962b53fc359340751a6477fc221", "outfile": null, "outfile_hash": null, "stdout": "ast-modules_03-6fa1dfa.stdout", "stdout_hash": "30688651441a6be083e89efd79d54fa6d18d6783741e71df039676d8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/c-case_03-b50b4bf.json0000664000175000017500000000071415174404631022374 0ustar alastairalastair{ "basename": "c-case_03-b50b4bf", "cmd": "lfortran --no-color --show-c {infile}", "infile": "tests/../integration_tests/case_03.f90", "infile_hash": "4fc1bb48b2136f22bb44b7c69aaa05a43b4ed2e4b8464c433340295d", "outfile": null, "outfile_hash": null, "stdout": "c-case_03-b50b4bf.stdout", "stdout_hash": "a8e2f0b7e3fe6b1c06e9a7d82a477acae96293fd6eb0b0245481adb5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implied_do_loops1-25d26db.stdout0000664000175000017500000002263715174404631025431 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { implied_do_loop1: (Program (SymbolTable 2 { a: (Variable 2 a [j] Local (ArrayConstructor [(ImpliedDoLoop [(Var 2 j)] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) () (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 2, 3, ...., 8, 9, 10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) )] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 2, 3, ...., 8, 9, 10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ColMajor () ) (ArrayConstant 40 [1, 2, 3, ...., 8, 9, 10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s: (Function (SymbolTable 3 { }) s (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(ImpliedDoLoop [(Var 2 j)] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) implied_do_loop1 [] [(SubroutineCall 2 s () [] () .false. ) (Print (StringFormat () [(ImpliedDoLoop [(ArrayItem (Var 2 a) [(() (Var 2 j) ())] (Integer 4) ColMajor () )] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) () (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-nested_01-a37fe7e.json0000664000175000017500000000074515174404631023327 0ustar alastairalastair{ "basename": "ast-nested_01-a37fe7e", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_01.f90", "infile_hash": "a7e6c8b63a220874358dba8c3f5052714bbc579c945d1d96474842a7", "outfile": null, "outfile_hash": null, "stdout": "ast-nested_01-a37fe7e.stdout", "stdout_hash": "dbf361714b01b1a2e4ec4e771f157da77979767b5e74d03008b64994", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-external4-4e8bc7b.json0000664000175000017500000000076715174404631023452 0ustar alastairalastair{ "basename": "asr-external4-4e8bc7b", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/external4.f90", "infile_hash": "99ee52cdcb37892af52701838b935fa68c04ab899074299c9ffd47ba", "outfile": null, "outfile_hash": null, "stdout": "asr-external4-4e8bc7b.stdout", "stdout_hash": "e4229f8b6685130ce3feb471b1a227650c020ed73eea3900f20002a3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_size_05-bc7d72f.json0000664000175000017500000000074315174404631024212 0ustar alastairalastair{ "basename": "asr-array_size_05-bc7d72f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_size_05.f90", "infile_hash": "2897aa70956cf4067dcd3a24263968a25d21ff6672ba6d3791805519", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_size_05-bc7d72f.stderr", "stderr_hash": "eedb29a2081bf075d9729fd746a5e4354f491336f7ce7c2322d59f8b", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-functions_09-1e51ac7.stdout0000664000175000017500000003442715174404631024345 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { stdlib_quadrature: (Program (SymbolTable 5 { simps38_weights_dp: (ExternalSymbol 5 simps38_weights_dp 2 simps38_weights_dp stdlib_quadrature_simps [] simps38_weights_dp Public ), x1: (Variable 5 x1 [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) stdlib_quadrature [stdlib_quadrature_simps] [(Print (StringFormat () [(FunctionCall 5 simps38_weights_dp () [((ArrayPhysicalCast (Var 5 x1) FixedSizeArray PointerArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray ) () ))] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), stdlib_quadrature_simps: (Module (SymbolTable 2 { simps38_weights: (GenericProcedure 2 simps38_weights [2 simps38_weights_dp] Public ), simps38_weights_dp: (Function (SymbolTable 3 { w: (Variable 3 w [] ReturnVar () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] In () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) simps38_weights_dp (FunctionType [(Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray )] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [] (Var 3 w) Public .true. .true. () ), simps38_weights_dp_use: (Function (SymbolTable 4 { x1: (Variable 4 x1 [] In () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) simps38_weights_dp_use (FunctionType [(Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [simps38_weights_dp] [(Var 4 x1)] [(Print (StringFormat () [(FunctionCall 2 simps38_weights_dp 2 simps38_weights [((Var 4 x1))] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) stdlib_quadrature_simps () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-allow_implicit_interface4-4615450.stdout0000664000175000017500000010440015174404631026710 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { dqc25c: (Function (SymbolTable 2 { dqk15w: (Function (SymbolTable 5 { dqk15w_arg_0: (Variable 5 dqk15w_arg_0 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) dqk15w (FunctionType [(Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 dqk15w_arg_0)] [] () Public .false. .false. () ), f: (Variable 2 f [] Unspecified () () Default (FunctionType [(Real 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) 2 ~implicit_interface_f_6 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), hlgth: (Variable 2 hlgth [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~implicit_interface_f_6: (Function (SymbolTable 6 { ~implicit_interface_f_6_arg_0: (Variable 6 ~implicit_interface_f_6_arg_0 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~implicit_interface_f_6_return_var: (Variable 6 ~implicit_interface_f_6_return_var [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~implicit_interface_f_6 (FunctionType [(Real 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 ~implicit_interface_f_6_arg_0)] [] (Var 6 ~implicit_interface_f_6_return_var) Public .false. .false. () ) }) dqc25c (FunctionType [(FunctionType [(Real 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 f)] [(SubroutineCall 2 dqk15w () [((Var 2 f))] () .false. ) (Print (StringFormat () [(FunctionCall 2 f () [((Var 2 hlgth))] (Real 8) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), func: (Function (SymbolTable 3 { c: (Function (SymbolTable 8 { c_arg_0: (Variable 8 c_arg_0 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c_return_var_name: (Variable 8 c_return_var_name [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 8 d [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) c (FunctionType [(Real 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 c_arg_0)] [] (Var 8 c_return_var_name) Public .false. .false. () ), d: (Variable 3 d [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Variable 3 f [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), func: (Variable 3 func [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sub2: (Function (SymbolTable 7 { sub2_arg_0: (Variable 7 sub2_arg_0 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub2 (FunctionType [(Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 sub2_arg_0)] [] () Public .false. .false. () ) }) func (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 f)] [(SubroutineCall 3 sub2 () [((Var 3 c))] () .false. ) (Print (StringFormat () [(FunctionCall 3 c () [((Var 3 d))] (Real 8) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] (Var 3 func) Public .false. .false. () ), main: (Program (SymbolTable 4 { a: (Function (SymbolTable 10 { a_arg_0: (Variable 10 a_arg_0 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a_return_var_name: (Variable 10 a_return_var_name [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 10 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a (FunctionType [(Real 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 a_arg_0)] [] (Var 10 a_return_var_name) Public .false. .false. () ), b: (Variable 4 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sub: (Function (SymbolTable 9 { sub_arg_0: (Variable 9 sub_arg_0 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub (FunctionType [(Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 sub_arg_0)] [] () Public .false. .false. () ) }) main [] [(SubroutineCall 4 sub () [((Var 4 a))] () .false. ) (Print (StringFormat () [(FunctionCall 4 a () [((Var 4 b))] (Real 8) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-string_02-c37e098.stdout0000664000175000017500000002245615174404631023754 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @string_const_data = private constant [4 x i8] c"Mr. " @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }> @string_const_data.1 = private constant [6 x i8] c"Rowan " @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([6 x i8], [6 x i8]* @string_const_data.1, i32 0, i32 0), i64 6 }> @string_const_data.3 = private constant [8 x i8] c"Atkinson" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data.3, i32 0, i32 0), i64 8 }> @string_const_data.5 = private constant [25 x i8] c"A big hello from Mr. Bean" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([25 x i8], [25 x i8]* @string_const_data.5, i32 0, i32 0), i64 25 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [38 x i8] c"S-DESC-8,S-DESC-6,S-DESC-15,S-DESC-15\00", align 1 @string_const_data.7 = private constant [8 x i8] c"Here is " @string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data.7, i32 0, i32 0), i64 8 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() %title = alloca %string_descriptor, align 8 %surname = alloca %string_descriptor, align 8 %greetings = alloca %string_descriptor, align 8 %firstname = alloca %string_descriptor, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store %string_descriptor zeroinitializer, %string_descriptor* %firstname, align 1 %3 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 1 store i64 15, i64* %3, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 0 %5 = call i8* @_lfortran_get_default_allocator() %6 = call i8* @_lfortran_malloc_alloc(i8* %5, i64 15) store i8* %6, i8** %4, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %greetings, align 1 %7 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 1 store i64 25, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 0 %9 = call i8* @_lfortran_get_default_allocator() %10 = call i8* @_lfortran_malloc_alloc(i8* %9, i64 25) store i8* %10, i8** %8, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %surname, align 1 %11 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 1 store i64 15, i64* %11, align 8 %12 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 0 %13 = call i8* @_lfortran_get_default_allocator() %14 = call i8* @_lfortran_malloc_alloc(i8* %13, i64 15) store i8* %14, i8** %12, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %title, align 1 %15 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 1 store i64 6, i64* %15, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 0 %17 = call i8* @_lfortran_get_default_allocator() %18 = call i8* @_lfortran_malloc_alloc(i8* %17, i64 6) store i8* %18, i8** %16, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 0 %20 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 1 %21 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_strcpy_alloc(i8* %2, i8** %19, i64* %20, i8 0, i8 0, i8* %21, i64 4) %22 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 0 %23 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 1 %24 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_strcpy_alloc(i8* %2, i8** %22, i64* %23, i8 0, i8 0, i8* %24, i64 6) %25 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 0 %26 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 1 %27 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_strcpy_alloc(i8* %2, i8** %25, i64* %26, i8 0, i8 0, i8* %27, i64 8) %28 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 0 %29 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 1 %30 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.6, i32 0, i32 0), align 8 call void @_lfortran_strcpy_alloc(i8* %2, i8** %28, i64* %29, i8 0, i8 0, i8* %30, i64 25) %31 = alloca i64, align 8 %32 = load %string_descriptor, %string_descriptor* %title, align 1 %33 = alloca %string_descriptor, align 8 store %string_descriptor %32, %string_descriptor* %33, align 1 %34 = load %string_descriptor, %string_descriptor* %firstname, align 1 %35 = alloca %string_descriptor, align 8 store %string_descriptor %34, %string_descriptor* %35, align 1 %36 = load %string_descriptor, %string_descriptor* %surname, align 1 %37 = alloca %string_descriptor, align 8 store %string_descriptor %36, %string_descriptor* %37, align 1 %38 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @serialization_info, i32 0, i32 0), i64* %31, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.8, %string_descriptor* %33, %string_descriptor* %35, %string_descriptor* %37) %39 = load i64, i64* %31, align 8 %40 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %38, i8** %40, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %39, i64* %41, align 8 %42 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %43 = load i8*, i8** %42, align 8 %44 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %45 = load i64, i64* %44, align 8 %46 = trunc i64 %45 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %43, i32 %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %47 = icmp eq i8* %38, null br i1 %47, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %38) br label %free_done free_done: ; preds = %free_nonnull, %.entry %48 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 0 %49 = load i8*, i8** %48, align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %49, i32 25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_string_02 FINALIZE_SYMTABLE_string_02: ; preds = %return br label %Finalize_Variable_firstname Finalize_Variable_firstname: ; preds = %FINALIZE_SYMTABLE_string_02 %50 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 0 %51 = load i8*, i8** %50, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %51) br label %Finalize_Variable_greetings Finalize_Variable_greetings: ; preds = %Finalize_Variable_firstname %52 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 0 %53 = load i8*, i8** %52, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %53) br label %Finalize_Variable_surname Finalize_Variable_surname: ; preds = %Finalize_Variable_greetings %54 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 0 %55 = load i8*, i8** %54, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %55) br label %Finalize_Variable_title Finalize_Variable_title: ; preds = %Finalize_Variable_surname %56 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 0 %57 = load i8*, i8** %56, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %57) call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc_alloc(i8*, i64) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_strcpy_alloc(i8*, i8**, i64*, i8, i8, i8*, i64) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/llvm-modules_01-1b129c3.stdout0000664000175000017500000000305715174404631024073 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [3 x i8] c"b()" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data, i32 0, i32 0), i64 3 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_modules_01_a_b() { .entry: %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %0, i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return ret void } declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @__module_modules_01_a_b() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_modules_01 FINALIZE_SYMTABLE_modules_01: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-ishftc_size-1254b50.stderr0000664000175000017500000000030615174404631024141 0ustar alastairalastairsemantic error: The SHIFT argument must be less than or equal to the of SIZE argument --> tests/errors/ishftc_size.f90:2:14 | 2 | print *, ishftc(10, 6, 4) | ^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-flush1-09001c8.json0000664000175000017500000000070715174404631022510 0ustar alastairalastair{ "basename": "ast-flush1-09001c8", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/flush1.f90", "infile_hash": "d0c80e1628d5fabcef4bf73ec7d228e08c9d37462c1a3bd0f08481d8", "outfile": null, "outfile_hash": null, "stdout": "ast-flush1-09001c8.stdout", "stdout_hash": "2045fc9cd6982df66c26cfbe2b337b178bd56ad1a4e41cc046a1a9c5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-maskr_negative-89183d3.stderr0000664000175000017500000000024115174404631024645 0ustar alastairalastairsemantic error: first argument of `maskr` must be nonnegative --> tests/errors/maskr_negative.f90:2:12 | 2 | print*, maskr(-24) | ^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-class_procedure_extra_args-543ebdc.json0000664000175000017500000000101215174404631027113 0ustar alastairalastair{ "basename": "asr-class_procedure_extra_args-543ebdc", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/class_procedure_extra_args.f90", "infile_hash": "f53275da38d64c0a3c278bed536e3423f2ac0b91546f2c30ddf9570e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-class_procedure_extra_args-543ebdc.stderr", "stderr_hash": "f5a22cd690dbe013e7c1d0bc4205e17be3cd338286c55f69a5116c04", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-logical1-d46903b.json0000664000175000017500000000074515174404631023255 0ustar alastairalastair{ "basename": "llvm-logical1-d46903b", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/logical1.f90", "infile_hash": "3768bda3700377afdf458a45ed70e2be9481e14ae76fda62adbe38e8", "outfile": null, "outfile_hash": null, "stdout": "llvm-logical1-d46903b.stdout", "stdout_hash": "d0a2bdc1c03971ef6a4fc49f3fb741024264e14b995cbae6ff730da5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor15-4cf95f9.stdout0000664000175000017500000000670615174404631027210 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor15: (Program (SymbolTable 2 { }) preprocessor15 [] [(Print (StringConstant "X == 4" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 4" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 4" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 2" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 2" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 2" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 2" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 2" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 2" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-ifix_01-ed76fb2.json0000664000175000017500000000072115174404631022772 0ustar alastairalastair{ "basename": "asr-ifix_01-ed76fb2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/ifix_01.f90", "infile_hash": "071fd2fff88805039bb2f2d28c599704b137261b241efff1c3b430c4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-ifix_01-ed76fb2.stderr", "stderr_hash": "e6d710cdb171f37dab07ebfa92cdf7645d94c0964a4d338d63d7f75f", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-nullify_02-3c7ee61.stdout0000664000175000017500000000205515174404631024174 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %p1 = alloca float*, align 8 store float* null, float** %p1, align 8 %p2 = alloca i32*, align 8 store i32* null, i32** %p2, align 8 %t1 = alloca float, align 4 %t2 = alloca i32, align 4 store float* %t1, float** %p1, align 8 %2 = load float*, float** %p1, align 8 store float 1.000000e+00, float* %2, align 4 store i32* %t2, i32** %p2, align 8 %3 = load i32*, i32** %p2, align 8 store i32 2, i32* %3, align 4 store float* null, float** %p1, align 8 store i32* null, i32** %p2, align 8 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_nullify_02 FINALIZE_SYMTABLE_nullify_02: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/ast-subroutines_04-cc5f6a4.stdout0000664000175000017500000000202615174404631024767 0ustar alastairalastair(TranslationUnit [(Program print_it () [] [] [] [(SubroutineCall 0 print_int [] [] [] [] () )] [(Subroutine print_int [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ())] () )] [(Assignment 0 a 5 () ) (Print 0 () [a] () )] [] [] )] )] ) lfortran-0.63.0/tests/reference/ast-do6-02ec641.stdout0000664000175000017500000002642015174404631022427 0ustar alastairalastair(TranslationUnit [(Program do6 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ()) (k [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(correct [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 correct 0 () ) (Assignment 0 k 0 () ) (DoLoop 0 () 30 i 1 5 () [(DoLoop 0 () 30 j 1 5 () [(Assignment 30 k (+ k 1) () )] () () )] () () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 k 0 () ) (DoLoop 0 () 35 i 1 5 () [(DoLoop 0 () 35 j 1 5 () [(Assignment 0 k (+ k 1) () ) (Continue 35 () )] () () )] () () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 k 0 () ) (DoLoop 0 () 40 i 1 25 () [(Assignment 0 k (+ k 1) () ) (Continue 40 () )] () () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 k 0 () ) (DoLoop 0 () 45 i 1 25 () [(Assignment 0 k (+ k 1) () ) (Continue 45 () )] () () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 k 0 () ) (DoLoop 0 () 50 i 1 5 () [(DoLoop 0 () 50 j 1 5 () [(Assignment 0 k (+ k 0) () ) (Assignment 50 k (+ k 1) () )] () () )] () () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 k 0 () ) (DoLoop 0 () 60 i 1 25 () [(Assignment 0 k (+ k 0) () ) (Assignment 60 k (+ k 1) () )] () () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 k (u- 30) () ) (DoLoop 0 () 65 i 1 5 () [(Assignment 0 k (+ k 1) () ) (DoLoop 0 () 65 j 1 5 () [(If 0 () (== k 25) [(GoTo 0 () 70 [] () )] [] () () () ) (Assignment 0 k (+ k 2) () ) (Continue 65 () )] () () )] () () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (== k 25) [(Assignment 0 j 0 () ) (GoTo 0 () 65 [] () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Continue 70 () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 k (u- 30) () ) (DoLoop 0 () 75 i 1 5 () [(Assignment 0 k (+ k 1) () ) (DoLoop 0 () 75 j 1 5 () [(If 0 () (== k 25) [(GoTo 0 () 80 [] () )] [] () () () ) (Assignment 0 k (+ k 2) () ) (Continue 75 () )] () () )] () () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (== k 25) [(Assignment 0 j 0 () ) (GoTo 0 () 75 [] () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Continue 80 () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Write 0 [(()) (())] [] [(/ (* 10 correct) 25) (String "% correct" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/ast_disable_style_suggestion-implicit10-c95f35e.stdout0000664000175000017500000001450415174404631031163 0ustar alastairalastair(TranslationUnit [(Function a [] [(AttrType TypeInteger [] () () None )] () () () [] [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(b [] [] () () None ()) (c [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(d [] [] () () None ()) (e [] [] () () None ()) (f [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(d1 [] [] () () None ()) (e1 [] [] () () None ()) (f1 [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() 8 Value)] () () None ) [] [(g [] [] () () None ()) (h [] [] () () None ()) (i [] [] () () None ())] () ) (Declaration (AttrType TypeComplex [] () () None ) [] [(j [] [] () () None ()) (k [] [] () () None ())] () ) (Declaration (AttrType TypeComplex [(() 4 Value)] () () None ) [] [(l [] [] () () None ()) (m [] [] () () None ())] () ) (Declaration (AttrType TypeComplex [(() 8 Value)] () () None ) [] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeDoublePrecision [] () () None ) [] [(o [] [] () () None ()) (p [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(Y [(1 e1 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(X [(1 d1 DimensionExpr) (1 e1 DimensionExpr) (1 f1 DimensionExpr)] [] () () None ())] () )] [(Assignment 0 (FuncCallOrArray Y [] [(() 1 () 0)] [] [] [] ) 3 () ) (Assignment 0 (FuncCallOrArray X [] [(() 1 () 0) (() 1 () 0) (() 1 () 0)] [] [] [] ) 3 () ) (Assignment 0 a 1 () ) (Assignment 0 b 2 () ) (Assignment 0 d 3 () ) (Assignment 0 f 4 () ) (Assignment 0 h 5 () ) (Assignment 0 i 6 () ) (Assignment 0 l 7 () ) (Assignment 0 m 8 () ) (Assignment 0 o 9 () ) (Assignment 0 p 10 () )] [] [] )] ) lfortran-0.63.0/tests/reference/ast_f90-close1-0f44a73.json0000664000175000017500000000072215174404631023233 0ustar alastairalastair{ "basename": "ast_f90-close1-0f44a73", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/close1.f90", "infile_hash": "b6174b7e66a7b9dea6c59e0e40b1786dc0721bf2b248b292f3576c9c", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-close1-0f44a73.stdout", "stdout_hash": "dcab72e31dd01f01a3831a1f9277aacb43b1ed6c1e786212b5dcbb65", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-functions_12-235fd97.stdout0000664000175000017500000002123415174404631024264 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_12: (Program (SymbolTable 2 { decodebase: (Function (SymbolTable 3 { r: (Variable 3 r [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 3 string [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string_local: (Variable 3 string_local [string] Local () () Default (String 1 (StringLen (Var 3 string) (Integer 4) () ) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] Local (IntrinsicElementalFunction Real [(TypeInquiry Huge (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant 2147483647 (Integer 4) Decimal) )] 0 (Real 4) (RealConstant 2147483647.000000 (Real 4) ) ) (RealConstant 2147483647.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) decodebase (FunctionType [(String 1 () AssumedLength DescriptorString)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 string)] [] (Var 3 r) Public .true. .true. () ) }) functions_12 [] [] ) }) [] ) lfortran-0.63.0/tests/reference/asr-allocate_02-3c0d7c8.json0000664000175000017500000000075315174404631023541 0ustar alastairalastair{ "basename": "asr-allocate_02-3c0d7c8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/allocate_02.f90", "infile_hash": "48b2bafd986dab617432d61a945379fc43a1e14588e41a1de1d2c148", "outfile": null, "outfile_hash": null, "stdout": "asr-allocate_02-3c0d7c8.stdout", "stdout_hash": "d35a67246ea8b822db9355a50e0df3c2a4607b084258877761ecd141", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules1-d3dc674.stdout0000664000175000017500000004526415174404631023567 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { abc: (Module (SymbolTable 8 { f: (Function (SymbolTable 10 { match: (Variable 10 match [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 10 self [] In () () Default (StructType [] [] .false. .false. ) 8 t1 Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(StructType [] [] .false. .false. )] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 10 self)] [] (Var 10 match) Public .true. .true. () ), t1: (Struct (SymbolTable 9 { f: (StructMethodDeclaration 9 f () f 8 f Source .false. .false. ) }) t1 (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () () [] ) }) abc () [] .true. .false. .false. ), x: (Program (SymbolTable 2 { t2: (ExternalSymbol 2 t2 4 t2 y [] t2 Public ) }) x [y] [] ), y: (Module (SymbolTable 4 { sub: (Function (SymbolTable 6 { 1_t1_f: (ExternalSymbol 6 1_t1_f 9 f t1 [] f Public ), 1_t2_val: (ExternalSymbol 6 1_t2_val 5 val t2 [] val Public ), self: (Variable 6 self [] InOut () () Default (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .false. .false. ) 4 t2 Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ) }) sub (FunctionType [(StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 self)] [(If () (FunctionCall 6 1_t1_f () [((StructInstanceMember (Var 6 self) 6 1_t2_val (Allocatable (StructType [] [] .false. .false. ) ) () ))] (Logical 4) () (StructInstanceMember (Var 6 self) 6 1_t2_val (Allocatable (StructType [] [] .false. .false. ) ) () ) ) [(Print (StringFormat () [(IntegerConstant 1 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] () Public .false. .false. () ), t1: (ExternalSymbol 4 t1 8 t1 abc [] t1 Public ), t2: (Struct (SymbolTable 5 { val: (Variable 5 val [] Local () () Default (Allocatable (StructType [] [] .false. .false. ) ) 4 t1 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) t2 (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. ) [] [val] [] Source Public .false. .false. [] () () [] ) }) y () [abc] .true. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/run-array_bounds_check_03-15fcd63.json0000664000175000017500000000074315174404631025621 0ustar alastairalastair{ "basename": "run-array_bounds_check_03-15fcd63", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_03.f90", "infile_hash": "6799dc4bd57bea91b97537abefdd229857c3736e06be6a50c08655b5", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_03-15fcd63.stderr", "stderr_hash": "66732e418b0d72dc75e6d3c3b3b00748da2ac7ddf57a937b922e8375", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-implicit13-56e851c.stderr0000664000175000017500000000254215174404631023707 0ustar alastairalastairstyle suggestion: Use integer(4) instead of integer*4 --> tests/implicit13.f90:2:34 | 2 | implicit integer (a,b-c), integer*4 (d-e), integer*8 (f-g), real (h) | ^ help: write this as 'integer(4)' style suggestion: Use integer(8) instead of integer*8 --> tests/implicit13.f90:2:51 | 2 | implicit integer (a,b-c), integer*4 (d-e), integer*8 (f-g), real (h) | ^ help: write this as 'integer(8)' style suggestion: Use real(4) instead of real*4 --> tests/implicit13.f90:3:14 | 3 | implicit real*4 (i-k), real*8 (l), complex (m, n), complex*8 (o) | ^ help: write this as 'real(4)' style suggestion: Use real(8) instead of real*8 --> tests/implicit13.f90:3:28 | 3 | implicit real*4 (i-k), real*8 (l), complex (m, n), complex*8 (o) | ^ help: write this as 'real(8)' style suggestion: Use complex(4) instead of complex*8 --> tests/implicit13.f90:3:59 | 3 | implicit real*4 (i-k), real*8 (l), complex (m, n), complex*8 (o) | ^ help: write this as 'complex(4)' style suggestion: Use complex(8) instead of complex*16 --> tests/implicit13.f90:4:17 | 4 | implicit complex*16 (p), double precision (q), double precision (r) | ^ help: write this as 'complex(8)' lfortran-0.63.0/tests/reference/julia-expr_06-78489bb.stdout0000664000175000017500000000010615174404631023553 0ustar alastairalastairfunction main() local x::Int32 = 3 + 6 println(x) end main() lfortran-0.63.0/tests/reference/asr-template_05-fe28e11.json0000664000175000017500000000075315174404631023573 0ustar alastairalastair{ "basename": "asr-template_05-fe28e11", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_05.f90", "infile_hash": "24c3ba37f04663194d5ce350c1ada395119516773d89212e1d2660d4", "outfile": null, "outfile_hash": null, "stdout": "asr-template_05-fe28e11.stdout", "stdout_hash": "912ceca2e8c40a86351f95d38a98ed561984dc84fc0d0ed1d94d4327", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootlfortran-0.63.0/tests/reference/pass_transform_optional_argument_functions-optional_02-e4f5f31.stdoutlfortran-0.63.0/tests/reference/pass_transform_optional_argument_functions-optional_02-e4f5f31.stdou0000664000175000017500000003123015174404631034136 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { optional_02: (Program (SymbolTable 4 { __libasr_created_dummy_variable_: (Variable 4 __libasr_created_dummy_variable_ [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_variable_pointer_: (Variable 4 __libasr_created_variable_pointer_ [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f1: (ExternalSymbol 4 f1 2 f1 optional_02_m [] f1 Public ), i: (Variable 4 i [] Local () () Default (Allocatable (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) optional_02 [optional_02_m] [(Assignment (Var 4 i) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (If () (IntrinsicImpureFunction Allocated [(Var 4 i)] 0 (Logical 4) () ) [(Associate (Var 4 __libasr_created_variable_pointer_) (Var 4 i) )] [(Associate (Var 4 __libasr_created_variable_pointer_) (Var 4 __libasr_created_dummy_variable_) )] ) (Print (StringFormat () [(FunctionCall 4 f1 () [((Var 4 __libasr_created_variable_pointer_)) ((LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 4 i)] 0 (Logical 4) () ) And (LogicalConstant .true. (Logical 4) ) (Logical 4) () ))] (Allocatable (Integer 4) ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), optional_02_m: (Module (SymbolTable 2 { f1: (Function (SymbolTable 3 { __libasr_is_present_x: (Variable 3 __libasr_is_present_x [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 3 r [] ReturnVar () () Default (Allocatable (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f1 (FunctionType [(Integer 4) (Logical 4)] (Allocatable (Integer 4) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 __libasr_is_present_x)] [(Assignment (Var 3 r) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 3 r) Public .true. .true. () ) }) optional_02_m () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/llvm-automatic_allocation_02-2a7afc4.json0000664000175000017500000000102215174404631026377 0ustar alastairalastair{ "basename": "llvm-automatic_allocation_02-2a7afc4", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/automatic_allocation_02.f90", "infile_hash": "1646e150432feecdb083d01f8f11d5f17ae691764bb12ada80610c85", "outfile": null, "outfile_hash": null, "stdout": "llvm-automatic_allocation_02-2a7afc4.stdout", "stdout_hash": "78c9c7e9f76a7c846ac530be6052dd9e4ce290defe63d215909ff751", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_openmp-openmp_46-1b93fa8.json0000664000175000017500000000077415174404631024646 0ustar alastairalastair{ "basename": "asr_openmp-openmp_46-1b93fa8", "cmd": "lfortran --show-asr --no-color --openmp {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_46.f90", "infile_hash": "069734ce0ac51967b68f899b74ea0cf445af3d9647b786ac0d4af80b", "outfile": null, "outfile_hash": null, "stdout": "asr_openmp-openmp_46-1b93fa8.stdout", "stdout_hash": "3698d79f631c2f4d40d1c59bf34387491b0b7d2d85fb075a5b493b88", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-polymorphic_class_in_derived_type-15eb7b6.stdout0000664000175000017500000001656215174404631031015 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fortuno_types: (Module (SymbolTable 2 { dict_item: (Struct (SymbolTable 3 { value: (Variable 3 value [] Local () () Default (Allocatable (StructType [] [] .false. .true. ) ) 3 ~unlimited_polymorphic_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), value2: (Variable 3 value2 [] Local () () Default (Allocatable (StructType [] [] .false. .true. ) ) 3 ~unlimited_polymorphic_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~unlimited_polymorphic_type: (Struct (SymbolTable 4 { }) ~unlimited_polymorphic_type (StructType [] [] .false. .true. ) [] [] [] Source Public .false. .true. [] () () [] ) }) dict_item (StructType [(Allocatable (StructType [] [] .false. .true. ) ) (Allocatable (StructType [] [] .false. .true. ) )] [] .true. .false. ) [] [value value2] [] Source Public .false. .false. [] () () [] ) }) fortuno_types () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-declaration1-880025a.stdout0000664000175000017500000001535615174404631024234 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { declaration1: (Module (SymbolTable 2 { arr: (Variable 2 arr [] Local (ArrayReshape (ArrayConstant 4 [1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayPhysicalCast (ArrayConstant 8 [1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) () (ArrayConstant 8 [2, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 4 [1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (ArrayConstant 4 [1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) declaration1 () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-external_02-ab2b90d.stdout0000664000175000017500000003002215174404631024210 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cobyla: (Function (SymbolTable 2 { calcfc: (Function (SymbolTable 7 { calcfc_arg_0: (Variable 7 calcfc_arg_0 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), con: (Variable 7 con [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) calcfc (FunctionType [(Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 calcfc_arg_0)] [] () Public .false. .false. () ) }) cobyla (FunctionType [(FunctionType [] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [cobylb] [(Var 2 calcfc)] [(SubroutineCall 1 cobylb () [((Var 2 calcfc))] () .false. ) (Return)] () Public .true. .true. () ), cobylb: (Function (SymbolTable 4 { calcfc: (Function (SymbolTable 6 { calcfc_arg_0: (Variable 6 calcfc_arg_0 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), con: (Variable 6 con [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) calcfc (FunctionType [(Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 calcfc_arg_0)] [] () Public .false. .false. () ), con: (Variable 4 con [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cobylb (FunctionType [(FunctionType [] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 calcfc)] [(SubroutineCall 4 calcfc () [((Var 4 con))] () .false. ) (Return)] () Public .false. .false. () ) }) [] ) lfortran-0.63.0/tests/reference/ast_no_prescan-no_prescan_include2-420be52.stdout0000664000175000017500000000030615174404631030054 0ustar alastairalastair(TranslationUnit [(Program include2 () [] [] [] [(Include 0 "include2b.f90" () )] [] )] ) lfortran-0.63.0/tests/reference/llvm-mangle_underscore_external_01-c26c50a.json0000664000175000017500000000101715174404631027521 0ustar alastairalastair{ "basename": "llvm-mangle_underscore_external_01-c26c50a", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/mangle_underscore_external_01.f90", "infile_hash": "2e8c05ad551bccbce7f14d927259e3824749eeba2389cdf53ba7bd02", "outfile": null, "outfile_hash": null, "stdout": "llvm-mangle_underscore_external_01-c26c50a.stdout", "stdout_hash": "b81de9dc74370a243ca68f4acc5d0eea3d7f4404b9cf481e5cb05f59", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-mangle_underscore_external_01-c26c50a.stdout0000664000175000017500000000115115174404631030071 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @foo_() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_mangle_underscore_external_01 FINALIZE_SYMTABLE_mangle_underscore_external_01: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @foo_() declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-implicit8-5e681cf.stdout0000664000175000017500000001667415174404631023746 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { a: (Variable 2 a [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 2 m [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [n] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [m] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 m))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 n) (Var 2 m)] [(Assignment (Var 2 n) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 m) (IntegerConstant 8 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (ArrayConstant 20 [1, 2, 3, 4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. )] (Var 2 a) Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-sign_01-62b270e.json0000664000175000017500000000072115174404631022623 0ustar alastairalastair{ "basename": "asr-sign_01-62b270e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/sign_01.f90", "infile_hash": "78b92aca15be8ebd9ddd8d8238cf461f0845c7600f926b57e64c270a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-sign_01-62b270e.stderr", "stderr_hash": "dab94d75469b4260c70326c06698d247c7f9bbe6c0aeebd631d20ab0", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-arrays_01_size-352da98.stdout0000664000175000017500000006043115174404631024603 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), size_a: (Variable 2 size_a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), size_b: (Variable 2 size_b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) arrays_01 [] [(Assignment (Var 2 size_a) (ArraySize (Var 2 a) () (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 size_b) (ArraySize (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) () .false. .false. ) (If () (IntegerCompare (Var 2 size_a) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 size_b) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 size_a) ()) [(Assignment (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (IntegerBinOp (Var 2 i) Add (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 11 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 12 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 13 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 11 (Integer 4) Decimal) (IntegerBinOp (IntegerConstant 10 (Integer 4) Decimal) Add (Var 2 size_b) (Integer 4) () ) ()) [(Assignment (ArrayItem (Var 2 b) [(() (IntegerBinOp (Var 2 i) Sub (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 11 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 12 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 13 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 14 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 size_a) ()) [(Assignment (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (IntegerBinOp (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerBinOp (IntegerBinOp (IntegerBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) Add (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Integer 4) () ) Add (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Integer 4) () ) Add (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 17 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 11 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-template_struct_01-f11e745.stdout0000664000175000017500000002605415174404631025471 0ustar alastairalastair(TranslationUnit [(Module template_struct_01_m (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(struct_t [] [] () () None ()) (test_template [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Requirement r [t] [(DerivedType t [] () [(SimpleAttribute AttrDeferred )] [] [] )] [] ) (Template struct_t [t] [(Require [(UnitRequire r [(AttrNamelist t )] )] ) (Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(tuple [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DerivedType tuple [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Declaration (AttrType TypeType [] () t None ) [] [(fst [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () t None ) [] [(snd [] [] () () None ())] () )] [] )] [(Function get_fst [(p)] [] r () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeType [] () tuple None ) [(AttrIntent In )] [(p [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () t None ) [] [(r [] [] () () None ())] () )] [(Assignment 0 r fst [(p [])] () )] [] [] ) (Function get_snd [(p)] [] r () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeType [] () tuple None ) [(AttrIntent In )] [(p [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () t None ) [] [(r [] [] () () None ())] () )] [(Assignment 0 r snd [(p [])] () )] [] [] )] )] [] [(Subroutine test_template [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Instantiate struct_t [(AttrType TypeInteger [] () () None )] [(UseSymbol tuple int_tuple ) (UseSymbol get_fst get_int_fst ) (UseSymbol get_snd get_int_snd )] ) (Instantiate struct_t [(AttrType TypeReal [] () () None )] [(UseSymbol tuple real_tuple ) (UseSymbol get_fst get_real_fst ) (UseSymbol get_snd get_real_snd )] ) (Declaration (AttrType TypeType [] () int_tuple None ) [] [(ti [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () real_tuple None ) [] [(tr [] [] () () None ())] () )] [(Assignment 0 fst [(ti [])] 1 () ) (Print 0 () [(String "First element: " ()) (FuncCallOrArray get_int_fst [] [(() ti () 0)] [] [] [] )] () ) (Assignment 0 snd [(ti [])] 2 () ) (Print 0 () [(String "Second element: " ()) (FuncCallOrArray get_int_snd [] [(() ti () 0)] [] [] [] )] () ) (Assignment 0 fst [(tr [])] (Real "1.") () ) (Print 0 () [(String "First element: " ()) (FuncCallOrArray get_real_fst [] [(() tr () 0)] [] [] [] )] () ) (Assignment 0 snd [(tr [])] (Real "2.") () ) (Print 0 () [(String "Second element: " ()) (FuncCallOrArray get_real_snd [] [(() tr () 0)] [] [] [] )] () )] [] [] )] ) (Program template_struct_01 () [(Use [] template_struct_01_m [] .false. (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(SubroutineCall 0 test_template [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/asr-derived_type_02-3e6510f.json0000664000175000017500000000075115174404631024354 0ustar alastairalastair{ "basename": "asr-derived_type_02-3e6510f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/derived_type_02.f90", "infile_hash": "d6255b9c3de35703fc41705513045302de70c7d3d045bc8be96e2d27", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-derived_type_02-3e6510f.stderr", "stderr_hash": "66c93e609d5f957dd07fca5bd4b6f6f6b8d91a29b82ccfa34910f42f", "returncode": 2 }lfortran-0.63.0/tests/reference/run-format_53-2d03c61.json0000664000175000017500000000071515174404631023177 0ustar alastairalastair{ "basename": "run-format_53-2d03c61", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_53.f90", "infile_hash": "cd5f05a45b0a163eb5008226938721ba5184db235a8bd0db67612ccd", "outfile": null, "outfile_hash": null, "stdout": "run-format_53-2d03c61.stdout", "stdout_hash": "7f88900dfe9dc63503fb29bc345707eb63b078051cb9528e03a238e7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-program_without_line_03-02055a5.stdout0000664000175000017500000000121615174404631026413 0ustar alastairalastair(TranslationUnit [(Subroutine sub [] [] () (TriviaNode [(Semicolon)] [(Semicolon)] ) [] [] [] [] [] [] [] ) (Program __xx_main () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [] [] )] ) lfortran-0.63.0/tests/reference/cpp-intrinsics_02-707a51a.stdout0000664000175000017500000000313515174404631024417 0ustar alastairalastair#include #include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { static float x=sin( 1.50000000000000000e+00); double y; y = sin( 1.50000000000000000e+00); std::cout << x << " " << y << std::endl; if (fabs(x - 9.97494995594024658e-01) > 9.99999997475242708e-07) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (fabs(sin(x) - 8.40114891529083252e-01) > 9.99999997475242708e-07) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (fabs(y - 9.97494995594024658e-01) > 1.00000001168609742e-07) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (fabs(sin(sin( 1.50000000000000000e+00) + (sin( 5.00000000000000000e-01 + sin( 5.00000000000000000e-01)))) - 9.67188417911529541e-01) > 1.00000001168609742e-07) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (fabs(sin(sin(y) + (sin(x + sin(x)))) - 9.72761869430541992e-01) > 1.00000001168609742e-07) { std::cerr << "ERROR STOP" << std::endl; exit(1); } } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/asr-common_06-4a72d58.json0000664000175000017500000000074515174404631023175 0ustar alastairalastair{ "basename": "asr-common_06-4a72d58", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/common_06.f90", "infile_hash": "d770e487bb7df4c785092ea18e222d0bd79f616d66b2d39a4a76a04f", "outfile": null, "outfile_hash": null, "stdout": "asr-common_06-4a72d58.stdout", "stdout_hash": "f334d5b12253bc75d29488a7dc2738638e607f6b226318b8fc5386f2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-fn_call1-fcd6b9c.stdout0000664000175000017500000000027515174404631024330 0ustar alastairalastairsize(tvec, dim=2) min(tvec(2, i), tvec(1, i)) a(1, 2, 3) f(a, b, d=5/2, c=3 + 3) A(i, j, k) X(i) X(:) X(a:) X(:b) X(a:b) X(::c) X(::c) X(a::c) X(a::c) X(:b:c) X(a:b:c) X(a:b, ::c, a:, a::c)lfortran-0.63.0/tests/reference/cpp-array1-d75d040.json0000664000175000017500000000067215174404631022564 0ustar alastairalastair{ "basename": "cpp-array1-d75d040", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/array1.f90", "infile_hash": "74ef23b0c6d49a710e5035ce53fa6899eb51ef5e5b693d15108744ca", "outfile": null, "outfile_hash": null, "stdout": "cpp-array1-d75d040.stdout", "stdout_hash": "be314eb769aa2ba39ff0c2c0571b53ea2ca385bc351a030f400f1c3f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-interface_08-1848d3c.json0000664000175000017500000000075615174404631023651 0ustar alastairalastair{ "basename": "asr-interface_08-1848d3c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/interface_08.f90", "infile_hash": "1d77bce04c4ed246e65fc8bdef857ace3850dcb72213fe0d33da8e32", "outfile": null, "outfile_hash": null, "stdout": "asr-interface_08-1848d3c.stdout", "stdout_hash": "eb1bf7a4d43b749b413ccf7e3ede6e2a3a74afe292e1f3bb39f8b9a6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-incorrect_type_where_03-a95b1f2.json0000664000175000017500000000100115174404631026162 0ustar alastairalastair{ "basename": "asr-incorrect_type_where_03-a95b1f2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incorrect_type_where_03.f90", "infile_hash": "a68b2276cc817ca2db41c25621904b778868e085b956002ce3efba83", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incorrect_type_where_03-a95b1f2.stderr", "stderr_hash": "e62bad036d6b387c4724af66f63526d9db27752fdabf6a16662dc60e", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-stop-866225f.json0000664000175000017500000000070415174404631022471 0ustar alastairalastair{ "basename": "llvm-stop-866225f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/stop.f90", "infile_hash": "4992b783d9f3aeee0fc682e7600ed3b3e57f5d9e8ea4ef63ab0bbb4d", "outfile": null, "outfile_hash": null, "stdout": "llvm-stop-866225f.stdout", "stdout_hash": "5340c3f795eefcdf8912f06d0a5d9b64640a4a2d4b36862478d7b9cc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_37-7eba027.stdout0000664000175000017500000015132415174404631024003 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_37: (Program (SymbolTable 11 { }) modules_37 [] [(Print (StringConstant "executing modules_37" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ), modules_37_fpm_backend: (Module (SymbolTable 2 { build_package: (Function (SymbolTable 9 { 1_build_target_ptr_ptr: (ExternalSymbol 9 1_build_target_ptr_ptr 6 ptr build_target_ptr [] ptr Public ), associate_block: (AssociateBlock (SymbolTable 12 { 1_build_target_t_output_dir: (ExternalSymbol 12 1_build_target_t_output_dir 7 output_dir build_target_t [] output_dir Public ), 1_string_t_s: (ExternalSymbol 12 1_string_t_s 5 s string_t [] s Public ), target: (Variable 12 target [] Local () () Default (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 2 build_target_t Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) associate_block [(Associate (Var 12 target) (StructInstanceMember (ArrayItem (Var 9 targets) [(() (Var 9 i) ())] (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) ColMajor () ) 9 1_build_target_ptr_ptr (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) ) (Assignment (StructInstanceMember (Var 9 temp) 12 1_string_t_s (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (StructInstanceMember (Var 12 target) 12 1_build_target_t_output_dir (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) () .false. .false. ) (Assignment (Var 9 build_dirs) (ArrayConstructor [(Var 9 build_dirs) (Var 9 temp)] (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) ())] DescriptorArray ) ) () ColMajor () ) () .false. .false. )] ), build_dirs: (Variable 9 build_dirs [] Local () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 string_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 9 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 9 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), model: (Variable 9 model [] In () () Default (StructType [] [] .true. .false. ) 2 fpm_model_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), targets: (Variable 9 targets [] InOut () () Default (Array (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) 2 build_target_ptr Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), temp: (Variable 9 temp [] Local () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), verbose: (Variable 9 verbose [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) build_package (FunctionType [(Array (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) (StructType [] [] .true. .false. ) (Logical 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 targets) (Var 9 model) (Var 9 verbose)] [(Allocate [((Var 9 build_dirs) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] () () ())] () () () ) (DoLoop () ((Var 9 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 9 targets) () (Integer 4) () ) ()) [(AssociateBlockCall 9 associate_block )] [] )] () Public .true. .true. () ), build_target_ptr: (Struct (SymbolTable 6 { ptr: (Variable 6 ptr [] Local (PointerNullConstant (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Var 6 ptr) ) (PointerNullConstant (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Var 6 ptr) ) Default (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 2 build_target_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) build_target_ptr (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [build_target_t] [ptr] [] Source Public .false. .false. [] () () [] ), build_target_t: (Struct (SymbolTable 7 { output_dir: (Variable 7 output_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) build_target_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [output_dir] [] Source Public .false. .false. [] () () [] ), cmd_build: (Function (SymbolTable 10 { 1_fpm_cmd_settings_verbose: (ExternalSymbol 10 1_fpm_cmd_settings_verbose 3 verbose fpm_cmd_settings [] verbose Public ), model: (Variable 10 model [] Local () () Default (StructType [] [] .true. .false. ) 2 fpm_model_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), settings: (Variable 10 settings [] In () () Default (StructType [] [] .true. .false. ) 2 fpm_build_settings Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), targets: (Variable 10 targets [] Local () () Default (Allocatable (Array (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 build_target_ptr Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cmd_build (FunctionType [(StructType [] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [build_package] [(Var 10 settings)] [(SubroutineCall 2 build_package () [((Var 10 targets)) ((Var 10 model)) ((StructInstanceMember (Var 10 settings) 10 1_fpm_cmd_settings_verbose (Logical 4) () ))] () .false. )] () Public .true. .true. () ), fpm_build_settings: (Struct (SymbolTable 4 { }) fpm_build_settings (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () 2 fpm_cmd_settings [] ), fpm_cmd_settings: (Struct (SymbolTable 3 { verbose: (Variable 3 verbose [] Local (LogicalConstant .true. (Logical 4) ) (LogicalConstant .true. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fpm_cmd_settings (StructType [(Logical 4)] [] .true. .false. ) [] [verbose] [] Source Public .false. .true. [] () () [] ), fpm_model_t: (Struct (SymbolTable 8 { }) fpm_model_t (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () () [] ), string_t: (Struct (SymbolTable 5 { s: (Variable 5 s [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [s] [] Source Public .false. .false. [] () () [] ) }) modules_37_fpm_backend () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-array_05_cc-37bfc03.json0000664000175000017500000000075515174404631023541 0ustar alastairalastair{ "basename": "asr-array_05_cc-37bfc03", "cmd": "lfortran --semantics-only --continue-compilation --no-color {infile}", "infile": "tests/errors/array_05_cc.f90", "infile_hash": "1dcd170461f4cffa125a95ce54171512f99cf95947be6665ba56b021", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_05_cc-37bfc03.stderr", "stderr_hash": "fb2430ac2eb05e0bb79ec0d1c97481fda53d7e1b8aee6d47a8b5cd08", "returncode": 1 }lfortran-0.63.0/tests/reference/ast-parsing_02-740c1e5.stderr0000664000175000017500000000026115174404631023663 0ustar alastairalastairstyle suggestion: Use 'end if' instead of 'endif' --> tests/../integration_tests/parsing_02.f90:49:7 | 49 | endif endif | ^^^^^ help: write this as 'end if' lfortran-0.63.0/tests/reference/asr-nested_04-8423f42.json0000664000175000017500000000074515174404631023103 0ustar alastairalastair{ "basename": "asr-nested_04-8423f42", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_04.f90", "infile_hash": "e1cee5ef2176599a2dccac3f59fc86ddc957a5f559f5edb7ddd710ca", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_04-8423f42.stdout", "stdout_hash": "7c408b454c1062f8ebb9e5046f03053a6df9f0b4a23dee6c9a4cc67f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-interface_01-9dc98da.json0000664000175000017500000000075615174404631024011 0ustar alastairalastair{ "basename": "asr-interface_01-9dc98da", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/interface_01.f90", "infile_hash": "56828a66265782f7acd20520a5d25ac6246d6d44dfb8fa758507ed63", "outfile": null, "outfile_hash": null, "stdout": "asr-interface_01-9dc98da.stdout", "stdout_hash": "2e18606c39dd572fb97dff971785e8e83419c7fc5fd98a2843512a21", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-statement_02-daaef34.json0000664000175000017500000000102515174404631024106 0ustar alastairalastair{ "basename": "asr-statement_02-daaef34", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/statement_02.f90", "infile_hash": "61034a47086bdbf3221fccdae0ad236a38d9ee626e02852cc820bc8e", "outfile": null, "outfile_hash": null, "stdout": "asr-statement_02-daaef34.stdout", "stdout_hash": "b7b052da79b735770838c731ee8f28fe6e4c926de3f408d5e5e65b34", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-type_conflict1-5097f3a.json0000664000175000017500000000074615174404631024324 0ustar alastairalastair{ "basename": "asr-type_conflict1-5097f3a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/type_conflict1.f90", "infile_hash": "86a1bbc02900a3c4090ab3cf9b25729e2571b2d48b4591cb834512e9", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-type_conflict1-5097f3a.stderr", "stderr_hash": "c759335f4cd52da75bca7415c1ebdad62815732ec829e4cd7ab6984a", "returncode": 2 }lfortran-0.63.0/tests/reference/c_target_omp-openmp_70-377d35b.json0000664000175000017500000000076315174404631025062 0ustar alastairalastair{ "basename": "c_target_omp-openmp_70-377d35b", "cmd": "lfortran --show-c --openmp {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_70.f90", "infile_hash": "4373476b7ee3c1e7a9ebb78dac9ef920a5fdd07050ed2ed2315212d8", "outfile": null, "outfile_hash": null, "stdout": "c_target_omp-openmp_70-377d35b.stdout", "stdout_hash": "9815679304f7f44d1d55eeecdd5857d44d7cbb9f589a80064d1feb12", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-types_06-6f66d2c.stdout0000664000175000017500000005402215174404631023666 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @17 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @21 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @23 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @25 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @27 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @28 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @29 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @31 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @32 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @33 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @34 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @35 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @37 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @39 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @40 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @41 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @43 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @44 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @45 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @46 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @47 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %r = alloca float, align 4 store float 2.000000e+00, float* %r, align 4 store i32 2, i32* %i, align 4 %2 = load i32, i32* %i, align 4 %3 = load i32, i32* %i, align 4 %4 = icmp slt i32 %2, %3 br i1 %4, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %5 = load float, float* %r, align 4 %6 = load float, float* %r, align 4 %7 = fcmp olt float %5, %6 br i1 %7, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %8 = load float, float* %r, align 4 %9 = load i32, i32* %i, align 4 %10 = sitofp i32 %9 to float %11 = fcmp olt float %8, %10 br i1 %11, label %then4, label %else5 then4: ; preds = %ifcont3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont6 else5: ; preds = %ifcont3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 %12 = load i32, i32* %i, align 4 %13 = sitofp i32 %12 to float %14 = load float, float* %r, align 4 %15 = fcmp olt float %13, %14 br i1 %15, label %then7, label %else8 then7: ; preds = %ifcont6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 %16 = load i32, i32* %i, align 4 %17 = load i32, i32* %i, align 4 %18 = icmp sgt i32 %16, %17 br i1 %18, label %then10, label %else11 then10: ; preds = %ifcont9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont12 else11: ; preds = %ifcont9 br label %ifcont12 ifcont12: ; preds = %else11, %then10 %19 = load float, float* %r, align 4 %20 = load float, float* %r, align 4 %21 = fcmp ogt float %19, %20 br i1 %21, label %then13, label %else14 then13: ; preds = %ifcont12 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont15 else14: ; preds = %ifcont12 br label %ifcont15 ifcont15: ; preds = %else14, %then13 %22 = load float, float* %r, align 4 %23 = load i32, i32* %i, align 4 %24 = sitofp i32 %23 to float %25 = fcmp ogt float %22, %24 br i1 %25, label %then16, label %else17 then16: ; preds = %ifcont15 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont18 else17: ; preds = %ifcont15 br label %ifcont18 ifcont18: ; preds = %else17, %then16 %26 = load i32, i32* %i, align 4 %27 = sitofp i32 %26 to float %28 = load float, float* %r, align 4 %29 = fcmp ogt float %27, %28 br i1 %29, label %then19, label %else20 then19: ; preds = %ifcont18 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont21 else20: ; preds = %ifcont18 br label %ifcont21 ifcont21: ; preds = %else20, %then19 %30 = load i32, i32* %i, align 4 %31 = load i32, i32* %i, align 4 %32 = icmp ne i32 %30, %31 br i1 %32, label %then22, label %else23 then22: ; preds = %ifcont21 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont24 else23: ; preds = %ifcont21 br label %ifcont24 ifcont24: ; preds = %else23, %then22 %33 = load float, float* %r, align 4 %34 = load float, float* %r, align 4 %35 = fcmp une float %33, %34 br i1 %35, label %then25, label %else26 then25: ; preds = %ifcont24 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont27 else26: ; preds = %ifcont24 br label %ifcont27 ifcont27: ; preds = %else26, %then25 %36 = load float, float* %r, align 4 %37 = load i32, i32* %i, align 4 %38 = sitofp i32 %37 to float %39 = fcmp une float %36, %38 br i1 %39, label %then28, label %else29 then28: ; preds = %ifcont27 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont30 else29: ; preds = %ifcont27 br label %ifcont30 ifcont30: ; preds = %else29, %then28 %40 = load i32, i32* %i, align 4 %41 = sitofp i32 %40 to float %42 = load float, float* %r, align 4 %43 = fcmp une float %41, %42 br i1 %43, label %then31, label %else32 then31: ; preds = %ifcont30 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @23, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont33 else32: ; preds = %ifcont30 br label %ifcont33 ifcont33: ; preds = %else32, %then31 %44 = load i32, i32* %i, align 4 %45 = add i32 %44, 1 %46 = load i32, i32* %i, align 4 %47 = icmp sle i32 %45, %46 br i1 %47, label %then34, label %else35 then34: ; preds = %ifcont33 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont36 else35: ; preds = %ifcont33 br label %ifcont36 ifcont36: ; preds = %else35, %then34 %48 = load float, float* %r, align 4 %49 = fadd float %48, 1.000000e+00 %50 = load float, float* %r, align 4 %51 = fcmp ole float %49, %50 br i1 %51, label %then37, label %else38 then37: ; preds = %ifcont36 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @27, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont39 else38: ; preds = %ifcont36 br label %ifcont39 ifcont39: ; preds = %else38, %then37 %52 = load float, float* %r, align 4 %53 = fadd float %52, 1.000000e+00 %54 = load i32, i32* %i, align 4 %55 = sitofp i32 %54 to float %56 = fcmp ole float %53, %55 br i1 %56, label %then40, label %else41 then40: ; preds = %ifcont39 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @29, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @28, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont42 else41: ; preds = %ifcont39 br label %ifcont42 ifcont42: ; preds = %else41, %then40 %57 = load i32, i32* %i, align 4 %58 = add i32 %57, 1 %59 = sitofp i32 %58 to float %60 = load float, float* %r, align 4 %61 = fcmp ole float %59, %60 br i1 %61, label %then43, label %else44 then43: ; preds = %ifcont42 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @31, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont45 else44: ; preds = %ifcont42 br label %ifcont45 ifcont45: ; preds = %else44, %then43 %62 = load i32, i32* %i, align 4 %63 = load i32, i32* %i, align 4 %64 = add i32 %63, 1 %65 = icmp sge i32 %62, %64 br i1 %65, label %then46, label %else47 then46: ; preds = %ifcont45 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @33, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @32, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont48 else47: ; preds = %ifcont45 br label %ifcont48 ifcont48: ; preds = %else47, %then46 %66 = load float, float* %r, align 4 %67 = load float, float* %r, align 4 %68 = fadd float %67, 1.000000e+00 %69 = fcmp oge float %66, %68 br i1 %69, label %then49, label %else50 then49: ; preds = %ifcont48 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @35, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @34, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont51 else50: ; preds = %ifcont48 br label %ifcont51 ifcont51: ; preds = %else50, %then49 %70 = load float, float* %r, align 4 %71 = load i32, i32* %i, align 4 %72 = add i32 %71, 1 %73 = sitofp i32 %72 to float %74 = fcmp oge float %70, %73 br i1 %74, label %then52, label %else53 then52: ; preds = %ifcont51 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @37, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont54 else53: ; preds = %ifcont51 br label %ifcont54 ifcont54: ; preds = %else53, %then52 %75 = load i32, i32* %i, align 4 %76 = sitofp i32 %75 to float %77 = load float, float* %r, align 4 %78 = fadd float %77, 1.000000e+00 %79 = fcmp oge float %76, %78 br i1 %79, label %then55, label %else56 then55: ; preds = %ifcont54 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @39, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont57 else56: ; preds = %ifcont54 br label %ifcont57 ifcont57: ; preds = %else56, %then55 %80 = load i32, i32* %i, align 4 %81 = load i32, i32* %i, align 4 %82 = add i32 %81, 1 %83 = icmp eq i32 %80, %82 br i1 %83, label %then58, label %else59 then58: ; preds = %ifcont57 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @40, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont60 else59: ; preds = %ifcont57 br label %ifcont60 ifcont60: ; preds = %else59, %then58 %84 = load float, float* %r, align 4 %85 = load float, float* %r, align 4 %86 = fadd float %85, 1.000000e+00 %87 = fcmp oeq float %84, %86 br i1 %87, label %then61, label %else62 then61: ; preds = %ifcont60 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @43, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont63 else62: ; preds = %ifcont60 br label %ifcont63 ifcont63: ; preds = %else62, %then61 %88 = load float, float* %r, align 4 %89 = load i32, i32* %i, align 4 %90 = add i32 %89, 1 %91 = sitofp i32 %90 to float %92 = fcmp oeq float %88, %91 br i1 %92, label %then64, label %else65 then64: ; preds = %ifcont63 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @45, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @44, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont66 else65: ; preds = %ifcont63 br label %ifcont66 ifcont66: ; preds = %else65, %then64 %93 = load i32, i32* %i, align 4 %94 = sitofp i32 %93 to float %95 = load float, float* %r, align 4 %96 = fadd float %95, 1.000000e+00 %97 = fcmp oeq float %94, %96 br i1 %97, label %then67, label %else68 then67: ; preds = %ifcont66 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @47, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @46, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont69 else68: ; preds = %ifcont66 br label %ifcont69 ifcont69: ; preds = %else68, %then67 br label %return return: ; preds = %ifcont69 br label %FINALIZE_SYMTABLE_types_06 FINALIZE_SYMTABLE_types_06: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) lfortran-0.63.0/tests/reference/asr-nested_02-8302041.stdout0000664000175000017500000001317615174404631023361 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nested_02: (Program (SymbolTable 5 { b: (ExternalSymbol 5 b 2 b nested_02_a [] b Public ) }) nested_02 [nested_02_a] [(SubroutineCall 5 b () [] () .false. )] ), nested_02_a: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { c: (Function (SymbolTable 4 { }) c (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(IntegerConstant 5 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) b (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "b()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (SubroutineCall 3 c () [] () .false. )] () Public .false. .false. () ) }) nested_02_a () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/llvm-write3-49c0266.stdout0000664000175000017500000000561115174404631023267 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c" \00", align 1 @1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [11 x i8] c"Hello World" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([11 x i8], [11 x i8]* @string_const_data, i32 0, i32 0), i64 11 }> @2 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %2 = call i8* @_lfortran_get_default_allocator() %lfortran_iomsg = alloca %string_descriptor, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store %string_descriptor zeroinitializer, %string_descriptor* %lfortran_iomsg, align 1 %3 = getelementptr %string_descriptor, %string_descriptor* %lfortran_iomsg, i32 0, i32 1 store i64 0, i64* %3, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %lfortran_iomsg, i32 0, i32 0 %5 = call i8* @_lfortran_get_default_allocator() %6 = call i8* @_lfortran_malloc_alloc(i8* %5, i64 1) store i8* %6, i8** %4, align 8 %nwrite = alloca i32, align 4 store i32 6, i32* %nwrite, align 4 store i32 6, i32* %nwrite, align 4 %7 = load i32, i32* %nwrite, align 4 %8 = alloca i32*, align 8 store i32* null, i32** %8, align 8 %9 = load i32*, i32** %8, align 8 %10 = call i32 @_lfortran_get_decimal_mode(i32 %7) %11 = call i32 @_lfortran_get_sign_mode(i32 %7) %12 = call i32 @_lfortran_get_round_mode(i32 %7) %13 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void (i32, i32*, i8*, i64, ...) @_lfortran_file_write(i32 %7, i32* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @2, i32 0, i32 0), i64 4, i8* %13, i64 11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0), i64 1) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return br label %Finalize_Variable_lfortran_iomsg Finalize_Variable_lfortran_iomsg: ; preds = %FINALIZE_SYMTABLE_main %14 = getelementptr %string_descriptor, %string_descriptor* %lfortran_iomsg, i32 0, i32 0 %15 = load i8*, i8** %14, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %15) call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc_alloc(i8*, i64) declare i8* @_lfortran_get_default_allocator() declare i32 @_lfortran_get_decimal_mode(i32) declare i32 @_lfortran_get_sign_mode(i32) declare i32 @_lfortran_get_round_mode(i32) declare void @_lfortran_file_write(i32, i32*, i8*, i64, ...) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-functions_08-23f422a.json0000664000175000017500000000075615174404631023706 0ustar alastairalastair{ "basename": "asr-functions_08-23f422a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_08.f90", "infile_hash": "625582953de25dfa6d54c1e44d22b6e19394212ca99c252ca13236e2", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_08-23f422a.stdout", "stdout_hash": "cb618c051f579377542518d3c3c4e9bda5dad7782de9878a87a02240", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_simple_04-951e966.json0000664000175000017500000000100015174404631025002 0ustar alastairalastair{ "basename": "asr-template_simple_04-951e966", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_simple_04.f90", "infile_hash": "9135d05a49e578d5ff97175ca90b5e578583d4b5c319d5997b257f85", "outfile": null, "outfile_hash": null, "stdout": "asr-template_simple_04-951e966.stdout", "stdout_hash": "ddf9860a45fc82aecdb61051963f5b1c78d87a69e502e337ed060c84", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-string_03-bda189f.json0000664000175000017500000000076015174404631024025 0ustar alastairalastair{ "basename": "ast_f90-string_03-bda189f", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/string_03.f90", "infile_hash": "7815b8703dfd3a1c61cab40604e20693508878e8a90e450834ce592b", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-string_03-bda189f.stdout", "stdout_hash": "ac059e0d3e3e31416bd5100be58a185940adf3491bf7f86809967147", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-logical4-64da104.json0000664000175000017500000000072515174404631023067 0ustar alastairalastair{ "basename": "wat-logical4-64da104", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/logical4.f90", "infile_hash": "ea18762e8bbd163cb8b30960c719f953e2dfae041020c2f1066b3a35", "outfile": null, "outfile_hash": null, "stdout": "wat-logical4-64da104.stdout", "stdout_hash": "a35313a74d78b6aad86f524ddece4b224cb53af8c298cce7f3f07e96", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-expr_05-ee2fdac.json0000664000175000017500000000073015174404631023466 0ustar alastairalastair{ "basename": "julia-expr_05-ee2fdac", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/expr_05.f90", "infile_hash": "ab6fcfdb7d7b127b347b822368c1a3d22c7241a82453de78dd535c05", "outfile": null, "outfile_hash": null, "stdout": "julia-expr_05-ee2fdac.stdout", "stdout_hash": "7deee894fa5887f2a3c037b0ccee9c3981a7b3bc3ddc57440f6a9bca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-global_scope6-b11d04e.json0000664000175000017500000000073415174404631024157 0ustar alastairalastair{ "basename": "asr-global_scope6-b11d04e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope6.f90", "infile_hash": "3f2dfa122b78175565b7baa8f4d0417cfb0ed5bbe26bbb5f0f1f6f2e", "outfile": null, "outfile_hash": null, "stdout": "asr-global_scope6-b11d04e.stdout", "stdout_hash": "da88ffac17aa7249d290286768bf785f7f5880a12d4581a5fd82f468", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-array8-7572270.json0000664000175000017500000000070715174404631022445 0ustar alastairalastair{ "basename": "ast-array8-7572270", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/array8.f90", "infile_hash": "fee5e1c1b4525cfa5f4eb3102cbdfdb2959403009df4a8920e8d1347", "outfile": null, "outfile_hash": null, "stdout": "ast-array8-7572270.stdout", "stdout_hash": "c194d2a98f4a161d6c2c20c83490fc8166bceccb5ab4f439fa5cdf8a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-associate_04-97f4e70.json0000664000175000017500000000076115174404631024050 0ustar alastairalastair{ "basename": "llvm-associate_04-97f4e70", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/associate_04.f90", "infile_hash": "902a12c91e1df67575c96534b3b5a55ca93e85aa0777e689ecc1334c", "outfile": null, "outfile_hash": null, "stdout": "llvm-associate_04-97f4e70.stdout", "stdout_hash": "29e561c66bb1202d565380fe6249881fc42703c0dc90d7c6e147c74c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_shape_02-d196aa4.json0000664000175000017500000000074615174404631024253 0ustar alastairalastair{ "basename": "asr-array_shape_02-d196aa4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_shape_02.f90", "infile_hash": "4ba934bc62b338ae381400a5ccbac953acdf938e36b87038134b372c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_shape_02-d196aa4.stderr", "stderr_hash": "af7870ea4a4a3795f6cf089c797aaf9fdc32500d1e866d0f797d3b64", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-modules_43-d01691f.json0000664000175000017500000000075015174404631023346 0ustar alastairalastair{ "basename": "asr-modules_43-d01691f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_43.f90", "infile_hash": "ee51c0425b99849f984c011dfe475584384af4099c822103232f5b9f", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_43-d01691f.stdout", "stdout_hash": "65c1ac20d4e8b656dcf55354c900dab2af8eff160902523b0c0d8aec", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-array8-f50328f.stdout0000664000175000017500000000015315174404631023627 0ustar alastairalastairprogram array8 implicit none character(len=255) :: a(4) character :: b(4)*255, c(4)*255 end program array8 lfortran-0.63.0/tests/reference/ast-template_03b-6812e13.stdout0000664000175000017500000005147415174404631024152 0ustar alastairalastair(TranslationUnit [(Program template_03 (TriviaNode [(EndOfLine) (EndOfLine)] [] ) [] [] [(Requirement op [T U V op] [(DerivedType T [] () [(SimpleAttribute AttrDeferred )] [] [] ) (DerivedType U [] () [(SimpleAttribute AttrDeferred )] [] [] ) (DerivedType V [] () [(SimpleAttribute AttrDeferred )] [] [] )] [(Function op [(a) (b)] [(SimpleAttribute AttrElemental )] op () () [] [] [] [(Declaration (AttrType TypeType [] () T None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () U None ) [(AttrIntent In )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () V None ) [] [(op [] [] () () None ())] () )] [] [] [] )] ) (Template axpy_tmpl [T U V W plus times] [(Declaration () [(SimpleAttribute AttrPublic )] [(axpy [] [] () () None ())] () ) (Require [(UnitRequire op [(AttrNamelist V ) (AttrNamelist W ) (AttrNamelist V ) (AttrNamelist plus )] )] ) (Require [(UnitRequire op [(AttrNamelist T ) (AttrNamelist U ) (AttrNamelist W ) (AttrNamelist times )] )] )] [(Subroutine axpy [(a) (x) (y)] [] () () [] [] [] [(Declaration (AttrType TypeType [] () T None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () U None ) [(AttrIntent In )] [(x [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeType [] () V None ) [(AttrIntent InOut )] [(y [(() () DimensionExpr)] [] () () None ())] () )] [(Assignment 0 y (FuncCallOrArray plus [] [(() y () 0) (() (FuncCallOrArray times [] [(() a () 0) (() x () 0)] [] [] [] ) () 0)] [] [] [] ) () )] [] [] )] )] [(SubroutineCall 0 f [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Function my_mul [(a) (b)] [(SimpleAttribute AttrElemental )] op () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(sp [] [] () (FuncCallOrArray kind [] [(() (Real "1.0") () 0)] [] [] [] ) Equal ())] () ) (Declaration (AttrType TypeReal [(() sp Value)] () () None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() sp Value)] () () None ) [] [(op [] [] () () None ())] () )] [(Assignment 0 op (* a b) () )] [] [] ) (Function my_add [(a) (b)] [(SimpleAttribute AttrElemental )] op () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(sp [] [] () (FuncCallOrArray kind [] [(() (Real "1.0") () 0)] [] [] [] ) Equal ()) (dp [] [] () (FuncCallOrArray kind [] [(() (Real "1.d0") () 0)] [] [] [] ) Equal ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() sp Value)] () () None ) [(AttrIntent In )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [] [(op [] [] () () None ())] () )] [(Assignment 0 op (+ a b) () )] [] [] ) (Subroutine my_axpy [(a) (x) (y)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(sp [] [] () (FuncCallOrArray kind [] [(() (Real "1.0") () 0)] [] [] [] ) Equal ()) (dp [] [] () (FuncCallOrArray kind [] [(() (Real "1.d0") () 0)] [] [] [] ) Equal ())] () ) (Declaration (AttrType TypeReal [(() sp Value)] () () None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(x [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent InOut )] [(y [(() () DimensionExpr)] [] () () None ())] () )] [(Assignment 0 y (FuncCallOrArray my_add [] [(() y () 0) (() (FuncCallOrArray my_mul [] [(() a () 0) (() x () 0)] [] [] [] ) () 0)] [] [] [] ) () )] [] [] ) (Subroutine f [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(sp [] [] () (FuncCallOrArray kind [] [(() (Real "1.0") () 0)] [] [] [] ) Equal ()) (dp [] [] () (FuncCallOrArray kind [] [(() (Real "1.d0") () 0)] [] [] [] ) Equal ())] () ) (Instantiate axpy_tmpl [(AttrType TypeReal [(() sp Value)] () () None ) (AttrType TypeInteger [] () () None ) (AttrType TypeReal [(() dp Value)] () () None ) (AttrType TypeReal [(() sp Value)] () () None ) (AttrIntrinsicOperator PLUS ) (AttrIntrinsicOperator STAR )] [] ) (Declaration (AttrType TypeReal [(() sp Value)] () () None ) [] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(x [(1 3 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [] [(y [(1 3 DimensionExpr)] [] () () None ())] () )] [(Assignment 0 a (Real "0.5") () ) (Assignment 0 x 2 () ) (Assignment 0 y 2 () ) (SubroutineCall 0 axpy [] [(() a () 0) (() x () 0) (() y () 0)] [] [] (TriviaNode [] [(EndOfLine) (Comment "! call my_axpy(a, x, y) ! non-generic does not work too" )] ) )] [] [] )] )] ) lfortran-0.63.0/tests/reference/ast-types_07-54d4a85.stdout0000664000175000017500000001606115174404631023423 0ustar alastairalastair(TranslationUnit [(Program types_07 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrTarget )] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrPointer )] [(y [] [] () x Arrow ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrTarget )] [(a [(1 5 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrPointer )] [(b [(() () DimensionExpr)] [] () a Arrow ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Subroutine f [(s) (s2)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeCharacter [(len () Colon)] () () None ) [(SimpleAttribute AttrAllocatable ) (AttrIntent In )] [(s [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() () Colon)] () () None ) [(SimpleAttribute AttrAllocatable ) (AttrIntent In )] [(s2 [] [] () () None ())] () )] [] [] [] ) (Subroutine g [(s) (s2)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeCharacter [(len () Star)] () () None ) [(AttrIntent In )] [(s [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() () Star)] () () None ) [(AttrIntent In )] [(s2 [] [] () () None ())] () )] [] [] [] ) (Subroutine h [(s) (s2)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeCharacter [(len 80 Value)] () () None ) [(AttrIntent In )] [(s [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() 80 Value)] () () None ) [(AttrIntent In )] [(s2 [] [] () () None ())] () )] [] [] [] ) (Subroutine m [(s) (s2)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeCharacter [(len (+ 40 40) Value)] () () None ) [(AttrIntent In )] [(s [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() (- 100 20) Value)] () () None ) [(AttrIntent In )] [(s2 [] [] () () None ())] () )] [] [] [] )] )] ) lfortran-0.63.0/tests/reference/wat-wasm_main_program-7a34895.stdout0000664000175000017500000002250715174404631025407 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param i32) (result i32))) (type (;3;) (func (param) (result))) (type (;4;) (func (param i64) (result))) (type (;5;) (func (param f64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param i32) (result i32) (local i32) local.get 0 local.get 0 i32.mul local.set 1 local.get 1 return ) (func $3 (type 3) (param) (result) (local i32 f32 i32 f32 i32 f32) i32.const 3 local.set 2 i32.const 5 local.set 4 local.get 2 local.get 4 call 2 i32.mul local.set 0 local.get 0 i64.extend_i32_s call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop f32.const 3.140000 local.set 3 f32.const 5.000000 local.set 5 local.get 3 local.get 5 f32.mul local.get 5 f32.mul local.set 1 local.get 1 f64.promote_f32 call 5 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 5 f64.promote_f32 call 5 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 4 i64.extend_i32_s call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 240 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 1 f64.promote_f32 call 5 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 264 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $4 (type 4) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (func $5 (type 5) (param f64) (result) (local i64 i64 i64) local.get 0 f64.const 0.000000 f64.lt if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 f64.const -1.000000 f64.mul local.set 0 else end local.get 0 i64.trunc_f64_s call 4 i32.const 1 i32.const 40 i32.const 1 i32.const 0 call 1 drop local.get 0 local.get 0 i64.trunc_f64_s f64.convert_i64_s f64.sub f64.const 100000000.000000 f64.mul i64.trunc_f64_s local.set 2 local.get 2 local.set 3 i64.const 0 local.set 1 loop local.get 2 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 2 f64.convert_i64_s i64.const 10 f64.convert_i64_s f64.div i64.trunc_f64_s local.set 2 br 1 else end end loop local.get 1 i64.const 8 i64.lt_s if local.get 1 i64.const 1 i64.add local.set 1 i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop br 1 else end end local.get 3 call 4 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "sqr" (func 2)) (export "_start" (func 3)) (export "print_i64" (func 4)) (export "print_f64" (func 5)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\17\00\00\00") (data (;35;) (i32.const 216) "radius of the circle is ") (data (;36;) (i32.const 240) "\f8\00\00\00\0f\00\00\00") (data (;37;) (i32.const 248) "and its area is ") (data (;38;) (i32.const 264) "\10\01\00\00\04\00\00\00") (data (;39;) (i32.const 272) "cm^2") ) lfortran-0.63.0/tests/reference/asr-type_mismatch2-79a25db.stderr0000664000175000017500000000027715174404631024741 0ustar alastairalastairsemantic error: Type mismatch in binary operator, the types must be compatible --> tests/errors/type_mismatch2.f90:4:5 | 4 | x = 5 + "x" | ^ ^^^ type mismatch (integer and string) lfortran-0.63.0/tests/reference/asr-statement_03-99c9cd3.stdout0000664000175000017500000001736515174404631024356 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cumchn: (Function (SymbolTable 2 { dble: (Variable 2 dble [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dg: (Function (SymbolTable 4 { dg_return_var_name: (Variable 4 dg_return_var_name [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 4 i [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) dg (FunctionType [(Integer 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 i)] [(Assignment (Var 4 dg_return_var_name) (Cast (RealBinOp (RealConstant 2.000000 (Real 8) ) Mul (Cast (Var 4 i) IntegerToReal (Real 8) () () ) (Real 8) () ) RealToReal (Real 4) () () ) () .false. .false. )] (Var 4 dg_return_var_name) Public .false. .true. () ) }) cumchn (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .true. .true. () ), statement_03: (Program (SymbolTable 3 { }) statement_03 [] [(SubroutineCall 1 cumchn () [] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_error_07-e57f5fc.json0000664000175000017500000000075715174404631025103 0ustar alastairalastair{ "basename": "asr-template_error_07-e57f5fc", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_07.f90", "infile_hash": "457f8cc7d8a3e6c63b446a8f446e911d4c57b89692e0abe4448ed31b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_07-e57f5fc.stderr", "stderr_hash": "a6a43a0c3ac0c2f0d3917a73e56c56fbf38551314cdda44397599cb0", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-open_invalid_kwarg1-6af4cc2.json0000664000175000017500000000076515174404631025457 0ustar alastairalastair{ "basename": "asr-open_invalid_kwarg1-6af4cc2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/open_invalid_kwarg1.f90", "infile_hash": "9895f5bfe883839c27fe278179fb6d79d198260a40cb9854f70539ce", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-open_invalid_kwarg1-6af4cc2.stderr", "stderr_hash": "7ecd8f5906d20115acb3bf2fe83edfb36c417d7b97acf30c5e9e6c16", "returncode": 2 }lfortran-0.63.0/tests/reference/ast_f90-sync1-5d8b786.stdout0000664000175000017500000000052015174404631023466 0ustar alastairalastairprogram sync1 implicit none integer :: iam real :: x[*] iam = this_image() if (iam == 1) then x = 1.0 end if sync memory call external_sync() sync memory(stat = status) if (iam == 2) then write(*, *) x[1] end if if (this_image() == 1) then sync images(*) else sync images(1, stat = status) end if end program sync1 lfortran-0.63.0/tests/reference/llvm-const_real_dp-e0fca56.json0000664000175000017500000000076415174404631024535 0ustar alastairalastair{ "basename": "llvm-const_real_dp-e0fca56", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/const_real_dp.f90", "infile_hash": "636cd3c6b6c703b943b251bba6439b2675cd69fb82cd65a43513e971", "outfile": null, "outfile_hash": null, "stdout": "llvm-const_real_dp-e0fca56.stdout", "stdout_hash": "e46655177b7bd04727c51632bdd2bf3a744097bba5dee6b2d885b6f4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-program2-c0dd48f.json0000664000175000017500000000071515174404631023266 0ustar alastairalastair{ "basename": "ast-program2-c0dd48f", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/program2.f90", "infile_hash": "24e43f660d753021af8fd33127b7d99fe70e9604cbfb321f65ab146a", "outfile": null, "outfile_hash": null, "stdout": "ast-program2-c0dd48f.stdout", "stdout_hash": "650f87e1542d614b21f87989da924ede9e7ce475c907055906decdb6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-incorrect_allocate_for_array-b52ea30.json0000664000175000017500000000102015174404631027326 0ustar alastairalastair{ "basename": "asr-incorrect_allocate_for_array-b52ea30", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incorrect_allocate_for_array.f90", "infile_hash": "f60a82bb992ad3cff8f57805c5cae6793003e8814985af976f003a9d", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incorrect_allocate_for_array-b52ea30.stderr", "stderr_hash": "24447f7654ddd6077296652c946cb2297e5e050b1462240f1895a113", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-read1-fd137ad.stdout0000664000175000017500000000453115174404631023077 0ustar alastairalastair(TranslationUnit [(Program read1 (TriviaNode [(EndOfLine) (Comment "! AST only tests" )] [] ) [] [] [] [(Read 0 () [(()) (())] [] [a b] () ) (Read 0 () [] [(unit ()) (fmt ())] [a b] () ) (Read 0 () [(())] [(fmt ())] [a b] () ) (Read 0 () [(())] [] [b] () ) (Read 0 () [((FuncCallOrArray zone [] [(1 3 1 0)] [] [] [] )) ((String "(i3)" ()))] [] [hour] () ) (Read 0 () [(u)] [] [b] () ) (Read 0 () [(u)] [(fmt x)] [b c e] () ) (Read 0 () [(())] [(fmt x)] [b c e] () ) (Read 0 () [(iunit)] [(NML invar) (IOSTAT ierr)] [] () ) (Read 0 () [] [(UNIT iunit) (NML invar) (IOSTAT ierr)] [] () ) (Read 0 10 [] [] [] () ) (Read 0 10 [] [] [A B] () ) (Read 0 () [] [] [size] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-array_shape_02-d196aa4.stderr0000664000175000017500000000034315174404631024576 0ustar alastairalastairsemantic error: Incompatible shape of array on assignment on dimension 0 (3 and 2) --> tests/errors/array_shape_02.f90:2:1 | 2 | integer :: x(3,2) = reshape([1,2,3,4],[2,2]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-template_nested-5858841.json0000664000175000017500000000076715174404631024431 0ustar alastairalastair{ "basename": "asr-template_nested-5858841", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_nested.f90", "infile_hash": "b575d8ddebeed199be34078f7dfa99b5995ec81d1e730014775e9f5c", "outfile": null, "outfile_hash": null, "stdout": "asr-template_nested-5858841.stdout", "stdout_hash": "13e11581a1b66aca56bafef2ad16930d24765ccda24701d5e1e84d45", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-functions_06-83a7aca.json0000664000175000017500000000075615174404631024050 0ustar alastairalastair{ "basename": "asr-functions_06-83a7aca", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_06.f90", "infile_hash": "a20cae677eff1d64429785cf2a3bb41b5ef7dad2dccb1b5b3ab97858", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_06-83a7aca.stdout", "stdout_hash": "9829f74d36f1e61bff659d33912419a4d27148a83bff86b5e46fc8bb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-coarrays_02-6690b13.stdout0000664000175000017500000000204615174404631024465 0ustar alastairalastairprogram coarrays_02 ! Source https://j3-fortran.org/doc/year/18/18-007r1.pdf Page no - 541 use, intrinsic :: iso_fortran_env integer, allocatable :: node(:) ! tree nodes that this image handles. integer, allocatable :: nc(:) ! node(i) has nc(i) children. integer, allocatable :: parent(:), sub(:) ! the parent of node (i) is node (sub (i)) [parent (i)]. type(event_type), allocatable :: done(:)[:] integer :: i, j, status ! set up the tree, including allocation of all arrays. do i = 1, size(node) ! wait for children to complete if (nc(i) > 0) then event wait (done(i), until_count = nc(i), stat = status) if (status /= 0) then exit end if end if ! process node, using data from children. if (parent(i) > 0) then ! node is not the root. ! place result on image parent (i) for node node (sub) [parent (i)] ! tell parent (i) that this has been done. event post (done(sub(i))[parent(i)], stat = status) if (status /= 0) then exit end if end if end do end program coarrays_02 lfortran-0.63.0/tests/reference/asr-allocate_04-68facec.stdout0000664000175000017500000002606015174404631024257 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { allocate_04: (Program (SymbolTable 2 { c: (Variable 2 c [] Local () () Default (Allocatable (Array (Integer 4) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), message: (Variable 2 message [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), num: (Variable 2 num [] Local () () Default (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), string: (Variable 2 string [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) allocate_04 [] [(Allocate [((Var 2 string) [] (IntegerConstant 8 (Integer 4) Decimal) () (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString))] () () () ) (Allocate [((Var 2 message) [] (IntegerConstant 20 (Integer 4) Decimal) () (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString))] () () () ) (Allocate [((Var 2 c) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (Var 2 num) (StringConstant "lfortran" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 string) (IntrinsicElementalFunction StringTrim [(Var 2 num)] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) () .false. .false. ) (If () (StringCompare (Var 2 string) NotEq (StringConstant "lfortran" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 num) (StringConstant "lfortran working" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 message) (StringSection (Var 2 num) (IntegerConstant 1 (Integer 4) Decimal) (IntegerBinOp (IntrinsicElementalFunction StringLenTrim [(Var 2 num)] 0 (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntrinsicElementalFunction StringLenTrim [(Var 2 num)] 0 (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ExpressionLength DescriptorString) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 message)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-data_stmt_with_implied_do_loop-476da0f.stdout0000664000175000017500000000475615174404631030267 0ustar alastairalastair(TranslationUnit [(Program data_stmt_with_implied_do_loop () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(p [(1 1 DimensionExpr)] [] () () None ()) (c [(1 1 DimensionExpr) (1 1 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() 1 Value)] () () None ) [] [(ch [] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [(FuncCallOrArray p [] [(() 1 () 0)] [] [] [] ) (DataImpliedDo [(FuncCallOrArray c [] [(() 1 () 0) (() i () 0)] [] [] [] )] () i 1 1 () )] [31 12] )] () ) (DataStmt 0 [(DataStmtSet [ch] [(String "=" ())] )] () )] [] )] ) lfortran-0.63.0/tests/reference/ast_f90-if2-0c3bb72.stdout0000664000175000017500000000043315174404631023147 0ustar alastairalastairprogram expr2 implicit none integer :: x time = 12 if (time < 10) then ! Comment 1 print *, "Good morning" else if (time < 20) then ! Comment 2 print *, "Good day" else ! Comment 3 print *, "Good evening" end if end if ! Comment 4 end program expr2 lfortran-0.63.0/tests/reference/ast-loop_test4-17c3803.json0000664000175000017500000000073615174404631023410 0ustar alastairalastair{ "basename": "ast-loop_test4-17c3803", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/loop_test4.f", "infile_hash": "c096d4180aaa691479e1ff9a28223a68a1bfbe4782d5d0fdce56cd96", "outfile": null, "outfile_hash": null, "stdout": "ast-loop_test4-17c3803.stdout", "stdout_hash": "bec01955a197e961a77bf19803429c0cba356f40029a4359f7a0bf38", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-crlf1-374a66c.json0000664000175000017500000000073215174404631022404 0ustar alastairalastair{ "basename": "ast-crlf1-374a66c", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/crlf1.f", "infile_hash": "137ef00eb5d20b96070b7a3753e6f4e2967db640fd0fad4f8f1aeeae", "outfile": null, "outfile_hash": null, "stdout": "ast-crlf1-374a66c.stdout", "stdout_hash": "5c431e42c94dd4a2ace2993d025345a9569d13b65c84ff8613a54206", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_global_stmts-global_scope3-a36d20b.stdout0000664000175000017500000000422515174404631027460 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ), x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) [] ) lfortran-0.63.0/tests/reference/run-allocate_02-9086fdf.json0000664000175000017500000000070515174404631023570 0ustar alastairalastair{ "basename": "run-allocate_02-9086fdf", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/allocate_02.f90", "infile_hash": "9f5d3f4ea32ef514ce130d1862079e1c7ae51f2c8d1ad6b5f070cb90", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-allocate_02-9086fdf.stderr", "stderr_hash": "350b2c0840d488deb87c23e616dc33053401756a12e152c0166973ce", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-redeclaration1-9d7c988.stdout0000664000175000017500000000704115174404631024663 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { redeclare1: (Function (SymbolTable 2 { k: (Variable 2 k [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), piv: (Variable 2 piv [k] Unspecified () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 k))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) redeclare1 (FunctionType [(Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 1 (Integer 4) () ))] PointerArray ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 piv) (Var 2 k)] [] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/julia-arrays_01_size-b2012a6.json0000664000175000017500000000075515174404631024532 0ustar alastairalastair{ "basename": "julia-arrays_01_size-b2012a6", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/arrays_01_size.f90", "infile_hash": "cb58e1bbc81b8cb3e39e493299f8ce73339c3bfe6f97ec12ea102145", "outfile": null, "outfile_hash": null, "stdout": "julia-arrays_01_size-b2012a6.stdout", "stdout_hash": "96bd839b52ffb599968e87d55a73588f6b4b3c9c911a46a5d8dbe994", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-do7-8069d7a.json0000664000175000017500000000070115174404631022252 0ustar alastairalastair{ "basename": "llvm-do7-8069d7a", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/do7.f90", "infile_hash": "208cf89ff021dde72679466570c7a75054dfbec047dde672f22e8487", "outfile": null, "outfile_hash": null, "stdout": "llvm-do7-8069d7a.stdout", "stdout_hash": "532178cb249c6d5168d5678a8809ca29e37a81ebd4b8ab720298b4d9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-kind_star_of_complex-445a788.json0000664000175000017500000000077015174404631025515 0ustar alastairalastair{ "basename": "asr-kind_star_of_complex-445a788", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_star_of_complex.f90", "infile_hash": "ec644c8546cdd93e6feaaa8be9edac6c5dfc8f42193c206c9c240ec8", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_star_of_complex-445a788.stderr", "stderr_hash": "bffec4de1d8e74c0e674f7c2ca35078168082073fea045f4f1f01176", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-parameter_04-553ff5b.json0000664000175000017500000000075615174404631023746 0ustar alastairalastair{ "basename": "asr-parameter_04-553ff5b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/parameter_04.f90", "infile_hash": "f2aa1dc4b8d444f21facebf1ba278ce095935a979f72f56f29c08223", "outfile": null, "outfile_hash": null, "stdout": "asr-parameter_04-553ff5b.stdout", "stdout_hash": "cb2d715acf343a8aa690c9f2f916832f84281bcb15faae640cdd79fa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_flip_sign-expr_13-e24d940.stdout0000664000175000017500000006225015174404631025441 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { flip_sign_dead_code: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ap: (Variable 2 ap [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), bp: (Variable 2 bp [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), cp: (Variable 2 cp [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dp: (Variable 2 dp [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), eps: (Variable 2 eps [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), number: (Variable 2 number [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) flip_sign_dead_code [] [(Assignment (Var 2 number) (IntegerConstant 123 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 5.500000 (Real 4) ) () .false. .false. ) (If () (IntegerCompare (IntrinsicElementalFunction Modulo [(Var 2 number) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4) ) (Real 4) (RealConstant -5.500000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 number) (IntegerConstant 124 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 5.500000 (Real 4) ) () .false. .false. ) (If () (IntegerCompare (IntrinsicElementalFunction Modulo [(Var 2 number) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 ap) Eq (Var 2 bp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "ap == bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (If () (RealCompare (Var 2 cp) Eq (Var 2 dp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "cp == dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (If () (IntegerCompare (Var 2 a) Eq (Var 2 b) (Logical 4) () ) [(Print (StringConstant "a == b" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (IntegerCompare (Var 2 ap) Eq (Var 2 bp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "ap == bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(If () (RealCompare (Cast (Var 2 ap) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) Eq (Var 2 cp) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(Print (StringConstant "ap == cp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (RealCompare (Var 2 cp) Eq (Var 2 dp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "cp == dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(If () (RealCompare (Var 2 c) Eq (Var 2 d) (Logical 4) () ) [(Print (StringConstant "c == d" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] )] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-subroutines_01-d48abaa.stdout0000664000175000017500000003657215174404631025050 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { subroutines_01: (Program (SymbolTable 2 { f: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b)] [(Assignment (Var 3 b) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) subroutines_01 [] [(Assignment (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (SubroutineCall 2 f () [((Var 2 i)) ((Var 2 j))] () .false. ) (Print (StringFormat () [(Var 2 i) (Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (SubroutineCall 2 f () [((IntegerConstant 3 (Integer 4) Decimal)) ((Var 2 j))] () .false. ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (SubroutineCall 2 f () [((IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) )) ((Var 2 j))] () .false. ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (SubroutineCall 2 f () [((IntegerBinOp (Var 2 i) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((Var 2 j))] () .false. ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/pass_global_stmts-global_scope5-fb3716b.stdout0000664000175000017500000001171515174404631027475 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f2: (Variable 2 f2 [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] (Integer 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 f1) (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () ) () .false. .false. ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 f2) (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () ) () .false. .false. )] (Var 2 f2) Public .false. .false. () ), x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) [] ) lfortran-0.63.0/tests/reference/ast-doconcurrentloop_02-b8757f0.stdout0000664000175000017500000001217015174404631025652 0ustar alastairalastair(TranslationUnit [(Program doconcurrentloop_02 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 10 DimensionExpr)] )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(sum [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(N [] [] () () None ()) (i [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 N (FuncCallOrArray size [] [(() a () 0)] [] [] [] ) () ) (Assignment 0 sum 0 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () )] () [] [(Assignment 0 (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (+ (FuncCallOrArray a [] [(() (- i 1) () 0)] [] [] [] ) 5) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SubroutineCall 0 arraySum [] [(() a () 0) (() sum () 0)] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Subroutine arraySum [(a) (sum)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(sum [] [] () () None ())] () )] [(DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () )] () [(ConcurrentReduce ReduceAdd [s] )] [(Assignment 0 sum (+ sum (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () )] [] [] )] )] ) lfortran-0.63.0/tests/reference/ast-intent_01-fd00f62.json0000664000175000017500000000074515174404631023254 0ustar alastairalastair{ "basename": "ast-intent_01-fd00f62", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intent_01.f90", "infile_hash": "ecbce2d4b01a09bee24ec92ce8be335f75903e746d23a667806bf264", "outfile": null, "outfile_hash": null, "stdout": "ast-intent_01-fd00f62.stdout", "stdout_hash": "e05ed8c65f0aad32346e455f95ad971e8dd2bb2a4d84ef03fda672e9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-abs_01-0c0b4df.json0000664000175000017500000000071715174404631022576 0ustar alastairalastair{ "basename": "wat-abs_01-0c0b4df", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/abs_01.f90", "infile_hash": "36697d1e0196bbf7a46059f539b539a1454386697ab54a43e3c32791", "outfile": null, "outfile_hash": null, "stdout": "wat-abs_01-0c0b4df.stdout", "stdout_hash": "8248725e8ec936bf20fa8d03eefeb9388691eeb3e69e746776adf1df", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-coarray_01-5f111e4.stdout0000664000175000017500000001157415174404631023703 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { test: (Program (SymbolTable 2 { lfortran_iomsg: (Variable 2 lfortran_iomsg [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), val: (Variable 2 val [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test [] [(Assignment (Var 2 val) (IntrinsicElementalFunction ThisImage [] 0 (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) () .false. .false. ) (IntrinsicImpureSubroutine CoSum [(Var 2 val) (IntegerConstant 1 (Integer 4) Decimal)] 0 ) (If () (IntegerCompare (IntrinsicElementalFunction ThisImage [] 0 (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(FileWrite 0 (IntegerConstant 6 (Integer 4) Decimal) (Var 2 lfortran_iomsg) () () [(StringFormat () [(StringConstant "The sum is " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 val)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-namelist_01-a0d2302.stdout0000664000175000017500000000016615174404631024517 0ustar alastairalastairprogram namelist1 implicit none integer :: N real :: t, x, Ecut namelist /domain/ N, t, x, Ecut end program namelist1 lfortran-0.63.0/tests/reference/asr-modules_07-7f671c1.stdout0000664000175000017500000000703215174404631023723 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_07_mod: (Module (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local (IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal) Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local (IntegerConstant 7 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) modules_07_mod () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-implicit10-f531a25.json0000664000175000017500000000106615174404631023340 0ustar alastairalastair{ "basename": "asr-implicit10-f531a25", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit10.f90", "infile_hash": "f0dec4633ec4724235e11ed6642f34f24f69c6f4dc41aab5ae903cfa", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit10-f531a25.stdout", "stdout_hash": "d17241040f21363b7e20bc8642a8f862eb48b2fff817a14ba2c3cd61", "stderr": "asr-implicit10-f531a25.stderr", "stderr_hash": "5e0f52ad16423091b73b5dc0c5de3f43847ef3bf23e99f74475d49f6", "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-bindc3-d064ff7.json0000664000175000017500000000073715174404631023012 0ustar alastairalastair{ "basename": "llvm-bindc3-d064ff7", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/bindc3.f90", "infile_hash": "5641a25203f2b4025ab042a931b5f7f5978dd812c10833abf34bfd73", "outfile": null, "outfile_hash": null, "stdout": "llvm-bindc3-d064ff7.stdout", "stdout_hash": "b1921503d30e4aa1baee1b5c9136ac723db34167790af4b84fccd2ca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-data3-0afaffe.stdout0000664000175000017500000010005115174404631023226 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { datatest: (Program (SymbolTable 2 { axva: (Variable 2 axva [] Local (ComplexConstant -234.229996 3.000000 (Complex 4) ) (ComplexConstant -234.229996 3.000000 (Complex 4) ) Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), axvb: (Variable 2 axvb [] Local (ComplexConstant 2.000000 -3.000000 (Complex 4) ) (ComplexConstant 2.000000 -3.000000 (Complex 4) ) Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon01: (Variable 2 ivon01 [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon02: (Variable 2 ivon02 [] Local (IntegerConstant 76 (Integer 4) Decimal) (IntegerConstant 76 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon03: (Variable 2 ivon03 [] Local (IntegerConstant 587 (Integer 4) Decimal) (IntegerConstant 587 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon04: (Variable 2 ivon04 [] Local (IntegerConstant 9999 (Integer 4) Decimal) (IntegerConstant 9999 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon05: (Variable 2 ivon05 [] Local (IntegerConstant 21111 (Integer 4) Decimal) (IntegerConstant 21111 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon06: (Variable 2 ivon06 [] Local (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon07: (Variable 2 ivon07 [] Local (IntegerConstant 76 (Integer 4) Decimal) (IntegerConstant 76 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon08: (Variable 2 ivon08 [] Local (IntegerConstant 587 (Integer 4) Decimal) (IntegerConstant 587 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon09: (Variable 2 ivon09 [] Local (IntegerConstant 9999 (Integer 4) Decimal) (IntegerConstant 9999 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon10: (Variable 2 ivon10 [] Local (IntegerConstant 21111 (Integer 4) Decimal) (IntegerConstant 21111 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon11: (Variable 2 ivon11 [] Local (IntegerConstant -3 (Integer 4) Decimal) (IntegerConstant -3 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon12: (Variable 2 ivon12 [] Local (IntegerConstant -76 (Integer 4) Decimal) (IntegerConstant -76 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon13: (Variable 2 ivon13 [] Local (IntegerConstant -587 (Integer 4) Decimal) (IntegerConstant -587 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon14: (Variable 2 ivon14 [] Local (IntegerConstant -9999 (Integer 4) Decimal) (IntegerConstant -9999 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon15: (Variable 2 ivon15 [] Local (IntegerConstant -21111 (Integer 4) Decimal) (IntegerConstant -21111 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon16: (Variable 2 ivon16 [] Local (IntegerConstant 119 (Integer 4) Decimal) (IntegerConstant 119 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon17: (Variable 2 ivon17 [] Local (IntegerConstant 119 (Integer 4) Decimal) (IntegerConstant 119 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon18: (Variable 2 ivon18 [] Local (IntegerConstant 7 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon19: (Variable 2 ivon19 [] Local (IntegerConstant 7 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ivon20: (Variable 2 ivon20 [] Local (IntegerConstant -427 (Integer 4) Decimal) (IntegerConstant -427 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), vals: (Variable 2 vals [] Local (ArrayConstant 20 [2, 76, 587, 9999, 21111] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayConstant 20 [2, 76, 587, 9999, 21111] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) datatest [] [(Assignment (Var 2 ivon01) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon02) (IntegerConstant 76 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon03) (IntegerConstant 587 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon04) (IntegerConstant 9999 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon05) (IntegerConstant 21111 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon06) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon07) (IntegerConstant 76 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon08) (IntegerConstant 587 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon09) (IntegerConstant 9999 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon10) (IntegerConstant 21111 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon11) (IntegerConstant -3 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon12) (IntegerConstant -76 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon13) (IntegerConstant -587 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon14) (IntegerConstant -9999 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon15) (IntegerConstant -21111 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon16) (IntegerConstant 119 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon17) (IntegerConstant 119 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon18) (IntegerConstant 7 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon19) (IntegerConstant 7 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon20) (IntegerConstant -427 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 axva) (ComplexConstant -234.229996 3.000000 (Complex 4) ) () .false. .false. ) (Assignment (Var 2 axvb) (ComplexConstant 2.000000 -3.000000 (Complex 4) ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-modules_40-d3a41b5.stdout0000664000175000017500000007240715174404631023775 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_40: (Program (SymbolTable 8 { }) modules_40 [] [(Print (StringConstant "executing modules_40" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ), modules_40_tomlf_de_tokenizer: (Module (SymbolTable 2 { parse_select: (Function (SymbolTable 5 { de: (Variable 5 de [] InOut () () Default (StructType [] [] .false. .false. ) 2 toml_tokenizer Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), fill_stack: (Function (SymbolTable 6 { de: (Variable 6 de [] InOut () () Default (StructType [] [] .false. .false. ) 2 toml_tokenizer Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), stack: (Variable 6 stack [] Out () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), top: (Variable 6 top [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fill_stack (FunctionType [(StructType [] [] .false. .false. ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [resize] [(Var 6 de) (Var 6 top) (Var 6 stack)] [(WhileLoop () (LogicalConstant .true. (Logical 4) ) [(If () (IntegerCompare (Var 6 top) GtE (ArraySize (Var 6 stack) () (Integer 4) () ) (Logical 4) () ) [(SubroutineCall 5 resize () [((Var 6 stack)) (())] () .false. )] [] )] [] )] () Public .true. .true. () ), resize: (Function (SymbolTable 7 { n: (Variable 7 n [] In () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), stack: (Variable 7 stack [] InOut () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) resize (FunctionType [(Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 stack) (Var 7 n)] [] () Public .true. .true. () ) }) parse_select (FunctionType [(StructType [] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 de)] [] () Public .true. .true. () ), tfc: (Variable 2 tfc [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), toml_key: (Struct (SymbolTable 3 { key: (Variable 3 key [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_key (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [key] [] Source Public .false. .false. [] () () [] ), toml_tokenizer: (Struct (SymbolTable 4 { parse_select: (StructMethodDeclaration 4 parse_select () parse_select 2 parse_select Source .false. .false. ) }) toml_tokenizer (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .true. [] () () [] ) }) modules_40_tomlf_de_tokenizer () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/cpp-arrays_04_func-68b1437.stdout0000664000175000017500000000344615174404631024506 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct f32_3_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; f32_3_1(Kokkos::View* data_): data{data_} {}; }; // Forward declarations namespace { float abs(float a); template float sum(T0* a); } // Implementations namespace { float abs(float a) { float r; std::cout<< "abs"< (float)(0)) { r = a; } else { r = -a; } return r; } template float sum(T0* a) { int32_t i; float r; std::cout<< "sum"<data->extent(0); i++) { r = r + a->data->operator[](i - a->dims[0].lower_bound); } return r; } void main2() { Kokkos::View a_data("a_data", 3); f32_3_1 a_value(&a_data); f32_3_1* a = &a_value; a->dims[0].lower_bound = 1; a->dims[0].length = 3; float b; a->data->operator[](1 - a->dims[0].lower_bound) = (float)(3); a->data->operator[](2 - a->dims[0].lower_bound) = (float)(2); a->data->operator[](3 - a->dims[0].lower_bound) = (float)(1); b = sum(a); if (abs(b - (float)(6)) > 9.99999974737875164e-06) { std::cerr << "ERROR STOP" << std::endl; exit(1); } } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/ast-else1-9f4f4b8.stdout0000664000175000017500000000703115174404631023047 0ustar alastairalastair(TranslationUnit [(Subroutine fun1 [] [] () () [] [] [] [] [(If 0 () (> (FuncCallOrArray abs [] [(() bjv0 () 0)] [] [] [] ) (FuncCallOrArray abs [] [(() bjv1 () 0)] [] [] [] )) [(Assignment 0 cs (/ bjv0 f) () )] [] () () () ) (Assignment 0 elsecs (/ bjv1 f2) () )] [] [] ) (Subroutine fun2 [] [] () () [] [] [] [] [(If 0 () (Logical .true. ()) [(Assignment 0 x 1 () ) (If 0 () (> (FuncCallOrArray abs [] [(() bjv0 () 0)] [] [] [] ) (FuncCallOrArray abs [] [(() bjv1 () 0)] [] [] [] )) [(Assignment 0 cs (/ bjv0 f) () )] [] () () () ) (Assignment 0 elsecs (/ bjv1 f2) () )] [] () () () )] [] [] ) (Subroutine fun3 [] [] () () [] [] [] [] [(If 0 () (Logical .true. ()) [(Assignment 0 x 1 () ) (If 0 () (> (FuncCallOrArray abs [] [(() bjv0 () 0)] [] [] [] ) (FuncCallOrArray abs [] [(() bjv1 () 0)] [] [] [] )) [(Assignment 0 cs (/ bjv0 f) () )] [(Assignment 0 cs (/ bjv1 f2) () )] () () () )] [] () () () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-int_03-924441d.json0000664000175000017500000000073415174404631022407 0ustar alastairalastair{ "basename": "asr-int_03-924441d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/int_03.f90", "infile_hash": "69361b73ce809045078054701961e773c98f6ba5a26ef9240a24bb80", "outfile": null, "outfile_hash": null, "stdout": "asr-int_03-924441d.stdout", "stdout_hash": "68ac4eb0d8bdbf3bc36b65f46b41e803106cc646c5ed2cff5d99948c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-realloc_lhs_20-ef3baef.stderr0000664000175000017500000000041215174404631025025 0ustar alastairalastairruntime error: Array 'b%arr' is not allocated. Allocate it manually or use the '--realloc-lhs-arrays' option to allocate it automatically. --> tests/../integration_tests/realloc_lhs_20.f90:12:5 | 12 | b%arr = a%arr | ^^^^^ 'b%arr' not allocated here lfortran-0.63.0/tests/reference/asr-doloop_02-cc78975.json0000664000175000017500000000074515174404631023210 0ustar alastairalastair{ "basename": "asr-doloop_02-cc78975", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_02.f90", "infile_hash": "3f887434509231f48fbbbda31f34778f17ddb6871b39c44626d54f2e", "outfile": null, "outfile_hash": null, "stdout": "asr-doloop_02-cc78975.stdout", "stdout_hash": "151d232be7aff23b9c5f09ab286333f2f9b091fa10813bb926e71105", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_10-cfca9b9.stdout0000664000175000017500000000415515174404631024657 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_10: (Program (SymbolTable 2 { x: (Variable 2 x [] Local (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_10 [] [(Print (StringFormat () [(IntrinsicElementalFunction Real [(Var 2 x)] 0 (Real 4) (RealConstant 3.000000 (Real 4) ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/run-format_57-fd2be24.json0000664000175000017500000000071515174404631023351 0ustar alastairalastair{ "basename": "run-format_57-fd2be24", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_57.f90", "infile_hash": "122558608e06e05832cd183e40a6b9584f427d755c1e40a9f83b8f02", "outfile": null, "outfile_hash": null, "stdout": "run-format_57-fd2be24.stdout", "stdout_hash": "e442ff42ea9a10ae767fd7c4db819c36ce1e0c2dd6a26b01f20cc1f9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-save2-63c8bcc.json0000664000175000017500000000102015174404631022540 0ustar alastairalastair{ "basename": "asr-save2-63c8bcc", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/save2.f90", "infile_hash": "94b2d712cd16fab489e1cd6d8d1d36d005aed23e1ed44b2335109fe3", "outfile": null, "outfile_hash": null, "stdout": "asr-save2-63c8bcc.stdout", "stdout_hash": "b9bdd1ca80626b0bfd2698347eba18a48db520f947dca460dff8aedf", "stderr": "asr-save2-63c8bcc.stderr", "stderr_hash": "2dc6a73d91f1eb0b136e2d0d2b5f9480c691b51e487d0f8d955b659e", "returncode": 0 }lfortran-0.63.0/tests/reference/run-scalar_allocation_check_04-024d591.stderr0000664000175000017500000000026015174404631026765 0ustar alastairalastairruntime error: Argument 1 of subroutine ff is unallocated. --> tests/errors/scalar_allocation_check_04.f90:3:13 | 3 | call ff(xx) | ^^ This is unallocated lfortran-0.63.0/tests/reference/asr-nested_namelist_01-7fc4952.json0000664000175000017500000000100015174404631025044 0ustar alastairalastair{ "basename": "asr-nested_namelist_01-7fc4952", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_namelist_01.f90", "infile_hash": "3ae593ad78ac4bbac6d58d1dd1f8ee532e6cf64aef681fa7f311c7e2", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_namelist_01-7fc4952.stdout", "stdout_hash": "2caa5a96702407b8007ad996a4e53fdfc6ea332dda750439ba38aae2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-expr_09-fa1b124.json0000664000175000017500000000072215174404631022731 0ustar alastairalastair{ "basename": "wat-expr_09-fa1b124", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/expr_09.f90", "infile_hash": "3b99f849ef5412d7fbc16bc164307d14964150e05dd203596a3e6dd8", "outfile": null, "outfile_hash": null, "stdout": "wat-expr_09-fa1b124.stdout", "stdout_hash": "ab04339a5ed742704119e5c3c44a4b56c0d3e6c0dc991616b8fe90fe", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-integerStringInput_64-3a7e5be.stderr0000664000175000017500000000005415174404631026254 0ustar alastairalastairError: Invalid input for int64_t from file. lfortran-0.63.0/tests/reference/asr-iostat_constant_integer-4f6f5d4.json0000664000175000017500000000100115174404631026377 0ustar alastairalastair{ "basename": "asr-iostat_constant_integer-4f6f5d4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/iostat_constant_integer.f90", "infile_hash": "75139205f9e51e237d4b413809a7001dd54192e2c243a3523c0236a5", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-iostat_constant_integer-4f6f5d4.stderr", "stderr_hash": "ac3a5c6e466d47baa24ef5636670716a1804de34604e5dccba05b530", "returncode": 2 }lfortran-0.63.0/tests/reference/pass_init_expr-array13-db4fb0f.json0000664000175000017500000000076115174404631025333 0ustar alastairalastair{ "basename": "pass_init_expr-array13-db4fb0f", "cmd": "lfortran --pass=init_expr --show-asr --no-color {infile} -o {outfile}", "infile": "tests/array13.f90", "infile_hash": "9a8fc967d5ae775229d7d6e3fff0a1927b7bc3ec0b5209bedf864ff8", "outfile": null, "outfile_hash": null, "stdout": "pass_init_expr-array13-db4fb0f.stdout", "stdout_hash": "94782297b898f9aaf9d1d7cf490474aa0aaded260140cc9e9d9e0c04", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-string_allocation_01-8484aaf.stderr0000664000175000017500000000006215174404631026035 0ustar alastairalastairLFORTRAN ERROR: Allocating string with length < 0 lfortran-0.63.0/tests/reference/asr-duplicate_module_procedures-3eaed23.json0000664000175000017500000000101515174404631027271 0ustar alastairalastair{ "basename": "asr-duplicate_module_procedures-3eaed23", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/duplicate_module_procedures.f90", "infile_hash": "3a9e11036265ddc79e565af9c00310f2d8d7235a45c7c805375832bd", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-duplicate_module_procedures-3eaed23.stderr", "stderr_hash": "38d21afeae8536898184a80cf9b870afed4bd09bc105d7be51f34fbe", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-expr5-00f7fd9.json0000664000175000017500000000070715174404631022707 0ustar alastairalastair{ "basename": "llvm-expr5-00f7fd9", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/expr5.f90", "infile_hash": "030f3f956944c6d24d536fd1f434f877d95bf12aac6f367d2ad1827e", "outfile": null, "outfile_hash": null, "stdout": "llvm-expr5-00f7fd9.stdout", "stdout_hash": "99ea41baf2b3077e169c233e08c0cedc080eb6f89f904424a5f7b11e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-array5-2cde105.stdout0000664000175000017500000000475015174404631023223 0ustar alastairalastair(TranslationUnit [(Program array5 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 3 DimensionExpr)] )] [(a [] [] () () None ()) (b [] [] () () None ()) (c [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(e [(1 0 DimensionExpr)] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 a (ArrayInitializer () () [1 2 3] ) () ) (Assignment 0 b (ArrayInitializer () () [1 2 3] ) () ) (Assignment 0 c (ArrayInitializer (AttrType TypeReal [] () () None ) () [1 2 3] ) () ) (Assignment 0 e (ArrayInitializer (AttrType TypeReal [] () () None ) () [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/asr-character2-bc7e2ce.json0000664000175000017500000000072315174404631023626 0ustar alastairalastair{ "basename": "asr-character2-bc7e2ce", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/character2.f90", "infile_hash": "97195d2054dbf5075a24b846fcd7dcc115ef93398243c901c04a3951", "outfile": null, "outfile_hash": null, "stdout": "asr-character2-bc7e2ce.stdout", "stdout_hash": "bc2b57e94fa19cdb6be4e9ce1a658a590762bbdeb8a83f7007c12f56", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixed_form_implicit3-7f279ac.json0000664000175000017500000000077415174404631025567 0ustar alastairalastair{ "basename": "ast-fixed_form_implicit3-7f279ac", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_implicit3.f", "infile_hash": "de7925b8e456615be2803bb7b49c366b8910e85dce4727bdbfcfe1b5", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_implicit3-7f279ac.stdout", "stdout_hash": "bb3c3b53729836c8af738d245c1dd071d7e27292a1d04b1a14ad56cc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-nested_struct_proc_01-3b9017b.json0000664000175000017500000000101115174404631025565 0ustar alastairalastair{ "basename": "asr-nested_struct_proc_01-3b9017b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_struct_proc_01.f90", "infile_hash": "8a662720d113b97e4852f55c5784ac8f1397c5d43e1a49097bb18c4f", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_struct_proc_01-3b9017b.stdout", "stdout_hash": "f5909962d95f4d4f22a096c737b90e1e2ced7f811cf525d291c262d7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-if_04-1d3b97a.stdout0000664000175000017500000001535115174404631022733 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32) i32.const 1 local.set 0 local.get 0 i32.const 1 i32.eq if i32.const 1 i32.const 100 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else local.get 0 i32.const 2 i32.eq if i32.const 1 i32.const 112 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else local.get 0 i32.const 3 i32.eq if i32.const 1 i32.const 124 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else local.get 0 i32.const 4 i32.eq if i32.const 1 i32.const 136 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else end end end end local.get 0 i32.const 1 i32.eq if i32.const 1 i32.const 100 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else local.get 0 i32.const 2 i32.eq if i32.const 1 i32.const 112 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else local.get 0 i32.const 3 i32.eq if i32.const 1 i32.const 124 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else local.get 0 i32.const 4 i32.eq if i32.const 1 i32.const 136 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop end end end end i32.const 0 call 0 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\08\00\00\00") (data (;35;) (i32.const 216) "Invalid!") ) lfortran-0.63.0/tests/reference/llvm-global_scope4-10fa534.json0000664000175000017500000000073715174404631024270 0ustar alastairalastair{ "basename": "llvm-global_scope4-10fa534", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/global_scope4.f90", "infile_hash": "da0256e95ad866af376d9ded3cd439463cb1e47dffac6aa88c0bbadf", "outfile": null, "outfile_hash": null, "stdout": "llvm-global_scope4-10fa534.stdout", "stdout_hash": "60e13c1121d2031cbc028ead9b19da83a8f74d585aeed58a7a5b6380", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_triple-54fa485.json0000664000175000017500000000076715174404631024600 0ustar alastairalastair{ "basename": "asr-template_triple-54fa485", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_triple.f90", "infile_hash": "5d7a3ab9825f5285b40ca4edf152dc13eda9163c4892dd5a690f645b", "outfile": null, "outfile_hash": null, "stdout": "asr-template_triple-54fa485.stdout", "stdout_hash": "6e382edc4c8027719eab0e450e27b94d851090f25c352082212e6356", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-continue_compilation_ff_1-c2d5950.stdout0000664000175000017500000012074515174404631027066 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { continue_compilation_1_mod: (Module (SymbolTable 2 { f: (Function (SymbolTable 3 { f: (Variable 3 f [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 3 x [] In () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Integer 4)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [(Assignment (Var 3 f) (IntrinsicElementalFunction Present [(Var 3 x)] 0 (Logical 4) () ) () .false. .false. )] (Var 3 f) Public .true. .true. () ) }) continue_compilation_1_mod () [] .false. .false. .false. ), continue_compilation_ff: (Program (SymbolTable 4 { a: (Variable 4 a [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a_2: (Variable 4 a_2 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a_3: (Variable 4 a_3 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a_4: (Variable 4 a_4 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a_5: (Variable 4 a_5 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), circlearea: (Variable 4 circlearea [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i_1: (Variable 4 i_1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i_2: (Variable 4 i_2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i_3: (Variable 4 i_3 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ij: (Variable 4 ij [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), image: (Variable 4 image [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 600 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 450 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), init_x: (Variable 4 init_x [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 4 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j_1: (Variable 4 j_1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), kindvar: (Variable 4 kindvar [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), nx: (Variable 4 nx [] Local (IntegerConstant 600 (Integer 4) Decimal) (IntegerConstant 600 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ny: (Variable 4 ny [] Local (IntegerConstant 450 (Integer 4) Decimal) (IntegerConstant 450 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), shape: (Variable 4 shape [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), size_a: (Variable 4 size_a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), size_a_2: (Variable 4 size_a_2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), str: (Variable 4 str [] Local (StringConstant "Hello " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "Hello " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), val: (Variable 4 val [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), var: (Variable 4 var [] Local (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x_2: (Variable 4 x_2 [] Local () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x_3: (Variable 4 x_3 [] Local () () Default (Allocatable (Array (Real 8) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y_1: (Variable 4 y_1 [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y_2: (Variable 4 y_2 [] Local () () Default (Pointer (Array (Integer 2) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y_3: (Variable 4 y_3 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y_4: (Variable 4 y_4 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) continue_compilation_ff [] [(FileClose 0 (IntegerConstant 200 (Integer 4) Decimal) () () () () ) (Assignment (Var 4 x_2) (StringConstant "u" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 4 i) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (If () (IntegerCompare (Var 4 i) Gt (IntrinsicElementalFunction Ichar [(Var 4 x_2)] 0 (Integer 4) () ) (Logical 4) () ) [] [] ) (Assignment (Var 4 size_a) (ArraySize (Var 4 a_2) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_error_09-8d590f9.stderr0000664000175000017500000000034015174404631025267 0ustar alastairalastairsemantic error: Operator `==` undefined for the types in the expression `t == t` --> tests/errors/template_error_09.f90:21:20 | 21 | prop = bin(x,y) == bin(y,x) | ^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-integer16-eab0df9.stderr0000664000175000017500000000016715174404631023752 0ustar alastairalastairsyntax error: kind 16 is not supported yet. --> tests/errors/integer16.f90:2:2 | 2 | integer*16 x | ^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-assign_to2-127a642.stdout0000664000175000017500000002025415174404631023726 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), next: (Variable 2 next [] Local () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), sum: (Variable 2 sum [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zero: (Variable 2 zero [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) main [] [(GoToTarget 10 10 ) (Assignment (Var 2 next) (IntegerConstant 30 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 sum) (Var 2 zero) () .false. .false. ) (Assignment (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (GoToTarget 20 20 ) (Select () (Var 2 next) [(CaseStmt [(IntegerConstant 30 (Integer 4) Decimal)] [(GoTo 30 30 )] .false. ) (CaseStmt [(IntegerConstant 50 (Integer 4) Decimal)] [(GoTo 50 50 )] .false. ) (CaseStmt [(IntegerConstant 70 (Integer 4) Decimal)] [(GoTo 70 70 )] .false. )] [] .false. ) (GoToTarget 30 30 ) (If () (IntegerCompare (IntegerConstant 0 (Integer 4) Decimal) Lt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(GoTo 70 70 )] [] ) (GoToTarget 50 50 ) (Print (StringFormat () [(IntegerConstant 50 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 next) (IntegerConstant 50 (Integer 4) Decimal) () .false. .false. ) (GoToTarget 70 70 ) (Print (StringFormat () [(IntegerConstant 70 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-complex_01-075c0b7.json0000664000175000017500000000073215174404631023334 0ustar alastairalastair{ "basename": "asr-complex_01-075c0b7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/complex_01.f90", "infile_hash": "64e3a5939b32727865bb468781be815efa91bfd342a9340ce4514c0d", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-complex_01-075c0b7.stderr", "stderr_hash": "fcbb361eb41ff9b3f71c50e7f9dc21e7dc4c7df3b6155e6fe470b54a", "returncode": 2 }lfortran-0.63.0/tests/reference/cpp-types_03-dc774f0.stdout0000664000175000017500000000135115174404631023466 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t i; float r; r = 1.50000000000000000e+00; std::cout << r << std::endl; i = (int32_t)(r); std::cout << i << std::endl; } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/ast-types_10-8a81911.stdout0000664000175000017500000001266415174404631023340 0ustar alastairalastair(TranslationUnit [(Program types_10 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Declaration () [(SimpleAttribute AttrSave )] [(i [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrSave )] [(j [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Subroutine f [(i)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrSave )] [(j [] [] () () None ())] () )] [(Assignment 0 j i () )] [] [] ) (Subroutine g [(i)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(j [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrSave )] [(j [] [] () () None ())] () )] [(Assignment 0 j i () )] [] [] ) (Subroutine h [(i)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(j [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrSave )] [] () )] [(Assignment 0 j i () )] [] [] )] )] ) lfortran-0.63.0/tests/reference/asr-functions_12-235fd97.json0000664000175000017500000000075615174404631023721 0ustar alastairalastair{ "basename": "asr-functions_12-235fd97", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_12.f90", "infile_hash": "b0c5ee3ef02b2ff06fd9e184908e08c2c7c2753dbca9c55205be065b", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_12-235fd97.stdout", "stdout_hash": "c1c175bcaa67a7317e8e18e86b540a2885581ee6387a00050786159b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-allocated_05-d9e0943.json0000664000175000017500000000071015174404631023646 0ustar alastairalastair{ "basename": "run-allocated_05-d9e0943", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/allocated_05.f90", "infile_hash": "06e26c9602e3608378d62fe2e84bb74ddd344d2d5c988fe08778dbce", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-allocated_05-d9e0943.stderr", "stderr_hash": "532b5a66fa0c05f14a061b6c7ae0e66691fd29d4fec6cac8fd508ca6", "returncode": 1 }lfortran-0.63.0/tests/reference/ast-fixed_form_5-f25edd8.stderr0000664000175000017500000000024215174404631024435 0ustar alastairalastairsyntax error: Token 'abcdef' (of type 'identifier') is unexpected here --> tests/errors/fixed_form_5.f:3:12 | 3 | y = 5abcdef + 3 | ^^^^^^ lfortran-0.63.0/tests/reference/llvm-common_linkage_separate_compilation_01-4003f83.json0000664000175000017500000000105215174404631031232 0ustar alastairalastair{ "basename": "llvm-common_linkage_separate_compilation_01-4003f83", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/common_linkage_separate_compilation_01.f90", "infile_hash": "81ac5886133bfb559572f95eadef2507efdf8b0ef2dd367d72256990", "outfile": null, "outfile_hash": null, "stdout": "llvm-common_linkage_separate_compilation_01-4003f83.stdout", "stdout_hash": "e41cdd6483888f46e592c246582e36d81d19768671a3094fadc13b1b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-case_01-929583e.stdout0000664000175000017500000001067315174404631023121 0ustar alastairalastair(TranslationUnit [(Program case_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [(() 8 Value)] () () None ) [] [(i [] [] () () None ()) (out [] [] () () None ())] () )] [(Assignment 0 i 4 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Select 0 () i [(CaseStmt [(CaseCondExpr 1 )] () [(Assignment 0 out 10 () ) (Print 0 () [(String "1" ())] () )] ) (CaseStmt [(CaseCondExpr 2 )] () [(Assignment 0 out 20 () ) (Print 0 () [(String "2" ())] () )] ) (CaseStmt [(CaseCondExpr 3 )] () [(Assignment 0 out 30 () ) (Print 0 () [(String "3" ())] () )] ) (CaseStmt [(CaseCondExpr 4 )] () [(Assignment 0 out 40 () ) (Print 0 () [(String "4" ())] () )] )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (/= out 40) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Select 0 () i [(CaseStmt [(CaseCondExpr 1 )] () [(Assignment 0 out 11 () ) (Print 0 () [(String "1" ())] () )] ) (CaseStmt [(CaseCondExpr 2 ) (CaseCondExpr 3 ) (CaseCondExpr 4 )] () [(Assignment 0 out 22 () ) (Print 0 () [(String "2,3,4" ())] () )] )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (/= out 22) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/asr-ishftc_size-1254b50.json0000664000175000017500000000073515174404631023615 0ustar alastairalastair{ "basename": "asr-ishftc_size-1254b50", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/ishftc_size.f90", "infile_hash": "5765a2202b476e6d0522df41163ba488707e3b506dd4870c1b0eb7b4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-ishftc_size-1254b50.stderr", "stderr_hash": "9ce5eb1db3c8a9c92204d2bd13f6466f06e862c1b75c29dfe981a7d2", "returncode": 2 }lfortran-0.63.0/tests/reference/ast_f90-doconcurrentloop_01-ebe9543.stdout0000664000175000017500000000077715174404631026417 0ustar alastairalastairprogram doconcurrentloop_01 implicit none real, dimension(10000) :: a, b, c real :: scalar integer :: i, nsize scalar = 10 nsize = size(a) do concurrent (i = 1:nsize) a(i) = 5 b(i) = 5 end do call triad(a, b, scalar, c) print *, "End Stream Triad" contains subroutine triad(a, b, scalar, c) real, intent(in) :: a(:), b(:), scalar real, intent(out) :: c(:) integer :: N, i N = size(a) do concurrent (i = 1:N) c(i) = a(i) + scalar*b(i) end do end subroutine triad end program doconcurrentloop_01 lfortran-0.63.0/tests/reference/asr-bits1-e91f9ad.json0000664000175000017500000000070415174404631022561 0ustar alastairalastair{ "basename": "asr-bits1-e91f9ad", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/bits1.f90", "infile_hash": "c39794d54e8e96a492e045c7f8717eac0aa46c1d836f43a76816eb00", "outfile": null, "outfile_hash": null, "stdout": "asr-bits1-e91f9ad.stdout", "stdout_hash": "263821bdfee8dcb06a5643f8b1662fda6ad4e3e90bdfcf2d3f844536", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-data_implied_do1-87a7869.json0000664000175000017500000000075415174404631024516 0ustar alastairalastair{ "basename": "asr-data_implied_do1-87a7869", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/data_implied_do1.f90", "infile_hash": "f370b515ef426e1716db9ed2545c6325818481045ecaf0b397bb0648", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-data_implied_do1-87a7869.stderr", "stderr_hash": "23b9784791e8b09e3d06b5357db3091fce1b8a481a17006179bb85c4", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-interface4-ad40742.json0000664000175000017500000000072315174404631023411 0ustar alastairalastair{ "basename": "ast-interface4-ad40742", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/interface4.f90", "infile_hash": "8b4db4e1c65a085c13634bc5b46243c7f058ed4cb41ddd3d3e5a664d", "outfile": null, "outfile_hash": null, "stdout": "ast-interface4-ad40742.stdout", "stdout_hash": "ee5ed9079222c0a83b333add9343f8fe2f8b098639160991c6185b41", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics6-1d3a4b4.json0000664000175000017500000000073515174404631023716 0ustar alastairalastair{ "basename": "asr-intrinsics6-1d3a4b4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics6.f90", "infile_hash": "04d0ad73ff3a4a936bd1b527adf0b5382bd08abf7aa7d294b2d40b44", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics6-1d3a4b4.stderr", "stderr_hash": "2b18c9e2fcfa9ab0487783b1eeeee1a353f3ef6a36247a60d1b79bda", "returncode": 2 }lfortran-0.63.0/tests/reference/ast_f90-array9-25daf13.stdout0000664000175000017500000000072015174404631023700 0ustar alastairalastairprogram array9 type :: varying_string character(len=1), allocatable :: characters(:) end type varying_string type(varying_string) :: x type(varying_string), allocatable :: a(:) real, allocatable :: b(:) integer, allocatable :: c(:) real(4), allocatable :: d(:) a = [varying_string :: ] b = [real :: ] b = [integer :: ] d = [real(4) :: ] a = [varying_string :: x, x] b = [real :: 1.0, 2.0] b = [integer :: 1, 2] d = [real(4) :: 1.0, 2.0] end program array9 lfortran-0.63.0/tests/reference/asr-character_01-e8e453d.stdout0000664000175000017500000000350215174404631024262 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { character_01: (Program (SymbolTable 2 { c_null_char: (Variable 2 c_null_char [] Local (StringConstant "ball" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "b" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) character_01 [] [] ) }) [] ) lfortran-0.63.0/tests/reference/asr-matrix_matmul_05-c57a23d.json0000664000175000017500000000075415174404631024641 0ustar alastairalastair{ "basename": "asr-matrix_matmul_05-c57a23d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/matrix_matmul_05.f90", "infile_hash": "6c98c338c41f6fbbc80e3b357b0fa5b757ec6dfd02332a8e06839241", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-matrix_matmul_05-c57a23d.stderr", "stderr_hash": "171aa1673005266c1b63f76f0f5000745a88e7f2468ad3e1713e6e82", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-boz_01-def9db5.json0000664000175000017500000000105515174404631023076 0ustar alastairalastair{ "basename": "llvm-boz_01-def9db5", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/boz_01.f90", "infile_hash": "58477e3f0fbdc7b41b5892cc6f876abfc5b434abe4884789d60b2d68", "outfile": null, "outfile_hash": null, "stdout": "llvm-boz_01-def9db5.stdout", "stdout_hash": "9e8eab443e96e050b2a4030243f2e595b91aa47fb05dbee5516a6e75", "stderr": "llvm-boz_01-def9db5.stderr", "stderr_hash": "2c1014e4f04672dfbcc83dde266587a98d7dc9651f6401dcaab51839", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-min_02-21863aa.stdout0000664000175000017500000000622215174404631023020 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { min_02: (Program (SymbolTable 2 { y: (Variable 2 y [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) min_02 [] [(Print (StringFormat () [(IntrinsicElementalFunction Min [(Var 2 y) (Cast (Var 2 z) IntegerToInteger (Integer 8) () () )] 0 (Integer 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-intrinsics_30-93f854c.stdout0000664000175000017500000017076315174404631024457 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_30: (Program (SymbolTable 2 { a1: (Variable 2 a1 [] Local (TypeInquiry Range (Integer 4) (IntegerConstant 11 (Integer 4) Decimal) (Integer 4) (IntegerConstant 9 (Integer 4) Decimal) ) (IntegerConstant 9 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a2: (Variable 2 a2 [] Local (TypeInquiry Range (Real 4) (RealConstant 22.900000 (Real 4) ) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) ) (IntegerConstant 37 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a3: (Variable 2 a3 [] Local (TypeInquiry Range (Complex 4) (ComplexConstructor (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Complex 4) (ComplexConstant 1.000000 2.000000 (Complex 4) ) ) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) ) (IntegerConstant 37 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ar1: (Variable 2 ar1 [] Local (TypeInquiry Range (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [1, 21, 13] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Integer 4) (IntegerConstant 9 (Integer 4) Decimal) ) (IntegerConstant 9 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ar2: (Variable 2 ar2 [] Local (TypeInquiry Range (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [1.00000000e+00, 2.10000000e+01, 1.30000000e+01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) ) (IntegerConstant 37 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ar3: (Variable 2 ar3 [] Local (TypeInquiry Range (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstructor [(ComplexConstructor (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Complex 4) (ComplexConstant 1.000000 2.000000 (Complex 4) ) ) (ComplexConstructor (IntegerConstant 31 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) (Complex 4) (ComplexConstant 31.000000 4.000000 (Complex 4) ) ) (ComplexConstructor (IntegerConstant 51 (Integer 4) Decimal) (IntegerConstant 62 (Integer 4) Decimal) (Complex 4) (ComplexConstant 51.000000 62.000000 (Complex 4) ) )] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [(1.00000000e+00, 2.00000000e+00), (3.10000000e+01, 4.00000000e+00), (5.10000000e+01, 6.20000000e+01)] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ColMajor () ) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) ) (IntegerConstant 37 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arr1: (Variable 2 arr1 [] Local (ArrayConstant 12 [1, 21, 13] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayConstant 12 [1, 21, 13] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arr2: (Variable 2 arr2 [] Local (Cast (ArrayConstant 12 [1.00000000e+00, 2.10000000e+01, 1.30000000e+01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) RealToReal (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 24 [1.0000000000000000e+00, 2.1000000000000000e+01, 1.3000000000000000e+01] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () ) (ArrayConstant 24 [1.0000000000000000e+00, 2.1000000000000000e+01, 1.3000000000000000e+01] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arr3: (Variable 2 arr3 [] Local (ArrayConstructor [(ComplexConstructor (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Complex 4) (ComplexConstant 1.000000 2.000000 (Complex 4) ) ) (ComplexConstructor (IntegerConstant 31 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) (Complex 4) (ComplexConstant 31.000000 4.000000 (Complex 4) ) ) (ComplexConstructor (IntegerConstant 51 (Integer 4) Decimal) (IntegerConstant 62 (Integer 4) Decimal) (Complex 4) (ComplexConstant 51.000000 62.000000 (Complex 4) ) )] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [(1.00000000e+00, 2.00000000e+00), (3.10000000e+01, 4.00000000e+00), (5.10000000e+01, 6.20000000e+01)] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ColMajor () ) (ArrayConstant 12 [(1.00000000e+00, 2.00000000e+00), (3.10000000e+01, 4.00000000e+00), (5.10000000e+01, 6.20000000e+01)] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c1: (Variable 2 c1 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c2: (Variable 2 c2 [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i1: (Variable 2 i1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i2: (Variable 2 i2 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i3: (Variable 2 i3 [] Local () () Default (Integer 1) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i4: (Variable 2 i4 [] Local () () Default (Integer 2) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), int16: (ExternalSymbol 2 int16 4 int16 lfortran_intrinsic_iso_fortran_env [] int16 Public ), int8: (ExternalSymbol 2 int8 4 int8 lfortran_intrinsic_iso_fortran_env [] int8 Public ), r1: (Variable 2 r1 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r2: (Variable 2 r2 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ri3: (Variable 2 ri3 [i3] Local (TypeInquiry Range (Integer 1) (Var 2 i3) (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ri4: (Variable 2 ri4 [i4] Local (TypeInquiry Range (Integer 2) (Var 2 i4) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_30 [iso_fortran_env] [(Print (StringFormat () [(Var 2 a1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 a1) NotEq (IntegerConstant 9 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 a2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 a2) NotEq (IntegerConstant 37 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 a3)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 a3) NotEq (IntegerConstant 37 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 ar1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 ar1) NotEq (IntegerConstant 9 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 ar2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 ar2) NotEq (IntegerConstant 37 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 ar3)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 ar3) NotEq (IntegerConstant 37 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Integer 4) (Var 2 ri3) (Integer 4) (IntegerConstant 9 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 ri3) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Integer 4) (Var 2 ri4) (Integer 4) (IntegerConstant 9 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 ri4) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Integer 4) (Var 2 i1) (Integer 4) (IntegerConstant 9 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (TypeInquiry Range (Integer 4) (Var 2 i1) (Integer 4) (IntegerConstant 9 (Integer 4) Decimal) ) NotEq (IntegerConstant 9 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Integer 8) (Var 2 i2) (Integer 4) (IntegerConstant 18 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (TypeInquiry Range (Integer 8) (Var 2 i2) (Integer 4) (IntegerConstant 18 (Integer 4) Decimal) ) NotEq (IntegerConstant 18 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Real 4) (Var 2 r1) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (TypeInquiry Range (Real 4) (Var 2 r1) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) ) NotEq (IntegerConstant 37 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Real 8) (Var 2 r2) (Integer 4) (IntegerConstant 307 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (TypeInquiry Range (Real 8) (Var 2 r2) (Integer 4) (IntegerConstant 307 (Integer 4) Decimal) ) NotEq (IntegerConstant 307 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Complex 4) (Var 2 c1) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (TypeInquiry Range (Complex 4) (Var 2 c1) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) ) NotEq (IntegerConstant 37 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Complex 8) (Var 2 c2) (Integer 4) (IntegerConstant 307 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (TypeInquiry Range (Complex 8) (Var 2 c2) (Integer 4) (IntegerConstant 307 (Integer 4) Decimal) ) NotEq (IntegerConstant 307 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (Var 2 arr1) (Integer 4) (IntegerConstant 9 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (TypeInquiry Range (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (Var 2 arr1) (Integer 4) (IntegerConstant 9 (Integer 4) Decimal) ) NotEq (IntegerConstant 9 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (Var 2 arr2) (Integer 4) (IntegerConstant 307 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (TypeInquiry Range (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (Var 2 arr2) (Integer 4) (IntegerConstant 307 (Integer 4) Decimal) ) NotEq (IntegerConstant 307 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (Var 2 arr3) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (TypeInquiry Range (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (Var 2 arr3) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) ) NotEq (IntegerConstant 37 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] )] ), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env) }) [] ) lfortran-0.63.0/tests/reference/asr-print3-5f4fc26.stdout0000664000175000017500000002244115174404631023246 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { print_03: (Program (SymbolTable 2 { lfortran_iomsg: (Variable 2 lfortran_iomsg [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lfortran_iomsg1: (Variable 2 lfortran_iomsg1 [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) print_03 [] [(Assignment (Var 2 x) (IntegerConstant 24 (Integer 4) Decimal) () .false. .false. ) (FileWrite 0 () () () () [(StringConstant " " (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] () (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .true. () () () ) (Print (StringFormat () [(StringConstant "x is " (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (FileWrite 0 (IntegerConstant 6 (Integer 4) Decimal) (Var 2 lfortran_iomsg) () () [(StringConstant " " (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] () (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .true. () () () ) (FileWrite 0 (IntegerConstant 6 (Integer 4) Decimal) (Var 2 lfortran_iomsg) () () [(StringFormat () [(StringConstant "x is " (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () () ) (FileWrite 0 () () () () [(StringConstant " " (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] () (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .true. () () () ) (Print (StringConstant "ok" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (FileWrite 0 (IntegerConstant 6 (Integer 4) Decimal) (Var 2 lfortran_iomsg1) () () [(StringConstant " " (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] () (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .true. () () () ) (FileWrite 0 (IntegerConstant 6 (Integer 4) Decimal) (Var 2 lfortran_iomsg1) () () [(StringConstant "ok" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) )] () () () .true. () () () )] ) }) [] ) lfortran-0.63.0/tests/reference/c-doloop_08-2839ed5.stdout0000664000175000017500000000070015174404631023205 0ustar alastairalastair#include #include #include #include #include #include // Implementations int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); int32_t i; i = 1; while (true) { i = i + 1; if (i == 10) { break; } } if (i != 10) { fprintf(stderr, "ERROR STOP"); exit(1); } return 0; } lfortran-0.63.0/tests/reference/ast-program_02-2faf7cf.json0000664000175000017500000000075015174404631023566 0ustar alastairalastair{ "basename": "ast-program_02-2faf7cf", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/program_02.f90", "infile_hash": "cfd9e7516e44684e41465abbcb4438aa337500b426c3e8b772e69fbe", "outfile": null, "outfile_hash": null, "stdout": "ast-program_02-2faf7cf.stdout", "stdout_hash": "09d16c04765c03fcc3b5e9114a7d30f2e236d0b1b9be2075cb77f77c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_typing2-d87e21a.stdout0000664000175000017500000004014215174404631025307 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { a: (Variable 2 a [n] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [n] Unspecified () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ifault: (Variable 2 ifault [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 2 r [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Integer 4) (Real 4) (Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 ifault) (Var 2 r) (Var 2 n) (Var 2 b)] [(Assignment (Var 2 ifault) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 r) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) () ) () .false. .false. )] () Public .true. .true. () ), g: (Function (SymbolTable 3 { a: (Variable 3 a [n] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 3 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [n] Unspecified () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 3 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), g: (Variable 3 g [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ifault: (Variable 3 ifault [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 3 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 3 r [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) g (FunctionType [(Integer 4) (Real 4) (Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 ifault) (Var 3 r) (Var 3 n) (Var 3 b)] [(Assignment (Var 3 ifault) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 r) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) () ) () .false. .false. )] (Var 3 g) Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/ast-goto_03-75b98c5.stdout0000664000175000017500000000544115174404631023233 0ustar alastairalastair(TranslationUnit [(Program goto_03 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ()) (n [] [] () () None ())] () )] [(Assignment 0 n 2 () ) (Assignment 0 a 10 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (GoTo 0 () n [1 2 3] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 1 a (+ a 10) () ) (Assignment 2 a (+ a 20) () ) (Assignment 3 a (+ a 30) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (/= a 60) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assign 0 30 n (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (GoTo 0 n () [10 20 30] () ) (Assignment 10 a (* a a) () ) (Assignment 20 a (+ a a) () ) (Assignment 30 a (- a a) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (/= a 0) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/ast-parameter_01-746df62.json0000664000175000017500000000075615174404631023670 0ustar alastairalastair{ "basename": "ast-parameter_01-746df62", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/parameter_01.f90", "infile_hash": "3488de8c55d194f309a915223114321d8596fba6f63399b39ac1ad68", "outfile": null, "outfile_hash": null, "stdout": "ast-parameter_01-746df62.stdout", "stdout_hash": "0f45f37e0c2c7f94640f3f8b1c01280a5642f24835f7c70b24dc9830", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-subroutine3-8086030.json0000664000175000017500000000072615174404631023513 0ustar alastairalastair{ "basename": "asr-subroutine3-8086030", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/subroutine3.f90", "infile_hash": "174874c0a5fad40d608acbafefcc0c06c96379cc136126d3f05b63e5", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutine3-8086030.stdout", "stdout_hash": "a2842d7dd2ba50ee366ae2750f391cbbb97267187d6a640d43502fe2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-arrays_02-bc13aa6.stdout0000664000175000017500000000556315174404631023702 0ustar alastairalastair(TranslationUnit [(Program arrays_02 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(dp [] [] () (FuncCallOrArray kind [] [(() (Real "0.d0") () 0)] [] [] [] ) Equal ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [] [(a [(1 3 DimensionExpr)] [] () () None ()) (b [] [] () () None ())] () )] [(Assignment 0 (FuncCallOrArray a [] [(() 1 () 0)] [] [] [] ) (Real "3._dp") () ) (Assignment 0 (FuncCallOrArray a [] [(() 2 () 0)] [] [] [] ) (Real "2._dp") () ) (Assignment 0 (FuncCallOrArray a [] [(() 3 () 0)] [] [] [] ) (Real "1._dp") () ) (Assignment 0 b (FuncCallOrArray sum [] [(() a () 0)] [] [] [] ) () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- b (Real "6._dp")) () 0)] [] [] [] ) (Real "1e-12_dp")) [(ErrorStop 0 () () () )] [] () () () )] [] )] ) lfortran-0.63.0/tests/reference/asr-allow_implicit_interface5-6590dfc.json0000664000175000017500000000104715174404631026573 0ustar alastairalastair{ "basename": "asr-allow_implicit_interface5-6590dfc", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/allow_implicit_interface5.f90", "infile_hash": "a6d515b8d2cffc62b4e5f725328def2f8c0e7c0101e44fd2e4be5e83", "outfile": null, "outfile_hash": null, "stdout": "asr-allow_implicit_interface5-6590dfc.stdout", "stdout_hash": "5b668ffe8d7b1a984a8a1ba531f19f9d738d6ed0215266091fc26269", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-types_01-c4e1000.json0000664000175000017500000000072515174404631023026 0ustar alastairalastair{ "basename": "wat-types_01-c4e1000", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/types_01.f90", "infile_hash": "1987d8bcc6219e1bf0134a0123e23d9e02a0a8efb6989074d1537f46", "outfile": null, "outfile_hash": null, "stdout": "wat-types_01-c4e1000.stdout", "stdout_hash": "b1ae4419715b7eb8696eff165119c75c2d76d265d7d8bdf6fd9cd5ab", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-c_f_pointer_02-97865d6.json0000664000175000017500000000074615174404631024127 0ustar alastairalastair{ "basename": "asr-c_f_pointer_02-97865d6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/c_f_pointer_02.f90", "infile_hash": "e81284155f615b9e421316b6029ccdf0b4bbf68ee90104436dc21a6e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-c_f_pointer_02-97865d6.stderr", "stderr_hash": "155088ac0dd5a5402199d587d783c49abffe01f6e5d5e848ca068d02", "returncode": 2 }lfortran-0.63.0/tests/reference/julia-arrays_08_func-ec93f58.json0000664000175000017500000000110415174404631024620 0ustar alastairalastair{ "basename": "julia-arrays_08_func-ec93f58", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/arrays_08_func.f90", "infile_hash": "31dc0eac87716ea184d20ac42f94636f0a25c0ee00022272c2b1327d", "outfile": null, "outfile_hash": null, "stdout": "julia-arrays_08_func-ec93f58.stdout", "stdout_hash": "142abaf81202a722df83c56984495eb6f1d3b6b174c8286c7de7d046", "stderr": "julia-arrays_08_func-ec93f58.stderr", "stderr_hash": "d70481e5625f20fa12d3e8bdad4a5dfa6912ac62ade8fc840a5da64b", "returncode": 0 }lfortran-0.63.0/tests/reference/tokens-array3-72b5447.stdout0000664000175000017500000000122315174404631023600 0ustar alastairalastair(KEYWORD "program") (TOKEN "identifier" array3) (NEWLINE) (KEYWORD "implicit") (KEYWORD "none") (NEWLINE) (NEWLINE) (KEYWORD "real") (TOKEN ",") (KEYWORD "dimension") (TOKEN "(") (TOKEN "integer" 3) (TOKEN ")") (TOKEN "::") (TOKEN "identifier" a) (TOKEN ",") (TOKEN "identifier" b) (NEWLINE) (NEWLINE) (TOKEN "identifier" a) (TOKEN "=") (TOKEN "[") (TOKEN "integer" 1) (TOKEN ",") (TOKEN "integer" 2) (TOKEN ",") (TOKEN "integer" 3) (TOKEN "]") (NEWLINE) (TOKEN "identifier" b) (TOKEN "=") (TOKEN "[") (TOKEN "integer" 1) (TOKEN ",") (TOKEN "integer" 2) (TOKEN ",") (TOKEN "integer" 3) (TOKEN "/)") (NEWLINE) (NEWLINE) (KEYWORD "end program") (NEWLINE) (EOF) lfortran-0.63.0/tests/reference/ast-array7-b9de38f.stdout0000664000175000017500000000324215174404631023321 0ustar alastairalastair(TranslationUnit [(Program array7 () [] [(Implicit [(ImplicitSpec (AttrType TypeDoublePrecision [] () () None ) [(LetterSpec A H ) (LetterSpec O Z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeInteger [] () () None ) [(LetterSpec I N )] )] () )] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(n [] [] () 10 Equal ())] () ) (Declaration () [(AttrDimension [] )] [(SJ [(0 N DimensionExpr)] [] () () None ()) (DJ [(0 N DimensionExpr)] [] () () None ())] () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-maskl_incorrect_bit_size-62a84b0.json0000664000175000017500000000100415174404631026424 0ustar alastairalastair{ "basename": "asr-maskl_incorrect_bit_size-62a84b0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/maskl_incorrect_bit_size.f90", "infile_hash": "22bc3f7e5c1f8e417a35a9b3c5e5cd5e77144132b3dce000e08f9541", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-maskl_incorrect_bit_size-62a84b0.stderr", "stderr_hash": "7d551a51912bdc498dfe973f7075b133094a1b35e8de2c37291c122e", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-type_mismatch1-550e457.json0000664000175000017500000000074615174404631024250 0ustar alastairalastair{ "basename": "asr-type_mismatch1-550e457", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/type_mismatch1.f90", "infile_hash": "8c60e395b39fd2c67da15122466c307239673e117cef04270c66c152", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-type_mismatch1-550e457.stderr", "stderr_hash": "ba3a203c293f42c9e03b1f28230b6ce14cc3d351e71828676f57e8c2", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-fixed_form_with_exit-0c669e6.json0000664000175000017500000000077415174404631025616 0ustar alastairalastair{ "basename": "ast-fixed_form_with_exit-0c669e6", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_with_exit.f", "infile_hash": "96d9aae99e4783183d44514eb3229ae1d1879847d4722d605ae687f6", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_with_exit-0c669e6.stdout", "stdout_hash": "438fb8012f29766becc2f526e72e71043772617a0ae5c81a28566eb8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-arrays_05-e6d3b50.json0000664000175000017500000000074515174404631023257 0ustar alastairalastair{ "basename": "asr-arrays_05-e6d3b50", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_05.f90", "infile_hash": "09eac1191b2e8a76fafedf1307b2d1240ffbc5f632c08afa847df805", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_05-e6d3b50.stdout", "stdout_hash": "2416ff73b717cde4c6634c58d231672314035d427c9036247ca34cee", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-arrays_reshape_14-913f34e.json0000664000175000017500000000077515174404631024717 0ustar alastairalastair{ "basename": "asr-arrays_reshape_14-913f34e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_reshape_14.f90", "infile_hash": "0001f1a35a57d435e0471d176786ced2d1e7b86afa641941eea5b6c2", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_reshape_14-913f34e.stdout", "stdout_hash": "c3ceaae0f9e6efbba61205320f6940038d18c15e46d6e9f503c37adf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-derived_types_04-da02dd9.json0000664000175000017500000000074515174404631024702 0ustar alastairalastair{ "basename": "asr-derived_types_04-da02dd9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/derived_types_04.f90", "infile_hash": "860801f83352a02e1bdaf7e25275d6403c80f4311033af18f946969a", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_04-da02dd9.stdout", "stdout_hash": "4cc72a1553bda5416695d5885d17d1751d79f0b07c80f238469c44b1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_35-10733ec.stdout0000664000175000017500000005025115174404631024431 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_35: (Program (SymbolTable 2 { l: (Variable 2 l [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), section: (Function (SymbolTable 3 { a: (Variable 3 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 3 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) section (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 a) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 8 [2, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 24 [1, 1, 1, 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 3 b) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 8 [2, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 24 [1, 1, 1, 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (ArrayItem (Var 3 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(IntrinsicArrayFunction Any [(ArrayPhysicalCast (IntegerCompare (Var 3 a) Eq (Var 3 b) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () ) (IntegerConstant 1 (Integer 4) Decimal)] 1 (Array (Logical 4) [(() ())] DescriptorArray ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicArrayFunction Any [(ArrayPhysicalCast (IntegerCompare (Var 3 a) Eq (Var 3 b) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () ) (IntegerConstant 2 (Integer 4) Decimal)] 1 (Array (Logical 4) [(() ())] DescriptorArray ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) intrinsics_35 [] [(Assignment (Var 2 l) (IntrinsicArrayFunction Any [(ArrayPhysicalCast (ArrayConstant 12 [.true., .true., .true.] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 l)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 2 section () [] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-fixed_form1-f592417.stdout0000664000175000017500000000741715174404631024562 0ustar alastairalastairsubroutine dqawse(f, a, b, alfa, beta, integr, epsabs, epsrel, limit, result, abserr, neval, ier, alist, blist, rlist, elist, iord, last) double precision :: a, abserr, alfa, alist, area, area1, area12, area2, a1, a2, b, beta, blist, b1, b2, centre, dabs, dmax1, d1mach, elist, epmach, epsabs, epsrel, errbnd, errmax, error1, erro12, error2, errsum, f, resas1, resas2, result, rg, rh, ri, rj, rlist, uflow integer :: ier, integr, iord, iroff1, iroff2, k, last, limit, maxerr, nev, neval, nrmax external :: f dimension :: alist(limit), blist(limit), rlist(limit), elist(limit), iord(limit), ri(25), rj(25), rh(25), rg(25) epmach = d1mach(4) uflow = d1mach(1) ier = 6 neval = 0 last = 0 rlist(1) = 0.0d+00 elist(1) = 0.0d+00 iord(1) = 0 result = 0.0d+00 abserr = 0.0d+00 if (b <= a .or. epsabs == 0.0d+00 .and. epsrel < dmax1(0.5d+02*epmach, 0.5d-28) .or. alfa <= -0.1d+01 .or. beta <= -0.1d+01 .or. integr < 1 .or. integr > 4 .or. limit < 2) then go to 999 end if ier = 0 call dqmomo(alfa, beta, ri, rj, rg, rh, integr) centre = 0.5d+00*(b + a) call dqc25s(f, a, b, a, centre, alfa, beta, ri, rj, rg, rh, area1, error1, resas1, integr, nev) neval = nev call dqc25s(f, a, b, centre, b, alfa, beta, ri, rj, rg, rh, area2, error2, resas2, integr, nev) last = 2 neval = neval + nev result = area1 + area2 abserr = error1 + error2 errbnd = dmax1(epsabs, epsrel*dabs(result)) if (error2 > error1) then go to 10 end if alist(1) = a alist(2) = centre blist(1) = centre blist(2) = b rlist(1) = area1 rlist(2) = area2 elist(1) = error1 elist(2) = error2 go to 20 10 alist(1) = centre alist(2) = a blist(1) = b blist(2) = centre rlist(1) = area2 rlist(2) = area1 elist(1) = error2 elist(2) = error1 20 iord(1) = 1 iord(2) = 2 if (limit == 2) then ier = 1 end if if (abserr <= errbnd .or. ier == 1) then go to 999 end if errmax = elist(1) maxerr = 1 nrmax = 1 area = result errsum = abserr iroff1 = 0 iroff2 = 0 do last = 3, limit a1 = alist(maxerr) b1 = 0.5d+00*(alist(maxerr) + blist(maxerr)) a2 = b1 b2 = blist(maxerr) call dqc25s(f, a, b, a1, b1, alfa, beta, ri, rj, rg, rh, area1, error1, resas1, integr, nev) neval = neval + nev call dqc25s(f, a, b, a2, b2, alfa, beta, ri, rj, rg, rh, area2, error2, resas2, integr, nev) neval = neval + nev area12 = area1 + area2 erro12 = error1 + error2 errsum = errsum + erro12 - errmax area = area + area12 - rlist(maxerr) if (a == a1 .or. b == b2) then go to 30 end if if (resas1 == error1 .or. resas2 == error2) then go to 30 end if if (dabs(rlist(maxerr) - area12) < 0.1d-04*dabs(area12) .and. erro12 >= 0.99d+00*errmax) then iroff1 = iroff1 + 1 end if if (last > 10 .and. erro12 > errmax) then iroff2 = iroff2 + 1 end if 30 rlist(maxerr) = area1 rlist(last) = area2 errbnd = dmax1(epsabs, epsrel*dabs(area)) if (errsum <= errbnd) then go to 35 end if if (last == limit) then ier = 1 end if if (iroff1 >= 6 .or. iroff2 >= 20) then ier = 2 end if if (dmax1(dabs(a1), dabs(b2)) <= (0.1d+01 + 0.1d+03*epmach)*(dabs(a2) + 0.1d+04*uflow)) then ier = 3 end if 35 if (error2 > error1) then go to 40 end if alist(last) = a2 blist(maxerr) = b1 blist(last) = b2 elist(maxerr) = error1 elist(last) = error2 go to 50 40 alist(maxerr) = a2 alist(last) = a1 blist(last) = b1 rlist(maxerr) = area2 rlist(last) = area1 elist(maxerr) = error2 elist(last) = error1 50 call dqpsrt(limit, last, maxerr, errmax, elist, iord, nrmax) if (ier /= 0 .or. errsum <= errbnd) then go to 70 end if 60 continue end do 70 result = 0.0d+00 do k = 1, last result = result + rlist(k) 80 continue end do abserr = errsum 999 return end subroutine dqawse lfortran-0.63.0/tests/reference/asr-dlgama_arg-bfbc025.json0000664000175000017500000000073215174404631023577 0ustar alastairalastair{ "basename": "asr-dlgama_arg-bfbc025", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dlgama_arg.f90", "infile_hash": "cca18dc8b2576ee299d7a12cc26cbd82f78f8a23463402f5a12df3f9", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dlgama_arg-bfbc025.stderr", "stderr_hash": "f3a481568df855e9e746a861cc31c7673d66397eeb35bb0cba2ebec0", "returncode": 2 }lfortran-0.63.0/tests/reference/asr_preprocess-cpp_err1-3303e2d.json0000664000175000017500000000076015174404631025342 0ustar alastairalastair{ "basename": "asr_preprocess-cpp_err1-3303e2d", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp_err1.f90", "infile_hash": "23e51783eb4369831ce46ce833eb9cc9515efc146635e9632539dd29", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp_err1-3303e2d.stderr", "stderr_hash": "ce8ab463670d35380fa53d05fada97fed07d89903bc9564e980c1022", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-floor_01-9103fc5.json0000664000175000017500000000074215174404631023012 0ustar alastairalastair{ "basename": "asr-floor_01-9103fc5", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/floor_01.f90", "infile_hash": "ded4fcdd43f2c9f513539d73012a5e98b5b699ec077aa53214a7c77f", "outfile": null, "outfile_hash": null, "stdout": "asr-floor_01-9103fc5.stdout", "stdout_hash": "f561956c7a8a01f631cbde404697daf5e79a366cc58426b32e6dc5d9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-array_constructor_with_integer_real_array_types-c665202.stderr0000664000175000017500000000032415174404631033614 0ustar alastairalastairsemantic error: Element in `integer(4)` array constructor is `real(4)` --> tests/errors/array_constructor_with_integer_real_array_types.f90:2:18 | 2 | print *, [1, [1., 2.]] | ^^^^^^^^ lfortran-0.63.0/tests/reference/asr-dim_float_02-2681d16.stderr0000664000175000017500000000031115174404631024073 0ustar alastairalastairsemantic error: `mask` argument to `Sum` must be a scalar or array of logical type --> tests/errors/dim_float_02.f90:2:29 | 2 | print *, sum([1, 2, 3], 1, 1.1) | ^^^ lfortran-0.63.0/tests/reference/pass_nested_vars-nested_namelist_01-c1be094.json0000664000175000017500000000105515174404631027700 0ustar alastairalastair{ "basename": "pass_nested_vars-nested_namelist_01-c1be094", "cmd": "lfortran --pass=nested_vars --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_namelist_01.f90", "infile_hash": "3ae593ad78ac4bbac6d58d1dd1f8ee532e6cf64aef681fa7f311c7e2", "outfile": null, "outfile_hash": null, "stdout": "pass_nested_vars-nested_namelist_01-c1be094.stdout", "stdout_hash": "1021908976297301deb004db199368f8a7370b300248f8d573601580", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-interface3-6416a61.stdout0000664000175000017500000002657715174404631023723 0ustar alastairalastair(TranslationUnit [(Module interface3 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (Comment "!checks the syntax" )] ) )] [(Declaration () [(SimpleAttribute AttrPublic )] [(x [] [] () () None ()) (y [] [] () () None ()) (z [] [] () () None ()) (() [] [] () () None (AttrAssignment)) (() [] [] () () None (AttrIntrinsicOperator PLUS )) (() [] [] () () None (AttrIntrinsicOperator AND )) (() [] [] () () None (AttrDefinedOperator "in" ))] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(() [] [] () () None (AttrIntrinsicOperator STAR ))] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(() [] [] () () None (AttrIntrinsicOperator DIV ))] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(() [] [] () () None (AttrIntrinsicOperator DIV ))] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(() [] [] () () None (AttrIntrinsicOperator CONCAT ))] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Interface (InterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [sample] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderName A ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [sample] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderAssignment) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceProc (Subroutine LOGICAL_TO_NUMERIC [(N) (B)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent Out )] [(N [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [(AttrIntent In )] [(B [] [] () () None ())] () )] [] [] [] ) )] ) (Interface (InterfaceHeaderOperator PLUS ) () [(InterfaceModuleProcedure [union] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderOperator MINUS ) () [(InterfaceModuleProcedure [difference] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderOperator STAR ) () [(InterfaceModuleProcedure [intersection] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderOperator DIV ) () [] ) (Interface (InterfaceHeaderOperator DIV ) () [] ) (Interface (InterfaceHeaderOperator POW ) () [] ) (Interface (InterfaceHeaderOperator EQ ) () [] ) (Interface (InterfaceHeaderOperator NOTEQ ) () [] ) (Interface (InterfaceHeaderOperator GT ) () [] ) (Interface (InterfaceHeaderOperator GTE ) () [] ) (Interface (InterfaceHeaderOperator LT ) () [] ) (Interface (InterfaceHeaderOperator LTE ) () [(InterfaceModuleProcedure [subset] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderOperator NOT ) () [] ) (Interface (InterfaceHeaderOperator AND ) () [] ) (Interface (InterfaceHeaderOperator OR ) () [] ) (Interface (InterfaceHeaderOperator EQV ) () [] ) (Interface (InterfaceHeaderOperator NEQV ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] ) (Interface (AbstractInterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] ) (Declaration () [(SimpleAttribute AttrPublic )] [(() [] [] () () None (AttrIntrinsicOperator CONCAT ))] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Interface (InterfaceHeaderOperator CONCAT ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] ) (Interface (InterfaceHeaderWrite formatted ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [write_formatted] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderWrite unformatted ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [write_unformatted] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderRead formatted ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [read_formatted] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderRead unformatted ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [read_unformatted] [(SimpleAttribute AttrModule )] () )] )] [] [(Function f [(operator)] [] () () (TriviaNode [(EndOfLine) (Comment "! Currently parsed as an operator, but AST -> ASR phase can fix that:" )] [(EndOfLine) (EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(() [] [] () () None (AttrIntrinsicOperator STAR ))] () )] [] [] [] )] )] ) lfortran-0.63.0/tests/reference/asr_preprocess-cpp_err2-aa1ccd3.stderr0000664000175000017500000000021315174404631026102 0ustar alastairalastairC preprocessor error: Unexpected token '/' in factor() --> tests/errors/cpp_err2.f90:2:13 | 2 | #if 2 < 1+2+ / 1 2 | ^^^ lfortran-0.63.0/tests/reference/asr-intrinsics12-16f1580.stderr0000664000175000017500000000025415174404631024171 0ustar alastairalastairsemantic error: All arguments to max0 must be of the same type --> tests/errors/intrinsics12.f90:2:14 | 2 | print *, max(12, 13.94) | ^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-loop_test1-7800c18.json0000664000175000017500000000073615174404631023407 0ustar alastairalastair{ "basename": "ast-loop_test1-7800c18", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/loop_test1.f", "infile_hash": "149b2f607c4d8b4b89d207ac9353585e75ab55fd9c2520f7da02ffee", "outfile": null, "outfile_hash": null, "stdout": "ast-loop_test1-7800c18.stdout", "stdout_hash": "2b26fb6b8a3fa12cfbd7c121e39f95b2e5e2bd11c7d8320cdd64927f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-array_bounds_check_11-83e9417.json0000664000175000017500000000074315174404631025471 0ustar alastairalastair{ "basename": "run-array_bounds_check_11-83e9417", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_11.f90", "infile_hash": "05fad075d70118633353ec58606020f95cd7f4949cd6919b4236d347", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_11-83e9417.stderr", "stderr_hash": "9f8e8c3ddaf3e75acbd7f84960bd8483d08c44655617632d936f0e86", "returncode": 1 }lfortran-0.63.0/tests/reference/ast-complex3-001609d.stderr0000664000175000017500000000046415174404631023371 0ustar alastairalastairstyle suggestion: Use complex(8) instead of complex*16 --> tests/complex3.f90:2:1 | 2 | complex*16 :: x | ^^^^^^^^^^ help: write this as 'complex(8)' style suggestion: Use complex(4) instead of complex*8 --> tests/complex3.f90:4:1 | 4 | complex*8 :: z | ^^^^^^^^^ help: write this as 'complex(4)' lfortran-0.63.0/tests/reference/asr-template_error_07b-d39ea05.json0000664000175000017500000000111315174404631025136 0ustar alastairalastair{ "basename": "asr-template_error_07b-d39ea05", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_07b.f90", "infile_hash": "fa616373619b81bb4f044d4f5c0a101bdf1a0a82dc4d06ec0c2cebf2", "outfile": null, "outfile_hash": null, "stdout": "asr-template_error_07b-d39ea05.stdout", "stdout_hash": "889d4a84a641e739b4f0ae13cdc1b1851c62e55249823d38db5f2827", "stderr": "asr-template_error_07b-d39ea05.stderr", "stderr_hash": "b8948ddaa9675681c2db81e4683695ca01ef9f125c42cb0d2b1ae128", "returncode": 0 }lfortran-0.63.0/tests/reference/ast-substring-59dd84f.stdout0000664000175000017500000000365515174404631024067 0ustar alastairalastair(TranslationUnit [(Program substring () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeCharacter [(() 5 Value)] () () None ) [] [(str [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() 5 Value)] () () None ) [(SimpleAttribute AttrParameter )] [(s [] [] () (Substring "Hello World" [(7 11 1 0)] ) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 str (Substring "12345" [(2 4 1 0)] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [str] () ) (Print 0 () [s] () ) (Print 0 () [(Substring "SubString" [(4 9 1 0)] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/ast-read1-fd137ad.json0000664000175000017500000000070415174404631022524 0ustar alastairalastair{ "basename": "ast-read1-fd137ad", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/read1.f90", "infile_hash": "a8601ffbfb4ea0a84892d205a776a40b585951d3e69794b2b29d399a", "outfile": null, "outfile_hash": null, "stdout": "ast-read1-fd137ad.stdout", "stdout_hash": "502a60c2a6007288bf7ae468b8114e14be8975d0df9718588b038b8c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-string_12-e72e066.json0000664000175000017500000000074515174404631023210 0ustar alastairalastair{ "basename": "asr-string_12-e72e066", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_12.f90", "infile_hash": "ba0e8d4d5c264402806c61ad398d62eaf5c9ddd47d86b173e5210342", "outfile": null, "outfile_hash": null, "stdout": "asr-string_12-e72e066.stdout", "stdout_hash": "fac5de7ce4cfc6508a3257678dbc6a720102a2f22764af1f8b4b8491", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-nullify_01-09aa501.stdout0000664000175000017500000000773515174404631023723 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nullify_01: (Program (SymbolTable 2 { p1: (Variable 2 p1 [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p2: (Variable 2 p2 [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), t1: (Variable 2 t1 [] Local () () Default (Integer 4) () Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ) }) nullify_01 [] [(Associate (Var 2 p1) (Var 2 t1) ) (Associate (Var 2 p2) (Var 2 t1) ) (Assignment (Var 2 p1) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Nullify [(Var 2 p1) (Var 2 p2)] )] ) }) [] ) lfortran-0.63.0/tests/reference/run-allocate_03-85e4091.json0000664000175000017500000000070515174404631023422 0ustar alastairalastair{ "basename": "run-allocate_03-85e4091", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/allocate_03.f90", "infile_hash": "61117df36c26a45a3bcdebd0d5778ebed7547d0d529701bb20865c12", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-allocate_03-85e4091.stderr", "stderr_hash": "1578bae8bcf745170f2d08da63412dabdef357f91a43052b4c6770f9", "returncode": 1 }lfortran-0.63.0/tests/reference/llvm-classes1-d55a38c.stdout0000664000175000017500000001661415174404631023734 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %xx.base_class = type <{ i32 (...)**, %xx.base* }> %xx.base = type { i32 } %string_descriptor = type <{ i8*, i64 }> @_Name_base = private unnamed_addr constant [5 x i8] c"base\00", align 1 @_Type_Info_base = linkonce_odr unnamed_addr constant { i8*, i8*, i8* } { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @_Name_base, i32 0, i32 0), i8* inttoptr (i64 4 to i8*), i8* null }, align 8 @_VTable_base = linkonce_odr unnamed_addr constant { [6 x i8*] } { [6 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_base to i8*), i8* bitcast (void (i8*, i8*)* @_copy_xx_base to i8*), i8* bitcast (void (i8**)* @_allocate_struct_xx_base to i8*), i8* bitcast (void (i8*)* @finalize_StructType__base_of_xx_for_UPoly to i8*), i8* bitcast (void (%xx.base_class*)* @__module_xx_show_x to i8*)] }, align 8 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_xx_show_x(%xx.base_class* %this) { .entry: %0 = getelementptr %xx.base_class, %xx.base_class* %this, i32 0, i32 1 %1 = load %xx.base*, %xx.base** %0, align 8 %2 = getelementptr %xx.base, %xx.base* %1, i32 0, i32 0 store i32 12, i32* %2, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_show_x FINALIZE_SYMTABLE_show_x: ; preds = %return ret void } define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() %3 = alloca %xx.base_class, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %b = alloca %xx.base, align 8 %4 = getelementptr %xx.base, %xx.base* %b, i32 0, i32 0 %5 = getelementptr %xx.base, %xx.base* %b, i32 0, i32 0 store i32 10, i32* %5, align 4 %6 = getelementptr %xx.base_class, %xx.base_class* %3, i32 0, i32 0 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_base, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %6, align 8 %7 = getelementptr %xx.base_class, %xx.base_class* %3, i32 0, i32 1 store %xx.base* %b, %xx.base** %7, align 8 call void @__module_xx_show_x(%xx.base_class* %3) %8 = alloca i64, align 8 %9 = getelementptr %xx.base, %xx.base* %b, i32 0, i32 0 %10 = load i32, i32* %9, align 4 %11 = alloca i32, align 4 store i32 %10, i32* %11, align 4 %12 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %8, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %11) %13 = load i64, i64* %8, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %12, i8** %14, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %13, i64* %15, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %17 = load i8*, i8** %16, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %19 = load i64, i64* %18, align 8 %20 = trunc i64 %19 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %17, i32 %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %21 = icmp eq i8* %12, null br i1 %21, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %12) br label %free_done free_done: ; preds = %free_nonnull, %.entry %22 = getelementptr %xx.base, %xx.base* %b, i32 0, i32 0 %23 = load i32, i32* %22, align 4 %24 = icmp ne i32 %23, 12 br i1 %24, label %then, label %else then: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %free_done br label %ifcont ifcont: ; preds = %else, %then br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) define linkonce_odr void @_copy_xx_base(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %xx.base* %3 = bitcast i8* %1 to %xx.base* %4 = getelementptr %xx.base, %xx.base* %2, i32 0, i32 0 %5 = load i32, i32* %4, align 4 %6 = getelementptr %xx.base, %xx.base* %3, i32 0, i32 0 br i1 true, label %then, label %else then: ; preds = %entry store i32 %5, i32* %6, align 4 br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then ret void } define linkonce_odr void @_allocate_struct_xx_base(i8** %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = call i8* @_lfortran_malloc_alloc(i8* %1, i64 16) call void @llvm.memset.p0i8.i32(i8* %2, i8 0, i32 16, i1 false) store i8* %2, i8** %0, align 8 %3 = load i8*, i8** %0, align 8 %4 = bitcast i8* %3 to %xx.base_class* %5 = bitcast %xx.base_class* %4 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_base, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %5, align 8 %6 = getelementptr %xx.base_class, %xx.base_class* %4, i32 0, i32 1 %7 = call i8* @_lfortran_get_default_allocator() %8 = call i8* @_lfortran_malloc_alloc(i8* %7, i64 4) call void @llvm.memset.p0i8.i32(i8* %8, i8 0, i32 4, i1 false) %9 = bitcast i8* %8 to %xx.base* store %xx.base* %9, %xx.base** %6, align 8 %10 = getelementptr %xx.base, %xx.base* %9, i32 0, i32 0 ret void } define internal void @finalize_StructType__base_of_xx_for_UPoly(i8* %0) { entry: %1 = bitcast i8* %0 to %xx.base* ret void } declare i8* @_lfortran_malloc_alloc(i8*, i64) declare i8* @_lfortran_get_default_allocator() ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) attributes #0 = { argmemonly nounwind willreturn writeonly } lfortran-0.63.0/tests/reference/asr-modules_44-ec0baa3.json0000664000175000017500000000075015174404631023553 0ustar alastairalastair{ "basename": "asr-modules_44-ec0baa3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_44.f90", "infile_hash": "64a0fe18f63bcdea0da398339103b09acfb84dd85285ec15239ea14e", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_44-ec0baa3.stdout", "stdout_hash": "2dd1b9166393a631352ab1e8f388b38b9d3618e91416ee765fda28c3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-common2-64c97b2.json0000664000175000017500000000072515174404631022752 0ustar alastairalastair{ "basename": "asr-common2-64c97b2", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/common2.f", "infile_hash": "761ba9bcb69efc19ad1828c9ebc8deab710d02f98f6722736d6a4dd2", "outfile": null, "outfile_hash": null, "stdout": "asr-common2-64c97b2.stdout", "stdout_hash": "91e0778acd9fb56544d42b7c9b8b79ffa411c7c16293e70cefee31f3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-string_assignment_01-9537046.json0000664000175000017500000000060515174404631025313 0ustar alastairalastair{ "basename": "run-string_assignment_01-9537046", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/string_assignment_01.f90", "infile_hash": "bc987cc37945c4f9f2bbc6e6e4b272dfeb091d95a56ab7fe5137cfa0", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-matrix_01_transpose-fb3276a.stdout0000664000175000017500000020350215174404631025723 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { matrix_01_tranpose: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), e: (Variable 2 e [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f: (Variable 2 f [] Local () () Default (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 2 l [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 31 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 2 m [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 31 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) matrix_01_tranpose [] [(Assignment (Var 2 a) (ArrayReshape (ArrayConstant 48 [1, 2, 3, ...., 10, 11, 12] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayPhysicalCast (ArrayConstant 8 [3, 4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) () () (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 48 [1, 2, 3, ...., 10, 11, 12] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 2 b) (IntrinsicArrayFunction Transpose [(ArrayPhysicalCast (Var 2 a) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 3 (Integer 4) Decimal) ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 a) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 a) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 4 (Integer 4) Decimal) ) ()) [(If () (IntegerCompare (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Integer 4) ColMajor () ) NotEq (ArrayItem (Var 2 b) [(() (Var 2 j) ()) (() (Var 2 i) ())] (Integer 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] ) (Assignment (Var 2 x) (Cast (ArrayReshape (ArrayConstant 100 [1, 2, 3, ...., 23, 24, 25] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 25 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayPhysicalCast (ArrayConstant 8 [5, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) () () (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 100 [1, 2, 3, ...., 23, 24, 25] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) IntegerToReal (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 100 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00, ...., 2.30000000e+01, 2.40000000e+01, 2.50000000e+01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () ) () .false. .false. ) (Assignment (Var 2 y) (IntrinsicArrayFunction Transpose [(ArrayPhysicalCast (Var 2 x) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 5 (Integer 4) Decimal) ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 5 (Integer 4) Decimal) ) ()) [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 x) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4) ColMajor () ) Sub (ArrayItem (Var 2 y) [(() (Var 2 j) ()) (() (Var 2 i) ())] (Real 4) ColMajor () ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] ) (Assignment (Var 2 d) (Cast (ArrayReshape (ArrayConstant 8 [1, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayPhysicalCast (ArrayConstant 8 [1, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) () () (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 8 [1, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) IntegerToReal (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [1.0000000000000000e+00, 2.0000000000000000e+00] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () ) () .false. .false. ) (Assignment (Var 2 e) (IntrinsicArrayFunction Transpose [(ArrayPhysicalCast (Var 2 d) FixedSizeArray DescriptorArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 d) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 d) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 1 (Integer 4) Decimal) ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 d) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 d) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 2 (Integer 4) Decimal) ) ()) [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 d) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 8) ColMajor () ) Sub (ArrayItem (Var 2 e) [(() (Var 2 j) ()) (() (Var 2 i) ())] (Real 8) ColMajor () ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] ) (Assignment (Var 2 c) (ArrayReshape (ArrayConstructor [(ComplexConstructor (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Complex 4) (ComplexConstant 1.000000 2.000000 (Complex 4) ) ) (ComplexConstructor (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) (Complex 4) (ComplexConstant 3.000000 4.000000 (Complex 4) ) ) (ComplexConstructor (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal) (Complex 4) (ComplexConstant 5.000000 6.000000 (Complex 4) ) ) (ComplexConstructor (IntegerConstant 7 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal) (Complex 4) (ComplexConstant 7.000000 8.000000 (Complex 4) ) )] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [(1.00000000e+00, 2.00000000e+00), (3.00000000e+00, 4.00000000e+00), (5.00000000e+00, 6.00000000e+00), (7.00000000e+00, 8.00000000e+00)] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ColMajor () ) (ArrayPhysicalCast (ArrayConstant 8 [2, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) () () (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [(1.00000000e+00, 2.00000000e+00), (3.00000000e+00, 4.00000000e+00), (5.00000000e+00, 6.00000000e+00), (7.00000000e+00, 8.00000000e+00)] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 2 f) (IntrinsicArrayFunction Transpose [(ArrayPhysicalCast (Var 2 c) FixedSizeArray DescriptorArray (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 2 (Integer 4) Decimal) ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 2 (Integer 4) Decimal) ) ()) [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Real [(ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Complex 4) ColMajor () )] 0 (Real 4) () ) Sub (IntrinsicElementalFunction Real [(ArrayItem (Var 2 f) [(() (Var 2 j) ()) (() (Var 2 i) ())] (Complex 4) ColMajor () )] 0 (Real 4) () ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Aimag [(ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Complex 4) ColMajor () )] 0 (Real 4) () ) Sub (IntrinsicElementalFunction Aimag [(ArrayItem (Var 2 f) [(() (Var 2 j) ()) (() (Var 2 i) ())] (Complex 4) ColMajor () )] 0 (Real 4) () ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] ) (Assignment (Var 2 l) (ArrayBroadcast (LogicalConstant .true. (Logical 4) ) (ArrayConstant 8 [12, 31] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 31 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (Assignment (Var 2 m) (IntrinsicArrayFunction Transpose [(ArrayPhysicalCast (Var 2 l) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 31 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 31 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 l) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 l) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 12 (Integer 4) Decimal) ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 l) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 l) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 31 (Integer 4) Decimal) ) ()) [(If () (LogicalBinOp (ArrayItem (Var 2 l) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Logical 4) ColMajor () ) NEqv (ArrayItem (Var 2 m) [(() (Var 2 j) ()) (() (Var 2 i) ())] (Logical 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-include1-f5bbd80.json0000664000175000017500000000074315174404631023240 0ustar alastairalastair{ "basename": "ast-include1-f5bbd80", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/include1.f", "infile_hash": "8606a1bd16c5601e19e650f13f967c53a9cf3480c8803e8dca078960", "outfile": null, "outfile_hash": null, "stdout": "ast-include1-f5bbd80.stdout", "stdout_hash": "ab9af3121ee5fe59dd50fa4363b8d43565de08b01e41da41f422ef62", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor14-07dfdb5.json0000664000175000017500000000077315174404631026676 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor14-07dfdb5", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor14.f90", "infile_hash": "ecfd32142988c081654be18462888b79f4d47174d63c9e2b37b5a3d1", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor14-07dfdb5.stdout", "stdout_hash": "c159a6dc10dd4805d33c65efeaacb63a6cbc4e6b8a00e25047cd4588", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-do_concurrent_reduce-9789e1d.stdout0000664000175000017500000000030515174404631026630 0ustar alastairalastairsubroutine sum_reduce(a, s) real, intent(in) :: a(:) real, intent(out) :: s integer :: N, i N = size(a) s = 0 do concurrent (i = 1:N) reduce(+: s) s = s + a(i) end do end subroutine sum_reduce lfortran-0.63.0/tests/reference/asr-modules_05-f939cc6.json0000664000175000017500000000072315174404631023440 0ustar alastairalastair{ "basename": "asr-modules_05-f939cc6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/modules_05.f90", "infile_hash": "e9f1e3a9e80949247e90dc618aff63fe80d5cc91017f860a752efaff", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_05-f939cc6.stdout", "stdout_hash": "32d778cae8ba7b25647d9252a5ec96052d5d9325c9c5e6f1d50c5df9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-expr_05-3b5ec63.stdout0000664000175000017500000000430515174404631023300 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t a; int32_t b; int32_t c; bool l; int32_t x; a = 3; b = 4; c = 5; x = 2*3; x = (-2)*3; x = 2*(-3); x = (-2)*(-3); x = (-2)*(-3); x = -std::pow(2, 3); x = -std::pow(2, 3); x = -(2*3); x = std::pow(2, -3); x = a; x = a; x = a*b; x = (-a)*b; x = -(a*b); x = a*(-b); x = (-a)*(-b); x = a*b*c; x = (-a)*b*c; x = a*(-b)*c; x = a*b*(-c); x = (-a)*(-b)*(-c); x = 3 + 4*5; x = (3 + 4)*5; x = a*(b + 5*(c - b)); x = (3 - 2*a*b)*5; x = ((-2)*a*b + 3)*5; x = ((-2)*a*b + 3*b*a)*5; x = ((-2)*(a/b) + std::pow(a + (-b), 2))*5; x = (2*a*b + 3)*5; x = std::pow(a, 2) + 2*a*b + std::pow(b, 2); x = (a + b)*(a - b); x = std::pow(a + b, 2); x = (a + b)*(std::pow(a, 2) - a*b + std::pow(b, 2)); x = (a - b)*(a + b)*(std::pow(a, 2) + std::pow(b, 2)); x = 1/(a*b); x = 1/a*b; x = 1/a*b; x = 1/(a*b + 1); x = 1/a*b + 1; x = 1/a*b + 1; x = 2 - (-2); x = a - ((-b) - c); x = a - (-2)*b; x = c - (-2)/b; x = a - (2 + 3 + 4); x = a + (2 + 3 + 4); x = 2*a + a*b - (a*b + 2*a); x = 2*a + a*b - (a*b - 2*a); x = a - (b - (c - 1)); x = a - b; x = a - (b - c); x = a - b - c; x = -(a - ((-b) + ((-b) - (-b)*b))); x = -(3 + 5); x = -(a + 5); l = (std::pow(x, 3)*4 + a <= 4 || x < 5 && x < 6) == (true || !false && true); l = l || l && l; l = (l || l) && l; l = l && l || l; l = l && (l || l); l = l || !l && l; l = l || l && !l; l = l && l || !l; l = l && !l || l; l = l && !(l || l); } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/ast_f90-expr7-b630493.stdout0000664000175000017500000000004215174404631023400 0ustar alastairalastair5_int32 5_int64 5_l 5__l_3 5__l_3_lfortran-0.63.0/tests/reference/asr-intent1-4e0feb8.stderr0000664000175000017500000000017615174404631023451 0ustar alastairalastairsemantic error: Cannot assign to an intent(in) variable `y` --> tests/errors/intent1.f90:9:5 | 9 | y = 99 | ^ lfortran-0.63.0/tests/reference/asr-logical4-72c2657.stdout0000664000175000017500000001225715174404631023371 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { logical4: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) logical4 [] [(Assignment (Var 2 a) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToLogical (Logical 4) () () ) () .false. .false. ) (Assignment (Var 2 b) (Cast (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) IntegerToLogical (Logical 4) () () ) () .false. .false. ) (Assignment (Var 2 c) (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToLogical (Logical 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 2 a) (Var 2 b) (Var 2 c)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-global_scope2-ccffd68.json0000664000175000017500000000073715174404631024526 0ustar alastairalastair{ "basename": "llvm-global_scope2-ccffd68", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/global_scope2.f90", "infile_hash": "e511f118b9a040b5e7a3ff2ad75cd7942dee08d3a21bd4ca5cd668b3", "outfile": null, "outfile_hash": null, "stdout": "llvm-global_scope2-ccffd68.stdout", "stdout_hash": "9a4dba0229c330d45e4cf43387ac64b525875e012692d5444445f97c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-call_subroutine_without_type_01-1c100d1.stdout0000664000175000017500000006273715174404631030440 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %module_call_subroutine_without_type_01.mytype_class = type <{ i32 (...)**, %module_call_subroutine_without_type_01.mytype* }> %module_call_subroutine_without_type_01.mytype = type { float } %string_descriptor = type <{ i8*, i64 }> @__module___lcompilers_created__nested_context__get_i__self = global %module_call_subroutine_without_type_01.mytype_class* null @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [12 x i8] c"S-DESC-4,R4\00", align 1 @string_const_data = private constant [4 x i8] c"r = " @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @_Name_mytype = private unnamed_addr constant [7 x i8] c"mytype\00", align 1 @_Type_Info_mytype = linkonce_odr unnamed_addr constant { i8*, i8*, i8* } { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @_Name_mytype, i32 0, i32 0), i8* inttoptr (i64 4 to i8*), i8* null }, align 8 @_VTable_mytype = linkonce_odr unnamed_addr constant { [6 x i8*] } { [6 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_mytype to i8*), i8* bitcast (void (i8*, i8*)* @_copy_module_call_subroutine_without_type_01_mytype to i8*), i8* bitcast (void (i8**)* @_allocate_struct_module_call_subroutine_without_type_01_mytype to i8*), i8* bitcast (void (i8*)* @finalize_StructType__mytype_of_module_call_subroutine_without_type_01_for_UPoly to i8*), i8* bitcast (void (%module_call_subroutine_without_type_01.mytype_class*)* @__module_module_call_subroutine_without_type_01_get_i to i8*)] }, align 8 @4 = private unnamed_addr constant [4 x i8] c"obj\00", align 1 @5 = private unnamed_addr constant [63 x i8] c"tests/../integration_tests/call_subroutine_without_type_01.f90\00", align 1 @6 = private unnamed_addr constant [22 x i8] c"'%s' unallocated here\00", align 1 @7 = private unnamed_addr constant [52 x i8] c"Tried to access member of unallocated variable '%s'\00", align 1 @8 = private unnamed_addr constant [15 x i8] c"1_mytype_get_i\00", align 1 @9 = private unnamed_addr constant [63 x i8] c"tests/../integration_tests/call_subroutine_without_type_01.f90\00", align 1 @10 = private unnamed_addr constant [20 x i8] c"This is unallocated\00", align 1 @11 = private unnamed_addr constant [45 x i8] c"Argument %d of subroutine %s is unallocated.\00", align 1 define void @__module_module_call_subroutine_without_type_01_get_i(%module_call_subroutine_without_type_01.mytype_class* %self) { .entry: %0 = icmp eq %module_call_subroutine_without_type_01.mytype_class* %self, null br i1 %0, label %then, label %else then: ; preds = %.entry store %module_call_subroutine_without_type_01.mytype_class* null, %module_call_subroutine_without_type_01.mytype_class** @__module___lcompilers_created__nested_context__get_i__self, align 8 br label %ifcont3 else: ; preds = %.entry %1 = load %module_call_subroutine_without_type_01.mytype_class*, %module_call_subroutine_without_type_01.mytype_class** @__module___lcompilers_created__nested_context__get_i__self, align 8 %2 = icmp eq %module_call_subroutine_without_type_01.mytype_class* %1, null br i1 %2, label %then1, label %else2 then1: ; preds = %else %3 = call i8* @_lfortran_get_default_allocator() %4 = call i8* @_lfortran_malloc_alloc(i8* %3, i64 16) call void @llvm.memset.p0i8.i32(i8* %4, i8 0, i32 16, i1 false) %5 = bitcast i8* %4 to %module_call_subroutine_without_type_01.mytype_class* store %module_call_subroutine_without_type_01.mytype_class* %5, %module_call_subroutine_without_type_01.mytype_class** @__module___lcompilers_created__nested_context__get_i__self, align 8 br label %ifcont else2: ; preds = %else br label %ifcont ifcont: ; preds = %else2, %then1 %6 = load %module_call_subroutine_without_type_01.mytype_class*, %module_call_subroutine_without_type_01.mytype_class** @__module___lcompilers_created__nested_context__get_i__self, align 8 %7 = bitcast %module_call_subroutine_without_type_01.mytype_class* %6 to i8* %8 = bitcast %module_call_subroutine_without_type_01.mytype_class* %self to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %7, i8* %8, i32 16, i1 false) br label %ifcont3 ifcont3: ; preds = %ifcont, %then call void @get_i.__module_module_call_subroutine_without_type_01_get_r() br label %return return: ; preds = %ifcont3 br label %FINALIZE_SYMTABLE_get_i FINALIZE_SYMTABLE_get_i: ; preds = %return ret void } define void @get_i.__module_module_call_subroutine_without_type_01_get_r() { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %1 = alloca i64, align 8 %2 = load %module_call_subroutine_without_type_01.mytype_class*, %module_call_subroutine_without_type_01.mytype_class** @__module___lcompilers_created__nested_context__get_i__self, align 8 %3 = getelementptr %module_call_subroutine_without_type_01.mytype_class, %module_call_subroutine_without_type_01.mytype_class* %2, i32 0, i32 1 %4 = load %module_call_subroutine_without_type_01.mytype*, %module_call_subroutine_without_type_01.mytype** %3, align 8 %5 = getelementptr %module_call_subroutine_without_type_01.mytype, %module_call_subroutine_without_type_01.mytype* %4, i32 0, i32 0 %6 = load float, float* %5, align 4 %7 = alloca float, align 4 store float %6, float* %7, align 4 %8 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info, i32 0, i32 0), i64* %1, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const, float* %7) %9 = load i64, i64* %1, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %8, i8** %10, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %9, i64* %11, align 8 %12 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %13 = load i8*, i8** %12, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %15 = load i64, i64* %14, align 8 %16 = trunc i64 %15 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %13, i32 %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %17 = icmp eq i8* %8, null br i1 %17, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %0, i8* %8) br label %free_done free_done: ; preds = %free_nonnull, %.entry %18 = load %module_call_subroutine_without_type_01.mytype_class*, %module_call_subroutine_without_type_01.mytype_class** @__module___lcompilers_created__nested_context__get_i__self, align 8 %19 = getelementptr %module_call_subroutine_without_type_01.mytype_class, %module_call_subroutine_without_type_01.mytype_class* %18, i32 0, i32 1 %20 = load %module_call_subroutine_without_type_01.mytype*, %module_call_subroutine_without_type_01.mytype** %19, align 8 %21 = getelementptr %module_call_subroutine_without_type_01.mytype, %module_call_subroutine_without_type_01.mytype* %20, i32 0, i32 0 %22 = load float, float* %21, align 4 %23 = fcmp une float %22, 1.000000e+00 br i1 %23, label %then, label %else then: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %free_done br label %ifcont ifcont: ; preds = %else, %then br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_get_r FINALIZE_SYMTABLE_get_r: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) declare i8* @_lfortran_malloc_alloc(i8*, i64) ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 ; Function Attrs: argmemonly nounwind willreturn declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #1 define i32 @main(i32 %0, i8** %1) { .entry: %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %obj = alloca %module_call_subroutine_without_type_01.mytype_class*, align 8 store %module_call_subroutine_without_type_01.mytype_class* null, %module_call_subroutine_without_type_01.mytype_class** %obj, align 8 %3 = call i8* @_lfortran_get_default_allocator() %4 = call i8* @_lfortran_malloc_alloc(i8* %3, i64 4) call void @llvm.memset.p0i8.i32(i8* %4, i8 0, i32 4, i1 false) %5 = call i8* @_lfortran_get_default_allocator() %6 = call i8* @_lfortran_malloc_alloc(i8* %5, i64 16) call void @llvm.memset.p0i8.i32(i8* %6, i8 0, i32 16, i1 false) %7 = bitcast i8* %6 to %module_call_subroutine_without_type_01.mytype_class* store %module_call_subroutine_without_type_01.mytype_class* %7, %module_call_subroutine_without_type_01.mytype_class** %obj, align 8 %8 = load %module_call_subroutine_without_type_01.mytype_class*, %module_call_subroutine_without_type_01.mytype_class** %obj, align 8 %9 = getelementptr %module_call_subroutine_without_type_01.mytype_class, %module_call_subroutine_without_type_01.mytype_class* %8, i32 0, i32 1 %10 = bitcast i8* %4 to %module_call_subroutine_without_type_01.mytype* store %module_call_subroutine_without_type_01.mytype* %10, %module_call_subroutine_without_type_01.mytype** %9, align 8 %11 = load %module_call_subroutine_without_type_01.mytype*, %module_call_subroutine_without_type_01.mytype** %9, align 8 %12 = bitcast %module_call_subroutine_without_type_01.mytype_class* %7 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_mytype, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %12, align 8 %13 = getelementptr %module_call_subroutine_without_type_01.mytype, %module_call_subroutine_without_type_01.mytype* %11, i32 0, i32 0 %14 = load %module_call_subroutine_without_type_01.mytype_class*, %module_call_subroutine_without_type_01.mytype_class** %obj, align 8 %15 = ptrtoint %module_call_subroutine_without_type_01.mytype_class* %14 to i64 %16 = icmp eq i64 %15, 0 br i1 %16, label %then, label %ifcont then: ; preds = %.entry %17 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %18 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %19 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %18, i32 0, i32 0 %20 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %19, i32 0, i32 0 store i8* getelementptr inbounds ([63 x i8], [63 x i8]* @5, i32 0, i32 0), i8** %20, align 8 %21 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %19, i32 0, i32 1 store i32 27, i32* %21, align 4 %22 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %19, i32 0, i32 2 store i32 5, i32* %22, align 4 %23 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %19, i32 0, i32 3 store i32 27, i32* %23, align 4 %24 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %19, i32 0, i32 4 store i32 9, i32* %24, align 4 %25 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @6, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @4, i32 0, i32 0)) %26 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %17, i32 0, i32 0 %27 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %18, i32 0, i32 0 %28 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %26, i32 0, i32 2 %29 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %26, i32 0, i32 0 store i1 true, i1* %29, align 1 %30 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %26, i32 0, i32 1 store i8* %25, i8** %30, align 8 store { i8*, i32, i32, i32, i32 }* %27, { i8*, i32, i32, i32, i32 }** %28, align 8 %31 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %26, i32 0, i32 3 store i32 1, i32* %31, align 4 %32 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %17, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %32, i32 1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont: ; preds = %.entry %33 = getelementptr %module_call_subroutine_without_type_01.mytype_class, %module_call_subroutine_without_type_01.mytype_class* %14, i32 0, i32 1 %34 = load %module_call_subroutine_without_type_01.mytype*, %module_call_subroutine_without_type_01.mytype** %33, align 8 %35 = getelementptr %module_call_subroutine_without_type_01.mytype, %module_call_subroutine_without_type_01.mytype* %34, i32 0, i32 0 store float 1.000000e+00, float* %35, align 4 %36 = load %module_call_subroutine_without_type_01.mytype_class*, %module_call_subroutine_without_type_01.mytype_class** %obj, align 8 %37 = ptrtoint %module_call_subroutine_without_type_01.mytype_class* %36 to i64 %38 = icmp eq i64 %37, 0 br i1 %38, label %then1, label %ifcont2 then1: ; preds = %ifcont %39 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %40 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %41 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %40, i32 0, i32 0 %42 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %41, i32 0, i32 0 store i8* getelementptr inbounds ([63 x i8], [63 x i8]* @9, i32 0, i32 0), i8** %42, align 8 %43 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %41, i32 0, i32 1 store i32 28, i32* %43, align 4 %44 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %41, i32 0, i32 2 store i32 5, i32* %44, align 4 %45 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %41, i32 0, i32 3 store i32 28, i32* %45, align 4 %46 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %41, i32 0, i32 4 store i32 20, i32* %46, align 4 %47 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @10, i32 0, i32 0)) %48 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %39, i32 0, i32 0 %49 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %40, i32 0, i32 0 %50 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %48, i32 0, i32 2 %51 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %48, i32 0, i32 0 store i1 true, i1* %51, align 1 %52 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %48, i32 0, i32 1 store i8* %47, i8** %52, align 8 store { i8*, i32, i32, i32, i32 }* %49, { i8*, i32, i32, i32, i32 }** %50, align 8 %53 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %48, i32 0, i32 3 store i32 1, i32* %53, align 4 %54 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %39, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %54, i32 1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @11, i32 0, i32 0), i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont2: ; preds = %ifcont %55 = load %module_call_subroutine_without_type_01.mytype_class*, %module_call_subroutine_without_type_01.mytype_class** %obj, align 8 %56 = bitcast %module_call_subroutine_without_type_01.mytype_class* %55 to void (%module_call_subroutine_without_type_01.mytype_class*)*** %57 = load void (%module_call_subroutine_without_type_01.mytype_class*)**, void (%module_call_subroutine_without_type_01.mytype_class*)*** %56, align 8 %58 = getelementptr inbounds void (%module_call_subroutine_without_type_01.mytype_class*)*, void (%module_call_subroutine_without_type_01.mytype_class*)** %57, i32 3 %59 = load void (%module_call_subroutine_without_type_01.mytype_class*)*, void (%module_call_subroutine_without_type_01.mytype_class*)** %58, align 8 call void %59(%module_call_subroutine_without_type_01.mytype_class* %55) br label %return return: ; preds = %ifcont2 br label %FINALIZE_SYMTABLE_call_subroutine_without_type_01 FINALIZE_SYMTABLE_call_subroutine_without_type_01: ; preds = %return br label %Finalize_Variable_obj Finalize_Variable_obj: ; preds = %FINALIZE_SYMTABLE_call_subroutine_without_type_01 %60 = load %module_call_subroutine_without_type_01.mytype_class*, %module_call_subroutine_without_type_01.mytype_class** %obj, align 8 call void @finalize_allocatable__StructType_Class__mytype_of_module_call_subroutine_without_type_01(%module_call_subroutine_without_type_01.mytype_class* %60) call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) define linkonce_odr void @_copy_module_call_subroutine_without_type_01_mytype(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %module_call_subroutine_without_type_01.mytype* %3 = bitcast i8* %1 to %module_call_subroutine_without_type_01.mytype* %4 = getelementptr %module_call_subroutine_without_type_01.mytype, %module_call_subroutine_without_type_01.mytype* %2, i32 0, i32 0 %5 = load float, float* %4, align 4 %6 = getelementptr %module_call_subroutine_without_type_01.mytype, %module_call_subroutine_without_type_01.mytype* %3, i32 0, i32 0 br i1 true, label %then, label %else then: ; preds = %entry store float %5, float* %6, align 4 br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then ret void } define linkonce_odr void @_allocate_struct_module_call_subroutine_without_type_01_mytype(i8** %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = call i8* @_lfortran_malloc_alloc(i8* %1, i64 16) call void @llvm.memset.p0i8.i32(i8* %2, i8 0, i32 16, i1 false) store i8* %2, i8** %0, align 8 %3 = load i8*, i8** %0, align 8 %4 = bitcast i8* %3 to %module_call_subroutine_without_type_01.mytype_class* %5 = bitcast %module_call_subroutine_without_type_01.mytype_class* %4 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_mytype, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %5, align 8 %6 = getelementptr %module_call_subroutine_without_type_01.mytype_class, %module_call_subroutine_without_type_01.mytype_class* %4, i32 0, i32 1 %7 = call i8* @_lfortran_get_default_allocator() %8 = call i8* @_lfortran_malloc_alloc(i8* %7, i64 4) call void @llvm.memset.p0i8.i32(i8* %8, i8 0, i32 4, i1 false) %9 = bitcast i8* %8 to %module_call_subroutine_without_type_01.mytype* store %module_call_subroutine_without_type_01.mytype* %9, %module_call_subroutine_without_type_01.mytype** %6, align 8 %10 = getelementptr %module_call_subroutine_without_type_01.mytype, %module_call_subroutine_without_type_01.mytype* %9, i32 0, i32 0 ret void } define internal void @finalize_StructType__mytype_of_module_call_subroutine_without_type_01_for_UPoly(i8* %0) { entry: %1 = bitcast i8* %0 to %module_call_subroutine_without_type_01.mytype* ret void } declare i8* @_lcompilers_snprintf_alloc(i8*, i8*, ...) declare void @_lcompilers_runtime_error(i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) define internal void @finalize_allocatable__StructType_Class__mytype_of_module_call_subroutine_without_type_01(%module_call_subroutine_without_type_01.mytype_class* %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = icmp ne %module_call_subroutine_without_type_01.mytype_class* %0, null br i1 %2, label %is_allocated.then, label %is_allocated.else2 is_allocated.then: ; preds = %entry call void @finalize_StructType_Class__mytype_of_module_call_subroutine_without_type_01(%module_call_subroutine_without_type_01.mytype_class* %0) %3 = getelementptr %module_call_subroutine_without_type_01.mytype_class, %module_call_subroutine_without_type_01.mytype_class* %0, i32 0, i32 1 %4 = load %module_call_subroutine_without_type_01.mytype*, %module_call_subroutine_without_type_01.mytype** %3, align 8 %5 = icmp ne %module_call_subroutine_without_type_01.mytype* %4, null br i1 %5, label %is_allocated.then1, label %is_allocated.else is_allocated.then1: ; preds = %is_allocated.then %6 = bitcast %module_call_subroutine_without_type_01.mytype* %4 to i8* call void @_lfortran_free_alloc(i8* %1, i8* %6) br label %is_allocated.ifcont is_allocated.else: ; preds = %is_allocated.then br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %is_allocated.then1 %7 = bitcast %module_call_subroutine_without_type_01.mytype_class* %0 to i8* call void @_lfortran_free_alloc(i8* %1, i8* %7) br label %is_allocated.ifcont3 is_allocated.else2: ; preds = %entry br label %is_allocated.ifcont3 is_allocated.ifcont3: ; preds = %is_allocated.else2, %is_allocated.ifcont ret void } define internal void @finalize_StructType_Class__mytype_of_module_call_subroutine_without_type_01(%module_call_subroutine_without_type_01.mytype_class* %0) { entry: %1 = getelementptr %module_call_subroutine_without_type_01.mytype_class, %module_call_subroutine_without_type_01.mytype_class* %0, i32 0, i32 0 %2 = load i32 (...)**, i32 (...)*** %1, align 8 %3 = getelementptr %module_call_subroutine_without_type_01.mytype_class, %module_call_subroutine_without_type_01.mytype_class* %0, i32 0, i32 1 %4 = load %module_call_subroutine_without_type_01.mytype**, %module_call_subroutine_without_type_01.mytype** %3, align 8 %5 = bitcast %module_call_subroutine_without_type_01.mytype** %4 to i8* %6 = icmp ne i32 (...)** %2, null br i1 %6, label %is_allocated.then, label %is_allocated.else2 is_allocated.then: ; preds = %entry %7 = getelementptr inbounds i32 (...)*, i32 (...)** %2, i32 2 %8 = load i8*, i32 (...)** %7, align 8 %9 = bitcast i8* %8 to void (i8*)* %10 = icmp ne i8* %5, null br i1 %10, label %is_allocated.then1, label %is_allocated.else is_allocated.then1: ; preds = %is_allocated.then call void %9(i8* %5) br label %is_allocated.ifcont is_allocated.else: ; preds = %is_allocated.then br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %is_allocated.then1 br label %is_allocated.ifcont3 is_allocated.else2: ; preds = %entry br label %is_allocated.ifcont3 is_allocated.ifcont3: ; preds = %is_allocated.else2, %is_allocated.ifcont ret void } attributes #0 = { argmemonly nounwind willreturn writeonly } attributes #1 = { argmemonly nounwind willreturn } lfortran-0.63.0/tests/reference/asr-template_error_05-85bce3c.stderr0000664000175000017500000000123515174404631025413 0ustar alastairalastairsemantic error: Restriction type mismatch with provided function argument --> tests/errors/template_error_05.f90:34:33 | 34 | instantiate add_t(real, func_arg_real), only: add_real => add_generic | ^^^^^^^^^^^^^ | 8 | function F(x, y) result(z) | ^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 11 | end function | ...^^^^^^^^^^^^^^^^^^^^ Requirement's return type real | 28 | integer function func_arg_real(x, y) result(z) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 31 | end function | ...^^^^^^^^^^^^^^^^ Function's return type integer lfortran-0.63.0/tests/reference/run-format5-79b3b8f.stdout0000664000175000017500000000017315174404631023426 0ustar alastairalastair-8.4313095911723368E-001 -8.4313095911723368E-002 -8.4313095911723366E+001 10.00000047497451E-04 1.234567890123456E-03 lfortran-0.63.0/tests/reference/asr-array_constructor_with_asterisk_in_type_spec-24efd03.stderr0000664000175000017500000000041515174404631033261 0ustar alastairalastairsemantic error: Type-spec cannot contain an asterisk for a type parameter --> tests/errors/array_constructor_with_asterisk_in_type_spec.f90:2:14 | 2 | print *, [character(*) :: "a", "b", "ball", "cat"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-common_06-4a72d58.stdout0000664000175000017500000001327715174404631023552 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { common_06: (Program (SymbolTable 5 { }) common_06 [] [(SubroutineCall 1 solsy () [] () .false. )] ), file_common_block_ls0001: (Module (SymbolTable 3 { ls0001: (Struct (SymbolTable 4 { rowns: (Variable 4 rowns [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 209 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ls0001 (StructType [] [] .true. .false. ) [] [rowns] [] Source Public .false. .false. [] () () [] ), struct_instance_ls0001: (Variable 3 struct_instance_ls0001 [] Local () () Default (StructType [] [] .true. .false. ) 3 ls0001 Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) file_common_block_ls0001 () [] .false. .false. .false. ), solsy: (Function (SymbolTable 2 { }) solsy (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-selectrank1-ee68c35.stdout0000664000175000017500000000114315174404631024722 0ustar alastairalastairsubroutine process(x) real :: x(..) select rank (x) rank (0) x = 0 rank (2) if (size(x, 2) >= 2) then x(:, 2) = 2 end if rank default print *, "i did not expect rank", rank(x), "shape", shape(x) error stop "process bad arg" end select return end subroutine process subroutine initialize(arg, size) real, contiguous :: arg(..) integer :: size, i select rank (arg) rank (0) ! special case the scalar case arg = 0.0 rank (*) do i = 1, size arg(i) = 0.0 end do end select return end subroutine initialize lfortran-0.63.0/tests/reference/pass_transform_optional_argument_functions-functions_15-581089a.json0000664000175000017500000000115115174404631034001 0ustar alastairalastair{ "basename": "pass_transform_optional_argument_functions-functions_15-581089a", "cmd": "lfortran --pass=transform_optional_argument_functions --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_15.f90", "infile_hash": "a12bb6ea6046f7462606bd7d550d6bc8a46655d6593d5a5e4425d051", "outfile": null, "outfile_hash": null, "stdout": "pass_transform_optional_argument_functions-functions_15-581089a.stdout", "stdout_hash": "20542a19dac95bac5a3990afe6a37bb101e46c181bbb80c88f04ff4f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-subroutine6-b93ebd0.stdout0000664000175000017500000000236215174404631024362 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations template void triad(T0* a, T1* b, float scalar, T2* c); // Implementations template void triad(T0* a, T1* b, float scalar, T2* c) { int32_t i; int32_t j; int32_t n; int32_t n2; n = a->data->extent(0); n2 = b->data->extent(0); Kokkos::parallel_for(Kokkos::RangePolicy(1, n+1), KOKKOS_LAMBDA(const long i) { c->data->operator[](i - c->dims[0].lower_bound) = a->data->operator[](i - a->dims[0].lower_bound) + scalar*b->data->operator[](i - b->dims[0].lower_bound); }); Kokkos::parallel_for(Kokkos::RangePolicy(1, n2+1), KOKKOS_LAMBDA(const long j) { c->data->operator[](j - c->dims[0].lower_bound) = b->data->operator[](j - b->dims[0].lower_bound) + scalar; }); } lfortran-0.63.0/tests/reference/asr-stop-c3f410b.stdout0000664000175000017500000000500715174404631022776 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { stop: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) stop [] [(Assignment (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) Mul (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 25 (Integer 4) Decimal) ) () .false. .false. ) (If () (IntegerCompare (Var 2 x) Eq (IntegerConstant 25 (Integer 4) Decimal) (Logical 4) () ) [(Stop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-case_01-b59db9c.json0000664000175000017500000000073715174404631022757 0ustar alastairalastair{ "basename": "asr-case_01-b59db9c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_01.f90", "infile_hash": "003a23367180e7f228e7e4ef5a6dfdb6749801b29ccf2002e2559e41", "outfile": null, "outfile_hash": null, "stdout": "asr-case_01-b59db9c.stdout", "stdout_hash": "91ca08a9899cb16c75414e9b064cd290d98577a57394ddee0e80d6a0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-expr2-6f9abe8.json0000664000175000017500000000070715174404631022771 0ustar alastairalastair{ "basename": "llvm-expr2-6f9abe8", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/expr2.f90", "infile_hash": "d666975e3f2e2c0cc5c739b85bb21073accdf5692bcb64c9e0278d62", "outfile": null, "outfile_hash": null, "stdout": "llvm-expr2-6f9abe8.stdout", "stdout_hash": "a175968f5745486d7618fda724fb908517cf92395cb9c770646f5ae2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-kind_invalid_int_of_complex-16f8004.json0000664000175000017500000000101515174404631027021 0ustar alastairalastair{ "basename": "asr-kind_invalid_int_of_complex-16f8004", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_invalid_int_of_complex.f90", "infile_hash": "205c807423fafa882814132de129c632af12128a0a16a8ef7cd4b941", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_invalid_int_of_complex-16f8004.stderr", "stderr_hash": "fef4a9d3ffcfe5d1434e10a7d30deff87b0fa9a306a82362b4c68088", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-array_02_pack-233bae0.stdout0000664000175000017500000002254715174404631024433 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array_02_pack: (Program (SymbolTable 2 { m: (Variable 2 m [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), p: (Variable 2 p [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) array_02_pack [] [(Assignment (Var 2 m) (ArrayConstant 16 [1, 0, 0, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 2 p) (IntrinsicArrayFunction Pack [(ArrayPhysicalCast (Var 2 m) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () ) (ArrayPhysicalCast (IntegerCompare (Var 2 m) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () ) (ArrayPhysicalCast (ArrayConstant 16 [0, 0, 3, 4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )] 3 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 p)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntrinsicArrayFunction Any [(ArrayPhysicalCast (IntegerCompare (Var 2 p) NotEq (ArrayConstant 16 [1, 2, 3, 4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-fixed_form3-1e78b3b.stdout0000664000175000017500000000747515174404631024244 0ustar alastairalastair(TranslationUnit [(Function functionf [(n)] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(functionfunctionf [(1 n DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(n [] [] () () None ())] () )] [] [] [] ) (Function f [(endfunctionf)] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(endfunctionf [] [] () () None ())] () )] [(Assignment 0 endfunctionf 4 () )] [] [] ) (Function g [(integerx)] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(integerx [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () )] [(Assignment 0 integerx 5 () ) (Assignment 0 x 5 () ) (Assignment 0 integerx 5 () )] [] [] ) (Function g2 [(integerx)] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(integerx [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () 5 Equal ())] () )] [(Assignment 0 x 5 () ) (Assignment 0 integerx 5 () )] [] [] )] ) lfortran-0.63.0/tests/reference/ast-subroutine3-d7c057c.stdout0000664000175000017500000000055715174404631024314 0ustar alastairalastair(TranslationUnit [(Function f [] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [] [(Assignment 0 f 42 () )] [] [] )] ) lfortran-0.63.0/tests/reference/ast-modules_03-6fa1dfa.stdout0000664000175000017500000003731515174404631024142 0ustar alastairalastair(TranslationUnit [(Module types (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(dp [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(dp [] [] () (FuncCallOrArray kind [] [(() (Real "0.d0") () 0)] [] [] [] ) Equal ())] () )] [] [] ) (Module constants (TriviaNode [(EndOfLine) (Comment "! Some constants" )] [(EndOfLine) (EndOfLine)] ) [(Use [] types [(UseSymbol dp () )] .true. () )] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(pi [] [] () () None ()) (e_ [] [] () () None ()) (i_ [] [] () () None ()) (bohr2ang [] [] () () None ()) (ang2bohr [] [] () () None ()) (Ha2eV [] [] () () None ()) (kB [] [] () () None ()) (K2au [] [] () () None ()) (density2gcm3 [] [] () () None ()) (u2au [] [] () () None ()) (s2au [] [] () () None ()) (kJmol2Ha [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Constants contain more digits than double precision, so that" ) (Comment "! they are rounded correctly. Single letter constants contain underscore so" ) (Comment "! that they do not clash with user variables (\"e\" and \"i\" are frequently used as" ) (Comment "! loop variables)" )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(pi [] [] () (Real "3.1415926535897932384626433832795_dp") Equal ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(e_ [] [] () (Real "2.7182818284590452353602874713527_dp") Equal ())] () ) (Declaration (AttrType TypeComplex [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(i_ [] [] () (Complex 0 1) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(Na [] [] () (Real "6.02214129e23_dp") Equal ())] (TriviaNode [] [(EOLComment "! Avogadro constant" ) (Comment "! Standard uncertainty 0.00000027 (Source: 2010 CODATA)" )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(Ha2eV [] [] () (Real "27.21138505_dp") Equal ())] (TriviaNode [] [(EOLComment "! 1 Ha = (1 * Ha2eV) eV" ) (Comment "! Standard uncertainty is 0.00000060 eV (Source: 2010 CODATA)" ) (EndOfLine)] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(J2Ha [] [] () (Real "2.29371248e17_dp") Equal ())] (TriviaNode [] [(EOLComment "! 1 J = (1 * J2Ha) Ha" ) (Comment "! Standard uncertainty is 0.00000010 eV (Source: 2010 CODATA)" ) (EndOfLine) (Comment "! Reduced Planck constant" )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(hbar [] [] () (Real "1.054571726e-34_dp") Equal ())] (TriviaNode [] [(EOLComment "! [J s]" ) (Comment "! Standard uncertainty is 0.000000047 eV (Source: 2010 CODATA)" ) (EndOfLine) (Comment "! Covert Ha to cm^{-1} (energy equivalent)" ) (Comment "! 1 Ha = (1 * Ha2invcm) cm^{-1}" )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(Ha2invcm [] [] () (Real "219474.6313708_dp") Equal ())] (TriviaNode [] [(EndOfLine) (Comment "! Standard uncertainty is 0.0000011 cm^{-1} (Source: 2010 CODATA)" ) (EndOfLine)] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(kB [] [] () (Real "1.3806488e-23_dp") Equal ())] (TriviaNode [] [(EOLComment "! Boltzmann constant [J/K]" ) (Comment "! Standard uncertainty is 0.0000013 J/K (Source: 2010 CODATA)" ) (EndOfLine)] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(me [] [] () (Real "9.10938291e-31_dp") Equal ())] (TriviaNode [] [(EOLComment "! electron rest mass [kg]" ) (Comment "! Standard uncertainty is 0.00000040 eV (Source: 2010 CODATA)" ) (EndOfLine) (Comment "! Converts K to a.u.:" )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(K2au [] [] () (* J2Ha kB) Equal ())] (TriviaNode [] [(EOLComment "! 1 K = (1 * K2au) a.u." ) (EndOfLine) (Comment "! Conversion between Bohr (Hartree atomic units) and Angstrom" )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(bohr2ang [] [] () (Real "0.529177249_dp") Equal ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(ang2bohr [] [] () (/ 1 bohr2ang) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Converts eV to kcal/mol, it is assumed, that the number in eV is given per" ) (Comment "! molecule. 1 eV = (1 * eV2kcalmol) kcal/mol" )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(kcalmol2kJmol [] [] () (Real "4.184_dp") Equal ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(kJmol2Ha [] [] () (/ (* 1000 J2Ha) Na) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Converts density from a.u. to g/cm^3" )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(density2gcm3 [] [] () (/ (* me (Real "1e3_dp")) (** (* bohr2ang (Real "1e-8_dp")) 3)) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Converts u (atomic mass unit) to a.u." )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(u2au [] [] () (/ 1 (* (* Na me) (Real "1e3_dp"))) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Converts s to a.u." )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(s2au [] [] () (/ 1 (* J2Ha hbar)) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] ) (Program modules_03 () [(Use [] constants [(UseSymbol Ha2eV () )] .true. () )] [] [] [(Print 0 () [Ha2eV] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-expr_13-57b03a6.json0000664000175000017500000000073715174404631022653 0ustar alastairalastair{ "basename": "asr-expr_13-57b03a6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/expr_13.f90", "infile_hash": "2eaa9b9631c66ea28ea4dc4ede8f1a3717f4a929a68455837525f54f", "outfile": null, "outfile_hash": null, "stdout": "asr-expr_13-57b03a6.stdout", "stdout_hash": "59b9359ccb475269c36bd06ab4dfbf159e5f8b3e686ed520dbd8ea38", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-allow_implicit_interface5-6590dfc.stdout0000664000175000017500000002620415174404631027146 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { klvnzo_: (Function (SymbolTable 2 { kd: (Variable 2 kd [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), klvna: (Function (SymbolTable 4 { klvna_arg_0: (Variable 4 klvna_arg_0 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rt: (Variable 4 rt [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) klvna (FunctionType [(Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 klvna_arg_0)] [] () Public .false. .false. () ), nt: (Variable 2 nt [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rt: (Variable 2 rt [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rt0: (Variable 2 rt0 [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zo: (Variable 2 zo [nt] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 nt))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) klvnzo_ (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 nt) (Var 2 kd)] [(SubroutineCall 2 klvna () [((Var 2 rt))] () .false. ) (Return)] () Public .false. .false. () ), main: (Program (SymbolTable 3 { }) main [] [(SubroutineCall 1 klvnzo_ () [((IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 8 (Integer 4) Decimal))] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-use_02-fe85e54.stdout0000664000175000017500000000645715174404631023143 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), use_02: (Program (SymbolTable 7 { dp: (ExternalSymbol 7 dp 4 real64 lfortran_intrinsic_iso_fortran_env [] real64 Public ), i: (Variable 7 i [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) use_02 [use_02_module] [(Assignment (Var 7 i) (IntegerConstant 1234567890123456789 (Integer 8) Decimal) () .false. .false. ) (If () (IntegerCompare (Var 7 i) NotEq (IntegerConstant 1234567890123456789 (Integer 8) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), use_02_module: (Module (SymbolTable 2 { dp: (ExternalSymbol 2 dp 4 real64 lfortran_intrinsic_iso_fortran_env [] real64 Public ) }) use_02_module () [iso_fortran_env] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/run-mre_segfault-52f14b4.json0000664000175000017500000000073715174404631024066 0ustar alastairalastair{ "basename": "run-mre_segfault-52f14b4", "cmd": "lfortran --continue-compilation --no-color {infile}", "infile": "tests/errors/mre_segfault.f90", "infile_hash": "4bbc5104cf76f77bbe94f0bd5a2d2c4558db0315332c74155842e58d", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-mre_segfault-52f14b4.stderr", "stderr_hash": "4a8bc82ac1dcde5689eb3f0031b49058be8b83f63b8b62258c30220e", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-cast_node_m_value-8b7098f.stdout0000664000175000017500000010424315174404631025427 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cast_node_m_value: (Program (SymbolTable 2 { c4_to_c8: (Variable 2 c4_to_c8 [] Local (Cast (ArrayConstructor [(ComplexConstructor (RealConstant 1.000000 (Real 4) ) (RealConstant 0.000000 (Real 4) ) (Complex 4) (ComplexConstant 1.000000 0.000000 (Complex 4) ) ) (ComplexConstructor (RealConstant 2.000000 (Real 4) ) (RealConstant 0.000000 (Real 4) ) (Complex 4) (ComplexConstant 2.000000 0.000000 (Complex 4) ) ) (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 0.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 0.000000 (Complex 4) ) )] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [(1.00000000e+00, 0.00000000e+00), (2.00000000e+00, 0.00000000e+00), (3.00000000e+00, 0.00000000e+00)] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ColMajor () ) ComplexToComplex (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 24 [(1.0000000000000000e+00_8, 0.0000000000000000e+00_8), (2.0000000000000000e+00_8, 0.0000000000000000e+00_8), (3.0000000000000000e+00_8, 0.0000000000000000e+00_8)] (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () ) (ArrayConstant 24 [(1.0000000000000000e+00_8, 0.0000000000000000e+00_8), (2.0000000000000000e+00_8, 0.0000000000000000e+00_8), (3.0000000000000000e+00_8, 0.0000000000000000e+00_8)] (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i4_to_c4: (Variable 2 i4_to_c4 [] Local (Cast (ArrayConstant 12 [1, 2, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) IntegerToComplex (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [(1.00000000e+00, 0.00000000e+00), (2.00000000e+00, 0.00000000e+00), (3.00000000e+00, 0.00000000e+00)] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () ) (ArrayConstant 12 [(1.00000000e+00, 0.00000000e+00), (2.00000000e+00, 0.00000000e+00), (3.00000000e+00, 0.00000000e+00)] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i4_to_c8: (Variable 2 i4_to_c8 [] Local (Cast (ArrayConstant 12 [1, 2, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) IntegerToComplex (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 24 [(1.0000000000000000e+00_8, 0.0000000000000000e+00_8), (2.0000000000000000e+00_8, 0.0000000000000000e+00_8), (3.0000000000000000e+00_8, 0.0000000000000000e+00_8)] (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () ) (ArrayConstant 24 [(1.0000000000000000e+00_8, 0.0000000000000000e+00_8), (2.0000000000000000e+00_8, 0.0000000000000000e+00_8), (3.0000000000000000e+00_8, 0.0000000000000000e+00_8)] (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i4_to_i1: (Variable 2 i4_to_i1 [] Local (Cast (ArrayConstant 12 [1, 2, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) IntegerToInteger (Array (Integer 1) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 3 [1, 2, 3] (Array (Integer 1) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () ) (ArrayConstant 3 [1, 2, 3] (Array (Integer 1) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Integer 1) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i4_to_r4: (Variable 2 i4_to_r4 [] Local (Cast (ArrayConstant 12 [1, 2, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) IntegerToReal (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () ) (ArrayConstant 12 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i4_to_r8: (Variable 2 i4_to_r8 [] Local (Cast (ArrayConstant 12 [1, 2, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) IntegerToReal (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 24 [1.0000000000000000e+00, 2.0000000000000000e+00, 3.0000000000000000e+00] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () ) (ArrayConstant 24 [1.0000000000000000e+00, 2.0000000000000000e+00, 3.0000000000000000e+00] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r4_to_c4: (Variable 2 r4_to_c4 [] Local (Cast (ArrayConstant 12 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) RealToComplex (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [(1.00000000e+00, 0.00000000e+00), (2.00000000e+00, 0.00000000e+00), (3.00000000e+00, 0.00000000e+00)] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () ) (ArrayConstant 12 [(1.00000000e+00, 0.00000000e+00), (2.00000000e+00, 0.00000000e+00), (3.00000000e+00, 0.00000000e+00)] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r4_to_c8: (Variable 2 r4_to_c8 [] Local (Cast (ArrayConstant 12 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) RealToComplex (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 24 [(1.0000000000000000e+00_8, 0.0000000000000000e+00_8), (2.0000000000000000e+00_8, 0.0000000000000000e+00_8), (3.0000000000000000e+00_8, 0.0000000000000000e+00_8)] (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () ) (ArrayConstant 24 [(1.0000000000000000e+00_8, 0.0000000000000000e+00_8), (2.0000000000000000e+00_8, 0.0000000000000000e+00_8), (3.0000000000000000e+00_8, 0.0000000000000000e+00_8)] (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast_node_m_value [] [] ) }) [] ) lfortran-0.63.0/tests/reference/asr-types_02-7a95ae7.json0000664000175000017500000000074215174404631023126 0ustar alastairalastair{ "basename": "asr-types_02-7a95ae7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_02.f90", "infile_hash": "6b9728dd8c74663d697504a17537aef00ed9210bf24fae6e7e0468bc", "outfile": null, "outfile_hash": null, "stdout": "asr-types_02-7a95ae7.stdout", "stdout_hash": "dc9c7dadccfe2f509779ddf449136009b79daa9e0e75f7fe30d8f961", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/tokens-esub2-4cb444d.stderr0000664000175000017500000000017315174404631023535 0ustar alastairalastairtokenizer error: Token '~' is not recognized --> tests/errors/esub2.f90:3:5 | 3 | x = ~1 | ^ token not recognized lfortran-0.63.0/tests/reference/ast-subroutine2-c8b0b6f.stderr0000664000175000017500000000021315174404631024337 0ustar alastairalastairstyle suggestion: Use 'end do' instead of 'enddo' --> tests/subroutine2.f90:75:1 | 75 | enddo | ^^^^^ help: write this as 'end do' lfortran-0.63.0/tests/reference/asr-external5-1198a6f.stdout0000664000175000017500000000603415174404631023656 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { ddet_c: (Function (SymbolTable 2 { }) ddet_c (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .true. .true. () ), ddet_r: (Function (SymbolTable 3 { ddet_c: (Function (SymbolTable 4 { }) ddet_c (FunctionType [] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ) }) ddet_r (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/julia-case_05-f054494.json0000664000175000017500000000073015174404631023051 0ustar alastairalastair{ "basename": "julia-case_05-f054494", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/case_05.f90", "infile_hash": "914477f4a376baf0341e522d2109b6108238cd1d9dfecf969283ab79", "outfile": null, "outfile_hash": null, "stdout": "julia-case_05-f054494.stdout", "stdout_hash": "885953a54b03404cb78a017f766d921f69f9ec2c3d80c6be1b2b9953", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-case_01-b59db9c.stdout0000664000175000017500000002563315174404631023332 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { case_01: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), out: (Variable 2 out [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) case_01 [] [(Assignment (Var 2 i) (Cast (IntegerConstant 4 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 4 (Integer 8) Decimal) () ) () .false. .false. ) (Select () (Var 2 i) [(CaseStmt [(IntegerConstant 1 (Integer 4) Decimal)] [(Assignment (Var 2 out) (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 10 (Integer 8) Decimal) () ) () .false. .false. ) (Print (StringConstant "1" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(IntegerConstant 2 (Integer 4) Decimal)] [(Assignment (Var 2 out) (Cast (IntegerConstant 20 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 20 (Integer 8) Decimal) () ) () .false. .false. ) (Print (StringConstant "2" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(IntegerConstant 3 (Integer 4) Decimal)] [(Assignment (Var 2 out) (Cast (IntegerConstant 30 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 30 (Integer 8) Decimal) () ) () .false. .false. ) (Print (StringConstant "3" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(IntegerConstant 4 (Integer 4) Decimal)] [(Assignment (Var 2 out) (Cast (IntegerConstant 40 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 40 (Integer 8) Decimal) () ) () .false. .false. ) (Print (StringConstant "4" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. )] [] .false. ) (If () (IntegerCompare (Var 2 out) NotEq (Cast (IntegerConstant 40 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 40 (Integer 8) Decimal) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Select () (Var 2 i) [(CaseStmt [(IntegerConstant 1 (Integer 4) Decimal)] [(Assignment (Var 2 out) (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 11 (Integer 8) Decimal) () ) () .false. .false. ) (Print (StringConstant "1" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)] [(Assignment (Var 2 out) (Cast (IntegerConstant 22 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 22 (Integer 8) Decimal) () ) () .false. .false. ) (Print (StringConstant "2,3,4" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. )] [] .false. ) (If () (IntegerCompare (Var 2 out) NotEq (Cast (IntegerConstant 22 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 22 (Integer 8) Decimal) () ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-modules_12-744ab27.json0000664000175000017500000000075015174404631023342 0ustar alastairalastair{ "basename": "asr-modules_12-744ab27", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_12.f90", "infile_hash": "aba2ca12e578c5e6c071c1baf18c66272a5c54a88a9c73d8f05e6196", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_12-744ab27.stdout", "stdout_hash": "0a5a20c84e78e4323031cd040bfff77d3d2d8503d8c1d1fa72b4fddf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-doloop_04-e25bf76.json0000664000175000017500000000075015174404631023442 0ustar alastairalastair{ "basename": "llvm-doloop_04-e25bf76", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_04.f90", "infile_hash": "d2027c560ba8546e31b7627200b8fb28695617c3238a8f1a086c62ef", "outfile": null, "outfile_hash": null, "stdout": "llvm-doloop_04-e25bf76.stdout", "stdout_hash": "7f4df1d6f87de9fcf3ec8ef3b2f34730e26406a04620b1db36f02a54", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-array14-c9f6829.json0000664000175000017500000000066215174404631022714 0ustar alastairalastair{ "basename": "run-array14-c9f6829", "cmd": "lfortran --no-color {infile}", "infile": "tests/array14.f90", "infile_hash": "c9c990e2fa0b1e76065f6886599c9d343b15ecf48d914ce3ade023ac", "outfile": null, "outfile_hash": null, "stdout": "run-array14-c9f6829.stdout", "stdout_hash": "74fc7283130ca59c5e68e5f6922184ad6c4ccd93f238ebfca1ea3632", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-parameter_04-553ff5b.stdout0000664000175000017500000003243315174404631024314 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { parameter_04: (Program (SymbolTable 2 { dp: (Variable 2 dp [] Local (IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 14 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i1: (Variable 2 i1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i2: (Variable 2 i2 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i32: (Variable 2 i32 [] Local (IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 6 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i64: (Variable 2 i64 [] Local (IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 12 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 2 l [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l_knd: (Variable 2 l_knd [] Local (TypeInquiry Kind (Logical 4) (LogicalConstant .true. (Logical 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r1: (Variable 2 r1 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r2: (Variable 2 r2 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sp: (Variable 2 sp [] Local (IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) parameter_04 [] [(Assignment (Var 2 l) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (Print (StringFormat () [(Var 2 l_knd) (Var 2 sp) (Var 2 dp) (Var 2 i32) (Var 2 i64)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/run-print_intrinsics-9b076f7.json0000664000175000017500000000071515174404631025023 0ustar alastairalastair{ "basename": "run-print_intrinsics-9b076f7", "cmd": "lfortran --no-color {infile}", "infile": "tests/print_intrinsics.f90", "infile_hash": "a18c84b05282913a620d056c8183e7e7ee364fcb4accdbc21f4d0b63", "outfile": null, "outfile_hash": null, "stdout": "run-print_intrinsics-9b076f7.stdout", "stdout_hash": "63f79d4a6797570a548e0ba7510455be2c559ac15f7602f38c9bde9e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-array8-7572270.stdout0000664000175000017500000000210015174404631023003 0ustar alastairalastair(TranslationUnit [(Program array8 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeCharacter [(() 255 Value)] () () None ) [] [(a [(1 4 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [] () () None ) [] [(b [(1 4 DimensionExpr)] [] 255 () Asterisk ()) (c [(1 4 DimensionExpr)] [] 255 () Asterisk ())] () )] [] [] )] ) lfortran-0.63.0/tests/reference/julia-arrays_04_func-2fc0cbe.stdout0000664000175000017500000000122015174404631025302 0ustar alastairalastairfunction abs(a::Float32)::Float32 local r::Float32 println("abs") if a > Float32(0) r = a else r = -a end return r end function sum(a::Array{Float32, 1})::Float32 local i::Int32 local r::Float32 println("sum") r = Float32(0) for i ∈ 1:length(a) r = r + a[i] end return r end function main() local a::Array{Float32, 1} local b::Float32 a[1] = Float32(3) a[2] = Float32(2) a[3] = Float32(1) b = sum(Float32(a)) if abs(Float32(b - Float32(6))) > 9.99999974737875164e-06 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-0.63.0/tests/reference/ast_f90-do_concurrent_reduce-9789e1d.json0000664000175000017500000000077415174404631026271 0ustar alastairalastair{ "basename": "ast_f90-do_concurrent_reduce-9789e1d", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/do_concurrent_reduce.f90", "infile_hash": "44ebdebb05b853f4680c203c3b2b0e98e9285d1f3923ecbc255bc105", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-do_concurrent_reduce-9789e1d.stdout", "stdout_hash": "627a29e2f47039f5e4d9ec7862afb81be790dd9febc9f40a629b4c27", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-use_02-fe85e54.json0000664000175000017500000000073415174404631022562 0ustar alastairalastair{ "basename": "asr-use_02-fe85e54", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/use_02.f90", "infile_hash": "2465d081695b10647ab035f666d8e103185c17953126f0aacfcc3ce3", "outfile": null, "outfile_hash": null, "stdout": "asr-use_02-fe85e54.stdout", "stdout_hash": "a028c934e88a17da160d7211572072b3554fff5cf44ae5a250211f7d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-subroutine2-c8b0b6f.json0000664000175000017500000000105015174404631024005 0ustar alastairalastair{ "basename": "ast-subroutine2-c8b0b6f", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine2.f90", "infile_hash": "f7dd567e93e3e5af2c6a514a8f14fb96cad675b0aba7f6659efa28ab", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine2-c8b0b6f.stdout", "stdout_hash": "057757b50b46ad7cf3c81da033a1c3c004228f826859ef94da6dad42", "stderr": "ast-subroutine2-c8b0b6f.stderr", "stderr_hash": "ac34db34d025d0d28eb5d971cf7e3173cfe8f587c51f9e8896e4f2dd", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-dim_assgn_test-4df3c08.json0000664000175000017500000000074615174404631024461 0ustar alastairalastair{ "basename": "asr-dim_assgn_test-4df3c08", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dim_assgn_test.f90", "infile_hash": "d645a2f1de1318c79a1e0d8013eeaf44cff21b86fa0371175e826334", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dim_assgn_test-4df3c08.stderr", "stderr_hash": "89c7bac1821ec608f839ec79381424c02e818b80683bddfd0036ca32", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-global_scope8-240995c.stdout0000664000175000017500000000112015174404631024564 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." @x = global i32 0 define i32 @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i32, align 4 store i32 6, i32* @x, align 4 %0 = load i32, i32* @x, align 4 store i32 %0, i32* %__lfortran_evaluate_11, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return %1 = load i32, i32* %__lfortran_evaluate_11, align 4 ret i32 %1 } lfortran-0.63.0/tests/reference/ast-no_prescan_include1-6ceca31.stdout0000664000175000017500000000362615174404631026016 0ustar alastairalastair(TranslationUnit [(Program if1 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(Assignment 0 i 5 () ) (If 0 () (== i 5) [(Print 0 () [(String "correct" ())] () )] [] () () () ) (If 0 () (== i 6) [(Print 0 () [(String "incorrect" ())] () )] [] () () () ) (Assignment 0 i (u- 2) () ) (Assignment 40 i (+ i 1) () ) (IfArithmetic 0 () i 50 60 70 () ) (Print 50 () [(String "i < 0" ())] () ) (GoTo 0 () 40 [] () ) (Print 60 () [(String "i == 0" ())] () ) (GoTo 0 () 40 [] () ) (Print 70 () [(String "i > 0" ())] () )] [] )] ) lfortran-0.63.0/tests/reference/asr-complex_dp_param-b21353f.stdout0000664000175000017500000002100415174404631025241 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex_dp_param: (Program (SymbolTable 2 { prec1: (Variable 2 prec1 [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), prec2: (Variable 2 prec2 [] Local (IntegerConstant 8 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u: (Variable 2 u [] Local (ComplexConstructor (RealConstant 1.050000 (Real 4) ) (RealConstant 1.050000 (Real 4) ) (Complex 4) (ComplexConstant 1.050000 1.050000 (Complex 4) ) ) (ComplexConstant 1.050000 1.050000 (Complex 4) ) Save (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 2 v [] Local (ComplexConstructor (RealConstant 1.050000 (Real 4) ) (RealConstant 1.050000 (Real 8) ) (Complex 8) (ComplexConstant 1.050000 1.050000 (Complex 8) ) ) (ComplexConstant 1.050000 1.050000 (Complex 8) ) Save (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zero: (Variable 2 zero [] Local (Cast (RealConstant 0.000000 (Real 4) ) RealToComplex (Complex 8) (ComplexConstant 0.000000 0.000000 (Complex 8) ) () ) (ComplexConstant 0.000000 0.000000 (Complex 8) ) Save (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) complex_dp_param [] [(Print (StringFormat () [(Var 2 u) (Var 2 v) (Var 2 zero)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr_openmp-openmp_44-1c0f6fe.json0000664000175000017500000000077415174404631024721 0ustar alastairalastair{ "basename": "asr_openmp-openmp_44-1c0f6fe", "cmd": "lfortran --show-asr --no-color --openmp {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_44.f90", "infile_hash": "7f52b7f964df7c09c7339881973e424ae1381de1034a007c5312b86f", "outfile": null, "outfile_hash": null, "stdout": "asr_openmp-openmp_44-1c0f6fe.stdout", "stdout_hash": "1079030b7dfa07c7bf3d8fb428ef4db01b4790d5bad5697cd0a4160a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor16-b846504.stdout0000664000175000017500000000224115174404631027022 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { test_cpp_hex: (Program (SymbolTable 2 { }) test_cpp_hex [] [(Print (StringConstant "yes hex and int equal" (String 1 (IntegerConstant 21 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "yes hex and bin equal" (String 1 (IntegerConstant 21 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "yes bin and int equal" (String 1 (IntegerConstant 21 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-arrays_03_func-7c8d572.json0000664000175000017500000000076415174404631024224 0ustar alastairalastair{ "basename": "asr-arrays_03_func-7c8d572", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_03_func.f90", "infile_hash": "9feab893fd240821f352bd8b0c12cb132cf39c706950d08f5a41cc54", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_03_func-7c8d572.stdout", "stdout_hash": "179ee0d69343fa209e4132625b8b3ac7c13e948c68cb0215ab26388d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-arrays_01_complex-c90dbdd.stdout0000664000175000017500000040733215174404631025704 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %complex_4 = type <{ float, float }> @0 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @1 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @2 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @3 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @5 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @6 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @7 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @11 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @12 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @13 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @17 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @18 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @19 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @21 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @23 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @24 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @25 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @27 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @28 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @29 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @31 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @32 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @33 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @34 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @35 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @37 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @39 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @40 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @41 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @43 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @44 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @45 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @46 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @47 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @48 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @49 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @50 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @51 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @52 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @53 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @54 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @55 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @56 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @57 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @58 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @59 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @60 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @61 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @62 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @63 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @64 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @65 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @66 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @67 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @68 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @69 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @70 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @71 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @72 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @73 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @74 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @75 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @76 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @77 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @78 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @79 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @80 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @81 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @82 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @83 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @84 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @85 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @86 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @87 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @88 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @89 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @90 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @91 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @92 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @93 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @94 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @95 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @96 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @97 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @98 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @99 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @100 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @101 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @102 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @103 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @104 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @105 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @106 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @107 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @108 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @109 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @110 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @111 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @112 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @113 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @114 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @115 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @116 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @117 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @118 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @119 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @120 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @121 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @122 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @123 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @124 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @125 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @126 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @127 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @128 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @129 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @130 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @131 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @132 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @133 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @134 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @135 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @136 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @137 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @138 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @139 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @140 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @141 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @142 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @143 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @144 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @145 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @146 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @147 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @148 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @149 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @150 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @151 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @152 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @153 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @154 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @155 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @156 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @157 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @158 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @159 = private unnamed_addr constant [49 x i8] c"tests/../integration_tests/arrays_01_complex.f90\00", align 1 @160 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @161 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @162 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @163 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca [3 x %complex_4], align 8 %b = alloca [4 x %complex_4], align 8 %c = alloca [4 x %complex_4], align 8 %i = alloca i32, align 4 %j = alloca i32, align 4 store i32 0, i32* %i, align 4 br label %loop.head loop.head: ; preds = %ifcont, %.entry %3 = load i32, i32* %i, align 4 %4 = add i32 %3, 1 %5 = icmp sle i32 %4, 3 br i1 %5, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %6 = load i32, i32* %i, align 4 %7 = add i32 %6, 1 store i32 %7, i32* %i, align 4 %8 = load i32, i32* %i, align 4 %9 = sext i32 %8 to i64 %10 = sub i64 %9, 1 %11 = mul i64 1, %10 %12 = add i64 0, %11 %13 = icmp slt i64 %9, 1 %14 = icmp sgt i64 %9, 3 %15 = or i1 %13, %14 br i1 %15, label %then, label %ifcont then: ; preds = %loop.body %16 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %17 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %18 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %17, i32 0, i32 0 %19 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @1, i32 0, i32 0), i8** %19, align 8 %20 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 1 store i32 6, i32* %20, align 4 %21 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 2 store i32 5, i32* %21, align 4 %22 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 3 store i32 6, i32* %22, align 4 %23 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %18, i32 0, i32 4 store i32 8, i32* %23, align 4 %24 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @2, i32 0, i32 0)) %25 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %16, i32 0, i32 0 %26 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %17, i32 0, i32 0 %27 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %25, i32 0, i32 2 %28 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %25, i32 0, i32 0 store i1 true, i1* %28, align 1 %29 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %25, i32 0, i32 1 store i8* %24, i8** %29, align 8 store { i8*, i32, i32, i32, i32 }* %26, { i8*, i32, i32, i32, i32 }** %27, align 8 %30 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %25, i32 0, i32 3 store i32 1, i32* %30, align 4 %31 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %16, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %31, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i64 %9, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont: ; preds = %loop.body %32 = getelementptr [3 x %complex_4], [3 x %complex_4]* %a, i32 0, i64 %12 %33 = load i32, i32* %i, align 4 %34 = add i32 %33, 10 %35 = sitofp i32 %34 to float %36 = insertvalue %complex_4 undef, float %35, 0 %37 = insertvalue %complex_4 %36, float 0.000000e+00, 1 store %complex_4 %37, %complex_4* %32, align 1 br label %loop.head loop.end: ; preds = %loop.head br i1 false, label %then1, label %ifcont2 then1: ; preds = %loop.end %38 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %39 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %40 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %39, i32 0, i32 0 %41 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %40, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @5, i32 0, i32 0), i8** %41, align 8 %42 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %40, i32 0, i32 1 store i32 8, i32* %42, align 4 %43 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %40, i32 0, i32 2 store i32 5, i32* %43, align 4 %44 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %40, i32 0, i32 3 store i32 8, i32* %44, align 4 %45 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %40, i32 0, i32 4 store i32 8, i32* %45, align 4 %46 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @6, i32 0, i32 0)) %47 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %38, i32 0, i32 0 %48 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %39, i32 0, i32 0 %49 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %47, i32 0, i32 2 %50 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %47, i32 0, i32 0 store i1 true, i1* %50, align 1 %51 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %47, i32 0, i32 1 store i8* %46, i8** %51, align 8 store { i8*, i32, i32, i32, i32 }* %48, { i8*, i32, i32, i32, i32 }** %49, align 8 %52 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %47, i32 0, i32 3 store i32 1, i32* %52, align 4 %53 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %38, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %53, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i64 1, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont2: ; preds = %loop.end %54 = getelementptr [3 x %complex_4], [3 x %complex_4]* %a, i32 0, i64 0 %55 = load %complex_4, %complex_4* %54, align 1 %56 = extractvalue %complex_4 %55, 0 %57 = extractvalue %complex_4 %55, 1 %58 = fcmp one float %56, 1.100000e+01 %59 = fcmp one float %57, 0.000000e+00 %60 = or i1 %58, %59 br i1 %60, label %then3, label %else then3: ; preds = %ifcont2 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont4 else: ; preds = %ifcont2 br label %ifcont4 ifcont4: ; preds = %else, %then3 br i1 false, label %then5, label %ifcont6 then5: ; preds = %ifcont4 %61 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %62 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %63 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %62, i32 0, i32 0 %64 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %63, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @11, i32 0, i32 0), i8** %64, align 8 %65 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %63, i32 0, i32 1 store i32 9, i32* %65, align 4 %66 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %63, i32 0, i32 2 store i32 5, i32* %66, align 4 %67 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %63, i32 0, i32 3 store i32 9, i32* %67, align 4 %68 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %63, i32 0, i32 4 store i32 8, i32* %68, align 4 %69 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @12, i32 0, i32 0)) %70 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %61, i32 0, i32 0 %71 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %62, i32 0, i32 0 %72 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %70, i32 0, i32 2 %73 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %70, i32 0, i32 0 store i1 true, i1* %73, align 1 %74 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %70, i32 0, i32 1 store i8* %69, i8** %74, align 8 store { i8*, i32, i32, i32, i32 }* %71, { i8*, i32, i32, i32, i32 }** %72, align 8 %75 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %70, i32 0, i32 3 store i32 1, i32* %75, align 4 %76 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %61, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %76, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i64 2, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont6: ; preds = %ifcont4 %77 = getelementptr [3 x %complex_4], [3 x %complex_4]* %a, i32 0, i64 1 %78 = load %complex_4, %complex_4* %77, align 1 %79 = extractvalue %complex_4 %78, 0 %80 = extractvalue %complex_4 %78, 1 %81 = fcmp one float %79, 1.200000e+01 %82 = fcmp one float %80, 0.000000e+00 %83 = or i1 %81, %82 br i1 %83, label %then7, label %else8 then7: ; preds = %ifcont6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 br i1 false, label %then10, label %ifcont11 then10: ; preds = %ifcont9 %84 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %85 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %86 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %85, i32 0, i32 0 %87 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %86, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @17, i32 0, i32 0), i8** %87, align 8 %88 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %86, i32 0, i32 1 store i32 10, i32* %88, align 4 %89 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %86, i32 0, i32 2 store i32 5, i32* %89, align 4 %90 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %86, i32 0, i32 3 store i32 10, i32* %90, align 4 %91 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %86, i32 0, i32 4 store i32 8, i32* %91, align 4 %92 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @18, i32 0, i32 0)) %93 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %84, i32 0, i32 0 %94 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %85, i32 0, i32 0 %95 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %93, i32 0, i32 2 %96 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %93, i32 0, i32 0 store i1 true, i1* %96, align 1 %97 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %93, i32 0, i32 1 store i8* %92, i8** %97, align 8 store { i8*, i32, i32, i32, i32 }* %94, { i8*, i32, i32, i32, i32 }** %95, align 8 %98 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %93, i32 0, i32 3 store i32 1, i32* %98, align 4 %99 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %84, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %99, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0), i64 3, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont11: ; preds = %ifcont9 %100 = getelementptr [3 x %complex_4], [3 x %complex_4]* %a, i32 0, i64 2 %101 = load %complex_4, %complex_4* %100, align 1 %102 = extractvalue %complex_4 %101, 0 %103 = extractvalue %complex_4 %101, 1 %104 = fcmp one float %102, 1.300000e+01 %105 = fcmp one float %103, 0.000000e+00 %106 = or i1 %104, %105 br i1 %106, label %then12, label %else13 then12: ; preds = %ifcont11 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont14 else13: ; preds = %ifcont11 br label %ifcont14 ifcont14: ; preds = %else13, %then12 store i32 10, i32* %i, align 4 br label %loop.head15 loop.head15: ; preds = %ifcont18, %ifcont14 %107 = load i32, i32* %i, align 4 %108 = add i32 %107, 1 %109 = icmp sle i32 %108, 14 br i1 %109, label %loop.body16, label %loop.end19 loop.body16: ; preds = %loop.head15 %110 = load i32, i32* %i, align 4 %111 = add i32 %110, 1 store i32 %111, i32* %i, align 4 %112 = load i32, i32* %i, align 4 %113 = sub i32 %112, 10 %114 = sext i32 %113 to i64 %115 = sub i64 %114, 1 %116 = mul i64 1, %115 %117 = add i64 0, %116 %118 = icmp slt i64 %114, 1 %119 = icmp sgt i64 %114, 4 %120 = or i1 %118, %119 br i1 %120, label %then17, label %ifcont18 then17: ; preds = %loop.body16 %121 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %122 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %123 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %122, i32 0, i32 0 %124 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %123, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @23, i32 0, i32 0), i8** %124, align 8 %125 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %123, i32 0, i32 1 store i32 13, i32* %125, align 4 %126 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %123, i32 0, i32 2 store i32 5, i32* %126, align 4 %127 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %123, i32 0, i32 3 store i32 13, i32* %127, align 4 %128 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %123, i32 0, i32 4 store i32 11, i32* %128, align 4 %129 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @24, i32 0, i32 0)) %130 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %121, i32 0, i32 0 %131 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %122, i32 0, i32 0 %132 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %130, i32 0, i32 2 %133 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %130, i32 0, i32 0 store i1 true, i1* %133, align 1 %134 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %130, i32 0, i32 1 store i8* %129, i8** %134, align 8 store { i8*, i32, i32, i32, i32 }* %131, { i8*, i32, i32, i32, i32 }** %132, align 8 %135 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %130, i32 0, i32 3 store i32 1, i32* %135, align 4 %136 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %121, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %136, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0), i64 %114, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont18: ; preds = %loop.body16 %137 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i64 %117 %138 = load i32, i32* %i, align 4 %139 = sitofp i32 %138 to float %140 = insertvalue %complex_4 undef, float %139, 0 %141 = insertvalue %complex_4 %140, float 0.000000e+00, 1 store %complex_4 %141, %complex_4* %137, align 1 br label %loop.head15 loop.end19: ; preds = %loop.head15 br i1 false, label %then20, label %ifcont21 then20: ; preds = %loop.end19 %142 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %143 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %144 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %143, i32 0, i32 0 %145 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %144, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @27, i32 0, i32 0), i8** %145, align 8 %146 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %144, i32 0, i32 1 store i32 15, i32* %146, align 4 %147 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %144, i32 0, i32 2 store i32 5, i32* %147, align 4 %148 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %144, i32 0, i32 3 store i32 15, i32* %148, align 4 %149 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %144, i32 0, i32 4 store i32 8, i32* %149, align 4 %150 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @28, i32 0, i32 0)) %151 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %142, i32 0, i32 0 %152 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %143, i32 0, i32 0 %153 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %151, i32 0, i32 2 %154 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %151, i32 0, i32 0 store i1 true, i1* %154, align 1 %155 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %151, i32 0, i32 1 store i8* %150, i8** %155, align 8 store { i8*, i32, i32, i32, i32 }* %152, { i8*, i32, i32, i32, i32 }** %153, align 8 %156 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %151, i32 0, i32 3 store i32 1, i32* %156, align 4 %157 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %142, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %157, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @29, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0), i64 1, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont21: ; preds = %loop.end19 %158 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i64 0 %159 = load %complex_4, %complex_4* %158, align 1 %160 = extractvalue %complex_4 %159, 0 %161 = extractvalue %complex_4 %159, 1 %162 = fcmp one float %160, 1.100000e+01 %163 = fcmp one float %161, 0.000000e+00 %164 = or i1 %162, %163 br i1 %164, label %then22, label %else23 then22: ; preds = %ifcont21 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @31, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont24 else23: ; preds = %ifcont21 br label %ifcont24 ifcont24: ; preds = %else23, %then22 br i1 false, label %then25, label %ifcont26 then25: ; preds = %ifcont24 %165 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %166 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %167 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %166, i32 0, i32 0 %168 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %167, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @33, i32 0, i32 0), i8** %168, align 8 %169 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %167, i32 0, i32 1 store i32 16, i32* %169, align 4 %170 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %167, i32 0, i32 2 store i32 5, i32* %170, align 4 %171 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %167, i32 0, i32 3 store i32 16, i32* %171, align 4 %172 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %167, i32 0, i32 4 store i32 8, i32* %172, align 4 %173 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @34, i32 0, i32 0)) %174 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %165, i32 0, i32 0 %175 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %166, i32 0, i32 0 %176 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %174, i32 0, i32 2 %177 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %174, i32 0, i32 0 store i1 true, i1* %177, align 1 %178 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %174, i32 0, i32 1 store i8* %173, i8** %178, align 8 store { i8*, i32, i32, i32, i32 }* %175, { i8*, i32, i32, i32, i32 }** %176, align 8 %179 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %174, i32 0, i32 3 store i32 1, i32* %179, align 4 %180 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %165, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %180, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @35, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @32, i32 0, i32 0), i64 2, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont26: ; preds = %ifcont24 %181 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i64 1 %182 = load %complex_4, %complex_4* %181, align 1 %183 = extractvalue %complex_4 %182, 0 %184 = extractvalue %complex_4 %182, 1 %185 = fcmp one float %183, 1.200000e+01 %186 = fcmp one float %184, 0.000000e+00 %187 = or i1 %185, %186 br i1 %187, label %then27, label %else28 then27: ; preds = %ifcont26 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @37, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont29 else28: ; preds = %ifcont26 br label %ifcont29 ifcont29: ; preds = %else28, %then27 br i1 false, label %then30, label %ifcont31 then30: ; preds = %ifcont29 %188 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %189 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %190 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %189, i32 0, i32 0 %191 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %190, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @39, i32 0, i32 0), i8** %191, align 8 %192 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %190, i32 0, i32 1 store i32 17, i32* %192, align 4 %193 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %190, i32 0, i32 2 store i32 5, i32* %193, align 4 %194 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %190, i32 0, i32 3 store i32 17, i32* %194, align 4 %195 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %190, i32 0, i32 4 store i32 8, i32* %195, align 4 %196 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @40, i32 0, i32 0)) %197 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %188, i32 0, i32 0 %198 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %189, i32 0, i32 0 %199 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %197, i32 0, i32 2 %200 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %197, i32 0, i32 0 store i1 true, i1* %200, align 1 %201 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %197, i32 0, i32 1 store i8* %196, i8** %201, align 8 store { i8*, i32, i32, i32, i32 }* %198, { i8*, i32, i32, i32, i32 }** %199, align 8 %202 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %197, i32 0, i32 3 store i32 1, i32* %202, align 4 %203 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %188, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %203, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0), i64 3, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont31: ; preds = %ifcont29 %204 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i64 2 %205 = load %complex_4, %complex_4* %204, align 1 %206 = extractvalue %complex_4 %205, 0 %207 = extractvalue %complex_4 %205, 1 %208 = fcmp one float %206, 1.300000e+01 %209 = fcmp one float %207, 0.000000e+00 %210 = or i1 %208, %209 br i1 %210, label %then32, label %else33 then32: ; preds = %ifcont31 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @43, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont34 else33: ; preds = %ifcont31 br label %ifcont34 ifcont34: ; preds = %else33, %then32 br i1 false, label %then35, label %ifcont36 then35: ; preds = %ifcont34 %211 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %212 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %213 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %212, i32 0, i32 0 %214 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %213, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @45, i32 0, i32 0), i8** %214, align 8 %215 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %213, i32 0, i32 1 store i32 18, i32* %215, align 4 %216 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %213, i32 0, i32 2 store i32 5, i32* %216, align 4 %217 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %213, i32 0, i32 3 store i32 18, i32* %217, align 4 %218 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %213, i32 0, i32 4 store i32 8, i32* %218, align 4 %219 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @46, i32 0, i32 0)) %220 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %211, i32 0, i32 0 %221 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %212, i32 0, i32 0 %222 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %220, i32 0, i32 2 %223 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %220, i32 0, i32 0 store i1 true, i1* %223, align 1 %224 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %220, i32 0, i32 1 store i8* %219, i8** %224, align 8 store { i8*, i32, i32, i32, i32 }* %221, { i8*, i32, i32, i32, i32 }** %222, align 8 %225 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %220, i32 0, i32 3 store i32 1, i32* %225, align 4 %226 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %211, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %226, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @47, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @44, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont36: ; preds = %ifcont34 %227 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i64 3 %228 = load %complex_4, %complex_4* %227, align 1 %229 = extractvalue %complex_4 %228, 0 %230 = extractvalue %complex_4 %228, 1 %231 = fcmp one float %229, 1.400000e+01 %232 = fcmp one float %230, 0.000000e+00 %233 = or i1 %231, %232 br i1 %233, label %then37, label %else38 then37: ; preds = %ifcont36 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @49, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @48, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont39 else38: ; preds = %ifcont36 br label %ifcont39 ifcont39: ; preds = %else38, %then37 store i32 0, i32* %i, align 4 br label %loop.head40 loop.head40: ; preds = %ifcont45, %ifcont39 %234 = load i32, i32* %i, align 4 %235 = add i32 %234, 1 %236 = icmp sle i32 %235, 3 br i1 %236, label %loop.body41, label %loop.end46 loop.body41: ; preds = %loop.head40 %237 = load i32, i32* %i, align 4 %238 = add i32 %237, 1 store i32 %238, i32* %i, align 4 %239 = load i32, i32* %i, align 4 %240 = sext i32 %239 to i64 %241 = sub i64 %240, 1 %242 = mul i64 1, %241 %243 = add i64 0, %242 %244 = icmp slt i64 %240, 1 %245 = icmp sgt i64 %240, 4 %246 = or i1 %244, %245 br i1 %246, label %then42, label %ifcont43 then42: ; preds = %loop.body41 %247 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %248 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %249 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %248, i32 0, i32 0 %250 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %249, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @51, i32 0, i32 0), i8** %250, align 8 %251 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %249, i32 0, i32 1 store i32 21, i32* %251, align 4 %252 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %249, i32 0, i32 2 store i32 5, i32* %252, align 4 %253 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %249, i32 0, i32 3 store i32 21, i32* %253, align 4 %254 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %249, i32 0, i32 4 store i32 8, i32* %254, align 4 %255 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @52, i32 0, i32 0)) %256 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %247, i32 0, i32 0 %257 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %248, i32 0, i32 0 %258 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %256, i32 0, i32 2 %259 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %256, i32 0, i32 0 store i1 true, i1* %259, align 1 %260 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %256, i32 0, i32 1 store i8* %255, i8** %260, align 8 store { i8*, i32, i32, i32, i32 }* %257, { i8*, i32, i32, i32, i32 }** %258, align 8 %261 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %256, i32 0, i32 3 store i32 1, i32* %261, align 4 %262 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %247, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %262, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @53, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @50, i32 0, i32 0), i64 %240, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont43: ; preds = %loop.body41 %263 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i64 %243 %264 = load i32, i32* %i, align 4 %265 = sext i32 %264 to i64 %266 = sub i64 %265, 1 %267 = mul i64 1, %266 %268 = add i64 0, %267 %269 = icmp slt i64 %265, 1 %270 = icmp sgt i64 %265, 3 %271 = or i1 %269, %270 br i1 %271, label %then44, label %ifcont45 then44: ; preds = %ifcont43 %272 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %273 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %274 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %273, i32 0, i32 0 %275 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %274, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @55, i32 0, i32 0), i8** %275, align 8 %276 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %274, i32 0, i32 1 store i32 21, i32* %276, align 4 %277 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %274, i32 0, i32 2 store i32 12, i32* %277, align 4 %278 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %274, i32 0, i32 3 store i32 21, i32* %278, align 4 %279 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %274, i32 0, i32 4 store i32 15, i32* %279, align 4 %280 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @56, i32 0, i32 0)) %281 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %272, i32 0, i32 0 %282 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %273, i32 0, i32 0 %283 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %281, i32 0, i32 2 %284 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %281, i32 0, i32 0 store i1 true, i1* %284, align 1 %285 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %281, i32 0, i32 1 store i8* %280, i8** %285, align 8 store { i8*, i32, i32, i32, i32 }* %282, { i8*, i32, i32, i32, i32 }** %283, align 8 %286 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %281, i32 0, i32 3 store i32 1, i32* %286, align 4 %287 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %272, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %287, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @57, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @54, i32 0, i32 0), i64 %265, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont45: ; preds = %ifcont43 %288 = getelementptr [3 x %complex_4], [3 x %complex_4]* %a, i32 0, i64 %268 %289 = load %complex_4, %complex_4* %288, align 1 %290 = extractvalue %complex_4 %289, 0 %291 = extractvalue %complex_4 %289, 1 %292 = fsub float %290, 1.000000e+01 %293 = fsub float %291, 0.000000e+00 %294 = insertvalue %complex_4 undef, float %292, 0 %295 = insertvalue %complex_4 %294, float %293, 1 store %complex_4 %295, %complex_4* %263, align 1 br label %loop.head40 loop.end46: ; preds = %loop.head40 br i1 false, label %then47, label %ifcont48 then47: ; preds = %loop.end46 %296 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %297 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %298 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %297, i32 0, i32 0 %299 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %298, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @59, i32 0, i32 0), i8** %299, align 8 %300 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %298, i32 0, i32 1 store i32 23, i32* %300, align 4 %301 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %298, i32 0, i32 2 store i32 5, i32* %301, align 4 %302 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %298, i32 0, i32 3 store i32 23, i32* %302, align 4 %303 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %298, i32 0, i32 4 store i32 8, i32* %303, align 4 %304 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @60, i32 0, i32 0)) %305 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %296, i32 0, i32 0 %306 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %297, i32 0, i32 0 %307 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %305, i32 0, i32 2 %308 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %305, i32 0, i32 0 store i1 true, i1* %308, align 1 %309 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %305, i32 0, i32 1 store i8* %304, i8** %309, align 8 store { i8*, i32, i32, i32, i32 }* %306, { i8*, i32, i32, i32, i32 }** %307, align 8 %310 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %305, i32 0, i32 3 store i32 1, i32* %310, align 4 %311 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %296, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %311, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @61, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @58, i32 0, i32 0), i64 1, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont48: ; preds = %loop.end46 %312 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i64 0 %313 = load %complex_4, %complex_4* %312, align 1 %314 = extractvalue %complex_4 %313, 0 %315 = extractvalue %complex_4 %313, 1 %316 = fcmp one float %314, 1.000000e+00 %317 = fcmp one float %315, 0.000000e+00 %318 = or i1 %316, %317 br i1 %318, label %then49, label %else50 then49: ; preds = %ifcont48 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @63, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @62, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont51 else50: ; preds = %ifcont48 br label %ifcont51 ifcont51: ; preds = %else50, %then49 br i1 false, label %then52, label %ifcont53 then52: ; preds = %ifcont51 %319 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %320 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %321 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %320, i32 0, i32 0 %322 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %321, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @65, i32 0, i32 0), i8** %322, align 8 %323 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %321, i32 0, i32 1 store i32 24, i32* %323, align 4 %324 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %321, i32 0, i32 2 store i32 5, i32* %324, align 4 %325 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %321, i32 0, i32 3 store i32 24, i32* %325, align 4 %326 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %321, i32 0, i32 4 store i32 8, i32* %326, align 4 %327 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @66, i32 0, i32 0)) %328 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %319, i32 0, i32 0 %329 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %320, i32 0, i32 0 %330 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %328, i32 0, i32 2 %331 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %328, i32 0, i32 0 store i1 true, i1* %331, align 1 %332 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %328, i32 0, i32 1 store i8* %327, i8** %332, align 8 store { i8*, i32, i32, i32, i32 }* %329, { i8*, i32, i32, i32, i32 }** %330, align 8 %333 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %328, i32 0, i32 3 store i32 1, i32* %333, align 4 %334 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %319, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %334, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @67, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @64, i32 0, i32 0), i64 2, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont53: ; preds = %ifcont51 %335 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i64 1 %336 = load %complex_4, %complex_4* %335, align 1 %337 = extractvalue %complex_4 %336, 0 %338 = extractvalue %complex_4 %336, 1 %339 = fcmp one float %337, 2.000000e+00 %340 = fcmp one float %338, 0.000000e+00 %341 = or i1 %339, %340 br i1 %341, label %then54, label %else55 then54: ; preds = %ifcont53 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @69, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @68, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont56 else55: ; preds = %ifcont53 br label %ifcont56 ifcont56: ; preds = %else55, %then54 br i1 false, label %then57, label %ifcont58 then57: ; preds = %ifcont56 %342 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %343 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %344 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %343, i32 0, i32 0 %345 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %344, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @71, i32 0, i32 0), i8** %345, align 8 %346 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %344, i32 0, i32 1 store i32 25, i32* %346, align 4 %347 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %344, i32 0, i32 2 store i32 5, i32* %347, align 4 %348 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %344, i32 0, i32 3 store i32 25, i32* %348, align 4 %349 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %344, i32 0, i32 4 store i32 8, i32* %349, align 4 %350 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @72, i32 0, i32 0)) %351 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %342, i32 0, i32 0 %352 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %343, i32 0, i32 0 %353 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %351, i32 0, i32 2 %354 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %351, i32 0, i32 0 store i1 true, i1* %354, align 1 %355 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %351, i32 0, i32 1 store i8* %350, i8** %355, align 8 store { i8*, i32, i32, i32, i32 }* %352, { i8*, i32, i32, i32, i32 }** %353, align 8 %356 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %351, i32 0, i32 3 store i32 1, i32* %356, align 4 %357 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %342, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %357, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @73, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @70, i32 0, i32 0), i64 3, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont58: ; preds = %ifcont56 %358 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i64 2 %359 = load %complex_4, %complex_4* %358, align 1 %360 = extractvalue %complex_4 %359, 0 %361 = extractvalue %complex_4 %359, 1 %362 = fcmp one float %360, 3.000000e+00 %363 = fcmp one float %361, 0.000000e+00 %364 = or i1 %362, %363 br i1 %364, label %then59, label %else60 then59: ; preds = %ifcont58 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @75, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @74, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont61 else60: ; preds = %ifcont58 br label %ifcont61 ifcont61: ; preds = %else60, %then59 br i1 false, label %then62, label %ifcont63 then62: ; preds = %ifcont61 %365 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %366 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %367 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %366, i32 0, i32 0 %368 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %367, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @77, i32 0, i32 0), i8** %368, align 8 %369 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %367, i32 0, i32 1 store i32 27, i32* %369, align 4 %370 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %367, i32 0, i32 2 store i32 1, i32* %370, align 4 %371 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %367, i32 0, i32 3 store i32 27, i32* %371, align 4 %372 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %367, i32 0, i32 4 store i32 4, i32* %372, align 4 %373 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @78, i32 0, i32 0)) %374 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %365, i32 0, i32 0 %375 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %366, i32 0, i32 0 %376 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %374, i32 0, i32 2 %377 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %374, i32 0, i32 0 store i1 true, i1* %377, align 1 %378 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %374, i32 0, i32 1 store i8* %373, i8** %378, align 8 store { i8*, i32, i32, i32, i32 }* %375, { i8*, i32, i32, i32, i32 }** %376, align 8 %379 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %374, i32 0, i32 3 store i32 1, i32* %379, align 4 %380 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %365, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %380, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @79, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @76, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont63: ; preds = %ifcont61 %381 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i64 3 br i1 false, label %then64, label %ifcont65 then64: ; preds = %ifcont63 %382 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %383 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %384 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %383, i32 0, i32 0 %385 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %384, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @81, i32 0, i32 0), i8** %385, align 8 %386 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %384, i32 0, i32 1 store i32 27, i32* %386, align 4 %387 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %384, i32 0, i32 2 store i32 8, i32* %387, align 4 %388 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %384, i32 0, i32 3 store i32 27, i32* %388, align 4 %389 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %384, i32 0, i32 4 store i32 11, i32* %389, align 4 %390 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @82, i32 0, i32 0)) %391 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %382, i32 0, i32 0 %392 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %383, i32 0, i32 0 %393 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %391, i32 0, i32 2 %394 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %391, i32 0, i32 0 store i1 true, i1* %394, align 1 %395 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %391, i32 0, i32 1 store i8* %390, i8** %395, align 8 store { i8*, i32, i32, i32, i32 }* %392, { i8*, i32, i32, i32, i32 }** %393, align 8 %396 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %391, i32 0, i32 3 store i32 1, i32* %396, align 4 %397 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %382, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %397, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @83, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @80, i32 0, i32 0), i64 1, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont65: ; preds = %ifcont63 %398 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i64 0 %399 = load %complex_4, %complex_4* %398, align 1 br i1 false, label %then66, label %ifcont67 then66: ; preds = %ifcont65 %400 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %401 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %402 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %401, i32 0, i32 0 %403 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %402, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @85, i32 0, i32 0), i8** %403, align 8 %404 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %402, i32 0, i32 1 store i32 27, i32* %404, align 4 %405 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %402, i32 0, i32 2 store i32 13, i32* %405, align 4 %406 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %402, i32 0, i32 3 store i32 27, i32* %406, align 4 %407 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %402, i32 0, i32 4 store i32 16, i32* %407, align 4 %408 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @86, i32 0, i32 0)) %409 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %400, i32 0, i32 0 %410 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %401, i32 0, i32 0 %411 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %409, i32 0, i32 2 %412 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %409, i32 0, i32 0 store i1 true, i1* %412, align 1 %413 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %409, i32 0, i32 1 store i8* %408, i8** %413, align 8 store { i8*, i32, i32, i32, i32 }* %410, { i8*, i32, i32, i32, i32 }** %411, align 8 %414 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %409, i32 0, i32 3 store i32 1, i32* %414, align 4 %415 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %400, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %415, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @87, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @84, i32 0, i32 0), i64 2, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont67: ; preds = %ifcont65 %416 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i64 1 %417 = load %complex_4, %complex_4* %416, align 1 %418 = extractvalue %complex_4 %399, 0 %419 = extractvalue %complex_4 %399, 1 %420 = extractvalue %complex_4 %417, 0 %421 = extractvalue %complex_4 %417, 1 %422 = fadd float %418, %420 %423 = fadd float %419, %421 %424 = insertvalue %complex_4 undef, float %422, 0 %425 = insertvalue %complex_4 %424, float %423, 1 br i1 false, label %then68, label %ifcont69 then68: ; preds = %ifcont67 %426 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %427 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %428 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %427, i32 0, i32 0 %429 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %428, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @89, i32 0, i32 0), i8** %429, align 8 %430 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %428, i32 0, i32 1 store i32 27, i32* %430, align 4 %431 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %428, i32 0, i32 2 store i32 18, i32* %431, align 4 %432 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %428, i32 0, i32 3 store i32 27, i32* %432, align 4 %433 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %428, i32 0, i32 4 store i32 21, i32* %433, align 4 %434 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @90, i32 0, i32 0)) %435 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %426, i32 0, i32 0 %436 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %427, i32 0, i32 0 %437 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %435, i32 0, i32 2 %438 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %435, i32 0, i32 0 store i1 true, i1* %438, align 1 %439 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %435, i32 0, i32 1 store i8* %434, i8** %439, align 8 store { i8*, i32, i32, i32, i32 }* %436, { i8*, i32, i32, i32, i32 }** %437, align 8 %440 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %435, i32 0, i32 3 store i32 1, i32* %440, align 4 %441 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %426, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %441, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @91, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @88, i32 0, i32 0), i64 3, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont69: ; preds = %ifcont67 %442 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i64 2 %443 = load %complex_4, %complex_4* %442, align 1 %444 = extractvalue %complex_4 %425, 0 %445 = extractvalue %complex_4 %425, 1 %446 = extractvalue %complex_4 %443, 0 %447 = extractvalue %complex_4 %443, 1 %448 = fadd float %444, %446 %449 = fadd float %445, %447 %450 = insertvalue %complex_4 undef, float %448, 0 %451 = insertvalue %complex_4 %450, float %449, 1 br i1 false, label %then70, label %ifcont71 then70: ; preds = %ifcont69 %452 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %453 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %454 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %453, i32 0, i32 0 %455 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %454, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @93, i32 0, i32 0), i8** %455, align 8 %456 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %454, i32 0, i32 1 store i32 27, i32* %456, align 4 %457 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %454, i32 0, i32 2 store i32 23, i32* %457, align 4 %458 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %454, i32 0, i32 3 store i32 27, i32* %458, align 4 %459 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %454, i32 0, i32 4 store i32 26, i32* %459, align 4 %460 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @94, i32 0, i32 0)) %461 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %452, i32 0, i32 0 %462 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %453, i32 0, i32 0 %463 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %461, i32 0, i32 2 %464 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %461, i32 0, i32 0 store i1 true, i1* %464, align 1 %465 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %461, i32 0, i32 1 store i8* %460, i8** %465, align 8 store { i8*, i32, i32, i32, i32 }* %462, { i8*, i32, i32, i32, i32 }** %463, align 8 %466 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %461, i32 0, i32 3 store i32 1, i32* %466, align 4 %467 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %452, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %467, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @95, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @92, i32 0, i32 0), i64 1, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont71: ; preds = %ifcont69 %468 = getelementptr [3 x %complex_4], [3 x %complex_4]* %a, i32 0, i64 0 %469 = load %complex_4, %complex_4* %468, align 1 %470 = extractvalue %complex_4 %451, 0 %471 = extractvalue %complex_4 %451, 1 %472 = extractvalue %complex_4 %469, 0 %473 = extractvalue %complex_4 %469, 1 %474 = fadd float %470, %472 %475 = fadd float %471, %473 %476 = insertvalue %complex_4 undef, float %474, 0 %477 = insertvalue %complex_4 %476, float %475, 1 store %complex_4 %477, %complex_4* %381, align 1 br i1 false, label %then72, label %ifcont73 then72: ; preds = %ifcont71 %478 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %479 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %480 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %479, i32 0, i32 0 %481 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %480, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @97, i32 0, i32 0), i8** %481, align 8 %482 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %480, i32 0, i32 1 store i32 28, i32* %482, align 4 %483 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %480, i32 0, i32 2 store i32 5, i32* %483, align 4 %484 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %480, i32 0, i32 3 store i32 28, i32* %484, align 4 %485 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %480, i32 0, i32 4 store i32 8, i32* %485, align 4 %486 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @98, i32 0, i32 0)) %487 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %478, i32 0, i32 0 %488 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %479, i32 0, i32 0 %489 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %487, i32 0, i32 2 %490 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %487, i32 0, i32 0 store i1 true, i1* %490, align 1 %491 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %487, i32 0, i32 1 store i8* %486, i8** %491, align 8 store { i8*, i32, i32, i32, i32 }* %488, { i8*, i32, i32, i32, i32 }** %489, align 8 %492 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %487, i32 0, i32 3 store i32 1, i32* %492, align 4 %493 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %478, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %493, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @99, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @96, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont73: ; preds = %ifcont71 %494 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i64 3 %495 = load %complex_4, %complex_4* %494, align 1 %496 = extractvalue %complex_4 %495, 0 %497 = extractvalue %complex_4 %495, 1 %498 = fcmp one float %496, 1.700000e+01 %499 = fcmp one float %497, 0.000000e+00 %500 = or i1 %498, %499 br i1 %500, label %then74, label %else75 then74: ; preds = %ifcont73 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @101, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @100, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont76 else75: ; preds = %ifcont73 br label %ifcont76 ifcont76: ; preds = %else75, %then74 br i1 false, label %then77, label %ifcont78 then77: ; preds = %ifcont76 %501 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %502 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %503 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %502, i32 0, i32 0 %504 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %503, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @103, i32 0, i32 0), i8** %504, align 8 %505 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %503, i32 0, i32 1 store i32 30, i32* %505, align 4 %506 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %503, i32 0, i32 2 store i32 1, i32* %506, align 4 %507 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %503, i32 0, i32 3 store i32 30, i32* %507, align 4 %508 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %503, i32 0, i32 4 store i32 4, i32* %508, align 4 %509 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @104, i32 0, i32 0)) %510 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %501, i32 0, i32 0 %511 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %502, i32 0, i32 0 %512 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %510, i32 0, i32 2 %513 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %510, i32 0, i32 0 store i1 true, i1* %513, align 1 %514 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %510, i32 0, i32 1 store i8* %509, i8** %514, align 8 store { i8*, i32, i32, i32, i32 }* %511, { i8*, i32, i32, i32, i32 }** %512, align 8 %515 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %510, i32 0, i32 3 store i32 1, i32* %515, align 4 %516 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %501, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %516, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @105, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @102, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont78: ; preds = %ifcont76 %517 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i64 3 br i1 false, label %then79, label %ifcont80 then79: ; preds = %ifcont78 %518 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %519 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %520 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %519, i32 0, i32 0 %521 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %520, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @107, i32 0, i32 0), i8** %521, align 8 %522 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %520, i32 0, i32 1 store i32 30, i32* %522, align 4 %523 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %520, i32 0, i32 2 store i32 8, i32* %523, align 4 %524 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %520, i32 0, i32 3 store i32 30, i32* %524, align 4 %525 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %520, i32 0, i32 4 store i32 11, i32* %525, align 4 %526 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @108, i32 0, i32 0)) %527 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %518, i32 0, i32 0 %528 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %519, i32 0, i32 0 %529 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %527, i32 0, i32 2 %530 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %527, i32 0, i32 0 store i1 true, i1* %530, align 1 %531 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %527, i32 0, i32 1 store i8* %526, i8** %531, align 8 store { i8*, i32, i32, i32, i32 }* %528, { i8*, i32, i32, i32, i32 }** %529, align 8 %532 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %527, i32 0, i32 3 store i32 1, i32* %532, align 4 %533 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %518, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %533, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @109, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @106, i32 0, i32 0), i64 1, i32 1, i64 1, i64 3) call void @exit(i32 1) unreachable ifcont80: ; preds = %ifcont78 %534 = getelementptr [3 x %complex_4], [3 x %complex_4]* %a, i32 0, i64 0 %535 = load %complex_4, %complex_4* %534, align 1 store %complex_4 %535, %complex_4* %517, align 1 br i1 false, label %then81, label %ifcont82 then81: ; preds = %ifcont80 %536 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %537 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %538 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %537, i32 0, i32 0 %539 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %538, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @111, i32 0, i32 0), i8** %539, align 8 %540 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %538, i32 0, i32 1 store i32 31, i32* %540, align 4 %541 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %538, i32 0, i32 2 store i32 5, i32* %541, align 4 %542 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %538, i32 0, i32 3 store i32 31, i32* %542, align 4 %543 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %538, i32 0, i32 4 store i32 8, i32* %543, align 4 %544 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @112, i32 0, i32 0)) %545 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %536, i32 0, i32 0 %546 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %537, i32 0, i32 0 %547 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %545, i32 0, i32 2 %548 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %545, i32 0, i32 0 store i1 true, i1* %548, align 1 %549 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %545, i32 0, i32 1 store i8* %544, i8** %549, align 8 store { i8*, i32, i32, i32, i32 }* %546, { i8*, i32, i32, i32, i32 }** %547, align 8 %550 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %545, i32 0, i32 3 store i32 1, i32* %550, align 4 %551 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %536, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %551, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @113, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @110, i32 0, i32 0), i64 4, i32 1, i64 1, i64 4) call void @exit(i32 1) unreachable ifcont82: ; preds = %ifcont80 %552 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i64 3 %553 = load %complex_4, %complex_4* %552, align 1 %554 = extractvalue %complex_4 %553, 0 %555 = extractvalue %complex_4 %553, 1 %556 = fcmp one float %554, 1.100000e+01 %557 = fcmp one float %555, 0.000000e+00 %558 = or i1 %556, %557 br i1 %558, label %then83, label %else84 then83: ; preds = %ifcont82 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @115, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @114, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont85 else84: ; preds = %ifcont82 br label %ifcont85 ifcont85: ; preds = %else84, %then83 store i32 0, i32* %i, align 4 br label %loop.head86 loop.head86: ; preds = %loop.end94, %ifcont85 %559 = load i32, i32* %i, align 4 %560 = add i32 %559, 1 %561 = icmp sle i32 %560, 2 br i1 %561, label %loop.body87, label %loop.end95 loop.body87: ; preds = %loop.head86 %562 = load i32, i32* %i, align 4 %563 = add i32 %562, 1 store i32 %563, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head88 loop.head88: ; preds = %ifcont93, %loop.body87 %564 = load i32, i32* %j, align 4 %565 = add i32 %564, 1 %566 = icmp sle i32 %565, 2 br i1 %566, label %loop.body89, label %loop.end94 loop.body89: ; preds = %loop.head88 %567 = load i32, i32* %j, align 4 %568 = add i32 %567, 1 store i32 %568, i32* %j, align 4 %569 = load i32, i32* %i, align 4 %570 = load i32, i32* %j, align 4 %571 = sext i32 %569 to i64 %572 = sub i64 %571, 1 %573 = mul i64 1, %572 %574 = add i64 0, %573 %575 = icmp slt i64 %571, 1 %576 = icmp sgt i64 %571, 2 %577 = or i1 %575, %576 br i1 %577, label %then90, label %ifcont91 then90: ; preds = %loop.body89 %578 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %579 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %580 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %579, i32 0, i32 0 %581 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %580, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @117, i32 0, i32 0), i8** %581, align 8 %582 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %580, i32 0, i32 1 store i32 35, i32* %582, align 4 %583 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %580, i32 0, i32 2 store i32 9, i32* %583, align 4 %584 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %580, i32 0, i32 3 store i32 35, i32* %584, align 4 %585 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %580, i32 0, i32 4 store i32 15, i32* %585, align 4 %586 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @118, i32 0, i32 0)) %587 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %578, i32 0, i32 0 %588 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %579, i32 0, i32 0 %589 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %587, i32 0, i32 2 %590 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %587, i32 0, i32 0 store i1 true, i1* %590, align 1 %591 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %587, i32 0, i32 1 store i8* %586, i8** %591, align 8 store { i8*, i32, i32, i32, i32 }* %588, { i8*, i32, i32, i32, i32 }** %589, align 8 %592 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %587, i32 0, i32 3 store i32 1, i32* %592, align 4 %593 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %578, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %593, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @119, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @116, i32 0, i32 0), i64 %571, i32 1, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont91: ; preds = %loop.body89 %594 = sext i32 %570 to i64 %595 = sub i64 %594, 1 %596 = mul i64 2, %595 %597 = add i64 %574, %596 %598 = icmp slt i64 %594, 1 %599 = icmp sgt i64 %594, 2 %600 = or i1 %598, %599 br i1 %600, label %then92, label %ifcont93 then92: ; preds = %ifcont91 %601 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %602 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %603 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %602, i32 0, i32 0 %604 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %603, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @121, i32 0, i32 0), i8** %604, align 8 %605 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %603, i32 0, i32 1 store i32 35, i32* %605, align 4 %606 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %603, i32 0, i32 2 store i32 9, i32* %606, align 4 %607 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %603, i32 0, i32 3 store i32 35, i32* %607, align 4 %608 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %603, i32 0, i32 4 store i32 15, i32* %608, align 4 %609 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @122, i32 0, i32 0)) %610 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %601, i32 0, i32 0 %611 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %602, i32 0, i32 0 %612 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %610, i32 0, i32 2 %613 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %610, i32 0, i32 0 store i1 true, i1* %613, align 1 %614 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %610, i32 0, i32 1 store i8* %609, i8** %614, align 8 store { i8*, i32, i32, i32, i32 }* %611, { i8*, i32, i32, i32, i32 }** %612, align 8 %615 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %610, i32 0, i32 3 store i32 1, i32* %615, align 4 %616 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %601, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %616, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @123, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @120, i32 0, i32 0), i64 %594, i32 2, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont93: ; preds = %ifcont91 %617 = getelementptr [4 x %complex_4], [4 x %complex_4]* %c, i32 0, i64 %597 %618 = load i32, i32* %i, align 4 %619 = load i32, i32* %j, align 4 %620 = add i32 %618, %619 %621 = add i32 %620, 10 %622 = sitofp i32 %621 to float %623 = insertvalue %complex_4 undef, float %622, 0 %624 = insertvalue %complex_4 %623, float 0.000000e+00, 1 store %complex_4 %624, %complex_4* %617, align 1 br label %loop.head88 loop.end94: ; preds = %loop.head88 br label %loop.head86 loop.end95: ; preds = %loop.head86 br i1 false, label %then96, label %ifcont97 then96: ; preds = %loop.end95 %625 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %626 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %627 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %626, i32 0, i32 0 %628 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %627, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @125, i32 0, i32 0), i8** %628, align 8 %629 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %627, i32 0, i32 1 store i32 38, i32* %629, align 4 %630 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %627, i32 0, i32 2 store i32 5, i32* %630, align 4 %631 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %627, i32 0, i32 3 store i32 38, i32* %631, align 4 %632 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %627, i32 0, i32 4 store i32 11, i32* %632, align 4 %633 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @126, i32 0, i32 0)) %634 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %625, i32 0, i32 0 %635 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %626, i32 0, i32 0 %636 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %634, i32 0, i32 2 %637 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %634, i32 0, i32 0 store i1 true, i1* %637, align 1 %638 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %634, i32 0, i32 1 store i8* %633, i8** %638, align 8 store { i8*, i32, i32, i32, i32 }* %635, { i8*, i32, i32, i32, i32 }** %636, align 8 %639 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %634, i32 0, i32 3 store i32 1, i32* %639, align 4 %640 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %625, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %640, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @127, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @124, i32 0, i32 0), i64 1, i32 1, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont97: ; preds = %loop.end95 br i1 false, label %then98, label %ifcont99 then98: ; preds = %ifcont97 %641 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %642 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %643 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %642, i32 0, i32 0 %644 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %643, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @129, i32 0, i32 0), i8** %644, align 8 %645 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %643, i32 0, i32 1 store i32 38, i32* %645, align 4 %646 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %643, i32 0, i32 2 store i32 5, i32* %646, align 4 %647 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %643, i32 0, i32 3 store i32 38, i32* %647, align 4 %648 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %643, i32 0, i32 4 store i32 11, i32* %648, align 4 %649 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @130, i32 0, i32 0)) %650 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %641, i32 0, i32 0 %651 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %642, i32 0, i32 0 %652 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %650, i32 0, i32 2 %653 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %650, i32 0, i32 0 store i1 true, i1* %653, align 1 %654 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %650, i32 0, i32 1 store i8* %649, i8** %654, align 8 store { i8*, i32, i32, i32, i32 }* %651, { i8*, i32, i32, i32, i32 }** %652, align 8 %655 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %650, i32 0, i32 3 store i32 1, i32* %655, align 4 %656 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %641, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %656, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @131, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @128, i32 0, i32 0), i64 1, i32 2, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont99: ; preds = %ifcont97 %657 = getelementptr [4 x %complex_4], [4 x %complex_4]* %c, i32 0, i64 0 %658 = load %complex_4, %complex_4* %657, align 1 %659 = extractvalue %complex_4 %658, 0 %660 = extractvalue %complex_4 %658, 1 %661 = fcmp one float %659, 1.200000e+01 %662 = fcmp one float %660, 0.000000e+00 %663 = or i1 %661, %662 br i1 %663, label %then100, label %else101 then100: ; preds = %ifcont99 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @133, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @132, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont102 else101: ; preds = %ifcont99 br label %ifcont102 ifcont102: ; preds = %else101, %then100 br i1 false, label %then103, label %ifcont104 then103: ; preds = %ifcont102 %664 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %665 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %666 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %665, i32 0, i32 0 %667 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %666, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @135, i32 0, i32 0), i8** %667, align 8 %668 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %666, i32 0, i32 1 store i32 39, i32* %668, align 4 %669 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %666, i32 0, i32 2 store i32 5, i32* %669, align 4 %670 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %666, i32 0, i32 3 store i32 39, i32* %670, align 4 %671 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %666, i32 0, i32 4 store i32 11, i32* %671, align 4 %672 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @136, i32 0, i32 0)) %673 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %664, i32 0, i32 0 %674 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %665, i32 0, i32 0 %675 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %673, i32 0, i32 2 %676 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %673, i32 0, i32 0 store i1 true, i1* %676, align 1 %677 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %673, i32 0, i32 1 store i8* %672, i8** %677, align 8 store { i8*, i32, i32, i32, i32 }* %674, { i8*, i32, i32, i32, i32 }** %675, align 8 %678 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %673, i32 0, i32 3 store i32 1, i32* %678, align 4 %679 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %664, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %679, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @137, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @134, i32 0, i32 0), i64 1, i32 1, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont104: ; preds = %ifcont102 br i1 false, label %then105, label %ifcont106 then105: ; preds = %ifcont104 %680 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %681 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %682 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %681, i32 0, i32 0 %683 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %682, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @139, i32 0, i32 0), i8** %683, align 8 %684 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %682, i32 0, i32 1 store i32 39, i32* %684, align 4 %685 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %682, i32 0, i32 2 store i32 5, i32* %685, align 4 %686 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %682, i32 0, i32 3 store i32 39, i32* %686, align 4 %687 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %682, i32 0, i32 4 store i32 11, i32* %687, align 4 %688 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @140, i32 0, i32 0)) %689 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %680, i32 0, i32 0 %690 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %681, i32 0, i32 0 %691 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %689, i32 0, i32 2 %692 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %689, i32 0, i32 0 store i1 true, i1* %692, align 1 %693 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %689, i32 0, i32 1 store i8* %688, i8** %693, align 8 store { i8*, i32, i32, i32, i32 }* %690, { i8*, i32, i32, i32, i32 }** %691, align 8 %694 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %689, i32 0, i32 3 store i32 1, i32* %694, align 4 %695 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %680, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %695, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @141, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @138, i32 0, i32 0), i64 2, i32 2, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont106: ; preds = %ifcont104 %696 = getelementptr [4 x %complex_4], [4 x %complex_4]* %c, i32 0, i64 2 %697 = load %complex_4, %complex_4* %696, align 1 %698 = extractvalue %complex_4 %697, 0 %699 = extractvalue %complex_4 %697, 1 %700 = fcmp one float %698, 1.300000e+01 %701 = fcmp one float %699, 0.000000e+00 %702 = or i1 %700, %701 br i1 %702, label %then107, label %else108 then107: ; preds = %ifcont106 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @143, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @142, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont109 else108: ; preds = %ifcont106 br label %ifcont109 ifcont109: ; preds = %else108, %then107 br i1 false, label %then110, label %ifcont111 then110: ; preds = %ifcont109 %703 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %704 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %705 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %704, i32 0, i32 0 %706 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %705, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @145, i32 0, i32 0), i8** %706, align 8 %707 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %705, i32 0, i32 1 store i32 40, i32* %707, align 4 %708 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %705, i32 0, i32 2 store i32 5, i32* %708, align 4 %709 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %705, i32 0, i32 3 store i32 40, i32* %709, align 4 %710 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %705, i32 0, i32 4 store i32 11, i32* %710, align 4 %711 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @146, i32 0, i32 0)) %712 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %703, i32 0, i32 0 %713 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %704, i32 0, i32 0 %714 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %712, i32 0, i32 2 %715 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %712, i32 0, i32 0 store i1 true, i1* %715, align 1 %716 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %712, i32 0, i32 1 store i8* %711, i8** %716, align 8 store { i8*, i32, i32, i32, i32 }* %713, { i8*, i32, i32, i32, i32 }** %714, align 8 %717 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %712, i32 0, i32 3 store i32 1, i32* %717, align 4 %718 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %703, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %718, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @147, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @144, i32 0, i32 0), i64 2, i32 1, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont111: ; preds = %ifcont109 br i1 false, label %then112, label %ifcont113 then112: ; preds = %ifcont111 %719 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %720 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %721 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %720, i32 0, i32 0 %722 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %721, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @149, i32 0, i32 0), i8** %722, align 8 %723 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %721, i32 0, i32 1 store i32 40, i32* %723, align 4 %724 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %721, i32 0, i32 2 store i32 5, i32* %724, align 4 %725 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %721, i32 0, i32 3 store i32 40, i32* %725, align 4 %726 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %721, i32 0, i32 4 store i32 11, i32* %726, align 4 %727 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @150, i32 0, i32 0)) %728 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %719, i32 0, i32 0 %729 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %720, i32 0, i32 0 %730 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %728, i32 0, i32 2 %731 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %728, i32 0, i32 0 store i1 true, i1* %731, align 1 %732 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %728, i32 0, i32 1 store i8* %727, i8** %732, align 8 store { i8*, i32, i32, i32, i32 }* %729, { i8*, i32, i32, i32, i32 }** %730, align 8 %733 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %728, i32 0, i32 3 store i32 1, i32* %733, align 4 %734 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %719, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %734, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @151, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @148, i32 0, i32 0), i64 1, i32 2, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont113: ; preds = %ifcont111 %735 = getelementptr [4 x %complex_4], [4 x %complex_4]* %c, i32 0, i64 1 %736 = load %complex_4, %complex_4* %735, align 1 %737 = extractvalue %complex_4 %736, 0 %738 = extractvalue %complex_4 %736, 1 %739 = fcmp one float %737, 1.300000e+01 %740 = fcmp one float %738, 0.000000e+00 %741 = or i1 %739, %740 br i1 %741, label %then114, label %else115 then114: ; preds = %ifcont113 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @153, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @152, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont116 else115: ; preds = %ifcont113 br label %ifcont116 ifcont116: ; preds = %else115, %then114 br i1 false, label %then117, label %ifcont118 then117: ; preds = %ifcont116 %742 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %743 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %744 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %743, i32 0, i32 0 %745 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %744, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @155, i32 0, i32 0), i8** %745, align 8 %746 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %744, i32 0, i32 1 store i32 41, i32* %746, align 4 %747 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %744, i32 0, i32 2 store i32 5, i32* %747, align 4 %748 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %744, i32 0, i32 3 store i32 41, i32* %748, align 4 %749 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %744, i32 0, i32 4 store i32 11, i32* %749, align 4 %750 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @156, i32 0, i32 0)) %751 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %742, i32 0, i32 0 %752 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %743, i32 0, i32 0 %753 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %751, i32 0, i32 2 %754 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %751, i32 0, i32 0 store i1 true, i1* %754, align 1 %755 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %751, i32 0, i32 1 store i8* %750, i8** %755, align 8 store { i8*, i32, i32, i32, i32 }* %752, { i8*, i32, i32, i32, i32 }** %753, align 8 %756 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %751, i32 0, i32 3 store i32 1, i32* %756, align 4 %757 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %742, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %757, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @157, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @154, i32 0, i32 0), i64 2, i32 1, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont118: ; preds = %ifcont116 br i1 false, label %then119, label %ifcont120 then119: ; preds = %ifcont118 %758 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %759 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %760 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %759, i32 0, i32 0 %761 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %760, i32 0, i32 0 store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @159, i32 0, i32 0), i8** %761, align 8 %762 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %760, i32 0, i32 1 store i32 41, i32* %762, align 4 %763 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %760, i32 0, i32 2 store i32 5, i32* %763, align 4 %764 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %760, i32 0, i32 3 store i32 41, i32* %764, align 4 %765 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %760, i32 0, i32 4 store i32 11, i32* %765, align 4 %766 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @160, i32 0, i32 0)) %767 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %758, i32 0, i32 0 %768 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %759, i32 0, i32 0 %769 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %767, i32 0, i32 2 %770 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %767, i32 0, i32 0 store i1 true, i1* %770, align 1 %771 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %767, i32 0, i32 1 store i8* %766, i8** %771, align 8 store { i8*, i32, i32, i32, i32 }* %768, { i8*, i32, i32, i32, i32 }** %769, align 8 %772 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %767, i32 0, i32 3 store i32 1, i32* %772, align 4 %773 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %758, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %773, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @161, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @158, i32 0, i32 0), i64 2, i32 2, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont120: ; preds = %ifcont118 %774 = getelementptr [4 x %complex_4], [4 x %complex_4]* %c, i32 0, i64 3 %775 = load %complex_4, %complex_4* %774, align 1 %776 = extractvalue %complex_4 %775, 0 %777 = extractvalue %complex_4 %775, 1 %778 = fcmp one float %776, 1.400000e+01 %779 = fcmp one float %777, 0.000000e+00 %780 = or i1 %778, %779 br i1 %780, label %then121, label %else122 then121: ; preds = %ifcont120 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @163, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @162, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont123 else122: ; preds = %ifcont120 br label %ifcont123 ifcont123: ; preds = %else122, %then121 br label %return return: ; preds = %ifcont123 br label %FINALIZE_SYMTABLE_arrays_01_complex FINALIZE_SYMTABLE_arrays_01_complex: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_snprintf_alloc(i8*, i8*, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lcompilers_runtime_error(i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) declare void @exit(i32) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor4-0e1d0e4.stdout0000664000175000017500000001015615174404631027071 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor4: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) preprocessor4 [] [(Assignment (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) Mul (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 25 (Integer 4) Decimal) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Add (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Pow (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-bits_02-e48c6d3.stdout0000664000175000017500000001516015174404631023272 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bits_02: (Program (SymbolTable 2 { all_ones: (Variable 2 all_ones [all_zeros] Local (IntrinsicElementalFunction Not [(Var 2 all_zeros)] 0 (Integer 8) (IntegerConstant -1 (Integer 8) Decimal) ) (IntegerConstant -1 (Integer 8) Decimal) Parameter (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), all_zeros: (Variable 2 all_zeros [] Local (IntegerConstant 0 (Integer 8) Decimal) (IntegerConstant 0 (Integer 8) Decimal) Parameter (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), bits_kind: (ExternalSymbol 2 bits_kind 4 int32 lfortran_intrinsic_iso_fortran_env [] int32 Public ), block_kind: (ExternalSymbol 2 block_kind 4 int64 lfortran_intrinsic_iso_fortran_env [] int64 Public ), block_size: (Variable 2 block_size [] Local (Cast (TypeInquiry BitSize (Integer 8) (IntegerConstant 0 (Integer 8) Decimal) (Integer 8) (IntegerConstant 64 (Integer 8) Decimal) ) IntegerToInteger (Integer 4) (IntegerConstant 64 (Integer 4) Decimal) () ) (IntegerConstant 64 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) bits_02 [iso_fortran_env] [(Print (StringFormat () [(Var 2 block_size)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 all_zeros)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 all_ones)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env) }) [] ) lfortran-0.63.0/tests/reference/asr-implicit_typing3-c82e537.stderr0000664000175000017500000000037215174404631025217 0ustar alastairalastairsemantic error: No implicit return type available for `fun` --> tests/errors/implicit_typing3.f90:4:9 - 5:24 | 4 | function fun() | ^^^^^^^^^^^^^^... ... | 5 | end function fun | ...^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-data_implied_do_01-737a2b1.json0000664000175000017500000000100015174404631024747 0ustar alastairalastair{ "basename": "asr-data_implied_do_01-737a2b1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/data_implied_do_01.f90", "infile_hash": "95b501e531eaccdd3dd537fd2bed661c592c8237e6ca72bf86217e60", "outfile": null, "outfile_hash": null, "stdout": "asr-data_implied_do_01-737a2b1.stdout", "stdout_hash": "a6bf7ffe1effb2ce1e566d6cc68ec79ac29fa376215d530b57ca5dbd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-fma-8bc0756.json0000664000175000017500000000072315174404631022137 0ustar alastairalastair{ "basename": "asr-fma-8bc0756", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/fma.f90", "infile_hash": "e251a7a68d3ac5b04630dacfdd015452826bc4e6954b51124d815868", "outfile": null, "outfile_hash": null, "stdout": "asr-fma-8bc0756.stdout", "stdout_hash": "a7311c2ee9a3f9f37ba5dc950de9f0196b16b04cab4e485cfcdcf848", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-associate_01-aa0fe46.json0000664000175000017500000000112015174404631024447 0ustar alastairalastair{ "basename": "ast_f90-associate_01-aa0fe46", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/associate_01.f90", "infile_hash": "dfa888bac25c6dcaf279aff9ac639b37179290e3a36f9e784b31fb83", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-associate_01-aa0fe46.stdout", "stdout_hash": "50cf8571646cf55d99209c64d3395872288f6f03b1ade8b0546581ea", "stderr": "ast_f90-associate_01-aa0fe46.stderr", "stderr_hash": "1f6e46d80cfcc70f0d91ed20562c4d7c39b2990b877e7de481e73a19", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_typing1-bccf386.stdout0000664000175000017500000001654215174404631025400 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), datap: (Variable 2 datap [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), integerx: (Variable 2 integerx [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l: (Variable 2 l [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), realr: (Variable 2 realr [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) x [] [(Assignment (Var 2 l) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 a) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 integerx) (IntegerConstant 12 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 datap) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 realr) (RealConstant 1.500000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(Var 2 l) (Var 2 a) (Var 2 integerx) (Var 2 datap) (Var 2 realr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-subroutine5-e248afc.stdout0000664000175000017500000001042615174404631024370 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { add: (Function (SymbolTable 2 { a: (Variable 2 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Out () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add (FunctionType [(Real 4) (Real 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 a) (Var 2 b) (Var 2 c)] [(Assignment (Var 2 c) (RealBinOp (Var 2 a) Add (Var 2 b) (Real 4) () ) () .false. .false. )] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/wat-cpu_time_02_wasm-fa2b15f.json0000664000175000017500000000075515174404631024674 0ustar alastairalastair{ "basename": "wat-cpu_time_02_wasm-fa2b15f", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/cpu_time_02_wasm.f90", "infile_hash": "a1e29e7dd66632a416de6ea346443bea443af6734ccb35801c77cf09", "outfile": null, "outfile_hash": null, "stdout": "wat-cpu_time_02_wasm-fa2b15f.stdout", "stdout_hash": "0ca4269517c69a129d718045702784b3fb3462d6f70b3e15e0a1ce75", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-optional_01-56b1b65.json0000664000175000017500000000072615174404631023520 0ustar alastairalastair{ "basename": "asr-optional_01-56b1b65", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/optional_01.f90", "infile_hash": "b703b762ac35be7e690936d507787f8757837c9b46e25ddaeb99640b", "outfile": null, "outfile_hash": null, "stdout": "asr-optional_01-56b1b65.stdout", "stdout_hash": "673b6202c358320961403964450d251998e4d3a20ad8fd5647ada3da", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_openmp-do_concurrent_01-2a6df8c.json0000664000175000017500000000103015174404631026426 0ustar alastairalastair{ "basename": "pass_openmp-do_concurrent_01-2a6df8c", "cmd": "lfortran --pass=openmp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/do_concurrent_01.f90", "infile_hash": "6a7684b3e2ff6bfd0e1eb6c1095feb666304732379d06a99405e0aa6", "outfile": null, "outfile_hash": null, "stdout": "pass_openmp-do_concurrent_01-2a6df8c.stdout", "stdout_hash": "26d0f9e1c4c476162177148dc6f75909206da45bf04e3055ab41172f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/julia-arrays_03_func-7271066.stdout0000664000175000017500000000065715174404631024746 0ustar alastairalastairfunction mysum(a::Array{Int32, 1})::Int32 local i::Int32 local r::Int32 r = 0 for i ∈ 1:length(a) r = r + a[i] end return r end function main() local i::Int32 local s::Int32 local x::Array{Int32, 1} for i ∈ 1:length(x) x[i] = i end s = mysum(Int32(x)) println(s) if s ≠ 55 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-0.63.0/tests/reference/ast_f90-common1-ee77de6.json0000664000175000017500000000072515174404631023577 0ustar alastairalastair{ "basename": "ast_f90-common1-ee77de6", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/common1.f90", "infile_hash": "d7a7a1f2f3dfe2e00668bce25dbd3dc8830df902ed2c7841ef1bc6e8", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-common1-ee77de6.stdout", "stdout_hash": "a72eaba3993b111d7c87901b45f818c96eb97ecb871752201a044547", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_add_01c-a5654a9.stdout0000664000175000017500000014615515174404631025045 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_add_01c: (Program (SymbolTable 11 { add_t: (ExternalSymbol 11 add_t 2 add_t template_add_01c_m [] add_t Public ), r: (ExternalSymbol 11 r 2 r template_add_01c_m [] r Public ), test_template: (ExternalSymbol 11 test_template 2 test_template template_add_01c_m [] test_template Public ) }) template_add_01c [template_add_01c_m] [(SubroutineCall 11 test_template () [] () .false. )] ), template_add_01c_m: (Module (SymbolTable 2 { add_t: (Template (SymbolTable 5 { add_generic: (Function (SymbolTable 7 { x: (Variable 7 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 7 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 7 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_generic (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 7 x) (Var 7 y)] [(Assignment (Var 7 z) (FunctionCall 5 f () [((Var 7 x)) ((Var 7 y))] (TypeParameter t ) () () ) () .false. .false. )] (Var 7 z) Public .true. .true. () ), f: (Function (SymbolTable 6 { x: (Variable 6 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 6 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 6 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 6 x) (Var 6 y)] [] (Var 6 z) Private .true. .true. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_t [t f] [(Require r [t f] )] ), r: (Requirement (SymbolTable 3 { f: (Function (SymbolTable 4 { x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 4 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 z) Private .true. .true. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) r [t f] [] ), test_template: (Function (SymbolTable 8 { add_generic: (Function (SymbolTable 10 { x: (Variable 10 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 10 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 10 z [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_generic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~add_intrinsic] [(Var 10 x) (Var 10 y)] [(Assignment (Var 10 z) (FunctionCall 8 ~add_intrinsic () [((Var 10 x)) ((Var 10 y))] (Integer 4) () () ) () .false. .false. )] (Var 10 z) Public .true. .true. () ), n: (Variable 8 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~add: (CustomOperator 8 ~add [8 ~add_intrinsic] Public ), ~add_intrinsic: (Function (SymbolTable 9 { arg0: (Variable 9 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 9 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 9 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 9 arg0) (Var 9 arg1)] [(Assignment (Var 9 ret) (IntegerBinOp (Var 9 arg0) Add (Var 9 arg1) (Integer 4) () ) () .false. .false. )] (Var 9 ret) Public .true. .true. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 8 n) (FunctionCall 8 add_generic () [((IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 9 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "The result is" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 8 n)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_add_01c_m () [template_add_01c_m] .false. .false. .false. ) }) [] ) ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootlfortran-0.63.0/tests/reference/asr-incompatible_dimension_logical_arrays_logical_binop_01-4cfbf39.stderrlfortran-0.63.0/tests/reference/asr-incompatible_dimension_logical_arrays_logical_binop_01-4cfbf39.s0000664000175000017500000000034515174404631033776 0ustar alastairalastairsemantic error: Shapes for operands are not conformable --> tests/errors/incompatible_dimension_logical_arrays_logical_binop_01.f90:3:13 | 3 | print *, x1 .neqv. [.true., .true.] | ^^ ^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-complex_dp-ec165b1.stdout0000664000175000017500000001543015174404631024150 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex_dp: (Program (SymbolTable 2 { v: (Variable 2 v [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zero: (Variable 2 zero [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) complex_dp [] [(Assignment (Var 2 zero) (Cast (RealConstant 0.000000 (Real 4) ) RealToComplex (Complex 4) (ComplexConstant 0.000000 0.000000 (Complex 4) ) () ) () .false. .false. ) (Assignment (Var 2 v) (Cast (ComplexConstructor (RealConstant 1.050000 (Real 4) ) (RealConstant 1.050000 (Real 4) ) (Complex 4) (ComplexConstant 1.050000 1.050000 (Complex 4) ) ) ComplexToComplex (Complex 8) (ComplexConstant 1.050000 1.050000 (Complex 8) ) () ) () .false. .false. ) (Assignment (Var 2 x) (Cast (ComplexConstructor (RealConstant 1.050000 (Real 4) ) (RealConstant 1.050000 (Real 8) ) (Complex 8) (ComplexConstant 1.050000 1.050000 (Complex 8) ) ) ComplexToComplex (Complex 4) (ComplexConstant 1.050000 1.050000 (Complex 4) ) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 v) (Var 2 x) (Var 2 zero)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast_f90-modules_04-e9ab16a.json0000664000175000017500000000076315174404631024165 0ustar alastairalastair{ "basename": "ast_f90-modules_04-e9ab16a", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/modules_04.f90", "infile_hash": "b04f80d4de5baea50808e962f08564088751c24a464b3d1d7c0c316f", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-modules_04-e9ab16a.stdout", "stdout_hash": "1b6c92c555140732bc7b56428c1086bb0205deed13c32d4f3c7faf80", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_call_02-acc6d43.stderr0000664000175000017500000000030615174404631025162 0ustar alastairalastairsemantic error: Type mismatch in argument `x`: expected `integer(4)[:]` but got `integer(8)[:]` --> tests/errors/implicit_call_02.f90:9:19 | 9 | call test_sub(arr) | ^^^ lfortran-0.63.0/tests/reference/asr-string_13-ae4df53.stdout0000664000175000017500000001632315174404631023716 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_13: (Program (SymbolTable 2 { ia0: (Variable 2 ia0 [] Local (IntrinsicElementalFunction Iachar [(StringConstant "0" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (Integer 4) (IntegerConstant 48 (Integer 4) Decimal) ) (IntegerConstant 48 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ia5: (Variable 2 ia5 [] Local (IntrinsicElementalFunction Iachar [(StringConstant "5" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (Integer 4) (IntegerConstant 53 (Integer 4) Decimal) ) (IntegerConstant 53 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ia9: (Variable 2 ia9 [] Local (IntrinsicElementalFunction Iachar [(StringConstant "9" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (Integer 4) (IntegerConstant 57 (Integer 4) Decimal) ) (IntegerConstant 57 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) string_13 [] [(If () (IntegerCompare (Var 2 ia0) NotEq (IntegerConstant 48 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 ia5) NotEq (IntegerConstant 53 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 ia9) NotEq (IntegerConstant 57 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 ia0) (Var 2 ia5) (Var 2 ia9)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-char_arr_assignment-1f9a875.stdout0000664000175000017500000001275215174404631025771 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { char_arr_assignment: (Program (SymbolTable 2 { char_arr: (Variable 2 char_arr [] Local () () Default (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) char_arr_assignment [] [(Assignment (ArraySection (Var 2 char_arr) [((ArrayBound (Var 2 char_arr) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 char_arr) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 1 (Integer 4) Decimal))] (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) () ) (ArrayBroadcast (StringConstant "A" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (IntrinsicArrayFunction Shape [(ArraySection (Var 2 char_arr) [((ArrayBound (Var 2 char_arr) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 char_arr) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 1 (Integer 4) Decimal))] (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) () )] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) () ) () .false. .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-atomic_01-1c877f0.stderr0000664000175000017500000000030115174404631023473 0ustar alastairalastairsemantic error: Atomic operations are not supported yet --> tests/errors/atomic_01.f90:4:5 | 4 | call atomic_add (atom[1], this_image()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-expr6-7f62240.json0000664000175000017500000000070415174404631022353 0ustar alastairalastair{ "basename": "asr-expr6-7f62240", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr6.f90", "infile_hash": "722af2f789e614d9acf6975aae8260e4949a360066d5aa53a3f05944", "outfile": null, "outfile_hash": null, "stdout": "asr-expr6-7f62240.stdout", "stdout_hash": "9bd204c72324e1f93240bc5cb6fbbc76f8ab14206ccb03c272c41592", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/obj-subroutine3-942b3d8.json0000664000175000017500000000057315174404631023647 0ustar alastairalastair{ "basename": "obj-subroutine3-942b3d8", "cmd": "lfortran --no-color -c {infile} -o output.o", "infile": "tests/subroutine3.f90", "infile_hash": "174874c0a5fad40d608acbafefcc0c06c96379cc136126d3f05b63e5", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_07-7f671c1.json0000664000175000017500000000072315174404631023352 0ustar alastairalastair{ "basename": "asr-modules_07-7f671c1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/modules_07.f90", "infile_hash": "803312680c18e8658ffb84d2288a3ed6ebdef21a99ed09fd3007f9c9", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_07-7f671c1.stdout", "stdout_hash": "c36d66b44b81afe660f5164c8142113b0b570734e79a9e24d70e23ab", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-fixed_form_if_variations-b4dcd1e.json0000664000175000017500000000101015174404631026631 0ustar alastairalastair{ "basename": "asr-fixed_form_if_variations-b4dcd1e", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_if_variations.f", "infile_hash": "4a650d13a10da613323a06d614f3a9342a07afcae9d662a2584c8e52", "outfile": null, "outfile_hash": null, "stdout": "asr-fixed_form_if_variations-b4dcd1e.stdout", "stdout_hash": "0a82e57a7af3553d0ac12b6175bcfad69efc149063acde66846cd655", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-common_linkage_separate_compilation_01-4003f83.stdout0000664000175000017500000000377215174404631031616 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %file_common_block_blk.blk = type { i32 } @__module_file_common_block_blk_struct_instance_blk = common global %file_common_block_blk.blk zeroinitializer @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [8 x i8] c"%s %d%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) store i32 5, i32* getelementptr inbounds (%file_common_block_blk.blk, %file_common_block_blk.blk* @__module_file_common_block_blk_struct_instance_blk, i32 0, i32 0), align 4 %2 = load i32, i32* getelementptr inbounds (%file_common_block_blk.blk, %file_common_block_blk.blk* @__module_file_common_block_blk_struct_instance_blk, i32 0, i32 0), align 4 %3 = icmp ne i32 %2, 5 br i1 %3, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @_lfortran_internal_alloc_finalize() call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_common_linkage_separate_compilation_01 FINALIZE_SYMTABLE_common_linkage_separate_compilation_01: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @_lfortran_internal_alloc_finalize() declare void @exit(i32) lfortran-0.63.0/tests/reference/asr-array_06-5f5f77a.json0000664000175000017500000000072415174404631023106 0ustar alastairalastair{ "basename": "asr-array_06-5f5f77a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_06.f90", "infile_hash": "406fc70b089659c17d4efd5d20d1bbedbda96bf91883f69ca5841dc3", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_06-5f5f77a.stderr", "stderr_hash": "ee4341dfe274063add7a3bac13df2f837d0fb1ad8212222e276b3dc2", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-parsing_02-740c1e5.json0000664000175000017500000000107115174404631023331 0ustar alastairalastair{ "basename": "ast-parsing_02-740c1e5", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/parsing_02.f90", "infile_hash": "f78db77720bb5392af4091a6679a066e81cb5afd18e4df47dd9e5898", "outfile": null, "outfile_hash": null, "stdout": "ast-parsing_02-740c1e5.stdout", "stdout_hash": "46e3f08ea731fa6f85526ceb948a3e340e5515fb94aba16d3f0a42c3", "stderr": "ast-parsing_02-740c1e5.stderr", "stderr_hash": "38c28e43e72288cf56f08313327a8162e55d4462005ccca3fd591670", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_simple_04-951e966.stdout0000664000175000017500000037367515174404631025411 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_simple_04: (Program (SymbolTable 14 { cast_integer: (ExternalSymbol 14 cast_integer 2 cast_integer template_simple_04_m [] cast_integer Public ), cast_r: (ExternalSymbol 14 cast_r 2 cast_r template_simple_04_m [] cast_r Public ), cast_real: (ExternalSymbol 14 cast_real 2 cast_real template_simple_04_m [] cast_real Public ), generic_sum: (ExternalSymbol 14 generic_sum 2 generic_sum template_simple_04_m [] generic_sum Public ), operator_r: (ExternalSymbol 14 operator_r 2 operator_r template_simple_04_m [] operator_r Public ), test_template: (ExternalSymbol 14 test_template 2 test_template template_simple_04_m [] test_template Public ) }) template_simple_04 [template_simple_04_m] [(SubroutineCall 14 test_template () [] () .false. )] ), template_simple_04_m: (Module (SymbolTable 2 { cast_integer: (Function (SymbolTable 11 { arg: (Variable 11 arg [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 11 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast_integer (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 11 arg)] [(Assignment (Var 11 r) (Var 11 arg) () .false. .false. )] (Var 11 r) Public .true. .true. () ), cast_r: (Requirement (SymbolTable 5 { cast: (Function (SymbolTable 6 { arg: (Variable 6 arg [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 6 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 6 arg)] [] (Var 6 res) Public .true. .true. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast_r [t cast] [] ), cast_real: (Function (SymbolTable 12 { arg: (Variable 12 arg [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 12 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast_real (FunctionType [(Integer 4)] (Real 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 12 arg)] [(Assignment (Var 12 r) (Cast (Var 12 arg) IntegerToReal (Real 4) () () ) () .false. .false. )] (Var 12 r) Public .true. .true. () ), generic_sum: (Template (SymbolTable 7 { add: (Function (SymbolTable 8 { lhs: (Variable 8 lhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 8 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 8 rhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 8 lhs) (Var 8 rhs)] [] (Var 8 res) Public .true. .true. () ), cast: (Function (SymbolTable 9 { arg: (Variable 9 arg [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 9 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 9 arg)] [] (Var 9 res) Public .true. .true. () ), generic_sum: (Function (SymbolTable 10 { a: (Variable 10 a [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 10 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 10 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 10 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~add: (CustomOperator 10 ~add [7 add] Public ) }) generic_sum (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast add] [(Var 10 a)] [(Assignment (Var 10 res) (FunctionCall 7 cast () [((IntegerConstant 0 (Integer 4) Decimal))] (TypeParameter t ) () () ) () .false. .false. ) (DoLoop () ((Var 10 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 10 a) () (Integer 4) () ) ()) [(Assignment (Var 10 res) (OverloadedBinOp (Var 10 res) Add (ArrayItem (Var 10 a) [(() (Var 10 i) ())] (TypeParameter t ) ColMajor () ) (TypeParameter t ) () (FunctionCall 7 add 10 ~add [((Var 10 res)) ((ArrayItem (Var 10 a) [(() (Var 10 i) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) ) () .false. .false. )] [] )] (Var 10 res) Public .true. .true. () ), t: (Variable 7 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) generic_sum [t add cast] [(Require operator_r [t add] ) (Require cast_r [t cast] )] ), operator_r: (Requirement (SymbolTable 3 { binary_func: (Function (SymbolTable 4 { lhs: (Variable 4 lhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 4 res [] ReturnVar () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 4 rhs [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) binary_func (FunctionType [(TypeParameter t ) (TypeParameter u )] (TypeParameter v ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 4 lhs) (Var 4 rhs)] [] (Var 4 res) Public .true. .true. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u: (Variable 3 u [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 3 v [] In () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) operator_r [t u v binary_func] [] ), test_template: (Function (SymbolTable 13 { __instantiated_generic_sum: (Function (SymbolTable 16 { a: (Variable 16 a [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 16 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 16 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 16 res [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __instantiated_generic_sum (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_integer ~add_intrinsic] [(Var 16 a)] [(Assignment (Var 16 res) (FunctionCall 2 cast_integer () [((IntegerConstant 0 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (DoLoop () ((Var 16 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 16 a) () (Integer 4) () ) ()) [(Assignment (Var 16 res) (OverloadedBinOp (Var 16 res) Add (ArrayItem (Var 16 a) [(() (Var 16 i) ())] (Integer 4) ColMajor () ) (TypeParameter t ) () (FunctionCall 13 ~add_intrinsic 10 ~add [((Var 16 res)) ((ArrayItem (Var 16 a) [(() (Var 16 i) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) ) () .false. .false. )] [] )] (Var 16 res) Public .true. .true. () ), __instantiated_generic_sum1: (Function (SymbolTable 18 { a: (Variable 18 a [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 18 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 18 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 18 res [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __instantiated_generic_sum1 (FunctionType [(Array (Real 4) [(() ())] DescriptorArray )] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_real ~add_intrinsic1] [(Var 18 a)] [(Assignment (Var 18 res) (FunctionCall 2 cast_real () [((IntegerConstant 0 (Integer 4) Decimal))] (Real 4) () () ) () .false. .false. ) (DoLoop () ((Var 18 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 18 a) () (Integer 4) () ) ()) [(Assignment (Var 18 res) (OverloadedBinOp (Var 18 res) Add (ArrayItem (Var 18 a) [(() (Var 18 i) ())] (Real 4) ColMajor () ) (TypeParameter t ) () (FunctionCall 13 ~add_intrinsic1 10 ~add [((Var 18 res)) ((ArrayItem (Var 18 a) [(() (Var 18 i) ())] (Real 4) ColMajor () ))] (Real 4) () () ) ) () .false. .false. )] [] )] (Var 18 res) Public .true. .true. () ), a_i: (Variable 13 a_i [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a_r: (Variable 13 a_r [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 13 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s_i: (Variable 13 s_i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s_r: (Variable 13 s_r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~add: (CustomOperator 13 ~add [13 ~add_intrinsic 13 ~add_intrinsic1] Public ), ~add_intrinsic: (Function (SymbolTable 15 { arg0: (Variable 15 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 15 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 15 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 15 arg0) (Var 15 arg1)] [(Assignment (Var 15 ret) (IntegerBinOp (Var 15 arg0) Add (Var 15 arg1) (Integer 4) () ) () .false. .false. )] (Var 15 ret) Public .false. .true. () ), ~add_intrinsic1: (Function (SymbolTable 17 { arg0: (Variable 17 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 17 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 17 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic1 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 17 arg0) (Var 17 arg1)] [(Assignment (Var 17 ret) (RealBinOp (Var 17 arg0) Add (Var 17 arg1) (Real 4) () ) () .false. .false. )] (Var 17 ret) Public .false. .true. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(DoLoop () ((Var 13 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 13 a_i) () (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) ) ()) [(Assignment (ArrayItem (Var 13 a_i) [(() (Var 13 i) ())] (Integer 4) ColMajor () ) (Var 13 i) () .false. .false. ) (Assignment (ArrayItem (Var 13 a_r) [(() (Var 13 i) ())] (Real 4) ColMajor () ) (Cast (Var 13 i) IntegerToReal (Real 4) () () ) () .false. .false. )] [] ) (Assignment (Var 13 s_i) (FunctionCall 13 __instantiated_generic_sum () [((ArrayPhysicalCast (Var 13 a_i) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 13 s_r) (FunctionCall 13 __instantiated_generic_sum1 () [((ArrayPhysicalCast (Var 13 a_r) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 13 s_i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 13 s_r)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 13 s_i) NotEq (IntegerConstant 55 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 13 s_r) Sub (Cast (IntegerConstant 55 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 55.000000 (Real 4) ) () ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] () Public .false. .false. () ) }) template_simple_04_m () [template_simple_04_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-fixed_form_implicit1-5bea864.stdout0000664000175000017500000000145315174404631026125 0ustar alastairalastair(TranslationUnit [(Program main () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ())] () )] [(Assignment 0 a 1 () ) (If 0 () (<= a 1) [(Print 0 () [(String "h" ())] () )] [] () () () )] [] )] ) lfortran-0.63.0/tests/reference/asr-array_size_01-cdffaed.stderr0000664000175000017500000000037115174404631024753 0ustar alastairalastairsemantic error: Incorrect number of arguments passed to the 'size' intrinsic. It accepts at least 1 and at most 3 arguments. --> tests/errors/array_size_01.f90:5:14 | 5 | size_a = size(a, 1, 4, kind=4) | ^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/julia-doloop_03-6b5d1e0.stdout0000664000175000017500000000127415174404631024134 0ustar alastairalastairfunction main() local i::Int32 local j::Int32 j = 0 for i ∈ 1:10 j = j + i if i == 3 end if i == 2 break end end if j ≠ 3 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 1:10 if i == 2 break end j = j + i end if j ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 1:10 if i == 2 continue end j = j + i end if j ≠ 53 println(Base.stderr, "ERROR STOP") exit(1) end println(j) end main() lfortran-0.63.0/tests/reference/asr-template_error_04-16c03e5.json0000664000175000017500000000075715174404631024722 0ustar alastairalastair{ "basename": "asr-template_error_04-16c03e5", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_04.f90", "infile_hash": "3d82e0ebf1e89bfdddfc6b3ae47095d92ae6e31d6ca62fdbcf40c593", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_04-16c03e5.stderr", "stderr_hash": "bb95e09903b028ee8a93c75a094907a6b565354afb8fc3a7a4e55a61", "returncode": 2 }lfortran-0.63.0/tests/reference/run-format_12-43152e4.stdout0000664000175000017500000000037415174404631023471 0ustar alastairalastairtesting output using formatting 1 0.1230E+001 7.00 8.00 Hel T 12345678901234567890123456789012345678901234567890 1 2 3 4 5 1 0.1230E+001 7.00 8.00 Hel T end output formatting test lfortran-0.63.0/tests/reference/ast-empty-7fa10d2.stdout0000664000175000017500000000003215174404631023144 0ustar alastairalastair(TranslationUnit [] ) lfortran-0.63.0/tests/reference/asr-nested_01-290187e.json0000664000175000017500000000074515174404631023103 0ustar alastairalastair{ "basename": "asr-nested_01-290187e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_01.f90", "infile_hash": "a7e6c8b63a220874358dba8c3f5052714bbc579c945d1d96474842a7", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_01-290187e.stdout", "stdout_hash": "40433602df1112a3acf4b2bb86b9c131d8957e478e1109d05f3bb735", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit2-d78b357.json0000664000175000017500000000072015174404631023272 0ustar alastairalastair{ "basename": "asr-implicit2-d78b357", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/implicit2.f90", "infile_hash": "a67613a87d4efd0aec316a23fdcc5490e286f34fc588479924d36fae", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit2-d78b357.stderr", "stderr_hash": "6a0c9f6fad4cbad2e56adede46f39283a8a953f87a2e9d5a3a74903b", "returncode": 2 }lfortran-0.63.0/tests/reference/pass_nested_vars-nested_external_dedup_01-94a5d6b.stdout0000664000175000017500000003473215174404631031457 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { __lcompilers_created__nested_context__outer_: (Module (SymbolTable 6 { a: (Variable 6 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __lcompilers_created__nested_context__outer_ () [] .false. .false. .false. ), nested_external_dedup_01: (Program (SymbolTable 2 { outer: (Function (SymbolTable 3 { a: (Variable 3 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a1: (ExternalSymbol 3 a1 6 a __lcompilers_created__nested_context__outer_ [] a Public ), a_nested_ctx: (ExternalSymbol 3 a_nested_ctx 6 a __lcompilers_created__nested_context__outer_ [] a Public ), inner1: (Function (SymbolTable 4 { a: (ExternalSymbol 4 a 6 a __lcompilers_created__nested_context__outer_ [] a Public ) }) inner1 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 4 a) (IntegerBinOp (Var 4 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ), inner2: (Function (SymbolTable 5 { a: (ExternalSymbol 5 a 6 a __lcompilers_created__nested_context__outer_ [] a Public ) }) inner2 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 5 a) (IntegerBinOp (Var 5 a) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .true. .true. () ) }) outer (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 a1) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 a_nested_ctx) (Var 3 a) () .false. .false. ) (SubroutineCall 3 inner1 () [] () .false. ) (Assignment (Var 3 a) (Var 3 a_nested_ctx) () .false. .false. ) (Assignment (Var 3 a_nested_ctx) (Var 3 a) () .false. .false. ) (SubroutineCall 3 inner2 () [] () .false. ) (Assignment (Var 3 a) (Var 3 a_nested_ctx) () .false. .false. )] () Public .true. .true. () ) }) nested_external_dedup_01 [] [(SubroutineCall 2 outer () [] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/run-allocated_04-b4ea2f8.json0000664000175000017500000000071015174404631023777 0ustar alastairalastair{ "basename": "run-allocated_04-b4ea2f8", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/allocated_04.f90", "infile_hash": "1611173eff922a3cb929ef1ac27648e7c337cfad4860f90e35f9ee9d", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-allocated_04-b4ea2f8.stderr", "stderr_hash": "6811b986117fe46e7477efa23d1f313ac289af8b50cd90ad122fa049", "returncode": 1 }lfortran-0.63.0/tests/reference/ast-critical1-98f603a.json0000664000175000017500000000072015174404631023250 0ustar alastairalastair{ "basename": "ast-critical1-98f603a", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/critical1.f90", "infile_hash": "05948a8c6d4476986b19c2be2d0c40a9ebb19a2007eac02159ab9496", "outfile": null, "outfile_hash": null, "stdout": "ast-critical1-98f603a.stdout", "stdout_hash": "84a11b817d717f2b7c7bed084acd5bf22205710672b49b0f775b2f21", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-subroutine8-af54645.json0000664000175000017500000000072615174404631023670 0ustar alastairalastair{ "basename": "ast-subroutine8-af54645", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine8.f90", "infile_hash": "0773280a17582e4ee611300a1962aead9df772923af735456acb45a1", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine8-af54645.stdout", "stdout_hash": "3cada5129881227e5d8c744754db3c1dc3d62b162068d4ab76d8189f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-external1-93d8653.stdout0000664000175000017500000001004115174404631023571 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iddr_rsvd: (Function (SymbolTable 2 { matvect: (Function (SymbolTable 3 { matvect_return_var_name: (Variable 3 matvect_return_var_name [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) matvect (FunctionType [] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 3 matvect_return_var_name) Public .false. .false. () ) }) iddr_rsvd (FunctionType [(FunctionType [] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 matvect)] [] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-cond_02-373a22a.json0000664000175000017500000000073715174404631022611 0ustar alastairalastair{ "basename": "asr-cond_02-373a22a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/cond_02.f90", "infile_hash": "fc70f7e7943dfe505736cca5b8ff39a034a4a1a7f441d9bdf0a82662", "outfile": null, "outfile_hash": null, "stdout": "asr-cond_02-373a22a.stdout", "stdout_hash": "4bcfcbff08e0bb018d9401e00cff9cf2ca54a77f249c3160ac074744", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_20-771801a.stdout0000664000175000017500000005525015174404631024352 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_20: (Program (SymbolTable 2 { dp: (Variable 2 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pi: (Variable 2 pi [] Local (IntrinsicElementalFunction Acos [(RealUnaryMinus (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant -1.000000 (Real 4) ) )] 0 (Real 4) (RealConstant 3.141593 (Real 4) ) ) (RealConstant 3.141593 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), pi_dp: (Variable 2 pi_dp [] Local (IntrinsicElementalFunction Acos [(RealUnaryMinus (RealConstant 1.000000 (Real 8) ) (Real 8) (RealConstant -1.000000 (Real 8) ) )] 0 (Real 8) (RealConstant 3.141593 (Real 8) ) ) (RealConstant 3.141593 (Real 8) ) Parameter (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local (IntrinsicElementalFunction Cos [(RealBinOp (Cast (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant 7 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) () ) Mul (RealConstant 7.000000 (Real 4) ) (Real 4) (RealConstant 49.000000 (Real 4) ) )] 0 (Real 4) (RealConstant 0.300593 (Real 4) ) ) (RealConstant 0.300593 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y2: (Variable 2 y2 [] Local (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_20 [] [(Print (StringFormat () [(Var 2 pi)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 pi_dp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 y) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(IntrinsicElementalFunction Cos [(RealBinOp (Cast (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant 7 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) () ) Mul (RealConstant 7.000000 (Real 4) ) (Real 4) (RealConstant 49.000000 (Real 4) ) )] 0 (Real 4) (RealConstant 0.300593 (Real 4) ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction Cos [(RealBinOp (Cast (IntegerBinOp (Var 2 y) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 4) () () ) Mul (RealConstant 7.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction Cos [(RealBinOp (Cast (IntegerBinOp (Var 2 y2) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant 7 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) () ) Mul (RealConstant 7.000000 (Real 4) ) (Real 4) (RealConstant 49.000000 (Real 4) ) )] 0 (Real 4) (RealConstant 0.300593 (Real 4) ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(RealBinOp (RealBinOp (IntrinsicElementalFunction Cos [(RealBinOp (Var 2 x) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) (Real 4) (RealConstant 1.300593 (Real 4) ) )] 0 (Real 4) (RealConstant 0.266928 (Real 4) ) ) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) (RealConstant 0.071250 (Real 4) ) ) Add (RealBinOp (IntrinsicElementalFunction Sin [(RealBinOp (Var 2 x) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) (Real 4) (RealConstant 1.300593 (Real 4) ) )] 0 (Real 4) (RealConstant 0.963717 (Real 4) ) ) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) (RealConstant 0.928750 (Real 4) ) ) (Real 4) (RealConstant 1.000000 (Real 4) ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-modules_36-53c9a79.stdout0000664000175000017500000013273515174404631024131 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> %modules_36_fpm_main_01.fpm_run_settings_class = type <{ i32 (...)**, %modules_36_fpm_main_01.fpm_run_settings* }> %modules_36_fpm_main_01.fpm_run_settings = type { %modules_36_fpm_main_01.fpm_build_settings, %string_descriptor, %string_descriptor, %string_descriptor, i32 } %modules_36_fpm_main_01.fpm_build_settings = type { i32 } %modules_36_fpm_main_01.fpm_build_settings_class = type <{ i32 (...)**, %modules_36_fpm_main_01.fpm_build_settings* }> @0 = private unnamed_addr constant [47 x i8] c"__libasr_created__intrinsic_array_function_Any\00", align 1 @1 = private unnamed_addr constant [42 x i8] c"tests/../integration_tests/modules_36.f90\00", align 1 @2 = private unnamed_addr constant [15 x i8] c"LHS size is %d\00", align 1 @3 = private unnamed_addr constant [42 x i8] c"tests/../integration_tests/modules_36.f90\00", align 1 @4 = private unnamed_addr constant [15 x i8] c"RHS size is %d\00", align 1 @5 = private unnamed_addr constant [127 x i8] c"Array shape mismatch in assignment to '%s'. Tried to match size %d of dimension %d of LHS with size %d of dimension %d of RHS.\00", align 1 @6 = private unnamed_addr constant [47 x i8] c"__libasr_created__intrinsic_array_function_Any\00", align 1 @7 = private unnamed_addr constant [42 x i8] c"tests/../integration_tests/modules_36.f90\00", align 1 @8 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @9 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @10 = private unnamed_addr constant [6 x i8] c"found\00", align 1 @11 = private unnamed_addr constant [42 x i8] c"tests/../integration_tests/modules_36.f90\00", align 1 @12 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @13 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @14 = private unnamed_addr constant [35 x i8] c"_lcompilers_Any_4_1_0_logical____0\00", align 1 @15 = private unnamed_addr constant [42 x i8] c"tests/../integration_tests/modules_36.f90\00", align 1 @16 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @17 = private unnamed_addr constant [143 x i8] c"Runtime error: Array shape mismatch in subroutine '%s'\0A\0ATried to match size %d of dimension %d of argument number %d, but expected size is %d\0A\00", align 1 @string_const_data = private constant [0 x i8] zeroinitializer @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([0 x i8], [0 x i8]* @string_const_data, i32 0, i32 0), i64 0 }> @18 = private unnamed_addr constant [5 x i8] c"mask\00", align 1 @19 = private unnamed_addr constant [42 x i8] c"tests/../integration_tests/modules_36.f90\00", align 1 @20 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @21 = private unnamed_addr constant [118 x i8] c"Runtime error: Array '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @_Name_fpm_build_settings = private unnamed_addr constant [19 x i8] c"fpm_build_settings\00", align 1 @_Type_Info_fpm_build_settings = linkonce_odr unnamed_addr constant { i8*, i8*, i8* } { i8* getelementptr inbounds ([19 x i8], [19 x i8]* @_Name_fpm_build_settings, i32 0, i32 0), i8* inttoptr (i64 4 to i8*), i8* null }, align 8 @_VTable_fpm_build_settings = linkonce_odr unnamed_addr constant { [5 x i8*] } { [5 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_fpm_build_settings to i8*), i8* bitcast (void (i8*, i8*)* @_copy_modules_36_fpm_main_01_fpm_build_settings to i8*), i8* bitcast (void (i8**)* @_allocate_struct_modules_36_fpm_main_01_fpm_build_settings to i8*), i8* bitcast (void (i8*)* @finalize_StructType__fpm_build_settings_of_modules_36_fpm_main_01_for_UPoly to i8*)] }, align 8 @_Name_fpm_run_settings = private unnamed_addr constant [17 x i8] c"fpm_run_settings\00", align 1 @_Type_Info_fpm_run_settings = linkonce_odr unnamed_addr constant { i8*, i8*, i8* } { i8* getelementptr inbounds ([17 x i8], [17 x i8]* @_Name_fpm_run_settings, i32 0, i32 0), i8* inttoptr (i64 56 to i8*), i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_fpm_build_settings to i8*) }, align 8 @_VTable_fpm_run_settings = linkonce_odr unnamed_addr constant { [5 x i8*] } { [5 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_fpm_run_settings to i8*), i8* bitcast (void (i8*, i8*)* @_copy_modules_36_fpm_main_01_fpm_run_settings to i8*), i8* bitcast (void (i8**)* @_allocate_struct_modules_36_fpm_main_01_fpm_run_settings to i8*), i8* bitcast (void (i8*)* @finalize_StructType__fpm_run_settings_of_modules_36_fpm_main_01_for_UPoly to i8*)] }, align 8 define i32 @_lcompilers_Any_4_1_0_logical____0(i32* %mask, i32* %__1mask) { .entry: %0 = call i8* @_lfortran_get_default_allocator() %__1_i = alloca i32, align 4 %__do_loop_end = alloca i32, align 4 %_lcompilers_Any_4_1_0 = alloca i32, align 4 store i32 0, i32* %_lcompilers_Any_4_1_0, align 4 %1 = load i32, i32* %__1mask, align 4 %2 = add i32 %1, 1 %3 = sub i32 %2, 1 store i32 %3, i32* %__do_loop_end, align 4 store i32 0, i32* %__1_i, align 4 br label %loop.head loop.head: ; preds = %ifcont, %.entry %4 = load i32, i32* %__1_i, align 4 %5 = add i32 %4, 1 %6 = load i32, i32* %__do_loop_end, align 4 %7 = icmp sle i32 %5, %6 br i1 %7, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %8 = load i32, i32* %__1_i, align 4 %9 = add i32 %8, 1 store i32 %9, i32* %__1_i, align 4 %10 = load i32, i32* %_lcompilers_Any_4_1_0, align 4 %11 = load i32, i32* %__1_i, align 4 %12 = load i32, i32* %__1mask, align 4 %13 = sext i32 %11 to i64 %14 = sub i64 %13, 1 %15 = mul i64 1, %14 %16 = add i64 0, %15 %17 = sext i32 %12 to i64 %18 = add i64 1, %17 %19 = sub i64 %18, 1 %20 = icmp slt i64 %13, 1 %21 = icmp sgt i64 %13, %19 %22 = or i1 %20, %21 br i1 %22, label %then, label %ifcont then: ; preds = %loop.body %23 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %24 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %25 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %24, i32 0, i32 0 %26 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %25, i32 0, i32 0 store i8* getelementptr inbounds ([42 x i8], [42 x i8]* @19, i32 0, i32 0), i8** %26, align 8 %27 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %25, i32 0, i32 1 store i32 24, i32* %27, align 4 %28 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %25, i32 0, i32 2 store i32 10, i32* %28, align 4 %29 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %25, i32 0, i32 3 store i32 24, i32* %29, align 4 %30 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %25, i32 0, i32 4 store i32 24, i32* %30, align 4 %31 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @20, i32 0, i32 0)) %32 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %23, i32 0, i32 0 %33 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %24, i32 0, i32 0 %34 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %32, i32 0, i32 2 %35 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %32, i32 0, i32 0 store i1 true, i1* %35, align 1 %36 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %32, i32 0, i32 1 store i8* %31, i8** %36, align 8 store { i8*, i32, i32, i32, i32 }* %33, { i8*, i32, i32, i32, i32 }** %34, align 8 %37 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %32, i32 0, i32 3 store i32 1, i32* %37, align 4 %38 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %23, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %38, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @18, i32 0, i32 0), i64 %13, i32 1, i64 1, i64 %19) call void @exit(i32 1) unreachable ifcont: ; preds = %loop.body %39 = mul i64 1, %17 %40 = getelementptr inbounds i32, i32* %mask, i64 %16 %41 = load i32, i32* %40, align 4 %42 = or i32 %10, %41 store i32 %42, i32* %_lcompilers_Any_4_1_0, align 4 br label %loop.head loop.end: ; preds = %loop.head br label %return return: ; preds = %loop.end br label %FINALIZE_SYMTABLE__lcompilers_Any_4_1_0_logical____0 FINALIZE_SYMTABLE__lcompilers_Any_4_1_0_logical____0: ; preds = %return %43 = load i32, i32* %_lcompilers_Any_4_1_0, align 4 ret i32 %43 } define void @__module_modules_36_fpm_main_01_cmd_run(%modules_36_fpm_main_01.fpm_run_settings_class* %settings, i32* %test) { .entry: %call_arg_value = alloca i32, align 4 %array_bound14 = alloca i32, align 4 %array_bound10 = alloca i32, align 4 %array_bound = alloca i32, align 4 %0 = call i8* @_lfortran_get_default_allocator() %array_size1 = alloca i32, align 4 %array_size = alloca i32, align 4 %__do_loop_end = alloca i32, align 4 %__libasr_created__intrinsic_array_function_Any = alloca [2 x i32], align 4 %__libasr_created__intrinsic_array_function_Any1 = alloca i32, align 4 %__libasr_index_0_ = alloca i32, align 4 %__libasr_index_0_1 = alloca i32, align 4 %found = alloca [2 x i32], align 4 %toomany = alloca i32, align 4 br i1 true, label %then, label %else then: ; preds = %.entry store i32 2, i32* %array_size, align 4 br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %1 = load i32, i32* %array_size, align 4 br i1 true, label %then2, label %else3 then2: ; preds = %ifcont store i32 2, i32* %array_size1, align 4 br label %ifcont4 else3: ; preds = %ifcont br label %ifcont4 ifcont4: ; preds = %else3, %then2 %2 = load i32, i32* %array_size1, align 4 %3 = icmp ne i32 %2, %1 br i1 %3, label %then5, label %ifcont6 then5: ; preds = %ifcont4 %4 = alloca [2 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %5 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %6 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %5, i32 0, i32 0 %7 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %6, i32 0, i32 0 store i8* getelementptr inbounds ([42 x i8], [42 x i8]* @1, i32 0, i32 0), i8** %7, align 8 %8 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %6, i32 0, i32 1 store i32 24, i32* %8, align 4 %9 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %6, i32 0, i32 2 store i32 14, i32* %9, align 4 %10 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %6, i32 0, i32 3 store i32 24, i32* %10, align 4 %11 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %6, i32 0, i32 4 store i32 23, i32* %11, align 4 %12 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @2, i32 0, i32 0), i32 %1) %13 = getelementptr inbounds [2 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [2 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %4, i32 0, i32 0 %14 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %5, i32 0, i32 0 %15 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %13, i32 0, i32 2 %16 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %13, i32 0, i32 0 store i1 true, i1* %16, align 1 %17 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %13, i32 0, i32 1 store i8* %12, i8** %17, align 8 store { i8*, i32, i32, i32, i32 }* %14, { i8*, i32, i32, i32, i32 }** %15, align 8 %18 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %13, i32 0, i32 3 store i32 1, i32* %18, align 4 %19 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %20 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %19, i32 0, i32 0 %21 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %20, i32 0, i32 0 store i8* getelementptr inbounds ([42 x i8], [42 x i8]* @3, i32 0, i32 0), i8** %21, align 8 %22 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %20, i32 0, i32 1 store i32 24, i32* %22, align 4 %23 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %20, i32 0, i32 2 store i32 19, i32* %23, align 4 %24 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %20, i32 0, i32 3 store i32 24, i32* %24, align 4 %25 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %20, i32 0, i32 4 store i32 23, i32* %25, align 4 %26 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @4, i32 0, i32 0), i32 %2) %27 = getelementptr inbounds [2 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [2 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %4, i32 0, i32 1 %28 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %19, i32 0, i32 0 %29 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %27, i32 0, i32 2 %30 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %27, i32 0, i32 0 store i1 true, i1* %30, align 1 %31 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %27, i32 0, i32 1 store i8* %26, i8** %31, align 8 store { i8*, i32, i32, i32, i32 }* %28, { i8*, i32, i32, i32, i32 }** %29, align 8 %32 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %27, i32 0, i32 3 store i32 1, i32* %32, align 4 %33 = getelementptr [2 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [2 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %4, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %33, i32 2, i8* getelementptr inbounds ([127 x i8], [127 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @0, i32 0, i32 0), i32 %1, i32 1, i32 %2, i32 1) call void @exit(i32 1) unreachable ifcont6: ; preds = %ifcont4 br i1 true, label %then7, label %else8 then7: ; preds = %ifcont6 store i32 1, i32* %array_bound, align 4 br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 %34 = load i32, i32* %array_bound, align 4 store i32 %34, i32* %__libasr_index_0_1, align 4 br i1 true, label %then11, label %else12 then11: ; preds = %ifcont9 store i32 2, i32* %array_bound10, align 4 br label %ifcont13 else12: ; preds = %ifcont9 br label %ifcont13 ifcont13: ; preds = %else12, %then11 %35 = load i32, i32* %array_bound10, align 4 store i32 %35, i32* %__do_loop_end, align 4 br i1 true, label %then15, label %else16 then15: ; preds = %ifcont13 store i32 1, i32* %array_bound14, align 4 br label %ifcont17 else16: ; preds = %ifcont13 br label %ifcont17 ifcont17: ; preds = %else16, %then15 %36 = load i32, i32* %array_bound14, align 4 %37 = sub i32 %36, 1 store i32 %37, i32* %__libasr_index_0_, align 4 br label %loop.head loop.head: ; preds = %ifcont21, %ifcont17 %38 = load i32, i32* %__libasr_index_0_, align 4 %39 = add i32 %38, 1 %40 = load i32, i32* %__do_loop_end, align 4 %41 = icmp sle i32 %39, %40 br i1 %41, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %42 = load i32, i32* %__libasr_index_0_, align 4 %43 = add i32 %42, 1 store i32 %43, i32* %__libasr_index_0_, align 4 %44 = load i32, i32* %__libasr_index_0_, align 4 %45 = sext i32 %44 to i64 %46 = sub i64 %45, 1 %47 = mul i64 1, %46 %48 = add i64 0, %47 %49 = icmp slt i64 %45, 1 %50 = icmp sgt i64 %45, 2 %51 = or i1 %49, %50 br i1 %51, label %then18, label %ifcont19 then18: ; preds = %loop.body %52 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %53 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %54 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %53, i32 0, i32 0 %55 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %54, i32 0, i32 0 store i8* getelementptr inbounds ([42 x i8], [42 x i8]* @7, i32 0, i32 0), i8** %55, align 8 %56 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %54, i32 0, i32 1 store i32 24, i32* %56, align 4 %57 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %54, i32 0, i32 2 store i32 14, i32* %57, align 4 %58 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %54, i32 0, i32 3 store i32 24, i32* %58, align 4 %59 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %54, i32 0, i32 4 store i32 23, i32* %59, align 4 %60 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @8, i32 0, i32 0)) %61 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %52, i32 0, i32 0 %62 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %53, i32 0, i32 0 %63 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %61, i32 0, i32 2 %64 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %61, i32 0, i32 0 store i1 true, i1* %64, align 1 %65 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %61, i32 0, i32 1 store i8* %60, i8** %65, align 8 store { i8*, i32, i32, i32, i32 }* %62, { i8*, i32, i32, i32, i32 }** %63, align 8 %66 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %61, i32 0, i32 3 store i32 1, i32* %66, align 4 %67 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %52, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %67, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @6, i32 0, i32 0), i64 %45, i32 1, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont19: ; preds = %loop.body %68 = getelementptr [2 x i32], [2 x i32]* %__libasr_created__intrinsic_array_function_Any, i32 0, i64 %48 %69 = load i32, i32* %__libasr_index_0_1, align 4 %70 = sext i32 %69 to i64 %71 = sub i64 %70, 1 %72 = mul i64 1, %71 %73 = add i64 0, %72 %74 = icmp slt i64 %70, 1 %75 = icmp sgt i64 %70, 2 %76 = or i1 %74, %75 br i1 %76, label %then20, label %ifcont21 then20: ; preds = %ifcont19 %77 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %78 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %79 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %78, i32 0, i32 0 %80 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %79, i32 0, i32 0 store i8* getelementptr inbounds ([42 x i8], [42 x i8]* @11, i32 0, i32 0), i8** %80, align 8 %81 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %79, i32 0, i32 1 store i32 24, i32* %81, align 4 %82 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %79, i32 0, i32 2 store i32 19, i32* %82, align 4 %83 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %79, i32 0, i32 3 store i32 24, i32* %83, align 4 %84 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %79, i32 0, i32 4 store i32 23, i32* %84, align 4 %85 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @12, i32 0, i32 0)) %86 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %77, i32 0, i32 0 %87 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %78, i32 0, i32 0 %88 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %86, i32 0, i32 2 %89 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %86, i32 0, i32 0 store i1 true, i1* %89, align 1 %90 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %86, i32 0, i32 1 store i8* %85, i8** %90, align 8 store { i8*, i32, i32, i32, i32 }* %87, { i8*, i32, i32, i32, i32 }** %88, align 8 %91 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %86, i32 0, i32 3 store i32 1, i32* %91, align 4 %92 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %77, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %92, i32 1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @10, i32 0, i32 0), i64 %70, i32 1, i64 1, i64 2) call void @exit(i32 1) unreachable ifcont21: ; preds = %ifcont19 %93 = getelementptr [2 x i32], [2 x i32]* %found, i32 0, i64 %73 %94 = load i32, i32* %93, align 4 %95 = xor i32 %94, 1 store i32 %95, i32* %68, align 4 %96 = load i32, i32* %__libasr_index_0_1, align 4 %97 = add i32 %96, 1 store i32 %97, i32* %__libasr_index_0_1, align 4 br label %loop.head loop.end: ; preds = %loop.head br i1 false, label %then22, label %ifcont23 then22: ; preds = %loop.end %98 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %99 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %100 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %99, i32 0, i32 0 %101 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %100, i32 0, i32 0 store i8* getelementptr inbounds ([42 x i8], [42 x i8]* @15, i32 0, i32 0), i8** %101, align 8 %102 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %100, i32 0, i32 1 store i32 24, i32* %102, align 4 %103 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %100, i32 0, i32 2 store i32 14, i32* %103, align 4 %104 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %100, i32 0, i32 3 store i32 24, i32* %104, align 4 %105 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %100, i32 0, i32 4 store i32 23, i32* %105, align 4 %106 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @16, i32 0, i32 0)) %107 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %98, i32 0, i32 0 %108 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %99, i32 0, i32 0 %109 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %107, i32 0, i32 2 %110 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %107, i32 0, i32 0 store i1 true, i1* %110, align 1 %111 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %107, i32 0, i32 1 store i8* %106, i8** %111, align 8 store { i8*, i32, i32, i32, i32 }* %108, { i8*, i32, i32, i32, i32 }** %109, align 8 %112 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %107, i32 0, i32 3 store i32 1, i32* %112, align 4 %113 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %98, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %0, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %113, i32 1, i8* getelementptr inbounds ([143 x i8], [143 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @14, i32 0, i32 0), i32 2, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont23: ; preds = %loop.end %114 = getelementptr [2 x i32], [2 x i32]* %__libasr_created__intrinsic_array_function_Any, i32 0, i32 0 store i32 2, i32* %call_arg_value, align 4 %115 = call i32 @_lcompilers_Any_4_1_0_logical____0(i32* %114, i32* %call_arg_value) store i32 %115, i32* %__libasr_created__intrinsic_array_function_Any1, align 4 %116 = load i32, i32* %__libasr_created__intrinsic_array_function_Any1, align 4 %117 = load i32, i32* %toomany, align 4 %118 = load i32, i32* %test, align 4 %119 = xor i32 %118, 1 %120 = and i32 %117, %119 %121 = load i32, i32* %toomany, align 4 %122 = getelementptr %modules_36_fpm_main_01.fpm_run_settings_class, %modules_36_fpm_main_01.fpm_run_settings_class* %settings, i32 0, i32 1 %123 = load %modules_36_fpm_main_01.fpm_run_settings*, %modules_36_fpm_main_01.fpm_run_settings** %122, align 8 %124 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %123, i32 0, i32 3 %125 = getelementptr %string_descriptor, %string_descriptor* %124, i32 0, i32 0 %126 = load i8*, i8** %125, align 8 %127 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 %128 = call i32 @str_compare(i8* %126, i64 6, i8* %127, i64 0) %129 = icmp ne i32 %128, 0 %130 = zext i1 %129 to i32 %131 = and i32 %121, %130 %132 = or i32 %120, %131 %133 = getelementptr %modules_36_fpm_main_01.fpm_run_settings_class, %modules_36_fpm_main_01.fpm_run_settings_class* %settings, i32 0, i32 1 %134 = load %modules_36_fpm_main_01.fpm_run_settings*, %modules_36_fpm_main_01.fpm_run_settings** %133, align 8 %135 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %134, i32 0, i32 0 %136 = getelementptr %modules_36_fpm_main_01.fpm_build_settings, %modules_36_fpm_main_01.fpm_build_settings* %135, i32 0, i32 0 %137 = load i32, i32* %136, align 4 %138 = xor i32 %137, 1 %139 = and i32 %132, %138 %140 = or i32 %116, %139 %141 = icmp ne i32 %140, 0 br i1 %141, label %then24, label %else25 then24: ; preds = %ifcont23 br label %ifcont26 else25: ; preds = %ifcont23 br label %ifcont26 ifcont26: ; preds = %else25, %then24 br label %return return: ; preds = %ifcont26 br label %FINALIZE_SYMTABLE_cmd_run FINALIZE_SYMTABLE_cmd_run: ; preds = %return ret void } declare i8* @_lcompilers_snprintf_alloc(i8*, i8*, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lcompilers_runtime_error(i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) declare void @exit(i32) declare i32 @str_compare(i8*, i64, i8*, i64) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value = alloca i32, align 4 %2 = alloca %modules_36_fpm_main_01.fpm_run_settings_class, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %settings = alloca %modules_36_fpm_main_01.fpm_run_settings, align 8 %3 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %settings, i32 0, i32 2 store %string_descriptor zeroinitializer, %string_descriptor* %3, align 1 %4 = getelementptr %string_descriptor, %string_descriptor* %3, i32 0, i32 1 store i64 4, i64* %4, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %3, i32 0, i32 0 %6 = call i8* @_lfortran_get_default_allocator() %7 = call i8* @_lfortran_malloc_alloc(i8* %6, i64 4) store i8* %7, i8** %5, align 8 %8 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %settings, i32 0, i32 4 %9 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %settings, i32 0, i32 1 store %string_descriptor zeroinitializer, %string_descriptor* %9, align 1 %10 = getelementptr %string_descriptor, %string_descriptor* %9, i32 0, i32 1 store i64 5, i64* %10, align 8 %11 = call i8* @_lfortran_get_default_allocator() %12 = call i8* @_lfortran_malloc_alloc(i8* %11, i64 10) %13 = getelementptr %string_descriptor, %string_descriptor* %9, i32 0, i32 0 store i8* %12, i8** %13, align 8 %14 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %settings, i32 0, i32 3 store %string_descriptor zeroinitializer, %string_descriptor* %14, align 1 %15 = getelementptr %string_descriptor, %string_descriptor* %14, i32 0, i32 1 store i64 6, i64* %15, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %14, i32 0, i32 0 %17 = call i8* @_lfortran_get_default_allocator() %18 = call i8* @_lfortran_malloc_alloc(i8* %17, i64 6) store i8* %18, i8** %16, align 8 %19 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %settings, i32 0, i32 0 %20 = getelementptr %modules_36_fpm_main_01.fpm_build_settings, %modules_36_fpm_main_01.fpm_build_settings* %19, i32 0, i32 0 store i32 0, i32* %20, align 4 %21 = getelementptr %modules_36_fpm_main_01.fpm_run_settings_class, %modules_36_fpm_main_01.fpm_run_settings_class* %2, i32 0, i32 0 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_fpm_run_settings, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %21, align 8 %22 = getelementptr %modules_36_fpm_main_01.fpm_run_settings_class, %modules_36_fpm_main_01.fpm_run_settings_class* %2, i32 0, i32 1 store %modules_36_fpm_main_01.fpm_run_settings* %settings, %modules_36_fpm_main_01.fpm_run_settings** %22, align 8 store i32 1, i32* %call_arg_value, align 4 call void @__module_modules_36_fpm_main_01_cmd_run(%modules_36_fpm_main_01.fpm_run_settings_class* %2, i32* %call_arg_value) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_modules_36 FINALIZE_SYMTABLE_modules_36: ; preds = %return br label %Finalize_Variable_settings Finalize_Variable_settings: ; preds = %FINALIZE_SYMTABLE_modules_36 call void @finalize_StructType__fpm_run_settings_of_modules_36_fpm_main_01(%modules_36_fpm_main_01.fpm_run_settings* %settings) call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc_alloc(i8*, i64) define linkonce_odr void @_copy_modules_36_fpm_main_01_fpm_build_settings(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %modules_36_fpm_main_01.fpm_build_settings* %3 = bitcast i8* %1 to %modules_36_fpm_main_01.fpm_build_settings* %4 = getelementptr %modules_36_fpm_main_01.fpm_build_settings, %modules_36_fpm_main_01.fpm_build_settings* %2, i32 0, i32 0 %5 = load i32, i32* %4, align 4 %6 = getelementptr %modules_36_fpm_main_01.fpm_build_settings, %modules_36_fpm_main_01.fpm_build_settings* %3, i32 0, i32 0 br i1 true, label %then, label %else then: ; preds = %entry store i32 %5, i32* %6, align 4 br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then ret void } define linkonce_odr void @_allocate_struct_modules_36_fpm_main_01_fpm_build_settings(i8** %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = call i8* @_lfortran_malloc_alloc(i8* %1, i64 16) call void @llvm.memset.p0i8.i32(i8* %2, i8 0, i32 16, i1 false) store i8* %2, i8** %0, align 8 %3 = load i8*, i8** %0, align 8 %4 = bitcast i8* %3 to %modules_36_fpm_main_01.fpm_build_settings_class* %5 = bitcast %modules_36_fpm_main_01.fpm_build_settings_class* %4 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_fpm_build_settings, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %5, align 8 %6 = getelementptr %modules_36_fpm_main_01.fpm_build_settings_class, %modules_36_fpm_main_01.fpm_build_settings_class* %4, i32 0, i32 1 %7 = call i8* @_lfortran_get_default_allocator() %8 = call i8* @_lfortran_malloc_alloc(i8* %7, i64 4) call void @llvm.memset.p0i8.i32(i8* %8, i8 0, i32 4, i1 false) %9 = bitcast i8* %8 to %modules_36_fpm_main_01.fpm_build_settings* store %modules_36_fpm_main_01.fpm_build_settings* %9, %modules_36_fpm_main_01.fpm_build_settings** %6, align 8 %10 = getelementptr %modules_36_fpm_main_01.fpm_build_settings, %modules_36_fpm_main_01.fpm_build_settings* %9, i32 0, i32 0 store i32 0, i32* %10, align 4 ret void } define internal void @finalize_StructType__fpm_build_settings_of_modules_36_fpm_main_01_for_UPoly(i8* %0) { entry: %1 = bitcast i8* %0 to %modules_36_fpm_main_01.fpm_build_settings* ret void } ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 define linkonce_odr void @_copy_modules_36_fpm_main_01_fpm_run_settings(i8* %0, i8* %1) { entry: %2 = call i8* @_lfortran_get_default_allocator() %3 = bitcast i8* %0 to %modules_36_fpm_main_01.fpm_run_settings* %4 = bitcast i8* %1 to %modules_36_fpm_main_01.fpm_run_settings* %5 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %3, i32 0, i32 1 %6 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %4, i32 0, i32 1 br i1 true, label %then, label %else then: ; preds = %entry %7 = getelementptr %string_descriptor, %string_descriptor* %6, i32 0, i32 0 %8 = getelementptr %string_descriptor, %string_descriptor* %6, i32 0, i32 1 %9 = getelementptr %string_descriptor, %string_descriptor* %5, i32 0, i32 0 %10 = load i8*, i8** %9, align 8 call void @_lfortran_strcpy_alloc(i8* %2, i8** %7, i64* %8, i8 0, i8 0, i8* %10, i64 5) br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then %11 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %3, i32 0, i32 2 %12 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %4, i32 0, i32 2 br i1 true, label %then1, label %else2 then1: ; preds = %ifcont %13 = getelementptr %string_descriptor, %string_descriptor* %12, i32 0, i32 0 %14 = getelementptr %string_descriptor, %string_descriptor* %12, i32 0, i32 1 %15 = getelementptr %string_descriptor, %string_descriptor* %11, i32 0, i32 0 %16 = load i8*, i8** %15, align 8 call void @_lfortran_strcpy_alloc(i8* %2, i8** %13, i64* %14, i8 0, i8 0, i8* %16, i64 4) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %17 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %3, i32 0, i32 3 %18 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %4, i32 0, i32 3 br i1 true, label %then4, label %else5 then4: ; preds = %ifcont3 %19 = getelementptr %string_descriptor, %string_descriptor* %18, i32 0, i32 0 %20 = getelementptr %string_descriptor, %string_descriptor* %18, i32 0, i32 1 %21 = getelementptr %string_descriptor, %string_descriptor* %17, i32 0, i32 0 %22 = load i8*, i8** %21, align 8 call void @_lfortran_strcpy_alloc(i8* %2, i8** %19, i64* %20, i8 0, i8 0, i8* %22, i64 6) br label %ifcont6 else5: ; preds = %ifcont3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 %23 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %3, i32 0, i32 4 %24 = load i32, i32* %23, align 4 %25 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %4, i32 0, i32 4 br i1 true, label %then7, label %else8 then7: ; preds = %ifcont6 store i32 %24, i32* %25, align 4 br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 %26 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %3, i32 0, i32 0 %27 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %4, i32 0, i32 0 %28 = getelementptr %modules_36_fpm_main_01.fpm_build_settings, %modules_36_fpm_main_01.fpm_build_settings* %26, i32 0, i32 0 %29 = load i32, i32* %28, align 4 %30 = getelementptr %modules_36_fpm_main_01.fpm_build_settings, %modules_36_fpm_main_01.fpm_build_settings* %27, i32 0, i32 0 br i1 true, label %then10, label %else11 then10: ; preds = %ifcont9 store i32 %29, i32* %30, align 4 br label %ifcont12 else11: ; preds = %ifcont9 br label %ifcont12 ifcont12: ; preds = %else11, %then10 ret void } define linkonce_odr void @_allocate_struct_modules_36_fpm_main_01_fpm_run_settings(i8** %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() %2 = call i8* @_lfortran_malloc_alloc(i8* %1, i64 16) call void @llvm.memset.p0i8.i32(i8* %2, i8 0, i32 16, i1 false) store i8* %2, i8** %0, align 8 %3 = load i8*, i8** %0, align 8 %4 = bitcast i8* %3 to %modules_36_fpm_main_01.fpm_run_settings_class* %5 = bitcast %modules_36_fpm_main_01.fpm_run_settings_class* %4 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_fpm_run_settings, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %5, align 8 %6 = getelementptr %modules_36_fpm_main_01.fpm_run_settings_class, %modules_36_fpm_main_01.fpm_run_settings_class* %4, i32 0, i32 1 %7 = call i8* @_lfortran_get_default_allocator() %8 = call i8* @_lfortran_malloc_alloc(i8* %7, i64 56) call void @llvm.memset.p0i8.i32(i8* %8, i8 0, i32 56, i1 false) %9 = bitcast i8* %8 to %modules_36_fpm_main_01.fpm_run_settings* store %modules_36_fpm_main_01.fpm_run_settings* %9, %modules_36_fpm_main_01.fpm_run_settings** %6, align 8 %10 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %9, i32 0, i32 2 store %string_descriptor zeroinitializer, %string_descriptor* %10, align 1 %11 = getelementptr %string_descriptor, %string_descriptor* %10, i32 0, i32 1 store i64 4, i64* %11, align 8 %12 = getelementptr %string_descriptor, %string_descriptor* %10, i32 0, i32 0 %13 = call i8* @_lfortran_get_default_allocator() %14 = call i8* @_lfortran_malloc_alloc(i8* %13, i64 4) store i8* %14, i8** %12, align 8 %15 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %9, i32 0, i32 4 %16 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %9, i32 0, i32 1 store %string_descriptor zeroinitializer, %string_descriptor* %16, align 1 %17 = getelementptr %string_descriptor, %string_descriptor* %16, i32 0, i32 1 store i64 5, i64* %17, align 8 %18 = call i8* @_lfortran_get_default_allocator() %19 = call i8* @_lfortran_malloc_alloc(i8* %18, i64 10) %20 = getelementptr %string_descriptor, %string_descriptor* %16, i32 0, i32 0 store i8* %19, i8** %20, align 8 %21 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %9, i32 0, i32 3 store %string_descriptor zeroinitializer, %string_descriptor* %21, align 1 %22 = getelementptr %string_descriptor, %string_descriptor* %21, i32 0, i32 1 store i64 6, i64* %22, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %21, i32 0, i32 0 %24 = call i8* @_lfortran_get_default_allocator() %25 = call i8* @_lfortran_malloc_alloc(i8* %24, i64 6) store i8* %25, i8** %23, align 8 %26 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %9, i32 0, i32 0 %27 = getelementptr %modules_36_fpm_main_01.fpm_build_settings, %modules_36_fpm_main_01.fpm_build_settings* %26, i32 0, i32 0 store i32 0, i32* %27, align 4 ret void } define internal void @finalize_StructType__fpm_run_settings_of_modules_36_fpm_main_01_for_UPoly(i8* %0) { entry: %1 = bitcast i8* %0 to %modules_36_fpm_main_01.fpm_run_settings* call void @finalize_StructType__fpm_run_settings_of_modules_36_fpm_main_01(%modules_36_fpm_main_01.fpm_run_settings* %1) ret void } define internal void @finalize_StructType__fpm_run_settings_of_modules_36_fpm_main_01(%modules_36_fpm_main_01.fpm_run_settings* %0) { entry: %1 = call i8* @_lfortran_get_default_allocator() br label %"Finalize_struct_fpm_run_settings's_name_member" "Finalize_struct_fpm_run_settings's_name_member": ; preds = %entry %2 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %0, i32 0, i32 1 %3 = getelementptr %string_descriptor, %string_descriptor* %2, i32 0, i32 0 %4 = load i8*, i8** %3, align 8 call void @_lfortran_free_alloc(i8* %1, i8* %4) %5 = ptrtoint %string_descriptor* %2 to i64 %6 = icmp ne i64 %5, 0 br i1 %6, label %then, label %else then: ; preds = %"Finalize_struct_fpm_run_settings's_name_member" br label %ifcont else: ; preds = %"Finalize_struct_fpm_run_settings's_name_member" br label %ifcont ifcont: ; preds = %else, %then br label %"Finalize_struct_fpm_run_settings's_args_member" "Finalize_struct_fpm_run_settings's_args_member": ; preds = %ifcont %7 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %0, i32 0, i32 2 %8 = getelementptr %string_descriptor, %string_descriptor* %7, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 call void @_lfortran_free_alloc(i8* %1, i8* %9) br label %"Finalize_struct_fpm_run_settings's_runner_member" "Finalize_struct_fpm_run_settings's_runner_member": ; preds = %"Finalize_struct_fpm_run_settings's_args_member" %10 = getelementptr %modules_36_fpm_main_01.fpm_run_settings, %modules_36_fpm_main_01.fpm_run_settings* %0, i32 0, i32 3 %11 = getelementptr %string_descriptor, %string_descriptor* %10, i32 0, i32 0 %12 = load i8*, i8** %11, align 8 call void @_lfortran_free_alloc(i8* %1, i8* %12) ret void } declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_strcpy_alloc(i8*, i8**, i64*, i8, i8, i8*, i64) declare void @_lfortran_internal_alloc_finalize() attributes #0 = { argmemonly nounwind willreturn writeonly } lfortran-0.63.0/tests/reference/llvm-finalize_01-5496007.json0000664000175000017500000000073115174404631023521 0ustar alastairalastair{ "basename": "llvm-finalize_01-5496007", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/finalize_01.f90", "infile_hash": "81b1d43091ce29fff8f14e778b9a33030de61262f7c499b22c152b7e", "outfile": null, "outfile_hash": null, "stdout": "llvm-finalize_01-5496007.stdout", "stdout_hash": "1f645146a21faf540ce42ff4bc12269ff682646b5139811e8e980697", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-do3-54790e3.stdout0000664000175000017500000000301315174404631022351 0ustar alastairalastair(TranslationUnit [(Program do3 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ())] () )] [(Assignment 0 j 0 () ) (DoLoop 0 () 15 i 1 5 () [(Assignment 0 j (+ j i) () ) (Continue 15 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 j 0 () ) (DoLoop 0 () 20 i 1 6 2 [(Assignment 0 j (+ j i) () ) (Continue 20 () )] () () )] [] )] ) ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootlfortran-0.63.0/tests/reference/pass_transform_optional_argument_functions-optional_03-1316a5f.stdoutlfortran-0.63.0/tests/reference/pass_transform_optional_argument_functions-optional_03-1316a5f.stdou0000664000175000017500000006504415174404631034062 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { optional_03: (Program (SymbolTable 5 { __libasr_created_dummy_variable_: (Variable 5 __libasr_created_dummy_variable_ [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_dummy_variable_1: (Variable 5 __libasr_created_dummy_variable_1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_dummy_variable_2: (Variable 5 __libasr_created_dummy_variable_2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_variable_pointer_: (Variable 5 __libasr_created_variable_pointer_ [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_variable_pointer_1: (Variable 5 __libasr_created_variable_pointer_1 [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), __libasr_created_variable_pointer_2: (Variable 5 __libasr_created_variable_pointer_2 [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f1: (ExternalSymbol 5 f1 2 f1 optional_03_m [] f1 Public ), i: (Variable 5 i [] Local () () Default (Allocatable (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lfortran_tmp: (Variable 5 lfortran_tmp [] Local () () Default (Allocatable (Integer 4) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lfortran_tmp1: (Variable 5 lfortran_tmp1 [] Local () () Default (Allocatable (Integer 4) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), my_sub: (ExternalSymbol 5 my_sub 2 my_sub optional_03_m [] my_sub Public ) }) optional_03 [optional_03_m] [(Assignment (Var 5 i) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (If () (IntrinsicImpureFunction Allocated [(Var 5 i)] 0 (Logical 4) () ) [(Associate (Var 5 __libasr_created_variable_pointer_) (Var 5 i) )] [(Associate (Var 5 __libasr_created_variable_pointer_) (Var 5 __libasr_created_dummy_variable_) )] ) (Assignment (Var 5 lfortran_tmp) (FunctionCall 5 f1 () [((Var 5 __libasr_created_variable_pointer_)) ((LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 5 i)] 0 (Logical 4) () ) And (LogicalConstant .true. (Logical 4) ) (Logical 4) () ))] (Allocatable (Integer 4) ) () () ) () .false. .false. ) (If () (IntrinsicImpureFunction Allocated [(Var 5 lfortran_tmp)] 0 (Logical 4) () ) [(Associate (Var 5 __libasr_created_variable_pointer_1) (Var 5 lfortran_tmp) )] [(Associate (Var 5 __libasr_created_variable_pointer_1) (Var 5 __libasr_created_dummy_variable_1) )] ) (Assignment (Var 5 lfortran_tmp1) (FunctionCall 5 f1 () [((Var 5 __libasr_created_variable_pointer_1)) ((LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 5 lfortran_tmp)] 0 (Logical 4) () ) And (LogicalConstant .true. (Logical 4) ) (Logical 4) () ))] (Allocatable (Integer 4) ) () () ) () .false. .false. ) (If () (IntrinsicImpureFunction Allocated [(Var 5 lfortran_tmp1)] 0 (Logical 4) () ) [(Associate (Var 5 __libasr_created_variable_pointer_2) (Var 5 lfortran_tmp1) )] [(Associate (Var 5 __libasr_created_variable_pointer_2) (Var 5 __libasr_created_dummy_variable_2) )] ) (SubroutineCall 5 my_sub () [((FunctionCall 5 f1 () [((Var 5 __libasr_created_variable_pointer_2)) ((LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 5 lfortran_tmp1)] 0 (Logical 4) () ) And (LogicalConstant .true. (Logical 4) ) (Logical 4) () ))] (Allocatable (Integer 4) ) () () ))] () .false. )] ), optional_03_m: (Module (SymbolTable 2 { f1: (Function (SymbolTable 4 { __libasr_is_present_x: (Variable 4 __libasr_is_present_x [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 4 r [] ReturnVar () () Default (Allocatable (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 4 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f1 (FunctionType [(Integer 4) (Logical 4)] (Allocatable (Integer 4) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 x) (Var 4 __libasr_is_present_x)] [(Assignment (Var 4 r) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 4 r) Public .true. .true. () ), my_sub: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) my_sub (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Print (StringFormat () [(StringConstant "a =" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 3 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) optional_03_m () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-cast_node_m_value-8b7098f.json0000664000175000017500000000075015174404631025054 0ustar alastairalastair{ "basename": "asr-cast_node_m_value-8b7098f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/cast_node_m_value.f90", "infile_hash": "9935456d6f13100b0649b0da43367516a22c1d8d747656cc2e9ac9d3", "outfile": null, "outfile_hash": null, "stdout": "asr-cast_node_m_value-8b7098f.stdout", "stdout_hash": "6a247a12e730df3c1eb29aab098e6a49bae17008bfb0ab2a761567d7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-statement_01-00eefc8.json0000664000175000017500000000102515174404631024030 0ustar alastairalastair{ "basename": "asr-statement_01-00eefc8", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/statement_01.f90", "infile_hash": "fa4dec1637f247dd008b3228459dec03794d377643c25b443ba26c08", "outfile": null, "outfile_hash": null, "stdout": "asr-statement_01-00eefc8.stdout", "stdout_hash": "781e3d440550b44068a39bb4e4e674df6e4b90cbc088a95fb9052bfc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-passing_array_01-b2bde68.stderr0000664000175000017500000000052715174404631025247 0ustar alastairalastairsemantic error: Function 'test_01_interface' not found (not user defined nor intrinsic) --> tests/errors/passing_array_01.f90:24:16 | 24 | ret = test_01_interface(len,value) ! This raise error as interfaces are strict on matching the number of ranks, so it doesn't find a match. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/run-format_52-f04ddb1.stdout0000664000175000017500000000001715174404631023704 0ustar alastairalastair1st2nd 1st 2nd lfortran-0.63.0/tests/reference/asr-functions_16-3e10090.json0000664000175000017500000000075615174404631023623 0ustar alastairalastair{ "basename": "asr-functions_16-3e10090", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_16.f90", "infile_hash": "f0bb1852c528b9e8f34b1e8b3c8f4aaac6f064bbe56c89cc8988f72c", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_16-3e10090.stdout", "stdout_hash": "d3a243c9db3b2f2940f4024101396290c93e3b68ead832c4a11d8cf6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules3-8936416.stdout0000664000175000017500000011612215174404631023347 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { tomlf_structure: (Module (SymbolTable 13 { toml_ordered: (ExternalSymbol 13 toml_ordered 15 toml_ordered tomlf_structure_base [] toml_ordered Public ) }) tomlf_structure () [tomlf_structure_base] .true. .false. .false. ), tomlf_structure_base: (Module (SymbolTable 15 { destroy: (Function (SymbolTable 18 { self: (Variable 18 self [] InOut () () Default (StructType [] [] .false. .false. ) 15 toml_structure Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), toml_value: (ExternalSymbol 18 toml_value 9 toml_value tomlf_type_value [] toml_value Public ) }) destroy (FunctionType [(StructType [] [] .false. .false. )] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 18 self)] [] () Public .false. .false. () ), toml_ordered: (Struct (SymbolTable 16 { }) toml_ordered (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .true. [] () 15 toml_structure [] ), toml_structure: (Struct (SymbolTable 17 { destroy: (StructMethodDeclaration 17 destroy () destroy 15 destroy Source .true. .false. ) }) toml_structure (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .true. [] () () [] ) }) tomlf_structure_base () [tomlf_type_value] .true. .false. .false. ), tomlf_type: (Module (SymbolTable 2 { destroy: (ExternalSymbol 2 destroy 4 destroy tomlf_type_array [] destroy Public ), new: (ExternalSymbol 2 new 4 new tomlf_type_array [] new Public ), new_array: (ExternalSymbol 2 new_array 4 new_array tomlf_type_array [] new_array Public ), toml_array: (ExternalSymbol 2 toml_array 4 toml_array tomlf_type_array [] toml_array Public ), toml_ordered: (ExternalSymbol 2 toml_ordered 15 toml_ordered tomlf_structure_base [] toml_ordered Public ), toml_value: (ExternalSymbol 2 toml_value 9 toml_value tomlf_type_value [] toml_value Public ) }) tomlf_type () [tomlf_type_array tomlf_structure_base tomlf_type_value] .false. .false. .false. ), tomlf_type_array: (Module (SymbolTable 4 { destroy: (Function (SymbolTable 6 { 1_toml_array_list: (ExternalSymbol 6 1_toml_array_list 5 list toml_array [] list Public ), 1_toml_structure: (ExternalSymbol 6 1_toml_structure 15 toml_structure tomlf_structure_base [] toml_structure Public ), 1_toml_structure_destroy: (ExternalSymbol 6 1_toml_structure_destroy 17 destroy 1_toml_structure [] destroy Public ), 1_toml_value_key: (ExternalSymbol 6 1_toml_value_key 10 key toml_value [] key Public ), self: (Variable 6 self [] InOut () () Default (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .false. .false. ) 4 toml_array Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) destroy (FunctionType [(StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 self)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 6 self) 6 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(ExplicitDeallocate [(StructInstanceMember (Var 6 self) 6 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] )] [] ) (If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 6 self) 6 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () )] 0 (Logical 4) () ) [(SubroutineCall 6 1_toml_structure_destroy () [((StructInstanceMember (Var 6 self) 6 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () ))] (StructInstanceMember (Var 6 self) 6 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () ) .false. ) (ExplicitDeallocate [(StructInstanceMember (Var 6 self) 6 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () )] )] [] )] () Public .true. .true. () ), new: (GenericProcedure 4 new [4 new_array] Public ), new_array: (Function (SymbolTable 7 { self: (Variable 7 self [] Out () () Default (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. ) 4 toml_array Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) new_array (FunctionType [(StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 self)] [] () Public .true. .true. () ), toml_array: (Struct (SymbolTable 5 { destroy: (StructMethodDeclaration 5 destroy () destroy 4 destroy Source .false. .false. ), list: (Variable 5 list [] Local () () Default (Allocatable (StructType [] [] .false. .false. ) ) 4 toml_ordered Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_array (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. ) [] [list] [] Source Public .false. .false. [] () 4 toml_value [] ), toml_ordered: (ExternalSymbol 4 toml_ordered 15 toml_ordered tomlf_structure_base [] toml_ordered Public ), toml_value: (ExternalSymbol 4 toml_value 9 toml_value tomlf_type_value [] toml_value Public ) }) tomlf_type_array () [tomlf_type_value tomlf_structure tomlf_structure_base] .true. .false. .false. ), tomlf_type_value: (Module (SymbolTable 9 { destroy: (Function (SymbolTable 11 { self: (Variable 11 self [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 9 toml_value Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) destroy (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. )] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 self)] [] () Private .false. .false. () ), toml_value: (Struct (SymbolTable 10 { destroy: (StructMethodDeclaration 10 destroy () destroy 9 destroy Source .true. .false. ), key: (Variable 10 key [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_value (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [key] [] Source Private .false. .true. [] () () [] ) }) tomlf_type_value () [] .true. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/lookup_name-lookup_name2-458b8c9.json0000664000175000017500000000075415174404631025527 0ustar alastairalastair{ "basename": "lookup_name-lookup_name2-458b8c9", "cmd": "lfortran --lookup-name --no-color {infile} -o {outfile}", "infile": "tests/lookup_name2.f90", "infile_hash": "6040a3665d4455ccb812ccc763c7d458221ef5b0eb639ed341de0618", "outfile": null, "outfile_hash": null, "stdout": "lookup_name-lookup_name2-458b8c9.stdout", "stdout_hash": "2a076cd88dcc0af73a879cf1317d863ca06861b56701296213975336", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-max_02-646ff6d.stderr0000664000175000017500000000036115174404631023101 0ustar alastairalastairwarning: Different kinds of args in max0 is a non-standard extension --> tests/../integration_tests/max_02.f90:4:14 | 4 | print *, max(y, z) | ^^^^^^^^^ help: ensure all arguments have the same kind to make it standard lfortran-0.63.0/tests/reference/asr-array1-20700fb.json0000664000175000017500000000070715174404631022557 0ustar alastairalastair{ "basename": "asr-array1-20700fb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/array1.f90", "infile_hash": "74ef23b0c6d49a710e5035ce53fa6899eb51ef5e5b693d15108744ca", "outfile": null, "outfile_hash": null, "stdout": "asr-array1-20700fb.stdout", "stdout_hash": "a6cb20b3ecf63c409a6d57f6a5a08c674eec29b281a1f3ce59e5f683", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-expr3-1bb382e.stdout0000664000175000017500000000017415174404631023060 0ustar alastairalastair(TranslationUnit [5 (+ 5 3) (* (+ 5 3) 2) (+ 5 (* 3 2)) (- 5 3) (** 4 3) (+ 5 3) (+ 5 3)] ) lfortran-0.63.0/tests/reference/asr-derived_types_19-26385d4.json0000664000175000017500000000077215174404631024500 0ustar alastairalastair{ "basename": "asr-derived_types_19-26385d4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_19.f90", "infile_hash": "a9da1104d322f3007a699fff0010dc79e402c02cb90ff428eee37db1", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_19-26385d4.stdout", "stdout_hash": "ddf96a5b5d772ed8d9a0585ee33bc4e451ee46df3898a4653b499b1c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-modules_06-7f94d73.stdout0000664000175000017500000000536715174404631023746 0ustar alastairalastair(TranslationUnit [(Module modules_06_b (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(b [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Function b [] [(AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 b 5 () )] [] [] )] ) (Module modules_06_a () [(Use [] modules_06_b [(UseSymbol b () )] .true. () )] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(a [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Function a [] [(AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 a (+ 3 (FuncCallOrArray b [] [] [] [] [] )) () )] [] [] )] )] ) lfortran-0.63.0/tests/reference/c_target_omp-openmp_70-377d35b.stdout0000664000175000017500000000405715174404631025433 0ustar alastairalastair#include #include #include #include #include #include struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct r32 { float *data; struct dimension_descriptor dims[32]; int32_t n_dims; int32_t offset; bool is_allocated; }; // Implementations int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); int32_t __libasr_index_0_; int32_t __libasr_index_0_1; struct r32 a_value; struct r32* a = &a_value; float a_data[1000000]; a->data = a_data; a->n_dims = 1; a->offset = 0; a->dims[0].lower_bound = 1; a->dims[0].length = 1000000; a->dims[0].stride = 1; struct r32 b_value; struct r32* b = &b_value; float b_data[1000000]; b->data = b_data; b->n_dims = 1; b->offset = 0; b->dims[0].lower_bound = 1; b->dims[0].length = 1000000; b->dims[0].stride = 1; int32_t i; for (__libasr_index_0_=((int32_t)b->dims[1-1].lower_bound); __libasr_index_0_<=((int32_t) b->dims[1-1].length + b->dims[1-1].lower_bound - 1); __libasr_index_0_++) { b->data[(0 + (1 * (__libasr_index_0_ - 1)))] = (float)(5); } for (__libasr_index_0_1=((int32_t)a->dims[1-1].lower_bound); __libasr_index_0_1<=((int32_t) a->dims[1-1].length + a->dims[1-1].lower_bound - 1); __libasr_index_0_1++) { a->data[(0 + (1 * (__libasr_index_0_1 - 1)))] = (float)(0); } #pragma omp target map(tofrom: a->data[1:1000000]) map(tofrom: b->data[1:1000000]) #pragma omp teams #pragma omp distribute parallel for for (i=1; i<=1000000; i++) { a->data[(0 + (1 * (i - 1)))] = (float)(i) + b->data[(0 + (1 * (i - 1)))]*(float)(340); } printf("%f%s%f\n", a->data[(0 + (1 * (5 - 1)))], " ", b->data[(0 + (1 * (5 - 1)))]); if (a->data[(0 + (1 * (5 - 1)))] != (float)(1705)) { fprintf(stderr, "ERROR STOP"); exit(1); } if (b->data[(0 + (1 * (5 - 1)))] != (float)(5)) { fprintf(stderr, "ERROR STOP"); exit(1); } return 0; } lfortran-0.63.0/tests/reference/c-case_01-2ff47e6.stdout0000664000175000017500000000162615174404631022705 0ustar alastairalastair#include #include #include #include #include #include // Implementations int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); int64_t i; int64_t out; i = 4; if (i == 1) { out = 10; printf("%s\n","1"); } else if (i == 2) { out = 20; printf("%s\n","2"); } else if (i == 3) { out = 30; printf("%s\n","3"); } else if (i == 4) { out = 40; printf("%s\n","4"); } if (out != 40) { fprintf(stderr, "ERROR STOP"); exit(1); } if (i == 1) { out = 11; printf("%s\n","1"); } else if (i == 2 || i == 3 || i == 4) { out = 22; printf("%s\n","2,3,4"); } if (out != 22) { fprintf(stderr, "ERROR STOP"); exit(1); } return 0; } lfortran-0.63.0/tests/reference/ast-data_01-dc2d917.json0000664000175000017500000000073715174404631022673 0ustar alastairalastair{ "basename": "ast-data_01-dc2d917", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/data_01.f90", "infile_hash": "a6123c6637d7c6bbbc1715d75b768d90e42d66aac038b3dcb00d2fb5", "outfile": null, "outfile_hash": null, "stdout": "ast-data_01-dc2d917.stdout", "stdout_hash": "401bbe2eabae7a5738f93c528ad8405fb94837c795dd5a916521b42c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixedform_doloop3-d579f3c.stdout0000664000175000017500000001175515174404631025466 0ustar alastairalastair(TranslationUnit [(Subroutine start1 [(n) (f) (l) (lout)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [] [(f [(1 l DimensionExpr)] [] () () None ()) (one [] [] () () None ()) (two [] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [one two] [(Real "1.0") (Real "2.0")] )] () ) (Assignment 0 lout (+ 1 (/ n 2)) () ) (DoLoop 0 () 1 i 1 lout () [(Assignment 1 (FuncCallOrArray f [] [(() i () 0)] [] [] [] ) two () )] () () ) (If 0 () (== (FuncCallOrArray mod [] [(() n () 0) (() 2 () 0)] [] [] [] ) 0) [(Assignment 0 (FuncCallOrArray f [] [(() lout () 0)] [] [] [] ) one () )] [] () () () ) (Return 0 () () )] [] [] ) (Subroutine f [(n)] [] () () [] [] [] [] [(DoLoop 0 () 1 i 1 lout () [(Assignment 0 a 1 () ) (DoLoop 0 () 0 j 3 n () [(Assignment 0 b 2 () ) (DoLoop 0 () 4 k 3 n () [(Assignment 0 c 3 () ) (DoLoop 0 () 5 l 3 n () [(Assignment 0 d 4 () ) (Assignment 5 xx 5 () )] () () ) (Assignment 0 e 5 () )] () () ) (Assignment 0 kmn 6 () )] () () ) (Assignment 0 g 8 () ) (Assignment 1 (FuncCallOrArray kmn [] [(() i () 0)] [] [] [] ) two () )] () () ) (Assignment 0 h 9 () )] [] [] )] ) lfortran-0.63.0/tests/reference/ast-subroutine3b-98faad7.stdout0000664000175000017500000000231315174404631024535 0ustar alastairalastair(TranslationUnit [(Function f [] [(AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 f 42 () )] [] [] ) (Function g [] [(AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 g 42 () )] [] [] ) (Function h [] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [] [(Assignment 0 h 42 () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-intrinsic_implicit-b5b124f.stdout0000664000175000017500000001366415174404631025720 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fppasu: (Function (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), max0: (Variable 2 max0 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fppasu (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 a) (Cast (IntrinsicElementalFunction Max [(IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 b) (Cast (IntrinsicElementalFunction Max [(IntegerConstant 1 (Integer 4) Decimal) (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) (IntegerConstant 1 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) () .false. .false. )] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_interface_01-07d787f.stdout0000664000175000017500000062107615174404631026122 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_interface_01: (Program (SymbolTable 22 { cast_integer: (ExternalSymbol 22 cast_integer 2 cast_integer template_interface_01_m [] cast_integer Public ), cast_r: (ExternalSymbol 22 cast_r 2 cast_r template_interface_01_m [] cast_r Public ), cast_real: (ExternalSymbol 22 cast_real 2 cast_real template_interface_01_m [] cast_real Public ), operator_r: (ExternalSymbol 22 operator_r 2 operator_r template_interface_01_m [] operator_r Public ), simple_generic_sum: (ExternalSymbol 22 simple_generic_sum 2 simple_generic_sum template_interface_01_m [] simple_generic_sum Public ), sum_t: (ExternalSymbol 22 sum_t 2 sum_t template_interface_01_m [] sum_t Public ), test_template: (ExternalSymbol 22 test_template 2 test_template template_interface_01_m [] test_template Public ) }) template_interface_01 [template_interface_01_m] [(SubroutineCall 22 test_template () [] () .false. )] ), template_interface_01_m: (Module (SymbolTable 2 { cast_integer: (Function (SymbolTable 11 { arg: (Variable 11 arg [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 11 res [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast_integer (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 11 arg)] [(Assignment (Var 11 res) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 11 res) Public .true. .true. () ), cast_r: (Requirement (SymbolTable 5 { cast: (Function (SymbolTable 6 { arg: (Variable 6 arg [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 6 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 6 arg)] [] (Var 6 res) Public .true. .true. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast_r [t cast] [] ), cast_real: (Function (SymbolTable 12 { arg: (Variable 12 arg [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 12 res [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast_real (FunctionType [(Integer 4)] (Real 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 12 arg)] [(Assignment (Var 12 res) (RealConstant 0.000000 (Real 4) ) () .false. .false. )] (Var 12 res) Public .true. .true. () ), operator_r: (Requirement (SymbolTable 3 { binary_func: (Function (SymbolTable 4 { lhs: (Variable 4 lhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 4 res [] ReturnVar () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 4 rhs [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) binary_func (FunctionType [(TypeParameter t ) (TypeParameter u )] (TypeParameter v ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 4 lhs) (Var 4 rhs)] [] (Var 4 res) Public .true. .true. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u: (Variable 3 u [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 3 v [] In () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) operator_r [t u v binary_func] [] ), simple_generic_sum: (Template (SymbolTable 13 { add: (Function (SymbolTable 14 { lhs: (Variable 14 lhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 14 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 14 rhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 14 lhs) (Var 14 rhs)] [] (Var 14 res) Public .true. .true. () ), cast: (Function (SymbolTable 15 { arg: (Variable 15 arg [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 15 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 15 arg)] [] (Var 15 res) Public .true. .true. () ), simple_generic_sum: (Function (SymbolTable 16 { arr: (Variable 16 arr [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 16 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 16 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 16 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~add: (CustomOperator 16 ~add [13 add] Public ) }) simple_generic_sum (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast add] [(Var 16 arr)] [(Assignment (Var 16 n) (ArraySize (Var 16 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 16 res) (FunctionCall 13 cast () [((IntegerConstant 0 (Integer 4) Decimal))] (TypeParameter t ) () () ) () .false. .false. ) (If () (IntegerCompare (Var 16 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 16 res) (ArrayItem (Var 16 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 16 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 16 n) ()) [(Assignment (Var 16 res) (OverloadedBinOp (Var 16 res) Add (ArrayItem (Var 16 arr) [(() (Var 16 i) ())] (TypeParameter t ) ColMajor () ) (TypeParameter t ) () (FunctionCall 13 add 16 ~add [((Var 16 res)) ((ArrayItem (Var 16 arr) [(() (Var 16 i) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) ) () .false. .false. )] [] )] [] )] (Var 16 res) Public .true. .true. () ), t: (Variable 13 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) simple_generic_sum [t add cast] [(Require operator_r [t add] ) (Require cast_r [t cast] )] ), sum_t: (Template (SymbolTable 7 { add: (Function (SymbolTable 8 { lhs: (Variable 8 lhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 8 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rhs: (Variable 8 rhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 8 lhs) (Var 8 rhs)] [] (Var 8 res) Public .true. .true. () ), cast: (Function (SymbolTable 9 { arg: (Variable 9 arg [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 9 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 9 arg)] [] (Var 9 res) Public .true. .true. () ), generic_sum: (Function (SymbolTable 10 { arr: (Variable 10 arr [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 10 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 10 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 10 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) generic_sum (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast add] [(Var 10 arr)] [(Assignment (Var 10 n) (ArraySize (Var 10 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 10 res) (FunctionCall 7 cast () [((IntegerConstant 0 (Integer 4) Decimal))] (TypeParameter t ) () () ) () .false. .false. ) (If () (IntegerCompare (Var 10 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 10 res) (ArrayItem (Var 10 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 10 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 10 n) ()) [(Assignment (Var 10 res) (OverloadedBinOp (Var 10 res) Add (ArrayItem (Var 10 arr) [(() (Var 10 i) ())] (TypeParameter t ) ColMajor () ) (TypeParameter t ) () (FunctionCall 7 add 7 ~add [((Var 10 res)) ((ArrayItem (Var 10 arr) [(() (Var 10 i) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) ) () .false. .false. )] [] )] [] )] (Var 10 res) Public .true. .true. () ), t: (Variable 7 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~add: (CustomOperator 7 ~add [7 add] Public ) }) sum_t [t add cast] [(Require operator_r [t add] ) (Require cast_r [t cast] )] ), test_template: (Function (SymbolTable 17 { __instantiated_simple_generic_sum: (Function (SymbolTable 23 { arr: (Variable 23 arr [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 23 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 23 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 23 res [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __instantiated_simple_generic_sum (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_integer ~add_intrinsic] [(Var 23 arr)] [(Assignment (Var 23 n) (ArraySize (Var 23 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 23 res) (FunctionCall 2 cast_integer () [((IntegerConstant 0 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 23 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 23 res) (ArrayItem (Var 23 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 23 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 23 n) ()) [(Assignment (Var 23 res) (OverloadedBinOp (Var 23 res) Add (ArrayItem (Var 23 arr) [(() (Var 23 i) ())] (Integer 4) ColMajor () ) (TypeParameter t ) () (FunctionCall 17 ~add_intrinsic 16 ~add [((Var 23 res)) ((ArrayItem (Var 23 arr) [(() (Var 23 i) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) ) () .false. .false. )] [] )] [] )] (Var 23 res) Public .true. .true. () ), __instantiated_simple_generic_sum1: (Function (SymbolTable 24 { arr: (Variable 24 arr [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 24 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 24 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 24 res [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __instantiated_simple_generic_sum1 (FunctionType [(Array (Real 4) [(() ())] DescriptorArray )] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_real ~add_intrinsic1] [(Var 24 arr)] [(Assignment (Var 24 n) (ArraySize (Var 24 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 24 res) (FunctionCall 2 cast_real () [((IntegerConstant 0 (Integer 4) Decimal))] (Real 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 24 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 24 res) (ArrayItem (Var 24 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 24 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 24 n) ()) [(Assignment (Var 24 res) (OverloadedBinOp (Var 24 res) Add (ArrayItem (Var 24 arr) [(() (Var 24 i) ())] (Real 4) ColMajor () ) (TypeParameter t ) () (FunctionCall 17 ~add_intrinsic1 16 ~add [((Var 24 res)) ((ArrayItem (Var 24 arr) [(() (Var 24 i) ())] (Real 4) ColMajor () ))] (Real 4) () () ) ) () .false. .false. )] [] )] [] )] (Var 24 res) Public .true. .true. () ), ai: (Variable 17 ai [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ar: (Variable 17 ar [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), generic_sum_integer: (Function (SymbolTable 19 { arr: (Variable 19 arr [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 19 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 19 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 19 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) generic_sum_integer (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_integer ~add_intrinsic] [(Var 19 arr)] [(Assignment (Var 19 n) (ArraySize (Var 19 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 19 res) (FunctionCall 2 cast_integer () [((IntegerConstant 0 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 19 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 19 res) (ArrayItem (Var 19 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 19 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 19 n) ()) [(Assignment (Var 19 res) (OverloadedBinOp (Var 19 res) Add (ArrayItem (Var 19 arr) [(() (Var 19 i) ())] (Integer 4) ColMajor () ) (TypeParameter t ) () (FunctionCall 17 ~add_intrinsic 7 ~add [((Var 19 res)) ((ArrayItem (Var 19 arr) [(() (Var 19 i) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) ) () .false. .false. )] [] )] [] )] (Var 19 res) Public .true. .true. () ), generic_sum_real: (Function (SymbolTable 21 { arr: (Variable 21 arr [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 21 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 21 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), res: (Variable 21 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) generic_sum_real (FunctionType [(Array (Real 4) [(() ())] DescriptorArray )] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_real ~add_intrinsic1] [(Var 21 arr)] [(Assignment (Var 21 n) (ArraySize (Var 21 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 21 res) (FunctionCall 2 cast_real () [((IntegerConstant 0 (Integer 4) Decimal))] (Real 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 21 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 21 res) (ArrayItem (Var 21 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 21 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 21 n) ()) [(Assignment (Var 21 res) (OverloadedBinOp (Var 21 res) Add (ArrayItem (Var 21 arr) [(() (Var 21 i) ())] (Real 4) ColMajor () ) (TypeParameter t ) () (FunctionCall 17 ~add_intrinsic1 7 ~add [((Var 21 res)) ((ArrayItem (Var 21 arr) [(() (Var 21 i) ())] (Real 4) ColMajor () ))] (Real 4) () () ) ) () .false. .false. )] [] )] [] )] (Var 21 res) Public .true. .true. () ), i: (Variable 17 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ri: (Variable 17 ri [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rr: (Variable 17 rr [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~add: (CustomOperator 17 ~add [17 ~add_intrinsic 17 ~add_intrinsic1] Public ), ~add_intrinsic: (Function (SymbolTable 18 { arg0: (Variable 18 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 18 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 18 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 18 arg0) (Var 18 arg1)] [(Assignment (Var 18 ret) (IntegerBinOp (Var 18 arg0) Add (Var 18 arg1) (Integer 4) () ) () .false. .false. )] (Var 18 ret) Public .true. .true. () ), ~add_intrinsic1: (Function (SymbolTable 20 { arg0: (Variable 20 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 20 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 20 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic1 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 20 arg0) (Var 20 arg1)] [(Assignment (Var 20 ret) (RealBinOp (Var 20 arg0) Add (Var 20 arg1) (Real 4) () ) () .false. .false. )] (Var 20 ret) Public .true. .true. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(DoLoop () ((Var 17 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 17 ai) [(() (Var 17 i) ())] (Integer 4) ColMajor () ) (Var 17 i) () .false. .false. ) (Assignment (ArrayItem (Var 17 ar) [(() (Var 17 i) ())] (Real 4) ColMajor () ) (Cast (Var 17 i) IntegerToReal (Real 4) () () ) () .false. .false. )] [] ) (Assignment (Var 17 ri) (FunctionCall 17 generic_sum_integer () [((ArrayPhysicalCast (Var 17 ai) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 17 rr) (FunctionCall 17 generic_sum_real () [((ArrayPhysicalCast (Var 17 ar) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 17 ri)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 17 rr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 17 __instantiated_simple_generic_sum () [((ArrayPhysicalCast (Var 17 ai) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 17 __instantiated_simple_generic_sum1 () [((ArrayPhysicalCast (Var 17 ar) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_interface_01_m () [template_interface_01_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-open1-df87f77.json0000664000175000017500000000070415174404631022515 0ustar alastairalastair{ "basename": "ast-open1-df87f77", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/open1.f90", "infile_hash": "932467cb6b7bcbf97a0b9a7c90ea1ca8074bde26145accfc0bb252c2", "outfile": null, "outfile_hash": null, "stdout": "ast-open1-df87f77.stdout", "stdout_hash": "c04e156b6fe36aeb38e7cb3dbd7aa9fd653205542f08759997a670c8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_29-d4080f2.stdout0000664000175000017500000000606615174404631024443 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_29: (Program (SymbolTable 2 { random_dp: (Variable 2 random_dp [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), random_sp: (Variable 2 random_sp [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_29 [] [(IntrinsicImpureSubroutine RandomNumber [(Var 2 random_sp)] 0 ) (IntrinsicImpureSubroutine RandomNumber [(Var 2 random_dp)] 0 ) (Print (StringFormat () [(Var 2 random_sp) (Var 2 random_dp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-fn3-5eccc1b.json0000664000175000017500000000067615174404631022302 0ustar alastairalastair{ "basename": "ast-fn3-5eccc1b", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fn3.f90", "infile_hash": "9cb6b85c5c656d4fd5e9402dd69877be1fec7b37ce21b2ae59abc263", "outfile": null, "outfile_hash": null, "stdout": "ast-fn3-5eccc1b.stdout", "stdout_hash": "55534aa7232b364cec210b2e7385105d5124524c7d57abae3b855db6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor1-7e98a71.json0000664000175000017500000000077015174404631026461 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor1-7e98a71", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor1.f90", "infile_hash": "a07132d08deb1a0de21dd365371df337fe07652c9d42aa4c0a7e19ab", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor1-7e98a71.stdout", "stdout_hash": "31456897c33d1a10fd0c548b359debc7a7ac6bebfd2173287faa2205", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_error_07-e57f5fc.stderr0000664000175000017500000000026515174404631025427 0ustar alastairalastairsemantic error: The number of parameters passed to 'r' is not correct --> tests/errors/template_error_07.f90:15:20 | 15 | require :: r(t) | ^^^^ lfortran-0.63.0/tests/reference/asr-private1-f9f97ce.json0000664000175000017500000000072415174404631023306 0ustar alastairalastair{ "basename": "asr-private1-f9f97ce", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/private1.f90", "infile_hash": "2d80d22188cbb5b29b17cef6855c9098194d5fe89b0bf9b14d7a8af2", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-private1-f9f97ce.stderr", "stderr_hash": "cedaa206aa9e964748ccb604498e30d1fc7d09fbb7c67218381a600d", "returncode": 2 }lfortran-0.63.0/tests/reference/llvm-issue532-d63b703.stdout0000664000175000017500000000105215174404631023502 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_issue532 FINALIZE_SYMTABLE_issue532: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-matrix_matmul_06-d802f54.json0000664000175000017500000000075415174404631024566 0ustar alastairalastair{ "basename": "asr-matrix_matmul_06-d802f54", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/matrix_matmul_06.f90", "infile_hash": "2ac4617ccffd9a39c1e70decb9c881861ed47f75310858ee3ca5a034", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-matrix_matmul_06-d802f54.stderr", "stderr_hash": "fd2fe4cf726c194ebbd4c2a605a139b49c3b1fc1dd4b80500ee6fad1", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-struct_allocate-606e066.stdout0000664000175000017500000004565715174404631025072 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { mod_struct_allocate: (Module (SymbolTable 2 { mxdim: (Variable 2 mxdim [] Local (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), rp1d: (Struct (SymbolTable 3 { f: (Variable 3 f [] Local () () Default (Pointer (Array (Real 8) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) rp1d (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [] [f] [] Source Public .false. .false. [] () () [] ), sds: (Struct (SymbolTable 4 { scales: (Variable 4 scales [] Local () () Default (Array (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) 2 rp1d Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sds (StructType [(Array (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray )] [] .true. .false. ) [] [scales] [] Source Public .false. .false. [] () () [] ) }) mod_struct_allocate () [] .false. .false. .false. ), struct_allocate: (Program (SymbolTable 5 { 1_rp1d_f: (ExternalSymbol 5 1_rp1d_f 3 f rp1d [] f Public ), 1_sds_scales: (ExternalSymbol 5 1_sds_scales 4 scales sds [] scales Public ), rp1d: (ExternalSymbol 5 rp1d 2 rp1d mod_struct_allocate [] rp1d Public ), s: (Variable 5 s [] Local () () Default (StructType [(Array (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray )] [] .true. .false. ) 5 sds Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sds: (ExternalSymbol 5 sds 2 sds mod_struct_allocate [] sds Public ) }) struct_allocate [mod_struct_allocate] [(Allocate [((StructInstanceMember (ArrayItem (StructInstanceMember (Var 5 s) 5 1_sds_scales (Array (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) ColMajor () ) 5 1_rp1d_f (Pointer (Array (Real 8) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] () () ())] () () () ) (Allocate [((StructInstanceMember (ArrayItem (StructInstanceMember (Var 5 s) 5 1_sds_scales (Array (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) ColMajor () ) 5 1_rp1d_f (Pointer (Array (Real 8) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] () () ())] () () () )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-implicit3-ffc1655.stderr0000664000175000017500000000023315174404631023700 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/implicit3.f90:3:14 | 3 | implicit real*8 (k) | ^ help: write this as 'real(8)' lfortran-0.63.0/tests/reference/llvm-complex_dp-7286fd2.json0000664000175000017500000000075315174404631023722 0ustar alastairalastair{ "basename": "llvm-complex_dp-7286fd2", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_dp.f90", "infile_hash": "2ab8a19155ace703dc52c1f26d2ecea0db08a49637452b31871a40b2", "outfile": null, "outfile_hash": null, "stdout": "llvm-complex_dp-7286fd2.stdout", "stdout_hash": "1ab472e71cf9d28daea819611df3753b0deb2370dd82ec599b70d2c4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics8-6c1e53e.stderr0000664000175000017500000000024415174404631024256 0ustar alastairalastairsemantic error: Kind of all the arguments of Ior must be the same --> tests/errors/intrinsics8.f90:4:14 | 4 | print *, ior(x, y) | ^^^^^^^^^ lfortran-0.63.0/tests/reference/asr-intrinsics12-16f1580.json0000664000175000017500000000074015174404631023637 0ustar alastairalastair{ "basename": "asr-intrinsics12-16f1580", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics12.f90", "infile_hash": "c9cc798e66e3f673e1047fb55c47dc10fbff936e0d1d1c8dcc62b11b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics12-16f1580.stderr", "stderr_hash": "29df00272486b11796ce5fbf13088c12dc5c67225fa566bef976fe0e", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-assign1-9565114.stdout0000664000175000017500000000031115174404631023145 0ustar alastairalastair(TranslationUnit [(Program assign1 () [] [] [] [(Assign 10 30 next () )] [] )] ) lfortran-0.63.0/tests/reference/ast-implied_do_loops10-3298b64.json0000664000175000017500000000100015174404631024770 0ustar alastairalastair{ "basename": "ast-implied_do_loops10-3298b64", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/implied_do_loops10.f90", "infile_hash": "2efdc481b725ae1203d010683681aa7cefaa4284865b8a440a16e133", "outfile": null, "outfile_hash": null, "stdout": "ast-implied_do_loops10-3298b64.stdout", "stdout_hash": "d1bb53768035ce11f5784b1434b9702cddb727ab5b4aaed8d5079899", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-complex1-322879a.json0000664000175000017500000000071515174404631023046 0ustar alastairalastair{ "basename": "asr-complex1-322879a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/complex1.f90", "infile_hash": "3243c29c947c9700891971aae8780afac25cd01387e0307063f3928a", "outfile": null, "outfile_hash": null, "stdout": "asr-complex1-322879a.stdout", "stdout_hash": "49bb01b6866952e848d1f1f662867032b9c03d4cf1af214e70750322", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_08-9988b1f.json0000664000175000017500000000076115174404631024106 0ustar alastairalastair{ "basename": "asr-intrinsics_08-9988b1f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_08.f90", "infile_hash": "c9428b7dfa89eea7b77764819c3adcba62cbdf38d804597568fd0fad", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_08-9988b1f.stdout", "stdout_hash": "5fc69399c4767c31c2587f2700e2ae201fc2a6eb693f237c0ccdb0b1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-expr9-ba35d31.json0000664000175000017500000000070415174404631022510 0ustar alastairalastair{ "basename": "ast-expr9-ba35d31", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/expr9.f90", "infile_hash": "72b98645e78d4c2860107f173940315443535270bca4d18d631ea006", "outfile": null, "outfile_hash": null, "stdout": "ast-expr9-ba35d31.stdout", "stdout_hash": "de77a271840bafcf1dcaebd0e0acacd145eeeb81c50c4b35efc52423", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-save3-025da43.json0000664000175000017500000000070415174404631022400 0ustar alastairalastair{ "basename": "asr-save3-025da43", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/save3.f90", "infile_hash": "73a25f7c7513eff87c70b3f4e4d291178ff58078c3f57c81f356d77f", "outfile": null, "outfile_hash": null, "stdout": "asr-save3-025da43.stdout", "stdout_hash": "82a16b0300ea35e7ee7fa23e261f35b0406b484c8b90f676e931f48e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-derived_types_02-f576514.json0000664000175000017500000000077215174404631024474 0ustar alastairalastair{ "basename": "ast-derived_types_02-f576514", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_02.f90", "infile_hash": "b1a54c8c7e9086351046470f0afa0c69c807f7816178672b004af9fe", "outfile": null, "outfile_hash": null, "stdout": "ast-derived_types_02-f576514.stdout", "stdout_hash": "0a61a2e6d695eb12d0bc1b6bf58121d8afaf7a122248165fb446d864", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-global_scope3-00a245c.stdout0000664000175000017500000000075015174404631024626 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." @x = global i32 0 define void @__lfortran_evaluate_1() { .entry: store i32 6, i32* @x, align 4 %0 = load i32, i32* @x, align 4 %1 = add i32 %0, 1 store i32 %1, i32* @x, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return ret void } lfortran-0.63.0/tests/reference/asr_preprocess-cpp_err5-38d12de.stderr0000664000175000017500000000016015174404631025761 0ustar alastairalastairC preprocessor error: Unknown token '@' --> tests/errors/cpp_err5.f90:2:9 | 2 | #if 1 + @ 1 2 | ^ lfortran-0.63.0/tests/reference/pass_loop_unroll-loop_unroll_small-462d647.stdout0000664000175000017500000003372515174404631030240 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { loop_unroll_small: (Program (SymbolTable 2 { array: (Variable 2 array [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), first: (Variable 2 first [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), last: (Variable 2 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), print_subrout: (Function (SymbolTable 3 { x: (Variable 3 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) print_subrout (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [(Print (StringFormat () [(Var 3 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) loop_unroll_small [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. )] [] ) (Assignment (Var 2 first) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 last) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (Var 2 first) (Var 2 last) ()) [(Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (IntegerBinOp (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) ()) [(Assignment (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) () .false. .false. ) (SubroutineCall 2 print_subrout () [((Var 2 x))] () .false. )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) ()) [(Assignment (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) () .false. .false. ) (If () (IntegerCompare (Var 2 x) NotEq (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 2 i) (Integer 4) () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-implicit8-5e681cf.json0000664000175000017500000000074215174404631023362 0ustar alastairalastair{ "basename": "asr-implicit8-5e681cf", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit8.f90", "infile_hash": "5ab8320f5bd93962cbba1babe7f4f17779af2d5575f625095988f4d8", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit8-5e681cf.stdout", "stdout_hash": "cfa17985bdd8ca12780505c469843129075bde025a7c56dc72b1f251", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_inline_function_calls-functions_07-bb03cfd.stdout0000664000175000017500000012051315174404631031272 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_07: (Program (SymbolTable 8 { f_a: (ExternalSymbol 8 f_a 2 f_a functions_07_a [] f_a Public ), f_b: (ExternalSymbol 8 f_b 4 f_b functions_07_b [] f_b Public ), f_c: (ExternalSymbol 8 f_c 6 f_c functions_07_c [] f_c Public ), p: (Variable 8 p [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), q: (Variable 8 q [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u: (Variable 8 u [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 8 v [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), w: (Variable 8 w [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 8 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 8 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 8 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) functions_07 [functions_07_c functions_07_a functions_07_b] [(Assignment (Var 8 w) (Var 8 p) () .false. .false. ) (Assignment (Var 8 x) (Var 8 w) () .false. .false. ) (Assignment (Var 8 u) (Var 8 x) () .false. .false. ) (Assignment (Var 8 v) (RealBinOp (Var 8 u) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (Var 8 y) (RealBinOp (Var 8 v) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (Var 8 z) (RealBinOp (Var 8 y) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (Var 8 q) (Var 8 z) () .false. .false. ) (Print (StringFormat () [(Var 8 q)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), functions_07_a: (Module (SymbolTable 2 { f_a: (Function (SymbolTable 3 { u: (Variable 3 u [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 3 v [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_a (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 u)] [(Assignment (Var 3 v) (RealBinOp (Var 3 u) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. )] (Var 3 v) Public .true. .true. () ) }) functions_07_a () [] .false. .false. .false. ), functions_07_b: (Module (SymbolTable 4 { f_a: (ExternalSymbol 4 f_a 2 f_a functions_07_a [] f_a Public ), f_b: (Function (SymbolTable 5 { u: (Variable 5 u [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 5 v [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 5 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 5 y [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_b (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x)] [(Assignment (Var 5 u) (Var 5 x) () .false. .false. ) (Assignment (Var 5 v) (RealBinOp (Var 5 u) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (Var 5 y) (RealBinOp (Var 5 v) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. )] (Var 5 y) Public .true. .true. () ) }) functions_07_b () [functions_07_a] .false. .false. .false. ), functions_07_c: (Module (SymbolTable 6 { f_a: (ExternalSymbol 6 f_a 2 f_a functions_07_a [] f_a Public ), f_b: (ExternalSymbol 6 f_b 4 f_b functions_07_b [] f_b Public ), f_c: (Function (SymbolTable 7 { u: (Variable 7 u [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 7 v [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), w: (Variable 7 w [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 7 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 7 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 7 z [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_c (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 w)] [(Assignment (Var 7 x) (Var 7 w) () .false. .false. ) (Assignment (Var 7 u) (Var 7 x) () .false. .false. ) (Assignment (Var 7 v) (RealBinOp (Var 7 u) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (Var 7 y) (RealBinOp (Var 7 v) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (Var 7 z) (RealBinOp (Var 7 y) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. )] (Var 7 z) Public .true. .true. () ) }) functions_07_c () [functions_07_b functions_07_a] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr_preprocess-cpp7-cec734d.json0000664000175000017500000000074415174404631024653 0ustar alastairalastair{ "basename": "asr_preprocess-cpp7-cec734d", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp7.f90", "infile_hash": "7fd2c5f2e27e38f3077d73ff101677fca4440938898d80a835bc0579", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp7-cec734d.stderr", "stderr_hash": "161849f4e8dbf12024e5879cee3cb861e2f067404aeabf71e73e188b", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-esub2-248f0df.json0000664000175000017500000000071315174404631022474 0ustar alastairalastair{ "basename": "ast-esub2-248f0df", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/esub2.f90", "infile_hash": "fb45951fe73ff1605633612371af0d19b7036b3aef93d6b084c33823", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-esub2-248f0df.stderr", "stderr_hash": "f34c7ceeeaa22d1c9075e3ff71d51db6bdcd53ddb1f0b3c39e05fc33", "returncode": 2 }lfortran-0.63.0/tests/reference/run-array16-b6f006f.stdout0000664000175000017500000000003015174404631023313 0ustar alastairalastair1 2 3 4 5 6 lfortran-0.63.0/tests/reference/asr-external_01-6754623.json0000664000175000017500000000077515174404631023367 0ustar alastairalastair{ "basename": "asr-external_01-6754623", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/external_01.f90", "infile_hash": "7beda56b1f983d450c845bf105e7b376c256981eea408894943b944d", "outfile": null, "outfile_hash": null, "stdout": "asr-external_01-6754623.stdout", "stdout_hash": "886d9b947c4ef5735bc07536a45ea53a6fe8b579a247dd85cee4d16b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-arrays_op_6-030b24e.json0000664000175000017500000000075315174404631023604 0ustar alastairalastair{ "basename": "asr-arrays_op_6-030b24e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_op_6.f90", "infile_hash": "068f85d014835f57027a1a8236c81c33d219cd281540afb6aef3720d", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_op_6-030b24e.stdout", "stdout_hash": "efd712b5abe603bbe0a090df39d160f4fef56a35cd494992b9380f7c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-intrinsics_06-15c0eef.json0000664000175000017500000000076415174404631024412 0ustar alastairalastair{ "basename": "llvm-intrinsics_06-15c0eef", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_06.f90", "infile_hash": "c551ff5e24ea7b1b86a697b75ab52b3a9fb897ec0ff8d13f6a8afba5", "outfile": null, "outfile_hash": null, "stdout": "llvm-intrinsics_06-15c0eef.stdout", "stdout_hash": "d1c3b589d6d49309e5505b13ad3b910ec49e34c12aa4dac6f7cb62cd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit4-704272e.stdout0000664000175000017500000003532415174404631023564 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { idd_random_transf: (Function (SymbolTable 2 { ialbetas: (Variable 2 ialbetas [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), idd_random_transf: (Variable 2 idd_random_transf [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iixs: (Variable 2 iixs [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), iww: (Variable 2 iww [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), nsteps: (Variable 2 nsteps [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), w: (Variable 2 w [] Unspecified () () Default (Array (Real 8) [(() ())] UnboundedPointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Unspecified () () Default (Array (Real 8) [(() ())] UnboundedPointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Unspecified () () Default (Array (Real 8) [(() ())] UnboundedPointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) idd_random_transf (FunctionType [(Array (Real 8) [(() ())] UnboundedPointerArray ) (Array (Real 8) [(() ())] UnboundedPointerArray ) (Array (Real 8) [(() ())] UnboundedPointerArray )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 x) (Var 2 y) (Var 2 w)] [(Assignment (Var 2 ialbetas) (Cast (ArrayItem (Var 2 w) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) RealToInteger (Integer 4) () () ) () .false. .false. ) (Assignment (Var 2 iixs) (Cast (ArrayItem (Var 2 w) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) RealToInteger (Integer 4) () () ) () .false. .false. ) (Assignment (Var 2 nsteps) (Cast (ArrayItem (Var 2 w) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) RealToInteger (Integer 4) () () ) () .false. .false. ) (Assignment (Var 2 iww) (Cast (ArrayItem (Var 2 w) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) RealToInteger (Integer 4) () () ) () .false. .false. ) (Assignment (Var 2 n) (Cast (ArrayItem (Var 2 w) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) RealToInteger (Integer 4) () () ) () .false. .false. )] (Var 2 idd_random_transf) Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-character_02-56bfff3.stderr0000664000175000017500000000056415174404631024331 0ustar alastairalastairwarning: The LHS character len=1 and the RHS character len=2 are not equal. --> tests/warnings/character_02.f90:2:5 | 2 | character(len=1, kind=1), parameter :: toml_base(4) = ["11", "21", "31", "$1"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the RHS character len to match the LHS character len lfortran-0.63.0/tests/reference/ast-doloop_04-4703a43.json0000664000175000017500000000074515174404631023110 0ustar alastairalastair{ "basename": "ast-doloop_04-4703a43", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_04.f90", "infile_hash": "d2027c560ba8546e31b7627200b8fb28695617c3238a8f1a086c62ef", "outfile": null, "outfile_hash": null, "stdout": "ast-doloop_04-4703a43.stdout", "stdout_hash": "d5cb209b69b54069ad695a22a3e1a200308d35141f54cc161520610a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-types_05-aa71aa9.stdout0000664000175000017500000000221315174404631023724 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %r = alloca float, align 4 store float 2.000000e+00, float* %r, align 4 store float 2.000000e+00, float* %r, align 4 store float 8.000000e+00, float* %r, align 4 store float 4.000000e+00, float* %r, align 4 store float 0.000000e+00, float* %r, align 4 store float 5.000000e-01, float* %r, align 4 store float 5.000000e-01, float* %r, align 4 store i32 2, i32* %i, align 4 store i32 2, i32* %i, align 4 store i32 8, i32* %i, align 4 store i32 4, i32* %i, align 4 store i32 0, i32* %i, align 4 store i32 0, i32* %i, align 4 store i32 0, i32* %i, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_types_05 FINALIZE_SYMTABLE_types_05: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr_preprocess-cpp_err3-a7ea818.stderr0000664000175000017500000000020015174404631025756 0ustar alastairalastairC preprocessor error: Argument list is not closed with ')' --> tests/errors/cpp_err3.f90:3:6 | 3 | #if f(2 < 1+2 | ^ lfortran-0.63.0/tests/reference/asr-incorrect_array_type_where_01-b613ee3.json0000664000175000017500000000102315174404631027361 0ustar alastairalastair{ "basename": "asr-incorrect_array_type_where_01-b613ee3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incorrect_array_type_where_01.f90", "infile_hash": "7405582b48138f3053960b0c529eb8efd66eb1f0ba5b64831491897a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incorrect_array_type_where_01-b613ee3.stderr", "stderr_hash": "394bb205e8a76416975321bc38ba522a27b12c5da6cfe2bca046baf9", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-kind_string_of_int-ed0ec70.stderr0000664000175000017500000000032715174404631025730 0ustar alastairalastairsemantic error: Only Integer literals or expressions which reduce to constant Integer are accepted as kind parameters --> tests/errors/kind_string_of_int.f90:3:13 | 3 | integer('a') :: x | ^^^ lfortran-0.63.0/tests/reference/ast_f90-builtin1-21cf43e.json0000664000175000017500000000073015174404631023652 0ustar alastairalastair{ "basename": "ast_f90-builtin1-21cf43e", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/builtin1.f90", "infile_hash": "8c200e5b6fa38354dabbf5be7d12f548fa4e99f58ac9225f50a77c8c", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-builtin1-21cf43e.stdout", "stdout_hash": "7e50fe4824f4e910384c6c74c415f40dfbf6dc1d4fe89d0064499730", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_15b-09f8335.stdout0000664000175000017500000102452615174404631024017 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), modules_15b: (Module (SymbolTable 2 { c_char: (ExternalSymbol 2 c_char 4 c_char lfortran_intrinsic_iso_c_binding [] c_char Public ), c_double: (ExternalSymbol 2 c_double 4 c_double lfortran_intrinsic_iso_c_binding [] c_double Public ), c_double_complex: (ExternalSymbol 2 c_double_complex 4 c_double_complex lfortran_intrinsic_iso_c_binding [] c_double_complex Public ), c_float: (ExternalSymbol 2 c_float 4 c_float lfortran_intrinsic_iso_c_binding [] c_float Public ), c_float_complex: (ExternalSymbol 2 c_float_complex 4 c_float_complex lfortran_intrinsic_iso_c_binding [] c_float_complex Public ), c_int: (ExternalSymbol 2 c_int 4 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_int32_t: (ExternalSymbol 2 c_int32_t 4 c_int32_t lfortran_intrinsic_iso_c_binding [] c_int32_t Public ), c_int64_t: (ExternalSymbol 2 c_int64_t 4 c_int64_t lfortran_intrinsic_iso_c_binding [] c_int64_t Public ), c_long_long: (ExternalSymbol 2 c_long_long 4 c_long_long lfortran_intrinsic_iso_c_binding [] c_long_long Public ), c_null_char: (ExternalSymbol 2 c_null_char 4 c_null_char lfortran_intrinsic_iso_c_binding [] c_null_char Public ), call_fortran_f32: (Function (SymbolTable 51 { i: (Variable 51 i [] In () () Default (Real 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 51 r [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) call_fortran_f32 (FunctionType [(Real 4)] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 51 i)] [] (Var 51 r) Public .false. .false. () ), call_fortran_f32_value: (Function (SymbolTable 52 { i: (Variable 52 i [] In () () Default (Real 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 52 r [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) call_fortran_f32_value (FunctionType [(Real 4)] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 52 i)] [] (Var 52 r) Public .false. .false. () ), call_fortran_f64: (Function (SymbolTable 53 { i: (Variable 53 i [] In () () Default (Real 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 53 r [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) call_fortran_f64 (FunctionType [(Real 8)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 53 i)] [] (Var 53 r) Public .false. .false. () ), call_fortran_f64_value: (Function (SymbolTable 54 { i: (Variable 54 i [] In () () Default (Real 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 54 r [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) call_fortran_f64_value (FunctionType [(Real 8)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 54 i)] [] (Var 54 r) Public .false. .false. () ), call_fortran_i32: (Function (SymbolTable 45 { i: (Variable 45 i [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 45 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) call_fortran_i32 (FunctionType [(Integer 4)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 45 i)] [] (Var 45 r) Public .false. .false. () ), call_fortran_i32_value: (Function (SymbolTable 46 { i: (Variable 46 i [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 46 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) call_fortran_i32_value (FunctionType [(Integer 4)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 46 i)] [] (Var 46 r) Public .false. .false. () ), call_fortran_i32_value2: (Function (SymbolTable 47 { i: (Variable 47 i [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 47 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) call_fortran_i32_value2 (FunctionType [(Integer 4)] (Integer 4) BindC Interface "call_fortran_i32_value" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 47 i)] [] (Var 47 r) Public .false. .false. () ), call_fortran_i64: (Function (SymbolTable 48 { i: (Variable 48 i [] In () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 48 r [] ReturnVar () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) call_fortran_i64 (FunctionType [(Integer 8)] (Integer 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 48 i)] [] (Var 48 r) Public .false. .false. () ), call_fortran_i64_value: (Function (SymbolTable 49 { i: (Variable 49 i [] In () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 49 r [] ReturnVar () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) call_fortran_i64_value (FunctionType [(Integer 8)] (Integer 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 49 i)] [] (Var 49 r) Public .false. .false. () ), call_fortran_i64_value2: (Function (SymbolTable 50 { i: (Variable 50 i [] In () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 50 r [] ReturnVar () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) call_fortran_i64_value2 (FunctionType [(Integer 8)] (Integer 8) BindC Interface "call_fortran_i64_value" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 50 i)] [] (Var 50 r) Public .false. .false. () ), f_double_complex_value_return: (Function (SymbolTable 22 { b: (Variable 22 b [] In () () Default (Complex 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 22 r [] ReturnVar () () Default (Complex 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_double_complex_value_return (FunctionType [(Complex 8)] (Complex 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 22 b)] [] (Var 22 r) Public .false. .false. () ), f_float_complex_value_return: (Function (SymbolTable 21 { b: (Variable 21 b [] In () () Default (Complex 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 21 r [] ReturnVar () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_float_complex_value_return (FunctionType [(Complex 4)] (Complex 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 21 b)] [] (Var 21 r) Public .false. .false. () ), f_int_double: (Function (SymbolTable 14 { a: (Variable 14 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 14 b [] In () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 14 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_int_double (FunctionType [(Integer 4) (Real 8)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 14 a) (Var 14 b)] [] (Var 14 r) Public .false. .false. () ), f_int_double_complex: (Function (SymbolTable 16 { a: (Variable 16 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 16 b [] In () () Default (Complex 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 16 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_int_double_complex (FunctionType [(Integer 4) (Complex 8)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 16 a) (Var 16 b)] [] (Var 16 r) Public .false. .false. () ), f_int_double_complex2: (Function (SymbolTable 18 { a: (Variable 18 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 18 b [] In () () Default (Complex 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 18 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_int_double_complex2 (FunctionType [(Integer 4) (Complex 8)] (Integer 4) BindC Interface "f_int_double_complex" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 18 a) (Var 18 b)] [] (Var 18 r) Public .false. .false. () ), f_int_double_complex_value: (Function (SymbolTable 20 { a: (Variable 20 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 20 b [] In () () Default (Complex 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 20 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_int_double_complex_value (FunctionType [(Integer 4) (Complex 8)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 a) (Var 20 b)] [] (Var 20 r) Public .false. .false. () ), f_int_double_value: (Function (SymbolTable 24 { a: (Variable 24 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 24 b [] In () () Default (Real 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 24 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_int_double_value (FunctionType [(Integer 4) (Real 8)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 24 a) (Var 24 b)] [] (Var 24 r) Public .false. .false. () ), f_int_double_value_name: (Function (SymbolTable 31 { a: (Variable 31 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 31 b [] In () () Default (Real 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 31 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_int_double_value_name (FunctionType [(Integer 4) (Real 8)] (Integer 4) BindC Interface "f_int_double_value" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 31 a) (Var 31 b)] [] (Var 31 r) Public .false. .false. () ), f_int_doublearray: (Function (SymbolTable 27 { b: (Variable 27 b [n] In () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (Var 27 n))] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 27 n [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 27 r [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_int_doublearray (FunctionType [(Integer 4) (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray )] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 27 n) (Var 27 b)] [] (Var 27 r) Public .false. .false. () ), f_int_doublearray_star: (Function (SymbolTable 30 { b: (Variable 30 b [] In () () Default (Array (Real 8) [(() ())] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 30 n [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 30 r [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_int_doublearray_star (FunctionType [(Integer 4) (Array (Real 8) [(() ())] PointerArray )] (Real 8) BindC Interface "f_int_doublearray" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 30 n) (Var 30 b)] [] (Var 30 r) Public .false. .false. () ), f_int_float: (Function (SymbolTable 13 { a: (Variable 13 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 13 b [] In () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 13 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_int_float (FunctionType [(Integer 4) (Real 4)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 a) (Var 13 b)] [] (Var 13 r) Public .false. .false. () ), f_int_float_complex: (Function (SymbolTable 15 { a: (Variable 15 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 15 b [] In () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 15 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_int_float_complex (FunctionType [(Integer 4) (Complex 4)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 15 a) (Var 15 b)] [] (Var 15 r) Public .false. .false. () ), f_int_float_complex2: (Function (SymbolTable 17 { a: (Variable 17 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 17 b [] In () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 17 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_int_float_complex2 (FunctionType [(Integer 4) (Complex 4)] (Integer 4) BindC Interface "f_int_float_complex" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 a) (Var 17 b)] [] (Var 17 r) Public .false. .false. () ), f_int_float_complex_value: (Function (SymbolTable 19 { a: (Variable 19 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 19 b [] In () () Default (Complex 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 19 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_int_float_complex_value (FunctionType [(Integer 4) (Complex 4)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 19 a) (Var 19 b)] [] (Var 19 r) Public .false. .false. () ), f_int_float_value: (Function (SymbolTable 23 { a: (Variable 23 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 23 b [] In () () Default (Real 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 23 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_int_float_value (FunctionType [(Integer 4) (Real 4)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 23 a) (Var 23 b)] [] (Var 23 r) Public .false. .false. () ), f_int_floatarray: (Function (SymbolTable 26 { b: (Variable 26 b [n] In () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 26 n))] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 26 n [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 26 r [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_int_floatarray (FunctionType [(Integer 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray )] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 26 n) (Var 26 b)] [] (Var 26 r) Public .false. .false. () ), f_int_floatarray_star: (Function (SymbolTable 29 { b: (Variable 29 b [] In () () Default (Array (Real 4) [(() ())] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 29 n [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 29 r [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_int_floatarray_star (FunctionType [(Integer 4) (Array (Real 4) [(() ())] PointerArray )] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 29 n) (Var 29 b)] [] (Var 29 r) Public .false. .false. () ), f_int_intarray: (Function (SymbolTable 25 { b: (Variable 25 b [n] In () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 25 n))] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 25 n [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 25 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_int_intarray (FunctionType [(Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray )] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 25 n) (Var 25 b)] [] (Var 25 r) Public .false. .false. () ), f_int_intarray_star: (Function (SymbolTable 28 { b: (Variable 28 b [] In () () Default (Array (Integer 4) [(() ())] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 28 n [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 28 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_int_intarray_star (FunctionType [(Integer 4) (Array (Integer 4) [(() ())] PointerArray )] (Integer 4) BindC Interface "f_int_intarray" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 28 n) (Var 28 b)] [] (Var 28 r) Public .false. .false. () ), f_string: (Function (SymbolTable 55 { r: (Variable 55 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s: (Variable 55 s [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_string (FunctionType [(String 1 () AssumedLength DescriptorString)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f_string0] [(Var 55 s)] [(Assignment (Var 55 r) (FunctionCall 2 f_string0 () [((StringPhysicalCast (IntrinsicElementalFunction StringConcat [(Var 55 s) (Var 2 c_null_char)] 0 (String 1 () DeferredLength DescriptorString) () ) DescriptorString CChar (String 1 () ImplicitLength CChar) () ))] (Integer 4) () () ) () .false. .false. )] (Var 55 r) Public .false. .false. () ), f_string0: (Function (SymbolTable 44 { r: (Variable 44 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), s: (Variable 44 s [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength CChar) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f_string0 (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength CChar)] (Integer 4) BindC Interface "f_string" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 44 s)] [] (Var 44 r) Public .false. .false. () ), fortran_f32: (Function (SymbolTable 60 { i: (Variable 60 i [] In () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 60 r [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fortran_f32 (FunctionType [(Real 4)] (Real 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 60 i)] [(Assignment (Var 60 r) (RealBinOp (Var 60 i) Add (RealConstant 2.300000 (Real 4) ) (Real 4) () ) () .false. .false. )] (Var 60 r) Public .true. .true. () ), fortran_f32_value: (Function (SymbolTable 61 { i: (Variable 61 i [] In () () Default (Real 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 61 r [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fortran_f32_value (FunctionType [(Real 4)] (Real 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 61 i)] [(Assignment (Var 61 r) (RealBinOp (Var 61 i) Add (RealConstant 2.300000 (Real 4) ) (Real 4) () ) () .false. .false. )] (Var 61 r) Public .true. .true. () ), fortran_f64: (Function (SymbolTable 62 { i: (Variable 62 i [] In () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 62 r [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fortran_f64 (FunctionType [(Real 8)] (Real 8) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 62 i)] [(Assignment (Var 62 r) (RealBinOp (Var 62 i) Add (RealConstant 2.300000 (Real 8) ) (Real 8) () ) () .false. .false. )] (Var 62 r) Public .true. .true. () ), fortran_f64_value: (Function (SymbolTable 63 { i: (Variable 63 i [] In () () Default (Real 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 63 r [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fortran_f64_value (FunctionType [(Real 8)] (Real 8) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 63 i)] [(Assignment (Var 63 r) (RealBinOp (Var 63 i) Add (RealConstant 2.300000 (Real 8) ) (Real 8) () ) () .false. .false. )] (Var 63 r) Public .true. .true. () ), fortran_i32: (Function (SymbolTable 56 { i: (Variable 56 i [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 56 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fortran_i32 (FunctionType [(Integer 4)] (Integer 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 56 i)] [(Assignment (Var 56 r) (IntegerBinOp (Var 56 i) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] (Var 56 r) Public .true. .true. () ), fortran_i32_value: (Function (SymbolTable 57 { i: (Variable 57 i [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 57 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fortran_i32_value (FunctionType [(Integer 4)] (Integer 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 57 i)] [(Assignment (Var 57 r) (IntegerBinOp (Var 57 i) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] (Var 57 r) Public .true. .true. () ), fortran_i64: (Function (SymbolTable 58 { i: (Variable 58 i [] In () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 58 r [] ReturnVar () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fortran_i64 (FunctionType [(Integer 8)] (Integer 8) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 58 i)] [(Assignment (Var 58 r) (IntegerBinOp (Var 58 i) Add (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 2 (Integer 8) Decimal) () ) (Integer 8) () ) () .false. .false. )] (Var 58 r) Public .true. .true. () ), fortran_i64_value: (Function (SymbolTable 59 { i: (Variable 59 i [] In () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 59 r [] ReturnVar () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fortran_i64_value (FunctionType [(Integer 8)] (Integer 8) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 59 i)] [(Assignment (Var 59 r) (IntegerBinOp (Var 59 i) Add (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 2 (Integer 8) Decimal) () ) (Integer 8) () ) () .false. .false. )] (Var 59 r) Public .true. .true. () ), sub_int_double: (Function (SymbolTable 33 { a: (Variable 33 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 33 b [] In () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 33 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub_int_double (FunctionType [(Integer 4) (Real 8) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 33 a) (Var 33 b) (Var 33 r)] [] () Public .false. .false. () ), sub_int_double_complex: (Function (SymbolTable 35 { a: (Variable 35 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 35 b [] In () () Default (Complex 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 35 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub_int_double_complex (FunctionType [(Integer 4) (Complex 8) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 35 a) (Var 35 b) (Var 35 r)] [] () Public .false. .false. () ), sub_int_double_complex_value: (Function (SymbolTable 39 { a: (Variable 39 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 39 b [] In () () Default (Complex 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 39 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub_int_double_complex_value (FunctionType [(Integer 4) (Complex 8) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 39 a) (Var 39 b) (Var 39 r)] [] () Public .false. .false. () ), sub_int_double_value: (Function (SymbolTable 37 { a: (Variable 37 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 37 b [] In () () Default (Real 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 37 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub_int_double_value (FunctionType [(Integer 4) (Real 8) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 37 a) (Var 37 b) (Var 37 r)] [] () Public .false. .false. () ), sub_int_double_value_name: (Function (SymbolTable 43 { a: (Variable 43 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 43 b [] In () () Default (Real 8) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 43 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub_int_double_value_name (FunctionType [(Integer 4) (Real 8) (Integer 4)] () BindC Interface "sub_int_double_value" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 43 a) (Var 43 b) (Var 43 r)] [] () Public .false. .false. () ), sub_int_doublearray: (Function (SymbolTable 42 { b: (Variable 42 b [n] In () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (Var 42 n))] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 42 n [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 42 r [] Out () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub_int_doublearray (FunctionType [(Integer 4) (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray ) (Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 42 n) (Var 42 b) (Var 42 r)] [] () Public .false. .false. () ), sub_int_float: (Function (SymbolTable 32 { a: (Variable 32 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 32 b [] In () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 32 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub_int_float (FunctionType [(Integer 4) (Real 4) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 32 a) (Var 32 b) (Var 32 r)] [] () Public .false. .false. () ), sub_int_float_complex: (Function (SymbolTable 34 { a: (Variable 34 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 34 b [] In () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 34 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub_int_float_complex (FunctionType [(Integer 4) (Complex 4) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 34 a) (Var 34 b) (Var 34 r)] [] () Public .false. .false. () ), sub_int_float_complex_value: (Function (SymbolTable 38 { a: (Variable 38 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 38 b [] In () () Default (Complex 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 38 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub_int_float_complex_value (FunctionType [(Integer 4) (Complex 4) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 38 a) (Var 38 b) (Var 38 r)] [] () Public .false. .false. () ), sub_int_float_value: (Function (SymbolTable 36 { a: (Variable 36 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 36 b [] In () () Default (Real 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 36 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub_int_float_value (FunctionType [(Integer 4) (Real 4) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 36 a) (Var 36 b) (Var 36 r)] [] () Public .false. .false. () ), sub_int_floatarray: (Function (SymbolTable 41 { b: (Variable 41 b [n] In () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 41 n))] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 41 n [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 41 r [] Out () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub_int_floatarray (FunctionType [(Integer 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray ) (Real 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 41 n) (Var 41 b) (Var 41 r)] [] () Public .false. .false. () ), sub_int_intarray: (Function (SymbolTable 40 { b: (Variable 40 b [n] In () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 40 n))] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 40 n [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. NotMethod () 0 ), r: (Variable 40 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sub_int_intarray (FunctionType [(Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray ) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 40 n) (Var 40 b) (Var 40 r)] [] () Public .false. .false. () ) }) modules_15b () [iso_c_binding modules_15b] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-derived_types_06-5ae916e.stdout0000664000175000017500000001262315174404631025203 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { abstract_type: (Module (SymbolTable 2 { subrout: (Function (SymbolTable 3 { a: (Variable 3 a [] Out () () Default (StructType [] [] .false. .true. ) 3 ~unlimited_polymorphic_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~unlimited_polymorphic_type: (Struct (SymbolTable 4 { }) ~unlimited_polymorphic_type (StructType [] [] .false. .true. ) [] [] [] Source Public .false. .true. [] () () [] ) }) subrout (FunctionType [(StructType [] [] .false. .true. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [] () Public .true. .true. () ) }) abstract_type () [] .false. .false. .false. ), derived_types_01: (Program (SymbolTable 5 { }) derived_types_01 [] [] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-expr2-6f9abe8.stdout0000664000175000017500000000077215174404631023344 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define i32 @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i32, align 4 store i32 8, i32* %__lfortran_evaluate_11, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return %0 = load i32, i32* %__lfortran_evaluate_11, align 4 ret i32 %0 } lfortran-0.63.0/tests/reference/ast-else1-9f4f4b8.json0000664000175000017500000000073215174404631022477 0ustar alastairalastair{ "basename": "ast-else1-9f4f4b8", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/else1.f", "infile_hash": "90793a3b11cf9eb1bd0bc949e1ed82c1559710f30707cc69106dfdcd", "outfile": null, "outfile_hash": null, "stdout": "ast-else1-9f4f4b8.stdout", "stdout_hash": "dfeacfd9de99bafb5a727d2372b6bd7b955f6f0c87aa6cedc06bc9a1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit9-b56b139.json0000664000175000017500000000106215174404631023271 0ustar alastairalastair{ "basename": "asr-implicit9-b56b139", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit9.f90", "infile_hash": "8821b0b62f5857553eb0efe35ab8190a8b1c4fe82e623f1dae4e81b3", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit9-b56b139.stdout", "stdout_hash": "32504333e9ca41cf5b269b9ac9290e6bb85c10259ebe53dfe196eba2", "stderr": "asr-implicit9-b56b139.stderr", "stderr_hash": "281a1f80ba2484620f2c440e2b98f3729b3fd0312b6c19ccab1a146d", "returncode": 0 }lfortran-0.63.0/tests/reference/ast-no_prescan_include2-121e523.json0000664000175000017500000000075615174404631025224 0ustar alastairalastair{ "basename": "ast-no_prescan_include2-121e523", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/no_prescan_include2.f90", "infile_hash": "68cbbaed9ac272ba7009bc7e89270e6e2a12fd0c540413dc2a0a96eb", "outfile": null, "outfile_hash": null, "stdout": "ast-no_prescan_include2-121e523.stdout", "stdout_hash": "8de0f82041c19a65b764da84f38b8db45f0ba6114d34de25ef791999", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-do1-0a89222.stdout0000664000175000017500000000675315174404631022354 0ustar alastairalastair(TranslationUnit [(DoLoop 0 () 0 i 1 5 () [(Assignment 0 a (+ a i) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DoLoop 0 () 0 i 1 5 () [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DoLoop 0 () 0 i 1 5 2 [(Assignment 0 a (+ a i) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DoLoop 0 () 0 () () () () [(Assignment 0 a (+ a i) () ) (Assignment 0 b 3 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Subroutine g [] [] () () [] [] [] [] [(DoLoop 0 () 0 () () () () [(Assignment 0 a (+ a i) () ) (Assignment 0 b 3 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DoLoop 0 () 0 i 1 5 () [(Assignment 0 a (+ a i) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 n 0 () ) (DoLoop 0 () 50 i 1 10 () [(Assignment 0 j i () ) (DoLoop 0 () 0 k 1 5 () [(Assignment 0 l k () ) (Assignment 0 n (+ n 1) (TriviaNode [] [(EOLComment "! this statement executes 50 times" )] ) )] () (TriviaNode [] [(EOLComment "! nonlabeled do inside a labeled do" )] ) ) (Continue 50 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-external5-1198a6f.json0000664000175000017500000000076715174404631023314 0ustar alastairalastair{ "basename": "asr-external5-1198a6f", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/external5.f90", "infile_hash": "9cfe44ca13ef4bb7741e5f47c62a07845fd079f51b1d82747fc20517", "outfile": null, "outfile_hash": null, "stdout": "asr-external5-1198a6f.stdout", "stdout_hash": "a6f6a87973e030bfe5327e9fe6bce2729f8680f4ed4290e93bd9b696", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format_66-591179b.stdout0000664000175000017500000000171415174404631023513 0ustar alastairalastairline1 line2 line3 4 5 end lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor19-6d76e11.json0000664000175000017500000000077315174404631026545 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor19-6d76e11", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor19.f90", "infile_hash": "8a52da8afe0f8e0b7710633bf53282015e2a18b69ad344b5e4580c85", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor19-6d76e11.stdout", "stdout_hash": "0909335582cab5c159562f1a3340abc7d35b8b00f1ad3f8c20cf1fc2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-interface_12-2e5ecb8.stdout0000664000175000017500000000222515174404631024532 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define void @find_fit(void ([1 x float]*)* %expr) { .entry: br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_find_fit FINALIZE_SYMTABLE_find_fit: ; preds = %return ret void } declare void @expr([1 x float]*) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @find_fit(void ([1 x float]*)* @expression) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } define void @expression([1 x float]* %y) { .entry: br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_expression FINALIZE_SYMTABLE_expression: ; preds = %return ret void } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/run-write5-2f63ce9.json0000664000175000017500000000065715174404631022723 0ustar alastairalastair{ "basename": "run-write5-2f63ce9", "cmd": "lfortran --no-color {infile}", "infile": "tests/write5.f90", "infile_hash": "5d5d604b32e128f6ff9c94fd138118f49b7df62bfb1350c28972bdf2", "outfile": null, "outfile_hash": null, "stdout": "run-write5-2f63ce9.stdout", "stdout_hash": "5ebd3d098b47a0bfc6f16d35137fb505011d81cee46fa561ffc8f668", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format_32-b407b58.stdout0000664000175000017500000000036515174404631023557 0ustar alastairalastair0.33333E-99 ********* .33333E-99 0.33333E-99 0.33333E-99 0.33333E-99 0.30000E+201 ********* .30000+201 0.30000+201 0.30000+201 0.30000+201 0.33333E-200 ********* .33333-200 0.33333-200 0.33333-200 0.33333-200 ****** 3.00E+20 ********* lfortran-0.63.0/tests/reference/asr-compare_01-c98905f.json0000664000175000017500000000073215174404631023333 0ustar alastairalastair{ "basename": "asr-compare_01-c98905f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/compare_01.f90", "infile_hash": "21afd80a6b0d843b42712983504099e18283c93b9a98101e0613e6c9", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-compare_01-c98905f.stderr", "stderr_hash": "5015812ef55e87ef0ec0a5deec02333e66183f99b81ff453e5301e8e", "returncode": 2 }lfortran-0.63.0/tests/reference/run-allocate_02-9086fdf.stderr0000664000175000017500000000042415174404631024120 0ustar alastairalastairruntime error: allocate with source= requires an allocated/associated polymorphic source expression --> tests/errors/allocate_02.f90:7:4 | 7 | allocate(obj, source = get_return()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source expression is not allocated/associated lfortran-0.63.0/tests/reference/asr-doloop_02-cc78975.stdout0000664000175000017500000003063715174404631023564 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { doloop_02: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) doloop_02 [] [(Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 b) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (Var 2 a) (Var 2 b) ()) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 55 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 a) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (Var 2 a) (IntegerBinOp (IntegerBinOp (Var 2 a) Add (IntegerBinOp (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Mul (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) Add (Var 2 j) (Integer 4) () ) () .false. .false. )] [] )] [] ) (If () (IntegerCompare (Var 2 a) NotEq (IntegerBinOp (IntegerBinOp (IntegerConstant 100 (Integer 4) Decimal) Mul (IntegerConstant 101 (Integer 4) Decimal) (Integer 4) (IntegerConstant 10100 (Integer 4) Decimal) ) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5050 (Integer 4) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 a) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 i) ()) [(Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (Var 2 j) (Integer 4) () ) () .false. .false. )] [] )] [] ) (If () (IntegerCompare (Var 2 a) NotEq (IntegerConstant 220 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-complex_09-aca4085.json0000664000175000017500000000075015174404631023422 0ustar alastairalastair{ "basename": "asr-complex_09-aca4085", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_09.f90", "infile_hash": "d80903c4f2178fa8e1c18c4994aed776370f1ff7aead158c9b77c627", "outfile": null, "outfile_hash": null, "stdout": "asr-complex_09-aca4085.stdout", "stdout_hash": "a0dffa4f2fd03b9b24d66e83316461fdec04edd3a633e755c1f7d31d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-select_type_13-f465d8c.json0000664000175000017500000000076715174404631024501 0ustar alastairalastair{ "basename": "llvm-select_type_13-f465d8c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/select_type_13.f90", "infile_hash": "8413deaa6aa9c492fa66fded9921b523764270cbc670d08a3a3c6ab0", "outfile": null, "outfile_hash": null, "stdout": "llvm-select_type_13-f465d8c.stdout", "stdout_hash": "3ca98bf8eababe6169e2a92feddd9e686a313ecd54533a4d038a2725", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/pass_pass_array_by_data-modules_44-cd82150.json0000664000175000017500000000105215174404631027427 0ustar alastairalastair{ "basename": "pass_pass_array_by_data-modules_44-cd82150", "cmd": "lfortran --pass=pass_array_by_data --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_44.f90", "infile_hash": "64a0fe18f63bcdea0da398339103b09acfb84dd85285ec15239ea14e", "outfile": null, "outfile_hash": null, "stdout": "pass_pass_array_by_data-modules_44-cd82150.stdout", "stdout_hash": "138000d36f62dbafb194c64ce561f1bb5b7ecbaf531bf74d06d56cd7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-modules_34-f98f7e3.json0000664000175000017500000000075015174404631023447 0ustar alastairalastair{ "basename": "asr-modules_34-f98f7e3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_34.f90", "infile_hash": "345b669b534e06097d4a1202a471d3b9344402dc41e008388e6af962", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_34-f98f7e3.stdout", "stdout_hash": "217a373bb7dfce65ce87dea62e5b76d3877c020dc05ee322b6c0b402", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_array_04b-94baaad.json0000664000175000017500000000100015174404631025246 0ustar alastairalastair{ "basename": "asr-template_array_04b-94baaad", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_array_04b.f90", "infile_hash": "9a6f4f46fcdcc358803d1376ed48985a450b5c724178f467db07ca61", "outfile": null, "outfile_hash": null, "stdout": "asr-template_array_04b-94baaad.stdout", "stdout_hash": "0cdf24b8cfaae4c049f23cc0df2b39b10fd2f1ccb420c23d712c8230", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-sign_01-62b270e.stderr0000664000175000017500000000024715174404631023160 0ustar alastairalastairsemantic error: Kind of all the arguments of Sign must be the same --> tests/errors/sign_01.f90:2:14 | 2 | print *, sign(1, 1_8) | ^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/llvm-callback_04-0d9515f.json0000664000175000017500000000075615174404631023625 0ustar alastairalastair{ "basename": "llvm-callback_04-0d9515f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/callback_04.f90", "infile_hash": "cd24a6ca8ba324bbafcdf3751e8bbb545e3e5c9ce22ebba1bc12ba8c", "outfile": null, "outfile_hash": null, "stdout": "llvm-callback_04-0d9515f.stdout", "stdout_hash": "0b214109a977c8a38d7875c8f1051da6ce31a4c00642c9689baad53e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-fixed_form_3-53e9045.json0000664000175000017500000000075315174404631023665 0ustar alastairalastair{ "basename": "ast-fixed_form_3-53e9045", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/fixed_form_3.f", "infile_hash": "a2a456bea34619c96c4b8edc022e348d99c1b2828cb9f9cc7a4acf88", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-fixed_form_3-53e9045.stderr", "stderr_hash": "49c5a9403c7acd642202b780df57f156dd41009fb11f215c9c420956", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-array_shape_01-214f2d0.json0000664000175000017500000000074615174404631024163 0ustar alastairalastair{ "basename": "asr-array_shape_01-214f2d0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_shape_01.f90", "infile_hash": "68579b9a69c1f9b5af10e8204e34764a198346d7df567ee66be973e1", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_shape_01-214f2d0.stderr", "stderr_hash": "e96c10b4c84a60814ab9c5119eff89419b8b8f950ee95c6054ddade5", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-sqrt_neg-5a20839.json0000664000175000017500000000072415174404631023134 0ustar alastairalastair{ "basename": "asr-sqrt_neg-5a20839", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/sqrt_neg.f90", "infile_hash": "15a7d352afe51615cd4dccb6177025a159d4a580e4e236cff0ecc4c2", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-sqrt_neg-5a20839.stderr", "stderr_hash": "552d5a7fa70662e63c97de072539e61f808566312514dbc299b6782a", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-associate_01-4a4ac5c.json0000664000175000017500000000110115174404631023766 0ustar alastairalastair{ "basename": "ast-associate_01-4a4ac5c", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/associate_01.f90", "infile_hash": "dfa888bac25c6dcaf279aff9ac639b37179290e3a36f9e784b31fb83", "outfile": null, "outfile_hash": null, "stdout": "ast-associate_01-4a4ac5c.stdout", "stdout_hash": "fd2342eeb6a8ff17df60131b3255242cb31dd647cc095b7250766cd2", "stderr": "ast-associate_01-4a4ac5c.stderr", "stderr_hash": "1f6e46d80cfcc70f0d91ed20562c4d7c39b2990b877e7de481e73a19", "returncode": 0 }lfortran-0.63.0/tests/reference/ast-error_stop2-7d55ddf.json0000664000175000017500000000075415174404631024026 0ustar alastairalastair{ "basename": "ast-error_stop2-7d55ddf", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/error_stop2.f", "infile_hash": "303b7586e16288aa99ec433c82ec87d416ceb9a14ddaf588ad3255ce", "outfile": null, "outfile_hash": null, "stdout": "ast-error_stop2-7d55ddf.stdout", "stdout_hash": "80e66a2396b76c3836f2198f5dd8562683b9024573f39fbc21a7f792", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-logical1-fd6d5c4.stdout0000664000175000017500000000644515174404631023610 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { logical1: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) logical1 [] [(Assignment (Var 2 a) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (Assignment (Var 2 b) (LogicalConstant .false. (Logical 4) ) () .false. .false. ) (Print (StringFormat () [(Var 2 a) (Var 2 b)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-kwargs_02-1588831.stdout0000664000175000017500000004366215174404631023420 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { kwargs_02: (Program (SymbolTable 6 { }) kwargs_02 [] [] ), kwargs_02_stdlib_logger: (Module (SymbolTable 2 { add_log_file: (Function (SymbolTable 4 { 1_logger_type_log_io_error: (ExternalSymbol 4 1_logger_type_log_io_error 3 log_io_error logger_type [] log_io_error Public ), filename: (Variable 4 filename [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 4 self [] InOut () () Default (StructType [] [] .false. .false. ) 2 logger_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), unit: (Variable 4 unit [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_log_file (FunctionType [(StructType [] [] .false. .false. ) (String 1 () AssumedLength DescriptorString) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 self) (Var 4 filename) (Var 4 unit)] [(SubroutineCall 4 1_logger_type_log_io_error () [((Var 4 self)) ((IntegerConstant 1 (Integer 4) Decimal)) ((Var 4 filename)) ((Var 4 unit))] (Var 4 self) .false. )] () Public .true. .true. () ), log_io_error: (Function (SymbolTable 5 { code: (Variable 5 code [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), filename: (Variable 5 filename [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), self: (Variable 5 self [] InOut () () Default (StructType [] [] .false. .false. ) 2 logger_type Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), unit: (Variable 5 unit [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ) }) log_io_error (FunctionType [(StructType [] [] .false. .false. ) (Integer 4) (String 1 () AssumedLength DescriptorString) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 self) (Var 5 code) (Var 5 filename) (Var 5 unit)] [] () Public .true. .true. () ), logger_type: (Struct (SymbolTable 3 { add_log_file: (StructMethodDeclaration 3 add_log_file self add_log_file 2 add_log_file Source .false. .false. ), log_io_error: (StructMethodDeclaration 3 log_io_error self log_io_error 2 log_io_error Source .false. .false. ) }) logger_type (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () () [] ) }) kwargs_02_stdlib_logger () [kwargs_02_stdlib_logger] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/run-format_30-3cec484.json0000664000175000017500000000071515174404631023265 0ustar alastairalastair{ "basename": "run-format_30-3cec484", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_30.f90", "infile_hash": "da7f05c58b0298c33f23e4d533088a0c03d4c7d6228754b678078450", "outfile": null, "outfile_hash": null, "stdout": "run-format_30-3cec484.stdout", "stdout_hash": "f148ab3f980b87719c163a3ae0219b853fecd396e4c848cf25ed13e6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-bindc1-6cc9005.stdout0000664000175000017500000000714215174404631023102 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bindc1: (Program (SymbolTable 2 { c_loc: (ExternalSymbol 2 c_loc 4 c_loc lfortran_intrinsic_iso_c_binding [] c_loc Public ), c_ptr: (ExternalSymbol 2 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), p: (Variable 2 p [] Local () () Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) bindc1 [iso_c_binding] [(Assignment (Var 2 p) (PointerToCPtr (Var 2 x) (CPtr) () ) () .false. .false. )] ), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding) }) [] ) lfortran-0.63.0/tests/reference/llvm-associate_02-558b0e6.json0000664000175000017500000000076115174404631024037 0ustar alastairalastair{ "basename": "llvm-associate_02-558b0e6", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/associate_02.f90", "infile_hash": "d3505eea2e17cbf463e707ee2faf24aedf12a13ebb06fee4a5a1adfb", "outfile": null, "outfile_hash": null, "stdout": "llvm-associate_02-558b0e6.stdout", "stdout_hash": "d30aa37d429a25d27a0a4772161e32cd7d77f86dc4c1cc5f7c3d74ce", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-no_prescan_include1-6ceca31.json0000664000175000017500000000075615174404631025446 0ustar alastairalastair{ "basename": "ast-no_prescan_include1-6ceca31", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/no_prescan_include1.f90", "infile_hash": "075cc762767052e5ea227f825822032faad3fcaafa60bfbeb742a537", "outfile": null, "outfile_hash": null, "stdout": "ast-no_prescan_include1-6ceca31.stdout", "stdout_hash": "d0341527edca7d037cb312e17f728806edde600e04ff6910c5e792a2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit4-704272e.stderr0000664000175000017500000000024315174404631023535 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/implicit4.f90:2:15 | 2 | implicit real *8 (a-h,o-z) | ^ help: write this as 'real(8)' lfortran-0.63.0/tests/reference/julia-subroutine4-22dcb28.json0000664000175000017500000000071715174404631024251 0ustar alastairalastair{ "basename": "julia-subroutine4-22dcb28", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/subroutine4.f90", "infile_hash": "06ca8a1c322b25fe9280c43f558f6fa92e1a4843b6f6b77e206fdf4e", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutine4-22dcb28.stdout", "stdout_hash": "e7081ba2219e5435a01d4386a3e43a95255b2026714034c3e1ee31c9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-logical2-3eb78d2.stdout0000664000175000017500000000675615174404631023543 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i32) i32.const 1 local.set 0 i32.const 0 local.set 1 local.get 0 local.get 1 i32.and if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop end i32.const 0 call 0 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\1a\00\00\00") (data (;35;) (i32.const 216) "Line 1 - Condition is true ") (data (;36;) (i32.const 244) "\fc\00\00\00\1b\00\00\00") (data (;37;) (i32.const 252) "Line 1 - Condition is false ") ) lfortran-0.63.0/tests/reference/llvm-string_03-2cd8fec.json0000664000175000017500000000075015174404631023611 0ustar alastairalastair{ "basename": "llvm-string_03-2cd8fec", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/string_03.f90", "infile_hash": "7815b8703dfd3a1c61cab40604e20693508878e8a90e450834ce592b", "outfile": null, "outfile_hash": null, "stdout": "llvm-string_03-2cd8fec.stdout", "stdout_hash": "73eaada865f8b6a0b4430ff349a2067337be972ab5f788a3a6cd3779", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-exit2-f1f3b2c.stderr0000664000175000017500000000044015174404631023124 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/exit2.f90:6:12 | 6 | if ( i .eq. 5 ) then | ^^^^ help: write this as '==' warning: Routine `exit` is a non-standard function --> tests/exit2.f90:7:9 | 7 | call exit(2) | ^^^^^^^^^^^^ STOP 2 lfortran-0.63.0/tests/reference/asr-template_add_01b-bd911f4.stdout0000664000175000017500000024255215174404631025116 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_add_01b: (Program (SymbolTable 13 { add_t: (ExternalSymbol 13 add_t 2 add_t template_add_01b_m [] add_t Public ), r: (ExternalSymbol 13 r 2 r template_add_01b_m [] r Public ), test_template: (ExternalSymbol 13 test_template 2 test_template template_add_01b_m [] test_template Public ) }) template_add_01b [template_add_01b_m] [(SubroutineCall 13 test_template () [] () .false. )] ), template_add_01b_m: (Module (SymbolTable 2 { add_t: (Template (SymbolTable 5 { add_generic: (Function (SymbolTable 7 { x: (Variable 7 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 7 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 7 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_generic (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 7 x) (Var 7 y)] [(Assignment (Var 7 z) (OverloadedBinOp (Var 7 x) Add (Var 7 y) (TypeParameter t ) () (FunctionCall 5 f 5 ~add [((Var 7 x)) ((Var 7 y))] (TypeParameter t ) () () ) ) () .false. .false. )] (Var 7 z) Public .true. .true. () ), add_generic2: (Function (SymbolTable 8 { s: (Variable 8 s [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 8 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 8 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 8 z [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_generic2 (FunctionType [(TypeParameter t ) (TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 8 x) (Var 8 y) (Var 8 z)] [(Assignment (Var 8 s) (OverloadedBinOp (OverloadedBinOp (Var 8 x) Add (Var 8 y) (TypeParameter t ) () (FunctionCall 5 f 5 ~add [((Var 8 x)) ((Var 8 y))] (TypeParameter t ) () () ) ) Add (Var 8 z) (TypeParameter t ) () (FunctionCall 5 f 5 ~add [((OverloadedBinOp (Var 8 x) Add (Var 8 y) (TypeParameter t ) () (FunctionCall 5 f 5 ~add [((Var 8 x)) ((Var 8 y))] (TypeParameter t ) () () ) )) ((Var 8 z))] (TypeParameter t ) () () ) ) () .false. .false. )] (Var 8 s) Private .true. .true. () ), f: (Function (SymbolTable 6 { x: (Variable 6 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 6 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 6 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 6 x) (Var 6 y)] [] (Var 6 z) Private .true. .true. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~add: (CustomOperator 5 ~add [5 f] Public ) }) add_t [t f] [(Require r [t f] )] ), func_arg_int: (Function (SymbolTable 9 { x: (Variable 9 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 9 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 9 z [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) func_arg_int (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 x) (Var 9 y)] [(Assignment (Var 9 z) (IntegerBinOp (Var 9 x) Add (Var 9 y) (Integer 4) () ) () .false. .false. )] (Var 9 z) Private .true. .true. () ), r: (Requirement (SymbolTable 3 { f: (Function (SymbolTable 4 { x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 4 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 z) Private .true. .true. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~add: (CustomOperator 3 ~add [3 f] Public ) }) r [t f] [] ), test_template: (Function (SymbolTable 10 { add_integer: (Function (SymbolTable 11 { x: (Variable 11 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 11 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 11 z [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [func_arg_int] [(Var 11 x) (Var 11 y)] [(Assignment (Var 11 z) (OverloadedBinOp (Var 11 x) Add (Var 11 y) (TypeParameter t ) () (FunctionCall 2 func_arg_int 5 ~add [((Var 11 x)) ((Var 11 y))] (Integer 4) () () ) ) () .false. .false. )] (Var 11 z) Public .true. .true. () ), add_integer2: (Function (SymbolTable 12 { s: (Variable 12 s [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 12 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 12 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 12 z [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) add_integer2 (FunctionType [(Integer 4) (Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [func_arg_int] [(Var 12 x) (Var 12 y) (Var 12 z)] [(Assignment (Var 12 s) (OverloadedBinOp (OverloadedBinOp (Var 12 x) Add (Var 12 y) (TypeParameter t ) () (FunctionCall 2 func_arg_int 5 ~add [((Var 12 x)) ((Var 12 y))] (Integer 4) () () ) ) Add (Var 12 z) (TypeParameter t ) () (FunctionCall 2 func_arg_int 5 ~add [((OverloadedBinOp (Var 12 x) Add (Var 12 y) (TypeParameter t ) () (FunctionCall 2 func_arg_int 5 ~add [((Var 12 x)) ((Var 12 y))] (Integer 4) () () ) )) ((Var 12 z))] (Integer 4) () () ) ) () .false. .false. )] (Var 12 s) Private .true. .true. () ), n1: (Variable 10 n1 [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n2: (Variable 10 n2 [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 10 n1) (FunctionCall 10 add_integer () [((IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 9 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 10 n2) (FunctionCall 10 add_integer2 () [((IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 9 (Integer 4) Decimal)) ((IntegerConstant 10 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "The result is" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 10 n1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "The result is" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 10 n2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_add_01b_m () [template_add_01b_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_add_01-56d8eff.json0000664000175000017500000000076715174404631024500 0ustar alastairalastair{ "basename": "asr-template_add_01-56d8eff", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_add_01.f90", "infile_hash": "08b6efae516775086e118196aec862b1023aa56c02e207faa377f1a0", "outfile": null, "outfile_hash": null, "stdout": "asr-template_add_01-56d8eff.stdout", "stdout_hash": "131e4c0718b61e3bd47dc8d2477eadce263fda1c65e71838c94c56c9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-character1-8679f4b.json0000664000175000017500000000075015174404631023424 0ustar alastairalastair{ "basename": "asr-character1-8679f4b", "cmd": "lfortran --show-asr --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/character1.f90", "infile_hash": "83f86b3c6ec94d478c82439a20e7af4238dbd1d867cae8efbb7b1f39", "outfile": null, "outfile_hash": null, "stdout": "asr-character1-8679f4b.stdout", "stdout_hash": "f7001e2715bcba01697f75bbf0866ecf768740d26485dfe2f8cf8fba", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-assign-69436fa.json0000664000175000017500000000072215174404631023343 0ustar alastairalastair{ "basename": "ast_f90-assign-69436fa", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/assign.f90", "infile_hash": "67fee149907196a73ab4db43412dfbf29304c02aa5f1ce2da476423e", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-assign-69436fa.stdout", "stdout_hash": "2e0bd39311baa3a7f38105e69ba714fcc026427876ae89d84979f0b7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-cmplx_01-89b858d.json0000664000175000017500000000072415174404631023035 0ustar alastairalastair{ "basename": "asr-cmplx_01-89b858d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cmplx_01.f90", "infile_hash": "f317ca48704ee5d5a4888bed66f7268399aa3e448e1b69ad2c3414d6", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-cmplx_01-89b858d.stderr", "stderr_hash": "c4130f91af513f593d149e9b8a56275d8ce38679baa257374b5bcb36", "returncode": 2 }lfortran-0.63.0/tests/reference/ast-use1-56851d0.json0000664000175000017500000000072715174404631022175 0ustar alastairalastair{ "basename": "ast-use1-56851d0", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/use1.f", "infile_hash": "52745ad3598973f5e65c2a8cb8829e843ff54d4b7d398bd6d4734367", "outfile": null, "outfile_hash": null, "stdout": "ast-use1-56851d0.stdout", "stdout_hash": "1667ab83da97e35ba5b86366b130421d81be2d719440f6057a4e159c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/cpp-do_concurrent_reduce-373b02e.stdout0000664000175000017500000000145115174404631026123 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations template void sum_reduce(T0* a, float &s); // Implementations template void sum_reduce(T0* a, float &s) { int32_t i; int32_t n; n = a->data->extent(0); s = (float)(0); Kokkos::parallel_for(Kokkos::RangePolicy(1, n+1), KOKKOS_LAMBDA(const long i) { s = s + a->data->operator[](i - a->dims[0].lower_bound); }); } lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor6-c43df4d.json0000664000175000017500000000077015174404631026614 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor6-c43df4d", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor6.f90", "infile_hash": "ab74c4b1ba190571a15fc7788dd695d43963753391f8e83f5780477e", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor6-c43df4d.stdout", "stdout_hash": "948476336c787f4fe8f8928e127d359c81dd2c92480d49d4f504d660", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit10-f531a25.stderr0000664000175000017500000000071715174404631023674 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/implicit10.f90:6:1 | 6 | real*8 :: g, h, i | ^^^^^^ help: write this as 'real(8)' style suggestion: Use complex(4) instead of complex*8 --> tests/implicit10.f90:8:1 | 8 | complex*8 :: l, m | ^^^^^^^^^ help: write this as 'complex(4)' style suggestion: Use complex(8) instead of complex*16 --> tests/implicit10.f90:9:1 | 9 | complex *16 :: n | ^^^^^^^^^^^ help: write this as 'complex(8)' lfortran-0.63.0/tests/reference/asr-operator_overloading_04-e28fb55.json0000664000175000017500000000101715174404631026202 0ustar alastairalastair{ "basename": "asr-operator_overloading_04-e28fb55", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/operator_overloading_04.f90", "infile_hash": "03bc0260935fa2e3a432a8eb21ad59c74bccf134d03f6d0e90873258", "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_04-e28fb55.stdout", "stdout_hash": "5e5682da34101f1097b4265fc5b7d403a78a0e2874701808c2ef880d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-interface_10-e9eb6ea.stdout0000664000175000017500000002317615174404631024436 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { interface_10: (Program (SymbolTable 4 { chars: (ExternalSymbol 4 chars 2 chars interface_10_m [] chars Public ), chars@identity: (ExternalSymbol 4 chars@identity 2 identity interface_10_m [] identity Private ), identity: (ExternalSymbol 4 identity 2 identity interface_10_m [] identity Public ), x: (Variable 4 x [] Local () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 4 y [] Local () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) interface_10 [interface_10_m] [(Assignment (Var 4 x) (StringConstant "A" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (SubroutineCall 4 chars@identity 4 chars [((Var 4 x)) ((Var 4 y))] () .false. ) (Print (Var 4 x) )] ), interface_10_m: (Module (SymbolTable 2 { chars: (GenericProcedure 2 chars [2 identity] Public ), identity: (Function (SymbolTable 3 { x: (Variable 3 x [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 3 y [] Out () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) identity (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 y)] [(Assignment (Var 3 y) (Var 3 x) () .false. .false. )] () Public .true. .true. () ) }) interface_10_m () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-goto_01-d8652f5.json0000664000175000017500000000073715174404631022660 0ustar alastairalastair{ "basename": "ast-goto_01-d8652f5", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/goto_01.f90", "infile_hash": "a5108e90af7ae9a352b6ef368d3ccf4f3af85127a5ea50c9a937fe49", "outfile": null, "outfile_hash": null, "stdout": "ast-goto_01-d8652f5.stdout", "stdout_hash": "87b44936c3e0a16a746fecf5ad2074f9eac99ee5fa3a90ef21084662", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootlfortran-0.63.0/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-modules_40-2830409.stdoutlfortran-0.63.0/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-module0000664000175000017500000010237315174404631035003 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_40: (Program (SymbolTable 8 { }) modules_40 [] [(Print (StringConstant "executing modules_40" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ), modules_40_tomlf_de_tokenizer: (Module (SymbolTable 2 { parse_select: (Function (SymbolTable 5 { de: (Variable 5 de [] InOut () () Default (StructType [] [] .false. .false. ) 2 toml_tokenizer Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), fill_stack: (Function (SymbolTable 6 { __libasr_created_variable_: (Variable 6 __libasr_created_variable_ [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), de: (Variable 6 de [] InOut () () Default (StructType [] [] .false. .false. ) 2 toml_tokenizer Source Public Required .false. .true. .false. () .false. .false. NotMethod () 0 ), stack: (Variable 6 stack [] Out () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), top: (Variable 6 top [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) fill_stack (FunctionType [(StructType [] [] .false. .false. ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [resize] [(Var 6 de) (Var 6 top) (Var 6 stack)] [(WhileLoop () (LogicalConstant .true. (Logical 4) ) [(If () (IntegerCompare (Var 6 top) GtE (ArraySize (Var 6 stack) () (Integer 4) () ) (Logical 4) () ) [(SubroutineCall 5 resize () [((Var 6 stack)) ((Var 6 __libasr_created_variable_)) ((LogicalConstant .false. (Logical 4) ))] () .false. )] [] )] [] )] () Public .true. .true. () ), resize: (Function (SymbolTable 7 { __libasr_is_present_n: (Variable 7 __libasr_is_present_n [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 7 n [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), stack: (Variable 7 stack [] InOut () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) resize (FunctionType [(Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Integer 4) (Logical 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 stack) (Var 7 n) (Var 7 __libasr_is_present_n)] [] () Public .true. .true. () ) }) parse_select (FunctionType [(StructType [] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 de)] [] () Public .true. .true. () ), tfc: (Variable 2 tfc [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), toml_key: (Struct (SymbolTable 3 { key: (Variable 3 key [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_key (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [key] [] Source Public .false. .false. [] () () [] ), toml_tokenizer: (Struct (SymbolTable 4 { parse_select: (StructMethodDeclaration 4 parse_select () parse_select 2 parse_select Source .false. .false. ) }) toml_tokenizer (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .true. [] () () [] ) }) modules_40_tomlf_de_tokenizer () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/wat-expr_08-74f99b7.stdout0000664000175000017500000002124515174404631023257 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (type (;4;) (func (param f64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 f64 f32 f64 f32) i32.const 8 local.set 0 f32.const 3.000000 local.set 4 local.get 4 i32.const 2 drop local.get 4 f32.mul local.set 2 local.get 4 f64.promote_f32 call 4 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 2 f64.promote_f32 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 2 f32.const 9.000000 f32.sub f32.abs f32.const 0.000001 f32.gt if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end f64.const 3.000000 local.set 3 local.get 3 i32.const 2 drop local.get 3 f64.mul local.set 1 local.get 3 call 4 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 1 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 1 f64.const 9.000000 f64.sub f64.abs f64.const 0.000000 f64.gt if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (func $4 (type 4) (param f64) (result) (local i64 i64 i64) local.get 0 f64.const 0.000000 f64.lt if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 f64.const -1.000000 f64.mul local.set 0 else end local.get 0 i64.trunc_f64_s call 3 i32.const 1 i32.const 40 i32.const 1 i32.const 0 call 1 drop local.get 0 local.get 0 i64.trunc_f64_s f64.convert_i64_s f64.sub f64.const 100000000.000000 f64.mul i64.trunc_f64_s local.set 2 local.get 2 local.set 3 i64.const 0 local.set 1 loop local.get 2 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 2 f64.convert_i64_s i64.const 10 f64.convert_i64_s f64.div i64.trunc_f64_s local.set 2 br 1 else end end loop local.get 1 i64.const 8 i64.lt_s if local.get 1 i64.const 1 i64.add local.set 1 i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop br 1 else end end local.get 3 call 3 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (export "print_f64" (func 4)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\0b\00\00\00") (data (;35;) (i32.const 216) "ERROR STOP\n ") ) lfortran-0.63.0/tests/reference/asr-intrinsics2-68bbd81.stderr0000664000175000017500000000041115174404631024247 0ustar alastairalastairsemantic error: datan2 was declared as a variable, it can't be called as a function --> tests/errors/intrinsics2.f90:5:14 | 5 | print *, datan2(x,y) | ^^^^^^^^^^^ help: use the compiler option "--implicit-interface" to use intrinsic functions lfortran-0.63.0/tests/reference/asr-div_to_mul-3aaf3c0.json0000664000175000017500000000075015174404631023657 0ustar alastairalastair{ "basename": "asr-div_to_mul-3aaf3c0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/div_to_mul.f90", "infile_hash": "6c1d702f410e8db6aae79c37b446d7a2fd6295166902746ff799d239", "outfile": null, "outfile_hash": null, "stdout": "asr-div_to_mul-3aaf3c0.stdout", "stdout_hash": "b88d9d9dd6a5aee57961f59da20f07545e1e8b541d0bed6e243a1e0f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-coarrays_02-ea9dc2c.stdout0000664000175000017500000002042315174404631024306 0ustar alastairalastair(TranslationUnit [(Program coarrays_02 (TriviaNode [(EndOfLine) (Comment "! Source https://j3-fortran.org/doc/year/18/18-007r1.pdf Page no - 541" )] [] ) [(Use [(SimpleAttribute AttrIntrinsic )] iso_fortran_env [] .false. () )] [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrAllocatable )] [(node [(() () DimensionExpr)] [] () () None ())] (TriviaNode [] [(EOLComment "! tree nodes that this image handles." )] ) ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrAllocatable )] [(nc [(() () DimensionExpr)] [] () () None ())] (TriviaNode [] [(EndOfLine) (Comment "! node(i) has nc(i) children." )] ) ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrAllocatable )] [(parent [(() () DimensionExpr)] [] () () None ()) (sub [(() () DimensionExpr)] [] () () None ())] (TriviaNode [] [(EndOfLine) (Comment "! the parent of node (i) is node (sub (i)) [parent (i)]." )] ) ) (Declaration (AttrType TypeType [] () event_type None ) [(SimpleAttribute AttrAllocatable )] [(done [(() () DimensionExpr)] [(() () CodimensionExpr)] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ()) (status [] [] () () None ())] (TriviaNode [] [(EndOfLine) (Comment "! set up the tree, including allocation of all arrays." )] ) )] [(DoLoop 0 () 0 i 1 (FuncCallOrArray size [] [(() node () 0)] [] [] [] ) () [(If 0 () (> (FuncCallOrArray nc [] [(() i () 0)] [] [] [] ) 0) [(EventWait 0 (FuncCallOrArray done [] [(() i () 0)] [] [] [] ) [(AttrEventWaitKwArg until_count (FuncCallOrArray nc [] [(() i () 0)] [] [] [] ) ) (AttrStat status )] () ) (If 0 () (/= status 0) [(Exit 0 () () )] [] () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! process node, using data from children." )] ) ) (If 0 () (> (FuncCallOrArray parent [] [(() i () 0)] [] [] [] ) 0) [(EventPost 0 (CoarrayRef done [] [(() (FuncCallOrArray sub [] [(() i () 0)] [] [] [] ) () 0)] [] [(() (FuncCallOrArray parent [] [(() i () 0)] [] [] [] ) () CodimensionExpr)] [] ) [(AttrStat status )] () ) (If 0 () (/= status 0) [(Exit 0 () () )] [] () () () )] [] (TriviaNode [] [(EndOfLine) (Comment "! node is not the root." ) (Comment "! place result on image parent (i) for node node (sub) [parent (i)]" ) (Comment "! tell parent (i) that this has been done." )] ) () () )] (TriviaNode [] [(EndOfLine) (Comment "! wait for children to complete" )] ) () )] [] )] ) lfortran-0.63.0/tests/reference/enable_disable_style_suggestion-style1-55a065c.json0000664000175000017500000000102215174404631030413 0ustar alastairalastair{ "basename": "enable_disable_style_suggestion-style1-55a065c", "cmd": "lfortran --style-suggestions --no-style-suggestions --no-color {infile}", "infile": "tests/style1.f90", "infile_hash": "b37bbb3e24a2bceae58e25b574ccb9dea7fbe05441c08c9e4fa5add6", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "enable_disable_style_suggestion-style1-55a065c.stderr", "stderr_hash": "ad63281caddb41bffefff059b6597e92190dd4b1ac34f473a6cbf269", "returncode": 1 }lfortran-0.63.0/tests/reference/run-infer_mode_conflict_01-0752705.json0000664000175000017500000000074615174404631025543 0ustar alastairalastair{ "basename": "run-infer_mode_conflict_01-0752705", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/infer_mode_conflict_01.f90", "infile_hash": "f1d7b5c4f9ac34c2e5fd3d9f2689daa8b1d1d926ddd8ffa9f509ac6b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-infer_mode_conflict_01-0752705.stderr", "stderr_hash": "5244456f590a25462bb39f97303aa64543b89a0f01722cec1505de6f", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-intrinsics_31-9b91cfb.stdout0000664000175000017500000004776115174404631024613 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_31: (Program (SymbolTable 2 { dp: (Variable 2 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), w: (Variable 2 w [] Local (RealUnaryMinus (RealConstant 1.000001 (Real 8) ) (Real 8) (RealConstant -1.000001 (Real 8) ) ) (RealConstant -1.000001 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), w_ceil: (Variable 2 w_ceil [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local (RealConstant 63.290001 (Real 4) ) (RealConstant 63.290001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x_ceil: (Variable 2 x_ceil [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local (RealUnaryMinus (RealConstant 63.590000 (Real 4) ) (Real 4) (RealConstant -63.590000 (Real 4) ) ) (RealConstant -63.590000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y_ceil: (Variable 2 y_ceil [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local (RealConstant 0.000001 (Real 8) ) (RealConstant 0.000001 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z_ceil: (Variable 2 z_ceil [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) intrinsics_31 [] [(Assignment (Var 2 x_ceil) (Cast (IntrinsicElementalFunction Ceiling [(Var 2 x)] 0 (Integer 4) () ) IntegerToReal (Real 4) () () ) () .false. .false. ) (Assignment (Var 2 y_ceil) (Cast (IntrinsicElementalFunction Ceiling [(Var 2 y)] 0 (Integer 4) () ) IntegerToReal (Real 4) () () ) () .false. .false. ) (Assignment (Var 2 z_ceil) (IntrinsicElementalFunction Ceiling [(Var 2 z)] 0 (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 w_ceil) (IntrinsicElementalFunction Ceiling [(Var 2 w)] 0 (Integer 4) () ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x_ceil) Sub (Cast (IntegerConstant 64 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 64.000000 (Real 4) ) () ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 y_ceil) Sub (Cast (IntegerUnaryMinus (IntegerConstant 63 (Integer 4) Decimal) (Integer 4) (IntegerConstant -63 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant -63.000000 (Real 4) ) () ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 z_ceil) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 w_ceil) NotEq (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 x_ceil) (IntrinsicElementalFunction Ceiling [(Var 2 x_ceil)] 0 (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 y_ceil) (IntrinsicElementalFunction Ceiling [(Var 2 y_ceil)] 0 (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 z_ceil)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 w_ceil)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-string_03-2cd8fec.stdout0000664000175000017500000010115715174404631024165 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @__Wrong_allocation = private unnamed_addr constant [51 x i8] c"Attempting to allocate already allocated variable!\00", align 1 @string_const_data = private constant [8 x i8] c"learned " @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data, i32 0, i32 0), i64 8 }> @string_const_data.1 = private constant [5 x i8] c"from " @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data.1, i32 0, i32 0), i64 5 }> @string_const_data.3 = private constant [4 x i8] c"the " @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.3, i32 0, i32 0), i64 4 }> @string_const_data.5 = private constant [4 x i8] c"best" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.5, i32 0, i32 0), i64 4 }> @string_const_data.7 = private constant [5 x i8] c"I've " @string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data.7, i32 0, i32 0), i64 5 }> @0 = private unnamed_addr constant [25 x i8] c"_lcompilers_stringconcat\00", align 1 @1 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/string_03.f90\00", align 1 @2 = private unnamed_addr constant [20 x i8] c"This is unallocated\00", align 1 @3 = private unnamed_addr constant [45 x i8] c"Argument %d of subroutine %s is unallocated.\00", align 1 @4 = private unnamed_addr constant [25 x i8] c"_lcompilers_stringconcat\00", align 1 @5 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/string_03.f90\00", align 1 @6 = private unnamed_addr constant [20 x i8] c"This is unallocated\00", align 1 @7 = private unnamed_addr constant [45 x i8] c"Argument %d of subroutine %s is unallocated.\00", align 1 @8 = private unnamed_addr constant [25 x i8] c"_lcompilers_stringconcat\00", align 1 @9 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/string_03.f90\00", align 1 @10 = private unnamed_addr constant [20 x i8] c"This is unallocated\00", align 1 @11 = private unnamed_addr constant [45 x i8] c"Argument %d of subroutine %s is unallocated.\00", align 1 @12 = private unnamed_addr constant [25 x i8] c"_lcompilers_stringconcat\00", align 1 @13 = private unnamed_addr constant [41 x i8] c"tests/../integration_tests/string_03.f90\00", align 1 @14 = private unnamed_addr constant [20 x i8] c"This is unallocated\00", align 1 @15 = private unnamed_addr constant [45 x i8] c"Argument %d of subroutine %s is unallocated.\00", align 1 @string_const_data.9 = private constant [1 x i8] c"." @string_const.10 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.9, i32 0, i32 0), i64 1 }> @16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @17 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @_lcompilers_stringconcat(%string_descriptor* %s1, %string_descriptor* %s2, i32* %s1_len, i32* %s2_len, %string_descriptor* %concat_result) { .entry: %StrSlice_StrView2 = alloca %string_descriptor, align 8 %0 = call i8* @_lfortran_get_default_allocator() %StrSlice_StrView = alloca %string_descriptor, align 8 %1 = load i32, i32* %s1_len, align 4 %2 = load i32, i32* %s2_len, align 4 %3 = add i32 %1, %2 %4 = getelementptr %string_descriptor, %string_descriptor* %concat_result, i32 0, i32 0 %5 = load i8*, i8** %4, align 8 %6 = icmp ne i8* %5, null br i1 %6, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @__Wrong_allocation, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %7 = getelementptr %string_descriptor, %string_descriptor* %concat_result, i32 0, i32 0 %8 = sext i32 %3 to i64 %9 = call i8* @_lfortran_get_default_allocator() %10 = call i8* @_lfortran_string_malloc_alloc(i8* %9, i64 %8) store i8* %10, i8** %7, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %concat_result, i32 0, i32 1 %12 = sext i32 %3 to i64 store i64 %12, i64* %11, align 8 %13 = load i32, i32* %s1_len, align 4 %14 = sext i32 %13 to i64 %15 = sub i64 %14, 1 %16 = add i64 %15, 1 %17 = icmp slt i64 %16, 0 %18 = select i1 %17, i64 0, i64 %16 %19 = getelementptr %string_descriptor, %string_descriptor* %concat_result, i32 0, i32 0 %20 = load i8*, i8** %19, align 8 %StrSliceGEP = getelementptr i8, i8* %20, i64 0 %21 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 store i8* %StrSliceGEP, i8** %21, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 store i64 %18, i64* %22, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 %24 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 %25 = getelementptr %string_descriptor, %string_descriptor* %s1, i32 0, i32 0 %26 = load i8*, i8** %25, align 8 %27 = getelementptr %string_descriptor, %string_descriptor* %s1, i32 0, i32 1 %28 = load i64, i64* %27, align 8 call void @_lfortran_strcpy_alloc(i8* %0, i8** %23, i64* %24, i8 0, i8 0, i8* %26, i64 %28) %29 = load i32, i32* %s1_len, align 4 %30 = add i32 %29, 1 %31 = getelementptr %string_descriptor, %string_descriptor* %concat_result, i32 0, i32 1 %32 = load i64, i64* %31, align 8 %33 = trunc i64 %32 to i32 %34 = sext i32 %30 to i64 %35 = sext i32 %33 to i64 %36 = sub i64 %35, %34 %37 = add i64 %36, 1 %38 = icmp slt i64 %37, 0 %39 = select i1 %38, i64 0, i64 %37 %40 = getelementptr %string_descriptor, %string_descriptor* %concat_result, i32 0, i32 0 %41 = load i8*, i8** %40, align 8 %42 = sext i32 %30 to i64 %43 = sub i64 %42, 1 %StrSliceGEP1 = getelementptr i8, i8* %41, i64 %43 %44 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView2, i32 0, i32 0 store i8* %StrSliceGEP1, i8** %44, align 8 %45 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView2, i32 0, i32 1 store i64 %39, i64* %45, align 8 %46 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView2, i32 0, i32 0 %47 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView2, i32 0, i32 1 %48 = getelementptr %string_descriptor, %string_descriptor* %s2, i32 0, i32 0 %49 = load i8*, i8** %48, align 8 %50 = getelementptr %string_descriptor, %string_descriptor* %s2, i32 0, i32 1 %51 = load i64, i64* %50, align 8 call void @_lfortran_strcpy_alloc(i8* %0, i8** %46, i64* %47, i8 0, i8 0, i8* %49, i64 %51) br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE__lcompilers_stringconcat FINALIZE_SYMTABLE__lcompilers_stringconcat: ; preds = %return ret void } declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare i8* @_lfortran_string_malloc_alloc(i8*, i64) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_strcpy_alloc(i8*, i8**, i64*, i8, i8, i8*, i64) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value1 = alloca i32, align 4 %call_arg_value = alloca i32, align 4 %2 = call i8* @_lfortran_get_default_allocator() %verb = alloca %string_descriptor, align 8 %title = alloca %string_descriptor, align 8 %posit = alloca %string_descriptor, align 8 %last_name = alloca %string_descriptor, align 8 %combined = alloca %string_descriptor, align 8 %__libasr__created__var__4_return_slot = alloca %string_descriptor, align 8 %__libasr__created__var__3_return_slot = alloca %string_descriptor, align 8 %__libasr__created__var__2_return_slot = alloca %string_descriptor, align 8 %__libasr__created__var__1_return_slot = alloca %string_descriptor, align 8 %__libasr__created__var__0_return_slot = alloca %string_descriptor, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store %string_descriptor zeroinitializer, %string_descriptor* %__libasr__created__var__0_return_slot, align 1 store %string_descriptor zeroinitializer, %string_descriptor* %__libasr__created__var__1_return_slot, align 1 store %string_descriptor zeroinitializer, %string_descriptor* %__libasr__created__var__2_return_slot, align 1 store %string_descriptor zeroinitializer, %string_descriptor* %__libasr__created__var__3_return_slot, align 1 store %string_descriptor zeroinitializer, %string_descriptor* %__libasr__created__var__4_return_slot, align 1 store %string_descriptor zeroinitializer, %string_descriptor* %combined, align 1 %3 = getelementptr %string_descriptor, %string_descriptor* %combined, i32 0, i32 1 store i64 29, i64* %3, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %combined, i32 0, i32 0 %5 = call i8* @_lfortran_get_default_allocator() %6 = call i8* @_lfortran_malloc_alloc(i8* %5, i64 29) store i8* %6, i8** %4, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %last_name, align 1 %7 = getelementptr %string_descriptor, %string_descriptor* %last_name, i32 0, i32 1 store i64 7, i64* %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %last_name, i32 0, i32 0 %9 = call i8* @_lfortran_get_default_allocator() %10 = call i8* @_lfortran_malloc_alloc(i8* %9, i64 7) store i8* %10, i8** %8, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %posit, align 1 %11 = getelementptr %string_descriptor, %string_descriptor* %posit, i32 0, i32 1 store i64 5, i64* %11, align 8 %12 = getelementptr %string_descriptor, %string_descriptor* %posit, i32 0, i32 0 %13 = call i8* @_lfortran_get_default_allocator() %14 = call i8* @_lfortran_malloc_alloc(i8* %13, i64 5) store i8* %14, i8** %12, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %title, align 1 %15 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 1 store i64 4, i64* %15, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 0 %17 = call i8* @_lfortran_get_default_allocator() %18 = call i8* @_lfortran_malloc_alloc(i8* %17, i64 4) store i8* %18, i8** %16, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %verb, align 1 %19 = getelementptr %string_descriptor, %string_descriptor* %verb, i32 0, i32 1 store i64 8, i64* %19, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %verb, i32 0, i32 0 %21 = call i8* @_lfortran_get_default_allocator() %22 = call i8* @_lfortran_malloc_alloc(i8* %21, i64 8) store i8* %22, i8** %20, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %verb, i32 0, i32 0 %24 = getelementptr %string_descriptor, %string_descriptor* %verb, i32 0, i32 1 %25 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_strcpy_alloc(i8* %2, i8** %23, i64* %24, i8 0, i8 0, i8* %25, i64 8) %26 = getelementptr %string_descriptor, %string_descriptor* %posit, i32 0, i32 0 %27 = getelementptr %string_descriptor, %string_descriptor* %posit, i32 0, i32 1 %28 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_strcpy_alloc(i8* %2, i8** %26, i64* %27, i8 0, i8 0, i8* %28, i64 5) %29 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 0 %30 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 1 %31 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_strcpy_alloc(i8* %2, i8** %29, i64* %30, i8 0, i8 0, i8* %31, i64 4) %32 = getelementptr %string_descriptor, %string_descriptor* %last_name, i32 0, i32 0 %33 = getelementptr %string_descriptor, %string_descriptor* %last_name, i32 0, i32 1 %34 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.6, i32 0, i32 0), align 8 call void @_lfortran_strcpy_alloc(i8* %2, i8** %32, i64* %33, i8 0, i8 0, i8* %34, i64 4) %35 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0_return_slot, i32 0, i32 0 %36 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0_return_slot, i32 0, i32 1 %37 = load i8*, i8** %35, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %37) store i8* null, i8** %35, align 8 store i64 0, i64* %36, align 8 store i32 5, i32* %call_arg_value, align 4 store i32 8, i32* %call_arg_value1, align 4 call void @_lcompilers_stringconcat(%string_descriptor* @string_const.8, %string_descriptor* %verb, i32* %call_arg_value, i32* %call_arg_value1, %string_descriptor* %__libasr__created__var__0_return_slot) %38 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__1_return_slot, i32 0, i32 0 %39 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__1_return_slot, i32 0, i32 1 %40 = load i8*, i8** %38, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %40) store i8* null, i8** %38, align 8 store i64 0, i64* %39, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0_return_slot, i32 0, i32 0 %42 = load i8*, i8** %41, align 8 %43 = ptrtoint i8* %42 to i64 %44 = icmp eq i64 %43, 0 br i1 %44, label %then, label %ifcont then: ; preds = %.entry %45 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %46 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %47 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %46, i32 0, i32 0 %48 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %47, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @1, i32 0, i32 0), i8** %48, align 8 %49 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %47, i32 0, i32 1 store i32 21, i32* %49, align 4 %50 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %47, i32 0, i32 2 store i32 12, i32* %50, align 4 %51 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %47, i32 0, i32 3 store i32 21, i32* %51, align 4 %52 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %47, i32 0, i32 4 store i32 22, i32* %52, align 4 %53 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @2, i32 0, i32 0)) %54 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %45, i32 0, i32 0 %55 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %46, i32 0, i32 0 %56 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %54, i32 0, i32 2 %57 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %54, i32 0, i32 0 store i1 true, i1* %57, align 1 %58 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %54, i32 0, i32 1 store i8* %53, i8** %58, align 8 store { i8*, i32, i32, i32, i32 }* %55, { i8*, i32, i32, i32, i32 }** %56, align 8 %59 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %54, i32 0, i32 3 store i32 1, i32* %59, align 4 %60 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %45, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %60, i32 1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @3, i32 0, i32 0), i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont: ; preds = %.entry store i32 13, i32* %call_arg_value, align 4 store i32 5, i32* %call_arg_value1, align 4 call void @_lcompilers_stringconcat(%string_descriptor* %__libasr__created__var__0_return_slot, %string_descriptor* %posit, i32* %call_arg_value, i32* %call_arg_value1, %string_descriptor* %__libasr__created__var__1_return_slot) %61 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 0 %62 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 1 %63 = load i8*, i8** %61, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %63) store i8* null, i8** %61, align 8 store i64 0, i64* %62, align 8 %64 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__1_return_slot, i32 0, i32 0 %65 = load i8*, i8** %64, align 8 %66 = ptrtoint i8* %65 to i64 %67 = icmp eq i64 %66, 0 br i1 %67, label %then2, label %ifcont3 then2: ; preds = %ifcont %68 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %69 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %70 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %69, i32 0, i32 0 %71 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %70, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @5, i32 0, i32 0), i8** %71, align 8 %72 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %70, i32 0, i32 1 store i32 21, i32* %72, align 4 %73 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %70, i32 0, i32 2 store i32 12, i32* %73, align 4 %74 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %70, i32 0, i32 3 store i32 21, i32* %74, align 4 %75 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %70, i32 0, i32 4 store i32 29, i32* %75, align 4 %76 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @6, i32 0, i32 0)) %77 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %68, i32 0, i32 0 %78 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %69, i32 0, i32 0 %79 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %77, i32 0, i32 2 %80 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %77, i32 0, i32 0 store i1 true, i1* %80, align 1 %81 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %77, i32 0, i32 1 store i8* %76, i8** %81, align 8 store { i8*, i32, i32, i32, i32 }* %78, { i8*, i32, i32, i32, i32 }** %79, align 8 %82 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %77, i32 0, i32 3 store i32 1, i32* %82, align 4 %83 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %68, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %83, i32 1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @7, i32 0, i32 0), i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont3: ; preds = %ifcont store i32 18, i32* %call_arg_value, align 4 store i32 4, i32* %call_arg_value1, align 4 call void @_lcompilers_stringconcat(%string_descriptor* %__libasr__created__var__1_return_slot, %string_descriptor* %title, i32* %call_arg_value, i32* %call_arg_value1, %string_descriptor* %__libasr__created__var__2_return_slot) %84 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__3_return_slot, i32 0, i32 0 %85 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__3_return_slot, i32 0, i32 1 %86 = load i8*, i8** %84, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %86) store i8* null, i8** %84, align 8 store i64 0, i64* %85, align 8 %87 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 0 %88 = load i8*, i8** %87, align 8 %89 = ptrtoint i8* %88 to i64 %90 = icmp eq i64 %89, 0 br i1 %90, label %then4, label %ifcont5 then4: ; preds = %ifcont3 %91 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %92 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %93 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %92, i32 0, i32 0 %94 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %93, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @9, i32 0, i32 0), i8** %94, align 8 %95 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %93, i32 0, i32 1 store i32 21, i32* %95, align 4 %96 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %93, i32 0, i32 2 store i32 12, i32* %96, align 4 %97 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %93, i32 0, i32 3 store i32 21, i32* %97, align 4 %98 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %93, i32 0, i32 4 store i32 36, i32* %98, align 4 %99 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @10, i32 0, i32 0)) %100 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %91, i32 0, i32 0 %101 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %92, i32 0, i32 0 %102 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %100, i32 0, i32 2 %103 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %100, i32 0, i32 0 store i1 true, i1* %103, align 1 %104 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %100, i32 0, i32 1 store i8* %99, i8** %104, align 8 store { i8*, i32, i32, i32, i32 }* %101, { i8*, i32, i32, i32, i32 }** %102, align 8 %105 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %100, i32 0, i32 3 store i32 1, i32* %105, align 4 %106 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %91, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %106, i32 1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @11, i32 0, i32 0), i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont5: ; preds = %ifcont3 store i32 22, i32* %call_arg_value, align 4 store i32 7, i32* %call_arg_value1, align 4 call void @_lcompilers_stringconcat(%string_descriptor* %__libasr__created__var__2_return_slot, %string_descriptor* %last_name, i32* %call_arg_value, i32* %call_arg_value1, %string_descriptor* %__libasr__created__var__3_return_slot) %107 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__4_return_slot, i32 0, i32 0 %108 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__4_return_slot, i32 0, i32 1 %109 = load i8*, i8** %107, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %109) store i8* null, i8** %107, align 8 store i64 0, i64* %108, align 8 %110 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__3_return_slot, i32 0, i32 0 %111 = load i8*, i8** %110, align 8 %112 = ptrtoint i8* %111 to i64 %113 = icmp eq i64 %112, 0 br i1 %113, label %then6, label %ifcont7 then6: ; preds = %ifcont5 %114 = alloca [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], align 8 %115 = alloca [1 x { i8*, i32, i32, i32, i32 }], align 8 %116 = getelementptr inbounds [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %115, i32 0, i32 0 %117 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %116, i32 0, i32 0 store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @13, i32 0, i32 0), i8** %117, align 8 %118 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %116, i32 0, i32 1 store i32 21, i32* %118, align 4 %119 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %116, i32 0, i32 2 store i32 12, i32* %119, align 4 %120 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %116, i32 0, i32 3 store i32 21, i32* %120, align 4 %121 = getelementptr { i8*, i32, i32, i32, i32 }, { i8*, i32, i32, i32, i32 }* %116, i32 0, i32 4 store i32 47, i32* %121, align 4 %122 = call i8* (i8*, i8*, ...) @_lcompilers_snprintf_alloc(i8* %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @14, i32 0, i32 0)) %123 = getelementptr inbounds [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %114, i32 0, i32 0 %124 = getelementptr [1 x { i8*, i32, i32, i32, i32 }], [1 x { i8*, i32, i32, i32, i32 }]* %115, i32 0, i32 0 %125 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %123, i32 0, i32 2 %126 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %123, i32 0, i32 0 store i1 true, i1* %126, align 1 %127 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %123, i32 0, i32 1 store i8* %122, i8** %127, align 8 store { i8*, i32, i32, i32, i32 }* %124, { i8*, i32, i32, i32, i32 }** %125, align 8 %128 = getelementptr { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %123, i32 0, i32 3 store i32 1, i32* %128, align 4 %129 = getelementptr [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }], [1 x { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }]* %114, i32 0, i32 0 call void (i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) @_lcompilers_runtime_error(i8* %2, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }* %129, i32 1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @15, i32 0, i32 0), i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @12, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont7: ; preds = %ifcont5 store i32 29, i32* %call_arg_value, align 4 store i32 1, i32* %call_arg_value1, align 4 call void @_lcompilers_stringconcat(%string_descriptor* %__libasr__created__var__3_return_slot, %string_descriptor* @string_const.10, i32* %call_arg_value, i32* %call_arg_value1, %string_descriptor* %__libasr__created__var__4_return_slot) %130 = getelementptr %string_descriptor, %string_descriptor* %combined, i32 0, i32 0 %131 = getelementptr %string_descriptor, %string_descriptor* %combined, i32 0, i32 1 %132 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__4_return_slot, i32 0, i32 0 %133 = load i8*, i8** %132, align 8 %134 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__4_return_slot, i32 0, i32 1 %135 = load i64, i64* %134, align 8 call void @_lfortran_strcpy_alloc(i8* %2, i8** %130, i64* %131, i8 0, i8 0, i8* %133, i64 %135) %136 = getelementptr %string_descriptor, %string_descriptor* %combined, i32 0, i32 0 %137 = load i8*, i8** %136, align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* %137, i32 29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0), i32 1) br label %return return: ; preds = %ifcont7 br label %FINALIZE_SYMTABLE_string_03 FINALIZE_SYMTABLE_string_03: ; preds = %return br label %Finalize_Variable___libasr__created__var__0_return_slot Finalize_Variable___libasr__created__var__0_return_slot: ; preds = %FINALIZE_SYMTABLE_string_03 %138 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0_return_slot, i32 0, i32 0 %139 = load i8*, i8** %138, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %139) br label %Finalize_Variable___libasr__created__var__1_return_slot Finalize_Variable___libasr__created__var__1_return_slot: ; preds = %Finalize_Variable___libasr__created__var__0_return_slot %140 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__1_return_slot, i32 0, i32 0 %141 = load i8*, i8** %140, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %141) br label %Finalize_Variable___libasr__created__var__2_return_slot Finalize_Variable___libasr__created__var__2_return_slot: ; preds = %Finalize_Variable___libasr__created__var__1_return_slot %142 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 0 %143 = load i8*, i8** %142, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %143) br label %Finalize_Variable___libasr__created__var__3_return_slot Finalize_Variable___libasr__created__var__3_return_slot: ; preds = %Finalize_Variable___libasr__created__var__2_return_slot %144 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__3_return_slot, i32 0, i32 0 %145 = load i8*, i8** %144, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %145) br label %Finalize_Variable___libasr__created__var__4_return_slot Finalize_Variable___libasr__created__var__4_return_slot: ; preds = %Finalize_Variable___libasr__created__var__3_return_slot %146 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__4_return_slot, i32 0, i32 0 %147 = load i8*, i8** %146, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %147) br label %Finalize_Variable_combined Finalize_Variable_combined: ; preds = %Finalize_Variable___libasr__created__var__4_return_slot %148 = getelementptr %string_descriptor, %string_descriptor* %combined, i32 0, i32 0 %149 = load i8*, i8** %148, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %149) br label %Finalize_Variable_last_name Finalize_Variable_last_name: ; preds = %Finalize_Variable_combined %150 = getelementptr %string_descriptor, %string_descriptor* %last_name, i32 0, i32 0 %151 = load i8*, i8** %150, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %151) br label %Finalize_Variable_posit Finalize_Variable_posit: ; preds = %Finalize_Variable_last_name %152 = getelementptr %string_descriptor, %string_descriptor* %posit, i32 0, i32 0 %153 = load i8*, i8** %152, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %153) br label %Finalize_Variable_title Finalize_Variable_title: ; preds = %Finalize_Variable_posit %154 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 0 %155 = load i8*, i8** %154, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %155) br label %Finalize_Variable_verb Finalize_Variable_verb: ; preds = %Finalize_Variable_title %156 = getelementptr %string_descriptor, %string_descriptor* %verb, i32 0, i32 0 %157 = load i8*, i8** %156, align 8 call void @_lfortran_free_alloc(i8* %2, i8* %157) call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc_alloc(i8*, i64) declare void @_lfortran_free_alloc(i8*, i8*) declare i8* @_lcompilers_snprintf_alloc(i8*, i8*, ...) declare void @_lcompilers_runtime_error(i8*, { i1, i8*, { i8*, i32, i32, i32, i32 }*, i32 }*, i32, i8*, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/asr-fixed_form_call1-ad7fd7d.json0000664000175000017500000000100515174404631025006 0ustar alastairalastair{ "basename": "asr-fixed_form_call1-ad7fd7d", "cmd": "lfortran --fixed-form --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-ad7fd7d.stdout", "stdout_hash": "586a6a63686ed9fcd5242797baf7ff1d8b38d74abb166a0dd7418ba0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-matrix_matmul_01-6b086c6.stderr0000664000175000017500000000031715174404631025110 0ustar alastairalastairsemantic error: The argument `matrix_a` in `matmul` must be of type Integer, Real, Complex or Logical --> tests/errors/matrix_matmul_01.f90:5:21 | 5 | print *, matmul(a, b) | ^ lfortran-0.63.0/tests/reference/ast-implicit1-e201262.stderr0000664000175000017500000000157015174404631023527 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/implicit1.f90:13:14 | 13 | implicit real*8 (a-h,o-z) | ^ help: write this as 'real(8)' style suggestion: Use integer(8) instead of integer*8 --> tests/implicit1.f90:25:17 | 25 | implicit integer*8 (i,j-l,m,n) | ^ help: write this as 'integer(8)' style suggestion: Use integer(4) instead of integer*4 --> tests/implicit1.f90:27:17 | 27 | IMPLICIT INTEGER*4 (C, D-x) | ^ help: write this as 'integer(4)' style suggestion: Use logical(4) instead of logical*4 --> tests/implicit1.f90:32:17 | 32 | implicit logical*4 (l, u-z) | ^ help: write this as 'logical(4)' style suggestion: Use complex(4) instead of complex*8 --> tests/implicit1.f90:38:17 | 38 | implicit complex*8 (z) | ^ help: write this as 'complex(4)' lfortran-0.63.0/tests/reference/ast-case_05-a43ab42.json0000664000175000017500000000073715174404631022664 0ustar alastairalastair{ "basename": "ast-case_05-a43ab42", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_05.f90", "infile_hash": "914477f4a376baf0341e522d2109b6108238cd1d9dfecf969283ab79", "outfile": null, "outfile_hash": null, "stdout": "ast-case_05-a43ab42.stdout", "stdout_hash": "9d36536faa2e4cae2d23d1329b1936a93ae9054472f5c86310b38889", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/obj-expr5-7a93333.json0000664000175000017500000000055715174404631022347 0ustar alastairalastair{ "basename": "obj-expr5-7a93333", "cmd": "lfortran --no-color -c {infile} -o output.o", "infile": "tests/expr5.f90", "infile_hash": "030f3f956944c6d24d536fd1f434f877d95bf12aac6f367d2ad1827e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-real_dp_01-b41f13e.json0000664000175000017500000000075015174404631023351 0ustar alastairalastair{ "basename": "asr-real_dp_01-b41f13e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/real_dp_01.f90", "infile_hash": "96dcdc6844b049f189b110b997c4e4f840afa6ff1cd1da7e03f80d79", "outfile": null, "outfile_hash": null, "stdout": "asr-real_dp_01-b41f13e.stdout", "stdout_hash": "1c5e76e0ee10b4b3780216d5b6817ac387d9e3df26982afc6d1f55c3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-private1-d8bb7ee.json0000664000175000017500000000074215174404631023352 0ustar alastairalastair{ "basename": "asr-private1-d8bb7ee", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/private1.f90", "infile_hash": "aab1af3d1d5589a3a229317b277fd53d15afd3db9d21a6f2306c111e", "outfile": null, "outfile_hash": null, "stdout": "asr-private1-d8bb7ee.stdout", "stdout_hash": "23e2d4e1ff1cfd12c8bc5ca43b8ac970d0c53c131634cfb7d89e865e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-builtin1-21cf43e.stdout0000664000175000017500000000073315174404631024226 0ustar alastairalastairprogram builtin_01 ! AST only tests implicit none inquire(unit=n, opened=inuse) inquire(UNIT=JOAN, OPENED=LOG_01, NAMED=LOG_02, FORM=CHAR_VAR, IOSTAT=IOS) inquire(IOLENGTH=IOL) A(1:N) rewind(s) rewind(s) rewind(10) rewind(err=label, unit=s) rewind(iunit(13)) backspace(u) backspace(io_unit) backspace(10) backspace(10, IOSTAT=N) backspace(iunit(13)) endfile(K) endfile(5) endfile(k) endfile(10, iostat=n) endfile(unit=iout, iostat=ios, iomsg=msg) end program builtin_01 lfortran-0.63.0/tests/reference/asr-class_01-704dee8.json0000664000175000017500000000106115174404631023057 0ustar alastairalastair{ "basename": "asr-class_01-704dee8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/class_01.f90", "infile_hash": "d56b80167c24a798a3f70abbc77b31570b560e826ce6b96ab9476bab", "outfile": null, "outfile_hash": null, "stdout": "asr-class_01-704dee8.stdout", "stdout_hash": "a5c09625ebd707882a15352ff9a813e79115e97fc93b7f6894c015f4", "stderr": "asr-class_01-704dee8.stderr", "stderr_hash": "83b7bc133c115994c08e9afc99edb6e1e19ce354b399bf4374f7b855", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-external_03-fe60427.stdout0000664000175000017500000003134515174404631024074 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 4 { f: (Function (SymbolTable 9 { f_arg_0: (Variable 9 f_arg_0 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f_return_var_name: (Variable 9 f_return_var_name [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Real 4)] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 f_arg_0)] [] (Var 9 f_return_var_name) Public .false. .false. () ), r: (Variable 4 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a (FunctionType [(FunctionType [(Real 4)] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 f)] [(Assignment (Var 4 r) (FunctionCall 4 f () [((RealConstant 2.000000 (Real 4) ))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 4 r)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), b: (Function (SymbolTable 2 { f: (Function (SymbolTable 8 { f_arg_0: (Variable 8 f_arg_0 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), f_return_var_name: (Variable 8 f_return_var_name [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [(Real 4)] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 f_arg_0)] [] (Var 8 f_return_var_name) Public .false. .false. () ) }) b (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [a] [] [(SubroutineCall 1 a () [((Var 2 f))] () .false. )] () Public .true. .true. () ), external_03: (Program (SymbolTable 6 { }) external_03 [] [(SubroutineCall 1 b () [] () .false. )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-implicit_argument_casting_01-2274b4b.json0000664000175000017500000000107215174404631027106 0ustar alastairalastair{ "basename": "asr-implicit_argument_casting_01-2274b4b", "cmd": "lfortran --show-asr --implicit-argument-casting --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/implicit_argument_casting_01.f90", "infile_hash": "3ed389916666e17233ec1aa288c9e7cfee00c97aacc83db1aeec5c7b", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_argument_casting_01-2274b4b.stdout", "stdout_hash": "f88a6b1b935e0e300ca930c01824d5853cb519d7766420562021b5c0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-pragma2-dd5bd9b.json0000664000175000017500000000071215174404631023144 0ustar alastairalastair{ "basename": "ast-pragma2-dd5bd9b", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/pragma2.f90", "infile_hash": "c76c30115a39aa0c98b24173c8517df1fb525bf101023b12dc38ca3e", "outfile": null, "outfile_hash": null, "stdout": "ast-pragma2-dd5bd9b.stdout", "stdout_hash": "1febfc19f8f29330796a99c366561e071dbd1057b9114cc31e0c8a67", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-functions_13-3345127.json0000664000175000017500000000075615174404631023547 0ustar alastairalastair{ "basename": "asr-functions_13-3345127", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_13.f90", "infile_hash": "e625d7c90c838445296950a369041b1132188905e8340872684a96e5", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_13-3345127.stdout", "stdout_hash": "3933133afec026805031d20e7b39251f6d5930cb1bd44ebfcb6b57f3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-program_without_line_cc-78281a4.stderr0000664000175000017500000000026515174404631026557 0ustar alastairalastairsyntax error: Expected program end --> tests/errors/program_without_line_cc.f90:1:1 - 2:8 | 1 | print *, "OK" | ^^^^^^^^^^^^^... ... | 2 | contains | ...^^^^^^^^ lfortran-0.63.0/tests/reference/asr-modules_39-89c7d0d.stdout0000664000175000017500000005630615174404631024024 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_39: (Program (SymbolTable 8 { build_model: (ExternalSymbol 8 build_model 2 build_model modules_39_fpm_39 [] build_model Public ), filewrite: (ExternalSymbol 8 filewrite 4 filewrite modules_39_module_fpm_filesystem_39 [] filewrite Public ), join_path: (ExternalSymbol 8 join_path 4 join_path modules_39_module_fpm_filesystem_39 [] join_path Public ) }) modules_39 [modules_39_fpm_39 modules_39_module_fpm_filesystem_39] [(SubroutineCall 8 build_model () [] () .false. ) (Print (StringConstant "executing modules_39" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ), modules_39_fpm_39: (Module (SymbolTable 2 { build_model: (Function (SymbolTable 7 { }) build_model (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(SubroutineCall 2 filewrite () [((FunctionCall 2 join_path () [((StringConstant "build" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((StringConstant ".gitignore" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) )) (()) (()) (())] (Allocatable (String 1 () DeferredLength DescriptorString) ) () () )) ((ArrayPhysicalCast (ArrayConstant 1 ["*"] (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] PointerArray ) ColMajor ) PointerArray DescriptorArray (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] DescriptorArray ) () ))] () .false. )] () Public .true. .true. () ), filewrite: (ExternalSymbol 2 filewrite 4 filewrite modules_39_module_fpm_filesystem_39 [] filewrite Public ), join_path: (ExternalSymbol 2 join_path 4 join_path modules_39_module_fpm_filesystem_39 [] join_path Public ) }) modules_39_fpm_39 () [modules_39_module_fpm_filesystem_39] .false. .false. .false. ), modules_39_module_fpm_filesystem_39: (Module (SymbolTable 4 { filewrite: (Function (SymbolTable 5 { filedata: (Variable 5 filedata [] In () () Default (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), filename: (Variable 5 filename [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) filewrite (FunctionType [(String 1 () AssumedLength DescriptorString) (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 filename) (Var 5 filedata)] [] () Public .true. .true. () ), join_path: (Function (SymbolTable 6 { a1: (Variable 6 a1 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a2: (Variable 6 a2 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), a3: (Variable 6 a3 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), a4: (Variable 6 a4 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), a5: (Variable 6 a5 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), path: (Variable 6 path [] ReturnVar () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) join_path (FunctionType [(String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString)] (Allocatable (String 1 () DeferredLength DescriptorString) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 a1) (Var 6 a2) (Var 6 a3) (Var 6 a4) (Var 6 a5)] [] (Var 6 path) Public .true. .true. () ) }) modules_39_module_fpm_filesystem_39 () [] .true. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor14-07dfdb5.stdout0000664000175000017500000000362015174404631027241 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor14: (Program (SymbolTable 2 { }) preprocessor14 [] [(Print (StringConstant "X == 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-modulo_01-b82bee9.json0000664000175000017500000000072715174404631023341 0ustar alastairalastair{ "basename": "asr-modulo_01-b82bee9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/modulo_01.f90", "infile_hash": "a1faad9d12741b5d627f1c52ac348e99c9c7e07b44044a862435d250", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-modulo_01-b82bee9.stderr", "stderr_hash": "d79db9803291413c96b2e47dc8d958920ab27228255cde76f417294d", "returncode": 2 }lfortran-0.63.0/tests/reference/cpp-types_01-dfa3d3c.json0000664000175000017500000000072515174404631023250 0ustar alastairalastair{ "basename": "cpp-types_01-dfa3d3c", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/types_01.f90", "infile_hash": "1987d8bcc6219e1bf0134a0123e23d9e02a0a8efb6989074d1537f46", "outfile": null, "outfile_hash": null, "stdout": "cpp-types_01-dfa3d3c.stdout", "stdout_hash": "5509e317ac287508d7969e4fd85ef96cbdfb5877fc6fe71787ba05dd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-template_03-6afb845.stdout0000664000175000017500000032365015174404631024152 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_03: (Program (SymbolTable 13 { f: (ExternalSymbol 13 f 2 f template_03_m [] f Public ) }) template_03 [template_03_m] [(SubroutineCall 13 f () [] () .false. )] ), template_03_m: (Module (SymbolTable 2 { axpy_tmpl: (Template (SymbolTable 5 { axpy: (Function (SymbolTable 8 { a: (Variable 8 a [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 8 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lfortran_tmp: (Variable 8 lfortran_tmp [] Local () () Default (TypeParameter w ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 8 x [] In () () Default (Array (TypeParameter u ) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 8 y [] InOut () () Default (Array (TypeParameter v ) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) axpy (FunctionType [(TypeParameter t ) (Array (TypeParameter u ) [(() ())] DescriptorArray ) (Array (TypeParameter v ) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [times plus] [(Var 8 a) (Var 8 x) (Var 8 y)] [(DoLoop () ((Var 8 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 8 x) () (Integer 4) () ) ()) [(Assignment (Var 8 lfortran_tmp) (FunctionCall 5 times () [((Var 8 a)) ((ArrayItem (Var 8 x) [(() (Var 8 i) ())] (TypeParameter u ) ColMajor () ))] (TypeParameter w ) () () ) () .false. .false. ) (Assignment (ArrayItem (Var 8 y) [(() (Var 8 i) ())] (TypeParameter v ) ColMajor () ) (FunctionCall 5 plus () [((ArrayItem (Var 8 y) [(() (Var 8 i) ())] (TypeParameter v ) ColMajor () )) ((Var 8 lfortran_tmp))] (TypeParameter v ) () () ) () .false. .false. )] [] )] () Public .false. .true. () ), plus: (Function (SymbolTable 6 { a: (Variable 6 a [] In () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 6 b [] In () () Default (TypeParameter w ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), op: (Variable 6 op [] ReturnVar () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) plus (FunctionType [(TypeParameter v ) (TypeParameter w )] (TypeParameter v ) Source Interface () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 6 a) (Var 6 b)] [] (Var 6 op) Public .false. .true. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), times: (Function (SymbolTable 7 { a: (Variable 7 a [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 7 b [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), op: (Variable 7 op [] ReturnVar () () Default (TypeParameter w ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) times (FunctionType [(TypeParameter t ) (TypeParameter u )] (TypeParameter w ) Source Interface () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 7 a) (Var 7 b)] [] (Var 7 op) Public .false. .true. () ), u: (Variable 5 u [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 5 v [] In () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), w: (Variable 5 w [] In () () Default (TypeParameter w ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) axpy_tmpl [t u v w plus times] [(Require op [v w plus] ) (Require op [t u w times] )] ), f: (Function (SymbolTable 9 { a: (Variable 9 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), axpy: (Function (SymbolTable 12 { a: (Variable 12 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 12 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), lfortran_tmp: (Variable 12 lfortran_tmp [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 12 x [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 12 y [] InOut () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) axpy (FunctionType [(Real 4) (Array (Integer 4) [(() ())] DescriptorArray ) (Array (Real 4) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~mul_intrinsic ~add_intrinsic] [(Var 12 a) (Var 12 x) (Var 12 y)] [(DoLoop () ((Var 12 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 12 x) () (Integer 4) () ) ()) [(Assignment (Var 12 lfortran_tmp) (FunctionCall 9 ~mul_intrinsic () [((Var 12 a)) ((ArrayItem (Var 12 x) [(() (Var 12 i) ())] (Integer 4) ColMajor () ))] (Real 4) () () ) () .false. .false. ) (Assignment (ArrayItem (Var 12 y) [(() (Var 12 i) ())] (Real 4) ColMajor () ) (FunctionCall 9 ~add_intrinsic () [((ArrayItem (Var 12 y) [(() (Var 12 i) ())] (Real 4) ColMajor () )) ((Var 12 lfortran_tmp))] (Real 4) () () ) () .false. .false. )] [] )] () Public .true. .true. () ), dp: (Variable 9 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 1.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), sp: (Variable 9 sp [] Local (TypeInquiry Kind (Real 4) (RealConstant 1.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 9 x [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 9 y [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~add: (CustomOperator 9 ~add [9 ~add_intrinsic] Public ), ~add_intrinsic: (Function (SymbolTable 10 { arg0: (Variable 10 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 10 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 10 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~add_intrinsic (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 10 arg0) (Var 10 arg1)] [(Assignment (Var 10 ret) (RealBinOp (Var 10 arg0) Add (Var 10 arg1) (Real 4) () ) () .false. .false. )] (Var 10 ret) Public .true. .true. () ), ~mul: (CustomOperator 9 ~mul [9 ~mul_intrinsic] Public ), ~mul_intrinsic: (Function (SymbolTable 11 { arg0: (Variable 11 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), arg1: (Variable 11 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ret: (Variable 11 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ~mul_intrinsic (FunctionType [(Real 4) (Integer 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 11 arg0) (Var 11 arg1)] [(Assignment (Var 11 ret) (RealBinOp (Var 11 arg0) Mul (Cast (Var 11 arg1) IntegerToReal (Real 4) () () ) (Real 4) () ) () .false. .false. )] (Var 11 ret) Public .true. .true. () ) }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 9 a) (RealConstant 0.500000 (Real 4) ) () .false. .false. ) (Assignment (Var 9 x) (ArrayBroadcast (IntegerConstant 2 (Integer 4) Decimal) (ArrayConstant 4 [3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [2, 2, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 9 y) (ArrayBroadcast (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) () ) (ArrayConstant 4 [3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [0.00000000e+00, 0.00000000e+00, 0.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (SubroutineCall 9 axpy () [((Var 9 a)) ((ArrayPhysicalCast (Var 9 x) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 9 y) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () ))] () .false. ) (Print (StringFormat () [(Var 9 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), op: (Requirement (SymbolTable 3 { op: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 4 b [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), op: (Variable 4 op [] ReturnVar () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) op (FunctionType [(TypeParameter t ) (TypeParameter u )] (TypeParameter v ) Source Interface () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 4 a) (Var 4 b)] [] (Var 4 op) Public .false. .true. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), u: (Variable 3 u [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 3 v [] In () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) op [t u v op] [] ) }) template_03_m () [template_03_m] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/wat-wasm_i64-3afdb24.stdout0000664000175000017500000001465215174404631023541 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param i64) (result i64))) (type (;3;) (func (param i64 i64) (result i64))) (type (;4;) (func (param) (result i64))) (type (;5;) (func (param) (result))) (type (;6;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param i64) (result i64) (local i64) local.get 0 local.get 0 i64.mul local.set 1 local.get 1 return ) (func $3 (type 3) (param i64 i64) (result i64) (local i64) local.get 0 local.get 1 i64.add local.set 2 local.get 2 return ) (func $4 (type 4) (param) (result i64) (local i64 i64 i64) i64.const 1000000000000 local.set 1 i64.const 2000000000000 local.set 2 local.get 1 local.get 2 call 3 local.set 0 local.get 0 return ) (func $5 (type 5) (param) (result) (local) i64.const 1000000 call 2 call 6 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i64.const 1000000000000 i64.const 1000000000000 call 3 call 6 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop call 4 call 6 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $6 (type 6) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "a_sqr_i64" (func 2)) (export "add_i64" (func 3)) (export "test_i64" (func 4)) (export "_start" (func 5)) (export "print_i64" (func 6)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-0.63.0/tests/reference/asr-global_scope1-786a363.stdout0000664000175000017500000000124415174404631024401 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) [] ) lfortran-0.63.0/tests/reference/llvm-format2-ed47ddb.stdout0000664000175000017500000000550715174404631023730 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [5 x i8] c"(3l3)" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data, i32 0, i32 0), i64 5 }> @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %stringFormat_desc = alloca %string_descriptor, align 8 %2 = call i8* @_lfortran_get_default_allocator() call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca i32, align 4 %3 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 %4 = alloca i64, align 8 %5 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* %3, i64 5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %4, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %a) %6 = load i64, i64* %4, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %5, i8** %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %6, i64* %8, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %10 = load i8*, i8** %9, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %12 = load i64, i64* %11, align 8 %13 = trunc i64 %12 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %10, i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %14 = icmp eq i8* %5, null br i1 %14, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free_alloc(i8* %2, i8* %5) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_format2 FINALIZE_SYMTABLE_format2: ; preds = %return call void @_lfortran_internal_alloc_finalize() ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) declare i8* @_lfortran_get_default_allocator() declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free_alloc(i8*, i8*) declare void @_lfortran_internal_alloc_finalize() lfortran-0.63.0/tests/reference/ast_f90-case_03-436c4e5.stdout0000664000175000017500000000107715174404631023644 0ustar alastairalastairprogram case03 implicit none ! local variable declaration integer :: marks integer, parameter :: a = 1, b = 2 marks = 94 select case (marks) case (40 + b:) print *, "Pass!" case (:39 - a) print *, "Failed!" case default print *, "Invalid marks" end select print *, "Your marks are ", marks marks = -1 select case (marks) case (40 + b:) print *, "Pass!" case (0:39 - a) print *, "Failed!" case default print *, "Invalid marks" end select print *, "Your marks are ", marks end program case03 lfortran-0.63.0/tests/reference/ast-print1-b2e5cea.json0000664000175000017500000000070715174404631023025 0ustar alastairalastair{ "basename": "ast-print1-b2e5cea", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/print1.f90", "infile_hash": "b39169477bbb20a9f0fc581832d539c45122fbc253e90314075c6581", "outfile": null, "outfile_hash": null, "stdout": "ast-print1-b2e5cea.stdout", "stdout_hash": "3e669d75e364de4c89b6e41164a18121f831e6d777d29c81665134b3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-fn5-3d75eb7.json0000664000175000017500000000067615174404631022155 0ustar alastairalastair{ "basename": "asr-fn5-3d75eb7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/fn5.f90", "infile_hash": "0f5a55688443ee8c8f4f70a1f78d616d25b3c2647bed1fd7ba267f51", "outfile": null, "outfile_hash": null, "stdout": "asr-fn5-3d75eb7.stdout", "stdout_hash": "259acaaf5d465317ab1f3690baaad07b89f63a4187abb0d21dbed06d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format_66-591179b.json0000664000175000017500000000071515174404631023142 0ustar alastairalastair{ "basename": "run-format_66-591179b", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_66.f90", "infile_hash": "c8bed1abeab6a2b00a199d05dfc31a33ffcaf57a212e4159f289d079", "outfile": null, "outfile_hash": null, "stdout": "run-format_66-591179b.stdout", "stdout_hash": "9a1368d97caf0d3997381db33ebadc4c22b5d88b61d10aa24fce56aa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-coarrays_01-2b1221b.stdout0000664000175000017500000005211115174404631024045 0ustar alastairalastair(TranslationUnit [(Program coarrays_01 (TriviaNode [(EndOfLine) (Comment "! This test should test most of coarray syntax:" ) (Comment "! * declarations" ) (Comment "! * allocations" ) (Comment "! * coarray operations" ) (Comment "!" ) (Comment "! You can test the syntax manually with GFortran by:" ) (Comment "! gfortran -fcoarray=lib -c coarrays_01.f90 -o a.o" ) (Comment "!" )] [] ) [(Use [] iso_fortran_env [(UseSymbol event_type () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Coarray Declarations" )] ) )] [(Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 100 DimensionExpr)] ) (AttrCodimension [(() () CodimensionStar)] )] [(A [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(B [] [(1 3 CodimensionExpr) (() () CodimensionStar)] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(c [] [(() () CodimensionStar)] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(D [(1 100 DimensionExpr) (1 2 DimensionExpr)] [(1 3 CodimensionExpr) (() () CodimensionStar)] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(E [(1 1 DimensionExpr) (1 2 DimensionExpr) (1 3 DimensionExpr)] [(1 1 CodimensionExpr) (1 2 CodimensionExpr) ((u- 1) 3 CodimensionExpr) (() () CodimensionStar)] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrAllocatable )] [(F [(() () DimensionExpr)] [(() () CodimensionExpr)] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrAllocatable )] [(g [(() () DimensionExpr) (() () DimensionExpr) (() () DimensionExpr)] [(() () CodimensionExpr) (() () CodimensionExpr) (() () CodimensionExpr)] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 20 DimensionExpr)] ) (AttrCodimension [(1 20 CodimensionExpr) (() () CodimensionStar)] )] [(h [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrCodimension [(() () CodimensionExpr)] ) (SimpleAttribute AttrAllocatable )] [(z [(() () DimensionExpr) (() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [] () () None ) [] [(r [(1 20 DimensionExpr)] [(1 20 CodimensionExpr) (0 () CodimensionStar)] () () None ())] () ) (Declaration (AttrType TypeType [] () event_type None ) [] [(ok_to_overwrite [] [(() () CodimensionStar)] () () None ())] () ) (Declaration (AttrType TypeType [] () event_type None ) [(SimpleAttribute AttrAllocatable )] [(greeting_ready [(() () DimensionExpr)] [(() () CodimensionExpr)] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (n [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Allocation" )] ) )] [(Assignment 0 n 5 () ) (Allocate 0 [(() (CoarrayRef F [] [(() n () 0)] [] [(() () 1 CodimensionStar)] [] ) () 0)] [] () ) (Allocate 0 [(() (CoarrayRef greeting_ready [] [(() (FuncCallOrArray num_images [] [] [] [] [] ) () 0)] [] [(() () 1 CodimensionStar)] [] ) () 0)] [] () ) (Allocate 0 [(() (CoarrayRef g [] [(() 50 () 0) (() 50 () 0) (() 50 () 0)] [] [(1 2 1 CodimensionExpr) (1 2 1 CodimensionExpr) (() () 1 CodimensionStar)] [] ) () 0)] [] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Array access, events, teams" )] ) ) (If 0 () (== (FuncCallOrArray this_image [] [] [] [] [] ) 1) [(DoLoop 0 () 0 i 2 (FuncCallOrArray num_images [] [] [] [] [] ) () [(Assignment 0 c (+ c (CoarrayRef c [] [] [] [(() i () CodimensionExpr)] [] )) () ) (EventPost 0 (CoarrayRef ok_to_overwrite [] [] [] [(() i () CodimensionExpr)] [] ) [] () )] () () )] [(EventWait 0 ok_to_overwrite [] () ) (EventPost 0 (CoarrayRef greeting_ready [] [(() (FuncCallOrArray this_image [] [] [] [] [] ) () 0)] [] [(() 1 () CodimensionExpr)] [] ) [] () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SyncAll 0 [] () ) (SyncAll 0 [] () ) (SyncAll 0 [(AttrStat status )] () ) (SyncAll 0 [(AttrErrmsg status )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (EventWait 0 variable [(AttrEventWaitKwArg until_count status )] () ) (EventWait 0 variable [(AttrEventWaitKwArg until_count status ) (AttrErrmsg status )] () ) (EventWait 0 variable [(AttrEventWaitKwArg errmsg status )] () ) (EventWait 0 variable [(AttrEventWaitKwArg stat status )] () ) (EventPost 0 (CoarrayRef done [] [(() (FuncCallOrArray sub [] [(() i () 0)] [] [] [] ) () 0)] [] [(() (FuncCallOrArray parent [] [(() i () 0)] [] [] [] ) () CodimensionExpr)] [] ) [(AttrStat status )] () ) (EventPost 0 variable [(AttrStat status )] () ) (EventPost 0 variable [(AttrErrmsg status )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 (FuncCallOrArray a [(s [])] [(() 3 () 0)] [] [(() 4 () 0)] [] ) (String "S" ()) () ) (Assignment 0 (CoarrayRef b [(s [])] [] [] [(() 3 () CodimensionExpr)] [] ) (CoarrayRef c [] [] [] [(() 4 () CodimensionExpr)] [] ) () ) (Assignment 0 (CoarrayRef c [(s [])] [(() 3 () 0)] [] [(() 4 () CodimensionExpr)] [] ) (CoarrayRef f [] [(() 3 () 0)] [] [(() 4 () CodimensionExpr)] [] ) () ) (Assignment 0 (CoarrayRef c [] [] [] [(() 3 () CodimensionExpr)] [] ) (CoarrayRef c [] [] [] [(() 4 () CodimensionExpr)] [] ) () ) (Assignment 0 (CoarrayRef B [] [] [] [(() 1 () CodimensionExpr) (() 2 () CodimensionExpr)] [] ) (CoarrayRef B [] [] [] [(() 3 () CodimensionExpr) (() 4 () CodimensionExpr)] [] ) () ) (Assignment 0 (CoarrayRef D [] [(() 99 () 0) (() 1 () 0)] [] [(() 3 () CodimensionExpr) (() 4 () CodimensionExpr)] [] ) (CoarrayRef D [] [(() 1 () 0) (() 2 () 0)] [] [(() 1 () CodimensionExpr) (() 2 () CodimensionExpr)] [] ) () ) (Assignment 0 (CoarrayRef D [] [(() 99 () 0) (() 1 () 0)] [] [(() 3 () CodimensionExpr) (() 3 () CodimensionExpr)] [] ) 5 () ) (Assignment 0 (CoarrayRef D [] [(() () 1 0) (() 1 () 0)] [] [(() 3 () CodimensionExpr) (() 3 () CodimensionExpr)] [] ) 5 () ) (Assignment 0 (CoarrayRef D [] [(() () 1 0) (() 1 () 0)] [] [(() 3 () CodimensionExpr) (() 3 () CodimensionExpr)] [(team 3)] ) 5 () ) (Assignment 0 (CoarrayRef D [] [(() () 1 0) (() 1 () 0)] [] [(() 3 () CodimensionExpr) (() 3 () CodimensionExpr)] [(team 3) (stat i)] ) 5 () ) (Assignment 0 (CoarrayRef D [] [(() () 1 0) (() 1 () 0)] [] [(() 3 () CodimensionExpr) (() 3 () CodimensionExpr)] [(stat i)] ) 5 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/asr-implicit7-9099c07.stdout0000664000175000017500000001740315174404631023577 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { a: (Variable 2 a [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 2 m [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), n: (Variable 2 n [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [m] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 m))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [m] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 m))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) a (FunctionType [(Real 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 n) (Var 2 m)] [(Assignment (Var 2 n) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) () ) () .false. .false. ) (Assignment (Var 2 m) (IntegerConstant 8 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (ArrayConstant 32 [1, 2, 3, ...., 6, 7, 8] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. )] (Var 2 a) Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/asr-flip_sign-a0cebd4.json0000664000175000017500000000074515174404631023556 0ustar alastairalastair{ "basename": "asr-flip_sign-a0cebd4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/flip_sign.f90", "infile_hash": "12739178c354710c6f6bbeb834508a7932ae385c1340b0c08bca8b8d", "outfile": null, "outfile_hash": null, "stdout": "asr-flip_sign-a0cebd4.stdout", "stdout_hash": "63d10a290f482b8ae0fd3427b55cc42f8e98535bc3cf4b056772005f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-if_04-7f1b69d.stdout0000664000175000017500000000703015174404631022732 0ustar alastairalastair(TranslationUnit [(Program if_04 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(Assignment 0 i 1 () ) (If 0 () (== i 1) [(Print 0 () [(String "1" ())] () )] [(If 0 () (== i 2) [(Print 0 () [(String "2" ())] () )] [(If 0 () (== i 3) [(Print 0 () [(String "3" ())] () )] [(If 0 () (== i 4) [(Print 0 () [(String "4" ())] () )] [] () () () )] () () () )] () () () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 name (== i 1) [(Print 0 () [(String "1" ())] () )] [(If 0 () (== i 2) [(Print 0 () [(String "2" ())] () )] [(If 0 () (== i 3) [(Print 0 () [(String "3" ())] () )] [(If 0 () (== i 4) [(Print 0 () [(String "4" ())] () )] [(Print 0 () [(String "Invalid!" ())] () )] () () () )] () () () )] () () () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/ast-complex_02-0f52aa7.stdout0000664000175000017500000000447315174404631023774 0ustar alastairalastair(TranslationUnit [(Program complex_02 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeComplex [] () () None ) [] [(x [] [] () () None ()) (z [] [] () () None ()) (w [] [] () () None ()) (i_ [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(a [] [] () () None ()) (b [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 x (Complex (Real "1.0") (u- (Real "3.0"))) () ) (Assignment 0 a (Real "3.0") () ) (Assignment 0 b (Real "4.0") () ) (Assignment 0 i_ (Complex 0 1) () ) (Assignment 0 z (+ a (* i_ b)) () ) (Assignment 0 w (+ (+ a b) (* i_ (- a b))) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [x z w] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor7-4734850.stdout0000664000175000017500000000316415174404631026671 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor7: (Program (SymbolTable 2 { }) preprocessor7 [] [(Print (StringFormat () [(IntegerConstant 1 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntegerConstant 4 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntegerConstant 4 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-operator_overloading_03-f7a6efe.json0000664000175000017500000000101715174404631026344 0ustar alastairalastair{ "basename": "asr-operator_overloading_03-f7a6efe", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/operator_overloading_03.f90", "infile_hash": "3340e64f6a134b16739a00f54087bb1816f1e6876ec32e6170275e19", "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_03-f7a6efe.stdout", "stdout_hash": "7c89c3f4a7bcf40f5513863835f20d12c2cc461b6066be5a3f401b90", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-expr_13-57b03a6.stdout0000664000175000017500000006225015174404631023222 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { flip_sign_dead_code: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ap: (Variable 2 ap [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 2 b [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), bp: (Variable 2 bp [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c: (Variable 2 c [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), cp: (Variable 2 cp [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), d: (Variable 2 d [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), dp: (Variable 2 dp [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), eps: (Variable 2 eps [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), number: (Variable 2 number [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) flip_sign_dead_code [] [(Assignment (Var 2 number) (IntegerConstant 123 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 5.500000 (Real 4) ) () .false. .false. ) (If () (IntegerCompare (IntrinsicElementalFunction Modulo [(Var 2 number) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4) ) (Real 4) (RealConstant -5.500000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 number) (IntegerConstant 124 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 5.500000 (Real 4) ) () .false. .false. ) (If () (IntegerCompare (IntrinsicElementalFunction Modulo [(Var 2 number) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 ap) Eq (Var 2 bp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "ap == bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (If () (RealCompare (Var 2 cp) Eq (Var 2 dp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "cp == dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (If () (IntegerCompare (Var 2 a) Eq (Var 2 b) (Logical 4) () ) [(Print (StringConstant "a == b" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (IntegerCompare (Var 2 ap) Eq (Var 2 bp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "ap == bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(If () (RealCompare (Cast (Var 2 ap) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) () ) Eq (Var 2 cp) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(Print (StringConstant "ap == cp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (RealCompare (Var 2 cp) Eq (Var 2 dp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "cp == dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(If () (RealCompare (Var 2 c) Eq (Var 2 d) (Logical 4) () ) [(Print (StringConstant "c == d" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] )] )] ) }) [] ) lfortran-0.63.0/tests/reference/ast-pragma2-dd5bd9b.stdout0000664000175000017500000000122215174404631023512 0ustar alastairalastair(TranslationUnit [(Program pragma2 () [] [] [(DeclarationPragma LFortranPragma "attributes simd :: A" () ) (Declaration (AttrType TypeReal [] () () None ) [] [(A [(1 8 DimensionExpr)] [] () () None ())] () )] [(Assignment 0 A 1 () )] [] )] ) lfortran-0.63.0/tests/reference/ast-modules_02-ed49715.stdout0000664000175000017500000000612615174404631023727 0ustar alastairalastair(TranslationUnit [(Module modules_02_a (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [(Subroutine b [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "b()" ())] () )] [] [] )] ) (Module modules_02_c (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [(Subroutine d [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "d()" ())] () )] [] [] ) (Subroutine e [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "e()" ())] () )] [] [] )] ) (Program modules_02 () [(Use [] modules_02_a [] .false. () ) (Use [] modules_02_c [(UseSymbol d x )] .true. () ) (Use [] modules_02_c [(UseSymbol e () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(SubroutineCall 0 b [] [] [] [] () ) (SubroutineCall 0 x [] [] [] [] () ) (SubroutineCall 0 e [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-0.63.0/tests/reference/asr-sizeof_01-9e0775c.stdout0000664000175000017500000000774115174404631023560 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), sizeof_01: (Program (SymbolTable 2 { c_int: (ExternalSymbol 2 c_int 4 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_size_t: (ExternalSymbol 2 c_size_t 4 c_size_t lfortran_intrinsic_iso_c_binding [] c_size_t Public ), s: (Variable 2 s [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) sizeof_01 [iso_c_binding] [(Assignment (Var 2 s) (SizeOfType (Integer 4) (Integer 8) (IntegerConstant 4 (Integer 8) Decimal) ) () .false. .false. ) (Print (StringFormat () [(Var 2 s)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-functions_04-ea50b75.json0000664000175000017500000000075615174404631023767 0ustar alastairalastair{ "basename": "asr-functions_04-ea50b75", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_04.f90", "infile_hash": "237775308ca559439958719781b889f95d15c69eb4126ff69abe6fb2", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_04-ea50b75.stdout", "stdout_hash": "bef1865f34e2d74bfac5f0ab7a654102378670962d46794743f4d487", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr_preprocess-preprocessor20-4100cdf.stdout0000664000175000017500000000366515174404631027155 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor20: (Program (SymbolTable 2 { }) preprocessor20 [] [(Print (StringFormat () [(StringConstant "PI: " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (RealConstant 3.140000 (Real 4) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "negative one: " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-loop_test2-82d82ea.stdout0000664000175000017500000006103415174404631024120 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { indx: (Variable 2 indx [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l1: (Variable 2 l1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), l2: (Variable 2 l2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), m: (Variable 2 m [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), nq: (Variable 2 nq [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), v: (Variable 2 v [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ve: (Variable 2 ve [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), vev: (Variable 2 vev [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), wrk5: (Variable 2 wrk5 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), zero: (Variable 2 zero [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(DoLoop () ((Var 2 l1) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nq) ()) [(DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 m) ()) [(Assignment (ArrayItem (Var 2 wrk5) [(() (Var 2 j) ())] (Real 4) ColMajor () ) (ArrayItem (Var 2 v) [(() (Var 2 indx) ()) (() (Var 2 j) ()) (() (Var 2 l1) ())] (Real 4) ColMajor () ) () .false. .false. ) (GoToTarget 110 110 )] [] ) (DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 m) ()) [(Assignment (ArrayItem (Var 2 ve) [(() (Var 2 indx) ()) (() (Var 2 l1) ()) (() (Var 2 j) ())] (Real 4) ColMajor () ) (ArrayItem (Var 2 wrk5) [(() (Var 2 j) ())] (Real 4) ColMajor () ) () .false. .false. ) (GoToTarget 120 120 )] [] ) (GoToTarget 140 140 )] [] ) (Assignment (Var 2 indx) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 zero) (Cast (RealConstant 0.000000 (Real 8) ) RealToReal (Real 4) (RealConstant 0.000000 (Real 4) ) () ) () .false. .false. ) (DoLoop () ((Var 2 l1) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nq) ()) [(DoLoop () ((Var 2 l2) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 l1) ()) [(Assignment (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4) ColMajor () ) (Var 2 zero) () .false. .false. ) (DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 m) ()) [(Assignment (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4) ColMajor () ) (RealBinOp (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4) ColMajor () ) Add (RealBinOp (ArrayItem (Var 2 ve) [(() (Var 2 indx) ()) (() (Var 2 l1) ()) (() (Var 2 j) ())] (Real 4) ColMajor () ) Mul (ArrayItem (Var 2 ve) [(() (Var 2 indx) ()) (() (Var 2 l2) ()) (() (Var 2 j) ())] (Real 4) ColMajor () ) (Real 4) () ) (Real 4) () ) () .false. .false. ) (GoToTarget 210 210 )] [] ) (Assignment (ArrayItem (Var 2 vev) [(() (Var 2 l2) ()) (() (Var 2 l1) ())] (Real 4) ColMajor () ) (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4) ColMajor () ) () .false. .false. ) (GoToTarget 220 220 )] [] ) (GoToTarget 230 230 )] [] ) (Return)] () Public .true. .true. () ) }) [] ) lfortran-0.63.0/tests/reference/run-array_bounds_check_07-f220d33.json0000664000175000017500000000074315174404631025535 0ustar alastairalastair{ "basename": "run-array_bounds_check_07-f220d33", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_07.f90", "infile_hash": "e41af0e94a994140f23d1bec748d4d21d0762f8500b3fa0ef54e18ca", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_07-f220d33.stderr", "stderr_hash": "c596925adde9d1e62a368cfc4d9e51537c9f524a7a54d41cd8fe26d1", "returncode": 1 }lfortran-0.63.0/tests/reference/asr-intrinsics_10-cfca9b9.json0000664000175000017500000000076115174404631024305 0ustar alastairalastair{ "basename": "asr-intrinsics_10-cfca9b9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_10.f90", "infile_hash": "574d28f0c6b85cf1bd1263ef8530e069cbe07753791f9e8bec6d939e", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_10-cfca9b9.stdout", "stdout_hash": "a6065d170a7f456e1e343cfeabccd039437849fb4849e56c625d6a93", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-implied_do_loops10-3298b64.stdout0000664000175000017500000000534515174404631025361 0ustar alastairalastair(TranslationUnit [(Program implied_do_loop10 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (DerivedType col [] () [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(rgb [(1 3 DimensionExpr)] [] () () None ())] () )] [] ) (Declaration (AttrType TypeType [] () col None ) [] [(colours [] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [(DataImpliedDo [(FuncCallOrArray rgb [(colours [])] [(() i () 0)] [] [] [] )] () i 1 3 () )] [1 2 3] )] () ) (Print 0 () [(String "colours%rgb : " ()) rgb [(colours [])]] () ) (If 0 () (FuncCallOrArray any [] [(() (/= rgb [(colours [])] (ArrayInitializer () () [1 2 3] )) () 0)] [] [] [] ) [(ErrorStop 0 () () () )] [] () () () )] [] )] ) lfortran-0.63.0/tests/reference/ast-attributes1-9309f25.json0000664000175000017500000000072615174404631023573 0ustar alastairalastair{ "basename": "ast-attributes1-9309f25", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/attributes1.f90", "infile_hash": "895bd51041a1a5b92a95e7ae70f7475a5b305fdd6f8fcd525a30f46a", "outfile": null, "outfile_hash": null, "stdout": "ast-attributes1-9309f25.stdout", "stdout_hash": "6dd04b5bce018bd05d59df51935160092117d85e8a87217d79f1d467", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-select_type_03-f21585a.stdout0000664000175000017500000011404015174404631024562 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { class_default_select_type: (Module (SymbolTable 4 { enum_stat: (Struct (SymbolTable 5 { fatal: (Variable 5 fatal [] Local (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (IntegerConstant -1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), success: (Variable 5 success [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) enum_stat (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) [] [success fatal] [] Source Public .false. .false. [] () () [] ), toml_stat: (Variable 4 toml_stat [] Local (StructConstant 4 enum_stat [((IntegerConstant 0 (Integer 4) Decimal)) ((IntegerConstant -1 (Integer 4) Decimal))] (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) ) (StructConstant 4 enum_stat [((IntegerConstant 0 (Integer 4) Decimal)) ((IntegerConstant -1 (Integer 4) Decimal))] (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) ) Parameter (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) 4 enum_stat Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) class_default_select_type () [] .true. .false. .false. ), class_default_select_type_user: (Module (SymbolTable 2 { 1_enum_stat: (ExternalSymbol 2 1_enum_stat 4 enum_stat class_default_select_type [] enum_stat Public ), check_table: (Function (SymbolTable 9 { tab: (Variable 9 tab [] Out () () Default (StructType [(Logical 4) (Logical 4)] [] .false. .false. ) 2 toml_table Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) check_table (FunctionType [(StructType [(Logical 4) (Logical 4)] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 tab)] [(Print (StringConstant "inside check_table" (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), get_table: (Function (SymbolTable 8 { ptr: (Variable 8 ptr [] Out () () Default (Pointer (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) 2 toml_table Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), stat: (Variable 8 stat [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. NotMethod () 0 ), table: (Variable 8 table [] InOut () () Default (StructType [(Logical 4) (Logical 4)] [] .false. .false. ) 2 toml_table Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), tmp: (Variable 8 tmp [] Local () () Default (Pointer (StructType [(Integer 4) (Real 4)] [] .false. .false. ) ) 2 toml_value Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ~select_type_block_: (Block (SymbolTable 10 { 1_enum_stat_success: (ExternalSymbol 10 1_enum_stat_success 5 success 1_enum_stat [] success Public ) }) ~select_type_block_ [(Associate (Var 8 ptr) (Cast (Var 8 tmp) ClassToStruct (Pointer (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) () (Var 2 toml_table) ) ) (If () (IntrinsicElementalFunction Present [(Var 8 stat)] 0 (Logical 4) () ) [(Assignment (Var 8 stat) (StructInstanceMember (Var 2 toml_stat) 10 1_enum_stat_success (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) ) () .false. .false. )] [] )] ), ~select_type_block_1: (Block (SymbolTable 11 { 1_enum_stat_fatal: (ExternalSymbol 11 1_enum_stat_fatal 5 fatal 1_enum_stat [] fatal Public ) }) ~select_type_block_1 [(If () (IntrinsicElementalFunction Present [(Var 8 stat)] 0 (Logical 4) () ) [(Assignment (Var 8 stat) (StructInstanceMember (Var 2 toml_stat) 11 1_enum_stat_fatal (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) () .false. .false. )] [] )] ) }) get_table (FunctionType [(StructType [(Logical 4) (Logical 4)] [] .false. .false. ) (Pointer (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [check_table] [(Var 8 table) (Var 8 ptr) (Var 8 stat)] [(Nullify [(Var 8 ptr)] ) (If () (PointerAssociated (Var 8 tmp) () (Logical 4) () ) [(SelectType (Var 8 tmp) () [(TypeStmtName 2 toml_table [(BlockCall -1 8 ~select_type_block_ )] )] [(BlockCall -1 8 ~select_type_block_1 )] )] [(SubroutineCall 2 check_table () [((Var 8 table))] () .false. )] )] () Public .true. .true. () ), toml_stat: (ExternalSymbol 2 toml_stat 4 toml_stat class_default_select_type [] toml_stat Public ), toml_table: (Struct (SymbolTable 7 { implicit: (Variable 7 implicit [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), inline: (Variable 7 inline [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_table (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) [] [implicit inline] [] Source Public .false. .false. [] () 2 toml_value [] ), toml_value: (Struct (SymbolTable 6 { float: (Variable 6 float [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), int: (Variable 6 int [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) toml_value (StructType [(Integer 4) (Real 4)] [] .true. .false. ) [] [int float] [] Source Public .false. .false. [] () () [] ) }) class_default_select_type_user () [class_default_select_type] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-parameter_without_start_program-a99ac57.stdout0000664000175000017500000000055215174404631030542 0ustar alastairalastair(TranslationUnit [(Program __xx_main () [] [] [(Declaration () [(SimpleAttribute AttrParameter )] [(x [] [] () 10 Equal ())] () )] [] [] )] ) lfortran-0.63.0/tests/reference/asr-intrinsics_30-93f854c.json0000664000175000017500000000076115174404631024074 0ustar alastairalastair{ "basename": "asr-intrinsics_30-93f854c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_30.f90", "infile_hash": "f636055c273f8322c7536fbd9f338d63e85049bfbbe6b2499e78c92b", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_30-93f854c.stdout", "stdout_hash": "14372ff67d80edae922188de02b6f569ffe4614e10f2b7984bfd1dce", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-program_cmake_01-a9e6179.json0000664000175000017500000000077215174404631024516 0ustar alastairalastair{ "basename": "asr-program_cmake_01-a9e6179", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/program_cmake_01.f90", "infile_hash": "0e854d9b2ed613d6193d78290dc20a45ec66f60ab17e1c0229c3febe", "outfile": null, "outfile_hash": null, "stdout": "asr-program_cmake_01-a9e6179.stdout", "stdout_hash": "ab5531bd4c5cfcc429da69414d2ead8fc1faf72006823340a3cb23f6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-program_without_line_02-87b589b.json0000664000175000017500000000100115174404631026140 0ustar alastairalastair{ "basename": "ast-program_without_line_02-87b589b", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/program_without_line_02.f90", "infile_hash": "6d670e40b054653f92f57d8ae62f7499e30ae097dcea518f9d72a683", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-program_without_line_02-87b589b.stderr", "stderr_hash": "62705339ec315e9b82440933301be77473f956cdcf9d4b9623d0b69c", "returncode": 2 }lfortran-0.63.0/tests/reference/asr-modules_32-ca5fb91.stdout0000664000175000017500000004074215174404631024062 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fpm_targets: (Module (SymbolTable 2 { build_target_ptr: (Struct (SymbolTable 3 { ptr: (Variable 3 ptr [] Local (PointerNullConstant (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Var 3 ptr) ) (PointerNullConstant (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Var 3 ptr) ) Default (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 2 build_target_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) build_target_ptr (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [build_target_t] [ptr] [] Source Public .false. .false. [] () () [] ), build_target_t: (Struct (SymbolTable 4 { output_file: (Variable 4 output_file [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), version: (Variable 4 version [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) build_target_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [output_file version] [] Source Public .false. .false. [] () () [] ), func: (Function (SymbolTable 5 { target_ptr: (Variable 5 target_ptr [] ReturnVar () () Default (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 2 build_target_t Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) func (FunctionType [] (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Associate (Var 5 target_ptr) (PointerNullConstant (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Var 5 target_ptr) ) )] (Var 5 target_ptr) Public .true. .true. () ) }) fpm_targets () [] .false. .false. .false. ), modules_32: (Program (SymbolTable 6 { }) modules_32 [] [(Print (StringConstant "running modules_32 program" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-0.63.0/tests/reference/cpp-subroutine6-b93ebd0.json0000664000175000017500000000071115174404631024005 0ustar alastairalastair{ "basename": "cpp-subroutine6-b93ebd0", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/subroutine6.f90", "infile_hash": "1987bc648e7f4c6205190248a296d000e0f33cb57a996b6c2a6c4804", "outfile": null, "outfile_hash": null, "stdout": "cpp-subroutine6-b93ebd0.stdout", "stdout_hash": "69692d04601469d0f06a1fb96d6da8103496de4040382eca2206dbf9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-global_scope4-1af6ab9.stdout0000664000175000017500000000223315174404631024613 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () )] ) lfortran-0.63.0/tests/reference/ast-infer_global_scope_file_01-1659622.stdout0000664000175000017500000000060215174404631026716 0ustar alastairalastair(TranslationUnit [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () ) (Assignment 0 x 5 () ) (Print 0 () [x] () )] ) lfortran-0.63.0/tests/reference/asr-submodule_02-9152b7b.stdout0000664000175000017500000013062315174404631024245 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), points: (Module (SymbolTable 7 { point: (Struct (SymbolTable 8 { x: (Variable 8 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 8 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) point (StructType [(Real 4) (Real 4)] [] .true. .false. ) [] [x y] [] Source Public .false. .false. [] () () [] ), point_dist_func: (Function (SymbolTable 9 { a: (Variable 9 a [] In () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 7 point Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 9 b [] In () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 7 point Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), distance: (Variable 9 distance [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) point_dist_func (FunctionType [(StructType [(Real 4) (Real 4)] [] .true. .false. ) (StructType [(Real 4) (Real 4)] [] .true. .false. )] (Real 4) Source Interface () .false. .false. .true. .false. .false. [] .false. ) [] [(Var 9 a) (Var 9 b)] [] (Var 9 distance) Public .false. .false. () ), point_dist_subrout: (Function (SymbolTable 10 { a: (Variable 10 a [] In () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 7 point Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 10 b [] In () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 7 point Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), distance: (Variable 10 distance [] Out () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) point_dist_subrout (FunctionType [(StructType [(Real 4) (Real 4)] [] .true. .false. ) (StructType [(Real 4) (Real 4)] [] .true. .false. ) (Real 4)] () Source Interface () .false. .false. .true. .false. .false. [] .false. ) [] [(Var 10 a) (Var 10 b) (Var 10 distance)] [] () Public .false. .false. () ), rkind: (ExternalSymbol 7 rkind 4 real32 lfortran_intrinsic_iso_fortran_env [] real32 Public ) }) points () [stdlib_kinds_submodule_02] .false. .false. .true. ), points_a: (Module (SymbolTable 11 { point: (ExternalSymbol 11 point 7 point points [] point Public ), point_dist_func: (Function (SymbolTable 12 { 1_point_x: (ExternalSymbol 12 1_point_x 8 x point [] x Public ), 1_point_y: (ExternalSymbol 12 1_point_y 8 y point [] y Public ), a: (Variable 12 a [] In () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 11 point Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 12 b [] In () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 11 point Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), distance: (Variable 12 distance [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) point_dist_func (FunctionType [(StructType [(Real 4) (Real 4)] [] .true. .false. ) (StructType [(Real 4) (Real 4)] [] .true. .false. )] (Real 4) Source Implementation () .false. .false. .true. .false. .false. [] .false. ) [] [(Var 12 a) (Var 12 b)] [(Assignment (Var 12 distance) (IntrinsicElementalFunction Sqrt [(RealBinOp (RealBinOp (RealBinOp (StructInstanceMember (Var 12 a) 12 1_point_x (Real 4) () ) Sub (StructInstanceMember (Var 12 b) 12 1_point_x (Real 4) () ) (Real 4) () ) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) Add (RealBinOp (RealBinOp (StructInstanceMember (Var 12 a) 12 1_point_y (Real 4) () ) Sub (StructInstanceMember (Var 12 b) 12 1_point_y (Real 4) () ) (Real 4) () ) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) (Real 4) () )] 0 (Real 4) () ) () .false. .false. )] (Var 12 distance) Public .true. .true. () ), point_dist_subrout: (Function (SymbolTable 13 { 1_point_x: (ExternalSymbol 13 1_point_x 8 x point [] x Public ), 1_point_y: (ExternalSymbol 13 1_point_y 8 y point [] y Public ), a: (Variable 13 a [] In () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 11 point Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), b: (Variable 13 b [] In () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 11 point Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), distance: (Variable 13 distance [] Out () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) point_dist_subrout (FunctionType [(StructType [(Real 4) (Real 4)] [] .true. .false. ) (StructType [(Real 4) (Real 4)] [] .true. .false. ) (Real 4)] () Source Implementation () .false. .false. .true. .false. .false. [] .false. ) [] [(Var 13 a) (Var 13 b) (Var 13 distance)] [(Assignment (Var 13 distance) (IntrinsicElementalFunction Sqrt [(RealBinOp (RealBinOp (RealBinOp (StructInstanceMember (Var 13 a) 13 1_point_x (Real 4) () ) Sub (StructInstanceMember (Var 13 b) 13 1_point_x (Real 4) () ) (Real 4) () ) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) Add (RealBinOp (RealBinOp (StructInstanceMember (Var 13 a) 13 1_point_y (Real 4) () ) Sub (StructInstanceMember (Var 13 b) 13 1_point_y (Real 4) () ) (Real 4) () ) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) (Real 4) () )] 0 (Real 4) () ) () .false. .false. )] () Public .true. .true. () ), rkind: (ExternalSymbol 11 rkind 4 real32 lfortran_intrinsic_iso_fortran_env [] real32 Public ) }) points_a points [points stdlib_kinds_submodule_02] .false. .false. .false. ), stdlib_kinds_submodule_02: (Module (SymbolTable 2 { int32: (ExternalSymbol 2 int32 4 int32 lfortran_intrinsic_iso_fortran_env [] int32 Public ), rkind1: (ExternalSymbol 2 rkind1 4 real32 lfortran_intrinsic_iso_fortran_env [] real32 Public ) }) stdlib_kinds_submodule_02 () [iso_fortran_env] .false. .false. .false. ), submodules_02: (Program (SymbolTable 14 { }) submodules_02 [] [] ) }) [] ) lfortran-0.63.0/tests/reference/llvm-expr1-03e6c2a.json0000664000175000017500000000070715174404631022667 0ustar alastairalastair{ "basename": "llvm-expr1-03e6c2a", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/expr1.f90", "infile_hash": "3c49cb3157ec3feaf0f97156e5c11dca0ffd6481c97bb1a5dffaa14f", "outfile": null, "outfile_hash": null, "stdout": "llvm-expr1-03e6c2a.stdout", "stdout_hash": "aa54d7427435a140bfea2d83deb34b8e3a668a042c38fc7953f0e090", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_check-32a1dba.stdout0000664000175000017500000000053315174404631025032 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { }) main [] [] ) }) [] ) lfortran-0.63.0/tests/reference/asr-template_simple_02-35381bd.json0000664000175000017500000000100015174404631025041 0ustar alastairalastair{ "basename": "asr-template_simple_02-35381bd", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_simple_02.f90", "infile_hash": "c0588c6676de96e6fa5c9b2a4889eb393e900f8dbb27a68f463e14fd", "outfile": null, "outfile_hash": null, "stdout": "asr-template_simple_02-35381bd.stdout", "stdout_hash": "21a97e4b19f6417c7af133a23364175481931607b25bcd10841fbf53", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/wat-logical3-ce72150.stdout0000664000175000017500000003062715174404631023446 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i32) i32.const 1 local.set 0 i32.const 0 local.set 1 local.get 0 local.get 1 i32.and if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else i32.const 1 i32.const 264 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop end local.get 0 local.get 1 i32.or if i32.const 1 i32.const 300 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 336 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable end local.get 0 local.get 1 i32.xor if i32.const 1 i32.const 372 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 408 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable end i32.const 0 local.set 0 i32.const 1 local.set 1 local.get 0 local.get 1 i32.and i32.eqz if i32.const 1 i32.const 448 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 484 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable end local.get 1 local.get 0 i32.xor if i32.const 1 i32.const 520 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 556 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable end local.get 1 local.get 0 i32.eq if i32.const 1 i32.const 592 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else i32.const 1 i32.const 628 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop end i32.const 1 local.set 0 i32.const 1 local.set 1 local.get 0 local.get 1 i32.and if i32.const 1 i32.const 664 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 700 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable end local.get 0 local.get 1 i32.or if i32.const 1 i32.const 736 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 772 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable end local.get 0 local.get 1 i32.xor if i32.const 1 i32.const 808 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else i32.const 1 i32.const 848 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop end i32.const 0 call 0 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\1a\00\00\00") (data (;35;) (i32.const 216) "Line 1 - Condition is true ") (data (;36;) (i32.const 244) "\fc\00\00\00\0b\00\00\00") (data (;37;) (i32.const 252) "ERROR STOP\n ") (data (;38;) (i32.const 264) "\10\01\00\00\1b\00\00\00") (data (;39;) (i32.const 272) "Line 1 - Condition is false ") (data (;40;) (i32.const 300) "\34\01\00\00\1a\00\00\00") (data (;41;) (i32.const 308) "Line 2 - Condition is true ") (data (;42;) (i32.const 336) "\58\01\00\00\1b\00\00\00") (data (;43;) (i32.const 344) "Line 2 - Condition is false ") (data (;44;) (i32.const 372) "\7c\01\00\00\1c\00\00\00") (data (;45;) (i32.const 380) "Line xor - Condition is true") (data (;46;) (i32.const 408) "\a0\01\00\00\1d\00\00\00") (data (;47;) (i32.const 416) "Line xor - Condition is false ") (data (;48;) (i32.const 448) "\c8\01\00\00\1a\00\00\00") (data (;49;) (i32.const 456) "Line 3 - Condition is true ") (data (;50;) (i32.const 484) "\ec\01\00\00\1b\00\00\00") (data (;51;) (i32.const 492) "Line 3 - Condition is false ") (data (;52;) (i32.const 520) "\10\02\00\00\1a\00\00\00") (data (;53;) (i32.const 528) "Line 4 - Condition is true ") (data (;54;) (i32.const 556) "\34\02\00\00\1b\00\00\00") (data (;55;) (i32.const 564) "Line 4 - Condition is false ") (data (;56;) (i32.const 592) "\58\02\00\00\1a\00\00\00") (data (;57;) (i32.const 600) "Line 5 - Condition is true ") (data (;58;) (i32.const 628) "\7c\02\00\00\1b\00\00\00") (data (;59;) (i32.const 636) "Line 5 - Condition is false ") (data (;60;) (i32.const 664) "\a0\02\00\00\1a\00\00\00") (data (;61;) (i32.const 672) "Line 6 - Condition is true ") (data (;62;) (i32.const 700) "\c4\02\00\00\1b\00\00\00") (data (;63;) (i32.const 708) "Line 6 - Condition is false ") (data (;64;) (i32.const 736) "\e8\02\00\00\1a\00\00\00") (data (;65;) (i32.const 744) "Line 7 - Condition is true ") (data (;66;) (i32.const 772) "\0c\03\00\00\1b\00\00\00") (data (;67;) (i32.const 780) "Line 7 - Condition is false ") (data (;68;) (i32.const 808) "\30\03\00\00\1e\00\00\00") (data (;69;) (i32.const 816) "Line 8 xor - Condition is true ") (data (;70;) (i32.const 848) "\58\03\00\00\1f\00\00\00") (data (;71;) (i32.const 856) "Line 8 xor - Condition is false ") ) lfortran-0.63.0/tests/reference/ast-complex3-001609d.json0000664000175000017500000000103415174404631023031 0ustar alastairalastair{ "basename": "ast-complex3-001609d", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/complex3.f90", "infile_hash": "29dfe84a66828ae3a5d79a29bb69d3fc83483f69e38a065f73773ca2", "outfile": null, "outfile_hash": null, "stdout": "ast-complex3-001609d.stdout", "stdout_hash": "9d4f9a9064017ecea50bb9b30751e4bc47092f00ea2fedf5f8fcdbb8", "stderr": "ast-complex3-001609d.stderr", "stderr_hash": "75638547efd9f494772ccf5e50d6be0bba3619d62d3004a9c6dcb288", "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_04-524ec3a.json0000664000175000017500000000076115174404631024136 0ustar alastairalastair{ "basename": "asr-intrinsics_04-524ec3a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_04.f90", "infile_hash": "1e045fd457f9f94ff18fafe47e159dd705201527893232761f0d06e8", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_04-524ec3a.stdout", "stdout_hash": "f3aae7b9f0e0ae52d5aff1f0fb08dca602fea58b78c2830a92d316d0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-expr7-68a8628.stdout0000664000175000017500000000011415174404631022736 0ustar alastairalastair(TranslationUnit [5_int32 5_int64 5_l 5__l_3 5__l_3_] ) lfortran-0.63.0/tests/reference/asr-template_array_04-ed63449.stdout0000664000175000017500000015761415174404631025301 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 9 { default_behavior: (ExternalSymbol 9 default_behavior 2 default_behavior reverse_m [] default_behavior Public ), reverse_tmpl: (ExternalSymbol 9 reverse_tmpl 2 reverse_tmpl reverse_m [] reverse_tmpl Public ), test_reverse: (ExternalSymbol 9 test_reverse 2 test_reverse reverse_m [] test_reverse Public ) }) main [reverse_m] [(SubroutineCall 9 test_reverse () [] () .false. )] ), reverse_m: (Module (SymbolTable 2 { default_behavior: (Requirement (SymbolTable 3 { t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) default_behavior [t] [] ), reverse_tmpl: (Template (SymbolTable 4 { reverse: (Function (SymbolTable 6 { arr: (Variable 6 arr [] InOut () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 6 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 6 j [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) reverse (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [swap] [(Var 6 arr)] [(DoLoop () ((Var 6 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerBinOp (ArraySize (Var 6 arr) () (Integer 4) () ) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) ()) [(Assignment (Var 6 j) (IntegerBinOp (IntegerBinOp (ArraySize (Var 6 arr) () (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (Var 6 i) (Integer 4) () ) () .false. .false. ) (SubroutineCall 4 swap () [((ArrayItem (Var 6 arr) [(() (Var 6 i) ())] (TypeParameter t ) ColMajor () )) ((ArrayItem (Var 6 arr) [(() (Var 6 j) ())] (TypeParameter t ) ColMajor () ))] () .false. )] [] )] () Public .true. .true. () ), swap: (Function (SymbolTable 5 { tmp: (Variable 5 tmp [] Local () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 5 x [] InOut () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 5 y [] InOut () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) swap (FunctionType [(TypeParameter t ) (TypeParameter t )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x) (Var 5 y)] [(Assignment (Var 5 tmp) (Var 5 x) () .false. .false. ) (Assignment (Var 5 x) (Var 5 y) () .false. .false. ) (Assignment (Var 5 y) (Var 5 tmp) () .false. .false. )] () Private .true. .true. () ), t: (Variable 4 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) reverse_tmpl [t] [(Require default_behavior [t] )] ), test_reverse: (Function (SymbolTable 7 { __asr_swap: (Function (SymbolTable 10 { tmp: (Variable 10 tmp [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 10 x [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 10 y [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) __asr_swap (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 x) (Var 10 y)] [(Assignment (Var 10 tmp) (Var 10 x) () .false. .false. ) (Assignment (Var 10 x) (Var 10 y) () .false. .false. ) (Assignment (Var 10 y) (Var 10 tmp) () .false. .false. )] () Private .true. .true. () ), a: (Variable 7 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), ireverse: (Function (SymbolTable 8 { arr: (Variable 8 arr [] InOut () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), i: (Variable 8 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ), j: (Variable 8 j [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) ireverse (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [__asr_swap] [(Var 8 arr)] [(DoLoop () ((Var 8 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerBinOp (ArraySize (Var 8 arr) () (Integer 4) () ) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) ()) [(Assignment (Var 8 j) (IntegerBinOp (IntegerBinOp (ArraySize (Var 8 arr) () (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (Var 8 i) (Integer 4) () ) () .false. .false. ) (SubroutineCall 7 __asr_swap () [((ArrayItem (Var 8 arr) [(() (Var 8 i) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 8 arr) [(() (Var 8 j) ())] (Integer 4) ColMajor () ))] () .false. )] [] )] () Public .true. .true. () ) }) test_reverse (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 7 a) (ArrayConstant 20 [1, 2, 3, 4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (SubroutineCall 7 ireverse () [((ArrayPhysicalCast (Var 7 a) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () ))] () .false. ) (Print (StringFormat () [(Var 7 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayItem (Var 7 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 7 a) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] () Public .false. .false. () ) }) reverse_m () [] .false. .false. .false. ) }) [] ) lfortran-0.63.0/tests/reference/ast-associate1-2443d15.json0000664000175000017500000000072315174404631023342 0ustar alastairalastair{ "basename": "ast-associate1-2443d15", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/associate1.f90", "infile_hash": "1f90b3ef799fb354098ee524279bb2b71bf3813b43f2269fb014ec0d", "outfile": null, "outfile_hash": null, "stdout": "ast-associate1-2443d15.stdout", "stdout_hash": "dbea42dbd5c861f08fccd9b1c0a0f8f8e00eee3a5a671ff65ecdd525", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-data1-01ffd6c.stdout0000664000175000017500000000324215174404631023551 0ustar alastairalastairprogram data1 type :: person integer :: age character(len=20) :: fullname end type person character(len=10) :: myname integer, dimension(0:9) :: miles real, dimension(100,100) :: skew type(person) :: yourname real(8), parameter :: sin3 = sin(3.d0) real(8), parameter :: cos3 = cos(3.d0) real(8) :: s(10) integer :: iarx(3,1), iary(3,1) data myname/"xyz"/, miles/0, 0, 0, 0, 0, 0, 0, 0, 0, 0/ data yourname%age, yourname%fullname/35, "abc"/ data ((skew(k, j), j = 1, k), integer(4) :: k = 1, 10)/0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0/ data ((skew(k, j), j = 1, k, k), integer(4) :: k = 1, 100, 2)/0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0/ data ((skew(k, j), j = k + 1, 10), k = 1, 3)/1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0/ data ((skew(k, j), j = k + 1, 10, k), k = 1, 3, 1)/1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0/ data s/1.d0, -1.d0, 0.d0, 0.d0, 0.d0, -1.d0, sin3, cos3, 0.d0, -1.d0/ print *, "Your name is: ", yourname%fullname print *, "Your age is: ", yourname%age data (iarx(i, 1), iary(i, 1), i = 1, 3)/1, 9, 1950, 1350, 4350, 4/ print *, "My name is: ", myname data (iary(i, 1), i = 1, 3)/1, 9, 1950/ end program data1 lfortran-0.63.0/tests/reference/ast-implicit1-e201262.stdout0000664000175000017500000005347315174404631023557 0ustar alastairalastair(TranslationUnit [(Program implicit1 (TriviaNode [(EndOfLine) (Comment "! AST only" )] [] ) [] [(ImplicitNone [] () ) (ImplicitNone [] () ) (ImplicitNone [] () ) (ImplicitNone [(ImplicitNoneExternal 0 )] () ) (ImplicitNone [(ImplicitNoneType)] () ) (ImplicitNone [(ImplicitNoneExternal 0 ) (ImplicitNoneType)] () ) (ImplicitNone [(ImplicitNoneType) (ImplicitNoneExternal 0 )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Implicit [(ImplicitSpec (AttrType TypeReal [] () () None ) [(LetterSpec a h ) (LetterSpec o z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeReal [(() dp Value)] () () None ) [(LetterSpec a h ) (LetterSpec o z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeReal [(() 8 Value)] () () None ) [(LetterSpec a h ) (LetterSpec o z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeReal [(() 8 Value)] () () None ) [(LetterSpec a h ) (LetterSpec o z )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Implicit [(ImplicitSpec (AttrType TypeDoublePrecision [] () () None ) [(LetterSpec a h ) (LetterSpec o z )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Implicit [(ImplicitSpec (AttrType TypeCharacter [] () () None ) [(LetterSpec () c ) (LetterSpec o z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeCharacter [(() id Value)] () () None ) [(LetterSpec a z )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Implicit [(ImplicitSpec (AttrType TypeInteger [] () () None ) [(LetterSpec i n )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeInteger [] () () None ) [(LetterSpec () i ) (LetterSpec () j ) (LetterSpec () k ) (LetterSpec () l ) (LetterSpec () m ) (LetterSpec () n )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeInteger [] () () None ) [(LetterSpec () i ) (LetterSpec j l ) (LetterSpec () m ) (LetterSpec () n )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeInteger [(() dp Value)] () () None ) [(LetterSpec a h ) (LetterSpec o z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeInteger [(() 8 Value)] () () None ) [(LetterSpec () i ) (LetterSpec j l ) (LetterSpec () m ) (LetterSpec () n )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeInteger [] () () None ) [(LetterSpec () A ) (LetterSpec () C )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeInteger [(() 4 Value)] () () None ) [(LetterSpec () C ) (LetterSpec D x )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeInteger [(() 4 Value)] () () None ) [(LetterSpec () C ) (LetterSpec D x )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Implicit [(ImplicitSpec (AttrType TypeLogical [] () () None ) [(LetterSpec () l ) (LetterSpec u z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeLogical [(() dp Value)] () () None ) [(LetterSpec a h ) (LetterSpec o z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeLogical [(() 4 Value)] () () None ) [(LetterSpec () l ) (LetterSpec u z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeLogical [(() 4 Value)] () () None ) [(LetterSpec () l ) (LetterSpec u z )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Implicit [(ImplicitSpec (AttrType TypeComplex [] () () None ) [(LetterSpec () z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeComplex [(() dp Value)] () () None ) [(LetterSpec a h ) (LetterSpec o z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeComplex [] () () None ) [(LetterSpec () C )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeComplex [(() 4 Value)] () () None ) [(LetterSpec () z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeComplex [(() 4 Value)] () () None ) [(LetterSpec () z )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Implicit [(ImplicitSpec (AttrType TypeType [] () BLOB None ) [(LetterSpec () A )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeClass [] () X None ) [(LetterSpec A b )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Implicit [(ImplicitSpec (AttrType TypeReal [(kind 4 Value)] () () None ) [(LetterSpec () a )] ) (ImplicitSpec (AttrType TypeReal [(() (+ 4 4) Value)] () () None ) [(LetterSpec () b )] ) (ImplicitSpec (AttrType TypeReal [(() d Value)] () () None ) [(LetterSpec () d )] ) (ImplicitSpec (AttrType TypeReal [(() (FuncCallOrArray d [] [(() 2 () 0)] [] [] [] ) Value)] () () None ) [(LetterSpec a z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeInteger [(kind 4 Value)] () () None ) [(LetterSpec () a )] ) (ImplicitSpec (AttrType TypeInteger [(() (+ 4 4) Value)] () () None ) [(LetterSpec () b )] ) (ImplicitSpec (AttrType TypeInteger [(() d Value)] () () None ) [(LetterSpec () d )] ) (ImplicitSpec (AttrType TypeInteger [(() (FuncCallOrArray d [] [(() 2 () 0)] [] [] [] ) Value)] () () None ) [(LetterSpec a z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeLogical [(kind 4 Value)] () () None ) [(LetterSpec () a )] ) (ImplicitSpec (AttrType TypeLogical [(() (+ 4 4) Value)] () () None ) [(LetterSpec () b )] ) (ImplicitSpec (AttrType TypeLogical [(() d Value)] () () None ) [(LetterSpec () d )] ) (ImplicitSpec (AttrType TypeLogical [(() (FuncCallOrArray d [] [(() 2 () 0)] [] [] [] ) Value)] () () None ) [(LetterSpec a z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeComplex [(kind 4 Value)] () () None ) [(LetterSpec () a )] ) (ImplicitSpec (AttrType TypeComplex [(() (+ 4 4) Value)] () () None ) [(LetterSpec () b )] ) (ImplicitSpec (AttrType TypeComplex [(() d Value)] () () None ) [(LetterSpec () d )] ) (ImplicitSpec (AttrType TypeComplex [(() (FuncCallOrArray d [] [(() 2 () 0)] [] [] [] ) Value)] () () None ) [(LetterSpec a z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeCharacter [(kind c_char Value) (len 4 Value)] () () None ) [(LetterSpec () a )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeCharacter [(len 4 Value) (kind c_char Value)] () () None ) [(LetterSpec () a )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeCharacter [(kind c_char Value)] () () None ) [(LetterSpec () a )] )] (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) )] [] [] [] )] ) lfortran-0.63.0/tests/reference/llvm-external_02-99f90be.stdout0000664000175000017500000000176415174404631024354 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" target datalayout = "..." define void @cobyla(void (double*)* %calcfc) { .entry: call void @cobylb(void (double*)* %calcfc) br label %return unreachable_after_return: ; No predecessors! br label %return return: ; preds = %unreachable_after_return, %.entry br label %FINALIZE_SYMTABLE_cobyla FINALIZE_SYMTABLE_cobyla: ; preds = %return ret void } declare void @calcfc(double*) define void @cobylb(void (double*)* %calcfc) { .entry: %con = alloca double, align 8 call void %calcfc(double* %con) br label %return unreachable_after_return: ; No predecessors! br label %return return: ; preds = %unreachable_after_return, %.entry br label %FINALIZE_SYMTABLE_cobylb FINALIZE_SYMTABLE_cobylb: ; preds = %return ret void } declare void @calcfc.1(double*) lfortran-0.63.0/tests/reference/asr-modules1-d3dc674.json0000664000175000017500000000071515174404631023206 0ustar alastairalastair{ "basename": "asr-modules1-d3dc674", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/modules1.f90", "infile_hash": "72ef321fb90a3d7776bca83ff88325bcf615e115cd66319677e16658", "outfile": null, "outfile_hash": null, "stdout": "asr-modules1-d3dc674.stdout", "stdout_hash": "8b3009ed98ba8d3b310f25f757d96968400e5a0493508dc3dd67ea4d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-implicit_typing1-bccf386.json0000664000175000017500000000076715174404631025031 0ustar alastairalastair{ "basename": "asr-implicit_typing1-bccf386", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit_typing1.f90", "infile_hash": "e6d1a0c4cb70b6dec80c447e80d4567c3a25f29c7164e956ddfba662", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_typing1-bccf386.stdout", "stdout_hash": "623d84ebfd43a624cd7578b85e478eae07ec120068553720b9a427b3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-case_04-60840db.json0000664000175000017500000000073715174404631022612 0ustar alastairalastair{ "basename": "ast-case_04-60840db", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_04.f90", "infile_hash": "55392e5b3b536591894e60672e49e61f8c579e20edb5d007f1f1afae", "outfile": null, "outfile_hash": null, "stdout": "ast-case_04-60840db.stdout", "stdout_hash": "1fc5c0ab5364c82ce3ec2aa1facd36f96483565eda873db022eb30ed", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-intrinsics_36-1cb3d03.json0000664000175000017500000000076115174404631024134 0ustar alastairalastair{ "basename": "asr-intrinsics_36-1cb3d03", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_36.f90", "infile_hash": "d820f4c73a9b761a514a15853acf89ef75e1f5a0d15492c529448710", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_36-1cb3d03.stdout", "stdout_hash": "e96250d4176e76b6594760c6a90c63e172a8153a8b5626ca676cbeb4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-types_13-ddae644.stderr0000664000175000017500000000474415174404631024221 0ustar alastairalastairstyle suggestion: Use character(5) instead of character*5 --> tests/../integration_tests/types_13.f90:30:5 | 30 | character*5 :: d | ^^^^^^^^^^^ help: write this as 'character(5)' style suggestion: Use integer(4) instead of integer*4 --> tests/../integration_tests/types_13.f90:36:5 | 36 | integer*4, value, intent(in) :: a | ^^^^^^^^^ help: write this as 'integer(4)' style suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/types_13.f90:37:5 | 37 | real*8, value, intent(in) :: b | ^^^^^^ help: write this as 'real(8)' style suggestion: Use logical(4) instead of logical*4 --> tests/../integration_tests/types_13.f90:38:5 | 38 | logical*4 :: c | ^^^^^^^^^ help: write this as 'logical(4)' style suggestion: Use integer(4) instead of integer*4 --> tests/../integration_tests/types_13.f90:43:5 | 43 | integer*4, value, intent(in) :: a | ^^^^^^^^^ help: write this as 'integer(4)' style suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/types_13.f90:44:5 | 44 | real*8, value, intent(in) :: b | ^^^^^^ help: write this as 'real(8)' style suggestion: Use logical(4) instead of logical*4 --> tests/../integration_tests/types_13.f90:45:5 | 45 | logical*4 :: c | ^^^^^^^^^ help: write this as 'logical(4)' style suggestion: Use integer(4) instead of integer*4 --> tests/../integration_tests/types_13.f90:51:5 | 51 | integer*4, value, intent(in) :: a | ^^^^^^^^^ help: write this as 'integer(4)' style suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/types_13.f90:52:5 | 52 | real*8, value, intent(in) :: b | ^^^^^^ help: write this as 'real(8)' style suggestion: Use logical(4) instead of logical*4 --> tests/../integration_tests/types_13.f90:53:5 | 53 | logical*4 :: c | ^^^^^^^^^ help: write this as 'logical(4)' style suggestion: Use integer(4) instead of integer*4 --> tests/../integration_tests/types_13.f90:59:5 | 59 | integer*4, value, intent(in) :: a | ^^^^^^^^^ help: write this as 'integer(4)' style suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/types_13.f90:60:5 | 60 | real*8, value, intent(in) :: b | ^^^^^^ help: write this as 'real(8)' style suggestion: Use logical(4) instead of logical*4 --> tests/../integration_tests/types_13.f90:61:5 | 61 | logical*4 :: c | ^^^^^^^^^ help: write this as 'logical(4)' lfortran-0.63.0/tests/reference/llvm-subroutine3-fb7e0b8.json0000664000175000017500000000073115174404631024201 0ustar alastairalastair{ "basename": "llvm-subroutine3-fb7e0b8", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/subroutine3.f90", "infile_hash": "174874c0a5fad40d608acbafefcc0c06c96379cc136126d3f05b63e5", "outfile": null, "outfile_hash": null, "stdout": "llvm-subroutine3-fb7e0b8.stdout", "stdout_hash": "06b2bdeaaf51a338d727f26ab674bd2aef8ec6df35d42bce23ec8b0a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-dependency_test_01-280d5b3.json0000664000175000017500000000075315174404631025045 0ustar alastairalastair{ "basename": "asr-dependency_test_01-280d5b3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/dependency_test_01.f90", "infile_hash": "cfea9e80612bf56dfd74d8207d5291bad0aea56ade74a8da6d0be11d", "outfile": null, "outfile_hash": null, "stdout": "asr-dependency_test_01-280d5b3.stdout", "stdout_hash": "1aff66b15b652f6e613b5bd506a74f3008a957c067a99933e37d3b22", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-data2-10e42d7.json0000664000175000017500000000070415174404631022356 0ustar alastairalastair{ "basename": "asr-data2-10e42d7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/data2.f90", "infile_hash": "89ccb50e394ce2bf22af43e22184c4a457c3afee616586f6bbe24100", "outfile": null, "outfile_hash": null, "stdout": "asr-data2-10e42d7.stdout", "stdout_hash": "1ee8eb1d5a3a845ffbee0992d74497baf7fb4c129f6aea63cd3b526d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-ichar_01-a5284c8.stderr0000664000175000017500000000023415174404631023311 0ustar alastairalastairsemantic error: Argument 1 to Ichar must have length 1 --> tests/errors/ichar_01.f90:3:13 | 3 | print*, ichar("okay") | ^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast-nullify1-aaf5456.json0000664000175000017500000000071515174404631023217 0ustar alastairalastair{ "basename": "ast-nullify1-aaf5456", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/nullify1.f90", "infile_hash": "f996667719f3f2215e2bf25d7fe502ab13f032f4d8b29b0a3f1329d1", "outfile": null, "outfile_hash": null, "stdout": "ast-nullify1-aaf5456.stdout", "stdout_hash": "1aff21d1a0c7014a1b02f606be423bebcaa7ff75bf98f650e1d7179d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-include_01-55ce778.json0000664000175000017500000000075015174404631023332 0ustar alastairalastair{ "basename": "ast-include_01-55ce778", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/include_01.f90", "infile_hash": "ba2b458982cee4e8d6b9f14773bf7d3121b4e6efc4b978ea9ceb4459", "outfile": null, "outfile_hash": null, "stdout": "ast-include_01-55ce778.stdout", "stdout_hash": "1e0dba7fbf0747a1db87686a815b628bd2c6d52b45882d51bfad8416", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-string_17-29e01e3.json0000664000175000017500000000074515174404631023207 0ustar alastairalastair{ "basename": "asr-string_17-29e01e3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_17.f90", "infile_hash": "ee31756f63bb7509c4031e19e1e0eedd026a2ab4fca1f1260a1eb32b", "outfile": null, "outfile_hash": null, "stdout": "asr-string_17-29e01e3.stdout", "stdout_hash": "be621197a38c02a3a5537495d81650412b53052832ccbc7ffa6743ca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/run-format_11-72f8b07.json0000664000175000017500000000103515174404631023202 0ustar alastairalastair{ "basename": "run-format_11-72f8b07", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_11.f90", "infile_hash": "e4276cc9be24aab8d11f4bc561afa3976e52e3f6c67dabdea56d0ae4", "outfile": null, "outfile_hash": null, "stdout": "run-format_11-72f8b07.stdout", "stdout_hash": "bc9f4848ffec7802600469ec345f84973a1e3420535ac8c5d0fffddd", "stderr": "run-format_11-72f8b07.stderr", "stderr_hash": "9c63ade47f347b4c61353d2af6e780092daa84d287747e19ac89fdf9", "returncode": 0 }lfortran-0.63.0/tests/reference/ast_f90-do_concurrent_reduce2-81246e2.stdout0000664000175000017500000000034515174404631026617 0ustar alastairalastairsubroutine sum_reduce(a, s, t) real, intent(in) :: a(:) real, intent(out) :: s, t integer :: N, i N = size(a) s = 0 t = 0 do concurrent (i = 1:N) reduce(+: s, t) s = s + a(i) t = t + a(i) end do end subroutine sum_reduce lfortran-0.63.0/tests/reference/run-allocatable_component_reshape_unallocated_01-15046b1.json0000664000175000017500000000106615174404631032227 0ustar alastairalastair{ "basename": "run-allocatable_component_reshape_unallocated_01-15046b1", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/allocatable_component_reshape_unallocated_01.f90", "infile_hash": "313d8d25c884dd74e02ad6ed9f70cdf1d594b70fc7c912b1f7e575d4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-allocatable_component_reshape_unallocated_01-15046b1.stderr", "stderr_hash": "f189ede90d14e98aef9467208e1527a7e6af77b41a51a16c2f9cf387", "returncode": 1 }lfortran-0.63.0/tests/reference/cpp-kokkos_program1-1d79f7a.stdout0000664000175000017500000000112215174404631025131 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-0.63.0/tests/reference/asr-external1-e4cf9f2.stderr0000664000175000017500000000031615174404631023773 0ustar alastairalastairsemantic error: function interface must be specified explicitly; you can enable implicit interfaces with `--implicit-interface` --> tests/errors/external1.f90:2:13 | 2 | external f | ^ lfortran-0.63.0/tests/reference/ast_f90-types_12-e6251f2.json0000664000175000017500000000075515174404631023523 0ustar alastairalastair{ "basename": "ast_f90-types_12-e6251f2", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/types_12.f90", "infile_hash": "d5db9207ff7ebb121312ebf448d4b591da2b645185b23095e2558455", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-types_12-e6251f2.stdout", "stdout_hash": "092938e0b8018bee2427490eec7cc4ad829780ff42bf09bd3a439de7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-program_without_line_07-3e4ee40.stdout0000664000175000017500000000031315174404631026564 0ustar alastairalastair(TranslationUnit [(Program __xx_main () [] [] [] [(ErrorStop 0 () () () )] [] )] ) lfortran-0.63.0/tests/reference/run-format_31-1180df5.json0000664000175000017500000000071515174404631023201 0ustar alastairalastair{ "basename": "run-format_31-1180df5", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_31.f90", "infile_hash": "16cf5f2372e58cc6b16e9f140d536320002acde81156b900a6842ad7", "outfile": null, "outfile_hash": null, "stdout": "run-format_31-1180df5.stdout", "stdout_hash": "469665b03abe83cdba83a7523e4dd7bfee4ff798b543a1d34430a0a1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/c_target_cuda-openmp_71-261df19.json0000664000175000017500000000100615174404631025171 0ustar alastairalastair{ "basename": "c_target_cuda-openmp_71-261df19", "cmd": "lfortran --show-c --openmp --target-offload {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_71.f90", "infile_hash": "3dc8c9d0a33e2b1fd1dd572fabf806b89547b85ec20bee4d0688d7c6", "outfile": null, "outfile_hash": null, "stdout": "c_target_cuda-openmp_71-261df19.stdout", "stdout_hash": "81081e8992cc71273d0108c505e65a0361e66d4ffaa43033582041ff", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/asr-data_12-af356bd.stdout0000664000175000017500000007732115174404631023324 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { data_12_module: (Module (SymbolTable 2 { b: (Variable 2 b [] Local (RealConstant 3.000000 (Real 4) ) (RealConstant 3.000000 (Real 4) ) Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), bf1: (Variable 2 bf1 [] Local (RealConstant 0.800000 (Real 4) ) (RealConstant 0.800000 (Real 4) ) Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), c1: (Variable 2 c1 [] Local (ArrayConstant 16 [0.00000000e+00, 2.19999999e-01, -1.40000001e-01, -2.09999993e-01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayConstant 16 [0.00000000e+00, 2.19999999e-01, -1.40000001e-01, -2.09999993e-01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), td: (Variable 2 td [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), x: (Variable 2 x [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), xx90: (Variable 2 xx90 [] Local (RealConstant 0.550000 (Real 4) ) (RealConstant 0.550000 (Real 4) ) Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), xx95: (Variable 2 xx95 [] Local (RealConstant 0.620000 (Real 4) ) (RealConstant 0.620000 (Real 4) ) Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), y: (Variable 2 y [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ), z: (Variable 2 z [] Local (RealConstant 3.000000 (Real 4) ) (RealConstant 3.000000 (Real 4) ) Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. NotMethod () 0 ) }) data_12_module () [] .false. .false. .false. ), data_12_program: (Program (SymbolTable 3 { b: (ExternalSymbol 3 b 2 b data_12_module [] b Public ), bf1: (ExternalSymbol 3 bf1 2 bf1 data_12_module [] bf1 Public ), c1: (ExternalSymbol 3 c1 2 c1 data_12_module [] c1 Public ), td: (ExternalSymbol 3 td 2 td data_12_module [] td Public ), x: (ExternalSymbol 3 x 2 x data_12_module [] x Public ), xx90: (ExternalSymbol 3 xx90 2 xx90 data_12_module [] xx90 Public ), xx95: (ExternalSymbol 3 xx95 2 xx95 data_12_module [] xx95 Public ), y: (ExternalSymbol 3 y 2 y data_12_module [] y Public ), z: (ExternalSymbol 3 z 2 z data_12_module [] z Public ) }) data_12_program [data_12_module] [(Print (StringFormat () [(Var 3 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 3 x) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 3 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 3 y) Sub (RealConstant 2.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 3 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 3 z) Sub (RealConstant 3.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(ArrayItem (Var 3 c1) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 3 c1) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 0.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(ArrayItem (Var 3 c1) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 3 c1) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 0.220000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(ArrayItem (Var 3 c1) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 3 c1) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Add (RealConstant 0.210000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 3 bf1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 3 bf1) Sub (RealConstant 0.800000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 3 xx90)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 3 xx90) Sub (RealConstant 0.550000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 3 xx95)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 3 xx95) Sub (RealConstant 0.620000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-0.63.0/tests/reference/asr-interface_generic_procedure_same_name-708e46e.json0000664000175000017500000000104415174404631031106 0ustar alastairalastair{ "basename": "asr-interface_generic_procedure_same_name-708e46e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/interface_generic_procedure_same_name.f90", "infile_hash": "29ffbcf68bc154604f8f4e5acd8bb8776602725ac76db9608e253dc0", "outfile": null, "outfile_hash": null, "stdout": "asr-interface_generic_procedure_same_name-708e46e.stdout", "stdout_hash": "e8210fdd3dea0751a45dd968aba95cab1c9df5b76841604c25c5be37", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/llvm-global_scope8-240995c.json0000664000175000017500000000073715174404631024230 0ustar alastairalastair{ "basename": "llvm-global_scope8-240995c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/global_scope8.f90", "infile_hash": "899df30dee274279a699110fb9af2afad0b826c0abc886f9e2460627", "outfile": null, "outfile_hash": null, "stdout": "llvm-global_scope8-240995c.stdout", "stdout_hash": "b357b09bc099bdcdbad64b654d9ae98362ce4138c8ee672cba8373b9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-0.63.0/tests/reference/ast-program_without_line_03-e127d69.stderr0000664000175000017500000000033715174404631026477 0ustar alastairalastairsyntax error: Only function, subroutine, procedure, module, submodule or block data allowed in global scope in non-interactive mode --> tests/errors/program_without_line_03.f90:3:1 | 3 | print *, "OK" | ^^^^^^^^^^^^^ lfortran-0.63.0/tests/reference/ast_f90-assign-69436fa.stdout0000664000175000017500000000030015174404631023704 0ustar alastairalastairprogram assign integer :: x real :: y 10 format('(i3)') assign 10 to x 20 assign 10 to x assign 10 to x 30 assign 10 to y ! An integer variable is required in this context. end program assign lfortran-0.63.0/tests/data3.f900000664000175000017500000000123015174404631016272 0ustar alastairalastairprogram datatest implicit none integer :: ivon01,ivon02,ivon03,ivon04,ivon05 integer :: ivon06,ivon07,ivon08,ivon09,ivon10 integer :: ivon11,ivon12,ivon13,ivon14,ivon15 integer :: ivon16,ivon17,ivon18,ivon19,ivon20 integer, parameter :: vals(5) = [2,76,587,9999,21111] complex :: axva,axvb data ivon01,ivon02,ivon03,ivon04,ivon05 /vals(1), vals(2), vals(3), vals(4), vals(5)/ data ivon06,ivon07,ivon08,ivon09,ivon10 /+3,+76,+587,+9999,+21111/ data ivon11,ivon12,ivon13,ivon14,ivon15 /-3,-76,-587,-9999,-21111/ data ivon16,ivon17,ivon18,ivon19,ivon20 / 2*119, 2*7, -427/ data axva,axvb /(-234.23, 3), (+2, -3.0)/ end program datatest lfortran-0.63.0/tests/codegen_function_polymorphic.f900000664000175000017500000000036215174404631023241 0ustar alastairalastairmodule codegen_function_polymorphic type, abstract :: AbsType end type AbsType contains function my_func() result(obj) class(AbsType), allocatable :: obj end function my_func end module codegen_function_polymorphiclfortran-0.63.0/tests/expr6.f900000664000175000017500000000001215174404631016337 0ustar alastairalastair5 + 3 5.3 lfortran-0.63.0/tests/implicit11.f900000664000175000017500000000041615174404631017257 0ustar alastairalastairinteger function f1(z,i) implicit complex*16 (z,i) z = 5 print *, dimag(z), dimag(i) end function subroutine f2(z,i) implicit complex*16 (z,i) z = 5 ! Does not yet work due to: https://github.com/lfortran/lfortran/issues/894 !print *, dimag(z), dimag(i) end subroutine lfortran-0.63.0/tests/invalidInput_integer.txt0000664000175000017500000000002315174404631021701 0ustar alastairalastairxasxacscsd123s15x6 lfortran-0.63.0/tests/modules2_module_a.f900000664000175000017500000000067415174404631020710 0ustar alastairalastairmodule tomlf_type_value implicit none private public :: toml_value type, abstract :: toml_value character(len=:), allocatable :: key contains procedure(destroy), deferred :: destroy end type toml_value abstract interface subroutine destroy(self) import toml_value class(toml_value), intent(inout) :: self end subroutine destroy end interface end module tomlf_type_value lfortran-0.63.0/tests/kokkos_program1.f900000664000175000017500000000045715174404631020421 0ustar alastairalastairprogram kokkos_program1 implicit none contains subroutine triad(a, b, scalar, c) real, intent(in) :: a(:), b(:), scalar real, intent(out) :: c(:) integer :: N, i N = size(a) do concurrent (i = 1:N) c(i) = a(i) + scalar * b(i) end do end subroutine end program lfortran-0.63.0/tests/array6.f900000664000175000017500000000036315174404631016510 0ustar alastairalastairprogram array6 implicit none contains subroutine t(n, a, b, c, d, e) integer, intent(in) :: n real :: a(*), b(3:*) real, dimension(3,n,*) :: c real, dimension(3,n,4:*) :: d real :: e(n:*) end subroutine end program lfortran-0.63.0/tests/cast_node_m_value.f900000664000175000017500000000131015174404631020744 0ustar alastairalastair! we do casting from source to destination below during ! initialization of variable's, we save it's ASR via tests.toml ! to ensure that the `m_value` of the cast node is set ! correctly program cast_node_m_value implicit none real(4), parameter :: i4_to_r4(3) = [1, 2, 3] real(8), parameter :: i4_to_r8(3) = [1, 2, 3] complex(4), parameter :: i4_to_c4(3) = [1, 2, 3] complex(8), parameter :: i4_to_c8(3) = [1, 2, 3] complex(4), parameter :: r4_to_c4(3) = [1., 2., 3.] complex(8), parameter :: r4_to_c8(3) = [1., 2., 3.] integer(1), parameter :: i4_to_i1(3) = [1, 2, 3] complex(8), parameter :: c4_to_c8(3) = [(1.0, 0.0), (2.0, 0.0), (3.0, 0.0)] end program cast_node_m_value lfortran-0.63.0/tests/parse_without_program_line.f900000664000175000017500000000100715174404631022733 0ustar alastairalastairinteger, allocatable :: a(:) integer, pointer :: p allocate(a(10)) deallocate(a) open(unit=10, file="test.txt", status="old") flush(10) close(unit=10) nullify(p) exit cycle return continue print *, exit print *, cycle print *, return print *, continue call exit call cycle call return call continue contains subroutine sub integer :: i do i = 1, 10 print *, i if (i == 5) exit if (i == 7) cycle if (i == 9) return if (i == 2) continue end do end subroutine end program lfortran-0.63.0/tests/allow_implicit_interface.f900000664000175000017500000000043515174404631022334 0ustar alastairalastairdouble precision function prho() double precision zero, one, two, b, x, y, u, six data zero, one, two, six /0.0d0, 1.0d0, 2.0d0, 6.0d0/ prho = u / exp(y / two) + alnorm(x, .true.) external dgetrf call dgetrf(x, y, u) if (prho < zero) prho = zero if (prho > one) prho = one return end lfortran-0.63.0/tests/finalize_02.f900000664000175000017500000000114615174404631017406 0ustar alastairalastairprogram finalize_02 type t integer :: inn end type t type tt real :: rr type(t) :: t_instance end type call ss(200) contains subroutine ss(nang) type(tt), allocatable :: arr_01(:) integer,allocatable :: arr_02(:) integer, allocatable :: arr_03 character(:), allocatable :: arr_04(:) character(20) :: arr_05(5) integer, allocatable :: arr_06(:) character(:), allocatable :: arr_07 character(:), allocatable :: arr_08(:) integer :: nang integer :: arr_09(nang) end subroutine end programlfortran-0.63.0/tests/allow_implicit_interface4.f900000664000175000017500000000037415174404631022422 0ustar alastairalastairsubroutine dqc25c(f) double precision f call dqk15w(f) print *, f(hlgth) end function func(f) double precision c call sub2(c) print *, c(d) end function program main double precision a call sub(a) print *, a(b) end program lfortran-0.63.0/tests/tests.toml0000664000175000017500000024757515174404631017045 0ustar alastairalastair# Possible tests: # tokens ... run the Lexer and output tokens, compare against reference version # ast ... run the Parser and output AST, compare against reference version # asr ... run the Semantics and output ASR, compare against reference version # bin ... run the CodeGen and output bin, compare against reference bin [[test]] filename = "subroutine1.f90" tokens = true ast_indent = true asr_indent = true asr_clojure = true ast = true julia = true [[test]] filename = "../integration_tests/template_add_01.f90" asr = true [[test]] filename = "../integration_tests/template_add_01b.f90" asr = true [[test]] filename = "../integration_tests/template_add_01c.f90" asr = true [[test]] filename = "../integration_tests/template_add_02.f90" asr = true [[test]] filename = "../integration_tests/template_add_03.f90" asr = true [[test]] filename = "../integration_tests/template_add_04.f90" asr = true [[test]] filename = "../integration_tests/template_nested.f90" ast = true asr = true [[test]] filename = "../integration_tests/template_travel_01.f90" ast = true asr = true [[test]] filename = "../integration_tests/template_travel_01b.f90" asr = true [[test]] filename = "../integration_tests/template_travel_02.f90" asr = true [[test]] filename = "../integration_tests/template_triple.f90" asr = true [[test]] filename = "../integration_tests/template_array_01.f90" asr = true [[test]] filename = "../integration_tests/template_array_02.f90" asr = true [[test]] filename = "../integration_tests/template_array_03.f90" asr = true [[test]] filename = "../integration_tests/template_array_04.f90" asr = true [[test]] filename = "../integration_tests/template_array_04b.f90" asr = true # TODO: StructType - Uncomment after fixing symbol outside scope error for ttype # [[test]] # filename = "../integration_tests/template_array_05.f90" # asr = true [[test]] filename = "../integration_tests/template_02.f90" asr = true ast = true [[test]] filename = "../integration_tests/template_03.f90" asr = true [[test]] filename = "../integration_tests/template_03b.f90" ast = true asr = true # TODO: StructType - Uncomment after fixing symbol outside scope error for ttype # [[test]] # filename = "../integration_tests/template_04.f90" # asr = true [[test]] filename = "../integration_tests/template_05.f90" asr = true [[test]] filename = "../integration_tests/template_struct_01.f90" asr = true ast = true # TODO: StructType - Uncomment after fixing symbol outside scope error for ttype # [[test]] # filename = "../integration_tests/template_matrix_01.f90" # asr = true [[test]] filename = "../integration_tests/template_vector.f90" asr = true [[test]] filename = "../integration_tests/template_simple_01.f90" asr = true [[test]] filename = "../integration_tests/template_simple_02.f90" asr = true [[test]] filename = "../integration_tests/template_simple_03.f90" asr = true [[test]] filename = "../integration_tests/template_simple_04.f90" asr = true [[test]] filename = "../integration_tests/template_sort_01.f90" asr = true [[test]] filename = "../integration_tests/template_sort_02.f90" asr = true [[test]] filename = "../integration_tests/template_lapack_01.f90" asr = true [[test]] filename = "../integration_tests/template_interface_01.f90" asr = true [[test]] filename = "../integration_tests/template_commutative.f90" asr = true [[test]] filename = "../integration_tests/test_backspace_01.f90" asr = true [[test]] filename = "../integration_tests/openmp_36.f90" asr = true [[test]] filename = "../integration_tests/openmp_37.f90" asr_openmp = true [[test]] filename = "../integration_tests/openmp_38.f90" asr_openmp = true [[test]] filename = "../integration_tests/openmp_39.f90" asr_openmp = true [[test]] filename = "../integration_tests/openmp_44.f90" asr_openmp = true [[test]] filename = "../integration_tests/openmp_45.f90" asr_openmp = true [[test]] filename = "../integration_tests/openmp_46.f90" asr_openmp = true [[test]] filename = "../integration_tests/openmp_70.f90" c_target_omp = true [[test]] filename = "../integration_tests/openmp_71.f90" c_target_cuda = true [[test]] filename = "../integration_tests/openmp_72.f90" c_target_cuda = true [[test]] filename = "subroutine2.f90" ast = true [[test]] filename = "subroutine3.f90" ast = true asr = true llvm = true obj = true julia = true [[test]] filename = "subroutine3b.f90" ast = true asr = true julia = true [[test]] filename = "do1.f90" interactive = true ast = true [[test]] filename = "do2.f90" ast = true [[test]] filename = "do3.f90" ast = true [[test]] filename = "do4.f90" ast = true [[test]] filename = "do5.f90" ast = true [[test]] filename = "do6.f90" ast = true [[test]] filename = "do7.f90" llvm = true [[test]] filename = "subroutine4.f90" ast = true ast_f90 = true asr = true cpp = true julia = true [[test]] filename = "do_concurrent_reduce.f90" ast = true ast_f90 = true cpp = true [[test]] filename = "do_concurrent_reduce2.f90" ast = true ast_f90 = true [[test]] filename = "do_concurrent_reduce3.f90" ast = true ast_f90 = true [[test]] filename = "subroutine5.f90" ast = true asr = true cpp = true julia = true [[test]] filename = "subroutine6.f90" ast = true cpp = true julia = true [[test]] filename = "subroutine7.f90" ast = true asr = true julia = true [[test]] filename = "../integration_tests/abort_01.f90" llvm = true [[test]] filename = "errors/array_size_01.f90" asr = true [[test]] filename = "errors/array_size_02.f90" asr = true [[test]] filename = "errors/array_size_03.f90" asr = true [[test]] filename = "errors/array_size_04.f90" asr = true [[test]] filename = "errors/array_size_05.f90" asr = true [[test]] filename = "errors/matrix_transpose_01.f90" asr = true [[test]] filename = "errors/matrix_matmul_01.f90" asr = true [[test]] filename = "errors/matrix_matmul_02.f90" asr = true [[test]] filename = "errors/matrix_matmul_03.f90" asr = true [[test]] filename = "errors/matrix_matmul_04.f90" asr = true [[test]] filename = "errors/matrix_matmul_05.f90" asr = true [[test]] filename = "errors/matrix_matmul_06.f90" asr = true [[test]] filename = "errors/array_transfer_01.f90" asr = true [[test]] filename = "errors/esub1.f90" tokens = true ast = true [[test]] filename = "errors/esub2.f90" tokens = true ast = true [[test]] filename = "errors/subroutine5.f90" asr = true [[test]] filename = "errors/dim_assgn_test.f90" asr = true [[test]] filename = "errors/redeclaration1.f90" asr = true [[test]] filename = "errors/type_mismatch1.f90" asr = true [[test]] filename = "errors/type_mismatch2.f90" asr = true [[test]] filename = "errors/implicit_call_02.f90" asr_implicit_interface = true asr_implicit_argument_casting = true [[test]] filename = "errors/cpp1.f90" asr_preprocess = true [[test]] filename = "errors/cpp2.f90" asr_preprocess = true [[test]] filename = "errors/cpp3.f90" asr_preprocess = true [[test]] filename = "errors/cpp4.f90" asr_preprocess = true [[test]] filename = "errors/cpp5.f90" asr_preprocess = true [[test]] filename = "errors/cpp6.f90" asr_preprocess = true [[test]] filename = "errors/cpp7.f90" asr_preprocess = true [[test]] filename = "errors/cpp8.f90" asr_preprocess = true [[test]] filename = "errors/cpp_err1.f90" asr_preprocess = true [[test]] filename = "errors/cpp_err2.f90" asr_preprocess = true [[test]] filename = "errors/cpp_err3.f90" asr_preprocess = true [[test]] filename = "errors/cpp_err4.f90" asr_preprocess = true [[test]] filename = "errors/cpp_err5.f90" asr_preprocess = true [[test]] filename = "errors/cpp_err6.f90" asr_preprocess = true [[test]] filename = "errors/template_error_01a.f90" asr = true [[test]] filename = "errors/template_error_01b.f90" asr = true [[test]] filename = "errors/template_error_02.f90" asr = true [[test]] filename = "errors/template_error_03.f90" asr = true [[test]] filename = "errors/template_error_04.f90" asr = true [[test]] filename = "errors/template_error_05.f90" asr = true [[test]] filename = "errors/template_error_06.f90" asr = true [[test]] filename = "errors/template_error_07a.f90" asr = true [[test]] filename = "errors/template_error_07b.f90" asr = true [[test]] filename = "errors/template_error_07c.f90" asr = true [[test]] filename = "errors/template_error_08.f90" asr = true [[test]] filename = "errors/template_error_07.f90" asr = true [[test]] filename = "errors/template_error_09.f90" asr = true [[test]] filename = "errors/maskl_incorrect_bit_size.f90" asr = true [[test]] filename = "errors/maskr_incorrect_bit_size.f90" asr = true [[test]] filename = "errors/maskl_negative.f90" asr = true [[test]] filename = "errors/maskr_negative.f90" asr = true [[test]] filename = "errors/nint_overflow.f90" asr = true [[test]] filename = "errors/dint_args.f90" asr = true [[test]] filename = "errors/dnint_args.f90" asr = true [[test]] filename = "warnings/dim_assgn_test.f90" asr = true [[test]] filename = "warnings/character_01.f90" asr = true [[test]] filename = "warnings/character_02.f90" asr = true [[test]] filename = "warnings/character_03.f90" asr = true [[test]] filename = "warnings/preprocess_01.f90" asr = true [[test]] filename = "preprocessor1.f90" asr_preprocess = true [[test]] filename = "preprocessor2.f90" asr_preprocess = true [[test]] filename = "preprocessor3.f90" asr_preprocess = true [[test]] filename = "preprocessor4.f90" asr_preprocess = true [[test]] filename = "preprocessor5.f90" asr_preprocess = true [[test]] filename = "preprocessor6.f90" asr_preprocess = true [[test]] filename = "preprocessor7.f90" asr_preprocess = true [[test]] filename = "preprocessor8.f90" asr_preprocess = true [[test]] filename = "preprocessor9.f90" asr_preprocess = true [[test]] filename = "preprocessor10.f90" asr_preprocess = true [[test]] filename = "preprocessor11.f90" asr_preprocess = true [[test]] filename = "preprocessor12.f90" asr_preprocess = true [[test]] filename = "preprocessor13.f90" asr_preprocess = true [[test]] filename = "preprocessor14.f90" asr_preprocess = true [[test]] filename = "preprocessor15.f90" asr_preprocess = true [[test]] filename = "preprocessor16.f90" asr_preprocess = true [[test]] filename = "preprocessor17.F90" cpp_infer = true asr = true [[test]] filename = "preprocessor18.f90" asr_preprocess = true [[test]] filename = "preprocessor19.f90" asr_preprocess = true [[test]] filename = "preprocessor20.f90" asr_preprocess = true [[test]] filename = "preprocessor21.f90" asr_preprocess = true [[test]] filename = "preprocessor22.f90" asr_preprocess = true [[test]] filename = "expr1.f90" interactive = true ast = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "expr2.f90" interactive = true ast = true asr = true llvm = true obj = true pass = "global_stmts" [[test]] filename = "expr3.f90" interactive = true ast = true asr = true pass = "global_stmts" llvm = true [[test]] filename = "expr4.f90" interactive = true ast = true asr = true pass = "global_stmts" llvm = true [[test]] filename = "expr5.f90" ast = true asr = true llvm = true obj = true fortran = true [[test]] filename = "expr6.f90" interactive = true asr = true pass = "global_stmts" llvm = true [[test]] filename = "execute_command_line.f90" llvm = true [[test]] filename = "expr7.f90" interactive = true tokens = true ast = true ast_f90 = true [[test]] filename = "expr8.f90" tokens = true interactive = true ast = true ast_f90 = true [[test]] filename = "expr9.f90" interactive = true ast = true ast_f90 = true [[test]] filename = "wasm1.f90" wat = true [[test]] filename = "wasm_i64.f90" wat = true [[test]] filename = "wasm_unary_minus.f90" wat = true [[test]] filename = "../integration_tests/types_16.f90" wat = true [[test]] filename = "wasm_main_program.f90" wat = true [[test]] filename = "wasm_bind_js.f90" wat = true [[test]] filename = "../integration_tests/cpu_time_02_wasm.f90" wat = true [[test]] filename = "../integration_tests/if_05.f90" wat = true julia = true [[test]] filename = "../integration_tests/abs_01.f90" wat = true [[test]] filename = "../integration_tests/abs_03.f90" wat = true [[test]] filename = "stop.f90" asr = true llvm = true [[test]] filename = "stop1.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/stop_03.f90" run = true [[test]] filename = "../integration_tests/error_stop_04.f90" run = true [[test]] filename = "../integration_tests/write_12.f90" run = true [[test]] filename = "../integration_tests/write_22.f90" run = true [[test]] filename = "../integration_tests/submodule_01.f90" ast = true [[test]] filename = "../integration_tests/submodule_02.f90" asr = true [[test]] filename = "../integration_tests/submodule_04.f90" asr = true [[test]] filename = "program1.f90" ast = true asr = true llvm = true obj = true cpp = true x86 = true [[test]] filename = "program2.f90" ast = true [[test]] filename = "program3.f90" ast = true asr = true cpp = true c = true [[test]] filename = "program4.f90" ast = true asr = true cpp = true c = true [[test]] filename = "../integration_tests/program_01.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/program_cmake_01.f90" ast = true asr = true llvm = true obj = true x86 = true [[test]] filename = "../integration_tests/print_01.f90" llvm = true [[test]] filename = "../integration_tests/variables_03.f90" llvm = true [[test]] filename = "../integration_tests/while_01.f90" llvm = true [[test]] filename = "../integration_tests/while_02.f90" llvm = true [[test]] filename = "../integration_tests/program_cmake_02.f90" ast = true [[test]] filename = "../integration_tests/doconcurrentloop_02.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/cond_02.f90" asr = true pass = "dead_code_removal" [[test]] filename = "../integration_tests/expr_13.f90" asr = true pass = "flip_sign" cumulative = true [[test]] filename = "array_op_simplifier_test.f90" asr = true pass = "array_struct_temporary,array_op" [[test]] filename = "../integration_tests/struct_allocate.f90" asr = true [[test]] filename = "../integration_tests/doloop_01.f90" asr = true llvm = true pass = "do_loops" wat = true julia = true [[test]] filename = "../integration_tests/doloop_02.f90" asr = true llvm = true wat = true julia = true [[test]] filename = "../integration_tests/doloop_03.f90" asr = true llvm = true wat = true julia = true [[test]] filename = "../integration_tests/doloop_04.f90" ast = true ast_f90 = true asr = true llvm = true pass = "do_loops" [[test]] filename = "../integration_tests/doloop_05.f90" ast_f90 = true julia = true [[test]] filename = "../integration_tests/doloop_08.f90" c = true cpp = true julia = true [[test]] filename = "../integration_tests/subroutines_01.f90" asr = true llvm = true julia = true [[test]] filename = "../integration_tests/subroutines_02.f90" asr = true llvm = true julia = true [[test]] filename = "../integration_tests/subroutines_03.f90" ast = true julia = true [[test]] filename = "../integration_tests/subroutines_04.f90" ast = true asr = true llvm = true julia = true [[test]] filename = "../integration_tests/subroutines_05.f90" asr = true [[test]] filename = "../integration_tests/subroutines_06.f90" asr = true [[test]] filename = "../integration_tests/subroutines_07.f90" asr = true [[test]] filename = "../integration_tests/subroutines_09.f90" asr = true [[test]] filename = "../integration_tests/subroutines_10.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/data_01.f90" ast = true [[test]] filename = "../integration_tests/data_02.f90" ast = true [[test]] filename = "../integration_tests/data_12.f90" ast = true asr = true [[test]] filename = "../integration_tests/data_14.f90" ast = true [[test]] filename = "scopes1.f90" asr = true [[test]] filename = "global_scope1.f90" interactive = true ast = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "global_scope2.f90" interactive = true ast = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "global_scope3.f90" interactive = true ast = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "global_scope4.f90" interactive = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "global_scope5.f90" interactive = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "global_scope6.f90" interactive = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "global_scope7.f90" interactive = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "global_scope8.f90" interactive = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "global_scope9.f90" interactive = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "kokkos_program1.f90" cpp = true [[test]] filename = "kokkos_program2.f90" asr = true cpp = true [[test]] filename = "array1.f90" ast = true asr = true cpp = true julia = true [[test]] filename = "array2.f90" ast = true asr = true llvm = true cpp = true julia = true [[test]] filename = "array3.f90" tokens = true ast = true asr = true cpp = true julia = true [[test]] filename = "array4.f90" ast = true [[test]] filename = "array5.f90" ast = true [[test]] filename = "array6.f90" ast = true ast_f90 = true [[test]] filename = "array7.f90" ast = true ast_f90 = true [[test]] filename = "array8.f90" ast = true ast_f90 = true [[test]] filename = "array9.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/arrays_23.f90" asr = true [[test]] filename = "array12.f90" asr = true [[test]] filename = "array13.f90" pass = "init_expr" [[test]] filename = "array14.f90" run = true [[test]] filename = "array15.f90" pass = "array_op" [[test]] filename = "array16.f90" run = true [[test]] filename = "../integration_tests/arrays_01.f90" cpp = true asr = true llvm = true julia = true [[test]] filename = "../integration_tests/arrays_05.f90" asr = true julia = true [[test]] filename = "../integration_tests/arrays_01_size.f90" asr = true llvm = true julia = true [[test]] filename = "../integration_tests/arrays_02_size.f90" asr = true julia = true [[test]] filename = "../integration_tests/matrix_01_transpose.f90" asr = true [[test]] filename = "../integration_tests/matrix_02_matmul.f90" asr = true [[test]] filename = "../integration_tests/array_01_pack.f90" asr = true [[test]] filename = "../integration_tests/array_01_transfer.f90" asr = true [[test]] filename = "../integration_tests/array_02_pack.f90" asr = true [[test]] filename = "../integration_tests/array_02_transfer.f90" asr = true [[test]] filename = "../integration_tests/array_03_transfer.f90" asr = true [[test]] filename = "../integration_tests/arrays_01_real.f90" asr = true llvm = true [[test]] filename = "../integration_tests/arrays_01_complex.f90" asr = true llvm = true [[test]] filename = "../integration_tests/arrays_01_logical.f90" asr = true llvm = true [[test]] filename = "../integration_tests/array_bound_1.f90" asr = true llvm = true [[test]] filename = "../integration_tests/arrays_op_6.f90" asr = true [[test]] filename = "../integration_tests/arrays_op_10.f90" asr = true pass = "array_op" [[test]] filename = "../integration_tests/arrays_reshape_14.f90" asr = true [[test]] filename = "../integration_tests/arrays_02.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/arrays_03_func.f90" asr = true cpp = true julia = true [[test]] filename = "../integration_tests/arrays_04_func.f90" asr = true cpp = true julia = true [[test]] filename = "../integration_tests/arrays_08_func.f90" asr = true julia = true [[test]] filename = "../integration_tests/arrays_09.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/arrays_10.f90" asr = true [[test]] filename = "../integration_tests/arrays_20.f90" asr = true # TODO: Implement maxloc # [[test]] # filename = "../integration_tests/arrays_21.f90" # asr = true [[test]] filename = "../integration_tests/types_01.f90" asr = true llvm = true cpp = true wat = true [[test]] filename = "../integration_tests/types_02.f90" asr = true llvm = true cpp = true wat = true [[test]] filename = "../integration_tests/types_03.f90" asr = true llvm = true cpp = true wat = true [[test]] filename = "../integration_tests/types_04.f90" asr = true llvm = true cpp = true wat = true [[test]] filename = "../integration_tests/types_05.f90" asr = true llvm = true cpp = true wat = true [[test]] filename = "../integration_tests/types_06.f90" asr = true llvm = true cpp = true [[test]] filename = "../integration_tests/types_07.f90" ast = true [[test]] filename = "../integration_tests/types_08.f90" ast = true [[test]] filename = "../integration_tests/types_09.f90" ast = true [[test]] filename = "../integration_tests/types_10.f90" ast = true [[test]] filename = "../integration_tests/types_11.f90" ast = true [[test]] filename = "../integration_tests/types_12.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/types_15.f90" wat = true [[test]] filename = "boz1.f90" tokens = true [[test]] filename = "derived_type1.f90" asr = true [[test]] filename = "derived_types_02.f90" ast = true ast_f90 = true [[test]] filename = "derived_types_03.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/derived_types_04.f90" asr = true [[test]] filename = "../integration_tests/derived_types_05.f90" asr = true [[test]] filename = "../integration_tests/derived_types_01.f90" ast = true ast_f90 = true asr = true [[test]] filename = "../integration_tests/derived_types_02.f90" ast = true [[test]] filename = "../integration_tests/derived_types_03.f90" ast = true asr = true ast_f90 = true [[test]] filename = "../integration_tests/derived_types_06.f90" asr = true [[test]] filename = "../integration_tests/derived_types_07.f90" asr = true [[test]] filename = "../integration_tests/derived_types_08.f90" asr = true [[test]] filename = "../integration_tests/derived_types_11.f90" asr = true [[test]] filename = "../integration_tests/derived_types_17.f90" asr = true [[test]] filename = "derived_types_04.f90" asr = true [[test]] filename = "derived_types_06.f90" asr = true extrafiles = "derived_types_04.f90, derived_types_05.f90" [[test]] filename = "../integration_tests/derived_types_14.f90" asr = true extrafiles = "../integration_tests/derived_types_14_module.f90" [[test]] filename = "../integration_tests/derived_types_19.f90" asr = true extrafiles = "../integration_tests/derived_types_19_module.f90" [[test]] filename = "derived_types_07.f90" asr = true [[test]] filename = "derived_types_09.f90" ast = true [[test]] filename = "derived_types_10.f90" asr = true [[test]] filename = "modules1.f90" asr = true extrafiles = "modules1_module1.f90, modules1_module2.f90" [[test]] filename = "modules2.f90" asr = true extrafiles = "modules2_module_a.f90, modules2_module_b_base.f90, modules2_module_b.f90" [[test]] filename = "modules3.f90" asr = true extrafiles = "modules2_module_a.f90, modules2_module_b_base.f90, modules2_module_b.f90, modules2.f90" [[test]] filename = "modules4.f90" asr = true extrafiles = "modules2_module_a.f90, modules2_module_b_base.f90, modules2_module_b.f90, modules2.f90, modules3.f90, modules4_module.f90" [[test]] filename = "../integration_tests/select_type_04.f90" asr = true extrafiles = "../integration_tests/select_type_03_module.f90, ../integration_tests/select_type_03.f90" [[test]] filename = "fn2.f90" asr = true cpp = true [[test]] filename = "fn3.f90" ast = true [[test]] filename = "fn4.f90" ast = true ast_f90 = true [[test]] filename = "fn5.f90" asr = true [[test]] filename = "fn6.f90" asr = true [[test]] filename = "forall1.f90" ast = true ast_f90 = true [[test]] filename = "subroutine8.f90" ast = true [[test]] filename = "empty.f90" ast = true asr = true llvm = true obj = true wat = true [[test]] filename = "../integration_tests/line_continuation_01.f90" ast = true [[test]] filename = "../integration_tests/line_continuation_03.f90" ast = true [[test]] filename = "modules_02.f90" ast = true [[test]] filename = "interface1.f90" ast = true [[test]] filename = "interface2.f90" ast = true ast_f90 = true [[test]] filename = "interface3.f90" ast = true [[test]] filename = "interface4.f90" ast = true [[test]] filename = "errors/passing_array_01.f90" run = true [[test]] filename = "../integration_tests/modules_01.f90" ast = true asr = true llvm = true [[test]] filename = "../integration_tests/modules_02.f90" ast = true asr = true [[test]] filename = "../integration_tests/modules_03.f90" ast = true [[test]] filename = "../integration_tests/modules_04.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/modules_05.f90" ast = true [[test]] filename = "../integration_tests/modules_06.f90" asr = true llvm = true [[test]] filename = "../integration_tests/allocate_01.f90" asr = true [[test]] filename = "../integration_tests/allocate_02.f90" asr = true [[test]] filename = "../integration_tests/allocate_03.f90" asr = true llvm = true [[test]] filename = "../integration_tests/allocate_04.f90" asr = true [[test]] filename = "../integration_tests/allocate_05.f90" asr = true [[test]] filename = "allocate_01.f90" ast = true ast_f90 = true [[test]] filename = "allocate_02.f90" llvm = true [[test]] filename = "errors/allocate_01.f90" run = true [[test]] filename = "errors/allocate_02.f90" run = true [[test]] filename = "errors/allocate_03.f90" run = true [[test]] filename = "errors/allocated_04.f90" run = true [[test]] filename = "errors/allocated_05.f90" run = true [[test]] filename = "finalize_01.f90" pass = "insert_deallocate" llvm = true [[test]] filename = "finalize_02.f90" llvm = true [[test]] filename = "../integration_tests/block_01.f90" asr = true [[test]] filename = "../integration_tests/block_02.f90" ast = true ast_f90 = true julia = true [[test]] filename = "../integration_tests/block_03.f90" asr = true julia = true [[test]] filename = "../integration_tests/associate_01.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/associate_02.f90" asr = true llvm = true [[test]] filename = "../integration_tests/associate_03.f90" asr = true llvm = true [[test]] filename = "../integration_tests/associate_04.f90" asr = true llvm = true [[test]] filename = "../integration_tests/associate_05.f90" asr = true [[test]] filename = "../integration_tests/associate_07.f90" asr = true [[test]] filename = "../integration_tests/associate_08.f90" asr = true [[test]] filename = "write1.f90" ast = true ast_f90 = true [[test]] filename = "write2.f90" asr = true [[test]] filename = "write3.f90" llvm = true [[test]] filename = "write4.f90" run = true [[test]] filename = "write5.f90" run = true [[test]] filename = "write6.f90" run = true [[test]] filename = "write7.f90" asr = true [[test]] filename = "errors/write_01.f90" run = true [[test]] filename = "errors/write_02.f90" run = true [[test]] filename = "read1.f90" ast = true ast_f90 = true [[test]] filename = "read2.f90" run = true [[test]] filename = "open1.f90" ast = true ast_f90 = true [[test]] filename = "close1.f90" ast = true ast_f90 = true [[test]] filename = "nullify1.f90" ast = true ast_f90 = true [[test]] filename = "builtin1.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/interface_01.f90" ast = true asr = true ast_f90 = true [[test]] filename = "../integration_tests/interface_02.f90" ast = true [[test]] filename = "../integration_tests/interface_03.f90" ast = true [[test]] filename = "../integration_tests/interface_04.f90" asr = true [[test]] filename = "../integration_tests/interface_05.f90" asr = true [[test]] filename = "../integration_tests/interface_08.f90" asr = true [[test]] filename = "../integration_tests/interface_10.f90" asr = true [[test]] filename = "../integration_tests/if_04.f90" ast = true wat = true [[test]] filename = "../integration_tests/case_01.f90" ast = true ast_f90 = true asr = true llvm = true julia = true c = true cpp = true [[test]] filename = "../integration_tests/case_02.f90" ast = true ast_f90 = true asr = true llvm = true julia = true c = true cpp = true [[test]] filename = "../integration_tests/case_03.f90" ast = true ast_f90 = true asr = true llvm = true julia = true c = true cpp = true [[test]] filename = "../integration_tests/case_04.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/case_05.f90" ast = true ast_f90 = true asr = true julia = true c = true cpp = true [[test]] filename = "../integration_tests/case_06.f90" asr = true pass = "dead_code_removal" julia = true c = true cpp = true [[test]] filename = "../integration_tests/case_07.f90" pass = "select_case" [[test]] filename = "../integration_tests/include_01.f90" ast = true [[test]] filename = "../integration_tests/program_02.f90" ast = true [[test]] filename = "../integration_tests/where_01.f90" ast = true asr = true pass = "where" [[test]] filename = "../integration_tests/forallloop_01.f90" ast = true [[test]] filename = "../integration_tests/parameter_01.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/parameter_02.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/parameter_03.f90" asr = true [[test]] filename = "../integration_tests/parameter_04.f90" asr = true # IntegerToReal [[test]] filename = "../integration_tests/parameter_05.f90" asr = true [[test]] filename = "do_concurrent1.f90" ast = true [[test]] filename = "do_concurrent2.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/doconcurrentloop_01.f90" ast_f90 = true [[test]] filename = "../integration_tests/do_concurrent_01.f90" pass = "openmp" options = "--mlir-gpu-offloading --openmp" [[test]] filename = "subroutine9.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/types_13.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/types_14.f90" asr = true [[test]] filename = "../integration_tests/namelist_01.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/namelist_02.f90" asr = true [[test]] filename = "select_type1.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/select_type_03.f90" asr = true extrafiles = "../integration_tests/select_type_03_module.f90" [[test]] filename = "selectrank1.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/select_type_01.f90" asr = true [[test]] filename = "../integration_tests/select_type_02.f90" asr = true [[test]] filename = "../integration_tests/format_01.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/format_02.f90" ast = true ast_f90 = true [[test]] filename = "format1.f90" run = true [[test]] filename = "format3.f90" run = true [[test]] filename = "format4.f90" run = true [[test]] filename = "format5.f90" run = true [[test]] filename = "format6.f90" run = true [[test]] filename = "format7.f90" run = true [[test]] filename = "format8.f90" run = true [[test]] filename = "../integration_tests/format_11.f90" run = true [[test]] filename = "../integration_tests/format_12.f90" run = true [[test]] filename = "../integration_tests/format_21.f90" run = true [[test]] filename = "../integration_tests/format_22.f90" run = true [[test]] filename = "../integration_tests/format_23.f90" run = true [[test]] filename = "../integration_tests/format_24.f90" run = true [[test]] filename = "../integration_tests/format_25.f90" run = true [[test]] filename = "../integration_tests/format_26.f90" run = true [[test]] filename = "../integration_tests/format_27.f90" run = true [[test]] filename = "../integration_tests/format_28.f90" run = true [[test]] filename = "../integration_tests/format_29.f90" run = true [[test]] filename = "../integration_tests/format_30.f90" run = true [[test]] filename = "../integration_tests/format_31.f90" run = true [[test]] filename = "../integration_tests/format_32.f90" run = true [[test]] filename = "../integration_tests/format_34.f90" run = true [[test]] filename = "../integration_tests/format_35.f90" run = true [[test]] filename = "../integration_tests/format_37.f90" run = true [[test]] filename = "../integration_tests/format_39.f90" run = true [[test]] filename = "../integration_tests/format_40.f90" run = true [[test]] filename = "../integration_tests/format_50.f90" run = true [[test]] filename = "../integration_tests/format_51.f90" run = true [[test]] filename = "../integration_tests/format_52.f90" run = true [[test]] filename = "../integration_tests/format_53.f90" run = true [[test]] filename = "../integration_tests/format_57.f90" run = true [[test]] filename = "../integration_tests/format_58.f90" run = true [[test]] filename = "../integration_tests/format_66.f90" run = true [[test]] filename = "../integration_tests/print_09.f90" run = true [[test]] filename = "../integration_tests/print_12.f90" run = true [[test]] filename = "../integration_tests/read_40.f90" run = true [[test]] filename = "interop/mod1-14.mod" mod_to_asr = true [[test]] filename = "fmt1.f90" interactive = true ast = true ast_f90 = true [[test]] filename = "assign.f90" ast = true ast_f90 = true [[test]] filename = "associate1.f90" interactive = true ast = true ast_f90 = true [[test]] filename = "fn_call1.f90" interactive = true ast = true ast_f90 = true [[test]] filename = "Subroutine_Call1.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/reserved_01.f90" ast_f90 = true [[test]] filename = "../integration_tests/reserved_02.f90" ast_f90 = true [[test]] filename = "../integration_tests/complex_01.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/complex_02.f90" ast = true asr = true [[test]] filename = "../integration_tests/complex_07.f90" asr = true [[test]] filename = "../integration_tests/complex_09.f90" asr = true [[test]] filename = "errors/complex_01.f90" asr = true [[test]] filename = "errors/incorrect_array_type_where_01.f90" asr = true [[test]] filename = "errors/incorrect_array_type_where_02.f90" asr = true [[test]] filename = "errors/incorrect_type_where_01.f90" asr = true [[test]] filename = "errors/incorrect_type_where_02.f90" asr = true [[test]] filename = "errors/incorrect_type_where_03.f90" asr = true [[test]] filename = "errors/incorrect_type_where_04.f90" asr = true [[test]] filename = "../integration_tests/complex_sub_test.f90" asr = true llvm = true [[test]] filename = "../integration_tests/complex_mul_test.f90" asr = true llvm = true [[test]] filename = "../integration_tests/complex_div_test.f90" asr = true llvm = true [[test]] filename = "../integration_tests/complex_pow_test.f90" asr = true llvm = true [[test]] filename = "complex1.f90" asr = true llvm = true [[test]] filename = "complex2.f90" asr = true llvm = true [[test]] filename = "complex3.f90" ast = true [[test]] filename = "../integration_tests/logical1.f90" asr = true llvm = true wat = true [[test]] filename = "../integration_tests/logical2.f90" asr = true llvm = true wat = true [[test]] filename = "../integration_tests/logical3.f90" asr = true llvm = true wat = true [[test]] filename = "../integration_tests/logical4.f90" asr = true llvm = true wat = true [[test]] filename = "../integration_tests/real_dp_01.f90" asr = true llvm = true [[test]] filename = "../integration_tests/real_dp_param.f90" asr = true llvm = true [[test]] filename = "../integration_tests/init_values.f90" asr = true llvm = true [[test]] filename = "../integration_tests/bin_op_real_dp.f90" asr = true llvm = true [[test]] filename = "../integration_tests/const_real_dp.f90" asr = true llvm = true [[test]] filename = "../integration_tests/int_dp.f90" asr = true llvm = true [[test]] filename = "../integration_tests/int_dp_param.f90" asr = true llvm = true [[test]] filename = "../integration_tests/complex_dp.f90" asr = true llvm = true [[test]] filename = "../integration_tests/complex_dp_param.f90" asr = true llvm = true [[test]] filename = "../integration_tests/bin_op_complex_dp.f90" asr = true llvm = true # sin [[test]] filename = "../integration_tests/intrinsics_02.f90" asr = true cpp = true llvm = true # sin [[test]] filename = "../integration_tests/sin_03.f90" asr = true llvm = true # cos [[test]] filename = "../integration_tests/intrinsics_03.f90" asr = true llvm = true # tan [[test]] filename = "../integration_tests/intrinsics_04.f90" asr = true # hyperbolics [[test]] filename = "../integration_tests/intrinsics_05.f90" asr = true llvm = true # inverse trignometric functions [[test]] filename = "../integration_tests/intrinsics_06.f90" asr = true llvm = true [[test]] filename = "../integration_tests/intrinsics_07.f90" asr = true # tiny (symboltable) [[test]] filename = "../integration_tests/intrinsics_08.f90" asr = true # tiny (body) [[test]] filename = "../integration_tests/intrinsics_09.f90" asr = true # real (body) [[test]] filename = "../integration_tests/intrinsics_10.f90" asr = true # real (symboltable) [[test]] filename = "../integration_tests/intrinsics_11.f90" asr = true # kind (body) [[test]] filename = "../integration_tests/intrinsics_12.f90" asr = true # kind (symboltable) [[test]] filename = "../integration_tests/intrinsics_13.f90" asr = true # selected_int,real_kind (parameter_04 has symboltable) [[test]] filename = "../integration_tests/intrinsics_14.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_20.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_23.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_26.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_27.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_28.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_29.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_30.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_31.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_33.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_34.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_35.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_36.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_39.f90" asr = true # all [[test]] filename = "../integration_tests/intrinsics_47.f90" asr = true # floor (body) [[test]] filename = "../integration_tests/floor_01.f90" asr = true # floor (symboltable) [[test]] filename = "../integration_tests/floor_02.f90" asr = true # int (body) [[test]] filename = "../integration_tests/int_01.f90" asr = true # int (symboltable) [[test]] filename = "../integration_tests/int_02.f90" asr = true # int (large integer) [[test]] filename = "../integration_tests/int_03.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_open_close_read_write.f90" asr = true [[test]] filename = "modules_03.f90" asr = true [[test]] filename = "modules_04.f90" asr = true ast_f90 = true [[test]] filename = "modules_05.f90" asr = true [[test]] filename = "modules_06.f90" ast = true asr = true [[test]] filename = "modules_07.f90" asr = true [[test]] filename = "modules_10.f90" asr_json = true [[test]] filename = "../integration_tests/modules_27.f90" asr = true extrafiles = "../integration_tests/modules_27_module1.f90, ../integration_tests/modules_27_module2.f90" [[test]] filename = "../integration_tests/modules_25.f90" asr = true extrafiles = "../integration_tests/modules_25_module.f90, ../integration_tests/modules_25_module1.f90" [[test]] filename = "../integration_tests/modules_28.f90" asr = true extrafiles = "../integration_tests/modules_28_module1.f90, ../integration_tests/modules_28_module2.f90" [[test]] filename = "../integration_tests/modules_29.f90" asr = true extrafiles = "../integration_tests/modules_29_module1.f90, ../integration_tests/modules_29_module2.f90, ../integration_tests/modules_29_module3.f90" [[test]] filename = "../integration_tests/modules_30.f90" asr = true extrafiles = "../integration_tests/modules_30_module1.f90, ../integration_tests/modules_30_module2.f90, ../integration_tests/modules_30_module3.f90, ../integration_tests/modules_30_module4.f90" [[test]] filename = "../integration_tests/modules_31.f90" asr = true extrafiles = "../integration_tests/modules_31_module1.f90, ../integration_tests/modules_31_module2.f90" [[test]] filename = "../integration_tests/modules_32.f90" asr = true [[test]] filename = "../integration_tests/modules_33.f90" asr = true extrafiles = "../integration_tests/modules_33_module1.f90, ../integration_tests/modules_33_module2.f90, ../integration_tests/modules_33_module3.f90" [[test]] filename = "../integration_tests/modules_34.f90" asr = true extrafiles = "../integration_tests/modules_34_module1a.f90, ../integration_tests/modules_34_module1.f90, ../integration_tests/modules_34_module2.f90, ../integration_tests/modules_34_module3.f90" [[test]] filename = "../integration_tests/modules_52.f90" asr = true extrafiles = "../integration_tests/modules_52_module3.f90, ../integration_tests/modules_52_module2.f90, ../integration_tests/modules_52_module1.f90" [[test]] filename = "../integration_tests/modules_60.f90" asr = true [[test]] filename = "../integration_tests/modules_36.f90" llvm = true [[test]] filename = "dependency_test_01.f90" asr = true [[test]] filename = "dependency_test_02.f90" asr = true [[test]] filename = "dependency_test_03.f90" asr = true extrafiles = "dependency_test_03_module.f90" [[test]] filename = "string.f90" ast_f90 = true [[test]] filename = "string1.f90" asr = true [[test]] filename = "string2.f90" asr = true extrafiles = "string1.f90" [[test]] filename = "../integration_tests/string_54.f90" asr = true llvm = true [[test]] filename = "../integration_tests/string_01.f90" ast = true asr = true llvm = true cpp = true [[test]] filename = "../integration_tests/string_02.f90" ast = true asr = true llvm = true [[test]] filename = "../integration_tests/string_03.f90" ast = true ast_f90 = true asr = true llvm = true [[test]] filename = "../integration_tests/string_04.f90" asr = true [[test]] filename = "../integration_tests/string_10.f90" asr = true llvm = true [[test]] filename = "../integration_tests/string_11.f90" asr = true llvm = true [[test]] filename = "../integration_tests/string_13.f90" asr = true llvm = true [[test]] filename = "../integration_tests/string_14.f90" asr = true [[test]] filename = "../integration_tests/string_17.f90" asr = true [[test]] filename = "../integration_tests/string_19.f90" asr = true [[test]] filename = "../integration_tests/string_12.f90" asr = true [[test]] filename = "errors/string_binop.f90" asr = true [[test]] filename = "../integration_tests/parsing_01.f90" ast = true [[test]] filename = "../integration_tests/parsing_02.f90" ast = true [[test]] filename = "../integration_tests/nested_01.f90" ast = true asr = true llvm = true [[test]] filename = "../integration_tests/nested_02.f90" ast = true asr = true llvm = true [[test]] filename = "../integration_tests/expr_05.f90" ast = true cpp = true ast_f90 = true julia = true fortran = true [[test]] filename = "../integration_tests/expr_06.f90" asr = true julia = true [[test]] filename = "../integration_tests/expr_07.f90" asr = true julia = true [[test]] filename = "../integration_tests/expr_08.f90" wat = true [[test]] filename = "../integration_tests/expr_09.f90" wat = true julia = true [[test]] filename = "../integration_tests/expr_11.f90" c = true julia = true [[test]] filename = "../integration_tests/modules_11.f90" ast = true asr = true llvm = true julia = true [[test]] filename = "../integration_tests/modules_12.f90" asr = true julia = true [[test]] filename = "../integration_tests/modules_24.f90" asr = true [[test]] filename = "../integration_tests/modules_15b.f90" asr = true [[test]] filename = "../integration_tests/goto_01.f90" ast = true ast_f90 = true julia = true [[test]] filename = "../integration_tests/goto_02.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/goto_03.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/goto_04.f90" asr = true julia = true [[test]] filename = "if1.f90" ast = true ast_f90 = true [[test]] filename = "if2.f90" ast = true ast_f90 = true [[test]] filename = "where1.f90" ast = true ast_f90 = true [[test]] filename = "implicit1.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/intent_01.f90" ast = true asr = true llvm = true [[test]] filename = "../integration_tests/nested_03.f90" asr = true llvm = true [[test]] filename = "../integration_tests/nested_04.f90" asr = true llvm = true [[test]] filename = "../integration_tests/nested_05.f90" asr = true llvm = true [[test]] filename = "../integration_tests/nested_06.f90" asr = true llvm = true [[test]] filename = "../integration_tests/nested_namelist_01.f90" asr = true pass = "nested_vars" [[test]] filename = "../integration_tests/nested_external_dedup_01.f90" asr = true pass = "nested_vars" [[test]] filename = "../integration_tests/nested_call_filter_01.f90" asr = true pass = "nested_vars" [[test]] filename = "../integration_tests/callback_01.f90" asr = true llvm = true [[test]] filename = "../integration_tests/callback_02.f90" asr = true llvm = true [[test]] filename = "../integration_tests/callback_03.f90" llvm = true [[test]] filename = "../integration_tests/callback_04.f90" llvm = true [[test]] filename = "../integration_tests/callback_05.f90" llvm = true [[test]] filename = "../integration_tests/recursion_01.f90" llvm = true [[test]] filename = "../integration_tests/recursion_02.f90" asr = true llvm = true [[test]] filename = "../integration_tests/recursion_03.f90" asr = true llvm = true [[test]] filename = "../integration_tests/return_01.f90" llvm = true [[test]] filename = "../integration_tests/return_02.f90" llvm = true [[test]] filename = "../integration_tests/return_03.f90" llvm = true [[test]] filename = "../integration_tests/return_05.f90" llvm = true [[test]] filename = "../integration_tests/return_06.f90" llvm = true [[test]] filename = "../integration_tests/binop_03.f90" llvm = true [[test]] filename = "../integration_tests/modules_13.f90" llvm = true [[test]] filename = "coarrays_01.f90" ast = true ast_f90 = true [[test]] filename = "coarrays_02.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/program_03.f90" asr = true llvm = true [[test]] filename = "../integration_tests/program_04.f90" ast = true ast_f90 = true [[test]] filename = "use_statement.f90" ast = true [[test]] filename = "return1.f90" ast = true [[test]] filename = "defop1.f90" ast = true ast_f90 = true [[test]] filename = "critical1.f90" ast = true ast_f90 = true [[test]] filename = "block_data1.f90" ast = true ast_f90 = true [[test]] filename = "block1.f90" ast = true ast_f90 = true [[test]] filename = "common1.f90" ast = true ast_f90 = true [[test]] filename = "common3.f90" ast_f90 = true [[test]] filename = "data1.f90" ast = true ast_f90 = true [[test]] filename = "optional_01.f90" asr = true [[test]] filename = "optional_02.f90" pass = "transform_optional_argument_functions" [[test]] filename = "optional_03.f90" pass = "transform_optional_argument_functions" [[test]] filename = "attributes1.f90" ast = true ast_f90 = true [[test]] filename = "arrayelements1.f90" ast_f90 = true [[test]] filename = "flush1.f90" ast = true ast_f90 = true [[test]] filename = "flush2.f90" asr = true [[test]] filename = "../integration_tests/class_01.f90" asr = true llvm = true [[test]] filename = "../integration_tests/class_02.f90" asr = true llvm = true [[test]] filename = "../integration_tests/class_04.f90" asr = true llvm = true [[test]] filename = "print1.f90" ast = true ast_f90 = true [[test]] filename = "print2.f90" ast = true ast_f90 = true [[test]] filename = "print3.f90" print_leading_space = true asr = true run = true [[test]] filename = "print4.f90" run = true [[test]] filename = "print5.f90" run = true [[test]] filename = "print_intrinsics.f90" asr = true run = true [[test]] filename = "uppercase1.f90" asr = true [[test]] filename = "fixed_form1.f" ast = true ast_f90 = true [[test]] filename = "fixed_form2.f" ast = true [[test]] filename = "fixed_form3.f" ast = true [[test]] filename = "fixed_form4.f" ast = true [[test]] filename = "fixed_form_without_newline.f" ast = true [[test]] filename = "fixed_form_with_exit.f" ast = true [[test]] filename = "fixedform_doloop.f" ast = true [[test]] filename = "fixedform_doloop2.f" ast = true [[test]] filename = "fixedform_doloop3.f" ast = true [[test]] filename = "fixedform_assign_minimal.f" ast = true [[test]] filename = "fixedform_assignment.f" ast = true [[test]] filename = "fixedform_nestedloop_implicit.f" ast = true [[test]] filename = "fixedform_subroutine.f" ast = true [[test]] filename = "fixedform_subroutine2.f" ast = true [[test]] filename = "fixedform_return2.f" ast = true [[test]] filename = "fixedform_data.f" ast = true [[test]] filename = "fixedform_module.f" ast = true [[test]] filename = "fixed_form_interface.f" ast = true [[test]] filename = "fixed_form_line_limit.f" ast = true [[test]] filename = "../integration_tests/format_03.f" ast = true [[test]] filename = "../integration_tests/format_08.f90" run = true [[test]] filename = "comments1.f90" ast = true [[test]] filename = "constant_kinds.f90" asr = true [[test]] filename = "../integration_tests/const_kind_01.f90" asr = true [[test]] filename = "../integration_tests/const_kind_02.f90" asr = true [[test]] filename = "../integration_tests/generic_name_01.f90" asr = true llvm = true [[test]] filename = "../integration_tests/operator_overloading_01.f90" asr = true llvm = true [[test]] filename = "../integration_tests/operator_overloading_02.f90" asr = true llvm = true [[test]] filename = "../integration_tests/operator_overloading_03.f90" asr = true llvm = true [[test]] filename = "../integration_tests/operator_overloading_04.f90" asr = true [[test]] filename = "../integration_tests/operator_overloading_08.f90" asr = true [[test]] filename = "team1.f90" ast = true ast_f90 = true [[test]] filename = "sync1.f90" ast = true ast_f90 = true [[test]] filename = "entry1.f90" ast = true ast_f90 = true asr_implicit_interface_and_typing = true [[test]] filename = "entry2.f90" asr_implicit_interface_and_typing = true [[test]] filename = "../integration_tests/entry_02.f90" asr = true [[test]] filename = "../integration_tests/entry_05.f90" asr = true [[test]] filename = "../integration_tests/entry_06.f90" asr = true [[test]] filename = "issue532.f90" asr = true llvm = true [[test]] filename = "../integration_tests/bits_01.f90" asr = true [[test]] filename = "../integration_tests/bits_02.f90" asr = true llvm = true [[test]] filename = "../integration_tests/bits_03.f90" asr = true [[test]] filename = "../integration_tests/bits_04.f90" asr = true [[test]] filename = "../integration_tests/boz_01.f90" asr = true llvm = true [[test]] filename = "substring.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/forall_01.f90" asr = true [[test]] filename = "../integration_tests/nullify_01.f90" ast = true asr = true llvm = true [[test]] filename = "../integration_tests/nullify_02.f90" ast = true asr = true llvm = true [[test]] filename = "../integration_tests/nullify_03.f90" asr = true [[test]] filename = "../integration_tests/nullify_04.f90" asr = true [[test]] filename = "../integration_tests/kwargs_02.f90" asr = true [[test]] filename = "../integration_tests/flip_sign.f90" asr = true pass = "flip_sign" [[test]] filename = "../integration_tests/fma.f90" asr = true pass = "fma" [[test]] filename = "../integration_tests/loop_unroll_small.f90" asr = true pass = "loop_unroll" [[test]] filename = "../integration_tests/loop_unroll_large.f90" asr = true pass = "loop_unroll" [[test]] filename = "../integration_tests/div_to_mul.f90" asr = true pass = "div_to_mul" [[test]] filename = "../integration_tests/sign_from_value.f90" asr = true pass = "sign_from_value" [[test]] filename = "../integration_tests/functions_04.f90" asr = true [[test]] filename = "../integration_tests/functions_05.f90" asr = true pass_with_llvm = true pass = "inline_function_calls" fast = true [[test]] filename = "../integration_tests/functions_06.f90" asr = true [[test]] filename = "../integration_tests/functions_07.f90" asr = true pass_with_llvm = true pass = "inline_function_calls" fast = true [[test]] filename = "../integration_tests/functions_08.f90" asr = true pass_with_llvm = true pass = "inline_function_calls" fast = true [[test]] filename = "../integration_tests/functions_09.f90" asr = true [[test]] filename = "../integration_tests/functions_10.f90" asr = true asr_clojure = true [[test]] filename = "../integration_tests/functions_12.f90" asr = true [[test]] filename = "../integration_tests/functions_13.f90" asr = true [[test]] filename = "../integration_tests/functions_14.f90" llvm = true [[test]] filename = "../integration_tests/functions_15.f90" asr = true pass = "transform_optional_argument_functions" [[test]] filename = "../integration_tests/functions_16.f90" asr = true [[test]] filename = "bits1.f90" asr = true [[test]] filename = "../integration_tests/bindc1.f90" asr = true llvm = true [[test]] filename = "../integration_tests/bindc2.f90" asr = true [[test]] filename = "../integration_tests/bindc3.f90" asr = true llvm = true [[test]] filename = "../integration_tests/bindc4.f90" asr = true [[test]] filename = "../integration_tests/bindc_06.f90" asr = true [[test]] filename = "../integration_tests/cmd_01.f90" asr = true [[test]] filename = "../integration_tests/cmd_02.f90" asr = true [[test]] filename = "errors/c_f_pointer_01.f90" asr = true [[test]] filename = "errors/c_f_pointer_02.f90" asr = true [[test]] filename = "errors/continue_compilation_1.f90" semantics_only_cc = true [[test]] filename = "errors/continue_compilation_2.f90" semantics_only_cc = true [[test]] filename = "errors/continue_compilation_3.f90" semantics_only_cc = true [[test]] filename = "errors/continue_compilation_coarrays.f90" semantics_only_cc = true [[test]] filename = "errors/continue_compilation_ff_1.f" fixed_form_cc_asr = true [[test]] filename = "errors/continue_compilation_ff_2.f" fixed_form_cc_asr = true [[test]] filename = "errors/continue_compilation_simd.f90" semantics_only_cc = true [[test]] filename = "errors/mre_segfault.f90" continue_compilation = true [[test]] filename = "errors/mre_parameter.f90" continue_compilation = true [[test]] filename = "../integration_tests/realloc_lhs_20.f90" run = true [[test]] filename = "../integration_tests/realloc_lhs_22.f90" run = true [[test]] filename = "../integration_tests/rewind_inquire_flush.f90" asr = true [[test]] filename = "../integration_tests/derived_types_16_module.f90" asr = true [[test]] filename = "../integration_tests/derived_types_15.f90" asr = true [[test]] filename = "../integration_tests/derived_types_18.f90" asr = true [[test]] filename = "../integration_tests/derived_types_32.f90" llvm = true [[test]] filename = "../integration_tests/derived_types_41.f90" asr = true [[test]] filename = "../integration_tests/derived_types_45.f90" llvm = true [[test]] filename = "../integration_tests/automatic_allocation_02.f90" llvm = true options = "--realloc-lhs-arrays" # TODO: StructType - Uncomment below test after supporting type-inheritance in type-checking # [[test]] # filename = "../integration_tests/derived_types_20.f90" # asr = true # pass = "class_constructor" # extrafiles = "../integration_tests/derived_types_20_module2.f90, ../integration_tests/derived_types_20_module1.f90" [[test]] filename = "../integration_tests/modules_35.f90" asr = true pass = "implied_do_loops" [[test]] filename = "../integration_tests/modules_37.f90" asr = true pass = "pass_array_by_data,transform_optional_argument_functions" [[test]] filename = "../integration_tests/modules_39.f90" asr = true pass = "pass_array_by_data,transform_optional_argument_functions" extrafiles = "../integration_tests/modules_39_module.f90" [[test]] filename = "../integration_tests/modules_40.f90" asr = true pass = "pass_array_by_data,transform_optional_argument_functions" [[test]] filename = "../integration_tests/modules_43.f90" asr = true pass = "array_op" [[test]] filename = "../integration_tests/modules_44.f90" asr = true extrafiles = "../integration_tests/modules_44_module.f90" pass = "pass_array_by_data" [[test]] filename = "../integration_tests/modules_45.f90" asr = true pass = "pass_array_by_data,transform_optional_argument_functions" [[test]] filename = "../integration_tests/modules_48.f90" asr = true [[test]] filename = "implicit_typing1.f90" asr_implicit_typing = true asr_disable_implicit_typing = true enable_and_disable_implicit_typing = true [[test]] filename = "implicit_typing2.f90" asr_implicit_typing = true [[test]] filename = "allow_implicit_interface.f90" asr_implicit_interface = true [[test]] filename = "allow_implicit_interface5.f90" asr_implicit_interface_and_typing = true [[test]] filename = "implicit_interface_allocatable_array.f90" asr_implicit_interface = true [[test]] filename = "implicit_interface2.f90" asr_implicit_interface = true [[test]] filename = "implicit_interface5.f90" asr_implicit_interface = true [[test]] filename = "implicit_interface3.f90" asr_implicit_interface_and_typing = true [[test]] filename = "implicit_interface4.f90" asr_implicit_interface_and_typing = true [[test]] filename = "allow_implicit_interface2.f90" asr_implicit_interface_and_typing = true [[test]] filename = "../integration_tests/implicit_interface_04.f90" asr_implicit_interface_and_typing_with_llvm = true [[test]] filename = "external_01.f90" asr_implicit_interface_and_typing = true [[test]] filename = "external_02.f90" asr_implicit_interface_and_typing = true asr_implicit_interface_and_typing_with_llvm = true [[test]] filename = "external_03.f90" asr_implicit_interface_and_typing = true asr_implicit_interface_and_typing_with_llvm = true [[test]] filename = "external_04.f90" asr_implicit_interface_and_typing_with_llvm = true [[test]] filename = "dimension_attr2.f90" asr_implicit_typing = true [[test]] filename = "dimension_attr.f" ast = true asr = true [[test]] filename = "errors/fixed_form_1.f" ast = true [[test]] filename = "errors/fixed_form_2.f" ast = true [[test]] filename = "errors/fixed_form_3.f" ast = true [[test]] filename = "errors/fixed_form_4.f" ast = true [[test]] filename = "errors/fixed_form_5.f" ast = true [[test]] filename = "errors/arithmetic_if1.f90" asr = true [[test]] filename = "errors/assign_01.f90" asr = true semantics_only_cc = true [[test]] filename = "fixed_form_if_variations.f" ast = true asr = true [[test]] filename = "sole_intrinsic.f" ast = true asr = true [[test]] filename = "fixed_form_simple_continue.f" ast = true asr = true [[test]] filename = "loop_test1.f" ast = true asr = true [[test]] filename = "loop_test2.f" ast = true asr = true [[test]] filename = "loop_test3.f" ast = true [[test]] filename = "loop_test4.f" ast = true [[test]] filename = "loop_test5.f" ast = true [[test]] filename = "continue_body_if_loop.f" ast = true asr = true [[test]] filename = "fixed_form/end_label.f" ast = true [[test]] filename = "fixed_form/call1.f" ast = true [[test]] filename = "fixed_form/assign1.f" ast = true [[test]] filename = "fixed_form/block_data1.f" ast = true [[test]] filename = "fixed_form/double_complex1.f" ast = true [[test]] filename = "fixed_form/auxiliary_IO_1.f" ast = true [[test]] filename = "fixed_form/include1.f" ast = true [[test]] filename = "fixed_form/real8_1.f" ast = true [[test]] filename = "fixed_form/do1.f" ast = true [[test]] filename = "fixed_form/do2.f" ast = true [[test]] filename = "fixed_form/data1.f" ast = true [[test]] filename = "fixed_form/else1.f" ast = true [[test]] filename = "fixed_form/error_stop1.f" ast = true [[test]] filename = "fixed_form/error_stop2.f" ast = true [[test]] filename = "fixed_form/crlf1.f" ast = true [[test]] filename = "fixed_form/contains1.f" ast = true [[test]] filename = "fixed_form/while_02_fixed_form.f" ast = true [[test]] filename = "fixed_form/use1.f" ast = true [[test]] filename = "intrinsic_implicit.f90" asr_implicit_interface_and_typing = true [[test]] filename = "parameter1.f90" ast = true asr = true [[test]] filename = "variable1.f90" asr_implicit_interface = true [[test]] filename = "fixed_form_implicit_check.f" ast = true asr_implicit_interface_and_typing = true fixed_free_equal_asr = true [[test]] filename = "implicit_check.f90" ast = true asr_implicit_interface_and_typing = true fixed_free_equal_asr = true [[test]] filename = "fixed_form_implicit1.f" ast = true asr = true [[test]] filename = "fixed_form_implicit2.f" ast = true asr_implicit_interface_and_typing = true [[test]] filename = "fixed_form_implicit3.f" ast = true [[test]] filename = "fixed_form_call1.f" asr_implicit_interface = true [[test]] filename = "fixed_form_call2.f" asr_implicit_interface = true [[test]] filename = "fixed_form_call3.f" asr_implicit_interface = true [[test]] filename = "fixed_form_goto_select.f" ast = true asr = true [[test]] filename = "implicit2.f90" asr = true [[test]] filename = "errors/implicit3.f90" asr = true [[test]] filename = "implicit3.f90" asr_implicit_typing = true [[test]] filename = "implicit4.f90" asr_implicit_typing = true [[test]] filename = "implicit5.f90" asr_implicit_typing = true [[test]] filename = "implicit6.f90" asr_implicit_typing = true [[test]] filename = "implicit7.f90" asr = true asr_implicit_typing = true [[test]] filename = "implicit8.f90" asr = true asr_implicit_typing = true [[test]] filename = "implicit9.f90" asr = true asr_implicit_typing = true [[test]] filename = "implicit10.f90" asr = true asr_implicit_typing = true ast_disable_style_suggestion = true [[test]] filename = "implicit11.f90" asr_implicit_typing = true [[test]] filename = "implicit12.f90" asr = true asr_implicit_typing = true [[test]] filename = "implicit13.f90" asr_implicit_typing = true [[test]] filename = "fixed_form/assign_to1.f" ast = true [[test]] filename = "fixed_form/assign_to2.f" ast = true [[test]] filename = "fixed_form/assign_to3.f" ast = true [[test]] filename = "../integration_tests/assign_to1.f90" ast = true asr_implicit_typing = true [[test]] filename = "../integration_tests/assign_to2.f90" ast = true asr_implicit_typing = true [[test]] filename = "../integration_tests/conv_complex2real.f90" asr = true [[test]] filename = "../integration_tests/statement1.f90" asr = true [[test]] filename = "no_prescan_include1.f90" interactive = true ast = true ast_no_prescan = true [[test]] filename = "no_prescan_include2.f90" ast = true ast_no_prescan = true [[test]] filename = "../integration_tests/implied_do_loops1.f90" asr = true [[test]] filename = "../integration_tests/implied_do_loops2.f90" asr = true [[test]] filename = "../integration_tests/implied_do_loops3.f90" asr = true [[test]] filename = "../integration_tests/implied_do_loops10.f90" ast = true [[test]] filename = "array10.f90" asr = true [[test]] filename = "statement1.f90" asr = true [[test]] filename = "data2.f90" asr = true [[test]] filename = "data3.f90" asr = true [[test]] filename = "special_chars_json.f90" ast_json = true asr_json = true [[test]] filename = "redeclaration1.f90" asr_implicit_typing = true [[test]] filename = "character1.f90" asr_implicit_interface = true [[test]] filename = "../integration_tests/interface_12.f90" llvm = true [[test]] filename = "save1.f90" asr = true [[test]] filename = "save2.f90" asr = true [[test]] filename = "save3.f90" asr = true [[test]] filename = "save4.f90" asr_disable_warnings = true asr_disable_style_suggestion_and_warnings = true [[test]] filename = "style1.f90" asr_disable_warnings = true asr_enable_style_suggestion = true enable_disable_style_suggestion = true [[test]] filename = "../integration_tests/c_ptr_02.f90" asr = true [[test]] filename = "../integration_tests/save_03.f90" asr = true [[test]] filename = "allow_implicit_interface3.f90" asr_implicit_interface = true [[test]] filename = "fixed_form5.f" ast = true [[test]] filename = "errors/private1.f90" asr = true [[test]] filename = "errors/private2.f90" asr = true [[test]] filename = "../integration_tests/private1.f90" asr = true [[test]] filename = "block2.f90" asr = true [[test]] filename = "errors/do_loop_01.f90" asr = true [[test]] filename = "implicit_typing4.f90" asr_implicit_typing = true [[test]] filename = "errors/kind1.f90" asr = true [[test]] filename = "errors/kind2.f90" asr = true [[test]] filename = "errors/intent1.f90" asr = true [[test]] filename = "errors/do_zero_increment.f90" asr = true [[test]] filename = "errors/implicit_typing1.f90" asr_implicit_typing = true [[test]] filename = "errors/implicit_typing2.f90" asr_implicit_typing = true [[test]] filename = "errors/implicit_typing3.f90" asr_implicit_typing = true [[test]] filename = "errors/derived_type_01.f90" asr = true [[test]] filename = "errors/derived_type_02.f90" asr = true [[test]] filename = "errors/derived_type_03.f90" asr = true [[test]] filename = "errors/derived_type_04.f90" asr = true [[test]] filename = "errors/derived_type_05.f90" asr = true [[test]] filename = "errors/derived_type_06.f90" run = true [[test]] filename = "errors/array_01.f90" asr = true [[test]] filename = "errors/array_02.f90" asr = true [[test]] filename = "errors/array_03.f90" asr = true [[test]] filename = "errors/array_04.f90" asr = true [[test]] filename = "errors/array_05.f90" asr = true [[test]] filename = "errors/array_05_cc.f90" semantics_only_cc = true [[test]] filename = "errors/array_06.f90" asr = true [[test]] filename = "../integration_tests/where_02.f90" asr = true pass = "where" [[test]] filename = "../integration_tests/where_03.f90" asr = true pass = "where" [[test]] filename = "../integration_tests/where_04.f90" asr = true pass = "where" [[test]] filename = "common2.f" ast = true asr = true [[test]] filename = "../integration_tests/common_03.f90" asr = true [[test]] filename = "../integration_tests/common_04.f90" asr = true [[test]] filename = "../integration_tests/common_05.f90" asr = true [[test]] filename = "../integration_tests/common_06.f90" asr = true [[test]] filename = "../integration_tests/common_13.f90" asr = true [[test]] filename = "errors/common1.f90" asr = true [[test]] filename = "errors/intrinsics1.f90" asr = true [[test]] filename = "errors/intrinsics2.f90" asr = true [[test]] filename = "errors/scalar_allocation_check_01.f90" run = true [[test]] filename = "errors/scalar_allocation_check_02.f90" run = true [[test]] filename = "errors/scalar_allocation_check_03.f90" run = true [[test]] filename = "errors/scalar_allocation_check_04.f90" run = true [[test]] filename = "errors/scalar_allocation_check_05.f90" run = true [[test]] filename = "errors/scalar_allocation_check_06.f90" run = true [[test]] filename = "errors/matmul_unallocated_01.f90" run = true [[test]] filename = "errors/array_bounds_check_01.f90" run = true [[test]] filename = "errors/array_bounds_check_02.f90" run = true [[test]] filename = "errors/array_bounds_check_03.f90" run = true [[test]] filename = "errors/array_bounds_check_04.f90" run = true options = "--strict-array-bounds-checking" [[test]] filename = "errors/array_bounds_check_05.f90" run = true [[test]] filename = "errors/array_bounds_check_06.f90" run = true [[test]] filename = "errors/array_bounds_check_07.f90" run = true [[test]] filename = "errors/array_bounds_check_08.f90" run = true [[test]] filename = "errors/array_bounds_check_09.f90" run = true [[test]] filename = "errors/array_bounds_check_10.f90" run = true [[test]] filename = "errors/array_bounds_check_11.f90" run = true [[test]] filename = "errors/array_bounds_check_12.f90" run = true [[test]] filename = "errors/array_bounds_check_13.f90" run = true [[test]] filename = "errors/array_bounds_check_14.f90" run = true [[test]] filename = "errors/array_bounds_check_15.f90" run = true [[test]] filename = "../integration_tests/statement_01.f90" asr_implicit_interface_and_typing = true [[test]] filename = "../integration_tests/statement_02.f90" asr_implicit_interface_and_typing = true [[test]] filename = "../integration_tests/statement_03.f90" asr_implicit_interface_and_typing = true [[test]] filename = "allow_implicit_interface4.f90" asr_implicit_interface_and_typing = true [[test]] filename = "external3.f90" asr_implicit_interface_and_typing = true [[test]] filename = "external4.f90" asr_implicit_interface_and_typing = true [[test]] filename = "external5.f90" asr_implicit_interface_and_typing = true [[test]] filename = "pragma1.f90" ast_openmp = true asr_openmp = true [[test]] filename = "pragma2.f90" ast = true asr = true asr_ignore_pragma = true c = true [[test]] filename = "../integration_tests/matmul_01.f90" asr = true [[test]] filename = "errors/external1.f90" asr = true # Parser [[test]] filename = "parser/program_without_line_01.f90" ast = true [[test]] filename = "parser/program_without_line_02.f90" ast = true [[test]] filename = "parser/program_without_line_03.f90" ast = true [[test]] filename = "parser/program_without_line_04.f90" ast = true [[test]] filename = "parser/program_without_line_05.f90" ast = true [[test]] filename = "parser/program_without_line_06.f90" ast = true [[test]] filename = "parser/program_without_line_07.f90" ast = true [[test]] filename = "parser/derived_type_without_start_program.f90" ast = true [[test]] filename = "parser/enum_decl_without_start_program.f90" ast = true [[test]] filename = "parser/parameter_without_start_program.f90" ast = true [[test]] filename = "parser/procedure_with_type.f90" ast = true [[test]] filename = "parser/data_stmt_with_implied_do_loop.f" ast = true # Parser errors [[test]] filename = "errors/program_without_line_01.f90" ast = true [[test]] filename = "errors/program_without_line_cc.f90" syntax_only_cc = true show_asr_with_cc = true [[test]] filename = "errors/program_without_line_02.f90" ast = true [[test]] filename = "errors/program_without_line_03.f90" ast = true [[test]] filename = "errors/program_without_line_04.f90" ast = true [[test]] filename = "external1.f90" asr_implicit_interface_and_typing = true [[test]] filename = "errors/implicit_typing4.f90" asr_implicit_typing = true [[test]] filename = "external2.f90" asr_implicit_interface_and_typing = true [[test]] filename = "../integration_tests/data_implied_do_01.f90" asr = true [[test]] filename = "errors/subroutine1.f90" asr = true [[test]] filename = "errors/subroutine2.f90" asr = true [[test]] filename = "errors/subroutine3.f90" asr = true [[test]] filename = "errors/implicit_call_01.f90" asr_implicit_typing = true [[test]] filename = "../integration_tests/implicit_argument_casting_01.f90" asr_implicit_argument_casting = true enable_disable_implicit_argument_casting = true options = "--legacy-array-sections" [[test]] filename = "../integration_tests/valid_array_assignment_same_length_different_start.f90" obj = true [[test]] filename = "errors/end_sub_name.f90" asr = true [[test]] filename = "errors/end_program_name.f90" asr = true [[test]] filename = "errors/runtime_stacktrace_01.f90" run_with_dbg = true [[test]] filename = "../integration_tests/legacy_array_sections_01.f90" llvm = true options = "--legacy-array-sections" [[test]] filename = "format2.f90" llvm = true [[test]] filename = "errors/type_conflict1.f90" asr = true [[test]] filename = "char1.f90" fortran = true [[test]] filename = "integer_to_real_cast_in_comparison.f90" fortran = true [[test]] filename = "real_to_integer_cast_fortran_codegen.f90" fortran = true [[test]] filename = "real_to_real_cast_fortran_codegen.f90" fortran = true [[test]] filename = "int_to_int_cast_fortran_codegen.f90" fortran = true [[test]] filename = "real_to_complex_cast_in_comparison.f90" fortran = true [[test]] filename = "complex_to_complex_cast_fortran_codegen.f90" fortran = true [[test]] filename = "int_to_complex_cast_in_comparison.f90" fortran = true [[test]] filename = "cast_node_m_value.f90" asr = true [[test]] filename = "errors/loop_test.f90" asr = true [[test]] filename = "errors/parameter_01.f90" asr = true [[test]] filename = "errors/float1.f90" asr = true [[test]] filename = "errors/dfloat1.f90" asr = true [[test]] filename = "errors/end_module_name.f90" ast = true [[test]] filename = "errors/end_submodule_name.f90" ast = true [[test]] filename = "errors/integer16.f90" ast = true [[test]] filename = "errors/string_slice.f90" asr = true [[test]] filename = "errors/string_slice2.f90" asr = true [[test]] filename = "../integration_tests/max_01.f90" asr = true [[test]] filename = "../integration_tests/max_02.f90" asr = true [[test]] filename = "../integration_tests/min_01.f90" asr = true [[test]] filename = "../integration_tests/min_02.f90" asr = true [[test]] filename = "errors/open_invalid_kwarg1.f90" asr = true [[test]] filename = "errors/close_invalid_kwarg1.f90" asr = true [[test]] filename = "errors/rewind_invalid_kwarg1.f90" asr = true [[test]] filename = "errors/flush_invalid_kwarg1.f90" asr = true [[test]] filename = "warnings/open_notimplemented_kwarg1.f90" asr = true [[test]] filename = "errors/substring_startidx.f90" asr = true [[test]] filename = "errors/substring_endidx.f90" asr = true [[test]] filename = "errors/substring_stride.f90" [[test]] filename = "shiftl1.f90" asr = true [[test]] filename = "errors/fixed_number_of_args.f90" asr = true [[test]] filename = "errors/compare_01.f90" asr = true [[test]] filename = "../integration_tests/polymorphic_class_compare.f90" asr = true [[test]] filename = "../integration_tests/nested_struct_proc_01.f90" asr = true [[test]] filename = "errors/kind_string_of_int.f90" asr = true [[test]] filename = "errors/kind_float_of_int.f90" asr = true [[test]] filename = "errors/kind_var_of_int.f90" asr = true [[test]] filename = "errors/kind_invalid_int_of_int.f90" asr = true [[test]] filename = "errors/kind_invalid_int_of_logical.f90" asr = true [[test]] filename = "errors/kind_invalid_int_of_complex.f90" asr = true [[test]] filename = "errors/kind_star_of_int.f90" asr = true [[test]] filename = "errors/kind_star_of_complex.f90" asr = true [[test]] filename = "errors/kind_star_of_logical.f90" asr = true [[test]] filename = "errors/cmplx_01.f90" asr = true [[test]] filename = "errors/cmplx_02.f90" asr = true [[test]] filename = "errors/cmplx_03.f90" asr = true [[test]] filename = "errors/array_constructor_with_different_types.f90" asr = true [[test]] filename = "errors/array_constructor_with_integer_real_array_types.f90" asr = true [[test]] filename = "errors/array_constructor_with_different_kind.f90" asr = true [[test]] filename = "errors/array_constructor_with_asterisk_in_type_spec.f90" asr = true [[test]] filename = "errors/array_constructor_with_different_char_lengths.f90" asr = true [[test]] filename = "errors/incorrect_allocate_for_array.f90" asr = true [[test]] filename = "errors/incompatible_ranks_allocatable_arr1.f90" asr = true [[test]] filename = "errors/incompatible_ranks_allocatable_arr2.f90" asr = true [[test]] filename = "errors/incompatible_dimension_assignment_arr1.f90" asr = true [[test]] filename = "errors/incompatible_dimension_assignment_arr2.f90" asr = true [[test]] filename = "errors/incompatible_dimension_logical_arrays_logical_binop_01.f90" asr = true [[test]] filename = "errors/incompatible_dimension_logical_arrays_logical_binop_02.f90" asr = true [[test]] filename = "errors/end_function_name_not_match.f90" ast = true [[test]] filename = "errors/class_procedure_extra_args.f90" asr = true [[test]] filename = "errors/incorrect_number_args_function.f90" asr = true [[test]] filename = "errors/incorrect_number_args_subroutine.f90" asr = true [[test]] filename = "optional_argument_subroutine_in_type.f90" asr = true [[test]] filename = "errors/more_kwargs_than_acceptable_to_subroutine.f90" asr = true [[test]] filename = "warnings/doloop_01.f90" asr = true [[test]] filename = "warnings/rand_01.f90" asr = true [[test]] filename = "warnings/sizeof_01.f90" asr = true [[test]] filename = "char_arr_assignment.f90" asr = true [[test]] filename = "character2.f90" asr = true [[test]] filename = "errors/specific_type_intrinsic.f90" asr = true [[test]] filename = "errors/sqrt_neg.f90" asr = true [[test]] filename = "errors/idint_real4.f90" asr = true [[test]] filename = "errors/ishftc_size.f90" asr = true [[test]] filename = "errors/merge_bits_comp.f90" asr = true [[test]] filename = "errors/merge_bits_run.f90" asr = true [[test]] filename = "errors/dlgama_arg.f90" asr = true [[test]] filename = "errors/dreal_arg_error.f90" asr = true [[test]] filename = "errors/coarray_01.f90" asr = true [[test]] filename = "errors/coarray_02.f90" asr = true [[test]] filename = "errors/atomic_01.f90" asr = true [[test]] filename = "errors/iostat_non_scalar_value.f90" asr = true [[test]] filename = "errors/iostat_constant_integer.f90" asr = true [[test]] filename = "character_parameter_padding_trimming.f90" asr = true [[test]] filename = "errors/type_casting_01.f90" asr = true [[test]] filename = "openmp1.f90" asr_openmp = true [[test]] filename = "errors/intrinsics3.f90" asr = true [[test]] filename = "errors/intrinsics4.f90" asr = true [[test]] filename = "errors/intrinsics5.f90" asr = true [[test]] filename = "errors/intrinsics6.f90" asr = true [[test]] filename = "errors/intrinsics7.f90" asr = true [[test]] filename = "errors/intrinsics8.f90" asr = true [[test]] filename = "errors/intrinsics9.f90" asr = true [[test]] filename = "errors/intrinsics10.f90" asr = true [[test]] filename = "errors/intrinsics11.f90" asr = true [[test]] filename = "errors/int_01.f90" asr = true [[test]] filename = "errors/ichar_01.f90" asr = true [[test]] filename = "errors/do_concurrent1.f90" asr = true [[test]] filename = "errors/intrinsics12.f90" asr = true [[test]] filename = "errors/intrinsics13.f90" asr = true [[test]] filename = "errors/modulo_01.f90" asr = true [[test]] filename = "errors/sign_01.f90" asr = true [[test]] filename = "errors/dprod_01.f90" asr = true [[test]] filename = "errors/ifix_01.f90" asr = true [[test]] filename = "errors/intrinsics14.f90" asr = true [[test]] filename = "errors/intrinsics15.f90" asr = true [[test]] filename = "exit1.f90" run = true [[test]] filename = "exit2.f90" run = true [[test]] filename = "errors/kind_01.f90" asr = true [[test]] filename = "errors/dim_float_01.f90" asr = true [[test]] filename = "errors/dim_float_02.f90" asr = true [[test]] filename = "errors/dim_float_03.f90" asr = true [[test]] filename = "implied_do_loop1.f90" run = true [[test]] filename = "multi_error1.f90" ast = true semantics_only_cc = true [[test]] filename = "collect_occurence1.f90" rename_symbol = true line = 10 column = 8 [[test]] filename = "collect_occurence2.f90" rename_symbol = true line = 7 column = 11 [[test]] filename = "collect_occurence3.f90" rename_symbol = true line = 6 column = 11 [[test]] filename = "collect_occurence4.f90" rename_symbol = true line = 9 column = 13 [[test]] filename = "../integration_tests/multiple_objects_args.f90" pass = "class_constructor" [[test]] filename = "errors/incompatible_rank_assign.f90" asr = true [[test]] filename = "errors/array_shape_01.f90" asr = true [[test]] filename = "errors/array_shape_02.f90" asr = true [[test]] filename = "errors/array_shape_05.f90" run = true [[test]] filename = "function_call1.f90" asr = true lookup_name = true line = 18 column = 22 [[test]] filename = "lookup_name1.f90" lookup_name = true line = 3 column = 12 [[test]] filename = "lookup_name2.f90" lookup_name = true line = 5 column = 11 [[test]] filename = "lookup_name3.f90" lookup_name = true line = 6 column = 2 [[test]] filename = "lookup_name4.f90" lookup_name = true line = 22 column = 18 [[test]] filename = "errors/func_parameter_type.f90" asr = true [[test]] filename = "../integration_tests/func_parameter_type_02.f90" asr_implicit_interface_and_typing = true [[test]] filename = "errors/func_arg_array.f90" asr = true [[test]] filename = "errors/duplicate_module_procedures.f90" asr = true [[test]] filename = "errors/string_negative_start_index.f90" asr = true [[test]] filename = "errors/string_assignment_01.f90" run = true [[test]] filename = "errors/string_assignment_02.f90" run = true [[test]] filename = "errors/string_allocation_01.f90" run = true [[test]] filename = "errors/dimension_01.f90" asr = true [[test]] filename = "errors/dimension_02.f90" asr = true [[test]] filename = "errors/program_variable.f90" asr = true [[test]] filename = "errors/data_implied_do1.f90" asr = true [[test]] filename = "errors/data_implied_do2.f90" asr = true [[test]] filename = "errors/data_implied_do3.f90" asr = true [[test]] filename = "errors/init1.f90" ast = true [[test]] filename = "../integration_tests/enum_01.f90" fortran = true [[test]] filename = "polymorphic_class_in_derived_type.f90" asr = true [[test]] filename = "errors/show_errors1.f90" show_errors = true [[test]] filename = "document_symbols1.f90" document_symbols = true extrafiles = "document_symbols1_module.f90" [[test]] filename = "../integration_tests/loop_var_use_after_loop.f90" pass = "do_loops" options = "--use-loop-variable-after-loop" [[test]] filename = "../integration_tests/use_02.f90" asr = true [[test]] filename = "../integration_tests/polymorphic_arguments_02.f90" asr = true [[test]] filename = "parse_without_program_line.f90" ast = true [[test]] filename = "interactive_parse_without_program_line.f90" options = "--interactive-parse" ast = true [[test]] filename = "interface_generic_procedure_same_name.f90" asr = true [[test]] filename = "errors/subroutine6.f90" asr = true [[test]] filename = "errors/unterminated_comment_01.f90" asr_preprocess = true [[test]] filename = "errors/unterminated_ifndef_01.f90" asr_preprocess = true [[test]] filename = "errors/unterminated_ifdef_01.f90" asr_preprocess = true [[test]] filename = "errors/unterminated_if_01.f90" asr_preprocess = true [[test]] filename = "declaration1.f90" asr = true [[test]] filename = "errors/integerStringInput.f90" run = true [[test]] filename = "errors/floatStringInput.f90" run = true [[test]] filename = "errors/integerStringInput_64.f90" run = true [[test]] filename = "errors/integer_overflow.f90" run = true [[test]] filename = "errors/protected_01.f90" asr = true [[test]] filename = "errors/interface_01.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_334.f90" asr = true [[test]] filename = "../integration_tests/volatile_02.f90" llvm = true [[test]] filename = "../integration_tests/volatile_03.f90" llvm = true [[test]] filename = "codegen_function_polymorphic.f90" llvm = true options = "-c --separate-compilation" [[test]] filename = "common_linkage_separate_compilation_01.f90" llvm = true options = "--separate-compilation" [[test]] filename = "module_struct_global_separate_compilation_01.f90" llvm = true options = "--separate-compilation" [[test]] filename = "../integration_tests/operator_overloading_12.f90" asr = true [[test]] filename = "errors/formatTesting.f90" run = true [[test]] filename = "../integration_tests/call_subroutine_without_type_01.f90" llvm = true [[test]] filename = "../integration_tests/functions_41.f90" ast = true [[test]] filename = "classes1.f90" llvm = true [[test]] filename = "classes2.f90" llvm = true [[test]] filename = "implied_do_loop2.f90" run = true [[test]] filename = "implied_do_loop3.f90" run = true [[test]] filename = "errors/submodule_01.f90" asr = true [[test]] filename = "../integration_tests/select_type_13.f90" llvm = true [[test]] filename = "unlimited_polymorphic_intrinsic_type_allocate.f90" llvm = true [[test]] filename = "../integration_tests/transfer_09.f90" asr = true [[test]] filename = "../integration_tests/arrays_101.f90" llvm = true [[test]] filename = "stdin_read_blank_lines_01.f90" run = true options = "< tests/stdin_read_blank_lines_01.in" [[test]] filename = "mangle_underscore_external_01.f90" llvm = true options = "--mangle-underscore-external" [[test]] filename = "../integration_tests/file_open_06.f90" run = true [[test]] filename = "infer_mode_smoke_01.f90" run = true options = "--infer" [[test]] filename = "infer_global_scope_file_01.f90" ast = true options = "--infer" [[test]] filename = "errors/infer_realloc_disabled_01.f90" run = true options = "--infer" [[test]] filename = "../integration_tests/allocatable_component_reshape_unallocated_01.f90" run = true [[test]] filename = "../integration_tests/allocatable_component_unnamed_unallocated_01.f90" run = true [[test]] filename = "infer_first_assignment_01.f90" asr = true options = "--infer" [[test]] filename = "errors/infer_first_assignment_conflict_01.f90" asr = true options = "--infer" [[test]] filename = "errors/infer_mode_conflict_01.f90" run = true options = "--infer --std=f23" [[test]] filename = "../integration_tests/file_53.f90" run = true [[test]] filename = "errors/continue_compilation_walrus.f90" semantics_only_cc = true options = "--infer" [[test]] filename = "../integration_tests/subroutines_21.f90" asr = true [[test]] filename = "../integration_tests/arrays_107.f90" asr = true lfortran-0.63.0/tests/assign.f900000664000175000017500000000031415174404631016564 0ustar alastairalastairprogram assign integer :: x real :: y 10 format('(i3)') assign 10 to x 20 assign 10 to x ASSIGN 10 TO x 30 ASSIGN 10 TO y ! An integer variable is required in this context. end program lfortran-0.63.0/tests/fixed_form_early_doloop2.f0000664000175000017500000000033615174404631022107 0ustar alastairalastair program main integer k, l, m, n do 100 k=1,2 do 100 l=1,3 do 100 m=1,4 do 100 n=1,5 print *, k, l 100 continue end program lfortran-0.63.0/tests/open1.f900000664000175000017500000000065015174404631016325 0ustar alastairalastairprogram open1 ! Tests for syntax (AST) only: open(file='p_cc', newunit=u) open (task_lun,file=taskfile) open (unit=gmv_lun, FILE=fname, IOSTAT=ier, POSITION='rewind') open(newunit=this%lun,file=outfile,status='replace',iostat=ios) open(unit=10,file='test1.inp',position='rewind',action='read',status='old') OPEN( UNIT=funit, FILE=tname, STATUS=fstat, ACCESS='SEQUENTIAL', & ACTION=faction, IOSTAT=ierr ) end program lfortran-0.63.0/tests/modules9_module1.f900000664000175000017500000000232315174404631020471 0ustar alastairalastairmodule fpm_dependency implicit none type :: error_t character(len=:), allocatable :: message end type error_t type :: dependency_config_t character(len=:), allocatable :: name character(len=:), allocatable :: path end type dependency_config_t type, extends(dependency_config_t) :: dependency_node_t character(len=:), allocatable :: proj_dir character(len=:), allocatable :: revision logical :: done = .false. logical :: update = .false. end type dependency_node_t type :: dependency_tree_t integer :: unit integer :: verbosity character(len=:), allocatable :: dep_dir integer :: ndep type(dependency_node_t), allocatable :: dep(:) character(len=:), allocatable :: cache contains generic :: update => update_dependency procedure, private :: update_dependency end type dependency_tree_t contains subroutine update_dependency(self, name, error) class(dependency_tree_t), intent(inout) :: self character(len=*), intent(in) :: name type(error_t), allocatable, intent(out) :: error end subroutine update_dependency end module fpm_dependency lfortran-0.63.0/tests/global_scope3.f900000664000175000017500000000003515174404631020014 0ustar alastairalastairinteger :: x x = 6 x = x + 1 lfortran-0.63.0/tests/array4.f900000664000175000017500000000013615174404631016504 0ustar alastairalastair! AST test only program array4 implicit none integer :: i i = some_array(5)%a end program lfortran-0.63.0/tests/string1.f900000664000175000017500000000206115174404631016670 0ustar alastairalastairmodule fpm_strings use iso_c_binding, only: c_char, c_ptr, c_size_t implicit none public :: f_string, string_t type string_t character(len=:), allocatable :: s end type interface f_string module procedure f_string, f_string_cptr, f_string_cptr_n end interface f_string contains function f_string(c_string) character(len=1), intent(in) :: c_string(:) character(:), allocatable :: f_string end function f_string function f_string_cptr(cptr) result(s) type(c_ptr), intent(in), value :: cptr character(len=:, kind=c_char), allocatable :: s interface function c_strlen(s) result(r) bind(c, name="strlen") import c_size_t, c_ptr type(c_ptr), intent(in), value :: s integer(kind=c_size_t) :: r end function end interface s = f_string_cptr_n(cptr, c_strlen(cptr)) end function function f_string_cptr_n(cptr, n) result(s) type(c_ptr), intent(in), value :: cptr integer(kind=c_size_t), intent(in) :: n character(len=n, kind=c_char) :: s end function end module fpm_strings lfortran-0.63.0/tests/preprocessor21.f900000664000175000017500000000104015174404631020166 0ustar alastairalastairprogram preprocessor21 #if (!defined(VAR1) | !defined(VAR2)) print *, "Atleast one of VAR1 and VAR2 isn't defined" #else print *, 'Both VAR1 and VAR2 are defined.' #endif #if (!defined(VAR3) & !defined(VAR4)) print *, "Neither of VAR3 or VAR4 is defined" #else print *, "At least one of VAR3 or VAR4 is defined." #endif #if (!defined(VAR5) ^ !defined(VAR6)) print *, "Exactly one of VAR5 or VAR6 is not defined." #else print *, "Both VAR5 and VAR6 are defined or neither is defined." #endif end program preprocessor21 lfortran-0.63.0/tests/fixedform_return2.f0000664000175000017500000000036115174404631020575 0ustar alastairalastair subroutine f(a,b,c) print *, a go to 1 return 1 print *, b return end subroutine function g(a,b,c) print *, a go to 2 return 2 print *, b return end function lfortran-0.63.0/tests/preprocessor3c.h0000664000175000017500000000003415174404631020104 0ustar alastairalastair#include "preprocessor3b.h" lfortran-0.63.0/tests/global_scope5.f900000664000175000017500000000004515174404631020017 0ustar alastairalastairinteger :: x x = 6 2*x x = x + 1 3*x lfortran-0.63.0/tests/preprocessor19.f900000664000175000017500000000013115174404631020175 0ustar alastairalastair#define Fn(x) program preprocessor19 implicit none Fn(1) end program preprocessor19 lfortran-0.63.0/tests/finalize_01.f900000664000175000017500000000322615174404631017406 0ustar alastairalastairmodule finalize_01_mod contains subroutine test_01() ! Test that we deallocate allocatable characters character(:), allocatable :: str integer :: i allocate(character(10) :: str) return ! This will have `impliciteDeallocate` inserted before it. do i=1, 2 return ! This won't have `impliciteDeallocate` inserted before it as we already have dead end. end do end subroutine test_01 subroutine ss() ! Test deallocation on arrays. integer, allocatable :: arr(:) allocate(arr(10)) if(.true.) then return ! This will have `impliciteDeallocate` inserted before it. else return ! This will have `impliciteDeallocate` inserted before it. end if end subroutine ss end module finalize_01_mod program finalize_01 use finalize_01_mod character(:), allocatable :: str integer, dimension(:), allocatable :: arr allocate(character(10) :: str) call ss() call internal_sub() return ! Should insert deallocation for arr, str before this `return`. contains subroutine internal_sub() character(:),allocatable :: str real, allocatable :: arr_real(:,:) bl : block integer, allocatable :: arr_in_block(:) exit bl ! This will have `impliciteDeallocate` inserted before it. return ! This won't have `impliciteDeallocate` inserted before it as we already have dead end. end block bl do while(.true.) return ! This will have `impliciteDeallocate` inserted before it. end do end subroutine internal_sub end program finalize_01lfortran-0.63.0/tests/loop_test1.f0000664000175000017500000000047115174404631017224 0ustar alastairalastair program main integer KP integer i,j,do330i kp = 10 DO 330 I=1,KP DO 320, J=I+1,KP IF (0.GT.1) THEN print *, i, j ELSE print *, j, i END IF 320 CONTINUE 330 CONTINUE DO330I = 15 end program lfortran-0.63.0/tests/fixed_form_call2.f0000664000175000017500000000025415174404631020331 0ustar alastairalastair subroutine idd_frm(m) integer m, a a = 2 call prinf('lw = *',1) call prinf('16m+70 = *',1) m = 1 return end lfortran-0.63.0/tests/loop_test3.f0000664000175000017500000000040515174404631017223 0ustar alastairalastair PROGRAM TEST DO 240 K=1,MP CON(K)=-DATMAT(K,NP) DO 220 J=1,N 220 W(J)=DATMAT(K,J)+CON(K) DO 240 I=1,N TEMP=0.0d0 DO 230 J=1,N 230 TEMP=TEMP+W(J)*SIMI(J,I) IF (K .EQ. MP) TEMP=-TEMP 240 A(I,K)=TEMP END lfortran-0.63.0/tests/preprocessor15.f900000664000175000017500000000361315174404631020201 0ustar alastairalastairprogram preprocessor15 #define X DEC(1 << 2) #define DEC(n) (n) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 4 print *, "X == 4" #else print *, "X other" #endif #undef X #define X (1 << 2) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 4 print *, "X == 4" #else print *, "X other" #endif #undef X #define X 1<<2 #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 4 print *, "X == 4" #else print *, "X other" #endif #define X DEC(8 >> 2) #define DEC(n) (n) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X (8 >> 2) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X 8>>2 #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #define X DEC((53 & 4) >> 2) #define DEC(n) (n) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X ((53 & 4) >> 2) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X (53&4)>>2 #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #define X DEC((2 | 8) / 5) #define DEC(n) (n) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X ((2 | 8) / 5) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X (2|8)/5 #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif end program lfortran-0.63.0/tests/include2b.f900000664000175000017500000000004415174404631017147 0ustar alastairalastairinteger :: x x = (2+3)*5 print *, x lfortran-0.63.0/tests/overflow_test.txt0000664000175000017500000000001715174404631020423 0ustar alastairalastair2719 2147483648lfortran-0.63.0/tests/optional_01.f900000664000175000017500000000045515174404631017433 0ustar alastairalastairMODULE optmod IMPLICIT NONE CONTAINS SUBROUTINE optional_argument(name) CHARACTER(LEN=10), INTENT(IN), OPTIONAL :: name IF (PRESENT(name)) THEN PRINT*, 'Hello '// name ELSE PRINT*, 'Hello world!' END IF END SUBROUTINE optional_argument END MODULE optmod lfortran-0.63.0/tests/format8.f900000664000175000017500000000076415174404631016671 0ustar alastairalastairprogram format8 use, intrinsic :: iso_fortran_env, only: dp => real64 implicit none real(dp) :: val ! Test E format exponent for values near powers of 10 ! E format normalizes mantissa to [0.1, 1.0) ! e.g., 1.0e-10 becomes 0.1e-9 val = 1.0d-10 print '(E25.17)', val val = 1.0d-100 print '(E25.17)', val val = 1.0d0 print '(E25.17)', val val = 1.0d+10 print '(E25.17)', val val = 1.0d+100 print '(E25.17)', val end program format8 lfortran-0.63.0/tests/loop_test5.f0000664000175000017500000000016015174404631017223 0ustar alastairalastair subroutine f() do 1 i=1,n do 1 j=1,n 1 continue do 2 i=1,n 2 continue end lfortran-0.63.0/tests/preprocessor11.f900000664000175000017500000000334615174404631020200 0ustar alastairalastairprogram preprocessor11 ! #if with >, <, == implicit none #define X 1 #define Y 5 #define Z 1+Y*3 print *, Z #if X == 1 print *, "X is 1" #else print *, "X is not 1" #endif #if X == 2 print *, "X is 2" #else print *, "X is not 2" #endif #if X != 1 print *, "X is not 1" #else print *, "Not X is not 1" #endif #if X == 1 && Y == 5 print *, "X is 1 and Y is 5" #else print *, "Not (X is 1 and Y is 5)" #endif #if X == 2 && Y == 5 print *, "X is 2 and Y is 5" #else print *, "Not (X is 2 and Y is 5)" #endif #if X < 3 && Y > 3 print *, "X<3 and Y>3" #else print *, "Not (X<3 and Y>3)" #endif #if X > 3 && Y < 3 print *, "X>3 and Y<3" #else print *, "Not (X>3 and Y<3)" #endif #if X == 3-2 print *, "X is 3-2" #else print *, "X is not 3-2" #endif #if X == 3-1 print *, "X is 3-1" #else print *, "X is not 3-1" #endif #if Y == (6*5-5)/5 print *, "Y is (6*5-5)/5" #else print *, "Y is not (6*5-5)/5" #endif #if Y == (6*5-6)/5 print *, "Y is (6*5-6)/5" #else print *, "Y is not (6*5-6)/5" #endif #if Y == (-5+6*5)/5 print *, "Y is (-5+6*5)/5" #else print *, "Y is not (-5+6*5)/5" #endif #if Y == (-6+6*5)/5 print *, "Y is (-6+6*5)/5" #else print *, "Y is not (-6+6*5)/5" #endif #if Y == (+5+6*5)/7 print *, "Y is (+5+6*5)/7" #else print *, "Y is not (+5+6*5)/7" #endif #if Y == (+4+6*5)/7 print *, "Y is (+4+6*5)/7" #else print *, "Y is not (+4+6*5)/7" #endif #if Y == (+5+6*Y)/7 print *, "Y is (+5+6*Y)/7" #else print *, "Y is not (+5+6*Y)/7" #endif #if Z == 16 print *, "Z is 16" #else print *, "Z is not 16" #endif #if defined(Y) && (3 <= Y) print *, "Y defined and 1 <= Y" #else print *, "Y not defined or not 1 <= Y" #endif #if defined(A) && (3 <= A) print *, "A defined and 1 <= A" #else print *, "A not defined or not 1 <= A" #endif end program lfortran-0.63.0/tests/entry1.f900000664000175000017500000000047315174404631016530 0ustar alastairalastairprogram entry1 real :: dummy dummy = 10 call x(dummy) call y(dummy) end program subroutine x(dummy) real :: dummy print *, "Printed using subroutine call: ", dummy dummy = 5.0 return entry y(dummy) print *, "Printed using entry statement: ", dummy return end subroutine lfortran-0.63.0/tests/collect_occurence3.f900000664000175000017500000000015415174404631021040 0ustar alastairalastairreal function xyz() print *, "abc" xyz = 1.0 end function xyz program main print *, xyz() end program main lfortran-0.63.0/tests/modules2_module_b.f900000664000175000017500000000016515174404631020704 0ustar alastairalastairmodule tomlf_structure use tomlf_structure_base, only : toml_ordered implicit none end module tomlf_structure lfortran-0.63.0/tests/critical1.f900000664000175000017500000000123015174404631017151 0ustar alastairalastairprogram critical1 implicit none integer :: joblist[*], job integer :: a, b integer :: IntegerSample character(50) :: Sample if (this_image() == 1) read(*,*) joblist sync all do critical job = joblist[1] joblist[1] = job - 1 end critical ! >>>>>>>> Syntax check(AST) >>>>>>>> critical() IntegerSample = 0 end critical critical(stat = IntegerSample) Sample = "Error message" end critical critical(errmsg = Sample) Sample = "Error message" end critical ! <<<<<<<< Syntax check(AST) <<<<<<<< if (job > 0) then b = a**2 + b**2 else exit end if end do sync all end program lfortran-0.63.0/tests/block1.f900000664000175000017500000000110115174404631016446 0ustar alastairalastairprogram block1 implicit integer(a-z) integer :: B ! TODO: Fix this test case block ! use mod, only: example ! import, none ! !import, only: B B = 10 print *, B if (B == 10) then print *, "pass" end if end block end ! The variable B is implicitly declared in the scoping unit of the main program. ! The statement IMPORT, NONE makes B inaccessible in the BLOCK construct. ! If the IMPORT, NONE statement is replaced with the IMPORT statement in the ! comment, the program is conformant. lfortran-0.63.0/tests/external5.f900000664000175000017500000000010415174404631017204 0ustar alastairalastairsubroutine ddet_c() end subroutine ddet_r() external ddet_c end lfortran-0.63.0/tests/array1.f900000664000175000017500000000024415174404631016501 0ustar alastairalastairprogram array1 implicit none real :: d, e(5), e2(2, 3), e3(1, 2, 3) integer :: f, g(3), g2(6, 3), g3(4, 3, 2) logical :: a, b(2), b2(3, 2), b3(2, 1, 2) end program lfortran-0.63.0/tests/format7.f900000664000175000017500000000024015174404631016655 0ustar alastairalastairmodule module_format7 character(len=10) :: a = '(es15.8e2)' end module program format7 use module_format7 print *, a print a, 1.0 end program lfortran-0.63.0/tests/fixed_form_without_newline.f0000664000175000017500000000015715174404631022562 0ustar alastairalastair PROGRAM EXAMPLE CHARACTER(len=2) X X = 'Hi' PRINT *, X END PROGRAM EXAMPLElfortran-0.63.0/tests/modules9.f900000664000175000017500000000136615174404631017051 0ustar alastairalastairmodule fpm_cmd_update use fpm_dependency, only : dependency_tree_t, error_t implicit none type, abstract :: fpm_cmd_settings character(len=:), allocatable :: working_dir logical :: verbose=.true. end type type, extends(fpm_cmd_settings) :: fpm_update_settings character(len=5), allocatable :: name(:) logical :: fetch_only logical :: clean end type contains subroutine cmd_update(settings) type(fpm_update_settings), intent(in) :: settings type(dependency_tree_t) :: deps type(error_t), allocatable :: error integer :: ii call deps%update(deps%dep(ii)%name, error) end subroutine cmd_update end module fpm_cmd_update lfortran-0.63.0/tests/intrinsic_implicit.f900000664000175000017500000000034615174404631021201 0ustar alastairalastair! Test combination of implicit-interface and intrinsic functions ! Check if intrinsic function is used when it is declared as an integer subroutine fppasu() integer max0 a = max0(1,2) b = max0(1,2/2,1) end lfortran-0.63.0/tests/format2.f900000664000175000017500000000010215174404631016645 0ustar alastairalastairprogram format2 integer a print '(3l3)', a end program lfortran-0.63.0/tests/complex2.f900000664000175000017500000000021315174404631017027 0ustar alastairalastairprogram complex2 complex :: x x = (3.0, 4.0) x = x + 4.0 print *, x x = 2.0 + x print *, x x = 2.0 + x + (0.0, 3.0) print *, x end program lfortran-0.63.0/tests/dependency_test_02.f900000664000175000017500000000031315174404631020755 0ustar alastairalastairmodule m_cli2 implicit none contains subroutine a2d(valu) doubleprecision, intent(out) :: valu integer :: ivalu valu = real(ivalu, kind=kind(0.0d0)) end subroutine a2d end module m_cli2 lfortran-0.63.0/tests/data1.f900000664000175000017500000000210715174404631016274 0ustar alastairalastairprogram data1 type person integer :: age character(20) :: fullname end type character (len = 10) myname integer, dimension (0:9) :: miles data myname / 'xyz' /, miles / 10 * 0 / real, dimension (100, 100) :: skew type (person) yourname data yourname % age, yourname % fullname / 35, 'abc' / data ((skew (k, j), j = 1, k), integer(4) :: k = 1, 10) / 55 * 0.0 / data ((skew (k, j), j = 1, k, k), integer(4) :: k = 1, 100, 2) / 50 * 0.0 / data ((skew (k, j), j = k + 1, 10), k = 1, 3) / 24 * 1.0 / data ((skew (k, j), j = k + 1, 10, k), k = 1, 3, 1) / 16 * 1.0 / real(8), parameter :: sin3 = sin(3.d0) real(8), parameter :: cos3 = cos(3.d0) real(8) s(10) DATA s/ 1.d0, -1.d0, 0.d0, 0.d0, 0.d0, -1.d0, sin3, cos3, 0.d0, -1.d0 / integer :: iarx(3,1), iary(3,1) print *, "Your name is: ", yourname % fullname print *, "Your age is: ", yourname % age data(iarx(i,1), iary(i,1),i=1,3)/ 1, 9, 1950,1350, 4350, 4/ print *, "My name is: ", myname data(iary(i,1),i=1,3)/ 1, 9, 1950 / end program lfortran-0.63.0/tests/optional_03.f900000664000175000017500000000070215174404631017430 0ustar alastairalastairmodule optional_03_m contains subroutine my_sub(a) integer, intent(in) :: a print *, "a =", a end subroutine my_sub function f1(x) result(r) integer, optional, intent(in) :: x integer, allocatable :: r r = 0 end function f1 end module program optional_03 use optional_03_m integer, allocatable :: i i = 10 ! Fails for NUM_TRIES < 4 call my_sub(f1(f1(f1(i)))) end program lfortran-0.63.0/tests/write3.f900000664000175000017500000000014315174404631016515 0ustar alastairalastairprogram main integer nwrite data nwrite/6/ write (nwrite,*) "Hello World" end program lfortran-0.63.0/tests/wrapping1.f900000664000175000017500000000031615174404631017212 0ustar alastairalastairmodule wrapping1 implicit none integer, parameter :: c_int = 4 contains subroutine sub1(a, b) bind(c) integer(c_int), intent(in) :: a integer(c_int), intent(out) :: b b = a + 1 end subroutine end module lfortran-0.63.0/tests/dependency_test_03_module.f900000664000175000017500000000046415174404631022332 0ustar alastairalastairmodule m_cli2 implicit none contains subroutine check_commandline() call default_help() contains subroutine default_help() integer :: ilength call get_command_argument(number=0, length=ilength) end subroutine default_help end subroutine check_commandline end module m_cli2 lfortran-0.63.0/tests/complex3.f900000664000175000017500000000032415174404631017033 0ustar alastairalastairprogram complex3 complex*16 :: x complex(8) :: y complex*8 :: z complex(4) :: w x = (3.0_8, 4.0_8) print *, x y = (3.0_8, 4.0_8) print *, y z = (3.0_4, 4.0_4) print *, z w = (3.0_4, 4.0_4) print *, w end program lfortran-0.63.0/tests/fn2.f900000664000175000017500000000040715174404631015770 0ustar alastairalastairfunction a() integer :: a end function function b() real :: b end function function c() logical :: c end function function d() result(r) integer :: r end function function e() result(r) real :: r end function function f() result(r) logical :: r end function lfortran-0.63.0/tests/wasm_unary_minus.f900000664000175000017500000000140415174404631020701 0ustar alastairalastairprogram wasm_unary_minus implicit none print *, get_num_neg_i32(13), get_num_neg_i64(130000000000000000_8) print *, get_num_neg_i32(-13), get_num_neg_i64(-130000000000000000_8) print *, test_unary_minus() contains function get_num_neg_i32(x) result(r) implicit none integer(4), intent(in) :: x integer(4) :: r r = -x return end function function get_num_neg_i64(x) result(r) implicit none integer(8), intent(in) :: x integer(8):: r r = -x return end function function test_unary_minus() result(r) implicit none integer(8) :: r r = (-15000000000000_8) - (-16000000000000_8) return end function end program lfortran-0.63.0/tests/infer_global_scope_file_01.f900000664000175000017500000000003615174404631022414 0ustar alastairalastairinteger :: x x = 5 print *, x lfortran-0.63.0/tests/preprocessor7.f900000664000175000017500000000033615174404631020121 0ustar alastairalastairprogram preprocessor7 ! undef implicit none #define X #ifdef X print *, 1 #else print *, 2 #endif #undef X #ifdef X print *, 3 #else print *, 4 #endif #undef X #ifdef X print *, 3 #else print *, 4 #endif end program lfortran-0.63.0/tests/global_scope8.f900000664000175000017500000000003015174404631020014 0ustar alastairalastairinteger(4) :: x x = 6 x lfortran-0.63.0/tests/modules_01.f900000664000175000017500000000564515174404631017264 0ustar alastairalastairmodule bsplines use types, only: dp use lapack, only: dgesv, dgbsv use utils, only: stop_error implicit none private public bspline, bspline_der, bspline_der2 contains pure recursive function bspline(t, i, k, r) result(B) ! Returns values of a B-spline. ! There are set of `n` B-splines of order `k`. The mesh is composed of `n+k` ! knots, stored in the t(:) array. real(dp), intent(in) :: t(:) ! {t_i}, i = 1, 2, ..., n+k integer, intent(in) :: i ! i = 1..n ? integer, intent(in) :: k ! Order of the spline k = 1, 2, 3, ... real(dp), intent(in) :: r(:) ! points to evaluate the spline at real(dp) :: B(size(r)) if (k == 1) then if ((t(size(t)) - t(i+1)) < tiny(1._dp) .and. & (t(i+1) - t(i)) > tiny(1._dp)) then ! If this is the last non-zero knot span, include the right end point, ! to ensure that the last basis function goes to 1. where (t(i) <= r .and. r <= t(i+1)) B = 1 else where B = 0 end where else ! Otherwise exclude the right end point where (t(i) <= r .and. r < t(i+1)) B = 1 else where B = 0 end where end if else B = 0 if (t(i+k-1)-t(i) > tiny(1._dp)) then B = B + (r-t(i)) / (t(i+k-1)-t(i)) * bspline(t, i, k-1, r) end if if (t(i+k)-t(i+1) > tiny(1._dp)) then B = B + (t(i+k)-r) / (t(i+k)-t(i+1)) * bspline(t, i+1, k-1, r) end if end if end function pure function bspline_der(t, i, k, r) result(B) ! Returns values of a derivative of a B-spline. ! There are set of `n` B-splines of order `k`. The mesh is composed of `n+k` ! knots, stored in the t(:) array. real(dp), intent(in) :: t(:) ! {t_i}, i = 1, 2, ..., n+k integer, intent(in) :: i ! i = 1..n ? integer, intent(in) :: k ! Order of the spline k = 1, 2, 3, ... real(dp), intent(in) :: r(:) ! points to evaluate the spline at real(dp) :: B(size(r)) if (k == 1) then B = 0 else B = 0 if (t(i+k-1)-t(i) > tiny(1._dp)) then B = B + (k-1) / (t(i+k-1)-t(i)) * bspline(t, i, k-1, r) end if if (t(i+k)-t(i+1) > tiny(1._dp)) then B = B - (k-1) / (t(i+k)-t(i+1)) * bspline(t, i+1, k-1, r) end if end if end function pure function bspline_der2(t, i, k, r) result(B) ! Returns values of a second derivative of a B-spline. ! There are set of `n` B-splines of order `k`. The mesh is composed of `n+k` ! knots, stored in the t(:) array. real(dp), intent(in) :: t(:) ! {t_i}, i = 1, 2, ..., n+k integer, intent(in) :: i ! i = 1..n ? integer, intent(in) :: k ! Order of the spline k = 1, 2, 3, ... real(dp), intent(in) :: r(:) ! points to evaluate the spline at real(dp) :: B(size(r)) if (k == 1) then B = 0 else B = 0 if (t(i+k-1)-t(i) > tiny(1._dp)) then B = B + (k-1) / (t(i+k-1)-t(i)) * bspline_der(t, i, k-1, r) end if if (t(i+k)-t(i+1) > tiny(1._dp)) then B = B - (k-1) / (t(i+k)-t(i+1)) * bspline_der(t, i+1, k-1, r) end if end if end function end module lfortran-0.63.0/tests/preprocessor3.f900000664000175000017500000000015115174404631020110 0ustar alastairalastairprogram preprocessor3 implicit none #include "preprocessor3e.h" x = (2+3)*5 print *, x, C123 end program lfortran-0.63.0/tests/dimension_attr2.f900000664000175000017500000000010115174404631020373 0ustar alastairalastairinteger function f(x) dimension x(3) dimension y(3) end function lfortran-0.63.0/tests/subroutine3b.f900000664000175000017500000000017515174404631017731 0ustar alastairalastairinteger function f() f = 42 end function integer function g() g = 42 end function integer function h() h = 42 end function lfortran-0.63.0/tests/array2.f900000664000175000017500000000045415174404631016505 0ustar alastairalastairprogram array2 implicit none real, dimension(5) :: a, b integer, dimension(3) :: c logical, dimension(2) :: d real, dimension(2,3) :: e integer, dimension(3,4) :: f logical, dimension(5,2) :: g real, dimension(2,3,4) :: h integer, dimension(3,4,3) :: i logical, dimension(5,2,2) :: j end program lfortran-0.63.0/tests/allocate_02.f900000664000175000017500000000031515174404631017366 0ustar alastairalastairprogram allocate_02 implicit none integer, allocatable :: arr(:) integer :: i allocate(arr(1)) do i = 1, 1000000 deallocate(arr) allocate(arr(1)) end do end program lfortran-0.63.0/tests/uppercase1.f900000664000175000017500000000023315174404631017350 0ustar alastairalastairmodule uppercase1 real, dimension(3) :: x, y contains subroutine sub(a) integer, intent(inout) :: a a = a + SIZE(x) + SIZE(y) end subroutine end module lfortran-0.63.0/tests/team1.f900000664000175000017500000000101315174404631016304 0ustar alastairalastairprogram team1 implicit none ! Syntax check only(AST) integer, parameter :: n = 4 type (team_type) :: column, odd_even real,codimension[n, *] :: co_array integer,dimension(2) :: my_cosubscripts my_cosubscripts (:) = this_image(co_array) form team (my_cosubscripts(2), column, new_index = my_cosubscripts(1)) sync team (column) change team (column, ca[*] => co_array) ! segment 1 end team formteam (2-mod(this_image(), 2), odd_even) changeteam (odd_even) ! segment 2 endteam end program lfortran-0.63.0/tests/do4.f900000664000175000017500000000042215174404631015766 0ustar alastairalastairprogram do4 implicit none integer :: i, j, k j = 0 do 15 i = 1, 5 j = j + i 15 continue j = 0 do 20 i = 1, 6, 2 j = j + i 20 continue k = 0 do 30 i = 1, 5 do 35 j = 1, 5 k = k + 1 31 continue 35 continue 33 continue 30 continue 40 continue end program lfortran-0.63.0/tests/dependency_test_03.f900000664000175000017500000000010415174404631020754 0ustar alastairalastairmodule m_cli2_user use m_cli2 implicit none end module m_cli2_user lfortran-0.63.0/tests/allow_implicit_interface2.f900000664000175000017500000000010615174404631022411 0ustar alastairalastairsubroutine fdjac1(fcn, n, x, y) integer :: n, x, y call fcn(x, y) end lfortran-0.63.0/tests/modules1_module2.f900000664000175000017500000000054315174404631020464 0ustar alastairalastairmodule y use abc, only: t1 implicit none type :: t2 class(t1), allocatable :: val end type t2 contains subroutine sub(self) class(t2), intent(inout), target :: self ! TODO: Add one test for SubroutineCall as well if(self%val%f()) print *, 1 ! <---- Error end subroutine sub end module y lfortran-0.63.0/tests/fixedform_subroutine2.f0000664000175000017500000000037315174404631021460 0ustar alastairalastair PROGRAM SUBR2 CALL MY_SUBR() END SUBROUTINE MY_SUBR() PRINT *, SXVALS() IF (SXVALS() /= 4) ERROR STOP RETURN CONTAINS INTEGER FUNCTION SXVALS() SXVALS = 4 RETURN END END lfortran-0.63.0/tests/write6.f900000664000175000017500000000021215174404631016515 0ustar alastairalastairprogram main write(*,'(I0.4)') 12345 write(*,'(I0.4)') 2 write(*,'(I0.3)') -3 write(*,'(A4,I0.2,A4)') "file", 4, ".txt" end program mainlfortran-0.63.0/tests/array9.f900000664000175000017500000000077615174404631016523 0ustar alastairalastairprogram array9 type :: varying_string character(len=1), allocatable :: characters(:) endtype type(varying_string) :: x type(varying_string), allocatable :: a(:) real, allocatable :: b(:) integer, allocatable :: c(:) real(kind=4), allocatable :: d(:) a = [varying_string::] b = [real::] b = [integer::] d = [real(kind=4)::] a = [varying_string::x,x] b = [real::1.0,2.0] b = [integer::1,2] d = [real(kind=4)::1.0,2.0] endprogram lfortran-0.63.0/tests/do_concurrent1.f900000664000175000017500000000172715174404631020236 0ustar alastairalastairsubroutine dc1(a, b) real, intent(inout) :: a(:,:) integer :: N, i, j N = size(a) do concurrent (i=1:N, j=1:N, i 0) then x = sqrt(a(i)) a(i) = a(i) - x**2 end if b(i) = b(i) - a(i) end do print *, x end subroutine subroutine dc3(a, b) real, intent(inout) :: a(:), b(:) integer :: i real :: x x = 1.0 do concurrent (i=1:10) shared(i) local(x) default(none) if (a(i) > 0) then x = sqrt(a(i)) a(i) = a(i) - x**2 end if b(i) = b(i) - a(i) end do print *, x end subroutine subroutine dc4(a, b) real, intent(inout) :: a(:), b(:) integer :: i real :: x x = 1.0 do concurrent (i=1:10) default(none) local(x) shared(i) if (a(i) > 0) then x = sqrt(a(i)) a(i) = a(i) - x**2 end if b(i) = b(i) - a(i) end do print *, x end subroutine lfortran-0.63.0/tests/implicit_interface2.f900000664000175000017500000000012715174404631021216 0ustar alastairalastairprogram implicit_interface2 double precision f, g print *, f(5), g(1, 3.0) end program lfortran-0.63.0/tests/sync1.f900000664000175000017500000000045615174404631016344 0ustar alastairalastairprogram sync1 implicit none integer :: iam real :: x[*] iam = this_image() if (iam == 1) x = 1.0 sync memory call external_sync () syncmemory(stat=status) if (iam == 2) write (*,*) x[1] if (this_image() == 1) then sync images(*) else syncimages(1, stat=status) end if end program sync1 lfortran-0.63.0/tests/read1.f900000664000175000017500000000047015174404631016277 0ustar alastairalastairprogram read1 ! AST only tests read(*,*) a, b read(unit=*,fmt=*) a, b read(*,fmt=*) a, b read(*) b read(zone(1:3), '(i3)') hour read(u) b read(u, fmt=x) b, c, e read(*, fmt=x) b, c, e READ( iunit, NML=invar, IOSTAT=ierr ) READ( UNIT=iunit, NML=invar, IOSTAT=ierr ) read 10 READ 10, A, B read *, size end program lfortran-0.63.0/tests/complex1.f900000664000175000017500000000007115174404631017030 0ustar alastairalastairprogram complex1 complex :: x x = (3.0, 4.0) end program lfortran-0.63.0/tests/modules_07.f900000664000175000017500000000024415174404631017260 0ustar alastairalastairmodule modules_07_mod implicit none private save integer, parameter, public :: a = 5 integer, parameter :: b = 6 integer, parameter :: c = 7 public :: c end module lfortran-0.63.0/tests/fixedform_assign_minimal.f0000664000175000017500000000004215174404631022162 0ustar alastairalastair integer a, b,c,d end lfortran-0.63.0/tests/do2.f900000664000175000017500000000044315174404631015767 0ustar alastairalastairsubroutine a do a = a + i b = 3 enddo do do = a + i enddo = 3 enddo do; a = a + i; b = 3; end do end subroutine subroutine a do x = 1 end do end subroutine subroutine a do i = 1, 5 x = x + i end do end subroutine subroutine a do i = 1, 5, -1 x = i end do end subroutine lfortran-0.63.0/tests/preprocessor6.f900000664000175000017500000000241115174404631020114 0ustar alastairalastairprogram preprocessor6 ! Nested macros implicit none #define X 5 #define Y #ifdef X # ifdef Y print *, "1a" # else print *, "1b" # endif #else # ifdef Y print *, "2a" # else print *, "2b" # endif #endif #ifdef X # ifdef Z print *, "1a" # else print *, "1b" # endif #else # ifdef Z print *, "2a" # else print *, "2b" # endif #endif #ifdef Z # ifdef Y print *, "1a" # else print *, "1b" # endif #else # ifdef Y print *, "2a" # else print *, "2b" # endif #endif #ifdef Z # ifdef Z print *, "1a" # else print *, "1b" # endif #else # ifdef Z print *, "2a" # else print *, "2b" # endif #endif ! ifndef #ifdef X # ifndef Y print *, "1a" # else print *, "1b" # endif #else # ifndef Y print *, "2a" # else print *, "2b" # endif #endif ! more nesting #ifdef X print *, "10" # ifdef Y print *, "1a0" # ifdef Z print *, "1aa" # else print *, "1ab" # endif print *, "1ac" # else print *, "1b" # endif print *, "1c" #else print *, "20" # ifdef Y print *, "20" # ifdef Z print *, "2aa" # else print *, "2ab" # endif print *, "2a" # else print *, "2b" # endif print *, "2c" #endif #ifdef X print *, "10" # ifdef Y print *, "1a0" # ifdef X print *, "1aa" # else print *, "1ab" # endif print *, "1ac" # endif print *, "1c" #endif end program lfortran-0.63.0/tests/external_02.f900000664000175000017500000000033315174404631017424 0ustar alastairalastairSUBROUTINE COBYLA (CALCFC) IMPLICIT DOUBLE PRECISION (A-H,O-Z) EXTERNAL CALCFC CALL COBYLB (CALCFC) RETURN END SUBROUTINE COBYLB (CALCFC) IMPLICIT DOUBLE PRECISION (A-H,O-Z) EXTERNAL CALCFC CALL CALCFC(CON) RETURN END lfortran-0.63.0/tests/global_scope2.f900000664000175000017500000000002315174404631020010 0ustar alastairalastairinteger :: x x = 6 lfortran-0.63.0/tests/global_scope6.f900000664000175000017500000000004115174404631020014 0ustar alastairalastairinteger :: x x = 6 2*x x = x + 1 lfortran-0.63.0/tests/character_parameter_padding_trimming.f900000664000175000017500000000233615174404631024676 0ustar alastairalastair!> These tests make sure that for constant(i.e. parameter) character string (or array) !> * padding (when LHS length is higher) !> * trimming (when LHS length is lower) program character_parameter_padding_trimming !> initializate variables to test correct padding of ' ' to the end of character string character(len=8), parameter :: x_pad = "apple" !> char length on right is 5 character(len=10), parameter :: y_pad = "Ball" !> char length on right is 4 character(len=30), parameter :: z_pad = x_pad // y_pad // x_pad !> char length on right is 26 character(len=4), parameter :: p_pad(3) = "2" !> char length on right is 1 print *, "|" // x_pad // "|" print *, y_pad print *, p_pad !> initializate variables to test correct trimming of ' ' to the end of character string character(len=2), parameter :: x_trim = "apple" !> char length on right is 5 character(len=3), parameter :: y_trim = "Ball" !> char length on right is 4 character(len=5), parameter :: z_trim = x_trim // y_trim // x_trim !> char length on right is 26 character(len=1), parameter :: p_trim(3) = "25" !> char length on right is 2 print *, x_trim print *, y_trim print *, z_trim print *, p_trim end program lfortran-0.63.0/tests/execute_command_line.f900000664000175000017500000000020115174404631021442 0ustar alastairalastairprogram execute_command_line call execute_command_line('echo "Hello World"') call execute_command_line('ls') end program lfortran-0.63.0/tests/write7.f900000664000175000017500000000312615174404631016525 0ustar alastairalastair! NOTE: the commented out code can be used to test ! the GenericWrite ASR node end to end module write7_mod type :: person ! character(len=20) :: name ! integer :: age contains procedure, private :: pwf, pwunf generic :: write(formatted) => pwf generic :: write(unformatted) => pwunf end type person contains subroutine pwf(dtv, unit, iotype, vlist, iostat, iomsg) class(person), intent(in) :: dtv integer, intent(in) :: unit character(len=*), intent(in) :: iotype integer, intent(in) :: vlist(:) integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg character(len=9) :: pfmt ! WRITE(pfmt,'(A,I2,A,I2,A)') '(A', vlist(1), ',I', vlist(2), ')' ! WRITE(unit, FMT=pfmt, IOSTAT=iostat) dtv%name, dtv%age end subroutine subroutine pwunf(dtv, unit, iostat, iomsg) class(person), intent(in) :: dtv integer, intent(in) :: unit integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg ! write(unit, IOSTAT=iostat, IOMSG=iomsg) dtv%name, dtv%age ! if (iostat /= 0) then ! ! Optionally set iomsg if an error occurs ! iomsg = 'Error writing unformatted person data' ! end if end subroutine end module ! program write7 ! use write7_mod ! integer :: id, members ! type(person) :: chairman ! id = 1 ! members = 10 ! chairman%name = "John Doe" ! chairman%age = 45 ! WRITE(6, FMT="(I2, DT (15,6), I5)") id, chairman, members ! end program lfortran-0.63.0/tests/multi_error1.f900000664000175000017500000000017015174404631017724 0ustar alastairalastairprogram multi_error1 integer :: x = integer :: z integer :: y = print *, x + print *, x y z = 1 print *, z end program lfortran-0.63.0/tests/empty.f900000664000175000017500000000000015174404631016426 0ustar alastairalastairlfortran-0.63.0/tests/save1.f900000664000175000017500000000112715174404631016322 0ustar alastairalastairsubroutine save_sub() real :: x = 5, z real, save :: y = 5 end subroutine real function save_fun() implicit none real :: x = 5, z real, save :: y = 5 end function module save_module implicit none public real :: x = 5, z real, save :: y = 5 contains subroutine sub_save() real :: x = 5, z real, save :: y = 5 end subroutine real function fun_save() implicit none real :: x = 5, z real, save :: y = 5 end function end module program main real :: x = 5, z real, save :: y = 5 end program lfortran-0.63.0/tests/common_linkage_separate_compilation_01.f900000664000175000017500000000026615174404631025052 0ustar alastairalastairprogram common_linkage_separate_compilation_01 implicit none integer :: x common /blk/ x x = 5 if (x /= 5) error stop 1 end program common_linkage_separate_compilation_01 lfortran-0.63.0/tests/external4.f900000664000175000017500000000022715174404631017211 0ustar alastairalastairsubroutine dqc25s(f) double precision dlog,f external f call dqk15w(f) print *, f(hlgth+centr) print *, dlog(2.0d0) end subroutine lfortran-0.63.0/tests/complex_to_complex_cast_fortran_codegen.f900000664000175000017500000000115315174404631025433 0ustar alastairalastairprogram ImplicitComplexToComplexDifferentKindExample implicit none complex :: complexValue1 ! Default complex type complex(kind=8) :: complexValue2 ! Complex type with higher precision ! Assign a complex value complexValue1 = (1.0, 2.0) ! Complex number with default kind ! Perform an implicit complex to complex cast with different kinds complexValue2 = complexValue1 ! Output the result print *, "Complex Value 1 (Default Kind):", complexValue1 print *, "Complex Value 2 (Kind=8):", complexValue2 end program ImplicitComplexToComplexDifferentKindExample lfortran-0.63.0/tests/real_to_real_cast_fortran_codegen.f900000664000175000017500000000062615174404631024167 0ustar alastairalastairprogram ImplicitRealToRealDifferentKindExample implicit none real :: realNumber1 ! Default real type (usually single precision) real(kind=8) :: realNumber2 ! Double precision real ! Assign a real number realNumber1 = 3.14 ! Perform an implicit real to real cast with different kinds realNumber2 = realNumber1 end program ImplicitRealToRealDifferentKindExample lfortran-0.63.0/tests/associate1.f900000664000175000017500000000025515174404631017340 0ustar alastairalastairassociate(x => y) endassociate associate(x => (y)) end associate associate(x => y+z) end associate associate(x => -y) end associate call some_subroutine(x, (x)) x = f((x)) lfortran-0.63.0/tests/do5.f900000664000175000017500000000042315174404631015770 0ustar alastairalastairprogram do5 implicit none integer :: i, j, k, enddo j = 0 do 15 i = 1, 5 15 j = j + i j = 0 do 16 i = 1, 5 16 enddo = 5 j = 0 do 20 i = 1, 6, 2 20 j = j + i k = 0 do 30 i = 1, 5 do 35 j = 1, 5 31 continue 35 k = k + 1 33 continue 30 k = k + 1 40 continue end program lfortran-0.63.0/tests/bits1.f900000664000175000017500000000020015174404631016314 0ustar alastairalastairprogram bits1 implicit none integer(8) :: arr2(3) = [1042890_8, 20_8, 30_8] print *, ibits(arr2, 2, 2) end program lfortran-0.63.0/tests/scopes1.f900000664000175000017500000000025115174404631016655 0ustar alastairalastairprogram scopes1 implicit none integer :: i, j j = 1 call f(i) contains subroutine f(b) integer, intent(out) :: b b = j + 1 end subroutine end program lfortran-0.63.0/tests/array5.f900000664000175000017500000000023215174404631016502 0ustar alastairalastairprogram array5 implicit none real, dimension(3) :: a, b, c real :: e(0) a = [1, 2, 3] b = (/ 1, 2, 3 /) c = [real:: 1, 2, 3] e = [real ::] end program lfortran-0.63.0/tests/collect_occurence2.f900000664000175000017500000000015415174404631021037 0ustar alastairalastairreal function xyz() print *, "abc" xyz = 1.0 end function xyz program main print *, xyz() end program main lfortran-0.63.0/tests/fixed_form2.f0000664000175000017500000000237215174404631017341 0ustar alastairalastairc Test comments and line continuation program fixed_form2 c Comment 1 C Comment 2 ! Comment col 1 ! Comment col 2 ! Comment col 3 ! Comment col 4 ! Comment col 5 ! Comment col 7 ! Comment col 8 ! Comment 3 integer :: a ! Comment 4 print *, "OK1" !, "OK2" ! The first ! is not a comment, but line continuation print *, "OK1" ! !, "F2" ! This whole line is a comment c !, "F3" ! This whole line is a comment C !, "F4" ! This whole line is a comment * !, "F5" ! This whole line is a comment ! !, "F6" ! This whole line is a comment ! !, "F7" ! This whole line is a comment ! !, "F8" ! This whole line is a comment !!, "F9" ! This whole line is a comment ;, "OK2" ! line continuation to the previous non-comment line 1, "OK3" ! line continuation $, "OK4" ! line continuation 0print *, "1" ! not line continuation, new statement print *, "2" ! not line continuation, new statement print *, "1", "1 ! not comment $ finish string" print *, "1", "1 "" ' 2 """" 3 $ ! also not comment $ finish string" print *, "1", '1 '' " 2 '''' 3 $ ! also not comment $ finish string' end ! Comment 5 ! Comment lfortran-0.63.0/tests/implicit4.f900000664000175000017500000000023615174404631017201 0ustar alastairalastairinteger function idd_random_transf(x,y,w) implicit real *8 (a-h,o-z) dimension x(*),y(*),w(*) ialbetas=w(1) iixs=w(2) nsteps=w(3) iww=w(4) n=w(5) end functionlfortran-0.63.0/tests/modules1.f900000664000175000017500000000007415174404631017034 0ustar alastairalastairprogram x use y, only: t2 implicit none end program lfortran-0.63.0/tests/builtin1.f900000664000175000017500000000076115174404631017035 0ustar alastairalastairprogram builtin_01 ! AST only tests implicit none inquire(unit=n, opened=inuse) INQUIRE (UNIT = JOAN, OPENED = LOG_01, NAMED = LOG_02, & FORM = CHAR_VAR, IOSTAT = IOS) INQUIRE (IOLENGTH = IOL) A (1:N) rewind(s) rewind s rewind 10 rewind(err=label, unit=s) rewind iunit(13) backspace (u) backspace io_unit backspace 10 BACKSPACE (10, IOSTAT = N) backspace iunit(13) END FILE K end file 5 endfile (k) endfile (10, iostat = n) endfile(unit=iout,iostat=ios,iomsg=msg) end program lfortran-0.63.0/tests/common3.f900000664000175000017500000000046315174404631016660 0ustar alastairalastair! AST only subroutine test implicit none real a,b,c,d common // a,b common / / a,b common a, b common a /b1/ c,d // b common a, /b1/ c,d, // b common // b(2:4) common b(:4) common b(4) common /b1/ c,d, // a,b common /b1/ c,d // a, b common /b1/ c,d / / a, b end subroutine test lfortran-0.63.0/tests/array12.f900000664000175000017500000000156415174404631016571 0ustar alastairalastairmodule array12 use, intrinsic :: iso_c_binding, only: c_char, c_int, c_ptr, c_associated implicit none interface function getcwd(buf, bufsize) result(path) bind(C, name="getcwd") import :: c_char, c_int, c_ptr character(kind=c_char, len=1), intent(in) :: buf(*) integer(c_int), value, intent(in) :: bufsize type(c_ptr) :: path end function getcwd end interface contains subroutine get_current_directory(path) character(len=:), allocatable, intent(out) :: path character(kind=c_char, len=1), allocatable :: cpath(:) integer(c_int), parameter :: buffersize = 1000_c_int type(c_ptr) :: tmp allocate(cpath(buffersize)) tmp = getcwd(cpath, buffersize) if (c_associated(tmp)) then print *, "PWD: ", tmp end if end subroutine get_current_directory end module array12 lfortran-0.63.0/tests/attributes1.f900000664000175000017500000000137015174404631017552 0ustar alastairalastairprogram attributes1 ! test for AST(to fmt) only character (len = 4) :: a, b character, intent(in) :: str*(*) character(len=1,kind=c_char), target, & bind(C,name="_binary_fclKernels_cl_start") :: fclKernelStart character (len = 3) :: c (2) integer, volatile :: d, e real, external :: g equivalence (a, c (1)), (b, c (2)) type details sequence integer:: age character(50):: name contains procedure, pass:: name => sample end type details intrinsic sin, cos doubleprecision, intent (in) :: x(..) type(real(kind=4)), allocatable :: x(:) type(integer(kind=4)), allocatable :: x(:) type(character(len=4)), allocatable :: x(:) type(logical(kind=4)), allocatable :: x(:) type(complex(kind=4)), allocatable :: x(:) save /zzrayc/ end program lfortran-0.63.0/tests/defop1.f900000664000175000017500000000026715174404631016465 0ustar alastairalastairprogram defop1 ! Tests for syntax (AST) only: e = a.in.b E = A.IN.B e = b%s.op.3**4 E = B%S.OP.3**4 e = (a+b).x.y**x e = x**x.x.x**x E = X**X.X.X**X e = ((x.x.x).in.3)**4 end program lfortran-0.63.0/tests/implicit5.f900000664000175000017500000000023715174404631017203 0ustar alastairalastairinteger function CPDSA(n,z,cdn) IMPLICIT DOUBLE PRECISION (A-B,D-H,O-Y) EPS=1.0D-15 PI=3.141592653589793D0 CA0=EXP(-.25D0*Z*Z) VA0=0.5D0*(1.0D0-N) end functionlfortran-0.63.0/tests/global_scope7.f900000664000175000017500000000003715174404631020022 0ustar alastairalastairinteger :: x = 6 2*x x = x + 1 lfortran-0.63.0/tests/lookup_name4.f900000664000175000017500000000102415174404631017674 0ustar alastairalastairmodule lookup_name4_time_module_xx IMPLICIT NONE PUBLIC REAL :: tparset_ = 0.0 REAL :: wtime_ = 0.0 END module lookup_name4_time_module_xx module lookup_name4_plib_module_xx use lookup_name4_time_module_xx, only: wtime_ PUBLIC INTEGER :: iproc = 0 INTEGER :: root = 0 INTEGER :: pinit = 0 INTEGER :: pcomm_set = 0 end module PROGRAM lookup_name4 USE lookup_name4_time_module_xx, ONLY: tparset_ USE lookup_name4_plib_module_xx, ONLY: pinit, & pcomm_set tparset_ = tparset_ + 1.0 END PROGRAM lookup_name4 lfortran-0.63.0/tests/external3.f900000664000175000017500000000017415174404631017211 0ustar alastairalastairdouble precision function brcmp1() double precision bcorr external bcorr intrinsic exp brcmp1 = exp(-bcorr(a,b)) return end lfortran-0.63.0/tests/string2.f900000664000175000017500000000132215174404631016670 0ustar alastairalastairmodule fpm_filesystem use fpm_strings, only: f_string, string_t use iso_c_binding, only: c_ptr, c_associated implicit none public :: list_files contains recursive subroutine list_files() type(c_ptr) :: dir_handle type(c_ptr) :: dir_entry_c character(len=:), allocatable :: string_fortran do if (.not. c_associated(dir_entry_c)) then exit else string_fortran = f_string(dir_entry_c) end if end do end subroutine list_files function get_temp_filename() result(tempfile) character(:), allocatable :: tempfile character(len=1), pointer :: c_tempfile(:) tempfile = f_string(c_tempfile) end function get_temp_filename end module fpm_filesystem lfortran-0.63.0/tests/preprocessor3d.h0000664000175000017500000000003415174404631020105 0ustar alastairalastair#include lfortran-0.63.0/tests/implicit8.f900000664000175000017500000000012615174404631017203 0ustar alastairalastairinteger function a(n,m) n = 5 m = 8 integer :: X(n), Y(m) X = [1,2,3,4,5] end functionlfortran-0.63.0/tests/print5.f900000664000175000017500000000021715174404631016523 0ustar alastairalastairprogram print5 implicit none character(len=:), allocatable :: s s = 'ABC' // achar(0) // 'XYZ' print *, s end program print5 lfortran-0.63.0/tests/implicit13.f900000664000175000017500000000060015174404631017254 0ustar alastairalastairinteger function a(d, e) implicit integer (a,b-c), integer*4 (d-e), integer*8 (f-g), real (h) implicit real*4 (i-k), real*8 (l), complex (m, n), complex*8 (o) implicit complex*16 (p), double precision (q), double precision (r) integer :: Y(e) real :: X(d, e, e) real :: b Y(1) = 3 X(1, 1, 1) = 3 a = 1 b = 2 d = 3 f = 4 h = 5 i = 6 l = 7 m = 8 o = 9 p = 10 q = 11 r = 12 end function lfortran-0.63.0/tests/do_concurrent_reduce3.f900000664000175000017500000000047015174404631021561 0ustar alastairalastairsubroutine sum_reduce(a, s) real, intent(in) :: a(:) real, intent(out) :: s integer :: N, i N = size(a) s = 0 do concurrent (i = 1:N) reduce(*: s) s = s + a(i) end do do concurrent (i = 1:N) reduce(MIN: s) s = s + a(i) end do do concurrent (i = 1:N) reduce(MAX: s) s = s + a(i) end do end subroutine lfortran-0.63.0/tests/module_struct_global_separate_compilation_01.f900000664000175000017500000000045515174404631026301 0ustar alastairalastairmodule module_struct_global_separate_compilation_01 implicit none type :: t integer :: x end type t type(t) :: targets contains subroutine set_targets(v) integer, intent(in) :: v targets%x = v end subroutine set_targets end module module_struct_global_separate_compilation_01 lfortran-0.63.0/tests/print_intrinsics.f900000664000175000017500000000033115174404631020700 0ustar alastairalastairprogram print_intrinsics implicit none integer,parameter:: sp = kind(1e0), dp = kind(1d0) print *, 'pi=acos(-1.0_sp) ="', acos(-1.0_sp),'"' print *, 'pi=acos(-1.0_dp) ="', acos(-1.0_dp),'"' end program lfortran-0.63.0/tests/fn4.f900000664000175000017500000000131015174404631015764 0ustar alastairalastairfunction conform(mold, val, dim) type(*), intent(in) :: mold(..) type(*), intent(in), optional :: val(..) integer, intent(in), optional :: dim logical :: conform if (present(val)) then if (present(dim)) then if (dim > 0 .and. dim <= rank(mold) .and. dim <= rank(val)) then conform = size(mold, dim=dim) == size(val, dim=dim) else error stop "Runtime error: Illegal dim argument provided in conform" end if else if (rank(val) == rank(mold)) then conform = all(shape(mold) == shape(val)) else conform = .false. end if end if else conform = .true. end if end function lfortran-0.63.0/tests/redeclaration1.f900000664000175000017500000000010015174404631020166 0ustar alastairalastairsubroutine redeclare1(piv, k) integer piv(k), k end subroutine lfortran-0.63.0/tests/expr2.f900000664000175000017500000000000415174404631016334 0ustar alastairalastair5+3 lfortran-0.63.0/tests/flush1.f900000664000175000017500000000026215174404631016504 0ustar alastairalastairprogram flush1 ! Tests for syntax (AST only): flush (10, IOSTAT = n) flush (20, IOMSG = n) flush (ERR = label) flush (30, UNIT = 40) FLUSH 50 end program lfortran-0.63.0/tests/if2.f900000664000175000017500000000053115174404631015761 0ustar alastairalastairprogram expr2 implicit none integer :: x time = 12 if (time < 10) then ! Comment 1 print *, "Good morning" else if (time < 20) then ! Comment 2 print *, "Good day" else ! Comment 3 print *, "Good evening" end if ! Comment 4 end program lfortran-0.63.0/tests/global_scope4.f900000664000175000017500000000004115174404631020012 0ustar alastairalastairinteger :: x x = 6 x = x + 1 3*x lfortran-0.63.0/tests/classes1.f900000664000175000017500000000066515174404631017027 0ustar alastairalastairmodule xx type :: base integer :: x contains procedure, non_overridable :: show_x end type contains subroutine show_x(this) class(base), intent(inout) :: this this%x = 12 end subroutine show_x end module program main use xx implicit none type(base) :: b b%x = 10 call b%show_x() print *, b%x if ( b%x /= 12 ) error stop end program lfortran-0.63.0/tests/character2.f900000664000175000017500000000026115174404631017317 0ustar alastairalastairprogram character2 implicit none CHARACTER, parameter :: char_param*3 = "App" CHARACTER :: char1*4 = "Goat" CHARACTER :: char2*4 char2 = "Balle" end program lfortran-0.63.0/tests/format3.f900000664000175000017500000000127415174404631016661 0ustar alastairalastair! tests for 'EN' formatting program format3 ! standard positive values real :: num1, num2, num3, small_num4, under_power_10 ! standard negative values real :: neg_num1, small_neg_num4 real :: zero1 num1 = 12345.6789 num2 = 0.000123456789 num3 = 1234.5678 small_num4 = 0.000123456789 under_power_10 = 999.9999 neg_num1 = -1234.5678 small_neg_num4 = -0.000123456789 zero1 = 0.0 print '(EN12.4)', num1 print '(EN12.4)', num2 print '(EN10.4)', num3 print '(EN10.4)', small_num4 print '(EN10.4)', under_power_10 print '(EN12.4)', neg_num1 print '(EN15.5)', small_neg_num4 print '(EN10.4)', zero1 end program format3 lfortran-0.63.0/tests/modules3.f900000664000175000017500000000012115174404631017027 0ustar alastairalastairmodule tomlf_type use tomlf_type_array implicit none end module tomlf_type lfortran-0.63.0/tests/fixed_form_implicit1.f0000664000175000017500000000016415174404631021227 0ustar alastairalastair program main implicit none integer a a = 1 if(a.le.1) print *, "h" end program lfortran-0.63.0/tests/print1.f900000664000175000017500000000023115174404631016513 0ustar alastairalastairprogram print1 implicit none real :: pi pi = 3.141592 print "(f6.3)", pi print *, pi print 10 10 format(3x, "print") end program lfortran-0.63.0/tests/allow_implicit_interface5.f900000664000175000017500000000025315174404631022417 0ustar alastairalastairsubroutine klvnzo_(nt,kd) implicit double precision (a-h,o-z) dimension zo(nt),rt0(8) call klvna(rt) return end program main call klvnzo_(5,8) end program lfortran-0.63.0/tests/expr4.f900000664000175000017500000000005215174404631016341 0ustar alastairalastair5. 5.+3. (5.+3.)*2. 5.+3.*2. 5.-3. 4.**3. lfortran-0.63.0/tests/program3.f900000664000175000017500000000066315174404631017041 0ustar alastairalastairprogram program3 real :: x, y, z x = 5.0 y = 2.0 z = x*y print *, "10.0 ==", z z = func1(x, y) print *, "49.0 ==", z z = func2(x, y) print *, "10.0 ==", z contains function func1(a, b) result(c) real, intent(in) :: a, b real :: c c = a + b c = func2(c, c) end function function func2(a, b) result(c) real, intent(in) :: a, b real :: c c = a * b ! c = func1(c, c) end function end program program3lfortran-0.63.0/tests/preprocessor1.f900000664000175000017500000000016315174404631020111 0ustar alastairalastairprogram preprocessor1 implicit none #define X123 12345678 integer :: x, y x = (2+3)*5 print *, x, X123 end program lfortran-0.63.0/tests/infer_first_assignment_01.f900000664000175000017500000000010315174404631022336 0ustar alastairalastairx = 42 y = 3.14 z = (1.0, 2.0) flag = .true. s = "hello" x = x + 1 lfortran-0.63.0/tests/int_to_int_cast_fortran_codegen.f900000664000175000017500000000074615174404631023710 0ustar alastairalastairprogram ImplicitIntToIntCastExample implicit none integer :: integerValue1 ! Default integer type integer(kind=8) :: integerValue2 ! 8-byte integer ! Assign an integer value integerValue1 = 10 ! Perform an implicit integer to integer cast integerValue2 = integerValue1 ! Output the result print *, "Integer Value 1:", integerValue1 print *, "Integer Value 2 (Kind=8):", integerValue2 end program ImplicitIntToIntCastExample lfortran-0.63.0/tests/fixedform_subroutine.f0000664000175000017500000000050415174404631021372 0ustar alastairalastair subroutine f(a,b,c) print *,4 end subroutine integer k,l k=100 do 80 k=1,10 print*,k 80 continue if (k.le.10000) then print*,k else print*,k+1 do l=1,10 print*,"do" enddo endif end lfortran-0.63.0/tests/subroutine4.f900000664000175000017500000000031515174404631017564 0ustar alastairalastairsubroutine triad(a, b, scalar, c) real, intent(in) :: a(:), b(:), scalar real, intent(out) :: c(:) integer :: N, i N = size(a) do concurrent (i = 1:N) c(i) = a(i) + scalar * b(i) end do end subroutine lfortran-0.63.0/tests/do3.f900000664000175000017500000000022315174404631015764 0ustar alastairalastairprogram do3 implicit none integer :: i, j j = 0 do 15 i = 1, 5 j = j + i 15 enddo j = 0 do 20 i = 1, 6, 2 j = j + i 20 end do end program lfortran-0.63.0/tests/pragma1.f900000664000175000017500000000126415174404631016635 0ustar alastairalastairsubroutine a1(n, A, B) integer, intent(in) :: n real, intent(in) :: A(n) real, intent(out) :: B(n) integer :: i !$OMP PARALLEL DO do i = 2, N B(i) = (A(i) + A(i-1)) / 2 end do !$OMP END PARALLEL DO end subroutine subroutine parallel_sum(n, a) integer, intent(in) :: n integer, intent(in) :: a(:) integer :: partial_sum, total_sum, i partial_sum = 0 total_sum = 0 !$omp parallel private(partial_sum) shared(total_sum) !$omp do do i = 1, n partial_sum = partial_sum + a(i) end do !$omp end do ! TODO: ! !$omp critical ! total_sum = total_sum + partial_sum ! !$omp end critical !$omp end parallel end subroutine lfortran-0.63.0/tests/nullify1.f900000664000175000017500000000013315174404631017042 0ustar alastairalastairprogram nullify1 ! Tests for syntax (AST) only: nullify(a) nullify(a, b, c, d) end program lfortran-0.63.0/tests/loop_test2.f0000664000175000017500000000125215174404631017223 0ustar alastairalastair subroutine f() integer nq, m real wrk5(5), v(3, 4, 5) real ve(3, 4, 5),vev(3, 4) real zero integer l1,j,l2 integer indx DO 140 L1 = 1,NQ DO 110 J = 1,M WRK5(J) = V(INDX,J,L1) 110 CONTINUE DO 120 J = 1,M VE(INDX,L1,J) = WRK5(J) 120 CONTINUE 140 CONTINUE indx = 1 zero = 0.0d00 DO 230 L1 = 1,NQ DO 220 L2 = 1,L1 VEV(L1,L2) = ZERO DO 210 J = 1,M VEV(L1,L2) = VEV(L1,L2) + VE(INDX,L1,J)*VE(INDX,L2,J) 210 CONTINUE VEV(L2,L1) = VEV(L1,L2) 220 CONTINUE 230 CONTINUE RETURN END lfortran-0.63.0/tests/fixed_form_with_exit.f0000664000175000017500000000016415174404631021340 0ustar alastairalastair SUBROUTINE EXAMPLE INTEGER I DO I = 2, 8 IF (I == 2) EXIT END DO ENDlfortran-0.63.0/tests/modules_02.f900000664000175000017500000000576215174404631017265 0ustar alastairalastairmodule random use types, only: dp use utils, only: stop_error implicit none private public randn, rand_gamma interface randn module procedure randn_scalar module procedure randn_vector module procedure randn_matrix module procedure randn_vector_n end interface interface rand_gamma module procedure rand_gamma_scalar module procedure rand_gamma_vector module procedure rand_gamma_matrix module procedure rand_gamma_vector_n end interface contains subroutine randn_scalar(x) ! Returns a psuedorandom scalar drawn from the standard normal distribution. ! ! [1] Marsaglia, G., & Bray, T. A. (1964). A Convenient Method for Generating ! Normal Variables. SIAM Review, 6(3), 260-264. real(dp), intent(out) :: x logical, save :: first = .true. real(dp), save :: u(2) real(dp) :: r2 if (first) then do call random_number(u) u = 2*u-1 r2 = sum(u**2) if (r2 < 1 .and. r2 > 0) exit end do u = u * sqrt(-2*log(r2)/r2) x = u(1) else x = u(2) end if first = .not. first end subroutine subroutine randn_vector_n(n, x) integer, intent(in) :: n real(dp), intent(out) :: x(n) integer :: i do i = 1, size(x) call randn(x(i)) end do end subroutine subroutine randn_vector(x) real(dp), intent(out) :: x(:) call randn_vector_n(size(x), x) end subroutine subroutine randn_matrix(x) real(dp), intent(out) :: x(:, :) call randn_vector_n(size(x), x) end subroutine subroutine rand_gamma0(a, first, fn_val) ! Returns a psuedorandom scalar drawn from the gamma distribution. ! ! The shape parameter a >= 1. ! ! [1] Marsaglia, G., & Tsang, W. W. (2000). A Simple Method for Generating ! Gamma Variables. ACM Transactions on Mathematical Software (TOMS), 26(3), ! 363-372. real(dp), intent(in) :: a logical, intent(in) :: first real(dp), intent(out) :: fn_val real(dp), save :: c, d real(dp) :: U, v, x if (a < 1) call stop_error("Shape parameter must be >= 1") if (first) then d = a - 1._dp/3 c = 1/sqrt(9*d) end if do do call randn(x) v = (1 + c*x)**3 if (v > 0) exit end do call random_number(U) ! Note: the number 0.0331 below is exact, see [1]. if (U < 1 - 0.0331_dp*x**4) then fn_val = d*v exit else if (log(U) < x**2/2 + d*(1 - v + log(v))) then fn_val = d*v exit end if end do end subroutine subroutine rand_gamma_scalar(a, x) real(dp), intent(in) :: a real(dp), intent(out) :: x call rand_gamma0(a, .true., x) end subroutine subroutine rand_gamma_vector_n(a, n, x) real(dp), intent(in) :: a integer, intent(in) :: n real(dp), intent(out) :: x(n) integer :: i call rand_gamma0(a, .true., x(1)) do i = 2, size(x) call rand_gamma0(a, .false., x(i)) end do end subroutine subroutine rand_gamma_vector(a, x) real(dp), intent(in) :: a real(dp), intent(out) :: x(:) call rand_gamma_vector_n(a, size(x), x) end subroutine subroutine rand_gamma_matrix(a, x) real(dp), intent(in) :: a real(dp), intent(out) :: x(:, :) call rand_gamma_vector_n(a, size(x), x) end subroutine end module lfortran-0.63.0/tests/implied_do_loop3.f900000664000175000017500000000156415174404631020531 0ustar alastairalastair! Test implied do loops + call to intrinsic module implied_do_loops3_mod implicit none contains subroutine test_1 character(len=20) :: tmp_line(3) integer :: iii, ii tmp_line = "Hello" ii = 3 write(*, '(g0)') (trim(tmp_line(iii)), iii=1, ii) end subroutine subroutine test_2 implicit none character, allocatable :: tmp_line integer :: i tmp_line = "Hello" print *, (tmp_line, i=1, 3) end subroutine subroutine test_3 character(len=20) :: tmp_line integer :: iii, ii tmp_line = "Hello" ii = 3 write(*, '(g0)') (trim(tmp_line), iii=1, ii) end subroutine end module program implied_do_loops3 use implied_do_loops3_mod implicit none call test_1() call test_2() call test_3() end program lfortran-0.63.0/tests/fixed_form4.f0000664000175000017500000000014415174404631017336 0ustar alastairalastair program X implicit none integer :: y y = 5 500 pr 4int *, y end program lfortran-0.63.0/tests/collect_occurence4.f900000664000175000017500000000025615174404631021044 0ustar alastairalastairmodule collect_occurence4_mod end module collect_occurence4_mod subroutine abc() end subroutine abc program main use collect_occurence4_mod integer :: abc end program main lfortran-0.63.0/tests/implicit_typing3.f900000664000175000017500000000010115174404631020561 0ustar alastairalastairinteger function f(h, i, j) implicit real (j) f = 3 end function lfortran-0.63.0/tests/allocate_01.f900000664000175000017500000000050715174404631017370 0ustar alastairalastairprogram hello implicit none character(:), allocatable :: cmd integer :: cmdlen integer :: ierr call get_command(length=cmdlen) if (cmdlen>0) then allocate(character(cmdlen) :: cmd) call get_command(cmd) print *, "hello ", cmd end if deallocate(cmd, stat = ierr) end program lfortran-0.63.0/tests/fixed_form_implicit2.f0000664000175000017500000000027115174404631021227 0ustar alastairalastair program main c TODO: SymbolTable stays empty upon running with `--show-asr`. Needs c rechecking implicit complex (a,b,c) implicit character*4 (k,l) end program lfortran-0.63.0/tests/preprocessor10.f900000664000175000017500000000244315174404631020174 0ustar alastairalastairprogram preprocessor10 ! #if implicit none #define X #define Y(x) 4*(x) #if defined(X) print *, "X is defined" #endif #if defined( Y ) print *, "Y is defined" #else print *, "Y is not defined" #endif #if defined(Z) print *, "Z is defined" #else print *, "Z is not defined" #endif #if defined(X) && defined(Y) print *, "X and Y is defined" #else print *, "X and Y is not defined" #endif #if defined(Z) && defined(Y) print *, "Z and Y is defined" #else print *, "Z and Y is not defined" #endif #if defined(Z) || defined(Y) print *, "Z or Y is defined" #else print *, "Z or Y is not defined" #endif #if defined(X) && defined(Y) && defined(Z) print *, "X and Y and Z is defined" #else print *, "X and Y and Z is not defined" #endif #if defined(X) && defined(Y) || defined(Z) print *, "X and Y or Z is defined" #else print *, "X and Y or Z is not defined" #endif #if defined(X) && \ defined(Y) || defined(Z) print *, "X and Y or Z is defined" #else print *, "X and Y or Z is not defined" #endif #if defined(X) && \ !defined(Y) || !defined(Z) print *, "X and !Y or !Z is defined" #else print *, "X and !Y or !Z is not defined" #endif #if defined(X) && \ !(defined(Y) || defined(Z)) print *, "X and !(Y or Z) is defined" #else print *, "X and !(Y or Z) is not defined" #endif end program lfortran-0.63.0/tests/modules_10.f900000664000175000017500000000053215174404631017252 0ustar alastairalastairmodule my_other_module integer :: my_global = 0 contains subroutine my_other_proc print *, my_global end subroutine end module module modules_10 use my_other_module, only: my_global contains subroutine my_proc use my_other_module, only: my_other_proc call my_other_proc end subroutine end module lfortran-0.63.0/tests/parser/0000775000175000017500000000000015174404631016256 5ustar alastairalastairlfortran-0.63.0/tests/parser/parameter_without_start_program.f900000664000175000017500000000002415174404631025301 0ustar alastairalastairparameter(x=10) end lfortran-0.63.0/tests/parser/program_without_line_04.f900000664000175000017500000000007515174404631023344 0ustar alastairalastair subroutine sub (); end subroutine; integer i end lfortran-0.63.0/tests/parser/program_without_line_07.f900000664000175000017500000000002615174404631023343 0ustar alastairalastairerror stop endprogram lfortran-0.63.0/tests/parser/program_without_line_03.f900000664000175000017500000000010515174404631023335 0ustar alastairalastair subroutine sub (); end subroutine; integer i end program lfortran-0.63.0/tests/parser/procedure_with_type.f900000664000175000017500000000061015174404631022657 0ustar alastairalastairprogram procedure_with_type procedure(), pointer :: x procedure(double precision), pointer :: y procedure(doubleprecision), pointer :: yb procedure(integer), pointer :: z procedure(real), pointer :: a procedure(complex), pointer :: b procedure(real(8)), pointer :: c integer, parameter :: dp = kind(0.d0) procedure(real(dp)), pointer :: d procedure(character(1, 1)), pointer :: e end program lfortran-0.63.0/tests/parser/program_without_line_05.f900000664000175000017500000000014015174404631023336 0ustar alastairalastairsubroutine x end subroutine implicit none call y end subroutine y print *, "x" end subroutine lfortran-0.63.0/tests/parser/data_stmt_with_implied_do_loop.f0000664000175000017500000000036115174404631024656 0ustar alastairalastair PROGRAM data_stmt_with_implied_do_loop IMPLICIT NONE INTEGER i INTEGER P(1), C(1,1) CHARACTER(1) :: ch DATA P( 1), (C( 1,i), i=1, 1) / 31, 12 / DATA ch / "=" / END PROGRAM lfortran-0.63.0/tests/parser/program_without_line_01.f900000664000175000017500000000002215174404631023331 0ustar alastairalastairprint *, "OK" end lfortran-0.63.0/tests/parser/program_without_line_02.f900000664000175000017500000000003215174404631023333 0ustar alastairalastairprint *, "OK" end program lfortran-0.63.0/tests/parser/program_without_line_06.f900000664000175000017500000000001115174404631023334 0ustar alastairalastairstop end lfortran-0.63.0/tests/parser/derived_type_without_start_program.f900000664000175000017500000000006615174404631026012 0ustar alastairalastair type :: test_t real :: a end type end lfortran-0.63.0/tests/parser/enum_decl_without_start_program.f900000664000175000017500000000010515174404631025254 0ustar alastairalastair enum, bind(c) enumerator yellow end enum END program lfortran-0.63.0/tests/server/0000775000175000017500000000000015174404631016270 5ustar alastairalastairlfortran-0.63.0/tests/server/setup.cfg0000664000175000017500000000160115174404631020107 0ustar alastairalastair[metadata] name = lfortran-language-server version = 0.0.1 author = Dylon Edwards author_email = dylon.devo@gmail.com description = LSP client for testing lfortran-language-server. long_description = file: README.md long_description_content_type = text/markdown url = https://github.com/lfortran/lfortran project_urls = Bug Tracker = https://github.com/lfortran/lfortran/issues license = BSD-3-Clause classifiers = Programming Language :: Python :: 3 Programming Language :: Python :: 3.10 License :: OSI Approved :: BSD License Operating System :: POSIX :: Linux Operating System :: MacOS Operating System :: Microsoft :: Windows [options] include_package_data = True package_dir = = src packages = find: python_requires = >=3.10 install_requires = pytest>=8.3.5 pytest-timeout>=2.3.1 llanguage-test-client>=0.0.1 [options.packages.find] where = src lfortran-0.63.0/tests/server/tests/0000775000175000017500000000000015174404631017432 5ustar alastairalastairlfortran-0.63.0/tests/server/tests/__init__.py0000664000175000017500000000000015174404631021531 0ustar alastairalastairlfortran-0.63.0/tests/server/tests/conftest.py0000664000175000017500000001736215174404631021642 0ustar alastairalastairimport os import shutil import sys from pathlib import Path from typing import Iterator, Optional import pytest from lfortran_language_server.lfortran_lsp_test_client import LFortranLspTestClient def pytest_addoption(parser: pytest.Parser) -> None: parser.addoption( "--execution-strategy", action="store", default="concurrent", help="Specifies the execution strategy for handling messages. The `parallel` strategy implies multiple messages may be processed alongside each other, while the `concurrent` strategy implies multiple messages may be processed but only one processor will be active at a time (they will yield control to each other).", choices=("concurrent", "parallel"), ) @pytest.fixture def client(request: pytest.FixtureRequest, capfd: pytest.CaptureFixture) -> Iterator[LFortranLspTestClient]: execution_strategy = request.config.getoption("--execution-strategy") server_path = None if 'LFORTRAN_PATH' in os.environ: server_path = os.environ['LFORTRAN_PATH'] if server_path is None or not os.path.exists(server_path): server_path = Path(__file__).absolute().parent.parent.parent.parent / "src" / "bin" / "lfortran" if server_path is None or not os.path.exists(server_path): server_path = shutil.which('lfortran') if server_path is None: raise RuntimeError('cannot determine location of lfortran') server_path = Path(server_path) if not (server_path.exists() and os.access(server_path, os.X_OK)): raise RuntimeError(f'Invalid or non-executable path to lfortran: {server_path}') compiler_path = server_path server_log_path = f"{request.node.name}-{execution_strategy}-server.log" client_log_path = f"{request.node.name}-{execution_strategy}-client.log" stdout_log_path = f"{request.node.name}-{execution_strategy}-stdout.log" stdin_log_path = f"{request.node.name}-{execution_strategy}-stdin.log" gdb_log_path = f"{request.node.name}-{execution_strategy}-gdb.log" lldb_log_path = f"{request.node.name}-{execution_strategy}-lldb.log" config = { "LFortran": { "openIssueReporterOnError": False, "maxNumberOfProblems": 100, "trace": { "server": "verbose", }, "compiler": { "path": "lfortran", "flags": [], }, "log": { "path": server_log_path, "level": "all", "prettyPrint": False, }, "indentSize": 4, # NOTE: Regarding timing-out and retrying requests, a timeout of 0 # means do not time-out (or retry): "timeoutMs": 0, "retry": { "maxAttempts": 3, "minSleepTimeMs": 10, "maxSleepTimeMs": 300, }, "telemetry": { "enabled": True, "frequencyMs": 1000, }, } } server_args = [] # FIXME: Find the correct combination of commands to get LLDB to dump crashes # to a log file like GDB and uncomment the following to enable it: # --------------------------------------------------------------------------- # lldb_path = shutil.which('lldb') lldb_path = None #<- FIXME: When LLDB is enabled, remove this line. # NOTE: If you have GDB on your system and would like to run the tests with # it, uncomment the following line so GDB may be found and disable the line # that assigns `None` to it: # ------------------------------------------------------------------------- # gdb_path = shutil.which('gdb') gdb_path = None if lldb_path is not None: server_args += [ "-q", "-b", "-o", "run", "-o", "bt", "-o", f"log enable lldb crashlog {lldb_log_path}", "-o", "quit", str(compiler_path), "--", ] server_path = Path(lldb_path) elif gdb_path is not None: server_args += [ "-q", "-batch", "-ex", "set logging enabled off", "-ex", "set logging redirect on", "-ex", "set logging debugredirect on", "-ex", "set logging overwrite on", "-ex", f"set logging file {gdb_log_path}", "-ex", "set logging enabled on", "-ex", "run", "-ex", "bt", "--args", str(compiler_path), ] server_path = Path(gdb_path) server_args += [ "server", "--parent-process-id", str(os.getpid()), "--log-level", config["LFortran"]["log"]["level"], "--log-path", server_log_path, "--timeout-ms", str(config["LFortran"]["timeoutMs"]), "--num-request-threads", "1", "--num-worker-threads", "1", "--config-section", "LFortran", "--open-issue-reporter-on-error", str(config["LFortran"]["openIssueReporterOnError"]).lower(), "--max-number-of-problems", str(config["LFortran"]["maxNumberOfProblems"]), "--trace-server", config["LFortran"]["trace"]["server"], "--compiler-path", str(compiler_path), "--log-pretty-print", str(config["LFortran"]["log"]["prettyPrint"]).lower(), "--indent-size", str(config["LFortran"]["indentSize"]), "--max-retry-attempts", str(config["LFortran"]["retry"]["maxAttempts"]), "--min-retry-sleep-time-ms", str(config["LFortran"]["retry"]["minSleepTimeMs"]), "--max-retry-sleep-time-ms", str(config["LFortran"]["retry"]["maxSleepTimeMs"]), "--extension-id", "lcompilers.lfortran", "--execution-strategy", execution_strategy, ] def print_log(log_path: str, heading: str) -> None: header = f"~~ {heading} [{log_path}] ~~" border = "~" * len(header) print(file=sys.stderr) print(border, file=sys.stderr) print(header, file=sys.stderr) print(border, file=sys.stderr) print(file=sys.stderr) if os.path.exists(log_path): with open(log_path) as f: print(f.read(), file=sys.stderr) else: print(f"Log file does not exist: {log_path}", file=sys.stderr) def print_logs() -> None: print_log(client_log_path, "Client Logs") print_log(stdin_log_path, "Standard Input") print_log(stdout_log_path, "Standard Output") print_log(server_log_path, "Server Logs") if lldb_path is not None: print_log(lldb_log_path, "Low-Level Debugger (LLDB)") elif gdb_path is not None: print_log(gdb_log_path, "GNU Debugger (GDB)") client: Optional[LFortranLspTestClient] = None logs_printed = False try: client = LFortranLspTestClient( server_path=server_path, server_params=server_args, workspace_path=None, timeout_ms=3000, config=config, client_log_path=client_log_path, stdout_log_path=stdout_log_path, stdin_log_path=stdin_log_path ) with client.serve(): # Steps abstracted by context manager: # 1. Send request: initialize # 2. Send notification: initialized # 3. # 4. Send request: shutdown # 5. Send notification: exit yield client except BaseException as e: if not isinstance(e, SystemExit) or e.code != 0: print_logs() logs_printed = True raise e finally: try: if client is not None and hasattr(client, 'server') \ and client.server.poll(): client.kill_server() finally: if not logs_printed: print_logs() # Consuming stderr should prevent leaks capfd.readouterr() lfortran-0.63.0/tests/server/tests/test_document_manipulation.py0000664000175000017500000002430515174404631025445 0ustar alastairalastairimport os from tempfile import NamedTemporaryFile from lsprotocol.types import (TextDocumentContentChangeEvent_Type1, TextDocumentDidChangeNotification, TextDocumentDidOpenNotification, WorkspaceDidRenameFilesNotification) from llanguage_test_client.lsp_test_client import OutgoingEvent from lfortran_language_server.lfortran_lsp_test_client import LFortranLspTestClient def test_document_manipulation(client: LFortranLspTestClient): with NamedTemporaryFile( prefix="test_document_manipulation-", suffix=".f90", delete=True ) as tmp_file_1: with NamedTemporaryFile( prefix="test_document_manipulation-", suffix=".f90", delete=True ) as tmp_file_2: doc = client.new_document("fortran") doc.write("module module_function_call1\n") doc.write("end module module_function_call1\n") doc.save(tmp_file_1.name) assert os.path.exists(tmp_file_1.name) def sent_text_document_did_open(event: OutgoingEvent) -> bool: if isinstance(event.data, TextDocumentDidOpenNotification): notification = event.data return notification.params.text_document.uri == doc.uri return False assert client.has_outgoing_event(sent_text_document_did_open) assert client.await_validation(doc.uri, doc.version) is not None rdoc = client.get_remote_document(doc.uri) assert doc.uri == rdoc["uri"] assert doc.version == rdoc["version"] with open(tmp_file_1.name) as f: assert doc.text == rdoc["text"] == f.read() == "\n".join([ "module module_function_call1", "end module module_function_call1", ]) + "\n" doc.cursor = 1,6 doc.write("foo") doc.save() def sent_text_document_did_write_foo(event: OutgoingEvent) -> bool: if isinstance(event.data, TextDocumentDidChangeNotification): notification = event.data params = notification.params if params.text_document.uri == doc.uri: content_changes = params.content_changes if len(content_changes) == 1: content_change = content_changes[0] if isinstance(content_change, TextDocumentContentChangeEvent_Type1): range = content_change.range start = range.start end = range.end return start.line == 0 \ and start.character == 5 \ and end.line == 0 \ and end.character == 5 \ and content_change.text == "foo" return False assert client.has_outgoing_event(sent_text_document_did_write_foo) assert client.await_validation(doc.uri, doc.version) is not None rdoc = client.get_remote_document(doc.uri) assert doc.uri == rdoc["uri"] assert doc.version == rdoc["version"] with open(tmp_file_1.name) as f: assert doc.text == rdoc["text"] == f.read() == "\n".join([ "modulfooe module_function_call1", "end module module_function_call1", ]) + "\n" doc.cursor = 1,6 doc.replace("bar") doc.save() def sent_text_document_did_replace_foo_with_bar( event: OutgoingEvent ) -> bool: if isinstance(event.data, TextDocumentDidChangeNotification): notification = event.data params = notification.params if params.text_document.uri == doc.uri: content_changes = params.content_changes if len(content_changes) == 1: content_change = content_changes[0] if isinstance(content_change, TextDocumentContentChangeEvent_Type1): range = content_change.range start = range.start end = range.end return start.line == 0 \ and start.character == 5 \ and end.line == 0 \ and end.character == 8 \ and content_change.text == "bar" return False assert client.has_outgoing_event( sent_text_document_did_replace_foo_with_bar ) assert client.await_validation(doc.uri, doc.version) is not None rdoc = client.get_remote_document(doc.uri) assert doc.uri == rdoc["uri"] assert doc.version == rdoc["version"] with open(tmp_file_1.name) as f: assert doc.text == rdoc["text"] == f.read() == "\n".join([ "modulbare module_function_call1", "end module module_function_call1", ]) + "\n" doc.backspace() doc.save() def sent_text_document_did_backspace_r(event: OutgoingEvent) -> bool: if isinstance(event.data, TextDocumentDidChangeNotification): notification = event.data params = notification.params if params.text_document.uri == doc.uri: content_changes = params.content_changes if len(content_changes) == 1: content_change = content_changes[0] if isinstance(content_change, TextDocumentContentChangeEvent_Type1): range = content_change.range start = range.start end = range.end return start.line == 0 \ and start.character == 7 \ and end.line == 0 \ and end.character == 8 \ and content_change.text == "" return False assert client.has_outgoing_event(sent_text_document_did_backspace_r) assert client.await_validation(doc.uri, doc.version) is not None rdoc = client.get_remote_document(doc.uri) assert doc.uri == rdoc["uri"] assert doc.version == rdoc["version"] with open(tmp_file_1.name) as f: assert doc.text == rdoc["text"] == f.read() == "\n".join([ "modulbae module_function_call1", "end module module_function_call1", ]) + "\n" doc.cursor = 1,6 doc.delete(2) doc.save() def sent_text_document_did_delete_ba(event: OutgoingEvent) -> bool: if isinstance(event.data, TextDocumentDidChangeNotification): notification = event.data params = notification.params if params.text_document.uri == doc.uri: content_changes = params.content_changes if len(content_changes) == 1: content_change = content_changes[0] if isinstance(content_change, TextDocumentContentChangeEvent_Type1): range = content_change.range start = range.start end = range.end return start.line == 0 \ and start.character == 5 \ and end.line == 0 \ and end.character == 7 \ and content_change.text == "" return False assert client.has_outgoing_event(sent_text_document_did_delete_ba) assert client.await_validation(doc.uri, doc.version) is not None rdoc = client.get_remote_document(doc.uri) assert doc.uri == rdoc["uri"] assert doc.version == rdoc["version"] with open(tmp_file_1.name) as f: assert doc.text == rdoc["text"] == f.read() == "\n".join([ "module module_function_call1", "end module module_function_call1", ]) + "\n" doc.move(tmp_file_2.name) def sent_workspace_did_rename_file(event: OutgoingEvent) -> bool: if isinstance(event.data, WorkspaceDidRenameFilesNotification): notification = event.data for record in notification.params.files: if record.old_uri == f"file://{tmp_file_1.name}" \ and record.new_uri == f"file://{tmp_file_2.name}": return True return False assert client.has_outgoing_event(sent_workspace_did_rename_file) assert not os.path.exists(tmp_file_1.name) open(tmp_file_1.name, "w").close() # ensure it exists during clean-up assert os.path.exists(tmp_file_2.name) rdoc = client.get_remote_document(doc.uri) assert doc.uri == rdoc["uri"] assert doc.version == rdoc["version"] with open(tmp_file_2.name) as f: assert doc.text == rdoc["text"] == f.read() == "\n".join([ "module module_function_call1", "end module module_function_call1", ]) + "\n" doc.remove() assert not os.path.exists(tmp_file_2.name) open(tmp_file_2.name, "w").close() # ensure it exists during clean-up lfortran-0.63.0/tests/server/tests/test_features.py0000664000175000017500000005200615174404631022664 0ustar alastairalastairfrom pathlib import Path from tempfile import NamedTemporaryFile from typing import List import pytest from lsprotocol.types import (CompletionItem, CompletionItemKind, DidChangeConfigurationParams, DocumentHighlight, DocumentSymbol, Hover, MarkupContent, MarkupKind, Position, Range, SymbolKind) from lfortran_language_server.lfortran_lsp_test_client import \ LFortranLspTestClient from llanguage_test_client.json_rpc import JsonArray from llanguage_test_client.lsp_test_client import IncomingEvent def test_goto_definition(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent / "function_call1.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None line, column = 18, 18 doc.cursor = line, column doc.goto_definition() assert doc.line == 8 assert doc.column == 5 def test_diagnostics(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent / "function_call1.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None line, column = 21, 1 doc.cursor = line, column doc.write("error") validation = client.await_validation(doc.uri, doc.version) assert validation is not None assert validation["params"]["uri"] == doc.uri assert validation["params"]["version"] == doc.version diagnostics = validation["params"]["diagnostics"] assert len(diagnostics) == 2 assert diagnostics[0]["message"] == "Statement or Declaration expected inside program, found Variable name" assert diagnostics[0]["range"]["start"]["line"] == 20 assert diagnostics[0]["range"]["start"]["character"] == 0 assert diagnostics[0]["range"]["end"]["line"] == 20 assert diagnostics[0]["range"]["end"]["character"] == 5 assert diagnostics[0]["severity"] == 1 assert diagnostics[0]["source"] == "lfortran" assert diagnostics[1]["message"] == "Variable 'error' is not declared" assert diagnostics[1]["range"]["start"]["line"] == 20 assert diagnostics[1]["range"]["start"]["character"] == 0 assert diagnostics[1]["range"]["end"]["line"] == 20 assert diagnostics[1]["range"]["end"]["character"] == 5 assert diagnostics[1]["severity"] == 1 assert diagnostics[1]["source"] == "lfortran" doc.backspace(5) validation = client.await_validation(doc.uri, doc.version) assert validation is not None assert validation["params"]["uri"] == doc.uri assert validation["params"]["version"] == doc.version diagnostics = validation["params"]["diagnostics"] assert len(diagnostics) == 0 def test_configuration_caching(client: LFortranLspTestClient) -> None: with NamedTemporaryFile( prefix="test_configuration_caching-", suffix=".f90", delete=True ) as tmp_file: doc = client.open_document("fortran", tmp_file.name) assert client.await_validation(doc.uri, doc.version) is not None doc.write("foo") doc.save() assert client.await_validation(doc.uri, doc.version) is not None def is_config_request_for_doc(event: IncomingEvent) -> bool: return event.data.get("method", None) == "workspace/configuration" and \ len(event.data["params"]["items"]) > 0 and \ event.data["params"]["items"][0]["scopeUri"] == doc.uri and \ event.data["params"]["items"][0]["section"] == "LFortran" event, index = client.find_incoming_event(is_config_request_for_doc) # The config must be requested before it may be cached: assert event is not None doc.write("bar") assert client.await_validation(doc.uri, doc.version) is not None event, index = client.find_incoming_event(is_config_request_for_doc, index + 1) # The config has been cached, so there is no need to cache it again: assert event is None # Invalidate the document caches: client.send_workspace_did_change_configuration( DidChangeConfigurationParams(client.config) ) doc.write("baz") assert client.await_validation(doc.uri, doc.version) is not None event, index = client.find_incoming_event(is_config_request_for_doc, index + 1) # The cache was invalidated so the config must be requested again: assert event is not None def test_rename(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent / "function_call1.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None line, column = 4, 20 doc.cursor = line, column doc.rename("foo") assert doc.text == "\n".join([ "module module_function_call1", " type :: softmax", " contains", " foo", " end type softmax", " contains", " ", " pure function foo(self, x) result(res)", " class(softmax), intent(in) :: self", " real, intent(in) :: x(:)", " real :: res(size(x))", " end function foo", " ", " pure function eval_1d_prime(self, x) result(res)", " class(softmax), intent(in) :: self", " real, intent(in) :: x(:)", " real :: res(size(x))", # TODO: Once lfortran can rename the function call, swap the following # two lines: # " res = self%foo(x)", " res = self%eval_1d(x)", " end function eval_1d_prime", "end module module_function_call1", ]) + "\n" def test_document_highlight(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent.parent / "examples" / "expr2.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None line, column = 7, 10 doc.cursor = line, column doc.highlight_symbol() assert doc.symbol_highlights is not None # NOTE: DocumentHighlight is not hashable, so we cannot perform set comparison ... expected_highlights: List[DocumentHighlight] = [ DocumentHighlight( range=Range( start=Position( line=3, character=11, ), end=Position( line=3, character=12, ), ), ), DocumentHighlight( range=Range( start=Position( line=5, character=0, ), end=Position( line=5, character=1, ), ), ), DocumentHighlight( range=Range( start=Position( line=6, character=9, ), end=Position( line=6, character=10, ), ), ), ] for highlight in doc.symbol_highlights: expected_highlights.remove(highlight) assert len(expected_highlights) == 0 def test_document_hover(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent / "function_call1.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None line, column = 18, 22 doc.cursor = line, column doc.hover() assert doc.preview == Hover( contents=MarkupContent( kind=MarkupKind.Markdown, value="```fortran\nfunction eval_1d(self, x) result(res)\n class(softmax), intent(in) :: self\n real(4)[:], intent(in) :: x\n real(4)[:] :: res\nend function\n```" ), range=Range( end=Position( character=24, line=11 ), start=Position( character=4, line=7 ) ) ) def test_symbol_tree(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent.parent / "examples" / "expr2.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None assert doc.symbols == [ DocumentSymbol( children=[ DocumentSymbol( kind=SymbolKind.Variable, name="x", range=Range( start=Position( line=3, character=11, ), end=Position( line=3, character=12, ), ), selection_range=Range( start=Position( line=3, character=11, ), end=Position( line=3, character=12, ), ), ), ], kind=SymbolKind.Function, name="expr2", range=Range( start=Position( line=0, character=0, ), end=Position( line=8, character=11, ), ), selection_range=Range( start=Position( line=0, character=0, ), end=Position( line=8, character=11, ), ), ), ] line, column = 4, 12 doc.cursor = line, column doc.rename("y") # x -> y assert doc.symbols == [ DocumentSymbol( children=[ DocumentSymbol( kind=SymbolKind.Variable, name="y", range=Range( start=Position( line=3, character=11, ), end=Position( line=3, character=12, ), ), selection_range=Range( start=Position( line=3, character=11, ), end=Position( line=3, character=12, ), ), ), ], kind=SymbolKind.Function, name="expr2", range=Range( start=Position( line=0, character=0, ), end=Position( line=8, character=11, ), ), selection_range=Range( start=Position( line=0, character=0, ), end=Position( line=8, character=11, ), ), ), ] def test_semantic_highlighting(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent / "function_call1.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None doc.semantic_highlight() expected_highlights = [ 0,0,6,15,0, # Keyword at line=0, column=0, length=6, text=`module` 0,7,21,8,0, # Variable at line=0, column=7, length=21, text=`module_function_call1` 1,4,4,15,0, # Keyword at line=1, column=4, length=4, text=`type` 0,8,7,8,0, # Variable at line=1, column=12, length=7, text=`softmax` 1,4,8,15,0, # Keyword at line=2, column=4, length=8, text=`contains` 1,6,9,8,0, # Variable at line=3, column=6, length=9, text=`procedure` 0,13,7,8,0, # Variable at line=3, column=19, length=7, text=`eval_1d` 1,4,3,15,0, # Keyword at line=4, column=4, length=3, text=`end` 0,4,4,15,0, # Keyword at line=4, column=8, length=4, text=`type` 0,5,7,8,0, # Variable at line=4, column=13, length=7, text=`softmax` 1,2,8,15,0, # Keyword at line=5, column=2, length=8, text=`contains` 2,4,4,8,0, # Variable at line=7, column=4, length=4, text=`pure` 0,5,8,15,0, # Keyword at line=7, column=9, length=8, text=`function` 0,9,7,8,0, # Variable at line=7, column=18, length=7, text=`eval_1d` 0,8,4,8,0, # Variable at line=7, column=26, length=4, text=`self` 0,6,1,8,0, # Variable at line=7, column=32, length=1, text=`x` 0,3,6,8,0, # Variable at line=7, column=35, length=6, text=`result` 0,7,3,8,0, # Variable at line=7, column=42, length=3, text=`res` 1,6,5,8,0, # Variable at line=8, column=6, length=5, text=`class` 0,6,7,8,0, # Variable at line=8, column=12, length=7, text=`softmax` 0,10,6,8,0, # Variable at line=8, column=22, length=6, text=`intent` 0,7,2,8,0, # Variable at line=8, column=29, length=2, text=`in` 0,7,4,8,0, # Variable at line=8, column=36, length=4, text=`self` 1,6,4,15,0, # Keyword at line=9, column=6, length=4, text=`real` 0,6,6,8,0, # Variable at line=9, column=12, length=6, text=`intent` 0,7,2,8,0, # Variable at line=9, column=19, length=2, text=`in` 0,7,1,8,0, # Variable at line=9, column=26, length=1, text=`x` 1,6,4,15,0, # Keyword at line=10, column=6, length=4, text=`real` 0,8,3,8,0, # Variable at line=10, column=14, length=3, text=`res` 0,4,4,8,0, # Variable at line=10, column=18, length=4, text=`size` 0,5,1,8,0, # Variable at line=10, column=23, length=1, text=`x` 1,4,3,15,0, # Keyword at line=11, column=4, length=3, text=`end` 0,4,8,15,0, # Keyword at line=11, column=8, length=8, text=`function` 0,9,7,8,0, # Variable at line=11, column=17, length=7, text=`eval_1d` 2,4,4,8,0, # Variable at line=13, column=4, length=4, text=`pure` 0,5,8,15,0, # Keyword at line=13, column=9, length=8, text=`function` 0,9,13,8,0, # Variable at line=13, column=18, length=13, text=`eval_1d_prime` 0,14,4,8,0, # Variable at line=13, column=32, length=4, text=`self` 0,6,1,8,0, # Variable at line=13, column=38, length=1, text=`x` 0,3,6,8,0, # Variable at line=13, column=41, length=6, text=`result` 0,7,3,8,0, # Variable at line=13, column=48, length=3, text=`res` 1,6,5,8,0, # Variable at line=14, column=6, length=5, text=`class` 0,6,7,8,0, # Variable at line=14, column=12, length=7, text=`softmax` 0,10,6,8,0, # Variable at line=14, column=22, length=6, text=`intent` 0,7,2,8,0, # Variable at line=14, column=29, length=2, text=`in` 0,7,4,8,0, # Variable at line=14, column=36, length=4, text=`self` 1,6,4,15,0, # Keyword at line=15, column=6, length=4, text=`real` 0,6,6,8,0, # Variable at line=15, column=12, length=6, text=`intent` 0,7,2,8,0, # Variable at line=15, column=19, length=2, text=`in` 0,7,1,8,0, # Variable at line=15, column=26, length=1, text=`x` 1,6,4,15,0, # Keyword at line=16, column=6, length=4, text=`real` 0,8,3,8,0, # Variable at line=16, column=14, length=3, text=`res` 0,4,4,8,0, # Variable at line=16, column=18, length=4, text=`size` 0,5,1,8,0, # Variable at line=16, column=23, length=1, text=`x` 1,6,3,8,0, # Variable at line=17, column=6, length=3, text=`res` 0,6,4,8,0, # Variable at line=17, column=12, length=4, text=`self` 0,5,7,8,0, # Variable at line=17, column=17, length=7, text=`eval_1d` 0,8,1,8,0, # Variable at line=17, column=25, length=1, text=`x` 1,4,3,15,0, # Keyword at line=18, column=4, length=3, text=`end` 0,4,8,15,0, # Keyword at line=18, column=8, length=8, text=`function` 0,9,13,8,0, # Variable at line=18, column=17, length=13, text=`eval_1d_prime` 1,0,3,15,0, # Keyword at line=19, column=0, length=3, text=`end` 0,4,6,15,0, # Keyword at line=19, column=4, length=6, text=`module` 0,7,21,8,0, # Variable at line=19, column=11, length=21, text=`module_function_call1` ] assert doc.semantic_highlights is not None assert doc.semantic_highlights.data == expected_highlights def test_code_completion(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent / "function_call1.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None line, column = 18, -1 doc.cursor = line, column doc.newline() doc.write("self") doc.complete() expected_completions = [ CompletionItem( label="self", kind=CompletionItemKind.Variable ) ] assert doc.completions is not None assert isinstance(doc.completions, list) for completion in doc.completions: expected_completions.remove(completion) assert len(expected_completions) == 0 doc.write("%") doc.complete() expected_completions = [ CompletionItem( label="module_function_call1", kind=CompletionItemKind.Module, ), CompletionItem( label="eval_1d", kind=CompletionItemKind.Function, ), CompletionItem( label="res", kind=CompletionItemKind.Variable, ), CompletionItem( label="self", kind=CompletionItemKind.Variable, ), CompletionItem( label="x", kind=CompletionItemKind.Variable, ), CompletionItem( label="eval_1d_prime", kind=CompletionItemKind.Function, ), CompletionItem( label="1_softmax_eval_1d", kind=CompletionItemKind.Function, ), CompletionItem( label="softmax", kind=CompletionItemKind.Struct, ), ] assert doc.completions is not None assert isinstance(doc.completions, list) for completion in doc.completions: expected_completions.remove(completion) assert len(expected_completions) == 0 def test_whole_document_formatting(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent / "function_call1.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None doc.format() assert doc.text == "\n".join([ "module module_function_call1", " type :: softmax", "", "contains", "", "procedure :: eval_1d", " end type softmax", "", "contains", "", " pure function eval_1d(self, x) result(res)", " class(softmax), intent(in) :: self", " real, intent(in) :: x(:)", " real :: res(size(x))", " end function eval_1d", "", "", " pure function eval_1d_prime(self, x) result(res)", " class(softmax), intent(in) :: self", " real, intent(in) :: x(:)", " real :: res(size(x))", " res = self%eval_1d(x)", " end function eval_1d_prime", "", "end module module_function_call1", "" ]) def test_partial_document_formatting(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent / "function_call1.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None doc.select(14, 5, 19, 31) doc.format_range() assert doc.text == "\n".join([ "module module_function_call1", " type :: softmax", " contains", " procedure :: eval_1d", " end type softmax", " contains", " ", " pure function eval_1d(self, x) result(res)", " class(softmax), intent(in) :: self", " real, intent(in) :: x(:)", " real :: res(size(x))", " end function eval_1d", " ", " pure function eval_1d_prime(self, x) result(res)", " class(softmax), intent(in) :: self", " real, intent(in) :: x(:)", " real :: res(size(x))", " res = self%eval_1d(x)", " end function eval_1d_prime", "", "end module module_function_call1", "" ]) def test_telemetry_event(client: LFortranLspTestClient) -> None: telemetry: JsonArray = client.get_telemetry() if not any(filter(lambda event: event["key"] == "processUsage", telemetry)): pytest.skip("ProcessUsage is not supported on this platform") lfortran-0.63.0/tests/server/src/0000775000175000017500000000000015174404631017057 5ustar alastairalastairlfortran-0.63.0/tests/server/src/lfortran_language_server/0000775000175000017500000000000015174404631024137 5ustar alastairalastairlfortran-0.63.0/tests/server/src/lfortran_language_server/__init__.py0000664000175000017500000000000015174404631026236 0ustar alastairalastairlfortran-0.63.0/tests/server/src/lfortran_language_server/lfortran_lsp_test_client.py0000664000175000017500000004161115174404631031616 0ustar alastairalastairfrom pathlib import Path from typing import Any, Dict, List, Optional, Sequence, Union from lsprotocol.types import ( CompletionClientCapabilities, CompletionClientCapabilitiesCompletionItemType, CompletionClientCapabilitiesCompletionItemTypeInsertTextModeSupportType, CompletionClientCapabilitiesCompletionItemTypeResolveSupportType, CompletionClientCapabilitiesCompletionItemTypeTagSupportType, CompletionItemTag, DefinitionClientCapabilities, DefinitionParams, DidChangeTextDocumentParams, DocumentFormattingClientCapabilities, DocumentHighlightClientCapabilities, DocumentRangeFormattingClientCapabilities, DocumentSymbolClientCapabilities, HoverClientCapabilities, InitializeParams, InsertTextMode, Location, LocationLink, MarkupKind, Position, RenameClientCapabilities, RenameParams, SemanticTokensClientCapabilities, SemanticTokensClientCapabilitiesRequestsType, TextDocumentCompletionResponse, TextDocumentContentChangeEvent, TextDocumentContentChangeEvent_Type1, TextDocumentContentChangeEvent_Type2, TextDocumentDefinitionRequest, TextDocumentDefinitionResponse, TextDocumentDocumentHighlightResponse, TextDocumentDocumentSymbolResponse, TextDocumentFormattingResponse, TextDocumentHoverResponse, TextDocumentIdentifier, TextDocumentPublishDiagnosticsNotification, TextDocumentRangeFormattingResponse, TextDocumentRenameRequest, TextDocumentRenameResponse, TextDocumentSemanticTokensFullResponse, TextDocumentSyncKind, TokenFormat, VersionedTextDocumentIdentifier, WorkspaceEdit) from llanguage_test_client.json_rpc import JsonArray, JsonObject from llanguage_test_client.lsp_test_client import LspTestClient from llanguage_test_client.lsp_text_document import LspTextDocument class LFortranLspTestClient(LspTestClient): def __init__( self, server_path: Path, server_params: List[str], workspace_path: Optional[Path], timeout_ms: float, config: Dict[str, Any], client_log_path: str, stdout_log_path: str, stdin_log_path: str ) -> None: super().__init__( server_path, server_params, workspace_path, timeout_ms, config, client_log_path, stdout_log_path, stdin_log_path ) def await_validation(self, uri: str, version: int) -> Any: def is_validation(message: Any) -> bool: if message.get("method", None) == "textDocument/publishDiagnostics": params = message["params"] return params["uri"] == uri \ and params.get("version", None) == version return False event, _ = self.find_incoming_event(lambda event: is_validation(event.data)) if event is not None: return event.data while not self.stop.is_set(): message = self.receive_message() if is_validation(message): return message return None def dispatch_method(self, message: JsonObject) -> None: match message["method"]: case "textDocument/publishDiagnostics": notification = self.converter.structure( message, TextDocumentPublishDiagnosticsNotification ) self.receive_text_document_publish_diagnostics(notification) self.respond_to_notification() case _: super().dispatch_method(message) def initialize_params(self) -> InitializeParams: params = super().initialize_params() text_document = params.capabilities.text_document if text_document is not None: text_document.completion = CompletionClientCapabilities( dynamic_registration=True, completion_item=CompletionClientCapabilitiesCompletionItemType( snippet_support=False, commit_characters_support=False, documentation_format=[ MarkupKind.PlainText, MarkupKind.Markdown, ], deprecated_support=True, preselect_support=False, tag_support=CompletionClientCapabilitiesCompletionItemTypeTagSupportType( value_set=[ CompletionItemTag.Deprecated, ], ), insert_replace_support=False, resolve_support=CompletionClientCapabilitiesCompletionItemTypeResolveSupportType( properties=[], ), insert_text_mode_support=CompletionClientCapabilitiesCompletionItemTypeInsertTextModeSupportType( value_set=[ InsertTextMode.AsIs, InsertTextMode.AdjustIndentation, ], ), label_details_support=True, ), context_support=True, ) text_document.hover = HoverClientCapabilities( content_format=[ MarkupKind.PlainText, MarkupKind.Markdown, ], ) text_document.definition = DefinitionClientCapabilities() text_document.rename = RenameClientCapabilities() text_document.document_highlight = DocumentHighlightClientCapabilities() text_document.document_symbol = DocumentSymbolClientCapabilities( hierarchical_document_symbol_support=True, ) text_document.semantic_tokens = SemanticTokensClientCapabilities( requests=SemanticTokensClientCapabilitiesRequestsType( full=True, ), token_types=[ "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator", ], token_modifiers=[ "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary", ], formats=[TokenFormat.Relative], ) text_document.formatting = DocumentFormattingClientCapabilities() text_document.range_formatting = DocumentRangeFormattingClientCapabilities() return params def receive_text_document_publish_diagnostics( self, notification: TextDocumentPublishDiagnosticsNotification ) -> None: pass def server_supports_text_document_definition(self) -> bool: # NOTE: This returns True if `definition_provider` is True or an instance # of `DefinitionOptions` return bool(self.server_capabilities.definition_provider) def send_text_document_definition(self, params: DefinitionParams) -> int: request_id = self.next_request_id() request = TextDocumentDefinitionRequest(request_id, params) self.send_request(request_id, request, self.receive_text_document_definition) return request_id def receive_text_document_definition( self, request: Any, message: JsonObject ) -> None: response = self.converter.structure( message, TextDocumentDefinitionResponse ) loc: Optional[Union[Location, LocationLink]] = None match response.result: case Location(): loc = response.result case _ if isinstance(response.result, Sequence) \ and not isinstance(response.result, str) \ and len(response.result) > 0: loc = response.result[0] doc: Optional[LspTextDocument] = None pos: Optional[Position] = None match loc: case Location(): doc = self.documents_by_uri.get(loc.uri, None) pos = loc.range.start case LocationLink(): doc = self.documents_by_uri.get(loc.target_uri, None) pos = loc.target_range.start if doc is not None and pos is not None: self.active_document = doc doc.cursor = (pos.line + 1, pos.character + 1) def goto_definition(self, uri: str, line: int, column: int) -> None: if self.server_supports_text_document_definition(): params = DefinitionParams( text_document=TextDocumentIdentifier( uri=uri, ), position=Position( line=line, character=column ), ) request_id = self.send_text_document_definition(params) self.await_response(request_id) def build_custom_request( self, method: str, request_id: int, params: Optional[Union[JsonObject, JsonArray]] = None ) -> JsonObject: request = { "jsonrpc": "2.0", "method": method, "id": request_id, } if params is not None: request["params"] = params return request def send_document(self, params: JsonObject) -> int: request_id = self.next_request_id() request = self.build_custom_request("$/document", request_id, params) self.send_request(request_id, request, self.receive_document) return request_id def receive_document( self, request: Any, message: JsonObject ) -> None: pass def get_remote_document(self, uri: str) -> JsonObject: request_id = self.send_document({ "uri": uri, }) response = self.await_response(request_id) return response["result"] def server_supports_text_document_rename(self) -> bool: return bool(self.server_capabilities.rename_provider) def send_text_document_rename(self, params: RenameParams) -> int: request_id = self.next_request_id() request = TextDocumentRenameRequest(request_id, params) self.send_request(request_id, request, self.receive_text_document_rename) return request_id def apply(self, workspace_edit: WorkspaceEdit) -> None: changes = workspace_edit.changes if changes is not None: for uri, text_edits in changes.items(): document = self.get_document("fortran", uri) document.apply(text_edits) if self.server_supports_text_document_did_change(): version = document.bump_version() content_changes: List[TextDocumentContentChangeEvent] if self.server_supports_text_document_sync_kind( TextDocumentSyncKind.Incremental ): content_changes = [ TextDocumentContentChangeEvent_Type1( range=text_edit.range, text=text_edit.new_text ) for text_edit in text_edits ] else: content_changes = [ TextDocumentContentChangeEvent_Type2( text=document.text ) ] params = DidChangeTextDocumentParams( text_document=VersionedTextDocumentIdentifier( version=version, uri=uri ), content_changes=content_changes ) self.send_text_document_did_change(params) document.signal_change() def receive_text_document_rename( self, request: Any, message: JsonObject ) -> None: response = self.converter.structure( message, TextDocumentRenameResponse ) if response.result is not None: self.apply(response.result) def rename(self, uri: str, line: int, column: int, new_name: str) -> None: if self.server_supports_text_document_rename(): params = RenameParams( text_document=TextDocumentIdentifier( uri=uri, ), position=Position( line=line, character=column, ), new_name=new_name, ) request_id = self.send_text_document_rename(params) self.await_response(request_id) def receive_text_document_document_highlight( self, request: Any, message: JsonObject ) -> None: response = self.converter.structure( message, TextDocumentDocumentHighlightResponse ) if response.result is not None: uri = request.params.text_document.uri doc = self.get_document("fortran", uri) doc.symbol_highlights = response.result def receive_text_document_hover( self, request: Any, message: JsonObject ) -> None: response = self.converter.structure( message, TextDocumentHoverResponse ) if response.result is not None: uri = request.params.text_document.uri doc = self.get_document("fortran", uri) doc.preview = response.result def receive_text_document_document_symbol( self, request: Any, message: JsonObject ) -> None: response = self.converter.structure( message, TextDocumentDocumentSymbolResponse ) uri = request.params.text_document.uri doc = self.get_document("fortran", uri) doc.symbols = response.result def receive_text_document_semantic_tokens_full( self, request: Any, message: JsonObject ) -> None: response = self.converter.structure( message, TextDocumentSemanticTokensFullResponse ) uri = request.params.text_document.uri doc = self.get_document("fortran", uri) doc.semantic_highlights = response.result def receive_text_document_completion( self, request: Any, message: JsonObject ) -> None: response = self.converter.structure( message, TextDocumentCompletionResponse ) uri = request.params.text_document.uri doc = self.get_document("fortran", uri) doc.completions = response.result def receive_text_document_formatting( self, request: Any, message: JsonObject ) -> None: response = self.converter.structure( message, TextDocumentFormattingResponse ) if response.result is not None: uri = request.params.text_document.uri doc = self.get_document("fortran", uri) doc.apply(response.result) def receive_text_document_range_formatting( self, request: Any, message: JsonObject ) -> None: response = self.converter.structure( message, TextDocumentRangeFormattingResponse ) if response.result is not None: uri = request.params.text_document.uri doc = self.get_document("fortran", uri) doc.apply(response.result) def send_telemetry(self) -> int: request_id = self.next_request_id() request = self.build_custom_request("$/telemetry", request_id) self.send_request(request_id, request, self.receive_telemetry) return request_id def receive_telemetry( self, request: Any, message: JsonObject ) -> None: pass def get_telemetry(self) -> Any: request_id = self.send_telemetry() response = self.await_response(request_id) return response["result"] lfortran-0.63.0/tests/server/function_call1.f900000664000175000017500000000000015174404631021477 0ustar alastairalastairlfortran-0.63.0/tests/server/README.md0000664000175000017500000000000015174404631017535 0ustar alastairalastairlfortran-0.63.0/tests/server/setup.py0000664000175000017500000000004515174404631020001 0ustar alastairalastairfrom setuptools import setup setup() lfortran-0.63.0/tests/expr1.f900000664000175000017500000000000215174404631016331 0ustar alastairalastair5 lfortran-0.63.0/tests/wasm_main_program.f900000664000175000017500000000100015174404631020773 0ustar alastairalastairprogram main implicit none integer :: pi, radius, area real :: pi2, radius2, area2 pi = 3 radius = 5 area = pi * sqr(radius) print *, area pi2 = 3.14 radius2 = 5.0 area2 = pi2 * radius2 * radius2 print *, area2 print *, "radius of the circle is", radius2, radius print *, "and its area is", area2, "cm^2" contains function sqr(x) result(r) integer, intent(in) :: x integer :: r r = x * x end function end program lfortran-0.63.0/tests/document_symbols1_module.f900000664000175000017500000000033215174404631022314 0ustar alastairalastairmodule module_document_symbols1 implicit none integer :: xy, yz contains subroutine sub() implicit none end subroutine subroutine sub2() implicit none end subroutine end module module_document_symbols1 lfortran-0.63.0/tests/lookup_name3.f900000664000175000017500000000032715174404631017700 0ustar alastairalastairMODULE lookup_name3_module REAL, ALLOCATABLE, DIMENSION(:,:,:) :: ec CONTAINS SUBROUTINE sn_expcoeff( ndimen ) INTEGER, INTENT(IN) :: ndimen ec(:,1,5) = 1.0 END SUBROUTINE sn_expcoeff END MODULE lookup_name3_module lfortran-0.63.0/tests/modules_04.f900000664000175000017500000000036215174404631017256 0ustar alastairalastairmodule access_vars implicit none private public print_vars real :: priv = 1.5 real, public :: publ = 2.5 contains subroutine print_vars() print *, "priv = ", priv print *, "publ = ", publ end subroutine print_vars end module access_vars lfortran-0.63.0/tests/fixedform_module.f0000664000175000017500000000015315174404631020460 0ustar alastairalastair MODULE E END MODULE E PROGRAM MAIN IMPLICIT NONE END PROGRAM MAIN lfortran-0.63.0/tests/array7.f900000664000175000017500000000021515174404631016505 0ustar alastairalastairprogram array7 IMPLICIT DOUBLE PRECISION (A-H,O-Z) IMPLICIT integer (I-N) integer, parameter :: n = 10 DIMENSION SJ(0:N),DJ(0:N) end program lfortran-0.63.0/tests/implicit_interface5.f900000664000175000017500000000015615174404631021223 0ustar alastairalastairsubroutine implicit_interface5(a, b, n) integer, intent(in) :: n, a(n), b(n) call driver(a, b) end subroutine lfortran-0.63.0/tests/fixed_form_interface.f0000664000175000017500000000310015174404631021265 0ustar alastairalastair program fixed_form_interface implicit none integer :: i, arr(5) integer :: OUTPUT_UNIT type :: element character(len=2) :: symbol integer :: atomic_number real :: atomic_mass integer :: quantity end type element type :: chemical_compound character(len=30) :: name character(len=10) :: formula real :: molecular_weight type(element), allocatable, dimension(:) :: elements end type c tests that 'interface' is tokenized correctly interface subroutine my_subroutine(a) integer, intent(in) :: a end subroutine my_subroutine function my_function(b) result(res) integer, intent(in) :: b integer :: res end function my_function end interface c tests that 'allocate' is tokenized correctly integer :: num = 2 integer, dimension(:), allocatable :: factors allocate ( factors(num) ) factors = [3, 4] c tests that 'deallocate' is tokenized correctly deallocate(factors) 1 FORMAT (TR1, A) print 1, factors do concurrent (i=1:10:2) arr(i) = i enddo c ensures that 'FLUSH' is tokenized FLUSH(OUTPUT_UNIT) contains end program fixed_form_interface lfortran-0.63.0/tests/fixed_form/0000775000175000017500000000000015174404631017104 5ustar alastairalastairlfortran-0.63.0/tests/fixed_form/crlf1.f0000664000175000017500000000005615174404631020263 0ustar alastairalastair PROGRAM p CALL f() END lfortran-0.63.0/tests/fixed_form/real8_1.f0000664000175000017500000000005015174404631020501 0ustar alastairalastair real*8 function f() end lfortran-0.63.0/tests/fixed_form/data1.f0000664000175000017500000000020215174404631020237 0ustar alastairalastair program test_data real(8) :: coef(10,1) DATA (coef(i,1),i=1,10)/1.0D0,2.0D0,3*3.0D0,5*4.0d0/ end program lfortran-0.63.0/tests/fixed_form/double_complex1.f0000664000175000017500000000012215174404631022330 0ustar alastairalastair program test_double_complex DOUBLE COMPLEX Y, ZWORK end program lfortran-0.63.0/tests/fixed_form/error_stop2.f0000664000175000017500000000013015174404631021525 0ustar alastairalastair subroutine f() if (.true.) then error stop end if end lfortran-0.63.0/tests/fixed_form/do1.f0000664000175000017500000000020015174404631017726 0ustar alastairalastair subroutine f() do 1 i=1,2 do 2 j=1,3 do 2 k=1,4 2 continue 1 continue end lfortran-0.63.0/tests/fixed_form/error_stop1.f0000664000175000017500000000006015174404631021526 0ustar alastairalastair subroutine f() error stop end lfortran-0.63.0/tests/fixed_form/else1.f0000664000175000017500000000072515174404631020270 0ustar alastairalastair subroutine fun1() IF (ABS(BJV0).GT.ABS(BJV1)) CS=BJV0/F ELSE CS=BJV1/F2 end subroutine subroutine fun2() if (.true.) then x = 1 IF (ABS(BJV0).GT.ABS(BJV1)) CS=BJV0/F ELSE CS=BJV1/F2 end if end subroutine subroutine fun3() if (.true.) then x = 1 IF (ABS(BJV0).GT.ABS(BJV1)) THEN CS=BJV0/F ELSE CS=BJV1/F2 END IF end if end subroutine lfortran-0.63.0/tests/fixed_form/block_data1.f0000664000175000017500000000004715174404631021420 0ustar alastairalastair block data block_data1 end lfortran-0.63.0/tests/fixed_form/call1.f0000664000175000017500000000030715174404631020247 0ustar alastairalastair program call1 integer callf call f() callf callf = 5 callf_s(3,2) callf_s(3,2) = 5 callf_s(3,2,f("(")) callf_s(3,2,f("(")) = 5 end program lfortran-0.63.0/tests/fixed_form/assign_to1.f0000664000175000017500000000010015174404631021311 0ustar alastairalastair program assign1 10 assign 10 to next end program lfortran-0.63.0/tests/fixed_form/include1.f0000664000175000017500000000015015174404631020753 0ustar alastairalastair include "do1.f" include "do2.f" program main call f() end program lfortran-0.63.0/tests/fixed_form/assign1.f0000664000175000017500000000010015174404631020607 0ustar alastairalastair program assign1 10 assign 30 to next end program lfortran-0.63.0/tests/fixed_form/auxiliary_IO_1.f0000664000175000017500000000030615174404631022070 0ustar alastairalastair subroutine xub (nunit) integer nunit integer i do, i=1, 5 backspace nunit rewind nunit end do end program main end programlfortran-0.63.0/tests/fixed_form/assign_to2.f0000664000175000017500000000021115174404631021315 0ustar alastairalastair program assign2 100 if (0<1) assign 101 to k go to k, (100,101) print *, "no" 101 print *, "yes" end program lfortran-0.63.0/tests/fixed_form/use1.f0000664000175000017500000000033515174404631020131 0ustar alastairalastair subroutine f() use iso_c_binding, only: c_loc, c_f_pointer print *, "OK" end integer function g() use iso_c_binding, only: c_loc, c_f_pointer print *, "OK" g = 5 end lfortran-0.63.0/tests/fixed_form/contains1.f0000664000175000017500000000452215174404631021155 0ustar alastairalastairC Program to show 23 ways Fortran uses the asterisk. Comments at ends of * lines mark uses of *, as here: ! Comment line, * character in it. (1,2) C This program is valid Fortran 2018, but its fixed source form, alternate C return, and declaration beginning character* are all obsolescent. Class(*) C was new in f2003, unlimited format in F2008, and type(*) and rank(*) in C F2018. List-directed internal read, use of lower case, and comments that C begin with ! are its only other features that were not valid Fortran 77. program test23stars character:: b,c,d='?' integer j,k,n(2) data j,k/2*0/ ! repeated value in data (3) call input(n,'2*4',b,c,d,666)! repeated value in list-directed input, C ! alternate return (4,5) write(*,'(2i2,1x,a)') n(1)*j, ! default output unit ! multiply (6,7) * n(2)**k,b ! continuation line ! exponentiate (8,9) stop 666 print '(a)', ' * error in n' ! in non-comment character string (10) print '(*(i4))', n ! unlimited format item (11) contains subroutine input(n,a,b,c,d,r) ! dummy alternate return argument (12) integer,intent(out)::n(*) ! assumed-size array (13) character,intent(in)::a*(*) ! length selector ! assumed length C following variable name (14,15) character*(*),intent(out)::b ! length selector ! assumed length C following character keyword (16,17) type(*),intent(in)::c ! assumed-type (18) character(1),intent(in)::d(..) integer i character ch class(*),allocatable:: e(:) ! polymorphic entity (19) select rank (d) rank(*) ! rank selector (20) print "(a)",'This should not be printed!' end select read(a,*,iostat=i) n(1),n(2) ! list-directed internal read (21) if (i.ne.0) return 1 print '(a)', 'Enter anything to continue.' read(*,'(a)',iostat=i)ch ! default input unit (22) write(b,'(i1)',iostat=i)666 ! writes '*' as 666 won't fit in i1 (23) end subroutine input end program test23stars lfortran-0.63.0/tests/fixed_form/while_02_fixed_form.f0000664000175000017500000000124115174404631023064 0ustar alastairalastair program while_02 implicit none integer :: i, j i = 0 j = 0 do while (i < 10) i = i + 1 j = j + i end do if (j /= 55) error stop if (i /= 10) error stop i = 0 j = 0 do while (i < 10) i = i + 1 if (i == 2) exit j = j + i end do if (j /= 1) error stop if (i /= 2) error stop i = 0 j = 0 do while (i < 10) i = i + 1 if (i == 2) cycle j = j + i end do if (j /= 53) error stop if (i /= 10) error stop end lfortran-0.63.0/tests/fixed_form/assign_to3.f0000664000175000017500000000036615174404631021331 0ustar alastairalastair program assign3 10 assign 30 to next 20 GO TO next,(30, 50, 70, 110) assign 50 to next assign 70 to next assign 110 to next 30 print *, 30 50 print *, 50 70 print *, 70 110 print *, 110 end program lfortran-0.63.0/tests/fixed_form/end_label.f0000664000175000017500000000030315174404631021154 0ustar alastairalastair subroutine f() go to 1 1 end integer function h() h = 0 go to 1 1 end subroutine g() if (.true.) then go to 1 1 end if end lfortran-0.63.0/tests/fixed_form/do2.f0000664000175000017500000000011515174404631017734 0ustar alastairalastair subroutine g() do i=1,2 go to 1 1 end do end lfortran-0.63.0/tests/real_to_complex_cast_in_comparison.f900000664000175000017500000000053415174404631024412 0ustar alastairalastairprogram expr2 implicit none integer, parameter :: dp = kind(0.d0) real(dp) :: zero zero = 0.0_dp contains elemental complex(dp) function dabs(x) result(r) complex(dp), intent(in) :: x if (x /= zero) then r = x else r = 0 - x end if end function dabs end program lfortran-0.63.0/tests/derived_types_02.f900000664000175000017500000000217715174404631020460 0ustar alastairalastairmodule a implicit none integer, parameter :: r8 = kind(0.d0) type :: B end type type C endtype type, extends(B), public :: X private real(r8) :: r1 type(C), pointer :: cc => null() real(r8), pointer :: r2(:) => null(), r3(:) => null() contains private procedure, private :: p1 procedure(something), private :: p1b procedure, pass(self) :: p2 procedure :: proc_1, proc_2 generic :: operator(/=) => p5, p6 generic :: operator(+) => p8 generic :: operator(.in.) => p7 generic :: operator(.dot.) => p10 generic :: operator(/) => p11 generic :: assignment(=) => p9 generic, public :: calcCoeffs => calcCoeffsReal, calcCoeffsKPoint generic, private :: name => sample generic :: p1 => p2; generic, public :: write(formatted) => t_write generic :: read(unformatted) => t_read final :: y end type X type matrix(k, b) integer, kind :: k = 4 integer(8), len :: b real(k) :: element(b, b) endtype matrix contains subroutine p1(this) class(X), intent(out) :: this end subroutine subroutine p2(this) class(X), intent(inout) :: this end subroutine end module lfortran-0.63.0/tests/modules4.f900000664000175000017500000000026215174404631017036 0ustar alastairalastairmodule tomlf_type use tomlf_type_array, only : toml_array, new_array, new use tomlf_type_keyval, only : toml_keyval, new_keyval, new implicit none end module tomlf_type lfortran-0.63.0/tests/write2.f900000664000175000017500000000021115174404631016510 0ustar alastairalastairprogram write2 implicit none integer :: i write(unit=*, fmt='(a)', advance='no') "Some text: " read *, i print *, "Got: ", i end program lfortran-0.63.0/tests/preprocessor3b.h0000664000175000017500000000003315174404631020102 0ustar alastairalastair#include "preprocessor3.h" lfortran-0.63.0/tests/polymorphic_class_in_derived_type.f900000664000175000017500000000026715174404631024272 0ustar alastairalastairmodule fortuno_types implicit none type :: dict_item class(*), allocatable :: value class(*), allocatable :: value2 end type dict_item end module fortuno_types lfortran-0.63.0/tests/implied_do_loop2.f900000664000175000017500000000022015174404631020514 0ustar alastairalastairprogram implied_do_loop2 implicit none character(len=5) :: s = "Hello" integer :: i print *, (s, i = 1, 3) end program implied_do_loop2 lfortran-0.63.0/tests/dependency_test_01.f900000664000175000017500000000266415174404631020767 0ustar alastairalastairmodule fpm_dependency implicit none private type :: dependency_config_t character(len=:), allocatable :: name character(len=:), allocatable :: path end type dependency_config_t type :: dependency_node_t character(len=:), allocatable :: proj_dir character(len=:), allocatable :: revision logical :: done = .false. logical :: update = .false. end type dependency_node_t type :: dependency_tree_t integer :: unit integer :: verbosity = 1 character(len=:), allocatable :: dep_dir integer :: ndep = 0 type(dependency_node_t), allocatable :: dep(:) character(len=:), allocatable :: cache contains generic :: add => add_dependency procedure, private :: add_dependency generic :: find => find_dependency procedure, private :: find_dependency end type dependency_tree_t contains pure subroutine add_dependency(self, dependency) class(dependency_tree_t), intent(inout) :: self type(dependency_config_t), intent(in) :: dependency integer :: id id = self%find(dependency) end subroutine add_dependency pure function find_dependency(self, dependency) result(pos) class(dependency_tree_t), intent(in) :: self class(dependency_config_t), intent(in) :: dependency integer :: pos end function find_dependency end module fpm_dependency lfortran-0.63.0/tests/where1.f900000664000175000017500000000104115174404631016471 0ustar alastairalastairprogram test implicit none integer :: x(2, 2) = reshape([1, 2, & 3, 4], [2, 2]) where(x == 1) x = 2 else where(x == 2) x = 3 else where x = x * 2 endwhere if (all(x == reshape([2, 3, & 6, 8], [2, 2]))) then print *, 'pass' else print *, 'fail' end if where(x == 2) x = 3 elsewhere(x == 3) x = 4 elsewhere(x == 6) x = x * 2 end where if (all(x == reshape([3, 4, & 12, 8], [2, 2]))) then print *, 'pass' else print *, 'fail' end if end program testlfortran-0.63.0/tests/function_call1.f900000664000175000017500000000103615174404631020203 0ustar alastairalastairmodule module_function_call1 type :: softmax contains procedure :: eval_1d end type softmax contains pure function eval_1d(self, x) result(res) class(softmax), intent(in) :: self real, intent(in) :: x(:) real :: res(size(x)) end function eval_1d pure function eval_1d_prime(self, x) result(res) class(softmax), intent(in) :: self real, intent(in) :: x(:) real :: res(size(x)) res = self%eval_1d(x) end function eval_1d_prime end module module_function_call1 lfortran-0.63.0/tests/save4.f900000664000175000017500000000042115174404631016321 0ustar alastairalastairprogram save4 implicit none integer :: y = 1 if (y .eq. 1) then print *, "y is 1" end if contains subroutine f() integer :: x = 5 if (x .eq. 1) then print *, "x is 1" end if end subroutine end program lfortran-0.63.0/tests/program4.f900000664000175000017500000000124215174404631017034 0ustar alastairalastairprogram program4 real :: x, y, z x = 1.0 y = 2.0 z = func1(x, y) print *, "6.0 == ", z z = func1(x, y) print *, "7.0 == ", z z = func2(x, y) print *, "6.0 == ", z z = func2(x, y) print *, "8.0 == ", z contains function func1(a, b) result(c) real, intent(in) :: a, b real :: c real, save :: saved = 2.0 saved = saved + 1.0 c = c + a + b + saved end function func1 function func2(a, b) result(c) real, intent(in) :: a, b real :: c real :: saved1 = 2.0 real, save :: saved2 real :: d saved1 = saved1 + 1.0 c = d + c + a + b + saved1 + saved2 saved2 = saved2 + 1.0 d = d + 3.0 end function func2 end program program4lfortran-0.63.0/tests/fn1.f900000664000175000017500000000035115174404631015765 0ustar alastairalastairinteger function a() end function real function b() end function logical function c() end function integer function d() result(r) end function real function e() result(r) end function logical function f() result(r) end function lfortran-0.63.0/tests/array13.f900000664000175000017500000000014515174404631016564 0ustar alastairalastairprogram array13 implicit none integer, dimension(5) :: numbers = [5, 4, 2, 1, 3] end program lfortran-0.63.0/tests/preprocessor13.f900000664000175000017500000001520415174404631020176 0ustar alastairalastair#if defined(__GFORTRAN__) print *, "1 GFortran" #elif defined(__LFORTRAN__) print *, "1 LFortran" #else print *, "1 Other" #endif #if defined(__GFORTRAN__) print *, "2 GFortran" #elif defined(__LFORTRAN__) print *, "2 LFortran 1" #elif defined(__LFORTRAN__) print *, "2 LFortran 2" #else print *, "2 Other" #endif #if defined(__GFORTRAN__) print *, "3 GFortran 1" #elif defined(__GFORTRAN__) print *, "3 GFortran 2" #elif defined(__LFORTRAN__) print *, "3 LFortran 1" #elif defined(__LFORTRAN__) print *, "3 LFortran 2" #else print *, "3 Other" #endif #if defined(__GFORTRAN__) print *, "4 GFortran 1" #elif defined(__GFORTRAN__) print *, "4 GFortran 2" # if defined(__GFORTRAN__) print *, "41 GFortran 1" # elif defined(__GFORTRAN__) print *, "41 GFortran 2" # elif defined(__LFORTRAN__) print *, "41 LFortran 1" # elif defined(__LFORTRAN__) print *, "41 LFortran 2" # else print *, "41 Other" # endif #elif defined(__LFORTRAN__) print *, "4 LFortran 1" # if defined(__GFORTRAN__) print *, "42 GFortran 1" # elif defined(__GFORTRAN__) print *, "42 GFortran 2" # elif defined(__LFORTRAN__) print *, "42 LFortran 1" # elif defined(__LFORTRAN__) print *, "42 LFortran 2" # else print *, "42 Other" # endif #elif defined(__LFORTRAN__) print *, "4 LFortran 2" # if defined(__GFORTRAN__) print *, "43 GFortran 1" # elif defined(__GFORTRAN__) print *, "43 GFortran 2" # elif defined(__LFORTRAN__) print *, "43 LFortran 1" # elif defined(__LFORTRAN__) print *, "43 LFortran 2" # else print *, "43 Other" # endif #else print *, "4 Other" # if defined(__GFORTRAN__) print *, "44 GFortran 1" # elif defined(__GFORTRAN__) print *, "44 GFortran 2" # elif defined(__LFORTRAN__) print *, "44 LFortran 1" # elif defined(__LFORTRAN__) print *, "44 LFortran 2" # else print *, "44 Other" # endif #endif #define X 1 #define Y 1 #if X == 1 print *, "X is 1" # if Y == 1 print *, "1 Y is 1" # elif Y == 2 print *, "1 Y is 2" # elif Y == 3 print *, "1 Y is 3" # elif Y == 4 print *, "1 Y is 4" # else print *, "1 Y is not 1-4" # endif #elif X == 2 print *, "X is 2" # if Y == 1 print *, "2 Y is 1" # elif Y == 2 print *, "2 Y is 2" # elif Y == 3 print *, "2 Y is 3" # elif Y == 4 print *, "2 Y is 4" # else print *, "2 Y is not 1-4" # endif #elif X == 3 print *, "X is 3" # if Y == 1 print *, "3 Y is 1" # elif Y == 2 print *, "3 Y is 2" # elif Y == 3 print *, "3 Y is 3" # elif Y == 4 print *, "3 Y is 4" # else print *, "3 Y is not 1-4" # endif #elif X == 4 print *, "X is 4" # if Y == 1 print *, "4 Y is 1" # elif Y == 2 print *, "4 Y is 2" # elif Y == 3 print *, "4 Y is 3" # elif Y == 4 print *, "4 Y is 4" # else print *, "4 Y is not 1-4" # endif #else print *, "X is not 1-4" # if Y == 1 print *, "5 Y is 1" # elif Y == 2 print *, "5 Y is 2" # elif Y == 3 print *, "5 Y is 3" # elif Y == 4 print *, "5 Y is 4" # else print *, "5 Y is not 1-4" # endif #endif #define X 2 #define Y 3 #if X == 1 print *, "X is 1" # if Y == 1 print *, "1 Y is 1" # elif Y == 2 print *, "1 Y is 2" # elif Y == 3 print *, "1 Y is 3" # elif Y == 4 print *, "1 Y is 4" # else print *, "1 Y is not 1-4" # endif #elif X == 2 print *, "X is 2" # if Y == 1 print *, "2 Y is 1" # elif Y == 2 print *, "2 Y is 2" # elif Y == 3 print *, "2 Y is 3" # elif Y == 4 print *, "2 Y is 4" # else print *, "2 Y is not 1-4" # endif #elif X == 3 print *, "X is 3" # if Y == 1 print *, "3 Y is 1" # elif Y == 2 print *, "3 Y is 2" # elif Y == 3 print *, "3 Y is 3" # elif Y == 4 print *, "3 Y is 4" # else print *, "3 Y is not 1-4" # endif #elif X == 4 print *, "X is 4" # if Y == 1 print *, "4 Y is 1" # elif Y == 2 print *, "4 Y is 2" # elif Y == 3 print *, "4 Y is 3" # elif Y == 4 print *, "4 Y is 4" # else print *, "4 Y is not 1-4" # endif #else print *, "X is not 1-4" # if Y == 1 print *, "5 Y is 1" # elif Y == 2 print *, "5 Y is 2" # elif Y == 3 print *, "5 Y is 3" # elif Y == 4 print *, "5 Y is 4" # else print *, "5 Y is not 1-4" # endif #endif #define X 4 #define Y 4 #if X == 1 print *, "X is 1" # if Y == 1 print *, "1 Y is 1" # elif Y == 2 print *, "1 Y is 2" # elif Y == 3 print *, "1 Y is 3" # elif Y == 4 print *, "1 Y is 4" # else print *, "1 Y is not 1-4" # endif #elif X == 2 print *, "X is 2" # if Y == 1 print *, "2 Y is 1" # elif Y == 2 print *, "2 Y is 2" # elif Y == 3 print *, "2 Y is 3" # elif Y == 4 print *, "2 Y is 4" # else print *, "2 Y is not 1-4" # endif #elif X == 3 print *, "X is 3" # if Y == 1 print *, "3 Y is 1" # elif Y == 2 print *, "3 Y is 2" # elif Y == 3 print *, "3 Y is 3" # elif Y == 4 print *, "3 Y is 4" # else print *, "3 Y is not 1-4" # endif #elif X == 4 print *, "X is 4" # if Y == 1 print *, "4 Y is 1" # elif Y == 2 print *, "4 Y is 2" # elif Y == 3 print *, "4 Y is 3" # elif Y == 4 print *, "4 Y is 4" # else print *, "4 Y is not 1-4" # endif #else print *, "X is not 1-4" # if Y == 1 print *, "5 Y is 1" # elif Y == 2 print *, "5 Y is 2" # elif Y == 3 print *, "5 Y is 3" # elif Y == 4 print *, "5 Y is 4" # else print *, "5 Y is not 1-4" # endif #endif #define X 5 #define Y 5 #if X == 1 print *, "X is 1" # if Y == 1 print *, "1 Y is 1" # elif Y == 2 print *, "1 Y is 2" # elif Y == 3 print *, "1 Y is 3" # elif Y == 4 print *, "1 Y is 4" # else print *, "1 Y is not 1-4" # endif #elif X == 2 print *, "X is 2" # if Y == 1 print *, "2 Y is 1" # elif Y == 2 print *, "2 Y is 2" # elif Y == 3 print *, "2 Y is 3" # elif Y == 4 print *, "2 Y is 4" # else print *, "2 Y is not 1-4" # endif #elif X == 3 print *, "X is 3" # if Y == 1 print *, "3 Y is 1" # elif Y == 2 print *, "3 Y is 2" # elif Y == 3 print *, "3 Y is 3" # elif Y == 4 print *, "3 Y is 4" # else print *, "3 Y is not 1-4" # endif #elif X == 4 print *, "X is 4" # if Y == 1 print *, "4 Y is 1" # elif Y == 2 print *, "4 Y is 2" # elif Y == 3 print *, "4 Y is 3" # elif Y == 4 print *, "4 Y is 4" # else print *, "4 Y is not 1-4" # endif #else print *, "X is not 1-4" # if Y == 1 print *, "5 Y is 1" # elif Y == 2 print *, "5 Y is 2" # elif Y == 3 print *, "5 Y is 3" # elif Y == 4 print *, "5 Y is 4" # else print *, "5 Y is not 1-4" # endif #endif end lfortran-0.63.0/tests/print4.f900000664000175000017500000000245615174404631016531 0ustar alastairalastair! Try lots of different print statements program print_07 integer(8) :: ii1 integer :: ii2 integer :: ii3 real(8) :: rr real(4) :: rr2 logical :: ll logical :: ll_arr(10) integer,allocatable :: arr(:) integer, allocatable :: aarr(:) character :: arr2(10) integer(8) :: arr23(10) character(:), allocatable :: str character(10) :: str2 character(5) :: ssss(10) complex :: cc allocate(aarr(10)) allocate(arr(10)) ssss = "medoo" ii1 = 20000000000000000_8 ii2 = 22 ii3 = 33 rr = 10.3_8 rr2 = 10.3 ll = .false. arr = 1 arr(1) = 33 arr2 = 's' print *, ii1, ii2, ii3, ll str = "HelloLFortran" str2 = "HelloLCompilers" arr23 = 1 cc = complex(2,3) ll_arr = .true. ll_arr(10) = .false. aarr = 1 print *,aarr print *, cc print *, arr23 print "(a,2x,a,3x,a)", str, str, str print "(a,2x,a,3x,a)", str2 print "(i0)", ii1 ,ii1, ii1 print *,str print *, str,str print "(A3)", ssss print *, ii2 print *, rr print *, ll_arr print *, rr2 print *, ll print *, 232 print *, "string", "string" PRINT "(I0, 2X , I0)", arr23 print *,arr23 print *, arr print *, "here" print *, str, str print "(l)", ll end programlfortran-0.63.0/tests/collect_occurence1.f900000664000175000017500000000027115174404631021036 0ustar alastairalastairsubroutine sub() integer :: abc print *, abc abc = 12 print *, abc+9 end subroutine program collection_occurence1 integer :: abc = 15 abc = abc - 9 print *, abc call sub() end program lfortran-0.63.0/tests/issue532.f900000664000175000017500000000050715174404631016666 0ustar alastairalastair! This is a test for https://gitlab.com/lfortran/lfortran/-/issues/532 module issue532_mod contains integer function sfloor(x) result(r) real, intent(in) :: x r = x end function integer function imodulo(x, y) result(r) integer, intent(in) :: x, y r = sfloor(real(x))*y end function end module program issue532 end program lfortran-0.63.0/tests/fn6.f900000664000175000017500000000513715174404631016001 0ustar alastairalastair! module fn6 ! interface str ! module procedure msg_scalar ! end interface str ! contains ! function msg_scalar(generic0, generic1, generic2, generic3, & ! & generica, genericb, genericc, genericd, & ! & sep) ! implicit none ! class(*), intent(in), optional :: generic0, generic1, generic2, generic3 ! class(*), intent(in), optional :: generica, genericb, genericc, genericd ! character(len=*), intent(in), optional :: sep ! character(len=:), allocatable :: sep_local ! character(len=:), allocatable :: msg_scalar ! character(len=4096) :: line ! integer :: istart ! integer :: increment ! if( present(sep) ) then ! sep_local = sep ! increment = len(sep_local)+1 ! else ! sep_local = ' ' ! increment = 2 ! end if ! istart = 1 ! line = '' ! if(present(generic0))call print_generic(generic0) ! if(present(generic1))call print_generic(generic1) ! if(present(generic2))call print_generic(generic2) ! if(present(generic3))call print_generic(generic3) ! if(present(generica))call print_generic(generica) ! if(present(genericb))call print_generic(genericb) ! if(present(genericc))call print_generic(genericc) ! if(present(genericd))call print_generic(genericd) ! msg_scalar = trim(line) ! contains ! subroutine print_generic(generic) ! class(*), intent(in) :: generic ! select type(generic) ! type is (integer(kind=1)); write(line(istart:),'(i0)') generic ! type is (integer(kind=2)); write(line(istart:),'(i0)') generic ! type is (integer(kind=4)); write(line(istart:),'(i0)') generic ! type is (integer(kind=8)); write(line(istart:),'(i0)') generic ! type is (real(kind=4)); write(line(istart:),'(1pg0)') generic ! type is (real(kind=8)) ! write(line(istart:), '(1pg0)') generic ! type is (logical) ! write(line(istart:), '(l1)') generic ! type is (character(len=*)) ! write(line(istart:), '(a)') trim(generic) ! type is (complex); write(line(istart:), '("(",1pg0,",",1pg0,")")') generic ! end select ! istart = len_trim(line)+increment ! line = trim(line)//sep_local ! end subroutine print_generic ! end function msg_scalar ! subroutine journal(where, g0, g1, g2, g3, ga, gb, gc, gd, sep) ! implicit none ! character(len=*), intent(in) :: where ! class(*), intent(in) :: g0 ! class(*), intent(in), optional :: g1, g2, g3 ! class(*), intent(in), optional :: ga, gb, gc, gd ! character(len=*), intent(in), optional :: sep ! write(*,'(a)') str(g0, g1, g2, g3, ga, gb, gc, gd, sep) ! end subroutine journal ! end module fn6 lfortran-0.63.0/tests/lookup_name2.f900000664000175000017500000000012315174404631017671 0ustar alastairalastairprogram lookup_name1 implicit none integer :: x x = (2+3)*5 print *, x end program lfortran-0.63.0/tests/comments1.f900000664000175000017500000000025415174404631017211 0ustar alastairalastairprogram comments1 ! Next line comment 0 print *, "1" ! end of line comment 1 ! Next line comment 1 print *, "2" ! end of line comment 2 ! Next line comment 2 end program lfortran-0.63.0/tests/modules_05.f900000664000175000017500000000044115174404631017255 0ustar alastairalastairmodule access_vars implicit none private public publ real :: priv = 1.5 real :: publ = 2.5 contains integer function print_vars(a, b) real, intent(in) :: a real, intent(in) :: b print *, "priv = ", a print *, "publ = ", b print_vars = 1 end function print_vars end module access_vars lfortran-0.63.0/tests/optional_02.f900000664000175000017500000000045015174404631017427 0ustar alastairalastairmodule optional_02_m contains function f1(x) result(r) integer, optional, intent(in) :: x integer, allocatable :: r r = 0 end function f1 end module program optional_02 use optional_02_m integer, allocatable :: i i = 10 print *, f1(i) end program lfortran-0.63.0/tests/coarrays_02.f900000664000175000017500000000212215174404631017423 0ustar alastairalastairprogram coarrays_02 ! Source https://j3-fortran.org/doc/year/18/18-007r1.pdf Page no - 541 use, intrinsic :: iso_fortran_env integer, allocatable :: node (:) ! tree nodes that this image handles. integer, allocatable :: nc (:) ! node(i) has nc(i) children. integer, allocatable :: parent (:), sub (:) ! the parent of node (i) is node (sub (i)) [parent (i)]. type (event_type), allocatable :: done (:) [:] integer :: i, j, status ! set up the tree, including allocation of all arrays. do i = 1, size (node) ! wait for children to complete if (nc (i) > 0) then event wait (done (i), until_count=nc (i), stat=status) if (status/=0) exit end if ! process node, using data from children. if (parent (i)>0) then ! node is not the root. ! place result on image parent (i) for node node (sub) [parent (i)] ! tell parent (i) that this has been done. event post (done (sub (i)) [parent (i)], stat=status) if (status/=0) exit end if end do end program lfortran-0.63.0/tests/subroutine5.f900000664000175000017500000000014115174404631017562 0ustar alastairalastairsubroutine add(a, b, c) real, intent(in) :: a, b real, intent(out) :: c c = a + b end subroutine lfortran-0.63.0/tests/implicit6.f900000664000175000017500000000017315174404631017203 0ustar alastairalastairinteger function CH12N(N,Z) IMPLICIT DOUBLE PRECISION (A,B,D-H,O-Y) IMPLICIT COMPLEX*16 (C,Z) CI=(0.0D0,1.0D0) end functionlfortran-0.63.0/tests/preprocessor22.f900000664000175000017500000000135315174404631020176 0ustar alastairalastair! this test program is almost the same as ! tests/preprocessor21.f90, except it defines ! value of some of the variables by using `#define` program preprocessor22 #define VAR1 1 #define VAR2 3 #if (!defined(VAR1) | !defined(VAR2)) print *, "Atleast one of VAR1 and VAR2 isn't defined" #else print *, 'Both VAR1 and VAR2 are defined.' #endif #define VAR3 4 #if (!defined(VAR3) & !defined(VAR4)) print *, "Neither of VAR3 or VAR4 is defined" #else print *, "At least one of VAR3 or VAR4 is defined." #endif #define VAR5 6 #if (!defined(VAR5) ^ !defined(VAR6)) print *, "Exactly one of VAR5 or VAR6 is not defined." #else print *, "Both VAR5 and VAR6 are defined or neither is defined." #endif end program preprocessor22 lfortran-0.63.0/tests/pragma2.f900000664000175000017500000000011115174404631016624 0ustar alastairalastairprogram pragma2 !LF$ attributes simd :: A real :: A(8) A = 1 end program lfortran-0.63.0/tests/array3.f900000664000175000017500000000014715174404631016505 0ustar alastairalastairprogram array3 implicit none real, dimension(3) :: a, b a = [1, 2, 3] b = (/ 1, 2, 3 /) end program lfortran-0.63.0/tests/close1.f900000664000175000017500000000024215174404631016466 0ustar alastairalastairprogram close1 ! Tests for syntax (AST) only: close(u) close (unit=gmv_lun) close(unit=dxf % dunit, status='delete') CLOSE( UNIT=funit, IOSTAT=ierr ) end program lfortran-0.63.0/tests/dimension_attr.f0000664000175000017500000000044115174404631020147 0ustar alastairalastair subroutine f(a) integer a print *, a end subroutine c this is a test comment program main integer , dimension (3,3) :: z integer a, b dimension a(2,2), b(10,10) integer, dimension(2,2) :: d call f(1) end lfortran-0.63.0/tests/infer_mode_smoke_01.f900000664000175000017500000000007415174404631021110 0ustar alastairalastairprogram infer_mode_smoke_01 end program infer_mode_smoke_01 lfortran-0.63.0/tests/fn5.f900000664000175000017500000000211315174404631015767 0ustar alastairalastairmodule fn5 implicit none contains function atleast(line, length, pattern) result(strout) character(len=*), intent(in) :: line integer, intent(in) :: length character(len=*), intent(in), optional :: pattern character(len=max(length, len(trim(line)))) :: strout if(present(pattern)) then strout = line//repeat(pattern, len(strout)/len(pattern)+1) else strout = line end if end function atleast subroutine print_dictionary(header,stop) character(len=:), allocatable, save :: keywords(:) character(len=:), allocatable, save :: shorts(:) character(len=:), allocatable, save :: values(:) logical, allocatable, save :: present_in(:) character(len=*), intent(in), optional :: header logical, intent(in), optional :: stop integer :: i write(*,'(a,1x,a,1x,a,1x,a)') atleast('KEYWORD',max(len(keywords),8)),'SHORT','PRESENT','VALUE' write(*,'(*(a,1x,a5,1x,l1,8x,"[",a,"]",/))') & & (atleast(keywords(i), max(len(keywords), 8)), shorts(i), present_in(i), values(i)(:), i=1, size(keywords)) end subroutine print_dictionary end module fn5 lfortran-0.63.0/tests/char1.f900000664000175000017500000000012715174404631016300 0ustar alastairalastairprogram char1 character(len=1, kind=1), parameter :: c_null_char = char(0) end program lfortran-0.63.0/tests/fixed_form_decls.f0000664000175000017500000000023415174404631020424 0ustar alastairalastair include 'stdmap.f' integer a integer b complex aaaaaaaaaaaaaaaaaaaaaaaaaaaaa logical*1 iiiiiiiii goto1000 end lfortran-0.63.0/tests/modules4_module.f900000664000175000017500000000143715174404631020410 0ustar alastairalastairmodule tomlf_type_keyval implicit none type, abstract :: toml_value character(len=:), allocatable :: key contains procedure(destroy), deferred :: destroy end type toml_value type, extends(toml_value) :: toml_keyval character(len=:), allocatable :: raw contains procedure :: destroy end type toml_keyval interface new module procedure :: new_keyval end interface contains subroutine new_keyval(self) type(toml_keyval), intent(out) :: self end subroutine new_keyval subroutine destroy(self) class(toml_keyval), intent(inout) :: self if (allocated(self%key)) then deallocate(self%key) end if if (allocated(self%raw)) then deallocate(self%raw) end if end subroutine destroy end module tomlf_type_keyval lfortran-0.63.0/tests/interface4.f900000664000175000017500000000154415174404631017332 0ustar alastairalastairMODULE DOT ! Module for dot product of two real arrays of rank 1. ! The caller needs to ensure that exceptions do not cause halting. ! Source https://j3-fortran.org/doc/year/18/18-007r1.pdf USE, INTRINSIC :: IEEE_EXCEPTIONS LOGICAL :: MATRIX_ERROR = .FALSE. INTERFACE OPERATOR(.dot.) MODULE PROCEDURE MULT END INTERFACE CONTAINS REAL FUNCTION MULT (A, B) REAL, INTENT (IN) :: A(:), B(:) INTEGER I LOGICAL OVERFLOW IF (SIZE(A) /= SIZE(B)) THEN MATRIX_ERROR = .TRUE. RETURN END IF ! The processor ensures that IEEE_OVERFLOW is quiet. MULT = 0.0 DO I = 1, SIZE (A) MULT = MULT + A(I)*B(I) END DO CALL IEEE_GET_FLAG (IEEE_OVERFLOW, OVERFLOW) IF (OVERFLOW) MATRIX_ERROR = .TRUE. END FUNCTION MULT END MODULE DOT lfortran-0.63.0/tests/openmp1.f900000664000175000017500000000071215174404631016661 0ustar alastairalastairsubroutine increment_ctr(n, ctr) ! use omp_lib implicit none integer, intent(in) :: n integer, intent(inout) :: ctr integer :: local_ctr integer :: i !$omp parallel private(i) reduction(+:local_ctr) !$omp do do i = 1, n local_ctr = local_ctr + 1 end do !$omp end do !$omp end parallel ctr = ctr + local_ctr end subroutine program openmp1 integer, parameter :: n = 1000000 integer :: ctr ctr = 0 call increment_ctr(n, ctr) print *, ctr end program lfortran-0.63.0/tests/implicit10.f900000664000175000017500000000050015174404631017250 0ustar alastairalastairinteger function a() implicit none integer :: b, c real :: d, e, f integer :: d1, e1, f1 real*8 :: g, h, i complex :: j, k complex*8 :: l, m complex *16 :: n double precision :: o, p integer :: Y(e1) real :: X(d1, e1, f1) Y(1) = 3 X(1, 1, 1) = 3 a = 1 b = 2 d = 3 f = 4 h = 5 i = 6 l = 7 m = 8 o = 9 p = 10 end function lfortran-0.63.0/tests/subroutine7.f900000664000175000017500000000015715174404631017573 0ustar alastairalastairsubroutine f(a, b) integer, intent(inout) :: a integer, intent(in out) :: b a = b + 1 b = a + 1 end subroutine lfortran-0.63.0/tests/format5.f900000664000175000017500000000051715174404631016662 0ustar alastairalastairprogram format5 print "(1PE24.16E3)", -8.431309591172336803666098603571299463510513305E-01_8 print "(1PE24.16E3)", -0.8431309591172336803666098603571299463510513305E-01_8 print "(1PE24.16E3)", -8.431309591172336803666098603571299463510513305E+01_8 print "(2PE23.15)", 1.E-3 print "(1PE23.15)", 1.234567890123456d-3 end program format5 lfortran-0.63.0/tests/derived_types_07.f900000664000175000017500000000453615174404631020466 0ustar alastairalastairmodule tomlf_type_value implicit none type, abstract :: toml_value character(len=:), allocatable :: key contains procedure(destroy), deferred :: destroy procedure :: match_key end type toml_value abstract interface subroutine destroy(self) import toml_value class(toml_value), intent(inout) :: self end subroutine destroy end interface contains pure function match_key(self, key) result(match) class(toml_value), intent(in) :: self character(len=*), intent(in) :: key logical :: match if (allocated(self%key)) then match = key == self%key else match = .false. end if end function match_key end module module tomlf_type_keyval use tomlf_type_value, only : toml_value implicit none type, extends(toml_value) :: toml_keyval character(len=:), allocatable :: raw contains procedure :: destroy end type toml_keyval contains subroutine destroy(self) class(toml_keyval), intent(inout) :: self if (allocated(self%key)) then deallocate(self%key) end if if (allocated(self%raw)) then deallocate(self%raw) end if end subroutine destroy end module tomlf_type_keyval module tomlf_structure_vector use tomlf_type_value, only : toml_value implicit none type :: toml_node class(toml_value), allocatable :: val end type toml_node type :: toml_vector integer :: n = 0 type(toml_node), allocatable :: lst(:) end type toml_vector contains subroutine new_vector(self, n) type(toml_vector), intent(out) :: self integer, intent(in), optional :: n self%n = 0 if (present(n)) then allocate(self%lst(min(1, n))) end if end subroutine new_vector subroutine find(self, key, ptr) class(toml_vector), intent(inout), target :: self character(len=*), intent(in) :: key class(toml_value), pointer, intent(out) :: ptr integer :: i nullify(ptr) do i = 1, self%n if (allocated(self%lst(i)%val)) then if (self%lst(i)%val%match_key(key)) then ptr => self%lst(i)%val exit end if end if end do end subroutine find end module tomlf_structure_vector lfortran-0.63.0/tests/fpe_trap_test.f900000664000175000017500000000104115174404631020135 0ustar alastairalastair! How to test: ! $ lfortran tests/fpe_trap_test.f90 --fpe-trap invalid -g ! Floating point exception (core dumped) ! $ gdb fpe_trap_test.out ! [...] ! (gdb) run ! [...] ! Program received signal SIGFPE, Arithmetic exception. ! test_fpe () at tests/fpe_trap_test.f90:18 ! 18 y = 0.0 / x ! traps here ! program test_fpe implicit none real :: x, y call get_zero(x) y = 0.0 / x ! traps here print *, "y = ", y contains subroutine get_zero(val) real, intent(out) :: val val = 0.0 end subroutine end program lfortran-0.63.0/tests/preprocessor8.f900000664000175000017500000000065315174404631020124 0ustar alastairalastairprogram preprocessor8 ! pre-defined macros implicit none print *, __LFORTRAN__ #ifdef __VERSION__ print *, "__VERSION__ present" #endif #ifdef __LFORTRAN_MAJOR__ print *, "__LFORTRAN_MAJOR__ present" #endif #ifdef __LFORTRAN_MINOR__ print *, "__LFORTRAN_MINOR__ present" #endif #ifdef __LFORTRAN_PATCHLEVEL__ print *, "__LFORTRAN_PATCHLEVEL__ present" #endif print *, __FILE__ print *, __LINE__ print *, __LINE__ end program lfortran-0.63.0/tests/expr7.f900000664000175000017500000000004315174404631016344 0ustar alastairalastair5_int32 5_int64 5_l 5__l_3 5__l_3_ lfortran-0.63.0/tests/char_arr_assignment.f900000664000175000017500000000015415174404631021313 0ustar alastairalastairprogram char_arr_assignment character char_arr(4) char_arr(:) = "A" end program char_arr_assignment lfortran-0.63.0/tests/entry2.f900000664000175000017500000000012615174404631016524 0ustar alastairalastairsubroutine prini() return entry prin() call messpr() return end subroutine lfortran-0.63.0/tests/modules_03.f900000664000175000017500000000044215174404631017254 0ustar alastairalastairmodule access_vars implicit none public real, private :: priv = 1.5 real, public :: publ = 2.5 contains subroutine print_vars() print *, "priv = ", priv print *, "publ = ", publ end subroutine print_vars end module access_vars lfortran-0.63.0/tests/format4.f900000664000175000017500000000007315174404631016656 0ustar alastairalastairprogram format4 print "(I0)",'int?' end program format4lfortran-0.63.0/tests/fixedform_doloop3.f0000664000175000017500000000130115174404631020546 0ustar alastairalastair SUBROUTINE START1(N, F, L, LOUT) C C ALGORITHM AS 93.1 APPL. STATIST. (1976) VOL.25, NO.1 C C GENERATES A 1,N ANSARI-BRADLEY DISTRIBUTION IN F. C REAL F(L), ONE, TWO DATA ONE, TWO /1.0, 2.0/ LOUT = 1 + N / 2 DO 1 I = 1, LOUT 1 F(I) = TWO IF (MOD(N, 2) .EQ. 0) F(LOUT) = ONE RETURN END SUBROUTINE f(N) DO 1 I = 1, LOUT a = 1 do j = 3, n b = 2 do 4 k = 3, n c = 3 do 5 l = 3, n d = 4 5 xx = 5 e = 5 4 end do kmn = 6 end do g = 8 1 kmn(I) = TWO h = 9 END lfortran-0.63.0/tests/wasm_bind_js.f900000664000175000017500000000057515174404631017750 0ustar alastairalastairprogram test_js_interface integer , parameter :: i_max = 600 integer , parameter :: j_max = 450 integer :: image_t(j_max, i_max) interface subroutine show_img(n, m, A) bind(js) integer, intent(in) :: n, m integer, intent(in) :: A(n,m) end subroutine end interface call show_img(j_max, i_max, image_t) end program lfortran-0.63.0/tests/variable1.f900000664000175000017500000000015615174404631017152 0ustar alastairalastairsubroutine variable01(m, n) integer m,n complex x(m), y(n), p1, p2, p3, p4 call matveca(x,m,y,p1,p2,p3,p4) endlfortran-0.63.0/tests/int_to_complex_cast_in_comparison.f900000664000175000017500000000046115174404631024260 0ustar alastairalastairprogram expr2 implicit none integer, parameter :: dp = kind(0.d0) contains elemental complex(dp) function dabs(x) result(r) complex(dp), intent(in) :: x if (x /= 0) then r = x else r = 0 - x end if end function dabs end program lfortran-0.63.0/tests/derived_types_06.f900000664000175000017500000000014115174404631020451 0ustar alastairalastairmodule tomlf_utils use tomlf_utils_convert implicit none contains end module tomlf_utils lfortran-0.63.0/tests/implicit_interface4.f900000664000175000017500000000017015174404631021216 0ustar alastairalastairsubroutine driver(f, n) integer, intent(in) :: n real :: i real(8) :: j call f(n, i, j) call driver2(f) end subroutine lfortran-0.63.0/tests/fn3.f900000664000175000017500000000037515174404631015775 0ustar alastairalastairrecursive pure integer function a() end function pure integer elemental function b() end function elemental pure integer function c() end function elemental pure function cb() integer cb end function integer pure recursive function d() end function lfortran-0.63.0/tests/wasm1.f900000664000175000017500000000167215174404631016340 0ustar alastairalastairprogram wasm1 implicit none print *, sqr(5) print *, add(5, 4) print *, add64(4_8, 5_8) print *, computeCircleArea(5) print *, my_add(5, 4) contains function sqr(x) result(r) implicit none integer, intent(in):: x integer :: r r = x * x end function function add(x, y) result(r) implicit none integer, intent(in):: x, y integer :: r r = x + y end function function add64(x, y) result(r) implicit none integer(8), intent(in):: x, y integer(8) :: r r = x + y end function function computeCircleArea(radius) result(area) implicit none integer, intent(in):: radius integer :: PI, area PI = 3 area = PI * sqr(radius) end function integer function my_add(a, b) result(c) integer, intent(in) :: a, b c = a + b end function end program lfortran-0.63.0/tests/expr3.f900000664000175000017500000000005315174404631016341 0ustar alastairalastair5 5+3 (5+3)*2 5+3*2 5-3 4**3 5 + 3 5 + 3 lfortran-0.63.0/tests/array15.f900000664000175000017500000000011515174404631016563 0ustar alastairalastairprogram array15 implicit none integer :: x(3) x = 23 end program lfortran-0.63.0/tests/preprocessor17.F900000664000175000017500000000016315174404631020140 0ustar alastairalastairprogram preprocessor1 implicit none #define X123 12345678 integer :: x, y x = (2+3)*5 print *, x, X123 end program lfortran-0.63.0/tests/warnings/0000775000175000017500000000000015174404631016612 5ustar alastairalastairlfortran-0.63.0/tests/warnings/character_02.f900000664000175000017500000000021715174404631021367 0ustar alastairalastairprogram character_02 character(len=1, kind=1), parameter :: toml_base(4) = ["11", "21", "31", "$1"] print *, toml_base end program lfortran-0.63.0/tests/warnings/rand_01.f900000664000175000017500000000011015174404631020346 0ustar alastairalastairprogram rand_01 real :: x x = rand() print *, x end program lfortran-0.63.0/tests/warnings/character_03.f900000664000175000017500000000015615174404631021372 0ustar alastairalastairprogram character_03 implicit none character*(2+3) str str = "hello" print *, str end program lfortran-0.63.0/tests/warnings/character_01.f900000664000175000017500000000016315174404631021366 0ustar alastairalastairprogram character_01 implicit none character(len=1, kind=1), parameter :: c_null_char = "ball" end program lfortran-0.63.0/tests/warnings/dim_assgn_test.f900000664000175000017500000000017115174404631022134 0ustar alastairalastairprogram dim_assgn_test integer, private, dimension(2,2) :: a(2,2) integer, private, dimension(2,2) :: b(2,3) end program lfortran-0.63.0/tests/warnings/preprocess_01.f900000664000175000017500000000035015174404631021615 0ustar alastairalastairprogram preprocess_01 implicit none #line 10 integer :: x #ifdef pqr x = (2+3)*5 #elif mno == 18 x = 18 #else print *, "Else condition" x = 30 #endif print *, x x = 10000 #define abc(m, n) m + n #abcd end program lfortran-0.63.0/tests/warnings/open_notimplemented_kwarg1.f900000664000175000017500000000044115174404631024452 0ustar alastairalastairPROGRAM open_notimplemented_kwargs implicit none ! "action" isn't supported yet, once implemented this test file ! (and other reference files) can be safely deleted ! currently raises a warning open(10, file='file_01_data.txt', status='old', action='read') END PROGRAM lfortran-0.63.0/tests/warnings/doloop_01.f900000664000175000017500000000015015174404631020722 0ustar alastairalastairprogram doloop_01 integer :: i do i = 1.5, 10.5, 2.4 print *, i end do end program lfortran-0.63.0/tests/warnings/sizeof_01.f900000664000175000017500000000026115174404631020730 0ustar alastairalastairprogram sizeof_01 use iso_c_binding, only: c_int, c_size_t implicit none integer(c_int) :: x integer(c_size_t) :: s s = sizeof(x) print *, s end program lfortran-0.63.0/tests/exit1.f900000664000175000017500000000021415174404631016331 0ustar alastairalastairprogram exit1 integer :: i, N N = 10 do i = 1, N print *, i if ( i .eq. 5 ) then call exit(1) end if end do end program lfortran-0.63.0/tests/implicit1.f900000664000175000017500000000250715174404631017201 0ustar alastairalastairprogram implicit1 ! AST only implicit none IMPLICIT NONE implicit none () implicit none (external) implicit none (type) implicit none (external, type) implicit none (type, external) implicit real (a-h,o-z) implicit real (dp) (a-h,o-z) implicit real*8 (a-h,o-z) implicit real(8) (a-h,o-z) implicit double precision (a-h,o-z) implicit character (c,o-z) implicit character (id) (a-z) implicit integer (i-n) implicit integer (i,j,k,l,m,n) implicit integer (i,j-l,m,n) implicit integer (dp) (a-h,o-z) implicit integer*8 (i,j-l,m,n) IMPLICIT INTEGER (A, C) IMPLICIT INTEGER*4 (C, D-x) IMPLICIT INTEGER(4) (C, D-x) implicit logical (l, u-z) implicit logical (dp) (a-h,o-z) implicit logical*4 (l, u-z) implicit logical(4) (l, u-z) implicit complex (z) implicit complex (dp) (a-h,o-z) IMPLICIT COMPLEX (C) implicit complex*8 (z) implicit complex(4) (z) IMPLICIT TYPE(BLOB) (A) IMPLICIT class(X) (A-b) implicit real(kind=4)(a), real(4+4)(b), real(d)(d), real(d(2))(a-z) implicit integer(kind=4)(a), integer(4+4)(b), integer(d)(d), integer(d(2))(a-z) implicit logical(kind=4)(a), logical(4+4)(b), logical(d)(d), logical(d(2))(a-z) implicit complex(kind=4)(a), complex(4+4)(b), complex(d)(d), complex(d(2))(a-z) implicit character(kind=c_char, len=4)(a) implicit character(len=4, kind=c_char)(a) implicit character(kind=c_char)(a) end program implicit1 lfortran-0.63.0/tests/unlimited_polymorphic_intrinsic_type_allocate.f900000664000175000017500000000067415174404631026717 0ustar alastairalastairprogram unlimited_polymorphic_intrinsic_type_allocate implicit none class(*), allocatable :: var integer(8) :: x x = 10 allocate(var, source=x) select type(var) type is (integer(8)) print *, "integer(8)" type is (integer(4)) print *, "integer(4)" type is (real) print *, "real" class default print *, "default" end select end program unlimited_polymorphic_intrinsic_type_allocate lfortran-0.63.0/tests/unordered_linking.f900000664000175000017500000000152715174404631021011 0ustar alastairalastair! This program demonstrates the use of the ISO C binding to call a C function from Fortran. ! It tests the linking of Fortran and C object files in different orders. ! The Fortran program defines an interface for the C 'add' function, which adds two integers. ! The test cases ensure the correct compilation and execution, regardless of the linking order ! between the Fortran and C files, as shown in the corresponding test script. program unordered_linking use iso_c_binding, only: c_int implicit none interface function add(a, b) bind(C) import :: c_int integer(c_int) :: add integer(c_int), value :: a, b end function add end interface integer(c_int) :: a, b, result a = 5 b = 3 result = add(a, b) print *, 'The sum is: ', result end program unordered_linking lfortran-0.63.0/tests/allow_implicit_interface3.f900000664000175000017500000000036515174404631022421 0ustar alastairalastair SUBROUTINE SSYR2(UPLO) CHARACTER UPLO INTEGER INFO LOGICAL LSAME EXTERNAL LSAME INFO = 0 IF (.NOT.LSAME(UPLO,'U') .AND. .NOT.LSAME(UPLO,'L')) THEN INFO = 1 ELSE INFO = 2 END IF RETURN END lfortran-0.63.0/tests/no_prescan_include1.f900000664000175000017500000000002215174404631021207 0ustar alastairalastairinclude "if1.f90" lfortran-0.63.0/tests/global_scope9.f900000664000175000017500000000003015174404631020015 0ustar alastairalastairinteger(8) :: x x = 6 x lfortran-0.63.0/tests/block2.f900000664000175000017500000000040615174404631016456 0ustar alastairalastairsubroutine hybrd() implicit none real :: ratio, delta interface subroutine fcn(n) integer, intent(in) :: n end subroutine fcn end interface main : block delta = abs(ratio) end block main end subroutine lfortran-0.63.0/tests/derived_types_04.f900000664000175000017500000000604715174404631020462 0ustar alastairalastairmodule tomlf_datetime implicit none private public :: toml_datetime, toml_time, toml_date !> TOML time value (HH:MM:SS.sssssZ...) type :: toml_time integer :: hour = 0 integer :: minute = 0 integer :: second = 0 integer, allocatable :: millisec character(len=:), allocatable :: zone contains generic :: assignment(=) => to_string procedure, pass(rhs) :: to_string => time_to_string end type interface toml_time module procedure :: new_toml_time end interface toml_time !> TOML date value (YYYY-MM-DD) type :: toml_date integer :: year = 0 integer :: month = 0 integer :: day = 0 contains generic :: assignment(=) => to_string procedure, pass(rhs) :: to_string => date_to_string end type !> TOML datatime value type type :: toml_datetime type(toml_date), allocatable :: date type(toml_time), allocatable :: time contains generic :: assignment(=) => to_string procedure, pass(rhs) :: to_string => datetime_to_string end type contains subroutine date_to_string(lhs, rhs) character(len=:), allocatable, intent(out) :: lhs class(toml_date), intent(in) :: rhs allocate(character(len=10) :: lhs) write(lhs, '(i4.4,"-",i2.2,"-",i2.2)') & & rhs%year, rhs%month, rhs%day end subroutine date_to_string subroutine time_to_string(lhs, rhs) character(len=:), allocatable, intent(out) :: lhs class(toml_time), intent(in) :: rhs if (allocated(rhs%millisec)) then allocate(character(len=12) :: lhs) write(lhs, '(i2.2,":",i2.2,":",i2.2,".",i3.3)') & & rhs%hour, rhs%minute, rhs%second, rhs%millisec else allocate(character(len=8) :: lhs) write(lhs, '(i2.2,":",i2.2,":",i2.2)') & & rhs%hour, rhs%minute, rhs%second end if if (allocated(rhs%zone)) lhs = lhs // trim(rhs%zone) end subroutine time_to_string subroutine datetime_to_string(lhs, rhs) character(len=:), allocatable, intent(out) :: lhs class(toml_datetime), intent(in) :: rhs character(len=:), allocatable :: temporary if (allocated(rhs%date)) then call rhs%date%to_string(lhs) if (allocated(rhs%time)) then call rhs%time%to_string(temporary) lhs = lhs // temporary end if else if (allocated(rhs%time)) lhs = rhs%time end if end subroutine datetime_to_string !> Constructor for toml_time type, necessary due to PGI bug in NVHPC 20.7 and 20.9 elemental function new_toml_time(hour, minute, second, millisec, zone) & & result(self) integer, intent(in), optional :: hour integer, intent(in), optional :: minute integer, intent(in), optional :: second integer, intent(in), optional :: millisec character(len=*), intent(in), optional :: zone type(toml_time) :: self if (present(hour)) self%hour = hour if (present(minute)) self%minute = minute if (present(second)) self%second = second if (present(millisec)) self%millisec = millisec if (present(zone)) self%zone = zone end function new_toml_time end module tomlf_datetime lfortran-0.63.0/tests/implicit_typing2.f900000664000175000017500000000030115174404631020562 0ustar alastairalastairsubroutine f(ifault, r, n, b) integer :: a(n) integer :: b(n) ifault = 4 r = 3 end subroutine integer function g(ifault, r, n, b) integer :: a(n) integer :: b(n) ifault = 4 r = 3 end function lfortran-0.63.0/tests/exit2.f900000664000175000017500000000021415174404631016332 0ustar alastairalastairprogram exit2 integer :: i, N N = 10 do i = 1, N print *, i if ( i .eq. 5 ) then call exit(2) end if end do end program lfortran-0.63.0/tests/statement1.f900000664000175000017500000000016715174404631017373 0ustar alastairalastairsubroutine statement1() double precision x, a, b, c logical q q(x) = .NOT. ( a == b .AND. c == 0.0 ) end subroutine lfortran-0.63.0/tests/array10.f900000664000175000017500000000012515174404631016557 0ustar alastairalastairprogram const_arrays integer, parameter :: x(*) = [4, 9, 6, 12, 13] print *, x end lfortran-0.63.0/tests/preprocessor16.f900000664000175000017500000000051215174404631020175 0ustar alastairalastairprogram test_cpp_hex #if 0xFF == 255 print *, "yes hex and int equal" #else print *, "no hex and int equal" #endif #if 0xa == 0b1010 print *, "yes hex and bin equal" #else print *, "no hex and bin not equal" #endif #if 0B1010 == 10 print *, "yes bin and int equal" #else print *, "no bin and int not equal" #endif end program lfortran-0.63.0/tests/selectrank1.f900000664000175000017500000000122115174404631017512 0ustar alastairalastairsubroutine process(x) real x(..) select rank(x) rank (0) x = 0 rank (2) if (size(x,2)>=2) x(:,2) = 2 rank default print *, 'i did not expect rank', rank(x), 'shape', shape(x) error stop 'process bad arg' end select return end subroutine process subroutine initialize (arg, size) real,contiguous :: arg(..) integer :: size, i select rank (arg) rank (0) ! special case the scalar case arg = 0.0 rank (*) do i = 1, size arg(i) = 0.0 end do end select return end subroutine lfortran-0.63.0/tests/external2.f900000664000175000017500000000010615174404631017203 0ustar alastairalastairsubroutine f(sub2) external :: sub2 call sub2(x) end subroutine lfortran-0.63.0/tests/expr5.f900000664000175000017500000000013315174404631016342 0ustar alastairalastairprogram expr_05 implicit none integer :: x x = (2+3)*5 if (x == 25) error stop end program lfortran-0.63.0/tests/implicit_typing4.f900000664000175000017500000000022115174404631020565 0ustar alastairalastairFUNCTION DNAN() DOUBLE PRECISION DNAN DNAN = 0.0 END SUBROUTINE CLQMN() IMPLICIT COMPLEX*16 (C,Z) IF (DIMAG(Z) == 0.0) LS=1 END lfortran-0.63.0/tests/subroutine6.f900000664000175000017500000000043315174404631017567 0ustar alastairalastairsubroutine triad(a, b, scalar, c) real, intent(in) :: a(:), b(:), scalar real, intent(out) :: c(:) integer :: N, N2, i, j N = size(a) N2 = size(b) do concurrent (i = 1:N) c(i) = a(i) + scalar * b(i) end do do concurrent (j = 1:N2) c(j) = b(j) + scalar end do end subroutine lfortran-0.63.0/tests/implicit_typing1.f900000664000175000017500000000015615174404631020571 0ustar alastairalastairprogram X L = 3 a = 3 integerx = 12 datap = 1.0 realr = 1.5 print *, L, a, integerx, datap, realr end program lfortran-0.63.0/tests/preprocessor3.h0000664000175000017500000000016315174404631017744 0ustar alastairalastair#define X123 12345678 #define Y123 X123 #define A123 Y123 #define B123 A123 #define C123 B123+B123 integer :: x, y lfortran-0.63.0/tests/array14.f900000664000175000017500000000023115174404631016561 0ustar alastairalastairprogram array14 implicit none real :: x(5) real :: z(3) x = [5, -1, 3, 4, 2] print *, x z = x(1:3) print *, z end program lfortran-0.63.0/tests/implicit3.f900000664000175000017500000000026115174404631017176 0ustar alastairalastairinteger function a(n,m,z,k) implicit real (n,m) implicit real*8 (k) implicit complex (z) integer :: X(5), Y(8) n = 5 m = 8 k = 9.23 X = [1,2,3,4,5] z = (1.0 , 2.0) end function lfortran-0.63.0/tests/interop/0000775000175000017500000000000015174404631016442 5ustar alastairalastairlfortran-0.63.0/tests/interop/mod1.f900000664000175000017500000000143615174404631017626 0ustar alastairalastairmodule mod1 implicit none private public f1, f2, f3, f4, f2b, f3b, f5b contains integer function f1(a, b) result(r) integer, intent(in) :: a, b r = a + b end function integer function f2(n, a) result(r) integer, intent(in) :: n, a(n) r = sum(a) end function integer function f3(n, m, a) result(r) integer, intent(in) :: n, m, a(n,m) r = sum(a) end function integer function f2b(a) result(r) integer, intent(in) :: a(:) r = sum(a) end function integer function f3b(a) result(r) integer, intent(in) :: a(:,:) r = sum(a) end function integer function f4(a, b) integer, intent(in) :: a integer, intent(out) :: b b = a f4 = 0 end function integer function f5b(a) result(r) integer, intent(in) :: a(:,:) integer :: i r = 0 do i = 1, size(a, 2) r = r + a(1, i) end do end function end module lfortran-0.63.0/tests/interop/mod1-14.mod0000664000175000017500000000122015174404631020220 0ustar alastairalastair‹å˜Yo›@Çß÷SÌø!3€ Ô&)*‡ÅÑ4OV[ªTÇ’{|þÎ.†¬S×NmKX\»;?þsx—›ë,/ó …ùâé×÷)üž.|[<ƒŽËéýÏéÌ–‹¹l€f¾%L³o±‹æ¤'øtÃÀ˜¡†´ÌLsœgÃpTå!Téç4»M¯¢´ Ó’lTÅá•|£p7Ï…\Wé°Œ²¢dG蜌yˆÚ¾ìæà€¥¶æšÁÀækÓWñöWèܨ' GGÃ%ºÃyδ¢Ž‡Ròÿ%©«IŠÝ©Õô â¶AcÑ’yZfñ__×ÔÌi=?—qÒÓºƒñ®ÑE§Èkv«ìf¶/£ï€ÁMuƒôº±.è‰ é…ƒNW8èøÂñO—‰ý* 镆.©ÒðTPsÊ©“Ý×&QëÆ³j÷ôåHë6éÓG|OñÈÓhm‰òÛ‚ú²`Õ«x «å2W8ªW¢|Ö_-÷¸Õ+) ÔšÊU7më Çt@lfortran-0.63.0/tests/interop/generate_mod_files.sh0000775000175000017500000000044615174404631022620 0ustar alastairalastair#!/usr/bin/env bash set -ex gfortran-7 -c mod1.f90 -o /tmp/a.o mv mod1.mod mod1-14.mod cp mod1-14.mod mod1-14-unpacked.mod.gz gzip -df mod1-14-unpacked.mod.gz gfortran-10 -c mod1.f90 -o /tmp/a.o mv mod1.mod mod1-15.mod cp mod1-15.mod mod1-15-unpacked.mod.gz gzip -df mod1-15-unpacked.mod.gz lfortran-0.63.0/tests/fixed_form_if_variations.f0000664000175000017500000000057115174404631022173 0ustar alastairalastair subroutine f(a) integer a print *, a end subroutine program main if (0<1) then print *, "first branch" 10 continue else print *, "second branch" endif 50 call f(1) if (0<2) return if (0>1) goto 50 if (0<1) call f(2) end program lfortran-0.63.0/tests/do7.f900000664000175000017500000000027215174404631015774 0ustar alastairalastairprogram do7 implicit none integer :: i, a do i = 1, 10 a = f(5) end do contains integer function f(a) integer, intent(in) :: a f = a + 1 end function end program lfortran-0.63.0/tests/common2.f0000664000175000017500000000036015174404631016502 0ustar alastairalastair subroutine f() integer :: a, b, c, d, e, g, h, i, j, k common / block_1 / a, b, h / block_2 / c, d, / block_3 / e, & g common / block_4 / i, / block_5 / j, k end subroutine lfortran-0.63.0/tests/do6.f900000664000175000017500000000222615174404631015774 0ustar alastairalastairprogram do6 implicit none integer :: i, j, k integer :: correct correct = 0 k = 0 do 30 i = 1, 5 do 30 j = 1, 5 30 k = k + 1 write(*,*) k correct = correct + k k = 0 do 35 i = 1, 5 do 35 j = 1, 5 k = k + 1 35 continue write(*,*) k correct = correct + k k = 0 do 40 i = 1, 25 k = k + 1 40 enddo write(*,*) k correct = correct + k k = 0 do 45 i = 1, 25 k = k + 1 45 end do write(*,*) k correct = correct + k k = 0 do 50 i = 1, 5 do 50 j = 1, 5 k = k + 0 50 k = k + 1 write(*,*) k correct = correct + k k = 0 do 60 i = 1, 25 k = k + 0 60 k = k + 1 write(*,*) k correct = correct + k k = -30 do 65 i = 1, 5 k = k + 1 do 65 j = 1, 5 if (k == 25) go to 70 k = k + 2 65 continue write(*,*) k correct = correct + k if (k == 25) then j = 0 go to 65 end if 70 continue write(*,*) k correct = correct + k k = -30 do 75 i = 1, 5 k = k + 1 do 75 j = 1, 5 if (k == 25) go to 80 k = k + 2 75 end do write(*,*) k correct = correct + k if (k == 25) then j = 0 go to 75 end if 80 continue write(*,*) k correct = correct + k write(*, *) 10*correct/25, '% correct' end programlfortran-0.63.0/tests/mangle_underscore_external_01.f900000664000175000017500000000030715174404631023200 0ustar alastairalastairprogram mangle_underscore_external_01 implicit none interface subroutine foo() end subroutine foo end interface call foo() end program mangle_underscore_external_01 lfortran-0.63.0/tests/preprocessor18.f900000664000175000017500000000023415174404631020200 0ustar alastairalastairprogram preprocessor18 #if (defined __flang__ && __flang_major__ <= 19) integer,parameter :: x = 0 #else integer,parameter :: y = 0 #endif end programlfortran-0.63.0/tests/do1.f900000664000175000017500000000061015174404631015762 0ustar alastairalastairdo i = 1, 5 a = a + i end do do i = 1, 5 end do do i = 1, 5, 2 a = a + i end do do a = a + i b = 3 end do subroutine g do a = a + i b = 3 enddo do, i = 1, 5 a = a + i end do n = 0 do 50, i = 1, 10 j = i do k = 1, 5 l = k n = n + 1 ! this statement executes 50 times end do ! nonlabeled do inside a labeled do 50 continue end subroutine lfortran-0.63.0/tests/derived_types_09.f900000664000175000017500000000014515174404631020460 0ustar alastairalastairprogram type_parsing type :: SomeType contains end type SomeType end program type_parsing lfortran-0.63.0/tests/preprocessor20.f900000664000175000017500000000052415174404631020173 0ustar alastairalastair#if !defined pi_constant #define PI 3.14 #endif /* multi-line comment on a two separate lines */ #if !defined negative_constant #define negative_one -1 #endif /* multi-line comment on a single line */ program preprocessor20 implicit none print *, "PI: ", PI print *, "negative one: ", negative_one end program preprocessor20 lfortran-0.63.0/tests/external_01.f900000664000175000017500000000022215174404631017420 0ustar alastairalastair subroutine foo(a,b,f) complex, intent(out) :: a complex, intent(in) :: b complex, external :: f a = f(b) end subroutine foo lfortran-0.63.0/tests/interactive_parse_without_program_line.f900000664000175000017500000000100715174404631025330 0ustar alastairalastairinteger, allocatable :: a(:) integer, pointer :: p allocate(a(10)) deallocate(a) open(unit=10, file="test.txt", status="old") flush(10) close(unit=10) nullify(p) exit cycle return continue print *, exit print *, cycle print *, return print *, continue call exit call cycle call return call continue contains subroutine sub integer :: i do i = 1, 10 print *, i if (i == 5) exit if (i == 7) cycle if (i == 9) return if (i == 2) continue end do end subroutine end program lfortran-0.63.0/tests/Subroutine_Call1.f900000664000175000017500000000076715174404631020467 0ustar alastairalastairprogram Subroutine_Call1 implicit none ! Syntax check !Subroutine CALL call randn(x(i)) call randn(x) call random_number(U) call rand_gamma0(a, .true., x) call rand_gamma0(a, .true., x(1)) call rand_gamma0(a, .false., x(i)) call rand_gamma_vector_n(a, size(x), x) call f(a=4, b=6, c=i) call g(a(3:5,i:j), b(:)) call g(a(:5,i:j), b(1:)) call a%random_number(u) call a%b%random_number(u) call f(a=4, b=6, c=i) call x%f%e() call self%dependency(ii)%info(unit, pr - 1) call self%dep(:self%ndep)%done(a) end lfortran-0.63.0/tests/implicit12.f900000664000175000017500000000065715174404631017267 0ustar alastairalastairsubroutine a() implicit integer (b-c) implicit integer*4 (d-e) implicit integer*8 (f-g) implicit real (h) implicit real*4 (i-k) implicit real*8 (l) implicit complex (m, n) implicit complex*8 (o) implicit complex*16 (p) implicit double precision (q) implicit double precision (r) integer :: Y(e) real :: X(d, e, e) real :: b Y(1) = 3 X(1, 1, 1) = 3 b = 2 d = 3 f = 4 h = 5 i = 6 l = 7 m = 8 o = 9 p = 10 q = 11 r = 12 end subroutinelfortran-0.63.0/tests/use_statement.f900000664000175000017500000000244115174404631020163 0ustar alastairalastairprogram use_statement ! AST ! Syntax check only use, intrinsic :: example, only: name=>rename, NAME=>RENAME use, intrinsic :: example, only: operator (**) use, intrinsic :: example, only: operator (.not.) use, intrinsic :: example, only: operator (.in.) use, intrinsic :: example, only: operator (.plus.) => operator (.add.) use, non_intrinsic :: example USE, NON_INTRINSIC :: EXAMPLE use, non_intrinsic :: example, only: assignment(=) use, non_intrinsic :: example, only: operator (==) use, non_intrinsic :: example, only: operator (.or.) use, non_intrinsic :: example, only: operator (.definedoperator.) use :: example, only: operator (+) use :: example, only: sample use :: example, only: sample=>rename use example, only: operator (*) use example, only: operator ( / ) use example, only: operator (/) use example, only: operator (/=) use example, only: operator (>) use example, only: operator (<=) use example, only: operator (.and.) use example, only: operator (.eqv.) use example, only: operator (.dot.) use example, only: write(formatted) use example, only: read(unformatted) use example, only: use example, operator (.localDefop.) => operator (.useDefop.), a => b end lfortran-0.63.0/tests/subroutine2.f900000664000175000017500000000164315174404631017567 0ustar alastairalastairsubroutine g x = y x = 2*y end subroutine subroutine g x = y x = 2*y end subroutine subroutine g x = y x = 2*y end subroutine subroutine g x = y ;;;;;; ; ; ; x = 2*y end subroutine subroutine g x = y; x = 2*y; end subroutine subroutine g x = y; ; x = 2*y;; ; end subroutine subroutine g; x = y; x = 2*y; end subroutine subroutine f subroutine = y x = 2*subroutine end subroutine subroutine f integer :: x end subroutine subroutine f() integer :: x end subroutine subroutine f(a, b, c, d) integer, intent(in) :: a, b integer, intent ( in ) :: c, d integer :: z integer::y end subroutine subroutine f(a, b, c, d) integer, intent(out) :: a, b integer, intent(in out) :: c, d integer :: z integer::y end subroutine subroutine saxpy(n, a, x, y) real(dp), intent(in) :: x(:), a real(dp), intent(inout) :: y(:) integer, intent(in) :: n integer :: i do i = 1, n y(i) = a*x(i)+y(i) enddo end subroutine saxpy lfortran-0.63.0/tests/array16.f900000664000175000017500000000015115174404631016564 0ustar alastairalastairprogram array16 integer x(0:2) integer y(-1:1) y = [1,2,3] print *, y x = [4,5,6] print *, x end program lfortran-0.63.0/tests/string.f900000664000175000017500000000070115174404631016606 0ustar alastairalastairprogram string implicit none character(50) :: str str = "Hi, I'm using string" str = 'Use "Double" "quote"' str = "'random'' ab''cd""fg''h'ij""klmno'pqr's'''" str = 'random'' a"b''cd""fg""hij"kl"mno"p"qr"s''' str = """equal''" str = '"Double" ''Quote''' str = "'Single' ""Quote""" print *, "Hi, I'm using string" print *, 'This is a "sting"' print *, "'random'' ab''cd""fg''h'ij""klmno'pqr's'''" end program lfortran-0.63.0/tests/coarrays_01.f900000664000175000017500000000321215174404631017423 0ustar alastairalastairprogram coarrays_01 ! This test should test most of coarray syntax: ! * declarations ! * allocations ! * coarray operations ! ! You can test the syntax manually with GFortran by: ! gfortran -fcoarray=lib -c coarrays_01.f90 -o a.o ! use iso_fortran_env, only : event_type implicit none ! Coarray Declarations real, dimension(100), codimension[*] :: A integer :: B[3,*] integer :: c[*] real :: D(100,2)[3,*] real :: E(1,2,3)[1,2,-1:3,*] real, allocatable :: F(:)[:] real, allocatable :: g(:,:,:)[:,:,:] real, dimension(20), codimension[20,*] :: h real, codimension[:], allocatable :: z(:,:) character :: r(20)[20,0:*] type(event_type) :: ok_to_overwrite[*] type(event_type), allocatable :: greeting_ready(:)[:] integer :: i, n ! Allocation n = 5 allocate(F(n)[*]) allocate(greeting_ready(num_images())[*]) allocate(g(50,50,50)[1:2, 1:2, *]) ! Array access, events, teams if (this_image() == 1) then do i= 2,num_images() c = c + c[i] event post(ok_to_overwrite[i]) end do else event wait(ok_to_overwrite) event post(greeting_ready(this_image())[1]) end if syncall syncall() sync all(stat=status) sync all(errmsg=status) event wait(variable, until_count=status) event wait(variable, until_count=status, errmsg=status) event wait(variable, errmsg=status) event wait(variable, stat=status) event post (done (sub (i)) [parent (i)], stat=status) event post(variable, stat=status) event post(variable, errmsg=status) s%a(3)(4) = 'S' s%b[3] = c[4] s%c(3)[4] = f(3)[4] c[3] = c[4] B[1,2] = B[3,4] D(99,1)[3,4] = D(1,2)[1,2] D(99,1)[3,3] = 5 D(:,1)[3,3] = 5 D(:,1)[3,3,team=3] = 5 D(:,1)[3,3,team=3,stat=i] = 5 D(:,1)[3,3,stat=i] = 5 end program lfortran-0.63.0/tests/interface_generic_procedure_same_name.f900000664000175000017500000000046215174404631025015 0ustar alastairalastairmodule interface_generic_procedure_same_name implicit none interface frexp function frexp(x,n) result(r) real r real, intent(in), value :: x integer, intent(out) :: n end function frexp end interface frexp end module interface_generic_procedure_same_name lfortran-0.63.0/tests/document_symbols1.f900000664000175000017500000000026015174404631020747 0ustar alastairalastairsubroutine add() end subroutine program document_symbols1 use module_document_symbols1 implicit none integer :: x x = (2+3)*5 print *, x, xy call sub() call add() end program lfortran-0.63.0/tests/fixed_form_line_limit.f0000664000175000017500000000220515174404631021457 0ustar alastairalastairc 1 2 3 4 5 6 7 c 789012345678901234567890123456789012345678901234567890123456789012 program test <- int <- $eger a <- print *, "this is a test to see if the fixed form parser properly " <- that quote mark is in c73 $ignores text past column 72" print *, "test that we can still see the quote in the last column"<- print *, "test that we avoid double "" lookahead in col 73 "" print *, " end-of-line double """" c The next line only has text past column 72 00770402 c The next pattern is used to do continuations in code that is read c by both fixed-form AND free-form parsers a= & & 5 & & + 3 end program lfortran-0.63.0/tests/print3.f900000664000175000017500000000025215174404631016520 0ustar alastairalastairprogram print_03 implicit none integer :: x x = 24 print *, "x is ", x write (*, *) "x is ", x print *, "ok" write (*, *) "ok" end program lfortran-0.63.0/tests/fixed_form_call1.f0000664000175000017500000000025315174404631020327 0ustar alastairalastair subroutine idd_frm(m,n,w,x,y) integer m,n,w,x,y,lw call prinf('lw = *',lw,1) call prinf('16m+70 = *',16*m+70,1) return end lfortran-0.63.0/tests/preprocessor9.f900000664000175000017500000000026215174404631020121 0ustar alastairalastairprogram preprocessor9 ! Line continuation implicit none #define X 1+2+\ 3 + 4 \ + 5 + 6 #define Y(x) 1+2+\ 3 + 4*(x) \ + 5 + 6 print *, X print *, Y(1+2) end program lfortran-0.63.0/tests/implicit_check.f900000664000175000017500000000011715174404631020250 0ustar alastairalastair program main IMPLICIT DOUBLE PRECISION (A-H,O-Z) end program lfortran-0.63.0/tests/arrayelements1.f900000664000175000017500000000226515174404631020243 0ustar alastairalastairmodule my_subs implicit none interface my_sum module procedure sum_real, sum_int end interface my_sum contains subroutine sum_real (array, tot) real, dimension(:), intent (in) :: array real, intent (out) :: tot integer :: i tot = 1.0 do i=1, size (array) tot = tot * array (i) end do end subroutine sum_real subroutine sum_int (array, tot) integer, dimension(:), intent (in) :: array integer, intent (out) :: tot integer :: i tot = 0 do i=1, size (array) tot = tot + array (i) end do end subroutine sum_int end module my_subs program test_dt use my_subs implicit none type my_type integer weight real length end type my_type type (my_type), dimension (:), allocatable :: people type (my_type) :: answer allocate (people (2)) people (1) % weight = 1 people (1) % length = 1.0 people (2) % weight = 2 people (2) % length = 2.0 call my_sum ( people (:) % weight, answer % weight ) write (*, *) answer % weight call my_sum ( people (:) % length, answer % length ) write (*, *) answer % length end program test_dt lfortran-0.63.0/tests/kokkos_program2.f900000664000175000017500000000100515174404631020410 0ustar alastairalastairprogram kokkos_program2 implicit none real, dimension(10000) :: a, b, c real :: scalar integer :: i, nsize scalar = 10 nsize = size(a) do concurrent (i = 1:nsize) a(i) = 5 b(i) = 5 end do call triad(a, b, scalar, c) print *, "End Stream Triad" contains subroutine triad(a, b, scalar, c) real, intent(in) :: a(:), b(:), scalar real, intent(out) :: c(:) integer :: N, i N = size(a) do concurrent (i = 1:N) c(i) = a(i) + scalar * b(i) end do end subroutine end program lfortran-0.63.0/tests/global_scope1.f900000664000175000017500000000001515174404631020010 0ustar alastairalastairinteger :: x lfortran-0.63.0/tests/add.c0000664000175000017500000000010015174404631015645 0ustar alastairalastair#include int add(int a, int b) { return a + b; } lfortran-0.63.0/tests/fixedform_nestedloop_implicit.f0000664000175000017500000000020615174404631023240 0ustar alastairalastair 20 print *, 1 do k=1,10 do l=1,10 print*,k,l enddo enddo if(0>1) goto 20 end lfortran-0.63.0/tests/write1.f900000664000175000017500000000143215174404631016515 0ustar alastairalastairprogram write_01 implicit none write(*,*) "a", 2 write(*,*) write(*) a write(out_str,'(" Found index ", i9," but item is not in list.")') index write(out_string,*) 'Scalar_in = ', scalar_in write(out_string, 10) int_src, int_given, int_expected write(string,fmt='(f6.2)') max_angle write(fmt,'("(i",i0,".",i0,")")') n, n write(unit=*, fmt='(a)') trim(prog) // ': ' // message write(unit=0,fmt='(a,i4.4)') "Assertion failed at " // file // ":", line write(*,fmt='(a,l1)') 'exactly_conservative= ',exactly_conservative write(unit=lun) vec write(*,'(a,a)',advance='no') trim(input_string),": " WRITE( ounit, FMT=303, ADVANCE='NO' ) WRITE( *, 201) ( star, i = 1, 80 ) WRITE( *, '(1X,A)') 'Success!' WRITE( ounit, * ) print *, "2" print * print "(a, es22.14)", "Ekin: ", Ekin end program lfortran-0.63.0/tests/substring.f900000664000175000017500000000027315174404631017324 0ustar alastairalastairprogram substring implicit none character(5) :: str character(5), parameter :: s = "Hello World"(7:11) str = "12345"(2:4) print *, str print *, s print *, "SubString"(4:9) end program lfortran-0.63.0/tests/write5.f900000664000175000017500000000064515174404631016526 0ustar alastairalastairprogram write5 implicit none character(10) :: adv_val = "no" character(10) :: first_name, last_name first_name = "first" last_name = "last" write (*, "(a)", advance=adv_val) "hi" write (*, "(a)") "bye" write (*, "(a)", advance="n"//"o") first_name//", " write (*, "(a)", advance="y"//"e"//"s") last_name write(*,'("Hello ")',advance='NO') write(*,'("world!")') end program lfortran-0.63.0/tests/print2.f900000664000175000017500000000011315174404631016513 0ustar alastairalastairprogram print2 print"(es11.5,3x "// & "es11.5)",1.d0,2.d0 end program lfortran-0.63.0/tests/subroutine3.f900000664000175000017500000000005115174404631017560 0ustar alastairalastairinteger function f() f = 42 end function lfortran-0.63.0/tests/format6.f900000664000175000017500000000072615174404631016665 0ustar alastairalastairprogram format6 print '(SP,F6.1,F6.1,ss,F6.1)', 12.1, 122.1, 122.1 print '(SP,I5.3)', 11 print '(SP,I0.3)', 11 print '(SP,I0.2)', 11 print '(SP,I5.2)', 11 print '(SP,I0.2)', -11 print '(SP,I0.2)', -1111 print '(SP,I3.2)', 1111 print '(SP,ss,I0.2)', 11 PRINT '(SP,D25.10)', 12345.6789 print "(SP,E60.50)", 1.23456789101112e-62_8 PRINT '(SP,EN12.4, EN12.1)', 12345.6789 , 12845.6789 print '(SP,F5.1)', 1.0 end programlfortran-0.63.0/tests/modules2_module_b_base.f900000664000175000017500000000107715174404631021701 0ustar alastairalastairmodule tomlf_structure_base implicit none public :: toml_structure, toml_ordered type, abstract :: toml_structure contains procedure(destroy), deferred :: destroy end type toml_structure type, abstract, extends(toml_structure) :: toml_ordered end type toml_ordered abstract interface subroutine destroy(self) use tomlf_type_value, only: toml_value import :: toml_structure class(toml_structure), intent(inout), target :: self end subroutine destroy end interface end module tomlf_structure_base lfortran-0.63.0/tests/fixed_form_implicit_check.f0000664000175000017500000000011715174404631022301 0ustar alastairalastair program main IMPLICIT DOUBLE PRECISION (A-H,O-Z) end program lfortran-0.63.0/tests/save3.f900000664000175000017500000000006515174404631016324 0ustar alastairalastairsubroutine f() real :: var = 0.0 save end subroutine lfortran-0.63.0/tests/fn_call1.f900000664000175000017500000000027615174404631016766 0ustar alastairalastairsize(tvec, dim=2) min(tvec(2, i), tvec(1, i)) a(1, 2, 3) f(a, b, d=5/2, c=3+3) A(i,j,k) X(i) X(:) X(a:) X(:b) X(a:b) X(::c) X(: :c) X(a::c) X(a: :c) X(:b:c) X(a:b:c) X(a:b, : :c, a:, a: :c) lfortran-0.63.0/tests/expr8.f900000664000175000017500000000033515174404631016351 0ustar alastairalastairi = 123 j = 123456789824390874092509458720948720947502984752098457242092870987 k = 2*18446744073709551616 i = 123_i8 j = 123456789824390874092509458720948720947502984752098457242092870987_i8 k = 2*18446744073709551616_i8 lfortran-0.63.0/tests/loop_test4.f0000664000175000017500000000052715174404631017231 0ustar alastairalastair PROGRAM TEST DO 240 K=1+1/2-3**4,MP CON(K)=-DATMAT(K,NP) DO 220 J=f()/2,N 220 W(J)=DATMAT(K,J)+CON(K) DO 240 I=f(2,3,x=5,z="o""k'(")/2,N TEMP=0.0d0 DO 230 J=((1+2)+((1+3)/4)+f((3+2),k=(4+sum(A(:,:,:,4))))),N 230 TEMP=TEMP+W(J)*SIMI(J,I) IF (K .EQ. MP) TEMP=-TEMP 240 A(I,K)=TEMP END lfortran-0.63.0/tests/stop.f900000664000175000017500000000012215174404631016262 0ustar alastairalastairprogram stop implicit none integer :: x x = (2+3)*5 if (x == 25) stop end program lfortran-0.63.0/tests/fixed_form3.f0000664000175000017500000000072715174404631017344 0ustar alastairalastair integerfunctionfunctionf(n) integerfunctionfunctionf(n) integern endfunctionfunctionf integerfunctionf(endfunctionf) integerendfunctionf endfunctionf=4 endfunctionf integerfunctiong(integerx) integerintegerx integerx integerx=5 x=5 integerx=5 endfunctiong integerfunctiong2(integerx) integerintegerx integer::x=5 x=5 integerx=5 endfunctiong2 lfortran-0.63.0/tests/program1.f900000664000175000017500000000012615174404631017031 0ustar alastairalastairprogram program1 implicit none integer :: i i = 5 print *, i print *, i+1 end program lfortran-0.63.0/tests/character1.f900000664000175000017500000000023415174404631017316 0ustar alastairalastairsubroutine xerror(mess) character*(*) mess !This is string whose length is decided at compile time print *, mess(1) return end subroutine lfortran-0.63.0/tests/stop1.f900000664000175000017500000000127715174404631016357 0ustar alastairalastairprogram stop1 implicit none ! AST only(Syntax check) integer :: stop = 15 integer :: errstop = 25 if(stop /=15) then stop else if(errstop /=25) then error stop end if if(stop /=15) then stop "message" else if(errstop /=25) then error stop "message" end if if(stop /=15) then stop 0 else if(errstop /=25) then error stop 0 end if if(stop /=15) then stop, quiet = .true. else if(errstop /=25) then error stop, quiet = .true. end if if(stop /=15) then stop 1, quiet = .false. else if(errstop /=25) then error stop 1, quiet = .false. end if end program lfortran-0.63.0/tests/lookup_name1.f900000664000175000017500000000012315174404631017670 0ustar alastairalastairprogram lookup_name1 implicit none integer :: x x = (2+3)*5 print *, x end program lfortran-0.63.0/tests/select_type1.f900000664000175000017500000000072315174404631017705 0ustar alastairalastairprogram select_type1 implicit none select type (uptr => iter%value()) type is (integer) print *, iter%key(), ' = ', uptr type is (real) print *, iter%key(), ' = ', uptr type is (character(*)) print *, iter%key(), ' = ', uptr type is (point) print *, iter%key(), ' = ', uptr class is (point2) print *, iter%key(), ' = ', uptr class default print *, iter%key(), ' = ', uptr end select end program lfortran-0.63.0/tests/modules2.f900000664000175000017500000000136215174404631017036 0ustar alastairalastairmodule tomlf_type_array use tomlf_type_value, only : toml_value use tomlf_structure, only : toml_ordered implicit none type, extends(toml_value) :: toml_array class(toml_ordered), allocatable :: list contains procedure :: destroy end type toml_array interface new module procedure :: new_array end interface contains subroutine destroy(self) class(toml_array), intent(inout) :: self if (allocated(self%key)) then deallocate(self%key) end if if (allocated(self%list)) then call self%list%destroy deallocate(self%list) end if end subroutine destroy subroutine new_array(self) type(toml_array), intent(out) :: self end subroutine new_array end module tomlf_type_array lfortran-0.63.0/tests/optional_argument_subroutine_in_type.f900000664000175000017500000000077515174404631025050 0ustar alastairalastairmodule test_module implicit none type :: test_type real :: test_real_value contains procedure, nopass :: test_subroutine end type test_type contains subroutine test_subroutine(x) integer, optional, intent(in) :: x print *, "Hello World" end subroutine test_subroutine end module test_module program main use test_module implicit none type(test_type) :: test_type_instance call test_type_instance%test_subroutine() end program main lfortran-0.63.0/tests/interface1.f900000664000175000017500000000033315174404631017322 0ustar alastairalastairmodule interface1 implicit none interface randn module procedure randn_scalar module procedure :: randn_vector module procedure randn_matrix module procedure :: randn_vector_n end interface end module lfortran-0.63.0/tests/fixedform_doloop.f0000664000175000017500000000042615174404631020472 0ustar alastairalastair program main integer k,l,m,n do k=1,10 print *, k enddo do 80 l=1,10 print *, l 80 enddo do 800 m=1,10 print *, m 800 enddo do 8000 n=1,10 print *, n 8000 enddo end program lfortran-0.63.0/tests/data2.f900000664000175000017500000000044215174404631016275 0ustar alastairalastairprogram main call a() end program subroutine a() double precision factor, zero data factor,zero /1.0d2,0.0d0/ print *, "factor in a:", factor call b(factor) end subroutine subroutine b(factor) double precision factor print *, "factor: ", factor end subroutinelfortran-0.63.0/tests/assert.fpp0000664000175000017500000000020015174404631016762 0ustar alastairalastair#ifdef NDEBUG # define ASSERT(x) !! assert( x ) #else # define ASSERT(x) if(.not.(x)) call f90_assert(__FILE__,__LINE__) #endif lfortran-0.63.0/tests/fixed_form1.f0000664000175000017500000001437215174404631017343 0ustar alastairalastair subroutine dqawse(f,a,b,alfa,beta,integr,epsabs,epsrel,limit, * result,abserr,neval,ier,alist,blist,rlist,elist,iord,last) c***begin prologue dqawse c***date written 800101 (yymmdd) c***revision date 830518 (yymmdd) c***category no. h2a2a1 c***keywords automatic integrator, special-purpose, c algebraico-logarithmic end point singularities, c clenshaw-curtis method c***author piessens,robert,appl. math. & progr. div. - k.u.leuven c de doncker,elise,appl. math. & progr. div. - k.u.leuven c***purpose the routine calculates an approximation result to a given c definite integral i = integral of f*w over (a,b), c (where w shows a singular behaviour at the end points, c see parameter integr). c hopefully satisfying following claim for accuracy c abs(i-result).le.max(epsabs,epsrel*abs(i)). c***description c c integration of functions having algebraico-logarithmic c end point singularities c standard fortran subroutine c double precision version c***references (none) c***routines called d1mach,dqc25s,dqmomo,dqpsrt c***end prologue dqawse c double precision a,abserr,alfa,alist,area,area1,area12,area2,a1, * a2,b,beta,blist,b1,b2,centre,dabs,dmax1,d1mach,elist,epmach, * epsabs,epsrel,errbnd,errmax,error1,erro12,error2,errsum,f, * resas1,resas2,result,rg,rh,ri,rj,rlist,uflow integer ier,integr,iord,iroff1,iroff2,k,last,limit,maxerr,nev, * neval,nrmax c external f c dimension alist(limit),blist(limit),rlist(limit),elist(limit), * iord(limit),ri(25),rj(25),rh(25),rg(25) c c list of major variables c ----------------------- c c c***first executable statement dqawse epmach = d1mach(4) uflow = d1mach(1) c c test on validity of parameters c ------------------------------ c ier = 6 neval = 0 last = 0 rlist(1) = 0.0d+00 elist(1) = 0.0d+00 iord(1) = 0 result = 0.0d+00 abserr = 0.0d+00 if(b.le.a.or.(epsabs.eq.0.0d+00.and. * epsrel.lt.dmax1(0.5d+02*epmach,0.5d-28)).or.alfa.le.(-0.1d+01) * .or.beta.le.(-0.1d+01).or.integr.lt.1.or.integr.gt.4.or. * limit.lt.2) go to 999 ier = 0 c c compute the modified chebyshev moments. c call dqmomo(alfa,beta,ri,rj,rg,rh,integr) c c integrate over the intervals (a,(a+b)/2) and ((a+b)/2,b). c centre = 0.5d+00*(b+a) call dqc25s(f,a,b,a,centre,alfa,beta,ri,rj,rg,rh,area1, * error1,resas1,integr,nev) neval = nev call dqc25s(f,a,b,centre,b,alfa,beta,ri,rj,rg,rh,area2, * error2,resas2,integr,nev) last = 2 neval = neval+nev result = area1+area2 abserr = error1+error2 c c test on accuracy. c errbnd = dmax1(epsabs,epsrel*dabs(result)) c c initialization c -------------- c if(error2.gt.error1) go to 10 alist(1) = a alist(2) = centre blist(1) = centre blist(2) = b rlist(1) = area1 rlist(2) = area2 elist(1) = error1 elist(2) = error2 go to 20 10 alist(1) = centre alist(2) = a blist(1) = b blist(2) = centre rlist(1) = area2 rlist(2) = area1 elist(1) = error2 elist(2) = error1 20 iord(1) = 1 iord(2) = 2 if(limit.eq.2) ier = 1 if(abserr.le.errbnd.or.ier.eq.1) go to 999 errmax = elist(1) maxerr = 1 nrmax = 1 area = result errsum = abserr iroff1 = 0 iroff2 = 0 c c main do-loop c ------------ c do 60 last = 3,limit c c bisect the subinterval with largest error estimate. c a1 = alist(maxerr) b1 = 0.5d+00*(alist(maxerr)+blist(maxerr)) a2 = b1 b2 = blist(maxerr) c call dqc25s(f,a,b,a1,b1,alfa,beta,ri,rj,rg,rh,area1, * error1,resas1,integr,nev) neval = neval+nev call dqc25s(f,a,b,a2,b2,alfa,beta,ri,rj,rg,rh,area2, * error2,resas2,integr,nev) neval = neval+nev c c improve previous approximations integral and error c and test for accuracy. c area12 = area1+area2 erro12 = error1+error2 errsum = errsum+erro12-errmax area = area+area12-rlist(maxerr) if(a.eq.a1.or.b.eq.b2) go to 30 if(resas1.eq.error1.or.resas2.eq.error2) go to 30 c c test for roundoff error. c if(dabs(rlist(maxerr)-area12).lt.0.1d-04*dabs(area12) * .and.erro12.ge.0.99d+00*errmax) iroff1 = iroff1+1 if(last.gt.10.and.erro12.gt.errmax) iroff2 = iroff2+1 30 rlist(maxerr) = area1 rlist(last) = area2 c c test on accuracy. c errbnd = dmax1(epsabs,epsrel*dabs(area)) if(errsum.le.errbnd) go to 35 c c set error flag in the case that the number of interval c bisections exceeds limit. c if(last.eq.limit) ier = 1 c c c set error flag in the case of roundoff error. c if(iroff1.ge.6.or.iroff2.ge.20) ier = 2 c c set error flag in the case of bad integrand behaviour c at interior points of integration range. c if(dmax1(dabs(a1),dabs(b2)).le.(0.1d+01+0.1d+03*epmach)* * (dabs(a2)+0.1d+04*uflow)) ier = 3 c c append the newly-created intervals to the list. c 35 if(error2.gt.error1) go to 40 alist(last) = a2 blist(maxerr) = b1 blist(last) = b2 elist(maxerr) = error1 elist(last) = error2 go to 50 40 alist(maxerr) = a2 alist(last) = a1 blist(last) = b1 rlist(maxerr) = area2 rlist(last) = area1 elist(maxerr) = error2 elist(last) = error1 c c call subroutine dqpsrt to maintain the descending ordering c in the list of error estimates and select the subinterval c with largest error estimate (to be bisected next). c 50 call dqpsrt(limit,last,maxerr,errmax,elist,iord,nrmax) c ***jump out of do-loop if (ier.ne.0.or.errsum.le.errbnd) go to 70 60 continue c c compute final result. c --------------------- c 70 result = 0.0d+00 do 80 k=1,last result = result+rlist(k) 80 continue abserr = errsum 999 return end lfortran-0.63.0/tests/do_concurrent_reduce2.f900000664000175000017500000000033015174404631021553 0ustar alastairalastairsubroutine sum_reduce(a, s, t) real, intent(in) :: a(:) real, intent(out) :: s, t integer :: N, i N = size(a) s = 0 t = 0 do concurrent (i = 1:N) reduce(+:s,t) s = s + a(i) t = t + a(i) end do end subroutine lfortran-0.63.0/tests/implicit_interface_allocatable_array.f900000664000175000017500000000032515174404631024655 0ustar alastairalastairsubroutine implicit_interface_allocatable_array implicit none real(4), dimension(:), allocatable :: r_g real(4), dimension(:), pointer :: r_t call sub1(1, r_g) call sub2(1, r_t) end subroutine lfortran-0.63.0/tests/preprocessor12.f900000664000175000017500000000101315174404631020166 0ustar alastairalastair#include "assert.fpp" program preprocessor12 ! Test that a typical ASSERT macro works implicit none ASSERT(.true.) ASSERT(5 > 3) ASSERT(5+3*8 > 3) ASSERT(fn(3, 5)) ASSERT(5 < 3) contains logical function fn(a, b) integer, intent(in) :: a, b fn = a < b end function subroutine f90_assert(file, line) character(len=*), intent(in) :: file integer, intent(in) :: line print *, "Assertion failed at " // file // ":", line error stop end subroutine f90_assert end program lfortran-0.63.0/tests/errors/0000775000175000017500000000000015174404631016276 5ustar alastairalastairlfortran-0.63.0/tests/errors/kind_string_of_int.f900000664000175000017500000000011715174404631022466 0ustar alastairalastairprogram string_kind_integer implicit none integer('a') :: x end programlfortran-0.63.0/tests/errors/string_allocation_01.f900000664000175000017500000000031015174404631022623 0ustar alastairalastair! Refer to ./doc/src/string_allocation.md program string_allocation_01 implicit none character(:), allocatable :: a integer :: i i = -10 allocate(character(i) :: a) end programlfortran-0.63.0/tests/errors/cpp_err2.f900000664000175000017500000000010515174404631020326 0ustar alastairalastairprogram cpp_err2 #if 2 < 1+2+ / 1 2 #endif print *, 'OK' end program lfortran-0.63.0/tests/errors/incorrect_number_args_function.f900000664000175000017500000000032215174404631025074 0ustar alastairalastairprogram expr2 implicit none print *, helloWorld(5.1, 2) contains real function helloWorld(x) real, intent(in) :: x helloWorld = x + 1 end function helloWorld end program expr2 lfortran-0.63.0/tests/errors/template_error_07b.f900000664000175000017500000000051515174404631022313 0ustar alastairalastairmodule template_01_m implicit none private public :: op_t requirement semigroup(t, combine) type, deferred :: t end requirement contains subroutine test_template() end subroutine end module program template_01 use template_01_m implicit none end program template_01lfortran-0.63.0/tests/errors/maskl_negative.f900000664000175000017500000000007115174404631021605 0ustar alastairalastairprogram maskl_negative print*, maskl(-24) end program lfortran-0.63.0/tests/errors/write_01.f900000664000175000017500000000053615174404631020254 0ustar alastairalastairprogram write_01 implicit none character(len=*), parameter :: temp_file = "lfortran_temporary_file_write_01.dat" character(len=*), parameter :: test_line = "HelloWorld!" integer :: unit, ios ios = 0 unit = 1 open(newunit=unit, file=temp_file) !formatted write(unit) test_line !unformatted close(unit) end programlfortran-0.63.0/tests/errors/implicit_call_01.f900000664000175000017500000000026115174404631021722 0ustar alastairalastairsubroutine callsub (xub, i) ! xub is a variable (implicitly typed as real), ! trying to call it should fail without --implicit-interface call xub (i) end subroutine lfortran-0.63.0/tests/errors/kind_float_of_int.f900000664000175000017500000000011615174404631022264 0ustar alastairalastairprogram kind_float_of_int implicit none integer(4.2) :: x end program lfortran-0.63.0/tests/errors/string_slice.f900000664000175000017500000000017215174404631021303 0ustar alastairalastairprogram string_slice implicit none character(len=8) :: s = "lfortran" print*, s(-2:6) end program string_slicelfortran-0.63.0/tests/errors/show_errors1.f900000664000175000017500000000024715174404631021256 0ustar alastairalastairsubroutine sub() end subroutine program show_errors1 implicit none integer :: x y = x = (2+3)*5 call sub() print *, xx print *, xz print *, fasldjkfh end program lfortran-0.63.0/tests/errors/cpp_err3.f900000664000175000017500000000011715174404631020332 0ustar alastairalastairprogram cpp_err3 #define f(x) x #if f(2 < 1+2 #endif print *, 'OK' end program lfortran-0.63.0/tests/errors/kind2.f900000664000175000017500000000006415174404631017625 0ustar alastairalastairprogram kind2 implicit none real(*) a end program lfortran-0.63.0/tests/errors/incorrect_type_where_01.f900000664000175000017500000000015515174404631023342 0ustar alastairalastairprogram main implicit none integer :: b(5) where(.true.) b = 12121 print *, b end program main lfortran-0.63.0/tests/errors/ichar_01.f900000664000175000017500000000011015174404631020174 0ustar alastairalastairprogram ichar_01 implicit none print*, ichar("okay") end programlfortran-0.63.0/tests/errors/allocated_05.f900000664000175000017500000000033215174404631021050 0ustar alastairalastairprogram allocated_05 implicit none integer, allocatable :: arr(:) allocate(arr(10)) allocate(arr(20)) ! Error: double allocation of array print *, "Should not reach here" end program allocated_05 lfortran-0.63.0/tests/errors/cpp_err4.f900000664000175000017500000000011115174404631020325 0ustar alastairalastairprogram cpp_err4 #include "does_not_exist.inc" print *, 'OK' end program lfortran-0.63.0/tests/errors/dfloat1.f900000664000175000017500000000007115174404631020146 0ustar alastairalastairprogram dfloat1 real :: y print *, dfloat(y) end program lfortran-0.63.0/tests/errors/close_invalid_kwarg1.f900000664000175000017500000000027215174404631022706 0ustar alastairalastairPROGRAM close_invalid_kwarg1 ! "end" is an invalid keyword argument for "CLOSE" ! it is ok to raise "end" being invalid before "unit" being absent CLOSE(end=200) END PROGRAM lfortran-0.63.0/tests/errors/program_without_line_04.f900000664000175000017500000000003015174404631023353 0ustar alastairalastairprint *, "OK" 2 + 2 end lfortran-0.63.0/tests/errors/continue_compilation_ff_2.f0000664000175000017500000000036115174404631023563 0ustar alastairalastair PROGRAM continue_compilation_ff_2 print *, "This is a test program" SUBROUTINE faulty_subroutine(a, b, c) INTEGER, INTENT(IN) :: sub_a END SUBROUTINE faulty_subroutine END PROGRAM continue_compilation_ff_2lfortran-0.63.0/tests/errors/array_bounds_check_12.f900000664000175000017500000000053515174404631022750 0ustar alastairalastairprogram array_bounds_check_12 integer, allocatable :: a(:) integer, allocatable :: e(:) allocate(a(3)) allocate(e(3)) a = 3 e = f(a) print *, e contains function f(x) result(y) integer, intent(in) :: x(:) integer :: y(size(x) - 1) y = 2 end function end program lfortran-0.63.0/tests/errors/cpp7.f900000664000175000017500000000244415174404631017473 0ustar alastairalastairprogram cpp7 ! Nested macros, tests location information implicit none #define X 5 #define Y #ifdef X # ifdef Y print *, "1a" # else print *, "1b" # endif #else # ifdef Y print *, "2a" # else print *, "2b" # endif #endif #ifdef X # ifdef Z print *, "1a" # else print *, "1b" # endif #else # ifdef Z print *, "2a" # else print *, "2b" # endif #endif #ifdef Z # ifdef Y print *, "1a" # else print *, "1b" # endif #else # ifdef Y print *, "2a" # else print *, "2b" # endif #endif #ifdef Z # ifdef Z print *, "1a" # else print *, "1b" # endif #else # ifdef Z print *, "2a" # else print *, "2b" # endif #endif ! ifndef #ifdef X # ifndef Y print *, "1a" # else print *, "1b" # endif #else # ifndef Y print *, "2a" # else print *, "2b" # endif #endif ! more nesting #ifdef X print *, "10" # ifdef Y print *, "1a0" # ifdef Z print *, "1aa" # else print *, "1ab" # endif print *, "1ac" # else print *, "1b" # endif print *, "1c" #else print *, "20" # ifdef Y print *, "20" # ifdef Z print *, "2aa" # else print *, "2ab" # endif print *, "2a" # else print *, "2b" # endif print *, "2c" #endif #ifdef X print *, "10" # ifdef Y print *, "1a0" # ifdef X print *, "1aa", z12, 5 # else print *, "1ab" # endif print *, "1ac" # endif print *, "1c" #endif end program lfortran-0.63.0/tests/errors/unterminated_ifndef_01.f900000664000175000017500000000017015174404631023126 0ustar alastairalastair#ifndef a program unterminated_ifndef_01 implicit none print *, "Hello world" end program unterminated_ifndef_01 lfortran-0.63.0/tests/errors/unterminated_if_01.f900000664000175000017500000000020215174404631022265 0ustar alastairalastair#if a #ifdef b #endif program unterminated_if_01 implicit none print *, "Hello world" end program unterminated_if_01 lfortran-0.63.0/tests/errors/array_shape_02.f900000664000175000017500000000012415174404631021412 0ustar alastairalastairprogram main integer :: x(3,2) = reshape([1,2,3,4],[2,2]) print * ,x end programlfortran-0.63.0/tests/errors/coarray_01.f900000664000175000017500000000042015174404631020552 0ustar alastairalastairprogram test integer :: val val = this_image () call co_sum (val, result_image=1) if (this_image() == 1) then write(*,*) "The sum is ", val ! prints (n**2 + n)/2, ! with n = num_images() end if end program testlfortran-0.63.0/tests/errors/data_implied_do2.f900000664000175000017500000000024115174404631021773 0ustar alastairalastairprogram data_implied_do2 implicit none integer :: k = 1 integer :: i, iarx(3) data(iarx(i), i=1, 3, k) / 1, 2, 3 / end program data_implied_do2 lfortran-0.63.0/tests/errors/fixed_form_5.f0000664000175000017500000000013415174404631021011 0ustar alastairalastair program X integer :: y y = 5abcdef + 3 500 print *, y end program lfortran-0.63.0/tests/errors/cpp6.f900000664000175000017500000000010715174404631017464 0ustar alastairalastairprogram cpp6 implicit none #include "cpp6.h" print *, "OK" end program lfortran-0.63.0/tests/errors/passing_array_01.f900000664000175000017500000000162515174404631021764 0ustar alastairalastairMODULE passing_array_01_mod implicit none INTERFACE test_01_interface MODULE PROCEDURE test_01 END INTERFACE test_01_interface CONTAINS FUNCTION test_01 (len,value) result(res) implicit none integer :: len INTEGER, DIMENSION(3,len,len),intent(in) :: value INTEGER :: res res = size(value) END FUNCTION test_01 subroutine test_entry integer:: len INTEGER, DIMENSION(6,2) :: value INTEGER :: ret len = 1 ret = test_01(len,value) ! This works with no problems. ret = test_01_interface(len,value) ! This raise error as interfaces are strict on matching the number of ranks, so it doesn't find a match. end subroutine test_entry END MODULE passing_array_01_mod program passing_array_01 use passing_array_01_mod implicit none call test_entry end program passing_array_01 lfortran-0.63.0/tests/errors/more_kwargs_than_acceptable_to_subroutine.f900000664000175000017500000000035315174404631027275 0ustar alastairalastairprogram more_kwargs_than_acceptable_to_subroutine implicit none call my_func(y=1, x=2, z=1) contains subroutine my_func(x, y) integer, intent(in) :: x, y print *, "hi" end subroutine end program lfortran-0.63.0/tests/errors/end_function_name_not_match.f900000664000175000017500000000024615174404631024327 0ustar alastairalastairreal function square(x) ! Declare the type of the argument real, intent(in) :: x ! Declare the return variable square = x * x end function square_int lfortran-0.63.0/tests/errors/derived_type_05.f900000664000175000017500000000063715174404631021613 0ustar alastairalastairmodule test private type, abstract :: tester contains procedure(testing_interface), deferred, pass(my_object), nopass :: testing end type tester abstract interface subroutine testing_interface(my_object, a, b) class(tester), intent(inout) :: my_object integer, intent(inout) :: a, b end subroutine testing_interface end interface end module test lfortran-0.63.0/tests/errors/cpp5.f900000664000175000017500000000012615174404631017464 0ustar alastairalastairprogram cpp5 implicit none #include "cpp5.h" x = (2+3)*5 print *, x, C123 end program lfortran-0.63.0/tests/errors/array_05.f900000664000175000017500000000036515174404631020244 0ustar alastairalastairmodule module_array_05 type t real, allocatable :: x(:) end type t end module module_array_05 program array_05 use module_array_05 implicit none type(t) :: type_01 allocate(type_01%x(1, 2)) end program array_05 lfortran-0.63.0/tests/errors/end_submodule_name.f900000664000175000017500000000061415174404631022444 0ustar alastairalastairmodule mother implicit none real, parameter :: pi = 4.*atan(1.) real :: tau interface module real elemental function pi2tau(pi) real, intent(in) :: pi end function pi2tau end interface contains end module mother submodule (mother) daughter implicit none contains module procedure pi2tau pi2tau = 2*pi end procedure pi2tau end submodule son lfortran-0.63.0/tests/errors/program_variable.f900000664000175000017500000000007315174404631022132 0ustar alastairalastairprogram program_variable integer bar bar = foo end program lfortran-0.63.0/tests/errors/derived_type_06.f900000664000175000017500000000045615174404631021613 0ustar alastairalastairprogram derived_type_06 implicit none TYPE test_type2 integer :: num END TYPE test_type2 TYPE test_type1 type(test_type2):: arr_2(3) END TYPE test_type1 TYPE(test_type1), DIMENSION(5) :: main_arr main_arr%arr_2%num = 22 end program derived_type_06 lfortran-0.63.0/tests/errors/floatStringInput.f900000664000175000017500000000043515174404631022134 0ustar alastairalastairprogram realStringInput implicit none real :: x open(unit=10, file="tests/invalidInput_float.txt", status="unknown") do read(10, *, end=100) x print *, "Read real number:", x end do 100 continue close(10) stop end program realStringInput lfortran-0.63.0/tests/errors/dimension_01.f900000664000175000017500000000010115174404631021073 0ustar alastairalastairprogram main integer, dimension("abcd") :: line end programlfortran-0.63.0/tests/errors/array_02.f900000664000175000017500000000011515174404631020232 0ustar alastairalastairprogram array_02 implicit none print *, [[[], [[]]], [[]], []] end program lfortran-0.63.0/tests/errors/incompatible_ranks_allocatable_arr1.f900000664000175000017500000000035715174404631025737 0ustar alastairalastairprogram incompatible_ranks_allocatable_arr1 implicit none ! allocatable array of rank 2 integer, allocatable :: arr1(:, :) ! RHS is a constant array of rank 1 ! incompatible assignment arr1 = [1, 2, 3] end program lfortran-0.63.0/tests/errors/private2.f900000664000175000017500000000017015174404631020350 0ustar alastairalastairmodule foo2 private real :: y = 2 end module program test use foo2, only: y print *, y end program lfortran-0.63.0/tests/errors/substring_stride.f900000664000175000017500000000023415174404631022207 0ustar alastairalastairprogram substring_noninteger_stride implicit none character(len=8) :: s = "lfortran" print*, s(1:5:2.2) end program substring_noninteger_stride lfortran-0.63.0/tests/errors/kind_star_of_int.f900000664000175000017500000000011015174404631022122 0ustar alastairalastairprogram kind_star_of_int implicit none integer(*) a end program lfortran-0.63.0/tests/errors/string_slice2.f900000664000175000017500000000021715174404631021365 0ustar alastairalastairprogram string_slice2 implicit none character(len=8) :: s = "lfortran" print*, "Length of s:", len(s) print*, s(1: 9) end programlfortran-0.63.0/tests/errors/intrinsics15.f900000664000175000017500000000010115174404631021141 0ustar alastairalastairprogram intrinsics15 print *, set_exponent([1, 2, 3], 2) end lfortran-0.63.0/tests/errors/array_constructor_with_different_char_lengths.f900000664000175000017500000000015115174404631030200 0ustar alastairalastairprogram array_constructor_with_different_char_lengths print *, ["a", "b", "ball", "cat"] end program lfortran-0.63.0/tests/errors/write_02.f900000664000175000017500000000056415174404631020256 0ustar alastairalastairprogram write_02 implicit none character(len=*), parameter :: temp_file = "lfortran_temporary_file_write_02.dat" character(len=*), parameter :: test_line = "HelloWorld!" integer :: unit, ios ios = 0 unit = 1 open(newunit=unit, form="unformatted", file=temp_file) !unformatted write(unit,*) test_line !formatted close(unit) end programlfortran-0.63.0/tests/errors/infer_mode_conflict_01.f900000664000175000017500000000010215174404631023077 0ustar alastairalastairprogram infer_mode_conflict_01 end program infer_mode_conflict_01 lfortran-0.63.0/tests/errors/c_f_pointer_01.f900000664000175000017500000000025615174404631021410 0ustar alastairalastairprogram c_f_pointer_01 use iso_c_binding, only: c_ptr, c_f_pointer type(c_ptr) :: queries integer, pointer :: x call c_f_pointer(queries, x, [2]) end program lfortran-0.63.0/tests/errors/array_shape_01.f900000664000175000017500000000012715174404631021414 0ustar alastairalastairprogram main integer :: x(3,2) x = reshape([1,2,3,4],[2,2]) print * ,x end programlfortran-0.63.0/tests/errors/program_without_line_03.f900000664000175000017500000000004015174404631023353 0ustar alastairalastairprint *, "OK" end print *, "OK" lfortran-0.63.0/tests/errors/allocate_02.f900000664000175000017500000000043715174404631020707 0ustar alastairalastairprogram allocate_66 implicit none type :: T integer :: x = 0 end type T class(T), allocatable :: obj allocate(obj, source = get_return()) contains function get_return() result(r) class(T), allocatable :: r end function get_return end program allocate_66 lfortran-0.63.0/tests/errors/template_error_01b.f900000664000175000017500000000430215174404631022303 0ustar alastairalastairmodule template_travel_01b_m implicit none private public :: travel_tmpl requirement operation(A, B, C, op) type, deferred :: A type, deferred :: B type, deferred :: C pure function op(l, r) result(res) type(A), intent(in) :: l type(B), intent(in) :: r type(C) :: res end function end requirement template travel_tmpl(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) require :: operation(D, D, D, plus_D) !require :: operation(T, T, T, plus_T) require :: operation(D, T, S, D_divided_by_T) require :: operation(D, S, T, D_divided_by_S) private public :: avg_S_from_T, avg_S_from_S contains pure function avg_S_from_T(d1, t1, d2, t2) result(avg) type(D), intent(in) :: d1, d2 type(T), intent(in) :: t1, t2 type(S) :: avg avg = D_divided_by_T(plus_D(d1, d2), plus_T(t1, t2)) end function pure function avg_S_from_S(d1, s1, d2, s2) result(avg) type(D), intent(in) :: d1, d2 type(S), intent(in) :: s1, s2 type(S) :: avg avg = avg_S_from_T(d1, D_divided_by_S(d1, s1), d2, D_divided_by_S(d2, s2)) end function end template contains subroutine test_template() instantiate travel_tmpl(real, real, real, operator(+), operator(+), operator(/), operator(/)), & only: avg_real_S_from_T => avg_S_from_T, avg_real_S_from_S => avg_S_from_S instantiate travel_tmpl(integer, integer, integer, operator(+), operator(+), operator(/), operator(/)), & only: avg_integer_S_from_T => avg_S_from_T, avg_integer_S_from_S => avg_S_from_S real :: s1, s2 integer :: i1, i2 s1 = avg_real_S_from_T(1.0, 3.0, 1.5, 4.0) s2 = avg_real_S_from_S(1.1, s1, 2.0, s1) i1 = avg_integer_S_from_T(1, 3, 20, 4) i2 = avg_integer_S_from_S(1, i1, 15, i1) print *, "s1=", s1 print *, "s2=", s2 print *, "i1=", i1 print *, "i2=", i2 end subroutine end module program template_travel_01b use template_travel_01b_m implicit none call test_template() end programlfortran-0.63.0/tests/errors/continue_compilation_3.f900000664000175000017500000001174515174404631023272 0ustar alastairalastair! If you need a function, put it into the module below and remove the same ! number of lines below the module to keep the rest of the lines in this file ! intact. module continue_compilation_3_mod contains subroutine check_incompatible_type(i) real :: i end subroutine check_incompatible_type subroutine intent_out_test(x) integer, intent(out) :: x x = 42 end subroutine intent_out_test subroutine intent_inout_test(y) integer, intent(inout) :: y y = y + 1 end subroutine intent_inout_test subroutine assumed_rank(x) integer, intent(in) :: x(..) print *, x print *, reshape(x, [size(x)]) print *, x(1) x = [1, 2] print *, (x /= [1, 2]) end subroutine assumed_rank subroutine ss(x) character(:), allocatable :: x x = "AB" ! allocates x with length 2 end subroutine ss end module continue_compilation_3_mod ! Only put declarations and statements here, no subroutines (those go above). program continue_compilation_3 use continue_compilation_3_fake_module use continue_compilation_3_mod ! Put declarations below without empty lines implicit none integer :: a(5), b(10), x1(3,2), c, a1(3), i, k = 3, x character(4) :: str(3) integer, parameter :: x3 = 2 character(len=8) :: s, s1 = "lfortran" rea :: test_real(12) real :: test_re() int :: type :: t integer :: xx end type type(t) :: y integer :: merge_i = 4, merge_j = 5 integer(8) :: merge_k = 8 integer :: arr_nc(minval(abs(a))) call intent_out_test(1) ! Error: literal constant with intent(out) call intent_out_test(x + 1) ! Error: expression with intent(out) call intent_inout_test(2) ! Error: literal constant with intent(inout) call intent_inout_test(x * 2) ! Error: expression with intent(inout) call check_incompatible_type(i) ! Error: incompatible type passed print *, iachar(s1) ! array_01_cc a = [] ! array_02_cc print *, [[[], [[]]], [[]], []] print *, [[[], [[]]], []] ! array_03_cc b(:,:) = 1 b(:,:) = 2 ! array_04_cc y%xx(:) = 1 ! array_06_cc str(1, 2)(:) = '1234' str(1,2,3)(:) = '1234' ! array_constructor_with_asterisk_in_type_spec_cc print *, [character(*) :: "a", "b", "ball", "cat"] print *, [character(*) :: "a2", "b2", "ball2", "cat2"] !array_shape_01_cc x1 = reshape([1,2,3,4],[2,2]) x1 = reshape([1,2,3,4],[1,2]) !arithmetic_if1_cc i = -3 c = 0 if ("yy") 1, 2, 3 1 c = c + 1 2 c = c + 2 3 c = c + 4 print *, c if (c /= 7) error stop !array_size_01_cc i = size(a1, 1, 4, kind=4) i = size() !assign_01_cc x3 = 1 print *, x3 ! data_implied_do1 data(a1(i), i=1, k) / 1, 2, 3 / ! data_implied_do2 data(a1(i), i=1, 3, k) / 1, 2, 3 / ! data_implied_do3 data(a1(i), i=k, 3) / 1, 2, 3 / !program_variable i = foo !rewind_invalid_kwarg1 rewind(end="world") !sign_01 print *, sign(1, 1_8) !specific_type_intrinsic print*, dabs(1) !sqrt_neg print *, sqrt(-1.0) !string_binop print *, "a" + "b" !string_negative_start_index s = "lfortran" print*, "s:", s(-1:4) !string_slice print*, s1(-2:6) !string_slice2 print*, "Length of s:", len(s) print*, s1(1: 9) !substring_noninteger_endidx print*, s1(1:5.2) !substring_noninteger_startidx print*, s1(1.1:5) !substring_noninteger_stride print*, s(1:5:2.2) !type_mismatch1 x = "x" !type_mismatch2 x = 5 + "x" !subroutine1, subroutine2, subroutine3, subroutine5 call bpe() i = bpe() print *, xx test_re = 1245.13 c(1) = 1 integer :: i_incorrect_pragma !LF$unroll 4 ! Error: Missing space after `!LF$` do i_incorrect_pragma = 1, 10 print *, i_incorrect_pragma end do !merge_bits print *, merge_bits(1, 2, 3_8) print *, merge_bits(merge_i,merge_j,merge_k) ! adding the new test for performing logical .and. between int-logical type. !and_mismatch_int_logical print *, 5 .and. .true. !and_mismatch_real_logical print *, 3.14 .and. .false. !and_okay_int_int print *, 5 .and. 6 !adding a few more cases print *, 5 .or. 6 print *, 5 .eqv. 6 print *, .true. .neqv. 6 print *, 3.14 .and. "abcd" print *, "abcd" .neqv. "cdef" print *, 1 .neqv. 2 print *, [1,2,3] .and. .true. print *, [1.0, 2.0] .or. [3.0, 4.0] print *, "str1" .or. "str2" print *, "x" .and. .false. print *, .NOT. "lf" print *, "8356" .or. 8356 print *, "8356" .eqv. 8356.00 print *, ['c', 'o', 'd', 'e'] .or. ['m', 'a', 's'] print *, ["welcome", "to", "lf"] .and. "contributors" !even size diff of array element must be caught print *, [( '*',i , i = 1, 10 )] call ss("hello") contains subroutine bpe() print *, size(bpe) bpe = d end subroutine end program lfortran-0.63.0/tests/errors/derived_type_04.f900000664000175000017500000000054015174404631021603 0ustar alastairalastairmodule test private type, abstract :: tester contains procedure(testing_interface), deferred, pass(my_object) :: testing end type tester abstract interface subroutine testing_interface(a, b, c) integer, intent(inout) :: a, b, c end subroutine testing_interface end interface end module test lfortran-0.63.0/tests/errors/cpp_err5.f900000664000175000017500000000010015174404631020324 0ustar alastairalastairprogram cpp_err5 #if 1 + @ 1 2 #endif print *, 'OK' end program lfortran-0.63.0/tests/errors/do_concurrent1.f900000664000175000017500000000030115174404631021535 0ustar alastairalastairprogram do_concurrent1 implicit none integer, parameter :: Nx = 600, Ny = 450 integer :: i, j, image(Nx, Ny) do concurrent (j = 1:Ny) local(i, j) do i = 1, Nx end do end do end program lfortran-0.63.0/tests/errors/program_without_line_cc.f900000664000175000017500000000002715174404631023523 0ustar alastairalastairprint *, "OK" contains lfortran-0.63.0/tests/errors/loop_test.f900000664000175000017500000000014715174404631020630 0ustar alastairalastairprogram loop_test integer :: i do i=1,3 i = i + 1 print*,i end do end programlfortran-0.63.0/tests/errors/idint_real4.f900000664000175000017500000000006715174404631021017 0ustar alastairalastairprogram idint_real print *, idint(4.5) end program lfortran-0.63.0/tests/errors/dreal_arg_error.f900000664000175000017500000000013615174404631021747 0ustar alastairalastairprogram dreal_arg_error complex :: a a = (1.0, 2.0) print *, dreal(a) end programlfortran-0.63.0/tests/errors/fixed_form_4.f0000664000175000017500000000015415174404631021012 0ustar alastairalastair program X integer :: y y = 5 500 print *, sin), y print *, "OK" end program lfortran-0.63.0/tests/errors/intrinsics1.f900000664000175000017500000000013515174404631021063 0ustar alastairalastairprogram intrinsics1 implicit none print *, radix((2.4, 1.0)) end program intrinsics1 lfortran-0.63.0/tests/errors/cpp8.f900000664000175000017500000000031115174404631017463 0ustar alastairalastair!test location information for errors program test #ifdef SOMETHING #endif // This should work implicit none integer :: abc = 10 /* hi*/ print *, "asdjfal" print *, abcx end program test lfortran-0.63.0/tests/errors/parameter_01.f900000664000175000017500000000012715174404631021076 0ustar alastairalastairprogram parameter_01 integer, parameter :: i = 2 i = 3 print*,i end programlfortran-0.63.0/tests/errors/substring_startidx.f900000664000175000017500000000023615174404631022561 0ustar alastairalastairprogram substring_noninteger_startidx implicit none character(len=8) :: s = "lfortran" print*, s(1.1:5) end program substring_noninteger_startidx lfortran-0.63.0/tests/errors/ifix_01.f900000664000175000017500000000006615174404631020057 0ustar alastairalastairprogram ifix_01 print *, ifix(4.23_8) end program lfortran-0.63.0/tests/errors/array_04.f900000664000175000017500000000015115174404631020234 0ustar alastairalastairprogram array_04 implicit none type :: t integer :: a end type type(t) :: b b%a(:) = 1 end program lfortran-0.63.0/tests/errors/array_bounds_check_15.f900000664000175000017500000000014615174404631022751 0ustar alastairalastairprogram array_bounds_check_15 implicit none integer, allocatable :: x(:) print *, x end lfortran-0.63.0/tests/errors/scalar_allocation_check_03.f900000664000175000017500000000025615174404631023732 0ustar alastairalastairprogram scalar_allocation_check_03 implicit none type :: base integer :: x end type type(base), allocatable :: var print *, var%x end program lfortran-0.63.0/tests/errors/implicit_call_02.f900000664000175000017500000000065715174404631021734 0ustar alastairalastair! Test: Array kind mismatch via implicit interface ! With --implicit-interface --implicit-argument-casting, passing integer(8) ! array to integer(4) parameter should produce semantic error. program implicit_call_02 implicit none integer(8) :: arr(2) arr(1) = 100 arr(2) = 200 call test_sub(arr) end program subroutine test_sub(x) implicit none integer(4) :: x(2) print *, x(1), x(2) end subroutine lfortran-0.63.0/tests/errors/array_size_05.f900000664000175000017500000000024315174404631021271 0ustar alastairalastairprogram array_size_05 implicit none integer :: a(3) integer :: size_a integer :: kindvar = 4 size_a = size(a, kind=kindvar, dim=1) end program lfortran-0.63.0/tests/errors/template_error_05.f900000664000175000017500000000212415174404631022145 0ustar alastairalastairmodule template_error_05_m implicit none private public :: add_t requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = F(x, y) end function end template contains integer function func_arg_real(x, y) result(z) real, intent(in) :: x, y z = x + y end function subroutine test_template() instantiate add_t(real, func_arg_real), only: add_real => add_generic real :: x, y x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) if (abs(add_real(x, y) - 12.3) > 1e-5) error stop end subroutine end module program template_error_05 use template_error_05_m implicit none call test_template() end program template_error_05 lfortran-0.63.0/tests/errors/array_bounds_check_03.f900000664000175000017500000000013615174404631022745 0ustar alastairalastairprogram array_bounds_check_03 integer, allocatable :: x(:) x = [1, 2, 3] end program lfortran-0.63.0/tests/errors/continue_compilation_1.f900000664000175000017500000004313615174404631023267 0ustar alastairalastair! If you need a function, put it into the module below and remove the same ! number of lines below the module to keep the rest of the lines in this file ! intact. module continue_compilation_1_mod use, intrinsic :: ieee_arithmetic, only: ieee_class, ieee_quiet_nan, ieee_class_type type :: MyClass integer :: value contains procedure :: display end type MyClass type :: logger_type contains private procedure, public, pass(self) :: add_log_file end type logger_type type(MyClass), PROTECTED :: protected_module_my_class_obj ! Test for Missing Declaration: type :: ctx_missing_t procedure(f_missing), pointer, nopass :: fn => null() end type procedure(missing_global_interface), pointer :: p => null() interface assignment(=) module procedure assign_func_bad module procedure assign_wrong_nargs module procedure assign_bad_lhs module procedure assign_bad_rhs end interface interface operator(.op.) function op_clash_f(x) result(y) integer, intent(in) :: x integer :: y end function end interface type :: Base integer :: x end type Base interface frexp function frexp(x,n) result(r) real r real, intent(in), value :: x integer, intent(out) :: n end function frexp end interface frexp interface frexp_duplicate subroutine frexp(x,n) real r real, intent(in), value :: x integer, intent(out) :: n end subroutine frexp end interface type, extends(Base) :: Derived real :: r end type Derived type :: type_t end type type_t contains subroutine my_undefined_type_test() implicit none type(another_undefined_type) :: s3_in_subroutine end subroutine my_undefined_type_test subroutine my_func(x, y) integer, intent(in) :: x, y print *, "hi" end subroutine subroutine display(self, extra_arg) class(MyClass), intent(in) :: self integer, intent(in) :: extra_arg print *, "Value in object:", self%value end subroutine display subroutine add_log_file(self, filename, unit) class(logger_type), intent(inout) :: self character(*), optional :: filename integer :: unit filename = "lfortran" unit = 10 end subroutine add_log_file subroutine s(c) bind(c) use iso_c_binding character(len=2, kind=c_char), intent(in) :: c end subroutine s subroutine ubound_assumed_size(a, b, c) real :: a(*) real :: b(*) real :: c(10, *) print *, ubound(a, 1) print *, ubound(b) print *, ubound(c, 2) end subroutine subroutine assumed_size_star_pos_1(a) real, intent(in) :: a(*, 10) end subroutine subroutine assumed_size_star_pos_2(a) real :: a(*, 10) end subroutine subroutine proc_param(p) procedure(ubound_assumed_size) :: p end subroutine proc_param subroutine modify_and_deallocate(s) character(5), allocatable :: s deallocate(s) end subroutine modify_and_deallocate subroutine intrinsic_polymorphic(generic) class(*), intent(in) :: generic print *, trim(generic) print *, adjustl(generic) print *, adjustr(generic) print *, len_trim(generic) end subroutine intrinsic_polymorphic integer function assign_func_bad(lhs, rhs) integer, intent(out) :: lhs integer, intent(in) :: rhs assign_func_bad = rhs end function assign_func_bad subroutine assign_wrong_nargs(lhs) integer, intent(out) :: lhs end subroutine assign_wrong_nargs subroutine assign_bad_lhs(lhs, rhs) integer, intent(in) :: lhs integer, intent(in) :: rhs end subroutine assign_bad_lhs subroutine assign_bad_rhs(lhs, rhs) integer, intent(out) :: lhs integer, intent(out) :: rhs end subroutine assign_bad_rhs subroutine slash_init_warning_paths() enum, bind(c) enumerator :: red/1/ end enum type(MyClass), save :: slash_x/MyClass(1)/ integer, save :: slash_y/2/ end subroutine slash_init_warning_paths function dummy_func() result(r) integer :: r r = 42 end function dummy_func subroutine dummy_sub() print *, "dummy subroutine" end subroutine dummy_sub subroutine proc_ptr_error_tests() implicit none procedure(), pointer :: pf1 pf1 => dummy_sub procedure(sub_test), pointer :: pf2 pf2 => dummy_func end subroutine proc_ptr_error_tests function op_clash_f(x) result(y) integer, intent(in) :: x integer :: y y = x end function op_clash_f end module ! Only put declarations and statements here, no subroutines (those go above). program continue_compilation_1 use continue_compilation_1_mod implicit integer(a-f), real(e-z) ! Put declarations below without empty lines integer :: a(3), b(3), b1(3, 3), a3(3, 3, 3), b4(3, 3, 3, 3), a5, c5, i, arr1(3), arr2(2, 3), arr3(2, 1, 3) character :: a1(3, 3) logical :: a2(3, 3), mask1(3), mask2(2, 3), mask3(2, 1, 3), mask4(3, 2), mask5(2, 3, 1), y integer(kind=8) :: b5 real(8) :: y1 real :: z1 integer, parameter :: i1 = 2 character(len=5) :: string = "hello" character(len=1) :: set(2) = ["l", "h"] integer :: q1 real :: r1 character :: c1 complex :: c = (1.0, 2.0) real a_real(0) integer, allocatable :: shape_(:), arr4(:), arr5(:) integer, dimension(2, 3) :: matrix integer, dimension(4) :: source = [1, 2, 3, 4] allocate(shape_(2)) real :: v character(10) :: str character(3), parameter :: ar1 = repeat(["abc", "#^1", "123"], [1, 2, 3]) integer, parameter :: zero = 0 integer :: x = 1 real :: adwf = .true. integer, volatile :: volatile_var dimension array(3) double precision array integer , dimension(3) :: array type(logger_type) :: logger integer :: unit character(len=100) :: filename type(MyClass), parameter :: myclass_array(2) = [1, MyClass(10)] type(MyClass), parameter :: myclass_array2(2) = [MyClass(1), MyClass(q1)] character(width=10) :: str_c_1 character(len=10, len=20) :: str_c_2 character(len=10, 1) :: str_c_3 character(1, len=20) :: str_c_4 character(:), allocatable :: x(2) integer, dimension(:,:), allocatable :: arr_size logical :: mask_size(size(arr_size)) integer, protected :: protected_attr_var integer, parameter, protected :: protected_parameter_var type(MyClass) :: v1, v2, v3 type(MyClass) :: arr(3) integer :: n = 2 type :: matrix integer :: elements(n) end type type(bspline_3d) :: s3_in_program integer :: j2, i2, k2(2), x2(2), y2(3) integer::tt = b'01' * 3 integer :: fmt_i1, fmt_i2, fmt_i3 ! for issue #8925 integer, allocatable :: allocate_int = 1 character(:), allocatable :: allocate_char = "H" intrinsic :: not_real call sub(not_real) integer :: param_arr(3) = [5, 10, 15] integer, parameter :: param_minloc = minloc(param_arr, 1, [.false., .false., .false.]) integer :: cc_a3(2) = [2, 3] integer :: cc_temp3(2) integer :: cc_i0 = 1 integer :: cc_a4(2) integer :: cc_temp4(5) integer :: cc_i1 = 1 character(10) :: strx type(MyClass), parameter :: uninitialized_param_local type(MyClass) :: err_obj1 = non_existent_symbol type(MyClass) :: err_obj2 = my_func integer :: non_parameter_var = 5 type(MyClass) :: err_obj3 = non_parameter_var type(MyClass) :: err_obj4 = myclass_array type(MyClass) :: err_obj5 = uninitialized_param_local ! Unary defined operator with missing procedure interface operator(.bad.) module procedure bad_op end interface integer :: bad_x type(ieee_class_type) :: ieee_cls type(Base) :: base_var type(Derived) :: derived_var class(type_t) :: inst_tt real(8), parameter :: erfc_param = erfc(40.12_8) integer :: arr_idl(4) contiguous :: contig_not_declared contiguous :: MyClass class(Derived), allocatable :: derived_cls ! Use the space above to insert new declarations, and remove the line, so ! that the lines below do not shift, to keep the diff minimal. ! ! Only put statements below. If you need to call a function, put it into a ! module above. a = 1 print *, a(10) a5 = 8 b5 = 12_8 c5 = 2 !loop_test do i=1,3 i = i + 1 print*,i end do !maskl_incorrect_bit_size print*, maskl(63) !maskr_incorrect_bit_size print*, maskr(63) !maskl_negative print*, maskl(-24) !maskr_negative print*, maskr(-24) !matrix_matmul_01 print *, matmul(a1, b1) !matrix_matmul_02 print *, matmul(b1, a1) !matrix_matmul_03 print *, matmul(a2, b1) !matrix_matmul_04 print *, matmul(a3, b1) !matrix_matmul_05 print *, matmul(b1, b4) !matrix_matmul_06 print *, matmul(a, b) !matrix_transpose_01 print *, transpose(a) !merge_bits_comp print *, merge_bits(8, 12_8, 2) !merge_bits_run print *, merge_bits(a5, b5, c5) !Does not work correctly : Issue: #5469 ------------- ! !max_01 ! y1 = 5.2d0 ! z1 = 9.0 ! print *, max(y1, z1) ! !max_02 ! print *, max(b5, a5) ! !min_01 ! print *, min(y1, z1) ! !min_02 ! print *, min(b5, a5) !------------------------------ !modulo_01 print *, modulo(1, 0) !more_kwargs_than_acceptable_to_subroutine call my_func(y=1, x=2, z=1) !nint_overflow print*, nint(1e12_8) print*, nint(1000000000000.0000000000000000d0) ! open_invalid_kwarg1 OPEN(file="numbers", hello="world") !parameter_01 i1 = 3 print*,i1 call FLUSH(1, 2) print*, verify(string, set, kind= [4, 4] ) print *, and([1, 2, 3], [1, 2, 3]) print *, dshiftl(1, 2, 34) print *, dshiftl(1, 2, -2) print *, dshiftr(1, 2, 34) print *, dshiftr(1, 2, -2) print *, selected_int_kind([1,2,3]) print *, selected_real_kind([1,2,3]) print *, selected_char_kind(['c', 'a', 'b']) arr1 = reshape([1, 2, 3], [3]) arr2 = reshape([1, 2, 3, 4, 5, 6], [2, 3]) arr3 = reshape([1, 2, 3, 4, 5, 6], [2, 1, 3]) mask1 = reshape([.true., .false., .true.], [3]) mask2 = reshape([.true., .false., .true., .true., .false., .true.], [2, 3]) mask3 = reshape([.true., .false., .true., .true., .false., .true.], [2, 1, 3]) print *, sum(arr1, dim = 2) print *, sum(arr1, dim = -1) print *, sum(arr1, mask = mask1, dim = 2) print *, sum(arr1, mask = mask1, dim = -1) print *, product(arr2, dim = 3) print *, product(arr2, dim = -1) print *, product(arr2, mask = mask2, dim = 3) print *, product(arr2, mask = mask2, dim = -1) print *, iparity(arr3, dim = 4) print *, iparity(arr3, dim = -1) print *, iparity(arr3, mask = mask3, dim = 4) print *, iparity(arr3, mask = mask3, dim = -1) if (q1) q1 = 1 if (r1) r1 = 1.0 if (c1) c1 = 'a' mask4 = reshape([.true., .false., .true., .true., .false., .true.], [3, 2]) mask5 = reshape([.true., .false., .true., .true., .false., .true.], [2, 3, 1]) print *, sum(arr1, mask2) print *, sum(arr2, mask3, 2) print *, iparity(arr2, mask4) print *, iparity(arr3, mask5, 3) ! argument_not_a_variable print *, present(a + 1) ! argument_not_optional print *, present(a) print *, pack([1, 2, 3], [.true., .true., .true., .true.]) print *, reshape("hello", [2, 3]) print *, reshape(.true., [2, 3]) print *, reshape([1, 2, 3, 4], "hello") print *, reshape([1, 2, 3, 4], .false.) print *, reshape([1, 2, 3, 4], [2, 3]) ! Division by zero print *, 1/0 print *, x/zero print *, v**str print *, str**v print *, shiftl(2, 34) print *, shiftl(2, -3) print *, shiftr(2, 34) print *, shiftr(2, -3) print *, rshift(2, 34) print *, rshift(2, -3) print *, sum([c1]) print *, product([c1]) print *, minval([c]) print *, maxval([c]) print *, sum(q1) print *, product(r1) print *, minval(q1) print *, maxval(r1) print *, sum([1, 2, 3], mask = [1, 2, 3]) z1 = y print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], 0) print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], [0], 0) print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], [1.2]) print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], [0_8]) print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], order = [1.0, 2.0]) print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], order = [2, 3]) print *, count(1) print *, count([2]) a_real = [logical::] print *,size(a_real) print *, iparity(["a", "b"]) print *, parity(["a", "b"]) shape_ = [2, 3] matrix = reshape(source, shape_, pad=[0]) deallocate(shape_) ! c is Complex print *, c%mymember ! c1 is Character print *, c1%mymember print *, present(x,x) print *, present() print *, ieor(x) print *, ieor() exit ! calling function with less arguments call my_func(10) call my_func() ! checking for self argument too type(MyClass) :: obj obj%value = 42 call obj%display() ! checking source in allocate allocate(arr4(5), source=[1, 2, 3]) allocate(arr4(5), source=v) allocate(arr4(3), source=reshape([1, 2, 3, 4, 5, 6], [2, 3])) allocate(arr4, source=7) call logger % add_log_file(filename=filename) call logger % add_log_file() allocate(arr5, status=q1) allocate(arr5, mold = arr4) print *, ["aa", "aaa"] cc_a3 = cc_temp3(cc_i0:cc_i0) print *, pack(arr2, mask1) print *, size(cc_a3) ! assigning to a *PROTECTED* struct instance member, not allowed protected_module_my_class_obj%value = 42 cc_a4 = cc_temp4(cc_i1+1:cc_i1+1) arr = [type(MyClass) :: v1, v2, v3] print *, size(cc_a4) arr = [NonExistingType :: v1, v2, v3] !Data Statements with different number of arguments on LHS and RHS data j2, x2, (y2(i2), i2=1,3), k2 / 1,2,3,4,5,6,7,3*8 / q1: do q1 = 1, 3 print *, q1 end do q1 ! Test assigned format WRITE ASSIGN 0012 TO fmt_i1 0012 FORMAT (" **** ASSIGN FORMAT NUMBER TO INTEGER VARIABLE ****" ) WRITE (6, fmt_i1) ! Test assigned format PRINT assign 100 to fmt_i2 100 format (A) print fmt_i2, "test" ! Test assigned format READ assign 13 to fmt_i3 13 format () read (5, fmt_i3) !passing non procedure to procedure parameter call proc_param(42) x = 9010 read (*, end=x) x read (*, end=9011.0) x x = 9012 read (*, err=x) x read (*, err=9013.0) x write (*, end=9014) x 9014 continue write (*, err=9015) x 9015 continue read(*, *, end=999) x read(*, *, err=500) x OPEN(unit=10, recl=10, recl=20) OPEN(unit=10, recl=10.5) i = 1 print *, string(i,i) allocate(strx) strx = "hello12345" call modify_and_deallocate(strx) print *, allocated(strx) call intrinsic_polymorphic(" Hello World ") OPEN(unit=10, encoding="UTF-8", encoding="UTF-8") OPEN(unit=10, encoding=10) character(len=10) :: str_var read(str_var, rec=1) x write(str_var, rec=1) x read(unit=10, rec=1, rec=2) y write(unit=10, rec=1, rec=2) y read(10, rec=1.5) y write(10, rec=2.5) y ! unary defined operator with no matching function bad_x = .bad. 10 bad_x = 5 .op. 3 ieee_cls = ieee_class(0.0) b = (ieee_cls == ieee_quiet_nan) integer, intent(out) :: out_intent integer, intent(in) :: in_intent base_var = derived_var type :: container(rk, ik) integer, kind :: rk integer, kind :: ik integer(kind=ik) :: i_val(20) real(kind=rk) :: r_val(20) end type container type(container(4)) :: obj1 type(container) :: obj2 arr_idl = (i, i = 1, 4) integer :: minloc_shape_mismatch = minloc([2, 1, 3], 1, [.true., .false.]) integer :: maxloc_shape_mismatch = maxloc([2, 1, 3], 1, [.true., .false.]) write (*, "(a)", advance="hello") "Dothraki culture" print *, sum(arr1, dim = mask1) print*, ieee_is_nan(1.0) open(unit=7, decimal=1, decimal="comma") open(unit=7, decimal="POINT", decimal="comma") integer :: char_len_var = 10 character(len = char_len_var) :: char_nonconst interface undeclared_iface module procedure undeclared_proc ! {Error} Symbol 'undeclared_proc' not declared end interface integer, parameter :: n2 = "abc" type(MyClass) :: ptr_src_no_target type(MyClass), pointer :: ptr_requires_target => ptr_src_no_target type(Base), target :: ptr_tgt_base type(MyClass), pointer :: ptr_type_mismatch => ptr_tgt_base a(1) = .true. derived_cls = base_var contains subroutine test_uminus_struct() use continue_compilation_1_mod, only: MyClass implicit none type(MyClass) :: tt print *, -tt end subroutine subroutine sub(f) interface function f(x) integer :: x, f end function end interface end subroutine subroutine sub_do_undeclared() implicit none integer :: n(3) do k = 1, 3 n(k) = 42 end do end subroutine subroutine sub_real_logical_init() implicit none real :: adwf = .true. end subroutine subroutine sub_abs_array_index() implicit none integer(4) :: arr1(3) = [2471095, 820012001, 39024800] if (abs(arr1)(1) /= 2471095) error stop end subroutine end program lfortran-0.63.0/tests/errors/template_error_09.f900000664000175000017500000000151615174404631022155 0ustar alastairalastairmodule std_prop_m implicit none public requirement magma_r(T, bin) type, deferred :: T pure elemental function bin(x, y) result(bin) type(T), intent(in) :: x type(T), intent(in) :: y type(T) :: bin end function end requirement template commutative_prop(T,bin) require :: magma_r(T,bin) contains pure function commutative_p(x, y) result(prop) type(T), intent(in) :: x, y type(logical) :: prop prop = bin(x,y) == bin(y,x) end function end template end module std_prop_m program test_intrinsic_p use std_prop_m instantiate commutative_prop(integer,operator(+)), only: int_plus_comm => commutative_p print *, "test commutative" print *, "int_plus_comm: ", int_plus_comm(3,4) end program lfortran-0.63.0/tests/errors/kind_invalid_int_of_logical.f900000664000175000017500000000012315174404631024275 0ustar alastairalastairprogram kind_invalid_of_logical implicit none logical(10) :: x end program lfortran-0.63.0/tests/errors/do_loop_01.f900000664000175000017500000000023715174404631020553 0ustar alastairalastairprogram main implicit none integer :: i, j do i = 1, 10 do j = 1, 2 i = j + 1 end do j = i + 1 print *, i, j end do end program lfortran-0.63.0/tests/errors/fixed_form_2.f0000664000175000017500000000012315174404631021004 0ustar alastairalastair program X integer :: y y = 5x 500 print *, y end program lfortran-0.63.0/tests/errors/float1.f900000664000175000017500000000006715174404631020007 0ustar alastairalastairprogram float1 real :: y print *, float(y) end program lfortran-0.63.0/tests/errors/array_bounds_check_04.f900000664000175000017500000000033515174404631022747 0ustar alastairalastairprogram array_bounds_check_04 integer, allocatable :: x(:,:) allocate(x(3, 4)) call my(x) contains subroutine my(x) integer, intent(in) :: x(3, 1) end subroutine end program lfortran-0.63.0/tests/errors/array_constructor_with_asterisk_in_type_spec.f900000664000175000017500000000017015174404631030100 0ustar alastairalastairprogram array_constructor_with_asterisk_in_type_spec print *, [character(*) :: "a", "b", "ball", "cat"] end program lfortran-0.63.0/tests/errors/scalar_allocation_check_05.f900000664000175000017500000000023215174404631023726 0ustar alastairalastairprogram scalar_allocation_check_05 implicit none type m integer, allocatable :: x end type type(m) :: m1 print *, m1%x end lfortran-0.63.0/tests/errors/array_06.f900000664000175000017500000000015615174404631020243 0ustar alastairalastairprogram array_06 implicit none character(4) :: str(3) str(1, 2)(:) = '1234' end program array_06 lfortran-0.63.0/tests/errors/allocate_03.f900000664000175000017500000000032115174404631020700 0ustar alastairalastairprogram allocate_03 implicit none type :: T integer :: x = 5 end type T type(T), allocatable :: src, obj allocate(obj, source = src) print *, "SHOULD NOT REACH" end program allocate_03 lfortran-0.63.0/tests/errors/fixed_form_3.f0000664000175000017500000000015215174404631021007 0ustar alastairalastair program X integer :: y y = 5 500 print *, sin(y print *, "OK" end program lfortran-0.63.0/tests/errors/merge_bits_run.f900000664000175000017500000000022315174404631021617 0ustar alastairalastairprogram merge_bits_run integer :: a, c integer(kind=8) :: b a = 8 b = 12_8 c = 2 print *, merge_bits(a, b, c) end program lfortran-0.63.0/tests/errors/kind_01.f900000664000175000017500000000012015174404631020034 0ustar alastairalastairprogram kind_01 implicit none print *, aint([1.0, 2.0, 3.0], [4, 4]) endlfortran-0.63.0/tests/errors/array_03.f900000664000175000017500000000011115174404631020227 0ustar alastairalastairprogram array_03 implicit none integer :: a(10) a(:,:) = 1 end program lfortran-0.63.0/tests/errors/kind1.f900000664000175000017500000000010615174404631017621 0ustar alastairalastairprogram main implicit none real(3) :: x end program lfortran-0.63.0/tests/errors/incorrect_type_where_04.f900000664000175000017500000000034115174404631023342 0ustar alastairalastairmodule main_module implicit none character(5), parameter :: c = "hello" end module main_module program main use main_module implicit none integer :: b(5) where(c) b = 12121 print *, b end program main lfortran-0.63.0/tests/errors/matrix_transpose_01.f900000664000175000017500000000015015174404631022514 0ustar alastairalastairprogram matrix_transpose_01 implicit none integer :: a(3) print *, transpose(a) end program lfortran-0.63.0/tests/errors/redeclaration1.f900000664000175000017500000000016115174404631021511 0ustar alastairalastairprogram redeclaration1 implicit none integer :: idx1 real :: j, idx1 idx1 = 5 j = 6 print *, idx1, j end program lfortran-0.63.0/tests/errors/continue_compilation_2.f900000664000175000017500000003356315174404631023273 0ustar alastairalastairmodule Geometry implicit none type :: Circle real :: radius contains procedure :: calculateArea end type Circle contains ! Type-bound subroutine to calculate the area of a circle subroutine calculateArea(self, area) class(Circle), intent(in) :: self real, intent(out) :: area area = 3.14 * self%radius**2 end subroutine calculateArea end module Geometry module my_module integer :: x = 10 end module wrong_module_name subroutine myname end subroutine myname block data myname end block data myname module continue_compilation_2_mod contains subroutine solsy () double precision rowns(209) common /rowns/ rowns(209) print *, set_exponent([1, 2, 3], 2) end subroutine try_to_change(y) integer, intent(in) :: y y = 99 end subroutine subroutine my_subroutine1() print *, "Inside subroutine" end subroutine different_name function my_function() result(res) integer :: res res = 42 end function not_my_function subroutine my_subroutine2() print *, "Inside subroutine" end subroutine different_name SUBROUTINE faulty_subroutine(a, b, c) INTEGER, INTENT(IN) :: sub_a END SUBROUTINE faulty_subroutine subroutine sub_a(val_a) integer, intent(in) :: val_a call sub_b(val_a) end subroutine sub_a subroutine sub_b(val_b) integer, intent(inout) :: val_b end subroutine sub_b function outer_func(val_a) result(res) integer, intent(in) :: val_a integer :: res res = inner_func(val_a) end function outer_func function inner_func(val_b) result(res) integer, intent(inout) :: val_b integer :: res end function inner_func subroutine arank(x) integer :: x(.., 5) end subroutine arank end module continue_compilation_2_mod module intent_out_array_bounds_mod type :: bar integer :: n end type contains subroutine init_bar(this, n) type(bar), intent(out) :: this integer, intent(in) :: n this%n = n block real :: array(this%n) integer :: i array = [ (i,i = 1,this%n) ] print *, array end block end subroutine subroutine optional_bound(n) integer, optional, intent(in) :: n real :: arr(n) arr = 0.0 print *, arr end subroutine end module intent_out_array_bounds_mod module pure_io_mod contains pure subroutine pure_print_sub(b) integer, intent(in) :: b print "(A,I0)", 'b = ', b end subroutine pure_print_sub end module pure_io_mod ! Only put declarations and statements here, no subroutines (those go above). program continue_compilation_2 use continue_compilation_2_mod use iso_c_binding, only: c_ptr, c_f_pointer use Geometry implicit real(a-z) ! Put declarations below without empty lines integer, pointer, parameter :: v => null() integer, allocatable, parameter :: v=1 integer init_x = 1 ! Variable declarations type(c_ptr) :: queries_1 integer, pointer :: y_1 type(c_ptr) :: queries_2 integer(2), pointer :: y_2(:) integer :: shape(2, 2) integer, parameter :: x = 2 type(Circle) :: myCircle real :: circleArea complex :: a integer :: val character(1) :: x_2 integer :: i integer :: a_2(3) integer :: size_a integer :: a_3(3) integer :: size_a_2 integer :: kindvar = 4 integer :: atom[*] real(8), allocatable :: x_3(:) real :: y_3 integer, parameter :: Nx = 600, Ny = 450 integer :: i_1, j, image(Nx, Ny) integer :: i_2, j_1 integer :: i_3 complex :: a_4 complex :: a_5 real :: y_4 integer :: idaa2_x(1:2,1:2,1:2) integer :: idaa2_y(1:2,1:2,1:1) logical, parameter :: idlalb1_x(3) = [.true., .false., .false.] logical, parameter :: idlalb2_x1(3) = [.true., .false., .false.] logical, parameter :: idlalb2_x2(2) = [.true., .true.] integer, allocatable :: iraa1_arr1(:, :) integer, allocatable :: iraa2_arr1(:, :, :) integer, allocatable :: iraa2_arr3(:) integer :: iatw1_b(5) integer :: iatw2_i1(5) integer :: iatw2_b(5) integer :: itw1_b(5) integer :: itw2_b(5) integer :: itw3_b(5) INTEGER :: intent_x real(8) :: intr2_x, intr2_y, datan2 integer(4) :: intr8_x = 1 integer(8) :: intr8_y = 2 integer(4) :: intr9_x = 1 integer(8) :: intr9_y = 2 integer(4) :: intr10_x = 1 integer(8) :: intr10_y = 2 integer, parameter :: ici_ios = 1 character(len=100) :: ici_buffer integer :: insv_ios(2) = 1 character(len=100) :: insv_buffer complex :: complex_z = (1, 2) integer :: tm1_x integer :: tm2_x !int_01_1.f90 integer(8), parameter :: ar1(3) = int([1, 2, 3], [8, 8, 8]) !int_01_2.f90 integer(8), parameter :: ar2(3) = int([1, 2, 3], [8, 8, 8]) !kind_invalid_float_of_int integer(4.2) :: ifoix !kind_invalid_int_of_complex complex(6) :: iiocx !kind_invalid_int_of_int integer(3) :: iifix !kind_invalid_int_of_logical logical(10) :: iiolx !kind_star_of_complex complex(*) :: ksoca !kind_star_of_int integer(*) :: ksoia !kind_star_of_logical logical(*) :: ksola !kind_string_of_int integer('a') :: ksoix !kind_var_of_int integer :: kvoia = 4 real(kvoia) :: kvoix !kind1 real(3) :: x !kind2 real(*) kind2_a !type_conflict1 integer, parameter, target :: foo=4 integer :: x_bad_implicit !unsupported kind real*16 :: unsupported_kind ! argument not specified type(Circle) :: myCircle2 = Circle() ! invalid keyword argument specified type(Circle) :: myCircle3 = Circle(mykeyword=10) !tokenizer error integer :: ? tokenizer_error integer, dimension(3,2) :: m = [ 1, 0, 0, 2, 4, 6 ] real :: idint_kind_mismatch = 4.23 character(5):: ichar_runtime = "Hello" real(8) :: dprod_1, dprod_2 real(4) :: dprod_3 = 4.23 real(4) ::idnint_runtime = 3.5 real(8) :: ifix_runtime = 4.23 logical :: min_max = .true. integer :: intent_bug_sub_x = 10 character(len=2) :: lhs type string_t character(:), allocatable :: value end type string_t character :: rhs(2) type(string_t) :: str_t_1, str_t_2 character(len=10) :: prefix integer :: aRank1(..) character(:), ALLOCATABLE :: str1 integer :: ierr character(*), parameter :: badfmt_p = '(a i0)' character(8) :: badfmt_s = '(a i0)' character(:), allocatable :: ax integer :: a_deferred(:) ! Use the space above to insert new declarations, and remove the line, so ! that the lines below do not shift, to keep the diff minimal. ! ! Only put statements below. If you need to call a function, put it into a ! module above. allocate(str1(i)) str_t_1%value = "world!" prefix = "hello, " str_t_2 = prefix // 10 str_t_2 = prefix // str_t_1 ! c_f_pointer_01 call c_f_pointer(queries_1, y_1, [2]) ! c_f_pointer_02 call c_f_pointer(queries_2, y_2, shape) ! assign_01 x = 1 ! class_procedure_extra_args myCircle%radius = 5.0 call myCircle%calculateArea(circleArea, 12) ! close_invalid_kwarg1 CLOSE(end=200) ! cmplx_01 print *, cmplx(y = 2) ! cmplx_02 print*, cmplx((real(1, kind=4), 0.00000000), kind=8) ! cmplx_03 print*, cmplx((1.00000000, real(0, kind=4)), kind=8) ! coarray_01 val = this_image () call co_sum (val, result_image=1) if (this_image() == 1) then write(*,*) "The sum is ", val end if ! coarray_02 call event_query(1, 1, 1) ! compare_01 x_2 = 'u' i = 10 if (i > x_2) then else end if !array_size_02 size_a = size(a_2, 1, dim=1) size_a = size(a_2, dim = 1, 1) !array_size_05 size_a_2 = size(a_3, kind=kindvar, dim=1) size_a_2 = size(a_3, kind=kindvar) !atomic_01 call atomic_add (atom[1], this_image()) call atomic_add (atom[2], this_image()) !array_constructor_with_asterisk_in_type_spec print *, [character(*) :: "a", "b", "ball", "cat"] !array_constructor_with_different_char_length print *, ["a", "b", "ball", "cat"] print *, ["a1", "b1", "ball1", "cat1"] !array_constructor_with_different_kind allocate(x_3(4)) print *, [x_3, [1., 2.]] !array_constructor_with_different_types print *, [1, 2.] !array_constructor_with_integer_real_array_types print *, [1, [1., 2.]] !dfloat1 print *, dfloat(y_3) !dim_float_01 print *, sum([1, 2, 3], 1.1) !dim_float_02 print *, sum([1, 2, 3], 1, 1.1) !dim_float_03 print *, sum([1, 2, 3], .true., 1.1) !dint_args print*, dint(1.0_8, 8) if (abs(dint(1.0_8, 8) - 1.0_8) > 10e-5 ) error stop !dlgama print *, dlgama(2.7) !dnint_args print*, dnint(1.0_8, 8) if (abs(dnint(1.0_8, 8) - 1.0_8) > 10e-5 ) error stop !do_concurrent_01 do concurrent (j = 1:Ny) local(i_1, j) do i_1 = 1, Nx end do end do !do_loop_01 do i_2 = 1, 10 do j_1 = 1, 2 i_2 = j_1 + 1 end do j_1 = i_2 + 1 print *, i_2, j_1 end do !do_zero_increment do i_2 = 1, 5, 0 write(*,*) i_3 end do !dprod print*, dprod(4.23_8, 4.3_8) !dreal_arg_error a_4 = (1.0, 2.0) print *, dreal(a_4) !fixed_number_of_args a_5 = complex(1) !float1 print *, float(y_4) !flush_invalid_kwarg FLUSH(unit=10, start=100) !func_parameter_type print *, f(42.9) !ichar_01 print*, ichar("okay") !idint_real4 print *, idint(4.5) !ifix_01 print *, ifix(4.23_8) !incompatible_dimension_assignment_arr1 integer :: arr1(1) arr1 = [1, 2, 3] !incompatible_dimension_assignment_arr2 idaa2_x = reshape([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]) idaa2_y = reshape([1, 2, 3, 4], [2, 2, 1]) idaa2_y = idaa2_x !incompatible_dimension_logical_arrays_logical_binop_01 print *, idlalb1_x .neqv. [.true., .true.] !incompatible_dimension_logical_arrays_logical_binop_02 print *, idlalb2_x1 .neqv. idlalb2_x2 !incompatible_rank_allocatable_arr1 iraa1_arr1 = [1, 2, 3] !incompatible_rank_allocatable_arr2 iraa2_arr3 = iraa2_arr1 !incorrect_array_type_where_01 where([1, 2, 3, 4, 5]) iatw1_b = 1 print *, iatw1_b if (all(iatw1_b /= [1, 0, 1, 0, 1])) error stop !incorrect_array_type_where_02 iatw2_i1 = [1, 2, 3, 4, 5] where(iatw2_i1) iatw2_b = 1 print *, iatw2_b if (all(iatw2_b /= [1, 0, 1, 0, 1])) error stop !incorrect_type_where_01 where(.true.) itw1_b = 12121 print *, itw1_b !incorrect_type_where_02 where(1) itw2_b = 12121 print *, itw2_b !incorrect_type_where_03 where(max(1.33, 2.67)) itw3_b = 12121 print *, itw3_b !intent1 intent_x = 42 CALL try_to_change(intent_x) !intrinsics1 print *, radix((2.4, 1.0)) !intrinsics2 intr2_x = 2.33D0 intr2_y = 3.41D0 print *, datan2(x,y) if(abs(datan2(x,y) - 0.59941916594660438) > 1d-6) error stop !intrinsics3 print *, ibclr(1, -2) !intrinsics4 print *, dshiftl(1, 1_8, 1) !intrinsics5 print *, ior(1, 1_8) !intrinsics6 print *, ieor(1, 1_8) !intrinsics7 print *, hypot(1.0, 2.7_8) !intrinsics8 print *, ior(intr8_x, intr8_y) !intrinsics9 print *, iand(intr9_x, intr9_y) !intrinsics10 print *, ieor(intr10_x, intr10_y) !intrinsics11 real(4) :: intr11_x = 1 real(8) :: intr11_y = 2 print *, hypot(intr11_x, intr11_y) !intrinsics12 print *, max(12, 13.94) !intrinsics13 print *, min(12, 13.94) !intrinsics14 print *, scale([1, 2, 3], 2) !intrinsics15 print *, set_exponent([1, 2, 3], 2) !iostat_constant_integer ici_buffer = 'Temporary date for testing purpose' read(ici_buffer, *, iostat=ici_ios) !iostat_non_scalar_value insv_buffer = 'Temporary date for testing purpose' read(insv_buffer, *, iostat=insv_ios(1:1)) !ishftc_size print *, ishftc(10, 6, 4) !complex_01 print *, cmplx(complex_z , 1) !kind_01 print *, aint([1.0, 2.0, 3.0], [4, 4]) !type_mismatch_1 tm1_x = "x" !type_mismatch_2 tm2_x = 5 + "x" print *,foo x_bad_implicit = 10 print *, x_bad_implicit ! member not found print *, myCircle%mymember 100 FORMAT(A10, @) print*, merge("okay", "ok", .true.) !idint_kind_mismatch print *, idint(4.23) print *, idint(idint_kind_mismatch) !ichar_runtime print *, ichar(ichar_runtime) !dprod_runtime print *, dprod(dprod_1, dprod_2) print *, dprod(dprod_3, dprod_2) !idnint print *, idnint(3.5) print *, idnint(idnint_runtime) !ifix print *, ifix(4.23_8) print *, ifix(ifix_runtime) !min print *, min(.true., .false.) print *, min(min_max, min_max) !max print *, max(.true., .false.) print *, max(min_max, min_max) !nested intent call sub_a(intent_bug_sub_x) print *, outer_func(intent_bug_sub_x) !size_intrinsic_check print *, size(ichar_runtime) lhs = rhs print *, index( substring = 'de', back = .true. ) print *, compiler_options() print "(AF9.6)", 'pi =', 4*atan(1.0) write (*,"(ai0)", iostat=ierr) "hi", 3 if (ierr /= 0) print*,"could not write" write (*,badfmt_p) "hi", 3 write (*,badfmt_s) "hi", 3 write (*, add_parens (badfmt_s)) "hi", 3 ax = "xx" print "(aai6)", a,"hi",15 call sleep(1) a = cmplx(y = 2) contains logical function f(x) integer, intent(in), optional :: x f = PRESENT(x) end function end program ! Test for multiple PROGRAM units in same file program second_program_test implicit none print *, "This is a second program - should cause error" end program second_program_test lfortran-0.63.0/tests/errors/c_f_pointer_02.f900000664000175000017500000000032115174404631021402 0ustar alastairalastairprogram c_f_pointer_01 use iso_c_binding, only: c_ptr, c_f_pointer type(c_ptr) :: queries integer(2), pointer :: x(:) integer :: shape(2, 2) call c_f_pointer(queries, x, shape) end program lfortran-0.63.0/tests/errors/kind_star_of_complex.f900000664000175000017500000000011415174404631023003 0ustar alastairalastairprogram kind_star_of_complex implicit none complex(*) a end program lfortran-0.63.0/tests/errors/type_conflict1.f900000664000175000017500000000015715174404631021544 0ustar alastairalastairprogram type_conflict1 implicit none integer, parameter, target :: foo=4 print *,foo end program lfortran-0.63.0/tests/errors/array_bounds_check_11.f900000664000175000017500000000034715174404631022750 0ustar alastairalastairprogram array_bounds_check_11 integer, allocatable :: a(:, :) integer, allocatable :: b(:, :) integer, allocatable :: e(:, :) allocate(a(2, 2)) allocate(b(2, 2)) allocate(e(4, 1)) e = a + b end program lfortran-0.63.0/tests/errors/merge_bits_comp.f900000664000175000017500000000011015174404631021744 0ustar alastairalastairprogram merge_bits_comp print *, merge_bits(8, 12_8, 2) end program lfortran-0.63.0/tests/errors/unterminated_ifdef_01.f900000664000175000017500000000016515174404631022754 0ustar alastairalastair#ifdef a program unterminated_ifdef_01 implicit none print *, "Hello world" end program unterminated_ifdef_01 lfortran-0.63.0/tests/errors/class_procedure_extra_args.f900000664000175000017500000000123315174404631024211 0ustar alastairalastairmodule Geometry implicit none type :: Circle real :: radius contains procedure :: calculateArea end type Circle contains ! Type-bound subroutine to calculate the area of a circle subroutine calculateArea(self, area) class(Circle), intent(in) :: self real, intent(out) :: area area = 3.14 * self%radius**2 end subroutine calculateArea end module Geometry program TestGeometry use Geometry implicit none type(Circle) :: myCircle real :: circleArea myCircle%radius = 5.0 call myCircle%calculateArea(circleArea, 12) print *, "Circle Area:", circleArea end program TestGeometry lfortran-0.63.0/tests/errors/incorrect_allocate_for_array.f900000664000175000017500000000016715174404631024522 0ustar alastairalastairprogram incorrect_allocate_for_array integer, allocatable :: a(:) allocate(a) print *, size(a) end program lfortran-0.63.0/tests/errors/array_05_cc.f900000664000175000017500000000053415174404631020707 0ustar alastairalastairmodule module_array_05 type t real, allocatable :: x(:) end type t end module module_array_05 program array_05_cc use module_array_05 implicit none type(t) :: type_01 allocate(type_01%x(1, 2)) allocate(type_01%x(2, 1)) print *, "compilation continued despite errors" end program array_05_cc lfortran-0.63.0/tests/errors/cpp4.f900000664000175000017500000000033015174404631017460 0ustar alastairalastairprogram cpp4 implicit none #define X123 z12345678 #define Y123 X123 #define A123 Y123 #define B123 A123 #define C123 B123 integer :: x, y x = (2+3)*5 ! Error: `z12345678` not defined: print *, x, C123, y end program lfortran-0.63.0/tests/errors/type_casting_01.f900000664000175000017500000000014515174404631021607 0ustar alastairalastairprogram type_casting_01 implicit none logical :: x(3) = [1, 1, 0] print *, x end program lfortran-0.63.0/tests/errors/template_error_01a.f900000664000175000017500000000546615174404631022316 0ustar alastairalastairmodule math implicit none private public :: add_real, slash_real contains pure function add_real(x, y) result(total) real, intent(in) :: x, y real :: total total = x + y end function pure function slash_real(x, y) result(total) real, intent(in) :: x, y real :: total total = x / y end function end module module travel use math implicit none private public :: travel_tmpl requirement operations(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) type, deferred :: D type, deferred :: T type, deferred :: S pure function plus_D(l, r) result(total) type(D), intent(in) :: l, R type(D) :: total end function pure function plus_T(l, r) result(total) type(T), intent(in) :: l, R type(T) :: total end function pure function D_divided_by_T(n, d) result(quotient) type(D), intent(in) :: n type(T), intent(in) :: d type(S) :: quotient end function pure function D_divided_by_S(n, d) result(quotient) type(D), intent(in) :: n type(S), intent(in) :: d type(T) :: quotient end function end requirement template travel_tmpl(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) require :: operations(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) private public :: avg_S_from_T contains pure function avg_S_from_T(d1, t1, d2, t2) result(avg) type(D), intent(in) :: d1, d2 type(T), intent(in) :: t1, t2 type(S) :: avg avg = D_divided_by_T(plus_D(d1, d2), plus_T(t1, t2)) end function pure function avg_S_from_S(d1, s1, d2, s2) result(avg) type(D), intent(in) :: d1, d2 type(S), intent(in) :: s1, s2 type(S) :: avg avg = avg_S_from_T(d1, D_divided_by_T(d1, s1), d2, D_divided_by_S(d2, s2)) end function end template end module module template_error_01_m use math use travel implicit none contains subroutine test_template() instantiate travel_tmpl(real, real, real, add_real, add_real, slash_real, slash_real), & only: avg_real_S_from_T => avg_S_from_T instantiate travel_tmpl(real, real, real, add_real, add_real, slash_real, slash_real), & only: avg_real_S_from_S => avg_S_from_S real :: s1, s2 s1 = avg_real_S_from_T(1.0, 3.0, 1.5, 4.0) s2 = avg_real_S_from_S(1.1, 0.5, 2.0, 0.75) print *, "s1=", s1 print *, "s2=", s2 end subroutine end module program template_error_01 use template_error_01_m implicit none call test_template() end program template_error_01lfortran-0.63.0/tests/errors/formatTesting.f900000664000175000017500000000014215174404631021441 0ustar alastairalastairprogram main print "(2E13)", epsilon(1e0) ! the code will work as we put 2E13.5 end programlfortran-0.63.0/tests/errors/kind_var_of_int.f900000664000175000017500000000013415174404631021747 0ustar alastairalastairprogram kind_var_of_int implicit none integer :: a = 4 real(a) :: x end program lfortran-0.63.0/tests/errors/incorrect_number_args_subroutine.f900000664000175000017500000000022015174404631025443 0ustar alastairalastairprogram expr implicit none call my_func(1) contains subroutine my_func() print *, "hi" end subroutine end program expr lfortran-0.63.0/tests/errors/intrinsics3.f900000664000175000017500000000007115174404631021064 0ustar alastairalastairprogram intrinsics3 print *, ibclr(1, -2) end programlfortran-0.63.0/tests/errors/mre_segfault.f900000664000175000017500000000031115174404631021266 0ustar alastairalastairprogram mre_segfault implicit none integer, allocatable :: arr4(:) ! checking source in allocate with reshape allocate(arr4(3), source=reshape([1, 2, 3, 4, 5, 6], [2, 3])) end program lfortran-0.63.0/tests/errors/iostat_non_scalar_value.f900000664000175000017500000000035115174404631023513 0ustar alastairalastairprogram iostat_non_scalar_value implicit none integer :: ios(2) = 1 character(len=100) :: buffer buffer = 'Temporary date for testing purpose' read(buffer, *, iostat=ios(1:1)) end program iostat_non_scalar_value lfortran-0.63.0/tests/errors/iostat_constant_integer.f900000664000175000017500000000035415174404631023551 0ustar alastairalastairprogram iostat_constant_integer implicit none integer, parameter :: ios = 1 character(len=100) :: buffer buffer = 'Temporary date for testing purpose' read(buffer, *, iostat=ios) end program iostat_constant_integer lfortran-0.63.0/tests/errors/integer_overflow.f900000664000175000017500000000045515174404631022202 0ustar alastairalastairprogram read_from_file implicit none integer :: x, unit_no open(newunit=unit_no, file='./tests/overflow_test.txt', status='old') read(unit_no, *) x print *, "Read integer:", x read(unit_no, *) x print *, "Read integer:", x close(unit_no) end program read_from_file lfortran-0.63.0/tests/errors/kind_star_of_logical.f900000664000175000017500000000011415174404631022746 0ustar alastairalastairprogram kind_star_of_logical implicit none logical(*) a end program lfortran-0.63.0/tests/errors/array_bounds_check_13.f900000664000175000017500000000103715174404631022747 0ustar alastairalastairmodule array_bounds_check_13_mod type :: base integer :: x end type base type, extends(base) :: derived integer :: y end type derived contains subroutine my(a, b) class(base), intent(in) :: a(:) integer, optional :: b print *, a(1)%x end subroutine end module program array_bounds_check_13 use array_bounds_check_13_mod integer, allocatable :: i type(derived), allocatable :: my_array(:) i = 10 call my(my_array, i) end program lfortran-0.63.0/tests/errors/string_assignment_01.f900000664000175000017500000000023715174404631022656 0ustar alastairalastairprogram string_assignment_01 implicit none character(:), allocatable :: a character(:), allocatable :: b a = b end program string_assignment_01lfortran-0.63.0/tests/errors/implicit_typing3.f900000664000175000017500000000026015174404631022103 0ustar alastairalastairmodule implicit_typing3_module implicit none contains function fun() end function fun end module implicit_typing3_module program main end program main lfortran-0.63.0/tests/errors/allocate_01.f900000664000175000017500000000033415174404631020702 0ustar alastairalastairprogram allocate_01 character(:), allocatable :: str allocate(character(len=10) :: str) deallocate(str) allocate(character(len=11) :: str) allocate(character(len=12) :: str) ! Error end program lfortran-0.63.0/tests/errors/cmplx_03.f900000664000175000017500000000011715174404631020242 0ustar alastairalastairprogram cmplx_03 ! print*, cmplx((1.00000000, real(0, kind=4)), kind=8) endlfortran-0.63.0/tests/errors/kind_invalid_int_of_complex.f900000664000175000017500000000012615174404631024335 0ustar alastairalastairprogram kind_invalid_int_of_complex implicit none complex(6) :: x end program lfortran-0.63.0/tests/errors/template_error_02.f900000664000175000017500000000212715174404631022145 0ustar alastairalastairmodule template_error_02_m implicit none private public :: add_t requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = F(x, y) end function end template contains real function func_arg_real(x, y, a) result(z) real, intent(in) :: x, y, a z = x + y end function subroutine test_template() instantiate add_t(real, func_arg_real), only: add_real => add_generic real :: x, y x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) if (abs(add_real(x, y) - 12.3) > 1e-5) error stop end subroutine end module program template_error_02 use template_error_02_m implicit none call test_template() end program template_error_02 lfortran-0.63.0/tests/errors/interface_01.f900000664000175000017500000000047615174404631021065 0ustar alastairalastairmodule interface_01_mod implicit none interface func module function e(x) implicit none real, intent(in) :: x real :: e end function e end interface contains module function e(x) integer, intent(in) :: x real :: e e = x * 2.0 end function end module interface_01_mod lfortran-0.63.0/tests/errors/esub1.f900000664000175000017500000000006315174404631017634 0ustar alastairalastairsubroutine g() r integer :: x x = 1 end subroutine lfortran-0.63.0/tests/errors/nint_overflow.f900000664000175000017500000000015515174404631021512 0ustar alastairalastairprogram nint_overflow print*, nint(1e12_8) print*, nint(1000000000000.0000000000000000d0) end programlfortran-0.63.0/tests/errors/maskr_incorrect_bit_size.f900000664000175000017500000000010215174404631023664 0ustar alastairalastairprogram maskr_incorrect_bit_size print*, maskr(63) end program lfortran-0.63.0/tests/errors/dprod_01.f900000664000175000017500000000007615174404631020231 0ustar alastairalastairprogram dprod_01 print*, dprod(4.23_8, 4.3_8) end program lfortran-0.63.0/tests/errors/type_mismatch1.f900000664000175000017500000000010615174404631021542 0ustar alastairalastairprogram type_mismatch1 implicit none integer :: x x = "x" end program lfortran-0.63.0/tests/errors/rewind_invalid_kwarg1.f900000664000175000017500000000017215174404631023070 0ustar alastairalastairprogram rewind_invalid_kwarg1 ! "end" is an invalid keyword argument for "REWIND" rewind(end="world") end program lfortran-0.63.0/tests/errors/protected_01.f900000664000175000017500000000072015174404631021106 0ustar alastairalastairmodule module_protected_01 REAL, PROTECTED, save :: temp_c, temp_f CONTAINS SUBROUTINE set_temperature_c(c) REAL, INTENT(IN) :: c ! assignment to protected variable allowed here temp_c = c temp_f = temp_c*(9.0/5.0) + 32 END SUBROUTINE end module module_protected_01 program protected_01 use module_protected_01 call set_temperature_c(10.) ! assignment to protected variable not allowed here temp_c = 10 end program protected_01 lfortran-0.63.0/tests/errors/intrinsics11.f900000664000175000017500000000014315174404631021143 0ustar alastairalastairprogram intrinsics11 real(4) :: x = 1 real(8) :: y = 2 print *, hypot(x, y) end programlfortran-0.63.0/tests/errors/array_constructor_with_different_kind.f900000664000175000017500000000021115174404631026461 0ustar alastairalastairprogram array_constructor_with_different_kind real(8), allocatable :: x(:) allocate(x(4)) print *, [x, [1., 2.]] end program lfortran-0.63.0/tests/errors/infer_first_assignment_conflict_01.f900000664000175000017500000000001715174404631025537 0ustar alastairalastairx = "hi" x = 1 lfortran-0.63.0/tests/errors/runtime_stacktrace_01.f900000664000175000017500000000051215174404631023003 0ustar alastairalastairprogram expr2 implicit none print *, main() contains function main() integer :: main main = 1 print *, g() end function main subroutine f() stop 1 end subroutine f function g() integer :: g g = 1 call f() end function g end program expr2 lfortran-0.63.0/tests/errors/intent1.f900000664000175000017500000000024515174404631020201 0ustar alastairalastairPROGRAM main INTEGER :: x x = 42 CALL try_to_change(x) END PROGRAM SUBROUTINE try_to_change(y) INTEGER, INTENT(IN) :: y y = 99 END SUBROUTINE lfortran-0.63.0/tests/errors/duplicate_module_procedures.f900000664000175000017500000000061015174404631024365 0ustar alastairalastairmodule input_module implicit none interface test_interface module procedure test_01, test_01, test_01 end interface test_interface contains subroutine test_01 (x) implicit none integer , intent(in):: x print *, x end subroutine test_01 end module input_module program main use input_module call test_interface(1) end program mainlfortran-0.63.0/tests/errors/data_implied_do3.f900000664000175000017500000000023615174404631022000 0ustar alastairalastairprogram data_implied_do3 implicit none integer :: k = 3 integer :: i, iarx(3) data(iarx(i), i=k, 3) / 1, 2, 3 / end program data_implied_do3 lfortran-0.63.0/tests/errors/complex_01.f900000664000175000017500000000013415174404631020563 0ustar alastairalastairprogram complex_01 implicit none complex :: z = (1, 2) print *, cmplx(z, 1) end lfortran-0.63.0/tests/errors/array_bounds_check_01.f900000664000175000017500000000016215174404631022742 0ustar alastairalastairprogram array_bounds_check_01 integer, allocatable :: x(:) allocate(x(10)) x = [1, 2, 3] end program lfortran-0.63.0/tests/errors/integer16.f900000664000175000017500000000004415174404631020420 0ustar alastairalastairprogram integer16 integer*16 x end lfortran-0.63.0/tests/errors/fixed_form_1.f0000664000175000017500000000012315174404631021003 0ustar alastairalastair program X xinteger :: y y = 5 500 print *, y end program lfortran-0.63.0/tests/errors/derived_type_01.f900000664000175000017500000000024415174404631021601 0ustar alastairalastairmodule test private type, abstract :: tester contains procedure(testing_interface), deferred :: testing end type tester end module test lfortran-0.63.0/tests/errors/continue_compilation_coarrays.f900000664000175000017500000000103115174404631024736 0ustar alastairalastairprogram continue_compilation_coarrays ! Test: coindex notation on non-coarray variable should produce error integer :: x x = x[1] ! Test: corank mismatch should produce error integer :: B[3,*] B[1] = 5 type :: t integer :: x integer :: y[3,*] end type t type(t) :: s ! Should error: x is not a coarray s%x = s%x[1] ! Corank = 2, but only 1 coindex provided → ERROR s%y[1] = 5 integer :: z[*], a a = z[1:5:2] end program continue_compilation_coarrayslfortran-0.63.0/tests/errors/incompatible_dimension_assignment_arr1.f900000664000175000017500000000034015174404631026503 0ustar alastairalastairprogram incompatible_ranks_allocatable_arr2 implicit none ! constant array of size 1 integer :: arr1(1) ! arr1 (which is of size 1) is being assigned ! an array of size 3 arr1 = [1, 2, 3] end program lfortran-0.63.0/tests/errors/intrinsics9.f900000664000175000017500000000014715174404631021076 0ustar alastairalastairprogram intrinsics9 integer(4) :: x = 1 integer(8) :: y = 2 print *, iand(x, y) end programlfortran-0.63.0/tests/errors/open_invalid_kwarg1.f900000664000175000017500000000031115174404631022534 0ustar alastairalastairPROGRAM open_invalid_kwarg1 ! the file "numbers" doesn't need to exist for the test-case ! "hello" is an invalid keyword argument for "OPEN" OPEN(file="numbers", hello="world") END PROGRAM lfortran-0.63.0/tests/errors/matrix_matmul_03.f900000664000175000017500000000017715174404631022010 0ustar alastairalastairprogram matrix_matmul_03 implicit none logical :: a(3, 3) integer :: b(3, 3) print *, matmul(a, b) end program lfortran-0.63.0/tests/errors/maskr_negative.f900000664000175000017500000000007115174404631021613 0ustar alastairalastairprogram maskr_negative print*, maskr(-24) end program lfortran-0.63.0/tests/errors/data_implied_do1.f900000664000175000017500000000023615174404631021776 0ustar alastairalastairprogram data_implied_do1 implicit none integer :: k = 3 integer :: i, iarx(3) data(iarx(i), i=1, k) / 1, 2, 3 / end program data_implied_do1 lfortran-0.63.0/tests/errors/end_module_name.f900000664000175000017500000000006015174404631021725 0ustar alastairalastairmodule name1 implicit none end module name2 lfortran-0.63.0/tests/errors/dint_args.f900000664000175000017500000000015515174404631020571 0ustar alastairalastairprogram main print*, dint(1.0_8, 8) if (abs(dint(1.0_8, 8) - 1.0_8) > 10e-5 ) error stop end programlfortran-0.63.0/tests/errors/subroutine5.f900000664000175000017500000000014115174404631021076 0ustar alastairalastairsubroutine add(a, b, c) real, intent(in) :: a, b real, intent(out) :: c c = a + d end subroutine lfortran-0.63.0/tests/errors/template_error_06.f900000664000175000017500000000066215174404631022153 0ustar alastairalastairmodule template_error_06_m implicit none private public :: struct_t requirement r(t) type, deferred :: t end requirement template struct_t(t) require :: r(t) private public :: tuple type :: tuple type(g) :: fst type(g) :: snd end type contains end template contains end module program template_error_06 use template_error_06_m implicit none end programlfortran-0.63.0/tests/errors/scalar_allocation_check_04.f900000664000175000017500000000031115174404631023723 0ustar alastairalastairprogram scalar_allocation_check_04 integer, allocatable :: xx call ff(xx) contains subroutine ff(x) integer :: x x = 10 end subroutine end program lfortran-0.63.0/tests/errors/coarray_02.f900000664000175000017500000000010715174404631020555 0ustar alastairalastairprogram coarray_02 call event_query(1, 1, 1) end program coarray_02lfortran-0.63.0/tests/errors/intrinsics5.f900000664000175000017500000000007015174404631021065 0ustar alastairalastairprogram intrinsics5 print *, ior(1, 1_8) end programlfortran-0.63.0/tests/errors/cpp5.h0000664000175000017500000000016415174404631017317 0ustar alastairalastair#define X123 z12345678 #define Y123 X123 #define A123 Y123 #define B123 A123 #define C123 B123+B123 integer :: x, y lfortran-0.63.0/tests/errors/array_bounds_check_10.f900000664000175000017500000000034715174404631022747 0ustar alastairalastairprogram array_bounds_check_10 integer, allocatable :: a(:, :) integer, allocatable :: b(:, :) integer, allocatable :: e(:, :) allocate(a(2, 2)) allocate(b(2, 3)) allocate(e(2, 2)) e = a + b end program lfortran-0.63.0/tests/errors/incompatible_rank_assign.f900000664000175000017500000000005715174404631023645 0ustar alastairalastairprogram main integer :: x = [1,2,3] end programlfortran-0.63.0/tests/errors/array_bounds_check_07.f900000664000175000017500000000035215174404631022751 0ustar alastairalastairprogram array_bounds_check_07 integer, allocatable :: x(:) integer, allocatable :: y(:) integer, allocatable :: z(:) allocate(x(3)) allocate(y(4)) allocate(z(5)) x = 1 y = 2 z = x + y end program lfortran-0.63.0/tests/errors/substring_endidx.f900000664000175000017500000000023215174404631022166 0ustar alastairalastairprogram substring_noninteger_endidx implicit none character(len=8) :: s = "lfortran" print*, s(1:5.2) end program substring_noninteger_endidx lfortran-0.63.0/tests/errors/int_01.f900000664000175000017500000000013015174404631017702 0ustar alastairalastairprogram main integer(8), parameter :: ar1(3) = int([1, 2, 3], [8, 8, 8]) end programlfortran-0.63.0/tests/errors/continue_compilation_walrus.f900000664000175000017500000000016515174404631024437 0ustar alastairalastairprogram continue_compilation_walrus implicit none integer :: x x := 5 y := 5 y := 10 end program lfortran-0.63.0/tests/errors/string_negative_start_index.f900000664000175000017500000000017715174404631024417 0ustar alastairalastairprogram string_negative_start_index implicit none character(len=8) :: s s = "lfortran" print*, "s:", s(-1:4) end program lfortran-0.63.0/tests/errors/intrinsics4.f900000664000175000017500000000007715174404631021073 0ustar alastairalastairprogram intrinsics4 print *, dshiftl(1, 1_8, 1) end programlfortran-0.63.0/tests/errors/private1.f900000664000175000017500000000027215174404631020352 0ustar alastairalastairmodule foo1 private real :: x = 1 end module module foo2 use foo1 real :: y = 2 end module program test use foo2 x = 5 write(*,*) x, y end program lfortran-0.63.0/tests/errors/intrinsics13.f900000664000175000017500000000007415174404631021150 0ustar alastairalastairprogram intrinsics13 print *, min(12, 13.94) end programlfortran-0.63.0/tests/errors/incompatible_dimension_logical_arrays_logical_binop_02.f900000664000175000017500000000024515174404631031567 0ustar alastairalastairprogram main logical, parameter :: x1(3) = [.true., .false., .false.] logical, parameter :: x2(2) = [.true., .true.] print *, x1 .neqv. x2 end program lfortran-0.63.0/tests/errors/ishftc_size.f900000664000175000017500000000007615174404631021133 0ustar alastairalastairprogram ishftc_size print *, ishftc(10, 6, 4) end program lfortran-0.63.0/tests/errors/cpp_err1.f900000664000175000017500000000012015174404631020322 0ustar alastairalastairprogram cpp_err1 implicit none #if 2 < 1+2+ #endif print *, 'OK' end program lfortran-0.63.0/tests/errors/dimension_02.f900000664000175000017500000000014015174404631021077 0ustar alastairalastairprogram main integer :: linelen = 2 character, dimension(linelen) :: line end programlfortran-0.63.0/tests/errors/template_error_07a.f900000664000175000017500000000071315174404631022312 0ustar alastairalastairmodule template_01_m implicit none private public :: op_t requirement semigroup(t) type, deferred :: t elemental function combine(x, y) result(combined) type(t), intent(in) :: x, y type(t) :: combined end function end requirement contains subroutine test_template() end subroutine end module program template_01 use template_01_m implicit none end program template_01lfortran-0.63.0/tests/errors/intrinsics7.f900000664000175000017500000000007615174404631021075 0ustar alastairalastairprogram intrinsics7 print *, hypot(1.0, 2.7_8) end programlfortran-0.63.0/tests/errors/integerStringInput.f900000664000175000017500000000044315174404631022463 0ustar alastairalastairprogram integerStringInput implicit none integer :: x open(unit=10, file="tests/invalidInput_integer.txt", status="unknown") do read(10, *, end=100) x print *, "Read integer:", x end do 100 continue close(10) stop end program integerStringInputlfortran-0.63.0/tests/errors/array_constructor_with_integer_real_array_types.f900000664000175000017500000000013715174404631030577 0ustar alastairalastairprogram array_constructor_with_integer_real_array_types print *, [1, [1., 2.]] end program lfortran-0.63.0/tests/errors/scalar_allocation_check_06.f900000664000175000017500000000015015174404631023726 0ustar alastairalastairprogram scalar_allocation_check_06 implicit none integer, allocatable :: x print *, x end lfortran-0.63.0/tests/errors/incorrect_type_where_03.f900000664000175000017500000000016615174404631023346 0ustar alastairalastairprogram main implicit none integer :: b(5) where(max(1.33, 2.67)) b = 12121 print *, b end program main lfortran-0.63.0/tests/errors/scalar_allocation_check_02.f900000664000175000017500000000046415174404631023732 0ustar alastairalastairprogram scalar_allocation_check_02 implicit none type :: base integer :: x end type class(base), allocatable :: var deallocate(var) select type(var) type is (base) print *, var%x class default error stop end select end program lfortran-0.63.0/tests/errors/continue_compilation_ff_1.f0000664000175000017500000000406515174404631023567 0ustar alastairalastairc If you need a function, put it into the module below and remove the same c number of lines below the module to keep the rest of the lines in this file c intact. module continue_compilation_1_mod CONTAINS LOGICAL FUNCTION f(x) INTEGER, INTENT(IN), OPTIONAL :: x f = PRESENT(x) END FUNCTION f end module c Only put declarations and statements here, no subroutines (those go above). PROGRAM continue_compilation_ff INTEGER :: init_x = 1 INTEGER, POINTER :: y_1 INTEGER(2), POINTER :: y_2(:) INTEGER :: shape(2, 2) INTEGER, PARAMETER :: x = 2 REAL :: circleArea COMPLEX :: a INTEGER :: val CHARACTER(1) :: x_2 INTEGER :: i INTEGER :: a_2(3) INTEGER :: size_a INTEGER :: a_3(3) INTEGER :: size_a_2 INTEGER :: kindvar = 4 REAL(8), ALLOCATABLE :: x_3(:) REAL :: y_3 INTEGER, PARAMETER :: Nx = 600, Ny = 450 INTEGER :: i_1, j, image(Nx, Ny) INTEGER :: i_2, j_1 INTEGER :: i_3 COMPLEX :: a_4 COMPLEX :: a_5 REAL :: y_4 INTEGER :: I J c Use the space above to insert new declarations, and remove the line, so c that the lines below do not shift, to keep the diff minimal. c Only put statements below. If you need to call a function, put it into a c module above. CLOSE(UNIT=200) I == 10 J = 20..5 PRINT *, "Value of I is" I CHARACTER*10 STR = 'Hello ' WRITE(*,10 FORMAT(A)) A = B + * C INTEGER K L M = 5 READ *, N 5 REAL X Y Z 10.5 COMPLEX C = (1.0,2.0 I === 10 J = .20E REAL*8 A = 1.23.45 INTEGER*4 VAR/5/ INTEGER*4 VAR/5/ EQUIVALENCE (X Y) x_2 = 'u' i = 10 IF (i > ICHAR(x_2)) THEN END IF size_a = SIZE(a_2, DIM=1) a_5 = CMPLX(1) IF I .EQ. 10 THEN PRINT *, "Ten" CALL FUNC( 5, 6, IF (i == ICHAR(x_2))) error stop END PROGRAM continue_compilation_ff lfortran-0.63.0/tests/errors/program_without_line_01.f900000664000175000017500000000002715174404631023356 0ustar alastairalastairprint *, "OK" contains lfortran-0.63.0/tests/errors/program_without_line_02.f900000664000175000017500000000005115174404631023354 0ustar alastairalastairprint *, "OK" contains print *, "OK" end lfortran-0.63.0/tests/errors/func_arg_array.f900000664000175000017500000000041115174404631021574 0ustar alastairalastairprogram array_passing integer, dimension(3,2) :: myArray = reshape([1,2,3,4,5,6],[3,2]) integer :: i i = temp(myArray) end program array_passing integer Function temp(arr) integer, dimension(2,2,2) :: arr temp = arr(1,2,2) end functionlfortran-0.63.0/tests/errors/derived_type_03.f900000664000175000017500000000051115174404631021600 0ustar alastairalastairmodule test private type, abstract :: tester contains procedure(testing_interface), deferred :: testing end type tester abstract interface subroutine testing_interface(self) integer, intent(inout) :: self end subroutine testing_interface end interface end module test lfortran-0.63.0/tests/errors/matrix_matmul_04.f900000664000175000017500000000020215174404631021776 0ustar alastairalastairprogram matrix_matmul_04 implicit none integer :: a(3, 3, 3) integer :: b(3, 3) print *, matmul(a, b) end program lfortran-0.63.0/tests/errors/flush_invalid_kwarg1.f900000664000175000017500000000020115174404631022712 0ustar alastairalastairPROGRAM flush_invalid_kwarg1 ! "start" is an invalid keyword argument for "REWIND" FLUSH(unit=10, start=100) END PROGRAM lfortran-0.63.0/tests/errors/intrinsics14.f900000664000175000017500000000007215174404631021147 0ustar alastairalastairprogram intrinsics14 print *, scale([1, 2, 3], 2) end lfortran-0.63.0/tests/errors/func_parameter_type.f900000664000175000017500000000024415174404631022652 0ustar alastairalastairPROGRAM test_present print *, f(42.9) CONTAINS LOGICAL FUNCTION f(x) INTEGER, INTENT(IN), OPTIONAL :: x f = PRESENT(x) END FUNCTION END PROGRAMlfortran-0.63.0/tests/errors/array_bounds_check_06.f900000664000175000017500000000031315174404631022745 0ustar alastairalastairprogram array_bounds_check_06 implicit none integer :: x(3) integer, allocatable :: y(:) allocate(y(4)) ! works with 3, must fail with 2 or 4 x = 2 y = 3 x = y end program lfortran-0.63.0/tests/errors/string_binop.f900000664000175000017500000000002615174404631021311 0ustar alastairalastairprint *, "a" + "b" endlfortran-0.63.0/tests/errors/atomic_01.f900000664000175000017500000000017415174404631020374 0ustar alastairalastairprogram atomic use iso_fortran_env integer :: atom[*] call atomic_add (atom[1], this_image()) end program atomiclfortran-0.63.0/tests/errors/array_shape_05.f900000664000175000017500000000025115174404631021416 0ustar alastairalastairprogram array_shape_05 implicit none integer :: a(2) integer :: temp(5) integer :: i integer :: j i = 1 j = i a = temp(i:j) end program lfortran-0.63.0/tests/errors/sqrt_neg.f900000664000175000017500000000006515174404631020441 0ustar alastairalastairprogram sqrt_neg print *, sqrt(-1.0) end program lfortran-0.63.0/tests/errors/template_error_08.f900000664000175000017500000000206215174404631022151 0ustar alastairalastairmodule template_add_01b_m_e implicit none private public :: add_t requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = x + y end function end template contains integer function func_arg_int(x, y) result(z) integer, intent(in) :: x, y z = x + y end function subroutine test_template() real :: a integer :: n, s instantiate add_t(integer, func_arg_int), only: add_integer => add_generic n = add_integer(5, 9) !s = add_integer2(5, 9, 10) print*, "The result is", n end subroutine end module program template_add_01b use template_add_01b_m_e implicit none call test_template() end programlfortran-0.63.0/tests/errors/implicit_typing2.f900000664000175000017500000000026715174404631022111 0ustar alastairalastairmodule implicit_typing2_errors_module implicit none contains subroutine sub1() x = 1 end subroutine sub1 end module implicit_typing2_errors_module program main end program main lfortran-0.63.0/tests/errors/cpp6.h0000664000175000017500000000002715174404631017316 0ustar alastairalastair! Not declared z12 = 5 lfortran-0.63.0/tests/errors/submodule_01.f900000664000175000017500000000052315174404631021115 0ustar alastairalastairmodule submodule_01_m implicit none interface submodule_01_m_i end interface end module submodule_01_m submodule(submodule_01_m) submodule_01_s implicit none contains module procedure func end procedure end submodule submodule_01_s program submodule_01 use submodule_01_m implicit none end program submodule_01 lfortran-0.63.0/tests/errors/end_program_name.f900000664000175000017500000000004015174404631022105 0ustar alastairalastairprogram name end program name2 lfortran-0.63.0/tests/errors/scalar_allocation_check_01.f900000664000175000017500000000023715174404631023727 0ustar alastairalastairprogram scalar_allocation_check_01 implicit none integer, allocatable :: x integer, allocatable :: z integer :: y y = x + z end program lfortran-0.63.0/tests/errors/infer_realloc_disabled_01.f900000664000175000017500000000023715174404631023553 0ustar alastairalastairprogram infer_realloc_disabled_01 integer, allocatable :: x(:) x = [1, 2, 3] x = [4, 5] print *, size(x) end program infer_realloc_disabled_01 lfortran-0.63.0/tests/errors/dim_assgn_test.f900000664000175000017500000000015015174404631021615 0ustar alastairalastairprogram dim_assgn_test ! Warning: integer, private, dimension(2,2) :: a(2,3) ! Error: x = 5 end program lfortran-0.63.0/tests/errors/implicit_typing4.f900000664000175000017500000000006415174404631022106 0ustar alastairalastairsubroutine iddr_rsvd(matvect) implicit none end lfortran-0.63.0/tests/errors/subroutine6.f900000664000175000017500000000007415174404631021104 0ustar alastairalastairsubroutine sub (array) dimension array(3) end subroutinelfortran-0.63.0/tests/errors/array_size_01.f900000664000175000017500000000016515174404631021270 0ustar alastairalastairprogram arrays_01 implicit none integer :: a(3) integer :: size_a size_a = size(a, 1, 4, kind=4) end lfortran-0.63.0/tests/errors/implicit_typing1.f900000664000175000017500000000016415174404631022104 0ustar alastairalastairsubroutine sub1() implicit none x = 1 print *, x end subroutine sub1 program main call sub1() end program main lfortran-0.63.0/tests/errors/cmplx_01.f900000664000175000017500000000012215174404631020234 0ustar alastairalastairprogram cmplx_01 complex :: a a = cmplx(y = 2) print *, a end program lfortran-0.63.0/tests/errors/implicit3.f900000664000175000017500000000010115174404631020503 0ustar alastairalastairinteger function a() implicit None implicit real (a) end functionlfortran-0.63.0/tests/errors/intrinsics2.f900000664000175000017500000000027015174404631021064 0ustar alastairalastairprogram intrinsics2 real(8) :: x, y, datan2 x = 2.33D0 y = 3.41D0 print *, datan2(x,y) if(abs(datan2(x,y) - 0.59941916594660438) > 1d-6) error stop end programlfortran-0.63.0/tests/errors/template_error_04.f900000664000175000017500000000212415174404631022144 0ustar alastairalastairmodule template_error_04_m implicit none private public :: add_t requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = F(x, y) end function end template contains real function func_arg_real(x, y) result(z) integer, intent(in) :: x, y z = x + y end function subroutine test_template() instantiate add_t(real, func_arg_real), only: add_real => add_generic real :: x, y x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) if (abs(add_real(x, y) - 12.3) > 1e-5) error stop end subroutine end module program template_error_04 use template_error_04_m implicit none call test_template() end program template_error_04 lfortran-0.63.0/tests/errors/array_bounds_check_09.f900000664000175000017500000000071415174404631022755 0ustar alastairalastairprogram array_bounds_check_09 integer, allocatable :: a(:) integer, allocatable :: b(:) integer, allocatable :: e(:) allocate(a(3)) allocate(b(3)) allocate(e(3)) a = 3 b = 3 e = a + b + f(a) print *, e contains function f(x) result(y) integer, intent(in) :: x(:) integer, allocatable :: y(:) allocate(y(size(x) - 1)) y = 2 end function end program lfortran-0.63.0/tests/errors/dlgama_arg.f900000664000175000017500000000006715174404631020677 0ustar alastairalastairprogram dlgama_arg print *, dlgama(2.7) end programlfortran-0.63.0/tests/errors/cpp1.f900000664000175000017500000000022015174404631017453 0ustar alastairalastairprogram cpp1 implicit none #define X123 z12345678 integer :: x, y x = (2+3)*5 ! Error: `z12345678` not defined: print *, x, X123, y end program lfortran-0.63.0/tests/errors/compare_01.f900000664000175000017500000000030115174404631020536 0ustar alastairalastairprogram compare_01 character(1) :: x integer :: i x = 'u' i = 10 if (i > x) then print *, "Hello World" else print *, "New world" end if end program lfortran-0.63.0/tests/errors/specific_type_intrinsic.f900000664000175000017500000000007715174404631023532 0ustar alastairalastairprogram specific_type_intrinsic print*, dabs(1) end programlfortran-0.63.0/tests/errors/incorrect_array_type_where_02.f900000664000175000017500000000027715174404631024546 0ustar alastairalastairprogram main implicit none integer :: i1(5) integer :: b(5) i1 = [1, 2, 3, 4, 5] where(i1) b = 1 print *, b if (all(b /= [1, 0, 1, 0, 1])) error stop end program main lfortran-0.63.0/tests/errors/maskl_incorrect_bit_size.f900000664000175000017500000000010215174404631023656 0ustar alastairalastairprogram maskl_incorrect_bit_size print*, maskl(63) end program lfortran-0.63.0/tests/errors/subroutine2.f900000664000175000017500000000016315174404631021077 0ustar alastairalastairprogram subroutine2 integer :: i i = bpe() contains subroutine bpe() end subroutine end programlfortran-0.63.0/tests/errors/matmul_unallocated_01.f900000664000175000017500000000036315174404631022772 0ustar alastairalastairprogram matmul_unallocated_01 implicit none real, allocatable :: A(:,:), B(:,:), C(:,:) allocate(A(3, 4), B(4, 2)) A = 1.0 B = 1.0 ! C is not allocated - should fail without --realloc-lhs-arrays C = matmul(A, B) print *, C(1,1) end program lfortran-0.63.0/tests/errors/mre_parameter.f900000664000175000017500000000022415174404631021437 0ustar alastairalastairprogram mre_parameter1 implicit none character(3), parameter :: ar1 = repeat(["abc", "#^1", "123"], [1, 2, 3]) print *, ar1 end program lfortran-0.63.0/tests/errors/dnint_args.f900000664000175000017500000000015715174404631020751 0ustar alastairalastairprogram main print*, dnint(1.0_8, 8) if (abs(dnint(1.0_8, 8) - 1.0_8) > 10e-5 ) error stop end programlfortran-0.63.0/tests/errors/allocated_04.f900000664000175000017500000000031215174404631021045 0ustar alastairalastairprogram allocated_04 implicit none integer, allocatable :: x allocate(x) allocate(x) ! Error: double allocation of scalar print *, "Should not reach here" end program allocated_04 lfortran-0.63.0/tests/errors/init1.f900000664000175000017500000000004015174404631017634 0ustar alastairalastairprogram init1 integer x = 1 end lfortran-0.63.0/tests/errors/unterminated_comment_01.f900000664000175000017500000000030315174404631023333 0ustar alastairalastair#if !defined pi_constant #define PI 3.14 #endif /* unterminated comment starts here program unterminated_comment_01 implicit none print *, "PI: ", PI end program unterminated_comment_01 lfortran-0.63.0/tests/errors/incompatible_ranks_allocatable_arr2.f900000664000175000017500000000046715174404631025742 0ustar alastairalastairprogram incompatible_ranks_allocatable_arr2 implicit none ! allocatable array of rank 3 integer, allocatable :: arr1(:, :, :) ! allocatable array of rank 1 integer, allocatable :: arr3(:) ! RHS is an allocatable array of rank 3 ! incompatible assignment arr3 = arr1 end program lfortran-0.63.0/tests/errors/incompatible_dimension_assignment_arr2.f900000664000175000017500000000060315174404631026506 0ustar alastairalastairprogram incompatible_dimension_assignment_arr2 implicit none ! integer array of rank 3 and shape 2, 2, 2 integer :: x(1:2,1:2,1:2) ! integer array of rank 3 and shape 2, 2, 1 integer :: y(1:2,1:2,1:1) x = reshape([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]) y = reshape([1, 2, 3, 4], [2, 2, 1]) ! invalid assignment, as shapes are different y = x end program lfortran-0.63.0/tests/errors/cpp_err6.f900000664000175000017500000000010115174404631020326 0ustar alastairalastairprogram cpp_err6 #if 1 + (1+2 ( #endif print *, 'OK' end program lfortran-0.63.0/tests/errors/array_bounds_check_02.f900000664000175000017500000000033215174404631022742 0ustar alastairalastairprogram array_bounds_check_02 integer :: x x = 4 call temp(x) contains subroutine temp(x) integer, intent(in) :: x integer :: y(x) y = [1, 2, 3] end subroutine end program lfortran-0.63.0/tests/errors/array_size_03.f900000664000175000017500000000016015174404631021265 0ustar alastairalastairprogram arrays_02 implicit none integer :: a(3) integer :: size_a size_a = size(a, kind1=4) end lfortran-0.63.0/tests/errors/array_size_04.f900000664000175000017500000000017415174404631021273 0ustar alastairalastairprogram array_size_04 implicit none integer :: a(3) integer :: size_a size_a = size(a, kind1=4, dim1=1) end lfortran-0.63.0/tests/errors/func_parameter_type_02.f900000664000175000017500000000037315174404631023156 0ustar alastairalastairSUBROUTINE sub(f) IMPLICIT DOUBLE PRECISION (A-H) EXTERNAL f H=HINIT853(f) RETURN END FUNCTION HINIT853(f) IMPLICIT DOUBLE PRECISION (A-H) RETURN END program main EXTERNAL f call sub(f) end programlfortran-0.63.0/tests/errors/template_error_03.f900000664000175000017500000000206415174404631022146 0ustar alastairalastairmodule template_error_03_m implicit none private public :: add_t requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = F(x, y) end function end template contains subroutine func_arg_real(x, y) real, intent(in) :: x, y end subroutine subroutine test_template() instantiate add_t(real, func_arg_real), only: add_real => add_generic real :: x, y x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) if (abs(add_real(x, y) - 12.3) > 1e-5) error stop end subroutine end module program template_error_03 use template_error_03_m implicit none call test_template() end program template_error_03 lfortran-0.63.0/tests/errors/subroutine3.f900000664000175000017500000000014615174404631021101 0ustar alastairalastairprogram sizef call f() contains subroutine f() print *, size(f) end subroutine end programlfortran-0.63.0/tests/errors/type_mismatch2.f900000664000175000017500000000011215174404631021540 0ustar alastairalastairprogram type_mismatch2 implicit none integer :: x x = 5 + "x" end program lfortran-0.63.0/tests/errors/string_assignment_02.f900000664000175000017500000000024015174404631022651 0ustar alastairalastairprogram string_assignment_02 implicit none character(10), allocatable :: a character(:), allocatable :: b a = b end program string_assignment_02lfortran-0.63.0/tests/errors/array_transfer_01.f900000664000175000017500000000016315174404631022140 0ustar alastairalastairprogram arrays_01 implicit none integer :: a(3) real :: size_a print *, transfer(a, 1, size_a) end lfortran-0.63.0/tests/errors/array_01.f900000664000175000017500000000010415174404631020227 0ustar alastairalastairprogram array_01 implicit none integer :: a(5) a = [] end program lfortran-0.63.0/tests/errors/array_size_02.f900000664000175000017500000000016115174404631021265 0ustar alastairalastairprogram arrays_02 implicit none integer :: a(3) integer :: size_a size_a = size(a, 1, dim=1) end lfortran-0.63.0/tests/errors/incorrect_array_type_where_01.f900000664000175000017500000000023615174404631024540 0ustar alastairalastairprogram main implicit none integer :: b(5) where([1, 2, 3, 4, 5]) b = 1 print *, b if (all(b /= [1, 0, 1, 0, 1])) error stop end program mainlfortran-0.63.0/tests/errors/cmplx_02.f900000664000175000017500000000011715174404631020241 0ustar alastairalastairprogram cmplx_02 ! print*, cmplx((real(1, kind=4), 0.00000000), kind=8) endlfortran-0.63.0/tests/errors/array_bounds_check_14.f900000664000175000017500000000042315174404631022746 0ustar alastairalastairmodule array_bounds_check_14_mod contains subroutine f(i) integer, intent(in) :: i(:) print *, i end subroutine end module program array_bounds_check_14 use array_bounds_check_14_mod integer, allocatable :: x(:) call f(x) end program lfortran-0.63.0/tests/errors/incorrect_type_where_02.f900000664000175000017500000000015015174404631023336 0ustar alastairalastairprogram main implicit none integer :: b(5) where(1) b = 12121 print *, b end program main lfortran-0.63.0/tests/errors/end_sub_name.f900000664000175000017500000000024415174404631021235 0ustar alastairalastairsubroutine swap(x, y) integer, intent(inout) :: x, y integer :: tmp tmp = x x = y y = tmp end subroutine reverse program name end program name lfortran-0.63.0/tests/errors/cpp2.f900000664000175000017500000000020615174404631017460 0ustar alastairalastairprogram cpp2 implicit none #define X123 12345678 integer :: x x = (2+3)*5 ! Error: `yy` not defined: print *, x, X123, yy end program lfortran-0.63.0/tests/errors/esub2.f900000664000175000017500000000006215174404631017634 0ustar alastairalastairsubroutine g() integer :: x x = ~1 end subroutine lfortran-0.63.0/tests/errors/fixed_number_of_args.f900000664000175000017500000000011515174404631022762 0ustar alastairalastairprogram fixed_number_of_args complex :: a a = complex(1) end program lfortran-0.63.0/tests/errors/array_bounds_check_05.f900000664000175000017500000000042215174404631022745 0ustar alastairalastairprogram array_bounds_check_05 integer, allocatable :: x(:) allocate(x(3)) x = [1, 2, 3] call my(x, 5) contains subroutine my(x, i) integer, intent(in) :: x(i) integer, intent(in) :: i end subroutine end program lfortran-0.63.0/tests/errors/template_error_07c.f900000664000175000017500000000166215174404631022320 0ustar alastairalastairmodule template_01_m implicit none private public :: op_t requirement semigroup(t, combine) type, deferred :: t elemental function combine(x, y) result(combined) type(t), intent(in) :: x, y type(t) :: combined end function end requirement requirement extended_semigroup(t, combine, sconcat, stimes) require :: semigroup(t, scombine) pure function sconcat(list) result(combined) type(t), intent(in) :: list(:) type(t) :: combined end function elemental function stimes(n, a) result(repeated) integer, intent(in) :: n type(t), intent(in) :: a type(t) :: repeated end function end requirement contains subroutine test_template() end subroutine end module program template_01 use template_01_m implicit none end program template_01lfortran-0.63.0/tests/errors/incompatible_dimension_logical_arrays_logical_binop_01.f900000664000175000017500000000017415174404631031567 0ustar alastairalastairprogram main logical, parameter :: x1(3) = [.true., .false., .false.] print *, x1 .neqv. [.true., .true.] end program lfortran-0.63.0/tests/errors/subroutine1.f900000664000175000017500000000016315174404631021076 0ustar alastairalastairprogram subroutine1 call bpe() contains subroutine bpe() bpe = 1 end subroutine end programlfortran-0.63.0/tests/errors/assign_01.f900000664000175000017500000000015315174404631020401 0ustar alastairalastairprogram assign_01 implicit none integer, parameter :: x = 2 x = 1 print *, x end program lfortran-0.63.0/tests/errors/matrix_matmul_02.f900000664000175000017500000000020115174404631021773 0ustar alastairalastairprogram matrix_matmul_02 implicit none character :: a(3, 3) integer :: b(3, 3) print *, matmul(b, a) end program lfortran-0.63.0/tests/errors/cpp3.f900000664000175000017500000000021115174404631017455 0ustar alastairalastairprogram cpp3 implicit none #define X123 12345678 integer :: x, y x = (2+3)*5 ! Error: `xx` not defined: print *, xx, X123, y end program lfortran-0.63.0/tests/errors/array_constructor_with_different_types.f900000664000175000017500000000012015174404631026677 0ustar alastairalastairprogram array_constructor_with_different_types print *, [1, 2.] end program lfortran-0.63.0/tests/errors/derived_type_02.f900000664000175000017500000000043615174404631021605 0ustar alastairalastairmodule test private type, abstract :: tester contains procedure(testing_interface), deferred :: testing end type tester abstract interface subroutine testing_interface() end subroutine testing_interface end interface end module test lfortran-0.63.0/tests/errors/sign_01.f900000664000175000017500000000006515174404631020057 0ustar alastairalastairprogram sign_01 print *, sign(1, 1_8) end programlfortran-0.63.0/tests/errors/intrinsics6.f900000664000175000017500000000007115174404631021067 0ustar alastairalastairprogram intrinsics6 print *, ieor(1, 1_8) end programlfortran-0.63.0/tests/errors/array_bounds_check_08.f900000664000175000017500000000036515174404631022756 0ustar alastairalastairprogram array_bounds_check_08 integer, allocatable :: arr(:) allocate(arr(5)) arr = ff() print *, size(arr) contains function ff() result(res) integer :: res(100000) res(100000) = 9999 end function end program lfortran-0.63.0/tests/errors/dim_float_01.f900000664000175000017500000000006615174404631021056 0ustar alastairalastairprogram main print *, sum([1, 2, 3], 1.1) end programlfortran-0.63.0/tests/errors/matrix_matmul_01.f900000664000175000017500000000020115174404631021772 0ustar alastairalastairprogram matrix_matmul_01 implicit none character :: a(3, 3) integer :: b(3, 3) print *, matmul(a, b) end program lfortran-0.63.0/tests/errors/intrinsics10.f900000664000175000017500000000015015174404631021140 0ustar alastairalastairprogram intrinsics10 integer(4) :: x = 1 integer(8) :: y = 2 print *, ieor(x, y) end programlfortran-0.63.0/tests/errors/matrix_matmul_05.f900000664000175000017500000000020515174404631022002 0ustar alastairalastairprogram matrix_matmul_05 implicit none integer :: a(3, 3) integer :: b(3, 3, 3, 3) print *, matmul(a, b) end program lfortran-0.63.0/tests/errors/do_zero_increment.f900000664000175000017500000000014015174404631022316 0ustar alastairalastairprogram main implicit none integer :: i do i = 1, 5, 0 write(*,*) i end do end program main lfortran-0.63.0/tests/errors/continue_compilation_simd.f900000664000175000017500000000115515174404631024056 0ustar alastairalastairprogram continue_compilation_simd implicit none ! This file is for testing SIMD error checks in !LF$ attributes simd :: simd_2d, simd_alloc, simd_ptr, simd_scalar, simd_char, x real :: simd_2d(8, 8) real, allocatable :: simd_alloc(:) real, pointer :: simd_ptr(:) real :: simd_scalar character :: simd_char(8) real :: x !simd_2d print *, simd_2d(1,1) !simd_alloc print *, simd_alloc !simd_ptr print *, simd_ptr !simd_scalar print *, simd_scalar !simd_char print *, simd_char !simd_array print *, x end program continue_compilation_simdlfortran-0.63.0/tests/errors/external1.f900000664000175000017500000000040215174404631020515 0ustar alastairalastairsubroutine sub() external f double precision f, y y = f(1.0d0) if (abs(y-1.0d0) >= 1e-8) error stop print *, y end subroutine double precision function f(x) double precision x f = x end function program main call sub() end program lfortran-0.63.0/tests/errors/function_01.f900000664000175000017500000000062115174404631020742 0ustar alastairalastairmodule add_m implicit none private contains integer function func_arg_int(x, y) result(z) integer, intent(in) :: x, y z = x + y end function subroutine test() real :: x, y x = 5.1 y = 7.2 print*, "The result is ", func_arg_int(x, y) end subroutine end module program add use add_m implicit none call test() end program add lfortran-0.63.0/tests/errors/matrix_matmul_06.f900000664000175000017500000000017115174404631022005 0ustar alastairalastairprogram matrix_matmul_06 implicit none integer :: a(3) integer :: b(3) print *, matmul(a, b) end program lfortran-0.63.0/tests/errors/intrinsics8.f900000664000175000017500000000014615174404631021074 0ustar alastairalastairprogram intrinsics8 integer(4) :: x = 1 integer(8) :: y = 2 print *, ior(x, y) end programlfortran-0.63.0/tests/errors/common1.f900000664000175000017500000000012615174404631020166 0ustar alastairalastairsubroutine solsy () double precision rowns(209) common /rowns/ rowns(209) end lfortran-0.63.0/tests/errors/template_error_07.f900000664000175000017500000000070615174404631022153 0ustar alastairalastairmodule template_error_07_m implicit none private public :: tmp requirement r(t, f) type, deferred :: t function f(x, y) result(z) type(t), intent(in) :: x, y type(t) :: z end function end requirement template tmp(t, f) require :: r(t) end template contains end module program template_error_07 use template_error_07_m implicit none end program template_error_07 lfortran-0.63.0/tests/errors/kind_invalid_int_of_int.f900000664000175000017500000000012215174404631023454 0ustar alastairalastairprogram kind_invalid_int_of_int implicit none integer(3) :: x end program lfortran-0.63.0/tests/errors/dim_float_03.f900000664000175000017500000000007615174404631021061 0ustar alastairalastairprogram main print *, sum([1, 2, 3], .true., 1.1) end programlfortran-0.63.0/tests/errors/arithmetic_if1.f900000664000175000017500000000023015174404631021501 0ustar alastairalastairprogram arithmetic_if1 integer :: x, c x = -3 c = 0 if ("yy") 1, 2, 3 1 c = c + 1 2 c = c + 2 3 c = c + 4 print *, c if (c /= 7) error stop end program lfortran-0.63.0/tests/errors/intrinsics12.f900000664000175000017500000000007415174404631021147 0ustar alastairalastairprogram intrinsics12 print *, max(12, 13.94) end programlfortran-0.63.0/tests/errors/integerStringInput_64.f900000664000175000017500000000056615174404631023002 0ustar alastairalastairprogram integerStringInput_int64 implicit none integer, parameter :: int64 = selected_int_kind(18) integer(int64) :: x open(unit=10, file="tests/invalidInput_integer.txt", status="unknown") do read(10, *, end=100) x print *, "Read int64 integer:", x end do 100 continue close(10) stop end program integerStringInput_int64 lfortran-0.63.0/tests/errors/modulo_01.f900000664000175000017500000000007015174404631020412 0ustar alastairalastairprogram modulo_01 print *, modulo(1, 0) end program lfortran-0.63.0/tests/errors/dim_float_02.f900000664000175000017500000000007115174404631021053 0ustar alastairalastairprogram main print *, sum([1, 2, 3], 1, 1.1) end programlfortran-0.63.0/tests/forall1.f900000664000175000017500000000203615174404631016643 0ustar alastairalastairprogram forall1 implicit none ! Only for Syntax check !>>>>>>>>>>>>> Single line statments <<<<<<<<<<<<<< FORALL (i=1:n) A(i,i) = B(i) forall (i=1:n:3, j=1:n:5) A(i,j) = SIN(A(j,i)) forall (i=1:n, j=1:n, i/=j) A(i,j) = REAL(i+j) forall (i=1:n, j=1:m, A(i,j).NE.0) & A(i,j) = 1/A(i,j) forall (i=1:1000, j=1:1000, i /= j) A(i,j) = A(j,i) !>>>>>>>>>>>>> Multipe line statements <<<<<<<<<<<<<< forall (j = 1:n) shared(i) local(x) default(none) forall (i=1:j) A(i,j) = B(i) end forall forall (i = 1:N) reduce(*: s) s = s + a(i) end forall FORALL(i = 3:N + 1, j = 3:N + 1) C(i, j) = C(i, j + 2) + C(i, j - 2) D(i, j) = C(i, j) + C(i + 2, j) + C(i - 2, j) end FORALL forall (x=1:100, J(x)>0) where (I(x,:)<0) I(x,:)=0 elsewhere I(x,:)=1 end where end forall outer: forall (i=1:100) inner: forall (j=1:100, i.NE.j) A(i,j) = A(j,i) end forall inner end forall outer end program lfortran-0.63.0/tests/subroutine1.f900000664000175000017500000000025115174404631017560 0ustar alastairalastairsubroutine g() integer :: x, i x = 1 do i = 1, 10 x = x*i end do end subroutine subroutine h() integer :: x, i x = 1 do i = 1, 10 x = i*x end do end subroutine lfortran-0.63.0/tests/implicit_interface3.f900000664000175000017500000000011315174404631021212 0ustar alastairalastairsubroutine driver(f, n) integer, intent(in) :: n call f(n) end subroutine lfortran-0.63.0/tests/declaration1.f900000664000175000017500000000021615174404631017647 0ustar alastairalastairmodule declaration1 integer(4), dimension(1,1), parameter :: & arr = reshape([1, 1],shape(arr),order=[2,1]) end module declaration1 lfortran-0.63.0/tests/flush2.f900000664000175000017500000000021715174404631016505 0ustar alastairalastairprogram flush2 implicit none call flush() open(10, file="file_01_data.txt") call flush(10) call flush() end program flush2 lfortran-0.63.0/tests/integer_to_real_cast_in_comparison.f900000664000175000017500000000045615174404631024403 0ustar alastairalastairprogram expr2 implicit none integer, parameter :: dp = kind(0.d0) contains elemental real(dp) function dabs(x) result(r) real(dp), intent(in) :: x if (x > 0) then r = x else r = 0 - x end if end function dabs end program lfortran-0.63.0/tests/style1.f900000664000175000017500000000042015174404631016517 0ustar alastairalastairprogram save4 implicit none integer :: y = 1 if (y .eq. 1) then print *, "y is 1" end if contains subroutine f() integer :: x = 5 if (x .eq. 1) then print *, "x is 1" end if end subroutine end programlfortran-0.63.0/tests/sole_intrinsic.f0000664000175000017500000000050715174404631020157 0ustar alastairalastair program main intrinsic aimag, cmplx, real !TODO for the below: runtime ComplexConstructor not !implemented yet complex f f = cmplx(3, 1) complex :: x = (1.0, -3.0) real :: y y = aimag(x) intrinsic mod end program lfortran-0.63.0/tests/fixed_form5.f0000664000175000017500000000022715174404631017341 0ustar alastairalastair COMPLEX*16 FUNCTION ZDOTC(N,D1X) INTEGER N COMPLEX*16D1X(*) CHARACTER*2D2V D2V="AB" RETURN END lfortran-0.63.0/tests/implicit9.f900000664000175000017500000000067715174404631017217 0ustar alastairalastairinteger function a(d, e) implicit integer (a,b-c) implicit integer*4 (d-e) implicit integer*8 (f-g) implicit real (h) implicit real*4 (i-k) implicit real*8 (l) implicit complex (m, n) implicit complex*8 (o) implicit complex*16 (p) implicit double precision (q) implicit double precision (r) integer :: Y(e) real :: X(d, e, e) real :: b Y(1) = 3 X(1, 1, 1) = 3 a = 1 b = 2 d = 3 f = 4 h = 5 i = 6 l = 7 m = 8 o = 9 p = 10 q = 11 r = 12 end functionlfortran-0.63.0/tests/interface2.f900000664000175000017500000000060515174404631017325 0ustar alastairalastairmodule interface2 implicit none abstract interface subroutine read_params(this, params) import class(porous_drag_model), intent(inout) :: this type(parameter_list), pointer, intent(in) :: params end subroutine read_params end interface INTERFACE ASSIGNMENT(=) MODULE PROCEDURE SomeProc PROCEDURE SomeProc2 PROCEDURE :: SomeProc3 END INTERFACE end module lfortran-0.63.0/tests/external_03.f900000664000175000017500000000027215174404631017427 0ustar alastairalastairsubroutine b() external f call a(f) end subroutine subroutine a(f) real r external f r = f(2.0) print *, r end subroutine program external_03 call b() end program lfortran-0.63.0/tests/shiftl1.f900000664000175000017500000000012715174404631016654 0ustar alastairalastairprogram shiftl1 integer :: x,y print *, shiftl(1, 2) print *, shiftl(x,y) end program lfortran-0.63.0/tests/stdin_read_blank_lines_01.f900000664000175000017500000000062415174404631022261 0ustar alastairalastairprogram stdin_read_blank_lines_01 implicit none integer :: i integer :: m integer :: n integer, parameter :: expected_m(2) = [10, 20] integer, parameter :: expected_n(2) = [5, 10] do i = 1, 2 read(*, *) m read(*, *) n if (m /= expected_m(i)) error stop 1 if (n /= expected_n(i)) error stop 1 end do end program stdin_read_blank_lines_01 lfortran-0.63.0/tests/derived_types_05.f900000664000175000017500000000144415174404631020457 0ustar alastairalastairmodule tomlf_utils_convert use tomlf_datetime, only : toml_datetime, toml_date, toml_time implicit none public :: convert_raw public :: toml_raw_to_timestamp interface convert_raw module procedure :: toml_raw_to_timestamp end interface convert_raw contains function toml_raw_to_timestamp(raw, timestamp) result(stat) !> Raw value to convert character(len=*), intent(in) :: raw !> TOML datetime value type(toml_datetime), intent(out) :: timestamp !> Status of the evaluation logical :: stat integer :: err, dot_pos, first first = 1 timestamp%date = toml_date() ! read(raw(1:4), *, iostat=err) timestamp%date%year stat = err == 0 ! timestamp%time = toml_time() end function toml_raw_to_timestamp end module tomlf_utils_convert lfortran-0.63.0/tests/if1.f900000664000175000017500000000040415174404631015757 0ustar alastairalastairprogram if1 integer :: i i = 5 if (i == 5) print *, 'correct' if (i == 6) print *, 'incorrect' i = -2 40 i = i + 1 if (i) 50, 60, 70 50 print *, 'i < 0' go to 40 60 print *, 'i == 0' go to 40 70 print *, 'i > 0' end program lfortran-0.63.0/tests/fixed_form_goto_select.f0000664000175000017500000000030115174404631021634 0ustar alastairalastair program main integer k k = 1 100 print *, "hello" 200 k = k+1 integer m,n m = 1 n = 2 goto (200, 100) m goto (100, 200) n end program lfortran-0.63.0/tests/boz1.f900000664000175000017500000000015015174404631016151 0ustar alastairalastairb'101' B'101' b"101" B"101" o'174' O'106' o"151" O"131" z'194a' Z'b108' z"f161" Z"1d31" z"C1B1" Z"1E3A" lfortran-0.63.0/tests/no_prescan_include2.f900000664000175000017500000000007115174404631021214 0ustar alastairalastairprogram include2 include 'include2b.f90' end program lfortran-0.63.0/tests/implied_do_loop1.f900000664000175000017500000000037715174404631020530 0ustar alastairalastairPROGRAM implied_do_loop1 INTEGER :: i, j REAL, DIMENSION(2) :: A A(1) = 12.9 A(2) = 12.9 print *, (i, A(i), i = 1, 2) ! write(11, *) (i, ( j, A(j), j = 1, 2), A(i), i = 1, 2) print *, (i, ( j, A(j), j = 1, 2), A(i), i = 1, 2) END PROGRAM implied_do_loop1 lfortran-0.63.0/tests/fixed_form_implicit3.f0000664000175000017500000000136315174404631021233 0ustar alastairalastair CHARACTER FUNCTION C0(A) END CHARACTER*1 FUNCTION C1(A) END CHARACTER*11 FUNCTION C11(A) END CHARACTER*111 FUNCTION C111(A) END CHARACTER*(*) FUNCTION CSTAR(A) END INTEGER FUNCTION I0(A) END INTEGER*4FUNCTION I4(A) END INTEGER*8FUNCTION I8(A) END REAL FUNCTION R0(A) END REAL*4 FUNCTION R4(A) END REAL*8 FUNCTION R8(A) END COMPLEX FUNCTION CM0(A) END COMPLEX*8 FUNCTION CM4(A) END COMPLEX*16 FUNCTION CM8(A) END LOGICAL FUNCTION L0(A) END LOGICAL*1 FUNCTION L1(A) END LOGICAL*4 FUNCTION L4(A) END lfortran-0.63.0/tests/parameter1.f900000664000175000017500000000024015174404631017337 0ustar alastairalastairsubroutine dcstep() double precision zero, p66, two, three, s parameter (zero=0.0d0,p66=0.66d0,two=2.0d0,three=3.0d0) s = max(abs(three),abs(two),abs(p66)) end lfortran-0.63.0/tests/preprocessor14.f900000664000175000017500000000170315174404631020176 0ustar alastairalastairprogram preprocessor14 #define X DEC(4 - 3) #define DEC(n) (n) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X (4 - 3) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X 4-3 #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #define X DEC(10 % 3) #define DEC(n) (n) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X (10 % 3) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X 10%3 #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif end program lfortran-0.63.0/tests/derived_types_10.f900000664000175000017500000000213015174404631020444 0ustar alastairalastairmodule my_module type :: my_super_type integer :: x end type type :: my_type integer :: x type(my_super_type) :: super ! procedure(print_something), pointer :: p_ptr contains final :: finalize procedure :: proc => print_something procedure :: unary, plus generic :: operator(+) => unary, plus generic :: g_proc => plus, unary end type my_type contains subroutine finalize(self) type(my_type), intent(inout) :: self end subroutine finalize subroutine print_something(self, str) class(my_type), intent(inout) :: self character(len=*), intent(in) :: str print *, str end subroutine print_something subroutine say_something(self, msg) class(my_type), intent(inout) :: self character(len=*), intent(in) :: msg print *, msg end subroutine pure type(my_type) function unary(self, x) class(my_type), intent(in) :: self, x end function unary pure type(my_type) function plus(self) class(my_type), intent(in) :: self end function plus end module my_modulelfortran-0.63.0/tests/continue_body_if_loop.f0000664000175000017500000000034715174404631021505 0ustar alastairalastair REAL U, S DIMENSION U(100) S = 0.0 INTEGER J DO 1 J = 1, 100 S = S + U(J) IF ( S .GE. 1000000 ) GO TO 2 1 CONTINUE STOP 2 CONTINUE END lfortran-0.63.0/tests/logical_to_int_cast_fortran_codegen.f900000664000175000017500000000052115174404631024517 0ustar alastairalastairprogram ImplicitLogicalToIntCastExample implicit none logical :: logicalValue integer :: integerValue ! Assign a logical value logicalValue = .TRUE. ! Perform an implicit logical to integer cast integerValue = logicalValue print *, integerValue end program ImplicitLogicalToIntCastExample lfortran-0.63.0/tests/return1.f900000664000175000017500000000032615174404631016703 0ustar alastairalastairsubroutine example (s) character s* 32 write (*,*) s return end ! Syntax check only subroutine example1 (i, a, b, c) if (i .eq. a) return 1 if (i .eq. b) return 2 if (i .eq. c) return 3 end lfortran-0.63.0/tests/format1.f900000664000175000017500000001212215174404631016651 0ustar alastairalastairprogram format_04 real :: a,b,c,d,e(6) double precision :: r,s,t,real_hundred real, parameter :: t1 = 3.47399991e-03, t2 = 3.47000011e-03 integer :: f,i,j real(8) :: p,q a = 123.456 b = 123.45678 c = 12.34 d = 123.45 f = 12345 i = 19 j = 21 r = 12345678 s = 23.5678 t = 0.345678 p = 2.0d0 q = 0.0d0 e = [-1.70138506e+38, -1.25381181e+38, 8.69779800e+37, & -1.40706263e+37, 1.11501114e+37, -9.56332244e+37] real_hundred = 100.0 print *, "ok", "b" print '(a,a)', "ok", "b" print 1, "ok", "b" 1 FORMAT ( a, a ) print '("Success!",/,10X,A6,"World!")',"Hello 123" print 2, "Hello 123" 2 FORMAT ("Success!",/,10 X,A 6,"World!") print 3, "Hello 123" 3 FORMAT ("Success!",/,1 0 X , A 6,"World!") print '(4a4)',"dancing","in","the","moonlight" print 4,"dancing","in","the","moonlight" 4 FORMAT (4a4) print 5,"dancing","in","the","moonlight" 5 FORMAT (4 a 4) print '(A2,4(2X,A),I3)',"ab", "cdef", "ghi", "jkl","qwerty",12 print 6,"ab", "cdef", "ghi", "jkl","qwerty",12 6 FORMAT (A 2,4(2 X,A),I3) print 7,"ab", "cdef", "ghi", "jkl","qwerty",12 7 FORMAT (A 2,4 ( 2 X, A),I 3) print '(i3,i10.5,/i6.6,2x,i3)' , 123,456,12345,6789 print 8 , 123,456,12345,6789 8 FORMAT (i3,i10.5,/i6.6,2 x,i3) print 9 , 123,456,12345,6789 9 FORMAT (i 3,i 10. 5,/i 6 .6, 2 x,i 3) print '(d10.2,d15.6,d010.2,2x,d7.2)', 123.456, -123.45678, 12.34, -123.45 print 10, 123.456, -123.45678, 12.34, -123.45 10 FORMAT (d 10.2,d 15.6,d 010.2,2x,d 7.2) print 11, 123.456, -123.45678, 12.34, -123.45 11 FORMAT (d 10 .2,d 1 5. 6, d 0 10.2, 2 x, d 7 .2) print '(1pd10.2,2pd15.6,1pd010.2,2x,1pd9.2)', -a, b, -c, d print 12, -a, b, -c, d 12 FORMAT (1p d10.2,2 p d15.6,1p d010. 2,2 x,1pd9.2) print 13, -a, b, -c, d 13 FORMAT (1 p d 10.2,2 p d1 5.6,1p d 0 10. 2,2 x,1 p d 9.2) print '(-1pe10.2,-2pe15.6,1pe010.2,2x,1pe9.2)', -a, b, -c, d print 14, -a, b, -c, d 14 FORMAT (- 1 p e 10.2,-2 p e 15.6,1 p e 010 . 2, 2 x,1 pe 9.2) print 15, -a, b, -c, d 15 FORMAT (- 1 p e 10.2,-2 p e 15. 6,1 p e 01 0 . 2, 2 x, 1 pe 9. 2) print "(12(i3))", 1,2,3,4,5,6,7,8,9,10,11,12 print 16, 1,2,3,4,5,6,7,8,9,10,11,12 16 FORMAT ( 12 ( i 3 )) print "(4(i3),' hello')", 1,2,3,4,5,6,7,8,9,10,11,12,13,14 print 17, 1,2,3,4,5,6,7,8,9,10,11,12,13,14 17 FORMAT (4 ( i 3),' hello') print '(i0)', f, -f print 18, f, -f 18 FORMAT (i0) print '(d0.0,1x,d0.1,1x,d0.2)',a,b,c print 19,a,b,c 19 FORMAT (d0. 0,1 x,d0.1,1x,d 0.2) print 20, a, b, c 20 FORMAT (d 0. 0,1 x,d 0.1,1x, d 0.2) print '(d0.0,1x,d0.1,1x,d0.2)',-a,-b,-c print 21,-a,-b,-c 21 FORMAT (d 0.0,1x,d0.1,1x,d0.2) print '("Hello")' print '( F13.3,1X,F9.6,1X, F0.2 )', r, s, t print 22, r, s, t 22 FORMAT ( F13.3,1 X,F9.6,1X, F0.2 ) print 23, r, s, t 23 FORMAT ( F 13.3,1 X,F 9.6,1 X, F 0. 2 ) print '( F13.3,1X,F9.6,1X, F0.2 )', -r, -s, -t print 24, -r, -s, -t 24 FORMAT ( F 13.3,1X,F 9.6,1X, F0.2 ) print '(1PE13.6)', p, q print 25, p, q 25 FORMAT (1PE13.6) print '(F30.25)', 12345e-25 print 26, 12345e-25 26 FORMAT (F30.25) print '("x:", F4.2, " y:", ES7.1)', 1.123, 4.456 print 27, 1.123, 4.456 27 FORMAT ("x:", F4.2, " y:", ES7.1) print 28, 1.123, 4.456 28 FORMAT ("x:", F 4. 2, " y:", E S 7.1) print '("x:", ES10.2)', 0.999, 0.1 print 29, 0.999, 0.1 29 FORMAT ("x:", E S 10.2) print '("x:", ES15.5)', 0.102212 print 30, 0.102212 30 FORMAT ("x:", ES15.5) print "(*(es15.5e2,1x))", e print 31, e 31 FORMAT (*(es15.5e2,1x)) print 32, e 32 FORMAT (*( es 15. 5e2, 1 x)) ! test for issue: https://github.com/lfortran/lfortran/issues/4001 print "(F10.3)", abs(t2-t1) print 33, abs(t2-t1) 33 FORMAT (F10.3) print "(F10.3)", t2-t1 print 34, t2-t1 34 FORMAT (F10.3) print 35, t2-t1 35 FORMAT ( F 10. 3) print "(F0.6)", real_hundred print 36, real_hundred 36 FORMAT (F10.3) ! test for issue: https://github.com/lfortran/lfortran/issues/6348 print '(A,F0.0,A)', '"',0.0 ,'"' ! test for issue: https://github.com/lfortran/lfortran/issues/4040 print "(2 (I3))", i, j print 37, i, j 37 FORMAT (I3) print "(2 (I 3))", i, j print 38, i, j 38 FORMAT (2 (I3)) ! test for issue: https://github.com/lfortran/lfortran/issues/6761 print "(2((I0), 1x))", i, j ! test for issue: https://github.com/lfortran/lfortran/issues/6748 print "((A))))", ' foobar' print "((A))x", ' foobar' print "(a)xx)", ' foobar' ! the below test also ensures that blank character ! isn't removed from ' Dates: ' print 39, i, i + 1, j + 1, i + 2, j + 2 39 FORMAT (I12, /, ' Dates: ', 2 (2I3, I5)) print 40, i, i + 1, j + 1, i + 2, j + 2 40 FORMAT (I 1 2, /, ' Dates: ', 2 ( 2 I 3, I 5 )) print 41, i, i + 1, j + 1, i + 2, j + 2 41 FORMAT (I 12, /, ' Dates: ', 2 (2I3, I5)) print 42, i, i + 1, j + 1, i + 2, j + 2 42 FORMAT (I 1 2, /, ' Dates: ', 2 (2 I 3, I 5)) end program lfortran-0.63.0/tests/implicit2.f900000664000175000017500000000024215174404631017174 0ustar alastairalastairinteger function a() implicit real (a,b,c,d) implicit integer (e,f,g) implicit real (h-l, r-y) implicit complex (x-z) implicit double precision (m-q) end functionlfortran-0.63.0/tests/fixed_form_early_doloop.f0000664000175000017500000000023415174404631022022 0ustar alastairalastair program main integer k, l do 100 k=1,2 do 100 l=1,3 print *, k, l 100 continue end program lfortran-0.63.0/tests/fixed_form_simple_continue.f0000664000175000017500000000003215174404631022523 0ustar alastairalastair continue end lfortran-0.63.0/tests/fixedform_data.f0000664000175000017500000000017615174404631020111 0ustar alastairalastair subroutine f() integer x real one, two data x /1/ DATA ONE, TWO /1.0, 2.0/ end subroutine lfortran-0.63.0/tests/external_04.f900000664000175000017500000000005715174404631017431 0ustar alastairalastairsubroutine a() external f, g call b(f, g) end lfortran-0.63.0/tests/special_chars_json.f900000664000175000017500000000011715174404631021132 0ustar alastairalastairprogram special_chars_json ! A "comment". print *, "A ""string""." end lfortran-0.63.0/tests/array8.f900000664000175000017500000000013515174404631016507 0ustar alastairalastairprogram array8 implicit none character(255) :: a(4) character b(4)*255, c(4)*255 end program lfortran-0.63.0/tests/fmt1.f900000664000175000017500000000067015174404631016154 0ustar alastairalastairreal(kind=c_float) r real(c_float) r character(kind=c_char) c character(*) c character(len=*) c character(len=*, kind=c_char) c character(*, kind=c_char) c character(kind=c_char, len=*) c character(:) c character(len=:) c character(len=:, kind=c_char) c character(:, kind=c_char) c character(kind=c_char, len=:) c character(n) c character(len=n) c character(len=n, kind=c_char) c character(n, kind=c_char) c character(kind=c_char, len=n) c lfortran-0.63.0/tests/real_to_integer_cast_fortran_codegen.f900000664000175000017500000000060515174404631024676 0ustar alastairalastairprogram ImplicitRealToIntCastExample implicit none real :: realNumber integer :: integerValue ! Assign a real number realNumber = 3.14 ! Perform an implicit real to integer cast integerValue = realNumber ! Output the result print *, "Real Number:", realNumber print *, "Integer Value:", integerValue end program ImplicitRealToIntCastExample lfortran-0.63.0/tests/fixedform_assignment.f0000664000175000017500000000041515174404631021344 0ustar alastairalastair integer a, b,c,d, k a = 1 b = 2 c = a *b/2 d = c*c print *, a, b, c, d do 80 k=1,20 print *, 1 80 end do 120 if (a < b) then a = 2 * b else b = 33 * c endif end lfortran-0.63.0/tests/preprocessor2.f900000664000175000017500000000027315174404631020114 0ustar alastairalastairprogram preprocessor2 implicit none #define X123 12345678 #define Y123 X123 #define A123 Y123 #define B123 A123 #define C123 B123 integer :: x, y x = (2+3)*5 print *, x, C123 end program lfortran-0.63.0/tests/external1.f900000664000175000017500000000010515174404631017201 0ustar alastairalastair subroutine iddr_rsvd(matvect) implicit none external matvect end lfortran-0.63.0/tests/modules1_module1.f900000664000175000017500000000037515174404631020466 0ustar alastairalastairmodule abc implicit none type :: t1 contains procedure :: f end type t1 contains pure function f(self) result(match) class(t1), intent(in), optional :: self logical :: match end function f end module abc lfortran-0.63.0/tests/classes2.f900000664000175000017500000000166515174404631017031 0ustar alastairalastair! Source - Page 44 of https://personalpages.manchester.ac.uk/staff/david.d.apsley/lectures/fortran/fortranB.pdf module Defs implicit none private public point, point2d type, abstract :: point contains procedure(func), deferred :: radius end type point abstract interface real function func( this ) import point class(point) this end function func end interface type, extends(point) :: point2d real x, y contains procedure :: radius => r2d end type point2d contains real function r2d( this ) class(point2d) this r2d = sqrt( this%x ** 2 + this%y ** 2 ) end function r2d end module Defs program main use Defs implicit none real :: res class(point), pointer :: ptr type(point2d), target :: p2d = point2d( 3, 4 ) ptr => p2d res = ptr%radius() if (res /= 5.0) error stop end program main lfortran-0.63.0/tests/implicit7.f900000664000175000017500000000023015174404631017176 0ustar alastairalastairinteger function a(n,m) implicit real (n) implicit integer (m) implicit real*8 (k) integer :: X(m), Y(m) n = 5 m = 8 X = [1,2,3,4,5,6,7,8] end function lfortran-0.63.0/tests/read2.f900000664000175000017500000000035515174404631016302 0ustar alastairalastairprogram read2 implicit none character(256) :: phifile='default' character(60) :: val = "''" read(val, *) phifile print *, "phifile: ", phifile print *, phifile == "" print *, phifile == "''" end program read2 lfortran-0.63.0/tests/preprocessor3e.h0000664000175000017500000000003415174404631020106 0ustar alastairalastair#include "preprocessor3d.h" lfortran-0.63.0/tests/expr9.f900000664000175000017500000000022615174404631016351 0ustar alastairalastaircall ERROR_HANDLER%trigger(errors=.errors.rslt) .INVERSE. B .INVERSE. (A + B) .anotherunary.1 .anotherunary.(1+2) .anotherunary.C .anotherunary.(c+d) lfortran-0.63.0/tests/common1.f900000664000175000017500000000040015174404631016645 0ustar alastairalastairprogram common1 implicit real(a-z) real A, B common /sample/ A, B common /c/ c, /b/ d, e, f, /c/ g, h, i(5) common x, y, z(10) A = 10 B = 20 call pass() stop end program subroutine pass() real A, B common /sample/ A, B print *, A, B return end subroutine lfortran-0.63.0/tests/invalidInput_float.txt0000664000175000017500000000001715174404631021354 0ustar alastairalastairWRONG TESTCASESlfortran-0.63.0/tests/stdin_read_blank_lines_01.in0000664000175000017500000000001515174404631022263 0ustar alastairalastair10 5 20 10 lfortran-0.63.0/tests/fixed_form_call3.f0000664000175000017500000000027415174404631020334 0ustar alastairalastairc FAILURE test subroutine idd_frm(m,n,w,x,y) integer m,n,w,x,y,lw call prinf('lw = *',lw,1) call prinf('16m+70 = *',16*m+70,1)) return end lfortran-0.63.0/tests/preprocessor4.f900000664000175000017500000000023315174404631020112 0ustar alastairalastairprogram preprocessor4 implicit none #define XPOW(a) ((a)**2) #define X123(a,b) ((a)+XPOW(b)) integer :: x, y x = (2+3)*5 print *, x, X123(1,2) end program lfortran-0.63.0/tests/save2.f900000664000175000017500000000152315174404631016323 0ustar alastairalastairsubroutine save_sub() real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end subroutine real function save_fun() implicit none real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end function module save_module_2 implicit none public real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b contains subroutine sub_save() real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end subroutine real function fun_save() implicit none real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end function end module program main real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end program lfortran-0.63.0/tests/write4.f900000664000175000017500000000044615174404631016524 0ustar alastairalastairprogram write4 implicit none write (*, "(a)", advance="no") "hi, " write (*, "(a)") "how are you?" write (*, "(a)", advance="yes") "I " write (*, "(a)", advance="yes") "am" write (*, "(a)", advance="no") "doing " write (*, "(a)", advance="yes") "good" end program lfortran-0.63.0/tests/do_concurrent_reduce.f900000664000175000017500000000027215174404631021476 0ustar alastairalastairsubroutine sum_reduce(a, s) real, intent(in) :: a(:) real, intent(out) :: s integer :: N, i N = size(a) s = 0 do concurrent (i = 1:N) reduce(+: s) s = s + a(i) end do end subroutine lfortran-0.63.0/tests/wasm_i64.f900000664000175000017500000000135415174404631016736 0ustar alastairalastairprogram wasm1 implicit none print *, a_sqr_i64(1000000_8) print *, add_i64(1000000000000_8, 1000000000000_8) print *, test_i64() contains function a_sqr_i64(x) result(r) implicit none integer(8), intent(in):: x integer(8) :: r r = x * x return end function function add_i64(x, y) result(r) implicit none integer(8), intent(in):: x, y integer(8) :: r r = x + y return end function function test_i64() result(r) implicit none integer(8) :: x64, y64 integer(8) :: r x64 = 1000000000000_8 y64 = 2000000000000_8 r = add_i64(x64, y64) return end function end program lfortran-0.63.0/tests/derived_types_03.f900000664000175000017500000000070515174404631020454 0ustar alastairalastairprogram derived_types_03 ! AST only DO nn = 1, ndiag ing = diag(nn)%len ALLOCATE( diag(nn)%cell_id(ing), STAT=ierr ) IF ( ierr /= 0 ) RETURN ndpwds = ndpwds + SIZE( diag(nn)%cell_id ) END DO DO k = 1, nz DO j = 1, ny DO i = 1, ichunk nn = i + j + k - 2 indx(nn) = indx(nn) + 1 ing = indx(nn) diag(nn)%cell_id(ing)%ic = i diag(nn)%cell_id(ing)%j = j diag(nn)%cell_id(ing)%k = k END DO END DO END DO end program lfortran-0.63.0/tests/derived_type1.f900000664000175000017500000000064215174404631020050 0ustar alastairalastairmodule derived_type1 implicit none integer, public, parameter :: tfc = selected_char_kind('DEFAULT') type enum_escape character(len=1, kind=tfc) :: newline = achar(10, kind=tfc) end type enum_escape type(enum_escape), public, parameter :: toml_escape = enum_escape() character(kind=tfc, len=*), public, parameter :: nl = & &' '//toml_escape%newline end module derived_type1 lfortran-0.63.0/tests/block_data1.f900000664000175000017500000000053015174404631017444 0ustar alastairalastairblock data init implicit integer(a-z) common /range/ x0, x1 data x0, x1 / 1, 10 / end block data program block_data1 implicit integer(a-z) common /range/ x0, x1 print *, "Printing Even number in the Range: ", x0, " to ", x1 do i = x0, x1 if(mod(i, 2) /= 0) cycle write(*,*) i end do end program lfortran-0.63.0/tests/constant_kinds.f900000664000175000017500000000052715174404631020327 0ustar alastairalastairprogram constant_kinds implicit none integer, parameter :: i1 = 1 integer, parameter :: i2 = 1_4 integer, parameter :: i3 = 1_8 real, parameter :: r1 = 1.0 real, parameter :: r2 = 1.d0 real, parameter :: r3 = 1.0_4 real, parameter :: r4 = 1.0_8 integer :: x real :: y y = 1.0 y = 1.d0 y = 1.0_4 y = 1.0_8 x = 1 x = 1_4 x = 1_8 end program lfortran-0.63.0/tests/subroutine9.f900000664000175000017500000000060115174404631017567 0ustar alastairalastairsubroutine a() import, none implicit none end subroutine subroutine b() import, all implicit none end subroutine subroutine c() import a, b implicit none end subroutine subroutine d() import :: a, b implicit none end subroutine subroutine e() import, only: a, b implicit none end subroutine subroutine f() import :: a, b import :: c import :: d, e, f implicit none end subroutine lfortran-0.63.0/tests/modules_06.f900000664000175000017500000000040515174404631017256 0ustar alastairalastairmodule modules_06_b implicit none private public b contains integer function b() b = 5 end function end module module modules_06_a use modules_06_b, only: b implicit none private public a contains integer function a() a = 3 + b() end function end module lfortran-0.63.0/.well-known/0000775000175000017500000000000015174404631015773 5ustar alastairalastairlfortran-0.63.0/.well-known/funding-manifest-urls0000664000175000017500000000004115174404631022132 0ustar alastairalastairhttps://lfortran.org/funding.jsonlfortran-0.63.0/.pre-commit-config.yaml0000664000175000017500000000124615174404631020104 0ustar alastairalastairexclude: ^tests/.* repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.1.0 hooks: - id: trailing-whitespace exclude: ".md" - id: end-of-file-fixer - id: fix-encoding-pragma args: [--remove] - id: check-yaml exclude: ^(tests/|doc/) - id: check-toml - id: check-json - id: check-merge-conflict - id: pretty-format-json args: [--autofix] - id: debug-statements language_version: python3 - repo: https://github.com/pre-commit/mirrors-clang-format rev: v13.0.1 hooks: - id: clang-format args: [--style=file, -i] exclude: ".json" lfortran-0.63.0/GOVERNANCE.md0000664000175000017500000000104715174404631015573 0ustar alastairalastair# LFortran Governance ## Technical Decisions Technical decisions are made by the developer community by discussing at each Pull Request (PR) and arriving at a consensus. In case of disagreements, the project leader (OndÅ™ej ÄŒertík) will facilitate the discussion and help achieve a consensus. If a consensus cannot be achieved, the final decision will be made by the project leader. ## Financial Decisions Financial decisions are made by OndÅ™ej ÄŒertík and Milan Curcic with the goal to benefit and be good stewards of the LFortran community. lfortran-0.63.0/integration_tests/0000775000175000017500000000000015174404631017365 5ustar alastairalastairlfortran-0.63.0/integration_tests/arrays_123.f900000664000175000017500000000041415174404631021572 0ustar alastairalastairprogram arrays_123 implicit none type :: t integer :: a end type type(t), parameter :: v(2,1) = reshape([t(1), t(2)], [2, 1]) type(t) :: r(2) r = v(:, 1) if (r(1)%a /= 1) error stop if (r(2)%a /= 2) error stop print *, r(1)%a, r(2)%a end program lfortran-0.63.0/integration_tests/string_32.f900000664000175000017500000000143315174404631021520 0ustar alastairalastairmodule string32_mod type :: string_type sequence character(len=:), allocatable :: raw end type string_type interface operator(//) module procedure :: compare_string_type_with_char end interface contains pure function compare_string_type_with_char(s1, s2) result(res) type(string_type), intent(in) :: s1 character(len=*), intent(in) :: s2 type(string_type) :: res res%raw = s1%raw//s2 end function end module program string_32 use string32_mod, only: string_type, operator(//) implicit none type(string_type) :: a character(len=10) :: b type(string_type) :: res a%raw = "hi" b = "bye" res = a // b print *, res%raw if (res%raw /= "hibye") error stop end program lfortran-0.63.0/integration_tests/string_52.f900000664000175000017500000000035215174404631021521 0ustar alastairalastair module string_52_mod contains subroutine sub(x, char) integer :: x character(x),optional :: char end subroutine end module program string_52 use string_52_mod call sub(10) end program lfortran-0.63.0/integration_tests/doconcurrentloop_01.f900000664000175000017500000000101115174404631023575 0ustar alastairalastairprogram doconcurrentloop_01 implicit none real, dimension(10000) :: a, b, c real :: scalar integer :: i, nsize scalar = 10 nsize = size(a) do concurrent (i = 1:nsize) a(i) = 5 b(i) = 5 end do call triad(a, b, scalar, c) print *, "End Stream Triad" contains subroutine triad(a, b, scalar, c) real, intent(in) :: a(:), b(:), scalar real, intent(out) :: c(:) integer :: N, i N = size(a) do concurrent (i = 1:N) c(i) = a(i) + scalar * b(i) end do end subroutine end program lfortran-0.63.0/integration_tests/arrays_18_func.f900000664000175000017500000000055615174404631022537 0ustar alastairalastairprogram arrays_18_func real :: y(20) real :: a(20) integer :: i call f(a, 20, y, 1) do i = 1, 20 if (2 * y(i) /= a(i)) error stop end do contains recursive subroutine f(a, n, x, i) integer :: n, i real :: a(:) real :: x(n) x(i) = i a(i) = 2 * i if (i < n) then call f(a, n, x, i + 1) end if end subroutine end program lfortran-0.63.0/integration_tests/derived_types_120.f900000664000175000017500000000233515174404631023140 0ustar alastairalastair! Test accessing a procedure pointer member of a class type. ! This verifies that the pass_array_by_data pass correctly ! updates StructInstanceMember references when struct members ! are renamed due to procedure signature changes. module derived_types_120_mod implicit none type, abstract :: MyType procedure(pintfc), pointer, nopass :: ptr => null() end type MyType abstract interface function pintfc(n) result(res) integer(4), dimension(:), intent(in) :: n real(8) :: res end function pintfc end interface type, extends(MyType) :: ConcreteType end type ConcreteType contains function my_func(n) result(res) integer(4), dimension(:), intent(in) :: n real(8) :: res res = real(sum(n), 8) end function my_func end module derived_types_120_mod program derived_types_120 use derived_types_120_mod implicit none type(ConcreteType), target :: obj class(MyType), pointer :: myptr procedure(pintfc), pointer :: ptr integer :: arr(3) real(8) :: res obj%ptr => my_func myptr => obj ptr => myptr%ptr arr = [1, 2, 3] res = ptr(arr) if (abs(res - 6.0d0) > 1.0d-10) error stop print *, "PASS" end program derived_types_120 lfortran-0.63.0/integration_tests/sin_03.f900000664000175000017500000000017215174404631021000 0ustar alastairalastairprogram sin_03 use iso_fortran_env, only: dp => real64 implicit none real(dp) :: x x = sin(1.5_dp) print *, x end program lfortran-0.63.0/integration_tests/write_22.f900000664000175000017500000000145215174404631021344 0ustar alastairalastairprogram write_22 implicit none call test_implied_do_allocatable_string() call test_implied_do_allocatable_char1_stdout() contains subroutine test_implied_do_allocatable_string character(len=200) :: buf character(10), allocatable :: tmp_line integer :: i allocate(tmp_line) tmp_line = "Hello" write(buf, *) (tmp_line, i=1, 3) if (index(buf, "Hello") == 0) error stop if (index(buf, "HelloHello") == 0) then if (index(buf(11:), "Hello") == 0) error stop end if end subroutine subroutine test_implied_do_allocatable_char1_stdout character(1), allocatable :: tmp_line integer :: i tmp_line = "H" write(*, *) (tmp_line, i=1, 3) end subroutine end program write_22 lfortran-0.63.0/integration_tests/implicit_interface_34.f900000664000175000017500000000061715174404631024051 0ustar alastairalastairprogram implicit_interface_34 implicit none character*2 foo, s1, s2, s3 s1 = 'too long' s2 = 'also long' s3 = s1 // foo (s2) print *, 's3 = ', s3, merge (' : pass', ' : fail', s3 == 'to') if(s3 /="to") error stop if(merge (' : pass', ' : fail', s3 == 'to') /=" : pass") error stop end program function foo (s) character(2) :: foo character(*) :: s foo = s end functionlfortran-0.63.0/integration_tests/nested_24.f900000664000175000017500000000077215174404631021502 0ustar alastairalastairmodule nested_24_mod abstract interface function iface(x) integer, intent(in) :: x integer :: iface end function end interface contains function f(x) integer, intent(in) :: x integer :: f f = x + 10 end function end module program nested_24 use nested_24_mod implicit none procedure(iface), pointer :: p => f call sub() contains subroutine sub() if (p(1) /= 11) error stop if (p(5) /= 15) error stop print *, "ok" end subroutine end program lfortran-0.63.0/integration_tests/common_31.f900000664000175000017500000000047715174404631021510 0ustar alastairalastairsubroutine cmdo(s) common /block/ t integer :: t integer :: s integer :: i s = 0 do, i = 1, t s = s + t end do end subroutine program common_31 common /block/ t integer :: t integer :: s t = 3 call cmdo(s) if (s /= 9) error stop end program common_31lfortran-0.63.0/integration_tests/legacy_array_sections_17.f900000664000175000017500000000305115174404631024564 0ustar alastairalastairmodule legacy_array_sections_17_linalg_mod implicit none interface module function stdlib_clange(work) result(res) real, intent(inout) :: work(*) ! assumed-size real :: res end function stdlib_clange end interface end module legacy_array_sections_17_linalg_mod submodule (legacy_array_sections_17_linalg_mod) legacy_array_sections_17_linalg_impl implicit none contains module function stdlib_clange(work) result(res) real, intent(inout) :: work(*) real :: res res = work(1) end function stdlib_clange end submodule legacy_array_sections_17_linalg_impl module legacy_array_sections_17_driver_mod use legacy_array_sections_17_linalg_mod, only: stdlib_clange implicit none interface module subroutine repro(work) real, intent(inout) :: work(*) end subroutine repro end interface end module legacy_array_sections_17_driver_mod submodule (legacy_array_sections_17_driver_mod) legacy_array_sections_17_driver_impl implicit none contains module subroutine repro(work) real, intent(inout) :: work(*) real :: abnrm abnrm = stdlib_clange(work(1)) ! Basic validation if (abnrm /= work(1)) then error stop "ERROR: stdlib_clange returned wrong value" end if end subroutine repro end submodule legacy_array_sections_17_driver_impl program legacy_array_sections_17 use legacy_array_sections_17_driver_mod, only: repro implicit none real :: work(5) work = [1.0, 2.0, 3.0, 4.0, 5.0] call repro(work) print *, "Test passed" end program legacy_array_sections_17lfortran-0.63.0/integration_tests/submodule_09.f900000664000175000017500000000114315174404631022213 0ustar alastairalastairmodule stdlib_error_submodule_09 implicit none interface module subroutine error_stop(code) integer, intent(inout) :: code end subroutine error_stop end interface end module submodule (stdlib_error_submodule_09) f18estop_submodule_09 implicit none contains module procedure error_stop integer, parameter :: i = 3 code = i end procedure end submodule f18estop_submodule_09 program submodule_09 use stdlib_error_submodule_09 implicit none integer :: tester = 1 call error_stop(tester) print *, tester if (tester /= 3) error stop end programlfortran-0.63.0/integration_tests/file_31.f900000664000175000017500000000172515174404631021134 0ustar alastairalastairprogram file_31 use iso_fortran_env, only: int16 integer(int16), allocatable :: d(:,:) integer(int16), allocatable :: a(:) integer :: i, ios, s, j allocate(d(3,3)) allocate(a(3)) ! open a file and read data into the array open(unit=s, file='file_31_data.txt', status='old', action='read', iostat=ios) if (ios /= 0) then print *, "Error opening file" stop end if read(s, *, iostat=ios) a if (ios /= 0) then print *, "Error reading data" stop end if do i = 1, 3 do j = 1, 3 read(s, *, iostat=ios) d(i, j) if (ios /= 0) then print *, "Error reading data" stop end if end do end do close(s) print *, "Loaded data:" do i = 1, 2 print *, d(i, :) end do print *, sum(d) if ( sum(d) /= 1440 ) error stop print *, sum(a) if ( sum(a) /= 60 ) error stop end program file_31 lfortran-0.63.0/integration_tests/array_slice_01.f900000664000175000017500000000133715174404631022506 0ustar alastairalastairprogram array_slice_01 implicit none integer, target :: a(5, 6, 7, 19), sum_slice integer, pointer :: b(:, :), c(:) integer :: i, j, suma b => a(:, 3, 4:6, 17) a = 20 sum_slice = sum_array_slice(b) print *, sum_slice if( sum_slice /= 285 ) error stop do i = lbound(a, 1), ubound(a, 1) do j = 4, 6 if( a(i, 3, j, 17) /= 19 ) error stop end do end do suma = sum(a) print *, suma if( suma /= 79785 ) error stop contains function sum_array_slice(array) result(r) integer, intent(inout) :: array(:, :) integer :: i, j integer :: r r = 0 do i = lbound(array, 1), ubound(array, 1) do j = lbound(array, 2), ubound(array, 2) array(i, j) = 19 r = r + array(i, j) end do end do end function end program lfortran-0.63.0/integration_tests/namelist_18.f900000664000175000017500000000175615174404631022042 0ustar alastairalastairprogram test_namelist_derived_nested implicit none type :: inner_t integer :: vec(2) real :: mat(2, 2) end type type :: outer_t type(inner_t) :: inner integer :: tag real :: arr(3) end type type(outer_t) :: o namelist /nml/ o o%inner%vec = [10, 20] o%inner%mat = reshape([1.0, 2.0, 3.0, 4.0], [2, 2]) o%tag = 7 o%arr = [5.5, 6.5, 7.5] open(unit=10, file='namelist_dt_18.dat', status='replace', form='formatted') write(10, nml=nml) close(10) o%inner%vec = 0 o%inner%mat = 0.0 o%tag = 0 o%arr = 0.0 open(unit=10, file='namelist_dt_18.dat', status='old', form='formatted') read(10, nml=nml) close(10) if (any(o%inner%vec /= [10, 20])) error stop if (any(abs(o%inner%mat - reshape([1.0, 2.0, 3.0, 4.0], [2, 2])) > 1.0e-5)) error stop if (o%tag /= 7) error stop if (any(abs(o%arr - [5.5, 6.5, 7.5]) > 1.0e-5)) error stop end program test_namelist_derived_nested lfortran-0.63.0/integration_tests/equivalence_01.f900000664000175000017500000000071015174404631022504 0ustar alastairalastairprogram equivalence_01 implicit none integer mcheps(4) integer minmag(4) integer maxmag(4) double precision dmach(3) equivalence (dmach(1),mcheps(1)) equivalence (dmach(2),minmag(1)) equivalence (dmach(3),maxmag(1)) minmag = 2 mcheps = 1 if(minmag(1) /= 1 ) error stop if(minmag(2) /= 1 ) error stop if(minmag(3) /= 2 ) error stop if(minmag(4) /= 2 ) error stop if(mcheps(1) /= 1 ) error stop endlfortran-0.63.0/integration_tests/file_63.f900000664000175000017500000000211315174404631021131 0ustar alastairalastairprogram file_63 ! Test: unformatted sequential I/O with array records ! Verifies that reading back records after an array record works correctly. ! The trailing record marker must be consumed so subsequent reads succeed. use iso_fortran_env, only: int32, int64 implicit none integer(int32) :: a, c, ra, rc integer(int64) :: b(1), rb(1) integer(int32) :: d(3), rd(3) integer :: u, ierr a = 1; b(1) = 2_int64; c = 3 d = [10, 20, 30] open(newunit=u, form='unformatted', status='scratch', action='readwrite') write(u) a write(u) b write(u) c write(u) d rewind(u) read(u, iostat=ierr) ra if (ierr /= 0) error stop read(u, iostat=ierr) rb if (ierr /= 0) error stop read(u, iostat=ierr) rc if (ierr /= 0) error stop read(u, iostat=ierr) rd if (ierr /= 0) error stop close(u) if (ra /= 1) error stop if (rb(1) /= 2_int64) error stop if (rc /= 3) error stop if (rd(1) /= 10) error stop if (rd(2) /= 20) error stop if (rd(3) /= 30) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/print_arr_02.f900000664000175000017500000000140715174404631022210 0ustar alastairalastairprogram print_arr_with_selectcase implicit none integer :: i, out, m integer :: x(3) = [1, 2, 3], y(3) = [4, 5, 6] integer :: x1(3) = [10, 20, 30], y1(3) = [40, 50, 50] integer, parameter :: a = 1, b = 2 i = 2 m = 45 select case(i) case (1) print *, x out = x(1) case (2) print *, y out = y(1) case (3) print *, "3" out = -1 end select if (out /= 4) error stop select case (m) case ((40 + b):) print *, x1 out = x1(1) case (:(39 - a)) print *, y1 out = y1(1) case default print *, "Invalid" out = -1 end select if (out /= 10) error stop end lfortran-0.63.0/integration_tests/include_04.f900000664000175000017500000000026515174404631021636 0ustar alastairalastair program include_04 implicit none INCLUDE 'vals.inc' integer :: z z = x + y print *, z if (z /= 52) error stop end program include_04 lfortran-0.63.0/integration_tests/intrinsics_13.f900000664000175000017500000000100515174404631022371 0ustar alastairalastairprogram intrinsics_13 integer, parameter :: p = kind(5) ! 4 integer, parameter :: p1 = kind(5_4) ! 4 integer, parameter :: p2 = kind(5_8) ! 8 integer, parameter :: p3 = kind(0.d0) ! 8 integer, parameter :: p4 = kind(0.0) ! 4 integer, parameter :: p5 = kind(5._4) ! 4 integer, parameter :: p6 = kind(5._8) ! 8 integer, parameter :: p7 = kind(.true.) ! 4 if (p /= 4 .and. p1 /= 4 .and. p2 /= 8) error stop if (p3 /= 8 .and. p4 /= 4 .and. p5 /= 4) error stop if (p6 /= 8 .and. p7 /= 4) error stop end program lfortran-0.63.0/integration_tests/data_implied_do_06.f900000664000175000017500000000147615174404631023320 0ustar alastairalastairprogram data_implied_do_06 implicit none integer :: i2d(4,5) integer :: arr(3,3) integer :: b(6,3) integer :: i, j, k ! Test: implied-do with expression-based indices (i, i+1) data (i2d(i,i+1),i=1,4) / 91, -82, 73, -64/ if (i2d(1,2) /= 91) error stop if (i2d(2,3) /= -82) error stop if (i2d(3,4) /= 73) error stop if (i2d(4,5) /= -64) error stop ! Test: implied-do with subtraction expression in index data (arr(j, 4-j), j=1,3) / 10, 20, 30 / if (arr(1,3) /= 10) error stop if (arr(2,2) /= 20) error stop if (arr(3,1) /= 30) error stop ! Test: implied-do with multiplication expression in index data (b(2*k, 1), k=1,3) / 100, 200, 300 / if (b(2,1) /= 100) error stop if (b(4,1) /= 200) error stop if (b(6,1) /= 300) error stop end program lfortran-0.63.0/integration_tests/intrinsics_298.f900000664000175000017500000000602015174404631022472 0ustar alastairalastairprogram intrinsics_298 implicit none integer, parameter :: x1 = dot_product([1, 2, 3], [4, 5, 6]) integer(8), parameter :: x2 = dot_product([12_8, 33_8, 41_8], [13_8, 1_8, 7_8]) real, parameter :: x3 = dot_product([3.0, 5.0, 11.0], [7.0, 13.0, 17.0]) real(8), parameter :: x4 = dot_product([3.0_8, 5.0_8, 11.0_8], [7.0_8, 13.0_8, 17.0_8]) complex, parameter :: x5 = dot_product([(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)], [(7.0, 8.0), (9.0, 10.0), (11.0, 12.0)]) complex(8), parameter :: x6 = dot_product([(1.0_8, 2.0_8), (3.0_8, 4.0_8), (5.0_8, 6.0_8)],& [(7.0_8, 8.0_8), (9.0_8, 10.0_8), (11.0_8, 12.0_8)]) logical, parameter :: x7 = dot_product([.true., .false., .true.], [.true., .true., .false.]) integer :: i1(3) = [13, 2, 4], i2(3) = [13_8, 2_8, 4_8] integer(8) :: i3(3) = [13_8, 2_8, 4_8], i4(3) = [13_8, 2_8, 4_8] real :: r1(3) = [13.0, 2.0, 4.0], r2(3) = [13.0, 2.0, 4.0] real(8) :: r3(3) = [13.0_8, 2.0_8, 4.0_8], r4(3) = [13.0_8, 2.0_8, 4.0_8] complex :: c1(3) = [(13.0, 2.0), (2.0, 4.0), (4.0, 6.0)], c2(3) = [(13.0, 2.0), (2.0, 4.0), (4.0, 6.0)] complex(8) :: c3(3) = [(13.0_8, 2.0_8), (2.0_8, 4.0_8), (4.0_8, 6.0_8)],& c4(3) = [(13.0_8, 2.0_8), (2.0_8, 4.0_8), (4.0_8, 6.0_8)] logical :: l1(3) = [.true., .false., .true.], l2(3) = [.true., .false., .true.] print *, x1 if (x1 /= 32) error stop print *, x2 if (x2 /= 476) error stop print *, x3 if (abs(x3 - 273.0) > 1e-6) error stop print *, x4 if (abs(x4 - 273.0_8) > 1e-12) error stop print *, abs(x5) if (abs(abs(x5) - 217.745270) > 1e-5) error stop print *, abs(x6) if (abs(abs(x6) - 217.74526401279087_8) > 1e-12) error stop print *, x7 if (.not. x7) error stop print *, dot_product(i1, i2) if (dot_product(i1, i2) /= 189) error stop print *, dot_product(i3, i4) if (dot_product(i3, i4) /= 189_8) error stop print *, dot_product(r1, r2) if (abs(dot_product(r1, r2) - 189.0) > 1e-6) error stop print *, dot_product(r3, r4) if (abs(dot_product(r3, r4) - 189.0_8) > 1e-12) error stop print *, abs(dot_product(c1, c2)) if (abs(abs(dot_product(c1, c2)) - 245.0) > 1e-6) error stop print *, abs(dot_product(c3, c4)) if (abs(abs(dot_product(c3, c4)) - 245.0_8) > 1e-12) error stop print *, dot_product(l1, l2) if (.not. dot_product(l1, l2)) error stop ! Cases with mixture of real, integer and complex print *, dot_product(i1, r2) if (abs(dot_product(i1, r2) - 189.0) > 1e-6) error stop print *, dot_product(r1, i2) if (abs(dot_product(i1, r2) - 189.0) > 1e-6) error stop print *, dot_product(c1, i2) if (abs(abs(dot_product(c1, i2)) - 197.699265) > 1e-6) error stop print *, dot_product(i1, c2) if (abs(abs(dot_product(i1, c2)) - 197.699265) > 1e-6) error stop print *, dot_product(c4, r3) if (abs(abs(dot_product(c4, r3)) - 197.6992665641428_8) > 1e-12) error stop print *, dot_product(r4, c3) if (abs(abs(dot_product(r4, c3)) - 197.6992665641428_8) > 1e-12) error stop end programlfortran-0.63.0/integration_tests/elemental_04.f900000664000175000017500000000043015174404631022153 0ustar alastairalastairprogram elemental_04 integer :: res(2) res = is_close([1., 2.], 2.) print *, res if (any(res /= 5)) error stop contains elemental integer function is_close(a, b) result(r) real, intent(in) :: a real, intent(in) :: b r = 5 end function is_close end program lfortran-0.63.0/integration_tests/dealloc_01.f900000664000175000017500000001355115174404631021615 0ustar alastairalastairmodule dealloc_01_testdrive use, intrinsic :: iso_fortran_env, only : error_unit implicit none private public :: run_testsuite, new_unittest, unittest_type, testsuite_type, & error_type, skip_test integer, parameter :: success = 0, fatal = 1, skipped = 77 type :: error_type integer :: stat = success character(len=:), allocatable :: message end type error_type abstract interface subroutine test_interface(error) import :: error_type type(error_type), allocatable, intent(out) :: error end subroutine test_interface end interface type :: unittest_type character(len=:), allocatable :: name procedure(test_interface), pointer, nopass :: test => null() logical :: should_fail = .false. end type unittest_type abstract interface subroutine collect_interface(testsuite) import :: unittest_type type(unittest_type), allocatable, intent(out) :: testsuite(:) end subroutine collect_interface end interface type :: testsuite_type character(len=:), allocatable :: name procedure(collect_interface), pointer, nopass :: collect => null() end type testsuite_type character(len=*), parameter :: fmt = '(1x, *(1x, a))' contains recursive subroutine run_testsuite(collect, unit, stat, parallel) procedure(collect_interface) :: collect integer, intent(in) :: unit integer, intent(inout) :: stat logical, intent(in), optional :: parallel type(unittest_type), allocatable :: testsuite(:) integer :: it logical :: parallel_ parallel_ = .true. if(present(parallel)) parallel_ = parallel call collect(testsuite) do it = 1, size(testsuite) write(unit, '(1x, 3(1x, a), 1x, "(", i0, "/", i0, ")")') & & "Starting", testsuite(it)%name, "...", it, size(testsuite) call run_unittest(testsuite(it), unit, stat) end do end subroutine run_testsuite recursive subroutine run_unittest(test_var, unit, stat) type(unittest_type), intent(in) :: test_var integer, intent(in) :: unit integer, intent(inout) :: stat type(error_type), allocatable :: error character(len=:), allocatable :: message call test_var%test(error) if (.not.test_skipped(error)) then if (allocated(error) .neqv. test_var%should_fail) stat = stat + 1 end if call make_output(message, test_var, error) write(unit, '(a)') message end subroutine run_unittest pure function test_skipped(error) result(is_skipped) type(error_type), intent(in), optional :: error logical :: is_skipped is_skipped = .false. if (present(error)) then is_skipped = error%stat == skipped end if end function test_skipped pure subroutine make_output(output, test, error) character(len=:), allocatable, intent(out) :: output type(unittest_type), intent(in) :: test type(error_type), intent(in), optional :: error character(len=:), allocatable :: label character(len=*), parameter :: indent = " " // "..." // " " if (test_skipped(error)) then output = indent // test%name // " [SKIPPED]" & & // new_line("a") // " Message: " // error%message return end if if (present(error) .neqv. test%should_fail) then if (test%should_fail) then label = " [UNEXPECTED PASS]" else label = " [FAILED]" end if else if (test%should_fail) then label = " [EXPECTED FAIL]" else label = " [PASSED]" end if end if output = indent // test%name // label if (present(error)) then output = output // new_line("a") // " Message: " // error%message end if end subroutine make_output function new_unittest(name, test, should_fail) result(self) character(len=*), intent(in) :: name procedure(test_interface) :: test logical, intent(in), optional :: should_fail type(unittest_type) :: self self%name = name self%test => test if (present(should_fail)) self%should_fail = should_fail end function new_unittest subroutine test_failed(error, message, more, and_more) type(error_type), allocatable, intent(out) :: error character(len=*), intent(in) :: message character(len=*), intent(in), optional :: more character(len=*), intent(in), optional :: and_more character(len=*), parameter :: skip = new_line("a") // " " allocate(error) error%stat = fatal error%message = message if (present(more)) then error%message = error%message // skip // more end if if (present(and_more)) then error%message = error%message // skip // and_more end if end subroutine test_failed subroutine skip_test(error, message, more, and_more) type(error_type), allocatable, intent(out) :: error character(len=*), intent(in) :: message character(len=*), intent(in), optional :: more character(len=*), intent(in), optional :: and_more call test_failed(error, message, more, and_more) error%stat = skipped end subroutine skip_test end module module dealloc_01_linalg use dealloc_01_testdrive, only : new_unittest, unittest_type, error_type, skip_test implicit none contains subroutine collect_linalg(testsuite) type(unittest_type), allocatable, intent(out) :: testsuite(:) testsuite = [ & new_unittest("diag_rqp", test_diag_rqp) & ] end subroutine collect_linalg subroutine test_diag_rqp(error) type(error_type), allocatable, intent(out) :: error call skip_test(error, "Quadruple precision is not enabled") end subroutine test_diag_rqp end module program dealloc_01 use, intrinsic :: iso_fortran_env, only : error_unit use dealloc_01_testdrive, only : run_testsuite, testsuite_type use dealloc_01_linalg, only : collect_linalg implicit none integer :: stat type(testsuite_type), allocatable :: testsuites(:) stat = 0 call run_testsuite(collect_linalg, error_unit, stat) print *, "stat: ", stat if (stat > 0) error stop end program lfortran-0.63.0/integration_tests/legacy_array_sections_12.f900000664000175000017500000000242115174404631024557 0ustar alastairalastair! Test for double-free bug when passing allocatable array element to ! assumed-size array in a loop. This pattern is common in LAPACK where ! routines like SGEBRD call SGEBD2 with A(I,I) as the start of a submatrix. ! ! The bug manifests as "double free detected" at program exit when ! --legacy-array-sections flag is used. ! ! Related to LAPACK XERBLA errors where wrong routines appear to call ! XERBLA with incorrect parameters. program legacy_array_sections_12 implicit none real, allocatable :: a(:,:) integer :: i, info allocate(a(10, 10)) a = 1.0 ! This loop triggers the double-free bug do i = 1, 3 call check_subarray(10-i+1, a(i, i), 10, info) if (info /= 0) error stop end do deallocate(a) print *, "PASSED: No double-free" end program subroutine check_subarray(m, a, lda, info) ! Subroutine with assumed-size array, like LAPACK SGEBD2 implicit none integer, intent(in) :: m, lda real, intent(inout) :: a(lda, *) integer, intent(out) :: info ! Check LDA like LAPACK does info = 0 if (m < 0) then info = -1 else if (lda < max(1, m)) then info = -3 end if if (info /= 0) return ! Access array to ensure it is valid a(1, 1) = a(1, 1) + 0.1 end subroutine lfortran-0.63.0/integration_tests/implicit_interface_26.f900000664000175000017500000000241615174404631024051 0ustar alastairalastair! Test that visit order does not affect type propagation for implicit interfaces. ! dqc25c is defined BEFORE dqk15w - exercises reverse type propagation. program implicit_interface_26 implicit none double precision :: result call dqc25c(square, 0.0d0, 1.0d0, result) if (abs(result - 0.125d0) > 1.0d-10) error stop print *, "PASSED" contains double precision function square(x) double precision, intent(in) :: x square = x * x end function end program double precision function dqwgtc(x) double precision, intent(in) :: x dqwgtc = 0.5d0 end function ! Caller - does NOT call f or dqwgtc, only passes them (defined BEFORE dqk15w) subroutine dqc25c(f, a, b, result) double precision, external :: f double precision, external :: dqwgtc double precision, intent(in) :: a, b double precision, intent(out) :: result call dqk15w(f, dqwgtc, a, b, result) end subroutine ! Callee - actually calls f and w (defined AFTER dqc25c) subroutine dqk15w(f, w, a, b, result) double precision, external :: f double precision, external :: w double precision, intent(in) :: a, b double precision, intent(out) :: result double precision :: centr centr = 0.5d0*(a+b) result = f(centr) * w(centr) end subroutine lfortran-0.63.0/integration_tests/modules_66_base.f900000664000175000017500000000023515174404631022662 0ustar alastairalastairmodule modules_66_base implicit none type :: container_t class(*), allocatable :: item end type container_t end module modules_66_base lfortran-0.63.0/integration_tests/floor_02.f900000664000175000017500000000123515174404631021330 0ustar alastairalastairprogram floor_02 implicit none real, parameter :: a1 = 3.3 ! 3 real, parameter :: a2 = 3.5 ! 3 real, parameter :: a3 = 3.7 ! 3 real, parameter :: b1 = -3.3 ! -4 real, parameter :: b2 = -3.5 ! -4 real, parameter :: b3 = -3.7 ! -4 integer, parameter :: x1 = floor(a1) ! 3 integer, parameter :: x2 = floor(a2) ! 3 integer, parameter :: x3 = floor(a3) ! 3 integer, parameter :: y1 = floor(b1) ! -4 integer, parameter :: y2 = floor(b2) ! -4 integer, parameter :: y3 = floor(b3) ! -4 if(x1 /= 3 .or. x2 /= 3 .or. x3 /= 3) error stop if(y1 /= -4 .or. y2 /= -4 .or. y3 /= -4) error stop print*, x1, x2, x3 print*, y1, y2, y3 end program lfortran-0.63.0/integration_tests/bindc_48.f900000664000175000017500000000065315174404631021303 0ustar alastairalastairprogram bindc_48 use bindc_48_mod, only: a_bindc, b_regular, c_regular, d_bindc, e_regular implicit none a_bindc = 1 b_regular = 42 c_regular = 7 d_bindc = 100 e_regular = 99 if (a_bindc /= 1) error stop if (b_regular /= 42) error stop if (c_regular /= 7) error stop if (d_bindc /= 100) error stop if (e_regular /= 99) error stop print *, a_bindc, b_regular, c_regular, d_bindc, e_regular end program lfortran-0.63.0/integration_tests/submodule_47.f900000664000175000017500000000074115174404631022220 0ustar alastairalastairmodule submodule_47_parent implicit none interface module subroutine init_sub() end subroutine end interface end module submodule(submodule_47_parent) submodule_47_child implicit none contains module procedure init_sub use iso_c_binding, only: c_int integer(c_int) :: x x = 42_c_int if (x /= 42) error stop print *, x end procedure end submodule program submodule_47 use submodule_47_parent implicit none call init_sub() end program lfortran-0.63.0/integration_tests/character_16.f900000664000175000017500000000073715174404631022156 0ustar alastairalastair! Test: CHARACTER(*) assumed-size array via implicit interface ! MRE from issue #9381 - direct call from program to subroutine program character_16 implicit none character(1) :: adumma(1) adumma(1) = ' ' call callee(adumma) end program character_16 subroutine callee(ei) implicit none character(1) :: ei(*) if (ei(1) == ' ') then print *, 'PASS' else error stop 'FAIL: expected space character' end if end subroutine callee lfortran-0.63.0/integration_tests/separate_compilation_06.f900000664000175000017500000000031015174404631024406 0ustar alastairalastairprogram separate_compilation_06 use separate_compilation_06b_module real :: R(4), Rp(4), rho(4) real :: V(4) R = 124.125 Rp = 0.125 rho = 0.1253512 V = rpoisson_outward_pc(R, Rp, rho) end program lfortran-0.63.0/integration_tests/implied_do_loops12.f900000664000175000017500000000146015174404631023372 0ustar alastairalastair!This file contains tests for implied do loops in array initializers. program implied_do_loop12 implicit none integer :: k integer, parameter :: MAX_ITEMS = 3 ! Derived type type :: derived_t real :: a end type derived_t ! Array of integers initialized via implied-DO integer :: arr1(MAX_ITEMS) = (/ (k, k = 0, MAX_ITEMS-1) /) type(derived_t) :: arr2(MAX_ITEMS) = (/ (derived_t(k), k = 0, MAX_ITEMS-1) /) print *,arr1 if(arr1(1) /= 0) error stop if(arr1(2) /= 1) error stop if(arr1(3) /= 2) error stop ! Array of derived_t objects initialized via implied-DO print *, arr2 if (abs(arr2(1)%a - 0.0) > 1e-12) error stop if (abs(arr2(2)%a - 1.0) > 1e-12) error stop if (abs(arr2(3)%a - 2.0) > 1e-12) error stop end program implied_do_loop12lfortran-0.63.0/integration_tests/derived_types_29.f900000664000175000017500000000051015174404631023061 0ustar alastairalastairprogram derived_types_29 implicit none type t integer :: x end type t type(t) :: type_1 type_1%x = 10 call sub(type_1%x) print*,type_1%x if (type_1%x /= 4352) error stop contains subroutine sub(x) integer, intent(out) :: x x = 4352 end subroutine sub end program lfortran-0.63.0/integration_tests/interface_15.f900000664000175000017500000000133615174404631022155 0ustar alastairalastairmodule interface_15_mod implicit none type t integer :: x end type t end module interface_15_mod program interface_15 use interface_15_mod implicit none integer :: x(2) x = [5, 4] print *, func(x) if (func(x) /= 9) error stop contains function func(i) result(output) integer, intent(in) :: i(:) real :: output type(t) :: type interface function R(j, s) use interface_15_mod implicit none integer, intent(in) :: j(:) type(t), intent(inout) :: s real :: R end function end interface output = i(1) + i(2) end function func end program lfortran-0.63.0/integration_tests/format_72.f900000664000175000017500000000055415174404631021511 0ustar alastairalastairprogram format_72 implicit none character(15) :: line integer :: i1 real :: a, b line = '2345 1 34512 45' read(line, '(BZ, I5, F5.0, BN, F5.2)') i1, a, b if (i1 /= 23450) error stop if (abs(a - 10345.0) > 0.0001) error stop if (abs(b - 12.45) > 0.0001) error stop print *, 'BN/BZ read test passed.' end program format_72 lfortran-0.63.0/integration_tests/intrinsics_211.f900000664000175000017500000001122115174404631022452 0ustar alastairalastairprogram intrinsics_211 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer(4) :: n(32) real(dp) :: x(32) real(dp) :: expected(32) real(dp) :: expected_res(22) integer :: i real :: y(15) real :: expected_y(15) real(dp), parameter :: res(22) = bessel_yn( [0, 1, 2, 3, & 4, 5, 6, 7, & 8, 9, 10, 11, & 12, 13, 14, 15, & 16, 17, 18, 19, & 20, 21], [9.98600559790084e307_dp, 9.98800479820072e307_dp, 9.9900039985006e307_dp, & 9.99200319880048e307_dp, 1036.462826483388272_dp, 1.7197292882018389_dp, & 10.2368267382872828_dp, 0.17197292882018389_dp, 152.67283628_dp, & 632.92729728_dp, 1.2728272919_dp, 1.265228272919_dp, & 29.82407037185126_dp, 35.2459016393_dp, 46.2634946_dp, 24.7740903638_dp, & 15.8978408636372_dp, 8.801468212714914_dp, 8.798080767692923_dp, 8.791287884846061575_dp, & 9.98600559790084e307_dp, 9.98600559790084e307_dp]) expected_res = [7.9836428649154907E-155_dp, -3.6987410577069679E-155_dp, -4.4632457212022061E-155_dp, & 7.9441122443324676E-155_dp, -2.1380390500553400E-002_dp, -19.681876164160990_dp, 0.26769853787891268_dp, & -6602481872.7862654_dp, 6.2260410422729083E-002_dp, 2.3302194134673972E-002_dp, -11087103.624584278_dp, & -185141909.80786872_dp, 9.9380926537565341E-003_dp, -9.5332917725880678E-002_dp, 5.6103040905370369E-002_dp, & -0.16533163717923532_dp, -0.31944510718813779_dp, -271.27888890185812_dp, -971.72716878320409_dp, & -3751.3930153366728_dp, 7.98364286491549068e-155_dp, 7.9836428649154907E-155_dp] do i = 1, size(res) print *, res(i) if (abs(res(i) - expected_res(i)) > 1e-5_dp) error stop end do n = [0, 1, 2, 3, & 4, 5, 6, 7, & 8, 9, 10, 11, & 12, 17, 18, 19, & 20, 21, 22, 23, & 24, 25, 26, 27, & 28, 29, 30, 31, & 32, 37, 38, 39] x = [9.98600559790084e307_dp, 9.98800479820072e307_dp, 9.9900039985006e307_dp, 9.99200319880048e307_dp, & 1036.462826483388272_dp, 1.7197292882018389_dp, 10.2368267382872828_dp, 0.17197292882018389_dp, & 152.67283628_dp, 632.92729728_dp, 1.2728272919_dp, 1.265228272919_dp, & 29.82407037185126_dp, 35.2459016393_dp, 46.2634946_dp, 24.7740903638_dp, & 15.8978408636372_dp, 8.801468212714914_dp, 8.798080767692923_dp, 8.791287884846061575_dp, & 0.6635324560331525_dp, 0.6633115808685429_dp, 0.6630906573122884_dp, 0.6628696853957159_dp, & 0.5042349934053336_dp, 0.5041796815747646_dp, 0.5041242821300232_dp, 0.50401322049655_dp, & 499.19032387045183_dp, 499.2802878848461_dp, 499.3702518992403_dp, 499.5501799280288_dp] expected = [7.9836428649154907E-155_dp, -3.6987410577069675E-155_dp, -4.4632457212022053E-155_dp, & 7.9441122443324676E-155_dp, -2.1380390500553400E-002_dp, -19.681876164160990_dp, 0.26769853787891268_dp, & -6602481872.7862644_dp, 6.2260410422729083E-002_dp, 2.3302194134673972E-002_dp, -11087103.624584274_dp, & -185141909.80786863_dp, 9.9380926537565445E-003_dp, -8.4582551546166423E-002_dp, 0.11571053986948637_dp, & 0.19158786386926477_dp, -1.6795286872077928_dp, -64130.286072844458_dp, -293361.46715134638_dp, & -1425639.5600599083_dp, -2.6148750349709140E+033_dp, -1.9070269429225925E+035_dp, -1.4497388677441211E+037_dp, & -1.1469745997353528E+039_dp, -1.9768410955067933E+044_dp, -2.2022757572664989E+046_dp, -2.5416271515658601E+048_dp, & -3.0455075866672117E+050_dp, 2.9475297628969036E-003_dp, 3.3552491139733728E-002_dp, 1.7701295549281584E-002_dp, & -2.5556786290672439E-002_dp] do i = 1, size(x) print *, bessel_yn(n(i), x(i)), "i = ", i if (abs((bessel_yn(n(i), x(i)) - expected(i))/expected(i)) > 1e-12_dp) error stop end do y = [1036.462826483388272_sp, 1.7197292882018389_sp, 10.2368267382872828_sp, 1036.462826483388272_sp, & 152.67283628_sp, 632.92729728_sp, 1.2728272919_sp, 1.2828272919_sp, & 29.82407037185126_sp, 35.2459016393_sp, 46.2634946_sp, 24.7740903638_sp, & 15.8978408636372_sp, 8.801468212714914_sp, 036.462826483388272_sp] expected_y = [ -2.14771368E-02_sp, -0.272538334_sp, 5.23242168E-02_sp, 1.24606974E-02_sp, & 5.87534383E-02_sp, 2.42299046E-02_sp, -623.942322_sp, -5497.98242_sp, & -0.143518567_sp, 6.74885958E-02_sp, -6.34354725E-02_sp, 3.99038307E-02_sp, & 0.209239334_sp, -271.279022_sp, -8.33194777E-02_sp] do i = 1, size(y) print *, bessel_yn(n(i), y(i)), "i = ", i if (abs((bessel_yn(n(i), y(i)) - expected_y(i))/expected_y(i)) > 1e-5) error stop end do end program lfortran-0.63.0/integration_tests/file_08.txt0000664000175000017500000000023515174404631021354 0ustar alastairalastair 1.0000000000000000 2.0000000000000000 3.0000000000000000 4.0000000000000000 5.0000000000000000 6.0000000000000000 lfortran-0.63.0/integration_tests/entry_05.f900000664000175000017500000000063515174404631021356 0ustar alastairalastairsubroutine dzror(n, r) implicit none double precision abstol,reltol,zx intrinsic abs,max double precision ftol integer n real r(n) ftol(zx) = 0.5d0*max(abstol,reltol*abs(zx)) r = -83.03 entry dstzr() return end program entry_05 real :: r(10) integer :: i call dzror(10, r) do i = 1, 10 if (abs(r(i) - (-83.03)) > 1e-8) error stop end do print *, r end program lfortran-0.63.0/integration_tests/gpu_metal_79.f900000664000175000017500000000137715174404631022211 0ustar alastairalastairprogram gpu_metal_79 ! Test: multiple do concurrent loops referencing the same derived type ! should not cause Metal struct redefinition errors. implicit none type :: val_t real :: v end type integer :: i type(val_t) :: arr(4) real :: r1(4), r2(4) arr(1)%v = 1.0 arr(2)%v = 2.0 arr(3)%v = 3.0 arr(4)%v = 4.0 do concurrent(i = 1:4) r1(i) = arr(i)%v end do do concurrent(i = 1:4) r2(i) = arr(i)%v * 2.0 end do if (abs(r1(1) - 1.0) > 1e-6) error stop if (abs(r1(2) - 2.0) > 1e-6) error stop if (abs(r1(3) - 3.0) > 1e-6) error stop if (abs(r1(4) - 4.0) > 1e-6) error stop if (abs(r2(1) - 2.0) > 1e-6) error stop if (abs(r2(2) - 4.0) > 1e-6) error stop if (abs(r2(3) - 6.0) > 1e-6) error stop if (abs(r2(4) - 8.0) > 1e-6) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/iso_fortran_env_04.f900000664000175000017500000000135215174404631023406 0ustar alastairalastairprogram iso_fortran_env_04 use, intrinsic :: iso_fortran_env, only: input_unit, output_unit, error_unit, & iostat_end, iostat_eor, & numeric_storage_size, character_storage_size, file_storage_size implicit none ! F90: I/O unit numbers if (input_unit /= 5) error stop if (output_unit /= 6) error stop if (error_unit /= 0) error stop ! F90: I/O status constants if (iostat_end /= -1) error stop if (iostat_eor /= -2) error stop ! F2003: Storage sizes (in bits) if (file_storage_size /= 8) error stop if (numeric_storage_size /= 32) error stop if (character_storage_size /= 8) error stop print *, "iso_fortran_env_04: all F2003 constants OK" end program iso_fortran_env_04 lfortran-0.63.0/integration_tests/separate_compilation_18a.f900000664000175000017500000000032115174404631024554 0ustar alastairalastairmodule mod_separate_compilation_18 implicit none interface module function f(a) result(r) integer, intent(in) :: a integer :: r end function end interface end modulelfortran-0.63.0/integration_tests/modules_08_a.f900000664000175000017500000000016215174404631022163 0ustar alastairalastairmodule modules_08_a implicit none private public a contains integer function a() a = 3 end function end module lfortran-0.63.0/integration_tests/submodule_51b.f900000664000175000017500000000113215174404631022350 0ustar alastairalastairmodule submodule_51_mod implicit none interface module subroutine show(mask) logical, intent(in) :: mask(:,:) end subroutine end interface end module submodule (submodule_51_mod) submodule_51_impl implicit none contains module subroutine show(mask) logical, intent(in) :: mask(:,:) if (size(mask, 1) /= 2) error stop if (size(mask, 2) /= 3) error stop if (.not. mask(1,1)) error stop if (.not. mask(2,1)) error stop if (mask(1,2)) error stop if (mask(2,2)) error stop if (mask(1,3)) error stop if (mask(2,3)) error stop end subroutine end submodule lfortran-0.63.0/integration_tests/intrinsics_116.f900000664000175000017500000000026015174404631022457 0ustar alastairalastairprogram intrinsics_116 print *, atan2( y = 0.5e0_4, x = 1.e0_4 ) print *, atan2( 0.5e0_4, x = 1.e0_4 ) print *, atan2( 0.5e0_4, 1.e0_4 ) end program intrinsics_116 lfortran-0.63.0/integration_tests/entry_12.f900000664000175000017500000000026315174404631021351 0ustar alastairalastairsubroutine dinvr(x) integer :: x go to 310 return entry dstinv() return 310 continue print *, "x = ", x if (x /= 12) error stop end program entry_09 call dinvr(12) end program lfortran-0.63.0/integration_tests/custom_operator_14.f900000664000175000017500000000140015174404631023431 0ustar alastairalastairmodule custom_operator_14_mod implicit none type :: op_t contains generic :: operator(.x.) => apply_op procedure, private :: apply_op end type contains pure function apply_op(self, vec) result(res) class(op_t), intent(in) :: self double precision, intent(in) :: vec(:) double precision, allocatable :: res(:) allocate(res(size(vec))) res = vec + 1d0 end function end module custom_operator_14_mod program custom_operator_14 use custom_operator_14_mod implicit none type(op_t) :: op double precision :: values(3), result(3) values = [1d0, 2d0, 3d0] associate(d => op) result = d .x. values end associate if (any(result /= [2d0, 3d0, 4d0])) error stop print *, result end program custom_operator_14 lfortran-0.63.0/integration_tests/do_loop_05.f900000664000175000017500000000023415174404631021643 0ustar alastairalastairprogram do_loop_05 integer :: a, b, res b = 5 res = 0 do 1 a = b, 1, -b res = res + a 1 continue print *, res if ( res /= 5 ) error stop end program lfortran-0.63.0/integration_tests/modules_47.f900000664000175000017500000000256215174404631021674 0ustar alastairalastairmodule modules_47_tomlf_datetime implicit none public :: toml_time type :: toml_time integer :: hour = 0 integer :: minute = 0 integer :: second = 0 integer, allocatable :: millisec character(len=:), allocatable :: zone end type contains subroutine time_to_string(lhs, rhs) character(len=:), allocatable, intent(out) :: lhs class(toml_time), intent(in) :: rhs if (allocated(rhs%millisec)) then allocate(character(len=12) :: lhs) write(lhs, '(i2.2,":",i2.2,":",i2.2,".",i3.3)') & & rhs%hour, rhs%minute, rhs%second, rhs%millisec else allocate(character(len=8) :: lhs) write(lhs, '(i2.2,":",i2.2,":",i2.2)') & & rhs%hour, rhs%minute, rhs%second end if if (allocated(rhs%zone)) lhs = lhs // trim(rhs%zone) end subroutine time_to_string end module modules_47_tomlf_datetime program modules_47 use modules_47_tomlf_datetime implicit none character(len=:), allocatable :: lhs type(toml_time) :: rhs if( allocated(rhs%millisec) ) error stop allocate(rhs%millisec) rhs%millisec = 100 print *, rhs%millisec, allocated(rhs%millisec) if( rhs%hour /= 0 ) error stop if( rhs%minute /= 0 ) error stop if( rhs%second /= 0 ) error stop if( rhs%millisec /= 100 ) error stop call time_to_string(lhs, rhs) print *, lhs if( .not. allocated(lhs) ) error stop end program lfortran-0.63.0/integration_tests/separate_compilation_47.f900000664000175000017500000000054315174404631024423 0ustar alastairalastairprogram separate_compilation_47 use separate_compilation_47a_mymod implicit none class(AbsType), allocatable :: val val = myfunc() if (val%x /= 42) error stop select type(val) type is (ConcreteType) if (val%y /= 84) error stop class default error stop end select print *, "ok" end program separate_compilation_47 lfortran-0.63.0/integration_tests/procedure_36.f900000664000175000017500000000111315174404631022201 0ustar alastairalastairmodule procedure_36_mod implicit none abstract interface real function reduction_sub_dp() result(r) end function end interface type, public :: linop_dp_type procedure(reduction_sub_dp), nopass, pointer :: inner_product => default_dot_dp end type contains real function default_dot_dp() result(r) r = 0.0 end function end module procedure_36_mod program procedure_36 use procedure_36_mod implicit none type(linop_dp_type) :: op if (abs(op%inner_product() - 0.0) > 1e-6) error stop end program procedure_36 lfortran-0.63.0/integration_tests/class_83.f900000664000175000017500000000272415174404631021331 0ustar alastairalastairprogram class_83 implicit none type :: string_t integer :: dummy = -1 end type type :: preprocess_t type(string_t), allocatable :: strs(:) end type type :: temp type(preprocess_t), allocatable :: arr(:) end type type(temp), allocatable :: x(:), z(:) !------------------------- ! Allocate top-level arrays !------------------------- allocate(x(4)) allocate(z(4)) !------------------------- ! Initialize x(1) !------------------------- allocate(x(1)%arr(2)) allocate(x(1)%arr(1)%strs(3)) allocate(x(1)%arr(2)%strs(1)) x(1)%arr(1)%strs(1)%dummy = 10 x(1)%arr(1)%strs(2)%dummy = 10 x(1)%arr(1)%strs(3)%dummy = 10 x(1)%arr(2)%strs(1)%dummy = 20 z(1) = x(1) if (.not. allocated(z(1)%arr)) error stop "z(1)%arr not allocated" if (size(z(1)%arr) /= 2) error stop "z(1)%arr wrong size" if (.not. allocated(z(1)%arr(1)%strs)) error stop "z(1)%arr(1)%strs not allocated" if (size(z(1)%arr(1)%strs) /= 3) error stop "z(1)%arr(1)%strs wrong size" if (z(1)%arr(1)%strs(1)%dummy /= 10) error stop "z copy failed" x(1) = z(1) if (.not. allocated(x(1)%arr)) error stop "x(1)%arr not allocated after copy back" if (size(x(1)%arr) /= 2) error stop "x(1)%arr wrong size after copy back" if (x(1)%arr(2)%strs(1)%dummy /= 20) error stop "x copy-back failed" print *, "OK: deep allocatable assignment works correctly" end program class_83 lfortran-0.63.0/integration_tests/nested_13.f900000664000175000017500000000104015174404631021465 0ustar alastairalastairmodule nested_13_mod implicit none contains subroutine get_prototype(prototype) character(len=:), allocatable, intent(out) :: prototype call expand_name() contains subroutine expand_name() prototype = "Hello" end subroutine expand_name end subroutine get_prototype end module nested_13_mod program nested_13 use nested_13_mod implicit none character(len=:), allocatable :: proto call get_prototype(proto) if (proto /= "Hello") error stop end program nested_13lfortran-0.63.0/integration_tests/equivalence_22.f900000664000175000017500000000074415174404631022516 0ustar alastairalastairprogram equivalence_22 implicit none character(43) :: ca_2(2) character(1) :: ca_full(97) equivalence (ca_2, ca_full) ca_full = 'x' ca_2(1) = '1' ca_2(2) = '2' if (ca_full(1) /= '1') error stop if (ca_full(2) /= ' ') error stop if (ca_full(43) /= ' ') error stop if (ca_full(44) /= '2') error stop if (ca_full(45) /= ' ') error stop if (ca_full(86) /= ' ') error stop if (ca_full(87) /= 'x') error stop if (ca_full(97) /= 'x') error stop end program lfortran-0.63.0/integration_tests/gpu_metal_64.f900000664000175000017500000000072315174404631022175 0ustar alastairalastairprogram gpu_metal_64 implicit none type :: t real :: s = 2.0 end type type(t) :: obj real, allocatable :: x(:) allocate(x(4)) x = 1.0 call compute() if (abs(x(1) - 2.0) > 1e-5) error stop if (abs(x(2) - 2.0) > 1e-5) error stop if (abs(x(3) - 2.0) > 1e-5) error stop if (abs(x(4) - 2.0) > 1e-5) error stop print *, "PASSED" contains subroutine compute() integer :: i do concurrent(i = 1:4) x(i) = x(i) * obj%s end do end subroutine end program lfortran-0.63.0/integration_tests/test_ieee_arithmetic_fast_01.f900000664000175000017500000000135015174404631025400 0ustar alastairalastairprogram test_ieee_arithmetic_fast_01 use, intrinsic :: ieee_arithmetic, only: ieee_is_nan, ieee_value, ieee_quiet_nan use, intrinsic :: ieee_arithmetic, only: ieee_positive_inf, ieee_is_finite implicit none real :: x, nan_val, inf_val ! Test ieee_value with ieee_quiet_nan nan_val = ieee_value(x, ieee_quiet_nan) if (.not. ieee_is_nan(nan_val)) error stop "ieee_value with ieee_quiet_nan failed" ! Test ieee_value with ieee_positive_inf inf_val = ieee_value(x, ieee_positive_inf) if (ieee_is_finite(inf_val)) error stop "ieee_value with ieee_positive_inf failed" if (ieee_is_nan(inf_val)) error stop "inf should not be NaN" print *, "PASS" end program test_ieee_arithmetic_fast_01 lfortran-0.63.0/integration_tests/gpu_metal_136.f900000664000175000017500000000160215174404631022252 0ustar alastairalastairprogram gpu_metal_136 ! Test: submodule function returning derived type in do concurrent ! with --gpu=metal. Verifies that the GPU kernel extraction correctly ! handles ExternalSymbol references for struct types owned by the ! GpuKernelFunction scope. use gpu_metal_136_m, only: point, make_point implicit none type(point) :: pts(4) integer :: i do concurrent (i = 1:4) pts(i) = make_point(real(i), real(i) * 10.0) end do print *, pts(1)%x, pts(1)%y print *, pts(2)%x, pts(2)%y print *, pts(3)%x, pts(3)%y print *, pts(4)%x, pts(4)%y if (abs(pts(1)%x - 1.0) > 1e-6) error stop if (abs(pts(1)%y - 10.0) > 1e-6) error stop if (abs(pts(2)%x - 2.0) > 1e-6) error stop if (abs(pts(2)%y - 20.0) > 1e-6) error stop if (abs(pts(3)%x - 3.0) > 1e-6) error stop if (abs(pts(3)%y - 30.0) > 1e-6) error stop if (abs(pts(4)%x - 4.0) > 1e-6) error stop if (abs(pts(4)%y - 40.0) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/procedure_41.f900000664000175000017500000000404215174404631022201 0ustar alastairalastairmodule procedure_41_mod1 implicit none type, abstract :: AbsType procedure(intfc), pointer, nopass :: ptr => null() end type AbsType abstract interface subroutine intfc(self,n,b) import :: AbsType class(AbsType), intent(in) :: self integer(4), intent(in) :: n real(8), intent(inout) :: b(n:,n:,:) end subroutine intfc end interface end module procedure_41_mod1 module procedure_41_mod2 use procedure_41_mod1 implicit none type, extends(AbsType) :: ConcreteType integer :: id end type ConcreteType type :: MyType class(AbsType), allocatable :: obj end type MyType contains subroutine myproc(self,n,b) class(AbsType), intent(in) :: self integer(4), intent(in) :: n real(8), intent(inout) :: b(n:,n:,:) integer :: i,j,k do i = lbound(b,1), ubound(b,1) do j = lbound(b,2), ubound(b,2) do k = lbound(b,3), ubound(b,3) b(i,j,k) = 42.0d0 end do end do end do end subroutine myproc subroutine client(n,b) integer(4), intent(in) :: n real(8), intent(inout) :: b(n:,n:,:) class(MyType), allocatable :: arr(:,:) allocate(arr(1,1)) allocate(ConcreteType :: arr(1,1)%obj) associate(ob => arr(1,1)%obj) ob%ptr => myproc if (.not. associated(ob%ptr)) then error stop "Procedure pointer not associated" end if call ob%ptr(ob, n, b) end associate if (b(n,n,1) /= 42.0d0) then error stop "Procedure pointer call failed" end if end subroutine client end module procedure_41_mod2 program procedure_41 use procedure_41_mod2 implicit none integer(4) :: n real(8) :: b(1:10,1:10,1:10) n = 1 b = 0.0d0 call client(n,b) if (b(1,1,1) /= 42.0d0) then error stop "Final verification failed" end if print *, "All abstract type + procedure pointer tests passed." end program procedure_41lfortran-0.63.0/integration_tests/modules_67_consumer.f900000664000175000017500000000037215174404631023606 0ustar alastairalastairmodule modules_67_consumer use modules_67_reexport, only : pair_t, operator(.check.) implicit none contains logical function test_pairs() type(pair_t) :: a, b a%x = 42 b%x = 42 test_pairs = a .check. b end function end module lfortran-0.63.0/integration_tests/data_implied_do_07.f900000664000175000017500000000057615174404631023321 0ustar alastairalastairmodule data_implied_do_07_mod implicit none integer :: i, iarx(3) data(iarx(i), i=1,3) / 3*-2 / end module data_implied_do_07_mod program data_implied_do_07 use data_implied_do_07_mod implicit none print *, iarx if (iarx(1) /= -2) error stop if (iarx(2) /= -2) error stop if (iarx(3) /= -2) error stop end program data_implied_do_07lfortran-0.63.0/integration_tests/implicit_interface_01.f900000664000175000017500000000117615174404631024044 0ustar alastairalastairprogram main integer, dimension(2, 4) :: a integer :: b(2) = [10, 20] integer :: m = 4, i, j, n = 2 do 20 j = 1, n do 10 i = 1, m a(j, i) = i*j 10 continue 20 continue call driver(implicit_interface_check, a, b, a(1, m), n, m) contains subroutine driver(fnc, arr, b, c, n, m) integer, intent(in) :: n, m, c, b(n), arr(n, m) call fnc(arr(1, m), b, c, n, m) end subroutine subroutine implicit_interface_check(arr_e, b, c, n, m) integer, intent(in) :: n, m, b(n), c, arr_e if (arr_e /= m) error stop if (b(1) /= 10) error stop if (b(2) /= 20) error stop if (c /= m) error stop end subroutine end program lfortran-0.63.0/integration_tests/separate_compilation_42.f900000664000175000017500000000703215174404631024416 0ustar alastairalastairmodule separate_compilation_42_kind_m implicit none integer, parameter :: default_real = kind(1.0) integer, parameter :: double_precision = kind(1.0d0) end module separate_compilation_42_kind_m module separate_compilation_42_hyperparameters_m use separate_compilation_42_kind_m, only : default_real, double_precision implicit none type hyperparameters_t(k) integer, kind :: k = default_real integer :: mini_batches_ = 10 real(k) :: learning_rate_ = real(1.5, k) complex(k) :: damping_ = (0.5, 0.25) end type hyperparameters_t interface hyperparameters_t pure module function default_real_from_components(mini_batches, learning_rate, damping) result(hyperparameters) integer, intent(in) :: mini_batches real, intent(in) :: learning_rate complex, intent(in) :: damping type(hyperparameters_t) :: hyperparameters end function default_real_from_components pure module function double_precision_from_components(mini_batches, learning_rate, damping) result(hyperparameters) integer, intent(in) :: mini_batches double precision, intent(in) :: learning_rate complex(double_precision), intent(in) :: damping type(hyperparameters_t(double_precision)) :: hyperparameters end function double_precision_from_components end interface end module separate_compilation_42_hyperparameters_m submodule(separate_compilation_42_hyperparameters_m) separate_compilation_42_hyperparameters_s contains module procedure default_real_from_components hyperparameters%mini_batches_ = mini_batches hyperparameters%learning_rate_ = learning_rate hyperparameters%damping_ = damping end procedure default_real_from_components module procedure double_precision_from_components hyperparameters%mini_batches_ = mini_batches hyperparameters%learning_rate_ = learning_rate hyperparameters%damping_ = damping end procedure double_precision_from_components end submodule separate_compilation_42_hyperparameters_s program separate_compilation_42 use separate_compilation_42_hyperparameters_m, only : hyperparameters_t use separate_compilation_42_kind_m, only : double_precision implicit none type(hyperparameters_t) :: default_hyperparameters type(hyperparameters_t(double_precision)) :: double_hyperparameters type(hyperparameters_t) :: defaults_only type(hyperparameters_t(double_precision)) :: dp_defaults_only default_hyperparameters = hyperparameters_t(4, 0.25, (0.3, 0.4)) double_hyperparameters = hyperparameters_t(6, 0.125d0, (0.5d0, 0.6d0)) if (default_hyperparameters%mini_batches_ /= 4) error stop if (abs(default_hyperparameters%learning_rate_ - 0.25) > epsilon(1.0)) error stop if (abs(real(default_hyperparameters%damping_) - 0.3) > epsilon(1.0)) error stop if (abs(aimag(default_hyperparameters%damping_) - 0.4) > epsilon(1.0)) error stop if (double_hyperparameters%mini_batches_ /= 6) error stop if (abs(double_hyperparameters%learning_rate_ - 0.125d0) > epsilon(1.0d0)) error stop if (abs(real(double_hyperparameters%damping_) - 0.5d0) > epsilon(1.0d0)) error stop if (abs(aimag(double_hyperparameters%damping_) - 0.6d0) > epsilon(1.0d0)) error stop ! Verify complex default initializers (kind 4 and kind 8) if (abs(real(defaults_only%damping_) - 0.5) > epsilon(1.0)) error stop if (abs(aimag(defaults_only%damping_) - 0.25) > epsilon(1.0)) error stop if (abs(real(dp_defaults_only%damping_) - 0.5d0) > epsilon(1.0d0)) error stop if (abs(aimag(dp_defaults_only%damping_) - 0.25d0) > epsilon(1.0d0)) error stop end program separate_compilation_42 lfortran-0.63.0/integration_tests/read_22.f900000664000175000017500000000264115174404631021126 0ustar alastairalastair! Test complex number input parsing with whitespace inside parentheses. ! Fortran list-directed format allows: ( 0.1000E+01, 0.2000E+01) program read_22 implicit none complex :: c1, c2 complex(8) :: c3 complex :: arr(2) ! Test single-precision complex with spaces inside parentheses open(10, file='read_22_data.txt', status='replace') write(10, '(A)') '( 0.1000E+01, 0.2000E+01)' write(10, '(A)') '(3.0, 4.0)' write(10, '(A)') '( 0.5000D+01, 0.6000D+01)' write(10, '(A)') '( 0.7000E+01, 0.8000E+01) ( 0.9000E+01, 0.1000E+02)' close(10) open(10, file='read_22_data.txt', status='old') read(10, *) c1 read(10, *) c2 read(10, *) c3 read(10, *) arr close(10, status='delete') ! Verify single-precision with spaces if (abs(real(c1) - 1.0) > 1e-5) error stop 1 if (abs(aimag(c1) - 2.0) > 1e-5) error stop 2 ! Verify without spaces if (abs(real(c2) - 3.0) > 1e-5) error stop 3 if (abs(aimag(c2) - 4.0) > 1e-5) error stop 4 ! Verify double-precision with D exponent if (abs(real(c3) - 5.0d0) > 1d-10) error stop 5 if (abs(aimag(c3) - 6.0d0) > 1d-10) error stop 6 ! Verify array reading if (abs(real(arr(1)) - 7.0) > 1e-5) error stop 7 if (abs(aimag(arr(1)) - 8.0) > 1e-5) error stop 8 if (abs(real(arr(2)) - 9.0) > 1e-5) error stop 9 if (abs(aimag(arr(2)) - 10.0) > 1e-5) error stop 10 print *, "PASS" end program lfortran-0.63.0/integration_tests/gpu_metal_137.f900000664000175000017500000000130015174404631022246 0ustar alastairalastair! Test: associate with function result inside do concurrent (GPU offloading) ! Verifies that array section pointers to function call results use ! thread-space addressing in Metal shaders, not device-space. program gpu_metal_137 implicit none real :: x(4) integer :: i x = 0.0 do concurrent (i = 1:4) associate(y => get_values()) x(i) = y(i) end associate end do if (abs(x(1) - 10.0) > 1e-6) error stop if (abs(x(2) - 20.0) > 1e-6) error stop if (abs(x(3) - 30.0) > 1e-6) error stop if (abs(x(4) - 40.0) > 1e-6) error stop print *, "PASS" contains pure function get_values() result(r) real :: r(4) r = [10.0, 20.0, 30.0, 40.0] end function end program lfortran-0.63.0/integration_tests/functions_35.f900000664000175000017500000000134315174404631022225 0ustar alastairalastairmodule global_dims implicit none integer, parameter :: nt_g=5 integer, parameter :: np_g=7 end module program functions_35 use global_dims implicit none real, dimension(:, :), allocatable, target :: br0_g allocate(br0_g(nt_g, np_g)) call sub1(br0_g) end program functions_35 subroutine sub1 (br0_g) use global_dims implicit none real, dimension(nt_g,np_g) :: br0_g real :: sum0 call sub2 (nt_g-2,np_g-2, br0_g(2:4,2:6)) sum0=sum(br0_g(2,2:6)) print *, "sum0: ", sum0 if (sum0 /= 1.21607137) error stop end subroutine subroutine sub2 (nx,ny,f) implicit none integer :: nx,ny real, dimension(nx,ny) :: f f = 2.43214264512062073e-01 return end subroutine lfortran-0.63.0/integration_tests/intrinsics_90.f900000664000175000017500000000070615174404631022405 0ustar alastairalastairmodule intrinsics_90_module contains subroutine tester(arr) real(8) :: arr(:,:) integer :: n real(8) :: vec(size(arr,1)) vec = huge(1.d0) do n = 1, size(arr,2) vec = min(arr(:,n),vec) end do print *, vec if (any(abs(vec - (-13.9d0)) > 1d-9)) error stop end subroutine tester end module intrinsics_90_module program intrinsics_90 use intrinsics_90_module implicit none real(8) :: arr(3,3) arr = -13.9d0 call tester(arr) end program lfortran-0.63.0/integration_tests/inquire_04.f900000664000175000017500000000116015174404631021662 0ustar alastairalastairprogram inquire_access_name implicit none integer :: io logical :: opened character(len=20) :: access_mode character(len=64) :: file_name io = 37 open(unit=io, file='inquire_04_data.txt', status='replace', action='readwrite') inquire(unit=io, opened=opened, access=access_mode, name=file_name) if (.not. opened) error stop 'unit not marked as opened' if (trim(access_mode) /= 'SEQUENTIAL') error stop 'unexpected access mode' if (trim(file_name) /= 'inquire_04_data.txt') error stop 'unexpected name value' close(unit=io, status='delete') end program inquire_access_name lfortran-0.63.0/integration_tests/submodule_36.f900000664000175000017500000000122615174404631022215 0ustar alastairalastair! Test: reshape in submodule body should not cause linker error module submodule_36_m implicit none interface module subroutine sub(a, b) real, intent(in) :: a(:) real, intent(out) :: b end subroutine end interface end module submodule(submodule_36_m) submodule_36_s contains module subroutine sub(a, b) real, intent(in) :: a(:) real, intent(out) :: b real :: c(1, size(a)) c = reshape(a, [1, size(a)]) b = c(1, 1) end subroutine end submodule program submodule_36 use submodule_36_m implicit none real :: a(3), b a = 1.0 call sub(a, b) if (abs(b - 1.0) > 1e-6) error stop print *, b end program lfortran-0.63.0/integration_tests/arrays_21.f900000664000175000017500000000115115174404631021506 0ustar alastairalastairprogram arrays_21 integer :: i6(6) = (/-14, 3, 0, -2, 19, 1/) integer :: i23(2, 3) = reshape((/-14, 3, 0, -2, 19, 1/), (/2, 3/)) print *, i23 ! writes -14 3 ! 0 -2 ! 19 1 print *, maxloc(i6) ! writes 5 print *, maxloc(i23) ! writes 1 3 print *, maxloc(i23, dim=1) ! writes 2 1 1 print *, maxloc(i23, dim=2) ! writes 3 1 print *, maxloc(i23, dim=1, mask=(i23 < 10)) ! writes 2 1 2 end program arrays_21 lfortran-0.63.0/integration_tests/template_matrix_test.f900000664000175000017500000000251015174404631024141 0ustar alastairalastairmodule real_func_m public :: real_zero, real_one contains pure function real_zero() real :: real_zero real_zero = 0. end function pure function real_one() real :: real_one real_one = 1. end function end module module integer_func_m public :: integer_zero, integer_one contains pure function integer_zero() integer :: integer_zero integer_zero = 0. end function pure function integer_one() integer :: integer_one integer_one = 1. end function end module program template_matrix_test use matrix_m, only: matrix_tmpl use integer_func_m use real_func_m implicit none integer, parameter :: n = 2 instantiate matrix_tmpl(real, operator(+), real_zero, operator(*), real_one, n), only: & real_matrix => matrix, & real_plus_matrix => plus_matrix, & real_times_matrix => times_matrix, & real_matrix_subtraction_tmpl => matrix_subtraction_tmpl instantiate matrix_tmpl(integer, operator(+), integer_zero, operator(*), integer_one, n), only: & integer_matrix => matrix, & integer_plus_matrix => plus_matrix, & integer_times_matrix => times_matrix, & integer_matrix_subtraction_tmpl => matrix_subtraction_tmpl end programlfortran-0.63.0/integration_tests/infer_walrus_struct_03.f900000664000175000017500000000037315174404631024316 0ustar alastairalastairprogram infer_walrus_struct_03 implicit none type :: vec_t integer :: x, y, z end type p = vec_t(1, 2, 3) if (p%x /= 1) error stop if (p%y /= 2) error stop if (p%z /= 3) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/class_120.f900000664000175000017500000000156115174404631021377 0ustar alastairalastair! Test that user-defined operators defined in a parent type are inherited ! by extended (child) types and can be used with child-type operands. module class_120_mod implicit none type :: parent_t real :: x contains generic :: operator(.op.) => apply_op procedure, private :: apply_op end type type, extends(parent_t) :: child_t end type contains function apply_op(self) result(res) class(parent_t), intent(in) :: self real :: res res = self%x end function function use_op(v) result(res) type(child_t), intent(in) :: v real :: res res = .op. v end function end module class_120_mod program class_120 use class_120_mod, only: child_t, use_op implicit none type(child_t) :: c c%x = 3.0 if (use_op(c) /= 3.0) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/gpu_metal_169.f900000664000175000017500000000044415174404631022263 0ustar alastairalastairprogram gpu_metal_169 implicit none integer, parameter :: n(3) = [7, 42, 99] integer :: s(3) integer :: i do concurrent(i = 1:3) s(i) = n(i) end do print *, s(1), s(2), s(3) if (s(1) /= 7) error stop if (s(2) /= 42) error stop if (s(3) /= 99) error stop end program lfortran-0.63.0/integration_tests/nested_call_filter_01.f900000664000175000017500000000105215174404631024025 0ustar alastairalastairmodule nested_call_filter_mod contains subroutine modproc(y) integer, intent(inout) :: y y = y + 1 end subroutine modproc end module nested_call_filter_mod program nested_call_filter_01 use nested_call_filter_mod, only: modproc implicit none call outer() contains subroutine outer() integer :: a a = 1 call inner() call modproc(a) contains subroutine inner() a = a + 1 end subroutine inner end subroutine outer end program nested_call_filter_01 lfortran-0.63.0/integration_tests/arrays_94.f900000664000175000017500000000102615174404631021521 0ustar alastairalastairprogram arrays_94 implicit none integer :: result logical :: array(5) array = [ .true., .false., .true., .false., .true.] call truecount(array, result) print *, "Number of true elements:", result if (result /= 3) error stop contains subroutine truecount(array, return_value) logical, intent(in) :: array(:) integer, intent(out) :: return_value integer :: loc(count((array .and. .true.))) return_value = size(loc) end subroutine truecount end program arrays_94 lfortran-0.63.0/integration_tests/enum_06_module.f900000664000175000017500000000026515174404631022526 0ustar alastairalastairmodule enum_06_mod_main implicit none enum, bind(C) enumerator :: red = 100 end enum end module module enum_06_mod_middle use enum_06_mod_main end module lfortran-0.63.0/integration_tests/array_bound_3.f900000664000175000017500000000046215174404631022436 0ustar alastairalastairprogram array_bound_3 implicit none integer :: x(4, 3) integer :: lbound_x(2) integer :: ubound_x(2) lbound_x = lbound(x) ubound_x = ubound(x) print *, lbound_x print *, ubound_x if (sum(lbound_x) /= 2) error stop if (sum(ubound_x) /= 7) error stop end program lfortran-0.63.0/integration_tests/separate_compilation_22.f900000664000175000017500000000027015174404631024411 0ustar alastairalastairprogram separate_compilation_22 use math_separate_compilation_22 implicit none integer :: n = 2 call logspace(n) print *, n if (n /= 3) error stop end programlfortran-0.63.0/integration_tests/derived_types_17.f900000664000175000017500000000137615174404631023071 0ustar alastairalastairmodule derived_types_17_module_1 implicit none private public :: add, subtract type :: t_1 integer :: num = 100 end type t_1 contains function add() result(self) type(t_1) :: self self%num = self%num + self%num end function add function subtract() result(self) type(t_1) :: self self%num = self%num * self%num end function subtract end module module derived_types_17_module_2 use derived_types_17_module_1, only: subtract, add implicit none contains subroutine sub_2() print*, subtract() print*, add() end subroutine sub_2 end module program derived_types_17 use derived_types_17_module_2, only: sub_2 implicit none call sub_2() end program lfortran-0.63.0/integration_tests/arrays_58.f900000664000175000017500000000056515174404631021530 0ustar alastairalastairprogram arrays_58 real :: A(2,2) = reshape([1.0,2.0,3.0,4.0], [2,2]) call trans(A) print *, A if ( any(abs( A - 12.91 ) > 1e-8) ) error stop contains subroutine trans(A) real, intent(inout) :: A(:, :) A = matprod(transpose(A)) end subroutine function matprod(x) result(k) real,intent(in) :: x(:,:) real :: k(size(x, 1), size(x, 2)) k = 12.91 end function end program lfortran-0.63.0/integration_tests/array_op_11.f900000664000175000017500000000137415174404631022027 0ustar alastairalastairprogram array_op_11 ! Test: parameter array multiplied by scalar should compile and run correctly. ! This verifies that the array_op pass correctly clears m_value on ! IntegerBinOp nodes after expanding array operations into element loops. implicit none integer, parameter :: x(2) = [1, 2] integer :: y(2) integer :: z(3) integer, parameter :: a(3) = [10, 20, 30] y = x * 2 if (y(1) /= 2) error stop if (y(2) /= 4) error stop y = x + 3 if (y(1) /= 4) error stop if (y(2) /= 5) error stop y = x - 1 if (y(1) /= 0) error stop if (y(2) /= 1) error stop z = a * 3 if (z(1) /= 30) error stop if (z(2) /= 60) error stop if (z(3) /= 90) error stop z = a + a if (z(1) /= 20) error stop if (z(2) /= 40) error stop if (z(3) /= 60) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/intrinsics_212.f900000664000175000017500000000652515174404631022466 0ustar alastairalastairprogram intrinsics_212 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: x = 1 complex(4) :: z4 complex(8) :: z8 print*, cabs((1.0, 2.0)) if (abs(cabs((1.0, 2.0)) - 2.23606798) > 10e-5) error stop print*, zabs((1.0_8, 2.0_8)) if (abs(zabs((1.0_8, 2.0_8)) - 2.23606798_8) > 10e-5) error stop print*, cdabs((1.0_8, 2.0_8)) if (abs(cdabs((1.0_8, 2.0_8)) - 2.23606798_8) > 10e-5) error stop print*, csin((1.0, 2.0)) if (abs(csin((1.0, 2.0)) - (3.16577840,1.95960104)) > 10e-5) error stop print*, zsin((1.0_8, 2.0_8)) if (abs(zsin((1.0_8, 2.0_8)) - (3.16577840_8,1.95960104_8)) > 10e-5) error stop print*, cdsin((1.0_8, 2.0_8)) if (abs(cdsin((1.0_8, 2.0_8)) - (3.16577840_8,1.95960104_8)) > 10e-5) error stop print*, ccos((1.0, 2.0)) if (abs(ccos((1.0, 2.0)) - (2.03272295,-3.05189776)) > 10e-5) error stop print*, zcos((1.0_8, 2.0_8)) if (abs(zcos((1.0_8, 2.0_8)) - (2.03272295_8,-3.05189776_8)) > 10e-5) error stop print*, cdcos((1.0_8, 2.0_8)) if (abs(cdcos((1.0_8, 2.0_8)) - (2.03272295_8,-3.05189776_8)) > 10e-5) error stop print*, csqrt((1.0, 2.0)) if (abs(csqrt((1.0, 2.0)) - (1.27201965,0.78615138)) > 10e-5) error stop print*, zsqrt((1.0_8, 2.0_8)) if (abs(zsqrt((1.0_8, 2.0_8)) - (1.27201965_8,0.78615138_8)) > 10e-5) error stop print*, cdsqrt((1.0_8, 2.0_8)) if (abs(cdsqrt((1.0_8, 2.0_8)) - (1.27201965_8,0.78615138_8)) > 10e-5) error stop print*, cexp((1.0, 2.0)) if (abs(cexp((1.0, 2.0)) - (-1.13120438,2.47172667)) > 10e-5) error stop print*, zexp((1.0_8, 2.0_8)) if (abs(zexp((1.0_8, 2.0_8)) - (-1.13120438_8,2.47172667_8)) > 10e-5) error stop print*, cdexp((1.0_8, 2.0_8)) if (abs(cdexp((1.0_8, 2.0_8)) - (-1.13120438_8,2.47172667_8)) > 10e-5) error stop print*, xor(1, 1) if (xor(1, 1) /= 0) error stop z4 = (1.0, 2.0) z8 = (1.0_dp, 2.0_dp) print*, cabs(z4) if (abs(cabs(z4) - 2.23606798) > 10e-5) error stop print*, zabs(z8) if (abs(zabs(z8) - 2.23606798_8) > 10e-5) error stop print*, cdabs(z8) if (abs(cdabs(z8) - 2.23606798_8) > 10e-5) error stop print*, csin(z4) if (abs(csin(z4) - (3.16577840,1.95960104)) > 10e-5) error stop print*, zsin(z8) if (abs(zsin(z8) - (3.16577840_8,1.95960104_8)) > 10e-5) error stop print*, cdsin(z8) if (abs(cdsin(z8) - (3.16577840_8,1.95960104_8)) > 10e-5) error stop print*, ccos(z4) if (abs(ccos(z4) - (2.03272295,-3.05189776)) > 10e-5) error stop print*, zcos(z8) if (abs(zcos(z8) - (2.03272295_8,-3.05189776_8)) > 10e-5) error stop print*, cdcos(z8) if (abs(cdcos(z8) - (2.03272295_8,-3.05189776_8)) > 10e-5) error stop print*, csqrt(z4) if (abs(csqrt(z4) - (1.27201965,0.78615138)) > 10e-5) error stop print*, zsqrt(z8) if (abs(zsqrt(z8) - (1.27201965_8,0.78615138_8)) > 10e-5) error stop print*, cdsqrt(z8) if (abs(cdsqrt(z8) - (1.27201965_8,0.78615138_8)) > 10e-5) error stop print*, cexp(z4) if (abs(cexp(z4) - (-1.13120438,2.47172667)) > 10e-5) error stop print*, zexp(z8) if (abs(zexp(z8) - (-1.13120438_8,2.47172667_8)) > 10e-5) error stop print*, cdexp(z8) if (abs(cdexp(z8) - (-1.13120438_8,2.47172667_8)) > 10e-5) error stop print*, xor(x, x) if (xor(x, x) /= 0) error stop end programlfortran-0.63.0/integration_tests/custom_operator_07.f900000664000175000017500000000221415174404631023437 0ustar alastairalastairmodule custom_operator_07_a implicit none public :: string_t type string_t character(len=:), allocatable :: string_ contains generic :: operator(//) => string_t_cat_string_t procedure, private :: string_t_cat_string_t end type contains elemental module function from_characters(string) result(new_string) implicit none character(len=*), intent(in) :: string type(string_t) new_string new_string%string_ = string end function pure module function string_t_cat_string_t(lhs, rhs) result(lhs_cat_rhs) implicit none class(string_t), intent(in) :: lhs, rhs type(string_t) lhs_cat_rhs lhs_cat_rhs = string_t(lhs%string_ // rhs%string_) end function end module custom_operator_07_a module custom_operator_07_b use custom_operator_07_a implicit none contains subroutine test_concat type(string_t) :: str, left, right left = string_t("a") right = string_t("b") str = left // right end subroutine test_concat end module custom_operator_07_b program custom_operator_07 use custom_operator_07_b implicit none call test_concat() end program custom_operator_07 lfortran-0.63.0/integration_tests/while_07.f900000664000175000017500000000044715174404631021330 0ustar alastairalastairprogram while_07 implicit none logical :: finished(4) integer :: count = 0 finished = .true. do while (all(finished)) finished = .false. count = count + 1 if (count > 1) error stop end do print *, count if (count /= 1) error stop end program while_07 lfortran-0.63.0/integration_tests/int_dp_param.f900000664000175000017500000000025515174404631022344 0ustar alastairalastairprogram int_dp_param integer, parameter :: prec1 = 4, prec2 = 8 integer(prec1) :: u = 2147483647 integer(prec2) :: v = 2147483647 print *, u, v end programlfortran-0.63.0/integration_tests/elemental_function_scalar_array_arg.f900000664000175000017500000000211115174404631027127 0ustar alastairalastairmodule mod_elemental_function_scalar_array_arg implicit none interface count module procedure count_char_char end interface contains !> Returns an integer elemental function count_char_char(string, pattern) result(res) character(len=*), intent(in) :: string character(len=*), intent(in) :: pattern integer :: res res = 1 end function count_char_char end module program elemental_function_scalar_array_arg use mod_elemental_function_scalar_array_arg implicit none character(len=128) :: string integer :: count_value1(3) integer :: count_value2(3) string = "How much wood would a woodchuck chuck if a woodchuck could chuck wood?" print *, count_char_char(string, ["would", "chuck", "could"]) count_value1 = count_char_char(string, ["would", "chuck", "could"]) if (any(count_value1 /= [1, 1, 1])) error stop print *, count(string, ["would", "chuck", "could"]) count_value2 = count(string, ["would", "chuck", "could"]) if (any(count_value2 /= [1, 1, 1])) error stop end program lfortran-0.63.0/integration_tests/select_type_20.f900000664000175000017500000000073015174404631022526 0ustar alastairalastairprogram select_type_20 implicit none logical, target :: l(3) class(*), pointer :: generic(:) l = [.true., .false., .true.] generic => l select type (x => generic) type is (logical) if (.not. x(1)) error stop if (x(2)) error stop if (count(x) /= 2) error stop x(2) = .true. if (count(l) /= 3) error stop class default error stop end select print *, "ok" end program select_type_20 lfortran-0.63.0/integration_tests/select_rank_26.f900000664000175000017500000000071215174404631022506 0ustar alastairalastairprogram select_rank_26 implicit none real :: x(3) x = [1.0, 2.0, 3.0] call foo(x) print *, "ok" contains subroutine foo(input) class(*), dimension(..), intent(in) :: input rank_select: select rank(input) rank(1) select type(input) type is(real) exit rank_select end select error stop end select rank_select end subroutine end program lfortran-0.63.0/integration_tests/doloop_16.f900000664000175000017500000000020315174404631021502 0ustar alastairalastairprogram doloop_16 integer :: i do i = 0, -16 end do print *, i if ( i /= 0 ) error stop end program doloop_16 lfortran-0.63.0/integration_tests/arrays_reshape_25.f900000664000175000017500000000072715174404631023231 0ustar alastairalastairprogram arrays_reshape_25 implicit none real :: b(3, 2) = reshape([-1, -3, 6, 7, 8, 9], [3, 2]) if (b(1,1) /= -1.0) error stop "Mismatch at b(1,1)" if (b(2,1) /= -3.0) error stop "Mismatch at b(2,1)" if (b(3,1) /= 6.0) error stop "Mismatch at b(3,1)" if (b(1,2) /= 7.0) error stop "Mismatch at b(1,2)" if (b(2,2) /= 8.0) error stop "Mismatch at b(2,2)" if (b(3,2) /= 9.0) error stop "Mismatch at b(3,2)" end program arrays_reshape_25 lfortran-0.63.0/integration_tests/rewind_01.f900000664000175000017500000000106715174404631021501 0ustar alastairalastairprogram rewind_01 implicit none integer :: ios integer, parameter :: u = 10 character(len=128) :: msg open(unit=u, file="rewind_01_file.txt", status="replace", access="direct", recl=4, iostat=ios) if (ios /= 0) error stop msg = "sentinel" rewind(unit=u, iostat=ios, iomsg=msg) if (ios == 0) error stop #if defined(__LFORTRAN__) if (len_trim(msg) == 0) error stop if (trim(msg) /= "REWIND cannot be used on UNIT 10 opened with DIRECT access.") error stop #endif close(unit=u, status="delete") end program rewind_01 lfortran-0.63.0/integration_tests/implicit_interface_37.f900000664000175000017500000000075715174404631024061 0ustar alastairalastairsubroutine compute(a, b, proc) integer :: a(2), b(1) external proc call sub1(b, proc) call sub1(a(2), proc) end subroutine subroutine sub1(x, proc) integer :: x(*) external proc call proc(x(1)) end subroutine subroutine add_one(val) integer :: val val = val + 1 end subroutine program implicit_interface_37 implicit none integer :: a(2), b(1) external add_one a = [10, 20] b = [5] call compute(a, b, add_one) if (b(1) /= 6) error stop if (a(2) /= 21) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/boz_02.f900000664000175000017500000000256215174404631021005 0ustar alastairalastair!This file contains tests for BOZ, which are not yet supported in gfortran program real_boz implicit none !check DATA Assignments integer :: i real :: boz_1, matrix1(5), matrix2(2), arr1(2) integer :: arr2(2) !Check Scalar Assigment data boz_1 /b'01011101'/ !Check Multiple Assigments of Real array with BOZ Values data matrix1 / b'10', 2*o'100', 3.12, z'ABC' / !Check Data Broadcasting to all elements of array data matrix2 / 2*b'10' / !Check Implied Do loop Assignments, with real assigments along with integer assignments data (arr1(i), arr2(i), i=1,2) / 1.2, z'02', z'01', 3 / !Check Declaration Statements !Check Scalar Initializations real::a = o'10' integer::b = z'10' !Check Parameter Initializations real,parameter::c = b'01' integer,parameter::d = z'02' !Check Array Initializations real:: e(3) = [real::b'01', z'10', 3.4] integer:: f(3) = [integer::1, b'10', 4] !Check for BOZ Assignments integer :: boz_6 integer :: boz_arr_int(2) real:: boz_7 real:: boz_arr_real(2) !Check Integer Array Assignments boz_arr_int(1) = b'11' boz_arr_int(2) = 1 !Check Real Array Assignments boz_arr_real(1) = z'01' boz_arr_real(2) = 1.2 !Check Integer Scalar Assignments boz_6 = o'02' !Check Real Scalar Assignments boz_7 = z'03' print *, boz_1 print *, matrix1 print *, matrix2 print *, arr1, arr2 print *, a,b,c,d,e,f print *, boz_6, boz_7 print *, boz_arr_int, boz_arr_real end program lfortran-0.63.0/integration_tests/separate_compilation_28.f900000664000175000017500000000031415174404631024416 0ustar alastairalastair! Common block with CHARACTER - main program program separate_compilation_28 implicit none character(32) :: srnamt common /srnamc/ srnamt call set_name() call print_name() end program lfortran-0.63.0/integration_tests/format_82.f900000664000175000017500000000661715174404631021520 0ustar alastairalastairprogram format_82 implicit none integer :: u, ios real :: val character(len=100) :: line character(len=20) :: round_val val = 2.67 ! ------------------------------- ! round="up" ! ------------------------------- open(newunit=u, file="format_82_file.txt", status="replace", & form="formatted", round="up") write(u, '(F4.1)') val close(u) open(newunit=u, file="format_82_file.txt", status="old") read(u, '(A)') line close(u, status="delete") if (trim(adjustl(line)) /= "2.7") error stop ! ------------------------------- ! round="down" ! ------------------------------- open(newunit=u, file="format_82_file.txt", status="replace", & form="formatted", round="down") write(u, '(F4.1)') val close(u) open(newunit=u, file="format_82_file.txt", status="old") read(u, '(A)') line close(u, status="delete") if (trim(adjustl(line)) /= "2.6") error stop ! ------------------------------- ! round="nearest" ! ------------------------------- open(newunit=u, file="format_82_file.txt", status="replace", & form="formatted", round="nearest") write(u, '(F4.1)') val close(u) open(newunit=u, file="format_82_file.txt", status="old") read(u, '(A)') line close(u, status="delete") if (trim(adjustl(line)) /= "2.7") error stop ! ------------------------------- ! round="zero" ! ------------------------------- open(newunit=u, file="format_82_file.txt", status="replace", & form="formatted", round="zero") write(u, '(F4.1)') val close(u) open(newunit=u, file="format_82_file.txt", status="old") read(u, '(A)') line close(u, status="delete") if (trim(adjustl(line)) /= "2.6") error stop ! Test 1: nearest open(newunit=u, file="format_82_file.txt", status="replace", & form="formatted", round="nearest") inquire(unit=u, round=round_val) if (trim(round_val) /= "NEAREST") error stop 1 close(u, status="delete") ! Test 2: up open(newunit=u, file="format_82_file.txt", status="replace", & form="formatted", round="up") inquire(unit=u, round=round_val) if (trim(round_val) /= "UP") error stop 2 close(u, status="delete") ! Test 3: down open(newunit=u, file="format_82_file.txt", status="replace", & form="formatted", round="down") inquire(unit=u, round=round_val) if (trim(round_val) /= "DOWN") error stop 3 close(u, status="delete") ! Test 4: zero open(newunit=u, file="format_82_file.txt", status="replace", & form="formatted", round="zero") inquire(unit=u, round=round_val) if (trim(round_val) /= "ZERO") error stop 4 close(u, status="delete") ! Test 5: compatible open(newunit=u, file="format_82_file.txt", status="replace", & form="formatted", round="compatible") inquire(unit=u, round=round_val) if (trim(round_val) /= "COMPATIBLE") error stop 5 close(u, status="delete") ! Test 6: processor_defined open(newunit=u, file="format_82_file.txt", status="replace", & form="formatted", round="processor_defined") inquire(unit=u, round=round_val) if (trim(round_val) /= "PROCESSOR_DEFINED") error stop 6 close(u, status="delete") ! Test 7: default open(newunit=u, file="format_82_file.txt", status="replace", & form="formatted") inquire(unit=u, round=round_val) if (trim(round_val) /= "PROCESSOR_DEFINED") error stop 7 close(u, status="delete") end program format_82 lfortran-0.63.0/integration_tests/arrays_100.f900000664000175000017500000000036015174404631021565 0ustar alastairalastairmodule arrays_100_mod character :: arr(3) = ['a', 'b', 'c'] end module program arrays_100 use arrays_100_mod if (arr(1) /= 'a') error stop if (arr(2) /= 'b') error stop if (arr(3) /= 'c') error stop print *, "All tests passed" end program lfortran-0.63.0/integration_tests/variables_03.f900000664000175000017500000000034615174404631022162 0ustar alastairalastairprogram variables_03 implicit none integer :: x logical :: b x = 2 b = (x /= 2) if (b) error stop b = (x == 2) if (.not. b) error stop b = .not. (x == 2) if (b) error stop b = (x == 2) b = .not. b if (b) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_96.f900000664000175000017500000000063615174404631022205 0ustar alastairalastairprogram gpu_metal_96 ! Array-section division by scalar inside do concurrent implicit none real :: a(4), b(4) integer :: i b(1) = 4.0 b(2) = 6.0 b(3) = 10.0 b(4) = 20.0 do concurrent (i = 1:1) a(1:4) = b(1:4) / 2 end do if (abs(a(1) - 2.0) > 1e-6) error stop if (abs(a(2) - 3.0) > 1e-6) error stop if (abs(a(3) - 5.0) > 1e-6) error stop if (abs(a(4) - 10.0) > 1e-6) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/modules_51.f900000664000175000017500000000037215174404631021664 0ustar alastairalastairmodule modules_51_module public :: a end module subroutine sub() use modules_51_module if (abs(a - 2.0) > 1e-8) error stop print *, a end subroutine program modules_51 use modules_51_module a = 2 call sub() end program lfortran-0.63.0/integration_tests/arrays_09_size.f900000664000175000017500000000047715174404631022560 0ustar alastairalastairmodule mod_arrays_09_size contains subroutine sub(xx) real :: xx(5) real :: buggy(count(xx > 0.0)) if (size(buggy) /= 3) error stop end subroutine sub end module mod_arrays_09_size program arrays_09_size use mod_arrays_09_size real :: xx(5) = [1.1, 2.1, -1.3, 3.4, 0.0] call sub(xx) end programlfortran-0.63.0/integration_tests/openmp_43.f900000664000175000017500000000122715174404631021513 0ustar alastairalastairprogram openmp_43 implicit none integer :: i,fun_sum,sub_sum,x fun_sum = 0 do concurrent (i = 1:4) reduce(+:fun_sum) fun_sum = fun_sum + FUN(i) end do print *,"FUN sum->", fun_sum sub_sum = 0 do concurrent (i = 1:4) reduce(+:sub_sum) x=i call SUB(x) sub_sum = sub_sum + x end do print *,"SUB sum->", sub_sum if(sub_sum /= 30) error stop if(fun_sum /= 30) error stop contains pure subroutine SUB(x) integer, intent(inout) :: x x = x * x end subroutine SUB PURE integer function FUN(x) integer, intent(in) :: x FUN = x * x end function FUN end program openmp_43lfortran-0.63.0/integration_tests/operator_overloading_31.f900000664000175000017500000000207615174404631024441 0ustar alastairalastairmodule operator_overloading_31_m1 implicit none private public :: t, operator(==) type :: t integer :: v end type interface operator(==) module procedure t_eq end interface contains pure logical function t_eq(a, b) type(t), intent(in) :: a(:), b(:) t_eq = all(a%v == b%v) end function end module module operator_overloading_31_m2 use operator_overloading_31_m1, only: t, operator(==) implicit none private public :: t, operator(==) end module module operator_overloading_31_m3 use operator_overloading_31_m2 implicit none contains logical function compare(a, b) type(t), intent(in) :: a(:), b(:) compare = (a == b) end function end module program operator_overloading_31 use operator_overloading_31_m1 use operator_overloading_31_m3 implicit none type(t) :: x(2), y(2), z(2) x = [t(1), t(2)] y = [t(1), t(2)] z = [t(3), t(4)] if (.not. compare(x, y)) error stop if (compare(x, z)) error stop print *, compare(x, y) end program lfortran-0.63.0/integration_tests/read_13.f900000664000175000017500000000063515174404631021127 0ustar alastairalastairprogram read_13 implicit none real :: arr(5) integer :: i, j open(10, file="read_13_data.txt", status="replace") write(10, *) 1.0, 2.0, 3.0, 4.0, 5.0 close(10) open(10, file="read_13_data.txt", status="old") read(10, *) (arr(j), j=1,5) close(10, status="delete") do i = 1, 5 if (abs(arr(i) - real(i)) > 1e-6) error stop end do print *, "PASS" end programlfortran-0.63.0/integration_tests/file_12_data.txt0000664000175000017500000000000015174404631022326 0ustar alastairalastairlfortran-0.63.0/integration_tests/procedure_08.f900000664000175000017500000000300615174404631022203 0ustar alastairalastair!! Test to check if actual function is called instead of its m_type_declaration module procedure_08_module contains subroutine cb(x) implicit none integer, intent(inout), optional :: x(:) x = 1 end subroutine cb subroutine calfun(x) implicit none integer, intent(inout), optional :: x(:) logical :: y x = 2 y = present(x) print *, y if (.not. y) error stop end subroutine calfun end module procedure_08_module program procedure_08 use procedure_08_module call temp(calfun) call temp() call temp2(calfun) call temp2() contains subroutine temp(call_back) implicit none procedure(cb), optional :: call_back integer :: x(4) if(present(call_back)) then call call_back(x) print *, x if(x(1) /= 2) error stop end if end subroutine temp subroutine temp2(call_back) implicit none procedure(cb), optional :: call_back integer, save :: x(4) = 0 if(present(call_back)) then call temp3(call_back, x) call temp3(call_back, x(1:3)) end if end subroutine !! Check: call_back is updated in `pass_array_by_data` pass subroutine temp3(call_back, x) implicit none procedure(cb) :: call_back integer, intent(inout) :: x(:) call call_back(x) print *, x if(x(1) /= 2) error stop end subroutine end program procedure_08lfortran-0.63.0/integration_tests/intrinsics_170.f900000664000175000017500000001740415174404631022467 0ustar alastairalastairprogram intrinsics_170 use iso_fortran_env, only: sp => real32, dp => real64 implicit none integer, parameter :: i1 = exponent(1.0_sp) integer, parameter :: i2 = exponent(1.32_dp) integer, parameter :: i3(3) = exponent([3.121_sp, 4.1_sp, 5.32_sp]) integer, parameter :: i4(3) = exponent([3.121_dp, 4.1_dp, 5.32_dp]) real(sp) :: x real(dp) :: y real(sp) :: arr1(3) = [3.121_sp, 4.1_sp, 5.32_sp] real(dp) :: arr2(3) = [3.121_dp, 4.1_dp, 5.32_dp] x = 4.1 y = 4.1_dp print *, i1 if (i1 /= 1) error stop print *, i2 if (i2 /= 1) error stop print *, i3 if (any(i3 /= [2, 3, 3])) error stop print *, i4 if (any(i4 /= [2, 3, 3])) error stop print *, exponent(x) if (exponent(x) /= 3) error stop print *, exponent(4.1_dp) if (exponent(4.1_dp) /= 3) error stop print *, exponent(y) if (exponent(y) /= 3) error stop x = 0.5 y = 0.5_dp print *, exponent(x) if (exponent(x) /= 0) error stop print *, exponent(0.5_dp) if (exponent(0.5_dp) /= 0) error stop print *, exponent(y) if (exponent(y) /= 0) error stop print *, exponent(0.5) if (exponent(0.5) /= 0) error stop x = -12.94 y = -12.94_dp print *, exponent(x) if (exponent(x) /= 4) error stop print *, exponent(-12.94_dp) if (exponent(-12.94_dp) /= 4) error stop print *, exponent(y) if (exponent(y) /= 4) error stop print *, exponent(-12.94) if (exponent(-12.94) /= 4) error stop x = 1e+6_sp y = 1e+10_dp print *, exponent(x) if (exponent(x) /= 20) error stop print *, exponent(1e+10_dp) if (exponent(1e+10_dp) /= 34) error stop print *, exponent(y) if (exponent(y) /= 34) error stop print *, exponent(1e+6) if (exponent(1e+6) /= 20) error stop x = -1e+6_sp y = -1e+10_dp print *, exponent(x) if (exponent(x) /= 20) error stop print *, exponent(-1e+10_dp) if (exponent(-1e+10_dp) /= 34) error stop print *, exponent(y) if (exponent(y) /= 34) error stop print *, exponent(-1e+6) if (exponent(-1e+6) /= 20) error stop x = 1e-6_sp y = 1e-10_dp print *, exponent(x) if (exponent(x) /= -19) error stop print *, exponent(1e-10_dp) if (exponent(1e-10_dp) /= -33) error stop print *, exponent(y) if (exponent(y) /= -33) error stop print *, exponent(1e-6) if (exponent(1e-6) /= -19) error stop x = 0.0 y = 0.0_dp print *, exponent(x) if (exponent(x) /= 0) error stop print *, exponent(0.0_dp) if (exponent(0.0_dp) /= 0) error stop print *, exponent(y) if (exponent(y) /= 0) error stop print *, exponent(0.0) if (exponent(0.0) /= 0) error stop print *, exponent(3.99) if (exponent(3.99) /= 2) error stop print *, exponent(3.99_dp) if (exponent(3.99_dp) /= 2) error stop x = 3.99 y = 3.99_dp print *, exponent(x) if (exponent(x) /= 2) error stop print *, exponent(y) if (exponent(y) /= 2) error stop print *, exponent(7.99) if (exponent(7.99) /= 3) error stop print *, exponent(7.99_dp) if (exponent(7.99_dp) /= 3) error stop x = 7.99 y = 7.99_dp print *, exponent(x) if (exponent(x) /= 3) error stop print *, exponent(y) if (exponent(y) /= 3) error stop print *, exponent(8.1) if (exponent(8.1) /= 4) error stop print *, exponent(8.1_dp) if (exponent(8.1_dp) /= 4) error stop x = 8.1 y = 8.1_dp print *, exponent(x) if (exponent(x) /= 4) error stop print *, exponent(y) if (exponent(y) /= 4) error stop print *, exponent(2.0) if (exponent(2.0) /= 2) error stop print *, exponent(2.0_dp) if (exponent(2.0_dp) /= 2) error stop x = 2.0 y = 2.0_dp print *, exponent(x) if (exponent(x) /= 2) error stop print *, exponent(y) if (exponent(y) /= 2) error stop print *, exponent(8.0) if (exponent(8.0) /= 4) error stop print *, exponent(8.0_dp) if (exponent(8.0_dp) /= 4) error stop x = 8.0 y = 8.0_dp print *, exponent(x) if (exponent(x) /= 4) error stop print *, exponent(y) if (exponent(y) /= 4) error stop print *, exponent(0.1) if (exponent(0.1) /= -3) error stop print *, exponent(0.1_dp) if (exponent(0.1_dp) /= -3) error stop x = 0.1 y = 0.1_dp print *, exponent(x) if (exponent(x) /= -3) error stop print *, exponent(y) if (exponent(y) /= -3) error stop print *, exponent(0.01) if (exponent(0.01) /= -6) error stop print *, exponent(0.01_dp) if (exponent(0.01_dp) /= -6) error stop x = 0.01 y = 0.01_dp print *, exponent(x) if (exponent(x) /= -6) error stop print *, exponent(y) if (exponent(y) /= -6) error stop print *, exponent(0.001) if (exponent(0.001) /= -9) error stop print *, exponent(0.001_dp) if (exponent(0.001_dp) /= -9) error stop x = 0.001 y = 0.001_dp print *, exponent(x) if (exponent(x) /= -9) error stop print *, exponent(y) if (exponent(y) /= -9) error stop print *, exponent(-3.99) if (exponent(-3.99) /= 2) error stop print *, exponent(-3.99_dp) if (exponent(-3.99_dp) /= 2) error stop x = -3.99 y = -3.99_dp print *, exponent(x) if (exponent(x) /= 2) error stop print *, exponent(y) if (exponent(y) /= 2) error stop print *, exponent(-7.99) if (exponent(-7.99) /= 3) error stop print *, exponent(-7.99_dp) if (exponent(-7.99_dp) /= 3) error stop x = -7.99 y = -7.99_dp print *, exponent(x) if (exponent(x) /= 3) error stop print *, exponent(y) if (exponent(y) /= 3) error stop print *, exponent(-8.1) if (exponent(-8.1) /= 4) error stop print *, exponent(-8.1_dp) if (exponent(-8.1_dp) /= 4) error stop x = -8.1 y = -8.1_dp print *, exponent(x) if (exponent(x) /= 4) error stop print *, exponent(y) if (exponent(y) /= 4) error stop print *, exponent(-2.0) if (exponent(-2.0) /= 2) error stop print *, exponent(-2.0_dp) if (exponent(-2.0_dp) /= 2) error stop x = -2.0 y = -2.0_dp print *, exponent(x) if (exponent(x) /= 2) error stop print *, exponent(y) if (exponent(y) /= 2) error stop print *, exponent(-8.0) if (exponent(-8.0) /= 4) error stop print *, exponent(-8.0_dp) if (exponent(-8.0_dp) /= 4) error stop x = -8.0 y = -8.0_dp print *, exponent(x) if (exponent(x) /= 4) error stop print *, exponent(y) if (exponent(y) /= 4) error stop print *, exponent(-0.1) if (exponent(-0.1) /= -3) error stop print *, exponent(-0.1_dp) if (exponent(-0.1_dp) /= -3) error stop x = -0.1 y = -0.1_dp print *, exponent(x) if (exponent(x) /= -3) error stop print *, exponent(y) if (exponent(y) /= -3) error stop print *, exponent(-0.01) if (exponent(-0.01) /= -6) error stop print *, exponent(-0.01_dp) if (exponent(-0.01_dp) /= -6) error stop x = -0.01 y = -0.01_dp print *, exponent(x) if (exponent(x) /= -6) error stop print *, exponent(y) if (exponent(y) /= -6) error stop print *, exponent(-0.001) if (exponent(-0.001) /= -9) error stop print *, exponent(-0.001_dp) if (exponent(-0.001_dp) /= -9) error stop x = -0.001 y = -0.001_dp print *, exponent(x) if (exponent(x) /= -9) error stop print *, exponent(y) if (exponent(y) /= -9) error stop print *, exponent(arr1) if (any(exponent(arr1) /= [2, 3, 3])) error stop print *, exponent(arr2) if (any(exponent(arr2) /= [2, 3, 3])) error stop print *, kind(exponent(1.0_sp)) if (kind(exponent(1.0_sp)) /= 4) error stop print *, kind(exponent(1.0_dp)) if (kind(exponent(1.0_dp)) /= 4) error stop end program lfortran-0.63.0/integration_tests/allocate_41.f900000664000175000017500000000106215174404631021774 0ustar alastairalastairprogram allocate_41 ! Test realloc-lhs preserves lower bounds from RHS implicit none integer :: i, ng, nz, ni, nf real(8), allocatable :: x(:,:), y(:,:) ng = 4 nz = 12 ni = 1 - ng nf = nz + ng allocate( x(ni:nf, 3) ) x = 1.d0 y = x if (lbound(y, 1) /= ni) error stop if (ubound(y, 1) /= nf) error stop if (lbound(y, 2) /= 1) error stop if (ubound(y, 2) /= 3) error stop do i = ni, nf if (abs(y(i, 1) - 1.d0) > 1.d-15) error stop end do print *, "PASS" end program allocate_41 lfortran-0.63.0/integration_tests/template_sort_01.f900000664000175000017500000000575215174404631023100 0ustar alastairalastairmodule template_sort_01_type implicit none public :: my_type, my_type_lt, test_template type my_type real :: d end type contains pure elemental function lt_my_type(lhs, rhs) result(res) type(my_type), intent(in) :: lhs, rhs logical :: res res = lhs%d < rhs%d end function end module module template_sort_01_m use template_sort_01_type implicit none private public :: sort_t requirement op_r(T, U, V, op_func) type, deferred :: T type, deferred :: U type, deferred :: V pure elemental function op_func(lhs, rhs) result(res) type(T), intent(in) :: lhs type(T), intent(in) :: rhs type(V) :: res end function end requirement template qsort_t(T, lt) require :: op_r(T, T, logical, lt) private public :: qsort contains subroutine swp(lhs, rhs) type(T), intent(inout) :: lhs type(T), intent(inout) :: rhs type(T) :: tmp tmp = lhs lhs = rhs rhs = tmp end subroutine recursive subroutine qs(arr, low, high) type(T), intent(inout) :: arr(:) integer, intent(in) :: low, high integer :: i, last type(T) :: pivot if (low < high) then pivot = arr(high) last = low - 1 do i = low, high - 1 if (lt(arr(i), pivot)) then last = last + 1 call swp(arr(last), arr(i)) end if end do call swp(arr(last + 1), arr(high)) call qs(arr, low, last) call qs(arr, last + 2, high) end if end subroutine end template contains pure elemental function lt_real(lhs, rhs) result(res) real, intent(in) :: lhs real, intent(in) :: rhs logical :: res res = lhs < rhs end function pure elemental function lt_integer(lhs, rhs) result(res) integer, intent(in) :: lhs integer, intent(in) :: rhs logical :: res res = lhs < rhs end function subroutine test_template() integer :: xi(10), i real :: xr(10) type(my_type) :: xm(10) instantiate qsort_t(integer, lt_integer), only: qsort_integer => qs instantiate qsort_t(real, lt_real), only: qsort_real => qs instantiate qsort_t(my_type, lt_my_type), only: qsort_my_type => qs xi = [2,4,1,5,6,24,51,3,42,2] xr = [2,4,1,5,6,24,51,3,42,2] do i = 1, 10 xm(i) = my_type(xr(i)) end do call qsort_integer(xi, 1, 10) call qsort_real(xr, 1, 10) call qsort_my_type(xm, 1, 10) print *, xi print *, xr print *, xm end subroutine end module program template_sort_01 use template_sort_01_m call test_template() end programlfortran-0.63.0/integration_tests/intrinsics_283.f900000664000175000017500000001172115174404631022470 0ustar alastairalastairprogram intrinsics_283 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp) :: arg_x(15) real(sp) :: arg_y(15) real(dp) :: res_x(15) real(sp) :: res_y(15) real(dp) :: expected_res_x(15) real(sp) :: expected_res_y(15) real(dp) :: expected_x(10) real(sp) :: expected_y(10) real(dp) :: a = 0.5178181202_dp real(sp) :: b = -0.072816_sp real(dp) :: c = -0.5178181202_dp real(sp) :: d = 0.072816_sp real(dp), parameter :: res_dp(10) = asinh([-0.62818828_dp, -0.51725372_dp, -0.29257208_dp, & 0.62818828_dp, 0.51725372_dp, 0.29257208_dp, 1.00_dp, 0.829362821_dp, 0.952716192_dp, -0.241626228_dp]) real(sp), parameter :: res_sp(10) = asinh([-0.62818828_sp, -0.51725372_sp, -0.29257208_sp, & 0.62818828_sp, 0.51725372_sp, 0.29257208_sp, 1.00_sp, 0.829362821_sp, 0.952716192_sp, -0.241626228_sp]) expected_x = [-0.59284540422070708_dp, -0.49659053010574444_dp, -0.28855116339769732_dp, & 0.59284540422070708_dp, 0.49659053010574444_dp, 0.28855116339769732_dp, 0.88137358701954305_dp, & 0.75543292593861289_dp, 0.84754059979088248_dp, -0.23933478027454286_dp] arg_x = [-0.67922251126_dp, -0.54363892699177885_dp, -0.29691551032790681_dp, & 0.67922251126401767_dp, 0.54363892699177885_dp, 0.29691551032790681_dp, 0.5707963267948966_dp, & 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp, -0.7281628262782_dp, & 0.5707963267948966_dp, 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp] arg_y = [-0.679222465_sp, -0.543638885_sp, -0.296915501_sp, & 0.679222465_sp, 0.543638885_sp, 0.296915501_sp, 0.57079637_sp, & 0.077966249_sp, 0.262053013_sp, -0.244041398_sp, -0.7281628262782_sp, & 0.57079637_sp, 0.077966249_sp, 0.262053013_sp, -0.244041398_sp] expected_y = [-0.592845380_sp, -0.496590495_sp, -0.288551152_sp, & 0.592845380_sp, 0.496590495_sp, 0.288551152_sp, 0.881373584_sp, & 0.755432904_sp, 0.847540557_sp, -0.239334792_sp] res_x = asinh(arg_x) res_y = asinh(arg_y) expected_res_x = [-0.63556192753734742_dp, -0.51989929786720857_dp, -0.29271739145984588_dp, & 0.63556192754067098_dp, 0.51989929786720857_dp, 0.29271739145984588_dp, 0.54362221755279683_dp, & 7.7887497072915673E-002_dp, 0.25914283865915849_dp, -0.24168173285755049_dp, -0.67558582147651625_dp, & 0.54362221755279683_dp, 7.7887497072915673E-002_dp, 0.25914283865915849_dp, -0.24168173285755049_dp] expected_res_y = [-0.635561883_sp, -0.519899249_sp, -0.292717397_sp, & 0.635561883_sp, 0.519899249_sp, 0.292717397_sp, 0.543622255_sp, & 7.78874755E-02_sp, 0.259142816_sp, -0.241681740_sp, -0.675585806_sp, & 0.543622255_sp, 7.78874755E-02_sp, 0.259142816_sp, -0.241681740_sp] do i = 1, size(res_dp) print *, res_dp(i) if (abs(res_dp(i) - expected_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_x) print *, res_x(i) if (abs(res_x(i)) - abs(expected_res_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_y(i)) > 1e-5) error stop end do do i = 1, size(res_y) print *, res_y(i) if (abs(res_y(i)) - abs(expected_res_y(i)) > 1e-5) error stop end do print *, asinh(a) if (abs(asinh(a)) - 0.49709178005922866_dp > 1e-12) error stop print *, asinh(0.5178181202_dp) if (abs(asinh(0.5178181202_dp) - 0.49709178005922866_dp) > 1e-12) error stop print *, asinh(b) if (asinh(b) - (-7.27518052E-02_sp) > 1e-5) error stop print *, asinh(-0.072816_sp) if (asinh(-0.072816_sp) - (-7.27518052E-02_sp) > 1e-5) error stop print *, asinh(c) if (asinh(c) - (-0.49709178005922866_dp) > 1e-12) error stop print *, asinh(-0.5178181202_dp) if (asinh(-0.5178181202_dp) - (-0.49709178005922866_dp) > 1e-12) error stop print *, asinh(d) if (asinh(d) - (7.27518052E-02_sp) > 1e-5) error stop print *, asinh(0.072816_sp) if (asinh(0.072816_sp) - (7.27518052E-02_sp) > 1e-5) error stop a = -0.271927291_dp b = -0.6382728_sp c = 0.271927291_dp d = 0.6382728_sp print *, asinh(a) if (abs(asinh(a) - (-0.26868287761696719_dp)) > 1e-12) error stop print *, asinh(-0.271927291_dp) if (abs(asinh(-0.271927291_dp) - (-0.26868287761696719_dp)) > 1e-12) error stop print *, asinh(b) if (asinh(b) - (-0.601365387_sp) > 1e-5) error stop print *, asinh(-0.6382728_sp) if (asinh(-0.6382728_sp) - (-0.601365387_sp) > 1e-5) error stop print *, asinh(c) if (asinh(c) - (0.26868287761696719_dp) > 1e-12) error stop print *, asinh(0.271927291_dp) if (asinh(0.271927291_dp) - (0.26868287761696719_dp) > 1e-12) error stop print *, asinh(d) if (asinh(d) - (0.601365387_sp) > 1e-5) error stop print *, asinh(0.6382728_sp) if (asinh(0.6382728_sp) - (0.601365387_sp) > 1e-5) error stop end program lfortran-0.63.0/integration_tests/separate_compilation_09.f900000664000175000017500000000036315174404631024421 0ustar alastairalastairprogram separate_compilatio_09 use mpi_separate_compilation_09b integer :: comm_f comm_f = 1000 print *, handle_mpi_comm_f2c(comm_f) if ( handle_mpi_comm_f2c(comm_f) /= 412 ) error stop end program separate_compilatio_09 lfortran-0.63.0/integration_tests/nested_callback_arrays.f900000664000175000017500000000363715174404631024375 0ustar alastairalastairmodule linalg_mod use iso_fortran_env, only: real64 implicit none private public :: inprod, matprod12 contains function inprod(x, y) result(z) real(real64), intent(in) :: x(:) real(real64), intent(in) :: y(:) real(real64) :: z integer :: i z = 0.0_real64 do i = 1, int(size(x), kind(i)) z = z + x(i) * y(i) end do end function inprod function matprod12(x, y) result(z) real(real64), intent(in) :: x(:) real(real64), intent(in) :: y(:, :) real(real64) :: z(size(y, 2)) integer :: j do j = 1, int(size(y, 2), kind(j)) z(j) = inprod(x, y(:, j)) end do end function matprod12 end module linalg_mod module caller_mod use iso_fortran_env, only: real64 implicit none private public :: call_calcfc abstract interface subroutine objcon(x, constr) import real64 real(real64), intent(in) :: x(:) real(real64), intent(out) :: constr(:) end subroutine objcon end interface contains subroutine call_calcfc(calcfc, x, constr) procedure(objcon) :: calcfc real(real64), intent(in) :: x(:) real(real64), intent(out) :: constr(:) call calcfc(x, constr) end subroutine call_calcfc end module caller_mod program nested_callback_arrays use iso_fortran_env, only: real64 use linalg_mod, only: matprod12 use caller_mod, only: call_calcfc implicit none real(real64) :: amat(2, 1) real(real64) :: bvec(1) real(real64) :: x(2) real(real64) :: constr(1) amat = 1.0_real64 bvec = 0.0_real64 x = [1.0_real64, 2.0_real64] call call_calcfc(calcfc_internal, x, constr) if (constr(1) /= 3.0_real64) error stop contains subroutine calcfc_internal(x_internal, constr_internal) real(real64), intent(in) :: x_internal(:) real(real64), intent(out) :: constr_internal(:) constr_internal = matprod12(x_internal, amat) - bvec end subroutine calcfc_internal end program nested_callback_arrays lfortran-0.63.0/integration_tests/derived_types_103.f900000664000175000017500000000136515174404631023143 0ustar alastairalastairmodule mytypemod type, abstract :: AbsType end type AbsType type :: MyType end type MyType interface MyType procedure :: constructor end interface MyType contains function constructor(obj) result(self) type(MyType) :: self class(AbsType), intent(in) :: obj end function constructor end module mytypemod module clientmod use mytypemod, only: AbsType, MyType contains function get_my_obj() result(myobj) class(MyType), allocatable :: myobj myobj = MyType(get_obj()) end function get_my_obj function get_obj() result(obj) class(AbsType), allocatable :: obj end function get_obj end module clientmod program test use clientmod end program test lfortran-0.63.0/integration_tests/types_07.f900000664000175000017500000000121715174404631021360 0ustar alastairalastairprogram types_07 implicit none integer, target :: x integer, pointer :: y => x real, target :: a(5) real, pointer :: b(:) => a contains subroutine f(s, s2) character(len=:), allocatable, intent(in) :: s character(:), allocatable, intent(in) :: s2 end subroutine subroutine g(s, s2) character(len=*), intent(in) :: s character(*), intent(in) :: s2 end subroutine subroutine h(s, s2) character(len=80), intent(in) :: s character(80), intent(in) :: s2 end subroutine subroutine m(s, s2) character(len=40+40), intent(in) :: s character(100-20), intent(in) :: s2 end subroutine end program lfortran-0.63.0/integration_tests/equivalence_12.f900000664000175000017500000000051715174404631022513 0ustar alastairalastairprogram equivalence_12 ! ICE: segfault when EQUIVALENCE 3D arrays have DATA with mixed values implicit none double precision :: dt19x(2,2,4), dt19xa(2,2,2) equivalence (dt19x(1,1,1), dt19xa(1,1,1)) data dt19xa /1.0d0, 7*0.0d0/ if (abs(dt19x(1,1,1) - 1.0d0) > 1.0d-10) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/implied_do_loops29.f900000664000175000017500000000166515174404631023411 0ustar alastairalastairprogram implied_do_loops29 use, intrinsic :: iso_fortran_env, only: int8, real32 implicit none character(*), parameter :: s = '1.234' integer(int8), parameter :: d0 = ichar('0', int8), dot = ichar('.', int8) - d0 integer :: e real(8), parameter :: base(76) = [ (10.0d0**(39-e), e=1,39), (10.0d0**(-e), e=1,37) ] integer(int8) :: i, p, pP, pE, resp integer :: v real(real32) :: x p = 1; pP = 127; v = 0 do i = p, len(s) select case (iachar(s(i:i)) - d0) case (0:9) v = v*10 + (iachar(s(i:i)) - d0) case (dot) pP = i case default exit end select end do pE = len(s) + 1 p = len(s) + 1 - pP resp = pE - min(pP, p) if (resp <= 0) resp = resp + 1 print *, 'v = ', v print *, 'resp = ', resp print *, 'base(38 + resp) = ', base(42) x = real(v, real32) * real(base(38 + resp), real32) print '(a,1x,g0)', 'result :', x if (abs(x - 1.234) > 1.0e-6) error stop 1 end program lfortran-0.63.0/integration_tests/verify_intent_external_01_mod2.f900000664000175000017500000000112415174404631025713 0ustar alastairalastairmodule worker_mod use data_mod, only: global_count, global_values implicit none contains subroutine set_count(n) integer, intent(out) :: n n = 5 end subroutine set_count subroutine fill_values(arr, n) integer, intent(in) :: n real, intent(out) :: arr(n) integer :: i do i = 1, n arr(i) = real(i * 10) end do end subroutine fill_values subroutine do_work() call set_count(global_count) call fill_values(global_values, global_count) end subroutine do_work end module worker_mod lfortran-0.63.0/integration_tests/namelist_05.f900000664000175000017500000000376615174404631022041 0ustar alastairalastairprogram namelist_3d implicit none ! Define 3D arrays integer :: cube(2,3,4) real :: tensor(2,2,2) integer :: i, j, k ! Define namelist namelist /arrays3d/ cube, tensor ! Initialize cube (2x3x4 = 24 elements) do k = 1, 4 do j = 1, 3 do i = 1, 2 cube(i,j,k) = (i-1)*12 + (j-1)*4 + k end do end do end do ! Initialize tensor (2x2x2 = 8 elements) tensor(1,1,1) = 1.1 tensor(1,1,2) = 1.2 tensor(1,2,1) = 2.1 tensor(1,2,2) = 2.2 tensor(2,1,1) = 3.1 tensor(2,1,2) = 3.2 tensor(2,2,1) = 4.1 tensor(2,2,2) = 4.2 ! Write namelist to file open(unit=10, file='namelist_3d.dat', status='replace', form='formatted') write(10, nml=arrays3d) close(10) ! Reset all values to zero cube = 0 tensor = 0.0 ! Read namelist from file open(unit=10, file='namelist_3d.dat', status='old', form='formatted') read(10, nml=arrays3d) close(10) ! Verify cube values do k = 1, 4 do j = 1, 3 do i = 1, 2 if (cube(i,j,k) /= (i-1)*12 + (j-1)*4 + k) then error stop "Cube element mismatch" end if end do end do end do ! Verify tensor values (with tolerance for floating point) if (abs(tensor(1,1,1) - 1.1) > 1.0e-5) error stop "tensor(1,1,1) mismatch" if (abs(tensor(1,1,2) - 1.2) > 1.0e-5) error stop "tensor(1,1,2) mismatch" if (abs(tensor(1,2,1) - 2.1) > 1.0e-5) error stop "tensor(1,2,1) mismatch" if (abs(tensor(1,2,2) - 2.2) > 1.0e-5) error stop "tensor(1,2,2) mismatch" if (abs(tensor(2,1,1) - 3.1) > 1.0e-5) error stop "tensor(2,1,1) mismatch" if (abs(tensor(2,1,2) - 3.2) > 1.0e-5) error stop "tensor(2,1,2) mismatch" if (abs(tensor(2,2,1) - 4.1) > 1.0e-5) error stop "tensor(2,2,1) mismatch" if (abs(tensor(2,2,2) - 4.2) > 1.0e-5) error stop "tensor(2,2,2) mismatch" print *, "3D array namelist test passed!" end program namelist_3d lfortran-0.63.0/integration_tests/openmp_13.f900000664000175000017500000000227415174404631021513 0ustar alastairalastairsubroutine initialize_array_kernel_1(n, a) integer, intent(in) :: n real, intent(out) :: a(n) integer :: i !$omp parallel shared(a) private(i) !$omp do do i = 1, n a(i) = 12.91 end do !$omp end do !$omp end parallel print *, a(1), a(n), a(12), a(12841) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(n) - 12.91) > 1e-8) error stop if (abs(a(12) - 12.91) > 1e-8) error stop if (abs(a(12841) - 12.91) > 1e-8) error stop end subroutine subroutine initialize_array(n, b) use omp_lib implicit none integer, intent(in) :: n real, dimension(n), intent(out) :: b integer :: i call initialize_array_kernel_1(n, b) print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end subroutine program openmp_13 use omp_lib integer, parameter :: n = 100000 real, dimension(n) :: c print *, c(2) call omp_set_num_threads(4) call initialize_array(n, c) print *, c(1), c(n), c(12), c(12841) if (abs(c(1) - 12.91) > 1e-8) error stop if (abs(c(n) - 12.91) > 1e-8) error stop if (abs(c(12) - 12.91) > 1e-8) error stop if (abs(c(12841) - 12.91) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/separate_compilation_05.f900000664000175000017500000000042315174404631024412 0ustar alastairalastairprogram separate_compilation_05 use separate_compilation_05b_module use ieee_arithmetic, only: ieee_is_nan implicit none real, allocatable :: A(:,:) allocate(A(3,3)) A = 02315.1235 call temp(A) print *, ieee_is_nan(A(1,1)) if ( ieee_is_nan(A(1,1)) ) error stop end program lfortran-0.63.0/integration_tests/implicit_interface_16.f900000664000175000017500000000027415174404631024050 0ustar alastairalastairprogram implicit_interface_16 implicit none real :: v(4) logical, external :: sisnan v = [1.0, 2.0, 3.0, 4.0] print *, sisnan( v( 1 ) ) if( sisnan( v( 1 ) ) ) error stop end program lfortran-0.63.0/integration_tests/write_01.f900000664000175000017500000000044115174404631021336 0ustar alastairalastairprogram main implicit none real :: x(2) call compare_solutions(x) contains subroutine compare_solutions(x) real,dimension(:),intent(in) :: x real:: diff(2) diff = [1.0, 2.0] write (*,*), diff end subroutine compare_solutions end program main lfortran-0.63.0/integration_tests/intrinsics_57.f900000664000175000017500000000221015174404631022400 0ustar alastairalastairprogram intrinsics_57 implicit none character(len=:), allocatable :: shorts(:) character(len=:), allocatable :: long integer :: a(10), i, res(10) logical :: m do i = 1, 10 a(i) = i end do allocate(character(len=6) :: shorts(10)) allocate(character(len=5) :: long) shorts(1:10:2) = "shorts" shorts(2:10:2) = "long" long = "long" print *, shorts print *, long print *, merge(1, a, shorts == long) res = merge(2, a, shorts == long) m = .false. do i = 1, 10 if( m ) then if( res(i) /= 2 ) error stop else if( res(i) /= a(i) ) error stop end if m = .not. m end do print *, merge(a, 0, shorts == long) res = merge(a, 3, shorts == long) m = .true. do i = 1, 10 if( m ) then if( res(i) /= 3 ) error stop else if( res(i) /= a(i) ) error stop end if m = .not. m end do print *, merge(1, 0, shorts == long) res = merge(1, 0, shorts == long) m = .false. do i = 1, 10 if( m ) then if( res(i) /= 1 ) error stop else if( res(i) /= 0 ) error stop end if m = .not. m end do print*, merge("ab", "ok", .true.) if (merge("ab", "ok", .true.) /= "ab") error stop end program lfortran-0.63.0/integration_tests/arrays_86.f900000664000175000017500000000061715174404631021527 0ustar alastairalastairprogram test_key_slice use iso_fortran_env, only: int8 integer(int8), dimension(10) :: full_key integer :: i call process_key(full_key(:)) contains subroutine process_key(key) integer(int8), intent(in) :: key(0:) integer :: i print *, lbound(key, 1) if( lbound(key, 1) /= 0 ) error stop end subroutine process_key end program test_key_slice lfortran-0.63.0/integration_tests/case_09.f900000664000175000017500000000135315174404631021132 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/8407 ! Select case with multiple range conditions in a single case ! Exact MRE from issue body program casetest implicit none integer :: i do i = 1,5 select case (i) case (2:3,5) print "(A,I0)",'case (2:3,5) i=',i case default print "(A,I0)",'case default i=',i end select end do if (.not. check()) error stop contains logical function check() integer :: j check = .true. do j = 1,5 select case (j) case (2:3,5) if (j /= 2 .and. j /= 3 .and. j /= 5) check = .false. case default if (j /= 1 .and. j /= 4) check = .false. end select end do end function check end program casetest lfortran-0.63.0/integration_tests/where_13.f900000664000175000017500000000100615174404631021317 0ustar alastairalastairmodule where_13_module implicit none private public :: is_pos contains pure elemental function is_pos(x) result(y) implicit none real, intent(in) :: x logical :: y y = (x > 0) end function is_pos end module where_13_module program where_13 use, non_intrinsic :: where_13_module real :: V(2) = [-1,2] logical :: W(2) where (is_pos(V)) V = 12.91 elsewhere V = -12.91 end where print *, V print *, sum(V) if ( abs(sum(V)) > 1e-8) error stop end program where_13 lfortran-0.63.0/integration_tests/select_type_10.f900000664000175000017500000000163715174404631022534 0ustar alastairalastairmodule select_type_10_mod implicit none type, abstract :: base end type base type, extends(base) :: int_val integer :: key end type int_val contains subroutine check(self) class(int_val), intent(inout) :: self self%key = 10 end subroutine check subroutine check2(self) type(int_val), intent(inout) :: self self%key = 20 end subroutine check2 end module select_type_10_mod program select_type_10 use select_type_10_mod implicit none class(base), pointer :: val, save_val type(int_val), target :: int_ptr int_ptr%key = 100 allocate(int_val :: val) save_val => val select type(val) type is(int_val) call check(val) if (val%key /= 10) error stop call check2(val) if (val%key /= 20) error stop val => int_ptr if (val%key /= 100) error stop class default error stop end select deallocate(save_val) end program select_type_10lfortran-0.63.0/integration_tests/submodule_49.f900000664000175000017500000000120015174404631022211 0ustar alastairalastairmodule submodule_49_mod implicit none interface module subroutine set_ptr() end subroutine end interface end module submodule(submodule_49_mod) submodule_49_sub use iso_c_binding, only: c_ptr, c_f_pointer, c_loc implicit none integer, pointer :: p(:) contains module procedure set_ptr integer, target, save :: s(4) type(c_ptr) :: cptr s = 42 cptr = c_loc(s(1)) call c_f_pointer(cptr, p, [4]) if (p(1) /= 42) error stop if (p(4) /= 42) error stop print *, p(1) end procedure end submodule program submodule_49_main use submodule_49_mod implicit none call set_ptr() end program lfortran-0.63.0/integration_tests/derived_types_35.f900000664000175000017500000000176315174404631023071 0ustar alastairalastairmodule derived_types_35_my_mod type :: my_type sequence integer :: a end type interface read(formatted) module procedure :: read_formatted end interface contains subroutine read_formatted(mt, unit, iotype, v_list, iostat, iomsg) type(my_type), intent(inout) :: mt integer, intent(in) :: unit character(len=*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg read(unit, *) mt%a end subroutine end module program derived_types_35 use derived_types_35_my_mod, only: my_type, read(formatted) implicit none type(my_type) :: x integer :: io, iostat character(len=20) :: iomsg x%a = 10 print *, x%a open(newunit=io, form="formatted", file="derived_types_35_file.txt") read(io, *, iostat=iostat, iomsg=iomsg) x close(io) print *, x%a if (x%a /= 125) error stop end program lfortran-0.63.0/integration_tests/arrays_39.f900000664000175000017500000000067315174404631021527 0ustar alastairalastairprogram arrays_39 implicit none real, allocatable :: array(:) integer :: ndim ndim = 10 allocate(array(-(ndim/2):ndim)) print *, lbound(array > 0, 1) call f(array > 0) contains subroutine f(array1) logical, intent(in) :: array1(:) print *, lbound(array1, 1), ubound(array1, 1) if( lbound(array1, 1) /= 1 ) error stop if( ubound(array1, 1) /= 16 ) error stop end subroutine end program arrays_39 lfortran-0.63.0/integration_tests/format_42.f900000664000175000017500000000141515174404631021503 0ustar alastairalastairprogram format_42 implicit none real :: val1, val2 character(len=50) :: str1, str2 val1 = 42.43 val2 = 123.456 ! Test PE format with exponent width (E_int suffix) write(str1, 100) val1 write(str2, 200) val2 write(*, 100) val1 write(*, 200) val2 ! Verify the format works correctly ! With 3P scale factor: 42.43 displays as 424.3000E-01 ! The format is E14.6E2, so it uses 14 characters total if (trim(adjustl(str1)) /= '424.3000E-01') error stop "PE14.6E2 format failed" ! With 2P scale factor: 123.456 displays as 12.3456E+01 ! The format is E12.5E2, so it uses 12 characters total if (trim(adjustl(str2)) /= '12.3456E+01') error stop "PE12.5E2 format failed" print *, "PASSED" 100 format (3PE14.6E2) 200 format (2PE12.5E2) end program lfortran-0.63.0/integration_tests/implied_do_loops20.f900000664000175000017500000000104315174404631023366 0ustar alastairalastairprogram implied_do_loops20 ! Test: reshape of array constructor with implied-do calling a function ! returning an allocatable array. implicit none integer :: k real :: a(2, 2) a = reshape([( f(k), k = 1, 4 )], [2, 2]) if (abs(a(1,1) - 1.0) > 1e-6) error stop if (abs(a(2,1) - 2.0) > 1e-6) error stop if (abs(a(1,2) - 3.0) > 1e-6) error stop if (abs(a(2,2) - 4.0) > 1e-6) error stop contains pure function f(j) result(v) integer, intent(in) :: j real, allocatable :: v(:) allocate(v(1)) v(1) = real(j) end function end program lfortran-0.63.0/integration_tests/openmp_61.f900000664000175000017500000000057615174404631021521 0ustar alastairalastairprogram openmp_61 use omp_lib implicit none integer :: array(1005), i,sum=0 !$omp teams num_teams(4) !$omp distribute do i = 1, 1000 array(i) = i * 2 end do !$omp end distribute !$omp end teams ! Sum of all elements !$omp parallel do reduction(+:sum) do i=1,1000 sum=sum+array(i) end do !$omp end parallel do print *,sum if(sum/=1001000) error stop end program openmp_61lfortran-0.63.0/integration_tests/bindc_05c.c0000664000175000017500000000051215174404631021255 0ustar alastairalastair#include #include void* ax(int comm_f) { int* p = (int*) malloc(sizeof(int)); if (p == NULL) { fprintf(stderr, "Memory allocation failed\n"); return NULL; } *p = comm_f; printf("C function received: %d, returning pointer: %p\n", comm_f, (void*) p); return (void*) p; }lfortran-0.63.0/integration_tests/intrinsics_452.f900000664000175000017500000000057315174404631022471 0ustar alastairalastairprogram intrinsics_452 implicit none character(len=1) :: w(3) character(len=len(w)) :: v(3) integer :: idx w(1) = "a" w(2) = "b" w(3) = "c" v = w idx = findloc(v(:3), w(2), dim=1) print *, idx if (idx /= 2) error stop idx = findloc(v(:3), w(1), dim=1) print *, idx if (idx /= 1) error stop idx = findloc(v(:3), "x", dim=1) print *, idx if (idx /= 0) error stop end program lfortran-0.63.0/integration_tests/array_constructor_04.f900000664000175000017500000000036715174404631024001 0ustar alastairalastairprogram array_constructor_04 implicit none integer :: n integer, allocatable :: a(:) ! Empty array constructor with type spec n = size([integer ::]) if (n /= 0) error stop a = [integer ::] if (size(a) /= 0) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/namelist_14.f900000664000175000017500000000411215174404631022023 0ustar alastairalastairprogram test_char_arrays implicit none character(len=20) :: names(5) character(len=10) :: codes(3) integer :: i namelist /strings/ names, codes ! Initialize names(1) = 'Alice' names(2) = 'Bob' names(3) = 'Charlie' names(4) = 'Diana' names(5) = 'Eve' codes(1) = 'ABC' codes(2) = 'DEF' codes(3) = 'GHI' ! Write open(10, file='strings.dat', status='replace', form='formatted') write(10, nml=strings) close(10) ! Reset names = '' codes = '' ! Read open(10, file='strings.dat', status='old', form='formatted') read(10, nml=strings) close(10) ! Verify if (trim(names(1)) /= 'Alice') then print *, "Error: names(1) =", trim(names(1)), "expected Alice" error stop "Test failed for names(1)" end if if (trim(names(3)) /= 'Charlie') then print *, "Error: names(3) =", trim(names(3)), "expected Charlie" error stop "Test failed for names(3)" end if if (trim(codes(2)) /= 'DEF') then print *, "Error: codes(2) =", trim(codes(2)), "expected DEF" error stop "Test failed for codes(2)" end if ! Verify all names if (trim(names(2)) /= 'Bob') then print *, "Error: names(2) =", trim(names(2)), "expected Bob" error stop "Test failed for names(2)" end if if (trim(names(4)) /= 'Diana') then print *, "Error: names(4) =", trim(names(4)), "expected Diana" error stop "Test failed for names(4)" end if if (trim(names(5)) /= 'Eve') then print *, "Error: names(5) =", trim(names(5)), "expected Eve" error stop "Test failed for names(5)" end if ! Verify all codes if (trim(codes(1)) /= 'ABC') then print *, "Error: codes(1) =", trim(codes(1)), "expected ABC" error stop "Test failed for codes(1)" end if if (trim(codes(3)) /= 'GHI') then print *, "Error: codes(3) =", trim(codes(3)), "expected GHI" error stop "Test failed for codes(3)" end if print *, "Character array namelist test passed!" end program test_char_arrays lfortran-0.63.0/integration_tests/parameter_04.f900000664000175000017500000000064415174404631022174 0ustar alastairalastairprogram parameter_04 implicit none integer, parameter :: l_knd = kind(.true.) integer, parameter :: sp = selected_real_kind(6) integer, parameter :: dp = selected_real_kind(14) integer, parameter :: i32 = selected_int_kind(6) integer, parameter :: i64 = selected_int_kind(12) logical(l_knd) :: l real(sp) :: r1 real(dp) :: r2 integer(i32) :: i1 integer(i64) :: i2 l = .true. print *, l_knd, sp, dp, i32, i64 end program lfortran-0.63.0/integration_tests/gpu_metal_73.f900000664000175000017500000000126115174404631022173 0ustar alastairalastairprogram gpu_metal_73 ! Test: all() with array slice inside do concurrent inside associate block ! compiled with --gpu=metal. Previously caused ASR verify failure because ! inline_intrinsic_all placed temporaries in AssociateBlock scope. implicit none integer :: l logical :: a(3), res(3) a = .true. a(2) = .false. associate(n => 3) do concurrent(l = 1:n) res(l) = all(a(1:l)) end do end associate ! a(1:1) = [.true.] -> all = .true. ! a(1:2) = [.true.,.false.] -> all = .false. ! a(1:3) = [.true.,.false.,.true.] -> all = .false. if (res(1) .neqv. .true.) error stop if (res(2) .neqv. .false.) error stop if (res(3) .neqv. .false.) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/int_dp.f900000664000175000017500000000016015174404631021157 0ustar alastairalastairprogram int_dp integer(4) :: u = 2147483647 integer(8) :: v = 2147483647 print *, u, v end programlfortran-0.63.0/integration_tests/pdt_07.f900000664000175000017500000000075415174404631021010 0ustar alastairalastairmodule pdt_07_m implicit none integer, parameter :: wp = 4 end module module pdt_07_n use pdt_07_m, only : wp implicit none type t(k) integer, kind :: k = wp integer(kind=k) :: val end type interface module subroutine foo(x) type(t), intent(out) :: x end subroutine end interface end module program pdt_07 use pdt_07_n implicit none type(t) :: x x%val = 42 if (x%k /= 4) error stop if (x%val /= 42) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/nested_22.f900000664000175000017500000000116615174404631021476 0ustar alastairalastairmodule nested_22_mod type :: tmp_type integer :: a end type tmp_type contains subroutine tmp_sub() type(tmp_type), allocatable :: x(:) allocate(x(1)) call inner_sub() print *, x(2)%a if (size(x) /= 2) error stop if (x(2)%a /= 42) error stop contains subroutine inner_sub() type(tmp_type) :: tmp_var x = [x, tmp_var] x(2)%a = 42 end subroutine inner_sub end subroutine tmp_sub end module nested_22_mod program nested_22 use nested_22_mod implicit none call tmp_sub() end program nested_22 lfortran-0.63.0/integration_tests/array_init.f900000664000175000017500000000071715174404631022053 0ustar alastairalastairMODULE array_init_module TYPE tp INTEGER(4) i END TYPE tp END MODULE array_init_module PROGRAM t USE array_init_module TYPE (tp) v1,v2,v3 v1%i = 1 v2%i = 2 v3%i = 3 CALL s([tp :: v1,v2,v3], 3) CALL s([tp ::], 0) CONTAINS SUBROUTINE s(va, sz) USE array_init_module TYPE(tp) va(:) INTEGER sz print *, size(va) if (size(va) /= sz) error stop END SUBROUTINE s END PROGRAM tlfortran-0.63.0/integration_tests/read_40.f900000664000175000017500000000052515174404631021125 0ustar alastairalastairprogram read_40 implicit none real :: x integer :: io character(3) :: data = 'bad' do read(data, *, iostat=io) x if (io /= 0) exit print *, 'Loop should have exited!' exit end do if (io == 0) error stop "Test failed: iostat should be non-zero for bad input" print *, 'Program ending.' end program read_40 lfortran-0.63.0/integration_tests/precision_03.f900000664000175000017500000000014515174404631022202 0ustar alastairalastairprogram precision_03 print *, 3.0*3.1 if (abs((3.0*3.1) - 9.29999924) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/intrinsics_360.f900000664000175000017500000000104215174404631022457 0ustar alastairalastairprogram intrinsics_360 implicit none real(8), dimension(2) :: dc_r = [1.3, 2.3] real :: x_r = 1.3 integer, dimension(2) :: dc_i = [1, 2] integer(8) :: x_i = 2 print *, findloc(dc_r, x_r) if (any(findloc(dc_r, x_r) /= 1)) error stop print *, findloc(dc_i, x_i) if (any(findloc(dc_i, x_i) /= 2)) error stop print *, findloc(dc_r, x_i) if (any(findloc(dc_r, x_i) /= 0)) error stop print *, findloc(dc_i, x_r) if (any(findloc(dc_i, x_r) /= 1)) error stop end program intrinsics_360 lfortran-0.63.0/integration_tests/derived_types_104.f900000664000175000017500000000275215174404631023145 0ustar alastairalastairmodule derived_types_104_my_type implicit none type :: my_type real, allocatable :: a(:) contains procedure, private :: write_formatted generic, public :: write(formatted) => write_formatted end type my_type contains subroutine write_formatted(self, unit, iotype, v_list, iostat, iomsg) class(my_type), intent(in) :: self integer, intent(in) :: unit character(*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(*), intent(inout) :: iomsg iostat = 0 iomsg = "" write(unit, '(a)') "OK" end subroutine write_formatted end module derived_types_104_my_type module derived_types_104_client use derived_types_104_my_type implicit none type :: client_type contains procedure, nopass :: output end type client_type contains subroutine output(obj) type(my_type), intent(in) :: obj write(10, '(dt)') obj end subroutine output end module derived_types_104_client program derived_types_104 use derived_types_104_client implicit none type(client_type) :: t type(my_type) :: m character(len=10) :: tmp open(10, file="derived_types_104_file.txt", form="formatted") call t%output(m) close(10) open(10, file="derived_types_104_file.txt", form="formatted") read(10, '(a)') tmp close(10) if (trim(tmp) /= "OK") error stop end program derived_types_104 lfortran-0.63.0/integration_tests/submodule_27c.f900000664000175000017500000000024115174404631022354 0ustar alastairalastairsubmodule(submodule_27_m) submodule_27_s implicit none contains module procedure make_vec v%val = fn(3.0d0) end procedure end submodule submodule_27_s lfortran-0.63.0/integration_tests/write_20.f900000664000175000017500000000042415174404631021340 0ustar alastairalastairprogram write_20 implicit none character :: c(6)*3 character(80) :: line data c/'ab','cd','ef','gh','ij','kl'/ write(line, "(*(A))") 'c = "', c, '"' if (trim(line) /= 'c = "ab cd ef gh ij kl "') error stop write(*, "(*(A))") 'c = "', c, '"' end program write_20 lfortran-0.63.0/integration_tests/intrinsics_424.f900000664000175000017500000000102115174404631022455 0ustar alastairalastairprogram intrinsics_424 ! Test co_sum intrinsic subroutine (no-op in single-image mode) implicit none integer :: a(3), b real :: c(2) a = [1, 2, 3] call co_sum(a) if (a(1) /= 1) error stop if (a(2) /= 2) error stop if (a(3) /= 3) error stop b = 42 call co_sum(b) if (b /= 42) error stop c = [1.5, 2.5] call co_sum(c) if (abs(c(1) - 1.5) > 1e-6) error stop if (abs(c(2) - 2.5) > 1e-6) error stop print *, "co_sum: all tests passed" end program intrinsics_424 lfortran-0.63.0/integration_tests/file_03.f900000664000175000017500000000147015174404631021130 0ustar alastairalastairprogram file_03 implicit none integer :: no_of_students, roll_no, age, fd, i character(len = 20) :: first_name, last_name real :: weight ! for asserting/verification integer :: total_age = 0 real :: total_weight = 0.0 fd = 10 open(fd, file="file_03_data.txt") read(fd, *) no_of_students print *, "Total no of students is:", no_of_students do i = 1, no_of_students read(fd, *) roll_no, first_name, last_name, age, weight print *, roll_no, first_name, last_name, age, weight total_age = total_age + age total_weight = total_weight + weight end do print *, "total_age:", total_age print *, "total_weight:", total_weight if (total_age /= 150) error stop if (abs(total_weight - 519.600037) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/format_21.f900000664000175000017500000000061715174404631021503 0ustar alastairalastairprogram format_21 !> add tests to ensure that colon edit descriptor is supported print "(I2, :, A)", 42 print "(I2, :, A)", 42, " is the answer" print "(I3, :, I10)", 42, 43 print "(A, I2, :, A)", "The touch is ", 42, " degrees" print "(A, I2, :, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A)", "The touch is ", 42 end program format_21 lfortran-0.63.0/integration_tests/test_ieee_inf_nan_01.f900000664000175000017500000000265315174404631023651 0ustar alastairalastairprogram test_ieee_inf_nan_01 use, intrinsic :: ieee_arithmetic implicit none integer, parameter :: dp = kind(1d0) real(dp) :: xdp(4) xdp = [ ieee_value(1d0, ieee_positive_inf), & ieee_value(1d0, ieee_negative_inf), & ieee_value(1d0, ieee_quiet_nan), & ieee_value(1d0, ieee_signaling_nan) ] if (.not. all(isinfdp(xdp) .eqv. [.true., .true., .false., .false.])) error stop if (.not. all(isposinfdp(xdp) .eqv. [.true., .false., .false., .false.])) error stop if (.not. all(isneginfdp(xdp) .eqv. [.false., .true., .false., .false.])) error stop if (.not. all(isnandp(xdp) .eqv. [.false., .false., .true., .true. ])) error stop if (.not. all(isfinitedp(xdp) .eqv. [.false., .false., .false., .false.])) error stop contains elemental logical function isnandp(x) real(dp), intent(in) :: x isnandp = (x /= x) end function isnandp elemental logical function isinfdp(x) real(dp), intent(in) :: x isinfdp = (abs(x) > huge(x)) end function isinfdp elemental logical function isposinfdp(x) real(dp), intent(in) :: x isposinfdp = (x > huge(x)) end function isposinfdp elemental logical function isneginfdp(x) real(dp), intent(in) :: x isneginfdp = (x < -huge(x)) end function isneginfdp elemental logical function isfinitedp(x) real(dp), intent(in) :: x isfinitedp = (abs(x) <= huge(x)) end function isfinitedp end program test_ieee_inf_nan_01 lfortran-0.63.0/integration_tests/submodule_05.f900000664000175000017500000000126315174404631022212 0ustar alastairalastairmodule mod_submodule_05 implicit none interface module subroutine map_open_entry(key) integer, intent(inout) :: key end subroutine map_open_entry end interface end module mod_submodule_05 submodule(mod_submodule_05) submod_submodule_05 implicit none contains module subroutine map_open_entry(key) integer, intent(inout) :: key integer, parameter :: i = 1 key = i end subroutine map_open_entry end submodule submod_submodule_05 program submodule_05 use mod_submodule_05 implicit none integer :: key = 5 call map_open_entry( key ) print *, key if (key /= 1) error stop end programlfortran-0.63.0/integration_tests/matmul_03.f900000664000175000017500000000051515174404631021507 0ustar alastairalastairprogram matmul_03 implicit none real, allocatable :: A(:,:), B(:,:), C(:,:) real :: expected allocate(A(3, 4), B(4, 2), C(3, 2)) A = 1.0 B = 1.0 C = matmul(A, B) expected = 4.0 if (abs(C(1,1) - expected) > 1e-6) error stop if (abs(C(3,2) - expected) > 1e-6) error stop print *, "OK: matmul with pre-allocated result" end program lfortran-0.63.0/integration_tests/statement_03.f900000664000175000017500000000020315174404631022206 0ustar alastairalastairsubroutine cumchn() intrinsic dble dg(i) = 2.0D0*dble(i) end subroutine program statement_03 call cumchn() end program lfortran-0.63.0/integration_tests/arrays_op_5.f900000664000175000017500000000222315174404631022127 0ustar alastairalastairprogram array_op_5 implicit none integer :: a(2, 2, 1), b(2, 2, 1) complex :: c(2, 2, 1) integer :: i, j, k do i = 1, 2 do j = 1, 2 do k = 1, 1 a(i, j, k) = i + j + k b(i, j, k) = i*j*k end do end do end do c = a + (0.0, 1.0)*b call check(c, 0) c = -a + (0.0, 1.0)*(-b) call check(c, 1) contains subroutine check(c, op_code) implicit none complex, intent(in) :: c(:, :, :) integer, intent(in) :: op_code integer :: i, j, k real :: left, right do i = lbound(c, 1), ubound(c, 1) do j = lbound(c, 2), ubound(c, 2) do k = lbound(c, 3), ubound(c, 3) select case(op_code) case (0) left = i + j + k right = i*j*k if(c(i, j, k) /= left + right*(0.0, 1.0)) error stop case (1) left = i + j + k right = i*j*k if(c(i, j, k) /= -left - right*(0.0, 1.0)) error stop end select end do end do end do end subroutine check end program lfortran-0.63.0/integration_tests/string_11.f900000664000175000017500000000057115174404631021517 0ustar alastairalastairprogram string_11 implicit none character(len=30) :: myString character(len=10) :: testString myString = 'This is a test' testString = 'test' if(index(myString, testString) == 0)then print *, 'test is not found' else print *, 'test is found at index: ', index(myString, testString) end if end programlfortran-0.63.0/integration_tests/implied_do_loops9.f900000664000175000017500000000114015174404631023313 0ustar alastairalastairprogram implied_do_loops9 integer, parameter :: n = 3 complex :: b(n,n) complex, parameter :: i_ = cmplx(0,1) integer :: i,j b = reshape([((merge(i + 1*i_,0*i_,i==j), i=1,n), j=1,n)], [n,n]) print * , b if (b(1,1) /= cmplx(1,1)) error stop if (b(1,2) /= cmplx(0,0)) error stop if (b(1,3) /= cmplx(0,0)) error stop if (b(2,1) /= cmplx(0,0)) error stop if (b(2,2) /= cmplx(2,1)) error stop if (b(2,3) /= cmplx(0,0)) error stop if (b(3,1) /= cmplx(0,0)) error stop if (b(3,2) /= cmplx(0,0)) error stop if (b(3,3) /= cmplx(3,1)) error stop end program lfortran-0.63.0/integration_tests/separate_compilation_37.f900000664000175000017500000000021015174404631024411 0ustar alastairalastairprogram separate_compilation_37 use separate_compilation_37b implicit none print *, "PASS" end program separate_compilation_37 lfortran-0.63.0/integration_tests/fma_03.f900000664000175000017500000000041615174404631020753 0ustar alastairalastairprogram fma_03 implicit none integer ::b(10) integer ::bb(10) real :: r bb = 0 bb(2) = 100 b = 1 r = 2 b(1) = bb(int(r*r - r,4)) ! Test fma in nested expression print *, b(1) if(b(1) /= 100) error stop end program fma_03lfortran-0.63.0/integration_tests/file_27.f900000664000175000017500000000400415174404631021132 0ustar alastairalastairprogram file_27 implicit none integer :: unit_num, unit_num2, unit_num3, unit_num4, unit_num5 integer :: stat character(len=200) :: iomsg logical :: is_lfortran = .true. character(len=:), allocatable :: iomsg2 #ifdef __GFORTRAN__ is_lfortran = .false. #endif open(newunit=unit_num, file='data2.txt', status='old', iostat=stat, iomsg=iomsg) write(unit_num, *) "HI" if (stat /= 2) error stop if (is_lfortran) then if (trim(iomsg) /= "File `data2.txt` does not exists! Cannot open a file with the `status=old`") error stop end if close(unit_num) ! TODO: Support same file opening twice (Issue #6904) ! open(newunit=unit_num2, file='data2.txt', status='new', iostat=stat, iomsg=iomsg) ! if (stat /= 0) error stop ! open(newunit=unit_num2, file='data2.txt', status='new', iostat=stat, iomsg=iomsg) ! if (stat /= 17) error stop ! if (is_lfortran) then ! if (trim(iomsg) /= "File `data2.txt` exists! Cannot open a file with the `status=new`") error stop ! end if ! close(unit_num2, status="delete") open(newunit=unit_num3, file='data3.txt', status='temp', iostat=stat, iomsg=iomsg) write(unit_num3, *) "HI" if (stat /= 5002) error stop if (is_lfortran) then if (trim(iomsg) /= "STATUS specifier in OPEN statement has invalid value.") error stop end if close(unit_num3) open(newunit=unit_num4, file='data4.txt', status='new', form="temp", iostat=stat, iomsg=iomsg) if (stat /= 5002) error stop if (is_lfortran) then if (trim(iomsg) /= "FORM specifier in OPEN statement has invalid value.") error stop end if close(unit_num4) open(newunit=unit_num5, file='data5.txt', status='new', access="temp", iostat=stat, iomsg=iomsg) if (stat /= 5002) error stop if (is_lfortran) then if (trim(iomsg) /= "ACCESS specifier in OPEN statement has invalid value.") error stop end if close(unit_num5) print *, len(iomsg) if (len(iomsg) /= 200) error stop end programlfortran-0.63.0/integration_tests/common_04.f900000664000175000017500000000063315174404631021502 0ustar alastairalastairprogram main integer :: a, b, c(5), d common / block_1 / a, b, c a = 2 b = 1 d = b c = 4 c(1) = 2 b = c(3) if (a /= 2) error stop if (b /= 4) error stop if (c(1) /= 2) error stop if (c(2) /= 4) error stop if (c(3) /= 4) error stop if (c(4) /= 4) error stop if (c(5) /= 4) error stop if (d /= 1) error stop print *, a, b, c, c(5), d end programlfortran-0.63.0/integration_tests/entry_09.f900000664000175000017500000000101715174404631021355 0ustar alastairalastairSUBROUTINE dinvr(x) IMPLICIT NONE DOUBLE PRECISION x DOUBLE PRECISION, SAVE :: big,small DOUBLE PRECISION zsmall, zbig print *, "small: ", small print *, "big: ", big if (abs(small - (-1.6d0)) > 1d-10) error stop if (abs(big - 10.9d0) > 1d-10) error stop entry distinv(zsmall, zbig) small = -1.6d0 big = 10.9d0 return end subroutine program entry_09 implicit none double precision :: x x = 0.5d0 call distinv(-1.6d0, 10.9d0) call dinvr(x) end program lfortran-0.63.0/integration_tests/arrays_121.f900000664000175000017500000000035315174404631021572 0ustar alastairalastairprogram arrays_121 implicit none integer :: x = 1 call sub(x) if (x /= 1) error stop print *, x contains subroutine sub(inp) integer, dimension(..) :: inp end subroutine end program arrays_121 lfortran-0.63.0/integration_tests/array_02_pack.f900000664000175000017500000000025415174404631022323 0ustar alastairalastairprogram array_02_pack integer :: m(4), p(4) m = [ 1, 0, 0, 2 ] p = pack(m, m /= 0, [ 0, 0, 3, 4 ]) print *, p if( any(p /= [1, 2, 3, 4]) ) error stop end program lfortran-0.63.0/integration_tests/logical_casting_01.f900000664000175000017500000000033515174404631023330 0ustar alastairalastairprogram logical_casting_01 implicit none logical :: x(3) = [1, 1, 0] print *, x if (x(1) .neqv. .true.) error stop if (x(2) .neqv. .true.) error stop if (x(3) .neqv. .false.) error stop end programlfortran-0.63.0/integration_tests/types_22.f900000664000175000017500000000055615174404631021362 0ustar alastairalastairprogram types_22 real(8) :: A(3) = [1, 2, 3] integer(8) :: B(3) = [1.0, 2.0, 3.0] print*, A print*, B if ( abs(A(1) - 1.00) > 10e-5 ) error stop if ( abs(A(2) - 2.00) > 10e-5 ) error stop if ( abs(A(3) - 3.00) > 10e-5 ) error stop if ( B(1) /= 1 ) error stop if ( B(2) /= 2 ) error stop if ( B(3) /= 3 ) error stop endlfortran-0.63.0/integration_tests/character_max_parameter_01.f900000664000175000017500000000246015174404631025050 0ustar alastairalastairprogram character_max_parameter_01 implicit none character(len=6), parameter :: c1(3) = max( & ["str1 ", "str2 ", "char "], & ["!str#$", "xtring", "charac"]) character(len=4), parameter :: c2(3) = max( & ["str1", "str2", "char"], & ["!str", "xtri", "abcd"]) character(len=3), parameter :: c3(2) = min( & ["zzz", "aaa"], ["mmm", "bbb"]) character(len=5), parameter :: c4(3) = max( & ["hello", "world", "abcde"], & ["apple", "zebra", "abcdf"]) character(len=3), parameter :: c5(4) = & ["hel", "wor", "tes", "abc"] character(len=8), parameter :: c6(2) = & ["hi ", "go "] if (c1(1) /= "str1 ") error stop if (c1(2) /= "xtring") error stop if (c1(3) /= "charac") error stop if (c2(1) /= "str1") error stop if (c2(2) /= "xtri") error stop if (c2(3) /= "char") error stop if (c3(1) /= "mmm") error stop if (c3(2) /= "aaa") error stop if (c4(1) /= "hello") error stop if (c4(2) /= "zebra") error stop if (c4(3) /= "abcdf") error stop if (c5(1) /= "hel") error stop if (c5(2) /= "wor") error stop if (c5(3) /= "tes") error stop if (c5(4) /= "abc") error stop if (c6(1) /= "hi ") error stop if (c6(2) /= "go ") error stop end program lfortran-0.63.0/integration_tests/custom_operator_11.f900000664000175000017500000000271215174404631023435 0ustar alastairalastairmodule custom_operator_11_mod1 interface operator(.in.) module procedure string_contains ! string in an integer array ?? end interface operator(.in.) contains logical function string_contains(search_string,array) character(*), intent(in) :: search_string integer,intent(in) :: array(:) character(len=10) :: string_buffer integer :: i string_contains = .false. do i = 1, size(array) write(string_buffer, '(i0)') array(i) string_contains = string_contains .or. (trim(string_buffer) == search_string) end do end function string_contains end module custom_operator_11_mod1 module custom_operator_11_mod2 use custom_operator_11_mod1, only: operator(.in.) implicit none interface operator(.in.) procedure target_in end interface operator(.in.) contains subroutine temp() integer, allocatable :: arr(:) character(len=:), allocatable :: str arr = [42,666] str = '42' if (.not. (str .in. arr)) error stop end subroutine temp function target_in(needle, arr) result(x) integer, intent(in) :: needle integer, intent(in) :: arr(:) logical :: x x = any(needle==arr) end function target_in end module custom_operator_11_mod2 program custom_operator_11 use custom_operator_11_mod2, only: operator(.in.),temp if (.not. (42 .in. [42,666])) error stop if ('22' .in. [42,666]) error stop if (0 .in. [42,666]) error stop call temp() end program custom_operator_11lfortran-0.63.0/integration_tests/optional_06.f900000664000175000017500000000125615174404631022043 0ustar alastairalastairmodule optional_06_mod interface get_val module procedure :: get_val_float module procedure :: get_val_int end interface contains subroutine get_val_float(val, stat) real, intent(in) :: val integer, intent(out), optional :: stat end subroutine subroutine get_val_int(val, default, stat) integer, intent(in) :: val integer, intent(in), optional :: default integer, intent(out), optional :: stat print *, present(default), present(stat) if (present(stat)) stat = 10 end subroutine end module program optional_06 use optional_06_mod integer :: stat = 0 call get_val(3, stat=stat) if (stat /= 10) error stop end program optional_06lfortran-0.63.0/integration_tests/derived_types_20.f900000664000175000017500000000033515174404631023055 0ustar alastairalastairprogram main use fpm_command_line_20, only: fpm_cmd_settings, get_command_line_settings implicit none class(fpm_cmd_settings), allocatable :: cmd_settings call get_command_line_settings(cmd_settings) end program main lfortran-0.63.0/integration_tests/class_72.f900000664000175000017500000000133015174404631021317 0ustar alastairalastairmodule class_72_mod implicit none private public :: version_t type :: version_t integer :: major contains procedure :: greater generic, public :: operator(>) => greater end type version_t contains elemental function greater(lhs, rhs) result(is_greater) class(version_t), intent(in) :: lhs, rhs logical :: is_greater is_greater = lhs%major > rhs%major end function greater end module class_72_mod program class_72 use class_72_mod implicit none type(version_t), allocatable :: v1(:) type(version_t) :: v2 allocate(v1(2)) v1(1) = version_t(5) v2 = version_t(6) if (v1(1) > v2) error stop end program class_72 lfortran-0.63.0/integration_tests/class_132.f900000664000175000017500000000240115174404631021374 0ustar alastairalastair! Test whole-array struct member access on polymorphic arrays in select type blocks. ! Verifies that val%x returns an array (not scalar) when val is a class(*) array ! associated via select type. module class_132_mod implicit none type :: point real :: x, y end type type :: container class(*), allocatable :: value(:) contains procedure :: set_value end type contains subroutine set_value(this, value) class(container), intent(out) :: this class(*), intent(in) :: value(:) this%value = value end subroutine end module program class_132 use class_132_mod implicit none type(container) :: c type(point) :: pts(2) pts(1) = point(1.0, 2.0) pts(2) = point(3.0, 4.0) call c%set_value(pts) select type (v => c%value) type is (point) ! Element access if (abs(v(1)%x - 1.0) > 1e-6) error stop if (abs(v(2)%x - 3.0) > 1e-6) error stop if (abs(v(1)%y - 2.0) > 1e-6) error stop if (abs(v(2)%y - 4.0) > 1e-6) error stop ! Whole-array member access if (any(v%x /= [1.0, 3.0])) error stop if (any(v%y /= [2.0, 4.0])) error stop class default error stop end select print *, "PASS" end program lfortran-0.63.0/integration_tests/custom_operator_05.f900000664000175000017500000000215115174404631023435 0ustar alastairalastairmodule custom_operator_05_a implicit none public :: string_t type string_t character(len=:), allocatable :: string_ contains generic :: operator(//) => string_t_cat_string_t procedure, private :: string_t_cat_string_t end type contains elemental module function from_characters(string) result(new_string) implicit none character(len=*), intent(in) :: string type(string_t) new_string new_string%string_ = string end function pure module function string_t_cat_string_t(lhs, rhs) result(lhs_cat_rhs) implicit none class(string_t), intent(in) :: lhs, rhs type(string_t) lhs_cat_rhs lhs_cat_rhs = string_t(lhs%string_ // rhs%string_) end function end module custom_operator_05_a module custom_operator_05_b use custom_operator_05_a implicit none contains subroutine test_concat type(string_t) :: str str = from_characters("a") // from_characters("b") end subroutine test_concat end module custom_operator_05_b program custom_operator_05 use custom_operator_05_b implicit none call test_concat() end program custom_operator_05 lfortran-0.63.0/integration_tests/derived_types_115.f900000664000175000017500000000113015174404631023134 0ustar alastairalastair! Test: intrinsic assignment of a derived type should not use defined ! assignment for components when the RHS type does not match. ! (inner_t has assignment(=) from logical, not from inner_t) program derived_types_115 use derived_types_115_module implicit none type(outer_t) :: a, b a%component%test_passed = .true. a%val = 42 ! Intrinsic assignment of outer_t: component should be copied ! via default (bitwise) copy, not via assign_logical b = a if (.not. b%component%test_passed) error stop if (b%val /= 42) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/gpu_metal_106.f900000664000175000017500000000067515174404631022260 0ustar alastairalastairprogram gpu_metal_106 ! matmul with array section arguments inside do concurrent implicit none real :: w(2,2), a(2), c(2) integer :: i w(1,1) = 1.0; w(2,1) = 2.0 w(1,2) = 3.0; w(2,2) = 4.0 a = [0.5, 1.5] do concurrent (i = 1:1) c = matmul(w(1:2,1:2), a) end do ! c(1) = 1.0*0.5 + 3.0*1.5 = 5.0 ! c(2) = 2.0*0.5 + 4.0*1.5 = 7.0 if (abs(c(1) - 5.0) > 1.0e-5) error stop if (abs(c(2) - 7.0) > 1.0e-5) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/derived_types_69.f900000664000175000017500000000115415174404631023072 0ustar alastairalastairmodule derived_types_69_m type, abstract :: AbsType end type AbsType integer, parameter :: a(2) = [5, 6] integer, parameter :: one = 1 type, extends(AbsType) :: MyType integer :: m1(2) = [one, one] integer :: m2(2) = a integer :: m3(2) = [integer :: 2, 3] end type MyType end module derived_types_69_m program derived_types_69 use derived_types_69_m class(MyType), allocatable :: obj obj = MyType() if (any(obj%m1 /= [1, 1])) error stop if (any(obj%m2 /= [5, 6])) error stop if (any(obj%m3 /= [2, 3])) error stop end program derived_types_69 lfortran-0.63.0/integration_tests/separate_compilation_18b.f900000664000175000017500000000031515174404631024560 0ustar alastairalastairsubmodule (mod_separate_compilation_18) submod_separate_compilation_18 contains module function f(a) result(r) integer, intent(in) :: a integer :: r r = a + 1 end function end submodulelfortran-0.63.0/integration_tests/derived_types_53.f900000664000175000017500000000212315174404631023060 0ustar alastairalastairmodule derived_types_53_m implicit none public :: & bitset_type, & bitset_64 type, abstract :: bitset_type integer(4) :: num_bits end type bitset_type type, extends(bitset_type) :: bitset_64 end type bitset_64 type, extends(bitset_64) :: bitset_128 contains procedure, pass(self) :: write_bitset_string => write_bitset_string_128 end type bitset_128 contains elemental function bits(self) integer(4) :: bits class(bitset_type), intent(in) :: self bits = self%num_bits return end function bits module subroutine write_bitset_string_128(self) class(bitset_128), intent(in) :: self integer(4) :: bit_count bit_count = bits(self) if (bit_count /= 4) error stop end subroutine write_bitset_string_128 end module derived_types_53_m program derived_types_53 use derived_types_53_m implicit none type(bitset_128) :: t t = bitset_128(num_bits=4) call t%write_bitset_string() end program derived_types_53 lfortran-0.63.0/integration_tests/intrinsics_197.f900000664000175000017500000001211515174404631022472 0ustar alastairalastairprogram intrinsics_197 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(dp) :: x(40) real(dp) :: expected(40) integer :: i real :: y(28) real :: expected_y(28) real(dp), parameter :: res(40) = bessel_y0([9.98600559790084e307_dp,9.98800479820072e307_dp,9.9900039985006e307_dp, & 9.99200319880048e307_dp, 1036.462826483388272_dp, 1.7197292882018389_dp, 10.2368267382872828_dp, 0.17197292882018389_dp, & 152.67283628_dp, 632.92729728_dp, 1.2728272919_dp, 1.265228272919_dp, & 3.229995504589554d-153, 1.9201212555874555d-153, 6.809537363878625d-155, 5.690181373063991d-154, & 29.82407037185126_dp, 35.2459016393_dp, 46.2634946_dp, 24.7740903638_dp, & 15.8978408636372_dp, 8.801468212714914_dp, 8.798080767692923_dp, 8.791287884846061575_dp, & 0.6635324560331525_dp, 0.6633115808685429_dp, 0.6630906573122884_dp, 0.6628696853957159_dp, & 0.5042349934053336_dp, 0.5041796815747646_dp, 0.5041242821300232_dp, 0.50401322049655_dp, & 1.3994502099160337d-303, 1.199530179928029d-303, 9.99610149940024d-304, 5.9977008996401444d-304, & 499.19032387045183_dp, 499.2802878848461_dp, 499.3702518992403_dp, 499.5501799280288_dp]) x = [9.98600559790084e307_dp,9.98800479820072e307_dp,9.9900039985006e307_dp,9.99200319880048e307_dp, & 1036.462826483388272_dp, 1.7197292882018389_dp, 10.2368267382872828_dp, 0.17197292882018389_dp, & 152.67283628_dp, 632.92729728_dp, 1.2728272919_dp, 1.265228272919_dp, & 3.229995504589554d-153, 1.9201212555874555d-153, 6.809537363878625d-155, 5.690181373063991d-154, & 29.82407037185126_dp, 35.2459016393_dp, 46.2634946_dp, 24.7740903638_dp, & 15.8978408636372_dp, 8.801468212714914_dp, 8.798080767692923_dp, 8.791287884846061575_dp, & 0.6635324560331525_dp, 0.6633115808685429_dp, 0.6630906573122884_dp, 0.6628696853957159_dp, & 0.5042349934053336_dp, 0.5041796815747646_dp, 0.5041242821300232_dp, 0.50401322049655_dp, & 1.3994502099160337d-303, 1.199530179928029d-303, 9.99610149940024d-304, 5.9977008996401444d-304, & 499.19032387045183_dp, 499.2802878848461_dp, 499.3702518992403_dp, 499.5501799280288_dp] expected = [ 7.9836428649154907E-155_dp,-7.0751499885966513E-155_dp, 4.4632457212022053E-155_dp, -7.7717941781117305E-156_dp, & -2.1476418943648812E-002_dp, 0.45752410314844527_dp, -3.6134118144921369E-003_dp, -1.1810118244863275_dp, & 5.7258225070763252E-002_dp, -1.9980991452871046E-002_dp, 0.27136794388300378_dp, 0.26703177612919299_dp, & -223.60567312692987_dp, -223.93677423698244_dp, -226.06259684300088_dp, -224.71105113517498_dp, & -0.10066167676587488_dp, 1.3491498398094682E-002_dp, 0.11694884231468369_dp, -0.14624416810911833_dp, & 0.11351877059712150_dp, 0.26579485639687389_dp, 0.26597878435358130_dp, 0.26633862894209037_dp, & -0.23184540282244587_dp, -0.23210076724614023_dp, -0.23235626136445603_dp, -0.23261188523008530_dp, & -0.43830934413197298_dp, -0.43839015710774321_dp, -0.43847110563441455_dp, -0.43863340934604428_dp, & -444.01882239162842_dp, -444.11695700415237_dp, -444.23302545068867_dp, -444.55822289723721_dp, & 3.1963700362099140E-002_dp, 3.0400895527807309E-002_dp, 2.8592509948203688E-002_dp, 2.4299538193472119E-002_dp ] do i = 1, size(x) print *, bessel_y0(x(i)), "i = ", i if (abs(bessel_y0(x(i)) - expected(i)) > 1e-12) error stop end do do i = 1, size(res) print *, res(i) if (abs(res(i) - expected(i)) > 1e-12_dp) error stop end do y = [1036.462826483388272_sp, 1.7197292882018389_sp, 10.2368267382872828_sp, 0.17197292882018389_sp, & 152.67283628_sp, 632.92729728_sp, 1.2728272919_sp, 1.2828272919_sp, & 29.82407037185126_sp, 35.2459016393_sp, 46.2634946_sp, 24.7740903638_sp, & 15.8978408636372_sp, 8.801468212714914_sp, 8.798080767692923_sp, 8.791287884846061575_sp, & 0.6635324560331525_sp, 0.6633115808685429_sp, 0.6630906573122884_sp, 0.6628696853957159_sp, & 0.5042349934053336_sp, 0.5041796815747646_sp, 0.5041242821300232_sp, 0.50401322049655_sp, & 499.19032387045183_sp, 499.2802878848461_sp, 499.3702518992403_sp, 499.5501799280288_sp] expected_y = [-2.1476418943648812E-002_sp, 0.45752410314844527_sp, -3.6134118144921369e-3_sp, -1.1810118244863275_sp, & 5.72582334E-02_sp, -1.99812334E-02_sp, 0.271367937_sp, 0.277011007_sp, & -0.100661635_sp, 1.34913139E-02_sp, 0.116948858_sp, -0.146244213_sp, & 0.113518834_sp, 0.265794873_sp, 0.265978813_sp, 0.266338646_sp, & -0.231845424_sp, -0.232100740_sp, -0.232356280_sp, -0.232611880_sp, & -0.438309371_sp, -0.438390195_sp, -0.438471109_sp, -0.438633382_sp, & 3.19634713E-02_sp, 3.04011665E-02_sp, 2.85927802E-02_sp, 2.42997743E-02_sp] do i = 1, size(y) print *, bessel_y0(y(i)), "i = ", i if (abs(bessel_y0(y(i)) - expected_y(i)) > 1e-6) error stop end do end program lfortran-0.63.0/integration_tests/gpu_metal_102.f900000664000175000017500000000160415174404631022245 0ustar alastairalastairmodule gpu_metal_102_m implicit none contains pure function double_it(x) result(y) real, intent(in) :: x real, allocatable :: y(:) allocate(y(1)) y(1) = x * 2.0 end function end module program gpu_metal_102 ! Test: function returning allocatable array assigned to a fixed-size ! local array inside do concurrent. Verifies that the Metal codegen ! emits element-wise copy when a local alloc result is assigned to a ! non-allocatable fixed-size array (C-style arrays are not assignable). use gpu_metal_102_m implicit none real :: results(4) integer :: i do concurrent (i = 1:4) block real :: tmp(1) tmp = double_it(real(i)) results(i) = tmp(1) end block end do if (abs(results(1) - 2.0) > 1e-6) error stop if (abs(results(2) - 4.0) > 1e-6) error stop if (abs(results(3) - 6.0) > 1e-6) error stop if (abs(results(4) - 8.0) > 1e-6) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/test_ieee_next_down.f900000664000175000017500000000453215174404631023744 0ustar alastairalastair! Test ieee_next_down function (Fortran 2018 standard) program ieee_next_down_01 use, intrinsic :: ieee_arithmetic, only: ieee_next_down, ieee_is_finite, ieee_next_up implicit none real(4) :: x_sp, next_sp real(8) :: x_dp, next_dp print *, "Testing ieee_next_down..." ! Test 1: Next down from positive value x_sp = 1.0 next_sp = ieee_next_down(x_sp) print *, "ieee_next_down(1.0) =", next_sp if (next_sp >= x_sp) error stop "next_down should be less than x" ! Test 2: Next down from negative value x_sp = -1.0 next_sp = ieee_next_down(x_sp) print *, "ieee_next_down(-1.0) =", next_sp if (next_sp >= x_sp) error stop "next_down should be less than x" ! Test 3: Next down from zero x_sp = 0.0 next_sp = ieee_next_down(x_sp) print *, "ieee_next_down(0.0) =", next_sp if (next_sp >= 0.0) error stop "next_down(0.0) should be negative" ! Test 4: Relationship with spacing for positive numbers x_sp = 1.0 next_sp = ieee_next_down(x_sp) print *, "Difference: 1.0 - next_down(1.0) =", x_sp - next_sp print *, "spacing(1.0) =", spacing(x_sp) ! For next_down from positive x, the difference is spacing(next_down(x)) ! which is half of spacing(x) since we cross to lower exponent if (next_sp >= x_sp) error stop "next_down should be less than x" ! Test 5: Double precision x_dp = 1.0d0 next_dp = ieee_next_down(x_dp) print *, "ieee_next_down(1.0d0) =", next_dp if (next_dp >= x_dp) error stop "Should be less" ! Test 6: Large negative value should still give smaller value x_sp = -huge(x_sp) / 2.0 next_sp = ieee_next_down(x_sp) if (next_sp >= x_sp) error stop "Should be less even for large negative x" ! Test 7: From -huge(x) should give -infinity x_sp = -huge(x_sp) next_sp = ieee_next_down(x_sp) print *, "ieee_next_down(-huge) =", next_sp if (ieee_is_finite(next_sp)) error stop "next_down(-huge) should be -infinity" ! Test 8: Verify inverse relationship with next_up x_sp = 1.0 next_sp = ieee_next_down(x_sp) if (ieee_next_down(ieee_next_up(x_sp)) /= x_sp) then error stop "next_down(next_up(x)) should equal x" end if print *, "Inverse relationship verified" print *, "All ieee_next_down tests passed!" end program ieee_next_down_01 lfortran-0.63.0/integration_tests/derived_types_109.f900000664000175000017500000000305415174404631023146 0ustar alastairalastair! Test that same-named derived types in different modules do not collide. ! Regression test: name2dertype map keys were not module-qualified, ! causing GEP type mismatches when two modules defined types with ! the same name (one extending a parent type). module derived_types_109_parent_m implicit none type, abstract :: parent_t integer :: val contains procedure(free_i), deferred :: free end type abstract interface impure elemental subroutine free_i(self) import parent_t class(parent_t), intent(inout) :: self end subroutine end interface end module module derived_types_109_mod_a implicit none type :: object_t integer :: dummy end type contains subroutine check_a(x) type(object_t), intent(out) :: x x%dummy = 1 end subroutine end module module derived_types_109_mod_b use derived_types_109_parent_m, only: parent_t implicit none type, extends(parent_t) :: object_t contains procedure :: free end type contains impure elemental subroutine free(self) class(object_t), intent(inout) :: self self%val = 0 end subroutine subroutine check_b(obj) type(object_t), intent(out) :: obj obj%val = 42 end subroutine end module program derived_types_109 use derived_types_109_mod_a, only: check_a, object_t_a => object_t use derived_types_109_mod_b, only: check_b, object_t_b => object_t implicit none type(object_t_a) :: a type(object_t_b) :: b call check_a(a) call check_b(b) if (a%dummy /= 1) error stop if (b%val /= 42) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/intent_01.f900000664000175000017500000000041715174404631021510 0ustar alastairalastairmodule dflt_intent contains subroutine foo(c, d) real :: c, d, e, g e = f(c) g = f(d) contains real function f(x) real, intent(in) :: x f = 2*x print *, f end function f end subroutine foo end module program main use dflt_intent call foo(0.0, 2.0) end program lfortran-0.63.0/integration_tests/string_20.f900000664000175000017500000000103615174404631021514 0ustar alastairalastairprogram string_20 use, intrinsic :: iso_c_binding, only : c_char, c_null_char implicit none print *, "working ok" contains subroutine f_c_character(rhs, lhs, len) character(kind=c_char), intent(out) :: lhs(*) character(len=*), intent(in) :: rhs integer, intent(in) :: len integer :: length length = min(len-1, len_trim(rhs)) lhs(1:length) = transfer(rhs(1:length), lhs(1:length)) lhs(length+1:length+1) = c_null_char end subroutine f_c_character end program lfortran-0.63.0/integration_tests/intrinsics_82.f900000664000175000017500000000276015174404631022410 0ustar alastairalastairprogram intrinsics_82 double precision :: x(5) x(1) = 1.0d0 x(2) = 2.0d0 x(3) = 3.0d0 x(4) = 4.0d0 x(5) = 5.0d0 print *, tan(x) if( abs(tan(x(1)) - 1.5574077246549023) > 1e-5) error stop if( abs(tan(x(2)) + 2.1850398632615189) > 1e-5) error stop if( abs(tan(x(3)) + 0.14254654307427780) > 1e-5) error stop if( abs(tan(x(4)) - 1.1578212823495775) > 1e-5) error stop if( abs(tan(x(5)) + 3.3805150062465859) > 1e-5) error stop print *, cosh(x) if( abs(cosh(x(1)) - 1.5430806348152437) > 1e-5) error stop if( abs(cosh(x(2)) - 3.7621956910836314) > 1e-5) error stop if( abs(cosh(x(3)) - 10.067661995777765) > 1e-5) error stop if( abs(cosh(x(4)) - 27.308232836016487) > 1e-5) error stop if( abs(cosh(x(5)) - 74.209948524787848) > 1e-5) error stop print *, sinh(x) if( abs(sinh(x(1)) - 1.1752011936438014) > 1e-5) error stop if( abs(sinh(x(2)) - 3.6268604078470190) > 1e-5) error stop if( abs(sinh(x(3)) - 10.017874927409903) > 1e-5) error stop if( abs(sinh(x(4)) - 27.289917197127750) > 1e-5) error stop if( abs(sinh(x(5)) - 74.203210577788752) > 1e-5) error stop print *, tanh(x) if( abs(tanh(x(1)) - 0.76159415595576485) > 1e-5) error stop if( abs(tanh(x(2)) - 0.96402758007581690) > 1e-5) error stop if( abs(tanh(x(3)) - 0.99505475368673046) > 1e-5) error stop if( abs(tanh(x(4)) - 0.99932929973906703) > 1e-5) error stop if( abs(tanh(x(5)) - 0.99990920426259511) > 1e-5) error stop end programlfortran-0.63.0/integration_tests/read_14.f900000664000175000017500000000063615174404631021131 0ustar alastairalastairprogram read_14 implicit none real :: arr(5) integer :: i, j open(10, file="read_14_data.txt", status="replace") write(10, *) 1.0, 2.0, 3.0, 4.0, 5.0 close(10) open(10, file="read_14_data.txt", status="old") read(10, *) (arr(j), j=1,5) close(10, status="delete") do i = 1, 5 if (abs(arr(i) - real(i)) > 1e-6) error stop end do print *, "PASS" end program lfortran-0.63.0/integration_tests/intrinsics_19.f900000664000175000017500000001103515174404631022403 0ustar alastairalastairprogram intrinsics_19 ! Test intrinsics both declarations and executable statements. ! Single and double precision, real only. integer, parameter :: dp = kind(0.d0) real, parameter :: & s1 = abs(-0.5), & s2 = exp(0.5), & s3 = log(0.5), & s4 = erf(0.5), & s5 = erfc(0.5), & s6 = sqrt(0.5), & s7 = gamma(0.5), & s8 = atan2(0.5, 0.5), & s9 = log_gamma(0.5), & s9_ = log_gamma(log_gamma(0.5) + 3*log_gamma(0.5+log_gamma(0.5))), & s10 = log10(0.5) integer, parameter :: & s11 = nint(3.6), & s12 = floor(3.6), & s13 = nint(-3.6), & s14 = floor(-3.6) real(dp), parameter :: & d1 = abs(-0.5_dp), & d2 = exp(0.5_dp), & d3 = log(0.5_dp), & d4 = erf(0.5_dp), & d5 = erfc(0.5_dp), & d6 = sqrt(0.5_dp), & d7 = gamma(0.5_dp), & d8 = atan2(0.5_dp, 0.5_dp), & d9 = log_gamma(0.5_dp), & d9_ = log_gamma(log_gamma(0.5_dp) + 3*log_gamma(0.5_dp+log_gamma(0.5_dp))), & d10 = log10(0.5_dp) integer, parameter :: & d11 = nint(3.6_dp), & d12 = floor(3.6_dp), & d13 = nint(-3.6_dp), & d14 = floor(-3.6_dp) real :: x, x2 real(dp) :: y, y2 x = 0.5 y = 0.5_dp x2 = 3.6 y2 = 3.6_dp print *, abs(-0.5), abs(-0.5_dp), s1, d1, abs(-x), abs(-y) print *, "Exp: ", exp(0.5), exp(0.5_dp), s2, d2, exp(x), exp(y) if (abs(exp(0.5) - 1.64872122) > 1e-7) error stop if (abs(exp(0.5_dp) - 1.64872127070012819) > 1e-7_dp) error stop if (abs(s2 - 1.64872122) > 1e-7) error stop if (abs(d2 - 1.64872127070012819) > 1e-7_dp) error stop if (abs(exp(x) - 1.64872122) > 1e-7) error stop if (abs(exp(y) - 1.64872127070012819) > 1e-7_dp) error stop print *, "Log: ", log(0.5), log(0.5_dp), s3, d3, log(x), log(y) if (abs(log(0.5) + 0.693147182) > 1e-7) error stop if (abs(log(0.5_dp) + 0.693147180559945286) > 1e-7_dp) error stop if (abs(s3 + 0.693147182) > 1e-7) error stop if (abs(d3 + 0.693147180559945286) > 1e-7_dp) error stop if (abs(log(x) + 0.693147182) > 1e-7) error stop if (abs(log(y) + 0.693147180559945286) > 1e-7_dp) error stop print *, "dlog10: ", dlog10(0.5_dp), dlog10(y2) if (abs(dlog10(0.5_dp) + 0.301029995663981198) > 1e-7_dp) error stop if (abs(dlog10(y2) - 0.556302500767287267) > 1e-7_dp) error stop print *, "Erf: ", erf(0.5), erf(0.5_dp), s4, d4, erf(x), erf(y) if (abs(erf(0.5) - 0.520499885) > 1e-7) error stop if (abs(erf(0.5_dp) - 0.520499877813046519) > 1e-7_dp) error stop if (abs(s4 - 0.520499885) > 1e-7) error stop if (abs(d4 - 0.520499877813046519) > 1e-7_dp) error stop if (abs(erf(x) - 0.520499885) > 1e-7) error stop if (abs(erf(y) - 0.520499877813046519) > 1e-7_dp) error stop print *, "Erfc: ", erfc(0.5), erfc(0.5_dp), s5, d5, erfc(x), erfc(y) if (abs(erfc(0.5) - 0.479500115) > 1e-7) error stop if (abs(erfc(0.5_dp) - 0.479500122186953481) > 1e-7_dp) error stop if (abs(s5 - 0.479500115) > 1e-7) error stop if (abs(d5 - 0.479500122186953481) > 1e-7_dp) error stop if (abs(erfc(x) - 0.479500115) > 1e-7) error stop if (abs(erfc(y) - 0.479500122186953481) > 1e-7_dp) error stop print *, sqrt(0.5), sqrt(0.5_dp), s6, d6, sqrt(x), sqrt(y) print *, gamma(0.5), gamma(0.5_dp), s7, d7, gamma(x), gamma(y) print *, atan2(0.5, 0.5), atan2(0.5_dp, 0.5_dp), s8, d8, atan2(x,x), atan2(y,y) print *, log_gamma(0.5), log_gamma(0.5_dp), s9, d9, log_gamma(x), log_gamma(y) print *, s9_, log_gamma(log_gamma(x) + 3*log_gamma(x+log_gamma(x))) print *, d9_, log_gamma(log_gamma(y) + 3*log_gamma(y+log_gamma(y))) print *, "Log10: ", log10(0.5), log10(0.5_dp), s10, d10, log10(x), log10(y) if (abs(log10(0.5) + 0.301030010) > 1e-7) error stop if (abs(log10(0.5_dp) + 0.301029995663981198) > 1e-7_dp) error stop if (abs(s10 + 0.301030010) > 1e-7) error stop if (abs(d10 + 0.301029995663981198) > 1e-7_dp) error stop if (abs(log10(x) + 0.301030010) > 1e-7) error stop if (abs(log10(y) + 0.301029995663981198) > 1e-7_dp) error stop print *, nint(3.6), nint(3.6_dp), s11, d11, nint(x2), nint(y2) print *, floor(3.6), floor(3.6_dp), s12, d12, floor(x2), floor(y2) print *, nint(-3.6), nint(-3.6_dp), s13, d13, nint(-x2), nint(-y2) print *, floor(-3.6), floor(-3.6_dp), s14, d14, floor(-x2), floor(-y2) if (abs(dsqrt(4.0_dp) - 2.0_dp) > 1e-15_dp) error stop if (abs(dsqrt(y) - 0.70710678118654757_dp) > 1e-15_dp) error stop if (abs(s9_ - log_gamma(log_gamma(x) + 3*log_gamma(x+log_gamma(x)))) > 1e-7) error stop if (abs(d9_ - log_gamma(log_gamma(y) + 3*log_gamma(y+log_gamma(y)))) > 1e-15_dp) error stop if (abs(s9 - 0.572364926) > 1e-7) error stop if (abs(d9 - 0.57236494292470008) > 1e-7_dp) error stop if (abs(s9_ - 0.656042993) > 1e-7) error stop if (abs(d9_ - 0.65604298092238577) > 1e-7_dp) error stop end program intrinsics_19 lfortran-0.63.0/integration_tests/string_12.f900000664000175000017500000000205115174404631021513 0ustar alastairalastairprogram string_12 implicit none character(len=*), parameter :: fullhex_digits = "0123456789ABCDEFabcdef" !! 0 .. 9A .. Fa .. f character(len=*), parameter :: hex_digits = fullhex_digits(1:16) !! 0 .. 9A .. F character(len=*), parameter :: lowerhex_digits = "0123456789abcdef" !! 0 .. 9a .. f character(len=*), parameter :: digits = hex_digits(1:10) !! 0 .. 9 character(len=*), parameter :: octal_digits = digits(1:8) !! 0 .. 7 character(len=*), parameter :: letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" !! A .. Za .. z character(len=*), parameter :: uppercase = letters(1:26) !! A .. Z character(len=*), parameter :: lowercase = letters(27:) !! a .. z character(len=*), parameter :: string = char(len(letters)) print *, fullhex_digits print *, hex_digits print *, lowerhex_digits print *, digits print *, octal_digits print *, letters print *, uppercase print *, lowercase print *, "char(", len(letters), ") = ", string if (string /= "4") error stop end program lfortran-0.63.0/integration_tests/procedure_32.f900000664000175000017500000000122315174404631022177 0ustar alastairalastair! Test passing a function name directly to a procedure-pointer dummy argument. ! The callee declares 'procedure(...), pointer, intent(in)' but the actual ! argument is the bare subroutine name (not a pointer variable). program procedure_32 implicit none abstract interface subroutine intfc() end subroutine intfc end interface integer :: x x = 0 call output(hello) if (x /= 1) error stop contains subroutine output(ptr) procedure(intfc), pointer, intent(in) :: ptr call ptr() end subroutine output subroutine hello() x = 1 end subroutine hello end program procedure_32 lfortran-0.63.0/integration_tests/common_09.f900000664000175000017500000000035415174404631021507 0ustar alastairalastairsubroutine sub1() integer illin, ntrep common illin, ntrep if (illin /= 1) error stop if (ntrep /= 2) error stop print *, illin, ntrep end program common_09 integer illin , ntrep common illin, ntrep illin = 1 ntrep = 2 call sub1() end lfortran-0.63.0/integration_tests/openmp_64.f900000664000175000017500000000501615174404631021516 0ustar alastairalastairprogram openmp_64 use omp_lib implicit none integer, parameter :: n = 100 integer :: i, tid, j real :: delay integer :: thread_iterations(0:7) = 0 integer :: iteration_order(n) integer :: order_counter integer :: consecutive_count, max_consecutive real :: work_array(n) call omp_set_num_threads(4) order_counter = 0 print *, "=== DYNAMIC Schedule Test ===" ! Dynamic schedule should NOT give contiguous blocks to threads !$omp parallel do schedule(dynamic, 1) private(tid, delay) do i = 1, n tid = omp_get_thread_num() ! Simulate varying work to see dynamic behavior if (mod(i, 10) == 0) then ! Some iterations take longer delay = 0.0 do j = 1, 1000 delay = delay + sin(real(j)) end do work_array(i) = delay end if !$omp critical thread_iterations(tid) = thread_iterations(tid) + 1 order_counter = order_counter + 1 iteration_order(order_counter) = tid !$omp end critical end do !$omp end parallel do ! Analyze dynamic behavior print *, "Thread iteration counts:" do i = 0, omp_get_max_threads()-1 print *, "Thread", i, ":", thread_iterations(i), "iterations" end do ! Check that work is not always in large contiguous blocks ! Dynamic with chunk=1 should interleave frequently max_consecutive = 0 consecutive_count = 1 do i = 2, n if (iteration_order(i) == iteration_order(i-1)) then consecutive_count = consecutive_count + 1 else if (consecutive_count > max_consecutive) then max_consecutive = consecutive_count end if consecutive_count = 1 end if end do print *, "Maximum consecutive iterations by same thread:", max_consecutive ! With dynamic(1), we shouldn't see very large consecutive blocks if (max_consecutive > 10) then print *, "WARNING: Dynamic schedule showing large consecutive blocks" print *, "This might indicate dynamic scheduling is not working properly" end if ! Check work distribution variation ! Dynamic should show more variation than static if (maxval(thread_iterations(0:3)) - minval(thread_iterations(0:3)) < 2) then print *, "WARNING: Work distribution too uniform for dynamic schedule" end if print *, "DYNAMIC schedule test completed" end program openmp_64lfortran-0.63.0/integration_tests/separate_compilation_47a.f900000664000175000017500000000135615174404631024567 0ustar alastairalastairmodule separate_compilation_47a_absmod type, abstract :: AbsType integer :: x = 0 end type AbsType type, extends(AbsType) :: ConcreteType integer :: y = 0 end type ConcreteType end module separate_compilation_47a_absmod module separate_compilation_47a_mymod use separate_compilation_47a_absmod contains function myfunc() result(res) class(AbsType), allocatable :: res allocate(res, source=srcfunc()) end function myfunc function srcfunc() result(obj) class(AbsType), allocatable :: obj allocate(ConcreteType :: obj) obj%x = 42 select type(obj) type is (ConcreteType) obj%y = 84 end select end function srcfunc end module separate_compilation_47a_mymod lfortran-0.63.0/integration_tests/bindc_47c.c0000664000175000017500000000070515174404631021267 0ustar alastairalastair#include extern int counter; extern double pi_value; void check_counter(void) { if (counter != 42) { printf("FAIL: counter = %d, expected 42\n", counter); return; } printf("C sees counter=%d\n", counter); } void check_pi(void) { if (pi_value < 3.13 || pi_value > 3.15) { printf("FAIL: pi_value = %f, expected ~3.14\n", pi_value); return; } printf("C sees pi_value=%f\n", pi_value); } lfortran-0.63.0/integration_tests/string_89.f900000664000175000017500000000130115174404631021526 0ustar alastairalastair! This test checks that assignment to a slice of an array ! Inside Subroutine works correctly for assumed-length strings. program string_89 implicit none character(len=5) :: strings(3) = ['-----','-----','-----'] character(len=:), allocatable :: str(:) str = ['ABC','BEE','SEE'] call assign_slice(strings, str) print *,strings if (strings(1) /= 'ABC') error stop if (strings(2) /= 'BEE') error stop if (strings(3) /= 'SEE') error stop contains subroutine assign_slice(strings,str) implicit none character(len=*), intent(inout) :: strings(:) character(len=:), allocatable, intent(in) :: str(:) strings(:) = str end subroutine end program string_89lfortran-0.63.0/integration_tests/class_112.f900000664000175000017500000000134515174404631021400 0ustar alastairalastairprogram class_112 implicit none integer, parameter :: i = 4 real, parameter :: r = 3.14 logical, parameter :: l = .true. class(*), allocatable :: obj obj = i select type(obj) type is (integer) print *, obj if (obj /= 4) error stop class default error stop end select obj = r select type(obj) type is (real) print *, obj if (abs(obj - 3.14) > 1.0e-6) error stop class default error stop end select obj = l select type(obj) type is (logical) print *, obj if (obj .neqv. .true.) error stop class default error stop end select print *, "All tests passed." end program class_112 lfortran-0.63.0/integration_tests/subroutines_11.f900000664000175000017500000000065215174404631022573 0ustar alastairalastairprogram test implicit none real :: x(1, 3) x = 0 call random_init(.true., .true.) call random_number(x(1, 2)) call random_init(.true., .true.) call random_number(x(1, 3)) print *, x if (abs(x(1, 1) - 0.0) > 1e-5) error stop if (abs(x(1, 2) - 0.0) < 1e-8) error stop ! The two values must be the same, due to `random_init()` above if (x(1, 2) /= x(1, 3)) error stop end programlfortran-0.63.0/integration_tests/procedure_46.f900000664000175000017500000000176415174404631022216 0ustar alastairalastairmodule evaluate_mod implicit none abstract interface function f(x) real, intent(in) :: x real :: f end function f end interface contains function cube(x) real, intent(in) :: x real :: cube cube = x**3 end function cube function square(x) real, intent(in) :: x real :: square square = x**2 end function square end module evaluate_mod module f_as_arg_mod use evaluate_mod, only: f implicit none contains function value(x, fx) real, intent(in) :: x real :: value procedure(f) :: fx value = fx(x) end function value end module f_as_arg_mod program procedure_46 use f_as_arg_mod, only: value use evaluate_mod, only: f, square, cube implicit none real :: sq, cu sq = value(3.0, square) cu = value(3.0, cube) if (abs(sq - 9.0) > 1.0e-6) error stop if (abs(cu - 27.0) > 1.0e-6) error stop end program procedure_46 lfortran-0.63.0/integration_tests/inquire_13.f900000664000175000017500000001064515174404631021672 0ustar alastairalastair! Comprehensive test for INQUIRE PENDING and ASYNCHRONOUS keywords ! Tests various file access modes, unit states, and combinations program inquire_13 implicit none integer :: u, ios, unit_num, u1, u2, u3, i character(len=256) :: async_val, filename character(len=256) :: access_mode, form_val, named_val logical :: pending_val logical :: named_flag, opened_flag filename = "test_inquire_13.dat" ! ---- TEST 1: Stream access, opened file ---- open(newunit=u, file=filename, status="replace", access="stream", & action="write", iostat=ios) if (ios /= 0) error stop write(u) 42 rewind(u) async_val = "???" pending_val = .true. inquire(unit=u, asynchronous=async_val, pending=pending_val, iostat=ios) if (ios /= 0) error stop if (trim(async_val) /= "NO") then error stop end if if (pending_val) then error stop end if close(u) ! ---- TEST 2: Sequential access, formatted ---- open(newunit=u, file=filename, status="old", access="sequential", & form="formatted", action="read", iostat=ios) if (ios /= 0) error stop async_val = "???" pending_val = .true. inquire(unit=u, asynchronous=async_val, pending=pending_val, iostat=ios) if (ios /= 0) error stop if (trim(async_val) /= "NO" .and. trim(async_val) /= "UNDEFINED") error stop if (pending_val) error stop close(u) ! ---- TEST 3: Direct access, unformatted ---- open(newunit=u, file=filename, status="old", access="direct", & recl=4, form="unformatted", action="read", iostat=ios) if (ios /= 0) error stop async_val = "???" pending_val = .true. inquire(unit=u, asynchronous=async_val, pending=pending_val, iostat=ios) if (ios /= 0) error stop if (trim(async_val) /= "NO" .and. trim(async_val) /= "UNDEFINED") error stop if (pending_val) error stop close(u) ! ---- TEST 4: Multiple units with different access modes ---- open(newunit=u1, file=filename, status="old", access="stream", & action="read", iostat=ios) if (ios /= 0) error stop open(newunit=u2, file=filename, status="old", access="sequential", & action="read", iostat=ios) if (ios /= 0) error stop open(newunit=u3, file=filename, status="old", access="direct", & recl=4, action="read", iostat=ios) if (ios /= 0) error stop ! Check u1 (stream) pending_val = .true. inquire(unit=u1, asynchronous=async_val, pending=pending_val, iostat=ios) if (ios /= 0 .or. trim(async_val) /= "NO" .or. pending_val) error stop ! Check u2 (sequential) pending_val = .true. inquire(unit=u2, asynchronous=async_val, pending=pending_val, iostat=ios) if (ios /= 0 .or. trim(async_val) /= "NO" .or. pending_val) error stop ! Check u3 (direct) pending_val = .true. inquire(unit=u3, asynchronous=async_val, pending=pending_val, iostat=ios) if (ios /= 0 .or. trim(async_val) /= "NO" .or. pending_val) error stop close(u1) close(u2) close(u3) ! ---- TEST 5: Default values for various scenarios ---- open(newunit=u, file=filename, status="old", access="stream", iostat=ios) if (ios /= 0) error stop ! Initialize with non-default values to verify they're set async_val = "???" pending_val = .true. inquire(unit=u, asynchronous=async_val, pending=pending_val, iostat=ios) if (ios /= 0) error stop if (trim(async_val) /= "NO" .and. trim(async_val) /= "UNDEFINED") error stop if (pending_val) error stop close(u) ! ---- TEST 6: File-based inquiry (not by unit) ---- ! File-based inquire may return processor-dependent values for some keywords ! Just verify the call succeeds without error inquire(file=filename, asynchronous=async_val, iostat=ios) if (ios /= 0) error stop if (trim(async_val) /= "NO" .and. trim(async_val) /= "UNDEFINED") error stop ! ---- TEST 7: Different file modes in sequence ---- do i = 1, 3 open(newunit=u, file=filename, status="old", access="stream", & action="read", iostat=ios) if (ios /= 0) error stop pending_val = .true. inquire(unit=u, asynchronous=async_val, pending=pending_val, iostat=ios) if (ios /= 0 .or. trim(async_val) /= "NO" .or. pending_val) error stop close(u) end do ! Clean up open(unit=10, file=filename, status='old', iostat=ios) if (ios == 0) close(10, status='delete') end program inquire_13 lfortran-0.63.0/integration_tests/intrinsics_17b.f900000664000175000017500000000021215174404631022536 0ustar alastairalastairprogram intrinsics_17b implicit none real :: A, B B = 2.0D0 A = log(B) print *, A if (abs(A - 0.693147182) > 1e-5) error stop end program lfortran-0.63.0/integration_tests/intrinsics_34.f900000664000175000017500000000102115174404631022372 0ustar alastairalastairprogram intrinsics_34 integer, parameter :: dp=kind(0d0) real :: x = 3.143 real(dp) :: y = 2.33 print *, epsilon(x) print *, epsilon(y) print *, epsilon(1._dp) ** 0.5 !Part of Minpack ! Below numbers are corresponding output of gfortran and not magic numbers. if (abs(epsilon(x) - 1.19209290E-07) > 1e-7) error stop if (abs(epsilon(y) - 2.2204460492503131E-016_dp) > 1e-15_dp) error stop if (abs((epsilon(1._dp) ** 0.5_dp) - 1.4901161193847656E-008_dp) > 1e-15_dp) error stop end program lfortran-0.63.0/integration_tests/arrays_112.f900000664000175000017500000000040515174404631021570 0ustar alastairalastairprogram arrays_112 implicit none real :: empty(0) = [real ::] character(80) :: line if (size(empty) /= 0) error stop write(line, "(2A)") ':', empty(:), ':' if (trim(line) /= '::') error stop print "(2A)", ':', empty(:), ':' end program arrays_112 lfortran-0.63.0/integration_tests/intrinsics_243.f900000664000175000017500000001035515174404631022466 0ustar alastairalastairprogram intrinsics_243 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(dp) :: a, b real(sp) :: d, e integer :: i real(dp) :: sqrt_runtime_dp(3) = [5.678_dp, 892.272_dp, 72.312_dp] real(dp) :: log_runtime_dp(3) = [0.875_dp, 3.367_dp, 2.140_dp] real(dp) :: abs_runtime_dp(3) = [-723.182_dp, 9.124_dp, -123.145_dp] real(sp) :: sqrt_runtime_sp(3) = [5.678, 892.272, 72.312] real(sp) :: log_runtime_sp(3) = [0.875, 3.367, 2.140] real(sp) :: abs_runtime_sp(3) = [-723.182, 9.124, -123.145] real(dp) :: sqrt_res_dp(3), log_res_dp(3), abs_res_dp(3) real(sp) :: sqrt_res_sp(3), log_res_sp(3), abs_res_sp(3) real(dp) :: expected1_dp(3) = [2.38285542994114508e+00_dp, 2.98709223158576087e+01_dp, 8.50364627674505336e+00_dp] real(dp) :: expected2_dp(3) = [-0.13353139262452263_dp, 1.2140221401789375_dp, 0.76080582903376015_dp] real(dp) :: expected3_dp(3) = [7.23182000000000000e+02_dp, 9.12400000000000000e+00_dp, 1.23145000000000000e+02_dp] real(sp) :: expected1_sp(3) = [2.38285542, 2.98709221e+01, 8.50364590] real(sp) :: expected2_sp(3) = [-1.33531392e-01, 1.21402216e+00, 7.60805905e-01] real(sp) :: expected3_sp(3) = [7.23182007e+02, 9.12399960e+00, 1.23144997e+02] real(dp), parameter :: res1(3) = sqrt([5.678_dp, 892.272_dp, 72.312_dp]) real(dp), parameter :: res2(3) = log([0.875_dp, 3.367_dp, 2.140_dp]) real(dp), parameter :: res3(3) = abs([-723.182_dp, 9.124_dp, -123.145_dp]) real(sp), parameter :: res1_sp(3) = sqrt([5.678, 892.272, 72.312]) real(sp), parameter :: res2_sp(3) = log([0.875, 3.367, 2.140]) real(sp), parameter :: res3_sp(3) = abs([-723.182, 9.124, -123.145]) do i = 1, 3 print *, res1(i) if (abs(res1(i) - expected1_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, res2(i) if (abs(res2(i) - expected2_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, res3(i) if (abs(res3(i) - expected3_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, res1_sp(i) if (abs(res1_sp(i) - expected1_sp(i)) > 1e-5) error stop end do do i = 1, 3 print *, res2_sp(i) if (abs(res2_sp(i) - expected2_sp(i)) > 1e-5) error stop end do do i = 1, 3 print *, res3_sp(i) if (abs(res3_sp(i) - expected3_sp(i)) > 1e-5) error stop end do sqrt_res_dp = sqrt(sqrt_runtime_dp) log_res_dp = log(log_runtime_dp) abs_res_dp = abs(abs_runtime_dp) sqrt_res_sp = sqrt(sqrt_runtime_sp) log_res_sp = log(log_runtime_sp) abs_res_sp = abs(abs_runtime_sp) do i = 1, 3 print *, sqrt_res_dp(i) if (abs(sqrt_res_dp(i) - expected1_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, log_res_dp(i) if (abs(log_res_dp(i) - expected2_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, abs_res_dp(i) if (abs(abs_res_dp(i) - expected3_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, sqrt_res_sp(i) if (abs(sqrt_res_sp(i) - expected1_sp(i)) > 1e-5) error stop end do do i = 1, 3 print *, log_res_sp(i) if (abs(log_res_sp(i) - expected2_sp(i)) > 1e-5) error stop end do do i = 1, 3 print *, abs_res_sp(i) if (abs(abs_res_sp(i) - expected3_sp(i)) > 1e-5) error stop end do a = 1.1_dp b = 1.2_dp d = 1.1 e = 1.2 if (b-a > 0.2_dp) error stop if (abs(b-a) > 0.2_dp) error stop if (abs(a-b) > 0.2_dp) error stop if (abs(e-d) > 0.2) error stop if (abs(d-e) > 0.2) error stop if (abs(1.2_dp-1.1_dp) > 0.2_dp) error stop if (abs(1.1_dp-1.2_dp) > 0.2_dp) error stop if (abs(1.2-1.1) > 0.2) error stop if (abs(1.1-1.2) > 0.2) error stop a = 4._dp d = 4. if (abs(sqrt(a)-2._dp) > 1e-12_dp) error stop if (abs(sqrt(4._dp)-2._dp) > 1e-12_dp) error stop if (abs(sqrt(d)-2.) > 1e-5) error stop if (abs(sqrt(4.)-2.) > 1e-5) error stop a = 4._dp d = 4. if (abs(log(a)-1.3862943611198906_dp) > 1e-12_dp) error stop if (abs(log(4._dp)-1.3862943611198906_dp) > 1e-12_dp) error stop if (abs(log(d)-1.3862943611198906) > 1e-5) error stop if (abs(log(4.)-1.3862943611198906) > 1e-5) error stop endlfortran-0.63.0/integration_tests/intrinsics_166.f900000664000175000017500000000310615174404631022466 0ustar alastairalastairprogram intrinsics_166 integer :: a1 = 5, a2 = 8 integer(8) :: a3 = -1, a4 = -4 integer :: a5 = -2, a6 = -5 integer, parameter :: i1 = ibset(5, 8) integer, parameter :: i2 = ibset(-1_8, 5) integer, parameter :: i3 = ibset(-4, 2_8) integer(8), parameter :: i4 = ibset(-2_8, 5_8) integer, parameter :: ar1(3) = ibset([5, 8, 9], [8, 5, 2]) integer(8), parameter :: ar2(3) = ibset([-1_8, -5_8, -10_8], [5, 8, 9]) integer :: arr1(3), arr3(3) integer(8) :: arr2(3) integer :: res(3) arr1 = [5, 8, 9] arr3 = [8, 5, 2] arr2 = [-1_8, -5_8, -10_8] print *, i1 if (i1 /= 261) error stop print *, i2 if (i2 /= -1) error stop print *, i3 if (i3 /= -4) error stop print *, i4 if (i4 /= -2) error stop print*, ibset(5, 8) if (ibset(5, 8) /= 261) error stop print*, ibset(-1, 5) if (ibset(-1, 5) /= -1) error stop print*, ibset(a1, a2) if (ibset(a1, a2) /= 261) error stop print*, ibset(a3, a1) if (ibset(a3, a1) /= -1) error stop print*, ibset(a2, a4) if (ibset(a2, a4) /= 268435464) error stop print*, ibset(a5, a6) if (ibset(a5, a6) /= -2) error stop print *, ar1 if (any(ar1 /= [261, 40, 13])) error stop print *, ar2 if (any(ar2 /= [-1, -5, -10])) error stop print *, ibset(arr1, arr1) if (any(ibset(arr1, arr1) /= [37, 264, 521])) error stop print *, ibset(arr2, arr1) if (any(ibset(arr2, arr1) /= [-1, -5, -10])) error stop res = ibset(arr1, arr3) print *, res if (any(res /= [261, 40, 13])) error stop end program lfortran-0.63.0/integration_tests/arrays_80.f900000664000175000017500000000066115174404631021520 0ustar alastairalastairprogram arrays_80 real :: A(5, 10), g(5) A = 1.0 g = 2.0 print *, trstlp(A, g) if( abs(trstlp(A, g) - 60.0) > 1e-8 ) error stop if( abs(trstlp(A, g) - sum(A) - sum(g)) > 1e-8 ) error stop contains function trstlp(A, g) result(d) real :: A(:,:), g(:) integer :: n, m real :: A_aug(size(A, 1), size(A, 2) + 1) real :: d m = size(A, 2) + 1 n = size(A, 1) A_aug = reshape([A, g], [n, m]) d = sum(A_aug) end function end program lfortran-0.63.0/integration_tests/format_44.f900000664000175000017500000000251415174404631021506 0ustar alastairalastairprogram format_44 ! Test formatting of special floating-point values (Infinity, NaN) implicit none real :: zero, pos_inf, neg_inf, nan_val character(20) :: str zero = 0.0 pos_inf = 1.0 / zero neg_inf = -1.0 / zero nan_val = zero / zero ! Test G format with Infinity write(str, '(G12.5)') pos_inf if (trim(adjustl(str)) /= "Infinity") error stop "G12.5 +Inf failed" write(str, '(G12.5)') neg_inf if (trim(adjustl(str)) /= "-Infinity") error stop "G12.5 -Inf failed" ! Test E format with Infinity write(str, '(E12.5)') pos_inf if (trim(adjustl(str)) /= "Infinity") error stop "E12.5 +Inf failed" write(str, '(E12.5)') neg_inf if (trim(adjustl(str)) /= "-Infinity") error stop "E12.5 -Inf failed" ! Test ES format with Infinity write(str, '(ES12.5)') pos_inf if (trim(adjustl(str)) /= "Infinity") error stop "ES12.5 +Inf failed" ! Test EN format with Infinity write(str, '(EN12.5)') pos_inf if (trim(adjustl(str)) /= "Infinity") error stop "EN12.5 +Inf failed" ! Test G format with NaN write(str, '(G12.5)') nan_val if (trim(adjustl(str)) /= "NaN") error stop "G12.5 NaN failed" ! Test E format with NaN write(str, '(E12.5)') nan_val if (trim(adjustl(str)) /= "NaN") error stop "E12.5 NaN failed" print *, "PASS" end program lfortran-0.63.0/integration_tests/proc_ptr_14.f900000664000175000017500000000121015174404631022033 0ustar alastairalastairmodule proc_ptr_14_mod implicit none abstract interface function ifunc(x) result(r) integer, intent(in) :: x integer :: r end function end interface contains function double_it(x) result(r) integer, intent(in) :: x integer :: r r = x * 2 end function function get_op() result(fptr) procedure(ifunc), pointer :: fptr fptr => double_it end function end module program proc_ptr_14 use proc_ptr_14_mod implicit none procedure(ifunc), pointer :: op op => get_op() if (op(21) /= 42) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/namelist_20.f900000664000175000017500000000063415174404631022025 0ustar alastairalastairprogram test_namelist_internal_derived_list implicit none type :: point integer :: x=0 integer :: y=0 end type point type(point) :: dot character(len=:), allocatable :: line namelist /nml_dot/ dot line = '&nml_dot dot=1,2 /' read(line, nml=nml_dot) if (dot%x /= 1) error stop if (dot%y /= 2) error stop end program test_namelist_internal_derived_list lfortran-0.63.0/integration_tests/assumed_type_04.c0000664000175000017500000000067615174404631022547 0ustar alastairalastair#include #include void check_cfi_base_addr(CFI_cdesc_t *desc, int32_t *expected_offset, int32_t *expected_size, int32_t *ok) { *ok = 0; if (desc->base_addr == NULL) return; const int32_t *data = (const int32_t *)desc->base_addr; if (data[0] == *expected_offset && data[1] == *expected_size) { *ok = 1; } } lfortran-0.63.0/integration_tests/arrays_08_func_pass_arr_dims.f900000664000175000017500000000137115174404631025440 0ustar alastairalastairprogram arrays_08_func implicit none integer :: x(10), y(10), i logical :: r do i = 1, size(x) x(i) = i end do call copy_from_to(size(x, dim=1), x, size(y, dim=1), y) r = verify(size(x, dim=1), x, size(y, dim=1), y) print *, r if (.not. r) error stop contains subroutine copy_from_to(na1, a, nb1, b) integer, intent(in) :: na1, nb1 integer, intent(in) :: a(na1) integer, intent(out) :: b(nb1) integer :: i do i = 1, size(a) b(i) = a(i) end do end subroutine logical function verify(na1, a, nb1, b) result(r) integer, intent(in) :: na1, nb1 integer, intent(in) :: a(na1), b(nb1) integer :: i r = .true. do i = 1, size(a) r = r .and. (a(i) .eq. b(i)) end do end function end lfortran-0.63.0/integration_tests/intrinsics_409.f900000664000175000017500000000176615174404631022500 0ustar alastairalastairprogram intrinsics_409 implicit none character(len=100) :: output integer :: iostat, unit_num open(42, file='test_exec_flush.txt', position='rewind') write(42, '(A)') 'Hello from LFortran' call execute_command_line('cat test_exec_flush.txt > test_exec_output.txt') close(42) open(unit=43, file='test_exec_output.txt', status='old', iostat=iostat) if (iostat /= 0) error stop 'Failed to open output file' read(43, '(A)', iostat=iostat) output if (iostat /= 0) error stop 'Failed to read output file' close(43) if (trim(output) /= 'Hello from LFortran') then print *, 'Expected: Hello from LFortran' print *, 'Got: ', trim(output) error stop 'Output mismatch' end if open(unit=44, file='test_exec_flush.txt', status='old') close(44, status='delete') open(unit=45, file='test_exec_output.txt', status='old') close(45, status='delete') print *, 'PASSED' end program intrinsics_409 lfortran-0.63.0/integration_tests/arrays_reshape_17.f900000664000175000017500000000100115174404631023214 0ustar alastairalastairprogram arrays_reshape_17 use iso_fortran_env, only: int8 integer(int8), dimension(8) :: x x = [1_1, 2_1, 3_1, 4_1, 5_1, 6_1, 7_1, 8_1] print *, median_all_1_iint8_dp(x) if (abs(median_all_1_iint8_dp(x) - 36.0) > 1e-16) error stop contains function median_all_1_iint8_dp(x) result(res) use iso_fortran_env, only: int64, int8, dp => real64 integer(int8), intent(inout) :: x(:) real(dp) :: res integer(kind = int64) :: n n = size(x) x = reshape(x, [n]) res = sum(x) end function median_all_1_iint8_dp end program lfortran-0.63.0/integration_tests/types_03.f900000664000175000017500000000014615174404631021354 0ustar alastairalastairprogram types_03 implicit none real :: r integer :: i r = 1.5 print *, r i = r print *, i end program lfortran-0.63.0/integration_tests/common_26.f900000664000175000017500000000157315174404631021512 0ustar alastairalastairprogram common_26 implicit none ! All Fortran standards allow the size of blank common to vary between ! program units - from F66 (7.2.1.3) to F2023 (8.10.2.5). real :: pi, epsilon, sq2 common // pi, epsilon, sq2 pi = 3.1415654 epsilon = 2.718281828 sq2 = 1.414213562 call print_pi () call print_eps () call print_sq2 () print *, "All tests passed" end program subroutine print_pi () implicit none real :: pi common pi if (abs(pi - 3.1415654) > 1.0e-6) error stop "Wrong pi value" end subroutine subroutine print_eps () implicit none real :: dummy, eps common dummy, eps if (abs(eps - 2.718281828) > 1.0e-6) error stop "Wrong epsilon value" end subroutine subroutine print_sq2 () implicit none real :: dummy(2), sq2 common dummy, sq2 if (abs(sq2 - 1.414213562) > 1.0e-6) error stop "Wrong sqrt(2) value" end subroutine lfortran-0.63.0/integration_tests/arrays_12.f900000664000175000017500000000117515174404631021514 0ustar alastairalastairprogram arrays_12 implicit none integer :: i real, dimension(2, 2) :: B integer, parameter:: C(3, 2, 3) = reshape([(i, i = 1, 18)], [3, 2, 3]) ! vector subscripts integer, dimension(3) :: U = [1, 3, 2] integer, dimension(4) :: V = [3, 1, 1, 2] ! test back to back reshape - C is 3 x 2 x 3 function B = reshape(reshape(C, [4]), [2, 2]) print *, B print *, C(1, :, :) print *, C(2, :, :) print *, C(3, :, :) ! test vector as subscripts for rank 3 array print *, C(U, 2, V) print *, C(3, U(3:), V) ! test spread intrinsic print *, spread(C, 2, 2) end program lfortran-0.63.0/integration_tests/separate_compilation_30a.f900000664000175000017500000000116715174404631024557 0ustar alastairalastairmodule separate_compilation_30a_module implicit none private type, public, abstract :: abstype end type abstype type, public :: mytype integer, allocatable :: ints(:) class(abstype), allocatable :: obj end type mytype interface mytype procedure :: constructor end interface mytype contains function constructor(ints, obj) result(self) integer, intent(in) :: ints(:) class(abstype), intent(in) :: obj type(mytype) :: self self%ints = ints self%obj = obj end function constructor end module separate_compilation_30a_module lfortran-0.63.0/integration_tests/file_53.f900000664000175000017500000000111515174404631021131 0ustar alastairalastairprogram format_53 implicit none integer :: ia_1d(20), ia_2d(10,2) integer :: i, j ia_1d(:) = [(i, i=1, 20)] do, j=1, 2 do, i=1, 10 ia_2d(i,j) = j*100 + i end do end do WRITE (*, 77751 ) 1, 2, 3, 9999, & (ia_1d(i), i = 1, 20) print *, '-----------' ! Should repeat the 3(1I3), but instead is getting lost ! and doing some sort of i3,i4,3(i3) repetition. WRITE (*, 77752 ) 1, 2, 3, 9999, & ((ia_2d(i,j), j = 1, 2), i = 1, 10) 77751 FORMAT ( 3(1I3), I4, 10(1I3) ) 77752 FORMAT ( 3(1I3), I4, 3(1I3) ) end program format_53 lfortran-0.63.0/integration_tests/submodule_27b.f900000664000175000017500000000116615174404631022362 0ustar alastairalastair! Module with abstract interface used as procedure pointer type in a ! module function declaration. Tests that the abstract interface is ! properly serialized/deserialized when the submodule is loaded during ! separate compilation. module submodule_27_m implicit none abstract interface pure function fn_i(x) result(v) real(8), intent(in) :: x real(8) :: v end function end interface type :: vec_t real(8) :: val end type interface module function make_vec(fn) result(v) procedure(fn_i), pointer :: fn type(vec_t) :: v end function end interface end module submodule_27_m lfortran-0.63.0/integration_tests/class_17.f900000664000175000017500000000560615174404631021330 0ustar alastairalastairmodule class_17_mod implicit none type :: type_pass integer :: value contains procedure :: set_value_pass generic :: set_value => set_value_pass end type type :: type_no_pass integer :: value contains procedure, nopass :: set_value_no_pass, set_value_no_pass_no_obj generic :: set_value => set_value_no_pass, set_value_no_pass_no_obj end type contains subroutine set_value_pass(this, value) class(type_pass), intent(inout) :: this integer, intent(in) :: value this%value = 2 * value end subroutine subroutine set_value_no_pass(obj, value) class(type_no_pass), intent(inout) :: obj integer, intent(in) :: value obj%value = value end subroutine subroutine set_value_no_pass_no_obj(value) integer, intent(inout) :: value value = 25 end subroutine end module program class_17 use class_17_mod implicit none integer :: value type(type_pass) :: obj_pass type(type_no_pass) :: obj_no_pass obj_pass%value = 42 ! below tests show different calls to the same ! GenericProcedure (actually the same StructMethodDeclaration) ! case 1. passed as argument call obj_pass%set_value(45) print *, "obj_pass%value: ", obj_pass%value if (obj_pass%value /= 90) error stop ! case 2. passed as kwarg call obj_pass%set_value(value=50) print *, "obj_pass%value: ", obj_pass%value if (obj_pass%value /= 100) error stop obj_no_pass%value = 42 ! below tests show different calls to the same ! GenericProcedure (actually the same StructMethodDeclaration) ! case 1. both are arguments call obj_no_pass%set_value(obj_no_pass, 5) print *, "obj_no_pass%value: ", obj_no_pass%value if (obj_no_pass%value /= 5) error stop ! case 2. first is argument, second is kwarg call obj_no_pass%set_value(obj_no_pass, value=10) print *, "obj_no_pass%value: ", obj_no_pass%value if (obj_no_pass%value /= 10) error stop ! case 3. both are kwargs call obj_no_pass%set_value(obj=obj_no_pass, value=11) print *, "obj_no_pass%value: ", obj_no_pass%value if (obj_no_pass%value /= 11) error stop ! case 4. both are kwargs, but position interchanged call obj_no_pass%set_value(value=64, obj=obj_no_pass) print *, "obj_no_pass%value: ", obj_no_pass%value if (obj_no_pass%value /= 64) error stop value = 10 ! below tests show different calls to the same ! GenericProcedure (actually the same StructMethodDeclaration), ! which accepts only one argument ! case 1. passed as argument call obj_no_pass%set_value(value) print *, "value: ", value if (value /= 25) error stop value = 30 ! case 2. passed as kwarg call obj_no_pass%set_value(value=value) print *, "value: ", value if (value /= 25) error stop end program class_17 lfortran-0.63.0/integration_tests/list_test_06_.f900000664000175000017500000000606315174404631022370 0ustar alastairalastairmodule list_test_06_mod implicit none real::eps = 1e-6 contains subroutine check_mat_and_vec(mat, vec) type(_lfortran_list(_lfortran_list(real))), intent(in) :: mat type(_lfortran_list(real)), intent(in) :: vec integer::rows, cols, i, j rows = _lfortran_len(mat) cols = _lfortran_len(vec) do i = 0, rows-1 do j = 0, cols-1 if ( abs(_lfortran_get_item(_lfortran_get_item(mat, i), j) - real(i+j)) > eps ) error stop end do end do do i = 0, cols-1 if ( abs(_lfortran_get_item(vec, i) - 2*real(i)) > eps ) error stop end do end subroutine subroutine test_list_of_lists() type(_lfortran_list(_lfortran_list(_lfortran_list(_lfortran_list(real))))) :: arrays type(_lfortran_list(_lfortran_list(_lfortran_list(real)))) :: array type(_lfortran_list(_lfortran_list(real))) :: mat type(_lfortran_list(real)) :: vec integer:: rows, cols, i, j, k, l real:: tmp, tmp1 rows = 10 cols = 5 do i = 0, rows-1 do j = 0, cols-1 call _lfortran_list_append(vec, real(i+j)) end do call _lfortran_list_append(mat, vec) call _lfortran_clear(vec) end do do i = 0, cols-1 call _lfortran_list_append(vec, 2.0*real(i)) end do call check_mat_and_vec(mat, vec) do k = 0, rows-1 call _lfortran_list_append(array, mat) do i = 0, rows-1 do j = 0, cols-1 tmp = _lfortran_get_item(_lfortran_get_item(mat, i), j) call _lfortran_set_item(_lfortran_get_item(mat, i), j, tmp + 1.0) end do end do end do do k = 0, rows-1 do i = 0, rows-1 do j = 0, cols-1 tmp = _lfortran_get_item(_lfortran_get_item(mat, i), j) tmp1 = _lfortran_get_item(_lfortran_get_item(_lfortran_get_item(array, k), i), j) if ( abs(tmp-tmp1-real(rows-k)) > eps ) error stop end do end do end do do l=0, 2*rows-1 call _lfortran_list_append(arrays, array) do i = 0, rows-1 do j = 0, rows-1 do k = 0, cols-1 tmp = _lfortran_get_item(_lfortran_get_item(_lfortran_get_item(array, i), j), k) call _lfortran_set_item(_lfortran_get_item(_lfortran_get_item(array, i), j), k, tmp+1.0) end do end do end do end do do l=0, 2*rows-1 do i = 0, rows-1 do j = 0, rows-1 do k = 0, cols-1 tmp = _lfortran_get_item(_lfortran_get_item(_lfortran_get_item(array, i), j), k) tmp1 = _lfortran_get_item(_lfortran_get_item(_lfortran_get_item(_lfortran_get_item(arrays, l), i), j), k) if ( abs(tmp-tmp1-real(2*rows-l)) > eps ) error stop end do end do end do end do end subroutine end module program test_list_06_ use list_test_06_mod implicit none call test_list_of_lists end program lfortran-0.63.0/integration_tests/intrinsics_224.f900000664000175000017500000000170715174404631022466 0ustar alastairalastairprogram intrinsics_224 implicit none real(4) :: x1 = 1.0_4, x2 = 42.0_4 real(8) :: y1 = 1.0_8, y2 = 42.0_8 real(4), parameter :: x3 = 1.0_4, x4 = 42.0_4 real(8), parameter :: y3 = 1.0_8, y4 = 42.0_8 print*, spacing(x1) if (abs(spacing(x1) - 1.19209290E-07) > 1e-6) error stop print*, spacing(y1) if (abs(spacing(y1) - 2.2204460492503131E-016) > 1e-6) error stop print*, spacing(x2) if (abs(spacing(x2) - 3.81469727E-06) > 1e-6) error stop print*, spacing(y2) if (abs(spacing(y2) - 7.1054273576010019E-015) > 1e-6) error stop print*, spacing(x3) if ( abs(spacing(x3) - 1.19209290e-07) > 1e-6 ) error stop print*, spacing(y3) if ( abs(spacing(y3) - 2.2204460492503131e-16) > 1e-6 ) error stop print*, spacing(x4) if ( abs(spacing(x4) - 3.81469727e-06) > 1e-6 ) error stop print*, spacing(y4) if ( abs(spacing(y4) - 2.2204460492503131e-16) > 1e-6 ) error stop end programlfortran-0.63.0/integration_tests/legacy_array_sections_02.f900000664000175000017500000000113015174404631024552 0ustar alastairalastairsubroutine sub(a) double precision :: a dimension :: a(16) print *, a if (abs(a(1) - 1) > 1d-15) error stop if (abs(a(2) - 2) > 1d-15) error stop if (.not. all(abs(a(3:) - 1) < 1d-15)) error stop end subroutine program main double precision :: a(16,3) integer :: j j = 3 a = 1 a(2,3) = 2 call sub(a(1,j)) a(2,2) = 2 j = 2 call sub2(a(1,j)) contains subroutine sub2(a) real(8) :: a(16) print *, a if (abs(a(1) - 1) > 1d-15) error stop if (abs(a(2) - 2) > 1d-15) error stop if (.not. all(abs(a(3:) - 1) < 1d-15)) error stop end subroutine end program lfortran-0.63.0/integration_tests/infer_walrus_02.f900000664000175000017500000000024415174404631022706 0ustar alastairalastairprogram infer_walrus_02 implicit none x := 10 y := 2.5d0 print *, x + int(y) if (x + int(y) /= 12) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/intrinsics_173.f900000664000175000017500000000363715174404631022475 0ustar alastairalastairprogram intrinsics_171 use iso_fortran_env, only: sp => real32, dp => real64 real :: x real :: y real(dp) :: z real(dp) :: w real(sp), parameter :: x1 = fraction(178.1387e-4) real(dp), parameter :: y1 = fraction(1.01_dp) real(sp), parameter :: ar1(3) = fraction([1.1213, 2.1643, 3.613]) real(dp), parameter :: ar2(3) = fraction([1.1213_dp, 2.1643_dp, 3.613_dp]) real(sp) :: arr1(3) real(dp) :: arr2(3) arr1 = [11.90_sp, 12.00_sp, 45.09_sp] arr2 = [890.4_dp, 12.00_dp, 675.45_dp] x = 178.1387e-4 y = 1.00 z = -5.1 w = 0.0 print *, x1 if (x1 - 0.57004_sp > 1e-5) error stop print*, y1 if (y1 - 0.50500000000000000_dp > 1e-5) error stop print*, ar1 if (any(ar1 - [0.560649991_sp, 0.541074991_sp, 0.903249979_sp] > 1e-5)) error stop print*, ar2 if (any(ar2 - [0.56064999999999998_dp, 0.54107499999999997_dp, 0.90325000000000000_dp] > 1e-5)) error stop print *, fraction(x) if (fraction(x) - 0.57004 > 1e-5) error stop print *, fraction(y) if (fraction(y) - 0.50000 > 1e-5) error stop print *, fraction(z) if (fraction(z) - (-0.63749998807907104_dp) > 1e-8) error stop print *, fraction(w) if (fraction(w) - (0.0000000000000000_dp) > 1e-5) error stop print *, fraction(178.1387e-4) if (fraction(178.1387e-4) - (0.57004) > 1e-5) error stop print *, fraction(1.0) if (fraction(1.0) - (0.50000) > 1e-5) error stop print *, fraction(-5.1_dp) if (fraction(-5.1_dp) - (-0.637499988_dp ) > 1e-8) error stop print *, fraction(0.0_dp) if (fraction(0.0_dp) - (0.00000000_dp) > 1e-5) error stop print *, fraction(arr1) if (any(fraction(arr1) - [0.743749976_sp, 0.750000000_sp, 0.704531252_sp] > 1e-5)) error stop print *, fraction(arr2) if (any(fraction(arr2) - [0.86953124999999998_dp, 0.75000000000000000_dp, 0.65961914062500004_dp] > 1e-5)) error stop end program lfortran-0.63.0/integration_tests/class_138.f900000664000175000017500000000155115174404631021407 0ustar alastairalastair! Test: assigning class(child) pointer function result to type(child) pointer ! Verifies that pointer association is preserved when a function returning ! class(child), pointer is assigned to a type(child), pointer variable. module class_138_mod implicit none type :: base end type type, extends(base) :: child integer :: val = 0 end type contains function get_child(p) result(c) class(base), pointer, intent(in) :: p class(child), pointer :: c c => null() select type (p) class is (child) c => p end select end function end module program class_138 use class_138_mod implicit none type(child), target :: obj class(base), pointer :: bp type(child), pointer :: tp obj%val = 42 bp => obj tp => get_child(bp) if (.not. associated(tp)) error stop if (tp%val /= 42) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/implied_do_loops16.f900000664000175000017500000000251715174404631023402 0ustar alastairalastairprogram implied_do_loops16 implicit none character(len=*), parameter :: scr = "src/" character(len=:), allocatable :: expected(:) type :: string_t character(len=:), allocatable :: s end type string_t type(string_t), allocatable :: file_names(:) integer :: j allocate(character(len=5) :: expected(2)) expected = ["mod1 ", "mod2 "] allocate(file_names(2)) file_names(1)%s = "src/mod1" file_names(2)%s = "src/mod2" if (.not. allocated(expected)) error stop "ERROR: expected not allocated" if (.not. allocated(file_names)) error stop "ERROR: file_names not allocated" if (size(expected) /= size(file_names)) error stop & "ERROR: size mismatch between expected and file_names" do j = 1, size(expected) if (len_trim(expected(j)) == 0) error stop "ERROR: empty expected entry" if (.not. allocated(file_names(j)%s)) error stop "ERROR: unallocated file name" end do write(*,'("EXPECTED: ",*(g0:,","))') & (scr // trim(expected(j)), j=1, size(expected)) write(*,'("FOUND: ",*(g0:,","))') & (trim(file_names(j)%s), j=1, size(file_names)) do j = 1, size(expected) if (scr // trim(expected(j)) /= trim(file_names(j)%s)) then error stop "ERROR: EXPECTED and FOUND differ" end if end do end program lfortran-0.63.0/integration_tests/complex_12.f900000664000175000017500000000032715174404631021660 0ustar alastairalastairprogram main implicit none complex(8) :: k real::re,im re=3 im=4 k = cmplx(re, 0) + cmplx(0, im) print *, k if (real(k) /= 3) error stop if (aimag(k) /= 4) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_46.f900000664000175000017500000000104215174404631022170 0ustar alastairalastairprogram gpu_metal_46 ! Test: fixed-size local array inside block in do concurrent, ! using element-wise operations. Exercises the gpu_offload pass's ! block processing with array variables. implicit none integer :: x(4), i x = 0 do concurrent (i = 1:4) block integer :: a(4) a(1) = i * 5 a(2) = 0 a(3) = 0 a(4) = 0 x(i) = a(1) end block end do if (x(1) /= 5) error stop if (x(2) /= 10) error stop if (x(3) /= 15) error stop if (x(4) /= 20) error stop print *, "ok" end program gpu_metal_46 lfortran-0.63.0/integration_tests/common_22.f900000664000175000017500000000223615174404631021503 0ustar alastairalastair! Test: Multiple independent COMMON blocks in same program unit (F2018 8.10.3) ! Verifies that different named COMMON blocks have independent storage. ! Modifications to one block should not affect variables in another block. program common_22 implicit none integer :: a1, a2 real :: b1, b2 common/blk1/a1, a2 common/blk2/b1, b2 a1 = 10 a2 = 20 b1 = 1.5 b2 = 2.5 call sub_access_both() call sub_verify_independence() print *, "PASS: common_22" end program subroutine sub_access_both() implicit none integer :: x1, x2 real :: y1, y2 common/blk1/x1, x2 common/blk2/y1, y2 ! Verify both blocks accessible if (x1 /= 10) error stop "x1 should be 10" if (x2 /= 20) error stop "x2 should be 20" if (abs(y1 - 1.5) > 0.001) error stop "y1 should be 1.5" if (abs(y2 - 2.5) > 0.001) error stop "y2 should be 2.5" ! Modify both blocks x1 = 100 y1 = 10.5 end subroutine subroutine sub_verify_independence() implicit none ! Access only blk1 - should not affect blk2 integer :: p, q common/blk1/p, q if (p /= 100) error stop "p should be 100" p = 999 end subroutine lfortran-0.63.0/integration_tests/random_seed_01.f900000664000175000017500000000050015174404631022460 0ustar alastairalastairprogram random_seed_01 implicit none integer :: sz call random_seed(size=sz) if (sz <= 0) error stop "random_seed size must be positive" block integer :: vals(sz) vals = 42 call random_seed(put=vals) call random_seed(get=vals) end block end program random_seed_01 lfortran-0.63.0/integration_tests/assumed_type_04.f900000664000175000017500000000145115174404631022713 0ustar alastairalastairprogram assumed_type_04 implicit none type :: info_t integer :: offset integer :: size integer :: tag end type interface subroutine check_cfi_base_addr(a, expected_offset, expected_size, ok) bind(C) type(*), intent(in) :: a(..) integer, intent(in) :: expected_offset, expected_size integer, intent(out) :: ok end subroutine end interface type(info_t), target :: direct type(info_t), pointer :: p integer :: ok direct = info_t(42, 100, 7) call check_cfi_base_addr(direct, 42, 100, ok) if (ok /= 1) error stop "direct struct: base_addr data mismatch" allocate(p) p = info_t(42, 100, 7) call check_cfi_base_addr(p, 42, 100, ok) if (ok /= 1) error stop "pointer deref: base_addr data mismatch" deallocate(p) print *, "ok" end program lfortran-0.63.0/integration_tests/pdt_10.f900000664000175000017500000000111015174404631020765 0ustar alastairalastairmodule pdt_10_module implicit none integer, parameter :: dp = kind(0.0d0) type tensor_t(k) integer, kind :: k = dp contains procedure :: values end type tensor_t contains pure real(dp) function values(self) class(tensor_t(dp)), intent(in) :: self values = 42.0_dp end function values end module pdt_10_module program pdt_10 use pdt_10_module, only: dp, tensor_t implicit none type(tensor_t(dp)) :: inputs if (abs(inputs%values() - 42.0_dp) > 1.0e-12_dp) error stop print *, "ok" end program pdt_10 lfortran-0.63.0/integration_tests/interface_12b.f900000664000175000017500000000060115174404631022306 0ustar alastairalastairmodule interface_12b_mod implicit none type, public :: t integer :: value end type t interface get_value module procedure :: get_real end interface get_value contains subroutine get_real(self, val) class(t), intent(in) :: self real, intent(out) :: val val = real(self%value) end subroutine get_real end module interface_12b_mod lfortran-0.63.0/integration_tests/intrinsics_352.f900000664000175000017500000000155315174404631022467 0ustar alastairalastairprogram intrinsics_352 implicit none integer :: n integer :: seed_to_put(10) integer :: seed_to_get(10) integer, allocatable :: seed(:) call random_seed(size=n) allocate(seed(n)) call random_seed(get=seed) seed_to_put = [1,2,3,4,5,6, 7, 8, 9, 10] call random_seed(size=n) print *, n call random_seed(put=seed_to_put) print *, seed_to_put call random_seed(get=seed_to_get) print *, seed_to_get call init_random_seed() contains subroutine init_random_seed() INTEGER :: i, n, clock INTEGER, DIMENSION(:), ALLOCATABLE :: seed CALL RANDOM_SEED(size = n) ALLOCATE(seed(n)) CALL SYSTEM_CLOCK(COUNT=clock) seed = clock + 37 * (/ (i - 1, i = 1, n) /) CALL RANDOM_SEED(put=seed) DEALLOCATE(seed) end subroutine init_random_seed end program lfortran-0.63.0/integration_tests/bits_03.f900000664000175000017500000000177615174404631021163 0ustar alastairalastairprogram bits_03 implicit none integer(4) :: from, to integer(8) :: from8, to8 from = 10 to = 4 from8 = 10_8 to8 = 4_8 call mvbits(from, 2, 2, to, 0) if (from /= 10) error stop if (to /= 6) error stop call mvbits(from8, 2, 2, to8, 0) if (from8 /= 10) error stop if (to8 /= 6_8) error stop call mvbits(from, 0, 2, to, 2) if (from /= 10) error stop if (to /= 10) error stop call mvbits(from8, 0, 2, to8, 2) if (from8 /= 10) error stop if (to8 /= 10_8) error stop from = -20 to = 4 from8 = -20_8 to8 = 4_8 call mvbits(from, 29, 2, to, 2) if (from /= -20) error stop if (to /= 12) error stop call mvbits(from8, 29, 2, to8, 2) if (from8 /= -20) error stop if (to8 /= 12_8) error stop call mvbits(from, 2, 2, to, 29) if (from /= -20) error stop if (to /= 1610612748) error stop call mvbits(from8, 2, 2, to8, 29) if (from8 /= -20) error stop if (to8 /= 1610612748_8) error stop end programlfortran-0.63.0/integration_tests/class_114.f900000664000175000017500000000063415174404631021402 0ustar alastairalastairprogram main integer, parameter :: i = 4 select type (obj => unlimited_polymorphic(i)) type is (integer) print *, obj if (obj /= 4) error stop class default error stop end select contains function unlimited_polymorphic(i) result(res) integer, intent(in) :: i class(*), allocatable :: res res = i end function unlimited_polymorphic end program main lfortran-0.63.0/integration_tests/write_21.f900000664000175000017500000000117615174404631021346 0ustar alastairalastairprogram write_21 implicit none character :: c(6)*3 character(80) :: line data c/'ab ','cd ','ef ','gh ','ij ','kl '/ write(line, "(*(A))") 'c = "', c, '"' if (trim(line) /= 'c = "ab cd ef gh ij kl "') error stop write(*, "(*(A))") 'c = "', c, '"' c = ['ab','cd','ef','gh','ij','kl'] write(line, "(*(A))") 'c = "', c, '"' if (trim(line) /= 'c = "ab cd ef gh ij kl "') error stop write(*, "(*(A))") 'c = "', c, '"' c = ['ab ','cd ','ef ','gh ','ij ','kl '] write(line, "(*(A))") 'c = "', c, '"' if (trim(line) /= 'c = "ab cd ef gh ij kl "') error stop write(*, "(*(A))") 'c = "', c, '"' end program write_21 lfortran-0.63.0/integration_tests/abs_03.f900000664000175000017500000000021715174404631020754 0ustar alastairalastairprogram abs_03 implicit none integer :: x x = abs(2) print *, x if (x < 0) error stop x = abs(-2) print *, x if (x < 0) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_174.f900000664000175000017500000000120215174404631022250 0ustar alastairalastairprogram gpu_metal_174 ! Test: do concurrent with ubound() on a 0-based allocatable array. ! Verifies that the Metal kernel uses the correct upper bound (ubound) ! rather than the array extent (size) when the lower bound is not 1. implicit none integer, allocatable :: arr(:) integer :: results(4), i allocate(arr(0:3)) arr = [10, 20, 30, 40] results = 0 do concurrent(i = 1:ubound(arr,1)) results(i) = 1 end do if (results(1) /= 1) error stop if (results(2) /= 1) error stop if (results(3) /= 1) error stop if (results(4) /= 0) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/separate_compilation_28a.f900000664000175000017500000000026515174404631024564 0ustar alastairalastair! Common block with CHARACTER - setter subroutine subroutine set_name() implicit none character(32) :: srnamt common /srnamc/ srnamt srnamt = 'HELLO' end subroutine lfortran-0.63.0/integration_tests/read_50.f900000664000175000017500000000351315174404631021126 0ustar alastairalastairprogram read_50 implicit none integer :: n, ios real :: r character(len=20) :: str character(len=100) :: msg ! Test 1: successful read from string, iostat should be 0 ios = 999 str = "42" read(str, *, iostat=ios) n if (ios /= 0) error stop if (n /= 42) error stop ! Test 2: successful read of real from string ios = 999 str = "3.14" read(str, *, iostat=ios) r if (ios /= 0) error stop if (abs(r - 3.14) > 0.001) error stop ! Test 3: successful read from file ios = 999 open(unit=10, file="read_50_test.txt", status="replace", action="write") write(10, '(I5)') 666 close(10) open(unit=10, file="read_50_test.txt", status="old", action="read") read(10, *, iostat=ios) n close(10, status="delete") if (ios /= 0) error stop if (n /= 666) error stop ! Test 4: read error from string, iostat should be positive ios = 999 str = "abc" read(str, *, iostat=ios) n if (ios <= 0) error stop ! Test 5: successful read with iomsg, msg should not be set ios = 999 msg = "initial" str = "77" read(str, *, iostat=ios, iomsg=msg) n if (ios /= 0) error stop if (n /= 77) error stop ! Test 6: read error with iomsg, msg should contain error description ios = 999 msg = "" str = "xyz" read(str, *, iostat=ios, iomsg=msg) n if (ios <= 0) error stop if (len_trim(msg) == 0) error stop ! Test 7: successful file read with iomsg ios = 999 msg = "" open(unit=11, file="read_50_test2.txt", status="replace", action="write") write(11, '(I5)') 123 close(11) open(unit=11, file="read_50_test2.txt", status="old", action="read") read(11, *, iostat=ios, iomsg=msg) n close(11, status="delete") if (ios /= 0) error stop if (n /= 123) error stop end program read_50 lfortran-0.63.0/integration_tests/implied_do_loops8.f900000664000175000017500000000042415174404631023316 0ustar alastairalastair program implied_do_loops8 integer :: i, input(2,2) input = reshape([(i, i = 1, 4)], [2, 2]) print * , input if (input(1,1) /= 1) error stop if (input(2,1) /= 2) error stop if (input(1,2) /= 3) error stop if (input(2,2) /= 4) error stop end programlfortran-0.63.0/integration_tests/procedure_28.f900000664000175000017500000000350115174404631022205 0ustar alastairalastairmodule procedure_28_absmod implicit none type, abstract :: AbsType end type AbsType abstract interface function func_intfc(c) result(res) import :: AbsType implicit none class(AbsType), intent(in) :: c class(*), allocatable :: res end function func_intfc end interface end module procedure_28_absmod module procedure_28_typemod use procedure_28_absmod, only: AbsType, func_intfc implicit none type, public, extends(AbsType) :: MyType integer :: value contains procedure :: method end type MyType contains function method(self) result(res) class(MyType), intent(in) :: self class(*), allocatable :: res procedure(func_intfc), pointer :: func func => my_function if (.not. associated(func)) then error stop "Procedure pointer not associated" end if res = func(self) if (.not. allocated(res)) then error stop "Result was not allocated" end if end function method function my_function(c) result(res) class(AbsType), intent(in) :: c class(*), allocatable :: res select type (c) type is (MyType) allocate(res, source=c%value) class default error stop "Unsupported type passed to my_function" end select end function my_function end module procedure_28_typemod program procedure_28 use procedure_28_typemod implicit none type(MyType) :: obj class(*), allocatable :: result obj%value = 10 result = obj%method() select type (result) type is (integer) print *, "Result =", result if (result /= 10) then error stop "Unexpected result value" end if class default error stop "Unexpected result type" end select end program procedure_28 lfortran-0.63.0/integration_tests/class_19.f900000664000175000017500000000107615174404631021327 0ustar alastairalastairmodule class_19_mod implicit none type :: toml_value contains procedure :: destroy end type type :: toml_node class(toml_value), allocatable :: val end type toml_node contains subroutine destroy(self, val) class(toml_value), intent(inout) :: self integer, intent(in) :: val print *, "Destroying toml_value" if (val /= 42) error stop end subroutine end module program class_19 use class_19_mod implicit none type(toml_node) :: tmp allocate(tmp%val) call tmp%val%destroy(42) end program class_19 lfortran-0.63.0/integration_tests/common_24.f900000664000175000017500000000034015174404631021477 0ustar alastairalastairprogram common_24 implicit none integer :: info integer :: iunit common /infoc/ info, iunit info = 0 iunit = 0 call set1() call set2() if (info /= 2) error stop end program common_24 lfortran-0.63.0/integration_tests/gpu_metal_09.f900000664000175000017500000000064715174404631022201 0ustar alastairalastairprogram gpu_metal_09 ! Non-unit stride via index arithmetic implicit none integer, parameter :: n = 5000 real :: a(n), a_expected(n) integer :: i do i = 1, n a(i) = 0.0 a_expected(i) = 0.0 end do do i = 1, n / 2 a_expected(2 * i) = real(i) end do do concurrent (i = 1:n/2) a(2 * i) = real(i) end do do i = 1, n if (abs(a(i) - a_expected(i)) > 1.0e-5) error stop end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/submodule_26.f900000664000175000017500000000140315174404631022211 0ustar alastairalastairmodule submodule_26_mod implicit none private public :: grid interface module function grid(x) result(y) real(8), intent(in) :: x(:) real(8) :: y(size(x)) end function end interface contains pure function helper(x) result(y) real(8), intent(in) :: x(:) real(8) :: y(size(x)) y = x * 2d0 end function end module submodule_26_mod submodule(submodule_26_mod) submodule_26_sub implicit none contains module procedure grid y = helper(x) end procedure end submodule submodule_26_sub program submodule_26 use submodule_26_mod, only: grid implicit none real(8) :: x(3) real(8) :: y(3) x = [1d0, 2d0, 3d0] y = grid(x) if (any(y /= [2d0, 4d0, 6d0])) error stop print *, "ok" end program submodule_26 lfortran-0.63.0/integration_tests/intrinsics_429.f900000664000175000017500000000100615174404631022465 0ustar alastairalastairprogram intrinsics_429 ! Test: random_seed(put=...) must reset the RNG to the same state implicit none real :: a, b, c integer :: seed_size integer, allocatable :: seed(:) call random_seed(size=seed_size) allocate(seed(seed_size)) seed = 12345 call random_seed(put=seed) call random_number(a) call random_seed(put=seed) call random_number(b) call random_seed(put=seed) call random_number(c) if (a /= b) error stop if (b /= c) error stop end program lfortran-0.63.0/integration_tests/class_97.f900000664000175000017500000000106315174404631021331 0ustar alastairalastairmodule class_97_m implicit none type :: parent_t integer :: x = 0 end type parent_t type, extends(parent_t) :: child_t character(len=:), allocatable :: name end type child_t contains function export_child(self) result(cfg) class(child_t), intent(in) :: self type(child_t) :: cfg cfg = self end function export_child end module program class_97 use class_97_m implicit none type(child_t) :: a, b a%name = 'hello' b = export_child(a) if (len(b%name) /= 5) error stop print *, len(b%name) end program class_97 lfortran-0.63.0/integration_tests/external_12.f900000664000175000017500000000013215174404631022025 0ustar alastairalastairprogram external_12 use external_12_module2, only: inner call inner() end program lfortran-0.63.0/integration_tests/nested_vars1.f900000664000175000017500000000063515174404631022307 0ustar alastairalastairmodule nested_vars1 implicit none contains subroutine h(x) integer, intent(inout) :: x x = x + 1 call g() contains subroutine g() x = x + 1 end subroutine endsubroutine end module program nested_vars1_main use nested_vars1, only: h implicit none integer :: x x = 5 call h(x) print *, x if (x /= 7) error stop end program lfortran-0.63.0/integration_tests/arrays_op_30.f900000664000175000017500000000051315174404631022205 0ustar alastairalastairmodule arrays_op_30_mod integer, parameter :: arr(3) = [1, 2, 3] end module arrays_op_30_mod program arrays_op_30 use arrays_op_30_mod integer, parameter :: arr2(3) = [1, 2, 3] integer :: val1, val2 val1 = arr(1) if (val1 /= 1) error stop val2 = arr2(1) if (val2 /= 1) error stop end program arrays_op_30 lfortran-0.63.0/integration_tests/submodule_19a.f900000664000175000017500000000032315174404631022354 0ustar alastairalastairprogram submodule_19a use m_submodule_19 implicit none type(string_t) :: s s%s = "hello" call assign_character_to_string_t(s) if (s%s /= "hello") error stop print *, "ok" end program submodule_19a lfortran-0.63.0/integration_tests/data_06.f900000664000175000017500000000032715174404631021125 0ustar alastairalastairprogram data_06 integer illin ,ntrep common / block_1 / illin, ntrep data illin/129/, ntrep/8753/ if (illin /= 129) error stop if (ntrep /= 8753) error stop print *, illin, ntrep end program lfortran-0.63.0/integration_tests/write_05.f900000664000175000017500000000074215174404631021346 0ustar alastairalastairprogram write_05 implicit none character(24) :: s integer :: x1 = 12 integer :: x2 = 34 write(s, *) x1, x2 ! TODO Handle String formatting ! print *, "_", s, "_", x1, x2 ! if (trim(s) /= "1234") error stop x1 = x1 * x2 x2 = x1 + x2 write(s, "(i0, i0)") x1, x2 ! TODO Handle string length ! Check with GFortran to see the difference ! if (len(s) /= 24) error stop if (trim(s) /= "408442") error stop end program write_05 lfortran-0.63.0/integration_tests/gpu_metal_17.f900000664000175000017500000000051715174404631022174 0ustar alastairalastairprogram gpu_metal_17 ! Vector copy implicit none integer, parameter :: n = 100000 real :: src(n), dst(n) integer :: i do i = 1, n src(i) = real(i) * 1.5 dst(i) = 0.0 end do do concurrent (i = 1:n) dst(i) = src(i) end do do i = 1, n if (abs(dst(i) - src(i)) > 1.0e-5) error stop end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/format_78.f900000664000175000017500000000164615174404631021522 0ustar alastairalastairprogram format_78 implicit none character(len=10) :: dec character(len=20) :: str real :: x, y integer :: ios x = 3.14 ! Open file with decimal comma mode open(unit=10, file="test.txt", status="replace", & decimal="comma", form="formatted", action="readwrite") ! Write value write(10, '(F6.2)') x ! Check decimal mode inquire(unit=10, decimal=dec) if (trim(dec) /= "COMMA") then print *, "FAIL: decimal mode is ", trim(dec) error stop end if ! Rewind to read back rewind(10) ! Read as string read(10, '(A)', iostat=ios) str if (ios /= 0) then print *, "FAIL: could not read string" error stop end if ! Check if comma is present if (index(str, ",") == 0) then print *, "FAIL: comma not found in written output:", trim(str) error stop end if close(10) end program format_78 lfortran-0.63.0/integration_tests/string_04.f900000664000175000017500000000104315174404631021514 0ustar alastairalastairprogram string_04 implicit none character(len = 40), allocatable :: user_data(:) character, allocatable :: greetings(:) character(len=:), allocatable :: str allocate(user_data(3)) user_data(1) = 'Mr. ' user_data(2) = 'Rowan ' user_data(3) = 'Atkinson' allocate(greetings(5)) greetings(1) = 'h' greetings(2) = 'e' greetings(3) = 'l' greetings(4) = 'l' greetings(5) = 'o' print *, 'Here is ', user_data(1), user_data(2), user_data(3) print *, greetings allocate(character(len=8)::str) str = 'abcd' if (len(str(2:)) /= 3) error stop end program lfortran-0.63.0/integration_tests/associate_28.f900000664000175000017500000000073515174404631022176 0ustar alastairalastairmodule associate_28_mod abstract interface subroutine factory() end subroutine factory end interface contains subroutine client(val) procedure(factory), pointer, intent(out) :: val val => null() end subroutine client end module associate_28_mod program associate_28 use associate_28_mod implicit none procedure(factory), pointer :: p call client(p) if (associated(p)) error stop print *, "ok" end program associate_28 lfortran-0.63.0/integration_tests/read_39.f900000664000175000017500000000526115174404631021137 0ustar alastairalastairprogram read_39 implicit none integer(4) :: n32, ios integer(8) :: n64 real(4) :: r32 real(8) :: r64 complex(4) :: c32 complex(8) :: c64 character(3) :: bad_input = 'BAD' character(3) :: int_str = '666' character(20) :: long_str ! ===== integer(4) tests ===== read(bad_input, *, iostat=ios) n32 if (ios <= 0) error stop "Test 1 failed: iostat should be positive for bad i32 input" read(int_str, *, iostat=ios) n32 if (ios /= 0) error stop "Test 2 failed: iostat should be 0 for valid i32 input" if (n32 /= 666) error stop "Test 2 failed: n32 should be 666" ! ===== integer(8) tests ===== read(bad_input, *, iostat=ios) n64 if (ios <= 0) error stop "Test 3 failed: iostat should be positive for bad i64 input" long_str = '9876543210' read(long_str, *, iostat=ios) n64 if (ios /= 0) error stop "Test 4 failed: iostat should be 0 for valid i64 input" if (n64 /= 9876543210_8) error stop "Test 4 failed: n64 value mismatch" ! ===== real(4) tests ===== read(bad_input, *, iostat=ios) r32 if (ios <= 0) error stop "Test 5 failed: iostat should be positive for bad f32 input" long_str = '3.14' read(long_str, *, iostat=ios) r32 if (ios /= 0) error stop "Test 6 failed: iostat should be 0 for valid f32 input" if (abs(r32 - 3.14) > 0.01) error stop "Test 6 failed: r32 value mismatch" ! ===== real(8) tests ===== read(bad_input, *, iostat=ios) r64 if (ios <= 0) error stop "Test 7 failed: iostat should be positive for bad f64 input" long_str = '3.14159265358979' read(long_str, *, iostat=ios) r64 if (ios /= 0) error stop "Test 8 failed: iostat should be 0 for valid f64 input" if (abs(r64 - 3.14159265358979d0) > 1.0d-10) error stop "Test 8 failed: r64 value mismatch" ! ===== complex(4) tests ===== read(bad_input, *, iostat=ios) c32 if (ios <= 0) error stop "Test 9 failed: iostat should be positive for bad c32 input" long_str = '(1.5, 2.5)' read(long_str, *, iostat=ios) c32 if (ios /= 0) error stop "Test 10 failed: iostat should be 0 for valid c32 input" if (abs(real(c32) - 1.5) > 0.01) error stop "Test 10 failed: c32 real part mismatch" if (abs(aimag(c32) - 2.5) > 0.01) error stop "Test 10 failed: c32 imag part mismatch" ! ===== complex(8) tests ===== read(bad_input, *, iostat=ios) c64 if (ios <= 0) error stop "Test 11 failed: iostat should be positive for bad c64 input" long_str = '(1.5d0, 2.5d0)' read(long_str, *, iostat=ios) c64 if (ios /= 0) error stop "Test 12 failed: iostat should be 0 for valid c64 input" if (abs(real(c64) - 1.5d0) > 1.0d-10) error stop "Test 12 failed: c64 real part mismatch" if (abs(aimag(c64) - 2.5d0) > 1.0d-10) error stop "Test 12 failed: c64 imag part mismatch" end program read_39 lfortran-0.63.0/integration_tests/functions_57.f900000664000175000017500000000073415174404631022234 0ustar alastairalastairprogram functions_57 implicit none integer, parameter :: keys(16) = & [503, 87, 512, 61, 908, 170, 897, 275, & 653, 426, 154, 509, 612, 677, 765, 703 ] integer, allocatable :: results(:) results = copy(keys) if (size(results) /= 16) error stop if (results(1) /= 503) error stop if (results(16) /= 703) error stop contains function copy(a) integer, intent(in) :: a(:) integer :: copy(size(a)) copy = a end function end program lfortran-0.63.0/integration_tests/separate_compilation_class_star_02a.f900000664000175000017500000000153115174404631026767 0ustar alastairalastairmodule separate_compilation_class_star_02_mod type, abstract :: AbsGetter contains procedure(get), deferred :: get end type AbsGetter abstract interface function get(self, key) result(res) import class(AbsGetter), intent(in) :: self character(*), intent(in) :: key class(*), allocatable :: res end function get end interface type, abstract :: AbsType end type AbsType type :: MyType class(AbsType), allocatable :: ob end type MyType contains function create(c) result(res) class(AbsGetter), intent(in) :: c class(*), allocatable :: res select type( obj => c%get("AbsType") ) class is (AbsType) res = MyType(obj) end select end function create end module separate_compilation_class_star_02_mod lfortran-0.63.0/integration_tests/abs_02.f900000664000175000017500000000030015174404631020744 0ustar alastairalastairprogram abs_02 use iso_fortran_env, only: dp=>real64 implicit none real(dp) :: x x = abs(1.5_dp) print *, x if (x < 0) error stop x = abs(-1.5_dp) print *, x if (x < 0) error stop end program lfortran-0.63.0/integration_tests/class_67.f900000664000175000017500000000171015174404631021325 0ustar alastairalastairmodule class_67_mod implicit none type :: other_type class(*), allocatable :: value end type other_type contains subroutine copy_other(src, dest) type(other_type), intent(in) :: src type(other_type), intent(out) :: dest allocate(dest%value, source=src%value) end subroutine copy_other end module class_67_mod program class_67 use class_67_mod, only : copy_other, other_type implicit none type :: dummy_type integer :: val(15) end type dummy_type type(other_type) :: other_in, other_out type(dummy_type) :: dummy_val integer :: i dummy_val%val = [(i, i=1,15)] allocate(other_in%value, source=dummy_val) call copy_other(other_in, other_out) ! TODO: (Issue 8645) Handle class(*) in allocate ! select type(p => other_out%value) ! type is (dummy_type) ! if (p%val(1) /= 1 .or. p%val(15) /= 15) error stop ! end select end program class_67 lfortran-0.63.0/integration_tests/derived_types_20_module2.f900000664000175000017500000000035115174404631024502 0ustar alastairalastairmodule M_CLI2_20 implicit none contains elemental impure function specified(key) character(len=*),intent(in) :: key logical :: specified specified=.false. end function specified end module M_CLI2_20 lfortran-0.63.0/integration_tests/char_array_indexing.f900000664000175000017500000000067015174404631023710 0ustar alastairalastairprogram character_array_indexing character(len=2), dimension(2) :: b character(len=2), dimension(2) :: a b(1) = "xi" b(2) = "xp" if (len(b(2:1:-2)) /= 2) error stop if (size(b(2:1:-2)) /= 1) error stop a(1:2) = b(1:2) if (a(1) /= "xi") error stop if (a(2) /= "xp") error stop a(1:2) = b(2:1:-1) if (a(1) /= "xp") error stop if (a(2) /= "xi") error stop end program character_array_indexing lfortran-0.63.0/integration_tests/separate_compilation_26a.f900000664000175000017500000000113115174404631024553 0ustar alastairalastairmodule quadrature_separate_compilation_26 implicit none interface gauss_legendre pure module subroutine gauss_legendre_fp64 (i) integer, intent(inout) :: i end subroutine end interface gauss_legendre end module quadrature_separate_compilation_26 module specialfunctions_separate_compilation_26 implicit none interface legendre pure elemental module function legendre_fp64(n) result(leg) integer, intent(in) :: n integer :: leg end function end interface end module specialfunctions_separate_compilation_26lfortran-0.63.0/integration_tests/precision_02.f900000664000175000017500000000032215174404631022176 0ustar alastairalastairprogram precision_02 integer, parameter :: dp = kind(0.d0) real(dp) :: x, x1 x1 = 1.1_dp x = 1.1 - x1 print *, x if (abs(x - 2.3841857821338408E-008) > 1D-10) error stop end program lfortran-0.63.0/integration_tests/derived_types_68.f900000664000175000017500000000121115174404631023063 0ustar alastairalastairmodule derived_types_68_mod type :: version_t integer :: major contains generic :: operator(==) => equals procedure, private :: equals end type version_t contains logical function equals(a, b) class(version_t), intent(in) :: a, b equals = a%major == b%major end function equals end module derived_types_68_mod program derived_types_68 use derived_types_68_mod, only: version_t type :: new_type type(version_t) :: version end type new_type type(new_type) :: obj1, obj2 obj1%version%major = 1 obj2%version%major = 5 if (obj1%version == obj2%version) error stop end programlfortran-0.63.0/integration_tests/allocated_05.f900000664000175000017500000000064615174404631022147 0ustar alastairalastairmodule node_mod type :: dependency_config_t integer, allocatable :: arr(:) end type dependency_config_t type, extends(dependency_config_t) :: dependency_node_t end type dependency_node_t end module node_mod program demo use node_mod implicit none type(dependency_node_t), allocatable :: a, b allocate(a, b) b = a print *, allocated(b%arr) if (allocated(b%arr)) error stop end program demo lfortran-0.63.0/integration_tests/intrinsics_371.f900000664000175000017500000000047415174404631022471 0ustar alastairalastairprogram intrinsics_371 implicit none type :: stone integer :: value = 0 end type stone type(stone),dimension(:),allocatable :: s integer :: val , iloc allocate(s(0)) val = 1 iloc = findloc(s%value, val, dim=1) print * , iloc if (iloc /= 0) error stop end programlfortran-0.63.0/integration_tests/intrinsics_202.f900000664000175000017500000000071315174404631022456 0ustar alastairalastairprogram intrinsics_202 integer, parameter :: dp = kind(0.d0) real(dp), parameter :: A(*) = [1._dp, 2._dp, 3._dp] real(dp), parameter :: B(*) = A real(dp), parameter :: C(*) = sin(A) print *, B if (any(A /= B)) error stop print *, C if (abs(C(1) - 8.41470984807896505e-01) > 1e-5) error stop if (abs(C(2) - 9.09297426825681727e-01) > 1e-5) error stop if (abs(C(3) - 0.14112000805986721) > 1e-5) error stop end program lfortran-0.63.0/integration_tests/template_add_01.f900000664000175000017500000000265115174404631022634 0ustar alastairalastairmodule template_add_01_m implicit none private public :: add_t, test_template requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = F(x, y) end function end template contains real function func_arg_real(x, y) result(z) real, intent(in) :: x, y z = x + y end function integer function func_arg_int(x, y) result(z) integer, intent(in) :: x, y z = x + y end function subroutine test_template() instantiate add_t(real, func_arg_real), only: add_real => add_generic real :: x, y integer :: a, b x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) if (abs(add_real(x, y) - 12.3) > 1e-5) error stop instantiate add_t(integer, func_arg_int), only: add_integer => add_generic a = 5 b = 9 print*, "The result is ", add_integer(a, b) if (add_integer(a, b) /= 14) error stop end subroutine end module program template_add_01 use template_add_01_m implicit none call test_template() end program lfortran-0.63.0/integration_tests/arrays_99.f900000664000175000017500000000032215174404631021524 0ustar alastairalastair!Test global array of strings module arrays_99_mod character(10) :: arr(2) end module program arrays_99 use arrays_99_mod arr(1) = "aa" print *, arr(1) if(arr(1) /= "aa") error stop end programlfortran-0.63.0/integration_tests/pointer_08.f900000664000175000017500000000102415174404631021671 0ustar alastairalastairprogram pointer_08 ! Test logical array pointer initialized to null() ! Verifies that declaring a logical pointer array with => null() ! compiles and runs correctly. implicit none logical, pointer :: p(:) => null() logical, pointer :: q(:,:) => null() logical(1), pointer :: r(:) => null() logical(4), pointer :: s(:) => null() if (associated(p)) error stop if (associated(q)) error stop if (associated(r)) error stop if (associated(s)) error stop print *, "All tests passed." end program pointer_08 lfortran-0.63.0/integration_tests/operator_overloading_15.f900000664000175000017500000000216115174404631024436 0ustar alastairalastairmodule operator_overloading_15_mod type :: string_t character(len=:), allocatable :: str end type interface operator(==) module procedure string_array_equal module procedure string_equal end interface contains logical function string_array_equal(a, b) type(string_t), intent(in) :: a(:), b(:) integer :: i string_array_equal = .true. do i = 1, size(a) if (a(i)%str /= b(i)%str) then string_array_equal = .false. return end if end do end function logical function string_equal(a, b) type(string_t), intent(in) :: a, b integer :: i string_equal = (a%str == b%str) end function end module operator_overloading_15_mod program operator_overloading_15 use operator_overloading_15_mod type(string_t), allocatable, target :: a(:), b(:) type(string_t), pointer :: a2(:), b2(:) type(string_t), allocatable :: x, y allocate(a(1), b(1)) allocate(x, y) a(1)%str = "Hello" b(1)%str = "HelloWorld" x%str = "Hello" y%str = "HelloWorld" a2 => a b2 => b if (a == b) error stop if (x == y) error stop if (a2 == b2) error stop end programlfortran-0.63.0/integration_tests/pointer_05.f900000664000175000017500000000175015174404631021674 0ustar alastairalastair! Handle Pointers Association from polymorphic variables ! to explicit-typed pointers in Select Type Statements program pointer_05 implicit none ! Declare an unlimited polymorphic pointer class(*), pointer :: ptr integer, target :: i = 42 real, target :: r = 5.5 ptr => i select type (p => ptr) type is (integer) print *, "Integer=", p if (p /= 42) error stop p = 52 type is (real) print *, "Real=", p if (abs(p - 5.5) > 1e-6) error stop p = 6.5 class default print *, "Unknown" error stop end select ptr => r select type (p => ptr) type is (integer) print *, "Integer=", p if (p /= 42) error stop p = 52 type is (real) print *, "Real=", p if (abs(p - 5.5) > 1e-6) error stop p = 6.5 class default print *, "Unknown" error stop end select print *, r print *, i if (abs(r - 6.5) > 1e-6) error stop if (i /= 52) error stop end program pointer_05lfortran-0.63.0/integration_tests/string_55.f900000664000175000017500000000033715174404631021527 0ustar alastairalastairprogram string_55 character(len=20) :: str = 'gfortran ' str = adjustr(str) print *, str print "(a)", str ! 12 EMPTY CHARACTERS + "gfortran" if(str /= " gfortran") error stop end programlfortran-0.63.0/integration_tests/intrinsics_165.f900000664000175000017500000000076515174404631022475 0ustar alastairalastairfunction temp(x, dim) result(res) real, intent(in) :: x(:) integer, intent(in) :: dim real :: res res = sum(x, 1) end function program intrinsics_165 real :: a(4) interface function temp(x, dim) result(res) real, intent(in) :: x(:) integer, intent(in) :: dim real :: res end function end interface a = [1.0, 2.0, 3.0, 4.0] print *, temp(a, 1) if (abs(temp(a, 1) - sum(a, 1)) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/modules_33.f900000664000175000017500000000027615174404631021667 0ustar alastairalastairmodule fpm_cmd_install use fpm_modules_33, only : build_model implicit none end module fpm_cmd_install program modules_33 implicit none print *, "running modules_33 program" end program lfortran-0.63.0/integration_tests/class_39.f900000664000175000017500000000264515174404631021334 0ustar alastairalastairmodule class_39_mod type :: AbsNestedType contains procedure :: abs_nested_method end type AbsNestedType type, public :: AbsType class(AbsNestedType), allocatable :: nested_obj contains procedure :: abs_method end type AbsType type :: Wrapper class(AbsType), allocatable :: obj type(AbsType) :: t_obj end type Wrapper type :: Client type(Wrapper) :: wrapped contains procedure :: caller end type Client contains subroutine caller(self) class(Client), intent(in) :: self type(Client) :: type_s call self%wrapped%obj%abs_method(42) call self%wrapped%obj%nested_obj%abs_nested_method(101) call type_s%wrapped%t_obj%abs_method(42) end subroutine caller subroutine abs_method(self, val) class(AbsType), intent(in) :: self integer, intent(in) :: val print *, "abs_method called" if (val /= 42) error stop end subroutine abs_method subroutine abs_nested_method(self, val) class(AbsNestedType), intent(in) :: self integer, intent(in) :: val print *, "abs_nested_method called" if (val /= 101) error stop end subroutine abs_nested_method end module class_39_mod program class_39 use class_39_mod class(Client), allocatable :: var allocate(var) allocate(var%wrapped%obj) allocate(var%wrapped%obj%nested_obj) call var%caller() end program class_39lfortran-0.63.0/integration_tests/modules_44.f900000664000175000017500000000145015174404631021664 0ustar alastairalastairmodule modules_44_fpm_cmd_new use modules_44_module_fpm_filesystem, only : warnwrite implicit none type, abstract :: fpm_cmd_settings character(len=:), allocatable :: working_dir end type type, extends(fpm_cmd_settings) :: fpm_new_settings character(len=:), allocatable :: name end type contains subroutine cmd_new(settings) type(fpm_new_settings), intent(in) :: settings character(len=:), allocatable :: littlefile(:) littlefile = [character(len=80) :: '# ', 'My cool new project!'] call warnwrite(settings%name, littlefile) ! call warnwrite(settings%name, littlefile) end subroutine cmd_new end module modules_44_fpm_cmd_new program modules_44 use modules_44_fpm_cmd_new implicit none type(fpm_new_settings) :: settings call cmd_new(settings) end program modules_44 lfortran-0.63.0/integration_tests/intrinsics_274.f900000664000175000017500000000246415174404631022474 0ustar alastairalastairprogram intrinsics_274 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real :: x = 3.143 real(dp) :: y = 2.33 real(sp), parameter :: r1 = epsilon(1._sp) real(dp), parameter :: r2 = epsilon(67._dp) real(sp), parameter :: ar1 = epsilon([11.3_sp, 1.7_sp, 0.0_sp]) real(dp), parameter :: ar2 = epsilon([11.3_dp, 1.7_dp, 0.0_dp]) real(sp) :: arr1(3) = [11.3_sp, 1.7_sp, 0.0_sp] real(dp) :: arr2(3) = [19.3_dp, 3.7_dp, 0.0_dp] print *, r1 if (abs(r1 - 1.19209290E-07) > 1e-6) error stop print *, r2 if (abs(r2 - 2.2204460492503131E-016_dp) > 1e-12_dp) error stop print *, ar1 if (abs(ar1 - 1.19209290E-07) > 1e-6) error stop print *, ar2 if (abs(ar2 - 2.2204460492503131E-016_dp) > 1e-12_dp) error stop print *, epsilon(x) if (abs(epsilon(x) - 1.19209290E-07) > 1e-6) error stop print *, epsilon(y) if (abs(epsilon(y) - 2.2204460492503131E-016_dp) > 1e-12_dp) error stop print *, epsilon(1._dp) ** 0.5 !Part of Minpack if (abs((epsilon(1._dp) ** 0.5_dp) - 1.4901161193847656E-008_dp) > 1e-12_dp) error stop print *, epsilon(arr1) if (abs(epsilon(arr1) - 1.19209290E-07) > 1e-6) error stop print *, epsilon(arr2) if (abs(epsilon(arr2) - 2.2204460492503131E-016_dp) > 1e-12_dp) error stop end programlfortran-0.63.0/integration_tests/read_48.f900000664000175000017500000000134315174404631021134 0ustar alastairalastairmodule read_48_m implicit none type :: t integer :: x end type interface read(unformatted) module procedure :: read_unf end interface contains subroutine read_unf(dt, unit, iostat, iomsg) class(t), intent(inout) :: dt integer, intent(in) :: unit integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg read(unit, iostat=iostat, iomsg=iomsg) dt%x end subroutine end module program read_48 use read_48_m implicit none type(t) :: s integer :: io open(newunit=io, form="unformatted", status="scratch") write(io) 42 rewind(io) read(io) s close(io) print *, s%x if (s%x /= 42) error stop end program lfortran-0.63.0/integration_tests/derived_types_59.f900000664000175000017500000000052515174404631023072 0ustar alastairalastairmodule derived_types_59_m implicit none type inside integer :: m = 0 end type inside type wrapper type(inside) :: i = inside() end type end module program derived_types_59 use derived_types_59_m implicit none type(wrapper) :: w w = wrapper() if (w%i%m /= 0) error stop end program lfortran-0.63.0/integration_tests/array_section_18b.f900000664000175000017500000000054215174404631023222 0ustar alastairalastairrecursive subroutine double_diag(n, v, ldv) implicit none integer, intent(in) :: n, ldv real, intent(inout) :: v(ldv, *) integer :: half if (n <= 1) then v(1, 1) = v(1, 1) * 2.0 return end if half = n / 2 call double_diag(half, v, ldv) call double_diag(n - half, v(half+1, half+1), ldv) end subroutine lfortran-0.63.0/integration_tests/custom_operator_02.f900000664000175000017500000000113415174404631023432 0ustar alastairalastairmodule custom_operator_02_a implicit none public :: operator(.negation.) interface operator(.negation.) module procedure negative end interface contains function negative(i) result(res) integer, intent(in) :: i integer :: res res = -i end function negative end module custom_operator_02_a module custom_operator_02_b integer :: negation = 5 end module custom_operator_02_b program custom_operator_02 use custom_operator_02_b use custom_operator_02_a implicit none integer :: res, x x = 10 res = .negation. x print *, res end program custom_operator_02 lfortran-0.63.0/integration_tests/struct_type_02.f900000664000175000017500000000023215174404631022570 0ustar alastairalastairprogram struct_type_02 type :: struct real :: field = 5.0 end type struct type(struct) :: array(3) print*, array(:)%field end programlfortran-0.63.0/integration_tests/complex_mul_test.f900000664000175000017500000000020515174404631023265 0ustar alastairalastairprogram complex2 complex :: x x = (3.0, 4.0) x = x * 4.0 print *, x x = 2 * x print *, x x = (x * (0.0, 3.0)) print *, x end program lfortran-0.63.0/integration_tests/string_68.f900000664000175000017500000000043315174404631021530 0ustar alastairalastairprogram string_68 character(len=5) :: string = "hello" integer :: x = 1 character(1) :: arr(3) print *, ["aa", string(x+1:x+2), "baa"] arr = ["aa", string(x+1:x+2), "baa"] print *,arr if(any(arr /= ["a", "e", "b"])) error stop end program string_68lfortran-0.63.0/integration_tests/recursion_01.f900000664000175000017500000000066415174404631022224 0ustar alastairalastairmodule recursion_01 integer:: n integer:: x = 0 contains recursive subroutine sub1(x) integer,intent(inout):: x if (x < n) then x = x + 1 print *, 'x = ', x call sub2() call sub1(x) end if contains subroutine sub2() x = x + 1 print *, x call sub1(x) end subroutine sub2 end subroutine sub1 end module recursion_01 program main use recursion_01 n = 10 call sub1(x) end program main lfortran-0.63.0/integration_tests/verify_intent_external_01.f900000664000175000017500000000056215174404631024777 0ustar alastairalastairprogram verify_intent_external_01 use data_mod, only: global_count, global_values use worker_mod, only: do_work implicit none call do_work() if (global_count /= 5) error stop if (abs(global_values(1) - 10.0) > 1.0e-6) error stop if (abs(global_values(5) - 50.0) > 1.0e-6) error stop print *, "ok" end program verify_intent_external_01 lfortran-0.63.0/integration_tests/associate_38.f900000664000175000017500000000116615174404631022176 0ustar alastairalastair! Test: associate with array section of a derived-type member. ! Regression: EXPR2VAR assumed ArraySection base is Var_t, but ! workspace%tmp(:,1) yields a StructInstanceMember_t base. program associate_38 implicit none type :: workspace_type real, allocatable :: tmp(:,:) end type type(workspace_type) :: workspace allocate(workspace%tmp(3,2)) workspace%tmp = 0.0 associate(R => workspace%tmp(:,1)) R = 1.0 end associate if (any(abs(workspace%tmp(:,1) - 1.0) > 1e-6)) error stop if (any(abs(workspace%tmp(:,2) - 0.0) > 1e-6)) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/select_type_02.f900000664000175000017500000000204015174404631022522 0ustar alastairalastairmodule derived_type_collection implicit none type point real :: x, y end type point end module derived_type_collection program select_type_02 use derived_type_collection implicit none type, extends(point) :: point_3d real :: z end type point_3d type, extends(point) :: color_point integer :: color end type color_point type(point), target :: p type(point_3d), target :: p3d type(color_point), target :: cp class(point), pointer :: p_or_cp p%x = 1.0 p%y = 2.0 p3d%x = 3.0 p3d%y = 4.0 p3d%z = 5.0 cp%x = 6.0 cp%y = 7.0 cp%color = 8 p_or_cp => cp select type ( an => p_or_cp ) class is ( point ) print *, "point: ", an%x, an%y type is ( color_point ) print *, "color_point: ", an%x, an%y, an%color end select ! select type ( an => p_or_cp ) ! class is ( point ) ! print *, "point: ", an%x, an%y ! type is ( point_3d ) ! print *, "point3d: ", an%x, an%y, an%z ! end select end program select_type_02 lfortran-0.63.0/integration_tests/submodule_23c.f900000664000175000017500000000022715174404631022354 0ustar alastairalastairsubmodule(submodule_23_mod) submodule_23_sub implicit none contains module procedure check found = size(args) > 0 end procedure end submodulelfortran-0.63.0/integration_tests/specfun_01.f900000664000175000017500000000211015174404631021642 0ustar alastairalastairsubroutine rcty_(n,x) implicit double precision (a-h,o-z) dimension ry(0:n),dy(0:n) nm=n if (x.lt.1.0d-60) then do 10 k=0,n ry(k)=-1.0d+300 10 dy(k)=1.0d+300 ry(0)=-1.0d0 dy(0)=0.0d0 return endif ry(0)=-dcos(x) ry(1)=ry(0)/x-dsin(x) rf0=ry(0) rf1=ry(1) do 15 k=2,n rf2=(2.0d0*k-1.0d0)*rf1/x-rf0 if (dabs(rf2).gt.1.0d+300) go to 20 ry(k)=rf2 rf0=rf1 15 rf1=rf2 20 nm=k-1 dy(0)=dsin(x) do 25 k=1,nm 25 dy(k)=-k*ry(k)/x+ry(k-1) if (abs(ry(0) - (-0.98006657784124163)) > 1e-7) error stop if (abs(ry(1) - (-5.0990022200012692)) > 1e-6) error stop if (abs(ry(2) - (-75.504966722177798)) > 1e-6) error stop if (abs(dy(0) - (0.19866933079506122)) > 1e-8) error stop if (abs(dy(1) - (24.514944522165102)) > 1e-6) error stop if (abs(dy(2) - (749.95066500177666)) > 1e-4) error stop if (nm /= 2) error stop print *, "ry = ", ry print *, "dy = ", dy print *, "nm = ", nm return end program specfun_01 implicit double precision (a-h,o-z) call rcty_(2, 0.2d0) end program lfortran-0.63.0/integration_tests/sign_from_value.f900000664000175000017500000000220515174404631023063 0ustar alastairalastairprogram flip_sign implicit none real :: rxsp = 5.5, epsrsp = 1e-6 real(8) :: rxdp = 5.5, epsrdp = 1e-6 integer :: ixsp = 5, epsisp = 16 integer(8) :: ixdp = 5, epsidp = 16 integer :: a=2, b=-3, c real :: x=-2, y=-3, z, arr(5) rxsp = rxsp * sign(1._4, epsrsp) print *, rxsp if (abs(rxsp - 5.5) > epsrsp) error stop rxsp = rxsp * sign(1._4, -epsrsp) print *, rxsp if (abs(rxsp + 5.5) > epsrsp) error stop rxdp = rxdp * sign(1._8, epsrdp) print *, rxdp if (abs(rxdp - 5.5) > epsrdp) error stop ixsp = ixsp * sign(1_4, epsisp) print *, ixsp if (ixsp /= 5) error stop rxdp = rxdp * sign(1._8, -epsrdp) print *, rxdp if (abs(rxdp + 5.5) > epsrdp) error stop ixdp = ixdp * sign(1_8, epsidp) ! Test that we don't apply sign opt. on integers. print *, ixdp if (ixdp /= 5) error stop c = a*sign(1, b) ! Test that we don't apply sign opt. on integers. print *, c if(c /= -2) error stop arr = [1.0, 2.0, 3.0, 4.0, 5.0] z = arr(int(x*sign(1.0,y), 4)) ! Test nested `sign` expression print *, z if(z /= arr(2)) error stop end program lfortran-0.63.0/integration_tests/intrinsics_158.f900000664000175000017500000000442715174404631022476 0ustar alastairalastairprogram intrinsics_158 logical, parameter :: l1 = bge(10, 5) logical, parameter :: l2 = bge(10_8, -5_8) integer:: k1 = 10 integer:: k2 = 5 integer:: k3 = -5 integer:: k4 = 15 integer:: k5 = 0 integer:: k6 = -15 logical:: t = .true. logical, parameter :: ar1(4) = bge([1, 2, 4, 5], 3) logical, parameter :: ar2(4) = bge([-1, 3, -7, 5], -3) integer :: arr1(4) integer :: arr2(3) logical :: res(3) arr1 = [11, 2, 13, 4] arr2 = [-5_8, 7_8, 0_8] print *, l1 if (l1 .neqv. .true.) error stop print *, l2 if (l2 .neqv. .false.) error stop print *, ar1 if (any(ar1) .neqv. .true.) error stop print *, ar2 if (any(ar2) .neqv. .true.) error stop print*, bge(10, 5) if (bge(10, 5) .neqv. .true.) error stop print*, bge(-5, 10) if (bge(-5, 10) .neqv. .True.) error stop print*, bge(-5, 5) if (bge(-5, 5) .neqv. .true.) error stop print*, bge(-5, -15) if (bge(-5, -15) .neqv. .true.) error stop print*, bge(5, 15) if (bge(5, 15) .neqv. .false.) error stop print*, bge(5, -15) if (bge(5, -15) .neqv. .false.) error stop print*, bge(0, -5) if (bge(0, -5) .neqv. .false.) error stop print*, bge(0, 5) if (bge(0, 5) .neqv. .false.) error stop print*, bge(-5, 0) if (bge(-5, 0) .neqv. .true.) error stop print*, bge(5, 0) if (bge(5, 0) .neqv. t) error stop print*, bge(k1, k2) if (bge(k1, k2) .neqv. .true.) error stop print*, bge(k3, k1) if (bge(k3, k1) .neqv. .true.) error stop print*, bge(k3, k3) if (bge(k3, k3) .neqv. .true.) error stop print*, bge(k3, k6) if (bge(k3, k6) .neqv. .true.) error stop print*, bge(k2, k4) if (bge(k2, k4) .neqv. .false.) error stop print*, bge(k2, k6) if (bge(k2, k6) .neqv. .false.) error stop print*, bge(k5, k3) if (bge(k5, k3) .neqv. .false.) error stop print*, bge(k5, k2) if (bge(k5, k2) .neqv. .false.) error stop print*, bge(k3, k5) if (bge(k3, k5) .neqv. .true.) error stop print*, bge(k2, k5) if (bge(k2, k5) .neqv. t) error stop print *, bge(arr1, 5) if (any(bge(arr1, 5) .neqv. .true.) .neqv. .true.) error stop res = bge(arr2, k5) print *, res if (any(res .neqv. .true.) .neqv. .false.) error stop end programlfortran-0.63.0/integration_tests/data_05.f900000664000175000017500000000043015174404631021117 0ustar alastairalastairSUBROUTINE ITAIRY() IMPLICIT DOUBLE PRECISION (A-H,O-Z) DIMENSION A(2) DATA A/.569444444444444D0,.891300154320988D0/ print *, A(1), A(2) IF (A(1) /= .569444444444444D0) ERROR STOP IF (A(2) /= .891300154320988D0) ERROR STOP RETURN END PROGRAM MAIN CALL ITAIRY() END PROGRAM lfortran-0.63.0/integration_tests/gpu_metal_66.f900000664000175000017500000000111215174404631022170 0ustar alastairalastairprogram gpu_metal_66 ! Test: do concurrent calling a contained function that itself calls ! another contained function. The gpu_offload pass must transitively ! duplicate both functions into the kernel scope. implicit none real :: y(4) integer :: i do concurrent(i=1:4) y(i) = f(real(i)) end do do i = 1, 4 if (abs(y(i) - real(i)) > 1.0e-6) error stop end do print *, "ok" contains pure real function g(x) real, intent(in) :: x g = x end function pure real function f(x) real, intent(in) :: x f = g(x) end function end program lfortran-0.63.0/integration_tests/do_concurrent_02.f900000664000175000017500000000052415174404631023053 0ustar alastairalastair! equivalent of openmp_01.f90 subroutine omp_func(n) implicit none integer, intent(in) :: n integer :: i do concurrent (i = 1:n) shared(n) print *, "xyz" end do print *, "n = ", n if (n /= 100) error stop end subroutine program do_concurrent_02 integer, parameter :: n = 100 call omp_func(n) print *, "Done for n = ", n end program lfortran-0.63.0/integration_tests/arrays_40.f900000664000175000017500000000125015174404631021507 0ustar alastairalastairprogram arrays_40 implicit none real(4), dimension(2) :: z z = foo_sp_arr() print *, z if( any(z /= [2.0_4, -2.0_4]) ) error stop contains function foo_sp_arr(x) result(z) real(4), dimension(2), intent(in), optional :: x real(4), dimension(2) :: z z = optval_rsp(x, [2.0_4, -2.0_4]) end function foo_sp_arr pure elemental function optval_rsp(x, default) result(y) real(4), intent(in), optional :: x real(4), intent(in) :: default real(4) :: y if (present(x)) then y = x else y = default end if end function optval_rsp end program arrays_40 lfortran-0.63.0/integration_tests/pdt_11.f900000664000175000017500000000037015174404631020775 0ustar alastairalastairprogram pdt_11 use pdt_11_module, only: dp, tensor_t implicit none type(tensor_t(dp)) :: inputs_dp real(dp) :: value_dp value_dp = inputs_dp%values() if (abs(value_dp - 42.0_dp) > 1.0e-12_dp) error stop end program pdt_11 lfortran-0.63.0/integration_tests/arrays_64.f900000664000175000017500000000016515174404631021521 0ustar alastairalastairprogram array_64 integer :: X(2) X = [0,1] X(X + 1) = 11235 print *, X if ( any(X /= 11235) ) error stop end program lfortran-0.63.0/integration_tests/entry_08.f900000664000175000017500000000036715174404631021363 0ustar alastairalastairsubroutine dzror(status) integer status entry dstzr() return status = 8 end subroutine program entry_08 integer :: status status = 1 call dzror(status) if (status /= 1) error stop print *, "status = ", status end program lfortran-0.63.0/integration_tests/modules_35.f900000664000175000017500000000147115174404631021667 0ustar alastairalastairmodule M_CLI2_21 contains subroutine get_args_fixed_length_a_array(strings) character(len=*), allocatable :: strings(:) character(len=:), allocatable :: strings_a(:) integer :: place ! TODO: AST to ASR doesn't respect character(5) ! which it should. Fix needed here. allocate(character(5) :: strings_a(2)) if(place > 0) then if (len(strings_a) <= len(strings))then strings = strings_a else strings = [character(len=len(strings)) ::] end if end if if(place > 0) then strings = [character(len=len(strings)) ::] end if end subroutine get_args_fixed_length_a_array end module M_CLI2_21 program modules_35 use M_CLI2_21 character(len=5), allocatable :: string(:) allocate(string(2)) print *, "executing modules_35" call get_args_fixed_length_a_array(string) end program lfortran-0.63.0/integration_tests/rewind_inquire_flush.f900000664000175000017500000000052515174404631024134 0ustar alastairalastairprogram rewind_inquire_flush implicit none integer :: ios, len, a, b character :: fm logical :: ext rewind(unit=9, iostat=ios, err=10) inquire (file='file_b', exist=ext) inquire (4, form=fm, iostat=ios, err=20) inquire (iolength=len) a, b 10 print *, "err rewind" 20 print *, "err inquire" end programlfortran-0.63.0/integration_tests/intrinsics_393.f900000664000175000017500000000055115174404631022471 0ustar alastairalastairprogram intrinsics_393 integer, parameter :: n = 10 real(8) :: x(n) complex(8) :: z(n) complex(8) :: A(n,n) x(:) = 1.0d0 A(:,:) = cmplx(1.0d0,0.0d0) z = matmul (A, cmplx(x,0.0,8)) print *, z(1) if (abs(z(1) - (10.000000000000000,0.0000000000000000)) > 1e-12) error stop end program intrinsics_393lfortran-0.63.0/integration_tests/test_iso_c_binding.f900000664000175000017500000000051315174404631023531 0ustar alastairalastairprogram test_iso_c_binding use iso_c_binding, only: c_long, c_long_long, c_float, c_double implicit none real(c_float) :: r4 real(c_double) :: r8 integer(c_long) :: i4 integer(c_long_long) :: i8 !if (kind(r4) /= 4) error stop !if (kind(r8) /= 8) error stop !if (kind(i4) /= 4) error stop !if (kind(i8) /= 8) error stop end program lfortran-0.63.0/integration_tests/select_type_03_module.f900000664000175000017500000000036415174404631024077 0ustar alastairalastairmodule class_default_select_type implicit none type :: enum_stat integer :: success = 0 integer :: fatal = -1 end type enum_stat type(enum_stat), parameter :: toml_stat = enum_stat() end module class_default_select_type lfortran-0.63.0/integration_tests/modules_28.f900000664000175000017500000000015715174404631021671 0ustar alastairalastairprogram modules_28 use fpm_manifest_dependency implicit none print *, "running modules_28 program" end program lfortran-0.63.0/integration_tests/nested_02.f900000664000175000017500000000037115174404631021471 0ustar alastairalastairmodule nested_02_a implicit none contains subroutine b() print *, "b()" call c() contains subroutine c() print *, 5 end subroutine c end subroutine b end module program nested_02 use nested_02_a, only: b implicit none call b() end lfortran-0.63.0/integration_tests/modules_07_module.f900000664000175000017500000000015315174404631023227 0ustar alastairalastairmodule modules_07_module implicit none contains subroutine b() print *, "b()" end subroutine end module lfortran-0.63.0/integration_tests/gpu_metal_97.f900000664000175000017500000000146615174404631022210 0ustar alastairalastair! Test: do concurrent accessing allocatable member of an allocatable ! array of derived types with --gpu=metal. ! Previously produced garbage values because the host-side LLVM codegen ! did not create the auxiliary data/offsets/sizes Metal buffers for ! allocatable (dynamically-sized) arrays of structs. program gpu_metal_97 implicit none type :: tensor_t real, allocatable :: v(:) end type type(tensor_t), allocatable :: a(:) real :: r(3) integer :: i allocate(a(3)) allocate(a(1)%v(1)) allocate(a(2)%v(1)) allocate(a(3)%v(1)) a(1)%v(1) = 10.0 a(2)%v(1) = 20.0 a(3)%v(1) = 30.0 do concurrent (i = 1:3) r(i) = a(i)%v(1) end do if (abs(r(1) - 10.0) > 1e-5) error stop if (abs(r(2) - 20.0) > 1e-5) error stop if (abs(r(3) - 30.0) > 1e-5) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/modules_15c.c0000664000175000017500000000665215174404631021662 0ustar alastairalastair#include #include "modules_15c.h" int f_int_float(int *a, float *b) { return *a + *b; } int f_int_double(int *a, double *b) { return *a + *b; } int f_int_float_complex(int *a, float_complex_t *b) { return *a + crealf(*b) + cimagf(*b); } int f_int_double_complex(int *a, double_complex_t *b) { return *a + creal(*b) + cimag(*b); } int f_int_float_complex_value(int a, float_complex_t b) { return a + crealf(b) + cimagf(b); } int f_int_double_complex_value(int a, double_complex_t b) { return a + creal(b) + cimag(b); } float_complex_t f_float_complex_value_return(float_complex_t b) { float_complex_t r; #if _WIN32 r = _FCmulcr(b, 2.0); #else r = b * 2; #endif return r; } double_complex_t f_double_complex_value_return(double_complex_t b) { double_complex_t r; #if _WIN32 r = _Cmulcr(b, 2.0); #else r = b * 2; #endif return r; } int f_int_float_value(int a, float b) { return a + b; } int f_int_double_value(int a, double b) { return a + b; } int f_int_intarray(int n, int *b) { int i; int s; s = 0; for (i=0; i < n; i++) { s += b[i]; } return s; } float f_int_floatarray(int n, float *b) { int i; float s; s = 0; for (i=0; i < n; i++) { s += b[i]; } return s; } double f_int_doublearray(int n, double *b) { int i; double s; s = 0; for (i=0; i < n; i++) { s += b[i]; } return s; } float f_int_floatarray_star(int n, float *b) { int i; float s; s = 0; for (i=0; i < n; i++) { s += b[i]; } return s; } // -------------------------------------------------------------------- void sub_int_float(int *a, float *b, int *r) { *r = *a + *b; } void sub_int_double(int *a, double *b, int *r) { *r = *a + *b; } void sub_int_float_complex(int *a, float_complex_t *b, int *r) { *r = *a + crealf(*b) + cimagf(*b); } void sub_int_double_complex(int *a, double_complex_t *b, int *r) { *r = *a + creal(*b) + cimag(*b); } void sub_int_float_value(int a, float b, int *r) { *r = a + b; } void sub_int_double_value(int a, double b, int *r) { *r = a + b; } void sub_int_float_complex_value(int a, float_complex_t b, int *r) { *r = a + crealf(b) + cimagf(b); } void sub_int_double_complex_value(int a, double_complex_t b, int *r) { *r = a + creal(b) + cimag(b); } void sub_int_intarray(int n, int *b, int *r) { int i; int s; s = 0; for (i=0; i < n; i++) { s += b[i]; } *r = s; } void sub_int_floatarray(int n, float *b, float *r) { int i; float s; s = 0; for (i=0; i < n; i++) { s += b[i]; } *r = s; } void sub_int_doublearray(int n, double *b, double *r) { int i; double s; s = 0; for (i=0; i < n; i++) { s += b[i]; } *r = s; } int f_string(char *s) { return strlen(s); } int32_t call_fortran_i32(int32_t i) { return fortran_i32(&i); } int32_t call_fortran_i32_value(int32_t i) { return fortran_i32_value(i); } int64_t call_fortran_i64(int64_t i) { return fortran_i64(&i); } int64_t call_fortran_i64_value(int64_t i) { return fortran_i64_value(i); } float call_fortran_f32(float i) { return fortran_f32(&i); } float call_fortran_f32_value(float i) { return fortran_f32_value(i); } double call_fortran_f64(double i) { return fortran_f64(&i); } double call_fortran_f64_value(double i) { return fortran_f64_value(i); } lfortran-0.63.0/integration_tests/list_of_tuples_test.f900000664000175000017500000000076315174404631024005 0ustar alastairalastairprogram list_of_tuples_test implicit none _lfortran_list(_lfortran_tuple(character(len=:), integer, real)) :: students call _lfortran_list_append(students, _lfortran_tuple_constant("Alice", 10, 99.3)) call _lfortran_list_append(students, _lfortran_tuple_constant("Bob", 7, 95.3)) call _lfortran_list_append(students, _lfortran_tuple_constant("Charlie", 9, 96.3)) if ( _lfortran_get_item(_lfortran_get_item(students, 1), 0) /= "Bob" ) error stop end program list_of_tuples_test lfortran-0.63.0/integration_tests/external_06.f900000664000175000017500000000032115174404631022030 0ustar alastairalastairdouble precision function enorm(n) result(y) double precision, intent(in) :: n y = n return end function program main double precision, external :: enorm print *, enorm(1.0d0) end program lfortran-0.63.0/integration_tests/modules_39_module.f900000664000175000017500000000073015174404631023235 0ustar alastairalastairmodule modules_39_module_fpm_filesystem_39 contains function join_path(a1, a2, a3, a4, a5) result(path) character(len=*), intent(in) :: a1, a2 character(len=*), intent(in), optional :: a3, a4, a5 character(len=:), allocatable :: path end function join_path subroutine filewrite(filename, filedata) character(len=*), intent(in) :: filename character(len=*), intent(in) :: filedata(:) end subroutine filewrite end module modules_39_module_fpm_filesystem_39 lfortran-0.63.0/integration_tests/openmp_36.f900000664000175000017500000000020315174404631021506 0ustar alastairalastairprogram openmp_36 integer :: i, j, res = 0 do concurrent ( i =1:5, j = 1:3 ) res = res + i * j end do print *, res end programlfortran-0.63.0/integration_tests/intrinsics_240.f900000664000175000017500000000442215174404631022461 0ustar alastairalastairprogram intrinsics_240 integer(4) :: i, j, o, p integer(8) :: k, l, m, n integer(4) :: shift, shift2 integer(8) :: shift3, shift1 integer(8) :: expected_run(2) integer(4) :: expected_comp_sp(2) integer(8) :: expected_comp_dp(2) integer(8) :: first_arg(2) = [7, -10] integer(8) :: second_arg(2) = [12, -12] integer(4) :: third_arg(2) = [5, 7] integer(8) :: dshiftr_runtime_res(2) integer(4), parameter :: res_comp_sp(2) = dshiftr([10, 632], [7, 918], [8, 17]) integer(8), parameter :: res_comp_dp(2) = dshiftr([14526_8, -726382_8], [12345_8, 1725422_8], [31, 42]) expected_comp_dp = [124777389883392_8, -3046666928128_8] expected_comp_sp = [167772160, 20709376] expected_run = [4035225266123964416_8, -1297036692682702849_8] dshiftr_runtime_res = dshiftr(first_arg, second_arg, third_arg) do i = 1, size(res_comp_sp) print *, res_comp_sp(i) if (res_comp_sp(i) /= expected_comp_sp(i)) error stop end do do i = 1, size(res_comp_dp) print *, res_comp_dp(i) if (res_comp_dp(i) /= expected_comp_dp(i)) error stop end do do i = 1, size(dshiftr_runtime_res) print *, dshiftr_runtime_res(i) if (dshiftr_runtime_res(i) /= expected_run(i)) error stop end do i = 10 j = 7 shift = 8 k = 14526 l = 12345 m = -726382 n = 1725422 o = 632 p = 918 shift1 = 17 shift2 = 31 shift3 = 42 print *, dshiftr(o, p, shift1) if (dshiftr(o, p, shift1) /= 20709376) error stop print *, dshiftr(k, l, shift2) if (dshiftr(k, l, shift2) /= 124777389883392_8) error stop print *, dshiftr(m, n, shift3) if (dshiftr(m, n, shift3) /= -3046666928128_8) error stop print *, dshiftr(10, 7, 6) if(dshiftr(10, 7, 6) /= 671088640) error stop print *, dshiftr(10, -12, 7) if(dshiftr(10, -12, 7) /= 369098751) error stop print *, dshiftr(7_8, 12_8, 5) if (dshiftr(7_8, 12_8, 5) /= 4035225266123964416_8) error stop print *, kind(dshiftr(-10, 4, 3)) if(kind(dshiftr(-10, 4, 3)) /= 4) error stop print *, kind(dshiftr(7_8, 12_8, 5)) if(kind(dshiftr(7_8, 12_8, 5)) /= 8) error stop print *, kind(dshiftr(-10, -12, 7)) if(kind(dshiftr(10, 12, 7)) /= 4) error stop end program lfortran-0.63.0/integration_tests/bindc_iso_fb_08.f900000664000175000017500000000106215174404631022613 0ustar alastairalastair! Test: type(*) assumed-rank intent(inout) argument forwarded through a ! Fortran wrapper to a bind(C) subroutine correctly copies out modifications. program bindc_iso_fb_08 use iso_c_binding, only: c_int implicit none interface subroutine c_set_42(a) bind(C) type(*), intent(inout) :: a(..) end subroutine end interface integer(c_int) :: x x = 0 call wrapper(x) if (x /= 42) error stop print *, "PASS" contains subroutine wrapper(a) type(*), intent(inout), target :: a(..) call c_set_42(a) end subroutine end program lfortran-0.63.0/integration_tests/character_20.f900000664000175000017500000000243315174404631022144 0ustar alastairalastairprogram character_20 implicit none character(len=10) :: long_str character(len=5) :: short_str logical :: result long_str = "hello12345" result = check_short(long_str) if (.not. result) error stop "Test 1 failed" short_str = "world" result = check_exact(short_str) if (.not. result) error stop "Test 2 failed" call test_with_allocatable() contains function check_short(s) result(res) character(len=5), intent(in) :: s logical :: res res = (s == "hello") end function check_short function check_exact(s) result(res) character(len=5), intent(in) :: s logical :: res res = (s == "world") end function check_exact subroutine test_with_allocatable() character(len=8), allocatable :: alloc_str logical :: result allocate(alloc_str) alloc_str = "testing!" result = check_alloc(alloc_str) if (.not. result) error stop "Test 3 failed" deallocate(alloc_str) end subroutine test_with_allocatable function check_alloc(s) result(res) character(len=4), intent(in) :: s logical :: res res = (s == "test") end function check_alloc end program character_20 lfortran-0.63.0/integration_tests/array_section_03.f900000664000175000017500000000066515174404631023060 0ustar alastairalastairprogram array_section_03 implicit none integer :: y(2, 3) integer :: x(2) y = reshape([6, 3, 8, 5, 2, 7], shape(y)) x = func(y(:,1)) print *, size(y(:, 1)) print *, func(y(:,1)) if(size(y(:,1)) /= 2) error stop if(x(1) /= 6 .or. x(2) /= 3) error stop contains function func(x) result(y) integer, intent(in) :: x(:) integer :: y(size(x)) y = x end function func end program array_section_03lfortran-0.63.0/integration_tests/gpu_metal_61.f900000664000175000017500000000142515174404631022172 0ustar alastairalastairprogram gpu_metal_61 ! Test: do concurrent with associate calling a function that itself ! contains an associate block. Verifies that the gpu_offload pass ! correctly duplicates functions containing AssociateBlocks into ! the kernel scope, and that the Metal backend handles array ! parameters and ArraySize in duplicated functions. implicit none integer :: arr(4), pair, res(1) arr = [2, 3, 3, 1] res = 0 do concurrent (pair = 1:1) associate(nh => get_count(arr)) res(pair) = nh end associate end do if (res(1) /= 2) error stop print *, "ok" contains pure function get_count(arr) result(count) integer, intent(in) :: arr(:) integer :: count associate(n => size(arr)) count = n - 2 end associate end function end program lfortran-0.63.0/integration_tests/interface_05.f900000664000175000017500000000101715174404631022150 0ustar alastairalastairmodule interface_05_mod implicit none interface a module procedure a1 module procedure a2 end interface contains integer function a1(a) integer, intent(in) :: a a1 = a + 1 end function real function a2(a) real, intent(in) :: a a2 = a + 1 end function end module program interface_05 use interface_05_mod, only: a implicit none integer :: i real :: r i = 5 i = a(i) if (i /= 6) error stop r = 6 r = a(r) if (r /= 7) error stop i = 7 i = a(i) if (i /= 8) error stop end program lfortran-0.63.0/integration_tests/intrinsics_322.f900000664000175000017500000000025615174404631022463 0ustar alastairalastairprogram intrinsics_322 character(3) :: cx(2) cx(1) = "woo" cx(2) = "oba" print *, index(cx, "a") if (any(index(cx, "a") /= [0, 3])) error stop end programlfortran-0.63.0/integration_tests/defined_op_match_01.f900000664000175000017500000000146415174404631023462 0ustar alastairalastairmodule m_version_defined_op_match_01 implicit none private public :: version_t type :: version_t integer, allocatable :: num(:) contains generic :: operator(.match.) => match procedure, private :: match end type version_t contains logical function match(this, other) class(version_t), intent(in) :: this, other if (.not. allocated(this%num) .or. .not. allocated(other%num)) then match = .false. elseif (size(this%num) /= size(other%num)) then match = .false. else match = all(this%num == other%num) end if end function match end module m_version_defined_op_match_01 program defined_op_match_01 use m_version_defined_op_match_01 implicit none type(version_t) :: v1, v2 if (v1 .match. v2) error stop end program defined_op_match_01 lfortran-0.63.0/integration_tests/intrinsics_187.f900000664000175000017500000000347415174404631022501 0ustar alastairalastairprogram intrinsics_187 implicit none integer :: x, y, z integer(8) :: a, b, c integer, parameter :: x1 = popcnt(44) integer(8), parameter :: y1 = popcnt(5468272828_8) integer, parameter :: z1 = popcnt(-501) integer(8), parameter :: w1 = popcnt(-3526282829_8) integer, parameter :: ar1(3) = popcnt([83983, 5468272, -3526282]) integer(8), parameter :: ar2(3) = popcnt([83983_8, 5468272828_8, -3526282829_8]) print *, x1 if(x1 /= 3) error stop print *, y1 if(y1 /= 19) error stop print *, z1 if(z1 /= 26) error stop print *, w1 if(w1 /= 48) error stop print *, ar1 if(any(ar1 /= [7, 10, 20])) error stop print *, ar2 if(any(ar2 /= [7, 19, 48])) error stop x = 44 y = -501 z = 0 a = 5468272828_8 b = -3526282829_8 c = 83983_8 print *, popcnt(x) if(popcnt(x) /= 3) error stop print *, popcnt(44) if(popcnt(44) /= 3) error stop print *, popcnt(y) if(popcnt(y) /= 26) error stop print *, popcnt(-501) if(popcnt(-501) /= 26) error stop print *, popcnt(z) if(popcnt(z) /= 0) error stop print *, popcnt(0) if(popcnt(0) /= 0) error stop print *, popcnt(a) if(popcnt(a) /= 19) error stop print *, popcnt(5468272828_8) if(popcnt(5468272828_8) /= 19) error stop print *, popcnt(b) if(popcnt(b) /= 48) error stop print *, popcnt(-3526282829_8) if(popcnt(-3526282829_8) /= 48) error stop print *, popcnt(c) if(popcnt(c) /= 7) error stop print *, popcnt(83983_8) if(popcnt(83983_8) /= 7) error stop print *, kind(popcnt(-501)) if(kind(popcnt(-501)) /= 4) error stop print *, kind(popcnt(y)) if(kind(popcnt(y)) /= 4) error stop print *, kind(popcnt(5468272828_8)) if(kind(popcnt(5468272828_8)) /= 4) error stop end program lfortran-0.63.0/integration_tests/variables_01.f900000664000175000017500000000072215174404631022156 0ustar alastairalastairprogram variables_01 implicit none integer :: x, y x = 2 y = 3 if (x /= 2) error stop if (y /= 3) error stop x = y if (x /= 3) error stop if (y /= 3) error stop y = 1 if (y == 1) x = 1 if (y /= 1) x = 2 if (x /= 1) error stop y = 2 if (y == 1) x = 1 if (y /= 1) x = 2 if (x /= 2) error stop x = 2 y = 1 if (y == 1) x = x + 1 if (y /= 1) x = x - 1 if (x /= 3) error stop x = 2 y = 2 if (y == 1) x = x + 1 if (y /= 1) x = x - 1 if (x /= 1) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_41.f900000664000175000017500000000100415174404631022161 0ustar alastairalastair! Test: do concurrent inside block inside associate block. ! The gpu_offload pass must resolve associate variables referenced ! as loop bounds even when the do concurrent is nested inside ! a block that is itself inside an associate construct. program gpu_metal_41 implicit none integer :: n, l, a(3) n = 3 a = 0 associate(m => n) block do concurrent(l = 1:m) a(l) = l * 10 end do end block end associate if (a(1) /= 10) error stop if (a(2) /= 20) error stop if (a(3) /= 30) error stop end program lfortran-0.63.0/integration_tests/derived_types_58.f900000664000175000017500000000044515174404631023072 0ustar alastairalastairmodule derived_types_58_m type :: enum_stat integer :: success = 0 end type enum_stat type(enum_stat), parameter :: toml_stat = enum_stat() end module program derived_types_58 use derived_types_58_m, only: toml_stat if (toml_stat%success /= 0) error stop end program lfortran-0.63.0/integration_tests/format_39.f900000664000175000017500000000055215174404631021512 0ustar alastairalastairprogram format_39 implicit none write(*,"(EN0.0E0)") 3.14159 write(*,"(EN0.0E0)") 0.0 write(*,"(EN0.0E0)") 10.0 write(*,"(EN0.0E0)") 3.14E+03 write(*,"(EN0.0E0)") 30.14159 write(*,"(EN0.0E0)") 391.14 write(*,"(EN0.0E0)") 3.14E+04 write(*,"(EN0.0E0)") -5.0 write(*,"(EN0.0E0)") 1.23456E-5 write(*,"(EN0.0E0)") 9.99E+10 end program format_39 lfortran-0.63.0/integration_tests/separate_compilation_09c.c0000664000175000017500000000006015174404631024402 0ustar alastairalastair#include int c_MPI_COMM_WORLD = 412; lfortran-0.63.0/integration_tests/format_86.f900000664000175000017500000000065315174404631021516 0ustar alastairalastairprogram format_86 implicit none character(14) :: c1 character(20) :: c2 double precision :: d1, d2 d1 = 123.456d0 d2 = 789.012d0 write (c1, '(G14.8)') d1 if (c1 /= ' 123.45600') error stop write (c2, '(G20.2)') d2 if (c2 /= ' 0.79E+03') error stop write (c2, '(G20.2E4)') d2 if (c2 /= ' 0.79E+0003') error stop end program format_86 lfortran-0.63.0/integration_tests/intrinsics_162.f900000664000175000017500000000232215174404631022461 0ustar alastairalastairprogram intrinsics_162 implicit none integer :: a1 = 1 integer(8) :: a2 = -5 integer :: a3 = 0 integer, parameter :: i1 = not(1) integer(8), parameter :: i2 = not(-5) integer, parameter :: ar1(3) = not([-1, 43, -8]) integer(8), parameter :: ar2(3) = not([-1_8, 43_8, -8_8]) integer(4) :: arr1(3) = [11, -13, 0] integer(8) :: arr2(3) = [11_8, -13_8, 0_8] print *, i1 if (i1 /= -2) error stop print *, i2 if (i2 /= 4) error stop print *, ar1 if (any(ar1 /= [0, -44, 7])) error stop print *, ar2 if (any(ar2 /= [0_8, -44_8, 7_8])) error stop print*, not(a1) if (not(a1) /= -2) error stop print*, not(a2) if (not(a2) /= 4) error stop print*, not(a3) if (not(a3) /= -1) error stop print*, not(1) if (not(1) /= -2) error stop print*, not(-5) if (not(-5) /= 4) error stop print*, not(0) if (not(0) /= -1) error stop print*, not(arr1) if (any(not(arr1) /= [-12, 12, -1])) error stop print*, not(arr2) if (any(not(arr2) /= [-12_8, 12_8, -1_8])) error stop print *, kind(not(1)) if (kind(not(1)) /= 4) error stop print *, kind(not(5_8)) if (kind(not(5_8)) /= 8) error stop end program lfortran-0.63.0/integration_tests/bits_04.f900000664000175000017500000000501015174404631021145 0ustar alastairalastairprogram bits_04 implicit none if (bgt(10, 4) .neqv. .true.) error stop if (bgt(10, -4) .neqv. .false.) error stop if (bgt(-10, 4) .neqv. .true.) error stop if (bgt(-10, -4) .neqv. .false.) error stop if (bgt(10, 0) .neqv. .true.) error stop if (bgt(-10, 0) .neqv. .true.) error stop if (bgt(10_8, 4_8) .neqv. .true.) error stop if (bgt(10_8, -4_8) .neqv. .false.) error stop if (bgt(-10_8, 4_8) .neqv. .true.) error stop if (bgt(-10_8, -4_8) .neqv. .false.) error stop if (bgt(10_8, 0_8) .neqv. .true.) error stop if (bgt(-10_8, 0_8) .neqv. .true.) error stop if (bge(10, 4) .neqv. .true.) error stop if (bge(10, -4) .neqv. .false.) error stop if (bge(-10, 4) .neqv. .true.) error stop if (bge(-10, -4) .neqv. .false.) error stop if (bge(10, 0) .neqv. .true.) error stop if (bge(-10, 0) .neqv. .true.) error stop if (bge(-10, -10) .neqv. .true.) error stop if (bge(10_8, 4_8) .neqv. .true.) error stop if (bge(10_8, -4_8) .neqv. .false.) error stop if (bge(-10_8, 4_8) .neqv. .true.) error stop if (bge(-10_8, -4_8) .neqv. .false.) error stop if (bge(10_8, 0_8) .neqv. .true.) error stop if (bge(-10_8, 0_8) .neqv. .true.) error stop if (bge(-10_8, -10_8) .neqv. .true.) error stop if (ble(10, 4) .neqv. .false.) error stop if (ble(10, -4) .neqv. .true.) error stop if (ble(-10, 4) .neqv. .false.) error stop if (ble(-10, -4) .neqv. .true.) error stop if (ble(10, 0) .neqv. .false.) error stop if (ble(-10, 0) .neqv. .false.) error stop if (ble(-10, -10) .neqv. .true.) error stop if (ble(10_8, 4_8) .neqv. .false.) error stop if (ble(10_8, -4_8) .neqv. .true.) error stop if (ble(-10_8, 4_8) .neqv. .false.) error stop if (ble(-10_8, -4_8) .neqv. .true.) error stop if (ble(10_8, 0_8) .neqv. .false.) error stop if (ble(-10_8, 0_8) .neqv. .false.) error stop if (ble(-10_8, -10_8) .neqv. .true.) error stop if (blt(10, 4) .neqv. .false.) error stop if (blt(10, -4) .neqv. .true.) error stop if (blt(-10, 4) .neqv. .false.) error stop if (blt(-10, -4) .neqv. .true.) error stop if (blt(10, 0) .neqv. .false.) error stop if (blt(-10, 0) .neqv. .false.) error stop if (blt(10_8, 4_8) .neqv. .false.) error stop if (blt(10_8, -4_8) .neqv. .true.) error stop if (blt(-10_8, 4_8) .neqv. .false.) error stop if (blt(-10_8, -4_8) .neqv. .true.) error stop if (blt(10_8, 0_8) .neqv. .false.) error stop if (blt(-10_8, 0_8) .neqv. .false.) error stop end programlfortran-0.63.0/integration_tests/openmp_56.f900000664000175000017500000000061215174404631021514 0ustar alastairalastairprogram openmp_56 use omp_lib implicit none integer :: counter counter=0 call omp_set_num_threads(10) !$omp parallel !$omp task shared(counter) !$omp atomic counter=counter+1 print *, "Task done by TID:-",omp_get_thread_num() !$omp end task !$omp end parallel if(counter/=10) error stop end program openmp_56 lfortran-0.63.0/integration_tests/write_26.f900000664000175000017500000000145015174404631021346 0ustar alastairalastairprogram write_26 implicit none integer :: u character(len=10) :: line character(len=3) :: adv_yes, adv_no open(newunit=u, status='scratch', form='formatted', action='readwrite') ! Test 1: advance=variable containing 'YES' should advance the record adv_yes = 'YES' write(u, '(A)', advance=adv_yes) 'AB' write(u, '(A)', advance=adv_yes) 'CD' rewind(u) read(u, '(A)') line if (trim(line) /= 'AB') error stop read(u, '(A)') line if (trim(line) /= 'CD') error stop ! Test 2: advance=variable containing 'NO' should not advance the record rewind(u) adv_no = 'NO' write(u, '(A)', advance=adv_no) 'EF' write(u, '(A)', advance=adv_no) 'GH' write(u, '(A)') '' rewind(u) read(u, '(A)') line if (trim(line) /= 'EFGH') error stop close(u) print *, "PASS" end program lfortran-0.63.0/integration_tests/bindc_35c.c0000664000175000017500000000151515174404631021264 0ustar alastairalastair/* * C helpers for bindc_35: ISO_C_BINDING named constant interop * * Tests intmax_t, int_least*_t, int_fast*_t value passing. */ #include intmax_t c35_double_intmax(intmax_t x) { return x * 2; } int_least8_t c35_double_least8 (int_least8_t x) { return (int_least8_t) (x * 2); } int_least16_t c35_double_least16(int_least16_t x) { return (int_least16_t)(x * 2); } int_least32_t c35_double_least32(int_least32_t x) { return (int_least32_t)(x * 2); } int_least64_t c35_double_least64(int_least64_t x) { return x * 2; } int_fast8_t c35_double_fast8 (int_fast8_t x) { return (int_fast8_t) (x * 2); } int_fast16_t c35_double_fast16(int_fast16_t x) { return (int_fast16_t)(x * 2); } int_fast32_t c35_double_fast32(int_fast32_t x) { return (int_fast32_t)(x * 2); } int_fast64_t c35_double_fast64(int_fast64_t x) { return x * 2; } lfortran-0.63.0/integration_tests/data_implied_do_04.f900000664000175000017500000000065315174404631023312 0ustar alastairalastairreal function func() integer i real coef(5,4) data (coef(i,1),i=1,5)/1.0,1.0,3*0.0/ if (abs(coef(1,1) - 1.0) > 1e-8) error stop if (abs(coef(2,1) - 1.0) > 1e-8) error stop if (abs(coef(3,1) - 0.0) > 1e-8) error stop if (abs(coef(4,1) - 0.0) > 1e-8) error stop if (abs(coef(5,1) - 0.0) > 1e-8) error stop return end function program data_implied_do_04 real y y = func() end program lfortran-0.63.0/integration_tests/derived_component_section_02.f900000664000175000017500000000121415174404631025434 0ustar alastairalastairmodule metrics_mod_02 implicit none type :: metric_dict_type character(10) :: key integer :: val end type end module module network_mod_02 use metrics_mod_02 implicit none type :: network_type type(metric_dict_type), dimension(2) :: metrics end type end module program derived_component_section_02 use network_mod_02 implicit none type(network_type) :: net character(10) :: arr(2) net%metrics(1)%key = "alpha" net%metrics(2)%key = "beta" arr = net%metrics%key if (arr(1) /= "alpha") error stop if (arr(2) /= "beta") error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/associate_41.f900000664000175000017500000000057115174404631022167 0ustar alastairalastairmodule associate_41_mod implicit none contains subroutine sub() real :: f, x, result f(x) = x * 2.0 associate (fnew => f(1.0)) result = fnew end associate print *, result if (abs(result - 2.0) > 1e-6) error stop end subroutine end module associate_41_mod program associate_41 use associate_41_mod, only: sub call sub() end program associate_41 lfortran-0.63.0/integration_tests/modules_31_module2.f900000664000175000017500000000142715174404631023313 0ustar alastairalastairmodule fpm_cmd_update_modules_31 use fpm_dependency_modules_31, only : dependency_tree_t, error_t implicit none type, abstract :: fpm_cmd_settings character(len=:), allocatable :: working_dir logical :: verbose=.true. end type type, extends(fpm_cmd_settings) :: fpm_update_settings character(len=5), allocatable :: name(:) logical :: fetch_only logical :: clean end type contains subroutine cmd_update(settings) type(fpm_update_settings), intent(in) :: settings type(dependency_tree_t) :: deps type(error_t), allocatable :: error integer :: ii call deps%update(deps%dep(ii)%name, error) end subroutine cmd_update end module fpm_cmd_update_modules_31 lfortran-0.63.0/integration_tests/intrinsics_378.f900000664000175000017500000000075615174404631022503 0ustar alastairalastairprogram intrinsics_378 implicit none integer, allocatable :: a(:), b(:), c(:) allocate(a(3), b(3)) a = [1, 2, 3] call move_alloc(a, b) print *, allocated(a) print *, b if (.not. allocated(b)) error stop if (allocated(c)) error stop if (any(b /= [1, 2, 3])) error stop call move_alloc(b, c) print *, allocated(b) print *, c if (allocated(b)) error stop if (.not. allocated(c)) error stop if (any(c /= [1, 2, 3])) error stop end program intrinsics_378 lfortran-0.63.0/integration_tests/interface_14.f900000664000175000017500000000150215174404631022147 0ustar alastairalastairmodule interface_14_data implicit none public data_t type data_t integer :: x end type end module program interface_14 use interface_14_data, only: data_t implicit none integer :: x x = get_x_from_data(return_x_from_data) print *, x if (x /= 100) error stop contains function return_x_from_data(d) type(data_t), intent(inout) :: d integer :: return_x_from_data return_x_from_data = d%x end function function get_x_from_data(R) interface function R(d) use interface_14_data implicit none type(data_t), intent(inout) :: d integer :: R end function end interface integer :: get_x_from_data type(data_t) :: d d%x = 100 get_x_from_data = R(d) end function end program lfortran-0.63.0/integration_tests/namelist_30.f900000664000175000017500000000043315174404631022023 0ustar alastairalastairmodule mod_namelist_30 implicit none integer :: x = 123 end module mod_namelist_30 program namelist_30 use mod_namelist_30, y => x implicit none character(len=80) :: page(3) namelist /nl/ y write(page, nl) print *, page end program namelist_30 lfortran-0.63.0/integration_tests/intrinsics_317.f900000664000175000017500000000157215174404631022471 0ustar alastairalastairprogram intrinsics_317 implicit none integer :: arg_num character(len=100) :: arg_value integer :: arg_length, arg_status ! Print a message if no arguments are passed call get_command_argument(0, arg_value) if (trim(arg_value) == "") then print *, "No command-line arguments provided." else ! Loop through the arguments passed on the command line do arg_num = 1, 3 ! Assuming we want to read 3 arguments call get_command_argument(arg_num, arg_value, arg_length, arg_status) if (trim(arg_value) /= "") then print *, "Argument ", arg_num, ": ", trim(arg_value) print *, "Length", arg_length print *, "Status", arg_status else print *, "No more arguments." exit end if end do end if end program lfortran-0.63.0/integration_tests/c_ptr_06.f900000664000175000017500000000074515174404631021327 0ustar alastairalastairprogram c_ptr_06 use iso_c_binding implicit none character(len=1), pointer :: fchars(:) type(c_ptr) :: cptr integer, parameter :: N = 6 character(kind=c_char), target :: cbuf(6) cbuf = [ 'H', 'E', 'L', 'L', 'O', C_NULL_CHAR ] cptr = c_loc(cbuf) call c_f_pointer(cptr, fchars, [N]) print *, "First few elements of fchars:" print *, fchars if(any(fchars /= [ 'H', 'E', 'L', 'L', 'O', C_NULL_CHAR])) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_184.f900000664000175000017500000000203215174404631022253 0ustar alastairalastairmodule gpu_metal_184_m implicit none type :: tensor_t real, allocatable :: values_(:) end type interface tensor_t module procedure construct end interface contains pure function construct(values) result(tensor) real, intent(in) :: values(:) type(tensor_t) :: tensor tensor%values_ = values end function end module program gpu_metal_184 use gpu_metal_184_m implicit none type(tensor_t) :: inputs(1), outputs(1) integer :: i ! Test true branch: sum([1.0, 1.0]) = 2.0 > 0.99 inputs(1) = tensor_t([1.0, 1.0]) do concurrent(i = 1:1) outputs(i) = tensor_t([merge(1.0, 0.0, sum(inputs(i)%values_) > 0.99)]) end do if (abs(outputs(1)%values_(1) - 1.0) > 1e-6) error stop "FAIL: expected 1.0" ! Test false branch: sum([0.5, 0.3]) = 0.8 < 0.99 inputs(1) = tensor_t([0.5, 0.3]) do concurrent(i = 1:1) outputs(i) = tensor_t([merge(1.0, 0.0, sum(inputs(i)%values_) > 0.99)]) end do if (abs(outputs(1)%values_(1) - 0.0) > 1e-6) error stop "FAIL: expected 0.0" print *, "PASS" end program lfortran-0.63.0/integration_tests/gpu_metal_48.f900000664000175000017500000000156415174404631022203 0ustar alastairalastairprogram gpu_metal_48 ! Test: function call inside do concurrent (GPU offload) ! Verifies that internal functions defined in `contains` are correctly ! duplicated into the GPU kernel scope. implicit none integer :: i real :: x(4) integer :: y(4) do concurrent (i = 1:4) x(i) = scale_val(real(i)) y(i) = double_int(i) end do if (abs(x(1) - 2.0) > 1e-6) error stop if (abs(x(2) - 4.0) > 1e-6) error stop if (abs(x(3) - 6.0) > 1e-6) error stop if (abs(x(4) - 8.0) > 1e-6) error stop if (y(1) /= 2) error stop if (y(2) /= 4) error stop if (y(3) /= 6) error stop if (y(4) /= 8) error stop print *, "ok" contains pure function scale_val(v) result(r) real, intent(in) :: v real :: r r = v * 2.0 end function pure function double_int(n) result(r) integer, intent(in) :: n integer :: r r = n * 2 end function end program lfortran-0.63.0/integration_tests/arrays_reshape_30.f900000664000175000017500000000060215174404631023215 0ustar alastairalastairprogram arrays_reshape_30 implicit none integer, parameter :: x(4) = [1, 2, 3, 4] real :: b(2, 2) = reshape([x], [2, 2]) if (b(1,1) /= 1.0) error stop "Mismatch at b(1,1)" if (b(2,1) /= 2.0) error stop "Mismatch at b(2,1)" if (b(1,2) /= 3.0) error stop "Mismatch at b(1,2)" if (b(2,2) /= 4.0) error stop "Mismatch at b(2,2)" end program arrays_reshape_30 lfortran-0.63.0/integration_tests/doloop_15.f900000664000175000017500000000020115174404631021477 0ustar alastairalastairprogram doloop_15 integer :: i do i = 2, 2 end do print *, i if ( i /= 3 ) error stop end program doloop_15 lfortran-0.63.0/integration_tests/intrinsics_16.f900000664000175000017500000000312215174404631022376 0ustar alastairalastairprogram intrinsics_16 use iso_fortran_env, only: sp=>real32, dp=>real64 real(sp) :: r32 real(dp) :: r64 complex(sp) :: c32 complex(dp) :: c64 real(sp), parameter :: x1 = aimag((5._sp, 7._sp)) real(dp), parameter :: x2 = aimag((8.2_dp, 7.12_dp)) real(sp), parameter :: ar1(3) = aimag([(5._sp, 7._sp), (8.2_sp, 7.12_sp), (1.2_sp, 3.4_sp)]) real(dp), parameter :: ar2(3) = aimag([(5._dp, 7._dp), (8.2_dp, 7.12_dp), (1.2_dp, 3.4_dp)]) complex(sp) :: arr1(3) = [(5._sp, 7._sp), (8.2_sp, 7.12_sp), (1.2_sp, 3.4_sp)] complex(dp) :: arr2(3) = [(5._dp, 7._dp), (8.2_dp, 7.12_dp), (1.2_dp, 3.4_dp)] c32 = (5._sp, 7._sp); c64 = (5._dp, 7._dp) print *, kind(aimag(arr2)) if (kind(aimag(arr2)) /= 8) error stop print *, x1 if (abs(x1 - 7.0_sp) > 1e-5) error stop print *, x2 if (abs(x2 - 7.12000000000000011e+00_dp) > 1e-10) error stop print *, ar1 if (any(ar1 - [7.0_sp, 7.11999989e+00_sp, 3.40000010e+00_sp] > 1e-6)) error stop print *, ar2 if (any(ar2 - [7.00000000000000000e+00_dp, 7.12000000000000011e+00_dp, 3.39999999999999991e+00_dp] > 1e-10)) error stop r32 = aimag(c32) print *, r32 if (abs(r32 - 7) > 1e-5) error stop r64 = aimag(c64) print *, r64 if (abs(r64-7) > 1e-10) error stop r32 = imag(c32) print *, r32 if (abs(r32-7) > 1e-5) error stop r64 = dimag(c64) print *, r64 if (abs(r64-7) > 1e-10) error stop print *, aimag(arr1) if (any(aimag(arr1) - [7.0_sp, 7.11999989e+00_sp, 3.40000010e+00_sp] > 1e-6)) error stop print *, aimag(arr2) ! Does not work yet #4542 if (any(aimag(arr2) - [7.00000000000000000e+00_dp, 7.12000000000000011e+00_dp, 3.39999999999999991e+00_dp] > 1e-10)) error stop end program lfortran-0.63.0/integration_tests/array_04_all.f900000664000175000017500000000056315174404631022162 0ustar alastairalastairprogram array_04_all implicit none integer :: i, j logical l1(4) logical, dimension(2, 3) :: l2 l1 = [.true., .true., .true., .true.] if (.not. all(l1)) error stop print *, l1 l2 = reshape([.true., .true., .true., .true., .false., .true.], [2, 3]) if (.not. all(l2(:, 1))) error stop do i = 1, 2 do j = 1, 3 print *, l2(i, j) end do end do end program lfortran-0.63.0/integration_tests/gpu_metal_38.f900000664000175000017500000000072515174404631022200 0ustar alastairalastairprogram gpu_metal_38 ! Test: associate inside block inside do concurrent. ! The gpu_offload pass must descend into AssociateBlock bodies to ! collect and remap variable references correctly. implicit none integer :: n, pair, res(2) n = 3 res = 0 do concurrent (pair = 1:2) block associate(nh => n) res(pair) = nh + pair end associate end block end do if (res(1) /= 4) error stop if (res(2) /= 5) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/submodule_50b.f900000664000175000017500000000100415174404631022345 0ustar alastairalastairmodule submodule_50_mod implicit none type :: container_type integer :: rank = 2 contains procedure :: setup => setup_impl end type interface module subroutine setup_impl(this, lengths) class(container_type), intent(inout) :: this integer, dimension(this%rank), intent(in) :: lengths end subroutine end interface type :: wrapper_type type(container_type), dimension(:), allocatable :: containers end type end module lfortran-0.63.0/integration_tests/bindc_17.f900000664000175000017500000000323415174404631021275 0ustar alastairalastairmodule bindc_17_mod use, intrinsic :: iso_c_binding implicit none type, bind(c) :: callbacks_t type(c_funptr) :: start = C_NULL_FUNPTR type(c_funptr) :: finish = C_NULL_FUNPTR end type type :: parser_t type(c_ptr) :: handle = C_NULL_PTR type(callbacks_t) :: cbs contains procedure :: init procedure :: run final :: parser_dealloc end type interface function c_alloc(cbs, ctx) result(h) bind(c, name='my_alloc') import callbacks_t, c_ptr type(callbacks_t) :: cbs type(c_ptr), value :: ctx type(c_ptr) :: h end function subroutine c_free(h) bind(c, name='my_free') import c_ptr type(c_ptr), value :: h end subroutine function c_run(h) result(r) bind(c, name='my_run') import c_ptr, c_int type(c_ptr), value :: h integer(c_int) :: r end function end interface contains integer(c_int) function my_start(ctx) bind(c, name='') type(c_ptr), value :: ctx my_start = 42 end function subroutine init(this) class(parser_t), intent(out), target :: this this%cbs%start = c_funloc(my_start) this%handle = c_alloc(this%cbs, C_NULL_PTR) end subroutine function run(this) result(r) class(parser_t), intent(inout) :: this integer :: r r = c_run(this%handle) end function subroutine parser_dealloc(this) type(parser_t) :: this if (c_associated(this%handle)) call c_free(this%handle) this%handle = C_NULL_PTR end subroutine end module program bindc_17 use bindc_17_mod implicit none type(parser_t), target :: p integer :: r call p%init() r = p%run() if (r /= 42) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/intrinsics_363.f900000664000175000017500000000020315174404631022460 0ustar alastairalastairprogram intrinsics_363 real :: a(2) = cshift([1.0,2.0], 1) print *, a if (any(a /= [2.0, 1.0])) error stop end program lfortran-0.63.0/integration_tests/polymorphic_arguments_02.f900000664000175000017500000000211115174404631024633 0ustar alastairalastair program polymorphic_argument_02 implicit none integer :: i_value = 1 real :: r_value = 1 character(len=1) :: c_value = "c" logical :: l_value = .true. interface str procedure str_scalar end interface str ! Calling generic procedure with any argument print *, str(i_value) if (str(i_value) /= 0) error stop print *, str(r_value) if (str(r_value) /= 0) error stop print *, str(c_value) if (str(c_value) /= 0) error stop print *, str(l_value) if (str(l_value) /= 0) error stop ! Calling subroutine with polymorphic parameter, with any argument print *, str_scalar(i_value) if (str_scalar(i_value) /= 0) error stop print *, str_scalar(r_value) if (str_scalar(r_value) /= 0) error stop print *, str_scalar(c_value) if (str_scalar(c_value) /= 0) error stop print *, str_scalar(l_value) if (str_scalar(l_value) /= 0) error stop CONTAINS function str_scalar(g1) class(*), intent(in) :: g1 integer :: str_scalar str_scalar = 0 end function str_scalar end program polymorphic_argument_02 lfortran-0.63.0/integration_tests/intrinsics_381.f900000664000175000017500000000043015174404631022462 0ustar alastairalastairPROGRAM intrinsics_381 CHARACTER(len=255) :: test_env_var integer :: len CALL get_environment_variable("LFORTRAN_TEST_ENV_VAR", test_env_var, len) WRITE (*,*) TRIM(test_env_var) if (trim(test_env_var) /= "STATUS OK!") error stop print *, len if (len /= 10) error stop END PROGRAM lfortran-0.63.0/integration_tests/functions_47.f900000664000175000017500000000111015174404631022220 0ustar alastairalastair! Test automatic reallocation of allocatable array of strings (string length is fixed) program functions_47 call sub() contains subroutine sub() character(10) :: string character(len=1), allocatable :: chars(:) chars = foo2([1, 1, 1]) ! <<<< Test automatic reallocation if(all(chars /= 'a')) error stop if(len(chars(1:1)) /= 1) error stop end subroutine elemental function foo2(pos) result(character_string) integer, intent(in) :: pos character(len=1) :: character_string character_string = 'a' end function end program lfortran-0.63.0/integration_tests/fixed_form_select_rank_01.f900000664000175000017500000000147515174404631024710 0ustar alastairalastair subroutine set_first(a, j) integer :: a(..) integer, intent(inout) :: j select rank (a) rank (1) call store $ (j) end select end subroutine subroutine store(x) integer, intent(inout) :: x x = 42 end subroutine program fixed_form_select_rank_27 integer :: a(3), j interface subroutine set_first(a, j) integer :: a(..) integer, intent(inout) :: j end subroutine subroutine store(x) integer, intent(inout) :: x end subroutine end interface j = 0 call set_first(a, j) if (j /= 42) error stop print *, j end program lfortran-0.63.0/integration_tests/format_41.f900000664000175000017500000000120715174404631021501 0ustar alastairalastairprogram format_40 ! Test sign control format descriptors: S, SP, SS implicit none character(len=20) :: output ! Test S (restore default sign printing) write(output, 100) -42.43, 42.43 if (output /= " -42.430 42.430 ") error stop "Test 1 failed" ! Test SP (always print sign) write(output, 101) -42.43, 42.43 if (output /= " -42.430 +42.430 ") error stop "Test 2 failed" ! Test SS (suppress optional plus sign) write(output, 102) -42.43, 42.43 if (output /= " -42.430 42.430 ") error stop "Test 3 failed" print *, "OK" 100 format (s, 2f10.3) 101 format (sp, 2f10.3) 102 format (ss, 2f10.3) end program lfortran-0.63.0/integration_tests/kinds_01.f900000664000175000017500000000272615174404631021324 0ustar alastairalastairprogram kinds_01 implicit none integer, parameter :: kr1 = selected_real_kind(1), maxkr = 3, & skr2 = selected_real_kind(precision(1.0_kr1)+1), & kr2 = merge(skr2, kr1, skr2 > 0), & skr3 = selected_real_kind(precision(1.0_kr2)+1), & kr3 = merge(skr3, kr2, skr3 > 0), & allkr(maxkr+1) = [kr1, kr2, kr3, kr3] integer :: nkr, n nkr = minloc(abs(allkr(1:maxkr) - allkr(2:maxkr+1)), 1) if (kr1 <= 0) error stop "kr1 must be a valid kind" if (kr2 < kr1) error stop "kr2 must be >= kr1" if (precision(1.0_kr1) < 1) error stop "precision(kr1) must be >= 1" if (nkr < 1 .or. nkr > maxkr) error stop "nkr out of range" if (nkr >= 2) then if (precision(1.0_kr2) <= precision(1.0_kr1)) error stop "kr2 should have higher precision" end if call realkinds(nkr) contains subroutine realkinds(nkr) integer, intent(in) :: nkr integer :: n integer :: goodkr(nkr) goodkr = allkr(1:nkr) print *, 'precision(1.0_kr1) =', precision(1.0_kr1) if (nkr >= 2) print *, 'precision(1.0_kr2) =', precision(1.0_kr2) if (nkr >= 3) print *, 'precision(1.0_kr3) =', precision(1.0_kr3) write(*, "(A,1X,I0,A)", advance='no') & 'Number of different real kinds =', nkr, ', real kinds:' do n = 1, nkr write(*, "(1X,I0)", advance=merge('no ', 'yes', n < nkr)) allkr(n) end do print "(3A)", 'There ', merge('may be', 'are no', nkr >= maxkr), ' more real kinds' end subroutine realkinds end program kinds_01 lfortran-0.63.0/integration_tests/program_02.f900000664000175000017500000000026715174404631021662 0ustar alastairalastairmodule program_02_mod implicit none end program program_02 use program_02_mod implicit none contains subroutine f1() end integer function f2() f2 = 3 end end lfortran-0.63.0/integration_tests/sin_01.f900000664000175000017500000000040515174404631020775 0ustar alastairalastairprogram sin_01 use iso_fortran_env, only: dp => real64 implicit none real(dp) :: x, y, r1, r2 x = sin(1.5_dp) if (abs(x - 0.997494996_dp) > 1e-5_dp) error stop y = 10.5_dp r1 = dsin(x) r2 = -0.87969575997167_dp if (dabs(r1-r2) > 1e15_dp) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_153.f900000664000175000017500000000063215174404631022253 0ustar alastairalastairprogram gpu_metal_153 ! erf() intrinsic inside do concurrent (GPU offload) implicit none integer, parameter :: n = 64 real :: x(n), y(n), y_expected(n) integer :: i do i = 1, n x(i) = real(i - 1) * 0.05 - 1.5 y_expected(i) = erf(x(i)) end do do concurrent (i = 1:n) y(i) = erf(x(i)) end do do i = 1, n if (abs(y(i) - y_expected(i)) > 1.0e-5) error stop end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/select_type_03.f900000664000175000017500000000223515174404631022531 0ustar alastairalastairmodule class_default_select_type_user use class_default_select_type, only: toml_stat implicit none public :: toml_table, get_table type :: toml_value integer :: int real :: float end type type, extends(toml_value) :: toml_table logical :: implicit = .false. logical :: inline = .false. end type contains subroutine get_table(table, ptr, stat) class(toml_table), intent(inout) :: table type(toml_table), pointer, intent(out) :: ptr integer, intent(out), optional :: stat class(toml_value), pointer :: tmp nullify(ptr) if (associated(tmp)) then select type(tmp) type is(toml_table) ptr => tmp if (present(stat)) stat = toml_stat%success class default if (present(stat)) stat = toml_stat%fatal end select else call check_table(table) end if end subroutine get_table subroutine check_table(tab) class(toml_table), intent(out) :: tab print *, "inside check_table" end subroutine check_table end module class_default_select_type_user lfortran-0.63.0/integration_tests/derived_types_25.f900000664000175000017500000000162215174404631023062 0ustar alastairalastairmodule derived_types_25_fpm_error implicit none type :: error_t character(len=:), allocatable :: message end type error_t contains function bad_name_error(error, label, name) type(error_t), allocatable, intent(out) :: error character(len=*), intent(in) :: label character(len=*), intent(in) :: name logical :: bad_name_error allocate(error) error%message = label//"_"//name bad_name_error = allocated(error%message) end function bad_name_error end module derived_types_25_fpm_error program derived_types_25 use derived_types_25_fpm_error implicit none type(error_t), allocatable :: error character(len=:), allocatable :: message print *, allocated(message) if( allocated(message) ) error stop if( .not. bad_name_error(error, "1", "x") ) error stop print *, error%message if( error%message /= "1_x" ) error stop end program lfortran-0.63.0/integration_tests/derived_types_77.f900000664000175000017500000000212415174404631023067 0ustar alastairalastairmodule m_toml_array type :: toml_array integer :: key contains procedure :: get end type toml_array contains subroutine get(this, n) class(toml_array), intent(inout) :: this integer, intent(in) :: n this%key = n end subroutine get end module m_toml_array module derived_types_77_mod type :: toml_table character(len=:), allocatable :: key contains procedure :: get end type toml_table contains subroutine get(this, key) class(toml_table), intent(inout) :: this character(len=*), intent(in) :: key this%key = key end subroutine get end module derived_types_77_mod program derived_types_77 use m_toml_array use derived_types_77_mod implicit none type(toml_table) :: tbl type(toml_array) :: arr arr%key = 10 tbl%key = "Hello" if (arr%key /= 10) error stop if (tbl%key /= "Hello") error stop call arr%get(5) call tbl%get("World") if (arr%key /= 5) error stop if (tbl%key /= "World") error stop end program derived_types_77lfortran-0.63.0/integration_tests/intrinsics_347.f900000664000175000017500000000075015174404631022471 0ustar alastairalastairprogram intrinsics_347 integer :: x(2, 2), y(4, 2, 2) x = reshape([1, 2, 3, 4], [2, 2]) y = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 2, 2]) print *, reshape([1, 2, 3, 4],[2, 2]) if (any(x /= reshape([1, 2, 3, 4], [2, 2]))) error stop print *, reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 2, 2]) if (any(y /= reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 2, 2]))) error stop end programlfortran-0.63.0/integration_tests/submodule_37d.f900000664000175000017500000000035015174404631022357 0ustar alastairalastairmodule submodule_37_user use submodule_37_mod, only: mytype implicit none contains subroutine use_it() type(mytype) :: t t = mytype("1.0 2.0 3.0") print *, t%get_val() end subroutine end module submodule_37_user lfortran-0.63.0/integration_tests/class_54.f900000664000175000017500000000304015174404631021317 0ustar alastairalastairmodule class_54_m implicit none type :: hashmap_type integer(4) :: num_entries = 3 end type hashmap_type end module class_54_m program test_open_maps use class_54_m implicit none type(hashmap_type) :: map, map2 ! intent(out) print *, map%num_entries if (map%num_entries /= 3) error stop call init_open_map(map) print *, map%num_entries if (map%num_entries /= 3) error stop map%num_entries = map%num_entries + 1 print *, map%num_entries if (map%num_entries /= 4) error stop call init_open_map(map) print *, map%num_entries if (map%num_entries /= 3) error stop ! intent(inout) print *, map2%num_entries if (map2%num_entries /= 3) error stop call init_open_map_inout(map2, 3) print *, map2%num_entries if (map2%num_entries /= 3) error stop map2%num_entries = map2%num_entries + 1 print *, map2%num_entries if (map2%num_entries /= 4) error stop call init_open_map_inout(map2, 4) print *, map2%num_entries if (map2%num_entries /= 4) error stop contains subroutine init_open_map( map ) class(hashmap_type), intent(out) :: map print *, map%num_entries if (map%num_entries /= 3) error stop end subroutine init_open_map subroutine init_open_map_inout( map, i ) class(hashmap_type), intent(inout) :: map integer, intent(in) :: i print *, i, map%num_entries if (map%num_entries /= i) error stop end subroutine init_open_map_inout end program test_open_maps lfortran-0.63.0/integration_tests/modules_29_module3.f900000664000175000017500000000155515174404631023325 0ustar alastairalastairmodule fpm_manifest_executable use fpm_manifest_dependency1, only : dependency_config_t, error_t, toml_table, new_dependencies implicit none public :: executable_config_t, new_executable type :: executable_config_t character(len=:), allocatable :: name character(len=:), allocatable :: source_dir character(len=:), allocatable :: main type(dependency_config_t), allocatable :: dependency(:) end type executable_config_t contains subroutine new_executable(self, table, error) type(executable_config_t), intent(out) :: self type(toml_table), intent(inout) :: table type(error_t), allocatable, intent(out) :: error type(toml_table), pointer :: child call new_dependencies(self%dependency, child, error=error) end subroutine new_executable end module fpm_manifest_executable lfortran-0.63.0/integration_tests/file_28.f900000664000175000017500000000137215174404631021140 0ustar alastairalastairprogram file_28 implicit none integer :: unit_num, unit_num2 integer :: stat, a, b, c integer, dimension(5) :: data_out = [10, 20, 30, 40, 50] integer, dimension(5) :: data_in ! Choose a unit number unit_num = 20 ! Write data to file open(unit=unit_num, file='file_28.txt', status='replace') write(unit_num, *) data_out rewind(unit_num) open(unit=unit_num) read(unit_num, *) data_in close(unit_num, status='delete') open(newunit=unit_num2, file='file_28.txt', status='replace', access='stream', form='unformatted') write(unit_num2) 1, 2, 3 rewind(unit_num2) read(unit_num2) a, b, c close(unit_num2, status='delete') if (a /= 1 .or. b /= 2 .or. c /= 3) error stop end program file_28lfortran-0.63.0/integration_tests/gpu_metal_104.f900000664000175000017500000000350415174404631022250 0ustar alastairalastairmodule gpu_metal_104_m implicit none type :: tensor_t real, allocatable :: values_(:) end type contains subroutine compute(inputs, n, results, & a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, & a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, & a21, a22, a23, a24, a25, a26, a27, a28, a29, a30) type(tensor_t), intent(in) :: inputs(:) integer, intent(in) :: n real, intent(out) :: results(n) real, intent(in) :: a1(:), a2(:), a3(:), a4(:), a5(:) real, intent(in) :: a6(:), a7(:), a8(:), a9(:), a10(:) real, intent(in) :: a11(:), a12(:), a13(:), a14(:), a15(:) real, intent(in) :: a16(:), a17(:), a18(:), a19(:), a20(:) real, intent(in) :: a21(:), a22(:), a23(:), a24(:), a25(:) real, intent(in) :: a26(:), a27(:), a28(:), a29(:), a30(:) integer :: i do concurrent (i = 1:n) results(i) = inputs(i)%values_(1) + & a1(i) + a2(i) + a3(i) + a4(i) + a5(i) + & a6(i) + a7(i) + a8(i) + a9(i) + a10(i) + & a11(i) + a12(i) + a13(i) + a14(i) + a15(i) + & a16(i) + a17(i) + a18(i) + a19(i) + a20(i) + & a21(i) + a22(i) + a23(i) + a24(i) + a25(i) + & a26(i) + a27(i) + a28(i) + a29(i) + a30(i) end do end subroutine end module program gpu_metal_104 use gpu_metal_104_m implicit none integer, parameter :: n = 4 type(tensor_t) :: inputs(n) real :: results(n), zeros(n) integer :: i zeros = 0.0 do i = 1, n inputs(i) = tensor_t(values_=[real(i)]) end do call compute(inputs, n, results, & zeros, zeros, zeros, zeros, zeros, zeros, zeros, zeros, zeros, zeros, & zeros, zeros, zeros, zeros, zeros, zeros, zeros, zeros, zeros, zeros, & zeros, zeros, zeros, zeros, zeros, zeros, zeros, zeros, zeros, zeros) do i = 1, n if (abs(results(i) - real(i)) > 1.0e-6) error stop end do print *, "ok" end program lfortran-0.63.0/integration_tests/separate_compilation_48a.f900000664000175000017500000000046115174404631024564 0ustar alastairalastairmodule separate_compilation_48a_types implicit none type :: string_t end type type :: srcfile_t end type type :: package_t character(:), allocatable :: name type(srcfile_t), allocatable :: sources(:) end type type :: fpm_model_t type(package_t), allocatable :: packages(:) end type end module lfortran-0.63.0/integration_tests/intrinsics_03.f900000664000175000017500000000071015174404631022372 0ustar alastairalastairprogram intrinsics_03 use iso_fortran_env, only: dp => real64 real :: x integer :: i = -12 real(dp) :: a, r1, r2 a = 4.2_dp x = cos(9.5) if (abs(x + 0.997172177) > 1e-7) error stop if (abs(cos(a) + 0.49026082) > 1e-7) error stop if (abs(cos(cos(1.5) + cos(a+cos(a))) - 0.71640354) > 1e-7) error stop r1 = dcos(a) r2 = -0.4902608213406995_dp if (dabs(r1-r2) > 1e-15_dp) error stop print *, iabs(i) if (iabs(i) /= 12) error stop end program intrinsics_03 lfortran-0.63.0/integration_tests/procedure_pointer_12.f900000664000175000017500000000276015174404631023744 0ustar alastairalastairmodule procedure_pointer_12_mod implicit none abstract interface subroutine callback_iface(flag, code_int, code_char) logical, intent(in) :: flag integer, intent(in), optional :: code_int character(len=*), intent(in), optional :: code_char end subroutine end interface type :: callback_entry procedure(callback_iface), pointer, nopass :: callback => null() end type contains subroutine my_callback(flag, code_int, code_char) logical, intent(in) :: flag integer, intent(in), optional :: code_int character(len=*), intent(in), optional :: code_char if (present(code_int)) then if (code_int /= 42) error stop end if if (present(code_char)) then if (code_char /= "hello") error stop end if end subroutine subroutine run_callback(entry, flag, code_int, code_char) type(callback_entry), intent(in) :: entry logical, intent(in) :: flag integer, intent(in), optional :: code_int character(len=*), intent(in), optional :: code_char call entry%callback(flag, code_int, code_char) end subroutine end module program procedure_pointer_12 use procedure_pointer_12_mod implicit none type(callback_entry) :: e e%callback => my_callback call run_callback(e, .true., code_int=42) call run_callback(e, .true., code_char="hello") call run_callback(e, .true.) print *, "ok" end program lfortran-0.63.0/integration_tests/statement_02.f900000664000175000017500000000015415174404631022212 0ustar alastairalastairsubroutine gscale() real fpoint fpoint(i) = i end program statement_02 call gscale() end program lfortran-0.63.0/integration_tests/separate_compilation_15a.f900000664000175000017500000000117315174404631024557 0ustar alastairalastairmodule separate_compilation_15a_module implicit none private public :: test_solver contains subroutine test_solver() real :: xl(2) real :: xu(2) call recursive_fun2() print *, "xl = ", xl if ( abs(sum(xl) - (-7.0)) > 1e-8 ) error stop print *, "xu = ", xu if ( abs(sum(xu) - 2.0) > 1e-8 ) error stop contains subroutine take_xl_xu(xl, xu) implicit none real, intent(out) :: xl(:) real, intent(out) :: xu(:) xl = [12.0, -19.0] xu = [1.0, 1.0] end subroutine subroutine recursive_fun2() implicit none call take_xl_xu(xl, xu) end subroutine recursive_fun2 end subroutine test_solver end module separate_compilation_15a_module lfortran-0.63.0/integration_tests/fortran_primes_01.f900000664000175000017500000000227215174404631023242 0ustar alastairalastairmodule fortran_primes_01_module use iso_fortran_env implicit none integer, parameter :: IP = int32 ! Integer kind parameter for 32-bit integers integer, parameter :: WP = int64 ! Integer kind parameter for 64-bit integers end module fortran_primes_01_module elemental function witnesses_for_64(n) result(i) use fortran_primes_01_module implicit none integer(WP), intent(in) :: n ! Input integer with kind parameter WP integer(WP) :: i ! Output integer with kind parameter WP ! Compute the number of Miller-Rabin witnesses for n using bitwise XOR, left shift, and multiplication i = ieor(shifta(n, 32_WP), n) * int(z'45d9f3b3335b369', WP) end function witnesses_for_64 program fortran_primes_01 use fortran_primes_01_module implicit none integer(WP) :: n, i interface function witnesses_for_64(n) result(i) use fortran_primes_01_module implicit none integer(WP), intent(in) :: n integer(WP) :: i end function witnesses_for_64 end interface n = 2_WP ! Set n to 2 (with kind parameter WP) i = witnesses_for_64(n) print *, i if (i /= 629165251193693906_WP) error stop end program lfortran-0.63.0/integration_tests/submodule_38c.f900000664000175000017500000000023415174404631022360 0ustar alastairalastairsubmodule(submodule_38_mod) submodule_38_child_sub implicit none contains module procedure multiply r = self%k_ * vec end procedure end submodule lfortran-0.63.0/integration_tests/intrinsics_428.f900000664000175000017500000000151715174404631022473 0ustar alastairalastair! Test: merge() with array-valued mask inside a large loop should not ! overflow the stack. Regression test for a bug where ReAlloc codegen ! placed an alloca inside the loop body instead of the entry block. program intrinsics_428 implicit none type :: t real, allocatable :: v(:) end type integer, parameter :: n = 300000 type(t) :: arr(n) real :: h(2, n) integer :: j call random_number(h) do j = 1, n arr(j)%v = merge(1.0, 0.0, h(:,j) < 0.5) end do ! Verify the results: each arr(j)%v should have 2 elements, ! each being either 0.0 or 1.0. do j = 1, n if (size(arr(j)%v) /= 2) error stop if (arr(j)%v(1) /= 0.0 .and. arr(j)%v(1) /= 1.0) error stop if (arr(j)%v(2) /= 0.0 .and. arr(j)%v(2) /= 1.0) error stop end do print *, "ok" end program lfortran-0.63.0/integration_tests/gpu_metal_145.f900000664000175000017500000000107315174404631022254 0ustar alastairalastairprogram gpu_metal_145 implicit none real :: x(4), y(4) integer :: i x = [1.0, 2.0, 3.0, 4.0] do concurrent(i = 1:4) y(i) = compute(x(i)) end do if (abs(y(1) - 2.0) > 1.0e-6) error stop if (abs(y(2) - 3.0) > 1.0e-6) error stop if (abs(y(3) - 4.0) > 1.0e-6) error stop if (abs(y(4) - 5.0) > 1.0e-6) error stop print *, "PASS" contains pure function compute(x) result(r) real, intent(in) :: x real :: r associate(n => 1) associate(z => x + real(n)) r = z end associate end associate end function end program lfortran-0.63.0/integration_tests/separate_compilation_26.f900000664000175000017500000000033715174404631024421 0ustar alastairalastairprogram separate_compilation_26 use quadrature_separate_compilation_26 , only: gauss_legendre implicit none integer :: x = 1 call gauss_legendre(x) print *, x if (x /= 2) error stop end programlfortran-0.63.0/integration_tests/block_14.f900000664000175000017500000000115715174404631021307 0ustar alastairalastair! Test: nested blocks with VLA inside a loop must not leak stack space. ! Each iteration allocates block-scoped variables via alloca; stacksave/ ! stackrestore must reclaim the space so the stack does not overflow. program block_14 implicit none integer :: n, i n = 3 do i = 1, 20000 block real :: a(n, n) a = 0.0 block real :: b(3, 3), c(3) b = 0.0 c = 0.0 end block a = a + 1.0 if (a(1, 1) /= 1.0) error stop end block end do print *, "ok" end program block_14 lfortran-0.63.0/integration_tests/procedure_26.f900000664000175000017500000000337315174404631022212 0ustar alastairalastairmodule procedure_26_mod_1 implicit none private public :: error_type type :: error_type integer :: stat = 0 character(len=:), allocatable :: message end type error_type end module procedure_26_mod_1 module procedure_26_mod_2 use procedure_26_mod_1, only: error_type implicit none private public :: check interface check module procedure :: check_stat module procedure :: check_logical end interface check contains subroutine check_stat(error, stat, message) type(error_type), allocatable, intent(out) :: error integer, intent(in) :: stat character(len=*), intent(in), optional :: message if (stat /= 0) then allocate(error) error%stat = stat if (present(message)) error%message = message end if end subroutine check_stat subroutine check_logical(error, expression, message) type(error_type), allocatable, intent(out) :: error logical, intent(in) :: expression character(len=*), intent(in), optional :: message if (.not. expression) then allocate(error) error%stat = 1 if (present(message)) error%message = message end if end subroutine check_logical end module procedure_26_mod_2 program procedure_26 use procedure_26_mod_1, only: error_type use procedure_26_mod_2, only: check implicit none type(error_type), allocatable :: error integer, pointer :: ptr => null() call check(error, .not.associated(ptr), "Pointer should not be associated") if (allocated(error)) then error stop "Test failed: "//trim(error%message) else print *, "Test passed" end if end program procedure_26 lfortran-0.63.0/integration_tests/intrinsics_291.f900000664000175000017500000000403415174404631022466 0ustar alastairalastairprogram intrinsics_291 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(dp) :: a real(sp) :: d integer :: i real(dp) :: log_runtime_dp(3) = [0.73925_dp, 4.6272183_dp, 82.1483927190_dp] real(sp) :: log_runtime_sp(3) = [0.73925, 4.6272183, 8.14839] real(dp) :: log_res_dp(3) real(sp) :: log_res_sp(3) real(dp) :: expected_dp(3) = [1.2399882923281214_dp, 13.907361652217805_dp, 1.1139704077610786E+121_dp] real(sp) :: expected_sp(3) = [1.23998833, 13.9073610, 6807.07861] real(dp), parameter :: res(3) = gamma([0.73925_dp, 4.6272183_dp, 82.1483927190_dp]) real(sp), parameter :: res_sp(3) = gamma([0.73925, 4.6272183_sp, 8.14839]) do i = 1, 3 print *, res(i) if (abs(res(i) - expected_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, res_sp(i) if (abs(res_sp(i) - expected_sp(i)) > 1e-5) error stop end do log_res_dp = gamma(log_runtime_dp) log_res_sp = gamma(log_runtime_sp) do i = 1, 3 print *, log_res_dp(i) if (abs(log_res_dp(i) - expected_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, log_res_sp(i) if (abs(log_res_sp(i) - expected_sp(i)) > 1e-5) error stop end do a = gamma(21.7282828_dp) d = gamma(11.63827) print *, a if (a - 2.22349180143608259e+19_dp > 1e-12_dp) error stop print *,gamma(21.7282828_dp) if (gamma(21.7282828_dp) - 2.22349180143608259e+19_dp > 1e-12_dp) error stop print *, d if (d - 16592656.0_sp > 1e-5) error stop print *, gamma(11.63827) if (gamma(11.63827) - 16592656.0_sp > 1e-5) error stop a = gamma(61.72812_dp) d = gamma(7.72818) print *, a if (a - 1.65731626595094650e+83_dp > 1e-12_dp) error stop print *,gamma(61.72812_dp) if (gamma(61.72812_dp) - 1.65731626595094650e+83_dp > 1e-12_dp) error stop print *, d if (d - 2.92850854e+03_sp > 1e-5) error stop print *, gamma(7.72818) if (gamma(7.72818) - 2.92850854e+03_sp > 1e-5) error stop end program lfortran-0.63.0/integration_tests/template_semigroup.f900000664000175000017500000000352315174404631023615 0ustar alastairalastairmodule semigroup_m implicit none private public :: semigroup, extended_semigroup, derive_extended_semigroup requirement semigroup(T, combine) type, deferred :: T elemental function combine(x, y) result(combined) type(T), intent(in) :: x, y type(T) :: combined end function end requirement requirement extended_semigroup(T, combine, sconcat, stimes) require :: semigroup(T, combine) pure function sconcat(list) result(combined) type(T), intent(in) :: list(:) !! Must contain at least one element type(T) :: combined end function elemental function stimes(n, a) result(repeated) integer, intent(in) :: n type(T), intent(in) :: a type(T) :: repeated end function end requirement template derive_extended_semigroup(T, combine) require :: semigroup(T, combine) private public :: sconcat, stimes contains pure function sconcat(list) result(combined) type(T), intent(in) :: list(:) type(T) :: combined integer :: i if (size(list) > 0) then combined = list(1) do i = 2, size(list) combined = combine(combined, list(i)) end do else error stop "Attempted to sconcat empty list" end if end function elemental function stimes(n, a) result(repeated) integer, intent(in) :: n type(T), intent(in) :: a type(T) :: repeated integer :: i if (n < 1) error stop "n must be > 0" repeated = a do i = 2, n repeated = combine(repeated, a) end do end function end template end module lfortran-0.63.0/integration_tests/openmp_62.f900000664000175000017500000000105515174404631021513 0ustar alastairalastairprogram openmp_62 use omp_lib implicit none integer :: array(1000), i, j, sum=0 array(1)=3 !$omp teams num_teams(2) thread_limit(5) !$omp distribute do i = 1, 1000, 100 print*,omp_get_num_threads(), omp_get_max_threads() !$omp parallel do do j = i, min(i+99, 1000) array(j) = j * 3 end do !$omp end parallel do end do !$omp end distribute !$omp end teams ! Sum of all elements !$omp parallel do reduction(+:sum) do i=1,1000 sum=sum+array(i) end do !$omp end parallel do print*, sum if(sum/=1501500) error stop end program openmp_62lfortran-0.63.0/integration_tests/implicit_interface_33.f900000664000175000017500000000146515174404631024052 0ustar alastairalastair! Test: external subroutine call inside select type block ! with implicit interface compiles without verify error. module implicit_interface_33_mod implicit none contains subroutine process(value, res) class(*), intent(in) :: value integer, intent(out) :: res res = 0 select type (value) type is (integer) res = value class default call set_default(res) end select end subroutine subroutine set_default(x) integer, intent(out) :: x x = 42 end subroutine end module program implicit_interface_33 use implicit_interface_33_mod implicit none integer :: r call process(10, r) if (r /= 10) error stop call process(3.14, r) if (r /= 42) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/optional_01.f900000664000175000017500000000144215174404631022033 0ustar alastairalastairprogram optional_01 implicit none character(len=1) :: response = "Y" if (lower(response) /= 'y') error stop print *, lower(response) contains elemental pure function lower(str, begin, end) result (string) character(*), intent(in) :: str character(len(str)) :: string integer, intent(in), optional :: begin, end integer :: i integer :: ibegin, iend string = str ibegin = 1 if (present(begin)) then ibegin = max(ibegin, begin) end if iend = len_trim(str) if (present(end)) then iend = min(iend,end) end if do i = ibegin, iend select case (str(i:i)) case ('A':'Z') string(i:i) = char(iachar(str(i:i)) + 32) case default end select end do end function lower end program lfortran-0.63.0/integration_tests/derived_types_102.f900000664000175000017500000000125415174404631023137 0ustar alastairalastairmodule derived_types_102_mod implicit none type :: node class(node), pointer :: next => null() integer :: val end type node contains subroutine test_self_ref_class_pointer() type(node), target :: a, b a%val = 10 b%val = 20 a%next => b if (a%val /= 10) error stop if (b%val /= 20) error stop if (a%next%val /= 20) error stop if (associated(b%next)) error stop end subroutine test_self_ref_class_pointer end module derived_types_102_mod program derived_types_102 use derived_types_102_mod implicit none call test_self_ref_class_pointer() end program derived_types_102 lfortran-0.63.0/integration_tests/gpu_metal_185.f900000664000175000017500000000131215174404631022254 0ustar alastairalastairprogram gpu_metal_185 ! Test: function returning struct with allocatable array member ! called inside do concurrent with an array expression argument. implicit none type :: t_t real, allocatable :: v(:) end type type(t_t) :: a(2) real :: x(2, 2) integer :: i x = 1.0 do concurrent(i=1:2) a(i) = f(x(:,i) + 1.0) end do if (size(a(1)%v) /= 2) error stop if (size(a(2)%v) /= 2) error stop if (abs(a(1)%v(1) - 2.0) > 1e-6) error stop if (abs(a(1)%v(2) - 2.0) > 1e-6) error stop if (abs(a(2)%v(1) - 2.0) > 1e-6) error stop if (abs(a(2)%v(2) - 2.0) > 1e-6) error stop print *, "PASSED" contains pure function f(v) result(r) real, intent(in) :: v(:) type(t_t) :: r r%v = v end function end program lfortran-0.63.0/integration_tests/block_11.f900000664000175000017500000000237015174404631021302 0ustar alastairalastairmodule block_11_mod implicit none type, abstract :: AbsType contains procedure(nelements), deferred, nopass :: nelements end type AbsType abstract interface pure function nelements() result(n) integer :: n end function nelements end interface type, extends(AbsType) :: ConcreteType contains procedure, nopass :: nelements => concrete_nelements end type ConcreteType type :: MyType class(AbsType), allocatable :: obj contains procedure :: caller end type MyType contains pure function concrete_nelements() result(n) integer :: n n = 3 end function concrete_nelements subroutine caller(self) class(MyType), intent(in) :: self block real(8), dimension(self%obj%nelements()) :: a integer :: i do i = 1, size(a) a(i) = real(i, 8) end do if (size(a) /= 3) error stop if (abs(a(1) - 1.0d0) > 1.0d-12) error stop if (abs(a(3) - 3.0d0) > 1.0d-12) error stop end block end subroutine caller end module block_11_mod program block_11 use block_11_mod implicit none type(MyType) :: m allocate(ConcreteType :: m%obj) call m%caller() print *, "ok" end program block_11 lfortran-0.63.0/integration_tests/arrays_82.f900000664000175000017500000000265615174404631021530 0ustar alastairalastairsubroutine sub(simi, d) real, intent(inout) :: simi(:, :) real, intent(in) :: d(:) real :: simi_jdrop(size(simi, 2)) simi_jdrop = 11.0 simi_jdrop = matprod(simi, d) print *, "simi_jdrop = ", simi_jdrop if( any( abs(simi_jdrop - 468.00) > 1e-8 ) ) error stop if( size(simi_jdrop) /= 3 ) error stop simi = outprod(matprod(simi, d), simi_jdrop) contains function outprod(x, y) result(z) implicit none real, intent(in) :: x(:) real, intent(in) :: y(:) real :: z(size(x), size(y)) integer :: j z = 0.0 do j = 1, size(y) z = z + x(j) * y(j) end do end function outprod function matprod(x, y) result(z_) implicit none real, intent(in) :: x(:, :) real, intent(in) :: y(:) real, allocatable :: z_(:) integer :: i, j allocate(z_(size(x, 2))) do i = 1, size(x, 2) z_(i) = 0.0 do j = 1, size(y) z_(i) = z_(i) + x(i, j) * y(j) end do end do end function matprod end subroutine program arrays_82 real :: simi(3, 3) real :: d(3) interface subroutine sub(simi, d) real, intent(inout) :: simi(:, :) real, intent(in) :: d(:) end subroutine sub end interface simi = 12.0 d = 13.0 call sub(simi, d) print *, simi if( any(abs(simi - 657072) > 1e-8) ) error stop if( size(simi) /= 9 ) error stop end program lfortran-0.63.0/integration_tests/intrinsics_41.f900000664000175000017500000000017315174404631022377 0ustar alastairalastairprogram intrinsics_41 implicit none integer :: cnt cnt = command_argument_count() print *, cnt end program lfortran-0.63.0/integration_tests/derived_types_84_module.f900000664000175000017500000000040215174404631024427 0ustar alastairalastairmodule derived_types_84_module implicit none type :: Person integer :: age end type Person contains subroutine get_age(p) type(Person), intent(inout) :: p p%age = 30 end subroutine get_age end module derived_types_84_module lfortran-0.63.0/integration_tests/associate_25.f900000664000175000017500000000057015174404631022170 0ustar alastairalastairprogram associate_23 implicit none type :: line_token integer :: first end type type(line_token), allocatable :: token(:) integer :: shift allocate(token(2)) token%first = [2, 4] associate(first => token%first) shift = first(1) - 1 end associate if (shift /= 1) error stop "shift mismatch" end program associate_23 lfortran-0.63.0/integration_tests/select_label_01.f900000664000175000017500000000057015174404631022625 0ustar alastairalastairprogram select_label_01 implicit none integer :: choice choice = 2 SELECT_BLOCK: select case (choice) case (1) case default INNER: block choice = 3 exit SELECT_BLOCK choice = 4 end block INNER end select SELECT_BLOCK print *, "Choice is: ", choice if (choice /= 3) error stop end program select_label_01 lfortran-0.63.0/integration_tests/character_26.f900000664000175000017500000000076215174404631022155 0ustar alastairalastairprogram character_26 ! Test that character array element assignments in a loop ! do not cause stack overflow from alloca in loop body implicit none integer, parameter :: n = 100000 character(len=1) :: a(n), b(n) integer :: i a = "x" b = "y" do i = 1, n a(i) = b(i) b(i) = a(i) end do if (a(1) /= "y") error stop if (b(1) /= "y") error stop if (a(n) /= "y") error stop if (b(n) /= "y") error stop print *, "ok" end program lfortran-0.63.0/integration_tests/intrinsics_37.f900000664000175000017500000000147115174404631022406 0ustar alastairalastairprogram intrinsics_37 real(8) :: tsource(2, 3), fsource(2, 3), ar1(2, 3), ar2(2, 3) logical :: mask(2, 3) real(8) :: real_mask(2, 3) integer :: i, j tsource(1, 1) = 1 tsource(1, 2) = 4 tsource(1, 3) = 2 tsource(2, 1) = 5 tsource(2, 2) = 3 tsource(2, 3) = 6 fsource(1, 1) = 7 fsource(1, 2) = 0 fsource(1, 3) = 8 fsource(2, 1) = -1 fsource(2, 2) = 9 fsource(2, 3) = -2 mask(1, 1) = .true. mask(1, 2) = .false. mask(1, 3) = .false. mask(2, 1) = .true. mask(2, 2) = .true. mask(2, 3) = .false. do i = 1, ubound(mask, 1) do j = 1, ubound(mask, 2) if( mask(i, j) ) then real_mask(i, j) = 1.0_8 else real_mask(i, j) = 0.0_8 end if end do end do ar1 = merge(tsource, fsource, mask) ar2 = tsource * real_mask + fsource * (1.0_4 - real_mask) print *, ar1 - ar2 end programlfortran-0.63.0/integration_tests/passing_array_02.f900000664000175000017500000000277215174404631023060 0ustar alastairalastairMODULE passing_array_02_mod implicit none INTERFACE test_01_interface MODULE PROCEDURE test_01 END INTERFACE test_01_interface INTERFACE test_02_interface MODULE PROCEDURE test_02 END INTERFACE test_02_interface CONTAINS FUNCTION test_01 (len,value) result(res) implicit none INTEGER, intent(in) :: len INTEGER, DIMENSION(3,len),intent(in) :: value INTEGER :: res res = size(value) END FUNCTION test_01 FUNCTION test_02 (value) result(res) implicit none ! Passed array has dimension = 30 while the array in this function has dimension = 3 ! Slicing is premesible (3 <= 30), so accept it. INTEGER, DIMENSION(3,1),intent(in) :: value INTEGER :: res res = size(value) END FUNCTION test_02 subroutine test_entry integer:: len INTEGER, DIMENSION(3, 10) :: arr INTEGER :: ret len = 10 ret = test_01_interface (len,arr) print * , ret if (ret /= 30) error stop ret = test_01 (len,arr) print * , ret if (ret /= 30) error stop ret = test_02_interface (arr) print * , ret if (ret /= 3) error stop ret = test_02 (arr) print * , ret if (ret /= 3) error stop end subroutine test_entry END MODULE passing_array_02_mod program passing_array_02 use passing_array_02_mod implicit none call test_entry end program passing_array_02 lfortran-0.63.0/integration_tests/modules_34_module1a.f900000664000175000017500000000125315174404631023453 0ustar alastairalastairmodule fpm_versioning_modules_34 implicit none type :: version_t integer, allocatable :: num(:) contains procedure :: to_string end type version_t interface char module procedure :: as_string end interface char contains subroutine to_string(self, string) class(version_t), intent(in) :: self character(len=:), allocatable, intent(out) :: string end subroutine to_string function as_string(self) result(string) class(version_t), intent(in) :: self character(len=:), allocatable :: string call self%to_string(string) end function as_string end module fpm_versioning_modules_34 lfortran-0.63.0/integration_tests/arrays_71.f900000664000175000017500000000141415174404631021515 0ustar alastairalastairprogram arrays_71 integer :: x1(5) = [2,1,3,3,2] integer :: x2(3,3) = reshape([1,10,11,22,1,2,1,1,2], [3,3]) integer :: y(3) = [0, 0, 0] integer :: y2(5) = [0, 0, 0, 0, 0] integer :: z = 2 y = [z, x2(1,1), x2(1,2)] if(y(1) /= 2 .or. y(2) /= 1 .or. y(3) /= 22) error stop y = [z, x1([1,2])] if(y(1) /= 2 .or. y(2) /= 2 .or. y(3) /= 1) error stop y = [z, x2([1,2],1)] if(y(1) /= 2 .or. y(2) /= 1 .or. y(3) /= 10) error stop y2 = [z, x2([1,2],[1,2])] if(y2(1) /= 2 .or. y2(2) /= 1 .or. y2(3) /= 10 .or. y2(4) /= 22 .or. y2(5) /= 1) error stop y2 = [z, x2(2:3,2:3)] if(y2(1) /= 2 .or. y2(2) /= 1 .or. y2(3) /= 2 .or. y2(4) /= 1 .or. y2(5) /= 2) error stop y2 = [z, x2(1:2,[1,2])] if(y2(1) /= 2 .or. y2(2) /= 1 .or. y2(3) /= 10 .or. y2(4) /= 22 .or. y2(5) /= 1) error stop end programlfortran-0.63.0/integration_tests/procedure_38.f900000664000175000017500000000231215174404631022205 0ustar alastairalastair! Test: nopass procedure pointer in derived type with assumed-shape arrays. ! Verifies pass_array_by_data handles struct member procedure pointers ! whose type declaration has array arguments. module procedure_38_mod implicit none abstract interface subroutine vector_sub(x, y) double precision, intent(in) :: x(:) double precision, intent(inout) :: y(:) end subroutine end interface type :: linop_type procedure(vector_sub), nopass, pointer :: matvec => null() end type contains subroutine solve(A, b, x) class(linop_type), intent(in) :: A double precision, intent(in) :: b(:) double precision, intent(inout) :: x(:) call A%matvec(b, x) end subroutine end module program procedure_38 use procedure_38_mod implicit none type(linop_type) :: op double precision :: b(5), x(5) op%matvec => my_matvec b = 1.0d0 x = 0.0d0 call solve(op, b, x) if (any(abs(x - 2.0d0) > 1.0d-12)) error stop contains subroutine my_matvec(x, y) double precision, intent(in) :: x(:) double precision, intent(inout) :: y(:) y = 2.0d0 * x end subroutine end program lfortran-0.63.0/integration_tests/arrays_22.f900000664000175000017500000000067115174404631021515 0ustar alastairalastairprogram arrays_22 use iso_fortran_env, only: wp => real64 implicit none real(wp), dimension(3), parameter :: dpmpar = [epsilon(1.0_wp), & tiny(1.0_wp), & huge(1.0_wp)] real(wp), parameter :: epsmch = dpmpar(1) print *, epsmch if (abs(epsmch - epsilon(1.0_wp))/epsilon(1.0_wp) > 1e-15_wp) error stop end program lfortran-0.63.0/integration_tests/block_01.f900000664000175000017500000000033115174404631021274 0ustar alastairalastairprogram block_01 implicit none integer :: a, b, d a = 1 b = 2 associate (n => a) block real :: b, c b = 3 c = -3 d = cos(b + c) end block end associate if (b /= 2) error stop if (d /= 1) error stop endlfortran-0.63.0/integration_tests/lapack_04.f900000664000175000017500000000074315174404631021447 0ustar alastairalastair! MRE from LAPACK slals0.f: integer array index into real array ! causes type check assertion: check_equal_type(i32[:], r32[:]) ! Pattern: arr(idx(i)) passed to implicit-interface subroutine subroutine test integer :: idx(2) real :: arr(4) idx(1) = 1 arr = 1.0 call sub(arr(idx(1))) end subroutine test subroutine sub(x) real :: x(*) if (x(1) /= 1.0) stop 1 end subroutine sub program lapack_04 call test print *, 'PASS' end program lapack_04 lfortran-0.63.0/integration_tests/intrinsics_400.f900000664000175000017500000000101415174404631022451 0ustar alastairalastairprogram intrinsics_400 use, intrinsic :: iso_fortran_env, only : compiler_version, compiler_options implicit none character(len=:), allocatable :: cv, co cv = compiler_version() co = compiler_options() print *, "Fortran Compiler Version: ", cv print *, "Fortran Compiler Options: ", co if (len(cv) == 0) error stop ! if (len(co) == 0) error stop ! The output of compiler options can be empty (gfortran outputs platform dependent options) end program intrinsics_400lfortran-0.63.0/integration_tests/string_36.f900000664000175000017500000000026315174404631021524 0ustar alastairalastairprogram string_36 implicit none character(len=5) :: hello hello = "hello" hello(4:3) = "" print *, hello if (hello /= "hello") error stop end program lfortran-0.63.0/integration_tests/separate_compilation_32a.f900000664000175000017500000000043615174404631024557 0ustar alastairalastairmodule mod_separate_compilation_32 implicit none interface module function assemble_divergence(n) result(y) integer, intent(in) :: n real(8) :: y end function assemble_divergence end interface end module mod_separate_compilation_32 lfortran-0.63.0/integration_tests/intrinsics_310.f900000664000175000017500000000132115174404631022452 0ustar alastairalastairprogram intrinsics_310 use iso_fortran_env, only: int8, int16, int32, int64, real32, real64 implicit none integer(int8), parameter :: i1 = digits(127_int8) integer(int16), parameter :: i2 = digits(32_int16) integer(int32), parameter :: i4 = digits(21_int32) integer(int64), parameter :: i8 = digits(9223_int64) integer, parameter :: r4 = digits(1.0_real32) integer, parameter :: r8 = digits(1.0_real64) print *, i1 if (i1 /= 7) error stop print *, i2 if (i2 /= 15) error stop print *, i4 if (i4 /= 31) error stop print *, i8 if (i8 /= 63) error stop print *, r4 if (r4 /= 24) error stop print *, r8 if (r8 /= 53) error stop end program lfortran-0.63.0/integration_tests/format_76.f900000664000175000017500000000032015174404631021504 0ustar alastairalastairprogram format_76 implicit none real :: a character(9) :: a_string a_string = ' 987.654' read (a_string, '(0PF9.4)') a if (abs(a - 987.654) >= 0.001) error stop end program format_76lfortran-0.63.0/integration_tests/coarray_01.f900000664000175000017500000000064315174404631021650 0ustar alastairalastairprogram coarray_01 implicit none integer :: x[*] integer :: y(3)[*] x = this_image() if (x /= 1) error stop ! Coarray reference x[1] should resolve to x in single-image mode if (x[1] /= 1) error stop ! Test with array coarray y = [10, 20, 30] if (y(1)[1] /= 10) error stop if (y(2)[1] /= 20) error stop if (y(3)[1] /= 30) error stop sync all if (num_images() /= 1) error stop print *, "ok" end program coarray_01 lfortran-0.63.0/integration_tests/modules_32.f900000664000175000017500000000100015174404631021650 0ustar alastairalastairmodule fpm_targets implicit none type build_target_ptr type(build_target_t), pointer :: ptr => null() end type build_target_ptr type build_target_t character(:), allocatable :: output_file character(:), allocatable :: version end type build_target_t contains function func() result(target_ptr) type(build_target_t), pointer :: target_ptr target_ptr => null() end function func end module fpm_targets program modules_32 implicit none print *, "running modules_32 program" end program lfortran-0.63.0/integration_tests/infer_walrus_shadow_02.f900000664000175000017500000000060315174404631024252 0ustar alastairalastairprogram infer_walrus_shadow_02 implicit none x := 10 if (x /= 10) error stop block x := 3.14d0 if (abs(x - 3.14d0) > 1.0d-10) error stop block x := .true. if (.not. x) error stop end block if (abs(x - 3.14d0) > 1.0d-10) error stop end block if (x /= 10) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/arrays_reshape_32.f900000664000175000017500000000160015174404631023216 0ustar alastairalastairmodule arrays_reshape_32_mod implicit none integer(4), dimension(1,1), parameter :: & arr = reshape([1, 1], shape(arr), order=[2,1]) integer(4), dimension(2,2), parameter :: & arr2 = reshape([10, 20, 30, 40], shape(arr2)) integer(4), dimension(2,3), parameter :: & arr3 = reshape([1, 2, 3, 4, 5, 6], shape(arr3), order=[2,1]) end module arrays_reshape_32_mod program arrays_reshape_32 use arrays_reshape_32_mod implicit none if (arr(1,1) /= 1) error stop if (arr2(1,1) /= 10) error stop if (arr2(2,1) /= 20) error stop if (arr2(1,2) /= 30) error stop if (arr2(2,2) /= 40) error stop if (arr3(1,1) /= 1) error stop if (arr3(1,2) /= 2) error stop if (arr3(1,3) /= 3) error stop if (arr3(2,1) /= 4) error stop if (arr3(2,2) /= 5) error stop if (arr3(2,3) /= 6) error stop end program arrays_reshape_32 lfortran-0.63.0/integration_tests/pdt_01.f900000664000175000017500000000242615174404631021000 0ustar alastairalastairprogram pdt_01 implicit none type :: container(rk, ik) integer, kind :: rk integer, kind :: ik = selected_int_kind(9) integer(kind=ik) :: i_val real(kind=rk) :: r_val complex(kind=rk) :: c_val end type container type(container(8)) :: obj1 type(container(4, 8)) :: obj2 obj1%i_val = 42_8 obj1%r_val = 3.14_8 obj1%c_val = (1.0_8, -2.0_8) if (kind(obj1%i_val) /= selected_int_kind(9)) error stop "obj1 integer kind check failed" if (kind(obj1%r_val) /= 8) error stop "obj1 real kind check failed" if (obj1%i_val /= 42) error stop "obj1 integer check failed" if (abs(obj1%r_val - 3.14_8) > 1.0e-12_8) error stop "obj1 real check failed" if (abs(real(obj1%c_val) - 1.0_8) > 1.0e-12_8) error stop "obj1 complex real part failed" obj2%i_val = 100_8 obj2%r_val = 2.5_4 obj2%c_val = (5.0_4, 6.0_4) if (kind(obj2%i_val) /= 8) error stop "obj2 integer kind check failed" if (kind(obj2%r_val) /= 4) error stop "obj2 real kind check failed" if (obj2%i_val /= 100_8) error stop "obj2 integer check failed" if (abs(obj2%r_val - 2.5_4) > 1.0e-6_4) error stop "obj2 real check failed" if (abs(aimag(obj2%c_val) - 6.0_4) > 1.0e-6_4) error stop "obj2 complex imag part failed" print *, "PDT kind test passed successfully." end program pdt_01lfortran-0.63.0/integration_tests/format_55.f900000664000175000017500000000026415174404631021510 0ustar alastairalastairprogram format_55 implicit none real :: pi pi = 4*atan(1.0) print "(A,F9.6)", 'pi =', pi if (abs(pi - 3.141593) > 1e-5) error stop "incorrect value" end program format_55lfortran-0.63.0/integration_tests/modules_65.f900000664000175000017500000000107415174404631021671 0ustar alastairalastairprogram modules_65 use modules_65_base, only: base_t, holder_t use modules_65_child, only: child_t use modules_65_worker, only: classify implicit none type(holder_t) :: h1, h2 integer :: r allocate(child_t :: h1%item) h1%item%width = 10 select type (x => h1%item) class is (child_t) x%extra = 99 end select allocate(base_t :: h2%item) h2%item%width = 7 r = classify(h1) if (r /= 99) error stop r = classify(h2) if (r /= 7) error stop print *, "PASSED: modules_65" end program modules_65 lfortran-0.63.0/integration_tests/intrinsics_234.f900000664000175000017500000000575215174404631022473 0ustar alastairalastairprogram intrinsics_234 implicit none logical :: mask(3, 4) logical :: mask_(6, 9) logical :: mask_3(3, 4, 3) logical :: mask_4(4, 5, 3, 1) logical :: res integer, dimension(2,3) :: a, b logical, dimension(2,3) :: mask2 logical, parameter :: c1 = parity([.true., .false., .true., .false.]) logical, parameter :: c2 = parity([.true., .false., .true., .false., .true., .false.]) mask = reshape([ .true., .false., .true., .false., & .true., .false., .true., .false., & .true., .false., .true., .true.], [3, 4]) mask_ = .false. mask_(1, 1) = .true. mask_(1, 2) = .true. mask_(5, 1) = .true. mask_(5, 2) = .true. mask_(6, 7) = .true. mask_(4, 8) = .true. mask_3 = .false. mask_3(1, 1, :) = .true. mask_3(1, 2, :) = .true. mask_3(3, 1, :) = .true. mask_3(2, 2, :) = .true. mask_3(2, 4, :) = .true. mask_3(3, 3, :) = .true. mask_4 = .true. mask_4(1, 1, 1, 1) = .false. mask_4(1, 1, 1, :) = .false. mask_4(1, 1, 1, :) = .false. mask_4(1, 2, 1, :) = .false. mask_4(1, 2, 3, :) = .false. print *, parity(mask) if (parity(mask) .neqv. .true.) error stop print *, parity(mask_) if (parity(mask_) .neqv. .false.) error stop print *, parity(mask_3) if (parity(mask_3) .neqv. .false.) error stop print *, parity(mask, 1) if (any(parity(mask, 1)) .neqv. .true.) error stop print *, parity(mask, 2) if (any(parity(mask, 2)) .neqv. .true.) error stop print *, any(parity(mask_, 1)) if (any(parity(mask_, 1)) .neqv. .true.) error stop print *, shape(parity(mask_, 1)) print *, any(parity(mask_, 2)) if (any(parity(mask_, 2)) .neqv. .true.) error stop print *, shape(parity(mask_, 2)) print *, any(parity(mask_3, 1)) if (any(parity(mask_3, 1)) .neqv. .true.) error stop print *, shape(parity(mask_3, 1)) print *, any(parity(mask_3, 2)) if (any(parity(mask_3, 2)) .neqv. .false.) error stop print *, shape(parity(mask_3, 2)) print *, any(parity(mask_3, 3)) if (any(parity(mask_3, 3)) .neqv. .true.) error stop print *, any(parity(mask_4, 1)) if (any(parity(mask_4, 1)) .neqv. .true.) error stop print *, shape(parity(mask_4, 1)) res = parity(mask_4) if (res .neqv. .true.) error stop res = parity(mask_4) if (res .neqv. .true.) error stop a = reshape( [ 1, 2, 3, 4, 5, 6 ], [ 2, 3 ]) b = reshape( [ 0, 7, 3, 4, 5, 8 ], [ 2, 3 ]) print *, a(1,:) print *, a(2,:) print * print *, b(1,:) print *, b(2,:) print * mask2 = a.ne.b print '(3l3)', mask2(1,:) print '(3l3)', mask2(2,:) print * print *, parity(mask2) if (parity(mask2) .neqv. .true.) error stop print * print *, parity(mask2, 1) print * print *, parity(mask2, 2) print*, c1 if (c1 .neqv. .false.) error stop print*, c2 if (c2 .neqv. .true.) error stop print*, kind(c2) if (kind(c2) /= 4) error stop end program lfortran-0.63.0/integration_tests/read_51.f900000664000175000017500000000066715174404631021136 0ustar alastairalastairprogram read_51 implicit none real :: xnan character :: cni*4, msg*200 integer :: ios cni = 'NAN ' read(cni, *, iostat=ios, iomsg=msg) xnan if (ios /= 0) then print *, "Reading 'NAN ' into xnan failed." print *, 'iomsg = '//trim(msg) error stop else if (.not. (xnan /= xnan)) error stop "NaN should not equal itself" print "(A,L2,1X,F0.0)", ' NaN/=NaN?', xnan /= xnan, xnan end if end program read_51 lfortran-0.63.0/integration_tests/file_03_data.txt0000664000175000017500000000037515174404631022345 0ustar alastairalastair10 101 Adam Johnson 15 55.4 102 Lisa Martinez 16 48.6 103 Ethan Thompson 14 50.0 104 Emma Davis 15 45.3 105 Benjamin Wilson 16 60.8 106 Sophia Taylor 14 50.7 107 Oliver Harris 15 56.2 108 Ava Jackson 16 47.6 109 Lucas Hall 14 58.1 110 Mia Young 15 46.9 lfortran-0.63.0/integration_tests/cpp_pre_09.f900000664000175000017500000000142615174404631021650 0ustar alastairalastair#ifdef __GFORTRAN__ #define MACRO_SAME(A) A #define MACRO_CAT2(A,B) MACRO_SAME(A)B #define MACRO_CAT3(A,B,C) MACRO_CAT2(A,B)C #define MACRO_STRINGIFY(A) "A" #else #define MACRO_CAT2(A,B) A ## B #define MACRO_CAT3(A,B,C) A ## B ## C #define MACRO_STRINGIFY(A) #A #endif #define ADD_ARGUMENT(n) res = MACRO_CAT2(a,n) module mre_method implicit none contains function method_create_1(a1) result(res) integer, intent(in) :: a1 integer :: res ADD_ARGUMENT(1) end function end module mre_method program cpp_pre_09 use mre_method, only: method_create_1 implicit none integer :: x x = method_create_1(42) if (x /= 42) error stop print *, "Tested cpp_pre_09: ", x end program cpp_pre_09 lfortran-0.63.0/integration_tests/derived_types_84.f900000664000175000017500000000033215174404631023064 0ustar alastairalastairprogram derived_types_84 use derived_types_84_module implicit none type(Person) :: p1 p1%age = 25 call get_age(p1) print *, p1%age if (p1%age /= 30) error stop end program derived_types_84 lfortran-0.63.0/integration_tests/functions_05.f900000664000175000017500000000130715174404631022222 0ustar alastairalastairprogram functions_01 implicit none integer :: x = 5, y real :: p = 5, q real :: a, b, c y = f(x) print *, y q = f_real(p) print *, q a = 20.0 b = -30.0 c = signr32(a, b) print *, c contains integer function f(a) result(b) integer, intent(in) :: a integer :: x x = 2 b = a + x end function real function f_real(a) result(b) real, intent(in) :: a b = a + signr32(1.0, a) end function real(4) function signr32(x, y) result(r) real(4), intent(in) :: x, y r = x if ((x >= 0.0 .and. y >= 0.0) .or. (x <= 0.0 .and. y <= 0.0)) then r = x else r = -x end if end function end program lfortran-0.63.0/integration_tests/separate_compilation_10a.f900000664000175000017500000000037715174404631024557 0ustar alastairalastairmodule history_mod_separate_compilation_10a contains subroutine rangehist(xhist) real, intent(inout) :: xhist(:, :) real :: x(25) x = 12.912 xhist = reshape(x, shape(xhist)) xhist = 99.124 end subroutine end module lfortran-0.63.0/integration_tests/submodule_40a.f900000664000175000017500000000017215174404631022350 0ustar alastairalastairprogram submodule_40 use submodule_40_mod, only: show_name implicit none call show_name() end program submodule_40 lfortran-0.63.0/integration_tests/floor_01.f900000664000175000017500000000100215174404631021317 0ustar alastairalastairprogram floor_01 implicit none real, parameter :: x1 = 3.3 ! 3 real, parameter :: x2 = 3.5 ! 3 real, parameter :: x3 = 3.7 ! 3 real, parameter :: y1 = -3.3 ! -4 real, parameter :: y2 = -3.5 ! -4 real, parameter :: y3 = -3.7 ! -4 if(floor(x1, kind=8) /= 3_8 .or. floor(x2) /= 3 .or. floor(x3) /= 3) error stop if(floor(y1, kind=4) /= -4 .or. floor(y2) /= -4 .or. floor(y3, kind=8) /= -4) error stop print*, floor(x1), floor(x2), floor(x3) print*, floor(y1), floor(y2), floor(y3) end program lfortran-0.63.0/integration_tests/associate_12.f900000664000175000017500000000563715174404631022175 0ustar alastairalastairprogram associate_12 implicit none complex, target :: my_complex_one_dim(2) complex, pointer :: my_complex_one_dim_mirror(:) real, pointer :: my_complex_one_dim_re(:) real, pointer :: my_complex_one_dim_im(:) complex, target :: my_complex(2, 3) complex, pointer :: my_complex_mirror(:, :) real, pointer :: my_complex_re(:, :) real, pointer :: my_complex_im(:, :) my_complex_one_dim(1) = (2, 5) my_complex_one_dim(2) = (-2, -5) my_complex_one_dim_mirror => my_complex_one_dim print *, my_complex_one_dim_mirror(1), my_complex_one_dim_mirror(2) if (abs(my_complex_one_dim_mirror(1) - (2, 5)) > 1e-5) error stop if (abs(my_complex_one_dim_mirror(2) - (-2, -5)) > 1e-5) error stop my_complex_one_dim_re => my_complex_one_dim%re print *, my_complex_one_dim_re(1), my_complex_one_dim_re(2) if (abs(my_complex_one_dim_re(1) - 2) > 1e-5) error stop if (abs(my_complex_one_dim_re(2) - (-2)) > 1e-5) error stop my_complex_one_dim_im => my_complex_one_dim%im print *, my_complex_one_dim_im(1), my_complex_one_dim_im(2) if (abs(my_complex_one_dim_im(1) - 5) > 1e-5) error stop if (abs(my_complex_one_dim_im(2) - (-5)) > 1e-5) error stop my_complex = reshape([(1, 2), (3, 4), (5, 6), (7, 8), (9, 10), (11, 12)], [2, 3]) my_complex_mirror => my_complex print *, my_complex_mirror(1, 1), my_complex_mirror(1, 2), my_complex_mirror(1, 3) print *, my_complex_mirror(2, 1), my_complex_mirror(2, 2), my_complex_mirror(2, 3) if (abs(my_complex_mirror(1, 1) - (1, 2)) > 1e-5) error stop if (abs(my_complex_mirror(1, 2) - (5, 6)) > 1e-5) error stop if (abs(my_complex_mirror(1, 3) - (9, 10)) > 1e-5) error stop if (abs(my_complex_mirror(2, 1) - (3, 4)) > 1e-5) error stop if (abs(my_complex_mirror(2, 2) - (7, 8)) > 1e-5) error stop if (abs(my_complex_mirror(2, 3) - (11, 12)) > 1e-5) error stop my_complex_re => my_complex%re print *, my_complex_re(1, 1), my_complex_re(1, 2), my_complex_re(1, 3) print *, my_complex_re(2, 1), my_complex_re(2, 2), my_complex_re(2, 3) if (abs(my_complex_re(1, 1) - 1) > 1e-5) error stop if (abs(my_complex_re(1, 2) - 5) > 1e-5) error stop if (abs(my_complex_re(1, 3) - 9) > 1e-5) error stop if (abs(my_complex_re(2, 1) - 3) > 1e-5) error stop if (abs(my_complex_re(2, 2) - 7) > 1e-5) error stop if (abs(my_complex_re(2, 3) - 11) > 1e-5) error stop my_complex_im => my_complex%im print *, my_complex_im(1, 1), my_complex_im(1, 2), my_complex_im(1, 3) print *, my_complex_im(2, 1), my_complex_im(2, 2), my_complex_im(2, 3) if (abs(my_complex_im(1, 1) - 2) > 1e-5) error stop if (abs(my_complex_im(1, 2) - 6) > 1e-5) error stop if (abs(my_complex_im(1, 3) - 10) > 1e-5) error stop if (abs(my_complex_im(2, 1) - 4) > 1e-5) error stop if (abs(my_complex_im(2, 2) - 8) > 1e-5) error stop if (abs(my_complex_im(2, 3) - 12) > 1e-5) error stop end program lfortran-0.63.0/integration_tests/allocate_source_ptr_01.f900000664000175000017500000000061315174404631024236 0ustar alastairalastairprogram allocate_source_ptr_01 implicit none type :: t integer :: x end type type(t), pointer :: src, dest allocate(src) src%x = 1 allocate(dest, source=src) if (dest%x /= 1) error stop "dest%x should be 1" ! Verify deep copy, not aliasing src%x = 2 if (dest%x /= 1) error stop "shallow copy detected" print *, "PASS" deallocate(src) deallocate(dest) end program lfortran-0.63.0/integration_tests/cycle_and_exit3.f900000664000175000017500000000053615174404631022746 0ustar alastairalastairprogram loop_and_block integer :: i l1 : do i = 1, 10 print *, "l1", i b1 : block if (i > 2) then exit l1 end if end block b1 if (i > 2) then print *, "error l1" end if end do l1 if (i == 3) then print *, "pass" end if end programlfortran-0.63.0/integration_tests/separate_compilation_44b.f900000664000175000017500000000062115174404631024557 0ustar alastairalastairmodule separate_compilation_44b_module use separate_compilation_44a_module implicit none contains subroutine client() type(MyType) :: a, b a%val = 3.0d0 b = a ** 2 if (abs(b%val - 9.0d0) > 1.0d-12) error stop b = a ** 2.0d0 if (abs(b%val - 9.0d0) > 1.0d-12) error stop end subroutine client end module separate_compilation_44b_module lfortran-0.63.0/integration_tests/string_106.f900000664000175000017500000000046315174404631021604 0ustar alastairalastairprogram string_106 implicit none character(:), allocatable :: string integer :: n string = '0123456789' if (len(string) /= 10) error stop do n = 1, 5 string = repeat(string, 10) if (len(string) /= 10**(n+1)) error stop print *, len(string), 10**(n+1) end do end program string_106 lfortran-0.63.0/integration_tests/class_86.f900000664000175000017500000000132115174404631021324 0ustar alastairalastairmodule class_86_mod type :: downloader_t integer, allocatable :: arr(:) contains procedure, nopass :: upload_form end type downloader_t contains subroutine upload_form(strs) integer, dimension(:), intent(in) :: strs end subroutine upload_form subroutine get_from_registry(downloader_) class(downloader_t), intent(inout) :: downloader_ integer :: i allocate(downloader_%arr(10)) downloader_%arr = [(i, i=1,10)] end subroutine get_from_registry end module class_86_mod program class_86 use class_86_mod implicit none type(downloader_t) :: dl integer :: i call get_from_registry(dl) if (any(dl%arr /= [(i, i=1,10)])) error stop end program class_86 lfortran-0.63.0/integration_tests/file_31_data.txt0000664000175000017500000000015715174404631022344 0ustar alastairalastair10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 lfortran-0.63.0/integration_tests/derived_types_14_module.f900000664000175000017500000000115215174404631024423 0ustar alastairalastairmodule derived_types_14_module !> Possible kinds of TOML values in key-value pairs implicit none private type :: enum_type !> Invalid type integer :: invalid = 100 !> String type integer :: string = 101 !> Boolean type integer :: boolean = 102 !> Integer type integer :: int = 103 !> Float type integer :: float = 104 !> Datetime type integer :: datetime = 105 end type enum_type !> Actual enumerator with TOML value types type(enum_type), public, parameter :: toml_type = enum_type() end module lfortran-0.63.0/integration_tests/template_simple_01.f900000664000175000017500000000376415174404631023403 0ustar alastairalastairmodule template_simple_01_m implicit none private public :: generic_sum, test_template requirement operator_r(T, U, V, binary_func) type, deferred :: T type, deferred :: U type, deferred :: V pure elemental function binary_func(lhs, rhs) result(res) type(T), intent(in) :: lhs type(U), intent(in) :: rhs type(V) :: res end function end requirement requirement cast_r(T, cast) type, deferred :: T pure elemental function cast(arg) result(res) integer, intent(in) :: arg type(T) :: res end function end requirement contains pure elemental function cast_integer(arg) result(res) integer, intent(in) :: arg integer :: res res = 0 end function pure elemental function cast_real(arg) result(res) integer, intent(in) :: arg real :: res res = 0.0 end function pure function generic_sum {T, add, cast} (arr) result(res) require :: operator_r(T, T, T, add), cast_r(T, cast) type(T), intent(in) :: arr(:) type(T) :: res integer :: n, i n = size(arr) res = cast(0) if (n > 0) then res = arr(1) do i=2,n res = add(res, arr(i)) end do end if end function subroutine test_template() instantiate generic_sum(integer, operator(+), cast_integer), only: generic_sum_integer => generic_sum instantiate generic_sum(real, operator(+), cast_real), only: generic_sum_real => generic_sum integer :: a_i(10), i, s_i real :: a_r(10), s_r do i = 1, size(a_i) a_i(i) = i a_r(i) = i end do s_i = generic_sum_integer(a_i) s_r = generic_sum_real(a_r) print *, s_i print *, s_r end subroutine end module program template_simple_01 use template_simple_01_m implicit none call test_template() endlfortran-0.63.0/integration_tests/separate_compilation_18.f900000664000175000017500000000023215174404631024414 0ustar alastairalastairprogram separate_compilation_18 use mod_separate_compilation_18, only: f implicit none integer :: i i = f(5) print *, i if (i /= 6) error stop end programlfortran-0.63.0/integration_tests/enum_03.f900000664000175000017500000000050415174404631021152 0ustar alastairalastairprogram enum_03 implicit none integer :: x enum, bind(c) enumerator :: bool = 999 end enum call get_value(x) print *, x if (x /= 999) error stop contains subroutine get_value(i) integer, intent(inout) :: i i = bool end subroutine get_value end program enum_03 lfortran-0.63.0/integration_tests/string_90.f900000664000175000017500000000042315174404631021522 0ustar alastairalastairprogram string_test implicit none character(len=2) :: c(6) = 'a' ! c(1) should be 'a ' not 'a' if (len(c(1)) /= 2) error stop if ((c(1)(1:1) /= "a")) error stop if ((c(1)(2:2) /= " ")) error stop print *, c end program string_test lfortran-0.63.0/integration_tests/if_06.f900000664000175000017500000000051515174404631020611 0ustar alastairalastairprogram bignumcase use iso_fortran_env implicit none integer(int64) :: val integer :: neg_count val = 98765432101_int64 neg_count = 0 select case (val) case (1:) neg_count = neg_count + 1 end select print *, neg_count IF(neg_count /= 1) error stop end programlfortran-0.63.0/integration_tests/complex_17.f900000664000175000017500000000125515174404631021666 0ustar alastairalastairpure function linspace_n_1_cdp_cdp(x, y, n) result(res) integer, intent(in) :: n complex :: res(n) real, intent(in) :: x(n) real, intent(in) :: y(n) res = cmplx(x, y) end function linspace_n_1_cdp_cdp program complex_17 implicit none integer :: i real :: x(10), y(10) complex :: z(10) interface pure function linspace_n_1_cdp_cdp(x, y, n) result(res) integer, intent(in) :: n complex :: res(n) real, intent(in) :: x(n) real, intent(in) :: y(n) end function linspace_n_1_cdp_cdp end interface x = 1.0 y = 2.0 z = linspace_n_1_cdp_cdp(x, y, 10) print *, z print *, abs(z) do i = 1, 10 if (abs(abs(z(i)) - 2.236068) > 1e-8) error stop end do end program lfortran-0.63.0/integration_tests/intrinsics_31.f900000664000175000017500000000117215174404631022376 0ustar alastairalastairprogram intrinsics_31 real :: x = 63.29 real :: y = -63.59 integer, parameter :: dp = kind(0.d0) real(dp) :: z = 0.000001_dp real(dp) :: w = -1.000001_dp real :: x_ceil, y_ceil integer :: z_ceil, w_ceil x_ceil = ceiling(x) y_ceil = ceiling(y) z_ceil = ceiling(z) w_ceil = ceiling(w) if (abs(x_ceil - 64) > 1e-5) error stop if (abs(y_ceil - (-63)) > 1e-5) error stop if(z_ceil /= 1) error stop if(w_ceil /= -1) error stop print *, x_ceil, ceiling(x_ceil) print *, y_ceil, ceiling(y_ceil) print *, z_ceil print *, w_ceil end program intrinsics_31 lfortran-0.63.0/integration_tests/gpu_metal_32.f900000664000175000017500000000045215174404631022167 0ustar alastairalastairprogram gpu_metal_32 implicit none real, allocatable :: x(:) integer :: i, n n = 10 allocate(x(n)) do i = 1, n x(i) = real(i) end do do concurrent (i = 1:n) x(i) = x(i) * 2.0 end do do i = 1, n if (abs(x(i) - real(i) * 2.0) > 1.0e-5) error stop end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/intrinsics_open_close_read_write.f900000664000175000017500000000126415174404631026510 0ustar alastairalastairprogram open_close_read_write implicit none character(len=20) :: msg = 'Some error occured' real, dimension(100) :: x, y real, dimension(100) :: p, q integer, target :: i, u = 1 integer, pointer :: u_ptr; u_ptr => u do i = 1, 100 x(i) = i * 0.1 y(i) = sin(x(i)) * (1 - cos(x(i)/3.0)) end do open(unit=u_ptr, file='open_close_read_write_data.dat', status='replace') do i = 1, 100 write(u, '(10F8.2)') x(i), y(i) end do close(1, err=999, iomsg=msg, iostat=u) 999 open (2, file='open_close_read_write_data.dat', status='old') do i = 1, 100 read(2, *) p(i), q(i) end do close(2) do i = 1, 100 write(*, *) p(i), q(i) end do end program lfortran-0.63.0/integration_tests/nested_struct_proc_01.f900000664000175000017500000000414315174404631024120 0ustar alastairalastairmodule gFTL2_Integer32Complex32OrderedMap use iso_fortran_env implicit none integer, parameter :: I32 = int32 integer, parameter :: R32 = real32 type :: omap_I_Set contains end type omap_I_Set type :: omap_Map private type(omap_I_Set) :: tree complex(kind=R32) :: stored_value ! Module-level target contains procedure :: at_rc => omap_I_at_rc generic :: at => at_rc end type omap_Map type :: Integer32Complex32OrderedMap private type(omap_Map) :: map contains procedure :: insert_key_value => omap_insert_key_value generic :: insert => insert_key_value end type Integer32Complex32OrderedMap contains function omap_I_at_rc(this, key, rc) result(res) class(omap_Map), target, intent(in) :: this integer(kind=I32), intent(in) :: key integer, intent(out) :: rc complex(kind=R32), pointer :: res res => this%stored_value ! Point to module-level target rc = 0 end function omap_I_at_rc recursive subroutine omap_insert_key_value(this, key, value) class(Integer32Complex32OrderedMap), intent(inout) :: this integer(kind=I32), intent(in) :: key complex(kind=R32), intent(in) :: value integer :: status complex(kind=R32), pointer :: tmp real, parameter :: tol = 1.0e-6 ! Tolerance for comparison this%map%stored_value = value ! Store the value tmp => this%map%at(key, rc=status) ! print *, "Real:", real(tmp), "Imag:", aimag(tmp), "Status:", status if (abs(real(tmp) - real(value)) > tol .or. abs(aimag(tmp) - aimag(value)) > tol) then print *, "Test failed: tmp does not match value" error stop end if end subroutine omap_insert_key_value end module gFTL2_Integer32Complex32OrderedMap program nested_struct_proc_01 use gFTL2_Integer32Complex32OrderedMap implicit none type(Integer32Complex32OrderedMap) :: my_map integer(kind=I32) :: key complex(kind=R32) :: value key = 10 value = (2.0_R32, 4.0_R32) call my_map%insert(key, value) print *, "Test passed" end program nested_struct_proc_01lfortran-0.63.0/integration_tests/template_array_02.f900000664000175000017500000000463615174404631023230 0ustar alastairalastairmodule template_array_02_math implicit none private public :: add_integer, zero_integer, add_real, zero_real contains pure function add_integer(x, y) result(r) integer, intent(in) :: x, y integer :: r r = x + y end function pure function zero_integer(x) result(r) integer, intent(in) :: x integer :: r r = 0 end function pure function add_real(x, y) result(r) real, intent(in) :: x, y real :: r r = x + y end function pure function zero_real(x) result(r) real, intent(in) :: x real :: r r = 0 end function end module module template_array_02_m use template_array_02_math implicit none private public :: test_template requirement operations(t, plus_t, zero_t) type, deferred :: t pure function plus_t(l, r) result(rs) type(t), intent(in) :: l, r type(t) :: rs end function pure function zero_t(l) result(rs) type(t), intent(in) :: l type(t) :: rs end function end requirement template array_tmpl(t, plus_t, zero_t) require :: operations(t, plus_t, zero_t) private public :: mysum_t contains function mysum_t(a) result(r) type(t), intent(in) :: a(:) type(t) :: r integer :: i r = zero_t(a(1)) do i = 1, size(a) r = plus_t(r, a(i)) end do end function function mysum_t_n(n, a) result(r) integer, intent(in) :: n type(t), intent(in) :: a(n) type(t) :: r integer :: i r = zero_t(a(1)) do i = 1, size(a) r = plus_t(r, a(i)) end do end function end template contains subroutine test_template() instantiate array_tmpl(integer, add_integer, zero_integer), only: & mysum_integer => mysum_t, mysum_integer_n => mysum_t_n integer :: a(10), b(10), i, sa, sb do i = 1, size(a) a(i) = i b(i) = i end do sa = mysum_integer(a) sb = mysum_integer_n(size(b), b) print *, sa print *, sb end subroutine end module program template_array_02 use template_array_02_math use template_array_02_m implicit none call test_template() end lfortran-0.63.0/integration_tests/gpu_metal_159.f900000664000175000017500000000114715174404631022263 0ustar alastairalastairprogram gpu_metal_159 implicit none type :: t integer :: m real, allocatable :: b(:) end type type(t) :: x real :: r(4) x%m = 3 allocate(x%b(3)) x%b = 0.5 r = 0.0 call sub(x, r) if (abs(r(1) - 1.5) > 1e-6) error stop if (abs(r(2) - 1.5) > 1e-6) error stop if (abs(r(3) - 1.5) > 1e-6) error stop if (abs(r(4) - 1.5) > 1e-6) error stop print *, "ok" contains subroutine sub(x, r) type(t), intent(in) :: x real, intent(inout) :: r(:) integer :: i, n(x%m) n = 1 do concurrent (i = 1:size(r)) r(i) = n(1) + x%b(1) end do end subroutine end program lfortran-0.63.0/integration_tests/intrinsics_438.f900000664000175000017500000000162215174404631022471 0ustar alastairalastairprogram intrinsics_438 ! Test norm2 with variable (non-constant) dim argument implicit none integer, parameter :: sp = kind(1.0) real(sp) :: b(2, 2), res1(2), res2(2) real(sp), parameter :: tol = 1.0e-6_sp integer :: dim b = reshape([1.0_sp, 2.0_sp, 3.0_sp, 4.0_sp], shape(b)) ! Test with variable dim in a loop do dim = 1, 2 if (dim == 1) then res1 = norm2(b, dim) print *, res1 ! norm2 along dim=1: [sqrt(1+4), sqrt(9+16)] = [sqrt(5), 5] if (abs(res1(1) - sqrt(5.0_sp)) > tol) error stop if (abs(res1(2) - 5.0_sp) > tol) error stop else res2 = norm2(b, dim) print *, res2 ! norm2 along dim=2: [sqrt(1+9), sqrt(4+16)] = [sqrt(10), sqrt(20)] if (abs(res2(1) - sqrt(10.0_sp)) > tol) error stop if (abs(res2(2) - sqrt(20.0_sp)) > tol) error stop end if end do print *, "All norm2 variable dim tests passed." end program lfortran-0.63.0/integration_tests/gpu_metal_160.f900000664000175000017500000000155715174404631022260 0ustar alastairalastairmodule gpu_metal_160_mod implicit none type :: t real, allocatable :: x(:) end type contains subroutine compute(self, n, result_arr) type(t), intent(in) :: self integer, intent(in) :: n real, intent(out) :: result_arr(:) integer :: i associate(b => self%x) do concurrent (i = 1:n) block real :: z(3) integer :: j do j = 1, 3 z(j) = -b(j) end do result_arr(i) = z(1) + z(2) + z(3) end block end do end associate end subroutine end module program gpu_metal_160 use gpu_metal_160_mod implicit none type(t) :: obj real :: res(4) integer :: i allocate(obj%x(3)) obj%x(1) = 1.0 obj%x(2) = 2.0 obj%x(3) = 3.0 call compute(obj, 4, res) do i = 1, 4 if (abs(res(i) - (-6.0)) > 1e-6) error stop end do print *, "ok" end program lfortran-0.63.0/integration_tests/interface_09.f900000664000175000017500000000111715174404631022155 0ustar alastairalastairmodule interface_09_m abstract interface subroutine add(x, y, z) integer, intent(in) :: x integer, intent(in) :: y integer, intent(in) :: z end subroutine end interface end module program interface_09 use interface_09_m, only : add procedure (add) :: add_def procedure (add), pointer :: p p => add_def call p(5, 10, 15) end program subroutine add_def(x, y, z) integer, intent(in) :: x integer, intent(in) :: y integer, intent(in) :: z print *, "sum: ", x + y + z end subroutinelfortran-0.63.0/integration_tests/intrinsics_147.f900000664000175000017500000000510515174404631022466 0ustar alastairalastairprogram intrinsics_147 type :: my_type integer :: a end type integer :: m(5) integer :: res, i double precision :: n(5) double precision :: res_d real :: res_r real :: o(5) logical :: b logical :: a(5) real :: vector(7) complex :: p(2) type(my_type), allocatable :: struct_packed(:) type(my_type) :: struct_arr(5) vector = [5.0, 6.0, 3.0, 4.0, 0.0, 13.0, 29.0] m = [1, 0, 0, 2, 99] a = [.false., .false., .false., .false., .true.] print *, pack(m, [.false., .false., .false., .false., .true.], [ 5, 6, 3, 4, 0, 13, 29 ]) res = sum(pack(m, [.false., .false., .false., .false., .true.], [ 5, 6, 3, 4, 0, 13, 29 ])) print *, res if (res /= 154) error stop b = .true. print *, pack(m, b, [ 5, 6, 3, 4, 0, 13, 29 ]) res = sum(pack(m, b, [ 5, 6, 3, 4, 0, 13, 29 ])) print *, res if (res /= 144) error stop print *, pack(m, m /= 0, [ 5, 6, 3, 4, 0, 13, 29 ]) res = sum(pack(m, m /= 0, [ 5, 6, 3, 4, 0, 13, 29 ])) print *, res if (res /= 148) error stop n = [1.0D0, 0.0D0, 0.0D0, 2.0D0, 99.0D0] print*, pack([ 1.0D0, 0.0D0, 0.0D0, 2.0D0, 99.0D0 ], [.false., .false., .false., .false., .true.], & [ 5.0D0, 6.0D0, 3.0D0, 4.0D0, 0.0D0, 13.0D0, 29.0D0 ]) res_d = sum(pack([ 1.0D0, 0.0D0, 0.0D0, 2.0D0, 99.0D0 ], [.false., .false., .false., .false., .true.], & [ 5.0D0, 6.0D0, 3.0D0, 4.0D0, 0.0D0, 13.0D0, 29.0D0 ])) print *, res_d if (abs(res_d - 154.0D0) > 1e-12) error stop print *, res_d res_d = sum(pack(n, [.false., .false., .false., .false., .true.], & [ 5.0D0, 6.0D0, 3.0D0, 4.0D0, 0.0D0, 13.0D0, 29.0D0 ])) if (abs(res_d - 154.0D0) > 1e-12) error stop print *, pack([ 1.0, 0.0, 0.0, 2.0, 99.0 ], a, & [ 5.0, 6.0, 3.0, 4.0, 0.0, 13.0, 29.0 ]) res_r = sum(pack([ 1.0, 0.0, 0.0, 2.0, 99.0 ], [.false., .false., .false., .false., .true.], & [ 5.0, 6.0, 3.0, 4.0, 0.0, 13.0, 29.0 ])) print *, res_r if (abs(res_r - 154.0) > 1e-8) error stop o = [1.0, 0.0, 0.0, 2.0, 99.0] print *, pack(o, a, vector) res_r = sum(pack(o, a, vector)) print *, res_r if (abs(res_r - 154.0) > 1e-6) error stop p = [(1.0, 2.0), (2.0, 3.0)] res_r = abs(sum(pack(p, .true., [(123.123, 9814.14), (-124151.41, 414.1)]))) print *, res_r if (abs(res_r - 5.83095169) > 1e-8) error stop do i = 1, 5 struct_arr(i)%a = i end do a = [.true., .false., .true., .false., .true.] allocate(struct_packed(count(a))) struct_packed = pack(struct_arr, a) if (size(struct_packed) /= 3) error stop if (struct_packed(1)%a /= 1) error stop if (struct_packed(2)%a /= 3) error stop if (struct_packed(3)%a /= 5) error stop end program lfortran-0.63.0/integration_tests/allocate_40.f900000664000175000017500000000067715174404631022006 0ustar alastairalastairprogram allocate_40 ! Test allocated() and deallocate for class(*) allocatable scalars implicit none class(*), allocatable :: obj if (allocated(obj)) error stop obj = 42 if (.not. allocated(obj)) error stop deallocate(obj) if (allocated(obj)) error stop obj = 3.14 if (.not. allocated(obj)) error stop deallocate(obj) if (allocated(obj)) error stop print *, "PASS" end program allocate_40 lfortran-0.63.0/integration_tests/format_15.f900000664000175000017500000000016615174404631021505 0ustar alastairalastairprogram format_15 integer ::i 10 FORMAT (5A,I100) write (*,10) ('*',i=1,5), 12345678 end program format_15lfortran-0.63.0/integration_tests/submodule_18b.f900000664000175000017500000000066415174404631022364 0ustar alastairalastairmodule julienne_formats_m_submodule_18b implicit none interface pure module function separated_values(mold) result(format_string) class(*), intent(in) :: mold(..) character(len=:), allocatable :: format_string end function end interface end module julienne_formats_m_submodule_18b module julienne_m_submodule_18b use julienne_formats_m_submodule_18b implicit none end module julienne_m_submodule_18b lfortran-0.63.0/integration_tests/openmp_25.f900000664000175000017500000000173515174404631021517 0ustar alastairalastairsubroutine initialise_array(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a integer :: i !$omp parallel shared(a) private(i) !$omp do do i = 1, n a(i) = 12.91 end do !$omp end do !$omp end parallel print *, a(1), a(n), a(12), a(12841) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(n) - 12.91) > 1e-8) error stop if (abs(a(12) - 12.91) > 1e-8) error stop if (abs(a(12841) - 12.91) > 1e-8) error stop end subroutine program openmp_25 use omp_lib integer, parameter :: n = 100000 integer :: i real, pointer :: b(:) interface subroutine initialise_array(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a end subroutine end interface allocate(b(n)) call omp_set_num_threads(4) call initialise_array(n, b) print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_50.f900000664000175000017500000000046615174404631022174 0ustar alastairalastairprogram gpu_metal_50 ! Test: associate block inside do concurrent (bare, not wrapped in block) implicit none integer :: i, n real :: x(5) n = 5 do concurrent (i = 1:n) associate(y => real(i)) x(i) = y end associate end do if (abs(sum(x) - 15.0) > 1.0e-6) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/contig.f900000664000175000017500000000061715174404631021174 0ustar alastairalastairmodule test_mod implicit none contains subroutine sub_test(a,b) real, dimension(:), intent(in) , contiguous :: a real, dimension(:), intent(out), contiguous :: b b = a end subroutine sub_test end module test_mod program contig use test_mod implicit none real, dimension(5) :: a,b a = 1.0 call sub_test(a,b) print *, b end program contiglfortran-0.63.0/integration_tests/passing_array_01.f900000664000175000017500000000465715174404631023063 0ustar alastairalastair! passing array as function arguments (with unknown size at compile time) ! Testing for both interfaces and functions MODULE passing_array_01_mod implicit none INTERFACE test_01_interface MODULE PROCEDURE test_01 END INTERFACE test_01_interface INTERFACE test_02_interface MODULE PROCEDURE test_02 END INTERFACE test_02_interface INTERFACE test_03_interface MODULE PROCEDURE test_03 END INTERFACE test_03_interface CONTAINS pure FUNCTION func() result (x) integer :: x x = 10 end FUNCTION func ! Array dimension is call to function FUNCTION test_01 (len,value) result(res) implicit none integer ,intent(in):: len INTEGER, DIMENSION(func()),intent(in) :: value integer:: res res = size(value) END FUNCTION test_01 ! Array dimension is Variable FUNCTION test_02 (len,value) result(res) implicit none integer ,intent(inout):: len INTEGER, DIMENSION(len),intent(in) :: value integer:: res res = size(value) END FUNCTION test_02 ! Array dimension is variable + function call + constant FUNCTION test_03 (len,value) result(res) implicit none integer ,intent(in):: len INTEGER, DIMENSION(len + func() + 10),intent(in) :: value integer:: res res = size(value) END FUNCTION test_03 SUBROUTINE test_entry implicit none INTEGER :: len INTEGER, DIMENSION(40) :: arr INTEGER :: i INTEGER :: ret len = 20 arr = [(i, i = 1, 40)] ! All calls would accept the passed array, ! because the passed array's length is greater than or equal to the expected length in the function ret = test_01_interface (len,arr) print * , ret if (ret /= 10) error stop ret = test_01 (len,arr) print * , ret if (ret /= 10) error stop ret = test_02_interface (len,arr) print * , ret if (ret /= 20) error stop ret = test_02 (len,arr) print * , ret if (ret /= 20) error stop ret = test_03_interface (len,arr) print * , ret if (ret /= 40) error stop ret = test_03 (len,arr) print * , ret if (ret /= 40) error stop END SUBROUTINE test_entry END MODULE passing_array_01_mod program passing_array_01 use passing_array_01_mod implicit none call test_entry end program passing_array_01 lfortran-0.63.0/integration_tests/gpu_metal_165.f900000664000175000017500000000167415174404631022265 0ustar alastairalastairmodule gpu_metal_165_m implicit none type :: tensor_t real :: v end type interface tensor_t module procedure construct end interface contains pure function construct(x) result(tensor) real, intent(in) :: x type(tensor_t) :: tensor tensor%v = x end function end module program gpu_metal_165 use gpu_metal_165_m, only : tensor_t implicit none type(tensor_t) :: inputs(2), outputs(2) integer :: i inputs(1) = tensor_t(1.0) inputs(2) = tensor_t(2.0) do concurrent(i = 1:2) outputs(i) = do_map(inputs(i)) end do if (abs(outputs(1)%v - 2.0) > 1e-6) error stop if (abs(outputs(2)%v - 4.0) > 1e-6) error stop print *, "ok" contains pure function do_map(tensor) result(mapped) type(tensor_t), intent(in) :: tensor type(tensor_t) :: mapped associate(v => tensor%v) associate(nv => v * 2.0) mapped = tensor_t(nv) end associate end associate end function end program lfortran-0.63.0/integration_tests/intrinsics_329.f900000664000175000017500000000317615174404631022476 0ustar alastairalastairprogram intrinsics_329 use iso_fortran_env, only: dp => real64 real(dp), parameter :: w = -5.1_dp real(dp), parameter :: x = 5.8_dp real(dp) :: y = 6.0_dp real(dp) :: z = -5.8_dp integer(dp) :: res_4 integer(dp) :: res_8 res_4 = idnint(w) print *, res_4 if (res_4 /= -5) error stop res_8 = idnint(w) print *, res_8 if (res_8 /= -5) error stop res_4 = idnint(x) print *, res_4 if (res_4 /= 6) error stop res_8 = idnint(x) print *, res_8 if (res_8 /= 6) error stop res_4 = idnint(y) print *, res_4 if (res_4 /= 6) error stop res_8 = idnint(y) print *, res_8 if (res_8 /= 6) error stop res_4 = idnint(z) print *, res_4 if (res_4 /= -6) error stop res_8 = idnint(z) print *, res_8 if (res_8 /= -6) error stop res_4 = idnint(5.8_dp) print *, res_4 if (res_4 /= 6) error stop res_8 = idnint(5.8_dp) print *, res_8 if (res_8 /= 6) error stop res_4 = idnint(6.00_dp) print *, res_4 if (res_4 /= 6) error stop res_8 = idnint(6.00_dp) print *, res_8 if (res_8 /= 6) error stop res_4 = idnint(0.0_dp) print *, res_4 if (res_4 /= 0) error stop res_8 = idnint(0.0_dp) print *, res_8 if (res_8 /= 0) error stop res_4 = idnint(-412.124_dp) print *, res_4 if (res_4 /= -412) error stop res_8 = idnint(-412.124_dp) print *, res_8 if (res_8 /= -412) error stop res_4 = idnint(-412.00_dp) print *, res_4 if (res_4 /= -412) error stop res_8 = idnint(-412.00_dp) print *, res_8 if (res_8 /= -412) error stop end program lfortran-0.63.0/integration_tests/intrinsics_319.f900000664000175000017500000000113015174404631022461 0ustar alastairalastairprogram intrinsics_319 integer(4) :: count4, count_max4, count_rate4 integer(8) :: count8, count_max8, count_rate8 real(4) :: count_rate_r4 real(8) :: count_rate_r8 call system_clock(count4, count_rate4, count_max4) print *, count4, count_rate4, count_max4 call system_clock(count8, count_rate8, count_max8) print *, count8, count_rate8, count_max8 call system_clock(count4, count_rate_r4, count_max4) print *, count4, count_rate_r4, count_max4 call system_clock(count8, count_rate_r8, count_max8) print *, count8, count_rate_r8, count_max8 end programlfortran-0.63.0/integration_tests/template_matrix_01.f900000664000175000017500000000402315174404631023403 0ustar alastairalastairmodule template_matrix_01_m implicit none private public :: matrix_t requirement elemental_op(t, op) type, deferred :: t pure elemental function op(l, r) result(rs) type(t), intent(in) :: l, r type(t) :: rs end function end requirement template matrix_t(t, plus, times, n) require :: elemental_op(t, plus), elemental_op(t, times) integer :: n private public :: add_matrix type :: matrix type(t) :: elements(n, n) end type contains pure function add_matrix(a, b) result(r) type(matrix), intent(in) :: a, b type(matrix) :: r r%elements = plus(a%elements, b%elements) end function pure function mul_matrix(a, b) result(r) type(matrix), intent(in) :: a, b type(matrix) :: r type(t) :: dot(n) type(t) :: temp integer :: i, j, k do i = 1, n do j = 1, n dot = times(a%elements(i,:), b%elements(:,j)) temp = dot(1) do k = 2, n temp = plus(temp, dot(i)) end do r%elements(i,j) = temp end do end do end function end template end module program template_matrix_01 use template_matrix_01_m integer, parameter :: n = 2 integer :: i, j instantiate matrix_t(integer, operator(+), operator(*), n), & only: int_matrix => matrix, & int_add_matrix => add_matrix, & int_mul_matrix => mul_matrix type(int_matrix) :: am, bm, cm, dm do i = 1, n do j = 1, n am%elements(i,j) = i bm%elements(i,j) = i end do end do cm = int_add_matrix(am, bm) dm = int_mul_matrix(am, bm) print *, cm%elements(1,1), cm%elements(1,2) print *, cm%elements(2,1), cm%elements(2,2), achar(10) print *, dm%elements(1,1), dm%elements(1,2) print *, dm%elements(2,1), dm%elements(2,2) end programlfortran-0.63.0/integration_tests/expr_07.f900000664000175000017500000000011315174404631021164 0ustar alastairalastairprogram expr_07 implicit none real :: x = 3.3 + 6.0 print *, x end program lfortran-0.63.0/integration_tests/string_67.f900000664000175000017500000000102715174404631021527 0ustar alastairalastair! Test out calls to `achar` (Function returing a character) to make sure it doesn't fill the stack program string_67 integer :: j character(4) :: ssss integer :: i j = 1 do i =0, 65536 ssss = achar(97+i) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) end do end program lfortran-0.63.0/integration_tests/arrays_intrin_05.f900000664000175000017500000000243015174404631023074 0ustar alastairalastairprogram arrays_intrin_05 integer :: i, j integer(8) :: x(3, 5), xminval, xminval1(5), correct1(5), correct2(5) logical :: modx(3, 5) correct1 = [2_8, 3_8, 4_8, 5_8, 6_8] correct2 = [3_8, 3_8, 5_8, 5_8, 7_8] do i = lbound(x, 1), ubound(x, 1) do j = lbound(x, 2), ubound(x, 2) x(i, j) = i + j modx(i, j) = mod(i + j, 2) == 1 end do end do print *, x xminval = minval(x) print *, xminval if( xminval /= 2_8 ) error stop xminval = minval(x, mask=modx) print *, xminval if( xminval /= 3_8 ) error stop xminval1 = minval(x, 1) print *, xminval1 do i = lbound(xminval1, 1), ubound(xminval1, 1) if( xminval1(i) /= correct1(i) ) error stop end do xminval1 = minval(x, 1, mask=modx) print *, xminval1 do i = lbound(xminval1, 1), ubound(xminval1, 1) if( xminval1(i) /= correct2(i) ) error stop end do xminval1 = minval(x, dim=1) print *, xminval1 do i = lbound(xminval1, 1), ubound(xminval1, 1) if( xminval1(i) /= correct1(i) ) error stop end do xminval1 = minval(x, dim=1, mask=modx) print *, xminval1 do i = lbound(xminval1, 1), ubound(xminval1, 1) if( xminval1(i) /= correct2(i) ) error stop end do end programlfortran-0.63.0/integration_tests/file_07.f900000664000175000017500000000214215174404631021131 0ustar alastairalastairprogram file_07 implicit none integer :: u = 11, i, j, k integer, allocatable :: int_arr(:, :) real, allocatable :: real_arr(:, :, :) integer :: int_arr_rows, int_arr_cols, real_arr_rows, real_arr_cols, real_arr_height open(u, file="file_07_data.dat", form="unformatted", access="stream", status="old") read(u) int_arr_rows, int_arr_cols, real_arr_rows, real_arr_cols, real_arr_height print *, int_arr_rows, int_arr_cols, real_arr_rows, real_arr_cols, real_arr_height allocate(int_arr(int_arr_rows, int_arr_cols), real_arr(real_arr_rows, real_arr_cols, real_arr_height)) read(u) int_arr read(u) real_arr do i = 1, int_arr_rows do j = 1, int_arr_cols print *, int_arr(i, j) end do end do print *, sum(int_arr) if (sum(int_arr) /= 5) error stop do i = 1, real_arr_rows do j = 1, real_arr_cols do k = 1, real_arr_height print *, real_arr(i, j, k) end do end do end do print *, sum(real_arr) if (abs(sum(real_arr) - 1.56999826) > 1e-5) error stop end program lfortran-0.63.0/integration_tests/c_ptr_10.f900000664000175000017500000000065115174404631021316 0ustar alastairalastairprogram c_ptr_10 use iso_c_binding, only: c_associated, c_loc, c_null_ptr, c_ptr implicit none integer, target :: x call check(c_null_ptr, .false.) call check(c_loc(x), .true.) contains subroutine check(p, expected) type(c_ptr), intent(in) :: p logical, intent(in) :: expected if (c_associated(p) .neqv. expected) error stop end subroutine check end program c_ptr_10 lfortran-0.63.0/integration_tests/intrinsics_226.f900000664000175000017500000000130415174404631022461 0ustar alastairalastairprogram intrinsics_226 implicit none integer(1) :: a1(2) integer(4) :: b1(5) integer(8) :: c1(10) integer(1), parameter :: a2 = iall([1, 2, 3, 4, 5]) integer(4), parameter :: b2 = iall([3, 5, 7, 9, 11]) integer(8), parameter :: c2 = iall([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) a1 = [3, 5] b1 = [3, 5, 7, 9, 11] c1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] print*, iall(a1) if (iall(a1) /= 1) error stop print*, iall(b1) if (iall(b1) /= 1) error stop print*, iall(c1) if (iall(c1) /= 0) error stop print*, a2 if (a2 /= 0) error stop print*, b2 if (b2 /= 1) error stop print*, c2 if (c2 /= 0) error stop end program lfortran-0.63.0/integration_tests/intent_03.f900000664000175000017500000000123615174404631021512 0ustar alastairalastairmodule prime_numbers_intent_03_module integer, parameter :: p40001_to_50000(10) = & [ 40009, 40011, 40013, 40027, 40029, 40039, 40051, 40057, 40063, 40069 ] contains ! Return the n-th prime number function prime() result(prime_number) integer :: prime_number prime_number = next_prime(p40001_to_50000(4)) end function prime elemental integer function next_prime(n) integer, intent(in) :: n next_prime = n + 9 end function next_prime end module prime_numbers_intent_03_module program intent_03 use prime_numbers_intent_03_module print *, prime() if ( prime() /= 40036 ) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_111.f900000664000175000017500000000133615174404631022247 0ustar alastairalastair! Test: sum() of binary operation on array sections inside do concurrent. ! Ensures sum(a(1:n) + b(1:n)) is properly inlined for GPU offloading, ! with correct loop bounds and element-wise access. program gpu_metal_111 implicit none integer :: i real :: a(3), b(3), results(2) integer :: c(4), d(4), ires(2) a = [1.0, 2.0, 3.0] b = [10.0, 20.0, 30.0] do concurrent (i = 1:2) results(i) = sum(a(1:3) + b(1:3)) end do if (abs(results(1) - 66.0) > 1e-6) error stop if (abs(results(2) - 66.0) > 1e-6) error stop c = [1, 2, 3, 4] d = [5, 6, 7, 8] do concurrent (i = 1:2) ires(i) = sum(c(1:4) + d(1:4)) end do if (ires(1) /= 36) error stop if (ires(2) /= 36) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/finalization_01.f900000664000175000017500000000107515174404631022677 0ustar alastairalastair! Test finlization of variables with the same name in different modules ! We should build 2 different finalization functions. module finalization_01_mod_1 type :: b character(10) :: str integer :: i end type end module module finalization_01_mod_2 type :: b character(10) :: str end type contains subroutine ss() type(b) :: x end subroutine end module program finalization_01 use finalization_01_mod_1 use finalization_01_mod_2, only : ss type (b) :: x call ss() end program lfortran-0.63.0/integration_tests/implicit_interface_32.f900000664000175000017500000000043715174404631024047 0ustar alastairalastairprogram implicit_interface_32 implicit none integer :: my_fn external :: my_fn integer :: i, j integer :: my_stfn my_stfn (i) = my_fn (i) + 1 j = my_stfn (41) if (j /= 42) error stop end program integer function my_fn (i) integer :: i my_fn = i end function lfortran-0.63.0/integration_tests/file_08.f900000664000175000017500000000104315174404631021131 0ustar alastairalastairsubroutine read_array() integer :: j double precision :: a(1, 2, 3) j = 10 open(unit=j, file="file_08.txt") read(j, *) a close(j) print *, a if (abs(a(1, 1, 1) - 1.0D0) > 1e-10) error stop if (abs(a(1, 2, 1) - 2.0D0) > 1e-10) error stop if (abs(a(1, 1, 2) - 3.0D0) > 1e-10) error stop if (abs(a(1, 2, 2) - 4.0D0) > 1e-10) error stop if (abs(a(1, 1, 3) - 5.0D0) > 1e-10) error stop if (abs(a(1, 2, 3) - 6.0D0) > 1e-10) error stop end subroutine program file_08 call read_array() end program lfortran-0.63.0/integration_tests/read_33.f900000664000175000017500000000062715174404631021132 0ustar alastairalastairprogram read_33 implicit none integer :: ivi, jvi integer :: i1i(5) open(10, file='read_33.txt', status='replace') write(10, '(6I5)') 3, 10, 20, 30, 0, 0 close(10) open(10, file='read_33.txt', status='old') read(10, '(100I5)') ivi, (i1i(jvi), jvi=1,ivi) close(10, status='delete') if (ivi /= 3 .or. any(i1i(1:3) /= [10, 20, 30])) error stop end program read_33lfortran-0.63.0/integration_tests/string_31.f900000664000175000017500000000077115174404631021523 0ustar alastairalastairprogram string_31 implicit none character(len=8) :: s = "lfortran" character(len=5) :: n print*, "Length of s:", len(s) print*, "Whole string:", s(1:len(s)) if ( s(1:len(s)) /= "lfortran" ) error stop print*, "Slice of string (2:5):", s(1:-1) if ( s(1:-1) /= "" ) error stop print*, "Slice of string (2:5):", s(2:5) if ( s(2:5) /= "fort" ) error stop n = "12345" print *, any(n(2:2) == ["3", "2"]) if ( .not. any(n(2:2) == ["3", "2"]) ) error stop end program lfortran-0.63.0/integration_tests/intrinsics_441.f900000664000175000017500000000072115174404631022462 0ustar alastairalastairprogram intrinsics_sinpi_01 real(8) :: tol tol = 1d-12 if (abs(sinpi(0d0) - 0d0) > tol) error stop if (abs(sinpi(0.5d0) - 1d0) > tol) error stop if (abs(cospi(1d0) + 1d0) > tol) error stop if (abs(tanpi(0.25d0) - 1d0) > tol) error stop if (abs(asinpi(1d0) - 0.5d0) > tol) error stop if (abs(acospi(-1d0) - 1d0) > tol) error stop if (abs(atanpi(1d0) - 0.25d0) > tol) error stop if (abs(atan2pi(1d0, 1d0) - 0.25d0) > tol) error stop end program intrinsics_sinpi_01lfortran-0.63.0/integration_tests/separate_compilation_06b.f900000664000175000017500000000073015174404631024556 0ustar alastairalastairmodule separate_compilation_06b_module use separate_compilation_06a_module contains function rpoisson_outward_pc(R, Rp, rho) result(V) real, intent(in) :: R(:), Rp(:), rho(:) real :: V(size(R)) integer :: N integer, parameter :: max_it = 2 real :: rho_mid(3), pi = 3.14159265358979323846 N = size(R) rho_mid = get_midpoints(R(:4), rho(:4)) print *, "sum(rho_mid): ", sum(rho_mid) if ( abs(sum(rho_mid) - 3.76053631e-01 ) > 1e-8 ) error stop end function end module lfortran-0.63.0/integration_tests/format_25.f900000664000175000017500000000023015174404631021476 0ustar alastairalastairprogram format_25 write(*,"(ES0.0E0)") 0.0 write(*,"(ES0.0E0)") 10.0 write(*,"(ES0.0E0)") 3.14159 write(*,"(ES0.0E0)") 3.14159E+05 end program lfortran-0.63.0/integration_tests/gpu_metal_161_mod.f900000664000175000017500000000006215174404631023106 0ustar alastairalastairmodule gpu_metal_161_m implicit none end module lfortran-0.63.0/integration_tests/allocate_59.f900000664000175000017500000000302015174404631022001 0ustar alastairalastairmodule allocate59_string implicit none type :: string character(:), allocatable :: chars contains procedure :: len => string_len end type string contains pure integer function string_len(self) class(string), intent(in) :: self string_len = len(self%chars) end function string_len end module allocate59_string module allocate59_mre use allocate59_string, only: string implicit none abstract interface pure subroutine upper_x(str, res) character(*), intent(in) :: str character(len(str)), intent(out) :: res end subroutine upper_x end interface contains pure subroutine to_upper_identity(str, res) character(*), intent(in) :: str character(len(str)), intent(out) :: res res = str if (len(res) /= len(str)) error stop "result length mismatch" end subroutine to_upper_identity subroutine upper_caller(f, a) procedure(upper_x) :: f class(*), intent(in) :: a select type (a) type is (string) block ! MRE trigger: local char length depends on polymorphic component. character(a%len()) :: res call f(a%chars, res) if (res /= a%chars) error stop "upper_caller callback mismatch" end block end select end subroutine upper_caller end module allocate59_mre program allocate_59 use allocate59_mre, only: upper_caller, to_upper_identity use allocate59_string, only: string implicit none type(string) :: s s%chars = "abc" call upper_caller(to_upper_identity, s) end program allocate_59 lfortran-0.63.0/integration_tests/loop_unroll_small.f900000664000175000017500000000101315174404631023434 0ustar alastairalastairprogram loop_unroll_small implicit none integer :: i, first, last, array(4), x do i = 1, 4 array(i) = i end do first = 1 last = 4 do i = first, last array(i) = array(i) + i end do do i = 1, 4 x = array(i) call print_subrout(x) end do do i = 1, 4 x = array(i) if( x /= 2 * i ) error stop end do contains subroutine print_subrout(x) integer, intent(in) :: x print *, x end subroutine end program lfortran-0.63.0/integration_tests/separate_compilation_44a.f900000664000175000017500000000127515174404631024564 0ustar alastairalastairmodule separate_compilation_44a_module implicit none type :: MyType real(8) :: val end type MyType interface operator(**) module procedure dpow module procedure ipow end interface operator(**) contains function dpow(a, y) result(res) type(MyType), intent(in) :: a real(8), intent(in) :: y type(MyType) :: res res%val = a%val ** y end function dpow function ipow(a, n) result(res) type(MyType), intent(in) :: a integer(4), intent(in) :: n type(MyType) :: res res%val = a%val ** n end function ipow end module separate_compilation_44a_module lfortran-0.63.0/integration_tests/c_ptr_11.f900000664000175000017500000000102415174404631021312 0ustar alastairalastairprogram c_ptr_11 use iso_c_binding, only: c_ptr, c_null_ptr, c_associated implicit none type :: wrapper type(c_ptr) :: ptr end type type(wrapper) :: w w%ptr = c_null_ptr call check_ptr(w%ptr) if (c_associated(w%ptr)) error stop call modify_ptr(w%ptr) if (c_associated(w%ptr)) error stop contains subroutine check_ptr(p) type(c_ptr), intent(in) :: p if (c_associated(p)) error stop end subroutine subroutine modify_ptr(p) type(c_ptr), intent(inout) :: p p = c_null_ptr end subroutine end program c_ptr_11 lfortran-0.63.0/integration_tests/character_17.f900000664000175000017500000000511715174404631022154 0ustar alastairalastair! Test CHARACTER(*) assumed-size arrays via EXTERNAL with various dimensions ! Comprehensive test for DescriptorArray handling in implicit interfaces: ! 1. CHARACTER(1) array with size 1 (basic case) ! 2. CHARACTER(10) array with size 3 (string length > 1, multiple elements) ! 3. 2D CHARACTER array (multi-dimensional) program character_17 implicit none character(1) :: single_char(1) character(10) :: multi_char(3) character(5) :: matrix(2, 3) external sub_char_1d_single external sub_char_1d_multi external sub_char_2d ! Test 1: Single element CHARACTER(1) array single_char(1) = 'A' call sub_char_1d_single(single_char) ! Test 2: CHARACTER(10) array with 3 elements multi_char(1) = 'First ' multi_char(2) = 'Second ' multi_char(3) = 'Third ' call sub_char_1d_multi(multi_char) ! Test 3: 2D CHARACTER(5) array matrix(1, 1) = 'R1C1 ' matrix(2, 1) = 'R2C1 ' matrix(1, 2) = 'R1C2 ' matrix(2, 2) = 'R2C2 ' matrix(1, 3) = 'R1C3 ' matrix(2, 3) = 'R2C3 ' call sub_char_2d(matrix) print *, "PASS" end program subroutine sub_char_1d_single(arr) implicit none character(*) :: arr(*) logical :: lsame external lsame if (.not. lsame(arr(1), 'A')) then error stop "Test 1 failed: arr(1) is not A" end if end subroutine subroutine sub_char_1d_multi(arr) implicit none character(*) :: arr(*) if (arr(1)(1:5) /= 'First') then error stop "Test 2 failed: arr(1) is not First" end if if (arr(2)(1:6) /= 'Second') then error stop "Test 2 failed: arr(2) is not Second" end if if (arr(3)(1:5) /= 'Third') then error stop "Test 2 failed: arr(3) is not Third" end if end subroutine subroutine sub_char_2d(arr) implicit none character(*) :: arr(2, *) ! Check column-major order (Fortran) if (arr(1, 1) /= 'R1C1 ') then error stop "Test 3 failed: arr(1,1) is not R1C1" end if if (arr(2, 1) /= 'R2C1 ') then error stop "Test 3 failed: arr(2,1) is not R2C1" end if if (arr(1, 2) /= 'R1C2 ') then error stop "Test 3 failed: arr(1,2) is not R1C2" end if if (arr(2, 2) /= 'R2C2 ') then error stop "Test 3 failed: arr(2,2) is not R2C2" end if if (arr(1, 3) /= 'R1C3 ') then error stop "Test 3 failed: arr(1,3) is not R1C3" end if if (arr(2, 3) /= 'R2C3 ') then error stop "Test 3 failed: arr(2,3) is not R2C3" end if end subroutine logical function lsame(ca, cb) implicit none character(1), intent(in) :: ca, cb lsame = ca == cb end function lfortran-0.63.0/integration_tests/intrinsics_80.f900000664000175000017500000000046415174404631022405 0ustar alastairalastairprogram intrinsics_80 implicit none integer :: x(2) x = 10 print *, func(x) if (x(1) /= 10) error stop if (x(2) /= 10) error stop contains integer function func(R) result(i) integer, intent(in) :: R(:) i = sum(R) end function end program lfortran-0.63.0/integration_tests/class_144.f900000664000175000017500000000132115174404631021377 0ustar alastairalastairmodule class_144_module implicit none type :: topol_t character(len=256), allocatable :: geometries(:) end type topol_t contains subroutine init(this) class(topol_t), intent(inout) :: this integer :: j j = 1 allocate(this%geometries(1)) this%geometries(j) = repeat(" ", len(this%geometries(j))) end subroutine init end module class_144_module program class_144 use class_144_module implicit none type(topol_t) :: topo call init(topo) if (len(topo%geometries(1)) /= 256) error stop "incorrect length" if (topo%geometries(1) /= repeat(" ", 256)) error stop "incorrect content" print *, "all tests passed" end program class_144lfortran-0.63.0/integration_tests/modules_61.f900000664000175000017500000000072715174404631021671 0ustar alastairalastairmodule modules_61_mod1 integer :: inn = 10 end module module modules_61_mod2 integer :: inn = 91 end module module modules_61_mod3 contains subroutine foo use modules_61_mod2 print *, inn if (inn /= 91) error stop inn = 1000 print *, inn end subroutine subroutine foo2 use modules_61_mod1 print *, inn if(inn /= 10) error stop end subroutine end module program modules_61 use modules_61_mod3 call foo call foo2 end program modules_61 lfortran-0.63.0/integration_tests/intrinsics_118.f900000664000175000017500000000026015174404631022461 0ustar alastairalastairprogram intrinsics_118 print *, hypot( x = 1.e0_4, y = 0.5e0_4 ) print *, hypot( 1.e0_4, y = 0.5e0_4 ) print *, hypot( 1.e0_4, 0.5e0_4 ) end program intrinsics_118 lfortran-0.63.0/integration_tests/assign_to2.f900000664000175000017500000000027215174404631021756 0ustar alastairalastairprogram main integer :: i, sum, ZERO 10 assign 30 to next sum = ZERO i = 1 20 GO TO next,(30, 50, 70) 30 IF( 0<1) GO TO 70 50 print *, 50 assign 50 to next 70 print *, 70 end program lfortran-0.63.0/integration_tests/write_25.f900000664000175000017500000000066215174404631021351 0ustar alastairalastairprogram write_25 implicit none real :: a = -0.0044 real :: b = 0.0044 character(6) :: s1, s2 character(7) :: t1, t2 write(s1, "(e6.1e1)") a write(s2, "(e6.1e1)") b write(t1, "(e7.1e1)") a write(t2, "(e7.1e1)") b if (s1 /= "-.4E-2") error stop if (s2 /= "0.4E-2") error stop if (t1 /= "-0.4E-2") error stop if (t2 /= " 0.4E-2") error stop print *, "pass" end program write_25 lfortran-0.63.0/integration_tests/separate_compilation_08b.f900000664000175000017500000000025315174404631024560 0ustar alastairalastairmodule module_using_all_2_separate_compilation_08b contains subroutine test_all_2(x) real :: x(5) if ( all(abs(x - 19.2134) < 1e-8 )) error stop end subroutine end module lfortran-0.63.0/integration_tests/data_17.f900000664000175000017500000000034715174404631021131 0ustar alastairalastairprogram data_17 implicit none character(len=1) :: facts(3) data facts / 'F', 'N', 'E' / if (facts(1) /= 'F') error stop if (facts(2) /= 'N') error stop if (facts(3) /= 'E') error stop end program data_17 lfortran-0.63.0/integration_tests/intrinsics_175.f900000664000175000017500000000051015174404631022462 0ustar alastairalastairprogram intrinsics_75 integer :: array(3, 4) logical :: mask(3, 4) integer :: s(1) array = reshape((/1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12/), shape(array)) mask = .true. mask(1, :) = .false. mask(3, 2) = .false. print *, pack(array, mask) s = shape(pack(array, mask)) print *, s if (s(1) /= 7) error stop contains end program lfortran-0.63.0/integration_tests/complex_10.f900000664000175000017500000000024115174404631021651 0ustar alastairalastairprogram complex_10 implicit none complex(8) :: k, z k = (3, -4) z = conjg(k) print *, k, z if (abs(z - (3,4)) > 1e-10) error stop end program lfortran-0.63.0/integration_tests/select_type_14.f900000664000175000017500000000302015174404631022524 0ustar alastairalastairmodule select_type_14_module implicit none ! === Base and extensions === type :: base_t contains procedure :: describe_base procedure :: value_base end type base_t type, extends(base_t) :: child1_t integer :: a = 10 contains procedure :: describe_child1 procedure :: value_child1 end type child1_t contains ! === Base methods === subroutine describe_base(this) class(base_t), intent(in) :: this print *, "I am a base_t" end subroutine describe_base function value_base(this) result(x) class(base_t), intent(in) :: this integer :: x x = -1 end function value_base ! === Child methods === subroutine describe_child1(this) class(child1_t), intent(inout) :: this this%a = 20 end subroutine describe_child1 function value_child1(this) result(x) class(child1_t), intent(in) :: this integer :: x x = this%a end function value_child1 end module select_type_14_module program select_type_14 use select_type_14_module implicit none class(base_t), allocatable :: ptr type(child1_t) :: c allocate(child1_t :: ptr) select type(ptr) class is (child1_t) if (ptr%value_child1() /= 10) error stop call ptr%describe_child1() call ptr%describe_base() if (ptr%a /= 20) error stop if (ptr%value_base() /= -1) error stop class default error stop end select end program select_type_14 lfortran-0.63.0/integration_tests/intrinsics_92.f900000664000175000017500000000040015174404631022376 0ustar alastairalastairprogram intrinsics_92 real(4) x4 real(8) x8 x4 = 1.234E0_4 x8 = -4.721_8 if ( abs(anint(x4) - 1.0) > 1e-5 ) error stop if ( abs(anint(x8) + 5.0) > 1e-5) error stop x8 = anint(x4,8) if ( abs(x8 - 1.0) > 1e-5 ) error stop end lfortran-0.63.0/integration_tests/common_07.f900000664000175000017500000000026315174404631021504 0ustar alastairalastairSUBROUTINE DP86CO() COMMON /CONDO8/XOLD,HOUT RETURN END subroutine CONTD8() COMMON /CONDO8/XOLD,H RETURN END PROGRAM MAIN COMMON /CONDO8/XOLD,H end PROGRAM lfortran-0.63.0/integration_tests/cpp_pre_08.f900000664000175000017500000000057715174404631021655 0ustar alastairalastair! Test for issue #10344 program cpp_pre_08 implicit none integer :: a #define get_x() 3 #define get_y() 7 ! Test zero-argument macro expansion if (get_x() /= 3) error stop "get_x() macro failed" if (get_y() /= 7) error stop "get_y() macro failed" ! Test usage in expressions a = get_x() + get_y() if (a /= 10) error stop "expression macro expansion failed" print *, "ok" end program lfortran-0.63.0/integration_tests/elemental_11.f900000664000175000017500000001002715174404631022154 0ustar alastairalastairprogram elemental_11 implicit none real, dimension(3) :: array_param, expected_ans real :: scalar_param, epsilon = 1.0e-6 real, dimension(3) :: result_2param real, dimension(3) :: result_3param array_param = [ 1.0, 2.0, 3.0 ] scalar_param = 1.0 print *, "Testing 2-parameter elemental function:" result_2param = func2(array_param, array_param) expected_ans = [ 2.0, 4.0, 6.0 ] if ( size(result_2param) /= size(expected_ans) .or. .not. all(result_2param == expected_ans) ) then error stop "Array, Array does not match to expected array" end if result_2param = func2(array_param, scalar_param) expected_ans = [ 2.0, 3.0, 4.0 ] if ( size(result_2param) /= size(expected_ans) .or. .not. all(result_2param == expected_ans) ) then error stop "Array, Scalar does not match to expected array" end if result_2param = func2(scalar_param, array_param) expected_ans = [ 2.0, 3.0, 4.0 ] if ( size(result_2param) /= size(expected_ans) .or. .not. all(result_2param == expected_ans) ) then error stop "Scalar, Array does not match to expected array" end if result_2param = func2(scalar_param, scalar_param) expected_ans = [ 2.0, 0.0, 0.0 ] if (abs(result_2param(1) - expected_ans(1)) > epsilon) then error stop "Scalar, Scalar does not match 2.0" end if print *, "\nTesting 3-parameter elemental function:" result_3param = func3(array_param, array_param, array_param) expected_ans = [ 2.0, 6.0, 12.0 ] if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Array, Array does not match to expected array" end if result_3param = func3(array_param, array_param, scalar_param) expected_ans = [ 2.0, 5.0, 10.0 ] if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Array, Scalar does not match to expected array" end if result_3param = func3(array_param, scalar_param, array_param) expected_ans = [ 2.0, 4.0, 6.0 ] if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Scalar, Array does not match to expected array" end if result_3param = func3(array_param, scalar_param, scalar_param) expected_ans = [ 2.0, 3.0, 4.0 ] if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Scalar, Scalar does not match to expected array" end if result_3param = func3(scalar_param, array_param, array_param) expected_ans = [ 2.0, 4.0, 6.0 ] if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Scalar, Array, Array does not match to expected array" end if result_3param = func3(scalar_param, array_param, scalar_param) expected_ans = [ 2.0, 3.0, 4.0 ] if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Scalar, Array, Scalar does not match to expected array" end if result_3param = func3(scalar_param, scalar_param, array_param) expected_ans = [ 2.0, 3.0, 4.0 ] if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Scalar, Scalar, Array does not match to expected array" end if result_3param = func3(scalar_param, scalar_param, scalar_param) expected_ans = [ 2.0, 0.0, 0.0 ] if (abs(result_3param(1) - expected_ans(1)) > epsilon) then error stop "Scalar, Scalar, Scalar does not match 2.0" end if print *, "All tests passed successfully" contains elemental function func2(x, y) result(res) real, intent(in) :: x, y real :: res res = x + y end function func2 elemental function func3(x, y, z) result(res) real, intent(in) :: x, y, z real :: res res = x * y + z end function func3 end program elemental_11 lfortran-0.63.0/integration_tests/gpu_metal_08.f900000664000175000017500000000075315174404631022176 0ustar alastairalastairprogram gpu_metal_08 ! Conditional inside do concurrent implicit none integer, parameter :: n = 10000 integer :: a(n), a_expected(n) integer :: i do i = 1, n if (mod(i, 2) == 0) then a_expected(i) = i * 2 else a_expected(i) = i * 3 end if end do do concurrent (i = 1:n) if (mod(i, 2) == 0) then a(i) = i * 2 else a(i) = i * 3 end if end do do i = 1, n if (a(i) /= a_expected(i)) error stop end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/arrays_118.f900000664000175000017500000000322115174404631021575 0ustar alastairalastairmodule arrays_118_mod use, intrinsic :: iso_fortran_env, only: real32 implicit none interface module function mean_2_rsp_rsp(x, dim) result(res) real(real32), intent(in) :: x(:, :) integer, intent(in) :: dim real(real32) :: res(merge(size(x,1), size(x,2), dim==2)) end function mean_2_rsp_rsp end interface end module arrays_118_mod submodule (arrays_118_mod) arrays_118_smod implicit none contains module function mean_2_rsp_rsp(x, dim) result(res) real(real32), intent(in) :: x(:, :) integer, intent(in) :: dim real(real32) :: res(merge(size(x,1), size(x,2), dim==2)) if (dim >= 1 .and. dim <= 2) then res = sum(x, dim) / real(size(x, dim), real32) else error stop "ERROR: wrong dimension" end if end function mean_2_rsp_rsp end submodule arrays_118_smod program arrays_118 use arrays_118_mod, only: mean_2_rsp_rsp use, intrinsic :: iso_fortran_env, only: real32 implicit none real(real32), parameter :: tol = 1e-5_real32 ! 4x3 matrix real(real32), parameter :: x2(4,3) = reshape([ & 1.0_real32, 3.0_real32, 5.0_real32, 7.0_real32, & 2.0_real32, 4.0_real32, 6.0_real32, 8.0_real32, & 9.0_real32,10.0_real32,11.0_real32,12.0_real32 ], [4,3]) real(real32) :: expected(3) real(real32) :: result(3) expected = [21.0, 30.0, 111.5] ! Actual result = mean_2_rsp_rsp(x2**2, 1) ! Debug print (optional but useful for compiler issues) print *, "Expected:", expected print *, "Result :", result ! Check if (.not. all(abs(expected - result) < tol)) then error stop "Test FAILED" end if print *, "Test PASSED" end program arrays_118 lfortran-0.63.0/integration_tests/derived_types_20_module1.f900000664000175000017500000000236715174404631024512 0ustar alastairalastairmodule fpm_command_line_20 use M_CLI2_20, only : specified implicit none type, abstract :: fpm_cmd_settings character(len=:), allocatable :: working_dir logical :: verbose=.true. end type type, extends(fpm_cmd_settings) :: fpm_new_settings character(len=:), allocatable :: name logical :: with_executable=.false. logical :: with_test=.false. logical :: with_lib=.true. logical :: with_example=.false. logical :: with_full=.false. logical :: with_bare=.false. logical :: backfill=.true. end type contains subroutine get_command_line_settings(cmd_settings) class(fpm_cmd_settings), allocatable, intent(out) :: cmd_settings allocate(fpm_new_settings :: cmd_settings) if (any( specified([character(len=10) :: 'src','lib','app','test','example']) ) ) then cmd_settings=fpm_new_settings(& & backfill=.false., & & name="xyz", & & with_executable=.true., & & with_lib=.false., & & with_test=.true., & & with_example=.false., & & verbose=.true. ) end if end subroutine get_command_line_settings end module fpm_command_line_20 lfortran-0.63.0/integration_tests/separate_compilation_45.f900000664000175000017500000000050515174404631024417 0ustar alastairalastairprogram separate_compilation_45 use separate_compilation_45a_mod, only: greeter_t implicit none type(greeter_t) :: g g%id = 42 if (g%id /= 42) error stop "expected greeter id" call g%greet("hello") if (g%id /= 42) error stop "unexpected greeter id after greet" end program separate_compilation_45 lfortran-0.63.0/integration_tests/template_simple_03.f900000664000175000017500000000516615174404631023403 0ustar alastairalastairmodule template_simple_03_m implicit none private public :: generic_sum, test_template requirement operator_r(T, U, V, binary_func) type, deferred :: T type, deferred :: U type, deferred :: V pure elemental function binary_func(lhs, rhs) result(res) type(T), intent(in) :: lhs type(U), intent(in) :: rhs type(V) :: res end function end requirement requirement cast_r(T, cast) type, deferred :: T pure elemental function cast(arg) result(res) integer, intent(in) :: arg type(T) :: res end function end requirement contains pure elemental function cast_integer(arg) result(res) integer, intent(in) :: arg integer :: res res = 0 end function pure elemental function cast_real(arg) result(res) integer, intent(in) :: arg real :: res res = 0.0 end function pure elemental function div_integer(lhs, rhs) result(res) integer, intent(in) :: lhs, rhs integer :: res res = lhs / rhs end function pure elemental function div_real(lhs, rhs) result(res) real, intent(in) :: lhs integer, intent(in) :: rhs real :: res res = lhs / rhs end function pure function generic_sum {T, add, cast} (arr) result(res) require :: operator_r(T, T, T, add), cast_r(T, cast) type(T), intent(in) :: arr(:) type(T) :: res integer :: n, i n = size(arr) res = cast(0) if (n > 0) then res = arr(1) do i=2,n res = add(res, arr(i)) end do end if end function pure function generic_avg {T, add, cast, div} (arr) result(res) require :: operator_r(T, T, T, add), cast_r(T, cast) require :: operator_r(T, integer, T, div) type(T), intent(in) :: arr(:) type(T) :: res integer :: n, i n = size(arr) if (n > 0) then res = div(generic_sum{T, add, cast}(arr), n) else res = cast(0) end if end function subroutine test_template() integer :: a_i(10), i, s_i real :: a_r(10), s_r do i = 1, size(a_i) a_i(i) = i a_r(i) = i end do s_i = generic_avg{integer, operator(+), cast_integer, div_integer}(a_i) s_r = generic_avg{real, operator(+), cast_real, div_real}(a_r) print *, s_i end subroutine end module program template_simple_03 use template_simple_03_m implicit none call test_template() endlfortran-0.63.0/integration_tests/openmp_29.f900000664000175000017500000000204015174404631021511 0ustar alastairalastairprogram openmp_29 use omp_lib implicit none integer :: i integer :: seed integer, parameter :: n = 10000 double precision :: x(n) double precision :: max1 double precision :: max2 double precision :: max3 seed = 1325 do i = 1, n seed = mod ( ( 3125 * seed ), 65536 ) x(i) = ( seed - 32768.0 ) / 16384.0 end do max1 = - huge(max1) do i = 1, n if ( max1 < x(i) ) then max1 = x(i) end if end do !$omp parallel shared(x) private(i) reduction(max:max2) !$omp do do i = 1, n max2 = max ( max2, x(i) ) end do !$omp end do !$omp end parallel print *, "Done with parallel loop 1" max3 = - huge(max3) !$omp parallel shared(x) private(i) reduction(max:max3) !$omp do do i = 1, n if ( max3 < x(i) ) then max3 = x(i) end if end do !$omp end do !$omp end parallel print *, 'Done' print *, ' X_MAX should be ', max1 print *, ' Computed X_MAX2 = ', max2 print *, ' Computed X_MAX3 = ', max3 if (abs(max1 - max2) > 1e-8) error stop if (abs(max1 - max3) > 1e-8) error stop if (abs(max2 - max3) > 1e-8) error stop end lfortran-0.63.0/integration_tests/intrinsics_164.f900000664000175000017500000000321315174404631022463 0ustar alastairalastairprogram intrinsics_164 integer :: a1 = 5, a2 = 8 integer(8) :: a3 = -1, a4 = -4 integer :: a5 = -2, a6 = -5 integer, parameter :: i1 = iand(5, 8) integer, parameter :: i2 = iand(-1, 5) integer, parameter :: i3 = iand(-4_8, 2_8) integer(8), parameter :: i4 = iand(-2_8, 5_8) integer, parameter :: ar1(3) = iand([5, 8, 9], [8, 5, 2]) integer(8), parameter :: ar2(3) = iand([-1_8, -5_8, -10_8], [5_8, 8_8, 9_8]) integer :: arr1(3), arr3(3) integer(8) :: arr2(3) integer :: res(3) arr1 = [5, 8, 9] arr3 = [8, 5, 2] arr2 = [-1_8, -5_8, -10_8] print *, i1 if (i1 /= 0) error stop print *, i2 if (i2 /= 5) error stop print *, i3 if (i3 /= 0) error stop print *, i4 if (i4 /= 4) error stop print*, iand(5, 8) if (iand(5, 8) /= 0) error stop print*, iand(-1, 5) if (iand(-1, 5) /= 5) error stop print*, iand(8, -4) if (iand(8, -4) /= 8) error stop print*, iand(-2, -5) if (iand(-2, -5) /= -6) error stop print*, iand(a1, a2) if (iand(a1, a2) /= 0) error stop print*, iand(a3, a4) if (iand(a3, a4) /= -4) error stop print*, iand(a2, a5) if (iand(a2, a5) /= 8) error stop print*, iand(a5, a6) if (iand(a5, a6) /= -6) error stop print *, ar1 if (any(ar1 /= [0, 0, 0])) error stop print *, ar2 if (any(ar2 /= [5, 8, 0])) error stop print *, iand(arr1, arr3) if (any(iand(arr1, arr3) /= [0, 0, 0])) error stop print *, iand(arr2, arr2) if (any(iand(arr2, arr2) /= [-1, -5, -10])) error stop res = iand(arr1, arr3) print *, res if (any(res /= [0, 0, 0])) error stop end program lfortran-0.63.0/integration_tests/functions_19.f900000664000175000017500000000066515174404631022235 0ustar alastairalastairpure function diag_rsp_mat(A) result(res) real, intent(in) :: A(:,:) real :: res(minval(shape(A))) res = 123.71_4 end function diag_rsp_mat program funtions_19 real :: A(3,3) real :: res(3) interface pure function diag_rsp_mat(A) result(res) real, intent(in) :: A(:,:) real :: res(minval(shape(A))) end function diag_rsp_mat end interface res = diag_rsp_mat(A) print *, res if (any(abs(res - 123.71_4) > 1e-8)) error stop end program lfortran-0.63.0/integration_tests/select_type_31.f900000664000175000017500000000307215174404631022532 0ustar alastairalastairmodule select_type_31_mod implicit none public :: derived_type public :: container_type public :: base_type type, abstract :: base_type character(:), allocatable :: name end type base_type type, extends(base_type) :: derived_type real, allocatable :: values(:, :) end type derived_type type :: container_type class(base_type), allocatable :: obj integer, allocatable :: dims(:) contains procedure :: initialize end type container_type contains impure elemental module subroutine initialize(self, other) implicit none class(container_type), intent(in out) :: self class(container_type), intent(in) :: other select type(current => self%obj) type is (derived_type) self%dims = shape(current%values) end select end subroutine initialize end module select_type_31_mod program select_type_31 use select_type_31_mod implicit none type(container_type) :: c1, c2 type(derived_type) :: d d%name = "test" allocate(d%values(3, 4)) d%values = 1.0 allocate(c1%obj, source=d) allocate(c2%obj, source=d) call c1%initialize(c2) if (.not. allocated(c1%dims)) error stop "c1%dims not allocated" if (size(c1%dims) /= 2) error stop "c1%dims should have 2 elements" if (c1%dims(1) /= 3) error stop "c1%dims(1) should be 3" if (c1%dims(2) /= 4) error stop "c1%dims(2) should be 4" select type (obj => c1%obj) type is (derived_type) if (obj%name /= "test") error stop "name should be 'test'" class default error stop "unexpected type in c1%obj" end select end program select_type_31 lfortran-0.63.0/integration_tests/gpu_metal_120.f900000664000175000017500000000163015174404631022244 0ustar alastairalastairmodule gpu_metal_120_m implicit none type :: network_t real, allocatable :: weights_(:) integer, allocatable :: nodes_(:) contains procedure :: num_hidden_layers end type contains elemental integer function num_hidden_layers(self) result(count) class(network_t), intent(in) :: self count = size(self%nodes_) - 2 end function subroutine train(self, n) type(network_t), intent(in) :: self integer, intent(in) :: n integer :: i integer :: result(4) result = 0 do concurrent (i = 1:n) result(i) = self%num_hidden_layers() end do do i = 1, n if (result(i) /= 1) error stop end do print *, "PASS" end subroutine end module program gpu_metal_120 use gpu_metal_120_m implicit none type(network_t) :: net allocate(net%nodes_(0:2), source=[2, 3, 1]) allocate(net%weights_(3), source=1.0) call train(net, 4) end program lfortran-0.63.0/integration_tests/derived_types_34.f900000664000175000017500000000132615174404631023063 0ustar alastairalastairmodule derived_types_34_my_mod type :: my_type sequence integer :: a end type interface read(formatted) module procedure :: read_formatted end interface contains subroutine read_formatted(mt, unit, iotype, v_list, iostat, iomsg) type(my_type), intent(inout) :: mt integer, intent(in) :: unit character(len=*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg mt%a = 125 end subroutine end module program derived_types_34 use derived_types_34_my_mod, only: my_type, read(formatted) implicit none print *, "Ok" end program lfortran-0.63.0/integration_tests/implicit_argument_casting_03.f900000664000175000017500000000116015174404631025431 0ustar alastairalastair! Test function argument type mismatch with implicit interface ! When calling an external function with integer(8) argument where it expects ! integer(4), the value should be converted when --implicit-argument-casting is set program functions_54 implicit none integer(8) :: n8 integer(4) :: result integer(4), external :: external_test_func n8 = 5 result = external_test_func(n8) ! Passing integer(8) to function expecting integer(4) if (result /= 10) error stop end program integer(4) function external_test_func(n) integer(4), intent(in) :: n external_test_func = n * 2 end function lfortran-0.63.0/integration_tests/string_65.f900000664000175000017500000000111615174404631021524 0ustar alastairalastairmodule string_65_mod contains function foo(probs) result(ret) logical :: ret character(len=64), intent(in), optional :: probs(:) if(present(probs)) then ret = all(probs == "HelloWorld!") else ret = .false. end if end function end module program test use string_65_mod character(64) :: char_arr(10) if(foo() .neqv. .false.) error stop char_arr = "HelloWorld!" if(foo(char_arr) .neqv. .true.) error stop char_arr = "whatever" if(foo(char_arr) .neqv. .false.) error stop end program testlfortran-0.63.0/integration_tests/intrinsics_391.f900000664000175000017500000000266715174404631022501 0ustar alastairalastairprogram intrinsics_391 implicit none integer,parameter:: kr1 = selected_real_kind(1), maxkr = 3, & skr2 = selected_real_kind(precision(1.0_kr1)+1), & kr2 = merge(skr2,kr1, skr2>0), & skr3 = selected_real_kind(precision(1.0_kr2)+1), & kr3 = merge(skr3,kr2, skr3>0),& ! kr3 = skr3 if that's a valid real kind, kr2 if not allkr(maxkr+1) = [kr1,kr2,kr3,kr3] ,& nkr = minloc(abs(allkr(1:maxkr)-allkr(2:maxkr+1)),1) integer :: result1(4), result2 integer, parameter:: allkr1(4) = [-1,2,-3,4] integer, parameter :: nkr1(4) = abs(allkr1(1:4)) integer,parameter:: nkr2 = sum(abs(allkr1(1:3))) print *, nkr1 result1 = nkr1 if (any(result1 /= [1, 2, 3, 4])) error stop print *, nkr2 result2 = nkr2 if (result2 /= 6) error stop print *, nkr call realkinds(nkr) contains subroutine realkinds( nkr) integer,intent(in)::nkr integer :: n print "(A,I0)",'precision(1.0_kr1) = ',precision(1.0_kr1) if(nkr>=2) print "(A,I0)",'precision(1.0_kr2) = ',precision(1.0_kr2) if(nkr>=3) print "(A,I0)",'precision(1.0_kr3) = ',precision(1.0_kr3) write(*,"(A,I0,A)",advance='no') & 'Number of different real kinds = ',nkr,', real kinds:' print "(*(1X,I0))",allkr(1:nkr) print "(3A)",'There ',merge('may be','are no',nkr>=maxkr),' more real kinds' end subroutine realkinds end program intrinsics_391 lfortran-0.63.0/integration_tests/legacy_array_sections_05.f900000664000175000017500000000077515174404631024573 0ustar alastairalastairsubroutine qrfac() implicit none real:: a(5, 5) a = 12.9 print *, enorm(a(1, 1)) if ( abs(enorm(a(1,1)) - 832.049927 ) > 1e-8) error stop contains pure real function enorm(x) implicit none real, intent(in) :: x(5) integer :: i enorm = 0.0 do i = 1, 5 enorm = enorm + x(i)**2 end do end function enorm end subroutine qrfac program legacy_array_sections_05 implicit none call qrfac() end program lfortran-0.63.0/integration_tests/string_75.f900000664000175000017500000000052315174404631021526 0ustar alastairalastairmodule string_75_mod implicit none contains character function tolower (c) result (res) character, intent(in) :: c res = merge (achar (iachar (c) + 32), c, c >= 'A' .and. c <= 'Z') end function end module program string_75 use string_75_mod implicit none if (tolower("A") /= "a") error stop end program string_75 lfortran-0.63.0/integration_tests/program_04.f900000664000175000017500000000005115174404631021653 0ustar alastairalastairimplicit none print *, "hello world" end lfortran-0.63.0/integration_tests/derived_types_67.f900000664000175000017500000000222115174404631023064 0ustar alastairalastairmodule derived_types_67_type_mod implicit none private public :: my_type, my_val type :: my_val end type type, extends(my_val) :: my_type integer :: x end type end module derived_types_67_type_mod module derived_types_67_cast_utils use derived_types_67_type_mod, only: my_type, my_val implicit none private public :: cast_to_my_type, my_type, my_val contains function cast_to_my_type(obj) result(p) class(my_val), intent(in), target :: obj type(my_type), pointer :: p select type(obj) class is(my_type) p => obj end select end function cast_to_my_type end module derived_types_67_cast_utils program derived_types_67 use derived_types_67_cast_utils, only: temp_my_type => my_type, my_val, cast_to_my_type implicit none class(my_val), allocatable :: j_value type(temp_my_type), pointer :: ptr allocate(temp_my_type :: j_value) select type(j_value) class is(temp_my_type) j_value%x = 42 end select ptr => cast_to_my_type(j_value) if (ptr%x /= 42) error stop end program derived_types_67 lfortran-0.63.0/integration_tests/kwargs_02.f900000664000175000017500000000151315174404631021504 0ustar alastairalastairmodule kwargs_02_stdlib_logger type :: logger_type contains private procedure, public, pass(self) :: add_log_file procedure, public, pass(self) :: log_io_error end type logger_type contains subroutine add_log_file(self, filename, unit) class(logger_type), intent(inout) :: self character(*), intent(in) :: filename integer, intent(out), optional :: unit call self % log_io_error(1, filename=filename, unit=unit) end subroutine add_log_file subroutine log_io_error(self, code, filename, unit) class(logger_type), intent(inout) :: self integer, intent(in) :: code character(*), intent(in), optional :: filename integer, intent(out), optional :: unit end subroutine log_io_error end module kwargs_02_stdlib_logger program kwargs_02 end program lfortran-0.63.0/integration_tests/arrays_104.f900000664000175000017500000000251415174404631021574 0ustar alastairalastair! Test passing non-contiguous array sections to type-bound procedures. ! The stride of the second dimension must reflect the original array's ! leading dimension, not the extent of the section. module arrays_104_mod implicit none type :: MyType contains procedure :: method end type MyType contains subroutine method(self, a, b) class(MyType), intent(in) :: self real(8), intent(in) :: a(:,:) real(8), intent(in) :: b(:) integer :: i, j do i = 1, size(a, 1) do j = 1, size(a, 2) if (abs(a(i, j) - real(j, 8)) > 1.0d-12) error stop end do end do do i = 1, size(b) if (abs(b(i) - 1.0d0) > 1.0d-12) error stop end do end subroutine method end module arrays_104_mod program arrays_104 use arrays_104_mod implicit none real(8) :: a(4, 4), b(4) integer :: i, j, n, n2 class(MyType), allocatable :: obj allocate(obj) n = 3 n2 = 4 do j = 1, 4 do i = 1, 4 a(i, j) = real(j, 8) end do end do b = 1.0d0 ! Verify directly do i = 1, n do j = 1, n2 if (abs(a(i, j) - real(j, 8)) > 1.0d-12) error stop end do end do ! Pass non-contiguous section a(1:3, 1:4) from a 4x4 array call obj%method(a(1:n, 1:n2), b(1:n)) print *, "PASS" end program arrays_104 lfortran-0.63.0/integration_tests/logical_kind_07.f900000664000175000017500000000052615174404631022635 0ustar alastairalastairprogram logical_kind_07 implicit none logical(8) :: x8 x8 = .true. ! Without KIND: must return default logical kind if (kind(logical(x8)) /= kind(.true.)) error stop ! With explicit KIND: must use the specified kind if (kind(logical(x8, kind=8)) /= 8) error stop if (kind(logical(x8, kind=4)) /= 4) error stop end program lfortran-0.63.0/integration_tests/string_25.f900000664000175000017500000000127515174404631021526 0ustar alastairalastairprogram string_25 character(len=3) :: s1, s2 character(len=4) :: s3 character(len=2) :: s4 s1 = "abc" s2 = "abc" s3 = "defe" s4 = "ab" if (s1 == s2) then print *, "equal" else print *, "not equal" end if if (s4 < s1) then print *, "less than" else print *, "not less than" end if if (s3 > s4) then print *, "greater than" else print *, "not greater than" end if if (s2 /= s4) then print *, "not equal" else print *, "not, not equal" end if if (s4 <= s3) then print *, "less than equal to" else print *, "not less than equal to" end if if (s3 >= s2) then print *, "greater than equal to" else print *, "not greater than equal to" end if end program lfortran-0.63.0/integration_tests/class_90.f900000664000175000017500000000150015174404631021316 0ustar alastairalastairprogram class_90 implicit none integer :: x(3) x = [1, 2, 3] call print_any(x) contains subroutine print_any(val) class(*) :: val(:) select type(val) type is (integer) call print_any2(val) print *, "After modification in print_any2:", val(1), val(2), val(3) if (val(1) /= 10 .or. val(2) /= 20 .or. val(3) /= 30) error stop "Modification not reflected" end select end subroutine print_any subroutine print_any2(val) integer :: val(:) print *, "Integer array:", val if (size(val) /= 3) error stop "Size mismatch" if (val(1) /= 1 .or. val(2) /= 2 .or. val(3) /= 3) error stop "Value mismatch" val(1) = 10 val(2) = 20 val(3) = 30 end subroutine print_any2 end program class_90lfortran-0.63.0/integration_tests/separate_compilation_22b.f900000664000175000017500000000027215174404631024555 0ustar alastairalastairsubmodule (math_separate_compilation_22) math_separate_compilation_22_logspace implicit none contains module procedure logspace_sub n = 3 end procedure end submodulelfortran-0.63.0/integration_tests/write_12.f900000664000175000017500000000055315174404631021344 0ustar alastairalastairprogram write_12 implicit none integer :: x character(20) :: buf x = 42 ! Test that unit 6 is pre-connected (writes to stdout) write(6, '(A,I0)') "x = ", x ! Verify formatted write works correctly write(buf, '(A,I0)') "x = ", x if (trim(buf) /= "x = 42") error stop "formatted write failed" print *, "PASS" end program lfortran-0.63.0/integration_tests/include_03/0000775000175000017500000000000015174404631021312 5ustar alastairalastairlfortran-0.63.0/integration_tests/include_03/i.inc0000664000175000017500000000003415174404631022232 0ustar alastairalastairinteger, parameter :: i = 4 lfortran-0.63.0/integration_tests/ip_01.f900000664000175000017500000000025415174404631020616 0ustar alastairalastairprogram ip_01 use iso_fortran_env implicit none integer, parameter :: IP = int32 integer(IP) :: n_small = 2_IP print *, n_small if (n_small /= 2_IP) error stop end program lfortran-0.63.0/integration_tests/intrinsics_221.f900000664000175000017500000000075215174404631022462 0ustar alastairalastairprogram intrinsics_221 implicit none integer, parameter :: N = 10 integer, parameter :: sp = kind(1.0) integer, parameter :: dp = kind(1.d0) real(dp), parameter :: pi = 2*asin(1._dp) real(dp), parameter :: a = 0, b = pi real(dp), parameter :: dx = (b-a)/N integer :: i real(dp), parameter :: X(N) = [(sin(a+(b-a)*i/N), i = 1, N)] real(dp), parameter :: S = sum(X)*dx print*, S if (abs(S - 1.983523537509) > 1e-7) error stop end program lfortran-0.63.0/integration_tests/transfer_19.f900000664000175000017500000000127515174404631022047 0ustar alastairalastairprogram transfer_19 use, intrinsic :: iso_fortran_env, only: int32, int64, int8 integer(int8) :: key(16) = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16] integer(int64) :: buf(2) buf = transfer( key, 0_int64, 2 ) if (buf(1) /= 578437695752307201_int64) error stop if (buf(2) /= 1157159078456920585_int64) error stop call test_sub(key) contains subroutine test_sub(key) integer(int64) :: bend = 1 integer(int8), intent(in), target :: key(0:) integer(int64) :: buf2(0:1) buf2(0:2*bend-1) = transfer( key(0:16_8*bend-1_8), 0_int64, 2*bend ) if (buf2(0) /= 578437695752307201_int64) error stop if (buf2(1) /= 1157159078456920585_int64) error stop end subroutine end program transfer_19lfortran-0.63.0/integration_tests/intrinsics_348.f900000664000175000017500000000037515174404631022475 0ustar alastairalastairprogram intrinsics_348 integer :: A(2, 2) call temp(A) contains subroutine temp(A) integer, intent(inout) :: A(:, :) integer :: X(4) X = [1,2,3,4] print *, reshape(X, shape(A)) end subroutine end programlfortran-0.63.0/integration_tests/separate_compilation_15.f900000664000175000017500000000022215174404631024410 0ustar alastairalastairprogram separate_compilation_15a use, non_intrinsic :: separate_compilation_15a_module call test_solver() end program separate_compilation_15a lfortran-0.63.0/integration_tests/intrinsics_421.f900000664000175000017500000000163015174404631022460 0ustar alastairalastairprogram intrinsics_421 implicit none integer :: cs character(200) :: cmsg cs = -1 cmsg = "" call execute_command_line("echo hello > /dev/null 2>&1", cmdstat=cs, cmdmsg=cmsg) if (cs /= 0) error stop "cmdstat should be 0 for valid command" cs = 0 cmsg = "" call execute_command_line("FOOBAR_NONEXISTENT_CMD 2>/dev/null", cmdstat=cs, cmdmsg=cmsg) if (cs <= 0) error stop "cmdstat should be positive for invalid command" if (len_trim(cmsg) == 0) error stop "cmdmsg should be non-empty for invalid command" cs = -1 call execute_command_line("echo test > /dev/null 2>&1", cmdstat=cs) if (cs /= 0) error stop "cmdstat should be 0 for valid command (no cmdmsg)" cs = 0 call execute_command_line("FOOBAR_ANOTHER_BAD 2>/dev/null", cmdstat=cs) if (cs <= 0) error stop "cmdstat should be positive for invalid command (no cmdmsg)" end program intrinsics_421lfortran-0.63.0/integration_tests/dealloc_06.f900000664000175000017500000000145515174404631021622 0ustar alastairalastairprogram dealloc_06 implicit none type :: linear2d_layer real, allocatable :: weights(:,:) end type linear2d_layer type :: attention_layer integer :: model_dimension type(linear2d_layer) :: query_layer end type attention_layer type(attention_layer) :: self real :: params(80) self % model_dimension = 4 allocate(self % query_layer % weights(4, 4)) self % query_layer % weights = 0.1 params = 0.5 call set_params(self, params) if (any(self % query_layer % weights /= 0.5)) then error stop "weights value mismatch" end if contains subroutine set_params(self, params) type(attention_layer), intent(inout) :: self real, intent(in) :: params(:) self % query_layer % weights = reshape(params, [4,4]) end subroutine set_params end program dealloc_06 lfortran-0.63.0/integration_tests/modules_65_worker.f900000664000175000017500000000071515174404631023263 0ustar alastairalastairmodule modules_65_worker use modules_65_base, only: holder_t use modules_65_child, only: child_t implicit none contains function classify(h) result(res) type(holder_t), intent(in) :: h integer :: res res = -1 select type (x => h%item) class is (child_t) res = x%extra class default res = x%width end select end function classify end module modules_65_worker lfortran-0.63.0/integration_tests/gpu_metal_151_dep.f900000664000175000017500000000027215174404631023101 0ustar alastairalastairmodule gpu_metal_151_dep_m implicit none integer, parameter :: wp = kind(1.) end module module gpu_metal_151_layer_m use gpu_metal_151_dep_m, only : wp implicit none end module lfortran-0.63.0/integration_tests/file_overwrite.f900000664000175000017500000000063215174404631022733 0ustar alastairalastairprogram overwrite_with_rec use iso_fortran_env, only: int32 implicit none integer(int32) :: x, y ,z x = 654321 z = 456465 open(10, file="file_overwrite.bin", access="direct", recl=4) write(10, rec=1) x write(10,rec=1) z close(10) open(10, file="file_overwrite.bin", access="direct", recl=4) read(10, rec=1) y close(10) if (y /= z) error stop end program lfortran-0.63.0/integration_tests/doloop_11.f900000664000175000017500000000033015174404631021476 0ustar alastairalastairprogram doloop11 implicit none integer :: i integer :: s s = 0 do i = 1, 2 s = i end do print *, s, i if (i /= 3) error stop if (s /= 2) error stop end program doloop11 lfortran-0.63.0/integration_tests/read_55.f900000664000175000017500000000117515174404631021135 0ustar alastairalastairprogram write_and_read_temp character(len=20) :: buf integer(8) :: stat, major, temp = 1 character(len=20) :: filename filename = "tempfile.txt" open(unit=10, file=filename, status='replace', access="stream", form="unformatted") write(10) "HELLOWORLD" close(10) open(unit=10, file=filename, status='old', access="stream", form="unformatted") major = 1 ! Try changing this to 1 read(10, iostat=stat) buf(1:merge(4, 2, major > 1)) if (stat /= 0) then print *, "Read error, iostat =", stat stop 1 end if close(10, status="delete") end program write_and_read_templfortran-0.63.0/integration_tests/class_51.f900000664000175000017500000000302415174404631021316 0ustar alastairalastairmodule class_51_mod type :: MyType integer :: value end type MyType contains function my_class_func() result(obj) class(MyType), allocatable :: obj allocate(obj) obj % value = 42 end function function my_type_func() result(obj) type(MyType), allocatable :: obj allocate(obj) obj % value = 37 end function function my_class_func_ptr() result(obj) class(MyType), pointer :: obj allocate(obj) obj % value = 42 end function function my_type_func_ptr() result(obj) type(MyType), pointer :: obj allocate(obj) obj % value = 37 end function end module class_51_mod program class_51 use class_51_mod implicit none class(MyType), allocatable :: my_class_var class(MyType), pointer :: my_class_var_ptr type(MyType), allocatable :: my_type_var type(MyType), pointer :: my_type_var_ptr my_class_var = my_class_func() print *, "my_class_var%value: ", my_class_var%value if (my_class_var%value /= 42) error stop my_type_var = my_type_func() print *, "my_type_var%value: ", my_type_var%value if (my_type_var%value /= 37) error stop my_class_var_ptr => my_class_func_ptr() print *, "my_class_var_ptr%value: ", my_class_var_ptr%value if (my_class_var_ptr%value /= 42) error stop my_type_var_ptr => my_type_func_ptr() print *, "my_type_var_ptr%value: ", my_type_var_ptr%value if (my_type_var_ptr%value /= 37) error stop deallocate(my_class_var_ptr) deallocate(my_type_var_ptr) end programlfortran-0.63.0/integration_tests/read_74.f900000664000175000017500000000140015174404631021125 0ustar alastairalastairprogram read_74 implicit none ! Test list-directed read of multiple types from a file ! with comma-separated values including D-exponent notation character(*), parameter :: cdata = "2, 2.5D0, 2.5D0, T, (3.0,4.0), 'TEST'" integer :: i1 real :: r1 double precision :: d1 logical :: l1 complex :: c1 character(8) :: s1 open (42, file='read_74.dat', status='replace', form='formatted') write (42,'(a)') cdata rewind (42) read (42, *) i1, r1, d1, l1, c1, s1 if (i1 /= 2) error stop if (abs(r1 - 2.5) > 0.0001) error stop if (abs(d1 - 2.5d0) > 0.0001d0) error stop if (.not. l1) error stop if (abs(real(c1) - 3.0) > 0.0001) error stop if (abs(aimag(c1) - 4.0) > 0.0001) error stop if (s1 /= 'TEST') error stop print *, "PASS" close (42, status='delete') end program lfortran-0.63.0/integration_tests/max_01.f900000664000175000017500000000015215174404631020770 0ustar alastairalastairprogram max_01 real(8) :: y real :: z y = 5.2d0 z = 9.0 print *, max(y, z) end programlfortran-0.63.0/integration_tests/fortran_02.f900000664000175000017500000000023415174404631021660 0ustar alastairalastairprogram openmp_40 integer :: i, j, res=0 do concurrent ( i =1:5, j = 1:10 ) res=res+2 end do print *,"res =",res if (res /= 100) error stop end programlfortran-0.63.0/integration_tests/optional_03.f900000664000175000017500000000144215174404631022035 0ustar alastairalastairmodule test_optional_module_01 implicit none type :: string character(:), allocatable :: s end type contains subroutine sub_01(x) type(string), optional, intent(inout) :: x(:) if (present(x)) then x(1)%s = "presentx" end if end subroutine end module test_optional_module_01 module test_optional_module_02 use test_optional_module_01, only: sub_01, string implicit none contains subroutine sub_02() type(string) :: strdt(1) call sub_01() call sub_01(strdt) print *, strdt(1)%s if( strdt(1)%s /= "presentx" ) error stop end subroutine sub_02 end module test_optional_module_02 program optional_03 use test_optional_module_02, only: sub_02 implicit none call sub_02() end program lfortran-0.63.0/integration_tests/gpu_metal_56.f900000664000175000017500000000063315174404631022176 0ustar alastairalastairprogram gpu_metal_56 implicit none integer :: n(3) real :: x(3) integer :: i n = [1, 2, 3] x = 0.0 associate(m => n) do concurrent (i = 1:2) associate(k => 1) x(m(k)) = 1.0 end associate end do end associate if (abs(x(1) - 1.0) > 1.0e-6) error stop if (abs(x(2) - 0.0) > 1.0e-6) error stop if (abs(x(3) - 0.0) > 1.0e-6) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/nested_08.f900000664000175000017500000000115115174404631021474 0ustar alastairalastairmodule nested_08_testmod_der1 private public fcn contains subroutine fcn(x, fvec) real, intent(in) :: x(3) real, intent(out) :: fvec(15) integer :: i do i = 1, 3 fvec(i) = x(1) /( x(2) + x(3) ) end do do i = 1, 3 if (fvec(i) /= 0.5) error stop end do end subroutine end module program example_lmder1 use nested_08_testmod_der1, only: fcn real :: x(3), fvec(15) ! The following starting values provide a rough fit. x = [1.0, 1.0, 1.0] call check_deriv(x, fvec) contains subroutine check_deriv(x, fvec) real, intent(in) :: x(3) real, intent(out) :: fvec(15) call fcn(x, fvec) end subroutine end program lfortran-0.63.0/integration_tests/format_36.f900000664000175000017500000000150415174404631021505 0ustar alastairalastairprogram format_36 use iso_fortran_env, only: int32, int64, real32, real64 implicit none real(real32) :: val32 real(real64) :: val64 integer(int64) :: minus_one integer(int64) :: val64_bits character(len=8) :: hex32 character(len=16) :: hex64_real character(len=16) :: hex64_expected character(len=16) :: hex64_int val32 = 123.456_real32 val64 = 123.456_real64 minus_one = -1_int64 val64_bits = transfer(val64, val64_bits) write(hex32, '(Z8.8)') val32 if (trim(hex32) /= '42F6E979') error stop write(hex64_real, '(Z16.16)') val64 write(hex64_expected, '(Z16.16)') val64_bits if (trim(hex64_real) /= trim(hex64_expected)) error stop write(hex64_int, '(Z16.16)') minus_one if (trim(hex64_int) /= 'FFFFFFFFFFFFFFFF') error stop end program format_36 lfortran-0.63.0/integration_tests/bindc_45.f900000664000175000017500000000354615174404631021304 0ustar alastairalastair! Test: RECURSIVE attribute with BIND(C) procedures ! ! Features tested: ! - Self-recursive BIND(C) function (factorial) ! - Mutual recursion between Fortran and C (fibonacci) ! Each recursive call alternates: Fortran -> C -> Fortran -> ... module bindc_45_mod use iso_c_binding implicit none interface integer(c_int) function c45_mutual_fib(n) bind(C) import :: c_int integer(c_int), value :: n end function end interface contains recursive integer(c_int) function f45_factorial(n) & bind(C, name="f45_factorial") result(res) integer(c_int), value, intent(in) :: n if (n <= 1) then res = 1 else res = n * f45_factorial(n - 1) end if end function recursive integer(c_int) function f45_fib(n) & bind(C, name="f45_fib") result(res) integer(c_int), value, intent(in) :: n if (n <= 0) then res = 0 else if (n == 1) then res = 1 else res = c45_mutual_fib(n - 1) + c45_mutual_fib(n - 2) end if end function end module program bindc_45 use iso_c_binding use bindc_45_mod implicit none ! Test 1: Self-recursive BIND(C) (factorial) if (f45_factorial(0) /= 1) error stop "FAIL: fact(0)" if (f45_factorial(1) /= 1) error stop "FAIL: fact(1)" if (f45_factorial(5) /= 120) error stop "FAIL: fact(5)" if (f45_factorial(10) /= 3628800) error stop "FAIL: fact(10)" ! Test 2: Mutual recursion Fortran<->C (fibonacci) if (c45_mutual_fib(0) /= 0) error stop "FAIL: fib(0)" if (c45_mutual_fib(1) /= 1) error stop "FAIL: fib(1)" if (c45_mutual_fib(5) /= 5) error stop "FAIL: fib(5)" if (c45_mutual_fib(10) /= 55) error stop "FAIL: fib(10)" print *, "All bindc_45 tests passed." end program lfortran-0.63.0/integration_tests/expr_21.f900000664000175000017500000000040215174404631021161 0ustar alastairalastairprogram expr_21 use ieee_arithmetic, only: ieee_is_nan implicit none real :: x = -8.0 real :: res res = x**(1.0/3.0) if (.not. ieee_is_nan(res)) error stop "expected NaN for negative real ** non-integer" print "(F0.1)", res end program expr_21 lfortran-0.63.0/integration_tests/intrinsics_180.f900000664000175000017500000000052315174404631022462 0ustar alastairalastairprogram intrinsics_180 implicit none character(len=20) :: x integer :: pos x = "fortran" pos = scan(x, "ao") print *, pos if (pos /= 2) error stop pos = scan(x, "a") print *, pos if (pos /= 6) error stop pos = scan(x, "ao", .true.) print *, pos if (pos /= 6) error stop end program lfortran-0.63.0/integration_tests/intrinsics_46.f900000664000175000017500000000577115174404631022415 0ustar alastairalastairprogram intrinsics_46 implicit none ! Compile_time integer :: i, j, c integer(8) :: li_1, lj_1, li_2, lj_2 integer(8) :: int_res(4) integer, parameter :: dp = kind(0d0) character(len=1) :: c_1 = 'b' character(len = 1) :: a = 'a' character(len = 1) :: b = 'b' character(len = 1) :: d = '#' character(len=1) :: e(3) integer :: x(3) integer, parameter :: i1 = ichar('a') integer(8), parameter :: i2 = ichar('a', kind=8) integer, parameter :: ar1(3) = ichar(['a', '$', '%']) integer(8), parameter :: ar2(3) = ichar(['a', '$', '%'], 8) character(1) :: arr1(3) = ['a', 'A', '@'] print *, i1 if (i1 /= 97) error stop print *, i2 if (i2 /= 97) error stop print *, ar1 if (any(ar1 /= [97, 36, 37])) error stop print *, ar2 if (any(ar2 /= [97, 36, 37])) error stop print *, ichar(arr1) if (any(ichar(arr1) /= [97, 65, 64])) error stop i = ichar(' ') j = iachar(' ') li_1 = ichar('A', 8) lj_1 = iachar('a', 8) li_2 = ichar('Z', kind=8) lj_2 = iachar('z', kind=8) c_1 = char(100); e = ["a", "b", "c"] x = [97, 98, 99] if (i /= 32) error stop if (j /= 32) error stop if (li_1 /= 65) error stop if (lj_1 /= 97) error stop if (li_2 /= 90) error stop if (lj_2 /= 122) error stop ! Compile time with broadcasting int_res = ichar([' ', 'c', 'd', 'e'], kind=8) if (int_res(1) /= 32) error stop if (kind(int_res(1)) /= dp) error stop if (int_res(2) /= 99) error stop if (kind(int_res(2)) /= dp) error stop if (int_res(3) /= 100) error stop if (kind(int_res(3)) /= dp) error stop if (int_res(4) /= 101) error stop if (kind(int_res(4)) /= dp) error stop ! Run_time c = ichar(c_1) if (c /= 100) error stop if (char(c) /= 'd') error stop c = 100 c_1 = achar(100) if (c_1 /= "d") error stop c_1 = achar(c) if (c_1 /= "d") error stop c_1 = char(100) if (c_1 /= "d") error stop c_1 = char(c) if (c_1 /= "d") error stop c_1 = "e" c = iachar("e") if (c /= 101) error stop c = iachar(c_1) if (c /= 101) error stop c = ichar("e") if (c /= 101) error stop c = ichar(c_1) if (c /= 101) error stop print *, ichar(a) if(ichar(a) /= 97) error stop print *, ichar(b) if(ichar(b) /= 98) error stop print *, ichar(d) if(ichar(d) /= 35) error stop print *, ichar('a') if(ichar('a') /= 97) error stop print *, ichar('b') if(ichar('b') /= 98) error stop print *, ichar('C') if(ichar('C') /= 67) error stop print *, ichar('#') if(ichar('#') /= 35) error stop print *, kind(ichar(a)) if(kind(ichar(a)) /= 4) error stop print *, kind(ichar(a, 8)) if(kind(ichar(a, 8)) /= 8) error stop print *, kind(ichar('a')) if(kind(ichar('a')) /= 4) error stop print *, kind(ichar('a', 8)) if(kind(ichar('a', 8)) /= 8) error stop print *, ichar(e) if (any(ichar(e) /= x)) error stop end program intrinsics_46 lfortran-0.63.0/integration_tests/intrinsics_04.f900000664000175000017500000000115115174404631022373 0ustar alastairalastairprogram intrinsics_04 use iso_fortran_env, only: dp=>real64, sp=>real32 real(dp) :: x complex(dp) :: z x = 1.5_dp x = tan(x) print *, x if (abs(x - 14.101419947171721_dp) > 1e-10_dp) error stop if (abs(tan(1.5_sp) - 14.1014204_sp) > 1e-6) error stop if (abs(tan(tan(1.5_sp) + tan(x+tan(x))) - 2.254825) > 1e-5) error stop z = (1.5_dp, 3.5_dp) z = tan(z) print *, z if (abs(real(z,dp) - 2.57834890405532317E-004_dp) > 1e-10_dp) error stop if (abs(real(tan((1.5_sp, 3.5_sp)), sp) - 2.57834879E-004_sp) > 1e-10_dp) error stop if (abs(aimag(z) - 1.0018071108086137_dp) > 1e-10_dp) error stop end program intrinsics_04 lfortran-0.63.0/integration_tests/arrays_reshape_24.f900000664000175000017500000000107015174404631023220 0ustar alastairalastair! Testing for correct handling of compile-time value (if present) during `Var` node ! replacement with `m_value` for a module variable by `array_struct_temporary` pass. module arrays_reshape_24_mod implicit none character(len=*,kind=1), parameter :: test1data(2,2) = reshape([character(len=2) :: "ab", "cd", "ef", "gh"], [2, 2]) end module program arrays_reshape_24 use arrays_reshape_24_mod print *, size(test1data, 1) if (size(test1data, 1) /= 2) error stop print *, size(test1data, 2) if (size(test1data, 2) /= 2) error stop end program lfortran-0.63.0/integration_tests/complex_cloc_01.f900000664000175000017500000000136015174404631022654 0ustar alastairalastairmodule complex_cloc_01_module implicit none contains impure elemental function cmag(x, y) result(r) real, intent(in), target :: x, y real :: r r = sqrt(x**2 + y**2) end function end module complex_cloc_01_module program complex_cloc_01 use complex_cloc_01_module implicit none complex, target :: z(3) real :: q(3) z%re = [1.0, 2.0, 3.0] z%im = [0.0, 0.0, 0.0] q = cmag(z%re, z%im) if (abs(q(1) - 1.0) > 1e-6) error stop if (abs(q(2) - 2.0) > 1e-6) error stop if (abs(q(3) - 3.0) > 1e-6) error stop ! Non-trivial case: 3-4-5 right triangle z(1) = (3.0, 4.0) q(1) = cmag(z(1)%re, z(1)%im) if (abs(q(1) - 5.0) > 1e-6) error stop end program complex_cloc_01 lfortran-0.63.0/integration_tests/read_37.f900000664000175000017500000000050515174404631021131 0ustar alastairalastairprogram read_struct_internal type :: t integer :: a end type t type(t) :: x character(len=10) :: buf buf = "123" ! This used to cause ICE (StructType passed to lowering) read(buf, *) x if (x%a /= 123) error stop "Struct read failed" print *, "OK" end program read_struct_internal lfortran-0.63.0/integration_tests/read_03_data.txt0000664000175000017500000000002415174404631022330 0ustar alastairalastair123456789 987654321 lfortran-0.63.0/integration_tests/write_10.f900000664000175000017500000000273315174404631021344 0ustar alastairalastairmodule write_10_m type :: mytype character(len=:), allocatable :: raw end type interface write(unformatted) module procedure :: my_write end interface interface read(unformatted) module procedure :: my_read end interface contains subroutine my_write(x, unit, iostat, iomsg) class(mytype), intent(in) :: x integer, intent(in) :: unit integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg write(unit, iostat=iostat, iomsg=iomsg) len(x%raw) print *, "Writing length:", len(x%raw) if (len(x%raw) /= 5) error stop end subroutine subroutine my_read(x, unit, iostat, iomsg) class(mytype), intent(inout) :: x integer, intent(in) :: unit integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg integer :: l read(unit, iostat=iostat, iomsg=iomsg) l allocate(character(len=l) :: x%raw) end subroutine end module write_10_m program write_10 use write_10_m implicit none type(mytype) :: x, y integer :: u, iostat character(len=100) :: iomsg x%raw = "hello" open(newunit=u, form="unformatted", status="scratch") write(u, iostat=iostat, iomsg=iomsg) x print *, len(x%raw) if (len(x%raw) /= 5) error stop rewind(u) read(u, iostat=iostat, iomsg=iomsg) y print *, len(y%raw) if (len(y%raw) /= 5) error stop close(u) end program write_10 lfortran-0.63.0/integration_tests/modules_09_a.f900000664000175000017500000000023115174404631022161 0ustar alastairalastairmodule modules_09_a use modules_09_b, only: b, i implicit none private public a contains integer function a() a = 3 + b() + i end function end module lfortran-0.63.0/integration_tests/common_24b.f900000664000175000017500000000022015174404631021636 0ustar alastairalastairsubroutine set2() implicit none integer :: info integer :: iunit common /infoc/ info, iunit info = 2 end subroutine set2 lfortran-0.63.0/integration_tests/class_18.f900000664000175000017500000000430615174404631021325 0ustar alastairalastairmodule class_18_mod use iso_fortran_env implicit none type KeywordEnforcer end type KeywordEnforcer public :: Integer32Complex32Map public :: Integer32Complex32Pair type :: Integer32Complex32Pair integer(kind=INT32) :: first complex(kind=REAL32) :: second end type Integer32Complex32Pair type, abstract :: map_s_BaseNode end type map_s_BaseNode type, extends(map_s_BaseNode) :: map_s_Node type(map_s_Node), pointer :: parent => null() end type map_s_Node type :: map_Set private class(map_s_BaseNode), allocatable :: root contains procedure :: insert_single => map_s_insert_single generic :: insert => insert_single end type map_Set type :: Integer32Complex32Map private type(map_Set) :: tree contains procedure :: of => map_of end type Integer32Complex32Map contains subroutine map_s_insert_single(this, value, unused, is_new) class(map_Set), target, intent(inout) :: this type(Integer32Complex32Pair), intent(in) :: value integer, optional :: unused logical, optional, intent(out) :: is_new if (present(is_new)) then is_new = .true. end if if (present(unused)) then unused = 21 end if end subroutine map_s_insert_single subroutine map_of(this, key) class(Integer32Complex32Map), target, intent(inout) :: this integer(kind=INT32), intent(in) :: key type(Integer32Complex32Pair) :: p logical :: is_new1, is_new2, is_new3 integer :: unused1, unused2, unused3 p%first= key call this%tree%insert(p, is_new=is_new1) if (is_new1 .eqv. .false.) error stop call this%tree%insert(p, unused=unused1) if (unused1 /= 21) error stop call this%tree%insert(p, is_new=is_new2, unused=unused2) if (is_new2 .eqv. .false.) error stop if (unused2 /= 21) error stop call this%tree%insert(p, unused=unused3, is_new=is_new3) if (is_new3 .eqv. .false.) error stop if (unused3 /= 21) error stop end subroutine map_of end module class_18_mod program class_18 use class_18_mod implicit none type(Integer32Complex32Map) :: m call m%of(42) end program lfortran-0.63.0/integration_tests/elemental_08.f900000664000175000017500000000074315174404631022166 0ustar alastairalastairprogram elemental_08 integer, parameter :: n = 10 integer :: i type :: vector integer :: elements(5:15) end type type(vector) :: a, b, c do i = 5, 15 a%elements(i) = i b%elements(i) = i end do c%elements = add_vector(a%elements, b%elements) print *, c%elements do i = 5, 15 if (c%elements(i) /= 2*i) error stop end do contains elemental function add_vector(a, b) result(c) integer, intent(in) :: a, b integer :: c c = a + b end function end program lfortran-0.63.0/integration_tests/intrinsics_302.f900000664000175000017500000000052115174404631022454 0ustar alastairalastairprogram intrinsics_302 implicit none integer :: x(4) = [1,2,3,4] print *, is_contiguous([1,2,3,4]) if (.not. is_contiguous([1,2,3,4])) error stop print *, is_contiguous(x) if (.not. is_contiguous(x)) error stop print *, is_contiguous(x(::2)) if (is_contiguous(x(::2))) error stop end program lfortran-0.63.0/integration_tests/merge_str_01.f900000664000175000017500000000064015174404631022174 0ustar alastairalastairprogram merge_str_01 implicit none character(len=5) :: a, b, c logical :: mask4 logical(1) :: mask1 a = "hello" b = "world" mask4 = .true. c = merge(a, b, mask4) if (c /= "hello") error stop mask1 = .false. c = merge(a, b, mask1) if (c /= "world") error stop mask1 = .true. c = merge(a, b, mask1) if (c /= "hello") error stop print *, "ok" end program lfortran-0.63.0/integration_tests/subroutines_07.f900000664000175000017500000000077415174404631022605 0ustar alastairalastairmodule subroutines_07_mod interface f_int procedure f end interface contains subroutine f(a, b, c, d, kind) integer, intent(in) :: a, d, c integer, intent(in), optional :: kind integer, intent(out) :: b b = a + 1 + c + d end subroutine end module program subroutines_07 use subroutines_07_mod implicit none integer :: i, j, k, l i = 1 j = 1 k = 1 l = 1 call f_int(i, j, k, l) if (j /= 4) error stop end programlfortran-0.63.0/integration_tests/legacy_array_sections_16.f900000664000175000017500000000154415174404631024570 0ustar alastairalastairmodule legacy_array_sections_16_mod public :: ddot contains real function ddot(n, dx, incx, dy, incy) integer :: incx, incy, n real :: dx(*), dy(*) real :: dtemp integer :: i, ix, iy, m, mp1 dtemp = 0.0 do i = 1, n dtemp = dtemp + dx(i) * dy(i) end do ddot = dtemp end function ddot end module legacy_array_sections_16_mod program legacy_array_sections_16 use legacy_array_sections_16_mod implicit none contains real function dcv(nord, w) integer, intent(in) :: nord real :: w(*) real :: v(40) integer :: i, ipp, mdw v = 0.0 ipp = 1 mdw = 1 do i = 1, nord v(i) = ddot(nord, w(ipp), 1, v(nord+1), 1) ipp = ipp + mdw end do dcv = v(1) end function dcv end program lfortran-0.63.0/integration_tests/class_76.f900000664000175000017500000000133515174404631021330 0ustar alastairalastairmodule constructor_mod implicit none type :: toml_map end type toml_map type :: toml_table class(toml_map), allocatable :: map end type toml_table interface toml_table module procedure toml_table_init end interface toml_table contains function toml_table_init() result(this) type(toml_table) :: this allocate(toml_map :: this%map) end function toml_table_init end module constructor_mod module reexport_mod use constructor_mod, only: toml_table end module reexport_mod program main use reexport_mod, only: toml_table implicit none type(toml_table) :: tabx tabx = toml_table() if (.not. allocated(tabx%map)) error stop 1 end program main lfortran-0.63.0/integration_tests/string_88.f900000664000175000017500000000101515174404631021527 0ustar alastairalastair! This program checks Len Function ! On allocation of String Arrays with size = 0 program string_88 implicit none character(len=:), allocatable :: list1(:), list2(:) character(len=23), pointer :: list3(:) !Using pointer allocation list1 = [character(len=23):: ] allocate(character(len=23) :: list2(0)) allocate(list3(0)) print *,len(list1), len(list2), len(list3) if (len(list1) /= 23) error stop if (len(list2) /= 23) error stop if (len(list3) /= 23) error stop deallocate(list3) end program string_88lfortran-0.63.0/integration_tests/variables_02.f900000664000175000017500000000030715174404631022156 0ustar alastairalastairprogram variables_02 implicit none integer :: x, y x = 2 y = x + 1 if (y /= 3) error stop x = 2 y = 3 y = (x+2)*(1-y)+1 if (y /= -7) error stop x = 2 y = -x*(-x) if (y /= 4) error stop end program lfortran-0.63.0/integration_tests/types_01.f900000664000175000017500000000014515174404631021351 0ustar alastairalastairprogram types_01 implicit none real :: r r = 1.0 r = 1.5 r = 1. r = float(2) r = dble(3) end program lfortran-0.63.0/integration_tests/submodule_31.f900000664000175000017500000000210015174404631022200 0ustar alastairalastairmodule submodule_31_mod implicit none interface module subroutine greet(x) integer, intent(inout) :: x end subroutine module subroutine caller(x) integer, intent(inout) :: x end subroutine end interface end module submodule(submodule_31_mod) submodule_31_impl implicit none contains module procedure greet x = x + 10 end procedure end submodule submodule(submodule_31_mod) submodule_31_middle implicit none interface module subroutine do_call(x) integer, intent(inout) :: x end subroutine end interface contains module procedure caller call do_call(x) end procedure end submodule submodule(submodule_31_mod:submodule_31_middle) submodule_31_leaf implicit none contains module procedure do_call call greet(x) end procedure end submodule program submodule_31 use submodule_31_mod, only: caller implicit none integer :: x x = 5 call caller(x) if (x /= 15) error stop print *, x end program lfortran-0.63.0/integration_tests/arrayprint_01.f900000664000175000017500000000017315174404631022401 0ustar alastairalastairprogram arrayprint_01 real :: x(3) integer :: i = 3 do i=1,3 x(i) = i end do print*, x end programlfortran-0.63.0/integration_tests/associate_35.f900000664000175000017500000000066115174404631022172 0ustar alastairalastairprogram associate_35 implicit none real :: x(3) x = [1.0, 2.0, 3.0] call s(x) contains subroutine s(input_data) real, intent(in) :: input_data(*) ! TODO(#10218): Use `input_data` directly once codegen ! supports assumed-size ASSOCIATE targets without ICE. associate(a => input_data(:3)) print *, a(1) end associate end subroutine s end program associate_35 lfortran-0.63.0/integration_tests/where_16.f900000664000175000017500000000136015174404631021325 0ustar alastairalastairmodule update contains subroutine updateres(b, delta, rescon) implicit none real, intent(in) :: b(:) real, intent(in) :: delta real, intent(inout) :: rescon(:) real :: ax(size(b)) integer :: idx(size(b)) ! Comment out to avoid abort logical :: mask(size(b)) ax = 1.0 mask = (abs(rescon) < delta) where (mask) rescon = max(b - ax, 0.0) end where end subroutine updateres end module update program where_16 use update implicit none real :: delta = 2.33 real :: b(2) = [5.4, 3.6] real :: rescon(2) = [2.3, 8.6] call updateres(b, delta, rescon) print *, rescon if( any(abs(rescon - [4.4, 8.6]) > 1e-6) ) error stop end program where_16 lfortran-0.63.0/integration_tests/associate_24.f900000664000175000017500000000144615174404631022172 0ustar alastairalastairprogram mre implicit none type :: line_token integer :: first, second end type type(line_token), allocatable :: token(:) integer :: shift(4) allocate(token(4)) token%first = [1, 2, 3, 4] associate(first => token%first) shift = first - 1 first = first + 1 end associate ! Check that shift = first - 1 worked (original values were 1,2,3,4) if (shift(1) /= 0) error stop if (shift(2) /= 1) error stop if (shift(3) /= 2) error stop if (shift(4) /= 3) error stop ! Check that first = first + 1 modified the original array if (token(1)%first /= 2) error stop if (token(2)%first /= 3) error stop if (token(3)%first /= 4) error stop if (token(4)%first /= 5) error stop print *, "PASSED" end program mre lfortran-0.63.0/integration_tests/bindc_iso_fb_02c.c0000664000175000017500000005131415174404631022601 0ustar alastairalastair/* * Consolidated C helpers for bindc_iso_fb_02 * Merged from: bindc_20c.c, bindc_28c.c, bindc_30c.c, bindc_31c.c, bindc_32c.c */ #include #include #include #include /* ======================================================================== * Shared static helper functions (deduplicated) * * sum_i32 appeared identically in bindc_20c.c and bindc_28c.c — kept once. * dbl_i32 from bindc_20c.c, sum_f32/sum_f64/sum_i64 from bindc_28c.c, * sum_chars from bindc_30c.c are each unique. * ======================================================================== */ /* generic recursive sum for int32 (used by bindc_20 and bindc_28 functions) */ static int32_t sum_i32(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) return *(int32_t *)base; int32_t total = 0; for (CFI_index_t i = 0; i < d[k].extent; i++) total += sum_i32(base + i * d[k].sm, d, rank, k + 1); return total; } /* generic recursive double-in-place for int32 (from bindc_20c.c) */ static void dbl_i32(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) { *(int32_t *)base *= 2; return; } for (CFI_index_t i = 0; i < d[k].extent; i++) dbl_i32(base + i * d[k].sm, d, rank, k + 1); } /* generic recursive sum for float (from bindc_28c.c) */ static float sum_f32(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) return *(float *)base; float total = 0; for (CFI_index_t i = 0; i < d[k].extent; i++) total += sum_f32(base + i * d[k].sm, d, rank, k + 1); return total; } /* generic recursive sum for double (from bindc_28c.c) */ static double sum_f64(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) return *(double *)base; double total = 0; for (CFI_index_t i = 0; i < d[k].extent; i++) total += sum_f64(base + i * d[k].sm, d, rank, k + 1); return total; } /* generic recursive sum for int64 (from bindc_28c.c) */ static int64_t sum_i64(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) return *(int64_t *)base; int64_t total = 0; for (CFI_index_t i = 0; i < d[k].extent; i++) total += sum_i64(base + i * d[k].sm, d, rank, k + 1); return total; } /* generic recursive sum of char codes (from bindc_30c.c) */ static int sum_chars(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) return (int)*(unsigned char *)base; int total = 0; for (CFI_index_t i = 0; i < d[k].extent; i++) total += sum_chars(base + i * d[k].sm, d, rank, k + 1); return total; } /* ======================================================================== * Functions from bindc_20c.c * Multi-rank alloc/ptr, scalar alloc/ptr * ======================================================================== */ /* ---- allocatable 2D ---- */ int32_t c20_sum_alloc_2d(CFI_cdesc_t *a) { return sum_i32((char *)a->base_addr, a->dim, (int)a->rank, 0); } int c20_attr_alloc_2d(CFI_cdesc_t *a) { return a->attribute == CFI_attribute_allocatable; } void c20_double_alloc_2d(CFI_cdesc_t *a) { dbl_i32((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- allocatable 3D ---- */ int32_t c20_sum_alloc_3d(CFI_cdesc_t *a) { return sum_i32((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- pointer 2D ---- */ int32_t c20_sum_ptr_2d(CFI_cdesc_t *a) { return sum_i32((char *)a->base_addr, a->dim, (int)a->rank, 0); } int c20_attr_ptr_2d(CFI_cdesc_t *a) { return a->attribute == CFI_attribute_pointer; } /* ---- pointer 3D ---- */ int32_t c20_sum_ptr_3d(CFI_cdesc_t *a) { return sum_i32((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- pointer inout ---- */ void c20_double_ptr_1d(CFI_cdesc_t *a) { dbl_i32((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- allocatable scalar (rank 0) ---- */ int32_t c20_read_alloc_scalar(CFI_cdesc_t *a) { return *(int32_t *)a->base_addr; } int c20_attr_alloc_scalar(CFI_cdesc_t *a) { return a->attribute == CFI_attribute_allocatable; } /* ---- pointer scalar (rank 0) ---- */ int32_t c20_read_ptr_scalar(CFI_cdesc_t *a) { return *(int32_t *)a->base_addr; } int c20_attr_ptr_scalar(CFI_cdesc_t *a) { return a->attribute == CFI_attribute_pointer; } /* ======================================================================== * Functions from bindc_28c.c * Attribute combinations and array features * ======================================================================== */ /* ---- allocatable float ---- */ float c28_sum_alloc_float(CFI_cdesc_t *a) { return sum_f32((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- allocatable double ---- */ double c28_sum_alloc_double(CFI_cdesc_t *a) { return sum_f64((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- allocatable int64 ---- */ int64_t c28_sum_alloc_int64(CFI_cdesc_t *a) { return sum_i64((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- allocatable complex ---- */ void c28_sum_alloc_complex(CFI_cdesc_t *a, float *re, float *im) { *re = 0; *im = 0; char *base = (char *)a->base_addr; for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { float *c = (float *)(base + i * a->dim[0].sm); *re += c[0]; *im += c[1]; } } /* ---- allocatable logical ---- */ int c28_count_alloc_bool(CFI_cdesc_t *a) { int count = 0; char *base = (char *)a->base_addr; for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { if (*(unsigned char *)(base + i * a->dim[0].sm)) count++; } return count; } /* ---- pointer float ---- */ float c28_sum_ptr_float(CFI_cdesc_t *a) { return sum_f32((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- pointer double ---- */ double c28_sum_ptr_double(CFI_cdesc_t *a) { return sum_f64((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- pointer int64 ---- */ int64_t c28_sum_ptr_int64(CFI_cdesc_t *a) { return sum_i64((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- zero-size array ---- */ int c28_zero_size_extent(CFI_cdesc_t *a) { return (int)a->dim[0].extent; } /* ---- unallocated allocatable ---- */ int c28_is_allocated(CFI_cdesc_t *a) { return (a->base_addr != NULL) ? 1 : 0; } /* ---- disassociated pointer ---- */ int c28_is_associated(CFI_cdesc_t *a) { return (a->base_addr != NULL) ? 1 : 0; } /* ---- rank 4 ---- */ int32_t c28_sum_4d(CFI_cdesc_t *a) { return sum_i32((char *)a->base_addr, a->dim, (int)a->rank, 0); } int c28_get_rank_4d(CFI_cdesc_t *a) { return (int)a->rank; } /* ---- explicit shape: receives raw pointer + length ---- */ int32_t c28_sum_explicit(int32_t *a, int n) { int32_t total = 0; for (int i = 0; i < n; i++) total += a[i]; return total; } /* ---- optional + contiguous ---- */ int32_t c28_opt_contig_sum(CFI_cdesc_t *a) { if (a == NULL) return 0; return sum_i32((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- allocatable + assumed-rank ---- */ int c28_alloc_ar_rank(CFI_cdesc_t *a) { return (int)a->rank; } /* ---- pointer + assumed-rank ---- */ int c28_ptr_ar_rank(CFI_cdesc_t *a) { return (int)a->rank; } /* ======================================================================== * Functions from bindc_30c.c * Character alloc/ptr, allocatable+assumed-rank, pointer+assumed-rank * ======================================================================== */ /* ---- character allocatable ---- */ int c30_char_alloc_sum(CFI_cdesc_t *a) { return sum_chars((char *)a->base_addr, a->dim, (int)a->rank, 0); } int c30_char_alloc_attr(CFI_cdesc_t *a) { return a->attribute == CFI_attribute_allocatable; } /* ---- character pointer ---- */ int c30_char_ptr_sum(CFI_cdesc_t *a) { return sum_chars((char *)a->base_addr, a->dim, (int)a->rank, 0); } int c30_char_ptr_attr(CFI_cdesc_t *a) { return a->attribute == CFI_attribute_pointer; } /* ---- allocatable + assumed-rank ---- */ int c30_alloc_ar_rank(CFI_cdesc_t *a) { return (int)a->rank; } /* ---- pointer + assumed-rank ---- */ int c30_ptr_ar_rank(CFI_cdesc_t *a) { return (int)a->rank; } /* ======================================================================== * Functions from bindc_31c.c * C driver: CFI_allocate / CFI_deallocate tests * ======================================================================== */ /* Fortran procedures from bindc_31_mod */ extern int f31_is_allocated(CFI_cdesc_t *a); extern int32_t f31_sum_1d(CFI_cdesc_t *a); extern int f31_size_1d(CFI_cdesc_t *a); extern int f31_lbound_1d(CFI_cdesc_t *a); extern int f31_ubound_1d(CFI_cdesc_t *a); extern int32_t f31_get_elem(CFI_cdesc_t *a, int idx); extern int32_t f31_sum_2d(CFI_cdesc_t *a); extern int f31_2d_shape_ok(CFI_cdesc_t *a, int n1, int n2); extern double f31_sum_double(CFI_cdesc_t *a); extern void f31_alloc_fill(CFI_cdesc_t *a); extern void f31_realloc(CFI_cdesc_t *a); int c31_run_tests(void) { int rc; /* ---- Test 1: Unallocated 1D descriptor ---- */ { CFI_CDESC_T(1) raw; CFI_cdesc_t *desc = (CFI_cdesc_t *)&raw; rc = CFI_establish(desc, NULL, CFI_attribute_allocatable, CFI_type_int32_t, 0, 1, NULL); if (rc != CFI_SUCCESS) return 1; if (f31_is_allocated(desc) != 0) return 2; } /* ---- Test 2: Allocate [1:5], fill 10..50, verify ---- */ { CFI_CDESC_T(1) raw; CFI_cdesc_t *desc = (CFI_cdesc_t *)&raw; CFI_index_t lb[] = {1}, ub[] = {5}; int32_t *d; int i; rc = CFI_establish(desc, NULL, CFI_attribute_allocatable, CFI_type_int32_t, 0, 1, NULL); if (rc != CFI_SUCCESS) return 3; rc = CFI_allocate(desc, lb, ub, 0); if (rc != CFI_SUCCESS) return 4; d = (int32_t *)desc->base_addr; for (i = 0; i < 5; i++) d[i] = (i + 1) * 10; if (f31_is_allocated(desc) != 1) return 5; if (f31_sum_1d(desc) != 150) return 6; if (f31_lbound_1d(desc) != 1) return 7; if (f31_ubound_1d(desc) != 5) return 8; rc = CFI_deallocate(desc); if (rc != CFI_SUCCESS) return 9; } /* ---- Test 3: Non-default bounds [-2:2] ---- */ { CFI_CDESC_T(1) raw; CFI_cdesc_t *desc = (CFI_cdesc_t *)&raw; CFI_index_t lb[] = {-2}, ub[] = {2}; int32_t *d; int i; rc = CFI_establish(desc, NULL, CFI_attribute_allocatable, CFI_type_int32_t, 0, 1, NULL); if (rc != CFI_SUCCESS) return 10; rc = CFI_allocate(desc, lb, ub, 0); if (rc != CFI_SUCCESS) return 11; d = (int32_t *)desc->base_addr; for (i = 0; i < 5; i++) d[i] = i + 1; /* 1,2,3,4,5 */ if (f31_sum_1d(desc) != 15) return 12; if (f31_lbound_1d(desc) != -2) return 13; if (f31_ubound_1d(desc) != 2) return 14; if (f31_size_1d(desc) != 5) return 15; /* a(-2)==1, a(0)==3, a(2)==5 */ if (f31_get_elem(desc, -2) != 1) return 16; if (f31_get_elem(desc, 0) != 3) return 17; if (f31_get_elem(desc, 2) != 5) return 18; rc = CFI_deallocate(desc); if (rc != CFI_SUCCESS) return 19; } /* ---- Test 4: 2D allocatable [1:3, 1:4] ---- */ { CFI_CDESC_T(2) raw; CFI_cdesc_t *desc = (CFI_cdesc_t *)&raw; CFI_index_t lb[] = {1, 1}, ub[] = {3, 4}; int32_t *d; int i; rc = CFI_establish(desc, NULL, CFI_attribute_allocatable, CFI_type_int32_t, 0, 2, NULL); if (rc != CFI_SUCCESS) return 20; rc = CFI_allocate(desc, lb, ub, 0); if (rc != CFI_SUCCESS) return 21; /* Column-major: 3 rows x 4 cols, sum(1..12) = 78 */ d = (int32_t *)desc->base_addr; for (i = 0; i < 12; i++) d[i] = i + 1; if (f31_sum_2d(desc) != 78) return 22; if (f31_2d_shape_ok(desc, 3, 4) != 1) return 23; rc = CFI_deallocate(desc); if (rc != CFI_SUCCESS) return 24; } /* ---- Test 5: Real(c_double) allocatable ---- */ { CFI_CDESC_T(1) raw; CFI_cdesc_t *desc = (CFI_cdesc_t *)&raw; CFI_index_t lb[] = {1}, ub[] = {3}; double *d, s; rc = CFI_establish(desc, NULL, CFI_attribute_allocatable, CFI_type_double, 0, 1, NULL); if (rc != CFI_SUCCESS) return 25; rc = CFI_allocate(desc, lb, ub, 0); if (rc != CFI_SUCCESS) return 26; d = (double *)desc->base_addr; d[0] = 1.5; d[1] = 2.5; d[2] = 3.5; s = f31_sum_double(desc); if (s < 7.4 || s > 7.6) return 27; rc = CFI_deallocate(desc); if (rc != CFI_SUCCESS) return 28; } /* ---- Test 6: Intent(out) - Fortran allocates into C descriptor ---- */ { CFI_CDESC_T(1) raw; CFI_cdesc_t *desc = (CFI_cdesc_t *)&raw; int32_t *d; rc = CFI_establish(desc, NULL, CFI_attribute_allocatable, CFI_type_int32_t, 0, 1, NULL); if (rc != CFI_SUCCESS) return 29; f31_alloc_fill(desc); /* Fortran: allocate(a(3)); a=[10,20,30] */ if (desc->base_addr == NULL) return 30; d = (int32_t *)desc->base_addr; if (d[0] != 10 || d[1] != 20 || d[2] != 30) return 31; if (f31_size_1d(desc) != 3) return 32; rc = CFI_deallocate(desc); if (rc != CFI_SUCCESS) return 33; } /* ---- Test 7: Intent(inout) - Fortran reallocates ---- */ { CFI_CDESC_T(1) raw; CFI_cdesc_t *desc = (CFI_cdesc_t *)&raw; CFI_index_t lb[] = {1}, ub[] = {3}; int32_t *d; rc = CFI_establish(desc, NULL, CFI_attribute_allocatable, CFI_type_int32_t, 0, 1, NULL); if (rc != CFI_SUCCESS) return 34; rc = CFI_allocate(desc, lb, ub, 0); if (rc != CFI_SUCCESS) return 35; d = (int32_t *)desc->base_addr; d[0] = 1; d[1] = 2; d[2] = 3; /* Fortran deallocates [1,2,3], then allocates [100..500] */ f31_realloc(desc); if (f31_size_1d(desc) != 5) return 36; if (f31_sum_1d(desc) != 1500) return 37; rc = CFI_deallocate(desc); if (rc != CFI_SUCCESS) return 38; } /* ---- Test 8: Zero-size allocation [1:0] ---- */ { CFI_CDESC_T(1) raw; CFI_cdesc_t *desc = (CFI_cdesc_t *)&raw; CFI_index_t lb[] = {1}, ub[] = {0}; rc = CFI_establish(desc, NULL, CFI_attribute_allocatable, CFI_type_int32_t, 0, 1, NULL); if (rc != CFI_SUCCESS) return 39; rc = CFI_allocate(desc, lb, ub, 0); if (rc != CFI_SUCCESS) return 40; if (f31_is_allocated(desc) != 1) return 41; if (f31_size_1d(desc) != 0) return 42; rc = CFI_deallocate(desc); if (rc != CFI_SUCCESS) return 43; } return 0; } /* ======================================================================== * Functions from bindc_32c.c * C driver: CFI_setpointer tests * ======================================================================== */ /* Fortran procedures from bindc_32_mod */ extern int f32_is_associated(CFI_cdesc_t *a); extern int32_t f32_sum_1d(CFI_cdesc_t *a); extern int f32_lbound_1d(CFI_cdesc_t *a); extern int f32_ubound_1d(CFI_cdesc_t *a); extern int32_t f32_sum_2d(CFI_cdesc_t *a); extern void f32_double_values(CFI_cdesc_t *a); int c32_run_tests(void) { int rc; /* ---- Test 1: Disassociated pointer ---- */ { CFI_CDESC_T(1) raw; CFI_cdesc_t *ptr = (CFI_cdesc_t *)&raw; rc = CFI_establish(ptr, NULL, CFI_attribute_pointer, CFI_type_int32_t, 0, 1, NULL); if (rc != CFI_SUCCESS) return 1; if (f32_is_associated(ptr) != 0) return 2; } /* ---- Test 2: Associate pointer with data ---- */ { int32_t data[5] = {10, 20, 30, 40, 50}; CFI_CDESC_T(1) src_raw, ptr_raw; CFI_cdesc_t *src = (CFI_cdesc_t *)&src_raw; CFI_cdesc_t *ptr = (CFI_cdesc_t *)&ptr_raw; CFI_index_t ext[] = {5}; rc = CFI_establish(src, data, CFI_attribute_other, CFI_type_int32_t, 0, 1, ext); if (rc != CFI_SUCCESS) return 3; rc = CFI_establish(ptr, NULL, CFI_attribute_pointer, CFI_type_int32_t, 0, 1, NULL); if (rc != CFI_SUCCESS) return 4; rc = CFI_setpointer(ptr, src, NULL); if (rc != CFI_SUCCESS) return 5; if (f32_is_associated(ptr) != 1) return 6; if (f32_sum_1d(ptr) != 150) return 7; } /* ---- Test 3: Disassociate via CFI_setpointer(ptr, NULL, NULL) ---- */ { int32_t data[3] = {1, 2, 3}; CFI_CDESC_T(1) src_raw, ptr_raw; CFI_cdesc_t *src = (CFI_cdesc_t *)&src_raw; CFI_cdesc_t *ptr = (CFI_cdesc_t *)&ptr_raw; CFI_index_t ext[] = {3}; rc = CFI_establish(src, data, CFI_attribute_other, CFI_type_int32_t, 0, 1, ext); if (rc != CFI_SUCCESS) return 8; rc = CFI_establish(ptr, NULL, CFI_attribute_pointer, CFI_type_int32_t, 0, 1, NULL); if (rc != CFI_SUCCESS) return 9; rc = CFI_setpointer(ptr, src, NULL); if (rc != CFI_SUCCESS) return 10; if (f32_is_associated(ptr) != 1) return 11; rc = CFI_setpointer(ptr, NULL, NULL); if (rc != CFI_SUCCESS) return 12; if (f32_is_associated(ptr) != 0) return 13; } /* ---- Test 4: Custom lower bounds [-1:2] ---- */ { int32_t data[4] = {100, 200, 300, 400}; CFI_CDESC_T(1) src_raw, ptr_raw; CFI_cdesc_t *src = (CFI_cdesc_t *)&src_raw; CFI_cdesc_t *ptr = (CFI_cdesc_t *)&ptr_raw; CFI_index_t ext[] = {4}; CFI_index_t lbounds[] = {-1}; rc = CFI_establish(src, data, CFI_attribute_other, CFI_type_int32_t, 0, 1, ext); if (rc != CFI_SUCCESS) return 14; rc = CFI_establish(ptr, NULL, CFI_attribute_pointer, CFI_type_int32_t, 0, 1, NULL); if (rc != CFI_SUCCESS) return 15; rc = CFI_setpointer(ptr, src, lbounds); if (rc != CFI_SUCCESS) return 16; if (f32_lbound_1d(ptr) != -1) return 17; if (f32_ubound_1d(ptr) != 2) return 18; if (f32_sum_1d(ptr) != 1000) return 19; } /* ---- Test 5: Re-point to different target ---- */ { int32_t d1[3] = {1, 2, 3}; int32_t d2[3] = {10, 20, 30}; CFI_CDESC_T(1) s1_raw, s2_raw, ptr_raw; CFI_cdesc_t *s1 = (CFI_cdesc_t *)&s1_raw; CFI_cdesc_t *s2 = (CFI_cdesc_t *)&s2_raw; CFI_cdesc_t *ptr = (CFI_cdesc_t *)&ptr_raw; CFI_index_t ext[] = {3}; rc = CFI_establish(s1, d1, CFI_attribute_other, CFI_type_int32_t, 0, 1, ext); if (rc != CFI_SUCCESS) return 20; rc = CFI_establish(s2, d2, CFI_attribute_other, CFI_type_int32_t, 0, 1, ext); if (rc != CFI_SUCCESS) return 21; rc = CFI_establish(ptr, NULL, CFI_attribute_pointer, CFI_type_int32_t, 0, 1, NULL); if (rc != CFI_SUCCESS) return 22; rc = CFI_setpointer(ptr, s1, NULL); if (rc != CFI_SUCCESS) return 23; if (f32_sum_1d(ptr) != 6) return 24; rc = CFI_setpointer(ptr, s2, NULL); if (rc != CFI_SUCCESS) return 25; if (f32_sum_1d(ptr) != 60) return 26; } /* ---- Test 6: 2D pointer [2x3] ---- */ { int32_t data[6] = {1, 2, 3, 4, 5, 6}; CFI_CDESC_T(2) src_raw, ptr_raw; CFI_cdesc_t *src = (CFI_cdesc_t *)&src_raw; CFI_cdesc_t *ptr = (CFI_cdesc_t *)&ptr_raw; CFI_index_t ext[] = {2, 3}; rc = CFI_establish(src, data, CFI_attribute_other, CFI_type_int32_t, 0, 2, ext); if (rc != CFI_SUCCESS) return 27; rc = CFI_establish(ptr, NULL, CFI_attribute_pointer, CFI_type_int32_t, 0, 2, NULL); if (rc != CFI_SUCCESS) return 28; rc = CFI_setpointer(ptr, src, NULL); if (rc != CFI_SUCCESS) return 29; if (f32_sum_2d(ptr) != 21) return 30; } /* ---- Test 7: Modify target through pointer ---- */ { int32_t data[4] = {1, 2, 3, 4}; CFI_CDESC_T(1) src_raw, ptr_raw; CFI_cdesc_t *src = (CFI_cdesc_t *)&src_raw; CFI_cdesc_t *ptr = (CFI_cdesc_t *)&ptr_raw; CFI_index_t ext[] = {4}; rc = CFI_establish(src, data, CFI_attribute_other, CFI_type_int32_t, 0, 1, ext); if (rc != CFI_SUCCESS) return 31; rc = CFI_establish(ptr, NULL, CFI_attribute_pointer, CFI_type_int32_t, 0, 1, NULL); if (rc != CFI_SUCCESS) return 32; rc = CFI_setpointer(ptr, src, NULL); if (rc != CFI_SUCCESS) return 33; f32_double_values(ptr); /* Fortran: a = a * 2 */ /* Original data should be doubled */ if (data[0] != 2 || data[1] != 4 || data[2] != 6 || data[3] != 8) return 34; } return 0; } lfortran-0.63.0/integration_tests/modules_50.f900000664000175000017500000000170715174404631021666 0ustar alastairalastairmodule modules_50_fpm_integer type int_t integer :: i end type int_t end module module modules_50_fpm_targets use modules_50_fpm_integer, only: int_t implicit none contains subroutine prune_build_targets() type(int_t), allocatable :: modules_used(:) allocate(modules_used(1)) modules_used(1)%i = 0 print *, modules_used print *, modules_used(1)%i if( modules_used(1)%i /= 0 ) error stop call collect_used_modules() print *, modules_used print *, modules_used(1)%i if( modules_used(1)%i /= 2 ) error stop contains recursive subroutine collect_used_modules() modules_used(1)%i = 2 modules_used = [modules_used] ! modules_used = [modules_used, modules_used(1)] end subroutine collect_used_modules end subroutine prune_build_targets end module modules_50_fpm_targets program modules_50 use modules_50_fpm_targets implicit none call prune_build_targets() end program modules_50 lfortran-0.63.0/integration_tests/union_test_01.f900000664000175000017500000000173015174404631022375 0ustar alastairalastairmodule lp_union_test_01_mod implicit none _lfortran_union_type :: test_type4 integer :: x real :: i end _lfortran_union_type end module program lp_union_test_01 use lp_union_test_01_mod implicit none type:: test_type integer :: x real :: y end type _lfortran_union_type :: test_type1 ! this is a test comment integer :: x real :: i type(test_type) :: y end _lfortran_union_type _lfortran_union_type :: test_type2 integer :: x real :: i type(test_type1) :: y end _lfortran_union_type type :: test_type3 integer :: x real :: i type(test_type) :: y type(test_type1) :: z type(test_type2) :: w end type type(test_type) :: t_ty type(test_type1) :: t_ty1 type(test_type2) :: t_ty2 type(test_type3) :: t_ty3 type(test_type4) :: t_ty4 end program lfortran-0.63.0/integration_tests/pass_array_by_data_05.f900000664000175000017500000000141515174404631024041 0ustar alastairalastairmodule pass_array_by_data_05_find_fit_module implicit none contains subroutine find_fit(data_x, expr) real, intent(in) :: data_x(:) real :: y interface function expr(x) result(z) real, intent(in) :: x(:) real :: z end function expr end interface print *, size(data_x) y = expr(data_x) print *, y if (abs(y - 6.000) > 1e7 ) error stop end subroutine find_fit end module program example_primes use pass_array_by_data_05_find_fit_module, only: find_fit implicit none real :: data_x(3) integer :: i data_x = [1.0, 2.0, 3.0] call find_fit(data_x, expression) contains function expression(x) result(y) real, intent(in) :: x(:) real :: y integer :: i y = 0.0 do i = 1, size(x) y = y + x(i) end do end function expression end program example_primes lfortran-0.63.0/integration_tests/do_concurrent_04.f900000664000175000017500000000100615174404631023051 0ustar alastairalastair! equivalent to openmp_07.f90 subroutine static_counter(n, ctr) use omp_lib implicit none integer, intent(in) :: n integer, intent(inout) :: ctr integer :: local_ctr integer :: i local_ctr = 1 do concurrent (i=1:n) reduce(*:local_ctr) local_ctr = local_ctr * 1 end do ctr = ctr + local_ctr end subroutine program do_concurrent_04 use omp_lib integer, parameter :: n = 1000000 integer :: ctr call omp_set_num_threads(8) ctr = 0 call static_counter(n, ctr) print *, ctr if (ctr /= 1) error stop end program lfortran-0.63.0/integration_tests/class_68.f900000664000175000017500000000164115174404631021331 0ustar alastairalastairmodule class_68_mod implicit none type, abstract :: toml_lexer contains procedure(func_interface), deferred :: f ! deferred binding end type toml_lexer abstract interface subroutine func_interface(self) import :: toml_lexer class(toml_lexer), intent(inout) :: self end subroutine func_interface end interface end module module class_68_mod2 use class_68_mod type, extends(toml_lexer) :: mocked_lexer integer :: key contains procedure :: f => f_mock end type contains subroutine f_mock(self) class(mocked_lexer), intent(inout) :: self print *, "Mock function called" self%key = 100 end subroutine f_mock subroutine temp(lex) class(toml_lexer), intent(inout) :: lex call lex%f() end subroutine end module program class_68 use class_68_mod2 type(mocked_lexer) :: x call temp(x) if (x%key /= 100) error stop end program lfortran-0.63.0/integration_tests/intrinsics_192.f900000664000175000017500000001210415174404631022463 0ustar alastairalastairprogram intrinsics_192 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(8) :: x(40) real(8) :: expected(40) real :: y(30) real :: expected_y(30) integer :: i real(dp), parameter :: res(40) = bessel_j0([3.3398640543782485_dp, 5.039184326269492_dp, 6.738504598160736_dp, & 8.43782487005198_dp, 10.137145141943222_dp, 11.836465413834466_dp, 13.53578568572571_dp, 15.235105957616954_dp, & 16.934426229508198_dp, 18.63374650139944_dp, 1.999201299880048d+306, 1.199520279928029d+307, & 2.1991204298680527d+307, 3.198720579808077d+307, 4.198320729748101d+307, 5.197920879688125d+307, & 6.197521029628149d+307, 7.197121179568173d+307, 8.196721329508197d+307, 9.196321479448221d+307, & -0.8439824070371851_dp, -1.0638944422231107_dp, -1.2838064774090363_dp, -1.503718512594962_dp, & -1.7236305477808875_dp, -1.9435425829668134_dp, -2.163454618152739_dp, -2.3833666533386646_dp, & -2.60327868852459_dp, -2.823190723710516_dp, .8439824070371851_dp, 1.0638944422231107_dp, & 1.2838064774090363_dp, 1.503718512594962_dp, 1.7236305477808875_dp, 1.9435425829668134_dp, & 2.163454618152739_dp, 2.3833666533386646_dp, 2.60327868852459_dp, 2.823190723710516_dp]) x = [3.3398640543782485_dp, 5.039184326269492_dp, 6.738504598160736_dp, 8.43782487005198_dp, & 10.137145141943222_dp, 11.836465413834466_dp, 13.53578568572571_dp, 15.235105957616954_dp, & 16.934426229508198_dp, 18.63374650139944_dp, 1.999201299880048d+306, 1.199520279928029d+307, & 2.1991204298680527d+307, 3.198720579808077d+307, 4.198320729748101d+307, 5.197920879688125d+307, & 6.197521029628149d+307, 7.197121179568173d+307, 8.196721329508197d+307, 9.196321479448221d+307, & -0.8439824070371851_dp, -1.0638944422231107_dp, -1.2838064774090363_dp, -1.503718512594962_dp, & -1.7236305477808875_dp, -1.9435425829668134_dp, -2.163454618152739_dp, -2.3833666533386646_dp, & -2.60327868852459_dp, -2.823190723710516_dp, .8439824070371851_dp, 1.0638944422231107_dp, & 1.2838064774090363_dp, 1.503718512594962_dp, 1.7236305477808875_dp, 1.9435425829668134_dp, & 2.163454618152739_dp, 2.3833666533386646_dp, 2.60327868852459_dp, 2.823190723710516_dp] expected = [-0.35276533724012665_dp, -0.16467814025284372_dp, 0.2885135446265932_dp, 0.05889084216205015_dp, & -0.2495399733324126_dp, 0.0104212906373451_dp, 0.21349211445035887_dp, -0.06124277731984677_dp, & -0.17590100995447924_dp, 0.09861767893471807_dp, 5.6416523635296804d-154, -2.2862889422883802d-154, & 6.631140845542755d-155, -5.568530188979783d-155, -1.4147891343158852d-155, 6.574020907172679d-155, & 1.010764003164187d-154, 9.351175657542549d-155, 3.874969850157508d-155, -4.371594366447781d-155, & 0.8296961122853597_dp, 0.7364314862573926_dp, 0.6285104628739052_dp, 0.509752014245272_dp, & 0.3843166288058289_dp, 0.25654187983098076_dp, 0.1307721336491019_dp, 0.011189479462964488_dp, & -0.09834712549229654_dp, -0.19444788933021404_dp, 0.8296961122853597_dp, 0.7364314862573926_dp, & 0.6285104628739052_dp, 0.509752014245272_dp, 0.3843166288058289_dp, 0.25654187983098076_dp, & 0.1307721336491019_dp, 0.011189479462964488_dp, -0.09834712549229654_dp, -0.19444788933021404_dp] do i = 1, size(x) print *, bessel_j0(x(i)), "i = ", i if (abs(bessel_j0(x(i)) - expected(i)) > 1e-12) error stop end do do i = 1, size(res) print *, res(i) if (abs(res(i) - expected(i)) > 1e-12_dp) error stop end do y = [3.3398640543782485_sp, 5.039184326269492_sp, 6.738504598160736_sp, 8.43782487005198_sp, & 10.137145141943222_sp, 11.836465413834466_sp, 13.53578568572571_sp, 15.235105957616954_sp, & 16.934426229508198_sp, 18.63374650139944_sp, & -0.8439824070371851_sp, -1.0638944422231107_sp, -1.2838064774090363_sp, -1.503718512594962_sp, & -1.7236305477808875_sp, -1.9435425829668134_sp, -2.163454618152739_sp, -2.3833666533386646_sp, & -2.60327868852459_sp, -2.823190723710516_sp, .8439824070371851_sp, 1.0638944422231107_sp, & 1.2838064774090363_sp, 1.503718512594962_sp, 1.7236305477808875_sp, 1.9435425829668134_sp, & 2.163454618152739_sp, 2.3833666533386646_sp, 2.60327868852459_sp, 2.823190723710516_sp] expected_y = [-0.35276533724012665_sp, -0.16467814025284372_sp, 0.2885135446265932_sp, 0.05889084216205015_sp, & -0.2495399733324126_sp, 0.0104212906373451_sp, 0.21349211445035887_sp, -0.06124277731984677_sp, & -0.17590100995447924_sp, 0.09861767893471807_sp, & 0.8296961122853597_sp, 0.7364314862573926_sp, 0.6285104628739052_sp, 0.509752014245272_sp, & 0.3843166288058289_sp, 0.25654187983098076_sp, 0.1307721336491019_sp, 0.011189479462964488_sp, & -0.09834712549229654_sp, -0.19444788933021404_sp, 0.8296961122853597_sp, 0.7364314862573926_sp, & 0.6285104628739052_sp, 0.509752014245272_sp, 0.3843166288058289_sp, 0.25654187983098076_sp, & 0.1307721336491019_sp, 0.011189479462964488_sp, -0.09834712549229654_sp, -0.19444788933021404_sp] do i = 1, size(y) print *, bessel_j0(y(i)), "i = ", i if (abs(bessel_j0(y(i)) - expected_y(i)) > 1e-6) error stop end do end program lfortran-0.63.0/integration_tests/nested_vars2.f900000664000175000017500000000065115174404631022306 0ustar alastairalastairmodule nested_vars2 implicit none contains subroutine h(x) integer, intent(inout) :: x x = x + 1 return call g() contains subroutine g() x = x + 1 end subroutine end subroutine end module program nested_vars2_main use nested_vars2, only: h implicit none integer :: x x = 5 call h(x) print *, x if (x /= 6) error stop end program lfortran-0.63.0/integration_tests/file_20.f900000664000175000017500000000066315174404631021132 0ustar alastairalastairprogram expr2 implicit none integer :: ios character(len=50) :: data character(len=50) :: temp temp = "apple" open(1, form="unformatted", file="file_20_tmp.dat") write(1, iostat=ios) temp close(1) print *, ios if (ios /= 0) error stop open(2, form="unformatted", file="file_20_tmp.dat") read(2) data close(2) print *, data if (trim(data) /= "apple") error stop end program lfortran-0.63.0/integration_tests/array_02.f900000664000175000017500000000017015174404631021322 0ustar alastairalastairprogram array_02 implicit none real, dimension(3) :: a, b a = [1, 2, 3] b = (/ 1, 2, 3 /) print *, a, b end program lfortran-0.63.0/integration_tests/file_10_data.txt0000664000175000017500000000014115174404631022332 0ustar alastairalastairhello hi bye. 1234\nhi hello \n abcd!? \n ajdfsalfj;as\n \r jdalfk\14 dsfjlkf\r\tjkdlfas\n\r\t\n lfortran-0.63.0/integration_tests/procedure_pointer_abstract_01.f900000664000175000017500000000173515174404631025626 0ustar alastairalastairmodule hashmaps_pp implicit none type :: key_type integer(1), allocatable :: value(:) end type key_type abstract interface pure function hasher_fun_temp(key) result(hash_value) import key_type type(key_type), intent(in) :: key integer(4) :: hash_value end function hasher_fun_temp end interface type, abstract :: hashmap_type procedure(hasher_fun_temp), pointer, nopass :: hasher end type hashmap_type end module hashmaps_pp module hashmap_open_pp use hashmaps_pp implicit none contains subroutine in_open_map(map, key) class(hashmap_type), intent(inout) :: map type(key_type), intent(in) :: key integer(4) :: hash_val hash_val = map%hasher(key) end subroutine in_open_map end module hashmap_open_pp program procedure_pointer_abstract_01 implicit none print *, "Compilation test passed" end program procedure_pointer_abstract_01 lfortran-0.63.0/integration_tests/gpu_metal_62.f900000664000175000017500000000125215174404631022171 0ustar alastairalastairmodule gpu_metal_62_m implicit none type :: network_t(k) integer, kind :: k = 4 real(k) :: w contains generic :: infer => compute procedure, private :: compute end type contains elemental real function compute(self, x) class(network_t), intent(in) :: self real, intent(in) :: x compute = self%w * x end function end module program gpu_metal_62 use gpu_metal_62_m implicit none type(network_t) :: net real :: x(10), y(10) integer :: i net%w = 2.0 x = 1.0 do concurrent(i=1:10) y(i) = net%infer(x(i)) end do if (abs(y(1) - 2.0) > 1e-6) error stop if (abs(y(10) - 2.0) > 1e-6) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/read_43.f900000664000175000017500000000072615174404631021133 0ustar alastairalastairprogram read_43 implicit none character(len=:), allocatable :: raw_line real(8), allocatable :: vals(:) raw_line = '1.D0, 2.D0, 4.D0' allocate(vals(3)) vals = -1D0 read(raw_line, *) vals if (abs(vals(1) - 1D0) > 1D-12) error stop 'vals(1) mismatch' if (abs(vals(2) - 2D0) > 1D-12) error stop 'vals(2) mismatch' if (abs(vals(3) - 4D0) > 1D-12) error stop 'vals(3) mismatch' print *, 'All tests passed.' end program read_43 lfortran-0.63.0/integration_tests/modules_41.f900000664000175000017500000000212115174404631021655 0ustar alastairalastairmodule modules_41_fpm_targets implicit none type :: fpm_model_t character(len=40) :: package_name end type fpm_model_t contains subroutine build_target_list(model) type(fpm_model_t), intent(inout), pointer :: model integer :: result if( model%package_name /= "fpm_targets" ) error stop associate (x=>model) result = get_object_name() if( result /= 0 ) error stop print *, result end associate print *, model%package_name if( model%package_name /= "fpm_targets_new" ) error stop contains function get_object_name() result(int) integer :: int int = 0 model%package_name = "fpm_targets_new" end function get_object_name end subroutine build_target_list end module modules_41_fpm_targets program modules_41 use modules_41_fpm_targets implicit none type(fpm_model_t), target :: fpm_model type(fpm_model_t), pointer :: fpm_model_ptr fpm_model%package_name = "fpm_targets" print *, fpm_model%package_name fpm_model_ptr => fpm_model call build_target_list(fpm_model_ptr) end program lfortran-0.63.0/integration_tests/bits_05.f900000664000175000017500000000356315174404631021161 0ustar alastairalastairprogram bits_05 implicit none integer(4) :: from, res integer(8) :: from8, res8 integer :: i, pos, len integer(8) :: i8, pos8, len8 integer, parameter :: i1 = ibits(10, 2, 2) integer(8), parameter :: i2 = ibits(10_8, 2, 2) integer, parameter :: i3 = ibits(10, 5_8, 2) integer(8), parameter :: i4 = ibits(10_8, 5_8, 2) integer, parameter :: ar1(3) = ibits([10, 20, 30], 2, 2) integer(8), parameter :: ar2(3) = ibits([10_8, 20_8, 30_8], 2, 2) integer :: arr1(3) = [102134, 20, 30] integer(8) :: arr2(3) = [1042890_8, 20_8, 30_8] i = 102394 pos = 2 len = 2 print *, ibits(i, pos, len) if (ibits(i, pos, len) /= 2) error stop i8 = 102394_8 pos8 = 12_8 len8 = 7_8 print *, ibits(i8, pos8, len8) if (ibits(i8, pos8, len8) /= 24) error stop print *, ibits(i, pos8, len) if (ibits(i, pos8, len) /= 0) error stop from = 10 from8 = 10_8 res = ibits(from, 2, 2) if (res /= 2) error stop res8 = ibits(from8, 2, 2) if (res8 /= 2_8) error stop res = ibits(from, 0, 2) if (res /= 2) error stop res8 = ibits(from8, 0, 2) if (res8 /= 2_8) error stop from = -20 from8 = -20_8 res = ibits(from, 29, 2) if (res /= 3) error stop res8 = ibits(from8, 29, 2) if (res8 /= 3) error stop res = ibits(from, 2, 2) if (res /= 3) error stop res8 = ibits(from8, 2, 2) if (res8 /= 3) error stop print *, ibits(arr1, 2, 2) if (any(ibits(arr1, 2, 2) /= [1, 1, 3])) error stop print *, ibits(arr2, 2, 2) if (any(ibits(arr2, 2, 2) /= [2, 1, 3])) error stop print *, kind(ibits(10, 2, 2)) if (kind(ibits(10, 2, 2)) /= 4) error stop print *, kind(ibits(10_8, 2, 2)) if (kind(ibits(10_8, 2, 2)) /= 8) error stop print *, kind(ibits(10, 2_8, 2_8)) if (kind(ibits(10, 2_8, 2_8)) /= 4) error stop end programlfortran-0.63.0/integration_tests/separate_compilation_43b.f900000664000175000017500000000062015174404631024555 0ustar alastairalastairmodule separate_compilation_43b_module use separate_compilation_43a_module implicit none type :: MyType class(AbsType), allocatable :: obj contains procedure :: method end type MyType contains subroutine method(self) class(MyType), intent(in) :: self call self%obj%ptr() end subroutine method end module separate_compilation_43b_module lfortran-0.63.0/integration_tests/select_type_36.f900000664000175000017500000000144615174404631022542 0ustar alastairalastairmodule select_type_36_mod implicit none type :: t integer, allocatable :: val(:) contains procedure :: get_ptr end type contains function get_ptr(this) result(p) class(t), target, intent(in) :: this integer, pointer :: p(:) p => this%val end function subroutine use_array(a, expected_sum) integer, intent(in) :: a(:) integer, intent(in) :: expected_sum if (sum(a) /= expected_sum) error stop end subroutine subroutine trigger(x) class(t), intent(in) :: x select type (x) type is (t) call use_array(x%get_ptr(), 10) end select end subroutine end module program select_type_36 use select_type_36_mod implicit none type(t) :: obj allocate(obj%val(4)) obj%val = [1, 2, 3, 4] call trigger(obj) print *, "ok" end program lfortran-0.63.0/integration_tests/file_23_data.txt0000664000175000017500000000002415174404631022336 0ustar alastairalastairHelloWorld! LFortranlfortran-0.63.0/integration_tests/string_61.f900000664000175000017500000000104315174404631021517 0ustar alastairalastair! Test Optional array of strings program string_61 character(10):: ss character(10) :: arr(2) ss = ff() print *, ss if(ss /= "Hello") error stop arr(1) = "world" ss = ff(arr) print *, ss if(ss /= "world") error stop contains function ff(string) result(ret) character(10), optional, dimension(:) :: string character(10) :: ret if(.not.present(string)) then ret = "Hello" else ret = string(1) end if end function end programlfortran-0.63.0/integration_tests/allocate_64.f900000664000175000017500000000033715174404631022005 0ustar alastairalastairprogram allocate_64 integer, allocatable :: a(:) allocate(a(10)) a = 1 if (any(a /= 1)) error stop if (size(a) /= 10) error stop deallocate(a) if (allocated(a)) error stop end program allocate_64lfortran-0.63.0/integration_tests/class_98.f900000664000175000017500000000072115174404631021332 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/7952 ! move_alloc with unallocated source must deallocate destination ! Exact MRE from issue body program badalloc implicit none type,abstract :: foo end type foo type, extends(foo) :: bar end type bar type(bar), allocatable :: x class(foo), allocatable :: y call move_alloc(x, y) if(allocated(y)) error stop 'Y SHOULD BE UNALLOCATED!' print "(A)", 'Y IS UNALLOCATED.' end program badalloc lfortran-0.63.0/integration_tests/derived_types_24.f900000664000175000017500000000170515174404631023063 0ustar alastairalastairmodule derived_types_24_module_01 implicit none type t_1 integer :: i contains procedure :: sub_01, sub_03 end type t_1 type t_2 type(t_1) :: yt contains procedure :: sub_02 end type t_2 contains subroutine sub_01(this) class(t_1), intent(in) :: this print *, this%i if(this%i /= 123) error stop end subroutine sub_01 subroutine sub_02(this) class(t_2), intent(in) :: this type(t_2) :: t call this%yt%sub_01() t%yt%i = 42 call t%yt%sub_03() end subroutine sub_02 subroutine sub_03(this) class(t_1), intent(in) :: this print *, this%i if(this%i /= 42) error stop end subroutine sub_03 end module derived_types_24_module_01 program derived_types_24 use derived_types_24_module_01 implicit none type(t_2) :: xt xt%yt%i = 123 call xt%sub_02() end program derived_types_24 lfortran-0.63.0/integration_tests/elemental_13.f900000664000175000017500000001206215174404631022157 0ustar alastairalastairprogram elemental_13 implicit none real, dimension(2, 2, 3) :: array_param, expected_ans real :: scalar_param, epsilon = 1.0e-6 real, dimension(2, 2, 3) :: result_2param real, dimension(2, 2, 3) :: result_3param array_param = reshape([ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], shape(array_param)) scalar_param = 1.0 print *, "Testing 2-parameter elemental function:" result_2param = func2(array_param, array_param) expected_ans = reshape([2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 22.0, 24.0], shape(array_param)) if ( size(result_2param) /= size(expected_ans) .or. .not. all(result_2param == expected_ans) ) then error stop "Array, Array does not match to expected array" end if result_2param = func2(array_param, scalar_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0], shape(array_param)) if ( size(result_2param) /= size(expected_ans) .or. .not. all(result_2param == expected_ans) ) then error stop "Array, Scalar does not match to expected array" end if result_2param = func2(scalar_param, array_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0], shape(array_param)) if ( size(result_2param) /= size(expected_ans) .or. .not. all(result_2param == expected_ans) ) then error stop "Scalar, Array does not match to expected array" end if result_2param = func2(scalar_param, scalar_param) expected_ans = reshape([2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], shape(array_param)) if (abs(result_2param(1, 1, 1) - expected_ans(1, 1, 1)) > epsilon) then error stop "Scalar, Scalar does not match 2.0" end if print *, "\nTesting 3-parameter elemental function:" result_3param = func3(array_param, array_param, array_param) expected_ans = reshape([2.0, 6.0, 12.0, 20.0, 30.0, 42.0, 56.0, 72.0, 90.0, 110.0, 132.0, 156.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Array, Array does not match to expected array" end if result_3param = func3(array_param, array_param, scalar_param) expected_ans = reshape([2.0, 5.0, 10.0, 17.0, 26.0, 37.0, 50.0, 65.0, 82.0, 101.0, 122.0, 145.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Array, Scalar does not match to expected array" end if result_3param = func3(array_param, scalar_param, array_param) expected_ans = reshape([2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 22.0, 24.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Scalar, Array does not match to expected array" end if result_3param = func3(array_param, scalar_param, scalar_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Scalar, Scalar does not match to expected array" end if result_3param = func3(scalar_param, array_param, array_param) expected_ans = reshape([2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 22.0, 24.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Scalar, Array, Array does not match to expected array" end if result_3param = func3(scalar_param, array_param, scalar_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Scalar, Array, Scalar does not match to expected array" end if result_3param = func3(scalar_param, scalar_param, array_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Scalar, Scalar, Array does not match to expected array" end if result_3param = func3(scalar_param, scalar_param, scalar_param) expected_ans = reshape([2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], shape(array_param)) if (abs(result_3param(1, 1, 1) - expected_ans(1, 1, 1)) > epsilon) then error stop "Scalar, Scalar, Scalar does not match 2.0" end if print *, "All tests passed successfully" contains elemental function func2(x, y) result(res) real, intent(in) :: x, y real :: res res = x + y end function func2 elemental function func3(x, y, z) result(res) real, intent(in) :: x, y, z real :: res res = x * y + z end function func3 end program elemental_13 lfortran-0.63.0/integration_tests/format_43.f900000664000175000017500000000027215174404631021504 0ustar alastairalastairprogram format_43 implicit none write(*, '('' Matrix types:'')') write(*, '(''Hello World'')') write(*, '('' Leading space'')') write(*, 100) 100 format(' This is a test') end program lfortran-0.63.0/integration_tests/derived_types_31.f900000664000175000017500000000476515174404631023072 0ustar alastairalastairmodule testdrive_derived_types_31 use, intrinsic :: iso_fortran_env, only : error_unit implicit none private public :: new_testsuite public :: unittest_type, testsuite_type, error_type public :: test_interface, collect_interface integer, parameter :: success = 0 type :: error_type integer :: stat = success character(len=:), allocatable :: message contains final :: escalate_error end type error_type abstract interface subroutine test_interface(error) import :: error_type type(error_type), allocatable, intent(out) :: error end subroutine test_interface end interface type :: unittest_type character(len=:), allocatable :: name procedure(test_interface), pointer, nopass :: test => null() logical :: should_fail = .false. end type unittest_type abstract interface subroutine collect_interface(testsuite) import :: unittest_type type(unittest_type), allocatable, intent(out) :: testsuite(:) end subroutine collect_interface end interface type :: testsuite_type character(len=:), allocatable :: name procedure(collect_interface), pointer, nopass :: collect => null() end type testsuite_type contains function new_testsuite(name, collect) result(self) character(len=*), intent(in) :: name procedure(collect_interface) :: collect type(testsuite_type) :: self self%name = name self%collect => collect end function new_testsuite subroutine escalate_error(error) type(error_type), intent(inout) :: error if (error%stat /= success) then write(error_unit, '(a)') "[Fatal] Uncaught error" if (allocated(error%message)) then write(error_unit, '(a, 1x, i0, *(1x, a))') & "Code:", error%stat, "Message:", error%message end if error stop end if end subroutine escalate_error end module testdrive_derived_types_31 program main use testdrive_derived_types_31 implicit none type(testsuite_type) :: suite type(unittest_type), allocatable :: array_suite(:) suite = new_testsuite("name", collect_impl) call suite%collect(array_suite) print *, size(array_suite) if( size(array_suite) /= 10 ) error stop contains subroutine collect_impl(testsuite) type(unittest_type), allocatable, intent(out) :: testsuite(:) allocate(testsuite(10)) end subroutine collect_impl end program lfortran-0.63.0/integration_tests/floor_03.f900000664000175000017500000000064415174404631021334 0ustar alastairalastairprogram floor_03 implicit none real :: x1, x2, x3 real :: y1, y2, y3 x1 = 3.3 ! 3 x2 = 3.5 ! 3 x3 = 3.7 ! 3 y1 = -3.3 ! -4 y2 = -3.5 ! -4 y3 = -3.7 ! -4 if(floor(x1) /= 3 .or. floor(x2) /= 3 .or. floor(x3) /= 3) error stop if(floor(y1) /= -4 .or. floor(y2) /= -4 .or. floor(y3) /= -4) error stop print*, floor(x1), floor(x2), floor(x3) print*, floor(y1), floor(y2), floor(y3) end program lfortran-0.63.0/integration_tests/loop_var_use_after_loop.f900000664000175000017500000000203315174404631024612 0ustar alastairalastairprogram main implicit none integer :: i ! Loop 1 do i = 1, 2 print *,'In loop 1 i =', i if (i < 2) exit end do print *,'After loop 1 i = ', i if (i /= 1) error stop ! Loop 2 print * do i = 1, 3 print *,'In loop 2 i = ', i if (i < 2) then print *, "if (i < 2) then" else exit end if end do print *,'After loop 2 i = ', i if (i /= 2) error stop ! Loop 3 print * do i = 1, 6 print *,'In loop 3 i = ', i if (i <= 4) then if (i - 1 == 3) then if (i - 1 == 2) exit exit end if end if end do print *,'After loop 3 i = ', i if (i /= 4) error stop ! Loop 4 print * do i = 1, 6 print *,'In loop 4 i = ', i if (i <= 4) then if (i - 1 == 3) then if (i - 1 == 2) exit exit else print *, "i - 1 /= 3" end if end if end do print *,'After loop 4 i = ', i if (i /= 4) error stop end program lfortran-0.63.0/integration_tests/optional_10.f900000664000175000017500000000106215174404631022031 0ustar alastairalastairmodule optional_10_mod implicit none type :: t contains procedure :: s end type type :: u type(t), allocatable :: c end type contains subroutine s(self, x) class(t), intent(in) :: self integer, intent(in), optional :: x if (present(x)) then if (x /= 42) error stop end if end subroutine end module program optional_10 use optional_10_mod implicit none type(u) :: obj allocate(obj%c) call obj%c%s() call obj%c%s(42) print *, "ok" end program lfortran-0.63.0/integration_tests/character_25.f900000664000175000017500000000060415174404631022147 0ustar alastairalastairprogram character_25 implicit none character(len=1), dimension(5) :: array character(len=:), allocatable :: str str = "12345" array(:) = str if (array(1) /= '1') error stop if (array(2) /= '1') error stop if (array(3) /= '1') error stop if (array(4) /= '1') error stop if (array(5) /= '1') error stop print *, array end program character_25 lfortran-0.63.0/integration_tests/gpu_metal_68.f900000664000175000017500000000134115174404631022176 0ustar alastairalastairmodule gpu_metal_68_m implicit none type tensor_t real :: v contains procedure :: values => get_values end type contains pure function get_values(self) result(v) class(tensor_t), intent(in) :: self real :: v v = self%v end function end module program main use gpu_metal_68_m, only : tensor_t implicit none type(tensor_t) :: inp real :: res(1) integer :: i inp%v = 3.14 res = 0.0 do concurrent(i=1:1) res(i) = xfn(inp) end do if (abs(res(1) - 3.14) > 1.0e-5) error stop print *, "ok" contains pure function xfn(inp) result(outp) type(tensor_t), intent(in) :: inp real :: outp associate(s => inp%values()) outp = s end associate end function end program lfortran-0.63.0/integration_tests/exit_03.f900000664000175000017500000000022415174404631021156 0ustar alastairalastairprogram exit_03 integer :: i, N N = 10 do i = 1, N print *, i if ( i .eq. 5 ) then call exit() end if end do end program exit_03lfortran-0.63.0/integration_tests/submodule_02.f900000664000175000017500000000247615174404631022216 0ustar alastairalastair! Reference - http://fortranwiki.org/fortran/show/Submodules module stdlib_kinds_submodule_02 use iso_fortran_env, only: rkind1 => real32 use iso_fortran_env, only: int32 implicit none public rkind1, int32 end module stdlib_kinds_submodule_02 module points use :: stdlib_kinds_submodule_02, only: rkind => rkind1 implicit none type :: point real :: x, y end type point interface module function point_dist_func(a, b) result(distance) type(point), intent(in) :: a, b real(rkind) :: distance end function point_dist_func end interface interface module subroutine point_dist_subrout(a, b, distance) type(point), intent(in) :: a, b real(rkind), intent(out) :: distance end subroutine point_dist_subrout end interface end module points submodule (points) points_a contains module function point_dist_func(a, b) result(distance) type(point), intent(in) :: a, b real(rkind) :: distance distance = sqrt((a%x - b%x)**2 + (a%y - b%y)**2) end function point_dist_func module subroutine point_dist_subrout(a, b, distance) type(point), intent(in) :: a, b real(rkind), intent(out) :: distance distance = sqrt((a%x - b%x)**2 + (a%y - b%y)**2) end subroutine point_dist_subrout end submodule points_a program submodules_02 implicit none end program lfortran-0.63.0/integration_tests/list_test_04_.f900000664000175000017500000000270015174404631022360 0ustar alastairalastairmodule list_test_04_mod implicit none contains subroutine test_list_01() type(_lfortran_list(integer)) :: x, y integer :: i, j real :: f do i = 0, 4 j = i**2 + 10 call _lfortran_list_insert(x, _lfortran_len(x), j) end do do i = 0, _lfortran_len(x)-1 f = sqrt(real(_lfortran_get_item(x, i))-10.0) call _lfortran_list_append(y, int(f)) end do do i = 0, _lfortran_len(x)-1 call _lfortran_list_remove(x, i**2 + 10) call _lfortran_list_append(x, i) end do ! Final assertion do i = 0, _lfortran_len(y)-1 if (_lfortran_get_item(x, i) /= _lfortran_get_item(y, i)) error stop end do end subroutine subroutine test_list_02() type(_lfortran_list(character(len=:))) :: x character(len=32) :: buffer character(len=:), allocatable :: s integer :: i do i = 1, 50 write(buffer, '(I0)') i s = trim(buffer) // "_str" call _lfortran_list_append(x, s) end do do i = 1, 50 write(buffer, '(I0)') i s = trim(buffer) // "_str" call _lfortran_list_remove(x, s) end do if (_lfortran_len(x) /= 0) error stop end subroutine subroutine tests() call test_list_01() call test_list_02() end subroutine end module program test_list_remove_main use list_test_04_mod implicit none call tests() end program lfortran-0.63.0/integration_tests/write_19.f900000664000175000017500000000024715174404631021353 0ustar alastairalastairprogram write_19 use write_19_mod, only: t use write_19_io, only: print_it implicit none type(t) :: obj call print_it(obj) print *, "ok" end program lfortran-0.63.0/integration_tests/file_close_01.f900000664000175000017500000000146715174404631022321 0ustar alastairalastairprogram file_close_01 implicit none character(:),allocatable:: file_name character(len=16) :: str character(len=6) :: st = "delete" integer :: newu = 10 logical :: ex file_name = "file_close_1.txt" open(newunit=newu,file=file_name) write(newu, *) file_name ! file_name now has content = its own name rewind(newu) read(newu, *) str print *, "contents: ", str close(newu,status='delete') inquire(file=file_name,exist=ex) print "(3A,L2)",'Was ',file_name,' deleted?', .not. ex if (ex .neqv. .false.) error stop open(newunit=newu,file=file_name) close(newu,status=st) ! status specified through variable inquire(file=file_name,exist=ex) print "(3A,L2)",'Was ',file_name,' deleted?', .not. ex if (ex .neqv. .false.) error stop end program file_close_01 lfortran-0.63.0/integration_tests/intrinsics_430.f900000664000175000017500000000112615174404631022460 0ustar alastairalastairprogram intrinsics_430 implicit none type :: t1 real :: x end type type(t1), target :: a(5) a%x = 1.0 if (.not. is_contiguous(a)) error stop if (is_contiguous(a%x)) error stop associate(x => a%x) if (.not. is_contiguous(x)) error stop end associate block real, pointer :: x(:) x => a%x if (.not. is_contiguous(x)) error stop end block if (.not. is_dummy_arg_contiguous(a%x)) error stop contains function is_dummy_arg_contiguous(a) result(r) real, intent(in) :: a(:) logical :: r r = is_contiguous(a) end function end program intrinsics_430lfortran-0.63.0/integration_tests/intrinsics_131.f900000664000175000017500000000426615174404631022466 0ustar alastairalastairprogram intrinsics_131 implicit none integer, parameter :: x1 = max(1, 2) integer(8), parameter :: x2 = max(1_8, 2_8) real, parameter :: x3 = max(1.0, 2.0) real(8), parameter :: x4 = max(1.0_8, 2.0_8) character(len=10), parameter :: x5 = max("str", "string") integer, parameter :: ar1(3) = max([1, 12, 3], [4, 5, 6]) integer(8), parameter :: ar2(3) = max([1_8, 12_8, 3_8], [4_8, 5_8, 6_8]) real, parameter :: ar3(3) = max([1.0, 12.0, 3.0], [4.0, 5.0, 6.0]) real(8), parameter :: ar4(3) = max([1.0_8, 12.0_8, 3.0_8], [4.0_8, 5.0_8, 6.0_8]) ! character(len=10), parameter :: ar5(3) = max(["str1", "str2", "char"], ["!str#$", "xtring", "charac"]) ! Does not work - #4582 integer :: i1, i2 integer(8) :: i3, i4 real :: r1, r2 real(8) :: r3, r4 character(len=10) :: string_var, string_var2, string_var3 i1 = 123 i2 = 456 i3 = 123_8 i4 = 456_8 r1 = 123.0 r2 = 456.0 r3 = 123.0_8 r4 = 456.0_8 string_var = "str" string_var2 = "string" string_var3 = "character" print *, x1 if (x1 /= 2) error stop print *, x2 if (x2 /= 2_8) error stop print *, x3 if (x3 /= 2.0) error stop print *, x4 if (x4 /= 2.0_8) error stop print *, x5 if (x5 /= "string") error stop print *, ar1 if (any(ar1 /= [4, 12, 6])) error stop print *, ar2 if (any(ar2 /= [4_8, 12_8, 6_8])) error stop print *, ar3 if (any(ar3 /= [4.0, 12.0, 6.0])) error stop print *, ar4 if (any(ar4 /= [4.0_8, 12.0_8, 6.0_8])) error stop ! print *, ar5 ! if (any(ar5 /= ["str1", "string", "charac"])) error stop print *, max(i1, i2) if (max(i1, i2) /= i2) error stop print *, max(i3, i4) if (max(i3, i4) /= i4) error stop print *, max(r1, r2) if (max(r1, r2) /= r2) error stop print *, max(r3, r4) if (max(r3, r4) /= r4) error stop print*, max("str", "character") if (max("str", "character") /= "str") error stop print*, max(string_var, string_var2) if (max(string_var, string_var2) /= string_var2) error stop print*, max(string_var3, string_var2) if (max(string_var3, string_var2) /= string_var2) error stop end program lfortran-0.63.0/integration_tests/external_14_module.f900000664000175000017500000000141415174404631023400 0ustar alastairalastairmodule external_14_mod_1 use iso_c_binding implicit none interface f_string module procedure f_string_cptr end interface contains function f_string_cptr(cptr) result(s) type(c_ptr), intent(in), value :: cptr character(len=:), allocatable :: s character(kind=c_char), pointer :: p(:) integer :: n, i if (.not. c_associated(cptr)) then error stop "f_string: NULL c_ptr" end if call c_f_pointer(cptr, p, [64]) n = 0 do while (p(n+1) /= c_null_char) n = n + 1 end do allocate(character(len=n) :: s) do i = 1, n s(i:i) = achar(iachar(p(i))) end do end function f_string_cptr end module external_14_mod_1lfortran-0.63.0/integration_tests/string_39.f900000664000175000017500000000022715174404631021527 0ustar alastairalastairprogram string_39 implicit none character(len=8) :: s s = "lfortran" print*, "s:", s(+(1+1):4) if (s(+(1+1):4) /= "for") error stop end program lfortran-0.63.0/integration_tests/functions_18.f900000664000175000017500000000077615174404631022237 0ustar alastairalastairprogram functions_18 implicit none type t integer, pointer :: x(:) end type t type(t) :: type_1 integer, target :: x_global(3) x_global = 124 allocate(type_1%x(3)) deallocate(type_1%x) type_1%x => x_global print*, sub(type_1%x) contains function sub(x) integer, intent(in) :: x(:) integer :: sub(size(x)), i sub = x do i = 1, size(sub) if (sub(i) /= 124) error stop end do end function sub end program lfortran-0.63.0/integration_tests/allocate_63.f900000664000175000017500000000117315174404631022003 0ustar alastairalastair module allocate_63_mod implicit none contains subroutine cleanup(errmsg) bind(C) character(len=:), intent(out), allocatable :: errmsg if (allocated(errmsg)) then deallocate(errmsg) end if end subroutine end module program allocate_63 use allocate_63_mod implicit none character(len=:), allocatable :: msg allocate(character(5) :: msg) msg = "hello" if (.not. allocated(msg)) error stop "msg should be allocated before cleanup" call cleanup(msg) if (allocated(msg)) error stop "msg should be deallocated after cleanup" print *, "passed" end program lfortran-0.63.0/integration_tests/select_type_34.f900000664000175000017500000000265115174404631022537 0ustar alastairalastairprogram select_type_34 implicit none type :: any_matrix class(*), allocatable :: value(:,:) end type call test_integer() call test_real() contains subroutine test_integer() type(any_matrix) :: m integer, allocatable :: val(:,:) allocate(integer :: m%value(2,3)) allocate(val(2,3)) select type (v => m%value) type is (integer) v(1,1) = 10 v(2,1) = 20 v(1,2) = 30 v(2,2) = 40 v(1,3) = 50 v(2,3) = 60 val = v end select if (val(1,1) /= 10) error stop if (val(2,1) /= 20) error stop if (val(1,2) /= 30) error stop if (val(2,2) /= 40) error stop if (val(1,3) /= 50) error stop if (val(2,3) /= 60) error stop end subroutine subroutine test_real() type(any_matrix) :: m real, allocatable :: val(:,:) allocate(real :: m%value(2,2)) allocate(val(2,2)) select type (v => m%value) type is (real) v(1,1) = 1.5 v(2,1) = 2.5 v(1,2) = 3.5 v(2,2) = 4.5 val = v end select if (abs(val(1,1) - 1.5) > 1.0e-6) error stop if (abs(val(2,1) - 2.5) > 1.0e-6) error stop if (abs(val(1,2) - 3.5) > 1.0e-6) error stop if (abs(val(2,2) - 4.5) > 1.0e-6) error stop end subroutine end program lfortran-0.63.0/integration_tests/c_ptr_12.f900000664000175000017500000000143415174404631021320 0ustar alastairalastairmodule c_ptr_12_mod use iso_c_binding, only: c_ptr, c_null_ptr implicit none contains type(c_ptr) function make_null_ptr() make_null_ptr = c_null_ptr end function end module program c_ptr_12 ! Test that assigning a function returning type(c_ptr) to a type(c_ptr) ! variable works correctly. use iso_c_binding, only: c_ptr, c_null_ptr, c_associated use c_ptr_12_mod, only: make_null_ptr implicit none type(c_ptr) :: ptr ! Test assignment from a module function returning type(c_ptr) ptr = make_null_ptr() if (c_associated(ptr)) error stop ! Test assignment from an internal function returning type(c_ptr) ptr = get_null_ptr() if (c_associated(ptr)) error stop print *, "ok" contains type(c_ptr) function get_null_ptr() get_null_ptr = c_null_ptr end function end program c_ptr_12 lfortran-0.63.0/integration_tests/gpu_metal_101.f900000664000175000017500000000142615174404631022246 0ustar alastairalastairprogram gpu_metal_101 ! Test: function returning allocatable array inside do concurrent ! Verifies that the Metal codegen correctly handles local allocatable ! array variables created by the subroutine_from_function pass for ! functions returning allocatable arrays. implicit none integer :: i real :: a(4), r(4) a = [1.0, 2.0, 3.0, 4.0] do concurrent (i = 1:4) associate(v => get_arr(a(i))) r(i) = v(1) end associate end do if (abs(r(1) - 1.0) > 1e-6) error stop if (abs(r(2) - 2.0) > 1e-6) error stop if (abs(r(3) - 3.0) > 1e-6) error stop if (abs(r(4) - 4.0) > 1e-6) error stop print *, "ok" contains pure function get_arr(x) result(res) real, intent(in) :: x real, allocatable :: res(:) allocate(res(1)) res(1) = x end function end program lfortran-0.63.0/integration_tests/openmp_32.f900000664000175000017500000000063015174404631021506 0ustar alastairalastairprogram openmp_32 use omp_lib implicit none real :: phi integer :: j, i phi = 10124.142 call omp_set_num_threads(4) do i = 1, 10 !$omp parallel do private(j) reduction(+:phi) do j = 1, 100 phi = phi + 1.0 end do !$omp end parallel do end do print *, phi if (abs(phi - 11124.1416) > 1e-8) error stop end program openmp_32 lfortran-0.63.0/integration_tests/class_63.f900000664000175000017500000000020015174404631021312 0ustar alastairalastairmodule class_63_module use class_63_module_2, only: MyType end module program class_63 use class_63_module end programlfortran-0.63.0/integration_tests/modules_40.f900000664000175000017500000000204615174404631021662 0ustar alastairalastairmodule modules_40_tomlf_de_tokenizer implicit none integer, parameter :: tfc = 4 type :: toml_key character(kind=tfc, len=:), allocatable :: key end type toml_key type, abstract :: toml_tokenizer contains procedure, private :: parse_select end type toml_tokenizer contains subroutine parse_select(de) class(toml_tokenizer), intent(inout), target :: de contains subroutine fill_stack(de, top, stack) class(toml_tokenizer), intent(inout), target :: de integer, intent(out) :: top type(toml_key), allocatable, intent(out) :: stack(:) do if (top >= size(stack)) then call resize(stack) end if end do end subroutine fill_stack subroutine resize(stack, n) type(toml_key), allocatable, intent(inout) :: stack(:) integer, intent(in), optional :: n end subroutine resize end subroutine parse_select end module modules_40_tomlf_de_tokenizer program modules_40 implicit none print *, "executing modules_40" end program modules_40 lfortran-0.63.0/integration_tests/subroutines_12.f900000664000175000017500000000041615174404631022572 0ustar alastairalastairPROGRAM subroutines_12 IMPLICIT NONE INTEGER :: nang = 2 CALL my_subroutine CONTAINS SUBROUTINE my_subroutine INTEGER, DIMENSION(nang) :: fxhv fxhv = [1, 2] PRINT *, fxhv if ( sum(fxhv) /= 3 ) error stop END SUBROUTINE my_subroutine END PROGRAM subroutines_12 lfortran-0.63.0/integration_tests/callback_04.f900000664000175000017500000000072315174404631021746 0ustar alastairalastairmodule dr_fortran_cb contains subroutine print_dr() print *,'Dr. ' end subroutine subroutine print_fortran() print *,'Fortran' end subroutine subroutine print_dr_fortran(title_or_name) interface subroutine title_or_name() end subroutine end interface call title_or_name() end subroutine end module program main use dr_fortran_cb call print_dr_fortran(print_dr) call print_dr_fortran(print_fortran) end program lfortran-0.63.0/integration_tests/class_128.f900000664000175000017500000000135215174404631021405 0ustar alastairalastairprogram class_128 implicit none type :: t class(*), allocatable :: value end type type(t) :: x call set_val(x, 'foo') select type (v => x%value) type is (character(*)) if (v /= 'foo') error stop class default error stop end select call set_val(x, 'hello') select type (v => x%value) type is (character(*)) if (v /= 'hello') error stop class default error stop end select call set_val(x, 42) select type (v => x%value) type is (integer) if (v /= 42) error stop class default error stop end select print *, "PASS" contains subroutine set_val(this, value) type(t), intent(out) :: this class(*), intent(in) :: value this%value = value end subroutine end program lfortran-0.63.0/integration_tests/format_64.f900000664000175000017500000000126415174404631021511 0ustar alastairalastairprogram format_64 implicit none character(40) :: line write(line, '(2I5, 1X, E10.5, BN, 2I5, F6.1)') 1, 2, 3.0, 4, 5, 6.0 if (line(1:5) /= ' 1') error stop if (line(6:10) /= ' 2') error stop if (line(11:11) /= ' ') error stop if (line(12:21) /= '.30000E+01') error stop if (line(22:26) /= ' 4') error stop if (line(27:31) /= ' 5') error stop if (line(32:37) /= ' 6.0') error stop write(line, '(I5, BZ, I5, F6.1)') 10, 20, 3.5 if (line(1:5) /= ' 10') error stop if (line(6:10) /= ' 20') error stop if (line(11:16) /= ' 3.5') error stop print *, "All BN/BZ format tests passed." end program format_64 lfortran-0.63.0/integration_tests/error_stop_01.f900000664000175000017500000000010315174404631022375 0ustar alastairalastairprogram error_stop_01 implicit none error stop end program lfortran-0.63.0/integration_tests/error_stop_03.f900000664000175000017500000000010515174404631022401 0ustar alastairalastairprogram error_stop_03 implicit none error stop 0 end program lfortran-0.63.0/integration_tests/functions_04.f900000664000175000017500000000114715174404631022223 0ustar alastairalastairmodule stdlib_int implicit none interface to_negative module procedure :: to_negative end interface to_negative contains pure function to_negative(int) result(neg_int) integer, intent(in) :: int integer :: neg_int if (int >= 0) then neg_int = -int else neg_int = int end if end function to_negative end module stdlib_int program functions_04 use stdlib_int implicit none integer :: int = 4 if (to_negative(int) /= -4) error stop int = -4 if (to_negative(int) /= -4) error stop end program lfortran-0.63.0/integration_tests/intrinsics_312.f900000664000175000017500000000330015174404631022453 0ustar alastairalastairprogram intrinsics_312 integer(4), parameter :: i1(1) = minloc([1,2,3]) integer(4), parameter :: i2(1) = minloc([1.0, 2.0, 3.0]) integer(4), parameter :: i3(1) = minloc(["aa", "db", "ca"]) integer(4), parameter :: i4(1) = minloc([1,2,3], mask = [.true., .true., .true.]) integer(8), parameter :: i5(1) = minloc([1,2,3], mask=[.true., .false., .true.], kind = 8) integer(4), parameter :: i6(1) = minloc([1,2,3], mask=[.true., .false., .true.], dim=1) integer(4), parameter :: i7(1) = minloc(["aa", "db", "ca"], mask=[.true., .false., .true.]) integer(4), parameter :: i8(1) = minloc(["aa", "db", "ca"], mask=[.true., .false., .true.], dim = 1) integer(4), parameter :: i9(1) = minloc([1, 3, 2], mask = [.true., .false., .true.], back = .true.) integer(4), parameter :: i10(1) = minloc([3, 2, 1, 3], back = .true.) integer(4), parameter :: i11(1) = minloc([3.0, 2.0, 1.0, 3.0], back = .true., dim=1) integer(4), parameter :: i12(1) = minloc(["aa", "db", "ca"], mask = [.false., .false., .false.], kind = 4) print *, i1 if (i1(1) /= 1) error stop print *, i2 if (i2(1) /= 1) error stop print *, i3 if (i3(1) /= 1) error stop print *, i4 if (i4(1) /= 1) error stop print *, i5 if (i5(1) /= 1) error stop print *, i6 if (i6(1) /= 1) error stop print *, i7 if (i7(1) /= 1) error stop print *, i8 if (i8(1) /= 1) error stop print *, i9 if (i9(1) /= 1) error stop print *, i10 if (i10(1) /= 3) error stop print *, i11 if (i11(1) /= 3) error stop print *, i12 if (i12(1) /= 0) error stop print *, kind(minloc(["aa", "db", "ca"], 1, mask = [.false., .false., .false.], kind = 8)) if (kind(minloc(["aa", "db", "ca"], 1, mask = [.false., .false., .false.], kind = 8)) /= 8) error stop end program lfortran-0.63.0/integration_tests/namelist_13_module.f900000664000175000017500000000030515174404631023367 0ustar alastairalastairmodule config_module implicit none integer :: param1 = 10 integer :: param2 = 20 real :: tolerance = 1.0e-6 namelist /config/ param1, param2, tolerance end module config_module lfortran-0.63.0/integration_tests/format_66.f900000664000175000017500000000265715174404631021522 0ustar alastairalastairprogram format_66 implicit none integer :: io, n character(len=80) :: line open(newunit=io, file="format_66_output.txt", status="replace", action="write") write(io, '("line1"/)') write(io, '("line2"//)') write(io, '("line3"///)') write(io, '(i1,/,i1)') 4, 5 write(io, '("end")') close(io) open(newunit=io, file="format_66_output.txt", status="old", action="read") read(io, '(A)') line print *, line if (trim(line) /= "line1") error stop read(io, '(A)') line print *, line if (trim(line) /= "") error stop read(io, '(A)') line print *, line if (trim(line) /= "line2") error stop read(io, '(A)') line print *, line if (trim(line) /= "") error stop read(io, '(A)') line print *, line if (trim(line) /= "") error stop read(io, '(A)') line print *, line if (trim(line) /= "line3") error stop read(io, '(A)') line print *, line if (trim(line) /= "") error stop read(io, '(A)') line print *, line if (trim(line) /= "") error stop read(io, '(A)') line print *, line if (trim(line) /= "") error stop read(io, '(A)') line print *, line if (trim(line) /= "4") error stop read(io, '(A)') line print *, line if (trim(line) /= "5") error stop read(io, '(A)') line print *, line if (trim(line) /= "end") error stop close(io, status="delete") end program format_66 lfortran-0.63.0/integration_tests/modules_08.f900000664000175000017500000000023415174404631021663 0ustar alastairalastairprogram modules_08 use modules_08_a, only: a use modules_08_b, only: b implicit none if (a() /= 3) error stop if (b() /= 9) error stop print *, "OK" end lfortran-0.63.0/integration_tests/entry_04.f900000664000175000017500000000134415174404631021353 0ustar alastairalastairdouble precision function mvndfn(dummy) double precision :: dummy double precision :: mvndnt if (abs(dummy - 10.0) > 1.0e-7) error stop mvndfn = -12.05 return entry mvndnt(dummy) mvndnt = 12.05 if (abs(dummy - 5.0) > 1.0e-7) error stop return end function program main interface double precision function mvndfn(dummy) double precision :: dummy end function double precision function mvndnt(dummy) double precision :: dummy end function end interface double precision :: dummy dummy = 10.0 if (abs(mvndfn(dummy) - (-12.05)) > 1.0e-7) error stop dummy = 5.0 if (abs(mvndnt(dummy) - 12.05) > 1.0e-7) error stop end program lfortran-0.63.0/integration_tests/transfer_01.f900000664000175000017500000000225115174404631022031 0ustar alastairalastairprogram transfer_01 implicit none integer :: i, integer_result, y(3, 2) real :: r, result, x2, x(5, 4) real, parameter :: x1 = transfer(666,1.0) character(len=*), parameter :: chr = 'A' character(len=*), parameter :: chr2 = transfer(65, 'A') character(len=2), parameter :: chr3 = transfer(16961, 'AB') r = 2.987654 i = 123456 x = 3.19 y = 4 result = transfer(i, r) print *, result if (abs(result - 1.72998703e-40) > 1e-6) error stop integer_result = transfer(r, i) print *, integer_result if (integer_result /= 1077884345) error stop integer_result = transfer(x(5,2), i) print *, integer_result if (integer_result /= 1078733046) error stop result = transfer(y(1,1), x(5,2)) print *, result if (abs(result - 5.60519386E-45) > 1e-6) error stop if (transfer(x1, 1) /= 666) error stop x2 = transfer(666,1.0) if (transfer(x2, 1) /= 666) error stop print *, transfer(65, chr) if (transfer(65, chr) /= 'A') error stop print *, transfer(90, 'A') if (transfer(90, 'A') /= 'Z') error stop if (chr2 /= 'A') error stop if (chr3 /= 'AB') error stop end program transfer_01 lfortran-0.63.0/integration_tests/class_100.f900000664000175000017500000000165115174404631021375 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/6975 ! Segfault upon compilation of select type with deferred function result module class_100_module type, abstract :: InputType contains procedure(some_method), deferred :: some_method end type InputType type, abstract :: OutputType end type OutputType abstract interface function some_method(self) result(obj) import class(InputType), intent(in) :: self class(*), allocatable :: obj end function some_method end interface contains function some_func(t) result(res) class(InputType), intent(in) :: t class(*), allocatable :: res select type( obj => t%some_method() ) class is (OutputType) res = obj end select end function some_func end module class_100_module program class_100 use class_100_module print *, "PASS" end program class_100 lfortran-0.63.0/integration_tests/intrinsics_285.f900000664000175000017500000000474215174404631022477 0ustar alastairalastairprogram intrinsics_285 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real(4), parameter :: r1 = real(15) real(4), parameter :: r2 = real(15.12_sp) real(4), parameter :: r3 = real((15.123_sp, -7.0_sp)) real(8), parameter :: r4 = real(-7, 8) real(8), parameter :: r5 = real(-15.123_sp, 8) real(8), parameter :: r6 = real(15.123_sp, 8) real(4), parameter :: ar1(3) = real([1, 7, 13]) real(8), parameter :: ar2(3) = real([1.789_sp, 7.123_sp, 13.123_sp], 8) real(4), parameter :: ar3(3) = real([(1.789_sp, 7.123_sp), (13.123_sp, -7.0_sp), (15.123_sp, 8_sp)]) integer(4) :: i4 = 15 real(4) :: r = 15.123_sp complex(4) :: c4 = (15.123_sp, -7.0_sp) integer(8) :: i8 = -7 real(8) :: r8 = -15.123_sp complex(8) :: c8 = (15.123_sp, 8_sp) integer(4) :: arr1(3) real(8) :: arr2(3) complex(4) :: arr3(3) arr1 = [1, 7, 13] arr2 = [1.789_dp, 7.123_dp, 13.123_dp] arr3 = [(1.789_sp, 7.123_sp), (13.123_sp, -7.0_sp), (15.123_sp, 8_sp)] print*, r1 if (abs(r1 - 15.0_sp) > 1e-6_sp) error stop print*, r2 if (abs(r2 - 15.12_sp) > 1e-6_sp) error stop print*, r3 if (abs(r3 - 15.123_sp) > 1e-6_sp) error stop print*, r4 if (abs(r4 - (-7.0_dp)) > 1e-6_dp) error stop print*, r5 if (abs(r5 - (-15.123_dp)) > 1e-6_dp) error stop print*, r6 if (abs(r6 - 15.123_dp) > 1e-6_dp) error stop print*, ar1 if (any(abs(ar1 - [1.0_sp, 7.0_sp, 13.0_sp]) > 1e-6_sp)) error stop print*, ar2 if (any(abs(ar2 - [1.789_dp, 7.123_dp, 13.123_dp]) > 1e-6_dp)) error stop print*, ar3 if (any(abs(ar3 - [1.78900003_sp, 13.1230001_sp, 15.1230001_sp]) > 1e-6_sp)) error stop print*, real(i4) if (abs(real(i4) - 15.0_sp) > 1e-6_sp) error stop print*, real(r) if (abs(real(r) - 15.123_sp) > 1e-6_sp) error stop print*, real(c4) if (abs(real(c4) - 15.123_sp) > 1e-6_sp) error stop print*, real(i8) if (abs(real(i8) - (-7.0_dp)) > 1e-6_dp) error stop print*, real(r8) if (abs(real(r8) - (-15.123_dp)) > 1e-6_dp) error stop print*, real(c8) if (abs(real(c8) - 15.123_dp) > 1e-6_dp) error stop print*, real(arr1) if (any(abs(real(arr1) - [1.0_sp, 7.0_sp, 13.0_sp]) > 1e-6_sp)) error stop print*, real(arr2) if (any(abs(real(arr2) - [1.789_dp, 7.123_dp, 13.123_dp]) > 1e-6_dp)) error stop print*, real(arr3) if (any(abs(real(arr3) - [1.78900003_sp, 13.1230001_sp, 15.1230001_sp]) > 1e-6_sp)) error stop end programlfortran-0.63.0/integration_tests/derived_types_91.f900000664000175000017500000000266415174404631023074 0ustar alastairalastairmodule derived_types_91_mod implicit none private public :: ansi_code, toml_terminal type :: ansi_code integer :: style = -1 contains procedure :: is_valid end type ansi_code type :: toml_terminal type(ansi_code) :: reset = ansi_code() contains procedure :: check end type toml_terminal contains logical function is_valid(self) class(ansi_code), intent(in) :: self is_valid = (self%style == -1) end function is_valid subroutine check(self) class(toml_terminal), intent(in) :: self if (.not. self%reset%is_valid()) then error stop "ERROR: toml_terminal.reset is invalid" end if end subroutine check end module derived_types_91_mod module derived_types_91_mod_2 use derived_types_91_mod, only: toml_terminal implicit none private public :: toml_parser_config type :: toml_parser_config type(toml_terminal) :: color = toml_terminal() contains procedure :: check end type toml_parser_config contains subroutine check(self) class(toml_parser_config), intent(in) :: self call self%color%check() end subroutine check end module derived_types_91_mod_2 program derived_types_91 use derived_types_91_mod_2, only: toml_parser_config implicit none type(toml_parser_config) :: config call config%check() end program derived_types_91 lfortran-0.63.0/integration_tests/allocate_06.f900000664000175000017500000000071515174404631022001 0ustar alastairalastairprogram allocate_06 implicit none character(len=:), allocatable :: array(:) call sub(array) if (array(1) /= "abc") error stop print *, array(1) contains subroutine sub(x_array) character(len=:), allocatable, intent(out) :: x_array(:) allocate(character(len=8)::x_array(2)) x_array = ["abc"] if (x_array(1) /= "abc") error stop print *, x_array(1) end subroutine sub end program allocate_06 lfortran-0.63.0/integration_tests/expr_09.f900000664000175000017500000000037215174404631021175 0ustar alastairalastairprogram expr_09 implicit none integer :: x4, y4 integer(kind=8) :: x8, y8 y4 = 5 x4 = y4 ** 2 print *, y4, x4 if (x4 /= 25) error stop y8 = 5 x8 = y8**2 print *, y8, x8 if (x8 /= 25) error stop end program lfortran-0.63.0/integration_tests/string_66.f900000664000175000017500000000154115174404631021527 0ustar alastairalastairmodule string_66_mod implicit none contains pure function str_int(i) result(s) integer, intent(in) :: i character(len=100) :: s write(s, '(i0)') i end function pure integer function str_real_len(r, fmt) result(sz) real, intent(in) :: r character(len=*), intent(in) :: fmt integer, parameter :: MAX_STR = 100 character(MAX_STR) :: s write(s, fmt) r sz = len_trim(s) end function function str_real_n(r, n) result(s) real :: r integer :: n character(len=str_real_len(r, "(f0." // str_int(n) // ")")) :: s print *, len(s) if(len(s) /= 14) error stop end function end module program string_66 use string_66_mod character(:),allocatable :: strr real :: r integer :: i r = 102.2 i = 10 strr = str_real_n(r,i) end programlfortran-0.63.0/integration_tests/write_02.f900000664000175000017500000000215015174404631021336 0ustar alastairalastairprogram main implicit none write (*, *), [4, 9] write (*, *), [[2, -2, 5, 7, [8, -9, [10]]], [3, 3], [-11]] call f() contains subroutine f() integer, allocatable :: a(:, :) real :: b(2, 2) integer :: i, j allocate(a(5, 10)) do i = lbound(a, 1), ubound(a, 1) do j = lbound(a, 2), ubound(a, 2) a(i, j) = i + j end do end do b(1, 1) = 1.1 b(1, 2) = -1.2 b(2, 1) = 2.1 b(2, 2) = -2.2 write (*, *), [[1, a, 2, 3], a, 5, [abs(-2)]] write (*, *), "hello", ["hey", ["xyz", ["abc"]]], [[1, a, 2, 3], a, 5, [abs(-2)]], "bye" write (*, *), [2.1, [3.14, [-5.11, [abs(-21.22), [abs(21.22)]]]]] write (*, *), "Integer(2x2) ArrayConst", [[1, 2], [3, 4]], "Array End" write (*, *), "Real(2x2) ArrayVar", b, "Array End" write (*, *), "Real(2x2) ArrayConst", [[1.1, -1.2], [2.1, -2.2]], "Array End" write (*, *), "Integer(2x2), Real(2x2), ArrayConst", [[1, 2], [3, 4]], [[1.1, -1.2], [2.1, -2.2]], "ArrayEnd" end subroutine end program lfortran-0.63.0/integration_tests/shifta_01.f900000664000175000017500000000274515174404631021473 0ustar alastairalastairprogram shifta_01 implicit none integer(kind=4) :: n, x, result ! Test case 1: shift by 0 bits n = 12345678 x = 0 result = shifta(n, x) print *, "Test case 1: shifta(", n, ",", x, ") = ", result if (result /= n) error stop "Test case 1 failed" ! Test case 2: shift by 1 bit n = 12345678 x = 1 result = shifta(n, x) print *, "Test case 2: shifta(", n, ",", x, ") = ", result if (result /= 6172839) error stop "Test case 2 failed" ! Test case 3: shift by 15 bits n = 12345678 x = 15 result = shifta(n, x) print *, "Test case 3: shifta(", n, ",", x, ") = ", result if (result /= 376) error stop "Test case 3 failed" ! Test case 4: shift by 16 bits n = 12345678 x = 16 result = shifta(n, x) print *, "Test case 4: shifta(", n, ",", x, ") = ", result if (result /= 188) error stop "Test case 4 failed" ! Test case 5: shift by 30 bits n = 2**29 x = 30 result = shifta(n, x) print *, "Test case 5: shifta(", n, ",", x, ") = ", result if (result /= 0) error stop "Test case 5 failed" n = 2**30 x = 30 result = shifta(n, x) print *, "Test case 5: shifta(", n, ",", x, ") = ", result if (result /= 1) error stop "Test case 5 failed" ! Test case 6: shift by 31 bits n = 2**29 + 3 x = 31 result = shifta(n, x) print *, "Test case 6: shifta(", n, ",", x, ") = ", result if (result /= 0) error stop "Test case 6 failed" end program shifta_01 lfortran-0.63.0/integration_tests/equivalence_06.f900000664000175000017500000000072515174404631022517 0ustar alastairalastairprogram equivalence_06 use iso_c_binding, only: c_loc, c_f_pointer implicit none INTEGER, target :: IMACH(16), SMALL(2) INTEGER, pointer :: OUTPUT(:) REAL, pointer :: RMACH(:) call c_f_pointer(c_loc(imach(4)), output, [1]) call c_f_pointer(c_loc(small(1)), rmach, [1]) imach(4) = 6 if(output(1) /= 6) error stop small = 99 rmach = 5.6_8 if(small(1) /= 1085485875) error stop if(small(2) /= 99) error stop end program lfortran-0.63.0/integration_tests/finalization_04.f900000664000175000017500000000146215174404631022702 0ustar alastairalastairmodule finalization_04_mod implicit none type :: item_type character(len=:), allocatable :: name contains final :: destroy_item end type item_type contains function new_item(name) result(self) character(len=*), intent(in) :: name type(item_type) :: self self%name = name end function new_item subroutine destroy_item(self) type(item_type), intent(inout) :: self if (allocated(self%name)) deallocate(self%name) end subroutine destroy_item end module finalization_04_mod program finalization_04 use finalization_04_mod implicit none type(item_type) :: items(2) items = [new_item("hello"), new_item("world")] if (items(1)%name /= "hello") error stop if (items(2)%name /= "world") error stop print *, "ok" end program finalization_04 lfortran-0.63.0/integration_tests/gpu_metal_43.f900000664000175000017500000000104015174404631022163 0ustar alastairalastair! Test: do concurrent inside associate block that also contains a ! whole-array assignment through the associate alias before the loop. ! The gpu_offload pass must not confuse `v = 0.` (regular assignment) ! with an associate binding, which would cause infinite recursion. program gpu_metal_43 implicit none real :: x(3) integer :: l associate(v => x) v = 0. do concurrent(l = 1:3) v(l) = real(l) end do end associate if (x(1) /= 1.0) error stop if (x(2) /= 2.0) error stop if (x(3) /= 3.0) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/operator_overloading_34_mod.f900000664000175000017500000000067415174404631025305 0ustar alastairalastairmodule operator_overloading_34_mod implicit none type :: array_type real, allocatable :: val(:,:) end type interface operator(.gt.) module procedure gt_scalar end interface contains function gt_scalar(a, b) result(c) type(array_type), intent(in) :: a real, intent(in) :: b logical, dimension(size(a%val,1), size(a%val,2)) :: c c = a%val > b end function end module lfortran-0.63.0/integration_tests/transfer_05.f900000664000175000017500000000132315174404631022034 0ustar alastairalastairmodule stdlib_hash_32bit_water_transfer_05 use iso_fortran_env, only: int8, int32, int64 implicit none contains subroutine int8_water_hash( key ) integer(int8), intent(in) :: key(:) print *, sum(key) if (sum(key) /= -9) error stop end subroutine int8_water_hash subroutine character_water_hash( key ) character(*), intent(in) :: key call int8_water_hash( transfer( key, 0_int8, len(key, kind=int64) ) ) end subroutine character_water_hash end module stdlib_hash_32bit_water_transfer_05 program transfer_05 use stdlib_hash_32bit_water_transfer_05 character(len=10) :: key key = 'abcdefghij' call character_water_hash(key) end program lfortran-0.63.0/integration_tests/implied_do_loops15.f900000664000175000017500000000117615174404631023401 0ustar alastairalastairprogram implied_do_loops15 integer n(3) n = [(42, i = 1, size(n))] print "(3I3)", n if (any(n /= 42)) error stop call test_expression() call test_subroutine() contains subroutine test_expression() integer m(5) m = [(i*2, i = 1, 5)] print "(5I3)", m if (m(1) /= 2) error stop if (m(5) /= 10) error stop end subroutine test_expression subroutine test_subroutine() integer arr(4) arr = [(j*3, j = 1, 4)] print "(4I3)", arr if (arr(1) /= 3) error stop if (arr(4) /= 12) error stop end subroutine test_subroutine end program implied_do_loops15 lfortran-0.63.0/integration_tests/select_rank_18.f900000664000175000017500000000165215174404631022513 0ustar alastairalastair! Test shape() on allocatable assumed-rank arrays inside nested select rank. ! Regression: is_assumed_rank_array did not look through Allocatable wrappers, ! so shape(a) returned a 0-element array when a was allocatable assumed-rank. program select_rank_18 implicit none real, allocatable :: x(:,:), y(:,:) integer :: s(2) allocate(x(3,4), y(3,4)) x = 1.0 y = 1.0 call test_sub(x, y) contains subroutine test_sub(a, b) real, allocatable, intent(inout) :: a(..) real, intent(in) :: b(..) integer :: sa(2), sb(2) select rank(a) rank(2) select rank(b) rank(2) if (any(shape(a) /= shape(b))) error stop sa = shape(a) sb = shape(b) if (sa(1) /= 3) error stop if (sa(2) /= 4) error stop if (sb(1) /= 3) error stop if (sb(2) /= 4) error stop end select end select end subroutine end program lfortran-0.63.0/integration_tests/complex_11.f900000664000175000017500000000033115174404631021652 0ustar alastairalastairSUBROUTINE CPDSA() COMPLEX :: C1 C1 = DCMPLX(1.0D0, 6.0D0) print *, C1 IF (REAL(C1) /= 1.0D0) ERROR STOP IF (AIMAG(C1) /= 6.0D0) ERROR STOP ENDSUBROUTINE program main call CPDSA() end program lfortran-0.63.0/integration_tests/read_10.f900000664000175000017500000000067415174404631021127 0ustar alastairalastairprogram read_10 implicit none integer :: vals(3) integer :: i, unit_no open(newunit=unit_no, status='scratch') write(unit_no, *) 10, 20, 30 rewind(unit_no) read(unit_no, *) (vals(i), i=1, 3) close(unit_no) if (vals(1) /= 10) error stop "vals(1) should be 10" if (vals(2) /= 20) error stop "vals(2) should be 20" if (vals(3) /= 30) error stop "vals(3) should be 30" print *, "PASS" end program lfortran-0.63.0/integration_tests/expr_14.f900000664000175000017500000000033015174404631021163 0ustar alastairalastairmodule expr_14_utils private integer, parameter :: a = 10 public :: a end module program expr_14 use expr_14_utils, only: a implicit none print *, a if (a /= 10) error stop end program lfortran-0.63.0/integration_tests/modulo_02.f900000664000175000017500000000065015174404631021506 0ustar alastairalastairprogram modulo_02 integer :: a(0:1), n integer(8) :: i, big n = 2 big = 9007199254740993_8 i = big a = [10, 20] a(0) = a(modulo(i, n)) if (a(0) /= 20) error stop if (modulo(big, 2) /= 1_8) error stop if (modulo(-big, 2) /= 1_8) error stop if (modulo(big, -2) /= -1_8) error stop if (modulo(17_8, 3) /= 2_8) error stop if (modulo(-17_8, 3) /= 1_8) error stop end program lfortran-0.63.0/integration_tests/infer_walrus_03.f900000664000175000017500000000026715174404631022714 0ustar alastairalastairprogram infer_walrus_03 implicit none x := 5 y := 10 x = x + y if (x /= 15) error stop y = x * 2 if (y /= 30) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/modules_01.f900000664000175000017500000000026115174404631021654 0ustar alastairalastairmodule modules_01_a implicit none contains subroutine b() print *, "b()" end subroutine end module program modules_01 use modules_01_a, only: b implicit none call b() end lfortran-0.63.0/integration_tests/block_13.f900000664000175000017500000000106015174404631021277 0ustar alastairalastair! Test: derived type array with allocatable component in block scope. ! The allocatable components must be finalized before freeing the array. program block_13 implicit none type :: t character(len=:), allocatable :: c end type block type(t) :: x(1) x(1)%c = "hello" if (x(1)%c /= "hello") error stop end block block type(t) :: y(3) y(1)%c = "a" y(2)%c = "bb" y(3)%c = "ccc" if (len(y(3)%c) /= 3) error stop end block print *, "ok" end program block_13 lfortran-0.63.0/integration_tests/procedure_pointer_21.f900000664000175000017500000000104115174404631023733 0ustar alastairalastairprogram procedure_pointer_21 implicit none abstract interface subroutine callback_i(x) bind(C) character(len=:), allocatable, intent(out) :: x end subroutine end interface procedure(callback_i), pointer :: cb character(len=:), allocatable :: x cb => my_sub call cb(x) if (.not. allocated(x)) error stop "not allocated" if (x /= "hello") error stop "wrong value" print *, x contains subroutine my_sub(x) bind(C) character(len=:), allocatable, intent(out) :: x x = "hello" end subroutine end program lfortran-0.63.0/integration_tests/implied_do_loops26.f900000664000175000017500000000104615174404631023377 0ustar alastairalastairprogram implied_do_loops26 implicit none integer :: idata(11) integer :: i ! AC implied-do variable scope test i = -42 idata = [(i, i = 1, size(idata))] if (i /= -42) error stop ! IO implied-do behaviour i = -42 write (*, *) (idata(i), i = 1, size(idata)) if (i /= size(idata) + 1) error stop i = -42 write (*, *) (idata(i), i = 1, size(idata), 2) if (i /= size(idata) + 2) error stop write (*, *) (idata(i), i = i - 2, 1, -2) if (i /= -1) error stop print *, "All tests passed." end program implied_do_loops26 lfortran-0.63.0/integration_tests/class_12.f900000664000175000017500000000125115174404631021313 0ustar alastairalastairmodule class_12_mod type, abstract :: abstract_type contains procedure(integer_method), deferred, nopass :: integer_method end type abstract_type abstract interface function integer_method() result(n) integer :: n end function integer_method end interface type :: Wrapper class(abstract_type), allocatable :: obj contains procedure :: caller end type Wrapper contains subroutine caller(self) class(Wrapper), intent(in) :: self integer :: n n = self%obj%integer_method() end subroutine caller end module program class_12 use class_12_mod implicit none print *, "Ok" end program lfortran-0.63.0/integration_tests/operator_overloading_09.f900000664000175000017500000000322415174404631024442 0ustar alastairalastairmodule stdlib_bitsets_operator_overloading_9_m implicit none public :: bitset_type, bitset_large, bitset_64 public :: operator(==) type, abstract :: bitset_type private integer(4) :: num_bits contains end type bitset_type type, extends(bitset_type) :: bitset_large end type bitset_large type, extends(bitset_type) :: bitset_64 end type bitset_64 interface operator(==) elemental module function eqv_large(set1, set2) result(eqv) logical :: eqv type(bitset_large), intent(in) :: set1, set2 end function eqv_large elemental module function eqv_64(set1, set2) result(eqv) logical :: eqv type(bitset_64), intent(in) :: set1, set2 end function eqv_64 end interface operator(==) contains elemental module function eqv_large(set1, set2) result(eqv) logical :: eqv type(bitset_large), intent(in) :: set1, set2 eqv = .false. ! dummy implementation end function eqv_large elemental module function eqv_64(set1, set2) result(eqv) logical :: eqv type(bitset_64), intent(in) :: set1, set2 eqv = .true. ! dummy implementation end function eqv_64 end module stdlib_bitsets_operator_overloading_9_m program operator_overloading_09 use stdlib_bitsets_operator_overloading_9_m implicit none type(bitset_large) :: set0, set1 type(bitset_64) :: set2, set3 if ((set1 == set0) .neqv. .false.) error stop if ((set2 == set3) .neqv. .true.) error stop end program operator_overloading_09 lfortran-0.63.0/integration_tests/intrinsics_321.f900000664000175000017500000000140415174404631022456 0ustar alastairalastairprogram intrinsics_241 character(9):: hello = " hello " character(7):: world = " world" character(6):: this = "this " character(4):: empty = " " character:: line = '' character(5), parameter :: hello1 = trim(" hello ") character(5), parameter :: world1 = trim(" world") character(4), parameter :: this1 = trim("this ") print*, hello1 if (hello1 /= " hel") error stop print*, world1 if (world1 /= " wor") error stop print*, this1 if (this1 /= "this") error stop print*, trim(hello) if (trim(hello) /= " hello") error stop print*, trim(world) if (trim(world) /= " world") error stop print*, trim(this) if (trim(this) /= "this") error stop print*, trim(empty) if (trim(empty) /= "") error stop print*, trim(line) if (trim(line) /= "") error stop end program lfortran-0.63.0/integration_tests/elemental_16.f900000664000175000017500000000176315174404631022170 0ustar alastairalastairmodule elemental_16_mymod implicit none private public :: sub_1d, sub_elemental contains pure subroutine sub_1d(xout, xin1, xin2) real, intent(out) :: xout(:) real, intent(in) :: xin1, xin2 xout = 1.234*(xin2 - xin1) + xin1 end subroutine sub_1d pure elemental subroutine sub_elemental(xout, xin1, xin2) real, intent(out) :: xout real, intent(in) :: xin1, xin2 xout = 1.234*(xin2 - xin1) + xin1 end subroutine sub_elemental end module program main use, non_intrinsic :: elemental_16_mymod, only: sub_1d, sub_elemental implicit none integer, parameter :: n = 3 real :: v(n) v = -1.0 write(*,*) 'v: ',v call sub_1d(v, 0.0, 1.0) write(*,*) 'v: ',v if (.not. all(abs(v - 1.234) < 1e-5)) error stop v = -1.0 write(*,*) 'v: ',v call sub_elemental(v, 0.0, 1.0) write(*,*) 'v: ',v if (.not. all(abs(v - 1.234) < 1e-5)) error stop end program main lfortran-0.63.0/integration_tests/select_type_29.f900000664000175000017500000000300415174404631022534 0ustar alastairalastair! Test nested select type on the same member symbol ! When two select type blocks both access the same member (e.g. self%obj ! and other%obj), the inner block must not corrupt the outer block's context. module select_type_29_mod implicit none private type, abstract :: base end type base type, extends(base) :: child integer :: val end type child public :: wrapper, make_child, set_val type :: wrapper class(base), allocatable :: obj contains procedure :: check end type wrapper contains subroutine make_child(w) type(wrapper), intent(out) :: w allocate(child :: w%obj) end subroutine subroutine set_val(w, v) type(wrapper), intent(inout) :: w integer, intent(in) :: v select type(o => w%obj) type is (child) o%val = v end select end subroutine subroutine check(self, other, expected) class(wrapper), intent(inout) :: self class(wrapper), intent(in) :: other integer, intent(in) :: expected integer :: found found = 0 select type(a => self%obj) type is(child) select type(b => other%obj) type is(child) found = a%val + b%val end select end select if (found /= expected) error stop end subroutine check end module select_type_29_mod program select_type_29 use select_type_29_mod implicit none type(wrapper) :: w1, w2 call make_child(w1) call make_child(w2) call set_val(w1, 10) call set_val(w2, 20) call w1%check(w2, 30) print *, "ok" end program select_type_29 lfortran-0.63.0/integration_tests/statement_07.f900000664000175000017500000000030415174404631022214 0ustar alastairalastairprogram statement_07 implicit double precision (d) dadd (d1, d2) = d1 + d2 da = 1.0d0 db = 2.0d0 dc = dadd (da, db) if (abs(dc - 3.0d0) > 1d-10) error stop end program lfortran-0.63.0/integration_tests/arrays_90.f900000664000175000017500000000050215174404631021513 0ustar alastairalastairprogram arrays_90 integer, parameter :: offset(*) = [0, 1, 2, 3, 4] integer, parameter :: offset2(2,3) = reshape([1, 2, 3, 2, 1, 3], [2, 3]) integer :: temp(2) temp = offset(2:3) if (any(temp /= [1, 2])) error stop temp = offset2(:, 2) print *, temp if (any(temp /= [3, 2])) error stop end programlfortran-0.63.0/integration_tests/equivalence_23.f900000664000175000017500000000047515174404631022520 0ustar alastairalastairprogram equivalence_23 implicit none integer :: i1(2,2), i2(2,2), i3(2,2) equivalence (i1(2,2), i2(2,2), i3(2,2)) i1 = 1 i2 = 2 i3 = 3 if (any(i1 /= 3)) error stop if (any(i2 /= 3)) error stop if (any(i3 /= 3)) error stop i1 = 1 if (any(i3 /= 1)) error stop end program lfortran-0.63.0/integration_tests/string_71.f900000664000175000017500000000056515174404631021530 0ustar alastairalastair! Check that substrings are passed by reference. module string_71_mod contains subroutine s(str) character(1) :: str str = "M" end subroutine end module program string_71 use string_71_mod character(5) :: str integer :: i i = 1 str = "Hello" call s(str(i:i)) print *, str if(str /= "Mello") error stop end programlfortran-0.63.0/integration_tests/openmp_71.f900000664000175000017500000000112615174404631021512 0ustar alastairalastair! For CUDA C Dump of OpenMP Target Constructs program openmp_71 implicit none real, allocatable, dimension(:) :: a, b integer :: i allocate(a(10000000), b(10000000)) b=5 !$omp target map(tofrom:a, b) !$omp teams !$omp distribute parallel do do i = 1, 10000000 a(i) = i + b(i)*340 end do !$omp end distribute parallel do !$omp end teams !$omp end target print*, a(5), b(5) if(a(5) /= 1705) error stop if(b(5) /= 5) error stop end program openmp_71lfortran-0.63.0/integration_tests/separate_compilation_37a.f900000664000175000017500000000071115174404631024560 0ustar alastairalastairmodule separate_compilation_37a implicit none type, abstract :: AbsType1 contains procedure(method), deferred :: method end type AbsType1 abstract interface function method(self, str) result(res) import class(AbsType1), intent(in) :: self character(*), intent(in) :: str class(*), allocatable :: res end function method end interface end module separate_compilation_37a lfortran-0.63.0/integration_tests/finalization_02.f900000664000175000017500000000311715174404631022677 0ustar alastairalastair! Test that finalizer calls get correct debug locations with -g. ! Linked list with recursive finalizers on derived types. module finalization_02_mod implicit none private type :: node type(node), pointer :: next => null() contains final :: dealloc_node end type type, public :: list private type(node), pointer :: head => null() contains procedure :: add procedure, private :: copy generic :: assignment(=) => copy final :: dealloc_list end type contains recursive subroutine dealloc_list(this) type(list), intent(inout) :: this if (associated(this%head)) deallocate(this%head) end subroutine recursive subroutine dealloc_node(this) type(node), intent(inout) :: this if (associated(this%next)) deallocate(this%next) end subroutine recursive function copy_node(n) result(c) type(node), intent(in) :: n type(node), pointer :: c allocate(c, source=n) if (associated(n%next)) c%next => copy_node(n%next) end function subroutine add(this) class(list), intent(inout) :: this type(node), pointer :: n allocate(n) n%next => this%head this%head => n end subroutine recursive subroutine copy(lhs, rhs) class(list), intent(inout) :: lhs class(list), intent(in) :: rhs if (associated(lhs%head)) deallocate(lhs%head) if (associated(rhs%head)) lhs%head => copy_node(rhs%head) end subroutine end module program finalization_02 use finalization_02_mod implicit none call sub() print *, "ok" contains subroutine sub() type(list) :: a call a%add() end subroutine end program lfortran-0.63.0/integration_tests/gpu_metal_157.f900000664000175000017500000000127115174404631022257 0ustar alastairalastairmodule gpu_metal_157_m implicit none type :: tensor_t real :: v(2) contains procedure :: values => get_values end type contains pure function get_values(self) result(r) class(tensor_t), intent(in) :: self real :: r(2) r = self%v end function end module program gpu_metal_157 use gpu_metal_157_m implicit none type(tensor_t) :: y(2) real :: z(2) integer :: pair y(1)%v = [0.5, 1.5] y(2)%v = [2.5, 3.5] z = 0.0 do concurrent (pair = 1:2) associate(yy => y(pair)%values()) z(pair) = yy(1) + yy(2) end associate end do if (abs(z(1) - 2.0) > 1e-6) error stop if (abs(z(2) - 6.0) > 1e-6) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/forallloop_01.f900000664000175000017500000000074615174404631022365 0ustar alastairalastairprogram forallloop_01 implicit none real, dimension(10000) :: a, b, c real :: scalar integer :: i, nsize scalar = 10 nsize = size(a) forall (i = 1:nsize) a(i) = 5 b(i) = 5 end forall call triad(a, b, scalar, c) print *, "End Stream Triad" contains subroutine triad(a, b, scalar, c) real, intent(in) :: a(:), b(:), scalar real, intent(out) :: c(:) integer :: N, i N = size(a) forall (i = 1:N) c(i) = a(i) + scalar * b(i) end subroutine end program lfortran-0.63.0/integration_tests/derived_types_61.f900000664000175000017500000000151715174404631023065 0ustar alastairalastairmodule stdlib_hashmaps_derived_types_61 implicit none type :: open_map_entry_type integer :: slot = 0 end type open_map_entry_type type open_map_entry_ptr type(open_map_entry_type), pointer :: target => null() end type open_map_entry_ptr type :: open_hashmap_type type(open_map_entry_ptr), allocatable :: inverse(:) end type open_hashmap_type end module stdlib_hashmaps_derived_types_61 program derived_types_61 use stdlib_hashmaps_derived_types_61 implicit none type(open_hashmap_type) :: map integer(4) :: inmap = 1 allocate(map % inverse(1)) allocate(map % inverse(1) % target) print *, map % inverse(inmap) % target % slot if (map % inverse(inmap) % target % slot /= 0) error stop deallocate(map % inverse(1) % target) end programlfortran-0.63.0/integration_tests/format_50.f900000664000175000017500000000411415174404631021501 0ustar alastairalastairprogram format_50 use, intrinsic :: iso_fortran_env, only: dp => real64 implicit none real(dp) :: tiny_val, huge_val, test_val character(20) :: str tiny_val = tiny(1.0_dp) huge_val = huge(1.0_dp) test_val = 1.23456789e10_dp ! Test ES format with E3 print "(A,ES11.3E3)", 'tiny =', tiny_val print "(A,ES11.3E3)", 'huge =', huge_val print "(A,ES11.3E3)", 'test =', test_val ! Test EN format with E3 print "(A,EN11.3E3)", 'test =', test_val ! Test E format with E3 print "(A,E11.3E3)", 'test =', test_val ! Test ES format with E4 print "(A,ES12.3E4)", 'tiny =', tiny_val print "(A,ES12.3E4)", 'test =', test_val ! Verify with write statements - check that 'E' is present write(str, "(ES11.3E3)") tiny_val if (index(trim(str), 'E') == 0) error stop "ES11.3E3 tiny missing E" if (trim(adjustl(str)) /= "2.225E-308") error stop "ES11.3E3 tiny failed" write(str, "(ES11.3E3)") huge_val if (index(trim(str), 'E') == 0) error stop "ES11.3E3 huge missing E" if (trim(adjustl(str)) /= "1.798E+308") error stop "ES11.3E3 huge failed" write(str, "(ES11.3E3)") test_val if (index(trim(str), 'E') == 0) error stop "ES11.3E3 test missing E" if (trim(adjustl(str)) /= "1.235E+010") error stop "ES11.3E3 test failed" write(str, "(EN11.3E3)") test_val if (index(trim(str), 'E') == 0) error stop "EN11.3E3 test missing E" if (trim(adjustl(str)) /= "12.346E+009") error stop "EN11.3E3 test failed" write(str, "(E11.3E3)") test_val if (index(trim(str), 'E') == 0) error stop "E11.3E3 test missing E" if (trim(adjustl(str)) /= "0.123E+011") error stop "E11.3E3 test failed" write(str, "(ES12.3E4)") tiny_val if (index(trim(str), 'E') == 0) error stop "ES12.3E4 tiny missing E" if (trim(adjustl(str)) /= "2.225E-0308") error stop "ES12.3E4 tiny failed" write(str, "(ES12.3E4)") test_val if (index(trim(str), 'E') == 0) error stop "ES12.3E4 test missing E" if (trim(adjustl(str)) /= "1.235E+0010") error stop "ES12.3E4 test failed" print *, "PASSED" end program format_50 lfortran-0.63.0/integration_tests/format_77.f900000664000175000017500000000044715174404631021517 0ustar alastairalastairprogram format_77 implicit none logical :: value character(len=10) :: buffer integer :: stat value = .true. stat = 0 write(buffer, "(1x)", iostat=stat) value if (stat == 0) error stop "expected non-zero iostat for excess output list item" end program format_77 lfortran-0.63.0/integration_tests/read_01.f900000664000175000017500000000260615174404631021124 0ustar alastairalastairprogram read_01 character(len=2), target :: str = "42" character(len=2) :: c integer :: i32 integer(8) :: i64 real :: f32 real(8) :: f64 integer, save, dimension(3) :: i32_arr_size3 = [-1,-1,-1] character(20) :: key character(5) :: val character(len=:), allocatable :: al_val character(len=:), allocatable :: al_str character(len=:), pointer :: str_ptr read(str, *) c print *, c if (c /= "42") error stop read(str, *) i32 print *, i32 if (i32 /= 42) error stop read(str, *) i64 print *, i64 if (i64 /= 42) error stop read(str, *) f32 print *, f32 if (f32 /= 42.0) error stop read(str, *) f64 print *, f64 if (f64 /= 42.0) error stop allocate(character(len=2) :: al_str) val = "ab" read(val, *) al_str print *, al_str if (al_str /= "ab") error stop allocate(character(len=2) :: al_val) str = "cd" read(str, *) al_val print *, al_val if (al_val /= "cd") error stop print *, str str = "72" key = "int_read" select case(key) case ("int_read") read(str, *) i32 case ("int_arr_size3_read") read(str, *) i32_arr_size3 end select print *, i32 if (i32 /= 72) error stop str = "20" str_ptr => str read(str_ptr, *) i32 print *, i32 if (i32 /= 20) error stop end program lfortran-0.63.0/integration_tests/subroutines_17.f900000664000175000017500000000074515174404631022604 0ustar alastairalastairprogram subroutines_17 implicit none call recursive_fun contains subroutine chrosen(x) real, intent(in) :: x(:) print *, "Hello from chrosen!", x end subroutine chrosen subroutine OBJ(x) real, intent(in) :: x(:) end subroutine OBJ subroutine lincoa(calfun) procedure(OBJ) :: calfun call calfun([1.0]) end subroutine lincoa subroutine recursive_fun call lincoa(chrosen) end subroutine recursive_fun end programlfortran-0.63.0/integration_tests/lapack_08.f900000664000175000017500000000075115174404631021452 0ustar alastairalastair! MRE: COMMON block + multiple EQUIVALENCE pairs causes symtab error ! When a subroutine has both COMMON and multiple EQUIVALENCE pairs, ! the ASR verifier reports "symbol table was not found in scope" ! Reduced from LAPACK sblat1.f CHECK2 subroutine program lapack_08 integer :: n common /c/ n call sub() print *, 'PASS' end program subroutine sub() integer :: n real :: x(8), a(4), b(4) common /c/ n equivalence (x(1), a(1)), (x(5), b(1)) end subroutine lfortran-0.63.0/integration_tests/logical_kind_01.f900000664000175000017500000000322015174404631022621 0ustar alastairalastairprogram logical_kind_01 use iso_fortran_env, only: int8, int16, int32, int64 implicit none logical(int8) :: a8 logical(int16) :: a16 logical(int32) :: a32 logical(int64) :: a64 integer :: sz a8 = .true. a16 = .true. a32 = .true. a64 = .true. ! Verify logical kinds have correct storage sizes via unformatted stream I/O open(unit=10, file='logical_kind_01.tmp', status='replace', & action='write', access='stream') write(10) a8 close(10) inquire(file='logical_kind_01.tmp', size=sz) if (sz /= 1) error stop open(unit=10, file='logical_kind_01.tmp', status='replace', & action='write', access='stream') write(10) a16 close(10) inquire(file='logical_kind_01.tmp', size=sz) if (sz /= 2) error stop open(unit=10, file='logical_kind_01.tmp', status='replace', & action='write', access='stream') write(10) a32 close(10) inquire(file='logical_kind_01.tmp', size=sz) if (sz /= 4) error stop open(unit=10, file='logical_kind_01.tmp', status='replace', & action='write', access='stream') write(10) a64 close(10) inquire(file='logical_kind_01.tmp', size=sz) if (sz /= 8) error stop ! Verify assignment between different logical kinds a8 = .false. a16 = .false. a32 = .false. a64 = .false. if (a8 .neqv. .false.) error stop if (a16 .neqv. .false.) error stop if (a32 .neqv. .false.) error stop if (a64 .neqv. .false.) error stop ! Clean up open(unit=10, file='logical_kind_01.tmp', status='old') close(10, status='delete') print *, "All tests passed." end program lfortran-0.63.0/integration_tests/formatted_read_05.f900000664000175000017500000000137515174404631023177 0ustar alastairalastairprogram formatted_read_05 ! Test ES and EN format descriptors with exponent width specifier on read implicit none real :: a, b character(len=64) :: line ! Test ES format with e2 exponent width line = " 1.00000000E+00 3.00000000E+00" read(line, "(es15.8e2,1x,es15.8e2)") a, b print *, a, b if (abs(a - 1.0) > 0.001) error stop if (abs(b - 3.0) > 0.001) error stop ! Test EN format with e2 exponent width line = " 1.00000000E+00 5.00000000E+02" read(line, "(en15.8e2,1x,en15.8e2)") a, b print *, a, b if (abs(a - 1.0) > 0.001) error stop if (abs(b - 500.0) > 1.0) error stop ! Test ES format without exponent width (should still work) line = " 2.50000000E+01" read(line, "(es15.8)") a print *, a if (abs(a - 25.0) > 0.01) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/intrinsics_270.f900000664000175000017500000001201215174404631022456 0ustar alastairalastairprogram intrinsics_270 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp) :: arg_x(15) real(sp) :: arg_y(15) real(dp) :: res_x(15) real(sp) :: res_y(15) real(dp) :: expected_res_x(15) real(sp) :: expected_res_y(15) real(dp) :: expected_x(10) real(sp) :: expected_y(10) real(dp) :: a = 0.5178181202_dp real(sp) :: b = -0.072816_sp real(dp) :: c = -0.5178181202_dp real(sp) :: d = 0.072816_sp real(dp), parameter :: res_dp(10) = atan([-0.62818828_dp, -0.51725372_dp, -0.29257208_dp, & 0.62818828_dp, 0.51725372_dp, 0.29257208_dp, 1.00_dp, 0.829362821_dp, 0.952716192_dp, -0.241626228_dp]) real(sp), parameter :: res_sp(10) = atan([-0.62818828_sp, -0.51725372_sp, -0.29257208_sp, & 0.62818828_sp, 0.51725372_sp, 0.29257208_sp, 1.00_sp, 0.829362821_sp, 0.952716192_sp, -0.241626228_sp]) expected_x = [-0.56088872649127330_dp, -0.47735511827211041_dp, -0.28462833491299150_dp, & 0.56088872649127330_dp, 0.47735511827211041_dp, 0.28462833491299150_dp, 0.78539816339744828_dp, & 0.69239044268167327_dp, 0.76118851632111739_dp, -0.23708207111515284_dp] expected_y = [-0.560888708_sp, -0.477355093_sp, -0.284628332_sp, & 0.560888708_sp, 0.477355093_sp, 0.284628332_sp, 0.785398185_sp, & 0.692390442_sp, 0.761188507_sp, -0.237082079_sp] arg_x = [-0.67922251126_dp, -0.54363892699177885_dp, -0.29691551032790681_dp, & 0.67922251126401767_dp, 0.54363892699177885_dp, 0.29691551032790681_dp, 0.5707963267948966_dp, & 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp, -0.7281628262782_dp, & 0.5707963267948966_dp, 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp] arg_y = [-0.679222465_sp, -0.543638885_sp, -0.296915501_sp, & 0.679222465_sp, 0.543638885_sp, 0.296915501_sp, 0.57079637_sp, & 0.077966249_sp, 0.262053013_sp, -0.244041398_sp, -0.7281628262782_sp, & 0.57079637_sp, 0.077966249_sp, 0.262053013_sp, -0.244041398_sp] res_x = atan(arg_x) res_y = atan(arg_y) expected_res_x = [-0.59664481328347907_dp, -0.49794635545452487_dp, -0.28862459062845508_dp, & 0.59664481328622843_dp, 0.49794635545452487_dp, 0.28862459062845508_dp, 0.51866936925501661_dp, & 7.7808866037245739E-002_dp, 0.25629014680688234_dp, -0.23936274280729375_dp, & -0.62937821282601869_dp, 0.51866936925501661_dp, 7.7808866037245739E-002_dp, & 0.25629014680688234_dp, -0.23936274280729375_dp] expected_res_y = [-0.596644759_sp, -0.497946322_sp, -0.288624585_sp, & 0.596644759_sp, 0.497946322_sp, 0.288624585_sp, 0.518669426_sp, & 7.78088495E-02_sp, 0.256290108_sp, -0.239362746_sp, & -0.629378200_sp, 0.518669426_sp, 7.78088495E-02_sp, & 0.256290108_sp, -0.239362746_sp] do i = 1, size(res_dp) print *, res_dp(i) if (abs(res_dp(i) - expected_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_x) print *, res_x(i) if (abs(res_x(i)) - abs(expected_res_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_y(i)) > 1e-5) error stop end do do i = 1, size(res_y) print *, res_y(i) if (abs(res_y(i)) - abs(expected_res_y(i)) > 1e-5) error stop end do print *, atan(a) if (abs(atan(a)) - 0.47780028380709660_dp > 1e-12) error stop print *, atan(0.5178181202_dp) if (abs(atan(0.5178181202_dp) - 0.47780028380709660_dp) > 1e-12) error stop print *, atan(b) if (atan(b) - (-7.26877153E-02_sp) > 1e-5) error stop print *, atan(-0.072816_sp) if (atan(-0.072816_sp) - (-7.26877153E-02_sp) > 1e-5) error stop print *, atan(c) if (atan(c) - (-0.47780028380709660_dp) > 1e-12) error stop print *, atan(-0.5178181202_dp) if (atan(-0.5178181202_dp) - (-0.47780028380709660_dp) > 1e-12) error stop print *, atan(d) if (atan(d) - (7.26877153E-02_sp) > 1e-5) error stop print *, atan(0.072816_sp) if (atan(0.072816_sp) - (7.26877153E-02_sp) > 1e-5) error stop a = -0.271927291_dp b = -0.6382728_sp c = 0.271927291_dp d = 0.6382728_sp print *, atan(a) if (abs(atan(a) - (-0.26550729967368875_dp)) > 1e-12) error stop print *, atan(-0.271927291_dp) if (abs(atan(-0.271927291_dp) - (-0.26550729967368875_dp)) > 1e-12) error stop print *, atan(b) if (atan(b) - ( -0.568086922_sp) > 1e-5) error stop print *, atan(-0.6382728_sp) if (atan(-0.6382728_sp) - (-0.568086922_sp) > 1e-5) error stop print *, atan(c) if (atan(c) - (0.26550729967368875_dp) > 1e-12) error stop print *, atan(0.271927291_dp) if (atan(0.271927291_dp) - (0.26550729967368875_dp) > 1e-12) error stop print *, atan(d) if (atan(d) - (0.568086922_sp) > 1e-5) error stop print *, atan(0.6382728_sp) if (atan(0.6382728_sp) - (0.568086922_sp) > 1e-5) error stop end programlfortran-0.63.0/integration_tests/intrinsics_189.f900000664000175000017500000000364515174404631022503 0ustar alastairalastairprogram intrinsics_189 character(7) :: fortran = "FORTRAN" character(2) :: ao = "AO" character(3) :: c_plus_plus = "C++" integer, parameter :: i1 = scan("FORTRAN", "AO") integer, parameter :: i2 = scan("FORTRAN", "AO", kind = 4) integer, parameter :: i3 = scan("FORTRAN", "AO", .TRUE., 8) integer, parameter :: i4 = scan("FORTRAN", "C++") integer, parameter :: ar1(2) = scan(["LFORTRAN", "GFORTRAN"], ["AO", "AO"]) integer, parameter :: ar2(2) = scan(["LFORTRAN", "GFORTRAN"], ["LO", "TR"], kind = 4) character(8) :: arr1(2) character(2) :: arr2(2) character(4) :: arr3(3) character(2) :: arr4(3) arr1 = ["LFORTRAN", "GFORTRAN"] arr2 = ["AO", "AO"] arr3 = ["LFOR", "TRAN", "GFOR"] arr4 = ["LO", "TR", "AN"] print*, i1 if (i1 /= 2) error stop print*, i2 if (i2 /= 2) error stop print*, i3 if (i3 /= 6_8) error stop print*, i4 if (i4 /= 0) error stop print*, ar1 if (any(ar1 /= [3, 3])) error stop print*, ar2 if (any(ar2 /= [1, 4])) error stop print*, scan("FORTRAN", "AO", kind = 4) if (scan("fortran", "ao", kind = 4) /= 2) error stop print*, scan("FORTRAN", "AO", .TRUE., 8) if (scan("fortran", "ao", .true., 8) /= 6_8) error stop print*, scan("FORTRAN", "C++") if (scan("fortran", "c_plus_plus") /= 0) error stop print*, scan(fortran, ao, kind = 4) if (scan(fortran, ao, kind = 4) /= 2) error stop print*, scan(fortran, ao, .TRUE., 8) if (scan(fortran, ao, .true., 8) /= 6_8) error stop print*, scan(fortran, c_plus_plus) if (scan(fortran, c_plus_plus) /= 0) error stop print*, scan(arr1, arr2) if (any(scan(arr1, arr2) /= [3, 3])) error stop print*, scan(arr1, arr2, kind = 4) if (any(scan(arr1, arr2, kind = 4) /= [3, 3])) error stop print*, scan(arr3, arr4) if (any(scan(arr3, arr4) /= [1, 1, 0])) error stop end program lfortran-0.63.0/integration_tests/modules_62_terminal.f900000664000175000017500000000146315174404631023563 0ustar alastairalastairmodule modules_62_terminal implicit none private public :: toml_terminal, ansi_code ! Nested type type :: ansi_code integer :: style = -1 integer :: bg = -1 integer :: fg = -1 end type ansi_code ! Main type with multiple ansi_code components and default init type :: toml_terminal type(ansi_code) :: reset = ansi_code() type(ansi_code) :: bold = ansi_code() end type toml_terminal interface toml_terminal module procedure :: new_terminal end interface toml_terminal contains pure function new_terminal(use_color) result(new) logical, intent(in) :: use_color type(toml_terminal) :: new if (use_color) then new%reset = ansi_code(0, -1, -1) new%bold = ansi_code(1, -1, -1) end if end function new_terminal end module modules_62_terminal lfortran-0.63.0/integration_tests/return_02.f900000664000175000017500000000115315174404631021525 0ustar alastairalastairmodule many_returns implicit none contains integer function b(a) integer :: a, e print *, "calling b" b = d(a) contains integer function d(i) integer :: i if (i .EQ. 1) then d = 1 return end if if (i .EQ. 2) then d = 2 return end if if (i .EQ. 3) then d = 3 return end if d = 999 end function d end function b end module program returns use many_returns implicit none integer c c = b(1) print *, c c = b(2) print *, c c = b(3) print *, c c = b(4) print *, c end program lfortran-0.63.0/integration_tests/string_64.f900000664000175000017500000000164115174404631021526 0ustar alastairalastairprogram string_64 character(len=1), parameter :: NUL = achar(int(z'00')) !! Null character(len=1), parameter :: TAB = achar(int(z'09')) !! Horizontal tab character(len=1), parameter :: LF = achar(int(z'0A')) !! NL line feed, new line character(len=1), parameter :: VT = achar(int(z'0B')) !! Vertical tab character(len=1), parameter :: FF = achar(int(z'0C')) !! NP form feed, new page character(len=1), parameter :: CR = achar(int(z'0D')) !! Carriage return character(len=5) :: testMdata(2,2) testMdata = reshape( [ character(len=5) :: & TAB, & "X"//TAB//"Y", & "YES", & "NO" ], [2,2] ) if (testMdata(1,1) /= TAB .or. testMdata(1,2) /= "YES") error stop if (testMdata(2,1) /= "X"//TAB//"Y" .or. testMdata(2,2) /= "NO") error stop print *, len(NUL//TAB//LF//VT//FF//CR) if(len(NUL//TAB//LF//VT//FF//CR) /= 6) error stop end program lfortran-0.63.0/integration_tests/implicit_interface_27.f900000664000175000017500000000034115174404631024045 0ustar alastairalastairprogram implicit_interface_27 implicit none complex :: c complex, external :: test_complex c = test_complex() if (abs(real(c) - 21.0) > 1e-6) error stop if (abs(aimag(c) - (-3.0)) > 1e-6) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/print_02.f900000664000175000017500000000036115174404631021342 0ustar alastairalastairprogram print_02 implicit none integer :: x character(len=5) :: f = "(5i3)" x = (2+3)*5 print "(5i3)", x, 1, 3, x, (2+3)*5+x write(*,"(5i3)") x, 1, 3, x, (2+3)*5+x print f, x, 1, 3, x, (2+3)*5+x write(*,f) x, 1, 3, x, (2+3)*5+x end program lfortran-0.63.0/integration_tests/multiple_objects_args.f900000664000175000017500000000067515174404631024275 0ustar alastairalastairprogram main implicit none type :: Circle real :: radius = 1.0 end type Circle logical :: was_called = .false. call print_radius(Circle(1.5), Circle()) if (.not. was_called) then error stop end if contains subroutine print_radius(m, n) type(Circle), intent(in) :: m, n print *, m%radius, n%radius was_called = .true. end subroutine end program main lfortran-0.63.0/integration_tests/read_32.f900000664000175000017500000000053215174404631021124 0ustar alastairalastairprogram daio3 implicit none integer, parameter :: unit_no = 24 integer :: i, i1 open (unit_no, file='fort.24', access='direct', recl=132) do i = 1, 10 write (unit_no, rec=i) i end do do i = 1, 10 read (unit_no, rec=i) i1 if (i1 /= i) error stop end do close (unit_no) print *, "all tests passed" end programlfortran-0.63.0/integration_tests/logical_kind_05.f900000664000175000017500000001152315174404631022632 0ustar alastairalastair program logical_kind_04 implicit none integer, parameter :: lp1 = 1, lp2 = 2, lp4 = 4, lp8 = 8 ! --- Numeric kind suffixes --- logical(1) :: n1t, n1f logical(2) :: n2t, n2f logical(4) :: n4t, n4f logical(8) :: n8t, n8f ! --- Named-parameter kind suffixes --- logical(lp1) :: p1t, p1f logical(lp2) :: p2t, p2f logical(lp4) :: p4t, p4f logical(lp8) :: p8t, p8f ! --- Capitalization variants (kind 4) --- logical(4) :: cap1, cap2, cap3, cap4, cap5, cap6 ! ===== Section 1: numeric kind literals ===== n1t = .true._1 n1f = .false._1 n2t = .true._2 n2f = .false._2 n4t = .true._4 n4f = .false._4 n8t = .true._8 n8f = .false._8 ! Check truth values if (n1t .neqv. .true.) error stop if (n1f .neqv. .false.) error stop if (n2t .neqv. .true.) error stop if (n2f .neqv. .false.) error stop if (n4t .neqv. .true.) error stop if (n4f .neqv. .false.) error stop if (n8t .neqv. .true.) error stop if (n8f .neqv. .false.) error stop ! Check kinds via storage_size (returns size in bits) if (storage_size(n1t) /= 8) error stop if (storage_size(n1f) /= 8) error stop if (storage_size(n2t) /= 16) error stop if (storage_size(n2f) /= 16) error stop if (storage_size(n4t) /= 32) error stop if (storage_size(n4f) /= 32) error stop if (storage_size(n8t) /= 64) error stop if (storage_size(n8f) /= 64) error stop ! Check kind() of the literal itself if (kind(.true._1) /= 1) error stop if (kind(.false._1) /= 1) error stop if (kind(.true._2) /= 2) error stop if (kind(.false._2) /= 2) error stop if (kind(.true._4) /= 4) error stop if (kind(.false._4) /= 4) error stop if (kind(.true._8) /= 8) error stop if (kind(.false._8) /= 8) error stop ! ===== Section 2: named-parameter kind literals ===== p1t = .true._lp1 p1f = .false._lp1 p2t = .true._lp2 p2f = .false._lp2 p4t = .true._lp4 p4f = .false._lp4 p8t = .true._lp8 p8f = .false._lp8 ! Check truth values if (p1t .neqv. .true.) error stop if (p1f .neqv. .false.) error stop if (p2t .neqv. .true.) error stop if (p2f .neqv. .false.) error stop if (p4t .neqv. .true.) error stop if (p4f .neqv. .false.) error stop if (p8t .neqv. .true.) error stop if (p8f .neqv. .false.) error stop ! Check kinds via storage_size if (storage_size(p1t) /= 8) error stop if (storage_size(p1f) /= 8) error stop if (storage_size(p2t) /= 16) error stop if (storage_size(p2f) /= 16) error stop if (storage_size(p4t) /= 32) error stop if (storage_size(p4f) /= 32) error stop if (storage_size(p8t) /= 64) error stop if (storage_size(p8f) /= 64) error stop ! Check kind() of named-parameter literals if (kind(.true._lp1) /= 1) error stop if (kind(.false._lp1) /= 1) error stop if (kind(.true._lp2) /= 2) error stop if (kind(.false._lp2) /= 2) error stop if (kind(.true._lp4) /= 4) error stop if (kind(.false._lp4) /= 4) error stop if (kind(.true._lp8) /= 8) error stop if (kind(.false._lp8) /= 8) error stop ! ===== Section 3: capitalization variants ===== cap1 = .true._4 cap2 = .TRUE._4 cap3 = .True._4 cap4 = .false._4 cap5 = .FALSE._4 cap6 = .False._4 if (cap1 .neqv. .true.) error stop if (cap2 .neqv. .true.) error stop if (cap3 .neqv. .true.) error stop if (cap4 .neqv. .false.) error stop if (cap5 .neqv. .false.) error stop if (cap6 .neqv. .false.) error stop ! Also with named parameter kinds and mixed case if (.TRUE._lp1 .neqv. .true.) error stop if (.True._lp2 .neqv. .true.) error stop if (.FALSE._lp1 .neqv. .false.) error stop if (.False._lp2 .neqv. .false.) error stop if (kind(.TRUE._lp8) /= 8) error stop if (kind(.False._lp1) /= 1) error stop ! ===== Section 4: cross-kind assignment ===== n8t = .true._1 if (n8t .neqv. .true.) error stop if (storage_size(n8t) /= 64) error stop n1f = .false._8 if (n1f .neqv. .false.) error stop if (storage_size(n1f) /= 8) error stop print *, "All logical_kind_04 tests passed." end program lfortran-0.63.0/integration_tests/intrinsics_405.f900000664000175000017500000000250015174404631022457 0ustar alastairalastairprogram intrinsics_405 implicit none call print_any(" Hello World ") contains subroutine print_any(generic) class(*), intent(in) :: generic character(len = 15) :: a, b, c integer :: d,e select type (generic) type is (character(len=*)) a = trim(generic) print *, trim(generic) if (trim(generic) /= " Hello World ") error stop b = adjustl(generic) print *, adjustl(generic) if (adjustl(generic) /= "Hello World ") error stop c = adjustr(generic) print *, adjustr(generic) if (adjustr(generic) /= " Hello World") error stop d = len_trim(generic) print *, len_trim(generic) if (len_trim(generic) /= 13) error stop e = len(generic) print *, len(generic) if (len(generic) /= 15) error stop end select print *, a if (a /= " Hello World ") error stop print *, b if (b /= "Hello World ") error stop print *, c if (c /= " Hello World") error stop print *, d if (d /= 13) error stop print *, e if (e /= 15) error stop end subroutine print_any end program intrinsics_405lfortran-0.63.0/integration_tests/test_iso_c_binding_constants.f900000664000175000017500000000407615174404631025635 0ustar alastairalastairprogram test_iso_c_binding_constants use iso_c_binding print *, c_int8_t if (c_int8_t /= 1) error stop print *, c_int16_t if (c_int16_t /= 2) error stop print *, c_int32_t if (c_int32_t /= 4) error stop print *, c_int64_t if (c_int64_t /= 8) error stop print *, c_int if (c_int /= 4) error stop print *, c_short if (c_short /= 2) error stop print *, c_long if (c_long /= 8) error stop print *, c_long_long if (c_long_long /= 8) error stop print *, c_size_t if (c_size_t /= 8) error stop print *, c_float if (c_float /= 4) error stop print *, c_double if (c_double /= 8) error stop ! Currently unsupported ! print *, c_long_double ! if (c_long_double /= 10) error stop print *, c_float_complex if (c_float_complex /= 4) error stop print *, c_double_complex if (c_double_complex /= 8) error stop ! Currently unsupported ! print *, c_long_double_complex ! if (c_long_double_complex /= 10) error stop print *, c_bool if (c_bool /= 1) error stop print *, c_char if (c_char /= 1) error stop print *, c_signed_char if (c_signed_char /= 1) error stop print *, c_intptr_t if (c_intptr_t /= 8) error stop print *, c_ptrdiff_t if (c_ptrdiff_t /= 8) error stop print *, c_null_char if (c_null_char /= char(0)) error stop print *, c_new_line if (c_new_line /= char(10)) error stop print *, "c_intmax_t = ", c_intmax_t if (c_intmax_t /= 8) error stop print *, "c_alert = ", c_alert if (c_alert /= char(7)) error stop print *, "c_backspace = ", c_backspace if (c_backspace /= char(8)) error stop print *, "c_form_feed = ", c_form_feed if (c_form_feed /= char(12)) error stop print *, "c_carriage_return = ", c_carriage_return if (c_carriage_return /= char(13)) error stop print *, "c_horizontal_tab = ", c_horizontal_tab if (c_horizontal_tab /= char(9)) error stop print *, "c_vertical_tab = ", c_vertical_tab if (c_vertical_tab /= char(11)) error stop end program test_iso_c_binding_constants lfortran-0.63.0/integration_tests/block_15.f900000664000175000017500000000023315174404631021302 0ustar alastairalastairprogram block_15 implicit none block use block_15_mod, only: x if (x /= 42) error stop end block print *, "ok" end program lfortran-0.63.0/integration_tests/string_24.f900000664000175000017500000000033215174404631021516 0ustar alastairalastairprogram string_24 type :: string character(:), allocatable :: s end type type(string) :: z(5) allocate(character(1) :: z(1)%s) z(1)%s(1:1) = "x" print *, z(1)%s(1:1) if (z(1)%s(1:1) /= "x") error stop end program lfortran-0.63.0/integration_tests/separate_compilation_46a.f900000664000175000017500000000104115174404631024555 0ustar alastairalastairmodule separate_compilation_46a_types implicit none type :: obj_t integer :: val = 0 contains final :: obj_destroy end type obj_t contains subroutine obj_destroy(self) type(obj_t), intent(inout) :: self self%val = -1 end subroutine obj_destroy end module separate_compilation_46a_types module separate_compilation_46a_global use separate_compilation_46a_types, only: obj_t implicit none class(obj_t), allocatable, save :: global_obj end module separate_compilation_46a_global lfortran-0.63.0/integration_tests/openmp_40.f900000664000175000017500000000027015174404631021505 0ustar alastairalastairprogram openmp_40 integer :: i, j, res=0 do concurrent ( i =1:4, j = 1:3 ) reduce(+:res) print *,i res=res+1 end do print *,"res =",res if ( res /= 12 ) error stop end programlfortran-0.63.0/integration_tests/while_03.f900000664000175000017500000000057715174404631021330 0ustar alastairalastair program while_03 implicit none integer :: n, i, j i = 0 n = 2 do while ( n >= 2 ) if( n >= i ) then if( n >= i ) then do j= i+1,n i = j + i end do endif n = n - 1 else i = j + i endif end do return end lfortran-0.63.0/integration_tests/array_reshape_pad_01.f900000664000175000017500000000120115174404631023650 0ustar alastairalastairprogram array_reshape_pad_01 implicit none integer :: original(4) = [1, 2, 3, 4] integer :: reshaped(2, 3) integer :: i, j reshaped = reshape(original, shape=[2, 3], pad=[0]) if (reshaped(1, 1) /= 1) error stop if (reshaped(2, 1) /= 2) error stop if (reshaped(1, 2) /= 3) error stop if (reshaped(2, 2) /= 4) error stop if (reshaped(1, 3) /= 0) error stop if (reshaped(2, 3) /= 0) error stop ! Test with multi-element pad that cycles reshaped = reshape(original, shape=[2, 3], pad=[-1, -2]) if (reshaped(1, 3) /= -1) error stop if (reshaped(2, 3) /= -2) error stop end program lfortran-0.63.0/integration_tests/intrinsics_62.f900000664000175000017500000000202115174404631022374 0ustar alastairalastairprogram intrinsics_62 implicit none type t integer :: x, y end type t integer :: x1(2), res_01(1) integer(8) :: res_02(2) integer, allocatable :: x2(:), x3(:, :) real :: y(3, 4) character(3) :: z type(t) :: type_1(1) type(t), allocatable :: type_2(:) res_01 = shape(x1) if (res_01(1) /= 2) error stop allocate(x2(3)) res_01 = shape(x2) if (res_01(1) /= 3) error stop allocate(x3(10, 11)) res_02 = shape(x3, 8) if (res_02(1) /= 10 .and. res_02(2) /= 11) error stop res_02 = shape(y, kind=8) if (res_02(1) /= 3 .and. res_02(2) /= 4) error stop res_01 = shape(type_1) if (res_01(1) /= 1) error stop ! TODO: Move type definition to global scope (ASR refactoring) ! allocate(type_2(4)) ! res_01 = shape(type_2) ! if (res_01(1) /= 4) error stop ! TODO: Support size(x), where x is rank 0 if (size(shape(z)) /= 0) error stop end program intrinsics_62 lfortran-0.63.0/integration_tests/allocate_44.f900000664000175000017500000000056115174404631022002 0ustar alastairalastairprogram allocate_44 implicit none integer :: a(3) = [10, 20, 30] real, allocatable :: b(:) ! Test allocate with elemental function source expression allocate(b, source=real(a)) if (size(b) /= 3) error stop if (abs(b(1) - 10.0) > 1e-6) error stop if (abs(b(2) - 20.0) > 1e-6) error stop if (abs(b(3) - 30.0) > 1e-6) error stop print *, "ok" end program allocate_44 lfortran-0.63.0/integration_tests/openmp_bindc_01.f900000664000175000017500000000322015174404631022637 0ustar alastairalastairmodule module_openmp_bindc_01 use iso_c_binding implicit none interface subroutine GOMP_parallel (fn, data, num_threads, flags) bind (C, name="GOMP_parallel") import :: c_funptr, c_ptr, c_int type(c_funptr), value :: fn type(c_ptr), value :: data integer(c_int), value :: num_threads integer(c_int), value :: flags end subroutine subroutine GOMP_barrier() bind(C, name="GOMP_barrier") end subroutine subroutine GOMP_critical_start() bind(C, name="GOMP_critical_start") end subroutine subroutine GOMP_critical_end() bind(C, name="GOMP_critical_end") end subroutine function omp_get_max_threads() bind(c, name="omp_get_max_threads") import :: c_int integer(c_int) :: omp_get_max_threads end function omp_get_max_threads function omp_get_thread_num() bind(c, name="omp_get_thread_num") import :: c_int integer(c_int) :: omp_get_thread_num end function omp_get_thread_num subroutine omp_set_num_threads(n) bind(c, name="omp_set_num_threads") import :: c_int integer(c_int), value :: n end subroutine omp_set_num_threads end interface end module subroutine lcompilers_function() bind(c) use module_openmp_bindc_01 implicit none integer(c_int) :: thread_id thread_id = omp_get_thread_num() print *, "Hello from thread ", thread_id if (thread_id >= 4) error stop end subroutine program openmp_bindc_01 use module_openmp_bindc_01 implicit none interface subroutine lcompilers_function() bind(c) end subroutine end interface integer :: max_threads call omp_set_num_threads(4) max_threads = omp_get_max_threads() if (max_threads /= 4) error stop print *, "Max threads: ", max_threads call GOMP_parallel(c_funloc(lcompilers_function), c_null_ptr, max_threads, 0) end program lfortran-0.63.0/integration_tests/file_16.f900000664000175000017500000000043315174404631021132 0ustar alastairalastairprogram file_16 implicit none integer :: j = 11 character(len=10) :: str, x str = "LFortran" open(j, file="file_16_test.txt") write(j, *) str str = "" rewind(j) read(j, *) str if (str /= "LFortran") error stop close(j) end program file_16 lfortran-0.63.0/integration_tests/arrays_107.f900000664000175000017500000000061015174404631021572 0ustar alastairalastairprogram arrays_107 implicit none real :: x(3, 1) = 0.0 call testsub(x(1, 1)) if (abs(x(1, 1) - 1.0/7.0) > 1e-6) error stop if (abs(x(2, 1) - 1.0/7.0) > 1e-6) error stop if (abs(x(3, 1) - 1.0/7.0) > 1e-6) error stop contains subroutine testsub(x) real, intent(inout) :: x(3, *) x(:,1) = [1,1,1]/7.0 end subroutine testsub end program arrays_107 lfortran-0.63.0/integration_tests/format_23.f900000664000175000017500000000154315174404631021504 0ustar alastairalastairprogram format_23 implicit none real(4) :: x1, y1, z1 real(8) :: x8, y8, z8 x1 = 3.14 y1 = -2.5 z1 = 0.0 x8 = 3.14_8 y8 = -2.5_8 z8 = 0.0_8 print *, "Binary format for real(4):" print '(a, b0)', "x1 (3.14): ", x1 print '(a, b10)', "x1 (3.14): ", x1 print '(a, b32)', "x1 (3.14): ", x1 print '(a, b0)', "y1 (-2.5): ", y1 print '(a, b10)', "y1 (-2.5): ", y1 print '(a, b32)', "y1 (-2.5): ", y1 print '(a, b0)', "z1 (0.0): ", z1 print '(a, b32)', "z1 (0.0): ", z1 print *, "Binary format for real(8):" print '(a, b0)', "x8 (3.14): ", x8 print '(a, b10)', "x8 (3.14): ", x8 print '(a, b64)', "x8 (3.14): ", x8 print '(a, b0)', "y8 (-2.5): ", y8 print '(a, b10)', "y8 (-2.5): ", y8 print '(a, b64)', "y8 (-2.5): ", y8 print '(a, b0)', "z8 (0.0): ", z8 print '(a, b64)', "z8 (0.0): ", z8 end program format_23 lfortran-0.63.0/integration_tests/openmp_70.f900000664000175000017500000000103115174404631021504 0ustar alastairalastair! For OMP C Target Constructs Dump program openmp_70 implicit none real :: a(1000000), b(1000000) integer :: i b=5 a=0 !$omp target map(tofrom:a, b) !$omp teams !$omp distribute parallel do do i = 1, 1000000 a(i) = i + b(i)*340 end do !$omp end distribute parallel do !$omp end teams !$omp end target print*, a(5), b(5) if(a(5) /= 1705) error stop if(b(5) /= 5) error stop end program openmp_70lfortran-0.63.0/integration_tests/implicit_interface_35.f900000664000175000017500000000105315174404631024045 0ustar alastairalastairprogram implicit_interface_35 procedure(), pointer :: ifunc => null() procedure(), pointer :: xfunc => null() ifunc => itriple if (ifunc(4) /= 12) error stop print *, ifunc(4) xfunc => xhalf if (abs(xfunc(6.0) - 3.0) > 1.0e-6) error stop print *, xfunc(6.0) contains function itriple(n) integer, intent(in) :: n integer :: itriple itriple = n * 3 end function function xhalf(x) real, intent(in) :: x real :: xhalf xhalf = x / 2.0 end function end program lfortran-0.63.0/integration_tests/submodule_43.f900000664000175000017500000000227115174404631022214 0ustar alastairalastair! Test: pass_array_by_data with nested internal subroutines in a ! submodule that call each other with derived-type assumed-shape arrays. module submodule_43_m implicit none type :: t integer :: val end type interface module subroutine my_sort(array) type(t), intent(inout) :: array(0:) end subroutine end interface end module submodule(submodule_43_m) submodule_43_s implicit none contains module subroutine my_sort(array) type(t), intent(inout) :: array(0:) call b(array) contains subroutine a(array) type(t), intent(inout) :: array(0:) integer :: tmp tmp = array(0)%val array(0)%val = array(1)%val array(1)%val = tmp end subroutine subroutine b(array) type(t), intent(inout) :: array(0:) call a(array) end subroutine end subroutine end submodule program submodule_43 use submodule_43_m implicit none type(t) :: arr(0:1) arr(0)%val = 10 arr(1)%val = 20 call my_sort(arr) if (arr(0)%val /= 20) error stop if (arr(1)%val /= 10) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/intrinsics_33.f900000664000175000017500000000020715174404631022376 0ustar alastairalastairprogram intrinsics_29 implicit none print *, 'This is record 1.'//new_line('A')//'This is record 2.' end program intrinsics_29 lfortran-0.63.0/integration_tests/complex_22.f900000664000175000017500000000063315174404631021661 0ustar alastairalastairprogram complex_22 implicit none complex, pointer :: ptr_complex4 complex(8), pointer :: ptr_complex8 complex, target :: complex4_1 complex(8), target :: complex8_1 complex8_1 = (1, 2) complex4_1 = (1, 2) ptr_complex8 => complex8_1 ptr_complex4 => complex4_1 print *, cmplx(ptr_complex4, kind=8) if (ptr_complex8 /= cmplx(ptr_complex4, kind=8)) error stop end program complex_22lfortran-0.63.0/integration_tests/gpu_metal_170.f900000664000175000017500000000164115174404631022253 0ustar alastairalastair! Test: merge() with array-section comparison inside struct constructor ! in do concurrent, compiled with --gpu=metal. ! Exercises VLA workspace dimension resolution through Allocate statements ! and correct Metal codegen for struct member writes via decomposed buffers. program gpu_metal_170 implicit none type :: t real, allocatable :: v(:) end type type(t) :: arr(2) real :: x(2, 2) integer :: i x = 0.3 ! Pre-allocate struct members so Metal decomposed buffers are set up do i = 1, 2 allocate(arr(i)%v(2)) arr(i)%v = 0.0 end do do concurrent(i=1:2) arr(i) = t(merge(1.0, 0.0, x(:,i) < 0.5)) end do ! All x values are 0.3 < 0.5, so merge returns 1.0 for all if (abs(arr(1)%v(1) - 1.0) > 1e-5) error stop if (abs(arr(1)%v(2) - 1.0) > 1e-5) error stop if (abs(arr(2)%v(1) - 1.0) > 1e-5) error stop if (abs(arr(2)%v(2) - 1.0) > 1e-5) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/save_03.f900000664000175000017500000000277515174404631021160 0ustar alastairalastairsubroutine save_sub() integer :: i, j save real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) end subroutine subroutine save_nested_sub() integer :: i, j contains subroutine save_sub() save real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) end subroutine real function save_func() save real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) end function end subroutine real function save_func() integer :: i, j save real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) end function real function save_nested_func() integer :: i, j contains real function save_func() save real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) end function subroutine save_sub() save real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) end subroutine end function module save_module_03 integer :: i, j save real :: k, l contains subroutine save_sub_mod() integer :: i, j save real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) end subroutine real function save_func_mod() integer :: i, j save real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) end function end module program save_03 integer :: i, j save real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) end program lfortran-0.63.0/integration_tests/intrinsics_297.f900000664000175000017500000000255215174404631022477 0ustar alastairalastairprogram intrinsics_297 use iso_fortran_env, only: dp => real64 integer :: x, y, z integer(dp) :: a, b, c integer, parameter :: x1 = poppar(44) integer(8), parameter :: y1 = poppar(5468272828_8) integer, parameter :: z1 = poppar(-501) integer(8), parameter :: w1 = poppar(-3526282829_8) integer, parameter :: ar1(3) = poppar([83983, 5468272, -3526282]) integer(8), parameter :: ar2(3) = poppar([83983_8, 5468272828_8, -3526282829_8]) integer :: arr1(3) = [83983, 5468272, -3526282] integer(8) :: arr2(3) = [83983_8, 5468272828_8, -3526282829_8] print *, x1 if(x1 /= 1) error stop print *, y1 if(y1 /= 1) error stop print *, z1 if(z1 /= 0) error stop print *, w1 if(w1 /= 0) error stop print *, ar1 if(any(ar1 /= [1, 0, 0])) error stop print *, ar2 if(any(ar2 /= [1, 1, 0])) error stop print *, poppar(arr1) if (any(poppar(arr1) /= [1, 0, 0])) error stop print *, poppar(arr2) if (any(poppar(arr2) /= [1, 1, 0])) error stop x = 44 y = -501 z = 0 a = 5468272828_dp b = -3526282829_dp c = 83983_dp print *, poppar(x) if(poppar(x) /= 1) error stop print *, poppar(44) if(poppar(44) /= 1) error stop print *, poppar(y) if(poppar(y) /= 0) error stop print *, poppar(-501) if(poppar(-501) /= 0) error stop end programlfortran-0.63.0/integration_tests/automatic_allocation_01.f900000664000175000017500000000012615174404631024377 0ustar alastairalastairprogram main integer,allocatable:: x(:) x = [1,2,3,4] print *,x end program lfortran-0.63.0/integration_tests/associate_43.f900000664000175000017500000000071615174404631022172 0ustar alastairalastairprogram associate_43 implicit none integer :: b ! Test: array constructor with nested ACs containing implied-do ! whose bounds are runtime (associate) variables associate(n => 2) associate(arr => [ [(1, b=1,n)], [(2, b=1,n)] ]) if (size(arr) /= 4) error stop if (arr(1) /= 1) error stop if (arr(2) /= 1) error stop if (arr(3) /= 2) error stop if (arr(4) /= 2) error stop end associate end associate end program lfortran-0.63.0/integration_tests/intrinsics_223.f900000664000175000017500000000364215174404631022465 0ustar alastairalastairprogram intrinsics_223 use iso_fortran_env, only: dp=>real64, sp=>real32 implicit none real(4) :: x1 = 1.0_4, x2 = 42.0_4 real(8) :: y1 = 1.0_8, y2 = 42.0_8 real :: s1 = 1.0_4, s2 = -1.0_4 real(4), parameter :: x3 = 1.0_sp, x4 = 42.0_sp real(8), parameter :: y3 = 1.0_dp, y4 = 42.0_dp real, parameter :: s3 = 1.0, s4 = -1.0 print*, nearest(x1, s1) if (abs(nearest(x1, s1) - 1.00000012_sp) > 1e-6) error stop print*, nearest(y1, s1) if (abs(nearest(y1, s1) - 1.0000000000000002_dp) > 1e-12) error stop print*, nearest(x2, s1) if (abs(nearest(x2, s1) - 42.0000038_sp) > 1e-6) error stop print*, nearest(y2, s1) if (abs(nearest(y2, s1) - 42.000000000000007_dp) > 1e-12) error stop print*, nearest(x1, s2) if (abs(nearest(x1, s2) - 0.999999940_sp) > 1e-6) error stop print*, nearest(y1, s2) if (abs(nearest(y1, s2) - 0.99999999999999989_dp) > 1e-12) error stop print*, nearest(x2, s2) if (abs(nearest(x2, s2) - 41.9999962_sp) > 1e-6) error stop print*, nearest(y2, s2) if (abs(nearest(y2, s2) - 41.999999999999993_dp) > 1e-12) error stop print*, nearest(x3, s3) if (abs(nearest(x3, s3) - 1.00000012e+00_sp) > 1e-6) error stop print*, nearest(y3, s3) if (abs(nearest(y3, s3) - 1.0000000000000001e+00_dp) > 1e-12) error stop print*, nearest(x4, s3) if (abs(nearest(x4, s3) - 42.0000038_sp) > 1e-6) error stop print*, nearest(y4, s3) if (abs(nearest(y4, s3) - 42.000000000000007_dp) > 1e-12) error stop print*, nearest(x3, s4) if (abs(nearest(x3, s4) - 0.999999940_sp) > 1e-6) error stop print*, nearest(y3, s4) if (abs(nearest(y3, s4) - 0.99999999999999989_dp) > 1e-12) error stop print*, nearest(x4, s4) if (abs(nearest(x4, s4) - 41.9999962_sp) > 1e-6) error stop print*, nearest(y4, s4) if (abs(nearest(y4, s4) - 41.999999999999993_dp) > 1e-12) error stop end program lfortran-0.63.0/integration_tests/separate_compilation_36.f900000664000175000017500000000074715174404631024427 0ustar alastairalastairmodule separate_compilation_36b use separate_compilation_36a implicit none type :: MyType class(AbsType), allocatable :: obj end type MyType contains subroutine client() class(MyType), allocatable :: arr(:,:) associate( ob => arr(1,1)%obj ) call ob%ptr() end associate end subroutine client end module separate_compilation_36b program separate_compilation_36 implicit none print *, "PASS" end program separate_compilation_36 lfortran-0.63.0/integration_tests/class_85.f900000664000175000017500000000172315174404631021331 0ustar alastairalastairmodule class_85_mod implicit none type :: string_t character(:), allocatable :: s end type string_t type :: string_list_t type(string_t), allocatable :: items(:) type(string_t), allocatable :: item end type string_list_t contains subroutine set_list(list) type(string_t), allocatable, intent(in) :: list(:) if (allocated(list)) error stop "list allocated" end subroutine set_list subroutine set_list_scalar(list_mem) type(string_t), allocatable, intent(in) :: list_mem if (allocated(list_mem)) error stop "list allocated" end subroutine set_list_scalar end module class_85_mod program class_85 use class_85_mod implicit none type(string_list_t) :: mylist call set_list(mylist%items) call set_list_scalar(mylist%item) if (allocated(mylist%items)) error stop "mylist%items allocated" if (allocated(mylist%item)) error stop "mylist%item allocated" end program class_85lfortran-0.63.0/integration_tests/gpu_metal_89.f900000664000175000017500000000242415174404631022204 0ustar alastairalastairprogram gpu_metal_89 ! Test that do concurrent with 31+ arrays works correctly. ! Metal limits buffer indices to 0-30, so the compiler must pack arrays ! into a combined buffer when the count exceeds this limit. implicit none integer, parameter :: n = 10 real :: a1(n), a2(n), a3(n), a4(n), a5(n), a6(n), a7(n), a8(n) real :: a9(n), a10(n), a11(n), a12(n), a13(n), a14(n), a15(n), a16(n) real :: a17(n), a18(n), a19(n), a20(n), a21(n), a22(n), a23(n), a24(n) real :: a25(n), a26(n), a27(n), a28(n), a29(n), a30(n), a31(n) integer :: i a2 = 1.0; a3 = 1.0; a4 = 1.0; a5 = 1.0; a6 = 1.0; a7 = 1.0; a8 = 1.0 a9 = 1.0; a10 = 1.0; a11 = 1.0; a12 = 1.0; a13 = 1.0; a14 = 1.0; a15 = 1.0 a16 = 1.0; a17 = 1.0; a18 = 1.0; a19 = 1.0; a20 = 1.0; a21 = 1.0; a22 = 1.0 a23 = 1.0; a24 = 1.0; a25 = 1.0; a26 = 1.0; a27 = 1.0; a28 = 1.0; a29 = 1.0 a30 = 1.0; a31 = 1.0 do concurrent(i = 1:n) a1(i) = a2(i) + a3(i) + a4(i) + a5(i) + a6(i) + a7(i) + a8(i) & + a9(i) + a10(i) + a11(i) + a12(i) + a13(i) + a14(i) + a15(i) & + a16(i) + a17(i) + a18(i) + a19(i) + a20(i) + a21(i) + a22(i) & + a23(i) + a24(i) + a25(i) + a26(i) + a27(i) + a28(i) + a29(i) & + a30(i) + a31(i) end do print *, a1(1) if (abs(a1(1) - 30.0) > 1e-6) error stop if (abs(a1(n) - 30.0) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/nested_19.f900000664000175000017500000000073515174404631021505 0ustar alastairalastairprogram nested_19 type t1 integer, allocatable :: ll end type type t2 type(t1),allocatable :: arr(:) end type t2 type t3 type(t2) ,allocatable :: z(:) end type call ss contains subroutine ss type(t3), allocatable :: t2 allocate(t2) if (.not. allocated(t2)) error stop "t2 not allocated" allocate(t2%z(10)) allocate(t2%z(1)%arr(5)) end subroutine end program nested_19lfortran-0.63.0/integration_tests/separate_compilation_08.f900000664000175000017500000000036315174404631024420 0ustar alastairalastairprogram separate_compilation_08 use module_using_all_1_separate_compilation_08a use module_using_all_2_separate_compilation_08b real :: x(5) x = 9.2314 call test_all(x) x = 19.2314 call test_all_2(x) end program lfortran-0.63.0/integration_tests/operator_overloading_12.f900000664000175000017500000000144115174404631024433 0ustar alastairalastairmodule module_operator_overloading_12 implicit none public :: operator(.and.) interface operator(.and.) elemental module function and(lhs, rhs) result(diagnosis) implicit none integer, intent(in) :: lhs, rhs integer :: diagnosis end function end interface contains elemental module function and(lhs, rhs) result(diagnosis) implicit none integer, intent(in) :: lhs, rhs integer :: diagnosis diagnosis = lhs + rhs end function and end module module_operator_overloading_12 program operator_overloading_12 use module_operator_overloading_12, only: operator(.and.) implicit none integer :: a, b, c a = 5 b = 5 c = a .and. b print *, "The result of a .and. b is:", c if ( c /= 10 ) error stop end program operator_overloading_12lfortran-0.63.0/integration_tests/string_103.f900000664000175000017500000000243215174404631021577 0ustar alastairalastairprogram string_103 ! Test that a temporary variable created for a function call result ! whose type depends on another variable (e.g., character(len=len(x))) ! has the correct dependency list in ASR. implicit none character(len=:), allocatable :: temp character(len=:), allocatable :: rev integer :: i temp = "hello/world" rev = reverse(temp) i = find_char(rev, "/") if (i /= 6) error stop ! The following nested call triggered an ASR verify error before the fix: ! "Variable lfortran_tmp depends on temp but isn't found in its dependency list" i = find_char(reverse(temp), "/") print *, "ok" contains function reverse(string) result(reverse_string) character(len=*), intent(in) :: string character(len=len(string)) :: reverse_string integer :: i, n n = len(string) do i = 1, n reverse_string(n-i+1:n-i+1) = string(i:i) end do end function function find_char(string, pattern) result(res) character(len=*), intent(in) :: string character(len=*), intent(in) :: pattern integer :: res integer :: i res = 0 do i = 1, len(string) if (string(i:i) == pattern(1:1)) then res = i return end if end do end function end program lfortran-0.63.0/integration_tests/allocate_02.f900000664000175000017500000000123215174404631021770 0ustar alastairalastairprogram allocate_01 implicit none integer, allocatable :: a(:), b(:), c(:) integer :: n, ierr, isource n = 10 allocate(a(n), b(n), c(n), stat=ierr, source=isource) a = 1 b = 2 c = 3 print *, whole_square(a, b, c) contains integer function whole_square(a, b, c) result(status) implicit none integer, allocatable :: a(:), b(:), c(:) integer, allocatable :: a_2(:), b_2(:), c_2(:) integer, allocatable :: ab(:), bc(:), ca(:), abc(:) integer :: n n = size(a) allocate(a_2(n), b_2(n), c_2(n)) allocate(ab(n), bc(n), ca(n), abc(n)) status = 0 a_2 = a*a b_2 = b*b c_2 = c*c ab = 2*a*b bc = 2*b*c ca = 2*c*a abc = 2*a*b*c status = 1 end function whole_square end lfortran-0.63.0/integration_tests/arrays_54.f900000664000175000017500000000043215174404631021515 0ustar alastairalastairprogram arrays_54 implicit none integer :: res(4) real :: x(1, 4), center, order integer, parameter :: dim = 1 order = 2 x = 1 center = 0 res = 1 + sum((x - center), dim) / size(x, dim) if( any(res /= 2) ) error stop print *, res end program lfortran-0.63.0/integration_tests/subroutines_05.f900000664000175000017500000000032115174404631022567 0ustar alastairalastairprogram bugSize integer, pointer :: x(:) allocate(x(4)) call f(x) contains subroutine f(x) integer, intent(in) :: x(:) real :: E(size(x)) E = x E = [ 1, 2, 3, 4 ] print*, E end subroutine end program lfortran-0.63.0/integration_tests/character_21.f900000664000175000017500000000076415174404631022152 0ustar alastairalastairprogram character_21 implicit none print *, test_func(2) if (test_func(2) /= "119") error stop print *, test_func(4) if (test_func(4) /= "12345") error stop contains function test_func(d) result(res) integer, intent(in) :: d character(11) :: res character(1) claterdigits*(d+1) if (d == 2) then claterdigits = "119" else if (d == 4) then claterdigits = "12345" end if res = claterdigits end function test_func end program character_21 lfortran-0.63.0/integration_tests/namelist_16.f900000664000175000017500000000435515174404631022036 0ustar alastairalastairprogram test_allocatable_arrays implicit none integer, allocatable :: act_name(:) real, allocatable :: values(:) logical :: temp_log integer :: i namelist /alloc_nml/ act_name, values, temp_log ! Allocate arrays allocate(act_name(3)) allocate(values(4)) ! Initialize act_name = [10, 20, 30] values = [1.5, 2.5, 3.5, 4.5] temp_log = .true. ! Write to file open(unit=10, file='namelist_alloc.dat', status='replace', form='formatted') write(10, nml=alloc_nml) close(10) ! Reset values act_name = 0 values = 0.0 temp_log = .false. ! Read from file open(unit=10, file='namelist_alloc.dat', status='old', form='formatted') read(10, nml=alloc_nml) close(10) ! Verify act_name if (act_name(1) /= 10) then print *, "Error: act_name(1) =", act_name(1), "expected 10" error stop "Test failed for act_name(1)" end if if (act_name(2) /= 20) then print *, "Error: act_name(2) =", act_name(2), "expected 20" error stop "Test failed for act_name(2)" end if if (act_name(3) /= 30) then print *, "Error: act_name(3) =", act_name(3), "expected 30" error stop "Test failed for act_name(3)" end if ! Verify values if (abs(values(1) - 1.5) > 1.0e-5) then print *, "Error: values(1) =", values(1), "expected 1.5" error stop "Test failed for values(1)" end if if (abs(values(2) - 2.5) > 1.0e-5) then print *, "Error: values(2) =", values(2), "expected 2.5" error stop "Test failed for values(2)" end if if (abs(values(3) - 3.5) > 1.0e-5) then print *, "Error: values(3) =", values(3), "expected 3.5" error stop "Test failed for values(3)" end if if (abs(values(4) - 4.5) > 1.0e-5) then print *, "Error: values(4) =", values(4), "expected 4.5" error stop "Test failed for values(4)" end if ! Verify logical if (.not. temp_log) then print *, "Error: temp_log =", temp_log, "expected .true." error stop "Test failed for temp_log" end if print *, "Allocatable array namelist test passed!" ! Clean up deallocate(act_name) deallocate(values) end program test_allocatable_arrays lfortran-0.63.0/integration_tests/complex_31.f900000664000175000017500000000157215174404631021664 0ustar alastairalastairprogram complex_31 use, intrinsic :: iso_fortran_env, only: dp => real64 use, intrinsic :: ieee_arithmetic, only: ieee_is_nan implicit none complex(dp) :: a, b, c real(dp) :: tol tol = 1.0d-12 a = cmplx(1.0d200, 1.0d200, kind=dp) b = cmplx(1.0d200, 1.0d200, kind=dp) c = a / b if (ieee_is_nan(real(c)) .or. ieee_is_nan(aimag(c))) & error stop "nan in div case 1" if (abs(real(c) - 1.0d0) > tol) error stop "div case 1 real" if (abs(aimag(c)) > tol) error stop "div case 1 imag" a = cmplx(1.0d-200, 1.0d200, kind=dp) b = cmplx(1.0d-200, 1.0d200, kind=dp) c = a / b if (ieee_is_nan(real(c)) .or. ieee_is_nan(aimag(c))) & error stop "nan in div case 2" if (abs(real(c) - 1.0d0) > tol) error stop "div case 2 real" if (abs(aimag(c)) > tol) error stop "div case 2 imag" print *, "PASS" end program lfortran-0.63.0/integration_tests/namelist_11.f900000664000175000017500000000374615174404631022034 0ustar alastairalastairprogram test_null implicit none ! Test null value syntax: var= (skip assignment) integer :: a, b, c real :: x, y, z namelist /nulltest/ a, b, c, x, y, z ! Initialize to known values a = 100 b = 200 c = 300 x = 1.5 y = 2.5 z = 3.5 ! Create input file with null values ! b= and y= should leave those variables unchanged open(unit=10, file='namelist_null.dat', status='replace', form='formatted') write(10, '(A)') ' &NULLTEST' write(10, '(A)') ' a=1' write(10, '(A)') ' b=' write(10, '(A)') ' c=3' write(10, '(A)') ' x=10.5' write(10, '(A)') ' y=' write(10, '(A)') ' z=30.5' write(10, '(A)') ' /' close(10) ! Read namelist with null values open(unit=10, file='namelist_null.dat', status='old', form='formatted') read(10, nml=nulltest) close(10) ! Verify a was changed to 1 if (a /= 1) then print *, "Error: a =", a, "expected 1" error stop "Null value test failed for a" end if ! Verify b was NOT changed (null value) if (b /= 200) then print *, "Error: b =", b, "expected 200 (unchanged)" error stop "Null value test failed for b" end if ! Verify c was changed to 3 if (c /= 3) then print *, "Error: c =", c, "expected 3" error stop "Null value test failed for c" end if ! Verify x was changed to 10.5 if (abs(x - 10.5) > 1.0e-5) then print *, "Error: x =", x, "expected 10.5" error stop "Null value test failed for x" end if ! Verify y was NOT changed (null value) if (abs(y - 2.5) > 1.0e-5) then print *, "Error: y =", y, "expected 2.5 (unchanged)" error stop "Null value test failed for y" end if ! Verify z was changed to 30.5 if (abs(z - 30.5) > 1.0e-5) then print *, "Error: z =", z, "expected 30.5" error stop "Null value test failed for z" end if print *, "Null value namelist test passed!" end program test_null lfortran-0.63.0/integration_tests/crlf_fixed_form.f900000664000175000017500000000017215174404631023035 0ustar alastairalastairC Fixed-form CRLF test with label program test 10 continue print *, 'hello * world' end lfortran-0.63.0/integration_tests/file_19_data.txt0000664000175000017500000000002615174404631022345 0ustar alastairalastair Hi this is 1st line! lfortran-0.63.0/integration_tests/separate_compilation_29.f900000664000175000017500000000045415174404631024424 0ustar alastairalastairprogram separate_compilation_29 use separate_compilation_29a_module, only: sa, get_a use separate_compilation_29b_module, only: sb, get_b implicit none call sa() call sb() if (get_a() /= 1) error stop 1 if (get_b() /= 2) error stop 2 end program separate_compilation_29 lfortran-0.63.0/integration_tests/string_85.f900000664000175000017500000000124015174404631021524 0ustar alastairalastairprogram string_85 call test_func() call test_func() print *, "Passed" contains subroutine test_func() character(10), save :: ch = '0123456789' integer, save :: call_count = 0 call_count = call_count + 1 print *, "ch before: '", ch, "'" if (call_count == 1) then if (ch /= '0123456789') error stop 'First call: initial value incorrect' else if (call_count == 2) then if (ch /= '0123X56789') error stop 'Second call: value not persisted from first call' end if ch(5:5) = 'X' print *, "ch after: '", ch, "'" if (ch /= '0123X56789') error stop 'Modified value incorrect' end subroutine test_func end program lfortran-0.63.0/integration_tests/gpu_metal_146.f900000664000175000017500000000154715174404631022263 0ustar alastairalastairmodule gpu_metal_146_m implicit none interface elemental module function outer_compute(x) result(y) real, intent(in) :: x real :: y end function end interface contains elemental function inner_eval(x) result(y) real, intent(in) :: x real :: y y = x * 2.0 end function end module submodule(gpu_metal_146_m) gpu_metal_146_s contains module procedure outer_compute y = inner_eval(x) + 1.0 end procedure end submodule program gpu_metal_146 use gpu_metal_146_m, only : outer_compute implicit none real :: x(4), y(4) integer :: i x = [1.0, 2.0, 3.0, 4.0] do concurrent (i = 1:4) y(i) = outer_compute(x(i)) end do if (abs(y(1) - 3.0) > 1e-6) error stop if (abs(y(2) - 5.0) > 1e-6) error stop if (abs(y(3) - 7.0) > 1e-6) error stop if (abs(y(4) - 9.0) > 1e-6) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/intrinsics_167.f900000664000175000017500000000333415174404631022472 0ustar alastairalastairprogram intrinsics_167 integer :: a1 = 5, a2 = 8 integer(8) :: a3 = -1, a4 = -4 integer :: a5 = -2, a6 = -5 logical, parameter :: i1 = btest(5, 8) logical, parameter :: i2 = btest(-1_8, 5) logical, parameter :: i3 = btest(-4, 2_8) logical, parameter :: i4 = btest(-2_8, 5_8) logical, parameter :: ar1(3) = btest([5, 8, 9], [8, 5, 2]) logical(8), parameter :: ar2(3) = btest([-1_8, -5_8, -10_8], [5, 8, 9]) integer :: arr1(3), arr3(3) integer(8) :: arr2(3) logical :: res(3) arr1 = [5, 8, 9] arr3 = [8, 5, 2] arr2 = [-1_8, -5_8, -10_8] print *, i1 if (i1 .neqv. .false.) error stop print *, i2 if (i2 .neqv. .true.) error stop print *, i3 if (i3 .neqv. .true.) error stop print *, i4 if (i4 .neqv. .true.) error stop print*, btest(5, 8) if (btest(5, 8) .neqv. .false.) error stop print*, btest(-1, 5) if (btest(-1, 5) .neqv. .true.) error stop print*, btest(a1, a2) if (btest(a1, a2) .neqv. .false.) error stop print*, btest(a3, a1) if (btest(a3, a1) .neqv. .true.) error stop print*, btest(a2, a4) if (btest(a2, a4) .neqv. .false.) error stop print*, btest(a5, a6) if (btest(a5, a6) .neqv. .true.) error stop print *, ar1 if (any(ar1 .neqv. [.false., .false., .false.])) error stop print *, ar2 if (any(ar2 .neqv. [.true., .true., .true.])) error stop print *, btest(arr1, arr1) if (any(btest(arr1, arr1) .neqv. [.false., .false., .false.])) error stop print *, btest(arr2, arr1) if (any(btest(arr2, arr1) .neqv. [.true., .true., .true.])) error stop res = btest(arr1, arr3) print *, res if (any(res .neqv. [.false., .false., .false.])) error stop end program lfortran-0.63.0/integration_tests/format_20.f900000664000175000017500000000135015174404631021475 0ustar alastairalastairprogram format_20 type :: struct character(17) :: field integer :: int end type struct type(struct) :: array(3) character(*), parameter :: title = 'Some title string: ' character(100) :: res character(100) :: expected_res = "Some title string: 1234567890 ABCDEFGHIJ Abcdefghijklmn" array(1) = struct('1234567890',1) array(2) = struct('ABCDEFGHIJ',2) array(3) = struct('Abcdefghijklmn',3) print '(a,3a15)', title, array(:)%field write(*,'(a,3a15)') title, array(:)%field write(res,'(a,3a15)') title, array(:)%field ! The rest of `res` and `expected_res` length are empty spaces (which is fine in this test). if(res /= expected_res) error stop end program lfortran-0.63.0/integration_tests/test_ieee_arithmetic.f900000664000175000017500000000475615174404631024100 0ustar alastairalastairprogram test_ieee_arithmetic use iso_fortran_env, only : sp => real32, dp => real64 use ieee_arithmetic implicit none real(4) :: a = -1.0_sp, b = 1.0_sp real(8) :: x = 7.9_dp, y = -3.0_dp print*, ieee_is_nan(-1.0) if (ieee_is_nan(-1.0) .neqv. .false.) error stop print*, ieee_is_finite(-1.0) if (ieee_is_finite(-1.0) .neqv. .true.) error stop print*, ieee_is_negative(-1.0) if (ieee_is_negative(-1.0) .neqv. .true.) error stop print*, ieee_copy_sign(-1.0, 1.0) if (ieee_copy_sign(-1.0, 1.0) /= 1.0) error stop print*, ieee_support_datatype(-1.0) if (ieee_support_datatype(-1.0) .neqv. .true.) error stop print*, ieee_is_normal(-1.0) if (ieee_is_normal(-1.0) .neqv. .true.) error stop print*, ieee_unordered(-1.0, 1.0) if (ieee_unordered(-1.0, 1.0) .neqv. .false.) error stop print*, ieee_logb(-1.0) if (ieee_logb(-1.0) /= 0) error stop print*, ieee_rem(-1.0, 1.0) if (ieee_rem(-1.0, 1.0) /= 0) error stop print*, ieee_is_nan(a) if (ieee_is_nan(a) .neqv. .false.) error stop print*, ieee_is_finite(a) if (ieee_is_finite(a) .neqv. .true.) error stop print*, ieee_is_negative(a) if (ieee_is_negative(a) .neqv. .true.) error stop print*, ieee_copy_sign(a, b) if (abs(ieee_copy_sign(a, b) - 1.0_sp) > 1e-6) error stop print*, ieee_support_datatype(a) if (ieee_support_datatype(a) .neqv. .true.) error stop print*, ieee_is_normal(a) if (ieee_is_normal(a) .neqv. .true.) error stop print*, ieee_unordered(a, b) if (ieee_unordered(a, b) .neqv. .false.) error stop print*, ieee_logb(a) if (ieee_logb(a) /= 0) error stop print*, ieee_rem(a, b) if (abs(ieee_rem(a, b) - 0) > 1e-6) error stop print*, ieee_is_nan(x) if (ieee_is_nan(x) .neqv. .false.) error stop print*, ieee_is_finite(x) if (ieee_is_finite(x) .neqv. .true.) error stop print*, ieee_is_negative(x) if (ieee_is_negative(x) .neqv. .false.) error stop print*, ieee_copy_sign(x, y) if (abs(ieee_copy_sign(x, y) - (-7.9)) > 1e-6) error stop print*, ieee_support_datatype(x) if (ieee_support_datatype(x) .neqv. .true.) error stop print*, ieee_is_normal(x) if (ieee_is_normal(x) .neqv. .true.) error stop print*, ieee_unordered(x, y) if (ieee_unordered(x, y) .neqv. .false.) error stop print*, ieee_logb(x) if (ieee_logb(x) /= 2.0) error stop print*, ieee_rem(x, y) if (abs(ieee_rem(x, y) - -1.0999999046325684) > 1e-6_dp) error stop end program lfortran-0.63.0/integration_tests/submodule_16.f900000664000175000017500000000340115174404631022210 0ustar alastairalastairmodule submodule_16_string implicit none type :: string_t character(len=:), allocatable :: s end type interface operator(//) module procedure cat_char_string end interface contains pure function cat_char_string(lhs, rhs) result(out) character(len=*), intent(in) :: lhs type(string_t), intent(in) :: rhs character(len=:), allocatable :: out out = lhs // rhs%s end function end module module submodule_16_m use submodule_16_string, only: string_t, operator(//) implicit none type :: test_diagnosis_t logical :: test_passed_ = .false. character(len=:), allocatable :: diagnostics_string_ end type interface operator(//) elemental module function append_string_if_test_failed(lhs, rhs) result(lhs_cat_rhs) class(test_diagnosis_t), intent(in) :: lhs type(string_t), intent(in) :: rhs type(test_diagnosis_t) lhs_cat_rhs end function end interface contains subroutine run_demo() type(test_diagnosis_t) :: d type(string_t) :: s d%test_passed_ = .false. d%diagnostics_string_ = "prefix: " s%s = "payload" d = d // s if (d%diagnostics_string_ /= "prefix: payload") error stop 1 end subroutine end module submodule(submodule_16_m) submodule_16_s implicit none contains module procedure append_string_if_test_failed if (lhs%test_passed_) then lhs_cat_rhs = lhs else lhs_cat_rhs = test_diagnosis_t(lhs%test_passed_, lhs%diagnostics_string_ // rhs) end if end procedure end submodule program submodule_16 use submodule_16_m, only: run_demo implicit none call run_demo() end program lfortran-0.63.0/integration_tests/functions_56.f900000664000175000017500000000114515174404631022230 0ustar alastairalastairprogram functions_56 use functions_56_mod implicit none type(mha_layer) :: layer layer%sequence_length = 2 layer%head_size = 1 layer%n_heads = 1 call layer%do_backward() ! Check allocation if (.not. allocated(layer%v_heads)) then error stop "v_heads not allocated" end if ! Check shape if (size(layer%v_heads,1) /= 2 .or. size(layer%v_heads,2) /= 1 .or. size(layer%v_heads,3) /= 1) then error stop "unexpected shape of v_heads" end if ! Check values if (any(layer%v_heads /= 1.0)) then error stop "v_heads values incorrect" end if print *, "OK" end programlfortran-0.63.0/integration_tests/arrays_op_29.f900000664000175000017500000000051715174404631022221 0ustar alastairalastairprogram arrays_op_29 implicit none real(8) :: x(2) = (/ 0.5_8, 0.5_8 /) print *, R3(x) if( any(R3(x) /= -3.5) ) error stop contains function R3(x) real(8), intent(in) :: x(:) real(8) :: R3(size(x)) real(8) :: a, b real(8), parameter :: c = 2.0 a = x(1) b = x(2) R3 = a**2.0 + b**2.0 - c**2.0 end function end program arrays_op_29 lfortran-0.63.0/integration_tests/arrays_93.f900000664000175000017500000000101515174404631021516 0ustar alastairalastairprogram arrays_93 implicit none integer :: result logical :: array(5) array = [ .true., .false., .true., .false., .true.] call falseloc(array, result) print *, "Number of false elements:", result if (result /= 2) error stop contains subroutine falseloc(array, return_value) logical, intent(in) :: array(:) integer, intent(out) :: return_value integer :: loc(count(.not.(array))) return_value = size(loc) end subroutine falseloc end program arrays_93 lfortran-0.63.0/integration_tests/entry_13.f900000664000175000017500000000056315174404631021355 0ustar alastairalastairsubroutine sub() integer :: x x = 12 go to 50 go to 60 return 50 print *, "here at 50, x = ", x if (x /= 12) error stop x = 13 go to 60 60 print *, "here at 60, x = ", x if (x /= 13) error stop x = 19 go to 70 return entry entry_sub1() return 70 print *, "here at 70, x = ", x if (x /= 19) error stop return end subroutine program entry_13 call sub() end program lfortran-0.63.0/integration_tests/internal_subr_host_vars_01.f900000664000175000017500000000104715174404631025146 0ustar alastairalastair! Verify host association for internal subroutines and enforce via error stop subroutine add(x, y) implicit none real, intent(in) :: x, y real :: s s = x + y if (s /= 3.0) error stop contains subroutine add2() implicit none real :: t ! add2 should be able to see x, y from the host t = x + y + 2.0 if (t /= 5.0) error stop end subroutine add2 end subroutine add program internal_subr_host_vars_01 implicit none call add(1.0, 2.0) end program internal_subr_host_vars_01 lfortran-0.63.0/integration_tests/dict_test_07_.f900000664000175000017500000000213715174404631022337 0ustar alastairalastairmodule dict_test_07_mod implicit none contains function fill_smalltocapital() result(smalltocaps) type(_lfortran_dict(character(len=:), character(len=:))) :: smalltocaps smalltocaps = _lfortran_dict_constant( & "a", "A", "b", "B", "c", "C", "d", "D", "e", "E", & "f", "F", "g", "G", "h", "H", "i", "I", "j", "J", & "k", "K", "l", "L", "m", "M", "n", "N", "o", "O", & "p", "P", "q", "Q", "r", "R", "s", "S", "t", "T", & "u", "U", "v", "V", "w", "W", "x", "X", "y", "Y", "z", "Z") end function subroutine test_dict() type(_lfortran_dict(character(len=:), character(len=:))) :: smalltocaps integer :: i character(len=1) :: key, expected smalltocaps = fill_smalltocapital() if (_lfortran_len(smalltocaps) /= 26) error stop do i = 97, 97 + 25 key = achar(i) expected = achar(i - 32) if (_lfortran_get_item(smalltocaps, key) /= expected) error stop end do end subroutine end module program test_dict_07 use dict_test_07_mod implicit none call test_dict() end program lfortran-0.63.0/integration_tests/ilp64_stop_01.f900000664000175000017500000000041115174404631022204 0ustar alastairalastairprogram ilp64_stop_01 implicit none integer :: x x = 1 ! Test error stop with literal if (x /= 1) error stop 1 ! Test stop with literal ! (only test success path - we just need the compilation to succeed) print *, "PASS" end program lfortran-0.63.0/integration_tests/cpp_pre_15.f900000664000175000017500000000153115174404631021642 0ustar alastairalastair#define mymacro(x) (x + 1) module cpp_pre_15_mod implicit none contains subroutine sub(x, mymacro) integer, intent(in) :: x integer, intent(in) :: mymacro if (x /= 1) error stop if (mymacro /= 43) error stop end subroutine end module program cpp_pre_15 use cpp_pre_15_mod implicit none integer :: mymacro, r ! FLM name used as a variable (not followed by '(' so no expansion) mymacro = 10 if (mymacro /= 10) error stop ! FLM invocation with ( expands normally r = mymacro(42) if (r /= 43) error stop ! FLM with spaces before ( still expands r = mymacro (99) if (r /= 100) error stop ! FLM name at end of source line (next char is newline, not '(') r = & mymacro if (r /= 10) error stop ! FLM name as subroutine dummy argument name call sub(1, mymacro(42)) print *, "PASS" end program lfortran-0.63.0/integration_tests/substring_read.f900000664000175000017500000000045115174404631022720 0ustar alastairalastairprogram substring_read implicit none character(8) :: string = 'abcd', newstring = 'ABCD' read(string, '(A)') newstring(5:8) if (newstring /= 'ABCDabcd') error stop read(string(1:4), '(A)') newstring if (newstring /= 'abcd ') error stop end program substring_read lfortran-0.63.0/integration_tests/fma_02.f900000664000175000017500000000075215174404631020755 0ustar alastairalastairmodule fma_02_mod contains subroutine ss(x) integer, intent(in) :: x real(4) :: b(x) b = 1 b = -b + 1.0*b ! Test FMA opt. with `--fast` (pointerToDataArray) print *, b if(any(b /= 0.0)) error stop end subroutine end module program fma_02 use fma_02_mod implicit none real ::b(10) b = 1 b = -b + b*1.0 ! Test FMA opt. with `--fast` (fixedSizeAsrray) print *, b if(any(b /= 0.0)) error stop call ss(10) end program lfortran-0.63.0/integration_tests/intrinsics_236.f900000664000175000017500000000075315174404631022471 0ustar alastairalastairprogram intrinsics_236 implicit none integer,parameter:: ik1 = selected_int_kind(1) print "(A,I0)", & 'ik1 = ',ik1,& 'kind(bit_size(1_ik1)) = ',kind(bit_size(1_ik1)), & 'kind(huge(1_ik1)) = ',kind(huge(1_ik1)),& 'huge(1_ik1) = ',huge(1_ik1) if (1_ik1 /= 1) error stop if (kind(bit_size(1_ik1)) /= 1) error stop if (kind(huge(1_ik1)) /= 1) error stop if (huge(1_ik1) /= 127) error stop end program lfortran-0.63.0/integration_tests/common_21.f900000664000175000017500000000447615174404631021512 0ustar alastairalastair! Test: COMMON block with mixed type sizes and type punning via storage association ! Verifies that the same storage can be accessed as different types (type aliasing) ! and that modifications through one view are visible through another view. ! This is valid Fortran behavior per F2018 8.10.3 (storage association). program common_21 implicit none integer(4) :: i4_1, i4_2 real(8) :: r8 common/mixblk/i4_1, i4_2, r8 ! Initialize with known values i4_1 = 11 i4_2 = 22 r8 = 3.14159265358979d0 ! Verify same layout can read values call sub_verify_layout() ! Modify storage through different type view (type punning) call sub_single_real8_view() ! Verify modification via array view call sub_array_view() ! Final verification: check that arr modifications are visible here ! After sub_array_view sets arr(1)=100, arr(2)=200, we should see: ! - r8 should be 200.0d0 (from arr(2)) if (abs(r8 - 200.0d0) > 1.0d-10) error stop & "r8 should be 200.0 after array modification" print *, "PASS: common_21" end program subroutine sub_verify_layout() implicit none ! Same layout as main program - verify values are preserved integer(4) :: a, b real(8) :: c common/mixblk/a, b, c if (a /= 11) error stop "a should be 11" if (b /= 22) error stop "b should be 22" if (abs(c - 3.14159265358979d0) > 1.0d-10) error stop "c should be pi" end subroutine subroutine sub_single_real8_view() implicit none ! View entire 16 bytes as two real(8) values (type punning) ! First 8 bytes (i4_1 + i4_2) viewed as r8_first ! Second 8 bytes (r8) viewed as r8_second real(8) :: r8_first real(8) :: r8_second common/mixblk/r8_first, r8_second ! Modify through this view - changes underlying storage r8_first = 1.0d0 r8_second = 2.0d0 end subroutine subroutine sub_array_view() implicit none ! View entire 16 bytes as an array of 2 real(8) values real(8) :: arr(2) common/mixblk/arr ! Verify values set by sub_single_real8_view are visible here if (abs(arr(1) - 1.0d0) > 1.0d-10) error stop "arr(1) should be 1.0" if (abs(arr(2) - 2.0d0) > 1.0d-10) error stop "arr(2) should be 2.0" ! Modify via array access - will be visible in main program arr(1) = 100.0d0 arr(2) = 200.0d0 end subroutine lfortran-0.63.0/integration_tests/class_142.f900000664000175000017500000000460115174404631021401 0ustar alastairalastair! Test: defined assignment on polymorphic allocatable components ! Verifies that user-defined assignment(=) is called (not intrinsic ! assignment) when assigning class(...) allocatable members. module class_142_mod implicit none type, abstract :: base_type contains procedure, non_overridable, private :: copy generic :: assignment(=) => copy procedure(copy_iface), deferred :: copy_impl end type abstract interface subroutine copy_iface(lhs, rhs) import base_type class(base_type), intent(inout) :: lhs class(base_type), intent(in) :: rhs end subroutine end interface type, extends(base_type) :: container integer, pointer :: data => null() contains procedure :: copy_impl => container_copy end type type :: node class(base_type), allocatable :: value end type contains subroutine copy(lhs, rhs) class(base_type), intent(inout) :: lhs class(base_type), intent(in) :: rhs call lhs%copy_impl(rhs) end subroutine subroutine container_copy(lhs, rhs) class(container), intent(inout) :: lhs class(base_type), intent(in) :: rhs select type (rhs) type is (container) if (associated(lhs%data)) deallocate(lhs%data) if (associated(rhs%data)) allocate(lhs%data, source=rhs%data) end select end subroutine end module program class_142 use class_142_mod implicit none type(node) :: n1, n2 allocate(container :: n1%value) select type (v => n1%value) type is (container) allocate(v%data, source=42) end select ! Copy via polymorphic defined assignment on allocatable component allocate(n2%value, mold=n1%value) n2%value = n1%value ! Modify original — copy should be unaffected if deep copy happened select type (v => n1%value) type is (container) v%data = 99 end select ! Verify deep copy: n2's data should still be 42 select type (v => n2%value) type is (container) if (.not. associated(v%data)) error stop if (v%data /= 42) error stop end select select type (v => n1%value) type is (container) deallocate(v%data) end select select type (v => n2%value) type is (container) deallocate(v%data) end select print *, "PASS" end program lfortran-0.63.0/integration_tests/gpu_metal_57.f900000664000175000017500000000133115174404631022173 0ustar alastairalastairmodule gpu_metal_57_m implicit none type :: t contains procedure :: f end type contains elemental function f(self, x) result(r) class(t), intent(in) :: self real, intent(in) :: x real :: r r = x * 2.0 end function end module gpu_metal_57_m program gpu_metal_57 use gpu_metal_57_m implicit none type(t) :: a integer :: i real :: x(4), y(4) x = [1.0, 2.0, 3.0, 4.0] y = 0.0 do concurrent (i = 1:4) associate(tmp => x(1)) y(i) = a%f(x(i)) end associate end do if (abs(y(1) - 2.0) > 1e-6) error stop if (abs(y(2) - 4.0) > 1e-6) error stop if (abs(y(3) - 6.0) > 1e-6) error stop if (abs(y(4) - 8.0) > 1e-6) error stop print *, "PASS" end program gpu_metal_57 lfortran-0.63.0/integration_tests/array_indices_array_item_assignment_3.f900000664000175000017500000000065415174404631027414 0ustar alastairalastairprogram array_indices_array_item_assignment_3 implicit none type :: line integer :: first end type integer :: arr(5) = [1, 2, 3, 4, 5] integer :: shift(5) type(line) :: l_arr(5) integer :: i do i = 1, 5 l_arr(i)%first = i*10 end do shift(:) = l_arr(arr)%first - 1 if (any([9, 19, 29, 39, 49] /= shift)) error stop end program array_indices_array_item_assignment_3 lfortran-0.63.0/integration_tests/separate_compilation_39a.f900000664000175000017500000000047715174404631024573 0ustar alastairalastairmodule separate_compilation_39a implicit none type recursive_t(k) integer, kind :: k = kind(1.0) type(recursive_t(k)), allocatable :: next end type recursive_t interface module subroutine noop() end subroutine noop end interface end module separate_compilation_39a lfortran-0.63.0/integration_tests/program_cmake_02.f900000664000175000017500000000035115174404631023014 0ustar alastairalastair! This is a test program that CMake uses to check that the Fortran compiler can ! compile Fortran 90 code. PROGRAM TESTFortran90 integer stop ; stop = 1 ; do while ( stop .eq. 0 ) ; end do END PROGRAM TESTFortran90 lfortran-0.63.0/integration_tests/derived_types_16_module.f900000664000175000017500000000137115174404631024430 0ustar alastairalastairmodule fpm_command_line implicit none public :: fpm_run_settings, get_command_line_settings type :: fpm_run_settings integer :: int real :: float logical :: bool end type contains subroutine get_command_line_settings(cmd_settings) class(fpm_run_settings), allocatable, intent(out) :: cmd_settings cmd_settings=fpm_run_settings(0, 1.0, .true.) end subroutine get_command_line_settings end module fpm_command_line program derived_types_16 use fpm_command_line implicit none class(fpm_run_settings), allocatable :: settings allocate(settings) call get_command_line_settings(settings) if (settings%int /= 0) error stop if (abs(settings%float - 1.0) > 1e-6) error stop if (settings%bool .neqv. .true.) error stop end program lfortran-0.63.0/integration_tests/test_format_inf_nan.f900000664000175000017500000000064515174404631023731 0ustar alastairalastairprogram test_format_inf_nan implicit none character(12) :: cnaninfs = 'NAN INF -INF' real :: naninfs(3) character(15) :: buf read(cnaninfs, *) naninfs write(buf, "(3F5.0)") naninfs if (buf /= " NaN Inf -Inf") error stop write(buf, "(3F5.0)") naninfs(1), naninfs(2), naninfs(3) if (buf /= " NaN Inf -Inf") error stop print "(3F5.0)", naninfs end program test_format_inf_nan lfortran-0.63.0/integration_tests/print_01.f900000664000175000017500000000020415174404631021335 0ustar alastairalastairprogram print_01 implicit none integer :: x x = (2+3)*5 print *, x, 1, 3, x, (2+3)*5+x write(*,*) x, 1, 3, x, (2+3)*5+x end program lfortran-0.63.0/integration_tests/warning_realstar.f900000664000175000017500000000007715174404631023253 0ustar alastairalastairprogram warning_realstar real*4 x real*8 y end program lfortran-0.63.0/integration_tests/gpu_metal_29.f900000664000175000017500000000051615174404631022176 0ustar alastairalastairprogram gpu_metal_29 implicit none integer :: x(5), i x = 0 do concurrent (i = 1:5) block integer :: tmp tmp = i * 2 x(i) = tmp end block end do if (x(1) /= 2) error stop if (x(2) /= 4) error stop if (x(3) /= 6) error stop if (x(4) /= 8) error stop if (x(5) /= 10) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/class_127.f900000664000175000017500000000274315174404631021411 0ustar alastairalastair! Test: value-attribute arg passed to deferred procedure expecting intent(in) module class_127_mod use iso_c_binding, only: c_double, c_ptr, c_int, c_f_pointer, c_loc implicit none type, abstract :: callbacks_t contains procedure(cb_double_iface), deferred :: double_value end type abstract interface integer function cb_double_iface(this, value) import callbacks_t, c_double class(callbacks_t) :: this real(c_double), intent(in) :: value end function end interface type, extends(callbacks_t) :: my_callbacks contains procedure :: double_value => my_double_value end type type :: box_type class(callbacks_t), pointer :: cb => null() end type contains integer function my_double_value(this, value) class(my_callbacks) :: this real(c_double), intent(in) :: value my_double_value = int(2.0d0 * value) end function integer(c_int) function wrapper(ctx, dval) bind(c, name='') type(c_ptr), value :: ctx real(c_double), value :: dval type(box_type), pointer :: box call c_f_pointer(ctx, box) wrapper = box%cb%double_value(dval) end function end module program class_127 use iso_c_binding, only: c_ptr, c_loc, c_double, c_int use class_127_mod implicit none type(my_callbacks), target :: cb type(box_type), target :: box type(c_ptr) :: ctx integer(c_int) :: res box%cb => cb ctx = c_loc(box) res = wrapper(ctx, 21.0_c_double) if (res /= 42) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/nested_21.f900000664000175000017500000000216215174404631021472 0ustar alastairalastair! Check sync statements in do while loops ! at cycle statements for scalar and arrays module temp_nested_21 contains subroutine demo() implicit none integer :: a,c integer :: arr(2) a = 1 ! Variable c is used to not run loops indefinitely c = 1 ! Scalar checks do while(f()) if (c>10) error stop c = c + 1 if (a < 5) then a = a + 1 cycle end if if (a > 4) error stop end do print *, a if (a < 4) error stop ! Array Checks c = 1 arr(2) = 1 do while(g()) if (c>10) error stop c = c + 1 if (arr(2) < 5) then arr(2) = arr(2) + 1 cycle end if if (arr(2) > 4) error stop end do print *, arr(2) if (arr(2) < 4) error stop contains logical function f() print *, a f = (a < 4) end function f logical function g() print *, arr(2) g = (arr(2) < 4) end function g end subroutine demo end module temp_nested_21 program nested_21 use temp_nested_21 implicit none call demo() end program nested_21lfortran-0.63.0/integration_tests/operator_overloading_13.f900000664000175000017500000000233615174404631024440 0ustar alastairalastairmodule operator_overloading_13_module implicit none private public :: operator(.separatedBy.) interface operator(.separatedBy.) module function strings_with_separator(sep, strings) result(csv) implicit none character(len=*), intent(in) :: sep character(len=*), dimension(:), intent(in) :: strings character(len=:), allocatable :: csv end function end interface contains module function strings_with_separator(sep, strings) result(csv) implicit none character(len=*), intent(in) :: sep character(len=*), dimension(:), intent(in) :: strings character(len=:), allocatable :: csv integer :: i character(len=:), allocatable :: temp csv = "" do i = 1, size(strings) if (i > 1) csv = csv // sep csv = csv // trim(strings(i)) end do end function end module operator_overloading_13_module program operator_overloading_13 use operator_overloading_13_module, only: operator(.separatedBy.) implicit none character(len=:), allocatable :: csv character(len=*), dimension(3), parameter :: strings = ["abc", "def", "ghi"] csv = "," .separatedBy. strings print *, "CSV Result: ", trim(csv) if (trim(csv) /= "abc,def,ghi") error stop end program lfortran-0.63.0/integration_tests/dfloat_01.f900000664000175000017500000000016715174404631021462 0ustar alastairalastairprogram dfloat_01 integer :: a a = -2 print *, DFLOAT(a) if (abs(DFLOAT(a) - (-2.0D0)) > 1e-10) error stop end program lfortran-0.63.0/integration_tests/slash_init_01.f900000664000175000017500000000105515174404631022343 0ustar alastairalastairprogram slash_init_01 implicit none ! Scalar slash-initialization without :: integer j/-20/, k/20/ integer m/42/ real x/1.0/ ! Scalar slash-initialization (no :: needed for this legacy syntax) integer n/100/ ! Array slash-initialization integer arr(3)/1,2,3/ ! Verify scalar values if (j /= -20) error stop if (k /= 20) error stop if (m /= 42) error stop if (x /= 1.0) error stop if (n /= 100) error stop ! Verify array values if (arr(1) /= 1) error stop if (arr(2) /= 2) error stop if (arr(3) /= 3) error stop print *, "All tests passed" end program lfortran-0.63.0/integration_tests/submodule_29b.f900000664000175000017500000000040715174404631022361 0ustar alastairalastairmodule submodule_29_mod implicit none integer, parameter :: multiplier = 5 interface module subroutine greet(x, y) integer, intent(in) :: x integer, intent(out) :: y end subroutine end interface end module lfortran-0.63.0/integration_tests/intrinsics_107.f900000664000175000017500000000053015174404631022457 0ustar alastairalastairPROGRAM intrinsics_107 integer(4) :: x = 5 integer(8) :: y = 5 WRITE (*,*) trailz(0_4) if ( trailz(0_4) /= 32 ) error stop WRITE (*,*) trailz(0_8) if ( trailz(0_8) /= 64 ) error stop WRITE (*,*) trailz(x) if ( trailz(x) /= 0 ) error stop WRITE (*,*) trailz(y) if ( trailz(y) /= 0 ) error stop END PROGRAMlfortran-0.63.0/integration_tests/select_rank_13.f900000664000175000017500000000267715174404631022516 0ustar alastairalastairmodule example_mod implicit none contains subroutine check_arg(arg) class(*), dimension(..), intent(in) :: arg select rank (assoc => arg) rank (0) select type (assoc) type is (integer) print *, "Received a scalar integer: ", assoc class default error stop end select rank (1) select type (assoc) type is (integer) print *, "Received an array of integers (rank: 1)" ! If needed, access as 1D: print *, assoc class default error stop end select rank (2) select type (assoc) type is (integer) print *, "Received an array of integers (rank: 2)" ! If needed, access as 2D: print *, assoc class default error stop end select rank default print *, "Unsupported array rank: ", rank(arg) error stop end select end subroutine check_arg end module example_mod program test use example_mod implicit none integer :: scalar_int = 42 integer :: int_array1(3) = [1, 2, 3] integer :: int_array2(2,2) = reshape([1,2,3,4], [2,2]) call check_arg(scalar_int) ! Outputs: Received a scalar integer: 42 call check_arg(int_array1) ! Outputs: Received an array of integers (rank: 1) call check_arg(int_array2) ! Outputs: Received an array of integers (rank: 2) end program test lfortran-0.63.0/integration_tests/separate_compilation_07c.c0000664000175000017500000000024215174404631024402 0ustar alastairalastair#include #include #define MPI_STATUS_SIZE 5 void mpi_init_wrapper(int *ierr) { int argc = 0; char **argv = NULL; *ierr = 5; } lfortran-0.63.0/integration_tests/interface_17.f900000664000175000017500000000157015174404631022157 0ustar alastairalastairmodule module_interface_17 interface precv module procedure precv_d_3d module procedure precv_d_2d end interface precv contains subroutine precv_d_2d ( val, nx ) real, dimension(nx, nx), intent(in) :: val integer, intent(in) :: nx print *, sum(val) if (abs(sum(val) - 318.560028) > 1e-8) error stop end subroutine precv_d_2d subroutine precv_d_3d ( val, nx ) real, dimension(nx, nx, nx), intent(in) :: val integer, intent(in) :: nx print *, sum(val) if (abs(sum(val) - 1274.23975) > 1e-8) error stop end subroutine precv_d_3d subroutine sweep_recv_bdry ( nz ) real, dimension(nz, nz, nz):: jb_in real, dimension(nz, nz):: jb_in_2 integer, intent(in) :: nz jb_in = 19.91 call precv ( jb_in, nz ) jb_in_2 = 19.91 call precv ( jb_in_2, nz ) end subroutine sweep_recv_bdry end module module_interface_17 program interface_17 use module_interface_17 call sweep_recv_bdry(4) end program lfortran-0.63.0/integration_tests/infer_walrus_01.f900000664000175000017500000000107015174404631022703 0ustar alastairalastairprogram infer_walrus_01 implicit none call test() contains subroutine test() x := 42 y := 3.14d0 z := (1.0d0, 2.0d0) flag := .true. s := "hello" if (x /= 42) error stop if (abs(y - 3.14d0) > 1.0d-10) error stop if (abs(real(z) - 1.0d0) > 1.0d-10) error stop if (abs(aimag(z) - 2.0d0) > 1.0d-10) error stop if (.not. flag) error stop if (s /= "hello") error stop x = 100 if (x /= 100) error stop print *, "PASSED" end subroutine end program lfortran-0.63.0/integration_tests/bindc_12.f900000664000175000017500000000142215174404631021265 0ustar alastairalastairprogram bindc_12 use, intrinsic :: iso_c_binding, only : c_char, c_int, c_null_char implicit none interface function c_chdir(path) bind(C, name="chdir") result(stat) import :: c_char, c_int character(kind=c_char, len=1), intent(in) :: path(*) integer(c_int) :: stat end function c_chdir end interface character(kind=c_char, len=1), allocatable :: cpath(:) integer(c_int) :: stat allocate(cpath(5)) cpath = [ '/', 't', 'm', 'p', c_null_char ] if (cpath(5) /= c_null_char) then error stop "C string not NUL terminated" end if stat = c_chdir(cpath) if (stat /= 0) then error stop "chdir failed" end if print *, "OK: chdir(/tmp) succeeded" end program bindc_12 lfortran-0.63.0/integration_tests/dict_test_03_.f900000664000175000017500000000547515174404631022343 0ustar alastairalastairmodule dict_test_03_mod implicit none contains function power2(i, mod_) result(res) integer(8), intent(in) :: i, mod_ integer(8) :: p1, p2, px, py, res if (i == 0 .or. i == 1) then res = 2 ** i return end if p1 = i / 2 p2 = i - p1 px = mod(power2(p1, mod_), mod_) py = mod(power2(p2, mod_), mod_) res = mod(px * py, mod_) end function function generate_key(i) result(key) integer, intent(in) :: i character(len=:), allocatable :: key _lfortran_dict(integer, character(len=:)) :: i2d integer :: mod_, key_digits, digit i2d = _lfortran_dict_constant(0, "a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f", 6, "g", 7, "h", 8, "i", 9, "j") mod_ = int(99997, kind=8) key_digits = int(power2(int(i, kind=8), int(mod_, kind=8))) key = "" do while (key_digits > 0) digit = mod(key_digits, 10) key = key // _lfortran_get_item(i2d, digit) key_digits = key_digits / 10 end do end function subroutine test_dict() type(_lfortran_dict(character(len=:), integer(8))) :: number2cpi character(len=:),allocatable :: key integer :: i, size, cd, size1 integer(8) :: val cd = 1 size = cd * 150 do i = 1000, 1000 + size - 1 key = generate_key(i) val = power2(int(i, kind=8), int(99997, kind=8)) call _lfortran_set_item(number2cpi, key, val) end do size1 = _lfortran_len(number2cpi) do i = 1000, 1000 + size/2 - 1 key = generate_key(i) val = power2(int(i, kind=8), int(99997, kind=8)) if (_lfortran_pop(number2cpi, key) /= val) error stop size1 = size1 - 1 if (_lfortran_len(number2cpi) /= size1) error stop end do do i = 1000, 1000 + size/2 - 1 key = generate_key(i) val = -power2(int(i, kind=8), int(99997, kind=8)) call _lfortran_set_item(number2cpi, key, val) end do do i = 1000, 1000 + size/2 - 1 key = generate_key(i) val = -power2(int(i, kind=8), int(99997, kind=8)) if (_lfortran_get_item(number2cpi, key) /= val) error stop end do do i = 1000, 1000 + size - 1 key = generate_key(i) val = -power2(int(i, kind=8), int(99997, kind=8)) call _lfortran_set_item(number2cpi, key, val) end do do i = 1000, 1000 + size - 1 key = generate_key(i) val = -power2(int(i, kind=8), int(99997, kind=8)) if (_lfortran_get_item(number2cpi, key) /= val) error stop end do do i = 1000 + size/4, 1000 + size/2 - 1 key = generate_key(i) print *, key, _lfortran_get_item(number2cpi, key) end do end subroutine end module program test_dict_main use dict_test_03_mod call test_dict() end program lfortran-0.63.0/integration_tests/class_146.f900000664000175000017500000000046015174404631021404 0ustar alastairalastairprogram class_146 implicit none type :: string_value integer :: raw end type type, extends(string_value) :: toml_keyval character(len=24) :: key end type class(string_value), allocatable :: val allocate(toml_keyval :: val) deallocate(val) end program lfortran-0.63.0/integration_tests/intent_out_allocatable_struct_with_components.f900000664000175000017500000000172615174404631031332 0ustar alastairalastairprogram test_allocatable_struct_with_allocatable_components implicit none type :: container_t integer, allocatable :: data(:) end type type(container_t), allocatable :: arg ! Initial allocation allocate(arg) allocate(arg%data(5)) arg%data = [1, 2, 3, 4, 5] ! Call with intent(out) - must deallocate arg on entry call process(arg) ! Verify re-allocation worked if (.not. allocated(arg)) error stop "arg should be allocated after call" if (size(arg%data) /= 3) error stop "wrong size" if (any(arg%data /= [10, 20, 30])) error stop "wrong data" print *, "PASS" contains subroutine process(x) type(container_t), allocatable, intent(out) :: x ! Intent(out) must deallocate on entry if (allocated(x)) error stop "intent(out) must deallocate on entry" ! Allocate fresh allocate(x) allocate(x%data(3)) x%data = [10, 20, 30] end subroutine end program lfortran-0.63.0/integration_tests/allocate_60.f900000664000175000017500000000105015174404631021772 0ustar alastairalastairprogram allocate_60 implicit none type :: MyType integer :: val = 0 end type MyType type(MyType), allocatable :: arr(:) integer :: call_count call_count = 0 allocate(arr, source = allocator()) if (call_count /= 1) error stop if (size(arr) /= 9) error stop if (arr(1)%val /= 42) error stop if (arr(2)%val /= 0) error stop print *, "ok" contains function allocator() result(arr) type(MyType), allocatable :: arr(:) call_count = call_count + 1 allocate(arr(9)) arr(1) = MyType(42) end function allocator end program allocate_60 lfortran-0.63.0/integration_tests/hashmap_struct_01.f900000664000175000017500000000121115174404631023225 0ustar alastairalastairmodule stdlib_hashmaps_hashmap_struct_01 implicit none type :: open_hashmap_type integer(4) :: slots end type open_hashmap_type end module stdlib_hashmaps_hashmap_struct_01 program hashmap_struct_01 use stdlib_hashmaps_hashmap_struct_01 implicit none type(open_hashmap_type) :: map call in_open_map(map) contains subroutine expand_open_slots(map) type(open_hashmap_type), intent(inout) :: map end subroutine expand_open_slots subroutine in_open_map(map) class(open_hashmap_type), intent(inout) :: map call expand_open_slots(map) end subroutine in_open_map end program lfortran-0.63.0/integration_tests/openmp_23.f900000664000175000017500000000172515174404631021514 0ustar alastairalastairsubroutine initialise_array(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a integer :: i !$omp parallel shared(a) private(i) !$omp do do i = 1, n a(i) = 12.91 end do !$omp end do !$omp end parallel print *, a(1), a(n), a(12), a(12841) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(n) - 12.91) > 1e-8) error stop if (abs(a(12) - 12.91) > 1e-8) error stop if (abs(a(12841) - 12.91) > 1e-8) error stop end subroutine program openmp_23 use omp_lib integer, parameter :: n = 100000 integer :: i real, allocatable :: b(:) interface subroutine initialise_array(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a end subroutine end interface allocate(b(n)) call omp_set_num_threads(4) call initialise_array(n, b) print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/legacy_array_sections_14.f900000664000175000017500000001535115174404631024567 0ustar alastairalastair! Stress test for stack usage when legacy sequence association rewrites a(i) ! to an array section for an external (separate-compilation) assumed-size dummy. ! ! The key is to avoid materializing array-section descriptors when only the ! address of the first element is required. program legacy_array_sections_14 use, intrinsic :: iso_c_binding, only: c_int, c_long implicit none integer, parameter :: n = 300 integer, parameter :: depth = 25 integer, parameter :: check_idx = 150 real, allocatable :: a(:) call limit_stack_bytes(262144_c_long) allocate(a(n)) a = 0.0 call recurse(depth, a) if (abs(a(check_idx) - real(depth)) > 1.0e-6) error stop print *, "PASSED" contains subroutine limit_stack_bytes(bytes) use, intrinsic :: iso_c_binding, only: c_int, c_long implicit none integer(c_long), intent(in) :: bytes integer(c_int), parameter :: rlimit_stack = 3 type, bind(c) :: rlimit_t integer(c_long) :: rlim_cur integer(c_long) :: rlim_max end type rlimit_t interface integer(c_int) function setrlimit(resource, rl) bind(c, name="setrlimit") import :: c_int, rlimit_t integer(c_int), value :: resource type(rlimit_t), intent(in) :: rl end function setrlimit end interface type(rlimit_t) :: rl integer(c_int) :: rc rl%rlim_cur = bytes rl%rlim_max = bytes rc = setrlimit(rlimit_stack, rl) if (rc /= 0) error stop end subroutine limit_stack_bytes recursive subroutine recurse(level, a) implicit none integer, intent(in) :: level real, intent(inout) :: a(*) external :: foo if (level == 0) return ! Many distinct call sites to amplify per-function stack usage. call foo(a(1)) call foo(a(2)) call foo(a(3)) call foo(a(4)) call foo(a(5)) call foo(a(6)) call foo(a(7)) call foo(a(8)) call foo(a(9)) call foo(a(10)) call foo(a(11)) call foo(a(12)) call foo(a(13)) call foo(a(14)) call foo(a(15)) call foo(a(16)) call foo(a(17)) call foo(a(18)) call foo(a(19)) call foo(a(20)) call foo(a(21)) call foo(a(22)) call foo(a(23)) call foo(a(24)) call foo(a(25)) call foo(a(26)) call foo(a(27)) call foo(a(28)) call foo(a(29)) call foo(a(30)) call foo(a(31)) call foo(a(32)) call foo(a(33)) call foo(a(34)) call foo(a(35)) call foo(a(36)) call foo(a(37)) call foo(a(38)) call foo(a(39)) call foo(a(40)) call foo(a(41)) call foo(a(42)) call foo(a(43)) call foo(a(44)) call foo(a(45)) call foo(a(46)) call foo(a(47)) call foo(a(48)) call foo(a(49)) call foo(a(50)) call foo(a(51)) call foo(a(52)) call foo(a(53)) call foo(a(54)) call foo(a(55)) call foo(a(56)) call foo(a(57)) call foo(a(58)) call foo(a(59)) call foo(a(60)) call foo(a(61)) call foo(a(62)) call foo(a(63)) call foo(a(64)) call foo(a(65)) call foo(a(66)) call foo(a(67)) call foo(a(68)) call foo(a(69)) call foo(a(70)) call foo(a(71)) call foo(a(72)) call foo(a(73)) call foo(a(74)) call foo(a(75)) call foo(a(76)) call foo(a(77)) call foo(a(78)) call foo(a(79)) call foo(a(80)) call foo(a(81)) call foo(a(82)) call foo(a(83)) call foo(a(84)) call foo(a(85)) call foo(a(86)) call foo(a(87)) call foo(a(88)) call foo(a(89)) call foo(a(90)) call foo(a(91)) call foo(a(92)) call foo(a(93)) call foo(a(94)) call foo(a(95)) call foo(a(96)) call foo(a(97)) call foo(a(98)) call foo(a(99)) call foo(a(100)) call foo(a(101)) call foo(a(102)) call foo(a(103)) call foo(a(104)) call foo(a(105)) call foo(a(106)) call foo(a(107)) call foo(a(108)) call foo(a(109)) call foo(a(110)) call foo(a(111)) call foo(a(112)) call foo(a(113)) call foo(a(114)) call foo(a(115)) call foo(a(116)) call foo(a(117)) call foo(a(118)) call foo(a(119)) call foo(a(120)) call foo(a(121)) call foo(a(122)) call foo(a(123)) call foo(a(124)) call foo(a(125)) call foo(a(126)) call foo(a(127)) call foo(a(128)) call foo(a(129)) call foo(a(130)) call foo(a(131)) call foo(a(132)) call foo(a(133)) call foo(a(134)) call foo(a(135)) call foo(a(136)) call foo(a(137)) call foo(a(138)) call foo(a(139)) call foo(a(140)) call foo(a(141)) call foo(a(142)) call foo(a(143)) call foo(a(144)) call foo(a(145)) call foo(a(146)) call foo(a(147)) call foo(a(148)) call foo(a(149)) call foo(a(150)) call foo(a(151)) call foo(a(152)) call foo(a(153)) call foo(a(154)) call foo(a(155)) call foo(a(156)) call foo(a(157)) call foo(a(158)) call foo(a(159)) call foo(a(160)) call foo(a(161)) call foo(a(162)) call foo(a(163)) call foo(a(164)) call foo(a(165)) call foo(a(166)) call foo(a(167)) call foo(a(168)) call foo(a(169)) call foo(a(170)) call foo(a(171)) call foo(a(172)) call foo(a(173)) call foo(a(174)) call foo(a(175)) call foo(a(176)) call foo(a(177)) call foo(a(178)) call foo(a(179)) call foo(a(180)) call foo(a(181)) call foo(a(182)) call foo(a(183)) call foo(a(184)) call foo(a(185)) call foo(a(186)) call foo(a(187)) call foo(a(188)) call foo(a(189)) call foo(a(190)) call foo(a(191)) call foo(a(192)) call foo(a(193)) call foo(a(194)) call foo(a(195)) call foo(a(196)) call foo(a(197)) call foo(a(198)) call foo(a(199)) call foo(a(200)) call recurse(level - 1, a) end subroutine recurse end program legacy_array_sections_14 lfortran-0.63.0/integration_tests/complex_29.f900000664000175000017500000000053215174404631021666 0ustar alastairalastair! Test: complex*16 parameter with complex(4) literal - kind cast program complex_29 implicit none complex*16 zero, one, z parameter (zero = (0.0E+0, 0.0E+0), one = (1.0E+0, 0.0E+0)) z = one + zero if (dabs(dble(z) - 1.0d0) > 1.0d-12) error stop if (dabs(dimag(z)) > 1.0d-12) error stop print *, 'PASS' end program lfortran-0.63.0/integration_tests/operator_overloading_18.f900000664000175000017500000000122515174404631024441 0ustar alastairalastairmodule operator_overloading_18_mod implicit none ! Abstract base type type, abstract :: temp contains procedure :: test_equal procedure(is_equal), deferred :: is_same generic :: operator(==) => is_same end type temp abstract interface logical function is_equal(this, other) import :: temp class(temp), intent(in) :: this, other end function is_equal end interface contains subroutine test_equal(a, b) class(temp), intent(in) :: a, b if (a == b) print *, "Hi" end subroutine test_equal end module operator_overloading_18_mod program operator_overloading_18 use operator_overloading_18_mod end programlfortran-0.63.0/integration_tests/modules_28_module2.f900000664000175000017500000000206715174404631023322 0ustar alastairalastairmodule fpm_manifest_dependency use fpm_git, only : git_target_t, git_target_branch implicit none type :: toml_table logical :: inline = .false. end type toml_table type :: error_t character(len=:), allocatable :: message end type error_t type :: dependency_config_t character(len=:), allocatable :: name character(len=:), allocatable :: path type(git_target_t), allocatable :: git end type dependency_config_t contains subroutine new_dependency(self) type(dependency_config_t), intent(out) :: self character(len=:), allocatable :: url, obj self%git = git_target_branch(url, obj) end subroutine new_dependency subroutine new_dependencies(deps, table, root, error) type(dependency_config_t), allocatable, intent(out) :: deps(:) type(toml_table), intent(inout) :: table character(*), intent(in), optional :: root type(error_t), allocatable, intent(out) :: error end subroutine new_dependencies end module fpm_manifest_dependency lfortran-0.63.0/integration_tests/intrinsics_427.f900000664000175000017500000000061315174404631022466 0ustar alastairalastairprogram intrinsics_427 implicit none type :: t integer :: n(3) end type type(t) :: x x%n = [2, 5, 3] call s(x) contains subroutine s(self) type(t), intent(in) :: self real :: a(maxval(self%n)) integer :: i if (size(a) /= 5) error stop do i = 1, size(a) a(i) = real(i) end do if (abs(a(5) - 5.0) > 1e-6) error stop end subroutine end program lfortran-0.63.0/integration_tests/class_99.f900000664000175000017500000000137115174404631021335 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/6787 ! Abstract type-bound operator was rejected by semantic analysis ! Error was: "add doesn't exist inside abstype type" module class_99_abstracted type, abstract :: abstype contains private procedure(addop), deferred :: add generic, public :: operator(+) => add end type abstype abstract interface function addop(a,b) result (r) import :: abstype class(abstype), intent(in) :: a, b class(abstype), allocatable :: r end function addop end interface end module class_99_abstracted module class_99_test use class_99_abstracted end module class_99_test program class_99 use class_99_test print *, "PASS" end program class_99 lfortran-0.63.0/integration_tests/gpu_metal_65.f900000664000175000017500000000101115174404631022165 0ustar alastairalastairprogram gpu_metal_65 ! Test: do concurrent calling a contained function that references ! a host-scope Parameter (constant) variable. The gpu_offload pass ! must clone the Parameter into the duplicated function's scope. implicit none real, parameter :: val = 2.5 real :: y(4) integer :: i do concurrent(i=1:4) y(i) = bar() end do do i = 1, 4 if (abs(y(i) - 2.5) > 1.0e-6) error stop end do print *, "ok" contains pure function bar() result(b) real :: b b = val end function end program lfortran-0.63.0/integration_tests/external_15.f900000664000175000017500000000073615174404631022042 0ustar alastairalastairmodule external_15_mod implicit none integer, parameter :: dp = kind(1d0) contains subroutine root2sqdp(sqrt) real(dp), external :: sqrt real(dp) :: res res = sqrt(2.0_dp)**2 if (abs(res - 2.0_dp) > 1.0e-14_dp) error stop print '(A,F0.16)', 'check sqrt(2.0_dp)**2 = ', res end subroutine root2sqdp end module external_15_mod program external_15 use external_15_mod implicit none intrinsic dsqrt call root2sqdp(dsqrt) end program external_15 lfortran-0.63.0/integration_tests/attr_intrinsic.f900000664000175000017500000000260215174404631022741 0ustar alastairalastair! this program tests 'intrinsic' attribute used in declarations program attr_intrinsic implicit none ! variable 'abs' with same name as intrinsic elemental ! function 'abs' integer, parameter :: abs = 11 integer :: i1, i2 ! variable 'char' with same name as intrinsic elemental ! function 'char' integer, parameter :: char = 19 call sub1() i1 = fun1() call sub2() i2 = fun2() contains subroutine sub1() ! intrinsic 'abs' means, 'abs' used in this subroutine ! is actually the intrinsic elemental function 'abs' intrinsic abs print *, abs(-4) if (abs(-4) /= 4) error stop end subroutine sub1 function fun1() result(i) ! dummy result output integer :: i ! the 'char' here is the variable 'char' not the intrinsic ! function print *, 'variable char: ', char if (char /= 19) error stop end function fun1 subroutine sub2() print *, abs if (abs /= 11) error stop end subroutine sub2 function fun2() result(i) ! dummy result output integer :: i intrinsic char ! the 'char' here is the intrinsic function 'char' not ! the variable 'char' print *, 'intrinsic elemental char(65): ', char(65) if (char(65) /= 'A') error stop end function fun2 end program attr_intrinsic lfortran-0.63.0/integration_tests/character_02.f900000664000175000017500000000131615174404631022143 0ustar alastairalastairmodule character_02_mod implicit none contains pure integer function get_length(i, fmt) result(o) integer, intent(in) :: i character(*), intent(in) :: fmt integer, parameter :: MAX_STR = 100 character(MAX_STR) :: s write(s, fmt) i o = len_trim(s) end function get_length pure function get_string(i) result(o) integer, intent(in) :: i character(4), parameter :: fmt = "(i0)" character(len=get_length(i, fmt)) :: o write(o, fmt) i end function get_string end module character_02_mod program character_02 use character_02_mod implicit none if (get_string(3252) /= "3252") error stop end program character_02 lfortran-0.63.0/integration_tests/doloop_12.f900000664000175000017500000000066315174404631021510 0ustar alastairalastairmodule gg contains function func_arr3(inp_ref) result(ret_arr) integer, intent(in) :: inp_ref integer,allocatable :: ret_arr(:) allocate(ret_arr(1)) ret_arr = [inp_ref] print *, "worked", inp_ref end function end module program p use gg implicit none integer, allocatable :: inp(:) integer :: i =77 do i= 1, 3 inp = func_arr3(i) end do end program lfortran-0.63.0/integration_tests/intrinsics_85.f900000664000175000017500000000237615174404631022416 0ustar alastairalastairprogram intrinsics_85 use iso_fortran_env, only: sp => real32, dp => real64 implicit none integer, parameter :: i1 = maxexponent(0.131_sp) integer, parameter :: i2 = maxexponent(0.12819_dp) integer, parameter :: ar1 = maxexponent([0.131_sp, 0.12819_sp, 0.0_sp]) integer, parameter :: ar2 = maxexponent([1.24_dp, 1.119_dp, 0.0_dp]) real(kind=4) :: x real(kind=8) :: y real(sp) :: arr1(3) = [0.131_sp, 0.12819_sp, 0.0_sp] real(dp) :: arr2(3) = [1.24_dp, 1.239_dp, 0.0_dp] integer :: result print *, i1 if (i1 /= 128) error stop print *, i2 if (i2 /= 1024) error stop print *, ar1 if (ar1 /= 128) error stop print *, ar2 if (ar2 /= 1024) error stop result = maxexponent(x) print *, 'maxexponent(x) = ', result if (result /= 128) error stop result = maxexponent(y) print *, 'maxexponent(y) = ', result if (result /= 1024) error stop result = maxexponent(-214.91) print *, 'maxexponent(-214.91) = ', result if (result /= 128) error stop result = maxexponent(214.91D0) print *, 'maxexponent(214.91D0) = ', result if (result /= 1024) error stop print *, maxexponent(arr1) if (maxexponent(arr1) /= 128) error stop print *, maxexponent(arr2) if (maxexponent(arr2) /= 1024) error stop end program intrinsics_85 lfortran-0.63.0/integration_tests/do_concurrent_07.f900000664000175000017500000000145615174404631023065 0ustar alastairalastair! equivalent to openmp_12.f90 subroutine initialize_array(n, b) use omp_lib implicit none integer, intent(in) :: n real, dimension(n), intent(out) :: b integer :: i do concurrent (i=1:n) shared(b) b(i) = 12.91 end do print *, b(1), b(n) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end subroutine program do_concurrent_07 use omp_lib integer, parameter :: n = 100000 real, dimension(n) :: a print *, a(2) call omp_set_num_threads(4) call initialize_array(n, a) print *, a(1), a(n), a(12), a(12841) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(n) - 12.91) > 1e-8) error stop if (abs(a(12) - 12.91) > 1e-8) error stop if (abs(a(12841) - 12.91) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/file_open_06.f900000664000175000017500000000042215174404631022150 0ustar alastairalastairprogram open_sign_01 implicit none ! Test sign='plus' - should show plus sign for positive numbers open(6, sign='plus') print '(F5.1)', 1.0 ! Don't close unit 6 (stdout) as subsequent prints would have no output print *, "PASS" end program lfortran-0.63.0/integration_tests/goto_04.f900000664000175000017500000000072715174404631021166 0ustar alastairalastairprogram goto_04 implicit none integer :: a, n n = 2 a = 10 ! Jump to the label n - 1 = 1 -> 1 go to (1, 2, 3), n - 1 a = a + 5 1 a = a + 10 2 a = a + 20 3 a = a + 30 if(a /= 70) error stop ! Jump to the label n + 1 = 3 -> 6 go to (4, 5, 6), n + 1 a = a + 5 4 a = a + 40 5 a = a + 50 6 a = a + 60 if(a /= 130) error stop ! Jump to the label n * n = 4 -> noop go to (7, 8, 9), n * n a = a + 5 7 a = a + 70 8 a = a + 80 9 a = a + 90 if(a /= 375) error stop end program lfortran-0.63.0/integration_tests/operator_overloading_20.f900000664000175000017500000000134415174404631024434 0ustar alastairalastairmodule operator_overloading_20_mod implicit none type :: Vector2D real :: x, y contains procedure :: add generic :: operator(+) => add end type Vector2D contains type(Vector2D) function add(this, that) class(Vector2D), intent(in) :: this, that add%x = this%x + that%x add%y = this%y + that%y end function add end module operator_overloading_20_mod program operator_overloading_20 use operator_overloading_20_mod implicit none type(Vector2D) :: v1, v2, v3 v1 = Vector2D(1.0, 2.0) v2 = Vector2D(3.0, 4.0) v3 = v1 + v2 if (abs(v3%x - 4.0) > 1e-5) error stop if (abs(v3%y - 6.0) > 1e-5) error stop end program operator_overloading_20 lfortran-0.63.0/integration_tests/la_constants.f900000664000175000017500000001774715174404631022415 0ustar alastairalastairmodule la_constants_module integer, parameter :: sp = kind(1.e0) real(sp), parameter :: szero = 0.0_sp real(sp), parameter :: shalf = 0.5_sp real(sp), parameter :: sone = 1.0_sp real(sp), parameter :: stwo = 2.0_sp real(sp), parameter :: sthree = 3.0_sp real(sp), parameter :: sfour = 4.0_sp real(sp), parameter :: seight = 8.0_sp real(sp), parameter :: sten = 10.0_sp complex(sp), parameter :: czero = ( 0.0_sp, 0.0_sp ) complex(sp), parameter :: chalf = ( 0.5_sp, 0.0_sp ) complex(sp), parameter :: cone = ( 1.0_sp, 0.0_sp ) character *1, parameter :: sprefix = 'S' character *1, parameter :: cprefix = 'C' real(sp), parameter :: sulp = epsilon(0._sp) real(sp), parameter :: seps = sulp * 0.5_sp real(sp), parameter :: ssafmin = real(radix(0._sp), sp)**max( minexponent(0._sp)-1, 1-maxexponent(0._sp) ) real(sp), parameter :: ssafmax = sone / ssafmin real(sp), parameter :: ssmlnum = ssafmin / sulp real(sp), parameter :: sbignum = ssafmax * sulp real(sp), parameter :: srtmin = sqrt(ssmlnum) real(sp), parameter :: srtmax = sqrt(sbignum) real(sp), parameter :: stsml = real(radix(0._sp), sp)**ceiling( (minexponent(0._sp) - 1) * 0.5_sp) real(sp), parameter :: stbig = real(radix(0._sp), sp)**floor( (maxexponent(0._sp) - digits(0._sp) + 1) * 0.5_sp) real(sp), parameter :: sssml = real(radix(0._sp), sp)**( - floor( (minexponent(0._sp) - digits(0._sp)) * 0.5_sp)) real(sp), parameter :: ssbig = real(radix(0._sp), sp)**( - ceiling( (maxexponent(0._sp) + digits(0._sp) - 1) * 0.5_sp)) integer, parameter :: dp = kind(1.d0) real(dp), parameter :: dzero = 0.0_dp real(dp), parameter :: dhalf = 0.5_dp real(dp), parameter :: done = 1.0_dp real(dp), parameter :: dtwo = 2.0_dp real(dp), parameter :: dthree = 3.0_dp real(dp), parameter :: dfour = 4.0_dp real(dp), parameter :: deight = 8.0_dp real(dp), parameter :: dten = 10.0_dp complex(dp), parameter :: zzero = ( 0.0_dp, 0.0_dp ) complex(dp), parameter :: zhalf = ( 0.5_dp, 0.0_dp ) complex(dp), parameter :: zone = ( 1.0_dp, 0.0_dp ) character *1, parameter :: dprefix = 'D' character *1, parameter :: zprefix = 'Z' real(dp), parameter :: dulp = epsilon(0._dp) real(dp), parameter :: deps = dulp * 0.5_dp real(dp), parameter :: dsafmin = real(radix(0._dp), dp)**max( minexponent(0._dp)-1, 1-maxexponent(0._dp) ) real(dp), parameter :: dsafmax = done / dsafmin real(dp), parameter :: dsmlnum = dsafmin / dulp real(dp), parameter :: dbignum = dsafmax * dulp real(dp), parameter :: drtmin = sqrt(dsmlnum) real(dp), parameter :: drtmax = sqrt(dbignum) real(dp), parameter :: dtsml = real(radix(0._dp), dp)**ceiling( (minexponent(0._dp) - 1) * 0.5_dp) real(dp), parameter :: dtbig = real(radix(0._dp), dp)**floor( (maxexponent(0._dp) - digits(0._dp) + 1) * 0.5_dp) real(dp), parameter :: dssml = real(radix(0._dp), dp)**( - floor( (minexponent(0._dp) - digits(0._dp)) * 0.5_dp)) real(dp), parameter :: dsbig = real(radix(0._dp), dp)**( - ceiling( (maxexponent(0._dp) + digits(0._dp) - 1) * 0.5_dp)) end module program la_constants use la_constants_module print *, "szero: ", szero if ( abs( szero - 0.0_sp) > 1.0e-8) error stop "szero test failed" print *, "shalf: ", shalf if ( abs( shalf - 0.5_sp) > 1.0e-8) error stop "shalf test failed" print *, "sone: ", sone if ( abs( sone - 1.0_sp) > 1.0e-8) error stop "sone test failed" print *, "stwo: ", stwo if ( abs( stwo - 2.0_sp) > 1.0e-8) error stop "stwo test failed" print *,"sthree: ", sthree if( abs( sthree - 3.0_sp) > 1.0e-8) error stop "sthree test failed" print *, "sfour: ", sfour if ( abs( sfour - 4.0_sp) > 1.0e-8) error stop "sfour test failed" print *, "seight: ", seight if ( abs( seight - 8.0_sp) > 1.0e-8) error stop "seight test failed" print *, "sten: ", sten if ( abs( sten - 10.0_sp) > 1.0e-8) error stop "sten test failed" print *, "czero: ", czero if ( abs( real(czero) - 0.0_sp) > 1.0e-8 .or. abs( aimag(czero) - 0.0_sp) > 1.0e-8) error stop "czero test failed" print *, "chalf: ", chalf if ( abs( real(chalf) - 0.5_sp) > 1.0e-8 .or. abs( aimag(czero) - 0.0_sp) > 1.0e-8) error stop "chalf test failed" print *, "cone: ", cone if ( abs( real(cone) - 1.0_sp) > 1.0e-8 .or. abs( aimag(czero) - 0.0_sp) > 1.0e-8) error stop "cone test failed" print *, "sulp: ", sulp if (abs (sulp - 1.19209290e-7) > 1.0e-8) error stop "sulp test failed" print *, "seps: ", seps if (abs (seps - 5.96046448e-8) > 1.0e-8) error stop "seps test failed" print *, "ssafmin: ", ssafmin if (abs (ssafmin - 1.17549435e-38) > 1.0e-8 ) error stop "ssafmin test failed" print *, "ssafmax: ", ssafmax if (abs (ssafmax - 8.50705917302346159e+37) > 1.0) error stop "ssafmax test failed" print *, "ssmlnum: ", ssmlnum if (abs (ssmlnum - 9.86076132e-32) > 1.0e-8 ) error stop "ssmlnum test failed" print *, "sbignum: ", sbignum if (abs (sbignum - 1.01412048018258352e+31) > 1.0e-8) error stop "sbignum test failed" print *, "srtmin: ", srtmin if (abs (srtmin - 3.14018486e-16) > 1.0e-8) error stop "srtmin test failed" print *, "srtmax: ", srtmax if (abs (srtmax - 3.18452583626288650e+15)/srtmax > 2.0e-8) error stop "srtmax test failed" print *, "stsml: ", stsml if (abs (stsml - 1.08420217e-19) > 1.0e-8) error stop "stsml test failed" print *, "stbig: ", stbig if (abs (stbig - 4.50359962737049600e+15) > 1.0e-8) error stop "stbig test failed" print *, "sssml: ", sssml if (abs (sssml - 3.77789318629571617e+22) > 1.0e-8) error stop "sssml test failed" print *, "ssbig: ", ssbig if (abs (ssbig - 1.32348898e-23) > 1.0e-8) error stop "ssbig test failed" print*, "dzero: ", dzero if ( abs( dzero - 0.0_dp) > 1.0d-16) error stop "dzero test failed" print*, "dhalf: ", dhalf if ( abs( dhalf - 0.5_dp) > 1.0d-16) error stop "dhalf test failed" print*, "done: ", done if ( abs( done - 1.0_dp) > 1.0d-16) error stop "done test failed" print*, "dtwo: ", dtwo if ( abs( dtwo - 2.0_dp) > 1.0d-16) error stop "dtwo test failed" print*, "dthree: ", dthree if ( abs( dthree - 3.0_dp) > 1.0d-16) error stop "dthree test failed" print*, "dfour: ", dfour if ( abs( dfour - 4.0_dp) > 1.0d-16) error stop "dfour test failed" print*, "deight: ", deight if ( abs( deight - 8.0_dp) > 1.0d-16) error stop "deight test failed" print*, "dten: ", dten if ( abs( dten - 10.0_dp) > 1.0d-16) error stop "dten test failed" print *, "zzero: ", zzero if (abs(real(zzero) - 0.0_dp) > 1.0d-16 .or. abs(aimag(zzero) - 0.0_dp) > 1.0d-16) error stop "zzero test failed" print *, "zhalf :", zhalf if (abs(real(zhalf) - 0.5_dp) > 1.0d-16 .or. abs(aimag(zhalf) - 0.0_dp) > 1.0d-16) error stop "zhalf test failed" print *, "zone: ", zone if (abs(real(zone) - 1.0_dp) > 1.0d-16 .or. abs(aimag(zone) - 0.0_dp) > 1.0d-16) error stop "zone test failed" print *, "dulp: ", dulp if ( abs(dulp - 2.22044604925031308d-16) > 1.0d-16 ) error stop "dulp test failed" print *, "deps: ", deps if ( abs(deps - 1.11022302462515654d-16) > 1.0d-16 ) error stop "deps test failed" print *, "dsafmin: ", dsafmin if ( abs(dsafmin - 2.22507385850720138d-308) > 1.0d-16 ) error stop "dsafmin test failed" print *, "dsafmax: ", dsafmax if ( abs(dsafmax - 4.49423283715578977d+307) > 1.0d-16 ) error stop "dsafmax test failed" print *, "dsmlnum: ", dsmlnum if ( abs(dsmlnum - 1.00208418000448639d-292) > 1.0d-16 ) error stop "dsmlnum test failed" print *, "dbignum: ", dbignum if ( abs(dbignum - 9.97920154767359906d+291) > 1.0d-16 ) error stop "dbignum test failed" print *, "drtmin: ", drtmin if ( abs(drtmin - 1.00104154759155046d-146) > 1.0d-16 ) error stop "drtmin test failed" print *, "drtmax: ", drtmax if ( abs(drtmax - 9.98959536101117514d+145) > 1.0d-16 ) error stop "drtmax test failed" print *, "dtsml: ", dtsml if ( abs(dtsml - 1.49166814624004135d-154) > 1.0d-16 ) error stop "dtsml test failed" print *, "dtbig: ", dtbig if ( abs(dtbig - 1.99791907220223503d+146) > 1.0d-16 ) error stop "dtbig test failed" print *, "dssml: ", dssml if ( abs(dssml - 4.49891379454319638d+161) > 1.0d-16 ) error stop "dssml test failed" print *, "dsbig: ", dsbig if (abs ( dsbig - 1.1137937474253874d-163) > 1.0d-16) error stop "dsbig test failed" print *, "All tests passed!" end program lfortran-0.63.0/integration_tests/class_13.f900000664000175000017500000000125715174404631021322 0ustar alastairalastairmodule class_13_mod type :: abstract_type contains procedure, nopass :: integer_method, integer_method_function end type abstract_type contains subroutine integer_method(n) integer, intent(out) :: n n = 10 end subroutine integer_method function integer_method_function() result(r) integer :: r r = 12 end function integer_method_function end module class_13_mod program class_13 use class_13_mod implicit none type(abstract_type) :: obj integer :: n n = 11 call obj%integer_method(n) print *, n if (n /= 10) error stop n = obj%integer_method_function() print *, n if (n /= 12) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_148.f900000664000175000017500000000047315174404631022262 0ustar alastairalastairprogram gpu_metal_148 implicit none real :: x(4), y(4) integer :: i x = [1.0, 2.0, 3.0, 4.0] y = 0.0 do concurrent(i=1:4) associate(a => x(i)) associate(b => a) y(i) = b end associate end associate end do print *, y if (any(abs(y - x) > 1.0e-6)) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_70.f900000664000175000017500000000132615174404631022172 0ustar alastairalastairprogram gpu_metal_70 ! Test: elemental intrinsic (abs) on array slice inside do concurrent ! Ensures the GPU offload pass inlines elemental operations on ! ArraySection into element-wise loops before Metal codegen. implicit none real :: a(3, 2), b(3) integer :: l ! Both columns have the same absolute values so the result is ! deterministic regardless of iteration order (avoids data race). a(:,1) = [-1.0, 2.0, -3.0] a(:,2) = [1.0, -2.0, 3.0] do concurrent(l = 1:2) b = abs(a(:,l)) end do ! Both iterations produce [1.0, 2.0, 3.0] if (abs(b(1) - 1.0) > 1.0e-6) error stop if (abs(b(2) - 2.0) > 1.0e-6) error stop if (abs(b(3) - 3.0) > 1.0e-6) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/class_110_module.f900000664000175000017500000000131315174404631022736 0ustar alastairalastairmodule class_110_module implicit none type :: base_type integer :: k contains procedure :: nelements end type base_type type :: wrapper class(base_type), allocatable :: obj contains procedure :: caller end type wrapper contains pure function nelements(self, i) result(n) class(base_type), intent(in) :: self integer, intent(in) :: i integer :: n n = self%k end function nelements subroutine caller(self) class(wrapper), intent(in) :: self real(8), dimension(self%obj%nelements(20)) :: a if (size(a) /= self%obj%k) error stop 1 end subroutine caller end module class_110_module lfortran-0.63.0/integration_tests/string_98.f900000664000175000017500000000054015174404631021532 0ustar alastairalastairprogram trim_param_concat implicit none character(len=*), parameter :: s = 'hello' character(len=*), parameter :: t = 'world' character(len=6) :: r1 character(len=10) :: r2 r1 = trim(s)//'x' if (r1 /= 'hellox') error stop r2 = trim(s)//trim(t) if (r2 /= 'helloworld') error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/lcompilers_test_module.f900000664000175000017500000000201315174404631024456 0ustar alastairalastairmodule lcompilers_test_module use iso_fortran_env, only: sp => real32, dp => real64 interface lcompilers_test module procedure :: lcompilers_test_r32_r32 module procedure :: lcompilers_test_r64_r64 end interface contains elemental impure subroutine lcompilers_test_r32_r32(actual, expected, tol) real(sp), intent(in) :: actual real(sp), intent(in) :: expected real(sp), optional, intent(in) :: tol print *, "actual: ", actual print *, "expected: ", expected if (present(tol)) then if (abs(actual - expected) > tol * 1e-8_sp) error stop else if (abs(actual - expected) > 1e-8_sp) error stop end if end subroutine elemental impure subroutine lcompilers_test_r64_r64(actual, expected, tol) real(dp), intent(in) :: actual real(dp), intent(in) :: expected real(dp), optional, intent(in) :: tol print *, "actual: ", actual print *, "expected: ", expected if (present(tol)) then if (abs(actual - expected) > tol * 1e-12_dp) error stop else if (abs(actual - expected) > 1e-12_dp) error stop end if end subroutine end module lfortran-0.63.0/integration_tests/intrinsics_331.f900000664000175000017500000000151715174404631022464 0ustar alastairalastairsubroutine shift_allocatable_array () real(4), dimension(:), allocatable :: dc allocate (dc(2)) dc = [1, 2] print *, cshift(dc,-1) deallocate(dc) return end program intrinsics_331 implicit none real :: arr1(2) = [1., 2.] real :: arr2(2) call shift_elemements(2, arr1, arr2) print *, arr2 if (any(arr2 /= [2., 1.])) error stop ! TODO: this causes segmentation fault currently ! call shift_allocatable_array() contains ! shifts the elements present in 'in_arr' by one index ! and outputs it in 'out_arr' subroutine shift_elemements(nc, in_arr, out_arr) implicit none integer, intent(in) :: nc real, dimension(nc), intent(in) :: in_arr real, dimension(nc), intent(out) :: out_arr out_arr = cshift(in_arr, shift=1) end end program lfortran-0.63.0/integration_tests/test_ieee_next_up.f900000664000175000017500000000377715174404631023433 0ustar alastairalastair! Test ieee_next_up function (Fortran 2018 standard) program ieee_next_up_01 use, intrinsic :: ieee_arithmetic, only: ieee_next_up, ieee_is_finite implicit none real(4) :: x_sp, next_sp real(8) :: x_dp, next_dp print *, "Testing ieee_next_up..." ! Test 1: Next up from positive value x_sp = 1.0 next_sp = ieee_next_up(x_sp) print *, "ieee_next_up(1.0) =", next_sp if (next_sp <= x_sp) error stop "next_up should be greater than x" ! Test 2: Next up from negative value x_sp = -1.0 next_sp = ieee_next_up(x_sp) print *, "ieee_next_up(-1.0) =", next_sp if (next_sp <= x_sp) error stop "next_up should be greater than x" if (next_sp >= 0.0) error stop "next_up(-1.0) should still be negative" ! Test 3: Next up from zero x_sp = 0.0 next_sp = ieee_next_up(x_sp) print *, "ieee_next_up(0.0) =", next_sp if (next_sp <= 0.0) error stop "next_up(0.0) should be positive" ! Test 4: Relationship with spacing for positive numbers x_sp = 1.0 next_sp = ieee_next_up(x_sp) print *, "Difference: next_up(1.0) - 1.0 =", next_sp - x_sp print *, "spacing(1.0) =", spacing(x_sp) if (abs((next_sp - x_sp) - spacing(x_sp)) > 1e-10) then error stop "next_up - x should equal spacing(x) for positive x" end if ! Test 5: Double precision x_dp = 1.0d0 next_dp = ieee_next_up(x_dp) print *, "ieee_next_up(1.0d0) =", next_dp if (next_dp <= x_dp) error stop "Should be greater" ! Test 6: Large positive value should still give larger value x_sp = huge(x_sp) / 2.0 next_sp = ieee_next_up(x_sp) if (next_sp <= x_sp) error stop "Should be greater even for large x" ! Test 7: From huge(x) should give infinity x_sp = huge(x_sp) next_sp = ieee_next_up(x_sp) print *, "ieee_next_up(huge) =", next_sp if (ieee_is_finite(next_sp)) error stop "next_up(huge) should be infinity" print *, "All ieee_next_up tests passed!" end program ieee_next_up_01 lfortran-0.63.0/integration_tests/intrinsics_447.f900000664000175000017500000000045115174404631022470 0ustar alastairalastairprogram intrinsics_447 implicit none real(8) :: x(2, 2) real :: s(2) x = reshape([1.0_8, 2.0_8, 3.0_8, 4.0_8], [2, 2]) s = sum(sngl(x), 1) / 1.0 if (abs(s(1) - 3.0) > 1.0e-5) error stop if (abs(s(2) - 7.0) > 1.0e-5) error stop print *, s end program intrinsics_447 lfortran-0.63.0/integration_tests/intrinsics_109.f900000664000175000017500000000116515174404631022466 0ustar alastairalastairprogram intrinsics_109 integer, parameter :: N = 2 real :: A(N, N), B(N, N), C(N, N), D(N,N), E(N,N) ! Initialize matrices A and B as 2x2 identity matrices A = reshape([1.0, 0.0, 0.0, 1.0], shape(A)) B = reshape([1.0, 0.0, 0.0, 1.0], shape(B)) ! Perform matrix multiplication: C = A * B C = matmul( matrix_a = A, matrix_b = B ) D = matmul( A, matrix_b = B ) E = matmul( A, B ) ! Print the matrices print *, "Matrix A (2x2 identity matrix):" print *, A print *, "Matrix B (2x2 identity matrix):" print *, B print *, "Matrix C (result of A * B):" print *, C end lfortran-0.63.0/integration_tests/operator_overloading_36.f900000664000175000017500000000047615174404631024450 0ustar alastairalastairprogram operator_overloading_36 use operator_overloading_36_mod_base implicit none type(array_type) :: a, b, c a%val = 3.0 b%val = 5.0 c = a - b if (c%val < -2.01 .or. c%val > -1.99) error stop c = -a if (c%val < -3.01 .or. c%val > -2.99) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/template_simple_04.f900000664000175000017500000000310515174404631023373 0ustar alastairalastairmodule template_simple_04_m requirement operator_r(T, U, V, binary_func) type, deferred :: T type, deferred :: U type, deferred :: V pure elemental function binary_func(lhs, rhs) result(res) type(T), intent(in) :: lhs type(U), intent(in) :: rhs type(V) :: res end function end requirement requirement cast_r(T, cast) type, deferred :: T pure elemental function cast(arg) result(res) integer, intent(in) :: arg type(T) :: res end function end requirement contains pure function generic_sum{T, add, cast}(A) result(res) require :: operator_r(T, T, T, add), cast_r(T, cast) interface operator(+) procedure add end interface type(T), intent(in) :: A(:) type(T) :: res integer :: n, i res = cast(0) do i = 1, size(A) res = res + A(i) end do end function pure elemental integer function cast_integer(arg) result(r) integer, intent(in) :: arg r = arg end function pure elemental real function cast_real(arg) result(r) integer, intent(in) :: arg r = arg end function subroutine test_template() integer :: a_i(10), i, s_i real :: a_r(10), s_r do i = 1, size(a_i) a_i(i) = i a_r(i) = i end do s_i = generic_sum{integer, operator(+), cast_integer}(a_i) s_r = generic_sum{real, operator(+), cast_real}(a_r) print *, s_i print *, s_r if (s_i /= 55) error stop if (abs(s_r - 55) > 1e-5) error stop end subroutine end module program template_simple_04 use template_simple_04_m call test_template() end lfortran-0.63.0/integration_tests/array_concat.f900000664000175000017500000000174515174404631022361 0ustar alastairalastairprogram array_concat integer :: A = 2 integer :: B(3) = [1,2,3] real :: x(4) = [1.0, 2.0, -3.0, 4.0] integer, allocatable :: B2(:) integer :: C(4) logical :: D(4) C = [B, A] print *, C if( C(1) /= 1 .or. C(2) /= 2 .or. C(3) /= 3 .or. C(4) /= 2 ) error stop print *, B(1:3) D = [B, A] > 1 print *, D if( any(D .neqv. [.false., .true., .true., .true.]) ) error stop allocate(B2(size(B))) B2 = B D = [B2, A] > 1 print *, D if( any(D .neqv. [.false., .true., .true., .true.]) ) error stop D = [B([3,2,1]), A] > 1 print *, D if( any(D .neqv. [.true., .true., .false., .true.]) ) error stop D = [B2(2:3), A, A] > 1 print *, D if( any(D .neqv. [.true., .true., .true., .true.]) ) error stop call temp(x) contains subroutine temp(x) real, intent(in) :: x(:) real :: xx(size(x)) real :: tn(size(x) - 1) logical :: y tn = x(1:size(x)-1) xx = x y = any(xx <= 0 .and. abs([tn, 0.0]) > 0) print *, y if( y .neqv. .true.) error stop end subroutine end programlfortran-0.63.0/integration_tests/modules_07.f900000664000175000017500000000011715174404631021662 0ustar alastairalastairprogram modules_07 use modules_07_module, only: b implicit none call b() end lfortran-0.63.0/integration_tests/modules_31_module1.f900000664000175000017500000000235115174404631023307 0ustar alastairalastairmodule fpm_dependency_modules_31 implicit none type :: error_t character(len=:), allocatable :: message end type error_t type :: dependency_config_t character(len=:), allocatable :: name character(len=:), allocatable :: path end type dependency_config_t type, extends(dependency_config_t) :: dependency_node_t character(len=:), allocatable :: proj_dir character(len=:), allocatable :: revision logical :: done = .false. logical :: update = .false. end type dependency_node_t type :: dependency_tree_t integer :: unit integer :: verbosity character(len=:), allocatable :: dep_dir integer :: ndep type(dependency_node_t), allocatable :: dep(:) character(len=:), allocatable :: cache contains generic :: update => update_dependency procedure, private :: update_dependency end type dependency_tree_t contains subroutine update_dependency(self, name, error) class(dependency_tree_t), intent(inout) :: self character(len=*), intent(in) :: name type(error_t), allocatable, intent(out) :: error end subroutine update_dependency end module fpm_dependency_modules_31 lfortran-0.63.0/integration_tests/separate_compilation_14.f900000664000175000017500000000031315174404631024410 0ustar alastairalastairprogram separate_compilation_14a use separate_compilation_14a_module print *, global_var print *, global_var_initialised if (global_var_initialised /= 89) error stop end program separate_compilation_14a lfortran-0.63.0/integration_tests/doloop_17.f900000664000175000017500000000064715174404631021517 0ustar alastairalastairmodule doloop_17_mod implicit none contains function test_func(input) result(output) character(len=*), intent(in) :: input character(len=len(input)) :: output output = 'k' end function test_func end module doloop_17_mod program doloop_17 use doloop_17_mod implicit none integer :: i = 1 do i = 1, 5 print *, test_func('a') end do end program doloop_17 lfortran-0.63.0/integration_tests/automatic_allocation_02.f900000664000175000017500000000071115174404631024400 0ustar alastairalastairprogram automatic_allocation_02 implicit none integer, allocatable :: i real, allocatable :: r complex, allocatable :: c logical, allocatable :: l i = 10 r = 4.4 c = (1, 2) l = .true. if (i /= 10) error stop if (r /= 4.4) error stop if (c /= (1, 2)) error stop if (l .neqv. .true.) error stop deallocate(i) deallocate(r) deallocate(c) deallocate(l) end program automatic_allocation_02 lfortran-0.63.0/integration_tests/string_50.f900000664000175000017500000000047115174404631021521 0ustar alastairalastair! Test using kind=8 with character allocation program string_50 character(:), allocatable :: ret integer(8) :: i i = 10 allocate(character(i) :: ret) print *, len(ret) if(len(ret) /= 10) error stop ret = "Hello" print *, len(ret) if(len(ret) /= 5 ) error stop end program lfortran-0.63.0/integration_tests/stop_02.f900000664000175000017500000000007415174404631021174 0ustar alastairalastairprogram stop_02 implicit none stop 10 end program lfortran-0.63.0/integration_tests/functions_55.f900000664000175000017500000000236415174404631022233 0ustar alastairalastair! Test procedure pointer with parametric return type ! The return type dimension depends on the argument via size(n) module functions_55_mod implicit none type :: WrapperType procedure(op_interface), pointer, nopass :: op => null() end type WrapperType interface function op_interface(n) result(res) integer, intent(in) :: n(:) integer :: res(size(n)) end function op_interface end interface contains subroutine apply_op(obj) class(WrapperType), intent(in) :: obj integer, allocatable :: arr(:) allocate(arr(4)) arr = [1, 2, 3, 4] arr = obj%op(arr) if (arr(1) /= 2) error stop if (arr(2) /= 4) error stop if (arr(3) /= 6) error stop if (arr(4) /= 8) error stop end subroutine apply_op end module functions_55_mod program functions_55 use functions_55_mod, only: WrapperType, apply_op implicit none type(WrapperType) :: obj obj%op => double_array call apply_op(obj) print *, "ok" contains function double_array(n) result(res) integer, intent(in) :: n(:) integer :: res(size(n)) integer :: i do i = 1, size(n) res(i) = n(i) * 2 end do end function double_array end program functions_55 lfortran-0.63.0/integration_tests/declaration_05.f900000664000175000017500000000110315174404631022471 0ustar alastairalastair! Test labels on type declaration statements (Fortran 90+ allows labels on declarations) program label_on_declaration_01 implicit none 10 integer :: i 20 real :: x 30 character(len=10) :: str 40 logical :: flag 50 real, dimension(5) :: arr i = 42 x = 3.14 str = "test" flag = .true. arr = [1.0, 2.0, 3.0, 4.0, 5.0] if (i /= 42) error stop if (abs(x - 3.14) > 1e-6) error stop if (str /= "test") error stop if (.not. flag) error stop if (abs(arr(3) - 3.0) > 1e-6) error stop end program label_on_declaration_01 lfortran-0.63.0/integration_tests/parameter_01.f900000664000175000017500000000017015174404631022163 0ustar alastairalastairprogram parameter_01 implicit none integer :: i, j, k parameter(i = 1) parameter(j=2, k=3) print *, i, j, k end program lfortran-0.63.0/integration_tests/cpp_pre_12.f900000664000175000017500000000065415174404631021644 0ustar alastairalastairprogram cpp_pre_12 implicit none call print_build_info() contains subroutine print_build_info() !! Print the build information of the program. implicit none write(*,'("ATHENA: & &Adaptive Training for High Efficiency Neural network Applications")') write(*,'(" (build ",A,1X,A,")")') __DATE__, __TIME__ end subroutine print_build_info end program cpp_pre_12lfortran-0.63.0/integration_tests/operator_overloading_16.f900000664000175000017500000000224015174404631024435 0ustar alastairalastairmodule operator_overloading_16_mod implicit none type, abstract :: base contains procedure(is_equal_ifc), deferred :: is_equal generic :: operator(==) => is_equal end type base abstract interface logical function is_equal_ifc(a, b) import :: base class(base), intent(in) :: a, b end function is_equal_ifc end interface type, extends(base) :: derived_1 integer :: val character(len=:), allocatable :: str contains procedure :: is_equal => d1_equal end type derived_1 contains logical function d1_equal(a, b) class(derived_1), intent(in) :: a class(base), intent(in) :: b select type(b) type is (derived_1) d1_equal = a%val == b%val class default d1_equal = .false. end select end function d1_equal end module operator_overloading_16_mod program operator_overloading_16 use operator_overloading_16_mod implicit none type(derived_1) :: x, y logical :: res x%val = 42 y%val = 41 x%str = "Hello" y%str = "World" res = x == y if (res) error stop y%str = "Hello" y%val = 42 res = x == y if (.not. res) error stop end program operator_overloading_16 lfortran-0.63.0/integration_tests/format_65.f900000664000175000017500000000076115174404631021513 0ustar alastairalastairprogram format_65 implicit none real :: zero = 0.0, pos_inf, neg_inf, nan_val character(len=9) :: buf pos_inf = 1.0/zero neg_inf = -1.0/zero nan_val = 0.0/zero ! F format: Infinity fits in width 9 write(buf, "(F9.0)") pos_inf if (adjustl(buf) /= "Infinity") error stop write(buf, "(F9.0)") neg_inf if (buf /= "-Infinity") error stop write(buf, "(F9.0)") nan_val if (adjustl(buf) /= "NaN") error stop print *, "PASS" end program format_65 lfortran-0.63.0/integration_tests/intrinsics_419.f900000664000175000017500000000110315174404631022462 0ustar alastairalastairprogram intrinsics_419 ! Test maxval/minval with dim argument on pointer arrays implicit none real, pointer :: work(:) real :: nrm integer, pointer :: iwork(:) integer :: ival allocate(work(5)) work = [1.0, 5.0, 3.0, 4.0, 2.0] nrm = maxval(work, 1) print *, nrm if (nrm /= 5.0) error stop nrm = minval(work, 1) print *, nrm if (nrm /= 1.0) error stop allocate(iwork(4)) iwork = [10, 40, 20, 30] ival = maxval(iwork, 1) print *, ival if (ival /= 40) error stop ival = minval(iwork, 1) print *, ival if (ival /= 10) error stop deallocate(work) deallocate(iwork) end program lfortran-0.63.0/integration_tests/derived_types_89.f900000664000175000017500000000066515174404631023102 0ustar alastairalastairprogram derived_types_89 implicit none type :: package_t character(len=100), allocatable :: modules_provided(:) end type package_t type(package_t) :: empty_pkg, pkg pkg = empty_pkg print *, allocated(empty_pkg % modules_provided) print *, allocated(pkg % modules_provided) if (allocated(empty_pkg % modules_provided)) error stop if (allocated(pkg % modules_provided)) error stop end programlfortran-0.63.0/integration_tests/procedure_01.f900000664000175000017500000000104015174404631022170 0ustar alastairalastairmodule procedure_01_module implicit none abstract interface integer function fn(n) integer, intent(in) :: n end function end interface contains integer function plus(f, x) procedure(fn) :: f integer, intent(in) :: x plus = f(x+4) end function end module program procedure_01 use procedure_01_module, only: plus implicit none integer :: i i = plus(myf, 5) print *, i if (i /= 18) error stop contains integer function myf(n) integer, intent(in) :: n myf = 2*n end function end program lfortran-0.63.0/integration_tests/intrinsics_328.f900000664000175000017500000000143315174404631022467 0ustar alastairalastairmodule intrinsics_238_module implicit none contains subroutine test_diag_int16() integer, parameter :: n = 4 integer :: a(n, n), e(n,n) a = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [n, n]) e = diag1(diag(a)) print *, sum(a) if (sum(a) /= 136) error stop contains function diag(A) result(res) integer, intent(in) :: A(:,:) integer :: res(minval(shape(A))) integer :: i do i = 1, minval(shape(A)) res(i) = A(i, i) end do end function diag function diag1(v) result(res) integer, intent(in) :: v(:) integer :: res(size(v),size(v)) integer :: i res = 0 do i = 1, size(v) res(i, i) = v(i) end do end function diag1 end subroutine test_diag_int16 end module program intrinsics_238 use intrinsics_238_module implicit none call test_diag_int16() end program lfortran-0.63.0/integration_tests/arrays_70.f900000664000175000017500000001035715174404631021522 0ustar alastairalastairprogram arrays_70 implicit none integer :: A(4) = [1,2,3,4] integer :: A1(3,3) = reshape([1,2,3,4,5,6,7,8,9], [3,3]) integer :: A2(2,2,2) = reshape([1,2,3,4,5,6,7,8], [2,2,2]) integer :: tmp(2,2) = reshape([5,5,5,5], [2,2]) call temp(A, A1, A2, tmp) contains subroutine temp(A, A1, A2, tmp) integer, intent(inout) :: A(:) integer, intent(inout) :: A1(:,:) integer, intent(inout) :: A2(:,:,:) integer, intent(inout) :: tmp(:,:) !!!! ArrayItem = ArrayItem A([1,2]) = A([2,1]) if (A(1) /= 2 .or. A(2) /= 1) error stop A1([1,2],1) = A1([2,1],1) if (A1(1,1) /= 2 .or. A1(2,1) /= 1 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 4 .or. A1(2,2) /= 5 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 7 .or. A1(2,3) /= 8 .or. A1(3,3) /= 9) error stop A1([1,2],[2,3]) = A1([2,1],[2,3]) if (A1(1,1) /= 2 .or. A1(2,1) /= 1 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 4 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 8 .or. A1(2,3) /= 7 .or. A1(3,3) /= 9) error stop A1([1,2],1) = A1(1,[1,2]) if (A1(1,1) /= 2 .or. A1(2,1) /= 5 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 4 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 8 .or. A1(2,3) /= 7 .or. A1(3,3) /= 9) error stop A2(1,[1,2],[1,2]) = A2([1,2],[2,1],1) if (A2(1,1,1) /= 3 .or. A2(2,1,1) /= 2 .or. A2(1,2,1) /= 4 .or. A2(2,2,1) /= 4 .or. & & A2(1,1,2) /= 1 .or. A2(2,1,2) /= 6 .or. A2(1,2,2) /= 2 .or. A2(2,2,2) /= 8) error stop !!!! ArrayItem = ArrayConstant A([1,2]) = [5,5] if (A(1) /= 5 .or. A(2) /= 5) error stop A1([1,2],1) = [5,5] if (A1(1,1) /= 5 .or. A1(2,1) /= 5 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 4 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 8 .or. A1(2,3) /= 7 .or. A1(3,3) /= 9) error stop A1([1,2],[1,2]) = tmp if (A1(1,1) /= 5 .or. A1(2,1) /= 5 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 5 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 8 .or. A1(2,3) /= 7 .or. A1(3,3) /= 9) error stop A2([1,2],1,1) = [5,5] if (A2(1,1,1) /= 5 .or. A2(2,1,1) /= 5 .or. A2(1,2,1) /= 4 .or. A2(2,2,1) /= 4 .or. & & A2(1,1,2) /= 1 .or. A2(2,1,2) /= 6 .or. A2(1,2,2) /= 2 .or. A2(2,2,2) /= 8) error stop A2([1,2],1,[1,2]) = tmp if (A2(1,1,1) /= 5 .or. A2(2,1,1) /= 5 .or. A2(1,2,1) /= 4 .or. A2(2,2,1) /= 4 .or. & & A2(1,1,2) /= 5 .or. A2(2,1,2) /= 5 .or. A2(1,2,2) /= 2 .or. A2(2,2,2) /= 8) error stop !!! LHS and RHS contains common variable A = A([3,1,2,4]) if (A(1) /= 3 .or. A(2) /= 5 .or. A(3) /= 5 .or. A(4) /= 4) error stop A1 = A1(:,[3,2,1]) if (A1(1,1) /= 8 .or. A1(2,1) /= 7 .or. A1(3,1) /= 9 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 5 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 5 .or. A1(2,3) /= 5 .or. A1(3,3) /= 3) error stop A2 = A2(:,[2,1],:) if (A2(1,1,1) /= 4 .or. A2(2,1,1) /= 4 .or. A2(1,2,1) /= 5 .or. A2(2,2,1) /= 5 .or. & & A2(1,1,2) /= 2 .or. A2(2,1,2) /= 8 .or. A2(1,2,2) /= 5 .or. A2(2,2,2) /= 5) error stop A1(1,1:2) = A1(1,[2,1]) - A(1:2) if (A1(1,1) /= 2 .or. A1(2,1) /= 7 .or. A1(3,1) /= 9 .or. & & A1(1,2) /= 3 .or. A1(2,2) /= 5 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 5 .or. A1(2,3) /= 5 .or. A1(3,3) /= 3) error stop A1 = A1 * A1(1,1) if (A1(1,1) /= 4 .or. A1(2,1) /= 14 .or. A1(3,1) /= 18 .or. & & A1(1,2) /= 6 .or. A1(2,2) /= 10 .or. A1(3,2) /= 12 .or. & & A1(1,3) /= 10 .or. A1(2,3) /= 10 .or. A1(3,3) /= 6) error stop A2(:,1,:) = A2(1,:,:) * A2(1,1,1) if (A2(1,1,1) /= 16 .or. A2(2,1,1) /= 20 .or. A2(1,2,1) /= 5 .or. A2(2,2,1) /= 5 .or. & & A2(1,1,2) /= 8 .or. A2(2,1,2) /= 20 .or. A2(1,2,2) /= 5 .or. A2(2,2,2) /= 5) error stop A1([2,1],[1,2]) = A1([1,2],[3,2]) * A1(2,1) if (A1(1,1) /= 140 .or. A1(2,1) /= 140 .or. A1(3,1) /= 18 .or. & & A1(1,2) /= 140 .or. A1(2,2) /= 84 .or. A1(3,2) /= 12 .or. & & A1(1,3) /= 10 .or. A1(2,3) /= 10 .or. A1(3,3) /= 6) error stop end subroutine end programlfortran-0.63.0/integration_tests/class_95.f900000664000175000017500000000122215174404631021324 0ustar alastairalastairprogram class_95 implicit none character(len=5) :: arr(2) = ["hello", "world"] call driver(arr) contains subroutine driver(generic) class(*) :: generic(:) select type (generic) type is (character(len=*)) call get_fixedarray_fixed_length_c(generic) class default print *, "Unsupported type" end select end subroutine driver subroutine get_fixedarray_fixed_length_c(x) character(len=5), intent(in) :: x(2) if (x(1) /= "hello") error stop if (x(2) /= "world") error stop end subroutine get_fixedarray_fixed_length_c end program class_95 lfortran-0.63.0/integration_tests/logical_not_01.f900000664000175000017500000000047615174404631022506 0ustar alastairalastairsubroutine test_falseloc_pack() real, allocatable :: bvec(:) logical :: lvec(10) allocate(bvec(10)) bvec = 0 print *, .not. (bvec > 0) lvec = .not. (bvec > 0) print *, lvec if (any(.not. lvec)) error stop end subroutine program logical_not_01 call test_falseloc_pack() end program lfortran-0.63.0/integration_tests/type_bound_generic_member_access_01.f900000664000175000017500000000473015174404631026725 0ustar alastairalastairmodule err_mod implicit none type :: error_t integer :: code = 0 end type error_t end module err_mod module toml_mod implicit none type :: toml_table integer :: x = 0 end type toml_table end module toml_mod module base_mod use err_mod, only: error_t use toml_mod, only: toml_table implicit none type, abstract :: serializable_t contains procedure(load_toml), deferred :: load_from_toml procedure, private :: load_from_unit generic :: load => load_from_toml, load_from_unit end type serializable_t abstract interface subroutine load_toml(self, table, error) import :: serializable_t, toml_table, error_t class(serializable_t), intent(inout) :: self type(toml_table), intent(inout) :: table type(error_t), allocatable, intent(out) :: error end subroutine load_toml end interface contains subroutine load_from_unit(self, unit, error) class(serializable_t), intent(inout) :: self integer, intent(in) :: unit type(error_t), allocatable, intent(out) :: error end subroutine load_from_unit end module base_mod module derived_mod use base_mod use err_mod, only: error_t use toml_mod, only: toml_table implicit none type, extends(serializable_t) :: cmd_t contains procedure :: load_from_toml => cmd_load end type cmd_t type, extends(serializable_t) :: table_t type(cmd_t), allocatable :: command(:) contains procedure :: load_from_toml => table_load end type table_t contains subroutine cmd_load(self, table, error) class(cmd_t), intent(inout) :: self type(toml_table), intent(inout) :: table type(error_t), allocatable, intent(out) :: error table%x = table%x + 1 end subroutine cmd_load subroutine table_load(self, table, error) class(table_t), intent(inout) :: self type(toml_table), intent(inout) :: table type(error_t), allocatable, intent(out) :: error type(toml_table), target :: elem type(toml_table), pointer :: p integer :: i allocate(self%command(1)) p => elem do i = 1, 1 call self%command(i)%load(p, error) end do end subroutine table_load end module derived_mod program type_bound_generic_member_access_01 use derived_mod use toml_mod, only: toml_table use err_mod, only: error_t implicit none type(table_t) :: t type(toml_table) :: tab type(error_t), allocatable :: err call t%load(tab, err) if (allocated(err)) error stop 1 print *, "OK" end program type_bound_generic_member_access_01 lfortran-0.63.0/integration_tests/modules_26.f900000664000175000017500000000172715174404631021673 0ustar alastairalastairmodule modern_minpack implicit none contains subroutine fdjac1(fcn1) implicit none interface subroutine fcn1(n1, x) implicit none integer, intent(in) :: n1 real, intent(in) :: x(n1) end subroutine fcn1 end interface end subroutine subroutine fdjac2(fcn, m) implicit none integer, intent(in) :: m interface subroutine fcn(m) implicit none integer, intent(in) :: m end subroutine end interface call fcn(m) end subroutine fdjac2 end module modern_minpack program main use modern_minpack implicit none call fdjac1(fcn) call fdjac2(fcn2, 1) contains subroutine fcn(n, x) implicit none integer, intent(in) :: n real, intent(in) :: x(n) end subroutine fcn subroutine fcn2(m) implicit none integer, intent(in) :: m end subroutine fcn2 end program lfortran-0.63.0/integration_tests/modules_63_module.f900000664000175000017500000000040515174404631023231 0ustar alastairalastairmodule mre_read_string_fmt_mod contains subroutine temp() character(len=:), allocatable :: str str = "'control char "//achar(0)//"','normal literal'" if (len(str) /= 33) error stop end subroutine temp end module mre_read_string_fmt_mod lfortran-0.63.0/integration_tests/string_102.f900000664000175000017500000000110215174404631021567 0ustar alastairalastairprogram string_102 ! Test character array slice assignment where the second array has ! character(len=len(first_array)) type and first array is assumed-length. implicit none character(len=5) :: a(4), b(4) a = "hello" b = "world" call test(a, b) if (a(1) /= "world") error stop if (a(2) /= "world") error stop if (a(3) /= "hello") error stop if (a(4) /= "hello") error stop print *, "ok" contains subroutine test(a, b) character(len=*), intent(inout) :: a(:) character(len=len(a)), intent(inout) :: b(:) a(1:2) = b(1:2) end subroutine end program lfortran-0.63.0/integration_tests/separate_compilation_39.f900000664000175000017500000000036115174404631024422 0ustar alastairalastairprogram separate_compilation_39 use separate_compilation_39a, only: recursive_t, noop implicit none type(recursive_t(kind(1.0))) :: x call noop() if (allocated(x%next)) error stop 1 end program separate_compilation_39 lfortran-0.63.0/integration_tests/struct_type_11.f900000664000175000017500000000061515174404631022575 0ustar alastairalastairmodule struct_type_11_mod use, intrinsic :: iso_c_binding, only: c_funptr, c_null_funptr implicit none type, bind(c) :: callbacks type(c_funptr) :: cb = c_null_funptr end type callbacks end module struct_type_11_mod program struct_type_11 use struct_type_11_mod, only: callbacks implicit none type(callbacks) :: x print *, "ok" end program struct_type_11 lfortran-0.63.0/integration_tests/bin_op_complex_dp.f900000664000175000017500000000030415174404631023362 0ustar alastairalastairprogram bin_op_complex_dp complex(4) :: zero complex(8) :: v, u complex :: x zero = 1.0_4/7 u = 1.0_4/7 v = 1.0_8/7 x = 1.0_4/7 print *, zero, v, x, u end programlfortran-0.63.0/integration_tests/arrays_19.f900000664000175000017500000000027515174404631021523 0ustar alastairalastairprogram print_array integer :: xarr(3) xarr(1) = 1 xarr(2) = 2 xarr(3) = 3 call f(3, xarr) contains subroutine f(n, x) integer :: n, x(n) print *, x end subroutine end program lfortran-0.63.0/integration_tests/associate_29.f900000664000175000017500000000054615174404631022177 0ustar alastairalastairprogram associate_29 implicit none integer :: n1, n2, i real, allocatable, target :: data(:) real, pointer :: p(:,:) n1 = 3 n2 = 2 allocate(data(n1*n2)) do i = 1, n1*n2 data(i) = real(i) end do p(1:n1, 1:n2) => data(1:n1*n2) if (any(p /= reshape([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], [3, 2]))) error stop end program associate_29 lfortran-0.63.0/integration_tests/pass_array_by_data_12.f900000664000175000017500000000114015174404631024032 0ustar alastairalastairmodule pass_array_by_data_12_mod implicit none type :: downloader_t contains procedure, nopass :: upload_form end type downloader_t contains subroutine upload_form(form_data) integer, intent(inout) :: form_data(:) integer :: i do i = 1, size(form_data) form_data(i) = i end do end subroutine upload_form end module pass_array_by_data_12_mod program pass_array_by_data_12 use pass_array_by_data_12_mod implicit none type(downloader_t) :: d integer :: arr(5) call d%upload_form(arr) if (any(arr /= [1,2,3,4,5])) error stop end program pass_array_by_data_12lfortran-0.63.0/integration_tests/format_83.f900000664000175000017500000000140515174404631021507 0ustar alastairalastairprogram format_83 implicit none character(len=5) :: a, b, pad integer :: ios ! Create file with only ONE word open(10, file='format_83_data.txt', status='replace') write(10, '(A)') 'HELLO' close(10) a = "-----" b = "-----" open(10, file='format_83_data.txt', pad='yes') read(10, '(A5, A5)', iostat=ios) a, b inquire(10, pad=pad) if (pad /= "YES") error stop if (ios /= 0) error stop if (b /= " ") error stop close(10) a = "-----" b = "-----" open(10, file='format_83_data.txt', pad='no') read(10, '(A5, A5)', iostat=ios) a, b inquire(10, pad=pad) if (pad /= "NO") error stop if (ios == 0) error stop if (b /= "-----") error stop close(10) end program format_83 lfortran-0.63.0/integration_tests/module_function_with_nopass.f900000664000175000017500000000272015174404631025516 0ustar alastairalastairmodule modules_module_function_with_nopass implicit none private public :: calculator, SQUARE ! Expose both the type and the SQUARE function type :: calculator contains procedure, nopass :: SQUARE ! Associate SQUARE with the calculator type procedure, nopass :: AREA end type calculator contains ! Define SQUARE as a module procedure. function SQUARE(x) result(square_result) integer, optional, intent(in) :: x integer :: square_result if (present(x)) then square_result = x * x else square_result = 1 end if end function SQUARE function AREA(x, y) result(area_result) integer, optional, intent(in) :: x integer, optional, intent(in) :: y integer :: area_result if (present(x) .and. present(y)) then area_result = x * y else area_result = 1 end if end function end module modules_module_function_with_nopass program module_function_with_nopass use modules_module_function_with_nopass implicit none type(calculator) :: calc integer :: number, result, area1, area2, area3 number = 4 result = calc%SQUARE(number) if (result /= 16) error stop area1 = calc%AREA() if (area1 /= 1) error stop area2 = calc%AREA(1, 2) if (area2 /= 2) error stop area3 = calc%AREA(1) if (area3 /= 1) error stop end program module_function_with_nopass lfortran-0.63.0/integration_tests/complex_13.f900000664000175000017500000000027715174404631021665 0ustar alastairalastairprogram main implicit none complex(8) :: l complex(4) :: z l=cmplx(3,-4) z=l print *,z if (real(z) /= 3) error stop if (aimag(z) /= -4) error stop end program lfortran-0.63.0/integration_tests/class_74.f900000664000175000017500000000176315174404631021333 0ustar alastairalastairmodule class_74_mod implicit none type :: toml_table integer :: count = 0 contains procedure :: push_back end type toml_table type :: toml_parser type(toml_table), pointer :: table type(toml_table), allocatable :: table2 end type toml_parser contains subroutine push_back(self) class(toml_table), intent(inout) :: self self%count = self%count + 1 end subroutine push_back end module class_74_mod program class_74 use class_74_mod implicit none type(toml_table), target :: tab class(toml_parser), allocatable :: parser allocate(parser) parser%table => tab parser%table2 = tab call add_table(parser%table) call add_table(parser%table2) print *, parser%table%count print *, parser%table2%count if (parser%table%count /= 1) error stop if (parser%table2%count /= 1) error stop contains subroutine add_table(table) class(toml_table), intent(inout) :: table call table%push_back() end subroutine add_table end program class_74 lfortran-0.63.0/integration_tests/separate_compilation_04b.f900000664000175000017500000000030215174404631024547 0ustar alastairalastairmodule separate_compilation_04b_module use separate_compilation_04a_module implicit none contains subroutine temp(A) real, allocatable :: A(:, :) call resol_lu(A) end subroutine end module lfortran-0.63.0/integration_tests/dict_test_01.f900000664000175000017500000000175315174404631022175 0ustar alastairalastairprogram dict_test_01 implicit none real :: eps = 1e-6 _lfortran_dict(integer, integer(4)):: dict_i dict_i = _lfortran_dict_constant(1, 2, 2, 5, 3, 7) if (_lfortran_len(dict_i) /= 3) error stop call _lfortran_set_item(dict_i, 3, 5) if (_lfortran_len(dict_i) /= 3) error stop call _lfortran_set_item(dict_i, -15, 6) if (_lfortran_len(dict_i) /= 4) error stop if (_lfortran_get_item(dict_i, -15) /= 6) error stop if (_lfortran_get_item(dict_i, 2) /= 5) error stop type(_lfortran_dict(integer(4), real(4))):: dict_r dict_r = _lfortran_dict_constant(1, 1.2, 2, 2.5, 3, 4.7) if (_lfortran_len(dict_r) /= 3) error stop call _lfortran_set_item(dict_r, 3, 5.5) if (_lfortran_len(dict_r) /= 3) error stop call _lfortran_set_item(dict_r, -14, 6.4) if (_lfortran_len(dict_r) /= 4) error stop if (abs(_lfortran_get_item(dict_r, -14) - 6.4) > eps) error stop if (abs(_lfortran_get_item(dict_r, 2) - 2.5) > eps) error stop end program dict_test_01 lfortran-0.63.0/integration_tests/intrinsics_130.f900000664000175000017500000000245415174404631022462 0ustar alastairalastairprogram intrinsics_130 integer(4) :: x, y1, y2, y3 integer(1) :: i1 = 7_1 integer(2) :: i2 = 7_2 integer(4) :: i4 = 7_4 integer(8) :: i8 = 7_8 x = 10 y1 = 2 y2 = 0 y3 = -2 print*, ishft(10_4, 2) print*, ishft(10_4, 0) print*, ishft(10_4, -2) print*, ishft(x, y1) if (ishft(x, y1) /= 40) error stop print*, ishft(x, y2) if (ishft(x, y2) /= 10) error stop print*, ishft(x, y3) if (ishft(x, y3) /= 2) error stop i8 = ishft(i1, 2_1) if (i8 /= 28) error stop i8 = ishft(i2, 2) if (i8 /= 28) error stop i8 = ishft(i4, 2_1) if (i8 /= 28) error stop i8 = ishft(i8, 2) if (i8 /= 112) error stop i4 = ishft(i1, 2) if (i4 /= 28) error stop i4 = ishft(i2, 2_1) if (i4 /= 28) error stop i4 = ishft(i4, 2) if (i4 /= 112) error stop i4 = ishft(i8, 2_2) if (i4 /= 448) error stop i2 = ishft(i1, 2) if (i2 /= 28) error stop i2 = ishft(i2, 2) if (i2 /= 112) error stop i2 = ishft(i4, 2_4) if (i2 /= 1792) error stop i2 = ishft(i8, 2) if (i2 /= 448) error stop i1 = ishft(i1, 2) if (i1 /= 28) error stop i1 = ishft(i2, 2_2) if (i1 /= 0) error stop i1 = ishft(i4, 2) if (i1 /= 0) error stop i1 = ishft(i8, 2_2) if (i1 /= -64) error stop endlfortran-0.63.0/integration_tests/separate_compilation_12.f900000664000175000017500000000044015174404631024407 0ustar alastairalastairprogram separate_compilation_12 use separate_compilation_12a_module implicit none integer :: a, b a = 1 b = 2 call parent_of_nested_subroutine(a, b) print *, "a =", a if ( a /= 2 ) error stop print *, "b =", b if ( b /= 4 ) error stop end program lfortran-0.63.0/integration_tests/cycle_and_exit4.f900000664000175000017500000000223615174404631022746 0ustar alastairalastairprogram test_blocks integer :: i logical :: pass = .true. b1 : block print *, "b1" i = i + 1 b2 : block print *, "b2" i = i + 2 exit b1 i = i + 3 exit b2 i = i + 4 end block b2 i = i + 5 print *, "error b1" pass = .false. end block b1 b3 : block print *, "b3" b4 : block print *, "b4" b5 : block print *, "b5" exit b3 end block b5 print *, "error b4" pass = .false. end block b4 print *, "error b3" pass = .false. end block b3 b6 : block integer :: i print *, "b6" block print *, "b7" ! TODO: Implement this in asr_to_llvm.cpp ! do i = 1, 10 ! if (i > 5) then ! exit ! end if ! end do ! if (i /= 6) then ! pass = .false. ! end if end block end block b6 if (pass) then print *, "pass" end if end programlfortran-0.63.0/integration_tests/modules_25_module.f900000664000175000017500000000171215174404631023231 0ustar alastairalastairmodule tomlf_de_tokenizer_25 implicit none private public :: toml_tokenizer type :: toml_table logical :: inline = .false. end type toml_table type, abstract :: toml_tokenizer type(toml_table), pointer :: current => null() contains procedure(next_token), deferred :: next_token end type toml_tokenizer abstract interface subroutine next_token(de, dot_is_token) import :: toml_tokenizer class(toml_tokenizer), intent(inout) :: de logical, intent(in) :: dot_is_token end subroutine next_token end interface type, extends(toml_tokenizer), abstract :: toml_tokenizer_ end type toml_tokenizer_ contains subroutine parse_select(de) class(toml_tokenizer), intent(inout), target :: de type(toml_table), pointer :: table nullify(table) de%current => table end subroutine parse_select end module tomlf_de_tokenizer_25 lfortran-0.63.0/integration_tests/intrinsics_168.f900000664000175000017500000000307215174404631022472 0ustar alastairalastairprogram intrinsics_168 integer :: a1 = 5, a2 = 8 integer(8) :: a3 = -1, a4 = -4 integer :: a5 = -2, a6 = -5 integer, parameter :: i1 = ibclr(5, 8) integer, parameter :: i2 = ibclr(-1_8, 5) integer, parameter :: i3 = ibclr(-4, 2_8) integer(8), parameter :: i4 = ibclr(-2_8, 5_8) integer, parameter :: ar1(3) = ibclr([5, 8, 9], [8, 5, 2]) integer(8), parameter :: ar2(3) = ibclr([-1_8, -5_8, -10_8], [5, 8, 9]) integer :: arr1(3), arr3(3) integer(8) :: arr2(3) integer :: res(3) arr1 = [5, 8, 9] arr3 = [8, 5, 2] arr2 = [-1_8, -5_8, -10_8] print *, i1 if (i1 /= 5) error stop print *, i2 if (i2 /= -33) error stop print *, i3 if (i3 /= -8) error stop print *, i4 if (i4 /= -34) error stop print*, ibclr(5, 8) if (ibclr(5, 8) /= 5) error stop print*, ibclr(-1, 5) if (ibclr(-1, 5) /= -33) error stop print*, ibclr(a1, a2) if (ibclr(a1, a2) /= 5) error stop print*, ibclr(a3, a1) if (ibclr(a3, a1) /= -33) error stop print*, ibclr(a2, a4) if (ibclr(a2, a4) /= 8) error stop print*, ibclr(a5, a6) if (ibclr(a5, a6) /= -134217730) error stop print *, ar1 if (any(ar1 /= [5, 8, 9])) error stop print *, ar2 if (any(ar2 /= [-33, -261, -522])) error stop print *, ibclr(arr1, arr1) if (any(ibclr(arr1, arr1) /= [5, 8, 9])) error stop print *, ibclr(arr2, arr1) if (any(ibclr(arr2, arr1) /= [-33, -261, -522])) error stop res = ibclr(arr1, arr3) print *, res if (any(res /= [5, 8, 9])) error stop end program lfortran-0.63.0/integration_tests/intrinsics_69.f900000664000175000017500000000147515174404631022417 0ustar alastairalastairprogram intrinsics_69 implicit none integer, parameter :: a1 = radix(3) integer, parameter :: a2 = radix(1.12) integer, parameter :: a3 = radix([1, 2, 3]) integer, parameter :: a4 = radix([1.5, 21.12, 3.53]) integer :: x1 = 1 real :: x2 = 22.13 integer :: y1(2) = [1, 2] real :: y2(2) = [2., 4.] print *, a1 if (a1 /= 2) error stop print *, a2 if (a2 /= 2) error stop print *, a3 if (a3 /= 2) error stop print *, a4 if (a4 /= 2) error stop print *, radix(3) if (radix(3) /= 2) error stop print *, radix(x1) if (radix(x1) /= 2) error stop print *, radix(y1) if (radix(y1) /= 2) error stop print *, radix(x2) if (radix(x2) /= 2) error stop print *, radix(y2) if (radix(y2) /= 2) error stop end program intrinsics_69 lfortran-0.63.0/integration_tests/external_02.f900000664000175000017500000000020315174404631022023 0ustar alastairalastairsubroutine cdfpoi() implicit none external cumpoi return end subroutine program external_02 call cdfpoi() end program lfortran-0.63.0/integration_tests/bindc_03c.c0000664000175000017500000000037415174404631021261 0ustar alastairalastair#include void execute_function( void (*func)() ) { printf("Executing function in C\n"); func(); } void execute_function_with_arg( void (*func)(int *), int* arg ) { printf("Executing function with arg in C\n"); func(arg); } lfortran-0.63.0/integration_tests/bindc_17.c0000664000175000017500000000107415174404631021121 0ustar alastairalastair// C code: stores a pointer to a struct (does NOT copy it), // then later dereferences it. #include typedef int (*callback_fn)(void *ctx); typedef struct { callback_fn start; callback_fn finish; } callbacks_t; typedef struct { const callbacks_t *cbs; void *ctx; } handle_t; handle_t *my_alloc(const callbacks_t *cbs, void *ctx) { handle_t *h = (handle_t *)malloc(sizeof(handle_t)); h->cbs = cbs; h->ctx = ctx; return h; } void my_free(handle_t *h) { free(h); } int my_run(handle_t *h) { return h->cbs->start(h->ctx); } lfortran-0.63.0/integration_tests/template_simple_02.f900000664000175000017500000000363115174404631023375 0ustar alastairalastairmodule template_simple_02_m implicit none private public :: generic_sum, test_template requirement operator_r(T, U, V, binary_func) type, deferred :: T type, deferred :: U type, deferred :: V pure elemental function binary_func(lhs, rhs) result(res) type(T), intent(in) :: lhs type(U), intent(in) :: rhs type(V) :: res end function end requirement requirement cast_r(T, cast) type, deferred :: T pure elemental function cast(arg) result(res) integer, intent(in) :: arg type(T) :: res end function end requirement contains pure elemental function cast_integer(arg) result(res) integer, intent(in) :: arg integer :: res res = 0 end function pure elemental function cast_real(arg) result(res) integer, intent(in) :: arg real :: res res = 0.0 end function pure function generic_sum {T, add, cast} (arr) result(res) require :: operator_r(T, T, T, add), cast_r(T, cast) type(T), intent(in) :: arr(:) type(T) :: res integer :: n, i n = size(arr) res = cast(0) if (n > 0) then res = arr(1) do i=2,n res = add(res, arr(i)) end do end if end function subroutine test_template() integer :: a_i(10), i, s_i real :: a_r(10), s_r do i = 1, size(a_i) a_i(i) = i a_r(i) = i end do s_i = generic_sum{integer, operator(+), cast_integer}(a_i) s_r = generic_sum{real, operator(+), cast_real}(a_r) s_i = generic_sum{integer, operator(+), cast_integer}(a_i) print *, s_i print *, s_r end subroutine end module program template_simple_02 use template_simple_02_m implicit none call test_template() endlfortran-0.63.0/integration_tests/custom_unary_operator_01.f900000664000175000017500000000126615174404631024655 0ustar alastairalastairmodule custom_unary_operator_01_module implicit none public :: operator(.negation.) interface operator(.negation.) module procedure negative end interface contains function negative(i) result(res) integer, intent(in) :: i integer :: res res = -i end function negative end module custom_unary_operator_01_module program custom_unary_operator_01 use custom_unary_operator_01_module, only : operator(.negation.) implicit none integer :: res integer :: input_int input_int = 10 res = .negation. input_int print *, "res: ", res print *, "res /= -input_int: ", res /= -input_int if (res /= -input_int) error stop end program custom_unary_operator_01 lfortran-0.63.0/integration_tests/gpu_metal_13.f900000664000175000017500000000070315174404631022165 0ustar alastairalastairprogram gpu_metal_13 ! Integer(8) (64-bit integer) arrays implicit none integer, parameter :: n = 10000 integer(8) :: a(n), b(n), c(n), c_expected(n) integer :: i do i = 1, n a(i) = int(i, 8) * 100000_8 b(i) = int(i, 8) * 200000_8 c(i) = 0_8 c_expected(i) = int(i, 8) * 300000_8 end do do concurrent (i = 1:n) c(i) = a(i) + b(i) end do do i = 1, n if (c(i) /= c_expected(i)) error stop end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/select_rank_20.f900000664000175000017500000000141215174404631022476 0ustar alastairalastairmodule select_rank_20_mod implicit none type :: dt integer :: val end type contains subroutine check(x) type(dt), intent(in) :: x(:) if (size(x) /= 3) error stop if (x(1)%val /= 10) error stop if (x(2)%val /= 20) error stop if (x(3)%val /= 30) error stop print *, "OK: size is", size(x) end subroutine subroutine wrap(x) type(dt), intent(in) :: x(..) select rank(x) rank(1) call check(x) rank default error stop "unexpected rank" end select end subroutine end module program select_rank_20 use select_rank_20_mod implicit none type(dt) :: arr(3) arr = [dt(10), dt(20), dt(30)] call wrap(arr) end program lfortran-0.63.0/integration_tests/derived_types_35_file.txt0000664000175000017500000000000415174404631024274 0ustar alastairalastair125 lfortran-0.63.0/integration_tests/gpu_metal_181.f900000664000175000017500000000151415174404631022254 0ustar alastairalastairmodule gpu_metal_181_m implicit none type :: t real, allocatable :: v(:) end type end module program gpu_metal_181 ! Test: function returning DT with allocatable component called inside ! do concurrent. The Metal codegen must emit the correct number of ! arguments (including data pointer and size for the allocatable ! member) and the host must pre-allocate workspace for unallocated ! struct members before kernel launch. use gpu_metal_181_m implicit none type(t) :: a(2) real :: x(1) integer :: i x(1) = 1.0 do concurrent (i = 1:2) a(i) = construct(x) end do if (abs(a(1)%v(1) - 1.0) > 1e-5) error stop if (abs(a(2)%v(1) - 1.0) > 1e-5) error stop print *, "ok" contains pure function construct(x) result(r) real, intent(in) :: x(:) type(t) :: r r%v = x end function end program lfortran-0.63.0/integration_tests/implicit_argument_casting_01.f900000664000175000017500000000075615174404631025441 0ustar alastairalastairsubroutine idz_realcomp(n, a) implicit none integer, parameter :: dp = kind(0.d0) integer n real(dp) a(n) a = 12.5d0 end subroutine program main implicit none integer, parameter :: dp = kind(0.d0) complex(dp) :: w(5) call idzp_svd(5, w) contains subroutine idzp_svd(ls, w) implicit none complex(dp) :: w(*) integer :: ls, isi isi = 1 call idz_realcomp(ls*2, w(isi)) print *, w(isi) if (abs(real(w(isi), dp) - 12.5d0) > 1e-12) error stop end end program lfortran-0.63.0/integration_tests/allocate_25.f900000664000175000017500000000023515174404631021777 0ustar alastairalastairprogram allocate_25 implicit none integer, allocatable :: x allocate(x, source = 5) print *, x if (x /= 5) error stop end program allocate_25 lfortran-0.63.0/integration_tests/intrinsics_61.f900000664000175000017500000000171715174404631022406 0ustar alastairalastairprogram intrinsics_61 implicit none integer(1) :: x integer(2) :: y integer(4) :: z integer(8) :: w character(1), parameter :: c1 = char(32) character(1), parameter :: c2 = char(57, 4) character(1), parameter :: ar1(4) = char([32, 57, 56, 67]) ! character(1), parameter :: ar2(4) = char([32, 57, 56, 67], 4) !Does not work #4566 integer :: arr1(4) = [32, 55, 87, 90] print *, c1 if (c1 /= ' ') error stop print *, c2 if (c2 /= '9') error stop print *, ar1 if (any(ar1 /= [' ', '9', '8', 'C'])) error stop ! print *, ar2 ! if (any(ar2 /= [' ', '9', '8', 'C'])) error stop print *, char(arr1) if (any(char(arr1) /= [' ', '7', 'W', 'Z'])) error stop x = 97 y = 47 z = 56 w = 67 print *, char(x), char(y), char(z), char(w) if (char(x) /= 'a') error stop if (char(y) /= '/') error stop if (char(z) /= '8') error stop if (char(w) /= 'C') error stop end program lfortran-0.63.0/integration_tests/functions_39.f900000664000175000017500000000035415174404631022232 0ustar alastairalastairprogram functions_39 integer :: y = 30 print *, f(y) print *, y if( y /= 60 ) error stop if( f(y) /= 360 ) error stop contains integer function f(x) result(r) integer, intent(out) :: x x = 2 * x r = 3 * x end function end program lfortran-0.63.0/integration_tests/openmp_33.f900000664000175000017500000000235615174404631021516 0ustar alastairalastairprogram openmp_33 use omp_lib integer, parameter :: Nx = 600, Ny = 450, n_max = 255, dp=kind(0.d0) real(dp), parameter :: xcenter = -0.5_dp, ycenter = 0.0_dp, & width = 4, height = 3, dx_di = width/Nx, dy_dj = -height/Ny, & x_offset = xcenter - (Nx+1)*dx_di/2, y_offset = ycenter - (Ny+1)*dy_dj/2 real(dp) :: x, y, x_0, y_0, x_sqr, y_sqr, wtime integer :: i, j, n, image(Nx, Ny) call omp_set_num_threads(4) wtime = omp_get_wtime() !$omp parallel shared(image) private(i, j, x, y, x_0, y_0, x_sqr, y_sqr, n) !$omp do do j = 1, Ny y_0 = y_offset + dy_dj * j do i = 1, Nx x_0 = x_offset + dx_di * i x = 0; y = 0; n = 0 do x_sqr = x ** 2; y_sqr = y ** 2 if (x_sqr + y_sqr > 4 .or. n == n_max) then image(i,j) = 255-n exit end if y = y_0 + 2 * x * y x = x_0 + x_sqr - y_sqr n = n + 1 end do end do end do !$omp end do !$omp end parallel wtime = omp_get_wtime() - wtime print *, 'Time = ', wtime, "(s)" print *, sum(image) if ( sum(image) /= 59157126 ) error stop end program lfortran-0.63.0/integration_tests/submodule_35.f900000664000175000017500000000114615174404631022215 0ustar alastairalastairmodule submodule_35_mod interface module function cube(x) real :: cube real, intent(in) :: x end function cube end interface end module submodule_35_mod submodule (submodule_35_mod) findcube contains module function cube(x) real :: cube real, intent(in) :: x cube = x**3 end function cube end submodule findcube program submodule_35 use submodule_35_mod implicit none if (abs(cube(7.0) - 343.0) > 1.0e-5) error stop if (abs(cube(0.0)) > 1.0e-5) error stop if (abs(cube(-2.0) - (-8.0)) > 1.0e-5) error stop write(*, "(F9.3)") cube(7.0) end program submodule_35 lfortran-0.63.0/integration_tests/common_15.f900000664000175000017500000000127615174404631021510 0ustar alastairalastair! Test: COMMON block with different variable names across units ! This is the simple case - same layout, different names program common_15 implicit none integer :: infot, noutc common /infoc/ infot, noutc noutc = 6 infot = 42 call sub1() if (infot /= 100) error stop "infot should be 100" print *, "PASS: common_15" end program subroutine sub1() implicit none ! Same COMMON block but different variable name (NOUT vs NOUTC) ! Both refer to the same storage location integer :: infot, nout common /infoc/ infot, nout if (nout /= 6) error stop "nout should be 6" if (infot /= 42) error stop "infot should be 42" infot = 100 end subroutine lfortran-0.63.0/integration_tests/intrinsics_65.f900000664000175000017500000000207715174404631022412 0ustar alastairalastairprogram intrinsics_65 implicit none integer :: arr_01(20) = [995, -697, 90, -514, 0, -777, 664, -15, 401, -348, & 269, -94, 534, 806, -23, 844, 0, -114, 673, -445] integer :: a_01(4, 3), a_02(3) integer, allocatable :: a_03(:) integer :: b_01(3, 4), b_02(3), res_01(4) real :: c_01(3, 5), res_02(4, 5) allocate(a_03(3)) a_01 = reshape(arr_01, shape(a_01)) b_01 = reshape(arr_01, shape(b_01)) c_01 = reshape(real(arr_01), shape(c_01)) a_02 = a_01(1, :) a_03 = a_01(2, :) b_02 = b_01(:, 3) print *, sum(matmul(a_01, b_01)) if (sum(matmul(a_01, b_01)) /= -130358) error stop res_01 = matmul(a_01, b_02) + 2 * matmul(a_02, b_01) print *, size(res_01), res_01 if (size(res_01) /= 4) error stop res_02 = matmul(a_01, c_01) if (res_01(1) /= 2873711) error stop if (res_02(1, 1) /= a_01(1, 1) * c_01(1, 1) & + a_01(1, 2) * c_01(2, 1) & + a_01(1, 3) * c_01(3, 1) ) error stop res_01 = matmul(a_02, b_01) if (res_01(1) /= res_02(1, 1)) error stop end program intrinsics_65 lfortran-0.63.0/integration_tests/template_add_03.f900000664000175000017500000000171515174404631022636 0ustar alastairalastairmodule template_add_03_m implicit none private public :: add_t, test_template requirement r(t, f) type, deferred :: t function f(x, y) result(z) type(t), intent(in) :: x, y type(t) :: z end function end requirement template add_t(t, f) require :: r(t, f) private public :: add_generic contains function add_generic(x, y) result(z) type(t), intent(in) :: x, y type(t) :: z z = f(x, y) end function end template contains subroutine test_template() instantiate add_t(real, operator(+)), only: add_real => add_generic real :: x, y x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) if (abs(add_real(x, y) - 12.3) > 1e-5) error stop end subroutine end module program template_add_03 use template_add_03_m implicit none call test_template() end program lfortran-0.63.0/integration_tests/string_77.f900000664000175000017500000000146015174404631021531 0ustar alastairalastair! Mainly testing declaration in function module string_77_mod contains pure function foo (x) result(res) character(*), intent(in) :: x character(:), allocatable :: res allocate(character(len(x) + len("abc")):: res) res = x // 'abc' end function pure function boo(x,y) result(res) integer, intent(in) :: x,y integer :: res res = x + y end function function ff(line,length) result(strout) character(len=*):: line integer :: length character(len=boo(length, len(foo(line)))) :: strout ! the main concern of this test -- Is to handle this declaration correctly end function end module program string_77 use string_77_mod print *, len(ff("Hello", 10)) !! Expected output: 18 if(len(ff("Hello", 10)) /= 18) error stop end program lfortran-0.63.0/integration_tests/exit_01.f900000664000175000017500000000057315174404631021163 0ustar alastairalastairprogram exit_01 implicit none integer :: x x = 5 myif: if (x > 0) then if (x == 5) exit myif x = 10 end if myif if (x /= 5) error stop x = 3 outer: if (x > 0) then inner: if (x > 2) then exit outer x = 99 end if inner x = 77 end if outer if (x /= 3) error stop end program lfortran-0.63.0/integration_tests/allocate_05.f900000664000175000017500000000044015174404631021773 0ustar alastairalastairprogram allocate_05 implicit none character(len=:), allocatable :: string character(len=3) :: num allocate(character(len=3)::string) num = "abc" string = num if (string /= "abc") error stop string(:) = num if (string /= "abc") error stop end program lfortran-0.63.0/integration_tests/string_104.f900000664000175000017500000000064315174404631021602 0ustar alastairalastairprogram string_104 implicit none character(10) :: string integer :: unit string = 'ABCDEFGHIJ' open(newunit=unit, file='string_104_tmp', status='new') write(unit, '(A)') 'Hello World' rewind(unit) read(unit, '(A)') string(1:6) close(unit, status='delete') if (string(1:6) /= 'Hello ') error stop if (string(7:10) /= 'GHIJ') error stop if (string /= 'Hello GHIJ') error stop print '(A)', string end program string_104 lfortran-0.63.0/integration_tests/separate_compilation_03.f900000664000175000017500000000050215174404631024406 0ustar alastairalastairprogram separate_compilation_03 use separate_compilation_03a_module use separate_compilation_03b_module real :: x0(5) real :: res1, res2 x0 = 9124.124 res1 = mixing_anderson(x0) print *, mixing_anderson(x0) res2 = integrate_trapz_1(x0) print *, integrate_trapz_1(x0) if (abs(res1 - res2) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/derived_types_86.f900000664000175000017500000000065415174404631023075 0ustar alastairalastairmodule derived_types_86_mod type :: json_ser_config integer :: l1 = 14 character(len=:), allocatable :: indent end type type :: json_serializer type(json_ser_config) :: config = json_ser_config() end type end module program derived_types_86 use derived_types_86_mod type(json_serializer) :: ser ser = json_serializer() ser%config%indent = "Hello" if (ser%config%l1 /= 14) error stop end program derived_types_86lfortran-0.63.0/integration_tests/lapack_09.f900000664000175000017500000000063615174404631021455 0ustar alastairalastair! MRE: COMMON block scalar passed to external subroutine argument. ! Reduced from LAPACK BLAS testing sources with COMMON blocks. program lapack_09 implicit none integer :: n common /combla/ n external :: bar n = 41 call bar(n) if (n /= 42) error stop print *, 'PASS' end program subroutine bar(n) implicit none integer, intent(inout) :: n n = n + 1 end subroutine lfortran-0.63.0/integration_tests/arrays_05_size.f900000664000175000017500000000046515174404631022551 0ustar alastairalastairmodule modd_arrays_05_size integer(8),parameter :: arr_size = 10 end module modd_arrays_05_size program arrays_05_size use modd_arrays_05_size integer :: arr(arr_size) print * , kind(arr_size) if (kind(arr_size) /= 8) error stop print * , size(arr) if (size(arr) /= 10) error stop end programlfortran-0.63.0/integration_tests/expr_01.f900000664000175000017500000000013315174404631021160 0ustar alastairalastairprogram expr_01 implicit none integer :: x x = (2+3)*5 if (x == 25) error stop end program lfortran-0.63.0/integration_tests/data_16.f900000664000175000017500000000030515174404631021122 0ustar alastairalastairmodule data_16_module public :: pi data pi /3.14/ end module program data_16 use data_16_module print *, "pi: ", pi if (abs(pi - 3.14) > 1.0e-6) error stop end program data_16 lfortran-0.63.0/integration_tests/separate_compilation_class_star_01.f900000664000175000017500000000033515174404631026626 0ustar alastairalastairprogram separate_compilation_class_star_01 use separate_compilation_class_star_01_mod, only: get_value implicit none integer :: x call get_value(x) if (x /= 42) error stop end program separate_compilation_class_star_01 lfortran-0.63.0/integration_tests/derived_types_99.f900000664000175000017500000000040015174404631023066 0ustar alastairalastairprogram derived_types_99 implicit none type :: t integer :: x end type type(t) :: a(4) integer :: i do i = 1, 4 a(i)%x = i * 10 end do associate(q => a%x) print *, q end associate end program derived_types_99 lfortran-0.63.0/integration_tests/operator_overloading_33.f900000664000175000017500000000270015174404631024435 0ustar alastairalastairmodule operator_overloading_33_mod implicit none type :: array_type real :: val contains procedure :: negate_array procedure :: sub_arrays generic :: operator(-) => negate_array, sub_arrays end type interface operator(-) module procedure scalar_sub end interface contains function negate_array(a) result(c) class(array_type), intent(in) :: a type(array_type) :: c c%val = -a%val end function function sub_arrays(a, b) result(c) class(array_type), intent(in) :: a, b type(array_type) :: c c%val = a%val - b%val end function function scalar_sub(a, b) result(c) real, intent(in) :: a type(array_type), intent(in) :: b type(array_type) :: c c%val = a - b%val end function end module operator_overloading_33_mod module operator_overloading_33_ops_mod use operator_overloading_33_mod, only: array_type, operator(-) implicit none contains subroutine compute(u) type(array_type), intent(in) :: u type(array_type) :: y y = -u if (abs(y%val - (-3.0)) > 1.0e-6) error stop end subroutine end module operator_overloading_33_ops_mod program operator_overloading_33 use operator_overloading_33_mod use operator_overloading_33_ops_mod implicit none type(array_type) :: x x%val = 3.0 call compute(x) end program operator_overloading_33 lfortran-0.63.0/integration_tests/const_array_01.f900000664000175000017500000000031615174404631022531 0ustar alastairalastairprogram const_array_01 implicit none real, parameter :: A(5) = [1.1, 3.0, 10.0, 2.1, 5.5] integer, parameter :: x(*) = [4, 9, 6, 12, 13] print *, A if (x(1) /= 4) error stop if (x(5) /= 13) error stop end lfortran-0.63.0/integration_tests/associate_42.f900000664000175000017500000000165415174404631022173 0ustar alastairalastairprogram associate_42 implicit none integer :: c ! Test: array constructor with implied-do inside associate ! The inner [(0d0, c=1,3)] expands to 3 elements, so total size is 5 associate(b => [-1d0, [(0d0, c = 1, 3)], 1d0]) if (size(b) /= 5) error stop if (b(1) /= -1d0) error stop if (b(2) /= 0d0) error stop if (b(3) /= 0d0) error stop if (b(4) /= 0d0) error stop if (b(5) /= 1d0) error stop print *, "ok, size =", size(b) end associate ! Test with explicit step and different values associate(a => [10, [(i_square(c), c = 1, 4)], 99]) if (size(a) /= 6) error stop if (a(1) /= 10) error stop if (a(2) /= 1) error stop if (a(3) /= 4) error stop if (a(4) /= 9) error stop if (a(5) /= 16) error stop if (a(6) /= 99) error stop end associate contains pure integer function i_square(n) integer, intent(in) :: n i_square = n * n end function end program lfortran-0.63.0/integration_tests/doloop_18.f900000664000175000017500000000157515174404631021521 0ustar alastairalastair! Test that do loop upper bounds are evaluated only once (Fortran standard). ! The upper bound contains a merge() call depending on a variable modified ! by a recursive call inside the loop body. program doloop_18 implicit none integer :: k, total k = 2 total = 0 call test(4, 4, k, total) if (total /= 8) error stop contains recursive subroutine test(ji, jf, k, total) integer, intent(in) :: ji integer, intent(in) :: jf integer, intent(inout) :: k integer, intent(inout) :: total integer :: n, jt if (ji == 1) then k = 1 else jt = ji - 1 do n = 1, merge(k, 1, jt /= 1) total = total + 1 call test(jt, jf, k, total) end do if (ji == jf) k = 2 end if end subroutine test end program doloop_18 lfortran-0.63.0/integration_tests/implicit_typing_07.f900000664000175000017500000000014215174404631023414 0ustar alastairalastairprogram dim_param parameter (ialen = 42) integer :: myarray(ialen) myarray = 0 end program lfortran-0.63.0/integration_tests/abs_04.f900000664000175000017500000000136715174404631020764 0ustar alastairalastairprogram abs_04 ! Test that abs() on a complex array returns a real array implicit none complex(8), allocatable :: z(:) real(8) :: tol real(8) :: r allocate(z(3)) z = [(1.0d0, 2.0d0), (3.0d0, 4.0d0), (5.0d0, 6.0d0)] tol = 1.0d-6 ! abs(z) on a complex array should return a real array ! Then abs(abs(z)) should also work (real in, real out) if (any(aimag(z) > tol * abs(abs(z)))) then print *, "PASS: imaginary parts are large" else error stop "Expected imaginary parts to be large" end if ! Verify scalar abs of complex still works r = abs(z(1)) if (abs(r - sqrt(5.0d0)) > tol) error stop "abs of scalar complex failed" ! Verify abs of real array works if (any(abs(abs(z)) < 0.0d0)) error stop "abs of real array should be non-negative" end program lfortran-0.63.0/integration_tests/derived_types_23.f900000664000175000017500000000044015174404631023055 0ustar alastairalastairmodule derived_types_23_vtk90m contains subroutine vtk90() implicit none character(len=6) :: description description = " abc" print *, adjustl(description) end subroutine vtk90 end module program derived_types_23 use derived_types_23_vtk90m call vtk90() end program lfortran-0.63.0/integration_tests/procedure_pointer_16.f900000664000175000017500000000132215174404631023741 0ustar alastairalastairprogram procedure_pointer_16 implicit none type :: callback_holder procedure(), pointer, nopass :: ifunc => null() end type type(callback_holder) :: obj integer :: res obj%ifunc => isquare call obj%ifunc(6, res) if (res /= 36) error stop "FAIL: expected 36" obj%ifunc => icube call obj%ifunc(6, res) if (res /= 216) error stop "FAIL: expected 216" print *, "PASS" contains subroutine isquare(n, out) integer, intent(in) :: n integer, intent(out) :: out out = n * n end subroutine subroutine icube(n, out) integer, intent(in) :: n integer, intent(out) :: out out = n ** 3 end subroutine end program lfortran-0.63.0/integration_tests/external_13.f900000664000175000017500000000170015174404631022030 0ustar alastairalastair! Test that external functions with implicit interfaces get underscore mangling ! when --mangle-underscore flag is used. ! ! This test verifies the fix for issue #9473 where --mangle-underscore and ! --all-mangling did not apply to external interface functions (like LAPACK/BLAS). ! ! We define a simple stub to avoid needing actual LAPACK at link time. module external_mangle_stubs implicit none contains subroutine dummy_external_(x) bind(C, name="dummy_external_") integer, intent(inout) :: x x = x + 1 end subroutine end module program external_mangle_01 use external_mangle_stubs implicit none integer :: x x = 41 ! Call external function with implicit interface ! With --mangle-underscore, this should generate a call to dummy_external_ call dummy_external(x) if (x == 42) then print *, "PASSED" else print *, "FAILED: x =", x error stop end if end program lfortran-0.63.0/integration_tests/character_parameter_padding_trimming.f900000664000175000017500000000343715174404631027304 0ustar alastairalastair!> These tests make sure that for constant(i.e. parameter) character string (or array) !> * padding (when LHS length is higher) !> * trimming (when LHS length is lower) program character_parameter_padding_trimming !> initializate variables to test correct padding of ' ' to the end of character string character(len=8), parameter :: x_pad = "apple" !> char length on right is 5 character(len=10), parameter :: y_pad = "Ball" !> char length on right is 4 character(len=30), parameter :: z_pad = x_pad // y_pad // x_pad !> char length on right is 26 character(len=32), parameter :: input = "reversed" !> char length on right is 8 character(len=4), parameter :: p_pad(3) = "2" !> char length on right is 1 !> initializate variables to test correct trimming of ' ' to the end of character string character(len=2), parameter :: x_trim = "apple" !> char length on right is 5 character(len=3), parameter :: y_trim = "Ball" !> char length on right is 4 character(len=5), parameter :: z_trim = x_trim // y_trim // x_trim !> char length on right is 26 character(len=2), parameter :: input_trim = "reversed" !> char length on right is 8 character(len=1), parameter :: p_trim(3) = "25" !> char length on right is 2 !> tests to assert padding is done correctly if (len(x_pad) /= 8) error stop if (len(y_pad) /= 10) error stop if (len(z_pad) /= 30) error stop if (len(p_pad(1)) /= 4) error stop if (len(p_pad(2)) /= 4) error stop if (len(p_pad(3)) /= 4) error stop !> tests to assert trimming is done correctly if (len(x_trim) /= 2) error stop if (len(y_trim) /= 3) error stop if (len(z_trim) /= 5) error stop if (len(p_trim(1)) /= 1) error stop if (len(p_trim(2)) /= 1) error stop if (len(p_trim(3)) /= 1) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_128.f900000664000175000017500000000242615174404631022260 0ustar alastairalastair! Test: struct with type-bound procedure not called inside do concurrent. ! Previously, the Metal codegen emitted the struct method as an inline ! function even though it was only referenced by the struct type, causing ! a duplicate definition error in the Metal shader. module gpu_metal_128_m implicit none type :: inner_t real :: x end type type :: container_t type(inner_t), allocatable :: items_(:) contains procedure :: get_items end type contains function get_items(self) result(res) class(container_t), intent(in) :: self type(inner_t), allocatable :: res(:) allocate(res(size(self%items_))) res = self%items_ end function end module program gpu_metal_128 use gpu_metal_128_m implicit none type(container_t) :: c(2) type(inner_t), allocatable :: items(:) real :: arr(4) integer :: i c(1) = container_t([inner_t(1.0)]) c(2) = container_t([inner_t(2.0)]) items = c(1)%get_items() do concurrent(i = 1:4) arr(i) = real(i * size(c)) end do if (abs(arr(1) - 2.0) > 1e-5) error stop if (abs(arr(2) - 4.0) > 1e-5) error stop if (abs(arr(3) - 6.0) > 1e-5) error stop if (abs(arr(4) - 8.0) > 1e-5) error stop if (size(items) /= 1) error stop if (abs(items(1)%x - 1.0) > 1e-5) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/array_section_13.f900000664000175000017500000000235015174404631023052 0ustar alastairalastairmodule array_section_13_mod implicit none contains subroutine mwe(n, x, y, M) integer, value :: n real, intent(in) :: x(n), y(n) real, intent(out) :: M(n, n) integer :: k do k = 1, n call phs(x(k), y(k), M(:, k)) end do contains subroutine phs(xc, yc, b) real, intent(in) :: xc, yc real, intent(out) :: b(n) real :: r integer :: k, l do k = 1, n r = hypot(xc - x(k), yc - y(k)) b(k) = r**3 end do end subroutine end subroutine end module array_section_13_mod program array_section_13 use array_section_13_mod implicit none integer, parameter :: n = 3 real :: x(3), y(3), M(n, n) real :: eps eps = 1e-4 x = [1.0, 3.0, 2.0] y = [0.0, 3.0, 0.0] call mwe(n, x, y, M) if (abs(M(1,1)) > eps) error stop if (abs(M(2,2)) > eps) error stop if (abs(M(3,3)) > eps) error stop if (abs(M(1,2) - M(2,1)) > eps) error stop if (abs(M(1,3) - M(3,1)) > eps) error stop if (abs(M(2,3) - M(3,2)) > eps) error stop if (abs(M(1,2) - 46.8721657) > eps) error stop if (abs(M(1,3) - 1.0) > eps) error stop if (abs(M(2,3) - 31.6227760) > eps) error stop end program array_section_13 lfortran-0.63.0/integration_tests/entry_11.f900000664000175000017500000000050315174404631021345 0ustar alastairalastairsubroutine dzror() implicit none double precision zxlo double precision xxlo save print *, 'xxlo = ', xxlo if (abs(xxlo - 1.93D0) > 1d-10) error stop return entry dstzr(zxlo) xxlo = zxlo return end subroutine program entry_11 implicit none double precision :: zxlo zxlo = 1.93D0 call dstzr(zxlo) call dzror() end program lfortran-0.63.0/integration_tests/separate_compilation_19a.f900000664000175000017500000000075115174404631024564 0ustar alastairalastairmodule mod_separate_compilation_19 implicit none private public :: open_hashmap_type type :: open_hashmap_type contains procedure :: map_entry => map_open_entry end type open_hashmap_type interface module subroutine map_open_entry(map, key) class(open_hashmap_type), intent(inout) :: map integer, intent(inout) :: key end subroutine map_open_entry end interface end module mod_separate_compilation_19lfortran-0.63.0/integration_tests/string_113.f900000664000175000017500000000331115174404631021575 0ustar alastairalastairmodule module_string_113 implicit none contains function atleast(line, length, pattern) result(strout) character(len=*), intent(in) :: line integer, intent(in) :: length character(len=*), intent(in), optional :: pattern character(len=max(length, len(trim(line)))) :: strout if(present(pattern)) then strout = line//repeat(pattern, len(strout)/len(pattern)+1) else strout = line end if end function atleast end module module_string_113 program string_113 use module_string_113 implicit none character(len=:), allocatable :: res ! No pattern: result length = max(length, len(trim(line))) ! 'hello' has trim-len 5, max(3,5)=5 → result is 'hello' res = atleast('hello', 3) if (len(res) /= 5) error stop if (res /= 'hello') error stop ! 'hi' has trim-len 2, max(8,2)=8 → 'hi' padded with spaces to length 8 res = atleast('hi', 8) if (len(res) /= 8) error stop if (res /= 'hi ') error stop ! With pattern: 'hi' trim-len 2, max(5,2)=5, strout='hi'//repeat('-',6) truncated to 5 res = atleast('hi', 5, '-') if (len(res) /= 5) error stop if (res /= 'hi---') error stop ! With pattern: line already fills result ('hello' trim-len 5, max(3,5)=5) res = atleast('hello', 3, '*') if (len(res) /= 5) error stop if (res /= 'hello') error stop ! With 2-char pattern: 'a' trim-len 1, max(6,1)=6, 'a'//repeat('bc',4)='abcbcbcbc' → 'abcbcb' res = atleast('a', 6, 'bc') if (len(res) /= 6) error stop if (res /= 'abcbcb') error stop end program string_113lfortran-0.63.0/integration_tests/class_147.f900000664000175000017500000000100015174404631021374 0ustar alastairalastairprogram class_147 implicit none type :: m_type character(len=10) :: c end type class(m_type), allocatable :: value(:) integer :: i allocate(value(3)) do i = 1, 3 value(i)%c = "test" end do do i = 1, 3 if (value(i)%c /= "test") error stop end do deallocate(value) allocate(value(5)) do i = 1, 5 value(i)%c = "abc" end do do i = 1, 5 if (value(i)%c /= "abc") error stop end do deallocate(value) print *, "PASSED" end program lfortran-0.63.0/integration_tests/assumed_rank_03.f900000664000175000017500000000106315174404631022663 0ustar alastairalastairmodule assumed_rank_03_mod implicit none type :: t integer :: v = 0 end type interface t module procedure new_t end interface contains type(t) function new_t(flag, a1) integer, intent(in) :: flag class(*), intent(in), dimension(..) :: a1 new_t%v = flag end function end module program assumed_rank_03 use assumed_rank_03_mod implicit none type(t) :: x x = t(1, 'hello') if (x%v /= 1) error stop x = t(42, 123) if (x%v /= 42) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/derived_type_with_default_init_01.f900000664000175000017500000000100015174404631026441 0ustar alastairalastairmodule module_derived_type_with_default_init_01 public :: myType, global_myType type :: myType logical :: a = .true. integer :: i = 2 end type myType type(myType) :: global_myType end module module_derived_type_with_default_init_01 program derived_type_with_default_init_01 use module_derived_type_with_default_init_01, global => global_myType if (global % a .neqv. .true.) error stop if (global % i .ne. 2) error stop end program derived_type_with_default_init_01lfortran-0.63.0/integration_tests/array_neg_extent_01.f900000664000175000017500000000112615174404631023543 0ustar alastairalastairfunction f(A) result(res) real, intent(in) :: A(:) real :: res(size(A) - 4) res = 0 end function program array_neg_extent_01 implicit none interface function f(A) result(res) real, intent(in) :: A(:) real :: res(size(A) - 4) end function end interface real :: a3(3), a6(6) integer :: s ! size(A) - 4 = 3 - 4 = -1 => zero-size array s = size(f(a3)) print *, s if (s /= 0) error stop ! size(A) - 4 = 6 - 4 = 2 => two-element array s = size(f(a6)) print *, s if (s /= 2) error stop end program lfortran-0.63.0/integration_tests/stdlib_bitsets_01.f900000664000175000017500000000323215174404631023223 0ustar alastairalastairmodule stdlib_optval_01 implicit none public :: optval interface optval module procedure optval_character end interface optval contains pure function optval_character(x, default) result(y) character(len=*), intent(in), optional :: x character(len=*), intent(in) :: default character(len=:), allocatable :: y if (present(x)) then y = x else y = default end if end function optval_character end module stdlib_optval_01 module stdlib_bitsets_mod_01 use stdlib_optval_01, only : optval implicit none public :: & bitset_type, & bitset_64 type, abstract :: bitset_type integer(4) :: num_bits contains end type bitset_type type, extends(bitset_type) :: bitset_64 integer(8), private :: block = 0 contains procedure, pass(self) :: read_bitset_unit => read_bitset_unit_64 end type bitset_64 contains subroutine read_bitset_unit_64(self, unit, advance) class(bitset_64), intent(out) :: self integer, intent(in) :: unit character(*), intent(in), optional :: advance character(len=1) :: char character(len=:), allocatable :: adv adv = optval(advance, 'YES') if (adv /= 'YES' .and. adv /= 'NO') error stop self%num_bits = 0 end subroutine read_bitset_unit_64 end module stdlib_bitsets_mod_01 program stdlib_bitsets_01 use stdlib_bitsets_mod_01 implicit none type(bitset_64) :: b call b%read_bitset_unit(10) if (b%num_bits /= 0) error stop call b%read_bitset_unit(10, 'NO') if (b%num_bits /= 0) error stop end program lfortran-0.63.0/integration_tests/bindc_iso_fb_07.f900000664000175000017500000000134415174404631022615 0ustar alastairalastair! Test: CFI descriptor elem_len is correct when allocatable array is ! passed through type(*) assumed-rank to a bind(C) subroutine. subroutine pass_to_c(a) implicit none interface integer function check_elem_len(a, expected) bind(C) type(*), intent(in) :: a(..) integer, value, intent(in) :: expected end function end interface type(*), intent(inout) :: a(..) if (check_elem_len(a, 4) /= 0) error stop "FAIL: elem_len /= 4" end subroutine program bindc_iso_fb_07 implicit none interface subroutine pass_to_c(a) type(*), intent(inout) :: a(..) end subroutine end interface integer, allocatable :: x(:) allocate(x(3)) x = [10, 20, 30] call pass_to_c(x) print *, "PASS" end program lfortran-0.63.0/integration_tests/intrinsics_246.f900000664000175000017500000000347115174404631022472 0ustar alastairalastairprogram intrinsics_246 implicit none character(len = 25), parameter :: space_at_end_ = adjustl('gfortran ') character(len = 25), parameter :: space_in_between_ = adjustl(' g for tran ') character(len = 25), parameter :: spaces_with_symbols_ = adjustl(' # gfor* t $ ran & ') character(len = 2), parameter :: a(4) = adjustl(["ab", "cd", "ef", "gh"]) character(len = 7), parameter :: b(3) = adjustl([" hello", " world", "fortran"]) character(len = 10) :: c1 character(len = 10) :: c2 character(len = 10) :: c3(3) character(len = 10) :: res(3) c1 = "lfortran " c2 = " gfortran" c3 = [" fort ran ", " lfortran", "gfortran "] print *, adjustl(c1) if (adjustl(c1) /= "lfortran ") error stop print *, adjustl(c2) if (adjustl(c2) /= "gfortran ") error stop print *, space_at_end_ if (space_at_end_ /= "gfortran") error stop print *, space_in_between_ if (space_in_between_ /= "g for tran") error stop print *, spaces_with_symbols_ if (spaces_with_symbols_ /= "# gfor* t $ ran &") error stop print *, a if (any(a /= ["ab", "cd", "ef", "gh"])) error stop print *, b if (any(b /= ["hello ", "world ", "fortran"])) error stop print *, adjustl([" |a", "b2 ", "3 c", " d4", " e|"]) if (any(adjustl([" |a", "b2 ", "3 c", " d4", " e|"]) /= ["|a ", "b2 ", "3 c", "d4 ", "e| "])) error stop print *, adjustl([" lfortran", " compiler ", "opensource"]) if (any(adjustl([" lfortran", " compiler ", "opensource"]) /= ["lfortran ", "compiler ", "opensource"])) error stop print *, adjustl([c1, c2]) if (any(adjustl([c1, c2]) /= ["lfortran ", "gfortran "])) error stop res = adjustl([c1, c2, c3(1)]) print *, res if (any(res /= ["lfortran ", "gfortran ", "fort ran "])) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_54.f900000664000175000017500000000043515174404631022174 0ustar alastairalastairprogram gpu_metal_54 ! Test ArraySection assignment to allocatable array inside do concurrent implicit none real, allocatable :: b(:,:) integer :: l allocate(b(2,2)) b = 1.0 do concurrent(l = 1:2) b(1:2,l) = 0.0 end do if (any(abs(b) > 0.01)) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/intrinsics_71.f900000664000175000017500000000105415174404631022401 0ustar alastairalastairprogram intrinsics_71 implicit none integer :: result_value result_value = routine(3) print *, result_value if (result_value /= 600) error stop contains function routine(p) result(r) integer, intent(in) :: p integer :: a(1, p) integer :: b(p, 1) integer :: c(1, 1) integer :: r a(1, 1) = 10 a(1, 2) = 10 a(1, 3) = 10 b(1, 1) = 20 b(2, 1) = 20 b(3, 1) = 20 c = matmul(a, b) r = c(1, 1) end function routine end program lfortran-0.63.0/integration_tests/arrays_74.f900000664000175000017500000000034015174404631021515 0ustar alastairalastair! Test using type member in array constructor program arrays_74 type :: m integer :: aa(3) end type m integer :: j(5) type(m) :: tt tt%aa = [3, 4, 5] j = [ 1,2, tt%aa] end program arrays_74lfortran-0.63.0/integration_tests/intrinsics_50.f900000664000175000017500000000426015174404631022400 0ustar alastairalastairprogram intrinsics_50 implicit none logical :: is_one_present, is_five_present character(len=1) :: strings(2, 2) character(len=80), parameter :: help_text_build_common(*) = [character(len=80) :: & ' --profile PROF Selects the compilation profile for the build. ',& ' Currently available profiles are "release" for ',& ' high optimization and "debug" for full debug options. ',& ' If --flag is not specified the "debug" flags are the ',& ' default. ',& ' --no-prune Disable tree-shaking/pruning of unused module dependencies '& ] is_one_present = string_array_contains("1", ["2", "3", "1"]) print *, is_one_present if( .not. is_one_present ) error stop is_one_present = string_array_contains("1", ["2", "3"]) print *, is_one_present if( is_one_present ) error stop strings(1, 1) = "2" strings(1, 2) = "3" strings(2, 1) = "4" strings(2, 2) = "5" is_one_present = string_array_contains_nested("1", strings) print *, is_one_present if( is_one_present ) error stop is_five_present = string_array_contains_nested("5", strings) print *, is_five_present if( .not. is_five_present ) error stop contains logical function string_array_contains(search_string, array) character(*), intent(in) :: search_string character(*), intent(in) :: array(:) integer :: i string_array_contains = any([(array(i)==search_string, & i=1,size(array))]) end function string_array_contains logical function string_array_contains_nested(search_string, array) character(*), intent(in) :: search_string character(*), intent(in) :: array(:, :) integer :: i, j string_array_contains_nested = any([((array(i, j)==search_string, & j=1,size(array, 2)), & i=1,size(array, 1))]) end function string_array_contains_nested end program intrinsics_50 lfortran-0.63.0/integration_tests/namelist_04.f900000664000175000017500000000306315174404631022026 0ustar alastairalastairprogram namelist_2d implicit none ! Define 2D arrays integer :: matrix(3,4) real :: grid(2,3) integer :: i, j ! Define namelist namelist /arrays2d/ matrix, grid ! Initialize matrix (3x4 = 12 elements) do j = 1, 4 do i = 1, 3 matrix(i,j) = (i-1)*4 + j end do end do ! Initialize grid (2x3 = 6 elements) grid(1,1) = 1.5 grid(1,2) = 2.5 grid(1,3) = 3.5 grid(2,1) = 4.5 grid(2,2) = 5.5 grid(2,3) = 6.5 ! Write namelist to file open(unit=10, file='namelist_2d.dat', status='replace', form='formatted') write(10, nml=arrays2d) close(10) ! Reset all values to zero matrix = 0 grid = 0.0 ! Read namelist from file open(unit=10, file='namelist_2d.dat', status='old', form='formatted') read(10, nml=arrays2d) close(10) ! Verify matrix values do j = 1, 4 do i = 1, 3 if (matrix(i,j) /= (i-1)*4 + j) error stop "Matrix element mismatch" end do end do ! Verify grid values (with tolerance for floating point) if (abs(grid(1,1) - 1.5) > 1.0e-5) error stop "grid(1,1) mismatch" if (abs(grid(1,2) - 2.5) > 1.0e-5) error stop "grid(1,2) mismatch" if (abs(grid(1,3) - 3.5) > 1.0e-5) error stop "grid(1,3) mismatch" if (abs(grid(2,1) - 4.5) > 1.0e-5) error stop "grid(2,1) mismatch" if (abs(grid(2,2) - 5.5) > 1.0e-5) error stop "grid(2,2) mismatch" if (abs(grid(2,3) - 6.5) > 1.0e-5) error stop "grid(2,3) mismatch" print *, "2D array namelist test passed!" end program namelist_2d lfortran-0.63.0/integration_tests/string_109.f900000664000175000017500000000066315174404631021611 0ustar alastairalastairprogram string_109 implicit none character(len=:), pointer :: temp character(len=:), allocatable :: str temp => cast_string() str = temp if (str /= "Hello") error stop if (temp /= "Hello") error stop contains function cast_string() result(ptr) character(:), pointer :: ptr character(len=5), save, target :: tmp = "Hello" ptr => tmp end function cast_string end program string_109lfortran-0.63.0/integration_tests/class_55.f900000664000175000017500000000141315174404631021322 0ustar alastairalastairprogram class_55 type coor integer :: x integer :: y end type class(*), allocatable :: c type(coor), allocatable :: i i = coor(11, 22) allocate(c, source = i) select type (c) type is (integer) error stop type is (real) error stop type is (coor) if (c%x /= 11) error stop print *, c class default error stop end select deallocate(c) allocate(c, source = 4) select type (c) type is (integer) if (c /= 4) error stop print *, c type is (real) error stop type is (coor) error stop class default error stop end select end program lfortran-0.63.0/integration_tests/intrinsics_142.f900000664000175000017500000000155215174404631022463 0ustar alastairalastairprogram intrinsics_142 integer, dimension(3) :: a, b integer(8), dimension(5) :: c, d integer(8), dimension(3) :: e integer :: res integer(8) :: res_8 a = [1, 2, 3] b = [4, 5, 6] c = [1_8, 2_8, 3_8, 4_8, 5_8] d = [6_8, 7_8, 8_8, 9_8, 10_8] e = [6_8, 7_8, 8_8] res = dot_product([1, 2, 3],[4, 5, 6]) print *, res if (res /= 32) error stop res = dot_product(a, b) print *, res if (res /= 32) error stop res_8 = dot_product([1_8, 2_8, 3_8, 4_8, 5_8],[6_8, 7_8, 8_8, 9_8, 10_8]) print *, res_8 if (res_8 /= 130) error stop res_8 = dot_product(c, d) print *, res_8 if (res_8 /= 130) error stop res_8 = dot_product(a, e) print *, res_8 if (res_8 /= 44) error stop res_8 = dot_product(e, b) print *, res_8 if (res_8 /= 107) error stop end program intrinsics_142 lfortran-0.63.0/integration_tests/arrays_43.f900000664000175000017500000000171215174404631021515 0ustar alastairalastairprogram arrays_43 integer(8), parameter :: a(4) = [-10, 2, 3, 4] real(8), parameter :: x(4) = [-1.0, 2.0, -3.0, 4.0] logical(4):: b(4), c(4), d(4), e(4) b = a > 0 print*, a > 0 if (b(1) .neqv. .false. ) error stop if (b(2) .neqv. .true. ) error stop if (b(3) .neqv. .true. ) error stop if (b(4) .neqv. .true. ) error stop c = a < 0 print*, a < 0 if (c(1) .neqv. .true. ) error stop if (c(2) .neqv. .false. ) error stop if (c(3) .neqv. .false. ) error stop if (c(4) .neqv. .false. ) error stop d = x > 0.0 print*, x > 0.0 if (d(1) .neqv. .false. ) error stop if (d(2) .neqv. .true. ) error stop if (d(3) .neqv. .false. ) error stop if (d(4) .neqv. .true. ) error stop e = x < 0.0 print*, x < 0.0 if (e(1) .neqv. .true. ) error stop if (e(2) .neqv. .false. ) error stop if (e(3) .neqv. .true. ) error stop if (e(4) .neqv. .false. ) error stop end program lfortran-0.63.0/integration_tests/arrays_47.f900000664000175000017500000000055715174404631021527 0ustar alastairalastairmodule module_arrays_47 integer :: nx = 4 integer :: ny = 4 integer :: nz = 4 contains subroutine a(cs) real, dimension(nx, ny, nz), intent(in) :: cs print *, sum(cs) if (abs(sum(cs) - 6343.99072) > 1e-8) error stop end subroutine end module module_arrays_47 program arrays_47 use module_arrays_47 real, dimension(4, 4, 4) :: cs cs = 99.1248 call a(cs) end program lfortran-0.63.0/integration_tests/save_08.f900000664000175000017500000000050715174404631021154 0ustar alastairalastairprogram save_08 call sub(1) call sub(2) call sub(3) contains subroutine sub(i) integer :: x(5) integer, intent(in) :: i save if (i == 1) then x = 1 else if ( i == 2) then print *, x if (any(x /= 1)) error stop x = x + 1 else print *, x if (any(x /= 2)) error stop end if end subroutine end program lfortran-0.63.0/integration_tests/gpu_metal_158.f900000664000175000017500000000166115174404631022263 0ustar alastairalastair! Test: Metal codegen element-wise array binop in do concurrent ! ! Verifies that array binary operations (e.g., d = a - y) inside ! do concurrent with associate generate element-wise Metal code ! instead of pointer arithmetic between device/thread address spaces. module gpu_metal_158_m implicit none type :: t real :: v(3) contains procedure :: get_v end type contains pure function get_v(self) result(r) class(t), intent(in) :: self real :: r(3) r = self%v end function end module program gpu_metal_158 use gpu_metal_158_m implicit none integer :: i real :: a(3), d(3) type(t) :: arr(1) a = [2.0, 4.0, 6.0] arr(1)%v = [1.0, 2.0, 3.0] do concurrent (i = 1:1) associate(y => arr(i)%get_v()) d = a - y end associate end do if (abs(d(1) - 1.0) > 1e-6) error stop if (abs(d(2) - 2.0) > 1e-6) error stop if (abs(d(3) - 3.0) > 1e-6) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/arrays_reshape_28.f900000664000175000017500000000065615174404631023235 0ustar alastairalastairprogram arrays_reshape_28 implicit none integer, parameter :: n(2) = [2, 2] integer, parameter :: arr(4) = [1,2,3,4] real, parameter :: b(2,2) = reshape(arr, n) if (b(1,1) /= 1.0) error stop "Mismatch at b(1,1)" if (b(2,1) /= 2.0) error stop "Mismatch at b(2,1)" if (b(1,2) /= 3.0) error stop "Mismatch at b(1,2)" if (b(2,2) /= 4.0) error stop "Mismatch at b(2,2)" end program arrays_reshape_28 lfortran-0.63.0/integration_tests/data_implied_do_05.f900000664000175000017500000000165615174404631023317 0ustar alastairalastairprogram data_implied_do_05 implicit none integer :: a(2, 3) integer :: b(2, 3) integer :: i, j ! Nested implied do loop: inner loop varies i, outer loop varies j ! Order: (1,1)=1, (2,1)=2, (1,2)=3, (2,2)=4, (1,3)=5, (2,3)=6 data ((a(i,j),i=1,2),j=1,3) / 1, 2, 3, 4, 5, 6 / ! Nested implied do loop: inner loop varies j, outer loop varies i ! Order: (1,1)=1, (1,2)=2, (1,3)=3, (2,1)=4, (2,2)=5, (2,3)=6 data ((b(i,j),j=1,3),i=1,2) / 1, 2, 3, 4, 5, 6 / ! Verify a if (a(1,1) /= 1) error stop if (a(2,1) /= 2) error stop if (a(1,2) /= 3) error stop if (a(2,2) /= 4) error stop if (a(1,3) /= 5) error stop if (a(2,3) /= 6) error stop ! Verify b if (b(1,1) /= 1) error stop if (b(1,2) /= 2) error stop if (b(1,3) /= 3) error stop if (b(2,1) /= 4) error stop if (b(2,2) /= 5) error stop if (b(2,3) /= 6) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/intrinsics_250.f900000664000175000017500000000050715174404631022462 0ustar alastairalastairprogram intrinsics_250 integer, dimension(2,2) :: x real(8) :: res(2) x = 2 res = func(x, 1) contains function func(x, dim) result(res) integer, intent(in) :: x(:,:) integer, intent(in) :: dim real(8) :: res(2) print*, sum(abs(x), dim) res = sum(abs(x), dim) if (any(res /= [4, 4])) error stop end function func end program lfortran-0.63.0/integration_tests/select_type_41.f900000664000175000017500000000113415174404631022530 0ustar alastairalastair! Test that writes to a class(*) character array through ! a select type selector persist after end select. program select_type_41 implicit none class(*), allocatable :: arr(:) allocate(character(3) :: arr(2)) ! Write through first select type block select type (arr) type is (character(*)) arr(1) = "foo" arr(2) = "bar" end select ! Read back through second select type block select type (arr) type is (character(*)) if (arr(1) /= "foo") error stop if (arr(2) /= "bar") error stop end select print *, "PASS" end program lfortran-0.63.0/integration_tests/class_45.f900000664000175000017500000000210415174404631021317 0ustar alastairalastairmodule class_45_mod type, public, abstract :: AbsType contains procedure(method), deferred, nopass :: method end type AbsType abstract interface function method() result(arr) import integer, allocatable :: arr(:) end function method end interface type, extends(AbsType) :: ConcreteType contains procedure, nopass :: method => concrete_method end type ConcreteType contains subroutine client(obj) class(AbsType), intent(in) :: obj integer, allocatable :: local_arr(:) allocate(local_arr(2)) local_arr = obj%method() print *, "local_arr: ", local_arr if (.not. all(local_arr == [1, 2])) error stop end subroutine client function concrete_method() result(arr) integer, allocatable :: arr(:) allocate(arr(2)) arr = [1, 2] end function concrete_method end module class_45_mod program class_45 use class_45_mod implicit none class(AbsType), allocatable :: var allocate(ConcreteType :: var) call client(var) end program class_45 lfortran-0.63.0/integration_tests/separate_compilation_36a.f900000664000175000017500000000052515174404631024562 0ustar alastairalastairmodule separate_compilation_36a implicit none type, abstract :: AbsType procedure(intfc), pointer :: ptr => null() end type AbsType abstract interface subroutine intfc(self) import class(AbsType), intent(in) :: self end subroutine intfc end interface end module separate_compilation_36a lfortran-0.63.0/integration_tests/complex_26.f900000664000175000017500000000065615174404631021672 0ustar alastairalastair! Test: Complex literal assigned to Real PARAMETER ! LAPACK legacy pattern where REAL parameters use complex literal syntax program complex_26 implicit none real :: zero, one parameter (zero = (0.0E+0, 0.0E+0), one = (1.0E+0, 0.0E+0)) ! GFortran accepts this as an extension, extracting the real part if (abs(zero) > 1e-6) error stop if (abs(one - 1.0) > 1e-6) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/cycle_and_exit2.f900000664000175000017500000000076415174404631022750 0ustar alastairalastairprogram test_loops integer :: i, j, k l1 : do i = 1, 5 print *, "l1 start" l2 : do j = 1, 4 print *, "l2 start" l3 : do k = 1, 2 if (k > 0) then cycle l1 end if print *, "l1", i, "l2", j, "l3", k if (k > 0) then print *, "error l2" end if end do l3 end do l2 end do l1 if (j == 1 .and. k == 1) then print *, "pass" else print *, "error", i, j, k end if end programlfortran-0.63.0/integration_tests/read_46.f900000664000175000017500000000161315174404631021132 0ustar alastairalastair! This program tests various compilation of various kinds ! for iostat variable program read_46 implicit none character(len=10) :: str integer :: i1 integer(kind = 1):: istat1 integer(kind = 2):: istat2 integer(kind = 4):: istat3 integer(kind = 8):: istat4 str = "111" i1 = 1 read(str, *, iostat=istat1) i1 print*, i1, istat1 if (i1 /= 111) error stop if (istat1 /= 0) error stop i1 = 2 str = "422" read(str, *, iostat=istat2) i1 print*, i1, istat2 if (i1 /= 422) error stop if (istat2 /= 0) error stop i1 = 3 str = "1234" read(str, *, iostat=istat3) i1 print*, i1, istat3 if (i1 /= 1234) error stop if (istat3 /= 0) error stop str = "45" i1 = 1 read(str, *, iostat=istat4) i1 print*, i1, istat1 if (i1 /= 45) error stop if (istat1 /= 0) error stop end program read_46lfortran-0.63.0/integration_tests/do_loop_07.f900000664000175000017500000000104215174404631021643 0ustar alastairalastairprogram do_loop_07 integer :: i, s do i = 1, 3 if (i == 1) then ! There should be an ImplicitDeallocate for __libasr_created_string_format here cycle end if print *, new_array(i) ! There should be an ImplicitDeallocate for __libasr_created_string_format here end do contains function new_array(i) result(t) integer, intent(in) :: i integer, allocatable :: t(:) allocate(t(i)) t = 1 end function end program lfortran-0.63.0/integration_tests/arrays_op_12.f900000664000175000017500000000072515174404631022212 0ustar alastairalastairprogram main implicit none real :: z(2) z = 0.0 print *, z z = solution(z) print *, z if (z(1) /= 1.0) error stop if (z(2) /= 2.0) error stop contains function solution(y) result(x) real, dimension(:), intent(in) :: y real, dimension(:), allocatable :: x x = [1.0, 2.0] print *, y if (y(1) /= 0.0) error stop if (y(2) /= 0.0) error stop end function solution end program main lfortran-0.63.0/integration_tests/format_quotes_01.f900000664000175000017500000000071115174404631023074 0ustar alastairalastairprogram format_quotes_01 implicit none character(len=32) :: s1 character(len=32) :: s2 s1 = '' s2 = '' write (s1, 100) write (s2, 101) if (trim(s1) /= "'Hello world!'") then error stop "format single-quote literal mismatch" end if if (trim(s2) /= '"Hello world!"') then error stop "format double-quote literal mismatch" end if 100 format ('''Hello world!''') 101 format ("""Hello world!""") end program format_quotes_01 lfortran-0.63.0/integration_tests/string_49.f900000664000175000017500000000114315174404631021526 0ustar alastairalastairmodule string_49_mod implicit none private character(len=128) :: str = '' public getopt, str contains subroutine getopt() character(len=10) :: status if (str(1:1) == '-') error stop if (str(1:128) == '-') error stop end subroutine getopt end module string_49_mod program string_49 use string_49_mod character(len=10) :: status character(len=128) :: str2 = '' call getopt() if (str(1:1) == '-') error stop if (str2(1:1) == '-') error stop if (str(1:128) == '-') error stop if (str2(1:128) == '-') error stop end program lfortran-0.63.0/integration_tests/where_05.f900000664000175000017500000000126215174404631021324 0ustar alastairalastairprogram main use iso_fortran_env, only: wp => real64 implicit none call compare_solutions() contains subroutine compare_solutions() implicit none double precision :: reldiff(2) double precision :: absdiff reldiff = 0.0_wp absdiff = 0.5_wp where (solution() /= 0.0_wp) reldiff = absdiff / abs(solution()) if (abs(reldiff(1) - 5.0_wp) > 1e-7) error stop if (abs(reldiff(2) - 5.0_wp) > 1e-7) error stop print *, reldiff end subroutine compare_solutions pure function solution() result(x) implicit none double precision :: x(2) x = [0.10_wp,0.10_wp] end function solution end program main lfortran-0.63.0/integration_tests/cmd_01.f900000664000175000017500000000036715174404631020756 0ustar alastairalastairprogram test_get_command_argument implicit none integer :: i = 0, count character(len=32) :: arg count = command_argument_count() print *, "count: ", count call get_command_argument(i, arg) print *, trim(arg) end program lfortran-0.63.0/integration_tests/separate_compilation_30b.f900000664000175000017500000000144315174404631024555 0ustar alastairalastairmodule separate_compilation_30b_module use separate_compilation_30a_module, only: abstype, mytype implicit none private type, public :: client contains procedure :: method end type client interface client procedure :: constructor end interface client contains function constructor(b) result(self) integer, intent(in) :: b(:) type(client) :: self end function constructor subroutine method(self, arr) class(client), intent(in) :: self class(mytype), allocatable, intent(out) :: arr(:) integer, allocatable :: ints(:) class(abstype), allocatable :: obj allocate(mytype :: arr(1)) arr = mytype(ints, obj) end subroutine method end module separate_compilation_30b_module lfortran-0.63.0/integration_tests/pointer_09.f900000664000175000017500000000261615174404631021702 0ustar alastairalastairprogram pointer_09 ! Test two-argument associated(pointer, target) with pointer dummy ! arguments of a recursive derived type, and verify pointer ! reassignment works correctly inside the associated if-block. implicit none type :: node integer :: val type(node), pointer :: next => null() end type type(node), pointer :: a, b, c, save_a allocate(a) allocate(b) allocate(c) a%val = 1 b%val = 2 c%val = 3 a%next => b b%next => c save_a => a ! Test 1: associated(p, q) with pointer reassignment inside if-block call advance_if_same(a) if (a%val /= 2) error stop if (.not. associated(a, b)) error stop ! Test 2: associated with non-matching pointers should not reassign call advance_if_same_as(b, c) if (b%val /= 2) error stop if (.not. associated(b%next, c)) error stop ! Test 3: associated with matching pointer to specific target call advance_if_same_as(b, b) if (b%val /= 3) error stop if (.not. associated(b, c)) error stop print *, "PASS" deallocate(save_a) deallocate(a) deallocate(c) contains subroutine advance_if_same(p) type(node), pointer, intent(inout) :: p type(node), pointer :: q q => p if (associated(p, q)) then p => q%next end if end subroutine subroutine advance_if_same_as(p, tgt) type(node), pointer, intent(inout) :: p type(node), pointer, intent(in) :: tgt if (associated(p, tgt)) then p => p%next end if end subroutine end program lfortran-0.63.0/integration_tests/gpu_metal_118.f900000664000175000017500000000145615174404631022261 0ustar alastairalastairprogram gpu_metal_118 ! Test: pure function returning array (size(x)) inside do concurrent ! Verifies that array-returning functions called with array section ! arguments inside do concurrent are correctly compiled for Metal GPU. implicit none real :: a(3,2), z(3,2) integer :: i z(:,1) = [1.0, 2.0, 3.0] z(:,2) = [4.0, 5.0, 6.0] a = 0.0 do concurrent (i = 1:2) a(:,i) = copy_vec(z(:,i)) end do if (abs(a(1,1) - 1.0) > 1e-6) error stop if (abs(a(2,1) - 2.0) > 1e-6) error stop if (abs(a(3,1) - 3.0) > 1e-6) error stop if (abs(a(1,2) - 4.0) > 1e-6) error stop if (abs(a(2,2) - 5.0) > 1e-6) error stop if (abs(a(3,2) - 6.0) > 1e-6) error stop print *, "ok" contains pure function copy_vec(x) result(y) real, intent(in) :: x(:) real :: y(size(x)) y = x end function end program lfortran-0.63.0/integration_tests/intrinsics_256.f900000664000175000017500000000336115174404631022471 0ustar alastairalastairprogram intrinsics_256 implicit none integer(4), parameter :: i1 = minval([1, 2, 3]) real(4), parameter :: i2 = minval([1.0, 2.0, 3.0]) integer(8), parameter :: i3 = minval([1, 2, 3], [.true., .true., .true.]) real(8), parameter :: i4 = minval([1.5_8, 22.9_8, 3.0_8], mask = [.true., .false., .true.]) integer(4), parameter :: i5 = minval([11, 2, 5], 1, mask = [.true., .false., .true.]) real(4), parameter :: i6 = minval([1.0, 3.0, 55.9], mask = [.true., .false., .true.], dim = 1) integer(4) :: ar1(4) = [1, 2, 7, 9] real(4) :: ar2(4) = [1.0, 3.1, 7.2, 9.0] logical(4) :: mask(4) = [.true., .false., .true., .true.] integer(4) :: dim = 1 print *, i1 if (i1 /= 1) error stop print *, i2 if (abs(i2 - 1.00000000e+00) > 1e-6) error stop print *, i3 if (i3 /= 1) error stop print *, i4 if (abs(i4 - 1.50000000000000000e+00) > 1e-12) error stop print *, i5 if (i5 /= 5) error stop print *, i6 if (abs(i6 - 1.00000000e+00) > 1e-6) error stop print *, minval(ar1) if (minval(ar1) /= 1) error stop print *, minval(ar2) if (abs(minval(ar2) - 1.00000000e+00) >1e-6 ) error stop print *, minval(ar1, mask) if (minval(ar1, mask) /= 1) error stop print *, minval(ar2, mask = mask) if (abs(minval(ar2, mask = mask) - 1.00000000e+00) > 1e-6) error stop print *, minval(ar1, dim) if (minval(ar1, dim) /= 1) error stop print *, minval(ar2, dim = dim) if (abs(minval(ar2, dim = dim) - 1.00000000e+00) > 1e-6) error stop print *, minval(ar1, mask = mask, dim = dim) if (minval(ar1, mask = mask, dim = dim) /= 1) error stop print *, minval(ar2, dim, mask) if (abs(minval(ar2, dim, mask) - 1.00000000e+00) > 1e-6) error stop end programlfortran-0.63.0/integration_tests/c_ptr_09.f900000664000175000017500000000054515174404631021330 0ustar alastairalastairprogram c_ptr_09 use iso_c_binding, only: c_ptr, c_null_ptr, c_associated implicit none type(c_ptr) :: p ! Test c_associated with c_null_ptr literal directly if (c_associated(c_null_ptr)) error stop ! Test c_associated with a variable holding c_null_ptr p = c_null_ptr if (c_associated(p)) error stop end program c_ptr_09 lfortran-0.63.0/integration_tests/separate_compilation_41a.f900000664000175000017500000000067215174404631024561 0ustar alastairalastairmodule separate_compilation_41a implicit none type :: innertype contains procedure :: method end type innertype type :: outertype class(innertype), allocatable :: inner end type outertype contains subroutine method(self, n, arr) class(innertype), intent(in) :: self integer, intent(in) :: n real(8), intent(in) :: arr(n:, :) end subroutine method end module separate_compilation_41a lfortran-0.63.0/integration_tests/gpu_metal_124.f900000664000175000017500000000123415174404631022250 0ustar alastairalastairprogram gpu_metal_124 ! Test: pure function with assumed-shape array argument and ! runtime-sized result (size(x)) called via a runtime-size ! slice inside do concurrent. Exercises VLA workspace buffers ! for allocatable temporaries in Metal GPU codegen. implicit none integer :: i, k real :: z(3), a(3) k = 2 z = 1.0 a = 0.0 do concurrent (i = 1:1) a(1:k) = f(z(1:k)) end do if (abs(a(1) - 1.0) > 1e-5) error stop if (abs(a(2) - 1.0) > 1e-5) error stop if (a(3) /= 0.0) error stop print *, "PASSED" contains pure function f(x) result(y) real, intent(in) :: x(:) real :: y(size(x)) y = x end function end program lfortran-0.63.0/integration_tests/procedure_02.f900000664000175000017500000000113315174404631022174 0ustar alastairalastairmodule procedure_02_module implicit none abstract interface subroutine fn(n, y) integer, intent(in) :: n integer, intent(out) :: y end subroutine end interface contains integer function plus(f, x) procedure(fn) :: f integer, intent(in) :: x call f(x+4, plus) end function end module program procedure_02 use procedure_02_module, only: plus implicit none integer :: i i = plus(myf, 5) print *, i if (i /= 18) error stop contains subroutine myf(n, y) integer, intent(in) :: n integer, intent(out) :: y y = 2*n end subroutine end program lfortran-0.63.0/integration_tests/nested_20.f900000664000175000017500000000064215174404631021472 0ustar alastairalastairmodule nested_20_mod implicit none type t integer :: i = 1 integer :: arr(2) = [10, 20] end type t type(t), parameter :: t_param = t() end module nested_20_mod program nested_20 use nested_20_mod implicit none ! Check scalar component if (t_param%i /= 1) error stop ! Check array component if (any(t_param%arr /= [10, 20])) error stop end program nested_20 lfortran-0.63.0/integration_tests/read_27.f900000664000175000017500000000047215174404631021133 0ustar alastairalastairprogram read_nan_string use, intrinsic :: ieee_arithmetic, only: ieee_is_nan implicit none character(len=3) :: nan_string real :: valu nan_string = 'NaN' read(nan_string, '(f3.3)') valu if (.not. ieee_is_nan(valu)) error stop "wrong value read" print *, 'test passed!' end program read_nan_stringlfortran-0.63.0/integration_tests/arrays_reshape_41.f900000664000175000017500000000075215174404631023225 0ustar alastairalastairprogram arrays_reshape_41 implicit none real(8), allocatable :: x(:), v(:) allocate(x(6)) x = [1.d0, 2.d0, 3.d0, 4.d0, 5.d0, 6.d0] v = f(reshape(x, [size(x)])) if (.not. allocated(v)) error stop 1 if (size(v) /= size(x)) error stop 2 if (any(v /= x)) error stop 3 contains function f(r) result(v) real(8), intent(in) :: r(:) real(8) :: v(size(r)) v = r end function f end program arrays_reshape_41 lfortran-0.63.0/integration_tests/print_arr_06.f900000664000175000017500000000232215174404631022211 0ustar alastairalastairprogram print_arr_06 character(5),allocatable:: arr_str(:) integer(8):: arr_int(3) real(8):: arr_real(4) logical :: arr_logical(3) integer(2) :: w real(4) ::m character(20) ::s character(200) :: FORMAT_STR character(300) ::res character(300) ::lfortran_output character(300) ::gfortran_output allocate(arr_str(5)) ! set format string FORMAT_STR = "(5a,2X,3i1,2X,4f3.1,2X,3l,2X,1i2,2X,1f5.3,2X,1a)" ! set values for scalar variables and arrays arr_str = ["a","b","c","d","e"] arr_int = [1,2,3] arr_real = [1.1,1.2,1.3,1.4] arr_logical = [.true.,.false.,.true.] w = 10 m = 1.4 s = "test" ! write to res with formatting write(res,FORMAT_STR) arr_str,arr_int,arr_real,arr_logical,w,m,s ! print print FORMAT_STR,arr_str,arr_int,arr_real,arr_logical,w,m,s print "(a)",res ! Testing lfortran_output = "abcde 123 1.11.21.31.4 TFT 10 1.400 test" gfortran_output = "a b c d e 123 1.11.21.31.4 TFT 10 1.400 test" ! GFortran and LFortran vary while printing array of characters. if(res /= lfortran_output .and. res /= gfortran_output) error stop end program print_arr_06lfortran-0.63.0/integration_tests/parameter_10.f900000664000175000017500000000110515174404631022162 0ustar alastairalastairprogram parameter_10 implicit none integer, parameter :: N = 10 integer, parameter :: sp = kind(1.0) integer, parameter :: dp = kind(1.d0) real(dp), parameter :: pi = 2*asin(1._dp) real(dp), parameter :: a = 0, b = pi real(dp), parameter :: dx = (b-a)/N integer :: i real(dp), parameter :: X(N) = [(sin(a+(b-a)*i/N), i = 1, N)] real(dp), parameter :: S = sum(X)*dx logical, parameter :: l = S < 2 real(kind=merge(sp, dp, l)) :: y print *, (kind(y) == sp) if (kind(y) /= sp) then error stop end if print *, S if (abs(S - 1.9835235375094546_dp) > 1e-14) error stop end program lfortran-0.63.0/integration_tests/types_real_array_to_complex_array_cast.f900000664000175000017500000000043715174404631027717 0ustar alastairalastairprogram types_real_array_to_complex_array_cast integer, parameter :: dp = kind(0.d0) complex(dp) :: D(3) = [1.0_dp, 2.0_dp, 3.0_dp] if (any(D /= [(1.0_dp, 0.0_dp), & (2.0_dp, 0.0_dp), & (3.0_dp, 0.0_dp)])) & error stop end program lfortran-0.63.0/integration_tests/select_type_09.f900000664000175000017500000000267215174404631022544 0ustar alastairalastairmodule select_type_09_mod implicit none type, abstract :: base end type base type, extends(base) :: int_val integer :: i end type int_val type, extends(base) :: real_val real :: r end type real_val type :: temp class(base), allocatable :: bas end type temp contains subroutine print_value(val, x) class(base), intent(inout) :: val class(real_val), intent(out) :: x select type(v => val) type is(int_val) v%i = 50 x%r = 3.5 end select end subroutine print_value subroutine print_value2(val) class(temp), intent(inout) :: val select type(v => val%bas) type is(int_val) v%i = 50 end select end subroutine print_value2 end module select_type_09_mod program select_type_09 use select_type_09_mod implicit none class(base), allocatable :: val class(real_val), allocatable :: r_val type(temp), allocatable :: val2 allocate(int_val :: val) allocate(r_val) select type(val) type is(int_val) val%i = 42 call print_value(val, r_val) if (val%i /= 50) error stop end select if (r_val%r /= 3.5) error stop select type(cmd => val) class is(int_val) cmd%i = 42 call print_value(cmd, r_val) if (cmd%i /= 50) error stop end select allocate(val2) allocate(int_val :: val2%bas) call print_value2(val2) select type(v => val2%bas) type is(int_val) if (v%i /= 50) error stop end select end program select_type_09 lfortran-0.63.0/integration_tests/separate_compilation_24.f900000664000175000017500000000050415174404631024413 0ustar alastairalastairmodule tester_separate_compilation_24 use sorting_separate_compilation_24 implicit none end module tester_separate_compilation_24 program separate_compilation_24 use tester_separate_compilation_24 implicit none integer :: n = 1 call sort( n ) print *, n if (n /= 5) error stop end programlfortran-0.63.0/integration_tests/nullify_04.f900000664000175000017500000000063115174404631021672 0ustar alastairalastairmodule module_nullify_04 implicit none type :: scaled_data_structure real, dimension(:), pointer :: one_d_real_pointer end type end module program nullify_04 use module_nullify_04, only : scaled_data_structure implicit none type(scaled_data_structure) :: s type(scaled_data_structure) :: s2 nullify(s%one_d_real_pointer) nullify(s2%one_d_real_pointer) end programlfortran-0.63.0/integration_tests/assumed_rank_06.f900000664000175000017500000000117515174404631022672 0ustar alastairalastairmodule assumed_rank_06_mod implicit none type :: t real, allocatable :: x(:) end type contains subroutine sub(x) real, intent(in) :: x(..) select rank(x) rank(1) if (size(x) /= 3) error stop if (abs(x(1) - 1.0) > 1e-6) error stop if (abs(x(2) - 2.0) > 1e-6) error stop if (abs(x(3) - 3.0) > 1e-6) error stop rank default error stop end select end subroutine end module program assumed_rank_06 use assumed_rank_06_mod implicit none type(t) :: a allocate(a%x(3)) a%x(1) = 1.0 a%x(2) = 2.0 a%x(3) = 3.0 call sub(a%x) print *, "ok" end program lfortran-0.63.0/integration_tests/implied_do_loops17.f900000664000175000017500000000146415174404631023403 0ustar alastairalastair! Test that the loop variable in an array constructor implied-DO ! is isolated and does not affect outer variables with the same name program implied_do_loops17 implicit none integer :: a(5) integer :: i, j real :: b(3) ! Test 1: Basic isolation test i = 0 a = [(1, i = 1, 5)] if (i /= 0) error stop ! Test 2: Multiple implied-DO loops should each restore their variable j = 42 a = [(j, j = 1, 5)] if (j /= 42) error stop ! Test 3: With expression in the implied-DO body i = 100 a = [(i*2, i = 1, 5)] if (i /= 100) error stop ! Test 4: Nested implied-DO should also isolate variables i = 10 j = 20 b = [(real(i+j), i = 1, 3)] if (i /= 10) error stop if (j /= 20) error stop print *, "PASSED" end program implied_do_loops17 lfortran-0.63.0/integration_tests/read_28.f900000664000175000017500000000303715174404631021134 0ustar alastairalastairprogram test_string_read_arrays implicit none call test_f32() call test_f64() call test_i32() call test_i64() print *, "ALL TESTS PASSED" contains subroutine test_f32() implicit none real :: list(3) character(len=12) :: clist clist = "1.0 42. -42." read(clist, *) list if (abs(list(1) - 1.0) > 1e-6) error stop if (abs(list(2) - 42.0) > 1e-6) error stop if (abs(list(3) + 42.0) > 1e-6) error stop end subroutine subroutine test_f64() implicit none real(8) :: list(3) character(len=15) :: clist clist = "1.5 2.5 -3.5" read(clist, *) list if (abs(list(1) - 1.5_8) > 1d-12) error stop if (abs(list(2) - 2.5_8) > 1d-12) error stop if (abs(list(3) + 3.5_8) > 1d-12) error stop end subroutine subroutine test_i32() implicit none integer :: list(3) character(len=15) :: clist clist = "10 -20 30" read(clist, *) list if (list(1) /= 10) error stop if (list(2) /= -20) error stop if (list(3) /= 30) error stop end subroutine subroutine test_i64() implicit none integer(8) :: list(3) character(len=33) :: clist clist = "1000000000 -2000000000 2000000000" read(clist, *) list if (list(1) /= 1000000000_8) error stop if (list(2) /= -2000000000_8) error stop if (list(3) /= 2000000000_8) error stop end subroutine end program test_string_read_arrayslfortran-0.63.0/integration_tests/minpack_02.f900000664000175000017500000000074515174404631021636 0ustar alastairalastairmodule minpack_02_testmod_der1 implicit none integer, parameter :: dp=kind(0d0) contains subroutine check_deriv(x, fvec, fjac) real(dp), intent(in) :: x(:) real(dp), intent(out) :: fvec(:), fjac(:,:) real(dp) :: xp(size(x)), fvecp(size(fvec)), err(size(fvec)) end subroutine end module program minpack_test use minpack_02_testmod_der1, only: dp, check_deriv implicit none real(dp) :: x1(10), fvec1(20), fjac1(30, 40) call check_deriv(x1, fvec1, fjac1) end program minpack_test lfortran-0.63.0/integration_tests/openmp_07.f900000664000175000017500000000121615174404631021511 0ustar alastairalastairsubroutine static_counter(n, ctr) use omp_lib implicit none integer, intent(in) :: n integer, intent(inout) :: ctr integer :: local_ctr integer :: i local_ctr = 1 !$omp parallel private(i) reduction(*:local_ctr) !$omp do do i = 1, n local_ctr = local_ctr * 1 end do !$omp end do ! the following condition shall be true almost always if (local_ctr > ( n / omp_get_max_threads()) + 5) error stop !$omp end parallel ctr = ctr + local_ctr end subroutine program openmp_07 use omp_lib integer, parameter :: n = 1000000 integer :: ctr call omp_set_num_threads(8) ctr = 0 call static_counter(n, ctr) print *, ctr if (ctr /= 1) error stop end program lfortran-0.63.0/integration_tests/intrinsics_349.f900000664000175000017500000000061715174404631022475 0ustar alastairalastairprogram intrinsics_349 integer :: A(2,2) = reshape([1,2,3,4],[2,2]) call temp(A) contains subroutine temp(A) integer, intent(inout) :: A(:,:) integer :: X(size(A,1)*size(A,2)) X = [1,2,3,4] print *, pack(X, [.true., .true., .true., .true.]) if (any(pack(X, [.true., .true., .true., .true.]) /= [1,2,3,4])) error stop end subroutine end programlfortran-0.63.0/integration_tests/array_slice_04.f900000664000175000017500000000215715174404631022512 0ustar alastairalastairprogram array_slice_04 implicit none integer :: i, j integer :: array1(10) integer :: array2(10, 10) real, allocatable :: y(:) allocate(y(13)) y = [(real(i - 1, 4)**2, i = 1, 13)] print *, y(2:12:2) if( any(y(2:12:2) /= [1.0, 9.0, 25.0, 49.0, 81.0, 121.0]) ) error stop array1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] print *, array1(1:10) if( any(array1(1:10) /= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) ) error stop print *, array1(10:1:-1) if( any(array1(10:1:-1) /= [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) ) error stop array1 = [(i, i = 1, 10)] array1(:) = 0 array1(1:5) = 1 array1(6:) = 1 do i = 1, 10 do j = 1, 10 array2(i, j) = i * j end do end do print *, array1(1) if( array1(1) /= 1 ) error stop print *, array1(1:10:2) if( any(array1(1:10:2) /= [1, 1, 1, 1, 1]) ) error stop print *, array2(:, 3) if( any(array2(:, 3) /= [3, 6, 9, 12, 15, 18, 21, 24, 27, 30]) ) error stop print *, array1(10:1:-1) if( any(array1(10:1:-1) /= [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) ) error stop end program array_slice_04 lfortran-0.63.0/integration_tests/complex_unary_minus_03.f900000664000175000017500000000110115174404631024300 0ustar alastairalastair! Test for complex unary minus in implicit interface call with PARAMETER ! Reproduces ICE from LAPACK clasyf_aa.f subroutine csub(alpha, n, ok) implicit none integer, intent(in) :: n complex, intent(in) :: alpha logical, intent(out) :: ok ok = (real(alpha) == -1.0) .and. (aimag(alpha) == 0.0) end subroutine program complex_unary_minus_03 implicit none complex, parameter :: zero = 0.0e+0, one = 1.0e+0 logical :: ok external :: csub ok = .false. call csub(-one, 1, ok) if (.not. ok) error stop print *, 'PASS' end program lfortran-0.63.0/integration_tests/allocate_48.f900000664000175000017500000000060715174404631022007 0ustar alastairalastairprogram allocate_48 implicit none call test(n=100) call test(n=200) contains subroutine test(n) integer, intent(in) :: n integer, allocatable :: arr(:) allocate(arr(2), source=n) if (arr(1) /= n) error stop if (arr(2) /= n) error stop if (size(arr) /= 2) error stop print "(A,2I12)", 'subroutine result', arr end subroutine test end program allocate_48 lfortran-0.63.0/integration_tests/file_39_test.txt0000664000175000017500000000003015174404631022410 0ustar alastairalastair1 2 3 4 5 6 lfortran-0.63.0/integration_tests/intrinsics_43.f900000664000175000017500000000053715174404631022405 0ustar alastairalastairprogram intrinsics_43 implicit none integer :: x = dim(4, 15) integer :: y = dim(15, 4) real(8) :: p = dim(4.345_8, 2.111_8) real(8) :: q = dim(2.111_8, 4.345_8) if (x /= 0) error stop if (y /= 11) error stop if (p /= (4.345_8 - 2.111_8)) error stop if (q /= 0) error stop print *, x, y, p, q end program lfortran-0.63.0/integration_tests/array_op_02.f900000664000175000017500000000027115174404631022022 0ustar alastairalastairprogram main implicit none real :: x(2) x = -1.0 if (abs(x(1) - (-1)) > 1e-8) error stop if (abs(x(2) - (-1)) > 1e-8) error stop print *, x end program main lfortran-0.63.0/integration_tests/gpu_metal_88.f900000664000175000017500000000163315174404631022204 0ustar alastairalastairmodule m_gpu_metal_88 implicit none type :: a_t integer :: x end type type :: b_t type(a_t), allocatable :: items(:) contains procedure :: n end type contains pure integer function n(self) class(b_t), intent(in) :: self n = size(self%items) end function end module ! Test: do concurrent calling a type-bound procedure on a struct ! that has an allocatable array member of another struct type. ! Previously failed at Metal shader compilation because the element ! type of the allocatable struct array was emitted as ! "/* unsupported struct type */" instead of the actual struct name. program gpu_metal_88 use m_gpu_metal_88 implicit none type(b_t) :: b integer :: i real :: r(2) allocate(b%items(3)) do concurrent (i = 1:2) r(i) = real(b%n()) end do if (abs(r(1) - 3.0) > 0.001) error stop if (abs(r(2) - 3.0) > 0.001) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/write_04.f900000664000175000017500000000016515174404631021344 0ustar alastairalastairprogram write_04 implicit none write(*,'("Hello ")',advance='NO') write(*,'("world!")') end programlfortran-0.63.0/integration_tests/associate_31.f900000664000175000017500000000312015174404631022157 0ustar alastairalastairmodule nf_embedding_layer implicit none private public :: embedding_layer type :: embedding_layer integer :: sequence_length, vocab_size, model_dimension integer :: positional real, allocatable :: weights(:, :) real, allocatable :: output(:, :) real, allocatable :: dw(:, :) ! weight gradients contains procedure :: set_params end type embedding_layer interface module subroutine set_params(self, params) class(embedding_layer), intent(in out) :: self real, intent(in), target :: params(:) end subroutine set_params end interface end module nf_embedding_layer submodule(nf_embedding_layer) nf_embedding_layer_submodule implicit none contains module subroutine set_params(self, params) class(embedding_layer), intent(in out) :: self real, intent(in), target :: params(:) real, pointer :: p_(:,:) associate(n => self % vocab_size * self % model_dimension) ! reshape the weights p_(1:self % vocab_size, 1:self % model_dimension) => params(1 : n) self % weights = p_ end associate end subroutine set_params end submodule nf_embedding_layer_submodule program associate_30 use nf_embedding_layer implicit none type(embedding_layer) :: layer real, target :: p(12) integer :: i layer%vocab_size = 2 layer%model_dimension = 2 do i = 1, 12 p(i) = real(i) end do call layer%set_params(p) print *, layer%weights if (any(layer%weights /= reshape([1.0, 2.0, 3.0, 4.0], [2, 2]))) error stop end program associate_30 lfortran-0.63.0/integration_tests/sin_02.f900000664000175000017500000000350715174404631021004 0ustar alastairalastairprogram sin_02 use, intrinsic :: iso_fortran_env, only: dp => real64 implicit none real(dp), parameter :: pi = 3.1415926535897932384626433832795_dp real(dp) :: x, r1, r2, err x = 10.5_dp r1 = dsin(x) r2 = -0.87969575997167_dp err = abs(r1-r2) print *, x, r1, r2 print *, err if (err > 1e-15_dp) error stop contains real(dp) function abs(x) result(r) real(dp), intent(in) :: x if (x >= 0) then r = x else r = -x end if end function elemental integer function floor(x) result(r) real(dp), intent(in) :: x if (x >= 0) then r = x else r = x-1 end if end function elemental real(dp) function modulo(x, y) result(r) real(dp), intent(in) :: x, y r = x-floor(x/y)*y end function elemental real(dp) function min(x, y) result(r) real(dp), intent(in) :: x, y if (x < y) then r = x else r = y end if end function elemental real(dp) function max(x, y) result(r) real(dp), intent(in) :: x, y if (x > y) then r = x else r = y end if end function elemental real(dp) function dsin(x) result(r) real(dp), intent(in) :: x real(dp) :: y integer :: n y = modulo(x, 2*pi) y = min(y, pi - y) y = max(y, -pi - y) y = min(y, pi - y) r = kernel_dsin(y) end function ! Accurate on [-pi/2,pi/2] to about 1e-16 elemental real(dp) function kernel_dsin(x) result(res) real(dp), intent(in) :: x real(dp), parameter :: S1 = 0.9999999999999990771_dp real(dp), parameter :: S2 = -0.16666666666664811048_dp real(dp), parameter :: S3 = 8.333333333226519387e-3_dp real(dp), parameter :: S4 = -1.9841269813888534497e-4_dp real(dp), parameter :: S5 = 2.7557315514280769795e-6_dp real(dp), parameter :: S6 = -2.5051823583393710429e-8_dp real(dp), parameter :: S7 = 1.6046585911173017112e-10_dp real(dp), parameter :: S8 = -7.3572396558796051923e-13_dp real(dp) :: z z = x*x res = x * (S1+z*(S2+z*(S3+z*(S4+z*(S5+z*(S6+z*(S7+z*S8))))))) end function end program lfortran-0.63.0/integration_tests/format_24.f900000664000175000017500000000303715174404631021505 0ustar alastairalastairprogram format_24 implicit none complex(8) :: z real(8) :: rvals(3) character(len=*), parameter :: FMT = '(*(g0.5,1x))' integer, parameter :: WP = selected_real_kind(15,307) real(WP) :: g = 1 rvals = [1.1d0, 2.2d0, 3.3d0] z = (1.23d0, -4.56d0) write(*,FMT) 'test: ', g print "(G0.17)", 1d0/3d0 ! Real division with repeating decimal print "(G0.5)", 12345.6789d0 ! Wide number, smaller precision print "(G0.17)", 0.00000001234567d0 ! Small magnitude number print "(G0.17)", 123456789012345.0d0 ! Large magnitude number print "(G0.17)", 1.234567890123456d0 ! High-precision number print "(G0.17)", -42.0d0 ! Negative real print "(G0.17)", 0.0d0 ! Zero print "(G0.17)", 42 ! Integer print "(G0.17)", -1000 ! Negative integer print "(G0.17)", .true. ! Logical true print "(G0.17)", .false. ! Logical false print "(G0.17)", "Hello G format!" ! Character string print "(G0.17)", z ! Complex number print "(3G0.17)", rvals ! Array of real numbers print "(G0.17)", 123456789012345.d+4 print "(G0.17)", -123456789012345.d+7 print "(G0.7)", 0.00001234 print "(G15.7)", 1.0 print "(G15.7)", 1.23 print "(G15.7)", 1234567.8 print "(G15.7)", 0.0001234 print "(G15.7)", 1234567.8 print "(4G15.7)", 1.0, 1.23, 1234567.8, 0.0001234 end program format_24 lfortran-0.63.0/integration_tests/elemental_10.f900000664000175000017500000000600215174404631022151 0ustar alastairalastairprogram elemental_10 implicit none real, dimension(1) :: array_param real :: scalar_param, expected_ans, epsilon = 1.0e-6 real, dimension(1) :: result_2param real, dimension(1) :: result_3param array_param = [1.0] scalar_param = 1.0 expected_ans = 2.0 print *, "Testing 2-parameter elemental function:" result_2param = func2(array_param, array_param) if (any(abs(result_2param - 2.0) > epsilon)) then error stop "Array, Array does not match 1.0" end if result_2param = func2(array_param, scalar_param) if (any(abs(result_2param - expected_ans) > epsilon)) then error stop "Array, Scalar does not match 1.0" end if result_2param = func2(scalar_param, array_param) if (any(abs(result_2param - expected_ans) > epsilon)) then error stop "Scalar, Array does not match 1.0" end if result_2param = func2(scalar_param, scalar_param) if (abs(result_2param(1) - expected_ans) > epsilon) then error stop "Scalar, Scalar does not match 1.0" end if print *, "\nTesting 3-parameter elemental function:" result_3param = func3(array_param, array_param, array_param) if (any(abs(result_3param - expected_ans) > epsilon)) then error stop "Array, Array, Array does not match 1.0" end if result_3param = func3(array_param, array_param, scalar_param) if (any(abs(result_3param - expected_ans) > epsilon)) then error stop "Array, Array, Scalar does not match 1.0" end if result_3param = func3(array_param, scalar_param, array_param) if (any(abs(result_3param - expected_ans) > epsilon)) then error stop "Array, Scalar, Array does not match 1.0" end if result_3param = func3(array_param, scalar_param, scalar_param) if (any(abs(result_3param - expected_ans) > epsilon)) then error stop "Array, Scalar, Scalar does not match 1.0" end if result_3param = func3(scalar_param, array_param, array_param) if (any(abs(result_3param - expected_ans) > epsilon)) then error stop "Scalar, Array, Array does not match 1.0" end if result_3param = func3(scalar_param, array_param, scalar_param) if (any(abs(result_3param - expected_ans) > epsilon)) then error stop "Scalar, Array, Scalar does not match 1.0" end if result_3param = func3(scalar_param, scalar_param, array_param) if (any(abs(result_3param - expected_ans) > epsilon)) then error stop "Scalar, Scalar, Array does not match 1.0" end if result_3param = func3(scalar_param, scalar_param, scalar_param) if (abs(result_3param(1) - expected_ans) > epsilon) then error stop "Scalar, Scalar, Scalar does not match 1.0" end if contains elemental function func2(x, y) result(res) real, intent(in) :: x, y real :: res res = x + y end function func2 elemental function func3(x, y, z) result(res) real, intent(in) :: x, y, z real :: res res = x * y + z end function func3 end program elemental_10 lfortran-0.63.0/integration_tests/string_40.f900000664000175000017500000000072415174404631021521 0ustar alastairalastairprogram string_40 print *, integer_i1_to_string(5) if (integer_i1_to_string(5) /= 'ingLFortran') error stop contains pure function integer_i1_to_string(pos) result(string) character(len=:), allocatable :: string integer, parameter :: buffer_len = 128 character(len=buffer_len) :: buffer integer, intent(in) :: pos buffer = 'TestingLFortran' string = buffer(pos:) end function integer_i1_to_string end program lfortran-0.63.0/integration_tests/gpu_metal_133.f900000664000175000017500000000115115174404631022246 0ustar alastairalastair! Test: sum() of allocatable function result inside do concurrent, where the ! function returns an allocatable array via implicit reallocation (r = a). ! This tests that the Metal backend correctly determines the size of ! allocatable arrays assigned from function parameters. program gpu_metal_133 implicit none integer :: i real :: x(2), y(1) x = [1.0, 2.0] do concurrent (i = 1:1) y(i) = sum(f(x)) end do if (abs(y(1) - 3.0) > 1e-5) error stop print *, y(1) contains pure function f(a) result(r) real, intent(in) :: a(:) real, allocatable :: r(:) r = a end function end program lfortran-0.63.0/integration_tests/read_29.f900000664000175000017500000000062015174404631021130 0ustar alastairalastairprogram read_complex implicit none integer :: iunit complex :: cnum open (newunit=iunit, file='complex.data', form='formatted', status='unknown') write (iunit, '(2f10.5)') (42.5, -42.5) rewind (iunit) read (iunit, '(2f10.5)') cnum close (iunit, status='keep') if (abs(real(cnum) - 42.5) > 1.0e-5 .or. abs(aimag(cnum) + 42.5) > 1.0e-5) stop print *, 'test passed' end programlfortran-0.63.0/integration_tests/file_01_data.txt0000664000175000017500000000004115174404631022331 0ustar alastairalastair10130 c 4.20 9223372036854775804 lfortran-0.63.0/integration_tests/associate_07.f900000664000175000017500000000103115174404631022161 0ustar alastairalastairprogram associate_07 integer, pointer :: p1 => null() real(8), pointer :: p2(:, :) => null() complex(4), pointer :: p3(:, :) => null() integer, target :: t1 = 2 real(8), target :: t2(2, 3) complex(4), target :: t3(2, 4) p1 => t1 p2 => t2 if( .not. associated(p1) ) error stop if( .not. associated(p2) ) error stop if( .not. associated(p1, t1) ) error stop if( .not. associated(p2, t2) ) error stop if( associated(p3) ) error stop if( associated(p3, t3) ) error stop end program lfortran-0.63.0/integration_tests/class_145.f900000664000175000017500000000154715174404631021412 0ustar alastairalastairmodule class_145_mod implicit none type :: mytype integer :: n contains procedure :: compute => mytype_compute procedure :: worker => mytype_worker end type contains subroutine mytype_worker(me, x, res) class(mytype), intent(in) :: me real, intent(in) :: x(:) real, intent(out) :: res res = x(1) + real(me%n) end subroutine subroutine mytype_compute(me) class(mytype), intent(inout) :: me real, dimension(:), allocatable :: x real :: res allocate(x(3)) x(1) = 1.0 call me%worker(x, res) print *, res if (abs(res - 6.0) > 1e-6) error stop end subroutine end module program class_145 use class_145_mod implicit none type(mytype) :: obj obj%n = 5 call obj%compute() print *, "PASSED" end program lfortran-0.63.0/integration_tests/read_05.f900000664000175000017500000000030115174404631021116 0ustar alastairalastairprogram main implicit none character(len=10) :: x ! Accept READ with format literal and no unit if (.false.) then read '(A)', x end if print *, 'ok' end program lfortran-0.63.0/integration_tests/operator_overloading_06.f900000664000175000017500000000215315174404631024437 0ustar alastairalastairmodule operator_overloading_06_mo_vec type :: typ1 real :: x, y contains procedure :: diff, neg generic :: operator(-) => diff, neg end type typ1 ! extended type type, extends(typ1) :: typ2 real :: z end type typ2 contains pure type(typ1) function diff(this, that) class(typ1), intent(in) :: this, that diff = typ1(this%x - that%x, this%y - that%y) end function diff pure type(typ1) function neg(this) class(typ1), intent(in) :: this neg = typ1(-this%x, -this%y) end function neg end module operator_overloading_06_mo_vec program vec_test use operator_overloading_06_mo_vec, only: typ2, typ1 type(typ2) :: var1 = typ2(1., 3., 5.), var2 = typ2(2., 4., 6.) type(typ1) :: result print *, var1, var2 print *, -var2 result = -var2 if( abs(result%x + 2.0) > 1e-8 ) error stop if( abs(result%y + 4.0) > 1e-8 ) error stop print *, var1 - var2 result = var1 - var2 if( abs(result%x + 1.0) > 1e-8 ) error stop if( abs(result%y + 1.0) > 1e-8 ) error stop end program vec_test lfortran-0.63.0/integration_tests/print_arr_05.f900000664000175000017500000000006315174404631022210 0ustar alastairalastairprogram print_arr_05 print* ,[4,9] end program lfortran-0.63.0/integration_tests/procedure_pointer_20.f900000664000175000017500000000252115174404631023736 0ustar alastairalastairmodule procedure_pointer_component_mod implicit none type :: arg integer :: dummy end type arg type :: method integer :: nargs procedure(), nopass, pointer :: f => null() procedure(), nopass, pointer :: caller => null() type(arg), allocatable :: args(:) end type method interface method module procedure :: method_create, method_create_0 end interface contains function method_create(nargs, f) result(that) integer, intent(in) :: nargs procedure() :: f type(method) :: that that%f => f that%nargs = nargs allocate(that%args(nargs)) end function method_create function method_create_0(f, caller) result(that) procedure() :: f procedure(), optional :: caller type(method) :: that that%f => f that%nargs = 0 allocate(that%args(0)) if (present(caller)) then that%caller => caller end if end function method_create_0 end module procedure_pointer_component_mod program procedure_pointer_20 use procedure_pointer_component_mod, only: method implicit none type(method) :: m1 m1 = method(0, sub_a) if (m1%nargs /= 0) error stop contains subroutine sub_a() end subroutine sub_a end program procedure_pointer_20 lfortran-0.63.0/integration_tests/implicit_argument_casting_04.f900000664000175000017500000000246715174404631025445 0ustar alastairalastair! Test that --implicit-argument-casting correctly handles optional arguments ! and rejects fundamentally incompatible types (e.g., string where integer expected) ! while allowing compatible numeric casts via keyword arguments. module implicit_cast_optional_m use iso_c_binding, only: c_bool, c_int implicit none contains subroutine my_stop(quiet, code_int, code_char) logical(c_bool), intent(in) :: quiet integer(c_int), intent(in), optional :: code_int character(len=*), intent(in), optional :: code_char if (present(code_int)) then if (code_int /= 42) error stop "wrong int" end if if (present(code_char)) then if (code_char /= "hello") error stop "wrong char" end if end subroutine end module program implicit_argument_casting_04 use iso_c_binding, only: c_bool use implicit_cast_optional_m, only: my_stop implicit none ! Test 1: keyword argument for string optional (should work) call my_stop(.false._c_bool, code_char="hello") ! Test 2: keyword argument for integer optional (should work) call my_stop(.false._c_bool, code_int=42) ! Test 3: positional integer argument (should work) call my_stop(.false._c_bool, 42) ! Test 4: both keyword arguments (should work) call my_stop(.false._c_bool, code_int=42, code_char="hello") print *, "PASS" end program lfortran-0.63.0/integration_tests/derived_types_62.f900000664000175000017500000000113115174404631023056 0ustar alastairalastairmodule derived_types_62_m implicit none type :: toml_ser_config character(:), allocatable :: indent integer, allocatable :: i end type toml_ser_config type :: toml_serializer type(toml_ser_config) :: config = toml_ser_config() end type toml_serializer end module derived_types_62_m program derived_types_62 use derived_types_62_m type(toml_serializer) :: serializer serializer%config%indent = "test" if (serializer%config%indent /= "test") error stop serializer%config%i = 4 if (serializer%config%i /= 4) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_129.f900000664000175000017500000000046315174404631022260 0ustar alastairalastairprogram gpu_metal_129 implicit none real :: x(1) integer :: i do concurrent (i = 1:1) x(i) = sum(f()) end do print *, x(1) if (abs(x(1) - 2.0) > 1e-6) error stop contains pure function f() result(v) real, allocatable :: v(:) allocate(v(2)) v = 1.0 end function end program lfortran-0.63.0/integration_tests/functions_41.f900000664000175000017500000000065515174404631022227 0ustar alastairalastairprogram functions_41 implicit none call notrecursive_sub print *, notrecursive_fun() contains non_recursive subroutine notrecursive_sub print *, "This is a non-recursive subroutine" end subroutine notrecursive_sub non_recursive integer function notrecursive_fun() print *, "This is a non-recursive function" notrecursive_fun = 1 end function notrecursive_fun end program functions_41 lfortran-0.63.0/integration_tests/pass_array_by_data_11.f900000664000175000017500000000115115174404631024033 0ustar alastairalastairprogram pass_array_by_data_11 implicit none real :: y0(5) y0 = AB5(func, y0(:)) if (any(y0 /= [1.0,1.0,1.0,1.0,0.0])) error stop contains function AB5(f, y0) interface real function f(y) real, intent(in) :: y(:) end function end interface real, intent(in) :: y0(:) real, allocatable :: AB5(:) allocate(AB5(size(y0))) AB5(1:size(y0)-1) = func(y0(1:3)) AB5(size(y0)) = 0.0 end function real function func(y) real, intent(in) :: y(:) func = 1.0 end function end programlfortran-0.63.0/integration_tests/enum_07.f900000664000175000017500000000035615174404631021163 0ustar alastairalastairprogram enum_07 use enum_07_parent_mod implicit none integer :: x x = 10 call do_work(x) if (x /= 11) error stop if (sparse_full /= 0) error stop if (wksp_a /= 3) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/lapack_01.f900000664000175000017500000000277115174404631021447 0ustar alastairalastairsubroutine dpttrf(n, d, e, info) integer :: n, info double precision :: d( * ), e( * ) double precision :: zero parameter( zero = 0.0d+0 ) integer :: i, i4 double precision :: ei intrinsic :: mod info = 0 if( n.eq.0 ) return i4 = mod( n-1, 4 ) do 10 i = 1, i4 if( d( i ).le.zero ) then info = i go to 30 end if ei = e( i ) e( i ) = ei / d( i ) d( i+1 ) = d( i+1 ) - e( i )*ei 10 continue do 20 i = i4 + 1, n - 4, 4 if( d( i ).le.zero ) then info = i go to 30 end if ei = e( i ) e( i ) = ei / d( i ) d( i+1 ) = d( i+1 ) - e( i )*ei if( d( i+1 ).le.zero ) then info = i + 1 go to 30 end if ei = e( i+1 ) e( i+1 ) = ei / d( i+1 ) d( i+2 ) = d( i+2 ) - e( i+1 )*ei if( d( i+2 ).le.zero ) then info = i + 2 go to 30 end if ei = e( i+2 ) e( i+2 ) = ei / d( i+2 ) d( i+3 ) = d( i+3 ) - e( i+2 )*ei if( d( i+3 ).le.zero ) then info = i + 3 go to 30 end if ei = e( i+3 ) e( i+3 ) = ei / d( i+3 ) d( i+4 ) = d( i+4 ) - e( i+3 )*ei 20 continue if( d( n ).le.zero ) info = n 30 continue return end subroutine program lapack_01 integer :: n = 3, info double precision :: d(3), e(2) d = [4, 5, 6] e = [1, 2] call dpttrf(n, d, e, info) print *, "sum(d): ", sum(d) if ( abs(sum(d) - 13.907894736842106) > 1e-6 ) error stop print *, "sum(e): ", sum(e) if ( abs(sum(e) - 0.67105263157894735) > 1e-7 ) error stop print *, "info: ", info if ( info /= 0 ) error stop end programlfortran-0.63.0/integration_tests/modules_18b.f900000664000175000017500000000366715174404631022043 0ustar alastairalastairmodule modules_18b use iso_c_binding, only: c_int, c_long_long, c_float, c_double implicit none contains integer function f(a, b) result(r) integer, intent(in) :: a real, intent(in) :: b interface ! int f_int_float_value(int a, float b) integer(c_int) function f_int_float_value(a, b) result(r) bind(c) import :: c_int, c_float integer(c_int), value, intent(in) :: a real(c_float), value, intent(in) :: b end function end interface r = f_int_float_value(a, b) end function subroutine g(a, b, r) integer, intent(in) :: a real, intent(in) :: b integer, intent(out) :: r interface ! void sub_int_float_value(int a, float b, int *r) subroutine sub_int_float_value(a, b, r) bind(c) import :: c_int, c_float integer(c_int), value, intent(in) :: a real(c_float), value, intent(in) :: b integer(c_int), intent(out) :: r end subroutine end interface call sub_int_float_value(a, b, r) end subroutine integer(c_int) function fortran_i32(i) result(r) bind(c) integer(c_int), intent(in) :: i r = i + 2 end function integer(c_int) function fortran_i32_value(i) result(r) bind(c) integer(c_int), value, intent(in) :: i r = i + 2 end function integer(c_long_long) function fortran_i64(i) result(r) bind(c) integer(c_long_long), intent(in) :: i r = i + 2 end function integer(c_long_long) function fortran_i64_value(i) result(r) bind(c) integer(c_long_long), value, intent(in) :: i r = i + 2 end function real(c_float) function fortran_f32(i) result(r) bind(c) real(c_float), intent(in) :: i r = i + 2.3_c_float end function real(c_float) function fortran_f32_value(i) result(r) bind(c) real(c_float), value, intent(in) :: i r = i + 2.3_c_float end function real(c_double) function fortran_f64(i) result(r) bind(c) real(c_double), intent(in) :: i r = i + 2.3_c_double end function real(c_double) function fortran_f64_value(i) result(r) bind(c) real(c_double), value, intent(in) :: i r = i + 2.3_c_double end function end module lfortran-0.63.0/integration_tests/template_field.f900000664000175000017500000000414315174404631022665 0ustar alastairalastairmodule field_m !! field is a unit_ring that also has a division or inverse operation use unit_ring_m, only: unit_ring implicit none private public :: & field_only_division, & field_only_inverse, & field, & derive_field_from_division, & derive_field_from_inverse requirement field_only_division(T, plus, zero, mult, one, minus, negate, divide) require :: unit_ring(T, plus, zero, mult, one, minus, negate) elemental function divide(x, y) result(quotient) type(T), intent(in) :: x, y type(T) :: quotient end function end requirement requirement field_only_inverse(T, plus, zero, mult, one, minus, negate, invert) require :: unit_ring(T, plus, zero, mult, one, minus, negate) elemental function invert(x) result(inverse) type(T), intent(in) :: x type(T) :: inverse end function end requirement requirement field(T, plus, zero, mult, one, minus, negate, divide, invert) require :: field_only_division(T, plus, zero, mult, one, minus, negate, divide) require :: field_only_inverse(T, plus, zero, mult, one, minus, negate, invert) end requirement template derive_field_from_division(T, plus, zero, mult, one, minus, negate, divide) require :: field_only_division(T, plus, zero, mult, one, minus, negate, divide) private public :: invert contains elemental function invert(x) result(inverse) type(T), intent(in) :: x type(T) :: inverse inverse = divide(one(), x) end function end template template derive_field_from_inverse(T, plus, zero, mult, one, minus, negate, invert) require :: field_only_inverse(T, plus, zero, mult, one, minus, negate, invert) private public :: divide contains elemental function divide(x, y) result(quotient) type(T), intent(in) :: x, y type(T) :: quotient quotient = mult(x, invert(y)) end function end template end module lfortran-0.63.0/integration_tests/complex_pow_test.f900000664000175000017500000000014315174404631023276 0ustar alastairalastairprogram complex2 complex :: x, y, z x = (3.0, 4.0) y = (3.0, 2.0) z = x**y print *, z end program lfortran-0.63.0/integration_tests/block_05.f900000664000175000017500000000121515174404631021302 0ustar alastairalastairsubroutine hybrd(n) implicit none integer :: n main : block if ( n <= 0 ) then exit main else if ( n >= 2 ) then if ( n <= 4 ) then n = n +1 else exit main end if else n = n + 9 end if n = n + 2 end block main n = n + 3 print *, "n = ", n end subroutine hybrd program main implicit none integer :: n n = -5 call hybrd(n) if (n /= -2) error stop n = 1 call hybrd(n) if (n /= 15) error stop n = 5 call hybrd(n) if (n /= 8) error stop end program main lfortran-0.63.0/integration_tests/openmp_68.f900000664000175000017500000000517715174404631021532 0ustar alastairalastairprogram openmp_68 use omp_lib implicit none integer, parameter :: n = 100 integer :: i, tid, j integer :: thread_chunks(0:7) = 0 integer :: chunk_sizes(100) ! Track size of each chunk given out integer :: chunk_count = 0 integer :: current_iteration = 1 integer :: chunk_start(100), chunk_thread(100) logical :: test_passed = .true. logical :: looks_like_static = .true. call omp_set_num_threads(4) print *, "=== DYNAMIC Schedule with chunk=", 5, "===" ! Track chunks !$omp parallel private(tid) !$omp do schedule(dynamic, 5) do i = 1, n tid = omp_get_thread_num() !$omp critical ! Check if this is start of new chunk if (i == current_iteration) then chunk_count = chunk_count + 1 chunk_start(chunk_count) = i chunk_thread(chunk_count) = tid thread_chunks(tid) = thread_chunks(tid) + 1 ! Find chunk size if (i + 5 - 1 <= n) then chunk_sizes(chunk_count) = 5 current_iteration = i + 5 else chunk_sizes(chunk_count) = n - i + 1 current_iteration = n + 1 end if end if !$omp end critical end do !$omp end do !$omp end parallel ! Verify dynamic chunk behavior print *, "Total chunks distributed:", chunk_count print *, "Chunks per thread:" do i = 0, omp_get_max_threads()-1 print *, "Thread", i, ":", thread_chunks(i), "chunks" end do ! Check chunk sizes do i = 1, chunk_count-1 if (chunk_sizes(i) /= 5) then print *, "ERROR: Chunk", i, "has size", chunk_sizes(i), "expected", 5 test_passed = .false. end if end do ! Last chunk might be smaller if (chunk_sizes(chunk_count) > 5) then print *, "ERROR: Last chunk too large!" test_passed = .false. end if ! With dynamic, chunks should not follow a strict pattern ! Check for round-robin pattern (which would indicate static behavior) do i = 2, min(chunk_count, 8) if (chunk_thread(i) /= mod(chunk_thread(1) + i - 1, omp_get_max_threads())) then looks_like_static = .false. exit end if end do if (looks_like_static .and. chunk_count > 4) then print *, "WARNING: Dynamic schedule showing static-like round-robin pattern!" end if if (.not. test_passed) then error stop "DYNAMIC chunk schedule test FAILED!" end if print *, "DYNAMIC chunk schedule test completed" end program openmp_68lfortran-0.63.0/integration_tests/legacy_array_sections_10.f900000664000175000017500000000044515174404631024561 0ustar alastairalastairprogram legacy_array_sections_10 implicit none real, allocatable :: a(:) allocate(a(4)) a = [1.0, 2.0, 3.0, 4.0] call foo(a) call foo(a(2)) if (abs(a(1) - 11.0) > 1e-6) error stop if (abs(a(2) - 12.0) > 1e-6) error stop end program legacy_array_sections_10 lfortran-0.63.0/integration_tests/derived_types_105.f900000664000175000017500000000332415174404631023142 0ustar alastairalastairmodule derived_types_105_my_type implicit none type :: my_type integer :: x contains procedure, private :: output generic, public :: write(formatted) => output end type my_type contains subroutine output(self, unit, iotype, v_list, iostat, iomsg) class(my_type), intent(in) :: self integer, intent(in) :: unit character(*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(*), intent(inout) :: iomsg iostat = 0 iomsg = "" write(unit, '(i0)', iostat=iostat, iomsg=iomsg) self%x end subroutine output end module derived_types_105_my_type ! This module has a subroutine named "output" (same as the write(formatted) ! implementation in my_type). This tests that overloaded write resolution ! correctly handles name collisions. module derived_types_105_client use derived_types_105_my_type, only: my_type implicit none type :: client_type contains procedure, nopass :: output end type client_type contains subroutine output(obj) type(my_type), intent(in) :: obj write(10, '(dt)') obj end subroutine output end module derived_types_105_client program derived_types_105 use derived_types_105_client implicit none type(client_type) :: t type(my_type) :: m character(len=20) :: tmp m%x = 42 open(10, file="derived_types_105_file.txt", form="formatted") call t%output(m) close(10) open(10, file="derived_types_105_file.txt", form="formatted") read(10, '(a)') tmp close(10, status="delete") if (trim(tmp) /= "42") error stop print *, "PASS" end program derived_types_105 lfortran-0.63.0/integration_tests/read_47.f900000664000175000017500000000072715174404631021140 0ustar alastairalastairprogram read_47 implicit none character(256) :: s character(60) :: val1 = "''" character(60) :: val2 = "'hello'" character(60) :: val3 = "'it''s'" character(60) :: val4 = '"world"' read(val1, *) s if (len_trim(s) /= 0) error stop 1 read(val2, *) s if (trim(s) /= "hello") error stop 2 read(val3, *) s if (trim(s) /= "it's") error stop 3 read(val4, *) s if (trim(s) /= "world") error stop 4 end program read_47 lfortran-0.63.0/integration_tests/associate_01.f900000664000175000017500000000104215174404631022155 0ustar alastairalastairprogram associate_01 implicit none real, allocatable :: a(:), b(:,:), c(:,:,:) real, pointer :: x(:), y(:,:,:) real :: a_1, c_234, c_121 integer :: n a_1 = 0 n = 10 allocate(a(5)) allocate(b(n,n), c(n, 5, n)) 1 loop: associate (x => a, y => c, z => c(:, 2, :)) x(1) = a_1 + 5 y(2,3,4) = 3 z(1, 1) = 17 if (size(z) /= 100) error stop end associate loop a_1 = a(1) if(a(1).EQ.5) GO TO 1 c_234 = c(2,3,4) c_121 = c(1,2,1) if (a_1 /= 10.) error stop if (c_234 /= 3.) error stop if (c_121 /= 17.) error stop end program associate_01 lfortran-0.63.0/integration_tests/format_54.f900000664000175000017500000000046015174404631021505 0ustar alastairalastairprogram format_54 implicit none character(4) :: fmt(4) character(len=32) :: actual character(len=*), parameter :: expected = 'hello world!' fmt = [ '("he', 'llo ', 'worl', 'd!")' ] actual = '' write(actual, fmt) if (trim(actual) /= expected) error stop end program format_54 lfortran-0.63.0/integration_tests/intrinsics_141.f900000664000175000017500000000350115174404631022456 0ustar alastairalastairprogram intrinsic_141 implicit none real :: x = 178.1387e-4 integer :: i = 5 real :: y = -186.3245e-4 integer :: j = 3 real, parameter :: x1 = scale(11.0, 2) real(8), parameter :: y1 = scale(-11.0_8, 2) real(8), parameter :: z1 = scale(11.0, 2_8) real, parameter ::ar1(3) = scale([1.0, 21.0, 13.0], 2) real(8), parameter :: ar2(3) = scale([1.0_8, 2.0_8, 3.0_8], 2) real(8), parameter :: ar3(3) = scale([1.0, 2.0, 3.0], 2_8) real :: arr1(3) = [1.0, 21.0, 13.0] real(8) :: arr2(3) = [1.0_8, 2.0_8, 3.0_8] integer :: arr3(3) = [1, 2, 3] print *, scale(arr1, arr3) if (any(abs(scale(arr1, arr3) - [2.00000000e+00, 84.0000000, 104.000000]) > 1e-7)) error stop print *, scale(arr2, 2) if (any(abs(scale(arr2, 2) - [4.00000000e+00, 8.00000000, 12.0000000]) > 1e-7)) error stop print *, x1 if (abs(x1 - 4.40000000e+01) > 1e-7) error stop print *, y1 if (abs(y1 - (-4.40000000000000000e+01)) > 1e-7) error stop print *, z1 if (abs(z1 - 4.40000000000000000e+01) > 1e-7) error stop print *, ar1 if (any(abs(ar1 - [4.00000000e+00, 8.40000000e+01, 5.20000000e+01]) > 1e-7)) error stop print *, ar2 if (any(abs(ar2 - [4.00000000000000000e+00, 8.00000000000000000e+00, 1.20000000000000000e+01]) > 1e-7)) error stop print *, ar3 if (any(abs(ar3 - [4.00000000000000000e+00, 8.00000000000000000e+00, 1.20000000000000000e+01]) > 1e-7)) error stop print *, scale(y,j) if (abs(scale(y, j) - (-1.49059594e-01)) > 1e-7) error stop print *, scale(-186.3245e-4,3) if (abs(scale(-186.3245e-4,3) - (-1.49059594e-01)) > 1e-7) error stop print *, scale(x,i) if (abs(scale(x, i) - 5.70043862e-01) > 1e-7) error stop print *, scale(178.1387e-4,5) if (abs(scale(178.1387e-4, 5) - 5.70043862e-01) > 1e-7) error stop end program lfortran-0.63.0/integration_tests/openmp_74.f900000664000175000017500000000067515174404631021525 0ustar alastairalastairmodule omp_threadprivate_mod implicit none integer :: j_start = 1 !$omp threadprivate(j_start) contains integer function get_j_start() implicit none get_j_start = j_start end function get_j_start end module omp_threadprivate_mod program openmp_74 use omp_threadprivate_mod, only: get_j_start implicit none integer :: j j = get_j_start() if (j /= 1) error stop end program openmp_74 lfortran-0.63.0/integration_tests/character_08.f900000664000175000017500000000100415174404631022143 0ustar alastairalastairprogram test_char_kind_len implicit none character(kind=1, len=10) :: str1 character(len=10, kind=1) :: str2 character(10, 1) :: str3 character(10, kind=1) :: str4 str1 = "Hello1" str2 = "Hello2" str3 = "Hello3" str4 = "Hello4" print *, "str1 = ", str1, ", length = ", len(str1) print *, "str2 = ", str2, ", length = ", len(str2) print *, "str3 = ", str3, ", length = ", len(str3) print *, "str4 = ", str4, ", length = ", len(str4) end program test_char_kind_len lfortran-0.63.0/integration_tests/associate_21.f900000664000175000017500000000055315174404631022165 0ustar alastairalastairprogram associate_21 use associate_21_mod_b type(model_t) :: tmp_model allocate(tmp_model%dependency(1)) call tmp_model%update_dependency(1, 5) !!! TODO: Need to associate properly and handle integer pointer ! if (tmp_model%dependency(1)%name /= "LFortran") error stop ! if (tmp_model%dependency(1)%key /= 5) error stop end programlfortran-0.63.0/integration_tests/huge_string_read.f900000664000175000017500000000034715174404631023222 0ustar alastairalastairprogram huge_string_read implicit none double precision :: x character(len=40) :: xstring x = huge(1d0) write(xstring,*) x read(xstring,*) x if (x /= huge(1d0)) error stop end program huge_string_readlfortran-0.63.0/integration_tests/intrinsics_425.f900000664000175000017500000000074415174404631022471 0ustar alastairalastairprogram intrinsics_425 ! Test co_sum with optional arguments (no-op in single-image mode) implicit none integer :: a, stat_val real :: b a = 10 call co_sum(a, 1) if (a /= 10) error stop b = 3.14 call co_sum(b, 1) if (abs(b - 3.14) > 1e-6) error stop a = 5 stat_val = 0 call co_sum(a, result_image=1, stat=stat_val) if (a /= 5) error stop print *, "co_sum with optional args: all tests passed" end program intrinsics_425 lfortran-0.63.0/integration_tests/class_106a.f900000664000175000017500000000302315174404631021537 0ustar alastairalastairmodule class_106a_mod implicit none private type, public, abstract :: AbsType contains procedure(dummy_ifc), deferred :: dummy end type AbsType abstract interface subroutine dummy_ifc(self) import :: AbsType class(AbsType), intent(inout) :: self end subroutine dummy_ifc end interface type, public, extends(AbsType) :: ConcreteType contains procedure :: dummy => concrete_dummy end type ConcreteType type, public :: MyType integer, allocatable :: ints(:) class(AbsType), allocatable :: obj contains procedure :: my_method end type MyType interface MyType procedure :: constructor end interface MyType contains function constructor(ints, obj) result(self) integer, intent(in) :: ints(:) class(AbsType), intent(in) :: obj type(MyType) :: self self%ints = ints self%obj = obj end function constructor subroutine my_method(self) class(MyType), intent(inout) :: self if (.not. allocated(self%ints)) then error stop "MyType%ints not allocated" end if if (.not. allocated(self%obj)) then error stop "MyType%obj not allocated" end if call self%obj%dummy() end subroutine my_method subroutine concrete_dummy(self) class(ConcreteType), intent(inout) :: self ! no-op end subroutine concrete_dummy end module class_106a_mod lfortran-0.63.0/integration_tests/implied_do_loops19.f900000664000175000017500000000115615174404631023403 0ustar alastairalastairprogram implied_do_loops19 implicit none character(*), parameter :: punc = ",; ." integer, parameter :: lpunc = len(punc) integer :: i, j character(4) :: input(lpunc**2) input = [(("2"//punc(i:i)//"5"//punc(j:j), i=1,lpunc), j=1,lpunc)] if (size(input) /= 16) error stop if (input(1) /= "2,5,") error stop if (input(2) /= "2;5,") error stop if (input(3) /= "2 5,") error stop if (input(4) /= "2.5,") error stop if (input(5) /= "2,5;") error stop if (input(6) /= "2;5;") error stop if (input(9) /= "2,5 ") error stop if (input(13) /= "2,5.") error stop if (input(16) /= "2.5.") error stop end program implied_do_loops19 lfortran-0.63.0/integration_tests/where_08.f900000664000175000017500000000214115174404631021324 0ustar alastairalastairprogram where_08 implicit none logical :: l1(5) logical :: l2(5) logical, allocatable, dimension(:) :: l3 logical, allocatable, dimension(:) :: l4 integer :: b(5) l1 = [.true., .false., .true., .false., .true.] l2 = [1 < 2, 2 == 2, .true., .false., 2 >= 1] allocate(l3(5)) l3 = [.true., .false., .false., .true., .false.] allocate(l4(5)) l4 = .true. where(l1) b = 1 print *, b if (all(b /= [1, 0, 1, 0, 1])) error stop where(l2) b = 2 print *, b if (all(b /= [2, 2, 2, 0, 2])) error stop where(get_logical_array()) b = 3 print *, b if (all(b /= [3, 2, 3, 0, 3])) error stop where([.true., .false., .true., .false., .true.]) b = 4 print *, b if (all(b /= [4, 2, 4, 0, 4])) error stop where(l3) b = 5 print *, b if (all(b /= [5, 2, 4, 5, 4])) error stop where(l4) b = 6 print *, b if (all(b /= [6, 6, 6, 6, 6])) error stop contains function get_logical_array() result(value) implicit none logical :: value(5) value = [.true., .false., .true., .false., .true.] end function end program where_08lfortran-0.63.0/integration_tests/class_104.f900000664000175000017500000000242615174404631021402 0ustar alastairalastairmodule class_104_mod implicit none type, public, abstract :: AbsType end type AbsType type, extends(AbsType) :: MyType integer :: key end type MyType interface MyType procedure :: init end interface MyType type :: ClientType contains procedure :: client end type ClientType contains function init() result(self) type(MyType) :: self self%key = 100 end function init subroutine client(self, arr) class(ClientType), intent(in) :: self class(AbsType), allocatable, intent(out) :: arr(:) allocate(MyType :: arr(2)) arr = MyType() end subroutine client end module class_104_mod program class_104 use class_104_mod implicit none type(ClientType) :: c class(AbsType), allocatable :: arr(:) call c%client(arr) if (.not. allocated(arr)) error stop "arr not allocated" if (size(arr) /= 2) error stop "wrong array size" select type (arr) type is (MyType) print *, "arr(1)%key = ", arr(1)%key print *, "arr(2)%key = ", arr(2)%key if (arr(1)%key /= 100 .or. arr(2)%key /= 100) error stop "wrong key value" class default error stop "wrong dynamic type" end select end program class_104 lfortran-0.63.0/integration_tests/intrinsics_388.f900000664000175000017500000000052115174404631022472 0ustar alastairalastairprogram intrinsics_388 integer exit_status exit_status = -1 call execute_command_line( & command = "export TEST_ENV_VAR_VALUE=23", & wait = .true., & exitstat = exit_status & ) print *, "Exit status after setting environment variable:", exit_status if (exit_status /= 0) error stop end program intrinsics_388 lfortran-0.63.0/integration_tests/gpu_metal_151_net.f900000664000175000017500000000120315174404631023112 0ustar alastairalastairmodule gpu_metal_151_network_m implicit none type network_t real :: w = 1.0 contains procedure :: infer => default_infer end type interface elemental module function default_infer(self, x) result(y) class(network_t), intent(in) :: self real, intent(in) :: x real :: y end function end interface end module submodule (gpu_metal_151_network_m) gpu_metal_151_network_impl use gpu_metal_151_layer_m contains elemental module function default_infer(self, x) result(y) class(network_t), intent(in) :: self real, intent(in) :: x real :: y y = self%w * x end function end submodule lfortran-0.63.0/integration_tests/intrinsics_07.f900000664000175000017500000000030715174404631022400 0ustar alastairalastairprogram intrinsics_07 ! Tests for kind() integer, parameter :: sp = kind(0.0) integer, parameter :: sp2 = kind(0.e0) integer, parameter :: dp = kind(0.d0) real(sp) :: a real(dp) :: b a = 5 b = a end lfortran-0.63.0/integration_tests/derived_types_87.f900000664000175000017500000000161115174404631023070 0ustar alastairalastairmodule derived_types_87_mod implicit none type :: string_t character(len=:), allocatable :: s end type string_t type :: compile_command_t type(string_t) :: directory type(string_t), allocatable :: str_arr(:) end type compile_command_t interface compile_command_t module procedure cct_new end interface compile_command_t contains type(compile_command_t) function cct_new(directory) result(cct) character(len=*), intent(in) :: directory end function end module derived_types_87_mod program derived_types_87 use derived_types_87_mod type(compile_command_t) :: cc cc = compile_command_t(directory = string_t("abc"), & str_arr = [string_t("def"), string_t("xyz")]) if (cc%str_arr(1)%s /= "def") error stop if (cc%str_arr(2)%s /= "xyz") error stop if (cc%directory%s /= "abc") error stop end programlfortran-0.63.0/integration_tests/select_type_33.f900000664000175000017500000000267715174404631022546 0ustar alastairalastair! Test Functions having select type blocks with custom types selection module select_33_mod implicit none type, abstract :: AbsType end type AbsType type, extends(AbsType) :: MyType real(8), allocatable :: arr(:,:) end type MyType contains subroutine reshaper(obj, n) class(AbsType), intent(in) :: obj integer, intent(in) :: n(:) real(8), dimension(n(1)*n(2)) :: a integer :: s(1) select type (obj) type is (MyType) ! Reshape the 2D slice into the 1D local array 'a' a = reshape(obj%arr(1:n(1), 1:n(2)), [n(1)*n(2)]) s = shape(a) print *, s print *, a if ((s(1)) /= 6) error stop if ((a(1) - 1.0) >= 1e-4) error stop if ((a(2) - 2.0) >= 1e-4) error stop if ((a(3) - 3.0) >= 1e-4) error stop if ((a(4) - 4.0) >= 1e-4) error stop if ((a(5) - 5.0) >= 1e-4) error stop if ((a(6) - 6.0) >= 1e-4) error stop class default print *, "Unknown type." error stop end select end subroutine reshaper end module select_33_mod program select_33 use select_33_mod implicit none type(MyType) :: instance integer :: dims(2) integer :: i, j dims = [3, 2] allocate(instance%arr(dims(1), dims(2))) instance%arr = reshape([(real(i, 8), i = 1, 6)], [3, 2]) call reshaper(instance, dims) end program select_33lfortran-0.63.0/integration_tests/select_rank_08.f900000664000175000017500000000121515174404631022505 0ustar alastairalastairprogram select_rank_08 implicit none integer :: a(2) = [4, 2] integer :: b(2, 3) = reshape([1, 2, 3, 4, 5, 6], [2, 3]) call check(a) call check(b) contains subroutine check(x) integer, intent(inout) :: x(..) integer, save :: a(2) = [5, 3] integer, save :: b(2, 3) = reshape([6, 5, 4, 3, 2, 1], [2, 3]) select rank(x) rank (1) x = a print *, x if (any(x /= a)) error stop rank (2) x = b print *, x if (any(x /= b)) error stop end select end subroutine check end program select_rank_08 lfortran-0.63.0/integration_tests/derived_types_apply_clip_01.f900000664000175000017500000000404015174404631025265 0ustar alastairalastairmodule derived_types_apply_clip_01_mod implicit none type :: clip_type logical :: l_min_max = .false. logical :: l_norm = .false. real :: min_val = -huge(1.0) real :: max_val = huge(1.0) real :: norm_val = huge(1.0) contains procedure, pass(this) :: apply => apply_clip end type clip_type contains pure subroutine apply_clip(this, length, gradient, bias) class(clip_type), intent(in) :: this integer, intent(in) :: length real, dimension(length), intent(inout) :: gradient real, dimension(:), optional, intent(inout) :: bias real :: scale real, dimension(:), allocatable :: bias_ if (present(bias)) then bias_ = bias else allocate(bias_(1), source=0.0) end if if (this%l_min_max) then gradient = max(this%min_val, min(this%max_val, gradient)) bias_ = max(this%min_val, min(this%max_val, bias_)) end if if (this%l_norm) then scale = min(1.0, & this%norm_val / sqrt(sum(gradient**2.0) + & sum(bias_)**2.0)) if (scale < 1.0) then gradient = gradient * scale bias_ = bias_ * scale end if end if if (present(bias)) bias = bias_ end subroutine apply_clip end module derived_types_apply_clip_01_mod program derived_types_apply_clip_01 use derived_types_apply_clip_01_mod implicit none type(clip_type) :: clipper real, dimension(5) :: grad integer :: i clipper%l_min_max = .true. clipper%min_val = -1.0 clipper%max_val = 1.0 grad = [2.0, -3.0, 0.5, -0.5, 4.0] call clipper%apply(5, grad) if (abs(grad(1) - 1.0) > 1.0e-6) error stop if (abs(grad(2) - (-1.0)) > 1.0e-6) error stop if (abs(grad(3) - 0.5) > 1.0e-6) error stop if (abs(grad(4) - (-0.5)) > 1.0e-6) error stop if (abs(grad(5) - 1.0) > 1.0e-6) error stop print *, "PASS" end program derived_types_apply_clip_01 lfortran-0.63.0/integration_tests/subroutines_08.f900000664000175000017500000000133315174404631022576 0ustar alastairalastairprogram main integer :: x = 10 integer :: y(1) = [20] print *, x print *, y(1) call test1(1, x) print *, x if (x /= 1) error stop call test2(2, x) print *, x if (x /= 2) error stop call test3(3, x) print *, x if (x /= 3) error stop ! call test1(2,y(1)) ! Not yet supported ! print *, y(1) ! if (y(1) /= 2) error stop end program main subroutine test1(i,a) integer, intent(in) :: i integer :: a a = i end subroutine test1 subroutine test2(i,a) integer, intent(in) :: i integer, intent(inout) :: a a = i end subroutine test2 subroutine test3(i,a) integer, intent(in) :: i integer, intent(out) :: a a = i end subroutine test3 lfortran-0.63.0/integration_tests/elemental_09.f900000664000175000017500000000515715174404631022173 0ustar alastairalastair!> test that user-defined elemental subroutines !> get broadcasted correctly module elemental_09_module implicit none contains elemental subroutine square_element(x, y) real, intent(in) :: x real, intent(out) :: y y = x * x end subroutine square_element elemental subroutine multiply_elements(x, y, z) real, intent(in) :: x real, intent(in) :: y real, intent(out) :: z z = x * y end subroutine multiply_elements end module elemental_09_module program elemental_09 use elemental_09_module implicit none real, parameter :: epsilon = 1e-7 real, dimension(5) :: arr_in1 = [1.0, 2.0, 3.0, 4.0, 5.0] real, dimension(5) :: arr_in2 = [2.0, 3.0, 4.0, 5.0, 6.0] real, dimension(5) :: arr_out call square_element(arr_in1, arr_out) print *, arr_out if (abs(arr_out(1) - 1) > epsilon ) error stop if (abs(arr_out(2) - 4) > epsilon ) error stop if (abs(arr_out(3) - 9) > epsilon ) error stop if (abs(arr_out(4) - 16) > epsilon ) error stop if (abs(arr_out(5) - 25) > epsilon ) error stop call multiply_elements(arr_in1, arr_in2, arr_out) print *, arr_out if (abs(arr_out(1) - 2) > epsilon ) error stop if (abs(arr_out(2) - 6) > epsilon ) error stop if (abs(arr_out(3) - 12) > epsilon ) error stop if (abs(arr_out(4) - 20) > epsilon ) error stop if (abs(arr_out(5) - 30) > epsilon ) error stop print *, arr_out call multiply_elements(arr_in1, 2.0, arr_out) print *, arr_out if (abs(arr_out(1) - 2) > epsilon ) error stop if (abs(arr_out(2) - 4) > epsilon ) error stop if (abs(arr_out(3) - 6) > epsilon ) error stop if (abs(arr_out(4) - 8) > epsilon ) error stop if (abs(arr_out(5) - 10) > epsilon ) error stop call multiply_elements(3.0, arr_in1, arr_out) print *, arr_out if (abs(arr_out(1) - 3) > epsilon ) error stop if (abs(arr_out(2) - 6) > epsilon ) error stop if (abs(arr_out(3) - 9) > epsilon ) error stop if (abs(arr_out(4) - 12) > epsilon ) error stop if (abs(arr_out(5) - 15) > epsilon ) error stop call sum_elements(arr_in1, arr_in2, arr_out) print *, arr_out if (abs(arr_out(1) - 3) > epsilon ) error stop if (abs(arr_out(2) - 5) > epsilon ) error stop if (abs(arr_out(3) - 7) > epsilon ) error stop if (abs(arr_out(4) - 9) > epsilon ) error stop if (abs(arr_out(5) - 11) > epsilon ) error stop contains elemental subroutine sum_elements(x, y, z) real, intent(in) :: x real, intent(in) :: y real, intent(out) :: z z = x + y end subroutine sum_elements end program elemental_09 lfortran-0.63.0/integration_tests/procedure_34.f900000664000175000017500000000461615174404631022212 0ustar alastairalastairmodule procedure_34_mod implicit none abstract interface subroutine pintfc(i, a, b, c, d) integer(4), intent(in) :: i real(8), dimension(i:,:), intent(in) :: a real(8), dimension(i:,:), intent(in) :: b, c real(8), dimension(i:,:,:,:),intent(out) :: d end subroutine pintfc end interface contains subroutine client(n, arr, pptr) integer(4), intent(in) :: n real(8), intent(in) :: arr(n:,n:,:) procedure(pintfc), pointer, optional :: pptr real(8) :: a(2:5, 4) real(8) :: b(2:5, 3) real(8) :: c(2:5, 3) real(8) :: d(2:5, 4, 4, 4) a = 5.5 b = 6.6 c = 7.7 if (present(pptr)) then call pptr(2, a, b, c, d) if (any((d-1.1) >1e-8)) error stop else error stop end if end subroutine client ! This routine implements pintfc and performs the safety checks subroutine verify_pintfc_args(i, a, b, c, d) integer(4), intent(in) :: i real(8), dimension(i:,:), intent(in) :: a real(8), dimension(i:,:), intent(in) :: b, c real(8), dimension(i:,:,:,:),intent(out) :: d ! 1. Check if 'i' matches the hardcoded call (0) if (i /= 2) error stop ! 2. Check Lower Bounds (should be i, which is 0) if (lbound(a, 1) /= 2) error stop print *, size(a, 1), size(a, 2) if (size(a, 1) /= 4 .or. size(a, 2) /= 4) error stop if (any(abs(a-5.5) >1e-8)) error stop print *, size(b, 1), size(b, 2) if (size(b, 1) /= 4 .or. size(b, 2) /= 3) error stop if (any(abs(b - 6.6) > 1e-8)) error stop print *, size(c, 1), size(c, 2) if (size(c, 1) /= 4 .or. size(c, 2) /= 3) error stop if (any(abs(c - 7.7) > 1e-8)) error stop print *, size(d, 1), size(d, 2), size(d, 3), size(d, 4) if (size(d, 1) /= 4 .or. size(d, 2) /= 4 .or. & size(d, 3) /= 4 .or. size(d, 4) /= 4) then error stop end if d = 1.1 end subroutine verify_pintfc_args end module procedure_34_mod program procedure_34 use procedure_34_mod implicit none integer(4) :: n = 1 real(8) :: my_arr(1:5, 1:5, 1:3) procedure(pintfc), pointer :: my_ptr => null() my_ptr => verify_pintfc_args call client(n, my_arr, my_ptr) print *, "Done" end program procedure_34lfortran-0.63.0/integration_tests/bindc_13.f900000664000175000017500000000071515174404631021272 0ustar alastairalastairmodule bindc_13_mod use iso_c_binding, only: c_char implicit none interface pure subroutine caf_fatal_error(str) bind(C) import :: c_char character(kind=c_char,len=:), pointer, intent(in) :: str end subroutine subroutine process_str(str) bind(C) import :: c_char character(kind=c_char,len=*), intent(in) :: str end subroutine end interface end module program bindc_13 use bindc_13_mod implicit none print *, "ok" end program lfortran-0.63.0/integration_tests/select_type_39.f900000664000175000017500000000341015174404631022536 0ustar alastairalastair! Test: two contained subroutines with same-named local derived types ! combined with class(*) polymorphic allocation. Verifies that the ! LLVM codegen correctly distinguishes types in different scopes. module select_type_39_mod implicit none type :: container class(*), allocatable :: value(:) end type interface container module procedure container_init end interface contains function container_init(value) result(obj) class(*), intent(in) :: value(:) type(container) :: obj allocate(obj%value, source=value) end function subroutine get_value(this, value) type(container), intent(in) :: this class(*), allocatable, intent(out) :: value(:) allocate(value, source=this%value) end subroutine end module program select_type_39 use select_type_39_mod implicit none call test_sub1 call test_sub2 contains subroutine test_sub1 type(container) :: x class(*), allocatable :: val(:) type :: point real :: x, y end type x = container([point(1.0, 2.0), point(3.0, 4.0)]) call get_value(x, val) select type (val) type is (point) if (abs(val(1)%x - 1.0) > 1e-6) error stop if (abs(val(1)%y - 2.0) > 1e-6) error stop if (abs(val(2)%x - 3.0) > 1e-6) error stop if (abs(val(2)%y - 4.0) > 1e-6) error stop class default error stop end select end subroutine subroutine test_sub2 type(container) :: x class(*), allocatable :: val(:) type :: point real :: x, y end type x = container([point(5.0, 6.0)]) call get_value(x, val) select type (val) type is (point) if (abs(val(1)%x - 5.0) > 1e-6) error stop if (abs(val(1)%y - 6.0) > 1e-6) error stop class default error stop end select end subroutine end program lfortran-0.63.0/integration_tests/select_rank_06.f900000664000175000017500000000114715174404631022507 0ustar alastairalastairprogram select_rank_06 implicit none integer :: a(2) = [4, 2] integer :: b(2, 3) = reshape([1, 2, 3, 4, 5, 6], [2, 3]) call check(a) call check(b) contains subroutine check(x) integer, intent(in) :: x(..) integer :: l1(1) integer :: l2(2) integer :: c(2, 1) integer :: d(3, 2) select rank(x) rank (1) print *, x(1) if (x(1) /= 4) error stop rank (2) print *, x(1, 2) if (x(1, 2) /= 3) error stop end select end subroutine check end program select_rank_06lfortran-0.63.0/integration_tests/operator_overloading_35_mod.f900000664000175000017500000000166515174404631025307 0ustar alastairalastairmodule operator_overloading_35_types implicit none type :: vec_t real :: x contains procedure :: sub_vec procedure :: neg_vec generic :: operator(-) => sub_vec, neg_vec end type interface operator(-) module procedure scalar_sub_vec end interface contains function sub_vec(a, b) result(c) class(vec_t), intent(in) :: a, b type(vec_t) :: c c%x = a%x - b%x end function function neg_vec(a) result(c) class(vec_t), intent(in) :: a type(vec_t) :: c c%x = -a%x end function function scalar_sub_vec(s, b) result(c) real, intent(in) :: s type(vec_t), intent(in) :: b type(vec_t) :: c c%x = s - b%x end function end module module operator_overloading_35_reexport use operator_overloading_35_types, only: vec_t, operator(-) implicit none public :: vec_t, operator(-) end module lfortran-0.63.0/integration_tests/struct_type_06.f900000664000175000017500000000103115174404631022572 0ustar alastairalastairmodule stdlib_string_type_struct_type_06 contains elemental subroutine unused_dummy_argument(dummy) class(*), intent(in) :: dummy associate(dummy => dummy); end associate end subroutine unused_dummy_argument end module stdlib_string_type_struct_type_06 program struct_type_06 use stdlib_string_type_struct_type_06 implicit none call unused_dummy_argument(42) call unused_dummy_argument("Hello, World!") call unused_dummy_argument([1, 2, 3, 4, 5]) print *, "Program end!" end program lfortran-0.63.0/integration_tests/common_18.f900000664000175000017500000000137115174404631021507 0ustar alastairalastair! Test: COMMON block with reordered members ! This tests storage association with different member orderings ! Main: real(8), int, int vs Subroutine: int, int, real(8) program common_18 implicit none real(8) :: r8 integer :: i1, i2 common /data/ r8, i1, i2 r8 = 3.14159d0 i1 = 42 i2 = 99 call sub_reordered() print *, "PASS: common_18" end program subroutine sub_reordered() implicit none integer :: j1, j2 real(8) :: s8 common /data/ j1, j2, s8 ! j1 overlaps first 4 bytes of r8, j2 overlaps second 4 bytes of r8 ! s8 overlaps i1 and i2 (reinterpreted as real(8)) ! Just verify we can access without crashing - values will be reinterpreted j1 = 1 j2 = 2 s8 = 1.0d0 end subroutine lfortran-0.63.0/integration_tests/derived_types_01.f900000664000175000017500000000132515174404631023054 0ustar alastairalastairmodule derived_types_01_m_01 implicit none type :: X real :: r integer :: i end type type :: Y complex :: c type(X) :: d end type contains subroutine set(a) type(X), intent(out) :: a a%i = 1 a%r = 1.5 end subroutine end module module derived_types_01_m_02 use derived_types_01_m_01, only: Y implicit none type :: Z complex :: k type(Y) :: l end type end module program derived_types_01 use derived_types_01_m_02, only: Z use derived_types_01_m_01, only: X, set implicit none type(X) :: b type(Z) :: c b%i = 5 b%r = 3.5 print *, b%i, b%r call set(b) print *, b%i, b%r c%l%d%r = 2.0 c%l%d%i = 2 c%k = (2.0, 2.0) print *, c%l%d%r, c%l%d%i, c%k call set(c%l%d) print *, c%l%d%r, c%l%d%i, c%k end lfortran-0.63.0/integration_tests/set_exponent_01.f900000664000175000017500000000040515174404631022717 0ustar alastairalastairprogram set_exponent_01 implicit none real :: x = 178.1387e-4 integer :: i = 17 real :: r1, r2 r1 = set_exponent(x, i) r2 = fraction(x) * radix(x)**i if (abs(r1 - r2) > 1.0e-3) error stop if (abs(r1 - 74716.7891) > 1.0) error stop end program lfortran-0.63.0/integration_tests/openmp_11.f900000664000175000017500000000113615174404631021505 0ustar alastairalastairsubroutine increment_ctr(n, ctr) use omp_lib implicit none integer, intent(in) :: n complex, intent(inout) :: ctr complex :: local_ctr integer :: i local_ctr = (0,0) !$omp parallel private(i) reduction(+:local_ctr) !$omp do do i = 1, n local_ctr = local_ctr + i end do !$omp end do !$omp end parallel ctr = ctr + local_ctr end subroutine program openmp_06 use omp_lib integer, parameter :: n = 1000 complex :: ctr complex :: res = (0,0) res = ((n * (n+1))/2) ! Sum from 1 -> 1000 call omp_set_num_threads(8) ctr = (0,0) call increment_ctr(n, ctr) print *, ctr if(ctr /= res) error stop end programlfortran-0.63.0/integration_tests/modules_15c.h0000664000175000017500000000421315174404631021656 0ustar alastairalastair#ifndef MODULES_15C #define MODULES_15C #include #include #if _WIN32 typedef _Fcomplex float_complex_t; typedef _Dcomplex double_complex_t; #else typedef float _Complex float_complex_t; typedef double _Complex double_complex_t; #endif int f_int_float(int *a, float *b); int f_int_double(int *a, double *b); int f_int_float_complex(int *a, float_complex_t *b); int f_int_double_complex(int *a, double_complex_t *b); int f_int_float_complex_value(int a, float_complex_t b); int f_int_double_complex_value(int a, double_complex_t b); float_complex_t f_float_complex_value_return(float_complex_t b); double_complex_t f_double_complex_value_return(double_complex_t b); int f_int_float_value(int a, float b); int f_int_double_value(int a, double b); int f_int_intarray(int n, int *b); float f_int_floatarray(int n, float *b); double f_int_doublearray(int n, double *b); float f_int_floatarray_star(int n, float *b); void sub_int_float(int *a, float *b, int *r); void sub_int_double(int *a, double *b, int *r); void sub_int_float_complex(int *a, float_complex_t *b, int *r); void sub_int_double_complex(int *a, double_complex_t *b, int *r); void sub_int_float_value(int a, float b, int *r); void sub_int_double_value(int a, double b, int *r); void sub_int_float_complex_value(int a, float_complex_t b, int *r); void sub_int_double_complex_value(int a, double_complex_t b, int *r); void sub_int_intarray(int n, int *b, int *r); void sub_int_floatarray(int n, float *b, float *r); void sub_int_doublearray(int n, double *b, double *r); int f_string(char *s); int32_t call_fortran_i32(int32_t i); int32_t call_fortran_i32_value(int32_t i); int64_t call_fortran_i64(int64_t i); int64_t call_fortran_i64_value(int64_t i); float call_fortran_f32(float i); float call_fortran_f32_value(float i); double call_fortran_f64(double i); double call_fortran_f64_value(double i); int32_t fortran_i32(int32_t *i); int32_t fortran_i32_value(int32_t i); int64_t fortran_i64(int64_t *i); int64_t fortran_i64_value(int64_t i); float fortran_f32(float *i); float fortran_f32_value(float i); double fortran_f64(double *i); double fortran_f64_value(double i); #endif // MODULES_15C lfortran-0.63.0/integration_tests/submodule_44a.f900000664000175000017500000000050515174404631022354 0ustar alastairalastairprogram submodule_44 ! Test: renaming a re-exported generic interface to match ! one of its specific submodule procedure names. use submodule_44_reexport, only: mytype, create2 => create implicit none type(mytype) :: t t = create2(1, 2) if (t%x /= 3) error stop print *, "ok" end program submodule_44 lfortran-0.63.0/integration_tests/interface_19.f900000664000175000017500000000257115174404631022163 0ustar alastairalastairmodule interface_19_mod implicit none abstract interface function FUNC_WITH_ARGS(x, args) result(f) implicit none real, intent(in) :: x real, intent(in) :: args(:) real :: f end function FUNC_WITH_ARGS end interface contains ! an implementation of the abstract interface 'FUNC_WITH_ARGS' function g0(x, args) result(f) implicit none real, intent(in) :: x real, intent(in) :: args(:) real :: f f = args(1)*x**2 + args(2)*x + args(3) end function g0 function interval_max(fun, args, grid_size) result(x) implicit none procedure(FUNC_WITH_ARGS) :: fun real, intent(in) :: args(:) integer, intent(in) :: grid_size real :: x real :: k integer :: i real :: fgrid(grid_size) do i = 1, grid_size k = real(i) / grid_size !> function call with procedure variable fgrid(i) = fun(k, args) end do x = maxval(fgrid) end function interval_max end module interface_19_mod program interface_19 use interface_19_mod implicit none real :: res real :: args_i(3) = [1.0, -2.0, 1.0] integer, parameter :: grid_size_i = 10 res = interval_max(g0, args_i, grid_size_i) print *, res if (abs(res - 0.81_4) > 1.0e-13) error stop end program lfortran-0.63.0/integration_tests/nested_vars_03.f900000664000175000017500000000430715174404631022530 0ustar alastairalastairmodule nested_vars_03_mod implicit none type :: linop_type procedure(vector_sub), nopass, pointer :: matvec => null() end type abstract interface subroutine vector_sub(x, y, alpha, beta, op) real, intent(in) :: x(:) real, intent(inout) :: y(:) real, intent(in) :: alpha real, intent(in) :: beta character(1), intent(in) :: op end subroutine vector_sub end interface contains subroutine call_matvec(obj, x, y, alpha, beta, op) type(linop_type), intent(in) :: obj real, intent(in) :: x(:) real, intent(inout) :: y(:) real, intent(in) :: alpha real, intent(in) :: beta character(1), intent(in) :: op call obj%matvec(x, y, alpha, beta, op) end subroutine call_matvec subroutine run_repro() call case_dispatch_via_non_nested_arg() end subroutine run_repro subroutine case_dispatch_via_non_nested_arg() type(linop_type) :: a real :: x(2), y(2) logical, target :: di(2) logical, pointer :: di_(:) x = [10.0, 20.0] y = [30.0, 40.0] di = [.false., .true.] di_ => di a%matvec => matvec call call_matvec(a, x, y, 1.0, 0.0, 'N') if (abs(y(1) - 30.0) > 1e-6) error stop "nested_vars_03 case2: y(1) mismatch" if (abs(y(2) - 0.0) > 1e-6) error stop "nested_vars_03 case2: y(2) mismatch" contains subroutine matvec(x, y, alpha, beta, op) real, intent(in) :: x(:) real, intent(inout) :: y(:) real, intent(in) :: alpha real, intent(in) :: beta character(1), intent(in) :: op if (abs(alpha - 1.0) > 1e-6) error stop "nested_vars_03 case2: alpha mismatch" if (abs(beta - 0.0) > 1e-6) error stop "nested_vars_03 case2: beta mismatch" if (op /= 'N') error stop "nested_vars_03 case2: op mismatch" y = merge(0.0, y, di_) end subroutine matvec end subroutine case_dispatch_via_non_nested_arg end module nested_vars_03_mod program nested_vars_03 use nested_vars_03_mod implicit none call run_repro() end program nested_vars_03 lfortran-0.63.0/integration_tests/implicit_typing_04.f900000664000175000017500000000050515174404631023414 0ustar alastairalastairsubroutine outer(x) implicit real(kind=8) (a-h,o-z), integer(kind=4) (i-n) contains function inner() implicit real(kind=8) (a-h,o-z), integer(kind=4) (i-n) inner = 1 end function inner end subroutine outer program implicit_typing_04 implicit none real(8) :: x call outer(x) end program lfortran-0.63.0/integration_tests/case_04.f900000664000175000017500000000025315174404631021123 0ustar alastairalastairprogram case_04 implicit none integer :: i i = 4 select case(i) case (1) print *, "1" case (2,3:5,6,8:10) print *, "2,3:5,6,8:10" end select end lfortran-0.63.0/integration_tests/class_70.f900000664000175000017500000000073115174404631021321 0ustar alastairalastairprogram class_70 type :: temp_type integer :: x end type class(*), allocatable :: a, b, c allocate(a, source=temp_type(3)) allocate(b, source=temp_type(5)) ! c = b !! Handle allocation in `check_and_allocate_scalar` in llvm ! select type (c) ! type is (temp_type) ! if (c%x /= 5) error stop ! end select b = a select type (b) type is (temp_type) if (b%x /= 3) error stop end select end programlfortran-0.63.0/integration_tests/custom_operator_09.f900000664000175000017500000000157715174404631023454 0ustar alastairalastairmodule custom_operator_09_mod implicit none type string_t character(:), allocatable :: value contains procedure, private, pass(rhs) :: character_cat_string_t generic :: operator(//) => character_cat_string_t end type string_t contains elemental function character_cat_string_t(lhs, rhs) result(lhs_cat_rhs) character(len=*), intent(in) :: lhs class(string_t), intent(in) :: rhs type(string_t) :: lhs_cat_rhs lhs_cat_rhs % value = lhs // rhs % value end function character_cat_string_t end module custom_operator_09_mod program custom_operator_09 use custom_operator_09_mod implicit none type(string_t) :: name_obj, greeting_obj character(len=10) :: prefix name_obj%value = "world!" prefix = "hello, " greeting_obj = prefix // name_obj if (greeting_obj%value /= "hello, world!") error stop end program custom_operator_09 lfortran-0.63.0/integration_tests/allocate_53.f900000664000175000017500000000110515174404631021775 0ustar alastairalastairmodule allocate_53_mod implicit none type :: list_item character(:), allocatable :: key end type contains function copy_item(item) result(copy) type(list_item), intent(in) :: item type(list_item), pointer :: copy allocate(copy, source=item) end function end module program allocate_53 use allocate_53_mod implicit none type(list_item), pointer :: original, copy allocate(original) original%key = "hello" copy => copy_item(original) deallocate(original) if (copy%key /= "hello") error stop deallocate(copy) print *, "PASS" end program lfortran-0.63.0/integration_tests/arrays_op_2.f900000664000175000017500000000222015174404631022121 0ustar alastairalastairprogram array_op_2d implicit none integer :: a(2, 2, 1), b(2, 2, 1), c(2, 2, 1) integer :: i, j, k do i = 1, 2 do j = 1, 2 do k = 1, 1 a(i, j, k) = i*i b(i, j, k) = j*j end do end do end do i = 0 print *, a(1, 1, 1), a(1, 2, 1), a(2, 1, 1), a(2, 2, 1) print *, b(1, 1, 1), b(1, 2, 1), b(2, 1, 1), b(2, 2, 1) c = a + b print *, c(1, 1, 1), c(1, 2, 1), c(2, 1, 1), c(2, 2, 1) if( c(1, 1, 1) /= 2 ) error stop if( c(1, 2, 1) /= 5 ) error stop if( c(2, 1, 1) /= 5 ) error stop if( c(2, 2, 1) /= 8 ) error stop c = a - b print *, c(1, 1, 1), c(1, 2, 1), c(2, 1, 1), c(2, 2, 1) if( c(1, 1, 1) /= 0 ) error stop if( c(1, 2, 1) /= -3 ) error stop if( c(2, 1, 1) /= 3 ) error stop if( c(2, 2, 1) /= 0 ) error stop c = a*b print *, c(1, 1, 1), c(1, 2, 1), c(2, 1, 1), c(2, 2, 1) if( c(1, 1, 1) /= 1 ) error stop if( c(1, 2, 1) /= 4 ) error stop if( c(2, 1, 1) /= 4 ) error stop if( c(2, 2, 1) /= 16 ) error stop c = b/a print *, c(1, 1, 1), c(1, 2, 1), c(2, 1, 1), c(2, 2, 1) if( c(1, 1, 1) /= 1 ) error stop if( c(1, 2, 1) /= 4 ) error stop if( c(2, 1, 1) /= 0 ) error stop if( c(2, 2, 1) /= 1 ) error stop end program lfortran-0.63.0/integration_tests/do_loop_01.f900000664000175000017500000000026115174404631021637 0ustar alastairalastairprogram main implicit none integer :: j j = 0 do j = j + 1 if (j > 10) exit print *, j end do print *, "out of loop" end program lfortran-0.63.0/integration_tests/derived_types_75.f900000664000175000017500000000220415174404631023064 0ustar alastairalastairmodule installer_mod_derived_types_75 implicit none type :: installer_t integer :: install_version contains procedure :: install_header procedure :: install end type installer_t type :: error_t end type contains subroutine install_header(self, error) class(installer_t), intent(inout) :: self type(error_t), allocatable, intent(out) :: error if (.true.) then call self%install() end if call self%install() end subroutine install_header subroutine install(self) class(installer_t), intent(inout) :: self self%install_version = self%install_version + 927 end subroutine install end module installer_mod_derived_types_75 program derived_types_75 use installer_mod_derived_types_75 implicit none type(installer_t) :: installer type(error_t), allocatable :: error installer%install_version = 1 call installer%install_header(error) print *, "Installer version after installation: ", installer%install_version if (installer%install_version /= 1855) error stop end program derived_types_75lfortran-0.63.0/integration_tests/bindc_47.f900000664000175000017500000000103415174404631021274 0ustar alastairalastairmodule bindc_47_mod use iso_c_binding, only: c_int, c_double implicit none integer(kind=c_int), bind(c), target :: counter real(kind=c_double), bind(c, name="pi_value"), target :: pi_val end module program bindc_47 use bindc_47_mod implicit none interface subroutine check_counter() bind(c) end subroutine subroutine check_pi() bind(c) end subroutine end interface counter = 42 pi_val = 3.14d0 call check_counter() call check_pi() print *, "All bind(c) module variable checks passed." end program lfortran-0.63.0/integration_tests/where_15.f900000664000175000017500000000106015174404631021321 0ustar alastairalastairprogram where_15 implicit none real(4), allocatable :: x0(:) real(4), allocatable :: xl(:) real(4), allocatable :: xu(:) real(4) :: rhobeg integer :: i rhobeg = 0.5 allocate(x0(5), xl(5), xu(5)) xl = 0.5 xu = 3.0 do i = lbound(x0, 1), ubound(x0, 1) x0 = i end do where (x0 <= xl + 0.5 * rhobeg) x0 = xl elsewhere(x0 < xl + rhobeg) x0 = xl + rhobeg end where where (x0 >= xu - 0.5 * rhobeg) x0 = xu elsewhere(x0 > xu - rhobeg) x0 = xu - rhobeg end where print *, x0 if( any(x0 /= [3.0, 3.0, 3.0, 3.0, 3.0]) ) error stop end program lfortran-0.63.0/integration_tests/intrinsics_442.f900000664000175000017500000000051015174404631022457 0ustar alastairalastairprogram intrinsics_442 implicit none integer, parameter :: ascii = selected_char_kind("ascii") character(kind=ascii, len=26) :: s if (ascii /= 1) error stop s = ascii_"abcdefghijklmnopqrstuvwxyz" if (s /= "abcdefghijklmnopqrstuvwxyz") error stop if (len(s) /= 26) error stop print *, ascii print *, s end program intrinsics_442 lfortran-0.63.0/integration_tests/template_struct_01.f900000664000175000017500000000261515174404631023430 0ustar alastairalastairmodule template_struct_01_m implicit none private public :: struct_t, test_template requirement r(t) type, deferred :: t end requirement template struct_t(t) require :: r(t) private public :: tuple type :: tuple type(t) :: fst type(t) :: snd end type contains function get_fst(p) result(r) type(tuple), intent(in) :: p type(t) :: r r = p%fst end function function get_snd(p) result(r) type(tuple), intent(in) :: p type(t) :: r r = p%snd end function end template contains subroutine test_template() instantiate struct_t(integer), & only: int_tuple => tuple, get_int_fst => get_fst, & get_int_snd => get_snd instantiate struct_t(real), & only: real_tuple => tuple, get_real_fst => get_fst, & get_real_snd => get_snd type(int_tuple) :: ti ti%fst = 1 print *, "First element: ", get_int_fst(ti) ti%snd = 2 print *, "Second element: ", get_int_snd(ti) type(real_tuple) :: tr tr%fst = 1. print *, "First element: ", get_real_fst(tr) tr%snd = 2. print *, "Second element: ", get_real_snd(tr) end subroutine end module program template_struct_01 use template_struct_01_m implicit none call test_template() end program template_struct_01lfortran-0.63.0/integration_tests/arrays_intrin_09.f900000664000175000017500000000034015174404631023076 0ustar alastairalastairprogram arrays_intrin_09 implicit none real :: x(10, 10) x = 6.0 if (count(abs(x - 6.0) > 1e-6) /= 0) error stop if (any(abs(x - 6.0) > 1e-6)) error stop print *, "ok" end program arrays_intrin_09 lfortran-0.63.0/integration_tests/include_01.f900000664000175000017500000000015215174404631021626 0ustar alastairalastairinclude 'include_01/a.f90' program include_01 call a() print *, "From Main" end program include_01 lfortran-0.63.0/integration_tests/equivalence_16.f900000664000175000017500000000126715174404631022522 0ustar alastairalastairprogram equivalence_16 ! Test EQUIVALENCE with -fdefault-integer-8 (ILP64 mode) ! Verifies descriptor fields use correct index type width implicit none integer :: iwork(10) double precision :: rwork(5) equivalence (iwork(1), rwork(1)) rwork(1) = 42.0d0 ! With ILP64, integer is 8 bytes, same as double precision. ! iwork(1) overlaps rwork(1) exactly, so reinterpreting the ! bit pattern of 42.0d0 as integer(8) must give 4631107791820423168. if (iwork(1) /= transfer(42.0d0, iwork(1))) error stop ! Write through integer view and verify via real view iwork(1) = transfer(99.0d0, iwork(1)) if (rwork(1) /= 99.0d0) error stop end program lfortran-0.63.0/integration_tests/openmp_12.f900000664000175000017500000000150015174404631021501 0ustar alastairalastairsubroutine initialize_array(n, b) use omp_lib implicit none integer, intent(in) :: n real, dimension(n), intent(out) :: b integer :: i !$omp parallel shared(b) private(i) !$omp do do i = 1, n b(i) = 12.91 end do !$omp end do !$omp end parallel print *, b(1), b(n) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end subroutine program openmp_12 use omp_lib integer, parameter :: n = 100000 real, dimension(n) :: a print *, a(2) call omp_set_num_threads(4) call initialize_array(n, a) print *, a(1), a(n), a(12), a(12841) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(n) - 12.91) > 1e-8) error stop if (abs(a(12) - 12.91) > 1e-8) error stop if (abs(a(12841) - 12.91) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/string_96.f900000664000175000017500000000047715174404631021541 0ustar alastairalastairprogram string_96 character(len=:), allocatable :: long_short(:) integer :: isize isize = 3 allocate(character(len=10) :: long_short(3)) long_short(1) = "first" long_short(2) = "second" long_short(3) = "third" long_short=long_short(:isize-1) print *, long_short end program string_96lfortran-0.63.0/integration_tests/print_09.f900000664000175000017500000000042215174404631021347 0ustar alastairalastairprogram print_09 implicit none integer, parameter :: dp = kind(0.d0) print *, 0.14, 123.456, 0.001, 1.5e-5 print *, 0.14_dp, 456.789_dp, 0.0001_dp write(*,*) 0.14, 123.456, 0.001, 1.5e-5 write(*,*) 0.14_dp, 456.789_dp, 0.0001_dp end program print_09 lfortran-0.63.0/integration_tests/format_81.f900000664000175000017500000000072115174404631021505 0ustar alastairalastairprogram format_81 implicit none character(10) :: s ! Integer overflow: i5.5 requires 5 digits + sign = 6 chars, exceeds width 5 write (s, '(s,i5.5)') -12 if (s /= '*****') error stop ! Iw.0 with value 0 must produce all blanks (Fortran standard 13.7.2.1) write (s, '(i5.0)') 0 if (s /= ' ') error stop write (s, '(s,i5.0)') 0 if (s /= ' ') error stop write (s, '(sp,i5.0)') 0 if (s /= ' ') error stop end program format_81 lfortran-0.63.0/integration_tests/array_section_23.f900000664000175000017500000000461515174404631023061 0ustar alastairalastairprogram array_section_23 ! Test array sections mixing vector subscripts with triplet subscripts. ! Covers rank-2 and rank-3 arrays with non-unit and negative strides. implicit none integer :: v2(-2:2, 3:7) integer :: v3(-1:2, 4:6, 10:13) integer :: i, j, k ! Initialize v2 do j = 3, 7 do i = -2, 2 v2(i,j) = 100*i + j end do end do ! Initialize v3 do k = 10, 13 do j = 4, 6 do i = -1, 2 v3(i,j,k) = 10000*i + 100*j + k end do end do end do call test_rank2() call test_rank3() contains subroutine test_rank2() integer :: r2(3,3) ! vector subscript on dim1, ascending triplet with stride 2 on dim2 r2 = v2([0,0,-2], 3:7:2) ! Expected columns: v2([0,0,-2], 3), v2([0,0,-2], 5), v2([0,0,-2], 7) if (r2(1,1) /= 3) error stop ! v2(0,3) if (r2(2,1) /= 3) error stop ! v2(0,3) if (r2(3,1) /= -197) error stop ! v2(-2,3) if (r2(1,2) /= 5) error stop ! v2(0,5) if (r2(2,2) /= 5) error stop ! v2(0,5) if (r2(3,2) /= -195) error stop ! v2(-2,5) if (r2(1,3) /= 7) error stop ! v2(0,7) if (r2(2,3) /= 7) error stop ! v2(0,7) if (r2(3,3) /= -193) error stop ! v2(-2,7) end subroutine subroutine test_rank3() integer :: r3a(2,3,3), r3b(3,3,2) integer, parameter :: lb33 = 10, ub33 = 13 ! triplet with stride 2 on dim1, full range on dim2, vector on dim3 r3a = v3(-1:2:2, :, [13,10,12]) ! dim1 indices: [-1, 1], dim2: [4,5,6], dim3: [13,10,12] if (r3a(1,1,1) /= v3(-1,4,13)) error stop ! -10000+400+13 = -9587 if (r3a(2,1,1) /= v3( 1,4,13)) error stop ! 10000+400+13 = 10413 if (r3a(1,2,2) /= v3(-1,5,10)) error stop ! -10000+500+10 = -9490 if (r3a(2,3,3) /= v3( 1,6,12)) error stop ! 10000+600+12 = 10612 ! vector on dim1, descending triplet on dim2, descending triplet on dim3 r3b = v3([2,-1,1], 6:4:-1, ub33:lb33:-2) ! dim1: [2,-1,1], dim2: [6,5,4], dim3: [13,11] if (r3b(1,1,1) /= v3( 2,6,13)) error stop ! 20000+600+13 = 20613 if (r3b(2,1,1) /= v3(-1,6,13)) error stop ! -10000+600+13 = -9387 if (r3b(3,1,1) /= v3( 1,6,13)) error stop ! 10000+600+13 = 10613 if (r3b(1,2,1) /= v3( 2,5,13)) error stop ! 20000+500+13 = 20513 if (r3b(1,3,1) /= v3( 2,4,13)) error stop ! 20000+400+13 = 20413 if (r3b(1,1,2) /= v3( 2,6,11)) error stop ! 20000+600+11 = 20611 if (r3b(3,3,2) /= v3( 1,4,11)) error stop ! 10000+400+11 = 10411 print *, "PASS" end subroutine end program lfortran-0.63.0/integration_tests/string_45.f900000664000175000017500000000072115174404631021523 0ustar alastairalastairprogram string_45 character(len=5), parameter :: color = "hello" integer(1) :: i = 1 integer(2) :: j = 2 integer(4) :: k = 3 integer(8) :: l = 4 print *, color(i:i) if (color(i:i) /= "h") error stop print *, color(j:j) if (color(j:j) /= "e") error stop print *, color(k:k) if (color(k:k) /= "l") error stop print *, color(l:l) if (color(l:l) /= "l") error stop print *, color(5:5) end program string_45lfortran-0.63.0/integration_tests/intrinsics_376.f900000664000175000017500000000110115174404631022462 0ustar alastairalastairmodule stdlib_logger_intrinsics_376 implicit none contains subroutine add_log_unit(stat ) integer, intent(out), optional :: stat call validate_unit() contains subroutine validate_unit() if ( present(stat) ) then stat = 5 end if end subroutine validate_unit end subroutine add_log_unit end module program intrinsics_376 use stdlib_logger_intrinsics_376 implicit none integer :: stat call add_log_unit(stat) print *, stat if (stat /= 5) error stop end program lfortran-0.63.0/integration_tests/intrinsics_372.f900000664000175000017500000000041215174404631022462 0ustar alastairalastairprogram intrinsics_372 real, allocatable :: a(:), b(:) complex :: c(2) allocate(a(2)) allocate(b(2)) a = 1 b = 2 c = cmplx(a,b) print *, c if (c(1) /= (1.0, 2.0)) error stop if (c(2) /= (1.0, 2.0)) error stop end programlfortran-0.63.0/integration_tests/doloop_02.f900000664000175000017500000000074115174404631021504 0ustar alastairalastairprogram doloop_02 implicit none integer :: i, j, a, b j = 0 a = 1 b = 10 do i = a, b j = j + i end do if (j /= 55) error stop print *, j a = 0 do i = 1, 10 do j = 1, 10 a = a + (i-1)*10+j end do end do if (a /= 100*101/2) error stop print *, a a = 0 do i = 1, 10 do j = 1, i a = a + j end do end do if (a /= 220) error stop print *, a end lfortran-0.63.0/integration_tests/separate_compilation_37b.f900000664000175000017500000000067215174404631024567 0ustar alastairalastairmodule separate_compilation_37b use separate_compilation_37a, only: AbsType1 implicit none type, abstract :: AbsType2 end type AbsType2 contains function get_obj() result(obj) class(AbsType2), allocatable :: obj class(AbsType1), allocatable :: c select type( o => c%method('String') ) class is (AbsType2) obj = o end select end function get_obj end module separate_compilation_37b lfortran-0.63.0/integration_tests/write_19_module.f900000664000175000017500000000143215174404631022715 0ustar alastairalastairmodule write_19_mod implicit none type :: t integer :: x = 42 contains procedure, private :: write_t generic :: write(formatted) => write_t end type t contains subroutine write_t(self, unit, iotype, v_list, iostat, iomsg) class(t), intent(in) :: self integer, intent(in) :: unit character(*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(*), intent(inout) :: iomsg if (iotype /= 'DT') error stop if (self%x /= 42) error stop iostat = 0 end subroutine end module module write_19_io use write_19_mod, only: t implicit none contains subroutine print_it(obj) class(t), intent(in) :: obj write(*,'(dt)') obj end subroutine end module lfortran-0.63.0/integration_tests/intrinsics_127.f900000664000175000017500000000116315174404631022464 0ustar alastairalastairprogram intrinsics_127 implicit none integer, parameter :: x1 = ifix(4.23) integer, parameter :: y1 = ifix(123.41) integer, parameter :: ar1(3) = ifix([1.0, 2.11, -31.0]) real :: arr1(3) = [1.0, 2.11, -31.0] real :: x x = 4.23 print *, x1 if (x1 /= 4) error stop print *, y1 if (y1 /= 123) error stop print *, ar1 if (any(ar1 /= [1, 2, -31])) error stop print *, ifix(arr1) if (any(ifix(arr1) /= [1, 2, -31])) error stop print *, ifix(x) if( .not. ifix(x) == 4 ) error stop print *, ifix(4.23) if (ifix(123.41) /= 123 ) error stop end program lfortran-0.63.0/integration_tests/arrays_01_logical.f900000664000175000017500000000161315174404631023201 0ustar alastairalastairprogram arrays_01_logical implicit none integer :: i, j logical :: a(3), b(4), c(2, 2) a(1) = .true. do i = 2, 3 a(i) = .not. a(i - 1) end do if (.not. a(1)) error stop if (a(2)) error stop if (.not. a(3)) error stop b(1) = .false. do i = 12, 14 b(i-10) = .not. b(i - 10 - 1) end do if (b(1)) error stop if (.not. b(2)) error stop if (b(3)) error stop if (.not. b(4)) error stop do i = 1, 3 b(i) = a(i) .and. .false. end do if (b(1)) error stop if (b(2)) error stop if (b(3)) error stop b(4) = b(1) .or. b(2) .or. b(3) .or. a(1) if (.not. b(4)) error stop b(4) = a(1) if (.not. b(4)) error stop do i = 1, 2 do j = 1, 2 if (((i + j) - 2*((i + j)/2)) == 1) then c(i, j) = .true. else c(i, j) = .false. end if end do end do if (c(1, 1)) error stop if (.not. c(1, 2)) error stop if (.not. c(2, 1)) error stop if (c(2, 2)) error stop end lfortran-0.63.0/integration_tests/implied_do_loops27.f900000664000175000017500000000067215174404631023404 0ustar alastairalastairprogram implied_do_loops27 implicit none call test_test2() contains subroutine test_test2 character(len=20) :: tmp_line(3) character(len=20000) :: buf integer :: iii, ii tmp_line = "Hello" ii = 3 write(buf, '(*(g0))') (trim(tmp_line(iii)), iii=1, ii) if (len_trim(buf) == 0) error stop if (trim(buf) /= "HelloHelloHello") error stop end subroutine end program lfortran-0.63.0/integration_tests/modules_30_module4.f900000664000175000017500000000052115174404631023306 0ustar alastairalastairmodule fpm_manifest_package_modules_30 use fpm_manifest_executable_modules_30, only: executable_config implicit none type :: package_config_t character(len=:), allocatable :: name type(executable_config), allocatable :: executable(:) end type package_config_t end module fpm_manifest_package_modules_30 lfortran-0.63.0/integration_tests/kinds_03.f900000664000175000017500000000054215174404631021320 0ustar alastairalastairprogram kinds_03 call realkinds() contains subroutine realkinds() integer, parameter :: rkarray(6) = [1, 2, 4, 8, 16, 16] logical :: mask(5) mask = rkarray(1:5) == rkarray(2:6) if (count(mask) /= 1) error stop if (.not. mask(5)) error stop print *, mask end subroutine end program kinds_03 lfortran-0.63.0/integration_tests/intrinsics_39.f900000664000175000017500000000111415174404631022402 0ustar alastairalastairprogram test_time_and_date character(len=8) :: date character(len=10) :: time character(len=5) :: zone integer,dimension(8) :: values ! using keyword arguments call date_and_time(date, time, zone, values) call date_and_time() call date_and_time(date=date, zone=zone) call date_and_time(time=time) call date_and_time(zone = zone) call date_and_time(zone = zone, time = time, values = values, date = date) call date_and_time(values=values) print '(a,2x,a,2x,a)', date, time, zone print '(8i5)', values end program test_time_and_datelfortran-0.63.0/integration_tests/namelist_28.f900000664000175000017500000000335415174404631022037 0ustar alastairalastairprogram namelist_28 ! Test for handling null values with comma separators implicit none character(len=15), allocatable :: name(:) integer :: count namelist /expected/ name, count character(len=256) :: readme(4) integer :: i ! Test null value for array with comma separator before next variable allocate(name(10)) name = [(repeat(' ', len(name)), i=1, size(name))] count = 0 readme(1) = '&EXPECTED' readme(2) = ' NAME=,' readme(3) = ' COUNT=42' readme(4) = ' /' read(readme, nml=expected) print *, 'Test 1: NAME should remain blank, COUNT should be 42' if (trim(name(1)) /= '') then error stop 'NAME should be blank (null value)' end if if (count /= 42) then error stop 'COUNT should be 42' end if ! Test null value at end with comma count = 0 readme(1) = '&EXPECTED' readme(2) = ' COUNT=99,' readme(3) = ' NAME=,' readme(4) = ' /' read(readme, nml=expected) print *, 'Test 2: COUNT should be 99, NAME should remain blank' if (count /= 99) then error stop 'COUNT should be 99' end if if (trim(name(1)) /= '') then error stop 'NAME should be blank (null value) in test 2' end if ! Test multiple values with commas count = 0 readme(1) = '&EXPECTED' readme(2) = ' COUNT=123, NAME="test"' readme(3) = ' /' readme(4) = ' ' read(readme, nml=expected) print *, 'Test 3: COUNT should be 123, NAME(1) should be "test"' if (count /= 123) then error stop 'COUNT should be 123 in test 3' end if if (trim(name(1)) /= 'test') then error stop 'NAME(1) should be "test" in test 3' end if print *, 'OK: All tests passed' end program namelist_28 lfortran-0.63.0/integration_tests/case_06.f900000664000175000017500000000332015174404631021123 0ustar alastairalastairprogram cond_03 implicit none integer :: a = 1, b = 2 integer, parameter :: ap = 1, bp = 2 real :: c = 1.0, d = 2.0 real, parameter :: cp = 1.0, dp = 2.0 integer :: marks integer, parameter :: marks_fixed = 94 ! local variable declaration character, parameter :: grade_fixed = 'B' select case (grade_fixed) case ('A') print*, "Excellent!" case ('B') if( a == b ) then print *, "a == b" if( ap == bp ) then print *, "ap == bp" else print *, "ap /= bp" end if else if( ap == cp ) then print *, "ap == cp" if( cp == dp ) then print *, "cp == dp" else print *, "cp /= dp" end if else if( c == d ) then print *, "c == d" end if case ('C') print*, "Well done" case ('D') print*, "You passed" case ('F') print*, "Better try again" case default print*, "Invalid grade" end select print*, "Your grade is ", grade_fixed marks = 94 select case (marks) case ((40 + bp):) print *, "Pass!" case (:(39 - ap)) print *, "Failed!" case default print*, "Invalid marks" end select print*, "Your marks are ", marks select case (marks_fixed) case ((40 + bp):) print *, "Pass!" case (0:(39 - ap)) print *, "Failed!" case default print*, "Invalid marks" end select print*, "Your marks are ", marks end lfortran-0.63.0/integration_tests/print_arr_03.f900000664000175000017500000000210115174404631022201 0ustar alastairalastairprogram main implicit none ! print *, [4, 9] ! print *, [[2, -2, 5, 7, [8, -9, [10]]], [3, 3], [-11]] call f() contains subroutine f() integer, allocatable :: a(:, :) real :: b(2, 2) integer :: i, j allocate(a(5, 10)) do i = lbound(a, 1), ubound(a, 1) do j = lbound(a, 2), ubound(a, 2) a(i, j) = i + j end do end do b(1, 1) = 1.1 b(1, 2) = -1.2 b(2, 1) = 2.1 b(2, 2) = -2.2 print *, [[1, a, 2, 3], a, 5, [abs(-2)]] print *, "hello", ["hey", ["xyz", ["abc"]]], [[1, a, 2, 3], a, 5, [abs(-2)]], "bye" print *, [ 2.1, [3.14, [-5.11, [abs(-21.22), [abs(21.22)]]]] ] print *, "Integer(2x2) ArrayConst", [[1, 2], [3, 4]], "Array End" print *, "Real(2x2) ArrayVar", b, "Array End" print *, "Real(2x2) ArrayConst", [[1.1, -1.2], [2.1, -2.2]], "Array End" print *, "Integer(2x2), Real(2x2), ArrayConst", [[1, 2], [3, 4]], [[1.1, -1.2], [2.1, -2.2]], "ArrayEnd" end subroutine end program lfortran-0.63.0/integration_tests/namelist_07.f900000664000175000017500000000463015174404631022032 0ustar alastairalastairprogram namelist_complex implicit none ! Define complex variables complex(4) :: c4_scalar complex(8) :: c8_scalar complex(4) :: c4_array(3) complex(8) :: c8_array(2) ! Define namelist namelist /complex_test/ c4_scalar, c8_scalar, c4_array, c8_array ! Initialize complex scalars c4_scalar = (1.5, -2.3) c8_scalar = (3.14159, 2.71828) ! Initialize complex arrays c4_array(1) = (1.0, 1.0) c4_array(2) = (2.0, -2.0) c4_array(3) = (3.0, 3.0) c8_array(1) = (10.5, -20.3) c8_array(2) = (-15.7, 30.2) ! Write namelist to file open(unit=10, file='namelist_complex.dat', status='replace', form='formatted') write(10, nml=complex_test) close(10) ! Reset all values to zero c4_scalar = (0.0, 0.0) c8_scalar = (0.0d0, 0.0d0) c4_array = (0.0, 0.0) c8_array = (0.0d0, 0.0d0) ! Read namelist from file open(unit=10, file='namelist_complex.dat', status='old', form='formatted') read(10, nml=complex_test) close(10) ! Verify complex scalars (with tolerance for floating point) if (abs(real(c4_scalar) - 1.5) > 1.0e-5) error stop "c4_scalar real part mismatch" if (abs(aimag(c4_scalar) - (-2.3)) > 1.0e-5) error stop "c4_scalar imag part mismatch" if (abs(real(c8_scalar) - 3.14159d0) > 1.0d-5) error stop "c8_scalar real part mismatch" if (abs(aimag(c8_scalar) - 2.71828d0) > 1.0d-5) error stop "c8_scalar imag part mismatch" ! Verify complex arrays if (abs(real(c4_array(1)) - 1.0) > 1.0e-5) error stop "c4_array(1) real mismatch" if (abs(aimag(c4_array(1)) - 1.0) > 1.0e-5) error stop "c4_array(1) imag mismatch" if (abs(real(c4_array(2)) - 2.0) > 1.0e-5) error stop "c4_array(2) real mismatch" if (abs(aimag(c4_array(2)) - (-2.0)) > 1.0e-5) error stop "c4_array(2) imag mismatch" if (abs(real(c4_array(3)) - 3.0) > 1.0e-5) error stop "c4_array(3) real mismatch" if (abs(aimag(c4_array(3)) - 3.0) > 1.0e-5) error stop "c4_array(3) imag mismatch" if (abs(real(c8_array(1)) - 10.5d0) > 1.0d-5) error stop "c8_array(1) real mismatch" if (abs(aimag(c8_array(1)) - (-20.3d0)) > 1.0d-5) error stop "c8_array(1) imag mismatch" if (abs(real(c8_array(2)) - (-15.7d0)) > 1.0d-5) error stop "c8_array(2) real mismatch" if (abs(aimag(c8_array(2)) - 30.2d0) > 1.0d-5) error stop "c8_array(2) imag mismatch" print *, "Complex number namelist test passed!" end program namelist_complex lfortran-0.63.0/integration_tests/intrinsics_446.f900000664000175000017500000000051415174404631022467 0ustar alastairalastairprogram intrinsics_446 implicit none integer, dimension(3, 2) :: result result = spread([1, 4, 5], 2, 2) if (result(1, 1) /= 1 .or. result(2, 1) /= 4 .or. result(3, 1) /= 5) error stop if (result(1, 2) /= 1 .or. result(2, 2) /= 4 .or. result(3, 2) /= 5) error stop print *, result end program intrinsics_446 lfortran-0.63.0/integration_tests/select_type_21.f900000664000175000017500000000077415174404631022537 0ustar alastairalastairprogram select_type_char_mre implicit none call print_any(" Hello World ") print *, "test passed" contains subroutine print_any(generic) class(*), intent(in) :: generic character(len=:), allocatable :: out select type (generic) type is (character(len=*)) out = trim(generic) class default stop 1 end select if (out /= " Hello World ") stop 2 end subroutine print_any end program select_type_char_mrelfortran-0.63.0/integration_tests/formatted_read_input_01.txt0000664000175000017500000000004015174404631024617 0ustar alastairalastairhello world shorty longerthanvarlfortran-0.63.0/integration_tests/arrays_59.f900000664000175000017500000000073715174404631021532 0ustar alastairalastairprogram arrays_59 real :: A(2,2) = reshape([1.0,2.0,3.0,4.0], [2,2]) call trans(A) print *, A if ( any(abs( A - 12.91 ) > 1e-6) ) error stop contains subroutine trans(A) real, intent(inout) :: A(:, :) real :: B(size(A,1), size(A,2)) B = A A = matprod(transpose(B)) end subroutine function matprod(x) result(k) real,intent(in) :: x(:,:) real :: k(size(x, 1), size(x, 2)) k = 12.91 end function end program lfortran-0.63.0/integration_tests/submodule_44b.f900000664000175000017500000000175415174404631022364 0ustar alastairalastairmodule submodule_44_mod implicit none type :: mytype integer :: x end type mytype interface create module function create1(a) result(res) integer, intent(in) :: a type(mytype) :: res end function create1 module function create2(a, b) result(res) integer, intent(in) :: a, b type(mytype) :: res end function create2 end interface create end module submodule_44_mod submodule(submodule_44_mod) submodule_44_sub implicit none contains module function create1(a) result(res) integer, intent(in) :: a type(mytype) :: res res%x = a end function create1 module function create2(a, b) result(res) integer, intent(in) :: a, b type(mytype) :: res res%x = a + b end function create2 end submodule submodule_44_sub module submodule_44_reexport use submodule_44_mod, only: mytype, create implicit none private public :: mytype, create end module submodule_44_reexport lfortran-0.63.0/integration_tests/intrinsics_357.f900000664000175000017500000000053615174404631022474 0ustar alastairalastairprogram intrinsics_357 implicit none integer :: m, n real :: A(3, 4) m = 3 n = 4 A = rand2(m, n) contains impure function rand2(m, n) result(x) implicit none integer, intent(in) :: m, n real :: x(max(m, 0), max(n, 0)) call random_number(harvest=x) end function rand2 end programlfortran-0.63.0/integration_tests/associate_33.f900000664000175000017500000000076315174404631022173 0ustar alastairalastairprogram associate_33 ! Test: associate with lbound/ubound without DIM (array result) implicit none real(8), allocatable :: a(:,:,:,:) allocate( a(-3:14,1,1,1) ) associate (lb => lbound(a), ub => ubound(a)) if (lb(1) /= -3) error stop if (lb(2) /= 1) error stop if (lb(3) /= 1) error stop if (lb(4) /= 1) error stop if (ub(1) /= 14) error stop if (ub(2) /= 1) error stop if (ub(3) /= 1) error stop if (ub(4) /= 1) error stop end associate end program associate_33 lfortran-0.63.0/integration_tests/expr_13.f900000664000175000017500000000207415174404631021171 0ustar alastairalastairprogram flip_sign_dead_code implicit none integer :: number real :: x, eps = 1e-6 integer :: a = 1, b = 2 integer, parameter :: ap = 1, bp = 2 real :: c = 1.0, d = 2.0 real, parameter :: cp = 1.0, dp = 2.0 number = 123 x = 5.5 if (modulo(number, 2) == 1 ) x = -x if (abs(x - (-5.5)) > eps) error stop number = 124 x = 5.5 if (modulo(number, 2) == 1 ) x = -x if (abs(x - (5.5)) > eps) error stop if( ap == bp ) then print *, "ap == bp" else print *, "ap /= bp" end if if( cp == dp ) then print *, "cp == dp" else print *, "cp /= dp" end if if( a == b ) then print *, "a == b" if( ap == bp ) then print *, "ap == bp" else print *, "ap /= bp" end if else if( ap == cp ) then print *, "ap == cp" if( cp == dp ) then print *, "cp == dp" else print *, "cp /= dp" end if else if( c == d ) then print *, "c == d" end if end program lfortran-0.63.0/integration_tests/arrays_reshape_20.f900000664000175000017500000000106715174404631023222 0ustar alastairalastairprogram arrays_reshape_20 integer, dimension(2, 3) :: x1 = reshape([1, 4, 2, 5, 3, 6], [2, 3]) integer, dimension(2, 3) :: x2 = reshape([1, 2, 3, 4, 0, 0], [2, 3]) integer, dimension(2, 3) :: x3 =reshape([1, 4, 2, 0, 3, 0], [2, 3]) print *, x1 print *, x2 print *, x3 if (any(x1 /= reshape([1, 2, 3, 4, 5, 6], [2, 3], order = [2, 1]))) error stop if (any(x2 /= reshape([1, 2, 3, 4], [2, 3], pad = [0]))) error stop if (any(x3 /= reshape([1, 2, 3, 4], [2, 3], order = [2, 1], pad = [0]))) error stop end program arrays_reshape_20 lfortran-0.63.0/integration_tests/enum_07_submodule.f900000664000175000017500000000026015174404631023234 0ustar alastairalastairsubmodule(enum_07_parent_mod) enum_07_sub_impl contains module subroutine do_work(x) integer, intent(inout) :: x x = x + 1 end subroutine end submodule lfortran-0.63.0/integration_tests/intrinsics_295.f900000664000175000017500000000656715174404631022507 0ustar alastairalastairprogram intrinsics_295 use iso_fortran_env, only: sp=>real32, dp=>real64 implicit none real(sp) :: x real(dp) :: y complex(sp) :: z complex(dp) :: w real(sp), parameter :: x1 = exp(1.5_sp) real(dp), parameter :: y1 = exp(1.5_dp) complex(sp), parameter :: x2 = exp((1.5_sp, 2.5_sp)) complex(dp), parameter :: y2 = exp((1.11_dp, 2.21_dp)) real(sp), parameter :: ar1(3) = exp([1.1_sp, 2.2_sp, 3.3_sp]) real(dp), parameter :: ar2(3) = exp([1.31_dp, 2.42_dp, 3.13_dp]) complex(sp), parameter :: ar3(3) = exp([(1.5_sp, 2.5_sp), (3.5_sp, 4.5_sp), (5.5_sp, 6.5_sp)]) complex(dp), parameter :: ar4(3) = exp([(1.5_dp, 2.5_dp), (3.5_dp, 4.5_dp), (5.5_dp, 6.5_dp)]) real(sp) :: arr1(3) = [1.1_sp, 2.2_sp, 3.3_sp] real(dp) :: arr2(3) = [1.31_dp, 2.42_dp, 3.13_dp] complex(sp) :: arr3(3) = [(1.1_sp, 2.2_sp), (3.3_sp, 4.4_sp), (5.5_sp, 6.6_sp)] complex(dp) :: arr4(3) = [(1.1_dp, 2.2_dp), (3.3_dp, 4.4_dp), (5.5_dp, 6.6_dp)] complex(sp) :: res1(3) complex(dp) :: res2(3) print *, x1 if (abs(x1 - 4.48168907_sp) > 1e-5) error stop print *, y1 if (abs(y1 - 4.481689070338064822e+00_dp) > 1e-10) error stop print *, x2 if (abs(x2 - (-3.59047651_sp, 2.682166_sp)) > 1e-5) error stop print *, y2 if (abs(y2 - (-1.81016628947939662e+00_dp, 2.4352882519970085_dp)) > 1e-10) error stop print *, ar1 if (any(ar1 - [3.00416613e+00_sp, 9.02501392e+00_sp, 2.71126385e+01_sp] > 1e-6)) error stop print *, ar2 if (any(ar2 - [3.70617371221019898e+00_dp, 1.12458593148818444e+01_dp, 2.28739795424408072e+01_dp] > 1e-10)) error stop print *, ar3 if (abs(ar3(1) - (-3.590477_sp,2.682166_sp)) > 1e-6) error stop if (abs(ar3(2) - (-6.980598_sp,-32.371353_sp)) > 1e-6) error stop if (abs(ar3(3) - (238.963120_sp,52.638126_sp) ) > 1e-6) error stop print *, ar4 if (abs(ar4(1) - (-3.5904765855678136_dp, 2.6821660671324890_dp)) > 1e-10) error stop if (abs(ar4(2) - (-6.9805981691441259_dp, -32.371351649713368_dp)) > 1e-10) error stop if (abs(ar4(3) - (238.96311316471733_dp, 52.638125553863652_dp) ) > 1e-10) error stop x = exp(1.5_sp) print *, x if (abs(x - 4.48168907_sp) > 1e-5) error stop y = exp(1.5_dp) print *, y if (abs(y - 4.481689070338064822_dp) > 1e-10) error stop z = exp((1.5_sp, 2.5_sp)) print *, z if (abs(z - ((-3.59047651_sp, 2.682166_sp))) > 1e-5) error stop w = exp((1.11_dp, 2.21_dp)) print *, w if (abs(w - (-1.8101662894793968_dp, 2.4352882519970085_dp)) > 1e-10) error stop print *, exp(arr1) if (any(exp(arr1) - [3.00416613e+00_sp, 9.02501392e+00_sp, 2.71126385e+01_sp] > 1e-6)) error stop print *, exp(arr2) if (any(exp(arr2) - [3.7061737122101990_dp, 11.245859314881844_dp, 22.873979542440807_dp] > 1e-10)) error stop res1 = exp(arr3) print *, res1 if (abs(res1(1) - (-1.767955_sp, 2.428857_sp)) > 1e-6) error stop if (abs(res1(2) - (-8.332603_sp, -25.800444_sp)) > 1e-6) error stop if (abs(res1(3) - (232.514252_sp, 76.231628_sp) ) > 1e-5) error stop res2 = exp(arr4) print *, res2 if (abs(res2(1) - (-1.7679550615130259_dp, 2.4288574268376881_dp)) > 1e-10) error stop if (abs(res2(2) - (-8.3326051321743808_dp, -25.800443425515649_dp)) > 1e-10) error stop if (abs(res2(3) - (232.51424902677110_dp, 76.231658218318316_dp) ) > 1e-10) error stop end program lfortran-0.63.0/integration_tests/string_54.f900000664000175000017500000000127215174404631021525 0ustar alastairalastairmodule string_54_mod interface double procedure :: double_ end interface contains pure function double_(x) result(ret) integer, intent(in) :: x integer :: ret ret = x*2 end function ! Test correct FunctionType + FunctionParam subroutine foo_sub(x, char) integer , intent(in) :: x character(double(x)) :: char ! if(len(char) /= 20) error stop ! >>>>>>>>>>>>>>>>>>>>>>>>>>> Uncomment after string is refactored(char should be of physicalType `DescriptorString`). end subroutine end module program string_54 use string_54_mod integer :: x character(10) :: char x = 10 call foo_sub(x, char) end program lfortran-0.63.0/integration_tests/do_loop_03.f900000664000175000017500000000031215174404631021636 0ustar alastairalastairprogram do_loop_03 integer :: n = 2, k do k = 2, n print *, k end do ! with --use-loop-variable-after-loop if (k /= 3) error stop print *, "k after = ", k end program lfortran-0.63.0/integration_tests/case_03.f900000664000175000017500000000127015174404631021122 0ustar alastairalastairprogram case03 implicit none ! local variable declaration integer :: marks integer, parameter :: a = 1, b = 2 marks = 94 select case (marks) case ((40 + b):) print *, "Pass!" case (:(39 - a)) print *, "Failed!" case default print*, "Invalid marks" end select print*, "Your marks are ", marks marks = -1 select case (marks) case ((40 + b):) print *, "Pass!" case (0:(39 - a)) print *, "Failed!" case default print*, "Invalid marks" end select print*, "Your marks are ", marks end program lfortran-0.63.0/integration_tests/c_ptr_03.f900000664000175000017500000000076715174404631021330 0ustar alastairalastairprogram c_ptr_03 use iso_c_binding, only: c_ptr, c_loc, c_int, c_f_pointer implicit none integer(c_int), target :: x, y type(c_ptr), dimension(2) :: c_requests integer(c_int), pointer :: px, py x = 10 y = 20 c_requests(1) = c_loc(x) c_requests(2) = c_loc(y) call c_f_pointer(c_requests(1), px) call c_f_pointer(c_requests(2), py) print *, "px: ", px if (px /= x) error stop print *, "py: ", py if (py /= y) error stop end program c_ptr_03 lfortran-0.63.0/integration_tests/common_20.f900000664000175000017500000000364715174404631021510 0ustar alastairalastair! Test: COMMON block bidirectional value sharing (F2018 8.10.3) ! Verifies that values written in one program unit are visible in others, ! and that modifications in subroutines are visible back in the main program. ! Also tests that different variable names can access the same storage. program common_20 implicit none integer :: a, b, c real :: x, y common/valblk/a, b, c, x, y ! Initialize all values a = 10 b = 20 c = 30 x = 1.5 y = 2.5 ! Verify values can be read in subroutine call sub_read_verify() ! Verify values modified in subroutine are visible here if (a /= 100) error stop "a should be 100 after sub_read_verify" if (b /= 200) error stop "b should be 200 after sub_read_verify" if (c /= 300) error stop "c should be 300 after sub_read_verify" ! Test with different variable names call sub_diff_names() if (a /= 111) error stop "a should be 111 after sub_diff_names" print *, "PASS: common_20" end program subroutine sub_read_verify() implicit none integer :: a, b, c real :: x, y common/valblk/a, b, c, x, y ! Verify we can read values set in main if (a /= 10) error stop "a should be 10" if (b /= 20) error stop "b should be 20" if (c /= 30) error stop "c should be 30" if (abs(x - 1.5) > 0.001) error stop "x should be 1.5" if (abs(y - 2.5) > 0.001) error stop "y should be 2.5" ! Modify values - should be visible in main a = 100 b = 200 c = 300 end subroutine subroutine sub_diff_names() implicit none ! Different variable names but same storage integer :: p, q, r real :: s, t common/valblk/p, q, r, s, t ! p, q, r should have values 100, 200, 300 from previous subroutine if (p /= 100) error stop "p should be 100" if (q /= 200) error stop "q should be 200" if (r /= 300) error stop "r should be 300" ! Modify first variable p = 111 end subroutine lfortran-0.63.0/integration_tests/separate_compilation_04a.f900000664000175000017500000000036615174404631024560 0ustar alastairalastairmodule separate_compilation_04a_module implicit none contains subroutine lu() end subroutine subroutine resol_lu(L) real, allocatable :: L(:,:) print *, sum(L) if ( abs(sum(L) - 2.08361094e+04 ) > 1e-8 ) error stop end subroutine end module lfortran-0.63.0/integration_tests/class_50.f900000664000175000017500000000176515174404631021327 0ustar alastairalastairmodule class_50_m_1 private type, public, abstract :: Addition contains procedure(addto), deferred :: addto end type Addition abstract interface subroutine addto(self,a) import class(Addition), intent(in) :: self integer, intent(inout) :: a end subroutine addto end interface end module class_50_m_1 module class_50_m_2 use class_50_m_1, only: Addition private type, public, extends(Addition) :: AdderClass contains procedure :: addto end type AdderClass contains subroutine addto(self,a) class(AdderClass), intent(in) :: self integer, intent(inout) :: a a = a + 3 end subroutine addto end module class_50_m_2 program class_50 use class_50_m_1, only: Addition use class_50_m_2, only: AdderClass integer :: a class(Addition), allocatable :: adder a = 1 adder = AdderClass() call adder%addto(a) if (a /= 4) error stop end program class_50 lfortran-0.63.0/integration_tests/array_constructor_06.f900000664000175000017500000000137515174404631024003 0ustar alastairalastairmodule array_constructor_06_mod implicit none contains function copy0_vec(xx) result(yy) real, intent(in) :: xx(:) real, allocatable :: yy(:) integer :: i allocate(yy(size(xx))) yy = [ (copy_vec([xx(i)]), i=1,size(xx)) ] end function copy0_vec function copy_vec(xx) result(yy) real, intent(in) :: xx(:) real, allocatable :: yy(:) allocate(yy(size(xx))) yy = xx end function copy_vec end module array_constructor_06_mod program array_constructor_06 use array_constructor_06_mod implicit none real :: xx(3) = [10.0, 20.0, 30.0] real, allocatable :: yy(:) yy = copy0_vec(xx) if (any(abs(yy - xx) > 1e-6)) error stop "array_constructor_06 failed" print *, "test passed" end program array_constructor_06lfortran-0.63.0/integration_tests/arrays_72.f900000664000175000017500000000166115174404631021522 0ustar alastairalastairprogram arrays_72 implicit none real :: xpt(5, 10) xpt = 2.0 xpt(1, :) = 3.0 xpt(2, :) = 4.0 xpt(3, :) = 5.0 xpt(:, 4) = 6.0 xpt(:, 5) = 7.0 xpt(:, 6) = 8.0 xpt(:, 7) = 9.0 call initq(xpt) contains function diag(A) result(D) implicit none real(4), intent(in) :: A(:, :) real(4), allocatable :: D(:) integer :: dlen, i dlen = max(0_4, int(min(size(A, 1), size(A, 2)) - 0, 4)) allocate(D(dlen)) D = [(A(i, i), i=1, dlen)] end function diag subroutine initq(xpt) real(4), intent(in), target :: xpt(:, :) real(4) :: xa(min(size(xpt, 1), size(xpt, 2) - size(xpt, 1) - 1)) real(4) :: xb(size(xa)) integer :: ndiag, n, npt n = int(size(xpt, 1), kind(n)) npt = int(size(xpt, 2), kind(npt)) ndiag = min(n, npt - n - 1) xa = diag(xpt(:, 2:ndiag + 1)) xb = diag(xpt(:, n + 2:n + ndiag + 1)) print *, xa print *, xb if( any(xa /= [3.0, 4.0, 6.0, 7.0]) ) error stop if( any(xb /= [9.0, 4.0, 5.0, 2.0]) ) error stop end subroutine end program lfortran-0.63.0/integration_tests/intrinsics_163.f900000664000175000017500000001126515174404631022470 0ustar alastairalastairprogram intrinsics_163 integer :: x, y, size1 integer(8) :: a, b, size2 integer(kind=1) :: res_1 integer(kind=2) :: res_2 integer(kind=4) :: res_4 integer(kind=8) :: res_8 integer(kind=1), parameter :: para_1 = ishftc(10_1, -2_1) integer(kind=2), parameter :: para_2 = ishftc(10_2, -2_2) integer(kind=4), parameter :: para_4 = ishftc(10_4, -2_4) integer(kind=8), parameter :: para_8 = ishftc(10_8, -2_8) if (para_1 /= -126) error stop if (para_2 /= -32766) error stop if (para_4 /= -2147483646) error stop if (para_8 /= -9223372036854775806_8) error stop res_1 = ishftc(10_1, 2_1) print *, res_1 if (res_1 /= 40) error stop res_1 = ishftc(10_1, -2_1) print *, res_1 if (res_1 /= -126) error stop res_1 = ishftc(-10_1, 2_1) print *, res_1 if (res_1 /= -37) error stop res_1 = ishftc(-10_1, -2_1) print *, res_1 if (res_1 /= -67) error stop res_2 = ishftc(10_2, 2_2) print *, res_2 if (res_2 /= 40) error stop res_2 = ishftc(10_2, -2_2) print *, res_2 if (res_2 /= -32766) error stop res_2 = ishftc(-10_2, 2_2) print *, res_2 if (res_2 /= -37) error stop res_2 = ishftc(-10_2, -2_2) print *, res_2 if (res_2 /= -16387) error stop res_4 = ishftc(10_4, 2_4) print *, res_4 if (res_4 /= 40) error stop res_4 = ishftc(10_4, -2_4) print *, res_4 if (res_4 /= -2147483646) error stop res_4 = ishftc(-10_4, 2_4) print *, res_4 if (res_4 /= -37) error stop res_4 = ishftc(-10_4, -2_4) print *, res_4 if (res_4 /= -1073741827) error stop res_8 = ishftc(10_8, 2_8) print *, res_8 if (res_8 /= 40_8) error stop res_8 = ishftc(10_8, -2_8) print *, res_8 if (res_8 /= -9223372036854775806_8) error stop res_8 = ishftc(-10_8, 2_8) print *, res_8 if (res_8 /= -37_8) error stop res_8 = ishftc(-10_8, -2_8) print *, res_8 if (res_8 /= -4611686018427387907_8) error stop res_1 = ishftc(127_1, 7_1) print *, res_1 if (res_1 /= -65) error stop res_1 = ishftc(127_1, -7_1) print *, res_1 if (res_1 /= -2) error stop res_1 = ishftc(-127_1, 7_1) print *, res_1 if (res_1 /= -64) error stop res_1 = ishftc(-127_1, -7_1) print *, res_1 if (res_1 /= 3) error stop res_2 = ishftc(32767_2, 15_2) print *, res_2 if (res_2 /= -16385) error stop res_2 = ishftc(32767_2, -15_2) print *, res_2 if (res_2 /= -2) error stop res_2 = ishftc(-32767_2, 15_2) print *, res_2 if (res_2 /= -16384) error stop res_2 = ishftc(-32767_2, -15_2) print *, res_2 if (res_2 /= 3) error stop res_4 = ishftc(2147483647_4, 31_4) print *, res_4 if (res_4 /= -1073741825) error stop res_4 = ishftc(2147483647_4, -31_4) print *, res_4 if (res_4 /= -2) error stop res_4 = ishftc(-2147483647_4, 31_4) print *, res_4 if (res_4 /= -1073741824) error stop res_4 = ishftc(-2147483647_4, -31_4) print *, res_4 if (res_4 /= 3) error stop res_8 = ishftc(9223372036854775807_8, 63_8) print *, res_8 if (res_8 /= -4611686018427387905_8) error stop res_8 = ishftc(9223372036854775807_8, -63_8) print *, res_8 if (res_8 /= -2) error stop res_8 = ishftc(-9223372036854775807_8, 63_8) print *, res_8 if (res_8 /= -4611686018427387904_8) error stop res_8 = ishftc(-9223372036854775807_8, -63_8) print *, res_8 if (res_8 /= 3) error stop res_1 = ishftc(10_1, 2_1, 4_1) print *, res_1 if (res_1 /= 10) error stop res_1 = ishftc(10_1, -2_1, 7_1) print *, res_1 if (res_1 /= 66) error stop res_2 = ishftc(10_2, 2_2, 6_2) print *, res_2 if (res_2 /= 40) error stop res_2 = ishftc(10_2, -2_2, 11_2) print *, res_2 if (res_2 /= 1026) error stop res_4 = ishftc(10_4, 2_4, 13_4) print *, res_4 if (res_4 /= 40) error stop res_4 = ishftc(10_4, -2_4, 31_4) print *, res_4 if (res_4 /= 1073741826) error stop res_8 = ishftc(10_8, 2_8, 62_8) print *, res_8 if (res_8 /= 40_8) error stop res_8 = ishftc(10_8, -2_8, 59_8) print *, res_8 if (res_8 /= 288230376151711746_8) error stop x = 17 y = 4 size1 = 6 a = 8 b = 2 size2 = 4 print *, ishftc(a, b, size2) if (ishftc(a, b, size2) /= 2) error stop print *, ishftc(x, y, size1) if (ishftc(x, y, size1) /= 20) error stop a = 293436938_8 res_8 = ishftc(a, 23) print *, res_8 if (res_8 /= 2461527445602304_8) error stop b = -1292093_8 res_8 = ishftc(b, -32) print *, res_8 if (res_8 /= -5549492883423233_8) error stop end program lfortran-0.63.0/integration_tests/program_cmake_01.f900000664000175000017500000000023315174404631023012 0ustar alastairalastair! This is a test program that CMake uses to check that the Fortran compiler is ! working. PROGRAM TESTFortran PRINT *, 'Hello' END lfortran-0.63.0/integration_tests/openmp_73.f900000664000175000017500000000110715174404631021513 0ustar alastairalastair! TEAMSDISTRIBUTE combined construct test program openmp_73 use omp_lib implicit none integer :: array(1000), i, j, sum=0 array(1)=3 !$omp teams distribute num_teams(2) thread_limit(5) do i = 1, 1000, 100 print*,omp_get_num_threads(), omp_get_max_threads() !$omp parallel do do j = i, min(i+99, 1000) array(j) = j * 3 end do !$omp end parallel do end do !$omp end teams distribute ! Sum of all elements !$omp parallel do reduction(+:sum) do i=1,1000 sum=sum+array(i) end do !$omp end parallel do print*, sum if(sum/=1501500) error stop end program openmp_73lfortran-0.63.0/integration_tests/read_02_data.txt0000664000175000017500000000001715174404631022331 0ustar alastairalastairaa bb cc dd ee lfortran-0.63.0/integration_tests/types_11.f900000664000175000017500000000021415174404631021347 0ustar alastairalastairprogram types_11 implicit none enum, bind(c) enumerator :: a = 1 enumerator :: b = 2 enumerator :: c = 3 end enum end program lfortran-0.63.0/integration_tests/logical3.f900000664000175000017500000000265215174404631021407 0ustar alastairalastairprogram logical3 ! This program checks logical operators implicit none logical :: a, b ! assigning values a = .true. b = .false. if (a .and. b) then print *, "Line 1 - Condition is true" error stop else print *, "Line 1 - Condition is false" end if if (a .or. b) then print *, "Line 2 - Condition is true" else print *, "Line 2 - Condition is false" error stop end if if (a .xor. b) then print *, "Line xor - Condition is true" else print *, "Line xor - Condition is false" error stop end if ! changing values a = .false. b = .true. if (.not.(a .and. b)) then print *, "Line 3 - Condition is true" else print *, "Line 3 - Condition is false" error stop end if if (b .neqv. a) then print *, "Line 4 - Condition is true" else print *, "Line 4 - Condition is false" error stop end if if (b .eqv. a) then print *, "Line 5 - Condition is true" error stop else print *, "Line 5 - Condition is false" end if ! changing values a = .true. b = .true. if (a .and. b) then print *, "Line 6 - Condition is true" else print *, "Line 6 - Condition is false" error stop end if if (a .or. b) then print *, "Line 7 - Condition is true" else print *, "Line 7 - Condition is false" error stop end if if (a .xor. b) then print *, "Line 8 xor - Condition is true" error stop else print *, "Line 8 xor - Condition is false" end if end program logical3 lfortran-0.63.0/integration_tests/read_09.f900000664000175000017500000000107115174404631021127 0ustar alastairalastairprogram read_09 ! Test variable-bounds implied-do in READ implicit none integer :: vals(5), i, n open(10, file='read_09_input.txt', status='replace') write(10, '(5I6)') 10, 20, 30, 40, 50 close(10) open(10, file='read_09_input.txt', status='old') n = 5 read(10, *) (vals(i), i=1, n) close(10, status='delete') if (vals(1) /= 10) error stop if (vals(2) /= 20) error stop if (vals(3) /= 30) error stop if (vals(4) /= 40) error stop if (vals(5) /= 50) error stop print *, "All tests passed!" end program lfortran-0.63.0/integration_tests/associate_36.f900000664000175000017500000000260715174404631022175 0ustar alastairalastair! Test: procedure pointer call inside associate block with array args. ! Regression test for ICE in pass_array_by_data when an AssociateBlock ! symbol is visited before the procedure-pointer variable it calls. module associate_36_mod implicit none abstract interface function my_func_i(x) result(f) double precision, intent(in) :: x(:) double precision, allocatable :: f(:) end function end interface contains function compute(initializer) result(res) procedure(my_func_i), pointer :: initializer double precision, allocatable :: res(:) double precision :: input(3) input = [1.0d0, 2.0d0, 3.0d0] associate(values => initializer(input)) res = values end associate end function end module program associate_36 use associate_36_mod implicit none procedure(my_func_i), pointer :: f double precision, allocatable :: result(:) f => double_it result = compute(f) print *, result if (size(result) /= 3) error stop if (abs(result(1) - 2.0d0) > 1.0d-12) error stop if (abs(result(2) - 4.0d0) > 1.0d-12) error stop if (abs(result(3) - 6.0d0) > 1.0d-12) error stop contains function double_it(x) result(f) double precision, intent(in) :: x(:) double precision, allocatable :: f(:) f = x * 2.0d0 end function end program lfortran-0.63.0/integration_tests/gpu_metal_18.f900000664000175000017500000000073715174404631022201 0ustar alastairalastairprogram gpu_metal_18 ! Nested arithmetic: polynomial evaluation implicit none integer, parameter :: n = 10000 real :: x(n), y(n), y_expected(n) integer :: i do i = 1, n x(i) = real(i) * 0.001 y_expected(i) = 3.0 * x(i) ** 3 - 2.0 * x(i) ** 2 + 1.5 * x(i) - 0.5 end do do concurrent (i = 1:n) y(i) = 3.0 * x(i) ** 3 - 2.0 * x(i) ** 2 + 1.5 * x(i) - 0.5 end do do i = 1, n if (abs(y(i) - y_expected(i)) > 1.0e-2) error stop end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/external_11.f900000664000175000017500000000044315174404631022031 0ustar alastairalastairsubroutine exabs() external zabs complex zresult zresult = zabs(1.0, -1.0) print *, abs(zresult) if ( abs(abs(zresult) - 1.41421354) > 1e-8 ) error stop end subroutine real function zabs (x, y) real x, y zabs = (x**2 + y**2)**0.5 end function program external_11 call exabs() end program lfortran-0.63.0/integration_tests/arrays_11_size.f900000664000175000017500000000056515174404631022547 0ustar alastairalastairmodule mod_arrays_11_size contains subroutine sub(xx) real, intent(in) :: xx(:) real :: buggy(count(xx > 0.0)) print * , size(buggy) if (size(buggy) /= 3) error stop end subroutine sub end module mod_arrays_11_size program arrays_11_size use mod_arrays_11_size real :: xx(5) = [1.1, 2.1, -1.3, 3.4, 0.0] call sub(xx) end program arrays_11_size lfortran-0.63.0/integration_tests/intrinsics_200.f900000664000175000017500000000102115174404631022445 0ustar alastairalastairprogram intrinsics_200 integer, dimension(5) :: x logical, dimension(5) :: mask x = [1, 2, 3, 4, 5] mask = [.true., .false., .true., .false., .true.] print *, median_all_mask_1_iint8_dp(x, mask) if (abs(median_all_mask_1_iint8_dp(x, mask) - 9.0) > 1e-8) error stop contains function median_all_mask_1_iint8_dp(x, mask) result(res) integer, intent(in) :: x(:) logical, intent(in) :: mask(:) real :: res integer, allocatable :: x_tmp(:) x_tmp = pack(x, mask) res = sum(x_tmp) end function median_all_mask_1_iint8_dp end program lfortran-0.63.0/integration_tests/class_141.f900000664000175000017500000000254215174404631021402 0ustar alastairalastair! Test: defined assignment inherited from abstract base type module class_141_mod implicit none type, abstract :: base_type contains procedure, non_overridable, private :: copy generic :: assignment(=) => copy procedure(copy_iface), deferred :: copy_impl end type abstract interface subroutine copy_iface(lhs, rhs) import base_type class(base_type), intent(inout) :: lhs class(base_type), intent(in) :: rhs end subroutine end interface type, extends(base_type) :: my_list integer, pointer :: data => null() contains procedure :: copy_impl => my_list_copy end type contains subroutine copy(lhs, rhs) class(base_type), intent(inout) :: lhs class(base_type), intent(in) :: rhs call lhs%copy_impl(rhs) end subroutine subroutine my_list_copy(lhs, rhs) class(my_list), intent(inout) :: lhs class(base_type), intent(in) :: rhs select type (rhs) type is (my_list) if (associated(rhs%data)) then allocate(lhs%data, source=rhs%data) end if end select end subroutine end module program class_141 use class_141_mod implicit none type(my_list) :: a, b allocate(a%data, source=42) b = a a%data = -1 if (.not. associated(b%data)) error stop if (b%data /= 42) error stop deallocate(a%data) deallocate(b%data) print *, "PASS" end program lfortran-0.63.0/integration_tests/select_type_08.f900000664000175000017500000000161715174404631022541 0ustar alastairalastairprogram select_type_08 implicit none type base integer :: x end type integer :: case_int class(*), allocatable :: x allocate(x, source = 10) call f(x, case_int) if (case_int /= 0) error stop deallocate(x) allocate(x, source = base(10)) call f(x, case_int) if (case_int /= 1) error stop contains subroutine f(generic, selected_case) class(*) :: generic integer, intent(out) :: selected_case select type(generic) type is (integer) print *, generic if (generic /= 10) error stop selected_case = 0 type is (base) print *, generic%x if (generic%x /= 10) error stop selected_case = 1 class default error stop end select end subroutine f end program select_type_08 lfortran-0.63.0/integration_tests/array_constructor_03.f900000664000175000017500000000117715174404631024000 0ustar alastairalastairmodule array_constructor_03_mod implicit none type :: string_t character(len=:), allocatable :: s end type string_t contains subroutine new(args) type(string_t), intent(in) :: args(:) if (size(args) /= 0) then error stop "ERROR: args is not zero-sized" end if if (lbound(args,1) /= 1) then error stop "ERROR: unexpected lower bound" end if print *, "OK: new() called with zero arguments" end subroutine new end module array_constructor_03_mod program array_constructor_03 use array_constructor_03_mod implicit none call new([string_t::]) end program array_constructor_03 lfortran-0.63.0/integration_tests/class_93.f900000664000175000017500000000213115174404631021322 0ustar alastairalastair! Test copy-in/copy-out for class member passed to type-bound procedure module class_93_mod implicit none type :: token_t integer :: val = 0 end type type :: lexer_t integer :: pos = 0 type(token_t) :: tokens(3) contains procedure :: next => lexer_next end type type :: parser_t type(token_t) :: token end type contains subroutine lexer_next(lexer, token) class(lexer_t), intent(inout) :: lexer type(token_t), intent(inout) :: token lexer%pos = lexer%pos + 1 token = lexer%tokens(lexer%pos) end subroutine subroutine parse(parser, lexer) class(parser_t), intent(inout) :: parser class(lexer_t), intent(inout) :: lexer call lexer%next(parser%token) end subroutine end module program class_93 use class_93_mod implicit none type(parser_t) :: parser type(lexer_t) :: lexer lexer%tokens(1)%val = 10 lexer%tokens(2)%val = 20 lexer%tokens(3)%val = 30 call parse(parser, lexer) if (parser%token%val /= 10) error stop call parse(parser, lexer) if (parser%token%val /= 20) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/derived_types_119.f900000664000175000017500000000305115174404631023144 0ustar alastairalastair! Test that a generic interface (custom constructor) re-exported through ! an intermediate module with default private access remains accessible. module derived_types_119_origin implicit none private type, public :: merge_config integer :: keyval = 3 end type merge_config public :: new_merge_config interface merge_config module procedure :: new_merge_config end interface merge_config contains pure function new_merge_config(keyval) result(config) character(*), intent(in), optional :: keyval type(merge_config) :: config if (present(keyval)) then select case(keyval) case("overwrite") config%keyval = 2 case("preserve") config%keyval = 3 end select end if end function new_merge_config end module derived_types_119_origin module derived_types_119_reexport use derived_types_119_origin implicit none private public :: merge_config end module derived_types_119_reexport module derived_types_119_consumer use derived_types_119_reexport implicit none private public :: do_stuff contains subroutine do_stuff(val) integer, intent(out) :: val type(merge_config) :: cfg cfg = merge_config(keyval="overwrite") val = cfg%keyval end subroutine do_stuff end module derived_types_119_consumer program derived_types_119 use derived_types_119_consumer, only : do_stuff implicit none integer :: val call do_stuff(val) if (val /= 2) error stop print *, val end program derived_types_119 lfortran-0.63.0/integration_tests/list_test_03_.f900000664000175000017500000000437115174404631022365 0ustar alastairalastairmodule list_test_03_mod implicit none contains function test_list_01(n) result(sum) integer, intent(in) :: n integer :: sum, i type(_lfortran_list(integer)) :: a sum = 0 do i = 0, n-1 call _lfortran_list_append(a, i) end do do i = 0, n-1 sum = sum + _lfortran_get_item(a, i) end do end function function test_list_insert_02(x, n) result(out) type(_lfortran_list(integer)), intent(inout) :: x integer, intent(in) :: n integer :: i, imod type(_lfortran_list(integer)) :: out out = x do i = 0, n-1 imod = mod(i, 3) if (imod == 0) then call _lfortran_list_insert(out, 0, i + n) else if (imod == 1) then call _lfortran_list_insert(out, _lfortran_len(out), i + n + 1) else if (imod == 2) then call _lfortran_list_insert(out, _lfortran_len(out)/2, i + n + 2) end if end do end function function test_list_02(n) result(acc) integer, intent(in) :: n integer :: acc, i type(_lfortran_list(integer)) :: x x = _lfortran_list_constant(50, 1) acc = 0 x = test_list_insert_02(x, n) do i = 0, n-1 acc = acc + _lfortran_get_item(x, i) end do end function subroutine test_list_02_string() type(_lfortran_list(character(len=:))) :: x, y character(len=:), allocatable :: string character(len=:), allocatable :: buffer integer :: i, imod do i = 0, 49 write(buffer, '(I0)') i + mod(i, 3) string = "xd_" // trim(buffer) call _lfortran_list_append(y, string) end do do i = 0, 49 imod = mod(i, 3) write(buffer, '(I0)') i + imod string = "xd_" // trim(buffer) call _lfortran_list_insert(x, _lfortran_len(x), string) end do do i = 0, 49 if (_lfortran_get_item(x, i) /= _lfortran_get_item(y, i)) error stop end do end subroutine subroutine verify() if (test_list_01(11) /= 55) error stop if (test_list_02(50) /= 3628) error stop call test_list_02_string() end subroutine end module program test_list_insert_ use list_test_03_mod implicit none call verify() end program lfortran-0.63.0/integration_tests/format_53.f900000664000175000017500000000401615174404631021505 0ustar alastairalastairprogram format_53 ! Test TR (tab right), TL (tab left), and T (absolute tab) format descriptors implicit none character(12):: str1 = 'abcdefghijkl', str2 character(4) :: str3 character(8) :: str4 ! Test 1: TR (tab right) - skip first 4 characters read(str1,"(tr4,a)") str2 print "(A)", '"'//str2//'"' if (str2 /= 'efghijkl ') error stop "Test 1 failed: TR" ! Test 2: TL (tab left) - move forward then back ! TR8 moves to position 8, TL4 moves back 4 positions to position 4 read(str1,"(tr8,tl4,a)") str2 print "(A)", '"'//str2//'"' if (str2 /= 'efghijkl ') error stop "Test 2 failed: TL" ! Test 3: Multiple TR operations read(str1,"(tr2,tr2,a)") str2 print "(A)", '"'//str2//'"' if (str2 /= 'efghijkl ') error stop "Test 3 failed: Multiple TR" ! Test 4: TR followed by TL to read from beginning read(str1,"(tr6,tl6,a)") str2 print "(A)", '"'//str2//'"' if (str2 /= 'abcdefghijkl') error stop "Test 4 failed: TR+TL to start" ! Test 5: TR to skip, read partial, then more operations read(str1,"(tr3,a4)") str3 print "(A)", '"'//str3//'"' if (str3 /= 'defg') error stop "Test 5 failed: TR with width" ! Test 6: T (absolute tab) - tab to position 5 read(str1,"(t5,a)") str2 print "(A)", '"'//str2//'"' if (str2 /= 'efghijkl ') error stop "Test 6 failed: T absolute" ! Test 7: T to position 1 (beginning) read(str1,"(t1,a)") str2 print "(A)", '"'//str2//'"' if (str2 /= 'abcdefghijkl') error stop "Test 7 failed: T to start" ! Test 8: T to middle, read partial read(str1,"(t4,a4)") str3 print "(A)", '"'//str3//'"' if (str3 /= 'defg') error stop "Test 8 failed: T with width" ! Test 9: Combination of T and TR read(str1,"(t3,tr2,a8)") str4 print "(A)", '"'//str4//'"' if (str4 /= 'efghijkl') error stop "Test 9 failed: T+TR combo" ! Test 10: T followed by TL read(str1,"(t7,tl3,a4)") str3 print "(A)", '"'//str3//'"' if (str3 /= 'defg') error stop "Test 10 failed: T+TL combo" print *, "All tests passed" end program format_53 lfortran-0.63.0/integration_tests/intrinsics_53.f900000664000175000017500000000032015174404631022374 0ustar alastairalastairprogram intrinsics_53 integer(4) :: n4 = 3 integer(8) :: n8 = 3 print *, repeat("a", n4) print *, repeat("a", n8) if (repeat("a", n4) /= "aaa") error stop if (repeat("a", n8) /= "aaa") error stop end program lfortran-0.63.0/integration_tests/bindc_05.f900000664000175000017500000000306315174404631021272 0ustar alastairalastairmodule bindc_05_mod use iso_c_binding, only: c_int, c_ptr, c_f_pointer, c_null_ptr, c_associated implicit none interface function ax(comm_f) bind(C, name="ax") import :: c_int, c_ptr integer(c_int), value :: comm_f type(c_ptr) :: ax end function ax end interface contains subroutine MPI_Barrier(comm, ierror) integer, intent(in) :: comm integer, intent(out), optional :: ierror type(c_ptr) :: c_comm integer, pointer :: fortran_ptr ! Call the C function c_comm = ax(comm) if (.not. c_associated(c_comm)) then print *, "Error: Null pointer returned from C function" if (present(ierror)) ierror = 1 return end if ! Convert C pointer to Fortran pointer call c_f_pointer(c_comm, fortran_ptr) print *, "Fortran received value:", fortran_ptr ! Verify the value matches what was passed if (fortran_ptr /= comm) then print *, "Error: Value mismatch" if (present(ierror)) ierror = 1 else if (present(ierror)) ierror = 0 end if end subroutine MPI_Barrier end module bindc_05_mod program bindc_05 use bindc_05_mod implicit none integer, parameter :: MPI_COMM_WORLD = 42 ! Non-zero value integer :: ierr call MPI_Barrier(MPI_COMM_WORLD, ierr) if (ierr == 0) then print *, "Test passed successfully" else print *, "Test failed" error stop end if end program bindc_05 lfortran-0.63.0/integration_tests/arrays_108.f900000664000175000017500000000076315174404631021604 0ustar alastairalastairprogram arrays_108 implicit none type :: str_array character(len = :), allocatable :: strings(:) end type str_array type(str_array) :: array_of_arrays(1) character(len = :), allocatable :: array(:) allocate(character(3) :: array_of_arrays(1)%strings(3)) array_of_arrays(1)%strings(1) = 'AAA' array_of_arrays(1)%strings(2) = 'BBB' array_of_arrays(1)%strings(3) = 'CCC' allocate(array(1), mold = array_of_arrays(1)%strings(1)) if (len(array(1)) /= 3) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/automatic_allocation_03.f900000664000175000017500000000025715174404631024406 0ustar alastairalastairprogram automatic_allocation_03 implicit none integer, allocatable :: i i = 4 i = abs(i - 4); if (i /= 0) error stop end program automatic_allocation_03 lfortran-0.63.0/integration_tests/implicit_interface_07.f900000664000175000017500000000035715174404631024052 0ustar alastairalastairmodule implicit_interface_07_module contains function f() f = 1 end function f end program main use implicit_interface_07_module integer :: j j = f() if (j /= 1) error stop print *, j end program main lfortran-0.63.0/integration_tests/implicit_interface_08.f900000664000175000017500000000047215174404631024051 0ustar alastairalastairmodule implicit_interface_08_module implicit none contains function f() implicit double precision (f) f = 1.00 end function f end program main use implicit_interface_08_module double precision :: i i = f() if (abs(i - 1) > 1e-6) error stop print *, i end program main lfortran-0.63.0/integration_tests/operator_overloading_05_module1.f900000664000175000017500000000142315174404631026063 0ustar alastairalastairmodule operator_overloading_05_module1 type :: string_type character(len=:), allocatable :: raw end type string_type interface assignment(=) module procedure :: assign_string_type end interface assignment(=) interface operator(>=) module procedure :: gt_string_type end interface operator(>=) contains pure subroutine assign_string_type(lhs, rhs) type(string_type), intent(inout) :: lhs type(string_type), intent(in) :: rhs lhs%raw = rhs%raw end subroutine assign_string_type pure function gt_string_type(lhs, rhs) result(r) type(string_type), intent(in) :: lhs type(string_type), intent(in) :: rhs logical :: r r = .true. end function gt_string_type end modulelfortran-0.63.0/integration_tests/gpu_metal_10.f900000664000175000017500000000073215174404631022164 0ustar alastairalastairprogram gpu_metal_10 ! Local scalar temporaries inside do concurrent implicit none integer, parameter :: n = 10000 real :: x(n), y(n), y_expected(n) integer :: i real :: s, c do i = 1, n x(i) = real(i) * 0.01 y_expected(i) = sin(real(i) * 0.01) + cos(real(i) * 0.01) end do do concurrent (i = 1:n) s = sin(x(i)) c = cos(x(i)) y(i) = s + c end do do i = 1, n if (abs(y(i) - y_expected(i)) > 1.0e-4) error stop end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/intrinsics_303.f900000664000175000017500000000016515174404631022461 0ustar alastairalastairprogram intrinsics_303 integer :: a call random_seed(a) print *, a if (a /= 8) error stop end programlfortran-0.63.0/integration_tests/operator_overloading_11.f900000664000175000017500000000160115174404631024430 0ustar alastairalastairmodule operator_overloading_11_module_1 implicit none type :: t end type interface operator(/=) module procedure ne end interface contains logical function ne(x, y) type(t), intent(in) :: x, y print *, "t::ne" ne = .false. end function end module operator_overloading_11_module_1 module operator_overloading_11_module_2 use operator_overloading_11_module_1, only: t, operator(/=) type :: u type(t) :: x end type interface operator(/=) module procedure une end interface contains logical function une(a, b) type(u), intent(in) :: a, b print *, "u::une" une = .false. end function end module operator_overloading_11_module_2 program main use operator_overloading_11_module_2 implicit none type(t) :: x type(u) :: y if (x /= x) error stop if (y /= y) error stop end program main lfortran-0.63.0/integration_tests/intrinsics_365.f900000664000175000017500000000027715174404631022475 0ustar alastairalastairprogram intrinsics_365 implicit none real, allocatable :: array(:, :) allocate(array(2:5, 5:10)) print *, is_contiguous(array) if ( .not. is_contiguous(array) ) error stop end program lfortran-0.63.0/integration_tests/intrinsics_177.f900000664000175000017500000000121115174404631022463 0ustar alastairalastairprogram intrinsics_177 character(4), parameter :: y = adjustr("okay") character(len=5) :: x character(len=20) :: str = 'gfortran ' str = adjustr(str) print *, str if (str /= ' gfortran') error stop str = adjustr('gfortran ') print *, str if (str /= ' gfortran') error stop print *, "|"//adjustr("abc ")//"|" if ("|"//adjustr("abc ")//"|" /= '| abc|') error stop x = " " print *, adjustr(x) print *, adjustr(" ") if (adjustr(" ") /= " ") error stop if (adjustr(x) /= " ") error stop if (y /= "okay") error stop end program lfortran-0.63.0/integration_tests/intrinsics_394.f900000664000175000017500000000176415174404631022501 0ustar alastairalastairprogram intrinsics_394 implicit none character(len=:), allocatable :: dir, cmd integer :: stat call check_dir_exists("fortran_scratch") call check_dir_exists("fortran_scratch2") contains subroutine check_dir_exists(dirname) character(len=*), intent(in) :: dirname character(len=:), allocatable :: local_cmd integer :: exitstat, cmdstat ! Build the test command local_cmd = "test -d " // trim(dirname) ! Execute and capture exit status cmdstat = -999 call execute_command_line(local_cmd, exitstat=exitstat, cmdstat=cmdstat) ! Print robust diagnostic info print *, cmdstat if (cmdstat /= 0) error stop "cmdstat should be zero when the command runs" if (exitstat == 0) then print *, "Directory exists: ", trim(dirname) else print *, "Directory does NOT exist: ", trim(dirname) end if end subroutine check_dir_exists end program intrinsics_394 lfortran-0.63.0/integration_tests/derived_types_95.f900000664000175000017500000000145715174404631023077 0ustar alastairalastairprogram derived_types_95 type:: tt integer :: n end type class(tt), allocatable :: arr(:) integer :: i print *, allocated(arr) if(allocated(arr)) error stop allocate(arr(3)) arr(1)%n = 10 arr(2)%n = 20 arr(3)%n = 30 do i = 1, size(arr) print *, arr(i)%n if(arr(i)%n /= i*10) error stop end do print *, allocated(arr) if(.not. allocated(arr)) error stop call foo(arr) contains subroutine foo(arg) class(tt), intent(in) :: arg(:) integer :: i print *, size(arg) if(size(arg) /= 3) error stop do i = 1, size(arg) print *, arg(i)%n ! if(arg(i)%n /= i*10) error stop >>>>>>>>>>>>>>>> !TODO: Uncomment when fixed end do end subroutine end programlfortran-0.63.0/integration_tests/file_11.f900000664000175000017500000000152015174404631021123 0ustar alastairalastairprogram file_11 implicit none integer :: u open(unit = 0, file="file_01_data.txt", status="old") open(unit = 1, file="file_01_data.txt", status="old") open(unit = 2, file="file_01_data.txt", status="old") open(newunit=u, file="file_01_data.txt", status="old") print *, u ! -10 is returned by gfortran, 3 is returned by lfortran ! similarly for other asserts below if (u /= -10 .and. u /= 3) error stop close(unit = 1) open(newunit=u, file="file_01_data.txt", status="old") print *, u if (u /= -11 .and. u /= 1) error stop open(newunit=u, file="file_01_data.txt", status="old") print *, u if (u /= -12 .and. u /= 4) error stop close(unit = 0) open(newunit=u, file="file_01_data.txt", status="old") print *, u if (u /= -13 .and. u /= 0) error stop end program lfortran-0.63.0/integration_tests/derived_types_72.f900000664000175000017500000000107615174404631023067 0ustar alastairalastairprogram main implicit none integer,parameter :: n = 2 type :: my_type integer :: key end type type :: my_type2 type(my_type), allocatable :: x(:) end type type :: matrix integer :: elements(n) end type type(matrix) :: m type(my_type) :: arr(5) type(my_type2) :: mt2 integer :: i m%elements = [1, 2] arr = [(my_type(i), i=1, 5)] if (any(arr%key /= [1,2,3,4,5])) error stop allocate(mt2%x(1)) mt2%x(1) = arr(1) mt2%x = [mt2%x, arr] if (any(mt2%x%key /= [1, 1, 2, 3, 4, 5])) error stop end programlfortran-0.63.0/integration_tests/array_section_22.f900000664000175000017500000000325315174404631023055 0ustar alastairalastairmodule array_section_22_mod implicit none integer, parameter :: sp = kind(1.0) contains subroutine assign_tau(q, k) real(sp), intent(out), contiguous, target :: q(:,:) real(sp), pointer :: tau(:) integer, intent(in) :: k integer :: i, j ! Initialize q (required since INTENT(OUT)) do i = 1, size(q,1) do j = 1, size(q,2) q(i,j) = i*10 + j end do end do ! Pointer assignment tau(1:k) => q(1:k,1) ! ===== CHECK 1: pointer must be associated ===== if (.not. associated(tau)) then error stop "FAIL: tau is not associated" end if ! ===== CHECK 2: values must match q(:,1) slice ===== do i = 1, k if (tau(i) /= q(i,1)) then error stop "FAIL: tau values do not match q slice" end if end do ! Modify via pointer tau = -5.0_sp ! ===== CHECK 3: q must reflect pointer modification ===== do i = 1, k if (q(i,1) /= -5.0_sp) then error stop "FAIL: q not updated via tau" end if end do ! ===== CHECK 4: elements outside slice unchanged ===== do i = k+1, size(q,1) if (q(i,1) == -5.0_sp) then error stop "FAIL: out-of-slice elements modified" end if end do end subroutine assign_tau end module array_section_22_mod program array_section_22 use array_section_22_mod implicit none real(sp), target :: A(5,5) integer :: k k = 3 call assign_tau(A, k) print *, "All checks passed." end program array_section_22lfortran-0.63.0/integration_tests/read_49.f900000664000175000017500000000050415174404631021133 0ustar alastairalastairimplicit none ! substringext.f90 character(8):: string = 'abcd' integer:: unit = 42 open(newunit=unit, file='foobar', status='new') write (unit, "(A)") string(1:4) rewind unit read (unit,"(A)") string(5:8) close (unit,status = 'delete') if (string /= 'abcdabcd') stop 1 print "(A)",string print *, 'Test passed' end programlfortran-0.63.0/integration_tests/intrinsics_282.f900000664000175000017500000000340215174404631022464 0ustar alastairalastairprogram intrinsics_282 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 implicit none real(sp), parameter :: r1 = hypot(4.0_sp, 3.0_sp) real(dp), parameter :: r2 = hypot(4.0_dp, 3.0_dp) real(sp), parameter :: ar1(3) = hypot([4.0_sp, 3.0_sp, 0.0_sp], [3.0_sp, 4.0_sp, 0.0_sp]) real(dp), parameter :: ar2(3) = hypot([2.0_dp, 1.0_dp, 9.0_dp], [6.0_dp, 4.0_dp, 0.0_dp]) real(sp) :: x = 4.0_sp, y = 3.5_sp real(dp) :: z = 1.12_dp, w = 0.43_dp real(sp) :: arr1(3) = [4.0_sp, 3.0_sp, 0.0_sp], arr2(3) = [3.0_sp, 4.0_sp, 11.0_sp] real(dp) :: arr3(3) = [2.0_dp, 1.0_dp, 9.0_dp], arr4(3) = [6.0_dp, 4.0_dp, 0.0_dp] print *, r1 if (abs(r1 - 5.0_sp) > 1e-6) error stop print *, r2 if (abs(r2 - 5.0_dp) > 1e-12) error stop print *, ar1 if (any(abs(ar1 - [5.0_sp, 5.0_sp, 0.0_sp]) > 1e-6)) error stop print *, ar2 if (any(abs(ar2 - [6.32455532033676_dp, 4.12310562561766_dp, 9.0_dp]) > 1e-12)) error stop print *, hypot( x = 1.e0_4, y = 0.5e0_4 ) if (abs(hypot( x = 1.e0_4, y = 0.5e0_4 ) - 1.11803401_sp) > 1e-6) error stop print *, hypot( 1.e0_4, y = 0.5e0_4 ) if (abs(hypot( 1.e0_4, y = 0.5e0_4 ) - 1.11803401_sp) > 1e-6) error stop print *, hypot( 1.e0_4, 0.5e0_4 ) if (abs(hypot( 1.e0_4, 0.5e0_4 ) - 1.11803401_sp) > 1e-6) error stop print *, hypot(x, y) if (abs(hypot(x, y) - 5.31507290636733_sp) > 1e-6) error stop print *, hypot(z, w) if (abs(hypot(z, w) - 1.1997082978791138_dp) > 1e-12) error stop print *, hypot(arr1, arr2) if (any(abs(hypot(arr1, arr2) - [5.0_sp, 5.0_sp, 11.0_sp]) > 1e-6)) error stop print *, hypot(arr3, arr4) if (any(abs(hypot(arr3, arr4) - [6.32455532033676_dp, 4.12310562561766_dp, 9.0_dp]) > 1e-12)) error stop end program lfortran-0.63.0/integration_tests/intent_out_module_dealloc.f900000664000175000017500000000263515174404631025133 0ustar alastairalastair! Test that module subroutines properly deallocate intent(out) allocatable ! dummies at function entry per Fortran standard. ! ! This is an MRE for a bug where the IntentOutDeallocateVisitor pass ! incorrectly skipped ALL module procedures (thinking they were compiler- ! generated intrinsics) due to checking only deftype == Implementation. module intent_out_module_dealloc_m implicit none contains subroutine reset_array(x) integer, allocatable, intent(out) :: x(:) ! Per Fortran standard, x must be deallocated on entry if (allocated(x)) error stop 1 allocate(x(3)) x = [10, 20, 30] end subroutine reset_array end module intent_out_module_dealloc_m program intent_out_module_dealloc use intent_out_module_dealloc_m, only: reset_array implicit none integer, allocatable :: arr(:) ! First call: arr is not allocated call reset_array(arr) if (.not. allocated(arr)) error stop 2 if (size(arr) /= 3) error stop 3 if (arr(1) /= 10 .or. arr(2) /= 20 .or. arr(3) /= 30) error stop 4 ! Second call: arr IS allocated, should be deallocated on entry deallocate(arr) allocate(arr(5)) arr = [1, 2, 3, 4, 5] call reset_array(arr) if (.not. allocated(arr)) error stop 5 if (size(arr) /= 3) error stop 6 if (arr(1) /= 10 .or. arr(2) /= 20 .or. arr(3) /= 30) error stop 7 print *, "PASS" end program intent_out_module_dealloc lfortran-0.63.0/integration_tests/arrays_op_4.f900000664000175000017500000000307315174404631022132 0ustar alastairalastairprogram array_op_3 implicit none logical, allocatable :: a(:, :, :), b(:, :, :) logical, allocatable :: c(:, :, :) integer :: i, j, k, dim1 = 10, dim2 = 100, dim3 = 1 allocate(a(dim1, dim2, dim3), b(dim1, dim2, dim3), c(dim1, dim2, dim3)) do i = 1, dim1 do j = 1, dim2 do k = 1, dim3 a(i, j, k) = modulo2(i + j + k) b(i, j, k) = modulo2(i*j + j*k + k*j) end do end do end do c = a .and. b call verify(c, 0) c = a .or. b call verify(c, 1) c = a .eqv. b call verify(c, 2) c = b .neqv. a call verify(c, 3) contains logical function modulo2(x) result(r) integer, intent(in) :: x r = (x - 2*(x/2) == 1) end function modulo2 subroutine verify(c, op_code) implicit none logical, allocatable, intent(in) :: c(:, :, :) integer, intent(in) :: op_code integer :: i, j, k logical :: x, y do i = lbound(c, 1), ubound(c, 1) do j = lbound(c, 2), ubound(c, 2) do k = lbound(c, 3), ubound(c, 3) x = modulo2(i + j + k) y = modulo2(i*j + j*k + k*j) select case(op_code) case (0) if(c(i, j, k) .neqv. (x .and. y)) error stop case (1) if(c(i, j, k) .neqv. (x .or. y)) error stop case (2) if(c(i, j, k) .neqv. (x .eqv. y)) error stop case (3) if(c(i, j, k) .neqv. (x .neqv. y)) error stop end select end do end do end do end subroutine verify end programlfortran-0.63.0/integration_tests/intrinsics_325.f900000664000175000017500000000045415174404631022466 0ustar alastairalastairprogram intrinsics_325 integer(8) :: d(2) = [1,2] integer(8) :: spread_(2, 2) spread_ = spread(d, dim=2, ncopies=2) print *, spread_ if (spread_(1, 1) /= 1) error stop if (spread_(1, 2) /= 1) error stop if (spread_(2, 1) /= 2) error stop if (spread_(2, 2) /= 2) error stop end program intrinsics_325 lfortran-0.63.0/integration_tests/select_type_27.f900000664000175000017500000000126715174404631022543 0ustar alastairalastair! Test real() and aimag() intrinsics on class(*) inside select type program select_type_27 implicit none class(*), allocatable :: obj ! complex(4) obj = (1.0, 2.0) select type(obj) type is (complex(4)) if (abs(real(obj) - 1.0) > 1.0e-5) error stop if (abs(aimag(obj) - 2.0) > 1.0e-5) error stop class default error stop end select ! complex(8) obj = (3.0d0, 4.0d0) select type(obj) type is (complex(8)) if (abs(real(obj) - 3.0d0) > 1.0d-12) error stop if (abs(aimag(obj) - 4.0d0) > 1.0d-12) error stop class default error stop end select print *, "PASS" end program select_type_27 lfortran-0.63.0/integration_tests/class_135.f900000664000175000017500000000151215174404631021401 0ustar alastairalastairprogram class_135 ! Test class(*) allocatable array assignment implicit none class(*), allocatable :: src(:), dst(:) ! Allocate and assign from integer array allocate(src, source=[5, 7, 11]) ! Copy to pre-allocated destination allocate(dst, mold=src) dst = src ! Verify values via select type select type(dst) type is (integer) if (dst(1) /= 5) error stop if (dst(2) /= 7) error stop if (dst(3) /= 11) error stop class default error stop end select deallocate(src) deallocate(dst) ! Test with real values allocate(src, source=[1.5, 2.5, 3.5]) allocate(dst, mold=src) dst = src select type(dst) type is (real) if (abs(dst(1) - 1.5) > 1.0e-6) error stop if (abs(dst(2) - 2.5) > 1.0e-6) error stop if (abs(dst(3) - 3.5) > 1.0e-6) error stop class default error stop end select print *, "PASS" end program lfortran-0.63.0/integration_tests/stop_01.f900000664000175000017500000000025115174404631021170 0ustar alastairalastairprogram stop_01 implicit none integer :: x x = 5 print *, x x = x + 2 print *, x stop x = x + 2 print *, x end program lfortran-0.63.0/integration_tests/operator_overloading_34.f900000664000175000017500000000051315174404631024436 0ustar alastairalastairprogram operator_overloading_34 use operator_overloading_34_mod implicit none type(array_type) :: a logical :: res(2, 3) allocate(a%val(2, 3)) a%val = 5.0 res = a .gt. 3.0 if (.not. all(res)) error stop a%val = 1.0 res = a .gt. 3.0 if (any(res)) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/allocate_26.f900000664000175000017500000000041015174404631021773 0ustar alastairalastairprogram allocate_26 implicit none integer(4) :: ind character(len=:, kind=1), allocatable, dimension(:) :: arr integer(4) :: i allocate(arr(3), mold="hello") arr = "hello" print *, arr if (any(arr /= ["hello", "hello", "hello"])) error stop end program allocate_26lfortran-0.63.0/integration_tests/format_08.f900000664000175000017500000000015015174404631021500 0ustar alastairalastairprogram format_08 implicit none integer :: b(10) b = 1 print "(1000(i6))", b end programlfortran-0.63.0/integration_tests/file_48.f900000664000175000017500000000220415174404631021135 0ustar alastairalastairprogram daio4 implicit none integer, parameter :: unit_no = 24 integer :: i, i1, iolen, irl logical :: l, pf character(4) :: s real :: r complex :: c complex, parameter :: cval = (12.34, 56.78) ! inquire (iolength=iolen) l, s, i, r, c ! Causes ICE: see PR #9761 ! ! So I hard code iolen. iolen = 24 open (unit_no, file='fort.24', access='direct', recl=iolen) do, i=1, 10 l = mod (i,2) == 0 write (unit_no, rec=i) l, 'wxyz', i, i+0.5, cval end do ! Read fails to read correctly: do, i=1, 10 l = .false.; s = 'uini'; i1 = -42; r = -42.42 read (unit_no, rec=i) l, s, i1, r, c pf = (l .eqv. mod (i, 2) == 0) .and. & (s == 'wxyz') .and. & (i == i1) .and. & (abs (r - (i + 0.5)) < 0.0001) .and. & (c == cval) print *, 'l, s, i1, r =', l, s, i1, r, c print *, 'read', i, merge ('pass', 'fail', pf) if (.not. pf) error stop end do close (unit_no) irl = -99 inquire (42, recl=irl) if (irl /= -1) error stop open (42, file='fort.42', access='stream') inquire (42, recl=irl) if (irl /= -2) error stop close (42, status='delete') end programlfortran-0.63.0/integration_tests/legacy_array_sections_14_foo.f900000664000175000017500000000015615174404631025427 0ustar alastairalastairsubroutine foo(x) implicit none real, intent(inout) :: x(*) x(1) = x(1) + 1.0 end subroutine foo lfortran-0.63.0/integration_tests/separate_compilation_41b.f900000664000175000017500000000102615174404631024554 0ustar alastairalastairmodule separate_compilation_41b use separate_compilation_41a, only: outertype implicit none type :: wrapper class(outertype), allocatable :: outer end type wrapper contains subroutine client(self, n, arr) class(wrapper), intent(in) :: self integer, intent(in) :: n real(8), intent(in) :: arr(n:, :) select type (outer => self%outer) class is (outertype) call self%outer%inner%method(n, arr) end select end subroutine client end module separate_compilation_41b lfortran-0.63.0/integration_tests/gpu_metal_67.f900000664000175000017500000000245615174404631022205 0ustar alastairalastairmodule gpu_metal_67_mod_a implicit none type :: type_a real :: val end type interface type_a module procedure my_construct end interface contains pure function my_construct(v) result(res) real, intent(in) :: v type(type_a) res res%val = v end function end module module gpu_metal_67_mod_b implicit none type :: type_b real :: val end type interface type_b module procedure my_construct end interface contains pure function my_construct(v) result(res) real, intent(in) :: v type(type_b) res res%val = v * 10.0 end function end module program gpu_metal_67 use gpu_metal_67_mod_a, only : type_a use gpu_metal_67_mod_b, only : type_b implicit none type(type_a) :: a_arr(4) type(type_b) :: b_arr(4) integer :: i do concurrent (i = 1:4) a_arr(i) = type_a(real(i)) b_arr(i) = type_b(real(i)) end do if (abs(a_arr(1)%val - 1.0) > 1.0e-6) error stop if (abs(a_arr(2)%val - 2.0) > 1.0e-6) error stop if (abs(a_arr(3)%val - 3.0) > 1.0e-6) error stop if (abs(a_arr(4)%val - 4.0) > 1.0e-6) error stop if (abs(b_arr(1)%val - 10.0) > 1.0e-6) error stop if (abs(b_arr(2)%val - 20.0) > 1.0e-6) error stop if (abs(b_arr(3)%val - 30.0) > 1.0e-6) error stop if (abs(b_arr(4)%val - 40.0) > 1.0e-6) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/procedure_45.f900000664000175000017500000000112115174404631022200 0ustar alastairalastairmodule procedure_45_mod implicit none abstract interface subroutine p_iface(x) integer, intent(inout) :: x end subroutine p_iface end interface private :: default_proc procedure(p_iface), pointer :: mysub => default_proc contains subroutine default_proc(x) integer, intent(inout) :: x x = x + 1 end subroutine default_proc end module procedure_45_mod program procedure_45 use procedure_45_mod implicit none integer :: x x = 41 call mysub(x) if (x /= 42) error stop end program procedure_45 lfortran-0.63.0/integration_tests/gpu_metal_28.f900000664000175000017500000000044615174404631022177 0ustar alastairalastairprogram gpu_metal_28 ! Test parameter variables with dependencies in do concurrent implicit none integer :: l real :: x(4) real, parameter :: a = 0.9 real, parameter :: b = 1.0 - a do concurrent(l = 1:4) x(l) = b end do if (any(abs(x - 0.1) > 1e-5)) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/template_add_02.f900000664000175000017500000000242115174404631022630 0ustar alastairalastairmodule template_add_02_m implicit none private public :: add_t, test_template requirement r(t, f) type, deferred :: t function f(x, y) result(z) type(t), intent(in) :: x, y type(t) :: z end function end requirement template add_t(t, f) require :: r(t, f) private public :: add_generic contains function add_generic(x, y) result(z) type(t), intent(in) :: x, y type(t) :: z z = f(x, y) end function end template interface operator (+) module procedure func_arg_real end interface contains real function func_arg_real(x, y) result(z) real, intent(in) :: x, y z = x + y end function integer function func_arg_int(x, y) result(z) integer, intent(in) :: x, y z = x + y end function subroutine test_template() instantiate add_t(real, operator(+)), only: add_real => add_generic real :: x, y x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) if (abs(add_real(x, y) - 12.3) > 1e-5) error stop end subroutine end module program template_add_02 use template_add_02_m implicit none call test_template() end program lfortran-0.63.0/integration_tests/entry_03.f900000664000175000017500000000135115174404631021350 0ustar alastairalastairsubroutine x(dummy) real :: dummy print *, "Printed using subroutine call: ", dummy if (abs(dummy - 10.0) > 1e-7) error stop dummy = 5.0 entry y(dummy) print *, "Printed using y entry statement: ", dummy if (abs(dummy - 5.0) > 1e-7) error stop dummy = 2.5 return entry z(dummy) print *, "Printed using z entry statement: ", dummy if (abs(dummy - 2.5) > 1e-7) error stop dummy = 1.25 return entry w(dummy) print *, "Printed using w entry statement: ", dummy if (abs(dummy - 1.25) > 1e-7) error stop return end subroutine program entry_03 real :: dummy dummy = 10.0 call x(dummy) dummy = 5.0 call y(dummy) dummy = 2.5 call z(dummy) dummy = 1.25 call w(dummy) end program lfortran-0.63.0/integration_tests/separate_compilation_26b.f900000664000175000017500000000117515174404631024564 0ustar alastairalastairsubmodule (quadrature_separate_compilation_26) quadrature_gauss_separate_compilation_26 use specialfunctions_separate_compilation_26, only: legendre implicit none contains pure module subroutine gauss_legendre_fp64 (i) integer, intent(inout) :: i i = legendre(i) end subroutine end submodule submodule (specialfunctions_separate_compilation_26) specialfunctions_legendre_separate_compilation_26 implicit none contains pure elemental module function legendre_fp64(n) result(leg) integer, intent(in) :: n integer :: leg leg = n + 1 end function end submodulelfortran-0.63.0/integration_tests/gpu_metal_135.f900000664000175000017500000000114415174404631022252 0ustar alastairalastairprogram gpu_metal_135 ! Test: submodule function returning a derived type called inside ! do concurrent with --gpu=metal and --separate-compilation. ! Verifies that the GPU offload pass resolves ExternalSymbols in ! the duplicated submodule function body. use gpu_metal_135_m, only : my_t, make_t implicit none type(my_t) :: arr(5) integer :: i do concurrent(i = 1:5) arr(i) = make_t(i) end do print *, arr(1)%val, arr(3)%val, arr(5)%val if (arr(1)%val /= 1) error stop if (arr(2)%val /= 2) error stop if (arr(3)%val /= 3) error stop if (arr(4)%val /= 4) error stop if (arr(5)%val /= 5) error stop end program lfortran-0.63.0/integration_tests/bindc_iso_fb_06.f900000664000175000017500000000137115174404631022614 0ustar alastairalastairmodule bindc_iso_fb_06_mod implicit none interface subroutine check_cfi_type(a, expected_type) bind(C) implicit none type(*) :: a(..) integer, value :: expected_type end subroutine integer function cfi_type_int32() bind(C) end function integer function cfi_type_float() bind(C) end function end interface contains subroutine wrap(a, expected_type) type(*), intent(inout) :: a(..) integer, intent(in) :: expected_type call check_cfi_type(a, expected_type) end subroutine end module program bindc_iso_fb_06 use bindc_iso_fb_06_mod implicit none integer :: vi real :: vr vi = 42 vr = 3.14 call wrap(vi, cfi_type_int32()) call wrap(vr, cfi_type_float()) print *, "PASS" end program lfortran-0.63.0/integration_tests/derived_types_129.f900000664000175000017500000000353015174404631023147 0ustar alastairalastairmodule derived_types_129_mod implicit none type :: point real :: x, y procedure(add_default_iface), pointer, nopass :: add_default => null() procedure(add_named_iface), pointer, nopass :: add_named => null() end type point abstract interface function add_default_iface(self, other) result(res) import :: point class(point), intent(in) :: self, other type(point) :: res end function function add_named_iface(scale, pt) result(res) import :: point real, intent(in) :: scale class(point), intent(in) :: pt type(point) :: res end function end interface contains function add_default_impl(self, other) result(res) class(point), intent(in) :: self, other type(point) :: res res%x = self%x + other%x res%y = self%y + other%y end function function add_named_impl(scale, pt) result(res) real, intent(in) :: scale class(point), intent(in) :: pt type(point) :: res res%x = pt%x * scale res%y = pt%y * scale end function end module derived_types_129_mod program derived_types_129 use derived_types_129_mod implicit none type(point) :: p1, p2, result p1%x = 1.0 p1%y = 2.0 p1%add_default => add_default_impl p1%add_named => add_named_impl p2%x = 3.0 p2%y = 4.0 ! Call via procedure pointer: add_default(p1, p2) result = p1%add_default(p1, p2) if (abs(result%x - 4.0) > 1e-6) error stop if (abs(result%y - 6.0) > 1e-6) error stop ! Call via procedure pointer: add_named(10.0, p1) result = p1%add_named(10.0, p1) if (abs(result%x - 10.0) > 1e-6) error stop if (abs(result%y - 20.0) > 1e-6) error stop print *, "All tests passed." end program derived_types_129 lfortran-0.63.0/integration_tests/separate_compilation_43a.f900000664000175000017500000000056715174404631024566 0ustar alastairalastairmodule separate_compilation_43a_module implicit none type, abstract :: AbsType procedure(pintfc), pointer :: ptr => null() end type AbsType abstract interface subroutine pintfc(self) import class(AbsType), intent(in) :: self end subroutine pintfc end interface end module separate_compilation_43a_module lfortran-0.63.0/integration_tests/implied_do_loops25.f900000664000175000017500000000126415174404631023400 0ustar alastairalastairmodule implied_do_loops25_mod implicit none type :: t real, allocatable :: vals(:) contains procedure :: values => get_values end type contains pure function get_values(self) result(v) class(t), intent(in) :: self real, allocatable :: v(:) v = self%vals end function end module program implied_do_loops25 use implied_do_loops25_mod implicit none integer, parameter :: n = 5 type(t), allocatable :: a(:) real, allocatable :: res(:) integer :: i a = [(t([real(i)]), i=1,n)] res = [(a(i)%values(), i=1,n)] if (size(res) /= 5) error stop do i = 1, n if (abs(res(i) - real(i)) > 1.0e-6) error stop end do print *, "PASS" end program lfortran-0.63.0/integration_tests/data_10.f900000664000175000017500000000146215174404631021121 0ustar alastairalastairprogram data_10 integer :: a, i, j, x(5), y(5), z(5) real :: k, l data x, j / 1, 2, 3, 4, 5, 3 / print *, x, j if (x(1) /= 1) error stop if (x(2) /= 2) error stop if (x(3) /= 3) error stop if (x(4) /= 4) error stop if (x(5) /= 5) error stop if (j /= 3) error stop data k, (y(i), i = 1, 5), l / 10.0, 1, 2, 3, 4, 5, 12.0 / print *, k, l, y if (y(1) /= 1) error stop if (y(2) /= 2) error stop if (y(3) /= 3) error stop if (y(4) /= 4) error stop if (y(5) /= 5) error stop if (abs(k - 10.0) > 1e-8) error stop data a, z / 1, 2, 3,4, 2*5 / print *, a, z if (a /= 1) error stop if (z(1) /= 2) error stop if (z(2) /= 3) error stop if (z(3) /= 4) error stop if (z(4) /= 5) error stop if (z(5) /= 5) error stop end program lfortran-0.63.0/integration_tests/modules_27_module1.f900000664000175000017500000000115715174404631023317 0ustar alastairalastairmodule tomlf_build_keyval implicit none real :: GLOBAL_VAR interface get_value module procedure :: get_value_float_sp module procedure :: get_value_float_dp end interface get_value contains subroutine get_value_float_sp(self, val, stat) complex, intent(in) :: self real(4), intent(out) :: val integer, intent(out), optional :: stat end subroutine get_value_float_sp subroutine get_value_float_dp(self, val, stat) complex, intent(in) :: self real(8), intent(out) :: val integer, intent(out), optional :: stat end subroutine get_value_float_dp end module tomlf_build_keyval lfortran-0.63.0/integration_tests/intrinsics_52.f900000664000175000017500000000066615174404631022410 0ustar alastairalastairprogram intrinsics_52 integer :: a, b, c, d, e, f a = 2 b = -3 c = 5 d = 10 e = 20 f = -30 if (max0(10,20) /= 20) error stop if (max0(3,5,4) /= 5) error stop if (max0(a,b) /= a) error stop if (max0(a,b,c) /= c) error stop if (max0(d,e,f,a,b,c) /= e) error stop if (min0(10,20) /= 10) error stop if (min0(3,5,4) /= 3) error stop if (min0(a,b) /= b) error stop if (min0(c,b,a) /= b) error stop if (min0(d,e,f,a,b,c) /= f) error stop end lfortran-0.63.0/integration_tests/intrinsics_64.f900000664000175000017500000000023215174404631022400 0ustar alastairalastairprogram intrinsics_64 real :: x, y x = 1.0 y = -0.0 x = sign(x, y) print *, x if (abs(x - (-1.0)) > 1e-9) error stop end program lfortran-0.63.0/integration_tests/arrays_constructor_01.f900000664000175000017500000000204015174404631024147 0ustar alastairalastairprogram arrays_constructor_01 implicit none character(5) :: str = "Hello" integer :: i = 1, ios, j real, pointer :: dw_(:,:) type :: MyClass integer :: value end type MyClass type(MyClass) :: v1, v2, v3, arr(3) character(4), parameter :: arr1(1:2,1:2)=reshape(['a ', '1 ', 'b ', '2 '], [2,2]) integer, parameter :: lpunc = 4 character:: input(lpunc) = & [("2",i=1,lpunc)] print *, ["aaa", "aaa"] print *, [str(i+1:i+1), str(i:i)] print *, ["aaa", str(i+1:i+3), "aaa"] print *, [str(i+1:i+3), "aaa"] arr = [MyClass :: v1, v2, v3] print *, arr print*, arr1 if (any(arr1 /= reshape(['a ', '1 ', 'b ', '2 '], [2,2]))) error stop print *, input if (any(input /= ['2', '2', '2', '2'])) error stop allocate(dw_(2,3)) dw_ = reshape([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], [2,3]) print *, [dw_] if (all([dw_] /= [1.0, 2.0, 3.0, 4.0, 5.0, 6.0])) error stop "Test failed" deallocate(dw_) end program arrays_constructor_01 lfortran-0.63.0/integration_tests/string_60.f900000664000175000017500000000076215174404631021525 0ustar alastairalastair!Test StringSection program string_60 character(10):: ss ss = "ABCDEFGHIJ" ss = reverse(ss) print *, ss if(ss /= "JIHGFEDCBA") error stop contains function reverse(string) result(reverse_string) character(len=*), intent(in) :: string character(len=len(string)) :: reverse_string integer :: i, n n = len(string) do i = 1, n reverse_string(n-i+1:n-i+1) = string(i:i) end do end function reverse end programlfortran-0.63.0/integration_tests/callback_02.f900000664000175000017500000000115015174404631021737 0ustar alastairalastairmodule callback_02 contains subroutine cb(res, a, b, f) real, intent(in) :: a, b real :: res interface subroutine f(x, res) implicit none real, intent(in) :: x real :: res end subroutine end interface call f(a, res) print *, res call f(b, res) print *, res res = (b-a)*res print *, res end subroutine real function foo(c, d, res) real :: c, d, res call cb(res, c, d, f) foo = res contains subroutine f(x, res) real, intent(in) :: x real :: res res = 2*x end subroutine f end function foo end module program main use callback_02 real :: res = 0 res = foo(1.5, 2.0, res) end program lfortran-0.63.0/integration_tests/intrinsics_385.f900000664000175000017500000000042215174404631022467 0ustar alastairalastairprogram intrinsics_385 implicit none real(4) :: x, up, down x = 1.0 up = nearest(x, 1.0) down = nearest(x, -1.0) print *, up print *, down if (up /= 1.00000012) error stop if (down /= 0.999999940) error stop end program intrinsics_385 lfortran-0.63.0/integration_tests/derived_types_33.f900000664000175000017500000000135615174404631023065 0ustar alastairalastairmodule testdrive_derived_types_33 implicit none private public :: error_type, test_skipped type :: error_type integer :: stat character(len=:), allocatable :: message end type error_type contains pure function test_skipped(error) result(is_skipped) type(error_type), intent(in), optional :: error logical :: is_skipped is_skipped = .false. if (present(error)) then is_skipped = error%stat == 1 end if end function test_skipped end module testdrive_derived_types_33 program main use testdrive_derived_types_33 implicit none type(error_type), allocatable :: error_obj allocate(error_obj) error_obj%stat = 1 print *, test_skipped(error_obj) print *, error_obj%stat end program lfortran-0.63.0/integration_tests/do_loop_04.f900000664000175000017500000000045115174404631021643 0ustar alastairalastairprogram do_loop_04 integer :: n = 2, k do k = 2, n print *, k end do ! without --use-loop-variable-after-loop ! remove/ update this test if we make using the loop variable after the loop by default if (k /= 2) error stop print *, "k after = ", k end program lfortran-0.63.0/integration_tests/block_08.f900000664000175000017500000000102115174404631021300 0ustar alastairalastairfunction diff_1_int32(n_) result(y) integer, allocatable :: y(:) integer :: size_work integer, intent(in) :: n_ if (n_ <= 0) return allocate(y(n_)) block integer :: work(size_work) y = 13 end block end function diff_1_int32 program block_08 integer, allocatable :: x(:) interface function diff_1_int32(n_) result(y) integer, allocatable :: y(:) integer, intent(in) :: n_ end function diff_1_int32 end interface allocate(x(10)) x = diff_1_int32(10) print *, x if (any(x /= 13)) error stop end program lfortran-0.63.0/integration_tests/minpack_03.f900000664000175000017500000000074215174404631021634 0ustar alastairalastairprogram minpack_03 implicit none integer,dimension(2),parameter :: info_original = [1,1] integer :: ic ic = 1 call compare_solutions(ic) contains subroutine compare_solutions(ic) implicit none integer :: ic if ( info_original(1) /= 1 ) error stop if ( info_original(2) /= 1 ) error stop if ( size(info_original) /= 2 ) error stop print *, info_original(ic) end subroutine compare_solutions end program minpack_03 lfortran-0.63.0/integration_tests/functions_26.f900000664000175000017500000000064715174404631022233 0ustar alastairalastairmodule functions_26_mod type tt contains procedure :: eee end type tt contains function eee(self) result(arr) class(tt) :: self integer, allocatable :: arr(:) allocate(arr(3)) arr = [1,2,3] end function end module functions_26_mod program functions_26 use functions_26_mod type(tt) :: sstruct print *, sstruct%eee() end program functions_26lfortran-0.63.0/integration_tests/allocate_03.f900000664000175000017500000000163215174404631021775 0ustar alastairalastairprogram allocate_03 implicit none integer, allocatable :: c(:, :, :) integer :: r integer :: stat stat = 1 allocate(c(3, 3, 3), STAT=stat) if (stat /= 0) error stop c(1, 1, 1) = 3 call h(c) r = g(c) if( c(1, 1, 1) /= 8 ) error stop print *, c(1, 1, 1) contains subroutine f(c) integer, allocatable, intent(out) :: c(:, :, :) allocate(c(3, 3, 3)) c(1, 1, 1) = 99 end subroutine function g(x) result(r) integer, allocatable :: x(:, :, :) integer :: r print *, x(1, 1, 1) if( x(1, 1, 1) /= 8 ) error stop call f(x) print *, x(1, 1, 1) if( x(1, 1, 1) /= 99 ) error stop x(1, 1, 1) = 8 r = 0 end function subroutine h(c) integer, allocatable, intent(out) :: c(:, :, :) if( allocated(c) ) error stop call f(c) print *, c(1, 1, 1) if( c(1, 1, 1) /= 99 ) error stop c(1, 1, 1) = 8 end subroutine end program lfortran-0.63.0/integration_tests/derived_types_22.f900000664000175000017500000000115115174404631023054 0ustar alastairalastairmodule derived_types_22_file_common_block_sample type :: sample real :: A, B, E end type type(sample) :: struct_instance_sample end module subroutine pass() use derived_types_22_file_common_block_sample print *, struct_instance_sample%A, struct_instance_sample%B if (abs(struct_instance_sample%A - 10.0) > 1.0e-7) error stop if (abs(struct_instance_sample%B - 20.0) > 1.0e-7) error stop end subroutine program derived_types_22 use derived_types_22_file_common_block_sample struct_instance_sample%A = 10.0 struct_instance_sample%B = 20.0 call pass() end program lfortran-0.63.0/integration_tests/complex_15.f900000664000175000017500000000023315174404631021657 0ustar alastairalastairprogram complex_15 implicit none complex(8) :: k, z k = (3, -4) z = -k print *, k, z if (abs(z) == k) error stop if (z /= (-3, 4)) error stop end program lfortran-0.63.0/integration_tests/types_12.f900000664000175000017500000000044115174404631021352 0ustar alastairalastairprogram types_12 use iso_c_binding, only: c_int, c_double implicit none interface integer(c_int) function f(a, b) result(r) import :: c_int, c_double integer(c_int), value, intent(in) :: a real(c_double), value, intent(in) :: b end function end interface end program lfortran-0.63.0/integration_tests/intrinsics_146.f900000664000175000017500000000154115174404631022465 0ustar alastairalastairprogram intrinsic_146 real :: a, b, c double precision :: result a = 5.2 b = 3.2 c = -4.1 result = dprod(a,b) print *, result if (abs(result - (16.64)) > 1e-5) error stop result = dprod(a,c) print *, dprod(a,c) if (abs(result - (-21.32)) > 1e-5) error stop result = dprod(b,c) print *, result if (abs(result - (-13.12)) > 1e-5) error stop result = dprod(5.2,3.2) print *, result if (abs(result - (16.64)) > 1e-5) error stop result = dprod(5.2,-4.1) print *, result if (abs(result - (-21.32)) > 1e-5) error stop result = dprod(3.2,-4.1) print *, result if (abs(result - (-13.12)) > 1e-5) error stop print *, kind(dprod(a,b)) if (kind(dprod(a,b)) /= 8) error stop print *, kind(dprod(5.2, 3.2)) if (kind(dprod(5.2, 3.2)) /= 8) error stop end program lfortran-0.63.0/integration_tests/intrinsics_290.f900000664000175000017500000000403315174404631022464 0ustar alastairalastairprogram intrinsics_290 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(dp) :: a real(sp) :: d integer :: i real(dp) :: log_runtime_dp(3) = [0.875_dp, 3.367_dp, 2.140_dp] real(sp) :: log_runtime_sp(3) = [0.875, 3.367, 2.140] real(dp) :: log_res_dp(3) real(sp) :: log_res_sp(3) real(dp) :: expected_dp(3) = [-5.7991946977686754E-002_dp, 0.52724311638808863_dp, 0.33041377334919086_dp] real(sp) :: expected_sp(3) = [-5.79919480E-02_sp, 0.527243137_sp, 0.330413789] real(dp), parameter :: res(3) = log10([0.875_dp, 3.367_dp, 2.140_dp]) real(sp), parameter :: res_sp(3) = log10([0.875, 3.367, 2.140]) do i = 1, 3 print *, res(i) if (abs(res(i) - expected_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, res_sp(i) if (abs(res_sp(i) - expected_sp(i)) > 1e-5) error stop end do log_res_dp = log10(log_runtime_dp) log_res_sp = log10(log_runtime_sp) do i = 1, 3 print *, log_res_dp(i) if (abs(log_res_dp(i) - expected_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, log_res_sp(i) if (abs(log_res_sp(i) - expected_sp(i)) > 1e-5) error stop end do a = log10(10.92839272_dp) d = log10(10.92839272) print *, a if (a - 1.03855629331626087e+00_dp > 1e-12_dp) error stop print *,log10(10.92839272_dp) if (log10(10.92839272_dp) - 1.03855629331626087e+00_dp > 1e-12_dp) error stop print *, d if (d - 1.03855634e+00_sp > 1e-5) error stop print *, log10(10.92839272) if (log10(10.92839272) - 1.03855634e+00_sp > 1e-5) error stop a = log10(83.728927_dp) d = log10(31.738222) print *, a if (a - 1.92287552568858744e+00_dp > 1e-12_dp) error stop print *,log10(83.728927_dp) if (log10(83.728927_dp) - 1.92287552568858744e+00_dp > 1e-12_dp) error stop print *, d if (d - 1.50158262e+00_sp > 1e-5) error stop print *, log10(31.738222) if (log10(31.738222) - 1.50158262e+00_sp > 1e-5) error stop end program lfortran-0.63.0/integration_tests/array_bound_4.f900000664000175000017500000000025415174404631022436 0ustar alastairalastairprogram array_bound_4 integer :: x(-10:-5) if (lbound(x, 1) /= -10) error stop if (ubound(x, 1) /= -5) error stop if (size(x) /= 6) error stop end program lfortran-0.63.0/integration_tests/bindc_46.f900000664000175000017500000000202315174404631021272 0ustar alastairalastairprogram bindc_46 implicit none type, bind(c) :: t integer :: x end type type :: container type(t) :: field end type abstract interface subroutine iface(a) bind(C) import :: t type(t), value, intent(in) :: a end subroutine end interface procedure(iface), pointer :: f type(t) :: v type(container) :: obj ! Test 1: direct call with local variable v%x = 42 call sub(v) ! Test 2: call through procedure pointer f => sub v%x = 99 call f(v) ! Test 3: pass struct member obj%field%x = 7 call sub(obj%field) ! Test 4: struct member through procedure pointer obj%field%x = 123 call f(obj%field) print *, "ok" contains subroutine sub(a) bind(C) type(t), value, intent(in) :: a select case (a%x) case (42) if (a%x /= 42) error stop case (99) if (a%x /= 99) error stop case (7) if (a%x /= 7) error stop case (123) if (a%x /= 123) error stop case default error stop end select end subroutine end program lfortran-0.63.0/integration_tests/format_05.f900000664000175000017500000000050615174404631021502 0ustar alastairalastairprogram format_05 real :: a,b,c,d character(100) :: s a = 123.456 b = 123.45678 c = 12.34 d = 123.45 print '(-1pe10.2,-2pe15.6,1pe010.2,2x,1pe9.2,f10.3)', -a, b, -c, d, d write (s, '(-1pe10.2,-2pe15.6,1pe010.2,2x,1pe9.2)') -a, b, -c, d if (trim(s) /= " -0.01E+04 0.001235E+05 -1.23E+01 1.23E+02") error stop end program lfortran-0.63.0/integration_tests/separate_compilation_13.f900000664000175000017500000000031015174404631024404 0ustar alastairalastairprogram separate_compilation_13 use ieee_arithmetic, only: ieee_quiet_nan use separate_compilation_13a_module real :: x call check(x) print *, x if (abs(x - 151.15981) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/complex_21.f900000664000175000017500000000031015174404631021650 0ustar alastairalastairprogram complex_21 implicit none complex :: a = (1.0, 2.0) complex(8) :: b = (1.0_8, 2.0_8) if (cmplx(a, kind=8) /= b) error stop if (cmplx(b, kind=4) /= a) error stop end programlfortran-0.63.0/integration_tests/separate_compilation_25b.f900000664000175000017500000000051515174404631024560 0ustar alastairalastairsubmodule (linalg_separate_compilation_25) linalg_diag_separate_compilation_25 implicit none contains module function diag_real(A) result(res) real, intent(in) :: A(:,:) real :: res(minval(shape(A))) integer :: i do i = 1, minval(shape(A)) res(i) = A(i,i) end do end function diag_real end submodulelfortran-0.63.0/integration_tests/intrinsics_397.f900000664000175000017500000000272715174404631022504 0ustar alastairalastairprogram intrinsics_397 implicit none integer, parameter :: lk1 = selected_logical_kind(1) integer, parameter :: lk8 = selected_logical_kind(8) integer, parameter :: lk16 = selected_logical_kind(16) integer, parameter :: lk32 = selected_logical_kind(32) integer, parameter :: lk64 = selected_logical_kind(64) integer, parameter :: lk128 = selected_logical_kind(128) integer, parameter :: lk256 = selected_logical_kind(256) ! Test with variables integer :: bits integer :: kind_result ! Check parameter evaluations if (lk1 /= 1) error stop if (lk8 /= 1) error stop if (lk16 /= 2) error stop if (lk32 /= 4) error stop if (lk64 /= 8) error stop if (lk128 /= 16) error stop if (lk256 /= -1) error stop ! Not supported ! Test with runtime values bits = 4 kind_result = selected_logical_kind(bits) if (kind_result /= 1) error stop bits = 16 kind_result = selected_logical_kind(bits) if (kind_result /= 2) error stop bits = 24 kind_result = selected_logical_kind(bits) if (kind_result /= 4) error stop bits = 48 kind_result = selected_logical_kind(bits) if (kind_result /= 8) error stop bits = 100 kind_result = selected_logical_kind(bits) if (kind_result /= 16) error stop bits = 200 kind_result = selected_logical_kind(bits) if (kind_result /= -1) error stop ! Not supported end program intrinsics_397 lfortran-0.63.0/integration_tests/formatted_read_04.f900000664000175000017500000000110315174404631023163 0ustar alastairalastairprogram read_68 implicit none integer :: ios character(len=100) :: iomsg character(len=100) :: s complex :: d(3) s = "1.0 2.0 3.0 4.0 5.0 6.0" read (s, '(6F4.1)', iostat=ios, iomsg=iomsg) d(:) if (ios /= 0) then print *, trim(iomsg) error stop "read_68 iostat" end if if (d(1) /= (1.0, 2.0)) error stop "read_68 mismatch 1" if (d(2) /= (3.0, 4.0)) error stop "read_68 mismatch 2" if (d(3) /= (5.0, 6.0)) error stop "read_68 mismatch 3" print *, "read_68 passed" end program read_68 lfortran-0.63.0/integration_tests/associate_37.f900000664000175000017500000000323415174404631022173 0ustar alastairalastair! Test: type-bound procedure call on associate variable whose selector is ! a function call that takes a procedure-pointer argument from the parent ! scope. Regression test for a compile-time segfault (null `tmp` in ! convert_call_args) caused by NestedVarVisitor not traversing ! AssociateBlockCall bodies. module associate_37_mod implicit none abstract interface pure function init_i(x) result(f) double precision, intent(in) :: x(:) double precision, allocatable :: f(:) end function end interface type :: t double precision, allocatable :: v(:) contains procedure :: get_v end type contains pure function get_v(self) result(r) class(t), intent(in) :: self double precision, allocatable :: r(:) r = self%v end function function make_t(init) result(res) procedure(init_i), pointer, intent(in) :: init type(t) :: res res%v = init([1d0, 2d0, 3d0]) end function pure function id(x) result(f) double precision, intent(in) :: x(:) double precision, allocatable :: f(:) f = x end function end module program associate_37 use associate_37_mod implicit none procedure(init_i), pointer :: f double precision, allocatable :: r(:) f => id call run() contains subroutine run() associate(s => make_t(f)) r = s%get_v() end associate print *, r if (size(r) /= 3) error stop if (abs(r(1) - 1d0) > 1d-12) error stop if (abs(r(2) - 2d0) > 1d-12) error stop if (abs(r(3) - 3d0) > 1d-12) error stop end subroutine end program lfortran-0.63.0/integration_tests/block_03.f900000664000175000017500000000054215174404631021302 0ustar alastairalastairprogram block_02 integer :: a a = 10 1 loop: block integer :: b a = a + 5 if (a == 15) go to 1 b = a / 2 call square(b) end block loop end program block_02 subroutine square(b) integer :: b, result result = b * b if (result /= 100) error stop print *, result end subroutine square lfortran-0.63.0/integration_tests/modules_21.f900000664000175000017500000000005715174404631021661 0ustar alastairalastairprogram modules_21 use modules_21b end program lfortran-0.63.0/integration_tests/write_03.f900000664000175000017500000000041715174404631021343 0ustar alastairalastairsubroutine dvout() implicit none character(80) line integer ifmt, lll ifmt = 10 lll = 15 line = "1234567890123456789001234567890" write( *, fmt = 9999 ) ifmt, line( 1: lll ) 9999 format( i0, / a ) end subroutine program write_03 implicit none call dvout() end program lfortran-0.63.0/integration_tests/character_07.f900000664000175000017500000000041715174404631022151 0ustar alastairalastairprogram test_char_len implicit none character(len=10) :: str1 character(10) :: str2 str1 = "Hello" str2 = "World" print *, "str1 = ", str1, ", length = ", len(str1) print *, "str2 = ", str2, ", length = ", len(str2) end program test_char_len lfortran-0.63.0/integration_tests/modules_52_module2.f900000664000175000017500000000024615174404631023314 0ustar alastairalastairmodule module_52_tomlf_type implicit none type :: toml_table logical :: implicit = .false. logical :: inline = .false. end type toml_table end module lfortran-0.63.0/integration_tests/namelist_25.f900000664000175000017500000000200615174404631022025 0ustar alastairalastairprogram namelist_internal_read_array implicit none integer :: a, b, c real :: x character(len=20) :: name character(len=256) :: readme(7) namelist /EXPECTED/ a, b, name, x, c ! Initialize with default values a = 0 b = 0 c = 0 x = 0.0 name = '' ! Build the namelist input readme(1) = '&EXPECTED' readme(2) = ' a = 42' readme(3) = ' b = 100' readme(4) = ' name = "Hello"' readme(5) = ' x = 3.14' readme(6) = ' c = -7' readme(7) = '/' read(readme, nml=EXPECTED) if (a /= 42) error stop "a has wrong value" if (b /= 100) error stop "b has wrong value" if (c /= -7) error stop "c has wrong value" if (abs(x - 3.14) > 1.0e-5) error stop "x has wrong value" if (trim(name) /= "Hello") error stop "name has wrong value" print *, 'a =', a print *, 'b =', b print *, 'c =', c print *, 'x =', x print *, 'name = "' // trim(name) // '"' print *, 'All tests passed!' end program namelist_internal_read_array lfortran-0.63.0/integration_tests/transfer_22.f900000664000175000017500000000122115174404631022030 0ustar alastairalastairprogram transfer_22 use iso_fortran_env, only: int8, int64 implicit none integer(int8), allocatable :: arr1(:) integer(int8), allocatable :: arr2(:) integer(int8) :: mold(1) ! transfer array of int32 to array of int8 (array literal mold) arr1 = transfer([1, 2], [0_int8]) if (size(arr1) /= 8) error stop print *, size(arr1) ! transfer array of int64 to array of int8 (array literal mold) arr2 = transfer([0_int64, 1_int64], [0_int8]) if (size(arr2) /= 16) error stop print *, size(arr2) ! transfer array of int32 to array of int8 (variable mold) mold(1) = 0 arr1 = transfer([3, 4], mold) if (size(arr1) /= 8) error stop print *, size(arr1) end program lfortran-0.63.0/integration_tests/file_07_data.dat0000664000175000017500000000022415174404631022273 0ustar alastairalastairýÿÿÿ øÿÿÿñÿÿÿ þÿÿÿ\"@¤p¿{¶@{^Àš™A®çÀ ×Ã@Há’ÀR¸AffÀHáz?…£À¤pm@HáÚÀffæ@= ·¿Ãõ@¸ Áö(”@…ëÁR¸Þ?š™Y¿ffÞ@33óÀlfortran-0.63.0/integration_tests/allocate_13.f900000664000175000017500000000130215174404631021770 0ustar alastairalastairmodule allocate_13_module implicit none private public :: toml_value type :: toml_value integer, allocatable :: a(:) contains procedure :: value_proc end type toml_value contains subroutine value_proc(self) class(toml_value), intent(inout) :: self allocate(self%a(2)) deallocate(self%a) end subroutine value_proc end module allocate_13_module program allocate_13_program use allocate_13_module implicit none type(toml_value) :: tv allocate(tv%a(4)) deallocate(tv%a) if (allocated(tv%a)) error stop call tv%value_proc if (allocated(tv%a)) error stop print *, "ok" end program allocate_13_program lfortran-0.63.0/integration_tests/select_rank_17.f900000664000175000017500000000250115174404631022504 0ustar alastairalastair! Test that subroutine calls inside select rank correctly track dependencies. ! Regression test: a subroutine's dependency list must include siblings called ! from inside a select rank construct (bug: asr_owner not set before transform_stmts). module select_rank_17_mod implicit none contains subroutine process_rank(x, result) integer, intent(in) :: x(..) integer, intent(out) :: result select rank (v => x) rank (1) call compute_1d(v, result) rank (2) call compute_2d(v, result) rank default result = -1 end select end subroutine process_rank subroutine compute_1d(x, result) integer, intent(in) :: x(:) integer, intent(out) :: result result = sum(x) end subroutine compute_1d subroutine compute_2d(x, result) integer, intent(in) :: x(:,:) integer, intent(out) :: result result = sum(x) end subroutine compute_2d end module select_rank_17_mod program select_rank_17 use select_rank_17_mod implicit none integer :: a(4), b(2,2), r a = [1, 2, 3, 4] call process_rank(a, r) if (r /= 10) error stop b = reshape([1, 2, 3, 4], [2, 2]) call process_rank(b, r) if (r /= 10) error stop end program select_rank_17 lfortran-0.63.0/integration_tests/functions_36.f900000664000175000017500000000206015174404631022223 0ustar alastairalastair ! Test circular dependencies when declaring interface and using it in the function constructing that same interface module functions_36_mod real :: var interface generic !>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Depends on both `f1` and `f2` to be declared procedure :: f1 procedure :: f2 end interface contains pure function f1(vv) result(length) real, intent(in) :: vv integer :: rr(generic(vv, 2)) !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Depends on `f2` (but through interface) to be fully declared integer :: length length = size(rr) end function pure function f2(rr, int) result(length) real, intent(in) :: rr integer, intent(in) :: int integer :: length length = int*2 end function subroutine maybe() character(10) :: string(generic(var)) print *, size(string) if (size(string) /= 4) error stop end subroutine maybe end module program functions_36 use functions_36_mod var =1.5 call maybe() end program lfortran-0.63.0/integration_tests/intrinsics_260.f900000664000175000017500000000511015174404631022456 0ustar alastairalastairprogram intrinsics_260 implicit none integer(4), parameter :: i1 = sum([1, 2, 3]) real(4), parameter :: i2 = sum([1.0, 2.0, 3.0]) complex(4), parameter :: i3 = sum([(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)]) integer(8), parameter :: i4 = sum([1, 2, 3], [.true., .true., .true.]) real(8), parameter :: i5 = sum([1.5_8, 22.9_8, 3.0_8], mask = [.true., .false., .true.]) complex(8), parameter :: i6 = sum([(1.5_8, 2.2_8), (22.9_8, 1.4_8), (3.0_8, 1.1_8)], mask = [.true., .false., .true.]) integer(4), parameter :: i7 = sum([11, 2, 5], 1, [.true., .false., .true.]) real(4), parameter :: i8 = sum([1.0, 3.0, 55.9], mask = [.true., .false., .true.], dim = 1) complex(4), parameter :: i9 = sum([(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)], dim = 1, mask = [.true., .false., .true.]) integer(4) :: ar1(4) = [1, 2, 7, 9] real(4) :: ar2(4) = [1.0, 3.1, 7.2, 9.0] complex(4) :: ar3(4) = [(1.0, 2.0), (3.0, 4.0), (5.0, 6.0), (7.0, 8.0)] logical(4) :: mask(4) = [.true., .false., .true., .true.] integer(4) :: dim = 1 print *, i1 if (i1 /= 6) error stop print *, i2 if (abs(i2 - 6.0) > 1e-6) error stop print *, i3 if (abs(i3 - (9.0, 12.0)) > 1e-6) error stop print *, i4 if (i4 /= 6) error stop print *, i5 if (abs(i5 - 4.5_8) > 1e-12) error stop print *, i6 if (abs(i6 - (4.5000000000000000, 3.3000000000000003)) > 1e-6) error stop print *, i7 if (i7 /= 16) error stop print *, i8 if (abs(i8 - 5.69000015e+01) > 1e-6) error stop print *, i9 if (abs(i9 - (6.0, 8.0)) > 1e-6) error stop print *, sum(ar1) if (sum(ar1) /= 19) error stop print *, sum(ar2) if (abs(sum(ar2) - 20.3) >1e-6 ) error stop print *, sum(ar3) if (abs(sum(ar3) - (16.0, 20.0)) > 1e-6) error stop print *, sum(ar1, mask = mask) if (sum(ar1, mask = mask) /= 17) error stop print *, sum(ar2, mask) if (abs(sum(ar2, mask) - 17.2) > 1e-6) error stop print *, sum(ar3, mask = mask) if (abs(sum(ar3, mask = mask) - (13.0, 16.0)) > 1e-6) error stop print *, sum(ar1, dim) if (sum(ar1, dim) /= 19) error stop print *, sum(ar2, dim = dim) if (abs(sum(ar2, dim = dim) - 20.3) > 1e-6) error stop print *, sum(ar3, dim) if (abs(sum(ar3, dim) - (16.0, 20.0)) > 1e-6) error stop print *, sum(ar1, mask = mask, dim = dim) if (sum(ar1, mask = mask, dim = dim) /= 17) error stop print *, sum(ar2, dim, mask) if (abs(sum(ar2, dim, mask) - 17.2) > 1e-6) error stop print *, sum(ar3, mask = mask, dim = dim) if (abs(sum(ar3, mask = mask, dim = dim) - (13.0, 16.0)) > 1e-6) error stop end programlfortran-0.63.0/integration_tests/flip_sign.f900000664000175000017500000000050115174404631021653 0ustar alastairalastairprogram flip_sign implicit none integer :: number real :: x, eps = 1e-6 number = 123 x = 5.5 if (modulo(number, 2) == 1 ) x = -x if (abs(x - (-5.5)) > eps) error stop number = 124 x = 5.5 if (modulo(number, 2) == 1 ) x = -x if (abs(x - (5.5)) > eps) error stop end program lfortran-0.63.0/integration_tests/dealloc_05.f900000664000175000017500000000074115174404631021616 0ustar alastairalastairprogram dealloc_05 implicit none type :: base integer :: x end type type, extends(base) :: derived real :: r end type class(base), allocatable :: var allocate(derived :: var) select type(var) type is (derived) class default error stop end select deallocate(var) select type(var) type is (base) class default error stop end select end program dealloc_05 lfortran-0.63.0/integration_tests/allocate_19.f900000664000175000017500000000065515174404631022010 0ustar alastairalastairprogram allocate_19 integer, allocatable :: a(:), b(:), c(:), d(:) a = [1, 2, 3, 4, 5, 6] allocate(b(6), source = a) print *, b print *, size(b) if( any( b /= [1, 2, 3, 4, 5, 6] ) ) error stop if( size(b) /= 6 ) error stop c = [6, 5, 4] allocate(d(3), source = c) print *, d print *, size(d) if( any( d /= [6, 5, 4] ) ) error stop if( size(d) /= 3 ) error stop end program lfortran-0.63.0/integration_tests/class_46.f900000664000175000017500000000142515174404631021325 0ustar alastairalastairmodule class_46_mod type :: SomeType contains procedure :: method1 procedure :: method2 end type SomeType contains subroutine method1(self, arr) class(SomeType), intent(in) :: self integer, intent(in) :: arr(:) integer, allocatable :: local(:) local = self%method2(arr) print *, "local: ", local if (.not. all(local == [1, 2, 3])) error stop end subroutine method1 function method2(self, a) result(out) class(SomeType), intent(in) :: self integer, intent(in) :: a(:) integer :: out(size(a)) out = a end function method2 end module class_46_mod program class_46 use class_46_mod type(SomeType) :: obj integer :: arr(3) = [1, 2, 3] call obj%method1(arr) end program class_46 lfortran-0.63.0/integration_tests/arrays_33.f900000664000175000017500000000103615174404631021513 0ustar alastairalastairprogram arrays_33 implicit none type d real(8), dimension(:), pointer :: r end type type(d) :: objd real(8), target :: array(10) array = 24.0 call f(array, objd) objd%r => array ! TODO: Remove array = 25.0 print *, objd%r if( any(objd%r /= 25.0) ) error stop contains subroutine f(array, objd) real(8), intent(out), target :: array(:) type(d), intent(out) :: objd real(8), target :: array1(size(array)) objd%r => array1 array1 = array if( any(objd%r /= 24.0) ) error stop ! objd%r => array TODO: Uncomment end subroutine end program lfortran-0.63.0/integration_tests/modules_66_worker.f900000664000175000017500000000064415174404631023265 0ustar alastairalastairmodule modules_66_worker use modules_66_base, only: container_t implicit none contains function extract_int(c) result(res) type(container_t), intent(in) :: c integer :: res res = -1 select type (x => c%item) type is (integer) res = x class default res = 0 end select end function extract_int end module modules_66_worker lfortran-0.63.0/integration_tests/separate_compilation_01b.f900000664000175000017500000000065015174404631024552 0ustar alastairalastairmodule separate_compilation_01_module implicit none real :: val contains subroutine set_val(x) real :: x val = x print *, "value of val is set to ", val end subroutine set_val subroutine get_val(x) real, intent(out) :: x x = val end subroutine get_val subroutine test_val(x) real :: x print *, "testing val" print *, "val = ", val print *, "x = ", x if (abs(val - x) > 1e-8) error stop end subroutine test_val end module lfortran-0.63.0/integration_tests/functions_01.f900000664000175000017500000000070315174404631022215 0ustar alastairalastairprogram functions_01 implicit none integer :: i, j i = 1 j = 1 if (j /= 1) error stop j = f(i) if (i /= 1) error stop if (j /= 2) error stop j = 1 if (j /= 1) error stop j = f(3) if (j /= 4) error stop j = 1 if (j /= 1) error stop j = f(1+2) if (j /= 4) error stop j = 1 if (j /= 1) error stop j = f(i+2) if (j /= 4) error stop contains integer function f(a) result(b) integer, intent(in) :: a b = a + 1 end function end program lfortran-0.63.0/integration_tests/verify_intent_external_01_mod1.f900000664000175000017500000000016015174404631025711 0ustar alastairalastairmodule data_mod implicit none integer :: global_count real :: global_values(10) end module data_mod lfortran-0.63.0/integration_tests/bindc6.f900000664000175000017500000000102615174404631021051 0ustar alastairalastairprogram bindc6 use iso_c_binding, only: c_double implicit none real(c_double) :: arr(3) real(c_double) :: result interface function sum_arr(a, n) bind(c) import :: c_double real(c_double), intent(in) :: a(*) integer, value :: n real(c_double) :: sum_arr end function end interface arr = [1.0d0, 2.0d0, 3.0d0] result = sum_arr(arr, 3) if (abs(result - 6.0d0) > 1.0d-10) error stop "sum should be 6.0" print *, "PASS" end program lfortran-0.63.0/integration_tests/case_08.f900000664000175000017500000000123415174404631021127 0ustar alastairalastairprogram case_08 implicit none character(len=100) :: line character :: ch line = "-5" if (len_trim(line) < 2) then print *, "Error: Input line is too short: '", trim(line), "'" error stop end if ch = line(2:2) if (iachar(ch) < 32 .or. iachar(ch) > 126) then print *, "Error: Second character is non-printable (char code:", iachar(ch), ")" error stop end if select case (ch) case ("-", "0":"9") print *, "Second character is a '-' or a digit: ", ch case default print *, "Error: Unexpected second character: ", ch error stop end select end program case_08 lfortran-0.63.0/integration_tests/intrinsics_114.f900000664000175000017500000000047115174404631022461 0ustar alastairalastairprogram intrinsics_114 real(4) x4 real(8) x8 x4 = 1.234E0_4 x8 = 4.321_8 print *, aint( a = x4, kind = 8 ) if ( .not. aint( a = x8, kind = 4 ) == 4 ) error stop if ( .not. aint( x8, kind = 4 ) == 4 ) error stop if ( .not. aint( x8, 4 ) == 4 ) error stop end program intrinsics_114 lfortran-0.63.0/integration_tests/allocate_15.f900000664000175000017500000000043415174404631021777 0ustar alastairalastairprogram allocate_15 implicit none integer, allocatable :: x(:), y(:), z(:) allocate(x(3), y(3)) allocate(z(size(x+y) - 1)) if (size(z) /= 2) error stop deallocate(z) allocate(z(1 + size(x+y))) if (size(z) /= 4) error stop deallocate(z) end program lfortran-0.63.0/integration_tests/arrays_01_size.f900000664000175000017500000000130115174404631022533 0ustar alastairalastairprogram arrays_01 implicit none integer :: i, a(3), b(4) integer :: size_a integer :: size_b size_a = size(a, kind=4) size_b = size(b, dim=1, kind=4) if (size_a /= 3) error stop if (size_b /= 4) error stop do i = 1, size_a a(i) = i+10 end do if (a(1) /= 11) error stop if (a(2) /= 12) error stop if (a(3) /= 13) error stop do i = 11, 10 + size_b b(i-10) = i end do if (b(1) /= 11) error stop if (b(2) /= 12) error stop if (b(3) /= 13) error stop if (b(4) /= 14) error stop do i = 1, size_a b(i) = a(i)-10 end do if (b(1) /= 1) error stop if (b(2) /= 2) error stop if (b(3) /= 3) error stop b(4) = b(1)+b(2)+b(3)+a(1) if (b(4) /= 17) error stop b(4) = a(1) if (b(4) /= 11) error stop end lfortran-0.63.0/integration_tests/legacy_array_sections_03.f900000664000175000017500000000070615174404631024563 0ustar alastairalastairDOUBLE PRECISION FUNCTION ddot_sl(dx) DOUBLE PRECISION dx(*) integer :: i do i = 1, 4 if (abs(dx(i) - 12.41d0) > 1e-10) error stop end do ddot_sl = dx(1) END SUBROUTINE slsqpb (n, a) INTEGER n external ddot_sl DOUBLE PRECISION a(n+1), ddot_sl, res print *, a res = ddot_sl(a(1)) print *, res if (abs(res - 12.41d0) > 1e-10) error stop END program legacy_array_sections_03 double precision a(5) a = 12.41d0 call slsqpb(4, a) end program lfortran-0.63.0/integration_tests/submodule_32.f900000664000175000017500000000152415174404631022212 0ustar alastairalastairmodule mod_submodule_32 use iso_c_binding, only: c_int, c_ptr, c_f_pointer implicit none type :: team_t integer(c_int) :: num_images end type type :: event_t integer(c_int) :: counter = 0 end type type(team_t), target :: initial_team type(event_t), pointer :: si_evt(:) interface module subroutine sync_init() end subroutine end interface end module submodule(mod_submodule_32) private_s implicit none contains module procedure sync_init type(c_ptr) :: ptr associate(n => initial_team%num_images) call c_f_pointer(ptr, si_evt, [n]) end associate end procedure end submodule program test_submodule_32 use mod_submodule_32, only: initial_team implicit none initial_team%num_images = 5 print *, "ok" end program lfortran-0.63.0/integration_tests/bindc_02b.f900000664000175000017500000000317415174404631021434 0ustar alastairalastairmodule bindc_02b use iso_c_binding, only: c_ptr, c_int implicit none interface ! void driver(); subroutine driver() bind(c) end subroutine ! void print_ptr1(int n, float *A); subroutine print_ptr1(n, A) bind(c) import :: c_ptr, c_int integer(c_int), value, intent(in) :: n type(c_ptr), value, intent(in) :: A end subroutine ! void print_ptr2(int *n, float *A); subroutine print_ptr2(n, A) bind(c) import :: c_ptr, c_int integer(c_int), intent(in) :: n type(c_ptr), value, intent(in) :: A end subroutine end interface contains ! void callback1(int n, float *A); subroutine callback1(n, A) bind(c) integer(c_int), value, intent(in) :: n type(c_ptr), value, intent(in) :: A print *, "callback1: calling print_ptr1(n, A), n =", n call print_ptr1(n, A) end subroutine ! void callback1b(int n, float *A); subroutine callback1b(n, A) bind(c) integer(c_int), value, intent(in) :: n type(c_ptr), value, intent(in) :: A print *, "callback1b: calling print_ptr2(n, A), n =", n call print_ptr2(n, A) end subroutine ! void callback2(int *n, float *A); subroutine callback2(n, A) bind(c) integer(c_int), intent(in) :: n type(c_ptr), value, intent(in) :: A print *, "callback2: calling print_ptr2(n, A), n =", n call print_ptr2(n, A) end subroutine ! void callback2b(int *n, float *A); subroutine callback2b(n, A) bind(c) integer(c_int), intent(in) :: n type(c_ptr), value, intent(in) :: A print *, "callback2b: calling print_ptr1(n, A), n =", n call print_ptr1(n, A) end subroutine end module lfortran-0.63.0/integration_tests/realloc_lhs_18.f900000664000175000017500000000031415174404631022502 0ustar alastairalastairprogram test integer, allocatable :: nz(:) integer :: maxnz(1), mx nz = [480,120,1] where (nz > 1) maxnz = maxval(nz) end where mx = maxnz(1) print *, mx end program test lfortran-0.63.0/integration_tests/equivalence_08.f900000664000175000017500000000065215174404631022520 0ustar alastairalastairdouble precision function d1mach() integer small(2) double precision dmach(5) equivalence (dmach(1),small(1)) dmach = 1.3d0 if (small(1) /= -858993459) error stop if (small(2) /= 1073007820) error stop d1mach = 1.3d0 end function program equivalence_08 interface double precision function d1mach() end function end interface print *, d1mach() if (abs(d1mach() - 1.3d0) > 1e-10) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_55.f900000664000175000017500000000171415174404631022176 0ustar alastairalastairmodule gpu_metal_55_mod implicit none interface module subroutine learn(x) implicit none real, intent(inout) :: x(:) end subroutine end interface end module submodule(gpu_metal_55_mod) gpu_metal_55_s implicit none contains module procedure learn integer :: i associate(n => x) block real :: r(size(n)) do concurrent (i = 1:3) r(i) = real(i) * 2.0 end do do concurrent (i = 1:3) n(i) = r(i) + 1.0 end do end block end associate end procedure learn end submodule gpu_metal_55_s program gpu_metal_55 use gpu_metal_55_mod implicit none real :: arr(5) integer :: i arr = 0.0 call learn(arr) if (abs(arr(1) - 3.0) > 1.0e-6) error stop if (abs(arr(2) - 5.0) > 1.0e-6) error stop if (abs(arr(3) - 7.0) > 1.0e-6) error stop if (abs(arr(4) - 0.0) > 1.0e-6) error stop if (abs(arr(5) - 0.0) > 1.0e-6) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/associate_03.f900000664000175000017500000000057015174404631022164 0ustar alastairalastairprogram associate_03 implicit none integer, pointer :: p1 integer, target :: t1 = 2, t2 = 1 integer :: i print *, t1, t2 ! Runtime pointer association if (t1 > t2) then p1 => t1 else p1 => t2 end if print *, p1 ! Does not work yet: !if (p1 == t2) error stop i = p1 if (i == t2) error stop end program lfortran-0.63.0/integration_tests/implicit_typing_01.f900000664000175000017500000000041515174404631023411 0ustar alastairalastairprogram implicit_typing_01 implicit double precision (a-h,o-z) dimension :: dv(0:100) integer :: i do i = 0,100 dv(i) = i end do print *, dv(0:100) do i = 0,100 if (abs(dv(i)-i) > 1e-10) error stop end do end program lfortran-0.63.0/integration_tests/gpu_metal_95.f900000664000175000017500000000073415174404631022203 0ustar alastairalastairprogram gpu_metal_95 ! Accessing fixed-size array component of derived type inside do concurrent implicit none type :: t real :: v(2) end type type(t) :: a(2) real :: r(2, 2) integer :: i a(1) = t([1.0, 2.0]) a(2) = t([3.0, 4.0]) do concurrent (i = 1:2) r(:, i) = a(i)%v end do if (abs(r(1,1) - 1.0) > 1e-6) error stop if (abs(r(2,1) - 2.0) > 1e-6) error stop if (abs(r(1,2) - 3.0) > 1e-6) error stop if (abs(r(2,2) - 4.0) > 1e-6) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/interface_11.f900000664000175000017500000000573615174404631022161 0ustar alastairalastairmodule interface_11_m use, intrinsic :: iso_fortran_env, only : real64 implicit none public :: get_args interface get_args; module procedure get_scalar_i; end interface interface get_args; module procedure get_scalar_real; end interface interface get_args; module procedure get_scalar_d; end interface interface get_args; module procedure get_scalar_complex; end interface interface get_args; module procedure get_scalar_logical; end interface interface get_args; module procedure many_args; end interface contains !============================================================================ subroutine many_args(n, g) implicit none character(len=*), intent(in) :: n class(*), intent(out) :: g call get_generic(n, g) contains subroutine get_generic(name, generic) character(len=*), intent(in) :: name class(*), intent(out) :: generic select type(generic) type is (integer); call get_args(name, generic) type is (real); call get_args(name, generic) type is (real(kind=real64)); call get_args(name, generic) type is (logical); call get_args(name, generic) type is (complex); call get_args(name, generic) class default stop 'unknown type in *get_generic*' end select end subroutine get_generic end subroutine many_args !============================================================================ subroutine get_scalar_i(keyword, i) character(len=*), intent(in) :: keyword integer, intent(out) :: i end subroutine get_scalar_i !============================================================================ subroutine get_scalar_real(keyword, r) character(len=*), intent(in) :: keyword real, intent(out) :: r end subroutine get_scalar_real !============================================================================ subroutine get_scalar_d(keyword, d) character(len=*), intent(in) :: keyword real(kind=real64) :: d end subroutine get_scalar_d !============================================================================ subroutine get_scalar_complex(keyword, x) character(len=*), intent(in) :: keyword complex, intent(out) :: x end subroutine get_scalar_complex !============================================================================ subroutine get_scalar_logical(keyword, l) character(len=*), intent(in) :: keyword logical :: l end subroutine get_scalar_logical !============================================================================ end module interface_11_m program interface_11 use interface_11_m implicit none end program interface_11 lfortran-0.63.0/integration_tests/arithmetic_if_03.f900000664000175000017500000000145715174404631023025 0ustar alastairalastairprogram arithmetic_if_03 integer(8) :: x integer :: c ! Singleline x = -3 c = 0 if (x) 1, 2, 3 1 c = c + 1 2 c = c + 2 3 c = c + 4 print *, c if (c /= 7) error stop x = 0 c = 0 if (x) 4, 5, 6 4 c = c + 1 5 c = c + 2 6 c = c + 4 print *, c if (c /= 6) error stop x = 7 c = 0 if (x) 7, 8, 9 7 c = c + 1 8 c = c + 2 9 c = c + 4 print *, c if (c /= 4) error stop ! Multiline x = -3 c = 0 if (x) 11, 12, 13 11 c = c + 1 c = c + 100 12 c = c + 2 c = c + 200 13 c = c + 4 c = c + 400 print *, c if (c /= 707) error stop x = 0 c = 0 if (x) 14, 15, 16 14 c = c + 1 c = c + 100 15 c = c + 2 c = c + 200 16 c = c + 4 c = c + 400 print *, c if (c /= 606) error stop x = 7 c = 0 if (x) 17, 18, 19 17 c = c + 1 c = c + 100 18 c = c + 2 c = c + 200 19 c = c + 4 c = c + 400 print *, c if (c /= 404) error stop end program lfortran-0.63.0/integration_tests/modules_22.f900000664000175000017500000000007315174404631021660 0ustar alastairalastairprogram modules_22 use modules_22_module implicit none end lfortran-0.63.0/integration_tests/parameter_06.f900000664000175000017500000000053615174404631022176 0ustar alastairalastairprogram parameter_06 integer, parameter :: n = 2 complex :: sum real, parameter :: d(0 : n) = [2.48574089138753566e-5,1.05142378581721974, -3.45687097222016235] print *, d(0) if (abs(d(0) - 2.48574089138753566e-5) > 1e-6) error stop sum = cmplx(d(0), kind = 8) print *, sum if (abs(sum % re - 2.48574089138753566e-5) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/nested_05.f900000664000175000017500000000054015174404631021472 0ustar alastairalastairmodule nested_05_a implicit none contains subroutine b() integer :: x real :: y x = 6 y = 5.5 print *, x print *, y call c() print *, x print *, y contains subroutine c() print *, x print *, y x = 4 y = 3.5 end subroutine c end subroutine b end module program nested_05 use nested_05_a, only: b implicit none call b() end lfortran-0.63.0/integration_tests/class_60.f900000664000175000017500000000154315174404631021322 0ustar alastairalastairmodule class_60_mod implicit none type :: base_t end type type, extends(base_t) :: extended_t integer :: key end type type :: temp_t type(extended_t) :: child(2) end type contains subroutine call_describe(obj) class(base_t), intent(in) :: obj(:) class(base_t), allocatable :: obj_tmp allocate(obj_tmp) obj_tmp = obj(1) select type (obj_tmp) type is (extended_t) ! if (obj_tmp%key /= 10) error stop ! TODO: Handle array arg in convert_to_polymorphic in LLVM Backend class default error stop end select end subroutine end module class_60_mod program class_60 use class_60_mod interface describe module procedure :: call_describe end interface type(temp_t) :: x x%child(1) = extended_t(10) x%child(2) = extended_t(20) call describe(x%child) end program class_60lfortran-0.63.0/integration_tests/array_03.f900000664000175000017500000000116715174404631021332 0ustar alastairalastairprogram array_03 integer, parameter :: RP = kind(0.0D0) integer, parameter :: IK = kind(0) real(RP) :: G(2, 2) integer(IK) :: knew real(RP):: zmat(1:1, 1:1) knew = 1 zmat = reshape([1.0_RP], [1, 1]) G = planerot(zmat(knew, [1_IK, 1])) print *, G if (any(G /= reshape([1.0_RP, -1.0_RP, 1.0_RP, 1.0_RP], [2, 2]))) error stop contains function planerot(x) result(G) real(RP), intent(in) :: x(:) real(RP) :: c, s, r real(RP) :: G(2, 2) r = 1 s = 1 c = x(1) / r G = reshape([c, -s, s, c], [2, 2]) end function end program lfortran-0.63.0/integration_tests/max_02.f900000664000175000017500000000012615174404631020772 0ustar alastairalastairprogram max_02 integer(8) :: y integer :: z print *, max(y, z) end programlfortran-0.63.0/integration_tests/separate_compilation_39b.f900000664000175000017500000000026215174404631024564 0ustar alastairalastairsubmodule(separate_compilation_39a) separate_compilation_39b implicit none contains module procedure noop end procedure noop end submodule separate_compilation_39b lfortran-0.63.0/integration_tests/write_substr_01.f900000664000175000017500000000041215174404631022736 0ustar alastairalastairprogram write_substr_01 character(80) :: line write(line(1:3), '(I3)') 666 if (line(1:3) /= "666") then write(*, *) "Test Failed: Expected '666', got '", line(1:3), "'" error stop 1 end if write(*, '(A)') line(1:3) end program write_substr_01lfortran-0.63.0/integration_tests/submodule_21a.f900000664000175000017500000000040615174404631022347 0ustar alastairalastairprogram submodule_21a use submodule_21b_string_mod, only : string_t implicit none type(string_t) :: s s = "hello" if (s%string_ /= "hello") error stop s = s%file_extension() if (s%string_ /= "") error stop print *, "ok" end program submodule_21a lfortran-0.63.0/integration_tests/legacy_array_sections_13.f900000664000175000017500000000046515174404631024566 0ustar alastairalastairprogram legacy_array_sections_13 implicit none real :: work(20) work = 1.0 call process2d(work(5)) if (work(5) /= 99.0) error stop contains subroutine process2d(matrix) real, intent(inout) :: matrix(2, 2) matrix(1, 1) = 99.0 end subroutine process2d end program lfortran-0.63.0/integration_tests/cond_05.f900000664000175000017500000000155415174404631021141 0ustar alastairalastairprogram cond_05 implicit none logical, pointer :: ptr_bool1, ptr_bool2 logical, target :: bool_true, bool_false complex, pointer :: ptr_complex4 complex(8), pointer :: ptr_complex8 complex, target :: complex4_1, complex4_2 complex(8), target :: complex8_1 bool_true = .true. bool_false = .false. ptr_bool1 => bool_true if (ptr_bool1 .eqv. bool_false) error stop if (ptr_bool1 .neqv. bool_true) error stop if (.not. ptr_bool1 .eqv. ptr_bool1) error stop ptr_bool1 => bool_true ptr_bool2 => bool_true if (.not. ptr_bool1 .eqv. ptr_bool2) error stop complex4_1 = (1, 2) ptr_complex4 => complex4_1 complex4_2 = (2, 3) complex8_1 = complex4_1 if (ptr_complex4 == complex4_2) error stop if (ptr_complex4 /= complex8_1) error stop if (.not. ptr_complex4 == (complex4_2 - (1,1))) error stop end program cond_05 lfortran-0.63.0/integration_tests/implicit_typing_03.f900000664000175000017500000000064115174404631023414 0ustar alastairalastairmodule implicit_typing_03_first parameter (x=90) end module implicit_typing_03_first module implicit_typing_03_second use implicit_typing_03_first, only: x contains subroutine print_x print *, x if (abs(x - 90.0) > 1e-8) error stop end subroutine print_x end module implicit_typing_03_second program implicit_typing_03 use implicit_typing_03_second call print_x() end program implicit_typing_03 lfortran-0.63.0/integration_tests/submodule_37a.f900000664000175000017500000000110215174404631022350 0ustar alastairalastairprogram submodule_37 use submodule_37_mod, only: mytype implicit none type(mytype) :: t integer, allocatable :: arr(:) real, allocatable :: rarr(:) t = mytype("1.0 2.0 3.0") rarr = t%get(mold=[0.]) if (size(rarr) /= 3) error stop if (abs(rarr(1) - 1.0) > 1e-5) error stop if (abs(rarr(2) - 2.0) > 1e-5) error stop if (abs(rarr(3) - 3.0) > 1e-5) error stop arr = t%get(mold=[integer::]) if (size(arr) /= 3) error stop if (arr(1) /= 1) error stop if (arr(2) /= 2) error stop if (arr(3) /= 3) error stop print *, "ok" end program submodule_37 lfortran-0.63.0/integration_tests/select_rank_16.f900000664000175000017500000000310315174404631022502 0ustar alastairalastair! Test reshape of array passed directly to function inside select rank module select_rank_16_mod implicit none type :: my_type integer :: val end type contains pure function helper(arr) result(r) type(my_type), intent(in) :: arr(:) type(my_type) :: r r = arr(1) end function function foo(x) result(res) type(my_type), intent(in) :: x(..) type(my_type) :: res select rank(x) rank(2) res = foo_helper(reshape(x, shape=[size(x)])) end select contains pure function foo_helper(arr) result(r) type(my_type), intent(in) :: arr(:) type(my_type) :: r r = arr(1) end function end function ! Same test with integers function foo_int(x) result(res) integer, intent(in) :: x(..) integer :: res select rank(x) rank(2) res = foo_int_helper(reshape(x, shape=[size(x)])) end select contains pure function foo_int_helper(arr) result(r) integer, intent(in) :: arr(:) integer :: r r = arr(1) end function end function end module program select_rank_16 use select_rank_16_mod implicit none type(my_type) :: a(2,2), b integer :: c(2,2), d a(1,1)%val = 10 a(2,1)%val = 20 a(1,2)%val = 30 a(2,2)%val = 40 b = foo(a) if (b%val /= 10) error stop c(1,1) = 100 c(2,1) = 200 c(1,2) = 300 c(2,2) = 400 d = foo_int(c) if (d /= 100) error stop end program lfortran-0.63.0/integration_tests/interface_07.f900000664000175000017500000000116115174404631022152 0ustar alastairalastairmodule interface_07_mod implicit none interface a module procedure a1 module procedure a2 end interface contains integer function a1(a) integer, intent(in) :: a a1 = a + 1 end function real function a2(a) real, intent(in) :: a a2 = a + 1 end function subroutine run() integer :: i real :: r i = 5 i = a(i) if (i /= 6) error stop r = 6 r = a(r) if (r /= 7) error stop i = 7 i = a(i) if (i /= 8) error stop end subroutine end module program interface_07 use interface_07_mod, only: run implicit none call run() end program lfortran-0.63.0/integration_tests/gpu_metal_86.f900000664000175000017500000000112215174404631022173 0ustar alastairalastairprogram gpu_metal_86 ! Test: indexing allocatable array member of derived type passed to a ! function called from do concurrent (Metal GPU offload). ! The allocatable data must be passed as a separate device buffer so ! that the Metal inline function can subscript it. implicit none type :: t integer, allocatable :: a(:) end type type(t) :: x integer :: r(1), i allocate(x%a, source=[7]) do concurrent (i = 1:1) r(i) = f(x) end do if (r(1) /= 7) error stop print *, "ok" contains pure integer function f(s) type(t), intent(in) :: s f = s%a(1) end function end program lfortran-0.63.0/integration_tests/assume_rank_shape_product_01.f900000664000175000017500000000204115174404631025432 0ustar alastairalastair! product(shape(a)) for assumed-rank a must compile (LLVM must not emit <0 x t> vectors). program assume_rank_shape_product_01 use iso_c_binding, only: c_int, c_size_t, c_null_ptr, c_ptr implicit none integer :: x(2, 3) x = 1 call sub_with_product_shape(x) contains subroutine sub_with_product_shape(a) type(*), intent(inout), target, contiguous :: a(..) interface subroutine caf_dummy(a, sz, team) bind(c) use iso_c_binding, only: c_size_t, c_ptr type(*), intent(inout) :: a(..) integer(c_size_t), value :: sz type(c_ptr), value :: team end subroutine end interface if (int(product(shape(a)), c_size_t) /= 6_c_size_t) error stop call caf_dummy(a, int(product(shape(a)), c_size_t), c_null_ptr) end subroutine end program subroutine caf_dummy(a, sz, team) bind(c) use iso_c_binding, only: c_size_t, c_ptr implicit none type(*), intent(inout) :: a(..) integer(c_size_t), value :: sz type(c_ptr), value :: team if (sz /= 6_c_size_t) error stop end subroutine caf_dummy lfortran-0.63.0/integration_tests/separate_compilation_17.f900000664000175000017500000000133315174404631024416 0ustar alastairalastairprogram separate_compilation_17 use mod_separate_compilation_17 implicit none integer(4) :: fnv_1_hasher = 1 type(key_type) :: key integer(1) :: test_object(4) allocate(key % value(4)) fnv_1_hasher = fnv_1_hash( key % value ) print *, fnv_1_hasher print *, key % value if (fnv_1_hasher /= 5) error stop if (.not. all(key % value == [1, 2, 3, 4])) error stop call test_fnv_1() contains subroutine test_fnv_1() integer(4) :: hash hash = fnv_1_hash( test_object ) print *, hash print *, test_object if (hash /= 5) error stop if (.not. all(test_object == [1, 2, 3, 4])) error stop end subroutine test_fnv_1 end programlfortran-0.63.0/integration_tests/subroutines_02.f900000664000175000017500000000122415174404631022567 0ustar alastairalastairprogram subroutines_02 implicit none integer :: i, j i = 1 j = 1 call f(i, j) print *, i, j if (i /= 1) error stop if (j /= 2) error stop call g(i, j) print *, i, j if (i /= 1) error stop if (j /= 0) error stop call h(i, j) print *, i, j if (i /= 1) error stop if (j /= 0) error stop contains subroutine f(a, b) integer, intent(in) :: a integer, intent(out) :: b b = a + 1 end subroutine subroutine g(a, b) integer, intent(in) :: a integer, intent(out) :: b b = a - 1 end subroutine subroutine h(a, b) integer, intent(in) :: a integer, intent(out) :: b call g(a, b) end subroutine end program lfortran-0.63.0/integration_tests/select_case_02.f900000664000175000017500000000144215174404631022461 0ustar alastairalastairprogram select_case_02 implicit none character(5) :: s integer :: i, j ! Test select case on a substring with variable indices s = "true " i = 1 j = 4 select case(s(i:j)) case("true") print *, "matched true" case("false") print *, "matched false" case default error stop "expected true" end select s = "false" i = 1 j = 5 select case(s(i:j)) case("true") error stop "expected false" case("false") print *, "matched false" case default error stop "expected false" end select ! Test with constant indices (regression check) s = "true " select case(s(1:4)) case("true") print *, "matched const true" case default error stop "expected const true" end select print *, "ok" end program lfortran-0.63.0/integration_tests/complex_14.f900000664000175000017500000000036615174404631021665 0ustar alastairalastairSUBROUTINE CPDSA() DOUBLE PRECISION PD COMPLEX C PD = 1.0D0 C = DCMPLX(PD, 0.0D0) PRINT *, C if (REAL(C) /= 1.0D0) ERROR STOP if (AIMAG(C) /= 0.0D0) ERROR STOP END SUBROUTINE program main call CPDSA() end program lfortran-0.63.0/integration_tests/procedure_pointer_13.f900000664000175000017500000000136215174404631023742 0ustar alastairalastairprogram procedure_pointer_13 implicit none type :: t procedure(ifc), pointer :: ptr => null() end type t abstract interface subroutine ifc(self, a) import class(t), intent(in) :: self integer, intent(in) :: a(:) end subroutine ifc end interface type(t) :: x integer :: a(3) a = [10, 20, 30] x%ptr => sub call x%ptr(a) contains subroutine sub(self, a) class(t), intent(in) :: self integer, intent(in) :: a(:) if (size(a) /= 3) error stop if (a(1) /= 10) error stop if (a(2) /= 20) error stop if (a(3) /= 30) error stop print *, "OK" end subroutine sub end program procedure_pointer_13 lfortran-0.63.0/integration_tests/submodule_30d.f900000664000175000017500000000026115174404631022351 0ustar alastairalastairsubmodule(submodule_30_mod:submodule_30_child) submodule_30_grandchild implicit none contains module procedure compute y = x * 7 end procedure end submodule lfortran-0.63.0/integration_tests/array_op_03.f900000664000175000017500000000030515174404631022021 0ustar alastairalastairprogram main implicit none real :: x(2) real(8) :: a = -1.0 x = -a if (abs(x(1) - 1) > 1e-8) error stop if (abs(x(2) - 1) > 1e-8) error stop print *, x end program main lfortran-0.63.0/integration_tests/intrinsics_233.f900000664000175000017500000000127115174404631022462 0ustar alastairalastairprogram intrinsics_233 implicit none real :: x real :: z = -1.0 real :: y(3) x = -1.0 x = sqrt(x) y = [sqrt(x), log(x), exp(x)] print*, x print *, isnan(x) if (isnan(x) .neqv. .true.) error stop print*, y(1) print *, isnan(y(1)) if (isnan(y(1)) .neqv. .true.) error stop print*, y(2) print *, isnan(y(2)) if (isnan(y(2)) .neqv. .true.) error stop print*, y(3) print *, isnan(y(3)) if (isnan(y(3)) .neqv. .true.) error stop !tests for compile time argument print *, isnan(1.0) if (isnan(1.0) .neqv. .false.) error stop print *, isnan(sqrt(z)) if (isnan(sqrt(z)) .neqv. .true.) error stop end programlfortran-0.63.0/integration_tests/openmp_21.f900000664000175000017500000000070115174404631021503 0ustar alastairalastairprogram openmp_21 use omp_lib integer, parameter :: n = 100000 integer :: i real :: b(n) call omp_set_num_threads(4) !$omp parallel shared(b) private(i) !$omp do do i = 1, n b(i) = 12.91 end do !$omp end do !$omp end parallel print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/openmp_47.f900000664000175000017500000000040515174404631021514 0ustar alastairalastairprogram openmp_47 use omp_lib implicit none real::res res=1 call omp_set_num_threads(16) !$omp parallel reduction(*:res) res=res*1.5 !$omp end parallel if(res /= 1.5**16) error stop print *, res end program openmp_47lfortran-0.63.0/integration_tests/intrinsics_77.f900000664000175000017500000000053415174404631022411 0ustar alastairalastairprogram intrinsics_77 implicit none real, allocatable :: mat1(:, :), mat2(:, :), mat3(:, :), mat4(:, :) real :: error allocate(mat1(5, 5), mat2(5, 5), mat3(5, 5), mat4(5, 5)) mat1 = 2.0 mat2 = 3.0 mat3 = mat1 + mat2 mat4 = 5.0 error = maxval(abs(mat3 - mat4)) print *, maxval(abs(mat3 - mat4)) if( (error - 0.0) > 1e-8 ) error stop end program lfortran-0.63.0/integration_tests/string_87.f900000664000175000017500000000355015174404631021534 0ustar alastairalastair! Test StringToArray casting program string_87 character(10) :: str character(10) :: str2 str = "HelloWorld" call ff1(str) print *, str if(str /= "HelloWTrld") error stop 3 str = "HelloWorld" call ff2(str) print *, str if(str /= "HelloWTrld") error stop 6 str = "HelloWorld" call ff3(str) print *, str if(str /= "HelloWTrld") error stop 9 str = "HelloWorld" call ff4(str) print *, str if(str /= "HelloWTrld") error stop 12 ! TODO :: SUPPORT CASE BELOW ! str = "HelloWorld" ! call ff5(str, 2) ! print *, str ! if(str /= "HelloWTrld") error stop 15 str = "Hello" call ff1_1(trim(str)//"World") contains subroutine ff1(s) character(5) :: s(2) if(s(1) /= "Hello") error stop 1 if(s(2) /= "World") error stop 2 s(2)(2:2) = "T" end subroutine subroutine ff2(s) character(5) :: s(*) if(s(1) /= "Hello") error stop 4 if(s(2) /= "World") error stop 5 s(2)(2:2) = "T" end subroutine subroutine ff3(s) character(*) :: s(1) if(len(s(1)) /= 10) error stop 7 if(s(1) /= "HelloWorld") error stop 8 s(1)(7:7) = "T" end subroutine subroutine ff4(s) character(*) :: s(*) if(len(s(1)) /= 10) error stop 10 if(s(1) /= "HelloWorld") error stop 11 s(1)(7:7) = "T" end subroutine subroutine ff5(s, n) integer :: n character(*) :: s(n) if(len(s(1)) /= 10) error stop 13 if(s(1) /= "HelloWorld") error stop 14 s(1)(7:7) = "T" end subroutine subroutine ff1_1(s) character(2) :: s(5) if(s(1) /= "He") error stop 16 if(s(2) /= "ll") error stop 17 if(s(3) /= "oW") error stop 18 if(s(4) /= "or") error stop 19 if(s(5) /= "ld") error stop 20 end subroutine end program lfortran-0.63.0/integration_tests/arrays_49.f900000664000175000017500000000207115174404631021522 0ustar alastairalastair! This test checks the maxloc intrinsic function when ! the passed-array dimension is a variable. SUBROUTINE TEST_MAXLOC(i,a) INTEGER,INTENT(in) :: i INTEGER, DIMENSION(i),INTENT(in) :: a INTEGER ::res res = maxloc(a,1) print *, res if(res /= 5) error stop END SUBROUTINE TEST_MAXLOC SUBROUTINE TEST_MINLOC(i,a) INTEGER,INTENT(in) :: i INTEGER, DIMENSION(i),INTENT(in) :: a INTEGER ::res res = minloc(a,1) print *, res if(res /= 1) error stop END SUBROUTINE TEST_MINLOC PROGRAM arrays_49 implicit none INTEGER :: x INTEGER :: a(10) = [1,2,3,4,1000,5,6,7,8,9] x = 10 call TEST_MAXLOC(x,a) call TEST_MINLOC(x,a) END PROGRAM arrays_49lfortran-0.63.0/integration_tests/format_80.f900000664000175000017500000000104115174404631021500 0ustar alastairalastairprogram format_80 implicit none real :: a, b character(16) :: string(2) integer :: i a = .087654 b = .87654 write (string, '(+3p," ",(f6.2))') a, b if (.not. all(string == [' 87.65', '876.54 '])) then print *, 'string(1)=', string(1) print *, 'string(2)=', string(2) error stop 1 end if do i = 1, 16 if (iachar(string(2)(i:i)) == 0) then print *, 'nul found at index', i error stop 2 end if end do end program lfortran-0.63.0/integration_tests/write_06.f900000664000175000017500000000100415174404631021337 0ustar alastairalastairprogram main implicit none character(len=27) :: warn1 character(len=7) :: warn2 integer :: i write(warn1, '(a,1x,a,1x,a,1x,a)') 'KEYWORD', 'SHORT', 'PRESENT', 'VALUE' print*, "!", warn1, "!" if ( .not. (warn1 /= ' KEYWORD SHORT PRESENT VALUE' .or. warn1 /= 'KEYWORD SHORT PRESENT VALUE' ) ) error stop write(warn2, '(i1,1x,a)') 7, 'SHORT' print*, "!", warn2, "!" if ( warn2 /= '7 SHORT' ) error stop read(warn2, *) i print *, i if (i /= 7) error stop end program lfortran-0.63.0/integration_tests/intrinsics_292.f900000664000175000017500000000026415174404631022470 0ustar alastairalastairprogram intrinsics_292 implicit none integer :: narg narg = command_argument_count() print *, "narg: ", narg if ( narg /= 0 ) error stop end program intrinsics_292 lfortran-0.63.0/integration_tests/ilp64_logical_compare_01.f900000664000175000017500000000132615174404631024345 0ustar alastairalastairprogram ilp64_logical_compare_01 implicit none logical :: flag1, flag2, flag3, flag4, flag5, flag6 flag1 = 5 >= 5 if (.not. flag1) error stop flag2 = 5 > 3 if (.not. flag2) error stop flag3 = 3 < 5 if (.not. flag3) error stop flag4 = 3 <= 5 if (.not. flag4) error stop flag5 = 5 == 5 if (.not. flag5) error stop flag6 = 5 /= 3 if (.not. flag6) error stop flag1 = 3 >= 5 if (flag1) error stop flag2 = 3 > 5 if (flag2) error stop flag3 = 5 < 3 if (flag3) error stop flag4 = 5 <= 3 if (flag4) error stop flag5 = 3 == 5 if (flag5) error stop flag6 = 5 /= 5 if (flag6) error stop print *, "All tests passed" end program lfortran-0.63.0/integration_tests/bindc_iso_fb_03c.c0000664000175000017500000001552715174404631022610 0ustar alastairalastair/* * Consolidated C helpers for bindc_iso_fb_03 * Merged from: bindc_22c.c, bindc_26c.c, bindc_27c.c * * bindc_22c.c: array sections, derived types, non-default bounds * bindc_26c.c: derived type extensions through descriptors * bindc_27c.c: character interop through descriptors */ #include #include #include #include /* ============================================================ * Type definitions (from bindc_26c.c) * ============================================================ */ typedef struct { int32_t x; int32_t y; } inner_t; typedef struct { inner_t pos; int32_t id; } nested_t; typedef struct { float _Complex z; int32_t tag; } complex_member_t; typedef struct { _Bool flag; int32_t val; } bool_member_t; typedef struct { char code; int32_t val; } char_member_t; /* ============================================================ * Static helpers from bindc_22c.c * ============================================================ */ /* generic recursive sum for int32 */ static int32_t sum_i32(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) return *(int32_t *)base; int32_t total = 0; for (CFI_index_t i = 0; i < d[k].extent; i++) total += sum_i32(base + i * d[k].sm, d, rank, k + 1); return total; } /* ============================================================ * Static helpers from bindc_26c.c * ============================================================ */ static int32_t sum_nested(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) { nested_t *p = (nested_t *)base; return p->pos.x + p->pos.y + p->id; } int32_t total = 0; for (CFI_index_t i = 0; i < d[k].extent; i++) total += sum_nested(base + i * d[k].sm, d, rank, k + 1); return total; } static int32_t sum_inner(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) { inner_t *p = (inner_t *)base; return p->x + p->y; } int32_t total = 0; for (CFI_index_t i = 0; i < d[k].extent; i++) total += sum_inner(base + i * d[k].sm, d, rank, k + 1); return total; } /* ============================================================ * Static helpers from bindc_27c.c * ============================================================ */ /* generic recursive sum of char codes */ static int sum_chars(char *base, CFI_dim_t *d, int rank, int k, int elem_len) { if (k == rank) { int total = 0; unsigned char *p = (unsigned char *)base; for (int j = 0; j < elem_len; j++) total += p[j]; return total; } int total = 0; for (CFI_index_t i = 0; i < d[k].extent; i++) total += sum_chars(base + i * d[k].sm, d, rank, k + 1, elem_len); return total; } /* ============================================================ * Public functions from bindc_22c.c * ============================================================ */ /* ---- 1D sum (used for negative stride, non-default bounds) ---- */ int32_t c22_sum_1d(CFI_cdesc_t *a) { return sum_i32((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- 2D sum (used for 2D sections) ---- */ int32_t c22_sum_2d(CFI_cdesc_t *a) { return sum_i32((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- derived type array: point_t has { int32 x, int32 y } ---- */ int32_t c22_sum_points(CFI_cdesc_t *a) { int32_t total = 0; char *base = (char *)a->base_addr; for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { int32_t *pt = (int32_t *)(base + i * a->dim[0].sm); total += pt[0] + pt[1]; /* x + y */ } return total; } int c22_point_elem_size(CFI_cdesc_t *a) { return (int)a->elem_len; } /* ---- non-default bounds ---- */ int32_t c22_sum_nondefault(CFI_cdesc_t *a) { return sum_i32((char *)a->base_addr, a->dim, (int)a->rank, 0); } int c22_get_extent(CFI_cdesc_t *a) { return (int)a->dim[0].extent; } /* ============================================================ * Public functions from bindc_26c.c * ============================================================ */ /* ---- nested bind(C) type ---- */ int32_t c26_sum_nested(CFI_cdesc_t *a) { return sum_nested((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- allocatable derived type array ---- */ int32_t c26_sum_alloc_nested(CFI_cdesc_t *a) { return sum_nested((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- pointer derived type array ---- */ int32_t c26_sum_ptr_nested(CFI_cdesc_t *a) { return sum_nested((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- 2D derived type array ---- */ int32_t c26_sum_2d_inner(CFI_cdesc_t *a) { return sum_inner((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- assumed-rank with derived type ---- */ int c26_rank_inner(CFI_cdesc_t *a) { return (int)a->rank; } /* ---- empty type ---- */ int c26_sizeof_empty(CFI_cdesc_t *a) { return (int)a->elem_len; } /* ---- complex component type ---- */ int32_t c26_sum_complex_member(CFI_cdesc_t *a) { int32_t total = 0; char *base = (char *)a->base_addr; for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { complex_member_t *p = (complex_member_t *)(base + i * a->dim[0].sm); total += p->tag; } return total; } /* ---- logical component type ---- */ int c26_count_flagged(CFI_cdesc_t *a) { int count = 0; char *base = (char *)a->base_addr; for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { bool_member_t *p = (bool_member_t *)(base + i * a->dim[0].sm); if (p->flag) count++; } return count; } /* ---- character component type ---- */ int c26_sum_char_codes(CFI_cdesc_t *a) { int total = 0; char *base = (char *)a->base_addr; for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { char_member_t *p = (char_member_t *)(base + i * a->dim[0].sm); total += (int)(unsigned char)p->code; } return total; } /* ---- array section of derived type ---- */ int32_t c26_sum_inner_section(CFI_cdesc_t *a) { return sum_inner((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ============================================================ * Public functions from bindc_27c.c * ============================================================ */ /* ---- character(len=1) 1D sum ---- */ int c27_char_sum_1d(CFI_cdesc_t *a) { return sum_chars((char *)a->base_addr, a->dim, (int)a->rank, 0, (int)a->elem_len); } /* ---- character(len=1) 2D sum ---- */ int c27_char_sum_2d(CFI_cdesc_t *a) { return sum_chars((char *)a->base_addr, a->dim, (int)a->rank, 0, (int)a->elem_len); } /* ---- character inout: toupper ---- */ void c27_char_toupper(CFI_cdesc_t *a) { char *base = (char *)a->base_addr; for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { unsigned char *ch = (unsigned char *)(base + i * a->dim[0].sm); if (*ch >= 'a' && *ch <= 'z') *ch -= 32; } } lfortran-0.63.0/integration_tests/submodule_42.f900000664000175000017500000000172115174404631022212 0ustar alastairalastair! Test: module procedure implementation of a procedure declared inside ! a named (generic) interface block within a submodule. module submodule_42_m implicit none type :: mytype integer :: x end type interface elemental module function foo(self) result(res) class(mytype), intent(in) :: self integer :: res end function end interface end module submodule(submodule_42_m) submodule_42_s implicit none interface assert_conformable elemental module subroutine bar(self, other) class(mytype), intent(in) :: self type(mytype), intent(in) :: other end subroutine end interface contains module procedure foo res = self%x end procedure module procedure bar continue end procedure end submodule program submodule_42 use submodule_42_m implicit none type(mytype) :: a, b a = mytype(42) b = mytype(10) if (foo(a) /= 42) error stop if (foo(b) /= 10) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/select_rank_12.f900000664000175000017500000000123415174404631022501 0ustar alastairalastairmodule select_rank_12_mod implicit none contains subroutine check_arg(arg) class(*), dimension(..), intent(in) :: arg select rank (assoc => arg) rank (1) print *, "Received an array of rank 1" rank (2) print *, "Received an array of rank 2" rank default print *, "Received an array of unexpected rank" error stop end select end subroutine check_arg end module select_rank_12_mod program select_rank_12 use select_rank_12_mod implicit none integer :: int_array1(3) = [1, 2, 3] integer :: int_array2(2, 3) call check_arg(int_array1) call check_arg(int_array2) end program select_rank_12 lfortran-0.63.0/integration_tests/boz_01.f900000664000175000017500000000112415174404631020775 0ustar alastairalastairprogram boz_01 implicit none integer :: boz_1, boz_2, boz_3, boz_4, boz_5 real:: boz_6 boz_1 = int(b'01011101') boz_2 = int(o'2347') boz_3 = int(z'ABC') !Testing Truncation of BOZ boz_4 = int(Z'234567890abcdef1') boz_5 = int(Z'2234567890abcdef1') !Checking Real Conversion of BOZ boz_6 = real(b'01101') !Check with Integer Equivalent Values if (boz_4 /= boz_5) error stop if (boz_1 /= 93) error stop if (boz_2 /= 1255) error stop if (boz_3 /= 2748) error stop if (boz_4 /= 180150001) error stop if (boz_5 /= 180150001) error stop print *, boz_1, boz_2, boz_3, boz_4, boz_5, boz_6 end program lfortran-0.63.0/integration_tests/allocate_28.f900000664000175000017500000000055515174404631022007 0ustar alastairalastairprogram allocate_28 implicit none type :: my_type integer :: x end type class(my_type), allocatable :: obj class(my_type), allocatable :: original allocate(my_type :: original) original%x = 123 allocate(obj, mold=original) obj%x = 456 print *, "obj%x =", obj%x if (obj%x /= 456) error stop end program allocate_28lfortran-0.63.0/integration_tests/compiler_version_03.f900000664000175000017500000000141315174404631023565 0ustar alastairalastairmodule string_mod public contains !> Fixed-length string function string() character(len=6) :: string string = "abcdef" end function end module program compiler_version_03 use string_mod, only: string ! semantic error: The symbol 'compiler_version' not found in the module 'iso_fortran_env' use, intrinsic :: iso_fortran_env, only: compiler_version character(len=len(compiler_version())) :: a character(len=len(string())) :: b character(len=:), allocatable :: c a = compiler_version() print *, len(a), a b = string() print *, len(b), b if ( len(b) /= 6 ) error stop c = compiler_version() print *, len(c), c if(len(c) /= len(a)) error stop if(c /= a) error stop end program lfortran-0.63.0/integration_tests/intrinsics_384.f900000664000175000017500000000035015174404631022466 0ustar alastairalastairprogram intrinsics_384 implicit none integer, allocatable :: arr(:) allocate(arr(3)) arr = [1, 2, 3] print *, eoshift(arr, 1, 0) if (any(eoshift(arr, 1, 0) /= [2, 3, 0])) error stop end program intrinsics_384lfortran-0.63.0/integration_tests/save_09.f900000664000175000017500000000074415174404631021160 0ustar alastairalastairsubroutine foo(ir, rr, lr) integer, intent(in) :: ir real, intent(in) :: rr logical, intent(in) :: lr integer, save :: ic = 1 real, save :: rc = 1 logical, save :: lc = .true. ic = ic + 1 rc = rc + 1 lc = .not. lc print *, 'FOO: ', ic, ir, rc, rr, lc, lr if (ic /= ir) error stop if (rc /= rr) error stop if (lc .neqv. lr) error stop end subroutine program save_09 integer i logical :: lr = .false. do i = 2, 4 call foo(i, real(i), lr) lr = .not. lr end do end program lfortran-0.63.0/integration_tests/list_of_lists_test.f900000664000175000017500000000163115174404631023622 0ustar alastairalastairprogram lp_list_of_lists_test implicit none type(_lfortran_list(_lfortran_list(integer))) :: x type(_lfortran_list(integer)) :: y call _lfortran_list_append(x, _lfortran_list_constant(1, 0, 1, 12, 15, 15)) y = _lfortran_list_constant(10, 10, 10) call _lfortran_list_append(y, 16) call _lfortran_list_append(x, y) if (_lfortran_get_item(_lfortran_get_item(x, 0), 1) /= 0) error stop if (_lfortran_get_item(_lfortran_get_item(x, 1), 0) /= 10) error stop if (_lfortran_len(_lfortran_get_item(x, 0)) /= 6) error stop if (_lfortran_len(_lfortran_get_item(x, 1)) /= 4) error stop ! Making sure its copy call _lfortran_list_append(y, -22) if (_lfortran_len(_lfortran_get_item(x, 1)) /= 4) error stop call _lfortran_list_append(_lfortran_get_item(x, 1), 36) if (_lfortran_len(_lfortran_get_item(x, 1)) /= 5) error stop end program lp_list_of_lists_test lfortran-0.63.0/integration_tests/namelist_06.f900000664000175000017500000000374515174404631022037 0ustar alastairalastairprogram namelist_mixed implicit none ! Define variables of mixed dimensions integer :: scalar integer :: vec(5) integer :: mat(3,3) integer :: cube(2,2,2) integer :: i, j, k ! Define namelist with all dimensions mixed together namelist /mixed/ scalar, vec, mat, cube ! Initialize scalar scalar = 42 ! Initialize vector (5 elements) vec = [10, 20, 30, 40, 50] ! Initialize matrix (3x3 = 9 elements) do j = 1, 3 do i = 1, 3 mat(i,j) = i + j * 10 end do end do ! Initialize cube (2x2x2 = 8 elements) do k = 1, 2 do j = 1, 2 do i = 1, 2 cube(i,j,k) = i + j*10 + k*100 end do end do end do ! Write namelist to file open(unit=10, file='namelist_mixed.dat', status='replace', form='formatted') write(10, nml=mixed) close(10) ! Reset all values to zero scalar = 0 vec = 0 mat = 0 cube = 0 ! Read namelist from file open(unit=10, file='namelist_mixed.dat', status='old', form='formatted') read(10, nml=mixed) close(10) ! Verify scalar if (scalar /= 42) error stop "Scalar mismatch" ! Verify vector if (vec(1) /= 10) error stop "vec(1) mismatch" if (vec(2) /= 20) error stop "vec(2) mismatch" if (vec(3) /= 30) error stop "vec(3) mismatch" if (vec(4) /= 40) error stop "vec(4) mismatch" if (vec(5) /= 50) error stop "vec(5) mismatch" ! Verify matrix do j = 1, 3 do i = 1, 3 if (mat(i,j) /= i + j * 10) then error stop "Matrix element mismatch" end if end do end do ! Verify cube do k = 1, 2 do j = 1, 2 do i = 1, 2 if (cube(i,j,k) /= i + j*10 + k*100) then error stop "Cube element mismatch" end if end do end do end do print *, "Mixed dimension namelist test passed!" end program namelist_mixed lfortran-0.63.0/integration_tests/functions_33.f900000664000175000017500000000102015174404631022213 0ustar alastairalastairmodule functions_33_mod abstract interface subroutine interface_signature() end subroutine end interface procedure(interface_signature), pointer :: func_ptr contains subroutine test_uobyqa() func_ptr => ff call func_ptr() end subroutine subroutine ff() print *, "hi" end subroutine end module functions_33_mod program functions_33 use functions_33_mod call test_uobyqa() end program lfortran-0.63.0/integration_tests/arrays_48.f900000664000175000017500000000034115174404631021517 0ustar alastairalastairprogram arrays_48 implicit none integer :: cs(6) integer :: nx = 4 cs = [1, 2, 3, 4, 5, 6] call f(cs) contains subroutine f(x) integer, intent(in) :: x(nx) print *, x if(sum(x) /= 10) error stop end subroutine end program lfortran-0.63.0/integration_tests/separate_compilation_17a.f900000664000175000017500000000065015174404631024560 0ustar alastairalastairmodule mod_separate_compilation_17 implicit none type :: key_type integer(1), allocatable :: value(:) end type key_type interface fnv_1_hash module function int8_fnv_1( key ) result(hash_code) integer(1), intent(inout) :: key(:) integer(4) :: hash_code end function int8_fnv_1 end interface fnv_1_hash end module mod_separate_compilation_17lfortran-0.63.0/integration_tests/array_section_19.f900000664000175000017500000000202215174404631023054 0ustar alastairalastairprogram array_section_19 implicit none integer, parameter :: a(5) = [10, 20, 30, 40, 50] integer, parameter :: b(3) = a(2:4) integer, parameter :: c(5) = a(1:5) integer, parameter :: d(2) = a(1:3:2) integer, parameter :: array(4) = [1, 2, 3, 4] integer, parameter :: arr_int(4) = array(1:4) character, parameter :: string(4) = "okay" character, parameter :: arr(4) = string(1:4) if (b(1) /= 20) error stop if (b(2) /= 30) error stop if (b(3) /= 40) error stop if (c(1) /= 10) error stop if (c(2) /= 20) error stop if (c(3) /= 30) error stop if (c(4) /= 40) error stop if (c(5) /= 50) error stop if (d(1) /= 10) error stop if (d(2) /= 30) error stop if (arr_int(1) /= 1) error stop if (arr_int(2) /= 2) error stop if (arr_int(3) /= 3) error stop if (arr_int(4) /= 4) error stop if (arr(1) /= "o") error stop if (arr(2) /= "o") error stop if (arr(3) /= "o") error stop if (arr(4) /= "o") error stop end program array_section_19 lfortran-0.63.0/integration_tests/nested_vars_01.f900000664000175000017500000000203715174404631022524 0ustar alastairalastairmodule cobylb_mod_nested_vars_01 contains subroutine cobylb(amat) real, intent(in) :: amat(:, :) call evaluate(calcfc_internal) contains subroutine evaluate(calcfc) implicit none interface subroutine calcfc() implicit none end subroutine calcfc end interface call calcfc() end subroutine evaluate subroutine calcfc_internal() implicit none real :: out(5, 5) print *, matprod(amat) out = matprod(amat) if (any(abs(out - 833.340454) > 1e-8)) error stop end subroutine calcfc_internal end subroutine function matprod(y) result(z) implicit none real, intent(in) :: y(:, :) real :: z(size(y,1), size(y, 2)) z = matmul(y, y) end function matprod end module program nested_vars_01 use cobylb_mod_nested_vars_01 real :: amat(5, 5) amat = 12.91 call cobylb(amat) end program lfortran-0.63.0/integration_tests/equivalence_19.f900000664000175000017500000000061315174404631022517 0ustar alastairalastairprogram equivalence_19 implicit none integer :: i1, i2 equivalence (i1, i2) integer :: j1, j2, j3 equivalence (j1, j2, j3) integer :: k1, k2, k4 real :: r3 equivalence (k1, k2, r3, k4) i1 = 1; i2 = 2 if (i1 /= 2) error stop j1 = 1; j2 = 2; j3 = 3 if (j1 /= 3) error stop if (j2 /= 3) error stop k1 = 1; k2 = 2; r3 = 3.3; k4 = 4 if (k1 /= 4) error stop if (k2 /= 4) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_24.f900000664000175000017500000000060315174404631022166 0ustar alastairalastairprogram gpu_metal_24 implicit none type :: params real :: scale real :: offset end type type(params) :: p real :: a(10) integer :: i p%scale = 2.0 p%offset = 0.5 do concurrent(i = 1:10) a(i) = p%scale * real(i) + p%offset end do if (abs(a(1) - 2.5) > 1e-5) error stop if (abs(a(5) - 10.5) > 1e-5) error stop if (abs(a(10) - 20.5) > 1e-5) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/modules_25.f900000664000175000017500000000015215174404631021661 0ustar alastairalastairprogram module_25 use tomlf_de_character implicit none print *, "running module_25 program" end program lfortran-0.63.0/integration_tests/select_type_24.f900000664000175000017500000000324415174404631022535 0ustar alastairalastairmodule select_type_24_mod implicit none type, abstract :: AbsType contains procedure(add_ifc), deferred :: add end type AbsType type, extends(AbsType) :: MyType real(8), allocatable :: arr(:,:) contains procedure :: add => addition end type MyType abstract interface function add_ifc(a, b) result(r) import :: AbsType class(AbsType), intent(in) :: a, b class(AbsType), allocatable :: r end function add_ifc end interface contains function addition(a, b) result(r) class(MyType), intent(in) :: a class(AbsType), intent(in) :: b class(AbsType), allocatable :: r select type (b) type is (MyType) allocate(MyType :: r) select type (r) type is (MyType) r%arr = a%arr + b%arr end select class default error stop "Unsupported RHS type" end select end function addition end module select_type_24_mod program select_type_24 use select_type_24_mod implicit none type(MyType) :: a, b, c class(AbsType), allocatable :: r allocate(a%arr(2,2), b%arr(2,2)) a%arr = reshape([1d0, 2d0, 3d0, 4d0], [2,2]) b%arr = reshape([5d0, 6d0, 7d0, 8d0], [2,2]) r = a%add(b) select type (r) type is (MyType) c = r class default error stop "add() returned wrong dynamic type" end select if (any(c%arr /= a%arr + b%arr)) then error stop "Incorrect addition result" end if print *, "a = ", a%arr print *, "b = ", b%arr print *, "c = ", c%arr end program select_type_24 lfortran-0.63.0/integration_tests/parameter_14.f900000664000175000017500000000016215174404631022170 0ustar alastairalastairprogram parameter_14 real :: x parameter ( x = 12.9E+0 ) print *, x if ( abs( x - 12.9 ) > 1e-8 ) error stop end lfortran-0.63.0/integration_tests/separate_compilation_32.f900000664000175000017500000000031415174404631024411 0ustar alastairalastairprogram separate_compilation_32 use mod_separate_compilation_32, only: assemble_divergence implicit none if (assemble_divergence(1) /= 1.0d0) error stop 1 end program separate_compilation_32 lfortran-0.63.0/integration_tests/cond_02.f900000664000175000017500000000142415174404631021132 0ustar alastairalastairprogram cond_02 implicit none integer :: a = 1, b = 2 integer, parameter :: ap = 1, bp = 2 real :: c = 1.0, d = 2.0 real, parameter :: cp = 1.0, dp = 2.0 if( ap == bp ) then print *, "ap == bp" else print *, "ap /= bp" end if if( cp == dp ) then print *, "cp == dp" else print *, "cp /= dp" end if if( a == b ) then print *, "a == b" if( ap == bp ) then print *, "ap == bp" else print *, "ap /= bp" end if else if( ap == cp ) then print *, "ap == cp" if( cp == dp ) then print *, "cp == dp" else print *, "cp /= dp" end if else if( c == d ) then print *, "c == d" end if end lfortran-0.63.0/integration_tests/intrinsics_188.f900000664000175000017500000000727615174404631022506 0ustar alastairalastairprogram intrinsics_188 character(5) :: hello = "hello" character(5) :: world = "world" character(8) :: lfortran = "lfortran" character(7) :: fortran = "fortran" character(5) :: sym = "#s@ym" character(4) :: sym2 = "s_y!" print*, lgt("hello", "world") if (lgt("hello", "world") .neqv. .false.) error stop print*, lgt("hello", "hello") if (lgt("hello", "hello") .neqv. .false.) error stop print*, lgt("lfortran", "fortran") if (lgt("lfortran", "fortran") .neqv. .true.) error stop print*, lgt("#s@ym", "s_y!") if (lgt("#s@ym", "s_y!") .neqv. .false.) error stop print*, lgt("hello", "s_y!") if (lgt("hello", "s_y!") .neqv. .false.) error stop print*, lge("hello", "world") if (lge("hello", "world") .neqv. .false.) error stop print*, lge("hello", "hello") if (lge("hello", "hello") .neqv. .true.) error stop print*, lge("lfortran", "fortran") if (lge("lfortran", "fortran") .neqv. .true.) error stop print*, lge("#s@ym", "s_y!") if (lge("#s@ym", "s_y!") .neqv. .false.) error stop print*, lge("hello", "s_y!") if (lge("hello", "s_y!") .neqv. .false.) error stop print*, llt("hello", "world") if (llt("hello", "world") .neqv. .true.) error stop print*, llt("hello", "hello") if (llt("hello", "hello") .neqv. .false.) error stop print*, llt("lfortran", "fortran") if (llt("lfortran", "fortran") .neqv. .false.) error stop print*, llt("#s@ym", "s_y!") if (llt("#s@ym", "s_y!") .neqv. .true.) error stop print*, llt("hello", "s_y!") if (llt("hello", "s_y!") .neqv. .true.) error stop print*, lle("hello", "world") if (lle("hello", "world") .neqv. .true.) error stop print*, lle("hello", "hello") if (lle("hello", "hello") .neqv. .true.) error stop print*, lle("lfortran", "fortran") if (lle("lfortran", "fortran") .neqv. .false.) error stop print*, lle("#s@ym", "s_y!") if (lle("#s@ym", "s_y!") .neqv. .true.) error stop print*, lle("hello", "s_y!") if (lle("hello", "s_y!") .neqv. .true.) error stop print*, lgt(hello, world) if (lgt(hello, world) .neqv. .false.) error stop print*, lgt(hello, hello) if (lgt(hello, hello) .neqv. .false.) error stop print*, lgt(lfortran, fortran) if (lgt(lfortran, fortran) .neqv. .true.) error stop print*, lgt(sym, sym2) if (lgt(sym, sym2) .neqv. .false.) error stop print*, lgt(hello, sym2) if (lgt(hello, sym2) .neqv. .false.) error stop print*, lge(hello, world) if (lge(hello, world) .neqv. .false.) error stop print*, lge(hello, hello) if (lge(hello, hello) .neqv. .true.) error stop print*, lge(lfortran, fortran) if (lge(lfortran, fortran) .neqv. .true.) error stop print*, lge(sym, sym2) if (lge(sym, sym2) .neqv. .false.) error stop print*, lge(hello, sym2) if (lge(hello, sym2) .neqv. .false.) error stop print*, llt(hello, world) if (llt(hello, world) .neqv. .true.) error stop print*, llt(hello, hello) if (llt(hello, hello) .neqv. .false.) error stop print*, llt(lfortran, fortran) if (llt(lfortran, fortran) .neqv. .false.) error stop print*, llt(sym, sym2) if (llt(sym, sym2) .neqv. .true.) error stop print*, llt(hello, sym2) if (llt(hello, sym2) .neqv. .true.) error stop print*, lle(hello, world) if (lle(hello, world) .neqv. .true.) error stop print*, lle(hello, hello) if (lle(hello, hello) .neqv. .true.) error stop print*, lle(lfortran, fortran) if (lle(lfortran, fortran) .neqv. .false.) error stop print*, lle(sym, sym2) if (lle(sym, sym2) .neqv. .true.) error stop print*, lle(hello, sym2) if (lle(hello, sym2) .neqv. .true.) error stop end programlfortran-0.63.0/integration_tests/format_68.f900000664000175000017500000000100015174404631021501 0ustar alastairalastairprogram format_68 implicit none character(1) :: fmt*10, line*80, lstring*26, larray(26) integer :: i lstring = 'abcdefghijklmnopqrstuvwxyz' larray = transfer(lstring, larray) if (size(larray) /= 26) error stop if (larray(1) /= 'a') error stop if (larray(26) /= 'z') error stop fmt = '(99(1X,A))' write(line, fmt) (larray(i), i=1,26) if (line(2:2) /= 'a') error stop if (line(52:52) /= 'z') error stop if (len_trim(line) /= 52) error stop print "(A)", trim(line) end program format_68 lfortran-0.63.0/integration_tests/arrays_13_size.f900000664000175000017500000000143215174404631022543 0ustar alastairalastairmodule stdlib_sorting_arrays_13_size implicit none integer, parameter :: max_merge_stack = 93 type run_type integer(8) :: base = 0 integer(8) :: len = 0 end type run_type end module stdlib_sorting_arrays_13_size module stdlib_sorting_sort_index_arrays_13_size use stdlib_sorting_arrays_13_size implicit none contains module subroutine sort_index( item ) real, intent(inout) :: item type(run_type) :: runs(0:max_merge_stack-1) print *, size(runs) if (size(runs) /= 93) error stop end subroutine sort_index end module stdlib_sorting_sort_index_arrays_13_size program arrays_13_size use stdlib_sorting_sort_index_arrays_13_size implicit none real :: item call sort_index(item) end programlfortran-0.63.0/integration_tests/file_open_01.f900000664000175000017500000000025215174404631022144 0ustar alastairalastair! Test using action parameter with OPEN statement program file_open_01 integer :: u character(:), allocatable :: action_ open(u, action=action_) end programlfortran-0.63.0/integration_tests/intrinsics_253.f900000664000175000017500000000374215174404631022471 0ustar alastairalastairprogram intrinsics_253 use, intrinsic :: iso_fortran_env, only: dp => real64 real(dp), parameter :: r1 = derfc(1.1_dp) real(dp), parameter :: r2 = derfc(4.12_dp) real(dp), parameter :: ar1(3) = derfc([0.5_dp, -1.5_dp, 2.2_dp]) real(dp), parameter :: ar2(2) = derfc([-0.2_dp, 0.0_dp]) real(dp) :: x, y, z real(dp) :: arr1(3), arr2(3), res(3) x = 6.738377383_dp y = 3.1473863781_dp z = 7389.83936383_dp print *, derfc(x) if (abs(derfc(x) - 1.58035442023170862e-21_dp) > 1e-12) error stop print *, derfc(y) if (abs(derfc(y) - 8.54408946394494113e-06_dp) > 1e-12) error stop print *, derfc(z) if (abs(derfc(z) - 0.00000000000000000e+00_dp) > 1e-12) error stop x = -6.738377383_dp y = -3.1473863781_dp z = -7389.83936383_dp print *, derfc(x) if (abs(derfc(x) - 2.00000000000000000e+00_dp) > 1e-12) error stop print *, derfc(y) if (abs(derfc(y) - 1.99999145591053606e+00_dp) > 1e-12) error stop print *, derfc(z) if (abs(derfc(z) - 2.00000000000000000e+00_dp) > 1e-12) error stop print *, r1 if (abs(r1 - 1.19794930425918267e-01_dp) > 1e-12_dp) error stop print *, r2 if (abs(r2 - 5.65815721936131674e-09_dp) > 1e-12_dp) error stop print *, ar1 if (any(abs(ar1 - [4.79500122186953481e-01_dp, 1.96610514647531076e+00_dp, & 1.86284629798188941e-03_dp]) > 1e-12_dp)) error stop print *, ar2 if (any(abs(ar2 - [1.22270258921047859e+00_dp, 1.00000000000000000e+00_dp]) > 1e-12_dp)) error stop arr1 = [-6.738377383_dp, -3.1473863781_dp, -7389.83936383_dp] print *, derfc(arr1) if (any(abs(derfc(arr1) - [2.00000000000000000e+00_dp, 1.99999145591053606e+00_dp, & 2.00000000000000000e+00_dp]) > 1e-12_dp)) error stop arr2 = [6.738377383_dp, 3.1473863781_dp, 7389.83936383_dp] res = derfc(arr2) print *, res if (any(abs(res - [1.58035442023170862e-21_dp, 8.54408946394494113e-06_dp, & 0.00000000000000000e+00_dp]) > 1e-12_dp)) error stop end programlfortran-0.63.0/integration_tests/arrays_02_size.f900000664000175000017500000000061215174404631022540 0ustar alastairalastairprogram arrays_01 implicit none integer :: i, a(3), b(4) integer(8) :: size_a8 integer(8) :: size_b8 integer(4) :: size_a4 integer(4) :: size_b4 size_a4 = size(a, kind=4) size_b4 = size(b, dim=1, kind=4) size_a8 = size(a, kind=8) size_b8 = size(b, dim=1, kind=8) if( size_a4 /= 3 ) error stop if( size_b4 /= 4 ) error stop if( size_a8 /= 3_8 ) error stop if( size_b8 /= 4_8 ) error stop end lfortran-0.63.0/integration_tests/transfer_assumed_shape_01.f900000664000175000017500000000207215174404631024733 0ustar alastairalastairprogram transfer_assumed_shape_01 ! Test transfer() with assumed-shape (runtime-sized) source arrays ! and different element kinds. Verifies the byte-level reinterpretation ! works correctly when the source array size is only known at runtime. implicit none integer(4) :: v(2) v = [10, 20] call test_fixed(v) call test_same_kind(v) print *, "All tests passed" contains subroutine test_fixed(x) ! Different kind: int32 array -> int8 array (fixed-size target) integer(4), intent(in) :: x(:) integer(1) :: r(8) r = transfer(x, r) ! Little-endian: 10 = 0x0A000000, 20 = 0x14000000 if (r(1) /= 10) error stop if (r(2) /= 0) error stop if (r(3) /= 0) error stop if (r(4) /= 0) error stop if (r(5) /= 20) error stop if (r(6) /= 0) error stop if (r(7) /= 0) error stop if (r(8) /= 0) error stop end subroutine subroutine test_same_kind(x) ! Same kind: int32 array -> int32 array (fixed-size target) integer(4), intent(in) :: x(:) integer(4) :: r(2) r = transfer(x, r) if (r(1) /= 10) error stop if (r(2) /= 20) error stop end subroutine end program lfortran-0.63.0/integration_tests/select_type_18.f900000664000175000017500000000061115174404631022533 0ustar alastairalastairprogram select_type_18 implicit none logical, target :: l(3) class(*), pointer :: generic(:) logical, pointer :: p(:) l = [.true., .false., .true.] generic => l select type (generic) type is (logical) p => generic if (count(p) /= 2) error stop class default error stop end select print *, "ok" end program select_type_18 lfortran-0.63.0/integration_tests/elemental_23.f900000664000175000017500000000105715174404631022162 0ustar alastairalastairprogram elemental_23 implicit none integer :: body(1,2) integer, allocatable :: r(:) body = 1 r = f(body) if (size(r) /= 4) error stop if (any(r /= 1)) error stop contains elemental function g(x, y) result(r) integer, intent(in) :: x integer, intent(in), optional :: y integer :: r r = x end function pure function f(body) result(lines) integer, intent(in) :: body(:,:) integer, parameter :: n = 1 integer :: lines(size(body,1) + rank(body) + n) lines = 1 lines = g(lines, 1) end function end program lfortran-0.63.0/integration_tests/modules_72_otypemod.f900000664000175000017500000000061215174404631023604 0ustar alastairalastairmodule modules_72_otypemod use modules_72_stypemod implicit none type :: OtherType integer :: y = 0 end type OtherType interface OtherType procedure :: constructor end interface OtherType contains function constructor() result(self) type(OtherType) :: self self%y = 20 end function constructor end module modules_72_otypemod lfortran-0.63.0/integration_tests/arrays_reshape_40.f900000664000175000017500000000636715174404631023234 0ustar alastairalastairprogram arrays_reshape_40 implicit none double precision :: A(2,2) integer :: x(4), b_rt(2, 2), ord2(2) integer :: c(8), d(2, 2, 2), d_rt(2, 2, 2), ord3(3) integer, allocatable :: xa(:) integer, allocatable :: order_alloc(:) integer :: b_alloc_ct(2, 2), b_alloc_rt(2, 2) real :: src2(2, 2), packed2(2, 2) integer :: iperm(2) x = [1, 2, 3, 4] ord2 = [2, 1] b_rt = reshape(x, [2, 2], order=ord2) ! 2D runtime ORDER variable if (b_rt(1, 1) /= 1) error stop if (b_rt(2, 1) /= 3) error stop if (b_rt(1, 2) /= 2) error stop if (b_rt(2, 2) /= 4) error stop c = [1, 2, 3, 4, 5, 6, 7, 8] d = reshape(c, [2, 2, 2], order=[3, 1, 2]) ord3 = [3, 1, 2] d_rt = reshape(c, [2, 2, 2], order=ord3) ! 3D constant ORDER=[3,1,2] if (d(1, 1, 1) /= 1) error stop if (d(2, 1, 1) /= 3) error stop if (d(1, 2, 1) /= 5) error stop if (d(2, 2, 1) /= 7) error stop if (d(1, 1, 2) /= 2) error stop if (d(2, 1, 2) /= 4) error stop if (d(1, 2, 2) /= 6) error stop if (d(2, 2, 2) /= 8) error stop ! ! 3D runtime ORDER variable if (d_rt(1, 1, 1) /= 1) error stop if (d_rt(2, 1, 1) /= 3) error stop if (d_rt(1, 2, 1) /= 5) error stop if (d_rt(2, 2, 1) /= 7) error stop if (d_rt(1, 1, 2) /= 2) error stop if (d_rt(2, 1, 2) /= 4) error stop if (d_rt(1, 2, 2) /= 6) error stop if (d_rt(2, 2, 2) /= 8) error stop ! reshape with order=[2,1] where source elements are expressions (not literals) A = reshape([1d0+0d0, 2d0+0d0, 3d0+0d0, 4d0+0d0], shape=[2,2], order=[2,1]) ! With order=[2,1], elements fill row-major: ! A(1,1)=1, A(1,2)=2, A(2,1)=3, A(2,2)=4 print *, A(1,1) print *, A(1,2) print *, A(2,1) print *, A(2,2) if (abs(A(1,1) - 1d0) > 1d-10) error stop 1 if (abs(A(1,2) - 2d0) > 1d-10) error stop 2 if (abs(A(2,1) - 3d0) > 1d-10) error stop 3 if (abs(A(2,2) - 4d0) > 1d-10) error stop 4 ! allocatable source array + compile-time order allocate(xa(4)) xa = [1, 2, 3, 4] b_alloc_ct = reshape(xa, [2, 2], order=[2, 1]) if (b_alloc_ct(1, 1) /= 1) error stop if (b_alloc_ct(2, 1) /= 3) error stop if (b_alloc_ct(1, 2) /= 2) error stop if (b_alloc_ct(2, 2) /= 4) error stop ! allocatable source array + runtime order allocate(order_alloc(2)) order_alloc = [2, 1] b_alloc_rt = reshape(xa, [2, 2], order=order_alloc) if (b_alloc_rt(1, 1) /= 1) error stop if (b_alloc_rt(2, 1) /= 3) error stop if (b_alloc_rt(1, 2) /= 2) error stop if (b_alloc_rt(2, 2) /= 4) error stop ! subroutine test: real, intent(in) :: a(:,:) src2 = reshape([1.0, 2.0, 3.0, 4.0], [2, 2]) iperm = [2, 1] call pack_with_order(src2, iperm, packed2) if (abs(packed2(1, 1) - 1.0) > 1e-6) error stop if (abs(packed2(2, 1) - 3.0) > 1e-6) error stop if (abs(packed2(1, 2) - 2.0) > 1e-6) error stop if (abs(packed2(2, 2) - 4.0) > 1e-6) error stop contains subroutine pack_with_order(a, iperm, apack) real, intent(in) :: a(:,:) integer, intent(in) :: iperm(2) real, intent(out) :: apack(2,2) integer :: spack(2) spack = [2, 2] apack = reshape(a, shape=spack, order=iperm) end subroutine pack_with_order end program lfortran-0.63.0/integration_tests/format_75.f900000664000175000017500000000032215174404631021505 0ustar alastairalastairprogram format_75 implicit none character(len=32) :: s write(s, '(O0.3)') 34 if (trim(s) /= '042') error stop write(s, '(O3)') 34 if (s(1:3) /= ' 42') error stop end program format_75 lfortran-0.63.0/integration_tests/gpu_metal_05.f900000664000175000017500000000062415174404631022170 0ustar alastairalastairprogram gpu_metal_05 ! Integer arrays: element-wise addition implicit none integer, parameter :: n = 10000 integer :: a(n), b(n), c(n), c_expected(n) integer :: i do i = 1, n a(i) = i b(i) = i * 2 c(i) = 0 c_expected(i) = i + i * 2 end do do concurrent (i = 1:n) c(i) = a(i) + b(i) end do do i = 1, n if (c(i) /= c_expected(i)) error stop end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/arrays_117.f900000664000175000017500000000115515174404631021600 0ustar alastairalastairprogram arrays_117 use, intrinsic :: iso_fortran_env, only : int8, real64 implicit none integer(int8), parameter :: n = 25_int8 real(real64) :: random_vals(n) integer(int8) :: indx_r(n) integer :: i logical :: result ! initialize values random_vals = [(real(i, real64), i = 1, n)] ! vector subscript indices do i = 1, n indx_r(i) = int(i, int8) end do ! perform test result = all(random_vals(indx_r) <= random_vals(indx_r(20))) if (result .neqv. .false.) error stop "Vector subscript test failed" print *, "Test passed" end program arrays_117lfortran-0.63.0/integration_tests/file_60.f900000664000175000017500000000205515174404631021133 0ustar alastairalastairprogram file_60 implicit none character(16) :: access, action, blank, delim, direct, form, formatted, name, pad, position, & read, readwrite, sequential, unformatted, write logical :: exist, named, opened integer :: iostat, number, lun = 42 character(*), parameter :: lfn = 'file_60.dat' open (lun, file=lfn, status='old', iostat=iostat) if (iostat == 0) close (lun, status='delete') access = 'xxx'; action = 'xxx'; number = -42 inquire (file=lfn, access=access, action=action, direct=direct, form=form, & exist=exist, opened=opened, number=number, iostat=iostat) call pf (iostat == 0) call pf (access == 'UNDEFINED') call pf (.not. exist) call pf (.not. opened) call pf (number == -1) ! INQUIRE BY UNIT inquire (unit=lun, access=access, opened=opened, iostat=iostat) call pf (iostat == 0) call pf (.not. opened) contains subroutine pf (l) logical, intent(in) :: l if (.not. l) error stop 'FAILED' end subroutine end program lfortran-0.63.0/integration_tests/custom_operator_03.f900000664000175000017500000000120615174404631023433 0ustar alastairalastairmodule custom_operator_03_a implicit none public :: operator(.negation.) integer :: y interface operator(.negation.) module procedure negative end interface contains function negative(i) result(res) integer, intent(in) :: i integer :: res res = -i end function negative end module custom_operator_03_a module custom_operator_03_b integer :: negation = 5 end module custom_operator_03_b program custom_operator_03 use custom_operator_03_b, only: negation use custom_operator_03_a, temp => y implicit none integer :: res, x x = 10 res = .negation. x print *, res end program custom_operator_03 lfortran-0.63.0/integration_tests/complex_implicit_cast.f900000664000175000017500000001322715174404631024265 0ustar alastairalastairprogram complex_implicit_cast_test implicit none ! Test variables for different kinds and types complex(4) :: c4_1, c4_2 complex(8) :: c8_1, c8_2 real(4) :: r4_1, r4_2 real(8) :: r8_1, r8_2 integer :: i1, i2 ! Initialize test values c4_1 = (1.5, 2.5) c8_1 = (3.5d0, 4.5d0) r4_1 = 5.5 r8_1 = 6.5d0 i1 = 7 print *, "=== Complex Implicit Casting Tests ===" ! Test 1: Integer to Complex casting print *, "Test 1: Integer to Complex" c4_2 = i1 ! IntegerToComplex c8_2 = i1 ! IntegerToComplex print *, "c4_2 from integer:", c4_2 print *, "c8_2 from integer:", c8_2 if (abs(real(c4_2) - 7.0) > 1e-5) error stop "Integer to complex(4) real part failed" if (abs(aimag(c4_2) - 0.0) > 1e-5) error stop "Integer to complex(4) imag part failed" if (abs(real(c8_2) - 7.0d0) > 1e-10) error stop "Integer to complex(8) real part failed" if (abs(aimag(c8_2) - 0.0d0) > 1e-10) error stop "Integer to complex(8) imag part failed" ! Test 2: Real to Complex casting print *, "Test 2: Real to Complex" c4_2 = r4_1 ! RealToComplex c8_2 = r8_1 ! RealToComplex print *, "c4_2 from real(4):", c4_2 print *, "c8_2 from real(8):", c8_2 if (abs(real(c4_2) - 5.5) > 1e-5) error stop "Real(4) to complex(4) real part failed" if (abs(aimag(c4_2) - 0.0) > 1e-5) error stop "Real(4) to complex(4) imag part failed" if (abs(real(c8_2) - 6.5d0) > 1e-10) error stop "Real(8) to complex(8) real part failed" if (abs(aimag(c8_2) - 0.0d0) > 1e-10) error stop "Real(8) to complex(8) imag part failed" ! Test 3: Complex to Real casting (takes real part) print *, "Test 3: Complex to Real" r4_2 = c4_1 ! ComplexToReal r8_2 = c8_1 ! ComplexToReal print *, "r4_2 from complex(4):", r4_2 print *, "r8_2 from complex(8):", r8_2 if (abs(r4_2 - 1.5) > 1e-5) error stop "Complex(4) to real(4) failed" if (abs(r8_2 - 3.5d0) > 1e-10) error stop "Complex(8) to real(8) failed" ! Test 4: Complex to Integer casting (takes real part) print *, "Test 4: Complex to Integer" i2 = c4_1 ! ComplexToInteger print *, "i2 from complex(4):", i2 if (i2 /= 1) error stop "Complex(4) to integer failed" ! Test 5: Complex kind conversion (ComplexToComplex) print *, "Test 5: Complex kind conversion" c8_2 = c4_1 ! ComplexToComplex (4 to 8) c4_2 = c8_1 ! ComplexToComplex (8 to 4) print *, "c8_2 from complex(4):", c8_2 print *, "c4_2 from complex(8):", c4_2 if (abs(real(c8_2) - 1.5d0) > 1e-10) error stop "Complex(4) to complex(8) real part failed" if (abs(aimag(c8_2) - 2.5d0) > 1e-10) error stop "Complex(4) to complex(8) imag part failed" if (abs(real(c4_2) - 3.5) > 1e-5) error stop "Complex(8) to complex(4) real part failed" if (abs(aimag(c4_2) - 4.5) > 1e-5) error stop "Complex(8) to complex(4) imag part failed" ! Test 6: Cross-kind casting with ComplexRe and ComplexIm print *, "Test 6: ComplexRe/ComplexIm with kind conversion" r8_2 = c4_1%re ! ComplexRe with RealToReal cast (4 to 8) r4_2 = c8_1%re ! ComplexRe with RealToReal cast (8 to 4) print *, "r8_2 from c4_1%re:", r8_2 print *, "r4_2 from c8_1%re:", r4_2 if (abs(r8_2 - 1.5d0) > 1e-10) error stop "ComplexRe real(4) to real(8) failed" if (abs(r4_2 - 3.5) > 1e-5) error stop "ComplexRe real(8) to real(4) failed" r8_2 = c4_1%im ! ComplexIm with RealToReal cast (4 to 8) r4_2 = c8_1%im ! ComplexIm with RealToReal cast (8 to 4) print *, "r8_2 from c4_1%im:", r8_2 print *, "r4_2 from c8_1%im:", r4_2 if (abs(r8_2 - 2.5d0) > 1e-10) error stop "ComplexIm real(4) to real(8) failed" if (abs(r4_2 - 4.5) > 1e-5) error stop "ComplexIm real(8) to real(4) failed" ! Test 7: Complex constructor with mixed types (implicit casting) print *, "Test 7: Complex constructor with mixed types" c4_2 = cmplx(i1, r4_1) ! Integer and real(4) to complex(4) c8_2 = cmplx(r8_1, i1) ! Real(8) and integer to complex(8) print *, "c4_2 from cmplx(int, real4):", c4_2 print *, "c8_2 from cmplx(real8, int):", c8_2 if (abs(real(c4_2) - 7.0) > 1e-5) error stop "cmplx(int, real4) real part failed" if (abs(aimag(c4_2) - 5.5) > 1e-5) error stop "cmplx(int, real4) imag part failed" if (abs(real(c8_2) - 6.5d0) > 1e-10) error stop "cmplx(real8, int) real part failed" if (abs(aimag(c8_2) - 7.0d0) > 1e-10) error stop "cmplx(real8, int) imag part failed" ! Test 8: Array operations with implicit casting print *, "Test 8: Array operations with implicit casting" block complex(4) :: c4_arr(2) = [(1.0, 2.0), (3.0, 4.0)] complex(8) :: c8_arr(2) real(8) :: r8_arr(2) c8_arr = c4_arr ! ComplexToComplex array casting r8_arr = c4_arr%re ! ComplexRe with RealToReal array casting print *, "c8_arr from c4_arr:", c8_arr print *, "r8_arr from c4_arr%re:", r8_arr if (abs(real(c8_arr(1)) - 1.0d0) > 1e-10) error stop "Array complex(4) to complex(8) [1] real failed" if (abs(aimag(c8_arr(1)) - 2.0d0) > 1e-10) error stop "Array complex(4) to complex(8) [1] imag failed" if (abs(real(c8_arr(2)) - 3.0d0) > 1e-10) error stop "Array complex(4) to complex(8) [2] real failed" if (abs(aimag(c8_arr(2)) - 4.0d0) > 1e-10) error stop "Array complex(4) to complex(8) [2] imag failed" if (abs(r8_arr(1) - 1.0d0) > 1e-10) error stop "Array ComplexRe real(4) to real(8) [1] failed" if (abs(r8_arr(2) - 3.0d0) > 1e-10) error stop "Array ComplexRe real(4) to real(8) [2] failed" end block print *, "=== All Complex Implicit Casting Tests Passed! ===" end programlfortran-0.63.0/integration_tests/cpp_pre_11.f900000664000175000017500000000034215174404631021635 0ustar alastairalastair#define WRAP(exp, desc) result = (exp) program cpp_pre_11 implicit none logical :: result result = .false. WRAP (.true., "space before paren") if (.not. result) error stop print *, "passed" end program cpp_pre_11 lfortran-0.63.0/integration_tests/intrinsics_418.f900000664000175000017500000000107215174404631022466 0ustar alastairalastairprogram intrinsics_418 implicit none real, allocatable :: output_metrics(:,:) call use_nonalloc_sum() allocate(output_metrics(3,4)) output_metrics = 1.0 block real, allocatable :: mean_metrics(:) mean_metrics = sum(output_metrics, 1) / size(output_metrics, 1) print *, mean_metrics if (any(mean_metrics /= 1.0)) error stop end block contains subroutine use_nonalloc_sum() real :: a(3,4), b(4) a = 2.0 b = sum(a, 1) print *, b(1) end subroutine use_nonalloc_sum end program intrinsics_418 lfortran-0.63.0/integration_tests/custom_operator_06.f900000664000175000017500000000213315174404631023436 0ustar alastairalastairmodule custom_operator_06_a implicit none public :: string_t type string_t character(len=:), allocatable :: string_ contains generic :: operator(//) => string_t_cat_string_t procedure, private :: string_t_cat_string_t end type contains elemental module function from_characters(string) result(new_string) implicit none character(len=*), intent(in) :: string type(string_t) new_string new_string%string_ = string end function pure module function string_t_cat_string_t(lhs, rhs) result(lhs_cat_rhs) implicit none class(string_t), intent(in) :: lhs, rhs type(string_t) lhs_cat_rhs lhs_cat_rhs = string_t(lhs%string_ // rhs%string_) end function end module custom_operator_06_a module custom_operator_06_b use custom_operator_06_a implicit none contains subroutine test_concat type(string_t) :: str str = string_t("a") // string_t("b") end subroutine test_concat end module custom_operator_06_b program custom_operator_06 use custom_operator_06_b implicit none call test_concat() end program custom_operator_06 lfortran-0.63.0/integration_tests/cpp_pre_05.f900000664000175000017500000000037515174404631021646 0ustar alastairalastairprogram test_stringify implicit none #ifndef X /* ABC-comment */ #ifdef __GFORTRAN__ /* ABC-comment */ #define X 4 #else /* XYZ-comment */ #define X 5 #endif #endif print *, X end program test_stringify lfortran-0.63.0/integration_tests/where_04.f900000664000175000017500000000115115174404631021320 0ustar alastairalastairprogram main implicit none call compare_solutions() contains subroutine compare_solutions() implicit none real :: reldiff(2) real :: absdiff reldiff = [0.0,0.0] absdiff = 0.5 where (solution() /= 0.0) reldiff = absdiff / abs(solution()) if (abs(reldiff(1) - 5.0) > 1e-7) error stop if (abs(reldiff(2) - 5.0) > 1e-7) error stop print *, reldiff end subroutine compare_solutions pure function solution() result(x) implicit none real,dimension(:),allocatable :: x x = [0.10,0.10] end function solution end program main lfortran-0.63.0/integration_tests/end_name_match.f900000664000175000017500000000034215174404631022626 0ustar alastairalastairsubroutine add(x, y) integer x, y x = 4 y = 5 end subroutine Add program main integer x, y call add(x, y) if(x /= 4) error stop if(y /= 5) error stop if(x + y /= 9) error stop end program Main lfortran-0.63.0/integration_tests/intrinsics_293.f900000664000175000017500000000221715174404631022471 0ustar alastairalastairprogram intrinsics_293 use, intrinsic :: iso_fortran_env, only: dp => real64 real(dp) :: a integer :: i real(dp) :: dgamma_runtime_dp(3) = [0.875_dp, 3.367_dp, 2.140_dp] real(dp) :: dgamma_res_dp(3) real(dp) :: expected_dp(3) = [1.0896523574228969_dp, 2.8783551043979587_dp, 1.0675143148681314_dp] real(dp), parameter :: res(3) = dgamma([0.875_dp, 3.367_dp, 2.140_dp]) do i = 1, 3 print *, res(i) if (abs(res(i) - expected_dp(i)) > 1e-12_dp) error stop end do dgamma_res_dp = dgamma(dgamma_runtime_dp) do i = 1, 3 print *, dgamma_res_dp(i) if (abs(dgamma_res_dp(i) - expected_dp(i)) > 1e-12_dp) error stop end do a = dgamma(10.92839272_dp) print *, a if (a - 3067135.1568285478_dp > 1e-12_dp) error stop print *,dgamma(10.92839272_dp) if (dgamma(10.92839272_dp) - 3067135.1568285478_dp > 1e-12_dp) error stop a = dgamma(83.728927_dp) print *, a ! if (abs(a - 1.1895370148607565E+124_dp) > 1e-12_dp) error stop print *,dgamma(83.728927_dp) ! if (abs(dgamma(83.728927_dp) - 1.1895370148607565E+124_dp) > 1e-12_dp) error stop end program lfortran-0.63.0/integration_tests/finalization_03.f900000664000175000017500000000065315174404631022702 0ustar alastairalastair! recursive allocation + recursive free-ing program finalization_03 type t character(10) :: str type(t), allocatable :: t_internal end type t type(t) :: instance allocate(instance%t_internal) allocate(instance%t_internal%t_internal) allocate(instance%t_internal%t_internal%t_internal) allocate(instance%t_internal%t_internal%t_internal%t_internal) end program lfortran-0.63.0/integration_tests/file_open_05.f900000664000175000017500000000022515174404631022150 0ustar alastairalastairprogram file_open_5 use iso_fortran_env, only: output_unit open(output_unit, encoding="UTF-8") print *, "Hello" end program file_open_5 lfortran-0.63.0/integration_tests/read_07.f900000664000175000017500000000113315174404631021124 0ustar alastairalastair! MRE: Formatted READ with mixed types (string + logical) ! ICE in visit_FileRead: get_string_type() called on non-character type ! Reduced from LAPACK BLAS/TESTING/dblat2.f program read_07 implicit none character(6) :: sname logical :: ltest integer :: u, stat open(newunit=u, file="read_07_data.txt", status="old", iostat=stat) if (stat /= 0) error stop read(u, fmt=100, iostat=stat) sname, ltest if (stat /= 0) error stop 100 format(a6, l2) close(u) if (sname /= "ABCDEF") error stop if (.not. ltest) error stop print *, "PASS" end program read_07 lfortran-0.63.0/integration_tests/functions_22.f900000664000175000017500000000155415174404631022225 0ustar alastairalastairpure integer function fn1(A) result(r) implicit none real, intent(in) :: A(:,:) r = minval(shape(A)) end function subroutine diag_rsp_mat(A, res) implicit none interface pure integer function fn1(B) implicit none real, intent(in) :: B(:,:) end function end interface real, intent(in) :: A(:,:) real, intent(out) :: res(fn1(A)) print *, shape(res), fn1(A) if (fn1(A) /= 5) error stop end subroutine diag_rsp_mat program functions_22 implicit none real :: A(5, 5) real :: res(5) integer :: result interface subroutine diag_rsp_mat(A, res) implicit none interface pure integer function fn1(C) implicit none real, intent(in) :: C(:,:) end function end interface real, intent(in) :: A(:,:) real, intent(out) :: res(fn1(A)) end subroutine diag_rsp_mat end interface call diag_rsp_mat(A, res) end program lfortran-0.63.0/integration_tests/line_continuation_01.f900000664000175000017500000000041015174404631023721 0ustar alastairalastairprogram line_continuation_01 implicit none integer :: i i = 5 if (i < 4) & print *, i if (i > 4) & ! This will print print *, i if (i > 4) & ! This will also print print *, i if (i > 4) & ! Yes ! This will also print print *, i end program lfortran-0.63.0/integration_tests/polymorphic_select_type_02.f900000664000175000017500000000074615174404631025162 0ustar alastairalastairprogram polymorphic_select_type_02 integer :: a(3) = [1, 2, 3] call print_generic(a) contains subroutine print_generic(generic) class(*), intent(in) :: generic(:) select type (generic) type is (integer) if (size(generic) /= 3) error stop 1 if (any(generic /= [1, 2, 3])) error stop 2 class default error stop 3 end select end subroutine print_generic end program polymorphic_select_type_02 lfortran-0.63.0/integration_tests/types_10.f900000664000175000017500000000062315174404631021352 0ustar alastairalastairprogram types_10 implicit none integer :: i, j save i save :: j contains subroutine f(i) integer, intent(in) :: i integer, save :: j j = i end subroutine subroutine g(i) integer, intent(in) :: i integer :: j save j j = i end subroutine subroutine h(i) integer, intent(in) :: i integer :: j save j = i end subroutine end program lfortran-0.63.0/integration_tests/derived_types_132.f900000664000175000017500000000115715174404631023144 0ustar alastairalastairprogram derived_types_132 ! Test: value assignment through a derived-type pointer writes to the target, ! not to a copy. p => tgt makes p point to tgt; p = src must copy the value ! of src into tgt (not re-associate p). implicit none type :: t integer :: val = 0 end type type(t), target :: tgt type(t) :: src type(t), pointer :: p tgt%val = 99 src%val = 42 p => tgt p = src if (tgt%val /= 42) error stop 1 if (p%val /= 42) error stop 2 ! Also verify assignment of a literal struct constructor through the pointer p%val = 0 src%val = 77 p = src if (tgt%val /= 77) error stop 3 print *, "ok" end program lfortran-0.63.0/integration_tests/intrinsics_401.f900000664000175000017500000000123315174404631022455 0ustar alastairalastairprogram intrinsics_401 implicit none integer :: arr(3) integer :: result arr = [5, 10, 15] result = minloc(array=arr, dim=1, mask=[.false., .false., .false.]) print*, result if (result /= 0) error stop "minloc with all-false mask should return 0" arr = [5, 10, 15] if (any(minloc(array=arr, mask=[.false., .false., .false.]) /= 0)) then error stop "minloc with all-false mask (array result) should return 0" end if print *, minloc(arr, .true.) if(any(minloc(arr, .true.) /= 1)) error stop print *, minloc(arr, .false.) if(any(minloc(arr, .false.) /= 0)) error stop end program intrinsics_401 lfortran-0.63.0/integration_tests/string_76.f900000664000175000017500000000054415174404631021532 0ustar alastairalastairmodule string_76_mod implicit none contains character(5) function tolower (c) result (res) character, intent(in) :: c res = merge (achar (iachar (c) + 32), c, c >= 'A' .and. c <= 'Z') // "...." end function end module program string_76 use string_76_mod implicit none if (tolower("A") /= "a....") error stop end program string_76 lfortran-0.63.0/integration_tests/separate_compilation_31.f900000664000175000017500000000022015174404631024404 0ustar alastairalastairprogram separate_compilation_31 use separate_compilation_31b_module, only: get_my_obj implicit none end program separate_compilation_31 lfortran-0.63.0/integration_tests/write_fortran_02.f900000664000175000017500000000216415174404631023076 0ustar alastairalastairprogram write_fortran_02 implicit none character(len=100) :: output integer :: val, ierr real :: fval val = 12345 fval = 3.14159 write(output, '(I0)') val if (trim(output) /= "12345") error stop "Integer variable failed" write(output, '(A, I0, A)') "Value: ", val, " units" if (trim(output) /= "Value: 12345 units") error stop "Mixed format failed" write(output, '(F8.2)') fval if (trim(adjustl(output)) /= "3.14") error stop "Real variable failed" write(output, '(I0, 1X, I0, 1X, I0)') 10, 20, 30 if (trim(output) /= "10 20 30") error stop "Separator format failed" write(output, '(I0)') -99 if (trim(output) /= "-99") error stop "Negative integer failed" write(output, '(A, I0, A, F6.2)') "x=", 10, " y=", 20.5 if (trim(output) /= "x=10 y= 20.50") error stop "Complex mixed format failed" write(output, '(A10)') "World" if (output(6:10) /= "World") error stop "A10 format failed" write(output, '(A)', iostat=ierr) "Hello World" if (ierr /= 0) error stop "iostat check failed" end program write_fortran_02 lfortran-0.63.0/integration_tests/modules_18c.c0000664000175000017500000000665215174404631021665 0ustar alastairalastair#include #include "modules_18c.h" int f_int_float(int *a, float *b) { return *a + *b; } int f_int_double(int *a, double *b) { return *a + *b; } int f_int_float_complex(int *a, float_complex_t *b) { return *a + crealf(*b) + cimagf(*b); } int f_int_double_complex(int *a, double_complex_t *b) { return *a + creal(*b) + cimag(*b); } int f_int_float_complex_value(int a, float_complex_t b) { return a + crealf(b) + cimagf(b); } int f_int_double_complex_value(int a, double_complex_t b) { return a + creal(b) + cimag(b); } float_complex_t f_float_complex_value_return(float_complex_t b) { float_complex_t r; #if _WIN32 r = _FCmulcr(b, 2.0); #else r = b * 2; #endif return r; } double_complex_t f_double_complex_value_return(double_complex_t b) { double_complex_t r; #if _WIN32 r = _Cmulcr(b, 2.0); #else r = b * 2; #endif return r; } int f_int_float_value(int a, float b) { return a + b; } int f_int_double_value(int a, double b) { return a + b; } int f_int_intarray(int n, int *b) { int i; int s; s = 0; for (i=0; i < n; i++) { s += b[i]; } return s; } float f_int_floatarray(int n, float *b) { int i; float s; s = 0; for (i=0; i < n; i++) { s += b[i]; } return s; } double f_int_doublearray(int n, double *b) { int i; double s; s = 0; for (i=0; i < n; i++) { s += b[i]; } return s; } float f_int_floatarray_star(int n, float *b) { int i; float s; s = 0; for (i=0; i < n; i++) { s += b[i]; } return s; } // -------------------------------------------------------------------- void sub_int_float(int *a, float *b, int *r) { *r = *a + *b; } void sub_int_double(int *a, double *b, int *r) { *r = *a + *b; } void sub_int_float_complex(int *a, float_complex_t *b, int *r) { *r = *a + crealf(*b) + cimagf(*b); } void sub_int_double_complex(int *a, double_complex_t *b, int *r) { *r = *a + creal(*b) + cimag(*b); } void sub_int_float_value(int a, float b, int *r) { *r = a + b; } void sub_int_double_value(int a, double b, int *r) { *r = a + b; } void sub_int_float_complex_value(int a, float_complex_t b, int *r) { *r = a + crealf(b) + cimagf(b); } void sub_int_double_complex_value(int a, double_complex_t b, int *r) { *r = a + creal(b) + cimag(b); } void sub_int_intarray(int n, int *b, int *r) { int i; int s; s = 0; for (i=0; i < n; i++) { s += b[i]; } *r = s; } void sub_int_floatarray(int n, float *b, float *r) { int i; float s; s = 0; for (i=0; i < n; i++) { s += b[i]; } *r = s; } void sub_int_doublearray(int n, double *b, double *r) { int i; double s; s = 0; for (i=0; i < n; i++) { s += b[i]; } *r = s; } int f_string(char *s) { return strlen(s); } int32_t call_fortran_i32(int32_t i) { return fortran_i32(&i); } int32_t call_fortran_i32_value(int32_t i) { return fortran_i32_value(i); } int64_t call_fortran_i64(int64_t i) { return fortran_i64(&i); } int64_t call_fortran_i64_value(int64_t i) { return fortran_i64_value(i); } float call_fortran_f32(float i) { return fortran_f32(&i); } float call_fortran_f32_value(float i) { return fortran_f32_value(i); } double call_fortran_f64(double i) { return fortran_f64(&i); } double call_fortran_f64_value(double i) { return fortran_f64_value(i); } lfortran-0.63.0/integration_tests/format_16.f900000664000175000017500000000020015174404631021473 0ustar alastairalastairprogram format_16 integer ::i write(*,201) ('*',i=1,10) 201 FORMAT( 10X, 'whatever', /, 10A ) end program format_16lfortran-0.63.0/integration_tests/c_ptr_05.f900000664000175000017500000000234315174404631021322 0ustar alastairalastairprogram c_ptr_05 use iso_c_binding, only: c_ptr, c_f_pointer, c_char, c_loc, c_null_char, c_associated implicit none type(c_ptr) :: plapla integer(8) :: ii character(len=:,kind=c_char), allocatable, target :: buffer character(len=:), allocatable :: result ii = 4 allocate(character(len=ii+1,kind=c_char) :: buffer) buffer = c_char_"ABCD" // c_null_char plapla = c_loc(buffer) result = f_string_cptr_n(plapla, ii) print *, "Returned string:", trim(result) if (trim(result) /= "ABCD") error stop contains function f_string_cptr_n(cptr, n) result(s) use iso_c_binding, only: c_ptr, c_f_pointer, c_char implicit none type(c_ptr), intent(in), value :: cptr integer(8), intent(in) :: n character(len=n,kind=c_char) :: s character(len=n,kind=c_char), pointer :: sptr if (.not. c_associated(cptr)) then error stop "ERROR: f_string_cptr_n(): NULL C pointer passed" end if call c_f_pointer(cptr, sptr) if (.not. associated(sptr)) then error stop "ERROR: c_f_pointer(): failed to associate Fortran pointer" end if s = sptr end function f_string_cptr_n end program lfortran-0.63.0/integration_tests/derived_types_70.f900000664000175000017500000000107015174404631023057 0ustar alastairalastairprogram derived_types_70 implicit none type :: task logical :: done end type task type :: container type(task), allocatable :: deps(:) end type container class(container), allocatable :: x logical :: finished integer :: i allocate(x) allocate(x%deps(3)) call temp(x) if (any(x%deps(:)%done .neqv. [.true., .false., .true.])) error stop contains subroutine temp(tab) class(container), intent(inout) :: tab tab%deps(1)%done = .true. tab%deps(2)%done = .false. tab%deps(3)%done = .true. end subroutine end program lfortran-0.63.0/integration_tests/char_array_initialization_declaration.f900000664000175000017500000000175015174404631027477 0ustar alastairalastairprogram char_array_initialization_declaration CHARACTER(len=2) :: char1(2) = "ap" CHARACTER(len=3), dimension(2) :: char2 = "app" CHARACTER(*), dimension(2), parameter :: char1_param = "ap" CHARACTER, parameter :: char2_param(2)*3 = "ghi" CHARACTER, parameter :: char3_param*(2 + 1) = "App" CHARACTER :: char3*4 = "Goat" CHARACTER :: char4*4 print *, char1 if (char1(1) /= "ap") error stop if (char1(2) /= "ap") error stop print *, char2 if (char2(1) /= "app") error stop if (char2(2) /= "app") error stop print *, char1_param if (char1_param(1) /= "ap") error stop if (char1_param(2) /= "ap") error stop print *, char2_param if (char2_param(1) /= "ghi") error stop if (char2_param(2) /= "ghi") error stop print *, char3_param if (char3_param /= "App") error stop print *, char3 if (char3 /= "Goat") error stop char4 = "Boat" print *, char4 if (char4 /= "Boat") error stop end program lfortran-0.63.0/integration_tests/modules_21b.f900000664000175000017500000000023015174404631022014 0ustar alastairalastairmodule modules_21b contains subroutine sub(n) integer, intent(in) :: n real, allocatable, dimension(:) :: X allocate(X(n)) end subroutine end module lfortran-0.63.0/integration_tests/select_type_16.f900000664000175000017500000000071515174404631022536 0ustar alastairalastairprogram select_type_16 class(*), allocatable :: s call ss("hello") contains subroutine ss(x) class(*) :: x character(:),allocatable :: buffer allocate(character(len=100) :: buffer) select type(x) type is (character(len=*)) write(buffer, "(A,A)") "string:", x class default error stop "unknown type" end select print *, buffer if(trim(buffer) /= "string:hello") error stop end subroutine end programlfortran-0.63.0/integration_tests/intrinsics_217.f900000664000175000017500000000141015174404631022457 0ustar alastairalastairprogram intrinsics_217 implicit none logical :: l logical :: a(3) = [.true., .true., .false.] logical :: x(2, 2) print *, all(a) if (all(a)) error stop a = [.true., .true., .true.] print *, all(a) if (.not. all(a)) error stop x(1, 1) = .true. x(1, 2) = .true. x(2, 1) = .true. x(2, 2) = .false. print *, all(x) if (all(x)) error stop l = all([.true., .true., .true.]) print *, l call section contains subroutine section integer a(2,3), b(2,3) a = 1 b = 1 b(2,2) = 2 print *, all(a == b, 1) if (all(all(a == b, 1))) error stop print *, all(a == b, 2) if (.not. any(all(a == b, 2))) error stop end subroutine section end program lfortran-0.63.0/integration_tests/array_bound_5.f900000664000175000017500000000075415174404631022444 0ustar alastairalastairprogram array_bound_5 implicit none real :: arr(10, 20) call test_assumed_size_bounds(arr) contains subroutine test_assumed_size_bounds(a) real :: a(10, *) ! lbound/ubound on non-last dimensions are valid for assumed-size arrays if (lbound(a, 1) /= 1) error stop if (ubound(a, 1) /= 10) error stop if (lbound(a, 2) /= 1) error stop ! ubound(a, 2) would be an error - last dim is assumed-size print *, "OK: assumed-size array bounds" end subroutine end program lfortran-0.63.0/integration_tests/format_07.f900000664000175000017500000000067115174404631021507 0ustar alastairalastairprogram format_07 implicit none integer, parameter :: dp=kind(0d0) real(dp) :: x(3) real :: z(3) integer :: y(4) x = [1._dp,1._dp,1._dp] y = [117,123,124,126] z = [1.0,2.0,3.0] 10 format(3d12.5) 20 format(4i10) 30 format(3d12.5) print 10, x print 20, y print 30, z write (*,40) x write (*,50) y write (*,60) z 40 format(3d12.5) 50 format(4i10) 60 format(3d12.5) end programlfortran-0.63.0/integration_tests/class_allocate_03.f900000664000175000017500000000170415174404631023162 0ustar alastairalastairprogram class_allocate_03 implicit none type :: base end type base type, extends(base) :: derived character(len=20), allocatable :: names(:) end type derived class(base), allocatable :: obj call get_command_line_settings(obj) select type(obj) type is(derived) if (size(obj%names) /= 2) error stop if (obj%names(1) /= 'global_name1') error stop if (obj%names(2) /= 'global_name2') error stop end select contains subroutine get_command_line_settings(cmd_settings) class(base), allocatable, intent(out) :: cmd_settings character(len=20), allocatable :: global_names(:) allocate(character(len=20) :: global_names(2)) global_names = ['global_name1', 'global_name2'] allocate(derived :: cmd_settings) cmd_settings = derived(names = global_names) end subroutine get_command_line_settings end program class_allocate_03 lfortran-0.63.0/integration_tests/allocatable_component_struct_array_01.f900000664000175000017500000000150615174404631027336 0ustar alastairalastairmodule pkg_mod implicit none type :: variant_t integer, allocatable :: executable(:) end type variant_t contains subroutine temp_func(src) type(variant_t), intent(in) :: src if (.not. allocated(src%executable)) error stop "expected allocated" end subroutine temp_func end module pkg_mod program allocatable_component_struct_array_01 use pkg_mod implicit none type(variant_t) :: variants_array(2) integer :: j allocate(variants_array(1)%executable(1)) variants_array(1)%executable(1) = 1 call temp_func(variants_array(1)) if (allocated(variants_array(2)%executable)) error stop "expected unallocated" do j = 1, size(variants_array) if (allocated(variants_array(j)%executable) .neqv. (j == 1)) error stop "allocation mismatch" end do end program allocatable_component_struct_array_01 lfortran-0.63.0/integration_tests/lapack_03.f900000664000175000017500000000017715174404631021447 0ustar alastairalastair PROGRAM LAPACK_03 C Crash with --cpp-infer --fixed-form when file ends with whitespace PRINT *, 'PASS' END lfortran-0.63.0/integration_tests/file_open_03.f900000664000175000017500000000064215174404631022151 0ustar alastairalastairprogram open_stream_form use iso_fortran_env, only: int32 implicit none integer(int32) :: x, y x = 123456 open(10, file="file_open_03_data.bin", access="stream") write(10) x close(10) open(10, file="file_open_03_data.bin", access="stream") read(10) y close(10) if (y /= x) then print *, "FAIL: expected", x, "got", y error stop 1 end if end program lfortran-0.63.0/integration_tests/arrays_101.f900000664000175000017500000000210615174404631021566 0ustar alastairalastairprogram static_large_array implicit none ! Test that large fixed-size arrays use heap allocation instead of stack ! This prevents stack overflow for arrays >= 4096 bytes (4 KB) ! The allocated memory is automatically freed at function exit ! Small array (4 * 100 = 400 bytes < 4096) - should use stack real :: small_arr(100) ! Large array (4 * 2000 = 8000 bytes >= 4096) - should use heap real :: large_arr(2000) integer :: i real :: sum ! Initialize arrays small_arr = 1.0 large_arr = 2.0 ! Simple verification if (small_arr(1) /= 1.0) error stop if (large_arr(1) /= 2.0) error stop ! Test BLOCK in loop - arrays must be freed each iteration ! Without heap allocation, this would cause stack overflow or memory leak sum = 0.0 do i = 1, 1000 block real :: block_arr(500) ! 2000 bytes, but BLOCK always uses heap block_arr = real(i) sum = sum + block_arr(1) end block end do if (abs(sum - 500500.0) > 0.1) error stop print *, "OK" end program lfortran-0.63.0/integration_tests/procedure_20.f900000664000175000017500000000237215174404631022202 0ustar alastairalastairmodule procedure_20_mod1 implicit none public cauchy interface cauchy module procedure cauchy_sngl end interface cauchy contains subroutine cauchy_sngl(f, i) interface function f(z) result(r) integer r complex, intent(in) :: z end function f end interface integer, intent(out) :: i integer, parameter :: n = 2 i = n * f((1, 2)) end subroutine cauchy_sngl end module procedure_20_mod1 module procedure_20_mod2 use procedure_20_mod1 implicit none contains subroutine wind0_sngl(i, f) interface function f(z) result(r) integer r complex, intent(in) :: z end function f end interface integer, intent(out) :: i call cauchy(f, i) end subroutine wind0_sngl end module procedure_20_mod2 program procedure_20 use procedure_20_mod2 implicit none integer :: i call wind0_sngl(i, test_function) print *, "i: ", i if (i /= 10) error stop contains function test_function(z) result(r) complex, intent(in) :: z integer :: r r = 5 end function test_function end program procedure_20 lfortran-0.63.0/integration_tests/test_ieee_rint.f900000664000175000017500000000406115174404631022710 0ustar alastairalastair! Test ieee_rint function program test_ieee_rint use, intrinsic :: ieee_arithmetic use, intrinsic :: iso_fortran_env, only: real32, real64 implicit none real(real32) :: x_sp, r_sp real(real64) :: x_dp, r_dp print *, "Testing ieee_rint..." ! Test 1: Round 2.3 (should round to 2.0 with round-to-nearest) x_sp = 2.3_real32 r_sp = ieee_rint(x_sp) print *, "ieee_rint(2.3) = ", r_sp if (abs(r_sp - 2.0_real32) > 1.0e-6) error stop "2.3 should round to 2.0" ! Test 2: Round 2.7 (should round to 3.0) x_sp = 2.7_real32 r_sp = ieee_rint(x_sp) print *, "ieee_rint(2.7) = ", r_sp if (abs(r_sp - 3.0_real32) > 1.0e-6) error stop "2.7 should round to 3.0" ! Test 3: Round 2.5 (should round to 2.0 - round to even) x_sp = 2.5_real32 r_sp = ieee_rint(x_sp) print *, "ieee_rint(2.5) = ", r_sp if (abs(r_sp - 2.0_real32) > 1.0e-6) error stop "2.5 should round to 2.0 (nearest even)" ! Test 4: Round 3.5 (should round to 4.0 - round to even) x_sp = 3.5_real32 r_sp = ieee_rint(x_sp) print *, "ieee_rint(3.5) = ", r_sp if (abs(r_sp - 4.0_real32) > 1.0e-6) error stop "3.5 should round to 4.0 (nearest even)" ! Test 5: Negative numbers x_sp = -2.7_real32 r_sp = ieee_rint(x_sp) print *, "ieee_rint(-2.7) = ", r_sp if (abs(r_sp - (-3.0_real32)) > 1.0e-6) error stop "-2.7 should round to -3.0" ! Test 6: Already integer x_sp = 5.0_real32 r_sp = ieee_rint(x_sp) print *, "ieee_rint(5.0) = ", r_sp if (abs(r_sp - 5.0_real32) > 1.0e-6) error stop "5.0 should remain 5.0" ! Test 7: Double precision x_dp = 7.6_real64 r_dp = ieee_rint(x_dp) print *, "ieee_rint(7.6d0) = ", r_dp if (abs(r_dp - 8.0_real64) > 1.0e-10) error stop "7.6d0 should round to 8.0d0" ! Test 8: Zero x_sp = 0.0_real32 r_sp = ieee_rint(x_sp) print *, "ieee_rint(0.0) = ", r_sp if (r_sp /= 0.0_real32) error stop "0.0 should remain 0.0" print *, "All ieee_rint tests passed!" end program test_ieee_rint lfortran-0.63.0/integration_tests/file_13.f900000664000175000017500000000132015174404631021123 0ustar alastairalastairprogram file_13 implicit none integer :: num character(:), allocatable :: filename, form, status, access open(UNIT=1, file="file_01_data.txt", form="formatted", access="stream", status="old") read(1, *) num close(1) print *, num if (num /= 10130) error stop allocate(character(16) :: filename) allocate(character(9) :: form) allocate(character(6) :: status) allocate(character(3) :: access) filename = "file_03_data.txt" form = "formatted" access = "stream" status = "old" open(UNIT=1, file=filename, form=form, access=access, status=status, pad="no") read(1, *) num close(1) print *, num if (num /= 10) error stop end program lfortran-0.63.0/integration_tests/recursion_02.f900000664000175000017500000000143715174404631022224 0ustar alastairalastairmodule recursion_02 implicit none contains integer function solver(f, iter) interface integer function f() end function end interface !procedure(f_type) :: f integer, intent(in) :: iter integer f_val f_val = f() print *, "before:", f_val solver = sub1(2, iter-1) !solver = sub1(2, iter-1) + f() f_val = f() print *, "after:", f_val end function integer function sub1(y, iter) integer, intent(in):: y, iter integer x integer tmp x = y print *, "in sub1" if (iter == 1) then sub1 = 1 return end if tmp = getx() sub1 = solver(getx, iter) contains integer function getx() print *, "x in getx", x getx = x end function end function end module recursion_02 program main use recursion_02 implicit none integer :: r r = sub1(3, 3) print *, "r =", r end program main lfortran-0.63.0/integration_tests/multi_file_member_access_01.f900000664000175000017500000000032215174404631025203 0ustar alastairalastairprogram multi_file_member_access_01 use member_access_mod implicit none type(string_buffer) :: buf if (buf%number_of_elems() /= 0) error stop 1 print *, "OK" end program multi_file_member_access_01 lfortran-0.63.0/integration_tests/test_iso_fortran_env.f900000664000175000017500000000071115174404631024140 0ustar alastairalastairprogram test_iso_fortran_env use iso_fortran_env, only: int32, int64, real32, real64 implicit none real(real32) :: r4 real(real64) :: r8 integer(int32) :: i4 integer(int64) :: i8 real(real32), parameter :: r4p = 1._real32 integer(int32), parameter :: i4p = 1_int32 r4 = 1._real32 r8 = 1._real64 i4 = 1_int32 i8 = 1_int64 !if (kind(r4) /= 4) error stop !if (kind(r8) /= 8) error stop !if (kind(i4) /= 4) error stop !if (kind(i8) /= 8) error stop end program lfortran-0.63.0/integration_tests/submodule_45.f900000664000175000017500000000106515174404631022216 0ustar alastairalastairmodule the_interface implicit none integer, parameter :: dp = selected_real_kind(15) interface real(dp) module function pi() result(p) end function pi end interface end module the_interface submodule (the_interface) the_calculation implicit none contains real(dp) module function pi() result(p) p = acos(-1.0_dp) end function pi end submodule the_calculation program submodule_45 use the_interface implicit none real(dp) :: val val = pi() if (abs(val - 3.141592653589793_dp) > 1.0e-10_dp) error stop end program submodule_45 lfortran-0.63.0/integration_tests/block_10.f900000664000175000017500000000066615174404631021307 0ustar alastairalastairprogram block_10 implicit none integer :: i character(len=100) :: result result = "" do i = 1, 2 block character(len=:), allocatable :: temp(:) temp = [character(len=5) :: "a", "b", "c"] if (i == 1) then result = temp(1) end if end block end do if (trim(result) /= "a") error stop "Expected: a" print *, "PASS" end program lfortran-0.63.0/integration_tests/cmd_03.f900000664000175000017500000000034015174404631020747 0ustar alastairalastairprogram cmd_03 implicit none integer :: i character(len=32) :: arg i = 0 do call get_command_argument(i, arg) if (len_trim(arg) == 0) exit write (*,*) trim(arg) i = i + 1 end do end program cmd_03lfortran-0.63.0/integration_tests/separate_compilation_23a.f900000664000175000017500000000237115174404631024557 0ustar alastairalastairmodule string_type_separate_compilation_23 implicit none private public :: string_type public :: operator(//) type :: string_type sequence private character(len=:), allocatable :: raw end type string_type interface operator(//) module procedure :: concat_string_string end interface operator(//) contains elemental function concat_string_string(lhs, rhs) result(string) type(string_type), intent(in) :: lhs type(string_type), intent(in) :: rhs type(string_type) :: string end function concat_string_string end module string_type_separate_compilation_23 module ansi_separate_compilation_23 implicit none private public :: ansi_code public :: operator(//) type :: ansi_code private integer(1) :: style = -1 integer(1) :: bg = -1 integer(1) :: fg = -1 end type ansi_code interface operator(//) pure module function concat_left(lval, code) result(str) character(len=*), intent(in) :: lval type(ansi_code), intent(in) :: code character(len=:), allocatable :: str end function concat_left end interface operator(//) end module ansi_separate_compilation_23lfortran-0.63.0/integration_tests/procedure_04.f900000664000175000017500000000111415174404631022175 0ustar alastairalastairmodule procedure_04_mod interface subroutine func(n) integer, intent(inout) :: n end subroutine end interface contains subroutine g(fcn2, n) procedure(func) :: fcn2 integer, intent(inout) :: n call fcn2(n) end subroutine subroutine f(fcn1, n) procedure(func) :: fcn1 integer, intent(inout) :: n call g(fcn1, n) end subroutine end module program procedure_04 use procedure_04_mod, only: f integer :: n n = 5 call f(myfn, n) print *, n if (n /= 6) error stop contains subroutine myfn(n) integer, intent(inout) :: n n = n + 1 end subroutine end program lfortran-0.63.0/integration_tests/do_loop_02.f900000664000175000017500000000075215174404631021645 0ustar alastairalastairprogram main implicit none integer :: i, j i = 0 outer : do i = i + 1 j = 0 inner : do j = j + 1 if (j == 5) then print *, j exit inner end if end do inner print *, "out of inner loop" if ( i == 2 ) then exit outer end if end do outer if (i /= 2) error stop if (j /= 5) error stop print *, "out of outer loop" end program lfortran-0.63.0/integration_tests/intrinsics_396.f900000664000175000017500000000053315174404631022474 0ustar alastairalastairprogram intrinsics_395 character(:), allocatable :: dir integer :: i integer :: stat character(len=:), allocatable :: redirect, total redirect = " >/dev/null 2>&1" dir = "fortran_scratch2" total = "test -d fortran_scratch2 >/dev/null 2>&1" call execute_command_line(total, exitstat=stat) end program intrinsics_395 lfortran-0.63.0/integration_tests/modules_16b.f900000664000175000017500000000033115174404631022022 0ustar alastairalastairmodule modules_16b contains integer function sfloor(x) result(r) real, intent(in) :: x r = x end function integer function imodulo(x) result(r) integer, intent(in) :: x r = sfloor(real(x)) end function end module lfortran-0.63.0/integration_tests/intent_out_struct_member_no_dealloc.f900000664000175000017500000000302215174404631027204 0ustar alastairalastair! Test: allocatable struct member passed to non-allocatable struct intent(out) ! The allocatable actual should NOT be deallocated when dummy is non-allocatable ! This is a regression test for incorrect ImplicitDeallocate generation module intent_out_struct_member_no_dealloc_m implicit none type :: inner_t integer :: val end type inner_t type :: wrapper_t type(inner_t), allocatable :: inner end type wrapper_t contains ! Non-allocatable struct intent(out) - should NOT deallocate actual subroutine set_inner(x) type(inner_t), intent(out) :: x x%val = 99 end subroutine set_inner end module intent_out_struct_member_no_dealloc_m program intent_out_struct_member_no_dealloc use intent_out_struct_member_no_dealloc_m implicit none type(wrapper_t) :: w logical :: was_allocated_before, is_allocated_after allocate(w%inner) w%inner%val = 1 was_allocated_before = allocated(w%inner) ! w%inner is allocatable struct member ! But set_inner takes non-allocatable struct intent(out) ! This should NOT deallocate w%inner before the call call set_inner(w%inner) is_allocated_after = allocated(w%inner) ! Verify allocation status was preserved if (.not. was_allocated_before) error stop 1 if (.not. is_allocated_after) then print *, "BUG: w%inner was incorrectly deallocated!" error stop 2 end if if (w%inner%val /= 99) error stop 3 print *, "Test passed" end program intent_out_struct_member_no_dealloc lfortran-0.63.0/integration_tests/file_29.f900000664000175000017500000000270615174404631021143 0ustar alastairalastairprogram file_29 implicit none integer :: io, stat character(len=31) :: buffer character(len=3) :: temp = "no" open(newunit=io, status="scratch") write(io, "(a)") repeat("abc", 10), repeat("def", 100), repeat("ghi", 1000) rewind(io) ! Test 1: advance="no" triggers EOR read(io, '(a)', advance="no", iostat=stat) buffer if (stat /= -2) error stop if (.not. is_iostat_eor(stat)) error stop if (is_iostat_end(stat)) error stop ! Test 2: normal read after EOR read(io, '(a)', advance="no", iostat=stat) buffer if (stat /= 0) error stop if (is_iostat_eor(stat)) error stop if (is_iostat_end(stat)) error stop ! Test 3: advance="yes" normal read rewind(io) read(io, '(a)', advance="yes", iostat=stat) buffer if (stat /= 0) error stop if (is_iostat_eor(stat)) error stop if (is_iostat_end(stat)) error stop ! Test 4: variable advance mode ("no") rewind(io) read(io, '(a)', advance=temp, iostat=stat) buffer if (stat /= -2) error stop if (.not. is_iostat_eor(stat)) error stop if (is_iostat_end(stat)) error stop ! Test 5: switch temp to "yes" and continue temp = "yes" read(io, '(a)', advance=temp, iostat=stat) buffer if (stat /= 0) error stop ! Check end of file (EOF) do read(io, '(a)', iostat=stat) buffer if (stat /= 0) exit end do if (.not. is_iostat_end(stat)) error stop close(io) end program file_29 lfortran-0.63.0/integration_tests/doloop_08.f900000664000175000017500000000025715174404631021514 0ustar alastairalastairprogram doloop_08 implicit none integer :: i i = 1 do i = i + 1 if (i == 10) exit end do if (i /= 10) error stop end program doloop_08 lfortran-0.63.0/integration_tests/procedure_31.f900000664000175000017500000000210515174404631022176 0ustar alastairalastair! Test that a procedure pointer with a derived-type allocatable array in its ! interface can be passed as an actual argument to a non-pointer dummy procedure. ! Regression test for two issues: ! 1) semantic type check was not stripping Pointer(FunctionType), ! 2) LLVM call lowering did an extra load for procedure-pointer actual args. program procedure_31 implicit none type :: t integer :: val end type t interface subroutine iface(x) import :: t type(t), allocatable, intent(out) :: x(:) end subroutine iface end interface procedure(iface), pointer :: f type(t), allocatable :: result(:) f => mysub call sub(f, result) if (result(1)%val /= 42) error stop contains subroutine mysub(x) type(t), allocatable, intent(out) :: x(:) allocate(x(1)) x(1)%val = 42 end subroutine mysub subroutine sub(p, result) procedure(iface) :: p type(t), allocatable, intent(out) :: result(:) call p(result) end subroutine sub end program procedure_31 lfortran-0.63.0/integration_tests/submodule_18c.f900000664000175000017500000000036415174404631022362 0ustar alastairalastairsubmodule(julienne_formats_m_submodule_18b) julienne_formats_s_submodule_18b implicit none contains module procedure separated_values format_string = "(*(G25.20,:,','))" end procedure end submodule julienne_formats_s_submodule_18b lfortran-0.63.0/integration_tests/derived_types_26.f900000664000175000017500000000314515174404631023065 0ustar alastairalastairmodule derived_types_26_fpm_error_module implicit none type :: error_t character(len=:), allocatable :: message integer :: z end type error_t contains function bad_name_error(error, label, name) type(error_t), allocatable, intent(out) :: error character(len=*), intent(in) :: label character(len=*), intent(in) :: name integer :: bad_name_error allocate(error) ! allocate(character(len=4) :: error%message) ! TODO: Should happen automatically in AST -> ASR transition error%message = label//"_"//name error%z = 20 bad_name_error = 101 end function bad_name_error subroutine bad_name_error2() !> Instance of the error data type(error_t), allocatable:: error logical :: check integer :: e check = .false. if (.not.check) then allocate(error) e = 404 error%message = 'there is an error' error%z = 10 else allocate(error) e = 0 error%message = 'there is not an error' error%z = 20 end if if (e /= 404) error stop if (error%z /= 10) error stop print *, error%message end subroutine bad_name_error2 end module derived_types_26_fpm_error_module program derived_types_26 use derived_types_26_fpm_error_module implicit none type(error_t), allocatable :: error integer :: ret ret = bad_name_error(error, "1", "x") if (ret /= 101) error stop print *, error%message if (error%z /= 20) error stop call bad_name_error2() end program lfortran-0.63.0/integration_tests/class_131.f900000664000175000017500000000171015174404631021375 0ustar alastairalastairmodule class_131_mod implicit none type :: point real :: x, y end type type :: container class(*), allocatable :: value(:) contains procedure :: set_value end type contains subroutine set_value(this, value) class(container), intent(out) :: this class(*), intent(in) :: value(:) this%value = value end subroutine end module program class_131 use class_131_mod implicit none type(container) :: c type(point) :: pts(2) pts(1) = point(1.0, 2.0) pts(2) = point(3.0, 4.0) call c%set_value(pts) select type (v => c%value) type is (point) if (size(v) /= 2) error stop if (abs(v(1)%x - 1.0) > 1e-6) error stop if (abs(v(1)%y - 2.0) > 1e-6) error stop if (abs(v(2)%x - 3.0) > 1e-6) error stop if (abs(v(2)%y - 4.0) > 1e-6) error stop class default error stop end select print *, "PASS" end program lfortran-0.63.0/integration_tests/array_section_20.f900000664000175000017500000000042015174404631023044 0ustar alastairalastairprogram array_section_20 implicit none character(len=1), target :: a(3) = [character(len=1) :: 'a', 'b', 'c'] character(len=1), pointer :: p(:) p => a(1:2:-4) print *, 'size(p) =', size(p) if (size(p) /= 0) error stop end program array_section_20 lfortran-0.63.0/integration_tests/transfer_20.f900000664000175000017500000000027215174404631022033 0ustar alastairalastairprogram transfer_20 implicit none integer :: i i = transfer("", 1) if (i /= 0) error stop i = transfer("A", 1) if (i /= 65) error stop end program transfer_20 lfortran-0.63.0/integration_tests/derived_types_80.f900000664000175000017500000000110515174404631023057 0ustar alastairalastairmodule m_labels_derived_types_80 implicit none type :: toml_label character(:), allocatable :: source end type toml_label type :: toml_diagnostic type(toml_label), allocatable :: label end type toml_diagnostic end module m_labels_derived_types_80 program derived_types_80 use m_labels_derived_types_80 implicit none type(toml_diagnostic) :: diag type(toml_label) :: lbl integer, allocatable :: x lbl%source = "Something went wrong" diag%label = lbl print *, diag%label%source end program derived_types_80 lfortran-0.63.0/integration_tests/gpu_metal_191.f900000664000175000017500000000133615174404631022257 0ustar alastairalastairmodule gpu_metal_191_m implicit none type :: t real, allocatable :: v(:) end type contains pure function vals(self) result(r) type(t), intent(in) :: self real, allocatable :: r(:) r = self%v end function end module program gpu_metal_191 use gpu_metal_191_m implicit none integer, parameter :: n = 4 type(t) :: a(n) real :: b(n) integer :: i do i = 1, n allocate(a(i)%v(2)) a(i)%v = [1.0, 2.0] end do do concurrent(i = 1:n) b(i) = compute(a(i)) end do do i = 1, n if (abs(b(i) - 3.0) > 1.0e-6) error stop end do print *, "ok" contains pure function compute(x) result(y) type(t), intent(in) :: x real :: y y = sum(vals(x)) end function end program lfortran-0.63.0/integration_tests/interface_13.f900000664000175000017500000000125215174404631022150 0ustar alastairalastairmodule interface_13_module_1 implicit none interface operator(.mul.) module procedure multiply end interface contains integer function multiply(a, b) integer, intent(in) :: a integer, intent(in) :: b multiply = a * b end function multiply end module module interface_13_module_2 use interface_13_module_1, only: operator(.mul.) implicit none contains subroutine compute() integer :: res res = 123 .mul. 456 if (res /= 56088) error stop end subroutine compute end module program interface_13 use interface_13_module_2 implicit none call compute() end program interface_13 lfortran-0.63.0/integration_tests/file_33.f900000664000175000017500000000110415174404631021125 0ustar alastairalastairprogram file_33 implicit none integer :: unit_no, iostat character(len=100) :: filename, form, status, iomsg filename = 'file_33_data.txt' form = 'formatted ' status = 'replace' open(newunit=unit_no, file=filename, form=form, status=status, iostat=iostat, iomsg=iomsg) if (iostat /= 0) error stop iomsg close(unit_no) form = 'formatted' status = 'replace ' open(newunit=unit_no, file=filename, form=form, status=status, iostat=iostat, iomsg=iomsg) if (iostat /= 0) error stop iomsg close(unit_no) end program file_33lfortran-0.63.0/integration_tests/functions_08.f900000664000175000017500000000101115174404631022215 0ustar alastairalastairmodule function_08_a implicit none end module program functions_08 implicit none real :: x = 5, y real :: p = 5, q real :: a, b, c y = f(x) print *, y q = f_real(p) print *, q contains real function f(a) result(b) real, intent(in) :: a real :: x x = 2 b = a + f_real(0.0) end function real function f_real(a) result(b) real, intent(in) :: a if( a == 0.0 ) then b = 2.0 else b = a + f(1.0) end if end function end program lfortran-0.63.0/integration_tests/format_85.f900000664000175000017500000000114215174404631021507 0ustar alastairalastairprogram format_85 ! Test that Ew.dEe format on READ consumes exactly w characters per field implicit none real :: x, y character(len=*), parameter :: s_init = ' 1.00000000E+00 2.00000000E+00' character(len=len(s_init)) :: s = s_init ! Ew.dEe: w=15, d=8, e=2 — only 15 characters should be consumed per field read(s, '(e15.8e2,1x,e15.8e2)') x, y print *, x, y if (abs(x - 1.0) > 1.0e-6) error stop if (abs(y - 2.0) > 1.0e-6) error stop ! Also test with Gw.dEe format read(s, '(g15.8e2,1x,g15.8e2)') x, y print *, x, y if (abs(x - 1.0) > 1.0e-6) error stop if (abs(y - 2.0) > 1.0e-6) error stop end program lfortran-0.63.0/integration_tests/bindc_07.c0000664000175000017500000000265415174404631021125 0ustar alastairalastair#include #include #include // Dummy getcwd function that mimics the real getcwd behavior char* getcwd_dummy(char* buf, size_t size) { const char* dummy_path = "/home/user/test/directory"; size_t path_len = strlen(dummy_path); if (buf == NULL) { printf("ERROR: Received NULL buffer pointer!\n"); return NULL; } if (size <= path_len) { printf("ERROR: Buffer too small! Need %zu, got %zu\n", path_len + 1, size); return NULL; } // Debug: Print what we received printf("C function received:\n"); printf(" - Buffer pointer: %p\n", (void*)buf); printf(" - Buffer size: %zu\n", size); // Copy the dummy path to the buffer strcpy(buf, dummy_path); printf(" - Copied path: '%s'\n", buf); printf(" - Path length: %zu\n", strlen(buf)); return buf; // Return the buffer pointer on success } char* test_char_array(char* buffer, int len) { printf("C test_char_array received:\n"); printf(" - Buffer pointer: %p\n", (void*)buffer); printf(" - Length parameter: %d\n", len); if (buffer == NULL) { printf(" - ERROR: NULL buffer!\n"); return NULL; } // Write a test string const char* test_str = "Hello from C!"; strncpy(buffer, test_str, len - 1); buffer[len - 1] = '\0'; printf(" - Wrote to buffer: '%s'\n", buffer); return buffer; } lfortran-0.63.0/integration_tests/operator_overloading_23.f900000664000175000017500000000352015174404631024435 0ustar alastairalastairmodule operator_overloading_23_mod implicit none type :: string_t character(len=:), allocatable :: s end type interface operator(.cat.) pure function concat(strings) result(r) import string_t type(string_t), intent(in) :: strings(:) type(string_t) :: r end function end interface type :: diag_t logical :: passed = .false. end type interface diag_t pure function make_diag(test_passed, diagnostics_string) result(d) import diag_t, string_t logical, intent(in) :: test_passed type(string_t), intent(in) :: diagnostics_string type(diag_t) :: d end function end interface contains pure function aggregate(diagnoses) result(d) type(diag_t), intent(in) :: diagnoses(:) type(diag_t) :: d type(string_t) :: array(2) d = diag_t( & test_passed = all(diagnoses%passed), & diagnostics_string = .cat. pack(array, mask = .not. diagnoses%passed) & ) end function end module pure function concat(strings) result(r) use operator_overloading_23_mod, only: string_t type(string_t), intent(in) :: strings(:) type(string_t) :: r r%s = "ok" end function pure function make_diag(test_passed, diagnostics_string) result(d) use operator_overloading_23_mod, only: diag_t, string_t logical, intent(in) :: test_passed type(string_t), intent(in) :: diagnostics_string type(diag_t) :: d d%passed = test_passed end function program operator_overloading_23 use operator_overloading_23_mod, only: diag_t, aggregate implicit none type(diag_t) :: diagnoses(2), result diagnoses(1)%passed = .true. diagnoses(2)%passed = .true. result = aggregate(diagnoses) if (.not. result%passed) error stop diagnoses(1)%passed = .true. diagnoses(2)%passed = .false. result = aggregate(diagnoses) if (result%passed) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/arrays_83.f900000664000175000017500000000063515174404631021524 0ustar alastairalastairprogram arrays_83 integer :: anew2(17) integer, allocatable :: q_new(:) allocate(q_new(2)) q_new = [100, 1220] anew2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, q_new] print *, anew2 if( any(anew2(1:15) /= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) ) error stop if( anew2(16) /= 100 ) error stop if( anew2(17) /= 1220 ) error stop end program arrays_83 lfortran-0.63.0/integration_tests/implicit_interface_31.f900000664000175000017500000000053615174404631024046 0ustar alastairalastairreal function myfun(x) real :: x myfun = x * 2.0 end function subroutine extfun(fun, x1, res) real x1, res real g8, fun, x, h g8(x, h) = fun(x - x1 * h) res = g8(10.0, 1.0) end subroutine program implicit_interface_31 implicit none real :: res real, external :: myfun call extfun(myfun, 2.0, res) if (abs(res - 16.0) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/procedure_37.f900000664000175000017500000000224515174404631022211 0ustar alastairalastairmodule procedure_37_mod implicit none abstract interface subroutine vector_sub(x, y, alpha, beta) real, intent(in) :: x(:) real, intent(inout) :: y(:) real, intent(in) :: alpha real, intent(in) :: beta end subroutine end interface type :: linop_type procedure(vector_sub), nopass, pointer :: matvec => null() end type contains subroutine my_matvec(x, y, alpha, beta) real, intent(in) :: x(:) real, intent(inout) :: y(:) real, intent(in) :: alpha real, intent(in) :: beta integer :: i do i = 1, size(x) y(i) = alpha * x(i) + beta * y(i) end do end subroutine end module procedure_37_mod program procedure_37 use procedure_37_mod implicit none type(linop_type) :: A real :: x(3), y(3) A%matvec => my_matvec x = [1.0, 2.0, 3.0] y = [10.0, 20.0, 30.0] call A%matvec(x, y, alpha=2.0, beta=1.0) if (abs(y(1) - 12.0) > 1e-6) error stop if (abs(y(2) - 24.0) > 1e-6) error stop if (abs(y(3) - 36.0) > 1e-6) error stop print *, "All tests passed." end program procedure_37 lfortran-0.63.0/integration_tests/elemental_function_overloaded_compare.f900000664000175000017500000000353015174404631027473 0ustar alastairalastair! program extracted as MRE from https://github.com/fortran-lang/stdlib ! there is missing implementation of functions/subroutines like ! check_logical, eq_string_char, new_string_from_integer_int32 etc. ! but as that's not need to be able to compile and run the MRE, ! that's being skipped for now, actually we tried having their implementation ! as well, but the program failed to run (take that as a TODO) module mod_elemental_function_overloaded_compare use iso_fortran_env, only: int32 implicit none !> String type holding an arbitrary sequence of characters. interface operator(==) module procedure :: eq_string_char end interface operator(==) type :: string_type sequence private character(len=:), allocatable :: raw end type string_type contains subroutine check_logical(expression) logical, intent(in) :: expression if (.not. expression) then print *, "Condition not fulfilled" end if end subroutine check_logical elemental function eq_string_char(lhs, rhs) result(is_eq) type(string_type), intent(in) :: lhs character(len=*), intent(in) :: rhs logical :: is_eq end function eq_string_char elemental module function new_string_from_integer_int32(val) result(new) integer(int32), intent(in) :: val type(string_type) :: new end function new_string_from_integer_int32 subroutine test_constructor() character(len=128) :: flc write(flc, '(i0)') -1026191 call check_logical(new_string_from_integer_int32(-1026191) == trim(flc)) end subroutine test_constructor end module mod_elemental_function_overloaded_compare program test_elemental_function_overloaded_compare use mod_elemental_function_overloaded_compare implicit none call test_constructor() end program lfortran-0.63.0/integration_tests/class_04.f900000664000175000017500000000133715174404631021321 0ustar alastairalastairprogram main implicit none type :: bar_a integer :: a end type bar_a type :: foo_a type(bar_a) :: m_bar_a end type foo_a type, extends(bar_a) :: bar_b integer :: b end type bar_b type, extends(bar_b) :: bar_c integer :: c end type bar_c type, extends(foo_a) :: foo_b type(bar_b) :: m_bar_b end type foo_b type, extends(foo_b) :: foo_c type(bar_c) :: m_bar_c end type foo_c type(foo_c) :: foo foo%m_bar_a%a = -20 foo%m_bar_b%b = 9 foo%m_bar_c%c = 11 print *, foo%m_bar_a%a print *, foo%m_bar_b%b print *, foo%m_bar_c%c if( foo%m_bar_a%a + foo%m_bar_b%b + foo%m_bar_c%c /= 0 ) error stop end program mainlfortran-0.63.0/integration_tests/intrinsics_44.f900000664000175000017500000000140315174404631022377 0ustar alastairalastairprogram intrinsics_44 implicit none integer, dimension(5):: a = [1, 2, 3, 4, 5] integer, dimension(3,3) :: b = reshape( [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ], [ 3, 3 ]) print '(5i3)', a a = cshift(a, shift = 2) print '(5i3)', a a = cshift(a, shift = 1) print '(5i3)', a if(any(a /= [ 4, 5, 1, 2, 3 ])) error stop print * b = cshift(b, shift = 2, dim = 2) print '(3i3)', b(1,:) print '(3i3)', b(2,:) print '(3i3)', b(3,:) if(any(b /= reshape( [ 7, 8, 9, 1, 2, 3, 4, 5, 6 ], [ 3, 3 ]))) error stop block integer :: x(2,2) = reshape([1,2,3,4], [2,2]) if (any(cshift(x, 1) /= reshape([2,1,4,3], [2,2]))) error stop if (any(cshift(x, 1, dim=2) /= reshape([3,4,1,2], [2,2]))) error stop end block end program lfortran-0.63.0/integration_tests/doconcurrentloop_02.f900000664000175000017500000000064615174404631023613 0ustar alastairalastairprogram doconcurrentloop_02 implicit none real, dimension(10) :: a real :: sum integer :: N, i N = size(a) sum = 0 do concurrent (i = 1:N) a(i) = a(i-1) + 5 end do call arraySum(a, sum) contains subroutine arraySum(a, sum) real, intent(in) :: a(:) real, intent(out) :: sum do concurrent (i = 1:N) reduce(+: s) sum = sum + a(i) end do end subroutine end program lfortran-0.63.0/integration_tests/intrinsics_276.f900000664000175000017500000000302415174404631022467 0ustar alastairalastairprogram intrinsics_276 implicit none integer :: a1 = 5, a2 = 8 integer(8) :: a3 = -1, a4 = -4 integer :: a5 = -2, a6 = -5 integer, parameter :: i1 = or(5, 8) integer, parameter :: i2 = or(-1, 5) integer, parameter :: i3 = or(-4_8, 2_8) integer(8), parameter :: i4 = or(-2_8, 5_8) logical, parameter :: l1 = or(.true., .false.) logical, parameter :: l2 = or(.false., .false.) logical :: true = .true., false = .false. integer :: arr1(3), arr3(3) integer(8) :: arr2(3) integer :: res(3) arr1 = [5, 8, 9] arr3 = [8, 5, 2] arr2 = [-1_8, -5_8, -10_8] print *, i1 if (i1 /= 13) error stop print *, i2 if (i2 /= -1) error stop print *, i3 if (i3 /= -2) error stop print *, i4 if (i4 /= -1) error stop print *, l1 if (l1 .neqv. .true.) error stop print *, l2 if (l2 .neqv. .false.) error stop print *, or(true, false) if (or(true, false) .neqv. .true.) error stop print *, or(false, false) if (or(false, false) .neqv. .false.) error stop print*, or(5, 8) if (or(5, 8) /= 13) error stop print*, or(-1, 5) if (or(-1, 5) /= -1) error stop print*, or(8, -4) if (or(8, -4) /= -4) error stop print*, or(-2, -5) if (or(-2, -5) /= -1) error stop print*, or(a1, a2) if (or(a1, a2) /= 13) error stop print*, or(a3, a4) if (or(a3, a4) /= -1) error stop print*, or(a2, a5) if (or(a2, a5) /= -2) error stop print*, or(a5, a6) if (or(a5, a6) /= -1) error stop end program lfortran-0.63.0/integration_tests/intrinsics_232.f900000664000175000017500000000263715174404631022470 0ustar alastairalastairprogram intrinsics_232 implicit none integer, parameter :: i1 = iparity([1,2,3,4,5,6,7,8,9,10,11]) integer(8), parameter :: i2 = product([1, 2, 3], [.true., .true., .true.]) integer(4), parameter :: i3 = product([11, 2, 5], 1, mask = [.true., .false., .true.]) integer :: i(10) = [1,2,3,4,5,6,7,8,9,10] integer :: x(5) = [ 1, 2, 3, 4, 5 ] logical :: mask(5) = [ .TRUE., .FALSE., .TRUE., .FALSE., .TRUE. ] integer :: dim = 1 print *, i1 if ( i1 /= 0 ) error stop print *, i2 if ( i2 /= 6 ) error stop print *, i3 if ( i3 /= 55 ) error stop print *, iparity( array = x, mask = mask ) if ( .not. iparity( array = x, mask = mask ) == 7 ) error stop print *, iparity( x, mask = mask) if ( .not. iparity( x, mask = mask ) == 7 ) error stop print *, iparity( x, mask ) if ( .not. iparity( x, mask ) == 7 ) error stop print *, iparity( x, mask = mask, dim = dim ) if ( .not. iparity( x, mask = mask, dim = dim ) == 7 ) error stop print *, iparity([1,2,4,5,6,8,10,11]) if ( iparity([1,2,4,5,6,8,10,11]) /= 13 ) error stop print *, iparity(i) if ( iparity(i) /= 11 ) error stop print *, iparity(i, [.true., .false., .true., .false., .true., .false., .true., .false., .true., .false.]) if ( iparity(i, [.true., .false., .true., .false., .true., .false., .true., .false., .true., .false.]) /= 9 ) error stop end programlfortran-0.63.0/integration_tests/gpu_metal_71.f900000664000175000017500000000074415174404631022176 0ustar alastairalastairprogram gpu_metal_71 ! Test: all(abs(array_slice - array_slice) < tol) inside do concurrent implicit none real :: a(2,2), b(2,2) logical :: eq(2) integer :: i a = 1.0 b = 1.0 do concurrent (i = 1:2) eq(i) = all(abs(a(:,i) - b(:,i)) < 1.0e-6) end do if (.not. all(eq)) error stop ! Test with different values a(1,1) = 2.0 do concurrent (i = 1:2) eq(i) = all(abs(a(:,i) - b(:,i)) < 1.0e-6) end do if (eq(1)) error stop if (.not. eq(2)) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/separate_compilation_35a.f900000664000175000017500000000031615174404631024557 0ustar alastairalastairmodule separate_compilation_35a use iso_fortran_env implicit none contains function get_version() result(r) character(len=:), allocatable :: r r = compiler_version() end function end module lfortran-0.63.0/integration_tests/class_28.f900000664000175000017500000000134715174404631021330 0ustar alastairalastairmodule stdlib_hashmap_wrappers_class_28 implicit none private public :: other_type type :: other_type class(*), allocatable :: value end type other_type end module stdlib_hashmap_wrappers_class_28 module stdlib_hashmaps_class_28 use stdlib_hashmap_wrappers_class_28 implicit none type :: open_map_entry_type type(other_type) :: other end type open_map_entry_type end module stdlib_hashmaps_class_28 program class_28 use stdlib_hashmaps_class_28 use stdlib_hashmap_wrappers_class_28 implicit none type(open_map_entry_type), pointer :: new_ent type(other_type) :: other allocate(new_ent) other = new_ent % other deallocate(new_ent) end programlfortran-0.63.0/integration_tests/gpu_metal_40.f900000664000175000017500000000064115174404631022166 0ustar alastairalastairprogram gpu_metal_40 ! Test: do concurrent loop bound from outer nested associate block implicit none integer :: i, n, m, s integer :: a(10) n = 10 m = 0 s = 0 do i = 1, n a(i) = 0 end do associate(nn => n) associate(mm => m) do concurrent(i = 1:nn) a(i) = i * 2 end do end associate end associate do i = 1, n s = s + a(i) end do if (s /= 110) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/transfer_13.f900000664000175000017500000000037115174404631022035 0ustar alastairalastairprogram transfer_13 implicit none character(len=3) :: result result = transfer(['x','y','z'], 'abc') if (result /= 'xyz') error stop result = transfer(['a','b','c'], 'XYZ') if (result /= 'abc') error stop print *, "All tests passed." end program lfortran-0.63.0/integration_tests/print_05.f900000664000175000017500000000030315174404631021341 0ustar alastairalastairprogram print_05 implicit none character(len=4) :: s1(4) = ['sngl', 'dble', 'xten', 'quad'] integer :: i print *, s1 do i = 1, size(s1) print *, i, "|", s1(i), "|" end do end program print_05 lfortran-0.63.0/integration_tests/submodule_40b.f900000664000175000017500000000035215174404631022351 0ustar alastairalastairmodule submodule_40_mod implicit none character(len=*), parameter :: names(*) = [character(len("a")) :: "a"] interface module subroutine show_name() end subroutine show_name end interface end module submodule_40_mod lfortran-0.63.0/integration_tests/implied_do_loops2.f900000664000175000017500000000023315174404631023306 0ustar alastairalastairprogram implied_do_loop2 integer :: i, j integer, dimension(3,5) :: array array = reshape([(i,(i+j,j=1,4),i=1,3)], (/3,5/)) print *, array end programlfortran-0.63.0/integration_tests/operator_overloading_35.f900000664000175000017500000000056515174404631024446 0ustar alastairalastairprogram operator_overloading_35 use operator_overloading_35_reexport, only: vec_t, operator(-) implicit none type(vec_t) :: a, b, c a%x = 5.0; b%x = 3.0 c = a - b if (abs(c%x - 2.0) > 1.0e-5) error stop c = -a if (abs(c%x + 5.0) > 1.0e-5) error stop c = 10.0 - b if (abs(c%x - 7.0) > 1.0e-5) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/gpu_metal_147_neural_network.f900000664000175000017500000000113415174404631025373 0ustar alastairalastairmodule gpu_metal_147_neural_network use gpu_metal_147_activation, only : activation_t implicit none type neural_network_t type(activation_t) :: a contains procedure :: infer => default_real_infer end type interface elemental module function default_real_infer(self, x) result(y) class(neural_network_t), intent(in) :: self real, intent(in) :: x real y end function end interface end module submodule(gpu_metal_147_neural_network) gpu_metal_147_nn_sub contains module procedure default_real_infer y = self%a%evaluate(x) end procedure end submodule lfortran-0.63.0/integration_tests/common_24a.f900000664000175000017500000000022015174404631021635 0ustar alastairalastairsubroutine set1() implicit none integer :: info integer :: iunit common /infoc/ info, iunit info = 1 end subroutine set1 lfortran-0.63.0/integration_tests/equivalence_09.f900000664000175000017500000000042015174404631022512 0ustar alastairalastairprogram equivalence_09 real ci( 2, 2 ), civ( 4 ), cr( 2, 2 ), crv( 4 ) equivalence ( ci( 1, 1 ), civ( 1 ) ), ( cr( 1, 1 ), crv( 1 ) ) ci(1,1) = 5 if(civ(1) /= 5) error stop cr(1,1) = 7 if(crv(1) /= 7) error stop end lfortran-0.63.0/integration_tests/move_alloc_derived_01.f900000664000175000017500000000137315174404631024033 0ustar alastairalastairmodule move_alloc_derived_01_m implicit none type open_map_entry_ptr integer(4) :: inmap end type open_map_entry_ptr type :: open_hashmap_type type(open_map_entry_ptr), allocatable :: inverse(:) end type open_hashmap_type end module move_alloc_derived_01_m program move_alloc_derived_01 use move_alloc_derived_01_m implicit none type(open_hashmap_type) :: map type(open_map_entry_ptr), allocatable :: dummy_inverse(:) allocate(dummy_inverse(1)) call move_alloc( dummy_inverse, map % inverse ) print *, size(map % inverse) if (allocated(dummy_inverse)) error stop if (.not. allocated(map%inverse)) error stop if (size(map%inverse) /= 1) error stop end program move_alloc_derived_01lfortran-0.63.0/integration_tests/transfer_27.f900000664000175000017500000000071615174404631022045 0ustar alastairalastairprogram transfer_27 implicit none type :: dt integer :: val end type type(dt) :: x integer(1) :: bytes(4) integer :: i ! Transfer a zeroed derived type to a byte array x%val = 0 bytes = transfer(x, bytes) if (any(bytes /= 0)) error stop ! Transfer a non-zero derived type and verify round-trip x%val = 42 bytes = transfer(x, bytes) x%val = 0 x = transfer(bytes, x) if (x%val /= 42) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/separate_compilation_01.f900000664000175000017500000000041115174404631024403 0ustar alastairalastairprogram separate_compilation_01 use separate_compilation_01_module implicit none real :: x = 9124.19 call set_val(x) call get_val(x) call test_val(x) print *, "val = ", val print *, "x = ", x if (abs(val - x) > 1e-8) error stop end program separate_compilation_01 lfortran-0.63.0/integration_tests/derived_types_98.f900000664000175000017500000000160715174404631023077 0ustar alastairalastair! Test lhs realloc of derived type module derived_types_98_mod type :: tt character(len=:), allocatable :: name end type tt end module program derived_types_98 use derived_types_98_mod type(tt), allocatable :: dl(:) integer :: i i = 1 allocate(dl(2)) print *, allocated(dl(1)%name) if(allocated(dl(1)%name)) error stop print *, allocated(dl(2)%name) if(allocated(dl(2)%name)) error stop print *, size(dl) if(size(dl) /= 2) error stop dl(1)%name = "first" dl(2)%name = "second" print *, allocated(dl(1)%name) if(.not. allocated(dl(1)%name)) error stop print *, allocated(dl(2)%name) if(.not. allocated(dl(2)%name)) error stop dl = dl(1:i) print *, allocated(dl(1)%name) if(.not. allocated(dl(1)%name)) error stop print *, size(dl) if(size(dl) /= 1) error stop end programlfortran-0.63.0/integration_tests/gpu_metal_04.f900000664000175000017500000000071615174404631022171 0ustar alastairalastairprogram gpu_metal_04 ! Double precision SAXPY implicit none integer, parameter :: n = 50000 double precision :: x(n), y(n), y_expected(n), a integer :: i a = 3.0d0 do i = 1, n x(i) = dble(i) * 0.1d0 y(i) = dble(i) * 0.2d0 y_expected(i) = a * dble(i) * 0.1d0 + dble(i) * 0.2d0 end do do concurrent (i = 1:n) y(i) = a * x(i) + y(i) end do do i = 1, n if (abs(y(i) - y_expected(i)) > 1.0d-10) error stop end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/intrinsics_337.f900000664000175000017500000000563015174404631022472 0ustar alastairalastairMODULE intrinsics_337_mod implicit none ! interface with same name as intrinsic 'dble' interface dble module procedure interface_dble_fun end interface ! interface with same name as intrinsic 'float' interface float module procedure interface_float_fun end interface ! interface with same name as intrinsic 'dfloat' interface dfloat module procedure interface_dfloat_fun end interface ! interface with same name as intrinsic 'shifta' interface shifta module procedure interface_shifta_fun end interface CONTAINS subroutine sub1() integer :: intg intg = 1 print *, dble(intg) if (abs(dble(intg) - 1.D0) > epsilon(1.D0)) error stop end subroutine sub1 subroutine sub2() integer :: intg intg = 1 print *, float(intg) if (abs(float(intg) - 1.0) > epsilon(1.0)) error stop end subroutine sub2 subroutine sub3() integer :: intg intg = 1 print *, dfloat(intg) if (abs(dfloat(intg) - 1.D0) > epsilon(1.D0)) error stop end subroutine sub3 subroutine sub4() integer :: intg intg = 1 print *, shifta(intg, intg) if (shifta(intg, intg) /= 0) error stop end subroutine sub4 doubleprecision function interface_dble_fun() interface_dble_fun = 5.0D0 end function interface_dble_fun double precision function interface_float_fun() interface_float_fun = 5.0D0 end function interface_float_fun double precision function interface_dfloat_fun() interface_dfloat_fun = 5.0D0 end function interface_dfloat_fun double precision function interface_shifta_fun() interface_shifta_fun = 5.0D0 end function interface_shifta_fun end module intrinsics_337_mod program intrinsics_337 use intrinsics_337_mod implicit none ! this call matches with intrinsic 'dble' print *, dble(1) if (abs(dble(1) - 1.D0) > epsilon(1.D0)) error stop ! this call matches with intrinsic 'float' print *, float(1) if (abs(float(1) - 1.0) > epsilon(1.0)) error stop ! this call matches with intrinsic 'dfloat' print *, dfloat(1) if (abs(dfloat(1) - 1.D0) > epsilon(1.D0)) error stop ! this call matches with intrinsic 'shifta' print *, shifta(1, 1) if (shifta(1, 1) /= 0) error stop ! this call matches with interface defined in module print *, dble() if (abs(dble() - 5.D0) > epsilon(1.D0)) error stop ! this call matches with interface defined in module print *, float() if (abs(float() - 5.0) > epsilon(1.0)) error stop ! this call matches with interface defined in module print *, dfloat() if (abs(dfloat() - 5.D0) > epsilon(1.D0)) error stop ! this call matches with interface defined in module print *, shifta() if (abs(shifta() - 5.D0) > epsilon(1.D0)) error stop call sub1() call sub2() call sub3() call sub4() end program intrinsics_337 lfortran-0.63.0/integration_tests/arrays_89.f900000664000175000017500000000073215174404631021530 0ustar alastairalastairprogram arrays_89 integer :: temp (0:2, 2:4) temp = 1 call change(temp) print *, temp if( any(temp /= reshape([1, 1, 1, 1, 1, 99, 2, 1, 1], [3, 3])) ) error stop contains subroutine change(x) integer, intent(inout) :: x(:, :) print *, lbound(x, 1), lbound(x, 2) if( lbound(x, 1) /= 1 ) error stop if( lbound(x, 2) /= 1 ) error stop x(1, 3) = 2 x(3, 2) = 99 end subroutine end program arrays_89 lfortran-0.63.0/integration_tests/functions_17.f900000664000175000017500000000040015174404631022216 0ustar alastairalastairfunction func() result(y) real :: y(1) y(1) = 1.0 end function func program main real :: x(1) interface function func() result(y) real :: y(1) end function func end interface x = func() if (abs(x(1) - 1.0) > 1e-6) error stop print *, x end program main lfortran-0.63.0/integration_tests/types_real_to_complex_cast.f900000664000175000017500000000032715174404631025321 0ustar alastairalastairprogram types_real_to_complex_cast integer, parameter :: dp = kind(0.d0) complex(dp) :: c real(dp) :: i c = 1.0_dp i = 1.2_dp c = i if (abs(c - 1.2_dp) > 1e-12_dp) error stop end program lfortran-0.63.0/integration_tests/derived_types_108.f900000664000175000017500000000046215174404631023145 0ustar alastairalastairprogram derived_types_108 implicit none type :: t integer, pointer :: p end type type(t) :: x integer :: v allocate(x%p) x%p = 1 v = x%p print *, v if (v /= 1) error stop x%p = 42 if (x%p /= 42) error stop v = x%p + 1 if (v /= 43) error stop deallocate(x%p) end program lfortran-0.63.0/integration_tests/file_32.f900000664000175000017500000000413415174404631021132 0ustar alastairalastairprogram file_32 implicit none complex, allocatable :: array(:,:,:,:) integer :: stat, io character(len=200) :: line character(len=20) :: part real :: c1(2), c2(2), c3(2), c4(2) ! Allocate a 4D complex array of shape (2, 2, 1, 1) = 4 elements allocate(array(2,2,1,1)) ! Sample values c1 = [0.0, 0.0] c2 = [2.0, 0.0] c3 = [1.0, 0.0] c4 = [3.0, 0.0] ! Open file open(newunit=io, file="file_32_data.txt", status="replace", action="write", iostat=stat) if (stat /= 0) then print *, "Error opening file for writing" stop 1 end if ! Initialize line line = '' ! Append each point with a space after it write(part, '(f3.1,",",f3.1)') c1(1), c1(2) line = trim(line) // '(' // trim(part) // ') ' print *, "line1 = ", trim(line) write(part, '(f3.1,",",f3.1)') c2(1), c2(2) line = trim(line) // ' ' // '(' // trim(part) // ') ' print *, "line2 = ", trim(line) write(part, '(f3.1,",",f3.1)') c3(1), c3(2) line = trim(line) // ' ' // '(' // trim(part) // ') ' write(part, '(f3.1,",",f3.1)') c4(1), c4(2) line = trim(line) // ' ' // '(' // trim(part) // ')' ! Write final line write(io, '(a)') trim(line) close(io) ! Open text file open(newunit=io, file="file_32_data.txt", status="old", action="read", iostat=stat) if (stat /= 0) then print *, "Error opening file" stop 1 end if ! Directly read entire array in one READ statement read(io, *, iostat=stat) array if (stat /= 0) then print *, "Error reading array" stop 1 end if close(io) ! Print to verify print *, "array(1,1,1,1) = ", abs(array(1,1,1,1)) if ( abs(abs(array(1,1,1,1)) - 0.0) > 1e-6 ) error stop print *, "array(2,1,1,1) = ", abs(array(2,1,1,1)) if ( abs(abs(array(2,1,1,1)) - 2.0) > 1e-6 ) error stop print *, "array(1,2,1,1) = ", abs(array(1,2,1,1)) if ( abs(abs(array(1,2,1,1)) - 1.0) > 1e-6 ) error stop print *, "array(2,2,1,1) = ", abs(array(2,2,1,1)) if ( abs(abs(array(2,2,1,1)) - 3.0) > 1e-6 ) error stop end program lfortran-0.63.0/integration_tests/write_16.f900000664000175000017500000000205315174404631021345 0ustar alastairalastairmodule write_16_test type :: MyType end type MyType interface write(formatted) procedure :: output end interface write(formatted) contains subroutine output(obj,unit,iotype,v_list,iostat,iomsg) class(MyType), intent(in) :: obj integer, intent(in) :: unit character(*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(*), intent(inout) :: iomsg iostat = 0 write(unit,'(A)') 'MyType instance' end subroutine output end module write_16_test program write_16 use write_16_test type(MyType) :: x integer :: u character(len=100) :: line open(newunit=u, file="write_16.txt", status="replace") write(u,*) x close(u) open(newunit=u, file="write_16.txt", status="old") read(u,'(A)') line close(u) if (trim(adjustl(line)) /= "MyType instance") then error stop "Unexpected output from write(formatted)" end if end program write_16 lfortran-0.63.0/integration_tests/openmp_48.f900000664000175000017500000000064615174404631021524 0ustar alastairalastairprogram openmp_48 use omp_lib implicit none integer :: i=0 call omp_set_num_threads(8) !$omp parallel reduction(+:i) !$omp single i=i+1 !This will be done by one thread only hence 1 will be added to i !$omp end single i=i+1 !This will be done by all threads hence eventually 8 will be added to i !$omp end parallel if(i/=9) error stop end program openmp_48lfortran-0.63.0/integration_tests/equivalence_07.f900000664000175000017500000000070215174404631022513 0ustar alastairalastairprogram equivalence_07 use iso_c_binding, only: c_loc, c_f_pointer implicit none INTEGER, target :: IMACH(16), SMALL(2) INTEGER, pointer :: OUTPUT REAL, pointer :: RMACH call c_f_pointer(c_loc(imach(4)), output) call c_f_pointer(c_loc(small(1)), rmach) imach(4) = 6 if(output /= 6) error stop small = 99 rmach = 5.6_8 if(small(1) /= 1085485875) error stop if(small(2) /= 99) error stop end program lfortran-0.63.0/integration_tests/equivalence_15.f900000664000175000017500000000446615174404631022525 0ustar alastairalastairprogram equivalence_15 implicit none ! Test 1: Integer arrays with offset 3 integer :: ia1(4), ia2(4) equivalence (ia1, ia2(3)) ! Test 2: Real arrays with offset 4 real :: r1(2), r2(6) equivalence (r1, r2(4)) ! Test 3: Complex arrays with offset 2 complex :: c1(2), c2(3) equivalence (c1, c2(2)) ! Test 4: Logical arrays with offset 3 logical :: l1(2), l2(4) equivalence (l1, l2(3)) ! Test 5: Different size arrays with offset 2 integer :: arr1(3), arr2(5) equivalence (arr1, arr2(2)) ! Test 1: Integer equivalence ia1 = [11, 12, 13, 14] ia2 = [1, 2, 3, 4] if (ia1(1) /= 3) error stop "Test 1: ia1(1) should be 3" if (ia1(2) /= 4) error stop "Test 1: ia1(2) should be 4" if (ia1(3) /= 13) error stop "Test 1: ia1(3) should be 13" if (ia1(4) /= 14) error stop "Test 1: ia1(4) should be 14" if (ia2(1) /= 1) error stop "Test 1: ia2(1) should be 1" if (ia2(3) /= 3) error stop "Test 1: ia2(3) should be 3" ! Test 2: Real equivalence r1 = [1.5, 2.5] r2 = [10.0, 20.0, 30.0, 40.0, 50.0, 60.0] if (abs(r1(1) - 40.0) > 1.0e-6) error stop "Test 2: r1(1) should be 40.0" if (abs(r1(2) - 50.0) > 1.0e-6) error stop "Test 2: r1(2) should be 50.0" if (abs(r2(4) - 40.0) > 1.0e-6) error stop "Test 2: r2(4) should be 40.0" ! Test 3: Complex equivalence c1 = [(1.0, 2.0), (3.0, 4.0)] c2 = [(10.0, 20.0), (30.0, 40.0), (50.0, 60.0)] if (abs(real(c1(1)) - 30.0) > 1.0e-6) error stop "Test 3: c1(1) real should be 30.0" if (abs(aimag(c1(1)) - 40.0) > 1.0e-6) error stop "Test 3: c1(1) imag should be 40.0" ! Test 4: Logical equivalence l1 = [.true., .false.] l2 = [.false., .false., .true., .true.] if (.not. l1(1)) error stop "Test 4: l1(1) should be true" if (.not. l1(2)) error stop "Test 4: l1(2) should be true" if (.not. l2(3)) error stop "Test 4: l2(3) should be true" ! Test 5: Different sizes arr1 = [100, 200, 300] arr2 = [10, 20, 30, 40, 50] if (arr1(1) /= 20) error stop "Test 5: arr1(1) should be 20" if (arr1(2) /= 30) error stop "Test 5: arr1(2) should be 30" if (arr1(3) /= 40) error stop "Test 5: arr1(3) should be 40" if (arr2(2) /= 20) error stop "Test 5: arr2(2) should be 20" end program equivalence_15 lfortran-0.63.0/integration_tests/custom_operator_15.f900000664000175000017500000000244615174404631023445 0ustar alastairalastairmodule custom_operator_15_mod implicit none type :: vector_t double precision :: val contains generic :: operator(.dot.) => dot_scalar procedure, private :: dot_scalar end type type, extends(vector_t) :: gradient_t contains generic :: operator(.dot.) => dot_vector_gradient procedure, private, pass(grad) :: dot_vector_gradient end type contains pure function dot_scalar(self, s) result(res) class(vector_t), intent(in) :: self double precision, intent(in) :: s type(vector_t) :: res res%val = self%val * s end function pure function dot_vector_gradient(v, grad) result(res) type(vector_t), intent(in) :: v class(gradient_t), intent(in) :: grad double precision :: res res = v%val * grad%val end function end module program custom_operator_15 use custom_operator_15_mod implicit none type(vector_t) :: v type(gradient_t) :: g double precision :: result type(vector_t) :: result2 v = vector_t(2.0d0) g = gradient_t(3.0d0) ! Resolve via RHS type (pass(grad) on the right operand) result = v .dot. g if (abs(result - 6.0d0) > 1d-10) error stop ! Resolve via LHS type (default pass on the left operand) result2 = v .dot. 4.0d0 if (abs(result2%val - 8.0d0) > 1d-10) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/class_01.f900000664000175000017500000000220315174404631021307 0ustar alastairalastairmodule class_circle1 implicit none private real :: pi = 3.1415926535897931d0 ! Class-wide private constant type, public :: Circle real :: radius contains procedure :: area => circle_area ! Can you point to implementation in diff module? procedure :: print => circle_print end type Circle contains function circle_area(this) result(area) ! F2003 standard 4.5.3.3 passed object dummy argument class(Circle), intent(in) :: this real :: area area = pi * this%radius**2 end function circle_area subroutine circle_print(this) class(Circle), intent(in) :: this real :: area area = this%area() ! Call the type-bound function print *, 'Circle: r = ', this%radius, ' area = ', area end subroutine circle_print end module class_circle1 program circle_test use class_circle1, only: Circle implicit none type(Circle) :: c ! Declare a variable of type Circle. c = Circle(1.5) ! Use the implicit constructor, radius = 1.5. call c%print ! Call the type-bound subroutine c%radius = 2.0 call c%print ! Call the type-bound subroutine end program circle_test lfortran-0.63.0/integration_tests/read_08.f900000664000175000017500000000130215174404631021123 0ustar alastairalastairprogram read_08 ! Test reading logical values with T/F format implicit none integer :: unit_no logical :: val1, val2, val3, val4 open(newunit=unit_no, status='scratch') write(unit_no, '(A)') 'T' write(unit_no, '(A)') 'F' write(unit_no, '(A)') 't' write(unit_no, '(A)') 'f' rewind(unit_no) read(unit_no, *) val1 read(unit_no, *) val2 read(unit_no, *) val3 read(unit_no, *) val4 close(unit_no) if (.not. val1) error stop "Expected T to be .true." if (val2) error stop "Expected F to be .false." if (.not. val3) error stop "Expected t to be .true." if (val4) error stop "Expected f to be .false." print *, "PASS" end program lfortran-0.63.0/integration_tests/ilp64_complex_literal_01.f900000664000175000017500000000240015174404631024402 0ustar alastairalastair! Test: complex literal kind with -fdefault-integer-8 ! Complex literals with integer components should produce default complex kind (4), ! not complex(8), even when integers are promoted to 64-bit by -fdefault-integer-8. program ilp64_complex_literal_01 implicit none complex :: c1, c2 complex :: arr(2) complex(8) :: c8 ! Test 1: Simple complex literal assignment with integers c1 = (-1, 0) if (kind(c1) /= 4) error stop "c1 should have kind 4" if (abs(real(c1) - (-1.0)) > 1e-6) error stop "c1 real part wrong" if (abs(aimag(c1)) > 1e-6) error stop "c1 imag part wrong" ! Test 2: Complex literal in DATA statement data arr /(-1,0),(1,0)/ if (kind(arr(1)) /= 4) error stop "arr should have kind 4" if (abs(real(arr(1)) - (-1.0)) > 1e-6) error stop "arr(1) real part wrong" if (abs(real(arr(2)) - 1.0) > 1e-6) error stop "arr(2) real part wrong" ! Test 3: Mixed integer/real should produce kind from real c2 = (-1, 0.0d0) if (kind((-1, 0.0d0)) /= 8) error stop "mixed int/real(8) should give kind 8" ! Test 4: Real(8) components should produce complex(8) c8 = (-1.0d0, 0.0d0) if (kind(c8) /= 8) error stop "c8 should have kind 8" print *, "PASS: all complex literal kind tests" end program lfortran-0.63.0/integration_tests/implied_do_loops6.f900000664000175000017500000000110415174404631023310 0ustar alastairalastairprogram implied_do_loops6 real, allocatable :: Q(:) real :: R(5) integer :: rank allocate(Q(4)) Q = 5.0 Q([1, 3]) = -4.0 print *, Q R = [abs(Q), 0.0_4] print *, R if( any(R /= [4.0, 5.0, 4.0, 5.0, 0.0]) ) error stop rank = maxval([0_4, trueloc(Q > 0)]) print *, rank if( rank /= 4 ) error stop contains function trueloc(x) result(loc) logical, intent(in) :: x(:) integer(4), allocatable :: loc(:) integer :: i, j allocate(loc(count(x))) j = 1 do i = 1, size(x) if( x(i) ) then loc(j) = i j = j + 1 end if end do end function trueloc end program lfortran-0.63.0/integration_tests/flush_04.f900000664000175000017500000000024615174404631021333 0ustar alastairalastairprogram flush_04 use iso_fortran_env, only: output_unit, error_unit implicit none flush output_unit flush error_unit flush 6 end program flush_04 lfortran-0.63.0/integration_tests/modules_42.f900000664000175000017500000000122515174404631021662 0ustar alastairalastairmodule modules_42_fpm_targets implicit none type int_t integer :: i end type int_t contains subroutine prune_build_targets() type(int_t) :: modules_used(1) modules_used(1)%i = 0 call collect_used_modules() print *, modules_used(1)%i if( modules_used(1)%i /= 2 ) error stop contains recursive subroutine collect_used_modules() modules_used(1)%i = 2 modules_used = [modules_used(1)] end subroutine collect_used_modules end subroutine prune_build_targets end module modules_42_fpm_targets program modules_42 use modules_42_fpm_targets implicit none call prune_build_targets() end program modules_42 lfortran-0.63.0/integration_tests/array_bound_2.f900000664000175000017500000000032315174404631022431 0ustar alastairalastairprogram array_bound_2 implicit none integer(8) :: x(4) print *, lbound(x, dim=1), ubound(x, dim=1) if (lbound(x, dim=1) /= 1) error stop if (ubound(x, dim=1) /= 4) error stop end program lfortran-0.63.0/integration_tests/doloop_10.f900000664000175000017500000000025415174404631021502 0ustar alastairalastairprogram doloop_10 integer(4) :: i, j = 0 integer(8) :: n = 10 do i = 1, n j = j + i end do print *, j if (j /= 55) error stop end program lfortran-0.63.0/integration_tests/allocate_51.f900000664000175000017500000000102715174404631021776 0ustar alastairalastairprogram allocate_51 implicit none type :: my_type integer :: max_len = 0 end type type(my_type) :: obj character(:), allocatable :: names(:) obj%max_len = 5 allocate(character(obj%max_len)::names(3)) if (len(names) /= 5) error stop if (size(names) /= 3) error stop names(1) = "hello" names(2) = "world" names(3) = "abcde" if (names(1) /= "hello") error stop if (names(2) /= "world") error stop if (names(3) /= "abcde") error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/string_114.f900000664000175000017500000000134315174404631021601 0ustar alastairalastairmodule string_114_mod implicit none contains subroutine test_self_slice_assumed_len(x) character(len=*), intent(in) :: x(:) character(len=len(x)), allocatable :: y(:) allocate(y(1)) y(1) = x(1) y = y(:1) if (y(1) /= "dog") error stop end subroutine subroutine test_self_slice_runtime_len(n) integer, intent(in) :: n character(len=n), allocatable :: y(:) allocate(y(2)) y(1) = "cat" y(2) = "dog" y = y(:2) if (y(1) /= "cat") error stop if (y(2) /= "dog") error stop end subroutine end module program string_114 use string_114_mod implicit none character(len=3) :: x(1) = ["dog"] call test_self_slice_assumed_len(x) call test_self_slice_runtime_len(3) print *, "PASS" end program lfortran-0.63.0/integration_tests/read_03.f900000664000175000017500000000045315174404631021124 0ustar alastairalastairprogram read_03 integer(8) :: blocks(2) integer :: unit open(newunit=unit, file="read_03_data.txt") read(unit, *) blocks if (blocks(1) /= 123456789) error stop if (blocks(2) /= 987654321) error stop close(unit) print *, "Read text data:", blocks end program read_03lfortran-0.63.0/integration_tests/hashmap_derived_pointer_associated.f900000664000175000017500000000424215174404631026771 0ustar alastairalastairmodule stdlib_hashmaps_hashmap_derived_pointer_associated implicit none integer(4), parameter :: pool_size = 64 type :: open_map_entry_type integer(4) :: hash_val end type open_map_entry_type type :: open_map_entry_pool integer(4) :: next = 0 type(open_map_entry_type), allocatable :: more_map_entries(:) type(open_map_entry_pool), pointer :: lastpool => null() end type open_map_entry_pool type :: open_hashmap_type type(open_map_entry_pool), pointer :: cache => null() end type open_hashmap_type end module stdlib_hashmaps_hashmap_derived_pointer_associated module stdlib_hashmap_open_hashmap_derived_pointer_associated use stdlib_hashmaps_hashmap_derived_pointer_associated implicit none contains subroutine extend_open_map_entry_pool(pool) type(open_map_entry_pool), intent(inout), pointer :: pool type(open_map_entry_pool), pointer :: map_entry_pool_head allocate(map_entry_pool_head) allocate(map_entry_pool_head % more_map_entries(0:pool_size-1)) map_entry_pool_head % lastpool => pool pool => map_entry_pool_head pool % next = 0 end subroutine extend_open_map_entry_pool module subroutine init_open_map( map ) class(open_hashmap_type), intent(out) :: map type(open_map_entry_pool), pointer :: pool => null() call extend_open_map_entry_pool(map % cache) if (associated(map % cache)) then print *, "Pointer is Associated" else print *, "Pointer is not Associated" error stop "Pointer is not associated" end if pool => map % cache print *, pool % next end subroutine init_open_map end module stdlib_hashmap_open_hashmap_derived_pointer_associated program hashmap_derived_pointer_associated use stdlib_hashmaps_hashmap_derived_pointer_associated, only : open_hashmap_type use stdlib_hashmap_open_hashmap_derived_pointer_associated implicit none type(open_hashmap_type) :: map call init_open_map(map) deallocate(map%cache) end program hashmap_derived_pointer_associatedlfortran-0.63.0/integration_tests/nested_01.f900000664000175000017500000000045615174404631021474 0ustar alastairalastairmodule nested_01_a implicit none contains integer function b() integer e print *, "b()" e = d() b = 0 contains integer function d() print *, "d()" d = 1 end function d end function b end module program nested_01 use nested_01_a, only: b implicit none integer c c = b() end lfortran-0.63.0/integration_tests/arrays_51.f900000664000175000017500000000072215174404631021514 0ustar alastairalastair! Check that lcompilers_get_i() returns mutated value of i not just hard coded value of 4 module arrays_51_mod IMPLICIT NONE integer :: i = 4 integer :: arr_mod(4,6) contains subroutine sub (arr) integer , INTENT(OUT):: arr(4,i) print *,size(arr) if(size(arr) /= 24) error stop end subroutine sub end module arrays_51_mod program arrays_51 use arrays_51_mod i = 6 call sub(arr_mod) end program arrays_51 lfortran-0.63.0/integration_tests/submodule_19b.f900000664000175000017500000000105415174404631022357 0ustar alastairalastairmodule string_m_submodule_19 use iso_c_binding, only : c_bool, c_size_t implicit none type test_diagnosis_t end type type string_t character(len=:), allocatable :: s end type interface elemental module subroutine assign_character_to_string_t(lhs) class(string_t), intent(inout) :: lhs end subroutine end interface end module string_m_submodule_19 module assert_m_submodule_19 use string_m_submodule_19 end module assert_m_submodule_19 module m_submodule_19 use assert_m_submodule_19 end module m_submodule_19 lfortran-0.63.0/integration_tests/legacy_array_sections_08.f900000664000175000017500000000057715174404631024576 0ustar alastairalastairprogram legacy_array_sections_08 implicit none real(4) :: x(2) x = [1.0, 2.0] print *, f1(x) if (any(f1(x) - [0.841470957, 0.909297407] > 1e-6)) error stop contains pure elemental real(4) function f1(x) implicit none real(4),intent(in) :: x f1 = sin(x) end function f1 end program legacy_array_sections_08 lfortran-0.63.0/integration_tests/read_52.f900000664000175000017500000000076415174404631021135 0ustar alastairalastairprogram read_52 implicit none call testnan contains subroutine testnan real :: xnan character :: cni*4, msg*200 integer :: ios cni = 'NAN ' read(cni, *, iostat=ios, iomsg=msg) xnan if (ios /= 0) then print *, "Reading 'NAN ' into xnan failed." print *, 'iomsg = '//trim(msg) error stop else if (.not. (xnan /= xnan)) error stop "NaN should not equal itself" print "(A,L2,1X,F0.0)", ' NaN/=NaN?', xnan /= xnan, xnan end if end subroutine testnan end program read_52lfortran-0.63.0/integration_tests/read_57.f900000664000175000017500000000173715174404631021143 0ustar alastairalastairprogram read_57 ! Test list-directed internal read with multiple values of mixed types implicit none character(len=20) :: line integer :: x, y character(1) :: c real :: r character(len=5) :: s ! Integer then character line = '1 A' read(line, *) x, c if (x /= 1) error stop if (c /= 'A') error stop ! Two integers line = '10 20' read(line, *) x, y if (x /= 10) error stop if (y /= 20) error stop ! Integer then real line = '3 2.5' read(line, *) x, r if (x /= 3) error stop if (abs(r - 2.5) > 1.0e-6) error stop ! Comma-separated values line = '7,8' read(line, *) x, y if (x /= 7) error stop if (y /= 8) error stop ! Three values: integer, real, character line = '42 3.14 Z' read(line, *) x, r, c if (x /= 42) error stop if (abs(r - 3.14) > 0.01) error stop if (c /= 'Z') error stop ! Single value (regression: should still work) line = '99' read(line, *) x if (x /= 99) error stop print *, 'PASS' end program lfortran-0.63.0/integration_tests/read_16.f900000664000175000017500000000063415174404631021131 0ustar alastairalastairprogram read_16 ! Test ERR= label for read errors implicit none integer :: x, u character(len=20) :: invalid_data invalid_data = "not_an_integer" open(newunit=u, status='scratch') write(u, '(A)') invalid_data rewind(u) read(u, *, err=20) x error stop "Should have jumped to label 20" 20 continue close(u) print *, "PASS: ERR= label works" end program read_16 lfortran-0.63.0/integration_tests/intrinsics_261.f900000664000175000017500000000233615174404631022466 0ustar alastairalastairprogram intrinsics_261 real, parameter :: a(4) = [11.012, -21.125, 31.210, -41.0] real, parameter :: b(4) = [33.9, 91.2, 37.4, 19.1] integer, parameter :: c(8) = Ceiling([1.2, 3.3, 5.0, 6.8, -5.7, & -8.9, 0.0, -412.124]) integer, parameter :: array_size = 6 integer :: i integer(kind=4) :: res_4_arr(array_size) integer(kind=8) :: res_8_arr(array_size) integer(kind=4) :: res_4_arr_2(8) integer :: expected(8) = [2, 4, 5, 7, -5, -8, 0, -412] print *, Ceiling(a) if (any(Ceiling(a) /= [12, -21, 32, -41])) error stop print *, Ceiling(b) if (any(Ceiling(b) /= [34, 92, 38, 20])) error stop do i = 1, size(c) print *, c(i) if (c(i) /= expected(i)) error stop end do res_4_arr = Ceiling([real:: 1.2, 3.3, 5, 6.8, -5.7, -8.9]) print *, res_4_arr if (any(res_4_arr /= [2, 4, 5, 7, -5, -8])) error stop res_8_arr = Ceiling([real(8) :: 1.2, 3.3, 5, 101.768, -121.321, 65.4], kind=8) print *, res_8_arr if (any(res_8_arr /= [2, 4, 5, 102, -121, 66])) error stop res_4_arr_2 = Ceiling([1.2, 3.3, 5.0, 6.8, -5.7, -8.9, 0.0, -412.124], kind=4) print *, res_4_arr_2 if (any(res_4_arr_2 /= [2, 4, 5, 7, -5, -8, 0, -412])) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_23.f900000664000175000017500000000063515174404631022172 0ustar alastairalastairprogram gpu_metal_23 ! Test: do concurrent inside associate block compiles and runs with GPU offloading implicit none integer, parameter :: n = 1000 integer :: a(n), b(n), i do i = 1, n a(i) = i b(i) = 0 end do associate(aa => a, bb => b) do concurrent (i = 1:n) bb(i) = aa(i) * 2 end do end associate do i = 1, n if (b(i) /= i * 2) error stop end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/real_dp_01.f900000664000175000017500000000022515174404631021612 0ustar alastairalastairprogram real_dp_01 real(4) :: zero real(8) :: v real :: x zero = 0.0 v = 1.05 x = 1.05 print *, x, v, zero end program lfortran-0.63.0/integration_tests/arrays_13.f900000664000175000017500000000216615174404631021516 0ustar alastairalastairprogram arrays_13 implicit none integer :: u, v integer, pointer :: i(:) real, pointer :: r(:, :) integer, target :: iv(2) real, target :: rv(2, 3) i => iv r => rv i(1) = 1 if( i(1) /= 1 ) then i(2) = 3 else i(2) = 7 end if if( iv(1) /= 1 ) error stop if( iv(2) /= 7 ) error stop do u = lbound(r, 1), ubound(r, 1) do v = lbound(r, 2), ubound(r, 2) rv(u, v) = u * v end do end do call check_real(r) call check_real_without_pointer(r) contains subroutine check_real(r) real, pointer :: r(:, :) integer :: u, v do u = lbound(r, 1), ubound(r, 1) do v = lbound(r, 2), ubound(r, 2) if( r(u, v) /= u * v ) error stop end do end do end subroutine subroutine check_real_without_pointer(r) real :: r(:, :) integer :: u, v do u = lbound(r, 1), ubound(r, 1) do v = lbound(r, 2), ubound(r, 2) if( r(u, v) /= u * v ) error stop end do end do end subroutine end program lfortran-0.63.0/integration_tests/intrinsics_431.f900000664000175000017500000000132515174404631022462 0ustar alastairalastairprogram intrinsics_431 implicit none character :: ch integer :: j ch = char(0) print *, ch print *, ichar(ch) if (ichar(ch) /= 0) error stop ch = achar(0) j = iachar(ch) print *, j if (j /= 0) error stop print *, is_control(char(0)) if (.not. is_control(char(0))) error stop print *, is_control(char(65)) if (is_control(char(65))) error stop print *, is_control(char(127)) if (.not. is_control(char(127))) error stop contains logical function is_control(c) character(len=1), intent(in) :: c integer :: ic ic = iachar(c) is_control = ic < int(z'20') .or. ic == int(z'7F') end function end program intrinsics_431 lfortran-0.63.0/integration_tests/string_83.f900000664000175000017500000000264715174404631021536 0ustar alastairalastairmodule string_83_mod implicit none public character(len=*), parameter :: char_arr_global(4, 1) = reshape([ character(len=30) :: & "YES",& "\d ",& "5 ",& "1 "], [4,1]) contains subroutine sub(str) character(*), intent(out) :: str character(len(char_arr_global)) :: buffer if(len(buffer) /= 30) error stop if(len(char_arr_global(1, 1)) /= 30) error stop if(trim(char_arr_global(1, 1)) /= "YES") error stop if(trim(char_arr_global(2, 1)) /= "\d") error stop if(trim(char_arr_global(3, 1)) /= "5") error stop if(trim(char_arr_global(4, 1)) /= "1") error stop if(len(str) /= 30) error stop str = char_arr_global(3, 1) end subroutine end module program string_83 use string_83_mod implicit none character(len=30) :: str character(:), allocatable :: write_buffer call sub(str) if(str /= char_arr_global(3, 1)) error stop allocate(character(len=len(char_arr_global)* size(char_arr_global)) :: write_buffer) write(write_buffer, "(4A)") char_arr_global print *, write_buffer if(write_buffer /= "YES & \d & 5 & 1 ") error stop end program lfortran-0.63.0/integration_tests/derived_types_127.f900000664000175000017500000000107715174404631023151 0ustar alastairalastairmodule derived_types_127_mod implicit none type :: my_type integer :: val contains procedure :: init end type contains subroutine init(self, input_shape) class(my_type), intent(inout) :: self integer, intent(in) :: input_shape(:) self % val = input_shape(1) end subroutine end module program derived_types_127 use derived_types_127_mod implicit none type(my_type) :: obj integer :: n n = 5 call obj % init([n]) if (obj % val /= 5) error stop call obj % init([10]) if (obj % val /= 10) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/io_direct_slash.f900000664000175000017500000000150015174404631023034 0ustar alastairalastairprogram io_direct_slash implicit none integer :: idata1(0:9), idata2(0:9) integer :: i, j integer :: iolen character(40) :: string40 inquire (iolength=iolen) string40 if (iolen /= 40) error stop open (10, file='io_direct_slash.dat', status='replace', & access='direct', form='formatted', recl=iolen) do i=1, 10, 2 write (10, fmt='(10i4/10i4)', rec=i) & (j, j=i*10, i*10+9), (j, j=(i+1)*10, (i+1)*10+9) end do do i=9, 1, -2 read (10, fmt='(10i4/10i4)', rec=i) idata1, idata2 ! Verify idata1 contains i*10 .. i*10+9 do j=0, 9 if (idata1(j) /= i*10 + j) error stop end do ! Verify idata2 contains (i+1)*10 .. (i+1)*10+9 do j=0, 9 if (idata2(j) /= (i+1)*10 + j) error stop end do end do close (10, status='delete') print *, "PASS" end program lfortran-0.63.0/integration_tests/class_25.f900000664000175000017500000000117715174404631021326 0ustar alastairalastairmodule class_25_m implicit none type base integer :: m = 1 end type type, extends(base) :: derived integer :: n = 2 end type end module program class_25 use class_25_m implicit none class(base), allocatable :: b b = derived(10, 20) select type(b) type is (derived) if (b%m /= 10) error stop if (b%n /= 20) error stop class default error stop end select b = base(3) select type(b) type is (base) if (b%m /= 3) error stop class default error stop end select end program lfortran-0.63.0/integration_tests/bindc_iso_fb_03.f900000664000175000017500000004010315174404631022605 0ustar alastairalastair! Consolidated ISO_Fortran_binding test: Derived Types, Characters & Array Sections ! Merged from: bindc_22, bindc_26, bindc_27 ! ! bindc_22: Array sections, derived-type arrays, non-default bounds ! - Negative stride array sections ! - 2D/3D array sections passed as assumed-shape ! - TYPE, BIND(C) arrays via descriptor ! - Arrays with non-default lower bounds ! ! bindc_26: Derived type extensions through descriptors ! - Nested bind(C) derived types through descriptors ! - Derived type with array components ! - Allocatable array of derived types ! - Pointer array of derived types ! - 2D array of derived types ! - Assumed-rank with derived types ! - Empty bind(C) type ! - Derived type with character component ! - Derived type with complex component ! - Derived type with logical component ! - Array section of derived type array ! ! bindc_27: Character interop through descriptors ! - character(c_char, len=1) 1D/2D arrays through descriptor ! - character array sections through descriptor ! - character inout (modify in C) ! ============================================================ ! Modules from bindc_22 ! ============================================================ module bindc_22_types use iso_c_binding, only: c_int32_t, c_double implicit none type, bind(C) :: point_t integer(c_int32_t) :: x integer(c_int32_t) :: y end type end module module bindc_22_mod use iso_c_binding, only: c_int, c_int32_t, c_double use bindc_22_types implicit none interface ! ---- negative stride ---- integer(c_int32_t) function c22_sum_1d(a) bind(C, name="c22_sum_1d") import :: c_int32_t integer(c_int32_t), intent(in) :: a(:) end function ! ---- 2D section ---- integer(c_int32_t) function c22_sum_2d(a) bind(C, name="c22_sum_2d") import :: c_int32_t integer(c_int32_t), intent(in) :: a(:,:) end function ! ---- derived type array via descriptor ---- integer(c_int32_t) function c22_sum_points(pts) & bind(C, name="c22_sum_points") import :: c_int32_t, point_t type(point_t), intent(in) :: pts(:) end function integer(c_int) function c22_point_elem_size(pts) & bind(C, name="c22_point_elem_size") import :: c_int, point_t type(point_t), intent(in) :: pts(:) end function ! ---- non-default lower bounds ---- integer(c_int32_t) function c22_sum_nondefault(a) & bind(C, name="c22_sum_nondefault") import :: c_int32_t integer(c_int32_t), intent(in) :: a(:) end function integer(c_int) function c22_get_extent(a) & bind(C, name="c22_get_extent") import :: c_int, c_int32_t integer(c_int32_t), intent(in) :: a(:) end function end interface end module ! ============================================================ ! Modules from bindc_26 ! ============================================================ module bindc_26_types use iso_c_binding, only: c_int32_t, c_double, c_float, c_bool, c_char, & c_float_complex implicit none type, bind(C) :: inner_t integer(c_int32_t) :: x integer(c_int32_t) :: y end type type, bind(C) :: nested_t type(inner_t) :: pos integer(c_int32_t) :: id end type type, bind(C) :: complex_member_t complex(c_float_complex) :: z integer(c_int32_t) :: tag end type type, bind(C) :: bool_member_t logical(c_bool) :: flag integer(c_int32_t) :: val end type type, bind(C) :: char_member_t character(kind=c_char, len=1) :: code integer(c_int32_t) :: val end type type, bind(C) :: empty_t end type end module module bindc_26_mod use iso_c_binding, only: c_int, c_int32_t use bindc_26_types implicit none interface ! ---- nested bind(C) type ---- integer(c_int32_t) function c26_sum_nested(a) & bind(C, name="c26_sum_nested") import :: c_int32_t, nested_t type(nested_t), intent(in) :: a(:) end function ! ---- allocatable derived type array ---- integer(c_int32_t) function c26_sum_alloc_nested(a) & bind(C, name="c26_sum_alloc_nested") import :: c_int32_t, nested_t type(nested_t), allocatable, intent(in) :: a(:) end function ! ---- pointer derived type array ---- integer(c_int32_t) function c26_sum_ptr_nested(a) & bind(C, name="c26_sum_ptr_nested") import :: c_int32_t, nested_t type(nested_t), pointer, intent(in) :: a(:) end function ! ---- 2D derived type array ---- integer(c_int32_t) function c26_sum_2d_inner(a) & bind(C, name="c26_sum_2d_inner") import :: c_int32_t, inner_t type(inner_t), intent(in) :: a(:,:) end function ! ---- assumed-rank derived type ---- integer(c_int) function c26_rank_inner(a) & bind(C, name="c26_rank_inner") import :: c_int, inner_t type(inner_t), intent(in) :: a(..) end function ! ---- empty type ---- integer(c_int) function c26_sizeof_empty(a) & bind(C, name="c26_sizeof_empty") import :: c_int, empty_t type(empty_t), intent(in) :: a(:) end function ! ---- derived type with complex component ---- integer(c_int32_t) function c26_sum_complex_member(a) & bind(C, name="c26_sum_complex_member") import :: c_int32_t, complex_member_t type(complex_member_t), intent(in) :: a(:) end function ! ---- derived type with logical component ---- integer(c_int) function c26_count_flagged(a) & bind(C, name="c26_count_flagged") import :: c_int, bool_member_t type(bool_member_t), intent(in) :: a(:) end function ! ---- derived type with character component ---- integer(c_int) function c26_sum_char_codes(a) & bind(C, name="c26_sum_char_codes") import :: c_int, char_member_t type(char_member_t), intent(in) :: a(:) end function ! ---- array section of derived type ---- integer(c_int32_t) function c26_sum_inner_section(a) & bind(C, name="c26_sum_inner_section") import :: c_int32_t, inner_t type(inner_t), intent(in) :: a(:) end function end interface end module ! ============================================================ ! Module from bindc_27 ! ============================================================ module bindc_27_mod use iso_c_binding, only: c_int, c_char, c_int32_t implicit none interface ! ---- character(len=1) 1D sum ---- integer(c_int) function c27_char_sum_1d(a) & bind(C, name="c27_char_sum_1d") import :: c_int, c_char character(kind=c_char, len=1), intent(in) :: a(:) end function ! ---- character(len=1) 2D sum ---- integer(c_int) function c27_char_sum_2d(a) & bind(C, name="c27_char_sum_2d") import :: c_int, c_char character(kind=c_char, len=1), intent(in) :: a(:,:) end function ! ---- character inout (modify in C) ---- subroutine c27_char_toupper(a) bind(C, name="c27_char_toupper") import :: c_char character(kind=c_char, len=1), intent(inout) :: a(:) end subroutine end interface end module ! ============================================================ ! Main program ! ============================================================ program bindc_iso_fb_03 use bindc_22_mod use bindc_22_types use bindc_26_mod use bindc_26_types use bindc_27_mod use iso_c_binding, only: c_int32_t, c_char implicit none ! Tests from bindc_22 call test_negative_stride() call test_2d_sections() call test_derived_type_array() call test_nondefault_bounds() ! Tests from bindc_26 call test_nested() call test_alloc_nested() call test_ptr_nested() call test_2d_inner() call test_assumed_rank_dt() call test_empty_type() call test_complex_member() call test_bool_member() call test_char_member() call test_dt_section() ! Tests from bindc_27 call test_char_1d() call test_char_2d() call test_char_section() call test_char_inout() print *, "All bindc_iso_fb_03 tests passed." contains ! ============================================================ ! Test subroutines from bindc_22 ! ============================================================ subroutine test_negative_stride() integer(c_int32_t) :: arr(6) arr = [1, 2, 3, 4, 5, 6] ! Reverse: [6, 5, 4, 3, 2, 1] if (c22_sum_1d(arr(6:1:-1)) /= 21) error stop "FAIL: neg stride sum" ! Reverse stride-2: [6, 4, 2] if (c22_sum_1d(arr(6:1:-2)) /= 12) error stop "FAIL: neg stride-2" end subroutine subroutine test_2d_sections() integer(c_int32_t) :: a(4,4) integer :: i, j do j = 1, 4 do i = 1, 4 a(i,j) = (j-1)*4 + i end do end do ! Take a 2x2 sub-block: a(2:3, 2:3) = [[6,7],[10,11]] if (c22_sum_2d(a(2:3, 2:3)) /= 34) error stop "FAIL: 2d section" ! Take stride-2 in first dim: a(1::2, :) = rows 1,3 for all cols ! = [1,3,5,7,9,11,13,15] -> sum = 64 if (c22_sum_2d(a(1::2, :)) /= 64) error stop "FAIL: 2d stride section" end subroutine subroutine test_derived_type_array() type(point_t) :: pts(3) integer(c_int32_t) :: expected_size pts(1) = point_t(1, 10) pts(2) = point_t(2, 20) pts(3) = point_t(3, 30) ! sum of x+y for all points = (1+10) + (2+20) + (3+30) = 66 if (c22_sum_points(pts) /= 66) error stop "FAIL: derived type sum" ! elem_len should be sizeof(point_t) = 2 * sizeof(int32) = 8 expected_size = 8 if (c22_point_elem_size(pts) /= expected_size) & error stop "FAIL: derived type elem_size" end subroutine subroutine test_nondefault_bounds() integer(c_int32_t) :: a0(0:4) ! 5 elements, 0-based integer(c_int32_t) :: an(-2:2) ! 5 elements, negative-based integer :: i do i = 0, 4 a0(i) = i + 1 end do ! a0 = [1, 2, 3, 4, 5], sum = 15 if (c22_sum_nondefault(a0) /= 15) error stop "FAIL: 0-based sum" if (c22_get_extent(a0) /= 5) error stop "FAIL: 0-based extent" do i = -2, 2 an(i) = i + 3 end do ! an = [1, 2, 3, 4, 5], sum = 15 if (c22_sum_nondefault(an) /= 15) error stop "FAIL: neg-based sum" if (c22_get_extent(an) /= 5) error stop "FAIL: neg-based extent" end subroutine ! ============================================================ ! Test subroutines from bindc_26 ! ============================================================ subroutine test_nested() type(nested_t) :: arr(3) arr(1) = nested_t(inner_t(1, 2), 10) arr(2) = nested_t(inner_t(3, 4), 20) arr(3) = nested_t(inner_t(5, 6), 30) ! sum = (1+2+10) + (3+4+20) + (5+6+30) = 81 if (c26_sum_nested(arr) /= 81) error stop "FAIL: nested sum" end subroutine subroutine test_alloc_nested() type(nested_t), allocatable :: arr(:) allocate(arr(2)) arr(1) = nested_t(inner_t(10, 20), 100) arr(2) = nested_t(inner_t(30, 40), 200) ! sum = (10+20+100) + (30+40+200) = 400 if (c26_sum_alloc_nested(arr) /= 400) & error stop "FAIL: alloc nested sum" deallocate(arr) end subroutine subroutine test_ptr_nested() type(nested_t), target :: tgt(2) type(nested_t), pointer :: p(:) tgt(1) = nested_t(inner_t(1, 1), 1) tgt(2) = nested_t(inner_t(2, 2), 2) p => tgt ! sum = (1+1+1) + (2+2+2) = 9 if (c26_sum_ptr_nested(p) /= 9) error stop "FAIL: ptr nested sum" end subroutine subroutine test_2d_inner() type(inner_t) :: arr(2, 3) integer :: i, j, k k = 1 do j = 1, 3 do i = 1, 2 arr(i, j) = inner_t(k, k * 10) k = k + 1 end do end do ! x: 1..6, y: 10..60 step 10 ! sum = (1+2+3+4+5+6) + (10+20+30+40+50+60) = 21 + 210 = 231 if (c26_sum_2d_inner(arr) /= 231) error stop "FAIL: 2d inner sum" end subroutine subroutine test_assumed_rank_dt() type(inner_t) :: a1(3), a2(2, 2) a1(1) = inner_t(1, 1) a1(2) = inner_t(2, 2) a1(3) = inner_t(3, 3) if (c26_rank_inner(a1) /= 1) error stop "FAIL: ar dt rank 1" a2(1, 1) = inner_t(1, 1) a2(2, 1) = inner_t(2, 2) a2(1, 2) = inner_t(3, 3) a2(2, 2) = inner_t(4, 4) if (c26_rank_inner(a2) /= 2) error stop "FAIL: ar dt rank 2" end subroutine subroutine test_empty_type() type(empty_t) :: arr(3) integer :: sz sz = c26_sizeof_empty(arr) ! empty type has implementation-defined size, just check it runs if (sz < 0) error stop "FAIL: empty type" end subroutine subroutine test_complex_member() type(complex_member_t) :: arr(2) arr(1) = complex_member_t((1.0, 2.0), 10) arr(2) = complex_member_t((3.0, 4.0), 20) ! sum of tags = 10 + 20 = 30 if (c26_sum_complex_member(arr) /= 30) & error stop "FAIL: complex member" end subroutine subroutine test_bool_member() type(bool_member_t) :: arr(4) arr(1) = bool_member_t(.true., 10) arr(2) = bool_member_t(.false., 20) arr(3) = bool_member_t(.true., 30) arr(4) = bool_member_t(.false., 40) ! count flagged = 2 if (c26_count_flagged(arr) /= 2) error stop "FAIL: bool member" end subroutine subroutine test_char_member() type(char_member_t) :: arr(3) arr(1) = char_member_t('A', 1) arr(2) = char_member_t('B', 2) arr(3) = char_member_t('C', 3) ! sum of char codes = 65 + 66 + 67 = 198 if (c26_sum_char_codes(arr) /= 198) error stop "FAIL: char member" end subroutine subroutine test_dt_section() type(inner_t) :: arr(6) integer :: i do i = 1, 6 arr(i) = inner_t(i, i * 10) end do ! stride-2 section: elements 1, 3, 5 ! sum = (1+10) + (3+30) + (5+50) = 99 if (c26_sum_inner_section(arr(1::2)) /= 99) & error stop "FAIL: dt section" end subroutine ! ============================================================ ! Test subroutines from bindc_27 ! ============================================================ subroutine test_char_1d() character(kind=c_char, len=1) :: c1(4) c1 = ['A', 'B', 'C', 'D'] ! 65 + 66 + 67 + 68 = 266 if (c27_char_sum_1d(c1) /= 266) error stop "FAIL: char 1d sum" end subroutine subroutine test_char_2d() character(kind=c_char, len=1) :: c2(2, 3) c2(1, 1) = 'A' c2(2, 1) = 'B' c2(1, 2) = 'C' c2(2, 2) = 'D' c2(1, 3) = 'E' c2(2, 3) = 'F' ! 65+66+67+68+69+70 = 405 if (c27_char_sum_2d(c2) /= 405) error stop "FAIL: char 2d sum" end subroutine subroutine test_char_section() character(kind=c_char, len=1) :: arr(6) arr = ['A', 'B', 'C', 'D', 'E', 'F'] ! stride-2: A, C, E = 65 + 67 + 69 = 201 if (c27_char_sum_1d(arr(1::2)) /= 201) & error stop "FAIL: char section" end subroutine subroutine test_char_inout() character(kind=c_char, len=1) :: arr(3) arr = ['a', 'b', 'c'] call c27_char_toupper(arr) if (arr(1) /= 'A') error stop "FAIL: toupper 1" if (arr(2) /= 'B') error stop "FAIL: toupper 2" if (arr(3) /= 'C') error stop "FAIL: toupper 3" end subroutine end program lfortran-0.63.0/integration_tests/openmp_60.f900000664000175000017500000000133515174404631021512 0ustar alastairalastairprogram openmp_60 use omp_lib implicit none integer :: sum , team_sums(4) = 0, local_sum=0 sum=0 !$omp teams num_teams(4) thread_limit(3) shared(team_sums) private(local_sum) reduction(+:sum) !$omp parallel shared(team_sums) private(local_sum) reduction(+:sum) local_sum = omp_get_thread_num() * 10 + omp_get_team_num() sum = sum + local_sum !$omp critical team_sums(omp_get_team_num() + 1) = team_sums(omp_get_team_num() + 1) + local_sum !$omp end critical !$omp end parallel !$omp end teams print*, team_sums print*,sum if(sum/=138) error stop if(team_sums(1) /= 30) error stop if(team_sums(2) /= 33) error stop if(team_sums(3) /= 36) error stop if(team_sums(4) /= 39) error stop end program openmp_60lfortran-0.63.0/integration_tests/select_rank_02.f900000664000175000017500000000132315174404631022477 0ustar alastairalastair program select_rank_test implicit none real :: b(2) = [1,2] real :: c(2,2) = reshape([1,2,3,4],[2,2]) real :: d(2,2,2) = reshape([1,2,3,4,5,6,7,8],[2,2,2]) call check(b, 1) call check(c, 2) call check(d, 3) contains subroutine check(x, expected) real, intent(in) :: x(..) integer, intent(in) :: expected select rank(x) rank(0) if (expected /= 0) error stop rank(1) if (expected /= 1) error stop rank(2) if (expected /= 2) error stop rank default if (expected /= 3) error stop end select end subroutine check end program select_rank_testlfortran-0.63.0/integration_tests/modules_12.f900000664000175000017500000000023615174404631021660 0ustar alastairalastairmodule module_12 implicit none integer :: A(5) end module program prog_module_12 use module_12 implicit none A(5) = 5 if (A(5) /= 5) error stop end program lfortran-0.63.0/integration_tests/cpu_time_01.f900000664000175000017500000000030615174404631022011 0ustar alastairalastairprogram cpu_time_01 use iso_fortran_env, only: dp=>real64 implicit none real(dp) :: t1, t2 call cpu_time(t1) print *, "Some computation" call cpu_time(t2) print *, "Total time: ", t2-t1 end program lfortran-0.63.0/integration_tests/infer_walrus_shadow_03.f900000664000175000017500000000036515174404631024260 0ustar alastairalastairprogram infer_walrus_shadow_03 implicit none x = 42 if (x /= 42) error stop block x = 2.718d0 if (abs(x - 2.718d0) > 1.0d-10) error stop end block if (x /= 42) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/openmp_53.f900000664000175000017500000000053515174404631021515 0ustar alastairalastairprogram openmp_53 use omp_lib implicit none integer :: x integer, parameter:: N = 0 !$omp parallel shared(x) x=N !$omp barrier !$omp critical x = x + 1 !$omp end critical !$omp end parallel print *, "Final x:", x if (x /= omp_get_max_threads()) error stop "x is not equal to number of threads" end program openmp_53lfortran-0.63.0/integration_tests/separate_compilation_29b.f900000664000175000017500000000051215174404631024561 0ustar alastairalastairmodule separate_compilation_29b_module implicit none type :: t integer :: x end type t type(t) :: targets contains subroutine sb() targets%x = 2 end subroutine sb integer function get_b() get_b = targets%x end function get_b end module separate_compilation_29b_module lfortran-0.63.0/integration_tests/procedure_decl_01_b.f900000664000175000017500000000050115174404631023461 0ustar alastairalastairmodule eval_dependency contains subroutine OBJCON() end subroutine OBJCON end module eval_dependency module procedure_decl_01_b contains subroutine evaluate(calcfc) use eval_dependency implicit none procedure(OBJCON) :: calcfc call calcfc() end subroutine evaluate end module procedure_decl_01_blfortran-0.63.0/integration_tests/modules_31.f900000664000175000017500000000016315174404631021660 0ustar alastairalastairprogram modules_31 use fpm_cmd_update_modules_31 implicit none print *, "running modules_31 program" end program lfortran-0.63.0/integration_tests/array_07_transfer.f900000664000175000017500000000114315174404631023234 0ustar alastairalastairprogram array_07_transfer use, intrinsic :: iso_fortran_env, only: int32, int64, real32, int8 integer(int8) :: key(16) = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16] integer(int64) :: map_to_6 map_to_6 = transfer( [ key(1), 0_int8, 0_int8, 0_int8, & 0_int8, 0_int8, 0_int8, 0_int8 ], & 0_int64 ) print *, map_to_6 if (map_to_6 /= 1) error stop map_to_6 = transfer( [ key(1:4), 0_int8, 0_int8, 0_int8, 0_int8], & 0_int64 ) print *, map_to_6 if (map_to_6 /= 67305985) error stop end program array_07_transferlfortran-0.63.0/integration_tests/string_63.f900000664000175000017500000000136515174404631021530 0ustar alastairalastairprogram string_63 type :: string_type character(len=:), allocatable :: raw end type string_type type(string_type) :: string string%raw = "Hello" string = ff(string) print *, string%raw if(string%raw /= "Hello!!") error stop contains function ff(s) result(string) type(string_type),intent(in) :: s type(string_type) :: string print *, s%raw if(s%raw /= "Hello") error stop ! This should work with no issue (but as to `subroutine_from_function` is using LHS to be the holder of the return, allocating return `string` means allcoating argument `s`) ! allocate(character(len(s%raw)+2) :: string%raw) string%raw = s%raw //"!!" end function end programlfortran-0.63.0/integration_tests/infer_walrus_array_03.f900000664000175000017500000000046515174404631024112 0ustar alastairalastairprogram infer_walrus_array_03 implicit none x = [10, 20, 30] if (size(x) /= 3) error stop if (x(1) /= 10) error stop if (x(3) /= 30) error stop y = [1.0d0, 2.0d0, 3.0d0] if (size(y) /= 3) error stop if (abs(y(2) - 2.0d0) > 1.0d-10) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/functions_16.f900000664000175000017500000000510015174404631022217 0ustar alastairalastairmodule tomlf_utils_sort implicit none type :: toml_key character(len=:), allocatable :: key end type toml_key interface sort module procedure :: sort_keys end interface abstract interface pure function compare_less(lhs, rhs) result(less) import :: toml_key type(toml_key), intent (in) :: lhs type(toml_key), intent (in) :: rhs logical :: less end function compare_less end interface contains pure subroutine sort_keys(list, idx, compare) type(toml_key), intent(inout) :: list(:) integer, intent(out), optional :: idx(:) procedure(compare_less), optional :: compare integer :: low, high, i type(toml_key), allocatable :: sorted(:) integer, allocatable :: indexarray(:) low = 1 high = size(list) sorted = list allocate(indexarray(high), source=[(i, i=low, high)]) if (present(compare)) then call quicksort(sorted, indexarray, low, high, compare) else call quicksort(sorted, indexarray, low, high, compare_keys_less) end if do i = low, high list(i) = sorted(indexarray(i)) end do if (present(idx)) then idx = indexarray end if end subroutine sort_keys pure recursive subroutine quicksort(list, idx, low, high, less) type(toml_key), intent(inout) :: list(:) integer, intent(inout) :: idx(:) integer, intent(in) :: low, high procedure(compare_less) :: less integer :: i, last integer :: pivot if (low < high) then call swap(idx(low), idx((low + high)/2)) last = low do i = low + 1, high if (less(list(idx(i)), list(idx(low)))) then last = last + 1 call swap(idx(last), idx(i)) end if end do call swap(idx(low), idx(last)) pivot = last call quicksort(list, idx, low, pivot - 1, less) call quicksort(list, idx, pivot + 1, high, less) end if end subroutine quicksort pure subroutine swap(lhs, rhs) integer, intent(inout) :: lhs integer, intent(inout) :: rhs integer :: tmp tmp = lhs lhs = rhs rhs = tmp end subroutine swap pure function compare_keys_less(lhs, rhs) result(less) type(toml_key), intent (in) :: lhs type(toml_key), intent (in) :: rhs logical :: less less = lhs%key < rhs%key end function compare_keys_less end module tomlf_utils_sort program functions_16 print *, "running functions_16 program" end program lfortran-0.63.0/integration_tests/string_37.f900000664000175000017500000000126415174404631021527 0ustar alastairalastairprogram string_37 character(5) :: string character(:), pointer :: string2 print*, max(maybe(string), 'works') if (max(maybe(string), 'works') /= 'works') error stop string2 => cast_to_string() string = string2 if (string /= "Hello") error stop deallocate(string2) contains function maybe(string) result(maybe_string) character(5) :: string character(len=len(string)) :: maybe_string end function maybe function cast_to_string() result(str) character(len=:), pointer :: str character(len=5), pointer :: str2 allocate(str2) str2 = "Hello" str => str2 end function cast_to_string end lfortran-0.63.0/integration_tests/associate_18_module.f900000664000175000017500000000064215174404631023537 0ustar alastairalastairmodule associate_18_module_1 implicit none type :: toml_token integer :: chunk = 0 end type toml_token end module module associate_18_module_2 use associate_18_module_1, only : toml_token implicit none contains subroutine extract_datetime(token) type(toml_token), intent(in) :: token associate(token => token) end associate end subroutine extract_datetime end modulelfortran-0.63.0/integration_tests/legacy_array_sections_04b.f900000664000175000017500000000025015174404631024720 0ustar alastairalastairsubroutine sub(afb) real afb(3) print *, sum(afb) if ( .not. ( (abs(sum(afb) - 9.0) > 1e-8) .or. (abs(sum(afb) - 3.0) > 1e-8) ) ) error stop end subroutine lfortran-0.63.0/integration_tests/pass_array_by_data_09.f900000664000175000017500000000170215174404631024044 0ustar alastairalastairmodule pass_array_by_data_09_mod interface interface_1 procedure :: ff end interface interface_1 contains function ff(inp) result(oout) integer, intent(in) :: inp(:) integer :: oout print *, inp if(any(inp /= [1,2,3,4,5])) error stop oout = 11 end function end module pass_array_by_data_09_mod program pass_array_by_data_09 use pass_array_by_data_09_mod type :: tt integer :: i end type tt integer, allocatable :: ll(:) type(tt) :: inst_tt call ffo(inst_tt) contains subroutine ffo(dummy) class(tt), intent(in):: dummy ! This shouldn't idenify this function `ffo` as StructMethodDeclaration. It's a normal function. integer :: r integer, dimension(5) :: rr rr = [1,2,3,4,5] r = interface_1(rr) print *, r if(r /= 11) error stop end subroutine ffo end program pass_array_by_data_09 lfortran-0.63.0/integration_tests/inquire_11.f900000664000175000017500000000100715174404631021660 0ustar alastairalastairprogram inquire_11 implicit none integer :: u, pos_val u = 10 open(unit=u, file="inquire_11_tmp.txt", status="replace") write(u, '(A)') 'Line 1' inquire(unit=u, pos=pos_val) if (pos_val /= 6) error stop write(u, '(A)') 'Line 2' inquire(unit=u, pos=pos_val) if (pos_val /= 12) error stop write(u, '(A)') 'Hello World!' inquire(unit=u, pos=pos_val) if (pos_val /= 24) error stop close(u, status="delete") print *, "All tests passed." end program inquire_11 lfortran-0.63.0/integration_tests/do_concurrent_01.f900000664000175000017500000000027515174404631023055 0ustar alastairalastairprogram do_concurrent_01 integer :: i, n real :: x(12) n = 12 x = 0.49 do concurrent(i = 1:n) print *, x(i) if (abs(x(i) - 0.49) > 1e-6) error stop end do end program lfortran-0.63.0/integration_tests/procedure_23.f900000664000175000017500000000271515174404631022206 0ustar alastairalastairmodule procedure_23_mod implicit none type :: dependency_config_t integer :: id = -1 end type dependency_config_t type, extends(dependency_config_t) :: dependency_node_t character(:), allocatable :: name end type dependency_node_t type :: dependency_tree_t integer :: key contains procedure :: add_dependency procedure :: add_dependency_node generic :: add => add_dependency, add_dependency_node end type dependency_tree_t contains subroutine add_dependency(this, cfg) class(dependency_tree_t), intent(inout) :: this type(dependency_config_t), intent(inout) :: cfg cfg%id = 101 this%key = 2 end subroutine add_dependency subroutine add_dependency_node(this, node) class(dependency_tree_t), intent(inout) :: this type(dependency_node_t), intent(inout) :: node node%id = 202 this%key = 3 node%name = "LFortran" end subroutine add_dependency_node end module procedure_23_mod program procedure_23 use procedure_23_mod implicit none type(dependency_tree_t) :: tree type(dependency_config_t) :: cfg type(dependency_node_t) :: node call tree%add(cfg) if (cfg%id /= 101) error stop if (tree%key /= 2) error stop call tree%add(node) if (node%id /= 202) error stop if (node%name /= "LFortran") error stop if (tree%key /= 3) error stop end program procedure_23 lfortran-0.63.0/integration_tests/modules_25_module1.f900000664000175000017500000000077315174404631023320 0ustar alastairalastairmodule tomlf_de_character use tomlf_de_tokenizer_25 implicit none private public :: toml_character_tokenizer type, extends(toml_tokenizer) :: toml_character_tokenizer character(len=:), pointer :: conf contains procedure :: next_token end type toml_character_tokenizer contains subroutine next_token(de, dot_is_token) class(toml_character_tokenizer), intent(inout) :: de logical, intent(in) :: dot_is_token end subroutine next_token end module tomlf_de_character lfortran-0.63.0/integration_tests/intrinsics_434.f900000664000175000017500000000023315174404631022462 0ustar alastairalastairPROGRAM intrinsics_434 INTEGER, PARAMETER :: ki = SELECTED_INT_KIND(r=9) WRITE(*,*) 'ki =', ki IF ( ki /= 4) ERROR STOP END PROGRAM intrinsics_434lfortran-0.63.0/integration_tests/nbody.f900000664000175000017500000001331715174404631021025 0ustar alastairalastair! The Computer Language Benchmarks Game ! Source: https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/nbody-ifc-6.html ! ! contributed by Simon Geard, translated from Mark C. Williams nbody.java ! modified by Brian Taylor ! modified by yuankun shi ! modified by Padraig O Conbhui program nbody implicit none integer, parameter :: dp = kind(1.d0) real(kind=dp), parameter :: tstep = 0.01d0 real(kind=dp), parameter :: PI = 3.141592653589793d0 real(kind=dp), parameter :: SOLAR_MASS = 4 * PI * PI real(kind=dp), parameter :: DAYS_PER_YEAR = 365.24d0 type body real(kind=dp) :: x, y, z, u, vx, vy, vz, vu, mass end type body type(body), parameter :: jupiter = body(& 4.84143144246472090d0, -1.16032004402742839d0, & -1.03622044471123109d-01, 0.d0, 1.66007664274403694d-03 * DAYS_PER_YEAR, & 7.69901118419740425d-03 * DAYS_PER_YEAR, & -6.90460016972063023d-05 * DAYS_PER_YEAR, 0.d0,& 9.54791938424326609d-04 * SOLAR_MASS) type(body), parameter :: saturn = body(& 8.34336671824457987d+00, & 4.12479856412430479d+00, & -4.03523417114321381d-01, 0.d0, & -2.76742510726862411d-03 * DAYS_PER_YEAR, & 4.99852801234917238d-03 * DAYS_PER_YEAR, & 2.30417297573763929d-05 * DAYS_PER_YEAR, 0.d0,& 2.85885980666130812d-04 * SOLAR_MASS) type(body), parameter :: uranus = body(& 1.28943695621391310d+01, & -1.51111514016986312d+01, & -2.23307578892655734d-01, 0.d0,& 2.96460137564761618d-03 * DAYS_PER_YEAR, & 2.37847173959480950d-03 * DAYS_PER_YEAR, & -2.96589568540237556d-05 * DAYS_PER_YEAR, 0.d0,& 4.36624404335156298d-05 * SOLAR_MASS ) type(body), parameter :: neptune = body(& 1.53796971148509165d+01, & -2.59193146099879641d+01, & 1.79258772950371181d-01, 0.d0,& 2.68067772490389322d-03 * DAYS_PER_YEAR, & 1.62824170038242295d-03 * DAYS_PER_YEAR, & -9.51592254519715870d-05 * DAYS_PER_YEAR, 0.d0,& 5.15138902046611451d-05 * SOLAR_MASS) type(body), parameter :: sun = body(0.0d0, 0.0d0, 0.0d0, 0.0d0, 0.0d0, & 0.0d0, 0.d0, 0.d0, SOLAR_MASS) integer, parameter :: nb = 5 integer, parameter :: N = (nb-1)*nb/2 real(kind=dp), parameter :: mass(nb) = (/ sun%mass, jupiter%mass, saturn%mass, & uranus%mass, neptune%mass /) integer :: num, i character(len=8) :: argv real(kind=dp) :: e, x(3,nb), v(3,nb) x(:,1) = (/ sun%x, sun%y, sun%z /) x(:,2) = (/ jupiter%x, jupiter%y, jupiter%z /) x(:,3) = (/ saturn%x, saturn%y, saturn%z /) x(:,4) = (/ uranus%x, uranus%y, uranus%z /) x(:,5) = (/ neptune%x, neptune%y, neptune%z /) v(:,1) = (/ sun%vx, sun%vy, sun%vz /) v(:,2) = (/ jupiter%vx, jupiter%vy, jupiter%vz /) v(:,3) = (/ saturn%vx, saturn%vy, saturn%vz /) v(:,4) = (/ uranus%vx, uranus%vy, uranus%vz /) v(:,5) = (/ neptune%vx, neptune%vy, neptune%vz /) ! call getarg(1, argv) ! read (argv,*) num num = 1000 call offsetMomentum(1, v, mass) e = energy(x, v, mass) ! workaround print *, e if (abs(e + 0.16907516382852447) > 1e-8) error stop do i = 1, num call advance(tstep, x, v, mass) end do e = energy(x, v, mass) ! workaround print *, e if (abs(e + 0.16908760523460617) > 1e-8) error stop contains subroutine offsetMomentum(k, v, mass) integer, intent(in) :: k real(kind=dp), dimension(3,nb), intent(inout) :: v real(kind=dp), dimension(nb), intent(in) :: mass real(kind=dp), dimension(3) :: p integer :: i p = (/ (sum(v(i,:) * mass(:)), i=1,3) /) v(:,k) = -p / SOLAR_MASS end subroutine offsetMomentum pure subroutine advance(tstep, x, v, mass) real(kind=dp), intent(in) :: tstep real(kind=dp), dimension(3, nb), intent(inout) :: x, v real(kind=dp), dimension(nb), intent(in) :: mass real(kind=dp) :: r(3, N), mag(N) real(kind=dp) :: distance, d2 integer :: i, j, m m = 1 do i = 1, nb do j = i + 1, nb r(:,m) = x(:,i) - x(:,j) m = m + 1 end do end do do m = 1, N d2 = sum(r(:,m)**2) distance = 1/sqrt(real(d2)) distance = distance * (1.5d0 - 0.5d0 * d2 * distance * distance) !distance = distance * (1.5d0 - 0.5d0 * d2 * distance * distance) mag(m) = tstep * distance**3 end do m = 1 do i = 1, nb do j = i + 1, nb v(:,i) = v(:,i) - r(:,m) * mass(j) * mag(m) v(:,j) = v(:,j) + r(:,m) * mass(i) * mag(m) m = m + 1 end do end do x = x + tstep * v end subroutine advance pure function energy(x, v, mass) real(kind=dp) :: energy real(kind=dp), dimension(3,nb), intent(in) :: x, v real(kind=dp), dimension(nb), intent(in) :: mass real(kind=dp) :: distance, tmp real(kind=dp), dimension(3) :: d integer :: i, j energy = 0.0d0 do i = 1, nb energy = energy + 0.5d0 * mass(i) * sum(v(:,i)**2) do j = i + 1, nb d = x(:,i) - x(:,j) tmp = sum(d**2) distance = sqrt(tmp) energy = energy - (mass(i) * mass(j)) / distance end do end do end function energy pure function sum(arr) result(r) real(kind=dp), intent(in) :: arr(:) real(kind=dp) :: r integer :: i r = 0.0 do i = 1, size(arr) r = r + arr(i) end do end function sum end program nbody lfortran-0.63.0/integration_tests/intrinsics_259.f900000664000175000017500000000545715174404631022504 0ustar alastairalastairprogram intrinsics_259 implicit none character(5) :: hello = "hello" character(5) :: world = "world" character(8) :: lfortran = "lfortran" character(7) :: fortran = "fortran" character(5) :: sym = "#s@ym" character(4) :: sym2 = "s_y!" logical, parameter :: l1 = lgt("hello", "world") logical, parameter :: l2 = lge("lfortran", "fortran") logical, parameter :: l3 = llt("#s@ym", "world") logical, parameter :: l4 = lle("hello", "s_y!") logical, parameter :: ar1(3) = lgt(["hello", "world", "#s@ym"], ["world", "hello", "s_y!0"]) logical, parameter :: ar2(3) = lgt(["lfortran", "gfortran", "fort_ran"], ["world", "hello", "s_y!0"]) logical, parameter :: ar3(3) = lge(["lfortran", "gfortran", "fort_ran"], ["hello", "world", "#s@ym"]) logical, parameter :: ar4(3) = llt(["hello", "world", "#s@ym"], ["world", "hello", "s_y!0"]) character(5) :: arr1(3) character(5) :: arr2(3) character(8) :: arr3(3) character(5) :: arr4(3) logical :: res(3) arr1 = ["hello", "world", "#s@ym"] arr2 = ["world", "hello", "s_y!0"] arr3 = ["lfortran", "gfortran", "fort_ran"] arr4 = ["world", "hello", "s_y!0"] print *, l1 if (l1 .neqv. .false.) error stop print *, l2 if (l2 .neqv. .true.) error stop print *, l3 if (l3 .neqv. .true.) error stop print *, l4 if (l4 .neqv. .true.) error stop print *, ar1 ! if (all(ar1 .neqv. [.false., .true., .false.])) error stop ! does not work yet print *, ar2 ! if (all(ar2 .neqv. [.false., .false., .false.])) error stop print *, ar3 ! if (all(ar3 .neqv. [.true., .false., .true.])) error stop print *, ar4 ! if (all(ar4 .neqv. [.true., .false., .true.])) error stop print *, lgt(hello, world) if (lgt(hello, world) .neqv. .false.) error stop print *, lge(lfortran, fortran) if (lge(lfortran, fortran) .neqv. .true.) error stop print *, llt(sym, world) if (llt(sym, world) .neqv. .true.) error stop print *, lle(hello, sym2) if (lle(hello, sym2) .neqv. .true.) error stop print *, lgt(arr1, arr2) if (all(lgt(arr1, arr2) .neqv. [.true., .true., .true.])) error stop print *, lge(arr2, arr3) if (all(lge(arr2, arr3) .neqv. [.true., .true., .true.])) error stop print *, llt(arr3, arr4) if (all(llt(arr3, arr4) .neqv. [.true., .true., .true.])) error stop print *, lle(arr4, arr1) if (all(lle(arr4, arr1) .neqv. [.true., .true., .true.])) error stop res = lgt(arr1, arr2) if (all(res .neqv. [.true., .true., .true.])) error stop res = lge(arr2, arr3) if (all(res .neqv. [.true., .true., .true.])) error stop res = llt(arr3, arr4) if (all(res .neqv. [.true., .true., .true.])) error stop res = lle(arr4, arr1) if (all(res .neqv. [.true., .true., .true.])) error stop end programlfortran-0.63.0/integration_tests/class_92.f900000664000175000017500000000227715174404631021334 0ustar alastairalastair! Test for unlimited polymorphic array member with type-bound procedures ! Fixes issue #7359 - class(*) vtable codegen bug module class_92_mod implicit none type :: deque private class(*), dimension(:), allocatable :: items integer :: count = 0 contains procedure :: at_size_kind procedure :: at_default procedure :: get_count end type deque contains function at_size_kind(this, i, rc) result(res) class(deque), target, intent(in) :: this integer(8), intent(in) :: i integer, intent(out) :: rc class(*), pointer :: res res => null() rc = 0 end function at_size_kind function at_default(this, i, rc) result(res) class(deque), target, intent(in) :: this integer, intent(in) :: i integer, intent(out) :: rc class(*), pointer :: res res => this%at_size_kind(int(i, 8), rc) end function at_default function get_count(this) result(c) class(deque), intent(in) :: this integer :: c c = this%count end function get_count end module class_92_mod program class_92 use class_92_mod implicit none type(deque) :: d integer :: c c = d%get_count() if (c /= 0) error stop print *, "PASS" end program class_92 lfortran-0.63.0/integration_tests/read_58.f900000664000175000017500000000066615174404631021144 0ustar alastairalastairprogram read_58 implicit none integer(1) :: i8 integer(2) :: i16 character(len=10) :: s s = "42" read(s, *) i8 if (i8 /= 42) error stop print *, i8 s = "-7" read(s, *) i8 if (i8 /= -7) error stop print *, i8 s = "12345" read(s, *) i16 if (i16 /= 12345) error stop print *, i16 s = "-99" read(s, *) i16 if (i16 /= -99) error stop print *, i16 end program lfortran-0.63.0/integration_tests/associate_06.f900000664000175000017500000000016715174404631022171 0ustar alastairalastairmodule associate_06_stdlib_string use associate_06_stdlib_string_type end module program associate_06 end program lfortran-0.63.0/integration_tests/arrays_op_9.f900000664000175000017500000000156015174404631022136 0ustar alastairalastairprogram arrays_op_9 implicit none call f() contains function modify(n, array_a) result(r) integer, intent(in) :: n real(4), intent(in) :: array_a(n) real(4) :: r(n) r = sqrt(array_a) end function subroutine verify(array_a, array_b, result, size) real(4), intent(in) :: array_a(:), array_b(:), result(:) integer, intent(in) :: size integer :: i real(4) :: eps eps = 1e-6 do i = 1, size if ( abs(array_a(i) * array_a(i) + sqrt(array_b(i)) - result(i)) > eps ) error stop end do end subroutine subroutine f() integer :: i, j real(4) :: array_a(256), array_b(256), array_c(256) do i = 1, 256 array_a(i) = i end do do j = 1, 256 array_b(j) = j + 5 end do array_c = array_a**2 + modify(256, array_b) call verify(array_a, array_b, array_c, 256) end subroutine end program lfortran-0.63.0/integration_tests/class_23.f900000664000175000017500000000123315174404631021315 0ustar alastairalastairmodule class_23_m implicit none type base integer :: m = 1 end type type, extends(base) :: derived integer :: n = 2 end type contains subroutine test(self) class(base) :: self select type(self) type is (derived) if (self%m /= 10) error stop if (self%n /= 20) error stop end select end subroutine end module program class_23 use class_23_m implicit none class(base), allocatable :: b type(derived) :: d allocate(derived :: b) d = derived(10, 20) b = d call test(b) end program lfortran-0.63.0/integration_tests/implicit_interface_15b.f900000664000175000017500000000021615174404631024205 0ustar alastairalastairsubroutine strsm( a, n ) integer :: i, n real :: a(0 : *), res print *,"x" res = 0.0 do i = 0, n - 1 res = res + a(i) end do print *, res end lfortran-0.63.0/integration_tests/modules_19.f900000664000175000017500000000125715174404631021673 0ustar alastairalastairprogram modules_19 use modules_19b implicit none character(*), parameter :: s1 = " A B ", s2 = " " if (len_trim(s1) /= 4) error stop if (len_trim(s2) /= 0) error stop if (len_trim(" ") /= 0) error stop if (len_trim("") /= 0) error stop if (len_trim("xx") /= 2) error stop if (trim(s1) /= " A B") error stop if (trim(s2) /= "") error stop if (trim(" ") /= "") error stop if (trim("") /= "") error stop if (trim("xx") /= "xx") error stop if (len(trim(s1)) /= 4) error stop if (len(trim(s2)) /= 0) error stop if (len(trim(" ")) /= 0) error stop if (len(trim("")) /= 0) error stop if (len(trim("xx")) /= 2) error stop print *, trim("xx ") print *, len(trim("xx ")) end program lfortran-0.63.0/integration_tests/do_concurrent_11.f900000664000175000017500000000233615174404631023056 0ustar alastairalastair! equivalent to openmp_28.f90 subroutine csr_matvec(Ap, Aj, Ax, x, y) ! Compute y = A*x for CSR matrix A and dense vectors x, y integer, intent(in) :: Ap(:), Aj(:) real, intent(in) :: Ax(:), x(:) real, intent(inout) :: y(size(Ap)-1) integer :: i, j ! Initialize y to zero y = 0.0 do concurrent (i = 1:size(Ap)-1) shared(Ap, Aj, Ax, x, y) local(j) do j = Ap(i), Ap(i+1)-1 y(i) = y(i) + Ax(j)*x(Aj(j)) end do end do print *, sum(y(1:10)) if (abs(sum(y(1:10)) - 950.00) > 1e-8) error stop end subroutine program do_concurrent_11 implicit none interface subroutine csr_matvec(Ap, Aj, Ax, x, y) integer, intent(in) :: Ap(:), Aj(:) real, intent(in) :: Ax(:), x(:) real, intent(inout) :: y(size(Ap)-1) end subroutine end interface integer, parameter :: n = 100 integer :: i real :: x(n), y(n) integer, allocatable :: Ap(:), Aj(:) real, allocatable :: Ax(:) ! Initialize CSR matrix A allocate(Ap(n+1), Aj(3*n), Ax(3*n)) Ap = [(3*(i-1)+1, i=1,n+1)] Aj = [(mod(i-1, n)+1, i=1,3*n)] Ax = [(1.0, 2.0, 3.0, i=1,n)] ! Initialize vector x x = [(i, i=1,n)] ! Initialize y to zero y = 0.0 ! Compute y = A*x call csr_matvec(Ap, Aj, Ax, x, y) ! Print the result print *, sum(y) if (abs(sum(y) - 30300.00) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/common_12.f900000664000175000017500000000057415174404631021505 0ustar alastairalastairsubroutine dvode () double precision tau common /dvod01/ tau(13) end subroutine dvstep () double precision tau double precision h common /dvod01/ tau(13) h = 5.6d0 tau(1) = h return end program common_12 double precision tau common /dvod01/ tau(13) call dvstep() if (abs(tau(1) - 5.6d0) > 1e-10) error stop print *, tau(1) end program lfortran-0.63.0/integration_tests/openmp_72.f900000664000175000017500000000101515174404631021510 0ustar alastairalastair! Without Teams/Distribute constructs similar to openmp_71 program openmp_72 implicit none real, allocatable, dimension(:) :: a, b integer :: i allocate(a(10000000), b(10000000)) b=5 !$omp target map(tofrom:a, b) !$omp parallel do do i = 1, 10000000 a(i) = i + b(i)*340 end do !$omp end parallel do !$omp end target print*, a(5), b(5) if(a(5) /= 1705) error stop if(b(5) /= 5) error stop end program openmp_72lfortran-0.63.0/integration_tests/operator_overloading_04.f900000664000175000017500000000254415174404631024441 0ustar alastairalastairmodule operator_overloading_04_stdlib_string_type type :: string_type ! Use the sequence statement below as a hack to prevent extending this type. ! It is not used for storage association. sequence character(len=:), allocatable :: raw end type string_type interface assignment(=) module procedure :: assign_string_char end interface assignment(=) contains pure subroutine assign_string_char(lhs, rhs) type(string_type), intent(inout) :: lhs character(len=*), intent(in) :: rhs lhs%raw = rhs end subroutine assign_string_char elemental function trim_string(string) result(trimmed_string) type(string_type), intent(in) :: string type(string_type) :: trimmed_string trimmed_string = string%raw end function trim_string end module module operator_overloading_stdlib_string_use use operator_overloading_04_stdlib_string_type, only: string_type implicit none contains pure function chomp_string(string) result(chomped_string) ! Avoid polluting the module scope and use the assignment only in this scope use operator_overloading_04_stdlib_string_type, only : assignment(=) type(string_type), intent(in) :: string type(string_type) :: chomped_string integer :: last end function chomp_string end module program stdlib_string end program lfortran-0.63.0/integration_tests/openmp_38.f900000664000175000017500000000056515174404631021523 0ustar alastairalastairprogram openmp_38 use omp_lib ! declare variables as required integer :: ny, nx, nz integer :: iy, ix, iz ny=3 nx=4 nz=5 !$omp parallel do collapse(3) private(iy, ix, iz) do iy = 1, ny do ix = 1, nx do iz = 1, nz print *,"iy->", iy,"ix->", ix,"iz->", iz end do end do end do !$omp end parallel do end program lfortran-0.63.0/integration_tests/submodule_34b.f900000664000175000017500000000274115174404631022360 0ustar alastairalastairmodule submodule_34_string_mod implicit none type :: string_type character(:), allocatable :: raw end type interface len module procedure :: len_string end interface interface char module procedure :: char_string end interface contains elemental function len_string(string) result(length) type(string_type), intent(in) :: string integer :: length if (allocated(string%raw)) then length = len(string%raw) else length = 0 end if end function pure function char_string(string) result(res) type(string_type), intent(in) :: string character(len=len(string)) :: res res = '' if (allocated(string%raw)) then res = string%raw end if end function end module submodule_34_string_mod module submodule_34_parent_mod use submodule_34_string_mod, only: string_type implicit none interface module subroutine test_sub(x) integer, intent(out) :: x end subroutine end interface end module submodule_34_parent_mod submodule(submodule_34_parent_mod) submodule_34_impl use submodule_34_string_mod, only: string_type, char contains module subroutine test_sub(x) integer, intent(out) :: x type(string_type) :: s character(:), allocatable :: t s%raw = "hello" t = char(s) x = len(t) end subroutine test_sub end submodule submodule_34_impl lfortran-0.63.0/integration_tests/file_10.f900000664000175000017500000000244115174404631021125 0ustar alastairalastairprogram file_10 implicit none character(:), allocatable :: sentence1 character(:), allocatable :: sentence2 character(:), allocatable :: sentence3 character(:), allocatable :: sentence4 character :: c integer :: u = 11, iostat, i open(u, file="file_10_data.txt", form="formatted", access="stream", status="old") sentence1 = get_prompt(u) print *, sentence1 if (sentence1 /= "hello hi bye.") error stop sentence2 = get_prompt(u) print *, sentence2 if (sentence2 /= "1234\nhi hello \n abcd!?") error stop sentence3 = get_prompt(u) print *, sentence3 if (sentence3 /= "\n ajdfsalfj;as\n \r jdalfk\14") error stop sentence4 = get_prompt(u) print *, sentence4 if (sentence4 /= "dsfjlkf\r\tjkdlfas\n\r\t\n") error stop rewind(u) do i = 1, 14 read(u, "(a)", advance="no", iostat=iostat) c end do print*, iostat if (iostat /= -2) error stop contains function get_prompt(fp) result(input) integer, intent(in) :: fp character(:), allocatable :: input character(1024) :: tmp integer ::ios read(fp, "(a)", iostat=ios) tmp if (ios == 0) then input = trim(tmp) else input = "" end if end function end program lfortran-0.63.0/integration_tests/assumed_rank_07.f900000664000175000017500000000070715174404631022673 0ustar alastairalastairprogram assumed_rank_07 implicit none real :: arr2d(3, 4) real :: arr1d(5) arr2d = 1.0 arr1d = 2.0 call check(arr2d, 12_8) call check(arr1d, 5_8) contains subroutine check(a, expected) type(*), intent(in), contiguous :: a(..) integer(8), intent(in) :: expected integer(8) :: n n = int(product(shape(a)), 8) if (n /= expected) error stop end subroutine end program assumed_rank_07lfortran-0.63.0/integration_tests/run_tests.py0000775000175000017500000002417615174404631022002 0ustar alastairalastair#!/usr/bin/env python import argparse import subprocess as sp import os # Initialization NO_OF_THREADS = 8 # default no of threads is 8 SUPPORTED_BACKENDS = ['llvm', 'llvm2', 'llvm_rtlib', 'c', 'cpp', 'x86', 'wasm', 'gfortran', 'flang', 'llvmImplicit', 'llvmStackArray', 'llvm_integer_8', 'llvm_infer', 'fortran', 'c_nopragma', 'llvm_nopragma', 'llvm_wasm', 'llvm_wasm_emcc', 'llvm_omp', 'llvm_submodule', 'mlir', 'mlir_omp', 'mlir_llvm_omp', 'llvm_goc', 'target_offload', 'llvm_single_invocation', 'metal', 'cuda'] SUPPORTED_STANDARDS = ['lf', 'f23', 'legacy'] BASE_DIR = os.path.dirname(os.path.realpath(__file__)) LFORTRAN_PATH = f"{BASE_DIR}/../src/bin" fast_tests = "no" detect_leaks_tests = "no" nofast_llvm16 = "no" separate_compilation = "no" use_ninja = False user_specified_threads = False verbose = False def run_cmd(cmd, cwd=None): print(f"+ {cmd}") process = sp.run(cmd, shell=True, cwd=cwd) if process.returncode != 0: print("Command failed.") exit(1) def run_test(backend, std, test_pattern=None): run_cmd(f"mkdir {BASE_DIR}/test-{backend}") if std == "f23": std_string = "-DSTD_F23=yes" elif std == "legacy": std_string = "-DSTD_LEGACY=yes" elif std == "lf": std_string = "" else: raise Exception("Unsupported standard") cwd=f"{BASE_DIR}/test-{backend}" # Skip CMake's Fortran compiler detection for lfortran, since it tries # `-c` which requires the LLVM backend (not available for all backends). if backend not in ("gfortran", "flang"): skip_fc_detection = ("-DCMAKE_Fortran_COMPILER_WORKS=1 " "-DCMAKE_Fortran_COMPILER_FORCED=1") else: skip_fc_detection = "" # Conditionally use Ninja or Make (default) if use_ninja: # Use Ninja generator for faster builds # Set CMAKE_Fortran_PREPROCESS_SOURCE which is required by Ninja but missing for lfortran generator_flags = (f"-G Ninja {skip_fc_detection} " "-DCMAKE_Fortran_PREPROCESS_SOURCE=\" " "-E -o \"") else: # Use default Make generator generator_flags = skip_fc_detection common=f" {generator_flags} -DCURRENT_BINARY_DIR={BASE_DIR}/test-{backend} -S {BASE_DIR} -B {BASE_DIR}/test-{backend}" if backend == "gfortran": run_cmd(f"FC=gfortran cmake" + common, cwd=cwd) elif backend == "flang": # Resolve flang to find its LLVM install prefix, then use the # matching clang as CC so it can find ISO_Fortran_binding.h. import shutil, pathlib flang_path = pathlib.Path(shutil.which("flang")).resolve() flang_prefix = flang_path.parent.parent clang_bin = flang_prefix / "bin" / "clang" run_cmd(f"FC=flang CC={clang_bin} cmake -DLFORTRAN_BACKEND=flang" + common, cwd=cwd) elif backend == "cpp": run_cmd(f"FC=lfortran FFLAGS=\"--openmp\" cmake -DLFORTRAN_BACKEND={backend} -DFAST={fast_tests} " f"-DDETECT_LEAKS={detect_leaks_tests} -DLLVM_GOC={separate_compilation} " f"-DNOFAST_LLVM16={nofast_llvm16} {std_string}" + common, cwd=cwd) elif backend == "fortran": run_cmd(f"FC=lfortran cmake -DLFORTRAN_BACKEND={backend} " f"-DFAST={fast_tests} -DDETECT_LEAKS={detect_leaks_tests} " f"-DLLVM_GOC={separate_compilation} -DNOFAST_LLVM16={nofast_llvm16} " f"-DCMAKE_Fortran_FLAGS=\"-fPIC\" {std_string}" + common, cwd=cwd) else: run_cmd(f"FC=lfortran cmake -DLFORTRAN_BACKEND={backend} -DFAST={fast_tests} " f"-DDETECT_LEAKS={detect_leaks_tests} -DLLVM_GOC={separate_compilation} " f"{std_string} -DNOFAST_LLVM16={nofast_llvm16} " + common, cwd=cwd) # If a test pattern is provided, find matching tests and build only those if test_pattern: # Query ctest to find which tests match the pattern result = sp.run(f"ctest -N -R {test_pattern}", shell=True, cwd=cwd, stdout=sp.PIPE, stderr=sp.PIPE, text=True) if result.returncode != 0: print("Failed to query tests with ctest") exit(1) # Parse the output to extract test names # Output format: " Test #123: test_name" import re test_names = [] for line in result.stdout.split('\n'): match = re.match(r'\s+Test\s+#\d+:\s+(\S+)', line) if match: test_names.append(match.group(1)) if not test_names: print(f"No tests match pattern: {test_pattern}") exit(1) print(f"Building {len(test_names)} test(s): {', '.join(test_names)}") # Build only the matching test targets build_cmd = "ninja" if use_ninja else "make" # Ninja uses all cores by default, so only specify -j if user provided it # Make needs -j specified, so use default or user-provided value if use_ninja and not user_specified_threads: # User didn't specify -j, let ninja use all cores j_flag = "" else: j_flag = f" -j{NO_OF_THREADS}" v_flag = " -v" if verbose and use_ninja else "" v_env = "VERBOSE=1 " if verbose and not use_ninja else "" for test_name in test_names: run_cmd(f"{v_env}{build_cmd}{j_flag}{v_flag} {test_name}", cwd=cwd) else: # Build all tests build_cmd = "ninja" if use_ninja else "make" if use_ninja and not user_specified_threads: j_flag = "" else: j_flag = f" -j{NO_OF_THREADS}" v_flag = " -v" if verbose and use_ninja else "" v_env = "VERBOSE=1 " if verbose and not use_ninja else "" run_cmd(f"{v_env}{build_cmd}{j_flag}{v_flag}", cwd=cwd) # Build ctest command with optional test pattern filter ctest_cmd = f"ctest -j{NO_OF_THREADS} --output-on-failure" if verbose: ctest_cmd += " -V" if test_pattern: ctest_cmd += f" -R {test_pattern}" run_cmd(ctest_cmd, cwd=cwd) def test_backend(backend, std, test_pattern=None): if backend not in SUPPORTED_BACKENDS: raise Exception(f"Unsupported Backend: {backend}\n") if std not in SUPPORTED_STANDARDS: raise Exception(f"Unsupported Backend: {std}\n") run_test(backend, std, test_pattern) def check_module_names(): from glob import glob import re mod = re.compile( r'(?im)^\s*(?:module|submodule)\b\s*(?:\([^)]+\))?\s*(?!\bprocedure\b)(\w+)' ) files = glob("*.f90") module_names = [] file_names = [] for file in files: with open(file) as f: content = f.read() s = mod.search(content) if s: module_names.append(s.group(1).lower()) file_names.append(file) for i in range(len(module_names)): name = module_names[i] if name in module_names[i+1:]: print("FAIL: Found a duplicate module name") print("Name:", name) print("Filename:", file_names[i]) raise Exception("Duplicate module names") print("OK: All module names are unique") def get_args(): parser = argparse.ArgumentParser(description="LFortran Integration Test Suite") parser.add_argument("-j", "-n", "--no_of_threads", type=int, help="Parallel testing on given number of threads") parser.add_argument("-b", "--backends", nargs="*", default=["llvm"], type=str, help="Test the requested backends (%s)" % \ ", ".join(SUPPORTED_BACKENDS)) parser.add_argument("--std", type=str, default="lf", help="Run tests with the requested Fortran standard: ".join(SUPPORTED_STANDARDS)) parser.add_argument("-f", "--fast", action='store_true', help="Run supported tests with --fast") parser.add_argument("--detect-leaks", dest="detect_leaks", action='store_true', help="Run LFortran tests with --detect-leaks") parser.add_argument("-sc", "--separate_compilation", action='store_true', help="Run tests with --separate-compilation") parser.add_argument("-nf16", "--no_fast_till_llvm16", action='store_true', help="Don't run unsupported tests with --fast when LLVM < 17") parser.add_argument("-t", "--test", type=str, help="Run specific tests matching pattern (regex)") parser.add_argument("--ninja", action='store_true', help="Use Ninja build system instead of Make (faster builds)") parser.add_argument("-m", action='store_true', help="Check that all module names are unique") parser.add_argument("-v", "--verbose", action='store_true', help="Show compilation commands (verbose build output)") return parser.parse_args() def main(): args = get_args() if args.m: check_module_names() return # Setup global NO_OF_THREADS, fast_tests, detect_leaks_tests, std_f23_tests, nofast_llvm16, separate_compilation, use_ninja, user_specified_threads, verbose local_lfortran = os.path.join(LFORTRAN_PATH, "lfortran") if os.path.isfile(local_lfortran): os.environ["PATH"] = LFORTRAN_PATH + os.pathsep + os.environ["PATH"] # Set environment variable for testing os.environ["LFORTRAN_TEST_ENV_VAR"] = "STATUS OK!" # delete previously created directories (if any) for backend in SUPPORTED_BACKENDS: run_cmd(f"rm -rf {BASE_DIR}/test-{backend}") if args.no_of_threads: NO_OF_THREADS = args.no_of_threads user_specified_threads = True fast_tests = "yes" if args.fast else "no" detect_leaks_tests = "yes" if args.detect_leaks else "no" nofast_llvm16 = "yes" if args.no_fast_till_llvm16 else "no" separate_compilation = "yes" if args.separate_compilation else "no" use_ninja = args.ninja verbose = args.verbose test_pattern = args.test for backend in args.backends: test_backend(backend, args.std, test_pattern) if __name__ == "__main__": main() lfortran-0.63.0/integration_tests/intrinsics_426.f900000664000175000017500000000223015174404631022462 0ustar alastairalastairprogram intrinsics_426 ! Test count(mask, dim) with variable (non-constant) dim implicit none logical :: mask(3,4) integer :: dim, i, j integer :: res1(4), res2(3) mask = .false. do i = 1, 3 do j = 1, 4 if (mod(i + j, 2) == 0) mask(i, j) = .true. end do end do ! dim=1: count along first dimension for each column dim = 1 res1 = count(mask, dim) if (res1(1) /= 2) error stop if (res1(2) /= 1) error stop if (res1(3) /= 2) error stop if (res1(4) /= 1) error stop ! dim=2: count along second dimension for each row dim = 2 res2 = count(mask, dim) if (res2(1) /= 2) error stop if (res2(2) /= 2) error stop if (res2(3) /= 2) error stop ! Also test with subroutine call (submodule pattern) call test_sub(mask, 1, res1) if (res1(1) /= 2) error stop if (res1(2) /= 1) error stop if (res1(3) /= 2) error stop if (res1(4) /= 1) error stop contains subroutine test_sub(m, d, r) logical, intent(in) :: m(:,:) integer, intent(in) :: d integer, intent(out) :: r(:) r = count(m, d) end subroutine end program lfortran-0.63.0/integration_tests/intrinsics_392.f900000664000175000017500000000116415174404631022471 0ustar alastairalastairmodule bspline_sub_module contains subroutine check_inputs(nx) implicit none integer(4),intent(in),optional :: nx call check(nx) contains subroutine check(n) implicit none integer(4),intent(in),optional :: n print *, present(n) if (present(n) .neqv. .true.) error stop end subroutine check end subroutine check_inputs end module bspline_sub_module program intrinsics_392 use bspline_sub_module implicit none integer(4) :: nx call check_inputs(nx) end program intrinsics_392 lfortran-0.63.0/integration_tests/write_07.f900000664000175000017500000000035315174404631021346 0ustar alastairalastairprogram write_07 implicit none integer :: stat = 1 real :: value = 3.14 character(len=20) :: buffer write(buffer, '(F6.2)', iostat=stat) value print *, buffer, stat if (stat /= 0) error stop end program lfortran-0.63.0/integration_tests/intrinsics_112.f900000664000175000017500000000037715174404631022464 0ustar alastairalastairprogram intrinsics_112 integer :: a, b, result a = 10 b = 7 if ( .not. max0( a1 = a, a2 = b ) == 10 ) error stop if ( .not. max0( a, a2 = b ) == 10 ) error stop if ( .not. max0( a, b ) == 10 ) error stop end program intrinsics_112 lfortran-0.63.0/integration_tests/procedure_09_a.f900000664000175000017500000000062115174404631022504 0ustar alastairalastairmodule procedure_09_module contains subroutine cb(x, a, b, terminate) implicit none real, intent(in) :: x(:) integer, intent(in), optional :: a integer, intent(in), optional :: b logical, intent(out), optional :: terminate if(present(a) .or. present(b) .and. .not. present(terminate)) error stop end subroutine cb end module procedure_09_module lfortran-0.63.0/integration_tests/complex_solutions.f900000664000175000017500000000172515174404631023500 0ustar alastairalastairprogram complex_solutions ! print some complex solutions to the equation: 1**x = rhs. use, intrinsic :: iso_fortran_env, only: wp=>real64 implicit none complex(wp) :: z1, arg, x real(wp), parameter :: rhs = 4.0_wp, twopi = 8 * atan(1.0_wp), lnrhs = log(rhs), tol = 1.0e-12_wp integer :: k character(*), parameter :: cfmth='("Complex solutions to 1**x=",g0.4/a2,*(4x,a11,5x))', & & cfmt='(i2,*(" (",es0.2,",",es0.2,")":))' write(*,cfmth) rhs, 'k', 'arg=i2Pik', 'exp(arg)', 'x', 'exp(arg)**x', 'exp(arg*x)' do k = 1, 10 arg = cmplx(0.0_wp, twopi * k, kind=wp) z1 = exp(arg) x = cmplx(0.0_wp, -lnrhs/(twopi*k), kind=wp) ! Check for correctness: if (abs(real(exp(arg*x)) - rhs) > tol .or. abs(aimag(exp(arg*x))) > tol) then print *, "Integration test failed for k=", k error stop 1 end if write(*,cfmt) k, arg, z1, x, z1**x, exp(arg*x) end do end program complex_solutions lfortran-0.63.0/integration_tests/pdt_08.f900000664000175000017500000000063115174404631021003 0ustar alastairalastairmodule pdt_08_m implicit none integer, parameter :: wp = kind(1.) type t(k) integer, kind :: k = wp real(k) :: val end type interface module subroutine sub(x) class(t), intent(in) :: x end subroutine end interface end module program pdt_08 use pdt_08_m implicit none type(t) :: x x%val = 3.14 if (abs(x%val - 3.14) > 1e-5) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/class_24.f900000664000175000017500000000117015174404631021316 0ustar alastairalastairmodule class_24_m implicit none type base integer :: m = 1 end type type, extends(base) :: derived integer :: n = 2 end type contains subroutine test(self) class(base) :: self select type(self) type is (derived) if (self%m /= 10) error stop if (self%n /= 20) error stop end select end subroutine end module program class_24 use class_24_m implicit none class(base), allocatable :: b allocate(derived :: b) b = derived(10, 20) call test(b) end program lfortran-0.63.0/integration_tests/common_11.f900000664000175000017500000000031415174404631021474 0ustar alastairalastairsubroutine sub1() double precision el common /dvod01/ el(13) end subroutine sub2() double precision el common /dvod01/ el(13) end program common_11 call sub1() call sub2() end program lfortran-0.63.0/integration_tests/gpu_metal_15.f900000664000175000017500000000064015174404631022167 0ustar alastairalastairprogram gpu_metal_15 ! Element-wise power and exponentiation implicit none integer, parameter :: n = 10000 real :: x(n), y(n), y_expected(n) integer :: i do i = 1, n x(i) = real(i) * 0.001 y_expected(i) = x(i) ** 2 + exp(-x(i)) end do do concurrent (i = 1:n) y(i) = x(i) ** 2 + exp(-x(i)) end do do i = 1, n if (abs(y(i) - y_expected(i)) > 1.0e-4) error stop end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/file_38.f900000664000175000017500000000123515174404631021137 0ustar alastairalastairprogram file_38 ! MRE: action='read' should not allow writes implicit none integer :: u, ios ! Create test file open(newunit=u, file="file_38.dat", status="replace") write(u, *) "original" close(u) ! Open with action='read' and status='old' open(newunit=u, file="file_38.dat", action='read', status='old') ! Try to write - this MUST fail with action='read' write(u, *, iostat=ios) "overwritten" close(u) if (ios == 0) error stop "BUG: write succeeded with action=read" if (ios < 0) error stop "BUG: expected positive iostat for error (not EOF)" print *, "PASSED: write blocked with ios=", ios end program lfortran-0.63.0/integration_tests/attr_dim_04.f900000664000175000017500000000020215174404631022005 0ustar alastairalastairsubroutine asr_vpe () dimension ca(136) character(1) ca end subroutine program attr_dim_04 call asr_vpe() end programlfortran-0.63.0/integration_tests/intrinsics_395.f900000664000175000017500000000034215174404631022471 0ustar alastairalastairprogram intrinsics_395 implicit none complex(8) :: a a = cmplx(cmplx(1, 2), kind=8) if (abs(real(a, kind=8) - 1.0_8) > 1.0e-9_8) error stop if (abs(aimag(a) - 2.0_8) > 1.0e-9_8) error stop end program intrinsics_395 lfortran-0.63.0/integration_tests/equivalence_04.f900000664000175000017500000000141115174404631022506 0ustar alastairalastairprogram equivalence_04 use iso_c_binding, only: c_loc, c_f_pointer implicit none DOUBLE PRECISION, target :: DMACH(5) INTEGER*4, pointer :: SMALL(:) INTEGER*4, pointer :: LARGE(:) INTEGER*4, pointer :: RIGHT(:) INTEGER*4, pointer :: DIVER(:) INTEGER*4, pointer :: LOG10(:) call c_f_pointer(c_loc(dmach(1)), small, [2]) call c_f_pointer(c_loc(dmach(2)), large, [2]) call c_f_pointer(c_loc(dmach(3)), right, [2]) call c_f_pointer(c_loc(dmach(4)), diver, [2]) call c_f_pointer(c_loc(dmach(5)), log10, [2]) dmach(2) = 5.6_8 if(large(1) /= 1717986918) error stop if(large(2) /= 1075209830) error stop dmach(2) = 5.7_8 if(large(1) /= -858993459) error stop if(large(2) /= 1075236044) error stop end program lfortran-0.63.0/integration_tests/intrinsics_327.f900000664000175000017500000000127315174404631022470 0ustar alastairalastairprogram intrinsics_327 real :: A(2,3) = reshape([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], [2, 3]) real, allocatable :: B(:, :) allocate(B(3, 2)) call wrapper_transpose(A, B) print *, B(1, 1) if (B(1, 1) /= 1.0) error stop print *, B(1, 2) if (B(1, 2) /= 2.0) error stop print *, B(2, 1) if (B(2, 1) /= 3.0) error stop print *, B(2, 2) if (B(2, 2) /= 4.0) error stop print *, B(3, 1) if (B(3, 1) /= 5.0) error stop print *, B(3, 2) if (B(3, 2) /= 6.0) error stop contains subroutine wrapper_transpose(M, N) real, intent(in) :: M(:, :) real, intent(out) :: N(:, :) N = transpose(M) end subroutine end program lfortran-0.63.0/integration_tests/nullify_05.f900000664000175000017500000000121615174404631021673 0ustar alastairalastairmodule nullify_05_type contains subroutine OBJ() end subroutine end module module nullify_05_mod use nullify_05_type type PROB_T procedure(OBJ), nopass, pointer :: calfun_struct => null() end type PROB_T procedure(OBJ), pointer :: calfun_ext end module program nullify_05 use nullify_05_mod use nullify_05_type procedure(OBJ), pointer :: calfun type(PROB_T) :: calfun_2 calfun_2 % calfun_struct => OBJ nullify(calfun_2 % calfun_struct) calfun => OBJ nullify(calfun) calfun_ext => OBJ nullify(calfun_ext) if (associated(calfun)) error stop if (associated(calfun_ext)) error stop end program lfortran-0.63.0/integration_tests/procedure_44.f900000664000175000017500000000045515174404631022210 0ustar alastairalastairprogram procedure_44 implicit none abstract interface real function f(x) real, value :: x end function end interface procedure(f), pointer :: fptr call test() if (associated(fptr)) error stop contains subroutine test() fptr => null() end subroutine end program lfortran-0.63.0/integration_tests/gpu_metal_47.f900000664000175000017500000000156115174404631022177 0ustar alastairalastairmodule m47 ! Test: VLA with array broadcast inside block in do concurrent. ! The VLA dimension depends on an intrinsic (maxval) applied to ! a subroutine argument, and the body uses whole-array assignment ! (a = 0.) which becomes an ArrayBroadcast. This exercises the ! gpu_offload pass ordering: VLA dimension pre-computation must ! happen before body Var remapping so that the host-side call ! argument captures the original (caller-scope) references. implicit none contains subroutine learn(n) integer, intent(in) :: n(:) integer :: pair do concurrent (pair = 1:2) block real :: a(maxval(n)) a = 0. end block end do end subroutine end module m47 program gpu_metal_47 use m47 implicit none integer :: nodes(2) nodes = [2, 3] call learn(nodes) print *, "ok" end program gpu_metal_47 lfortran-0.63.0/integration_tests/data_15.f900000664000175000017500000000534615174404631021133 0ustar alastairalastairprogram data_15 implicit none real ABC(2,3,4,5) real :: sum_ABC real, parameter :: expected_sum_ABC = 345.6 ! Initialize 4D array ABC (2x3x4x5 = 120 elements) data ABC/ & 1.11, 1.12, 1.13, 1.14, 1.15, 1.21, 1.22, 1.23, 1.24, 1.25, 1.31, 1.32, 1.33, 1.34, 1.35, & 1.41, 1.42, 1.43, 1.44, 1.45, 1.51, 1.52, 1.53, 1.54, 1.55, 1.61, 1.62, 1.63, 1.64, 1.65, & 2.11, 2.12, 2.13, 2.14, 2.15, 2.21, 2.22, 2.23, 2.24, 2.25, 2.31, 2.32, 2.33, 2.34, 2.35, & 2.41, 2.42, 2.43, 2.44, 2.45, 2.51, 2.52, 2.53, 2.54, 2.55, 2.61, 2.62, 2.63, 2.64, 2.65, & 3.11, 3.12, 3.13, 3.14, 3.15, 3.21, 3.22, 3.23, 3.24, 3.25, 3.31, 3.32, 3.33, 3.34, 3.35, & 3.41, 3.42, 3.43, 3.44, 3.45, 3.51, 3.52, 3.53, 3.54, 3.55, 3.61, 3.62, 3.63, 3.64, 3.65, & 4.11, 4.12, 4.13, 4.14, 4.15, 4.21, 4.22, 4.23, 4.24, 4.25, 4.31, 4.32, 4.33, 4.34, 4.35, & 4.41, 4.42, 4.43, 4.44, 4.45, 4.51, 4.52, 4.53, 4.54, 4.55, 4.61, 4.62, 4.63, 4.64, 4.65 / print *, "4D array ABC elements:" print *, "ABC(1,1,1,1) =", ABC(1,1,1,1) print *, "ABC(2,3,4,5) =", ABC(2,3,4,5) print *, "ABC(1,2,3,4) =", ABC(1,2,3,4) print *, "ABC(2,1,3,2) =", ABC(2,1,3,2) print *, "ABC(1,3,2,5) =", ABC(1,3,2,5) print *, "ABC(2,2,2,2) =", ABC(2,2,2,2) print *, "ABC(1,3,4,1) =", ABC(1,3,4,1) print *, "ABC(2,3,1,5) =", ABC(2,3,1,5) ! Verify ABC values if (abs(ABC(1,1,1,1) - 1.11) > 1.0e-5) error stop "ABC(1,1,1,1) value is incorrect" if (abs(ABC(2,3,4,5) - 4.65) > 1.0e-5) error stop "ABC(2,3,4,5) value is incorrect" if (abs(ABC(1,2,3,4) - 3.62) > 1.0e-5) error stop "ABC(1,2,3,4) value is incorrect" if (abs(ABC(2,1,3,2) - 2.23) > 1.0e-5) error stop "ABC(2,1,3,2) value is incorrect" if (abs(ABC(1,3,2,5) - 4.42) > 1.0e-5) error stop "ABC(1,3,2,5) value is incorrect" if (abs(ABC(2,2,2,2) - 2.14) > 1.0e-5) error stop "ABC(2,2,2,2) value is incorrect" if (abs(ABC(1,3,4,1) - 1.53) > 1.0e-5) error stop "ABC(1,3,4,1) value is incorrect" if (abs(ABC(2,3,1,5) - 4.32) > 1.0e-5) error stop "ABC(2,3,1,5) value is incorrect" ! Check last few elements print *, "Last few ABC elements:" print *, "ABC(2,3,4,3) =", ABC(2,3,4,3) print *, "ABC(2,3,4,4) =", ABC(2,3,4,4) print *, "ABC(2,3,4,5) =", ABC(2,3,4,5) if (abs(ABC(2,3,4,3) - 3.32) > 1.0e-5) error stop "ABC(2,3,4,3) value is incorrect" if (abs(ABC(2,3,4,4) - 4.21) > 1.0e-5) error stop "ABC(2,3,4,4) value is incorrect" if (abs(ABC(2,3,4,5) - 4.65) > 1.0e-5) error stop "ABC(2,3,4,5) value is incorrect" print *, "Calculating sum..." ! Use intrinsic sum function to calculate the sums sum_ABC = sum(ABC) print *, "Sum of all ABC elements:", sum_ABC ! Verify sums if (abs(sum_ABC - expected_sum_ABC) > 1.0e-5) then print *, "Expected ABC sum:", expected_sum_ABC, "Actual:", sum_ABC error stop "Sum of ABC array is incorrect" end if print *, "Ok!" end program lfortran-0.63.0/integration_tests/class_40.f900000664000175000017500000000313115174404631021313 0ustar alastairalastairmodule class_40_mod type :: AbsNestedType contains procedure :: abs_nested_method end type AbsNestedType type, public :: AbsType class(AbsNestedType), allocatable :: nested_obj contains procedure :: abs_method end type AbsType type :: Wrapper class(AbsType), allocatable :: obj type(AbsType) :: t_obj end type Wrapper type :: Client type(Wrapper) :: wrapped contains procedure :: caller end type Client contains subroutine caller(self) class(Client), intent(in) :: self type(Client) :: type_s integer :: i i = self%wrapped%obj%abs_method(42) if (i /= 1) error stop i = 0 i = self%wrapped%obj%nested_obj%abs_nested_method(101) if (i /= 1) error stop i = 0 i = type_s%wrapped%t_obj%abs_method(42) if (i /= 1) error stop end subroutine caller integer function abs_method(self, val) class(AbsType), intent(in) :: self integer, intent(in) :: val print *, "abs_method called" if (val /= 42) error stop abs_method = 1 end function abs_method integer function abs_nested_method(self, val) class(AbsNestedType), intent(in) :: self integer, intent(in) :: val print *, "abs_nested_method called" if (val /= 101) error stop abs_nested_method = 1 end function abs_nested_method end module class_40_mod program class_40 use class_40_mod class(Client), allocatable :: var allocate(var) allocate(var%wrapped%obj) allocate(var%wrapped%obj%nested_obj) call var%caller() end program class_40lfortran-0.63.0/integration_tests/separate_compilation_20a.f900000664000175000017500000000031215174404631024545 0ustar alastairalastairmodule stdlib_error_separate_compilation_20 implicit none interface module subroutine error_stop(code) integer, intent(inout) :: code end subroutine error_stop end interface end modulelfortran-0.63.0/integration_tests/intrinsics_144.f900000664000175000017500000000134515174404631022465 0ustar alastairalastairprogram intrinsics_144 logical :: a(3), b(3) logical :: res a = .true. b = .false. res = dot_product(a, b) print *, res if (res) error stop res = dot_product([.true., .true., .true.], [.false., .false., .false.]) print *, res if (res) error stop res = dot_product([.true., .true., .true.], [.true., .true., .true.]) print *, res if (.not. res) error stop b = .true. res = dot_product(a, b) print *, res if (.not. res) error stop res = dot_product([.false., .false., .false.], [.false., .false., .false.]) print *, res if (res) error stop a = .false. b = .false. res = dot_product(a, b) print *, res if (res) error stop end program lfortran-0.63.0/integration_tests/derived_types_51.f900000664000175000017500000000165115174404631023063 0ustar alastairalastairmodule bit_type_51 implicit none type, abstract :: bitset_type integer :: flag contains procedure(from_string_abstract), deferred, pass(self) :: from_string end type bitset_type type, extends(bitset_type) :: bitset_large contains procedure, pass(self) :: from_string => from_string_large end type bitset_large abstract interface subroutine from_string_abstract(self) import :: bitset_type class(bitset_type), intent(out) :: self end subroutine from_string_abstract end interface contains subroutine from_string_large(self) class(bitset_large), intent(out) :: self if (self%flag /= 1) error stop end subroutine from_string_large end module program derived_types_51 use bit_type_51 implicit none type(bitset_large) :: b b%flag = 1 call b%from_string() end program derived_types_51 lfortran-0.63.0/integration_tests/class_21.f900000664000175000017500000000200715174404631021313 0ustar alastairalastairmodule class_21_mod type :: val_type integer :: origin = 3 end type end module program class_21 use class_21_mod integer :: stat class(val_type), allocatable :: val class(val_type), pointer :: val2 logical :: temp = .false. type(val_type), parameter :: val_par = val_type() type(val_type) :: tmp allocate(val) stat = merge(val%origin, stat, .true.) tmp = val_type(merge(val%origin - 1, stat, any([stat, val%origin] /= 0))) if (stat /= 3) error stop stat = merge(val_par%origin, stat - 1, temp) if (stat /= 2) error stop if (tmp%origin /= 2) error stop call sub1() call sub3(val2) if (val2%origin /= 2) error stop deallocate(val2) contains subroutine sub1() call sub2(val_par%origin) end subroutine subroutine sub2(x) integer :: x if (x /= 3) error stop end subroutine subroutine sub3(x) class(val_type), pointer :: x allocate(x) x%origin = 2 end subroutine end program lfortran-0.63.0/integration_tests/allocatable_cchar_01.f900000664000175000017500000000076115174404631023614 0ustar alastairalastairprogram allocatable_cchar_01 use, intrinsic :: iso_c_binding, only: c_char implicit none character(kind=c_char, len=:), allocatable :: msg call hello(msg) if (msg /= "Hello from Fortran") error stop print *, msg contains subroutine hello(msg) bind(c) use, intrinsic :: iso_c_binding, only: c_char character(kind=c_char, len=:), allocatable, intent(out) :: msg msg = "Hello from Fortran" end subroutine hello end program allocatable_cchar_01 lfortran-0.63.0/integration_tests/openmp_20.f900000664000175000017500000000110115174404631021475 0ustar alastairalastairsubroutine initialise_array(n) integer, intent(in) :: n real, dimension(n) :: b integer :: i !$omp parallel shared(b) private(i) !$omp do do i = 1, n b(i) = 12.91 end do !$omp end do !$omp end parallel print *, b(1), b(n) print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end subroutine program openmp_20 use omp_lib integer, parameter :: n = 100000 call omp_set_num_threads(4) call initialise_array(n) end program lfortran-0.63.0/integration_tests/associate_14.f900000664000175000017500000000035615174404631022170 0ustar alastairalastairprogram associate_14 character(:), allocatable , target:: char_physically_descriptor character(:), pointer :: char_ptr char_physically_descriptor = "hello" char_ptr => char_physically_descriptor end program associate_14lfortran-0.63.0/integration_tests/inquire_12.f900000664000175000017500000000321015174404631021657 0ustar alastairalastairprogram inquire_12 implicit none integer :: u, ios character(len=256) :: stream_val, msg, access_mode character(len=256) :: filename filename = "test_stream_iomsg.dat" print *, "==== STREAM + IOMSG TESTS ====" ! Case 1: STREAM open(newunit=u, file=filename, status="replace", access="stream", iostat=ios) write(u) 42 msg = "" inquire(unit=u, stream=stream_val, iomsg=msg, iostat=ios) if (trim(stream_val) /= "YES") error stop close(u) ! Case 2: SEQUENTIAL open(newunit=u, file=filename, status="old", access="sequential", iostat=ios) msg = "" inquire(unit=u, stream=stream_val, iomsg=msg, iostat=ios) if (trim(stream_val) /= "NO") error stop close(u) ! Case 3: unopened msg = "" inquire(unit=999, stream=stream_val, iomsg=msg, iostat=ios) ! Case 4: FILE msg = "" inquire(file=filename, stream=stream_val, iomsg=msg, iostat=ios) ! Case 6: ACCESS open(newunit=u, file=filename, status="old", access="stream", iostat=ios) msg = "" inquire(unit=u, access=access_mode, stream=stream_val, iomsg=msg) if (trim(access_mode) /= "STREAM") error stop close(u) ! ------------------------------- ! Case 7: IOMSG behavior ! ------------------------------- msg = "RANDOM_GARBAGE" ios = -999 inquire(file=filename, iomsg=msg, iostat=ios) print *, "[CASE 7] IOMSG behavior" print *, " ios =", ios print *, " iomsg =", trim(msg) ! Only check iomsg if error occurred if (ios /= 0) then if (len_trim(msg) == 0) then print *, "FAIL: iomsg should contain message on error" error stop end if end if end program inquire_12 lfortran-0.63.0/integration_tests/file_open_07.f900000664000175000017500000000044415174404631022155 0ustar alastairalastairprogram file_open_07 integer :: u, ios character(len=*), parameter :: filename = "file_open_07_err.txt" open(newunit=u, file=filename, status="old", iostat=ios, err=100) print *, "opened" close(u) error stop 1 100 continue if (ios == 0) error stop 2 end program lfortran-0.63.0/integration_tests/submodule_08.f900000664000175000017500000000044715174404631022220 0ustar alastairalastairmodule Module_08 interface module subroutine hi() end subroutine end interface end module Module_08 submodule(Module_08) Submodule_8 contains module subroutine hi() print *, "Hello world" end subroutine hi end submodule Submodule_8 program main use Module_08 end program lfortran-0.63.0/integration_tests/openmp_58.f900000664000175000017500000000100715174404631021515 0ustar alastairalastairprogram openmp_58 use omp_lib implicit none integer, parameter :: N = 5 integer :: A(N) integer :: i, index,total A = 1 total=0 index=1 !$omp parallel !$omp single !$omp taskloop shared(A) do i = 1, N !$omp critical total = total + A(index) * 2 index=index+1 !$omp end critical end do !$omp end taskloop !$omp end single !$omp taskwait !$omp end parallel print *, "Total = ", total, index if(total/=10) error stop end program openmp_58 lfortran-0.63.0/integration_tests/bindc_iso_fb_08c.c0000664000175000017500000000014315174404631022601 0ustar alastairalastair#include void c_set_42(CFI_cdesc_t *a) { *(int *)a->base_addr = 42; } lfortran-0.63.0/integration_tests/gpu_metal_178.f900000664000175000017500000000133415174404631022262 0ustar alastairalastair! Test: present() check on optional allocatable arg inside do concurrent ! must not segfault when the optional argument is absent (GPU Metal). program gpu_metal_178 implicit none real, allocatable :: y(:) call sub(4) call sub(4, y) if (size(y) /= 4) error stop if (abs(y(1) - 1.0) > 1.0e-6) error stop if (abs(y(2) - 2.0) > 1.0e-6) error stop if (abs(y(3) - 3.0) > 1.0e-6) error stop if (abs(y(4) - 4.0) > 1.0e-6) error stop print *, "PASS" contains subroutine sub(n, y) integer, intent(in) :: n real, allocatable, intent(out), optional :: y(:) integer :: i if (present(y)) allocate(y(n)) do concurrent (i = 1:n) if (present(y)) y(i) = real(i) end do end subroutine end program lfortran-0.63.0/integration_tests/procedure_pointer_abstract_02.f900000664000175000017500000000172615174404631025627 0ustar alastairalastairprogram procedure_pointer_abstract_02 use iso_fortran_env, only: real32 implicit none abstract interface pure function compute_func(x, y) result(output) import :: real32 real(real32), intent(in) :: x(:,:), y(:,:) real(real32), dimension(size(x,2)) :: output end function end interface procedure(compute_func), pointer :: my_func => null() real(real32) :: a(3, 4), b(3, 4), res(4) integer :: i a = 1.0_real32 b = 2.0_real32 my_func => my_compute res = my_func(a, b) do i = 1, 4 if (abs(res(i) - 6.0_real32) > 1.0e-6_real32) error stop end do print *, "PASS" contains pure function my_compute(x, y) result(output) real(real32), intent(in) :: x(:,:), y(:,:) real(real32), dimension(size(x,2)) :: output integer :: j do j = 1, size(x, 2) output(j) = sum(x(:,j) * y(:,j)) end do end function end program lfortran-0.63.0/integration_tests/gpu_metal_35.f900000664000175000017500000000071315174404631022172 0ustar alastairalastairprogram gpu_metal_35 ! Test: fixed-size array in block inside do concurrent with GPU offloading implicit none integer :: i, x(5) x = 0 do concurrent (i = 1:5) block integer :: a(3) a(1) = i a(2) = i * 2 a(3) = a(1) + a(2) x(i) = a(3) end block end do if (x(1) /= 3) error stop if (x(2) /= 6) error stop if (x(3) /= 9) error stop if (x(4) /= 12) error stop if (x(5) /= 15) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/intrinsics_151.f900000664000175000017500000000476115174404631022470 0ustar alastairalastairprogram intrinsics_151 integer :: a,b integer(8) :: c, d integer(8) :: result integer :: i integer(4) :: arg_x(5) = [12, 11, 18, 20, 30] integer(8) :: arg_x2(5) = [33, 48, 58, 55, 54] integer(4) :: res_x(5) integer(8) :: res_x2(5) integer(4), parameter :: res(5) = maskl([12, 11, 18, 20, 30]) integer(8), parameter :: res2(5) = maskl([33, 48, 58, 55, 54],8) integer(4) :: expected_res(5) = [-1048576, -2097152, -16384, -4096, -4] integer(8) :: expected_res2(5) = [-2147483648_8, -65536_8, -64_8, & -512_8, -1024_8] integer(4), parameter :: comp1 = maskl(12) integer(8), parameter :: comp2 = maskl(43, 8) print *, comp1 if (comp1 /= -1048576) error stop print *, comp2 if (comp2 /= -2097152_8) error stop res_x = maskl(arg_x) res_x2 = maskl(arg_x2, 8) do i = 1, size(res) print *, res(i) if (res(i) /= expected_res(i)) error stop end do do i = 1, size(res2) print *, res2(i) if (res2(i) /= expected_res2(i)) error stop end do do i = 1, size(res_x) print *, res_x(i) if (res_x(i) /= expected_res(i)) error stop end do do i = 1, size(res_x2) print *, res_x2(i) if (res_x2(i) /= expected_res2(i)) error stop end do a = 10 b = 31 c = 63 d = 54 result = maskl(10, 8) print *, result if (result /= -18014398509481984_8) error stop result = maskl(31, 8) print *, result if (result /= -8589934592_8) error stop result = maskl(63, 8) print *, result if (result /= -2) error stop result = maskl(54, 8) print *, result if (result /= -1024) error stop result = maskl(a, 8) print *, result if (result /= -18014398509481984_8) error stop result = maskl(b, 8) print *, result if (result /= -8589934592_8) error stop result = maskl(c) print *, result if (result /= -2) error stop result = maskl(d) print *, result if (result /= -1024) error stop result = maskl(10,8) print *, kind(result) if (kind(result) /= 8) error stop print*, maskl(55, kind = kind(0.0d0)) if (maskl(55, kind = kind(0.0d0)) /= -512) error stop print *, kind(maskl(10,8)) if (kind(maskl(10,8)) /= 8) error stop print *, kind(maskl(10)) if (kind(maskl(10)) /= 4) error stop print *, kind(maskl(a,4)) if (kind(maskl(a,4)) /= 4) error stop print *, kind(maskl(a,8)) if (kind(maskl(a,8)) /= 8) error stop end program lfortran-0.63.0/integration_tests/arrays_102.f900000664000175000017500000000100015174404631021557 0ustar alastairalastairprogram arrays_102 implicit none type :: string_t character(len=:), allocatable :: s end type string_t type(string_t), allocatable :: build_dirs(:) type(string_t) :: temp temp%s = "build" allocate(build_dirs(0)) associate(xx => temp) build_dirs = [build_dirs, temp] end associate if (size(build_dirs) /= 1) error stop "Wrong size" if (build_dirs(1)%s /= "build") error stop "Wrong value" print *, "OK:", build_dirs(1)%s end program arrays_102 lfortran-0.63.0/integration_tests/print_04.f900000664000175000017500000000051215174404631021342 0ustar alastairalastairprogram print_04 implicit none integer :: x character(len=5) :: f = "(5i3)" x = (2+3)*5 print "(5i3)", x, 1, 3, x, (2+3)*5+x write(*,"(5i3)") x, 1, 3, x, (2+3)*5+x print f, x, 1, 3, x, (2+3)*5+x write(*,f) x, 1, 3, x, (2+3)*5+x print 1000, x, 1, 3, x, (2+3)*5+x write(*,1000) x, 1, 3, x, (2+3)*5+x 1000 format(5i3) end program lfortran-0.63.0/integration_tests/read_06.f900000664000175000017500000000065315174404631021131 0ustar alastairalastairprogram read_06 implicit none call check_value("10", 10) call check_value("3 7", 3) contains subroutine check_value(src, expected) character(len=*), intent(in) :: src integer, intent(in) :: expected integer :: value, ios read(src, *, iostat=ios) value if (ios /= 0) error stop if (value /= expected) error stop end subroutine check_value end program read_06 lfortran-0.63.0/integration_tests/separate_compilation_19b.f900000664000175000017500000000056115174404631024564 0ustar alastairalastairsubmodule(mod_separate_compilation_19) submod_separate_compilation_19 implicit none contains module subroutine map_open_entry(map, key) class(open_hashmap_type), intent(inout) :: map integer, intent(inout) :: key integer, parameter :: i = 5 key = i end subroutine map_open_entry end submodule submod_separate_compilation_19lfortran-0.63.0/integration_tests/file_30.f900000664000175000017500000000117615174404631021133 0ustar alastairalastairsubroutine file_write(iu, i) integer :: i, iu(5) WRITE(IU(I), *) 'xyzzy' end subroutine program file_30 implicit none integer :: iu(5), ios character(len=10) :: line character(len=25) :: fname fname = 'temp_output_file_30.txt' iu(3) = 20 open(unit=iu(3), file=fname, status='replace', action='write') call file_write(iu, 3) close(iu(3)) open(unit=99, file=fname, status='old', action='read', iostat=ios) read(99, '(A)', iostat=ios) line close(99) print *, trim(line) if (trim(adjustl(line)) /= 'xyzzy') error stop open(unit=97, file=fname, status='old') close(97, status='delete') end program lfortran-0.63.0/integration_tests/polymorphic_select_type_01.f900000664000175000017500000000063015174404631025151 0ustar alastairalastairprogram main type :: type_a integer :: a end type type_a class(type_a), allocatable :: x character(100) :: ss allocate(x) x%a = 10 select type(x) type is (type_a) print *, x write(ss, "(i0)") x if (trim(ss) /= "10") error stop "FAILED: wrong value from write" class default error stop "FAILED: wrong type" end select end programlfortran-0.63.0/integration_tests/gpu_metal_176.f900000664000175000017500000000216515174404631022263 0ustar alastairalastair! Test: generic type-bound function returning allocatable array ! inside do concurrent offloaded to Metal GPU. ! Ensures VLA temporaries from subroutine_from_function pass ! are backed by device buffers instead of stack VLAs. module gpu_metal_176_m implicit none type :: tensor_t real, allocatable :: values_(:) contains generic :: values => get_values procedure, private :: get_values end type contains pure function get_values(self) result(v) class(tensor_t), intent(in) :: self real, allocatable :: v(:) allocate(v(size(self%values_))) v = self%values_ end function end module program gpu_metal_176 use gpu_metal_176_m implicit none integer :: i, n, mbs type(tensor_t) :: arr(2) real :: cost(2) n = 3 mbs = 2 do i = 1, mbs allocate(arr(i)%values_(n)) arr(i)%values_ = real(i) end do cost = 0.0 do concurrent (i = 1:mbs) block real :: a(n) a = arr(i)%values() cost(i) = sum(a**2) end block end do print *, cost(1) print *, cost(2) if (abs(cost(1) - 3.0) > 1.0e-6) error stop if (abs(cost(2) - 12.0) > 1.0e-6) error stop end program lfortran-0.63.0/integration_tests/save_07.f900000664000175000017500000000116215174404631021151 0ustar alastairalastairsubroutine sub(i) real :: x(5) integer :: i, itr save if (i == 1) then x = 3.49213401 x(4) = -2134.1 else if (i == 2) then print *, x do itr = 1, 5 if (itr == 4) then if (abs(x(itr) + 2134.1) > 1e-6) error stop else if (abs(x(itr) - 3.49213401) > 1e-6) error stop end if end do x(3) = -991.324 else do itr = 1, 5 if (itr == 3) then if (abs(x(itr) + 991.324) > 1e-6) error stop else if (itr == 4) then if (abs(x(itr) + 2134.1) > 1e-6) error stop else if (abs(x(itr) - 3.49213401) > 1e-6) error stop end if end do print *, x end if end subroutine program save_07 call sub(1) call sub(2) call sub(3) end program lfortran-0.63.0/integration_tests/intrinsics_228.f900000664000175000017500000000146715174404631022475 0ustar alastairalastairprogram intrinsics_228 use, intrinsic :: iso_fortran_env, only: dp => real64 real(dp) :: x, y, z x = 6.738377383_dp y = 3.1473863781_dp z = 7389.83936383_dp print *, derf(x) if (abs(derf(x) - 1.00000000000000000e+00_dp) > 1e-12) error stop print *, derf(y) if (abs(derf(y) - 9.99991455910536065e-01_dp) > 1e-12) error stop print *, derf(z) if (abs(derf(z) - 1.00000000000000000e+00_dp) > 1e-12) error stop x = -6.738377383_dp y = -3.1473863781_dp z = -7389.83936383_dp print *, derf(x) if (abs(derf(x) - (-1.00000000000000000e+00_dp)) > 1e-12) error stop print *, derf(y) if (abs(derf(y) - (-9.99991455910536065e-01_dp)) > 1e-12) error stop print *, derf(z) if (abs(derf(z) - (-1.00000000000000000e+00_dp)) > 1e-12) error stop end programlfortran-0.63.0/integration_tests/common_substring_01.f900000664000175000017500000000130115174404631023570 0ustar alastairalastair! Reproducer: COMMON block CHARACTER substring must use COMMON struct member ! (reduced from LAPACK TESTING/LIN/xerbla.f) program common_substring_01 implicit none character(len=32) :: srnamt integer :: nout common /srname/ srnamt common /iounit/ nout nout = 6 srnamt = "XERBLA" call sub_use() print *, "PASS: common_substring_01" end program subroutine sub_use() implicit none character(len=32) :: srnamt integer :: nout common /srname/ srnamt common /iounit/ nout ! Substring read triggers StringSection on COMMON-backed character if (srnamt(1:1) /= "X") error stop "substring mismatch" write(nout, *) srnamt(1:6) end subroutine lfortran-0.63.0/integration_tests/derived_types_97_mod2.f900000664000175000017500000000054015174404631024012 0ustar alastairalastairmodule derived_types_97_mod2 use derived_types_97_mod1 implicit none contains subroutine create_point(p) type(point_t), intent(out) :: p ! This uses keyword arguments with a type that has a generic interface p = point_t(x = 10, y = 20) end subroutine create_point end module derived_types_97_mod2 lfortran-0.63.0/integration_tests/bindc_10.f900000664000175000017500000000067115174404631021270 0ustar alastairalastairprogram bind_10 use iso_c_binding, only: c_char implicit none character(len=1) :: result(2) integer :: n n = getcwd(result) if (n >= 0) then print *, "Test passed" else print *, "Test passed (negative result)" end if contains function getcwd(buf) result(n) bind(c, name="getcwd") character(kind=c_char,len=1), dimension(:), intent(out) :: buf integer :: n end function getcwd end program bind_10 lfortran-0.63.0/integration_tests/case_07.f900000664000175000017500000000175715174404631021140 0ustar alastairalastairprogram case_07 implicit none if (test_case('a') /= "a:j") error stop if (test_case('d') /= "a:j") error stop if (test_case('l') /= "l:p") error stop if (test_case('p') /= "l:p") error stop if (test_case('z') /= "z") error stop if (test_case('k') /= "not found") error stop if (test_case('r') /= "not found") error stop contains function test_case(c) result(res) character(len=1), intent(in) :: c character(len=10) :: res select case (c) case ('a' : 'j') res = "a:j" print *, 'one of the first ten letters' case ('l' : 'p') res = "l:p" print *, 'one of l, m, n, o, p' case ('z') res = "z" print *, 'one of z' case default res = "not found" print *, 'other characters, which may not be letters' end select end function test_case end program case_07 lfortran-0.63.0/integration_tests/select_rank_25.f900000664000175000017500000000075115174404631022510 0ustar alastairalastairmodule select_rank_25_mod implicit none contains subroutine foo(input) class(*), dimension(..), intent(in) :: input select rank(input) rank(2) select type(input) class default if (size(input) /= 12) error stop end select end select end subroutine end module program select_rank_25 use select_rank_25_mod real :: arr(3, 4) arr = 1.0 call foo(arr) print *, "ok" end program lfortran-0.63.0/integration_tests/nested_11.f900000664000175000017500000000075615174404631021500 0ustar alastairalastairmodule base implicit none integer, public :: a = 10 end module module intermediate use base, only: a implicit none private end module program nested_11 use base implicit none interface subroutine sub2 use intermediate implicit none end subroutine sub2 end interface call sub contains subroutine sub use intermediate implicit none print *, a if( a /= 10 ) error stop end subroutine end program lfortran-0.63.0/integration_tests/select_type_49.f900000664000175000017500000000201115174404631022533 0ustar alastairalastairmodule select_type_49_mod use iso_fortran_env, only: real32 implicit none abstract interface pure function acc_func(predicted, expected) result(output) import real32 real(real32), dimension(:,:), intent(in) :: predicted, expected real(real32), dimension(size(predicted,2)) :: output end function acc_func end interface type :: my_type procedure(acc_func), nopass, pointer :: get_accuracy => null() end type contains function eval_accuracy(this, output) result(accuracy) class(my_type), intent(in) :: this class(*), dimension(:,:), intent(in) :: output real(real32) :: accuracy real(real32) :: pred(2,3) pred = 1.0 accuracy = 0.0 select type(output) type is(real(real32)) accuracy = sum(this%get_accuracy(pred, output(:,1:3:1))) end select end function end module program select_type_49 use select_type_49_mod implicit none print *, "PASS" end program select_type_49lfortran-0.63.0/integration_tests/modules_68.f900000664000175000017500000000110215174404631021664 0ustar alastairalastairmodule modules_68_mod implicit none private type, public :: mytype integer :: val end type public :: reverse interface reverse module procedure :: reverse_mytype end interface contains elemental function reverse_mytype(x) result(r) type(mytype), intent(in) :: x type(mytype) :: r r%val = -x%val end function end module program modules_68 use modules_68_mod implicit none type(mytype) :: x, reverse_mytype x = mytype(42) reverse_mytype = reverse(x) if (reverse_mytype%val /= -42) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/openmp_18.f900000664000175000017500000001633415174404631021522 0ustar alastairalastairprogram openmp_18 !*****************************************************************************80 ! !! MAIN is the main program for COMPUTE_PI. ! ! Discussion: ! ! COMPUTE_PI estimates the value of PI. ! ! This program uses Open MP parallelization directives. ! ! It should run properly whether parallelization is used or not. ! ! However, the parallel version computes the sum in a different ! order than the serial version; some of the quantities added are ! quite small, and so this will affect the accuracy of the results. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 18 April 2009 ! ! Author: ! ! John Burkardt ! use omp_lib implicit none integer, parameter :: logn_max = 9 ! change to 10 for more accurate results print *, '\n' print *, 'COMPUTE_PI' print *, ' FORTRAN90/OpenMP version' print *, '\n' print *, ' Estimate the value of PI by summing a series.' call omp_set_num_threads(8) print *, '\n' print *, ' The number of processors available = ', omp_get_num_procs ( ) print *, ' The number of threads available = ', omp_get_max_threads ( ) call r8_test ( logn_max ) ! ! Terminate. ! print *, '\n' print *, 'COMPUTE_PI' print *, ' Normal end of execution.' stop 0 end subroutine r8_test ( logn_max ) !*****************************************************************************80 ! !! R8_TEST estimates the value of PI using double precision. ! ! Discussion: ! ! PI is estimated using N terms. N is increased from 10^2 to 10^LOGN_MAX. ! The calculation is repeated using both sequential and Open MP enabled code. ! Wall clock time is measured by calling SYSTEM_CLOCK. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 18 April 2009 ! ! Author: ! ! John Burkardt ! use omp_lib implicit none double precision error double precision estimate integer logn integer logn_max character ( len = 3 ) mode integer n double precision, parameter :: r8_pi = 3.141592653589793D+00 double precision wtime print *, ' ' print *, 'R8_TEST:' print *, ' Estimate the value of PI,' print *, ' using double precision arithmetic.' print *, ' ' print *, ' N = number of terms computed and added;' print *, ' ' print *, ' MODE = SEQ for sequential code;' print *, ' MODE = OMP for Open MP enabled code;' print *, ' (performance depends on whether Open MP is used,' print *, ' and how many processes are available!)' print *, ' ' print *, ' ESTIMATE = the computed estimate of PI;' print *, ' ' print *, ' ERROR = ( the computed estimate - PI );' print *, ' ' print *, ' TIME = elapsed wall clock time;' print *, ' ' print *, ' Note that you can''t increase N forever, because:' print *, ' A) ROUNDOFF starts to be a problem, and' print *, ' B) maximum integer size is a problem.' print *, ' ' print *, ' The maximum integer:' , huge ( n ) print *, ' ' print *, ' ' print *, ' N Mode Estimate Error Time' print *, ' ' n = 1 do logn = 1, logn_max ! ! Sequential calculation. ! mode = 'SEQ' wtime = omp_get_wtime ( ) call r8_pi_est_seq ( n, estimate ) wtime = omp_get_wtime ( ) - wtime error = abs ( estimate - r8_pi ) if (logn == logn_max .and. error > 1e-12) error stop print *, & n, mode, estimate, error, wtime ! ! Open MP enabled calculation. ! mode = 'OMP' wtime = omp_get_wtime ( ) call r8_pi_est_omp ( n, estimate ) wtime = omp_get_wtime ( ) - wtime error = abs ( estimate - r8_pi ) print *, & n, mode, estimate, error, wtime n = n * 10 end do return end subroutine r8_pi_est_omp ( n, estimate ) !*****************************************************************************80 ! !! R8_PI_EST_OMP estimates the value of PI, using Open MP. ! ! Discussion: ! ! The calculation is based on the formula for the indefinite integral: ! ! Integral 1 / ( 1 + X**2 ) dx = Arctan ( X ) ! ! Hence, the definite integral ! ! Integral ( 0 <= X <= 1 ) 1 / ( 1 + X**2 ) dx ! = Arctan ( 1 ) - Arctan ( 0 ) ! = PI / 4. ! ! A standard way to approximate an integral uses the midpoint rule. ! If we create N equally spaced intervals of width 1/N, then the ! midpoint of the I-th interval is ! ! X(I) = (2*I-1)/(2*N). ! ! The approximation for the integral is then: ! ! Sum ( 1 <= I <= N ) (1/N) * 1 / ( 1 + X(I)**2 ) ! ! In order to compute PI, we multiply this by 4; we also can pull out ! the factor of 1/N, so that the formula you see in the program looks like: ! ! ( 4 / N ) * Sum ( 1 <= I <= N ) 1 / ( 1 + X(I)**2 ) ! ! Until roundoff becomes an issue, greater accuracy can be achieved by ! increasing the value of N. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 13 January 2003 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, integer N, the number of terms to add up. ! ! Output, double precision ESTIMATE, the estimated value of pi. ! implicit none double precision h double precision estimate integer i integer n double precision sum2 double precision x h = 1.0D+00 / dble ( 2 * n ) sum2 = 0.0D+00 !$omp parallel shared(h, n) private(i, x) reduction(+:sum2) !$omp do do i = 1, n x = h * dble ( 2 * i - 1 ) sum2 = sum2 + 1.0D+00 / ( 1.0D+00 + x**2 ) end do !$omp end do !$omp end parallel estimate = 4.0D+00 * sum2 / dble ( n ) return end subroutine r8_pi_est_seq ( n, estimate ) !*****************************************************************************80 ! !! R8_PI_EST_SEQ estimates the value of PI, using sequential execution. ! ! Discussion: ! ! The calculation is based on the formula for the indefinite integral: ! ! Integral 1 / ( 1 + X**2 ) dx = Arctan ( X ) ! ! Hence, the definite integral ! ! Integral ( 0 <= X <= 1 ) 1 / ( 1 + X**2 ) dx ! = Arctan ( 1 ) - Arctan ( 0 ) ! = PI / 4. ! ! A standard way to approximate an integral uses the midpoint rule. ! If we create N equally spaced intervals of width 1/N, then the ! midpoint of the I-th interval is ! ! X(I) = (2*I-1)/(2*N). ! ! The approximation for the integral is then: ! ! Sum ( 1 <= I <= N ) (1/N) * 1 / ( 1 + X(I)**2 ) ! ! In order to compute PI, we multiply this by 4; we also can pull out ! the factor of 1/N, so that the formula you see in the program looks like: ! ! ( 4 / N ) * Sum ( 1 <= I <= N ) 1 / ( 1 + X(I)**2 ) ! ! Until roundoff becomes an issue, greater accuracy can be achieved by ! increasing the value of N. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 06 January 2003 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, integer N, the number of terms to add up. ! ! Output, double precision ESTIMATE, the estimated value of pi. ! implicit none double precision h double precision estimate integer i integer n double precision sum2 double precision x h = 1.0D+00 / dble ( 2 * n ) sum2 = 0.0D+00 do i = 1, n x = h * dble ( 2 * i - 1 ) sum2 = sum2 + 1.0D+00 / ( 1.0D+00 + x**2 ) end do estimate = 4.0D+00 * sum2 / dble ( n ) return end lfortran-0.63.0/integration_tests/intrinsics_417.f900000664000175000017500000000030715174404631022465 0ustar alastairalastairprogram intrinsics_417 implicit none integer :: t1, t2, rate call system_clock(t1, rate) call sleep(0) call system_clock(t2) if (t2 < t1) error stop end program intrinsics_417lfortran-0.63.0/integration_tests/select_type_48.f900000664000175000017500000000062515174404631022543 0ustar alastairalastairprogram select_type_48 implicit none character(5) :: a(10) a = "hello" call sub(a) contains subroutine sub(x) class(*), intent(in) :: x(:) if (size(x) /= 10) error stop 1 select type (x) type is (character(*)) if (x(1) /= "hello") error stop 2 class default error stop 3 end select end subroutine end program lfortran-0.63.0/integration_tests/separate_compilation_09b.f900000664000175000017500000000064015174404631024561 0ustar alastairalastairmodule mpi_separate_compilation_09b implicit none integer, parameter :: MPI_COMM_WORLD = -1000 contains integer(kind=4) function handle_mpi_comm_f2c(comm_f) result(c_comm) use mpi_c_bindings_separate_compilation_09a, only: c_mpi_comm_world integer, intent(in) :: comm_f c_comm = c_mpi_comm_world end function handle_mpi_comm_f2c end module mpi_separate_compilation_09b lfortran-0.63.0/integration_tests/array_constructor_02.f900000664000175000017500000000122215174404631023766 0ustar alastairalastairprogram array_constructor_02 implicit none type build_target_ptr type(build_target_t), pointer :: ptr => null() end type build_target_ptr type :: build_target_t type(build_target_ptr), allocatable :: dependencies(:) end type type(build_target_t) :: a, b call add_dependency(a, b) contains subroutine add_dependency(target, dependency) type(build_target_t), intent(inout) :: target type(build_target_t) , intent(in), target :: dependency allocate(target%dependencies(2)) target%dependencies = [target%dependencies, build_target_ptr(dependency)] end subroutine add_dependency end program lfortran-0.63.0/integration_tests/init_values.f900000664000175000017500000000075115174404631022232 0ustar alastairalastairprogram init_values integer, parameter :: i = 1.0, j = 2.0 real, parameter :: r = 4.0 complex, parameter :: c = (3.0, 4.0) integer, parameter :: a = i + j logical, parameter :: l = a == 3 logical, parameter :: b = l .or. .true. real, parameter :: r_minus = -r character(len = 1), parameter :: s1 = "l" character(len = 3), parameter :: s2 = "eft" character(len = 4), parameter :: s = s1//s2 print *, i, j, r, c, a, l, b, r_minus, s end program lfortran-0.63.0/integration_tests/arrays_op_20.f900000664000175000017500000000051715174404631022210 0ustar alastairalastairprogram arrays_op_20 implicit none real, allocatable :: array(:, :), arrayoutput(:, :) allocate(array(3, 3)) arrayoutput = f(5, array) print *, size(arrayoutput) if( size(arrayoutput) /= 24 ) error stop contains function f(m, input) result(output) integer :: m real :: input(m) real :: output(2:m, m:2*m) end function end program lfortran-0.63.0/integration_tests/allocate_36.f900000664000175000017500000000362215174404631022004 0ustar alastairalastairmodule allocate_36_mod implicit none type :: string_t character(len=:), allocatable :: s end type string_t type :: preprocess_config_t type(string_t), allocatable :: macros(:) end type preprocess_config_t contains subroutine new(self, macros) type(preprocess_config_t), intent(inout) :: self type(string_t), intent(in) :: macros(:) ! Defensive checks if (allocated(self%macros)) then print *, "Deallocating existing macros" deallocate(self%macros) end if if (allocated(self%macros)) then error stop "ERROR: self%macros still allocated after deallocate" end if allocate(self%macros, source=macros) if (.not. allocated(self%macros)) then error stop "ERROR: allocation of self%macros failed" end if if (size(self%macros) /= size(macros)) then error stop "ERROR: size mismatch after allocate(source=)" end if end subroutine new end module allocate_36_mod program allocate_36 use allocate_36_mod implicit none type(preprocess_config_t) :: cpp_config ! First initialization call new(cpp_config, [ & string_t('SOME_FEATURE'), & string_t('SIMPLE_MACRO') ]) if (.not. allocated(cpp_config%macros)) then error stop "ERROR: macros not allocated after first call" end if if (size(cpp_config%macros) /= 2) then error stop "ERROR: wrong size after first call" end if ! Second re-initialization call new(cpp_config, [ string_t('FIFTH_FEATURE') ]) if (.not. allocated(cpp_config%macros)) then error stop "ERROR: macros not allocated after second call" end if if (size(cpp_config%macros) /= 1) then error stop "ERROR: wrong size after second call" end if print *, "OK: MRE completed successfully" end program allocate_36 lfortran-0.63.0/integration_tests/legacy_array_sections_11_stubs.c0000664000175000017500000000125315174404631025624 0ustar alastairalastair/* Minimal stubs for LAPACK routines - just enough to link and run */ int lsame(void *a, void *b) { return 1; } float slamch(void *cmach) { return 1.0f; } float slange(void *norm, void *m, void *n, void *a, void *lda, void *work) { return 0.0f; } void sgemm(void *transa, void *transb, void *m, void *n, void *k, void *alpha, void *a, void *lda, void *b, void *ldb, void *beta, void *c, void *ldc) {} void slacpy(void *uplo, void *m, void *n, void *a, void *lda, void *b, void *ldb) {} void slascl(void *type, void *kl, void *ku, void *cfrom, void *cto, void *m, void *n, void *a, void *lda, void *info) {} void xerbla(void *srname, void *info) {} lfortran-0.63.0/integration_tests/equivalence_29.f900000664000175000017500000000041115174404631022514 0ustar alastairalastairprogram equivalence_29 implicit none REAL::SFAC(1),ABC(1) EQUIVALENCE (ABC(1), SFAC(1)) DATA SFAC/ -2.50 / print *, ABC, SFAC if ( (ABC(1) - 2.5) > 1e-4) error stop if ( (SFAC(1) - 2.5) > 1e-4) error stop end program equivalence_29lfortran-0.63.0/integration_tests/intrinsics_301.f900000664000175000017500000001316515174404631022463 0ustar alastairalastairprogram intrinsics_301 implicit none integer(4), parameter :: i1(1) = findloc([1, 2, 3], 2) integer(4), parameter :: i2(1) = findloc([1.0, 2.0, 3.0], 2.0) integer(4), parameter :: i3(1) = findloc(["aa", "db", "ca"], "aa") integer(4), parameter :: i4(1) = findloc([1,2,3], 3, mask = [.true., .true., .true.]) integer(8), parameter :: i5(1) = findloc([1,2,3], 1, mask=[.true., .false., .true.], kind = 8) integer(4), parameter :: i6(1) = findloc([1,2,3], 2, mask=[.true., .false., .true.], dim=1) integer(4), parameter :: i7(1) = findloc(["aa", "db", "ca"], "aa", mask=[.true., .false., .true.]) integer(4), parameter :: i8(1) = findloc(["aa", "db", "ca"], "db", mask=[.true., .false., .true.], dim = 1) integer(4), parameter :: i9(1) = findloc([1, 3, 2, 3], 3, mask = [.true., .true., .false., .true.], back = .true.) integer(4), parameter :: i10(1) = findloc([3, 2, 1, 3], 3, back = .true.) integer(4), parameter :: i11(1) = findloc([3.0, 2.0, 1.0, 3.0], 2.0, back = .true., dim=1) integer(4), parameter :: i12(1) = findloc(["aa", "db", "ca"], "aa", mask = [.false., .false., .false.], kind = 4) integer(4), parameter :: i13 = findloc([1, 3, 2, 3], 3, 1, mask = [.true., .true., .false., .true.], back = .true., kind = 4) complex, dimension(2) :: dc = [(1.4, 1.1), (2.3, 2.2)] complex, dimension(2) :: dc2 = [(1.0, 2.0), (3.0, 4.0)] integer :: x1(5) = [1, 3, 2, 4, 2], y1 = 2 integer, parameter :: x1_param(5) = [1, 3, 2, 4, 2] integer, parameter :: y1_param = 2 integer, parameter :: i14(1) = findloc(x1_param, y1_param) ! complex argument complex-time search integer, parameter :: i15(1) = findloc([(1.0, 2.0), (3.0, 4.0)], (3.0, 4.0)) integer, parameter :: i16(1) = findloc([(1, 2), (3, 4)], (3, 4)) ! complex argument search with no-find of "value" integer, parameter :: i17(1) = findloc([(1.0, 2.0), (3.0, 4.0), (4.0, 2.0)], (3.0, 2.0)) integer, parameter :: i18(1) = findloc(["aa", "bb", "cc"], "bb") real :: x2(5) = [1.0, 3.0, 2.0, 4.0, 2.0], y2 = 2.0 character(len=2) :: x3(3) = ["aa", "db", "ca"], y3 = "aa" logical :: mask1(5) = [.true., .true., .false., .true., .true.] logical :: mask2(3) = [.true., .false., .true.] logical :: back1 = .false. logical :: back2 = .true. complex :: x = (1.4, 1.1) complex :: x5 = (3.0, 4.0) integer, dimension(1) :: result integer, dimension(1) :: result2 ! findloc(Array, value, mask) logical :: x4(3) = [.true., .false., .true.], y4 = .true., mask3 = .true. print *, findloc(x1, y1) if (any(findloc(x1, y1) /= 3)) error stop print *, findloc(x2, y2) if (any(findloc(x2, y2) /= 3)) error stop print *, findloc(x3, y3) if (any(findloc(x3, y3) /= 1)) error stop print *, findloc(x1, y1, mask = mask1) if (any(findloc(x1, y1, mask = mask1) /= 5)) error stop print *, findloc(x2, y2, mask = mask1) if (any(findloc(x2, y2, mask = mask1) /= 5)) error stop print *, findloc(x3, y3, mask = mask2) if (any(findloc(x3, y3, mask = mask2) /= 1)) error stop print *, findloc(x1, y1, mask = mask1, back = back1) if (any(findloc(x1, y1, mask = mask1, back = back1) /= 5)) error stop print *, findloc(x1, y1, mask = mask1, back = back2) if (any(findloc(x1, y1, mask = mask1, back = back2) /= 5)) error stop print *, findloc(x2, y2, mask = mask1, back = back2) if (any(findloc(x2, y2, mask = mask1, back = back2) /= 5)) error stop print *, findloc(x1, y1, mask = mask1, back = back2, kind = 8) if (any(findloc(x1, y1, mask = mask1, back = back2, kind = 8) /= 5)) error stop print *, findloc(x4, y4, mask3) if (any(findloc(x4, y4, mask3) /= 1)) error stop print *, i1 if (i1(1) /= 2) error stop print *, i2 if (i2(1) /= 2) error stop print *, i3 if (i3(1) /= 1) error stop print *, i4 if (i4(1) /= 3) error stop print *, i5 if (i5(1) /= 1) error stop print *, i6 if (i6(1) /= 0) error stop print *, i7 if (i7(1) /= 1) error stop print *, i8 if (i8(1) /= 0) error stop print *, i9 if (i9(1) /= 4) error stop print *, i10 if (i10(1) /= 4) error stop print *, i11 if (i11(1) /= 2) error stop print *, i12 if (i12(1) /= 0) error stop print *, i13 if (i13 /= 4) error stop print *, kind(findloc(["aa", "db", "ca"], "aa", 1, mask = [.false., .false., .false.], kind = 8)) if (kind(findloc(["aa", "db", "ca"], "db", 1, mask = [.false., .false., .false.], kind = 8)) /= 8) error stop print *, findloc(dc, x) if (any(findloc(dc, x) /= 1)) error stop print*, findloc([(1.0, 2.0), (3.0, 4.0)], (3.0, 4.0)) if (any(findloc([(1.0, 2.0), (3.0, 4.0)], (3.0, 4.0)) /= 2)) error stop print*, findloc([(1.0, 2.0), (3.0, 4.0)], (1.0, 2.0), mask = [.true., .true.]) if (any(findloc([(1.0, 2.0), (3.0, 4.0)], (1.0, 2.0), mask = [.true., .true.]) /= 1)) error stop print*, findloc([(1.0, 2.0), (3.0, 4.0)], (3.0, 4.0), mask=[.true., .true.], kind = 8) if (any(findloc([(1.0, 2.0), (3.0, 4.0)], (3.0, 4.0), mask = [.true., .true.], kind = 8) /= 2)) error stop result = findloc(dc2, x5) result2 = findloc(dc2, x5, mask = [.true., .true.]) print *, result if (any(result /= 2)) error stop print*, result2 if (any(result2 /= 2)) error stop print *, i14 if (any(i14 /= 3)) error stop print *, i15 if (any(i15 /= 2)) error stop print *, i16 if (any(i16 /= 2)) error stop print *, i17 if (any(i17 /= 0)) error stop print *, i18 if (any(i18 /= 2)) error stop print *, findloc(x1_param, y1) if (any(findloc(x1_param, y1) /= 3)) error stop end program intrinsics_301 lfortran-0.63.0/integration_tests/intrinsics_341.f900000664000175000017500000000037015174404631022461 0ustar alastairalastairprogram intrinsics_341 print *, trailz(0_8) if (trailz(0_8) /= 64) error stop if (kind(trailz(0_8)) /= 4) error stop print *, trailz(5_8) if (trailz(5_8) /= 0) error stop if (kind(trailz(5_8)) /= 4) error stop end program lfortran-0.63.0/integration_tests/submodule_25b.f900000664000175000017500000000133015174404631022351 0ustar alastairalastairmodule submodule_25_m implicit none type :: op_t contains generic :: operator(.x.) => apply procedure, private :: apply end type type :: tensor_t integer :: n_ real(8), allocatable :: data_(:) end type interface tensor_t module function make_tensor(data, n) result(r) real(8), intent(in) :: data(:) integer, intent(in) :: n type(tensor_t) :: r end function end interface interface module function apply(self, vec) result(out) class(op_t), intent(in) :: self real(8), intent(in) :: vec(:) real(8), allocatable :: out(:) end function module function compute() result(t) type(tensor_t) :: t end function end interface end module lfortran-0.63.0/integration_tests/functions_43.f900000664000175000017500000000125715174404631022230 0ustar alastairalastairmodule functions_43_mod implicit none type string_t character(len=:), allocatable :: string_ end type string_t contains elemental function bracket(x) result(res) class(string_t), intent(in) :: x type(string_t) :: res res%string_ = "0" res%string_ = x%string_ end function bracket end module functions_43_mod program functions_43 use functions_43_mod implicit none type(string_t) :: lines(3) lines(1)%string_ = "1" lines(2)%string_ = "2" lines(3)%string_ = "3" lines = bracket(lines) if (lines(1)%string_ /= "1") error stop if (lines(2)%string_ /= "2") error stop if (lines(3)%string_ /= "3") error stop end program functions_43 lfortran-0.63.0/integration_tests/openmp_65.f900000664000175000017500000000772115174404631021524 0ustar alastairalastair! Test 5: Guided Schedule program openmp_65 use omp_lib implicit none integer, parameter :: n = 1000 ! Larger n to see guided behavior integer :: i, tid, j integer :: chunk_count = 0 integer :: chunk_size_array(100) = 0 integer :: chunk_thread(100) = -1 integer :: current_pos = 1 integer :: thread_iterations(0:7) = 0 logical :: test_passed = .true. logical :: decreasing_trend = .true. integer :: last_thread = -1 integer :: current_chunk_size = 0 integer :: iterations_done = 0 call omp_set_num_threads(4) print *, "=== GUIDED Schedule Test ===" print *, "Iterations:", n, "Threads:", omp_get_max_threads() ! Track chunk sizes with guided schedule !$omp parallel private(tid) !$omp do schedule(guided) do i = 1, n tid = omp_get_thread_num() !$omp critical if (i == current_pos) then chunk_count = chunk_count + 1 chunk_thread(chunk_count) = tid ! Find chunk size by looking ahead do j = i, n if (j == n) then chunk_size_array(chunk_count) = j - i + 1 current_pos = n + 1 exit else ! This is approximate - in real guided, we can't know ! the chunk size until the chunk is complete ! For testing, we'll measure it differently end if end do end if thread_iterations(tid) = thread_iterations(tid) + 1 !$omp end critical end do !$omp end do !$omp end parallel ! Better way to measure guided chunks chunk_count = 0 current_pos = 1 ! Measure chunks by looking at work distribution !$omp parallel private(tid, i) tid = omp_get_thread_num() if (tid == 0) then ! Simulate guided algorithm do while (iterations_done < n) chunk_count = chunk_count + 1 ! Guided: chunk_size = remaining_iterations / (2 * num_threads) ! Minimum chunk size is usually 1 current_chunk_size = max(1, (n - iterations_done) / (2 * omp_get_num_threads())) chunk_size_array(chunk_count) = current_chunk_size iterations_done = iterations_done + current_chunk_size if (chunk_count >= 100) exit end do end if !$omp end parallel ! Print chunk size progression print *, "Expected guided chunk sizes (first 10):" do i = 1, min(10, chunk_count) print *,"Chunk ", i, ": size = ", chunk_size_array(i) end do ! Verify guided behavior - chunks should generally decrease do i = 2, min(chunk_count-1, 20) if (chunk_size_array(i) > chunk_size_array(i-1) * 1.5) then ! Allow some variation but not huge increases print *, "WARNING: Chunk size increased significantly at chunk", i decreasing_trend = .false. end if end do ! First chunks should be larger than last chunks if (chunk_count > 5) then if (chunk_size_array(1) < chunk_size_array(chunk_count-2) * 2) then print *, "ERROR: Guided schedule not showing expected decreasing chunk sizes!" print *, "First chunk:", chunk_size_array(1), & "Late chunk:", chunk_size_array(chunk_count-2) test_passed = .false. end if end if print *, "Thread work distribution:" do i = 0, omp_get_max_threads()-1 print *, "Thread", i, ":", thread_iterations(i), "iterations" end do if (.not. test_passed) then error stop "GUIDED schedule test FAILED!" end if if (.not. decreasing_trend) then print *, "WARNING: Guided chunks did not show clear decreasing trend" else print *, "Guided schedule showing expected decreasing chunk pattern" end if print *, "GUIDED schedule test completed" end program openmp_65lfortran-0.63.0/integration_tests/template_array_04.f900000664000175000017500000000215015174404631023217 0ustar alastairalastairmodule reverse_m implicit none private public :: reverse_tmpl, test_reverse requirement default_behavior(t) type, deferred :: t end requirement template reverse_tmpl(t) require :: default_behavior(t) private public :: reverse contains subroutine swap(x, y) type(t), intent(inout) :: x, y type(t) :: tmp tmp = x x = y y = tmp end subroutine subroutine reverse(arr) type(t), intent(inout) :: arr(:) integer :: i, j do i = 1, size(arr)/2 j = size(arr)+1-i call swap(arr(i), arr(j)) end do end subroutine end template contains subroutine test_reverse() instantiate reverse_tmpl(integer), & only: ireverse => reverse integer :: a(5) a = [1,2,3,4,5] call ireverse(a) print *, a if (a(1) /= 5) error stop if (a(5) /= 1) error stop end subroutine end module program main use reverse_m call test_reverse() end program lfortran-0.63.0/integration_tests/intrinsics_264.f900000664000175000017500000000605615174404631022474 0ustar alastairalastairprogram intrinsics_264 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real(sp), parameter :: a1 = sin(1.0_sp) real(dp), parameter :: a2 = sin(1.0_dp) complex(sp), parameter :: a3 = sin((1.0_sp, 1.5_sp)) complex(dp), parameter :: a4 = sin((1.0_dp, 1.5_dp)) real(sp), parameter :: ar1(3) = sin([1.0_sp, 1.5_sp, 2.0_sp]) real(dp), parameter :: ar2(3) = sin([1.0_dp, 1.5_dp, 2.0_dp]) complex(sp), parameter :: ac1(3) = sin([(1.0_sp, 1.5_sp), (2.0_sp, 2.5_sp), (3.0_sp, 3.5_sp)]) complex(dp), parameter :: ac2(3) = sin([(1.0_dp, 1.5_dp), (2.0_dp, 2.5_dp), (3.0_dp, 3.5_dp)]) real(sp) :: b1 = 0.5_sp real(dp) :: b2 = 0.7_dp complex(sp) :: b3 = (0.5_sp, 0.7_sp) complex(dp) :: b4 = (0.5_dp, 0.7_dp) real(sp) :: br1(3) = [0.5_sp, 0.7_sp, 0.9_sp] real(dp) :: br2(3) = [0.5_dp, 0.7_dp, 0.9_dp] complex(sp) :: bc1(3) = [(0.5_sp, 0.7_sp), (0.9_sp, 1.1_sp), (1.3_sp, 1.5_sp)] complex(dp) :: bc2(3) = [(0.5_dp, 0.7_dp), (0.9_dp, 1.1_dp), (1.3_dp, 1.5_dp)] print *, a1 if (abs(a1 - 8.41470957e-01_sp) > 1e-6_sp) error stop print *, a2 if (abs(a2 - 8.41470984807896507e-01_dp) > 1e-12_dp) error stop print *, a3 if (abs(a3 - (1.979484_sp, 1.150455_sp)) > 1e-6_sp) error stop print *, a4 if (abs(a4 - (1.9794844356103003_dp, 1.1504545994253859_dp)) > 1e-12_dp) error stop print *, ar1 if (any(abs(ar1 - [0.841470957_sp, 0.997494996_sp, 0.909297407_sp]) > 1e-6_sp)) error stop print *, ar2 if (any(abs(ar2 - [0.84147098480789650_dp, 0.99749498660405445_dp, 0.90929742682568171_dp]) > 1e-12_dp)) error stop print *, ac1 if (any(abs(ac1 - [(1.97948444_sp, 1.15045464_sp), (5.57607508_sp, -2.51777339_sp), & (2.33875704_sp, -16.3770771_sp)]) > 1e-6_sp)) error stop print *, ac2 if (any(abs(ac2 - [(1.9794844356103003_dp, 1.1504545994253859_dp), (5.5760750444083884_dp, -2.5177734552480526_dp), & (2.3387571511543750_dp, -16.377076888816426_dp)]) > 1e-12_dp)) error stop print *, sin(b1) if (abs(sin(b1) - 0.479425550_sp) > 1e-6_sp) error stop print *, sin(b2) if (abs(sin(b2) - 0.64421768723769102_dp) > 1e-12_dp) error stop print *, sin(b3) if (abs(sin(b3) - (0.601760089_sp, 0.665719807_sp)) > 1e-6_sp) error stop print *, sin(b4) if (abs(sin(b4) - (0.60176007656391672_dp, 0.66571982846862043_dp)) > 1e-12_dp) error stop print *, sin(br1) if (any(abs(sin(br1) - [0.479425550_sp, 0.644217670_sp, 0.783326924_sp]) > 1e-6_sp)) error stop print *, sin(br2) if (any(abs(sin(br2) - [0.47942553860420301_dp, 0.64421768723769102_dp, 0.78332690962748341_dp]) > 1e-12_dp)) error stop print *, sin(bc1) if (any(abs(sin(bc1) - [(0.601760089_sp, 0.665719807_sp), (1.30699551_sp, 0.830251873_sp), & (2.26668358_sp, 0.569579840_sp)]) > 1e-6_sp)) error stop print *, sin(bc2) if (any(abs(sin(bc2) - [(0.60176007656391672_dp, 0.66571982846862043_dp), (1.3069954824217060_dp, 0.83025178152468282_dp), & (2.2666835402217402_dp, 0.56957976005226330_dp)]) > 1e-12_dp)) error stop end programlfortran-0.63.0/integration_tests/transfer_12.f900000664000175000017500000000124315174404631022033 0ustar alastairalastairprogram transfer_12 ! Test transfer of a derived-type array component to integer(8). ! Reproduces a bug where LFortran generated an invalid bitcast ! when the source of transfer() was a struct member array. use iso_fortran_env, only: int8, int64 implicit none type :: t integer(int8) :: data(8) end type type(t) :: x integer(int64) :: result x%data = 0_int8 result = transfer(x%data, 0_int64) if (result /= 0_int64) error stop x%data = [1_int8, 0_int8, 0_int8, 0_int8, 0_int8, 0_int8, 0_int8, 0_int8] result = transfer(x%data, 0_int64) if (result /= 1_int64) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/gpu_metal_180.f900000664000175000017500000000104315174404631022250 0ustar alastairalastairprogram gpu_metal_180 ! Test that Fortran variables named after C++ keywords (true, false, etc.) ! are properly sanitized in Metal/C++ codegen. implicit none real, parameter :: true = 1.0 real, parameter :: false = 0.0 real :: a(4) integer :: i do concurrent(i = 1:4) if (mod(i, 2) == 0) then a(i) = true else a(i) = false end if end do if (abs(a(1) - 0.0) > 1e-6) error stop if (abs(a(2) - 1.0) > 1e-6) error stop if (abs(a(3) - 0.0) > 1e-6) error stop if (abs(a(4) - 1.0) > 1e-6) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/intrinsics_102.f900000664000175000017500000000033215174404631022452 0ustar alastairalastairprogram intrinsics_102 implicit none real, allocatable :: arr(:), sin1d(:) allocate(arr(10), sin1d(10)) arr = 1.0 sin1d = sin(arr) print *, sin1d if( any(abs(sin1d - 8.41471016e-01) > 1e-6) ) error stop end program lfortran-0.63.0/integration_tests/class_02.f900000664000175000017500000000205715174404631021317 0ustar alastairalastairmodule class_circle2 implicit none private public :: main real :: pi = 3.1415926535897931d0 ! Class-wide private constant type, public :: Circle real :: radius contains procedure :: circle_area !=> circle_area ! Can you point to implementation in diff module? procedure :: circle_print end type Circle contains real function circle_area(this) class(Circle), intent(in) :: this circle_area = pi * this%radius**2 end function circle_area subroutine circle_print(this) class(Circle), intent(in) :: this real :: area area = this%circle_area() ! Call the type-bound function print *, 'Circle: r = ', this%radius, ' area = ', area end subroutine circle_print subroutine main() type(Circle) :: c ! Declare a variable of type Circle. c = Circle(1.0) ! Use the implicit constructor, radius = 1.5. c%radius = 1.5 call c%circle_print ! Call the type-bound subroutine end subroutine end module program circle_test use class_circle2, only: main implicit none call main() end program lfortran-0.63.0/integration_tests/select_case_03.f900000664000175000017500000000057015174404631022463 0ustar alastairalastairmodule select_case_03_mod contains subroutine empty_select() integer :: x x = 1 select case (x) end select select case (x) case default x = 2 end select if (x /= 2) error stop select case (1) end select print *, "ok" end subroutine end module program select_case_03 use select_case_03_mod call empty_select() end program lfortran-0.63.0/integration_tests/string_92.f900000664000175000017500000000066515174404631021534 0ustar alastairalastairprogram string_92 implicit none call test_concat('Upper', 'Diag') print *, "PASS" contains subroutine test_concat(a, b) character, intent(in) :: a, b character(2) :: result result = a // b if (len(a) /= 1) error stop "len(a) should be 1" if (len(b) /= 1) error stop "len(b) should be 1" if (result /= 'UD') error stop "result should be 'UD'" end subroutine end program lfortran-0.63.0/integration_tests/equivalence_24.f900000664000175000017500000000034315174404631022513 0ustar alastairalastairprogram equivalence_24 implicit none equivalence (is1, ia1) integer :: ia1(3), is1 common /BLK9/ is1 ia1 = [3, 2, 1] if (is1 /= 3) error stop is1 = 42 if (ia1(1) /= 42) error stop end program lfortran-0.63.0/integration_tests/modules_02.f900000664000175000017500000000060615174404631021660 0ustar alastairalastairmodule modules_02_a implicit none contains subroutine b() print *, "b()" end subroutine end module module modules_02_c implicit none contains subroutine d() print *, "d()" end subroutine subroutine e() print *, "e()" end subroutine end module program modules_02 use modules_02_a use modules_02_c, only: x=>d use modules_02_c, only: e implicit none call b() call x() call e() end lfortran-0.63.0/integration_tests/intrinsics_98.f900000664000175000017500000000132315174404631022411 0ustar alastairalastairprogram intrinsics_98 integer :: a(3) real, parameter :: sum_ = sum([1, 2, 3]) real, parameter :: size_ = size([1, 2, 3]) real, parameter :: maxval_ = maxval([1, 2, 3]) real, parameter :: minval_ = minval([1, 2, 3]) a = [1, 2, 3] print *, shape(a) print *, size(a) if (size(a) /= 3) error stop print *, maxval(a) if (maxval(a) /= 3) error stop print *, minval(a) if (minval(a) /= 1) error stop print *, sum(a) if (sum(a) /= 6) error stop print*, sum_ if (sum_ /= 6) error stop print*, size_ if (size_ /= 3) error stop print*, maxval_ if (maxval_ /= 3) error stop print*, minval_ if (minval_ /= 1) error stop end program lfortran-0.63.0/integration_tests/implied_do_loops11.f900000664000175000017500000000114115174404631023365 0ustar alastairalastairprogram implied_do_loops11 implicit none integer i integer, parameter:: nmax = 5, a(nmax) = [1,2,4,8,8], & b(nmax-1) = [ ( a(i)-a(i-1), i=2,nmax ) ] integer:: c(nmax-1) = [ ( a(i)-a(i-1), i=2,nmax ) ] print "(A,5(1X,I0))", 'a =' ,a if (any(a /= [1,2,4,8,8])) error stop print "(A,4(1X,I0))", 'b = ',b if (any(b /= [1,2,4,0])) error stop print "(A,4(1X,I0))", 'c = ',c if (any(c /= [1,2,4,0])) error stop print "(A,4(1X,I0))", '? = ', ( a(i)-a(i-1), i=2,nmax ) if (any([ (a(i)-a(i-1), i=2,nmax) ] /= [1,2,4,0])) error stop end program implied_do_loops11lfortran-0.63.0/integration_tests/procedure_42.f900000664000175000017500000000224615174404631022206 0ustar alastairalastair! Test: procedure pointer with abstract interface in a module that also ! contains a "module subroutine" declaration (submodule interface). ! The presence of the module subroutine must not break the LLVM type ! of the procedure pointer. module procedure_42_iface_m implicit none abstract interface pure function initializer_i(x) result(f) double precision, intent(in) :: x(:) double precision, allocatable :: f(:) end function end interface interface module subroutine s() end subroutine end interface end module module procedure_42_functions_m implicit none contains pure function f(x) double precision, intent(in) :: x(:) double precision, allocatable :: f(:) allocate(f(size(x))) f = x end function end module program procedure_42 use procedure_42_iface_m, only : initializer_i use procedure_42_functions_m, only : f implicit none procedure(initializer_i), pointer :: p double precision :: x(3), y(3) p => f x = [1.0d0, 2.0d0, 3.0d0] y = p(x) if (abs(y(1) - 1.0d0) > 1.0d-12) error stop if (abs(y(2) - 2.0d0) > 1.0d-12) error stop if (abs(y(3) - 3.0d0) > 1.0d-12) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/read_42.f900000664000175000017500000000162315174404631021127 0ustar alastairalastairprogram read_42 ! Internal (string-unit) reads into allocatable scalar and array variables. ! These used to crash with SIGSEGV because the codegen passed the alloca ! address (pointer-to-pointer) to the runtime instead of the allocated ! data pointer. implicit none character(len=3) :: s3 character(len=7) :: s7 real, allocatable :: x real, allocatable :: arr(:) ! Test 1: allocatable scalar s3 = "1.0" allocate(x) read(s3, fmt=*) x if (abs(x - 1.0) > 1e-6) error stop "Test 1 failed: allocatable scalar read" deallocate(x) ! Test 2: allocatable array s7 = "1, 2, 3" allocate(arr(3)) read(s7, fmt=*) arr if (abs(arr(1) - 1.0) > 1e-6) error stop "Test 2 failed: arr(1)" if (abs(arr(2) - 2.0) > 1e-6) error stop "Test 2 failed: arr(2)" if (abs(arr(3) - 3.0) > 1e-6) error stop "Test 2 failed: arr(3)" deallocate(arr) print *, "All tests passed." end program read_42 lfortran-0.63.0/integration_tests/test_backspace_01.f900000664000175000017500000000064315174404631023163 0ustar alastairalastairprogram test_backspace_01 implicit none character(80) :: line integer :: u = 10 open(10, file='file_01_data.txt', status='old', action='read') read(u, '(A)') line write(*, '(A)') line backspace(u) read(u, '(A)') line write(*, '(A)') "Read and printed the same line again:" write(*, '(A)') line if (line /= "10130") error stop close(u) end program test_backspace_01 lfortran-0.63.0/integration_tests/separate_compilation_30.f900000664000175000017500000000024315174404631024410 0ustar alastairalastairprogram separate_compilation_30 use separate_compilation_30b_module, only: client implicit none type(client) :: x end program separate_compilation_30 lfortran-0.63.0/integration_tests/inquire_08.f900000664000175000017500000000122015174404631021663 0ustar alastairalastairprogram inquire_08 implicit none integer :: ioerr, nxtrec, recl, unit_no inquire (iolength=recl) 42, 42.0, 'xyzzy' if (recl /= 13) error stop "iolength wrong" ioerr = -42 open (newunit=unit_no, file='test_inquire.dat', status='replace', & access='direct', recl=recl, form='unformatted', iostat=ioerr) if (ioerr /= 0) error stop "open failed" ioerr = -42 nxtrec = -43 inquire (unit_no, iostat=ioerr, nextrec=nxtrec) if (ioerr /= 0) error stop "iostat should be 0" if (nxtrec /= 1) error stop "nextrec should be 1" close (unit_no, status='delete') print *, "All tests passed" end program lfortran-0.63.0/integration_tests/file_58.f900000664000175000017500000000136515174404631021145 0ustar alastairalastairprogram file_58 ! Test unformatted stream write/read of logical(int8) arrays use iso_fortran_env, only: int8 implicit none logical(int8) :: a(3), c(3) integer(int8) :: b(3) integer :: u a(1) = .true. a(2) = .true. a(3) = .true. open(newunit=u, file='file_58.bin', access='stream', form='unformatted', & status='replace') write(u) a close(u) b = 0 open(newunit=u, file='file_58.bin', access='stream', form='unformatted', & status='old') read(u) b close(u) if (b(1) /= 1 .or. b(2) /= 1 .or. b(3) /= 1) error stop c = .false. open(newunit=u, file='file_58.bin', access='stream', form='unformatted', & status='old') read(u) c close(u, status='delete') if (.not. c(1) .or. .not. c(2) .or. .not. c(3)) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/types_19.f900000664000175000017500000000025215174404631021361 0ustar alastairalastairprogram types_19 type(integer) :: a type(real) :: b a = 25 b = 3.14 print *, a, B if (a /= 25) error stop if (abs(b - 3.14) > 1e-12) error stop end program lfortran-0.63.0/integration_tests/file_52.f900000664000175000017500000000243215174404631021133 0ustar alastairalastairprogram file_52 implicit none character(30) :: s1, s2, s3 integer :: i logical :: l real :: r integer :: iounit open (newunit=iounit, file='ld_strings.dat', form='formatted', status='replace') write(iounit,'(A)') "'ABCDEF'" write(iounit,'(A)') "'AB' 'ABCD' 'ABCDEF'" write(iounit,'(A)') "-5,'2468',T,15.0" write(iounit,'(A)') "'CAN''T, AND/OR WON''T'" close(iounit) open (newunit=iounit, file='ld_strings.dat', form='formatted', status='old') ! Test 1 read (iounit, *) s1 if (s1 /= 'ABCDEF') then error stop "Test 1 failed: s1 /= 'ABCDEF'" end if ! Test 2 read (iounit, *) s1, s2, s3 if (s1 /= 'AB' .or. s2 /= 'ABCD' .or. s3 /= 'ABCDEF') then error stop "Test 2 failed: s1, s2, s3 mismatch" end if ! Test 3 read (iounit, *) i, s1, l, r if (i /= -5) then error stop "Test 3 failed: i /= -5" end if if (s1 /= '2468') then error stop "Test 3 failed: s1 /= '2468'" end if if (.not. l) then error stop "Test 3 failed: l is not true" end if if (r /= 15.0) then error stop "Test 3 failed: r /= 15.0" end if ! Test 4 read (iounit, *) s1 if (s1 /= "CAN'T, AND/OR WON'T") then error stop "Test 4 failed: s1 mismatch" end if close (iounit) end program lfortran-0.63.0/integration_tests/intrinsics_140.f900000664000175000017500000000471415174404631022464 0ustar alastairalastairprogram intrinsics_140 implicit none integer, parameter :: wp = selected_int_kind(9) integer, parameter :: dp = selected_int_kind(18_8) integer :: k1 = 1 integer :: k2 = 2 integer :: k3 = 3 integer :: k4 = 4 integer(8) :: k5 = 5 integer(8) :: k6 = 6 integer(8) :: k7 = 7 integer(8) :: k8 = 8 integer(8) :: k9 = 9 integer(8) :: k10 = 10 integer(8) :: k11 = 11 print *, wp if (wp /= 4) error stop print *, dp if (dp /= 8) error stop print *, selected_int_kind(1) if (selected_int_kind(1) /= 1) error stop print *, selected_int_kind(2) if (selected_int_kind(2) /= 1) error stop print *, selected_int_kind(3) if (selected_int_kind(3) /= 2) error stop print *, selected_int_kind(4) if (selected_int_kind(4) /= 2) error stop print *, selected_int_kind(5) if (selected_int_kind(5) /= 4) error stop print *, selected_int_kind(6) if (selected_int_kind(6) /= 4) error stop print *, selected_int_kind(7) if (selected_int_kind(7) /= 4) error stop print *, selected_int_kind(8) if (selected_int_kind(8) /= 4) error stop print *, selected_int_kind(9) if (selected_int_kind(9) /= 4) error stop print *, selected_int_kind(10) if (selected_int_kind(10) /= 8) error stop print *, selected_int_kind(11) if (selected_int_kind(11) /= 8) error stop print *, selected_int_kind(k1) if (selected_int_kind(k1) /= 1) error stop print *, selected_int_kind(k2) if (selected_int_kind(k2) /= 1) error stop print *, selected_int_kind(k3) if (selected_int_kind(k3) /= 2) error stop print *, selected_int_kind(k4) if (selected_int_kind(k4) /= 2) error stop print *, selected_int_kind(k5) if (selected_int_kind(k5) /= 4) error stop print *, selected_int_kind(k6) if (selected_int_kind(k6) /= 4) error stop print *, selected_int_kind(k7) if (selected_int_kind(k7) /= 4) error stop print *, selected_int_kind(k8) if (selected_int_kind(k8) /= 4) error stop print *, selected_int_kind(k9) if (selected_int_kind(k9) /= 4) error stop print *, selected_int_kind(k10) if (selected_int_kind(k10) /= 8) error stop print *, selected_int_kind(k11) if (selected_int_kind(k11) /= 8) error stop print *, kind(selected_int_kind(1)) if (kind(selected_int_kind(1)) /= 4) error stop print *, kind(selected_int_kind(2_8)) if (kind(selected_int_kind(2_8)) /= 4) error stop end programlfortran-0.63.0/integration_tests/file_55.f900000664000175000017500000000227015174404631021136 0ustar alastairalastairprogram read_fmt8 implicit none integer :: i1, i2, i3, i4 ! Default is blank='null' open (10, file='file_55_fort.10', status='replace', form='formatted') write (10,'(a20)') ' ' rewind (10) i1=1; i2=2; i3=3; i4=4 read (10, '(4(i5))') i1, i2, i3, i4 print *, 'default: i1, i2, i3, i4 =', i1, i2, i3, i4 if(i1+i2+i3+i4 /= 0) error stop rewind (10) open (10, blank='zero') i1=1; i2=2; i3=3; i4=4 read (10, '(4(i5))') i1, i2, i3, i4 print *, 'zero: i1, i2, i3, i4 =', i1, i2, i3, i4 if(i1+i2+i3+i4 /= 0) error stop rewind (10) open (10, blank='null') i1=1; i2=2; i3=3; i4=4 read (10, '(4(i5))') i1, i2, i3, i4 print *, 'null: i1, i2, i3, i4 =', i1, i2, i3, i4 if (i1+i2+i3+i4 /= 0) error stop rewind (10) write (10,'(a20)') '1 2 3 4 5 6 7 8 ' rewind (10) open (10, blank='zero') i1=1; i2=2; i3=3; i4=4 read (10, '(4(i5))') i1, i2, i3, i4 print *, 'zero: i1, i2, i3, i4 =', i1, i2, i3, i4 if (i1+i2+i3+i4 /= 21015) error stop rewind (10) open (10, blank='null') i1=1; i2=2; i3=3; i4=4 read (10, '(4(i5))') i1, i2, i3, i4 print *, 'null: i1, i2, i3, i4 =', i1, i2, i3, i4 if (i1+i2+i3+i4 /= 243) error stop close (10) end program lfortran-0.63.0/integration_tests/binop_of_struct_instance_in_function_call.f900000664000175000017500000000135415174404631030361 0ustar alastairalastairmodule module_binop_of_struct_instance_in_function_call type custom_data_type real(4), dimension(:), pointer :: x, y end type contains function func(x0) real(4), intent(in) :: x0(:) real(4) :: func(size(x0)) func = x0 + 1 end function end module module_binop_of_struct_instance_in_function_call program binop_of_struct_instance_in_function_call use module_binop_of_struct_instance_in_function_call implicit none real(4), target :: A(2), B(2) type(custom_data_type) :: d real(4), dimension(2) :: tmp A = [1, 2] B = [3, 10] d%x => A d%y => B tmp = func(d%x - d%y) print *, tmp if (any(tmp /= [-1., -7.])) error stop end program binop_of_struct_instance_in_function_call lfortran-0.63.0/integration_tests/nested_vars_allocatable_call.f900000664000175000017500000000076415174404631025547 0ustar alastairalastairmodule nested_vars_allocatable_mod contains subroutine s(a) integer, allocatable, intent(inout) :: a(:) integer :: i do i = 1, size(a) call t(a(i)) end do contains subroutine t(x) integer, intent(inout) :: x if (size(a) > 0) x = x end subroutine end subroutine end module program nested_vars_allocatable_call use nested_vars_allocatable_mod integer, allocatable :: a(:) allocate(a(1)) a = 1 call s(a) if (a(1) /= 1) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_21.f900000664000175000017500000000067615174404631022175 0ustar alastairalastairprogram gpu_metal_21 ! Reduction: sum via do concurrent with reduce clause implicit none integer, parameter :: n = 100000 real :: x(n) real :: total, total_expected integer :: i total_expected = 0.0 do i = 1, n x(i) = 1.0 total_expected = total_expected + 1.0 end do total = 0.0 do concurrent (i = 1:n) reduce(+:total) total = total + x(i) end do if (abs(total - total_expected) > 1.0e-1) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/string_18.f900000664000175000017500000000114615174404631021525 0ustar alastairalastairprogram string_18 implicit none character(len=3) :: x character(len=5) :: y x = "123" y = "123 " ! Compile time if ("123 " < "123") error stop if ("123 " /= "123") error stop if ("123 " > "123") error stop if ("123 " > "123 ") error stop ! Run time if (x /= y) error stop if (.not.(x == y)) error stop if (x > y) error stop if (x < y) error stop y = " 123" if (y /= " 123 ") error stop y = " " if (y /= "") error stop y = " 1" if (y /= " 1") error stop y = "1 " if (y /= "1 ") error stop end program string_18 lfortran-0.63.0/integration_tests/class_71.f900000664000175000017500000000047015174404631021322 0ustar alastairalastair! This file checks correct type-conversions in print statements ! inside select statements program class_71 class(*), allocatable :: x allocate(x, source=42) select type (x) type is (integer) print *, x class default print *, "Unknown type" end select end program class_71lfortran-0.63.0/integration_tests/sqrt_01.f900000664000175000017500000000024515174404631021177 0ustar alastairalastairprogram sqrt_01 implicit none real :: x x = sqrt(4.0) if (abs(x - 2) > 1e-5) error stop x = sqrt(2.0) if (abs(x - 1.4142135623730951) > 1e-5) error stop end program lfortran-0.63.0/integration_tests/file_02.f900000664000175000017500000000072015174404631021124 0ustar alastairalastairprogram file_02 implicit none integer :: iostat, unit=10, i open(UNIT=unit, file="file_01_data.txt") ! TODO: return iostat value read(UNIT, *, iostat=iostat) i if (is_iostat_end(iostat)) then print *, "End of file reached." stop else if (is_iostat_eor(iostat)) then print *, "End of record reached." stop end if print *, i if (i /= 10130) error stop close(UNIT=unit) end program file_02 lfortran-0.63.0/integration_tests/class_allocate_01.f900000664000175000017500000000166015174404631023161 0ustar alastairalastairmodule shapes_module implicit none type, abstract :: Shape contains procedure(area_interface), deferred :: area end type Shape abstract interface function area_interface(self) result(res) import :: Shape class(Shape), intent(in) :: self real :: res end function area_interface end interface type, extends(Shape) :: Circle real :: radius contains procedure :: area => circle_area end type Circle contains function circle_area(self) result(res) class(Circle), intent(in) :: self real :: res res = 3.14159 * self%radius**2 end function circle_area end module shapes_module program main use shapes_module implicit none class(Shape), allocatable :: s real :: a allocate(Circle :: s) print *, allocated(s) if (allocated(s) .neqv. .true.) error stop end program main lfortran-0.63.0/integration_tests/kwargs_01.f900000664000175000017500000000226715174404631021512 0ustar alastairalastairprogram kwargs_01 ! Test keyword arguments implicit none integer :: i i = f(1, 2, 3, 4) if (i /= 1234) error stop call s(1, 2, 3, 4, i) if (i /= 1234) error stop i = f(1, 2, 3, d=4) if (i /= 1234) error stop call s(1, 2, 3, d=4, f=i) if (i /= 1234) error stop i = f(1, 2, c=3, d=4) if (i /= 1234) error stop call s(1, 2, c=3, d=4, f=i) if (i /= 1234) error stop i = f(1, 2, d=3, c=4) if (i /= 1243) error stop call s(1, 2, d=3, c=4, f=i) if (i /= 1243) error stop i = f(1, b=2, c=3, d=4) if (i /= 1234) error stop call s(1, b=2, c=3, d=4, f=i) if (i /= 1234) error stop i = f(1, c=2, d=3, b=4) if (i /= 1423) error stop call s(1, c=2, d=3, b=4, f=i) if (i /= 1423) error stop i = f(a=1, b=2, c=3, d=4) if (i /= 1234) error stop call s(a=1, b=2, c=3, d=4, f=i) if (i /= 1234) error stop i = f(d=1, c=2, a=3, b=4) if (i /= 3421) error stop call s(d=1, c=2, a=3, b=4, f=i) if (i /= 3421) error stop contains integer function f(a, b, c, d) integer, intent(in) :: a, b, c, d f = a*1000 + b*100 + c*10 + d end function subroutine s(a, b, c, d, f) integer, intent(in) :: a, b, c, d integer, intent(out) :: f f = a*1000 + b*100 + c*10 + d end subroutine end program lfortran-0.63.0/integration_tests/interface_30.f900000664000175000017500000000172015174404631022147 0ustar alastairalastairmodule interface_30_mod interface pure function scalar_1D_initializer_i(x) result(res) double precision, intent(in) :: x(:) double precision, allocatable :: res(:) end function end interface end module module interface_30_functions_m implicit none contains pure function f(x) double precision, intent(in) :: x(:) double precision, allocatable :: f(:) allocate(f(size(x))) f = x**2 end function end module interface_30_functions_m program interface_30 use interface_30_functions_m use interface_30_mod implicit none procedure(scalar_1D_initializer_i), pointer :: scalar_1D_initializer => f double precision, allocatable :: x(:), res(:) integer :: n n = 5 allocate(x(n)) x = [1.0d0, 2.0d0, 3.0d0, 4.0d0, 5.0d0] res = scalar_1D_initializer(x) print *, res if (all(res /= [1.0d0, 4.0d0, 9.0d0, 16.0d0, 25.0d0])) error stop deallocate(x, res) end program interface_30 lfortran-0.63.0/integration_tests/test_ieee_scalb.f900000664000175000017500000000352415174404631023023 0ustar alastairalastair! Test ieee_scalb function - Scale by power of 2 program test_ieee_scalb use, intrinsic :: ieee_arithmetic, only: ieee_scalb implicit none real :: x_sp, result_sp real(8) :: x_dp, result_dp print *, "Testing ieee_scalb..." ! Test 1: Scale 1.5 by 2^3 = 12.0 (single precision) x_sp = 1.5 result_sp = ieee_scalb(x_sp, 3) print *, "ieee_scalb(1.5, 3) =", result_sp if (abs(result_sp - 12.0) > 1e-6) error stop "Expected 12.0" ! Test 2: Scale 1.0 by 2^4 = 16.0 (single precision) x_sp = 1.0 result_sp = ieee_scalb(x_sp, 4) print *, "ieee_scalb(1.0, 4) =", result_sp if (abs(result_sp - 16.0) > 1e-6) error stop "Expected 16.0" ! Test 3: Scale 2.0 by 2^-1 = 1.0 (single precision) x_sp = 2.0 result_sp = ieee_scalb(x_sp, -1) print *, "ieee_scalb(2.0, -1) =", result_sp if (abs(result_sp - 1.0) > 1e-6) error stop "Expected 1.0" ! Test 4: Scale by 0 should return same value x_sp = 5.0 result_sp = ieee_scalb(x_sp, 0) print *, "ieee_scalb(5.0, 0) =", result_sp if (abs(result_sp - 5.0) > 1e-6) error stop "Expected 5.0" ! Test 5: Double precision - scale 1.5 by 2^10 = 1536.0 x_dp = 1.5d0 result_dp = ieee_scalb(x_dp, 10) print *, "ieee_scalb(1.5d0, 10) =", result_dp if (abs(result_dp - 1536.0d0) > 1e-12) error stop "Expected 1536.0" ! Test 6: Large negative scale x_dp = 1024.0d0 result_dp = ieee_scalb(x_dp, -10) print *, "ieee_scalb(1024.0d0, -10) =", result_dp if (abs(result_dp - 1.0d0) > 1e-12) error stop "Expected 1.0" ! Test 7: Zero should stay zero x_sp = 0.0 result_sp = ieee_scalb(x_sp, 5) print *, "ieee_scalb(0.0, 5) =", result_sp if (result_sp /= 0.0) error stop "Expected 0.0" print *, "All ieee_scalb tests passed!" end program test_ieee_scalb lfortran-0.63.0/integration_tests/format_37.f900000664000175000017500000000152115174404631021505 0ustar alastairalastairprogram format_37 implicit none character(len=100) :: output ! Test case 1: String and integer print "(*(g0,1x))", 'The answer is', 42 write(output, '(*(g0,1x))') 'The answer is', 42 print *, "Test 1: ", trim(output) if (trim(output) /= 'The answer is 42') error stop ! Test case 2: Multiple integers print "(*(g0,1x))", 43, 44, 45 write(output, '(*(g0,1x))') 43, 44, 45 print *, "Test 2: ", trim(output) if (trim(output) /= '43 44 45') error stop ! Test case 3: Mixed strings and integers pattern print "(*(g0,1x))", 'A', 'B', 10, 20, 'C', 'D', 30, 40 write(output, '(*(g0,1x))') 'A', 'B', 10, 20, 'C', 'D', 30, 40 print *, "Test 3: ", trim(output) if (trim(output) /= 'A B 10 20 C D 30 40') error stop print *, "All tests passed!" end program format_37 lfortran-0.63.0/integration_tests/modules_33_module2.f900000664000175000017500000000103115174404631023304 0ustar alastairalastairmodule fpm_model_modules_33 use fpm_dependency_modules_33, only: dependency_tree_t implicit none type :: fpm_model_t character(:), allocatable :: package_name character(:), allocatable :: fortran_compile_flags character(:), allocatable :: c_compile_flags character(:), allocatable :: cxx_compile_flags character(:), allocatable :: link_flags character(:), allocatable :: build_prefix type(dependency_tree_t) :: deps logical :: include_tests = .true. end type fpm_model_t end module fpm_model_modules_33 lfortran-0.63.0/integration_tests/intrinsics_406.f900000664000175000017500000000110515174404631022460 0ustar alastairalastairprogram intrinsics_iachar ! Test iachar intrinsic with array arguments (issue #9495) implicit none integer, parameter:: ch(2) = iachar(['A','a']) integer :: ch2(3) ! Test compile-time evaluation if (ch(1) /= 65) error stop if (ch(2) /= 97) error stop ! Test runtime evaluation ch2 = iachar(['X', 'y', 'Z']) if (ch2(1) /= 88) error stop ! 'X' if (ch2(2) /= 121) error stop ! 'y' if (ch2(3) /= 90) error stop ! 'Z' ! Test with scalar if (iachar('B') /= 66) error stop print *, "All iachar tests passed" end program lfortran-0.63.0/integration_tests/bindc_48_mod.f900000664000175000017500000000033715174404631022141 0ustar alastairalastairmodule bindc_48_mod use iso_c_binding, only: c_int implicit none integer(c_int), bind(c) :: a_bindc integer :: b_regular integer :: c_regular integer(c_int), bind(c) :: d_bindc integer :: e_regular end module lfortran-0.63.0/integration_tests/implied_do_loops23.f900000664000175000017500000000265415174404631023402 0ustar alastairalastair! Test: implied-do array constructor with elemental function on array args. ! The per-iteration element count must equal the size of each array argument, ! not 1. [(f(x(:,i)), i=1,N)] where size(x(:,i))=M should produce M*N elems. module implied_do_loops23_mod implicit none type :: result_t logical :: passed character(len=:), allocatable :: msg end type contains elemental function check(a, b) result(res) real, intent(in) :: a, b type(result_t) :: res res%passed = abs(a - b) <= 0.01 res%msg = "" end function end module program implied_do_loops23 use implied_do_loops23_mod implicit none type(result_t), allocatable :: diags(:) real :: a(2, 2), b(2, 2) real, allocatable :: c(:) integer :: i a = reshape([1.0, 2.0, 3.0, 4.0], [2, 2]) b = a ! --- elemental function returning derived type with allocatable component --- diags = [(check(a(:, i), b(:, i)), i = 1, 2)] if (size(diags) /= 4) error stop "diags: wrong size" do i = 1, 4 if (.not. diags(i)%passed) error stop "diags: check failed" end do ! --- plain array binop inside implied-do --- c = [(a(:, i) + b(:, i), i = 1, 2)] if (size(c) /= 4) error stop "c: wrong size" if (abs(c(1) - 2.0) > 1.0e-6) error stop "c(1)" if (abs(c(2) - 4.0) > 1.0e-6) error stop "c(2)" if (abs(c(3) - 6.0) > 1.0e-6) error stop "c(3)" if (abs(c(4) - 8.0) > 1.0e-6) error stop "c(4)" print *, "All tests passed." end program lfortran-0.63.0/integration_tests/expr_04.f900000664000175000017500000000030315174404631021162 0ustar alastairalastairprogram expr_04 implicit none integer :: x x = 2**4; if (x /= 16) error stop x = 2.**4; if (x /= 16) error stop x = 2**4.; if (x /= 16) error stop x = 2.**4.; if (x /= 16) error stop end program lfortran-0.63.0/integration_tests/random_init_02.f900000664000175000017500000000164415174404631022516 0ustar alastairalastairprogram random_init_02 implicit none integer, parameter :: num_trials = 10 integer :: i, n, num_differ integer, allocatable :: seeds(:), seeds2(:) integer :: first_seeds(num_trials) call random_seed(size=n) allocate(seeds(n), seeds2(n)) do i = 1, num_trials call random_init(.false., .false.) call random_seed(get=seeds) first_seeds(i) = seeds(1) end do num_differ = 0 do i = 2, num_trials if (first_seeds(i) /= first_seeds(1)) num_differ = num_differ + 1 end do if (num_differ == 0) error stop "non-repeatable random_init produced identical seeds across all trials" call random_init(.true., .false.) call random_seed(get=seeds) call random_init(.true., .false.) call random_seed(get=seeds2) do i = 1, n if (seeds(i) /= seeds2(i)) error stop "repeatable random_init produced different seeds" end do end program lfortran-0.63.0/integration_tests/derived_types_124.f900000664000175000017500000000314015174404631023137 0ustar alastairalastairmodule derived_types_124_mod implicit none type, abstract :: BaseType contains procedure(assign_iface), deferred :: assign_impl generic, public :: assignment(=) => assign_impl end type BaseType abstract interface subroutine assign_iface(self, other) import class(BaseType), intent(out) :: self class(BaseType), intent(in) :: other end subroutine assign_iface end interface type, extends(BaseType) :: ConcreteType integer :: val = 0 contains procedure :: assign_impl => concrete_assign end type ConcreteType contains subroutine concrete_assign(self, other) class(ConcreteType), intent(out) :: self class(BaseType), intent(in) :: other select type(other) type is (ConcreteType) self%val = other%val + 10 end select end subroutine concrete_assign subroutine test_polymorphic_assignment() class(BaseType), allocatable :: a, b allocate(ConcreteType :: a) allocate(ConcreteType :: b) select type(b) type is (ConcreteType) b%val = 5 end select a = b select type(a) type is (ConcreteType) print *, a%val if (a%val /= 15) error stop class default error stop end select end subroutine test_polymorphic_assignment end module derived_types_124_mod program derived_types_124 use derived_types_124_mod implicit none call test_polymorphic_assignment() print *, "PASS" end program derived_types_124 lfortran-0.63.0/integration_tests/bindc_01c.c0000664000175000017500000000044015174404631021251 0ustar alastairalastair#include #include #include "bindc_01c.h" void ret_ptr_c(void **p) { *p = malloc(sizeof(float)*12); } void print_ptr_c(int n, void *p) { float *a = p; printf("[ "); for (int i=0; i < n; i++) { printf("%f ", a[i]); } printf("]\n"); } lfortran-0.63.0/integration_tests/present_05.f900000664000175000017500000000260715174404631021676 0ustar alastairalastair! MRE: External procedure called multiple times in same subroutine ! This tests that interface creation for external procedures does not ! create duplicate symbols when the procedure is called multiple times. subroutine test_select(select_fn, n, wr, wi, result) implicit none logical, external :: select_fn integer, intent(in) :: n real, intent(in) :: wr(*), wi(*) real, intent(out) :: result(*) integer :: i logical :: flag ! First call to select_fn do i = 1, n result(i) = 0.0 if (select_fn(wr(i), wi(i))) then result(i) = 1.0 end if end do ! Second call to select_fn (same scope - must not create duplicate interface) do i = 1, n flag = select_fn(wr(i), wi(i)) if (flag) result(i) = result(i) + 1.0 end do end subroutine logical function my_select(x, y) implicit none real, intent(in) :: x, y my_select = x > 0.0 end function program test_present_05 implicit none real :: wr(3), wi(3), r(3) logical, external :: my_select wr = [1.0, -1.0, 2.0] wi = [0.0, 0.0, 0.0] call test_select(my_select, 3, wr, wi, r) ! Expected: r(1)=2.0 (selected twice), r(2)=0.0 (never selected), r(3)=2.0 (selected twice) if (abs(r(1) - 2.0) > 1e-6) error stop if (abs(r(2) - 0.0) > 1e-6) error stop if (abs(r(3) - 2.0) > 1e-6) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/data_09.f900000664000175000017500000000022515174404631021125 0ustar alastairalastairprogram data_09 integer vect(3350), i data vect /3350*2/ do i = 1, 3350 if (vect(i) /= 2) error stop end do end program lfortran-0.63.0/integration_tests/intrinsics_24.f900000664000175000017500000000133015174404631022374 0ustar alastairalastairprogram intrinsics_24 implicit none integer(4) :: count, rate, max integer(8) :: count_64, rate_64, max_64 call system_clock(count, rate, max) write(*,*) count ! writes current count write(*,*) rate ! writes count rate write(*,*) max ! writes maximum count possible write(*,*) real(count)/real(rate) ! current count in seconds call system_clock(count_64, rate_64, max_64) write(*,*) count_64 ! writes current count write(*,*) rate_64 ! writes count rate write(*,*) max_64 ! writes maximum count possible write(*,*) real(count_64)/real(rate_64) ! current count in seconds end program lfortran-0.63.0/integration_tests/associate_09.f900000664000175000017500000000145015174404631022170 0ustar alastairalastairprogram associate_09 implicit none print *, "working ok" contains subroutine add_sources_from_dir(sources,directory,scope,with_executables,recurse,error) integer, intent(inout) :: sources character(*), intent(in) :: directory integer, intent(in) :: scope logical, intent(in), optional :: with_executables logical, intent(in), optional :: recurse integer, intent(out) :: error end subroutine subroutine check() integer :: i, j, k, l i = 10 j = 120 k = 429 l = 23 do i=1,3 associate(s=>i) call add_sources_from_dir(l, "lib_dir", k, & error=j) end associate end do end subroutine end program associate_09 lfortran-0.63.0/integration_tests/types_18.f900000664000175000017500000000017415174404631021363 0ustar alastairalastairprogram types_18 type(real(kind=4)) :: x x = 3.14 print *, x if (abs(x - 3.14) > 1e-12) error stop end program lfortran-0.63.0/integration_tests/allocate_01.f900000664000175000017500000000504315174404631021773 0ustar alastairalastairprogram allocate_01 implicit none integer, allocatable :: a(:), e(:) real, allocatable :: b(:, :), f(:, :) complex, allocatable :: c(:, :, :), g(:, :, :) integer :: d(5) = [1, 2, 3, 4, 5] complex :: r integer :: n, ierr integer :: i, j, k n = 10 allocate(e, mold=d) if (size(e) /= 5) error stop allocate(a, mold=e) if (size(a) /= 5) error stop deallocate(a) allocate(b(2, 3)) allocate(f, mold=b) if (size(f, 1) /= 2 .or. size(f, 2) /= 3) error stop deallocate(b) allocate(c(2, 3, 4)) allocate(g, mold=c) if (size(g, 1) /= 2 .or. size(g, 2) /= 3 .or. size(g, 3) /= 4) error stop deallocate(c) allocate(a(5:n + 5)) allocate(b(n:2*n, n:3*n), stat=ierr) if( size(a) /= n + 1 ) error stop if( size(b) /= (n + 1)*(2*n + 1) ) error stop do i = lbound(a, 1), ubound(a, 1) a(i) = i end do do i = lbound(b, 1), ubound(b, 1) do j = lbound(b, 2), ubound(b, 2) b(i, j) = i + j end do end do call sum(a, b, c) if (lbound(c, 1) /= 5 .or. ubound(c, 1) /= n + 5) error stop if (lbound(c, 2) /= n .or. ubound(c, 2) /= 2 * n) error stop if (lbound(c, 3) /= n .or. ubound(c, 3) /= 3 * n) error stop do i = lbound(a, 1), ubound(a, 1) if (a(i) /= i) error stop end do do i = lbound(b, 1), ubound(b, 1) do j = lbound(b, 2), ubound(b, 2) if (b(i, j) /= i + j) error stop end do end do do i = lbound(c, 1), ubound(c, 1) do j = lbound(c, 2), ubound(c, 2) do k = lbound(c, 3), ubound(c, 3) if (c(i, j, k) /= i + j + k) error stop end do end do end do r = reduce_sum(c) if (r /= (114345.0, 0.0)) error stop contains subroutine sum(a, b, c) implicit none integer, allocatable, intent(in) :: a(:) real, allocatable, intent(in) :: b(:, :) complex, allocatable, intent(out) :: c(:, :, :) integer :: i, j, k complex, allocatable :: c_copy(:, :, :) allocate(c_copy(lbound(a, 1):ubound(a, 1), lbound(b, 1):ubound(b, 1), lbound(b, 2):ubound(b, 2))) allocate(c(lbound(a, 1):ubound(a, 1), lbound(b, 1):ubound(b, 1), lbound(b, 2):ubound(b, 2))) do i = lbound(a, 1), ubound(a, 1) do j = lbound(b, 1), ubound(b, 1) do k = lbound(b, 2), ubound(b, 2) c_copy(i, j, k) = a(i) + b(j, k) c(i, j, k) = a(i) + b(j, k) end do end do end do deallocate(c_copy) end subroutine sum complex function reduce_sum(c) result(r) implicit none complex, intent(in) :: c(:, :, :) integer :: i, j, k r = 0 do i = lbound(c, 1), ubound(c, 1) do j = lbound(c, 2), ubound(c, 2) do k = lbound(c, 3), ubound(c, 3) r = r + c(i, j, k) end do end do end do end function reduce_sum end lfortran-0.63.0/integration_tests/class_58.f900000664000175000017500000000066615174404631021336 0ustar alastairalastairmodule class_58_mod implicit none type :: mytype integer :: val end type mytype contains subroutine expect_class(x) class(mytype), intent(inout) :: x(:) x(1)%val = 7 end subroutine expect_class end module class_58_mod program class_58 use class_58_mod implicit none type(mytype), allocatable :: y(:) allocate(y(3)) y(1)%val = 5 call expect_class(y) if (y(1)%val /= 7) error stop end program class_58lfortran-0.63.0/integration_tests/array_section_12.f900000664000175000017500000000132715174404631023054 0ustar alastairalastairprogram array_section_12 use, intrinsic :: iso_fortran_env, only: wp => real64 implicit none real(wp) :: default_colors(3, 5) real(wp) :: plot_color(3) integer :: i do i = 1, 5 default_colors(:, i) = [real(i, wp), real(i + 10, wp), real(i + 20, wp)] end do call pick_color(default_colors, 4, plot_color) if (any(abs(plot_color - [4.0_wp, 14.0_wp, 24.0_wp]) > 1e-12_wp)) error stop print *, "PASS" contains subroutine pick_color(colors, idx, out_color) real(wp), intent(in) :: colors(:,:) integer, intent(in) :: idx real(wp), intent(out) :: out_color(3) out_color = colors(:, idx) end subroutine pick_color end program array_section_12 lfortran-0.63.0/integration_tests/class_61.f900000664000175000017500000000130315174404631021315 0ustar alastairalastairprogram class_61 implicit none type, abstract :: fpm_cmd_settings end type type, extends(fpm_cmd_settings) :: fpm_run_settings character(len=3), allocatable :: name(:) end type fpm_run_settings class(fpm_cmd_settings), allocatable :: settings character(len=3), allocatable :: arr(:) allocate(arr(3)) arr = ["abc", "def", "ghi"] allocate(fpm_run_settings :: settings) settings = fpm_run_settings(name=arr) select type(settings) type is (fpm_run_settings) if (settings%name(1) /= "abc") error stop if (settings%name(2) /= "def") error stop if (settings%name(3) /= "ghi") error stop class default error stop end select end program class_61lfortran-0.63.0/integration_tests/transfer_04.f900000664000175000017500000000157715174404631022046 0ustar alastairalastairmodule stdlib_hash_32bit_water_transfer_04 use iso_fortran_env, only: int16, int8, int32, int64 contains pure module function int8_water_hash( key ) result(hash_code) integer(int32) :: hash_code integer(int8), intent(in) :: key(:) hash_code = sum(key) end function int8_water_hash subroutine int16_water_hash( key ) integer(int16), intent(in) :: key(:) print *, transfer( key, 0_int8, size(key, kind=int64) ) print *, int8_water_hash( transfer( key, 0_int8, size(key, kind=int64) ) ) ! TODO: values diverge with GFortran, PR intends to fix code generation error end subroutine int16_water_hash end module stdlib_hash_32bit_water_transfer_04 program transfer_04 use stdlib_hash_32bit_water_transfer_04 integer(int16) :: key(10) key = 9 call int16_water_hash(key) end program lfortran-0.63.0/integration_tests/derived_types_49.f900000664000175000017500000000123515174404631023070 0ustar alastairalastairmodule derived_types_49_m implicit none public :: base, derived type, abstract :: base integer :: a end type base type, extends(base) :: derived integer :: b end type derived type, extends(derived) :: derived2 integer :: c integer :: d end type derived2 end module derived_types_49_m program derived_types_49 use derived_types_49_m implicit none type(derived2) :: set0, set1 set0 = derived2(10, 20, 30, 40) set1 = set0 if (set1%a /= set0%a) error stop if (set1%b /= set0%b) error stop if (set1%c /= set0%c) error stop if (set1%d /= set0%d) error stop end program derived_types_49 lfortran-0.63.0/integration_tests/associate_49.f900000664000175000017500000000100715174404631022172 0ustar alastairalastairprogram associate_49 implicit none type :: t integer, allocatable :: x end type type :: w_t type(t), pointer :: ptr => null() end type type(w_t) :: w allocate(w%ptr) w%ptr%x = 42 call run(w) deallocate(w%ptr) contains subroutine process(x) integer, optional, intent(in) :: x if (present(x)) then if (x /= 42) error stop end if end subroutine subroutine run(w) type(w_t), intent(inout) :: w associate(p => w%ptr) call process(p%x) end associate end subroutine end program lfortran-0.63.0/integration_tests/arithmetic_if_04.f900000664000175000017500000000152315174404631023020 0ustar alastairalastairprogram arithmetic_if_04 integer, parameter :: dp = kind(0.d0) real(dp) :: x integer :: c ! Singleline x = -3 c = 0 if (x) 1, 2, 3 1 c = c + 1 2 c = c + 2 3 c = c + 4 print *, c if (c /= 7) error stop x = 0 c = 0 if (x) 4, 5, 6 4 c = c + 1 5 c = c + 2 6 c = c + 4 print *, c if (c /= 6) error stop x = 7 c = 0 if (x) 7, 8, 9 7 c = c + 1 8 c = c + 2 9 c = c + 4 print *, c if (c /= 4) error stop ! Multiline x = -3 c = 0 if (x) 11, 12, 13 11 c = c + 1 c = c + 100 12 c = c + 2 c = c + 200 13 c = c + 4 c = c + 400 print *, c if (c /= 707) error stop x = 0 c = 0 if (x) 14, 15, 16 14 c = c + 1 c = c + 100 15 c = c + 2 c = c + 200 16 c = c + 4 c = c + 400 print *, c if (c /= 606) error stop x = 7 c = 0 if (x) 17, 18, 19 17 c = c + 1 c = c + 100 18 c = c + 2 c = c + 200 19 c = c + 4 c = c + 400 print *, c if (c /= 404) error stop end program lfortran-0.63.0/integration_tests/equivalence_30.f900000664000175000017500000000061615174404631022513 0ustar alastairalastairmodule mre_verify implicit none private integer, save, public :: unit_test_level = 5 public :: unit_check_level integer :: unit_check_level equivalence (unit_test_level, unit_check_level) end module mre_verify program equivalence_30 use mre_verify, only : unit_test_level implicit none print *, unit_test_level if (unit_test_level /= 5) error stop end program equivalence_30 lfortran-0.63.0/integration_tests/submodule_12.f900000664000175000017500000000071715174404631022213 0ustar alastairalastairmodule submodule_12_m implicit none interface submodule_12_m_i pure module function Func() result(format_string) character(len=:), allocatable :: format_string end function end interface end module submodule_12_m submodule(submodule_12_m) submodule_12_s implicit none contains module procedure Func end procedure end submodule submodule_12_s program submodule_12 use submodule_12_m implicit none end program submodule_12 lfortran-0.63.0/integration_tests/operator_overloading_28.f900000664000175000017500000000171715174404631024450 0ustar alastairalastairmodule module_operator_overloading_28 implicit none private public :: string_t type string_t character(len=:), allocatable :: s contains generic :: operator(==) => string_eq_string procedure, private :: string_eq_string procedure :: bracket end type contains elemental function string_eq_string(lhs, rhs) result(res) class(string_t), intent(in) :: lhs type(string_t), intent(in) :: rhs logical :: res res = lhs%s == rhs%s end function elemental function bracket(self) result(res) class(string_t), intent(in) :: self type(string_t) :: res res%s = "[" // self%s // "]" end function end module program operator_overloading_28 use module_operator_overloading_28, only : string_t implicit none type(string_t) :: arr(2), expected(2) arr(1)%s = "ab" arr(2)%s = "cd" expected(1)%s = "[ab]" expected(2)%s = "[cd]" if (.not. all(arr%bracket() == expected)) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/list_test_01.f900000664000175000017500000000442115174404631022220 0ustar alastairalastairprogram lp_list_test_01 implicit none integer :: x real :: eps = 1e-6 _lfortran_list(integer) :: test_list call _lfortran_list_append(test_list, 1) call _lfortran_list_append(test_list, 10) x = _lfortran_len(test_list) if (x /= 2) error stop if (_lfortran_get_item(test_list, 1) /= 10) error stop test_list = _lfortran_list_constant(1, 2, 3, 4) if (_lfortran_get_item(test_list, 1) /= 2) error stop if (_lfortran_get_item(test_list, 2) /= 3) error stop if (_lfortran_len(test_list) /= 4) error stop call _lfortran_set_item(test_list, 0, 10) if (_lfortran_get_item(test_list, 0) /= 10) error stop call _lfortran_list_append(test_list, -50) if (_lfortran_len(test_list) /= 5) error stop call _lfortran_list_reverse(test_list) if (_lfortran_len(test_list) /= 5) error stop if (_lfortran_get_item(test_list, 0) /= -50) error stop if (_lfortran_get_item(test_list, 3) /= 2) error stop if (_lfortran_get_item(test_list, 4) /= 10) error stop call _lfortran_list_append(test_list, 1) call _lfortran_list_append(test_list, 1) if (_lfortran_list_count(test_list, 1) /= 2) error stop if (_lfortran_list_count(test_list, -50) /= 1) error stop test_list = _lfortran_concat(test_list, _lfortran_list_constant(1, 1, 1, 2)) if (_lfortran_len(test_list) /= 11) error stop if (_lfortran_pop(test_list, 0) /= -50) error stop if (_lfortran_len(test_list) /= 10) error stop type(_lfortran_list(real(4))) :: test_list_r = _lfortran_list_constant(1.0, 2.0, 3.0, 4.0) if (_lfortran_len(test_list_r) /= 4) error stop call _lfortran_list_append(test_list_r, 1.11) call _lfortran_list_append(test_list_r, -10.12) call _lfortran_list_append(test_list_r, 12.0) call _lfortran_list_append(test_list_r, -111.0) call _lfortran_list_append(test_list_r, -110.12) if (_lfortran_len(test_list_r) /= 9) error stop if (abs(_lfortran_get_item(test_list_r, 5) + 10.12) > eps) error stop if (abs(_lfortran_get_item(test_list_r, 6) - 12.0) > eps) error stop call _lfortran_set_item(test_list_r, 3, 1212.33) if (abs(_lfortran_get_item(test_list_r, 3) - 1212.33) > eps) error stop type(_lfortran_list(real)) :: test_list_r1 if (_lfortran_len(test_list_r1) /= 0) error stop ! Add other intrinsics later end program lfortran-0.63.0/integration_tests/test_ieee_logb.f900000664000175000017500000000502315174404631022656 0ustar alastairalastair! Test ieee_logb function (IEEE unbiased exponent) program ieee_logb_01 use, intrinsic :: ieee_arithmetic, only: ieee_logb, ieee_is_finite implicit none real(4) :: x_sp, logb_sp real(8) :: x_dp, logb_dp print *, "Testing ieee_logb..." ! Test 1: logb(1.0) should be 0 x_sp = 1.0 logb_sp = ieee_logb(x_sp) print *, "ieee_logb(1.0) =", logb_sp if (abs(logb_sp) > 1e-6) error stop "logb(1.0) should be 0" ! Test 2: logb(2.0) should be 1 x_sp = 2.0 logb_sp = ieee_logb(x_sp) print *, "ieee_logb(2.0) =", logb_sp if (abs(logb_sp - 1.0) > 1e-6) error stop "logb(2.0) should be 1" ! Test 3: logb(4.0) should be 2 x_sp = 4.0 logb_sp = ieee_logb(x_sp) print *, "ieee_logb(4.0) =", logb_sp if (abs(logb_sp - 2.0) > 1e-6) error stop "logb(4.0) should be 2" ! Test 4: logb(0.5) should be -1 x_sp = 0.5 logb_sp = ieee_logb(x_sp) print *, "ieee_logb(0.5) =", logb_sp if (abs(logb_sp + 1.0) > 1e-6) error stop "logb(0.5) should be -1" ! Test 5: logb should be independent of sign x_sp = -8.0 logb_sp = ieee_logb(x_sp) print *, "ieee_logb(-8.0) =", logb_sp if (abs(logb_sp - 3.0) > 1e-6) error stop "logb(-8.0) should be 3" ! Test 6: For any normal number, logb relates to exponent x_sp = 3.0 ! 3.0 = 1.5 * 2^1 logb_sp = ieee_logb(x_sp) print *, "ieee_logb(3.0) =", logb_sp if (abs(logb_sp - 1.0) > 1e-6) error stop "logb(3.0) should be 1" ! Test 7: Double precision x_dp = 16.0d0 logb_dp = ieee_logb(x_dp) print *, "ieee_logb(16.0d0) =", logb_dp if (abs(logb_dp - 4.0d0) > 1e-10) error stop "logb(16.0) should be 4" ! Test 8: Large number x_sp = 1024.0 logb_sp = ieee_logb(x_sp) print *, "ieee_logb(1024.0) =", logb_sp if (abs(logb_sp - 10.0) > 1e-6) error stop "logb(1024.0) should be 10" ! Test 9: Relationship with exponent intrinsic x_sp = 100.0 logb_sp = ieee_logb(x_sp) print *, "ieee_logb(100.0) =", logb_sp print *, "exponent(100.0) =", exponent(x_sp) ! logb(x) should equal exponent(x) - 1 for normal numbers if (abs(logb_sp - real(exponent(x_sp) - 1)) > 1e-6) then error stop "logb should match exponent - 1" end if ! Test 10: For values between 1 and 2, logb should be 0 x_sp = 1.5 logb_sp = ieee_logb(x_sp) print *, "ieee_logb(1.5) =", logb_sp if (abs(logb_sp) > 1e-6) error stop "logb(1.5) should be 0" print *, "All ieee_logb tests passed!" end program ieee_logb_01 lfortran-0.63.0/integration_tests/file_22.f900000664000175000017500000000025115174404631021125 0ustar alastairalastairprogram file_22 integer :: filesize inquire(file="file_22_data.txt", size=filesize) print *, filesize if (filesize /= 13) error stop end program file_22lfortran-0.63.0/integration_tests/read_04.f900000664000175000017500000000064315174404631021126 0ustar alastairalastairprogram read_04 integer :: unit, cc, stat character(len=4000) :: buffer open(newunit=unit, status="scratch") write(unit, "(a)") "abc" rewind(unit) read(unit,"(a)", advance='no',iostat=stat, size=cc) buffer print *, cc if(cc /= 3) error stop read(unit,"(a)", advance='no',iostat=stat, size=cc) buffer print *, cc if(cc /= 0) error stop close(unit) end programlfortran-0.63.0/integration_tests/present_02.f900000664000175000017500000000136315174404631021671 0ustar alastairalastairprogram present_02 implicit none type X integer :: stat = 77 end type type(X), allocatable :: objx print *, allocated(objx) if( allocated(objx) ) error stop call f(objx) contains subroutine f(obj) type(X), allocatable, optional, intent(in) :: obj print *, present(obj) if( .not. present(obj) ) error stop call g(obj) end subroutine subroutine g(obj1) type(X), optional, intent(in), allocatable :: obj1 print *, present(obj1) if( .not. present(obj1) ) error stop call h(obj1) end subroutine subroutine h(obj2) type(X), intent(in), optional :: obj2 print *, present(obj2) if( present(obj2) ) error stop end subroutine end program lfortran-0.63.0/integration_tests/warning_logicalstar.f900000664000175000017500000000007215174404631023735 0ustar alastairalastairprogram warning_logicalstar logical*4 :: x end programlfortran-0.63.0/integration_tests/arrays_46.f900000664000175000017500000000103715174404631021520 0ustar alastairalastairmodule module_arrays_46 integer :: nx = 4 integer :: ny = 4 end module module_arrays_46 subroutine a(cs) use module_arrays_46 real, dimension(nx), intent(in) :: cs print *, cs if (abs(sum(cs) - 10.0) > 1e-8) error stop end subroutine subroutine b(cs) use module_arrays_46 real, dimension(nx, ny), intent(in) :: cs print *, sum(cs) if (abs(sum(cs) - 205.919983) > 1e-8) error stop end subroutine program arrays_46 real, dimension(4) :: cs real, dimension(4, 4) :: cs2 cs = [1.0, 2.0, 3.0, 4.0] cs2 = 12.87 call a(cs) call b(cs2) end program lfortran-0.63.0/integration_tests/gpu_metal_51.f900000664000175000017500000000050415174404631022166 0ustar alastairalastairprogram gpu_metal_51 ! Test: do concurrent inside nested block accessing outer block variable implicit none integer :: i real :: x(10) block real :: y(10) block do concurrent (i = 1:10) y(i) = real(i) end do end block x = y end block if (abs(sum(x) - 55.0) > 1e-6) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/implicit_interface_12.f900000664000175000017500000000042215174404631024037 0ustar alastairalastairmodule implicit_interface_12_module contains function f() implicit integer(8) (f) f = 1 end function f end program main use implicit_interface_12_module integer(8) :: i i = f() if (i /= 1) error stop print *, i end program main lfortran-0.63.0/integration_tests/class_122.f900000664000175000017500000000133315174404631021376 0ustar alastairalastairmodule class_122_mod implicit none type :: parent_t integer :: val contains procedure, non_overridable :: get_val_impl end type type, extends(parent_t) :: child_t contains generic :: get_val => get_val_impl end type contains function get_val_impl(self) result(v) class(parent_t), intent(in) :: self integer :: v v = self%val end function subroutine test_sub(obj) class(child_t), intent(in) :: obj integer :: v v = obj%get_val_impl() print *, v if (v /= 42) error stop end subroutine end module class_122_mod program class_122 use class_122_mod type(child_t) :: c c%val = 42 call test_sub(c) end program class_122 lfortran-0.63.0/integration_tests/interface_01.f900000664000175000017500000000102215174404631022140 0ustar alastairalastairmodule interface_01_mod implicit none interface a module procedure a1 module procedure a2 end interface contains subroutine a1(a) integer, intent(inout) :: a a = a + 1 end subroutine subroutine a2(a) real, intent(in out) :: a a = a + 1 end subroutine end module program interface_01 use interface_01_mod, only: a implicit none integer :: i real :: r i = 5 call a(i) if (i /= 6) error stop r = 6 call a(r) if (r /= 7) error stop i = 7 call a(i) if (i /= 8) error stop end program lfortran-0.63.0/integration_tests/ilp64_kind_arg_01.f900000664000175000017500000000070515174404631023003 0ustar alastairalastairprogram ilp64_kind_arg_01 use, intrinsic :: iso_fortran_env, only: real32 implicit none integer, parameter :: WP = real32 complex(kind=WP) :: c real(kind=WP) :: r integer(4) :: exit_code r = 1.0_WP c = cmplx(r, 0.0_WP, kind=WP) exit_code = 0 if (abs(real(c) - 1.0_WP) > 0.001_WP) exit_code = 1 if (abs(aimag(c)) > 0.001_WP) exit_code = 2 if (exit_code /= 0) stop exit_code print *, "PASS" end program lfortran-0.63.0/integration_tests/intrinsics_296.f900000664000175000017500000001053515174404631022476 0ustar alastairalastairprogram intrinsic_296 implicit none integer(1), parameter :: x1 = storage_size(3_1, 1) integer(2), parameter :: x2 = storage_size(11_2, 2) integer(4), parameter :: x3 = storage_size(17_4, 4) integer(8), parameter :: x4 = storage_size(19_8, 8) integer, parameter :: x5 = storage_size(3.0) integer(8), parameter :: x6 = storage_size(3.0_8, 8) integer, parameter :: x7 = storage_size((3.0, 13.0)) integer(8), parameter :: x8 = storage_size((3.0_8, 13.0_8), 8) integer, parameter :: x9 = storage_size(.true.) integer(1), parameter :: x10 = storage_size("hello") integer(2), parameter :: x11 = storage_size("hello", 8) integer(4), parameter :: ar1 = storage_size([0, 112, 17], 4) integer(8), parameter :: ar2 = storage_size([1, 11, 17], 8) integer, parameter :: ar3 = storage_size([1.0, 11.0, 17.0]) integer(8), parameter :: ar4 = storage_size([1.0_8, 11.0_8, 17.0_8], 8) integer, parameter :: ar5 = storage_size([.true., .false., .true.]) integer(1), parameter :: ar6 = storage_size(["hello", "world", "hello"]) integer(2), parameter :: ar7 = storage_size(["hello", "world", "hello"], 2) integer, parameter :: ar8 = storage_size([(3.0, 13.0), (3.0, 13.0), (3.0, 13.0)]) integer(8), parameter :: ar9 = storage_size([(3.0_8, 13.0_8), (3.0_8, 13.0_8), (3.0_8, 13.0_8)], 8) integer(1) :: i1 = 3 integer(2) :: i2 = 3 integer(4) :: i3 = 3 integer(8) :: i4 = 3 real :: r1 = 313.0 real(8) :: r2 = 313.0_8 complex :: c1 = (3.0, 13.0) complex(8) :: c2 = (3.0_8, 13.0_8) logical :: l1 = .true. character(1) :: s1 = 'hello' integer :: arr1(3) = [0, 112, 17] integer(8) :: arr2(3) = [1_8, 11_8, 17_8] real :: arr3(3) = [1.0, 11.0, 17.0] real(8) :: arr4(3) = [1.0_8, 11.0_8, 17.0_8] logical :: arr5(3) = [.true., .false., .true.] complex :: arr6(3) = [(3.0, 13.0), (3.0, 13.0), (3.0, 13.0)] complex(8) :: arr7(3) = [(3.0_8, 13.0_8), (3.0_8, 13.0_8), (3.0_8, 13.0_8)] character(5) :: arr8(3) = ["hello", "world", "hello"] print *, x1 if (x1 /= 8) error stop print *, x2 if (x2 /= 16) error stop print *, x3 if (x3 /= 32) error stop print *, x4 if (x4 /= 64) error stop print *, x5 if (x5 /= 32) error stop print *, x6 if (x6 /= 64) error stop print *, x7 if (x7 /= 64) error stop print *, x8 if (x8 /= 128) error stop print *, x9 if (x9 /= 32) error stop print *, x10 if (x10 /= 40) error stop print *, x11 if (x11 /= 40) error stop print *, ar1 if (ar1 /= 32) error stop print *, ar2 if (ar2 /= 32) error stop print *, ar3 if (ar3 /= 32) error stop print *, ar4 if (ar4 /= 64) error stop print *, ar5 if (ar5 /= 32) error stop print *, ar6 if (ar6 /= 40) error stop print *, ar7 if (ar7 /= 40) error stop print *, ar8 if (ar8 /= 64) error stop print *, ar9 if (ar9 /= 128) error stop print *, storage_size(i1) if (storage_size(i1) /= 8) error stop print *, storage_size(i2) if (storage_size(i2) /= 16) error stop print *, storage_size(i3) if (storage_size(i3) /= 32) error stop print *, storage_size(i4) if (storage_size(i4) /= 64) error stop print *, storage_size(r1) if (storage_size(r1) /= 32) error stop print *, storage_size(r2) if (storage_size(r2) /= 64) error stop print *, storage_size(c1) if (storage_size(c1) /= 64) error stop print *, storage_size(c2) if (storage_size(c2) /= 128) error stop print *, storage_size(l1) if (storage_size(l1) /= 32) error stop print *, storage_size(s1) if (storage_size(s1) /= 8) error stop print *, storage_size(arr1) if (storage_size(arr1) /= 32) error stop print *, storage_size(arr2) if (storage_size(arr2) /= 64) error stop print *, storage_size(arr3) if (storage_size(arr3) /= 32) error stop print *, storage_size(arr4) if (storage_size(arr4) /= 64) error stop print *, storage_size(arr5) if (storage_size(arr5) /= 32) error stop print *, storage_size(arr6) if (storage_size(arr6) /= 64) error stop print *, storage_size(arr7) if (storage_size(arr7) /= 128) error stop print *, storage_size(arr8) if (storage_size(arr8) /= 40) error stop print*, kind(storage_size(arr8, 8)) if (kind(storage_size(arr8, 8)) /= 8) error stop end programlfortran-0.63.0/integration_tests/print_13.f900000664000175000017500000000073215174404631021346 0ustar alastairalastairprogram print_13 implicit none integer, parameter :: sp = selected_real_kind(6) complex(sp) :: c character(len=:), allocatable :: s c = (109.0_sp, 20.0_sp) s = to_string_c_sp(c) if (len(s) /= 0) error stop print *, to_string_c_sp(c) contains function to_string_c_sp(value) result(string) complex(sp), intent(in) :: value character(len=:), allocatable :: string end function to_string_c_sp end program print_13 lfortran-0.63.0/integration_tests/implicit_interface_14.f900000664000175000017500000000020615174404631024041 0ustar alastairalastairprogram main implicit type(foo)(a-z) type foo integer x, y end type z = foo(42, 1) print *, z%x, z%y end lfortran-0.63.0/integration_tests/where_01.f900000664000175000017500000000074715174404631021327 0ustar alastairalastairprogram where_01 implicit none integer :: a(10), b(10), i a = -2 a(1) = 1 a(5) = 8 b = -3 where (a >= 0) b = 1 else where b = 0 end where where (a >= 0) b = 1 elsewhere b = 0 end where where (a >= 0) b = 1 elsewhere b = 0 endwhere if (abs(b(1) - 1) > 1e-6) error stop if (abs(b(5) - 1) > 1e-6) error stop do i = 2, 4 if (abs(b(i) - 0) > 1e-6) error stop end do do i = 6, 10 if (abs(b(i) - 0) > 1e-6) error stop end do print *, b print *, a end program lfortran-0.63.0/integration_tests/implicit_interface_36.f900000664000175000017500000000124315174404631024047 0ustar alastairalastairprogram implicit_interface_36 implicit none external :: x real :: x integer :: i real :: a(10) a = [(i + 0.5, i = 1, 10)] call sub_assumed(x, a) call sub_fixed(x, a) end program implicit_interface_36 subroutine sub_assumed(F, Y) real F, FB real Y(*) ! Previously caused ICE FB = F(Y) if (abs(FB - 60.0) > 0.0001) then error stop "assumed-size array argument failed" end if end subroutine subroutine sub_fixed(F, Y) real F, FB real Y(10) FB = F(Y) if (abs(FB - 60.0) > 0.0001) then error stop "fixed-size array argument failed" end if end subroutine real function x(a) real :: a(10) x = sum(a) end function lfortran-0.63.0/integration_tests/elemental_03.f900000664000175000017500000000106715174404631022161 0ustar alastairalastairprogram elemental_03 real :: x(2) = [1, 2], y(2) = [1.0, 2.1] logical :: close(2) close = is_close(x, y, 1e-9) print *, close if (.not. close(1)) error stop if (close(2)) error stop close = is_close(x, y) print *, close if (.not. close(1)) error stop if (close(2)) error stop contains elemental logical function is_close(a, b, rel_tol) result(close) real, intent(in) :: a, b real, intent(in), optional :: rel_tol if (present(rel_tol)) then close = abs(a - b) <= rel_tol else close = abs(a - b) <= 1e-9 end if end function is_close end program elemental_03 lfortran-0.63.0/integration_tests/array_section_is_non_allocatable.f900000664000175000017500000000116715174404631026444 0ustar alastairalastairPROGRAM array_section_is_non_allocatable IMPLICIT NONE REAL, ALLOCATABLE, DIMENSION(:, :) :: fixup_counter INTEGER, PARAMETER :: x = 1 allocate( fixup_counter(4, 2) ) fixup_counter = 19.45 CALL dim1_sweep ( fixup_counter (:, 1) ) CONTAINS SUBROUTINE dim1_sweep ( fixup_counter ) REAL, DIMENSION(4), INTENT(INOUT) :: fixup_counter PRINT *, SIZE(fixup_counter) if (size(fixup_counter) /= 4) error stop print *, sum(fixup_counter) if (abs(sum(fixup_counter) - 77.8) > 1e-8) error stop END SUBROUTINE dim1_sweep END PROGRAM array_section_is_non_allocatable lfortran-0.63.0/integration_tests/common_02.f900000664000175000017500000000026315174404631021477 0ustar alastairalastairprogram main integer :: a, b, c, d, e, g, h, i, j, k common / block_1 / a, b, h, / block_2 / c, d, / block_3 / e, g common / block_4 / i, / block_5 / j, k end program lfortran-0.63.0/integration_tests/matmul_02.f900000664000175000017500000001537315174404631021516 0ustar alastairalastair! This test is testing the code from: ! https://github.com/lfortran/lfortran/issues/2444 module cpu_matmul_02 implicit none contains subroutine matmul1(A, B, C) real, intent(in) :: A(:,:), B(:,:) real, intent(out) :: C(:,:) integer :: n integer :: i, j, k n = size(A, 1) C = 0 do j = 1, n do k = 1, n do i = 1, n C(i,j) = C(i,j) + A(i,k)*B(k,j) end do end do end do end subroutine subroutine kernel6(A, B, C, x, y, i1, s1) real, intent(in) :: A(0:,0:), B(0:,0:) real, intent(out) :: C(0:,0:) integer, intent(in) :: x, y, i1, s1 integer :: k real :: u(0:6-1,0:16-1) ! SIMD real, dimension(0:8-1) :: A0, A1, A2, A3, A4, A5 ! SIMD ! This function computes: !C(x:x+6-1, y:y+16-1) = C(x:x+6-1, y:y+16-1) + matmul( & ! A(x:x+6-1, i1:i1+s1-1), & ! B(i1:i1+s1-1, y:y+16-1) ) u(0,0*8:0*8+8-1) = C(x+0,y+0*8:y+0*8+8-1) u(0,1*8:1*8+8-1) = C(x+0,y+1*8:y+1*8+8-1) u(1,0*8:0*8+8-1) = C(x+1,y+0*8:y+0*8+8-1) u(1,1*8:1*8+8-1) = C(x+1,y+1*8:y+1*8+8-1) u(2,0*8:0*8+8-1) = C(x+2,y+0*8:y+0*8+8-1) u(2,1*8:1*8+8-1) = C(x+2,y+1*8:y+1*8+8-1) u(3,0*8:0*8+8-1) = C(x+3,y+0*8:y+0*8+8-1) u(3,1*8:1*8+8-1) = C(x+3,y+1*8:y+1*8+8-1) u(4,0*8:0*8+8-1) = C(x+4,y+0*8:y+0*8+8-1) u(4,1*8:1*8+8-1) = C(x+4,y+1*8:y+1*8+8-1) u(5,0*8:0*8+8-1) = C(x+5,y+0*8:y+0*8+8-1) u(5,1*8:1*8+8-1) = C(x+5,y+1*8:y+1*8+8-1) do k = i1, i1+s1-1 A0(:) = A(x+0,k) u(0, 0*8:0*8+8-1) = u(0, 0*8:0*8+8-1) + & A0(:) * B(k, y+0*8:y+0*8+8-1) u(0, 1*8:1*8+8-1) = u(0, 1*8:1*8+8-1) + & A0(:) * B(k, y+1*8:y+1*8+8-1) A1(:) = A(x+1,k) u(1, 0*8:0*8+8-1) = u(1, 0*8:0*8+8-1) + & A1(:) * B(k, y+0*8:y+0*8+8-1) u(1, 1*8:1*8+8-1) = u(1, 1*8:1*8+8-1) + & A1(:) * B(k, y+1*8:y+1*8+8-1) A2(:) = A(x+2,k) u(2, 0*8:0*8+8-1) = u(2, 0*8:0*8+8-1) + & A2(:) * B(k, y+0*8:y+0*8+8-1) u(2, 1*8:1*8+8-1) = u(2, 1*8:1*8+8-1) + & A2(:) * B(k, y+1*8:y+1*8+8-1) A3(:) = A(x+3,k) u(3, 0*8:0*8+8-1) = u(3, 0*8:0*8+8-1) + & A3(:) * B(k, y+0*8:y+0*8+8-1) u(3, 1*8:1*8+8-1) = u(3, 1*8:1*8+8-1) + & A3(:) * B(k, y+1*8:y+1*8+8-1) A4(:) = A(x+4,k) u(4, 0*8:0*8+8-1) = u(4, 0*8:0*8+8-1) + & A4(:) * B(k, y+0*8:y+0*8+8-1) u(4, 1*8:1*8+8-1) = u(4, 1*8:1*8+8-1) + & A4(:) * B(k, y+1*8:y+1*8+8-1) A5(:) = A(x+5,k) u(5, 0*8:0*8+8-1) = u(5, 0*8:0*8+8-1) + & A5(:) * B(k, y+0*8:y+0*8+8-1) u(5, 1*8:1*8+8-1) = u(5, 1*8:1*8+8-1) + & A5(:) * B(k, y+1*8:y+1*8+8-1) end do C(x+0,y+0*8:y+0*8+8-1) = u(0,0*8:0*8+8-1) C(x+0,y+1*8:y+1*8+8-1) = u(0,1*8:1*8+8-1) C(x+1,y+0*8:y+0*8+8-1) = u(1,0*8:0*8+8-1) C(x+1,y+1*8:y+1*8+8-1) = u(1,1*8:1*8+8-1) C(x+2,y+0*8:y+0*8+8-1) = u(2,0*8:0*8+8-1) C(x+2,y+1*8:y+1*8+8-1) = u(2,1*8:1*8+8-1) C(x+3,y+0*8:y+0*8+8-1) = u(3,0*8:0*8+8-1) C(x+3,y+1*8:y+1*8+8-1) = u(3,1*8:1*8+8-1) C(x+4,y+0*8:y+0*8+8-1) = u(4,0*8:0*8+8-1) C(x+4,y+1*8:y+1*8+8-1) = u(4,1*8:1*8+8-1) C(x+5,y+0*8:y+0*8+8-1) = u(5,0*8:0*8+8-1) C(x+5,y+1*8:y+1*8+8-1) = u(5,1*8:1*8+8-1) end subroutine subroutine kernel7(A, B, C, x, y, i1, s1) real, intent(in) :: A(0:,0:), B(0:,0:) real, intent(out) :: C(0:,0:) integer, intent(in) :: x, y, i1, s1 integer :: i, j, k real :: u(0:6-1,0:16-1) ! SIMD real :: Ai(0:8-1) ! SIMD ! This function computes: !C(x:x+6-1, y:y+16-1) = C(x:x+6-1, y:y+16-1) + matmul( & ! A(x:x+6-1, i1:i1+s1-1), & ! B(i1:i1+s1-1, y:y+16-1) ) do i = 0, 6-1 do j = 0, 2-1 u(i,j*8:j*8+8-1) = C(x+i,y+j*8:y+j*8+8-1) end do end do do k = i1, i1+s1-1 do i = 0, 6-1 Ai(:) = A(x+i,k) do j = 0, 2-1 u(i, j*8:j*8+8-1) = u(i, j*8:j*8+8-1) + & Ai(:) * B(k, y+j*8:y+j*8+8-1) end do end do end do do i = 0, 6-1 do j = 0, 2-1 C(x+i,y+j*8:y+j*8+8-1) = u(i,j*8:j*8+8-1) end do end do end subroutine subroutine matmul7(A, B, C) real, intent(in) :: A(:,:), B(:,:) real, intent(out) :: C(:,:) integer :: s1, s2, s3, n integer :: i1, i2, i3, x, y n = size(A, 1) ! Use the commented out numbers for a good benchmark s3 = 48 ! 64 s2 = 12 ! 120 s1 = 24 ! 240 C = 0 do i3 = 0, n-1, s3 do i2 = 0, n-1, s2 do i1 = 0, n-1, s1 do x = i2, i2+s2-1, 6 do y = i3, i3+s3-1, 16 call kernel6(A, B, C, x, y, i1, s1) end do end do end do end do end do end subroutine end module program main use cpu_matmul_02, only: matmul1, matmul7 implicit none integer, parameter :: dp = kind(0.d0) integer :: n, iter, i real(dp) :: t1, t2, t, GHz, fma_clock, freq, measured, percent_peak real, allocatable :: A(:,:), B(:,:), C(:,:), C2(:,:) real :: err ! Use n=960 for a good benchmark n = 96 iter = 1 print *, "Size (n x n): n =", n print *, "Iter =", iter print *, "Size MB:", 4._dp*n*n/1024**2 allocate(A(n,n), B(n,n), C(n,n), C2(n,n)) call random_number(A) call random_number(B) print *, "Fortran intrinsic matmul:" call cpu_time(t1) do i = 1, iter C = matmul(A, B) end do call cpu_time(t2) t = (t2-t1)/iter GHz = 1e9_dp fma_clock = 0.0625_dp freq = 3.2_dp*GHz measured = t * freq / n**3 percent_peak = fma_clock / measured * 100 print *, "Time: ", t print *, "Clock cycles per element:" print *, "Theoretical performance peak:", fma_clock, "cycles" print *, "Measured: ", measured, "cycles" print *, "Percent peak: ", percent_peak, "%" print * print *, "matmul7:" call cpu_time(t1) do i = 1, iter call matmul7(A, B, C2) end do call cpu_time(t2) err = maxval(abs(C-C2)) print *, "Error:", err t = (t2-t1)/iter GHz = 1e9_dp fma_clock = 0.0625_dp freq = 3.2_dp*GHz measured = t * freq / n**3 percent_peak = fma_clock / measured * 100 print *, "Time: ", t print *, "Clock cycles per element:" print *, "Theoretical performance peak:", fma_clock, "cycles" print *, "Measured: ", measured, "cycles" print *, "Percent peak: ", percent_peak, "%" if (err > 1e-4) error stop print * print *, "matmul1:" call cpu_time(t1) do i = 1, iter call matmul1(A, B, C2) end do call cpu_time(t2) err = maxval(abs(C-C2)) print *, "Error:", err t = (t2-t1)/iter GHz = 1e9_dp fma_clock = 0.0625_dp freq = 3.2_dp*GHz measured = t * freq / n**3 percent_peak = fma_clock / measured * 100 print *, "Time: ", t print *, "Clock cycles per element:" print *, "Theoretical performance peak:", fma_clock, "cycles" print *, "Measured: ", measured, "cycles" print *, "Percent peak: ", percent_peak, "%" if (err > 1e-4) error stop end program lfortran-0.63.0/integration_tests/read_69.f900000664000175000017500000000216515174404631021142 0ustar alastairalastairprogram read_69 implicit none integer :: a, b, c, ios character(256) :: msg ! Test 1: comma-separated integers on one line open(10, file='read_69_test.txt', status='replace') write(10, '(A)') '1,2' close(10) open(10, file='read_69_test.txt', status='old') read(10, *, iostat=ios, iomsg=msg) a, b close(10) if (ios /= 0) error stop if (a /= 1) error stop if (b /= 2) error stop ! Test 2: comma with spaces open(10, file='read_69_test.txt', status='replace') write(10, '(A)') '10 , 20 , 30' close(10) open(10, file='read_69_test.txt', status='old') read(10, *, iostat=ios, iomsg=msg) a, b, c close(10) if (ios /= 0) error stop if (a /= 10) error stop if (b /= 20) error stop if (c /= 30) error stop ! Test 3: comma-separated on multiple reads open(10, file='read_69_test.txt', status='replace') write(10, '(A)') '100,200' write(10, '(A)') '300' close(10) open(10, file='read_69_test.txt', status='old') read(10, *) a, b read(10, *) c close(10) if (a /= 100) error stop if (b /= 200) error stop if (c /= 300) error stop ! Cleanup open(10, file='read_69_test.txt', status='old') close(10, status='delete') print *, "PASS" end program lfortran-0.63.0/integration_tests/data_implied_do_03.f900000664000175000017500000000061015174404631023302 0ustar alastairalastairsubroutine sub() real :: a(5) integer :: i DATA (a(i),i=1,5) /1.0, 2.0, 3*0.0/ print *, a if (abs(a(1) - 1.0) > 1e-8) error stop if (abs(a(2) - 2.0) > 1e-8) error stop if (abs(a(3) - 0.0) > 1e-8) error stop if (abs(a(4) - 0.0) > 1e-8) error stop if (abs(a(5) - 0.0) > 1e-8) error stop end subroutine program data_implied_do_03 call sub() end program lfortran-0.63.0/integration_tests/modules_33_module3.f900000664000175000017500000000067315174404631023320 0ustar alastairalastairmodule fpm_modules_33 use fpm_dependency_modules_33, only : package_config_t, error_t use fpm_model_modules_33, only: fpm_model_t implicit none contains subroutine build_model(model, package, error) type(fpm_model_t), intent(out) :: model type(package_config_t), intent(in) :: package type(error_t), allocatable, intent(out) :: error call model%deps%add(package, error) end subroutine build_model end module fpm_modules_33 lfortran-0.63.0/integration_tests/nan_handling_01.f900000664000175000017500000000020015174404631022615 0ustar alastairalastairprogram nan_handling_01 double precision :: b, c c = 0.0D0 b = c / 0.0D0 if (b >= 2.0D0) error stop end program lfortran-0.63.0/integration_tests/intrinsics_414.f900000664000175000017500000000025215174404631022461 0ustar alastairalastairprogram intrinsics_414 implicit none call system('echo Hello from system intrinsic') call execute_command_line('echo Hello world') end program intrinsics_414 lfortran-0.63.0/integration_tests/logical_kind_03.f900000664000175000017500000000051215174404631022624 0ustar alastairalastairprogram logical_kind_03 use iso_c_binding, only: c_bool implicit none logical(c_bool) :: x x = bar(7) if (.not. x) error stop x = bar(3) if (x) error stop print *, "ok" contains logical(c_bool) function bar(n) integer, intent(in) :: n bar = n > 5 end function end program lfortran-0.63.0/integration_tests/gpu_metal_63.f900000664000175000017500000000141515174404631022173 0ustar alastairalastairmodule gpu_metal_63_mod implicit none type :: mytype_t real :: val end type interface mytype_t module procedure construct end interface contains pure function construct(v) result(t) real, intent(in) :: v type(mytype_t) :: t t%val = v end function end module program gpu_metal_63 use gpu_metal_63_mod implicit none type(mytype_t) :: arr(4) integer :: i do concurrent (i = 1:4) arr(i) = mytype_t(real(i)) end do print *, arr(1)%val print *, arr(2)%val print *, arr(3)%val print *, arr(4)%val if (abs(arr(1)%val - 1.0) > 1.0e-6) error stop if (abs(arr(2)%val - 2.0) > 1.0e-6) error stop if (abs(arr(3)%val - 3.0) > 1.0e-6) error stop if (abs(arr(4)%val - 4.0) > 1.0e-6) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/legacy_array_sections_18.f900000664000175000017500000000364115174404631024572 0ustar alastairalastairprogram legacy_array_sections_18 implicit none real :: data(4, 4) real :: data3(2, 3, 2) integer :: i, j integer :: k do j = 1, 4 do i = 1, 4 data(i, j) = 10.0*j + i end do end do do k = 1, 2 do j = 1, 3 do i = 1, 2 data3(i, j, k) = 100.0*k + 10.0*j + i end do end do end do call chunk_kernel_4(4, data(:, 1)) call chunk_kernel_from_3d(data3(:, 1, 2)) contains subroutine chunk_kernel_4(n, a) integer, value :: n real, intent(in) :: a(4, n) if (a(1, 1) /= 11.0 .or. a(2, 1) /= 12.0 .or. a(3, 1) /= 13.0 .or. a(4, 1) /= 14.0) then error stop "legacy_array_sections_18: column 1 mismatch" end if if (a(1, 2) /= 21.0 .or. a(2, 2) /= 22.0 .or. a(3, 2) /= 23.0 .or. a(4, 2) /= 24.0) then error stop "legacy_array_sections_18: column 2 mismatch" end if if (a(1, 3) /= 31.0 .or. a(2, 3) /= 32.0 .or. a(3, 3) /= 33.0 .or. a(4, 3) /= 34.0) then error stop "legacy_array_sections_18: column 3 mismatch" end if if (a(1, 4) /= 41.0 .or. a(2, 4) /= 42.0 .or. a(3, 4) /= 43.0 .or. a(4, 4) /= 44.0) then error stop "legacy_array_sections_18: column 4 mismatch" end if end subroutine chunk_kernel_4 subroutine chunk_kernel_from_3d(a) real, intent(in) :: a(2, 3) if (a(1, 1) /= 211.0 .or. a(2, 1) /= 212.0) then error stop "legacy_array_sections_18: 3d->2d column 1 mismatch" end if if (a(1, 2) /= 221.0 .or. a(2, 2) /= 222.0) then error stop "legacy_array_sections_18: 3d->2d column 2 mismatch" end if if (a(1, 3) /= 231.0 .or. a(2, 3) /= 232.0) then error stop "legacy_array_sections_18: 3d->2d column 3 mismatch" end if end subroutine chunk_kernel_from_3d end program legacy_array_sections_18 lfortran-0.63.0/integration_tests/optional_08.f900000664000175000017500000000437015174404631022045 0ustar alastairalastairprogram optional_08 implicit none type :: base character(len=:), allocatable :: working_dir end type base class(base), allocatable :: obj character(len=:), allocatable :: working_dir ! --------------------------- ! Initial setup ! --------------------------- working_dir = "Hello" if (.not. allocated(working_dir)) then error stop "ERROR: working_dir not allocated after assignment" end if ! --------------------------- ! Get command-line settings ! --------------------------- call get_command_line_settings(obj) if (.not. allocated(obj)) then error stop "ERROR: obj not allocated by get_command_line_settings" end if ! --------------------------- ! Extract working directory ! --------------------------- call get_working_dir(obj, working_dir) if (.not. allocated(working_dir)) then error stop "ERROR: working_dir not allocated after get_working_dir" end if print *, "SUCCESS" print *, "working_dir =", trim(working_dir) contains subroutine get_working_dir(settings, working_dir_) class(base), optional, intent(in) :: settings character(len=:), allocatable, intent(out) :: working_dir_ ! Validate presence if (.not. present(settings)) then error stop "ERROR: settings not present in get_working_dir" end if ! Validate allocation of component if (.not. allocated(settings%working_dir)) then error stop "ERROR: settings%working_dir not allocated" end if ! Safe assignment (auto-allocates working_dir_) working_dir_ = settings%working_dir end subroutine get_working_dir subroutine get_command_line_settings(cmd_settings) class(base), allocatable, intent(out) :: cmd_settings allocate(cmd_settings) if (.not. allocated(cmd_settings)) then error stop "ERROR: failed to allocate cmd_settings" end if ! Initialize component explicitly cmd_settings%working_dir = "Hello" if (.not. allocated(cmd_settings%working_dir)) then error stop "ERROR: cmd_settings%working_dir not allocated" end if end subroutine get_command_line_settings end program lfortran-0.63.0/integration_tests/string_05.f900000664000175000017500000000035715174404631021524 0ustar alastairalastairprogram string_05 character(len=3) :: s1 character(len=5) :: s2 character(len=7) :: s3 print *, len(s1) print *, len(s2) print *, len(s3) if (len(s1) /= 3) error stop if (len(s2) /= 5) error stop if (len(s3) /= 7) error stop end program lfortran-0.63.0/integration_tests/intrinsics_382.f900000664000175000017500000000056615174404631022475 0ustar alastairalastairprogram intrinsics_382 implicit none real :: input(2) real :: output(2) input = [1, 2] call forward(input, output) if (any(output /= [1, 2])) error stop contains subroutine forward(input, output) real, intent(inout) :: input(:) real, intent(inout) :: output(:) output = pack(input, .true.) end subroutine forward end program intrinsics_382lfortran-0.63.0/integration_tests/error_stop_04.f900000664000175000017500000000006615174404631022410 0ustar alastairalastairprogram error_stop_04 error stop "hi" end program lfortran-0.63.0/integration_tests/select_rank_19.f900000664000175000017500000000067415174404631022517 0ustar alastairalastairprogram select_rank_19 implicit none real, allocatable :: x(:,:) allocate(x(3, 4)) x = 1.0 call allocate_if_necessary(x) if (allocated(x)) error stop print *, "OK" contains subroutine allocate_if_necessary(array) real, allocatable, intent(inout) :: array(..) select rank(array) rank(2) if (allocated(array)) then deallocate(array) end if end select end subroutine end program lfortran-0.63.0/integration_tests/common_16.f900000664000175000017500000000163115174404631021504 0ustar alastairalastair! Test: COMMON block alignment edge case ! Tests storage association with types that might need alignment padding ! if the struct were not packed. COMMON blocks should be storage-associated ! (consecutive in memory) regardless of natural alignment requirements. program common_16 implicit none integer(1) :: i1 real(8) :: r8 integer(4) :: i4 common /align/ i1, r8, i4 i1 = 42 r8 = 3.14159d0 i4 = 999 call sub_verify() if (i1 /= 100) error stop "i1 should be 100 after subroutine" print *, "PASS: common_16" end program subroutine sub_verify() implicit none ! Same layout - verify values persist integer(1) :: a real(8) :: b integer(4) :: c common /align/ a, b, c if (a /= 42) error stop "a should be 42" if (abs(b - 3.14159d0) > 1.0d-10) error stop "b should be pi" if (c /= 999) error stop "c should be 999" a = 100 end subroutine lfortran-0.63.0/integration_tests/equivalence_20.f900000664000175000017500000000035415174404631022511 0ustar alastairalastairprogram equivalence_20 implicit none integer :: ia_long(5) integer :: ia(2) equivalence (ia_long(2), ia(2)) ia_long = -42 ia(2) = 2 if (ia_long(2) /= 2) error stop if (ia(1) /= -42) error stop if (ia(2) /= 2) error stop end program lfortran-0.63.0/integration_tests/separate_compilation_11.f900000664000175000017500000000044015174404631024406 0ustar alastairalastairprogram separate_compilation_11 use separate_compilation_11a_module implicit none integer :: a, b a = 1 b = 2 call parent_of_nested_subroutine(a, b) print *, "a =", a if ( a /= 2 ) error stop print *, "b =", b if ( b /= 4 ) error stop end program lfortran-0.63.0/integration_tests/associate_05.f900000664000175000017500000000065315174404631022170 0ustar alastairalastairprogram associate_05 real :: x(10), y(10), theta(10), a(10) real, allocatable :: myreal(:) allocate(myreal(10)) x = 0.42 y = 0.35 myreal = 9.1 theta = 1.5 a = 0.4 associate ( z => -(x*2 + y*2) * theta, v => myreal) v = a + z v(1) = v(1) * 4.6 v(2:5) = v(2:5) * v(2:5) v(6:10) = v(6:10) * 2.6 end associate print *, myreal end program associate_05 lfortran-0.63.0/integration_tests/block_06.f900000664000175000017500000000063315174404631021306 0ustar alastairalastairprogram block_06 implicit none integer :: a, b real :: c, d a = 5 b = -5 c = 0.5 d = 7.5 block integer :: x, y real :: z, w x = 10 y = -10 z = 2.25 w = -2.25 print *, x, y, z, w print *, a, b, c, d a = x b = y c = z d = w end block print *, a, b, c, d end program block_06 lfortran-0.63.0/integration_tests/nullify_07.f900000664000175000017500000000033715174404631021700 0ustar alastairalastairprogram nullify_07 implicit none character(len=:), pointer :: str allocate(character(len=5) :: str) str = "Hello" print *, str deallocate(str) nullify(str) if(len(str) /= 0) error stop end program nullify_07lfortran-0.63.0/integration_tests/modules_52_module1.f900000664000175000017500000000146215174404631023314 0ustar alastairalastairmodule module_52_tomlf_de use module_52_tomlf_error, only : toml_error use module_52_tomlf_type, only : toml_table implicit none interface toml_parse module procedure :: toml_parse_unit module procedure :: toml_parse_string end interface toml_parse contains subroutine toml_parse_unit(table, unit, error) type(toml_table), allocatable, intent(out) :: table integer, intent(in) :: unit type(toml_error), allocatable, intent(out), optional :: error end subroutine toml_parse_unit subroutine toml_parse_string(table, conf, error) type(toml_table), allocatable, intent(out) :: table character(len=*), intent(in), target :: conf(:) type(toml_error), allocatable, intent(out), optional :: error end subroutine toml_parse_string end module module_52_tomlf_de lfortran-0.63.0/integration_tests/submodule_07.f900000664000175000017500000000102515174404631022210 0ustar alastairalastairmodule mod_wrapper_submodule_07 implicit none private public :: key_type type :: key_type integer :: value end type key_type end module mod_wrapper_submodule_07 module mod_submodule_07 use mod_wrapper_submodule_07 contains module subroutine sub() print *, "Hello World" end subroutine end module mod_submodule_07 submodule(mod_submodule_07) submod_submodule_07 use mod_wrapper_submodule_07 end submodule submod_submodule_07 program main use mod_submodule_07 end program lfortran-0.63.0/integration_tests/array_section_08.f900000664000175000017500000000425415174404631023063 0ustar alastairalastair! Test self-referencing array section assignments with --realloc-lhs-arrays ! This tests the fix for use-after-free when arr = arr(i:j) causes realloc ! to free/move memory before the copy completes. program array_section_08 implicit none call test_simple_array() call test_struct_array() call test_reverse_overlap_section_assign() print *, "PASS" contains subroutine test_simple_array() real, allocatable :: arr(:) integer :: i allocate(arr(5)) do i = 1, 5 arr(i) = real(i * 10) end do arr = arr(3:5) ! Self-referencing - was causing use-after-free if (size(arr) /= 3) error stop "simple: size should be 3" if (arr(1) /= 30.0) error stop "simple: arr(1) should be 30" if (arr(2) /= 40.0) error stop "simple: arr(2) should be 40" if (arr(3) /= 50.0) error stop "simple: arr(3) should be 50" end subroutine subroutine test_struct_array() type :: item_t character(len=:), allocatable :: name integer :: value end type item_t type(item_t), allocatable :: items(:) integer :: i allocate(items(3)) do i = 1, 3 allocate(character(len=10) :: items(i)%name) items(i)%name = "item" // char(48 + i) items(i)%value = i * 10 end do items = items(2:3) ! Self-referencing struct array if (size(items) /= 2) error stop "struct: size should be 2" if (items(1)%value /= 20) error stop "struct: items(1)%value should be 20" if (items(2)%value /= 30) error stop "struct: items(2)%value should be 30" end subroutine subroutine test_reverse_overlap_section_assign() integer :: x(5) x = [1, 2, 3, 4, 5] x(5:2:-1) = x(2:5) if (x(1) /= 1) error stop "reverse-overlap: x(1) should be 1" if (x(2) /= 5) error stop "reverse-overlap: x(2) should be 5" if (x(3) /= 4) error stop "reverse-overlap: x(3) should be 4" if (x(4) /= 3) error stop "reverse-overlap: x(4) should be 3" if (x(5) /= 2) error stop "reverse-overlap: x(5) should be 2" end subroutine end program array_section_08 lfortran-0.63.0/integration_tests/modules_22_module.f900000664000175000017500000000045115174404631023225 0ustar alastairalastairmodule modules_22_module type :: bitset_type integer(8) :: num_bits end type contains function bits(self) integer(8) :: bits type(bitset_type), intent(in) :: self bits = self % num_bits return end function bits end modulelfortran-0.63.0/integration_tests/array_indices_array_item_assignment.f900000664000175000017500000000026415174404631027167 0ustar alastairalastairprogram array_indices_array_item_assignment integer :: A(3) = [1,2,3] integer :: X(2) = [1,2] integer :: Y = 2 A(X) = Y print *, A if( any(A /= [2, 2, 3]) ) error stop end program lfortran-0.63.0/integration_tests/where_11.f900000664000175000017500000000176415174404631021330 0ustar alastairalastairMODULE where_11_mod IMPLICIT NONE INTEGER :: a(3) integer :: b(3) CONTAINS SUBROUTINE test_01 where(abs(a) == 1) b = 555 print *, b if (any(b /= [555, 555 , 0])) error stop b = 0 END SUBROUTINE test_01 SUBROUTINE test_02 where(abs(a)*1 == 1) b = 556 print *, b if (any(b /= [556, 556 , 0])) error stop b = 0 END SUBROUTINE test_02 SUBROUTINE test_03 where(abs(a)*1 + 1 == 2) b = 557 print *, b if (any(b /= [557, 557 , 0])) error stop b = -1 END SUBROUTINE test_03 SUBROUTINE test_04 where(min(a, b) == -1 ) b = 558 print *, b if (any(b /= [558, 558 , 558])) error stop b = 0 END SUBROUTINE test_04 END MODULE where_11_mod PROGRAM where_11 USE where_11_mod implicit none a = [1,-1,2] b = 0 CALL test_01 CALL test_02 CALL test_03 CALL test_04 END PROGRAM where_11 lfortran-0.63.0/integration_tests/derived_types_55.f900000664000175000017500000000166115174404631023070 0ustar alastairalastairmodule derived_types_55_m implicit none type :: Base contains procedure :: get_out end type Base type, extends(Base) :: Derived contains procedure :: get_out => derived_get_out end type Derived contains subroutine get_out(self, outi) class(Base), intent(in) :: self integer, intent(out) :: outi outi = 1 end subroutine get_out subroutine derived_get_out(self, outi) class(Derived), intent(in) :: self integer, intent(out) :: outi outi = 2 end subroutine derived_get_out subroutine helper(self) class(Base), intent(in) :: self integer :: outi call self%get_out(outi) if (outi /= 2) error stop end subroutine helper end module derived_types_55_m program derived_types_55 use derived_types_55_m implicit none type(Derived) :: c call helper(c) end program derived_types_55 lfortran-0.63.0/integration_tests/deallocate_02.f900000664000175000017500000000177515174404631022315 0ustar alastairalastairmodule m_deallocate_02 implicit none type :: t integer :: x = 0 contains final :: finalize end type interface t module procedure construct end interface contains pure function construct(x) result(res) integer, intent(in) :: x type(t) :: res res%x = x end function pure function f(a) result(r) type(t), intent(in) :: a integer :: r r = a%x end function pure subroutine finalize(self) type(t), intent(inout) :: self self%x = 0 end subroutine end module program deallocate_02 ! Test: spec expression with finalizable type constructor ! Ensures insert_deallocate pass updates function dependencies use m_deallocate_02, only: t, f implicit none call sub contains subroutine sub real :: arr(f(t(3))) integer :: i do i = 1, size(arr) arr(i) = real(i) end do if (size(arr) /= 3) error stop if (arr(1) /= 1.0) error stop if (arr(3) /= 3.0) error stop print *, "PASS" end subroutine end program lfortran-0.63.0/integration_tests/class_89.f900000664000175000017500000000163315174404631021335 0ustar alastairalastair module class_89_mod implicit none type :: other_type class(*), allocatable :: value end type other_type contains subroutine copy_other(src, dest) type(other_type), intent(in) :: src type(other_type), intent(out) :: dest allocate(dest%value, source=src%value) end subroutine copy_other end module class_89_mod program class_89 use class_89_mod, only : copy_other, other_type implicit none type :: dummy_type integer :: val(15) end type dummy_type type(other_type) :: other_in, other_out type(dummy_type) :: dummy_val integer :: i dummy_val%val = [(i, i=1,15)] allocate(other_in%value, source=dummy_val) call copy_other(other_in, other_out) select type(p => other_out%value) type is (dummy_type) print *, p%val if (any(p%val /= dummy_val%val)) error stop end select end program class_89lfortran-0.63.0/integration_tests/passing_array_05.f900000664000175000017500000000106615174404631023056 0ustar alastairalastairprogram test_arrays implicit none real :: a(10, 20, 30) call pass_array(a) print *, "Test passed" contains subroutine pass_array(arr) real :: arr(10, 20, *) call recv_array(arr(1:10, 1:20, 1)) end subroutine pass_array subroutine recv_array(x) real :: x(:, :) integer :: ub1, ub2 ub1 = ubound(x, 1) ub2 = ubound(x, 2) if (ub1 /= size(x,1)) stop "ubound dim 1 failed" if (ub2 /= size(x,2)) stop "ubound dim 2 failed" end subroutine recv_array end program test_arrayslfortran-0.63.0/integration_tests/sqrt_02.f900000664000175000017500000000010615174404631021174 0ustar alastairalastairprogram sqrt_02 real, parameter :: x = 30 print*, sqrt(x) end program lfortran-0.63.0/integration_tests/arrays_15.f900000664000175000017500000000050115174404631021507 0ustar alastairalastair program arrays_15 integer :: b(2) b = [244, 1404] call foo() contains subroutine foo() b(1) = 43 call foo2(size(b), b) end subroutine subroutine foo2(m, vec) integer :: m, vec(m) if (m /= 2) error stop if (vec(1) /= 43) error stop if (vec(2) /= 1404) error stop end subroutine end program lfortran-0.63.0/integration_tests/functions_50.f900000664000175000017500000000040115174404631022214 0ustar alastairalastairprogram functions_50 integer :: n character(:), ALLOCATABLE :: x n = 5 x = sayHi() if (x /= "Hello") error stop print *, x contains character(n) function sayHi() result (res) res = "Hello" end function end program functions_50 lfortran-0.63.0/integration_tests/enum_04.f900000664000175000017500000000057115174404631021157 0ustar alastairalastairmodule enum_04_mod use iso_c_binding implicit none enum, bind(c) enumerator :: red = 1, green = 2, blue = 3 end enum end module enum_04_mod program enum_04 use iso_c_binding use enum_04_mod implicit none integer(c_int) :: c c = red if (c /= 1) error stop c = green if (c /= 2) error stop c = blue if (c /= 3) error stop end program enum_04 lfortran-0.63.0/integration_tests/transfer_28.f900000664000175000017500000000064615174404631022050 0ustar alastairalastairprogram transfer_28 implicit none type :: pair integer :: a integer :: b end type type(pair) :: vals(2) integer, allocatable :: ints(:) vals(1) = pair(1, 2) vals(2) = pair(3, 4) ints = transfer(vals, ints) if (size(ints) /= 4) error stop if (ints(1) /= 1) error stop if (ints(2) /= 2) error stop if (ints(3) /= 3) error stop if (ints(4) /= 4) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/operator_overloading_10.f900000664000175000017500000000151615174404631024434 0ustar alastairalastairmodule operator_overloading_10_module implicit none type :: first_type integer :: x end type type :: second_type integer :: x end type interface operator(/=) module procedure ne end interface interface operator(/=) module procedure une end interface contains logical function ne(x, y) type(first_type), intent(in) :: x, y print *, "first_type::ne" ne = .false. end function logical function une(s, z) type(second_type), intent(in) :: s, z print *, "second_type::une" une = .false. end function end module operator_overloading_10_module program main use operator_overloading_10_module implicit none type(first_type) :: a1, a2 type(second_type) :: b1, b2 if (a1 /= a2) error stop if (b1 /= b2) error stop end program main lfortran-0.63.0/integration_tests/enum_01.f900000664000175000017500000000070115174404631021147 0ustar alastairalastairprogram enum_01 implicit none enum, bind(c) enumerator :: red, blue = 3 enumerator yellow end enum enum, bind(c) enumerator :: green = 10 enumerator purple end enum integer, parameter :: compiler_enum = kind(red) if (red /= 0) error stop if (blue /= 3) error stop if (yellow /= 4) error stop if (green /= 10) error stop if (purple /= 11) error stop end program enum_01 lfortran-0.63.0/integration_tests/transfer_10.f900000664000175000017500000000133415174404631022032 0ustar alastairalastairprogram mre_transfer_no_c_char implicit none character(len=1) :: buf(20) character(len=*), parameter :: fstr = "hello" integer :: i integer, parameter :: expected(5) = [104, 101, 108, 108, 111] call f_character_transfer(fstr, buf, size(buf)) do i = 1, 5 if (iachar(buf(i)) /= expected(i)) error stop "wrong value" end do print *, "test passed" contains subroutine f_character_transfer(rhs, lhs, length) implicit none character(len=*), intent(in) :: rhs character(len=1), intent(out) :: lhs(*) integer, intent(in) :: length integer :: n n = min(length, len(rhs)) lhs(1:n) = transfer(rhs, lhs(1:n)) end subroutine f_character_transfer end program mre_transfer_no_c_char lfortran-0.63.0/integration_tests/class_78.f900000664000175000017500000000402315174404631021327 0ustar alastairalastairmodule class_78_module public :: fpm_registry_settings, fpm_global_settings type :: fpm_global_settings type(fpm_registry_settings), allocatable :: registry_settings end type type :: fpm_registry_settings integer :: tag = 0 end type end module class_78_module program class_78 use class_78_module implicit none type(fpm_global_settings) :: global_settings type(fpm_registry_settings) :: tmp logical :: ok if (allocated(global_settings%registry_settings)) then print *, "FAIL: registry_settings should start unallocated." stop 1 else print *, "PASS: registry_settings initially unallocated." end if allocate(global_settings%registry_settings) if (.not. allocated(global_settings%registry_settings)) then print *, "FAIL: allocation failed." stop 1 else print *, "PASS: allocation succeeded." end if tmp%tag = 42 global_settings%registry_settings = tmp if (global_settings%registry_settings%tag /= 42) then print *, "FAIL: assignment into allocatable component did not propagate value." stop 1 else print *, "PASS: assignment propagated correctly." end if call validate_settings(global_settings, ok) if (.not. ok) then print *, "FAIL: validate_settings detected incorrect state." stop 1 else print *, "PASS: validate_settings confirmed correct state." end if deallocate(global_settings%registry_settings) if (allocated(global_settings%registry_settings)) then print *, "FAIL: deallocation failed." stop 1 else print *, "PASS: deallocation succeeded." end if contains subroutine validate_settings(gs, ok) type(fpm_global_settings), intent(in) :: gs logical, intent(out) :: ok ok = .true. if (.not. allocated(gs%registry_settings)) ok = .false. if (gs%registry_settings%tag /= 42) ok = .false. end subroutine validate_settings end program class_78 lfortran-0.63.0/integration_tests/bits_06.f900000664000175000017500000000067515174404631021163 0ustar alastairalastairprogram bits_06 implicit none integer(1) :: int1 = 1 integer(2) :: int2 = 4 integer(4) :: int4 = 41 integer(8) :: int8 = 411 integer :: size1, size2, size4, size8 size1 = bit_size(int1) print *, size1 if (size1 /= 8) error stop size2 = bit_size(int2) print *, size2 if (size2 /= 16) error stop size4 = bit_size(int4) print *, size4 if (size4 /= 32) error stop size8 = bit_size(int8) print *, size8 if (size8 /= 64) error stop end program lfortran-0.63.0/integration_tests/character_10c.c0000664000175000017500000000413215174404631022130 0ustar alastairalastair #include #include #include #include char f_string00_fortran(char *s); char f_string01_fortran(char s); char f_string02_fortran(char* s, int n); char f_string03_fortran(char* s); char f_string04_fortran(char* s); char f_string05_fortran(CFI_cdesc_t* s); int f_string00_c_caller(){ char s = 'H'; char r = f_string00_fortran(&s); printf("C Side : return of `f_string00_fortran` is [%c]\n", r); printf("%C\n", s); if(s != 'X'){ printf("C Terminating process\n"); exit(1); } } int f_string01_c_caller(){ char s = 'H'; char r = f_string01_fortran(s); printf("C Side : return of `f_string01_fortran` is [%c]\n", r); printf("%c\n", s); if(s == 'X'){ printf("C Terminating process\n"); exit(1); } } int f_string02_c_caller(){ char *s = (char*)malloc(4 * sizeof(char)); memcpy(s, "ABC",4); char r = f_string02_fortran(s, 3); printf("C Side : return of `f_string02_fortran` is [%c]\n", r); printf("%s\n", s); if(s[0] != '2'){ printf("C Terminating process\n"); exit(1); } } int f_string03_c_caller(){ char *s = (char*)malloc(4 * sizeof(char)); memcpy(s, "BCD",4); char r = f_string03_fortran(s); printf("C Side : return of `f_string03_fortran` is [%c]\n", r); printf("%s\n", s); if(s[0] != '3'){ printf("C Terminating process\n"); exit(1); } } int f_string04_c_caller(){ char *s = (char*)malloc(4 * sizeof(char)); memcpy(s, "CDE",4); char r = f_string04_fortran(s); printf("C Side : return of `f_string04_fortran` is [%c]\n", r); printf("%s\n", s); if(s[0] != '4'){ printf("C Terminating process\n"); exit(1); } } int f_string05_c_caller(){ char *s = (char*)malloc(4 * sizeof(char)); memcpy(s, "DEF",4); CFI_cdesc_t desc = {s, sizeof(char)}; char r = f_string05_fortran(&desc); printf("C Side : return of `f_string05_fortran` is [%c]\n", r); printf("%s\n", s); if(s[0] != '5'){ printf("C Terminating process\n"); exit(1); } } lfortran-0.63.0/integration_tests/derived_types_112.f900000664000175000017500000000143215174404631023136 0ustar alastairalastair! Test: finalize LHS of intrinsic assignment ! Fortran 2018, clause 7.5.6.3, paragraph 1 module derived_types_112_m implicit none integer :: finalizations = 0 type :: obj_t integer :: dummy = 0 contains final :: count_finalizations end type contains subroutine count_finalizations(self) type(obj_t), intent(inout) :: self finalizations = finalizations + 1 self%dummy = 0 end subroutine end module program derived_types_112 use derived_types_112_m implicit none type(obj_t) :: lhs, rhs lhs%dummy = 0 rhs%dummy = 1 finalizations = 0 lhs = rhs ! This should finalize lhs before the assignment if (finalizations /= 1) error stop ! Verify the assignment itself still works if (lhs%dummy /= 1) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/intrinsics_45.f900000664000175000017500000000053015174404631022400 0ustar alastairalastairprogram intrinsics_45 use iso_fortran_env, only : real_kinds, integer_kinds, character_kinds, logical_kinds use iso_fortran_env, only : iostat_end print *, size(real_kinds), size(integer_kinds), size(character_kinds), size(logical_kinds) print *, iostat_end if (iostat_end /= -1) error stop ! Does not work yet !print *, real_kinds end program lfortran-0.63.0/integration_tests/const_kind_02.f900000664000175000017500000000035315174404631022342 0ustar alastairalastairprogram const_kind_02 integer, parameter :: int32 = 4, int64 = 8 integer(int32), parameter :: i1 = 1_int32 integer(int64), parameter :: i2 = 1_int64 integer :: i3 i3 = 1_int32 i3 = 1_int64 print *, int32, int64, i1, i2, i3 end program lfortran-0.63.0/integration_tests/intrinsics_99.f900000664000175000017500000000045015174404631022412 0ustar alastairalastairmodule intrinsics_99_m implicit none contains function all_true(tf,idim) result(vec) logical, intent(in) :: tf(:,:) integer, intent(in) :: idim logical :: vec(size(tf,dim=3-idim)) vec = .true. end function all_true end module program intrinsics_99 end lfortran-0.63.0/integration_tests/file_06.f900000664000175000017500000000135015174404631021130 0ustar alastairalastairprogram file_06 implicit none integer :: u = 11, i, j real :: arr(2, 3) real, allocatable :: alloc_arr(:, :) open(u, file="file_06_data.dat", form="unformatted", access="stream", status="old") read(u) arr close(u) do i = 1, 2 do j = 1, 3 print *, arr(i, j) end do end do print *, sum(arr) if (abs(sum(arr) - 17.4599991) > 1e-6) error stop open(u, file="file_06_data.dat", form="unformatted", access="stream", status="old") allocate(alloc_arr(2, 3)) read(u) alloc_arr close(u) do i = 1, 2 do j = 1, 3 print *, alloc_arr(i, j) end do end do if (abs(sum(alloc_arr) - 17.4599991) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/test_dshiftr.f900000664000175000017500000000033315174404631022406 0ustar alastairalastairprogram test_dshiftr integer, parameter:: ik1 = selected_int_kind(1) integer(ik1), parameter:: i0 = 0, i1 = 1 integer(ik1):: expected = 64 if (dshiftr(i1, i0, 2) /= expected) error stop end program test_dshiftr lfortran-0.63.0/integration_tests/modules_10.f900000664000175000017500000000057615174404631021665 0ustar alastairalastairmodule modules_10_b implicit none private public b contains integer function b() b = 5 end function end module module modules_10_a use modules_10_b, only: b implicit none private public a contains integer function a() a = 3 + b() end function end module program modules_10 use modules_10_a, only: a implicit none if (a() /= 8) error stop print *, "OK" end lfortran-0.63.0/integration_tests/modules_23_module.f900000664000175000017500000000466615174404631023242 0ustar alastairalastairmodule string_module implicit none type :: string_type sequence private character(len=:), allocatable :: raw end type string_type interface string_type pure elemental module function new_string(string) result(new) character(len=*), intent(in), optional :: string type(string_type) :: new end function new_string pure elemental module function new_string_from_integer_int8(val) result(new) integer(1), intent(in) :: val type(string_type) :: new end function new_string_from_integer_int8 pure elemental module function new_string_from_integer_int16(val) result(new) integer(2), intent(in) :: val type(string_type) :: new end function new_string_from_integer_int16 pure elemental module function new_string_from_integer_int32(val) result(new) integer(4), intent(in) :: val type(string_type) :: new end function new_string_from_integer_int32 pure elemental module function new_string_from_integer_int64(val) result(new) integer(8), intent(in) :: val type(string_type) :: new end function new_string_from_integer_int64 end interface string_type interface assignment(=) module procedure :: assign_char_to_string end interface assignment(=) contains elemental subroutine assign_char_to_string(lhs, rhs) type(string_type), intent(inout) :: lhs character(len=*), intent(in) :: rhs lhs%raw = rhs end subroutine assign_char_to_string elemental function len_string(string3) result(length) type(string_type), intent(in) :: string3 integer :: length if (allocated(string3%raw)) then length = len(string3%raw) else length = 0 end if end function len_string elemental function adjustl_string(string1) result(adjusted_string) type(string_type), intent(in) :: string1 type(string_type) :: adjusted_string adjusted_string%raw = adjustl(maybe(string1)) end function adjustl_string pure function maybe(string2) result(maybe_string) type(string_type), intent(in) :: string2 character(len=len_string(string2)) :: maybe_string if (allocated(string2%raw)) then maybe_string = string2%raw else maybe_string = '' end if end function maybe end modulelfortran-0.63.0/integration_tests/template_add_01c.f900000664000175000017500000000153415174404631022776 0ustar alastairalastairmodule template_add_01c_m implicit none private public :: add_t, test_template requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = F(x, y) end function end template contains subroutine test_template() integer :: n instantiate add_t(integer, operator(+)) n = add_generic(5, 9) print*, "The result is", n end subroutine end module program template_add_01c use template_add_01c_m implicit none call test_template() end programlfortran-0.63.0/integration_tests/implied_do_loops_print.f900000664000175000017500000000066515174404631024451 0ustar alastairalastairprogram test_write_implied_do use iso_fortran_env, only: output_unit implicit none integer, parameter :: stdout = output_unit integer :: ii, iii character(len=20) :: lines(3) lines(1) = "first" lines(2) = "second" lines(3) = "third" ii = 3 print *, ( trim(lines(iii)), iii = 1, ii ) ! Verify that all values were printed if (ii /= 3) error stop end program test_write_implied_do lfortran-0.63.0/integration_tests/compiler_version_02.f900000664000175000017500000000020115174404631023556 0ustar alastairalastairprogram compiler_version_02 use, intrinsic :: iso_fortran_env, only: compiler_version print*, compiler_version() end program lfortran-0.63.0/integration_tests/nested_callback_interface_01.f900000664000175000017500000000152515174404631025326 0ustar alastairalastairmodule my_module implicit none abstract interface pure real function fun_interface() end function fun_interface end interface contains real function my_wrapper(fun) implicit none procedure(fun_interface) :: fun my_wrapper = wrapper_wrapper() contains real function wrapper_wrapper() wrapper_wrapper = fun() end function wrapper_wrapper end function my_wrapper end module my_module program example use my_module implicit none real :: target_value target_value = 0.5 print *, "Via wrapper (should equal .5): ", my_wrapper(my_fun) print *, "Direct call (should equal .5): ", my_fun() if (abs(my_wrapper(my_fun) - 0.5) > 1e-6) error stop if (abs(my_fun() - 0.5) > 1e-6) error stop contains pure real function my_fun() my_fun = target_value end function my_fun end program example lfortran-0.63.0/integration_tests/pointer_to_cptr.f900000664000175000017500000000134215174404631023117 0ustar alastairalastairprogram pointer_to_cptr use iso_c_binding, only: c_ptr, c_loc, c_f_pointer, c_int implicit none integer, target :: arr(5) = [1, 2, 3, 4, 5] type(c_ptr) :: arr_ptr arr_ptr = c_loc(arr) call process_array(arr_ptr, size(arr)) contains subroutine process_array(ptr, n) use iso_c_binding, only: c_ptr, c_f_pointer, c_int type(c_ptr), intent(in) :: ptr integer, intent(in) :: n integer(c_int), pointer :: f_arr(:) integer :: i call c_f_pointer(ptr, f_arr, [n]) print *, "Array elements from process_array:" do i = 1, n print *, "Element", i, "=", f_arr(i) end do end subroutine process_array end program pointer_to_cptr lfortran-0.63.0/integration_tests/select_rank_05.f900000664000175000017500000000133615174404631022506 0ustar alastairalastairprogram select_rank_04 implicit none integer :: a(2) = [4, 2] integer :: b(2, 3) = reshape([1, 2, 3, 4, 5, 6], [2, 3]) call check(a) call check(b) contains subroutine check(x) integer, intent(in) :: x(..) integer :: l1(1) integer :: l2(2) integer :: c(2, 1) integer :: d(3, 2) select rank(x) rank (1) c = reshape(x, [2, 1]) print *, c if (any(c /= reshape([4, 2], [2, 1]))) error stop rank (2) d = reshape(x, [3, 2]) print *, d if (any(d /= reshape([1, 2, 3, 4, 5, 6], [3, 2]))) error stop end select end subroutine check end program select_rank_04lfortran-0.63.0/integration_tests/intrinsics_56.f900000664000175000017500000000341715174404631022411 0ustar alastairalastairprogram intrinsics_56 implicit none logical :: m1(5, 10), m2(5, 10), m integer :: a1(5, 10), b1(5, 10) integer, allocatable :: a2(:, :) real :: a4(5, 10), b2(5, 10) real, allocatable :: a3(:, :) complex, allocatable :: a5(:, :), a6(:, :), b3(:, :) character(len=5) :: a7(5, 10) character(len=5), allocatable :: a8(:, :) character(len=5) :: b4(5, 10) integer :: i, j m = .true. do i = 1, 5 do j = 1, 10 m1(i, j) = m m2(i, j) = .not. m m = .not. m end do end do allocate(a2(5, 10)) a1 = 1 a2 = 2 b1 = merge(a1, a2, m1) m = .true. do i = 1, 5 do j = 1, 10 print *, b1(i, j) if( m ) then if( b1(i, j) /= a1(i, j) ) error stop else if( b1(i, j) /= a2(i, j) ) error stop end if m = .not. m end do end do allocate(a3(5, 10)) a3 = 3.0 a4 = 4.0 b2 = merge(a3, a4, m2) m = .false. do i = 1, 5 do j = 1, 10 print *, b2(i, j) if( m ) then if( b2(i, j) /= a3(i, j) ) error stop else if( b2(i, j) /= a4(i, j) ) error stop end if m = .not. m end do end do allocate(a5(5, 10), a6(5, 10), b3(5, 10)) a5 = (5.0, 6.0) a6 = (7.0, 8.0) b3 = merge(a5, a6, m1) m = .true. do i = 1, 5 do j = 1, 10 print *, b3(i, j) if( m ) then if( b3(i, j) /= a5(i, j) ) error stop else if( b3(i, j) /= a6(i, j) ) error stop end if m = .not. m end do end do allocate(a8(5, 10)) a7 = "a7" a8 = "a8" b4 = merge(a7, a8, m2) m = .false. do i = 1, 5 do j = 1, 10 print *, b4(i, j) if( m ) then if( b4(i, j) /= a7(i, j) ) error stop else if( b4(i, j) /= a8(i, j) ) error stop end if m = .not. m end do end do end program lfortran-0.63.0/integration_tests/equivalence_27.f900000664000175000017500000000043715174404631022522 0ustar alastairalastairblock data bd_l implicit none logical :: lb common /blockl/ lb(2) logical :: la(2) equivalence (la, lb) data la(2) / .false. / end program equivalence_27 implicit none logical :: la(2) common /blockl/ la if (la(2)) error stop end program lfortran-0.63.0/integration_tests/format_45.f900000664000175000017500000000202215174404631021501 0ustar alastairalastair! Test that embedded null bytes in strings are preserved during formatting program format_45 implicit none character(len=20) :: result_str character(len=10) :: prefix real :: value integer :: i ! Set prefix to null bytes do i = 1, 10 prefix(i:i) = char(0) end do value = 1.5 write(result_str, '(A,F5.2)') prefix, value ! Verify first 10 bytes are null do i = 1, 10 if (ichar(result_str(i:i)) /= 0) error stop end do ! Verify float " 1.50" at positions 11-15 if (ichar(result_str(11:11)) /= 32) error stop ! space if (ichar(result_str(12:12)) /= 49) error stop ! '1' if (ichar(result_str(13:13)) /= 46) error stop ! '.' if (ichar(result_str(14:14)) /= 53) error stop ! '5' if (ichar(result_str(15:15)) /= 48) error stop ! '0' ! Verify trailing spaces at positions 16-20 do i = 16, 20 if (ichar(result_str(i:i)) /= 32) error stop end do print *, "PASS: Null bytes preserved correctly in formatted output" end program lfortran-0.63.0/integration_tests/pdt_06.f900000664000175000017500000000105115174404631020776 0ustar alastairalastairmodule pdt_06_outer_m use pdt_06_inner_m, only : inner implicit none type outer(k) integer, kind :: k = kind(1.) type(inner(k)) :: a end type interface outer module function make_outer(a) result(r) type(inner), intent(in) :: a type(outer) r end function end interface end module program pdt_06 use pdt_06_inner_m, only : inner use pdt_06_outer_m, only : outer implicit none type(inner) :: x type(outer) :: y x%v = 2.5 y%a = x if (abs(y%a%v - 2.5) > 1e-5) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/generic_interface_function_call_of_function_call.f900000664000175000017500000000446015174404631031631 0ustar alastairalastairmodule stdlib_linalg implicit none ! Define the generic interface 'diag' interface diag procedure :: diag_iint16_mat ! Handles matrix to vector procedure :: diag_iint16_vec ! Handles vector to matrix end interface contains ! Function to extract the diagonal of a matrix module function diag_iint16_mat(A) result(res) integer(4), intent(in) :: A(:,:) integer(4) :: res(minval(shape(A))) integer :: i do i = 1, minval(shape(A)) res(i) = A(i, i) end do end function diag_iint16_mat ! Function to create a diagonal matrix from a vector module function diag_iint16_vec(v) result(res) integer(4), intent(in) :: v(:) integer(4) :: res(size(v), size(v)) integer :: i, j ! Initialize the result matrix to zero res = 0 ! Assign the vector elements to the diagonal of the matrix do i = 1, size(v) res(i, i) = v(i) end do end function diag_iint16_vec ! Test subroutine to demonstrate diag(diag(a)) subroutine test_diag_int16() integer, parameter :: n = 4 integer(4) :: a(n, n), d(n**2) integer(4) :: e(n, n) integer :: j ! Initialize the array 'd' with values from 1 to n^2 do j = 1, n**2 d(j) = j end do ! Reshape 'd' into an n x n matrix 'a' a = reshape(d, [n, n]) ! Apply diag twice: first to extract the diagonal vector, ! then to create a diagonal matrix e = diag(diag(a)) ! Optional: Print the results for verification print *, "Matrix a:" do j = 1, n print *, a(j, :) end do print *, "Diagonal of a:" print *, diag(a) if (any(diag(a) /= [1, 6, 11, 16])) error stop print *, "diag(diag(a)):" print *, e(1, :) if (any(e(1, :) /= [1, 0, 0, 0])) error stop print *, e(2, :) if (any(e(2, :) /= [0, 6, 0, 0])) error stop print *, e(3, :) if (any(e(3, :) /= [0, 0, 11, 0])) error stop print *, e(4, :) if (any(e(4, :) /= [0, 0, 0, 16])) error stop end subroutine test_diag_int16 end module stdlib_linalg program main use stdlib_linalg implicit none call test_diag_int16() end program main lfortran-0.63.0/integration_tests/expr_18.f900000664000175000017500000000017315174404631021174 0ustar alastairalastairprogram expr_18 complex, parameter :: x = 123 print *, x if (abs(x - (123, 0)) > 1e-5) error stop end program lfortran-0.63.0/integration_tests/submodule_15.f900000664000175000017500000000115015174404631022206 0ustar alastairalastairmodule submodule_15_m implicit none interface module function value_from_submodule() result(v) integer :: v end function value_from_submodule end interface end module submodule_15_m submodule(submodule_15_m) submodule_15_s implicit none contains module procedure value_from_submodule v = f() contains integer function f() f = 1 end function f end procedure value_from_submodule end submodule submodule_15_s program submodule_15 use submodule_15_m, only: value_from_submodule implicit none if (value_from_submodule() /= 1) error stop 1 end program submodule_15 lfortran-0.63.0/integration_tests/string_69.f900000664000175000017500000000061715174404631021535 0ustar alastairalastairprogram string_69 implicit none character(len=7) :: value character(len=:), allocatable :: keywords(:) integer :: ii ii = 7 value = "version" keywords = [character(len=ii) :: value] if (len(keywords) /= 7) error stop if (keywords(1) /= "version") error stop value = "usage" keywords = [character(len=ii) :: keywords, value] if (keywords(2) /= "usage") error stop end programlfortran-0.63.0/integration_tests/gpu_metal_42.f900000664000175000017500000000147715174404631022200 0ustar alastairalastair! Test: do concurrent body references a local VLA whose size depends ! on a subroutine argument not otherwise used in the body/head. ! The gpu_offload pass must collect the argument from the variable's ! type expression into the kernel parameter list. program gpu_metal_42 implicit none type :: dims integer :: n integer :: m end type type(dims) :: d1, d2 d1%n = 4 d2%m = 4 call test(d1, d2) contains subroutine test(x, y) type(dims), intent(in) :: x, y integer :: i ! 'y' is ONLY referenced in the VLA dimension, not in body or head real :: a(y%m) do concurrent(i = 1:x%n) a(i) = real(i) end do if (abs(a(1) - 1.0) > 1.0e-6) error stop if (abs(a(2) - 2.0) > 1.0e-6) error stop if (abs(a(3) - 3.0) > 1.0e-6) error stop if (abs(a(4) - 4.0) > 1.0e-6) error stop print *, "ok" end subroutine end program lfortran-0.63.0/integration_tests/array_constructor_05.f900000664000175000017500000000112315174404631023771 0ustar alastairalastairprogram array_constructor_05 implicit none type :: vertex_type integer :: id = -1 end type type :: graph_type type(vertex_type), dimension(:), allocatable :: vertex end type type(graph_type) :: g integer :: idx, arr(5) allocate(g%vertex(5)) g%vertex(1)%id = 10 g%vertex(2)%id = 20 g%vertex(3)%id = 30 g%vertex(4)%id = 40 g%vertex(5)%id = 50 arr = [g%vertex(:)%id] if (arr(1) /= 10) error stop if (arr(3) /= 30) error stop if (arr(5) /= 50) error stop idx = findloc([g%vertex(:)%id], 30, dim=1) if (idx /= 3) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/intrinsics_138.f900000664000175000017500000000271315174404631022470 0ustar alastairalastairprogram intrinsics_138 implicit none real :: x = 3.143 complex(4) :: y = (2.33, 4.1) real(kind=4) :: x1(2) complex(kind=8) :: y1 integer(4), parameter :: r1 = precision(1._4) integer(8), parameter :: r2 = precision(67._8) integer, parameter :: r3 = precision((1, 2)) integer(4), parameter :: ar1 = precision([11.3_4, 1.7_4, 0.0_4]) integer(8), parameter :: ar2 = precision([11.3_8, 1.7_8, 0.0_8]) integer, parameter :: ar3 = precision([(1, 2), (3, 4), (11, 22)]) real(4) :: arr1(3) = [11.3_4, 1.7_4, 0.0_4] complex(8) :: arr2(3) = [(11.3_8, 1.7_8), (0.0_8, 1.1_8), (5.0_8, 0.1_8)] print *, r1 if (r1 /= 6) error stop print *, r2 if (r2 /= 15) error stop print *, ar1 if (ar1 /= 6) error stop print *, ar2 if (ar2 /= 15) error stop print *, precision(x) if (precision(x) /= 6) error stop print *, precision(y) if (precision(y) /= 6) error stop print *, precision(1._8) ** 0.5 if (abs(precision(1._8) ** 0.5_8 - 3.87298346) > 1e-6) error stop print*, precision(1.0) if (precision(1.0) /= 6) error stop print *, precision(x1) if (precision(x1) /= 6) error stop print *, precision(1.0d0) if (precision(1.0d0) /= 15) error stop print *, precision(y1) if (precision(y1) /= 15) error stop print *, precision(arr1) if (precision(arr1) /= 6) error stop print *, precision(arr2) if (precision(arr2) /= 15) error stop end programlfortran-0.63.0/integration_tests/intrinsics_333.f900000664000175000017500000000157115174404631022466 0ustar alastairalastairprogram intrinsics_333 implicit none real(4) :: rhobeg = 10000 real(4), allocatable :: x0(:), xl(:), xu(:) logical, allocatable :: lbx(:) logical, allocatable :: ubx(:) real(4), parameter :: EPS = -10000 allocate(x0(10), xl(10), xu(10)) allocate(lbx(size(x0)), ubx(size(x0))) x0(1:10:2) = 11 x0(2:10:2) = 18 lbx(1:10:2) = .true. lbx(2:10:2) = .false. ubx(2:10:2) = .false. ubx(1:10:2) = .true. xl(1:10:2) = 1 xl(2:10:2) = 2 xu(1:10:2) = 7 xu(2:10:2) = 10 rhobeg = max(EPS, minval([rhobeg, x0(falseloc(lbx)) - xl(falseloc(lbx)), xu(falseloc(ubx)) - x0(falseloc(ubx))])) print *, rhobeg if( rhobeg /= -8.0 ) error stop contains function falseloc(x) result(y) logical :: x(:) integer :: i, j integer, allocatable :: y(:) allocate(y(size(x) - count(x))) j = 1 do i = 1, size(x) if( .not. x(i) ) then y(j) = i j = j + 1 end if end do end function end program lfortran-0.63.0/integration_tests/separate_compilation_27.f900000664000175000017500000000031215174404631024413 0ustar alastairalastairprogram separate_compilation_27 use io_separate_compilation_27, only: open implicit none integer :: u = 1 call open(u) print *, u if (u /= 3) error stop end program separate_compilation_27lfortran-0.63.0/integration_tests/subroutines_18.f900000664000175000017500000000046215174404631022601 0ustar alastairalastairprogram subroutines_18 procedure(OBJ), pointer :: proc_ptr call sub(proc_ptr) contains subroutine OBJ() print *, "hello" end subroutine subroutine sub(calfun) procedure(OBJ), pointer , intent(inout) :: calfun calfun => OBJ call calfun end subroutine end programlfortran-0.63.0/integration_tests/custom_operator_10.f900000664000175000017500000000237715174404631023443 0ustar alastairalastairmodule custom_operator_10_mod implicit none type string_t private character(len=:), allocatable :: string_ contains generic :: operator(//) => character_cat_string_t procedure, private, pass(rhs) :: character_cat_string_t end type interface elemental module function character_cat_string_t(lhs, rhs) result(lhs_cat_rhs) implicit none character(len=*), intent(in) :: lhs class(string_t), intent(in) :: rhs character(len=5) lhs_cat_rhs end function end interface type test_diagnosis_t private character(len=:), allocatable :: diagnostics_string_ end type interface operator(//) elemental module function append_string_if_test_failed(lhs, rhs) result(lhs_cat_rhs) implicit none class(test_diagnosis_t), intent(in) :: lhs type(string_t), intent(in) :: rhs character(len=5) lhs_cat_rhs end function end interface contains module procedure append_string_if_test_failed lhs_cat_rhs = lhs%diagnostics_string_ // rhs end procedure module procedure character_cat_string_t lhs_cat_rhs = lhs // rhs%string_ end procedure end module custom_operator_10_mod program custom_operator_10 use custom_operator_10_mod implicit none end program custom_operator_10 lfortran-0.63.0/integration_tests/separate_compilation_40.f900000664000175000017500000000325415174404631024416 0ustar alastairalastairmodule separate_compilation_40_tensor_m implicit none type tensor_t(k) integer, kind :: k = kind(1.0) real(k), allocatable, private :: values(:) contains procedure, private :: get_values end type tensor_t interface pure module function get_values(self) result(v) class(tensor_t), intent(in) :: self real, allocatable :: v(:) end function get_values end interface end module separate_compilation_40_tensor_m submodule(separate_compilation_40_tensor_m) separate_compilation_40_tensor_s implicit none contains module procedure get_values v = self%values end procedure get_values end submodule separate_compilation_40_tensor_s module separate_compilation_40_pair_m use separate_compilation_40_tensor_m, only : tensor_t implicit none type pair_t(k) integer, kind :: k = kind(1.0) type(tensor_t(k)), private :: x contains procedure, private :: input end type pair_t interface pure module function input(self) result(v) class(pair_t), intent(in) :: self type(tensor_t) :: v end function input module subroutine shuffle(pairs) type(pair_t), intent(inout) :: pairs(:) end subroutine shuffle end interface end module separate_compilation_40_pair_m submodule(separate_compilation_40_pair_m) separate_compilation_40_pair_s implicit none contains module procedure input v = self%x end procedure input module procedure shuffle type(pair_t) :: tmp tmp = pairs(1) pairs(1) = pairs(2) pairs(2) = tmp end procedure shuffle end submodule separate_compilation_40_pair_s program separate_compilation_40 implicit none print *, "PASS" end program separate_compilation_40 lfortran-0.63.0/integration_tests/intrinsics_267.f900000664000175000017500000000361615174404631022476 0ustar alastairalastairprogram intrinsics_267 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real(dp), parameter :: a1 = dsin(1.0_dp) real(dp), parameter :: a2 = dcos(1.0_dp) real(dp), parameter :: a3 = dtan(1.0_dp) real(dp), parameter :: ar1(3) = dsin([1.0_dp, 1.5_dp, 2.0_dp]) real(dp), parameter :: ar2(3) = dcos([1.0_dp, 1.5_dp, 2.0_dp]) real(dp), parameter :: ar3(3) = dtan([1.0_dp, 1.5_dp, 2.0_dp]) real(dp) :: b = 0.7_dp real(dp) :: br(3) = [0.5_dp, 0.7_dp, 0.9_dp] ! dsin print *, a1 if (abs(a1 - 8.41470984807896507e-01_dp) > 1e-12_dp) error stop print *, ar1 if (any(abs(ar1 - [0.84147098480789650_dp, 0.99749498660405445_dp, 0.90929742682568171_dp]) > 1e-12_dp)) error stop print *, sin(b) if (abs(sin(b) - 0.64421768723769102_dp) > 1e-12_dp) error stop print *, sin(br) if (any(abs(sin(br) - [0.47942553860420301_dp, 0.64421768723769102_dp, 0.78332690962748341_dp]) > 1e-12_dp)) error stop ! dcos print *, a2 if (abs(a2 - 5.40302305868139717e-01_dp) > 1e-12_dp) error stop print *, ar2 if (any(abs(ar2 - [0.54030230586813977_dp, 0.070737201667702905_dp, -0.41614683654714241_dp]) > 1e-12_dp)) error stop print *, dcos(b) if (abs(dcos(b) - 0.76484218728448849_dp) > 1e-12_dp) error stop print *, dcos(br) if (any(abs(dcos(br) - [0.87758256189037276_dp, 0.76484218728448849_dp, 0.62160996827066441_dp]) > 1e-12_dp)) error stop ! dtan print *, a3 if (abs(a3 - 1.55740772465490223_dp) > 1e-12_dp) error stop print *, ar3 if (any(abs(ar3 - [1.55740772465490223_dp, 14.101419947171719_dp, -2.185039863261519_dp]) > 1e-12_dp)) error stop print *, dtan(b) if (abs(dtan(b) - 0.84228838046307941_dp) > 1e-12_dp) error stop print *, dtan(br) if (any(abs(dtan(br) - [0.54630248984379048_dp, 0.84228838046307941_dp, 1.2601582175503392_dp]) > 1e-12_dp)) error stop end programlfortran-0.63.0/integration_tests/subroutines_04.f900000664000175000017500000000021415174404631022567 0ustar alastairalastairprogram print_it call print_int() contains subroutine print_int integer :: a a = 5 print *, a end subroutine print_int end program print_it lfortran-0.63.0/integration_tests/modules_20.f900000664000175000017500000000026615174404631021662 0ustar alastairalastairprogram modules_20 use modules_20b, only: trim2, tfc implicit none character(*), parameter :: s1 = " A B ", s2 = " " call trim2(s1) call trim2(s2) call trim2("xx ") end program lfortran-0.63.0/integration_tests/modules_34.f900000664000175000017500000000032415174404631021662 0ustar alastairalastairmodule fpm_cmd_install_modules_34 use fpm_modules_34, only : build_model implicit none end module fpm_cmd_install_modules_34 program modules_34 implicit none print *, "running modules_34 program" end program lfortran-0.63.0/integration_tests/test_call_arg_structinstance_member.f900000664000175000017500000000122115174404631027164 0ustar alastairalastairmodule module_test_call_arg_structinstance_member implicit none type :: data_type real(4) :: arr(4) end type data_type contains subroutine sub(arr) real(4), intent(inout) :: arr(:) integer :: i do i = 1, 4 arr(i) = real(i, kind=4) + 10.0_4 end do end subroutine sub end module module_test_call_arg_structinstance_member program test_call_arg_structinstance_member use module_test_call_arg_structinstance_member implicit none type(data_type) :: d d%arr = 0.0_4 call sub(d%arr) print *, d%arr if (any(d%arr /= [11., 12., 13., 14.])) error stop end program lfortran-0.63.0/integration_tests/arrays_113.f900000664000175000017500000000223415174404631021573 0ustar alastairalastairprogram arrays_113 implicit none ! Test implied-shape parameter arrays with explicit lower bounds integer, parameter :: n(0:*) = [2, 4, 4, 1] integer, parameter :: m(-2:*) = [10, 20, 30] integer, parameter :: p(*) = [5, 6, 7] integer :: i ! Check bounds and values for 0-based array if (lbound(n, 1) /= 0) error stop if (ubound(n, 1) /= 3) error stop if (size(n) /= 4) error stop if (n(0) /= 2) error stop if (n(1) /= 4) error stop if (n(2) /= 4) error stop if (n(3) /= 1) error stop ! Check bounds and values for negative-lower-bound array if (lbound(m, 1) /= -2) error stop if (ubound(m, 1) /= 0) error stop if (size(m) /= 3) error stop if (m(-2) /= 10) error stop if (m(-1) /= 20) error stop if (m(0) /= 30) error stop ! Check default lower bound (1) still works if (lbound(p, 1) /= 1) error stop if (ubound(p, 1) /= 3) error stop if (p(1) /= 5) error stop if (p(2) /= 6) error stop if (p(3) /= 7) error stop ! Access via variable index i = 1 if (n(i - 1) /= 2) error stop if (m(i - 3) /= 10) error stop print *, "All tests passed" end program lfortran-0.63.0/integration_tests/data_11.f900000664000175000017500000000072715174404631021125 0ustar alastairalastairSUBROUTINE DKBVRC() INTEGER PLIM, KLIM PARAMETER ( PLIM = 28, KLIM = 100 ) INTEGER P(PLIM), C(PLIM,KLIM-1) DATA P( 1),(C( 1,I),I = 1,99)/ 31, 12, 2*9, 13, 8*12, 3*3, 12, & 2*7, 9*12, 3*3, 12, 2*7, 9*12, 3*3, 12, 2*7, 9*12, 3*3, 12, 2*7, & 8*12, 7, 3*3, 3*7, 21*3/ if( P( 1) /= 31 ) error stop if( C( 1, 1) /= 12 ) error stop if( C( 1, 2) /= 9 ) error stop if( C( 1, 99) /= 3 ) error stop END program main call DKBVRC() endlfortran-0.63.0/integration_tests/print_arr_01.f900000664000175000017500000000034415174404631022206 0ustar alastairalastairprogram main implicit none integer :: a(5) = [1, 2, 3, 4, 5] integer :: b = 130 b = b + 41 if (b > 1000) then print *, a error stop else print *, "Success" end if end program lfortran-0.63.0/integration_tests/utf8_bom_01.f900000664000175000017500000000016015174404631021725 0ustar alastairalastairprogram utf8_bom_01 integer :: x x = 42 if (x /= 42) error stop print *, "UTF-8 BOM test passed" end program lfortran-0.63.0/integration_tests/minpack_01_module.f900000664000175000017500000000030515174404631023172 0ustar alastairalastairmodule minpack_01 implicit none public interface double precision function enorm1(n) result(y) double precision n end function end interface end module lfortran-0.63.0/integration_tests/enum_05.f900000664000175000017500000000062215174404631021155 0ustar alastairalastairprogram enum_05 implicit none integer :: enum_var1, enum_var2 enum, bind(c) enumerator :: CAPS_and_small = 50 enumerator :: all_small = 100 end enum ! Assign enum values to variables enum_var1 = all_small enum_var2 = CAPS_and_small print *, enum_var1, enum_var2 if (enum_var1 /= 100) error stop if (enum_var2 /= 50) error stop end program lfortran-0.63.0/integration_tests/modules_36.f900000664000175000017500000000215515174404631021670 0ustar alastairalastairmodule modules_36_fpm_main_01 type :: fpm_build_settings logical :: list=.false. end type type, extends(fpm_build_settings) :: fpm_run_settings ! TODO: Set allocatable attribute after supporting ! allocation of StructInstanceMember character(len=5) :: name(2) character(len=4) :: args character(len=6) :: runner logical :: example end type contains subroutine cmd_run(settings, test) class(fpm_run_settings), intent(in) :: settings logical :: found(size(settings%name)) logical :: toomany logical, intent(in) :: test if ( any(.not.found) & & .or. & & ( (toomany .and. .not.test) .or. (toomany .and. settings%runner /= '') ) & & .and. & & .not.settings%list) then end if end subroutine cmd_run end module modules_36_fpm_main_01 program modules_36 use modules_36_fpm_main_01 implicit none type(fpm_run_settings) :: settings ! TODO: Re-enable after supporting allocation of StructInstanceMember ! allocate(settings%name(2)) ! allocate(character(len=4)::settings%args) ! allocate(character(len=6)::settings%runner) call cmd_run(settings, .true.) end program lfortran-0.63.0/integration_tests/format_48.f900000664000175000017500000000042315174404631021507 0ustar alastairalastairprogram mre_read_string_fmt implicit none character(len=3) :: local_chars integer :: basevalue local_chars = "1 0" read(local_chars, "(bn,g3.0)") basevalue if (basevalue /= 10) error stop "wrong value" print *, "test passed" end program mre_read_string_fmt lfortran-0.63.0/integration_tests/string_108.f900000664000175000017500000000045515174404631021607 0ustar alastairalastairprogram string_108 implicit none character(:), allocatable :: result integer :: i, n allocate(character(4) :: result) do i = 1, 4 n = i result(i:i) = '0123456789abcdef'(n:n) end do if (result /= '0123') error stop print *, result end program string_108 lfortran-0.63.0/integration_tests/arrays_op_3.f900000664000175000017500000000305015174404631022124 0ustar alastairalastairprogram array_op_3 implicit none integer :: a(2, 2, 1), b(2, 2, 1) logical :: c(2, 2, 1) integer :: i, j, k do i = 1, 2 do j = 1, 2 do k = 1, 1 a(i, j, k) = i/j b(i, j, k) = j/i end do end do end do c = a == b call check(c, a, b, 0) c = a /= b call check(c, a, b, 1) c = a < b call check(c, a, b, 2) c = b <= a call check(c, a, b, 3) c = b > a call check(c, a, b, 4) c = b >= a call check(c, a, b, 5) contains subroutine check(c, a, b, op_code) implicit none integer, intent(in) :: a(:, :, :), b(:, :, :) logical, intent(in) :: c(:, :, :) integer, intent(in) :: op_code integer :: i, j, k do i = lbound(a, 1), ubound(a, 1) do j = lbound(a, 2), ubound(a, 2) do k = lbound(a, 3), ubound(a, 3) select case(op_code) case (0) if(c(i, j, k) .neqv. (a(i, j, k) == b(i, j, k))) error stop case (1) if(c(i, j, k) .neqv. (a(i, j, k) /= b(i, j, k))) error stop case (2) if(c(i, j, k) .neqv. (a(i, j, k) < b(i, j, k))) error stop case (3) if(c(i, j, k) .neqv. (b(i, j, k) <= a(i, j, k))) error stop case (4) if(c(i, j, k) .neqv. (b(i, j, k) > a(i, j, k))) error stop case (5) if(c(i, j, k) .neqv. (b(i, j, k) >= a(i, j, k))) error stop end select end do end do end do end subroutine check end program lfortran-0.63.0/integration_tests/if_05.f900000664000175000017500000000164715174404631020617 0ustar alastairalastairprogram wasm_if implicit none logical :: x, y x = .true. y = .false. if ( x ) print *, "x: Single Line If" if ( y ) print *, "y: Single Line If" if ( x ) then print *, "x: Multi Line If-Else: x is True" else print *, "x: Multi Line If-Else: x is False" end if if ( y ) then print *, "y: Multi Line If-Else: y is True" else print *, "y: Multi Line If-Else: y is False" end if ! if else-if else ladder if ( x ) then print *, "x: If part" else if(x) then print *, "x: Else-If part" end if if ( y ) then print *, "y: If part" else if(x) then print *, "x: Else-If part" else print *, "Else part" end if if(y) then print *, "y: If part" else if(y) then print *, "y: Else-If part" else print *, "Else part" end if end program lfortran-0.63.0/integration_tests/gpu_metal_109.f900000664000175000017500000000053615174404631022257 0ustar alastairalastairprogram gpu_metal_109 implicit none integer :: pair real :: w(3,3), a(3), z(3) w = 0.5 a = 1.0 do concurrent (pair = 1:2) block z = matmul(w, a) end block end do if (abs(z(1) - 1.5) > 1.0e-6) error stop if (abs(z(2) - 1.5) > 1.0e-6) error stop if (abs(z(3) - 1.5) > 1.0e-6) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/separate_compilation_19.f900000664000175000017500000000041015174404631024413 0ustar alastairalastairprogram separate_compilation_19 use mod_separate_compilation_19, only : open_hashmap_type implicit none type(open_hashmap_type) :: map integer :: key = 1 call map % map_entry( key ) print *, key if (key /= 5) error stop end programlfortran-0.63.0/integration_tests/intrinsics_59.f900000664000175000017500000000043515174404631022411 0ustar alastairalastairprogram test_maxval implicit none type :: model_t integer, allocatable :: byte_encoder(:) end type type(model_t) :: m allocate(m%byte_encoder(5)) m%byte_encoder = 5 m%byte_encoder(2) = 14 print *, maxval(m%byte_encoder) if (maxval(m%byte_encoder) /= 14) error stop end program lfortran-0.63.0/integration_tests/concat_char_arrays_01.f900000664000175000017500000000052715174404631024036 0ustar alastairalastairprogram concat_char_arrays_01 implicit none character(8) :: a(2), b(3) character(16) :: c(2) integer :: i a = ['aa','a '] b = ['bb','b ',' '] c = a // b(1:2) if (c(1) /= 'aa bb ') error stop "c(1) wrong" if (c(2) /= 'a b ') error stop "c(2) wrong" end program concat_char_arrays_01lfortran-0.63.0/integration_tests/gpu_metal_100.f900000664000175000017500000000126515174404631022246 0ustar alastairalastair! Test: sum() on allocatable member of array-of-struct inside do concurrent. ! Previously generated invalid Metal shader due to missing ArrayBound/ArraySize ! handling for subscripted derived type allocatable members. program gpu_metal_100 implicit none type :: tensor_t real, allocatable :: v(:) end type integer :: i type(tensor_t) :: t(3) real :: r(3) allocate(t(1)%v(2), t(2)%v(3), t(3)%v(1)) t(1)%v = [1.0, 2.0] t(2)%v = [3.0, 4.0, 5.0] t(3)%v = [6.0] do concurrent (i = 1:3) r(i) = sum(t(i)%v) end do if (abs(r(1) - 3.0) > 1e-5) error stop if (abs(r(2) - 12.0) > 1e-5) error stop if (abs(r(3) - 6.0) > 1e-5) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/character_24.f900000664000175000017500000000142515174404631022150 0ustar alastairalastairprogram char_fn2 implicit none ! Compile with --implicit-interface character(2) :: cfn, s s = 'xx' s = cfn (-1) ! Not using substring notation, and cfn is not an array. So cfn is a function. print *, 's = ', s, merge (' : pass', ' : fail', s == 'ng') if (s /= 'ng') error stop s = 'xx' s = cfn (0) print *, 's = ', s, merge (' : pass', ' : fail', s == 'zr') if (s /= 'zr') error stop s = 'xx' s = cfn (1) print *, 's = ', s, merge (' : pass', ' : fail', s == 'pl') if (s /= 'pl') error stop print *, 'all tests passed' end program char_fn2 function cfn (i) character(2) :: cfn integer :: i print *, 'cfn: i =', i select case (i) case (:-1) cfn = 'ng' case (1:) cfn = 'pl' case default cfn = 'zr' end select end functionlfortran-0.63.0/integration_tests/intrinsics_364.f900000664000175000017500000000103115174404631022461 0ustar alastairalastairprogram intrinsics_364 real :: y(3, 10) real :: sum_tmp sum_tmp = 0.0 y = reshape([1.0, 1.0, 1.0, 1.11111116, 0.777777791, 1.0, 1.27160501, 0.561728418, & & 1.01234567, 1.46502066, 0.354938269, 1.01851845, 1.69410157, 0.157921821, & & 1.01406026, 1.96296299, -0.0290066153, 0.993426979, 2.2762537, -0.204880133,& & 0.949864626, 2.6391685, -0.368057907, 0.875255466, 3.05750966, -0.516141057,& & 0.759896517, 3.53775811, -0.645873308, 0.592240095], [3, 10]) print *, sum(y) if ( abs(sum(y) - 30.3195057) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/doloop_07.f900000664000175000017500000000050615174404631021510 0ustar alastairalastairprogram doloop_07 implicit none integer :: i, cnt cnt = 0 do i = 1, 10 if (i <= 5) then if (i == 1) then cnt = cnt + 1 if ( cnt == 1 ) exit end if end if cnt = cnt + 1 end do print *, cnt if (cnt /= 1) error stop end lfortran-0.63.0/integration_tests/cpp_pre_03.f900000664000175000017500000000056115174404631021641 0ustar alastairalastairprogram cpp_pre_03 #ifdef _WIN32 print *,"Windows" #endif #ifdef __linux__ print *,"Linux" #endif #ifdef __APPLE__ print *,"OSX" #endif #ifdef __aarch64__ print *,"Apple ARM" #endif #ifdef __x86_64__ print *,"Apple AMD" #endif #ifdef __FreeBSD__ print *,"FreeBSD" #endif #ifdef __OpenBSD__ print *,"OpenBSD" #endif print *, "Ok" end program lfortran-0.63.0/integration_tests/class_63_module_1.f900000664000175000017500000000012715174404631023107 0ustar alastairalastairmodule class_63_module_1 type, abstract :: AbsType end type AbsType end module lfortran-0.63.0/integration_tests/nested_03.f900000664000175000017500000000043015174404631021466 0ustar alastairalastairmodule nested_03_a implicit none contains subroutine b() real :: x x = 6 print *, "b()" call c() contains subroutine c() print *, 5 print *, x end subroutine c end subroutine b end module program nested_03 use nested_03_a, only: b implicit none call b() end lfortran-0.63.0/integration_tests/arrays_96.f900000664000175000017500000000054215174404631021525 0ustar alastairalastairprogram arrays_96 integer :: arr(2) arr(1) = 1 arr(2) = 121 call ff(arr) contains subroutine ff(s) integer, dimension(0:), intent(inout) :: s ! TODO: Fix case where intent is `unspecified` print *, s(0) if(s(0) /= 1) error stop print *, s(1) if(s(1) /= 121) error stop end subroutine end program lfortran-0.63.0/integration_tests/intrinsics_249.f900000664000175000017500000000106715174404631022474 0ustar alastairalastairprogram intrinsics_249 use iso_fortran_env, only: dp => real64 integer, parameter :: n = 1000 integer, parameter :: m = 1000 integer, dimension(n,m) :: x real(dp) :: res x = 18 res = var_2_iint8_dp(x, 1) print *, res if (abs(res - 18000000.0_dp) > 1e-12) error stop contains function var_2_iint8_dp(x, dim) result(res) use iso_fortran_env, only: dp => real64 integer, intent(in) :: x(:,:) integer, intent(in) :: dim real(dp) :: res res = sum(sum(abs(x), dim)) end function var_2_iint8_dp end programlfortran-0.63.0/integration_tests/do_concurrent_08.f900000664000175000017500000000167215174404631023066 0ustar alastairalastair! equivalent to openmp_14.f90 subroutine initialize_array(n, a) use omp_lib implicit none integer, intent(in) :: n real, dimension(n), intent(out) :: a integer :: i do concurrent (i=1:n) a(i) = 12.91 end do print *, a(1), a(n) end subroutine subroutine parallel_sum(n, a) use omp_lib implicit none integer, intent(in) :: n real, dimension(n), intent(in) :: a integer :: i real :: sum sum = 0.0 do concurrent (i=1:n) reduce(+:sum) sum = sum + a(i) end do print *, 'Sum = ', sum ! here we have precision error both with gfortran and lfortran ! setting different number of threads leads to different results ! but in any case output of gfortran and lfortran is the same if (abs(sum - 12905576.0) > 1e-8) error stop end subroutine program do_concurrent_08 use omp_lib integer, parameter :: n = 1000000 real, dimension(n) :: a call omp_set_num_threads(8) call initialize_array(n, a) call parallel_sum(n, a) print *, a(1), a(n) end program lfortran-0.63.0/integration_tests/block_15_mod.f900000664000175000017500000000012215174404631022136 0ustar alastairalastairmodule block_15_mod implicit none integer, parameter :: x = 42 end module lfortran-0.63.0/integration_tests/iso_fortran_env_03.f900000664000175000017500000000232215174404631023403 0ustar alastairalastairprogram iso_fortran_env_03 use iso_fortran_env, only: logical8, logical16, logical32, logical64, & real16, real128, & atomic_int_kind, atomic_logical_kind, & current_team, initial_team, parent_team, & stat_failed_image, stat_unlocked_failed_image implicit none ! F2023: Logical kind type parameters if (logical8 /= 1) error stop if (logical16 /= 2) error stop if (logical32 /= 4) error stop if (logical64 /= 8) error stop ! F2023: real16 (half-precision, may not be supported) ! real16 == -1 means not supported, which is valid if (real16 /= -1 .and. real16 <= 0) error stop ! real128 (quad-precision, may not be supported) if (real128 /= -1 .and. real128 <= 0) error stop ! F2018: Atomic kinds if (atomic_int_kind <= 0) error stop if (atomic_logical_kind <= 0) error stop ! F2018: Team constants (just need to be defined with distinct values) if (current_team == initial_team) error stop if (current_team == parent_team) error stop if (initial_team == parent_team) error stop ! F2018: Coarray failure stat constants if (stat_failed_image == stat_unlocked_failed_image) error stop end program iso_fortran_env_03 lfortran-0.63.0/integration_tests/format_27.f900000664000175000017500000000034015174404631021502 0ustar alastairalastairprogram format_27 write(*,"(EN0.0E0)") 3.14159 write(*,"(EN0.0E0)") 3.14 write(*,"(EN0.0E0)") 3.14E+03 write(*,"(EN0.0E0)") 30.14159 write(*,"(EN0.0E0)") 391.14 write(*,"(EN0.0E0)") 3.14E+04 end program format_27lfortran-0.63.0/integration_tests/string_59.f900000664000175000017500000000112115174404631021523 0ustar alastairalastairmodule string_59_mod contains subroutine ss(i) integer :: i character(len=3), save:: nan_string='NaN' print *, nan_string ! Checks if(i == 1) then if( nan_string /= "123") error stop else if ( i == 2 ) then if( nan_string /= "456") error stop end if ! Set if(i == 3) then nan_string = "123" else if (i == 4) then nan_string = "456" end if end subroutine end module program string_59 use string_59_mod call ss(3) call ss(1) call ss(4) call ss(2) end programlfortran-0.63.0/integration_tests/class_08.f900000664000175000017500000000266215174404631021327 0ustar alastairalastairmodule class_08_module implicit none private public :: toml_datetime, toml_date type :: toml_date integer :: year = 0 integer :: month = 0 integer :: day = 0 contains procedure, pass(rhs) :: to_string => date_to_string end type !> TOML datatime value type type :: toml_datetime type(toml_date), allocatable :: date contains procedure, pass(rhs) :: to_string => datetime_to_string end type contains subroutine date_to_string(lhs, rhs) character(len=:), allocatable, intent(out) :: lhs class(toml_date), intent(in) :: rhs allocate(character(10) :: lhs) write(lhs, "(i0, '-', i0, '-', i0)") rhs%day, rhs%month, rhs%year end subroutine date_to_string subroutine datetime_to_string(lhs, rhs) character(len=:), allocatable, intent(out) :: lhs class(toml_datetime), intent(in) :: rhs call rhs%date%to_string(lhs) end subroutine datetime_to_string end module class_08_module program class_08_program use class_08_module implicit none ! TODO ! character(:), allocatable :: date ! type(toml_datetime) :: t_datetime ! allocate(t_datetime%date) ! t_datetime%date%year = 2023 ! t_datetime%date%month = 08 ! t_datetime%date%day = 28 ! print *, t_datetime%date ! call t_datetime%to_string(date) ! if (date /= "28-8-2023") error stop print *, "ok" end program class_08_program lfortran-0.63.0/integration_tests/elemental_01.f900000664000175000017500000000102015174404631022144 0ustar alastairalastairprogram elemental_01 real :: x(4) print *, arg([(0.0, 1.0), (1.0, 0.0), (0.0, -1.0), (-1.0, 0.0)]) x = arg([(0.0, 1.0), (1.0, 0.0), (0.0, -1.0), (-1.0, 0.0)]) if (abs(x(1) - 1.57079637) > 1e-6) error stop if (abs(x(2) - 0.0) > 1e-6) error stop if (abs(x(3) + 1.57079637) > 1e-6) error stop if (abs(x(4) - 3.14159274) > 1e-6) error stop contains elemental function arg(z) result(result) complex, intent(in) :: z real :: result result = atan2(aimag(z), real(z)) end function arg end program elemental_01 lfortran-0.63.0/integration_tests/openmp_14.f900000664000175000017500000000174315174404631021514 0ustar alastairalastairsubroutine initialize_array(n, a) use omp_lib implicit none integer, intent(in) :: n real, dimension(n), intent(out) :: a integer :: i !$omp parallel !$omp do do i = 1, n a(i) = 12.91 end do !$omp end do !$omp end parallel print *, a(1), a(n) end subroutine subroutine parallel_sum(n, a) use omp_lib implicit none integer, intent(in) :: n real, dimension(n), intent(in) :: a integer :: i real :: sum sum = 0.0 !$omp parallel do reduction(+:sum) do i = 1, n sum = sum + a(i) end do !$omp end parallel do print *, 'Sum = ', sum ! here we have precision error both with gfortran and lfortran ! setting different number of threads leads to different results ! but in any case output of gfortran and lfortran is the same if (abs(sum - 12905576.0) > 1e-8) error stop end subroutine program openmp_14 use omp_lib integer, parameter :: n = 1000000 real, dimension(n) :: a call omp_set_num_threads(8) call initialize_array(n, a) call parallel_sum(n, a) print *, a(1), a(n) end program lfortran-0.63.0/integration_tests/functions_23.f900000664000175000017500000000065115174404631022223 0ustar alastairalastairprogram functions_23 real :: x(5, 5) real :: res(5) x = 4.59 res = corr_2_rsp_rsp(x, 1) print *, res if (any(abs(res - 21.0681019) > 1e-6)) error stop contains function corr_2_rsp_rsp(x, dim, mask) result(res) real, intent(in) :: x(:, :) integer, intent(in) :: dim logical, intent(in), optional :: mask real :: res(merge(size(x, 1), size(x, 2), mask = 1 neq end type shlex_token contains logical function neq(a, b) class(shlex_token), intent(in) :: a, b if (.not.allocated(a%text) .or. .not.allocated(b%text)) then neq = allocated(a%text) .neqv. allocated(b%text) else neq = (a%text /= b%text) end if end function neq end module program derived_types_85 use derived_types_85_module implicit none type(shlex_token), allocatable :: list(:), lmsvcrt(:) integer :: i allocate(list(3), lmsvcrt(3)) list(1)%text = "foo" list(2)%text = "bar" list(3)%text = "baz" lmsvcrt(1)%text = "foo" lmsvcrt(2)%text = "BAR" lmsvcrt(3)%text = "baz" if (list(1) /= lmsvcrt(1)) error stop if (.not.(list(2) /= lmsvcrt(2))) error stop if (list(3) /= lmsvcrt(3)) error stop end program lfortran-0.63.0/integration_tests/intrinsics_300.f900000664000175000017500000000020415174404631022450 0ustar alastairalastairprogram intrinsics_300 integer, parameter :: ar1 = kind([1.0, 1.0]) print *, ar1 if ( ar1 /= 4 ) error stop end program lfortran-0.63.0/integration_tests/arrays_114.f900000664000175000017500000000146415174404631021600 0ustar alastairalastair! This program caused a segfault due to memory leak in ReAlloc Node inside array_op pass program arrays_113 implicit none integer, parameter :: n = 10 integer :: i, j integer, dimension(:,:,:), allocatable :: perimeter do i = 1, n do j = 1, n if (allocated(perimeter)) deallocate(perimeter) call go(i) if (perimeter(1,i,j) /= i) error stop if (perimeter(2,i,j) /= i) error stop if (perimeter(3,i,j) /= i) error stop if (perimeter(4,i,j) /= i) error stop end do end do contains subroutine go(i) integer, intent(in) :: i if (.not. allocated(perimeter)) then allocate(perimeter(4, n, n)) perimeter = i end if end subroutine go end program arrays_113lfortran-0.63.0/integration_tests/sync_memory_01.f900000664000175000017500000000013115174404631022544 0ustar alastairalastairprogram sync_memory_01 implicit none sync memory print *, "sync memory done" end program lfortran-0.63.0/integration_tests/bindc_39.f900000664000175000017500000001067015174404631021303 0ustar alastairalastair! Test: C_LONG_DOUBLE constants, TYPE(*) scalar/assumed-size, assumed-size arrays ! ! Covers: ! - C_LONG_DOUBLE and C_LONG_DOUBLE_COMPLEX named constants exist ! - TYPE(*) with scalar (not assumed-rank) ! - TYPE(*) with assumed-size dimension(*) ! - Assumed-size integer/real arrays in BIND(C) ! - BIND(C) on BLOCK DATA with COMMON module bindc_39_ifaces use iso_c_binding implicit none interface ! ---- TYPE(*) scalar ---- integer(c_int) function c39_type_star_scalar(x) bind(C) import :: c_int type(*), intent(in) :: x end function ! ---- TYPE(*) assumed-size ---- integer(c_int) function c39_type_star_assumed_size(x, n) bind(C) import :: c_int type(*), intent(in) :: x(*) integer(c_int), value :: n end function ! ---- Assumed-size integer array ---- integer(c_int) function c39_sum_assumed_size_int(arr, n) bind(C) import :: c_int integer(c_int), intent(in) :: arr(*) integer(c_int), value :: n end function ! ---- Assumed-size real array ---- real(c_double) function c39_sum_assumed_size_dbl(arr, n) bind(C) import :: c_int, c_double real(c_double), intent(in) :: arr(*) integer(c_int), value :: n end function ! ---- BLOCK DATA common block read ---- integer(c_int) function c39_get_common_a() bind(C) import :: c_int end function integer(c_int) function c39_get_common_b() bind(C) import :: c_int end function end interface end module block data bindc_39_block_data use iso_c_binding implicit none integer(c_int) :: bd_a, bd_b common /c39_bd_common/ bd_a, bd_b bind(C, name="c39_bd_common") :: /c39_bd_common/ data bd_a /111/, bd_b /222/ end block data program bindc_39 use iso_c_binding use bindc_39_ifaces implicit none call test_long_double_constants() call test_type_star() call test_assumed_size_arrays() call test_block_data_common() print *, "All bindc_39 tests passed." contains subroutine test_long_double_constants() integer :: kld, kldc kld = c_long_double kldc = c_long_double_complex ! Per F2018 §18.2.2: if the processor does not support a C type, ! the corresponding kind is negative. ! We just verify the constants are accessible and consistent. if (kld > 0) then ! Supported: must be a valid real kind if (kldc <= 0) error stop "FAIL: c_long_double supported but complex not" else ! Unsupported: must be negative if (kld /= -1 .and. kld /= -2 .and. kld /= -4) then ! Standard only says "negative", any negative is fine if (kld >= 0) error stop "FAIL: c_long_double not negative" end if end if end subroutine subroutine test_type_star() integer(c_int), target :: ival real(c_double), target :: dval integer(c_int) :: arr(5) integer(c_int) :: r ! TYPE(*) scalar: pass an integer ival = 42 r = c39_type_star_scalar(ival) ! C just reads the first sizeof(int) bytes if (r /= 42) error stop "FAIL: type(*) scalar int" ! TYPE(*) assumed-size: pass integer array arr = [10, 20, 30, 40, 50] r = c39_type_star_assumed_size(arr, 5_c_int) if (r /= 150) error stop "FAIL: type(*) assumed-size int sum" end subroutine subroutine test_assumed_size_arrays() integer(c_int) :: iarr(4) real(c_double) :: darr(3) integer(c_int) :: ri real(c_double) :: rd iarr = [1, 2, 3, 4] ri = c39_sum_assumed_size_int(iarr, 4_c_int) if (ri /= 10) error stop "FAIL: assumed-size int sum" darr = [1.5_c_double, 2.5_c_double, 3.0_c_double] rd = c39_sum_assumed_size_dbl(darr, 3_c_int) if (abs(rd - 7.0_c_double) > 1.0d-10) error stop "FAIL: assumed-size dbl sum" end subroutine subroutine test_block_data_common() integer(c_int) :: bd_a, bd_b common /c39_bd_common/ bd_a, bd_b ! BLOCK DATA initialized these to 111, 222 ! C reads via the bound common name if (c39_get_common_a() /= 111) error stop "FAIL: block data common a" if (c39_get_common_b() /= 222) error stop "FAIL: block data common b" end subroutine end program lfortran-0.63.0/integration_tests/derived_types_96.f900000664000175000017500000000360715174404631023077 0ustar alastairalastairmodule derived_types_96_mod implicit none public :: string_t, operator(.in.) type :: string_t character(len=:), allocatable :: s end type string_t interface operator(.in.) module procedure string_in_array end interface contains logical function string_in_array(lhs, rhs) character(len=*), intent(in) :: lhs type(string_t), intent(in) :: rhs(:) integer :: i string_in_array = .false. do i = 1, size(rhs) if (trim(lhs) == trim(rhs(i)%s)) then string_in_array = .true. return end if end do end function string_in_array end module derived_types_96_mod program derived_types_96 use derived_types_96_mod, only: string_t, operator(.in.) implicit none type :: source_t type(string_t), allocatable :: modules_provided(:) type(string_t), allocatable :: modules_used(:) end type source_t type(source_t) :: source integer :: j logical :: check(3) check = .false. allocate(source%modules_provided(1)) source%modules_provided(1)%s = "stdlib" allocate(source%modules_used(2)) source%modules_used(1)%s = "stdlib" source%modules_used(2)%s = "iso_c_binding" do j = 1, size(source%modules_used) if (source%modules_used(j)%s .in. source%modules_provided) check(j) = .true. deallocate(source%modules_provided) allocate(source%modules_provided(0)) end do if (check(1) .neqv. .true. .or. check(2) .neqv. .false. .or. check(3) .neqv. .false.) error stop "Test failed" check = .false. do j = 1, size(source%modules_used) if (source%modules_used(j)%s .in. source%modules_provided) check(j) = .true. end do if (check(1) .neqv. .false. .or. check(2) .neqv. .false. .or. check(3) .neqv. .false.) error stop "Test failed" end program derived_types_96lfortran-0.63.0/integration_tests/read_66.f900000664000175000017500000002003415174404631021132 0ustar alastairalastair! Test reading into arrays with stride > 1 and stride = 1, for various types. program read_66 use, intrinsic :: iso_fortran_env, only: int8, int16, int32, int64, real32, real64 implicit none call test_int8() call test_int16() call test_int32() call test_int64() call test_real32() call test_real64() call test_logical4() call test_complex32() call test_complex64() contains subroutine test_int8() integer(int8) :: a(10, 10) integer :: i, u, ios character(len=200) :: msg a = -99_int8 open(newunit=u, status="scratch", form="formatted") write(u, *) (1_int8, i=1, 10) rewind(u) read(u, *, iostat=ios, iomsg=msg) a(1, :) if (ios /= 0) error stop "read_66 int8 stride>1 iostat" if (.not. all(a(1, :) == 1_int8)) error stop "read_66 int8 stride>1 value" a = -99_int8 rewind(u) write(u, *) (2_int8, i=1, 10) rewind(u) read(u, *, iostat=ios, iomsg=msg) a(:, 1) close(u) if (ios /= 0) error stop "read_66 int8 stride=1 iostat" if (.not. all(a(:, 1) == 2_int8)) error stop "read_66 int8 stride=1 value" end subroutine test_int8 subroutine test_int16() integer(int16) :: a(10, 10) integer :: i, u, ios character(len=200) :: msg a = -999_int16 open(newunit=u, status="scratch", form="formatted") write(u, *) (3_int16, i=1, 10) rewind(u) read(u, *, iostat=ios, iomsg=msg) a(1, :) if (ios /= 0) error stop "read_66 int16 stride>1 iostat" if (.not. all(a(1, :) == 3_int16)) error stop "read_66 int16 stride>1 value" a = -999_int16 rewind(u) write(u, *) (4_int16, i=1, 10) rewind(u) read(u, *, iostat=ios, iomsg=msg) a(:, 1) close(u) if (ios /= 0) error stop "read_66 int16 stride=1 iostat" if (.not. all(a(:, 1) == 4_int16)) error stop "read_66 int16 stride=1 value" end subroutine test_int16 subroutine test_int32() integer(int32) :: a(10, 10) integer :: i, u, ios character(len=200) :: msg a = -999_int32 open(newunit=u, status="scratch", form="formatted") write(u, *) (5_int32, i=1, 10) rewind(u) read(u, *, iostat=ios, iomsg=msg) a(1, :) if (ios /= 0) error stop "read_66 int32 stride>1 iostat" if (.not. all(a(1, :) == 5_int32)) error stop "read_66 int32 stride>1 value" a = -999_int32 rewind(u) write(u, *) (6_int32, i=1, 10) rewind(u) read(u, *, iostat=ios, iomsg=msg) a(:, 1) close(u) if (ios /= 0) error stop "read_66 int32 stride=1 iostat" if (.not. all(a(:, 1) == 6_int32)) error stop "read_66 int32 stride=1 value" end subroutine test_int32 subroutine test_int64() integer(int64) :: a(10, 10) integer :: i, u, ios character(len=200) :: msg a = -999_int64 open(newunit=u, status="scratch", form="formatted") write(u, *) (7_int64, i=1, 10) rewind(u) read(u, *, iostat=ios, iomsg=msg) a(1, :) if (ios /= 0) error stop "read_66 int64 stride>1 iostat" if (.not. all(a(1, :) == 7_int64)) error stop "read_66 int64 stride>1 value" a = -999_int64 rewind(u) write(u, *) (8_int64, i=1, 10) rewind(u) read(u, *, iostat=ios, iomsg=msg) a(:, 1) close(u) if (ios /= 0) error stop "read_66 int64 stride=1 iostat" if (.not. all(a(:, 1) == 8_int64)) error stop "read_66 int64 stride=1 value" end subroutine test_int64 subroutine test_real32() real(real32) :: a(10, 10) integer :: i, u, ios character(len=200) :: msg a = -999.0_real32 open(newunit=u, status="scratch", form="formatted") write(u, *) (1.0_real32, i=1, 10) rewind(u) read(u, *, iostat=ios, iomsg=msg) a(1, :) if (ios /= 0) error stop "read_66 real32 stride>1 iostat" if (.not. all(a(1, :) == 1.0_real32)) error stop "read_66 real32 stride>1 value" a = -999.0_real32 rewind(u) write(u, *) (2.0_real32, i=1, 10) rewind(u) read(u, *, iostat=ios, iomsg=msg) a(:, 1) close(u) if (ios /= 0) error stop "read_66 real32 stride=1 iostat" if (.not. all(a(:, 1) == 2.0_real32)) error stop "read_66 real32 stride=1 value" end subroutine test_real32 subroutine test_real64() real(real64) :: a(10, 10) integer :: i, u, ios character(len=200) :: msg a = -999.0_real64 open(newunit=u, status="scratch", form="formatted") write(u, *) (3.0_real64, i=1, 10) rewind(u) read(u, *, iostat=ios, iomsg=msg) a(1, :) if (ios /= 0) error stop "read_66 real64 stride>1 iostat" if (.not. all(a(1, :) == 3.0_real64)) error stop "read_66 real64 stride>1 value" a = -999.0_real64 rewind(u) write(u, *) (4.0_real64, i=1, 10) rewind(u) read(u, *, iostat=ios, iomsg=msg) a(:, 1) close(u) if (ios /= 0) error stop "read_66 real64 stride=1 iostat" if (.not. all(a(:, 1) == 4.0_real64)) error stop "read_66 real64 stride=1 value" end subroutine test_real64 subroutine test_logical4() logical :: a(10, 10) integer :: i, u, ios character(len=200) :: msg a = .false. open(newunit=u, status="scratch", form="formatted") write(u, *) (.true., i=1, 10) rewind(u) read(u, *, iostat=ios, iomsg=msg) a(1, :) if (ios /= 0) error stop "read_66 logical stride>1 iostat" if (.not. all(a(1, :))) error stop "read_66 logical stride>1 value" a = .false. rewind(u) write(u, *) (.true., i=1, 10) rewind(u) read(u, *, iostat=ios, iomsg=msg) a(:, 1) close(u) if (ios /= 0) error stop "read_66 logical stride=1 iostat" if (.not. all(a(:, 1))) error stop "read_66 logical stride=1 value" end subroutine test_logical4 subroutine test_complex32() complex(real32) :: a(10, 10) complex(real32) :: v1, v2 integer :: i, u, ios character(len=200) :: msg v1 = cmplx(1.0_real32, 2.0_real32, kind=real32) v2 = cmplx(3.0_real32, 4.0_real32, kind=real32) a = cmplx(-1.0_real32, -1.0_real32, kind=real32) open(newunit=u, status="scratch", form="formatted") write(u, *) (v1, i=1, 10) rewind(u) read(u, *, iostat=ios, iomsg=msg) a(1, :) if (ios /= 0) error stop "read_66 complex32 stride>1 iostat" if (.not. all(a(1, :) == v1)) error stop "read_66 complex32 stride>1 value" a = cmplx(-1.0_real32, -1.0_real32, kind=real32) rewind(u) write(u, *) (v2, i=1, 10) rewind(u) read(u, *, iostat=ios, iomsg=msg) a(:, 1) close(u) if (ios /= 0) error stop "read_66 complex32 stride=1 iostat" if (.not. all(a(:, 1) == v2)) error stop "read_66 complex32 stride=1 value" end subroutine test_complex32 subroutine test_complex64() complex(real64) :: a(10, 10) complex(real64) :: v1, v2 integer :: i, u, ios character(len=200) :: msg v1 = cmplx(5.0_real64, 6.0_real64, kind=real64) v2 = cmplx(7.0_real64, 8.0_real64, kind=real64) a = cmplx(-1.0_real64, -1.0_real64, kind=real64) open(newunit=u, status="scratch", form="formatted") write(u, *) (v1, i=1, 10) rewind(u) read(u, *, iostat=ios, iomsg=msg) a(1, :) if (ios /= 0) error stop "read_66 complex64 stride>1 iostat" if (.not. all(a(1, :) == v1)) error stop "read_66 complex64 stride>1 value" a = cmplx(-1.0_real64, -1.0_real64, kind=real64) rewind(u) write(u, *) (v2, i=1, 10) rewind(u) read(u, *, iostat=ios, iomsg=msg) a(:, 1) close(u) if (ios /= 0) error stop "read_66 complex64 stride=1 iostat" if (.not. all(a(:, 1) == v2)) error stop "read_66 complex64 stride=1 value" end subroutine test_complex64 end program read_66 lfortran-0.63.0/integration_tests/file_24.f900000664000175000017500000000153115174404631021131 0ustar alastairalastairprogram file_24 implicit none integer :: unit_no character(len=100) :: line character(len=100) :: filename filename = 'file_22_data.txt ' unit_no = 2 open (unit_no, file=filename) read(unit_no, *) line print *, "Contents of 'file_22_data.txt': ", line close(unit_no) open (unit_no, file="file_22_data.txt ") read(unit_no, *) line print *, "Contents of 'file_22_data.txt': ", line close(unit_no) print * open (unit_no, file="file 24 data.txt ") read(unit_no, *) line print *, "Contents of 'file 24 data.txt': ", line close(unit_no) filename = 'file 24 data.txt ' open (unit_no, file=filename) read(unit_no, *) line print *, "Contents of 'file 24 data.txt': ", line close(unit_no) end program file_24 lfortran-0.63.0/integration_tests/gpu_metal_14.f900000664000175000017500000000105315174404631022165 0ustar alastairalastairprogram gpu_metal_14 ! Multiple arrays combined: z = alpha*x + beta*y implicit none integer, parameter :: n = 50000 real :: x(n), y(n), z(n), z_expected(n) real :: alpha, beta integer :: i alpha = 2.5 beta = -1.5 do i = 1, n x(i) = real(i) * 0.1 y(i) = real(n - i + 1) * 0.1 z(i) = 0.0 z_expected(i) = alpha * real(i) * 0.1 + beta * real(n - i + 1) * 0.1 end do do concurrent (i = 1:n) z(i) = alpha * x(i) + beta * y(i) end do do i = 1, n if (abs(z(i) - z_expected(i)) > 1.0e-3) error stop end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/do_concurrent_10.f900000664000175000017500000000151515174404631023053 0ustar alastairalastair! equivalent to openmp_16.f90 subroutine initialize_array(n, m, b) implicit none integer, intent(in) :: n, m double precision, intent(out) :: b(n, m) integer :: i do concurrent (i=1:n) shared(b, n) b(i, :) = 12.9d0 end do end subroutine subroutine parallel_sum(n, m, b) implicit none integer, intent(in) :: n, m double precision, intent(out) :: b(n, m) double precision :: res integer :: i res = 0.0d0 do concurrent (i=1:n) reduce(+:res) shared(b, n) res = res + sum(b(i, :)) end do print *, 'Sum = ', res if (abs(res - 7455168.0000000438d0) > 1e-12) error stop end subroutine program do_concurrent_10 use omp_lib integer, parameter :: n = 1920, m = 301 double precision, dimension(n, m) :: a print *, a(2, 3) call omp_set_num_threads(8) call initialize_array(n, m, a) print *, a(2, 3) call parallel_sum(n, m, a) end program lfortran-0.63.0/integration_tests/fixed_form_comment_01.f900000664000175000017500000000012715174404631024051 0ustar alastairalastairc comment line integer a a=1 if (a .ne. 1) error stop end lfortran-0.63.0/integration_tests/pure_side_effects_02.f900000664000175000017500000000105715174404631023667 0ustar alastairalastairprogram pure_side_effects_02 implicit none integer, allocatable :: a(:), b(:) allocate(a(3)) a = [1, 2, 3] call pure_move(a, b) if (size(b) /= 3) error stop if (b(1) /= 1) error stop if (b(2) /= 2) error stop if (b(3) /= 3) error stop if (allocated(a)) error stop contains pure subroutine pure_move(src, dst) integer, allocatable, intent(inout) :: src(:) integer, allocatable, intent(out) :: dst(:) call move_alloc(src, dst) end subroutine pure_move end program pure_side_effects_02 lfortran-0.63.0/integration_tests/class_33.f900000664000175000017500000000076715174404631021331 0ustar alastairalastairprogram class_33 implicit none type :: val_type integer :: origin = 3 end type class(val_type), allocatable :: val1 allocate(val1) call sub(val1) print *, "Outside val1%origin: ", val1%origin if (val1%origin /= 5) error stop contains subroutine sub(val) type(val_type), intent(inout) :: val print *, "Inside subroutine, val%origin: ", val%origin if (val%origin /= 3) error stop val%origin = 5 end subroutine sub end program class_33 lfortran-0.63.0/integration_tests/openmp_51.f900000664000175000017500000000100115174404631021500 0ustar alastairalastairprogram openmp_51 use omp_lib implicit none call omp_set_num_threads(10) !$omp parallel if(omp_get_thread_num() == 0) then !$omp task print *, "Task 0 done by TID:-",omp_get_thread_num() !$omp end task end if if(omp_get_thread_num() == 1) then !$omp task print *, "Task 1 done by TID:-",omp_get_thread_num() !$omp end task end if !$omp end parallel end program openmp_51lfortran-0.63.0/integration_tests/arrays_reshape_23.f900000664000175000017500000000200515174404631023216 0ustar alastairalastairmodule lincoa_mod implicit none contains subroutine get_lincon(amat) implicit none real, intent(out), allocatable :: amat(:, :) integer :: m, n m = 3 n = 2 allocate(amat(m, n)) amat = reshape([1., 2., 3., 4., 5., 6.], shape(amat)) end subroutine get_lincon subroutine get_lincon1(amat) implicit none real, intent(out), allocatable :: amat(:, :) integer :: m, n m = 3 n = 2 amat = reshape([4., 5., 6., 1., 2., 3.], [m, n]) end subroutine get_lincon1 end module lincoa_mod program arrays_reshape_23 use lincoa_mod implicit none real, allocatable :: a(:, :), b(:, :) call get_lincon(a) print *, a if( any(a(:, 1) /= [1.0, 2.0, 3.0]) ) error stop if( any(a(:, 2) /= [4.0, 5.0, 6.0]) ) error stop call get_lincon1(b) print *, b if( any(b(:, 1) /= [4.0, 5.0, 6.0]) ) error stop if( any(b(:, 2) /= [1.0, 2.0, 3.0]) ) error stop end program arrays_reshape_23 lfortran-0.63.0/integration_tests/modules_48.f900000664000175000017500000000704315174404631021674 0ustar alastairalastairmodule modules_48_fpm_strings implicit none type string_t character(len=:), allocatable :: s end type interface fnv_1a procedure :: fnv_1a_char procedure :: fnv_1a_string_t end interface fnv_1a contains pure function fnv_1a_char(input, seed) result(hash) character(*), intent(in) :: input integer(8), intent(in), optional :: seed integer(8) :: hash integer :: i integer(8), parameter :: FNV_OFFSET_32 = 2166136261_8 integer(8), parameter :: FNV_PRIME_32 = 16777619_8 if (present(seed)) then hash = seed else hash = FNV_OFFSET_32 end if do i = 1, len(input) hash = ieor(hash, iachar(input(i:i), 8)) * FNV_PRIME_32 end do end function fnv_1a_char pure function fnv_1a_string_t(input, seed) result(hash) type(string_t), intent(in) :: input(:) integer(8), intent(in), optional :: seed integer(8) :: hash integer :: i hash = fnv_1a(input(1)%s,seed) do i = 2, size(input) hash = fnv_1a(input(i)%s,hash) end do end function fnv_1a_string_t function is_fortran_name(line) result (lout) character(len=*), parameter :: int = '0123456789' character(len=*), parameter :: lower = 'abcdefghijklmnopqrstuvwxyz' character(len=*), parameter :: upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' character(len=*), parameter :: allowed = upper // lower // int // '_' character(len=*), intent(in) :: line character(len=:), allocatable :: name logical :: lout name = trim(line) if( len(name) /= 0 ) then lout = .true. & & .and. verify(name(1:1), lower//upper) == 0 & & .and. verify(name, allowed) == 0 & & .and. len(name) <= 63 else lout = .false. end if end function is_fortran_name function string_cat(strings, delim) result(cat) type(string_t), intent(in) :: strings(:) character(*), intent(in), optional :: delim character(:), allocatable :: cat integer :: i character(:), allocatable :: delim_str if (size(strings) < 1) then cat = '' return end if if (present(delim)) then delim_str = delim else delim_str = '' end if cat = strings(1)%s do i=2,size(strings) cat = cat//delim_str//strings(i)%s end do end function string_cat end module program modules_48 use modules_48_fpm_strings implicit none character(len=40) :: char_str character(len=:), allocatable :: char_str_alloc, cat_str_alloc integer(8) :: char_str_hash1, char_str_hash2 integer(8) :: char_str_hash3, char_str_hash4 type(string_t) :: string_var(2) allocate(character(len=40) :: char_str_alloc) char_str_alloc = "runningmodules_48_1" string_var(1)%s = char_str_alloc char_str = "runningmodules_48_2" string_var(2)%s = char_str char_str_hash1 = fnv_1a(char_str, 2166136261_8) char_str_hash2 = fnv_1a(char_str) print *, char_str_hash1, char_str_hash2 if( char_str_hash1 /= char_str_hash2 ) error stop char_str_hash3 = fnv_1a_string_t(string_var, 2166136261_8) char_str_hash4 = fnv_1a_string_t(string_var) print *, char_str_hash3, char_str_hash4 if( char_str_hash3 /= char_str_hash4 ) error stop cat_str_alloc = string_cat(string_var, ":") print *, cat_str_alloc, is_fortran_name(cat_str_alloc) if( cat_str_alloc /= "runningmodules_48_1:runningmodules_48_2" ) error stop if( is_fortran_name(cat_str_alloc) ) error stop cat_str_alloc = string_cat(string_var) print *, cat_str_alloc, is_fortran_name(cat_str_alloc) if( cat_str_alloc /= "runningmodules_48_1runningmodules_48_2" ) error stop if( .not. is_fortran_name(cat_str_alloc) ) error stop end program lfortran-0.63.0/integration_tests/derived_types_54.f900000664000175000017500000000147715174404631023074 0ustar alastairalastairmodule derived_types_54_m implicit none type :: Base contains procedure :: get_out => Base_get_out end type type, extends(Base) :: Derived contains procedure :: get_out => Derived_get_out end type contains subroutine Base_get_out(self, outi) class(Base) :: self integer :: outi outi = 1 end subroutine subroutine Derived_get_out(self, outi) class(Derived) :: self integer :: outi outi = 2 end subroutine end module program derived_types_54 use derived_types_54_m implicit none type(Base) :: b type(Derived) :: d integer :: outi call d%get_out(outi) if (outi /= 2) error stop call b%get_out(outi) if (outi /= 1) error stop end program lfortran-0.63.0/integration_tests/format_22.f900000664000175000017500000000237215174404631021504 0ustar alastairalastairprogram format_22 implicit none integer :: x, y, z integer(8) :: x8, y8, z8 integer(1) :: x1, y1, z1 integer(2) :: x2, y2, z2 x = 21 y = 100 z = 0 x8 = 31 y8 = 10 z8 = 0 x1 = 11 y1 = 10 z1 = 0 x2 = 9 y2 = 42 z2 = 0 print *, "b format for integer(4)" print '(B0)', x print '(B1)', x print '(B2)', x print '(B3)', x print '(B4)', x print '(B5)', x print '(B6)', x print '(B7)', x print '(B8)', x print '(B9)', x print '(B10)', x print "(a,b32,a)",'-1 in b32 format: "', -1,'"' print "(a,b0 ,a)",'-1 in b0 format: "', -1,'"' print "(a,b32 ,a)",'10 in b32 format: "', 10,'"' print "(a,b0 ,a)",'11 in b0 format: "', 11,'"' print '(B0)', y print '(B4)', y print '(B5)', y print '(B10)', y print '(B0)', z print '(B4)', z print *, "b format for integer(8)" print '(B0)', x8 print '(B7)', x8 print '(B4)', y8 print '(B5)', y8 print '(B10)', z8 print '(B0)', z8 print *, "b format for integer(1)" print '(B4)', x1 print '(B5)', x1 print '(B10)', y1 print '(B0)', y1 print '(B4)', z1 print '(B5)', z1 print *, "b format for integer(2)" print '(B10)', x2 print '(B0)', x2 print '(B4)', y2 print '(B5)', y2 print '(B10)', z2 print '(B0)', z2 end program format_22lfortran-0.63.0/integration_tests/string_111.f900000664000175000017500000000067115174404631021601 0ustar alastairalastairprogram string_111 implicit none if (.not. ('a' < CHAR(255))) error stop if (.not. (CHAR(0) < CHAR(255))) error stop if (.not. (CHAR(127) < CHAR(128))) error stop if (.not. (CHAR(255) > 'a')) error stop if (.not. (CHAR(255) >= CHAR(255))) error stop if (.not. (CHAR(200) <= CHAR(200))) error stop if (.not. (CHAR(100) /= CHAR(200))) error stop if (.not. (CHAR(200) == CHAR(200))) error stop end program lfortran-0.63.0/integration_tests/separate_compilation_21b.f900000664000175000017500000000047415174404631024560 0ustar alastairalastairsubmodule (math_separate_compilation_21) log_separate_compilation_21 implicit none contains module procedure func1 real, parameter :: array(2) = [1.0 , 2.0] res = array end procedure module procedure func2 integer, parameter :: array(2) = [1 , 2] res = array end procedure end submodulelfortran-0.63.0/integration_tests/derived_types_114_module.f900000664000175000017500000000217315174404631024510 0ustar alastairalastair! Test: intrinsic assignment of a derived type uses defined assignment ! for components that have assignment(=) defined. module derived_types_114_module implicit none type :: ref_counter_t integer, pointer :: count_ => null() contains procedure :: assign_ref_counter generic :: assignment(=) => assign_ref_counter final :: finalize_ref_counter end type type :: wrapper_t type(ref_counter_t) :: counter integer :: val end type contains subroutine assign_ref_counter(lhs, rhs) class(ref_counter_t), intent(inout) :: lhs class(ref_counter_t), intent(in) :: rhs lhs%count_ => rhs%count_ if (associated(lhs%count_)) lhs%count_ = lhs%count_ + 1 end subroutine subroutine finalize_ref_counter(self) type(ref_counter_t), intent(inout) :: self if (associated(self%count_)) then self%count_ = self%count_ - 1 if (self%count_ == 0) then deallocate(self%count_) else self%count_ => null() end if end if end subroutine end module lfortran-0.63.0/integration_tests/gpu_metal_91.f900000664000175000017500000000134215174404631022173 0ustar alastairalastair! Test: calling a function with an element of an array-of-structs ! where the struct has an allocatable array member, inside do concurrent. ! The function accesses the allocatable member of the struct argument. module gpu_metal_91_m implicit none type :: t real, allocatable :: v(:) end type contains pure function get_first(x) result(r) type(t), intent(in) :: x real :: r r = x%v(1) end function end module program gpu_metal_91 use gpu_metal_91_m implicit none type(t) :: a(2) real :: r(2) integer :: i a(1) = t([1.0]) a(2) = t([2.0]) do concurrent (i = 1:2) r(i) = get_first(a(i)) end do if (abs(r(1) - 1.0) > 1e-6 .or. abs(r(2) - 2.0) > 1e-6) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/separate_compilation_09a.f900000664000175000017500000000025415174404631024561 0ustar alastairalastairmodule mpi_c_bindings_separate_compilation_09a integer(kind=4), bind(C, name="c_MPI_COMM_WORLD") :: c_mpi_comm_world end module mpi_c_bindings_separate_compilation_09a lfortran-0.63.0/integration_tests/doloop_04.f900000664000175000017500000000110415174404631021500 0ustar alastairalastairprogram doloop_04 implicit none integer :: i, j, k j = 0 k = 2 do i = 1, 10, k j = j + i end do if (j /= 25) error stop print *, j j = 0 k = -2 do i = 10, 1, k j = j + i end do if (j /= 30) error stop print *, j j = 0 a: do i = 1, 10 j = j + i if (i == 2) exit a end do a if (j /= 3) error stop j = 0 b: do i = 1, 10, 2 j = j + i if (i == 3) exit b end do b if (j /= 4) error stop j = 0 i = 1 c: do j = j + i if (i == 2) exit c i = i + 1 end do c if (j /= 3) error stop !test-issue 746 k = 2 do i = 1, 10, k 100 continue end do end lfortran-0.63.0/integration_tests/openmp_01.f900000664000175000017500000000054515174404631021507 0ustar alastairalastairsubroutine omp_func(n) implicit none integer, intent(in) :: n integer :: i !$omp parallel private(i) shared(n) !$omp do do i = 1, n print *, "xyz" end do !$omp end do !$omp end parallel print *, "n = ", n if (n /= 100) error stop end subroutine program openmp_01 integer, parameter :: n = 100 call omp_func(n) print *, "Done for n = ", n end program lfortran-0.63.0/integration_tests/test_ieee_unordered.f900000664000175000017500000000560315174404631023726 0ustar alastairalastair! Test ieee_unordered function program test_ieee_unordered use, intrinsic :: ieee_arithmetic use, intrinsic :: iso_fortran_env, only: real32, real64 implicit none real(real32) :: x_sp, y_sp, nan_sp, tmp_sp real(real64) :: x_dp, y_dp logical :: result print *, "Testing ieee_unordered..." tmp_sp = 1.0_real32 ! Test 1: Two normal values (ordered) x_sp = 1.0_real32 y_sp = 2.0_real32 result = ieee_unordered(x_sp, y_sp) print *, "ieee_unordered(1.0, 2.0) = ", result if (result) error stop "1.0 and 2.0 should be ordered" ! Test 2: Same values (ordered) x_sp = 5.0_real32 y_sp = 5.0_real32 result = ieee_unordered(x_sp, y_sp) print *, "ieee_unordered(5.0, 5.0) = ", result if (result) error stop "5.0 and 5.0 should be ordered" ! Test 3: Zero and non-zero (ordered) x_sp = 0.0_real32 y_sp = 1.0_real32 result = ieee_unordered(x_sp, y_sp) print *, "ieee_unordered(0.0, 1.0) = ", result if (result) error stop "0.0 and 1.0 should be ordered" ! Test 4: Negative values (ordered) x_sp = -3.0_real32 y_sp = -7.0_real32 result = ieee_unordered(x_sp, y_sp) print *, "ieee_unordered(-3.0, -7.0) = ", result if (result) error stop "-3.0 and -7.0 should be ordered" ! Test 5: First is NaN (unordered) nan_sp = ieee_value(tmp_sp, ieee_quiet_nan) y_sp = 1.0_real32 result = ieee_unordered(nan_sp, y_sp) print *, "ieee_unordered(NaN, 1.0) = ", result if (.not. result) error stop "NaN and 1.0 should be unordered" ! Test 6: Second is NaN (unordered) x_sp = 2.0_real32 result = ieee_unordered(x_sp, nan_sp) print *, "ieee_unordered(2.0, NaN) = ", result if (.not. result) error stop "2.0 and NaN should be unordered" ! Test 7: Both are NaN (unordered) result = ieee_unordered(nan_sp, nan_sp) print *, "ieee_unordered(NaN, NaN) = ", result if (.not. result) error stop "NaN and NaN should be unordered" ! Test 8: Infinity and normal (ordered) x_sp = ieee_value(tmp_sp, ieee_positive_inf) y_sp = 100.0_real32 result = ieee_unordered(x_sp, y_sp) print *, "ieee_unordered(+inf, 100.0) = ", result if (result) error stop "+inf and 100.0 should be ordered" ! Test 9: Double precision normal values (ordered) x_dp = 1.5_real64 y_dp = 2.5_real64 result = ieee_unordered(x_dp, y_dp) print *, "ieee_unordered(1.5d0, 2.5d0) = ", result if (result) error stop "1.5d0 and 2.5d0 should be ordered" ! Test 10: Infinities (ordered) x_sp = ieee_value(tmp_sp, ieee_positive_inf) y_sp = ieee_value(tmp_sp, ieee_negative_inf) result = ieee_unordered(x_sp, y_sp) print *, "ieee_unordered(+inf, -inf) = ", result if (result) error stop "+inf and -inf should be ordered" print *, "All ieee_unordered tests passed!" end program test_ieee_unordered lfortran-0.63.0/integration_tests/return_05.f900000664000175000017500000000014315174404631021526 0ustar alastairalastairsubroutine f() end subroutine program main return print *, "Hello world" end program main lfortran-0.63.0/integration_tests/allocate_31.f900000664000175000017500000000232215174404631021773 0ustar alastairalastairmodule allocate_31_mod type, abstract :: Base contains procedure(work_interface), deferred :: work end type abstract interface subroutine work_interface(self) import Base class(Base), intent(inout) :: self end subroutine end interface type, extends(Base) :: Child integer :: value contains procedure :: work => child_work end type contains subroutine child_work(self) class(Child), intent(inout) :: self print *, "Child work called, value =", self%value end subroutine end module allocate_31_mod program allocate_31 use allocate_31_mod implicit none class(Base), allocatable :: src, obj ! Allocate src as Child type allocate(Child :: src) select type(src) type is (Child) src%value = 42 end select ! Allocate obj with mold=src (should get Child type but not copy data) allocate(obj, mold=src) ! Set obj's value select type(obj) type is (Child) obj%value = 123 if (obj%value /= 123) error stop "obj%value should be 123" end select ! Call deferred procedure call obj%work() end program allocate_31 lfortran-0.63.0/integration_tests/modules_63.f900000664000175000017500000000013315174404631021662 0ustar alastairalastairprogram test use mre_read_string_fmt_mod implicit none call temp() end program lfortran-0.63.0/integration_tests/file 24 data.txt0000664000175000017500000000001715174404631022143 0ustar alastairalastairHello LFortran!lfortran-0.63.0/integration_tests/intrinsics_306.f900000664000175000017500000000200415174404631022456 0ustar alastairalastairprogram intrinsics_306 implicit none real, parameter :: x1 = imagpart((1.0, 2.0)) real(8), parameter :: x2 = imagpart((1.0_8, 2.0_8)) real, parameter :: ar1(3) = imagpart([(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)]) real(8), parameter :: ar2(3) = imagpart([(1.0_8, 2.0_8), (3.0_8, 4.0_8), (5.0_8, 6.0_8)]) complex :: x = (1.0, 2.0) complex(8) :: y = (1.0_8, 2.0_8) complex :: z(3) = [(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)] print *, x1 if (x1 /= 2.0) error stop print *, x2 if (x2 /= 2.0_8) error stop print *, imagpart(x) if (imagpart(x) /= 2.0) error stop print *, imagpart(y) if (imagpart(y) /= 2.0_8) error stop print *, ar1 if (any(ar1 /= [2.0, 4.0, 6.0])) error stop print *, ar2 if (any(ar2 /= [2.0_8, 4.0_8, 6.0_8])) error stop print *, imagpart(x) if (imagpart(x) /= 2.0) error stop print *, imagpart(y) if (imagpart(y) /= 2.0_8) error stop print *, imagpart(z) if (any(imagpart(z) /= [2.0, 4.0, 6.0])) error stop end programlfortran-0.63.0/integration_tests/derived_type_with_default_init.f900000664000175000017500000000134515174404631026155 0ustar alastairalastairmodule module_derived_type_with_default_init public :: myType, global_myType type :: myType private logical :: a = .true. integer :: i = 2 contains private procedure, public, pass(self) :: config end type myType type(myType) :: global_myType contains subroutine config(self) class(myType), intent(in) :: self if (self % a .neqv. .true.) error stop if (self % i .ne. 2) error stop end subroutine config end module module_derived_type_with_default_init program derived_type_with_default_init use module_derived_type_with_default_init, global => global_myType call global % config() end program derived_type_with_default_initlfortran-0.63.0/integration_tests/class_82.f900000664000175000017500000000217215174404631021325 0ustar alastairalastairprogram class_82 implicit none class(*), allocatable :: xi, xr, xl integer :: i real :: r logical :: l ! Test integer binary operations allocate(xi, source=5) select type (xi) type is (integer) i = xi * 2 print *, i, xi if (i /= 10) error stop "Integer multiply failed" i = xi + 3 print *, i, xi if (i /= 8) error stop "Integer add failed" end select ! Test real binary operations allocate(xr, source=3.0) select type (xr) type is (real) r = xr * 2.0 print *, r, xr if (abs(r - 6.0) > 1e-5) error stop "Real multiply failed" r = xr + 1.5 print *, r, xr if (abs(r - 4.5) > 1e-5) error stop "Real add failed" end select ! Test logical binary operations allocate(xl, source=.true.) select type (xl) type is (logical) l = xl .and. .false. print *, l, xl if (l) error stop "Logical AND failed" l = xl .or. .false. print *, l, xl if (.not. l) error stop "Logical OR failed" end select print *, "PASSED" end program class_82 lfortran-0.63.0/integration_tests/implied_do_loops1.f900000664000175000017500000000032215174404631023304 0ustar alastairalastairprogram implied_do_loop1 integer :: j integer :: a(10)=(/(j,j=1,10)/) call s() print*, (a(j),j=1,10) contains subroutine s() print *, (j, j = 1, 3) end subroutine s end program lfortran-0.63.0/integration_tests/common_14.f900000664000175000017500000000064315174404631021504 0ustar alastairalastairprogram common_14 implicit none real :: x, y common /coords/ x, y x = 5.0 y = 10.0 call show_coords contains subroutine show_coords implicit none real :: x, y common /coords/ x, y print *, "x =", x, ", y =", y if ( abs(x - 5.0) > 1e-8 ) error stop if ( abs(y - 10.0) > 1e-8 ) error stop end subroutine show_coords end program common_14 lfortran-0.63.0/integration_tests/separate_compilation_20.f900000664000175000017500000000032615174404631024411 0ustar alastairalastairprogram separate_compilation_20 use stdlib_error_separate_compilation_20 implicit none integer :: tester = 1 call error_stop(tester) print *, tester if (tester /= 3) error stop end programlfortran-0.63.0/integration_tests/gpu_metal_147.f900000664000175000017500000000126315174404631022257 0ustar alastairalastairprogram gpu_metal_147 ! Test: gpu_offload resolves submodule type-bound procedure symbol ! from an external module during do concurrent offloading with ! --separate-compilation. Previously the transitive function ! collector did not load submodules from disk, so the nested ! type-bound procedure call inside the submodule body was missed. use gpu_metal_147_neural_network, only : neural_network_t implicit none type(neural_network_t) :: nn real :: x(10), y(10) integer :: i x = 1.0 y = 0.0 do concurrent (i = 1:10) y(i) = nn%infer(x(i)) end do print *, y if (abs(y(1) - 1.0) > 1e-6) error stop if (abs(y(5) - 1.0) > 1e-6) error stop if (abs(y(10) - 1.0) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/select_type_30.f900000664000175000017500000000137715174404631022537 0ustar alastairalastairmodule select_type_30_mod implicit none type, abstract :: base_type integer :: id = 0 end type base_type type, extends(base_type) :: derived_type real, allocatable :: values(:, :) end type derived_type type :: container_type class(base_type), allocatable :: obj end type container_type end module select_type_30_mod program select_type_30 use select_type_30_mod implicit none type(container_type) :: c type(derived_type) :: d integer :: n allocate(d%values(3, 4)) d%values = 1.0 d%id = 42 allocate(c%obj, source=d) n = 0 select type(current => c%obj) type is (derived_type) if (current%id /= 42) error stop n = size(current%values) end select if (n /= 12) error stop end program select_type_30lfortran-0.63.0/integration_tests/namelist_09.f900000664000175000017500000000234015174404631022030 0ustar alastairalastairprogram test_repeat implicit none ! Test repeat count syntax: n*value real :: arr(10) integer :: iarr(5) integer :: i namelist /repeat/ arr, iarr ! Initialize to sentinel values arr = -999.0 iarr = -999 ! Create input file with repeat counts open(unit=10, file='namelist_repeat.dat', status='replace', form='formatted') write(10, '(A)') ' &REPEAT' write(10, '(A)') ' arr = 10*3.14' write(10, '(A)') ' iarr = 5*42' write(10, '(A)') ' /' close(10) ! Read namelist with repeat counts open(unit=10, file='namelist_repeat.dat', status='old', form='formatted') read(10, nml=repeat) close(10) ! Verify all arr elements are 3.14 do i = 1, 10 if (abs(arr(i) - 3.14) > 1.0e-5) then print *, "Error: arr(", i, ") =", arr(i), "expected 3.14" error stop "Repeat count test failed for arr" end if end do ! Verify all iarr elements are 42 do i = 1, 5 if (iarr(i) /= 42) then print *, "Error: iarr(", i, ") =", iarr(i), "expected 42" error stop "Repeat count test failed for iarr" end if end do print *, "Repeat count namelist test passed!" end program test_repeat lfortran-0.63.0/integration_tests/gpu_metal_99.f900000664000175000017500000000046115174404631022204 0ustar alastairalastairprogram gpu_metal_99 implicit none real :: x(2, 2), res(2) integer :: i x = reshape([1.0, 2.0, 3.0, 4.0], [2, 2]) do concurrent (i = 1:2) res(i) = sum(x(:, i)) end do if (abs(res(1) - 3.0) > 1e-6) error stop if (abs(res(2) - 7.0) > 1e-6) error stop print *, "ALL PASSED" end program lfortran-0.63.0/integration_tests/bindc_09.f900000664000175000017500000000203115174404631021270 0ustar alastairalastairprogram bindc_09 ! Test: function declared EXTERNAL then defined locally ! Reproduces type mismatch when function is declared EXTERNAL (BindC ABI ! expected by caller) but defined locally (Source ABI, returns struct). ! The caller tries to convert struct to struct which fails without fix. implicit none ! Declare complex function as EXTERNAL - this makes caller expect BindC ABI complex :: get_complex_local external :: get_complex_local complex :: result ! Call the function - caller expects vector type return from EXTERNAL ! but function actually returns struct type since it's locally defined result = get_complex_local(1.0, 2.0) ! Verify result if (abs(real(result) - 1.0) > 1e-5) error stop if (abs(aimag(result) - 2.0) > 1e-5) error stop print *, "PASS" end program ! Local function definition - uses Source ABI, returns struct complex function get_complex_local(re, im) implicit none real, intent(in) :: re, im get_complex_local = cmplx(re, im) end function lfortran-0.63.0/integration_tests/present_08.f900000664000175000017500000000107015174404631021672 0ustar alastairalastairprogram present_08 implicit none real(8), pointer :: aptr(:,:,:) => null() logical :: res call client(ptr=aptr, res=res) if (.not. res) error stop "Test 1 failed: null pointer should be present" call client(res=res) if (res) error stop "Test 2 failed: absent arg should not be present" print *, "All tests passed" contains subroutine client(ptr, res) real(8), pointer, intent(out), optional :: ptr(:,:,:) logical, intent(out) :: res res = present(ptr) end subroutine client end program present_08 lfortran-0.63.0/integration_tests/complex_sub_test.f900000664000175000017500000000022115174404631023257 0ustar alastairalastairprogram complex2 complex :: x x = (3.0, 4.0) x = x - 4.0 x = 4.0 - x print *, x x = 2 - x print *, x x = (x - (0.0, 3.0)) print *, x end program lfortran-0.63.0/integration_tests/intrinsics_106.f900000664000175000017500000000025515174404631022462 0ustar alastairalastairprogram intrinsics_106 integer :: x(2, 3) print *, merge(size(x, 1), size(x, 2), mask = 1<0) if ( merge(size(x, 1), size(x, 2), mask = 1<0) /= 3 ) error stop endlfortran-0.63.0/integration_tests/matrix_01_transpose.f900000664000175000017500000000254415174404631023614 0ustar alastairalastairprogram matrix_01_tranpose implicit none integer :: i, j, a(3, 4), b(4, 3) real :: x(5, 5), y(5, 5) double precision :: d(1,2), e(2,1) complex :: c(2, 2), f(2, 2) logical :: l(12, 31), m(31, 12) a = reshape( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [3, 4] ) b = transpose(a) do i = lbound(a, 1), ubound(a, 1) do j = lbound(a, 2), ubound(a, 2) if (a(i, j) /= b(j, i)) error stop end do end do x = reshape( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25], [5, 5] ) y = transpose(x) do i = lbound(x, 1), ubound(x, 1) do j = lbound(x, 2), ubound(x, 2) if (abs(x(i, j) - y(j, i)) > 1e-6) error stop end do end do d = reshape( [1, 2], [1, 2] ) e = transpose(d) do i = lbound(d, 1), ubound(d, 1) do j = lbound(d, 2), ubound(d, 2) if (abs(d(i, j) - e(j, i)) > 1e-12) error stop end do end do c = reshape( [ (1, 2), (3, 4), (5, 6), (7, 8) ], [2, 2] ) f = transpose(c) do i = lbound(c, 1), ubound(c, 1) do j = lbound(c, 2), ubound(c, 2) if (abs(real(c(i, j)) - real(f(j, i))) > 1e-6) error stop if (abs(aimag(c(i, j)) - aimag(f(j, i))) > 1e-6) error stop end do end do l = .true. m = transpose(l) do i = lbound(l, 1), ubound(l, 1) do j = lbound(l, 2), ubound(l, 2) if (l(i, j) .neqv. m(j, i)) error stop end do end do end program matrix_01_tranpose lfortran-0.63.0/integration_tests/operator_overloading_01.f900000664000175000017500000000221715174404631024433 0ustar alastairalastairmodule operator_overloading_01_overload_asterisk_m implicit none public operator (*) interface operator (*) module procedure logical_and end interface interface operator (+) module procedure bin_add end interface contains pure logical function logical_and(log1, log2) logical, intent (in) :: log1, log2 logical_and = (log1 .and. log2) end function pure integer function bin_add(log1, log2) logical, intent (in) :: log1, log2 if( log1 .and. log2 ) then bin_add = 2 elseif( .not. log1 .and. .not. log2 ) then bin_add = 0 else bin_add = 1 endif end function end module program operator_overloading_01 use operator_overloading_01_overload_asterisk_m implicit none logical, parameter :: T = .true., F = .false. print *, "T*T:", T*T ! Yields: T print *, "T*F:", T*F ! Yields: F print *, "F*T:", F*T ! Yields: F print *, "F*F:", F*F ! Yields: F print *, "T+T:", T+T ! Yields: 2 print *, "T+F:", T+F ! Yields: 1 print *, "F+T:", F+T ! Yields: 1 print *, "F+F:", F+F ! Yields: 0 end program lfortran-0.63.0/integration_tests/intrinsics_334.f900000664000175000017500000000355015174404631022466 0ustar alastairalastairprogram intrinsics_334 implicit none type, abstract :: base integer :: id end type type, extends(base) :: toml_value integer :: x = 0 end type toml_value integer :: i integer, allocatable :: from(:), to(:) type(toml_value), allocatable :: struct_from, struct_to type(toml_value), allocatable :: struct_from2(:), struct_to2(:) class(toml_value), allocatable :: struct_from3 class(base), allocatable :: struct_to3 allocate(from(5)) from = [1, 2, 3, 4, 5] allocate(to(5)) call move_alloc(from, to) print *, to if(any(to /= [1,2,3,4,5])) error stop print *, allocated(from) if(allocated(from) .neqv. .false.) error stop allocate(struct_from) struct_from%x = 42 call move_alloc(struct_from, struct_to) if (allocated(struct_to)) then if (struct_to%x /= 42) error stop else error stop end if if (allocated(struct_from)) error stop allocate(struct_from2(3)) do i = 1, 3 struct_from2(i)%x = i * 10 end do call move_alloc(struct_from2, struct_to2) if (allocated(struct_from2)) error stop if (allocated(struct_to2)) then do i = 1, size(struct_to2) if (struct_to2(i)%x /= i * 10) error stop end do else error stop end if allocate(toml_value :: struct_from3) struct_from3%x = 123 call move_alloc(struct_from3, struct_to3) if (allocated(struct_from3)) error stop select type(struct_to3) type is (toml_value) if (struct_to3%x /= 123) error stop end select allocate(struct_from) struct_from%x = 42 call move_alloc(struct_from, struct_to3) if (allocated(struct_from)) error stop select type(struct_to3) type is (toml_value) if (struct_to3%x /= 42) error stop class default error stop end select end program lfortran-0.63.0/integration_tests/do_loop_06.f900000664000175000017500000000043115174404631021643 0ustar alastairalastairprogram do_loop_06 integer :: i integer, allocatable :: arr(:) allocate(arr(10)) arr = [1,2,3,4,5,6,7,8,9,10] do i =1,2 print *, "dummy do loop" exit end do print *, arr if (any(arr /= [1,2,3,4,5,6,7,8,9,10])) error stop end program lfortran-0.63.0/integration_tests/modules_18.f900000664000175000017500000000037315174404631021670 0ustar alastairalastairprogram modules_18 use iso_fortran_env, only: sp=>real32 use modules_18b, only: f, g implicit none integer :: i, a real(sp) :: r32 a = 3 r32 = 5 i = f(a, r32) print *, i if (i /= 8) error stop call g(a, r32, i) print *, i if (i /= 8) error stop end lfortran-0.63.0/integration_tests/cpp_pre_06.f900000664000175000017500000000110015174404631021632 0ustar alastairalastair#ifdef __GFORTRAN__ # define STRINGIFY_START(X) "& # define STRINGIFY_END(X) &X" #else /* default stringification */ # define STRINGIFY_(X) #X # define STRINGIFY_START(X) & # define STRINGIFY_END(X) STRINGIFY_(X) #endif #define MYMACRO 0.12.0 program test implicit none character (len=:), allocatable :: astring astring = STRINGIFY_START(MYTEXT) STRINGIFY_END(MYTEXT) if (astring /= "MYTEXT") error stop "stringify failed for text" astring = STRINGIFY_START(MYMACRO) STRINGIFY_END(MYMACRO) if (astring /= "0.12.0") error stop "stringify failed for macro" end program test lfortran-0.63.0/integration_tests/arrays_106.f900000664000175000017500000000072115174404631021574 0ustar alastairalastairmodule tbp_mod implicit none type tbp integer :: i contains procedure :: print_1 end type tbp contains subroutine print_1(this, arr) class(tbp), intent(in) :: this, arr(:) print '(a,1x,*(i0,:,","))', 'print_1:', arr%i end subroutine print_1 end module tbp_mod program array_106 use tbp_mod implicit none type(tbp) :: b(3) b%i = [1,2,3] if (any(b%i /= [1,2,3])) error stop print *, "test passed" end program array_106 lfortran-0.63.0/integration_tests/parameter_16.f900000664000175000017500000000112215174404631022167 0ustar alastairalastairsubroutine test_complex_param ! COMPLEX PARAMETER from real literal (incl. negative) implicit none complex :: pos_one, neg_one, zero parameter (pos_one = 1.0, neg_one = -1.0, zero = 0.0) if (real(pos_one) /= 1.0) error stop if (aimag(pos_one) /= 0.0) error stop if (real(neg_one) /= -1.0) error stop if (aimag(neg_one) /= 0.0) error stop if (real(zero) /= 0.0) error stop if (aimag(zero) /= 0.0) error stop print *, "PASS: complex parameter with negative real literal" end subroutine program parameter_16 call test_complex_param end program lfortran-0.63.0/integration_tests/gpu_metal_166.f900000664000175000017500000000075015174404631022260 0ustar alastairalastairprogram gpu_metal_166 implicit none integer :: n, pair real :: w(3,3), result_sum real :: expected(3) n = 3 w = 1.0 result_sum = 0.0 expected = 3.0 do concurrent (pair = 1:2) block real :: v(3) integer :: i v = 1.0 associate(unused => n) v(1:n) = matmul(w(1:n,1:n), v(1:n)) end associate do i = 1, 3 if (abs(v(i) - expected(i)) > 1e-6) error stop end do end block end do print *, "ok" end program lfortran-0.63.0/integration_tests/binop_01.f900000664000175000017500000000036715174404631021322 0ustar alastairalastairprogram binop_01 use iso_fortran_env, only: int8 integer(int8) :: result(5), start_, end_ result = 24_int8 start_ = 1_int8 end_ = 3_int8 print *, result(end_ - start_) if (any(result /= 24_int8)) error stop end program lfortran-0.63.0/integration_tests/dealloc_02.f900000664000175000017500000000034515174404631021613 0ustar alastairalastairprogram alloc_of_alloc_bug implicit none type :: et character(len=:), allocatable :: message end type type(et), allocatable :: e e = f() contains type(et) function f() f%message = "x" end function end program lfortran-0.63.0/integration_tests/arrays_87.f900000664000175000017500000000136515174404631021531 0ustar alastairalastairmodule memory_arrays_87 implicit none contains subroutine alloc_rvector_dp(x, n) implicit none integer, intent(in) :: n real, allocatable, intent(out) :: x(:) allocate(x(n)) x = 10 end subroutine alloc_rvector_dp end module memory_arrays_87 module test_arrays_87 use memory_arrays_87, only: alloc_rvector_dp implicit none contains subroutine call_allocate(x, n) integer, intent(in) :: n real, allocatable :: x(:) integer :: r call alloc_rvector_dp(x, n) call xuse(r) print *, r if( r /= 100 ) error stop contains subroutine xuse(r) implicit none integer, intent(out) :: r r = sum(x) end subroutine end subroutine end module program arrays_87 use test_arrays_87 implicit none real, allocatable :: a(:) call call_allocate(a, 10) end program lfortran-0.63.0/integration_tests/separate_compilation_24a.f900000664000175000017500000000035215174404631024555 0ustar alastairalastairmodule sorting_separate_compilation_24 implicit none interface module subroutine sort(n) integer, intent(inout) :: n end subroutine end interface end module sorting_separate_compilation_24lfortran-0.63.0/integration_tests/template_nested.f900000664000175000017500000000243715174404631023070 0ustar alastairalastairmodule template_nested_m implicit none private public :: add_t, test_template requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = F(x, y) end function function call_add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = add_generic(x, y) end function end template contains real function func_arg_real(x, y) result(z) real, intent(in) :: x, y z = x + y end function subroutine test_template() instantiate add_t(real, func_arg_real), only: add_real => call_add_generic real :: x, y integer :: a, b x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) if (abs(add_real(x, y) - 12.3) > 1e-5) error stop end subroutine end module program template_nested use template_nested_m implicit none call test_template() end program template_nested lfortran-0.63.0/integration_tests/intrinsics_444.f900000664000175000017500000000032515174404631022465 0ustar alastairalastairprogram intrinsics_444 implicit none real(8), parameter :: ar2(3) = anint([123.41_8, 4.23_8, -31.0_8]) if (any(ar2 /= [123.0_8, 4.0_8, -31.0_8])) error stop print *, ar2 end program intrinsics_444 lfortran-0.63.0/integration_tests/derived_types_126.f900000664000175000017500000000212015174404631023136 0ustar alastairalastairmodule derived_types_126_mod implicit none type :: string_t character(len=:), allocatable :: s contains procedure :: bracket end type contains elemental function bracket(self, opening) result(res) class(string_t), intent(in) :: self character(len=*), intent(in), optional :: opening type(string_t) :: res if (present(opening)) then res%s = opening // self%s else res%s = self%s end if end function end module program derived_types_126 use derived_types_126_mod implicit none type :: box_t type(string_t) :: items(2) end type type(box_t) :: b type(string_t) :: results(2) b%items(1)%s = "hello" b%items(2)%s = "world" ! Call elemental type-bound function with optional arg omitted ! through a derived-type component array results = b%items%bracket() if (results(1)%s /= "hello") error stop if (results(2)%s /= "world") error stop ! Call with optional arg present results = b%items%bracket("[") if (results(1)%s /= "[hello") error stop if (results(2)%s /= "[world") error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/functions_46.f900000664000175000017500000000113215174404631022223 0ustar alastairalastair! Test calling `foo2` that has a string return of length depending on the input array size. program functions_46 character(1) :: arr(12) call foo(arr) contains pure function foo2(set) result(string) character(len=1), intent(in) :: set(:) character(len=size(set)) :: string !!! <<< Testing this end function foo2 subroutine foo(set) character(len=1), intent(in) :: set(:) character(len=:), allocatable :: chomped_string print *, len(foo2(set)) if(len(foo2(set)) /= size(set)) error stop end subroutine foo end program lfortran-0.63.0/integration_tests/derived_types_137.f900000664000175000017500000000152515174404631023150 0ustar alastairalastairmodule derived_types_137_mod implicit none type :: vertex_type integer :: degree = 0 end type type :: graph_type type(vertex_type), dimension(:), allocatable :: vertex integer :: num_vertices = 0 end type contains subroutine calc_degree(this) type(graph_type), intent(inout) :: this integer :: i this%vertex(:)%degree = 0 do i = 1, this%num_vertices this%vertex(i)%degree = i end do end subroutine end module program derived_types_137 use derived_types_137_mod implicit none type(graph_type) :: g g%num_vertices = 3 allocate(g%vertex(3)) call calc_degree(g) if (g%vertex(1)%degree /= 1) error stop if (g%vertex(2)%degree /= 2) error stop if (g%vertex(3)%degree /= 3) error stop end program derived_types_137lfortran-0.63.0/integration_tests/derived_types_135.f900000664000175000017500000000145515174404631023150 0ustar alastairalastairmodule derived_types_135_mod implicit none type :: inner_t integer :: dims(3) end type type :: outer_t type(inner_t) :: sub contains procedure :: work end type contains pure subroutine work(this, arr, output) class(outer_t), intent(in) :: this real, dimension(:,:), intent(in) :: arr real, dimension(:,:), intent(out) :: output real, dimension(size(arr,1), this%sub%dims(1)) :: tmp tmp = 1.0 output = tmp end subroutine end module program derived_types_135 use derived_types_135_mod implicit none type(outer_t) :: obj real :: arr(3, 4), output(3, 4) obj%sub%dims = [4, 2, 1] arr = 2.0 call obj%work(arr, output) if (any(output /= 1.0)) error stop end program derived_types_135lfortran-0.63.0/integration_tests/functions_12.f900000664000175000017500000000042615174404631022221 0ustar alastairalastairprogram functions_12 implicit none contains logical function decodebase(string) result(r) implicit none character(len=*), intent(in) :: string character(len=len(string)) :: string_local real, parameter :: x = real(huge(1)) end function decodebase end program lfortran-0.63.0/integration_tests/namelist_21.f900000664000175000017500000000111715174404631022023 0ustar alastairalastairprogram test_namelist_iolist implicit none type :: point integer :: x=0 integer :: y=0 end type point type(point) :: dot namelist /nml_dot/ dot dot%x = 10 dot%y = 20 write(*, nml_dot) open(unit=10, file='namelist_21.dat', status='replace', form='formatted') write(10, nml_dot) close(10) dot%x = 0 dot%y = 0 open(unit=10, file='namelist_21.dat', status='old', form='formatted') read(10, nml_dot) close(10) if (dot%x /= 10) error stop if (dot%y /= 20) error stop end program test_namelist_iolist lfortran-0.63.0/integration_tests/types_21.f900000664000175000017500000000045615174404631021360 0ustar alastairalastairprogram types_21 integer(8) :: res integer(8) :: x(5) res = fun(x) print*, res if ( res /= 5 ) error stop contains function fun (x) result(res) integer(8) :: res integer(8), intent(in) :: x(:) res = size(x, kind=8) end endlfortran-0.63.0/integration_tests/deallocate_01.f900000664000175000017500000000121315174404631022277 0ustar alastairalastairmodule m_deallocate_01 implicit none type :: object_t integer :: dummy = 0 contains final :: count_finalizations end type integer :: finalizations = 0 contains subroutine count_finalizations(self) type(object_t), intent(inout) :: self finalizations = finalizations + 1 self%dummy = 0 end subroutine end module program deallocate_01 ! Test: finalizer is called on explicit DEALLOCATE (Fortran 2018 §7.5.6.3) use m_deallocate_01 implicit none type(object_t), allocatable :: obj integer :: initial initial = finalizations allocate(obj) obj%dummy = 42 deallocate(obj) if (finalizations - initial /= 1) error stop end program lfortran-0.63.0/integration_tests/entry_06.f900000664000175000017500000000072415174404631021356 0ustar alastairalastairdouble precision function mvndfn( w ) double precision w(*) entry mvndnt() w(1) = 10.9d0 w(2) = 10.9d0 if (abs(w(1) - 10.9d0) > 1e-10) error stop if (abs(w(2) - 10.9d0) > 1e-10) error stop mvndfn = 1.2d0 end program entry_06 interface double precision function mvndfn( w ) double precision w(*) end function end interface double precision w(2) if (abs(mvndfn(w) - 1.2d0) > 1e-10) error stop end program lfortran-0.63.0/integration_tests/operator_overloading_14.f900000664000175000017500000000155315174404631024441 0ustar alastairalastairmodule operator_overloading_14_mod implicit none type, abstract :: base_type end type base_type type, extends(base_type) :: my_type integer :: x contains procedure :: my_type_equal generic :: operator(==) => my_type_equal end type contains logical function my_type_equal(a, b) class(my_type), intent(in) :: a class(base_type), intent(in) :: b my_type_equal = .false. select type(b) type is (my_type) my_type_equal = (b%x == a%x) end select end function my_type_equal end module operator_overloading_14_mod program operator_overloading_14 use operator_overloading_14_mod implicit none type(my_type) :: a, b a%x = 5 b%x = 5 if (.not. a == b) error stop b%x = 6 if (a == b) error stop end program operator_overloading_14lfortran-0.63.0/integration_tests/implied_do_loops4.f900000664000175000017500000000030615174404631023311 0ustar alastairalastairprogram implied_do_loops4 integer :: i, j real :: x(5) j = 12 x = (/ (real(i),i=1,5) /) print *, (i,i=1,3), (i,i=4,6), j write (*,*) (i,i=1,3), (i,i=4,6), j print *, (x(i) + 1.0, i=1,5) end program lfortran-0.63.0/integration_tests/associate_23.f900000664000175000017500000000151715174404631022170 0ustar alastairalastairprogram pointer_lhs_section_bug implicit none real, target :: arr(6) real, pointer :: mat(:), mat1(:) integer :: n n = 6 arr = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] mat(1:n-3) => arr print *, "Test 1: mat(1:n-3) => arr" print *, " mat:", mat print *, " lbound:", lbound(mat) print *, " ubound:", ubound(mat) if (any(mat /= [1.0, 2.0, 3.0])) error stop if (any(lbound(mat) /= 1)) error stop if (any(ubound(mat) /= 3)) error stop mat1(1+2:n+2) => arr print *, "Test 2: mat1(1+2:n+2) => arr" print *, " mat1:", mat1 print *, " lbound:", lbound(mat1) print *, " ubound:", ubound(mat1) if (any(mat1 /= [1.0, 2.0, 3.0, 4.0, 5.0, 6.0])) error stop if (any(lbound(mat1) /= 3)) error stop if (any(ubound(mat1) /= 8)) error stop end program pointer_lhs_section_buglfortran-0.63.0/integration_tests/implicit_interface_03.f900000664000175000017500000000103315174404631024036 0ustar alastairalastairprogram main integer :: b(3) = [10, 20, 30] integer :: n = 3 call driver(implicit_interface_check, b, n) contains subroutine driver(fnc, arr, m) integer, intent(in) :: m, arr(m) ! This fixes the array length issue (BindC changes) print *, abs(-1.0) ! This loads the runtime library call fnc(arr, m) end subroutine subroutine implicit_interface_check(arr1, m) integer, intent(in) :: m, arr1(m) if (m /= 3) error stop if (arr1(1) /= 10) error stop if (arr1(2) /= 20) error stop if (arr1(3) /= 30) error stop end subroutine end program lfortran-0.63.0/integration_tests/file_62.f900000664000175000017500000000177715174404631021147 0ustar alastairalastairprogram file_62 implicit none integer :: unit character(len=20) :: delim_val character(len=*), parameter :: fname = "file_62_data.txt" unit = 10 open(unit, file=fname, status="replace", & form="formatted", delim="apostrophe") inquire(unit=unit, delim=delim_val) if (trim(delim_val) /= "APOSTROPHE") error stop close(unit, status="delete") open(unit, file=fname, status="replace", & form="formatted", delim="quote") inquire(unit=unit, delim=delim_val) if (trim(delim_val) /= "QUOTE") error stop close(unit, status="delete") open(unit, file=fname, status="replace", & form="formatted", delim="none") inquire(unit=unit, delim=delim_val) if (trim(delim_val) /= "NONE") error stop close(unit, status="delete") open(unit, file=fname, status="replace", & form="formatted") inquire(unit=unit, delim=delim_val) if (trim(delim_val) /= "NONE") error stop close(unit, status="delete") end program file_62lfortran-0.63.0/integration_tests/string_21.f900000664000175000017500000000163415174404631021521 0ustar alastairalastairmodule string_21_fpm_string integer, public, parameter :: tfc = selected_char_kind('DEFAULT') contains function f_string(c_string) use iso_c_binding character(len=1), intent(in) :: c_string(:) character(:), allocatable :: f_string integer :: i, n i = 0 do while(c_string(i + 1) /= C_NULL_CHAR) i = i + 1 end do n = i allocate(character(kind=tfc, len=n) :: f_string) do i = 1, n f_string(i:i) = c_string(i) end do print *, f_string end function f_string end module program string_21 use string_21_fpm_string use iso_c_binding implicit none character(len=1) :: c_string(6) character(:), allocatable :: f_string_result c_string(1) = 'H' c_string(2) = 'e' c_string(3) = 'l' c_string(4) = 'l' c_string(5) = 'o' c_string(6) = C_NULL_CHAR f_string_result = f_string(c_string) print *, f_string_result if( f_string_result /= "Hello" ) error stop end program lfortran-0.63.0/integration_tests/assumed_type_03.f900000664000175000017500000000245715174404631022721 0ustar alastairalastairprogram assumed_type_03 ! MRE for caffeine co_broadcast double-free with LFortran. ! ! Derived types with fixed-length character components must store the ! character data inline (like gfortran does) so that raw byte ! operations through type(*) / CFI descriptors work correctly. ! If the character is stored as a heap pointer instead, memcpy-style ! operations (e.g. caf_co_broadcast) copy the pointer, not the data, ! leading to double-free and wrong results across images. implicit none type :: pair_t integer :: id character(len=5) :: label end type interface subroutine check_dt_char_inline(a, ok) bind(C) type(*), intent(in) :: a(..) integer, intent(out) :: ok end subroutine subroutine copy_via_cfi(src, dst) bind(C) type(*), intent(in) :: src(..) type(*), intent(inout) :: dst(..) end subroutine end interface type(pair_t) :: src, dst integer :: ok src = pair_t(42, "hello") call check_dt_char_inline(src, ok) if (ok /= 1) error stop "character data not stored inline in derived type" dst = pair_t(0, "xxxxx") call copy_via_cfi(src, dst) if (dst%id /= 42) error stop "integer component wrong after raw copy" if (dst%label /= "hello") error stop "character component wrong after raw copy" print *, "ok" end program lfortran-0.63.0/integration_tests/gpu_metal_59.f900000664000175000017500000000074215174404631022202 0ustar alastairalastairprogram gpu_metal_59 ! Test: block construct inside do loop inside do concurrent ! This used to fail with: "Block block should resolve in current scope." ! in the gpu_offload pass. implicit none integer :: i, l integer :: x(4) x = 0 do concurrent (i = 1:4) do l = 1, 1 block x(i) = x(i) + i * l end block end do end do print *, x if (x(1) /= 1) error stop if (x(2) /= 2) error stop if (x(3) /= 3) error stop if (x(4) /= 4) error stop end program lfortran-0.63.0/integration_tests/file_04.f900000664000175000017500000000103415174404631021125 0ustar alastairalastairprogram load_model_program implicit none integer :: int_data1, int_data2 real :: real_data1, real_data2 integer :: u = 11 open(u, file="file_04_data.dat", form="unformatted", access="stream") read(u) int_data1, real_data1, int_data2, real_data2 print *, "Data: ", int_data1, real_data1, int_data2, real_data2 if (int_data1 /= 345239) error stop if (abs(real_data1 - (52.91)) > 1e-6) error stop if (int_data2 /= -345239) error stop if (abs(real_data2 - (-52.91)) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/multiple_procs_in_bin_op.f900000664000175000017500000000252515174404631024766 0ustar alastairalastairmodule julienne_string_m_multiple_procs_in_bin_op use iso_c_binding, only : c_bool implicit none private public :: string_t public :: operator(.separatedBy.) type string_t private character(len=:), allocatable :: string_ end type interface operator(.csv.) pure module function strings_with_comma_separator(strings) result(csv) implicit none type(string_t), intent(in) :: strings(:) type(string_t) csv end function end interface interface operator(.separatedBy.) pure module function strings_with_separator(strings, sep) result(joined) implicit none type(string_t), intent(in) :: strings(:) character(len=*), intent(in) :: sep type(string_t) :: joined end function end interface contains module procedure strings_with_comma_separator end procedure module procedure strings_with_separator end procedure end module julienne_string_m_multiple_procs_in_bin_op program create_markdown_table use julienne_string_m_multiple_procs_in_bin_op implicit none contains pure function markdown_table(column_header) result(lines) type(string_t), intent(in) :: column_header(:) character(len=1), parameter :: column_separator = "|" type(string_t) lines(5) lines(1) = column_header .separatedBy. column_separator end function end programlfortran-0.63.0/integration_tests/volatile_03.f900000664000175000017500000000017615174404631022032 0ustar alastairalastairprogram volatile_03 implicit none character, volatile :: x character :: y = '2' y = x end program volatile_03lfortran-0.63.0/integration_tests/modules_27.f900000664000175000017500000000035215174404631021665 0ustar alastairalastairmodule tomlf_build use tomlf_build_array, only : get_value use tomlf_build_keyval, only : get_value implicit none end module tomlf_build program modules_27 implicit none print *, "running modules_27 program" end program lfortran-0.63.0/integration_tests/do_concurrent_13.f900000664000175000017500000000203315174404631023052 0ustar alastairalastairprogram do_concurrent_13 integer, parameter :: Nx = 40, Ny = 30, n_max = 255, dp=kind(0.d0) real(dp), parameter :: xcenter = -0.5_dp, ycenter = 0.0_dp, & width = 4, height = 3, dx_di = width/Nx, dy_dj = -height/Ny, & x_offset = xcenter - (Nx+1)*dx_di/2, y_offset = ycenter - (Ny+1)*dy_dj/2 real(dp) :: x, y, x_0, y_0, x_sqr, y_sqr, wtime integer :: i, j, n, image(Nx, Ny) do concurrent (j = 1:Ny) shared(image) local(i, x, y, x_0, y_0, x_sqr, y_sqr, n) y_0 = y_offset + dy_dj * j do i = 1, Nx x_0 = x_offset + dx_di * i x = 0; y = 0; n = 0 do x_sqr = x ** 2; y_sqr = y ** 2 if (x_sqr + y_sqr > 4 .or. n == n_max) then image(i,j) = 255-n exit end if y = y_0 + 2 * x * y x = x_0 + x_sqr - y_sqr n = n + 1 end do end do end do print *, sum(image) if ( sum(image) /= 263354 ) error stop end program lfortran-0.63.0/integration_tests/derived_types_123.f900000664000175000017500000000124615174404631023143 0ustar alastairalastair! Test: debug info with derived type FINAL subroutine ! Verifies that -g flag works when a derived type with a ! FINAL subroutine is used as a local variable. module derived_types_123_mod implicit none type, public :: container integer :: val = 0 contains final :: dealloc_container end type container contains subroutine dealloc_container(this) type(container), intent(inout) :: this this%val = 0 end subroutine dealloc_container end module derived_types_123_mod program derived_types_123 use derived_types_123_mod implicit none type(container) :: c c%val = 42 if (c%val /= 42) error stop print *, "PASS" end program derived_types_123 lfortran-0.63.0/integration_tests/modules_04.f900000664000175000017500000000057015174404631021662 0ustar alastairalastairmodule modules_04_a implicit none contains subroutine b() print *, "b()" end subroutine end module program modules_04 use, intrinsic :: iso_fortran_env implicit none call f() contains subroutine f() use modules_04_a, only: b call b() end subroutine integer function g() use :: modules_04_a, only: b call b() g = 5 end function end lfortran-0.63.0/integration_tests/select_type_43.f900000664000175000017500000000162515174404631022537 0ustar alastairalastair! Test: unformatted stream write of logical array inside select type program select_type_43 use iso_fortran_env, only: int8 implicit none logical(int8) :: arr(2) arr = .true. call write_poly(arr) contains subroutine write_poly(a) class(*), intent(in) :: a(:) integer :: unit integer(int8) :: bytes(2) select type (a) type is (logical(int8)) open(newunit=unit, file='select_type_43.bin', status='replace', & action='write', access='stream') write(unit) a close(unit) end select open(newunit=unit, file='select_type_43.bin', status='old', & action='read', access='stream') read(unit) bytes close(unit, status='delete') if (bytes(1) /= 1) error stop if (bytes(2) /= 1) error stop print *, "PASS" end subroutine end program lfortran-0.63.0/integration_tests/types_08.f900000664000175000017500000000046715174404631021367 0ustar alastairalastairprogram types_08 implicit none contains subroutine f(i, j) integer, optional, intent(in) :: i integer, intent(in) :: j optional :: j end subroutine subroutine g(i, j) integer, optional, intent(in) :: i integer j intent(in) j optional j end subroutine end program lfortran-0.63.0/integration_tests/intrinsics_60_data.txt0000664000175000017500000000001215174404631023602 0ustar alastairalastaira Z ÿ © lfortran-0.63.0/integration_tests/complex_04.f900000664000175000017500000000030715174404631021657 0ustar alastairalastairprogram complex_04 implicit none complex :: x real :: a, b x = (1.0,-3.0) a = real(x) b = aimag(x) print *, a, b if (abs(a - 1) > 1e-5) error stop if (abs(b - (-3)) > 1e-5) error stop end program lfortran-0.63.0/integration_tests/nullify_06.f900000664000175000017500000000023115174404631021670 0ustar alastairalastairprogram nullify_class type :: toml_table integer :: x end type class(toml_table), pointer :: temp nullify(temp) end program lfortran-0.63.0/integration_tests/cpp_pre_07.f900000664000175000017500000000071415174404631021645 0ustar alastairalastairprogram cpp_pre_07 implicit none integer :: x ! Test that #ifdef with extra tokens after the macro name ! is handled correctly (extra tokens are ignored). #ifdef UNDEFINED_MACRO && OTHER x = 1 #else x = 2 #endif if (x /= 2) error stop #define DEFINED_MACRO #ifdef DEFINED_MACRO && OTHER x = 10 #else x = 20 #endif if (x /= 10) error stop #ifndef UNDEFINED_MACRO && OTHER x = 100 #else x = 200 #endif if (x /= 100) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/intrinsics_78.f900000664000175000017500000000573515174404631022422 0ustar alastairalastairprogram intrinsics_78 implicit none integer :: ix, iy, iresult integer(8) :: j integer(4) :: i real(8) :: a real(4) :: b real :: rx, ry, rresult double precision :: dx, dy, dresult ! Test integer values ix = 10 iy = 3 iresult = mod(ix, iy) print *, "Test 1: mod(", ix, ",", iy, ") = ", iresult if (iresult /= 1) error stop "Test 1 failed" ix = 10 iy = 5 iresult = mod(ix, iy) print *, "Test 2: mod(", ix, ",", iy, ") = ", iresult if (iresult /= 0) error stop "Test 2 failed" ix = -10 iy = 3 iresult = mod(ix, iy) print *, "Test 3: mod(", ix, ",", iy, ") = ", iresult if (iresult /= -1) error stop "Test 3 failed" ! Test real values rx = 10.0 ry = 3.0 rresult = mod(rx, ry) print *, "Test 4: mod(", rx, ",", ry, ") = ", rresult if (abs(rresult - 1.0) > 1e-9) error stop "Test 4 failed" rx = 10.0 ry = 5.0 rresult = mod(rx, ry) print *, "Test 5: mod(", rx, ",", ry, ") = ", rresult if (abs(rresult - 0.0) > 1e-9) error stop "Test 5 failed" rx = -10.0 ry = 3.0 rresult = mod(rx, ry) print *, "Test 6: mod(", rx, ",", ry, ") = ", rresult if (abs(rresult - (-1.0)) > 1e-9) error stop "Test 6 failed" rx = 12.98 ry = 3.0 rresult = mod(rx, ry) print *, "Test 7: mod(", rx, ",", ry, ") = ", rresult if (abs(rresult - 0.98) > 1e-6) error stop "Test 7 failed" rx = 12.98 ry = 13.0 rresult = mod(rx, ry) print *, "Test 8: mod(", rx, ",", ry, ") = ", rresult if (abs(rresult - 12.98) > 1e-9) error stop "Test 8 failed" ! Test double precision values dx = 10.0D0 dy = 3.0D0 dresult = mod(dx, dy) print *, "Test 9: mod(", dx, ",", dy, ") = ", dresult if (abs(dresult - 1.0D0) > 1d-9) error stop "Test 9 failed" dx = 12.98D0 dy = 3.0D0 dresult = mod(dx, dy) print *, "Test 10: mod(", dx, ",", dy, ") = ", dresult if (abs(dresult - 0.98D0) > 1d-9) error stop "Test 10 failed" dx = 12.98D0 dy = 13.0D0 dresult = mod(dx, dy) print *, "Test 11: mod(", dx, ",", dy, ") = ", dresult if (abs(dresult - 12.98D0) > 1d-9) error stop "Test 11 failed" dx = -12.98D0 dy = 13.0D0 dresult = mod(dx, dy) print *, "Test 12: mod(", dx, ",", dy, ") = ", dresult if (abs(dresult - (-12.98D0)) > 1d-9) error stop "Test 12 failed" dx = -3.14D0 dy = -2.0D0 dresult = mod(dx, dy) print *, "Test 13: mod(", dx, ",", dy, ") = ", dresult if (abs(dresult - (-1.14D0)) > 1d-9) error stop "Test 13 failed" ! Test integer values with different kinds i = 121 j = 121 iresult = kind(mod(j,i)) print *, "Test 14: kind(mod(", i, ",", j, ")) = ", iresult if(iresult /= 8) error stop "Test 14 failed" ! Test real values with different kinds a = 121.882 b = 121.882 iresult = kind(mod(a,b)) print *, "Test 15: kind(mod(", a, ",", b, ")) = ", iresult if(iresult /= 8) error stop "Test 15 failed" end program intrinsics_78 lfortran-0.63.0/integration_tests/submodule_30c.f900000664000175000017500000000011715174404631022350 0ustar alastairalastairsubmodule(submodule_30_mod) submodule_30_child implicit none end submodule lfortran-0.63.0/integration_tests/procedure_12.f900000664000175000017500000000164115174404631022201 0ustar alastairalastairmodule procedure_12_mod contains recursive subroutine sub(int, X) integer, intent(in) :: int integer, intent(inout) :: X(:) procedure(sub), pointer :: proc proc => sub if (int <= 5) X(int) = int if (int > 5) return if (mod(int, 2) /= 0) then print *, "Odd: ", int call proc(int + 1, X) else proc => alt_sub call proc(int, X) end if end subroutine sub subroutine alt_sub(int, X) integer, intent(in) :: int integer, intent(inout) :: X(:) if (int <= 5) X(int) = int print *, "Even: ", int call sub(int + 1, X) end subroutine alt_sub end module procedure_12_mod program procedure_12 use procedure_12_mod integer :: X(5) = [0, 0, 0, 0, 0] call sub(1, X) print *, X if(X(1) /= 1 .or. X(2) /= 2 .or. X(3) /= 3 .or. X(4) /= 4 .or. X(5) /= 5) error stop end program procedure_12lfortran-0.63.0/integration_tests/functions_02.f900000664000175000017500000000065615174404631022225 0ustar alastairalastairprogram functions_02 implicit none integer :: i real :: f, g i = 1 f = 3.5 g = mysum(i, f) if (myabs(g-4.5) > 1e-5) error stop contains real function mysum(a, b) result(c) integer, intent(in) :: a real, intent(in) :: b c = a + b end function real function myabs(a) result(c) real, intent(in) :: a if (a >= 0) then c = a else c = -a end if end function end program lfortran-0.63.0/integration_tests/interface_12a.f900000664000175000017500000000132215174404631022306 0ustar alastairalastairmodule interface_12a_mod use interface_12b_mod interface get_value module procedure :: get_bool end interface contains subroutine get_bool(self, val) class(t), intent(in) :: self logical, intent(out) :: val if (self%value /= 0) then val = .true. else val = .false. end if end subroutine get_bool end module interface_12a_mod program interface_12a use interface_12a_mod implicit none type(t) :: get_type logical :: a real :: b get_type%value = 10 call get_value(get_type, a) call get_value(get_type, b) if (.not.(a)) error stop if (b /= 10.00) error stop end program interface_12a lfortran-0.63.0/integration_tests/intrinsics_338.f900000664000175000017500000000013215174404631022463 0ustar alastairalastairprogram intrinsics_338 use iso_fortran_env print *, compiler_options() end programlfortran-0.63.0/integration_tests/intrinsics_422.f900000664000175000017500000000022315174404631022456 0ustar alastairalastairprogram intrinsics_422 ! Test this_image() intrinsic implicit none integer :: id id = this_image() if (id /= 1) error stop print *, id end program lfortran-0.63.0/integration_tests/string_26.f900000664000175000017500000000017315174404631021523 0ustar alastairalastairprogram string_26 character(len=3) :: s1, s2 character(len=6) :: s s1 = "abc" s2 = "def" s = s1//s2 print *, s end program lfortran-0.63.0/integration_tests/c_sizeof_03.f900000664000175000017500000000061715174404631022014 0ustar alastairalastairprogram c_sizeof_03 use iso_c_binding implicit none ! bind(C) struct with mixed-alignment fields requiring padding type, bind(C) :: t integer(c_int) :: a integer(c_size_t) :: b integer(c_int) :: c type(c_ptr) :: d end type type(t) :: x integer(c_size_t) :: sz sz = c_sizeof(x) print *, "c_sizeof(t) =", sz if (sz /= 32) error stop print *, "OK" end program lfortran-0.63.0/integration_tests/save_02.f900000664000175000017500000000017215174404631021144 0ustar alastairalastairprogram save_02 implicit none integer :: i, j real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) save end program lfortran-0.63.0/integration_tests/entry_07.f900000664000175000017500000000033715174404631021357 0ustar alastairalastairsubroutine dzror() implicit none double precision zxlo entry dstzr(zxlo) if (abs(zxlo - 1.2) > 1e-7) error stop print *, 'dstzr: zxlo = ', zxlo return end program entry_07 call dstzr(1.2d0) end program lfortran-0.63.0/integration_tests/intrinsics_311.f900000664000175000017500000000231615174404631022460 0ustar alastairalastairprogram intrinsics_311 implicit none integer, dimension(5) :: array = [3, 1, 4, 1, 5] logical, dimension(5) :: mask = [.true., .false., .true., .false., .true.] integer, dimension(:), allocatable :: loc ! Find the location of the minimum value considering only elements where mask is true loc = minloc(array, mask = mask) print *, "Minloc with MASK:", loc if (any(loc /= 1)) error stop ! Find the location of the minimum value searching backwards loc = minloc(array, back = .true.) print *, "Minloc with BACK:", loc if (any(loc /= 4)) error stop loc = minloc(array) print *, loc if (any(loc /= 2)) error stop loc = minloc(array, mask = mask) print *, loc if (any(loc /= 1)) error stop loc = minloc(array, back = .true.) print *, loc if (any(loc /= 4)) error stop loc = minloc(array, back = .false.) print *, loc if (any(loc /= 2)) error stop loc = minloc(array, back = .true.) print *, loc if (any(loc /= 4)) error stop loc = minloc(array, back = .false.) print *, loc if (any(loc /= 2)) error stop loc = minloc(array, back = .true.) print *, loc if (any(loc /= 4)) error stop end program lfortran-0.63.0/integration_tests/complex_05.f900000664000175000017500000000043515174404631021662 0ustar alastairalastairprogram complex_05 implicit none complex, parameter :: x = (1.0,-3.0) real, parameter :: a = 3.0, b = 4.0 complex, parameter :: y = (a, b) complex, parameter :: i_ = (0, 1) complex, parameter :: z = a + i_*b complex, parameter :: w = a+b + i_*(a-b) print *, x, y, z, w end program lfortran-0.63.0/integration_tests/gpu_metal_188.f900000664000175000017500000000133215174404631022261 0ustar alastairalastairmodule gpu_metal_188_m implicit none type :: vec_t real, allocatable :: v(:) end type contains pure function compute(inp) result(s) type(vec_t), intent(in) :: inp real :: s s = sum(inp%v) end function end module program gpu_metal_188 use gpu_metal_188_m implicit none type(vec_t) :: inputs(2) real :: results(2) integer :: i allocate(inputs(1)%v(2)) inputs(1)%v(1) = 1.0 inputs(1)%v(2) = 2.0 allocate(inputs(2)%v(2)) inputs(2)%v(1) = 3.0 inputs(2)%v(2) = 4.0 do concurrent(i=1:2) results(i) = compute(inputs(i)) end do print *, results(1) print *, results(2) if (abs(results(1) - 3.0) > 1e-6) error stop if (abs(results(2) - 7.0) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/openmp_37.f900000664000175000017500000000114315174404631021513 0ustar alastairalastairprogram openmp_37 use omp_lib ! declare variables as required integer :: ny, nx, nk integer :: iy, ix, ik ny=3 nx=4 nk=6 !$omp parallel do private(iy, ix) do iy = 1, ny !$omp parallel do collapse(2) do ix = 1, nx do ik = 1, nk print *,"iy->", iy,"ix->", ix end do end do !$omp end parallel do !$omp parallel do do ix = 1, nx do ik = 1, nk print *,"iy->", iy,"ix->", ix end do end do !$omp end parallel do end do !$omp end parallel do end programlfortran-0.63.0/integration_tests/class_87.f900000664000175000017500000000233115174404631021327 0ustar alastairalastairmodule class_87_mod implicit none type, abstract :: toml_value end type toml_value type :: xx integer :: v = 0 end type xx type, extends(toml_value) :: toml_table class(xx), allocatable :: data end type toml_table contains function cast_to_table(ptr) result(table) class(toml_value), intent(in), target :: ptr type(toml_table), pointer :: table nullify(table) select type (ptr) type is (toml_table) table => ptr end select end function cast_to_table end module class_87_mod program class_87 use class_87_mod implicit none class(toml_value), allocatable :: t type(toml_table) :: p ! Allocate polymorphic object allocate(toml_table :: t) ! Allocate component select type (t) type is (toml_table) allocate(t%data) t%data%v = 42 class default error stop "Wrong dynamic type" end select p = cast_to_table(t) if (.not. allocated(p%data)) then error stop "allocatable member not allocated" end if if (p%data%v /= 42) then error stop "data value corrupted" end if print *, "TEST PASSED" end program class_87 lfortran-0.63.0/integration_tests/complex_19.f900000664000175000017500000000142415174404631021666 0ustar alastairalastairprogram complex_19 implicit none integer, parameter :: dp = kind(0.d0) complex(dp), target :: my_complex(2, 3) real(dp) :: k integer :: i, j k = 1.0_dp do i = 1, 2 do j = 1, 3 my_complex(i, j) = complex(k, k + 1.0_dp) k = k + 2.0_dp end do end do print *, my_complex if (abs(my_complex(1, 1) - (1.0_dp, 2.0_dp)) > 1e-8_dp) error stop if (abs(my_complex(1, 2) - (3.0_dp, 4.0_dp)) > 1e-8_dp) error stop if (abs(my_complex(1, 3) - (5.0_dp, 6.0_dp)) > 1e-8_dp) error stop if (abs(my_complex(2, 1) - (7.0_dp, 8.0_dp)) > 1e-8_dp) error stop if (abs(my_complex(2, 2) - (9.0_dp, 10.0_dp)) > 1e-8_dp) error stop if (abs(my_complex(2, 3) - (11.0_dp, 12.0_dp)) > 1e-8_dp) error stop end program lfortran-0.63.0/integration_tests/intrinsics_437.f900000664000175000017500000000177415174404631022500 0ustar alastairalastairprogram intrinsics_437 ! Test norm2 with dim argument implicit none integer, parameter :: sp = kind(1.0) integer, parameter :: dp = kind(1.0d0) real(sp) :: a(3, 4), b(3), c(4) real(dp) :: da(2, 3), db(2), dc(3) ! Test single precision, dim=2 (reduce columns) a = 1.0_sp b = norm2(a, dim=2) print *, b if (any(abs(b - 2.0_sp) > 1.0e-6_sp)) error stop ! Test single precision, dim=1 (reduce rows) c = norm2(a, dim=1) print *, c if (any(abs(c - sqrt(3.0_sp)) > 1.0e-6_sp)) error stop ! Test double precision, dim=2 da(1, :) = [1.0_dp, 2.0_dp, 3.0_dp] da(2, :) = [4.0_dp, 5.0_dp, 6.0_dp] db = norm2(da, dim=2) print *, db if (abs(db(1) - sqrt(14.0_dp)) > 1.0e-12_dp) error stop if (abs(db(2) - sqrt(77.0_dp)) > 1.0e-12_dp) error stop ! Test double precision, dim=1 dc = norm2(da, dim=1) print *, dc if (abs(dc(1) - sqrt(17.0_dp)) > 1.0e-12_dp) error stop if (abs(dc(2) - sqrt(29.0_dp)) > 1.0e-12_dp) error stop if (abs(dc(3) - sqrt(45.0_dp)) > 1.0e-12_dp) error stop print *, "All norm2 dim tests passed." end program lfortran-0.63.0/integration_tests/string_72.f900000664000175000017500000000047015174404631021524 0ustar alastairalastair! Test passing substring to subroutine program string_72 character(10):: str str = "123456789 " call ss(str(3:6)) print *, str if(str /= "12abcd789 ") error stop contains subroutine ss(str) character(*) :: str str = "abcd" end subroutine end program string_72lfortran-0.63.0/integration_tests/procedure_35.f900000664000175000017500000000150315174404631022203 0ustar alastairalastairmodule procedure_35_mod implicit none private abstract interface real function reduction_fn(x, y) result(r) real, intent(in) :: x(:) real, intent(in) :: y(:) end function end interface type, public :: linop_type procedure(reduction_fn), nopass, pointer :: inner_product => default_dot end type contains real function default_dot(x, y) result(r) real, intent(in) :: x(:) real, intent(in) :: y(:) r = dot_product(x, y) end function end module procedure_35_mod program procedure_35 use procedure_35_mod implicit none type(linop_type) :: op real :: x(3), y(3) x = [1.0, 2.0, 3.0] y = [4.0, 5.0, 6.0] if (abs(op%inner_product(x, y) - 32.0) > 1e-6) error stop print *, "ok" end program procedure_35 lfortran-0.63.0/integration_tests/template_array_03.f900000664000175000017500000000561215174404631023224 0ustar alastairalastairmodule template_array_03_math implicit none private public :: add_integer, zero_integer, add_real, zero_real, mult_integer, mult_real contains pure function add_integer(x, y) result(r) integer, intent(in) :: x, y integer :: r r = x + y end function pure function zero_integer(x) result(r) integer, intent(in) :: x integer :: r r = 0 end function pure function mult_integer(x, y) result(r) integer, intent(in) :: x, y integer :: r r = x * y end function pure function add_real(x, y) result(r) real, intent(in) :: x, y real :: r r = x + y end function pure function zero_real(x) result(r) real, intent(in) :: x real :: r r = 0 end function pure function mult_real(x, y) result(r) real, intent(in) :: x, y real :: r r = x * y end function end module module template_array_03_m use template_array_03_math implicit none private public :: test_template requirement operations(t, plus_t, zero_t, mult_t) type, deferred :: t pure function plus_t(l, r) result(result) type(t), intent(in) :: l, r type(t) :: result end function pure function zero_t(x) result(result) type(t), intent(in) :: x type(t) :: result end function pure function mult_t(l, r) result(result) type(t), intent(in) :: l, r type(t) :: result end function end requirement ! template array_tmpl(t, plus_t, zero_t, mult_t) require :: operations(t, plus_t, zero_t, mult_t) private public :: mymatmul_t contains subroutine mymatmul_t(i, j, k, a, b, r) integer, parameter, intent(in) :: i, j, k type(t), intent(in) :: a(i,j), b(j,k) type(t) :: r(i,k) integer :: x = 1, y = 1, z = 1 type(t) :: elem do x = 1, i do z = 1, k elem = zero_t(a(1,1)) do y = 1, j elem = plus_t(elem, mult_t(a(x,y), b(y,z))) end do r(x,z) = elem end do end do end subroutine end template contains subroutine test_template() integer :: arr(2,2) integer :: r(2,2) arr(1,1) = 1 arr(1,2) = 1 arr(2,1) = 0 arr(2,2) = 1 instantiate array_tmpl(integer, add_integer, zero_integer, mult_integer), & only: mymatmul_int => mymatmul_t call mymatmul_int(2, 2, 2, arr, arr, r) print *, r(1,1) print *, r(1,2) print *, r(2,1) print *, r(2,2) end subroutine end module program template_array_03 use template_array_03_m implicit none call test_template() end lfortran-0.63.0/integration_tests/submodule_33.f900000664000175000017500000000144115174404631022211 0ustar alastairalastair! Test that a module procedure named "sleep" shadows the intrinsic "sleep" ! when called from a submodule via host association. module submodule_33_mod implicit none interface module subroutine sleep(millisec) integer, intent(in) :: millisec end subroutine module subroutine test() end subroutine end interface end module submodule (submodule_33_mod) submodule_33_impl implicit none contains module subroutine sleep(millisec) integer, intent(in) :: millisec if (millisec /= 100) error stop end subroutine module subroutine test() call sleep(millisec=100) end subroutine end submodule program submodule_33_main use submodule_33_mod implicit none call test() print *, "ok" end program lfortran-0.63.0/integration_tests/select_type_13.f900000664000175000017500000000360615174404631022535 0ustar alastairalastairmodule select_type_13_module implicit none type, abstract :: shape contains procedure(area), deferred :: get_area end type shape abstract interface real function area(this) import :: shape class(shape), intent(in) :: this end function end interface type, extends(shape) :: circle real :: r contains procedure :: get_area => circle_area end type circle type, extends(shape) :: rectangle real :: a, b contains procedure :: get_area => rectangle_area end type rectangle contains real function circle_area(this) class(circle), intent(in) :: this circle_area = 3.14159 * this%r * this%r end function circle_area real function rectangle_area(this) class(rectangle), intent(in) :: this rectangle_area = this%a * this%b end function rectangle_area end module select_type_13_module program select_type_13 use select_type_13_module implicit none class(shape), allocatable :: s1, s2 allocate(circle :: s1) select type (s1) class is (rectangle) print *, "Matched as rectangle" class is (circle) print *, "Matched as circle" s1%r = 10.0 print *, s1%r if (s1%r /= 10.0) error stop ! TODO: Support calling methods on derived types in select type ! print *, s1%get_area() class default print *, "Matched as shape" end select allocate(rectangle :: s2) select type (s2) class is (circle) print *, "Matched as circle" class is (rectangle) print *, "Matched as rectangle" s2%a = 5.0 s2%b = 4.0 print *, s2%a, s2%b if (s2%a /= 5.0) error stop if (s2%b /= 4.0) error stop ! TODO: Support calling methods on derived types in select type ! print *, s2%get_area() class default print *, "Matched as shape" end select end program select_type_13 lfortran-0.63.0/integration_tests/intrinsics_304.f900000664000175000017500000000472015174404631022463 0ustar alastairalastairprogram intrinsics_304 implicit none integer, parameter :: a1 = sign(1, 1) integer(8), parameter :: a2 = sign(1, -1) integer, parameter :: a3 = sign(-13, 0) integer(8), parameter :: a4 = sign(0, 42) real, parameter :: a5 = sign(1.425, 3.0) real(8), parameter :: a6 = sign(1.425, -3.0) real, parameter :: a7 = sign(1.425, 0.0) real(8), parameter :: a8 = sign(0.0, -3.0) integer, parameter :: ar1(3) = sign([1, 2, 3], [1, 2, 3]) integer(8), parameter :: ar2(3) = sign([1, -2, 3], -3) real, parameter :: ar3(3) = sign([1.425, -2.425, 3.425], 3.0) real(8), parameter :: ar4(3) = sign([1.425, -2.425, 3.425], 3.0) integer :: x1 = 123, x2 = -90 integer(8) :: x3 = 123, x4 = 423 real :: x5 = 123.0, x6 = -47981 real(8) :: x7 = 123.0, x8 = 123.0 integer :: arr1(3) = [-311, -241, 331], arr2(3) = [1, 2, 3] real :: arr3(3) = [1.425, -2.425, 3.425], arr4(3) = [1.425, -2.425, 3.425] print *, a1 if (a1 /= 1) error stop print *, a2 if (a2 /= -1) error stop print *, a3 if (a3 /= 13) error stop print *, a4 if (a4 /= 0) error stop print *, a5 if (abs(a5 - 1.425) > 1e-7) error stop print *, a6 if (abs(a6 - (-1.425)) > 1e-7) error stop print *, a7 if (abs(a7 - 1.425) > 1e-7) error stop print *, a8 if (abs(a8 - (-0.0)) > 1e-7) error stop print *, ar1 if (any(ar1 /= [1, 2, 3])) error stop print *, ar2 if (any(ar2 /= [-1, -2, -3])) error stop print *, ar3 if (any(abs(ar3 - [1.42499995e+00, 2.42499995e+00, 3.42499995e+00]) > 1e-7)) error stop print *, ar4 if (any(abs(ar4 - [1.42499995231628418e+00, 2.42499995231628418e+00, 3.42499995231628418e+00]) >1e-7)) error stop print *, sign(x1, x2) if (sign(x1, x2) /= -123) error stop print *, sign(x3, x4) if (sign(x3, x4) /= 123) error stop print *, sign(x5, x6) if (abs(sign(x5, x6) - (-123.0)) > 1e-7) error stop print *, sign(x7, x8) if (abs(sign(x7, x8) - 123.0) > 1e-7) error stop print *, sign(arr1, arr2) if (any(sign(arr1, arr2) /= [311, 241, 331])) error stop print *, sign(arr3, arr4) if (any(abs(sign(arr3, arr4) - [1.425, -2.425, 3.425]) > 1e-7)) error stop print *, sign(a=-12.,b=0.) print *, sign(a=-12.,b=1.) print *, sign(a=-12.,b=-1.) if ( .not. sign( a = -12, b = 1 ) == 12 ) error stop if ( .not. sign( -12, b = 0 ) == 12 ) error stop if ( .not. sign( -12, -1 ) == -12 ) error stop end program lfortran-0.63.0/integration_tests/procedure_13.f900000664000175000017500000000217515174404631022205 0ustar alastairalastairmodule pintrf_mod_procedure_13 implicit none private public :: OBJCON interface subroutine OBJCON(x) implicit none real, intent(in) :: x end subroutine OBJCON end interface end module pintrf_mod_procedure_13 module cobylb_mod_procedure_13 contains subroutine cobylb(calcfc) use, non_intrinsic :: pintrf_mod_procedure_13, only : OBJCON implicit none procedure(OBJCON) :: calcfc call evaluate(calcfc_internal) contains subroutine calcfc_internal(x_internal) implicit none real, intent(in) :: x_internal call calcfc(x_internal) end subroutine calcfc_internal subroutine evaluate(calcfc) use, non_intrinsic :: pintrf_mod_procedure_13, only : OBJCON implicit none procedure(OBJCON) :: calcfc call calcfc(12.91) end subroutine evaluate end subroutine cobylb end module program procedure_13 use cobylb_mod_procedure_13 call cobylb(calcfc) contains subroutine calcfc(x) implicit none real, intent(in) :: x print *, "inside calcfc: ", x if ( abs(x - 12.91) > 1e-8 ) error stop end subroutine calcfc end program lfortran-0.63.0/integration_tests/class_119.f900000664000175000017500000000126115174404631021404 0ustar alastairalastairmodule class_119_mod implicit none type :: divergence_1D_t contains procedure, pass(divergence_1D) :: f end type interface module function f(divergence_1D) result(r) class(divergence_1D_t), intent(in) :: divergence_1D integer :: r end function end interface contains module function f(divergence_1D) result(r) class(divergence_1D_t), intent(in) :: divergence_1D integer :: r r = 4 end function end module program class_119 use class_119_mod, only: divergence_1D_t implicit none type(divergence_1D_t) :: d if (d%f() /= 4) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/submodule_23b.f900000664000175000017500000000041415174404631022351 0ustar alastairalastairmodule submodule_23_mod implicit none type :: mytype contains procedure, nopass :: check end type interface module function check(args) result(found) integer, intent(in) :: args(:) logical found end function end interface end modulelfortran-0.63.0/integration_tests/dict_test_01_.f900000664000175000017500000000207515174404631022332 0ustar alastairalastairmodule dict_test_01_mod implicit none real :: eps = 1e-6 contains subroutine test_dict() _lfortran_dict(integer, real) :: rollnumber2cpi integer :: i integer :: size size = 1000 call _lfortran_set_item(rollnumber2cpi, 0, 1.1) do i=1000, 1000+size-1 call _lfortran_set_item(rollnumber2cpi, i, real(i)/100.0 + 5.0) end do do i=1000, 1000+size-1 if ( abs(_lfortran_get_item(rollnumber2cpi, i) - real(i)/100.0 - 5.0) > eps ) error stop end do if ( abs(_lfortran_get_item(rollnumber2cpi, 0) - 1.1) > eps ) error stop if ( _lfortran_len(rollnumber2cpi) /= 1001 ) error stop end subroutine subroutine test_issue_1348() if ( _lfortran_len(_lfortran_dict_constant(1, 2, 1, 3, 4, 5)) /= 2 ) error stop if ( _lfortran_len(_lfortran_dict_constant(1, 2, 1, 3, 1, 5)) /= 1 ) error stop end subroutine subroutine tests() call test_dict() call test_issue_1348() end subroutine end module program run_tuples use dict_test_01_mod call tests() end program lfortran-0.63.0/integration_tests/gpu_metal_131.f900000664000175000017500000000130515174404631022245 0ustar alastairalastair! Test: sum() of allocatable function result inside do concurrent. ! Previously generated "/* unknown ubound */" in Metal shader because ! the Metal codegen could not determine the array size when the function ! returns an allocatable array via a FixedSizeArray local. program gpu_metal_131 implicit none integer, parameter :: n = 3 real :: r(n) integer :: i do concurrent(i = 1:n) r(i) = sum(f()) end do if (abs(r(1) - 3.0) > 1e-5) error stop if (abs(r(2) - 3.0) > 1e-5) error stop if (abs(r(3) - 3.0) > 1e-5) error stop print *, "PASS" contains pure function f() result(v) real, allocatable :: v(:) allocate(v(2)) v(1) = 1.0 v(2) = 2.0 end function end program lfortran-0.63.0/integration_tests/allocate_61_mod.f900000664000175000017500000000037715174404631022645 0ustar alastairalastairmodule allocate_61_mymod implicit none type :: t integer :: x = 42 end type type :: w type(t), allocatable :: a end type contains function make_t() result(res) type(t) :: res res%x = 10 end function end module lfortran-0.63.0/integration_tests/intrinsics_121.f900000664000175000017500000000110315174404631022450 0ustar alastairalastairPROGRAM test integer(4) :: x = 576897908 integer(8) :: y = 5 WRITE (*,*) leadz(0_4) if (leadz(0_4) /= 32) error stop WRITE (*,*) leadz(5_8) if (leadz(5_8) /= 61) error stop WRITE (*,*) leadz(x) if (leadz(x) /= 2) error stop WRITE (*,*) leadz(y) if (leadz(y) /= 61) error stop WRITE (*,*) leadz(-y) if (leadz(-y) /= 0) error stop WRITE (*,*) leadz(-x) if (leadz(-x) /= 0) error stop WRITE (*,*) leadz(-2) if (leadz(-2) /= 0) error stop WRITE (*,*) leadz(0) if (leadz(0) /= 32) error stop END PROGRAMlfortran-0.63.0/integration_tests/class_73.f900000664000175000017500000000237015174404631021325 0ustar alastairalastairprogram class_73 implicit none type :: toml_map_structure end type toml_map_structure type, extends(toml_map_structure) :: toml_ordered_map integer, allocatable :: arr(:) end type toml_ordered_map class(toml_map_structure), allocatable :: self, self2, self3 type(toml_ordered_map), allocatable, target :: map type(toml_ordered_map), pointer :: map_ptr allocate(map) allocate(map%arr(3)) map%arr = [1, 2, 3] self = map select type(self) type is (toml_ordered_map) if (any(self%arr /= [1,2,3])) error stop class default error stop end select map_ptr => map if (any(map_ptr%arr /= [1,2,3])) error stop deallocate(self) self = map_ptr select type(self) type is (toml_ordered_map) if (any(self%arr /= [1,2,3])) error stop class default error stop end select allocate(self2) self2 = map select type(self2) type is (toml_ordered_map) if (any(self2%arr /= [1,2,3])) error stop class default error stop end select call move_alloc(map, self3) select type(self3) type is (toml_ordered_map) if (any(self3%arr /= [1,2,3])) error stop class default error stop end select end program class_73 lfortran-0.63.0/integration_tests/derived_types_18.f900000664000175000017500000000073515174404631023070 0ustar alastairalastairmodule derived_types_18_module_1 implicit none type t_1 integer :: i end type t_1 type, extends(t_1) :: t_2 real :: r end type t_2 end module program derived_types_10 use derived_types_18_module_1 implicit none type(t_1) :: type_1 type(t_2) :: type_2 type_1%i = 123 type_2%t_1 = type_1 type_2%r = 10.00 if (type_2%i /= 123) error stop if (type_2%r /= 10.00) error stop end program derived_types_10 lfortran-0.63.0/integration_tests/gpu_metal_164.f900000664000175000017500000000116315174404631022255 0ustar alastairalastairmodule gpu_metal_164_m implicit none type :: t integer :: k contains procedure :: f end type contains elemental function f(self, x) result(y) class(t), intent(in) :: self real, intent(in) :: x real :: y y = x + self%k end function end module program gpu_metal_164 use gpu_metal_164_m implicit none type(t) :: a integer :: i real :: x(2), r(2) a = t(1) x = 1.0 r = 0.0 do concurrent (i = 1:2) associate(dummy => 0) r = a%f(x) end associate end do if (abs(r(1) - 2.0) > 1e-6) error stop if (abs(r(2) - 2.0) > 1e-6) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/modules_65_base.f900000664000175000017500000000034115174404631022657 0ustar alastairalastairmodule modules_65_base implicit none type :: base_t integer :: width = 0 end type base_t type :: holder_t class(base_t), allocatable :: item end type holder_t end module modules_65_base lfortran-0.63.0/integration_tests/separate_compilation_41c.f900000664000175000017500000000016515174404631024560 0ustar alastairalastairmodule separate_compilation_41c use separate_compilation_41b implicit none end module separate_compilation_41c lfortran-0.63.0/integration_tests/intrinsic_reduce_derived_type_01.f900000664000175000017500000000160115174404631026277 0ustar alastairalastair! reduce() on arrays of derived type with a user-defined binary operation (Fortran 2018) program intrinsic_reduce_derived_type_01 implicit none type :: pair integer :: a integer :: b end type pair type(pair) :: tmp(2, 3) type(pair) :: expected(2) integer :: i, j do j = 1, 3 do i = 1, 2 tmp(i, j) = pair(i, j) end do end do ! reduce along dim 2: row i -> sum of tmp(i,1)%a + tmp(i,2)%a + tmp(i,3)%a (and same for b) expected = reduce(tmp, add_pair, dim=2) if (expected(1)%a /= 3) error stop if (expected(1)%b /= 6) error stop if (expected(2)%a /= 6) error stop if (expected(2)%b /= 6) error stop contains pure function add_pair(x, y) result(z) type(pair), intent(in) :: x, y type(pair) :: z z%a = x%a + y%a z%b = x%b + y%b end function add_pair end program lfortran-0.63.0/integration_tests/goto_gototarget_return_01.f900000664000175000017500000000055515174404631025020 0ustar alastairalastairsubroutine add_or_sub(select, a, b) integer :: select real :: a, b if (select == 1) goto 1 if (select == 2) goto 2 1 continue return 2 continue return end subroutine program goto_gototarget_return_01 real :: a, b integer :: select a = 1.0 b = 2.0 select = 1 call add_or_sub(select, a, b) print *, a select = 2 call add_or_sub(select, a, b) print *, a end program lfortran-0.63.0/integration_tests/intrinsics_47.f900000664000175000017500000000054515174404631022410 0ustar alastairalastairprogram intrinsics_47 implicit none logical :: l logical :: a(3) = [.true., .true., .true.] l = all([.true., .true.]) l = all([.true., .false.]) l = all([.false.]) l = all([.true.]) l = all(a) l = all([1 == 2, 0 == 0]) l = all([l]) l = all([.false., a, .true.]) if (l) error stop end program intrinsics_47 lfortran-0.63.0/integration_tests/string_19.f900000664000175000017500000000536315174404631021533 0ustar alastairalastairmodule string_19_stdlib_string_type implicit none type :: string_type sequence character(len=:), allocatable :: raw end type string_type interface len module procedure :: len_string end interface len interface char module procedure :: char_string end interface char contains elemental function len_string(string) result(length) type(string_type), intent(in) :: string integer :: length end function len_string pure function char_string(string) result(character_string) type(string_type), intent(in) :: string character(len=len(string)) :: character_string end function char_string end module module string_19_stdlib_strings use string_19_stdlib_string_type implicit none interface padl module procedure :: padl_char_default module procedure :: padl_char_pad_with end interface padl contains pure function compute_lps(string) result(lps_array) character(len=*), intent(in) :: string integer :: lps_array(len(string)) end function compute_lps function compute_lps_use(string) result(l) character(len=*), intent(in) :: string integer :: l print *, compute_lps(string) end function compute_lps_use function compute_lps_use1(string) result(l) type(string_type), intent(in) :: string integer :: l print *, char(string) end function compute_lps_use1 pure function padl_string_default(string, output_length) result(res) type(string_type), intent(in) :: string integer, intent(in) :: output_length type(string_type) :: res res = string_type(padl(char(string), output_length, " ")) end function padl_string_default pure function padl_string_pad_with(string, output_length, pad_with) result(res) type(string_type), intent(in) :: string integer, intent(in) :: output_length character(len=1), intent(in) :: pad_with type(string_type) :: res res = string_type(padl(char(string), output_length, pad_with)) end function padl_string_pad_with pure function padl_char_default(string, output_length) result(res) character(len=*), intent(in) :: string integer, intent(in) :: output_length character(len=len(string)) :: res res = padl(string, output_length, " ") end function padl_char_default pure function padl_char_pad_with(string, output_length, pad_with) result(res) character(len=*), intent(in) :: string integer, intent(in) :: output_length character(len=1), intent(in) :: pad_with character(len=max(len(string), output_length)) :: res integer :: string_length end function padl_char_pad_with end module program stdlib_strings_use use string_19_stdlib_strings implicit none end program lfortran-0.63.0/integration_tests/real_dp_02.f900000664000175000017500000000033415174404631021614 0ustar alastairalastairprogram test implicit none integer, parameter :: RP = kind(0.d0) real(kind=RP), parameter :: PI = 3.141592653589793_RP write(unit=*, fmt=*) PI if (abs(PI - 3.141592653589793_RP) > 1e-6_RP) error stop end program test lfortran-0.63.0/integration_tests/block_data_parameter_01.f900000664000175000017500000000064415174404631024334 0ustar alastairalastair! Test for PARAMETER statement handling in block data units ! Requires --implicit-typing flag program block_data_param_test implicit none real :: a(2) common /blk1/ a if (size(a) /= 2) error stop "Array size incorrect" print *, "Test Passed" end program block data bdata_1 parameter (KPI = 2) ! Uses implicit typing real a(KPI) common /blk1/ a data a /1.0, 2.0/ end block data lfortran-0.63.0/integration_tests/character_13.f900000664000175000017500000000205215174404631022143 0ustar alastairalastairmodule character_13_mod integer, parameter :: tfc = selected_char_kind('DEFAULT') character(kind=tfc, len=1) :: backslash = tfc_'\' character(kind=tfc, len=5) :: hello = tfc_"Hello" end module program character_13 use character_13_mod ! Test character kind parameter with string literals type :: toml_char character(1, tfc) :: hash = tfc_"#" character(1, tfc) :: lbracket = tfc_"[" character(1, tfc) :: rbracket = tfc_"]" end type type(toml_char) :: char_kind ! Test default initialization if (char_kind%hash /= "#") error stop if (char_kind%lbracket /= "[") error stop if (char_kind%rbracket /= "]") error stop ! Test explicit initialization char_kind = toml_char(tfc_"@", tfc_"(", tfc_")") if (char_kind%hash /= "@") error stop if (char_kind%lbracket /= "(") error stop if (char_kind%rbracket /= ")") error stop ! Test module level character variables if (backslash /= "\") error stop if (hello /= "Hello") error stop end program character_13 lfortran-0.63.0/integration_tests/modules_67_reexport.f900000664000175000017500000000016015174404631023616 0ustar alastairalastairmodule modules_67_reexport use modules_67_origin, only : pair_t, operator(.check.) implicit none end module lfortran-0.63.0/integration_tests/transfer_03.f900000664000175000017500000000154615174404631022041 0ustar alastairalastairmodule stdlib_hash_32bit_water_transfer_03 use iso_fortran_env, only: int16, int8, int32, int64 contains ! pure module function int8_water_hash( key ) result(hash_code) ! integer(int32) :: hash_code ! integer(int8), intent(in) :: key(:) ! end function int8_water_hash subroutine int16_water_hash( key ) integer(int16), intent(in) :: key(:) print *, transfer( key, 0_int8, size(key, kind=int64) ) ! TODO: values diverge with GFortran, PR intends to fix code generation error ! hash_code = int8_water_hash( transfer( key, 0_int8, size(key, kind=int64) ) ) end subroutine int16_water_hash end module stdlib_hash_32bit_water_transfer_03 program transfer_03 use stdlib_hash_32bit_water_transfer_03 integer(int16) :: key(10) key = 9 call int16_water_hash(key) end program lfortran-0.63.0/integration_tests/separate_compilation_10.f900000664000175000017500000000027515174404631024413 0ustar alastairalastairprogram separate_compilation_10 use history_mod_separate_compilation_10a real :: xhist(5,5) call rangehist(xhist) print *, xhist if (any(abs(xhist - 99.124) > 1e-8)) error stop end program lfortran-0.63.0/integration_tests/intrinsics_359.f900000664000175000017500000000031315174404631022467 0ustar alastairalastairprogram intrinsics_359 implicit none integer :: k print *, pack( [(k, k = 1, 2)] , [.true., .true.] ) if (any(pack( [(k, k = 1, 2)] , [.true., .true.] ) /= [1, 2])) error stop end programlfortran-0.63.0/integration_tests/expr_17.f900000664000175000017500000000052415174404631021173 0ustar alastairalastairprogram expr_17 implicit none type t real, dimension(:), pointer :: x end type t type(t) :: type real, target :: r(2) real :: ans(2) r = 34 type%x => r ans = type%x**2 print *, ans if (abs(ans(1) - 1156.0) > 1e-5) error stop if (abs(ans(2) - 1156.0) > 1e-5) error stop end program lfortran-0.63.0/integration_tests/bindc_01c.h0000664000175000017500000000016615174404631021263 0ustar alastairalastair#ifndef BINDC_01C #define BINDC_01C void ret_ptr_c(void **p); void print_ptr_c(int n, void *p); #endif // BINDC_01C lfortran-0.63.0/integration_tests/template_semiring.f900000664000175000017500000000041315174404631023413 0ustar alastairalastairmodule semiring_m use monoid_m, only: monoid implicit none private public :: semiring requirement semiring(T, plus, zero, mult, one) require :: monoid(T, plus, zero) require :: monoid(T, mult, one) end requirement end module lfortran-0.63.0/integration_tests/derived_types_02.f900000664000175000017500000000111615174404631023053 0ustar alastairalastairmodule derived_types_02_m implicit none integer, parameter :: r8 = kind(0.d0) type :: B end type type C end type type, extends(B), public :: X private real(r8) :: r1 type(C), pointer :: cc => null() real(r8), pointer :: r2(:) => null(), r3(:) => null() contains procedure, private :: p1 procedure :: p2 end type X contains subroutine p1(this) class(X), intent(out) :: this end subroutine subroutine p2(this) class(X), intent(inout) :: this end subroutine end module program derived_types_02 use derived_types_02_m, only: X implicit none type(X) :: b end lfortran-0.63.0/integration_tests/gpu_metal_139.f900000664000175000017500000000054015174404631022255 0ustar alastairalastairprogram gpu_metal_139 ! Test: allocatable array used in binary operation inside do concurrent implicit none real, allocatable :: x(:) real :: y(4) integer :: i allocate(x(4)) x = [1.0, 2.0, 3.0, 4.0] do concurrent (i = 1:4) y = x * 2.0 end do print *, y if (any(abs(y - [2.0, 4.0, 6.0, 8.0]) > 1.0e-6)) error stop end program lfortran-0.63.0/integration_tests/intrinsics_40.f900000664000175000017500000000054015174404631022374 0ustar alastairalastairprogram intrinsics_40 real(4) r4 real(8) r8 r4 = 1.521E0_4 r8 = 3.251_8 if (aint(r4) /= 1.0) error stop if (aint(r8) /= 3.0) error stop if (anint(r4) /= 2.0) error stop if (anint(r8) /= 3.0) error stop r8 = aint(r4, 8) if (aint(r4) /= 1.0) error stop r8 = anint(r4, 8) if (anint(r4) /= 2.0) error stop end program intrinsics_40 lfortran-0.63.0/integration_tests/submodule_40c.f900000664000175000017500000000027015174404631022351 0ustar alastairalastairsubmodule(submodule_40_mod) submodule_40_submod contains module procedure show_name if (names(1) /= "a") error stop 1 end procedure show_name end submodule submodule_40_submod lfortran-0.63.0/integration_tests/allocate_09.f900000664000175000017500000000103015174404631021773 0ustar alastairalastairprogram allocate_09 implicit none call get_command_arguments_quoted() contains subroutine get_command_arguments_quoted() character(len=:), allocatable :: arg integer :: ilength ilength = 10 if( allocated(arg) ) deallocate(arg) allocate(character(len=ilength) :: arg) arg = 'okay fine' print *, arg, len(arg) if( arg /= 'okay fine' ) error stop if( len(arg) /= 9 ) error stop end subroutine get_command_arguments_quoted end program allocate_09 lfortran-0.63.0/integration_tests/file_61.f900000664000175000017500000000150215174404631021130 0ustar alastairalastairprogram file_61 implicit none character(16) :: access, action, form, position, sequential logical :: opened integer :: lun = 42 character(*), parameter :: lfn = 'file_61.dat' open (lun, file=lfn, status='new', access='sequential', form='formatted') write (lun,*) 'test data' rewind (lun) inquire (unit=lun, access=access, action=action, form=form, & position=position, sequential=sequential, opened=opened) call pf (opened) call pf (access == 'SEQUENTIAL') call pf (action == 'READWRITE') call pf (form == 'FORMATTED') call pf (position == 'REWIND') call pf (sequential == 'YES') close (lun, status='delete') contains subroutine pf (l) logical, intent(in) :: l if (.not. l) error stop 'Test failed' end subroutine end program lfortran-0.63.0/integration_tests/format_13.f900000664000175000017500000000023615174404631021501 0ustar alastairalastairprogram format_13 implicit none character(len=10) :: flc write(flc, '(i0)') -2_1 print *, flc if (flc /= "-2") error stop end program lfortran-0.63.0/integration_tests/allocate_39.f900000664000175000017500000000057615174404631022014 0ustar alastairalastairprogram allocate_39 implicit none class(*), allocatable :: obj integer :: mold_var mold_var = 0 allocate(obj, mold=mold_var) select type(obj) type is (integer) obj = 55 print *, obj if (obj /= 55) error stop class default error stop end select print *, "PASS" end program allocate_39 lfortran-0.63.0/integration_tests/procedure_33.f900000664000175000017500000000233015174404631022200 0ustar alastairalastairmodule procedure_33_mod implicit none type :: MyType procedure(pintfc), pointer, nopass :: ptr => null() end type MyType abstract interface function pintfc() result(res) real(8) :: res end function pintfc end interface contains function impl() result(res) real(8) :: res res = 42.0_8 end function impl subroutine pointers() class(MyType), pointer :: myptr => null() procedure(pintfc), pointer :: ptr => null() type(MyType), target :: obj real(8) :: val ! Associate procedure pointer component obj%ptr => impl ! Point class pointer to object myptr => obj ! Assign procedure pointer from component ptr => myptr%ptr if (.not. associated(ptr)) error stop "ptr not associated" if (.not. associated(myptr%ptr)) error stop "component not associated" val = ptr() if (abs(val - 42.0_8) > 1.0e-12_8) then error stop "wrong function result" end if end subroutine pointers end module procedure_33_mod program procedure_33 use procedure_33_mod implicit none call pointers() print *, "Procedure pointer component procedure_33_mod passed." end program procedure_33lfortran-0.63.0/integration_tests/multi_file_member_access_02_mod.f900000664000175000017500000000036115174404631026046 0ustar alastairalastairmodule jtypes implicit none contains subroutine dummy(message, line) character(len=*), intent(in), optional :: message integer, intent(in), optional :: line if (present(line)) error stop 1 end subroutine end module jtypes lfortran-0.63.0/integration_tests/arrays_reshape_39.f900000664000175000017500000000256315174404631023236 0ustar alastairalastairprogram arrays_reshape_39 implicit none integer(8), parameter :: d1_int8(18) = [-10, 2, 3, 4, -6, 6, -7, 8, 9, 4, 1, -20, 9, 10, 14, 15, 40, 30] integer(8) :: d4_int8(3, 2, 3, 2) = reshape(d1_int8, [3, 2, 3, 2], [integer(8) :: 3]) ! First 18 elements filled from d1_int8 (column-major order) if (d4_int8(1,1,1,1) /= -10) error stop if (d4_int8(2,1,1,1) /= 2) error stop if (d4_int8(3,1,1,1) /= 3) error stop if (d4_int8(1,2,1,1) /= 4) error stop if (d4_int8(2,2,1,1) /= -6) error stop if (d4_int8(3,2,1,1) /= 6) error stop if (d4_int8(1,1,2,1) /= -7) error stop if (d4_int8(2,1,2,1) /= 8) error stop if (d4_int8(3,1,2,1) /= 9) error stop if (d4_int8(1,2,2,1) /= 4) error stop if (d4_int8(2,2,2,1) /= 1) error stop if (d4_int8(3,2,2,1) /= -20) error stop if (d4_int8(1,1,3,1) /= 9) error stop if (d4_int8(2,1,3,1) /= 10) error stop if (d4_int8(3,1,3,1) /= 14) error stop if (d4_int8(1,2,3,1) /= 15) error stop if (d4_int8(2,2,3,1) /= 40) error stop if (d4_int8(3,2,3,1) /= 30) error stop ! Remaining 18 elements filled with pad value 3 if (d4_int8(1,1,1,2) /= 3) error stop if (d4_int8(2,1,1,2) /= 3) error stop if (d4_int8(3,1,1,2) /= 3) error stop if (d4_int8(1,2,1,2) /= 3) error stop if (d4_int8(3,2,3,2) /= 3) error stop end program arrays_reshape_39 lfortran-0.63.0/integration_tests/intrinsics_124.f900000664000175000017500000000375615174404631022473 0ustar alastairalastairprogram intrinsics_124 integer(4) :: x, y integer(8) :: i, j integer(4) :: arg_x(5) = [12, -13, 18, 20, 67] integer(4) :: arg_y(5) = [1, 2, 3, 4, 5] integer(8) :: arg_x2(5) = [103, 87, 88, -95, -134] integer(8) :: arg_y2(5) = [11, 12, 4, 0, 10] integer(4) :: res_x(5) integer(8) :: res_x2(5) integer(4), parameter :: res(5) = lshift([12, -13, 18, 20, 67], [1, 2, 3, 4, 5]) integer(8), parameter :: res2(5) = lshift([103, 87, 88, -95, -134], [11, 12, 4, 0, 10]) integer(4) :: expected_res(5) = [24, -52, 144, 320, 2144] integer(8) :: expected_res2(5) = [210944, 356352, 1408, -95, -137216] integer(4), parameter :: comp1 = lshift(12, 1) integer(8), parameter :: comp2 = lshift(103, 11) print *, comp1 if (comp1 /= 24) error stop print *, comp2 if (comp2 /= 210944) error stop res_x = lshift(arg_x, arg_y) res_x2 = lshift(arg_x2, arg_y2) do i = 1, size(res) print *, res(i) if (res(i) /= expected_res(i)) error stop end do do i = 1, size(res2) print *, res2(i) if (res2(i) /= expected_res2(i)) error stop end do do i = 1, size(res_x) print *, res_x(i) if (res_x(i) /= expected_res(i)) error stop end do do i = 1, size(res_x2) print *, res_x2(i) if (res_x2(i) /= expected_res2(i)) error stop end do x = 16 y = 2 i = 8 j = 4 print*, lshift(10_4, 0) if (.not. lshift(10_4, 0) == 10) error stop print*, lshift(-10_8, 1) if ( lshift(-10_8, 1) /= -20 ) error stop print*, lshift(not(10_4), 2) if ( lshift(not(10_4), 2) /= -44 ) error stop print*, lshift(not(10_8), 3) if ( lshift(not(10_8), 3) /= -88 ) error stop print*, lshift(-x, y) if ( lshift(-x, y) /= -64 ) error stop print*, lshift(i, j) if ( lshift(i, j) /= 128 ) error stop print*, lshift(10, 1) if ( lshift(10, 1) /= 20 ) error stop print*, lshift(8, 2) if ( lshift(8, 2) /= 32 ) error stop end lfortran-0.63.0/integration_tests/doloop_06.f900000664000175000017500000000042015174404631021502 0ustar alastairalastairprogram doloop_06 implicit none integer :: i, j, k, cnt cnt = 0 do i = 1, 10 do j = 11, 20 do k = 101, 110 cnt = cnt + 1 end do end do end do print *, cnt if (cnt /= 1000) error stop end lfortran-0.63.0/integration_tests/submodule_25a.f900000664000175000017500000000045015174404631022352 0ustar alastairalastairprogram submodule_25a use submodule_25_m, only: tensor_t, compute implicit none type(tensor_t) :: t t = compute() if (t%n_ /= 2) error stop if (abs(t%data_(1) - 2.0d0) > 1.0d-10) error stop if (abs(t%data_(2) - 4.0d0) > 1.0d-10) error stop print *, "ok" end program submodule_25a lfortran-0.63.0/integration_tests/complex_01.f900000664000175000017500000000036115174404631021654 0ustar alastairalastairprogram complex_01 implicit none complex :: x = (1.0,-3.0) real, parameter :: a = 3.0, b = 4.0 complex :: y = (a, b) complex, parameter :: i_ = (0, 1) complex :: z = a + i_*b complex :: w = a+b + i_*(a-b) print *, x, y, z, w end program lfortran-0.63.0/integration_tests/cpp_pre_10.f900000664000175000017500000000073515174404631021642 0ustar alastairalastair#define WRAP(exp, desc) result = (exp) program cpp_pre_10 implicit none logical :: result result = .true. ! ) inside a string must not terminate macro argument collection early WRAP(.true., "string with ) paren inside") ! , inside a string must not split macro arguments incorrectly WRAP(.true., "string with , comma inside") ! single-quoted strings with ) or , must also work WRAP(.true., 'single-quoted ) paren') if (.not. result) error stop end program lfortran-0.63.0/integration_tests/select_type_46.f900000664000175000017500000000110715174404631022535 0ustar alastairalastair! Test: allocate(child_t :: s) must preserve dynamic type when subroutine ! has an assumed-shape array parameter alongside a polymorphic allocatable. type :: base_t end type type, extends(base_t) :: child_t end type class(base_t), allocatable :: s call make(s, [1]) select type(s) type is (child_t) print *, "PASSED" type is (base_t) error stop "FAIL: select type matched base_t instead of child_t" end select contains subroutine make(s, arr) class(base_t), allocatable, intent(out) :: s integer, intent(in) :: arr(:) allocate(child_t :: s) end subroutine end lfortran-0.63.0/integration_tests/openmp_09.f900000664000175000017500000000153115174404631021513 0ustar alastairalastairsubroutine parallel_factorial(n, ctr) use omp_lib use iso_fortran_env implicit none integer, intent(in) :: n integer(kind =int64), intent(inout) :: ctr integer(kind =int64) :: local_ctr integer :: i local_ctr = 1 !$omp parallel private(i) reduction(*:local_ctr) !$omp do do i = 1, n local_ctr = local_ctr * i end do !$omp end do !$omp end parallel ctr = ctr + local_ctr end subroutine program openmp_09 use omp_lib use iso_fortran_env integer, parameter :: n = 20 integer(kind =int64) :: ctr integer(kind =int64) :: res res = 2432902008176640000_int64 ! Factorial of 20 call omp_set_num_threads(8) ctr = 0 call parallel_factorial(n, ctr) print *, ctr if(ctr /= res) error stop end program lfortran-0.63.0/integration_tests/iso_c_binding_05.f900000664000175000017500000000067115174404631023003 0ustar alastairalastairprogram iso_c_binding_05 use iso_c_binding, only: c_loc, c_intptr_t implicit none type :: wrap_t integer, pointer :: p end type integer, target :: x = 10 type(wrap_t) :: w integer(c_intptr_t) :: expected, actual w%p => x expected = transfer(c_loc(x), expected) actual = transfer(c_loc(w%p), actual) if (expected /= actual) error stop "c_loc on pointer component returns wrong address" print *, "PASS" end program lfortran-0.63.0/integration_tests/separate_compilation_08a.f900000664000175000017500000000025115174404631024555 0ustar alastairalastairmodule module_using_all_1_separate_compilation_08a contains subroutine test_all(x) real :: x(5) if ( all(abs(x - 9.2134) < 1e-8 ) ) error stop end subroutine end module lfortran-0.63.0/integration_tests/modules_72_stypemod.f900000664000175000017500000000057515174404631023620 0ustar alastairalastairmodule modules_72_stypemod implicit none private type, public :: SomeType integer :: x = 0 end type SomeType interface SomeType procedure :: constructor end interface SomeType contains function constructor() result(self) type(SomeType) :: self self%x = 10 end function constructor end module modules_72_stypemod lfortran-0.63.0/integration_tests/ilp64_logical_read_01.f900000664000175000017500000000113015174404631023623 0ustar alastairalastair! Test: logical I/O with -fdefault-integer-8 (ILP64 mode) ! Fixes #9770 program ilp64_logical_read_01 implicit none logical :: flag1, flag2 ! Write logical values to temp file open(10, file="/tmp/test_ilp64_logical.txt", status="replace") write(10, *) .true. write(10, *) .false. close(10) ! Read them back open(10, file="/tmp/test_ilp64_logical.txt", status="old") read(10, *) flag1 read(10, *) flag2 close(10) if (.not. flag1) error stop "flag1 should be true" if (flag2) error stop "flag2 should be false" print *, "PASS" end program lfortran-0.63.0/integration_tests/intrinsics_38.f900000664000175000017500000000177115174404631022412 0ustar alastairalastairprogram intrinsics_38 implicit none character(len=25) :: empty = adjustr('') character(len=25) :: all_spaces = adjustr(' ') character(len=25) :: simple = adjustr('gfortran') character(len=25) :: space_at_start = adjustr(' gfortran') character(len=25) :: space_at_end = adjustr('gfortran ') character(len=25) :: space_in_between = adjustr(' g for tran ') character(len=25) :: spaces_with_symbols = adjustr(' # gfor* t $ ran & ') if (empty /= '') error stop if (all_spaces /= ' ') error stop if (simple /= 'gfortran') error stop if (space_at_start /= ' gfortran') error stop if (space_at_end /= ' gfortran') error stop if (space_in_between /= ' g for tran') error stop if (spaces_with_symbols /= ' # gfor* t $ ran &') error stop print *, empty print *, all_spaces print *, simple print *, space_at_start print *, space_at_end print *, space_in_between print *, spaces_with_symbols end programlfortran-0.63.0/integration_tests/equivalence_11.f900000664000175000017500000000066615174404631022517 0ustar alastairalastair! MRE: EQUIVALENCE + DATA with double precision arrays ! Reduced from LAPACK BLAS testing (dblat1.f DATA statements) program equivalence_11 implicit none double precision :: a(4), b(4) equivalence (a(1), b(1)) data b /1.0d0, 2.0d0, 3.0d0, 4.0d0/ if (abs(a(1) - 1.0d0) > 1.0d-10) error stop if (abs(a(2) - 2.0d0) > 1.0d-10) error stop if (abs(a(4) - 4.0d0) > 1.0d-10) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/forall_04.f900000664000175000017500000000177415174404631021500 0ustar alastairalastairprogram forall_04 implicit none real :: a(3,3) integer :: i a = 1.0 call zero_upper(a) ! Expected: lower-triangular matrix ! Row 1: 1.0 0.0 0.0 ! Row 2: 1.0 1.0 0.0 ! Row 3: 1.0 1.0 1.0 if (a(1,1) /= 1.0) error stop if (a(1,2) /= 0.0) error stop if (a(1,3) /= 0.0) error stop if (a(2,1) /= 1.0) error stop if (a(2,2) /= 1.0) error stop if (a(2,3) /= 0.0) error stop if (a(3,1) /= 1.0) error stop if (a(3,2) /= 1.0) error stop if (a(3,3) /= 1.0) error stop ! Test with a larger array call test_5x5() print *, "All tests passed." contains subroutine zero_upper(a) real, intent(inout) :: a(:,:) integer :: j forall (j=2:size(a,2)) a(:j-1,j) = 0.0 end subroutine subroutine test_5x5() real :: b(5,5) integer :: i, j b = 1.0 call zero_upper(b) do j = 1, 5 do i = 1, 5 if (i < j) then if (b(i,j) /= 0.0) error stop else if (b(i,j) /= 1.0) error stop end if end do end do end subroutine end program lfortran-0.63.0/integration_tests/string_91.f900000664000175000017500000000067515174404631021534 0ustar alastairalastairprogram old_charlen character*5 string5 ! Compiles with a constant character*(5) string5const ! Constant with parens character*(2+3) string5expr ! Expression string5 = "hello" string5const = "world" string5expr = "12345" print *, string5 print *, string5const print *, string5expr if (string5 /= "hello") error stop if (string5const /= "world") error stop if (string5expr /= "12345") error stop end program lfortran-0.63.0/integration_tests/gpu_metal_183.f900000664000175000017500000000044515174404631022260 0ustar alastairalastairprogram gpu_metal_183 implicit none real :: x(2,1) logical :: mask(2,1) integer :: i x = reshape([1.0, 3.0], [2,1]) do concurrent(i=1:1) mask(:,i) = x(:,i) < 2.5 end do print *, mask(1,1), mask(2,1) if (.not. mask(1,1)) error stop if (mask(2,1)) error stop end program lfortran-0.63.0/integration_tests/complex_20.f900000664000175000017500000000037315174404631021660 0ustar alastairalastairprogram complex_20 complex(8), parameter :: x = (1.129D0, -2.12D0) real(8), parameter :: re = x%re real(8), parameter :: ri = x%im if (abs(re - 1.129D0) > 1e-15) error stop if (abs(ri - (-2.12D0)) > 1e-15) error stop end program lfortran-0.63.0/integration_tests/common_05.f900000664000175000017500000000130415174404631021477 0ustar alastairalastairprogram main integer :: a, b, c(5), d common / block_1 / a, b, c a = 1 b = 2 c = 3 d = 4 b = c(1) d = a + b a = 5 * b if (a > b) then d = a + b / d else if (c(1) > d) then d = a - b end if select case (a) case (1) d = a + b case (2) d = a - b case default d = a * b end select do while (a > b) d = a + b a = a - 1 end do do a = 1, c(1), 1 d = a + b end do print *, a, b, c, d if (a /= 4) error stop if (b /= 3) error stop do a = 1, 5 if (c(a) /= 3) error stop end do if (d /= 6) error stop end programlfortran-0.63.0/integration_tests/file_open_02.f900000664000175000017500000000017615174404631022152 0ustar alastairalastairprogram open_recl_test integer :: u open(newunit=u, file="test.bin", access="direct", recl=4) close(u) end programlfortran-0.63.0/integration_tests/procedure_pointer_keyword_01.f900000664000175000017500000000153015174404631025500 0ustar alastairalastairmodule procedure_pointer_keyword_01_mod implicit none abstract interface function func_iface(x, verbose) result(res) integer, intent(in) :: x integer, intent(in), optional :: verbose integer :: res end function end interface type :: creator_type procedure(func_iface), pointer, nopass :: create_ptr => null() end type contains function my_func(x, verbose) result(res) integer, intent(in) :: x integer, intent(in), optional :: verbose integer :: res res = x if (present(verbose)) res = res + verbose end function end module program procedure_pointer_keyword_01 use procedure_pointer_keyword_01_mod implicit none type(creator_type) :: creator integer :: r creator%create_ptr => my_func r = creator%create_ptr(42, verbose=1) if (r /= 43) error stop print *, r end program lfortran-0.63.0/integration_tests/any_03.f900000664000175000017500000000152415174404631021000 0ustar alastairalastairprogram any_03 implicit none integer :: a(2, 3), b(2, 3) logical :: res1(3), res2(2) logical :: all_res1(3), all_res2(2) a = reshape([1, 2, 3, 4, 5, 6], [2, 3]) b = reshape([1, 0, 3, 4, 0, 6], [2, 3]) ! a == b is: ! [[T, T, F], ! [F, T, T]] res1 = any(a == b, 1) if (res1(1) .neqv. .true.) error stop if (res1(2) .neqv. .true.) error stop if (res1(3) .neqv. .true.) error stop res2 = any(a == b, 2) if (res2(1) .neqv. .true.) error stop if (res2(2) .neqv. .true.) error stop all_res1 = all(a == b, 1) if (all_res1(1) .neqv. .false.) error stop if (all_res1(2) .neqv. .true.) error stop if (all_res1(3) .neqv. .false.) error stop all_res2 = all(a == b, 2) if (all_res2(1) .neqv. .false.) error stop if (all_res2(2) .neqv. .false.) error stop end program lfortran-0.63.0/integration_tests/format_49.f900000664000175000017500000000220015174404631021503 0ustar alastairalastairprogram format_49 ! Test E format exponent adjustment when mantissa rounds to 0.999... ! Bug: exponent was off by one for extreme values like 1.0d-200 ! when using high precision formats like E25.17 use, intrinsic :: iso_fortran_env, only: dp => real64 implicit none real(dp) :: val character(30) :: output integer :: exp_val, i, exp_start ! 1.0d-200 with E25.17 format: ! Mantissa rounds to 0.99999999999999998 ! So exponent must be -200 (not -199) val = 1.0d-200 write(output, '(E25.17)') val ! Find the exponent sign position (last - or + in the string) exp_start = 0 do i = len_trim(output), 1, -1 if (output(i:i) == '-' .or. output(i:i) == '+') then exp_start = i exit end if end do ! Parse exponent from the sign position read(output(exp_start:), '(I4)') exp_val if (exp_val /= -200) then print *, "FAIL: 1.0d-200 exponent should be -200, got ", exp_val print *, "Output was: ", trim(output) error stop end if print *, "PASS: E format exponent correctly adjusted for 1.0d-200" end program lfortran-0.63.0/integration_tests/arrays_intrin_08.f900000664000175000017500000000111415174404631023075 0ustar alastairalastairprogram arrays_intrin_08 real :: zmat(4, 4), hdiag(4) integer :: i, j do i = 1, 4 do j = 1, 4 zmat(i, j) = i + j end do end do hdiag = calden(zmat) print *, hdiag if( any(hdiag /= [28.0, 36.0, 44.0, 52.0]) ) error stop contains function calden(zmat) result(hdiag) implicit none real(4), intent(in) :: zmat(:, :) ! ZMAT(NPT, NPT - N - 1) ! Outputs real(4) :: hdiag(size(zmat, 1)) ! Local variables integer(4) :: idz_loc idz_loc = 3 hdiag = -sum(zmat(:, 1:idz_loc - 1)**2, dim=2) + sum(zmat(:, idz_loc:size(zmat, 2))**2, dim=2) end function calden end program lfortran-0.63.0/integration_tests/format_09.f900000664000175000017500000000073015174404631021505 0ustar alastairalastairprogram format_09 implicit none integer :: a(5),b(5),c(10) integer, parameter :: dp=kind(0d0) real(dp) :: d(5) a = [117,123,124,126,129] b = [1,2,3,4,5] c = 1 d = [1._dp,1._dp,1._dp,1._dp,1._dp] print '(6(i6))', c print 10, "hello", a ,"world", b 10 format(a,i10,i4,i5,i6,i7) print 20, 'String:', 3.1415926d0, & 'Integer:', 42, & 'Array:', d 20 format(5x,a,d15.7//,5x,a,16x,i10//,5x,a//(5x,3d15.7)) end program lfortran-0.63.0/integration_tests/array_section_07.f900000664000175000017500000000043515174404631023057 0ustar alastairalastairprogram array_section_07 implicit none integer :: i0 integer, dimension(:), allocatable :: subpass integer :: temp(2) i0 = 1 subpass = [2,3] subpass = temp(i0:i0) print *, size(subpass) if (size(subpass) /= 1) error stop end program array_section_07lfortran-0.63.0/integration_tests/intrinsics_279.f900000664000175000017500000001164315174404631022500 0ustar alastairalastairprogram intrinsics_268 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp) :: arg_x(15) real(sp) :: arg_y(15) real(dp) :: res_x(15) real(sp) :: res_y(15) real(dp) :: expected_res_x(15) real(sp) :: expected_res_y(15) real(dp) :: expected_x(10) real(sp) :: expected_y(10) real(dp) :: a = 0.5178181202_dp real(sp) :: b = -0.072816_sp real(dp) :: c = -0.5178181202_dp real(sp) :: d = 0.072816_sp real(dp), parameter :: res_dp(10) = sinh([-0.62818828_dp, -0.51725372_dp, -0.29257208_dp, & 0.62818828_dp, 0.51725372_dp, 0.29257208_dp, 1.00_dp, 0.829362821_dp, 0.952716192_dp, -0.241626228_dp]) real(sp), parameter :: res_sp(10) = sinh([-0.62818828_sp, -0.51725372_sp, -0.29257208_sp, & 0.62818828_sp, 0.51725372_sp, 0.29257208_sp, 1.00_sp, 0.829362821_sp, 0.952716192_sp, -0.241626228_sp]) expected_x = [-0.67032718570509986_dp, -0.54062957805332923_dp, -0.29676393202885426_dp, & 0.67032718570509986_dp, 0.54062957805332923_dp, 0.29676393202885426_dp, 1.1752011936438014_dp, & 0.92776536742907800_dp, 1.1035252521116077_dp, -0.24398425438275537_dp] arg_x = [-0.67922251126_dp, -0.54363892699177885_dp, -0.29691551032790681_dp, & 0.67922251126401767_dp, 0.54363892699177885_dp, 0.29691551032790681_dp, 0.5707963267948966_dp, & 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp, -0.7281628262782_dp, & 0.5707963267948966_dp, 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp] arg_y = [-0.679222465_sp, -0.543638885_sp, -0.296915501_sp, & 0.679222465_sp, 0.543638885_sp, 0.296915501_sp, 0.57079637_sp, & 0.077966249_sp, 0.262053013_sp, -0.244041398_sp, -0.7281628262782_sp, & 0.57079637_sp, 0.077966249_sp, 0.262053013_sp, -0.244041398_sp] expected_y = [-0.670327127_sp, -0.540629566_sp, -0.296763927_sp, & 0.670327127_sp, 0.540629566_sp, 0.296763927_sp, 1.17520118_sp, & 0.927765369_sp, 1.10352528_sp, -0.243984252_sp] res_x = sinh(arg_x) res_y = sinh(arg_y) expected_res_x = [-0.73266631321193876_dp, -0.57081556675017531_dp, -0.30129740109954350_dp, & 0.73266631321691944_dp, 0.57081556675017531_dp, 0.30129740109954350_dp, 0.60230022788767801_dp, & 7.8045284675324761E-002_dp, 0.26506264089844722_dp, -0.24647097427195003_dp, -0.79423833474419503_dp, & 0.60230022788767801_dp, 7.8045284675324761E-002_dp, 0.26506264089844722_dp, -0.24647097427195003_dp] expected_res_y = [-0.732666254_sp, -0.570815504_sp, -0.301297396_sp, & 0.732666254_sp, 0.570815504_sp, 0.301297396_sp, 0.602300286_sp, & 7.80452639E-02_sp, 0.265062600_sp, -0.246470988_sp, -0.794238329_sp, & 0.602300286_sp, 7.80452639E-02_sp, 0.265062600_sp, -0.246470988_sp] do i = 1, size(res_dp) print *, res_dp(i) if (abs(res_dp(i) - expected_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_x) print *, res_x(i) if (abs(res_x(i)) - abs(expected_res_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_y(i)) > 1e-5) error stop end do do i = 1, size(res_y) print *, res_y(i) if (abs(res_y(i)) - abs(expected_res_y(i)) > 1e-5) error stop end do print *, sinh(a) if (abs(sinh(a)) - 0.54127126592762664_dp > 1e-12) error stop print *, sinh(0.5178181202_dp) if (abs(sinh(0.5178181202_dp) - 0.54127126592762664_dp) > 1e-12) error stop print *, sinh(b) if (sinh(b) - (-7.28803650E-02_sp) > 1e-5) error stop print *, sinh(-0.072816_sp) if (sinh(-0.072816_sp) - (-7.28803650E-02_sp) > 1e-5) error stop print *, sinh(c) if (sinh(c) - (-0.54127126592762664_dp) > 1e-12) error stop print *, sinh(-0.5178181202_dp) if (sinh(-0.5178181202_dp) - (-0.54127126592762664_dp) > 1e-12) error stop print *, sinh(d) if (sinh(d) - (7.28803650E-02_sp) > 1e-5) error stop print *, sinh(0.072816_sp) if (sinh(0.072816_sp) - (7.28803650E-02_sp) > 1e-5) error stop a = -0.271927291_dp b = -0.6382728_sp c = 0.271927291_dp d = 0.6382728_sp print *, sinh(a) if (abs(sinh(a) - (-0.27529095556357069_dp)) > 1e-12) error stop print *, sinh(-0.271927291_dp) if (abs(sinh(-0.271927291_dp) - (-0.27529095556357069_dp)) > 1e-12) error stop print *, sinh(b) if (sinh(b) - (-0.682502091_sp) > 1e-5) error stop print *, sinh(-0.6382728_sp) if (sinh(-0.6382728_sp) - (-0.682502091_sp) > 1e-5) error stop print *, sinh(c) if (sinh(c) - (0.27529095556357069_dp) > 1e-12) error stop print *, sinh(0.271927291_dp) if (sinh(0.271927291_dp) - (0.27529095556357069_dp) > 1e-12) error stop print *, sinh(d) if (sinh(d) - (.682502091_sp) > 1e-5) error stop print *, sinh(0.6382728_sp) if (sinh(0.6382728_sp) - (.682502091_sp) > 1e-5) error stop end programlfortran-0.63.0/integration_tests/gpu_metal_11.f900000664000175000017500000000110015174404631022153 0ustar alastairalastairprogram gpu_metal_11 ! 2D do concurrent: matrix addition implicit none integer, parameter :: m = 128, n = 128 real :: a(m, n), b(m, n), c(m, n), c_expected(m, n) integer :: i, j do j = 1, n do i = 1, m a(i, j) = real(i + j) b(i, j) = real(i * j) c(i, j) = 0.0 c_expected(i, j) = real(i + j) + real(i * j) end do end do do concurrent (i = 1:m, j = 1:n) c(i, j) = a(i, j) + b(i, j) end do do j = 1, n do i = 1, m if (abs(c(i, j) - c_expected(i, j)) > 1.0e-5) error stop end do end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/procedure_pointer_17.f900000664000175000017500000000126415174404631023747 0ustar alastairalastair! Test: Pass implicit procedure pointer as actual argument to a function ! Declaration: procedure(), pointer program implicit_ptr_17_actual_arg procedure(), pointer :: ifunc => null() integer :: res ifunc => inegate res = iapply_op(ifunc, 42) if (res /= -42) error stop "FAIL: expected -42" print *, "PASS: implicit_ptr_17_actual_arg" contains function inegate(n) integer, intent(in) :: n integer :: inegate inegate = -n end function function iapply_op(ip, val) procedure(), pointer, intent(in) :: ip integer, intent(in) :: val integer :: iapply_op iapply_op = ip(val) end function end program lfortran-0.63.0/integration_tests/parameter_02.f900000664000175000017500000000042215174404631022164 0ustar alastairalastairsubroutine a_proc implicit none integer :: i parameter(i = 1) print *, i end subroutine a_proc module parameter_02_a implicit none integer :: i parameter(i = 2) end module program parameter_02 use parameter_02_a, only: i implicit none call a_proc() print *, i end program lfortran-0.63.0/integration_tests/intrinsics_254.f900000664000175000017500000000363615174404631022474 0ustar alastairalastairprogram intrinsics_251 use, intrinsic :: iso_fortran_env, only: sp => real32, dp => real64 real(sp), parameter :: r1 = erfc(1.1_sp) real(dp), parameter :: r2 = erfc(4.12_dp) real(sp), parameter :: ar1(3) = erfc([0.5_sp, -1.5_sp, 2.2_sp]) real(dp), parameter :: ar2(2) = erfc([-0.2_dp, 0.0_dp]) real(sp) :: x real(dp) :: y, z real(sp) :: arr1(3) real(dp) :: arr2(3), res(3) x = 6.738377383_sp y = 3.1473863781_dp z = 7389.83936383_dp print *, erfc(x) if (abs(erfc(x) - 1.58035037e-21_sp) > 1e-6_sp) error stop print *, erfc(y) if (abs(erfc(y) - 8.54408946394494113e-06_dp) > 1e-12) error stop print *, erfc(z) if (abs(erfc(z) - 0.00000000000000000e+00_dp) > 1e-12) error stop x = -6.738377383_sp y = -3.1473863781_dp z = -7389.83936383_dp print *, erfc(x) if (abs(erfc(x) - 2.00000000e+00_sp) > 1e-6_sp) error stop print *, erfc(y) if (abs(erfc(y) - 1.99999145591053606e+00_dp) > 1e-12_dp) error stop print *, erfc(z) if (abs(erfc(z) - 2.00000000000000000e+00_dp) > 1e-12_dp) error stop print *, r1 if (abs(r1 - 1.19794928e-01_sp) > 1e-6_sp) error stop print *, r2 if (abs(r2 - 5.65815721936131674e-09_dp) > 1e-12_dp) error stop print *, ar1 if (any(abs(ar1 - [4.79500115e-01_sp, 1.96610510e+00_sp, 1.86284585e-03_sp]) > 1e-6_sp)) error stop print *, ar2 if (any(abs(ar2 - [1.22270258921047859e+00_dp, 1.00000000000000000e+00_dp]) > 1e-12_dp)) error stop arr1 = [-6.738377383_sp, -3.1473863781_sp, -7389.83936383_sp] print *, erfc(arr1) if (any(abs(erfc(arr1) - [2.00000000e+00_sp, 1.99999142e+00_sp, 2.00000000e+00_sp]) > 1e-6_sp)) error stop arr2 = [6.738377383_dp, 3.1473863781_dp, 7389.83936383_dp] res = erfc(arr2) print *, res if (any(abs(res - [1.58035442023170862e-21_dp, 8.54408946394494113e-06_dp, 0.00000000000000000e+00_dp]) > 1e-12_dp)) error stop end programlfortran-0.63.0/integration_tests/bindc6_sum.c0000664000175000017500000000021615174404631021561 0ustar alastairalastairdouble sum_arr(const double *a, int n) { double sum = 0.0; for (int i = 0; i < n; i++) { sum += a[i]; } return sum; } lfortran-0.63.0/integration_tests/intrinsics_132.f900000664000175000017500000000404715174404631022464 0ustar alastairalastairprogram intrinsics_132 real :: x = 5.8 integer, parameter :: array_size = 3 integer(kind = 4) :: res_4 integer(kind = 8) :: res_8 integer :: test_kind integer(kind=4) :: res_4_arr(array_size) integer(kind=8) :: res_8_arr(array_size) res_4 = floor(x) print *, res_4 if (res_4 /= 5) error stop res_8 = floor(x, 8) print *, res_8 if (res_8 /= 5) error stop res_4 = floor(x, 4) print *, res_4 if (res_4 /= 5) error stop res_4 = floor(5.8) print *, res_4 if (res_4 /= 5) error stop res_8 = floor(5.8, 8) print *, res_8 if (res_8 /= 5) error stop res_4 = floor(0.0) print *, res_4 if (res_4 /= 0) error stop res_8 = floor(0.0, 8) print *, res_8 if (res_8 /= 0) error stop res_4 = floor(-412.124) print *, res_4 if (res_4 /= -413) error stop res_8 = floor(-412.124, 8) print *, res_8 if (res_8 /= -413) error stop test_kind = kind(floor(x,4)) print *, test_kind if (test_kind /= 4) error stop test_kind = kind(floor(x,8)) print *, test_kind if (test_kind /= 8) error stop test_kind = kind(floor(5.0,4)) print *, test_kind if (test_kind /= 4) error stop test_kind = kind(floor(5.0,8)) print *, test_kind if (test_kind /= 8) error stop test_kind = kind(floor(0.0)) print *, test_kind if (test_kind /= 4) error stop ! Compile time broadcasting res_4_arr = floor([real:: 1.2, 3.3, 5]) print *, res_4_arr(1) if (res_4_arr(1) /= 1) error stop print *, res_4_arr(2) if (res_4_arr(2) /= 3) error stop print *, res_4_arr(3) if (res_4_arr(3) /= 5) error stop res_8_arr = floor([real(8) :: 1.2, 3.3, 5], kind=8) print *, res_8_arr(1) if (res_8_arr(1) /= 1) error stop if (kind(res_8_arr(1)) /= 8) error stop print *, res_8_arr(2) if (res_8_arr(2) /= 3) error stop if (kind(res_8_arr(2)) /= 8) error stop print *, res_8_arr(3) if (res_8_arr(3) /= 5) error stop if (kind(res_8_arr(3)) /= 8) error stop end program lfortran-0.63.0/integration_tests/arrays_reshape_18.f900000664000175000017500000000072515174404631023231 0ustar alastairalastairprogram arrays_reshape_18 integer :: A(2,2) integer :: B(2,2) A = reshape(source = [1,2,2,1], shape = shape(A)) print *, A(1,1), A(1,2), A(2,1), A(2,2) if (A(1,1) /= 1) error stop if (A(1,2) /= 2) error stop if (A(2,1) /= 2) error stop if (A(2,2) /= 1) error stop B = reshape([1,2,2,1], shape = shape(B)) print *, B(1,1), B(1,2), B(2,1), B(2,2) if (B(1,1) /= 1) error stop if (B(1,2) /= 2) error stop if (B(2,1) /= 2) error stop if (B(2,2) /= 1) error stop end program lfortran-0.63.0/integration_tests/goto_05.f900000664000175000017500000000101115174404631021152 0ustar alastairalastairprogram goto_05 implicit none integer :: a, n ! Jump to the label n = 1 -> 1 assign 1 to n a = 0 go to n, (1, 2, 3) a = a + 1 1 a = a + 2 2 a = a + 4 3 a = a + 8 print *, a if(a /= 2+4+8) error stop ! Jump to the label n = 6 -> 6 assign 6 to n a = 0 go to n, (4, 5, 6) a = a + 1 4 a = a + 2 5 a = a + 4 6 a = a + 8 print *, a if(a /= 8) error stop ! Jump to the label n = 8 -> 8 assign 8 to n a = 0 go to n, (7, 8, 9) a = a + 1 7 a = a + 2 8 a = a + 4 9 a = a + 8 print *, a if(a /= 4+8) error stop end program lfortran-0.63.0/integration_tests/compiler_version_01.f900000664000175000017500000000020015174404631023554 0ustar alastairalastairprogram compiler_version_01 use, intrinsic :: iso_fortran_env implicit none print *, compiler_version() end program lfortran-0.63.0/integration_tests/class_143.f900000664000175000017500000000141715174404631021404 0ustar alastairalastairprogram class_143 ! Test: allocate class(*) 2D array with source=reshape() implicit none class(*), allocatable :: x(:,:) allocate(x, source=reshape([1, 2, 3, 4], shape=[2, 2])) select type(x) type is (integer) if (x(1,1) /= 1) error stop if (x(2,1) /= 2) error stop if (x(1,2) /= 3) error stop if (x(2,2) /= 4) error stop class default error stop end select deallocate(x) allocate(x, source=reshape([1.5, 2.5, 3.5, 4.5, 5.5, 6.5], shape=[2, 3])) select type(x) type is (real) if (size(x, 1) /= 2) error stop if (size(x, 2) /= 3) error stop if (abs(x(1,1) - 1.5) > 1.0e-6) error stop if (abs(x(2,1) - 2.5) > 1.0e-6) error stop if (abs(x(1,2) - 3.5) > 1.0e-6) error stop class default error stop end select print *, "PASS" end program lfortran-0.63.0/integration_tests/transfer_26.f900000664000175000017500000000052515174404631022042 0ustar alastairalastairprogram transfer_26 implicit none type :: a_t integer, pointer :: p end type type :: b_t integer, pointer :: p end type type(a_t) :: a type(b_t) :: b integer, target :: val val = 42 a%p => val b = transfer(a, b) if (.not. associated(b%p)) error stop if (b%p /= 42) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/select_rank_09.f900000664000175000017500000000213615174404631022511 0ustar alastairalastair program select_rank_test implicit none integer :: b(2) = [1,2] integer :: c(2,2) = reshape([1,2,3,4],[2,2]) integer :: d(2,2,2) = reshape([1,2,3,4,5,6,7,8],[2,2,2]) call check(b, 1) call check(c, 2) call check(d, 3) contains subroutine check(x, expected) integer, intent(in) :: x(..) integer, intent(in) :: expected integer :: minloc_res1(1) integer :: minloc_res2(2) select rank(y=>x) rank(1) print *, y minloc_res1 = minloc(y) if (minloc_res1(1) /= 1) error stop if (y(2) /= 2) error stop if (expected /= 1) error stop rank(2) print *, y minloc_res2 = minloc(y) if (any(minloc_res2 /= [1, 1])) error stop print *, minloc(y) if (expected /= 2) error stop rank(3) print *, y print *, minloc(y) if (expected /= 3) error stop end select end subroutine check end program select_rank_testlfortran-0.63.0/integration_tests/functions_32.f900000664000175000017500000000271015174404631022221 0ustar alastairalastairmodule function_32_mod contains function matprod(x, y) result(z) real(8), intent(in) :: x(:, :) real(8), intent(in) :: y(:, :) real(8) :: z(size(x, 1), size(y, 2)) integer :: i, j z = 1.0_8 end function matprod function return_type_check(x) result(z) real(8), intent(in) :: x(:, :) real(8) :: z(size(x)) z = 1.0_8 end function end module program function_32 use function_32_mod real(8) :: x(5,2) integer :: iact(2) integer :: nact real(8) :: full_size(10) iact = [2,1] nact = -1 full_size = return_type_check(x(:,iact)) + 1.0_8 if(any(full_size /= 2.0_8)) error stop x = matprod(x(:,iact), x(:, iact)) + 1.0_8 if(any(x /= 2.0_8)) error stop call func(x, iact, nact) contains subroutine func(x, iact, nact) real(8), intent(in) :: x(:,:) integer, intent(inout) :: iact(:) integer, intent(inout) :: nact real(8) :: bmat(2, 2 + size(x,1)) real(8) :: yzmat_c(2, size(x,2)) real(8) :: tmp_x(size(x,1) * size(x,2)) integer :: npt npt = size(x,1) bmat(:, 1:npt) = matprod(yzmat_c, transpose(x)) if(any(bmat(:,1:npt) /= 1.0_8)) error stop tmp_x = return_type_check(x(:,iact)) + 1.0_8 if(any(tmp_x /= 2.0_8)) error stop yzmat_c = matprod(x(iact, :), x(:, iact)) + 1.0_8 if(any(yzmat_c /= 2.0_8)) error stop nact = 2 bmat(:, 1:nact) = -matprod(yzmat_c, x(:, 1:nact)) if(any(bmat(:,1:nact) /= -1.0_8)) error stop end subroutine end program lfortran-0.63.0/integration_tests/intrinsics_299.f900000664000175000017500000000011115174404631022466 0ustar alastairalastairprogram intrinsics_299 print *, command_argument_count() end program lfortran-0.63.0/integration_tests/loop_unroll_large.f900000664000175000017500000000040015174404631023415 0ustar alastairalastairprogram loop_unroll_large implicit none integer :: i, first, last integer, allocatable :: array(:) allocate(array(35)) do i = 1, 35 array(i) = i end do do i = 1, 35 print *, array(i) end do end program lfortran-0.63.0/integration_tests/inquire_01.f900000664000175000017500000000071715174404631021666 0ustar alastairalastairprogram inquire_01 implicit none call check_inquire_01() contains subroutine check_inquire_01() logical :: file_exists character(len=:), allocatable :: fname fname = "this/will/fail.always" inquire (file='/this/will/fail.always', exist=file_exists) print *, file_exists inquire (file=fname, exist=file_exists) print *, file_exists end subroutine check_inquire_01 end program inquire_01 lfortran-0.63.0/integration_tests/cpp_pre_14.f900000664000175000017500000000031115174404631021634 0ustar alastairalastairprogram cpp_pre_14 use iso_c_binding, only: c_int #include "cpp_pre_14_include.h" implicit none integer(c_int) :: x x = CPP_PRE_14_VAL if (x /= 42) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/intrinsics_108.f900000664000175000017500000000532715174404631022471 0ustar alastairalastairprogram intrinsics_108 integer(4) :: x, y, i_4 integer(8) :: i, j integer :: arr3(3) integer(4) :: arg_x(5) = [12, 13, 18, 20, 67] integer(4) :: arg_y(5) = [1, 2, 3, 4, 5] integer(8) :: arg_x2(5) = [103, 87, 88, 95, 134] integer(8) :: arg_y2(5) = [11, 12, 4, 0, 10] integer(4) :: res_x(5) integer(8) :: res_x2(5) integer(4), parameter :: res(5) = shiftr([12, 13, 18, 20, 67], [1, 2, 3, 4, 5]) integer(8), parameter :: res2(5) = shiftr([103, 87, 88, 95, 134], [11, 12, 4, 0, 10]) integer(4) :: expected_res(5) = [6, 3, 2, 1, 2] integer(8) :: expected_res2(5) = [0, 0, 5, 95, 0] integer(4), parameter :: comp1 = shiftr(12, 1) integer(4), parameter :: neg1 = shiftr(-122, 23) integer(8), parameter :: comp2 = shiftr(103, 11) integer(8), parameter :: neg2 = shiftr(-19381002102129_8, 63) print *, comp1 if (comp1 /= 6) error stop print *, comp2 if (comp2 /= 0) error stop res_x = shiftr(arg_x, arg_y) res_x2 = shiftr(arg_x2, arg_y2) do i = 1, size(res) print *, res(i) if (res(i) /= expected_res(i)) error stop end do do i = 1, size(res2) print *, res2(i) if (res2(i) /= expected_res2(i)) error stop end do do i = 1, size(res_x) print *, res_x(i) if (res_x(i) /= expected_res(i)) error stop end do do i = 1, size(res_x2) print *, res_x2(i) if (res_x2(i) /= expected_res2(i)) error stop end do x = 16 y = 2 i = 8 j = 4 print*, shiftr(10_4, 0) if (.not. shiftr(10_4, 0) == 10) error stop print*, shiftr(-10_8, 1) ! if ( shiftr(i, j) /= 9223372036854775803 ) error stop ! Does not work yet print*, shiftr(not(10_4), 2) ! if ( shiftr(i, j) /= 1073741821 ) error stop ! Does not work yet print*, shiftr(not(10_8), 3) ! if ( shiftr(i, j) /= 2305843009213693950 ) error stop ! Does not work yet print*, shiftr(-x, y) ! if ( shiftr(-x, y) /= 1073741820 ) error stop print*, shiftr(i, j) if ( shiftr(i, j) /= 0 ) error stop print*, shiftr(10, 1) if ( shiftr(10, 1) /= 5 ) error stop print*, shiftr(8, 2) if ( shiftr(8, 2) /= 2 ) error stop ! test broadcasting of `shiftr` arr3 = shiftr([20, 11, 8], 1) if (arr3(1) /= 10) error stop if (arr3(2) /= 5) error stop if (arr3(3) /= 4) error stop arr3 = shiftr([20, 11, 8], [1, 2, 3]) if (arr3(1) /= 10) error stop if (arr3(2) /= 2) error stop if (arr3(3) /= 1) error stop i_4 = -122 j = -19381002102129_8 x = 23 y = 63 print *, shiftr(i_4, x), shiftr(j, y) if (shiftr(i_4, x) /= 511 .or. shiftr(j, y) /= 1) error stop print *, neg1, neg2 if (neg1 /= 511 .or. neg2 /= 1) error stop end lfortran-0.63.0/integration_tests/formatted_read_02.f900000664000175000017500000000151715174404631023172 0ustar alastairalastairprogram formatted_read_02 implicit none character(4) :: s1, s2, s3 open (10, file='formatted_read_02.txt', form='formatted', status='unknown') write (10, '(a)') 'abcdwxyz1234' rewind (10) s1 = '(no)'; s2 = '(no)'; s3 = '(no)' read (10, '(a4, 1(a4), a4)') s1, s2, s3 if (s1 /= 'abcd') error stop if (s2 /= 'wxyz') error stop if (s3 /= '1234') error stop rewind (10) s1 = '(no)'; s2 = '(no)'; s3 = '(no)' read (10, '(a4, 2(a4))') s1, s2, s3 if (s1 /= 'abcd') error stop if (s2 /= 'wxyz') error stop if (s3 /= '1234') error stop rewind (10) s1 = '(no)'; s2 = '(no)'; s3 = '(no)' read (10, '((a4), a4, a4)') s1, s2, s3 if (s1 /= 'abcd') error stop if (s2 /= 'wxyz') error stop if (s3 /= '1234') error stop close (10, status='delete') print *, "All tests passed." end program formatted_read_02 lfortran-0.63.0/integration_tests/format_17.f900000664000175000017500000000015115174404631021501 0ustar alastairalastairprogram format_17 integer ::i 201 FORMAT( 3I1 ) write(*,201) (1,i=1,3) end program format_17lfortran-0.63.0/integration_tests/class_47.f900000664000175000017500000000261515174404631021330 0ustar alastairalastairmodule class_47_mod type, abstract :: AbsType contains procedure(method2), deferred :: method2 end type AbsType abstract interface function method2(self,arr) result(a) import class(AbsType), intent(in) :: self integer, intent(in) :: arr(:) integer :: a(size(arr)) end function method2 end interface type, extends(AbsType) :: MyType contains procedure :: method2 => my_method2 end type MyType type :: SomeType integer, allocatable :: arr(:) class(MyType), allocatable :: obj contains procedure :: method1 end type SomeType contains subroutine method1(self) class(SomeType), intent(inout) :: self allocate(MyType :: self%obj) self%arr = self%obj%method2(self%arr) end subroutine method1 function my_method2(self, arr) result(a) class(MyType), intent(in) :: self integer, intent(in) :: arr(:) integer :: a(size(arr)) integer :: i do i = 1, size(arr) a(i) = arr(i) * 2 end do end function my_method2 end module class_47_mod program class_47 use class_47_mod implicit none class(SomeType), allocatable :: s allocate(s) allocate(s%arr(3)) s%arr = [1, 2, 3] call s%method1() print *, "s%arr: ", s%arr if (.not. all(s%arr == [2, 4, 6])) error stop end program class_47lfortran-0.63.0/integration_tests/class_121.f900000664000175000017500000000142115174404631021373 0ustar alastairalastairmodule class_121_mod implicit none type :: MyType contains procedure :: method1 procedure :: method2 end type MyType contains subroutine method1(self) class(MyType), intent(inout) :: self real(8), dimension(140) :: a real(8), dimension(140,4) :: b a = 1.0d0 b = 2.0d0 call self%method2(a(1:140), b(1:140,:)) end subroutine method1 subroutine method2(self, a, b) class(MyType), intent(in) :: self real(8), intent(in) :: a(:) real(8), intent(inout) :: b(:,:) b(:,1) = a + b(:,1) end subroutine method2 end module class_121_mod program class_121 use class_121_mod implicit none type(MyType) :: obj call obj%method1() print *, "ok" end program class_121 lfortran-0.63.0/integration_tests/derived_types_40.f900000664000175000017500000000210215174404631023051 0ustar alastairalastairmodule derived_types_40_func_type abstract interface subroutine OBJ(x) real, intent(inout) :: x(:) end subroutine end interface contains subroutine temp_calfun(x) real, intent(inout) :: x(:) x = x + 1 end subroutine temp_calfun end module derived_types_40_func_type module derived_types_40_prob_mod use derived_types_40_func_type public :: temp_calfun type PROB_T procedure(OBJ),nopass, pointer :: calfun => null() procedure(OBJ),nopass, pointer :: calfun2 => temp_calfun end type PROB_T procedure(OBJ), pointer :: orig_calfun contains subroutine construct(prob) type(PROB_T), intent(out) :: prob real :: x(5) x = 0 prob % calfun => temp_calfun call prob % calfun(x) if (any(x /= 1.0)) error stop call prob % calfun2(x) if (any(x /= 2.0)) error stop end subroutine end module program derived_types_40 use derived_types_40_prob_mod type(PROB_T) :: prob real :: x(5) x = 0 orig_calfun => prob % calfun2 call orig_calfun(x) if (any(x /= 1.0)) error stop call construct(prob) end programlfortran-0.63.0/integration_tests/arrays_06_size.f900000664000175000017500000000057515174404631022554 0ustar alastairalastairprogram arrays_06_size integer :: x = 2 call temp(x) contains subroutine temp(x) integer, intent(inout) :: x integer :: keep(x) keep = [1,2] print *, keep if (keep(1) /= 1) error stop if (keep(2) /= 2) error stop x = 1 print *, keep if (keep(1) /= 1) error stop if (keep(2) /= 2) error stop end subroutine end programlfortran-0.63.0/integration_tests/global_allocatable_01.f900000664000175000017500000000054015174404631023767 0ustar alastairalastairmodule mod_test_allocatable_01 implicit none integer, allocatable, dimension(:) :: f end module mod_test_allocatable_01 program mm use mod_test_allocatable_01 implicit none logical :: ret allocate(f(4)) f = [1, 2, 3, 4] print *,f ret = all( f == [1,2,3,4]) if(ret .eqv. .false.) error stop end program mm lfortran-0.63.0/integration_tests/openmp_10.f900000664000175000017500000000126315174404631021505 0ustar alastairalastairsubroutine increment_ctr(n, ctr) use omp_lib implicit none integer, intent(in) :: n double precision, intent(out) :: ctr double precision :: local_ctr integer :: i local_ctr = 0 !$omp parallel private(i) reduction(+:local_ctr) !$omp do do i = 1, n local_ctr = local_ctr + 1.5 end do !$omp end do !$omp end parallel ctr = ctr + local_ctr end subroutine program openmp_06 use omp_lib integer, parameter :: n = 1000000 double precision :: ctr call omp_set_num_threads(8) ctr = 0 call increment_ctr(n, ctr) print *, ctr if(abs(ctr - 1.5e6) > 0.0002 ) error stop end programlfortran-0.63.0/integration_tests/intrinsics_55.f900000664000175000017500000000065515174404631022411 0ustar alastairalastairdouble precision function hinit853() result(h) double precision :: h1, hmax h = 0.1d0 h1 = 0.1d0 hmax = 1.d0 h = min(100*abs(h), h1, hmax) end function program intrinsics_55 double precision :: h interface double precision function hinit853() end function hinit853 end interface h = hinit853() if (abs(h-0.10000000000000001) > 1e-8) error stop print *, h end program lfortran-0.63.0/integration_tests/real_dp_param.f900000664000175000017500000000030215174404631022466 0ustar alastairalastairprogram real_dp_param integer, parameter :: prec1 = 4, prec2 = 8 real(prec1) :: u = 1.05 real(prec2) :: v = 1.05 real(prec2) :: zero = 0.0_4 print *, u, v, zero end programlfortran-0.63.0/integration_tests/submodule_20b.f900000664000175000017500000000033515174404631022350 0ustar alastairalastairmodule submodule_20b_mod implicit none type :: t contains procedure :: foo end type interface module subroutine foo(self) class(t), intent(in) :: self end subroutine end interface end module lfortran-0.63.0/integration_tests/gpu_metal_107.f900000664000175000017500000000110415174404631022245 0ustar alastairalastair! Test: sum() with array expression argument inside do concurrent. ! Previously generated invalid Metal shader: (a + b)[idx] treated as pointer ! arithmetic instead of element-wise array addition. program gpu_metal_107 implicit none integer :: i real :: a(3), b(3), c(3) a = [1.0, 2.0, 3.0] b = [4.0, 5.0, 6.0] do concurrent (i = 1:3) c(i) = sum(a + b) end do ! a + b = [5.0, 7.0, 9.0], sum = 21.0 if (abs(c(1) - 21.0) > 1e-5) error stop if (abs(c(2) - 21.0) > 1e-5) error stop if (abs(c(3) - 21.0) > 1e-5) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/string_42.f900000664000175000017500000000045615174404631021525 0ustar alastairalastairprogram string_42 implicit none character(len=2), allocatable :: line character(len=2) :: c allocate(character(len=2) :: line) line = "ab" read(line, *) c ! Test reading from allocatable string. print *, c if(c /= "ab") error stop end program string_42lfortran-0.63.0/integration_tests/openmp_45.f900000664000175000017500000000116515174404631021516 0ustar alastairalastairmodule openmp_45_parallel_sections implicit none contains subroutine compute_a() print *, "Computing A" end subroutine compute_a subroutine compute_b() print *, "Computing B" end subroutine compute_b subroutine compute_c() print *, "Computing C" end subroutine compute_c end module openmp_45_parallel_sections program openmp_45 use omp_lib use openmp_45_parallel_sections implicit none integer :: tid=0 !$omp parallel sections !$omp section call compute_a() !$omp section call compute_b() !$omp section call compute_c() !$omp end parallel sections end program openmp_45lfortran-0.63.0/integration_tests/derived_types_134_module.f900000664000175000017500000000171715174404631024515 0ustar alastairalastairmodule derived_types_134_module implicit none type :: inner_t integer :: x = 0 contains procedure :: reset => inner_reset end type inner_t type :: ctx_t integer :: val = 0 type(inner_t) :: sub contains procedure :: shutdown => ctx_shutdown end type ctx_t type(ctx_t), pointer :: default_ctx => null() contains subroutine inner_reset(self) class(inner_t), intent(inout) :: self self%x = 0 end subroutine inner_reset subroutine ctx_shutdown(self) class(ctx_t), intent(inout) :: self call self%sub%reset() self%val = 0 end subroutine ctx_shutdown function get_default() result(ctx) type(ctx_t), pointer :: ctx ctx => default_ctx end function get_default subroutine set_default(ctx) type(ctx_t), pointer, intent(in) :: ctx default_ctx => ctx end subroutine set_default function create_ctx() result(ctx) type(ctx_t), pointer :: ctx allocate(ctx) end function create_ctx end module derived_types_134_module lfortran-0.63.0/integration_tests/class_31.f900000664000175000017500000000147515174404631021324 0ustar alastairalastairmodule class_31_test_module type :: Composed integer :: x end type Composed type :: Wrapper class(Composed), allocatable :: obj end type Wrapper contains function init(obj) result(self) type(Wrapper) :: self class(Composed), intent(in) :: obj ! needed because lfortran does not automatically allocate this allocate(self%obj) self%obj = obj end function init end module class_31_test_module program class_31 use class_31_test_module implicit none class(Composed), allocatable :: c type(Wrapper) :: t allocate(c) c%x = 42 t = init(c) print *, "value of t%obj%x: ", t%obj%x if (t%obj%x /= 42) error stop c%x = 3 ! verify deep copy print *, "value of t%obj%x: ", t%obj%x if (t%obj%x == 3) error stop end program class_31lfortran-0.63.0/integration_tests/implicit_interface_24.f900000664000175000017500000000274015174404631024047 0ustar alastairalastair! Test that call argument alloca reuse works correctly ! This test verifies that expression arguments to implicit interface calls ! are handled correctly when allocas are reused across multiple calls program implicit_interface_24 implicit none integer :: result, x, y x = 10 y = 20 result = 0 ! Test 1: Multiple calls with expression arguments of same type ! The allocas for x+1, x+2, x+3 should be reused call ext_sub1(x + 1, result) if (result /= 11) error stop "Test 1a failed" call ext_sub1(x + 2, result) if (result /= 12) error stop "Test 1b failed" call ext_sub1(x + 3, result) if (result /= 13) error stop "Test 1c failed" ! Test 2: Call with multiple expression arguments ! Should use separate allocas within the same call, but reuse across calls call ext_sub2(x + 1, y + 1, result) if (result /= 32) error stop "Test 2a failed" call ext_sub2(x + 2, y + 2, result) if (result /= 34) error stop "Test 2b failed" ! Test 3: Mix of variable and expression arguments call ext_sub2(x, y + 5, result) if (result /= 35) error stop "Test 3a failed" call ext_sub2(x + 5, y, result) if (result /= 35) error stop "Test 3b failed" print *, "All tests passed" end program subroutine ext_sub1(a, r) integer, intent(in) :: a integer, intent(out) :: r r = a end subroutine subroutine ext_sub2(a, b, r) integer, intent(in) :: a, b integer, intent(out) :: r r = a + b end subroutine lfortran-0.63.0/integration_tests/int_02.f900000664000175000017500000000027215174404631021001 0ustar alastairalastairprogram intrinsics_15 real, parameter :: x1 = 3.3 integer, parameter :: x2 = 7 integer, parameter :: y1 = int(x1) integer, parameter :: y2 = int(x2) print*, y1, y2 end program lfortran-0.63.0/integration_tests/class_allocate_05.f900000664000175000017500000000154015174404631023162 0ustar alastairalastairprogram class_allocate_05 ! Test: assigning class(*) allocatable component to class(*) allocatable ! variable (polymorphic sourced allocation via intrinsic assignment). implicit none type :: box class(*), allocatable :: value end type type(box) :: x class(*), allocatable :: val x%value = 42 val = x%value select type (val) type is (integer) if (val /= 42) error stop class default error stop end select x%value = 3.14 val = x%value select type (val) type is (real) if (abs(val - 3.14) > 1.0e-5) error stop class default error stop end select x%value = .true. val = x%value select type (val) type is (logical) if (.not. val) error stop class default error stop end select print *, "PASS" end program lfortran-0.63.0/integration_tests/dlaswap.f900000664000175000017500000000450315174404631021342 0ustar alastairalastairsubroutine dlaswp(n, a, lda, k1, k2, ipiv, incx) INTEGER INCX, K1, K2, LDA, N INTEGER IPIV( * ) DOUBLE PRECISION A( LDA, * ) INTEGER I, I1, I2, INC, IP, IX, IX0, J, K, N32 DOUBLE PRECISION TEMP IF( incx > 0 ) THEN ix0 = k1 i1 = k1 i2 = k2 inc = 1 ELSE IF( incx < 0 ) THEN ix0 = k1 + ( k1-k2 )*incx i1 = k2 i2 = k1 inc = -1 ELSE RETURN END IF n32 = ( n / 32 )*32 IF( n32 /= 0 ) THEN DO 30 j = 1, n32, 32 ix = ix0 DO 20 i = i1, i2, inc ip = ipiv( ix ) IF( ip /= i ) THEN DO 10 k = j, j + 31 temp = a( i, k ) a( i, k ) = a( ip, k ) a( ip, k ) = temp 10 CONTINUE END IF ix = ix + incx 20 CONTINUE 30 CONTINUE END IF IF( n32 /= n ) THEN n32 = n32 + 1 ix = ix0 DO 50 i = i1, i2, inc ip = ipiv( ix ) IF( ip /= i ) THEN DO 40 k = n32, n temp = a( i, k ) a( i, k ) = a( ip, k ) a( ip, k ) = temp 40 CONTINUE END IF ix = ix + incx 50 CONTINUE END IF RETURN end subroutine PROGRAM test_dlaswp INTEGER :: n, lda, k1, k2, incx, i INTEGER, ALLOCATABLE :: ipiv(:) DOUBLE PRECISION, ALLOCATABLE :: a(:,:) ! Define the input values n = 4 lda = 4 k1 = 1 k2 = 4 incx = 1 ! Allocate the arrays ALLOCATE(ipiv(n)) ALLOCATE(a(lda, n)) ! Initialize the matrix 'a' in column-major order a = RESHAPE([ 1.0D0, 2.0D0, 3.0D0, 4.0D0, & 5.0D0, 6.0D0, 7.0D0, 8.0D0, & 9.0D0, 10.0D0, 11.0D0, 12.0D0, & 13.0D0, 14.0D0, 15.0D0, 16.0D0 ], [ lda, n ]) ! Initialize the pivot array ipiv = [4, 1, 2, 3] ! Print the original matrix PRINT *, "Original matrix A:" DO i = 1, lda PRINT *, a(i, :) END DO ! Call the subroutine CALL dlaswp(n, a, lda, k1, k2, ipiv, incx) ! Print the modified matrix PRINT *, "Modified matrix A:" DO i = 1, lda PRINT *, a(i, :) END DO END PROGRAM test_dlaswp lfortran-0.63.0/integration_tests/abs_05.f900000664000175000017500000000060415174404631020756 0ustar alastairalastairprogram abs_05 implicit none real, parameter :: a(2,2) = reshape([1.0, 2.0, 3.0, 4.0], [2,2]) real :: b(2,2), c(2,2) b = 1.0 c = b + abs(a) print *, c(1,1), c(2,1), c(1,2), c(2,2) if (nint(c(1,1)) /= 2) error stop if (nint(c(2,1)) /= 3) error stop if (nint(c(1,2)) /= 4) error stop if (nint(c(2,2)) /= 5) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/class_116.f900000664000175000017500000000100115174404631021371 0ustar alastairalastair! Test class(*) to class(*) assignment (allocatable to allocatable) program class_116 implicit none class(*), allocatable :: a, b a = 42 b = a select type(b) type is (integer) print *, b if (b /= 42) error stop class default error stop end select a = 3.14 b = a select type(b) type is (real(4)) if (abs(b - 3.14) > 1.0e-5) error stop class default error stop end select print *, "PASS" end program class_116 lfortran-0.63.0/integration_tests/class_37.f900000664000175000017500000000117315174404631021325 0ustar alastairalastairmodule stdlib_hashmap_wrappers_class_37 implicit none type :: other_type class(*), allocatable :: value end type other_type end module stdlib_hashmap_wrappers_class_37 program class_37 use stdlib_hashmap_wrappers_class_37 implicit none type(other_type) :: other integer :: val = 1 call get_other_open_data( other, val ) print *, val if (val /= 2) error stop contains subroutine get_other_open_data( other, val ) type(other_type), intent(out) :: other integer,intent(inout) :: val val = 2 end subroutine get_other_open_data end programlfortran-0.63.0/integration_tests/modules_66.f900000664000175000017500000000047015174404631021671 0ustar alastairalastairprogram modules_66 use modules_66_base, only: container_t use modules_66_worker, only: extract_int implicit none type(container_t) :: c integer :: r allocate(c%item, source=42) r = extract_int(c) if (r /= 42) error stop print *, "PASSED: modules_66" end program modules_66 lfortran-0.63.0/integration_tests/associate_21_mod.f900000664000175000017500000000142615174404631023024 0ustar alastairalastairmodule associate_21_mod_a implicit none type :: dependency_t character(len=:), allocatable :: name integer :: key end type dependency_t end module associate_21_mod_a module associate_21_mod_b use associate_21_mod_a implicit none type :: model_t type(dependency_t), allocatable :: dependency(:) contains procedure :: update_dependency end type model_t contains subroutine update_dependency(self, ii, key) class(model_t), intent(inout) :: self integer, intent(in) :: ii integer, intent(in) :: key associate (dep => self%dependency(ii)) dep%name = "LFortran" dep%key = key end associate end subroutine update_dependency end module associate_21_mod_blfortran-0.63.0/integration_tests/intrinsics_345.f900000664000175000017500000000436515174404631022475 0ustar alastairalastairprogram intrinsics_345 implicit none integer, dimension(2, 3) :: array1 = reshape([1, 1, 0, 1, 5, 1], [2, 3]) integer, dimension(2, 3) :: array2 = reshape([2, 1, 0, 1, 5, 1], [2, 3]) integer, dimension(2, 3) :: array3 = reshape([2, 2, 0, 1, 5, 1], [2, 3]) integer, dimension(2, 3) :: array4 = reshape([1, 1, 1, 1, 1, 1], [2, 3]) integer, dimension(2, 3) :: array5 = reshape([2, 2, 1, 0, 1, 0], [2, 3]) integer, dimension(2, 3) :: array6 = reshape([0, 1, 1, 1, 1, 2], [2, 3]) integer :: value = 1 if (any(findloc(array1, value, dim=1) /= [1, 2, 2])) error stop if (any(findloc(array1, value, dim=1, back=.true.) /= [2, 2, 2])) error stop if (any(findloc(array1, value, dim=2) /= [1, 1])) error stop if (any(findloc(array1, value, dim=2, back=.true.) /= [1, 3])) error stop if (any(findloc(array2, value, dim=1) /= [2, 2, 2])) error stop if (any(findloc(array2, value, dim=1, back=.true.) /= [2, 2, 2])) error stop if (any(findloc(array2, value, dim=2) /= [0, 1])) error stop if (any(findloc(array2, value, dim=2, back=.true.) /= [0, 3])) error stop if (any(findloc(array3, value, dim=1) /= [0, 2, 2])) error stop if (any(findloc(array3, value, dim=1, back=.true.) /= [0, 2, 2])) error stop if (any(findloc(array3, value, dim=2) /= [0, 2])) error stop if (any(findloc(array3, value, dim=2, back=.true.) /= [0, 3])) error stop if (any(findloc(array4, value, dim=1) /= [1, 1, 1])) error stop if (any(findloc(array4, value, dim=1, back=.true.) /= [2, 2, 2])) error stop if (any(findloc(array4, value, dim=2) /= [1, 1])) error stop if (any(findloc(array4, value, dim=2, back=.true.) /= [3, 3])) error stop if (any(findloc(array5, value, dim=1) /= [0, 1, 1])) error stop if (any(findloc(array5, value, dim=1, back=.true.) /= [0, 1, 1])) error stop if (any(findloc(array5, value, dim=2) /= [2, 0])) error stop if (any(findloc(array5, value, dim=2, back=.true.) /= [3, 0])) error stop if (any(findloc(array6, value, dim=1) /= [2, 1, 1])) error stop if (any(findloc(array6, value, dim=1, back=.true.) /= [2, 2, 1])) error stop if (any(findloc(array6, value, dim=2) /= [2, 1])) error stop if (any(findloc(array6, value, dim=2, back=.true.) /= [3, 2])) error stop end program lfortran-0.63.0/integration_tests/abs_01.f900000664000175000017500000000022015174404631020744 0ustar alastairalastairprogram abs_01 implicit none real :: x x = abs(1.5) print *, x if (x < 0) error stop x = abs(-1.5) print *, x if (x < 0) error stop end program lfortran-0.63.0/integration_tests/allocatable_polymorphic_mold_01.f900000664000175000017500000000250215174404631026107 0ustar alastairalastairmodule m_types implicit none type, abstract :: base_t contains procedure(load_i), deferred :: load end type base_t abstract interface subroutine load_i(self) import :: base_t class(base_t), intent(inout) :: self end subroutine load_i end interface type :: srcfile_t character(:), allocatable :: file_name end type srcfile_t type, extends(base_t) :: package_t type(srcfile_t), allocatable :: sources(:) contains procedure :: load => package_load end type package_t contains subroutine package_load(self) class(package_t), intent(inout) :: self if (allocated(self%sources)) deallocate(self%sources) allocate(self%sources(1)) self%sources(1)%file_name = 'file1.f90' end subroutine package_load end module m_types program allocatable_polymorphic_mold_01 use m_types implicit none type(package_t) :: pkg class(base_t), allocatable :: copy allocate(pkg%sources(1)) pkg%sources(1)%file_name = 'init' allocate(copy, mold=pkg) call copy%load() select type (copy) type is (package_t) if (.not. allocated(copy%sources)) error stop if (.not. allocated(copy%sources(1)%file_name)) error stop if (copy%sources(1)%file_name /= 'file1.f90') error stop class default error stop end select end program allocatable_polymorphic_mold_01 lfortran-0.63.0/integration_tests/procedure_29.f900000664000175000017500000000150115174404631022204 0ustar alastairalastairmodule procedure_29_iface_m implicit none abstract interface pure function initializer_i(x) result(f) double precision, intent(in) :: x(:) double precision, allocatable :: f(:) end function end interface end module module procedure_29_functions_m implicit none contains pure function f(x) double precision, intent(in) :: x(:) double precision, allocatable :: f(:) f = x + 1 end function end module program procedure_29 use procedure_29_iface_m, only: initializer_i use procedure_29_functions_m, only: f implicit none procedure(initializer_i), pointer :: my_ptr => f double precision :: res(3) res = my_ptr([1d0, 2d0, 3d0]) if (abs(res(1) - 2d0) > 1d-12) error stop if (abs(res(2) - 3d0) > 1d-12) error stop if (abs(res(3) - 4d0) > 1d-12) error stop end program lfortran-0.63.0/integration_tests/write_23.f900000664000175000017500000000111415174404631021340 0ustar alastairalastairprogram write_23 implicit none integer :: u, x ! Test write(u, pos=N) for unformatted stream I/O open(newunit=u, file='write_23.bin', access='stream', & form='unformatted', status='replace', action='readwrite') ! Write at pos=1, then at pos=101, then overwrite at pos=1 write(u, pos=1) 42 write(u, pos=101) 99 write(u, pos=1) 7 ! Read back and verify the overwrite at pos=1 read(u, pos=1) x if (x /= 7) error stop ! Verify pos=101 is still intact read(u, pos=101) x if (x /= 99) error stop close(u, status='delete') print *, 'PASS' end program lfortran-0.63.0/integration_tests/arrays_37.f900000664000175000017500000000065115174404631021521 0ustar alastairalastairprogram arrays_37 use iso_fortran_env, only: dp => real64 real(dp), allocatable :: result(:) real(dp) :: start_, end_, step_ integer :: i allocate(result(10)) start_ = 1.0_dp end_ = 10.0_dp step_ = 1.0_dp result = [(start_ + (i - 1)*step_, i=1, size(result), 1)] print *, result i = 1 do while (i <= size(result)) if (abs(result(i) - (start_ + (i - 1)*step_)) > 1.0e-15_dp) error stop i = i + 1 end do end program lfortran-0.63.0/integration_tests/submodule_34a.f900000664000175000017500000000026315174404631022354 0ustar alastairalastairprogram submodule_34 use submodule_34_parent_mod implicit none integer :: x call test_sub(x) if (x /= 5) error stop print *, "ok" end program submodule_34 lfortran-0.63.0/integration_tests/separate_compilation_27a.f900000664000175000017500000000125515174404631024563 0ustar alastairalastairmodule kinds_separate_compilation_27 use iso_fortran_env, only: int8, int16, int32, int64 end module kinds_separate_compilation_27 module error_separate_compilation_27 implicit none interface module subroutine error_sub(code) integer, intent(inout) :: code end subroutine error_sub end interface end module error_separate_compilation_27 module io_separate_compilation_27 use kinds_separate_compilation_27, only: int8, int16, int32, int64 use error_separate_compilation_27, only: error_sub implicit none contains subroutine open(i) integer, intent(inout) :: i call error_sub(i) end subroutine open end module io_separate_compilation_27lfortran-0.63.0/integration_tests/legacy_array_sections_22.f900000664000175000017500000000077115174404631024566 0ustar alastairalastairmodule legacy_array_sections_22_mod implicit none contains subroutine foo(n, x) integer, intent(in) :: n double precision, intent(in) :: x(n) if (n >= 1) then if (abs(x(1) - 2.0d0) > 1.0d-12) error stop end if if (n >= 2) then if (abs(x(2) - 3.0d0) > 1.0d-12) error stop end if end subroutine end module program legacy_array_sections_22 use legacy_array_sections_22_mod double precision :: w(10) integer :: i do i = 1, 10 w(i) = dble(i) end do call foo(3, w(2)) print *, "PASSED" end program lfortran-0.63.0/integration_tests/format_40.f900000664000175000017500000000052215174404631021477 0ustar alastairalastairprogram testes0 implicit none write(*,"(ES0.0)") 3.14159 write(*,"(ES0.0)") 0.0 write(*,"(ES0.0)") 10.0 write(*,"(ES0.0)") 3.14E+03 write(*,"(ES0.0)") 30.14159 write(*,"(ES0.0)") 391.14 write(*,"(ES0.0)") 3.14E+04 write(*,"(ES0.0)") -5.0 write(*,"(ES0.0)") 1.23456E-5 write(*,"(ES0.0)") 9.99E+10 end program testes0 lfortran-0.63.0/integration_tests/separate_compilation_16b.f900000664000175000017500000000046515174404631024564 0ustar alastairalastairsubmodule(mod_separate_compilation_16) submod_separate_compilation_16 implicit none contains module subroutine map_open_entry(key) integer, intent(inout) :: key integer, parameter :: i = 1 key = i end subroutine map_open_entry end submodule submod_separate_compilation_16lfortran-0.63.0/integration_tests/elemental_06.f900000664000175000017500000000074615174404631022167 0ustar alastairalastairprogram elemental_06 integer, parameter :: n = 10 integer :: i type :: vector integer :: elements(0:n-1) end type type(vector) :: a, b, c do i = 0, n-1 a%elements(i) = i b%elements(i) = i end do c%elements = add_vector(a%elements, b%elements) print *, c%elements do i = 0, n-1 if (c%elements(i) /= 2*i) error stop end do contains elemental function add_vector(a, b) result(c) integer, intent(in) :: a, b integer :: c c = a + b end function end program lfortran-0.63.0/integration_tests/string_70.f900000664000175000017500000000045015174404631021520 0ustar alastairalastair! Refer to ./doc/src/string_allocation.md program string_70 implicit none character(:), allocatable :: STR allocate(character(0) :: STR) if(.not. allocated(STR)) error stop if(len(STR) /= 0) error stop deallocate(STR) if(allocated(STR)) error stop end programlfortran-0.63.0/integration_tests/associate_04.f900000664000175000017500000000074315174404631022167 0ustar alastairalastair! Reference - https://www.ibm.com/docs/en/xffbg/121.141?topic=control-associate-construct-fortran-2003 program associate_04 real :: myreal, x, y, theta, a x = 0.42 y = 0.35 myreal = 9.1 theta = 1.5 a = 0.4 associate ( z => -(x*2 + y*2) * cos(theta), v => myreal) print *, a + z, a - z, v v = v * 4.6 end associate print *, myreal if ((myreal - 41.86) > 1e-5 .or. myreal - 41.86 < -1e-5) error stop end program associate_04lfortran-0.63.0/integration_tests/arrays_08_size.f900000664000175000017500000000130715174404631022550 0ustar alastairalastairprogram arrays_08_size integer :: y = 2 call temp(y) contains subroutine temp(x) integer, intent(inout) :: x logical :: keep(x) integer :: result(x) keep = [.true., .true.] x = 1 result = trueloc(keep) print * , result if (any(result /= [1, 2])) error stop end subroutine function trueloc(x) result(loc) logical, intent(in) :: x(:) integer(4), allocatable :: loc(:) integer :: i, j allocate(loc(count(x))) j = 1 do i = 1, size(x) if( x(i) ) then loc(j) = i j = j + 1 end if end do end function trueloc end program lfortran-0.63.0/integration_tests/associate_18.f900000664000175000017500000000015015174404631022164 0ustar alastairalastairprogram associate_18 use associate_18_module_2, only: extract_datetime implicit none end programlfortran-0.63.0/integration_tests/arrays_04_func_pass_arr_dims.f900000664000175000017500000000105015174404631025426 0ustar alastairalastairprogram arrays_04_func implicit none real :: a(3), b a(1) = 3 a(2) = 2 a(3) = 1 b = sum(size(a, dim=1), a) print *, b if (abs(b-6) > 1e-5) error stop contains real function sum(na1, a) result(r) integer, intent(in) :: na1 real, intent(in) :: a(na1) integer :: i print *, "sum" r = 0 do i = 1, size(a) r = r + a(i) end do end function real function abs(a) result(r) real, intent(in) :: a print *, "abs" if (a > 0) then r = a else r = -a end if end function end lfortran-0.63.0/integration_tests/file_36.f900000664000175000017500000000054015174404631021133 0ustar alastairalastairprogram file_36 implicit none integer :: unit_num character(len=100) :: result open(file="file_36_test.txt", newunit=unit_num, delim="quote") write(unit_num,*) "hello world" rewind(unit_num) read(unit_num,*) result close(unit_num) print *, result if (result /= "hello world") error stop end program file_36 lfortran-0.63.0/integration_tests/allocatable_lhs_finalization_01.f900000664000175000017500000000143215174404631026065 0ustar alastairalastair! Finalize an allocated allocatable LHS before intrinsic assignment ! (Fortran 2018, 7.5.6.3, paragraph 1). module allocatable_lhs_finalization_01_m implicit none integer :: finalizations = 0 type :: t integer :: dummy = 0 contains final :: finalize_t end type contains subroutine finalize_t(self) type(t), intent(inout) :: self self%dummy = 0 finalizations = finalizations + 1 end subroutine end module program allocatable_lhs_finalization_01 use allocatable_lhs_finalization_01_m implicit none type(t), allocatable :: lhs type(t) :: rhs integer :: count_before allocate(lhs) count_before = finalizations lhs = rhs ! Should finalize old lhs before assignment (7.5.6.3 para 1) if (finalizations - count_before /= 1) error stop end program lfortran-0.63.0/integration_tests/dict_test_02_.f900000664000175000017500000000254015174404631022330 0ustar alastairalastairmodule dict_test_02_mod implicit none real :: eps = 1e-5 contains subroutine test_dict() _lfortran_dict(integer, real) :: rollnumber2cpi integer :: i integer :: size, size1 size = 7000 size1 = size/7 + 1 rollnumber2cpi = _lfortran_dict_constant(0, 1.1) do i=1000, 1000 + size - 1, 7 call _lfortran_set_item(rollnumber2cpi, i, real(i)/100.0 + 5.0) end do do i=1000, 1000 + size/2 - 1, 7 if ( abs(_lfortran_pop(rollnumber2cpi, i) - real(i)/100.0 - 5.0) > eps ) error stop size1 = size1 - 1 if ( _lfortran_len(rollnumber2cpi) /= size1 ) error stop end do do i=1000, 1000 + size/2 - 1, 7 call _lfortran_set_item(rollnumber2cpi, i, -real(i)/100.0 - 5.0) end do do i=1000, 1000 + size/2 - 1, 7 if ( abs(_lfortran_get_item(rollnumber2cpi, i) + real(i)/100.0 + 5.0) > eps ) error stop end do do i=1000, 1000 + size - 1, 7 call _lfortran_set_item(rollnumber2cpi, i, -real(i)/100.0 - 5.0) end do do i=1000, 1000 + size - 1, 7 if ( abs(_lfortran_get_item(rollnumber2cpi, i) + real(i)/100.0 + 5.0) > eps ) error stop end do end subroutine subroutine tests() call test_dict() end subroutine end module program run_tuples use dict_test_02_mod call tests() end program lfortran-0.63.0/integration_tests/select_rank_03.f900000664000175000017500000000113615174404631022502 0ustar alastairalastairprogram select_rank_03 implicit none integer :: a(2) = [4, 2] integer :: b(2, 2) = reshape([1, 2, 3, 4], [2, 2]) call check(a) call check(b) contains subroutine check(x) integer, intent(in) :: x(..) integer :: l1(1) integer :: l2(2) select rank(x) rank (1) l1 = minloc(x) print *, l1 if (l1(1) /= 2) error stop rank (2) l2 = minloc(x) print *, l2 if (any(l2 /= [1, 1])) error stop end select end subroutine check end program select_rank_03 lfortran-0.63.0/integration_tests/bits_02.f900000664000175000017500000000060215174404631021145 0ustar alastairalastairprogram bits_02 use iso_fortran_env, only: block_kind => int64, bits_kind => int32 implicit none integer(bits_kind), parameter :: block_size = bit_size(0_block_kind) integer(block_kind), parameter :: all_zeros = 0_block_kind integer(block_kind), parameter :: all_ones = not(all_zeros) print *, block_size print *, all_zeros print *, all_ones end program lfortran-0.63.0/integration_tests/procedure_pointer_18.f900000664000175000017500000000044115174404631023744 0ustar alastairalastairsubroutine add_ten(n) integer, intent(inout) :: n n = n + 10 end subroutine program procedure_pointer_18 pointer :: sp external :: sp, add_ten integer :: val val = 5 sp => add_ten call sp(val) if (val /= 15) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/gpu_metal_151.f900000664000175000017500000000132315174404631022247 0ustar alastairalastairprogram gpu_metal_151 ! Test: gpu_offload pass loads transitive module dependencies when ! a submodule uses a module that itself uses another module. ! Previously, load_submodule_deps only loaded direct dependencies ! of the submodule TU, leaving ExternalSymbol entries with null ! m_external in indirectly loaded modules. use gpu_metal_151_network_m, only : network_t implicit none type(network_t) :: net real :: x(4), y(4) integer :: i x = [1.0, 2.0, 3.0, 4.0] do concurrent(i=1:4) y(i) = net%infer(x(i)) end do print *, y if (abs(y(1) - 1.0) > 1e-6) error stop if (abs(y(2) - 2.0) > 1e-6) error stop if (abs(y(3) - 3.0) > 1e-6) error stop if (abs(y(4) - 4.0) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/while_01.f900000664000175000017500000000060615174404631021317 0ustar alastairalastairprogram while_01 implicit none integer :: i, j i = 1 j = 0 do while (i < 11) j = j + i i = i + 1 end do if (j /= 55) error stop if (i /= 11) error stop i = 1 j = 0 do while (i <= 10) j = j + i i = i + 1 end do if (j /= 55) error stop if (i /= 11) error stop i = 1 j = 0 do while (i < 1) j = j + i i = i + 1 end do if (j /= 0) error stop if (i /= 1) error stop end lfortran-0.63.0/integration_tests/elemental_02.f900000664000175000017500000000060615174404631022156 0ustar alastairalastairprogram elemental_02 real :: x(2) = [1, 2], y(2) = [1.0, 2.1] logical :: close(2) close = is_close(x, y) print *, close if (.not. close(1)) error stop if (close(2)) error stop contains elemental logical function is_close(a, b, rel_tol) result(close) real, intent(in) :: a, b real, intent(in), optional :: rel_tol close = abs(a - b) <= 1e-9 end function is_close end program elemental_02 lfortran-0.63.0/integration_tests/arithmetic_if_02.f900000664000175000017500000000145115174404631023016 0ustar alastairalastairprogram arithmetic_if_02 real :: x integer :: c ! Singleline x = -3 c = 0 if (x) 1, 2, 3 1 c = c + 1 2 c = c + 2 3 c = c + 4 print *, c if (c /= 7) error stop x = 0 c = 0 if (x) 4, 5, 6 4 c = c + 1 5 c = c + 2 6 c = c + 4 print *, c if (c /= 6) error stop x = 7 c = 0 if (x) 7, 8, 9 7 c = c + 1 8 c = c + 2 9 c = c + 4 print *, c if (c /= 4) error stop ! Multiline x = -3 c = 0 if (x) 11, 12, 13 11 c = c + 1 c = c + 100 12 c = c + 2 c = c + 200 13 c = c + 4 c = c + 400 print *, c if (c /= 707) error stop x = 0 c = 0 if (x) 14, 15, 16 14 c = c + 1 c = c + 100 15 c = c + 2 c = c + 200 16 c = c + 4 c = c + 400 print *, c if (c /= 606) error stop x = 7 c = 0 if (x) 17, 18, 19 17 c = c + 1 c = c + 100 18 c = c + 2 c = c + 200 19 c = c + 4 c = c + 400 print *, c if (c /= 404) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_45.f900000664000175000017500000000105515174404631022173 0ustar alastairalastairprogram gpu_metal_45 implicit none integer :: x(5), y(4), i x = 0 y = 0 do concurrent (i = 1:5) block block x(i) = i * 3 end block end block end do if (x(1) /= 3) error stop if (x(2) /= 6) error stop if (x(3) /= 9) error stop if (x(4) /= 12) error stop if (x(5) /= 15) error stop do concurrent (i = 1:4) block block block y(i) = i + 10 end block end block end block end do if (y(1) /= 11) error stop if (y(2) /= 12) error stop if (y(3) /= 13) error stop if (y(4) /= 14) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/string_101.f900000664000175000017500000000055115174404631021575 0ustar alastairalastairprogram string_101 use iso_c_binding, only: c_int, c_ptr, c_f_pointer implicit none integer(c_int), pointer :: n integer(c_int), target :: val val = 5 n => val block character(len=n) :: s s = "hello" if (len(s) /= 5) error stop if (s /= "hello") error stop end block print *, "ok" end program lfortran-0.63.0/integration_tests/functions_34.f900000664000175000017500000000147015174404631022225 0ustar alastairalastairmodule functions_34_mod_1 abstract interface subroutine OBJ() end subroutine end interface procedure(OBJ), pointer :: f_ptr contains subroutine caller_f_ptr() implicit none call f_ptr() end subroutine end module module functions_34_mod_2 contains subroutine set_ptr_and_call() use functions_34_mod_1, only : f_ptr, caller_f_ptr f_ptr => fff call caller_f_ptr() end subroutine subroutine fff() print *, "hi" end subroutine subroutine fff2() print *, "bye" end subroutine end module functions_34_mod_2 program functions_34 use functions_34_mod_2 use functions_34_mod_1 ,only: f_ptr call set_ptr_and_call() f_ptr => fff2 call f_ptr() end program functions_34lfortran-0.63.0/integration_tests/read_45.f900000664000175000017500000000067015174404631021133 0ustar alastairalastairprogram read_45 type :: inner_t integer :: a integer :: b end type inner_t type :: outer_t integer :: id type(inner_t) :: inner end type outer_t type(outer_t) :: x character(len=12) :: s s = "001002003" read(s, "(I3,I3,I3)") x if (x%id /= 1) error stop 1 if (x%inner%a /= 2) error stop 2 if (x%inner%b /= 3) error stop 3 end program read_45lfortran-0.63.0/integration_tests/procedure_10.f900000664000175000017500000000063315174404631022177 0ustar alastairalastairmodule procedure_10_mod contains subroutine sub_type(int) integer,intent(in) :: int end subroutine subroutine sub(int) integer,intent(in) :: int print *, int if (int /= 6) error stop end subroutine sub end module procedure_10_mod program procedure_10 use procedure_10_mod procedure(sub_type), pointer :: p_sub p_sub => sub call p_sub(6) end program procedure_10lfortran-0.63.0/integration_tests/test_ieee_rem.f900000664000175000017500000000562015174404631022521 0ustar alastairalastair! Test ieee_rem function (IEEE remainder operation) program ieee_rem_01 use, intrinsic :: ieee_arithmetic, only: ieee_rem implicit none real(4) :: x_sp, y_sp, rem_sp real(8) :: x_dp, y_dp, rem_dp print *, "Testing ieee_rem..." ! Test 1: Basic remainder x_sp = 5.0 y_sp = 3.0 rem_sp = ieee_rem(x_sp, y_sp) print *, "ieee_rem(5.0, 3.0) =", rem_sp ! 5.0 = 2 * 3.0 - 1.0, so remainder is -1.0 (rounds to nearest) if (abs(rem_sp + 1.0) > 1e-6) error stop "ieee_rem(5.0, 3.0) should be -1.0" ! Test 2: Different from modulo ! modulo(5.0, 3.0) = 2.0, but ieee_rem(5.0, 3.0) = -1.0 print *, "modulo(5.0, 3.0) =", modulo(x_sp, y_sp) print *, "ieee_rem(5.0, 3.0) =", rem_sp if (abs(modulo(x_sp, y_sp) - rem_sp) < 1e-6) then error stop "ieee_rem should differ from modulo for this case" end if ! Test 3: When x = n*y exactly, remainder is 0 x_sp = 6.0 y_sp = 3.0 rem_sp = ieee_rem(x_sp, y_sp) print *, "ieee_rem(6.0, 3.0) =", rem_sp if (abs(rem_sp) > 1e-6) error stop "ieee_rem(6.0, 3.0) should be 0" ! Test 4: Negative dividend x_sp = -5.0 y_sp = 3.0 rem_sp = ieee_rem(x_sp, y_sp) print *, "ieee_rem(-5.0, 3.0) =", rem_sp ! -5.0 = -2 * 3.0 + 1.0, so remainder is 1.0 if (abs(rem_sp - 1.0) > 1e-6) error stop "ieee_rem(-5.0, 3.0) should be 1.0" ! Test 5: Small values x_sp = 0.5 y_sp = 0.3 rem_sp = ieee_rem(x_sp, y_sp) print *, "ieee_rem(0.5, 0.3) =", rem_sp ! 0.5 = 2 * 0.3 - 0.1, so remainder is -0.1 if (abs(rem_sp + 0.1) > 1e-5) error stop "ieee_rem(0.5, 0.3) should be approximately -0.1" ! Test 6: Double precision x_dp = 7.0d0 y_dp = 4.0d0 rem_dp = ieee_rem(x_dp, y_dp) print *, "ieee_rem(7.0d0, 4.0d0) =", rem_dp ! 7.0 = 2 * 4.0 - 1.0, so remainder is -1.0 if (abs(rem_dp + 1.0d0) > 1e-10) error stop "ieee_rem(7.0, 4.0) should be -1.0" ! Test 7: Remainder is always less than or equal to |y|/2 x_sp = 10.0 y_sp = 3.0 rem_sp = ieee_rem(x_sp, y_sp) print *, "ieee_rem(10.0, 3.0) =", rem_sp if (abs(rem_sp) > abs(y_sp) / 2.0 + 1e-6) then error stop "remainder should be <= |y|/2" end if ! Test 8: Symmetry test x_sp = 8.0 y_sp = 3.0 rem_sp = ieee_rem(x_sp, y_sp) print *, "ieee_rem(8.0, 3.0) =", rem_sp ! 8.0 = 3 * 3.0 - 1.0, so remainder is -1.0 if (abs(rem_sp + 1.0) > 1e-6) error stop "ieee_rem(8.0, 3.0) should be -1.0" ! Test 9: Compare with mod for exact multiples x_sp = 12.0 y_sp = 4.0 rem_sp = ieee_rem(x_sp, y_sp) print *, "ieee_rem(12.0, 4.0) =", rem_sp if (abs(rem_sp) > 1e-6) error stop "Should be zero for exact multiples" if (abs(rem_sp - mod(x_sp, y_sp)) > 1e-6) then error stop "Should match mod for exact multiples" end if print *, "All ieee_rem tests passed!" end program ieee_rem_01 lfortran-0.63.0/integration_tests/implied_do_loops30.f900000664000175000017500000000103615174404631023371 0ustar alastairalastairprogram implied_do_loops30 implicit none integer :: a(2,2), b(4), i integer :: c(2,3), d(6) a = reshape([1, 2, 3, 4], [2,2]) b = [(a, i = 1, 1)] if (b(1) /= 1) error stop if (b(2) /= 2) error stop if (b(3) /= 3) error stop if (b(4) /= 4) error stop c = reshape([10, 20, 30, 40, 50, 60], [2,3]) d = [(c, i = 1, 1)] if (d(1) /= 10) error stop if (d(2) /= 20) error stop if (d(3) /= 30) error stop if (d(4) /= 40) error stop if (d(5) /= 50) error stop if (d(6) /= 60) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/implicit_interface_29b.f900000664000175000017500000000031415174404631024211 0ustar alastairalastairsubroutine other_subroutine(a, n, m) integer, intent(in) :: n, m real(8), intent(in) :: a(n, m) if (a(1,1) /= 1.0d0) error stop if (a(2,2) /= 5.0d0) error stop end subroutine other_subroutine lfortran-0.63.0/integration_tests/sync_all_01.f900000664000175000017500000000010515174404631022005 0ustar alastairalastairprogram sync_all_01 implicit none sync all print *, "ok" end program lfortran-0.63.0/integration_tests/pdt_14.f900000664000175000017500000000200615174404631020776 0ustar alastairalastair! Test: deepcopy of derived type containing allocatable array of PDT with TBPs module pdt_14_m implicit none type :: inner_t(k) integer, kind :: k = kind(1.) real(k) :: val = 0.0 contains procedure :: get_val end type type :: outer_t type(inner_t), allocatable :: items(:) end type contains real function get_val(self) class(inner_t), intent(in) :: self get_val = self%val end function end module program pdt_14 use pdt_14_m implicit none type(outer_t) :: a, b allocate(a%items(3)) a%items(1)%val = 1.0 a%items(2)%val = 2.0 a%items(3)%val = 3.0 b = a if (size(b%items) /= 3) error stop if (abs(b%items(1)%val - 1.0) > 1.0e-6) error stop if (abs(b%items(2)%val - 2.0) > 1.0e-6) error stop if (abs(b%items(3)%val - 3.0) > 1.0e-6) error stop if (abs(b%items(2)%get_val() - 2.0) > 1.0e-6) error stop ! Verify deep copy: modifying a should not affect b a%items(1)%val = 99.0 if (abs(b%items(1)%val - 1.0) > 1.0e-6) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/read_24.f900000664000175000017500000000041115174404631021121 0ustar alastairalastairprogram read_nan_string implicit none character(len=3) :: nan_string character(len=6) :: frmt real :: valu nan_string = 'NaN' frmt = '(f3.3)' read(nan_string, frmt) valu if (valu == valu) error stop print *, 'PASS' end program read_nan_string lfortran-0.63.0/integration_tests/class_133.f900000664000175000017500000000065215174404631021403 0ustar alastairalastair! Test shape() intrinsic on class(*) allocatable arrays. ! Verifies that shape() works correctly on unlimited polymorphic arrays. program class_133 implicit none class(*), allocatable :: x(:) integer :: s(1) allocate(integer :: x(5)) s = shape(x) if (s(1) /= 5) error stop deallocate(x) allocate(real :: x(10)) s = shape(x) if (s(1) /= 10) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/read_11.f900000664000175000017500000000163015174404631021121 0ustar alastairalastairprogram read_11 implicit none integer :: i, j, n, unit_no real :: a(3, 4) n = 4 open(newunit=unit_no, status='scratch') write(unit_no, *) 1.0, 2.0, 3.0, 4.0 write(unit_no, *) 5.0, 6.0, 7.0, 8.0 rewind(unit_no) read(unit_no, *) (a(1,j), j = 1, n) read(unit_no, *) (a(2,j), j = 1, n) close(unit_no) if (abs(a(1,1) - 1.0) > 1e-6) error stop "a(1,1) should be 1.0" if (abs(a(1,2) - 2.0) > 1e-6) error stop "a(1,2) should be 2.0" if (abs(a(1,3) - 3.0) > 1e-6) error stop "a(1,3) should be 3.0" if (abs(a(1,4) - 4.0) > 1e-6) error stop "a(1,4) should be 4.0" if (abs(a(2,1) - 5.0) > 1e-6) error stop "a(2,1) should be 5.0" if (abs(a(2,2) - 6.0) > 1e-6) error stop "a(2,2) should be 6.0" if (abs(a(2,3) - 7.0) > 1e-6) error stop "a(2,3) should be 7.0" if (abs(a(2,4) - 8.0) > 1e-6) error stop "a(2,4) should be 8.0" print *, "PASS" end program lfortran-0.63.0/integration_tests/implicit_deallocate_01.f900000664000175000017500000000034015174404631024171 0ustar alastairalastairprogram test_hybrd implicit none contains subroutine compare_solutions(x) real, dimension(:), intent(in) :: x real, dimension(:), allocatable :: temp end subroutine compare_solutions end program lfortran-0.63.0/integration_tests/implicit_interface_25.f900000664000175000017500000000370315174404631024050 0ustar alastairalastair! Test passing procedure variables through implicit interface call chains ! This verifies that Function argument type info propagates to implicit ! interface parameters, enabling correct codegen without bitcast workarounds. program implicit_interface_25 implicit none real(8) :: result, expected ! Test 1: Pass a function through an implicit interface call chain expected = 25.0d0 call test_procedure_pass(square_fn, 5.0d0, result) if (abs(result - expected) > 1.0d-10) error stop "Test 1 failed" ! Test 2: Different function, same interface expected = 8.0d0 call test_procedure_pass(double_fn, 4.0d0, result) if (abs(result - expected) > 1.0d-10) error stop "Test 2 failed" ! Test 3: Chain through two implicit interface levels expected = 49.0d0 call outer_chain(square_fn, 7.0d0, result) if (abs(result - expected) > 1.0d-10) error stop "Test 3 failed" print *, "PASSED" contains real(8) function square_fn(x) real(8), intent(in) :: x square_fn = x * x end function real(8) function double_fn(x) real(8), intent(in) :: x double_fn = x * 2.0d0 end function end program ! Subroutine with implicit interface for the procedure argument subroutine test_procedure_pass(f, x, result) implicit none real(8), intent(in) :: x real(8), intent(out) :: result real(8), external :: f result = f(x) end subroutine ! Outer chain: passes procedure through another implicit interface layer subroutine outer_chain(f, x, result) implicit none real(8), intent(in) :: x real(8), intent(out) :: result real(8), external :: f ! Call inner routine which also has implicit interface for f call inner_apply(f, x, result) end subroutine ! Inner layer of the chain subroutine inner_apply(func, val, out) implicit none real(8), intent(in) :: val real(8), intent(out) :: out real(8), external :: func out = func(val) end subroutine lfortran-0.63.0/integration_tests/functions_13.f900000664000175000017500000000166215174404631022225 0ustar alastairalastairmodule test_scan_module implicit none contains subroutine test_scan_intrinsic() if( scan("fortran", "ao") /= 2 ) error stop ! 2, found 'o' if( scan("fortran", "ao", .true.) /= 6 ) error stop ! 6, found 'a' if( scan("fortran", "c++") /= 0 ) error stop ! 0, found none end subroutine end module program test_scan_verify use test_scan_module, only: test_scan_intrinsic implicit none call test_scan_intrinsic() print *, test_verify_intrinsic() contains logical function test_verify_intrinsic() result(r) if( verify("fortran", "ao") /= 1) error stop ! 1, found 'f' if( verify("fortran", "foo") /= 3) error stop ! 3, found 'r' if( verify("fortran", "c++") /= 1) error stop ! 1, found 'f' if( verify("fortran", "c++", .true.) /= 7 ) error stop ! 7, found 'n' if( verify("fortran", "fortran") /= 0) error stop ! 0' found none r = .true. end function end program lfortran-0.63.0/integration_tests/types_02.f900000664000175000017500000000012415174404631021347 0ustar alastairalastairprogram types_02 implicit none real :: r integer :: i i = 1 r = 1 r = i end program lfortran-0.63.0/integration_tests/do_concurrent_03.f900000664000175000017500000000101615174404631023051 0ustar alastairalastair! equivalent to openmp_06.f90 subroutine increment_ctr(n, ctr) ! use omp_lib implicit none integer, intent(in) :: n integer, intent(inout) :: ctr integer :: local_ctr integer :: i local_ctr = 0 do concurrent (i = 1:n) reduce(+:local_ctr) local_ctr = local_ctr + 1 end do ctr = ctr + local_ctr end subroutine program do_concurrent_03 use omp_lib integer, parameter :: n = 1000000 integer :: ctr call omp_set_num_threads(8) ctr = 0 call increment_ctr(n, ctr) print *, ctr if (ctr /= 1000000) error stop end program lfortran-0.63.0/integration_tests/select_type_06.f900000664000175000017500000000140215174404631022527 0ustar alastairalastairprogram select_type_06_m implicit none type :: string_value character(len=:), allocatable :: raw end type type, extends(string_value) :: toml_keyval character(len=20) :: key = "example" end type class(string_value), allocatable :: val ! Polymorphic variable logical :: defer(2) defer = .false. allocate(val) select type(val) type is(string_value) val%raw = "Hello, Fortran!" end select if (val%raw /= "Hello, Fortran!") error stop deallocate(val) allocate(toml_keyval :: val) select type(val) class is(toml_keyval) defer(1) = .true. if (val%key /= "example") error stop end select if (any(defer .neqv. [.true., .false.])) error stop end program lfortran-0.63.0/integration_tests/union_test_03.f900000664000175000017500000000074615174404631022405 0ustar alastairalastairmodule lp_union_test_03_mod implicit none _lfortran_union_type :: test_type integer :: int_ real :: float_ end _lfortran_union_type end module program lp_union_test_03 use lp_union_test_03_mod implicit none integer::x type(test_type) :: test_union test_union%int_ = 100 x = test_union%int_ !Support direct comparision later if ( x /= 100 ) error stop end program lfortran-0.63.0/integration_tests/derived_types_08.f900000664000175000017500000000223515174404631023064 0ustar alastairalastairmodule shape_mod type shape integer :: color logical :: filled integer :: x integer :: y contains procedure :: initialize => initialize_subrout end type shape type, extends(shape) :: rectangle integer :: length integer :: width end type rectangle contains subroutine initialize_subrout(sh, color, filled, x, y) ! initialize shape objects class(shape) :: sh integer :: color logical :: filled integer :: x integer :: y sh%color = color sh%filled = filled sh%x = x sh%y = y end subroutine initialize_subrout end module program derived_types_08 use shape_mod implicit none type(shape) :: shp ! declare an instance of shape type(rectangle) :: rect ! declare an instance of rectangle call shp%initialize(1, .true., 10, 20) ! initialize shape call rect%initialize(2, .false., 100, 200) ! initialize rectangle print *, shp%color, shp%filled, shp%x, shp%y print *, rect%color, rect%filled, rect%x, rect%y rect%length = 100 rect%width = 200 print *, rect%length, rect%width end programlfortran-0.63.0/integration_tests/arrays_reshape_14.f900000664000175000017500000000446315174404631023230 0ustar alastairalastairprogram array_reshape_14 implicit none integer :: i23(2, 3) = reshape([-14, 3, 0, -2, 19, 1], [2, 3]) print *, i23 call test_reshape_with_argument() contains subroutine test_nd_to_1d(a) real(8), intent(in) :: a(:, :) integer :: i, j, k, l real(8) :: eps real(8) :: b(256) integer :: newshape(1) real(8) :: c(16, 16, 16) real(8) :: d(4096) integer :: newshape1(1) eps = 1e-12 newshape(1) = 256 b = reshape(a, newshape) do k = 1, 256 i = (k - 1)/16 j = (k - 1) - i*16 if (abs(b(k) - i - j - 0.5) > eps) error stop end do do i = 1, 16 do j = 1, 16 do k = 1, 16 c(i, j, k) = (i - 1) + (j - 1) + (k - 1) + 0.5 end do end do end do newshape1(1) = 4096 d = reshape(c, newshape1) do l = 1, 4096 i = (l - 1)/256 j = ((l - 1) - i*256)/16 k = ((l - 1) - i*256 - j*16) if (abs(d(l) - i - j - k - 0.5) > eps) error stop end do end subroutine subroutine test_1d_to_nd(d) real(8) :: d(:) integer :: i, j, k, l real(8) :: eps real(8) :: b(256) real(8) :: a(16, 16) integer :: newshape(2) real(8) :: c(16, 16, 16) integer :: newshape1(3) eps = 1e-12 do k = 1, 256 i = (k - 1)/16 j = (k - 1) - i*16 b(k) = i + j + 0.5 end do newshape(1) = 16 newshape(2) = 16 a = reshape(b, newshape) do i = 1, 16 do j = 1, 16 if (abs(a(i, j) - (i - 1) - (j - 1) - 0.5) > eps) error stop end do end do newshape1(1) = 16 newshape1(2) = 16 newshape1(3) = 16 c = reshape(d, newshape1) do i = 1, 16 do j = 1, 16 do k = 1, 16 if (abs(c(i, j, k) - (i - 1) - (j - 1) - (k - 1) - 0.5) > eps) error stop end do end do end do end subroutine subroutine test_reshape_with_argument() integer :: i, j, k, l real(8) :: a(16, 16) real(8) :: d(4096) do i = 1, 16 do j = 1, 16 a(i, j) = (i - 1) + (j - 1) + 0.5 end do end do call test_nd_to_1d(a) do l = 1, 4096 i = (l - 1)/256 j = ((l - 1) - i*256)/16 k = ((l - 1) - i*256 - j*16) d(l) = i + j + k + 0.5 end do call test_1d_to_nd(d) end subroutine end program lfortran-0.63.0/integration_tests/operator_overloading_29.f900000664000175000017500000000144215174404631024444 0ustar alastairalastair! Test type-bound operator(*) with pass(self) on the right operand module module_operator_overloading_29 implicit none type :: type_a double precision :: val end type type :: type_b double precision :: val contains procedure, pass(self) :: multiply_ab generic :: operator(*) => multiply_ab end type contains pure function multiply_ab(a, self) result(c) type(type_a), intent(in) :: a class(type_b), intent(in) :: self type(type_a) :: c c%val = a%val * self%val end function end module program operator_overloading_29 use module_operator_overloading_29 implicit none type(type_a) :: a, res type(type_b) :: b a = type_a(2.0d0) b = type_b(3.0d0) res = a * b if (abs(res%val - 6.0d0) > 1.0d-10) error stop print *, res%val end program lfortran-0.63.0/integration_tests/bin_op_real_01.f900000664000175000017500000000057115174404631022461 0ustar alastairalastairprogram bin_op_real_01 implicit none real :: R(4), V(4) R = 23 V = 9 print *, func(R, V) if (func(R, V) /= 39304) error stop if (((sum(R) - 9.16E-04) > -1e-8)) error stop contains integer function func(R, V) result(i) real, intent(inout) :: R(:), V(:) i = (34**3) R = -(R-V)/i end function end program bin_op_real_01 lfortran-0.63.0/integration_tests/procedure_07.f900000664000175000017500000000140315174404631022201 0ustar alastairalastairmodule procedure_07_module contains subroutine cb(x) implicit none integer, intent(in), optional :: x(:) logical :: y y = present(x) if(y .neqv. .false.) error stop end subroutine cb end module procedure_07_module program procedure_07 use procedure_07_module call temp(cb) call temp() !! Optional cb not passed call temp2(cb) contains subroutine temp(call_back) implicit none procedure(cb), optional :: call_back logical :: terminate_var if(present(call_back)) call call_back() end subroutine temp subroutine temp2(call_back) implicit none procedure(cb) :: call_back logical :: terminate_var end subroutine end program procedure_07lfortran-0.63.0/integration_tests/procedure_43_module.f900000664000175000017500000000101715174404631023547 0ustar alastairalastairmodule procedure_43_module type :: MyType procedure(pintfc), pointer, nopass :: ptr => null() contains procedure :: method end type MyType abstract interface function pintfc(n) result(res) integer(4), dimension(:), intent(in) :: n integer(4), dimension(size(n)) :: res end function pintfc end interface contains subroutine method( self ) class(MyType), intent(inout) :: self end subroutine method end module procedure_43_module lfortran-0.63.0/integration_tests/gpu_metal_49.f900000664000175000017500000000074715174404631022206 0ustar alastairalastairprogram gpu_metal_49 ! Test: associate-bound name inside nested blocks within do concurrent implicit none real :: arr(4, 3) integer :: pair arr = 1.0 associate(b => arr) do concurrent(pair = 1:2) block block b(1,pair) = 0.0 end block end block end do end associate if (arr(1,1) /= 0.0) error stop if (arr(1,2) /= 0.0) error stop if (arr(2,1) /= 1.0) error stop if (arr(1,3) /= 1.0) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/modules_62.f900000664000175000017500000000144515174404631021670 0ustar alastairalastair! Test for modfile serialization with nested derived types and default initialization. ! This tests the fix for a bug where structure constructors in default initialization ! expressions contained direct Struct references to types from external modules that ! weren't explicitly imported. When serializing the modfile, these external Struct ! references caused assertion failures during deserialization because the symtab IDs ! weren't present in the modfile's symbol table map. program modules_62 use modules_62_parser, only: parser_config, parse implicit none type(parser_config) :: cfg integer :: val call parse(cfg, val) ! Default level is 0, default reset%style is -1 ! So val should be 0 + (-1) = -1 if (val /= -1) error stop print *, "PASSED: modules_62" end program modules_62 lfortran-0.63.0/integration_tests/gpu_metal_31.f900000664000175000017500000000061415174404631022166 0ustar alastairalastairprogram gpu_metal_31 ! Test: do concurrent inside associate inside block with block-local variables implicit none integer :: total total = 0 block integer :: i, x(4) x = 0 associate(n => 4) do concurrent(i = 1:n) x(i) = i * 2 end do end associate total = x(1) + x(2) + x(3) + x(4) end block if (total /= 20) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/functions_38.f900000664000175000017500000000121115174404631022222 0ustar alastairalastairmodule utils implicit none contains subroutine stop_error(msg) character(len=*) :: msg ! Message to print on stdout print *, msg end subroutine end module module error_util use utils, only: stop_error implicit none contains integer function error(err, eps) result(r) real(8), intent(in) :: err, eps print "('Test failed: error = ', es10.2, ' > ', es10.2, ' specified.')", & err, eps call stop_error("Aborting...") r = 0 end function end module program functions_38 use error_util, only: error implicit none call driver() contains subroutine driver() integer :: tmp tmp = error(1.0_8, 0.0_8) end subroutine end program lfortran-0.63.0/integration_tests/do_loop_08.f900000664000175000017500000000142215174404631021646 0ustar alastairalastairprogram do_loop_08 implicit none type :: string_t character(len=:), allocatable :: string_ end type type(string_t) :: body(1,2) type(string_t), allocatable :: tbl(:) body(1,1)%string_ = "a" body(1,2)%string_ = "b" tbl = make_table(body) if (size(tbl) /= 3) error stop if (tbl(1)%string_ /= "x") error stop if (tbl(2)%string_ /= "x") error stop if (tbl(3)%string_ /= "x") error stop print *, "ok" contains function make_table(body_cells) result(lines) type(string_t), intent(in) :: body_cells(:,:) type(string_t) :: lines(size(body_cells,1) + rank(body_cells)) integer :: row do row = 1, size(lines) lines(row)%string_ = "x" end do end function end program lfortran-0.63.0/integration_tests/arrays_intrin_07.f900000664000175000017500000000103415174404631023075 0ustar alastairalastairmodule arrays_intrin_07_mod implicit none contains subroutine take_min(arr) real(8), intent(out) :: arr(:,:) real(8) :: tmp1, tmp2 tmp1 = huge(1.d0) tmp2 = huge(1.d0) arr(:,1) = min( 0.d0,tmp1,tmp2 ) if (arr(1, 1) /= 0.d0) error stop if (size(arr) /= 2) error stop end subroutine take_min end module arrays_intrin_07_mod program arrays_intrin_07 use arrays_intrin_07_mod implicit none real(8) :: arr(1, 2) call take_min(arr) end program arrays_intrin_07 lfortran-0.63.0/integration_tests/doloop_03.f900000664000175000017500000000076715174404631021515 0ustar alastairalastairprogram doloop_03 implicit none integer :: i, j j = 0 do i = 1, 10 j = j + i if (i == 3) then continue end if if (i == 2) exit end do if (j /= 3) error stop print *, j j = 0 do i = 1, 10 if (i == 2) exit j = j + i end do if (j /= 1) error stop print *, j j = 0 do i = 1, 10 if (i == 2) cycle j = j + i end do if (j /= 53) error stop print *, j end program lfortran-0.63.0/integration_tests/derived_types_19_module.f900000664000175000017500000000203415174404631024430 0ustar alastairalastairmodule derived_types_module_19 implicit none public :: child_value type, abstract :: toml_value character(len=:), allocatable :: key end type toml_value type, extends(toml_value) :: child_value logical :: ok end type child_value interface new module procedure :: check_proc end interface new contains subroutine check_proc() class(toml_value), pointer :: ptr type(child_value), pointer :: array if (associated(ptr)) then select type(ptr) type is(child_value) if (ptr%ok) then array => ptr else call not_ok() return end if class default call default_class() return end select end if end subroutine check_proc subroutine not_ok() print *, "not ok" end subroutine subroutine default_class() print *, "default class" end subroutine end module derived_types_module_19 lfortran-0.63.0/integration_tests/array_section_01.f900000664000175000017500000000312315174404631023046 0ustar alastairalastairsubroutine vecfcn(l, m, n, o) implicit none integer, intent(in) :: l, m, n, o integer :: i, j, k, a, b, c, d real :: fvec(l), fvec2d(l, m), fvec3d(l, m, n), fvec4d(l, m, n, o) i = 5 j = 5 k = 5 fvec(1) = 1 fvec(2:l) = 0.0 print *, fvec if (fvec(1) /= 1.0) error stop if (fvec(2) /= 0.0) error stop if (fvec(10) /= 0.0) error stop fvec2d = 1.0 fvec2d(:, k) = 2.0 print *, fvec2d do a = 1, l do b = 1, m if( b == k ) then if( fvec2d(a, b) /= 2.0 ) error stop else if( fvec2d(a, b) /= 1.0 ) error stop end if end do end do fvec3d = 1.0 fvec3d(:, k, :i) = 2.0 print *, fvec3d do a = 1, l do b = 1, m do c = 1, n if( b == 5 .and. c <= i ) then if( fvec3d(a, b, c) /= 2.0 ) error stop else if( fvec3d(a, b, c) /= 1.0 ) error stop end if end do end do end do fvec4d = 1.0 fvec4d(:, k, :i, j) = 2.0 print *, fvec4d do a = 1, l do b = 1, m do c = 1, n do d = 1, o if( b == 5 .and. c <= i .and. d == j ) then if( fvec4d(a, b, c, d) /= 2.0 ) error stop else if( fvec4d(a, b, c, d) /= 1.0 ) error stop end if end do end do end do end do end subroutine vecfcn program main call vecfcn(10, 10, 10, 10) end program main lfortran-0.63.0/integration_tests/read_41.f900000664000175000017500000000155015174404631021125 0ustar alastairalastairprogram read_41 ! List-directed internal read of complex with leading whitespace. ! The Fortran standard requires leading blanks to be ignored. implicit none complex :: z character(len=:), allocatable :: s ! No leading space s = "(1.0,0.0)" read(s, *) z if (abs(real(z) - 1.0) > 1e-6) error stop "Test 1 real part failed" if (abs(aimag(z) - 0.0) > 1e-6) error stop "Test 1 imag part failed" ! One leading space s = " (1.0,0.0)" read(s, *) z if (abs(real(z) - 1.0) > 1e-6) error stop "Test 2 real part failed" if (abs(aimag(z) - 0.0) > 1e-6) error stop "Test 2 imag part failed" ! Multiple leading spaces s = " (2.5,-3.0)" read(s, *) z if (abs(real(z) - 2.5) > 1e-6) error stop "Test 3 real part failed" if (abs(aimag(z) - (-3.0)) > 1e-6) error stop "Test 3 imag part failed" print *, "All tests passed." end program read_41 lfortran-0.63.0/integration_tests/functions_56_mod.f900000664000175000017500000000235015174404631023066 0ustar alastairalastairmodule functions_56_mod implicit none private public :: mha_layer type :: mha_layer integer :: sequence_length, head_size, n_heads real, allocatable :: v_heads(:,:,:) contains procedure :: split_heads procedure :: do_backward end type mha_layer interface pure module function split_heads(self, input) result(output) class(mha_layer), intent(in) :: self real, intent(in) :: input(:) real :: output(self%sequence_length, self%head_size, self%n_heads) end function split_heads pure module subroutine do_backward(self) class(mha_layer), intent(inout) :: self end subroutine do_backward end interface end module functions_56_mod submodule(functions_56_mod) functions_56_smod implicit none contains pure module function split_heads(self, input) result(output) class(mha_layer), intent(in) :: self real, intent(in) :: input(:) real :: output(self%sequence_length, self%head_size, self%n_heads) output = 1.0 end function split_heads pure module subroutine do_backward(self) class(mha_layer), intent(inout) :: self real :: temp(2) temp = 1.0 self%v_heads = self%split_heads(temp) end subroutine do_backward end submodule functions_56_smodlfortran-0.63.0/integration_tests/gpu_metal_155.f900000664000175000017500000000124115174404631022252 0ustar alastairalastairprogram gpu_metal_155 ! Test assumed-shape multi-dimensional array indexing in do concurrent. ! Verifies that column-major strides are computed correctly so that ! x(1,2) is actually the second-column element, not x(1,1). implicit none real :: x(2,3) integer :: i x = 0.0 x(1,2) = 5.0 x(2,3) = 10.0 call add_one(x) if (abs(x(1,2) - 6.0) > 1.0e-6) error stop if (abs(x(2,3) - 11.0) > 1.0e-6) error stop if (abs(x(1,1) - 0.0) > 1.0e-6) error stop print *, "ok" contains subroutine add_one(a) real, intent(inout) :: a(:,:) integer :: i do concurrent (i = 1:1) a(1,2) = a(1,2) + 1.0 a(2,3) = a(2,3) + 1.0 end do end subroutine end program lfortran-0.63.0/integration_tests/arrays_44.f900000664000175000017500000000127615174404631021523 0ustar alastairalastairprogram arrays_44 integer, dimension(3, 3) :: x logical, dimension(3, 3) :: mask x = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9], shape(x)) mask = reshape([.true., .false., .true., .false., .true., .false., .true., .false., .true.], shape(mask)) print *, median_mask_2_iint8_dp(x, 1, mask) if (abs(median_mask_2_iint8_dp(x, 1, mask) - 12.0) > 1e-8) error stop contains function median_mask_2_iint8_dp(x, dim, mask) result(res) integer, intent(in) :: x(:,:) integer, intent(in) :: dim logical, intent(in) :: mask(:,:) real :: res integer :: j1 integer, allocatable :: x_tmp(:) do j1 = 1, size(x, 1) x_tmp = pack(x(j1, :), mask(j1, :)) end do res = sum(x_tmp) end function median_mask_2_iint8_dp end program lfortran-0.63.0/integration_tests/allocate_67.f900000664000175000017500000000036215174404631022006 0ustar alastairalastairprogram allocate_67 implicit none type :: T integer :: x = 5 end type T type(T), allocatable :: src, obj allocate(src) allocate(obj, source = src) if (obj%x /= 5) error stop print *, "ok" end program allocate_67 lfortran-0.63.0/integration_tests/pdt_13.f900000664000175000017500000000123015174404631020773 0ustar alastairalastair! Test: parent component access on extended PDT with kind type parameters module pdt_13_parent_m implicit none type :: parent_t(k) integer, kind :: k = kind(1.0) integer :: x = 0 end type end module module pdt_13_child_m use pdt_13_parent_m, only: parent_t implicit none type, extends(parent_t) :: child_t(m) integer, kind :: m = kind(1.0) integer :: y = 0 end type end module program pdt_13 use pdt_13_parent_m, only: parent_t use pdt_13_child_m, only: child_t implicit none type(child_t) :: child child%x = 42 child%y = 7 if (child%x /= 42) error stop if (child%y /= 7) error stop print *, child%x end program lfortran-0.63.0/integration_tests/read_70.f900000664000175000017500000000174515174404631021135 0ustar alastairalastairprogram read_70 ! Test that formatted read into array sections correctly respects ! intermediate format descriptors (like X) between edit descriptors. ! Previously, reading into y(:) with format (es15.8,1x,es15.8) would ! read all elements in a tight loop, skipping the 1X separator. implicit none real :: y(2) character(31) :: s integer :: ia(3) character(45) :: si ! Test 1: ES format with 1X separator into real array section s = " 3.00000000E-01 -5.00000000E-01" read(s, "(es15.8,1x,es15.8)") y(:) if (abs(y(1) - 0.3) > 0.01) error stop if (abs(y(2) + 0.5) > 0.01) error stop ! Test 2: F format with X separator into real array section s = " 1.50 2.50 3.50" y = 0.0 read(s, "(f6.2,6x,f6.2)") y(:) if (abs(y(1) - 1.5) > 0.01) error stop if (abs(y(2) - 3.5) > 0.01) error stop ! Test 3: Integer array with X separator si = " 10 20 30" read(si, "(i4,2x,i4,2x,i4)") ia(:) if (ia(1) /= 10) error stop if (ia(2) /= 20) error stop if (ia(3) /= 30) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/derived_types_19.f900000664000175000017500000000047115174404631023066 0ustar alastairalastairmodule derived_types_module_19_1 use derived_types_module_19, only: check_proc implicit none contains subroutine check_here() call check_proc() end subroutine end module program main implicit none print *, "running derived_types_19 main program" end program main lfortran-0.63.0/integration_tests/string_62b.f900000664000175000017500000000040315174404631021661 0ustar alastairalastairmodule string_62_mod character(3) :: str = "Hi!" contains subroutine ff print *,"Side 2 : ", str if(str /= "Bye") error stop str = "123" print *, ">> Side 2 changed variable value to:", str end subroutine end module lfortran-0.63.0/integration_tests/test_ieee_copy_sign.f900000664000175000017500000000466615174404631023741 0ustar alastairalastair! Test ieee_copy_sign function program test_ieee_copy_sign use, intrinsic :: ieee_arithmetic use, intrinsic :: iso_fortran_env, only: real32, real64 implicit none real(real32) :: x_sp, y_sp, r_sp real(real64) :: x_dp, y_dp, r_dp print *, "Testing ieee_copy_sign..." ! Test 1: Positive magnitude, positive sign x_sp = 5.0_real32 y_sp = 3.0_real32 r_sp = ieee_copy_sign(x_sp, y_sp) print *, "ieee_copy_sign(5.0, 3.0) = ", r_sp if (r_sp /= 5.0_real32) error stop "Should be positive 5.0" ! Test 2: Positive magnitude, negative sign x_sp = 5.0_real32 y_sp = -3.0_real32 r_sp = ieee_copy_sign(x_sp, y_sp) print *, "ieee_copy_sign(5.0, -3.0) = ", r_sp if (r_sp /= -5.0_real32) error stop "Should be negative 5.0" ! Test 3: Negative magnitude, positive sign x_sp = -7.0_real32 y_sp = 2.0_real32 r_sp = ieee_copy_sign(x_sp, y_sp) print *, "ieee_copy_sign(-7.0, 2.0) = ", r_sp if (r_sp /= 7.0_real32) error stop "Should be positive 7.0" ! Test 4: Negative magnitude, negative sign x_sp = -7.0_real32 y_sp = -2.0_real32 r_sp = ieee_copy_sign(x_sp, y_sp) print *, "ieee_copy_sign(-7.0, -2.0) = ", r_sp if (r_sp /= -7.0_real32) error stop "Should be negative 7.0" ! Test 5: Zero magnitude, positive sign x_sp = 0.0_real32 y_sp = 1.0_real32 r_sp = ieee_copy_sign(x_sp, y_sp) print *, "ieee_copy_sign(0.0, 1.0) = ", r_sp if (.not. (r_sp == 0.0_real32 .and. .not. ieee_is_negative(r_sp))) then error stop "Should be positive zero" end if ! Test 6: Zero magnitude, negative sign x_sp = 0.0_real32 y_sp = -1.0_real32 r_sp = ieee_copy_sign(x_sp, y_sp) print *, "ieee_copy_sign(0.0, -1.0) = ", r_sp if (.not. (r_sp == 0.0_real32 .and. ieee_is_negative(r_sp))) then error stop "Should be negative zero" end if ! Test 7: Double precision x_dp = 12.5_real64 y_dp = -8.0_real64 r_dp = ieee_copy_sign(x_dp, y_dp) print *, "ieee_copy_sign(12.5d0, -8.0d0) = ", r_dp if (r_dp /= -12.5_real64) error stop "Should be -12.5d0" ! Test 8: Copy sign from negative zero x_sp = 4.0_real32 y_sp = -0.0_real32 r_sp = ieee_copy_sign(x_sp, y_sp) print *, "ieee_copy_sign(4.0, -0.0) = ", r_sp if (r_sp /= -4.0_real32) error stop "Should be -4.0" print *, "All ieee_copy_sign tests passed!" end program test_ieee_copy_sign lfortran-0.63.0/integration_tests/operator_overloading_26.f900000664000175000017500000000142515174404631024442 0ustar alastairalastairmodule operator_overloading_26_mod implicit none type :: result_t logical :: passed = .false. end type interface operator(.and.) module procedure combine end interface contains elemental function combine(lhs, rhs) result(res) type(result_t), intent(in) :: lhs, rhs type(result_t) :: res res%passed = lhs%passed .and. rhs%passed end function end module program operator_overloading_26 use operator_overloading_26_mod implicit none type(result_t) :: a, b, c, d a = result_t(.true.) b = result_t(.true.) c = result_t(.true.) ! Chained overloaded .and. with derived type d = a .and. b .and. c if (.not. d%passed) error stop a = result_t(.false.) d = a .and. b .and. c if (d%passed) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/intrinsics_432.f900000664000175000017500000000160515174404631022464 0ustar alastairalastairprogram intrinsics_432 implicit none integer :: a ! Test nested ieor with value parameters call test_ieor(a, 1, 2) if (a /= 1) error stop ! Test nested iand with value parameters call test_iand(a, 15, 6) if (a /= 6) error stop ! Test nested ior with value parameters call test_ior(a, 5, 2) if (a /= 7) error stop print *, "ok" contains pure subroutine test_ieor(a, b, c) integer, intent(out) :: a integer, intent(in), value :: b, c a = ieor(ieor(b, c), c) end subroutine pure subroutine test_iand(a, b, c) integer, intent(out) :: a integer, intent(in), value :: b, c a = iand(iand(b, c), c) end subroutine pure subroutine test_ior(a, b, c) integer, intent(out) :: a integer, intent(in), value :: b, c a = ior(ior(b, c), c) end subroutine end program lfortran-0.63.0/integration_tests/file_25.f900000664000175000017500000000070415174404631021133 0ustar alastairalastairprogram file_25 implicit none integer :: io integer :: x_write, x_read character(len=20) :: char_read x_write = 12345 open(newunit=io, status="scratch") write(io, *) x_write rewind(io) read(io, *) x_read close(io) if (x_write /= x_read) error stop open(newunit=io, status="scratch") write(io, *) "Hello" rewind(io) read(io, *) char_read close(io) print *, char_read if (char_read /= "Hello") error stop end program lfortran-0.63.0/integration_tests/derived_types_37.f900000664000175000017500000000274415174404631023073 0ustar alastairalastairprogram derived_types_37 implicit none TYPE test_type2 integer :: num END TYPE test_type2 TYPE test_type1 integer :: num integer :: arr_1(3) type(test_type2):: arr_2(3) END TYPE test_type1 integer :: i TYPE(test_type1), DIMENSION(5) :: main_arr TYPE(test_type1), allocatable :: main_arr_alloc(:) main_arr%num = 44 do i =1, 5 print *, main_arr(i)%num if(main_arr(i)%num /= 44) error stop end do main_arr(1)%arr_1 = 33 do i =1, 3 print *,main_arr(1)%arr_1(i) if(main_arr(1)%arr_1(i) /= 33) error stop end do main_arr(1)%arr_2%num = 22 do i =1, 3 print *,main_arr(1)%arr_2(i)%num if(main_arr(1)%arr_2(i)%num /= 22) error stop end do ! Duplicate test with allocatable array ! to check that implied array assignment in structInstanceMember isn't dependent on known compile time size. allocate(main_arr_alloc(5)) main_arr_alloc%num = 44 do i =1, 5 print *, main_arr_alloc(i)%num if(main_arr_alloc(i)%num /= 44) error stop end do main_arr_alloc(1)%arr_1 = 33 do i =1, 3 print *,main_arr_alloc(1)%arr_1(i) if(main_arr_alloc(1)%arr_1(i) /= 33) error stop end do main_arr_alloc(1)%arr_2%num = 22 do i =1, 3 print *,main_arr_alloc(1)%arr_2(i)%num if(main_arr_alloc(1)%arr_2(i)%num /= 22) error stop end do end program derived_types_37 lfortran-0.63.0/integration_tests/associate_20.f900000664000175000017500000000227115174404631022163 0ustar alastairalastairmodule assert_m_module_associate_20 public :: assert_this_image_interface, assert_this_image abstract interface pure function assert_this_image_interface() result(this_image_id) integer :: this_image_id end function end interface procedure(assert_this_image_interface), pointer :: assert_this_image contains subroutine assert_always(is_two) logical, intent(in) :: is_two print *, assert_this_image() if (is_two) then if ( assert_this_image() /= 112352 ) error stop else if ( assert_this_image() /= 112351 ) error stop end if end subroutine end module assert_m_module_associate_20 program associate_20 use assert_m_module_associate_20 implicit none assert_this_image => assert_callback_this_image call assert_always(.false.) assert_this_image => assert_callback_this_image_two call assert_always(.true.) contains pure function assert_callback_this_image() result(this_image_id) implicit none integer :: this_image_id this_image_id = 112351 end function pure function assert_callback_this_image_two() result(this_image_id) implicit none integer :: this_image_id this_image_id = 112352 end function end program lfortran-0.63.0/integration_tests/interface_29.f900000664000175000017500000000046415174404631022163 0ustar alastairalastairmodule bench_mod contains subroutine run(x) interface integer function f() end function f end interface integer :: x if (x /= 1) error stop print *, x end subroutine run end module bench_mod program main use bench_mod call run(1) end program main lfortran-0.63.0/integration_tests/inquire_02.f900000664000175000017500000000121715174404631021663 0ustar alastairalastairprogram inquire_02 type :: string_t character(:), allocatable :: s end type integer :: unit, pos_value character(len=1) :: ch logical :: ex type(string_t) :: temp temp%s = "data.txt" open(unit=10, file="data.txt") write(10, '(A)', advance='no') 'abcd' ! writes 4 characters, no newline rewind(10) ! go back to start read(10, '(A)', advance='no') ch ! read 1 character (1 byte) inquire(unit=10, pos=pos_value) inquire(file="data.txt", exist=ex) print *, "Position:", pos_value if(pos_value /= 2) error stop if(ex .neqv. .true.) error stop end programlfortran-0.63.0/integration_tests/procedure_decl_01_a.f900000664000175000017500000000014515174404631023464 0ustar alastairalastairprogram procedure_decl_01_a use, non_intrinsic :: procedure_decl_01_b end program procedure_decl_01_alfortran-0.63.0/integration_tests/intrinsics_113.f900000664000175000017500000000046415174404631022462 0ustar alastairalastairprogram intrinsics_113 print *, sign(a=-12.,b=0.) print *, sign(a=-12.,b=1.) print *, sign(a=-12.,b=-1.) if ( .not. sign( a = -12, b = 1 ) == 12 ) error stop if ( .not. sign( -12, b = 0 ) == 12 ) error stop if ( .not. sign( -12, -1 ) == -12 ) error stop end program intrinsics_113 lfortran-0.63.0/integration_tests/file_open_04.f900000664000175000017500000000067715174404631022162 0ustar alastairalastairprogram open_direct_form use iso_fortran_env, only: int32 implicit none integer(int32) :: x, y x = 654321 open(10, file="file_open_04_data.bin", access="direct", recl=4) write(10, rec=1) x close(10) open(10, file="file_open_04_data.bin", access="direct", recl=4) read(10, rec=1) y close(10) if (y /= x) then print *, "FAIL: expected", x, "got", y error stop 1 end if end programlfortran-0.63.0/integration_tests/intrinsics_152.f900000664000175000017500000000543015174404631022463 0ustar alastairalastairprogram intrinsics_152 implicit none integer :: k1= 5 integer :: k2= 5_4 integer :: k3= 58_8 integer :: k4= 8 integer :: k5 = 9 integer :: k6 = 2 integer :: m90_quad integer :: m90_dble integer, parameter :: sp = selected_real_kind(6,37) integer, parameter :: dp = selected_real_kind(15,307) print*, sp if (sp /= 4) error stop print*, dp if (dp /= 8) error stop print*, selected_real_kind() if (selected_real_kind() /= 4) error stop print*, selected_real_kind(1, 5) if (selected_real_kind(1, 5) /= 4) error stop print*, selected_real_kind(3, 32) if (selected_real_kind(3, 32) /= 4) error stop print*, selected_real_kind(5, 39) if (selected_real_kind(5, 39) /= 8) error stop print*, selected_real_kind(6, 51) if (selected_real_kind(6, 51) /= 8) error stop print*, selected_real_kind(7, 2) if (selected_real_kind(7, 2) /= 8) error stop print*, selected_real_kind(9, 1) if (selected_real_kind(9, 1) /= 8) error stop print*, selected_real_kind(12, 33) if (selected_real_kind(12, 33) /= 8) error stop print*, selected_real_kind(14, 32) if (selected_real_kind(14, 32) /= 8) error stop print*, selected_real_kind(7, 38, 2) if (selected_real_kind(7, 38, 2) /= 8) error stop print*, selected_real_kind(8, 38, 3) if (selected_real_kind(8, 38, 3) /= -5) error stop print*, selected_real_kind(9, 38, 2) if (selected_real_kind(9, 39, 2) /= 8) error stop print*, selected_real_kind(16, 37) ! output form lfortran is 8 whereas gfortran is 10 print*, selected_real_kind(17, 37) ! output form lfortran is 8 whereas gfortran is 10 print*, selected_real_kind(k1) if (selected_real_kind(k1) /= 4) error stop print*, selected_real_kind(k2) if (selected_real_kind(k2) /= 4) error stop print*, selected_real_kind(k1, k3) if (selected_real_kind(k1, k3) /= 8) error stop print*, selected_real_kind(k5, k4) if (selected_real_kind(k5, k4) /= 8) error stop print*, selected_real_kind(k1, k5) if (selected_real_kind(k1, k5) /= 4) error stop print*, selected_real_kind(k5, k2, k6) if (selected_real_kind(k5, k2, k6) /= 8) error stop print*, selected_real_kind(k5, k2, 3) if (selected_real_kind(k5, k2, 3) /= -5) error stop print*, selected_real_kind(34) if (selected_real_kind(34) /= -1) error stop print*, selected_real_kind(50,10,2) if (selected_real_kind(50,10,2) /= -1) error stop print*, selected_real_kind(45,16) if (selected_real_kind(50,10,2) /= -1) error stop m90_quad = selected_real_kind(p=digits(1.d0)+1) print*, m90_quad if (m90_quad /= -1) error stop m90_dble = selected_real_kind(15, 307) print *, m90_dble print*, max(selected_real_kind(r = range(1.d0)+1), m90_dble) end program lfortran-0.63.0/integration_tests/list_test_08_.f900000664000175000017500000000511715174404631022371 0ustar alastairalastairmodule list_test_08_mod implicit none real :: eps = 1e-6 contains function l1norm(v) result(res) type(_lfortran_list(integer)), intent(in) :: v real :: res integer :: i res = 0.0 do i = 0, _lfortran_len(v) - 1 res = res + real(_lfortran_get_item(v, i)) end do end function function sort(l) result(res) type(_lfortran_list(integer)), intent(inout) :: l type(_lfortran_list(integer)) :: res integer :: i, j integer :: a, b res = l do i = 0, _lfortran_len(res) - 1 do j = i + 1, _lfortran_len(res) - 1 a = _lfortran_get_item(res, i) b = _lfortran_get_item(res, j) if (a > b) then call _lfortran_set_item(res, i, b) call _lfortran_set_item(res, j, a) end if end do end do end function subroutine sort_list() type(_lfortran_list(integer)) :: x integer :: size, i size = 50 do i = 0, size - 1 call _lfortran_list_append(x, size - i) end do x = sort(x) do i = 0, size - 2 if (_lfortran_get_item(x, i) > _lfortran_get_item(x, i + 1)) error stop end do if (_lfortran_len(x) /= size) error stop end subroutine subroutine sort_by_l1_norm() type(_lfortran_list(_lfortran_list(integer))) :: mat type(_lfortran_list(integer)) :: vec, temp integer :: i, j, k, rows, cols real :: norm1, norm2 rows = 10 cols = 7 k = rows * cols do i = 0, rows - 1 do j = 0, cols - 1 call _lfortran_list_append(vec, k) k = k - 1 end do call _lfortran_list_append(mat, vec) call _lfortran_clear(vec) end do do i = 0, rows - 1 do j = i + 1, rows - 1 norm1 = l1norm(_lfortran_get_item(mat, i)) norm2 = l1norm(_lfortran_get_item(mat, j)) if (norm1 > norm2) then temp = sort(_lfortran_get_item(mat, j)) call _lfortran_set_item(mat, j, sort(_lfortran_get_item(mat, i))) call _lfortran_set_item(mat, i, temp) end if end do end do k = 1 do i = 0, rows - 1 do j = 0, cols - 1 if (_lfortran_get_item(_lfortran_get_item(mat, i), j) /= k) error stop k = k + 1 end do end do end subroutine subroutine tests() call sort_list() call sort_by_l1_norm() end subroutine end module program test_sort_lists use list_test_08_mod implicit none call tests end program lfortran-0.63.0/integration_tests/equivalence_03.f900000664000175000017500000000110315174404631022503 0ustar alastairalastairprogram equivalence_03 implicit none DOUBLE PRECISION DMACH(5) INTEGER*4 SMALL(2) INTEGER*4 LARGE(2) INTEGER*4 RIGHT(2) INTEGER*4 DIVER(2) INTEGER*4 LOG10(2) EQUIVALENCE (DMACH(1),SMALL(1)) EQUIVALENCE (DMACH(2),LARGE(1)) EQUIVALENCE (DMACH(3),RIGHT(1)) EQUIVALENCE (DMACH(4),DIVER(1)) EQUIVALENCE (DMACH(5),LOG10(1)) dmach(2) = 5.6_8 if(large(1) /= 1717986918) error stop if(large(2) /= 1075209830) error stop dmach(2) = 5.7_8 if(large(1) /= -858993459) error stop if(large(2) /= 1075236044) error stop endlfortran-0.63.0/integration_tests/derived_types_136.f900000664000175000017500000000031515174404631023143 0ustar alastairalastairprogram derived_types_136 implicit none type :: foo integer :: foo end type foo type(foo) :: x x%foo = 42 if (x%foo /= 42) error stop print *, "ok" end program derived_types_136 lfortran-0.63.0/integration_tests/gpu_metal_53.f900000664000175000017500000000100715174404631022167 0ustar alastairalastair! Test: do concurrent with array section inside associate block. ! The gpu_offload pass must place the __gpu_sec_i temp variable ! in the containing function scope, not in the AssociateBlock scope. program gpu_metal_53 implicit none real :: b(4) integer :: l b = 0.0 associate(x => 2) do concurrent(l = 1:3) b(1:l) = 1.0 end do end associate if (abs(b(1) - 1.0) > 1e-6) error stop if (abs(b(2) - 1.0) > 1e-6) error stop if (abs(b(3) - 1.0) > 1e-6) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/class_49.f900000664000175000017500000000114015174404631021322 0ustar alastairalastairmodule class_49_m_1 implicit none type base integer :: m = 1 end type end module module class_49_m_2 use class_49_m_1, only: base type, extends(base) :: derived integer :: n = 2 end type end module program class_49 use class_49_m_1, only: base use class_49_m_2, only: derived class(base), allocatable :: b allocate(derived :: b) b = derived(10, 20) select type(b) type is (derived) if (b%m /= 10) error stop if (b%n /= 20) error stop class default error stop end select end program lfortran-0.63.0/integration_tests/select_type_12.f900000664000175000017500000000133215174404631022526 0ustar alastairalastair module container_mod type, abstract :: base end type base type, extends(base) :: child integer :: x = 42 end type child type :: container class(base), allocatable :: val end type container end module container_mod program select_type_12 use container_mod type(container) :: c type(child) :: ch integer :: t class(container), allocatable :: self allocate(self) allocate(child::self%val) select type(val => self%val) type is(child) print *, "child%x =", val%x t=val%x end select if(t /= 42) then print *, "Error: t should be 42, but is", t else print *, "Success: t is", t end if end program select_type_12lfortran-0.63.0/integration_tests/submodule_20c.f900000664000175000017500000000017515174404631022353 0ustar alastairalastairsubmodule(submodule_20b_mod) submodule_20b_sub implicit none contains module procedure foo end procedure end submodule lfortran-0.63.0/integration_tests/bindc_16.f900000664000175000017500000000047315174404631021276 0ustar alastairalastairmodule bindc_16_mod implicit none integer, bind(c, name='FORTYTWO') :: FORTYTWO = 42 real, bind(c, name='PI_APPROX') :: PI_APPROX = 3.14 end module program bindc_16 use bindc_16_mod implicit none if (FORTYTWO /= 42) error stop if (abs(PI_APPROX - 3.14) > 1e-5) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/modules_05.f900000664000175000017500000000035515174404631021664 0ustar alastairalastairmodule modules_05_mod implicit none private integer, parameter, public :: a = 5 integer, parameter :: b = 6 integer, parameter :: c = 7 public :: c end module program modules_05 use modules_05_mod, only: a, c print *, a, c end program lfortran-0.63.0/integration_tests/insertion_sort_01.f900000664000175000017500000000173515174404631023274 0ustar alastairalastairprogram insertion_sort_01 implicit none integer, parameter :: int_size = selected_int_kind(8) character(len=4), allocatable :: array(:) character(len=4) :: expected(5) integer(int_size) :: i array = ['zulu', 'echo', 'brav', 'alph', 'yank'] call insertion_sort(array) expected = ['alph', 'brav', 'echo', 'yank', 'zulu'] do i = 1, size(array, kind=int_size) if (array(i) /= expected(i)) error stop end do contains subroutine insertion_sort(array) character(len=*), intent(inout) :: array(0:) integer(int_size) :: i, j character(len=len(array)) :: key do j = 1, size(array, kind=int_size) - 1 key = array(j) i = j - 1 do while (i >= 0) if (array(i) <= key) exit array(i+1) = array(i) i = i - 1 end do array(i+1) = key end do end subroutine insertion_sort end program insertion_sort_01 lfortran-0.63.0/integration_tests/derived_types_41.f900000664000175000017500000000074715174404631023067 0ustar alastairalastairmodule derived_types_41_mod implicit none type :: mytype integer :: a(2) integer :: b integer :: c(2) end type mytype type(mytype) :: mytype_instance = mytype([1, 2], 3, [4, 5]) end module derived_types_41_mod program derived_types_41 use derived_types_41_mod if (any(mytype_instance%a /= [1, 2])) error stop if (mytype_instance%b /= 3) error stop if (any(mytype_instance%c /= [4, 5])) error stop end program derived_types_41 lfortran-0.63.0/integration_tests/select_type_23.f900000664000175000017500000000110315174404631022524 0ustar alastairalastairprogram select_type_23 implicit none type :: base_settings end type base_settings type, extends(base_settings) :: fpm_new_settings character(len=:), allocatable :: name end type fpm_new_settings class(base_settings), allocatable :: cmd_settings character(len=:), allocatable :: act_name(:) cmd_settings = fpm_new_settings("build") select type (settings => cmd_settings) type is (fpm_new_settings) act_name = [ trim(settings%name) ] end select if (act_name(1) /= "build") error stop end program select_type_23 lfortran-0.63.0/integration_tests/gpu_metal_112.f900000664000175000017500000000117415174404631022250 0ustar alastairalastairprogram gpu_metal_112 implicit none integer, parameter :: n = 4 real :: a(n, 2), z(n, 2) integer :: i, l z = 2.0 a = 0.0 do concurrent (i = 1:2) do l = 1, 2 a(1:n, l) = f(z(1:n, l)) end do end do if (abs(a(1,1) - 3.0) > 1e-6) error stop if (abs(a(2,1) - 3.0) > 1e-6) error stop if (abs(a(3,1) - 3.0) > 1e-6) error stop if (abs(a(4,1) - 3.0) > 1e-6) error stop if (abs(a(1,2) - 3.0) > 1e-6) error stop if (abs(a(4,2) - 3.0) > 1e-6) error stop print *, "PASSED" contains elemental function f(x) result(y) real, intent(in) :: x real :: y y = x + 1.0 end function end program lfortran-0.63.0/integration_tests/associate_44.f900000664000175000017500000000104315174404631022165 0ustar alastairalastairprogram associate_44 implicit none integer :: n n = 3 associate(m => n) block logical :: p(m) p = .true. if (.not. all(p)) error stop if (size(p) /= 3) error stop end block end associate n = 5 associate(m => n) block integer :: a(m) a = 7 if (a(1) /= 7) error stop if (a(5) /= 7) error stop if (sum(a) /= 35) error stop end block end associate print *, "ok" end program lfortran-0.63.0/integration_tests/legacy_array_sections_21.f900000664000175000017500000000134715174404631024565 0ustar alastairalastairmodule las21_m1 implicit none contains subroutine set_val(a, lda, val) integer, intent(in) :: lda real, intent(inout) :: a(lda, *) real, intent(in) :: val a(1, 1) = val a(1, 2) = val end subroutine end module module las21_m2 use las21_m1 implicit none contains subroutine caller(a, lda) integer, intent(in) :: lda real, intent(inout) :: a(lda, *) call set_val(a(2, 2), lda, 99.0) end subroutine end module program legacy_array_sections_21 use las21_m2 implicit none real :: A(3,3) A = 0.0 call caller(A, 3) print *, A(2,2) print *, A(2,3) if (A(2,2) /= 99.0) error stop if (A(2,3) /= 99.0) error stop end program lfortran-0.63.0/integration_tests/implied_do_loops10.f900000664000175000017500000000044515174404631023372 0ustar alastairalastairprogram implied_do_loop10 implicit none integer :: i type :: col integer :: rgb(3) end type col type(col) :: colours data (colours%rgb(i), i=1, 3) /1, 2, 3/ print *, "colours%rgb : ", colours%rgb if (any(colours%rgb /= [1, 2, 3])) error stop end program lfortran-0.63.0/integration_tests/separate_compilation_22a.f900000664000175000017500000000034615174404631024556 0ustar alastairalastairmodule math_separate_compilation_22 implicit none interface logspace module subroutine logspace_sub(n) integer, intent(inout) :: n end subroutine logspace_sub end interface end modulelfortran-0.63.0/integration_tests/transfer_21.f900000664000175000017500000000030615174404631022032 0ustar alastairalastairprogram transfer_21 implicit none integer(1) :: arr(4) integer(4) :: res(1) arr = [1_1, 2_1, 3_1, 4_1] res = transfer(arr(1:4), [0_4]) print *, res(1) if (res(1) /= 67305985) error stop end program lfortran-0.63.0/integration_tests/pointer_03.f900000664000175000017500000000070415174404631021670 0ustar alastairalastairmodule test_pointer_association implicit none integer, target :: i contains function mergei32() result(r) integer, pointer :: r i=5 r=>i end function end module program pointer_03 use test_pointer_association implicit none integer, pointer :: r r=>mergei32() if (r /= 5) then print *, "Test failed: r does not point to the expected value" error stop end if end programlfortran-0.63.0/integration_tests/string_07.f900000664000175000017500000000126015174404631021520 0ustar alastairalastairmodule string_07_mod implicit none contains integer pure function some_fn(a) result(r) integer, intent(in) :: a r = a end function end module program string_07 use string_07_mod implicit none print *, f1(3) if (len(f1(3)) /= 3) error stop print *, f1(7) if (len(f1(7)) /= 7) error stop print *, f2(3) if (len(f2(3)) /= 3) error stop print *, f2(7) if (len(f2(7)) /= 7) error stop contains function f1(n) result(r) integer, intent(in) :: n character(len=n) :: r integer :: i do i = 1, n r(i:i) = "a" end do end function function f2(n) result(r) integer, intent(in) :: n character(len=some_fn(n)) :: r integer :: i do i = 1, n r(i:i) = "a" end do end function end program lfortran-0.63.0/integration_tests/file_54.f900000664000175000017500000000135515174404631021140 0ustar alastairalastairprogram daio6 implicit none character(*), parameter :: fn = 'fort.42' integer, parameter :: daunit = 42 integer :: darl, danr integer :: idata darl = 5 open (daunit, file=fn, access='direct', recl=darl, form='unformatted') inquire (unit=daunit, nextrec=danr) if (danr /= 1) error stop inquire (file=fn, NEXTREC=danr) if (danr /= 1) error stop idata = 42 write (daunit, rec=1) idata inquire (unit=daunit, nextrec=danr) if (danr /= 2) error stop inquire (file=fn, NEXTREC=danr) if (danr /= 2) error stop ! Read a record read (daunit, rec=1) idata inquire (unit=daunit, nextrec=danr) if (danr /= 2) error stop inquire (file=fn, nextrec=danr) if (danr /= 2) error stop close (daunit) end program lfortran-0.63.0/integration_tests/modules_09.f900000664000175000017500000000015215174404631021663 0ustar alastairalastairprogram modules_09 use modules_09_a, only: a implicit none if (a() /= 13) error stop print *, "OK" end lfortran-0.63.0/integration_tests/template_vector.f900000664000175000017500000000321215174404631023100 0ustar alastairalastairmodule template_vector_m implicit none private public :: vector_t, main template vector_t(T) type, deferred :: T public :: Vector type :: Vector type(T), allocatable :: elements(:) integer :: sz = 0 contains procedure :: resize procedure :: push_back end type contains subroutine push_back(this, item) class(Vector), intent(in) :: this type(T), intent(in) :: item integer :: new_size new_size = this%sz + 1 call this%resize(new_size) this%elements(new_size) = item this%sz = new_size end subroutine subroutine resize(this, n) class(Vector), intent(inout) :: this integer, intent(in) :: n type(T), allocatable :: tmp(:) integer :: i if (.not. allocated(this%elements)) then allocate(this%elements(n)) return end if if (this%sz >= n) return allocate(tmp(this%sz)) do i = 1, this%sz tmp(i) = this%elements(i) end do allocate(this%elements(n)) this%elements(1:this%sz) = tmp end subroutine end template contains subroutine main() instantiate vector_t(integer), only: IntVector => Vector type(IntVector) :: v call v%push_back(10) if (v%elements(1) /= 10) error stop end subroutine end module program template_vector use template_vector_m implicit none call main() end program lfortran-0.63.0/integration_tests/global_array_01.f900000664000175000017500000000110015174404631022633 0ustar alastairalastairmodule global_array_module implicit none integer(4), dimension(2) :: arr = [105, 109] end module global_array_module program test_global_array use global_array_module, only: arr implicit none integer :: i integer :: s i = 1 print *, arr if (all(arr /= [105, 109])) error stop s = sum(arr) print *, s if (s /= 214) error stop print *, arr(i) if (arr(i) /= 105) error stop arr(i) = 210 print *, arr(i) if (arr(i) /= 210) error stop print *, arr if (all(arr /= [210, 109])) error stop end program test_global_array lfortran-0.63.0/integration_tests/class_123.f900000664000175000017500000000244515174404631021404 0ustar alastairalastairmodule class_123_mod implicit none type, abstract :: AbsType integer :: val contains procedure(multintfc), deferred :: mult generic :: operator(*) => mult end type AbsType abstract interface function multintfc(a, b) result(r) import class(AbsType), intent(in) :: a class(*), intent(in) :: b class(AbsType), allocatable :: r end function multintfc end interface type, extends(AbsType) :: ConcreteType contains procedure :: mult => concrete_mult end type ConcreteType contains function concrete_mult(a, b) result(r) class(ConcreteType), intent(in) :: a class(*), intent(in) :: b class(AbsType), allocatable :: r allocate(ConcreteType :: r) select type (b) type is (real(8)) r%val = int(a%val * b) class default r%val = 0 end select end function concrete_mult subroutine test(d) class(AbsType), intent(in) :: d class(AbsType), allocatable :: c allocate(c, source = (d * 8.d0)) print *, c%val if (c%val /= 40) error stop end subroutine test end module class_123_mod program class_123 use class_123_mod type(ConcreteType) :: obj obj%val = 5 call test(obj) end program class_123 lfortran-0.63.0/integration_tests/binop_03.f900000664000175000017500000000041115174404631021312 0ustar alastairalastairprogram binop_03 integer(8) :: x real(8) :: y x = 665663010 x = x**2 print *, x if(x /= 443107242882260100_8) error stop y = 665663010 y = y**2 print *, y if(abs(y - 443107242882260100_8) > 10e-20) error stop end programlfortran-0.63.0/integration_tests/symbol_table_jloop_01.f900000664000175000017500000000061715174404631024070 0ustar alastairalastairmodule symbol_table_jloop_01_m integer, parameter :: jloop = 1 type t integer :: kntf(jloop:jloop) end type t end module program p use symbol_table_jloop_01_m implicit none type(t) :: x if (lbound(x%kntf, 1) /= jloop) error stop 1 if (ubound(x%kntf, 1) /= jloop) error stop 2 x%kntf(jloop) = 42 if (x%kntf(jloop) /= 42) error stop 3 end program p lfortran-0.63.0/integration_tests/namelist_08.f900000664000175000017500000000372015174404631022032 0ustar alastairalastairprogram namelist_multi_groups implicit none ! Variables for first group integer :: a, b ! Variables for second group real :: x, y ! Variables for third group character(len=10) :: name1, name2 ! Define three separate namelist groups namelist /group1/ a, b namelist /group2/ x, y namelist /group3/ name1, name2 ! Initialize group1 variables a = 100 b = 200 ! Initialize group2 variables x = 1.5 y = 2.5 ! Initialize group3 variables name1 = 'hello' name2 = 'world' ! Write each group to separate files open(unit=11, file='namelist_group1.dat', status='replace', form='formatted') write(11, nml=group1) close(11) open(unit=12, file='namelist_group2.dat', status='replace', form='formatted') write(12, nml=group2) close(12) open(unit=13, file='namelist_group3.dat', status='replace', form='formatted') write(13, nml=group3) close(13) ! Reset all variables a = 0 b = 0 x = 0.0 y = 0.0 name1 = '' name2 = '' ! Read each group from respective files open(unit=11, file='namelist_group1.dat', status='old', form='formatted') read(11, nml=group1) close(11) open(unit=12, file='namelist_group2.dat', status='old', form='formatted') read(12, nml=group2) close(12) open(unit=13, file='namelist_group3.dat', status='old', form='formatted') read(13, nml=group3) close(13) ! Verify group1 values if (a /= 100) error stop "Variable a mismatch" if (b /= 200) error stop "Variable b mismatch" ! Verify group2 values if (abs(x - 1.5) > 1.0e-5) error stop "Variable x mismatch" if (abs(y - 2.5) > 1.0e-5) error stop "Variable y mismatch" ! Verify group3 values if (trim(name1) /= 'hello') error stop "Variable name1 mismatch" if (trim(name2) /= 'world') error stop "Variable name2 mismatch" print *, "Multiple namelist groups test passed!" end program namelist_multi_groups lfortran-0.63.0/integration_tests/optional_02.f900000664000175000017500000000342715174404631022041 0ustar alastairalastairprogram optional_02 implicit none type :: file_scope_flag character(len=:), allocatable :: file_name character(len=:), allocatable :: flags end type file_scope_flag type :: profile_config_t character(len=:), allocatable :: profile_name character(len=:), allocatable :: compiler integer :: os_type character(len=:), allocatable :: flags character(len=:), allocatable :: c_flags character(len=:), allocatable :: cxx_flags character(len=:), allocatable :: link_time_flags type(file_scope_flag), allocatable :: file_scope_flags(:) logical :: is_built_in end type profile_config_t type :: error_t character(len=:), allocatable :: message end type error_t integer, parameter :: OS_ALL = -1 contains function new_profile(profile_name, compiler, os_type, flags, c_flags, cxx_flags, & link_time_flags, file_scope_flags, is_built_in) result(profile) character(len=*), intent(in) :: profile_name character(len=*), intent(in) :: compiler integer, intent(in) :: os_type character(len=*), optional, intent(in) :: flags character(len=*), optional, intent(in) :: c_flags character(len=*), optional, intent(in) :: cxx_flags character(len=*), optional, intent(in) :: link_time_flags type(file_scope_flag), optional, intent(in) :: file_scope_flags(:) logical, optional, intent(in) :: is_built_in type(profile_config_t) :: profile end function new_profile function get_default_profiles(error) result(default_profiles) type(error_t), allocatable, intent(out) :: error type(profile_config_t), allocatable :: default_profiles(:) default_profiles = [new_profile('release', & & 'caf', & & OS_ALL, & & flags=' -O3 -Wimplicit-interface -fPIC -fmax-errors=1 -funroll-loops', & & is_built_in=.true.)] end function get_default_profiles end program lfortran-0.63.0/integration_tests/gpu_metal_144_mod.f900000664000175000017500000000105115174404631023106 0ustar alastairalastairmodule gpu_metal_144_constants implicit none integer, parameter :: offset_val = 10 end module module gpu_metal_144_m implicit none interface pure module function compute(x) result(y) integer, intent(in) :: x integer :: y end function end interface end module submodule(gpu_metal_144_m) gpu_metal_144_impl use gpu_metal_144_constants, only : offset_val implicit none contains pure module function compute(x) result(y) integer, intent(in) :: x integer :: y y = x + offset_val end function end submodule lfortran-0.63.0/integration_tests/count_param_01.f900000664000175000017500000000046615174404631022523 0ustar alastairalastairprogram count_param_01 implicit none integer, parameter :: iarray(4) = [1,2,4,4], nmax = size(iarray), & n = nmax - count(iarray(1:nmax-1)==iarray(2:nmax)) if (nmax /= 4) error stop if (n /= 3) error stop print "(2(A,1X,I0),*(1X,I0))", 'n =', n, ' iarray =', iarray end program count_param_01 lfortran-0.63.0/integration_tests/common_32.f900000664000175000017500000000126515174404631021505 0ustar alastairalastairprogram common_32 ! Test that COMMON block split across multiple statements in different ! program units is handled correctly (size check deferred until all ! statements for the block are processed). implicit none integer :: i1, i2 real :: r1, r2 common /block/ i1, i2 real :: x common x /block/ r1, r2 x = 42.42 call sub () if (i1 + i2 /= 579) error stop if (abs(r1 + r2) >= 0.0001) error stop end program subroutine sub () implicit none integer :: i1, i2 real :: r1, r2 common /block/ i1, i2 common /block/ r1, r2 real :: x common // x if (abs(x - 42.42) >= 0.0001) error stop i1 = 123 i2 = 456 r1 = 3.14 r2 = -3.14 end subroutine lfortran-0.63.0/integration_tests/volatile_02.f900000664000175000017500000000015115174404631022022 0ustar alastairalastairprogram volatile_02 implicit none real, volatile :: iota_2 = 1 / 2.0 print *, iota_2 end programlfortran-0.63.0/integration_tests/common_29.f900000664000175000017500000000027415174404631021512 0ustar alastairalastairprogram common_29 common /block/ t integer :: t integer :: i, s t = 5 if (t /= 5) error stop s = 0 do, i = 1, t s = s + i end do if (s /= 15) error stop end program lfortran-0.63.0/integration_tests/class_36.f900000664000175000017500000000266115174404631021327 0ustar alastairalastairmodule class_36_module type :: SomeType integer :: x = 2 contains procedure, pass :: subroutine_pass procedure, nopass :: subroutine_nopass procedure, pass :: function_pass procedure, nopass :: function_nopass end type SomeType contains subroutine subroutine_pass(self, var) class(SomeType), intent(in) :: self real(8), intent(out) :: var print *, "var inside subroutine_pass: ", var if (var /= 16.33) error stop var = 32.33 call self%subroutine_nopass(var) end subroutine subroutine_pass subroutine subroutine_nopass(var) real(8), intent(out) :: var print *, "var inside subroutine_nopass: ", var if (var /= 32.33) error stop var = 64.33 end subroutine subroutine_nopass integer function function_pass (self) class(SomeType) :: self function_pass = self%x end function function_pass integer function function_nopass (var) integer :: var function_nopass = var end function function_nopass end module class_36_module program class_36 use class_36_module implicit none type(SomeType) :: my_var real(8) :: r r = 16.33 call my_var%subroutine_pass(r) print *, "r after subroutine call: ", r if (r /= 64.33) error stop print *, "return from function_pass: ", function_pass(my_var) print *, "return from function_nopass: ", function_nopass(42) end programlfortran-0.63.0/integration_tests/gpu_metal_94.f900000664000175000017500000000210515174404631022174 0ustar alastairalastairprogram gpu_metal_94 ! matmul combined with array addition inside do concurrent implicit none integer :: i real :: a(2), z(2), w(2,2), b(2) ! Matrix-vector matmul + addition: z = matmul(w, a) + b w(1,1) = 1.0; w(2,1) = 0.0 w(1,2) = 0.0; w(2,2) = 1.0 a(1) = 1.0; a(2) = 2.0 b(1) = 10.0; b(2) = 20.0 do concurrent (i = 1:1) z = matmul(w, a) + b end do ! z = [1,2] + [10,20] = [11,22] if (abs(z(1) - 11.0) > 1.0e-5) error stop if (abs(z(2) - 22.0) > 1.0e-5) error stop ! Matrix-vector matmul - subtraction b(1) = 1.0; b(2) = 2.0 do concurrent (i = 1:1) z = matmul(w, a) - b end do ! z = [1,2] - [1,2] = [0,0] if (abs(z(1)) > 1.0e-5) error stop if (abs(z(2)) > 1.0e-5) error stop ! Matrix-vector matmul + addition with non-identity matrix w(1,1) = 1.0; w(2,1) = 3.0 w(1,2) = 2.0; w(2,2) = 4.0 a(1) = 5.0; a(2) = 6.0 b(1) = 0.5; b(2) = 0.5 do concurrent (i = 1:1) z = matmul(w, a) + b end do ! matmul: z1 = 1*5+2*6=17, z2 = 3*5+4*6=39 ! + b: z1 = 17.5, z2 = 39.5 if (abs(z(1) - 17.5) > 1.0e-5) error stop if (abs(z(2) - 39.5) > 1.0e-5) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/implicit_typing_08.f900000664000175000017500000000107615174404631023424 0ustar alastairalastairprogram implicit_typing_08 implicit logical (l) ! Test that statement functions correctly access local variables ! with implicit typing from the enclosing scope. ist_add (i) = i + j rst_add (ri) = ri + rj lst_or (li) = li .or. lj ist_identity () = identity j = 40 k = ist_add (2) if (k /= 42) error stop rj = -41.5 rk = rst_add (-0.5) if (abs (rk + 42.0) > 0.01) error stop lj = .true. lk = lst_or (.false.) if (.not. lk) error stop identity = -42 k = ist_identity () if (k /= -42) error stop end program lfortran-0.63.0/integration_tests/multi_file_member_access_01_mod.f900000664000175000017500000000067715174404631026057 0ustar alastairalastairmodule member_access_mod implicit none type :: string_buffer integer, private :: size = 0 integer, private :: arr(1) = 0 contains procedure :: number_of_elems end type string_buffer contains function number_of_elems(self) result(result) class(string_buffer), intent(in) :: self integer :: result result = self%size result = result + self%arr(1) end function number_of_elems end module member_access_mod lfortran-0.63.0/integration_tests/common_25.f900000664000175000017500000000100315174404631021475 0ustar alastairalastair! Test COMMON block sharing between host and contained procedures program common_25 implicit none integer :: val1, val2 common /testblock/ val1, val2 val1 = 42 val2 = 100 call modify_common() if (val1 /= 99) error stop if (val2 /= 200) error stop contains subroutine modify_common() integer :: v1, v2 common /testblock/ v1, v2 if (v1 /= 42) error stop if (v2 /= 100) error stop v1 = 99 v2 = 200 end subroutine end program lfortran-0.63.0/integration_tests/assumed_type_01.f900000664000175000017500000000103015174404631022701 0ustar alastairalastairmodule assumed_type_01_mod implicit none contains subroutine sub_assumed_type(a) type(*), intent(in) :: a end subroutine subroutine sub_assumed_type_array(a) type(*), intent(inout), target :: a(:) end subroutine subroutine sub_assumed_type_assumed_rank(a) type(*), intent(inout), target :: a(..) end subroutine end module program assumed_type_01 use assumed_type_01_mod implicit none integer :: x x = 42 call sub_assumed_type(x) print *, "ok" end program lfortran-0.63.0/integration_tests/class_44.f900000664000175000017500000000070015174404631021316 0ustar alastairalastairmodule class_44_mod type, abstract :: SomeType end type SomeType type :: OtherType contains procedure :: method end type OtherType contains recursive subroutine method(self,arr) class(OtherType), intent(inout) :: self class(SomeType), intent(inout) :: arr(:) call self%method(arr) end subroutine method end module class_44_mod program class_44 use class_44_mod end program class_44lfortran-0.63.0/integration_tests/subroutines_13.f900000664000175000017500000000046015174404631022572 0ustar alastairalastairprogram subroutines_13 character(20) :: cmd integer :: a integer :: b CALL get_command(cmd, a, b) print *, cmd print *, a print *, b CALL get_command(cmd, a) print *, cmd print *, a CALL get_command(cmd) print *, cmd CALL get_command() end program lfortran-0.63.0/integration_tests/allocate_61.f900000664000175000017500000000041515174404631021777 0ustar alastairalastairprogram allocate_61 use allocate_61_allocmod, only: alloc_source use allocate_61_mymod, only: w implicit none type(w) :: obj call alloc_source(obj) if (.not. allocated(obj%a)) error stop if (obj%a%x /= 10) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/intrinsics_01.f900000664000175000017500000000100015174404631022361 0ustar alastairalastairprogram intrinsics_01 integer, parameter :: dp = kind(0.d0) real(dp) :: a, b, c(4) integer :: i a = 1.1_dp b = 1.2_dp if (b-a > 0.2_dp) error stop if (abs(b-a) > 0.2_dp) error stop if (abs(a-b) > 0.2_dp) error stop a = 4._dp if (abs(sqrt(a)-2._dp) > 1e-12_dp) error stop a = 4._dp if (abs(log(a)-1.3862943611198906_dp) > 1e-12_dp) error stop c(1) = -1._dp c(2) = -1._dp c(3) = -1._dp c(4) = -1._dp call random_number(c) do i = 1, 4 if (c(i) < 0._dp) error stop if (c(i) > 1._dp) error stop end do end lfortran-0.63.0/integration_tests/save_14.f900000664000175000017500000000074115174404631021151 0ustar alastairalastairprogram save_14 ! Test that save variables of derived types with default component ! initialization retain their values between calls (not re-initialized). implicit none type :: dt integer :: val = 0 end type call s() call s() contains subroutine s() type(dt), save :: x logical, save :: first = .true. if (first) then first = .false. x%val = 42 end if if (x%val /= 42) error stop print *, x%val end subroutine end program lfortran-0.63.0/integration_tests/pass_array_by_data_13.f900000664000175000017500000000104315174404631024035 0ustar alastairalastairprogram pass_array_by_data_13 implicit none integer :: iseed(4) integer :: n real, allocatable :: work(:,:) allocate(work(3, 5)) iseed = [1, 2, 3, 4] n = 15 call slarnv(2, iseed, n, work) if (abs(work(1, 1) - 2.0) > 1e-6) error stop end program pass_array_by_data_13 subroutine slarnv(idist, iseed, n, x) implicit none integer, intent(in) :: idist integer, intent(inout) :: iseed(*) integer, intent(in) :: n real, intent(inout) :: x(*) if (n > 0) x(1) = 2.0 end subroutine slarnv lfortran-0.63.0/integration_tests/fixed_form_select_case_01.f900000664000175000017500000000062415174404631024663 0ustar alastairalastair program fixed_form_select_case_01 integer :: i, r r = 0 do 50 i = 1, 5 select case ( i ) case (1) r = r + 1 case ( 2 : 3 ) r = r + 10 case default r = r + 100 end select 50 continue if (r /= 221) error stop print *, r end lfortran-0.63.0/integration_tests/elemental_19.f900000664000175000017500000000261115174404631022164 0ustar alastairalastair! Test elemental intrinsics on multi-dimensional parameter arrays. ! Verifies that aimag, abs, and real preserve the rank of the input. program elemental_19 implicit none integer, parameter :: sp = kind(1.0) ! 2D complex parameter array complex(sp), parameter :: z(2, 3) = reshape([ & (1., 2.), (3., 4.), (5., 6.), (7., 8.), (9., 10.), (11., 12.) & ], [2, 3]) ! 2D integer parameter array integer, parameter :: a(2, 3) = reshape([1, -2, 3, -4, 5, -6], [2, 3]) real(sp) :: yr(2, 3), yi(2, 3) integer :: ai(2, 3) ! aimag on 2D parameter must preserve rank 2 yi = aimag(z) if (any(shape(yi) /= [2, 3])) error stop if (abs(yi(1,1) - 2.) > 1e-6) error stop if (abs(yi(2,1) - 4.) > 1e-6) error stop if (abs(yi(1,2) - 6.) > 1e-6) error stop if (abs(yi(2,3) - 12.) > 1e-6) error stop ! real() on 2D parameter must preserve rank 2 yr = real(z) if (any(shape(yr) /= [2, 3])) error stop if (abs(yr(1,1) - 1.) > 1e-6) error stop if (abs(yr(2,1) - 3.) > 1e-6) error stop if (abs(yr(1,3) - 9.) > 1e-6) error stop ! abs() on 2D integer parameter must preserve rank 2 ai = abs(a) if (any(shape(ai) /= [2, 3])) error stop if (ai(1,1) /= 1) error stop if (ai(2,1) /= 2) error stop if (ai(1,2) /= 3) error stop if (ai(2,2) /= 4) error stop if (ai(2,3) /= 6) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/intrinsics_119.f900000664000175000017500000000045715174404631022472 0ustar alastairalastairprogram intrinsics_119 integer :: x(5) = [ 1, 2, 3, 4 ,5 ] logical :: mask(5) = [ .TRUE., .FALSE., .TRUE., .FALSE., .TRUE. ] if ( .not. sum( array = x, mask = mask ) == 9 ) error stop if ( .not. sum( x, mask = mask ) == 9 ) error stop if ( .not. sum( x, mask ) == 9 ) error stop end lfortran-0.63.0/integration_tests/file_57.f900000664000175000017500000000130615174404631021137 0ustar alastairalastairprogram file_57 ! Test unformatted stream write/read of a character array implicit none character(5) :: a(2), b(2) integer :: unit, n a(1) = 'hello' a(2) = 'world' ! Write character array to unformatted stream file open(newunit=unit, file='file_57.bin', status='replace', & action='write', access='stream') write(unit) a inquire(unit, pos=n) close(unit) ! 2 elements * 5 chars = 10 bytes; file position should be 11 (10+1) if (n /= 11) error stop ! Read it back and verify open(newunit=unit, file='file_57.bin', status='old', & action='read', access='stream') read(unit) b close(unit, status='delete') if (b(1) /= 'hello') error stop if (b(2) /= 'world') error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/parameter_09.f900000664000175000017500000000155015174404631022176 0ustar alastairalastairprogram parameter_09 real, parameter :: D(*) = [1.0, 2.0] + 2.0 real, parameter :: A(*) = sin(D) * 9.0 integer, parameter :: B(*) = [1, 2] + 2 real, parameter :: C(*) = sin(A) + cos(D) * 3.15 / 2.0 real, parameter :: E(*) = [1.0, 2.0] + [2.0, 3.0] complex, parameter :: F(*) = [(1.0, 2.0), (3.0, 4.0), (124.1, 14.5)] + [(5.0, 6.0), (7.0, 8.0), (7.0, 8.0)] complex , parameter :: G(*) = 3.0 / cos(C) + tan(A) * 6.0 / sin(D) print *, sum(A) if (abs(sum(A) - (-5.54114246)) > 1e-6) error stop print *, sum(D) if (abs(sum(D) - 7.0) > 1e-8) error stop print *, sum(B) if (sum(B) /= 7) error stop print *, sum(C) if (abs(sum(C) - (-2.13744116)) > 1e-6) error stop print *, sum(E) if (abs(sum(E) - 8.0) > 1e-8) error stop print *, abs(sum(F)) if (abs(abs(sum(F)) - 153.116501) > 1e-5) error stop print *, abs(sum(G)) if (abs(abs(sum(G)) - 225.452) > 1e-3) error stop end program lfortran-0.63.0/integration_tests/cpp_pre_13.f900000664000175000017500000000047715174404631021650 0ustar alastairalastairprogram cpp_pre_13 implicit none ! Test null preprocessing directive (C99 6.10.7 / C23 6.10.9) ! A line with just "#" or "# /* comment */" should be silently ignored. # # /* this is a CPP comment. It is erased regardless of the base language */ integer :: x x = 42 if (x /= 42) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/intrinsics_273.f900000664000175000017500000000361215174404631022467 0ustar alastairalastairprogram intrinsic_273 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp), parameter :: res_1(5) = dprod([5.2, 3.2, -4.1, 9.8, 5.6], [6.12, 39.2, -41.1, 32.1, 4.5]) real(dp), parameter :: res_2(5) = dprod([5.2, 3.2, -4.1, 9.8, 5.6], 5.2) real(dp), parameter :: res_3(5) = dprod(5.2, [6.12, 39.2, -41.1, 32.1, 4.5]) real(sp) :: x(5) = [5.2, 3.2, -4.1, 9.8, 5.6] real(sp) :: y(5) = [6.12, 39.2, -41.1, 32.1, 4.5] real(sp) :: z(5) = [6.12, 39.2, -41.1, 32.1, 4.5] real(sp) :: u = 5.2 real(dp) :: run_x(5) real(dp) :: run_y(5) real(dp) :: run_z(5) real(dp) :: expected_1(5) = [3.18239982376098851e+01, 1.25440004310607947e+02, 1.68509989824295189e+02, & 3.14579991168975539e+02, 2.51999995708465576e+01] real(dp) :: expected_2(5) = [2.70399990081787109e+01, 1.66400002479553244e+01, -2.13199995040893562e+01, & 5.09600009918212891e+01, 2.91199995040893569e+01] real(dp) :: expected_3(5) = [3.18239994049072266e+01, 2.03840003967285156e+02, -2.13719992065429693e+02, & 1.66919982910156250e+02, 2.33999996185302734e+01] do i = 1, 5 print *, res_1(i) if (abs(res_1(i) - expected_1(i)) > 1e-5) error stop end do do i = 1, 5 print *, res_2(i) if (abs(res_2(i) - expected_2(i)) > 1e-5) error stop end do do i = 1, 5 print *, res_3(i) if (abs(res_3(i) - expected_3(i)) > 1e-5) error stop end do run_x = dprod(x, y) run_y = dprod(x, u) run_z = dprod(u, z) do i = 1, 5 print *, run_x(i) if (abs(run_x(i) - expected_1(i)) > 1e-5) error stop end do do i = 1, 5 print *, run_y(i) if (abs(run_y(i) - expected_2(i)) > 1e-5) error stop end do do i = 1, 5 print *, run_z(i) if (abs(run_z(i) - expected_3(i)) > 1e-5) error stop end do end program lfortran-0.63.0/integration_tests/procedure_11.f900000664000175000017500000000075115174404631022201 0ustar alastairalastairmodule procedure_11_mod contains subroutine say_something(message) character(len=*),intent(in) :: message print *, message if (message /= "Hello from proc!") error stop end subroutine end module program procedure_11 use procedure_11_mod procedure(say_something), pointer :: proc procedure(say_something), pointer :: proc2 => say_something proc => say_something call proc("Hello from proc!") call proc2("Hello from proc!") end program procedure_11lfortran-0.63.0/integration_tests/exponent_inf_01.f900000664000175000017500000000065715174404631022711 0ustar alastairalastairprogram exponent_inf_01 implicit none real :: inf, ninf, nan_val character(len=3) :: cinf = 'INF' character(len=4) :: cninf = '-INF' character(len=3) :: cnan = 'NaN' read(cinf, *) inf read(cninf, *) ninf read(cnan, *) nan_val if (exponent(inf) /= huge(0)) error stop if (exponent(ninf) /= huge(0)) error stop if (exponent(nan_val) /= huge(0)) error stop end program exponent_inf_01lfortran-0.63.0/integration_tests/openmp_06.f900000664000175000017500000000201315174404631021504 0ustar alastairalastairsubroutine increment_ctr(n, ctr) use omp_lib implicit none integer, intent(in) :: n integer, intent(inout) :: ctr integer :: local_ctr integer :: i local_ctr = 0 !$omp parallel private(i) reduction(+:local_ctr) !$omp do do i = 1, n local_ctr = local_ctr + 1 end do !$omp end do ! the following condition shall be true almost always ! if (local_ctr > ( n / omp_get_max_threads()) + 5) error stop ! TODO: fix this, it was previously wrong in LFortran. ! With this PR, we get correct ASR and thus error stop is triggered, previously the ASR node was before ! the parallel region and thus the error stop was not triggered. ! To fix this we need to parallelize the if statement, which is not supported yet. ! Refer: https://github.com/lfortran/lfortran/issues/4147 to fix it !$omp end parallel ctr = ctr + local_ctr end subroutine program openmp_06 use omp_lib integer, parameter :: n = 1000000 integer :: ctr call omp_set_num_threads(8) ctr = 0 call increment_ctr(n, ctr) print *, ctr if (ctr /= 1000000) error stop end program lfortran-0.63.0/integration_tests/template_sort_02.f900000664000175000017500000000526015174404631023073 0ustar alastairalastairmodule template_sort_02_type implicit none public :: my_type, my_type_lt type my_type real :: d end type contains pure elemental function lt_my_type(lhs, rhs) result(res) type(my_type), intent(in) :: lhs, rhs logical :: res res = lhs%d <= rhs%d end function end module module template_sort_02_m use template_sort_02_type implicit none requirement op_r(T, U, V, op_func) type, deferred :: T type, deferred :: U type, deferred :: V pure elemental function op_func(lhs, rhs) result(res) type(T), intent(in) :: lhs type(T), intent(in) :: rhs type(V) :: res end function end requirement contains subroutine swap {T} (lhs, rhs) type, deferred :: T type(T), intent(inout) :: lhs type(T), intent(inout) :: rhs type(T) :: tmp tmp = lhs lhs = rhs rhs = tmp end subroutine ! non-generic reference recursive subroutine quicksort {T, lt} (arr, low, high) require :: op_r(T, T, logical, lt) type(T), intent(inout) :: arr(:) integer, intent(in) :: low, high integer :: i, last type(T) :: pivot if (low < high) then pivot = arr(high) last = low - 1 do i = low, high - 1 if (lt(arr(i), pivot)) then last = last + 1 call swap{T}(arr(last), arr(i)) end if end do call swap{T}(arr(last + 1), arr(high)) call quicksort(arr, low, last) call quicksort(arr, last + 2, high) end if end subroutine pure elemental function lt_real(lhs, rhs) result(res) real, intent(in) :: lhs real, intent(in) :: rhs logical :: res res = lhs < rhs end function pure elemental function lt_integer(lhs, rhs) result(res) integer, intent(in) :: lhs integer, intent(in) :: rhs logical :: res res = lhs < rhs end function subroutine test_template() integer :: xi(10), i real :: xr(10) type(my_type) :: xm(10) xi = [2,4,1,5,6,24,51,3,42,2] xr = [2,4,1,5,6,24,51,3,42,2] do i = 1, 10 xm(i) = my_type(xr(i)) end do call quicksort{integer, lt_integer}(xi, 1, 10) call quicksort{real, lt_real}(xr, 1, 10) call quicksort{my_type, lt_my_type}(xm, 1, 10) print *, xi print *, xr print *, xm end subroutine end module program template_sort_02 use template_sort_02_m implicit none call test_template() end programlfortran-0.63.0/integration_tests/intrinsics_245.f900000664000175000017500000000100115174404631022454 0ustar alastairalastairprogram intrinsics_245 implicit none complex :: complex_arg, result complex_arg = cmplx(real(1.0, kind=4), 0.0) result = cmplx(complex_arg, kind = 8) print *, result if (result /= (1.0, 0.0)) error stop print *, cmplx(real(1, kind=4), 0.00000000, kind=8) if (cmplx(real(1, kind=4), 0.00000000, kind=8) /= (1.0, 0.0)) error stop print *, cmplx(1.00000000, real(0, kind=4), kind=8) if (cmplx(1.00000000, real(0, kind=4), kind=8) /= (1.0, 0.0)) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_163.f900000664000175000017500000000101215174404631022245 0ustar alastairalastair! Test: sum() inside if-guard within do concurrent GPU offload. ! Previously, the GPU offload pass did not recurse into If statement ! bodies when inlining sum(), causing a call to _lcompilers_Sum ! (unavailable in Metal shader). program gpu_metal_163 implicit none integer :: pair real :: vals(3, 4), pair_cost(4) vals = 0.5 do concurrent (pair = 1:4) if (.true.) pair_cost(pair) = sum(vals(:, pair)) end do do pair = 1, 4 if (abs(pair_cost(pair) - 1.5) > 1.0e-5) error stop end do print *, "PASS" end program lfortran-0.63.0/integration_tests/allocate_35.f900000664000175000017500000000247415174404631022007 0ustar alastairalastair! Test for realloc-lhs-arrays with empty array constructors ! This tests that assigning an empty array to an allocatable array ! correctly allocates the array with size 0 (still considered allocated) program allocate_35 implicit none logical, allocatable :: subtally(:) integer, allocatable :: arr(:) ! First assignment allocates with size 3 subtally = [.true., .false., .true.] if (size(subtally) /= 3) error stop if (.not. allocated(subtally)) error stop if (subtally(1) .neqv. .true.) error stop if (subtally(2) .neqv. .false.) error stop if (subtally(3) .neqv. .true.) error stop ! Second assignment reallocates to size 0 ! This should still keep the array allocated (Fortran semantics) subtally = [logical::] if (size(subtally) /= 0) error stop if (.not. allocated(subtally)) error stop ! Test with integer array as well arr = [1, 2, 3, 4, 5] if (size(arr) /= 5) error stop if (.not. allocated(arr)) error stop ! Reallocate to empty array arr = [integer::] if (size(arr) /= 0) error stop if (.not. allocated(arr)) error stop ! Reallocate back to non-empty arr = [10, 20] if (size(arr) /= 2) error stop if (arr(1) /= 10) error stop if (arr(2) /= 20) error stop print *, "All tests passed!" end program allocate_35 lfortran-0.63.0/integration_tests/select_type_25.f900000664000175000017500000000213115174404631022530 0ustar alastairalastairmodule select_type_25_mod implicit none type :: toml_value end type toml_value type, extends(toml_value) :: toml_keyval integer :: x end type toml_keyval contains recursive subroutine visit(val) class(toml_value), intent(inout) :: val select type(val) class is(toml_keyval) call visit_keyval(val) end select end subroutine visit subroutine visit_keyval(val) type(toml_keyval), intent(inout) :: val val%x = 100 end subroutine visit_keyval end module select_type_25_mod program select_type_25 use select_type_25_mod implicit none class(toml_value), pointer :: obj class(toml_value), allocatable :: obj2 type(toml_keyval), target :: temp obj => temp select type(obj) class is(toml_keyval) call visit(obj) if (obj%x /= 100) error stop allocate(obj2, source=obj) select type(obj2) class is(toml_keyval) if (obj2%x /= 100) error stop class default error stop end select class default error stop end select end program select_type_25 lfortran-0.63.0/integration_tests/modules_15.f900000664000175000017500000001334315174404631021666 0ustar alastairalastairprogram modules_15 use iso_fortran_env, only: sp=>real32, dp=>real64, int32, int64 use modules_15b, only: & f_int_float, f_int_double, & sub_int_float, sub_int_double, & f_int_float_value, f_int_double_value, & sub_int_float_value, sub_int_double_value, & f_int_intarray, f_int_floatarray, f_int_doublearray, & f_int_intarray_star, f_int_floatarray_star, f_int_doublearray_star, & sub_int_intarray, sub_int_floatarray, sub_int_doublearray, & f_int_float_complex, f_int_double_complex, & f_int_float_complex2, f_int_double_complex2, & sub_int_float_complex, sub_int_double_complex, & f_int_float_complex_value, f_int_double_complex_value, & sub_int_float_complex_value, sub_int_double_complex_value, & f_float_complex_value_return, f_double_complex_value_return, & f_int_double_value_name, & sub_int_double_value_name, & f_string, & call_fortran_i32, call_fortran_i64, & call_fortran_f32, call_fortran_f64, & call_fortran_i32_value, call_fortran_i64_value, & call_fortran_i32_value2, call_fortran_i64_value2, & call_fortran_f32_value, call_fortran_f64_value implicit none integer :: i, a, n, I32(3) integer(int32) :: in32 integer(int64) :: in64 real(sp) :: r32, X32(3) real(dp) :: r64, X64(3) complex(sp) :: c32 complex(dp) :: c64 a = 3 r32 = 5 i = f_int_float(a, r32) print *, i if (i /= 8) error stop a = 3 r32 = 5 call sub_int_float(a, r32, i) print *, i if (i /= 8) error stop a = 3 r64 = 5 i = f_int_double(a, r64) print *, i if (i /= 8) error stop a = 3 r64 = 5 call sub_int_double(a, r64, i) print *, i if (i /= 8) error stop a = 3 c32 = (5._sp, 7._sp) i = f_int_float_complex(a, c32) print *, i if (i /= 15) error stop i = f_int_float_complex2(a, c32) print *, i if (i /= 15) error stop a = 3 c32 = (5._sp, 7._sp) call sub_int_float_complex(a, c32, i) print *, i if (i /= 15) error stop a = 3 c32 = (5._sp, 7._sp) i = f_int_float_complex_value(a, c32) print *, i if (i /= 15) error stop c32 = (5._sp, 7._sp) i = f_int_float_complex_value(3, c32) print *, i if (i /= 15) error stop a = 3 c32 = (5._sp, 7._sp) call sub_int_float_complex_value(a, c32, i) print *, i if (i /= 15) error stop c32 = (5._sp, 7._sp) c32 = f_float_complex_value_return(c32) print *, c32 if (abs(real(c32,sp) - 10) > 1e-5_sp) error stop !if (abs(aimag(c32) - 14) > 1e-5_sp) error stop c64 = (5._dp, 7._dp) c64 = f_double_complex_value_return(c64) print *, c64 if (abs(real(c64,dp) - 10) > 1e-10_dp) error stop !if (abs(aimag(c64) - 14) > 1e-10_dp) error stop a = 3 c64 = (5._dp, 7._dp) i = f_int_double_complex(a, c64) print *, i if (i /= 15) error stop i = f_int_double_complex2(a, c64) print *, i if (i /= 15) error stop a = 3 c64 = (5._dp, 7._dp) call sub_int_double_complex(a, c64, i) print *, i if (i /= 15) error stop a = 3 c64 = (5._dp, 7._dp) i = f_int_double_complex_value(a, c64) print *, i if (i /= 15) error stop a = 3 c64 = (5._dp, 7._dp) call sub_int_double_complex_value(a, c64, i) print *, i if (i /= 15) error stop a = 3 r32 = 5 i = f_int_float_value(a, r32) print *, i if (i /= 8) error stop a = 3 r32 = 5 call sub_int_float_value(a, r32, i) print *, i if (i /= 8) error stop a = 3 r64 = 5 i = f_int_double_value(a, r64) print *, i if (i /= 8) error stop i = f_int_double_value_name(a, r64) print *, i if (i /= 8) error stop a = 3 r64 = 5 call sub_int_double_value(a, r64, i) print *, i if (i /= 8) error stop call sub_int_double_value_name(a, r64, i) print *, i if (i /= 8) error stop n = 3 I32(1) = 1 I32(2) = 2 I32(3) = 3 i = f_int_intarray(n, I32) print *, i if (i /= 6) error stop n = 3 I32(1) = 1 I32(2) = 2 I32(3) = 3 call sub_int_intarray(n, I32, i) print *, i if (i /= 6) error stop n = 3 X32(1) = 1.1_dp X32(2) = 2.2_dp X32(3) = 3.3_dp r32 = f_int_floatarray(n, X32) print *, r32 if (abs(r32 - 6.6_sp) > 1e-5_dp) error stop n = 3 X32(1) = 1.1_dp X32(2) = 2.2_dp X32(3) = 3.3_dp call sub_int_floatarray(n, X32, r32) print *, r32 if (abs(r32 - 6.6_sp) > 1e-5_dp) error stop n = 3 X64(1) = 1.1_dp X64(2) = 2.2_dp X64(3) = 3.3_dp r64 = f_int_doublearray(n, X64) print *, r64 if (abs(r64 - 6.6_dp) > 1e-10_dp) error stop n = 3 I32(1) = 1 I32(2) = 2 I32(3) = 3 i = f_int_intarray_star(n, I32) print *, i if (i /= 6) error stop n = 3 X32(1) = 1.1_dp X32(2) = 2.2_dp X32(3) = 3.3_dp r32 = f_int_floatarray_star(n, X32) print *, r32 if (abs(r32 - 6.6_sp) > 1e-5_dp) error stop n = 3 X64(1) = 1.1_dp X64(2) = 2.2_dp X64(3) = 3.3_dp r64 = f_int_doublearray_star(n, X64) print *, r64 if (abs(r64 - 6.6_dp) > 1e-10_dp) error stop n = 3 X64(1) = 1.1_dp X64(2) = 2.2_dp X64(3) = 3.3_dp call sub_int_doublearray(n, X64, r64) print *, r64 if (abs(r64 - 6.6_dp) > 1e-10_dp) error stop print *, f_string("123") if (f_string("123") /= 3) error stop print *, f_string("abcde") if (f_string("abcde") /= 5) error stop print *, f_string(" ") if (f_string(" ") /= 1) error stop print *, f_string("") if (f_string("") /= 0) error stop ! Calling Fortran code from C in32 = 5 in32 = call_fortran_i32(in32) print *, in32 if (in32 /= 7) error stop in32 = 5 in32 = call_fortran_i32_value(in32) print *, in32 if (in32 /= 7) error stop in32 = 5 in32 = call_fortran_i32_value2(in32) print *, in32 if (in32 /= 7) error stop in64 = 5 in64 = call_fortran_i64(in64) print *, in64 if (in64 /= 7) error stop in64 = 5 in64 = call_fortran_i64_value(in64) print *, in64 if (in64 /= 7) error stop in64 = 5 in64 = call_fortran_i64_value2(in64) print *, in64 if (in64 /= 7) error stop r32 = 5 r32 = call_fortran_f32(r32) print *, r32 if (abs(r32 - 7.3_sp) > 1e-5_dp) error stop r32 = 5 r32 = call_fortran_f32_value(r32) print *, r32 if (abs(r32 - 7.3_sp) > 1e-5_dp) error stop r64 = 5 r64 = call_fortran_f64(r64) print *, r64 if (abs(r64 - 7.3_dp) > 1e-10_dp) error stop r64 = 5 r64 = call_fortran_f64_value(r64) print *, r64 if (abs(r64 - 7.3_dp) > 1e-10_dp) error stop end lfortran-0.63.0/integration_tests/return_06.f900000664000175000017500000000005115174404631021525 0ustar alastairalastairprogram main return end program main lfortran-0.63.0/integration_tests/c_ptr_07.f900000664000175000017500000000355615174404631021333 0ustar alastairalastairmodule cptr_07_mod use iso_c_binding implicit none contains function f_string(cstr) result(fstr) character(len=1), pointer :: cstr(:) character(:), allocatable :: fstr integer :: i, n n = 0 do i = 1, size(cstr) if (cstr(i) == c_null_char) exit n = n + 1 end do allocate(character(len=n) :: fstr) do i = 1, n fstr(i:i) = cstr(i) end do end function f_string end module cptr_07_mod module cptr_07_mod_2 use iso_c_binding use cptr_07_mod implicit none contains function get_temp_filename() result(tempfile) integer, parameter :: MAX_FILENAME_LENGTH = 32768 character(:), allocatable :: tempfile type(c_ptr) :: c_tempfile_ptr character(len=1), pointer :: c_tempfile(:) interface function c_tempnam(dir, pfx) bind(C, name="tempnam") import :: c_ptr type(c_ptr), value :: dir type(c_ptr), value :: pfx type(c_ptr) :: c_tempnam end function c_tempnam subroutine c_free(ptr) bind(C, name="free") import :: c_ptr type(c_ptr), value :: ptr end subroutine c_free end interface c_tempfile_ptr = c_tempnam(C_NULL_PTR, C_NULL_PTR) if (.not. c_associated(c_tempfile_ptr)) then error stop "tempnam returned NULL" end if call c_f_pointer(c_tempfile_ptr, c_tempfile, [MAX_FILENAME_LENGTH]) tempfile = f_string(c_tempfile) call c_free(c_tempfile_ptr) end function get_temp_filename end module cptr_07_mod_2 program cptr_07 use cptr_07_mod_2 implicit none character(:), allocatable :: name allocate(name, source=get_temp_filename()) print *, "Temp filename =", trim(name) end program cptr_07 lfortran-0.63.0/integration_tests/doloop_05.f900000664000175000017500000000025215174404631021504 0ustar alastairalastairprogram doloop_05 implicit none integer :: i, j 1 j = 0 2 I_LOOP: do i = 1, 10 3 if (i == 2) cycle I_loop 4 j = j + i 5 end do i_Loop 6 if (j /= 53) error stop end lfortran-0.63.0/integration_tests/array_section_05.f900000664000175000017500000000070715174404631023057 0ustar alastairalastairprogram array_section_05 integer, allocatable :: A(:,:) logical, allocatable :: B(:) allocate(A(2,0)) allocate(B(size(A,2))) B = is_prime(A(2,:)) if (any(shape(B) /= [0])) error stop if (all(B) .neqv. .true.) error stop if (all(is_prime(A(1:1,:))) .neqv. .true.) error stop contains elemental logical function is_prime(n) integer, intent(in) :: n is_prime = .false. end function is_prime end program lfortran-0.63.0/integration_tests/read_78.f900000664000175000017500000000104115174404631021132 0ustar alastairalastairmodule read_78_mod implicit none contains subroutine get_sarr(val, arr) character(len=*), intent(in) :: val character(len=*), allocatable, intent(out) :: arr(:) if (.not. allocated(arr)) allocate(arr(2)) read(val, *) arr end subroutine get_sarr end module read_78_mod program read_78 use read_78_mod, only: get_sarr implicit none character(len=16), allocatable :: arr(:) call get_sarr('alpha, beta', arr) if (trim(arr(1)) /= 'alpha' .or. trim(arr(2)) /= 'beta') error stop end program read_78 lfortran-0.63.0/integration_tests/external_12_module.f900000664000175000017500000000113015174404631023371 0ustar alastairalastairmodule external_12_module1 LOGICAL(4), ALLOCATABLE, DIMENSION(:) :: inrdone end module external_12_module1 MODULE external_12_module2 use external_12_module1, only: inrdone REAL(4), PARAMETER :: one = 1.0 PUBLIC :: inner CONTAINS SUBROUTINE inner ( ) REAL(4), ALLOCATABLE, DIMENSION(:) :: dfmxi REAL(4) :: epsi=1.0E-4 ALLOCATE( dfmxi(5) ) ALLOCATE( inrdone(5) ) dfmxi = -one WHERE( dfmxi <= epsi ) inrdone = .TRUE. print *, "inrdone: ", inrdone if (any(inrdone .neqv. .TRUE.)) error stop END SUBROUTINE inner END MODULE external_12_module2 lfortran-0.63.0/integration_tests/types_05.f900000664000175000017500000000034115174404631021353 0ustar alastairalastairprogram types_05 implicit none real :: r integer :: i r = 1. * 2 r = 2 * 1. r = 2 * (3+1.) r = 2 * (3.-1) r = 1/2 r = 1./2 r = 1/2. i = 1. * 2 i = 2 * 1. i = 2 * (3+1.) i = 2 * (3.-1) i = 1/2 i = 1./2 i = 1/2. end program lfortran-0.63.0/integration_tests/separate_compilation_24b.f900000664000175000017500000000037615174404631024564 0ustar alastairalastairsubmodule(sorting_separate_compilation_24) radix_sort_separate_compilation_24 implicit none contains module subroutine sort(n) integer, intent(inout) :: n n = 5 end subroutine end submodule radix_sort_separate_compilation_24lfortran-0.63.0/integration_tests/separate_compilation_38a.f900000664000175000017500000000060515174404631024563 0ustar alastairalastairmodule separate_compilation_38_module implicit none type recursive_t(k) integer, kind :: k = kind(1.0) type(recursive_t(k)), allocatable :: next end type recursive_t interface recursive_t pure module function make() result(n) implicit none type(recursive_t) :: n end function make end interface recursive_t end module separate_compilation_38_module lfortran-0.63.0/integration_tests/template_add_04.f900000664000175000017500000000236315174404631022637 0ustar alastairalastairmodule template_add_04_m implicit none private public :: add_t, test_template requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F, mult) require :: R(T, F) integer :: mult private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z integer :: i z = F(x, y) do i = 1,mult-1 z = F(z, F(x,y)) end do end function end template contains real function func_arg_real(x, y) result(z) real, intent(in) :: x, y z = x + y end function integer function func_arg_int(x, y) result(z) integer, intent(in) :: x, y z = x + y end function subroutine test_template() integer, parameter :: n = 10 instantiate add_t(real, func_arg_real, n), only: add_real => add_generic real :: x, y integer :: a, b x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) end subroutine end module program template_add_04 use template_add_04_m implicit none call test_template() end programlfortran-0.63.0/integration_tests/random_init_01.f900000664000175000017500000000045615174404631022515 0ustar alastairalastairprogram random_init_01 implicit none ! Test random_init with keyword arguments (image_distinct) call random_init(repeatable=.true., image_distinct=.true.) call random_init(image_distinct=.false., repeatable=.false.) call random_init(.true., .false.) print *, "ok" end program lfortran-0.63.0/integration_tests/write_15.f900000664000175000017500000000057615174404631021354 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/4888 ! String array concatenation (//) in write statement ! Exact MRE from issue body program writetesta implicit none character(3):: c(6) = 'ab' character(80) :: output write(output,"(6A)") c//' ' print "(A)", trim(output) if (trim(output) /= 'ab ab ab ab ab ab') error stop end program writetesta lfortran-0.63.0/integration_tests/submodule_39a.f900000664000175000017500000000130315174404631022355 0ustar alastairalastairprogram submodule_39 use input_output_pair_m, only : input_output_pair_t use mini_batch_m, only : mini_batch_t, make_batch implicit none type(input_output_pair_t), allocatable :: input_output_pairs(:) type(mini_batch_t) :: mini_batch allocate(input_output_pairs(2)) input_output_pairs(1)%input = 1.0 input_output_pairs(2)%input = 2.0 mini_batch = make_batch(input_output_pairs) if (.not. allocated(mini_batch%input_output_pairs)) error stop 1 if (size(mini_batch%input_output_pairs) /= 2) error stop 2 if (abs(mini_batch%input_output_pairs(1)%input - 1.0) > 1e-6) error stop 3 if (abs(mini_batch%input_output_pairs(2)%input - 2.0) > 1e-6) error stop 4 end program submodule_39 lfortran-0.63.0/integration_tests/gpu_metal_182.f900000664000175000017500000000044315174404631022255 0ustar alastairalastairprogram gpu_metal_182 implicit none real :: vals(2, 2) logical :: res(2) integer :: i vals = reshape([0.5, 0.6, 0.1, 0.2], [2, 2]) do concurrent(i=1:2) res(i) = sum(vals(:,i)) > 0.99 end do print *, res if (.not. res(1)) error stop if (res(2)) error stop end program lfortran-0.63.0/integration_tests/string_44.f900000664000175000017500000000024715174404631021525 0ustar alastairalastairprogram string_44 character(len=:),allocatable :: color color = "red" select case (color) case('red') print *, "red" end select end programlfortran-0.63.0/integration_tests/procedure_pointer_19.f900000664000175000017500000000056115174404631023750 0ustar alastairalastairprogram procedure_pointer_19 implicit none type :: t procedure(), pointer, nopass :: caller => null() procedure(), pointer, nopass :: f => null() end type type(t) :: x x%caller => sub x%f => sub call x%caller(x%f) print *, "ok" contains subroutine sub(func) procedure() :: func end subroutine end program lfortran-0.63.0/integration_tests/bindc_iso_fb_05.f900000664000175000017500000012312115174404631022611 0ustar alastairalastair! Consolidated ISO_Fortran_binding test: Assumed-rank/type, C-Fortran Callbacks & Misc ! ! Merged from: bindc_21, bindc_23, bindc_25, bindc_29, bindc_34, bindc_40, bindc_42, bindc_44 ! ============================================================ ! Modules from bindc_21 ! ============================================================ module bindc_21_mod use iso_c_binding, only: c_int, c_int32_t, c_int64_t, c_double implicit none interface ! ---- assumed-rank with intent(inout) ---- subroutine c21_double_ar(a) bind(C, name="c21_double_ar") import :: c_int32_t integer(c_int32_t), intent(inout) :: a(..) end subroutine ! ---- assumed-rank with specific types ---- integer(c_int64_t) function c21_sum_ar_i64(a) & bind(C, name="c21_sum_ar_i64") import :: c_int64_t integer(c_int64_t), intent(in) :: a(..) end function integer(c_int) function c21_sum_ar_dbl(a) & bind(C, name="c21_sum_ar_dbl") import :: c_int, c_double real(c_double), intent(in) :: a(..) end function ! ---- optional assumed-rank ---- integer(c_int) function c21_opt_ar_present(a) & bind(C, name="c21_opt_ar_present") import :: c_int type(*), optional, intent(in) :: a(..) end function ! ---- optional scalar ---- integer(c_int) function c21_opt_scalar_present(x) & bind(C, name="c21_opt_scalar_present") import :: c_int, c_int32_t integer(c_int32_t), optional, intent(in) :: x end function integer(c_int32_t) function c21_opt_scalar_value(x) & bind(C, name="c21_opt_scalar_value") import :: c_int32_t integer(c_int32_t), optional, intent(in) :: x end function ! ---- multiple descriptor arguments ---- integer(c_int32_t) function c21_dot_product(a, b) & bind(C, name="c21_dot_product") import :: c_int32_t integer(c_int32_t), intent(in) :: a(:) integer(c_int32_t), intent(in) :: b(:) end function subroutine c21_add_arrays(a, b, c) bind(C, name="c21_add_arrays") import :: c_int32_t integer(c_int32_t), intent(in) :: a(:) integer(c_int32_t), intent(in) :: b(:) integer(c_int32_t), intent(out) :: c(:) end subroutine end interface end module ! ============================================================ ! Modules from bindc_23 ! ============================================================ module bindc_23_mod use iso_c_binding, only: c_int, c_int32_t, c_char implicit none interface ! ---- character(c_char) assumed-shape arrays ---- integer(c_int) function c23_char_sum_1d(a) & bind(C, name="c23_char_sum_1d") import :: c_int, c_char character(kind=c_char, len=1), intent(in) :: a(:) end function ! ---- assumed-rank: rank query for scalar (rank 0) ---- integer(c_int) function c23_get_rank(a) bind(C, name="c23_get_rank") import :: c_int, c_int32_t integer(c_int32_t), intent(in) :: a(..) end function ! ---- optional allocatable ---- integer(c_int) function c23_opt_alloc_present(a) & bind(C, name="c23_opt_alloc_present") import :: c_int, c_int32_t integer(c_int32_t), optional, allocatable, intent(in) :: a(:) end function integer(c_int32_t) function c23_opt_alloc_sum(a) & bind(C, name="c23_opt_alloc_sum") import :: c_int, c_int32_t integer(c_int32_t), optional, allocatable, intent(in) :: a(:) end function ! ---- optional pointer ---- integer(c_int) function c23_opt_ptr_present(a) & bind(C, name="c23_opt_ptr_present") import :: c_int, c_int32_t integer(c_int32_t), optional, pointer, intent(in) :: a(:) end function ! ---- C calling Fortran (receives descriptor, calls back) ---- integer(c_int32_t) function c23_call_fortran_sum(a) & bind(C, name="c23_call_fortran_sum") import :: c_int32_t integer(c_int32_t), intent(in) :: a(:) end function end interface end module ! Fortran BIND(C) procedure with descriptor arg (called from C) module bindc_23_callbacks use iso_c_binding, only: c_int32_t implicit none contains integer(c_int32_t) function fortran_sum_1d(a) & bind(C, name="fortran_sum_1d") integer(c_int32_t), intent(in) :: a(:) integer :: i fortran_sum_1d = 0 do i = 1, size(a) fortran_sum_1d = fortran_sum_1d + a(i) end do end function end module ! ============================================================ ! Modules from bindc_25 ! ============================================================ module bindc_25_types use iso_c_binding, only: c_int32_t, c_double implicit none type, bind(C) :: pair_t integer(c_int32_t) :: a integer(c_int32_t) :: b end type end module module bindc_25_fortran_procs use iso_c_binding use bindc_25_types implicit none contains ! ---- assumed-shape subroutine (C calls this) ---- subroutine f25_double_1d(a) bind(C, name="f25_double_1d") integer(c_int32_t), intent(inout) :: a(:) integer :: i do i = 1, size(a) a(i) = a(i) * 2 end do end subroutine integer(c_int32_t) function f25_sum_1d(a) bind(C, name="f25_sum_1d") integer(c_int32_t), intent(in) :: a(:) integer :: i f25_sum_1d = 0 do i = 1, size(a) f25_sum_1d = f25_sum_1d + a(i) end do end function integer(c_int32_t) function f25_sum_2d(a) bind(C, name="f25_sum_2d") integer(c_int32_t), intent(in) :: a(:,:) integer :: i, j f25_sum_2d = 0 do j = 1, size(a, 2) do i = 1, size(a, 1) f25_sum_2d = f25_sum_2d + a(i, j) end do end do end function ! ---- assumed-rank (C calls this) ---- integer(c_int) function f25_get_rank(a) bind(C, name="f25_get_rank") integer(c_int32_t), intent(in) :: a(..) f25_get_rank = rank(a) end function ! ---- allocatable arg (C calls this) ---- integer(c_int32_t) function f25_sum_alloc(a) bind(C, name="f25_sum_alloc") integer(c_int32_t), allocatable, intent(in) :: a(:) integer :: i f25_sum_alloc = 0 if (allocated(a)) then do i = 1, size(a) f25_sum_alloc = f25_sum_alloc + a(i) end do end if end function ! ---- pointer arg (C calls this) ---- integer(c_int32_t) function f25_sum_ptr(a) bind(C, name="f25_sum_ptr") integer(c_int32_t), pointer, intent(in) :: a(:) integer :: i f25_sum_ptr = 0 if (associated(a)) then do i = 1, size(a) f25_sum_ptr = f25_sum_ptr + a(i) end do end if end function ! ---- optional arg (C calls this) ---- integer(c_int) function f25_opt_present(a) bind(C, name="f25_opt_present") integer(c_int32_t), optional, intent(in) :: a(:) if (present(a)) then f25_opt_present = 1 else f25_opt_present = 0 end if end function ! ---- CONTIGUOUS arg (C calls this) ---- integer(c_int32_t) function f25_sum_contig(a) & bind(C, name="f25_sum_contig") integer(c_int32_t), contiguous, intent(in) :: a(:) integer :: i f25_sum_contig = 0 do i = 1, size(a) f25_sum_contig = f25_sum_contig + a(i) end do end function ! ---- intent(out) descriptor (C calls, Fortran fills) ---- subroutine f25_fill_array(a) bind(C, name="f25_fill_array") integer(c_int32_t), intent(out) :: a(:) integer :: i do i = 1, size(a) a(i) = i * 10 end do end subroutine ! ---- multiple descriptor args (C calls this) ---- integer(c_int32_t) function f25_dot(a, b) bind(C, name="f25_dot") integer(c_int32_t), intent(in) :: a(:), b(:) integer :: i f25_dot = 0 do i = 1, size(a) f25_dot = f25_dot + a(i) * b(i) end do end function subroutine f25_add(a, b, c) bind(C, name="f25_add") integer(c_int32_t), intent(in) :: a(:), b(:) integer(c_int32_t), intent(out) :: c(:) integer :: i do i = 1, size(a) c(i) = a(i) + b(i) end do end subroutine ! ---- derived type array (C calls this) ---- integer(c_int32_t) function f25_sum_pairs(pts) & bind(C, name="f25_sum_pairs") type(pair_t), intent(in) :: pts(:) integer :: i f25_sum_pairs = 0 do i = 1, size(pts) f25_sum_pairs = f25_sum_pairs + pts(i)%a + pts(i)%b end do end function ! ---- complex array (C calls this) ---- subroutine f25_sum_complex(a, re, im) bind(C, name="f25_sum_complex") complex(c_float_complex), intent(in) :: a(:) real(c_float), intent(out) :: re, im integer :: i re = 0.0 im = 0.0 do i = 1, size(a) re = re + real(a(i)) im = im + aimag(a(i)) end do end subroutine ! ---- logical array (C calls this) ---- integer(c_int) function f25_count_true(a) & bind(C, name="f25_count_true") logical(c_bool), intent(in) :: a(:) integer :: i f25_count_true = 0 do i = 1, size(a) if (a(i)) f25_count_true = f25_count_true + 1 end do end function ! ---- function returning scalar (C calls this) ---- integer(c_int32_t) function f25_square(x) bind(C, name="f25_square") integer(c_int32_t), value :: x f25_square = x * x end function ! ---- function returning complex (C calls this) ---- complex(c_float_complex) function f25_conj(z) bind(C, name="f25_conj") complex(c_float_complex), value :: z f25_conj = conjg(z) end function end module module bindc_25_c_iface use iso_c_binding, only: c_int, c_int32_t implicit none interface integer(c_int) function c25_run_all_tests() & bind(C, name="c25_run_all_tests") import :: c_int end function end interface end module ! ============================================================ ! Modules from bindc_29 ! ============================================================ module bindc_29_types use iso_c_binding, only: c_int32_t, c_double implicit none type, bind(C) :: vec3_t real(c_double) :: x, y, z end type end module module bindc_29_globals use iso_c_binding, only: c_int32_t, c_double, c_bool, c_char, & c_float_complex, c_int use bindc_29_types implicit none ! Module variables bound to C globals defined in bindc_29c.c integer(c_int32_t), bind(C, name="c29_global_arr") :: global_arr(4) type(vec3_t), bind(C, name="c29_global_vec") :: global_vec logical(c_bool), bind(C, name="c29_global_flag") :: global_flag integer(c_int32_t), bind(C, name="c29_global_counter") :: global_counter end module module bindc_29_mod use iso_c_binding use bindc_29_types implicit none interface ! ---- read C globals (verify Fortran can read them) ---- integer(c_int) function c29_check_globals() & bind(C, name="c29_check_globals") import :: c_int end function ! ---- verify Fortran writes are visible in C ---- integer(c_int) function c29_verify_writes() & bind(C, name="c29_verify_writes") import :: c_int end function ! ---- descriptor type code check ---- integer(c_int) function c29_check_type_int32(a) & bind(C, name="c29_check_type_int32") import :: c_int, c_int32_t integer(c_int32_t), intent(in) :: a(:) end function integer(c_int) function c29_check_type_double(a) & bind(C, name="c29_check_type_double") import :: c_int, c_double real(c_double), intent(in) :: a(:) end function integer(c_int) function c29_check_type_float(a) & bind(C, name="c29_check_type_float") import :: c_int, c_float real(c_float), intent(in) :: a(:) end function ! ---- same array to multiple descriptor args ---- integer(c_int32_t) function c29_self_dot(a, b) & bind(C, name="c29_self_dot") import :: c_int32_t integer(c_int32_t), intent(in) :: a(:), b(:) end function end interface end module ! A module with BIND(C, NAME="") — blank name (private linkage) module bindc_29_blank_name use iso_c_binding, only: c_int32_t implicit none contains integer(c_int32_t) function f29_blank_add(a, b) bind(C, name="") integer(c_int32_t), value :: a, b f29_blank_add = a + b end function end module ! ============================================================ ! Modules from bindc_34 ! ============================================================ module bindc_34_types use iso_c_binding implicit none ! ---- ENUM, BIND(C) ---- enum, bind(C) enumerator :: COLOR_RED = 0 enumerator :: COLOR_GREEN = 1 enumerator :: COLOR_BLUE = 2 end enum ! ---- Derived type with fixed array component ---- type, bind(C) :: vec5_t integer(c_int32_t) :: data(5) end type end module module bindc_34_globals use iso_c_binding implicit none ! ---- Module bind(C) character variable ---- character(kind=c_char, len=1), bind(C, name="g34_char") :: g34_char ! ---- Module bind(C) complex variable ---- complex(c_float_complex), bind(C, name="g34_cmplx") :: g34_cmplx end module module bindc_34_common_mod use iso_c_binding implicit none ! ---- COMMON block with BIND(C) ---- integer(c_int32_t) :: common_x, common_y common /c34_common/ common_x, common_y bind(C, name="c34_common") :: /c34_common/ end module module bindc_34_ifaces use iso_c_binding use bindc_34_types implicit none abstract interface function int_func_i(x) bind(C) result(r) import :: c_int integer(c_int), value :: x integer(c_int) :: r end function end interface interface ! Enum: C returns an enum value integer(c_int) function c34_get_color(idx) bind(C) import :: c_int integer(c_int), value :: idx end function ! Enum: C checks if value matches expected integer(c_int) function c34_check_color(val, expected) bind(C) import :: c_int integer(c_int), value :: val, expected end function ! DT with fixed array: C sums the data array integer(c_int32_t) function c34_sum_vec5(v) bind(C) import :: c_int32_t, vec5_t type(vec5_t), intent(in) :: v end function ! DT with fixed array: C reads element at index integer(c_int32_t) function c34_get_vec5_elem(v, idx) bind(C) import :: c_int32_t, c_int, vec5_t type(vec5_t), intent(in) :: v integer(c_int), value :: idx end function ! c_f_procpointer: C returns a function pointer type(c_funptr) function c34_get_func_ptr() bind(C) import :: c_funptr end function ! Module globals: C sets char and complex subroutine c34_set_globals(c, re, im) bind(C) import :: c_char, c_float character(kind=c_char, len=1), value :: c real(c_float), value :: re, im end subroutine ! Module globals: C reads char character(kind=c_char, len=1) function c34_get_char() bind(C) import :: c_char end function ! Module globals: C reads complex real part real(c_float) function c34_get_cmplx_re() bind(C) import :: c_float end function ! Module globals: C reads complex imag part real(c_float) function c34_get_cmplx_im() bind(C) import :: c_float end function ! COMMON: C sets values subroutine c34_set_common(x, y) bind(C) import :: c_int32_t integer(c_int32_t), value :: x, y end subroutine ! COMMON: C reads x integer(c_int32_t) function c34_get_common_x() bind(C) import :: c_int32_t end function ! COMMON: C reads y integer(c_int32_t) function c34_get_common_y() bind(C) import :: c_int32_t end function end interface end module ! ============================================================ ! Modules from bindc_40 ! ============================================================ module bindc_40_ifaces use iso_c_binding implicit none interface ! ---- CFI_type_cptr: pass c_ptr array through descriptor ---- integer(c_int) function c40_check_cptr_type(arr) bind(C) import :: c_int, c_ptr type(c_ptr), intent(in) :: arr(:) end function ! ---- CFI_type_cfunptr: pass c_funptr array through descriptor ---- integer(c_int) function c40_check_cfunptr_type(arr) bind(C) import :: c_int, c_funptr type(c_funptr), intent(in) :: arr(:) end function ! ---- Deferred-length allocatable character ---- integer(c_int) function c40_check_deferred_char(s) bind(C) import :: c_int, c_char character(kind=c_char, len=:), allocatable, intent(in) :: s end function ! ---- Explicit-shape 2D array ---- integer(c_int) function c40_sum_explicit_2d(arr, r, c) bind(C) import :: c_int integer(c_int), value :: r, c integer(c_int), intent(in) :: arr(r, c) end function ! ---- Explicit-shape 3D array ---- integer(c_int) function c40_sum_explicit_3d(arr, d1, d2, d3) bind(C) import :: c_int integer(c_int), value :: d1, d2, d3 integer(c_int), intent(in) :: arr(d1, d2, d3) end function ! ---- Internal BIND(C) proc: C calls this ---- integer(c_int) function c40_call_internal(fp, x) bind(C) import :: c_int, c_funptr type(c_funptr), value :: fp integer(c_int), value :: x end function end interface end module ! ============================================================ ! Modules from bindc_42 ! ============================================================ module bindc_42_globals use iso_c_binding implicit none integer(c_int), save, bind(C, name="g42_save_var") :: g42_save_var = 0 end module module bindc_42_protected_mod use iso_c_binding implicit none integer(c_int), protected, bind(C, name="g42_protected") :: g42_protected = 99 contains subroutine set_protected(val) integer(c_int), intent(in) :: val g42_protected = val end subroutine end module module bindc_42_ifaces use iso_c_binding implicit none interface ! ---- Negative-stride section from C ---- integer(c_int) function c42_test_negative_stride_section() bind(C) import :: c_int end function ! ---- SAVE+BIND(C) global: C modifies it ---- subroutine c42_set_save_var(val) bind(C) import :: c_int integer(c_int), value :: val end subroutine integer(c_int) function c42_get_save_var() bind(C) import :: c_int end function ! ---- PROTECTED+BIND(C): C reads it ---- integer(c_int) function c42_get_protected() bind(C) import :: c_int end function ! ---- Optional allocatable scalar ---- integer(c_int) function c42_opt_alloc_scalar(x) bind(C) import :: c_int integer(c_int), allocatable, optional, intent(in) :: x end function ! ---- Optional pointer scalar ---- integer(c_int) function c42_opt_ptr_scalar(x) bind(C) import :: c_int integer(c_int), pointer, optional, intent(in) :: x end function end interface end module ! (bindc_44 has no modules — interfaces are in the program block) ! ============================================================ ! Main program ! ============================================================ program bindc_iso_fb_05 use bindc_21_mod use bindc_23_mod use bindc_23_callbacks use bindc_25_types use bindc_25_fortran_procs use bindc_25_c_iface use bindc_29_types use bindc_29_globals use bindc_29_mod use bindc_29_blank_name use bindc_34_types use bindc_34_globals use bindc_34_common_mod use bindc_34_ifaces use bindc_40_ifaces use bindc_42_globals use bindc_42_protected_mod use bindc_42_ifaces use iso_c_binding implicit none ! Interfaces from bindc_44 (originally inline in program) interface integer(c_int) function c44_get_rank(a) bind(C) import :: c_int type(*), dimension(..), intent(in) :: a end function integer(c_int) function c44_get_elem_len(a) bind(C) import :: c_int type(*), dimension(..), intent(in) :: a end function integer(c_int) function c44_total_size(a) bind(C) import :: c_int type(*), dimension(..), intent(in) :: a end function integer(c_int) function c44_sum_star(a) bind(C) import :: c_int type(*), dimension(..), intent(in) :: a end function integer(c_int) function c44_opt_rank(a) bind(C) import :: c_int type(*), dimension(..), optional, intent(in) :: a end function end interface ! --- bindc_21 tests --- call test_ar_inout() call test_ar_types() call test_opt_ar() call test_opt_scalar() call test_multi_arg() ! --- bindc_23 tests --- call test_char_array() call test_ar_rank0() call test_opt_alloc() call test_opt_ptr() call test_c_calls_fortran() ! --- bindc_25 tests --- call test_c_calling_fortran() ! --- bindc_29 tests --- call test_read_c_globals() call test_write_to_c_globals() call test_c_sizeof_derived() call test_c_sizeof_array() call test_c_associated_two_args() call test_c_loc_variants() call test_c_f_pointer_multidim() call test_type_codes() call test_same_array_multi_desc() call test_blank_name() ! --- bindc_34 tests --- call test_enum() call test_dt_fixed_array() call test_c_f_procpointer() call test_module_globals() call test_common_block() ! --- bindc_40 tests --- call test_cptr_type_code() call test_cfunptr_type_code() call test_deferred_char() call test_explicit_shape_multidim() call test_internal_bindc() ! --- bindc_42 tests --- call test_negative_stride_section() call test_save_bindc() call test_protected_bindc() call test_optional_alloc_scalar() call test_optional_ptr_scalar() call test_c_f_pointer_lower_bounds() ! --- bindc_44 tests --- call test_44_all() print *, "All bindc_iso_fb_05 tests passed." contains ! ========== Test subroutines from bindc_21 ========== subroutine test_ar_inout() integer(c_int32_t) :: a1(4), a2(2,3) a1 = [1, 2, 3, 4] call c21_double_ar(a1) if (a1(1) /= 2 .or. a1(4) /= 8) error stop "FAIL: ar inout 1d" a2 = reshape([1, 2, 3, 4, 5, 6], [2, 3]) call c21_double_ar(a2) if (a2(1,1) /= 2 .or. a2(2,3) /= 12) error stop "FAIL: ar inout 2d" end subroutine subroutine test_ar_types() integer(c_int64_t) :: ai64(3) real(c_double) :: ad(3) ai64 = [10_c_int64_t, 20_c_int64_t, 30_c_int64_t] if (c21_sum_ar_i64(ai64) /= 60_c_int64_t) & error stop "FAIL: ar i64 sum" ad = [1.5d0, 2.5d0, 3.0d0] if (c21_sum_ar_dbl(ad) /= 7) error stop "FAIL: ar dbl sum" end subroutine subroutine test_opt_ar() integer(c_int32_t) :: arr(4) arr = [1, 2, 3, 4] if (c21_opt_ar_present(arr) /= 1) error stop "FAIL: opt ar present" if (c21_opt_ar_present() /= 0) error stop "FAIL: opt ar absent" end subroutine subroutine test_opt_scalar() integer(c_int32_t) :: x x = 77 if (c21_opt_scalar_present(x) /= 1) error stop "FAIL: opt scalar present" if (c21_opt_scalar_present() /= 0) error stop "FAIL: opt scalar absent" if (c21_opt_scalar_value(x) /= 77) error stop "FAIL: opt scalar value" end subroutine subroutine test_multi_arg() integer(c_int32_t) :: a(4), b(4), c(4) a = [1, 2, 3, 4] b = [10, 20, 30, 40] if (c21_dot_product(a, b) /= 300) error stop "FAIL: dot product" c = 0 call c21_add_arrays(a, b, c) if (c(1) /= 11 .or. c(4) /= 44) error stop "FAIL: add arrays" end subroutine ! ========== Test subroutines from bindc_23 ========== subroutine test_char_array() character(kind=c_char, len=1) :: c1(4) c1 = ['A', 'B', 'C', 'D'] ! 65 + 66 + 67 + 68 = 266 if (c23_char_sum_1d(c1) /= 266) error stop "FAIL: char sum" end subroutine subroutine test_ar_rank0() integer(c_int32_t) :: scalar scalar = 42 if (c23_get_rank(scalar) /= 0) error stop "FAIL: ar rank0" end subroutine subroutine test_opt_alloc() integer(c_int32_t), allocatable :: a(:) allocate(a(3)) a = [10, 20, 30] if (c23_opt_alloc_present(a) /= 1) error stop "FAIL: opt alloc present" if (c23_opt_alloc_sum(a) /= 60) error stop "FAIL: opt alloc sum" if (c23_opt_alloc_present() /= 0) error stop "FAIL: opt alloc absent" deallocate(a) end subroutine subroutine test_opt_ptr() integer(c_int32_t), target :: tgt(3) integer(c_int32_t), pointer :: p(:) tgt = [1, 2, 3] p => tgt if (c23_opt_ptr_present(p) /= 1) error stop "FAIL: opt ptr present" if (c23_opt_ptr_present() /= 0) error stop "FAIL: opt ptr absent" end subroutine subroutine test_c_calls_fortran() integer(c_int32_t) :: arr(5) integer(c_int32_t) :: result arr = [10, 20, 30, 40, 50] result = c23_call_fortran_sum(arr) if (result /= 150) error stop "FAIL: c calls fortran" end subroutine ! ========== Test subroutines from bindc_25 ========== subroutine test_c_calling_fortran() integer(c_int) :: result result = c25_run_all_tests() if (result /= 0) then print *, "C test failed with code:", result error stop "FAIL: C calling Fortran tests failed" end if end subroutine ! ========== Test subroutines from bindc_29 ========== subroutine test_read_c_globals() ! C initializes globals; Fortran reads them if (c29_check_globals() /= 0) error stop "FAIL: C globals not init" ! Now read from Fortran side if (global_arr(1) /= 10) error stop "FAIL: global_arr(1)" if (global_arr(2) /= 20) error stop "FAIL: global_arr(2)" if (global_arr(3) /= 30) error stop "FAIL: global_arr(3)" if (global_arr(4) /= 40) error stop "FAIL: global_arr(4)" if (abs(global_vec%x - 1.0d0) > 1.0d-10) & error stop "FAIL: global_vec x" if (abs(global_vec%y - 2.0d0) > 1.0d-10) & error stop "FAIL: global_vec y" if (abs(global_vec%z - 3.0d0) > 1.0d-10) & error stop "FAIL: global_vec z" if (.not. global_flag) error stop "FAIL: global_flag" if (global_counter /= 42) error stop "FAIL: global_counter" end subroutine subroutine test_write_to_c_globals() ! Fortran writes to C globals global_arr(1) = 100 global_arr(2) = 200 global_arr(3) = 300 global_arr(4) = 400 global_counter = 99 ! C verifies the writes if (c29_verify_writes() /= 0) error stop "FAIL: C verify writes" end subroutine subroutine test_c_sizeof_derived() type(vec3_t) :: v integer(c_size_t) :: sz v = vec3_t(1.0d0, 2.0d0, 3.0d0) sz = c_sizeof(v) ! vec3_t has 3 doubles = 24 bytes if (sz /= 24_c_size_t) error stop "FAIL: c_sizeof vec3_t" end subroutine subroutine test_c_sizeof_array() integer(c_int32_t) :: arr(10) integer(c_size_t) :: sz arr = 0 sz = c_sizeof(arr) ! 10 * 4 = 40 bytes if (sz /= 40_c_size_t) error stop "FAIL: c_sizeof array" end subroutine subroutine test_c_associated_two_args() integer(c_int32_t), target :: a, b type(c_ptr) :: pa, pb, pc a = 1 b = 2 pa = c_loc(a) pb = c_loc(b) pc = c_loc(a) ! pa and pc point to same location if (.not. c_associated(pa, pc)) error stop "FAIL: c_assoc same" ! pa and pb point to different locations if (c_associated(pa, pb)) error stop "FAIL: c_assoc diff" ! single-arg form if (.not. c_associated(pa)) error stop "FAIL: c_assoc single" ! null check if (c_associated(c_null_ptr)) error stop "FAIL: c_assoc null" end subroutine subroutine test_c_loc_variants() integer(c_int32_t), allocatable, target :: alloc_arr(:) integer(c_int32_t), target :: fixed_arr(5) type(vec3_t), target :: v type(c_ptr) :: p integer(c_int32_t), pointer :: fp ! C_LOC on allocatable allocate(alloc_arr(3)) alloc_arr = [10, 20, 30] p = c_loc(alloc_arr) if (.not. c_associated(p)) error stop "FAIL: c_loc alloc" call c_f_pointer(p, fp) if (fp /= 10) error stop "FAIL: c_loc alloc value" ! C_LOC on array element fixed_arr = [100, 200, 300, 400, 500] p = c_loc(fixed_arr(3)) call c_f_pointer(p, fp) if (fp /= 300) error stop "FAIL: c_loc element" ! C_LOC on derived type component v = vec3_t(7.0d0, 8.0d0, 9.0d0) p = c_loc(v%x) if (.not. c_associated(p)) error stop "FAIL: c_loc component" deallocate(alloc_arr) end subroutine subroutine test_c_f_pointer_multidim() integer(c_int32_t), target :: data(6) type(c_ptr) :: p integer(c_int32_t), pointer :: matrix(:,:) data = [1, 2, 3, 4, 5, 6] p = c_loc(data) call c_f_pointer(p, matrix, [2, 3]) ! Column-major: matrix(1,1)=1, matrix(2,1)=2, matrix(1,2)=3, etc. if (matrix(1, 1) /= 1) error stop "FAIL: c_f_ptr 2d (1,1)" if (matrix(2, 1) /= 2) error stop "FAIL: c_f_ptr 2d (2,1)" if (matrix(1, 2) /= 3) error stop "FAIL: c_f_ptr 2d (1,2)" if (matrix(2, 3) /= 6) error stop "FAIL: c_f_ptr 2d (2,3)" end subroutine subroutine test_type_codes() integer(c_int32_t) :: ai(3) real(c_double) :: ad(3) real(c_float) :: af(3) ai = [1, 2, 3] ad = [1.0d0, 2.0d0, 3.0d0] af = [1.0, 2.0, 3.0] if (c29_check_type_int32(ai) /= 1) error stop "FAIL: type code int32" if (c29_check_type_double(ad) /= 1) error stop "FAIL: type code double" if (c29_check_type_float(af) /= 1) error stop "FAIL: type code float" end subroutine subroutine test_same_array_multi_desc() integer(c_int32_t) :: arr(4) arr = [1, 2, 3, 4] ! dot product of arr with itself: 1+4+9+16 = 30 if (c29_self_dot(arr, arr) /= 30) error stop "FAIL: self dot" end subroutine subroutine test_blank_name() integer(c_int32_t) :: r r = f29_blank_add(10_c_int32_t, 20_c_int32_t) if (r /= 30) error stop "FAIL: blank name" end subroutine ! ========== Test subroutines from bindc_34 ========== subroutine test_enum() ! Verify enum values match between Fortran and C if (c34_get_color(0) /= COLOR_RED) error stop "FAIL: enum RED" if (c34_get_color(1) /= COLOR_GREEN) error stop "FAIL: enum GREEN" if (c34_get_color(2) /= COLOR_BLUE) error stop "FAIL: enum BLUE" ! Pass Fortran enum to C and check if (c34_check_color(COLOR_RED, 0) /= 1) error stop "FAIL: check RED" if (c34_check_color(COLOR_GREEN, 1) /= 1) error stop "FAIL: check GREEN" if (c34_check_color(COLOR_BLUE, 2) /= 1) error stop "FAIL: check BLUE" end subroutine subroutine test_dt_fixed_array() type(vec5_t) :: v v%data = [10, 20, 30, 40, 50] if (c34_sum_vec5(v) /= 150) error stop "FAIL: vec5 sum" if (c34_get_vec5_elem(v, 0) /= 10) error stop "FAIL: vec5 elem 0" if (c34_get_vec5_elem(v, 2) /= 30) error stop "FAIL: vec5 elem 2" if (c34_get_vec5_elem(v, 4) /= 50) error stop "FAIL: vec5 elem 4" end subroutine subroutine test_c_f_procpointer() type(c_funptr) :: cfp procedure(int_func_i), pointer :: fptr ! Get function pointer from C (doubles its argument) cfp = c34_get_func_ptr() ! Convert to Fortran procedure pointer call c_f_procpointer(cfp, fptr) ! Call through procedure pointer if (fptr(21) /= 42) error stop "FAIL: c_f_procpointer call" if (fptr(0) /= 0) error stop "FAIL: c_f_procpointer zero" if (fptr(-5) /= -10) error stop "FAIL: c_f_procpointer neg" end subroutine subroutine test_module_globals() ! Set from Fortran, read from C g34_char = 'Z' if (c34_get_char() /= 'Z') error stop "FAIL: module char F->C" g34_cmplx = cmplx(3.0, 4.0) if (abs(c34_get_cmplx_re() - 3.0) > 1.0e-5) & error stop "FAIL: module cmplx re F->C" if (abs(c34_get_cmplx_im() - 4.0) > 1.0e-5) & error stop "FAIL: module cmplx im F->C" ! Set from C, read from Fortran call c34_set_globals('A', 1.5, 2.5) if (g34_char /= 'A') error stop "FAIL: module char C->F" if (abs(real(g34_cmplx) - 1.5) > 1.0e-5) & error stop "FAIL: module cmplx re C->F" if (abs(aimag(g34_cmplx) - 2.5) > 1.0e-5) & error stop "FAIL: module cmplx im C->F" end subroutine subroutine test_common_block() ! Set from Fortran, read from C common_x = 42 common_y = 84 if (c34_get_common_x() /= 42) error stop "FAIL: common x F->C" if (c34_get_common_y() /= 84) error stop "FAIL: common y F->C" ! Set from C, read from Fortran call c34_set_common(100, 200) if (common_x /= 100) error stop "FAIL: common x C->F" if (common_y /= 200) error stop "FAIL: common y C->F" end subroutine ! ========== Test subroutines from bindc_40 ========== subroutine test_cptr_type_code() type(c_ptr) :: ptrs(3) integer(c_int), target :: vals(3) integer :: j vals = [10, 20, 30] do j = 1, 3 ptrs(j) = c_loc(vals(j)) end do ! C checks desc->type == CFI_type_cptr if (c40_check_cptr_type(ptrs) /= 1) error stop "FAIL: CFI_type_cptr" end subroutine subroutine test_cfunptr_type_code() type(c_funptr) :: fps(2) fps(1) = c_funloc(internal_add) fps(2) = c_funloc(internal_add) ! C checks desc->type == CFI_type_cfunptr ! Note: LFortran treats c_funptr as CPtr (same as c_ptr), ! so the type code is CFI_type_cptr (41) instead of ! CFI_type_cfunptr (43). Skip this check for now. ! if (c40_check_cfunptr_type(fps) /= 1) error stop "FAIL: CFI_type_cfunptr" end subroutine subroutine test_deferred_char() character(kind=c_char, len=:), allocatable :: s integer(c_int) :: r s = "Hello" ! C checks elem_len == 5 and attribute == allocatable r = c40_check_deferred_char(s) if (r /= 5) error stop "FAIL: deferred char elem_len" end subroutine subroutine test_explicit_shape_multidim() integer(c_int) :: a2d(3, 2) integer(c_int) :: a3d(2, 3, 2) integer(c_int) :: r integer :: i a2d = reshape([1, 2, 3, 4, 5, 6], [3, 2]) r = c40_sum_explicit_2d(a2d, 3_c_int, 2_c_int) if (r /= 21) error stop "FAIL: explicit 2D sum" a3d = reshape([(i, i = 1, 12)], [2, 3, 2]) r = c40_sum_explicit_3d(a3d, 2_c_int, 3_c_int, 2_c_int) if (r /= 78) error stop "FAIL: explicit 3D sum" end subroutine subroutine test_internal_bindc() type(c_funptr) :: fp integer(c_int) :: r fp = c_funloc(internal_add) r = c40_call_internal(fp, 7_c_int) if (r /= 107) error stop "FAIL: internal bindc proc" end subroutine ! Internal BIND(C) procedure (F2018 allows this) integer(c_int) function internal_add(x) bind(C) integer(c_int), value :: x internal_add = x + 100 end function ! ========== Test subroutines from bindc_42 ========== subroutine test_negative_stride_section() ! All done on C side: create array, CFI_section with stride=-1, verify if (c42_test_negative_stride_section() /= 1) & error stop "FAIL: negative stride section" end subroutine subroutine test_save_bindc() g42_save_var = 42 if (c42_get_save_var() /= 42) error stop "FAIL: save var F->C" call c42_set_save_var(100_c_int) if (g42_save_var /= 100) error stop "FAIL: save var C->F" end subroutine subroutine test_protected_bindc() ! Cannot modify g42_protected here (PROTECTED), but C can read it call set_protected(77_c_int) if (c42_get_protected() /= 77) error stop "FAIL: protected C read" end subroutine subroutine test_optional_alloc_scalar() integer(c_int), allocatable :: x integer(c_int) :: r ! Present and allocated allocate(x) x = 42 r = c42_opt_alloc_scalar(x) if (r /= 42) error stop "FAIL: opt alloc scalar present" ! Absent r = c42_opt_alloc_scalar() if (r /= -1) error stop "FAIL: opt alloc scalar absent" deallocate(x) end subroutine subroutine test_optional_ptr_scalar() integer(c_int), pointer :: p integer(c_int), target :: tgt integer(c_int) :: r ! Present and associated tgt = 55 p => tgt r = c42_opt_ptr_scalar(p) if (r /= 55) error stop "FAIL: opt ptr scalar present" ! Absent r = c42_opt_ptr_scalar() if (r /= -1) error stop "FAIL: opt ptr scalar absent" end subroutine subroutine test_c_f_pointer_lower_bounds() use iso_c_binding integer(c_int), target :: data(6) type(c_ptr) :: cp integer(c_int), pointer :: fp2d(:,:) integer :: i data = [(i, i = 1, 6)] cp = c_loc(data(1)) ! C_F_POINTER with shape [3,2] and implicit lower bound 1 call c_f_pointer(cp, fp2d, [3, 2]) if (fp2d(1,1) /= 1) error stop "FAIL: c_f_ptr 2d (1,1)" if (fp2d(3,1) /= 3) error stop "FAIL: c_f_ptr 2d (3,1)" if (fp2d(1,2) /= 4) error stop "FAIL: c_f_ptr 2d (1,2)" if (fp2d(3,2) /= 6) error stop "FAIL: c_f_ptr 2d (3,2)" end subroutine ! ========== Test subroutines from bindc_44 ========== subroutine test_44_all() ! pair_t is available from bindc_25_types (identical definition) integer(c_int32_t) :: is integer(c_int32_t) :: i1(5) integer(c_int32_t) :: i2(3, 4) integer(c_int32_t) :: i3(2, 3, 2) real(c_float) :: rs real(c_float) :: r1(4) type(pair_t) :: dt1(3) integer :: i ! Initialize data is = 42 i1 = [1, 2, 3, 4, 5] i2 = reshape([(i, i = 1, 12)], [3, 4]) i3 = reshape([(i, i = 10, 21)], [2, 3, 2]) rs = 7.0_c_float r1 = [1.0_c_float, 2.0_c_float, 3.0_c_float, 4.0_c_float] dt1(1) = pair_t(1, 2) dt1(2) = pair_t(3, 4) dt1(3) = pair_t(5, 6) ! ---- Rank detection for scalar through rank-3 ---- if (c44_get_rank(is) /= 0) error stop "FAIL: int scalar rank" if (c44_get_rank(i1) /= 1) error stop "FAIL: int 1D rank" if (c44_get_rank(i2) /= 2) error stop "FAIL: int 2D rank" if (c44_get_rank(i3) /= 3) error stop "FAIL: int 3D rank" if (c44_get_rank(rs) /= 0) error stop "FAIL: real scalar rank" if (c44_get_rank(r1) /= 1) error stop "FAIL: real 1D rank" if (c44_get_rank(dt1) /= 1) error stop "FAIL: struct 1D rank" ! ---- Element length ---- if (c44_get_elem_len(is) /= 4) error stop "FAIL: int32 elem_len" if (c44_get_elem_len(rs) /= 4) error stop "FAIL: float elem_len" if (c44_get_elem_len(dt1) /= 8) error stop "FAIL: pair_t elem_len" ! ---- Total element count ---- if (c44_total_size(is) /= 1) error stop "FAIL: scalar size" if (c44_total_size(i1) /= 5) error stop "FAIL: 1D size" if (c44_total_size(i2) /= 12) error stop "FAIL: 2D size" if (c44_total_size(i3) /= 12) error stop "FAIL: 3D size" if (c44_total_size(r1) /= 4) error stop "FAIL: real 1D size" if (c44_total_size(dt1) /= 3) error stop "FAIL: struct 1D size" ! ---- Data access and type-based dispatch ---- if (c44_sum_star(is) /= 42) error stop "FAIL: int scalar sum" if (c44_sum_star(i1) /= 15) error stop "FAIL: int 1D sum" if (c44_sum_star(i2) /= 78) error stop "FAIL: int 2D sum" if (c44_sum_star(i3) /= 186) error stop "FAIL: int 3D sum" if (c44_sum_star(r1) /= 10) error stop "FAIL: real 1D sum" ! ---- OPTIONAL present ---- if (c44_opt_rank(i1) /= 1) error stop "FAIL: opt present" ! ---- OPTIONAL absent ---- if (c44_opt_rank() /= -1) error stop "FAIL: opt absent" end subroutine end program lfortran-0.63.0/integration_tests/intrinsics_413.f900000664000175000017500000000034315174404631022461 0ustar alastairalastairprogram ichar_test implicit none integer :: i ! This should work - char(0) returns a character of length 1 i = ichar(char(0)) print *, i if (i /= 0) error stop end program ichar_test lfortran-0.63.0/integration_tests/modules_58_module.f900000664000175000017500000000166715174404631023250 0ustar alastairalastairMODULE module_58_module01 IMPLICIT NONE INTEGER, PUBLIC :: nx1 = 1000 INTEGER, PUBLIC :: nx2 = 1000 REAL, ALLOCATABLE, DIMENSION(:), PUBLIC :: arr END MODULE MODULE module_58_module02 USE module_58_module01 IMPLICIT NONE REAL, ALLOCATABLE, DIMENSION(:), PUBLIC :: ref_flux REAL, ALLOCATABLE, DIMENSION(:), PUBLIC :: ref_fluxm CONTAINS SUBROUTINE mms_deallocate END SUBROUTINE mms_deallocate SUBROUTINE mms_allocate ( ) nx1 = 555 ALLOCATE( ref_flux(nx1), ref_fluxm(nx2) ) print *,"Size of nx1",nx1 if(size(ref_flux) /= 555) error stop print *,"Size of nx2",nx2 if(size(ref_fluxm) /= 1000) error stop END SUBROUTINE mms_allocate SUBROUTINE test_alocate_external allocate(arr(nx1)) print *, size(arr) if(size(ref_flux) /= 555) error stop end SUBROUTINE test_alocate_external END MODULE module_58_module02lfortran-0.63.0/integration_tests/intrinsics_product_nodes_01.f900000664000175000017500000000047015174404631025323 0ustar alastairalastairprogram intrinsics_product_nodes use, intrinsic :: iso_fortran_env, only: int32 implicit none integer, parameter :: ndim = 1 integer(int32), dimension(ndim), parameter :: nodes = [10_int32] integer(int32), parameter :: ncol = product(nodes) if (ncol /= 10_int32) error stop end program lfortran-0.63.0/integration_tests/intrinsics_195.f900000664000175000017500000000155415174404631022475 0ustar alastairalastair!> the below test cases test the broadcasting of "max" intrinsic !> procedure during compile time program intrinsics_195 integer :: arr3(3), arr2(2) arr3 = max([-1, 2, 3], 2, 5, [4, 4, 5], [5, -8, 7]) if (arr3(1) /= 5) error stop if (arr3(2) /= 5) error stop if (arr3(3) /= 7) error stop ! not necessary to test the dimensions though ! as the initial assignment itself would raise an ! error if the assignment was incompatible if (size(arr3) /= 3) error stop arr3 = max(1, [-1, 2, 20]) if (arr3(1) /= 1) error stop if (arr3(2) /= 2) error stop if (arr3(3) /= 20) error stop arr3 = max([1, 2, 3], [1, 1, [2]]) if (arr3(1) /= 1) error stop if (arr3(2) /= 2) error stop if (arr3(3) /= 3) error stop arr2 = max([1, 2], -1, -4) if (arr2(1) /= 1) error stop if (arr2(2) /= 2) error stop end program lfortran-0.63.0/integration_tests/modules_30.f900000664000175000017500000000114615174404631021661 0ustar alastairalastairmodule fpm_manifest_modules_30 use fpm_manifest_package_modules_30, only : package_config_t use fpm_manifest_executable_modules_30, only : default_executable implicit none contains subroutine package_defaults(package, root) type(package_config_t), intent(inout) :: package character(len=*), intent(in) :: root allocate(package%executable(1)) call default_executable(package%executable(1), package%name) end subroutine package_defaults end module fpm_manifest_modules_30 program modules_30 implicit none print *, "running modules_30 program" end program lfortran-0.63.0/integration_tests/intrinsics_10.f900000664000175000017500000000012215174404631022365 0ustar alastairalastairprogram intrinsics_10 integer, parameter :: x = 3 print*, real(x) end program lfortran-0.63.0/integration_tests/nested_vars_04.f900000664000175000017500000000444615174404631022535 0ustar alastairalastairmodule m_sellc implicit none integer, parameter :: sp = kind(1.0) integer, parameter :: ilp = kind(1) type :: SELLC_type integer(ilp), allocatable :: rowptr(:) integer(ilp), allocatable :: col(:,:) end type type, extends(SELLC_type) :: SELLC_sp_type real(sp), allocatable :: data(:,:) end type contains subroutine spmv_sellc_sp(matrix, vec_x, vec_y) type(SELLC_sp_type), intent(in) :: matrix real(sp), intent(in) :: vec_x(:) real(sp), intent(inout) :: vec_y(:) integer :: i, nz, rowidx real(sp) :: alpha_ alpha_ = 1.0_sp i = 1 rowidx = 1 nz = matrix%rowptr(i + 1) - matrix%rowptr(i) associate(data => matrix%data, ia => matrix%rowptr, ja => matrix%col) call chunk_kernel_4(nz, data(:, ia(i)), ja(:, ia(i)), vec_x, vec_y(rowidx:)) end associate contains subroutine chunk_kernel_4(n, a, col, x, y) integer, intent(in) :: n real(sp), intent(in) :: a(4) integer(ilp), intent(in) :: col(4) real(sp), intent(in) :: x(:) real(sp), intent(inout) :: y(4) integer :: j do j = 1, n y(:) = y(:) + alpha_ * a(:) * x(col(:)) end do end subroutine chunk_kernel_4 end subroutine spmv_sellc_sp end module m_sellc program test_sellc use m_sellc implicit none type(SELLC_sp_type) :: matrix real(sp) :: vec_x(6), vec_y(4) real(sp) :: expected(4) allocate(matrix%data(4, 7)) allocate(matrix%col(4, 7)) allocate(matrix%rowptr(3)) matrix%data = reshape([ & 1, 2, 3, 0, 13, 14, 0, & 4, 5, 6, 7, 15, 16, 17, & 8, 9, 10, 0, 0, 0, 0, & 11, 12, 0, 0, 0, 0, 0 ], shape(matrix%data)) matrix%col = reshape([ & 1, 3, 4, 1, 4, 5, 1, & 2, 3, 5, 6, 2, 5, 6, & 1, 2, 3, 1, 1, 1, 1, & 5, 6, 1, 1, 1, 1, 1 ], shape(matrix%col)) matrix%rowptr = [1, 5, 8] vec_x = 1.0_sp vec_y = 0.0_sp call spmv_sellc_sp(matrix, vec_x, vec_y) expected = [4.0_sp, 8.0_sp, 12.0_sp, 0.0_sp] if (any(abs(vec_y - expected) > 1.0e-6_sp)) then error stop "nested_vars_04: unexpected vec_y" end if print *, "vec_y =", vec_y end program test_sellclfortran-0.63.0/integration_tests/modules_59.f900000664000175000017500000000132415174404631021672 0ustar alastairalastairmodule module_mod_59 implicit none private public :: is_finite interface is_finite module procedure is_finite_1 end interface is_finite contains subroutine is_finite_1(x) integer , intent(in) :: x print *, x if(x /= 1111) error stop end subroutine is_finite_1 end module module_mod_59 module mod_middle use, non_intrinsic :: module_mod_59, only : is_finite end module mod_middle program module_59 real :: x(2) call calfun(x) contains subroutine calfun(x) use, non_intrinsic :: mod_middle, only : is_finite real, intent(in) :: x(:) call is_finite(1111) end subroutine calfun end program module_59lfortran-0.63.0/integration_tests/capital_01.f900000664000175000017500000000025115174404631021620 0ustar alastairalastairPROGRAM CAPITAL_01 INTEGER A,B,C A=1 B=2 C=A+B PRINT *, C IF ( A /= 1 ) ERROR STOP IF ( B /= 2 ) ERROR STOP IF ( C /= 3 ) ERROR STOP END lfortran-0.63.0/integration_tests/block_07.f900000664000175000017500000000127615174404631021313 0ustar alastairalastairprogram main implicit none integer :: i, j i = 0 j = 0 test: block outer : do i = i + 1 inner : do j = j + 1 if ( j == 3 ) then exit test end if if (j == 5) then print *, j exit inner end if end do inner print *, "out of inner loop" if ( i == 2 ) then exit outer end if end do outer print *, "out of outer loop" end block test if (i /= 1) error stop if (j /= 3) error stop print *, "out of test block" end program lfortran-0.63.0/integration_tests/intrinsics_445.f900000664000175000017500000000055415174404631022472 0ustar alastairalastairprogram intrinsics_445 implicit none real :: x, zero zero = 0.0 x = log_gamma(1.0) if (abs(x) > 1.0e-6) error stop x = log_gamma(2.0) if (abs(x) > 1.0e-6) error stop x = log_gamma(0.5) if (abs(x - 0.5723649) > 1.0e-5) error stop x = log_gamma(zero) if (x <= huge(x)) error stop print *, x end program intrinsics_445 lfortran-0.63.0/integration_tests/test_endfile_01.f900000664000175000017500000000312115174404631022647 0ustar alastairalastairprogram test_endfile_01 use iso_fortran_env, only: iostat_end implicit none integer :: u, ios character(len=20) :: line u = 20 open(unit=u, file="test_endfile_01.txt", status="replace", action="readwrite", form="formatted") ! Write some data write(u, '(a)') "line1" write(u, '(a)') "line2" ! Mark the end of the file endfile(u) ! TODO: WRITE after ENDFILE without repositioning must fail. ! Requires per-unit state tracking in the I/O runtime to detect ! that the unit is in an "after endfile" state. ! write(u, '(a)', iostat=ios) "this should not be written" ! if (ios <= 0) then ! print *, "ERROR: WRITE after ENDFILE did not produce an error condition" ! close(u, status="delete") ! stop 1 ! end if ! Now reposition to the beginning (required after ENDFILE) rewind(u) ! Read the two lines back read(u, '(a)', iostat=ios) line if (ios /= 0 .or. trim(adjustl(line)) /= "line1") then print *, "ERROR: Failed to read line1 correctly" stop 1 end if read(u, '(a)', iostat=ios) line if (ios /= 0 .or. trim(adjustl(line)) /= "line2") then print *, "ERROR: Failed to read line2 correctly" stop 1 end if ! TODO: Third read should hit end-of-file condition (iostat_end). ! Currently the runtime truncation works but iostat_end detection ! after ENDFILE needs per-unit state tracking. ! read(u, '(a)', iostat=ios) line ! if (ios /= iostat_end) then ! print *, "ERROR: Did not detect end-of-file after ENDFILE" ! stop 1 ! end if close(u, status="delete") print *, "ENDFILE test passed" end program test_endfile_01 lfortran-0.63.0/integration_tests/format_01.f900000664000175000017500000000640215174404631021477 0ustar alastairalastairprogram format_01 implicit none 1 format(/,'BDF2 step ',i6,': T=',es12.5,', H=',es12.5,', ETAH=',es12.5) integer :: x 2 format(/ ,'BDF2 step ',i6,': T=',es12.5,', H=',es12.5,', ETAH=',es12.5) 3 format( /,'BDF2 step ',i6,': T=',es12.5,', H=',es12.5,', ETAH=',es12.5) 4 format(2x,'Preconditioner update FAILED at T=',es12.5,', ETAH=',es12.5) 5 format(/) 6 format(/ ) 7 format( /) 8 format(i6, /) 9 format(i6,/) 10 format(/ , /) 121 FORMAT( /, 80A, / ) integer :: y 122 FORMAT( /, 80A, /) 123 FORMAT(/, 80A, /) 124 FORMAT(/, 80A, / ) 130 FORMAT( 10X, & 'keyword Input Echo - Values from input or default', / ,& 80A, / ) 131 FORMAT( 10X, & 'keyword Input Echo - Values from input or default', / ,& 80A, /) 158 FORMAT( 4X, 'epsi = ', ES11.4, /, 4X, 'iitm = ', I3, /, & 4X, 'oitm = ', I4, /, 4X, 'timedep = ', I1, /, & 4X, 'swp_typ = ', I1, /, 4X, 'multiswp = ', I1, /, & 4X, 'angcpy = ', I1, /, 4X, 'it_det = ', I1, /, & 4X, 'soloutp = ', I1, /, 4X, 'kplane = ', I4, /, & 4X, 'popout = ', I1, /, 4X, 'fluxp = ', I1, /, & 4X, 'fixup = ', I1, / ) 161 FORMAT( 'slgg(nmat,nmom,ng,ng) echo', /, 'Column-order loops:',& ' Mats (fastest ), Moments, Groups, Groups (slowest)' ) 162 FORMAT( 2X, ES15.8, 2X, ES15.8, 2X, ES15.8, 2X, ES15.8 ) 221 FORMAT( 4X, 'Group ', I3, 4X, ' Inner ', I5, 4X, ' Dfmxi ', & ES11.4, ' Fixup x/y/z/t ', 4(ES9.2,1x) ) 306 FORMAT( 2X, I4, 6(1X, ES11.4) ) 324 FORMAT( 4(2X, ES17.10) ) 422 FORMAT( /, 4X, 'Manufactured/Computed Solutions Max Diff=', & ES13.6 ) 500 format( "IARRAY =", *( I0, :, ",")) 501 format(*( I0, :, ",")) 510 FORMAT (1X, F10.3, I5, F10.3, I5/F10.3, I5, F10.3, I5) 511 FORMAT (3/,I5) 512 format(3/) 513 FORMAT (1x, A, 3/ 1x, 2(I10,F10.2) // 1x, 2E15.7) 520 FORMAT (1X, I1, 1X, 'ISN''T', 1X, I1) 530 FORMAT (1PE12.4, I10) 540 FORMAT (I12, /, ' Dates: ', 2 (2I3, I5)) 550 FORMAT (ES12.3, ES12.3E3, G3.4, G3.4E100) 600 format(//,63x,'Internal',/, & 1x,'Cell',3(5x,'Temp '), 7x,'P',8x,'Density',6x,'Energy', & /,2x,'Num',6x,'(K)',7x,'(C)',7x,'(F)',6x,'(Pa)',6x, & '(kg/m**3)',5x,'(J/kg)' ) 610 format(71('-'),/,(1x,i4,0p,3f10.1,1p,3e12.3)) 620 format((1x,i4,0p,3(2x,'|',2x,f5.1),1p, 3(1x,'|',1x,e9.3))) 630 format( //,' Format Number ',i4) 631 format(//,' Format Number ',i4) 640 format("Table form of A"/(2F8.2)) 650 FORMAT( 5X, 'ng= ', I4, / & 5X, 'mat_opt= ', I2, / & 5X, 'src_opt= ', I2, / & 5X, 'scatp= ', I2 ) 660 format(' Format Number ',0PF17.8,' Ry' ) 670 format(/'xx') 680 format(/"xx") 690 format(/ "xx") 700 format(/ 'xx') 710 format(/ i5, 'x') 720 format(// i5, 'x') 730 format(//) integer :: z x = 5 740 FORMAT(/1X'(',I2,')', X, A) end program lfortran-0.63.0/integration_tests/submodule_46.f900000664000175000017500000000210415174404631022212 0ustar alastairalastairmodule math_submodule_46 implicit none integer, parameter :: sp = 4 interface linspace pure module function linspace_sp(start, end, n) result(res) real(sp), intent(in) :: start, end integer, intent(in) :: n real(sp) :: res(max(n, 0)) end function end interface end module submodule (math_submodule_46) linspace_submod_46 implicit none contains module procedure linspace_sp real(sp) :: x(max(n, 0)) integer :: i if (n <= 0) return if (n == 1) then res(1) = end return end if do i = 1, n x(i) = start + (end - start) * real(i - 1, sp) / real(n - 1, sp) end do res = x end procedure end submodule program submodule_46 use math_submodule_46 implicit none real(4) :: result(5) result = linspace(0.0, 1.0, 5) if (abs(result(1) - 0.0) > 1.0e-6) error stop if (abs(result(5) - 1.0) > 1.0e-6) error stop if (abs(result(3) - 0.5) > 1.0e-6) error stop print *, result end program lfortran-0.63.0/integration_tests/infer_walrus_array_02.f900000664000175000017500000000045215174404631024105 0ustar alastairalastairprogram infer_walrus_array_02 implicit none x := reshape([1, 2, 3, 4, 5, 6], [2, 3]) if (size(x, 1) /= 2) error stop if (size(x, 2) /= 3) error stop if (x(1, 1) /= 1) error stop if (x(2, 1) /= 2) error stop if (x(1, 2) /= 3) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/intrinsics_161.f900000664000175000017500000000323415174404631022463 0ustar alastairalastairprogram intrinsics_161 integer :: a1 = 5, a2 = 8 integer(8) :: a3 = -1, a4 = -4 integer :: a5 = -2, a6 = -5 integer, parameter :: i1 = ieor(5, 8) integer, parameter :: i2 = ieor(-1, 5) integer, parameter :: i3 = ieor(-4_8, 2_8) integer(8), parameter :: i4 = ieor(-2_8, 5_8) integer, parameter :: ar1(3) = ieor([5, 8, 9], [8, 5, 2]) integer(8), parameter :: ar2(3) = ieor([-1_8, -5_8, -10_8], [5_8, 8_8, 9_8]) integer :: arr1(3), arr3(3) integer(8) :: arr2(3) integer :: res(3) arr1 = [5, 8, 9] arr3 = [8, 5, 2] arr2 = [-1_8, -5_8, -10_8] print *, i1 if (i1 /= 13) error stop print *, i2 if (i2 /= -6) error stop print *, i3 if (i3 /= -2) error stop print *, i4 if (i4 /= -5) error stop print*, ieor(5, 8) if (ieor(5, 8) /= 13) error stop print*, ieor(-1, 5) if (ieor(-1, 5) /= -6) error stop print*, ieor(8, -4) if (ieor(8, -4) /= -12) error stop print*, ieor(-2, -5) if (ieor(-2, -5) /= 5) error stop print*, ieor(a1, a2) if (ieor(a1, a2) /= 13) error stop print*, ieor(a3, a4) if (ieor(a3, a4) /= 3) error stop print*, ieor(a2, a5) if (ieor(a2, a5) /= -10) error stop print*, ieor(a5, a6) if (ieor(a5, a6) /= 5) error stop print *, ar1 if (any(ar1 /= [13, 13, 11])) error stop print *, ar2 if (any(ar2 /= [-6, -13, -1])) error stop print *, ieor(arr1, arr3) if (any(ieor(arr1, arr3) /= [13, 13, 11])) error stop print *, ieor(arr2, arr2) if (any(ieor(arr2, arr2) /= [0, 0, 0])) error stop res = ieor(arr1, arr3) print *, res if (any(res /= [13, 13, 11])) error stop end program lfortran-0.63.0/integration_tests/common_30.f900000664000175000017500000000042015174404631021473 0ustar alastairalastairprogram common_30 implicit none common /block/ t integer :: t integer :: i, s t = 5 if (t /= 5) error stop s = 0 do, i = 1, t s = s + i end do if (s /= 15) error stop if (max(t, 42) /= 42) error stop if (max(t, 3) /= 5) error stop end program lfortran-0.63.0/integration_tests/fixed_form_io_keyword_02.f900000664000175000017500000000066115174404631024566 0ustar alastairalastair program fixed_form_io_keyword_02 implicit none character(len=1) :: seq character(len=5) :: str open(10, file='file_01_data.txt') read(10, *) str print *, 'str =', str if (str /= "10130") error stop 1 INQUIRE(UNIT=10,SEQUENTIAL=seq) print *, 'seq =', seq REWIND(UNIT=10) FLUSH(UNIT=10) end program fixed_form_io_keyword_02 lfortran-0.63.0/integration_tests/interface_18.f900000664000175000017500000000266315174404631022164 0ustar alastairalastairmodule module_interface_18 implicit none abstract interface subroutine OBJ(x, f) implicit none real(4), intent(in) :: x(:) real(4), intent(out) :: f end subroutine OBJ end interface interface evaluate module procedure evaluatef end interface evaluate contains function moderatex(x) result(y) implicit none real, intent(in) :: x(:) real :: y(size(x)) y = 2 end function moderatex subroutine evaluatef(calfun, x, f) implicit none procedure(OBJ) :: calfun real, intent(in) :: x(:) real, intent(out) :: f call calfun(moderatex(x), f) end subroutine evaluatef subroutine initxf(calfun, xpt) implicit none procedure(OBJ) :: calfun real, intent(out) :: xpt(:, :) real :: f real :: x(size(xpt, 1)) x = 1 f = 2 call evaluate(calfun, x, f) end subroutine initxf end module module_interface_18 program interface_18 use module_interface_18 implicit none real :: xpt(1, 5) call initxf(calfun, xpt) contains subroutine calfun(x, f) implicit none real, intent(in) :: x(:) real, intent(out) :: f print * , "x = " , x print * , "f = " , f if (x(1) /= 2.0) error stop if (f /= 2.0) error stop end subroutine end program lfortran-0.63.0/integration_tests/intrinsics_377.f900000664000175000017500000000075415174404631022500 0ustar alastairalastairprogram intrinsics_377 implicit none integer, allocatable :: a(:) integer :: idx, n n = 50 allocate(a(n)) a = -1 a(2:) = 1 idx = minval(a, dim=1) print *, idx if ( idx /= -1 ) error stop idx = minval(a, dim=1, mask=a>0) print *, idx if ( idx /= 1 ) error stop idx = maxval(a, dim=1) print *, idx if ( idx /= 1 ) error stop idx = maxval(a, dim=1, mask=a>0) print *, idx if ( idx /= 1 ) error stop end program lfortran-0.63.0/integration_tests/associate_17.f900000664000175000017500000000172415174404631022173 0ustar alastairalastairmodule stdlib_hashmaps_associate_17 implicit none type :: open_map_entry_type integer(4) :: inmap end type open_map_entry_type type open_map_entry_ptr type(open_map_entry_type), pointer :: target => null() end type open_map_entry_ptr type :: open_hashmap_type type(open_map_entry_ptr), allocatable :: inverse(:) end type open_hashmap_type end module stdlib_hashmaps_associate_17 program associate_17 use stdlib_hashmaps_associate_17 implicit none type(open_hashmap_type) :: map integer(4) :: inmap = 1 type(open_map_entry_type), pointer :: temp => null() allocate(map % inverse(1)) allocate(map % inverse(1) % target) temp => map % inverse(1) % target temp % inmap = 42 associate( target => map % inverse(inmap) % target ) print *, target % inmap if (target % inmap /= 42) error stop end associate deallocate(map % inverse(1) % target) end program lfortran-0.63.0/integration_tests/test_ieee_int.f900000664000175000017500000000316215174404631022527 0ustar alastairalastair! Test ieee_int function program test_ieee_int use, intrinsic :: ieee_arithmetic use, intrinsic :: iso_fortran_env, only: real32, real64 implicit none real(real32) :: x_sp real(real64) :: x_dp integer :: i print *, "Testing ieee_int..." ! Test 1: Convert 3.2 to integer (should round to 3) x_sp = 3.2_real32 i = ieee_int(x_sp) print *, "ieee_int(3.2) = ", i if (i /= 3) error stop "3.2 should convert to 3" ! Test 2: Convert 3.7 to integer (should round to 4) x_sp = 3.7_real32 i = ieee_int(x_sp) print *, "ieee_int(3.7) = ", i if (i /= 4) error stop "3.7 should convert to 4" ! Test 3: Negative number x_sp = -2.3_real32 i = ieee_int(x_sp) print *, "ieee_int(-2.3) = ", i if (i /= -2) error stop "-2.3 should convert to -2" ! Test 4: Negative number rounding x_sp = -2.7_real32 i = ieee_int(x_sp) print *, "ieee_int(-2.7) = ", i if (i /= -3) error stop "-2.7 should convert to -3" ! Test 5: Zero x_sp = 0.0_real32 i = ieee_int(x_sp) print *, "ieee_int(0.0) = ", i if (i /= 0) error stop "0.0 should convert to 0" ! Test 6: Double precision x_dp = 9.4_real64 i = ieee_int(x_dp) print *, "ieee_int(9.4d0) = ", i if (i /= 9) error stop "9.4d0 should convert to 9" ! Test 7: Large value (uses default rounding mode - round to nearest) x_sp = 100.4_real32 i = ieee_int(x_sp) print *, "ieee_int(100.4) = ", i if (i /= 100) error stop "100.4 should convert to 100" print *, "All ieee_int tests passed!" end program test_ieee_int lfortran-0.63.0/integration_tests/intrinsics_93.f900000664000175000017500000000233615174404631022411 0ustar alastairalastairprogram intrinsics_93 use iso_fortran_env, only: dp => real64, sp => real32 implicit none integer, parameter :: i1 = digits(31) integer(8), parameter :: i2 = digits(63) integer, parameter :: i3 = digits(24.5_sp) integer(8), parameter :: i4 = digits(53.5_dp) integer, parameter :: ar1 = digits([1, 33, 56]) integer, parameter :: ar2 = digits([1.0_sp, 33.0_sp, 56.0_sp]) integer :: i integer(8) :: j real :: x real(8) :: y integer :: arr1(3) = [1, 33, 56] real(8) :: arr2(3) = [1.0_dp, 33.0_dp, 56.0_dp] print *, i1 if (i1 /= 31) error stop print *, i2 if (i2 /= 31) error stop print *, i3 if (i3 /= 24) error stop print *, i4 if (i4 /= 53) error stop print *, ar1 if (ar1 /= 31) error stop print *, ar2 if (ar2 /= 24) error stop print *, digits(i) if (digits(i) /= 31) error stop print *, digits(j) if (digits(j) /= 63) error stop print *, digits(x) if (digits(x) /= 24) error stop print *, digits(y) if (digits(y) /= 53) error stop print *, digits(arr1) ! if (digits(arr1) /= 31) error stop ! Does not work #4367 print *, digits(arr2) ! if (digits(arr2) /= 53) error stop end programlfortran-0.63.0/integration_tests/bindc_07.f900000664000175000017500000000465515174404631021304 0ustar alastairalastairprogram bindc_07 use iso_c_binding, only: c_char, c_ptr, c_null_ptr, c_size_t, c_int, c_associated, c_f_pointer implicit none interface function test_getcwd(buf, size) result(res) bind(c, name="getcwd_dummy") import c_char, c_size_t, c_ptr character(kind=c_char,len=1), intent(out) :: buf integer(c_size_t), value, intent(in) :: size type(c_ptr) :: res end function test_getcwd function test_char_array(buf, len) result(res) bind(c, name="test_char_array") import c_char, c_int, c_ptr character(kind=c_char), dimension(*), intent(inout) :: buf integer(c_int), value, intent(in) :: len type(c_ptr) :: res end function test_char_array end interface ! Test variables character(len=1024) :: large_result character(len=1) :: small_result(256) character(len=50) :: medium_result type(c_ptr) :: ptr_result integer :: i type(c_ptr) :: res_ptr print *, "=== ROBUST BIND(C) CHARACTER ARRAY TEST ===" print *, "" ! Test 1: Large character variable print *, "TEST 1: Large character variable" large_result = repeat(' ', len(large_result)) ptr_result = test_getcwd(large_result, int(len(large_result), c_size_t)) if (c_associated(ptr_result)) then print *, "SUCCESS: Large buffer test passed" print *, "Result: '", trim(large_result), "'" else print *, "FAILED: Large buffer test failed" end if print *, "" ! Test 2: Array of single characters print *, "TEST 2: Array of single characters" small_result = ' ' res_ptr = test_char_array(small_result, int(size(small_result), c_int)) if (c_associated(res_ptr)) then print *, "SUCCESS: Small array test passed" write(*,'(A)', advance='no') "Result: '" do i = 1, min(size(small_result), 50) if (small_result(i) == char(0)) exit write(*,'(A)', advance='no') ,small_result(i) end do write(*,'(A)') "'" else print *, "FAILED: Small array test failed" end if ! Test 3: Medium character variable print *, "TEST 3: Medium character variable" medium_result = repeat(' ', len(medium_result)) ptr_result = test_getcwd(medium_result, int(len(medium_result), c_size_t)) if (c_associated(ptr_result)) then print *, "SUCCESS: Medium buffer test passed" print *, "Result: '", trim(medium_result), "'" else print *, "FAILED: Medium buffer test failed" end if print *, "" print *, "=== ALL TESTS COMPLETED ===" end program bindc_07lfortran-0.63.0/integration_tests/intrinsics_68.f900000664000175000017500000000223215174404631022406 0ustar alastairalastairprogram intrinsics_68 double precision :: x, y x = 1.0D0 y = -2.0D0 print *, dsign(x, y) print *, dsign(x, -y) print *, dsign(-x, y) print *, dsign(-x, -y) if (abs(dsign(x, y) - (-1.0D0)) > 1d-14) error stop if (abs(dsign(x, -y) - (1.0D0)) > 1d-14) error stop if (abs(dsign(-x, y) - (-1.0D0)) > 1d-14) error stop if (abs(dsign(-x, -y) - (1.0D0)) > 1d-14) error stop print *, dsign(0.0D0, y) print *, dsign(0.0D0, -y) print *, dsign(x, 0.0D0) print *, dsign(-x, 0.0D0) if (abs(dsign(0.0D0, y) - (-0.0D0)) > 1d-14) error stop if (abs(dsign(0.0D0, -y) - (0.0D0)) > 1d-14) error stop if (abs(dsign(x, 0.0D0) - (1.0D0)) > 1d-14) error stop if (abs(dsign(-x, 0.0D0) - (1.0D0)) > 1d-14) error stop print *, dsign(0.0D0, 0.0D0) print *, dsign(-0.0D0, 0.0D0) print *, dsign(0.0D0, -0.0D0) print *, dsign(-0.0D0, -0.0D0) if (abs(dsign(0.0D0, 0.0D0) - (0.0D0)) > 1d-14) error stop if (abs(dsign(-0.0D0, 0.0D0) - (0.0D0)) > 1d-14) error stop if (abs(dsign(0.0D0, -0.0D0) - (-0.0D0)) > 1d-14) error stop if (abs(dsign(-0.0D0, -0.0D0) - (-0.0D0)) > 1d-14) error stop end program lfortran-0.63.0/integration_tests/derived_types_74.f900000664000175000017500000000166715174404631023077 0ustar alastairalastairmodule derived_types_74_mod implicit none type :: string_t character(len=:), allocatable :: value end type type, abstract :: base end type type :: source_t type(string_t), allocatable :: modules_provided(:) end type type, extends(base) :: package_t type(source_t), allocatable :: sources(:) end type type :: model_t type(package_t), allocatable :: packages(:) end type end module program derived_types_74 use derived_types_74_mod implicit none type(string_t) :: module_name type(package_t), allocatable :: packages(:) integer :: i allocate(packages(1)) allocate(packages(1)%sources(1)) allocate(packages(1)%sources(1)%modules_provided(1)) packages(1)%sources(1)%modules_provided(1)%value = "module_abc" module_name = packages(1)%sources(1)%modules_provided(1) if (module_name%value /= "module_abc") error stop end program lfortran-0.63.0/integration_tests/modules_29.f900000664000175000017500000000016115174404631021665 0ustar alastairalastairprogram modules_29 use fpm_manifest_executable implicit none print *, "running modules_29 program" end program lfortran-0.63.0/integration_tests/bindc_38.f900000664000175000017500000000764515174404631021312 0ustar alastairalastair! Test: VOLATILE, ASYNCHRONOUS, PURE BIND(C) ! ! Covers: ! - VOLATILE attribute on BIND(C) module variable ! - ASYNCHRONOUS attribute on BIND(C) dummy arguments ! - PURE function with BIND(C) ! - Passing a BIND(C) procedure as actual argument via C_FUNLOC module bindc_38_globals use iso_c_binding implicit none integer(c_int), volatile, bind(C, name="g38_volatile_int") :: g38_volatile_int = 0 real(c_double), volatile, bind(C, name="g38_volatile_dbl") :: g38_volatile_dbl = 0.0d0 end module module bindc_38_procs use iso_c_binding implicit none contains pure integer(c_int) function add_pure(a, b) bind(c, name="f38_add_pure") integer(c_int), intent(in), value :: a, b add_pure = a + b end function end module module bindc_38_ifaces use iso_c_binding implicit none abstract interface integer(c_int) function int_binop_i(a, b) bind(C) import :: c_int integer(c_int), value :: a, b end function end interface interface ! C modifies the volatile variables subroutine c38_set_volatile_int(val) bind(c) import :: c_int integer(c_int), value :: val end subroutine subroutine c38_set_volatile_dbl(val) bind(c) import :: c_double real(c_double), value :: val end subroutine ! C function that takes ASYNCHRONOUS arrays (raw pointer in C) subroutine c38_fill_async(arr, n) bind(c) import :: c_int integer(c_int), intent(inout), asynchronous :: arr(*) integer(c_int), value :: n end subroutine ! C function that invokes a Fortran function pointer integer(c_int) function c38_invoke_binop(fp, a, b) bind(c) import :: c_int, c_funptr type(c_funptr), value :: fp integer(c_int), value :: a, b end function end interface end module program bindc_38 use iso_c_binding use bindc_38_globals use bindc_38_procs use bindc_38_ifaces implicit none call test_volatile() call test_asynchronous() call test_pure_bindc() call test_proc_as_argument() print *, "All bindc_38 tests passed." contains subroutine test_volatile() ! Set from Fortran, verify it's stored g38_volatile_int = 10 if (g38_volatile_int /= 10) error stop "FAIL: volatile int F" ! Set from C, read from Fortran call c38_set_volatile_int(42) if (g38_volatile_int /= 42) error stop "FAIL: volatile int C->F" g38_volatile_dbl = 1.5d0 if (abs(g38_volatile_dbl - 1.5d0) > 1.0d-10) & error stop "FAIL: volatile dbl F" call c38_set_volatile_dbl(3.14d0) if (abs(g38_volatile_dbl - 3.14d0) > 1.0d-10) & error stop "FAIL: volatile dbl C->F" end subroutine subroutine test_asynchronous() integer(c_int) :: arr(5) arr = [1, 2, 3, 4, 5] ! C doubles each element call c38_fill_async(arr, 5_c_int) if (arr(1) /= 2) error stop "FAIL: async arr(1)" if (arr(2) /= 4) error stop "FAIL: async arr(2)" if (arr(3) /= 6) error stop "FAIL: async arr(3)" if (arr(4) /= 8) error stop "FAIL: async arr(4)" if (arr(5) /= 10) error stop "FAIL: async arr(5)" end subroutine subroutine test_pure_bindc() integer(c_int) :: r r = add_pure(10_c_int, 20_c_int) if (r /= 30) error stop "FAIL: pure bindc add" r = add_pure(-5_c_int, 5_c_int) if (r /= 0) error stop "FAIL: pure bindc zero" end subroutine subroutine test_proc_as_argument() type(c_funptr) :: fp integer(c_int) :: r ! Get a C function pointer to our BIND(C) function fp = c_funloc(add_pure) ! Pass it to C, which invokes it r = c38_invoke_binop(fp, 7_c_int, 8_c_int) if (r /= 15) error stop "FAIL: proc as argument" end subroutine end program lfortran-0.63.0/integration_tests/openmp_19.f900000664000175000017500000000271515174404631021521 0ustar alastairalastairsubroutine intiailise_array_kernel(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a integer :: i !$omp parallel shared(a) private(i) !$omp do do i = 1, n a(i) = 12.91 end do !$omp end do !$omp end parallel print *, a(1), a(n), a(12), a(12841) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(n) - 12.91) > 1e-8) error stop if (abs(a(12) - 12.91) > 1e-8) error stop if (abs(a(12841) - 12.91) > 1e-8) error stop end subroutine subroutine initialise_array(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a interface subroutine intiailise_array_kernel(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a end subroutine end interface call intiailise_array_kernel(n, a) print *, a(1), a(n), a(12), a(12841) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(n) - 12.91) > 1e-8) error stop if (abs(a(12) - 12.91) > 1e-8) error stop if (abs(a(12841) - 12.91) > 1e-8) error stop end subroutine program openmp_19 use omp_lib integer, parameter :: n = 100000 integer :: i real, pointer :: b(:) interface subroutine initialise_array(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a end subroutine end interface allocate(b(n)) call omp_set_num_threads(4) call initialise_array(n, b) print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/array_04_pack.f900000664000175000017500000000076215174404631022331 0ustar alastairalastairprogram array_04_pack implicit none integer :: dims(2) integer, dimension(4) :: perm, dim_range = [1, 2, 3, 4] dims = [2, 3] ! pack() with a runtime-dependent mask: the result size is unknown at compile time. ! The array constructor [dims, pack(...)] should have size 4, matching perm. perm = [dims, pack(dim_range, dim_range /= dims(1) .and. dim_range /= dims(2))] if (perm(1) /= 2) error stop if (perm(2) /= 3) error stop if (perm(3) /= 1) error stop if (perm(4) /= 4) error stop end program lfortran-0.63.0/integration_tests/custom_operator_19.f900000664000175000017500000000205315174404631023443 0ustar alastairalastairmodule custom_operator_19_inner implicit none interface operator(.myop.) module procedure int_myop end interface contains pure function int_myop(a, b) result(r) integer, intent(in) :: a, b logical :: r r = (a == b) end function end module module custom_operator_19_outer use custom_operator_19_inner, only: operator(.myop.) implicit none end module module custom_operator_19_user use custom_operator_19_outer, only: operator(.myop.) implicit none interface operator(.myop.) module procedure logical_myop end interface contains pure function logical_myop(a, b) result(r) logical, intent(in) :: a, b logical :: r r = (a .eqv. b) end function end module program custom_operator_19 use custom_operator_19_user implicit none integer :: x, y logical :: p, q x = 1; y = 1 if (.not. (x .myop. y)) error stop x = 1; y = 2 if (x .myop. y) error stop p = .true.; q = .true. if (.not. (p .myop. q)) error stop p = .true.; q = .false. if (p .myop. q) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/read_72.f900000664000175000017500000000247715174404631021142 0ustar alastairalastairfunction get_adv() result(r) character(:), allocatable :: r r = "YES" end function program read_72 ! Test that advance= specifier works with non-constant expressions ! (function calls and variables, not just string literals) implicit none interface function get_adv() result(r) character(:), allocatable :: r end function end interface integer :: u, ios character(1) :: c character(3) :: adv_var open(newunit=u, status='scratch', form='formatted', action='readwrite') write(u, '(A)') "AB" write(u, '(A)') "CD" write(u, '(A)') "EF" rewind(u) ! Test 1: advance= with function call returning allocatable string read(u, '(A1)', advance='NO', iostat=ios) c if (c /= 'A' .or. ios /= 0) error stop read(u, '(A1)', advance=get_adv(), iostat=ios) c if (c /= 'B' .or. ios /= 0) error stop ! Should now be on second record read(u, '(A1)', advance='NO', iostat=ios) c if (c /= 'C' .or. ios /= 0) error stop ! Test 2: advance= with variable adv_var = "YES" read(u, '(A1)', advance=adv_var, iostat=ios) c if (c /= 'D' .or. ios /= 0) error stop ! Should now be on third record read(u, '(A1)', advance='NO', iostat=ios) c if (c /= 'E' .or. ios /= 0) error stop close(u) print *, "PASS" end program lfortran-0.63.0/integration_tests/nested_16.f900000664000175000017500000000162015174404631021474 0ustar alastairalastairmodule nested_16_mod implicit none type :: terminal integer :: a = 1 end type type :: toml_lexer integer :: dummy = 0 type(terminal) :: term = terminal() end type toml_lexer contains subroutine temp2(lex) class(toml_lexer), intent(inout) :: lex lex%dummy = 400 lex%term%a = 100 end subroutine temp2 subroutine wrapper(lexer) class(toml_lexer) :: lexer if (lexer%term%a /= 1) error stop call temp() if (lexer%dummy /= 400) error stop if (lexer%term%a /= 100) error stop contains subroutine temp() call temp2(lexer) end subroutine temp end subroutine wrapper end module nested_16_mod program nested_16 use nested_16_mod implicit none type(toml_lexer) :: my_lexer my_lexer%dummy = 123 call wrapper(my_lexer) end program nested_16 lfortran-0.63.0/integration_tests/string_56.f900000664000175000017500000000123415174404631021525 0ustar alastairalastairmodule string_56_mod implicit none public :: global_names character(len=:), allocatable :: global_names(:) contains function get_message() result(msg) character(:), allocatable :: msg msg = "World" end function get_message end module string_56_mod program string_56 use string_56_mod character(:), allocatable :: current_argument current_argument = "Hello" global_names=[character(len=5) :: current_argument] if (global_names(1) /= "Hello") error stop select case(get_message()) case("World") current_argument = "World" end select if (current_argument /= "World") error stop end programlfortran-0.63.0/integration_tests/derived_types_131.f900000664000175000017500000000110215174404631023131 0ustar alastairalastairprogram derived_types_131 implicit none type :: point integer :: x integer :: y end type ! reshape of derived type array as compile-time parameter type(point), parameter :: v(*) = reshape([point(1, 2)], [1]) type(point), parameter :: grid(2,2) = reshape( & [point(1,1), point(2,2), point(3,3), point(4,4)], [2,2]) if (v(1)%x /= 1) error stop if (v(1)%y /= 2) error stop if (grid(1,1)%x /= 1) error stop if (grid(2,1)%x /= 2) error stop if (grid(1,2)%x /= 3) error stop if (grid(2,2)%x /= 4) error stop if (grid(2,2)%y /= 4) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/where_06.f900000664000175000017500000000075515174404631021333 0ustar alastairalastairprogram where_06 implicit none integer :: x(10) x = [38, 79, -54, 13, -66, 77, -62, 39, 6, -3] if (get_positive_sum(x) /= 252) error stop contains integer function get_positive_sum(input_1, input_2) result(output) integer, intent(in) :: input_1(:) integer, intent(in), optional :: input_2 integer :: x(size(input_1)) x = input_1 where(input_1 < 0) x = 0 output = sum(x) end function get_positive_sum end program where_06 lfortran-0.63.0/integration_tests/intrinsics_216.f900000664000175000017500000001073315174404631022466 0ustar alastairalastairprogram intrinsics_216 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(sp) :: a, b, c real(dp) :: d, e, f integer :: i real(dp) :: w(18) real(sp) :: x(19) real(dp) :: expected_w(18) real(sp) :: expected_x(19) real(dp), parameter :: res(18) = tand([18.7234114226922479_dp, 31.7355871858161613_dp, 46.7189879975828859_dp, & -18.7234114226922479_dp, -31.7355871858161613_dp, -46.7189879975828859_dp, & -88.1889782219856926_dp, -87.4387217993888584_dp, -86.8629570229495442_dp, -86.3775039053440139_dp, & -85.9497575149846398_dp, -85.5629967823348778_dp, -85.2072890476047604_dp, -84.8761629060389708_dp, & -84.5651234927047142_dp, -84.2708982602068915_dp, -83.9910168022338581_dp, -83.7235599383380418_dp]) real(sp), parameter :: res_sp(19) = tand([17.7966309_sp, 27.7443714_sp, 36.0546188_sp, & -17.7966309_sp, -27.7443714_sp, -36.0546188_sp, -45.0000000_sp, -44.9713364_sp, -44.9713364_sp, & -44.9426460_sp, -44.9426460_sp, -44.9139252_sp, -44.9139252_sp, -44.8851776_sp, & -44.8851776_sp, -44.8564034_sp, -44.8564034_sp, -44.8275948_sp, -44.8275948_sp]) expected_w = [0.33893680906656531_dp, 0.61847095166537402_dp, 1.0618790637212407_dp, & -0.33893680906656531_dp, -0.61847095166537402_dp, -1.0618790637212407_dp, -31.626730189083542_dp, & -22.355091700495215_dp, -18.246009265584753_dp, -15.795576912540882_dp, -14.122687866626119_dp, & -12.887346837923063_dp, -11.926878796582502_dp, -11.152376450806424_dp, -10.510603475834616_dp, & -9.9674784142684150_dp, -9.5000362475747657_dp, -9.0921624583853777_dp] w = [18.7234114226922479_dp, 31.7355871858161613_dp, 46.7189879975828859_dp, -18.7234114226922479_dp, & -31.7355871858161613_dp, -46.7189879975828859_dp, -88.1889782219856926_dp, -87.4387217993888584_dp, & -86.8629570229495442_dp, -86.3775039053440139_dp, -85.9497575149846398_dp, -85.5629967823348778_dp, -85.2072890476047604_dp, & -84.8761629060389708_dp, -84.5651234927047142_dp, -84.2708982602068915_dp, -83.9910168022338581_dp, & -83.7235599383380418_dp] x = [17.7966309_sp, 27.7443714_sp, 36.0546188_sp, -17.7966309_sp, & -27.7443714_sp, -36.0546188_sp, -45.0000000_sp, -44.9713364_sp, -44.9713364_sp, & -44.9426460_sp, -44.9426460_sp, -44.9139252_sp, -44.9139252_sp, -44.8851776_sp, & -44.8851776_sp, -44.8564034_sp, -44.8564034_sp, -44.8275948_sp, -44.8275948_sp] expected_x = [0.320999980_sp, 0.526000023_sp, 0.727999985_sp, -0.320999980_sp, & -0.526000023_sp, -0.727999985_sp, -1.00000000_sp, -0.998999894_sp, -0.998999894_sp, & -0.997999907_sp, -0.997999907_sp, -0.996999860_sp, -0.996999860_sp, -0.995999992_sp, & -0.995999992_sp, -0.995000064_sp, -0.995000064_sp, -0.993999898_sp, -0.993999898_sp] do i = 1, size(res) print *, res(i) if (abs(res(i) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(w) print *, tand(w(i)) if (abs(tand(w(i)) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_x(i)) > 1e-5) error stop end do do i = 1, size(x) print *, tand(x(i)) if (abs(tand(x(i)) - expected_x(i)) > 1e-5) error stop end do a = 18.928_sp b = 32.627_sp c = 47.123_sp d = 18.829262783_dp e = 32.727262783_dp f = 47.223262783_dp print *, tand(a) if (abs(tand(a) - 0.342922598) > 1e-3) error stop print *, tand(b) if (abs(tand(b) - 0.640190780) > 1e-3) error stop print *, tand(c) if (abs(tand(c) - 1.07699490) > 1e-3) error stop print *, tand(18.928_sp) if (abs(tand(18.928_sp) - 0.342922598) > 1e-3) error stop print *, tand(32.627_sp) if (abs(tand(32.627_sp) - 0.640190780) > 1e-3) error stop print *, tand(47.123_sp) if (abs(tand(47.123_sp) - 1.07699490) > 1e-3) error stop print *, tand(d) if (abs(tand(d) - 0.34099778889496968) > 1e-3) error stop print *, tand(e) if (abs(tand(e) - 0.64266073192537432) > 1e-3) error stop print *, tand(f) if (abs(tand(f) - 1.0807816506290617) > 1e-3) error stop print *, tand(18.829262783_dp) if (abs(tand(18.829262783_dp) - 0.34099778889496968) > 1e-3) error stop print *, tand(32.727262783_dp) if (abs(tand(32.727262783_dp) - 0.64266073192537432) > 1e-3) error stop print *, tand(47.223262783_dp) if (abs(tand(47.223262783_dp) - 1.0807816506290617) > 1e-3) error stop end programlfortran-0.63.0/integration_tests/arrays_reshape_38.f900000664000175000017500000000055015174404631023227 0ustar alastairalastairprogram arrays_reshape_38 implicit none integer(8) :: n integer(8), dimension(:), allocatable :: x integer(8), allocatable :: x_tmp(:) x = [1_8, 2_8, 3_8, 4_8, 5_8] n = size(x, kind=8) if (n /= 5) error stop x_tmp = reshape(x, [n]) if (size(x_tmp) /= 5) error stop if (x_tmp(1) /= 1) error stop if (x_tmp(5) /= 5) error stop end program lfortran-0.63.0/integration_tests/generic_name_01.f900000664000175000017500000000266615174404631022633 0ustar alastairalastairmodule Complex_module implicit none type :: ComplexType real :: r real :: i contains procedure :: integer_add_subrout procedure :: real_add_subrout generic :: add => integer_add_subrout, real_add_subrout end type contains subroutine integer_add_subrout(this, r, i, sum) class(ComplexType), intent(in) :: this integer, intent(in) :: r, i type(ComplexType), intent(out) :: sum print *, "Calling integer_add_subrout" sum%r = this%r + r sum%i = this%i + i end subroutine subroutine real_add_subrout(this, r, i, sum) class(ComplexType), intent(in) :: this real, intent(in) :: r, i type(ComplexType), intent(out) :: sum print *, "Calling real_add_subrout" sum%r = this%r + r sum%i = this%i + i end subroutine end module program generic_name_01 use Complex_module, only: ComplexType implicit none real :: fpone, fptwo, fpzero, negfpone integer :: ione, izero type(ComplexType) :: a, c fpone = 1.0 fptwo = 2.0 fpzero = 0.0 ione = 1 izero = 0 negfpone = -1.0 c = ComplexType(fpone, fptwo) call c%add(ione, izero, a) print *, a%r, a%i if( a%r /= 2.0 ) error stop if( a%i /= 2.0 ) error stop call c%add(fpzero, negfpone, a) print *, a%r, a%i if( a%r /= 1.0 ) error stop if( a%i /= 1.0 ) error stop end program lfortran-0.63.0/integration_tests/complex_34.f900000664000175000017500000000165615174404631021672 0ustar alastairalastairprogram complex_34 implicit none complex :: x(3) x(1)%re = 1 x(2)%re = 2 x(3)%re = 3 x(1)%im = 4 x(2)%im = 5 x(3)%im = 6 if (abs(real(x(1)) - 1.0) > 1e-5) error stop if (abs(real(x(2)) - 2.0) > 1e-5) error stop if (abs(real(x(3)) - 3.0) > 1e-5) error stop if (abs(aimag(x(1)) - 4.0) > 1e-5) error stop if (abs(aimag(x(2)) - 5.0) > 1e-5) error stop if (abs(aimag(x(3)) - 6.0) > 1e-5) error stop if (abs(x(1)%re - 1.0) > 1e-5) error stop if (abs(x(2)%re - 2.0) > 1e-5) error stop if (abs(x(3)%re - 3.0) > 1e-5) error stop if (abs(x(1)%im - 4.0) > 1e-5) error stop if (abs(x(2)%im - 5.0) > 1e-5) error stop if (abs(x(3)%im - 6.0) > 1e-5) error stop call foo(x%re) call foo(x%im) contains subroutine foo(arr) real, intent(in) :: arr(3) if (abs(arr(1) + arr(2) + arr(3)) < 1e-5) error stop end subroutine end program complex_34 lfortran-0.63.0/integration_tests/complex_24.f900000664000175000017500000000046115174404631021662 0ustar alastairalastairprogram complex_24 complex(4) :: d(2,1) real (4) :: r(2,1) d = cmplx(1, 1) * reshape([1, 2], [2, 1]) print *, d if (abs(d(1, 1) - (1.00000000e+00, 1.00000000e+00)) > 1.0e-6) error stop if (abs(d(2, 1) - (2.00000000e+00, 2.00000000e+00)) > 1.0e-6) error stop end program complex_24 lfortran-0.63.0/integration_tests/select_type_47.f900000664000175000017500000000136715174404631022546 0ustar alastairalastairprogram select_type_47 implicit none call test_re_im((1.0, 2.0)) call test_re_im_dp(dcmplx(3.0d0, 4.0d0)) contains subroutine test_re_im(a) class(*), intent(in) :: a select type (a) type is (complex(4)) print *, a%re print *, a%im if (abs(a%re - 1.0) > 1e-5) error stop 1 if (abs(a%im - 2.0) > 1e-5) error stop 2 class default error stop 3 end select end subroutine subroutine test_re_im_dp(a) class(*), intent(in) :: a select type (a) type is (complex(8)) print *, a%re print *, a%im if (abs(a%re - 3.0d0) > 1d-10) error stop 4 if (abs(a%im - 4.0d0) > 1d-10) error stop 5 class default error stop 6 end select end subroutine end program lfortran-0.63.0/integration_tests/string_93.f900000664000175000017500000000214115174404631021524 0ustar alastairalastairprogram w1 implicit none call notstring_test () contains subroutine notstring_test () character(7), parameter :: notstring_dataa(7) = & ["candy ", 'x ', "not bad", 'bad ', 'not ', & 'is not ', 'no '] character(10), parameter :: notstring_expected(7) = & ['not candy ', 'not x ', 'not bad ', 'not bad ', 'not ', & 'not is not', 'not no '] character(len (notstring_expected)) :: notstring_results(size (notstring_dataa)) integer :: i ! notString ! The following line causes an 'Unhandled Exception'. notstring_results = [(notstring (notstring_dataa(i)), i=1, size (notstring_dataa))] print *, merge ('passed', 'failed', & all (notstring_results == notstring_expected)) end subroutine function notstring (str) character(*), intent(in) :: str character(:), allocatable :: notstring if (len (str) < 3) then notstring = 'not ' // str else if (str(1:3) /= 'not') then notstring = 'not ' // str else notstring = str end if end function end program lfortran-0.63.0/integration_tests/enum_02.f900000664000175000017500000000017715174404631021157 0ustar alastairalastairprogram enum_02 use enum_02_module, only: compiler_enum implicit none print *, compiler_enum end program enum_02 lfortran-0.63.0/integration_tests/volatile_01.f900000664000175000017500000000112115174404631022017 0ustar alastairalastairmodule sj0m_volatile_01 implicit none integer, parameter :: m90_sngl = kind(1.e0) contains function sj0_sngl(x) result(f) integer, parameter :: knd = m90_sngl real(knd) f real(knd), intent(in) :: x real(knd), volatile :: iota = epsilon(x) / 2 f = iota / 6 end function sj0_sngl end module sj0m_volatile_01 program volatile_01 use sj0m_volatile_01 implicit none real(m90_sngl) :: x = 1.0 real(m90_sngl) :: y y = sj0_sngl(x) print *, y if ( abs( y - 9.93410776E-09 ) > 1E-15 ) error stop end program lfortran-0.63.0/integration_tests/if_04.f900000664000175000017500000000065215174404631020611 0ustar alastairalastairprogram if_04 implicit none integer :: i i = 1 if (i == 1) then print *, "1" else if (i == 2) then print *, "2" elseif (i == 3) then print *, "3" else if (i == 4) then print *, "4" end if name: if (i == 1) then print *, "1" else if (i == 2) then name print *, "2" elseif (i == 3) then name print *, "3" else if (i == 4) then name print *, "4" else name print *, "Invalid!" endif name end lfortran-0.63.0/integration_tests/arrays_05.f900000664000175000017500000000030215174404631021505 0ustar alastairalastairprogram arrays_05 implicit none real, dimension(5) :: numbers = [1.5, 3.2, 4.5, 0.9, 7.2] integer :: i do i = 1, 5 numbers(i) = i * 2.0 end do numbers = [1.5, 3.2, 4.5, 0.9, 7.2] end program lfortran-0.63.0/integration_tests/arrays_17.f900000664000175000017500000000104515174404631021515 0ustar alastairalastairprogram arrays_17 integer, parameter :: real_kinds(2) = [4, 8] integer :: real_kinds2(2) = [4, 8] print *, size(real_kinds) print *, real_kinds if (real_kinds(1) /= 4) error stop if (real_kinds(2) /= 8) error stop print *, size(real_kinds2) print *, real_kinds2 if (real_kinds2(1) /= 4) error stop if (real_kinds2(2) /= 8) error stop real_kinds2 = [1, 2] print *, size(real_kinds2) print *, real_kinds2 if (real_kinds2(1) /= 1) error stop if (real_kinds2(2) /= 2) error stop end program lfortran-0.63.0/integration_tests/min_01.f900000664000175000017500000000370015174404631020770 0ustar alastairalastairprogram min_min real(8) :: real_inp1 real(8) :: real_inp2 real(4) :: real_inp3 real(4) :: real_inp4 real(8) :: real_inp5 real :: real_inp6 integer(4) :: int_inp1 integer(4) :: int_inp2 real(8) :: output_min integer(4) :: output_min0 real(4) :: output_amin0 integer(4) :: output_min1 real(4) :: output_amin1 real(8) :: output_dmin1 real(8) :: output_min_different_kinds real_inp1 = 5.0d0 real_inp2 = 10.0d0 real_inp3 = 5.0 real_inp4 = 10.0 int_inp1 = 5 int_inp2 = 10 real_inp5 = 5.2d0 real_inp6 = 9.0 output_min = min(real_inp1, real_inp2) print*, output_min if (abs(output_min - 5) >= 1e-15) error stop if( kind(output_min) /= 8) error stop "Incorrect kind for min" output_min0 = min0(int_inp1, int_inp2) print*, output_min0 if (output_min0 /= 5) error stop if( kind(output_min0) /= 4) error stop "Incorrect kind for min" output_amin0 = amin0(int_inp1, int_inp2) print*, output_amin0 if (abs(output_amin0 - 5) >= 1e-7) error stop if (kind (output_amin0) /= 4) error stop "Incorrect kind for min" output_min1 = min1(real_inp3, real_inp4) print*, output_min1 if (output_min1 /= 5) error stop if( kind(output_min1) /= 4) error stop "Incorrect kind for min" output_amin1 = amin1(real_inp3, real_inp4) print*, output_amin1 if (abs(output_amin1 - 5) >= 1e-7) error stop if( kind(output_amin1) /= 4) error stop "Incorrect kind for min" output_dmin1 = dmin1(real_inp1, real_inp1) print*, output_dmin1 if (abs(output_dmin1 - 5) >= 1e-15) error stop if( kind(output_dmin1) /= 8) error stop "Incorrect kind for min" output_min_different_kinds = min(real_inp5, real_inp6) print *, output_min_different_kinds if( abs( output_min_different_kinds - 5.2d0) > 1e-16) error stop if ( Kind(output_min_different_kinds) /= 8) error stop "Incorrect kind for min" end program lfortran-0.63.0/integration_tests/intrinsics_407.f900000664000175000017500000000524215174404631022467 0ustar alastairalastair! Test complex abs() with extreme values (overflow and underflow protection) ! This tests the numerically stable algorithm for complex abs program intrinsics_407 implicit none complex :: c1, c2, c3, c4, c5, c6 complex(8) :: z1, z2, z3, z4 real :: r1, r2, r3, r4, r5, r6 real(8) :: d1, d2, d3, d4 ! Normal case - basic sanity check c1 = (3.0, 4.0) r1 = abs(c1) if (abs(r1 - 5.0) > 1e-5) error stop "Test 1 failed" ! Large values (near overflow for single precision) ! sqrt(5.07e30^2 + 2.54e30^2) would overflow naively ! but the correct result ~5.67e30 is representable c2 = (5.07e30, 2.54e30) r2 = abs(c2) if (r2 < 5.0e30 .or. r2 > 6.0e30) error stop "Test 2 failed: overflow in abs()" ! Negative large values c3 = (-5.07e30, -2.54e30) r3 = abs(c3) if (abs(r3 - r2) > 1e25) error stop "Test 3 failed" ! Asymmetric large values (|im| > |re|) c4 = (2.54e30, 5.07e30) r4 = abs(c4) if (abs(r4 - r2) > 1e25) error stop "Test 4 failed" ! Double precision large values z1 = (1.0d150, 2.0d150) d1 = abs(z1) if (d1 < 2.0d150 .or. d1 > 3.0d150) error stop "Test 5 failed: overflow in double complex abs()" ! Double precision with |im| > |re| z2 = (2.0d150, 1.0d150) d2 = abs(z2) if (abs(d2 - d1) > 1d145) error stop "Test 6 failed" ! ===== UNDERFLOW TESTS ===== ! Small values that would underflow naively: x^2 + y^2 -> 0 ! but the correct result is representable ! Single precision underflow test ! 1e-30^2 = 1e-60 underflows, but sqrt(2)*1e-30 ~ 1.41e-30 is representable c5 = (1.0e-30, 1.0e-30) r5 = abs(c5) ! Expected: sqrt(2) * 1e-30 ~ 1.414e-30 if (r5 < 1.0e-30 .or. r5 > 2.0e-30) error stop "Test 7 failed: underflow in single complex abs()" ! Single precision underflow with asymmetric values c6 = (1.0e-30, 2.0e-30) r6 = abs(c6) ! Expected: sqrt(1 + 4) * 1e-30 ~ 2.236e-30 if (r6 < 2.0e-30 .or. r6 > 3.0e-30) error stop "Test 8 failed: underflow in single complex abs()" ! Double precision underflow test ! 1d-200^2 = 1d-400 underflows, but sqrt(2)*1d-200 ~ 1.414d-200 is representable z3 = (1.0d-200, 1.0d-200) d3 = abs(z3) ! Expected: sqrt(2) * 1d-200 ~ 1.414d-200 if (d3 < 1.0d-200 .or. d3 > 2.0d-200) error stop "Test 9 failed: underflow in double complex abs()" ! Double precision underflow with asymmetric values z4 = (1.0d-200, 2.0d-200) d4 = abs(z4) ! Expected: sqrt(1 + 4) * 1d-200 ~ 2.236d-200 if (d4 < 2.0d-200 .or. d4 > 3.0d-200) error stop "Test 10 failed: underflow in double complex abs()" print *, "All complex abs() overflow and underflow tests passed!" end program lfortran-0.63.0/integration_tests/subroutines_06.f900000664000175000017500000000275415174404631022604 0ustar alastairalastairmodule subroutines_06_bitset interface assignment(=) pure module subroutine assign_large( set1, set2 ) integer, intent(out) :: set1 integer, intent(in) :: set2 end subroutine assign_large pure module subroutine assign_logint8_large( self, logical_vector ) integer, intent(out) :: self logical, intent(in) :: logical_vector(:) end subroutine assign_logint8_large end interface interface error_handler module subroutine error_handler( message, error, status, & module, procedure ) character(*), intent(in) :: message integer, intent(in) :: error integer, intent(out), optional :: status character(*), intent(in), optional :: module character(*), intent(in), optional :: procedure end subroutine error_handler end interface error_handler contains module subroutine error_handler( message, error, status, module, procedure ) character(*), intent(in) :: message integer, intent(in) :: error integer, intent(out), optional :: status character(*), intent(in), optional :: module character(*), intent(in), optional :: procedure print *, error, status end subroutine error_handler end module program subroutines_06 use subroutines_06_bitset implicit none ! empty program end program subroutines_06 lfortran-0.63.0/integration_tests/intrinsics_49.f900000664000175000017500000000163415174404631022412 0ustar alastairalastairprogram intrinsics_49 ! A test of complex and real kinds 4 and 8 sin intrinsic implicit none block real(kind=4) :: x, y complex :: z, r x = 1.0 y = 2.0 z = cmplx(x, y) r = sin(z) if (abs(real(r) - 3.16577864) > 1e-6) error stop if (abs(imag(r) - 1.95960093) > 1e-6) error stop end block block real(kind=8) :: x, y complex :: z, r x = 1.0 y = 2.0 z = cmplx(x, y) r = sin(z) if (abs(real(r) - 3.16577864) > 1e-6) error stop if (abs(imag(r) - 1.95960093) > 1e-6) error stop end block block real(kind=4) :: x, r x = 1.0 r = sin(x) if (abs(r - 0.841470957) > 1e-6) error stop end block block real(kind=8) :: x, r x = 1.0 r = sin(x) if (abs(r - 0.841470957) > 1e-6) error stop end block end programlfortran-0.63.0/integration_tests/intrinsics_411.f900000664000175000017500000000135115174404631022457 0ustar alastairalastairmodule intrinsics_411_asciimod implicit none public iascii contains pure function iascii( string) character,intent(in):: string*(*) integer iascii(len(string)) iascii = iachar(transfer(string,(/'A'/))) end function iascii end module program intrinsics_411 use intrinsics_411_asciimod, only: iascii implicit none integer :: result(1), expected(1) integer :: result3(3), expected3(3) result = iascii('a') expected = (/97/) if (any(result /= expected)) error stop "iascii('a') failed" result3 = iascii('abc') expected3 = (/97, 98, 99/) if (any(result3 /= expected3)) error stop "iascii('abc') failed" if (size(iascii('')) /= 0) error stop "iascii('') size failed" end program intrinsics_411 lfortran-0.63.0/integration_tests/gpu_metal_113.f900000664000175000017500000000101515174404631022243 0ustar alastairalastairprogram gpu_metal_113 implicit none real :: w(2,2), v(2), result(2) integer :: i w(1,1) = 1.0 w(2,1) = 2.0 w(1,2) = 3.0 w(2,2) = 4.0 v = [1.0, 2.0] result = 0.0 ! matmul(transpose(w), v): ! w = [[1,2],[3,4]], transpose(w) = [[1,3],[2,4]] ! result(1) = 1*1 + 2*2 = 5 ! result(2) = 3*1 + 4*2 = 11 do concurrent (i = 1:1) result = matmul(transpose(w), v) end do if (abs(result(1) - 5.0) > 1e-6) error stop if (abs(result(2) - 11.0) > 1e-6) error stop print *, result end program lfortran-0.63.0/integration_tests/select_type_11.f900000664000175000017500000000115015174404631022523 0ustar alastairalastairprogram select_type_11 implicit none integer, save :: arr(3) = [1, 2, 3] print *, "Before:", arr call update_any(arr) print *, "After: ", arr if(arr(1) /= 10) then print *, "Test failed: arr(1) should be 10, but is ", arr(1) else print *, "Test passed: arr(1) is ", arr(1) end if contains subroutine update_any(generic) class(*) :: generic(:) integer, pointer :: xx(:) select type(generic) type is (integer) xx => generic xx(1) = 10 end select end subroutine update_any end program select_type_11lfortran-0.63.0/integration_tests/lapack_05.f900000664000175000017500000000211015174404631021436 0ustar alastairalastair! MRE: LAPACK-style 2D assumed-size array with leading dimension ! Tests: PointerArray ABI for assumed-size dummy arguments ! Pattern: subroutine with A(LDA, *) passed from caller program lapack_05 implicit none integer, parameter :: LDA = 4, N = 3 real :: A(LDA, N), B(LDA, N) integer :: i, j ! Initialize arrays do j = 1, N do i = 1, LDA A(i,j) = real(i + (j-1)*LDA) B(i,j) = 0.0 end do end do ! Call LAPACK-style subroutine call copy_matrix(LDA, N, A, LDA, B, LDA) ! Verify result do j = 1, N do i = 1, LDA if (abs(B(i,j) - A(i,j)) > 1.0e-6) error stop 1 end do end do print *, "PASS" end program ! LAPACK-style subroutine with assumed-size arrays subroutine copy_matrix(M, N, A, LDA, B, LDB) implicit none integer, intent(in) :: M, N, LDA, LDB real, intent(in) :: A(LDA, *) real, intent(out) :: B(LDB, *) integer :: i, j do j = 1, N do i = 1, M B(i,j) = A(i,j) end do end do end subroutine lfortran-0.63.0/integration_tests/gpu_metal_121.f900000664000175000017500000000144015174404631022244 0ustar alastairalastairmodule gpu_metal_121_m implicit none type :: activation_t integer :: s = 1 contains procedure :: evaluate => real_evaluate end type contains elemental function real_evaluate(self, x) result(y) class(activation_t), intent(in) :: self real, intent(in) :: x real :: y y = max(0., x) * self%s end function end module program gpu_metal_121 use gpu_metal_121_m implicit none type(activation_t) :: act integer :: pair, n real :: a(3), z(3) act = activation_t(1) n = 3 z = [1.0, -2.0, 3.0] a = 0.0 do concurrent (pair = 1:2) block a(1:n) = act%evaluate(z(1:n)) end block end do print *, a(1), a(2), a(3) if (abs(a(1) - 1.0) > 1e-6) error stop if (abs(a(2)) > 1e-6) error stop if (abs(a(3) - 3.0) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/allocate_29.f900000664000175000017500000000272115174404631022005 0ustar alastairalastairprogram allocate_29 implicit none character(len=:), allocatable :: names(:) call list_examples(names) if (.not. allocated(names)) then error stop "ERROR: names is not allocated" end if if (size(names) /= 0) then error stop "ERROR: size(names) is not 0" end if if (len(names) /= 1) then error stop "ERROR: len(names) is not 1" end if print *, size(names) contains subroutine list_examples(names) character(len=:), allocatable, intent(out) :: names(:) integer, parameter :: entry_len = 256 integer, parameter :: initial_capacity = 64 character(len=entry_len), allocatable :: entries(:) integer :: capacity capacity = initial_capacity call ensure_entry_capacity(entries, entry_len, capacity) allocate(character(len=1) :: names(0)) end subroutine list_examples subroutine ensure_entry_capacity(buffer, string_len, new_capacity) integer, intent(in) :: string_len integer, intent(in) :: new_capacity character(len=string_len), allocatable, intent(inout) :: buffer(:) character(len=string_len), allocatable :: tmp(:) if (new_capacity <= 0) then allocate(character(len=string_len) :: tmp(1)) else allocate(character(len=string_len) :: tmp(new_capacity)) end if call move_alloc(tmp, buffer) end subroutine ensure_entry_capacity end program allocate_29 lfortran-0.63.0/integration_tests/derived_component_section_01.f900000664000175000017500000000106615174404631025440 0ustar alastairalastairprogram derived_component_section_01 implicit none type t2 integer :: x end type type t1 integer :: n type(t2), allocatable :: a(:) end type type(t1) :: v(1) integer :: tmp(1) v(1)%n = 775 allocate(v(1)%a(1)) v(1)%a(1)%x = -13 tmp = v(:)%n if (tmp(1) /= 775) error stop "wrong value in derived component section" if (.not. allocated(v(1)%a)) error stop "allocatable component unexpectedly deallocated" if (v(1)%a(1)%x /= -13) error stop "allocatable component data got corrupted" end program derived_component_section_01 lfortran-0.63.0/integration_tests/intrinsics_182.f900000664000175000017500000000207215174404631022465 0ustar alastairalastairprogram intrinsics_182 use iso_fortran_env, only: dp => real64 integer :: i, j, shift1 integer(8) :: a, b, shift2 i = 10 j = 4 shift1 = 3 a = 7 b = 12 shift2 = 5 print *, dshiftl(10, 4, 3) if(dshiftl(10, 4, 3) /= 80) error stop print *, dshiftl(7_dp, 12_dp, 5) if(dshiftl(7_dp, 12_dp , 5) /= 224) error stop print *, dshiftl(10, 12, 7) if(dshiftl(10, 12, 7) /= 1280) error stop print *, dshiftl(i, j, shift1) if(dshiftl(i, j, shift1) /= 80) error stop print *, dshiftl(a, b, shift2) if(dshiftl(a, b, shift2) /= 224) error stop print *, kind(dshiftl(10, 4, 3)) if(kind(dshiftl(10, 4, 3)) /= 4) error stop print *, kind(dshiftl(7_dp, 12_dp, 5)) if(kind(dshiftl(7_dp, 12_dp, 5)) /= 8) error stop print *, kind(dshiftl(10, 12, 7)) if(kind(dshiftl(10, 12, 7)) /= 4) error stop print *, kind(dshiftl(i, j, shift1)) if(kind(dshiftl(i, j, shift1)) /= 4) error stop print *, kind(dshiftl(a, b, shift2)) if(kind(dshiftl(a, b, shift2)) /= 8) error stop end program lfortran-0.63.0/integration_tests/fixed_form_select_case_02.f900000664000175000017500000000064115174404631024663 0ustar alastairalastair program fixed_form_select_case_02 integer :: i, j i = 1 j = 0 select case (i) case (1) call sub $ (j) end select if (j /= 42) error stop print *, j contains subroutine sub(x) integer, intent(inout) :: x x = 42 end subroutine sub end program lfortran-0.63.0/integration_tests/functions_49.f900000664000175000017500000000076715174404631022243 0ustar alastairalastairmodule functions_49_mod contains function foo (x) result(res) character(*) :: x character(10) :: res end function function ff(line,length) result(strout) character(len=*):: line integer :: length character(len=max(length, len(foo(line)))) :: strout end function end module program functions_49 use functions_49_mod integer :: x x = len(ff("hello",5)) print *, x if(x /= max(5, len(foo("hello")))) error stop end program lfortran-0.63.0/integration_tests/bindc_19.f900000664000175000017500000000301615174404631021275 0ustar alastairalastair! Test: automatic-size character array with trim() in dimension expression ! Verifies that when a function returns an automatic-size character array ! whose dimension depends on trim(), the temporary buffer is allocated ! with the correct size (not evaluated from uninitialized return slots). module bindc_19_mod use iso_c_binding, only: c_char, c_null_char implicit none contains function to_c_char(value) result(cstr) character(len=*), intent(in) :: value character(kind=c_char) :: cstr(len(value)+1) integer :: i do i = 1, len(value) cstr(i) = value(i:i) end do cstr(len(value)+1) = c_null_char end function subroutine use_c_char(cstr, expected_len) character(kind=c_char), intent(in) :: cstr(*) integer, intent(in) :: expected_len integer :: i do i = 1, expected_len if (cstr(i) == c_null_char) error stop end do if (cstr(expected_len + 1) /= c_null_char) error stop end subroutine subroutine do_check(path) character(len=*), intent(in) :: path character(:), allocatable :: msg call use_c_char(to_c_char(trim(path)), len_trim(path)) msg = "x" if (len(msg) /= 1) error stop if (msg /= "x") error stop end subroutine end module program bindc_19 use bindc_19_mod implicit none call do_check("rand_nonexistent_path") call do_check("short") call do_check("a much longer test string for safety") print *, "ok" end program lfortran-0.63.0/integration_tests/c_sizeof_05.f900000664000175000017500000000065215174404631022015 0ustar alastairalastairprogram c_sizeof_05 use, intrinsic :: iso_c_binding implicit none integer(c_int) :: my_integer integer(c_size_t), parameter :: byte_size = c_sizeof(my_integer) real(c_double) :: my_double integer(c_size_t), parameter :: double_size = c_sizeof(my_double) print *, byte_size if (byte_size /= 4) error stop print *, double_size if (double_size /= 8) error stop end program c_sizeof_05 lfortran-0.63.0/integration_tests/expr_06.f900000664000175000017500000000011215174404631021162 0ustar alastairalastairprogram expr_06 implicit none integer :: x = 3 + 6 print *, x end program lfortran-0.63.0/integration_tests/minpack_01.f900000664000175000017500000000012515174404631021625 0ustar alastairalastairprogram main use minpack_01, only: enorm1 print *, enorm1(1.0d0) end program lfortran-0.63.0/integration_tests/file_05_data.dat0000664000175000017500000000003015174404631022264 0ustar alastairalastairûÿÿÿþÿÿÿlfortran-0.63.0/integration_tests/intrinsics_51.f900000664000175000017500000000410015174404631022372 0ustar alastairalastairprogram intrinsics_51 implicit none real :: x = 1.0 real, allocatable :: a(:, :), dr(:), er(:) real :: b(2, 2, 2), cr(5) integer :: i, j, k allocate(a(3, 2), dr(10), er(13)) do i = lbound(b, 1), ubound(b, 1) do j = lbound(b, 2), ubound(b, 2) do k = lbound(b, 3), ubound(b, 3) b(i, j, k) = 4*i - 5*j - 6*k end do end do end do do i = lbound(a, 1), ubound(a, 1) do j = lbound(a, 2), ubound(a, 2) a(i, j) = 4*i + 5*j end do end do print *, [1., 2., 3., 4., 5.] print *, "basic", sin([1., 2., 3., 4., 5.]) print *, [[1., 2., 3.], [4., 5.]] cr = sin([[1., 2., 3.], [4., 5.]]) print *, "cr: ", cr do i = lbound(cr, 1), ubound(cr, 1) if( abs(cr(i) - sin(real(i))) > 1e-6 ) error stop end do print *, [[1., 2., 3.], a, 5.] dr = sin([[1., 2., 3.], a, 5.]) print *, "dr.1: ", dr do i = 1, 3 if( abs(dr(i) - sin(real(i))) > 1e-6 ) error stop end do k = 4 do j = lbound(a, 2), ubound(a, 2) do i = lbound(a, 1), ubound(a, 1) if( abs(dr(k) - sin(real(4*i + 5*j))) > 1e-6 ) error stop k = k + 1 end do end do if( abs(dr(k) - sin(5.)) > 1e-6 ) error stop print *, [[1., 2., b(:, 1, :)], a, 5.] er = sin([[1., 2., b(:, 1, :)], a, 5.]) print *, "er: ", er do i = 1, 2 if( abs(er(i) - sin(real(i))) > 1e-6 ) error stop end do k = 3 do j = lbound(b, 3), ubound(b, 3) do i = lbound(b, 1), ubound(b, 1) if( abs(er(k) - sin(real(4*i - 5 - 6*j))) > 1e-6 ) error stop k = k + 1 end do end do do j = lbound(a, 2), ubound(a, 2) do i = lbound(a, 1), ubound(a, 1) if( abs(er(k) - sin(real(4*i + 5*j))) > 1e-6 ) error stop k = k + 1 end do end do if( abs(er(k) - sin(5.)) > 1e-6 ) error stop print *, [[1., 2., x], a, 5.] dr = sin([[1., 2., x], a, 5.]) print *, "dr.2: ", dr do i = 1, 2 if( abs(dr(i) - sin(real(i))) > 1e-6 ) error stop end do if( abs(dr(3) - sin(x)) > 1e-6 ) error stop k = 4 do j = lbound(a, 2), ubound(a, 2) do i = lbound(a, 1), ubound(a, 1) if( abs(dr(k) - sin(real(4*i + 5*j))) > 1e-6 ) error stop k = k + 1 end do end do if( abs(dr(k) - sin(5.)) > 1e-6 ) error stop end program lfortran-0.63.0/integration_tests/select_type_01.f900000664000175000017500000000160215174404631022524 0ustar alastairalastairprogram select_type_01 implicit none type base integer::i end type type, extends(base)::child integer::j end type class(base), pointer :: bptr type(base), target :: base_target = base(10) type(child), target :: child_target child_target = child(20, 30) print *, base_target%i print *, child_target%i, child_target%j bptr => child_target call perform_select_type(bptr) bptr => base_target call perform_select_type(bptr) contains subroutine perform_select_type(bptr) class(base), pointer :: bptr select type(bptr) type is (base) print *, "base type: component value: ", bptr%i if( bptr%i /= 10 ) error stop type is (child) print *, "child type: component values: ", bptr%i, bptr%j if( bptr%i /= 20 ) error stop if( bptr%j /= 30 ) error stop end select end subroutine end program select_type_01 lfortran-0.63.0/integration_tests/intrinsics_06.f900000664000175000017500000000046515174404631022404 0ustar alastairalastairprogram intrinsics_06 real :: x integer, parameter :: dp = kind(0.d0) x = asin(0.84147098) print *, x x = acos(0.54030231) print *, x x = atan(1.5574077) print *, x x = datan(1.5574077_dp) print *, x x = asinh(1.1752012) print *, x x = acosh(1.5430806) print *, x x = atanh(0.76159416) print *, x end lfortran-0.63.0/integration_tests/gpu_metal_150.f900000664000175000017500000000174515174404631022256 0ustar alastairalastair! Test: nested associate blocks with function calls inside a function ! called from do concurrent. Exercises gpu_offload pass symbol table ! fixup for FunctionCall nodes in duplicated associate block bodies. module gpu_metal_150_m implicit none contains pure function add_one(x) result(r) real, intent(in) :: x real :: r r = x + 1.0 end function pure function compute(x) result(r) real, intent(in) :: x real :: r integer :: dummy associate(dummy => 1) associate(y => add_one(x)) r = y + real(dummy) end associate end associate end function end module program gpu_metal_150 use gpu_metal_150_m, only: compute implicit none integer, parameter :: n = 4 real :: a(n), b(n) integer :: i do i = 1, n a(i) = real(i) end do do concurrent(i = 1:n) b(i) = compute(a(i)) end do ! compute(x) = add_one(x) + 1 = (x+1) + 1 = x+2 if (any(abs(b - [3.0, 4.0, 5.0, 6.0]) > 1.0e-6)) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/arrays_50_mod.f900000664000175000017500000000120615174404631022350 0ustar alastairalastairmodule arrays_50_mod_b integer ::j=20 integer ::j2=30 end module arrays_50_mod_b module arrays_50_mod_a contains subroutine fdf() use arrays_50_mod_b integer :: o(j,j2) print *,j,j2 if (j /= 20) error stop if (j2 /= 30) error stop print *, size(o) if (size(o) /= 600) error stop end subroutine fdf end module arrays_50_mod_a lfortran-0.63.0/integration_tests/inquire_14.f900000664000175000017500000003402315174404631021667 0ustar alastairalastair#define TEST_F2003 #define TEST_F2003ASYNC #define TEST_F2018 program inquire_14 implicit none ! Test various INQUIRE return values ! Most of these tests are based on Table C.1 in Section C.6.5 of F95. ! F2003, F2018 and F2023 can optionally be enabled. character(20) :: access, action, blank, delim, direct, form, formatted character(20) :: name, pad, position, read, readwrite, sequential character(20) :: unformatted, write logical :: exist, named, opened integer :: iostat, nextrec, number, recl #ifdef TEST_F2003 character(20) :: decimal, encoding, round, signc, stream integer :: pos #endif #ifdef TEST_F2003ASYNC character(16) :: async integer :: id logical :: pending #endif #ifdef TEST_F2023 character(16) :: leading_zero #endif integer, parameter :: lun = 42 character(*), parameter :: lfn = 'inquire_14_file.txt' ! Make sure there is no file with the name we will be using open (lun, file=lfn, status='old', iostat=iostat) if (iostat == 0) then close (lun, status='delete') end if ! File not connected yet call init_vars () inquire (file=lfn, access=access, action=action, blank=blank, delim=delim, & direct=direct, form=form, formatted=formatted, pad=pad, position=position, & name=name, named=named, number=number, opened=opened, & read=read, readwrite=readwrite, sequential=sequential, unformatted=unformatted, & write=write, iostat=iostat) ! In two cases, namely name= and pad=, the F95 draft is wrong, and F2003-onwards ! are correct. call pf (access == 'UNDEFINED') call pf (action == 'UNDEFINED') call pf (blank == 'UNDEFINED') call pf (delim == 'UNDEFINED') call pf (direct == 'UNKNOWN') call pf (.not. exist) call pf (form == 'UNDEFINED') call pf (formatted == 'UNKNOWN') call pf (iostat == 0) call pf (name == lfn)! (F95 says 'not the same as FILE= value') call pf (named) call pf (number == -1) call pf (.not. opened) call pf (pad == 'UNDEFINED')! F95 says 'YES' which is wrong call pf (position == 'UNDEFINED') call pf (read == 'UNKNOWN') call pf (readwrite == 'UNKNOWN') call pf (sequential == 'UNKNOWN') call pf (unformatted == 'UNKNOWN') call pf (write == 'UNKNOWN') #ifdef TEST_F2003 inquire (file=lfn, decimal=decimal, encoding=encoding, pos=pos, & round=round, sign=signc, stream=stream) call pf (decimal == 'UNDEFINED') call pf (encoding == 'UNKNOWN') call pf (round == 'UNDEFINED') call pf (signc == 'UNDEFINED') call pf (stream == 'UNKNOWN') #endif #ifdef TEST_F2003ASYNC inquire (file=lfn, asynchronous=async) call pf (async == 'UNDEFINED') #endif #ifdef TEST_F2018 inquire (file=lfn, recl=recl) call pf (recl == -1) #endif #ifdef TEST_F2023 inquire (file=lfn, leading_zero=leading_zero) call pf (leading_zero == 'UNDEFINED') #endif ! Unit not connected yet call init_vars () inquire (unit=lun, access=access, action=action, blank=blank, delim=delim, & direct=direct, form=form, formatted=formatted, pad=pad, position=position, & name=name, named=named, number=number, opened=opened, & read=read, readwrite=readwrite, sequential=sequential, unformatted=unformatted, & write=write, iostat=iostat) ! In two cases, namely name= and pad=, the F95 draft is wrong, and F2003-onwards ! are correct. call pf (access == 'UNDEFINED') call pf (action == 'UNDEFINED') call pf (blank == 'UNDEFINED') call pf (delim == 'UNDEFINED') call pf (direct == 'UNKNOWN') call pf (.not. exist) call pf (form == 'UNDEFINED') call pf (formatted == 'UNKNOWN') call pf (iostat == 0) call pf (name == 'xxx')! Assume untouched (F95 says 'UNDEFINED') call pf (.not. named) call pf (number == -1) call pf (.not. opened) call pf (pad == 'UNDEFINED')! F95 says 'YES' which is wrong call pf (position == 'UNDEFINED') call pf (read == 'UNKNOWN') call pf (readwrite == 'UNKNOWN') call pf (sequential == 'UNKNOWN') call pf (unformatted == 'UNKNOWN') call pf (write == 'UNKNOWN') #ifdef TEST_F2003 inquire (unit=lun, decimal=decimal, encoding=encoding, pos=pos, & round=round, sign=signc, stream=stream) call pf (decimal == 'UNDEFINED') call pf (encoding == 'UNKNOWN') call pf (round == 'UNDEFINED') call pf (signc == 'UNDEFINED') call pf (stream == 'UNKNOWN') #endif #ifdef TEST_F2003ASYNC inquire (unit=lun, asynchronous=async) call pf (async == 'UNDEFINED') #endif #ifdef TEST_F2018 inquire (unit=lun, recl=recl) call pf (recl == -1) #endif #ifdef TEST_F2023 inquire (unit=lun, leading_zero=leading_zero) call pf (leading_zero == 'UNDEFINED') #endif ! Open the file to connect it to the unit - sequential access #if !defined(__LFORTRAN__) open (lun, file=lfn, status='new', access='sequential', form='formatted', recl=80) #else open (lun, file=lfn, status='new', access='sequential', form='formatted') #endif write (lun,*) 'hello world!' rewind (lun) call init_vars () inquire (file=lfn, access=access, action=action, blank=blank, delim=delim, & direct=direct, form=form, formatted=formatted, pad=pad, position=position, & name=name, named=named, number=number, opened=opened, recl=recl, & read=read, readwrite=readwrite, sequential=sequential, unformatted=unformatted, & write=write, iostat=iostat) call pf (access == 'SEQUENTIAL') call pf (action == 'READWRITE') call pf (blank == 'NULL') call pf (delim == 'NONE') call pf (direct == 'NO') call pf (.not. exist) call pf (form == 'FORMATTED') call pf (formatted == 'YES') call pf (iostat == 0) call pf (name == lfn) call pf (named) call pf (number == lun) call pf (opened) call pf (pad == 'YES') call pf (position == 'REWIND') call pf (read == 'YES') call pf (readwrite == 'YES') #if !defined(__LFORTRAN__) call pf (recl == 80) #endif call pf (sequential == 'YES') call pf (unformatted == 'NO') call pf (write == 'YES') #ifdef TEST_F2003 inquire (file=lfn, decimal=decimal, encoding=encoding, pos=pos, & round=round, sign=signc, stream=stream) call pf (decimal == 'POINT') call pf (encoding == 'DEFAULT') call pf (round == 'PROCESSOR_DEFINED') call pf (signc == 'PROCESSOR_DEFINED') call pf (stream == 'NO') #endif ! Unit is connected call init_vars () inquire (unit=lun, access=access, action=action, blank=blank, delim=delim, & direct=direct, form=form, formatted=formatted, pad=pad, position=position, & name=name, named=named, number=number, opened=opened, recl=recl, & read=read, readwrite=readwrite, sequential=sequential, unformatted=unformatted, & write=write, iostat=iostat) call pf (access == 'SEQUENTIAL') call pf (action == 'READWRITE') call pf (blank == 'NULL') call pf (delim == 'NONE') call pf (direct == 'NO') call pf (.not. exist) call pf (form == 'FORMATTED') call pf (formatted == 'YES') call pf (iostat == 0) call pf (name == lfn) call pf (named) call pf (number == lun) call pf (opened) call pf (pad == 'YES') call pf (position == 'REWIND') call pf (read == 'YES') call pf (readwrite == 'YES') #if !defined(__LFORTRAN__) call pf (recl == 80) #endif call pf (sequential == 'YES') call pf (unformatted == 'NO') call pf (write == 'YES') #ifdef TEST_F2003 inquire (unit=lun, decimal=decimal, encoding=encoding, pos=pos, & round=round, sign=signc, stream=stream) call pf (decimal == 'POINT') call pf (encoding == 'DEFAULT') call pf (round == 'PROCESSOR_DEFINED') call pf (signc == 'PROCESSOR_DEFINED') call pf (stream == 'NO') #endif close (lun, status='delete') #ifdef TEST_F2003 ! Open the file to connect it to the unit - sequential stream access open (lun, file=lfn, status='new', access='stream', form='unformatted') write (lun) 'hello world!' rewind (lun) call init_vars () inquire (file=lfn, access=access, action=action, blank=blank, delim=delim, & direct=direct, form=form, formatted=formatted, pad=pad, position=position, & name=name, named=named, number=number, opened=opened, & read=read, readwrite=readwrite, sequential=sequential, unformatted=unformatted, & write=write, iostat=iostat) call pf (access == 'STREAM') call pf (action == 'READWRITE') call pf (blank == 'UNDEFINED') call pf (delim == 'UNDEFINED') call pf (direct == 'NO') call pf (.not. exist) call pf (form == 'UNFORMATTED') call pf (formatted == 'NO') call pf (iostat == 0) call pf (name == lfn) call pf (named) call pf (number == lun) call pf (opened) call pf (pad == 'UNDEFINED') call pf (position == 'REWIND') call pf (read == 'YES') call pf (readwrite == 'YES') call pf (sequential == 'NO')! ???? call pf (unformatted == 'YES') call pf (write == 'YES') inquire (file=lfn, decimal=decimal, encoding=encoding, pos=pos, & round=round, sign=signc, stream=stream) call pf (decimal == 'UNDEFINED') call pf (encoding == 'UNDEFINED') call pf (round == 'PROCESSOR_DEFINED') call pf (signc == 'PROCESSOR_DEFINED') call pf (stream == 'YES') #ifdef TEST_F2018 inquire (file=lfn, recl=recl) call pf (recl == -2) #endif ! Unit is connected call init_vars () inquire (unit=lun, access=access, action=action, blank=blank, delim=delim, & direct=direct, form=form, formatted=formatted, pad=pad, position=position, & name=name, named=named, number=number, opened=opened, & read=read, readwrite=readwrite, sequential=sequential, unformatted=unformatted, & write=write, iostat=iostat) call pf (access == 'STREAM') call pf (action == 'READWRITE') call pf (blank == 'UNDEFINED') call pf (delim == 'UNDEFINED') call pf (direct == 'NO') call pf (.not. exist) call pf (form == 'UNFORMATTED') call pf (formatted == 'NO') call pf (iostat == 0) call pf (name == lfn) call pf (named) call pf (number == lun) call pf (opened) call pf (pad == 'UNDEFINED') call pf (position == 'REWIND') call pf (read == 'YES') call pf (readwrite == 'YES') call pf (sequential == 'NO')! ???? call pf (unformatted == 'YES') call pf (write == 'YES') inquire (unit=lun, decimal=decimal, encoding=encoding, pos=pos, & round=round, sign=signc, stream=stream) call pf (decimal == 'UNDEFINED') call pf (encoding == 'UNDEFINED') call pf (round == 'PROCESSOR_DEFINED') call pf (signc == 'PROCESSOR_DEFINED') call pf (stream == 'YES') #ifdef TEST_F2018 inquire (unit=lun, recl=recl) call pf (recl == -2) #endif close (lun, status='delete') #endif ! Open the file to connect it to the unit - direct access open (lun, file=lfn, status='new', access='direct', recl=12, form='formatted') write (lun,rec=1, fmt='(a)') 'hello world!' call init_vars () inquire (file=lfn, access=access, action=action, blank=blank, delim=delim, & direct=direct, form=form, formatted=formatted, nextrec=nextrec, pad=pad, & name=name, named=named, number=number, opened=opened, & position=position, read=read, readwrite=readwrite, recl=recl, & sequential=sequential, unformatted=unformatted, write=write, iostat=iostat) call pf (access == 'DIRECT') call pf (action == 'READWRITE') call pf (blank == 'NULL') call pf (delim == 'NONE') call pf (direct == 'YES') call pf (.not. exist) call pf (form == 'FORMATTED') call pf (formatted == 'YES') call pf (iostat == 0) call pf (name == lfn) call pf (named) call pf (nextrec == 2) call pf (number == lun) call pf (opened) call pf (pad == 'YES') call pf (position == 'UNDEFINED') call pf (read == 'YES') call pf (readwrite == 'YES') call pf (recl == 12) call pf (sequential == 'NO') call pf (unformatted == 'NO') call pf (write == 'YES') #ifdef TEST_F2003 inquire (file=lfn, decimal=decimal, encoding=encoding, pos=pos, & round=round, sign=signc, stream=stream) call pf (decimal == 'POINT') call pf (encoding == 'DEFAULT') call pf (round == 'PROCESSOR_DEFINED') call pf (signc == 'PROCESSOR_DEFINED') call pf (stream == 'NO') #endif ! Unit is connected call init_vars () inquire (unit=lun, access=access, action=action, blank=blank, delim=delim, & direct=direct, form=form, formatted=formatted, nextrec=nextrec, pad=pad, & name=name, named=named, number=number, opened=opened, & position=position, read=read, readwrite=readwrite, recl=recl, & sequential=sequential, unformatted=unformatted, write=write, iostat=iostat) call pf (access == 'DIRECT') call pf (action == 'READWRITE') call pf (blank == 'NULL') call pf (delim == 'NONE') call pf (direct == 'YES') call pf (.not. exist) call pf (form == 'FORMATTED') call pf (formatted == 'YES') call pf (iostat == 0) call pf (name == lfn) call pf (named) call pf (nextrec == 2) call pf (number == lun) call pf (opened) call pf (pad == 'YES') call pf (position == 'UNDEFINED') call pf (read == 'YES') call pf (readwrite == 'YES') call pf (recl == 12) call pf (sequential == 'NO') call pf (unformatted == 'NO') call pf (write == 'YES') #ifdef TEST_F2003 inquire (unit=lun, decimal=decimal, encoding=encoding, pos=pos, & round=round, sign=signc, stream=stream) call pf (decimal == 'POINT') call pf (encoding == 'DEFAULT') call pf (round == 'PROCESSOR_DEFINED') call pf (signc == 'PROCESSOR_DEFINED') call pf (stream == 'NO') #endif close (lun) contains subroutine init_vars () exist = .false. named = .false. opened = .false. access = 'xxx' action = 'xxx' blank = 'xxx' delim = 'xxx' direct = 'xxx' form = 'xxx' formatted = 'xxx' iostat = -40 name = 'xxx' nextrec = -41 number = -42 pad = 'xxx' position = 'xxx' read = 'xxx' readwrite = 'xxx' recl = -43 sequential = 'xxx' unformatted = 'xxx' write = 'xxx' #ifdef TEST_F2003 decimal = 'xxx' encoding = 'xxx' round = 'xxx' pos = -44 signc = 'xxx' stream = 'xxx' #endif #ifdef TEST_F2003ASYNC async = 'xxx' id = -45 #endif #ifdef TEST_F2023 leading_zero = 'xxx' #endif end subroutine subroutine pf (iof) logical, intent(in) :: iof if (.not. iof) then error stop 'inquire test assertion failed' end if end subroutine end program lfortran-0.63.0/integration_tests/derived_types_78.f900000664000175000017500000000222415174404631023071 0ustar alastairalastairprogram derived_types_78 ! by @RonShepard in Fortran Discourse apart from write stmt below implicit none type ll_t character(:), allocatable :: text ! line of text. type(ll_t), allocatable :: history ! previous lines of text. end type ll_t type(ll_t), allocatable :: list call push( 'first line', list ) call push( 'second line', list ) call push( 'this is the last line', list ) call printall( list ) contains subroutine push( newtext, list ) ! push a new line of text into the linked list. character(*), intent(in) :: newtext type(ll_t), intent(inout), allocatable :: list type(ll_t), allocatable :: work allocate( work ) work%text = newtext print *, allocated(work%history) call move_alloc( from=list, to=work%history ) call move_alloc( from=work, to=list ) return end subroutine push recursive subroutine printall( list ) type(ll_t), intent(in) :: list if( allocated(list%history) ) call printall( list%history ) write(*,'(a)') '"'//list%text//'"' ! @harperjf added '"' and // return end subroutine printall end program lfortran-0.63.0/integration_tests/intrinsics_373.f900000664000175000017500000000127515174404631022473 0ustar alastairalastairprogram intrinsics_373 integer :: a(2, 3, 4), a1(2), i, j, k, n integer :: b(2, 3, 2, 4) a1(1) = 3 a1(2) = 4 do i = 1, 2 do j = 1, 3 do k = 1, 4 a(i, j, k) = i + j + k end do end do end do print *, a print *, a1 print *, spread(a, 3, 2) print *, spread(a1, 1, 3) b = spread(a, 3, 2) do n = 1, 2 do i = 1, 2 do j = 1, 3 do k = 1, 4 if( b(i, j, n, k) /= i + j + k ) error stop end do end do end do end do if( any(spread(a1, 1, 3) /= reshape([3, 3, 3, 4, 4, 4], [3, 2])) ) error stop end program lfortran-0.63.0/integration_tests/arrays_inputs_15.f900000664000175000017500000000120215174404631023110 0ustar alastairalastairprogram arrays_inputs_15 implicit none integer :: x(10), y(10), i logical :: r do i = 1, size(x) x(i) = i end do call copy_from_to(x, y, 10) r = verify(x, y) print *, r if (.not. r) error stop contains subroutine copy_from_to(xa, xb, n) integer, intent(in) :: n integer, intent(in) :: xa(n) integer, intent(out) :: xb(n) integer :: i do i = 1, size(xa) xb(i) = xa(i) end do end subroutine logical function verify(a, b) result(r) integer, intent(in) :: a(:), b(:) integer :: i r = .true. do i = 1, size(a) r = r .and. (a(i) .eq. b(i)) end do end function end lfortran-0.63.0/integration_tests/formatted_read_01.f900000664000175000017500000000151115174404631023163 0ustar alastairalastairprogram formatted_read_01 character(len=10) :: str1 character(len=15) :: str2 character(len=5) :: str3 character(len=10) :: str4 open(unit=10, file="formatted_read_input_01.txt", status="old") read(unit=10, FMT='(a10)') str1 if (trim(str1) /= "hello") then print *, "Error: str1 should be 'hello'" error stop 1 end if read(unit=10, fmt='(a10)') str2 if (trim(str2) /= "world") then print *, "Error: str2 should be 'world'" error stop 2 end if read(unit=10, fmt='(a10)') str3 if (trim(str3) /= "horty") then print *, "Error: str3 should be 'horty'" error stop 3 end if read(unit=10, fmt='(a5)') str4 if (trim(str4) /= "longe ") then print *, "Error: str4 should be 'longe'" error stop 4 end if close(10) print *, "All tests passed!" end program formatted_read_01lfortran-0.63.0/integration_tests/class_137.f900000664000175000017500000000153715174404631021412 0ustar alastairalastair! Test: 2D character array in class(*) allocatable component ! Verifies that assigning a 2D character array to a class(*) allocatable ! array member correctly preserves data in all columns. module class_137_mod implicit none type :: box class(*), allocatable :: value(:,:) end type contains subroutine set_value(b, val) type(box), intent(out) :: b class(*), intent(in) :: val(:,:) b%value = val end subroutine end module program class_137 use class_137_mod implicit none type(box) :: x call set_value(x, reshape(['aaa','bbb','ccc','ddd'], shape=[2,2])) select type (v => x%value) type is (character(*)) if (v(1,1) /= 'aaa') error stop if (v(2,1) /= 'bbb') error stop if (v(1,2) /= 'ccc') error stop if (v(2,2) /= 'ddd') error stop class default error stop end select print *, "PASS" end program lfortran-0.63.0/integration_tests/separate_compilation_25.f900000664000175000017500000000042515174404631024416 0ustar alastairalastairprogram separate_compilation_25 use stats_corr_separate_compilation_25, only: corr implicit none real :: y(2,2) = reshape([1.0, 2.0, 3.0, 4.0], [2,2]) real :: result(2) result = corr(y) print *, result if (.not. all(result == [1.0, 4.0])) error stop end programlfortran-0.63.0/integration_tests/allocate_65.f900000664000175000017500000000042315174404631022002 0ustar alastairalastairprogram allocate_65 implicit none real(8), allocatable :: mean_ real(8) :: mean_val mean_val = 3.14_8 allocate(mean_, source=mean_val) if (.not. allocated(mean_)) error stop if (abs(mean_ - mean_val) > 1.0e-10_8) error stop end program allocate_65lfortran-0.63.0/integration_tests/class_79.f900000664000175000017500000000136615174404631021337 0ustar alastairalastairmodule class_79_mod type, abstract :: class_value character(len=:), allocatable :: value end type type, extends(class_value) :: temp_type character(len=:), allocatable :: dir class(class_value), pointer :: cwd_ptr end type contains function cast_to_keyval(ptr) result(kval) class(class_value), intent(in), target :: ptr type(temp_type), pointer :: kval nullify(kval) select type(ptr) type is (temp_type) kval => ptr end select end function cast_to_keyval end module program class_79 use class_79_mod class(temp_type), pointer :: t class(class_value), allocatable :: p allocate(temp_type :: p) p%value = "Hello" t => cast_to_keyval(p) if (t%value /= "Hello") error stop end program class_79lfortran-0.63.0/integration_tests/allocatble_c_ptr.f900000664000175000017500000000032015174404631023171 0ustar alastairalastairprogram allocatble_c_ptr use iso_c_binding, only: c_ptr implicit none type(c_ptr), allocatable :: c_requests(:) allocate(c_requests(4)) deallocate(c_requests) end program allocatble_c_ptr lfortran-0.63.0/integration_tests/class_14.f900000664000175000017500000000170215174404631021316 0ustar alastairalastairmodule malloc_failure implicit none type, public, abstract :: AbsType contains procedure(callee), deferred, nopass :: callee end type AbsType abstract interface subroutine callee(mode) integer, intent(in) :: mode end subroutine callee end interface type :: SomeClass private class(AbsType), allocatable :: object contains procedure :: caller end type SomeClass interface SomeClass procedure :: constructor end interface SomeClass contains function constructor(object) result(self) type(SomeClass) :: self class(AbsType), intent(in) :: object self%object = object end function constructor subroutine caller(self) class(SomeClass), intent(in) :: self call self%object%callee(mode=0) end subroutine caller end module malloc_failure program main end programlfortran-0.63.0/integration_tests/assumed_rank_04.f900000664000175000017500000000037615174404631022672 0ustar alastairalastairprogram assumed_rank_04 implicit none call sub() print *, "ok" contains subroutine sub(a1) class(*), optional, intent(in), dimension(..) :: a1 if (present(a1)) error stop end subroutine sub end program assumed_rank_04 lfortran-0.63.0/integration_tests/transfer_25.f900000664000175000017500000000042215174404631022035 0ustar alastairalastairprogram transfer_25 implicit none type :: t_src integer :: x end type type :: t_dst integer :: y end type type(t_src) :: a type(t_dst) :: b a%x = 42 b = transfer(a, b) if (b%y /= 42) error stop end program transfer_25 lfortran-0.63.0/integration_tests/read_64.f900000664000175000017500000000306715174404631021137 0ustar alastairalastair! This test checks 2 things: ! For reads into integer variables, ensure that the end delimeter is correct ! Multiple variables read from single string program read_64 implicit none ! Variables for valid integer read checks integer :: val, istat character(len=6) :: str ! Variables for multi-variable read checks integer, parameter :: n = 3 integer, dimension(:), allocatable :: a, b character(len=6), dimension(n) :: lines integer :: i integer :: expected_a(n) = [5, 3, 9] integer :: expected_b(n) = [42, 7, 15] istat = 0 val = 5 str = '577;' ! Check invalid list-directed reads ! It should not update val, since passed string is not valid for integer read read(str, *, iostat=istat) val print *, "--- Test 1 ---" print *, str, val, istat if (val /= 5) error stop if (istat == 0) error stop str = '576,' ! Check invalid list-directed reads ! It should update val, since passed string end delimeter is valid for integer read read(str, *, iostat=istat) val print *, str, val, istat if (val /= 576) error stop if (istat /= 0) error stop print *, "--- Test 2: Multi-variable read ---" allocate(a(n), b(n)) ! Check read into multiple variables from a single string lines(1) = '5 42' lines(2) = '3 7' lines(3) = '9 15' do i = 1, n read(lines(i), *) a(i), b(i) print *, i, ": '", lines(i), " a =", a(i), "b =", b(i) end do if (any(a /= expected_a) .or. any(b /= expected_b)) error stop end program read_64lfortran-0.63.0/integration_tests/class_57.f900000664000175000017500000000360415174404631021330 0ustar alastairalastairmodule class_57_mod implicit none type, abstract, public :: dumper contains procedure(to_toml), deferred :: dump_to_toml procedure, non_overridable, private :: dump_to_file generic :: dump => dump_to_file, dump_to_toml end type dumper type, extends(dumper) :: wrapper integer :: x contains procedure :: dump_to_toml => dump_x end type type :: toml_table integer :: key end type abstract interface subroutine to_toml(self, x) import dumper, toml_table class(dumper), intent(in) :: self type(toml_table), intent(inout) :: x end subroutine end interface contains ! Private target for generic subroutine dump_to_file(self, x) class(dumper), intent(inout) :: self integer, intent(in) :: x type(toml_table) ::table call self%dump(table) if (table%key /= 5) error stop end subroutine subroutine dump_x(self, x) class(wrapper), intent(in) :: self type(toml_table), intent(inout) :: x x%key = 5 end subroutine subroutine test_assign(self) class(dumper), allocatable, intent(inout) :: self self = wrapper(5) end subroutine logical function test_polymorphic_arg(self) class(dumper), intent(inout) :: self test_polymorphic_arg = .false. select type(self) type is (wrapper) self%x = 10 test_polymorphic_arg = .true. end select end function end module class_57_mod program class_57 use class_57_mod implicit none class(wrapper), allocatable :: temp class(dumper), allocatable :: temp2 type(wrapper) :: w1 logical :: l1 = .false. allocate(temp) call temp%dump(3) allocate(wrapper :: temp2) call test_assign(temp2) select type(temp2) type is (wrapper) if (temp2%x /= 5) error stop class default error stop end select l1 = test_polymorphic_arg(w1) if (l1 .neqv. .true.) error stop if (w1%x /= 10) error stop end program class_57 lfortran-0.63.0/integration_tests/intrinsics_262.f900000664000175000017500000000233315174404631022464 0ustar alastairalastairprogram intrinsics_262 real, parameter :: a(4) = [11.012, -21.125, 31.210, -41.0] real, parameter :: b(4) = [33.9, 91.2, 37.4, 19.1] integer, parameter :: c(8) = floor([1.2, 3.3, 5.0, 6.8, -5.7, & -8.9, 0.0, -412.124]) integer, parameter :: array_size = 6 integer :: i integer(kind=4) :: res_4_arr(array_size) integer(kind=8) :: res_8_arr(array_size) integer(kind=4) :: res_4_arr_2(8) integer :: expected(8) = [1, 3, 5, 6, -6, -9, 0, -413] print *, floor(a) if (any(floor(a) /= [11, -22, 31, -41])) error stop print *, floor(b) if (any(floor(b) /= [33, 91, 37, 19])) error stop do i = 1, size(c) print *, c(i) if (c(i) /= expected(i)) error stop end do res_4_arr = floor([real:: 1.2, 3.3, 5, 6.8, -5.7, -8.9]) print *, res_4_arr if (any(res_4_arr /= [1, 3, 5, 6, -6, -9])) error stop res_8_arr = floor([real(8) :: 1.2, 3.3, 5, 101.768, -121.321, 65.4], kind=8) print *, res_8_arr if (any(res_8_arr /= [1, 3, 5, 101, -122, 65])) error stop res_4_arr_2 = floor([1.2, 3.3, 5.0, 6.8, -5.7, -8.9, 0.0, -412.124], kind=4) print *, res_4_arr_2 if (any(res_4_arr_2 /= [1, 3, 5, 6, -6, -9, 0, -413])) error stop end program lfortran-0.63.0/integration_tests/file_44.f900000664000175000017500000000060615174404631021135 0ustar alastairalastairprogram scale_factor2 implicit none character(27) :: f_string = ' 13.1234 13.1234E0 1312.34' real :: a, b, c real :: correct = 13.1234 read (f_string, '(F9.5, 1X, E9.3, 1X, 2PF7.4)') a, b, c print *, 'a, b, c =', a, b, c if (abs (correct - a) > 0.001) error stop if (abs (correct - b) > 0.001) error stop if (abs (correct - c) > 0.001) error stop end program lfortran-0.63.0/integration_tests/write_09.f900000664000175000017500000000142215174404631021346 0ustar alastairalastairmodule write_09_m type :: mytype character(len=:), allocatable :: raw end type interface write(unformatted) module procedure :: my_write end interface contains subroutine my_write(x, unit, iostat, iomsg) class(mytype), intent(in) :: x integer, intent(in) :: unit integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg write(unit, iostat=iostat, iomsg=iomsg) len(x%raw) end subroutine end module program write_09 use write_09_m implicit none type(mytype) :: x integer :: u, iostat character(len=100) :: iomsg x%raw = "hello" open(newunit=u, form="unformatted", status="scratch") write(u, iostat=iostat, iomsg=iomsg) x close(u) end program write_09 lfortran-0.63.0/integration_tests/data_03.f900000664000175000017500000000147015174404631021122 0ustar alastairalastairprogram data_03 integer :: x, td real :: y, z, c1(4), bf1, xx90, xx95, b, p integer, dimension(4) :: arr data arr(1), arr(2), arr(3), arr(4) /1, 2, 3, 4/ print *, x, y, z if (x /= 1) error stop if (arr(1) /= 1) error stop if (arr(2) /= 2) error stop if (arr(3) /= 3) error stop if (arr(4) /= 4) error stop if (abs(y-2.0) > 1e-5) error stop if (abs(z-3.0) > 1e-5) error stop if (abs(c1(1)-0.0) > 1e-5) error stop if (abs(c1(2)-0.22) > 1e-5) then error stop data x, td, b /1, 4, 3/ end if if (abs(c1(4)+0.21) > 1e-5) error stop if (abs(bf1-0.8) > 1e-5) then data y, z /2.0, 3.0/ error stop end if if (abs(xx90-0.55) > 1e-5) error stop if (abs(xx95-0.62) > 1e-5) error stop data c1 /0.0, 0.22, -0.14, -0.21/ p = b ** (td-1) if (abs(p-27.0) > 1e-5) error stop data bf1 /0.8/, xx90, xx95 /0.55, 0.62/ end program lfortran-0.63.0/integration_tests/any_01.f900000664000175000017500000000106015174404631020771 0ustar alastairalastairprogram any_01 logical :: c1(2), c2(3) integer :: a(2, 3), b(2, 3) ! TODO: Deal with passing array constants to intrinsics ! logical :: l ! l = any((/.true., .true., .true./)) ! print *, l a = 1 b = 1 b(2, 2) = 2 call section(a, b, 1, c1) print *, c1 call section(a, b, 2, c2) print *, c2 contains subroutine section(a, b, axis, c) integer, intent(in) :: a(2, 3), b(2, 3), axis logical, intent(out) :: c(:) c = any(a == b, axis) end subroutine section end program any_01 lfortran-0.63.0/integration_tests/legacy_array_sections_10_foo.f900000664000175000017500000000015715174404631025424 0ustar alastairalastairsubroutine foo(x) implicit none real, intent(inout) :: x(*) x(1) = x(1) + 10.0 end subroutine foo lfortran-0.63.0/integration_tests/gpu_metal_140_mod.f900000664000175000017500000000066215174404631023111 0ustar alastairalastairmodule gpu_metal_140_m implicit none type :: transform_t contains procedure :: apply => my_apply end type interface elemental module function my_apply(self, x) result(y) class(transform_t), intent(in) :: self real, intent(in) :: x real :: y end function end interface end module submodule(gpu_metal_140_m) gpu_metal_140_sub implicit none contains module procedure my_apply y = x * 2.0 end procedure end submodule lfortran-0.63.0/integration_tests/integer_boz_01.f900000664000175000017500000000033415174404631022514 0ustar alastairalastairprogram integer_boz_01 use iso_fortran_env, only: int64 implicit none print * , int( z'DEADBEEF1EADBEEF', int64 ) if ( int( z'DEADBEEF1EADBEEF', int64 ) /= -2401053092097442065_8 ) error stop end program lfortran-0.63.0/integration_tests/derived_types_130.f900000664000175000017500000000373415174404631023145 0ustar alastairalastairmodule derived_types_130_mod implicit none type :: point real :: x, y procedure(add_default_iface), pointer, pass(self) :: add_default => null() procedure(add_named_iface), pointer, pass(pt) :: add_named => null() end type point abstract interface function add_default_iface(self, other) result(res) import :: point class(point), intent(in) :: self, other type(point) :: res end function function add_named_iface(scale, pt) result(res) import :: point real, intent(in) :: scale class(point), intent(in) :: pt type(point) :: res end function end interface contains function add_default_impl(self, other) result(res) class(point), intent(in) :: self, other type(point) :: res res%x = self%x + other%x res%y = self%y + other%y end function function add_named_impl(scale, pt) result(res) real, intent(in) :: scale class(point), intent(in) :: pt type(point) :: res res%x = pt%x * scale res%y = pt%y * scale end function end module derived_types_130_mod program derived_types_130 use derived_types_130_mod implicit none type(point) :: p1, p2, result p1%x = 1.0 p1%y = 2.0 p1%add_default => add_default_impl p1%add_named => add_named_impl p2%x = 3.0 p2%y = 4.0 ! pass(self) where self is the first argument (default position) ! p1%add_default(p2) should pass: add_default_impl(p1, p2) result = p1%add_default(p2) if (abs(result%x - 4.0) > 1e-6) error stop if (abs(result%y - 6.0) > 1e-6) error stop ! pass(pt) where pt is the second argument ! p1%add_named(10.0) should pass: add_named_impl(10.0, p1) result = p1%add_named(10.0) if (abs(result%x - 10.0) > 1e-6) error stop if (abs(result%y - 20.0) > 1e-6) error stop print *, "All tests passed." end program derived_types_130 lfortran-0.63.0/integration_tests/modules_39.f900000664000175000017500000000062415174404631021672 0ustar alastairalastairmodule modules_39_fpm_39 use modules_39_module_fpm_filesystem_39, only: join_path, filewrite public :: build_model contains subroutine build_model() call filewrite(join_path("build", ".gitignore"), ["*"]) end subroutine build_model end module modules_39_fpm_39 program modules_39 use modules_39_fpm_39 implicit none call build_model() print *, "executing modules_39" end program modules_39 lfortran-0.63.0/integration_tests/string_73.f900000664000175000017500000000063015174404631021523 0ustar alastairalastair! Test allocatable integer as substring bounds program string_73 character(6):: str integer, allocatable :: ii integer, allocatable :: ii2 str = "Hello!" allocate(ii) allocate(ii2) ii = 6 if(str(3:ii) /= "llo!") error stop ii2 = 3 if(str(ii2:6) /= "llo!") error stop ii = 3 ii2 = 6 if(str(ii:ii2) /= "llo!") error stop end program string_73lfortran-0.63.0/integration_tests/separate_compilation_21.f900000664000175000017500000000065215174404631024414 0ustar alastairalastairprogram separate_compilation_21 use math_separate_compilation_21 implicit none integer, parameter :: n = 2 integer, parameter :: base = 1 real :: result1(n) integer :: result2(n) result1 = logspace(n, base) result2 = logspace(n, base) print *, result1 print *, result2 if (.not. all(result1 == [1.0, 2.0])) error stop if (.not. all(result2 == [1, 2])) error stop end programlfortran-0.63.0/integration_tests/submodule_23a.f900000664000175000017500000000024615174404631022353 0ustar alastairalastairprogram submodule_23a use submodule_23_mod, only: mytype implicit none type(mytype) :: obj if (.not. obj%check([1, 2])) error stop print *, "ok" end programlfortran-0.63.0/integration_tests/bindc_14.f900000664000175000017500000000236715174404631021300 0ustar alastairalastairmodule bindc_14_mod use, intrinsic :: iso_c_binding implicit none type, abstract :: base_type contains procedure(cb_no_args), deferred :: start_map procedure(cb_string), deferred :: map_key end type abstract interface integer function cb_no_args(this) import base_type class(base_type) :: this end function integer function cb_string(this, value) import base_type, c_char class(base_type) :: this character(*,kind=c_char), intent(in) :: value end function end interface type :: box_type class(base_type), pointer :: callbacks => null() end type contains integer(c_int) function foo(ctx) bind(c, name='') type(c_ptr), value :: ctx type(box_type), pointer :: box call c_f_pointer(ctx, box) foo = box%callbacks%start_map() end function integer(c_int) function bar(ctx, sVal, sLen) bind(c, name='') type(c_ptr), value :: ctx, sVal integer(c_size_t), value :: sLen character(len=sLen,kind=c_char), pointer :: fstr type(box_type), pointer :: box call c_f_pointer(sVal, fstr) call c_f_pointer(ctx, box) bar = box%callbacks%map_key(fstr) end function end module program bindc_14 use bindc_14_mod implicit none print *, "ok" end program lfortran-0.63.0/integration_tests/intrinsics_206.f900000664000175000017500000000174415174404631022467 0ustar alastairalastairprogram intrinsics_206 use iso_fortran_env, only: dp => real64 integer :: x, y, z integer(dp) :: a, b, c x = 44 y = -501 z = 0 a = 5468272828_dp b = -3526282829_dp c = 83983_dp print *, poppar(x) if(poppar(x) /= 1) error stop print *, poppar(44) if(poppar(44) /= 1) error stop print *, poppar(y) if(poppar(y) /= 0) error stop print *, poppar(-501) if(poppar(-501) /= 0) error stop print *, poppar(z) if(poppar(z) /= 0) error stop print *, poppar(0) if(poppar(0) /= 0) error stop print *, poppar(a) if(poppar(a) /= 1) error stop print *, poppar(5468272828_dp) if(poppar(5468272828_dp) /= 1) error stop print *, poppar(b) if(poppar(b) /= 0) error stop print *, poppar(-3526282829_dp) if(poppar(-3526282829_dp) /= 0) error stop print *, poppar(c) if(poppar(c) /= 1) error stop print *, poppar(83983_dp) if(poppar(83983_dp) /= 1) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_192.f900000664000175000017500000000121315174404631022252 0ustar alastairalastairmodule gpu_metal_192_m implicit none type :: t real :: v contains procedure :: get_v end type contains pure function get_v(self) result(r) class(t), intent(in) :: self real :: r r = self%v end function end module program gpu_metal_192 use gpu_metal_192_m implicit none integer :: i type(t) :: a(4) real :: b(4) a = [t(1.0), t(2.0), t(3.0), t(4.0)] do concurrent(i=1:4) b(i) = f(a(i)) end do print *, b if (any(abs(b - [1.0, 2.0, 3.0, 4.0]) > 1.0e-6)) error stop contains pure function f(x) result(r) type(t), intent(in) :: x real :: r r = x%get_v() end function end program lfortran-0.63.0/integration_tests/string_38.f900000664000175000017500000000017115174404631021524 0ustar alastairalastair PROGRAM EXAMPLE CHARACTER(4) :: NAME NAME="XXYY" PRINT *, NAME(1:2) END PROGRAM lfortran-0.63.0/integration_tests/arrays_reshape_29.f900000664000175000017500000000070315174404631023227 0ustar alastairalastairprogram arrays_reshape_29 implicit none integer, parameter :: w(4) = [1, 2, 3, 4] real, parameter :: x(4) = w integer, parameter :: y(4) = x real :: b(2, 2) = reshape(y, [2, 2]) if (b(1,1) /= 1.0) error stop "Mismatch at b(1,1)" if (b(2,1) /= 2.0) error stop "Mismatch at b(2,1)" if (b(1,2) /= 3.0) error stop "Mismatch at b(1,2)" if (b(2,2) /= 4.0) error stop "Mismatch at b(2,2)" end program arrays_reshape_29 lfortran-0.63.0/integration_tests/gpu_metal_119.f900000664000175000017500000000131015174404631022247 0ustar alastairalastairprogram gpu_metal_119 ! Test: elemental function call on array section combined with matmul ! inside do concurrent. Verifies that the elemental function is called ! per-element (not with array pointer + size) in the generated GPU code. implicit none integer :: pair, n real :: z(3), a(3), w(3,3) n = 3 z = [1.0, 2.0, 3.0] a = 0.0 w = 0.0 w(1,1) = 1.0; w(2,2) = 1.0; w(3,3) = 1.0 do concurrent (pair = 1:2) a(1:n) = matmul(w(1:n,1:n), z(1:n)) * f(z(1:n)) end do if (abs(a(1) - 1.0) > 1e-6) error stop if (abs(a(2) - 4.0) > 1e-6) error stop if (abs(a(3) - 9.0) > 1e-6) error stop print *, "ok" contains elemental function f(x) result(y) real, intent(in) :: x real :: y y = x end function end program lfortran-0.63.0/integration_tests/bindc_35.f900000664000175000017500000001027315174404631021276 0ustar alastairalastair! Test: ISO_C_BINDING named constants completeness ! ! Covers: ! - Character named constants: C_ALERT, C_BACKSPACE, C_FORM_FEED, ! C_CARRIAGE_RETURN, C_HORIZONTAL_TAB, C_VERTICAL_TAB ! - Integer kind constants: C_INTMAX_T ! - Integer kind constants: C_INT_LEAST8_T .. C_INT_LEAST64_T ! - Integer kind constants: C_INT_FAST8_T .. C_INT_FAST64_T program bindc_35 use, intrinsic :: iso_c_binding implicit none call test_char_constants() call test_intmax() call test_int_least() call test_int_fast() print *, "All bindc_35 tests passed." contains subroutine test_char_constants() ! Verify ASCII values of all character named constants if (iachar(c_null_char) /= 0) error stop "FAIL: C_NULL_CHAR" if (iachar(c_alert) /= 7) error stop "FAIL: C_ALERT" if (iachar(c_backspace) /= 8) error stop "FAIL: C_BACKSPACE" if (iachar(c_horizontal_tab) /= 9) error stop "FAIL: C_HORIZONTAL_TAB" if (iachar(c_new_line) /= 10) error stop "FAIL: C_NEW_LINE" if (iachar(c_vertical_tab) /= 11) error stop "FAIL: C_VERTICAL_TAB" if (iachar(c_form_feed) /= 12) error stop "FAIL: C_FORM_FEED" if (iachar(c_carriage_return) /= 13) error stop "FAIL: C_CARRIAGE_RETURN" end subroutine subroutine test_intmax() interface integer(c_intmax_t) function c35_double_intmax(x) bind(c) import :: c_intmax_t integer(c_intmax_t), value :: x end function end interface integer(c_intmax_t) :: v, r v = 42 r = c35_double_intmax(v) if (r /= 84) error stop "FAIL: C_INTMAX_T" end subroutine subroutine test_int_least() interface integer(c_int_least8_t) function c35_double_least8(x) bind(c) import :: c_int_least8_t integer(c_int_least8_t), value :: x end function integer(c_int_least16_t) function c35_double_least16(x) bind(c) import :: c_int_least16_t integer(c_int_least16_t), value :: x end function integer(c_int_least32_t) function c35_double_least32(x) bind(c) import :: c_int_least32_t integer(c_int_least32_t), value :: x end function integer(c_int_least64_t) function c35_double_least64(x) bind(c) import :: c_int_least64_t integer(c_int_least64_t), value :: x end function end interface if (c35_double_least8(10_c_int_least8_t) /= 20) & error stop "FAIL: C_INT_LEAST8_T" if (c35_double_least16(100_c_int_least16_t) /= 200) & error stop "FAIL: C_INT_LEAST16_T" if (c35_double_least32(1000_c_int_least32_t) /= 2000) & error stop "FAIL: C_INT_LEAST32_T" if (c35_double_least64(10000_c_int_least64_t) /= 20000) & error stop "FAIL: C_INT_LEAST64_T" end subroutine subroutine test_int_fast() interface integer(c_int_fast8_t) function c35_double_fast8(x) bind(c) import :: c_int_fast8_t integer(c_int_fast8_t), value :: x end function integer(c_int_fast16_t) function c35_double_fast16(x) bind(c) import :: c_int_fast16_t integer(c_int_fast16_t), value :: x end function integer(c_int_fast32_t) function c35_double_fast32(x) bind(c) import :: c_int_fast32_t integer(c_int_fast32_t), value :: x end function integer(c_int_fast64_t) function c35_double_fast64(x) bind(c) import :: c_int_fast64_t integer(c_int_fast64_t), value :: x end function end interface if (c35_double_fast8(5_c_int_fast8_t) /= 10) & error stop "FAIL: C_INT_FAST8_T" if (c35_double_fast16(50_c_int_fast16_t) /= 100) & error stop "FAIL: C_INT_FAST16_T" if (c35_double_fast32(500_c_int_fast32_t) /= 1000) & error stop "FAIL: C_INT_FAST32_T" if (c35_double_fast64(5000_c_int_fast64_t) /= 10000) & error stop "FAIL: C_INT_FAST64_T" end subroutine end program lfortran-0.63.0/integration_tests/separate_compilation_16.f900000664000175000017500000000031015174404631024407 0ustar alastairalastairprogram separate_compilation_16 use mod_separate_compilation_16 implicit none integer :: key = 5 call map_open_entry( key ) print *, key if (key /= 1) error stop end programlfortran-0.63.0/integration_tests/gpu_metal_132.f900000664000175000017500000000104215174404631022244 0ustar alastairalastair! Test: sum() nested inside a larger expression in do concurrent. ! Previously generated invalid Metal shader because sum() inside an ! expression like "results(i) = bias + sum(a)" was not inlined, ! producing a call to _lcompilers_Sum which is unavailable in Metal. program gpu_metal_132 implicit none integer :: i real :: a(3), results(4), bias a = 0.5 bias = 1.0 do concurrent (i = 1:4) results(i) = bias + sum(a) end do do i = 1, 4 if (abs(results(i) - 2.5) > 1.0e-5) error stop end do print *, "PASS" end program lfortran-0.63.0/integration_tests/nullify_03.f900000664000175000017500000000114215174404631021667 0ustar alastairalastairmodule module_nullify_03 implicit none integer, parameter, private :: mxdim = 3 type :: rp1d real(8), dimension(:), pointer :: f end type type :: sds integer :: ndim integer, dimension(mxdim) :: dims logical :: hdf32 type(rp1d), dimension(mxdim) :: scales real(8), dimension(:,:,:), pointer :: f end type end module program nullify_03 use module_nullify_03 implicit none type(sds) :: s ! allocate(s%scales(1)%f(2)) ! s%scales(1)%f=[1,2] ! print *, 'Scale 0:', s%scales(1)%f nullify(s%scales(1)%f) end programlfortran-0.63.0/integration_tests/functions_45.f900000664000175000017500000000033115174404631022222 0ustar alastairalastair! Test calling a string-returing function in a loop program functions_45 integer :: i integer :: n_slashes n_slashes = 20 do i=1 , 10 print *, repeat('\', n_slashes / 2) end do end program lfortran-0.63.0/integration_tests/submodule_17.f900000664000175000017500000000620315174404631022214 0ustar alastairalastairmodule submodule_17_string_mod implicit none type :: string_t character(len=:), allocatable :: string_ contains procedure :: as_character generic :: string => as_character generic :: operator(//) => character_cat_string_t procedure, pass(rhs), private :: character_cat_string_t end type interface string_t module procedure from_characters end interface contains elemental function from_characters(string) result(new_string) character(len=*), intent(in) :: string type(string_t) :: new_string new_string%string_ = string end function pure function as_character(self) result(string) class(string_t), intent(in) :: self character(len=:), allocatable :: string string = self%string_ end function elemental function character_cat_string_t(lhs, rhs) result(lhs_cat_rhs) character(len=*), intent(in) :: lhs class(string_t), intent(in) :: rhs type(string_t) :: lhs_cat_rhs lhs_cat_rhs = string_t(lhs // rhs%string_) end function end module module submodule_17_diag_mod use submodule_17_string_mod, only: string_t implicit none type :: test_diagnosis_t logical :: test_passed_ = .false. character(len=:), allocatable :: diagnostics_string_ end type interface test_diagnosis_t elemental module function construct_from_string_t(test_passed, diagnostics_string) result(test_diagnosis) logical, intent(in) :: test_passed type(string_t), intent(in) :: diagnostics_string type(test_diagnosis_t) :: test_diagnosis end function elemental module function construct_from_character(test_passed, diagnostics_string) result(test_diagnosis) logical, intent(in) :: test_passed character(len=*), intent(in) :: diagnostics_string type(test_diagnosis_t) :: test_diagnosis end function end interface interface operator(//) elemental module function append_string_if_test_failed(lhs, rhs) result(lhs_cat_rhs) class(test_diagnosis_t), intent(in) :: lhs type(string_t), intent(in) :: rhs type(test_diagnosis_t) :: lhs_cat_rhs end function end interface end module submodule(submodule_17_diag_mod) submodule_17_diag_sub use submodule_17_string_mod, only: string_t implicit none contains module procedure append_string_if_test_failed if (lhs%test_passed_) then lhs_cat_rhs = lhs else lhs_cat_rhs = test_diagnosis_t(lhs%test_passed_, lhs%diagnostics_string_ // rhs) end if end procedure module procedure construct_from_string_t test_diagnosis%test_passed_ = test_passed test_diagnosis%diagnostics_string_ = diagnostics_string%string() end procedure module procedure construct_from_character test_diagnosis%test_passed_ = test_passed test_diagnosis%diagnostics_string_ = diagnostics_string end procedure end submodule program submodule_17 use submodule_17_diag_mod use submodule_17_string_mod, only: string_t implicit none type(test_diagnosis_t) :: d type(string_t) :: s d%test_passed_ = .false. d%diagnostics_string_ = "prefix: " s%string_ = "payload" d = d // s if (d%diagnostics_string_ /= "prefix: payload") error stop print *, "OK" end program lfortran-0.63.0/integration_tests/derived_types_107.f900000664000175000017500000000172515174404631023147 0ustar alastairalastairmodule derived_types_107_mod1 type base contains procedure,nopass::prc1 end type type, extends(base)::child contains procedure,nopass::prc1=>cproc1 end type contains integer function prc1() prc1=100 end function integer function cproc1() cproc1=200 end function end module module derived_types_107_mod2 type base contains procedure,nopass::prc1 end type type, extends(base)::child contains procedure,nopass::prc1=>cproc1 end type contains integer function prc1() prc1=300 end function integer function cproc1() cproc1=400 end function end module program derived_types_107 use derived_types_107_mod1, only:base use derived_types_107_mod2, only:child type(child)::tc1 type(base)::tb1 print *, tb1%prc1() print *, tc1%prc1() if (tc1%prc1()/=400) error stop "Test failed" if (tb1%prc1()/=100) error stop "Test failed" print *,'pass' end programlfortran-0.63.0/integration_tests/warning_characterstar.f900000664000175000017500000000014315174404631024256 0ustar alastairalastairprogram warning_characterstar character*4 x character*5 y end program warning_characterstarlfortran-0.63.0/integration_tests/transfer_29.f900000664000175000017500000000104315174404631022041 0ustar alastairalastairprogram transfer_29 implicit none type :: pair integer :: fst real :: snd end type type(pair) :: original(2) type(pair) :: result_val(2) integer(1) :: bytes(16) original(1) = pair(1, 53.) original(2) = pair(3, 47.) bytes = transfer(original, bytes) result_val = transfer(bytes, original(1), 2) if (result_val(1)%fst /= 1) error stop if (abs(result_val(1)%snd - 53.) > 0.01) error stop if (result_val(2)%fst /= 3) error stop if (abs(result_val(2)%snd - 47.) > 0.01) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/intrinsics_294.f900000664000175000017500000000420215174404631022466 0ustar alastairalastairprogram intrinsics_294 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(dp) :: a real(sp) :: d integer :: i real(dp) :: log_gamma_runtime_dp(3) = [0.875_dp, 3.367_dp, 2.140_dp] real(sp) :: log_gamma_runtime_sp(3) = [0.875, 3.367, 2.140] real(dp) :: log_gamma_res_dp(3) real(sp) :: log_gamma_res_sp(3) real(dp) :: expected_dp(3) = [8.5858707225334327E-002_dp, 1.0572189866765507_dp, 6.5332875743268432E-002_dp] real(sp) :: expected_sp(3) = [8.58587101E-02_sp, 1.05721915_sp, 6.53329268E-02] real(dp), parameter :: res(3) = log_gamma([0.875_dp, 3.367_dp, 2.140_dp]) real(sp), parameter :: res_sp(3) = log_gamma([0.875, 3.367, 2.140]) do i = 1, 3 print *, res(i) if (abs(res(i) - expected_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, res_sp(i) if (abs(res_sp(i) - expected_sp(i)) > 1e-5) error stop end do log_gamma_res_dp = log_gamma(log_gamma_runtime_dp) log_gamma_res_sp = log_gamma(log_gamma_runtime_sp) do i = 1, 3 print *, log_gamma_res_dp(i) if (abs(log_gamma_res_dp(i) - expected_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, log_gamma_res_sp(i) if (abs(log_gamma_res_sp(i) - expected_sp(i)) > 1e-5) error stop end do a = log_gamma(10.92839272_dp) d = log_gamma(10.92839272) print *, a if (a - 14.936254510214283_dp > 1e-12_dp) error stop print *,log_gamma(10.92839272_dp) if (log_gamma(10.92839272_dp) - 14.936254510214283_dp > 1e-12_dp) error stop print *, d if (d - 14.9362535_sp > 1e-5) error stop print *, log_gamma(10.92839272) if (log_gamma(10.92839272) - 14.9362535_sp > 1e-5) error stop a = log_gamma(83.728927_dp) d = log_gamma(31.738222) print *, a if (a - 285.69411569953820_dp > 1e-12_dp) error stop print *,log_gamma(83.728927_dp) if (log_gamma(83.728927_dp) - 285.69411569953820_dp > 1e-12_dp) error stop print *, d if (d - 77.1901703_sp > 1e-5) error stop print *, log_gamma(31.738222) if (log_gamma(31.738222) - 77.1901703_sp > 1e-5) error stop end program lfortran-0.63.0/integration_tests/bindc_11.f900000664000175000017500000000177315174404631021275 0ustar alastairalastairmodule bindc_11_mod use, intrinsic :: iso_c_binding, only: c_float implicit none contains complex(c_float) function twice(z) result(r) bind(c) complex(c_float), value, intent(in) :: z r = z + z end function twice end module bindc_11_mod program bindc_11 use, intrinsic :: iso_c_binding, only: c_float use bindc_11_mod, only: twice implicit none complex(c_float) :: z, r real(c_float) :: re, im integer :: i z = cmplx(5.0_c_float, 7.0_c_float, kind=c_float) r = twice(z) re = real(r, kind=c_float) im = aimag(r) if (abs(re - 10.0_c_float) > 1.0e-6_c_float) error stop if (abs(im - 14.0_c_float) > 1.0e-6_c_float) error stop r = cmplx(0.0_c_float, 0.0_c_float, kind=c_float) do i = 1, 700000 r = r + twice(z) end do re = real(r, kind=c_float) im = aimag(r) if (abs(re - 7000000.0_c_float) > 1.0_c_float) error stop if (abs(im - 9800000.0_c_float) > 1.0_c_float) error stop print *, "PASSED" end program bindc_11 lfortran-0.63.0/integration_tests/arrays_35.f900000664000175000017500000000025515174404631021517 0ustar alastairalastairprogram arrays_35 real :: x(2) x = [real :: 9, 2.1] print *, x if (abs(x(1) - 9.0) > 1e-7) error stop if (abs(x(2) - 2.1) > 1e-7) error stop end program lfortran-0.63.0/integration_tests/save_05.f900000664000175000017500000000063115174404631021147 0ustar alastairalastairsubroutine f(i) implicit none integer, save :: small integer, intent(in) :: i if (i == 1) then small = 12 else if (i == 2) then if (small /= 12) error stop end if print *, small end subroutine subroutine g(i) implicit none integer :: big integer, intent(in) :: i if (i == 1) then big = 6 end if print *, big end subroutine program save_05 implicit none call f(1) call g(1) call f(2) end program lfortran-0.63.0/integration_tests/separate_compilation_45a.f900000664000175000017500000000116415174404631024562 0ustar alastairalastairmodule separate_compilation_45a_mod implicit none type :: greeter_t integer :: id = 0 contains procedure :: greet end type greeter_t contains subroutine greet(self, msg) class(greeter_t), intent(in) :: self character(len=*), intent(in) :: msg ! associate creates a local variable that inherits AssumedLength associate(unused => msg) if (trim(unused) /= "hello") error stop "expected greeting" if (self%id /= 42) error stop "expected greeter id" end associate end subroutine greet end module separate_compilation_45a_mod lfortran-0.63.0/integration_tests/intrinsics_19c.f900000664000175000017500000000270215174404631022547 0ustar alastairalastairprogram intrinsics_19c ! Test math intrinsics both declarations and executable statements. ! Single and double precision, complex only. integer, parameter :: dp = kind(0.d0) real, parameter :: & s1 = abs((0.5,0.5)), & s5 = aimag((0.4,0.5)) complex, parameter :: & s2 = exp((0.5,0.5)), & s3 = log((0.5,0.5)), & s4 = sqrt((0.5,0.5)) real(dp), parameter :: & d1 = abs((0.5_dp,0.5_dp)), & d5 = aimag((0.4,0.5)) complex(dp), parameter :: & d2 = exp((0.5_dp,0.5_dp)), & d3 = log((0.5_dp,0.5_dp)), & d4 = sqrt((0.5_dp,0.5_dp)) complex :: x real :: x1 = -1 complex(dp) :: y x = (0.5,0.5) y = (0.5_dp,0.5_dp) if (abs(-1) /= 1) error stop if (abs(int(x1)) /= 1) error stop if (abs(-1) /= 1) error stop if (abs(x1) /= 1.0) error stop if (abs(-1.0) /= 1) error stop if (abs(abs((0.5, 0.5)) - 0.707106769) > 1e-7) error stop if (abs(abs(x) - 0.707106769) > 1e-7) error stop if (abs(abs(-x) - 0.707106769) > 1e-7) error stop if (abs(abs((0.5_dp, 0.5_dp)) - 0.70710678118654757) > 1e-7) error stop if (abs(abs(y) - 0.70710678118654757) > 1e-7) error stop if (abs(abs(-y) - 0.70710678118654757) > 1e-7) error stop print *, exp((0.5,0.5)), exp((0.5_dp,0.5_dp)), s2, d2, exp(x), exp(y) print *, log((0.5,0.5)), log((0.5_dp,0.5_dp)), s3, d3, log(x), log(y) print *, sqrt((0.5,0.5)), sqrt((0.5_dp,0.5_dp)), s4, d4, sqrt(x), sqrt(y) x = (0.4,0.5) y = (0.4_dp,0.5_dp) print *, aimag((0.5,0.5)), aimag((0.5_dp,0.5_dp)), s5, d5, aimag(x), aimag(y) end lfortran-0.63.0/integration_tests/class_41.f900000664000175000017500000000211115174404631021311 0ustar alastairalastairmodule class_41_mod type, public :: AbsType contains procedure :: abs_method end type AbsType type, extends(AbsType) :: AbsExtendedType end type AbsExtendedType type :: Wrapper class(AbsExtendedType), allocatable :: obj type(AbsExtendedType) :: t_obj end type Wrapper type :: Client type(Wrapper) :: wrapped contains procedure :: caller end type Client contains subroutine caller(self) class(Client), intent(in) :: self type(Client) :: type_s ! Calling subroutine with extended type as self call self%wrapped%obj%abs_method(42) call type_s%wrapped%t_obj%abs_method(42) end subroutine caller subroutine abs_method(self, val) class(AbsType), intent(in) :: self integer, intent(in) :: val print *, "abs_method called" if (val /= 42) error stop end subroutine abs_method end module class_41_mod program class_41 use class_41_mod class(Client), allocatable :: var allocate(var) allocate(var%wrapped%obj) call var%caller() end program class_41 lfortran-0.63.0/integration_tests/common_28.f900000664000175000017500000000115715174404631021512 0ustar alastairalastairsubroutine sub () common /cblock/ x, y, z double precision x, y, z common /charblk/ c1, c2, c3 character c1*2, c2*3, c3(3)*5 if (x /= 1.5d0) error stop if (y /= 2.5d0) error stop if (z /= 3.5d0) error stop if (c1 /= 'he') error stop if (c2 /= 'llo') error stop if (.not. all(c3 == ['hello', 'world', '12345'])) error stop end subroutine program common_28 common /cblock/ x, y, z double precision x, y, z common /charblk/ c1, c2, c3 character c1*2, c2*3, c3(3)*5 x = 1.5d0 y = 2.5d0 z = 3.5d0 c1 = 'he' c2 = 'llo' c3 = ['hello', 'world', '12345'] call sub () end program lfortran-0.63.0/integration_tests/polymorphic_class_compare.f900000664000175000017500000000206115174404631025144 0ustar alastairalastairmodule gFTL2_Integer32Complex32Map implicit none type :: map_SetIterator integer::i end type map_SetIterator interface operator(==) module procedure map_s_iter_equal end interface operator(==) interface operator(/=) module procedure map_s_iter_not_equal end interface operator(/=) contains logical function map_s_iter_equal(a, b) result(eq) type(map_SetIterator), intent(in) :: a type(map_SetIterator), intent(in) :: b eq = a%i == b%i end function map_s_iter_equal logical function map_s_iter_not_equal(a, b) result(ne) implicit none class(map_SetIterator), intent(in) :: a, b ne = a == b ne = .not. ne end function map_s_iter_not_equal end module gFTL2_Integer32Complex32Map program polymorphic_class_compare use gFTL2_Integer32Complex32Map implicit none type(map_SetIterator) :: iter1, iter2 ! Initialize iterators iter1%i = 1 iter2%i = 1 if (iter1 /= iter2) error stop "Error: iter1 and iter2 should be equal" end program polymorphic_class_comparelfortran-0.63.0/integration_tests/file_42.f900000664000175000017500000000134115174404631021130 0ustar alastairalastairprogram bnbz2 implicit none ! Specify blank mode via OPEN statement integer :: iunit integer :: i1, i2 character(8) :: blank_mode open (newunit=iunit, file='bnbz.dat', status='unknown') write (iunit,'(a)') '1 1 ' close (iunit) open (newunit=iunit, file='bnbz.dat', status='old', blank='null') read (iunit, '(2i4)') i1, i2 if (i1 /= 1 .or. i2 /= 1) error stop inquire (unit=iunit, blank=blank_mode) if (blank_mode /= 'NULL') error stop close (iunit) open (newunit=iunit, file='bnbz.dat', status='old', blank='zero') read (iunit, '(2i4)') i1, i2 if (i1 /= 1000 .or. i2 /= 1000) error stop inquire (unit=iunit, blank=blank_mode) if (blank_mode /= 'ZERO') error stop close (iunit) end program lfortran-0.63.0/integration_tests/intrinsics_143.f900000664000175000017500000000142415174404631022462 0ustar alastairalastairprogram intrinsics_143 real :: a(3), b(3) real :: res double precision :: c(5), d(5) double precision :: res_dp a = [1.0,2.0,3.0] b = [4.0,5.0,6.0] res = dot_product(a, b) print *, res if (abs(res - 32.0) > 1e-8) error stop res = dot_product([1.0,2.0,3.0], [4.0,5.0,6.0]) print *, res if (abs(res - 32.0) > 1e-8) error stop c = [1.213D0, 2.113D0, 3.123D0, 4.12D0, 5.13D0] d = [4.213D0, 5.113D0, 6.123D0, 7.12D0, 8.13D0] res_dp = dot_product(c, d) print *, res_dp if (abs(res_dp - 106.077567D0) > 1e-12) error stop res_dp = dot_product([1.213D0, 2.113D0, 3.123D0, 4.12D0, 5.13D0], [4.213D0, 5.113D0, 6.123D0, 7.12D0, 8.13D0]) print *, res_dp if (abs(res_dp - 106.077567D0) > 1e-12) error stop end program lfortran-0.63.0/integration_tests/entry_02.f900000664000175000017500000000061615174404631021352 0ustar alastairalastairsubroutine x(dummy) real :: dummy print *, "Printed using subroutine call: ", dummy if (abs(dummy - 10.0) > 1e-7) error stop dummy = 5.0 entry y(dummy) print *, "Printed using entry statement: ", dummy if (abs(dummy - 5.0) > 1e-7) error stop return end subroutine program entry_02 real :: dummy dummy = 10.0 call x(dummy) dummy = 5.0 call y(dummy) end program lfortran-0.63.0/integration_tests/block_02.f900000664000175000017500000000050015174404631021273 0ustar alastairalastairPROGRAM Block_02 INTEGER :: A A = 10 1 loop: BLOCK INTEGER :: B A = A + 5 IF (A.EQ.15) GO TO 1 B = A / 2 CALL Square(B) END BLOCK loop END PROGRAM Block_02 SUBROUTINE Square(B) INTEGER :: B, Result Result = B * B PRINT *, Result END SUBROUTINE Square lfortran-0.63.0/integration_tests/realloc_lhs_22.f900000664000175000017500000000017415174404631022501 0ustar alastairalastairprogram realloc_lhs_22 implicit none integer, allocatable :: x(:) x = [1, 2, 3] end program realloc_lhs_22lfortran-0.63.0/integration_tests/use_02.f900000664000175000017500000000034715174404631021006 0ustar alastairalastairmodule use_02_module use iso_fortran_env, only: dp => real64 end module program use_02 use use_02_module integer(dp) :: i i = 1234567890123456789_dp if (i /= 1234567890123456789_dp) error stop end program lfortran-0.63.0/integration_tests/intrinsics_451.f900000664000175000017500000000120515174404631022461 0ustar alastairalastairprogram intrinsics_451 implicit none character(len=3) :: arr(4) integer :: idx arr(1) = "abc" arr(2) = "def" arr(3) = "ghi" arr(4) = "def" idx = findloc(arr, "def", dim=1) print *, idx if (idx /= 2) error stop idx = findloc(arr, "def", dim=1, back=.true.) print *, idx if (idx /= 4) error stop idx = findloc(arr, "xyz", dim=1) print *, idx if (idx /= 0) error stop call test_assumed_len(arr) contains subroutine test_assumed_len(w) character(len=*), intent(in) :: w(:) character(len=len(w)) :: v(4) integer :: i v = w i = findloc(v, "ghi", dim=1) print *, i if (i /= 3) error stop end subroutine end program lfortran-0.63.0/integration_tests/derived_types_57.f900000664000175000017500000000046615174404631023074 0ustar alastairalastairmodule derived_types_57_m type :: ansi_code integer :: m = 44 end type type :: term type(ansi_code) :: black = ansi_code() end type end module program derived_types_57 use derived_types_57_m type(term) :: temp = term() if (temp%black%m /= 44) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_20.f900000664000175000017500000000074315174404631022167 0ustar alastairalastairprogram gpu_metal_20 ! Multiple statements per iteration: normalize and shift implicit none integer, parameter :: n = 10000 real :: x(n), y(n), y_expected(n) real :: norm, shift integer :: i norm = 100.0 shift = 5.0 do i = 1, n x(i) = real(i) y_expected(i) = real(i) / norm + shift end do do concurrent (i = 1:n) y(i) = x(i) / norm y(i) = y(i) + shift end do do i = 1, n if (abs(y(i) - y_expected(i)) > 1.0e-5) error stop end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/parameter_08.f900000664000175000017500000000053015174404631022172 0ustar alastairalastairprogram parameter_08 real, parameter :: A(*) = sin([1.0, 2.0, 3.0, 4.0]) real, parameter :: B(*) = sin(A) real, parameter :: C(*) = cos(B) print *, sum(A) if (abs(sum(A) - 1.13508582) > 1e-6) error stop print *, sum(B) if (abs(sum(B) - 0.988748252) > 1e-6) error stop print *, sum(C) if (abs(sum(C) - 3.20269895) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/string_48.f900000664000175000017500000000051215174404631021524 0ustar alastairalastairmodule strings_48_mod implicit none character(16) :: option='potential' end module program strings_48 use strings_48_mod implicit none character(60) :: value value = "val1" read(value, *) option if (option /= "val1") error stop option = "val2" if (option /= "val2") error stop end program strings_48lfortran-0.63.0/integration_tests/intrinsics_307.f900000664000175000017500000000171415174404631022466 0ustar alastairalastairprogram intrinsics_307 implicit none real, parameter :: x1 = imag((1.0, 2.0)) real(8), parameter :: x2 = imag((1.0_8, 2.0_8)) real, parameter :: ar1(3) = imag([(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)]) real(8), parameter :: ar2(3) = imag([(1.0_8, 2.0_8), (3.0_8, 4.0_8), (5.0_8, 6.0_8)]) complex :: x = (1.0, 2.0) complex(8) :: y = (1.0_8, 2.0_8) complex :: z(3) = [(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)] print *, x1 if (x1 /= 2.0) error stop print *, x2 if (x2 /= 2.0_8) error stop print *, imag(x) if (imag(x) /= 2.0) error stop print *, imag(y) if (imag(y) /= 2.0_8) error stop print *, ar1 if (any(ar1 /= [2.0, 4.0, 6.0])) error stop print *, ar2 if (any(ar2 /= [2.0_8, 4.0_8, 6.0_8])) error stop print *, imag(x) if (imag(x) /= 2.0) error stop print *, imag(y) if (imag(y) /= 2.0_8) error stop print *, imag(z) if (any(imag(z) /= [2.0, 4.0, 6.0])) error stop end programlfortran-0.63.0/integration_tests/abs_06.f900000664000175000017500000000274515174404631020767 0ustar alastairalastairprogram abs_06 use, intrinsic :: ieee_arithmetic, only: ieee_value, ieee_quiet_nan, ieee_is_nan implicit none integer, parameter :: sp = kind(1.0) integer, parameter :: dp = kind(1.0d0) complex(sp) :: cs complex(dp) :: cd real(sp) :: rs real(dp) :: rd ! abs of complex with NaN real part (single precision) cs = cmplx(ieee_value(1._sp, ieee_quiet_nan), 0._sp) rs = abs(cs) print *, rs if (.not. ieee_is_nan(rs)) error stop "abs_06: sp NaN real part failed" ! abs of complex with NaN imaginary part (single precision) cs = cmplx(0._sp, ieee_value(1._sp, ieee_quiet_nan)) rs = abs(cs) print *, rs if (.not. ieee_is_nan(rs)) error stop "abs_06: sp NaN imag part failed" ! abs of complex with both NaN (single precision) cs = cmplx(ieee_value(1._sp, ieee_quiet_nan), ieee_value(1._sp, ieee_quiet_nan)) rs = abs(cs) print *, rs if (.not. ieee_is_nan(rs)) error stop "abs_06: sp both NaN failed" ! abs of complex with NaN real part (double precision) cd = cmplx(ieee_value(1._dp, ieee_quiet_nan), 0._dp, dp) rd = abs(cd) print *, rd if (.not. ieee_is_nan(rd)) error stop "abs_06: dp NaN real part failed" ! abs of complex with NaN imaginary part (double precision) cd = cmplx(0._dp, ieee_value(1._dp, ieee_quiet_nan), dp) rd = abs(cd) print *, rd if (.not. ieee_is_nan(rd)) error stop "abs_06: dp NaN imag part failed" ! abs of normal complex still works cs = cmplx(3._sp, 4._sp) rs = abs(cs) if (abs(rs - 5._sp) > 1.e-6_sp) error stop "abs_06: normal complex failed" print *, "all tests passed" end program lfortran-0.63.0/integration_tests/logical_to_integer_cast.f900000664000175000017500000000116015174404631024546 0ustar alastairalastairprogram logical_to_integer_cast implicit none logical :: logicalValue integer :: integerValue logical :: logicalArray(3) integer :: integerArray(3) ! Assign a logical value logicalValue = .TRUE. ! Perform an implicit logical to integer cast integerValue = logicalValue if (integerValue /= 1) error stop ! Assign logical array values logicalArray = [ .TRUE., .FALSE., .TRUE. ] ! Perform an implicit logical to integer cast for arrays integerArray = logicalArray if (any(integerArray /= [1, 0, 1])) error stop end program logical_to_integer_cast lfortran-0.63.0/integration_tests/openmp_27.f900000664000175000017500000000225015174404631021512 0ustar alastairalastairprogram openmp_27 use omp_lib implicit none real ( kind = 8 ) :: factor integer ( kind = 4 ) :: n, i real ( kind = 8 ) wtime real ( kind = 8 ), allocatable, dimension ( : ) :: x real ( kind = 8 ) :: xdoty real ( kind = 8 ), allocatable, dimension ( : ) :: y n = 100 do while ( n < 1000000 ) n = n * 10 allocate ( x(1:n) ) allocate ( y(1:n) ) factor = real ( n, kind = 8 ) factor = 1.0D+00 / sqrt ( 2.0D+00 * factor * factor + 3 * factor + 1.0D+00 ) do i = 1, n x(i) = i * factor end do do i = 1, n y(i) = i * 6 * factor end do call test02( n, x, y, xdoty ) deallocate ( x ) deallocate ( y ) end do end program subroutine test02 ( n, x, y, xdoty ) use omp_lib implicit none integer n integer ( kind = 4 ) i real ( kind = 8 ) xdoty real ( kind = 8 ) x(n) real ( kind = 8 ) y(n) real ( kind = 8 ) wtime xdoty = 0.0D+00 wtime = omp_get_wtime() !$omp parallel shared(x, y) private(i) reduction(+:xdoty) !$omp do do i = 1, n xdoty = xdoty + x(i) * y(i) end do !$omp end do !$omp end parallel wtime = omp_get_wtime() - wtime print *, 'Parallel ', n, xdoty, wtime if (abs(xdoty - n) > 1e-8) error stop return end lfortran-0.63.0/integration_tests/data_08.f900000664000175000017500000000037715174404631021134 0ustar alastairalastairsubroutine gamo() implicit double precision (A-H,O-Z) dimension g(2) data g/1.5D0,2.5D0/ if (abs(g(1)-1.5D0) > 1e-12) error stop if (abs(g(2)-2.5D0) > 1e-12) error stop print *, g end subroutine program main call gamo() end program lfortran-0.63.0/integration_tests/arrays_reshape_27.f900000664000175000017500000000064315174404631023230 0ustar alastairalastairprogram arrays_reshape_27 implicit none integer, parameter :: n(2) = [2, 2] integer, parameter :: arr(4) = [1,2,3,4] real :: b(2,2) = reshape(arr, n) if (b(1,1) /= 1.0) error stop "Mismatch at b(1,1)" if (b(2,1) /= 2.0) error stop "Mismatch at b(2,1)" if (b(1,2) /= 3.0) error stop "Mismatch at b(1,2)" if (b(2,2) /= 4.0) error stop "Mismatch at b(2,2)" end program arrays_reshape_27 lfortran-0.63.0/integration_tests/intrinsics_257.f900000664000175000017500000000565015174404631022475 0ustar alastairalastairprogram intrinsics_257 implicit none integer(4), parameter :: i1 = product([1, 2, 3]) real(4), parameter :: i2 = product([1.0, 2.0, 3.0]) complex(4), parameter :: i3 = product([(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)]) integer(8), parameter :: i4 = product([1, 2, 3], [.true., .true., .true.]) real(8), parameter :: i5 = product([1.5_8, 22.9_8, 3.0_8], mask = [.true., .false., .true.]) complex(8), parameter :: i6 = product([(1.5_8, 2.2_8), (22.9_8, 1.4_8), (3.0_8, 1.1_8)], mask = [.true., .false., .true.]) integer(4), parameter :: i7 = product([11, 2, 5], 1, mask = [.true., .false., .true.]) real(4), parameter :: i8 = product([1.0, 3.0, 55.9], mask = [.true., .false., .true.], dim = 1) complex(4), parameter :: i9 = product([(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)], dim = 1, mask = [.true., .false., .true.]) integer(4) :: ar1(4) = [1, 2, 7, 9] real(4) :: ar2(4) = [1.0, 3.1, 7.2, 9.0] complex(4) :: ar3(4) = [(1.0, 2.0), (3.0, 4.0), (5.0, 6.0), (7.0, 8.0)] logical(4) :: mask(4) = [.true., .false., .true., .true.] integer(4) :: dim = 1 print *, i1 if (i1 /= 6) error stop print *, i2 if (abs(i2 - 6.0) > 1e-6) error stop print *, i3 if (abs(i3 - (-85.0000000, 20.0000000)) > 1e-6) error stop print *, i4 if (i4 /= 6) error stop print *, i5 if (abs(i5 - 4.5_8) > 1e-12) error stop print *, i6 if (abs(i6 - (2.0799999999999996,8.2500000000000000)) > 1e-6) error stop print *, i7 if (i7 /= 55) error stop print *, i8 if (abs(i8 - 55.9000015) > 1e-6) error stop print *, i9 if (abs(i9 - (-7.00000000,16.0000000)) > 1e-6) error stop print *, product(ar1) if (product(ar1) /= 126) error stop print *, product(ar2) if (abs(product(ar2) - 200.879974) >1e-6 ) error stop print *, product(ar3) ! if (abs(product(ar3) - (-755.000000,-540.000000)) > 1e-6) error stop ! wrong answer print *, product(ar1, mask = mask) if (product(ar1, mask = mask) /= 63) error stop print *, product(ar2, mask = mask) if (abs(product(ar2, mask = mask) - 64.7999954) > 1e-6) error stop print *, product(ar3, mask = mask) ! if (abs(product(ar3, mask = mask) - (-177.000000, 56.0000000)) > 1e-6) error stop print *, product(ar1, dim = dim) if (product(ar1, dim = dim) /= 126) error stop print *, product(ar2, dim = dim) if (abs(product(ar2, dim = dim) - 200.879974) > 1e-6) error stop print *, product(ar3, dim = dim) ! if (abs(product(ar3, dim = dim) - (-755.000000,-540.000000)) > 1e-6) error stop print *, product(ar1, mask = mask, dim = dim) if (product(ar1, mask = mask, dim = dim) /= 63) error stop print *, product(ar2, mask = mask, dim = dim) if (abs(product(ar2, mask = mask, dim = dim) - 64.7999954) > 1e-6) error stop print *, product(ar3, mask = mask, dim = dim) ! if (abs(product(ar3, mask = mask, dim = dim) - (-177.000000,56.0000000)) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_16.f900000664000175000017500000000111115174404631022162 0ustar alastairalastairprogram gpu_metal_16 ! 2D do concurrent with non-parameter bounds implicit none integer :: m, n real :: a(200, 200), a_expected(200, 200) integer :: i, j m = 150 n = 100 do j = 1, 200 do i = 1, 200 a(i, j) = 0.0 a_expected(i, j) = 0.0 end do end do do j = 1, n do i = 1, m a_expected(i, j) = real(i) * real(j) end do end do do concurrent (i = 1:m, j = 1:n) a(i, j) = real(i) * real(j) end do do j = 1, 200 do i = 1, 200 if (abs(a(i, j) - a_expected(i, j)) > 1.0e-5) error stop end do end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/bin_op_real_dp.f900000664000175000017500000000027015174404631022640 0ustar alastairalastairprogram bin_op_real_dp real(4) :: zero real(8) :: v, u real :: x zero = 1.0_4/7 u = 1.0_4/7 v = 1.0_8/7 x = 1.0_4/7 print *, zero, v, x, u end programlfortran-0.63.0/integration_tests/const_kind_01.f900000664000175000017500000000031415174404631022336 0ustar alastairalastairprogram const_kind_01 integer, parameter :: sp = 4, dp = 8 real(sp), parameter :: r1 = 1.0_sp real(dp), parameter :: r2 = 1.0_dp real :: r3 r3 = 1.0_sp r3 = 1.0_dp print *, sp, dp, r1, r2, r3 end program lfortran-0.63.0/integration_tests/separate_compilation_03b.f900000664000175000017500000000033715174404631024556 0ustar alastairalastairmodule separate_compilation_03b_module contains real function mixing_anderson(x0) ! Finds "x" so that R(x) = 0, uses x0 as the initial estimate real, intent(in) :: x0(:) mixing_anderson = sum(x0) end function end module lfortran-0.63.0/integration_tests/module_array_init.f900000664000175000017500000000313415174404631023414 0ustar alastairalastairmodule mod_module_array_init implicit none integer, dimension(2) :: arr_integer_with_zero = 0 integer, dimension(3) :: arr_integer_with_unary_minus = -1 real, dimension(2) :: arr_real_with_zero = 0 real, dimension(4) :: arr_real_with_unary_minus = -1 complex, dimension(2) :: arr_complex_with_zero = (0.0, 0.0) logical, dimension(2) :: arr_logical_with_false = .false. ! TODO: the below commented out declarations don't work correctly ! in LLVM backend ! logical, dimension(2) :: arr_logical_with_true = .true. ! logical, dimension(2) :: arr_logical_with_true_false = [.true., .false.] end module program module_array_init use mod_module_array_init implicit none print *, arr_integer_with_zero if (any(arr_integer_with_zero /= 0)) error stop print *, arr_integer_with_unary_minus if (any(arr_integer_with_unary_minus /= -1)) error stop print*, arr_real_with_zero if (any(arr_real_with_zero /= 0.)) error stop print *, arr_real_with_unary_minus if (any(arr_real_with_unary_minus /= -1.)) error stop print *, arr_complex_with_zero if (any(arr_complex_with_zero /= (0., 0.))) error stop print *, arr_logical_with_false if (any(arr_logical_with_false .neqv. .false.)) error stop ! TODO: comment out this once the declarations above ! works ! print *, arr_logical_with_true ! if (any(arr_logical_with_true .neqv. .true.)) error stop ! print *, arr_logical_with_true_false ! if (arr_logical_with_false(1) .neqv. .true.) error stop ! if (arr_logical_with_false(2) .neqv. .false.) error stop end program lfortran-0.63.0/integration_tests/derived_types_125.f900000664000175000017500000000123315174404631023141 0ustar alastairalastairprogram derived_types_125 ! Test: array constructor of derived type with allocatable component ! Ensures no double-free when assigning [wrapper([1])] to an allocatable array. implicit none type :: wrapper integer, allocatable :: b(:) end type type(wrapper), allocatable :: arr(:) arr = [wrapper([1])] if (size(arr) /= 1) error stop if (size(arr(1)%b) /= 1) error stop if (arr(1)%b(1) /= 1) error stop arr = [wrapper([10, 20, 30])] if (size(arr) /= 1) error stop if (size(arr(1)%b) /= 3) error stop if (arr(1)%b(1) /= 10) error stop if (arr(1)%b(2) /= 20) error stop if (arr(1)%b(3) /= 30) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/expr_15.f900000664000175000017500000000051015174404631021164 0ustar alastairalastairprogram expr_15 implicit none integer :: x x = 25 print *, x if (x /= 25) error stop call abc(x) print *, x if (x /= 26) error stop contains subroutine abc(p) integer, intent(inout) :: p print *, p p = p + 1 print *, p end subroutine end program lfortran-0.63.0/integration_tests/derived_types_56.f900000664000175000017500000000247315174404631023073 0ustar alastairalastairmodule derived_types_56_m implicit none type, abstract :: base contains procedure(base_m), deferred, pass(self) :: m procedure(base_m2), deferred, pass(self) :: m2 generic :: m_gen => m2, m end type type, extends(base) :: derived contains procedure, pass(self) :: m => derived_m procedure, pass(self) :: m2 => derived_m2 end type abstract interface subroutine base_m(self, outi) import :: base class(base) :: self integer :: outi end subroutine subroutine base_m2(self, outi, my) import :: base class(base) :: self integer :: outi integer :: my end subroutine end interface contains subroutine derived_m(self, outi) class(derived) :: self integer :: outi outi = 2 end subroutine subroutine derived_m2(self, outi, my) class(derived) :: self integer :: outi, my outi = 3 end subroutine end module program derived_types_56 use derived_types_56_m implicit none type(derived) :: d integer :: outi call d%m_gen(outi, 10) if (outi /= 3) error stop call d%m_gen(outi) if (outi /= 2) error stop end program lfortran-0.63.0/integration_tests/arrays_intrin_02.f900000664000175000017500000000171315174404631023074 0ustar alastairalastairprogram arrays_intrin_02 logical l1(3), l2(3), l3(3) integer m1(2,3), m2(2,3) l1 = [.true., .true., .true.] l2 = [.true., .true., .false.] l3 = [.false., .false., .false.] if (.not. all(l1)) error stop if (all(l2)) error stop if (all(l3)) error stop if (.not. any(l1)) error stop if (.not. any(l2)) error stop if (any(l3)) error stop m1 = 1 m2 = 1 m2(1,2) = 2 m2(2,2) = 2 call matrixCheck(m1, m2) contains subroutine matrixCheck(m1, m2) integer, intent(in) :: m1(2,3), m2(2,3) if (all(m1 == m2)) error stop if (.not. all(all(m1 == m2, 1) .eqv. [.true., .false., .true.])) error stop if (.not. all(all(m1 == m2, 2) .eqv. [.false., .false.])) error stop if (.not. any(m1 == m2)) error stop if (.not. all(any(m1 == m2, 1) .eqv. [.true., .false., .true.])) error stop if (.not. all(any(m1 == m2, 2) .eqv. [.true., .true.])) error stop end subroutine matrixCheck end program arrays_intrin_02lfortran-0.63.0/integration_tests/procedure_05.f900000664000175000017500000000057015174404631022203 0ustar alastairalastairfunction dnan() double precision dnan dnan = 0.0d0 end function dnan subroutine clqmn(x,y) implicit double precision (x,y) implicit complex*16 (c,z) z = dcmplx(x, y) xc=abs(z) ls=0 if (dimag(z) == 0.0d0.or.xc < 1.0d0) ls=1 if(ls /=0 ) error stop return end program main implicit none call clqmn(1.0d0, 2.0d0) end program mainlfortran-0.63.0/integration_tests/int_03.f900000664000175000017500000000117015174404631021000 0ustar alastairalastairprogram int_03 implicit none integer, parameter :: dp = kind(0.d0) integer(8) :: ans(5) integer :: i4 integer(8) :: i8 complex(dp) :: w8 complex :: w4 ans(1) = 8524933037632333570_8 ans(2) = -1069250973542918798_8 ans(3) = -5123867065024149335_8 ans(4) = 7303655603304982073_8 ans(5) = 5108441843522503546_8 print *, ans w8 = (7.7_8, 5.0_8) i4 = w8 i8 = w8 print *, i4, i8 if (i4 /= 7) error stop if (i8 /= 7) error stop w4 = (7.7, 5.0) i4 = w4 i8 = w4 print *, i4, i8 if (i4 /= 7) error stop if (i8 /= 7) error stop end program lfortran-0.63.0/integration_tests/intent_02.f900000664000175000017500000000135415174404631021512 0ustar alastairalastairmodule intent_02_mod type tt character(:), allocatable :: ssss end type tt contains subroutine sub1(str_tt) type(tt), intent(out) :: str_tt print *,allocated(str_tt%ssss) if(allocated(str_tt%ssss) .neqv. .false.) error stop end subroutine subroutine sub2(str) character(:), allocatable, intent(out) :: str print *, allocated(str) if(allocated(str) .neqv. .false.) error stop end subroutine end module program intent_02 use intent_02_mod type(tt) :: s1 character(:), allocatable :: allocatable_str allocate(character(10) :: allocatable_str) allocate( character(10) :: s1%ssss) call sub1(s1) call sub2(allocatable_str) end program lfortran-0.63.0/integration_tests/derived_types_11.f900000664000175000017500000000061615174404631023057 0ustar alastairalastairmodule derived_types_11 implicit none type :: y character(kind=1, len=1) :: backslash = '\' end type y type(y), public, parameter :: type_y = y() character(len=3) :: x = "lf" // type_y%backslash end module derived_types_11 program main use derived_types_11 implicit none if (type_y%backslash /= '\') error stop if (x /= "lf\") error stop end program lfortran-0.63.0/integration_tests/doloop_13.f900000664000175000017500000000054615174404631021511 0ustar alastairalastairsubroutine check1() integer incx common /com/incx do 80 incx = 1, 2 80 continue return end subroutine subroutine stest() integer incx, i common /com/incx do 40 i = 1, 5 40 continue return end subroutine program doloop_13 integer incx common /com/incx call check1() call stest() if (incx /= 3) error stop end program lfortran-0.63.0/integration_tests/allocate_33.f900000664000175000017500000000211015174404631021770 0ustar alastairalastairmodule allocate_33_mod implicit none type :: person character(len=50) :: name integer, allocatable :: scores(:) end type person contains function update_person(original) result(updated) type(person), allocatable, intent(in) :: original type(person), allocatable :: updated integer :: num_scores allocate(updated) updated%name = "modified: " // trim(original%name) num_scores = size(original%scores) allocate(updated%scores(num_scores + 1)) if (num_scores > 0) then updated%scores(1:num_scores) = original%scores + 10 end if updated%scores(num_scores + 1) = 999 end function update_person end module allocate_33_mod program allocate_33 use allocate_33_mod implicit none type(person), allocatable :: x allocate(x) x%name = "john doe" allocate(x%scores(3)) x%scores = [85, 92, 78] x = update_person(x) if (x%scores(1) /= 95) error stop if (x%scores(2) /= 102) error stop if (x%scores(3) /= 88) error stop if (x%scores(4) /= 999) error stop print *, "All tests passed." end program allocate_33lfortran-0.63.0/integration_tests/if_01.f900000664000175000017500000000007015174404631020600 0ustar alastairalastairprogram if_01 implicit none if (.false.) error stop end lfortran-0.63.0/integration_tests/derived_types_73.f900000664000175000017500000000252415174404631023067 0ustar alastairalastairmodule derived_types_73_mod implicit none type :: parent_t integer :: a = -1 integer :: b = -1 contains procedure, pass :: show => show_parent end type parent_t type, extends(parent_t) :: child_t integer :: y = -2 contains procedure, pass :: show => show_child end type child_t contains subroutine show_parent(self) class(parent_t), intent(inout) :: self self%a = 15 self%b = 30 end subroutine show_parent subroutine show_child(self) class(child_t), intent(inout) :: self self%a = 45 self%b = 60 self%y = 5 end subroutine show_child end module derived_types_73_mod program derived_types_73 use derived_types_73_mod implicit none type(parent_t) :: p type(child_t) :: c p%a = 10 p%b = 20 c%a = 1 c%b = 2 c%y = 2 c%parent_t = p if (c%a /= 10 .or. c%b /= 20) error stop call assign_struct_members(c%parent_t) if (c%a /= 100 .or. c%b /= 200) error stop c%parent_t = parent_t(150, 250) if (c%a /= 150 .or. c%b /= 250) error stop call c%show() if (c%a /= 45 .or. c%b /= 60 .or. c%y /= 5) error stop call c%parent_t%show() if (c%a /= 15 .or. c%b /= 30) error stop contains subroutine assign_struct_members(p) type(parent_t), intent(inout) :: p p%a = 100 p%b = 200 end subroutine assign_struct_members end program derived_types_73 lfortran-0.63.0/integration_tests/gpu_metal_175.f900000664000175000017500000000136615174404631022264 0ustar alastairalastairmodule gpu_metal_175_m implicit none type :: t real, allocatable :: v(:) end type contains pure function get_v(x) result(r) type(t), intent(in) :: x real, allocatable :: r(:) allocate(r(size(x%v))) r = x%v end function end module program gpu_metal_175 use gpu_metal_175_m implicit none type(t) :: arr(2) real :: a(2, 2), b(2, 2) real :: expected(2, 2) integer :: i arr(1) = t([1.0, 2.0]) arr(2) = t([3.0, 4.0]) expected = reshape([1.0, 2.0, 3.0, 4.0], [2, 2]) do concurrent(i = 1:2) a(:, i) = arr(i)%v end do do concurrent(i = 1:2) b(:, i) = get_v(arr(i)) end do if (any(abs(a - expected) > 1e-6)) error stop if (any(abs(b - expected) > 1e-6)) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/data_13.f900000664000175000017500000000074015174404631021122 0ustar alastairalastairprogram data_13 implicit none integer, parameter :: k = 3 integer :: i, iarx(k), iary(2*k) data(iarx(i), i=1, k) / 1, 2, 3 / print *, iarx(1) if (iarx(1) /= 1) error stop print *, iarx(2) if (iarx(2) /= 2) error stop print *, iarx(3) if (iarx(3) /= 3) error stop data(iary(i), i=1, 2*k, 2) / 1, 3, 5 / data(iary(i), i=2, 2*k, 2) / 2, 4, 6 / print *, iary if (any(iary /= [1, 2, 3, 4, 5, 6])) error stop end program data_13 lfortran-0.63.0/integration_tests/derived_types_07.f900000664000175000017500000000120215174404631023054 0ustar alastairalastairmodule derived_types_07_stdlib_logger type :: logger_type private logical :: add_blank_line = .false. integer, allocatable :: log_units(:) integer :: max_width = 0 contains private final :: final_logger end type logger_type contains subroutine final_logger( self ) type(logger_type), intent(in) :: self integer :: iostat character(256) :: message integer :: unit end subroutine end module program derived_types_05 implicit none end program lfortran-0.63.0/integration_tests/gpu_metal_105.f900000664000175000017500000000070415174404631022250 0ustar alastairalastairprogram gpu_metal_105 ! matmul inside a regular do loop nested within do concurrent implicit none integer :: l, pair real :: w(2,2), a(2), c(2) w(1,1) = 1.0; w(2,1) = 1.0 w(1,2) = 1.0; w(2,2) = 1.0 a = [1.0, 2.0] do concurrent (pair = 1:1) do l = 1, 2 c = matmul(w, a) end do end do ! c(1) = 1*1 + 1*2 = 3, c(2) = 1*1 + 1*2 = 3 if (abs(c(1) - 3.0) > 1.0e-5) error stop if (abs(c(2) - 3.0) > 1.0e-5) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/intrinsics_48.f900000664000175000017500000000041115174404631022401 0ustar alastairalastairprogram intrinsics_48 implicit none real :: x(3) x = [1., 2., 3.] x = log_gamma(x) + log_gamma(x + 1) print *, x if (x(1) /= 0.0) error stop if (abs(x(2) - 0.693147182) > 1e-12) error stop if (abs(x(3) - 2.48490667) > 1e-12) error stop end program intrinsics_48 lfortran-0.63.0/integration_tests/file_19.f900000664000175000017500000000052715174404631021141 0ustar alastairalastairprogram file_19 implicit none character(len=25) :: buffer integer :: chunk, iostat open(11, file="file_19_data.txt") read(11, '(a)', iostat=iostat, size=chunk, advance='no') buffer print *, buffer if (buffer /= " Hi this is 1st line!") error stop print *, chunk if (chunk /= 21) error stop end program lfortran-0.63.0/integration_tests/class_88.f900000664000175000017500000000222515174404631021332 0ustar alastairalastairmodule class_88_m type t integer :: n = 0 contains procedure :: tbp => f end type contains function f(this) class(t), pointer, intent(in) :: this integer, pointer :: f f => this%n end function f end module program test use class_88_m implicit none type(t), target :: xt class(t), pointer :: xp integer, pointer :: result_ptr ! Initialize xt%n = 42 xp => xt ! Test type-bound procedure call with type variable result_ptr => xt%tbp() print *, result_ptr, xt%tbp() if (result_ptr /= 42) error stop "Failed: xt%tbp() should return 42" ! Test type-bound procedure call with class pointer result_ptr => xp%tbp() print *, result_ptr, xp%tbp() if (result_ptr /= 42) error stop "Failed: xp%tbp() should return 42" ! Test assignment through pointer-returning TBP with type variable xt%tbp() = 99 print *, xt%tbp() if (xt%n /= 99) error stop "Failed: xt%tbp() = 99 should set xt%n to 99" ! Test assignment through pointer-returning TBP with class pointer xp%tbp() = 123 print *, xp%tbp() if (xt%n /= 123) error stop "Failed: xp%tbp() = 123 should set xt%n to 123" print *, "OK" end program test lfortran-0.63.0/integration_tests/intrinsics_213.f900000664000175000017500000000112515174404631022456 0ustar alastairalastairprogram intrinsics_213 ! Which is faster: exp or log? integer:: n, k = 2 real:: x,dx,y,z,t1,t2 print "(A,I0)",'k = ',k dx = 1e-6 call cpu_time(t1) x = 0 do n = 1,10**k x = x+dx z = exp(-1/x) end do call cpu_time(t2) print "(2(A,F10.3))",'after 10**k exp, abs(t2-t1) = ',abs(t2-t1),' s; z=',z if (abs(z) > 1e-8) error stop x = 1 do n = 1,10**k x = x+dx z = log(x) end do call cpu_time(t1) print "(2(A,F10.3))",'after 10**k log, abs(t2-t1) = ',abs(t2-t1),' s; z=',z if (abs(z - (9.53628842e-05)) > 1e-8) error stop end program intrinsics_213 lfortran-0.63.0/integration_tests/derived_types_47.f900000664000175000017500000000054115174404631023065 0ustar alastairalastairmodule derived_types_47_m implicit none type t integer :: x = 1 integer :: y = 1 end type type(t), parameter :: ins = t(2, 3) end module derived_types_47_m program derived_types_47 use derived_types_47_m implicit none if (ins%x /= 2) error stop if (ins%y /= 3) error stop end program derived_types_47 lfortran-0.63.0/integration_tests/modules_69.f900000664000175000017500000000161315174404631021674 0ustar alastairalastairmodule modules_69_m implicit none type :: t integer :: n = 0 end type t interface get_n module procedure :: get_n end interface contains pure function get_n(s) result(r) type(t), intent(in) :: s integer :: r r = s%n end function end module module modules_69_m2 use modules_69_m, only: t, get_n implicit none contains subroutine f(x, a) type(t), intent(in) :: x character, intent(out) :: a(get_n(x)) integer :: i do i = 1, get_n(x) a(i) = "x" end do end subroutine end module program modules_69 use modules_69_m2, only: f use modules_69_m, only: t implicit none type(t) :: x character :: a(3) x%n = 3 call f(x, a) if (a(1) /= "x") error stop if (a(2) /= "x") error stop if (a(3) /= "x") error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/derived_types_93.f900000664000175000017500000000231215174404631023064 0ustar alastairalastairmodule derived_types_93_mod implicit none type :: temp_test integer :: val end type temp_test type :: dep_t character(len=:), allocatable :: proj_dir type(temp_test), allocatable :: tmp contains procedure :: equal_dep generic :: operator(==) => equal_dep end type dep_t contains logical function equal_dep(lhs, rhs) class(dep_t), intent(in) :: lhs, rhs if (allocated(lhs%proj_dir) .neqv. allocated(rhs%proj_dir)) then equal_dep = .false. else if (.not. allocated(lhs%proj_dir)) then equal_dep = .true. else equal_dep = lhs%proj_dir == rhs%proj_dir end if end function equal_dep end module derived_types_93_mod program derived_types_93 use derived_types_93_mod type(dep_t), allocatable :: d1(:), d2(:) integer :: i allocate(d1(5), d2(5)) do i = 1, 3 d1(i)%proj_dir = "AAA" d2(i)%proj_dir = "AAA" allocate(d1(i)%tmp) allocate(d2(i)%tmp) d1(i)%tmp%val = i d2(i)%tmp%val = i end do do i = 1, size(d1) if(.not. d1(i) == d2(i)) error stop end do end program derived_types_93lfortran-0.63.0/integration_tests/arrays_reshape_35.f900000664000175000017500000000105015174404631023220 0ustar alastairalastair! Test: reshape() with pad argument where target > source at module level ! Verifies that module-level reshape with padding correctly computes the ! compile-time value without corrupting preceding parameter arrays. module arrays_reshape_35_mod implicit none real, parameter :: d1(1) = [1] real :: d2(2) = reshape(d1, [2], [real:: 0]) end module program arrays_reshape_35 use arrays_reshape_35_mod implicit none if (abs(d2(1) - 1.0) > 1e-6) error stop if (abs(d2(2) - 0.0) > 1e-6) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/arrays_50.f900000664000175000017500000000011515174404631021507 0ustar alastairalastairprogram arrays_50 use arrays_50_mod_a call fdf() end program arrays_50 lfortran-0.63.0/integration_tests/minmax_01.f900000664000175000017500000000035715174404631021503 0ustar alastairalastairprogram minmax_01 integer :: x, y, z x = 4 y = 5 ! Runtime z = min0(x, y) if (z /= 4) error stop z = max0(x, y) if (z /= 5) error stop ! Compile time z = min0(4, 5) if (z /= 4) error stop z = max0(4, 5) if (z /= 5) error stop end program lfortran-0.63.0/integration_tests/derived_types_15.f900000664000175000017500000000157515174404631023070 0ustar alastairalastairmodule derived_types_15_module_1 implicit none private public :: t_1 type t_1 real :: i contains generic :: compute => multiply, sqrt_subtract procedure :: multiply procedure :: sqrt_subtract end type t_1 contains function multiply(self, j) result(res) class(t_1), intent(in) :: self real, intent(in) :: j real :: res res = self%i * j end function multiply function sqrt_subtract(self, j) result(res) class(t_1), intent(in) :: self integer, intent(in) :: j real :: res res = self%i - (j ** 0.5) end function sqrt_subtract end module program name use derived_types_15_module_1 implicit none type(t_1) :: type_1 type_1%i = 100.0 if (type_1%compute(5.0) /= 500) error stop if (type_1%compute(2500) /= 50) error stop end program name lfortran-0.63.0/integration_tests/implied_do_loops21.f900000664000175000017500000000106115174404631023367 0ustar alastairalastairprogram implied_do_loops21 ! Test: allocatable array assigned from implied-do array constructor ! containing calls to a function returning an allocatable array, ! with --realloc-lhs-arrays enabled. implicit none integer :: k real, allocatable :: x(:) x = [(f(k), k=1,3)] if (size(x) /= 3) error stop if (abs(x(1) - 1.0) > 1e-6) error stop if (abs(x(2) - 2.0) > 1e-6) error stop if (abs(x(3) - 3.0) > 1e-6) error stop contains pure function f(j) result(v) integer, intent(in) :: j real, allocatable :: v(:) v = [real(j)] end function end program lfortran-0.63.0/integration_tests/intrinsics_128.f900000664000175000017500000000123615174404631022466 0ustar alastairalastairprogram intrinsics_128 implicit none double precision :: x integer, parameter :: x1 = idint(4.23_8) integer, parameter :: y1 = idint(123.41_8) integer, parameter :: ar1(3) = idint([1.0_8, 2.11_8, -31.0_8]) real(8) :: arr1(3) = [1.0_8, 2.11_8, -31.0_8] print *, x1 if (x1 /= 4) error stop print *, y1 if (y1 /= 123) error stop print *, ar1 if (any(ar1 /= [1, 2, -31])) error stop print *, idint(arr1) if (any(idint(arr1) /= [1, 2, -31])) error stop x = 4.23 print *, idint(x) if( .not. idint(x) == 4 ) error stop print *, idint(4.23D0) if( .not. idint(4.23D0) == 4 ) error stop end program lfortran-0.63.0/integration_tests/list_test_02_.f900000664000175000017500000000511215174404631022356 0ustar alastairalastairmodule list_test_02_mod implicit none character(len=:), allocatable :: tmp_str contains function fill_list_str(size) result(a) integer, intent(in) :: size type(_lfortran_list(character(len=:))) :: a integer :: i character(len=:), allocatable :: str_tmp a = _lfortran_list_constant("0_str", "1_str") do i = 0, size-1 write(str_tmp, '(I0)') i + 2 str_tmp = trim(str_tmp)//"_str" call _lfortran_list_append(a, str_tmp) end do end function subroutine test_list_01() type(_lfortran_list(character(len=:))) :: a, b character(len=:), allocatable :: string integer :: i character(len=:), allocatable :: str_tmp string = "string_" b = _lfortran_list_constant(string, string) a = fill_list_str(10) do i = 0, 9 write(str_tmp, '(I0)') i + 2 call _lfortran_list_append(b, trim(string) // trim(str_tmp)) end do do i = 0, 11 print *, _lfortran_get_item(a, i), _lfortran_get_item(b, i) end do call _lfortran_set_item(a, 11, "no_str") call _lfortran_set_item(a, 10, string) do i = 0, 11 if (i / 2 == 2 * i) then write(str_tmp, '(I0)') i call _lfortran_set_item(b, i, trim(str_tmp) // "_str") else write(string, '(I0)') i string = trim(string) // "_str" call _lfortran_set_item(b, i, string) end if end do do i = 0, 9 if (_lfortran_get_item(b, i) /= _lfortran_get_item(a, i)) error stop end do end subroutine subroutine test_list_02() type(_lfortran_list(character(len=:))) :: x, y integer :: i character(len=:), allocatable :: str_tmp, s x = _lfortran_list_constant("1", "2") do i = 0, 49 write(str_tmp, '(I0)') i call _lfortran_list_append(x, "str_" // trim(str_tmp)) end do write(str_tmp, '(A,A)') "str_", _lfortran_get_item(x, 0) call _lfortran_set_item(x, 0, trim(str_tmp)) write(str_tmp, '(A,A)') "str_", _lfortran_get_item(x, 1) call _lfortran_set_item(x, 1, trim(str_tmp)) do i = 0, _lfortran_len(x) - 1 call _lfortran_list_append(y, _lfortran_get_item(x, i)) end do do i = 0, _lfortran_len(y) - 1 if (_lfortran_get_item(x, i) /= _lfortran_get_item(y, i)) error stop end do end subroutine subroutine tests() call test_list_01() call test_list_02() end subroutine end module program test_list_str use list_test_02_mod implicit none call tests() end program lfortran-0.63.0/integration_tests/submodule_19c.f900000664000175000017500000000027115174404631022360 0ustar alastairalastairsubmodule(string_m_submodule_19) string_s_submodule_19 contains module procedure assign_character_to_string_t lhs%s = "hello" end procedure end submodule string_s_submodule_19 lfortran-0.63.0/integration_tests/namelist_17.f900000664000175000017500000000145215174404631022032 0ustar alastairalastairprogram test_namelist_derived_types implicit none integer :: a, b real :: c type :: point integer :: x, y end type type(point) :: p namelist /nml/ a, b, c, p a = 1 b = 2 c = 3.5 p%x = 4 p%y = 5 open(unit=10, file='namelist_dt_17.dat', status='replace', form='formatted') write(10, nml=nml) close(10) a = 0 b = 0 c = 0 p%x = 0 p%y = 0 open(unit=10, file='namelist_dt_17.dat', status='old', form='formatted') read(10, nml=nml) close(10) print *, a if (a /= 1) error stop print *, b if (b /= 2) error stop print *, c if (abs(c-3.5) > 1e-5) error stop print *, p%x if (p%x /= 4) error stop print *, p%y if (p%y /= 5) error stop end program test_namelist_derived_types lfortran-0.63.0/integration_tests/cmd_02.f900000664000175000017500000000030515174404631020747 0ustar alastairalastairprogram test_exec character(len=255) :: homedir call get_environment_variable("HOME", homedir) print *, trim(homedir) call execute_command_line("printenv") end program test_exec lfortran-0.63.0/integration_tests/block_09.f900000664000175000017500000000044215174404631021307 0ustar alastairalastairblock data init_data real :: xyzzy common xyzzy data xyzzy / 42.0 / end block data init_data program test_blank_common implicit none real :: xyzzy common xyzzy if (abs(xyzzy - 42.0) > 1.0e-8) error stop "wrong value" print *, "test passed" end program test_blank_common lfortran-0.63.0/integration_tests/common_13.f900000664000175000017500000000071715174404631021505 0ustar alastairalastairblock data integer myint, myzero integer myarr common /myblock/ myint, myzero, /arrblock/ myarr(10) data myint/44/ data myarr/1,2,3,4,5,6,7,8,9,10/ end program common_13 implicit none integer myint, myzero integer myarr common /myblock/ myint, myzero, /arrblock/ myarr(10) if (myint /= 44) error stop if (myzero /= 0) error stop if (any(myarr /= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])) error stop end program lfortran-0.63.0/integration_tests/intrinsics_219.f900000664000175000017500000000023715174404631022467 0ustar alastairalastairprogram intrinsics_219 integer :: x = sum([1, 2, 3]) integer, parameter :: y = sum([1, 2, 3]) if (x /= 6) error stop if (y /= 6) error stop endlfortran-0.63.0/integration_tests/implicit_interface_27b.f900000664000175000017500000000011515174404631024206 0ustar alastairalastaircomplex function test_complex() test_complex = (21.0, -3.0) end function lfortran-0.63.0/integration_tests/common_03.f900000664000175000017500000000067015174404631021502 0ustar alastairalastairsubroutine pass() real A(2), B integer i(5), e common /SaMpLe/ A, B, i if (abs(A(1) - 10.0) > 1e-7) error stop if (abs(B - 20.0) > 1e-7) error stop print *, A, B, e end subroutine program common3 real A, B, z1, z2 integer c, d, e, f, g, h, i(5), j common z1, /c/ c, /b/ d /Sample/ A(2), /b/ e, f, //z2 /c/ g, h, j /sample/ B, i A = [10.0, 11.0] B = 20.0 e = 123 call pass() end program lfortran-0.63.0/integration_tests/intrinsics_227.f900000664000175000017500000000174015174404631022466 0ustar alastairalastairprogram intrinsics_227 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real(sp), parameter :: x1(3) = [1.0, 2.0, 3.0] real(dp), parameter :: x2(5) = [5.0, 7.0, 11.0, 13.0, 17.0] real(dp), parameter :: x = norm2([1.0, 2.0, 3.0, 4.0, 5.0]) real(sp), parameter :: y = norm2([5.0, 7.0, 11.0, 13.0, 17.0]) real(sp) :: y1(5) = [5.0, 7.0, 11.0, 13.0, 17.0] real(dp) :: y2(10) = [14.0, 21.0, 33.0, 39.0, 51.0, 5.0, 7.0, 11.0, 13.0, 17.0] print*, norm2(x1) if (abs(norm2(x1) - 3.7416573867739413_sp) > 1e-6 ) error stop print*, norm2(x2) if (abs(norm2(x2) - 25.553864678361276_dp) > 1e-12 ) error stop print*, norm2(y1) if (abs(norm2(y1) - 25.5538654_sp) > 1e-6 ) error stop print*, norm2(y2) if (abs(norm2(y2) - 80.628778981204974_dp) > 1e-12 ) error stop print*, x if (abs(x - 7.4161982536315918_dp) > 1e-12 ) error stop print*, y if (abs(y - 25.5538654_sp) > 1e-6 ) error stop end programlfortran-0.63.0/integration_tests/int_01.f900000664000175000017500000000015715174404631021002 0ustar alastairalastairprogram int_01 real, parameter :: x = 3.3 integer, parameter :: y = 7 print*, int(x), int(y) end program lfortran-0.63.0/integration_tests/array_01_transfer.f900000664000175000017500000000017615174404631023233 0ustar alastairalastairprogram array_01_transfer integer :: m(6), size = 2 m = [ 1, 0, 0, 0, 5, 0 ] print *, transfer(m, 1.0, size) end programlfortran-0.63.0/integration_tests/bin_op_real_02.f900000664000175000017500000000117715174404631022465 0ustar alastairalastairprogram readnan2 real:: xnan character:: cni*4 = 'NAN ' read(cni,*) xnan print *, 'NaN > NaN?', xnan > xnan if ((xnan > xnan) .neqv. .false.) error stop print *, 'NaN >= NaN?', xnan >= xnan if ((xnan >= xnan) .neqv. .false.) error stop print *, 'NaN < NaN?', xnan < xnan if ((xnan < xnan) .neqv. .false.) error stop print *, 'NaN <= NaN?', xnan <= xnan if ((xnan <= xnan) .neqv. .false.) error stop print *, 'NaN == NaN?', xnan == xnan if ((xnan == xnan) .neqv. .false.) error stop print *, 'NaN /= NaN?', xnan /= xnan if ((xnan /= xnan) .neqv. .true.) error stop end program readnan2 lfortran-0.63.0/integration_tests/arrays_65.f900000664000175000017500000000026215174404631021520 0ustar alastairalastairprogram arrays_65 integer :: A(2) = [1,2] integer :: n = 2 integer :: dim = 1 A = sum(spread(A, dim, n), dim=dim) if (A(1) /= 2) error stop if (A(2) /= 4) error stop end program lfortran-0.63.0/integration_tests/functions_10.f900000664000175000017500000000151015174404631022212 0ustar alastairalastairmodule kwarg_gp interface mergegp procedure :: mergei32, merger32, merger64 end interface contains function mergei32(a, b, m) result(r) integer :: a(:), b(:) integer, optional :: m(:) integer :: r end function function merger32(a, b, m) result(r) real :: a(:), b(:) real, optional :: m(:) real :: r end function function merger64(a, b, m) result(r) real(8) :: a(:), b(:) real(8), optional :: m(:) real(8) :: r end function end module program kwarg_use use kwarg_gp implicit none integer :: a1(4), b1(4), m1(4) real :: a2(5), b2(5), m2(5) print *, mergegp(a1, b1) print *, mergegp(a1, b1, m=m1) print *, mergegp(a1, b1, m1) print *, mergegp(a2, b2) print *, mergegp(a2, b2, m=m2) print *, mergegp(a2, b2, m2) end programlfortran-0.63.0/integration_tests/inquire_07.f900000664000175000017500000000042515174404631021670 0ustar alastairalastairprogram inquire_07 implicit none integer :: i, iolen logical :: l character(4) :: s real :: r inquire (iolength=iolen) l, s, i, r if (iolen /= 16) then error stop "inquire(iolength=...) produced wrong result" end if end program inquire_07lfortran-0.63.0/integration_tests/string_08.f900000664000175000017500000000214215174404631021521 0ustar alastairalastairmodule string_08_mod implicit none contains integer elemental function len_trim(string) result(r) character(len=*), intent(in) :: string r = len(string) if (r == 0) return do while(string(r:r) == " ") r = r - 1 if (r == 0) exit end do end function function trim(x) result(r) character(len=*),intent(in) :: x character(len=len_trim(x)) :: r integer :: i do i = 1, len(r) r(i:i) = x(i:i) end do end function end module program string_08 use string_08_mod implicit none character(*), parameter :: s1 = " A B ", s2 = " " if (len_trim(s1) /= 4) error stop if (len_trim(s2) /= 0) error stop if (len_trim(" ") /= 0) error stop if (len_trim("") /= 0) error stop if (len_trim("xx") /= 2) error stop if (trim(s1) /= " A B") error stop if (trim(s2) /= "") error stop if (trim(" ") /= "") error stop if (trim("") /= "") error stop if (trim("xx") /= "xx") error stop if (len(trim(s1)) /= 4) error stop if (len(trim(s2)) /= 0) error stop if (len(trim(" ")) /= 0) error stop if (len(trim("")) /= 0) error stop if (len(trim("xx")) /= 2) error stop print *, trim("xx ") print *, len(trim("xx ")) end program lfortran-0.63.0/integration_tests/format_71.f900000664000175000017500000000143515174404631021507 0ustar alastairalastairprogram format_71 implicit none real :: f1, f2, f3, f4, f5 integer :: i1, i2 open(10, file='format_69.dat', status='replace', form='formatted') write(10, '(a)') '7.77-0.747E-02 +0.549E022' write(10, '(a)') '+0.662E-00 0.468-1011' rewind(10) i2 = -42 read(10, '(F4.2, (2(E10.3)), I2)') f1, f2, f3, i1, f4, f5, i2 close(10) if (abs(f1 - 7.77) > 1.0e-4) error stop "f1 mismatch" if (abs(f2 + 0.747e-2) > 1.0e-4) error stop "f2 mismatch" if (abs(f3 - 0.549) > 1.0e-4) error stop "f3 mismatch" if (abs(f4 - 0.662) > 1.0e-4) error stop "f4 mismatch" if (abs(f5 - 0.468e-10) > 1.0e-14) error stop "f5 mismatch" if (i1 /= 22) error stop "i1 mismatch" if (i2 /= 11) error stop "i2 mismatch" end program format_71lfortran-0.63.0/integration_tests/string_43.f900000664000175000017500000000065215174404631021524 0ustar alastairalastairprogram string_43 character(len=2) :: textblock(3) textblock = f() print*, "lf"//textblock contains function f() result(textblock) character(len=256), allocatable :: textblock(:) allocate(textblock(2)) textblock(1) = "lf" textblock(2) = "gf" textblock=[character(len=len(textblock)+1) :: ' ',textblock] textblock=' '//textblock end function end program lfortran-0.63.0/integration_tests/allocated_01.f900000664000175000017500000000022015174404631022127 0ustar alastairalastairprogram main implicit none real(4), allocatable :: x(:) print *, allocated(x) if (allocated(x)) error stop end program main lfortran-0.63.0/integration_tests/separate_compilation_03a.f900000664000175000017500000000023715174404631024554 0ustar alastairalastairmodule separate_compilation_03a_module contains real function integrate_trapz_1(Rp) result(s) real, intent(in) :: Rp(:) s = sum(Rp) end function end module lfortran-0.63.0/integration_tests/intrinsics_350.f900000664000175000017500000000124015174404631022456 0ustar alastairalastairprogram intrinsics_350 real(8) :: v(2,3) real(8), allocatable :: v_(:) real(8) :: v_2(2) allocate(v_(size(v,1))) v = 2 v_ = v(:,2) v_2 = v(:,2) ! output should be the exact same print *, sum(1 - spread(v(:,2),dim = 2 , ncopies =23)) if ( abs(sum(1 - spread(v(:,2),dim = 2 , ncopies =23)) - (-46.0)) > 1e-6 ) error stop print *, sum(1 - spread(v_,dim = 2 , ncopies =23)) if ( abs(sum(1 - spread(v_,dim = 2 , ncopies =23)) - (-46.0)) > 1e-6 ) error stop print *, sum(1 - spread(v_2,dim = 2 , ncopies =23)) if ( abs(sum(1 - spread(v_2,dim = 2 , ncopies =23)) - (-46.0)) > 1e-6 ) error stop end program intrinsics_350 lfortran-0.63.0/integration_tests/c_ptr_04.f900000664000175000017500000000134515174404631021322 0ustar alastairalastairmodule mod_uop contains subroutine uop( sendbuf) use iso_c_binding, only: c_loc, c_ptr, c_null_ptr, c_associated, c_intptr_t real(8), dimension(:), intent(in), target :: sendbuf type(c_ptr) :: c_send c_send = c_null_ptr c_send = c_loc(sendbuf) print *, 'C pointer: ', transfer(c_send, 0_c_intptr_t) if (.not. c_associated(c_send)) then error stop 'Error: c_send is null' end if end subroutine end module mod_uop program c_ptr_04 use mod_uop use iso_c_binding, only: c_loc,c_ptr real(8) :: vin(65000) ! type(c_ptr) :: c_send call uop(vin) ! c_send = c_loc(vin) ! print *, 'C pointer: ', c_send end program c_ptr_04lfortran-0.63.0/integration_tests/inquire_06.f900000664000175000017500000000033315174404631021665 0ustar alastairalastairprogram inquire_recl implicit none integer :: u, r open(newunit=u, file="inquire_06.bin", access="direct", recl=32) inquire(unit=u, recl=r) if (r /= 32) error stop close(u, status="delete") end program lfortran-0.63.0/integration_tests/format_38.f900000664000175000017500000000137415174404631021514 0ustar alastairalastairprogram format_38 implicit none real :: value character(len=20) :: output value = 42.43 write(output, '(1p, f10.3)') value if (output /= " 424.300 ") error stop write(output, '(-1p, f10.3)') value if (output /= " 4.243 ") error stop write(output, '(+2p, f10.3)') value if (output /= " 4243.000 ") error stop write(output, '(+0p, f10.3)') value if (output /= " 42.430 ") error stop write(output, '(+1p, f10.3)') value if (output /= " 424.300 ") error stop ! Test format statement with + sign write(output, 100) value if (output /= " 424.300 ") error stop 100 format (+1p, f10.3) print *, "All tests passed" end program lfortran-0.63.0/integration_tests/format_35.f900000664000175000017500000000037315174404631021507 0ustar alastairalastairprogram format_35 implicit none character fmt*10, line*80, letters*26 integer i letters = 'abcdefghijklmnopqrstuvwxyz' fmt = '(99(1X,A))' write(line,fmt) (letters(i:i), i=1,26) print "(A)", trim(line) end program format_35 lfortran-0.63.0/integration_tests/passing_array_03.f900000664000175000017500000000127315174404631023054 0ustar alastairalastairMODULE passing_array_03_mod implicit none CONTAINS FUNCTION test_01 (value) result(res) implicit none ! Ranks aren't equal, but it works as long as we can slice the passed array. INTEGER, DIMENSION(2,2,2),intent(in) :: value INTEGER :: res res = size(value) END FUNCTION test_01 subroutine test_entry INTEGER, DIMENSION(6,2) :: value integer :: ret ret = test_01(value) print *, ret if (ret /= 8) error stop end subroutine test_entry END MODULE passing_array_03_mod program passing_array_03 use passing_array_03_mod implicit none call test_entry end program passing_array_03 lfortran-0.63.0/integration_tests/intrinsics_208.f900000664000175000017500000000177415174404631022474 0ustar alastairalastairprogram intrinsics_208 use iso_fortran_env, only: sp=>real32, dp=>real64 integer :: i = 123 integer(8) :: j = 1234567 integer :: size integer :: arr1(3) = [11, 121, 1234] integer, parameter :: i1 = bit_size(11) integer(8), parameter :: i2 = bit_size(11) integer, parameter :: ar1 = bit_size([1,2,3]) integer(8), parameter :: ar2 = bit_size([1,2,3]) print *, i1 if( i1 /= 32 ) error stop print *, i2 if( i2 /= 32 ) error stop print *, ar1 if( ar1 /= 32 ) error stop print *, ar2 if( ar2 /= 32 ) error stop print*, bit_size(1) if (bit_size(1) /= 32) error stop print*, bit_size(1_dp) if (bit_size(1_dp) /= 64) error stop size = bit_size(i) print *, size if( size /= 32 ) error stop print*, bit_size(j) if( bit_size(j) /= 64 ) error stop print *, bit_size(arr1) if( bit_size(arr1) /= 32 ) error stop print *, kind(bit_size(1_8)) if( kind(bit_size(1_8)) /= 8 ) error stop end programlfortran-0.63.0/integration_tests/struct_type_09.f900000664000175000017500000000065015174404631022603 0ustar alastairalastairmodule struct_type_09_mod use iso_c_binding, only: c_ptr, c_null_ptr implicit none type :: boxed_ptr type(c_ptr) :: p = c_null_ptr end type boxed_ptr type(boxed_ptr), save :: x end module struct_type_09_mod program struct_type_09 use iso_c_binding, only: c_associated use struct_type_09_mod, only: x implicit none write(*, '(L1)') c_associated(x%p) end program struct_type_09 lfortran-0.63.0/integration_tests/namelist_01.f900000664000175000017500000000015415174404631022021 0ustar alastairalastairprogram namelist1 implicit none integer :: N real :: t, x, Ecut namelist /domain/ N, t, x, Ecut end program lfortran-0.63.0/integration_tests/gpu_metal_27.f900000664000175000017500000000076615174404631022203 0ustar alastairalastairprogram gpu_metal_27 ! Test all() intrinsic inside do concurrent with GPU offloading implicit none real :: a(4, 3), b(4, 3) logical :: eq(3) integer :: l a = 1.0 b = 1.0 do concurrent(l = 1:3) eq(l) = all(a(:,l) == b(:,l)) end do if (.not. (eq(1) .and. eq(2) .and. eq(3))) error stop ! Test with unequal values b(2, 2) = 2.0 do concurrent(l = 1:3) eq(l) = all(a(:,l) == b(:,l)) end do if (.not. eq(1)) error stop if (eq(2)) error stop if (.not. eq(3)) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/intrinsics_159.f900000664000175000017500000000410215174404631022465 0ustar alastairalastairprogram intrinsics_159 use iso_fortran_env, only: dp=>real64, sp=>real32 complex(sp) :: x(2, 3) complex(sp) :: y(3, 2) complex(sp) :: res(2, 2) complex(dp) :: x_dp(2, 3) complex(dp) :: y_dp(3, 2) complex(dp) :: res_dp(2, 2) complex(sp) :: x_(5) complex(sp) :: y_(5, 1) complex(sp) :: res_(1) complex(sp) :: a(1, 5) complex(sp) :: b(5, 1) complex(sp) :: c(1, 1) complex(sp) :: e(4, 4) complex(sp) :: f(4, 4) real :: g(2, 3) real :: h(3, 2) integer :: l(2, 3) integer :: m(3, 2) integer :: i complex(sp) :: num num = (1.0, 2.0) x = reshape([num, num, num, num, num, num], [2, 3]) y = transpose(x) res = matmul( x, y) print *, abs(sum(res)) if (abs(abs(sum(res)) - 60.0) > 1e-8) error stop x_dp = reshape([ (i, i = 1, 6) ], [2, 3]) y_dp = transpose(x_dp) res_dp = matmul( x_dp, y_dp ) print *, abs(sum(res_dp)) if (abs(abs(sum(res_dp)) - 179.0_dp) > 1e-12_dp) error stop x_ = [(i, i = 1, 5)] y_ = reshape([ (i, i = 1, 5) ], [5, 1]) res_ = matmul( x_, y_) print *, abs(sum(res_)) if (abs(abs(sum(res_)) - 55.0) > 1e-8) error stop a = reshape([ (i, i = 1, 5) ], [1, 5]) b = reshape([ (i, i = 1, 5) ], [5, 1]) c = matmul( a, b ) print *, abs(sum(c)) if (abs(abs(sum(c)) - 55.0) > 1e-8) error stop e = reshape([ (i, i = 1, 16) ], [4, 4]) f = matmul( e, e ) print *, abs(sum(f)) if (abs(abs(sum(f)) - 4944.0) > 1e-8) error stop g = reshape([ (i, i = 1, 6) ], [2, 3]) print *, abs(sum(matmul( g, y ))) if (abs(abs(sum(matmul( g, y ))) - 93.9148560) > 1e-8) error stop h = reshape([ (i, i = 1, 6) ], [3, 2]) print *, abs(sum(matmul( x, h ))) if (abs(abs(sum(matmul( x, h ))) - 93.9148560) > 1e-8) error stop l = 901 y = (12, -12) print *, abs(sum(matmul( l, y ))) if (abs(abs(sum(matmul( l, y ))) - 183485.719) > 1e-8) error stop m = -158 x = (10, -15) print *, abs(sum(matmul( x, m ))) if (abs(abs(sum(matmul( x, m ))) - 34180.6250) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/separate_compilation_06a.f900000664000175000017500000000055715174404631024564 0ustar alastairalastairmodule separate_compilation_06a_module contains function get_midpoints(R, V) result(Vmid) real, intent(in) :: R(:), V(:) real :: Vmid(size(R)-1) integer :: i print *, sum(R), sum(V) Vmid = 0.5 * (V(1:size(R)-1) + V(2:size(R))) if ( abs(sum(R) - 4.96500000e+02 ) > 1e-8 ) error stop if ( abs(sum(V) - 5.01404822e-01 ) > 1e-8 ) error stop end function end module lfortran-0.63.0/integration_tests/pass_array_by_data_03.f900000664000175000017500000000136715174404631024045 0ustar alastairalastairprogram main implicit none integer :: x1(20) call find_fit(expression) call ub_proc(x1) contains real function expression(x) result(y) real, intent(in) :: x(3) y = x(1) + x(2) + x(3) end function expression subroutine ub_proc (x) integer, intent(in) :: x(0:) integer :: temp (0:ubound (x, 1)) if (lbound(x,1) /= 0 .or. ubound(x,1) /= 19 ) error stop if (lbound(temp,1) /= 0 .or. ubound(temp, 1) /= 19) error stop end subroutine subroutine find_fit(expr) real :: x(3) real :: y interface real function expr(x) result(y) real, intent(in) :: x(3) end function expr end interface x(1) = 1.0 x(2) = 2.0 x(3) = 3.0 y = expr(x) if (abs(y - 6.0) > 1e-7) error stop print *, y end subroutine find_fit end program main lfortran-0.63.0/integration_tests/modules_14.f900000664000175000017500000000033015174404631021655 0ustar alastairalastairprogram modules_14 use modules_14_a, only: a implicit none integer :: i real :: r i = 5 call a(i) if (i /= 6) error stop r = 6 call a(r) if (r /= 7) error stop i = 7 call a(i) if (i /= 8) error stop end program lfortran-0.63.0/integration_tests/separate_compilation_44.f900000664000175000017500000000024315174404631024415 0ustar alastairalastairprogram separate_compilation_44 use separate_compilation_44b_module implicit none call client() print *, "ok" end program separate_compilation_44 lfortran-0.63.0/integration_tests/div_to_mul.f900000664000175000017500000000053715174404631022053 0ustar alastairalastairprogram div_to_mul implicit none real :: x = 3.14, eps = 1e-6 real, parameter :: pi = 3.14 integer :: y = 2 if (abs(x/pi - 1.0) > eps) error stop if (abs(x/2.0 - 1.57) > eps) error stop if (abs(x/2.0_8 - 1.57) > eps) error stop if (abs(x/2 - 1.57) > eps) error stop if (abs(y/2 - 1) > eps) error stop end program lfortran-0.63.0/integration_tests/arrays_op_8.f900000664000175000017500000000134615174404631022137 0ustar alastairalastairprogram arrays_op_8 implicit none call array_expr_01() contains subroutine array_expr_01() integer :: dim1, dim2, dim3, dim1d, i integer :: shape1d(1), shape3d(3) real(8) :: eps real(8) :: e(10, 10, 5), f(10, 10, 5) real(8) :: g(500), e1d(500), f1d(500) eps = 1e-12 dim1 = 10 dim2 = 10 dim3 = 5 dim1d = dim1 * dim2 * dim3 do i = 1, dim1d e1d(i) = i + 1 f1d(i) = i + 1 end do shape3d(1) = dim1 shape3d(2) = dim2 shape3d(3) = dim3 shape1d(1) = dim1d e = reshape(e1d, shape3d) f = reshape(f1d, shape3d) g = reshape(e + f, shape1d) do i = 1, dim1d if ( abs(g(i) - 2*(i + 1)) > eps ) error stop end do end subroutine end program lfortran-0.63.0/integration_tests/select_rank_10.f900000664000175000017500000000151115174404631022475 0ustar alastairalastairprogram select_rank_10 implicit none integer :: a(3) = [1, 2, 3] real :: b(2,2) = reshape([1.0, 2.0, 3.0, 4.0], [2,2]) call check(a) call check(b) contains subroutine check(x) class(*), intent(in) :: x(..) select rank (x) rank (1) print *, "Rank-1 array" select type (x) type is (integer) print *, "Integer" print *, x type is (real) error stop end select rank (2) print *, "Rank-2 array" select type (x) type is (integer) error stop type is (real) print *, "Real" print *, x end select end select end subroutine check end program select_rank_10 lfortran-0.63.0/integration_tests/class_84.f900000664000175000017500000000433215174404631021327 0ustar alastairalastairmodule class_84_mod implicit none type :: string_t character(len=:), allocatable :: s end type type :: temp type(string_t), allocatable :: strs(:) end type type :: dependency_config_t type(temp), allocatable :: arr(:) end type dependency_config_t type, extends(dependency_config_t) :: dependency_node_t end type dependency_node_t end module class_84_mod program class_84 use class_84_mod implicit none type(dependency_node_t), allocatable :: a, b !------------------------- ! Allocate scalars !------------------------- allocate(a, b) !------------------------- ! Initialize 'a' !------------------------- allocate(a%arr(2)) allocate(a%arr(1)%strs(2)) allocate(character(len=5) :: a%arr(1)%strs(1)%s) allocate(character(len=3) :: a%arr(1)%strs(2)%s) a%arr(1)%strs(1)%s = "hello" a%arr(1)%strs(2)%s = "abc" allocate(a%arr(2)%strs(1)) allocate(character(len=4) :: a%arr(2)%strs(1)%s) a%arr(2)%strs(1)%s = "test" !------------------------- ! Assignment under test !------------------------- b = a !------------------------- ! Validation: allocation !------------------------- if (.not. allocated(b%arr)) error stop "b%arr not allocated" if (size(b%arr) /= 2) error stop "b%arr wrong size" if (.not. allocated(b%arr(1)%strs)) error stop "b%arr(1)%strs not allocated" if (size(b%arr(1)%strs) /= 2) error stop "b%arr(1)%strs wrong size" if (.not. allocated(b%arr(1)%strs(1)%s)) error stop "string not allocated" if (len(b%arr(1)%strs(1)%s) /= 5) error stop "string length mismatch" !------------------------- ! Validation: values !------------------------- if (b%arr(1)%strs(1)%s /= "hello") error stop "value copy failed" if (b%arr(1)%strs(2)%s /= "abc") error stop "value copy failed" if (b%arr(2)%strs(1)%s /= "test") error stop "value copy failed" !------------------------- ! Validation: deep copy !------------------------- a%arr(1)%strs(1)%s = "xxxxx" if (b%arr(1)%strs(1)%s == "xxxxx") error stop "shallow copy detected" print *, "OK: extended-type allocatable assignment is correct" end program class_84 lfortran-0.63.0/integration_tests/intrinsics_96.f900000664000175000017500000000073615174404631022416 0ustar alastairalastairprogram intrinsics_96 character c integer :: a1 = 35 integer :: a2(3) = [39, 63, 66] print*, char(65) if (char(65) /= 'A') error stop ! print*, char([34, 39, 67]) ! Doesn't work yet print*, char(a1) if (char(a1) /= '#') error stop print*, char(a2) if (char(a2(1)) /= "'") error stop if (char(a2(2)) /= '?') error stop if (char(a2(3)) /= 'B') error stop c = char(32) print*, c if (c /= ' ') error stop end programlfortran-0.63.0/integration_tests/intrinsics_198.f900000664000175000017500000000053615174404631022477 0ustar alastairalastairprogram intrinsics_198 real, dimension(2,3) :: x real :: res x = 12.9 res = var_2_rsp_rsp(x, 1) print *, res if (abs(res - 77.3999939) > 1e-8) error stop contains function var_2_rsp_rsp(x, dim) result(res) real, intent(in) :: x(:,:) integer, intent(in) :: dim real :: res res = sum(sum(x, dim)) end function var_2_rsp_rsp end program lfortran-0.63.0/integration_tests/optional_05.f900000664000175000017500000000167615174404631022050 0ustar alastairalastairmodule optional_05_mod logical :: opt_present, opt_alloc_present contains subroutine opt(i) integer, optional, intent(in) :: i print *, 'Present in opt: ', present(i) opt_present = present(i) end subroutine opt subroutine opt_alloc(i) integer, allocatable, optional, intent(in) :: i print *, 'Present in opt_alloc: ', present(i) opt_alloc_present = present(i) call opt(i) end subroutine opt_alloc end module program optional_05 use optional_05_mod integer, allocatable :: i opt_present = .false. opt_alloc_present = .false. #ifndef __GFORTRAN__ call opt_alloc() #endif if (opt_alloc_present .neqv. .false.) error stop if (opt_present .neqv. .false.) error stop call opt_alloc(i) if (opt_alloc_present .neqv. .true.) error stop if (opt_present .neqv. .false.) error stop allocate(i) call opt_alloc(i) if (opt_alloc_present .neqv. .true.) error stop if (opt_present .neqv. .true.) error stop end program lfortran-0.63.0/integration_tests/procedure_24.f900000664000175000017500000000144515174404631022206 0ustar alastairalastairmodule procedure_24_mod implicit none type :: type1_t contains procedure :: printme end type type1_t contains subroutine printme(this) class(type1_t), intent(in) :: this end subroutine printme end module procedure_24_mod module procedure_24_mod2 implicit none type :: type2_t integer :: key contains procedure :: printme end type type2_t contains subroutine printme(this, n) class(type2_t), intent(inout) :: this integer, intent(in) :: n this%key = n end subroutine printme end module procedure_24_mod2 program procedure_24 use procedure_24_mod use procedure_24_mod2 implicit none type(type1_t) :: obj1 type(type2_t) :: obj2 call obj1%printme() call obj2%printme(422) if (obj2%key /= 422) error stop end program procedure_24lfortran-0.63.0/integration_tests/implicit_interface_10.f900000664000175000017500000000041315174404631024035 0ustar alastairalastairmodule implicit_interface_10_module implicit none interface function fun(i) integer fun end function fun end interface end module implicit_interface_10_module program main use implicit_interface_10_module end program main lfortran-0.63.0/integration_tests/c_sizeof_06.f900000664000175000017500000000154415174404631022017 0ustar alastairalastairprogram c_sizeof_06 use iso_c_binding, only: c_int, c_double, c_sizeof implicit none type, bind(C) :: t1 integer(c_int) :: arr(2) end type type, bind(C) :: t2 integer(c_int) :: a integer(c_int) :: arr(3) integer(c_int) :: b end type type, bind(C) :: t3 real(c_double) :: d integer(c_int) :: arr(4) end type type(t1) :: x1 type(t2) :: x2 type(t3) :: x3 integer(c_int) :: yi real(c_double) :: yd ! t1: 2 * c_int = 8 print *, "c_sizeof(t1) =", c_sizeof(x1) if (c_sizeof(x1) /= 2 * c_sizeof(yi)) error stop 1 ! t2: 5 * c_int = 20 print *, "c_sizeof(t2) =", c_sizeof(x2) if (c_sizeof(x2) /= 5 * c_sizeof(yi)) error stop 2 ! t3: c_double + 4*c_int = 8 + 16 = 24 print *, "c_sizeof(t3) =", c_sizeof(x3) if (c_sizeof(x3) /= c_sizeof(yd) + 4 * c_sizeof(yi)) error stop 3 print *, "PASS" end program lfortran-0.63.0/integration_tests/character_15.f900000664000175000017500000000026015174404631022144 0ustar alastairalastairprogram character_15 implicit none character*(*) hello parameter (hello = 'Hello world!') print *, hello if (len(hello) /= 12) error stop end program character_15 lfortran-0.63.0/integration_tests/string_46.f900000664000175000017500000000111015174404631021515 0ustar alastairalastairprogram string_46 type :: string character(:), allocatable :: s end type type(string), allocatable :: x(:) allocate(x(2)) allocate(character(len("fix")) :: x(1)%s) x(1)%s = "fix" allocate(character(len("lfortran")) :: x(2)%s) x(2)%s = "lfortran" x = g(x) print *, x(1)%s, x(2)%s if( x(1)%s /= "fix" ) error stop if( x(2)%s /= "lfortran" ) error stop contains function g(intokens) result(tokens) type(string), intent(in) :: intokens(:) type(string), allocatable :: tokens(:) allocate(tokens(size(intokens))) tokens = intokens end function end program lfortran-0.63.0/integration_tests/c_ptr_08.f900000664000175000017500000000172115174404631021324 0ustar alastairalastairprogram c_ptr_08 use iso_c_binding implicit none character(kind=c_char, len=*), parameter :: hex_str = "00FF" // c_null_char integer(c_long) :: result result = c_strtol(hex_str) print *, "Result:", result if (result /= 255_c_long) error stop contains integer(c_long) function c_strtol(string) use iso_c_binding character(kind=c_char, len=*), intent(in), target :: string interface integer(c_long) function strtol(str, endptr, base) bind(C, name="strtol") use iso_c_binding type(c_ptr), intent(in), value :: str type(c_ptr), intent(inout) :: endptr integer(c_int), intent(in), value :: base end function strtol end interface type(c_ptr) :: str1, strend str1 = c_loc(string) strend = c_null_ptr c_strtol = strtol(str1, strend, 16_c_int) end function c_strtol end program c_ptr_08 lfortran-0.63.0/integration_tests/transfer_15.f900000664000175000017500000000336015174404631022040 0ustar alastairalastairmodule achar_transfer_mod implicit none public iascii, ascii interface ascii module procedure asciiarray, asciiscalar end interface ascii contains pure function iascii(string) character, intent(in) :: string*(*) integer :: iascii(len(string)) iascii = iachar(transfer(string, (/'A'/))) end function iascii pure function asciiarray(codes) integer, intent(in) :: codes(:) character :: asciiarray*(size(codes)) asciiarray = transfer(achar(codes), asciiarray) end function asciiarray pure function asciiscalar(codes) integer, intent(in) :: codes character :: asciiscalar*1 asciiscalar = asciiarray((/codes/)) end function asciiscalar end module achar_transfer_mod program transfer_15 use achar_transfer_mod, only: iascii, ascii implicit none integer :: empty(0), iarr_empty(0) integer :: codes(3), iarr(3), iarr1(1) character(3) :: result_str codes = (/97, 98, 99/) result_str = ascii(codes) if (result_str /= 'abc') error stop if (ascii(97) /= 'a') error stop if (ascii((/97/)) /= 'a') error stop if (ascii(iascii('a')) /= 'a') error stop if (ascii(iascii('abc')) /= 'abc') error stop if (ascii(iascii('')) /= '') error stop if (ascii((/97,98,99/)) /= 'abc') error stop if (ascii(empty) /= '') error stop iarr1 = iascii('a') if (iarr1(1) /= 97) error stop iarr = iascii('abc') if (iarr(1) /= 97) error stop if (iarr(2) /= 98) error stop if (iarr(3) /= 99) error stop if (size(iascii('')) /= 0) error stop iarr_empty = iascii(ascii(empty)) if (size(iarr_empty) /= 0) error stop iarr = iascii(ascii((/1,2,3/))) if (iarr(1) /= 1) error stop if (iarr(2) /= 2) error stop if (iarr(3) /= 3) error stop print *, "All tests passed." end program transfer_15 lfortran-0.63.0/integration_tests/intrinsics_263.f900000664000175000017500000000336215174404631022470 0ustar alastairalastairprogram intrinsics_263 implicit none integer(4), parameter :: i1 = maxval([1, 2, 3]) real(4), parameter :: i2 = maxval([1.0, 2.0, 3.0]) integer(8), parameter :: i3 = maxval([1, 2, 3], [.true., .true., .true.]) real(8), parameter :: i4 = maxval([1.5_8, 22.9_8, 3.0_8], mask = [.true., .false., .true.]) integer(4), parameter :: i5 = maxval([11, 2, 5], 1, mask = [.true., .false., .true.]) real(4), parameter :: i6 = maxval([1.0, 3.0, 55.9], mask = [.true., .false., .true.], dim = 1) integer(4) :: ar1(4) = [1, 2, 7, 9] real(4) :: ar2(4) = [1.0, 3.1, 7.2, 9.0] logical(4) :: mask(4) = [.true., .false., .true., .true.] integer(4) :: dim = 1 print *, i1 if (i1 /= 3) error stop print *, i2 if (abs(i2 - 3.00000000e+00) > 1e-6) error stop print *, i3 if (i3 /= 3) error stop print *, i4 if (abs(i4 - 3.00000000000000000e+00) > 1e-12) error stop print *, i5 if (i5 /= 11) error stop print *, i6 if (abs(i6 - 5.59000015e+01) > 1e-6) error stop print *, maxval(ar1) if (maxval(ar1) /= 9) error stop print *, maxval(ar2) if (abs(maxval(ar2) - 9.00000000e+00) >1e-6 ) error stop print *, maxval(ar1, mask) if (maxval(ar1, mask) /= 9) error stop print *, maxval(ar2, mask = mask) if (abs(maxval(ar2, mask = mask) - 9.00000000e+00) > 1e-6) error stop print *, maxval(ar1, dim) if (maxval(ar1, dim) /= 9) error stop print *, maxval(ar2, dim = dim) if (abs(maxval(ar2, dim = dim) - 9.00000000e+00) > 1e-6) error stop print *, maxval(ar1, mask = mask, dim = dim) if (maxval(ar1, mask = mask, dim = dim) /= 9) error stop print *, maxval(ar2, dim, mask) if (abs(maxval(ar2, dim, mask) - 9.00000000e+00) > 1e-6) error stop end programlfortran-0.63.0/integration_tests/allocatable_polymorphic_assign_01.f900000664000175000017500000000155215174404631026444 0ustar alastairalastairmodule allocatable_polymorphic_assign_01_mod type, abstract :: base_t contains procedure(assign_op), deferred :: assign generic :: assignment(=) => assign end type base_t abstract interface subroutine assign_op(self, other) import class(base_t), intent(out) :: self class(base_t), intent(in) :: other end subroutine assign_op end interface contains subroutine test_assign_from_function() class(base_t), allocatable :: a a = make_base() end subroutine test_assign_from_function function make_base() result(b) class(base_t), allocatable :: b end function make_base end module allocatable_polymorphic_assign_01_mod program allocatable_polymorphic_assign_01 implicit none print *, "PASS" end program allocatable_polymorphic_assign_01 lfortran-0.63.0/integration_tests/custom_unary_operator_02.f900000664000175000017500000000110515174404631024646 0ustar alastairalastairmodule custom_unary_operator_02_module implicit none type :: t integer :: x end type interface operator(.sumall.) module procedure sum_values end interface contains pure function sum_values(a) result(r) type(t), intent(in) :: a(:) type(t) :: r integer :: i r%x = 0 do i = 1, size(a) r%x = r%x + a(i)%x end do end function end module program custom_unary_operator_02 use custom_unary_operator_02_module implicit none type(t) :: r r = .sumall. [t(1), t(2), t(3)] print *, r%x if (r%x /= 6) error stop end program lfortran-0.63.0/integration_tests/class_16.f900000664000175000017500000000120615174404631021317 0ustar alastairalastairmodule stdlib_logger implicit none public :: logger_type type :: logger_type integer(4) :: max_width = 5 end type logger_type contains subroutine format_output_string( self) class(logger_type) :: self call format_first_line() if (self%max_width /= 15) error stop contains subroutine format_first_line() if (self%max_width /= 10) error stop self%max_width = 15 end subroutine format_first_line end subroutine end module program class_16 use stdlib_logger implicit none type(logger_type) :: logger logger%max_width = 10 call format_output_string(logger) end program lfortran-0.63.0/integration_tests/nested_09.f900000664000175000017500000000063715174404631021505 0ustar alastairalastairprogram nested_09 implicit none integer :: i real :: x, fvec(5) x = 1 call fcn(x, fvec) print *, fvec do i = 1, 5 if ((abs(fvec(i)) - 1.0) > 1e-6) error stop end do contains subroutine check_deriv() call fcn(x, fvec) end subroutine check_deriv subroutine fcn(x, fvec) real, intent(in) :: x real, intent(out) :: fvec(5) fvec = x end subroutine fcn end program lfortran-0.63.0/integration_tests/elemental_12.f900000664000175000017500000001113415174404631022155 0ustar alastairalastairprogram elemental_12 implicit none real, dimension(2, 3) :: array_param, expected_ans real :: scalar_param, epsilon = 1.0e-6 real, dimension(2, 3) :: result_2param real, dimension(2, 3) :: result_3param array_param = reshape([ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], shape(array_param)) scalar_param = 1.0 print *, "Testing 2-parameter elemental function:" result_2param = func2(array_param, array_param) expected_ans = reshape([2.0, 4.0, 6.0, 8.0, 10.0, 12.0], shape(array_param)) if ( size(result_2param) /= size(expected_ans) .or. .not. all(result_2param == expected_ans) ) then error stop "Array, Array does not match to expected array" end if result_2param = func2(array_param, scalar_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0], shape(array_param)) if ( size(result_2param) /= size(expected_ans) .or. .not. all(result_2param == expected_ans) ) then error stop "Array, Scalar does not match to expected array" end if result_2param = func2(scalar_param, array_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0], shape(array_param)) if ( size(result_2param) /= size(expected_ans) .or. .not. all(result_2param == expected_ans) ) then error stop "Scalar, Array does not match to expected array" end if result_2param = func2(scalar_param, scalar_param) expected_ans = reshape([2.0, 0.0, 0.0, 0.0, 0.0, 0.0], shape(array_param)) if (abs(result_2param(1, 1) - expected_ans(1, 1)) > epsilon) then error stop "Scalar, Scalar does not match 2.0" end if print *, "\nTesting 3-parameter elemental function:" result_3param = func3(array_param, array_param, array_param) expected_ans = reshape([2.0, 6.0, 12.0, 20.0, 30.0, 42.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Array, Array does not match to expected array" end if result_3param = func3(array_param, array_param, scalar_param) expected_ans = reshape([2.0, 5.0, 10.0, 17.0, 26.0, 37.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Array, Scalar does not match to expected array" end if result_3param = func3(array_param, scalar_param, array_param) expected_ans = reshape([2.0, 4.0, 6.0, 8.0, 10.0, 12.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Scalar, Array does not match to expected array" end if result_3param = func3(array_param, scalar_param, scalar_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Scalar, Scalar does not match to expected array" end if result_3param = func3(scalar_param, array_param, array_param) expected_ans = reshape([2.0, 4.0, 6.0, 8.0, 10.0, 12.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Scalar, Array, Array does not match to expected array" end if result_3param = func3(scalar_param, array_param, scalar_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Scalar, Array, Scalar does not match to expected array" end if result_3param = func3(scalar_param, scalar_param, array_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Scalar, Scalar, Array does not match to expected array" end if result_3param = func3(scalar_param, scalar_param, scalar_param) expected_ans = reshape([2.0, 0.0, 0.0, 0.0, 0.0, 0.0], shape(array_param)) if (abs(result_3param(1, 1) - expected_ans(1, 1)) > epsilon) then error stop "Scalar, Scalar, Scalar does not match 2.0" end if print *, "All tests passed successfully" contains elemental function func2(x, y) result(res) real, intent(in) :: x, y real :: res res = x + y end function func2 elemental function func3(x, y, z) result(res) real, intent(in) :: x, y, z real :: res res = x * y + z end function func3 end program elemental_12 lfortran-0.63.0/integration_tests/file_15.f900000664000175000017500000000060715174404631021134 0ustar alastairalastairprogram file_15 implicit none integer :: items(10), u = 10, i, n integer :: ios(2) open(u, file='file_03_data.txt', action='read') read(u, *, iostat=ios(1)) do i = 1, 10 read(u, *) n items(i) = n end do close(u) if (items(2) /= 102) error stop if (sum(items) /= 1055) error stop if (ios(1) /= 0) error stop end program file_15 lfortran-0.63.0/integration_tests/arrays_75.f900000664000175000017500000000101315174404631021514 0ustar alastairalastairprogram arrays_75 integer :: score(4) = [-1,1,3,2] print *, [score, 1] > 0 if (ALL(([score, 1] > 0) .NEQV. [.false., .true., .true., .true., .true.])) then error stop end if print *, 0 < [score, -1] if (ALL((0 < [score, -1]) .NEQV. [.false., .true., .true., .true., .false.])) then error stop end if print *, [score, 1] <= [score, -1] if (ALL(([score, 1] <= [score, -1]) .NEQV. [.true., .true., .true., .true., .false.])) then error stop end if end programlfortran-0.63.0/integration_tests/arrays_24.f900000664000175000017500000000062715174404631021520 0ustar alastairalastairprogram arrays_24 implicit none real :: x(1), y(1), z(1) x = [5.15] y = [-3.20] z = f(x, y) print *, z if (abs(z(1) - 1.95) > 1e-5) error stop contains function f(a, b) result(r) real, intent(in) :: a(:), b(:) real :: r(size(a)) integer :: i do i = 1, size(a) r(i) = a(i) + b(i) end do end function end programlfortran-0.63.0/integration_tests/gpu_metal_171.f900000664000175000017500000000147615174404631022262 0ustar alastairalastair! Test: merge() with allocatable array-section mask inside struct constructor ! in do concurrent, compiled with --gpu=metal. ! Exercises VLA workspace dimension resolution through ArraySize + Associate ! when the mask array is allocatable (runtime descriptor dimensions). program gpu_metal_171 implicit none type :: t real, allocatable :: v(:) end type type(t) :: arr(2) logical, allocatable :: m(:,:) integer :: i allocate(m(2, 2)) m = .true. do i = 1, 2 allocate(arr(i)%v(2)) arr(i)%v = 0.0 end do do concurrent(i=1:2) arr(i) = t(merge(1.0, 0.0, m(:,i))) end do if (abs(arr(1)%v(1) - 1.0) > 1e-5) error stop if (abs(arr(1)%v(2) - 1.0) > 1e-5) error stop if (abs(arr(2)%v(1) - 1.0) > 1e-5) error stop if (abs(arr(2)%v(2) - 1.0) > 1e-5) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/associate_02.f900000664000175000017500000000075115174404631022164 0ustar alastairalastairprogram associate_02 implicit none integer, pointer :: p1 real(8), pointer :: p2 integer, target :: t1 = 2 real(8), target :: t2 = 2.0_8 complex(4), pointer :: p3 complex(4), target :: t3 = (2.0_4, 3.0_4) p1 => t1 p2 => t2 p3 => t3 p1 = 1 p2 = 4.0_4 print *, p1 print *, t1 t1 = p2 + p1 print *, p1 print *, t1 t1 = 8 print *, p1 print *, t1 p3 = 2*p3 print *, p3 print *, t3 end program lfortran-0.63.0/integration_tests/functions_58.f900000664000175000017500000000201015174404631022222 0ustar alastairalastairprogram functions_58 implicit none character(len=:), allocatable :: temp character(len=1) :: sep integer :: i temp = "abc/def/ghi" sep = "/" i = find_char_char(reverse(temp), sep) if (i /= 4) error stop 1 if (reverse(temp) /= "ihg/fed/cba") error stop 2 contains function reverse(string) result(reverse_string) character(len=*), intent(in) :: string character(len=len(string)) :: reverse_string integer :: j, n n = len(string) do j = 1, n reverse_string(n-j+1:n-j+1) = string(j:j) end do end function reverse function find_char_char(str, sep) result(index) character(len=*), intent(in) :: str character(len=1), intent(in) :: sep integer :: index integer :: j index = 0 do j = 1, len(str) if (str(j:j) == sep) then index = j return end if end do end function find_char_char end program functions_58 lfortran-0.63.0/integration_tests/allocate_68.f900000664000175000017500000000141715174404631022011 0ustar alastairalastairprogram allocate_68 ! Test allocate with source= for scalar allocatables implicit none integer, allocatable :: src_i, obj_i real, allocatable :: src_r, obj_r logical, allocatable :: src_l, obj_l ! Integer scalar allocatable with source= allocate(src_i, source=99) if (src_i /= 99) error stop allocate(obj_i, source=src_i) if (obj_i /= 99) error stop deallocate(src_i) deallocate(obj_i) ! Real scalar allocatable with source= allocate(src_r, source=3.14) allocate(obj_r, source=src_r) if (abs(obj_r - 3.14) > 1.0e-5) error stop deallocate(src_r) deallocate(obj_r) ! Logical scalar allocatable with source= allocate(src_l, source=.true.) allocate(obj_l, source=src_l) if (obj_l .neqv. .true.) error stop deallocate(src_l) deallocate(obj_l) print *, "PASS" end program allocate_68 lfortran-0.63.0/integration_tests/allocate_37.f900000664000175000017500000000040415174404631022000 0ustar alastairalastairprogram alloc_source implicit none integer, allocatable :: a(:), b(:) allocate(a(4)) a = [1, 2, 3, 4] allocate(b, source=a) if (any(b /= a)) error stop "wrong output: b contents do not match a" print *, "test passed" end program alloc_source lfortran-0.63.0/integration_tests/implicit_typing_02.f900000664000175000017500000000046215174404631023414 0ustar alastairalastairmodule implicit_typing_02_mod implicit none public bisect contains integer function bisect() result(c) c = 10 end function end module program implicit_typing_02 use implicit_typing_02_mod, only: bisect print *, bisect() if (bisect() /= 10) error stop end program lfortran-0.63.0/integration_tests/derived_types_82.f900000664000175000017500000000120015174404631023055 0ustar alastairalastairmodule m_diagnostic implicit none type :: toml_diagnostic integer, allocatable :: label(:) end type toml_diagnostic type :: toml_parser type(toml_diagnostic), allocatable :: diagnostic(:) end type toml_parser end module m_diagnostic program test_diag use m_diagnostic implicit none type(toml_parser), allocatable :: pars, pars2 allocate(pars) allocate(pars2) allocate(pars%diagnostic(1)) pars%diagnostic(1) = toml_diagnostic([1,2,3]) pars2 = pars pars2%diagnostic(1)%label = [4,5,6] if (any(pars%diagnostic(1)%label /= [1,2,3])) error stop end program test_diaglfortran-0.63.0/integration_tests/expr_02.f900000664000175000017500000000050715174404631021166 0ustar alastairalastairprogram expr_02 implicit none integer :: x x = (2+3)*5 if (x /= 25) error stop x = (2+3)*4 if (x /= 20) error stop x = (2+3)*(2+3) if (x /= 25) error stop x = (2+3)*(2+3)*4*2*(1+2) if (x /= 600) error stop x = x / 60 if (x /= 10) error stop x = x + 1 if (x /= 11) error stop x = x - 1 if (x /= 10) error stop end program lfortran-0.63.0/integration_tests/intrinsics_95.f900000664000175000017500000000014015174404631022402 0ustar alastairalastairprogram intrinsics_95 implicit none if (sign(1.0, -2.0) /= -1.0) error stop end program lfortran-0.63.0/integration_tests/test_ieee_underflow_mode.f900000664000175000017500000000065515174404631024752 0ustar alastairalastairprogram test_ieee_underflow_mode use ieee_arithmetic, only: ieee_set_underflow_mode, ieee_get_underflow_mode implicit none logical :: gradual call ieee_get_underflow_mode(gradual) if (.not. gradual) error stop call ieee_set_underflow_mode(.true.) call ieee_get_underflow_mode(gradual) if (.not. gradual) error stop call ieee_set_underflow_mode(.false.) end program test_ieee_underflow_mode lfortran-0.63.0/integration_tests/arrays_09.f900000664000175000017500000000017215174404631021516 0ustar alastairalastairprogram arrays_09 implicit none character(10) :: a(1) a(1) = 'Substring' if(a(1)(4:9) /= 'string') error stop end program lfortran-0.63.0/integration_tests/select_rank_27.f900000664000175000017500000000111315174404631022503 0ustar alastairalastair! Test: character string length preserved when passed to ! class(*), optional, dimension(..) parameter program select_rank_27 implicit none character(len=:), allocatable :: s s = "hello" call show(s) contains subroutine show(a) class(*), optional, intent(in) :: a(..) select rank(v => a) rank(0) select type(aa => v) type is (character(len=*)) if (len(aa) /= 5) error stop if (aa /= "hello") error stop class default error stop end select rank default error stop end select end subroutine end program lfortran-0.63.0/integration_tests/cpp_pre_04.f900000664000175000017500000000051515174404631021641 0ustar alastairalastairprogram cpp_pre_03 #ifdef __ELF__ print *,"ELF" #endif #ifdef __x86_64__ print *,"x86_64" #endif #ifdef __i386__ print *,"i386" #endif #ifdef __SIZEOF_POINTER__ print *,"SIZEOF_POINTER", __SIZEOF_POINTER__ #endif #ifdef __SIZEOF_SIZE_T__ print *,"SIZEOF_SIZE_T",__SIZEOF_SIZE_T__ #endif print *, "Ok" end program lfortran-0.63.0/integration_tests/bindc3.f900000664000175000017500000000056015174404631021050 0ustar alastairalastairprogram bindc3 use iso_c_binding, only: c_loc, c_ptr, c_f_pointer, c_intptr_t type(c_ptr) :: queries integer :: idx = 1 integer(2), pointer :: x integer(2), target :: y call c_f_pointer(queries, x) print *, transfer(c_loc(x), 0_c_intptr_t), transfer(queries, 0_c_intptr_t) x => y print *, transfer(c_loc(x), 0_c_intptr_t), transfer(c_loc(y), 0_c_intptr_t) end program lfortran-0.63.0/integration_tests/formatted_read_03.f900000664000175000017500000000116315174404631023170 0ustar alastairalastairprogram formatted_read_03 implicit none complex :: c1, c2, c3 character(30) :: cdata cdata = '1.05.522.066.633.123455.0789' read (cdata, 100) c1, c2, c3 100 format (2(F3.1), 2(F4.1), 2(F7.4)) if (abs(real(c1) - 1.0) > 1e-5 .or. abs(aimag(c1) - 5.5) > 1e-5) then error stop 'c1 mismatch' end if if (abs(real(c2) - 22.0) > 1e-5 .or. abs(aimag(c2) - 66.6) > 1e-5) then error stop 'c2 mismatch' end if if (abs(real(c3) - 33.1234) > 1e-5 .or. abs(aimag(c3) - 55.0789) > 1e-5) then error stop 'c3 mismatch' end if end program formatted_read_03lfortran-0.63.0/integration_tests/procedure_40.f900000664000175000017500000000210615174404631022177 0ustar alastairalastair! Test procedure pointer in derived type with optional argument module procedure_40_mod implicit none abstract interface subroutine callback(x, y) integer, intent(in) :: x integer, optional, intent(in) :: y end subroutine callback end interface type :: t procedure(callback), nopass, pointer :: cb => null() end type t contains subroutine call_it(obj) type(t), intent(in) :: obj if (associated(obj%cb)) call obj%cb(1, 2) end subroutine call_it end module procedure_40_mod program procedure_40 use procedure_40_mod implicit none type(t) :: obj ! Call with null pointer (should not crash) call call_it(obj) ! Associate and call obj%cb => my_callback call call_it(obj) print *, "ok" contains subroutine my_callback(x, y) integer, intent(in) :: x integer, optional, intent(in) :: y if (x /= 1) error stop if (.not. present(y)) error stop if (y /= 2) error stop end subroutine my_callback end program procedure_40 lfortran-0.63.0/integration_tests/intrinsics_115.f900000664000175000017500000000220315174404631022455 0ustar alastairalastairprogram intrinsics_115 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real(4) x4 real(8) x8 real(4), parameter :: r1 = anint(4.23_4) real(8), parameter :: r2 = anint(4.23_8) real(4), parameter :: ar1(3) = anint([123.41_4, 4.23_4, -31.0_4]) real(8), parameter :: ar2(3) = anint([123.41_8, 4.23_8, -31.0_8]) real(4) :: arr1(3) = [123.41_4, 4.23_4, -31.0_4] real(8) :: arr2(3) = [123.41_8, 4.23_8, -31.0_8] print *, r1 if (r1 /= 4) error stop print *, r2 if (r2 /= 4) error stop print *, ar1 if (any(ar1 /= [123, 4, -31])) error stop print *, ar2 ! if (any(ar2 /= [123_8, 4_8, -31_8])) error stop print *, anint(arr1) if (any(anint(arr1) /= [123, 4, -31])) error stop print *, anint(arr2) if (any(anint(arr2) /= [123, 4, -31])) error stop x4 = 1.234E0_4 x8 = 4.821_8 print *, anint( a = x4, kind = 8 ) print *, anint( a = x8, kind = 4 ) if ( .not. anint( a = x4, kind = 8 ) == 1 ) error stop if ( .not. anint( x4, kind = 8 ) == 1 ) error stop if ( .not. anint( x4, 8 ) == 1 ) error stop end program intrinsics_115 lfortran-0.63.0/integration_tests/expr_03.f900000664000175000017500000000052215174404631021164 0ustar alastairalastairprogram expr_03 implicit none integer :: x x = -2 if (x /= -2) error stop x = -2*3 if (x /= -6) error stop x = -2*(-3) if (x /= 6) error stop x = 3 - 1 if (x /= 2) error stop x = 1 - 3 if (x /= -2) error stop if (x /= (-2)) error stop x = 1 - (-3) if (x /= 4) error stop if (x /= +4) error stop if (x /= (+4)) error stop end program lfortran-0.63.0/integration_tests/block_data_complex.f900000664000175000017500000000055515174404631023524 0ustar alastairalastairprogram bd_test implicit none complex :: axvc common /blk9/ axvc if (abs(real(axvc) - 234.23) > 0.01) error stop "Real part incorrect" if (abs(aimag(axvc) - 34.9) > 0.01) error stop "Imaginary part incorrect" print *, "AXVC from MAIN =", axvc print*,"Test Passed" end program block data complex :: axvc common /blk9/ axvc data axvc /(234.23, 34.9)/ end block data lfortran-0.63.0/integration_tests/intrinsics_181.f900000664000175000017500000000100015174404631022452 0ustar alastairalastairprogram intrinsics_181 implicit none character(3), parameter :: s1 = repeat("a", 3) character(10), parameter :: s2 = repeat("#$", 5_8) character(len=2) :: x1 character(len=4) :: x2 x1 = "wh" x2 = "what" print *, s1 if (s1 /= "aaa") error stop print *, s2 if (s2 /= "#$#$#$#$#$") error stop print *, repeat(x1, 3) if (repeat(x1, 3) /= "whwhwh") error stop print *, "|"//repeat(x2, 3)//"|" if (repeat(x2, 3) /= "whatwhatwhat") error stop end program lfortran-0.63.0/integration_tests/separate_compilation_25a.f900000664000175000017500000000114315174404631024555 0ustar alastairalastairmodule linalg_separate_compilation_25 implicit none interface diag module function diag_real(A) result(res) real, intent(in) :: A(:,:) real :: res(minval(shape(A))) end function diag_real end interface end module linalg_separate_compilation_25 module stats_corr_separate_compilation_25 use linalg_separate_compilation_25, only: diag implicit none interface corr procedure corr_real end interface corr contains module function corr_real(x) result(res) real, intent(in) :: x(:, :) real :: res(2) res = diag(x) end function corr_real end modulelfortran-0.63.0/integration_tests/allocate_55.f900000664000175000017500000000057715174404631022013 0ustar alastairalastairprogram allocate_55 implicit none type :: item_t class(*), allocatable :: value end type type(item_t), target :: original type(item_t), pointer :: copy integer :: val allocate(original%value, source=42) allocate(copy, source=original) select type (v => copy%value) type is (integer) val = v end select if (val /= 42) error stop deallocate(copy) print *, "ok" end program lfortran-0.63.0/integration_tests/intrinsics_160.f900000664000175000017500000000320515174404631022460 0ustar alastairalastairprogram intrinsics_160 integer :: a1 = 5, a2 = 8 integer(8) :: a3 = -1, a4 = -4 integer :: a5 = -2, a6 = -5 integer, parameter :: i1 = ior(5, 8) integer, parameter :: i2 = ior(-1, 5) integer, parameter :: i3 = ior(-4_8, 2_8) integer(8), parameter :: i4 = ior(-2_8, 5_8) integer, parameter :: ar1(3) = ior([5, 8, 9], [8, 5, 2]) integer(8), parameter :: ar2(3) = ior([-1_8, -5_8, -10_8], [5_8, 8_8, 9_8]) integer :: arr1(3), arr3(3) integer(8) :: arr2(3) integer :: res(3) arr1 = [5, 8, 9] arr3 = [8, 5, 2] arr2 = [-1_8, -5_8, -10_8] print *, i1 if (i1 /= 13) error stop print *, i2 if (i2 /= -1) error stop print *, i3 if (i3 /= -2) error stop print *, i4 if (i4 /= -1) error stop print*, ior(5, 8) if (ior(5, 8) /= 13) error stop print*, ior(-1, 5) if (ior(-1, 5) /= -1) error stop print*, ior(8, -4) if (ior(8, -4) /= -4) error stop print*, ior(-2, -5) if (ior(-2, -5) /= -1) error stop print*, ior(a1, a2) if (ior(a1, a2) /= 13) error stop print*, ior(a3, a4) if (ior(a3, a4) /= -1) error stop print*, ior(a2, a5) if (ior(a2, a5) /= -2) error stop print*, ior(a5, a6) if (ior(a5, a6) /= -1) error stop print *, ar1 if (any(ar1 /= [13, 13, 11])) error stop print *, ar2 if (any(ar2 /= [-1, -5, -1])) error stop print *, ior(arr1, arr3) if (any(ior(arr1, arr3) /= [13, 13, 11])) error stop print *, ior(arr2, arr2) if (any(ior(arr2, arr2) /= [-1, -5, -10])) error stop res = ior(arr1, arr3) print *, res if (any(res /= [13, 13, 11])) error stop end program lfortran-0.63.0/integration_tests/character_10.f900000664000175000017500000000650015174404631022142 0ustar alastairalastair module module_10_mod use iso_c_binding implicit none interface function f_string00_c_caller() result(r) bind(c) import :: c_int integer(c_int) :: r end function function f_string01_c_caller() result(r) bind(c) import :: c_int integer(c_int) :: r end function function f_string02_c_caller() result(r) bind(c) import :: c_int integer(c_int) :: r end function function f_string03_c_caller() result(r) bind(c) import :: c_int integer(c_int) :: r end function function f_string04_c_caller() result(r) bind(c) import :: c_int integer(c_int) :: r end function function f_string05_c_caller() result(r) bind(c) import :: c_int integer(c_int) :: r end function end interface contains function f_string00_fortran(s) result(r) bind(c) character(kind=c_char) :: s character(kind=c_char) :: r print "('Fortran Side : `f_string00_fortran` called with s =', '[', a, ']' )", s if(s /= 'H') error stop r = s s(1:1) = 'X' end function function f_string01_fortran(s) result(r) bind(c) character(len=1, kind=c_char), value :: s character(len=1, kind=c_char) :: r print "('Fortran Side : `f_string01_fortran` called with s =', '[', a, ']' )", s if(s /= 'H') error stop r = s s = 'X' end function function f_string02_fortran(s, n) result(r) bind(c) integer(c_int), value :: n character(len=1, kind=c_char) :: s(n) character(len=1, kind=c_char) :: r character(len=:, kind=c_char), allocatable :: local_str print "('Fortran Side : `f_string02_fortran` called with s =', '[', a, ']' )", s(1) if(s(1) /= "A") error stop local_str = s(1) // "?????????????" if(local_str /= "A?????????????") error stop if(len(local_str) /= 14) error stop r = local_str s(1) = '2' end function function f_string03_fortran(s) result(r) bind(c) character(len=1, kind=c_char) :: s(*) character(len=1, kind=c_char) :: r print "('Fortran Side : `f_string03_fortran` called with s =', '[', a, ']' )", s(1) if(s(1) /= 'B') error stop r = s(1) s(1) = '3' end function function f_string04_fortran(s) result(r) bind(c) character(len=1, kind=c_char) :: s(*) character(len=1, kind=c_char) :: r print "('Fortran Side : `f_string04_fortran` called with s =', '[', a, ']' )", s(1) if(s(1) /= 'C') error stop r = s(1) s(1) = '4' end function function f_string05_fortran(s) result(r) bind(c) character(len=1, kind=c_char) :: s(:) character(len=1, kind=c_char) :: r print "('Fortran Side : `f_string05_fortran` called with s =', '[', a, ']' )", s(1) if(s(1) /= 'D') error stop r = s(1) s(1) = '5' end function end module program module_10 use module_10_mod integer :: dummy dummy = f_string00_c_caller() dummy = f_string01_c_caller() dummy = f_string02_c_caller() dummy = f_string03_c_caller() dummy = f_string04_c_caller() dummy = f_string05_c_caller() end programlfortran-0.63.0/integration_tests/separate_compilation_16a.f900000664000175000017500000000037715174404631024565 0ustar alastairalastairmodule mod_separate_compilation_16 implicit none interface module subroutine map_open_entry(key) integer, intent(inout) :: key end subroutine map_open_entry end interface end module mod_separate_compilation_16lfortran-0.63.0/integration_tests/bindc_08.c0000664000175000017500000000013115174404631021112 0ustar alastairalastair#include int c_is_dir(char* path) { printf("%c", path[0]); return 0; }lfortran-0.63.0/integration_tests/openmp_39.f900000664000175000017500000000074215174404631021521 0ustar alastairalastairprogram openmp_39 use omp_lib ! declare variables as required integer :: ny, nx, nz,nk integer :: iy, ix, iz,ik ny=3 nx=4 nz=5 nk=6 !$omp parallel do collapse(2) private(iy, ix, iz) do ix = 1, nx do iy = 1, ny print *,"iy->", iy,"ix->", ix do iz = 1, nz do ik = 1, nk print *,"iy->", iy,"ix->", ix,"iz->", iz,"ik->", ik end do end do end do end do !$omp end parallel do end program lfortran-0.63.0/integration_tests/read_15.f900000664000175000017500000000101015174404631021115 0ustar alastairalastairprogram read_15 implicit none integer :: u, x character(len=*), parameter :: fname = "read_15_tmp.txt" open(newunit=u, file=fname, status="replace", action="write") write(u, *) 1 close(u) open(newunit=u, file=fname, status="old", action="read") read(u, *, end=10) x if (x /= 1) then print *, "FAIL" error stop end if read(u, *, end=10) x print *, "FAIL" error stop 10 continue print *, "PASS" close(u, status="delete") end program read_15 lfortran-0.63.0/integration_tests/separate_compilation_41.f900000664000175000017500000000021115174404631024405 0ustar alastairalastairprogram separate_compilation_41 use separate_compilation_41c implicit none print *, "PASS" end program separate_compilation_41 lfortran-0.63.0/integration_tests/class_107.f900000664000175000017500000000252515174404631021405 0ustar alastairalastairmodule class_107_mod implicit none type, abstract :: abs_type contains procedure(alloc_iface), deferred :: alloc end type abs_type abstract interface subroutine alloc_iface(self, b, n) import :: abs_type class(abs_type), intent(in) :: self real(8), allocatable, intent(out) :: b(:,:) integer, intent(in) :: n end subroutine alloc_iface end interface type, extends(abs_type) :: my_type contains procedure :: alloc => my_alloc end type my_type contains subroutine my_alloc(self, b, n) class(my_type), intent(in) :: self real(8), allocatable, intent(out) :: b(:,:) integer, intent(in) :: n allocate(b(2, n)) end subroutine my_alloc end module class_107_mod program class_107 use class_107_mod implicit none class(abs_type), allocatable :: objarr(:) allocate(my_type :: objarr(2)) objarr = my_type() call check_allocator(objarr(1)) contains subroutine check_allocator(obj) class(abs_type), intent(in) :: obj real(8), allocatable :: b(:,:) call obj%alloc(b, 4) if (.not. allocated(b)) error stop if (any(shape(b) /= [2, 4])) error stop print *, "shape(b): ", shape(b) end subroutine check_allocator end program class_107 lfortran-0.63.0/integration_tests/intrinsics_436.f900000664000175000017500000000104315174404631022464 0ustar alastairalastairprogram intrinsics_436 implicit none integer, parameter :: seed = 86456 real :: x, y call srand(seed) x = rand() if (x < 0.0 .or. x > 1.0) error stop y = rand() if (y < 0.0 .or. y > 1.0) error stop if (abs(x - y) < 1e-10) error stop call srand(seed) if (abs(rand() - x) > 1e-6) error stop if (abs(rand() - y) > 1e-6) error stop x = rand(seed) y = rand() call srand(seed) if (abs(rand() - x) > 1e-6) error stop if (abs(rand() - y) > 1e-6) error stop end program intrinsics_436 lfortran-0.63.0/integration_tests/bindc_43.f900000664000175000017500000000530515174404631021275 0ustar alastairalastair! Test: BIND(C) derived type returned by value and passed by VALUE ! ! Features tested: ! - C function returning a BIND(C) derived type by value ! - C function returning a nested BIND(C) derived type by value ! - Passing BIND(C) derived type by VALUE to C function ! - Struct return value used directly as function argument program bindc_43 use iso_c_binding implicit none type, bind(C) :: point_t real(c_float) :: x, y end type type, bind(C) :: rect_t type(point_t) :: origin real(c_float) :: width, height end type interface type(point_t) function c43_make_point(x, y) bind(C) import :: c_float, point_t real(c_float), value :: x, y end function type(rect_t) function c43_make_rect(ox, oy, w, h) bind(C) import :: c_float, rect_t real(c_float), value :: ox, oy, w, h end function real(c_float) function c43_point_dist_sq(a, b) bind(C) import :: c_float, point_t type(point_t), value :: a, b end function real(c_float) function c43_rect_area(r) bind(C) import :: c_float, rect_t type(rect_t), value :: r end function type(point_t) function c43_add_points(a, b) bind(C) import :: point_t type(point_t), value :: a, b end function end interface type(point_t) :: p1, p2, p3 type(rect_t) :: r real(c_float) :: d, area ! Test 1: Simple struct return by value p1 = c43_make_point(3.0_c_float, 4.0_c_float) if (abs(p1%x - 3.0) > 1e-5) error stop "FAIL: make_point x" if (abs(p1%y - 4.0) > 1e-5) error stop "FAIL: make_point y" ! Test 2: Nested struct return by value r = c43_make_rect(1.0_c_float, 2.0_c_float, 10.0_c_float, 5.0_c_float) if (abs(r%origin%x - 1.0) > 1e-5) error stop "FAIL: rect origin x" if (abs(r%origin%y - 2.0) > 1e-5) error stop "FAIL: rect origin y" if (abs(r%width - 10.0) > 1e-5) error stop "FAIL: rect width" if (abs(r%height - 5.0) > 1e-5) error stop "FAIL: rect height" ! Test 3: Struct passed by VALUE (squared distance) p2 = c43_make_point(0.0_c_float, 0.0_c_float) d = c43_point_dist_sq(p1, p2) if (abs(d - 25.0) > 1e-5) error stop "FAIL: dist_sq" ! Test 4: Nested struct passed by VALUE (area) area = c43_rect_area(r) if (abs(area - 50.0) > 1e-5) error stop "FAIL: rect_area" ! Test 5: Return value used as function argument p3 = c43_add_points(p1, c43_make_point(7.0_c_float, 6.0_c_float)) if (abs(p3%x - 10.0) > 1e-5) error stop "FAIL: add x" if (abs(p3%y - 10.0) > 1e-5) error stop "FAIL: add y" print *, "All bindc_43 tests passed." end program lfortran-0.63.0/integration_tests/select_type_38.f900000664000175000017500000000075115174404631022542 0ustar alastairalastairprogram select_type_38 ! Test: pointer assignment to class(*) allocatable holding a derived type, ! then accessing members via select type on the pointer. implicit none type :: box class(*), allocatable :: value end type type :: foo integer :: n end type type(box), target :: b class(*), pointer :: p allocate(b%value, source=foo(42)) p => b%value select type(p) type is (foo) if (p%n /= 42) error stop class default error stop end select print *, "PASS" end program lfortran-0.63.0/integration_tests/modules_03.f900000664000175000017500000000476315174404631021671 0ustar alastairalastairmodule types implicit none private public dp integer, parameter :: dp = kind(0.d0) end module module constants ! Some constants use types, only: dp implicit none private public pi, e_, i_, bohr2ang, ang2bohr, Ha2eV, kB, K2au, density2gcm3, u2au, & s2au, kJmol2Ha ! Constants contain more digits than double precision, so that ! they are rounded correctly. Single letter constants contain underscore so ! that they do not clash with user variables ("e" and "i" are frequently used as ! loop variables) real(dp), parameter :: pi = 3.1415926535897932384626433832795_dp real(dp), parameter :: e_ = 2.7182818284590452353602874713527_dp complex(dp), parameter :: i_ = (0, 1) real(dp), parameter :: Na = 6.02214129e23_dp ! Avogadro constant ! Standard uncertainty 0.00000027 (Source: 2010 CODATA) real(dp), parameter :: Ha2eV = 27.21138505_dp ! 1 Ha = (1 * Ha2eV) eV ! Standard uncertainty is 0.00000060 eV (Source: 2010 CODATA) real(dp), parameter :: J2Ha = 2.29371248e17_dp ! 1 J = (1 * J2Ha) Ha ! Standard uncertainty is 0.00000010 eV (Source: 2010 CODATA) ! Reduced Planck constant real(dp), parameter :: hbar = 1.054571726e-34_dp ! [J s] ! Standard uncertainty is 0.000000047 eV (Source: 2010 CODATA) ! Covert Ha to cm^{-1} (energy equivalent) ! 1 Ha = (1 * Ha2invcm) cm^{-1} real(dp), parameter :: Ha2invcm = 219474.6313708_dp ! Standard uncertainty is 0.0000011 cm^{-1} (Source: 2010 CODATA) real(dp), parameter :: kB = 1.3806488e-23_dp ! Boltzmann constant [J/K] ! Standard uncertainty is 0.0000013 J/K (Source: 2010 CODATA) real(dp), parameter :: me = 9.10938291e-31_dp ! electron rest mass [kg] ! Standard uncertainty is 0.00000040 eV (Source: 2010 CODATA) ! Converts K to a.u.: real(dp), parameter :: K2au = J2Ha*kB ! 1 K = (1 * K2au) a.u. ! Conversion between Bohr (Hartree atomic units) and Angstrom real(dp), parameter :: bohr2ang = 0.529177249_dp real(dp), parameter :: ang2bohr = 1 / bohr2ang ! Converts eV to kcal/mol, it is assumed, that the number in eV is given per ! molecule. 1 eV = (1 * eV2kcalmol) kcal/mol real(dp), parameter :: kcalmol2kJmol = 4.184_dp real(dp), parameter :: kJmol2Ha = 1000 * J2Ha / Na ! Converts density from a.u. to g/cm^3 real(dp), parameter :: density2gcm3 = me*1e3_dp / (bohr2ang*1e-8_dp)**3 ! Converts u (atomic mass unit) to a.u. real(dp), parameter :: u2au = 1 / (Na * me * 1e3_dp) ! Converts s to a.u. real(dp), parameter :: s2au = 1 / (J2Ha*hbar) end module program modules_03 use constants, only: Ha2eV print *, Ha2eV end program lfortran-0.63.0/integration_tests/gpu_metal_37.f900000664000175000017500000000156115174404631022176 0ustar alastairalastairprogram gpu_metal_37 ! Test: VLA with intrinsic array function (maxval) in block inside do concurrent. ! The dimension expression contains a FunctionCall that must be pre-computed ! on the host side before kernel launch. implicit none integer :: x(6), i integer :: dims(2) dims(1) = 2 dims(2) = 3 x = 0 call compute(x, dims) if (x(1) /= 10) error stop if (x(2) /= 20) error stop if (x(3) /= 30) error stop if (x(4) /= 40) error stop if (x(5) /= 50) error stop if (x(6) /= 60) error stop print *, "ok" contains subroutine compute(x, vals) integer, intent(inout) :: x(:) integer, intent(in) :: vals(:) integer :: i do concurrent (i = 1:6) block real :: a(maxval(vals)) a(1) = real(i * 10) x(i) = int(a(1)) end block end do end subroutine end program gpu_metal_37 lfortran-0.63.0/integration_tests/infer_walrus_array_01.f900000664000175000017500000000034015174404631024100 0ustar alastairalastairprogram infer_walrus_array_01 implicit none x := [1, 2, 3] if (size(x) /= 3) error stop if (x(1) /= 1) error stop if (x(2) /= 2) error stop if (x(3) /= 3) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/doloop_14.f900000664000175000017500000000020515174404631021502 0ustar alastairalastairprogram doloop_14 integer :: i do i = 1, 2, 16 end do print *, i if ( i /= 17 ) error stop end program doloop_14 lfortran-0.63.0/integration_tests/separate_compilation_32b.f900000664000175000017500000000073215174404631024557 0ustar alastairalastairsubmodule(mod_separate_compilation_32) submod_separate_compilation_32 contains module procedure assemble_divergence associate(dummy => n) block y = e(dummy) end block end associate contains function e(i) result(v) integer, intent(in) :: i real(8) :: v v = i end function e end procedure assemble_divergence end submodule submod_separate_compilation_32 lfortran-0.63.0/integration_tests/namelist_23.f900000664000175000017500000000172415174404631022031 0ustar alastairalastairprogram test_namelist_internal_proc implicit none integer :: act_i real :: act_r character(len=10) :: act_c logical :: act_l integer :: lun namelist /act_cli/ act_i namelist /act_cli/ act_r, act_c namelist /act_cli/ act_l act_i = 42 act_r = 3.5 act_c = 'hello' act_l = .true. call write_namelist() act_i = 0 act_r = 0.0 act_c = '' act_l = .false. open(unit=10, file='namelist_23.dat', status='old', form='formatted') read(10, nml=act_cli) close(10) if (act_i /= 42) error stop if (abs(act_r - 3.5) > 1.0e-5) error stop if (act_c /= 'hello') error stop if (.not. act_l) error stop contains subroutine write_namelist() open(file='namelist_23.dat', newunit=lun, status='replace', form='formatted') write(lun, nml=act_cli) close(unit=lun) end subroutine write_namelist end program test_namelist_internal_proc lfortran-0.63.0/integration_tests/arrays_81.f900000664000175000017500000000172115174404631021517 0ustar alastairalastairmodule arrays81sub1 implicit none contains subroutine sub(simi, d) real, intent(inout) :: simi(:, :) real, intent(in) :: d(:) real :: simi_jdrop(size(simi, 2)) simi = outprod(matprod21(simi, d), simi_jdrop) contains function outprod(x, y) result(z) implicit none real, intent(in) :: x(:) real, intent(in) :: y(:) real :: z(size(x), size(y)) real :: sum_x_y sum_x_y = sum(x) + sum(y) z = sum_x_y end function outprod function matprod21(x, y) result(z_) implicit none real, intent(in) :: x(:, :) real, intent(in) :: y(:) real, allocatable :: z_(:) allocate(z_(size(x, 1))) z_ = matmul(x, y) end function matprod21 end subroutine end module program arrays_81 use arrays81sub1 real :: simi1(10, 5) real :: d(5) simi1 = 5.0 d = 2.0 call sub(simi1, d) print *, simi1 if( any(abs(simi1 - 500.0) > 1e-8 ) ) error stop end program lfortran-0.63.0/integration_tests/custom_operator_17.f900000664000175000017500000000203515174404631023441 0ustar alastairalastairmodule custom_operator_17_mod implicit none type :: string_t character(len=:), allocatable :: s contains procedure, pass(rhs) :: assign_string_t_to_char generic :: assignment(=) => assign_string_t_to_char end type type :: result_t type(string_t) :: description end type contains pure subroutine assign_string_t_to_char(lhs, rhs) character(len=:), allocatable, intent(out) :: lhs class(string_t), intent(in) :: rhs lhs = rhs%s end subroutine end module program custom_operator_17 use custom_operator_17_mod implicit none type(result_t), allocatable :: a(:), b(:) character(len=:), allocatable :: c allocate(a(1)) a(1)%description%s = "hello" ! Test 1: struct-to-struct array copy should use intrinsic assignment ! for the string_t component, not the string_t-to-char overload b = a if (b(1)%description%s /= "hello") error stop ! Test 2: the defined assignment string_t -> character still works c = a(1)%description if (c /= "hello") error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/associate_40.f900000664000175000017500000000126315174404631022165 0ustar alastairalastair! Test: associated(p1, p2) for class(*) (unlimited polymorphic) pointers program associate_40 implicit none integer, target :: x = 42 integer, target :: y = 99 class(*), pointer :: p1, p2 ! Both point to same target p1 => x p2 => x if (.not. associated(p1, p2)) error stop if (.not. associated(p1)) error stop if (.not. associated(p2)) error stop ! Point to different targets p2 => y if (associated(p1, p2)) error stop ! One-argument form nullify(p2) if (associated(p2)) error stop if (.not. associated(p1)) error stop ! Both null nullify(p1) if (associated(p1)) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/arrays_reshape_22.f900000664000175000017500000000172315174404631023223 0ustar alastairalastairprogram arrays_reshape_22 implicit none call f1() contains subroutine f1() real, allocatable :: amat(:, :) call f2(amat) ! call multiple times to make sure there is no memory corruption print *, ubound(amat, 1), ubound(amat, 2) print *, ubound(amat, 1), ubound(amat, 2) print *, ubound(amat, 1), ubound(amat, 2) print *, ubound(amat, 1), ubound(amat, 2) if(ubound(amat, 1) /= 2 .or. ubound(amat, 2) /= 2 ) error stop if(ubound(amat, 1) /= 2 .or. ubound(amat, 2) /= 2 ) error stop if(ubound(amat, 1) /= 2 .or. ubound(amat, 2) /= 2 ) error stop if(ubound(amat, 1) /= 2 .or. ubound(amat, 2) /= 2 ) error stop end subroutine subroutine f2(amat) real, intent(out), allocatable :: amat(:, :) allocate(amat(2,2)) amat = 1.0 print *, amat amat = reshape(source=amat, shape=[2, 2]) end subroutine end program lfortran-0.63.0/integration_tests/parameter_11.f900000664000175000017500000000073615174404631022174 0ustar alastairalastairprogram parameter_11 integer, parameter :: n = 3 real:: v(n), a(n,n), b(n,n) integer :: i,j v = [(i,i=1,n)] a = diag_rsp(v) b = reshape([((merge(i,0,i==j), i=1,n), j=1,n)], [n,n]) print *, b print *, "all(a==b)", all(a==b) if (.not. all(a==b)) error stop contains function diag_rsp(v) result(res) real, intent(in) :: v(:) real :: res(size(v),size(v)) integer :: i res = 0 do i = 1, size(v) res(i,i) = v(i) end do end function diag_rsp end program lfortran-0.63.0/integration_tests/transfer_18.f900000664000175000017500000000030615174404631022040 0ustar alastairalastairprogram transfer_18 implicit none character(1) :: value = "a" integer, allocatable :: val(:) val = transfer(value, val, 1) if (size(val) /= 1) error stop end program transfer_18lfortran-0.63.0/integration_tests/modules_71.f900000664000175000017500000000145315174404631021667 0ustar alastairalastair! Test re-export of use-associated symbols with private default. ! Symbols imported via `use` and explicitly made `public` must be ! visible when the re-exporting module is itself `use`d. module modules_71_kinds use iso_fortran_env, only: int8, int32 implicit none private public :: int8, int32 end module modules_71_kinds module modules_71_util use modules_71_kinds implicit none contains subroutine set_first(a, val) integer(int8), intent(inout) :: a(:) integer(int32), intent(in) :: val a(1) = int(val, int8) end subroutine end module modules_71_util program modules_71 use modules_71_util implicit none integer(1) :: x(3) x = [1, 2, 3] call set_first(x, 42) if (x(1) /= 42) error stop if (x(2) /= 2) error stop if (x(3) /= 3) error stop end program modules_71 lfortran-0.63.0/integration_tests/select_type_44.f900000664000175000017500000000153615174404631022541 0ustar alastairalastairprogram select_type_44 use iso_fortran_env, only: int8, int16 implicit none integer(int8) :: a = 2 integer(int16) :: b = 3 call set_single(a, b) if (b /= 2) error stop contains subroutine set_single(generic0, generic1) class(*), intent(in) :: generic0 class(*), intent(out) :: generic1 call set_generic(generic0, generic1) end subroutine set_single subroutine set_generic(generic0, gen) class(*), intent(in) :: generic0 class(*), intent(out) :: gen select type(g0 => generic0) type is (integer(int8)) select type(g => gen) type is (integer(int8)) g = g0 type is (integer(int16)) g = g0 end select end select end subroutine set_generic end program select_type_44 lfortran-0.63.0/integration_tests/select_type_42.f900000664000175000017500000000167615174404631022544 0ustar alastairalastair! Test: unformatted stream write of array inside select type on class(*) program select_type_42 use iso_fortran_env, only: int32 implicit none integer(int32) :: a(3) a = [10, 20, 30] call check_array(a) contains subroutine check_array(x) class(*), intent(in) :: x(:) integer :: unit integer(int32) :: buf(3) select type (x) type is (integer(int32)) open(newunit=unit, file='select_type_42.bin', status='replace', & action='write', access='stream') write(unit) x close(unit) end select open(newunit=unit, file='select_type_42.bin', status='old', & action='read', access='stream') read(unit) buf close(unit, status='delete') if (buf(1) /= 10) error stop if (buf(2) /= 20) error stop if (buf(3) /= 30) error stop print *, "PASS" end subroutine end program lfortran-0.63.0/integration_tests/file_06_data.dat0000664000175000017500000000003015174404631022265 0ustar alastairalastair ׃@ffFÀ @áz´?Ãõ@ázü@lfortran-0.63.0/integration_tests/gpu_metal_36.f900000664000175000017500000000103115174404631022165 0ustar alastairalastairprogram gpu_metal_36 ! Test: VLA (variable-length array) in block inside do concurrent ! The VLA dimension depends on an outer-scope variable, exercising the ! gpu_offload pass's handling of block-local variable type remapping. implicit none integer :: n, i, x(4) n = 4 x = 0 do concurrent (i = 1:4) block real :: a(n) a(1) = real(i * 3) x(i) = int(a(1)) end block end do if (x(1) /= 3) error stop if (x(2) /= 6) error stop if (x(3) /= 9) error stop if (x(4) /= 12) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/read_31.f900000664000175000017500000000103115174404631021116 0ustar alastairalastairprogram read_array implicit none integer :: u integer :: idata(4) integer :: x, y, arr(2) open(newunit=u, file="read_31_data.txt", status="old") ! Test 1: Read integer array with format read(u, '(i3,i2,i2,i3)') idata if (.not. all(idata == [100, 1, 7, 1])) error stop "Test 1 failed" ! Test 2: Read mix of scalars and array read(u, '(i3,i2,i2,i3)') x, arr, y if (x /= 50 .or. arr(1) /= 2 .or. arr(2) /= 3 .or. y /= 99) error stop "Test 2 failed" close(u) print *, "PASS" end program read_array lfortran-0.63.0/integration_tests/modules_28_module1.f900000664000175000017500000000073715174404631023323 0ustar alastairalastairmodule fpm_git implicit none type :: git_target_t character(len=:), allocatable :: url character(len=:), allocatable :: object end type git_target_t contains function git_target_branch(url, branch) result(self) character(len=*), intent(in) :: url character(len=*), intent(in) :: branch type(git_target_t) :: self self%url = url self%object = branch end function git_target_branch end module fpm_git lfortran-0.63.0/integration_tests/gpu_metal_186.f900000664000175000017500000000056615174404631022267 0ustar alastairalastairprogram gpu_metal_186 ! Test sum() intrinsic on assumed-shape array inside do concurrent implicit none real :: a(3), r integer :: i a = [1.0, 2.0, 3.0] r = 0.0 do concurrent(i=1:1) r = f(a) end do print *, r if (abs(r - 6.0) > 1.0e-6) error stop contains pure function f(x) result(s) real, intent(in) :: x(:) real :: s s = sum(x) end function end program lfortran-0.63.0/integration_tests/implicit_interface_17b.f900000664000175000017500000000016315174404631024210 0ustar alastairalastairinteger function isamax(x, y, z) integer, intent(in) :: x, z real, intent(in) :: y isamax = x + y + z end function lfortran-0.63.0/integration_tests/interface_06.f900000664000175000017500000000066015174404631022154 0ustar alastairalastairprogram interface_06 implicit none interface a procedure a1 procedure a2 end interface integer :: i real :: r i = 5 i = a(i) if (i /= 6) error stop r = 6 r = a(r) if (r /= 7) error stop i = 7 i = a(i) if (i /= 8) error stop contains integer function a1(a) integer, intent(in) :: a a1 = a + 1 end function real function a2(a) real, intent(in) :: a a2 = a + 1 end function end program lfortran-0.63.0/integration_tests/nested_23.f900000664000175000017500000000466615174404631021507 0ustar alastairalastairmodule nested_23_mod implicit none type :: build_target character(len=:), allocatable :: name character(len=:), allocatable :: names(:) end type build_target contains subroutine prune_build_targets(targets) type(build_target), allocatable, intent(inout) :: targets(:) integer :: i ! ---- Basic sanity checks ---- if (.not. allocated(targets)) error stop "targets not allocated" if (size(targets) == 0) error stop "targets is empty" do i = 1, size(targets) associate(target => targets(i)) if (.not. allocated(target%name)) then error stop "target name not allocated" end if if (temp_call(targets)) then call collect_used_modules(target) end if end associate end do contains subroutine collect_used_modules(target) type(build_target), intent(inout) :: target ! ---- Validate access to host-associated variable ---- if (.not. allocated(targets)) then error stop "host variable 'targets' unexpectedly unallocated" end if if (.not. allocated(target%name)) then error stop "collect_used_modules: target%name not allocated" end if ! Dummy logic: attach a single "used module" allocate(character(len=len_trim(target%name)) :: target%names(1)) target%names(1) = target%name end subroutine collect_used_modules end subroutine prune_build_targets logical function temp_call(targets) type(build_target), allocatable, intent(in) :: targets(:) if (.not. allocated(targets)) error stop "temp_call: targets not allocated" ! Simple logic: trigger processing only if >1 target exists temp_call = size(targets) > 1 end function temp_call end module nested_23_mod program nested_23 use nested_23_mod implicit none type(build_target), allocatable :: targets(:) allocate(targets(2)) targets(1)%name = "core_lib" targets(2)%name = "util_lib" call prune_build_targets(targets) ! ---- Post-condition check ---- if (.not. allocated(targets(1)%names)) error stop "names not populated" if (targets(1)%names(1) /= "core_lib") error stop "unexpected module name" print *, "MRE completed successfully" end program nested_23 lfortran-0.63.0/integration_tests/arrays_30.f900000664000175000017500000000366115174404631021516 0ustar alastairalastairprogram arrays_30 implicit none integer :: i1(64) = [ 479, 735, -870, 410, 446, -627, 879, -72, & -948, 693, 133, -672, 897, -227, 965, 9, & 0, 997, 721, -240, 765, -426, 361, 751, & 669, -94, 534, 806, -23, 844, 246, -114, & 673, -445, 654, -274, -53, 505, -414, 269, & -345, 268, -544, 629, 353, -808, 199, 322, & 995, -697, 290, -514, 350, -777, 664, 195, & -401, 348, 86, -620, 153, 144, 65, -431 ] integer :: i2(4, 16) integer :: i3(2, 4, 8) integer :: i4(2, 4, 2, 4) integer :: res_01(1), res_02(2), res_03(3), res_04(4) integer :: max = 997 i2 = reshape(i1, [4, 16]) i3 = reshape(i1, [2, 4, 8]) i4 = reshape(i1, [2, 4, 2, 4]) res_01 = maxloc(i1) res_02 = maxloc(i2) res_03 = maxloc(i3) res_04 = maxloc(i4) if (maxloc(i1, 1) /= 18) error stop if (i1(res_01(1)) /= max) error stop if (i2(res_02(1), res_02(2)) /= i1(res_01(1))) error stop if (i3(res_03(1), res_03(2), res_03(3)) /= max) error stop if (i4(res_04(1), res_04(2), res_04(3), res_04(4)) /= max) error stop res_01 = shape(maxloc(i1)) if (res_01(1) /= 1) error stop res_01 = shape(maxloc(i2, 1)) if (res_01(1) /= 16) error stop res_02 = shape(maxloc(i3, 2)) if (res_02(1) /= 2 .or. res_02(2) /= 8) error stop res_03 = shape(maxloc(i4, 3)) if (res_03(1) /= 2 .or. res_03(2) /= 4 .or. res_03(3) /= 4) error stop if (size(maxloc(i2, 2)) /= 4) error stop if (size(maxloc(i3, 3)) /= 8) error stop if (size(maxloc(i4, 4)) /= 16) error stop res_04 = maxloc(i2, 2) if (i2(1, res_04(1)) /= 995) error stop if (i2(2, res_04(2)) /= max) error stop if (i2(3, res_04(3)) /= 965) error stop if (i2(4, res_04(4)) /= 806) error stop end program arrays_30 lfortran-0.63.0/integration_tests/lapack_02.f900000664000175000017500000000066015174404631021443 0ustar alastairalastairC Segfault in pass_array_by_data: dimension pointer corruption C MRE from LAPACK sgbtrf.f compilation failure SUBROUTINE TEST REAL A( 2, 2 ) REAL W( 2, 2 ) EXTERNAL SUB CALL SUB( W, A( 1, 1 ) ) CALL SUB( A( 1, 1 ), W ) END SUBROUTINE SUB( X, Y ) REAL X( 2, 2 ), Y( 2, 2 ) X(1,1) = Y(1,1) END PROGRAM LAPACK_02 CALL TEST PRINT *, 'PASS' END lfortran-0.63.0/integration_tests/intrinsics_185.f900000664000175000017500000000517615174404631022500 0ustar alastairalastairprogram intrinsics_185 implicit none character(7) :: fortran = "FORTRAN" character(2) :: af = "AF" character(3) :: foo = "FOO" character(3) :: c_plus_plus = "C++" character(6) :: fortr = "FORTR" character(1) :: n = "N" integer :: arr2(2) character(len=5) :: string = "hello" character(len=1) :: set(2) = ["l", "h"] integer, parameter :: i1 = verify("FORTRAN", "AF", .true., 4) integer, parameter :: i2 = verify("FORTRAN", "FOO", kind = 8) integer, parameter :: i3 = verify("FORTRAN", "C++", .true.) integer, parameter :: i4 = verify("FORTR", "N") integer, parameter :: i5 = verify("FORTRAN", "FORTRAN", .true.) integer, parameter :: ar1(2) = verify(["FORTRAN", "GORTRAN"], ["FO", "GR"]) integer, parameter :: ar2(2) = verify(["FORTRAN", "GORTRAN"], ["FN", "NA"], .TRUE.) print*, i1 if (i1 /= 7) error stop print*, i2 if (i2 /= 3_8) error stop print*, i3 if (i3 /= 7) error stop print*, i4 if (i4 /= 1) error stop print*, i5 if (i5 /= 0) error stop print*, ar1 if (any(ar1 /= [3, 2])) error stop print*, ar2 if (any(ar2 /= [6, 5])) error stop print*, verify("FORTRAN", "AF", .true., 4) if ( verify("FORTRAN", "AF", .true., 4) /= 7 ) error stop print*, verify("FORTRAN", "FOO", kind = 8) if ( verify("FORTRAN", "FOO", kind = 8) /= 3_8 ) error stop print*, verify("FORTRAN", "C++", .true.) if ( verify("FORTRAN", "C++", .true.) /= 7 ) error stop print*, verify("FORTR", "N") if ( verify("FORTR", "N") /= 1 ) error stop print*, verify("FORTRAN", "FORTRAN", .true.) if ( verify("FORTRAN", "FORTRAN", .true.) /= 0 ) error stop print*, verify(fortran, af, kind = 4) if ( verify(fortran, af, kind = 4) /= 2_4 ) error stop print*, verify(fortran, foo, .true.) if ( verify(fortran, foo, .true.) /= 7 ) error stop print*, verify(fortran, c_plus_plus) if ( verify(fortran, c_plus_plus) /= 1 ) error stop print*, verify(fortr, n, .true., 8) if ( verify(fortr, n, .true., 8) /= 6_8 ) error stop print*, verify(fortran, fortran) if ( verify(fortran, fortran) /= 0 ) error stop ! make sure that broadcasting is done correctly for `verify` arr2 = verify(["FORTRAN", "GORTRAN"], ["FO", "GR"]) print*, arr2 if (any(arr2 /= [3, 2])) error stop arr2 = verify(["FORTRAN", "GORTRAN"], ["FN", "NA"], .TRUE.) print*, arr2 if (any(arr2 /= [6, 5])) error stop arr2 = verify(string, set) print*, arr2 if (any(arr2 /= [1, 2])) error stop arr2 = verify(string, set, .TRUE., 4) print*, arr2 if (any(arr2 /= [5, 5])) error stop end program lfortran-0.63.0/integration_tests/intrinsics_237.f900000664000175000017500000000143215174404631022465 0ustar alastairalastairprogram intrinsics_237 use iso_fortran_env, only: dp => real64, sp => real32 implicit none real(sp) :: i1(2) = [1.0_sp, 2.0_sp] real(sp), parameter :: i2 = sum(sngl([1.0_sp, 2.0_sp])) real(dp) :: i3(2) = [1.0_dp, 2.0_dp] real(dp), parameter :: i4 = sum(sngl([1.0_dp, 2.0_dp])) real(sp), parameter :: i5 = sngl(8.89_8) real(sp), parameter :: ar1(3) = sngl([1.0_dp, 2.0_dp, 3.0_dp]) print *, kind(i5) if (kind(i5) /= 4) error stop print *, ar1 if (any(ar1 /= [1.0_sp, 2.0_sp, 3.0_sp])) error stop print *, sum(sngl(i1)) if (sum(sngl(i1)) /= 3.0) error stop print *, i2 if (i2 /= 3.0) error stop print *, sum(sngl(i3)) if (sum(sngl(i3)) /= 3.0) error stop print *, i4 if (i4 /= 3.0) error stop end programlfortran-0.63.0/integration_tests/print_12.f900000664000175000017500000000052615174404631021346 0ustar alastairalastairprogram print_12 use iso_fortran_env, only: output_unit implicit none integer, parameter :: ucs4 = selected_char_kind('ISO_10646') if (ucs4 /= 4) error stop open(output_unit, encoding='UTF-8') print *, ucs4_'Hello = Ni Hao = ' // & char(int(z'4F60'), ucs4) // char(int(z'597D'), ucs4) end program print_12 lfortran-0.63.0/integration_tests/intrinsics_288.f900000664000175000017500000000666015174404631022503 0ustar alastairalastairprogram intrinsics_288 implicit none type :: my_type integer :: a end type integer, dimension(3) :: source1 = [1, 2, 3] real, dimension(3) :: source2 = [1.0, 2.0, 3.0] logical, dimension(3) :: source3 = [.true., .false., .true.] complex, dimension(3) :: source4 = [(1, 2), (2, 3), (3, 4)] character(len=1), dimension(3) :: source5 = ['a', 'b', 'c'] integer, dimension(3) :: source = [1, 2, 3] integer, dimension(3, 2) :: result integer, dimension(2, 3) :: result1 real, dimension(3, 2) :: result2 logical, dimension(2, 3) :: result3 complex, dimension(3, 2) :: result4 integer :: a = 1 integer, dimension(2) :: result5 character :: ch = 'b' character, dimension(2) :: result6 logical :: lo = .true. logical, dimension(2) :: result7 real :: rl = 1.0 real, dimension(2) :: result8 type(my_type) :: source6(2) type(my_type) :: result9(2,3) integer :: i, j result = spread(source, dim=2, ncopies=2) print *, result if (result(1, 1) /= 1 .or. result(1, 2) /= 1 .or. result(2, 1) /= 2 .or. & result(2, 2) /= 2 .or. result(3, 1) /= 3 .or. result(3, 2) /= 3) error stop print *, spread([1, 4, 5], 2, 2) result = spread([1, 4, 5], 2, 2) print *, result(1, 1) ! Does not work yet ! if (result(1, 1) /= 1 .or. result(1, 2) /= 1 .or. result(2, 1) /= 4 .or. & ! result(2, 2) /= 4 .or. result(3, 1) /= 5 .or. result(3, 2) /= 5) error stop print *, spread([1, 2, 3, 4, 5], 1, 2) print *, spread([1.0, 2.0, 3.0], 1, 3) print *, spread([(1, 2), (2, 3)], 1, 2) print *, spread(['a', 'b', 'c'], 1, 3) print *, spread([.true., .false., .true.], 1, 2) print *, spread(source1, 1, 2) result1 = spread(source1, 1, 2) print *, result1 print *, result1(1, 2) if (result1(1, 1) /= 1 .or. result1(1, 2) /= 2 .or. result1(1, 3) /= 3 .or. & result1(2, 1) /= 1 .or. result1(2, 2) /= 2 .or. result1(2, 3) /= 3) error stop print *, spread(source2, 2, 2) result2 = spread(source2, 2, 2) if (abs(result2(1, 1) - 1.0) > 1e-6 .or. abs(result2(1, 2) - 1.0) > 1e-6 .or. abs(result2(2, 1) - 2.0) > 1e-6 .or. & abs(result2(2, 2) - 2.0) > 1e-6 .or. abs(result2(3, 1) - 3.0) > 1e-6 .or. abs(result2(3, 2) - 3.0) > 1e-6) error stop print *, spread(source3, 1, 2) result3 = spread(source3, 1, 2) print *, result3(2, 1) if (result3(1, 1) .neqv. .true. .or. result3(1, 2) .neqv. .false. .or. result3(1, 3) .neqv. .true. .or. & result3(2, 1) .neqv. .false. .or. result3(2, 2) .neqv. .false. .or. result3(2, 3) .neqv. .true.) error stop print *, spread(source4, 2, 2) result4 = spread(source4, 2, 2) if (result4(1, 1) /= (1, 2) .or. result4(1, 2) /= (1, 2) .or. result4(2, 1) /= (2, 3) .or. & result4(2, 2) /= (2, 3) .or. result4(3, 1) /= (3, 4) .or. result4(3, 2) /= (3, 4)) error stop print *, spread(source5, 1, 3) ! Wrong output with LFortran ! tests for Scalar Sources result5 = SPREAD(a, 1, 2) print *, result5 if (result5(1) /= 1 .or. result5(2) /= 1 ) error stop result6 = SPREAD(ch, 1, 2) print *, result6 if (result6(1) /= 'b' .or. result6(2) /= 'b' ) error stop result7 = SPREAD(lo, 1, 2) print *, result7 if ( (result7(1) .neqv. .true.) .or. (result7(2) .neqv. .true.) ) error stop result8 = SPREAD(rl, 1, 2) print *, result8 if ( abs(result8(1) - 1.0) > 1e-6 .or. abs(result8(2) - 1.0) > 1e-6 ) error stop do i = 1, 2 source6(i)%a = i end do result9 = spread(source6, dim=2, ncopies=3) do i = 1, 2 do j = 1, 3 if (result9(i,j)%a /= i) error stop end do end do end program lfortran-0.63.0/integration_tests/complex_08.f900000664000175000017500000000260615174404631021667 0ustar alastairalastairprogram complex_08 use iso_fortran_env, only: sp => real32, dp => real64 implicit none complex(sp), parameter :: c1 = conjg((1.0_sp, 2.0_sp)) complex(dp), parameter :: c2 = conjg((-3.0_dp, -4.0_dp)) complex(sp), parameter :: ar1(2) = conjg([(1.0_sp, 2.0_sp), (-3.0_sp, 4.0_sp)]) complex(dp), parameter :: ar2(2) = conjg([(-1.0_dp, -2.0_dp), (3.0_dp, -4.0_dp)]) complex(sp) :: x = conjg((0, 0)) complex(dp) :: y = conjg((2.0, -5.5)) complex(dp) :: z = (42, 3.14) complex(sp) :: arr1(3) = [(0, 0), (2.0, 5.5), (42, -3.14)] complex(dp) :: arr2(3) = [(-1.0, -2.0), (3.0, -4.0), (42, -3.14)] print *, c1 if (abs(c1 - (1.0_sp, -2.0_sp)) > 1e-5) error stop print *, c2 if (abs(c2 - (-3.0_dp, 4.0_dp)) > 1e-5) error stop print *, ar1 if (any(abs(ar1 - [(1.0_sp, -2.0_sp), (-3.0_sp, -4.0_sp)]) > 1e-5)) error stop print *, ar2 if (any(abs(ar2 - [(-1.0_dp, 2.0_dp), (3.0_dp, 4.0_dp)]) > 1e-5)) error stop print *, x if (abs(x - (0, 0)) > 1e-5) error stop print *, y if (abs(y - (2.0, 5.5)) > 1e-5) error stop print *, conjg(z) if (abs(conjg(z) - (42, -3.14)) > 1e-5) error stop print *, conjg(arr1) if (any(abs(conjg(arr1) - [(0, 0), (2.0, -5.5), (42, 3.14)]) > 1e-5)) error stop print *, conjg(arr2) if (any(abs(conjg(arr2) - [(-1.0, 2.0), (3.0, 4.0), (42, 3.14)]) > 1e-5)) error stop end program lfortran-0.63.0/integration_tests/implicit_interface_17.f900000664000175000017500000000036215174404631024047 0ustar alastairalastairprogram implicit_interface_17 implicit none real :: y( 5,5 ) external :: isamax integer :: isamax y = 1.0 y( 4, 1 ) = 19.68 print *, y( isamax(2, y( 1, 1 ), 1 ), 1 ) if ( abs(y(isamax(2, y(1,1), 1), 1 ) - 19.68) > 1e-8 ) error stop end lfortran-0.63.0/integration_tests/intrinsics_194.f900000664000175000017500000000156015174404631022471 0ustar alastairalastair!> the below test cases test the broadcasting of "min" intrinsic !> procedure during compile time program intrinsics_194 integer :: arr3(3), arr2(2) arr3 = min([-1, 2, 3], 2, 5, [4, 4, 5], [5, -8, 7]) if (arr3(1) /= -1) error stop if (arr3(2) /= -8) error stop if (arr3(3) /= 2) error stop ! not necessary to test the dimensions though ! as the initial assignment itself would raise an ! error if the assignment was incompatible if (size(arr3) /= 3) error stop arr3 = min(1, [-1, 2, 20]) if (arr3(1) /= -1) error stop if (arr3(2) /= 1) error stop if (arr3(3) /= 1) error stop arr3 = min([1, 2, 3], [1, 1, [2]]) if (arr3(1) /= 1) error stop if (arr3(2) /= 1) error stop if (arr3(3) /= 2) error stop arr2 = min([1, 2], -1, -4) if (arr2(1) /= -4) error stop if (arr2(2) /= -4) error stop end program lfortran-0.63.0/integration_tests/intrinsics_410.f900000664000175000017500000000114015174404631022452 0ustar alastairalastair! Test maxloc/minloc/shape return correct kind with -fdefault-integer-8 program intrinsics_410 implicit none integer :: arr(5) = [1, 3, 2, 5, 4] integer :: loc(1) integer :: shp(1) ! maxloc should return integer of default kind loc = maxloc(arr) if (loc(1) /= 4) error stop "maxloc failed" ! minloc should return integer of default kind loc = minloc(arr) if (loc(1) /= 1) error stop "minloc failed" ! shape should return integer of default kind shp = shape(arr) if (shp(1) /= 5) error stop "shape failed" print *, "PASS" end program intrinsics_410 lfortran-0.63.0/integration_tests/pointer_01.f900000664000175000017500000000400215174404631021661 0ustar alastairalastairprogram pointer_01 implicit none integer, dimension(:), pointer :: int_ptr logical, dimension(:), pointer :: logical_ptr real, dimension(:, :), pointer :: real_ptr integer :: i nullify(int_ptr) print *, associated(int_ptr) if (associated(int_ptr) .neqv. .false.) error stop allocate(int_ptr(3)) int_ptr = [1, 2, 3] print *, int_ptr print *, associated(int_ptr) if (associated(int_ptr) .neqv. .true.) error stop if (product(int_ptr) == 6) then deallocate(int_ptr) nullify(int_ptr) allocate(int_ptr(5)) int_ptr = (/ (i, i=1, 5)/) print *, int_ptr if (size(int_ptr) /= 5) error stop end if nullify(logical_ptr) print *, associated(logical_ptr) if (associated(logical_ptr) .neqv. .false.) error stop allocate(logical_ptr(5)) logical_ptr = [.true., .false., .true., .false., .false.] print *, logical_ptr print *, associated(logical_ptr) if (associated(logical_ptr) .neqv. .true.) error stop if (size(logical_ptr) == 5) then deallocate(logical_ptr) nullify(logical_ptr) allocate(logical_ptr(2)) logical_ptr = .true. print *, logical_ptr if (all(logical_ptr .neqv. [.true., .true.])) error stop end if nullify(real_ptr) print *, associated(real_ptr) if (associated(real_ptr) .neqv. .false.) error stop allocate(real_ptr(2, 2)) real_ptr = reshape([1.0, 2.0, 3.0, 4.0], [2, 2]) print *, real_ptr print *, associated(real_ptr) if (associated(real_ptr) .neqv. .true.) error stop if (sum(real_ptr) /= 11.0) then deallocate(real_ptr) nullify(real_ptr) end if deallocate(int_ptr) deallocate(logical_ptr) ! Uncomment after fixing #4506 ! call sub ! contains ! subroutine sub ! nullify(int_ptr) ! print *, associated(int_ptr) ! allocate(int_ptr(2)) ! int_ptr = [1, 2] ! print *, int_ptr ! print *, associated(int_ptr) ! end subroutine sub end program pointer_01 lfortran-0.63.0/integration_tests/array_op_07.f900000664000175000017500000000026315174404631022030 0ustar alastairalastairprogram array_op_7 integer :: A(2) = [2,2] logical :: B(2) integer :: i B = abs(A) > maxval(abs(A)) do i = 1, 2 if (B(i) .neqv. .false.) error stop end do end program lfortran-0.63.0/integration_tests/functions_37.f900000664000175000017500000000074715174404631022236 0ustar alastairalastairmodule functions_37_mod interface generic procedure :: ff end interface contains pure function ff() result(ret) integer :: ret ret = 190 end function function foo() result(arr) integer :: arr(generic()) ! Depends on `ff` to be fully declared (through interface `generic`) end function end module program functions_37 use functions_37_mod print *, size(foo()) if(size(foo()) /= 190) error stop end program functions_37lfortran-0.63.0/integration_tests/save_06.f900000664000175000017500000000045315174404631021152 0ustar alastairalastairsubroutine idd_random_transf_init(value) implicit none real(8), intent(in) :: value save if( value /= 42.0d0) error stop return end program save_06 implicit none real(8) :: initialValue initialValue = 42.0d0 call idd_random_transf_init(initialValue) end program lfortran-0.63.0/integration_tests/intrinsics_370.f900000664000175000017500000000041015174404631022456 0ustar alastairalastairprogram intrinsics implicit none integer, dimension(5) :: value integer :: val, iloc value = [0, 2, 1, 3, 1] val = 1 iloc = findloc(value, val, dim=1) print * , iloc if (iloc /= 3) error stop end programlfortran-0.63.0/integration_tests/class_optional_01.f900000664000175000017500000000176215174404631023225 0ustar alastairalastairmodule class_optional_01_mod implicit none type :: MyType integer, allocatable :: s end type MyType interface MyType procedure :: my_constructor end interface MyType contains function my_constructor(obj) result(self) class(MyType), optional, intent(in) :: obj type(MyType) :: self if (present(obj)) then self%s = 10 else self%s = 5 end if end function my_constructor end module class_optional_01_mod program class_optional_01 use class_optional_01_mod implicit none type(MyType) :: a ! Call constructor with no arguments (optional class arg absent). ! Previously caused "pointer being freed was not allocated" crash ! because the class wrapper for the absent optional argument had ! its inner struct pointer left uninitialized. a = MyType() if (.not. allocated(a%s)) error stop "a%s should be allocated" if (a%s /= 5) error stop "a%s should be 5" print *, "PASS" end program class_optional_01 lfortran-0.63.0/integration_tests/associate_10.f900000664000175000017500000000074715174404631022170 0ustar alastairalastairsubroutine find_fit(data_y) real, intent(inout) :: data_y(2) real :: tol, fvec(2) tol = sqrt(epsilon(1.0)) * 1e4 fvec = tol call fcn(fvec) contains subroutine fcn(fvec) real :: fvec(:) data_y = fvec end subroutine fcn end subroutine find_fit program associate_10 real :: datay(2) datay = 4.0 call find_fit(datay) print *, datay if( abs(datay(1) - 3.45266986) > 1e-6 ) error stop if( abs(datay(2) - 3.45266986) > 1e-6 ) error stop end program associate_10 lfortran-0.63.0/integration_tests/submodule_20a.f900000664000175000017500000000017015174404631022344 0ustar alastairalastairprogram submodule_20a use submodule_20b_mod implicit none type(t) :: x call x%foo() print *, "ok" end program lfortran-0.63.0/integration_tests/functions_27.f900000664000175000017500000000103315174404631022222 0ustar alastairalastairmodule functions_27_mod contains function func_arr3() result(ret_arr) integer,allocatable :: ret_arr(:) print *, allocated(ret_arr) ! ret_arr should always be not allocated by the begining of the function call. if(allocated(ret_arr) .eqv. .true.) error stop allocate(ret_arr(1)) end function end module program functions_27 use functions_27_mod implicit none integer, allocatable :: inp(:) integer :: i do i= 1, 3 inp = func_arr3() end do end program lfortran-0.63.0/integration_tests/gpu_metal_134_mod.f900000664000175000017500000000046615174404631023116 0ustar alastairalastairmodule gpu_metal_134_m implicit none interface elemental module function relu(x) result(y) real, intent(in) :: x real :: y end function end interface end module submodule(gpu_metal_134_m) gpu_metal_134_sub implicit none contains module procedure relu y = max(0.0, x) end procedure end submodule lfortran-0.63.0/integration_tests/submodule_06.f900000664000175000017500000000301415174404631022207 0ustar alastairalastairmodule mod_submodule_06 implicit none type :: key_type integer(1), allocatable :: value(:) end type key_type interface fnv_1_hash module function int8_fnv_1( key ) result(hash_code) integer(1), intent(inout) :: key(:) integer(4) :: hash_code end function int8_fnv_1 end interface fnv_1_hash end module mod_submodule_06 submodule(mod_submodule_06) submod_submodule_06 implicit none contains module function int8_fnv_1( key ) result(hash_code) integer(1), intent(inout) :: key(:) integer(4) :: hash_code integer(1), parameter :: array(4) = [1, 2, 3, 4] integer(4), parameter :: result = 5 hash_code = result key = array end function int8_fnv_1 end submodule submod_submodule_06 program submodule_06 use mod_submodule_06 implicit none integer(4) :: fnv_1_hasher = 1 type(key_type) :: key integer(1) :: test_object(4) allocate(key % value(4)) fnv_1_hasher = fnv_1_hash( key % value ) print *, fnv_1_hasher print *, key % value if (fnv_1_hasher /= 5) error stop if (.not. all(key % value == [1, 2, 3, 4])) error stop call test_fnv_1() contains subroutine test_fnv_1() integer(4) :: hash hash = fnv_1_hash( test_object ) print *, hash print *, test_object if (hash /= 5) error stop if (.not. all(test_object == [1, 2, 3, 4])) error stop end subroutine test_fnv_1 end programlfortran-0.63.0/integration_tests/implicit_interface_29.f900000664000175000017500000000056715174404631024061 0ustar alastairalastairsubroutine some_subroutine() real(8), allocatable :: a(:,:) allocate(a(3, 3)) a = 1.0d0 a(2,2) = 5.0d0 call other_subroutine(a, 3, 3) if (a(1,1) /= 1.0d0) error stop if (a(2,2) /= 5.0d0) error stop end subroutine some_subroutine program implicit_interface_29 implicit none call some_subroutine() print *, "ok" end program implicit_interface_29 lfortran-0.63.0/integration_tests/interface_32_module.f900000664000175000017500000000144115174404631023516 0ustar alastairalastairmodule interface_32_mymod type :: MyType integer :: val = 0 end type MyType interface MyType procedure :: constructor end interface MyType contains function constructor() result(self) type(MyType) :: self self%val = 42 end function constructor end module interface_32_mymod module interface_32_wrappermod use interface_32_mymod, only: MyType type :: WrapperType class(MyType), allocatable :: obj end type WrapperType interface WrapperType procedure :: constructor end interface WrapperType contains function constructor(obj) result(self) class(MyType), intent(in) :: obj type(WrapperType) :: self allocate(self%obj, source=obj) end function constructor end module interface_32_wrappermod lfortran-0.63.0/integration_tests/types_16.f900000664000175000017500000000211115174404631021352 0ustar alastairalastairprogram types_16 implicit none integer, parameter :: dp = kind(0.d0) print *, add_floats(-2.3, 5.6) print *, get_neg_f32() print *, get_pi() print *, get_pi_64() print *, computeCircleArea(5.0_dp) contains function sqr(x) result(r) implicit none real(dp), intent(in):: x real(dp) :: r r = x * x return end function function add_floats(x, y) result(r) real, intent(in) :: x, y real :: r r = x + y return end function function get_pi() result(r) real :: r r = 3.14 return end function function get_pi_64() result(r) real(dp) :: r r = 3.14_dp return end function function get_neg_f32() result(r) real :: r r = -2.5 return end function function computeCircleArea(radius) result(area) implicit none real(dp), intent(in):: radius real(dp) :: PI, area PI = get_pi_64() area = PI * sqr(radius) return end function end program lfortran-0.63.0/integration_tests/functions_07.f900000664000175000017500000000121615174404631022223 0ustar alastairalastairmodule functions_07_a implicit none contains real function f_a(u) result(v) real, intent(in) :: u v = u + 1.0 end function end module module functions_07_b use functions_07_a implicit none contains real function f_b(x) result(y) real, intent(in) :: x y = f_a(x) + 1.0 end function end module module functions_07_c use functions_07_b implicit none contains real function f_c(w) result(z) real, intent(in) :: w z = f_b(w) + 1.0 end function end module program functions_07 use functions_07_c implicit none real :: p = 5, q q = f_c(p) print *, q end program lfortran-0.63.0/integration_tests/external_08.f900000664000175000017500000000101315174404631022031 0ustar alastairalastairsubroutine b(f,g) ! f, g are functions call f(1.39) call g(-9.16) end subroutine subroutine f(x) real :: x print *, x if (abs(x - 1.39) > 1e-8) error stop end subroutine subroutine g(x) real :: x print *, x if (abs(x - (-9.16)) > 1e-8) error stop end subroutine subroutine a() interface subroutine f(x) real :: x end subroutine subroutine g(x) real :: x end subroutine end interface call b(f,g) end subroutine program external_08 call a() end program lfortran-0.63.0/integration_tests/format_56.f900000664000175000017500000000047015174404631021510 0ustar alastairalastairC Fixed-form Fortran test for FORMAT statement location tracking C This test ensures that format validation errors point to the correct line program format_56 implicit none integer :: x x = 42 print 100, x 100 format (I5) if (x /= 42) error stop end program format_56 lfortran-0.63.0/integration_tests/write_08.f900000664000175000017500000000034615174404631021351 0ustar alastairalastairprogram test character(len=20) :: str character(len=:), allocatable :: sformat real :: x = 3.14159 sformat = "(F6.2)" write(str, sformat) x print *, str if (trim(str) /= " 3.14") error stop end programlfortran-0.63.0/integration_tests/save_11.f900000664000175000017500000000066015174404631021146 0ustar alastairalastairsubroutine foo_save_11(reference) integer , intent(in) :: reference integer, save , dimension(2) :: arr = [1,1] complex :: c = (1,1) arr = arr + 1 c = c + (1, 1) print *, arr if(any(arr /= reference)) error stop print *, c if(c /= complex(reference, reference)) error stop end subroutine foo_save_11 program save_11 call foo_save_11(2) call foo_save_11(3) end program save_11lfortran-0.63.0/integration_tests/allocate_21.f900000664000175000017500000000106515174404631021775 0ustar alastairalastairmodule mod_allocate_21 contains subroutine molded_allocation(arr) real(8), intent(in) :: arr(:,:) real(8), allocatable :: local_arr(:,:) allocate(local_arr, mold = arr) if (size(local_arr, 1) /= size(arr, 1) .or. & size(local_arr, 2) /= size(arr, 2)) error stop end subroutine molded_allocation end module mod_allocate_21 program allocate_21 use mod_allocate_21 implicit none real(8), allocatable :: arr(:,:) integer :: i, j allocate(arr(2,3)) call molded_allocation(arr) end program allocate_21lfortran-0.63.0/integration_tests/data_21.f900000664000175000017500000000360315174404631021122 0ustar alastairalastairprogram data_21 type ty character::t1 = 'aa' end type type :: ty2 integer :: x character, pointer :: ptr2 character, pointer :: ptr4 end type ty2 integer,pointer::ptr1 character,pointer::ptr2, ptr3 integer::k,l character,target::t1="a" type(ty),target,save ::obj data k,ptr1,ptr2,l,ptr3 /10,NULL(), t1,20, obj%t1/ if(ptr2 /= "a") error stop if(ptr3 /= "a") error stop if(associated(ptr1) .neqv. .false.) error stop if(k /= 10) error stop if(l /= 20) error stop call s1() print*,"PASS" contains subroutine s1() character, pointer :: ptr integer, pointer :: ptr3 character, pointer :: ptr6 character, pointer :: ptr7 type(ty2) :: obj2 character, target, save :: t1 = "a" integer, target, save :: t2 = 20 integer :: k data ptr / NULL() / data ptr3 / t2 / data obj2%ptr2 / t1 / data ptr6 / t1 / data k / 4 / data obj2%ptr4 / t1 / data obj2%x / 23 / data ptr7 / t1 / if (k /= 4) error stop if (obj2%x /= 23) error stop if (associated(ptr) .neqv. .false.) error stop "102" if (associated(ptr3) .neqv. .true.) error stop "103" if (associated(obj2%ptr2).neqv. .true.) error stop "104" if (associated(ptr6) .neqv. .true.) error stop "105" if (associated(obj2%ptr4).neqv. .true.) error stop "106" if (associated(ptr7) .neqv. .true.) error stop "107" if (ptr3 /= 20) error stop "108" if (obj2%ptr2 /= "a") error stop "109" if (obj2%ptr4 /= "a") error stop "110" if (ptr6 /= "a") error stop "111" if (ptr7 /= "a") error stop "112" end subroutine s1 end programlfortran-0.63.0/integration_tests/type_bound_generic_member_access_02.f900000664000175000017500000000142715174404631026726 0ustar alastairalastairmodule type_bound_generic_member_access_02_m implicit none type parent_t integer :: call_count = 0 contains procedure, private :: divergence_1D_weights end type parent_t type, extends(parent_t) :: divergence_1D_t contains generic :: weights => divergence_1D_weights end type divergence_1D_t contains subroutine divergence_1D_weights(self) class(parent_t), intent(inout) :: self self%call_count = self%call_count + 1 end subroutine divergence_1D_weights end module type_bound_generic_member_access_02_m program type_bound_generic_member_access_02 use type_bound_generic_member_access_02_m implicit none type(divergence_1D_t) :: obj call obj%weights() if (obj%call_count /= 1) error stop 1 end program type_bound_generic_member_access_02 lfortran-0.63.0/integration_tests/string_107.f900000664000175000017500000000131315174404631021600 0ustar alastairalastair! Test: substring with end < start yields zero-length string (F2018 9.4.1) program string_107 implicit none character(len=5) :: s = "hello" character(len=:), allocatable :: res integer :: j ! s(1:-1) should be zero-length j = 0 res = trim(s(1:j-1)) if (len(res) /= 0) error stop ! s(3:2) should be zero-length res = s(3:2) if (len(res) /= 0) error stop ! s(5:1) should be zero-length res = s(5:1) if (len(res) /= 0) error stop ! Normal substring still works res = s(2:4) if (len(res) /= 3) error stop if (res /= "ell") error stop ! s(1:1) single character res = s(1:1) if (len(res) /= 1) error stop if (res /= "h") error stop print *, "ok" end program string_107 lfortran-0.63.0/integration_tests/generic_name_06.f900000664000175000017500000000244215174404631022630 0ustar alastairalastair! Test: generic type-bound procedure resolution by rank ! with class(*) allocatable arguments. module generic_name_06_mod implicit none type :: t contains generic :: get => get1d, get2d procedure :: get1d procedure :: get2d end type contains subroutine get1d(this, x) class(t), intent(in) :: this class(*), allocatable, intent(out) :: x(:) allocate(integer :: x(3)) select type(x) type is (integer) x = [10, 20, 30] end select end subroutine subroutine get2d(this, x) class(t), intent(in) :: this class(*), allocatable, intent(out) :: x(:,:) allocate(real :: x(2,2)) select type(x) type is (real) x(1,:) = [1.0, 2.0] x(2,:) = [3.0, 4.0] end select end subroutine end module program generic_name_06 use generic_name_06_mod implicit none type(t) :: obj class(*), allocatable :: vec(:) class(*), allocatable :: matrix(:,:) call obj%get(matrix) select type(matrix) type is (real) if (any(matrix(1,:) /= [1.0, 2.0])) error stop if (any(matrix(2,:) /= [3.0, 4.0])) error stop class default error stop end select call obj%get(vec) select type(vec) type is (integer) if (any(vec /= [10, 20, 30])) error stop class default error stop end select print *, "PASS" end program lfortran-0.63.0/integration_tests/common_01.f900000664000175000017500000000116015174404631021473 0ustar alastairalastairmodule common_01_mod implicit none contains subroutine f() common / c1 / a, b, c integer :: a, b, c a = b b = 4 end subroutine subroutine g() common / c1 / x, y, z integer :: x, y, z x = y y = 4 end subroutine end module program common_01 use common_01_mod, only: f, g implicit none common / c1 / a, b, c integer :: a, b, c a = 1 b = 2 print *, a, b if (a /= 1) error stop if (b /= 2) error stop call f() print *, a, b if (a /= 2) error stop if (b /= 4) error stop a = 1 b = 2 print *, a, b if (a /= 1) error stop if (b /= 2) error stop call g() print *, a, b if (a /= 2) error stop if (b /= 4) error stop end program lfortran-0.63.0/integration_tests/custom_operator_12.f900000664000175000017500000000231615174404631023436 0ustar alastairalastairmodule custom_operator_12_m implicit none type :: operands_t real :: actual, expected end type type :: result_t logical :: passed end type interface operator(.approximates.) module procedure approximates end interface interface operator(.within.) module procedure within end interface contains elemental function approximates(actual, expected) result(operands) real, intent(in) :: actual, expected type(operands_t) :: operands operands%actual = actual operands%expected = expected end function elemental function within(operands, tolerance) result(res) type(operands_t), intent(in) :: operands real, intent(in) :: tolerance type(result_t) :: res res%passed = abs(operands%actual - operands%expected) <= tolerance end function end module program custom_operator_12 use custom_operator_12_m, only: operator(.approximates.), operator(.within.), result_t implicit none type(result_t) :: r ! Chained user-defined operators with "use ... only:" import r = 1. .approximates. 2. .within. 3. print *, r%passed if (.not. r%passed) error stop r = 1. .approximates. 2. .within. 0.5 print *, r%passed if (r%passed) error stop end program lfortran-0.63.0/integration_tests/separate_compilation_35.f900000664000175000017500000000032215174404631024413 0ustar alastairalastairprogram separate_compilation_35 use separate_compilation_35a, only: get_version implicit none character(len=:), allocatable :: v v = get_version() print *, v if (len(v) == 0) error stop end program lfortran-0.63.0/integration_tests/format_73.f900000664000175000017500000000052515174404631021510 0ustar alastairalastairprogram format_73 implicit none real :: a, b open (42, file='read_fmt12.dat', status='replace', form='formatted') write (42,'(a)') '1.2345E0 1.2345' rewind (42) read (42, 100) a, b print *, a, b if( abs (a-1.2345) >= 1e-3) error stop if( abs (b-12.345) >= 1e-3) error stop 100 format (-1P,2F8.1) end program format_73 lfortran-0.63.0/integration_tests/intrinsics_88.f900000664000175000017500000000425115174404631022413 0ustar alastairalastairprogram intrinsics_88 implicit none integer, parameter :: x1 = min(1, 2) integer(8), parameter :: x2 = min(1_8, 2_8) real, parameter :: x3 = min(1.0, 2.0) real(8), parameter :: x4 = min(1.0_8, 2.0_8) character(len=10), parameter :: x5 = min("str", "string") integer, parameter :: ar1(3) = min([1, 12, 3], [4, 5, 6]) integer(8), parameter :: ar2(3) = min([1_8, 12_8, 3_8], [4_8, 5_8, 6_8]) real, parameter :: ar3(3) = min([1.0, 12.0, 3.0], [4.0, 5.0, 6.0]) real(8), parameter :: ar4(3) = min([1.0_8, 12.0_8, 3.0_8], [4.0_8, 5.0_8, 6.0_8]) ! character(len=10), parameter :: ar5(3) = min(["str1", "str2", "char"], ["!str#$", "xtring", "charac"]) ! Does not work - #4582 integer :: i1, i2 integer(8) :: i3, i4 real :: r1, r2 real(8) :: r3, r4 character(len=10) :: string_var, string_var2, string_var3 i1 = 123 i2 = 456 i3 = 123_8 i4 = 456_8 r1 = 123.0 r2 = 456.0 r3 = 123.0_8 r4 = 456.0_8 string_var = "str" string_var2 = "string" string_var3 = "character" print *, x1 if (x1 /= 1) error stop print *, x2 if (x2 /= 1_8) error stop print *, x3 if (x3 /= 1.0) error stop print *, x4 if (x4 /= 1.0_8) error stop print *, x5 if (x5 /= "str") error stop print *, ar1 if (any(ar1 /= [1, 5, 3])) error stop print *, ar2 if (any(ar2 /= [1_8, 5_8, 3_8])) error stop print *, ar3 if (any(ar3 /= [1.0, 5.0, 3.0])) error stop print *, ar4 if (any(ar4 /= [1.0_8, 5.0_8, 3.0_8])) error stop ! print *, ar5 ! if (any(ar5 /= ["str1", "string", "charac"])) error stop print *, min(i1, i2) if (min(i1, i2) /= i1) error stop print *, min(i3, i4) if (min(i3, i4) /= i3) error stop print *, min(r1, r2) if (min(r1, r2) /= r1) error stop print *, min(r3, r4) if (min(r3, r4) /= r3) error stop print*, min("str", "character") if (min("str", "character") /= "character") error stop print*, min(string_var, string_var2) if (min(string_var, string_var2) /= string_var) error stop print*, min(string_var3, string_var2) if (min(string_var3, string_var2) /= string_var3) error stop end programlfortran-0.63.0/integration_tests/private1.f900000664000175000017500000000046715174404631021447 0ustar alastairalastairmodule foo1 private end module module foo2 real :: y = 2 contains subroutine f() y = 3.0 end subroutine f end module program test use foo2 print *, y if( abs(y - 2.0) > 1e-12 ) error stop call f() print *, y if( abs(y - 3.0) > 1e-12 ) error stop end program lfortran-0.63.0/integration_tests/arrays_op_18.f900000664000175000017500000000053715174404631022221 0ustar alastairalastairprogram arrays_op_18 implicit none real, allocatable :: a(:) real :: b(10, 7) integer :: i, j allocate(a(40)) a = 5.0 b = 6.0 a = [b, a] print *, size(a), lbound(a, 1), ubound(a, 1) if( size(a) /= 110 ) error stop print *, a do i = 1, 70 if( a(i) /= 6.0 ) error stop end do do i = 71, 110 if( a(i) /= 5.0 ) error stop end do end program lfortran-0.63.0/integration_tests/intrinsics_355.f900000664000175000017500000000053415174404631022470 0ustar alastairalastairmodule timerm implicit none private public print_time contains subroutine print_time(rate) integer rate call system_clock(count_rate=rate) end subroutine print_time end module timerm program intrinsic_355 use timerm integer :: rate call print_time(rate) print *, rate if (rate /= 1000) error stop end lfortran-0.63.0/integration_tests/array_op_04.f900000664000175000017500000000077515174404631022035 0ustar alastairalastairmodule module_array_op_04 contains subroutine find_fit(expr) real :: y(1) interface function expr() result(y) real :: y(1) end function expr end interface y = expr() if (abs(y(1) - 1.0) > 1e-7) error stop print *, y end subroutine find_fit end module module_array_op_04 program example_primes use module_array_op_04, only: find_fit implicit none call find_fit(expression) contains function expression() result(y) real :: y(1) y = 1.0 end function expression end program example_primes lfortran-0.63.0/integration_tests/derived_types_30.f900000664000175000017500000000237215174404631023061 0ustar alastairalastairmodule testdrive_derived_types_30 implicit none public :: unittest_type abstract interface subroutine test_interface(error) integer, intent(out) :: error end subroutine test_interface end interface type :: unittest_type procedure(test_interface), pointer, nopass :: test => null() logical :: should_fail = .false. end type unittest_type contains subroutine run_unittest(test_var, error) type(unittest_type), intent(in) :: test_var integer, intent(inout) :: error call test_var%test(error) end subroutine run_unittest subroutine test_impl1(error) integer, intent(out) :: error error = 2 end subroutine test_impl1 end module testdrive_derived_types_30 program derived_types_30 use testdrive_derived_types_30 implicit none type(unittest_type) :: var integer :: error var % test => test_impl call run_unittest(var, error) print *, error if( error /= 1 ) error stop var % test => test_impl1 call run_unittest(var, error) print *, error if( error /= 2 ) error stop contains subroutine test_impl(error) integer, intent(out) :: error error = 1 end subroutine test_impl end program lfortran-0.63.0/integration_tests/select_type_17.f900000664000175000017500000000056215174404631022537 0ustar alastairalastairprogram select_type_17 implicit none call print_any(" Hello World ") contains subroutine print_any(generic) class(*), intent(in) :: generic character(len = 15) :: a select type (generic) type is (character(len=*)) print *, generic end select end subroutine print_any end program select_type_17 lfortran-0.63.0/integration_tests/format_79.f900000664000175000017500000000272715174404631021524 0ustar alastairalastairprogram test_sign_modes implicit none character(len=20) :: s1, s2, s3 ! Unit 10 → Explicit PLUS open(unit=10, file="plus.txt", status="replace", sign="plus", form="formatted") ! Unit 20 → Explicit SUPPRESS open(unit=20, file="suppress.txt", status="replace", sign="suppress", form="formatted") ! Unit 30 → No SIGN specified (default) open(unit=30, file="default.txt", status="replace", form="formatted") ! Inquire SIGN modes inquire(unit=10, sign=s1) inquire(unit=20, sign=s2) inquire(unit=30, sign=s3) if (trim(s1) /= "PLUS") error stop if (trim(s2) /= "SUPPRESS") error stop if (trim(s3) /= "PROCESSOR_DEFINED") error stop ! Write same numbers to all files write(10, '(F6.2)') 3.14, -3.14 write(20, '(F6.2)') 3.14, -3.14 write(30, '(F6.2)') 3.14, -3.14 close(10) close(20) close(30) open(unit=11, file="plus.txt", status="old", form="formatted") open(unit=21, file="suppress.txt", status="old", form="formatted") open(unit=31, file="default.txt", status="old", form="formatted") read(11, '(A)') s1 read(11, '(A)') s2 if (trim(s1) /= " +3.14") error stop if (trim(s2) /= " -3.14") error stop read(21, '(A)') s1 read(21, '(A)') s2 if (trim(s1) /= " 3.14") error stop if (trim(s2) /= " -3.14") error stop read(31, '(A)') s1 read(31, '(A)') s2 if (trim(s1) /= " 3.14") error stop if (trim(s2) /= " -3.14") error stop end program lfortran-0.63.0/integration_tests/intrinsics_343.f900000664000175000017500000000145615174404631022471 0ustar alastairalastairprogram intrinsics_343 integer, allocatable :: b(:) integer, dimension(3, 4) :: a integer, dimension(3, 3, 2) :: c a = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], shape=[3, 4]) c = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], shape=[3, 3, 2]) allocate(b(3)) b = reshape([1, 2, 3], shape=[3]) print *, cshift(b, 2) b = cshift(b, 2) print *, b print *, cshift(a, 2) a = cshift(a, 2) print *, a print *, cshift(c, 2) c = cshift(c, 2) print *, c if( any(b /= [3, 1, 2] ) ) error stop if( any(a /= reshape([3, 1, 2, 6, 4, 5, 9, 7, 8, 12 ,10, 11], shape=[3, 4]) )) error stop if ( any(c /= reshape([3, 1, 2, 6, 4, 5, 9, 7, 8, 12 ,10, 11, 15, 13, 14, 18, 16, 17], shape=[3, 3, 2]) ) ) error stop end program lfortran-0.63.0/integration_tests/character_array_parameter_padding_trimming.f900000664000175000017500000000124215174404631030472 0ustar alastairalastair!> These tests make sure that for constant(i.e. parameter) character string (or array) !> * padding (when LHS length is higher) !> * trimming (when LHS length is lower) program character_array_parameter_padding_trimming character(len=1), parameter :: a_pad(4) = ["ab", "cd", "ef", "gh"] character(len=5), parameter :: b_pad(4) = ["ab", "cd", "ef", "gh"] character(len=1), parameter :: c_pad(4) = [["ab", "cd"], [["ef"], "gh"]] character(len=5), parameter :: d_pad(4) = [["ab", "cd"], [["ef"], "gh"]] if (len(a_pad) /= 1) error stop if (len(b_pad) /= 5) error stop if (len(c_pad) /= 1) error stop if (len(d_pad) /= 5) error stop end program lfortran-0.63.0/integration_tests/bindc_iso_fb_04.f900000664000175000017500000002605215174404631022615 0ustar alastairalastair! Consolidated ISO_Fortran_binding test: CFI Library Functions, Header Validation & Errors ! Merged from: bindc_33, bindc_36, bindc_37, bindc_41 ! --- Module from bindc_33 --- module bindc_33_mod use iso_c_binding implicit none type, bind(C) :: pair_t integer(c_int32_t) :: x, y end type interface integer(c_int) function c33_test_address_1d(a) bind(C) import :: c_int, c_int32_t integer(c_int32_t), intent(in) :: a(:) end function integer(c_int) function c33_test_address_2d(a) bind(C) import :: c_int, c_int32_t integer(c_int32_t), intent(in) :: a(:,:) end function integer(c_int) function c33_check_contiguous(a) bind(C) import :: c_int, c_int32_t integer(c_int32_t), pointer, intent(in) :: a(:) end function integer(c_int) function c33_test_section(a) bind(C) import :: c_int, c_int32_t integer(c_int32_t), intent(in) :: a(:) end function integer(c_int) function c33_test_select_part(a) bind(C) import :: c_int, pair_t type(pair_t), intent(in) :: a(:) end function end interface end module ! --- Module from bindc_36 --- module bindc_36_types use iso_c_binding implicit none type, bind(C) :: pair_t_36 integer(c_int32_t) :: x, y end type end module ! --- Module from bindc_37 --- module bindc_37_types use iso_c_binding implicit none type, bind(C) :: pair_t_37 integer(c_int32_t) :: x, y end type end module ! --- Module from bindc_41 --- module bindc_41_ifaces use iso_c_binding implicit none interface integer(c_int) function c41_test_establish_errors() bind(C) import :: c_int end function integer(c_int) function c41_test_allocate_errors() bind(C) import :: c_int end function integer(c_int) function c41_test_deallocate_errors() bind(C) import :: c_int end function integer(c_int) function c41_test_section_errors() bind(C) import :: c_int end function integer(c_int) function c41_test_setpointer_errors() bind(C) import :: c_int end function integer(c_int) function c41_test_select_part_errors() bind(C) import :: c_int end function integer(c_int) function c41_test_address_errors() bind(C) import :: c_int end function end interface end module program bindc_iso_fb_04 use iso_c_binding use bindc_33_mod use bindc_36_types use bindc_37_types use bindc_41_ifaces implicit none ! --- Interfaces from bindc_36 (inline in original program) --- interface integer(c_int) function c36_check_max_rank() bind(c) import :: c_int end function integer(c_int) function c36_check_version() bind(c) import :: c_int end function integer(c_int) function c36_check_type_macros() bind(c) import :: c_int end function integer(c_int) function c36_check_error_codes() bind(c) import :: c_int end function integer(c_int) function c36_get_cfi_type(a) bind(c) import :: c_int type(*), dimension(..) :: a end function integer(c_int) function c36_expected_int32() bind(c) import :: c_int end function integer(c_int) function c36_expected_float() bind(c) import :: c_int end function integer(c_int) function c36_expected_double() bind(c) import :: c_int end function integer(c_int) function c36_expected_float_complex() bind(c) import :: c_int end function integer(c_int) function c36_expected_double_complex() bind(c) import :: c_int end function integer(c_int) function c36_expected_bool() bind(c) import :: c_int end function integer(c_int) function c36_expected_char() bind(c) import :: c_int end function integer(c_int) function c36_expected_struct() bind(c) import :: c_int end function integer(c_int) function c36_test_error_establish() bind(c) import :: c_int end function integer(c_int) function c36_test_error_allocate() bind(c) import :: c_int end function integer(c_int) function c36_test_error_deallocate() bind(c) import :: c_int end function end interface ! --- Interfaces from bindc_37 (inline in original program) --- interface integer(c_int) function c37_check_char_2d(arr) bind(c) import :: c_int, c_char character(kind=c_char, len=1), intent(in) :: arr(:,:) end function integer(c_int) function c37_section_2d(a) bind(c) import :: c_int, c_int32_t integer(c_int32_t), intent(in) :: a(:,:) end function integer(c_int) function c37_check_rank15(a) bind(c) import :: c_int, c_int32_t integer(c_int32_t), intent(in) :: a(..) end function subroutine c37_scalar_from_c(val) bind(c) import :: c_int32_t integer(c_int32_t), allocatable, intent(out) :: val end subroutine end interface ! ===== Tests from bindc_33 ===== call test_address() call test_contiguous() call test_section() call test_select_part() ! ===== Tests from bindc_36 ===== if (c36_check_max_rank() /= 1) error stop "FAIL: CFI_MAX_RANK" if (c36_check_version() /= 1) error stop "FAIL: CFI_VERSION" if (c36_check_type_macros() /= 1) error stop "FAIL: CFI type macros" if (c36_check_error_codes() /= 1) error stop "FAIL: CFI error codes" call test_type_codes() if (c36_test_error_establish() /= 1) error stop "FAIL: CFI_establish errors" if (c36_test_error_allocate() /= 1) error stop "FAIL: CFI_allocate errors" if (c36_test_error_deallocate() /= 1) error stop "FAIL: CFI_deallocate errors" ! ===== Tests from bindc_37 ===== call test_char_2d() call test_section_2d() call test_rank15() call test_scalar_from_c() call test_cf_pointer_lbounds() ! ===== Tests from bindc_41 ===== if (c41_test_establish_errors() /= 1) error stop "FAIL: establish errors" if (c41_test_allocate_errors() /= 1) error stop "FAIL: allocate errors" if (c41_test_deallocate_errors() /= 1) error stop "FAIL: deallocate errors" if (c41_test_section_errors() /= 1) error stop "FAIL: section errors" if (c41_test_setpointer_errors() /= 1) error stop "FAIL: setpointer errors" if (c41_test_select_part_errors() /= 1) error stop "FAIL: select_part errors" if (c41_test_address_errors() /= 1) error stop "FAIL: address errors" print *, "All bindc_iso_fb_04 tests passed." contains ! ===== Subroutines from bindc_33 ===== subroutine test_address() integer(c_int32_t) :: a1(5) integer(c_int32_t) :: a2(3, 4) integer :: i, j do i = 1, 5 a1(i) = i * 10 end do do j = 1, 4 do i = 1, 3 a2(i, j) = i + (j - 1) * 3 end do end do if (c33_test_address_1d(a1) /= 0) error stop "FAIL: CFI_address 1D" if (c33_test_address_2d(a2) /= 0) error stop "FAIL: CFI_address 2D" end subroutine subroutine test_contiguous() integer(c_int32_t), target :: a(10) integer(c_int32_t), pointer :: p(:) integer :: i do i = 1, 10 a(i) = i end do p => a(1:10) if (c33_check_contiguous(p) /= 1) error stop "FAIL: contiguous" p => a(1:10:2) if (c33_check_contiguous(p) /= 0) error stop "FAIL: non-contiguous" end subroutine subroutine test_section() integer(c_int32_t) :: a(10) integer :: i do i = 1, 10 a(i) = i * 10 end do if (c33_test_section(a) /= 0) error stop "FAIL: CFI_section" end subroutine subroutine test_select_part() type(pair_t) :: arr(3) arr(1) = pair_t(10, 100) arr(2) = pair_t(20, 200) arr(3) = pair_t(30, 300) if (c33_test_select_part(arr) /= 0) error stop "FAIL: CFI_select_part" end subroutine ! ===== Subroutines from bindc_36 ===== subroutine test_type_codes() integer(c_int32_t) :: arr_int(1) real(c_float) :: arr_float(1) real(c_double) :: arr_double(1) complex(c_float_complex) :: arr_fc(1) complex(c_double_complex) :: arr_dc(1) logical(c_bool) :: arr_bool(1) character(kind=c_char, len=1) :: arr_char(1) type(pair_t_36) :: arr_struct(1) if (c36_get_cfi_type(arr_int) /= c36_expected_int32()) & error stop "FAIL: type int32" if (c36_get_cfi_type(arr_float) /= c36_expected_float()) & error stop "FAIL: type float" if (c36_get_cfi_type(arr_double) /= c36_expected_double()) & error stop "FAIL: type double" if (c36_get_cfi_type(arr_fc) /= c36_expected_float_complex()) & error stop "FAIL: type float_Complex" if (c36_get_cfi_type(arr_dc) /= c36_expected_double_complex()) & error stop "FAIL: type double_Complex" if (c36_get_cfi_type(arr_bool) /= c36_expected_bool()) & error stop "FAIL: type Bool" if (c36_get_cfi_type(arr_char) /= c36_expected_char()) & error stop "FAIL: type char" if (c36_get_cfi_type(arr_struct) /= c36_expected_struct()) & error stop "FAIL: type struct" end subroutine ! ===== Subroutines from bindc_37 ===== subroutine test_char_2d() character(kind=c_char, len=1) :: grid(3, 2) grid(1,1) = 'A'; grid(2,1) = 'B'; grid(3,1) = 'C' grid(1,2) = 'D'; grid(2,2) = 'E'; grid(3,2) = 'F' if (c37_check_char_2d(grid) /= 1) error stop "FAIL: char 2D" end subroutine subroutine test_section_2d() integer(c_int32_t) :: mat(4, 4) integer :: i, j do j = 1, 4 do i = 1, 4 mat(i, j) = i * 10 + j end do end do if (c37_section_2d(mat) /= 1) error stop "FAIL: section 2D" end subroutine subroutine test_rank15() integer(c_int32_t) :: arr(2,2,2,2,2,2,2,2,2,2,2,2,2,2,2) arr = 1 if (c37_check_rank15(arr) /= 1) error stop "FAIL: rank 15" end subroutine subroutine test_scalar_from_c() integer(c_int32_t), allocatable :: val call c37_scalar_from_c(val) if (.not. allocated(val)) error stop "FAIL: scalar alloc" if (val /= 999) error stop "FAIL: scalar value" end subroutine subroutine test_cf_pointer_lbounds() integer(c_int32_t), target :: arr(6) integer(c_int32_t), pointer :: p(:) type(c_ptr) :: cptr arr = [10, 20, 30, 40, 50, 60] cptr = c_loc(arr(1)) call c_f_pointer(cptr, p, [6]) if (p(1) /= 10) error stop "FAIL: cf_ptr default lb" if (p(6) /= 60) error stop "FAIL: cf_ptr default ub" end subroutine end program lfortran-0.63.0/integration_tests/intrinsics_222.f900000664000175000017500000000176015174404631022463 0ustar alastairalastairprogram intrinsics_222 use, intrinsic :: iso_fortran_env, only: dp => real64 complex(8) :: a, b, c, d real(dp) :: expected(4) integer :: i real(dp), parameter :: result(4) = dreal([(1.0_8, 2.0_8), (-3.7280_8, 4.0_8), (-1.0_8, -1.0_8), (10.829_8, -189.0_8)]) expected = [1.0000000000000000_dp, -3.7280000000000000_dp, -1.0000000000000000_dp, 10.8290000000000000_dp] do i = 1, size(expected) print *, result(i) if (abs(result(i) - expected(i)) > 1e-12_dp) error stop end do a = (1.0_8, 2.0_8) b = (-3.7280_8, 4.0_8) c = (-1.0_8, -1.0_8) d = (10.829_8, -189.0_8) print *, dreal(a) if (abs(dreal(a) - 1.0000000000000000_dp) > 1e-12_dp) error stop print *, dreal(b) if (abs(dreal(b) + 3.7280000000000000_dp) > 1e-12_dp) error stop print *, dreal(c) if (abs(dreal(c) + 1.0000000000000000_dp) > 1e-12_dp) error stop print *, dreal(d) if (abs(dreal(d) - 10.8290000000000000_dp) > 1e-12_dp) error stop end programlfortran-0.63.0/integration_tests/gpu_metal_177.f900000664000175000017500000000171515174404631022264 0ustar alastairalastairmodule gpu_metal_177_m implicit none type :: data_t real, allocatable :: v(:) end type contains elemental function f(x) result(r) real, intent(in) :: x real :: r r = x * 2.0 end function pure function get_v(d) result(res) type(data_t), intent(in) :: d real, allocatable :: res(:) allocate(res(size(d%v))) res = d%v end function subroutine run(arr, n) type(data_t), intent(in) :: arr(:) integer, intent(in) :: n integer :: i real :: z(4), out(4) z = 1.0 out = 0.0 do concurrent (i = 1:size(arr)) associate(y => get_v(arr(i))) out(1:n) = f(z(1:n)) end associate end do print *, out(1), out(2) if (abs(out(1) - 2.0) > 1e-6) error stop if (abs(out(2) - 2.0) > 1e-6) error stop end subroutine end module program gpu_metal_177 use gpu_metal_177_m type(data_t) :: arr(2) arr(1) = data_t([1.0, 2.0]) arr(2) = data_t([3.0, 4.0]) call run(arr, 2) end program lfortran-0.63.0/integration_tests/dealloc_03.f900000664000175000017500000000075715174404631021623 0ustar alastairalastairprogram dealloc_03 implicit none type :: toml_value integer :: x end type class(toml_value), allocatable :: tmp allocate(tmp) tmp%x = 42 print *, "Value of x in tmp:", tmp%x call new_table(tmp) print *, "Value of x in tmp after new_table call:", tmp%x if (tmp%x /= 0) error stop contains subroutine new_table(self) class(toml_value), allocatable, intent(out) :: self allocate(self) self%x = 0 end subroutine new_table end program lfortran-0.63.0/integration_tests/interface_03.f900000664000175000017500000000076315174404631022155 0ustar alastairalastairprogram interface_03 implicit none interface subroutine a1(a) integer, intent(inout) :: a end subroutine end interface interface subroutine a2(a) integer, intent(inout) :: a end subroutine subroutine a3(a) real, intent(inout) :: a end subroutine end interface procedure(a1) :: sub contains subroutine X() interface subroutine a4(a) integer, intent(inout) :: a end subroutine end interface end subroutine end program lfortran-0.63.0/integration_tests/gpu_metal_92.f900000664000175000017500000000175115174404631022200 0ustar alastairalastair! Test: calling an internal function (in contains) with a derived type ! argument containing an allocatable array member, from do concurrent. ! Verifies that the Metal codegen correctly passes allocatable member ! data pointers when emitting function/subroutine calls with struct-typed ! arguments inside GPU kernels. program gpu_metal_92 implicit none type :: tensor_t real, allocatable :: values_(:) end type integer :: i type(tensor_t) :: arr(4) real :: out(4) arr(1) = tensor_t([10.0]) arr(2) = tensor_t([20.0]) arr(3) = tensor_t([30.0]) arr(4) = tensor_t([40.0]) do concurrent (i = 1:4) out(i) = get_first(arr(i)) end do if (abs(out(1) - 10.0) > 1e-5) error stop if (abs(out(2) - 20.0) > 1e-5) error stop if (abs(out(3) - 30.0) > 1e-5) error stop if (abs(out(4) - 40.0) > 1e-5) error stop print *, "PASS" contains pure function get_first(x) result(r) type(tensor_t), intent(in) :: x real :: r r = x%values_(1) end function end program lfortran-0.63.0/integration_tests/submodule_38a.f900000664000175000017500000000064015174404631022357 0ustar alastairalastairprogram submodule_38 use submodule_38_mod, only : child_t implicit none type(child_t) :: c double precision :: v(3) double precision, allocatable :: r(:) c%k_ = 2 v = [1.0d0, 2.0d0, 3.0d0] r = c .x. v if (size(r) /= 3) error stop if (abs(r(1) - 2.0d0) > 1.0d-10) error stop if (abs(r(2) - 4.0d0) > 1.0d-10) error stop if (abs(r(3) - 6.0d0) > 1.0d-10) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/allocatable_derived_array_01.f900000664000175000017500000000232415174404631025351 0ustar alastairalastairmodule hashmap_wrappers_01 implicit none type :: key_type integer(1), allocatable :: value(:) end type key_type end module hashmap_wrappers_01 module hashmap_chaining_01 use hashmap_wrappers_01 implicit none type(key_type) :: prev_keys_inverse(1024) integer(4), allocatable :: duplicate_key_entries(:) end module hashmap_chaining_01 module test_chaining_maps_01 use hashmap_chaining_01 implicit none contains subroutine allocater() integer :: i do i = 1, 1024 allocate(prev_keys_inverse(i)%value(16)) end do end subroutine subroutine deallocater() integer :: i do i = 1, 1024 deallocate(prev_keys_inverse(i)%value) end do end subroutine end module program allocatable_derived_array_01 use test_chaining_maps_01 implicit none call allocater() if (.not. allocated(prev_keys_inverse(1)%value)) error stop if (size(prev_keys_inverse(1)%value) /= 16) error stop if (.not. allocated(prev_keys_inverse(1024)%value)) error stop call deallocater() if (allocated(prev_keys_inverse(1)%value)) error stop if (allocated(prev_keys_inverse(1024)%value)) error stop end program lfortran-0.63.0/integration_tests/implicit_interface_22.f900000664000175000017500000000122715174404631024044 0ustar alastairalastairmodule implicit_interface_22_mod implicit none interface generic_sub module procedure real_sub end interface contains subroutine real_sub(f, n) integer, intent(in) :: n interface subroutine f(x) real, intent(in) :: x end subroutine end interface real :: x x = 1.0 call f(x) if (n /= 3) error stop print *, "real_sub called with n =", n end subroutine end module program test use implicit_interface_22_mod implicit none external :: my_f call generic_sub(my_f, 3) print *, "PASS" end program subroutine my_f(x) real, intent(in) :: x print *, "my_f called with x =", x end subroutine lfortran-0.63.0/integration_tests/gpu_metal_152.f900000664000175000017500000000341415174404631022253 0ustar alastairalastair! Test: submodule struct constructor returning a derived type with array argument, ! called from do concurrent. Exercises two fixes: ! 1. types_equal() must compare GPU-duplicated StructTypes structurally, ! not by pointer identity. ! 2. pass_array_by_data must clean up stale ExternalSymbols in GPU kernel scopes. module gpu_metal_152_m implicit none type :: result_t real :: val end type interface result_t pure module function construct(v) result(r) real, intent(in) :: v(:) type(result_t) :: r end function end interface interface elemental module function do_work(self, x) result(out) type(result_t), intent(in) :: self real, intent(in) :: x type(result_t) :: out end function end interface end module submodule(gpu_metal_152_m) gpu_metal_152_impl implicit none contains pure module function construct(v) result(r) real, intent(in) :: v(:) type(result_t) :: r integer :: i r%val = 0.0 do i = 1, size(v) r%val = r%val + v(i) end do end function module procedure do_work out%val = self%val + x end procedure end submodule program gpu_metal_152 use gpu_metal_152_m, only: result_t, do_work implicit none integer, parameter :: n = 4 type(result_t) :: inputs(n), outputs(n) real :: vals(n) integer :: i vals = [1.0, 2.0, 3.0, 4.0] do i = 1, n inputs(i)%val = real(i) end do do concurrent(i = 1:n) outputs(i) = do_work(inputs(i), vals(i)) end do ! do_work(inputs(i), vals(i)) = inputs(i)%val + vals(i) = i + i = 2*i if (abs(outputs(1)%val - 2.0) > 1e-5) error stop if (abs(outputs(2)%val - 4.0) > 1e-5) error stop if (abs(outputs(3)%val - 6.0) > 1e-5) error stop if (abs(outputs(4)%val - 8.0) > 1e-5) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/complex_18.f900000664000175000017500000000216015174404631021663 0ustar alastairalastairprogram complex_18 implicit none complex(4), target :: my_complex1(2, 3) complex(8), target :: my_complex2(2, 3) integer :: i, j, k k = 1 do i = 1, 2 do j = 1, 3 my_complex1(i, j) = complex(k, k + 1) my_complex2(i, j) = complex(k, k + 1) k = k + 2 end do end do print *, my_complex1 if (abs(my_complex1(1, 1) - (1, 2)) > 1e-5) error stop if (abs(my_complex1(1, 2) - (3, 4)) > 1e-5) error stop if (abs(my_complex1(1, 3) - (5, 6)) > 1e-5) error stop if (abs(my_complex1(2, 1) - (7, 8)) > 1e-5) error stop if (abs(my_complex1(2, 2) - (9, 10)) > 1e-5) error stop if (abs(my_complex1(2, 3) - (11, 12)) > 1e-5) error stop print *, my_complex2 if (abs(my_complex2(1, 1) - (1, 2)) > 1e-8_8) error stop if (abs(my_complex2(1, 2) - (3, 4)) > 1e-8_8) error stop if (abs(my_complex2(1, 3) - (5, 6)) > 1e-8_8) error stop if (abs(my_complex2(2, 1) - (7, 8)) > 1e-8_8) error stop if (abs(my_complex2(2, 2) - (9, 10)) > 1e-8_8) error stop if (abs(my_complex2(2, 3) - (11, 12)) > 1e-8_8) error stop end program lfortran-0.63.0/integration_tests/string_16.f900000664000175000017500000000707515174404631021532 0ustar alastairalastairprogram string_16 implicit none character, parameter :: exclamation_1 = achar(33) character, parameter :: dollar_1 = achar(36) character, parameter :: left_parenthesis_1 = achar(40) character, parameter :: plus_1 = achar(43) character, parameter :: zero_1 = achar(48) character, parameter :: nine_1 = achar(57) character, parameter :: semicolon_1 = achar(59) character, parameter :: capital_a_1 = achar(65) character, parameter :: capital_z_1 = achar(90) character, parameter :: right_bracket_1 = achar(93) character, parameter :: small_a_1 = achar(97) character, parameter :: small_z_1 = achar(122) character, parameter :: right_brace_1 = achar(125) character, parameter :: str_i8 = achar(125_8) character, parameter :: ar1(5) = achar([33, 36, 40, 43, 48]) character, parameter :: ar2(5) = achar([57, 59, 65, 90, 93], 1) character :: exclamation character :: dollar character :: left_parenthesis character :: plus character :: zero character :: nine character :: semicolon character :: capital_a character :: capital_z character :: right_bracket character :: small_a character :: small_z character :: right_brace integer :: a1 = 35 integer(8) :: a3 = 12872_8 integer :: a2(3) = [39, 63, 66] exclamation = achar(33) dollar = achar(36) left_parenthesis = achar(40) plus = achar(43) zero = achar(48) nine = achar(57) semicolon = achar(59) capital_a = achar(65) capital_z = achar(90) right_bracket = achar(93) small_a = achar(97) small_z = achar(122) right_brace = achar(125) print *, exclamation_1 if (exclamation_1 /= '!') error stop print *, dollar_1 if (dollar_1 /= '$') error stop print *, left_parenthesis_1 if (left_parenthesis_1 /= '(') error stop print *, plus_1 if (plus_1 /= '+') error stop print *, zero_1 if (zero_1 /= '0') error stop print *, nine_1 if (nine_1 /= '9') error stop print *, semicolon_1 if (semicolon_1 /= ';') error stop print *, capital_a_1 if (capital_a_1 /= 'A') error stop print *, capital_z_1 if (capital_z_1 /= 'Z') error stop print *, right_bracket_1 if (right_bracket_1 /= ']') error stop print *, small_a_1 if (small_a_1 /= 'a') error stop print *, small_z_1 if (small_z_1 /= 'z') error stop print *, right_brace_1 if (right_brace_1 /= '}') error stop print *, str_i8 if (str_i8 /= '}') error stop print *, ar1 if (any(ar1 /= ['!', '$', '(', '+', '0'])) error stop print *, ar2 if (any(ar2 /= ['9', ';', 'A', 'Z', ']'])) error stop print*, achar(65) if (achar(65) /= 'A') error stop print*, achar(a1) if (achar(a1) /= '#') error stop print*, achar(a2) if (achar(a2(1)) /= "'") error stop if (achar(a2(2)) /= '?') error stop if (achar(a2(3)) /= 'B') error stop print *, achar(a3) if (achar(a3) /= 'H') error stop if(exclamation /= '!') error stop if(dollar /= '$') error stop if(left_parenthesis /= '(') error stop if(plus /= '+') error stop if(zero /= '0') error stop if(nine /= '9') error stop if(semicolon /= ';') error stop if(capital_a /= 'A') error stop if(capital_z /= 'Z') error stop if(right_bracket /= ']') error stop if(small_a /= 'a') error stop if(small_z /= 'z') error stop if(right_brace /= '}') error stop print *, exclamation, dollar, left_parenthesis, plus, zero, nine, semicolon print *, capital_a, capital_z, right_bracket, small_a, small_z, right_brace end program lfortran-0.63.0/integration_tests/bindc_iso_fb_02.f900000664000175000017500000005777715174404631022635 0ustar alastairalastair! Consolidated ISO_Fortran_binding test: Allocatable, Pointer & CFI Allocation/Setpointer ! Merged from: bindc_20, bindc_28, bindc_30, bindc_31, bindc_32 ! ! bindc_20: Multi-rank allocatable/pointer, scalar alloc/ptr, intent(out/inout) ! bindc_28: Attribute combinations and array features (float, double, int64, ! complex, logical, zero-size, unallocated, rank-4, explicit-shape, ! optional+contiguous) ! bindc_30: Character alloc/ptr, allocatable+assumed-rank, pointer+assumed-rank ! bindc_31: C creates allocatable arrays via CFI_allocate and passes to Fortran ! bindc_32: C creates pointer associations via CFI_setpointer and passes to Fortran ! ============================================================================ ! Module from bindc_20 ! ============================================================================ module bindc_20_mod use iso_c_binding, only: c_int, c_int32_t implicit none interface ! ---- allocatable 2D ---- integer(c_int32_t) function c20_sum_alloc_2d(a) & bind(C, name="c20_sum_alloc_2d") import :: c_int32_t integer(c_int32_t), allocatable, intent(in) :: a(:,:) end function integer(c_int) function c20_attr_alloc_2d(a) & bind(C, name="c20_attr_alloc_2d") import :: c_int, c_int32_t integer(c_int32_t), allocatable, intent(in) :: a(:,:) end function subroutine c20_double_alloc_2d(a) bind(C, name="c20_double_alloc_2d") import :: c_int32_t integer(c_int32_t), allocatable, intent(inout) :: a(:,:) end subroutine ! ---- allocatable 3D ---- integer(c_int32_t) function c20_sum_alloc_3d(a) & bind(C, name="c20_sum_alloc_3d") import :: c_int32_t integer(c_int32_t), allocatable, intent(in) :: a(:,:,:) end function ! ---- pointer 2D ---- integer(c_int32_t) function c20_sum_ptr_2d(a) & bind(C, name="c20_sum_ptr_2d") import :: c_int32_t integer(c_int32_t), pointer, intent(in) :: a(:,:) end function integer(c_int) function c20_attr_ptr_2d(a) & bind(C, name="c20_attr_ptr_2d") import :: c_int, c_int32_t integer(c_int32_t), pointer, intent(in) :: a(:,:) end function ! ---- pointer 3D ---- integer(c_int32_t) function c20_sum_ptr_3d(a) & bind(C, name="c20_sum_ptr_3d") import :: c_int32_t integer(c_int32_t), pointer, intent(in) :: a(:,:,:) end function ! ---- pointer with intent(inout): C doubles values ---- subroutine c20_double_ptr_1d(a) bind(C, name="c20_double_ptr_1d") import :: c_int32_t integer(c_int32_t), pointer, intent(inout) :: a(:) end subroutine ! ---- allocatable scalar ---- integer(c_int32_t) function c20_read_alloc_scalar(x) & bind(C, name="c20_read_alloc_scalar") import :: c_int32_t integer(c_int32_t), allocatable, intent(in) :: x end function integer(c_int) function c20_attr_alloc_scalar(x) & bind(C, name="c20_attr_alloc_scalar") import :: c_int, c_int32_t integer(c_int32_t), allocatable, intent(in) :: x end function ! ---- pointer scalar ---- integer(c_int32_t) function c20_read_ptr_scalar(x) & bind(C, name="c20_read_ptr_scalar") import :: c_int32_t integer(c_int32_t), pointer, intent(in) :: x end function integer(c_int) function c20_attr_ptr_scalar(x) & bind(C, name="c20_attr_ptr_scalar") import :: c_int, c_int32_t integer(c_int32_t), pointer, intent(in) :: x end function end interface end module ! ============================================================================ ! Module from bindc_28 ! ============================================================================ module bindc_28_mod use iso_c_binding, only: c_int, c_int32_t, c_int64_t, c_float, & c_double, c_bool, c_float_complex implicit none interface ! ---- allocatable float array ---- real(c_float) function c28_sum_alloc_float(a) & bind(C, name="c28_sum_alloc_float") import :: c_float real(c_float), allocatable, intent(in) :: a(:) end function ! ---- allocatable double array ---- real(c_double) function c28_sum_alloc_double(a) & bind(C, name="c28_sum_alloc_double") import :: c_double real(c_double), allocatable, intent(in) :: a(:) end function ! ---- allocatable int64 array ---- integer(c_int64_t) function c28_sum_alloc_int64(a) & bind(C, name="c28_sum_alloc_int64") import :: c_int64_t integer(c_int64_t), allocatable, intent(in) :: a(:) end function ! ---- allocatable complex array ---- subroutine c28_sum_alloc_complex(a, re, im) & bind(C, name="c28_sum_alloc_complex") import :: c_float_complex, c_float complex(c_float_complex), allocatable, intent(in) :: a(:) real(c_float), intent(out) :: re, im end subroutine ! ---- allocatable logical array ---- integer(c_int) function c28_count_alloc_bool(a) & bind(C, name="c28_count_alloc_bool") import :: c_int, c_bool logical(c_bool), allocatable, intent(in) :: a(:) end function ! ---- pointer float array ---- real(c_float) function c28_sum_ptr_float(a) & bind(C, name="c28_sum_ptr_float") import :: c_float real(c_float), pointer, intent(in) :: a(:) end function ! ---- pointer double array ---- real(c_double) function c28_sum_ptr_double(a) & bind(C, name="c28_sum_ptr_double") import :: c_double real(c_double), pointer, intent(in) :: a(:) end function ! ---- pointer int64 array ---- integer(c_int64_t) function c28_sum_ptr_int64(a) & bind(C, name="c28_sum_ptr_int64") import :: c_int64_t integer(c_int64_t), pointer, intent(in) :: a(:) end function ! ---- zero-size array ---- integer(c_int) function c28_zero_size_extent(a) & bind(C, name="c28_zero_size_extent") import :: c_int, c_int32_t integer(c_int32_t), intent(in) :: a(:) end function ! ---- unallocated allocatable ---- integer(c_int) function c28_is_allocated(a) & bind(C, name="c28_is_allocated") import :: c_int, c_int32_t integer(c_int32_t), allocatable, intent(in) :: a(:) end function ! ---- disassociated pointer ---- integer(c_int) function c28_is_associated(a) & bind(C, name="c28_is_associated") import :: c_int, c_int32_t integer(c_int32_t), pointer, intent(in) :: a(:) end function ! ---- rank 4 array ---- integer(c_int32_t) function c28_sum_4d(a) & bind(C, name="c28_sum_4d") import :: c_int32_t integer(c_int32_t), intent(in) :: a(:,:,:,:) end function integer(c_int) function c28_get_rank_4d(a) & bind(C, name="c28_get_rank_4d") import :: c_int, c_int32_t integer(c_int32_t), intent(in) :: a(:,:,:,:) end function ! ---- explicit-shape in bind(C) ---- integer(c_int32_t) function c28_sum_explicit(a, n) & bind(C, name="c28_sum_explicit") import :: c_int32_t, c_int integer(c_int), value :: n integer(c_int32_t), intent(in) :: a(n) end function ! ---- optional + contiguous ---- integer(c_int32_t) function c28_opt_contig_sum(a) & bind(C, name="c28_opt_contig_sum") import :: c_int32_t integer(c_int32_t), optional, contiguous, intent(in) :: a(:) end function end interface end module ! ============================================================================ ! Module from bindc_30 ! ============================================================================ module bindc_30_mod use iso_c_binding, only: c_int, c_int32_t, c_char implicit none interface ! ---- character allocatable array ---- integer(c_int) function c30_char_alloc_sum(a) & bind(C, name="c30_char_alloc_sum") import :: c_int, c_char character(kind=c_char, len=:), allocatable, intent(in) :: a(:) end function integer(c_int) function c30_char_alloc_attr(a) & bind(C, name="c30_char_alloc_attr") import :: c_int, c_char character(kind=c_char, len=:), allocatable, intent(in) :: a(:) end function ! ---- character pointer array ---- integer(c_int) function c30_char_ptr_sum(a) & bind(C, name="c30_char_ptr_sum") import :: c_int, c_char character(kind=c_char, len=:), pointer, intent(in) :: a(:) end function integer(c_int) function c30_char_ptr_attr(a) & bind(C, name="c30_char_ptr_attr") import :: c_int, c_char character(kind=c_char, len=:), pointer, intent(in) :: a(:) end function ! ---- allocatable + assumed-rank ---- integer(c_int) function c30_alloc_ar_rank(a) & bind(C, name="c30_alloc_ar_rank") import :: c_int, c_int32_t integer(c_int32_t), allocatable, intent(in) :: a(..) end function ! ---- pointer + assumed-rank ---- integer(c_int) function c30_ptr_ar_rank(a) & bind(C, name="c30_ptr_ar_rank") import :: c_int, c_int32_t integer(c_int32_t), pointer, intent(in) :: a(..) end function end interface end module ! ============================================================================ ! Module from bindc_31 ! ============================================================================ module bindc_31_mod use iso_c_binding implicit none contains integer(c_int) function f31_is_allocated(a) bind(C) integer(c_int32_t), allocatable, intent(in) :: a(:) f31_is_allocated = 0 if (allocated(a)) f31_is_allocated = 1 end function integer(c_int32_t) function f31_sum_1d(a) bind(C) integer(c_int32_t), allocatable, intent(in) :: a(:) f31_sum_1d = sum(a) end function integer(c_int) function f31_size_1d(a) bind(C) integer(c_int32_t), allocatable, intent(in) :: a(:) f31_size_1d = size(a) end function integer(c_int) function f31_lbound_1d(a) bind(C) integer(c_int32_t), allocatable, intent(in) :: a(:) f31_lbound_1d = lbound(a, 1) end function integer(c_int) function f31_ubound_1d(a) bind(C) integer(c_int32_t), allocatable, intent(in) :: a(:) f31_ubound_1d = ubound(a, 1) end function integer(c_int32_t) function f31_get_elem(a, idx) bind(C) integer(c_int32_t), allocatable, intent(in) :: a(:) integer(c_int), value, intent(in) :: idx f31_get_elem = a(idx) end function integer(c_int32_t) function f31_sum_2d(a) bind(C) integer(c_int32_t), allocatable, intent(in) :: a(:,:) f31_sum_2d = sum(a) end function integer(c_int) function f31_2d_shape_ok(a, n1, n2) bind(C) integer(c_int32_t), allocatable, intent(in) :: a(:,:) integer(c_int), value, intent(in) :: n1, n2 f31_2d_shape_ok = 0 if (size(a, 1) == n1 .and. size(a, 2) == n2) f31_2d_shape_ok = 1 end function real(c_double) function f31_sum_double(a) bind(C) real(c_double), allocatable, intent(in) :: a(:) f31_sum_double = sum(a) end function subroutine f31_alloc_fill(a) bind(C) integer(c_int32_t), allocatable, intent(out) :: a(:) allocate(a(3)) a = [10, 20, 30] end subroutine subroutine f31_realloc(a) bind(C) integer(c_int32_t), allocatable, intent(inout) :: a(:) if (allocated(a)) deallocate(a) allocate(a(5)) a = [100, 200, 300, 400, 500] end subroutine end module ! ============================================================================ ! Module from bindc_32 ! ============================================================================ module bindc_32_mod use iso_c_binding implicit none contains integer(c_int) function f32_is_associated(a) bind(C) integer(c_int32_t), pointer, intent(in) :: a(:) f32_is_associated = 0 if (associated(a)) f32_is_associated = 1 end function integer(c_int32_t) function f32_sum_1d(a) bind(C) integer(c_int32_t), pointer, intent(in) :: a(:) f32_sum_1d = sum(a) end function integer(c_int) function f32_lbound_1d(a) bind(C) integer(c_int32_t), pointer, intent(in) :: a(:) f32_lbound_1d = lbound(a, 1) end function integer(c_int) function f32_ubound_1d(a) bind(C) integer(c_int32_t), pointer, intent(in) :: a(:) f32_ubound_1d = ubound(a, 1) end function integer(c_int32_t) function f32_sum_2d(a) bind(C) integer(c_int32_t), pointer, intent(in) :: a(:,:) f32_sum_2d = sum(a) end function subroutine f32_double_values(a) bind(C) integer(c_int32_t), pointer, intent(inout) :: a(:) a = a * 2 end subroutine end module ! ============================================================================ ! Main program ! ============================================================================ program bindc_iso_fb_02 use bindc_20_mod use bindc_28_mod use bindc_30_mod use bindc_31_mod use bindc_32_mod use iso_c_binding implicit none interface integer(c_int) function c31_run_tests() bind(C) import :: c_int end function integer(c_int) function c32_run_tests() bind(C) import :: c_int end function end interface integer(c_int) :: res ! --- Tests from bindc_20 --- call test_alloc_2d() call test_alloc_3d() call test_ptr_2d() call test_ptr_3d() call test_ptr_inout() call test_alloc_scalar() call test_ptr_scalar() ! --- Tests from bindc_28 --- call test_alloc_float() call test_alloc_double() call test_alloc_int64() call test_alloc_complex() call test_alloc_bool() call test_ptr_float() call test_ptr_double() call test_ptr_int64() call test_zero_size() call test_unallocated() call test_disassociated() call test_rank4() call test_explicit_shape() call test_opt_contig() ! --- Tests from bindc_30 --- call test_char_alloc() call test_char_ptr() call test_alloc_ar() call test_ptr_ar() ! --- Tests from bindc_31 (C-driven CFI_allocate tests) --- res = c31_run_tests() if (res /= 0) then print *, "C test failed with code:", res error stop "FAIL: C allocatable tests failed" end if ! --- Tests from bindc_32 (C-driven CFI_setpointer tests) --- res = c32_run_tests() if (res /= 0) then print *, "C test failed with code:", res error stop "FAIL: C pointer tests failed" end if print *, "All bindc_iso_fb_02 tests passed." contains ! ======================================================================== ! Test subroutines from bindc_20 ! ======================================================================== subroutine test_alloc_2d() integer(c_int32_t), allocatable :: a(:,:) allocate(a(2,3)) a = reshape([1, 2, 3, 4, 5, 6], [2, 3]) if (c20_sum_alloc_2d(a) /= 21) error stop "FAIL: alloc 2d sum" if (c20_attr_alloc_2d(a) /= 1) error stop "FAIL: alloc 2d attr" call c20_double_alloc_2d(a) if (a(1,1) /= 2 .or. a(2,3) /= 12) error stop "FAIL: alloc 2d double" if (c20_sum_alloc_2d(a) /= 42) error stop "FAIL: alloc 2d double sum" deallocate(a) end subroutine subroutine test_alloc_3d() integer(c_int32_t), allocatable :: a(:,:,:) integer :: i allocate(a(2,3,2)) a = reshape([(i, i=1,12)], [2, 3, 2]) if (c20_sum_alloc_3d(a) /= 78) error stop "FAIL: alloc 3d sum" deallocate(a) end subroutine subroutine test_ptr_2d() integer(c_int32_t), target :: tgt(2,3) integer(c_int32_t), pointer :: p(:,:) tgt = reshape([10, 20, 30, 40, 50, 60], [2, 3]) p => tgt if (c20_sum_ptr_2d(p) /= 210) error stop "FAIL: ptr 2d sum" if (c20_attr_ptr_2d(p) /= 1) error stop "FAIL: ptr 2d attr" end subroutine subroutine test_ptr_3d() integer(c_int32_t), target :: tgt(2,3,2) integer(c_int32_t), pointer :: p(:,:,:) integer :: i tgt = reshape([(i*10, i=1,12)], [2, 3, 2]) p => tgt if (c20_sum_ptr_3d(p) /= 780) error stop "FAIL: ptr 3d sum" end subroutine subroutine test_ptr_inout() integer(c_int32_t), target :: tgt(4) integer(c_int32_t), pointer :: p(:) tgt = [1, 2, 3, 4] p => tgt call c20_double_ptr_1d(p) if (tgt(1) /= 2 .or. tgt(4) /= 8) error stop "FAIL: ptr inout" end subroutine subroutine test_alloc_scalar() integer(c_int32_t), allocatable :: x allocate(x) x = 42 if (c20_read_alloc_scalar(x) /= 42) error stop "FAIL: alloc scalar read" ! TODO: LFortran bug - alloc scalar attr not set correctly ! if (c20_attr_alloc_scalar(x) /= 1) error stop "FAIL: alloc scalar attr" deallocate(x) end subroutine subroutine test_ptr_scalar() integer(c_int32_t), target :: tgt integer(c_int32_t), pointer :: p tgt = 99 p => tgt if (c20_read_ptr_scalar(p) /= 99) error stop "FAIL: ptr scalar read" ! TODO: LFortran bug - ptr scalar attr not set correctly ! if (c20_attr_ptr_scalar(p) /= 1) error stop "FAIL: ptr scalar attr" end subroutine ! ======================================================================== ! Test subroutines from bindc_28 ! ======================================================================== subroutine test_alloc_float() real(c_float), allocatable :: a(:) allocate(a(3)) a = [1.0, 2.0, 3.0] if (abs(c28_sum_alloc_float(a) - 6.0) > 1.0e-5) & error stop "FAIL: alloc float sum" deallocate(a) end subroutine subroutine test_alloc_double() real(c_double), allocatable :: a(:) allocate(a(3)) a = [1.0d0, 2.0d0, 3.0d0] if (abs(c28_sum_alloc_double(a) - 6.0d0) > 1.0d-10) & error stop "FAIL: alloc double sum" deallocate(a) end subroutine subroutine test_alloc_int64() integer(c_int64_t), allocatable :: a(:) allocate(a(3)) a = [10_c_int64_t, 20_c_int64_t, 30_c_int64_t] if (c28_sum_alloc_int64(a) /= 60_c_int64_t) & error stop "FAIL: alloc int64 sum" deallocate(a) end subroutine subroutine test_alloc_complex() complex(c_float_complex), allocatable :: a(:) real(c_float) :: re, im allocate(a(2)) a = [(1.0, 2.0), (3.0, 4.0)] call c28_sum_alloc_complex(a, re, im) if (abs(re - 4.0) > 1.0e-5) error stop "FAIL: alloc complex re" if (abs(im - 6.0) > 1.0e-5) error stop "FAIL: alloc complex im" deallocate(a) end subroutine subroutine test_alloc_bool() logical(c_bool), allocatable :: a(:) allocate(a(5)) a = [.true., .false., .true., .true., .false.] if (c28_count_alloc_bool(a) /= 3) error stop "FAIL: alloc bool count" deallocate(a) end subroutine subroutine test_ptr_float() real(c_float), target :: tgt(3) real(c_float), pointer :: p(:) tgt = [10.0, 20.0, 30.0] p => tgt if (abs(c28_sum_ptr_float(p) - 60.0) > 1.0e-5) & error stop "FAIL: ptr float sum" end subroutine subroutine test_ptr_double() real(c_double), target :: tgt(3) real(c_double), pointer :: p(:) tgt = [10.0d0, 20.0d0, 30.0d0] p => tgt if (abs(c28_sum_ptr_double(p) - 60.0d0) > 1.0d-10) & error stop "FAIL: ptr double sum" end subroutine subroutine test_ptr_int64() integer(c_int64_t), target :: tgt(3) integer(c_int64_t), pointer :: p(:) tgt = [100_c_int64_t, 200_c_int64_t, 300_c_int64_t] p => tgt if (c28_sum_ptr_int64(p) /= 600_c_int64_t) & error stop "FAIL: ptr int64 sum" end subroutine subroutine test_zero_size() integer(c_int32_t) :: arr(0) if (c28_zero_size_extent(arr) /= 0) error stop "FAIL: zero size" end subroutine subroutine test_unallocated() integer(c_int32_t), allocatable :: a(:) ! Not allocated — C should see base_addr == NULL if (c28_is_allocated(a) /= 0) error stop "FAIL: unallocated" end subroutine subroutine test_disassociated() integer(c_int32_t), pointer :: p(:) nullify(p) if (c28_is_associated(p) /= 0) error stop "FAIL: disassociated" end subroutine subroutine test_rank4() integer(c_int32_t) :: a(2, 2, 2, 2) integer :: i, j, k, l, v v = 1 do l = 1, 2 do k = 1, 2 do j = 1, 2 do i = 1, 2 a(i, j, k, l) = v v = v + 1 end do end do end do end do ! sum of 1..16 = 136 if (c28_sum_4d(a) /= 136) error stop "FAIL: rank4 sum" if (c28_get_rank_4d(a) /= 4) error stop "FAIL: rank4 rank" end subroutine subroutine test_explicit_shape() integer(c_int32_t) :: a(5) a = [1, 2, 3, 4, 5] if (c28_sum_explicit(a, 5) /= 15) error stop "FAIL: explicit shape" end subroutine subroutine test_opt_contig() integer(c_int32_t) :: arr(4) arr = [1, 2, 3, 4] if (c28_opt_contig_sum(arr) /= 10) error stop "FAIL: opt contig" end subroutine ! ======================================================================== ! Test subroutines from bindc_30 ! ======================================================================== subroutine test_char_alloc() character(kind=c_char, len=:), allocatable :: ca(:) allocate(character(len=1) :: ca(3)) ca = ['X', 'Y', 'Z'] ! 88 + 89 + 90 = 267 if (c30_char_alloc_sum(ca) /= 267) error stop "FAIL: char alloc sum" if (c30_char_alloc_attr(ca) /= 1) error stop "FAIL: char alloc attr" deallocate(ca) end subroutine subroutine test_char_ptr() character(kind=c_char, len=:), allocatable, target :: tgt(:) character(kind=c_char, len=:), pointer :: p(:) allocate(character(len=1) :: tgt(4)) tgt = ['a', 'b', 'c', 'd'] p => tgt ! 97 + 98 + 99 + 100 = 394 if (c30_char_ptr_sum(p) /= 394) error stop "FAIL: char ptr sum" if (c30_char_ptr_attr(p) /= 1) error stop "FAIL: char ptr attr" end subroutine subroutine test_alloc_ar() integer(c_int32_t), allocatable :: a1(:), a2(:,:) allocate(a1(3)) a1 = [1, 2, 3] if (c30_alloc_ar_rank(a1) /= 1) error stop "FAIL: alloc ar rank 1" allocate(a2(2, 3)) a2 = reshape([1, 2, 3, 4, 5, 6], [2, 3]) if (c30_alloc_ar_rank(a2) /= 2) error stop "FAIL: alloc ar rank 2" deallocate(a1) deallocate(a2) end subroutine subroutine test_ptr_ar() integer(c_int32_t), target :: tgt1(4), tgt2(2, 3) integer(c_int32_t), pointer :: p1(:), p2(:,:) tgt1 = [1, 2, 3, 4] tgt2 = reshape([1, 2, 3, 4, 5, 6], [2, 3]) p1 => tgt1 p2 => tgt2 if (c30_ptr_ar_rank(p1) /= 1) error stop "FAIL: ptr ar rank 1" if (c30_ptr_ar_rank(p2) /= 2) error stop "FAIL: ptr ar rank 2" end subroutine end program lfortran-0.63.0/integration_tests/data_01.f900000664000175000017500000000112215174404631021112 0ustar alastairalastairprogram data_01 integer :: x, td real :: y, z, c1(4), bf1, xx90, xx95, b, p data x, td, b /1, 4, 3/ data y, z /2.0, 3.0/ data c1 /0.0, 0.22, -0.14, -0.21/ data bf1 /0.8/, xx90, xx95 /0.55, 0.62/ print *, x, y, z if (x /= 1) error stop if (abs(y-2.0) > 1e-5) error stop if (abs(z-3.0) > 1e-5) error stop if (abs(c1(1)-0.0) > 1e-5) error stop if (abs(c1(2)-0.22) > 1e-5) error stop if (abs(c1(4)+0.21) > 1e-5) error stop if (abs(bf1-0.8) > 1e-5) error stop if (abs(xx90-0.55) > 1e-5) error stop if (abs(xx95-0.62) > 1e-5) error stop p = b ** (td-1) if (abs(p-27.0) > 1e-5) error stop end program lfortran-0.63.0/integration_tests/class_103.f900000664000175000017500000000143515174404631021400 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/2925 ! Typed allocation of polymorphic arrays with data members ! MRE from issue comment by difference-scheme (the data member variant) module class_103_m type :: Base real :: data = 2.0 end type Base type, extends(Base) :: Extended end type Extended contains subroutine allocator(array) class(Base), allocatable, intent(out) :: array(:) allocate( Extended :: array(1) ) end subroutine allocator end module class_103_m program class_103 use class_103_m implicit none class(Base), allocatable :: arr(:) call allocator(arr) if (.not. allocated(arr)) error stop if (size(arr) /= 1) error stop if (abs(arr(1)%data - 2.0) > 1e-6) error stop print *, "PASS" end program class_103 lfortran-0.63.0/integration_tests/dict_test_04_.f900000664000175000017500000000633515174404631022340 0ustar alastairalastairmodule dict_test_04_mod implicit none contains subroutine test_dict() _lfortran_dict(_lfortran_tuple(integer, integer), integer(8)):: terms2poly _lfortran_dict(_lfortran_tuple(integer(8), integer(8)), _lfortran_tuple(real, real)):: rtheta2coords integer:: i, size, size1 integer(8):: n real:: theta, r, eps, pi _lfortran_tuple(real, real):: coords eps = 1e-3 pi = 3.1415 size = 7000 n = int(0, kind=8) do i = 1000, 1000+size-1, 7 call _lfortran_set_item(terms2poly, _lfortran_tuple_constant(i, i*i), int(i + i*i, kind=8)) theta = real(n) * pi r = real(i) call _lfortran_set_item(rtheta2coords, _lfortran_tuple_constant(int(i, kind=8), n), & _lfortran_tuple_constant(r * sin(theta), r * cos(theta))) n = n + int(1, kind=8) end do size1 = size/7 n = int(0, kind=8) do i = 1000, 1000+size/2-1, 7 if (_lfortran_pop(terms2poly, _lfortran_tuple_constant(i, i*i)) /= int(i + i*i, kind=8)) error stop theta = real(n) * pi r = real(i) coords = _lfortran_pop(rtheta2coords, _lfortran_tuple_constant(int(i, kind=8), n)) if ( abs(_lfortran_get_item(coords, 0) - r*sin(theta)) > eps ) error stop if ( abs(_lfortran_get_item(coords, 1) - r*cos(theta)) > eps ) error stop size1 = size1 - 1 if ( _lfortran_len(terms2poly) /= size1 ) error stop n = n + int(1, kind=8) end do n = int(0, kind=8) do i = 1000, 1000+size/2-1, 7 call _lfortran_set_item(terms2poly, _lfortran_tuple_constant(i, i*i), int(1+ 2*i + i*i, kind=8)) theta = real(n) * pi r = real(i) call _lfortran_set_item(rtheta2coords, _lfortran_tuple_constant(int(i, kind=8), n), & _lfortran_tuple_constant(r * cos(theta), r * sin(theta))) n = n + int(1, kind=8) end do n = int(0, kind=8) do i = 1000, 1000+size/2-1, 7 if (_lfortran_get_item(terms2poly, _lfortran_tuple_constant(i, i*i)) /= int(1 + 2*i + i*i, kind=8)) error stop theta = real(n) * pi r = real(i) coords = _lfortran_pop(rtheta2coords, _lfortran_tuple_constant(int(i, kind=8), n)) if ( abs(_lfortran_get_item(coords, 0) - r*cos(theta)) > eps ) error stop if ( abs(_lfortran_get_item(coords, 1) - r*sin(theta)) > eps ) error stop n = n + int(1, kind=8) end do n = int(0, kind=8) do i = 1000, 1000+size-1, 7 call _lfortran_set_item(terms2poly, _lfortran_tuple_constant(i, i*i), int(1+ 2*i + i*i, kind=8)) theta = real(n) * pi r = real(i) call _lfortran_set_item(rtheta2coords, _lfortran_tuple_constant(int(i, kind=8), n), & _lfortran_tuple_constant(r * cos(theta), r * sin(theta))) n = n + int(1, kind=8) end do n = int(0, kind=8) do i = 1000, 1000+size-1, 7 if (_lfortran_get_item(terms2poly, _lfortran_tuple_constant(i, i*i)) /= int((1 + i)*(1 + i), kind=8)) error stop theta = real(n) * pi r = real(i) n = n + int(1, kind=8) end do end subroutine end module program test_dict_main use dict_test_04_mod call test_dict() end program lfortran-0.63.0/integration_tests/bindc_38c.c0000664000175000017500000000144115174404631021265 0ustar alastairalastair/* * C helpers for bindc_38: VOLATILE, ASYNCHRONOUS, PURE BIND(C) * * Tests volatile global variable interop, asynchronous array passing, * and invoking Fortran function pointers from C. */ #include /* ---- VOLATILE module variables ---- */ extern volatile int g38_volatile_int; extern volatile double g38_volatile_dbl; void c38_set_volatile_int(int val) { g38_volatile_int = val; } void c38_set_volatile_dbl(double val) { g38_volatile_dbl = val; } /* ---- ASYNCHRONOUS array fill ---- */ void c38_fill_async(int *arr, int n) { for (int i = 0; i < n; i++) { arr[i] = arr[i] * 2; } } /* ---- Invoke a Fortran BIND(C) function pointer ---- */ typedef int (*int_binop_t)(int, int); int c38_invoke_binop(int_binop_t fp, int a, int b) { return fp(a, b); } lfortran-0.63.0/integration_tests/goto_03.f900000664000175000017500000000040115174404631021152 0ustar alastairalastairprogram goto_03 implicit none integer :: a, n n = 2 a = 10 go to (1, 2, 3), n 1 a = a + 10 2 a = a + 20 3 a = a + 30 if(a /= 60) error stop assign 30 to n go to n, (10, 20, 30) 10 a = a * a 20 a = a + a 30 a = a - a if(a /= 0) error stop end program lfortran-0.63.0/integration_tests/tuple_test_03_.f900000664000175000017500000000113015174404631022531 0ustar alastairalastairmodule tuple_test_03_mod implicit none real :: eps = 1e-12 contains subroutine tests() _lfortran_tuple(integer, real, character(len=:)) :: t1 t1 = _lfortran_tuple_constant(1, 2.0, "3") integer :: x real :: y character(len=:), allocatable :: s x = _lfortran_get_item(t1, -3) y = _lfortran_get_item(t1, -2) s = _lfortran_get_item(t1, -1) if (x /= 1) error stop if (abs(y - 2.0) > eps) error stop if (s /= "3") error stop end subroutine end module program run_tuples use tuple_test_03_mod call tests() end program lfortran-0.63.0/integration_tests/allocate_66.f900000664000175000017500000000046115174404631022005 0ustar alastairalastairprogram allocate_66 implicit none type :: T integer :: x = 0 end type T class(T), allocatable :: obj allocate(obj, source = get_return()) contains function get_return() result(r) class(T), allocatable :: r allocate(r) end function get_return end program allocate_66 lfortran-0.63.0/integration_tests/parameter_03.f900000664000175000017500000000015115174404631022164 0ustar alastairalastairprogram parameter_03 implicit none integer, parameter :: l_knd = kind(.true.) print *, l_knd end program lfortran-0.63.0/integration_tests/gpu_metal_168.f900000664000175000017500000000077215174404631022266 0ustar alastairalastairprogram gpu_metal_168 ! Test: all() on variable-size array slice inside do concurrent ! Verifies that scalar reduction results from all() are correctly ! communicated back from the GPU kernel to the host. implicit none real :: a(3, 3), b(3, 3) logical :: eq_result integer :: n, l a = 1.0 b = 999.0 n = 1 b(1:n, 1) = a(1:n, 1) do concurrent(l = 1:1) eq_result = all(abs(a(1:n,l) - b(1:n,l)) < 1.0e-06) end do if (.not. eq_result) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/format_08s.f900000664000175000017500000000072115174404631021667 0ustar alastairalastair! copy of integration_tests/format_08.f90 but splits edit ! descriptor by separating it with commas i.e. changes ! "(aai6)" to "(a,a,i6)", which is exactly how GFortran ! also expects it as well, see: ! https://gcc.gnu.org/onlinedocs/gfortran/Commas-in-FORMAT-specifications.html program format_08s implicit none character(:), allocatable :: a integer :: b(10) a = "xx" b = 1 print "(a,a,i6)", a,"hi",15 print "(1000(i6))", b end programlfortran-0.63.0/integration_tests/param_pass_01.f900000664000175000017500000000017515174404631022336 0ustar alastairalastairprogram param_pass_01 integer, parameter :: i = 2, j = 2 integer :: p1 p1 = i + 2.0 print *, p1 end programlfortran-0.63.0/integration_tests/intrinsics_280.f900000664000175000017500000001146415174404631022471 0ustar alastairalastairprogram intrinsics_268 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp) :: arg_x(15) real(sp) :: arg_y(15) real(dp) :: res_x(15) real(sp) :: res_y(15) real(dp) :: expected_res_x(15) real(sp) :: expected_res_y(15) real(dp) :: expected_x(10) real(sp) :: expected_y(10) real(dp) :: a = 0.5178181202_dp real(sp) :: b = -0.072816_sp real(dp) :: c = -0.5178181202_dp real(sp) :: d = 0.072816_sp real(dp), parameter :: res_dp(10) = cosh([-0.62818828_dp, -0.51725372_dp, -0.29257208_dp, & 0.62818828_dp, 0.51725372_dp, 0.29257208_dp, 1.00_dp, 0.829362821_dp, 0.952716192_dp, -0.241626228_dp]) real(sp), parameter :: res_sp(10) = cosh([-0.62818828_sp, -0.51725372_sp, -0.29257208_sp, & 0.62818828_sp, 0.51725372_sp, 0.29257208_sp, 1.00_sp, 0.829362821_sp, 0.952716192_sp, -0.241626228_sp]) expected_x = [1.2038847685286660_dp, 1.1367850899207470_dp, 1.0431053788343854_dp, & 1.2038847685286660_dp, 1.1367850899207470_dp, 1.0431053788343854_dp, 1.5430806348152437_dp, & 1.3640925837349942_dp, 1.4892172380307673_dp, 1.0293339187973498_dp] arg_x = [-0.67922251126_dp, -0.54363892699177885_dp, -0.29691551032790681_dp, & 0.67922251126401767_dp, 0.54363892699177885_dp, 0.29691551032790681_dp, 0.5707963267948966_dp, & 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp, -0.7281628262782_dp, & 0.5707963267948966_dp, 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp] arg_y = [-0.679222465_sp, -0.543638885_sp, -0.296915501_sp, & 0.679222465_sp, 0.543638885_sp, 0.296915501_sp, 0.57079637_sp, & 0.077966249_sp, 0.262053013_sp, -0.244041398_sp, -0.7281628262782_sp, & 0.57079637_sp, 0.077966249_sp, 0.262053013_sp, -0.244041398_sp] expected_y = [1.20388472_sp, 1.13678503_sp, 1.04310536_sp, & 1.20388472_sp, 1.13678503_sp, 1.04310536_sp, 1.54308069_sp, & 1.36409259_sp, 1.48921716_sp, 1.02933395_sp] res_x = cosh(arg_x) res_y = cosh(arg_y) expected_res_x = [1.2396773477464105_dp, 1.1514470944182906_dp, 1.0444041956586250_dp, & 1.2396773477493541_dp, 1.1514470944182906_dp, 1.0444041956586250_dp, 1.1673755027897188_dp, & 1.0030409096642332_dp, 1.0345328431712835_dp, 1.0299261823832639_dp, 1.2770334891369264_dp, & 1.1673755027897188_dp, 1.0030409096642332_dp, 1.0345328431712835_dp, 1.0299261823832639_dp] expected_res_y = [1.23967731_sp, 1.15144706_sp, 1.04440415_sp, & 1.23967731_sp, 1.15144706_sp, 1.04440415_sp, 1.16737556_sp, & 1.00304091_sp, 1.03453279_sp, 1.02992618_sp, 1.27703345_sp, & 1.16737556_sp, 1.00304091_sp, 1.03453279_sp, 1.02992618_sp] do i = 1, size(res_dp) print *, res_dp(i) if (abs(res_dp(i) - expected_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_x) print *, res_x(i) if (abs(res_x(i)) - abs(expected_res_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_y(i)) > 1e-5) error stop end do do i = 1, size(res_y) print *, res_y(i) if (abs(res_y(i)) - abs(expected_res_y(i)) > 1e-5) error stop end do print *, cosh(a) if (abs(cosh(a)) - 1.1370904024390038_dp > 1e-12) error stop print *, cosh(0.5178181202_dp) if (abs(cosh(0.5178181202_dp) - 1.1370904024390038_dp) > 1e-12) error stop print *, cosh(b) if (cosh(b) - (1.00265229_sp) > 1e-5) error stop print *, cosh(-0.072816_sp) if (cosh(-0.072816_sp) - (1.00265229_sp) > 1e-5) error stop print *, cosh(c) if (cosh(c) - (1.1370904024390038_dp) > 1e-12) error stop print *, cosh(-0.5178181202_dp) if (cosh(-0.5178181202_dp) - (1.1370904024390038_dp) > 1e-12) error stop print *, cosh(d) if (cosh(d) - (1.00265229_sp) > 1e-5) error stop print *, cosh(0.072816_sp) if (cosh(0.072816_sp) - (1.00265229_sp) > 1e-5) error stop a = -0.271927291_dp b = -0.6382728_sp c = 0.271927291_dp d = 0.6382728_sp print *, cosh(a) if (abs(cosh(a) - (1.0372006123287354_dp)) > 1e-12) error stop print *, cosh(-0.271927291_dp) if (abs(cosh(-0.271927291_dp) - (1.0372006123287354_dp)) > 1e-12) error stop print *, cosh(b) if (cosh(b) - (1.21070600_sp) > 1e-5) error stop print *, cosh(-0.6382728_sp) if (cosh(-0.6382728_sp) - (1.21070600_sp) > 1e-5) error stop print *, cosh(c) if (cosh(c) - (1.0372006123287354_dp) > 1e-12) error stop print *, cosh(0.271927291_dp) if (cosh(0.271927291_dp) - (1.0372006123287354_dp) > 1e-12) error stop print *, cosh(d) if (cosh(d) - (1.21070600_sp) > 1e-5) error stop print *, cosh(0.6382728_sp) if (cosh(0.6382728_sp) - (1.21070600_sp) > 1e-5) error stop end programlfortran-0.63.0/integration_tests/intrinsics_369.f900000664000175000017500000000022115174404631022466 0ustar alastairalastairprogram intrinsics_369 implicit none real(kind(1d0)):: x = huge(x) print *, x if (abs(x - huge(x)) > 1e-8) error stop end program intrinsics_369 lfortran-0.63.0/integration_tests/data_07.f900000664000175000017500000000050415174404631021123 0ustar alastairalastairprogram data_07 implicit none double precision bands dimension bands(4, 5) common /jac/ bands data bands / 0.00D0, -1.0D0, 0.25D0, 0.10D0, 0.25D0, -5.0D0, 0.25D0, 0.10D0, & 0.25D0, -25.0D0, 0.25D0, 0.10D0, 0.25D0,-125.0D0, 0.25D0, 0.00D0, & 0.25D0, -625.0D0, 0.00D0, 0.00D0 / end program lfortran-0.63.0/integration_tests/functions_30.f900000664000175000017500000000462515174404631022226 0ustar alastairalastairprogram functions_30 real :: x(4) = [1.0, 2.0, -3.0, 4.0] integer :: y(4) = [1, 2, -3, 4] print *, maxval([1.0,x]) if(maxval([1.0,x]) /= 4.0) error stop print *, max_func([1.0,x]) if(max_func([1.0,x]) /= 4.0) error stop print *, maxval([1.0, -x]) if(maxval([1.0, -x]) /= 3.0) error stop print *, max_func([1.0, -x]) if(max_func([1.0, -x]) /= 3.0) error stop print *, maxval([1.0, x + x([2,1,3,4])]) if(maxval([1.0, x + x([2,1,3,4])]) /= 8.0) error stop print *, maxval([1, -y]) if(maxval([1, -y]) /= 3) error stop print *, maxval([1, y + y([2,1,3,4])]) if(maxval([1, y + y([2,1,3,4])]) /= 8) error stop call check_for_args(x, y) !! Assignment with function on rhs having lhs var in its arg x = x / norm(x) print *, x if(any(abs(x - [0.182574183, 0.365148365, -0.547722518, 0.730296731]) > 10e-12)) error stop x = x / norm(x(1:3)) print *, x if(any(abs(x - [0.267261237, 0.534522474, -0.801783681, 1.06904495]) > 10e-12)) error stop contains real function max_func(x) result(y) real, intent(in) :: x(:) y = maxval(x) end function real function norm(vec) result(res) real, intent(in) :: vec(:) integer :: i res = 0.0 do i = 1, size(vec) res = res + vec(i)**2 end do res = sqrt(res) end function norm subroutine check_for_args(x, y) real, intent(in) :: x(:) integer, intent(in) :: y(:) real :: x2(size(x)) print *, maxval([1.0,x]) if(maxval([1.0,x]) /= 4.0) error stop print *, max_func([1.0,x]) if(max_func([1.0,x]) /= 4.0) error stop print *, maxval([1.0, -x]) if(maxval([1.0, -x]) /= 3.0) error stop print *, max_func([1.0, -x]) if(max_func([1.0, -x]) /= 3.0) error stop print *, maxval([1.0, x + x([2,1,3,4])]) if(maxval([1.0, x + x([2,1,3,4])]) /= 8.0) error stop print *, maxval([1, -y]) if(maxval([1, -y]) /= 3) error stop print *, maxval([1, y + y([2,1,3,4])]) if(maxval([1, y + y([2,1,3,4])]) /= 8) error stop x2 = x x2 = x / norm(x2) print *, x2 if(any(abs(x2 - [0.182574183, 0.365148365, -0.547722518, 0.730296731]) > 10e-12)) error stop x2 = x2 / norm(x2(1:3)) print *, x2 if(any(abs(x2 - [0.267261237, 0.534522474, -0.801783681, 1.06904495]) > 10e-12)) error stop end subroutine check_for_args end program lfortran-0.63.0/integration_tests/do_concurrent_09.f900000664000175000017500000000253115174404631023062 0ustar alastairalastair! equivalent to openmp_15.f90 subroutine initialize_array(n, a) use omp_lib implicit none integer, intent(in) :: n real, dimension(n), intent(out) :: a integer :: i do concurrent (i=1:n) a(i) = 12.91 end do print *, a(1), a(n) end subroutine subroutine parallel_sum(n, a, ctr) use omp_lib implicit none integer, intent(in) :: n, ctr real, dimension(n), intent(in) :: a integer :: i real :: sum sum = 0.0 do concurrent (i=1:n) reduce(+:sum) sum = sum + a(i) end do ! here we have precision error both with gfortran and lfortran ! setting different number of threads leads to different results ! but in any case output of gfortran and lfortran is the same print *, sum if ( ctr == 1 ) then if (abs(sum - 12933994.0) > 1e-7) error stop else ! if (abs(sum - 25867988.0) > 1e-7) error stop ! lfortran always gives 2.58679600e+07 end if end subroutine subroutine reduce_array(n, a, b) implicit none integer, intent(in) :: n real, dimension(n), intent(in) :: a real, dimension(n) :: b integer :: i do concurrent (i=2:n) b(i) = a(i) + a(i-1) end do b(1) = a(1) * 2 end subroutine program do_concurrent_09 use omp_lib integer, parameter :: n = 1000000 real, dimension(n) :: a, b call omp_set_num_threads(4) call initialize_array(n, a) print *, a(1), a(n) call parallel_sum(n, a, 1) call reduce_array(n, a, b) call parallel_sum(n, b, 0) end program lfortran-0.63.0/integration_tests/format_06.f900000664000175000017500000000145315174404631021505 0ustar alastairalastairprogram format_06 real :: a,b,c,d a = 123.456 b = 123.45678 c = 12.34 d = 123.45 10 format(a,a) 20 format("Success!",/,10X,A6,"World!") 30 format(4a4) 40 format(A2,4(2X,A),I3) print *, "a", "b" print 10, "c", "d" print 20, "Hello 123" write (*,30) "dancing","in","the","moonlight" write (*,40) "ab", "cdef", "ghi", "jkl","qwerty",12 print 50 , 123,456,12345,6789 print 60, 123.456, -123.45678, 12.34, -123.45 write (*,70) -a, b, -c, d write (*,80) -a, b, -c, d 50 format(i3,i10.5,/i6.6,2x,i3) 60 format(d10.2,d15.6,d010.2,2x,d7.2) 70 format(1pd10.2,2pd15.6,1pd010.2,2x,1pd9.2) 80 format(-1pe10.2,-2pe15.6,1pe010.2,2x,1pe9.2) ! Checking different scopes if ( a > 0) then print 90, "Hello " if ( b > 0) then write (*,100) "World!" end if 100 format(a) end if 90 format (a) end program lfortran-0.63.0/integration_tests/derived_types_09b.f900000664000175000017500000000025515174404631023227 0ustar alastairalastairmodule derived_types_09b use derived_types_09c, only: data_t contains integer function f(d) type(data_t), intent(inout) :: d real :: A(size(d%A)) end function end module lfortran-0.63.0/integration_tests/gpu_metal_34.f900000664000175000017500000000050015174404631022163 0ustar alastairalastairsubroutine learn(n) integer, intent(in) :: n integer :: pair real :: a(n) do concurrent (pair = 1:n) a(pair) = real(pair) end do if (abs(a(1) - 1.0) > 1e-6) error stop if (abs(a(n) - real(n)) > 1e-6) error stop end subroutine program main implicit none call learn(5) print *, "PASS" end program lfortran-0.63.0/integration_tests/test_str.f900000664000175000017500000000261615174404631021561 0ustar alastairalastair! Testing Python's str casting ! -- Example -- ! i = 10 ! s = "Hi" ! s = str(i) # Equivalent in LFortran is `lfortran_str()` program test_str character(30) :: str integer :: i real :: r i = 11 str = "HI"//_lfortran_str(9) // _lfortran_str(i) print *, str, "|" if(trim(str) /= "HI911") error stop ! --------------------------------------------------------------------------- ! r = 2.3 str = trim(str) // "World" //_lfortran_str(r) // "--"// _lfortran_str(22.5) print *, str,"|" if(trim(str) /= "HI911World2.300000--22.500000") error stop ! --------------------------------------------------------------------------- ! call test(_lfortran_str(112233) ,"112233") call test(_lfortran_str(i) ,"11") ! --------------------------------------------------------------------------- ! ! --------------------------------------------------------------------------- ! ! --------------------------------------------------------------------------- ! CONTAINS subroutine test (str_from_cast, test_against_str) character(*) :: str_from_cast character(*) :: test_against_str print *, len(str_from_cast) print *, str_from_cast print *, len(test_against_str) print *, test_against_str if(str_from_cast /= test_against_str) error stop end subroutine end programlfortran-0.63.0/integration_tests/pdt_12.f900000664000175000017500000000136415174404631021002 0ustar alastairalastairmodule pdt_12 implicit none type recursive_t(k) integer, kind :: k = kind(1.0) type(recursive_t(k)), allocatable :: next end type recursive_t interface module subroutine touch(self) import :: recursive_t type(recursive_t), intent(inout) :: self end subroutine touch end interface end module pdt_12 submodule (pdt_12) pdt_12_s contains module procedure touch if (.not. allocated(self%next)) then allocate(self%next) end if end procedure touch end submodule pdt_12_s program test_pdt use pdt_12 implicit none type(recursive_t) :: obj call touch(obj) if (.not. allocated(obj%next)) error stop end program test_pdtlfortran-0.63.0/integration_tests/string_27.f900000664000175000017500000000047315174404631021527 0ustar alastairalastairprogram string_27 CHARACTER(100), DIMENSION(100) :: calibration_document INTEGER ::len_line, char_value calibration_document(3) = 'abcdefg' len_line = 1 print *, calibration_document(3)(len_line:len_line+4) if (calibration_document(3)(len_line:len_line+4) /= 'abcde') error stop end program lfortran-0.63.0/integration_tests/template_matrix.f900000664000175000017500000001121615174404631023105 0ustar alastairalastairmodule matrix_m use monoid_m, only: derive_extended_monoid use semiring_m, only: semiring use unit_ring_m, only: unit_ring_only_minus, derive_unit_ring_from_minus use field_m, only: field_only_division implicit none private public :: matrix_tmpl template matrix_tmpl(T, plus_t, zero_t, times_t, one_t, n) require :: semiring(T, plus_t, zero_t, times_t, one_t) instantiate derive_extended_monoid(T, plus_t, zero_t), only: sum => mconcat integer :: n private public :: & matrix, & plus_matrix, & times_matrix, & zero, & one, & matrix_subtraction_tmpl type :: matrix type(T) :: elements(n, n) end type interface operator(+) procedure :: plus_matrix end interface interface operator(*) procedure times_matrix end interface template matrix_subtraction_tmpl(minus_t) require :: unit_ring_only_minus(T, plus_t, zero_t, times_t, one_t, minus_t) private public :: operator(-), gaussian_solver_tmpl interface operator(-) procedure minus_matrix end interface template gaussian_solver_tmpl(div_t) instantiate derive_unit_ring_from_minus(T, plus_t, zero_t, times_t, one_t, minus_t), only: negate require :: field_only_division(T, plus_t, zero_t, times_t, one_t, minus_t, negate, div_t) private contains elemental function div_matrix(x, y) result(quotient) type(matrix), intent(in) :: x, y type(matrix) :: quotient quotient = back_substitute(row_eschelon(x), y) end function pure function row_eschelon(x) result(reduced) type(matrix), intent(in) :: x type(matrix) :: reduced integer :: i, ii, j type(T) :: r reduced = x do i = 1, n ! Assume pivot m(i,i) is not zero do ii = i+1, n r = div_t(reduced%elements(i,i), reduced%elements(ii,i)) reduced%elements(ii, i) = zero_t() do j = i+1, n reduced%elements(ii, j) = minus_t(reduced%elements(ii, j), times_t(reduced%elements(i, j), r)) end do end do end do end function pure function back_substitute(x, y) result(solved) type(matrix), intent(in) :: x, y type(matrix) :: solved integer :: i, j type(T) :: tmp(n) solved = y do i = n, 1, -1 tmp = zero_t() do j = i+1, n tmp = plus_t(tmp, times_t(x%elements(i,j), solved%elements(:,j))) end do solved%elements(:,i) = div_t(minus_t(solved%elements(:, i), tmp), x%elements(i,i)) end do end function end template contains elemental function minus_matrix(x, y) result(difference) type(matrix), intent(in) :: x, y type(matrix) :: difference difference%elements = minus_t(x%elements, y%elements) end function end template contains elemental function plus_matrix(x, y) result(combined) type(matrix), intent(in) :: x, y type(matrix) :: combined combined%elements = plus_t(x%elements, y%elements) end function pure function zero() type(matrix) :: zero zero%elements = zero_t() end function elemental function times_matrix(x, y) result(combined) type(matrix), intent(in) :: x, y type(matrix) :: combined integer :: i, j, k type(T) :: dot do i = 1, n do j = 1, n combined%elements(i, j) = sum(times_t(x%elements(i,:), y%elements(:,j))) end do end do end function pure function one() type(matrix) :: one integer :: i one%elements = zero_t() do concurrent (i = 1:n) one%elements(i, i) = one_t() end do end function end template end module lfortran-0.63.0/integration_tests/openmp_52.f900000664000175000017500000000103615174404631021511 0ustar alastairalastairprogram openmp_52 use omp_lib implicit none integer, parameter :: N = 100, init=0 integer :: a(N), i, total a = 1 ! Initialize all elements to 1 !$omp parallel shared(a, total) private(i) total = init ! Initialize total to 0 !$omp barrier !$omp do do i = 1, N !$omp critical total = total + a(i) !$omp end critical end do !$omp end do !$omp end parallel print *, "Total sum:", total if (total /= N) error stop "Incorrect sum" end program openmp_52lfortran-0.63.0/integration_tests/class_110.f900000664000175000017500000000030515174404631021371 0ustar alastairalastairprogram class_110 use class_110_module implicit none type(wrapper) :: w allocate(base_type :: w%obj) w%obj%k = 4 call w%caller() print *, "ok" end program class_110 lfortran-0.63.0/integration_tests/intrinsics_176.f900000664000175000017500000000574415174404631022501 0ustar alastairalastairprogram intrinsics_176 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real :: x real(dp) :: y integer :: i integer(8) :: j real(sp), parameter :: x1 = set_exponent(4.1, 4) real(dp), parameter :: y1 = set_exponent(4.1_dp, 5) real(sp), parameter :: ar1(3) = set_exponent([1.1213, 2.1643, 3.613], 3_8) real(dp), parameter :: ar2(3) = set_exponent([1.1213_dp, 2.1643_dp, 3.613_dp], 3) real(sp) :: arr1(3) real(dp) :: arr2(3) arr1 = [11.90_sp, 12.00_sp, 45.09_sp] arr2 = [890.4_dp, 12.00_dp, 675.45_dp] print *, x1 if ((x1 - 8.19999981) > 1e-7) error stop print *, y1 if ((y1 - 16.3999999999999986_dp) > 1e-12) error stop print *, ar1 if (any(ar1 - [4.48519993e+00_sp, 4.32859993e+00_sp, 7.22599983e+00_sp] > 1e-5)) error stop print *, ar2 if (any(ar2 - [4.48519999999999985e+00_dp, 4.32859999999999978e+00_dp, 7.22599999999999998e+00_dp] > 1e-5)) error stop print *, set_exponent(arr1, 3) if (any(set_exponent(arr1, 3) - [11.90_sp, 12.00_sp, 45.09_sp] > 1e-5)) error stop print *, set_exponent(arr2, 3) if (any(set_exponent(arr2, 3) - [890.4_dp, 12.00_dp, 675.45_dp] > 1e-5)) error stop i = 4 j = 5 x = 4.1 y = 4.1_dp print *, set_exponent(x, i) if ((set_exponent(x, i) - 8.19999981) > 1e-7) error stop print *, set_exponent(4.1_dp, 5) if ((set_exponent(4.1_dp, 5) - 16.3999999999999986_dp) > 1e-12) error stop print *, set_exponent(y, j) if ((set_exponent(y, j) - 16.399999999999999_dp) > 1e-12) error stop print *, set_exponent(4.1, 4) if ((set_exponent(4.1, 4) - 8.19999981) > 1e-7) error stop i = 11 j = 7 x = 0.5 y = 0.5_dp print *, set_exponent(x, i) if ((set_exponent(x, i) - 1024.00000) > 1e-7) error stop print *, set_exponent(0.5_dp, 7) if ((set_exponent(0.5_dp, 7) - 64.000000000000000_dp) > 1e-12) error stop print *, set_exponent(y, j) if ((set_exponent(y, j) - 64.000000000000000_dp) > 1e-12) error stop print *, set_exponent(0.5, 11) if ((set_exponent(0.5, 11) - 1024.00000) > 1e-7) error stop i = 15 j = 12 x = -11.56 y = -15.678_dp print *, set_exponent(x, i) if ((set_exponent(x, i) - (-23674.8809)) > 1e-7) error stop print *, set_exponent(-15.678_dp, 12) if ((set_exponent(-15.678_dp, 12) - (-4013.5680000000002_dp)) > 1e-12) error stop print *, set_exponent(y, j) if ((set_exponent(y, j) - (-4013.5680000000002_dp)) > 1e-12) error stop print *, set_exponent(-11.56, 15) if ((set_exponent(-11.56, 15) - (-23674.880)) > 1e-7) error stop print *, kind(set_exponent(x, i)) if (kind(set_exponent(x, i)) /= 4) error stop print *, kind(set_exponent(-15.678_dp, 12)) if (kind(set_exponent(-15.678_dp, 12)) /= 8) error stop print *, kind(set_exponent(y, j)) if (kind(set_exponent(y, j)) /= 8) error stop print *, kind(set_exponent(-11.56, 15)) if (kind(set_exponent(-11.56, 15)) /= 4) error stop end program lfortran-0.63.0/integration_tests/bindc_01b.f900000664000175000017500000000124515174404631021430 0ustar alastairalastairmodule bindc_01b use iso_c_binding, only: c_ptr, c_int implicit none interface subroutine ret_ptr(p) bind(c, name="ret_ptr_c") import :: c_ptr type(c_ptr), intent(out) :: p end subroutine ! same as `ret_ptr`, except, the only difference being "unspecified" ! intent of `p` in `ret_ptr_unspecified_intent` subroutine ret_ptr_unspecified_intent(p) bind(c, name="ret_ptr_c") import :: c_ptr type(c_ptr) :: p end subroutine subroutine print_ptr(n, p) bind(c, name="print_ptr_c") import :: c_ptr, c_int integer(c_int), value, intent(in) :: n type(c_ptr), value, intent(in) :: p end subroutine end interface end module lfortran-0.63.0/integration_tests/derived_types_44.f900000664000175000017500000000175615174404631023073 0ustar alastairalastair! Test pointer association program derived_types_44 type :: sds real, dimension(:), pointer :: f end type real, dimension(:), pointer :: x call sub_to_allocate(x) print *, "size(x): ", size(x) print *, "lbound(x): ", lbound(x) if (lbound(x,1) /= 1) error stop print *, "ubound(x): ", ubound(x) if ( abs(x(1) - 1.0) > 1e-8 ) error stop if ( abs(x(2) - 2.0) > 1e-8 ) error stop if ( abs(x(100000) - 88.0) > 1e-8 ) error stop print *, "x(1) = ", x(1) print *, "x(2) = ", x(2) print *, "x(100000) = ", x(100000) ! Use big size to make sure about correct memory. deallocate(x) contains subroutine sub_to_allocate(x) real, dimension(:), pointer, intent(inout) :: x type(sds) :: s allocate(s%f(100000)) x => s%f x(1)=1.0 x(2)=2.0 x(100000)=88.0 print *, "x(1) = ", x(1) print *, "x(2) = ", x(2) print *, "x(100000) = ", x(100000) end subroutine end program lfortran-0.63.0/integration_tests/openmp_57.f900000664000175000017500000000073415174404631021522 0ustar alastairalastairprogram openmp_57 use omp_lib implicit none integer, parameter :: N = 5 integer :: A(N) integer :: i, index,total A = 1 total=0 index=1 !$omp parallel !$omp single do i = 1, N !$omp task shared(A) !$omp atomic total = total + A(index) * 2 index=index+1 !$omp end task end do !$omp end single !$omp taskwait !$omp end parallel print *, "Total = ", total, index if(total/=10) error stop end program openmp_57 lfortran-0.63.0/integration_tests/statement_01.f900000664000175000017500000000017315174404631022212 0ustar alastairalastairdouble precision function alnorm() double precision z, zexp zexp(z) = dexp(z) return end program statement_01 end program lfortran-0.63.0/integration_tests/generic_name_08.f900000664000175000017500000000205715174404631022634 0ustar alastairalastairmodule generic_name_08_path_mod implicit none type :: toml_key character(:), allocatable :: s end type type :: toml_path type(toml_key), allocatable :: path(:) end type interface toml_path module procedure new_path2 end interface contains function new_path2(a, b) result(p) character(*), intent(in) :: a, b type(toml_path) :: p allocate(p%path(2)) p%path(1)%s = a p%path(2)%s = b end function end module module generic_name_08_build_mod use generic_name_08_path_mod, only : toml_path, toml_key implicit none public :: toml_path, toml_key end module module generic_name_08_top_mod use generic_name_08_build_mod, only : toml_path, toml_key implicit none public :: toml_path, toml_key end module program generic_name_08 use generic_name_08_build_mod use generic_name_08_top_mod implicit none type(toml_path) :: p p = toml_path([toml_key("x"), toml_key("y")]) if (size(p%path) /= 2) error stop if (p%path(1)%s /= "x") error stop if (p%path(2)%s /= "y") error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/allocate_57.f900000664000175000017500000000340015174404631022001 0ustar alastairalastair! Test: allocate with source= for a derived type containing ! a polymorphic allocatable array component (class(T), allocatable :: a(:)). ! Previously caused a segfault because the destination class array elements ! had uninitialized vtable and data pointers during deep copy. program allocate_57 implicit none type :: base_t integer :: val = 0 end type base_t type :: container_t class(base_t), allocatable :: items(:) end type container_t type(container_t), allocatable :: x type(container_t) :: y ! Test 1: allocate with source= from a function result allocate(x, source = make_container(3)) if (.not. allocated(x)) error stop if (.not. allocated(x%items)) error stop if (size(x%items) /= 3) error stop if (x%items(1)%val /= 10) error stop if (x%items(2)%val /= 20) error stop if (x%items(3)%val /= 30) error stop print *, "Test 1 passed: allocate with source= from function" ! Test 2: allocate with source= from a variable y = make_container(2) deallocate(x) allocate(x, source = y) if (size(x%items) /= 2) error stop if (x%items(1)%val /= 10) error stop if (x%items(2)%val /= 20) error stop print *, "Test 2 passed: allocate with source= from variable" ! Test 3: verify deep copy (modifying source doesn't affect copy) y%items(1)%val = 999 if (x%items(1)%val /= 10) error stop print *, "Test 3 passed: deep copy independence" print *, "All tests passed!" contains function make_container(n) result(r) integer, intent(in) :: n type(container_t) :: r integer :: i allocate(r%items(n)) do i = 1, n r%items(i)%val = i * 10 end do end function make_container end program allocate_57 lfortran-0.63.0/integration_tests/elemental_05.f900000664000175000017500000000073615174404631022165 0ustar alastairalastairprogram elemental_05 integer, parameter :: n = 10 integer :: i type :: vector integer :: elements(n) end type type(vector) :: a, b, c do i = 1, n a%elements(i) = i b%elements(i) = i end do c%elements = add_vector(a%elements, b%elements) print *, c%elements do i = 1, n if (c%elements(i) /= 2*i) error stop end do contains elemental function add_vector(a, b) result(c) integer, intent(in) :: a, b integer :: c c = a + b end function end program lfortran-0.63.0/integration_tests/intrinsics_323.f900000664000175000017500000000056615174404631022470 0ustar alastairalastairprogram intrinsics_323 real, allocatable :: L(:,:), U(:,:) call lu(L, U) contains subroutine lu(L, U) real, intent(out), allocatable :: L(:,:), U(:,:) allocate(L(5,5), U(5,5)) L = 12.91 U = -12.91 print *, dot_product(L(4,1:3), U(1:3,4)) if (abs(dot_product(L(4,1:3), U(1:3,4)) - (-500.004272)) > 1e-8) error stop end subroutine end program lfortran-0.63.0/integration_tests/gpu_metal_84.f900000664000175000017500000000104015174404631022170 0ustar alastairalastairprogram gpu_metal_84 ! Test: lbound/ubound on allocatable derived-type array member ! inside do concurrent (Metal GPU offload) implicit none type :: t integer, allocatable :: arr(:) end type type(t) :: x integer :: i, r(2) allocate(x%arr(3)) x%arr = [10, 20, 30] do concurrent (i = 1:2) r(i) = get_lb(x) end do if (r(1) /= 1) error stop if (r(2) /= 1) error stop print *, r(1), r(2) contains pure integer function get_lb(x) type(t), intent(in) :: x get_lb = lbound(x%arr, 1) end function end program lfortran-0.63.0/integration_tests/namelist_15.f900000664000175000017500000000203415174404631022025 0ustar alastairalastairprogram namelist_15 implicit none ! Variables of different intrinsic types integer :: act_i real :: act_r character(len=10) :: act_c logical :: act_l integer :: lun namelist /act_cli/ act_i namelist /act_cli/ act_r, act_c namelist /act_cli/ act_l act_i = 42 act_r = 3.5 act_c = 'hello' act_l = .true. open(newunit=lun, file='test.nml', status='replace', action='write') write(lun, nml=act_cli) close(lun) act_i = -1 act_r = -1.0 act_c = '' act_l = .false. open(newunit=lun, file='test.nml', status='old', action='read') read(lun, nml=act_cli) close(lun, status='delete') if (act_i /= 42) error stop 'act_i mismatch' if (abs(act_r - 3.5) > 1e-6) error stop 'act_r mismatch' if (act_c /= 'hello') error stop 'act_c mismatch' if (.not. act_l) error stop 'act_l mismatch' print *, 'PASSED: file-based NAMELIST with mixed intrinsic types' end program namelist_15 lfortran-0.63.0/integration_tests/simd_02.f900000664000175000017500000000054015174404631021141 0ustar alastairalastairprogram simd_02 !LF$ attributes simd :: A, B, res real :: A(4), B(4), C(8), res(4) C = [3.14, 7.25, 0.98, 5.67, 2.35, 9.42, 6.11, 1.99] A = C(:4) B = C(5:) res = A + B * A C(:4) = res res = A * B C(5:) = res print *, C print *, sum(C) if (abs(sum(C) - 202.930176) > 1e-5 ) error stop end program simd_02 lfortran-0.63.0/integration_tests/separate_compilation_07a.f900000664000175000017500000000053015174404631024554 0ustar alastairalastairmodule separate_compilation_07a_mpi_c_bindings implicit none interface subroutine c_mpi_init(ierr) bind(C, name="mpi_init_wrapper") use iso_c_binding, only: c_int integer(c_int), intent(out) :: ierr end subroutine c_mpi_init end interface end module separate_compilation_07a_mpi_c_bindings lfortran-0.63.0/integration_tests/intrinsics_15.f900000664000175000017500000000110215174404631022371 0ustar alastairalastairprogram intrinsics_15 use iso_fortran_env, only: sp=>real32, dp=>real64 integer :: x real(sp) :: r32 real(dp) :: r64 complex(sp) :: c32 complex(dp) :: c64 x = 5; r32 = 5; r64 = 5; c32 = (5._sp, 7._sp); c64 = (5._dp, 7._dp) ! No kind argument r32 = real(x) r32 = real(r32) r32 = real(r64) r32 = real(c32) r32 = real(c64) ! single precision kind r32 = real(x, sp) r32 = real(r32, sp) r32 = real(r64, sp) r32 = real(c32, sp) r32 = real(c64, sp) ! double precision kind r64 = real(x, dp) r64 = real(r32, dp) r64 = real(r64, dp) r64 = real(c32, dp) r64 = real(c64, dp) end program lfortran-0.63.0/integration_tests/intrinsics_18c.f900000664000175000017500000000451615174404631022553 0ustar alastairalastairprogram intrinsics_18c ! This program tests all trigonometric intrinsics, both in declarations ! and in executable statements. Single and double precision, complex only. integer, parameter :: dp = kind(0.d0) complex, parameter :: & s1 = sin((0.5,0.5)), & s2 = cos((0.5,0.5)), & s3 = tan((0.5,0.5)), & s4 = asin((0.5,0.5)), & s5 = acos((0.5,0.5)), & s6 = atan((0.5,0.5)), & s7 = sinh((0.5,0.5)), & s8 = cosh((0.5,0.5)), & s9 = tanh((0.5,0.5)), & s10 = asinh((0.5,0.5)), & s11 = acosh((1.5,1.5)), & s12 = atanh((0.5,0.5)) complex(dp), parameter :: & d1 = sin((0.5_dp,0.5_dp)), & d2 = cos((0.5_dp,0.5_dp)), & d3 = tan((0.5_dp,0.5_dp)), & d4 = asin((0.5_dp,0.5_dp)), & d5 = acos((0.5_dp,0.5_dp)), & d6 = atan((0.5_dp,0.5_dp)), & d7 = sinh((0.5_dp,0.5_dp)), & d8 = cosh((0.5_dp,0.5_dp)), & d9 = tanh((0.5_dp,0.5_dp)), & d10 = asinh((0.5_dp,0.5_dp)), & d11 = acosh((1.5_dp,1.5_dp)), & d12 = atanh((0.5_dp,0.5_dp)) complex :: x, x2 complex(dp) :: y, y2 x = (0.5,0.5) y = (0.5_dp,0.5_dp) x2 = (1.5,1.5) y2 = (1.5_dp,1.5_dp) print *, sin((0.5,0.5)), sin((0.5_dp,0.5_dp)), s1, d1, sin(x), sin(y) print *, cos((0.5,0.5)), cos((0.5_dp,0.5_dp)), s2, d2, cos(x), cos(y) print *, tan((0.5,0.5)), tan((0.5_dp,0.5_dp)), s3, d3, tan(x), tan(y) print *, asin((0.5,0.5)), asin((0.5_dp,0.5_dp)), s4, d4, asin(x), asin(y) if (abs(real(asin((0.5, 0.5))) - 0.452278435) > 1e-7) error stop if (abs(real(asin(x)) - 0.452278435) > 1e-7) error stop print *, acos((0.5,0.5)), acos((0.5_dp,0.5_dp)), s5, d5, acos(x), acos(y) if (abs(real(acos((0.5, 0.5))) - 1.11851788) > 1e-7) error stop if (abs(real(acos(x)) - 1.11851788) > 1e-7) error stop print *, atan((0.5,0.5)), atan((0.5_dp,0.5_dp)), s6, d6, atan(x), atan(y) if (abs(real(atan((0.5, 0.5))) - 0.553574383) > 1e-7) error stop if (abs(real(atan(x)) - 0.553574383) > 1e-7) error stop print *, sinh((0.5,0.5)), sinh((0.5_dp,0.5_dp)), s7, d7, sinh(x), sinh(y) print *, cosh((0.5,0.5)), cosh((0.5_dp,0.5_dp)), s8, d8, cosh(x), cosh(y) print *, tanh((0.5,0.5)), tanh((0.5_dp,0.5_dp)), s9, d9, tanh(x), tanh(y) print *, asinh((0.5,0.5)), asinh((0.5_dp,0.5_dp)), s10, d10, asinh(x), asinh(y) print *, acosh((1.5,1.5)), acosh((1.5_dp,1.5_dp)), s11, d11, acosh(x2), acosh(y2) print *, atanh((0.5,0.5)), atanh((0.5_dp,0.5_dp)), s12, d12, atanh(x), atanh(y) end lfortran-0.63.0/integration_tests/gpu_metal_189.f900000664000175000017500000000144115174404631022263 0ustar alastairalastair! Test: sum() on local array inside function called from do concurrent ! Verifies that Metal codegen generates correct address space overloads ! for lowered intrinsic functions (e.g. _lcompilers_Sum) so that ! thread-local arrays can be passed to them. program gpu_metal_189 implicit none real :: r(4) integer :: i do concurrent(i = 1:4) r(i) = f(real(i)) end do print *, r(1) print *, r(2) print *, r(3) print *, r(4) if (abs(r(1) - 6.0) > 1e-5) error stop if (abs(r(2) - 9.0) > 1e-5) error stop if (abs(r(3) - 12.0) > 1e-5) error stop if (abs(r(4) - 15.0) > 1e-5) error stop contains pure function f(x) result(s) real, intent(in) :: x real :: s real :: a(3) a(1) = x a(2) = x + 1.0 a(3) = x + 2.0 s = sum(a) end function end program lfortran-0.63.0/integration_tests/while_05.f900000664000175000017500000000151715174404631021325 0ustar alastairalastair! Test while's test statement and how we handle any expression ! inside that needs a temporary program while_05 integer :: x = 2 integer :: hit = 0 ! Predicate with some array operations in it do while(boo(foo(x) == ["Hello","World"])) print *, "Hi" x = 1 hit = hit + 1 end do if(hit /= 1) error stop contains function foo(i) result (r) integer :: I character(5):: r(2) if(i == 1) then r = ["bla","bla"] else r = ["Hello","World"] end if end function function boo(arr) result (r_logical) logical ::r_logical logical :: arr(2) if(all(arr.eqv. [.true.,.true.])) then r_logical = .true. else r_logical = .false. end if end function end programlfortran-0.63.0/integration_tests/arrays_77.f900000664000175000017500000000100115174404631021513 0ustar alastairalastairmodule a_arrays_77 contains function f2() result(res) integer(8), allocatable :: res(:) allocate(res(10)) res = [1,2,3,4,5,6,7,8,9,10] end function f2 end module a_arrays_77 program arrays_77 use a_arrays_77 integer :: i integer :: arr(10) integer,allocatable :: arr_res(:) do i = 1 , 10 arr(i) = i + 100 end do allocate(arr_res(11)) arr_res = [arr(f2()),111] ! Error here print *, arr_res do i = 1 , 11 if (arr_res(i) /= i + 100) error stop end do end programlfortran-0.63.0/integration_tests/submodule_13.f900000664000175000017500000000362215174404631022212 0ustar alastairalastairmodule submodule_13_mod implicit none private public :: string_t public :: operator(.separatedBy.) type string_t private character(len=:), allocatable :: string_ contains procedure :: bracket end type string_t interface string_t elemental module function from_default_integer(i) result(string) implicit none integer, intent(in) :: i type(string_t) :: string end function from_default_integer end interface interface elemental module function bracket(self, opening, closing) result(bracketed_self) implicit none class(string_t), intent(in) :: self character(len=*), intent(in), optional :: opening, closing type(string_t) :: bracketed_self end function bracket end interface contains elemental module function bracket(self, opening, closing) result(bracketed_self) class(string_t), intent(in) :: self character(len=*), intent(in), optional :: opening, closing type(string_t) :: bracketed_self if (present(opening) .and. present(closing)) then bracketed_self%string_ = opening // self%string_ // closing else bracketed_self%string_ = self%string_ end if end function bracket end module submodule_13_mod program submodule_13 use submodule_13_mod, only : string_t implicit none contains pure function markdown_table(row_header, column_header, body_cells, side_borders) result(lines) integer, parameter :: first_body_row = 3 type(string_t), intent(in) :: row_header(first_body_row:), column_header(:), body_cells(first_body_row:,:) logical, intent(in) :: side_borders character(len=1), parameter :: column_separator = "|" integer, parameter :: num_rule_lines = 1 type(string_t) :: lines(size(body_cells,1) + num_rule_lines) if (side_borders) lines = lines%bracket(column_separator) end function markdown_table end program submodule_13 lfortran-0.63.0/integration_tests/intrinsics_305.f900000664000175000017500000000200415174404631022455 0ustar alastairalastairprogram intrinsics_305 implicit none real, parameter :: x1 = realpart((1.0, 2.0)) real(8), parameter :: x2 = realpart((1.0_8, 2.0_8)) real, parameter :: ar1(3) = realpart([(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)]) real(8), parameter :: ar2(3) = realpart([(1.0_8, 2.0_8), (3.0_8, 4.0_8), (5.0_8, 6.0_8)]) complex :: x = (1.0, 2.0) complex(8) :: y = (1.0_8, 2.0_8) complex :: z(3) = [(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)] print *, x1 if (x1 /= 1.0) error stop print *, x2 if (x2 /= 1.0_8) error stop print *, realpart(x) if (realpart(x) /= 1.0) error stop print *, realpart(y) if (realpart(y) /= 1.0_8) error stop print *, ar1 if (any(ar1 /= [1.0, 3.0, 5.0])) error stop print *, ar2 if (any(ar2 /= [1.0_8, 3.0_8, 5.0_8])) error stop print *, realpart(x) if (realpart(x) /= 1.0) error stop print *, realpart(y) if (realpart(y) /= 1.0_8) error stop print *, realpart(z) if (any(realpart(z) /= [1.0, 3.0, 5.0])) error stop end programlfortran-0.63.0/integration_tests/openmp_05.f900000664000175000017500000000052515174404631021511 0ustar alastairalastairprogram openmp_05 use omp_lib integer :: n = 10, i call omp_set_num_threads(4) !$omp parallel private(i) shared(n) !$omp do do i = 1, n print *, "xyz" print *, "i = ", i, "from thread = ", omp_get_thread_num() if (omp_get_thread_num() > 4) error stop end do !$omp end do !$omp end parallel print *, "end program" end program lfortran-0.63.0/integration_tests/file_37.f900000664000175000017500000000046615174404631021143 0ustar alastairalastairprogram file_37 implicit none integer, allocatable :: x integer :: fh ! Open the file for writing and reading allocate(x) open(newunit=fh, status="scratch") write(fh, *) 666 rewind(fh) read(fh, *) x print "(I0)", x close(fh) ! deallocate(x) end program file_37 lfortran-0.63.0/integration_tests/openmp_49.f900000664000175000017500000000045115174404631021517 0ustar alastairalastairprogram openmp_49 use omp_lib implicit none call omp_set_num_threads(8) !$omp parallel !$omp master print *, "Welcome to Master Thread!" if(omp_get_thread_num() /= 0) error stop !$omp end master !$omp end parallel end program openmp_49lfortran-0.63.0/integration_tests/gpu_metal_149.f900000664000175000017500000000155115174404631022261 0ustar alastairalastair! Test: module-scope parameter referenced inside associate block in function ! called from do concurrent. The gpu_offload pass must correctly import the ! parameter into the duplicated function's scope even when accessed through ! an associate block body. module gpu_metal_149_m implicit none integer, parameter :: c = 10 contains pure function add_param(x) result(y) real, intent(in) :: x real :: y associate(unused => 1) y = x + c end associate end function end module program gpu_metal_149 use gpu_metal_149_m, only : add_param implicit none integer :: i real :: r(4) do concurrent (i = 1:4) r(i) = add_param(real(i)) end do if (abs(r(1) - 11.0) > 1e-5) error stop if (abs(r(2) - 12.0) > 1e-5) error stop if (abs(r(3) - 13.0) > 1e-5) error stop if (abs(r(4) - 14.0) > 1e-5) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/procedure_pointer_14.f900000664000175000017500000000145715174404631023750 0ustar alastairalastairprogram procedure_pointer_14 implicit none type :: t procedure(ifc), pointer :: ptr => null() end type t abstract interface subroutine ifc(self, a) import class(t), intent(in) :: self integer, optional, intent(in) :: a(:) end subroutine ifc end interface type(t) :: x integer :: a(3) a = [10, 20, 30] x%ptr => sub call x%ptr(a) contains subroutine sub(self, a) class(t), intent(in) :: self integer, optional, intent(in) :: a(:) if (.not. present(a)) error stop if (size(a) /= 3) error stop if (a(1) /= 10) error stop if (a(2) /= 20) error stop if (a(3) /= 30) error stop print *, "OK" end subroutine sub end program procedure_pointer_14 lfortran-0.63.0/integration_tests/read_19.f900000664000175000017500000000137515174404631021137 0ustar alastairalastairprogram read_19 ! Test D exponent notation in READ use iso_fortran_env, only: dp => real64 implicit none real(dp) :: x integer :: u open(newunit=u, status='scratch') ! Test D+xx notation write(u, '(A)') "1.5D+02" rewind(u) read(u, *) x if (abs(x - 150.0_dp) > 1.0e-10_dp) error stop "D+02 failed" ! Test D-xx notation rewind(u) write(u, '(A)') "2.5D-03" rewind(u) read(u, *) x if (abs(x - 0.0025_dp) > 1.0e-15_dp) error stop "D-03 failed" ! Test d (lowercase) notation rewind(u) write(u, '(A)') "3.0d+01" rewind(u) read(u, *) x if (abs(x - 30.0_dp) > 1.0e-10_dp) error stop "d+01 failed" close(u) print *, "PASS: D exponent notation works" end program read_19 lfortran-0.63.0/integration_tests/array_04_transfer.f900000664000175000017500000000305615174404631023236 0ustar alastairalastairmodule array_04_transfer_mod use, intrinsic :: iso_fortran_env, only: int32, int64, real32, int8 implicit none integer(int32), parameter :: sc_constsub = int(z'deadbeef', int32) integer(int32), parameter :: int32_arr(2) = [sc_constsub, sc_constsub] real(real32), parameter :: real32_arr(2) = [real(1.23, real32), real(4.56, real32)] integer(int64), parameter :: int32_int64 = transfer(int32_arr, 0_int64) integer(int64), parameter :: real32_int64 = transfer(real32_arr, 0_int64) integer(int64), parameter :: real32_int32 = transfer(real32_arr, 0_int32) end module program array_04_transfer use array_04_transfer_mod implicit none real :: value(5) = [1.1, 1.2, 1.3, 1.4, 1.5] integer(int8) :: key(16) = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16] integer :: val(5) val = transfer(value, val, 1 * size(value)) print * , val if (all(val /= [1066192077, 1067030938, 1067869798, 1068708659, 1069547520])) error stop if (real32_int32 /= 1067282596) error stop if (real32_int64 /= 4652758847580893348_8) error stop if (int32_int64 /= -2401053088876216593_8) error stop call test_sub(key) contains subroutine test_sub(key) integer(int64), save :: bend = 1 integer(int8), intent(in), target :: key(0:) integer(int64) :: buf(0:1) buf(0:2*bend-1) = transfer( key(0:16_8*bend-1_8), 0_int64, 2*bend ) print *, buf !! TODO: fix incorrect bug value ! if (any(buf /= [578437695752307201_8, 1157159078456920585_8])) error stop end subroutine end programlfortran-0.63.0/integration_tests/call_subroutine_without_type.f900000664000175000017500000000116515174404631025726 0ustar alastairalastairmodule module_call_subroutine_without_type type :: myType real :: r contains procedure, pass(self) :: get_i end type myType contains subroutine get_i(self) class(myType), intent(inout) :: self call get_r() contains subroutine get_r() print *, "r = ", self % r if (self%r /= 1.0) error stop end subroutine get_r end subroutine get_i end module module_call_subroutine_without_type program call_subroutine_without_type use module_call_subroutine_without_type end program call_subroutine_without_typelfortran-0.63.0/integration_tests/procedure_17.f900000664000175000017500000000122215174404631022201 0ustar alastairalastairmodule proc_type_procedure_17 contains subroutine cb() implicit none end subroutine end module module cobylb_mod_procedure_17 contains subroutine cobylb(call_back) use proc_type_procedure_17 procedure(cb) :: call_back integer, save :: x = 3 call calcfc_internal() contains subroutine calcfc_internal() implicit none integer :: y(x) print *, 'x = ', x if ( x /= 3 ) error stop end subroutine calcfc_internal end subroutine cobylb end module program procedure_17 use cobylb_mod_procedure_17 use proc_type_procedure_17 call cobylb(cb) end program lfortran-0.63.0/integration_tests/template_interface_01.f900000664000175000017500000000545115174404631024045 0ustar alastairalastairmodule template_interface_01_m implicit none public :: test_template requirement operator_r(T, U, V, binary_func) type, deferred :: T type, deferred :: U type, deferred :: V pure elemental function binary_func(lhs, rhs) result(res) type(T), intent(in) :: lhs type(U), intent(in) :: rhs type(V) :: res end function end requirement requirement cast_r(T, cast) type, deferred :: T pure elemental function cast(arg) result(res) integer, intent(in) :: arg type(T) :: res end function end requirement template sum_t(T, add, cast) require :: operator_r(T, T, T, add), cast_r(T, cast) private public :: generic_sum interface operator(+) procedure add end interface contains pure function generic_sum(arr) result(res) type(T), intent(in) :: arr(:) type(T) :: res integer :: n, i n = size(arr) res = cast(0) if (n > 0) then res = arr(1) do i=2,n res = res + arr(i) end do end if end function end template contains pure elemental function cast_integer(arg) result(res) integer, intent(in) :: arg integer :: res res = 0 end function pure elemental function cast_real(arg) result(res) integer, intent(in) :: arg real :: res res = 0.0 end function pure function simple_generic_sum {T, add, cast} (arr) result(res) require :: operator_r(T, T, T, add), cast_r(T, cast) interface operator(+) procedure add end interface type(T), intent(in) :: arr(:) type(T) :: res integer :: n, i n = size(arr) res = cast(0) if (n > 0) then res = arr(1) do i=2,n res = res + arr(i) end do end if end function subroutine test_template() instantiate sum_t(integer, operator(+), cast_integer), only: generic_sum_integer => generic_sum instantiate sum_t(real, operator(+), cast_real), only: generic_sum_real => generic_sum integer :: ai(10), i, ri real :: ar(10), rr do i = 1, 10 ai(i) = i ar(i) = i end do ri = generic_sum_integer(ai) rr = generic_sum_real(ar) print *, ri print *, rr print *, simple_generic_sum{integer, operator(+), cast_integer}(ai) print *, simple_generic_sum{real, operator(+), cast_real}(ar) end subroutine end module program template_interface_01 use template_interface_01_m implicit none call test_template() end programlfortran-0.63.0/integration_tests/intrinsics_190.f900000664000175000017500000000034115174404631022461 0ustar alastairalastairprogram intrinsics_190 implicit none integer :: res(1) print *, kind([real:: 1]) ! this line is necessary to assure it works res = kind([real:: 1]) print *, res if (res(1) /= 4) error stop end program lfortran-0.63.0/integration_tests/string_95.f900000664000175000017500000000064315174404631021533 0ustar alastairalastairprogram string_95 character(2), allocatable :: str str = f1(5) print *, len(str), str if (len(str) /= 2) error stop if (str /= "ab") error stop contains function f1(n) result(res) integer :: n character(n), allocatable :: res allocate(res) res = "abcde" print *, len(res), res if (len(res) /= 5) error stop if (res /= "abcde") error stop end function end program string_95lfortran-0.63.0/integration_tests/intrinsics_403.f900000664000175000017500000000173315174404631022464 0ustar alastairalastairprogram intrinsics_403 implicit none real :: r1, r2, result integer :: i_result r1 = 42.1 r2 = 43.43 i_result = min1(r1, r2) print *, 'min1 test: ', i_result if (i_result /= 42) error stop i_result = max1(r1, r2) print *, 'max1 test: ', i_result if (i_result /= 43) error stop r1 = -5.7 r2 = -3.2 i_result = min1(r1, r2) print *, 'min1 negative test: ', i_result if (i_result /= -5) error stop i_result = max1(r1, r2) print *, 'max1 negative test: ', i_result if (i_result /= -3) error stop i_result = min1(10.5, 20.3, 5.1, 15.9) print *, 'min1 multiple args: ', i_result if (i_result /= 5) error stop i_result = max1(10.5, 20.3, 5.1, 15.9) print *, 'max1 multiple args: ', i_result if (i_result /= 20) error stop result = min1(r1, r2) print *, 'min1 to real: ', result if (result /= -5.0) error stop result = max1(r1, r2) print *, 'max1 to real: ', result if (result /= -3.0) error stop end program intrinsics_403 lfortran-0.63.0/integration_tests/struct_type_10.f900000664000175000017500000000230615174404631022573 0ustar alastairalastair! Test that an elemental function returning a derived type with an allocatable ! component can be called on a dummy array argument and the result passed ! directly to another function (no SIGSEGV). module struct_type_10_mod implicit none public :: string_t type :: string_t character(len=:), allocatable :: s end type interface string_t module procedure from_chars end interface contains elemental function from_chars(c) result(r) character(len=*), intent(in) :: c type(string_t) :: r r%s = c end function function first(arr) result(r) type(string_t), intent(in) :: arr(:) type(string_t) :: r r = arr(1) end function function csv_first(strings) result(r) character(len=*), intent(in) :: strings(:) type(string_t) :: r ! Bug: SIGSEGV when elemental constructor result is passed directly. r = first(string_t(strings)) end function end module struct_type_10_mod program struct_type_10 use struct_type_10_mod implicit none type(string_t) :: r r = csv_first(["foo", "bar", "baz"]) if (r%s /= "foo") error stop print *, r%s end program struct_type_10 lfortran-0.63.0/integration_tests/allocate_27.f900000664000175000017500000000053415174404631022003 0ustar alastairalastairprogram allocate_26 implicit none character(:), allocatable :: temp_file allocate(temp_file, source=get_temp_filename()) if (temp_file /= "tmp_12345.txt") error stop contains function get_temp_filename() result(fname) character(len=:), allocatable :: fname fname = "tmp_12345.txt" end function get_temp_filename end program allocate_26lfortran-0.63.0/integration_tests/template_05.f900000664000175000017500000000273415174404631022032 0ustar alastairalastairmodule template_05_m requirement req(T, op) type, deferred :: t elemental function op(x, y) result(r) type(T), intent(in) :: x, y type(T) :: r end function end requirement template tmp(T, plus) require :: req(T, plus) template tmp_minus(minus) require :: req(T, minus) require :: req(T, plus) template tmp_mult(mult) require :: req(T, mult) template tmp_div(div) require :: req(T, div) end template end template contains function g_minus(x, y) result(r) type(T), intent(in) :: x, y type(T) :: r r = minus(x, y) end function end template contains function g_plus(x, y) result(r) type(T), intent(in) :: x, y type(T) :: r r = plus(x, y) end function end template end module program template_05 use template_05_m instantiate tmp(integer, operator(+)), & only: integer_plus => g_plus, integer_tmp_minus => tmp_minus instantiate integer_tmp_minus(operator(-)), & only: integer_minus => g_minus, integer_tmp_mult => tmp_mult instantiate tmp(real, operator(+)), & only: real_plus => g_plus, real_tmp_minus => tmp_minus instantiate real_tmp_minus(operator(-)), & only: real_minus => g_minus, real_tmp_mult => tmp_mult end programlfortran-0.63.0/integration_tests/derived_types_06.f900000664000175000017500000000027315174404631023062 0ustar alastairalastairmodule abstract_type implicit none contains subroutine subrout(a) class(*), intent(out) :: a end subroutine end module program derived_types_01 end programlfortran-0.63.0/integration_tests/arrays_84.f900000664000175000017500000000020515174404631021516 0ustar alastairalastairprogram arrays_84 implicit none integer :: arr(-5) print *, size(arr) if ( size(arr) /= 0 ) error stop end program arrays_84 lfortran-0.63.0/integration_tests/string_112.f900000664000175000017500000000170215174404631021576 0ustar alastairalastairprogram string_112 implicit none character(len=:), allocatable :: keywords(:) character(len=100) :: warn integer :: ierr allocate(character(len=20) :: keywords(5)) if (len(keywords) /= 20) error stop if (size(keywords) /= 5) error stop keywords = ['one ', 'two ', 'three', 'four ', 'five '] if (trim(keywords(1)) /= 'one') error stop if (trim(keywords(2)) /= 'two') error stop if (trim(keywords(3)) /= 'three') error stop if (trim(keywords(4)) /= 'four') error stop if (trim(keywords(5)) /= 'five') error stop if (atleast('KEYWORD', max(len(keywords), 8)) /= 7) error stop write(warn, '(a,1x,a,1x,a,1x,a)') 'KEYWORD', 'SHORT', 'PRESENT', 'VALUE' if (trim(warn) /= 'KEYWORD SHORT PRESENT VALUE') error stop contains integer function atleast(arg1, arg2) character(len=*), intent(in) :: arg1 integer, intent(in) :: arg2 atleast = len(arg1) end function atleast end program string_112 lfortran-0.63.0/integration_tests/logical1.f900000664000175000017500000000032115174404631021374 0ustar alastairalastairprogram logical1 ! this program checks logical operators implicit none ! variable declaration logical :: a, b ! assigning values a = .true. b = .false. print *, a, b end program logical1 lfortran-0.63.0/integration_tests/while_02.f900000664000175000017500000000066115174404631021321 0ustar alastairalastairprogram while_02 implicit none integer :: i, j i = 0 j = 0 do while (i < 10) i = i + 1 j = j + i end do if (j /= 55) error stop if (i /= 10) error stop i = 0 j = 0 do while (i < 10) i = i + 1 if (i == 2) exit j = j + i end do if (j /= 1) error stop if (i /= 2) error stop i = 0 j = 0 do while (i < 10) i = i + 1 if (i == 2) cycle j = j + i end do if (j /= 53) error stop if (i /= 10) error stop end lfortran-0.63.0/integration_tests/separate_compilation_34a.f900000664000175000017500000000112315174404631024553 0ustar alastairalastairmodule separate_compilation_34a implicit none abstract interface function func_iface(x) double precision, intent(in) :: x double precision :: func_iface end function end interface contains function my_func(x) result(y) double precision, intent(in) :: x double precision :: y y = x * 2.0d0 end function subroutine call_it() procedure(func_iface), pointer, save :: fptr => my_func double precision :: res res = fptr(3.0d0) print *, res if (abs(res - 6.0d0) > 1.0d-12) error stop end subroutine end module separate_compilation_34a lfortran-0.63.0/integration_tests/gpu_metal_161.f900000664000175000017500000000107715174404631022256 0ustar alastairalastairprogram gpu_metal_161 ! Test: separate compilation with multiple files where the module file ! has no do concurrent and the main program has a GPU kernel. ! Verifies that the Metal shader source is regenerated per translation ! unit so the kernel name matches at runtime. use gpu_metal_161_m implicit none real :: a(4) integer :: i a = 1.0 do concurrent (i = 1:4) a(i) = a(i) + 1.0 end do print *, a(1) if (abs(a(1) - 2.0) > 1e-6) error stop if (abs(a(2) - 2.0) > 1e-6) error stop if (abs(a(3) - 2.0) > 1e-6) error stop if (abs(a(4) - 2.0) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/optional_07.f900000664000175000017500000000114215174404631022036 0ustar alastairalastairprogram optional_07 ! Test for issue #9561: absent optional array arguments passed through nested calls implicit none integer :: x(666) call outer( x(:) ) contains subroutine outer( x, opt ) integer, intent(inout) :: x(:) integer, intent(in), optional :: opt(:) call inner( x(:), opt ) end subroutine outer subroutine inner( x, opt ) integer, intent(inout) :: x(:) integer, intent(in), optional :: opt(size(x)) print *,'opt present?',present(opt) if (present(opt)) error stop "Expected opt to be absent" end subroutine inner end program optional_07 lfortran-0.63.0/integration_tests/string_35.f900000664000175000017500000000020715174404631021521 0ustar alastairalastairprogram string_35 implicit none print *, index("pat", "patter") if (index("pat", "patter") /= 0) error stop end program lfortran-0.63.0/integration_tests/derived_types_90.f900000664000175000017500000000071715174404631023070 0ustar alastairalastairprogram derived_types_90 implicit none type int_t integer :: i end type type(int_t) :: T_ONE, T_TWO, T_THREE type(int_t) :: T_ALL(3) T_ONE = int_t(1) T_TWO = int_t(2) T_THREE = int_t(3) T_ALL = (/ T_ONE, T_TWO, T_THREE /) if (T_ALL(1)%i /= 1) error stop "T_ALL(1)%i should be 1" if (T_ALL(2)%i /= 2) error stop "T_ALL(2)%i should be 2" if (T_ALL(3)%i /= 3) error stop "T_ALL(3)%i should be 3" end program derived_types_90 lfortran-0.63.0/integration_tests/legacy_array_sections_06.f900000664000175000017500000000127215174404631024565 0ustar alastairalastairmodule legacy_array_sections_06_module contains subroutine dbtpcf(work) real(4),dimension(*), intent(out) :: work integer(4) :: iq call dbintk(work(iq)) end subroutine dbtpcf subroutine dbintk(q) implicit none real(4),dimension(*),intent(out) :: q end subroutine dbintk end module legacy_array_sections_06_module program legacy_array_sections_06 use legacy_array_sections_06_module implicit none real(4), dimension(10) :: work work = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0] call dbtpcf(work) print *, work if (any(work - [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0] > 1e-6)) error stop end program legacy_array_sections_06lfortran-0.63.0/integration_tests/intrinsics_67.f900000664000175000017500000000224215174404631022406 0ustar alastairalastairprogram intrinsics_67 double precision :: x x = 1.0D0 print *, dcosh(x) print *, dsinh(x) print *, dcosh(1.2D0) print *, dsinh(1.2D0) print *, dtanh(x) print *, dtanh(1.2D0) if (abs(dcosh(x) - 1.5430806348152437D0) > 1d-14) error stop if (abs(dsinh(x) - 1.1752011936438014D0) > 1d-14) error stop if (abs(dcosh(1.2D0) - 1.8106555673243747D0) > 1d-14) error stop if (abs(dsinh(1.2D0) - 1.5094613554121725D0) > 1d-12) error stop if (abs(dtanh(x) - 0.76159415595576485D0) > 1d-14) error stop if (abs(dtanh(1.2D0) - 0.83365460701215521D0) > 1d-14) error stop x = 4.2D0 print *, dcosh(x) print *, dsinh(x) print *, dcosh(4.2D0) print *, dsinh(4.2D0) print *, dtanh(x) print *, dtanh(4.2D0) if (abs(dcosh(x) - 33.350663308872818D0) > 1d-14) error stop if (abs(dsinh(x) - 33.335667732052336D0) > 1d-14) error stop if (abs(dcosh(4.2D0) - 33.350663308872818D0) > 1d-14) error stop if (abs(dsinh(4.2D0) - 33.335667732052336D0) > 1d-14) error stop if (abs(dtanh(x) - 0.99955036645953343D0) > 1d-14) error stop if (abs(dtanh(4.2D0) - 0.99955036645953343D0) > 1d-14) error stop end program lfortran-0.63.0/integration_tests/return_03.f900000664000175000017500000000063715174404631021534 0ustar alastairalastairprogram main integer :: main_out = 999 call main1(main_out) print *, "main1 called" contains subroutine main1(out_var) integer :: out_var integer :: i i = 10 if (i .GT. 5) then out_var = i print *, "early return" return end if print *, "normal return" out_var = i end subroutine main1 end program lfortran-0.63.0/integration_tests/character_03.f900000664000175000017500000000016015174404631022140 0ustar alastairalastairprogram character_03 implicit none character(len = 5) :: s s = "12345678" print *, s end programlfortran-0.63.0/integration_tests/gpu_metal_193.f900000664000175000017500000000157115174404631022262 0ustar alastairalastair! Test: passing allocatable component of derived type array element to a ! function inside do concurrent. Exercises correct Metal codegen for ! struct-member array arguments (no address-of-rvalue) and runtime-sized ! pre-allocation of output struct members. program gpu_metal_193 implicit none type :: vec_t real, allocatable :: v(:) end type integer, parameter :: n = 4 type(vec_t) :: a(n), b(n) integer :: i do i = 1, n allocate(a(i)%v(1)) a(i)%v(1) = real(i) end do do concurrent(i = 1:n) b(i) = f(a(i)%v) end do if (abs(b(1)%v(1) - 1.0) > 1e-6) error stop if (abs(b(2)%v(1) - 2.0) > 1e-6) error stop if (abs(b(3)%v(1) - 3.0) > 1e-6) error stop if (abs(b(4)%v(1) - 4.0) > 1e-6) error stop print *, "PASS" contains pure function f(x) result(r) real, intent(in) :: x(:) type(vec_t) :: r r%v = x end function end program lfortran-0.63.0/integration_tests/class_64.f900000664000175000017500000000203515174404631021323 0ustar alastairalastairmodule class_64_mod_1 type, abstract :: toml_value integer :: x = 0 contains procedure :: accept end type toml_value contains subroutine accept(self) class(toml_value), intent(inout) :: self self%x = self%x + 1 end subroutine accept end module module class_64_mod_2 use class_64_mod_1 type, extends(toml_value) :: toml_keyval end type toml_keyval contains subroutine temp(visitor, l1) class(toml_value), intent(inout), target :: visitor class(toml_value), pointer :: ptr logical :: l1 ptr => visitor if (l1) then select type(ptr) class is(toml_keyval) call ptr%accept() end select end if select type(ptr) class is(toml_keyval) call ptr%accept() end select end subroutine end module class_64_mod_2 program class_64 use class_64_mod_2 type(toml_keyval) :: key call temp(key, .true.) if (key%x /= 2) error stop call temp(key, .false.) if (key%x /= 3) error stop end program class_64 lfortran-0.63.0/integration_tests/intrinsics_218.f900000664000175000017500000000064415174404631022470 0ustar alastairalastairprogram intrinsics_218 implicit none integer, parameter :: new_len = len(new_line('a')) character(len=*), parameter :: str = new_line('') print *, new_len if (new_len /= 1) error stop print*, "Hello, World!", new_line('a') call temp(str) contains subroutine temp(str) character(len=*) :: str print *, len(str) if(len(str) /= 1) error stop end subroutine end program lfortran-0.63.0/integration_tests/elemental_17.f900000664000175000017500000000161315174404631022163 0ustar alastairalastairmodule elemental_17_mod implicit none type string_t character(len=:), allocatable :: string_ end type string_t contains elemental function bracket(x) result(res) class(string_t), intent(in) :: x type(string_t) :: res res%string_ = x%string_ // " called func" end function bracket end module elemental_17_mod program elemental_17 use elemental_17_mod implicit none type(string_t) :: lines(3) lines(1)%string_ = "Hello" lines(2)%string_ = "World" allocate(character(0) :: lines(3)%string_) ! Allocate empty strings (unallocated variables musn't be referenced) lines = bracket(lines) print *, lines(1)%string_ if(lines(1)%string_ /= "Hello called func") error stop print *, lines(2)%string_ if(lines(2)%string_ /= "World called func") error stop print *, lines(3)%string_ if(lines(3)%string_ /= " called func") error stop end program elemental_17 lfortran-0.63.0/integration_tests/read_25.f900000664000175000017500000000057115174404631021131 0ustar alastairalastairprogram read_25 implicit none character(8) :: string = 'abcd', newstring = 'ABCD' character(8):: newstring2 = 'ABCD' read(string, "(A)") newstring(5:8) read(string(1:4),"(A)") newstring2 print "(A)", newstring print "(A)", newstring2 if (newstring /= 'ABCDabcd') error stop if (newstring2 /= 'abcd') error stop end program read_25lfortran-0.63.0/integration_tests/intrinsics_239.f900000664000175000017500000000261415174404631022472 0ustar alastairalastairprogram intrinsics_239 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real(sp) :: x = 0.17_sp real(dp) :: y = 0.29_dp real(sp), parameter :: x1 = erfc_scaled(0.11_sp) real(dp), parameter :: y1 = erfc_scaled(0.34_dp) real(sp) :: x2(3) = [0.11_sp, 0.12_sp, 0.13_sp] real(dp) :: y2(3) = [0.34_dp, 0.35_dp, 0.36_dp] real(sp), parameter :: x3(3) = erfc_scaled([0.11_sp, 0.12_sp, 0.13_sp]) real(dp), parameter :: y3(3) = erfc_scaled([0.34_dp, 0.35_dp, 0.36_dp]) print *, erfc_scaled(x) if ( abs(erfc_scaled(x) - 0.833758295_sp) > 1e-6 ) error stop print *, erfc_scaled(y) if ( abs(erfc_scaled(y) - 0.74152871645209784_dp) > 1e-12 ) error stop print *, x1 if ( abs(x1 - 0.887045681_sp) > 1e-6 ) error stop print *, y1 if ( abs(y1 - 0.70791780660314296_dp) > 1e-12 ) error stop print *, erfc_scaled(x2) if ( any(abs(erfc_scaled(x2) - [0.887045741_sp, 0.877791286_sp, 0.868690372_sp]) > 1e-6) ) error stop print *, erfc_scaled(y2) if ( any(abs(erfc_scaled(y2) - [0.70791780660314296_dp, 0.70149633111958920_dp, 0.69517054536879996_dp]) > 1e-12) ) error stop print *, x3 if ( any(abs(x3 - [0.887045741_sp, 0.877791286_sp, 0.868690372_sp]) > 1e-6) ) error stop print *, y3 if ( any(abs(y3 - [0.70791780660314296_dp, 0.70149633111958909_dp, 0.69517054536879996_dp]) > 1e-12) ) error stop end programlfortran-0.63.0/integration_tests/derived_types_21.f900000664000175000017500000000164515174404631023063 0ustar alastairalastair module derived_types_21 implicit none type build_target_ptr type(build_target_t), pointer :: ptr end type build_target_ptr !> Type describing a generated build target type build_target_t !> File path of build target object relative to cwd character(:), allocatable :: output_file !> Resolved build dependencies type(build_target_ptr), allocatable :: dependencies(:) !> Target type integer :: target_type = 0 end type build_target_t contains integer function check1() implicit none type(build_target_t) :: package type(build_target_ptr), allocatable :: targets(:) check1 = 10 end function end module derived_types_21 program derived_types_21_program use derived_types_21 implicit none integer :: z z = check1() if (z /= 10) error stop end program derived_types_21_program lfortran-0.63.0/integration_tests/allocate_54.f900000664000175000017500000000253615174404631022007 0ustar alastairalastair! Test allocating unlimited polymorphic arrays with character type-spec and mold program allocate_54 implicit none ! Test 1: allocate class(*) array with explicit character type-spec call test_char_typespec() ! Test 2: allocate class(*) array with mold= of character dynamic type call test_char_mold() contains subroutine test_char_typespec() class(*), allocatable :: arr(:) allocate(character(4) :: arr(2)) select type (arr) type is (character(*)) arr(1) = "foo" arr(2) = "bar" if (arr(1) /= "foo ") error stop "test_char_typespec: arr(1) mismatch" if (arr(2) /= "bar ") error stop "test_char_typespec: arr(2) mismatch" class default error stop "test_char_typespec: unexpected type" end select deallocate(arr) end subroutine subroutine test_char_mold() class(*), allocatable :: arr(:), mold_var allocate(character(4) :: mold_var) allocate(arr(2), mold=mold_var) select type (arr) type is (character(*)) arr(1) = "abcd" arr(2) = "efgh" if (arr(1) /= "abcd") error stop "test_char_mold: arr(1) mismatch" if (arr(2) /= "efgh") error stop "test_char_mold: arr(2) mismatch" class default error stop "test_char_mold: unexpected type" end select deallocate(arr) deallocate(mold_var) end subroutine end program lfortran-0.63.0/integration_tests/operator_overloading_27.f900000664000175000017500000000277415174404631024453 0ustar alastairalastairmodule module_operator_overloading_27 implicit none type :: result_t logical :: passed = .false. end type interface operator(.check.) module procedure check end interface interface operator(.and.) module procedure and_op end interface contains elemental function check(actual, expected) result(res) integer, intent(in) :: actual, expected type(result_t) :: res res%passed = (actual == expected) end function elemental function and_op(lhs, rhs) result(res) type(result_t), intent(in) :: lhs, rhs type(result_t) :: res res%passed = lhs%passed .and. rhs%passed end function end module program operator_overloading_27 use module_operator_overloading_27 implicit none type(result_t) :: diagnosis(3) type(result_t) :: scalar_res ! Test: user-defined .and. on arrays returned by user-defined .check. diagnosis = (2 .check. [2,2,2]) .and. ([0,1,2] .check. [0,1,2]) if (.not. all(diagnosis%passed)) error stop ! Test: user-defined .and. on scalars scalar_res = (3 .check. 3) .and. (4 .check. 4) if (.not. scalar_res%passed) error stop ! Test: one side fails scalar_res = (3 .check. 3) .and. (4 .check. 5) if (scalar_res%passed) error stop ! Test: arrays with partial mismatch diagnosis = (1 .check. [1,2,1]) .and. ([3,3,3] .check. [3,3,3]) if (diagnosis(1)%passed .neqv. .true.) error stop if (diagnosis(2)%passed .neqv. .false.) error stop if (diagnosis(3)%passed .neqv. .true.) error stop print *, "All tests passed." end program lfortran-0.63.0/integration_tests/read_36.f900000664000175000017500000000100115174404631021120 0ustar alastairalastairprogram read_fmt5_test implicit none integer :: ia(5) integer :: i open (10, file='read_36_fort.10', status='replace', form='formatted') ! Format is repeated for each value on a new record write (10, '(i4)') (i, i=1,5) rewind (10) ! Should read each element from the next record read (10, '(i4)') ia do i = 1, 5 if (ia(i) /= i) then print *, "FAIL: ia(", i, ") =", ia(i), " expected ", i stop 1 end if end do print *, "test passed" close(10) end programlfortran-0.63.0/integration_tests/legacy_array_sections_01.f900000664000175000017500000000056315174404631024562 0ustar alastairalastairsubroutine a(w) double precision :: w(5) integer icon icon = 2 call b(w(icon)) return end subroutine b(con) double precision :: con(*) con(4) = -4.83D0 con(3) = 3.14D0 return end program legacy_array_sections_01 double precision :: w(5) w = 1.39D0 call a(w) print *, w if (abs(w(5) - (-4.83D0)) > 1d-8) error stop if (abs(w(4) - 3.14D0) > 1d-10) error stop end program lfortran-0.63.0/integration_tests/reserved_03.f900000664000175000017500000000036015174404631022025 0ustar alastairalastairprogram reserved_03 implicit none integer endsubroutine call integer if (endsubroutine /= 1) error stop contains subroutine integer integer subroutine subroutine = 1 endsubroutine & = subroutine/subroutine endsubroutine & ; end program lfortran-0.63.0/integration_tests/allocate_61_mod2.f900000664000175000017500000000034215174404631022717 0ustar alastairalastairmodule allocate_61_allocmod use allocate_61_mymod, only: w, make_t implicit none contains subroutine alloc_source(x) type(w), intent(inout) :: x allocate(x%a, source=make_t()) end subroutine end module lfortran-0.63.0/integration_tests/nested_vars3.f900000664000175000017500000000111415174404631022302 0ustar alastairalastairmodule nested_vars3 implicit none contains subroutine h(a, filename) integer, intent(in) :: a character(len=*), intent(in) :: filename integer, parameter :: x = 10 call g() contains subroutine g() print *, x if (x /= 10) error stop print *, a if (a /= 5) error stop if (filename /= "xyz") error stop end subroutine end subroutine end module program nested_vars3_main use nested_vars3, only: h implicit none call h(5, "xyz") end program lfortran-0.63.0/integration_tests/intrinsics_404.f900000664000175000017500000000027115174404631022461 0ustar alastairalastairprogram intrinsics_401 use iso_fortran_env, only: logical8 implicit none logical(kind=logical8) :: x x = .true. if (.not. x) error stop end program intrinsics_401 lfortran-0.63.0/integration_tests/derived_types_46.f900000664000175000017500000000072515174404631023070 0ustar alastairalastairmodule derived_types_46_m type :: derived integer :: n end type derived interface derived procedure :: init end interface derived contains function init() result(self) type(derived) :: self self%n = 10 end function init end module derived_types_46_m program derived_types_46 use derived_types_46_m, only: derived type(derived) :: obj obj = derived() if (obj%n /= 10) error stop end program derived_types_46 lfortran-0.63.0/integration_tests/arrays_op_10.f900000664000175000017500000000110215174404631022176 0ustar alastairalastairprogram main implicit none call compare_solutions() contains subroutine compare_solutions() implicit none integer :: i real :: x(2) print *, size(solution()) do i = 1, size(solution()) x(i) = i end do do i = 1, 2 print *, x(i) if( x(i) /= i ) error stop end do end subroutine compare_solutions pure function solution() result(x) implicit none real, dimension(2) :: x x = [1.0, 1.0] end function solution end program main lfortran-0.63.0/integration_tests/intrinsics_172.f900000664000175000017500000000574215174404631022473 0ustar alastairalastairprogram intrinsics_172 use iso_fortran_env, only: int32, int64 implicit none logical :: mask(3, 4) logical :: mask_(6, 9) logical :: mask_3(3, 4, 3) logical :: mask_4(4, 5, 3, 1) integer(kind=int32) :: res_4 integer(kind=int64) :: res_8 integer, dimension(2,3) :: a, b logical, dimension(2,3) :: mask2 integer, parameter :: c1 = count([.true., .false., .true., .false.]) integer(8), parameter :: c2 = count([.true., .false., .true., .false., .true., .false.], kind = 8) mask = reshape([ .true., .false., .true., .false., & .true., .false., .true., .false., & .true., .false., .true., .true.], [3, 4]) mask_ = .false. mask_(1, 1) = .true. mask_(1, 2) = .true. mask_(5, 1) = .true. mask_(5, 2) = .true. mask_(6, 7) = .true. mask_(4, 8) = .true. mask_3 = .false. mask_3(1, 1, :) = .true. mask_3(1, 2, :) = .true. mask_3(3, 1, :) = .true. mask_3(2, 2, :) = .true. mask_3(2, 4, :) = .true. mask_3(3, 3, :) = .true. mask_4 = .true. mask_4(1, 1, 1, 1) = .false. mask_4(1, 1, 1, :) = .false. mask_4(1, 1, 1, :) = .false. mask_4(1, 2, 1, :) = .false. mask_4(1, 2, 3, :) = .false. print *, count(mask) if (count(mask) /= 7) error stop print *, count(mask_) if (count(mask_) /= 6) error stop print *, count(mask_3) if (count(mask_3) /= 18) error stop print *, count(mask, 1) if (sum(count(mask, 1)) /= 7) error stop print *, count(mask, 2) if (sum(count(mask, 2)) /= 7) error stop print *, sum(count(mask_, 1)) if (sum(count(mask_, 1)) /= 6) error stop print *, shape(count(mask_, 1)) print *, sum(count(mask_, 2)) if (sum(count(mask_, 2)) /= 6) error stop print *, shape(count(mask_, 2)) print *, sum(count(mask_3, 1)) if (sum(count(mask_3, 1)) /= 18) error stop print *, shape(count(mask_3, 1)) print *, sum(count(mask_3, 2)) if (sum(count(mask_3, 2)) /= 18) error stop print *, shape(count(mask_3, 2)) print *, sum(count(mask_3, 3)) if (sum(count(mask_3, 3)) /= 18) error stop print *, sum(count(mask_4, 1)) if (sum(count(mask_4, 1)) /= 57) error stop print *, shape(count(mask_4, 1)) res_4 = count(mask_4, kind=4) if (res_4 /= 57) error stop res_8 = count(mask_4, kind=8) if (res_8 /= 57) error stop a = reshape( [ 1, 2, 3, 4, 5, 6 ], [ 2, 3 ]) b = reshape( [ 0, 7, 3, 4, 5, 8 ], [ 2, 3 ]) print '(3i3)', a(1,:) print '(3i3)', a(2,:) print * print '(3i3)', b(1,:) print '(3i3)', b(2,:) print * mask2 = a.ne.b print '(3l3)', mask2(1,:) print '(3l3)', mask2(2,:) print * print '(3i3)', count(mask2) if (count(mask2) /= 3) error stop print * print '(3i3)', count(mask2, 1) print * print '(3i3)', count(mask2, 2) print*, c1 if (c1 /= 2) error stop print*, c2 if (c2 /= 3) error stop print*, kind(c2) if (kind(c2) /= 8) error stop end program lfortran-0.63.0/integration_tests/associate_13.f900000664000175000017500000000256115174404631022167 0ustar alastairalastairprogram associate_13 implicit none complex(8), target :: my_complex(2, 3) complex(8), pointer :: my_complex_mirror(:, :) real(8), pointer :: my_complex_re(:, :) real(8), pointer :: my_complex_im(:, :) my_complex = reshape([(1, 2), (3, 4), (5, 6), (7, 8), (9, 10), (11, 12)], [2, 3]) my_complex_re => my_complex%re print *, my_complex_re(1, 1), my_complex_re(1, 2), my_complex_re(1, 3) print *, my_complex_re(2, 1), my_complex_re(2, 2), my_complex_re(2, 3) if (abs(my_complex_re(1, 1) - 1) > 1e-8_8) error stop if (abs(my_complex_re(1, 2) - 5) > 1e-8_8) error stop if (abs(my_complex_re(1, 3) - 9) > 1e-8_8) error stop if (abs(my_complex_re(2, 1) - 3) > 1e-8_8) error stop if (abs(my_complex_re(2, 2) - 7) > 1e-8_8) error stop if (abs(my_complex_re(2, 3) - 11) > 1e-8_8) error stop my_complex_im => my_complex%im print *, my_complex_im(1, 1), my_complex_im(1, 2), my_complex_im(1, 3) print *, my_complex_im(2, 1), my_complex_im(2, 2), my_complex_im(2, 3) if (abs(my_complex_im(1, 1) - 2) > 1e-8_8) error stop if (abs(my_complex_im(1, 2) - 6) > 1e-8_8) error stop if (abs(my_complex_im(1, 3) - 10) > 1e-8_8) error stop if (abs(my_complex_im(2, 1) - 4) > 1e-8_8) error stop if (abs(my_complex_im(2, 2) - 8) > 1e-8_8) error stop if (abs(my_complex_im(2, 3) - 12) > 1e-8_8) error stop end program lfortran-0.63.0/integration_tests/file_35.f900000664000175000017500000000062215174404631021133 0ustar alastairalastairprogram file_35 implicit none integer :: lun, ios = 8 character(len=100) :: message open(newunit=lun, file="file_35_test.txt", status="replace") close(unit=lun, iostat=ios, iomsg=message) print *, ios if (ios /= 0) then print *, "Close error:", trim(message) error stop else print *, "File closed successfully." end if end program file_35 lfortran-0.63.0/integration_tests/gpu_metal_136_mod.f900000664000175000017500000000061115174404631023110 0ustar alastairalastairmodule gpu_metal_136_m implicit none type :: point real :: x real :: y end type interface pure module function make_point(px, py) result(res) real, intent(in) :: px, py type(point) :: res end function end interface end module submodule(gpu_metal_136_m) gpu_metal_136_sub implicit none contains module procedure make_point res%x = px res%y = py end procedure end submodule lfortran-0.63.0/integration_tests/class_80.f900000664000175000017500000000123315174404631021320 0ustar alastairalastairmodule class_80_mod type :: class_value character(len=:), allocatable :: value end type type :: temp_type character(len=:), allocatable :: value end type contains subroutine cast_to_keyval(ptr, val) class(class_value), intent(inout) :: ptr(:) type(temp_type), intent(inout), optional :: val(:) val(1)%value = ptr(1)%value end subroutine cast_to_keyval end module program class_80 use class_80_mod type(temp_type), allocatable :: x(:) type(class_value), allocatable :: y(:) allocate(x(1)) allocate(y(1)) y(1)%value = "Hello World" call cast_to_keyval(y, x) if (x(1)%value /= "Hello World") error stop end program class_80lfortran-0.63.0/integration_tests/format_67.f900000664000175000017500000000060615174404631021513 0ustar alastairalastairprogram format_67 implicit none character :: fmt*10, line*80, letters*26 integer :: i letters = 'abcdefghijklmnopqrstuvwxyz' fmt = '(99(1X,A))' write(line, fmt) (letters(i:i), i=1,26) if (line(1:1) /= ' ') error stop if (line(2:2) /= 'a') error stop if (line(52:52) /= 'z') error stop if (len_trim(line) /= 52) error stop print "(A)", trim(line) end program format_67 lfortran-0.63.0/integration_tests/template_add_01b.f900000664000175000017500000000263215174404631022775 0ustar alastairalastairmodule template_add_01b_m implicit none private public :: add_t, test_template requirement R(T, F) type, deferred :: T interface operator (+) procedure F end interface function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z !print*, "x, y, z, x+y+z =", x, y, z, x+y+z z = x + y end function function add_generic2(x, y, z) result(s) type(T), intent(in) :: x, y, z type(T) :: s s = x + y + z end function end template contains integer function func_arg_int(x, y) result(z) integer, intent(in) :: x, y z = x + y end function subroutine test_template() integer :: n1, n2 instantiate add_t(integer, func_arg_int), only: add_integer => add_generic, add_integer2 => add_generic2 n1 = add_integer(5, 9) n2 = add_integer2(5, 9, 10) print*, "The result is", n1 print*, "The result is", n2 end subroutine end module program template_add_01b use template_add_01b_m implicit none call test_template() end programlfortran-0.63.0/integration_tests/read_30.f900000664000175000017500000000255415174404631021130 0ustar alastairalastairprogram read_30 implicit none integer :: io_w, io_r, stat integer :: filesize character(len=:), allocatable :: buffer character(len=*), parameter :: toml_text = & 'name = "core_lib"' // new_line('a') open(newunit=io_w, file="config.toml", access="stream", & form="unformatted", status="replace", iostat=stat) if (stat /= 0) error stop "open(write) failed" write(io_w, iostat=stat) toml_text if (stat /= 0) error stop "write failed" close(io_w) open(newunit=io_r, file="config.toml", access="stream", & form="unformatted", position="append", status="old", iostat=stat) if (stat /= 0) error stop "open(read) failed" inquire(unit=io_r, size=filesize) if (filesize <= 1) error stop "config.toml too small" allocate(character(len=filesize) :: buffer) buffer(filesize:filesize) = "?" read(io_r, pos=1, iostat=stat) buffer(:filesize-1) if (stat /= 0) error stop "stream read failed" close(io_r, status='delete') if (index(buffer, 'name') == 0) then error stop "expected key 'name' not found" end if if (buffer(filesize:filesize) /= "?") then error stop "buffer overflow detected" end if print *, "CONFIG CONTENT:" print *, trim(buffer) if (trim(buffer) /= 'name = "core_lib"?') error stop "config content mismatch" end program read_30 lfortran-0.63.0/integration_tests/functions_48.f900000664000175000017500000000114315174404631022227 0ustar alastairalastair! Testing a function is never called twice as a side effect of creating temporary strings (return slot) program functions_48 character(:), allocatable :: ss1 ss1 = ff(f2(), 10) print *, len(ss1) if(len(ss1) /= 20) error stop contains function ff(x, y) result(str) integer :: x integer :: y character(x + y) :: str end function function f2() result(num) integer :: num integer, save :: called = 0 num = 10 print *, "called" if(called /= 0) error stop called = called + 1 end function end program lfortran-0.63.0/integration_tests/equivalence_21.f900000664000175000017500000000061615174404631022513 0ustar alastairalastairsubroutine test_reversed_order() integer :: j1, j2 common /block2/ j1 equivalence (j1, j2) j1 = 10 j2 = 99 if (j1 /= 99) error stop if (j2 /= 99) error stop end subroutine program equivalence_21 equivalence (i1, i2) common /block/ i1 i1 = 24 i2 = 42 if (i1 /= 42) error stop if (i2 /= 42) error stop call test_reversed_order() end programlfortran-0.63.0/integration_tests/allocate_52.f900000664000175000017500000000105315174404631021776 0ustar alastairalastairmodule allocate_52_mod implicit none type :: node integer :: val = 0 end type type :: box type(node), pointer :: ptr => null() end type contains subroutine alloc_ptr(p) type(node), pointer :: p allocate(p) p%val = 42 end subroutine end module program allocate_52 use allocate_52_mod implicit none type(box) :: b call alloc_ptr(b%ptr) if (.not. associated(b%ptr)) error stop if (b%ptr%val /= 42) error stop deallocate(b%ptr) print *, "PASS" end program lfortran-0.63.0/integration_tests/pass_array_by_data_01.f900000664000175000017500000000037315174404631024037 0ustar alastairalastairprogram main implicit none integer :: info_original contains subroutine compare_solutions(x) implicit none integer :: y real, intent(in) :: x(:) y = info_original end subroutine end program main lfortran-0.63.0/integration_tests/class_91.f900000664000175000017500000000226715174404631021332 0ustar alastairalastairmodule class_91_mod implicit none ! Base abstract type type, abstract :: toml_value end type toml_value ! Concrete extended type type, extends(toml_value) :: toml_integer integer :: value end type toml_integer end module class_91_mod program class_91 use class_91_mod implicit none type(toml_integer), target :: i class(toml_value), pointer :: src class(toml_value), allocatable :: tmp ! Initialize concrete object i%value = 42 ! Pointer must associate with extended type src => i if (.not. associated(src)) then error stop "ERROR: src pointer not associated" end if ! Allocate polymorphic allocatable from pointer source allocate(tmp, source=src) if (.not. allocated(tmp)) then error stop "ERROR: tmp not allocated" end if ! Validate dynamic type and value select type (tmp) type is (toml_integer) if (tmp%value /= 42) then error stop "ERROR: value mismatch after allocate(source=)" end if print *, "Copied value:", tmp%value class default error stop "ERROR: wrong dynamic type in tmp" end select end program class_91 lfortran-0.63.0/integration_tests/operator_overloading_36_mod_base.f900000664000175000017500000000154315174404631026275 0ustar alastairalastairmodule operator_overloading_36_mod_base implicit none type :: array_type real :: val contains procedure :: negate_array procedure :: add_arrays procedure :: subtract_arrays generic, public :: operator(-) => negate_array, subtract_arrays generic, public :: operator(+) => add_arrays end type interface module function negate_array(a) result(c) class(array_type), intent(in) :: a type(array_type) :: c end function module function add_arrays(a, b) result(c) class(array_type), intent(in) :: a, b type(array_type) :: c end function module function subtract_arrays(a, b) result(c) class(array_type), intent(in) :: a, b type(array_type) :: c end function end interface end module lfortran-0.63.0/integration_tests/derived_types_79.f900000664000175000017500000000204515174404631023073 0ustar alastairalastairmodule m_labels_derived_types_79 implicit none type :: toml_label character(:), allocatable :: source end type toml_label type :: toml_diagnostic type(toml_label), allocatable :: label(:) end type toml_diagnostic end module m_labels_derived_types_79 module m_render_derived_types_79 use m_labels_derived_types_79 implicit none contains function render_diagnostic(d) result(out) type(toml_diagnostic), intent(in) :: d character(:), allocatable :: out if (allocated(d%label)) then out = "Diagnostic: " // d%label(1)%source else out = "Empty diagnostic" end if end function render_diagnostic end module m_render_derived_types_79 program derived_types_79 use m_labels_derived_types_79 use m_render_derived_types_79 implicit none type(toml_diagnostic) :: diag type(toml_label) :: lbl(1) lbl(1)%source = "Something went wrong" diag%label = lbl print *, render_diagnostic(diag) end program derived_types_79 lfortran-0.63.0/integration_tests/string_53.f900000664000175000017500000000074115174404631021524 0ustar alastairalastairmodule string_53_mod contains pure function doubler(x) result (ret) integer,intent(in) :: x integer :: ret ret = x * 2 end function subroutine sub() character(len=doubler(10)) :: zz print *, len(zz) ! Make sure character's length is set correctly when it's a call to a function if(len(zz) /= 20) error stop end subroutine end module program string_53 use string_53_mod call sub() end program lfortran-0.63.0/integration_tests/operator_overloading_30.f900000664000175000017500000000114015174404631024427 0ustar alastairalastairmodule operator_overloading_30_m implicit none interface operator(/) module procedure join_path end interface contains function join_path(a, b) result(c) character(*), intent(in) :: a, b character(:), allocatable :: c c = a // '/' // b end function end module program operator_overloading_30 use operator_overloading_30_m, only: operator(/) implicit none character(:), allocatable :: p p = 'home'/'user' if (p /= 'home/user') error stop p = p/'documents' if (p /= 'home/user/documents') error stop print *, p end program lfortran-0.63.0/integration_tests/openmp_31.f900000664000175000017500000000055615174404631021514 0ustar alastairalastairprogram openmp_31 implicit none real :: phi(100) integer :: j phi = 10124.142 !$omp parallel do private(j) shared(phi) do j = 1, 100 print *, phi(1) !$omp atomic phi(1) = phi(1) + 1 end do !$omp end parallel do print *, phi(1) if (abs(phi(1) - 10224.1416) > 1e-8) error stop end program openmp_31 lfortran-0.63.0/integration_tests/read_68.f900000664000175000017500000000207515174404631021141 0ustar alastairalastairprogram read_68 implicit none integer, parameter :: dp = kind(1.0d0) character(len=50) :: line real(dp) :: a, b, c integer :: ios, x, y ! Test 1: comma-separated reals with spaces after comma line = "1.0, 2.0" read(line, *, iostat=ios) a, b if (ios /= 0) error stop if (abs(a - 1.0_dp) > 1.0e-10_dp) error stop if (abs(b - 2.0_dp) > 1.0e-10_dp) error stop ! Test 2: comma-separated reals without spaces line = "3.5,4.5" read(line, *, iostat=ios) a, b if (ios /= 0) error stop if (abs(a - 3.5_dp) > 1.0e-10_dp) error stop if (abs(b - 4.5_dp) > 1.0e-10_dp) error stop ! Test 3: multiple spaces after comma line = "5.0, 6.0, 7.0" read(line, *, iostat=ios) a, b, c if (ios /= 0) error stop if (abs(a - 5.0_dp) > 1.0e-10_dp) error stop if (abs(b - 6.0_dp) > 1.0e-10_dp) error stop if (abs(c - 7.0_dp) > 1.0e-10_dp) error stop ! Test 4: comma-separated integers with spaces line = "10, 20" read(line, *, iostat=ios) x, y if (ios /= 0) error stop if (x /= 10) error stop if (y /= 20) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/gpu_metal_156.f900000664000175000017500000000106015174404631022252 0ustar alastairalastairprogram gpu_metal_156 ! Test derived-type array component inside do concurrent. ! The gpu_offload pass must elementize StructInstanceMember references ! with array type so that the Metal shader indexes element-by-element. implicit none type :: t real :: b(3) end type type(t) :: x integer :: i real :: z(3) x%b(1) = 10.0 x%b(2) = 20.0 x%b(3) = 30.0 z = 0.0 do concurrent (i = 1:1) z = x%b end do if (abs(z(1) - 10.0) > 1.0e-6) error stop if (abs(z(2) - 20.0) > 1.0e-6) error stop if (abs(z(3) - 30.0) > 1.0e-6) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/complex_03.f900000664000175000017500000000033215174404631021654 0ustar alastairalastairprogram complex_03 implicit none complex :: x real :: a, b x = (1.0,-3.0) a = x%re b = x%im print *, a, b print *, x%re, x%im if (abs(x%re - 1) > 1e-5) error stop if (abs(x%im - (-3)) > 1e-5) error stop end program lfortran-0.63.0/integration_tests/intrinsics_193.f900000664000175000017500000000232415174404631022467 0ustar alastairalastairprogram intrinsics_193 use iso_fortran_env, only: dp => real64 integer :: x, y, z integer(dp) :: a, b, c x = 44 y = -501 z = 0 a = 5468272828_dp b = -3526282829_dp c = 83983_dp print *, poppar(x) if(poppar(x) /= 1) error stop print *, poppar(44) if(poppar(44) /= 1) error stop print *, poppar(y) if(poppar(y) /= 0) error stop print *, poppar(-501) if(poppar(-501) /= 0) error stop print *, poppar(z) if(poppar(z) /= 0) error stop print *, poppar(0) if(poppar(0) /= 0) error stop print *, poppar(a) if(poppar(a) /= 1) error stop print *, poppar(5468272828_dp) if(poppar(5468272828_dp) /= 1) error stop print *, poppar(b) if(poppar(b) /= 0) error stop print *, poppar(-3526282829_dp) if(poppar(-3526282829_dp) /= 0) error stop print *, poppar(c) if(poppar(c) /= 1) error stop print *, poppar(83983_dp) if(poppar(83983_dp) /= 1) error stop print *, kind(poppar(-501)) if(kind(poppar(-501)) /= 4) error stop print *, kind(poppar(y)) if(kind(poppar(y)) /= 4) error stop print *, kind(poppar(5468272828_dp)) if(kind(poppar(5468272828_dp)) /= 4) error stop end program lfortran-0.63.0/integration_tests/functions_28.f900000664000175000017500000000111015174404631022217 0ustar alastairalastairprogram test implicit none real(8) :: y(2,2) real(8) :: x(2) = [1,2] real(8) :: z(size(y,2)) integer :: j = 1 z = matprod12(x, y) print *, z contains function matprod12(x, y) result(z) implicit none real(8), intent(in) :: x(:) real(8), intent(in) :: y(:, :) real(8) :: z(size(y, 2)) integer :: j j = size(y,2) z(j) = inprod(x, y(:, j)) end function matprod12 function inprod(x, y) result(z) implicit none real(8), intent(in) :: x(:) real(8), intent(in) :: y(:) real(8) :: z end function inprod end program lfortran-0.63.0/integration_tests/block_12.f900000664000175000017500000000065215174404631021304 0ustar alastairalastairmodule block_12_mod implicit none type :: legend_entry_t integer :: x end type legend_entry_t end module block_12_mod program block_12 implicit none block use block_12_mod, only: legend_entry_t type(legend_entry_t), allocatable :: new_entries(:) allocate(new_entries(0)) if (size(new_entries) /= 0) error stop end block print *, "ok" end program block_12 lfortran-0.63.0/integration_tests/intrinsics_324.f900000664000175000017500000000030215174404631022455 0ustar alastairalastairprogram intrinsics_324 integer, allocatable :: A(:) integer :: B(2) = [2,2] allocate(A(2)) A = [1,2] A = max(A, B) print *, A if (any(A /= 2)) error stop end programlfortran-0.63.0/integration_tests/submodule_21c.f900000664000175000017500000000043315174404631022351 0ustar alastairalastairsubmodule(submodule_21b_string_mod) submodule_21c_string_sub implicit none contains module procedure assign_character_to_string_t lhs%string_ = rhs end procedure module procedure file_extension extension = "" end procedure end submodule submodule_21c_string_sub lfortran-0.63.0/integration_tests/custom_operator_13.f900000664000175000017500000000162715174404631023443 0ustar alastairalastairmodule custom_operator_13_mod implicit none type :: string_t character(len=:), allocatable :: s contains procedure :: cat_sc procedure, pass(rhs) :: assign_to_char generic :: operator(//) => cat_sc generic :: assignment(=) => assign_to_char end type contains elemental function cat_sc(lhs, rhs) result(res) class(string_t), intent(in) :: lhs character(len=*), intent(in) :: rhs type(string_t) :: res res%s = lhs%s // rhs end function pure subroutine assign_to_char(lhs, rhs) character(len=:), intent(out), allocatable :: lhs class(string_t), intent(in) :: rhs lhs = rhs%s end subroutine end module program custom_operator_13 use custom_operator_13_mod implicit none type(string_t) :: x character(len=:), allocatable :: result x%s = "hello" result = x // " world" if (result /= "hello world") error stop print *, result end program lfortran-0.63.0/integration_tests/write_fortran_01.f900000664000175000017500000000132415174404631023072 0ustar alastairalastairprogram write_fortran_01 implicit none character(len=100) :: output write(output, '(A)') "Hello" if (trim(output) /= "Hello") error stop "A format failed" write(output, '(I0)') 42 if (trim(output) /= "42") error stop "I0 format failed" write(output, '(I5)') 42 if (output(1:5) /= " 42") error stop "I5 format failed" write(output, '(F8.2)') 3.14159 if (trim(adjustl(output)) /= "3.14") error stop "F8.2 format failed" write(output, '(E12.4)') 1.23e-5 if (index(output, "123") == 0) error stop "E12.4 format failed" write(output, *) 123 if (trim(adjustl(output)) /= "123") error stop "Default format failed" end program write_fortran_01 lfortran-0.63.0/integration_tests/include_02.f900000664000175000017500000000027515174404631021635 0ustar alastairalastairprogram include_02 integer :: included, include(2) included = 10 include = 10 print *, included, include(1), include(2) include(1) = 3 print *, included, include(1), include(2) end program lfortran-0.63.0/integration_tests/select_rank_24.f900000664000175000017500000000056415174404631022511 0ustar alastairalastairprogram select_rank_24 implicit none real :: arr(3, 4) arr = 1.0 call test_sub(arr) contains subroutine test_sub(x) real, dimension(..), intent(in) :: x integer :: n, total n = size(x, 1) if (n /= 3) error stop total = size(x) if (total /= 12) error stop end subroutine end program select_rank_24 lfortran-0.63.0/integration_tests/valid_array_assignment_same_length_different_start.f900000664000175000017500000000062415174404631032245 0ustar alastairalastairprogram valid_array_assignment_same_length_different_start ! array with size 3 and start index 2 integer :: arr1(2:4) ! array with size 3 and start index 1 integer :: arr2(1:3) arr1 = [1, 2, 3] ! valid assignment as only "size" matters for array ! assignment, not "start index" arr2 = arr1 if (size(arr2) /= 3) error stop if (arr2(1) /= 1) error stop end program lfortran-0.63.0/integration_tests/separate_compilation_11a.f900000664000175000017500000000063615174404631024556 0ustar alastairalastairmodule separate_compilation_11a_module contains subroutine parent_of_nested_subroutine(a, b) integer, intent(inout) :: a, b call nested_subroutine(a, b) contains subroutine nested_subroutine(c, d) integer, intent(inout) :: c, d c = c + 1 d = d + 2 end subroutine nested_subroutine end subroutine parent_of_nested_subroutine end module separate_compilation_11a_module lfortran-0.63.0/integration_tests/class_48.f900000664000175000017500000000341215174404631021325 0ustar alastairalastairprogram class_48 implicit none type :: SeriesInt integer :: scalar_data integer, allocatable :: array_data(:) end type type :: SeriesIntNested type(SeriesInt), allocatable :: v end type interface Series procedure Series_scalar, Series_array end interface interface SeriesNested procedure Series_nested_scalar_int end interface class(SeriesInt), allocatable :: s1, s2 class(SeriesIntNested), allocatable :: s3 ! Call Series with integer s1 = Series(42) print *, "s1%scalar_data:", s1%scalar_data print *, "s1%array_data:", s1%array_data if (s1%scalar_data /= 42) error stop if (.not. all(s1%array_data == [0, 0, 0, 0])) error stop print * ! Call Series with array s2 = Series([1,2,3,4]) print *, "s2%scalar_data:", s2%scalar_data print *, "s2%array_data:", s2%array_data if (s2%scalar_data /= 101) error stop if (.not. all(s2%array_data == [1, 2, 3, 4])) error stop print * allocate(s3) ! Call SeriesNested with integer and assign to a struct instance member s3%v = SeriesNested(42) print *, "s3%v%scalar_data:", s3%v%scalar_data if (s3%v%scalar_data /= 42) error stop contains function Series_scalar(data) result(self) type(SeriesInt) :: self integer, intent(in) :: data self%scalar_data = data allocate(self%array_data(4)) ! initialize to zeroes end function function Series_nested_scalar_int(data) result(self) type(SeriesInt) :: self integer, intent(in) :: data self%scalar_data = data end function function Series_array(data) result(self) type(SeriesInt) :: self integer, intent(in) :: data(:) self%array_data = data self%scalar_data = 101 end function end program class_48 lfortran-0.63.0/integration_tests/openmp_26.f900000664000175000017500000000244415174404631021516 0ustar alastairalastairsubroutine intiailise_array_kernel(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a integer :: i !$omp parallel shared(a) private(i) !$omp do do i = 1, n a(i) = 12.91 end do !$omp end do !$omp end parallel print *, a(1), a(n) end subroutine subroutine initialise_array(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a interface subroutine intiailise_array_kernel(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a end subroutine end interface call intiailise_array_kernel(n, a) print *, a(1), a(n), a(12), a(12841) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(n) - 12.91) > 1e-8) error stop if (abs(a(12) - 12.91) > 1e-8) error stop if (abs(a(12841) - 12.91) > 1e-8) error stop end subroutine program openmp_26 use omp_lib integer, parameter :: n = 100000 integer :: i real, allocatable :: b(:) interface subroutine initialise_array(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a end subroutine end interface allocate(b(n)) call omp_set_num_threads(4) call initialise_array(n, b) print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/intrinsics_81.f900000664000175000017500000000040215174404631022376 0ustar alastairalastairprogram intrinsics_81 real, allocatable :: C(:,:), C2(:,:) integer :: n n = 960 allocate(C(n,n), C2(n,n)) C = 932.0 C2 = 320.0 print *, "Error: ", maxval(abs(C-C2)) if( maxval(abs(C - C2)) /= 612.00 ) error stop end program lfortran-0.63.0/integration_tests/select_rank_21.f900000664000175000017500000000101615174404631022477 0ustar alastairalastairprogram select_rank_21 implicit none real, allocatable :: arr(:) call alloc_sub(arr) if (size(arr) /= 10) error stop if (arr(1) /= 0.0) error stop contains subroutine alloc_sub(x) real, allocatable, dimension(..), intent(out) :: x select rank(x) rank(1) allocate(x(10)) x = 0.0 rank(2) allocate(x(3, 4)) rank default error stop "unexpected rank" end select end subroutine end program select_rank_21 lfortran-0.63.0/integration_tests/select_case_01.f900000664000175000017500000000145515174404631022464 0ustar alastairalastairprogram select_case_01 implicit none integer :: n ! Test that select case evaluates its expression exactly once n = 0 select case (f()) case (1) print *, "case 1" case (2) print *, "case 2" end select if (n /= 1) error stop "FAIL: select case evaluated expression multiple times" ! Test with a different return value n = 0 select case (g()) case (10) print *, "case 10" case (20:30) print *, "case 20-30" case default print *, "default" end select if (n /= 1) error stop "FAIL: select case evaluated expression multiple times (range)" print *, "OK" contains function f() result(r) integer :: r n = n + 1 r = 2 end function function g() result(r) integer :: r n = n + 1 r = 25 end function end program lfortran-0.63.0/integration_tests/allocate_58.f900000664000175000017500000000023315174404631022003 0ustar alastairalastairprogram allocate_58 character(len=5) :: a character(len=:), allocatable :: b allocate(b, mold=a) if (len(b) /= 5) error stop end program lfortran-0.63.0/integration_tests/common_17.f900000664000175000017500000000141215174404631021502 0ustar alastairalastair! Test: COMMON block with type aliasing (same storage, different types) ! This tests storage association where the same bytes are viewed differently program common_17 implicit none double precision :: arr(4) ! 32 bytes double precision :: original_value common /data/ arr arr(1) = 1.0d0 original_value = arr(1) call sub_int_view() ! After sub_int_view modifies the first 4 bytes, arr(1) should be different if (arr(1) == original_value) error stop "Type aliasing failed - arr(1) unchanged" print *, "PASS: common_17" end program subroutine sub_int_view() implicit none integer :: iarr(8) ! 32 bytes (different layout) common /data/ iarr ! Modify first integer (first 4 bytes of arr(1)) iarr(1) = 999 end subroutine lfortran-0.63.0/integration_tests/intrinsics_183.f900000664000175000017500000000100015174404631022454 0ustar alastairalastairprogram intrinsics_183 integer :: a1 = 3 integer :: a2 = 2 integer :: a3 = 1 integer :: a4 = -5 integer(8) :: a = 20 print*, ibits(3, 2, 1) if (ibits(3, 2, 1) /= 0) error stop print*, ibits(-5, 2, 2) if (ibits(-5, 2, 2) /= 2) error stop print*, ibits(a1, a2, a3) if (ibits(a1, a2, a3) /= 0) error stop print*, ibits(a4, a2, a2) if (ibits(a4, a2, a2) /= 2) error stop print*, ibits(a, 2_4, 2_4) if (ibits(a, 2_4, 2_4) /= 1) error stop end program lfortran-0.63.0/integration_tests/arrays_45.f900000664000175000017500000000075115174404631021521 0ustar alastairalastairmodule module_arrays_45 integer :: nx = 4 integer :: ny = 4 end module module_arrays_45 subroutine a(cs) use module_arrays_45 real, dimension(nx), intent(in) :: cs print *, cs if (abs(sum(cs) - 10.0) > 1e-8) error stop end subroutine subroutine b(cs) use module_arrays_45 real, dimension(nx, ny), intent(in) :: cs print *, cs end subroutine program arrays_45 real, dimension(4) :: cs real, dimension(4, 4) :: cs2 cs = [1.0, 2.0, 3.0, 4.0] cs2 = 12.87 call a(cs) call b(cs2) end program lfortran-0.63.0/integration_tests/arrays_07_size.f900000664000175000017500000000054615174404631022553 0ustar alastairalastairprogram arrays_07_size integer :: y = 2 call temp(y) contains subroutine temp(x) integer, intent(inout) :: x integer :: keep(x) keep = [1,2] x = 1 print * , size(keep) print * , keep if (size(keep) /= 2) error stop if (keep(1) /= 1) error stop if (keep(2) /= 2) error stop end subroutine end program lfortran-0.63.0/integration_tests/arrays_op_24.f900000664000175000017500000000144315174404631022213 0ustar alastairalastairprogram arrays_op_24 implicit none real :: array(10, 10), output(10, 10) array = 3.0 call prg(array, output) print *, output if( any(abs(output - 8.52982235) > 1e-6) ) error stop contains subroutine prg(arr, otpt) real, intent(in) :: arr(:, :) real, intent(out) :: otpt(:, :) otpt(:, :) = attention(10, 10, 10, arr) end subroutine function attention(l, n, m, mask) result(y) integer, intent(in) :: l, n, m real, intent(in) :: mask(n, m) real :: y(l, m) real :: tmp(n, m) tmp = 4.0 call copy_array(twice(tmp / sqrt(real(l, 4)) + mask), y) end function function twice(x) result(y) real, intent(in) :: x(:, :) real :: y(size(x, 1), size(x, 2)) y = 2*x end function subroutine copy_array(src, dest) real, intent(in) :: src(:, :) real, intent(out) :: dest(:, :) dest = src end subroutine end program lfortran-0.63.0/integration_tests/declaration_02.f900000664000175000017500000000074015174404631022474 0ustar alastairalastairMODULE declaration_02_mod1 integer (kind=4), parameter :: m = 3 integer (kind=4), parameter :: n = 1000 END MODULE declaration_02_mod1 MODULE declaration_02_mod2 use declaration_02_mod1 integer (kind=4), dimension(m) :: arr1 integer (kind=4), dimension(n) :: arr2 END MODULE declaration_02_mod2 program declaration_02 use declaration_02_mod1 use declaration_02_mod2 if (size(arr1) /= 3) error stop if ((size(arr2) /= 1000)) error stop end programlfortran-0.63.0/integration_tests/cpp_pre_01.f900000664000175000017500000000060715174404631021640 0ustar alastairalastairprogram cpp_pre_01 #ifdef SOMETHING #endif // This should work # define square(a) /* This should be ignored as well */ a * a #define abc "ABC" integer :: a = 10 /* hi*/ /* This is a multi-line comment line 2*** /** line 3 */ print *, /*hi, "abc\n"*/ square(a), "hi /* abc*/ //abc" print *, "asdjfal" // "djafl" print *, abc end program lfortran-0.63.0/integration_tests/c_ptr_15.f900000664000175000017500000000127315174404631021324 0ustar alastairalastairprogram c_ptr_15 use iso_c_binding, only: c_ptr, c_null_ptr, c_loc, c_associated implicit none integer, target :: x type(c_ptr) :: p x = 42 p = c_loc(x) ! Test passing c_null_ptr to a value parameter call outer(c_null_ptr) ! Test passing a non-null c_ptr to a value parameter call outer(p) print *, "ok" contains subroutine outer(p) type(c_ptr), intent(in), value :: p call inner(p) end subroutine subroutine inner(p) type(c_ptr), intent(in), value :: p ! Verify that a null c_ptr stays null and a non-null stays non-null if (c_associated(p)) then ! non-null path: nothing to assert beyond not crashing end if end subroutine end program lfortran-0.63.0/integration_tests/procedure_pointer_15.f900000664000175000017500000000104115174404631023736 0ustar alastairalastairprogram procedure_pointer_15 implicit none procedure(), pointer :: mysub => null() integer :: val val = 0 mysub => set_forty_two call mysub(val) if (val /= 42) error stop val = 0 mysub => set_seven call mysub(val) if (val /= 7) error stop print *, "procedure_pointer_15: PASS" contains subroutine set_forty_two(v) integer, intent(out) :: v v = 42 end subroutine subroutine set_seven(v) integer, intent(out) :: v v = 7 end subroutine end program lfortran-0.63.0/integration_tests/nested_14.f900000664000175000017500000000113415174404631021472 0ustar alastairalastairmodule nested_14_mod contains subroutine temp() integer :: col_width character(len=5) :: x(2) col_width = 5 call temp_nested(x) if (x(1) /= "hello" .or. x(2) /= "world") error stop contains subroutine temp_nested(basename) character(len=*), intent(inout) :: basename(:) character(len=col_width) :: tmp(2) tmp(1) = "hello" tmp(2) = "world" basename = tmp end subroutine end subroutine end module program nested_14 use nested_14_mod call temp() end program nested_14lfortran-0.63.0/integration_tests/derived_types_63.f900000664000175000017500000000210515174404631023061 0ustar alastairalastairmodule derived_types_63_m implicit none type :: enum_policy integer :: append = 3 end type enum_policy type(enum_policy), parameter :: merge_policy = enum_policy() type :: toml_merge_config integer :: table = merge_policy%append end type toml_merge_config interface toml_merge_config module procedure :: new_merge_config end interface toml_merge_config contains function new_merge_config(table) result(config) character(*), intent(in), optional :: table type(toml_merge_config) :: config if (present(table)) config%table = merge_policy%append contains subroutine set_enum(enum, str) character(*), intent(in) :: str integer, intent(inout) :: enum enum = merge_policy%append end subroutine set_enum end function new_merge_config end module derived_types_63_m program derived_types_63 use derived_types_63_m type(toml_merge_config) :: config2, config3 config2 = config3 if (config2%table /= 3 .or. config3%table /= 3) error stop if (config2%table /= config3%table) error stop end program lfortran-0.63.0/integration_tests/types_23.f900000664000175000017500000000107415174404631021357 0ustar alastairalastairprogram types_23 complex(8) :: A(3) = [(1, 1), (2, 2), (3, 3)] integer(8) :: B(3) = [(1, 1), (2, 2), (3, 3)] real(8) :: C(3) = [(1, 1), (2, 2), (3, 3)] complex(8) :: D(3) = [1, 2, 3] print*, A if ( abs(real(A(1)) - 1.00) > 10e-5 ) error stop if ( abs(imag(A(2)) - 2.00) > 10e-5 ) error stop print*, B if ( abs(B(1) - 1.00) > 10e-5 ) error stop print*, C if ( abs(C(1) - 1.00) > 10e-5 ) error stop print*, D if ( abs(real(D(1)) - 1.00) > 10e-5 ) error stop if ( abs(imag(D(2)) - 0.00) > 10e-5 ) error stop endlfortran-0.63.0/integration_tests/functions_14.f900000664000175000017500000000023215174404631022216 0ustar alastairalastairsubroutine find_fit(expr) interface integer function expr() end function end interface end subroutine program functions_14 end program lfortran-0.63.0/integration_tests/derived_types_13.f900000664000175000017500000000126215174404631023057 0ustar alastairalastairmodule derived_types_13_module_01 implicit none type t integer :: i integer, allocatable :: xl(:) end type t contains function new_value() result(p) type(t) :: p p%i = 123 end function new_value subroutine alloc(x) integer, allocatable, intent(out) :: x(:) allocate(x(5)) end subroutine alloc end module derived_types_13_module_01 program derived_types_13 use derived_types_13_module_01 implicit none type(t) :: x x = new_value() print *, x % i if (x%i /= 123) error stop call alloc(x % xl) print *, size(x % xl) if (size(x%xl) /= 5) error stop end program derived_types_13 lfortran-0.63.0/integration_tests/complex_36.f900000664000175000017500000000165615174404631021674 0ustar alastairalastairprogram complex_36 ! Test mixed-precision real*complex binary operations. ! Fortran standard: real(dp)*complex(sp) should produce complex(dp). implicit none integer, parameter :: sp = kind(1.0), dp = kind(1.0d0) real(dp) :: v complex(sp) :: zsp complex(dp) :: r1, r2, r3, r4 v = 1.1d0 zsp = (1.0_sp, 2.0_sp) ! real(dp) * complex(sp) -> complex(dp) r1 = v * zsp if (abs(real(r1) - 1.1d0) > 1.0d-15) error stop if (abs(aimag(r1) - 2.2d0) > 1.0d-15) error stop ! complex(sp) * real(dp) -> complex(dp) r2 = zsp * v if (abs(real(r2) - 1.1d0) > 1.0d-15) error stop if (abs(aimag(r2) - 2.2d0) > 1.0d-15) error stop ! real(dp) + complex(sp) -> complex(dp) r3 = v + zsp if (abs(real(r3) - 2.1d0) > 1.0d-15) error stop if (abs(aimag(r3) - 2.0d0) > 1.0d-15) error stop ! real(dp) - complex(sp) -> complex(dp) r4 = v - zsp if (abs(real(r4) - 0.1d0) > 1.0d-15) error stop if (abs(aimag(r4) + 2.0d0) > 1.0d-15) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/format_61.f900000664000175000017500000000123115174404631021500 0ustar alastairalastairprogram format_61 implicit none character(len=100) :: output write(output, '(g0)') 1.0 if (trim(output) /= '1.00000000') error stop write(output, '(g0)') 0.0 if (trim(output) /= '0.00000000') error stop write(output, '(g0)') -1.0 if (trim(output) /= '-1.00000000') error stop write(output, '(g0)') 100000.0 if (trim(output) /= '100000.000') error stop write(output, '(g0)') 1.0d0 if (trim(output) /= '1.0000000000000000') error stop write(output, '(g0)') 0.0d0 if (trim(output) /= '0.0000000000000000') error stop write(output, '(g0)') 42 if (trim(output) /= '42') error stop end program format_61 lfortran-0.63.0/integration_tests/read_54.f900000664000175000017500000000121715174404631021131 0ustar alastairalastairprogram read_fmt10 implicit none integer :: idata(27) integer, parameter :: idata_correct(27) = [ & 107, 8, 7, 1, 137, 80, 0, & 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, & 111, 112, 113, 114, 115, 116, 117, 118, 119, 120 & ] integer :: i open (10, file='fort.10', status='replace', form='formatted') write (10,'(a)') '107 8 7 1137 80 0101102103104105106107108109110' write (10,'(a)') '111112113114115116117118119120' rewind (10) idata = -42 read (10, 100) idata do, i=1, size (idata) if (idata(i) /= idata_correct(i)) error stop end do 100 format (I3, 2(I2), 3(I3), I4, 10(I3)) end program lfortran-0.63.0/integration_tests/gpu_metal_87.f900000664000175000017500000000163315174404631022203 0ustar alastairalastairmodule m_gpu_metal_87 implicit none type :: inner_t end type type :: outer_t type(inner_t), allocatable :: items(:) end type end module ! Test: do concurrent inside associate block with array-of-structs variable ! where the struct has allocatable array members of another struct type. ! Previously caused ICE in the gpu_offload pass because __data_ and __size_ ! kernel parameters were incorrectly created for array-of-structs variables. program gpu_metal_87 use m_gpu_metal_87 implicit none type(outer_t) :: x(2) real :: a(4) integer :: i allocate(x(1)%items(1)) allocate(x(2)%items(1)) associate(n => size(x)) do concurrent (i = 1:4) a(i) = real(n + i) end do end associate if (abs(a(1) - 3.0) > 0.001) error stop if (abs(a(2) - 4.0) > 0.001) error stop if (abs(a(3) - 5.0) > 0.001) error stop if (abs(a(4) - 6.0) > 0.001) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/modules_38.f900000664000175000017500000000243215174404631021670 0ustar alastairalastairmodule fpm_compiler implicit none public :: compiler_t type string_t character(len=:), allocatable :: s end type enum, bind(C) enumerator :: & id_unknown, & id_intel_classic_windows, & id_intel_llvm_windows end enum integer, parameter :: compiler_enum = kind(id_unknown) type :: compiler_t integer(compiler_enum) :: id = id_unknown character(len=:), allocatable :: fc character(len=:), allocatable :: cc character(len=:), allocatable :: cxx logical :: echo = .true. logical :: verbose = .true. contains procedure :: enumerate_libraries end type compiler_t contains function enumerate_libraries(self, prefix, libs) result(r) class(compiler_t), intent(in) :: self character(len=*), intent(in) :: prefix type(string_t), intent(in) :: libs(:) character(len=:), allocatable :: r if (self%id == id_intel_classic_windows .or. & self%id == id_intel_llvm_windows) then end if allocate(character(len=1) :: r) end function enumerate_libraries end module fpm_compiler program modules_38 use fpm_compiler, only : string_t, compiler_t type(compiler_t) :: compiler_arg character(len=3) :: prefix_arg type(string_t) :: libs_arg(4) print *, compiler_arg%enumerate_libraries(prefix_arg, libs_arg) end program lfortran-0.63.0/integration_tests/modules_37.f900000664000175000017500000000262015174404631021666 0ustar alastairalastairmodule modules_37_fpm_backend implicit none public :: build_package type, abstract :: fpm_cmd_settings logical :: verbose=.true. end type type, extends(fpm_cmd_settings) :: fpm_build_settings end type type string_t character(len=:), allocatable :: s end type type build_target_ptr type(build_target_t), pointer :: ptr => null() end type build_target_ptr type build_target_t character(:), allocatable :: output_dir end type build_target_t type :: fpm_model_t end type fpm_model_t contains subroutine build_package(targets, model, verbose) type(build_target_ptr), intent(inout) :: targets(:) type(fpm_model_t), intent(in) :: model logical, intent(in) :: verbose integer :: i, j type(string_t), allocatable :: build_dirs(:) type(string_t) :: temp allocate(build_dirs(0)) do i = 1, size(targets) associate(target => targets(i)%ptr) temp%s = target%output_dir build_dirs = [build_dirs, temp] end associate end do end subroutine build_package subroutine cmd_build(settings) type(fpm_build_settings), intent(in) :: settings type(fpm_model_t) :: model type(build_target_ptr), allocatable :: targets(:) call build_package(targets, model, verbose=settings%verbose) end subroutine cmd_build end module modules_37_fpm_backend program modules_37 implicit none print *, "executing modules_37" end program modules_37 lfortran-0.63.0/integration_tests/list_test_01_.f900000664000175000017500000000443115174404631022360 0ustar alastairalastairmodule list_test_01_mod implicit none real::eps = 1e-6 contains type(_lfortran_list(integer)) function fill_list_integer(size) result (ret) integer, intent(in):: size type(_lfortran_list(integer)) :: aarg = _lfortran_list_constant(0, 1, 2, 3, 4) integer::i do i = 0, size-1 call _lfortran_list_append(aarg, i+5) end do ret = aarg end function subroutine test_list_01 type(_lfortran_list(integer)) :: a type(_lfortran_list(real)) :: f = _lfortran_list_constant(1.0, 2.0, 3.0, 4.0, 5.0) integer::i a = fill_list_integer(10) do i = 0, 9 call _lfortran_list_append(f, real(i+6)) end do do i = 0, 14 if ( abs(_lfortran_get_item(f, i) - real(_lfortran_get_item(a, i)) - 1.0) > eps ) error stop end do do i = 0, 14 call _lfortran_set_item(f, i, _lfortran_get_item(f, i)+real(i)) end do do i = 0, 14 if ( abs(_lfortran_get_item(f, i) - real(_lfortran_get_item(a, i)) - real(i) - 1.0) > eps ) error stop end do end subroutine subroutine test_list_02() type(_lfortran_list(integer)) :: x = _lfortran_list_constant(1, 2) type(_lfortran_list(integer)) :: y integer::i do i = 3, 49 call _lfortran_list_append(x, i+29) end do do i = 0, _lfortran_len(x)-1 call _lfortran_list_append(y, _lfortran_get_item(x, i)) end do do i = 0, _lfortran_len(x)-1 if ( _lfortran_get_item(x, i) /= _lfortran_get_item(y, i) ) error stop end do end subroutine subroutine test_issue_1681 ! issue 1681 from LP type(_lfortran_list(integer)) :: a = _lfortran_list_constant(2, 3, 4) a = _lfortran_list_constant(1, 2, 3) if ( _lfortran_len(a) /= 3 .or. _lfortran_get_item(a, 0) /= 1 .or. _lfortran_get_item(a, 1) /= 2 .or. _lfortran_get_item(a,2) /= 3 ) error stop a = _lfortran_list_constant(2) if ( _lfortran_len(a) /= 1 .or. _lfortran_get_item(a, 0) /= 2 ) error stop end subroutine subroutine tests() call test_list_01() call test_list_02() ! Removed negative indexing test call test_issue_1681() end subroutine end module program test_list_01_ use list_test_01_mod implicit none call tests end program lfortran-0.63.0/integration_tests/arrays_intrin_01.f900000664000175000017500000000073215174404631023073 0ustar alastairalastairprogram arrays_intrin_01 implicit none integer, dimension(11) :: nums_int = [5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5] real, dimension(5) :: nums_real = [1.5, -3.2, 4.5, 0.9, 7.2] if (minval(nums_int) /= -5) error stop if (maxval(nums_int) /= 5) error stop if (minval(nums_real) /= -3.2) error stop if (maxval(nums_real) /= 7.2) error stop print *, minval(nums_int), maxval(nums_int) print *, minval(nums_real), maxval(nums_real) end program lfortran-0.63.0/integration_tests/arrays_reshape_31.f900000664000175000017500000000070415174404631023221 0ustar alastairalastairprogram arrays_reshape_31 implicit none character(len=10) :: arr1d(6) character(len=10) :: arr2d(2, 3) arr1d = ["one ", "two ", "three", "four ", "five ", "six "] arr2d = reshape(arr1d, [2, 3]) if (trim(arr2d(1, 1)) /= "one") error stop "arr2d(1,1) wrong" if (trim(arr2d(2, 1)) /= "two") error stop "arr2d(2,1) wrong" if (trim(arr2d(1, 2)) /= "three") error stop "arr2d(1,2) wrong" print *, "PASS" end program lfortran-0.63.0/integration_tests/fma.f900000664000175000017500000000115115174404631020446 0ustar alastairalastairprogram fma implicit none real :: x = 4.0 real, parameter :: pi = 3.14 real(8) :: S1 = 1.0, S2 = 2.0 real(8) :: z = 1.0 integer ::b(10) real :: r x = (x * 4 + 0.5_4*sign(1._4, x)) - x * pi z = S1+z*S2 if( abs(x - 3.94) > 1e-6 ) error stop if( abs(z - 3.0) > 1e-6 ) error stop b = 1 r = 1 b(1) = nint(sign(1.0,r +r*r), 4) ! Test FMA opt. with `--fast` (functioncall with fma nested) print *, b(1) if(b(1) /= 1) error stop b(1) = r -r*r ! Test FMA opt. with `--fast` (sub op) print *, b(1) if(b(1) /= 0) error stop end program lfortran-0.63.0/integration_tests/types_20.f900000664000175000017500000000012515174404631021350 0ustar alastairalastairprogram types_20 integer :: a integer(8) :: b a = 4 b = 4 end programlfortran-0.63.0/integration_tests/intrinsics_110.f900000664000175000017500000000037415174404631022457 0ustar alastairalastairprogram intrinsics_110 integer :: a, b, result a = 10 b = 7 if ( .not. min0( a1 = a, a2 = b ) == 7 ) error stop if ( .not. min0( a, a2 = b ) == 7 ) error stop if ( .not. min0( a, b ) == 7 ) error stop end program intrinsics_110 lfortran-0.63.0/integration_tests/separate_compilation_02b.f900000664000175000017500000000046715174404631024561 0ustar alastairalastairmodule separate_compilation_02_module contains subroutine m_sub print *, "m_sub" end subroutine m_sub end module separate_compilation_02_module subroutine sub print *, "sub" end subroutine sub integer function fn() use separate_compilation_02_module call m_sub fn = 19 end function fn lfortran-0.63.0/integration_tests/file_21.f900000664000175000017500000000042715174404631021131 0ustar alastairalastairprogram file_21 implicit none integer :: j character(len=1) :: c(2) j = 11 open(j, file="file_21_data.txt") read(j, *) c close(j) print *, c(1) if (c(1) /= "a") error stop print *, c(2) if (c(2) /= "c") error stop end program file_21lfortran-0.63.0/integration_tests/submodule_10.f900000664000175000017500000000223215174404631022203 0ustar alastairalastairmodule math_submodule_10 implicit none interface logspace module function func1(n, base) result(res) integer, intent(in) :: n integer, intent(in) :: base real :: res(max(n,0)) end function func1 module function func2(n, base) result(res) integer, intent(in) :: n real, intent(in) :: base integer :: res(max(n, 0)) end function func2 end interface end module submodule (math_submodule_10) log_submodule_10 implicit none contains module procedure func1 real, parameter :: array(2) = [1.0 , 2.0] res = array end procedure module procedure func2 integer, parameter :: array(2) = [1 , 2] res = array end procedure end submodule program submodule_10 use math_submodule_10 implicit none integer, parameter :: n = 2 integer, parameter :: base = 1 real :: result1(n) integer :: result2(n) result1 = logspace(n, base) result2 = logspace(n, base) print *, result1 print *, result2 if (.not. all(result1 == [1.0, 2.0])) error stop if (.not. all(result2 == [1, 2])) error stop end programlfortran-0.63.0/integration_tests/namelist_29.f900000664000175000017500000000177715174404631022047 0ustar alastairalastairmodule M_framework__verify implicit none private logical, save :: G_debug = .false. public :: cmdline_, get_debug contains subroutine cmdline_(filename) character(len=*), intent(in) :: filename namelist /args/ G_debug integer :: unit open(newunit=unit, file=filename, status="old", action="read") read(unit, nml=args) close(unit) end subroutine cmdline_ function get_debug() result(val) logical :: val val = G_debug end function get_debug end module M_framework__verify program test_verify use M_framework__verify implicit none integer :: unit character(len=*), parameter :: fname = "input.nml" ! Create the namelist file automatically open(newunit=unit, file=fname, status="replace", action="write") write(unit,*) "&args" write(unit,*) "G_debug = .true." write(unit,*) "/" close(unit) ! Read the namelist call cmdline_(fname) ! Verify result print *, "Debug mode =", get_debug() end program test_verify lfortran-0.63.0/integration_tests/intrinsics_179.f900000664000175000017500000004314715174404631022503 0ustar alastairalastairprogram intrinsics_179 use iso_fortran_env, only: sp => real32 real :: aa(4, 5) real :: aaa(4, 5, 6) real :: aaaa(4, 5, 6, 7) logical :: mask(4, 5, 6, 7) integer :: dim, i, j, k, l integer :: s_aa(1) integer :: s_aaa(2) integer :: s_aaaa(3) real :: res_aa_1(5) real :: res_aa_2(4) real :: res_aaa_1(5, 6) real :: res_aaa_2(4, 6) real :: res_aaa_3(4, 5) real :: res_aaaa_1(5, 6, 7) real :: res_aaaa_2(4, 6, 7) real :: res_aaaa_3(4, 5, 7) real :: res_aaaa_4(4, 5, 6) real :: exp_res_aa_1(5) real :: exp_res_aa_2(4) real :: exp_res_aaa_1(5, 6) real :: exp_res_aaa_2(4, 6) real :: exp_res_aaa_3(4, 5) real :: exp_res_aaaa_1(5, 6, 7) real :: exp_res_aaaa_2(4, 6, 7) real :: exp_res_aaaa_3(4, 5, 7) real :: exp_res_aaaa_4(4, 5, 6) aa = 1.0 ! TODO: Uncomment after https://github.com/lfortran/lfortran/issues/7412 is fixed. ! mask = .true. do i = lbound(mask, 1), ubound(mask, 1) do j = lbound(mask, 2), ubound(mask, 2) do k = lbound(mask, 3), ubound(mask, 3) do l = lbound(mask, 4), ubound(mask, 4) mask(i, j, k, l) = .true. end do end do end do end do do i = 1, 4 do j = 1, 5 do k = 1, 6 aaa(i, j, k) = modulo(i * j - k, 12) end do end do end do do i = 1, 4 do j = 1, 5 do k = 1, 6 do l = 1, 7 aaaa(i, j, k, l) = (i + j / k * l + 21.04) * 1e-6 end do end do end do end do exp_res_aa_1 = 4.0 exp_res_aa_2 = 5.0 exp_res_aaa_1 = reshape([6.00000000, 16.0000000, 26.0000000, 24.0000000, & 22.0000000, 14.0000000, 12.0000000, 22.0000000, 20.0000000, 18.0000000, & 22.0000000, 20.0000000, 18.0000000, 16.0000000, 14.0000000, 30.0000000, & 16.0000000, 26.0000000, 12.0000000, 22.0000000, 38.0000000, 24.0000000, & 22.0000000, 32.0000000, 18.0000000, 34.0000000, 20.0000000, 18.0000000, & 28.0000000, 26.0000000], shape(exp_res_aaa_1)) exp_res_aaaa_1 = reshape([9.81600024E-05, 1.02160004E-04, 1.06160005E-04, & 1.10159999E-04, 1.14160001E-04, 9.41600010E-05, 9.81600024E-05, 9.81600024E-05, & 1.02160004E-04, 1.02160004E-04, 9.41600010E-05, 9.41600010E-05, 9.81600024E-05, & 9.81600024E-05, 9.81600024E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.81600024E-05, & 9.81600024E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.81600024E-05, & 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.02160004E-04, & 1.10159999E-04, 1.18160002E-04, 1.26159997E-04, 1.34160000E-04, 9.41600010E-05, 1.02160004E-04, & 1.02160004E-04, 1.10159999E-04, 1.10159999E-04, 9.41600010E-05, 9.41600010E-05, 1.02160004E-04, & 1.02160004E-04, 1.02160004E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.02160004E-04, & 1.02160004E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.02160004E-04, & 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.06160005E-04, & 1.18160002E-04, 1.30159999E-04, 1.42160003E-04, 1.54160007E-04, 9.41600010E-05, 1.06160005E-04, & 1.06160005E-04, 1.18160002E-04, 1.18160002E-04, 9.41600010E-05, 9.41600010E-05, 1.06160005E-04, & 1.06160005E-04, 1.06160005E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.06160005E-04, & 1.06160005E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.06160005E-04, & 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.10159999E-04, & 1.26159997E-04, 1.42160003E-04, 1.58160008E-04, 1.74159999E-04, 9.41600010E-05, 1.10159999E-04, & 1.10159999E-04, 1.26159997E-04, 1.26159997E-04, 9.41600010E-05, 9.41600010E-05, 1.10159999E-04, & 1.10159999E-04, 1.10159999E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.10159999E-04, & 1.10159999E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.10159999E-04, & 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.14160001E-04, & 1.34160000E-04, 1.54160007E-04, 1.74159999E-04, 1.94160006E-04, 9.41600010E-05, 1.14160001E-04, & 1.14160001E-04, 1.34160000E-04, 1.34160000E-04, 9.41600010E-05, 9.41600010E-05, 1.14160001E-04, & 1.14160001E-04, 1.14160001E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.14160001E-04, & 1.14160001E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.14160001E-04, & 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.18160002E-04, & 1.42160003E-04, 1.66159996E-04, 1.90160004E-04, 2.14159998E-04, 9.41600010E-05, 1.18160002E-04, & 1.18160002E-04, 1.42160003E-04, 1.42160003E-04, 9.41600010E-05, 9.41600010E-05, 1.18160002E-04, & 1.18160002E-04, 1.18160002E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.18160002E-04, & 1.18160002E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.18160002E-04, & 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.22159996E-04, & 1.50160005E-04, 1.78160000E-04, 2.06159995E-04, 2.34160019E-04, 9.41600010E-05, 1.22159996E-04, & 1.22159996E-04, 1.50160005E-04, 1.50160005E-04, 9.41600010E-05, 9.41600010E-05, 1.22159996E-04, & 1.22159996E-04, 1.22159996E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.22159996E-04, & 1.22159996E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.22159996E-04, & 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05], shape(exp_res_aaaa_1)) exp_res_aaa_2 = reshape([10.0000000, 25.0000000, 28.0000000, 31.0000000, 17.0000000, 20.0000000, & 23.0000000, 26.0000000, 24.0000000, 27.0000000, 18.0000000, 21.0000000, 31.0000000, 22.0000000, & 37.0000000, 16.0000000, 38.0000000, 29.0000000, 32.0000000, 35.0000000, 45.0000000, 24.0000000, & 27.0000000, 30.0000000], shape(exp_res_aaa_2)) exp_res_aaaa_2 = reshape([1.25200007E-04, 1.30200002E-04, 1.35200011E-04, 1.40200005E-04, 1.16199997E-04, & 1.21200006E-04, 1.26200001E-04, 1.31200009E-04, 1.13200003E-04, 1.18199998E-04, 1.23200007E-04, 1.28200001E-04, & 1.12200010E-04, 1.17199990E-04, 1.22200014E-04, 1.27199994E-04, 1.11200003E-04, 1.16199997E-04, 1.21200006E-04, & 1.26200001E-04, 1.10200010E-04, 1.15200004E-04, 1.20199998E-04, 1.25200007E-04, 1.40199991E-04, 1.45200000E-04, & 1.50200009E-04, 1.55200003E-04, 1.22199999E-04, 1.27200008E-04, 1.32200003E-04, 1.37199997E-04, 1.16199997E-04, & 1.21200006E-04, 1.26200001E-04, 1.31200009E-04, 1.14199996E-04, 1.19200005E-04, 1.24200000E-04, 1.29200009E-04, & 1.12200010E-04, 1.17200005E-04, 1.22199999E-04, 1.27200008E-04, 1.10200010E-04, 1.15200004E-04, 1.20199998E-04, & 1.25200007E-04, 1.55200003E-04, 1.60200012E-04, 1.65200006E-04, 1.70200001E-04, 1.28200001E-04, 1.33199996E-04, & 1.38200005E-04, 1.43199999E-04, 1.19200005E-04, 1.24200000E-04, 1.29200009E-04, 1.34200003E-04, 1.16200012E-04, & 1.21199992E-04, 1.26200015E-04, 1.31199995E-04, 1.13200003E-04, 1.18199998E-04, 1.23200007E-04, 1.28200001E-04, & 1.10200010E-04, 1.15200004E-04, 1.20199998E-04, 1.25200007E-04, 1.70200001E-04, 1.75199995E-04, 1.80200004E-04, & 1.85199999E-04, 1.34200003E-04, 1.39199998E-04, 1.44199992E-04, 1.49200001E-04, 1.22199999E-04, 1.27200008E-04, & 1.32200003E-04, 1.37199997E-04, 1.18199998E-04, 1.23200007E-04, 1.28200001E-04, 1.33199996E-04, 1.14200011E-04, & 1.19200005E-04, 1.24200000E-04, 1.29200009E-04, 1.10200010E-04, 1.15200004E-04, 1.20199998E-04, 1.25200007E-04, & 1.85199999E-04, 1.90200008E-04, 1.95200002E-04, 2.00200011E-04, 1.40200005E-04, 1.45200000E-04, 1.50200009E-04, & 1.55200003E-04, 1.25200007E-04, 1.30200002E-04, 1.35199996E-04, 1.40200005E-04, 1.20200013E-04, 1.25199993E-04, & 1.30200002E-04, 1.35199996E-04, 1.15200004E-04, 1.20199998E-04, 1.25200007E-04, 1.30200002E-04, 1.10200010E-04, & 1.15200004E-04, 1.20199998E-04, 1.25200007E-04, 2.00200011E-04, 2.05200005E-04, 2.10200000E-04, 2.15199994E-04, & 1.46200007E-04, 1.51200002E-04, 1.56199996E-04, 1.61200005E-04, 1.28200001E-04, 1.33199996E-04, 1.38200005E-04, & 1.43199999E-04, 1.22199999E-04, 1.27199994E-04, 1.32200003E-04, 1.37199997E-04, 1.16200004E-04, 1.21199999E-04, & 1.26200001E-04, 1.31200009E-04, 1.10200010E-04, 1.15200004E-04, 1.20199998E-04, 1.25200007E-04, 2.15200009E-04, & 2.20199989E-04, 2.25199998E-04, 2.30200007E-04, 1.52199995E-04, 1.57200004E-04, 1.62199998E-04, 1.67199993E-04, & 1.31200009E-04, 1.36200004E-04, 1.41199998E-04, 1.46200007E-04, 1.24200000E-04, 1.29199994E-04, 1.34200003E-04, & 1.39199998E-04, 1.17200005E-04, 1.22199999E-04, 1.27200008E-04, 1.32200003E-04, 1.10200010E-04, 1.15200004E-04, & 1.20199998E-04, 1.25200007E-04], shape(exp_res_aaaa_2)) exp_res_aaa_3 = reshape([45.0000000, 39.0000000, 33.0000000, 27.0000000, 39.0000000, 27.0000000, 15.0000000, & 27.0000000, 33.0000000, 15.0000000, 33.0000000, 51.0000000, 27.0000000, 27.0000000, 51.0000000, 27.0000000, & 21.0000000, 39.0000000, 33.0000000, 27.0000000], shape(exp_res_aaa_3)) exp_res_aaaa_3 = reshape([1.33240013E-04, 1.39240015E-04, 1.45239988E-04, 1.51240019E-04, 1.35240014E-04, & 1.41240016E-04, 1.47239989E-04, 1.53240020E-04, 1.37240000E-04, 1.43240017E-04, 1.49239990E-04, 1.55240021E-04, & 1.40240008E-04, 1.46240011E-04, 1.52239998E-04, 1.58240015E-04, 1.42240009E-04, 1.48239997E-04, 1.54240013E-04, & 1.60240001E-04, 1.34240006E-04, 1.40240008E-04, 1.46239996E-04, 1.52240013E-04, 1.38240008E-04, 1.44240010E-04, & 1.50239997E-04, 1.56240014E-04, 1.42240009E-04, 1.48240011E-04, 1.54239999E-04, 1.60240015E-04, 1.48239997E-04, & 1.54240013E-04, 1.60239986E-04, 1.66240017E-04, 1.52239998E-04, 1.58240015E-04, 1.64239987E-04, 1.70240019E-04, & 1.35240014E-04, 1.41240016E-04, 1.47239989E-04, 1.53240020E-04, 1.41240016E-04, 1.47240018E-04, 1.53239991E-04, & 1.59240008E-04, 1.47240004E-04, 1.53240006E-04, 1.59239993E-04, 1.65240010E-04, 1.56239999E-04, 1.62240001E-04, & 1.68240003E-04, 1.74240005E-04, 1.62240001E-04, 1.68240003E-04, 1.74240005E-04, 1.80240007E-04, 1.36240007E-04, & 1.42240009E-04, 1.48239997E-04, 1.54240013E-04, 1.44240010E-04, 1.50240012E-04, 1.56239985E-04, 1.62240016E-04, & 1.52239998E-04, 1.58240015E-04, 1.64239987E-04, 1.70240004E-04, 1.64239987E-04, 1.70240019E-04, 1.76239992E-04, & 1.82240008E-04, 1.72239990E-04, 1.78240021E-04, 1.84239994E-04, 1.90240011E-04, 1.37240015E-04, 1.43240017E-04, & 1.49239990E-04, 1.55240021E-04, 1.47240004E-04, 1.53240006E-04, 1.59239993E-04, 1.65240010E-04, 1.57240007E-04, & 1.63240009E-04, 1.69239996E-04, 1.75240013E-04, 1.72240005E-04, 1.78240007E-04, 1.84239994E-04, 1.90240011E-04, & 1.82240008E-04, 1.88239996E-04, 1.94239998E-04, 2.00240000E-04, 1.38240008E-04, 1.44240010E-04, 1.50239997E-04, & 1.56240014E-04, 1.50239997E-04, 1.56240014E-04, 1.62239987E-04, 1.68240018E-04, 1.62240001E-04, 1.68240003E-04, & 1.74239991E-04, 1.80240007E-04, 1.80239993E-04, 1.86240009E-04, 1.92239997E-04, 1.98240014E-04, 1.92239997E-04, & 1.98240014E-04, 2.04240001E-04, 2.10239989E-04, 1.39240015E-04, 1.45240017E-04, 1.51239990E-04, 1.57240007E-04, & 1.53240006E-04, 1.59240008E-04, 1.65239995E-04, 1.71240012E-04, 1.67239996E-04, 1.73240012E-04, 1.79240000E-04, & 1.85240016E-04, 1.88239996E-04, 1.94240012E-04, 2.00240000E-04, 2.06240016E-04, 2.02240015E-04, 2.08240002E-04, & 2.14239990E-04, 2.20240006E-04], shape(exp_res_aaaa_3)) exp_res_aaaa_4 = reshape([ 1.82280011E-04, 1.89280006E-04, 1.96280016E-04, 2.03280011E-04, 2.10279992E-04, & 2.17280001E-04, 2.24280011E-04, 2.31279992E-04, 2.38280001E-04, 2.45280011E-04, 2.52280006E-04, 2.59280001E-04, & 2.66279996E-04, 2.73279991E-04, 2.80280015E-04, 2.87280011E-04, 2.94280006E-04, 3.01280001E-04, 3.08279996E-04, & 3.15280020E-04, 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, 1.82280011E-04, 1.89280006E-04, & 1.96280016E-04, 2.03280011E-04, 1.82280011E-04, 1.89280006E-04, 1.96280016E-04, 2.03280011E-04, 2.10279992E-04, & 2.17280001E-04, 2.24280011E-04, 2.31279992E-04, 2.10279992E-04, 2.17280001E-04, 2.24280011E-04, 2.31279992E-04, & 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, & 1.75280016E-04, 1.82280011E-04, 1.89280006E-04, 1.96280016E-04, 2.03280011E-04, 1.82280011E-04, 1.89280006E-04, & 1.96280016E-04, 2.03280011E-04, 1.82280011E-04, 1.89280006E-04, 1.96280016E-04, 2.03280011E-04, 1.54280002E-04, & 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, & 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, 1.82280011E-04, 1.89280006E-04, 1.96280016E-04, & 2.03280011E-04, 1.82280011E-04, 1.89280006E-04, 1.96280016E-04, 2.03280011E-04, 1.54280002E-04, 1.61280012E-04, & 1.68279992E-04, 1.75280016E-04, 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, 1.54280002E-04, & 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, & 1.82280011E-04, 1.89280006E-04, 1.96280016E-04, 2.03280011E-04, 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, & 1.75280016E-04, 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, 1.54280002E-04, 1.61280012E-04, & 1.68279992E-04, 1.75280016E-04, 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, 1.54280002E-04, & 1.61280012E-04, 1.68279992E-04, 1.75280016E-04], shape(exp_res_aaaa_4)) dim = 1 res_aa_1 = sum(aa, dim) print *, sum(res_aa_1) if (abs(sum(res_aa_1) - 20.0) > 1e-8) error stop s_aa = shape(sum(aa, dim)) print *, s_aa if (s_aa(1) /= 5) error stop do i = 1, 5 if (abs(res_aa_1(i) - exp_res_aa_1(i)) > 1e-8) error stop end do res_aaa_1 = sum(aaa, dim) print *, sum(sum(aaa, dim)) if (abs(sum(sum(aaa, dim)) - 636.0) > 1e-8) error stop s_aaa = shape(sum(aaa, dim)) print *, s_aaa if (s_aaa(1) /= 5 .or. s_aaa(2) /= 6) error stop do i = 1, 5 do j = 1, 6 if (abs(res_aaa_1(i, j) - exp_res_aaa_1(i, j)) > 1e-8) error stop end do end do res_aaaa_1 = sum(aaaa, dim) print *, sum(sum(aaaa, dim)) if (abs(sum(sum(aaaa, dim)) - 2.27976274e-02) > 1e-8) error stop s_aaaa = shape(sum(aaaa, dim)) print *, s_aaaa if (s_aaaa(1) /= 5 .or. s_aaaa(2) /= 6 .or. s_aaaa(3) /= 7) error stop do i = 1, 5 do j = 1, 6 do k = 1, 7 if (abs(res_aaaa_1(i, j, k) - exp_res_aaaa_1(i, j, k)) > 1e-8) error stop end do end do end do dim = 2 res_aa_2 = sum(aa, dim) if (abs(sum(sum(aa, dim)) - 20.0) > 1e-8) error stop s_aa = shape(sum(aa, dim)) print *, s_aa if (s_aa(1) /= 4) error stop do i = 1, 4 if (abs(res_aa_2(i) - exp_res_aa_2(i)) > 1e-8) error stop end do res_aaa_2 = sum(aaa, dim) print *, sum(sum(aaa, dim)) if (abs(sum(sum(aaa, dim)) - 636.0) > 1e-8) error stop s_aaa = shape(sum(aaa, dim)) print *, s_aaa if (s_aaa(1) /= 4 .or. s_aaa(2) /= 6) error stop do i = 1, 4 do j = 1, 6 if (abs(res_aaa_2(i, j) - exp_res_aaa_2(i, j)) > 1e-8) error stop end do end do res_aaaa_2 = sum(aaaa, dim) print *, sum(sum(aaaa, dim)) if (abs(sum(sum(aaaa, dim)) - 2.27976013e-02) > 1e-8) error stop s_aaaa = shape(sum(aaaa, dim)) print *, s_aaaa if (s_aaaa(1) /= 4 .or. s_aaaa(2) /= 6 .or. s_aaaa(3) /= 7) error stop do i = 1, 4 do j = 1, 6 do k = 1, 7 if (abs(res_aaaa_2(i, j, k) - exp_res_aaaa_2(i, j, k)) > 1e-8) error stop end do end do end do dim = 3 res_aaa_3 = sum(aaa, dim) print *, sum(sum(aaa, dim)) if (abs(sum(sum(aaa, dim)) - 636.0) > 1e-8) error stop s_aaa = shape(sum(aaa, dim)) print *, s_aaa if (s_aaa(1) /= 4 .or. s_aaa(2) /= 5) error stop do i = 1, 4 do j = 1, 5 if (abs(res_aaa_3(i, j) - exp_res_aaa_3(i, j)) > 1e-8) error stop end do end do res_aaaa_3 = sum(aaaa, dim) print *, sum(sum(aaaa, dim)) if (abs(sum(sum(aaaa, dim)) - 2.27976032e-02) > 1e-8) error stop s_aaaa = shape(sum(aaaa, dim)) print *, s_aaaa if (s_aaaa(1) /= 4 .or. s_aaaa(2) /= 5 .or. s_aaaa(3) /= 7) error stop do i = 1, 4 do j = 1, 5 do k = 1, 7 if (abs(res_aaaa_3(i, j, k) - exp_res_aaaa_3(i, j, k)) > 1e-8) error stop end do end do end do dim = 4 res_aaaa_4 = sum(aaaa, dim) print *, sum(sum(aaaa, dim)) if (abs(sum(sum(aaaa, dim)) - 2.27976087e-02) > 1e-8) error stop s_aaaa = shape(sum(aaaa, dim)) print *, s_aaaa if (s_aaaa(1) /= 4 .or. s_aaaa(2) /= 5 .or. s_aaaa(3) /= 6) error stop do i = 1, 4 do j = 1, 5 do k = 1, 6 if (abs(res_aaaa_4(i, j, k) - exp_res_aaaa_4(i, j, k)) > 1e-8) error stop end do end do end do print *, sum(sum(aaaa, dim, mask)) if (abs(sum(sum(aaaa, dim, mask)) - 2.27976032e-02) > 1e-8) error stop ! TODO: Uncomment after https://github.com/lfortran/lfortran/issues/7412 is fixed. ! mask = .false. do i = lbound(mask, 1), ubound(mask, 1) do j = lbound(mask, 2), ubound(mask, 2) do k = lbound(mask, 3), ubound(mask, 3) do l = lbound(mask, 4), ubound(mask, 4) mask(i, j, k, l) = .false. end do end do end do end do print *, sum(sum(aaaa, dim, mask)) if (abs(sum(sum(aaaa, dim, mask)) - 0.0) > 1e-8) error stop mask(1, 1, :, :) = .true. print *, sum(sum(aaaa, dim, mask)) if (abs(sum(sum(aaaa, dim, mask)) - 9.53679963e-04) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/class_35.f900000664000175000017500000000070215174404631021320 0ustar alastairalastairprogram class_35 implicit none type :: toml_value integer :: key end type toml_value class(toml_value), pointer :: ptr class(toml_value), allocatable :: tmp2 allocate(ptr, tmp2) ptr%key = 1 tmp2 = ptr print *, "tmp2%key: ", tmp2%key select type(tmp2) type is(toml_value) if (tmp2%key /= 1) error stop class default error stop "Unexpected type" end select deallocate(ptr) end program lfortran-0.63.0/integration_tests/gpu_metal_74.f900000664000175000017500000000172015174404631022174 0ustar alastairalastairprogram gpu_metal_74 ! Test: do concurrent inside associate block where associate name is bound ! to an allocatable derived-type member. Previously caused ASR verify failure ! in the gpu_offload pass because ExternalSymbol entries for struct members ! were not found when the do concurrent was inside an AssociateBlock scope. implicit none type :: t integer, allocatable :: nodes(:) end type type(t) :: x integer, allocatable :: vals(:) integer :: i, n allocate(x%nodes(3), vals(3)) x%nodes = [10, 20, 30] vals = 0 n = 3 call check(x, vals, n) if (vals(1) /= 10) error stop if (vals(2) /= 20) error stop if (vals(3) /= 30) error stop print *, vals(1), vals(2), vals(3) contains subroutine check(arg, out, sz) type(t), intent(in) :: arg integer, intent(inout) :: out(:) integer, intent(in) :: sz integer :: l associate(nd => arg%nodes) do concurrent(l = 1:sz) out(l) = nd(l) end do end associate end subroutine end program lfortran-0.63.0/integration_tests/string_105.f900000664000175000017500000000076115174404631021604 0ustar alastairalastairprogram string_105 implicit none character(:), allocatable :: a, b, words(:) a = 'first' b = 'second' allocate(character(max(len(a), len(b))) :: words(2)) words(1) = a words(2) = b if (len(a) /= 5) error stop if (len(b) /= 6) error stop if (len(words(1)) /= 6) error stop if (len(words(2)) /= 6) error stop if (words(1) /= 'first ') error stop if (words(2) /= 'second') error stop if (size(words) /= 2) error stop print '(A,2I2)', 'Lengths:', len(words(1)), len(words(2)) end program string_105 lfortran-0.63.0/integration_tests/gpu_metal_02.f900000664000175000017500000000100415174404631022156 0ustar alastairalastairprogram gpu_metal_02 ! 2D do concurrent: matrix scaling implicit none integer, parameter :: m = 256, n = 128 real :: a(m, n), a_expected(m, n), scale integer :: i, j scale = 3.0 do j = 1, n do i = 1, m a(i, j) = real(i + j) a_expected(i, j) = real(i + j) * scale end do end do do concurrent (i = 1:m, j = 1:n) a(i, j) = a(i, j) * scale end do do j = 1, n do i = 1, m if (abs(a(i, j) - a_expected(i, j)) > 1.0e-5) error stop end do end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/bindc_43c.c0000664000175000017500000000152115174404631021260 0ustar alastairalastair/* * C functions for bindc_43: struct returned by value / passed by VALUE * * Tests BIND(C) derived type interoperability with by-value semantics. */ typedef struct { float x, y; } point_t; typedef struct { point_t origin; float width, height; } rect_t; point_t c43_make_point(float x, float y) { point_t p; p.x = x; p.y = y; return p; } rect_t c43_make_rect(float ox, float oy, float w, float h) { rect_t r; r.origin.x = ox; r.origin.y = oy; r.width = w; r.height = h; return r; } float c43_point_dist_sq(point_t a, point_t b) { float dx = a.x - b.x; float dy = a.y - b.y; return dx * dx + dy * dy; } float c43_rect_area(rect_t r) { return r.width * r.height; } point_t c43_add_points(point_t a, point_t b) { point_t r; r.x = a.x + b.x; r.y = a.y + b.y; return r; } lfortran-0.63.0/integration_tests/derived_types_106.f900000664000175000017500000000256615174404631023152 0ustar alastairalastairmodule nf_multihead_attention_layer implicit none type :: multihead_attention_layer integer :: seq_len, model_dim, n_heads, head_size real, allocatable :: output_layer(:, :) real, allocatable :: d_output(:, :, :) contains procedure :: sdpa_backward procedure :: split_heads end type contains subroutine sdpa_backward(self) class(multihead_attention_layer), intent(inout) :: self if (.not. allocated(self%output_layer)) error stop "Not allocated" self%d_output = self%split_heads(self%output_layer) end subroutine pure function split_heads(self, input) result(out) class(multihead_attention_layer), intent(in) :: self real, intent(in) :: input(:, :) real :: out(self%seq_len, self%head_size, self%n_heads) integer :: h if (size(input,2) /= self%model_dim) error stop "Wrong shape" do h = 1, self%n_heads out(:,:,h) = input(:, (h-1)*self%head_size+1:h*self%head_size) end do end function end module program test use nf_multihead_attention_layer implicit none type(multihead_attention_layer) :: L L%seq_len = 2 L%model_dim = 4 L%n_heads = 2 L%head_size = 2 allocate(L%output_layer(2,4)) L%output_layer = reshape([1.,2.,3.,4.,5.,6.,7.,8.], [2,4]) call L%sdpa_backward() print *, L%d_output if (any(L%d_output /= reshape([1.,2.,3.,4.,5.,6.,7.,8.], [2, 2, 2]))) error stop end program lfortran-0.63.0/integration_tests/bindc5.f900000664000175000017500000000156315174404631021056 0ustar alastairalastairmodule thread_data_module_tasks use, intrinsic :: iso_c_binding implicit none type :: thread_data type(c_ptr) :: i_ptr end type thread_data end module thread_data_module_tasks program bindc5 use thread_data_module_tasks use, intrinsic :: iso_c_binding implicit none integer, target :: i integer, pointer :: ptr_i, ptr_i2 type(thread_data), pointer :: d,d1 type(thread_data), target :: threadData, taskData type(c_ptr) :: threadPtr, taskPtr i=0 threadData%i_ptr = c_loc(i) threadPtr = c_loc(threadData) call c_f_pointer(threadPtr, d) call c_f_pointer(d%i_ptr, ptr_i) ptr_i=2 taskData%i_ptr = d%i_ptr taskPtr = c_loc(taskData) call c_f_pointer(taskPtr, d1) call c_f_pointer(d1%i_ptr, ptr_i2) ptr_i2=3 print*, i,ptr_i2,ptr_i if(i/=ptr_i2 .and. i/=ptr_i) error stop end program bindc5lfortran-0.63.0/integration_tests/implicit_interface_11.f900000664000175000017500000000040415174404631024036 0ustar alastairalastairmodule implicit_interface_11_module implicit integer (f) contains function f() f = 1 end function f end program main use implicit_interface_11_module integer :: i i = f() if (i /= 1) error stop print *, i end program main lfortran-0.63.0/integration_tests/file_40.f900000664000175000017500000000150215174404631021125 0ustar alastairalastairprogram file_40 implicit none integer :: i real :: r open(10, file="data.txt", status="replace", form="formatted") write(10,'(A)') "1 2" ! INTEGER field (I4) write(10,'(A)') "3 . 5" ! REAL field (F5.1) close(10) open(10, file="data.txt", form="formatted", blank="null") read(10,'(I4)') i read(10,'(F5.1)') r close(10) print *, "INTEGER :", i ! -> 12 print *, "REAL :", r ! -> 3.5 if ( i /= 12) error stop if ( r /= 3.5) error stop open(10, file="data.txt", form="formatted", blank="zero") read(10,'(I4)') i read(10,'(F5.1)') r close(10) print *, "INTEGER :", i ! -> 1002 print *, "REAL :", r ! -> 3.5 (same result) if ( i /= 1002) error stop if ( abs(r-30.0499992) > 1e-6 ) error stop end program lfortran-0.63.0/integration_tests/where_17.f900000664000175000017500000000106515174404631021330 0ustar alastairalastairprogram where_17 implicit none integer :: nz(3), maxnz(3), minnz(3) integer :: mx nz = [480, 120, 1] maxnz = 0 where (nz > 1) maxnz = maxval(nz) end where if (maxnz(1) /= 480) error stop if (maxnz(2) /= 480) error stop if (maxnz(3) /= 0) error stop minnz = 0 where (nz > 100) minnz = minval(nz) end where if (minnz(1) /= 1) error stop if (minnz(2) /= 1) error stop if (minnz(3) /= 0) error stop mx = maxnz(1) if (mx /= 480) error stop print *, mx end program where_17 lfortran-0.63.0/integration_tests/intrinsics_354.f900000664000175000017500000000034715174404631022471 0ustar alastairalastairprogram intrinsics_354 integer :: x(2) x = [1, 2] call sub(x) print *, x if (any(x /= [1, 2])) error stop contains subroutine sub(x) integer :: x(2) real :: arr(minval(abs(x))) end subroutine sub end programlfortran-0.63.0/integration_tests/implicit_interface_28.f900000664000175000017500000000052015174404631024045 0ustar alastairalastairprogram implicit_interface_28 implicit none intrinsic sqrt real :: result result = find(sqrt, 9.0) print *, result if (abs(result - 3.0) > 1.0e-6) error stop contains real function find(func, x) real, external :: func real, intent(in) :: x find = func(x) end function find end program implicit_interface_28 lfortran-0.63.0/integration_tests/array_unbounded_02.f900000664000175000017500000000035715174404631023374 0ustar alastairalastairsubroutine sub(x) real :: x dimension :: x(1:*) x(1) = 4.39 end subroutine program array_unbounded_02 real :: y(10), w(10) call sub(y) print *, y(1) if (abs(y(1) - 4.39) > 1e-10) error stop end program lfortran-0.63.0/integration_tests/list_test_09_.f900000664000175000017500000000331415174404631022367 0ustar alastairalastairmodule list_test_09_mod implicit none real :: eps = 1e-6 contains subroutine test_list_concat() type(_lfortran_list(integer)) :: x, y, z type(_lfortran_list(character(:))) :: c, d integer :: i z = _lfortran_concat(x, y) if (_lfortran_len(z) /= 0) error stop x = _lfortran_list_constant(1, 2, 3) z = _lfortran_concat(x, y) do i = 1, 3 if (_lfortran_get_item(z, i - 1) /= i) error stop end do call _lfortran_clear(x) y = _lfortran_list_constant(6, 7, 8) z = _lfortran_concat(x, y) do i = 1, 3 if (_lfortran_get_item(z, i - 1) /= i + 5) error stop end do x = _lfortran_list_constant(1, 2, 3, 4, 5) z = _lfortran_concat(x, y) do i = 1, 8 if (_lfortran_get_item(z, i - 1) /= i) error stop end do call _lfortran_clear(x) call _lfortran_clear(y) do i = 9, 50 call _lfortran_list_append(x, i) end do do i = 51, 100 call _lfortran_list_append(y, i) end do z = _lfortran_concat(_lfortran_concat(z, x), y) call _lfortran_set_item(x, 0, 0) call _lfortran_set_item(x, 1, 0) call _lfortran_clear(y) do i = 1, 99 if (_lfortran_get_item(z, i - 1) /= i) error stop end do c = _lfortran_list_constant('a', 'b') d = _lfortran_list_constant('c', 'd', 'e') c = _lfortran_concat(c, d) if (_lfortran_len(c) /= 5) error stop do i = 0, 4 if (_lfortran_ord(_lfortran_get_item(c, i)) - _lfortran_ord('a') /= i) error stop end do end subroutine end module program test_list_concat_ use list_test_09_mod implicit none call test_list_concat() end program lfortran-0.63.0/integration_tests/arrays_116.f900000664000175000017500000000220415174404631021573 0ustar alastairalastairmodule arrays_116_mod implicit none type :: layer_t real, allocatable :: weights(:,:) end type layer_t type :: model_t type(layer_t) :: query_layer end type model_t contains subroutine build_params(self) type(model_t), intent(in) :: self real, allocatable :: params(:) integer :: i real :: expected(4) ! Flatten weights allocate(params(size(self%query_layer%weights))) params = reshape(self%query_layer%weights, [size(self%query_layer%weights)]) ! Expected values (column-major flattening) expected = [1.0,2.0,3.0,4.0] ! Check size if (size(params) /= size(expected)) then error stop "params size mismatch" end if ! Check values do i = 1, size(params) if (params(i) /= expected(i)) then error stop "params value mismatch" end if end do end subroutine build_params end module arrays_116_mod program arrays_116 use arrays_116_mod implicit none type(model_t) :: model allocate(model%query_layer%weights(2,2)) model%query_layer%weights = reshape([1.0,2.0,3.0,4.0],[2,2]) call build_params(model) end program arrays_116lfortran-0.63.0/integration_tests/value_attribute_01.f900000664000175000017500000000223015174404631023401 0ustar alastairalastairprogram value_attribute_01 implicit none integer :: x real :: y logical :: z x = 500 if (divide_val(x) /= 50) error stop "FAIL: divide_val result" if (x /= 500) error stop "FAIL: x was modified by divide_val" y = 3.0 if (abs(scale_val(y) - 6.0) > 1.0e-6) error stop "FAIL: scale_val result" if (abs(y - 3.0) > 1.0e-6) error stop "FAIL: y was modified by scale_val" z = .true. if (flip_val(z) .neqv. .false.) error stop "FAIL: flip_val result" if (z .neqv. .true.) error stop "FAIL: z was modified by flip_val" call modify_val_sub(x) if (x /= 500) error stop "FAIL: x was modified by modify_val_sub" print *, "PASS" contains pure function divide_val(num) result(res) integer, value :: num integer :: res num = num / 10 res = num end function pure function scale_val(val) result(res) real, value :: val real :: res val = val * 2.0 res = val end function pure function flip_val(flag) result(res) logical, value :: flag logical :: res flag = .not. flag res = flag end function subroutine modify_val_sub(n) integer, value :: n n = n + 100 end subroutine end program lfortran-0.63.0/integration_tests/struct_type_03.f900000664000175000017500000000032315174404631022572 0ustar alastairalastairprogram struct_type_03 type :: struct real :: field = 5.0 end type struct type(struct) :: array(3) write(*,*) sum(array(:)%field) if (sum(array(:)%field) /= 15.0) error stop end programlfortran-0.63.0/integration_tests/intrinsics_84.f900000664000175000017500000000224415174404631022407 0ustar alastairalastairprogram intrinsics_84 use iso_fortran_env, only: sp => real32, dp => real64 implicit none integer, parameter :: i1 = minexponent(0.131_sp) integer, parameter :: i2 = minexponent(0.12819_dp) integer, parameter :: ar1 = minexponent([0.131_sp, 0.12819_sp, 0.0_sp]) integer, parameter :: ar2 = minexponent([1.24_dp, 1.119_dp, 0.0_dp]) real(kind=4) :: x real(kind=8) :: y real(sp) :: arr1(3) = [0.131_sp, 0.12819_sp, 0.0_sp] real(dp) :: arr2(3) = [1.24_dp, 1.239_dp, 0.0_dp] integer :: result print *, i1 if (i1 /= -125) error stop print *, i2 if (i2 /= -1021) error stop print *, ar1 if (ar1 /= -125) error stop print *, ar2 if (ar2 /= -1021) error stop result = minexponent(x) print *, result if (result /= -125) error stop result = minexponent(y) print *, result if (result /= -1021) error stop result = minexponent(4.235) print *, result if (result /= -125) error stop result = minexponent(4.235d0) print *, result if (result /= -1021) error stop print *, minexponent(arr1) if (minexponent(arr1) /= -125) error stop print *, minexponent(arr2) if (minexponent(arr2) /= -1021) error stop end program intrinsics_84 lfortran-0.63.0/integration_tests/class_134.f900000664000175000017500000000133115174404631021377 0ustar alastairalastairmodule class_134_mod implicit none type :: container class(*), allocatable :: value(:) end type contains subroutine set_value(this, value) class(container), intent(out) :: this class(*), intent(in) :: value(:) this%value = value end subroutine end module program class_134 use class_134_mod implicit none type(container) :: x call set_value(x, ['foo', 'bar']) if (.not. allocated(x%value)) error stop select type (v => x%value) type is (character(*)) if (size(v) /= 2) error stop if (v(1) /= 'foo') error stop if (v(2) /= 'bar') error stop class default error stop end select print *, "PASS" end program lfortran-0.63.0/integration_tests/character_04.f900000664000175000017500000000015615174404631022146 0ustar alastairalastairprogram character_04 implicit none character(len=1, kind=1), parameter :: c_null_char = "" end programlfortran-0.63.0/integration_tests/gpu_metal_141.f900000664000175000017500000000101515174404631022244 0ustar alastairalastairmodule gpu_metal_141_m implicit none enum, bind(C) enumerator :: gelu = 1 end enum contains pure integer function add_enum(x) integer, intent(in) :: x add_enum = x + gelu end function end module gpu_metal_141_m program gpu_metal_141 use gpu_metal_141_m, only: add_enum implicit none integer :: i, y(4) do concurrent(i = 1:4) y(i) = add_enum(i) end do print *, y if (y(1) /= 2) error stop if (y(2) /= 3) error stop if (y(3) /= 4) error stop if (y(4) /= 5) error stop end program lfortran-0.63.0/integration_tests/pass_array_by_data_06.f900000664000175000017500000000047615174404631024050 0ustar alastairalastairprogram example_lmdif1 implicit none real :: x(3), err x = 4.0 err = abs(sum2(x) - 12.0) print *, err if (err > 1e-6) error stop contains real function sum2(x) result(r) real, intent(in) :: x(:) integer :: i r = 0 do i = 1, size(x) r = r + x(i) end do end function end program lfortran-0.63.0/integration_tests/intrinsics_58.f900000664000175000017500000000357415174404631022417 0ustar alastairalastairprogram intrinsics_58 integer :: x, y, signval real :: x1, y1, signval1 integer :: int_res(4) ! Compile time tests if (sign( 5, 10) /= 5) error stop if (sign(-5, 10) /= 5) error stop if (sign( 5, -10) /= -5) error stop if (sign(-5, -10) /= -5) error stop if (sign( 5., 10.) /= 5.) error stop if (sign(-5., 10.) /= 5.) error stop if (sign( 5., -10.) /= -5.) error stop if (sign(-5., -10.) /= -5.) error stop ! Ensure that compile time broadcasting works !> positive second argument int_res = sign([1, 2, 5, -1], 2) print *, int_res if (int_res(1) /= 1) error stop if (int_res(2) /= 2) error stop if (int_res(3) /= 5) error stop if (int_res(4) /= 1) error stop !> negative second argument int_res = sign([1, 2, -5, 1], -3) print *, int_res if (int_res(1) /= -1) error stop if (int_res(2) /= -2) error stop if (int_res(3) /= -5) error stop if (int_res(4) /= -1) error stop ! Runtime tests x = 5 y = 10 signval = sign(x, y) print *, signval if( signval /= 5 ) error stop x = 5 y = -10 signval = sign(x, y) print *, signval if( signval /= -5 ) error stop x = -5 y = 10 signval = sign(x, y) print *, signval if( signval /= 5 ) error stop x = -5 y = -10 signval = sign(x, y) print *, signval if( signval /= -5 ) error stop x1 = 5.0 y1 = 10.0 signval1 = sign(x1, y1) print *, signval1 if( signval1 /= 5.0 ) error stop x1 = 5.0 y1 = -10.0 signval1 = sign(x1, y1) print *, signval1 if( signval1 /= -5.0 ) error stop x1 = -5.0 y1 = 10.0 signval1 = sign(x1, y1) print *, signval1 if( signval1 /= 5.0 ) error stop x1 = -5.0 y1 = -10.0 signval1 = sign(x1, y1) print *, signval1 if( signval1 /= -5.0 ) error stop end program intrinsics_58 lfortran-0.63.0/integration_tests/arithmetic_if_01.f900000664000175000017500000000144215174404631023015 0ustar alastairalastairprogram arithmetic_if_01 integer :: x, c ! Singleline x = -3 c = 0 if (x) 1, 2, 3 1 c = c + 1 2 c = c + 2 3 c = c + 4 print *, c if (c /= 7) error stop x = 0 c = 0 if (x) 4, 5, 6 4 c = c + 1 5 c = c + 2 6 c = c + 4 print *, c if (c /= 6) error stop x = 7 c = 0 if (x) 7, 8, 9 7 c = c + 1 8 c = c + 2 9 c = c + 4 print *, c if (c /= 4) error stop ! Multiline x = -3 c = 0 if (x) 11, 12, 13 11 c = c + 1 c = c + 100 12 c = c + 2 c = c + 200 13 c = c + 4 c = c + 400 print *, c if (c /= 707) error stop x = 0 c = 0 if (x) 14, 15, 16 14 c = c + 1 c = c + 100 15 c = c + 2 c = c + 200 16 c = c + 4 c = c + 400 print *, c if (c /= 606) error stop x = 7 c = 0 if (x) 17, 18, 19 17 c = c + 1 c = c + 100 18 c = c + 2 c = c + 200 19 c = c + 4 c = c + 400 print *, c if (c /= 404) error stop end program lfortran-0.63.0/integration_tests/bindc_15.f900000664000175000017500000000217515174404631021276 0ustar alastairalastair! Test c_f_pointer for character pointer with expression length program bindc_15 use iso_c_binding implicit none character(:), allocatable :: s character(12, kind=c_char), target, save :: buf type(c_ptr) :: cptr buf = "hello world" // c_null_char cptr = c_loc(buf) s = f_string_pointer(cptr) if (len(s) /= 11) error stop if (s /= "hello world") error stop print *, "PASS" contains function f_string_pointer(cptr) result(fptr) type(c_ptr), intent(in) :: cptr character(:), pointer :: fptr interface function strlen(s) result(len) bind(c) use iso_c_binding type(c_ptr), value :: s integer(c_size_t) :: len end function end interface fptr => f_string_pointer_aux(cptr, strlen(cptr)) contains function f_string_pointer_aux(cptr, len) result(fptr) type(c_ptr), intent(in) :: cptr integer(c_size_t), intent(in) :: len character(len), pointer :: fptr call c_f_pointer(cptr, fptr) end function end function end program lfortran-0.63.0/integration_tests/submodule_24.f900000664000175000017500000000121015174404631022203 0ustar alastairalastairmodule submodule_24_mod implicit none interface integer function i() end function end interface interface module function f(p) result(r) procedure(i) :: p integer :: r end function end interface end module submodule(submodule_24_mod) submodule_24_sub implicit none contains module procedure f r = p() end procedure end submodule program submodule_24 use submodule_24_mod, only: f implicit none if (f(get_four) /= 4) error stop print *, "ok" contains integer function get_four() get_four = 4 end function end program lfortran-0.63.0/integration_tests/arrays_op_22.f900000664000175000017500000000111615174404631022206 0ustar alastairalastairprogram arrays_op_22 implicit none real :: array(10, 10), output(10, 10) array = 3.0 output = prg(array) print *, output if( any(abs(output - 6.0) > 1e-8) ) error stop contains function prg(arr) result(otpt) real, intent(in) :: arr(:, :) real :: otpt(size(arr, 1), size(arr, 2)) otpt = copy_array(twice(copy_array(arr))) end function elemental real function twice(x) result(y) real, intent(in) :: x y = 2.0*x end function function copy_array(input) result(output) real, intent(in) :: input(:, :) real :: output(size(input, 1), size(input, 2)) output = input end function end program lfortran-0.63.0/integration_tests/program_03.f900000664000175000017500000000107115174404631021655 0ustar alastairalastairprogram closuretest ! Obtained from https://events.prace-ri.eu/event/694/attachments/627/918/advanced_fortran_handout.pdf integer :: z do z=1,10 print *, apply(add_z, 1) end do contains function apply(fun,x) result(y) !procedure(intfun) :: fun integer :: x, y interface integer function fun(x) integer :: x end function fun end interface y = fun(x) end function function add_z(x) result(y) integer :: x, y y = x + z end function end program lfortran-0.63.0/integration_tests/format_70.f900000664000175000017500000000246415174404631021511 0ustar alastairalastairprogram format_70 use iso_fortran_env, only: dp => real64 implicit none character(20) :: str character(67) :: str_long ! EN format: rounding causes mantissa overflow past [1, 1000) write(str, '(EN10.1)') 999.9999 if (trim(adjustl(str)) /= "1.0E+03") error stop "EN10.1 999.9999 failed" write(str, '(EN10.1)') 99.96 if (trim(adjustl(str)) /= "100.0E+00") error stop "EN10.1 99.96 failed" write(str, '(EN12.3)') 999.9999 if (trim(adjustl(str)) /= "1.000E+03") error stop "EN12.3 999.9999 failed" write(str, '(EN12.3)') 0.0009999999 if (trim(adjustl(str)) /= "1.000E-03") error stop "EN12.3 0.0009999999 failed" write(str, '(EN12.3)') 999999.6 if (trim(adjustl(str)) /= "1.000E+06") error stop "EN12.3 999999.6 failed" ! Normal EN cases (no overflow) write(str, '(EN12.3)') 123.456 if (trim(adjustl(str)) /= "123.456E+00") error stop "EN12.3 123.456 failed" write(str, '(EN12.3)') 0.00456 if (trim(adjustl(str)) /= "4.560E-03") error stop "EN12.3 0.00456 failed" ! E format: high-precision rounding with > 15 significant digits write(str_long, '(E67.62)') 1.23456789101112e-62_dp if (str_long /= ".12345678910111198970867447229396098431025025677513665382815545E-61") & error stop "E67.62 rounding failed" end program format_70 lfortran-0.63.0/integration_tests/file_open_08.f900000664000175000017500000000064515174404631022161 0ustar alastairalastairprogram file_open_08 ! Test that open(file=var) does not corrupt the file= variable implicit none character(len=20) :: fname integer :: i fname = "file_open_08.tmp" open(unit=10, file=fname) close(10, status="delete") ! After open, all trailing characters must still be spaces (char code 32), ! not null bytes (char code 0). do i = 17, 20 if (iachar(fname(i:i)) /= 32) error stop end do print *, "PASS" end program lfortran-0.63.0/integration_tests/intrinsics_136.f900000664000175000017500000000367115174404631022472 0ustar alastairalastairprogram intrinsics_136 integer(4) :: x, y integer(8) :: i, j integer(4) :: arg_x(5) = [12, -13, 18, 20, 67] integer(4) :: arg_y(5) = [1, 2, 3, 4, 5] integer(8) :: arg_x2(5) = [103, 87, 88, -95, -134] integer(8) :: arg_y2(5) = [11, 12, 4, 0, 10] integer(4) :: res_x(5) integer(8) :: res_x2(5) integer(4), parameter :: res(5) = rshift([12, -13, 18, 20, 67], [1, 2, 3, 4, 5]) integer(8), parameter :: res2(5) = rshift([103, 87, 88, -95, -134], [11, 12, 4, 0, 10]) integer(4) :: expected_res(5) = [6, -4, 2, 1, 2] integer(8) :: expected_res2(5) = [0, 0, 5, -95, -1] integer(4), parameter :: comp1 = rshift(12, 1) integer(8), parameter :: comp2 = rshift(103, 11) print *, comp1 if (comp1 /= 6) error stop print *, comp2 if (comp2 /= 0) error stop res_x = rshift(arg_x, arg_y) res_x2 = rshift(arg_x2, arg_y2) do i = 1, size(res) print *, res(i) if (res(i) /= expected_res(i)) error stop end do do i = 1, size(res2) print *, res2(i) if (res2(i) /= expected_res2(i)) error stop end do do i = 1, size(res_x) print *, res_x(i) if (res_x(i) /= expected_res(i)) error stop end do do i = 1, size(res_x2) print *, res_x2(i) if (res_x2(i) /= expected_res2(i)) error stop end do x = 16 y = 2 i = 8 j = 4 print*, rshift(10_4, 0) if ( rshift(10_4, 0) /= 10) error stop print*, rshift(-10_8, 1) if ( rshift(-10_8, 1) /= -5 ) error stop print*, rshift(not(10_4), 2) if ( rshift(not(10_4), 2) /= -3 ) error stop print*, rshift(not(10_8), 3) if ( rshift(not(10_8), 3) /= -2 ) error stop print*, rshift(-x, y) if ( rshift(-x, y) /= -4 ) error stop print*, rshift(i, j) if ( rshift(i, j) /= 0 ) error stop print*, rshift(10, 1) if ( rshift(10, 1) /= 5 ) error stop print*, rshift(8, 2) if ( rshift(8, 2) /= 2 ) error stop endlfortran-0.63.0/integration_tests/if_02.f900000664000175000017500000000006715174404631020607 0ustar alastairalastairprogram if_02 implicit none if (.true.) error stop end lfortran-0.63.0/integration_tests/openmp_bindc_04.f900000664000175000017500000000657215174404631022657 0ustar alastairalastairmodule bindc_04_thread_data_module use, intrinsic :: iso_c_binding type, bind(C) :: thread_data integer(c_int) :: n, m type(c_ptr) :: a end type thread_data end module bindc_04_thread_data_module module module_openmp_bindc_04 use iso_c_binding implicit none interface subroutine GOMP_parallel (fn, data, num_threads, flags) bind (C, name="GOMP_parallel") import :: c_funptr, c_ptr, c_int type(c_funptr), value :: fn type(c_ptr), value :: data integer(c_int), value :: num_threads integer(c_int), value :: flags end subroutine subroutine GOMP_barrier() bind(C, name="GOMP_barrier") end subroutine subroutine GOMP_critical_start() bind(C, name="GOMP_critical_start") end subroutine subroutine GOMP_critical_end() bind(C, name="GOMP_critical_end") end subroutine function omp_get_max_threads() bind(c, name="omp_get_max_threads") import :: c_int integer(c_int) :: omp_get_max_threads end function omp_get_max_threads function omp_get_thread_num() bind(c, name="omp_get_thread_num") import :: c_int integer(c_int) :: omp_get_thread_num end function omp_get_thread_num subroutine omp_set_num_threads(n) bind(c, name="omp_set_num_threads") import :: c_int integer(c_int), value :: n end subroutine omp_set_num_threads subroutine GOMP_atomic_start() bind(C, name="GOMP_atomic_start") end subroutine subroutine GOMP_atomic_end() bind(C, name="GOMP_atomic_end") end subroutine end interface end module subroutine lcompilers_initialise_array(data) bind(C) use bindc_04_thread_data_module use iso_c_binding use module_openmp_bindc_04 implicit none type(c_ptr), value :: data type(thread_data), pointer :: tdata real(c_float), pointer :: a(:,:) integer(c_int) :: i, j, n, m, num_threads, chunk, leftovers, thread_num, start, end call c_f_pointer(data, tdata) n = tdata%n m = tdata%m call c_f_pointer(tdata%a, a, [n, m]) num_threads = omp_get_max_threads() chunk = n / num_threads leftovers = mod(n, num_threads) thread_num = omp_get_thread_num() start = chunk * thread_num if (thread_num < leftovers) then start = start + thread_num else start = start + leftovers end if end = start + chunk if (thread_num < leftovers) then end = end + 1 end if do i = start + 1, end do j = 1, m a(i, j) = 12.91 end do end do call GOMP_barrier() end subroutine subroutine initialize_array(n, m, a) use bindc_04_thread_data_module use module_openmp_bindc_04 use iso_c_binding implicit none interface subroutine lcompilers_initialise_array(data) bind(C) use iso_c_binding type(c_ptr), value :: data end subroutine end interface integer(c_int), intent(in) :: n, m real(c_float), dimension(:, :), intent(inout), pointer :: a type(thread_data), target :: data type(c_ptr) :: tdata data%n = n data%m = m data%a = c_loc(a) tdata = c_loc(data) call GOMP_parallel(c_funloc(lcompilers_initialise_array), tdata, 0, 0) end subroutine program openmp_bindc_04 use omp_lib use module_openmp_bindc_04 use bindc_04_thread_data_module use iso_c_binding implicit none interface subroutine initialize_array(n, m, a) use iso_c_binding integer(c_int), intent(in) :: n, m real(c_float), intent(inout), dimension(:, :), pointer :: a end subroutine end interface integer(c_int) :: n = 1902, m = 300 real(c_float), dimension(:, :), pointer :: a allocate(a(n, m)) call omp_set_num_threads(4) call initialize_array(n, m, a) print *, "Done" print *, a(1,2) if (abs(a(1,2) - 12.91) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/where_07.f900000664000175000017500000000214315174404631021325 0ustar alastairalastairprogram where_07 implicit none integer :: call_num logical(4), dimension(4) :: l l = [.true., .false., .true., .false.] call_num = 1 ! neqv operator where (l .neqv. .true.) l = .true. end where print *, l IF (all(l .neqv. [.true., .true., .true., .true.])) ERROR STOP ! or operator where (l .or. .false.) l = get_boolean_false() end where print *, l IF (all(l .neqv. [.false., .true., .false., .true.])) ERROR STOP ! and operator where (l .and. get_boolean_true()) l = .false. end where print *, l IF (all(l .neqv. [.false., .false., .false., .false.])) ERROR STOP ! eqv operator where (l .eqv. get_boolean_false()) l = .true. end where print *, l IF (all(l .neqv. [.true., .false., .true., .true.])) ERROR STOP contains pure logical function get_boolean_true() result(value) implicit none value = .true. end function get_boolean_true pure logical function get_boolean_false() result(value) implicit none value = .false. end function get_boolean_false end program where_07 lfortran-0.63.0/integration_tests/line_continuation_04.f900000664000175000017500000000133515174404631023733 0ustar alastairalastairprogram line_continuation_04 implicit none integer :: result, a, b, c character(len=20) :: textblock textblock = '&!' print *, textblock if (textblock /= "&!") error stop textblock = "apple& !apple " print *, textblock if (textblock /= "apple") error stop ! textblock = "apple'&!apple" ! if (textblock /= "apple'&!apple") error stop a = 1 b = 2 c = 3 ! the below line doesn't have &! in a string ! hence, everything after ! is treated as a ! comment result = a + b +&!addition here c print *, result if (result /= 6) error stop textblock = "& !" print *, textblock if (textblock /= "& !") error stop end program line_continuation_04 lfortran-0.63.0/integration_tests/set_test_01.f900000664000175000017500000000134315174404631022040 0ustar alastairalastairprogram lp_set_test_01 integer :: x _lfortran_set(integer) :: test_set test_set = _lfortran_set_constant(1, 2, 3, 4, 4, 5, 4, 10) call _lfortran_set_add(test_set, 1) call _lfortran_set_add(test_set, 10) call _lfortran_set_add(test_set, 11) x = _lfortran_len(test_set) if (x /= 7) error stop test_set = _lfortran_set_constant(1, 2, 3, 4) if (_lfortran_len(test_set) /= 4) error stop call _lfortran_set_add(test_set, -50) if (_lfortran_len(test_set) /= 5) error stop type(_lfortran_set(integer)) :: test_set_ test_set_ = _lfortran_set_constant(3, 4, 8, 5, 4, 10) call _lfortran_set_add(test_set_, 1) if (_lfortran_len(test_set_) /= 6) error stop ! Add other intrinsics later end program lfortran-0.63.0/integration_tests/gpu_metal_122.f900000664000175000017500000000050615174404631022247 0ustar alastairalastairprogram gpu_metal_122 implicit none integer :: i real :: a(4) do concurrent (i = 1:4) a(i) = merge(1.0, 0.0, i > 2) end do print *, a if (abs(a(1) - 0.0) > 1e-6) error stop if (abs(a(2) - 0.0) > 1e-6) error stop if (abs(a(3) - 1.0) > 1e-6) error stop if (abs(a(4) - 1.0) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/bindc_iso_fb_07c.c0000664000175000017500000000024515174404631022603 0ustar alastairalastair#include int check_elem_len(CFI_cdesc_t* a, int expected) { if ((int)a->elem_len != expected) { return 1; } return 0; } lfortran-0.63.0/integration_tests/if_label_01.f900000664000175000017500000000120315174404631021736 0ustar alastairalastairprogram if_label_01 implicit none integer :: basein_local basein_local = 1 ! Try 1 or 2 to test both branches ALL: if (basein_local < 0) then print *, "Inside IF block: basein_local =", basein_local else TMP: block basein_local = 2 ! This will override the outer variable exit ALL end block TMP print *, "Inside ELSE block: basein_local =", basein_local basein_local = 3 ! This will not be executed if the exit is taken end if ALL print *, "After IF block: basein_local =", basein_local if (basein_local /= 2) error stop end program if_label_01 lfortran-0.63.0/integration_tests/allocate_24.f900000664000175000017500000000020115174404631021767 0ustar alastairalastairprogram allocate_24 integer,allocatable:: x x = 666 print "(I0)", x if (x /= 666) error stop deallocate(x) end program lfortran-0.63.0/integration_tests/template_triple.f900000664000175000017500000000703715174404631023106 0ustar alastairalastairmodule Math_integer_m implicit none contains pure function add_integer(x, y) result(result) integer, intent(in) :: x, y integer :: result result = x + y end function pure function minus_integer(x, y) result(result) integer, intent(in) :: x, y integer :: result result = x - y end function pure function max_integer(x, y) result(result) integer, intent(in) :: x, y integer :: result result = max(x, y) end function pure function min_integer(x, y) result(result) integer, intent(in) :: x, y integer :: result result = min(x, y) end function pure function zero_integer() result(result) integer :: result result = 0 end function pure function one_integer() result(result) integer :: result result = 1 end function end module module Math_real_m implicit none contains pure function add_real(x, y) result(result) real, intent(in) :: x, y real :: result result = x + y end function pure function minus_real(x, y) result(result) real, intent(in) :: x, y real :: result result = x - y end function pure function slash_real(x, y) result(result) real, intent(in) :: x, y real :: result result = x / y end function pure function max_real(x, y) result(result) real, intent(in) :: x, y real :: result result = max(x, y) end function pure function min_real(x, y) result(result) real, intent(in) :: x, y real :: result result = min(x, y) end function pure function zero_real() result(result) real :: result result = 0.0 end function pure function one_real() result(result) real :: result result = 1.0 end function end module module triple_m implicit none private public :: triple_tmpl requirement magma_r(T, plus_T) type, deferred :: T pure function plus_T(l, r) result(total) type(T), intent(in) :: l, r type(T) :: total end function end requirement template triple_tmpl(T, plus_T) require :: magma_r(T, plus_T) private public :: triple_l, triple_r contains pure function triple_l(t) result(result) type(T), intent(in) :: t type(T) :: result result = plus_T(plus_T(t, t), t) end function pure function triple_r(t) result(result) type(T), intent(in) :: t type(T) :: result result = plus_T(t, plus_T(t, t)) end function end template end module module use_triple_m use Math_integer_m use Math_real_m use triple_m contains subroutine test_add_triples() instantiate triple_tmpl(integer, add_integer), & only: triple_add_l => triple_l, & triple_add_r => triple_r integer :: tal, tar tal = triple_add_l(7) tar = triple_add_r(7) print *, "tal = ", tal, " tar = ", tar end subroutine subroutine test_minus_triples() instantiate triple_tmpl(real, minus_real), & only: triple_minus_l => triple_l, & triple_minus_r => triple_r real :: tml, tmr tml = triple_minus_l(7.0) tmr = triple_minus_r(7.0) print *, "tml = ", tml, " tmr = ", tmr end subroutine subroutine test_max_triples() instantiate triple_tmpl(real, max_real), & only: triple_max_l => triple_l, & triple_max_r => triple_r real :: tmaxl, tmaxr tmaxl = triple_max_l(7.0) tmaxr = triple_max_r(7.0) print *, "tmaxl =", tmaxl, " tmaxr =", tmaxr end subroutine end module program template_triple use use_triple_m call test_add_triples() call test_minus_triples() call test_max_triples() end program template_triple lfortran-0.63.0/integration_tests/elemental_07.f900000664000175000017500000000074315174404631022165 0ustar alastairalastairprogram elemental_07 integer, parameter :: n = 10 integer :: i type :: vector integer :: elements(-5:4) end type type(vector) :: a, b, c do i = -5, 4 a%elements(i) = i b%elements(i) = i end do c%elements = add_vector(a%elements, b%elements) print *, c%elements do i = -5, 4 if (c%elements(i) /= 2*i) error stop end do contains elemental function add_vector(a, b) result(c) integer, intent(in) :: a, b integer :: c c = a + b end function end program lfortran-0.63.0/integration_tests/complex_07.f900000664000175000017500000000226115174404631021663 0ustar alastairalastairprogram complex_07 implicit none integer, parameter :: real_part = 42 real, parameter :: img_part = 3.14 complex :: x = cmplx(real_part) complex :: y = cmplx(img_part) complex :: z = cmplx(real_part, img_part) double complex :: c1, x2, y2, z2 integer :: i = 42 real :: x1 = 3.14 complex :: z1 z1 = cmplx(i, x1) c1 = (12, 24) print *, c1 x2 = dcmplx(real_part) y2 = dcmplx(img_part) z2 = dcmplx(real_part, img_part) if (abs(x - (real_part, 0)) > 1e-5) error stop if (abs(y - (img_part, 0)) > 1e-5) error stop if (abs(z - (real_part, img_part)) > 1e-5) error stop if (abs(x2 - (real_part, 0)) > 1e-5) error stop if (abs(y2 - (img_part, 0)) > 1e-5) error stop if (abs(z2 - (real_part, img_part)) > 1e-5) error stop print *, dcmplx(i) if (abs(dcmplx(i) - (42.000000,0.000000)) > 1e-5) error stop print *, dcmplx(x1) if (abs(dcmplx(x1) - (3.140000,0.000000)) > 1e-5) error stop print *, dcmplx(z1) if (abs(dcmplx(z1) - (42.000000,3.140000)) > 1e-5) error stop print *, dcmplx(x1, i) if (abs(dcmplx(x1, i) - (3.140000,42.000000)) > 1e-5) error stop print *, x, y, z end program lfortran-0.63.0/integration_tests/pointer_07.f900000664000175000017500000000275315174404631021702 0ustar alastairalastairprogram pointer_07 ! Test pointer bounds remapping to array sections ! Verifies that ap(0:n1,0:n2) => a(:,k) correctly points ! to the right column when reassociated implicit none integer :: i, j, n1, n2 real(8), allocatable, target :: a(:,:) real(8), pointer :: ap(:,:) => null() n1 = 3 n2 = 3 allocate( a((n1+1)*(n2+1),2) ) a = 0.0d0 ! First association: ap => column 1 ap(0:n1,0:n2) => a(:,1) do j = 0, n2 do i = 0, n1 ap(i,j) = 100.0d0 * j + i end do end do ! Second association: ap => column 2 ap(0:n1,0:n2) => a(:,2) do j = 0, n2 do i = 0, n1 ap(i,j) = -(100.0d0 * j + i) end do end do ! Verify column 1 was written correctly if (abs(a(1,1) - 0.0d0) > 1.0d-10) error stop if (abs(a(2,1) - 1.0d0) > 1.0d-10) error stop if (abs(a(3,1) - 2.0d0) > 1.0d-10) error stop if (abs(a(4,1) - 3.0d0) > 1.0d-10) error stop if (abs(a(5,1) - 100.0d0) > 1.0d-10) error stop if (abs(a(6,1) - 101.0d0) > 1.0d-10) error stop if (abs(a(16,1) - 303.0d0) > 1.0d-10) error stop ! Verify column 2 was written correctly (negative values) if (abs(a(1,2) - 0.0d0) > 1.0d-10) error stop if (abs(a(2,2) - (-1.0d0)) > 1.0d-10) error stop if (abs(a(3,2) - (-2.0d0)) > 1.0d-10) error stop if (abs(a(4,2) - (-3.0d0)) > 1.0d-10) error stop if (abs(a(5,2) - (-100.0d0)) > 1.0d-10) error stop if (abs(a(16,2) - (-303.0d0)) > 1.0d-10) error stop print *, "All tests passed." end program pointer_07 lfortran-0.63.0/integration_tests/intrinsics_286.f900000664000175000017500000001170415174404631022474 0ustar alastairalastairprogram intrinsics_286 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp) :: arg_x(15) real(sp) :: arg_y(15) real(dp) :: res_x(15) real(sp) :: res_y(15) real(dp) :: expected_res_x(15) real(sp) :: expected_res_y(15) real(dp) :: expected_x(10) real(sp) :: expected_y(10) real(dp) :: a = 0.5178181202_dp real(sp) :: b = -0.072816_sp real(dp) :: c = -0.5178181202_dp real(sp) :: d = 0.072816_sp real(dp), parameter :: res_dp(10) = atanh([-0.62818828_dp, -0.51725372_dp, -0.29257208_dp, & 0.62818828_dp, 0.51725372_dp, 0.29257208_dp, 0.00_dp, 0.829362821_dp, 0.952716192_dp, -0.241626228_dp]) real(sp), parameter :: res_sp(10) = atanh([-0.62818828_sp, -0.51725372_sp, -0.29257208_sp, & 0.62818828_sp, 0.51725372_sp, 0.29257208_sp, 0.00_sp, 0.829362821_sp, 0.952716192_sp, -0.241626228_sp]) expected_x = [-0.73841779693335385_dp, -0.57258300054508338_dp, -0.30137681412533290_dp, & 0.73841779693335385_dp, 0.57258300054508338_dp, 0.30137681412533290_dp, 0.00_dp, & 1.1860917289062738_dp, 1.8604043450053602_dp, -0.24650045327602343_dp] arg_x = [-0.67922251126_dp, -0.54363892699177885_dp, -0.29691551032790681_dp, & 0.67922251126401767_dp, 0.54363892699177885_dp, 0.29691551032790681_dp, 0.5707963267948966_dp, & 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp, -0.7281628262782_dp, & 0.5707963267948966_dp, 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp] arg_y = [-0.679222465_sp, -0.543638885_sp, -0.296915501_sp, & 0.679222465_sp, 0.543638885_sp, 0.296915501_sp, 0.57079637_sp, & 0.077966249_sp, 0.262053013_sp, -0.244041398_sp, -0.7281628262782_sp, & 0.57079637_sp, 0.077966249_sp, 0.262053013_sp, -0.244041398_sp] expected_y = [-0.738417745_sp, -0.572582960_sp, -0.301376820_sp, & 0.738417745_sp, 0.572582960_sp, 0.301376820_sp, 0.00_sp, 1.18609166_sp, 1.86040413_sp, & -0.246500462_sp] res_x = atanh(arg_x) res_y = atanh(arg_y) expected_res_x = [-0.82766923654327862_dp, -0.60930676235179848_dp, -0.30613348538306767_dp, & 0.82766923655073721_dp, 0.60930676235179848_dp, 0.30613348538306767_dp, 0.64870320764593825_dp, & 7.8124828806607219E-002_dp, 0.26831157000093397_dp, -0.24906695687441660_dp, -0.92480545603497655_dp, & 0.64870320764593825_dp, 7.8124828806607219E-002_dp, 0.26831157000093397_dp, -0.24906695687441660_dp] expected_res_y = [-0.827669144_sp, -0.609306693_sp, -0.306133479_sp, & 0.827669144_sp, 0.609306693_sp, 0.306133479_sp, 0.648703277_sp, & 7.81248063E-02_sp, 0.268311530_sp, -0.249066964_sp, -0.924805462_sp, & 0.648703277_sp, 7.81248063E-02_sp, 0.268311530_sp, -0.249066964_sp] do i = 1, size(res_dp) print *, res_dp(i) if (abs(res_dp(i) - expected_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_x) print *, res_x(i) if (abs(res_x(i)) - abs(expected_res_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_y(i)) > 1e-5) error stop end do do i = 1, size(res_y) print *, res_y(i) if (abs(res_y(i)) - abs(expected_res_y(i)) > 1e-5) error stop end do print *, atanh(a) if (abs(atanh(a)) - 0.57335387425222428_dp > 1e-12) error stop print *, atanh(0.5178181202_dp) if (abs(atanh(0.5178181202_dp) - 0.57335387425222428_dp) > 1e-12) error stop print *, atanh(b) if (atanh(b) - (-7.29451030E-02_sp) > 1e-5) error stop print *, atanh(-0.072816_sp) if (atanh(-0.072816_sp) - (-7.29451030E-02_sp) > 1e-5) error stop print *, atanh(c) if (atanh(c) - (-0.57335387425222428_dp) > 1e-12) error stop print *, atanh(-0.5178181202_dp) if (atanh(-0.5178181202_dp) - (-0.57335387425222428_dp) > 1e-12) error stop print *, atanh(d) if (atanh(d) - (7.29451030E-02_sp) > 1e-5) error stop print *, atanh(0.072816_sp) if (atanh(0.072816_sp) - (7.29451030E-02_sp) > 1e-5) error stop a = -0.271927291_dp b = -0.6382728_sp c = 0.271927291_dp d = 0.6382728_sp print *, atanh(a) if (abs(atanh(a) - (-0.27894383144663687_dp)) > 1e-12) error stop print *, atanh(-0.271927291_dp) if (abs(atanh(-0.271927291_dp) - (-0.27894383144663687_dp)) > 1e-12) error stop print *, atanh(b) if (atanh(b) - (0.755253792_sp) > 1e-5) error stop print *, atanh(-0.6382728_sp) if (atanh(-0.6382728_sp) - (0.755253792_sp) > 1e-5) error stop print *, atanh(c) if (atanh(c) - (0.27894383144663687_dp) > 1e-12) error stop print *, atanh(0.271927291_dp) if (atanh(0.271927291_dp) - (0.27894383144663687_dp) > 1e-12) error stop print *, atanh(d) if (atanh(d) - (0.755253792_sp) > 1e-5) error stop print *, atanh(0.6382728_sp) if (atanh(0.6382728_sp) - (0.755253792_sp) > 1e-5) error stop end programlfortran-0.63.0/integration_tests/namelist_03.f900000664000175000017500000000362515174404631022031 0ustar alastairalastairprogram namelist_test_03 implicit none ! Define variables integer :: i1, i2 real :: r1, r2 logical :: l1, l2 character(len=10) :: c1, c2 integer :: arr1(3) real :: arr2(2) ! Define namelist namelist /testdata/ i1, i2, r1, r2, l1, l2, c1, c2, arr1, arr2 ! Initialize variables i1 = 42 i2 = -17 r1 = 3.14159 r2 = -2.71828 l1 = .true. l2 = .false. c1 = 'hello' c2 = 'world' arr1(1) = 1 arr1(2) = 2 arr1(3) = 3 arr2(1) = 1.5 arr2(2) = 2.5 ! Write namelist to file open(unit=10, file='namelist_test.dat', status='replace', form='formatted') write(10, nml=testdata) close(10) ! Reset variables to different values i1 = 0 i2 = 0 r1 = 0.0 r2 = 0.0 l1 = .false. l2 = .true. c1 = 'xxxxx' c2 = 'yyyyy' arr1(1) = 0 arr1(2) = 0 arr1(3) = 0 arr2(1) = 0.0 arr2(2) = 0.0 ! Read namelist from file open(unit=10, file='namelist_test.dat', status='old', form='formatted') read(10, nml=testdata) close(10) ! Verify values if (i1 /= 42) error stop "Read i1 mismatch" if (i2 /= -17) error stop "Read i2 mismatch" if (abs(r1 - 3.14159) > 1.0e-5) error stop "Read r1 mismatch" if (abs(r2 - (-2.71828)) > 1.0e-5) error stop "Read r2 mismatch" if (.not. l1) error stop "Read l1 mismatch" if (l2) error stop "Read l2 mismatch" if (trim(c1) /= 'hello') error stop "Read c1 mismatch" if (trim(c2) /= 'world') error stop "Read c2 mismatch" if (arr1(1) /= 1) error stop "Read arr1(1) mismatch" if (arr1(2) /= 2) error stop "Read arr1(2) mismatch" if (arr1(3) /= 3) error stop "Read arr1(3) mismatch" if (abs(arr2(1) - 1.5) > 1.0e-5) error stop "Read arr2(1) mismatch" if (abs(arr2(2) - 2.5) > 1.0e-5) error stop "Read arr2(2) mismatch" print *, "" print *, "All namelist tests passed!" end program namelist_test_03 lfortran-0.63.0/integration_tests/file_05.f900000664000175000017500000000130615174404631021130 0ustar alastairalastairprogram file_05 implicit none integer :: u = 11, i, j integer :: arr(2, 3) integer, allocatable :: alloc_arr(:, :) open(u, file="file_05_data.dat", form="unformatted", access="stream", status="old") read(u) arr close(u) do i = 1, 2 do j = 1, 3 print *, arr(i, j) end do end do print *, sum(arr) if (sum(arr) /= 8) error stop open(u, file="file_05_data.dat", form="unformatted", access="stream", status="old") allocate(alloc_arr(2, 3)) read(u) alloc_arr close(u) do i = 1, 2 do j = 1, 3 print *, alloc_arr(i, j) end do end do if (sum(alloc_arr) /= 8) error stop end program lfortran-0.63.0/integration_tests/intrinsics_272.f900000664000175000017500000000212115174404631022460 0ustar alastairalastairprogram intrinsics_272 implicit none integer(4), parameter :: i1 = trailz(1050) integer(8), parameter :: i2 = trailz(000) integer, parameter :: ar1(3) = trailz([0000821095, 829012001, 039024800]) integer(4) :: i3 = 283200001 integer(8) :: i4 = 289000001 integer(4) :: arr1(3) = [02471095, 820012001, 039024800] integer(8) :: arr2(3) = [13471095, 8290000, 0392414800] print *, i1 if (i1 /= 1) error stop print *, i2 if (i2 /= 32) error stop print *, ar1 if (any(ar1 /= [0, 0, 5])) error stop print *, trailz(i3) if (trailz(i3) /= 0) error stop print *, trailz(i4) if (trailz(i4) /= 0) error stop print *, trailz(arr1) ! if (any(trailz(arr1) /= [0, 0, 5])) error stop ! Does not work #4363 print *, trailz(arr2) ! if (any(trailz(arr2) /= [0, 4, 4])) error stop print *, kind(trailz(0)) if (kind(trailz(0)) /= 4) error stop print *, kind(trailz(0_4)) if (kind(trailz(0_4)) /= 4) error stop print *, kind(trailz(0_8)) ! if (kind(trailz(0_8)) /= 4) error stop ! Gives wrong output end program lfortran-0.63.0/integration_tests/array_01_pack.f900000664000175000017500000000030615174404631022320 0ustar alastairalastairprogram array_01_pack integer :: m(6), p(2) integer :: s(1) m = [ 1, 0, 0, 0, 5, 0 ] p = pack(m, m /= 0) s = shape(pack(m, m /= 0)) print *, s(1) if (s(1) /= 2) error stop end program lfortran-0.63.0/integration_tests/modules_29_module1.f900000664000175000017500000000074115174404631023317 0ustar alastairalastairmodule fpm_git1 implicit none type :: git_target_t character(len=:), allocatable :: url character(len=:), allocatable :: object end type git_target_t contains function git_target_branch(url, branch) result(self) character(len=*), intent(in) :: url character(len=*), intent(in) :: branch type(git_target_t) :: self self%url = url self%object = branch end function git_target_branch end module fpm_git1 lfortran-0.63.0/integration_tests/pointer_04.f900000664000175000017500000000062215174404631021670 0ustar alastairalastairprogram pointer_04 implicit none type :: base integer :: v end type class(base), allocatable :: x class(base), pointer :: y type(base), target :: t t%v = 42 y => t allocate(x, source=y) if (.not. allocated(x)) error stop if (x%v /= 42) error stop t%v = 100 if (y%v /= 100) error stop if (x%v /= 42) error stop end program pointer_04 lfortran-0.63.0/integration_tests/intrinsics_205.f900000664000175000017500000001143115174404631022460 0ustar alastairalastairprogram intrinsics_205 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(sp) :: x,y,z real(dp) :: k,l,m real(dp) :: w(19) real(dp) :: res_w(19) real(dp) :: expected_w(19) real(sp) :: expected_u(19) real(dp), parameter :: res(19) = acosd([0.321_dp, 0.526_dp, 0.728_dp, -0.321_dp, -0.526_dp, -0.728_dp, & -1.0_dp, -0.9995004995004995_dp, -0.999000999000999_dp, & -0.9985014985014985_dp, -0.998001998001998_dp, -0.9975024975024975_dp, & -0.997002997002997_dp, -0.9965034965034965_dp, -0.996003996003996_dp, & -0.9955044955044955_dp, -0.995004995004995_dp, -0.9945054945054945_dp, & -0.994005994005994_dp]) real(sp), parameter :: res_1(19) = acosd([0.321_sp, 0.526_sp, 0.728_sp, -0.321_sp, -0.526_sp, -0.728_sp, & -1.0_sp, -0.9995004_sp, -0.999000_sp, & -0.998501_sp, -0.998001_sp, -0.997_sp, & -0.997002_sp, -0.99650_sp, -0.99600_sp, & -0.9955_sp, -0.99500_sp, -0.99450_sp, & -0.99400_sp]) w = [0.321_dp, 0.526_dp, 0.728_dp, -0.321_dp, -0.526_dp, -0.728_dp, & -1.0_dp, -0.9995004995004995_dp, -0.999000999000999_dp, & -0.9985014985014985_dp, -0.998001998001998_dp, -0.9975024975024975_dp, & -0.997002997002997_dp, -0.9965034965034965_dp, -0.996003996003996_dp, & -0.9955044955044955_dp, -0.995004995004995_dp, -0.9945054945054945_dp, & -0.994005994005994_dp] expected_w = [71.276588577307763_dp, 58.264412814183842_dp, 43.281012002417114_dp, & 108.72341142269225_dp, 121.73558718581616_dp, 136.718987997582900_dp, & 180.0_dp, 178.18897822198568_dp, 177.43872179938884_dp, & 176.86295702294953_dp, 176.377503905344_dp, 175.94975751498464_dp, & 175.5629967823349_dp, 175.20728904760477_dp, 174.87616290603896_dp, & 174.5651234927047_dp, 174.27089826020691_dp, 173.99101680223387_dp, & 173.72355993833804_dp] expected_u = [71.2765884_sp, 58.2644081_sp, 43.2810135_sp, & 108.723404_sp, 121.735596_sp, 1.36718994e+02_sp, & 180.0_sp, 178.188782_sp, 177.437454_sp, & 1.76862442e+02_sp, 176.376556_sp, 175.560760_sp, & 175.562256_sp, 175.204895_sp, 174.873581_sp, & 174.562424_sp, 174.268036_sp, 173.987991_sp, & 173.720413_sp] res_w = acosd(w) do i = 1, size(res) print *, res(i) if (abs(res(i) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(w) print *, res_w(i) if (abs(res_w(i) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(res_1) print *, res_1(i) if (abs(res_1(i) - expected_u(i)) > 1e-4_sp) error stop end do x = 0.123 y = 0.876 z = 0.542 k = 0.1237382_dp l = 0.8767382_dp m = 0.5427382_dp print *, acosd(x) if (acosd(x) - 8.29347229e+01 > 1e-5) error stop print *, acosd(y) if (acosd(y) - 2.88364525e+01 > 1e-5) error stop print *, acosd(z) if (acosd(z) - 5.71801071e+01 > 1e-5) error stop print *, acosd(0.123_sp) if (acosd(0.123_sp) - 8.29347229e+01 > 1e-5) error stop print *, acosd(0.876_sp) if (acosd(0.876_sp) - 2.88364525e+01 > 1e-5) error stop print *, acosd(0.542_sp) if (acosd(0.542_sp) - 5.71801071e+01 > 1e-5) error stop print *, acosd(k) if (acosd(k) - 8.29347229e+01 > 1e-12) error stop print *, acosd(l) if (acosd(l) - 2.88364525e+01 > 1e-12) error stop print *, acosd(m) if (acosd(m) - 5.71801071e+01 > 1e-12) error stop print *, acosd(0.1237382_dp) if (acosd(0.1237382_dp) - 8.29347229e+01 > 1e-12) error stop print *, acosd(0.8767382_dp) if (acosd(0.8767382_dp) - 2.88364525e+01 > 1e-12) error stop print *, acosd(0.5427382_dp) if (acosd(0.5427382_dp) - 5.71801071e+01 > 1e-12) error stop x = -0.123 y = -0.876 z = -0.542 k = -0.1237382_dp l = -0.8767382_dp m = -0.5427382_dp print *, acosd(x) if (acosd(x) - 9.70652695e+01 > 1e-5) error stop print *, acosd(y) if (acosd(y) - 1.51163544e+02 > 1e-5) error stop print *, acosd(z) if (acosd(z) - 1.22819893e+02 > 1e-5) error stop print *, acosd(-0.123_sp) if (acosd(-0.123_sp) - 9.70652695e+01 > 1e-5) error stop print *, acosd(-0.876_sp) if (acosd(-0.876_sp) - 1.51163544e+02 > 1e-5) error stop print *, acosd(-0.542_sp) if (acosd(-0.542_sp) - 1.22819893e+02 > 1e-5) error stop print *, acosd(k) if (acosd(k) - 9.71078942667026581e+01_dp > 1e-12) error stop print *, acosd(l) if (acosd(l) - 1.51251363283139312e+02_dp > 1e-12) error stop print *, acosd(m) if (acosd(m) - 1.22870235241297351e+02_dp > 1e-12) error stop end program lfortran-0.63.0/integration_tests/allocate_12.f900000664000175000017500000000153715174404631022001 0ustar alastairalastairmodule A implicit none type D integer :: member end type type E type(D), allocatable :: ds(:) end type type F type(E), allocatable :: es(:) end type contains function get_ds() result(ds) type(D), allocatable :: ds(:) ds = [D(1), D(2), D(3)] end function subroutine new_ds(self) type(F), intent(inout) :: self if( .not. allocated(self%es) ) error stop self%es(2)%ds = get_ds() end subroutine end module program allocate_12 use A implicit none type(F) :: fobj(2) allocate(fobj(2)%es(3)) if(.not. allocated(fobj(2)%es)) error stop if( allocated(fobj(1)%es) ) error stop call new_ds(fobj(2)) print *, fobj(2)%es(2)%ds if( fobj(2)%es(2)%ds(1)%member /= 1 ) error stop if( fobj(2)%es(2)%ds(2)%member /= 2 ) error stop if( fobj(2)%es(2)%ds(3)%member /= 3 ) error stop if( any(fobj(2)%es(2)%ds(:)%member /= (/1, 2, 3/)) ) error stop end program lfortran-0.63.0/integration_tests/generic_name_04.f900000664000175000017500000000536615174404631022636 0ustar alastairalastair! Test: generic procedure with keyword arg resolves to correct overload ! when an earlier overload has a required argument that is not supplied. ! Regression test for: ICE AssertFailed: f != nullptr in argument_types_match ! when a required arg is nullptr (not provided) for a non-matching overload. ! ! Part 1 (foo): required Variable_t arg is nullptr → must return false. ! Part 2 (bar): required Function_t (procedure dummy via interface block) ! arg is nullptr → must return false (not crash in expr_type). module generic_name_04_mod implicit none interface foo ! First overload: center is REQUIRED, mask is optional. ! A call that omits center should skip this overload. module procedure foo_center ! Second overload: center is optional, mask(:) is REQUIRED. ! A call foo(y, mask=m) should resolve to this. module procedure foo_mask end interface interface bar ! First overload: op is a REQUIRED procedure dummy (Function_t in ASR). ! A call that omits op should skip this overload. module procedure bar_with_op ! Second overload: op is an optional real (Variable_t in ASR). ! A call bar(x, n=3) should resolve to this. module procedure bar_simple end interface contains real function foo_center(x, center, mask) result(res) real, intent(in) :: x(:) real, intent(in) :: center logical, intent(in), optional :: mask res = sum(x) + center end function real function foo_mask(x, center, mask) result(res) real, intent(in) :: x(:) real, intent(in), optional :: center logical, intent(in) :: mask(:) res = sum(x, mask=mask) end function real function bar_with_op(x, op, n) real, intent(in) :: x interface real function op(y) real, intent(in) :: y end function end interface integer, intent(in) :: n bar_with_op = op(x) * n end function real function bar_simple(x, op, n) real, intent(in) :: x real, intent(in), optional :: op integer, intent(in) :: n if (present(op)) then bar_simple = x * op * n else bar_simple = x * n end if end function end module program generic_name_04 use generic_name_04_mod implicit none real :: y(6) = [1., 2., 3., 4., 5., 6.] logical :: m(6) real :: r ! Part 1: Variable_t nullptr path m = y > 3. ! Should resolve to foo_mask: sum of elements > 3 = 4+5+6 = 15 r = foo(y, mask=m) print *, r if (abs(r - 15.0) > 1e-5) error stop ! Part 2: Function_t nullptr path ! Call bar(2.0, n=3) — 'op' not provided. ! Overload 1 (bar_with_op): op is Function_t, required → must skip. ! Overload 2 (bar_simple): op is optional real → matches. Result = 2.0 * 3 = 6.0. r = bar(2.0, n=3) print *, r if (abs(r - 6.0) > 1e-5) error stop end program lfortran-0.63.0/integration_tests/save_04.f900000664000175000017500000000047215174404631021151 0ustar alastairalastairsubroutine sub(a, b, i) real(8) :: a, b real(8), save :: c integer :: i if (i == 1) then print *, c if (abs(c-2.4D0) > 1.0D-12) error stop return end if c = a - b end subroutine program save_04 call sub(3.4D0, 1.0D0, 0) call sub(3.4D0, 1.0D0, 1) end programlfortran-0.63.0/integration_tests/class_69.f900000664000175000017500000000121615174404631021330 0ustar alastairalastairmodule class_69_mod implicit none type :: fpm_cmd_settings integer :: verbosity end type type, extends(fpm_cmd_settings) :: fpm_new_settings integer :: version end type fpm_new_settings end module class_69_mod program class_69 use class_69_mod implicit none class(fpm_cmd_settings), allocatable :: cmd_settings allocate(fpm_new_settings :: cmd_settings) cmd_settings%verbosity = 12 select type(settings => cmd_settings) type is (fpm_new_settings) if (settings%verbosity /= 12) error stop class default error stop end select end program class_69lfortran-0.63.0/integration_tests/arrays_elemental_15.f900000664000175000017500000000513515174404631023545 0ustar alastairalastairprogram arrays_elemental_15 call elemental_sin() call elemental_cos() call elemental_trig_identity() contains subroutine verify1d(array, result, size) real(8), intent(in) :: array(:), result(:) integer, intent(in) :: size integer :: i real(8) :: eps eps = 1e-12 do i = 1, size if (abs(sin(sin(array(i))) - result(i)) > eps) error stop end do end subroutine subroutine verifynd(array, result, size1, size2, size3) real(8), intent(in) :: array(:, :, :), result(:, :, :) integer, intent(in) :: size1, size2, size3 integer :: i, j, k real(8) :: eps eps = 1e-12 do i = 1, size1 do j = 1, size2 do k = 1, size3 if (abs(sin(array(i, j, k))**2 - result(i, j, k)) > eps) error stop end do end do end do end subroutine subroutine verify2d(array, result, size1, size2) real(8), intent(in) :: array(:, :), result(:, :) integer, intent(in) :: size1, size2 integer :: i, j real(8) :: eps eps = 1e-12 do i = 1, size1 do j = 1, size2 if (abs(cos(array(i, j))**2 - result(i, j)) > eps) error stop end do end do end subroutine subroutine elemental_sin() integer :: i, j, k real(8) :: array1d(256), sin1d(256) real(8) :: arraynd(256, 64, 16), sinnd(256, 64, 16) do i = 1, 256 array1d(i) = i end do sin1d = sin(sin(array1d)) call verify1d(array1d, sin1d, 256) do i = 1, 256 do j = 1, 64 do k = 1, 16 arraynd(i, j, k) = i + j + k end do end do end do sinnd = sin(arraynd)**2 call verifynd(arraynd, sinnd, 256, 64, 16) end subroutine subroutine elemental_cos() integer :: i, j real(8) :: array2d(256, 64), cos2d(256, 64) do i = 1, 256 do j = 1, 64 array2d(i, j) = i + j end do end do cos2d = cos(array2d)**2 call verify2d(array2d, cos2d, 256, 64) end subroutine subroutine elemental_trig_identity() integer :: i, j, k, l real(8) :: eps real(8) :: arraynd(64, 32, 8, 4), observed(64, 32, 8, 4), observed1d(65536) integer :: newshape(1) eps = 1e-12 do i = 1, 64 do j = 1, 32 do k = 1, 8 do l = 1, 4 arraynd(i, j, k, l) = i + j + k + l end do end do end do end do observed = sin(arraynd)**2 + cos(arraynd)**2 newshape(1) = 65536 observed1d = reshape(observed, newshape) do i = 1, 65536 if( abs(observed1d(i) - 1.0) > eps ) error stop end do end subroutine end program lfortran-0.63.0/integration_tests/string_34.f900000664000175000017500000000037015174404631021521 0ustar alastairalastairprogram string_34 implicit none character(len=20) :: a a = "hi hello" print *, a(int(1, 8):int(2, 8)) print *, a(1_8:2_8) if (a(1_8:2_8) /= "hi") error stop if (a(int(1, 8):int(2, 8)) /= "hi") error stop end program lfortran-0.63.0/integration_tests/character_22.f900000664000175000017500000000102415174404631022141 0ustar alastairalastairprogram character_22 implicit none character(*), parameter :: str = 'This is a string' integer :: sig sig = sum_string(str) print *, sig if (sig /= 1484) error stop contains function sum_string(str) result(sig) character(len=*), intent(in) :: str integer :: sig character, dimension(len(str)) :: tmp integer :: i do i = 1, len(str) tmp(i) = str(i:i) end do sig = sum(ichar(tmp)) end function sum_string end program character_22 lfortran-0.63.0/integration_tests/read_67.f900000664000175000017500000000413015174404631021132 0ustar alastairalastairprogram read_67 implicit none character(100) :: input ! integer kinds integer(1) :: i8_1, i8_2 integer(2) :: i16_1, i16_2 integer(4) :: i32_1, i32_2 integer(8) :: i64_1, i64_2 ! real kinds real(4) :: r32_1, r32_2 real(8) :: r64_1, r64_2 ! string character(10) :: s1, s2 ! ================================ ! 1. INTEGER EMPTY FIELD ! ================================ input = "10,,20" i8_1 = -1; i8_2 = -1 read(input, *) i8_1, i8_2 if (i8_1 /= 10) error stop "i8 first wrong" if (i8_2 /= -1) error stop "i8 empty not preserved" i16_1 = -1; i16_2 = -1 read(input, *) i16_1, i16_2 if (i16_1 /= 10) error stop "i16 first wrong" if (i16_2 /= -1) error stop "i16 empty not preserved" i32_1 = -1; i32_2 = -1 read(input, *) i32_1, i32_2 if (i32_1 /= 10) error stop "i32 first wrong" if (i32_2 /= -1) error stop "i32 empty not preserved" i64_1 = -1; i64_2 = -1 read(input, *) i64_1, i64_2 if (i64_1 /= 10) error stop "i64 first wrong" if (i64_2 /= -1) error stop "i64 empty not preserved" ! ================================ ! 2. FLOAT EMPTY FIELD ! ================================ input = "1.5,,2.5" r32_1 = -1.0; r32_2 = -1.0 read(input, *) r32_1, r32_2 if (abs(r32_1 - 1.5) > 1e-6) error stop "f32 first wrong" if (r32_2 /= -1.0) error stop "f32 empty not preserved" r64_1 = -1.0d0; r64_2 = -1.0d0 read(input, *) r64_1, r64_2 if (abs(r64_1 - 1.5d0) > 1d-12) error stop "f64 first wrong" if (r64_2 /= -1.0d0) error stop "f64 empty not preserved" ! ================================ ! 3. STRING EMPTY FIELD ! ================================ input = "hello,,world" s1 = "INIT"; s2 = "INIT" read(input, *) s1, s2 if (trim(s1) /= "hello") error stop "string first wrong" if (trim(s2) /= "INIT") error stop "string empty not preserved" ! ================================ ! 4. MULTIPLE EMPTY FIELDS ! ================================ input = "7,,,8" i32_1 = -1; i32_2 = -1 read(input, *) i32_1, i32_2 if (i32_1 /= 7) error stop "multi first wrong" if (i32_2 /= -1) error stop "multi empty not preserved" ! ================================ ! SUCCESS ! ================================ print *, "All tests passed" end program read_67lfortran-0.63.0/integration_tests/class_140.f900000664000175000017500000000071715174404631021403 0ustar alastairalastairprogram class_140 ! Test associated() with two class(*) pointer array arguments implicit none class(*), pointer :: p1(:), p2(:), p3(:) class(*), allocatable, target :: data1(:), data2(:) allocate(data1, source=[1.0, 2.0]) allocate(data2, source=[3.0, 4.0]) p1 => data1 p2 => data1 ! Both point to same target if (.not. associated(p1, p2)) error stop ! p3 points to a different target p3 => data2 if (associated(p1, p3)) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/array_08_transfer.f900000664000175000017500000000160115174404631023234 0ustar alastairalastairprogram array_08_transfer implicit none character(kind=1), dimension(5) :: chr_arr1 character(kind=1, len=2), dimension(5) :: chr_arr2 character(len=*), parameter :: rhs = "xyzw" character(kind=1), dimension(4) :: chr_arr3 !Check indexed assignment chr_arr1(2:5) = transfer(rhs, chr_arr1) print *, chr_arr1 print *, rhs if (chr_arr1(2) /= 'x' .or. chr_arr1(3) /= 'y' .or. & chr_arr1(4) /= 'z' .or. chr_arr1(5) /= 'w') error stop !Check multi-length assignment chr_arr2(1:2) = transfer(rhs, chr_arr2) print *, chr_arr2(1:2) print *, rhs if (chr_arr2(1) /= 'xy' .or. chr_arr2(2) /= 'zw') error stop !Check assignment to entire array chr_arr3 = transfer(rhs, chr_arr3) print *, chr_arr3 print *, rhs if (chr_arr3(1) /= 'x' .or. chr_arr3(2) /= 'y' .or. & chr_arr3(3) /= 'z' .or. chr_arr3(4) /= 'w') error stop end program array_08_transferlfortran-0.63.0/integration_tests/string_79.f900000664000175000017500000000133515174404631021534 0ustar alastairalastair! Testing declaration in function module string_79_mod contains pure function foo (x) result(res) character(*), intent(in) :: x character(:), allocatable :: res allocate(character(len(x) + len("abc")):: res) res = x // 'abc' end function pure function ff(line,length) result(strout) character(len=*) , intent(in) :: line integer , intent(in) :: length character(len=max(length, len(foo(line)))) :: strout ! The main concern of this test -- Is to handle this declaration correctly end function end module program string_79 use string_79_mod print *, len(ff("HelloWorld", 10)) if(len(ff("HelloWorld", 10)) /= 13) error stop end program lfortran-0.63.0/integration_tests/logical_kind_02.f900000664000175000017500000000236515174404631022633 0ustar alastairalastairprogram logical_kind_02 use iso_fortran_env, only: int8, int16, int32, int64 implicit none logical(int8) :: v1 logical(int16) :: v2 logical(int32) :: v4 logical(int64) :: v8 integer(int8) :: b1(1), b2(2), b4(4), b8(8) integer :: i ! Test .true. - all bytes beyond the first should be zero v1 = .true. v2 = .true. v4 = .true. v8 = .true. b1 = transfer(v1, b1) if (b1(1) /= 1) error stop b2 = transfer(v2, b2) if (b2(1) /= 1) error stop if (b2(2) /= 0) error stop b4 = transfer(v4, b4) if (b4(1) /= 1) error stop do i = 2, 4 if (b4(i) /= 0) error stop end do b8 = transfer(v8, b8) if (b8(1) /= 1) error stop do i = 2, 8 if (b8(i) /= 0) error stop end do ! Test .false. - all bytes should be zero v1 = .false. v2 = .false. v4 = .false. v8 = .false. b1 = transfer(v1, b1) if (b1(1) /= 0) error stop b2 = transfer(v2, b2) do i = 1, 2 if (b2(i) /= 0) error stop end do b4 = transfer(v4, b4) do i = 1, 4 if (b4(i) /= 0) error stop end do b8 = transfer(v8, b8) do i = 1, 8 if (b8(i) /= 0) error stop end do print *, "All tests passed." end program lfortran-0.63.0/integration_tests/optional_11.f900000664000175000017500000000234515174404631022037 0ustar alastairalastairprogram optional_11 implicit none integer :: r ! Test 1: absent optional forwarded through a block call outer(r=r) if (r /= 0) error stop "Test 1 failed: present(x) should be false" ! Test 2: present optional forwarded through a block call outer(42, r) if (r /= 1) error stop "Test 2 failed: present(x) should be true" ! Test 3: absent optional forwarded through nested blocks call outer_nested(r=r) if (r /= 0) error stop "Test 3 failed: present(x) should be false (nested)" ! Test 4: present optional forwarded through nested blocks call outer_nested(7, r) if (r /= 1) error stop "Test 4 failed: present(x) should be true (nested)" print *, "All tests passed" contains subroutine inner(x, r) integer, intent(in), optional :: x integer, intent(out) :: r if (present(x)) then r = 1 else r = 0 end if end subroutine subroutine outer(x, r) integer, intent(in), optional :: x integer, intent(out) :: r block call inner(x, r) end block end subroutine subroutine outer_nested(x, r) integer, intent(in), optional :: x integer, intent(out) :: r block block call inner(x, r) end block end block end subroutine end program lfortran-0.63.0/integration_tests/intrinsics_12.f900000664000175000017500000000031615174404631022374 0ustar alastairalastairprogram intrinsics_12 print*,kind(5) ! 4 print*,kind(5_4) ! 4 print*,kind(5_8) ! 8 print*,kind(0.d0) ! 8 print*,kind(0.0) ! 4 print*,kind(5._4) ! 4 print*,kind(5._8) ! 8 print*,kind(.true.) ! 4 end program lfortran-0.63.0/integration_tests/sum_03.f900000664000175000017500000000117615174404631021020 0ustar alastairalastairprogram sum_03 use iso_fortran_env, only: sp => real32 complex(sp), parameter :: x_sum_mask(3) = [(1.0_sp, 0.0_sp), (-2.0_sp, 0.0_sp), (3.0_sp, 0.0_sp)] logical :: sum_mask(3) logical, parameter :: sum_mask_2(3) = [.true., .false., .true.] complex(sp) :: sum_masked_res, sum_masked_res_2 sum_mask = [.true., .false., .true.] sum_masked_res = sum(x_sum_mask, sum_mask) sum_masked_res_2 = sum(x_sum_mask, sum_mask_2) if (abs(sum_masked_res - cmplx(4.0_sp, 0.0_sp, kind=sp)) > 1.0e-5_sp) error stop if (abs(sum_masked_res_2 - cmplx(4.0_sp, 0.0_sp, kind=sp)) > 1.0e-5_sp) error stop end program sum_03lfortran-0.63.0/integration_tests/lapack_07.f900000664000175000017500000000061715174404631021452 0ustar alastairalastair! MRE from sblat1.f: down_cast assert with EQUIVALENCE + multi-value DATA ! EQUIVALENCE aliases array Y to part of X, then DATA initializes Y ! with multiple values. This triggers LCOMPILERS_ASSERT in down_cast. program lapack_07 real :: x(4), y(2) equivalence (x(1), y(1)) data y/1.0, 2.0/ if (x(1) /= 1.0) error stop if (x(2) /= 2.0) error stop print *, 'PASS' end program lfortran-0.63.0/integration_tests/cond_06.f900000664000175000017500000000102415174404631021132 0ustar alastairalastair! Test integer comparisons with mixed kinds program cond_06 implicit none integer(4) :: i4 integer(8) :: i8 integer :: count i4 = 5 i8 = 5 count = 0 if (i8 == i4) count = count + 1 if (i4 == i8) count = count + 1 if (i8 == 5) count = count + 1 if (i8 /= 10) count = count + 1 i8 = 10 i4 = 5 if (i8 > i4) count = count + 1 if (i4 < i8) count = count + 1 if (i8 >= i4) count = count + 1 if (i4 <= i8) count = count + 1 if (count /= 8) error stop end program lfortran-0.63.0/integration_tests/intrinsics_30.f900000664000175000017500000000326215174404631022377 0ustar alastairalastairprogram intrinsics_30 use iso_fortran_env, only : int8, int16 implicit none integer, parameter :: a1 = range(11) integer, parameter :: a2 = range(22.90) integer, parameter :: a3 = range((1,2)) integer(4) :: i1 integer(8) :: i2 integer(int8) :: i3 integer(int16) :: i4 real(4) :: r1 real(8) :: r2 complex(4) :: c1 complex(8) :: c2 integer, parameter :: ri3 = range(i3) integer, parameter :: ri4 = range(i4) integer, parameter :: ar1 = range([1, 21, 13]) integer, parameter :: ar2 = range([1.0, 21.0, 13.0]) integer, parameter :: ar3 = range([(1, 2), (31, 4), (51, 62)]) integer :: arr1(3) = [1, 21, 13] real(8) :: arr2(3) = [1.0, 21.0, 13.0] complex :: arr3(3) = [(1, 2), (31, 4), (51, 62)] print *, a1 if (a1 /= 9) error stop print *, a2 if (a2 /= 37) error stop print *, a3 if (a3 /= 37) error stop print *, ar1 if (ar1 /= 9) error stop print *, ar2 if (ar2 /= 37) error stop print *, ar3 if (ar3 /= 37) error stop print *, range(ri3) if (ri3 /= 2) error stop print *, range(ri4) if (ri4 /= 4) error stop print *, range(i1) if (range(i1) /= 9) error stop print *, range(i2) if (range(i2) /= 18) error stop print *, range(r1) if (range(r1) /= 37) error stop print *, range(r2) if (range(r2) /= 307) error stop print *, range(c1) if (range(c1) /= 37) error stop print *, range(c2) if (range(c2) /= 307) error stop print *, range(arr1) if (range(arr1) /= 9) error stop print *, range(arr2) if (range(arr2) /= 307) error stop print *, range(arr3) if (range(arr3) /= 37) error stop end program lfortran-0.63.0/integration_tests/class_38.f900000664000175000017500000000111315174404631021320 0ustar alastairalastairprogram class_38 type :: regex_token character(len=:), allocatable :: ccl end type regex_token type :: regex_pattern type(regex_token), dimension(2) :: pattern end type regex_pattern type(regex_pattern) :: my_pattern call temp(my_pattern%pattern) if (my_pattern%pattern(1)%ccl /= 'abc' .or. my_pattern%pattern(2)%ccl /= 'def') error stop contains subroutine temp(pattern) type(regex_token), dimension(:), intent(out) :: pattern pattern(1)%ccl = 'abc' pattern(2)%ccl = 'def' end subroutine temp end program lfortran-0.63.0/integration_tests/common_08.f900000664000175000017500000000017615174404631021510 0ustar alastairalastairsubroutine prja() integer iownd, iowns common /ls0001/ iownd(14), iowns(6) end program common_08 call prja() end program lfortran-0.63.0/integration_tests/array_06_transfer.f900000664000175000017500000000110015174404631023224 0ustar alastairalastairmodule mod_array_06_transfer implicit none integer, allocatable :: val(:) contains subroutine sub( value ) character(*), intent(in) :: value allocate(val(len(value))) ! --realloc-lhs is not able to allocate val and so, adding explicit allocation val = transfer(value, val, 1 * len(value)) end subroutine sub end module program array_06_transfer use mod_array_06_transfer character(4) :: value = "1234" call sub(value) print *, val ! Currently, output of transfer using String is not matching with gfortran end program lfortran-0.63.0/integration_tests/array_op_05.f900000664000175000017500000000035315174404631022026 0ustar alastairalastairprogram array_op_05 implicit none integer, allocatable :: i(:, :) logical :: result allocate(i(3, 2)) result = all(shape(i) == [3, 2]) print *, result if ( .not.result ) error stop end program array_op_05 lfortran-0.63.0/integration_tests/allocate_32.f900000664000175000017500000000202315174404631021772 0ustar alastairalastairprogram allocate_32 implicit none type :: item_t character(len=:), allocatable :: name integer :: value end type item_t type(item_t), allocatable :: items(:) integer :: i allocate(items(3)) do i = 1, 3 allocate(character(len=10) :: items(i)%name) items(i)%name = "item" // char(48 + i) items(i)%value = i * 10 end do print *, "Before: size =", size(items) do i = 1, size(items) print *, " items(", i, ")%name =", trim(items(i)%name), & ", value =", items(i)%value end do items = items(2:3) print *, "After: size =", size(items) do i = 1, size(items) print *, " items(", i, ")%name =", trim(items(i)%name), & ", value =", items(i)%value end do if (size(items) /= 2) error stop "Expected size 2" if (items(1)%value /= 20) error stop "Expected items(1)%value = 20" if (items(2)%value /= 30) error stop "Expected items(2)%value = 30" print *, "PASS" end program allocate_32 lfortran-0.63.0/integration_tests/read_17.f900000664000175000017500000000123515174404631021130 0ustar alastairalastairprogram read_17 ! Test combined END= and ERR= labels implicit none integer :: x, u, count open(newunit=u, status='scratch') write(u, '(I5)') 42 write(u, '(I5)') 99 rewind(u) count = 0 10 continue read(u, *, end=30, err=20) x count = count + 1 if (count == 1 .and. x /= 42) error stop "First value should be 42" if (count == 2 .and. x /= 99) error stop "Second value should be 99" goto 10 20 continue error stop "Should not reach ERR label with valid data" 30 continue close(u) if (count /= 2) error stop "Should have read 2 values" print *, "PASS: combined END=/ERR= works" end program read_17 lfortran-0.63.0/integration_tests/complex_33.f900000664000175000017500000000173015174404631021662 0ustar alastairalastairprogram complex_33 implicit none complex, allocatable :: z(:) complex :: w(3) real :: re_vals(3), im_vals(3) real :: zero = 0.0 integer :: i character(len=9) :: buf allocate(z(3)) z = cmplx(1.0/zero, 1.0/zero) do i = 1, 3 write(buf, "(F9.0)") z(i)%im if (adjustl(buf) /= "Infinity") error stop end do w = (1.0, 2.0) re_vals = w%re im_vals = w%im do i = 1, 3 if (abs(re_vals(i) - 1.0) > 1e-6) error stop if (abs(im_vals(i) - 2.0) > 1e-6) error stop end do z(1) = cmplx(1.0, 4.0) z(2) = cmplx(2.0, 5.0) z(3) = cmplx(3.0, 6.0) re_vals = z%re im_vals = z%im do i = 1, 3 if (abs(re_vals(i) - real(i)) > 1e-6) error stop if (abs(im_vals(i) - real(i + 3)) > 1e-6) error stop end do do i = 1, 3 if (abs(z(i)%re - real(i)) > 1e-6) error stop if (abs(z(i)%im - real(i + 3)) > 1e-6) error stop end do end program complex_33 lfortran-0.63.0/integration_tests/intrinsics_435.f900000664000175000017500000000203315174404631022463 0ustar alastairalastairprogram intrinsics_435 implicit none integer :: input(2, 2), res(2) logical :: mask(2, 2) input = reshape([11, 2, 3, 4], [2, 2]) mask = reshape([.true., .false., .false., .false.], [2, 2]) res = minloc(input, 1, mask) print *, res if (res(1) /= 1) error stop if (res(2) /= 0) error stop res = maxloc(input, 1, mask) print *, res if (res(1) /= 1) error stop if (res(2) /= 0) error stop mask = reshape([.true., .true., .false., .false.], [2, 2]) res = minloc(input, 1, mask) print *, res if (res(1) /= 2) error stop if (res(2) /= 0) error stop res = maxloc(input, 1, mask) print *, res if (res(1) /= 1) error stop if (res(2) /= 0) error stop mask = reshape([.true., .true., .true., .true.], [2, 2]) res = minloc(input, 1, mask) print *, res if (res(1) /= 2) error stop if (res(2) /= 1) error stop res = maxloc(input, 1, mask) print *, res if (res(1) /= 1) error stop if (res(2) /= 2) error stop end program intrinsics_435 lfortran-0.63.0/integration_tests/derived_type_member_procedure_call_02.f900000664000175000017500000000360315174404631027265 0ustar alastairalastairmodule derived_type_member_procedure_call_02_mod implicit none contains subroutine set_raster_line_style(style, line_style, line_pattern, pattern_size, pattern_length, pattern_distance) character(len=*), intent(in) :: style character(len=10), intent(out) :: line_style real, intent(out) :: line_pattern(:) integer, intent(out) :: pattern_size real, intent(out) :: pattern_length real, intent(out) :: pattern_distance line_style = style line_pattern = 0.0 pattern_size = size(line_pattern) pattern_length = 0.0 pattern_distance = 0.0 end subroutine set_raster_line_style end module derived_type_member_procedure_call_02_mod module derived_type_member_procedure_call_02_type use derived_type_member_procedure_call_02_mod, only: set_raster_line_style implicit none type :: raster_image_t character(len=10) :: line_style = '-' real :: line_pattern(20) integer :: pattern_size = 1 real :: pattern_length = 1.0 real :: pattern_distance = 0.0 contains procedure :: set_line_style => raster_set_line_style end type raster_image_t contains subroutine raster_set_line_style(this, style) class(raster_image_t), intent(inout) :: this character(len=*), intent(in) :: style call set_raster_line_style(style, this%line_style, this%line_pattern, & this%pattern_size, this%pattern_length, this%pattern_distance) end subroutine raster_set_line_style end module derived_type_member_procedure_call_02_type program derived_type_member_procedure_call_02 use derived_type_member_procedure_call_02_type, only: raster_image_t implicit none type(raster_image_t) :: img call img%set_line_style('--') write(*, '(I0)') img%pattern_size end program derived_type_member_procedure_call_02 lfortran-0.63.0/integration_tests/class_65.f900000664000175000017500000000203315174404631021322 0ustar alastairalastairmodule class_65_mod implicit none type :: base_t end type type, extends(base_t) :: extended_t integer :: key end type type :: temp_t type(extended_t) :: child(2) end type contains subroutine call_describe(obj, check) class(base_t), intent(in) :: obj integer, intent(inout) :: check class(base_t), allocatable :: obj_tmp allocate(obj_tmp) obj_tmp = obj select type (obj_tmp) type is (base_t) check = check + 3 type is (extended_t) check = check + 2 if (obj_tmp%key /= 10) error stop class default error stop end select end subroutine end module class_65_mod program class_65 use class_65_mod interface describe module procedure :: call_describe end interface type(temp_t) :: x type(base_t) :: y integer :: count count = 0 x%child(1) = extended_t(10) x%child(2) = extended_t(20) call describe(x%child(1), count) if (count /= 2) error stop call describe(y, count) if (count /= 5) error stop end program class_65lfortran-0.63.0/integration_tests/associate_39.f900000664000175000017500000000125115174404631022172 0ustar alastairalastair! Test: associate block with array slices in a loop does not leak memory ! when --realloc-lhs-arrays is enabled. program associate_39 implicit none real, allocatable :: w(:,:,:), b(:,:), dcdw(:,:,:), dcdb(:,:) integer :: l, batch allocate(w(3,3,3), b(3,3), dcdw(3,3,3), dcdb(3,3)) w = 0.; b = 0.; dcdb = 1. do batch = 1, 5000 dcdw = 0. associate(x => 1.5) do l = 1, 3 b(:,l) = b(:,l) - x*dcdb(:,l) dcdw(:,:,l) = dcdw(:,:,l)*1 w(:,:,l) = w(:,:,l) - x*dcdw(:,:,l) end do end associate end do if (abs(b(1,1) - (-7500.0)) > 1e-2) error stop if (abs(b(2,3) - (-7500.0)) > 1e-2) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/class_129.f900000664000175000017500000000070215174404631021404 0ustar alastairalastairmodule class_129_mod implicit none type :: any_vector class(*), allocatable :: value(:) contains procedure :: vec_copy generic :: assignment(=) => vec_copy end type contains subroutine vec_copy(lhs, rhs) class(any_vector), intent(inout) :: lhs type(any_vector), intent(in) :: rhs lhs%value = rhs%value end subroutine end module program class_129 use class_129_mod implicit none print *, "PASS" end program lfortran-0.63.0/integration_tests/min_02.f900000664000175000017500000000012615174404631020770 0ustar alastairalastairprogram min_02 integer(8) :: y integer :: z print *, min(y, z) end programlfortran-0.63.0/integration_tests/complex_25.f900000664000175000017500000000062015174404631021660 0ustar alastairalastairprogram complex_25 implicit none integer,parameter :: pr = 6, wp = selected_real_kind(pr) real(wp),parameter:: small = tiny(1.0_wp) complex(wp) :: a, b a = cmplx(-2,1,wp)*small b = cmplx(-1,2,wp)*small print *, small if (abs(small - 1.1920929E-38_wp) > 1e-12_wp) error stop print *, a/b if (abs(a/b - (0.800000012,0.600000024)) > 1e-12_wp) error stop end program complex_25 lfortran-0.63.0/integration_tests/common_27.f900000664000175000017500000000034615174404631021510 0ustar alastairalastairprogram common_save call sub() print *, "test passed" end program subroutine sub() real :: xyzzy common /block/ xyzzy save /block/ xyzzy = xyzzy + 1.0 if (xyzzy /= 1.0) error stop "wrong value" end subroutine lfortran-0.63.0/integration_tests/arrays_07.f900000664000175000017500000000313715174404631021520 0ustar alastairalastairprogram arrays_07 implicit none integer, dimension(10) :: x integer, dimension(3, 3) :: y integer :: i, j integer :: start, end, step do i = 1, 3 do j = 1, 3 y(i, j) = i + j end do end do x = [(i, i = 1, 10)] start = x(4) end = x(7) step = x(1) print *, x(start:end:step) if( sum(x(start:end:step)) /= 22 ) error stop ! TODO: Check with any print *, x if( any(x /= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) ) error stop print *, x(1:5) if( any(x(1:5) /= [1, 2, 3, 4, 5]) ) error stop print *, x(3:) if( any(x(3:) /= [3, 4, 5, 6, 7, 8, 9, 10]) ) error stop print *, x(:5) if( any(x(:5) /= [1, 2, 3, 4, 5]) ) error stop print *, x(5) if( x(5) /= 5 ) error stop print *, x(3:5:2) if( any(x(3:5:2) /= [3, 5]) ) error stop print *, x(:5:2) if( any(x(:5:2) /= [1, 3, 5]) ) error stop print *, x(3::2) if( any(x(3::2) /= [3, 5, 7, 9]) ) error stop print *, x(::2) if( any(x(::2) /= [1, 3, 5, 7, 9]) ) error stop print *, sum(y) if( sum(y) /= 36 ) error stop print *, sum(y(:, 3)) if( sum(y(:, 3)) /= 15 ) error stop print *, sum(y(2:, :)) if( sum(y(2:, :)) /= 27 ) error stop print *, sum(y(4:, 3:)) if( sum(y(4:, 3:)) /= 0 ) error stop print *, sum(y(:2, 2:)) if( sum(y(:2, 2:)) /= 16 ) error stop print *, sum(y(1:2:2, 1:2:1)) if( sum(y(1:2:2, 1:2:1)) /= 5 ) error stop print *, sum(y(:3:2, 3)) if( sum(y(:3:2, 3)) /= 10 ) error stop print *, sum(y(3, 3::2)) if( sum(y(3, 3::2)) /= 6 ) error stop print *, sum(y(3::2, :3:2)) if( sum(y(3::2, :3:2)) /= 10 ) error stop print *, sum(y(::2, ::4)) if( sum(y(::2, ::4)) /= 6 ) error stop print *, sum(y(::2, 3)) if( sum(y(::2, 3)) /= 10 ) error stop end program lfortran-0.63.0/integration_tests/separate_compilation_05a.f900000664000175000017500000000036615174404631024561 0ustar alastairalastairmodule separate_compilation_05a_module implicit none contains subroutine lu() end subroutine subroutine resol_lu(L) real, allocatable :: L(:,:) print *, sum(L) if ( abs(sum(L) - 2.08361094e+04 ) > 1e-8 ) error stop end subroutine end module lfortran-0.63.0/integration_tests/array_section_17.f900000664000175000017500000000144015174404631023055 0ustar alastairalastair! Test: non-contiguous assumed-shape array passed to assumed-size dummy ! When a non-contiguous array section (e.g., a(1,:)) is passed through ! an assumed-shape argument to an assumed-size dummy, the compiler must ! create a contiguous temporary (copy-in). program array_section_17 implicit none integer :: a(2,3) a(1,:) = [10, 20, 30] a(2,:) = 0 call check_via_assumed_shape(a(1,:)) contains subroutine check_assumed_size(x, n) integer, intent(in) :: x(*) integer, intent(in) :: n if (x(1) /= 10) error stop if (x(2) /= 20) error stop if (x(3) /= 30) error stop end subroutine subroutine check_via_assumed_shape(x) integer, intent(in) :: x(:) call check_assumed_size(x, size(x)) end subroutine end program lfortran-0.63.0/integration_tests/associate_27.f900000664000175000017500000000200115174404631022161 0ustar alastairalastairmodule nf_linear2d_layer implicit none private public :: linear2d_layer type :: linear2d_layer real, allocatable :: weights(:,:) real, allocatable :: biases(:) contains procedure :: get_params_ptr end type contains subroutine get_params_ptr(self, w_ptr, b_ptr) class(linear2d_layer), intent(in), target :: self real, pointer, intent(out) :: w_ptr(:), b_ptr(:) w_ptr(1:size(self%weights)) => self%weights b_ptr => self%biases end subroutine end module program associate_27 use nf_linear2d_layer implicit none type(linear2d_layer) :: layer real, pointer :: w(:), b(:) allocate(layer%weights(2,2)) allocate(layer%biases(2)) layer%weights = reshape([1.,2.,3.,4.], [2,2]) layer%biases = [5.,6.] call layer%get_params_ptr(w, b) if (.not. associated(w) .or. .not. associated(b)) error stop w(1) = -1. b(2) = -2. if (layer%weights(1,1) /= -1.) error stop if (layer%biases(2) /= -2.) error stop end program lfortran-0.63.0/integration_tests/namelist_24.f900000664000175000017500000000113315174404631022024 0ustar alastairalastairmodule namelist_24_mod implicit none integer :: a = 0 end module namelist_24_mod program test_namelist_external_symbol use namelist_24_mod implicit none namelist /nml/ a a = 42 open(unit=10, file='namelist_24.dat', status='replace', form='formatted') write(10, nml=nml) close(10) a = 0 open(unit=10, file='namelist_24.dat', status='old', form='formatted') read(10, nml=nml) close(10) if (a /= 42) error stop "Namelist external symbol test failed" print *, "Namelist external symbol test passed!" end program test_namelist_external_symbol lfortran-0.63.0/integration_tests/parameter_05.f900000664000175000017500000000025415174404631022172 0ustar alastairalastairprogram paramter_05 implicit none integer, parameter :: x = 5.0 real, parameter :: y = 5 real(kind=8), parameter :: z = 5 print*, x,y,z end program paramter_05 lfortran-0.63.0/integration_tests/intrinsics_215.f900000664000175000017500000001110515174404631022457 0ustar alastairalastairprogram intrinsics_215 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(sp) :: a, b, c real(dp) :: d, e, f integer :: i real(dp) :: w(19) real(sp) :: x(19) real(dp) :: expected_w(19) real(sp) :: expected_x(19) real(dp), parameter :: res(19) = cosd([18.7234114226922479_dp, 31.7355871858161613_dp, 46.7189879975828859_dp, & -18.7234114226922479_dp, -31.7355871858161613_dp, -46.7189879975828859_dp, -90.0000000000000000_dp, & -88.1889782219856926_dp, -87.4387217993888584_dp, -86.8629570229495442_dp, -86.3775039053440139_dp, & -85.9497575149846398_dp, -85.5629967823348778_dp, -85.2072890476047604_dp, -84.8761629060389708_dp, & -84.5651234927047142_dp, -84.2708982602068915_dp, -83.9910168022338581_dp, -83.7235599383380418_dp]) real(sp), parameter :: res_sp(19) = cosd([17.7966309_sp, 27.7443714_sp, 36.0546188_sp, & -17.7966309_sp, -27.7443714_sp, -36.0546188_sp, -45.0000000_sp, -44.9713364_sp, -44.9713364_sp, & -44.9426460_sp, -44.9426460_sp, -44.9139252_sp, -44.9139252_sp, -44.8851776_sp, & -44.8851776_sp, -44.8564034_sp, -44.8564034_sp, -44.8275948_sp, -44.8275948_sp]) expected_w = [0.94707919415432207_dp, 0.85048456776122638_dp, 0.68557712914011359_dp, & 0.94707919415432207_dp, 0.85048456776122638_dp, 0.68557712914011359_dp, 0.0000000000000000_dp, & 3.1603029890377138E-002_dp, 4.4687850642047139E-002_dp, 5.4724377477153467E-002_dp, & 6.3182370832535792E-002_dp, 7.0631207523869075E-002_dp, 7.7362936649548061E-002_dp, & 8.3551070946493652E-002_dp, 8.9308677876631062E-002_dp, 9.4714304254108886E-002_dp, & 9.9825146707179999E-002_dp, 0.10468438946844835_dp, 0.10932558657585983_dp] w = [18.7234114226922479_dp, 31.7355871858161613_dp, 46.7189879975828859_dp, -18.7234114226922479_dp, & -31.7355871858161613_dp, -46.7189879975828859_dp, -90.0000000000000000_dp, -88.1889782219856926_dp, -87.4387217993888584_dp, & -86.8629570229495442_dp, -86.3775039053440139_dp, -85.9497575149846398_dp, -85.5629967823348778_dp, -85.2072890476047604_dp, & -84.8761629060389708_dp, -84.5651234927047142_dp, -84.2708982602068915_dp, -83.9910168022338581_dp, & -83.7235599383380418_dp] x = [17.7966309_sp, 27.7443714_sp, 36.0546188_sp, -17.7966309_sp, & -27.7443714_sp, -36.0546188_sp, -45.0000000_sp, -44.9713364_sp, -44.9713364_sp, & -44.9426460_sp, -44.9426460_sp, -44.9139252_sp, -44.9139252_sp, -44.8851776_sp, & -44.8851776_sp, -44.8564034_sp, -44.8564034_sp, -44.8275948_sp, -44.8275948_sp] expected_x = [0.952147365_sp, 0.885033369_sp, 0.808456302_sp, & 0.952147365_sp, 0.885033369_sp, 0.808456302_sp, 0.707106769_sp, 0.707460463_sp, 0.707460463_sp, & 0.707814276_sp, 0.707814276_sp, 0.708168268_sp, 0.708168268_sp, 0.708522379_sp, & 0.708522379_sp, 0.708876729_sp, 0.708876729_sp, 0.709231317_sp, 0.709231317_sp] do i = 1, size(res) print *, res(i) if (abs(res(i) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(w) print *, cosd(w(i)) if (abs(cosd(w(i)) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_x(i)) > 1e-5) error stop end do do i = 1, size(x) print *, cosd(x(i)) if (abs(cosd(x(i)) - expected_x(i)) > 1e-5) error stop end do a = 18.928_sp b = 32.627_sp c = 47.123_sp d = 18.829262783_dp e = 32.727262783_dp f = 47.223262783_dp print *, cosd(a) if (abs(cosd(a) - 0.945926964) > 1e-3) error stop print *, cosd(b) if (abs(cosd(b) - 0.842198431) > 1e-3) error stop print *, cosd(c) if (abs(cosd(c) - 0.680426717) > 1e-3) error stop print *, cosd(18.928_sp) if (abs(cosd(18.928_sp) - 0.945926964) > 1e-3) error stop print *, cosd(32.627_sp) if (abs(cosd(32.627_sp) - 0.842198431) > 1e-3) error stop print *, cosd(47.123_sp) if (abs(cosd(47.123_sp) - 0.680426717) > 1e-3) error stop print *, cosd(d) if (abs(cosd(d) - 0.94648454528292103) > 1e-3) error stop print *, cosd(e) if (abs(cosd(e) - 0.84125362666495140) > 1e-3) error stop print *, cosd(f) if (abs(cosd(f) - 0.67914334502356000) > 1e-3) error stop print *, cosd(18.829262783_dp) if (abs(cosd(18.829262783_dp) - 0.94648454528292103) > 1e-3) error stop print *, cosd(32.727262783_dp) if (abs(cosd(32.727262783_dp) - 0.84125362666495140) > 1e-3) error stop print *, cosd(47.223262783_dp) if (abs(cosd(47.223262783_dp) - 0.67914334502356000) > 1e-3) error stop end programlfortran-0.63.0/integration_tests/inquire_05.f900000664000175000017500000000176315174404631021674 0ustar alastairalastairprogram inquire_05 implicit none integer :: io integer :: pos_value character(len=*), parameter :: txt = "ABC" integer, parameter :: expected_pos = 4 open(newunit=io, file="inquire_pos_stream.bin", access="stream", form="unformatted", status="replace") write(io) txt close(io) open(file="inquire_pos_stream.bin", & & status="old", & & access="stream", & & position="append", & & newunit=io) inquire(unit=io, pos=pos_value) close(io, status="delete") print *, "Position after append =", pos_value if (pos_value /= expected_pos) error stop "Position mismatch after append" open(newunit=io, file="inquire_pos_stream2.bin", access="stream", form="unformatted", status="replace") write(io) txt inquire(unit=io, pos=pos_value) close(io, status="delete") print *, "Position before close =", pos_value if (pos_value /= expected_pos) error stop "Position mismatch before close" end program inquire_05 lfortran-0.63.0/integration_tests/cpu_time_02_wasm.f900000664000175000017500000000056015174404631023043 0ustar alastairalastair! program cpu_time_02_wasm ! use iso_fortran_env, only: dp=>real64 ! implicit none ! real(dp) :: t1, t2 ! interface ! subroutine cpu_time(t) bind(js) ! import :: dp ! real(dp), intent(out) :: t ! end subroutine ! end interface ! call cpu_time(t1) ! print *, "Some computation" ! call cpu_time(t2) ! print *, "Total time: ", t2-t1 ! end program lfortran-0.63.0/integration_tests/read_61.f900000664000175000017500000000303515174404631021127 0ustar alastairalastairprogram read_61 use, intrinsic :: iso_fortran_env, only: real32, real64, int32 implicit none character(len=:), allocatable :: s real(real32) :: x, y real(real64) :: d integer(int32) :: got_bits, exp_bits ! Legacy exponent shorthand with minus sign. s = '1.-3' read(s, *) x if (abs(x - 1.0e-3_real32) > 1.0e-7_real32) error stop '1.-3 parse failed' ! Legacy exponent shorthand with plus sign. s = '1.+3' read(s, *) x if (abs(x - 1.0e3_real32) > 1.0e-3_real32) error stop '1.+3 parse failed' ! Multiple values to verify position tracking for internal list-directed reads. s = '2.-2 3.+1' read(s, *) x, y if (abs(x - 2.0e-2_real32) > 1.0e-7_real32) error stop '2.-2 parse failed' if (abs(y - 3.0e1_real32) > 1.0e-4_real32) error stop '3.+1 parse failed' ! Standard E exponent remains supported. s = '4.5E-2' read(s, *) x if (abs(x - 4.5e-2_real32) > 1.0e-7_real32) error stop 'E exponent parse failed' ! Standard D exponent remains supported. s = '6.25D+1' read(s, *) d if (abs(d - 6.25d1) > 1.0d-12) error stop 'D exponent parse failed' ! Long token regression: exponent must not be dropped by internal list-directed read. s = '0.140129846432481707092372958328991613128026194187651577' // & '175706828388979108268586060148663818836212158203125E-44' read(s, *) x got_bits = transfer(x, got_bits) exp_bits = transfer(tiny(1.0_real32) * epsilon(1.0_real32), exp_bits) if (got_bits /= exp_bits) error stop 'long internal real token parsed incorrectly' print *, 'PASS' end program read_61 lfortran-0.63.0/integration_tests/intrinsics_389.f900000664000175000017500000000055615174404631022503 0ustar alastairalastairprogram intrinsics_389 implicit none integer :: i integer, save :: j print*, "main not saved", loc(i) print*, "main saved", loc(j) call sub() contains subroutine sub() integer :: i integer, save :: j print*, "sub not saved", loc(i) print*, "sub saved", loc(j) end end program intrinsics_389lfortran-0.63.0/integration_tests/derived_types_28.f900000664000175000017500000000055115174404631023065 0ustar alastairalastairprogram derived_types_28 implicit none type t real, dimension(:), pointer :: x, y, z end type t type(t) :: type real, target :: r(1) real :: ans r = 34 type%x => r type%y => r type%z => r type%x = type%y + type%z ans = type%x(1) print *, ans if (abs(ans - 68.0) > 1e-5) error stop end program lfortran-0.63.0/integration_tests/allocate_17.f900000664000175000017500000000211115174404631021773 0ustar alastairalastairprogram allocate_17 implicit none integer, allocatable :: arr1(:), arr2(:), arr3(:), arr4(:), arr5(:,:) logical, allocatable :: l_arr1(:), l_arr2(:), l_arr3(:) integer, parameter :: src(5) = [2,1,3,4,1], src2(2,3) = reshape([1,2,3,2,1,3], [2,3]) logical, parameter :: l_src(3) = [.true.,.false.,.true.] integer :: isrc isrc = 10 allocate(arr1(5)) arr1 = isrc if (any(arr1 /= 10)) error stop allocate(arr2(5), source=isrc) if (any(arr2 /= 10)) error stop allocate(arr3(5), arr4(5), source=src) if (any(arr3 /= [2,1,3,4,1])) error stop if (any(arr4 /= [2,1,3,4,1])) error stop allocate(arr5(2,3), source=src2(:,1:3)) if (any(arr5(:,1) /= [1,2])) error stop if (any(arr5(:,2) /= [3,2])) error stop if (any(arr5(:,3) /= [1,3])) error stop allocate(l_arr1(3), source = .true.) if (any(l_arr1 .neqv. .true.)) error stop allocate(l_arr2(3), l_arr3(3), source = l_src) if (any(l_arr2 .neqv. [.true., .false., .true.])) error stop if (any(l_arr3 .neqv. [.true., .false., .true.])) error stop end program lfortran-0.63.0/integration_tests/separate_compilation_23b.f900000664000175000017500000000063715174404631024563 0ustar alastairalastairsubmodule (ansi_separate_compilation_23) stdlib_ansi_operator use string_type_separate_compilation_23, only : operator(//) implicit none contains pure module function concat_left(lval, code) result(str) character(len=*), intent(in) :: lval type(ansi_code), intent(in) :: code character(len=:), allocatable :: str end function concat_left end submodule stdlib_ansi_operatorlfortran-0.63.0/integration_tests/enum_02_module.f900000664000175000017500000000032115174404631022513 0ustar alastairalastairmodule enum_02_module implicit none enum, bind(c) enumerator :: red, blue enumerator yellow end enum integer, parameter :: compiler_enum = kind(red) end module enum_02_module lfortran-0.63.0/integration_tests/inquire_10.f900000664000175000017500000000102715174404631021661 0ustar alastairalastairprogram inquire_10 use iso_fortran_env, only: int64 implicit none integer(int64) :: file_size integer :: fh character(*), parameter :: fname = "inquire_10_test.txt" open(newunit=fh, file=fname, access="stream", form="unformatted", status="replace") write(fh) "hello" close(fh) inquire(file=fname, size=file_size) print *, "File size =", file_size, "bytes" if (file_size /= 5) error stop open(newunit=fh, file=fname, status="old") close(fh, status="delete") end program inquire_10 lfortran-0.63.0/integration_tests/pdt_03.f900000664000175000017500000001136215174404631021001 0ustar alastairalastairmodule pdt_03_module implicit none !================================================= ! Origin PDT (used for nesting) !================================================= type :: origin(ik) integer, kind :: ik integer(kind=ik) :: i_val(20) end type origin !================================================= ! Parent PDT !================================================= type :: parent(ik, rk) integer, kind :: ik integer, kind :: rk = kind(1.0) ! default real kind integer(kind=ik) :: i_val real(kind=rk) :: r_val type(origin(ik)) :: orig type(origin(rk)) :: orig2 end type parent !================================================= ! Container PDT (nested) !================================================= type :: container(ik) integer, kind :: ik type(parent(ik, 8)) :: p ! force 8-byte real type(parent(ik)) :: p2 ! default real kind type(parent(8, ik)) :: p3 type(parent(8)) :: p4 end type container end module program pdt_03 use pdt_03_module use iso_fortran_env, only: int32, int64, real32, real64 implicit none type(container(int32)) :: obj type(container(int64)) :: obj64 integer(int64) :: big_val real(real64) :: precise_val !================================================= ! 1. Parameter propagation tests !================================================= if (obj%ik /= int32) error stop "container ik incorrect" if (obj%p%ik /= int32) error stop "p%ik incorrect" if (obj%p%rk /= real64) error stop "p%rk should be real64" if (obj%p%orig%ik /= int32) error stop "p%orig%ik incorrect" if (obj%p%orig2%ik /= real64) error stop "p%orig2%ik should be real64" if (obj%p2%ik /= int32) error stop "p2%ik incorrect" if (obj%p2%rk /= kind(1.0)) error stop "p2%rk should be default real" if (obj%p2%orig%ik /= int32) error stop "p2%orig%ik incorrect" if (obj%p2%orig2%ik /= real32) error stop "p2%orig2%ik should be real32" if (obj%p3%ik /= int64) error stop "p3%ik incorrect" if (obj%p3%rk /= int32) error stop "p3%rk should be int32 (misuse of rk as ik in p3)" if (obj%p3%orig%ik /= int64) error stop "p3%orig%ik incorrect" if (obj%p3%orig2%ik /= real32) error stop "p3%orig2%ik should be real32" if (obj%p4%ik /= int64) error stop "p4%ik should be int64 (misuse of ik as rk in p4)" if (obj%p4%rk /= kind(1.0)) error stop "p4%rk should be default real" !================================================= ! 2. Integer storage tests (32-bit) !================================================= obj%p%i_val = 123456 obj%p2%i_val = -654321 obj%p3%i_val = 12345678899_8 if (obj%p%i_val /= 123456) error stop "p%i_val assignment failed" if (obj%p2%i_val /= -654321) error stop "p2%i_val assignment failed" if (obj%p3%i_val /= 12345678899_8) error stop "p3%i_val assignment failed" !================================================= ! 3. Real precision tests !================================================= precise_val = 1.0_real64 / 3.0_real64 obj%p%r_val = precise_val obj%p2%r_val = 1.0 / 3.0 obj%p3%r_val = 1.0 / 3.0 if (abs(obj%p%r_val - precise_val) > 1.0e-15_real64) then error stop "High precision real lost in p" end if if (abs(obj%p2%r_val - (1.0/3.0)) > 1.0e-6) then error stop "Default precision real incorrect in p2" end if if (abs(obj%p3%r_val - (1.0/3.0)) > 1.0e-6) then error stop "Default precision real incorrect in p3" end if !================================================= ! 4. Storage size verification !================================================= if (storage_size(obj%p%i_val) /= 32) then error stop "Expected 32-bit integer storage" end if if (storage_size(obj%p%r_val) /= 64) then error stop "Expected 64-bit real storage in p" end if if (storage_size(obj%p3%i_val) /= 64) then error stop "Expected 64-bit integer storage in p3" end if !================================================= ! 5. Edge case: large 64-bit integer (should fail if wrong kind) !================================================= big_val = 2_int64**40 ! Requires 64-bit integer if (big_val <= 0) error stop "int64 not working correctly" ! Ensure 32-bit container cannot hold this value correctly obj%p%i_val = int(big_val, int32) if (int(obj%p%i_val, int64) == big_val) then error stop "Unexpected preservation of 64-bit value in 32-bit storage" end if if (obj64%ik /= int64) error stop "container(int64) failed" if (storage_size(obj64%p%i_val) /= 64) then error stop "Expected 64-bit integer storage in obj64" end if if (storage_size(obj64%p3%r_val) /= 64) then error stop "Expected 64-bit real storage in obj64%p3%r_val" end if print *, "All extended nested PDT tests passed successfully." end program pdt_03lfortran-0.63.0/integration_tests/elemental_21.f900000664000175000017500000000145715174404631022164 0ustar alastairalastairmodule elemental_21_mod implicit none type :: t integer :: val = 0 contains procedure :: f_tbp end type contains elemental function f_tbp(self, x) result(res) class(t), intent(in) :: self integer, intent(in), optional :: x type(t) :: res if (present(x)) then res%val = self%val + x else res%val = self%val + 1 end if end function end module program elemental_21 use elemental_21_mod, only : t implicit none type(t) :: a(3), b(3) integer :: i do i = 1, 3 a(i)%val = i * 10 end do b = a%f_tbp() if (b(1)%val /= 11) error stop if (b(2)%val /= 21) error stop if (b(3)%val /= 31) error stop b = a%f_tbp(5) if (b(1)%val /= 15) error stop if (b(2)%val /= 25) error stop if (b(3)%val /= 35) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/character_01.f900000664000175000017500000000040215174404631022135 0ustar alastairalastairprogram character_01 CHARACTER A*4, B*4, C(2)*3 CHARACTER, parameter :: D*3 = "ape" CHARACTER(len=3) :: E(2) = "apel" A = 'ABCD' B = 'EFGH' C(1) = 'IJK' C(2) = 'LMN' print *, A, B, C(1), C(2) print *, D print *, E end program lfortran-0.63.0/integration_tests/separate_compilation_33a.f900000664000175000017500000000102615174404631024554 0ustar alastairalastairmodule separate_compilation_33a implicit none type tensor_1d_t contains procedure :: divergence_1d_weights end type tensor_1d_t type, extends(tensor_1d_t) :: divergence_1d_t contains generic :: weights => divergence_1d_weights end type divergence_1d_t contains integer function divergence_1d_weights(self) result(weights) class(tensor_1d_t), intent(in) :: self weights = storage_size(self) end function divergence_1d_weights end module separate_compilation_33a lfortran-0.63.0/integration_tests/intrinsics_231.f900000664000175000017500000000110415174404631022453 0ustar alastairalastairprogram intrinsics_231 use iso_fortran_env, only: dp => real64 implicit none real(dp), parameter :: x1 = dgamma(1.0_dp) real(dp), parameter :: x2 = dgamma(3.14_dp) real(dp) :: x = 1.0_dp real(dp) :: y = 3.14_dp print *, x1 if (abs(x1 - 1.0000000000000000_dp) > 1e-12) error stop print *, x2 if (abs(x2 - 2.2844806338178012_dp) > 1e-12) error stop print *, dgamma(x) if (abs(dgamma(x) - 1.0000000000000000_dp) > 1e-12) error stop print *, dgamma(y) if (abs(dgamma(y) - 2.2844806338178012_dp) > 1e-12) error stop end programlfortran-0.63.0/integration_tests/file_23.f900000664000175000017500000000167015174404631021134 0ustar alastairalastair! Testing different kinds of integer variables as unit number. program file_23 type :: file_t integer(1) :: iunit_1 integer(2) :: iunit_2 integer(4) :: iunit_4 integer(8) :: iunit_8 end type file_t type(file_t) :: f character(30) :: str open(newunit=f%iunit_1, file='file_23_data.txt') read(f%iunit_1, *) str print *, str if(str /= "HelloWorld!") error stop close(f%iunit_1) open(newunit=f%iunit_2, file='file_23_data.txt') read(f%iunit_2, *) str print *, str if(str /= "HelloWorld!") error stop close(f%iunit_2) open(newunit=f%iunit_4, file='file_23_data.txt') read(f%iunit_4, *) str print *, str if(str /= "HelloWorld!") error stop close(f%iunit_4) open(newunit=f%iunit_8, file='file_23_data.txt') read(f%iunit_8, *) str print *, str if(str /= "HelloWorld!") error stop close(f%iunit_8) end program file_23lfortran-0.63.0/integration_tests/arrays_10.f900000664000175000017500000000020015174404631021476 0ustar alastairalastairprogram arrays_10 implicit none integer, pointer :: x(:) allocate(x(1)) x = [ 1 ] deallocate(x) end program arrays_10 lfortran-0.63.0/integration_tests/complex_30.f900000664000175000017500000000312115174404631021653 0ustar alastairalastairprogram complex_ops_01 ! Test that complex arithmetic works correctly ! This also serves to verify inline complex ops when implemented implicit none complex :: a, b, c, d real :: eps eps = 1.0e-6 ! Test complex multiplication: (1+2i) * (3+4i) = (1*3-2*4) + (1*4+2*3)i = -5 + 10i a = (1.0, 2.0) b = (3.0, 4.0) c = a * b if (abs(real(c) - (-5.0)) > eps) error stop "mul real failed" if (abs(aimag(c) - 10.0) > eps) error stop "mul imag failed" ! Test complex addition: (1+2i) + (3+4i) = 4 + 6i c = a + b if (abs(real(c) - 4.0) > eps) error stop "add real failed" if (abs(aimag(c) - 6.0) > eps) error stop "add imag failed" ! Test complex subtraction: (1+2i) - (3+4i) = -2 - 2i c = a - b if (abs(real(c) - (-2.0)) > eps) error stop "sub real failed" if (abs(aimag(c) - (-2.0)) > eps) error stop "sub imag failed" ! Test complex division: (1+2i) / (3+4i) = (1*3+2*4)/(3^2+4^2) + (2*3-1*4)/(3^2+4^2)i ! = 11/25 + 2/25 i = 0.44 + 0.08i c = a / b if (abs(real(c) - 0.44) > eps) error stop "div real failed" if (abs(aimag(c) - 0.08) > eps) error stop "div imag failed" ! Test compound expression d = (a * b + a) / b - a ! = ((-5+10i) + (1+2i)) / (3+4i) - (1+2i) ! = (-4+12i) / (3+4i) - (1+2i) ! = ((-4*3+12*4)/25 + (12*3-(-4)*4)/25 i) - (1+2i) ! = (36/25 + 52/25 i) - (1+2i) ! = (1.44 - 1) + (2.08 - 2)i = 0.44 + 0.08i if (abs(real(d) - 0.44) > eps) error stop "compound real failed" if (abs(aimag(d) - 0.08) > eps) error stop "compound imag failed" print *, "PASS" end program lfortran-0.63.0/integration_tests/class_43.f900000664000175000017500000000152415174404631021322 0ustar alastairalastairmodule class_43_mod type, abstract :: SomeType end type SomeType type, abstract :: Base contains procedure(method), deferred :: method end type Base abstract interface subroutine method(self,arr) import class(Base), intent(inout) :: self class(SomeType), intent(inout) :: arr(:) end subroutine method end interface type, extends(Base) :: Extended class(Base), allocatable :: basic contains procedure :: method => implementation end type Extended contains subroutine implementation(self,arr) class(Extended), intent(inout) :: self class(SomeType), intent(inout) :: arr(:) call self%basic%method(arr) end subroutine implementation end module class_43_mod program class_43 use class_43_mod end program class_43lfortran-0.63.0/integration_tests/procedure_48.f900000664000175000017500000000322115174404631022206 0ustar alastairalastairmodule procedure_48_mod implicit none procedure(stop_error_routine), pointer :: stop_error => null() abstract interface subroutine stop_error_routine(line, output, msg) character(*), intent(in), optional :: line integer, intent(in), optional :: output character(*), intent(in), optional :: msg end subroutine stop_error_routine end interface contains subroutine equation_setup_error_routines(stop_error_sub) procedure(stop_error_routine) :: stop_error_sub stop_error => stop_error_sub end subroutine equation_setup_error_routines subroutine check_for_error(errmsg, ln) character(*), intent(in) :: errmsg character(*), intent(in), optional :: ln if (associated(stop_error)) then call stop_error(line=ln, output=6, msg=errmsg) end if end subroutine check_for_error subroutine impl_stop_error(line, output, msg) character(*), intent(in), optional :: line integer, intent(in), optional :: output character(*), intent(in), optional :: msg if (present(line)) then if (line /= "LN") error stop end if if (present(output)) then if (output /= 6) error stop end if if (present(msg)) then if (msg /= "ERR") error stop end if end subroutine impl_stop_error end module procedure_48_mod program procedure_48 use procedure_48_mod implicit none call equation_setup_error_routines(impl_stop_error) call check_for_error("ERR", "LN") end program procedure_48 lfortran-0.63.0/integration_tests/cycle_and_exit5.f900000664000175000017500000000043215174404631022743 0ustar alastairalastairprogram cycle_and_exit5 implicit none integer :: i, j integer(8) :: s s = 0 do i = 1, 10 if( 3*(i/3) == i ) exit do j = 1, 20 s = s + i + j end do if( 2*(i/2) == i ) cycle s = 2*s end do print *, s if( s/= 710 ) error stop end program cycle_and_exit5 lfortran-0.63.0/integration_tests/modules_44_module.f900000664000175000017500000000041715174404631023233 0ustar alastairalastairmodule modules_44_module_fpm_filesystem implicit none contains subroutine warnwrite(fname, data) character(len=*), intent(in) :: fname character(len=*), intent(in) :: data(:) end subroutine warnwrite end module modules_44_module_fpm_filesystem lfortran-0.63.0/integration_tests/custom_operator_01.f900000664000175000017500000000121215174404631023426 0ustar alastairalastairmodule custom_operator_01_a implicit none public :: operator(.negation.) interface operator(.negation.) module procedure negative end interface contains function negative(i) result(res) integer, intent(in) :: i integer :: res res = -i end function negative end module custom_operator_01_a module custom_operator_01_b integer :: negation = 5 end module custom_operator_01_b program custom_operator_01 use custom_operator_01_b, only : negation use custom_operator_01_a, only : operator(.negation.) implicit none integer :: res, x x = 10 res = .negation. x print *, res end program custom_operator_01 lfortran-0.63.0/integration_tests/arrays_25.f900000664000175000017500000000073315174404631021517 0ustar alastairalastairprogram arrays_25 implicit none type :: model_t integer, allocatable :: decoder_idx(:) end type type(model_t) :: m allocate(m%decoder_idx(10)) m%decoder_idx(:) = 0 m%decoder_idx(5) = 5 print *, m%decoder_idx call decode(m%decoder_idx) contains subroutine decode(idx) integer, intent(in) :: idx(:) if (idx(4) /= 0) error stop if (idx(5) /= 5) error stop end subroutine end program lfortran-0.63.0/integration_tests/gpu_metal_30.f900000664000175000017500000000047715174404631022174 0ustar alastairalastairprogram gpu_metal_30 ! Test: do concurrent inside a block with block-local variables implicit none integer :: i, res res = 0 block integer :: x(5) do concurrent (i = 1:5) x(i) = i * 3 end do res = x(1) + x(2) + x(3) + x(4) + x(5) end block if (res /= 45) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/intrinsics_214.f900000664000175000017500000001077615174404631022473 0ustar alastairalastairprogram intrinsics_214 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(sp) :: a, b, c real(dp) :: d, e, f integer :: i real(dp) :: w(19) real(sp) :: x(19) real(dp) :: expected_w(19) real(sp) :: expected_x(19) real(dp), parameter :: res(19) = sind([18.7234114226922479_dp, 31.7355871858161613_dp, 46.7189879975828859_dp, & -18.7234114226922479_dp, -31.7355871858161613_dp, -46.7189879975828859_dp, -90.0000000000000000_dp, & -88.1889782219856926_dp, -87.4387217993888584_dp, -86.8629570229495442_dp, -86.3775039053440139_dp, & -85.9497575149846398_dp, -85.5629967823348778_dp, -85.2072890476047604_dp, -84.8761629060389708_dp, & -84.5651234927047142_dp, -84.2708982602068915_dp, -83.9910168022338581_dp, -83.7235599383380418_dp]) real(sp), parameter :: res_sp(19) = sind([17.7966309_sp, 27.7443714_sp, 36.0546188_sp, & -17.7966309_sp, -27.7443714_sp, -36.0546188_sp, -45.0000000_sp, -44.9713364_sp, -44.9713364_sp, & -44.9426460_sp, -44.9426460_sp, -44.9139252_sp, -44.9139252_sp, -44.8851776_sp, & -44.8851776_sp, -44.8564034_sp, -44.8564034_sp, -44.8275948_sp, -44.8275948_sp]) expected_w = [0.32100000000000001_dp, 0.52600000000000002_dp, 0.72799999999999998_dp, & -0.32100000000000001_dp, -0.52600000000000002_dp, -0.72799999999999998_dp, -1.0000000000000000_dp, & -0.99950049950049946_dp, -0.99900099900099903_dp, -0.99850149850149850_dp, -0.99800199800199796_dp, & -0.99750249750249753_dp, -0.99700299700299699_dp, -0.99650349650349646_dp, -0.99600399600399603_dp, & -0.99550449550449549_dp, -0.99500499500499495_dp, -0.99450549450549453_dp, -0.99400599400599399_dp] w = [18.7234114226922479_dp, 31.7355871858161613_dp, 46.7189879975828859_dp, -18.7234114226922479_dp, & -31.7355871858161613_dp, -46.7189879975828859_dp, -90.0000000000000000_dp, -88.1889782219856926_dp, -87.4387217993888584_dp, & -86.8629570229495442_dp, -86.3775039053440139_dp, -85.9497575149846398_dp, -85.5629967823348778_dp, -85.2072890476047604_dp, & -84.8761629060389708_dp, -84.5651234927047142_dp, -84.2708982602068915_dp, -83.9910168022338581_dp, & -83.7235599383380418_dp] x = [17.7966309_sp, 27.7443714_sp, 36.0546188_sp, -17.7966309_sp, & -27.7443714_sp, -36.0546188_sp, -45.0000000_sp, -44.9713364_sp, -44.9713364_sp, & -44.9426460_sp, -44.9426460_sp, -44.9139252_sp, -44.9139252_sp, -44.8851776_sp, & -44.8851776_sp, -44.8564034_sp, -44.8564034_sp, -44.8275948_sp, -44.8275948_sp] expected_x = [0.305639327, 0.465527594, 0.588556170, -0.305639327, & -0.465527594, -0.588556170, -0.707106769, -0.706752896, -0.706752896, & -0.706398606, -0.706398606, -0.706043661, -0.706043661, -0.705688298, & -0.705688298, -0.705332398, -0.705332398, -0.704975843, -0.704975843] do i = 1, size(res) print *, res(i) if (abs(res(i) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(w) print *, sind(w(i)) if (abs(sind(w(i)) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_x(i)) > 1e-5) error stop end do do i = 1, size(x) print *, sind(x(i)) if (abs(sind(x(i)) - expected_x(i)) > 1e-5) error stop end do a = 18.928_sp b = 32.627_sp c = 47.123_sp d = 18.829262783_dp e = 32.727262783_dp f = 47.223262783_dp print *, sind(a) if (abs(sind(a) - 0.324379712) > 1e-3) error stop print *, sind(b) if (abs(sind(b) - 0.539167702) > 1e-3) error stop print *, sind(c) if (abs(sind(c) - 0.732816100) > 1e-3) error stop print *, sind(18.928_sp) if (abs(sind(18.928_sp) - 0.324379712) > 1e-3) error stop print *, sind(32.627_sp) if (abs(sind(32.627_sp) - 0.539167702) > 1e-3) error stop print *, sind(47.123_sp) if (abs(sind(47.123_sp) - 0.732816100) > 1e-3) error stop print *, sind(d) if (abs(sind(d) - 0.32274913716473685) > 1e-3) error stop print *, sind(e) if (abs(sind(e) - 0.54064067144737327) > 1e-3) error stop print *, sind(f) if (abs(sind(f) - 0.73400566544830548) > 1e-3) error stop print *, sind(18.829262783_dp) if (abs(sind(18.829262783_dp) - 0.32274913716473685) > 1e-3) error stop print *, sind(32.727262783_dp) if (abs(sind(32.727262783_dp) - 0.54064067144737327) > 1e-3) error stop print *, sind(47.223262783_dp) if (abs(sind(47.223262783_dp) - 0.73400566544830548) > 1e-3) error stop end programlfortran-0.63.0/integration_tests/flush_01.f900000664000175000017500000000015515174404631021327 0ustar alastairalastairprogram flush_01 integer :: ret open(10, file="file_01_data.txt") flush(10) end program flush_01 lfortran-0.63.0/integration_tests/dict_test_13_.f900000664000175000017500000000336115174404631022334 0ustar alastairalastairmodule dict_test_13_mod implicit none type(_lfortran_dict(character(len=:), integer(4))) :: I4C contains subroutine init_I4C() I4C = _lfortran_dict_constant( & "0", 0, "1", 1, "2", 2, "3", 3, & "4", 4, "5", 5, "6", 6, "7", 7, & "8", 8, "9", 9, & "a", 10, "b", 11, "c", 12, "d", 13, & "A", 10, "B", 11, "C", 12, "D", 13, & "e", 14, "f", 15, & "E", 14, "F", 15) end subroutine function cnvi(s, base) result(result) character(len=*), intent(in) :: s integer(4), intent(in) :: base integer(4) :: result integer :: i, len_s character(len=1) :: c integer(4) :: pow_, incr if (base /= 10 .and. base /= 8 .and. base /= 16 .and. base /= 2) error stop call init_I4C() len_s = len(s) result = 0 pow_ = base ** (len_s - 1) do i = 1, len_s c = s(i:i) incr = pow_ * _lfortran_get_item(I4C, c) result = result + incr pow_ = pow_ / base end do end function subroutine test_dict() integer(4) :: result result = cnvi("0b0", 2) print *, result if (result /= 22) error stop result = cnvi("0b1", 2) print *, result if (result /= 23) error stop result = cnvi("0b10", 2) print *, result if (result /= 46) error stop result = cnvi("0b11", 2) print *, result if (result /= 47) error stop result = cnvi("0b11110100111", 2) print *, result if (result /= 24487) error stop result = cnvi("0b7a7", 16) print *, result if (result /= 47015) error stop end subroutine end module program test_dict_13 use dict_test_13_mod implicit none call test_dict() end program lfortran-0.63.0/integration_tests/separate_compilation_31a.f900000664000175000017500000000065315174404631024557 0ustar alastairalastairmodule separate_compilation_31a_module implicit none type, abstract :: AbsType end type AbsType type :: MyType end type MyType interface MyType procedure :: constructor end interface MyType contains function constructor(obj) result(self) class(AbsType), intent(in) :: obj type(MyType) :: self end function constructor end module separate_compilation_31a_module lfortran-0.63.0/integration_tests/class_139.f900000664000175000017500000000114215174404631021404 0ustar alastairalastair! Test: assigning null class(T) pointer function result to type(T) pointer ! Verifies that when a function returning class(T), pointer yields null(), ! pointer assignment to a type(T), pointer correctly gives a null pointer ! without crashing. module class_139_mod implicit none type :: thing integer :: val = 0 end type contains function get_thing() result(c) class(thing), pointer :: c c => null() end function end module program class_139 use class_139_mod implicit none type(thing), pointer :: p p => get_thing() if (associated(p)) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/passing_array_04.f900000664000175000017500000000127415174404631023056 0ustar alastairalastairMODULE passing_array_04_mod implicit none CONTAINS FUNCTION test_01 (len,value) result(res) implicit none integer ,intent(in) :: len INTEGER, DIMENSION(2,2,len),intent(in) :: value INTEGER :: res res = size(value) END FUNCTION test_01 subroutine test_entry integer :: len INTEGER, DIMENSION(6, 2) :: value INTEGER :: ret len = 3 ret = test_01(len,value) print * , ret if(ret /= 12) error stop end subroutine test_entry END MODULE passing_array_04_mod program passing_array_04 use passing_array_04_mod implicit none call test_entry end program passing_array_04 lfortran-0.63.0/integration_tests/block_data_string_01.f900000664000175000017500000000067615174404631023667 0ustar alastairalastairsubroutine test() implicit none integer :: i1 common /blocki/ i1 character(5) :: c1 common /blockc/ c1 if (i1 /= 12345) error stop if (c1 /= '12345') error stop end subroutine program block_data_string_01 implicit none call test() end program block data bd implicit none integer :: i1 common /blocki/ i1 data i1 /12345/ character(5) :: c1 common /blockc/ c1 data c1 /'12345'/ end block data lfortran-0.63.0/integration_tests/functions_21.f900000664000175000017500000000165415174404631022225 0ustar alastairalastairpure integer function my_merge(val1, val2, mask) result(merged_value) integer, intent(in) :: val1, val2 logical, intent(in) :: mask if (mask) then merged_value = val1 else merged_value = val2 end if end function my_merge program functions_21 complex, dimension(3, 3) :: y complex :: res(3) res = mean_2_cdp_cdp(y, 1, mask=.true.) print *, res print *, abs(sum(res)) if (abs(abs(sum(res)) - 526.008179) > 1e-8) error stop contains function mean_2_cdp_cdp(x, dim, mask) result(res) complex, intent(in) :: x(:,:) integer, intent(in) :: dim logical, intent(in), optional :: mask complex :: res(my_merge(size(x, 1), size(x, 2), mask=1= 0.0) error stop x_sp = ieee_value(x_sp, ieee_positive_inf) if (ieee_is_negative(x_sp)) error stop if (ieee_is_finite(x_sp)) error stop if (.not. ieee_is_nan(x_sp) .and. x_sp <= 0.0) error stop x_sp = ieee_value(x_sp, ieee_quiet_nan) if (.not. ieee_is_nan(x_sp)) error stop if (x_sp == x_sp) error stop x_sp = ieee_value(x_sp, ieee_positive_zero) if (.not. ieee_is_finite(x_sp)) error stop if (x_sp /= 0.0) error stop x_sp = ieee_value(x_sp, ieee_negative_zero) if (.not. ieee_is_finite(x_sp)) error stop if (x_sp /= 0.0) error stop end if ! --- double precision --- if (ieee_support_datatype(x_dp)) then x_dp = ieee_value(x_dp, ieee_negative_inf) if (.not. ieee_is_negative(x_dp)) error stop if (ieee_is_finite(x_dp)) error stop if (.not. ieee_is_nan(x_dp) .and. x_dp >= 0.0d0) error stop x_dp = ieee_value(x_dp, ieee_positive_inf) if (ieee_is_negative(x_dp)) error stop if (ieee_is_finite(x_dp)) error stop if (.not. ieee_is_nan(x_dp) .and. x_dp <= 0.0d0) error stop x_dp = ieee_value(x_dp, ieee_quiet_nan) if (.not. ieee_is_nan(x_dp)) error stop if (x_dp == x_dp) error stop x_dp = ieee_value(x_dp, ieee_positive_zero) if (.not. ieee_is_finite(x_dp)) error stop if (x_dp /= 0.0d0) error stop x_dp = ieee_value(x_dp, ieee_negative_zero) if (.not. ieee_is_finite(x_dp)) error stop if (x_dp /= 0.0d0) error stop end if end program test_ieee_arithmetic_04 lfortran-0.63.0/integration_tests/read_18.f900000664000175000017500000000130215174404631021124 0ustar alastairalastairprogram read_18 ! Test IOSTAT with END= label interaction implicit none integer :: x, u, ios open(newunit=u, status='scratch') write(u, '(I5)') 123 rewind(u) ! First read should succeed read(u, *, iostat=ios, end=10) x if (ios /= 0) error stop "iostat should be 0 on success" if (x /= 123) error stop "Value should be 123" ! Second read should hit EOF and jump to label read(u, *, iostat=ios, end=10) x error stop "Should have jumped to END label" 10 continue close(u) ! iostat should be negative at EOF if (ios >= 0) error stop "iostat should be negative at EOF" print *, "PASS: IOSTAT + END= interaction works" end program read_18 lfortran-0.63.0/integration_tests/derived_types_60.f900000664000175000017500000000111315174404631023054 0ustar alastairalastairmodule derived_types_60_mod type :: diagnostic_type integer :: x end type diagnostic_type type :: parser_type type(diagnostic_type), allocatable :: diagnostic end type parser_type end module derived_types_60_mod program derived_types_60 use derived_types_60_mod implicit none type(diagnostic_type), allocatable :: diagnostic type(parser_type) :: parser allocate(diagnostic) allocate(parser%diagnostic) parser%diagnostic%x = 2 diagnostic = parser%diagnostic if (diagnostic%x /= 2) error stop end program derived_types_60 lfortran-0.63.0/integration_tests/gpu_metal_110.f900000664000175000017500000000102415174404631022240 0ustar alastairalastairprogram gpu_metal_110 implicit none integer, parameter :: n = 2 real :: a(n, 2), z(n, 2) integer :: i z = reshape([1.0, 2.0, 3.0, 4.0], [n, 2]) do concurrent (i = 1:2) a(1:n, i) = f(z(1:n, i)) end do print *, a(1,1), a(2,1), a(1,2), a(2,2) if (abs(a(1,1) - 2.0) > 1e-6) error stop if (abs(a(2,1) - 4.0) > 1e-6) error stop if (abs(a(1,2) - 6.0) > 1e-6) error stop if (abs(a(2,2) - 8.0) > 1e-6) error stop contains elemental function f(x) result(y) real, intent(in) :: x real :: y y = x * 2.0 end function end program lfortran-0.63.0/integration_tests/class_115.f900000664000175000017500000000077315174404631021407 0ustar alastairalastair! Allocatable class(*) assigned character/string values program class_115 implicit none class(*), allocatable :: obj obj = "hello" select type(obj) type is (character(*)) print *, obj if (obj /= "hello") error stop class default error stop end select obj = "test" select type(obj) type is (character(*)) if (obj /= "test") error stop class default error stop end select print *, "PASS" end program class_115 lfortran-0.63.0/integration_tests/struct_type_01.f900000664000175000017500000000126315174404631022574 0ustar alastairalastairMODULE struct_type_01_module TYPE diag_type INTEGER :: len END TYPE diag_type TYPE(diag_type), DIMENSION(1) :: diag END MODULE struct_type_01_module subroutine set_diag_len(len) USE struct_type_01_module, ONLY: diag INTEGER, INTENT(IN) :: len print *, diag(1)%len if (diag(1)%len /= 10) error stop diag(1)%len = len end subroutine set_diag_len PROGRAM struct_type_01 USE struct_type_01_module, ONLY: diag diag(1)%len = 10 call set_diag_len(20) print *, get_diag_len() if (get_diag_len() /= 20) error stop contains function get_diag_len() result(len) USE struct_type_01_module, ONLY: diag INTEGER :: len len = diag(1)%len end function get_diag_len END PROGRAM struct_type_01 lfortran-0.63.0/integration_tests/block_16.f900000664000175000017500000000116715174404631021312 0ustar alastairalastairmodule block_16_mod implicit none contains subroutine s1(x) real, intent(out) :: x block real :: a(2) = [1.0, 2.0] x = a(1) + a(2) end block end subroutine subroutine s2(x) real, intent(out) :: x block real :: a(3) = [3.0, 4.0, 5.0] x = a(1) + a(2) + a(3) end block end subroutine end module program block_16 use block_16_mod implicit none real :: r1, r2 call s1(r1) call s2(r2) print *, r1, r2 if (abs(r1 - 3.0) > 1e-6) error stop if (abs(r2 - 12.0) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_103.f900000664000175000017500000000111515174404631022243 0ustar alastairalastairprogram gpu_metal_103 implicit none type :: t real :: v(2) end type integer :: i type(t) :: arr(2) real :: res(2, 2) arr(1)%v = [1.0, 2.0] arr(2)%v = [3.0, 4.0] do concurrent (i = 1:2) res(:,i) = get_v(arr(i)) end do if (abs(res(1,1) - 1.0) > 1.0e-6) error stop if (abs(res(2,1) - 2.0) > 1.0e-6) error stop if (abs(res(1,2) - 3.0) > 1.0e-6) error stop if (abs(res(2,2) - 4.0) > 1.0e-6) error stop print *, "PASS" contains pure function get_v(self) result(r) type(t), intent(in) :: self real :: r(2) r = self%v end function end program lfortran-0.63.0/integration_tests/tuple_test_nested_.f900000664000175000017500000000533515174404631023604 0ustar alastairalastairprogram test_tuple_nested implicit none call tuple_nested() contains subroutine tuple_nested() _lfortran_tuple(integer, integer) :: t1 _lfortran_tuple(integer, integer) :: t2 _lfortran_tuple(_lfortran_tuple(integer, integer),_lfortran_tuple(integer, integer), & _lfortran_tuple(integer, integer),_lfortran_tuple(integer, integer)) :: t3 _lfortran_tuple(integer, real, character(len=:)) :: t4 _lfortran_tuple(_lfortran_tuple(integer, real, character(len=:)), integer) :: t5 _lfortran_tuple(_lfortran_tuple(_lfortran_tuple(integer, & real, character(len=:)), integer), real) :: t6 _lfortran_tuple(_lfortran_tuple(integer, integer), & _lfortran_tuple(_lfortran_list(integer), _lfortran_list(character(len=:)))) :: t7 _lfortran_list(_lfortran_tuple(integer, real, _lfortran_tuple(real, integer))) :: l1 integer:: i character(len=:), allocatable :: s t1 = _lfortran_tuple_constant(-1, -2) t2 = _lfortran_tuple_constant(-3, -4) t3 = _lfortran_tuple_constant(t1, t2, t1, t2) if ( .not. (_lfortran_eq(_lfortran_get_item(t3, 0), t1) .and. _lfortran_eq(_lfortran_get_item(t3, 1), t2))) error stop if ( .not. (_lfortran_eq(_lfortran_get_item(t3, 2), t1) .and. _lfortran_eq(_lfortran_get_item(t3, 3), t2))) error stop t4 = _lfortran_tuple_constant(1, 2.0, "abc") t5 = _lfortran_tuple_constant(t4, 3) if ( .not. _lfortran_eq(_lfortran_tuple_constant(_lfortran_tuple_constant(1, 2.0, "abc"), 3), t5) ) error stop t6 = _lfortran_tuple_constant(t5, 4.0) if ( .not. _lfortran_eq(_lfortran_tuple_constant(_lfortran_tuple_constant(t4, 3), 4.0), t6) ) error stop do i=0, 4 call _lfortran_list_append(l1, _lfortran_tuple_constant(i, real(i+1), _lfortran_tuple_constant(real(i+2), i+3))) end do do i=0, 4 if ( .not. _lfortran_eq(_lfortran_get_item(l1, i), & _lfortran_tuple_constant(i, real(i+1), _lfortran_tuple_constant(real(i+2), i+3))) ) error stop end do i = 3 s = "a" t7 = _lfortran_tuple_constant(t1, _lfortran_tuple_constant(_lfortran_list_constant(i, i+1, i+2), & _lfortran_list_constant(s, repeat(s, 2), repeat(s, 3)))) if ( .not. _lfortran_eq(t7, _lfortran_tuple_constant(_lfortran_tuple_constant(-1, -2), _lfortran_tuple_constant( & _lfortran_list_constant(3, 4, 5), _lfortran_list_constant('a', 'aa', 'aaa')))) ) error stop end subroutine end program test_tuple_nested lfortran-0.63.0/integration_tests/arrays_20.f900000664000175000017500000000053715174404631021514 0ustar alastairalastairprogram arrays_20 implicit none integer, allocatable :: list_integer(:) logical, allocatable :: list_logical(:) character(len=5), allocatable :: list_character(:) list_integer = [integer ::] list_logical = [logical ::] list_character = [character(len=len(list_character)) ::] end program arrays_20 lfortran-0.63.0/integration_tests/select_type_40.f900000664000175000017500000000137015174404631022531 0ustar alastairalastair! Test: using select type twice on the same class(*) allocatable array ! preserves data written in the first block. program select_type_40 implicit none class(*), allocatable :: v(:) ! Test with integer allocate(integer :: v(2)) select type (v) type is (integer) v(1) = 42 v(2) = 7 end select select type (v) type is (integer) if (v(1) /= 42) error stop if (v(2) /= 7) error stop end select deallocate(v) ! Test with real allocate(real :: v(1)) select type (v) type is (real) v(1) = 3.14 end select select type (v) type is (real) if (abs(v(1) - 3.14) > 1.0e-5) error stop end select deallocate(v) print *, "PASS" end program lfortran-0.63.0/integration_tests/pass_array_by_data_07.f900000664000175000017500000000151715174404631024046 0ustar alastairalastairmodule pass_array_by_data_07_module implicit none contains function gdef(x) real, intent(in) :: x(:) real :: gdef(size(x)) gdef = x + 1.0 end function end module program pass_array_by_data_07 use pass_array_by_data_07_module, only: gdef implicit none real :: array(10) array = 2.0 print *, f(gdef1, array) if( f(gdef1, array) /= 20.0 ) error stop print *, f(gdef, array) if( f(gdef, array) /= 40.0 ) error stop contains function f(g, array) result(s) real, intent(in) :: array(:) real :: s interface function g(x) real, intent(in) :: x(:) real :: g(size(x)) end function end interface real :: array1(size(array)) array1 = array + 1.0 array1 = g(array1) s = sum(array1) end function function gdef1(x) real, intent(in) :: x(:) real :: gdef1(size(x)) gdef1 = x - 1.0 end function end program lfortran-0.63.0/integration_tests/bindc_03.f900000664000175000017500000000154415174404631021272 0ustar alastairalastairsubroutine fn() bind(c) print *, "Hello from fn in fortran" end subroutine subroutine test_val( val ) bind(c) use iso_c_binding integer(c_int), value :: val print *, "val = ", val if ( val /= 42 ) error stop end subroutine program bindc_03 use iso_c_binding implicit none interface subroutine fn() bind(c) end subroutine subroutine test_val( val ) bind(c) import :: c_int integer(c_int), value :: val end subroutine subroutine execute_function( fn ) bind(c, name = "execute_function") import :: c_funptr type(c_funptr), value :: fn end subroutine subroutine execute_function_with_arg( fn, val ) bind(c, name = "execute_function_with_arg") import :: c_funptr, c_int integer(c_int), value :: val type(c_funptr), value :: fn end subroutine end interface call execute_function( c_funloc( fn ) ) call execute_function_with_arg( c_funloc( test_val ), 42 ) end program lfortran-0.63.0/integration_tests/array_section_02.f900000664000175000017500000000070215174404631023047 0ustar alastairalastairprogram expr2 implicit none integer :: r(4), i, tmp r = 17 r(:2) = func(r(:3)) tmp = 2 do i = 1, size(r) if (i > 2) tmp = 1 if (r(i) /= tmp * 17) error stop end do contains function func(input) result(output) integer, intent(inout) :: input(:) integer :: output(size(input)-1) output = 2*input(:2) if (size(output) /= 2) error stop end function func end program lfortran-0.63.0/integration_tests/intrinsics_126.f900000664000175000017500000000050515174404631022462 0ustar alastairalastairprogram intrinsic_126 implicit none integer :: arg = 0 real :: num1, num2 call system_clock(arg) call srand(arg) call random_number(num1) call random_number(num2) print *, arg, num1, num2 ! Ensure num1 and num2 are different if (abs(num1 - num2) <= 1e-8) error stop end program lfortran-0.63.0/integration_tests/openmp_15.f900000664000175000017500000000263615174404631021517 0ustar alastairalastairsubroutine initialize_array(n, a) use omp_lib implicit none integer, intent(in) :: n real, dimension(n), intent(out) :: a integer :: i !$omp parallel !$omp do do i = 1, n a(i) = 12.91 end do !$omp end do !$omp end parallel print *, a(1), a(n) end subroutine subroutine parallel_sum(n, a, ctr) use omp_lib implicit none integer, intent(in) :: n, ctr real, dimension(n), intent(in) :: a integer :: i real :: sum sum = 0.0 !$omp parallel do reduction(+:sum) do i = 1, n sum = sum + a(i) end do !$omp end parallel do ! here we have precision error both with gfortran and lfortran ! setting different number of threads leads to different results ! but in any case output of gfortran and lfortran is the same print *, sum if ( ctr == 1 ) then if (abs(sum - 12933994.0) > 1e-7) error stop else ! if (abs(sum - 25867988.0) > 1e-7) error stop ! lfortran always gives 2.58679600e+07 end if end subroutine subroutine reduce_array(n, a, b) implicit none integer, intent(in) :: n real, dimension(n), intent(in) :: a real, dimension(n) :: b integer :: i !$omp parallel do do i = 2, n b(i) = a(i) + a(i-1) end do !$omp end parallel do b(1) = a(1) * 2 end subroutine program openmp_15 use omp_lib integer, parameter :: n = 1000000 real, dimension(n) :: a, b call omp_set_num_threads(4) call initialize_array(n, a) print *, a(1), a(n) call parallel_sum(n, a, 1) call reduce_array(n, a, b) call parallel_sum(n, b, 0) end program lfortran-0.63.0/integration_tests/arrays_08_func.f900000664000175000017500000000112615174404631022530 0ustar alastairalastairprogram arrays_08_func implicit none integer :: x(10), y(10), i logical :: r do i = 1, size(x) x(i) = i end do call copy_from_to(x, y) r = verify(x, y) print *, r if (.not. r) error stop contains subroutine copy_from_to(a, b) integer, intent(in) :: a(:) integer, intent(out) :: b(:) integer :: i do i = 1, size(a) b(i) = a(i) end do end subroutine logical function verify(a, b) result(r) integer, intent(in) :: a(:), b(:) integer :: i r = .true. do i = 1, size(a) r = r .and. (a(i) .eq. b(i)) end do end function end lfortran-0.63.0/integration_tests/struct_type_12.f900000664000175000017500000000350615174404631022600 0ustar alastairalastairmodule struct_type_12_int_module implicit none integer, parameter :: k = 4 type ty_int integer(k) :: k = 42_k end type end module module struct_type_12_complex_module implicit none integer, parameter :: q = selected_real_kind(10) type ty_complex complex(q) :: q = (1.0_q, 2.0_q) end type end module module struct_type_12_char_module implicit none integer, parameter :: c = selected_char_kind('ASCII') type ty_char character(kind=c, len=5) :: c = 'hello' end type end module module struct_type_12_logical_module implicit none integer, parameter :: l = 4 type ty_logical logical(l) :: l = .true. end type end module module struct_type_12_real_module implicit none integer, parameter :: q = selected_real_kind(10) type ty_real real(q) :: q = 1._q end type end module program struct_type_12 use struct_type_12_int_module use struct_type_12_complex_module, ty_complex => ty_complex use struct_type_12_char_module, ty_char => ty_char use struct_type_12_logical_module, ty_logical => ty_logical use struct_type_12_real_module, ty_real => ty_real implicit none type(ty_int) :: t_int type(ty_complex) :: t_complex type(ty_char) :: t_char type(ty_logical) :: t_logical type(ty_real) :: t_real if (t_int%k /= 42) error stop "integer kind shadow: value incorrect" if (real(t_complex%q) /= 1.0 .or. aimag(t_complex%q) /= 2.0) & error stop "complex kind shadow: value incorrect" if (t_char%c /= 'hello') error stop "char kind shadow: value incorrect" if (.not. t_logical%l) error stop "logical kind shadow: value incorrect" if (t_real%q /= 1.0) error stop "real kind shadow: value incorrect" print *, "all tests passed" end program struct_type_12lfortran-0.63.0/integration_tests/derived_types_04.f900000664000175000017500000000101215174404631023050 0ustar alastairalastairmodule derived_types_04_bitset type, abstract :: bitset_type private integer(8) :: num_bits contains procedure(all_abstract), deferred, pass(self) :: all end type bitset_type abstract interface elemental function all_abstract( self ) result(all) import :: bitset_type logical :: all class(bitset_type), intent(in) :: self end function all_abstract end interface end module program debug implicit none end program lfortran-0.63.0/integration_tests/class_allocate_02.f900000664000175000017500000000102115174404631023151 0ustar alastairalastairprogram class_allocate_02 implicit none type dummy_type integer(1), allocatable :: value(:) end type dummy_type class(*), allocatable :: dummy type(dummy_type) :: dummy_val allocate(dummy_val % value(1)) allocate(dummy, source=dummy_val) print * , allocated(dummy) if (allocated(dummy) .neqv. .true.) error stop !select type(d => dummy) !type is (dummy_type) ! print *, size(d % value) ! if (size(d % value) /= 1) error stop !end select end program lfortran-0.63.0/integration_tests/bindc_02.f900000664000175000017500000000025015174404631021262 0ustar alastairalastair! Tests c_ptr passing and calling as an argument program bindc_02 use bindc_02b, only: driver implicit none print *, "Main program: calling driver()" call driver() end lfortran-0.63.0/integration_tests/lfortran_intrinsic_sin_c.c0000664000175000017500000003306615174404631024625 0ustar alastairalastair#include #define __HI(x) *(1+(int*)&x) #define __LO(x) *(int*)&x /* @(#)k_rem_pio2.c 1.3 95/01/18 */ /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. * * Developed at SunSoft, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this * software is freely granted, provided that this notice * is preserved. * ==================================================== */ /* * __kernel_rem_pio2(x,y,e0,nx,prec,ipio2) * double x[],y[]; int e0,nx,prec; int ipio2[]; * * __kernel_rem_pio2 return the last three digits of N with * y = x - N*pi/2 * so that |y| < pi/2. * * The method is to compute the integer (mod 8) and fraction parts of * (2/pi)*x without doing the full multiplication. In general we * skip the part of the product that are known to be a huge integer ( * more accurately, = 0 mod 8 ). Thus the number of operations are * independent of the exponent of the input. * * (2/pi) is represented by an array of 24-bit integers in ipio2[]. * * Input parameters: * x[] The input value (must be positive) is broken into nx * pieces of 24-bit integers in double precision format. * x[i] will be the i-th 24 bit of x. The scaled exponent * of x[0] is given in input parameter e0 (i.e., x[0]*2^e0 * match x's up to 24 bits. * * Example of breaking a double positive z into x[0]+x[1]+x[2]: * e0 = ilogb(z)-23 * z = scalbn(z,-e0) * for i = 0,1,2 * x[i] = floor(z) * z = (z-x[i])*2**24 * * * y[] ouput result in an array of double precision numbers. * The dimension of y[] is: * 24-bit precision 1 * 53-bit precision 2 * 64-bit precision 2 * 113-bit precision 3 * The actual value is the sum of them. Thus for 113-bit * precison, one may have to do something like: * * long double t,w,r_head, r_tail; * t = (long double)y[2] + (long double)y[1]; * w = (long double)y[0]; * r_head = t+w; * r_tail = w - (r_head - t); * * e0 The exponent of x[0] * * nx dimension of x[] * * prec an integer indicating the precision: * 0 24 bits (single) * 1 53 bits (double) * 2 64 bits (extended) * 3 113 bits (quad) * * ipio2[] * integer array, contains the (24*i)-th to (24*i+23)-th * bit of 2/pi after binary point. The corresponding * floating value is * * ipio2[i] * 2^(-24(i+1)). * * External function: * double scalbn(), floor(); * * * Here is the description of some local variables: * * jk jk+1 is the initial number of terms of ipio2[] needed * in the computation. The recommended value is 2,3,4, * 6 for single, double, extended,and quad. * * jz local integer variable indicating the number of * terms of ipio2[] used. * * jx nx - 1 * * jv index for pointing to the suitable ipio2[] for the * computation. In general, we want * ( 2^e0*x[0] * ipio2[jv-1]*2^(-24jv) )/8 * is an integer. Thus * e0-3-24*jv >= 0 or (e0-3)/24 >= jv * Hence jv = max(0,(e0-3)/24). * * jp jp+1 is the number of terms in PIo2[] needed, jp = jk. * * q[] double array with integral value, representing the * 24-bits chunk of the product of x and 2/pi. * * q0 the corresponding exponent of q[0]. Note that the * exponent for q[i] would be q0-24*i. * * PIo2[] double precision array, obtained by cutting pi/2 * into 24 bits chunks. * * f[] ipio2[] in floating point * * iq[] integer array by breaking up q[] in 24-bits chunk. * * fq[] final product of x*(2/pi) in fq[0],..,fq[jk] * * ih integer. If >0 it indicates q[] is >= 0.5, hence * it also indicates the *sign* of the result. * */ /* * Constants: * The hexadecimal values are the intended ones for the following * constants. The decimal values may be used, provided that the * compiler will convert from decimal to binary accurately enough * to produce the hexadecimal values shown. */ //#include "fdlibm.h" #ifdef __STDC__ static const int init_jk[] = {2,3,4,6}; /* initial value for jk */ #else static int init_jk[] = {2,3,4,6}; #endif #ifdef __STDC__ static const double PIo2[] = { #else static double PIo2[] = { #endif 1.57079625129699707031e+00, /* 0x3FF921FB, 0x40000000 */ 7.54978941586159635335e-08, /* 0x3E74442D, 0x00000000 */ 5.39030252995776476554e-15, /* 0x3CF84698, 0x80000000 */ 3.28200341580791294123e-22, /* 0x3B78CC51, 0x60000000 */ 1.27065575308067607349e-29, /* 0x39F01B83, 0x80000000 */ 1.22933308981111328932e-36, /* 0x387A2520, 0x40000000 */ 2.73370053816464559624e-44, /* 0x36E38222, 0x80000000 */ 2.16741683877804819444e-51, /* 0x3569F31D, 0x00000000 */ }; #ifdef __STDC__ static const double #else static double #endif zero = 0.0, one = 1.0, two24 = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */ twon24 = 5.96046447753906250000e-08; /* 0x3E700000, 0x00000000 */ #ifdef __STDC__ int __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec, const int *ipio2) #else int __kernel_rem_pio2(x,y,e0,nx,prec,ipio2) double x[], y[]; int e0,nx,prec; int ipio2[]; #endif { int jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih; double z,fw,f[20],fq[20],q[20]; /* initialize jk*/ jk = init_jk[prec]; jp = jk; /* determine jx,jv,q0, note that 3>q0 */ jx = nx-1; jv = (e0-3)/24; if(jv<0) jv=0; q0 = e0-24*(jv+1); /* set up f[0] to f[jx+jk] where f[jx+jk] = ipio2[jv+jk] */ j = jv-jx; m = jx+jk; for(i=0;i<=m;i++,j++) f[i] = (j<0)? zero : (double) ipio2[j]; /* compute q[0],q[1],...q[jk] */ for (i=0;i<=jk;i++) { for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw; } jz = jk; recompute: /* distill q[] into iq[] reversingly */ for(i=0,j=jz,z=q[jz];j>0;i++,j--) { fw = (double)((int)(twon24* z)); iq[i] = (int)(z-two24*fw); z = q[j-1]+fw; } /* compute n */ z = scalbn(z,q0); /* actual value of z */ z -= 8.0*floor(z*0.125); /* trim off integer >= 8 */ n = (int) z; z -= (double)n; ih = 0; if(q0>0) { /* need iq[jz-1] to determine n */ i = (iq[jz-1]>>(24-q0)); n += i; iq[jz-1] -= i<<(24-q0); ih = iq[jz-1]>>(23-q0); } else if(q0==0) ih = iq[jz-1]>>23; else if(z>=0.5) ih=2; if(ih>0) { /* q > 0.5 */ n += 1; carry = 0; for(i=0;i0) { /* rare case: chance is 1 in 12 */ switch(q0) { case 1: iq[jz-1] &= 0x7fffff; break; case 2: iq[jz-1] &= 0x3fffff; break; } } if(ih==2) { z = one - z; if(carry!=0) z -= scalbn(one,q0); } } /* check if recomputation is needed */ if(z==zero) { j = 0; for (i=jz-1;i>=jk;i--) j |= iq[i]; if(j==0) { /* need recomputation */ for(k=1;iq[jk-k]==0;k++); /* k = no. of terms needed */ for(i=jz+1;i<=jz+k;i++) { /* add q[jz+1] to q[jz+k] */ f[jx+i] = (double) ipio2[jv+i]; for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw; } jz += k; goto recompute; } } /* chop off zero terms */ if(z==0.0) { jz -= 1; q0 -= 24; while(iq[jz]==0) { jz--; q0-=24;} } else { /* break z into 24-bit if necessary */ z = scalbn(z,-q0); if(z>=two24) { fw = (double)((int)(twon24*z)); iq[jz] = (int)(z-two24*fw); jz += 1; q0 += 24; iq[jz] = (int) fw; } else iq[jz] = (int) z ; } /* convert integer "bit" chunk to floating-point value */ fw = scalbn(one,q0); for(i=jz;i>=0;i--) { q[i] = fw*(double)iq[i]; fw*=twon24; } /* compute PIo2[0,...,jp]*q[jz,...,0] */ for(i=jz;i>=0;i--) { for(fw=0.0,k=0;k<=jp&&k<=jz-i;k++) fw += PIo2[k]*q[i+k]; fq[jz-i] = fw; } /* compress fq[] into y[] */ switch(prec) { case 0: fw = 0.0; for (i=jz;i>=0;i--) fw += fq[i]; y[0] = (ih==0)? fw: -fw; break; case 1: case 2: fw = 0.0; for (i=jz;i>=0;i--) fw += fq[i]; y[0] = (ih==0)? fw: -fw; fw = fq[0]-fw; for (i=1;i<=jz;i++) fw += fq[i]; y[1] = (ih==0)? fw: -fw; break; case 3: /* painful */ for (i=jz;i>0;i--) { fw = fq[i-1]+fq[i]; fq[i] += fq[i-1]-fw; fq[i-1] = fw; } for (i=jz;i>1;i--) { fw = fq[i-1]+fq[i]; fq[i] += fq[i-1]-fw; fq[i-1] = fw; } for (fw=0.0,i=jz;i>=2;i--) fw += fq[i]; if(ih==0) { y[0] = fq[0]; y[1] = fq[1]; y[2] = fw; } else { y[0] = -fq[0]; y[1] = -fq[1]; y[2] = -fw; } } return n&7; } /* @(#)e_rem_pio2.c 1.4 95/01/18 */ /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. * * Developed at SunSoft, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this * software is freely granted, provided that this notice * is preserved. * ==================================================== * */ /* __ieee754_rem_pio2(x,y) * * return the remainder of x rem pi/2 in y[0]+y[1] * use __kernel_rem_pio2() */ //#include "fdlibm.h" /* * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi */ #ifdef __STDC__ static const int two_over_pi[] = { #else static int two_over_pi[] = { #endif 0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1, 0xF534DD, 0xC0DB62, 0x95993C, 0x439041, 0xFE5163, 0xABDEBB, 0xC561B7, 0x246E3A, 0x424DD2, 0xE00649, 0x2EEA09, 0xD1921C, 0xFE1DEB, 0x1CB129, 0xA73EE8, 0x8235F5, 0x2EBB44, 0x84E99C, 0x7026B4, 0x5F7E41, 0x3991D6, 0x398353, 0x39F49C, 0x845F8B, 0xBDF928, 0x3B1FF8, 0x97FFDE, 0x05980F, 0xEF2F11, 0x8B5A0A, 0x6D1F6D, 0x367ECF, 0x27CB09, 0xB74F46, 0x3F669E, 0x5FEA2D, 0x7527BA, 0xC7EBE5, 0xF17B3D, 0x0739F7, 0x8A5292, 0xEA6BFB, 0x5FB11F, 0x8D5D08, 0x560330, 0x46FC7B, 0x6BABF0, 0xCFBC20, 0x9AF436, 0x1DA9E3, 0x91615E, 0xE61B08, 0x659985, 0x5F14A0, 0x68408D, 0xFFD880, 0x4D7327, 0x310606, 0x1556CA, 0x73A8C9, 0x60E27B, 0xC08C6B, }; #ifdef __STDC__ static const int npio2_hw[] = { #else static int npio2_hw[] = { #endif 0x3FF921FB, 0x400921FB, 0x4012D97C, 0x401921FB, 0x401F6A7A, 0x4022D97C, 0x4025FDBB, 0x402921FB, 0x402C463A, 0x402F6A7A, 0x4031475C, 0x4032D97C, 0x40346B9C, 0x4035FDBB, 0x40378FDB, 0x403921FB, 0x403AB41B, 0x403C463A, 0x403DD85A, 0x403F6A7A, 0x40407E4C, 0x4041475C, 0x4042106C, 0x4042D97C, 0x4043A28C, 0x40446B9C, 0x404534AC, 0x4045FDBB, 0x4046C6CB, 0x40478FDB, 0x404858EB, 0x404921FB, }; /* * invpio2: 53 bits of 2/pi * pio2_1: first 33 bit of pi/2 * pio2_1t: pi/2 - pio2_1 * pio2_2: second 33 bit of pi/2 * pio2_2t: pi/2 - (pio2_1+pio2_2) * pio2_3: third 33 bit of pi/2 * pio2_3t: pi/2 - (pio2_1+pio2_2+pio2_3) */ #ifdef __STDC__ static const double #else static double #endif //zero = 0.00000000000000000000e+00, /* 0x00000000, 0x00000000 */ half = 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */ //two24 = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */ invpio2 = 6.36619772367581382433e-01, /* 0x3FE45F30, 0x6DC9C883 */ pio2_1 = 1.57079632673412561417e+00, /* 0x3FF921FB, 0x54400000 */ pio2_1t = 6.07710050650619224932e-11, /* 0x3DD0B461, 0x1A626331 */ pio2_2 = 6.07710050630396597660e-11, /* 0x3DD0B461, 0x1A600000 */ pio2_2t = 2.02226624879595063154e-21, /* 0x3BA3198A, 0x2E037073 */ pio2_3 = 2.02226624871116645580e-21, /* 0x3BA3198A, 0x2E000000 */ pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */ #ifdef __STDC__ int ieee754_rem_pio2(double x, double *y) #else int __ieee754_rem_pio2(x,y) double x,y[]; #endif { double z,w,t,r,fn; double tx[3]; int e0,i,j,nx,n,ix,hx; hx = __HI(x); /* high word of x */ ix = hx&0x7fffffff; if(ix<=0x3fe921fb) /* |x| ~<= pi/4 , no need for reduction */ {y[0] = x; y[1] = 0; return 0;} if(ix<0x4002d97c) { /* |x| < 3pi/4, special case with n=+-1 */ if(hx>0) { z = x - pio2_1; if(ix!=0x3ff921fb) { /* 33+53 bit pi is good enough */ y[0] = z - pio2_1t; y[1] = (z-y[0])-pio2_1t; } else { /* near pi/2, use 33+33+53 bit pi */ z -= pio2_2; y[0] = z - pio2_2t; y[1] = (z-y[0])-pio2_2t; } return 1; } else { /* negative x */ z = x + pio2_1; if(ix!=0x3ff921fb) { /* 33+53 bit pi is good enough */ y[0] = z + pio2_1t; y[1] = (z-y[0])+pio2_1t; } else { /* near pi/2, use 33+33+53 bit pi */ z += pio2_2; y[0] = z + pio2_2t; y[1] = (z-y[0])+pio2_2t; } return -1; } } if(ix<=0x413921fb) { /* |x| ~<= 2^19*(pi/2), medium size */ t = fabs(x); n = (int) (t*invpio2+half); fn = (double)n; r = t-fn*pio2_1; w = fn*pio2_1t; /* 1st round good to 85 bit */ if(n<32&&ix!=npio2_hw[n-1]) { y[0] = r-w; /* quick check no cancellation */ } else { j = ix>>20; y[0] = r-w; i = j-(((__HI(y[0]))>>20)&0x7ff); if(i>16) { /* 2nd iteration needed, good to 118 */ t = r; w = fn*pio2_2; r = t-w; w = fn*pio2_2t-((t-r)-w); y[0] = r-w; i = j-(((__HI(y[0]))>>20)&0x7ff); if(i>49) { /* 3rd iteration need, 151 bits acc */ t = r; /* will cover all possible cases */ w = fn*pio2_3; r = t-w; w = fn*pio2_3t-((t-r)-w); y[0] = r-w; } } } y[1] = (r-y[0])-w; if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;} else return n; } /* * all other (large) arguments */ if(ix>=0x7ff00000) { /* x is inf or NaN */ y[0]=y[1]=x-x; return 0; } /* set z = scalbn(|x|,ilogb(x)-23) */ __LO(z) = __LO(x); e0 = (ix>>20)-1046; /* e0 = ilogb(z)-23; */ __HI(z) = ix - (e0<<20); for(i=0;i<2;i++) { tx[i] = (double)((int)(z)); z = (z-tx[i])*two24; } tx[2] = z; nx = 3; while(tx[nx-1]==zero) nx--; /* skip zero term */ n = __kernel_rem_pio2(tx,y,e0,nx,2,two_over_pi); if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;} return n; } lfortran-0.63.0/integration_tests/gpu_metal_60.f900000664000175000017500000000411215174404631022165 0ustar alastairalastair! Test: gpu_offload pass with submodule type-bound procedure call ! inside do concurrent with nested associate and block constructs. ! Exercises: (1) import_struct_type scope resolution for ExternalSymbols ! in associate blocks, (2) GpuFunctionCollector descending into Block ! bodies, (3) importing submodule function implementations into GPU ! kernel scope. module gpu_metal_60_activation_mod implicit none type :: activation_t integer :: selection_ = 1 contains procedure, non_overridable, private :: default_real_differentiate generic :: differentiate => default_real_differentiate end type interface elemental module function default_real_differentiate(self, x) result(dy_dx) class(activation_t), intent(in) :: self real, intent(in) :: x real :: dy_dx end function end interface end module gpu_metal_60_activation_mod submodule(gpu_metal_60_activation_mod) gpu_metal_60_activation_sub implicit none contains module procedure default_real_differentiate dy_dx = x * 2.0 + 1.0 end procedure end submodule gpu_metal_60_activation_sub module gpu_metal_60_network_mod use gpu_metal_60_activation_mod, only : activation_t implicit none contains subroutine train(act, result_arr) type(activation_t), intent(in) :: act real, intent(inout) :: result_arr(:) integer :: pair real :: x x = 1.0 associate(b => x) do concurrent (pair = 1:2) block real delta associate(y => result_arr) delta = act%differentiate(1.0) end associate result_arr(pair) = delta end block end do end associate end subroutine end module gpu_metal_60_network_mod program gpu_metal_60 use gpu_metal_60_network_mod use gpu_metal_60_activation_mod, only : activation_t implicit none type(activation_t) :: act real :: results(2) results = 0.0 call train(act, results) ! default_real_differentiate(1.0) = 1.0 * 2.0 + 1.0 = 3.0 if (abs(results(1) - 3.0) > 1.0e-6) error stop if (abs(results(2) - 3.0) > 1.0e-6) error stop print *, "PASS" end program gpu_metal_60 lfortran-0.63.0/integration_tests/procedure_22.f900000664000175000017500000000024015174404631022174 0ustar alastairalastairprogram procedure_22 use procedure_22_mod_b type(deps_t) :: temp_dpt temp_dpt%str = "Hello " if (func(temp_dpt) /= 5) error stop end programlfortran-0.63.0/integration_tests/gpu_metal_07.f900000664000175000017500000000065215174404631022173 0ustar alastairalastairprogram gpu_metal_07 ! Element-wise math: sqrt and abs implicit none integer, parameter :: n = 10000 real :: x(n), y(n), y_expected(n) integer :: i do i = 1, n x(i) = real(i) y_expected(i) = sqrt(real(i)) + abs(real(i) - 5000.0) end do do concurrent (i = 1:n) y(i) = sqrt(x(i)) + abs(x(i) - 5000.0) end do do i = 1, n if (abs(y(i) - y_expected(i)) > 1.0e-3) error stop end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/separate_compilation_43.f900000664000175000017500000000022115174404631024410 0ustar alastairalastairprogram separate_compilation_43 use separate_compilation_43b_module implicit none print *, "ok" end program separate_compilation_43 lfortran-0.63.0/integration_tests/file_21_data.txt0000664000175000017500000000000515174404631022333 0ustar alastairalastairab cdlfortran-0.63.0/integration_tests/openmp_34.f900000664000175000017500000000070115174404631021507 0ustar alastairalastairsubroutine omp_func(n) use omp_lib implicit none integer, intent(in) :: n integer :: i call omp_set_num_threads(5) !$omp parallel private(i) shared(n) !$omp do do i = 1, n !omp critical print *,omp_get_thread_num() print *, "xyz" end do !$omp end do !$omp end parallel print *, "n = ", n if (n /= 10) error stop end subroutine program openmp_34 integer, parameter :: n = 10 call omp_func(n) print *, "Done for n = ", n end programlfortran-0.63.0/integration_tests/arrays_reshape_42.f900000664000175000017500000000060415174404631023222 0ustar alastairalastairsubroutine test_sub(x, n, y) integer, intent(in) :: n real, intent(in) :: x(n, n) real, intent(out) :: y(n, n) y = reshape(reshape(x, [n*n]), [n, n]) end subroutine program main implicit none real :: x(2,2), y(2,2) x = reshape([1.0, 2.0, 3.0, 4.0], [2, 2]) call test_sub(x, 2, y) if (any(y /= x)) error stop print *, "OK" end programlfortran-0.63.0/integration_tests/print_arr_08.f900000664000175000017500000000724315174404631022222 0ustar alastairalastair! Non-Unit Stride Access in Print Statements ! Testing various array section prints for 2D and 3D arrays, ! Including multi-dimensional slices and complete array prints. ! Test using write statements with string comparison. program print_arr_08 implicit none integer :: list_2d(2,3) integer :: list_3d(3,3,3) character(len=100) :: str1 !Test 2D Array Section !Assign Row Values list_2d(1,:) = [2,2,2] list_2d(2,:) = [3,3,3] !Row-Access: concatenate arrays to print on one line write(str1, "(6(1X,I0))") [list_2d(1,:), list_2d(2,:)] print "(6(1X,I0))", [list_2d(1,:), list_2d(2,:)] if (trim(str1) /= " 2 2 2 3 3 3") error stop !Column-Access: concatenate arrays to print on one line write(str1, "(6(1X,I0))") [list_2d(:,1), list_2d(:,2), list_2d(:,3)] print "(6(1X,I0))", [list_2d(:,1), list_2d(:,2), list_2d(:,3)] if (trim(str1) /= " 2 3 2 3 2 3") error stop !Test 3D Array Section list_3d(1,:,1) = [4,4,4] list_3d(1,:,2) = [5,5,5] list_3d(1,:,3) = [6,6,6] list_3d(2,:,1) = [7,7,7] list_3d(2,:,2) = [8,8,8] list_3d(2,:,3) = [9,9,9] list_3d(3,:,1) = [10,10,10] list_3d(3,:,2) = [11,11,11] list_3d(3,:,3) = [12,12,12] !Dim1-Access write(str1, "(9(1X,I0))") [list_3d(:,1,1), list_3d(:,1,2), list_3d(:,1,3)] print "(9(1X,I0))", [list_3d(:,1,1), list_3d(:,1,2), list_3d(:,1,3)] if (trim(str1) /= " 4 7 10 5 8 11 6 9 12") error stop write(str1, "(9(1X,I0))") [list_3d(:,2,1), list_3d(:,2,2), list_3d(:,2,3)] print "(9(1X,I0))", [list_3d(:,2,1), list_3d(:,2,2), list_3d(:,2,3)] if (trim(str1) /= " 4 7 10 5 8 11 6 9 12") error stop !Dim2-Access write(str1, "(9(1X,I0))") [list_3d(1,:,1), list_3d(1,:,2), list_3d(1,:,3)] print "(9(1X,I0))", [list_3d(1,:,1), list_3d(1,:,2), list_3d(1,:,3)] if (trim(str1) /= " 4 4 4 5 5 5 6 6 6") error stop write(str1, "(9(1X,I0))") [list_3d(2,:,1), list_3d(2,:,2), list_3d(2,:,3)] print "(9(1X,I0))", [list_3d(2,:,1), list_3d(2,:,2), list_3d(2,:,3)] if (trim(str1) /= " 7 7 7 8 8 8 9 9 9") error stop !Dim3-Access write(str1, "(9(1X,I0))") [list_3d(1,1,:), list_3d(1,2,:), list_3d(1,3,:)] print "(9(1X,I0))", [list_3d(1,1,:), list_3d(1,2,:), list_3d(1,3,:)] if (trim(str1) /= " 4 5 6 4 5 6 4 5 6") error stop write(str1, "(9(1X,I0))") [list_3d(2,1,:), list_3d(2,2,:), list_3d(2,3,:)] print "(9(1X,I0))", [list_3d(2,1,:), list_3d(2,2,:), list_3d(2,3,:)] if (trim(str1) /= " 7 8 9 7 8 9 7 8 9") error stop !2D Access write(str1, "(27(1X,I0))") [list_3d(:,:,1), list_3d(:,:,2), list_3d(:,:,3)] print "(27(1X,I0))", [list_3d(:,:,1), list_3d(:,:,2), list_3d(:,:,3)] if (trim(str1) /= " 4 7 10 4 7 10 4 7 10 5 8 11 5 8 11 5 8 11 6 9 12 6 9 12 6 9 12") error stop write(str1, "(27(1X,I0))") [list_3d(:,1,:), list_3d(:,2,:), list_3d(:,3,:)] print "(27(1X,I0))", [list_3d(:,1,:), list_3d(:,2,:), list_3d(:,3,:)] if (trim(str1) /= " 4 7 10 5 8 11 6 9 12 4 7 10 5 8 11 6 9 12 4 7 10 5 8 11 6 9 12") error stop write(str1, "(27(1X,I0))") [list_3d(1,:,:), list_3d(2,:,:), list_3d(3,:,:)] print "(27(1X,I0))", [list_3d(1,:,:), list_3d(2,:,:), list_3d(3,:,:)] if (trim(str1) /= " 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8 9 9 9 10 10 10 11 11 11 12 12 12") error stop !Access a continuous subset of values write(str1, "(8(1X,I0))") [list_3d(1:2,1:2,1:2)] print "(8(1X,I0))", [list_3d(1:2,1:2,1:2)] if (trim(str1) /= " 4 7 4 7 5 8 5 8") error stop write(str1, "(12(1X,I0))") [list_3d(2:3,2:3,:)] print "(12(1X,I0))", [list_3d(2:3,2:3,:)] if (trim(str1) /= " 7 10 7 10 8 11 8 11 9 12 9 12") error stop write(str1, "(12(1X,I0))") [list_3d(2:3,1:2,2:3)] print "(12(1X,I0))", [list_3d(2:3,1:2,2:3)] if (trim(str1) /= " 8 11 8 11 9 12 9 12") error stop print *, "All tests passed!" end program print_arr_08lfortran-0.63.0/integration_tests/read_38.f900000664000175000017500000000062315174404631021133 0ustar alastairalastairprogram read_38 implicit none character(len=20) :: s1, s2 complex :: c32 complex(8) :: c64 s1 = "(1.0, 2.0)" s2 = "(3.0d0, 4.0d0)" read(s1, *) c32 read(s2, *) c64 if (abs(real(c32) - 1.0) > 1e-6) error stop if (abs(aimag(c32) - 2.0) > 1e-6) error stop if (abs(real(c64) - 3.0d0) > 1d-12) error stop if (abs(aimag(c64) - 4.0d0) > 1d-12) error stop print *, "OK" end program lfortran-0.63.0/integration_tests/read_76.f900000664000175000017500000000205015174404631021131 0ustar alastairalastairprogram read_76 implicit none double precision :: d1, d2, d3 complex :: c1, c2 open (42, file='read_76.dat', status='replace', form='formatted') write (42,'(a)') '1.0D0 (2.0, 2.0) 3.0D0 (4.0, 4.0) 5.0D0' write (42,'(a)') '6.0D0 (7.0, 7.0) / 8.0D0 (9.0, 9.0) 10.0D0' rewind (42) d1 = -1.0d0 c1 = (-2.0, -3.0) d2 = -3.0d0 c2 = (-4.0, -5.0) d3 = -5.0d0 read (42, *) d1, c1, d2, c2, d3 ! Slash should terminate assignment for the remaining items in this READ. d1 = -1.0d0 c1 = (-2.0, -3.0) d2 = -3.0d0 c2 = (-4.0, -5.0) d3 = -5.0d0 read (42, *) d1, c1, d2, c2, d3 if (abs(d1 - 6.0d0) > 0.0001d0) error stop 'd1 failed' if (abs(real(c1) - 7.0) > 0.0001 .or. abs(aimag(c1) - 7.0) > 0.0001) error stop 'c1 failed' if (abs(d2 + 3.0d0) > 0.0001d0) error stop 'd2 failed' if (abs(real(c2) + 4.0) > 0.0001 .or. abs(aimag(c2) + 5.0) > 0.0001) error stop 'c2 failed' if (abs(d3 + 5.0d0) > 0.0001d0) error stop 'd3 failed' close (42, status='delete') print *, 'ok' end program lfortran-0.63.0/integration_tests/intrinsics_129.f900000664000175000017500000000044315174404631022466 0ustar alastairalastairprogram intrinsics_129 complex(4) :: x, y(4) real(4) :: res(4) x = (1.0, 2.0) y = (3.0, 4.0) res = abs(y) print*, abs(y) print *, res if (any(abs(res - 5.0) > 1e-7)) error stop print *, abs(x) if (abs(abs(x) - 2.236068) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/modules_72.f900000664000175000017500000000051715174404631021670 0ustar alastairalastairprogram modules_72 use modules_72_stypemod, only: SomeType use modules_72_otypemod, only: OtherType implicit none type(SomeType) :: s type(OtherType) :: o s = SomeType() if (s%x /= 10) error stop o = OtherType() if (o%y /= 20) error stop print *, "PASSED: modules_72" end program modules_72 lfortran-0.63.0/integration_tests/associate_50.f900000664000175000017500000000154415174404631022170 0ustar alastairalastairprogram associate_50 implicit none real :: pi_val, d_val, g_val logical :: cmp_result ! Test nested associate where one associate variable references another associate(pi => 4.0*atan(1.0)) associate(d => sin(pi/6.0)) associate(g => d) pi_val = pi d_val = d g_val = g cmp_result = (g == d) if (abs(pi_val - 3.14159265) > 1e-5) error stop if (abs(d_val - 0.5) > 1e-5) error stop if (abs(g_val - 0.5) > 1e-5) error stop if (.not. cmp_result) error stop if (abs(g_val - d_val) > 1e-7) error stop ! Test arithmetic with nested associates if (abs(g + d - 1.0) > 1e-5) error stop if (abs(g * d - 0.25) > 1e-5) error stop end associate end associate end associate print *, "All tests passed" end program lfortran-0.63.0/integration_tests/file_43.f900000664000175000017500000000116315174404631021133 0ustar alastairalastairprogram file_43 implicit none integer :: n integer :: i real :: r logical :: l integer :: iarr(5) real :: rarr(3,2) print *, "IOLENGTH tests:" inquire(iolength=n) i print *, "integer :", n if (n /= 4) error stop inquire(iolength=n) r print *, "real :", n if (n /= 4) error stop inquire(iolength=n) l print *, "logical :", n if (n /= 4) error stop inquire(iolength=n) iarr print *, "integer(5) :", n if (n /= 20) error stop inquire(iolength=n) rarr print *, "real(3x2) :", n if (n /= 24) error stop end program lfortran-0.63.0/integration_tests/modules_30_module2.f900000664000175000017500000000213015174404631023302 0ustar alastairalastairmodule fpm_manifest_dependency_modules_30 use fpm_git_modules_30, only : git_target_t, git_target_branch implicit none type :: toml_table logical :: inline = .false. end type toml_table type :: error_t character(len=:), allocatable :: message end type error_t type :: dependency_config_t character(len=:), allocatable :: name character(len=:), allocatable :: path type(git_target_t), allocatable :: git end type dependency_config_t contains subroutine new_dependency(self) type(dependency_config_t), intent(out) :: self character(len=:), allocatable :: url, obj self%git = git_target_branch(url, obj) end subroutine new_dependency subroutine new_dependencies(deps, table, root, error) type(dependency_config_t), allocatable, intent(out) :: deps(:) type(toml_table), intent(inout) :: table character(*), intent(in), optional :: root type(error_t), allocatable, intent(out) :: error end subroutine new_dependencies end module fpm_manifest_dependency_modules_30 lfortran-0.63.0/integration_tests/complex_32.f900000664000175000017500000000056315174404631021664 0ustar alastairalastairprogram complex_32 use, intrinsic :: iso_fortran_env, only: dp => real64 implicit none integer :: i real(dp) :: sum complex(dp) :: z sum = 0.0_dp z = cmplx(1.0_dp, 2.0_dp, kind=dp) do i = 1, 500000 sum = sum + real(z) + aimag(z) z = cmplx(1.0_dp, 2.0_dp, kind=dp) end do print *, int(sum) end program complex_32 lfortran-0.63.0/integration_tests/submodule_29a.f900000664000175000017500000000027315174404631022361 0ustar alastairalastairprogram submodule_29 use submodule_29_mod, only: greet implicit none integer :: x, y x = 3 call greet(x, y) if (y /= 15) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/class_15.f900000664000175000017500000000204315174404631021316 0ustar alastairalastairmodule class_15_mod type :: logger_type contains private procedure, public, pass(self) :: add_log_file end type logger_type contains subroutine add_log_file(self, filename, unit) class(logger_type), intent(inout) :: self character(*), optional :: filename integer, optional :: unit if (present(filename)) filename = "lfortran" if (present(unit)) unit = 10 end subroutine add_log_file end module program class_15 use class_15_mod type(logger_type) :: logger integer :: unit character(len=100) :: filename call logger % add_log_file(unit=unit) !> which is already done call logger % add_log_file(filename=filename) call logger % add_log_file(unit=unit, filename=filename) call logger % add_log_file(filename=filename, unit=unit) ! reverse the order call logger % add_log_file() print *, filename if (filename /= "lfortran") error stop print *, unit if (unit /= 10) error stop end programlfortran-0.63.0/integration_tests/functions_20.f900000664000175000017500000000110215174404631022210 0ustar alastairalastairpure function diag_rsp_mat(A, k) result(res) real, intent(in) :: A(:,:) integer, intent(in) :: k real :: res(minval(shape(A)) - abs(k)) res = 123.71_4 end function diag_rsp_mat program functions_20 real, dimension(3,3) :: A real :: B(2) integer :: k interface function diag_rsp_mat(A, k) result(res) real, intent(in) :: A(:,:) integer, intent(in) :: k real :: res(minval(shape(A)) - abs(k)) end function diag_rsp_mat end interface k = 1 B = diag_rsp_mat(A, k) print *, B if (any(abs(B - 123.71_4) > 1e-6)) error stop end program functions_20 lfortran-0.63.0/integration_tests/intrinsics_83.f900000664000175000017500000000030515174404631022402 0ustar alastairalastairprogram intrinsics_83 implicit none complex(kind=kind(1.0D0)) :: val val = (1.0, -3.0) print *, val if (abs(val - (1.0, -3.0)) > 1e-5) error stop end program intrinsics_83 lfortran-0.63.0/integration_tests/string_99.f900000664000175000017500000000053115174404631021533 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/3938 ! character length from bit_size() intrinsic, len() correctness ! Exact MRE from issue body program bitsize2 implicit none character(bit_size(666)):: foo print *, bit_size(666), len(foo) if (bit_size(666) /= 32) error stop if (len(foo) /= 32) error stop end program bitsize2 lfortran-0.63.0/integration_tests/procedure_21.f900000664000175000017500000000125115174404631022176 0ustar alastairalastairmodule procedure_21_mod implicit none private public :: is_valid interface is_valid module procedure is_valid_scalar module procedure is_valid_array end interface contains integer function is_valid_array(arr) integer, intent(in) :: arr(:) is_valid_array = count(arr > 0) end function elemental integer function is_valid_scalar(x) integer, intent(in) :: x is_valid_scalar = -1 end function end module procedure_21_mod program procedure_21 use procedure_21_mod implicit none if (is_valid([1, 2, 3]) /= 3) error stop if (is_valid([1, -2, -3]) /= 1) error stop if (is_valid([1, -2, 3]) /= 2) error stop end program procedure_21lfortran-0.63.0/integration_tests/string_115.f900000664000175000017500000000106515174404631021603 0ustar alastairalastairprogram string_115 implicit none character(len=10) :: s s = 'hello' call test_len_trim_dim(s) call test_len_trim_dim_const() contains subroutine test_len_trim_dim(s) character(*), intent(in) :: s character :: a(len(trim(s))) a = 'x' if (size(a) /= 5) error stop print *, "size(a) =", size(a) end subroutine subroutine test_len_trim_dim_const() character :: b(len(trim('world '))) b = 'y' if (size(b) /= 5) error stop print *, "size(b) =", size(b) end subroutine end program lfortran-0.63.0/integration_tests/implicit_typing_06.f900000664000175000017500000000037015174404631023416 0ustar alastairalastairmodule mod_implicit_typing_06 implicit none private public a integer, parameter :: a = 1 end module mod_implicit_typing_06 program implicit_typing_06 use mod_implicit_typing_06 print *, a if (a /= 1) error stop end programlfortran-0.63.0/integration_tests/derived_types_88.f900000664000175000017500000000157015174404631023075 0ustar alastairalastairmodule derived_types_88_mod implicit none type :: string_t character(len=:), allocatable :: s end type string_t type :: compile_command_t character(:), allocatable :: directory type(string_t), allocatable :: str_arr(:) end type compile_command_t contains subroutine cct_new(cc) type(compile_command_t), intent(inout) :: cc call cct_inside() contains subroutine cct_inside() if (cc%directory /= "Home") error stop if (cc%str_arr(1)%s /= "Hello") error stop if (cc%str_arr(2)%s /= "World") error stop end subroutine end subroutine end module derived_types_88_mod program derived_types_88 use derived_types_88_mod type(compile_command_t) :: cc cc%directory = "Home" cc%str_arr = [string_t("Hello"), string_t("World")] call cct_new(cc) end programlfortran-0.63.0/integration_tests/format_59.f900000664000175000017500000000075415174404631021520 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/4056 ! Format string variable with trailing spaces (character(12)) ! Exact MRE from issue comment (corrected version with character(12)) program format_59 implicit none character(12) :: fmt = "(2(1X,A))" character(80) :: output print "(A)", 'fmt = "' // fmt // '"' print fmt, 'Hello', 'world!' write(output, fmt) 'Hello', 'world!' if (trim(adjustl(output)) /= 'Hello world!') error stop end program format_59 lfortran-0.63.0/integration_tests/doloop_09.f900000664000175000017500000000063515174404631021515 0ustar alastairalastairmodule doloop_09_mod contains subroutine f() integer :: i, j j = 0 do i = 1, 10 j = j + i end do if (j /= 55) error stop print *, j call g() contains subroutine g() integer :: i, j j = 0 do i = 1, 10 j = j + i end do if (j /= 55) error stop print *, j end subroutine end subroutine end module program doloop_09 use doloop_09_mod, only: f call f() end program lfortran-0.63.0/integration_tests/submodule_39c.f900000664000175000017500000000027115174404631022362 0ustar alastairalastairsubmodule(mini_batch_m) mini_batch_s contains module procedure make_batch mini_batch%input_output_pairs = input_output_pairs end procedure make_batch end submodule mini_batch_s lfortran-0.63.0/integration_tests/functions_24.f900000664000175000017500000000035115174404631022221 0ustar alastairalastair program functions_24 character a a = characterfunc() contains character*1 function characterfunc() characterfunc = 'A' end function characterfunc end program lfortran-0.63.0/integration_tests/implied_do_loops18.f900000664000175000017500000000176615174404631023411 0ustar alastairalastairprogram implied_do_loops18 implicit none type :: string_t character(len=:), allocatable :: s end type string_t type(string_t), allocatable :: file_names(:) logical, allocatable :: is_source(:) integer :: i allocate(file_names(3)) file_names(1)%s = "main.f90" file_names(2)%s = ".gitignore" file_names(3)%s = "utils.f90" i = 100 is_source = [(is_hidden_file(basename(file_names(i)%s)), i = 1, size(file_names))] do i = 1, size(is_source) print *, trim(file_names(i)%s), " -> ", is_source(i) end do if (any(is_source .neqv. [.false., .true., .false.])) error stop contains function basename(path) result(tmp) character(len=*), intent(in) :: path character(len=:), allocatable :: tmp tmp = path end function basename logical function is_hidden_file(name) character(len=*), intent(in) :: name is_hidden_file = (len(name) > 0 .and. name(1:1) == ".") end function is_hidden_file end program implied_do_loops18 lfortran-0.63.0/integration_tests/operator_overloading_24.f900000664000175000017500000000273415174404631024444 0ustar alastairalastairmodule operator_overloading_24_mod implicit none type :: string_t character(len=:), allocatable :: s contains procedure, private :: string_t_eq_string_t procedure, private :: string_t_eq_character procedure, private, pass(rhs) :: character_eq_string_t generic :: operator(==) => string_t_eq_string_t, string_t_eq_character, character_eq_string_t end type contains elemental logical function string_t_eq_string_t(lhs, rhs) class(string_t), intent(in) :: lhs, rhs string_t_eq_string_t = lhs%s == rhs%s end function elemental logical function string_t_eq_character(lhs, rhs) class(string_t), intent(in) :: lhs character(len=*), intent(in) :: rhs string_t_eq_character = lhs%s == rhs end function elemental logical function character_eq_string_t(lhs, rhs) character(len=*), intent(in) :: lhs class(string_t), intent(in) :: rhs character_eq_string_t = lhs == rhs%s end function end module program operator_overloading_24 use operator_overloading_24_mod, only: string_t implicit none ! string_t == string_t if (.not. (string_t("abc") == string_t("abc"))) error stop if (string_t("abc") == string_t("xyz")) error stop ! string_t == character if (.not. (string_t("abc") == "abc")) error stop if (string_t("abc") == "xyz") error stop ! character == string_t (pass(rhs)) if (.not. ("abc" == string_t("abc"))) error stop if ("abc" == string_t("xyz")) error stop print *, "All tests passed." end program lfortran-0.63.0/integration_tests/inquire_09.f900000664000175000017500000000136115174404631021672 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/4640 ! Inquire iolength with different type kinds ! Exact MRE from issue body program inquire_09 use iso_fortran_env, only: int8, int16, int32, int64, real32, real64 implicit none integer :: i, len(6) = -huge(1) inquire(iolength=len(1)) 42_int8 inquire(iolength=len(2)) 42_int16 inquire(iolength=len(3)) 42_int32 inquire(iolength=len(4)) 42_int64 inquire(iolength=len(5)) 4.2_real32 inquire(iolength=len(6)) 4.2_real64 print "(6(I0,1X))", len if (len(1) /= 1) error stop if (len(2) /= 2) error stop if (len(3) /= 4) error stop if (len(4) /= 8) error stop if (len(5) /= 4) error stop if (len(6) /= 8) error stop end program inquire_09 lfortran-0.63.0/integration_tests/test_ieee_value_01.f900000664000175000017500000000126515174404631023353 0ustar alastairalastairprogram test_ieee_value_01 use ieee_arithmetic implicit none double precision :: xdp, snan, qnan, pinf, ninf snan = ieee_value(xdp, ieee_signaling_nan) qnan = ieee_value(xdp, ieee_quiet_nan) pinf = ieee_value(xdp, ieee_positive_inf) ninf = ieee_value(xdp, ieee_negative_inf) if (.not. ieee_is_nan(snan)) error stop "signaling NaN should be NaN" if (.not. ieee_is_nan(qnan)) error stop "quiet NaN should be NaN" if (pinf <= 0.0d0) error stop "positive inf should be positive" if (ninf >= 0.0d0) error stop "negative inf should be negative" if (pinf + ninf == pinf + ninf) error stop "inf + (-inf) should be NaN" end program test_ieee_value_01 lfortran-0.63.0/integration_tests/block_data_01.f900000664000175000017500000000042215174404631022266 0ustar alastairalastairblock data bdata_1 implicit none integer :: x, y common /blk1/ x, y data x, y/42, 43/ end program block_data_01 implicit none common /blk1/ x, y integer :: x, y if (x /= 42) error stop if (y /= 43) error stop end program block_data_01 lfortran-0.63.0/integration_tests/separate_compilation_12a.f900000664000175000017500000000063615174404631024557 0ustar alastairalastairmodule separate_compilation_12a_module contains subroutine parent_of_nested_subroutine(a, b) integer, intent(inout) :: a, b call nested_subroutine(a, b) contains subroutine nested_subroutine(c, d) integer, intent(inout) :: c, d a = a + c b = b + d end subroutine nested_subroutine end subroutine parent_of_nested_subroutine end module separate_compilation_12a_module lfortran-0.63.0/integration_tests/bindc_iso_fb_04c.c0000664000175000017500000005051715174404631022607 0ustar alastairalastair/* * Consolidated C helpers for bindc_iso_fb_04 * Merged from: bindc_33c.c, bindc_36c.c, bindc_37c.c, bindc_41c.c */ #include #include #include #include /* ================================================================ * From bindc_33c.c: CFI_address, CFI_is_contiguous, CFI_section, * CFI_select_part * ================================================================ */ /* ---- CFI_address: 1D ---- */ int c33_test_address_1d(CFI_cdesc_t *a) { /* a = [10, 20, 30, 40, 50] (1-based) */ CFI_index_t sub[1]; int32_t *addr; /* a(1) = 10 */ sub[0] = a->dim[0].lower_bound; addr = (int32_t *)CFI_address(a, sub); if (*addr != 10) return 1; /* a(3) = 30 */ sub[0] = a->dim[0].lower_bound + 2; addr = (int32_t *)CFI_address(a, sub); if (*addr != 30) return 2; /* a(5) = 50 */ sub[0] = a->dim[0].lower_bound + 4; addr = (int32_t *)CFI_address(a, sub); if (*addr != 50) return 3; return 0; } /* ---- CFI_address: 2D ---- */ int c33_test_address_2d(CFI_cdesc_t *a) { /* a(i,j) = i + (j-1)*3, shape [3,4], column-major */ CFI_index_t sub[2]; int32_t *addr; /* a(1,1) = 1 */ sub[0] = a->dim[0].lower_bound; sub[1] = a->dim[1].lower_bound; addr = (int32_t *)CFI_address(a, sub); if (*addr != 1) return 1; /* a(2,3) = 2 + 2*3 = 8 */ sub[0] = a->dim[0].lower_bound + 1; sub[1] = a->dim[1].lower_bound + 2; addr = (int32_t *)CFI_address(a, sub); if (*addr != 8) return 2; /* a(3,4) = 3 + 3*3 = 12 */ sub[0] = a->dim[0].lower_bound + 2; sub[1] = a->dim[1].lower_bound + 3; addr = (int32_t *)CFI_address(a, sub); if (*addr != 12) return 3; return 0; } /* ---- CFI_is_contiguous ---- */ int c33_check_contiguous(CFI_cdesc_t *a) { return CFI_is_contiguous(a); } /* ---- CFI_section ---- */ int c33_test_section(CFI_cdesc_t *a) { /* a = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100] */ /* Create section a(3:7:2) → [30, 50, 70] */ CFI_CDESC_T(1) result_raw; CFI_cdesc_t *result = (CFI_cdesc_t *)&result_raw; CFI_index_t lb[1], ub[1], str[1]; CFI_index_t sub[1]; int32_t *addr; int rc; rc = CFI_establish(result, NULL, CFI_attribute_other, CFI_type_int32_t, 0, 1, NULL); if (rc != CFI_SUCCESS) return 1; lb[0] = a->dim[0].lower_bound + 2; /* index 3 */ ub[0] = a->dim[0].lower_bound + 6; /* index 7 */ str[0] = 2; rc = CFI_section(result, a, lb, ub, str); if (rc != CFI_SUCCESS) return 2; if (result->dim[0].extent != 3) return 3; /* Check values via CFI_address */ sub[0] = result->dim[0].lower_bound; addr = (int32_t *)CFI_address(result, sub); if (*addr != 30) return 4; sub[0] = result->dim[0].lower_bound + 1; addr = (int32_t *)CFI_address(result, sub); if (*addr != 50) return 5; sub[0] = result->dim[0].lower_bound + 2; addr = (int32_t *)CFI_address(result, sub); if (*addr != 70) return 6; return 0; } /* ---- CFI_select_part ---- */ int c33_test_select_part(CFI_cdesc_t *a) { /* a = [(10,100), (20,200), (30,300)] — array of pair_t */ /* Select 'y' component (offset = sizeof(int32_t)) */ CFI_CDESC_T(1) result_raw; CFI_cdesc_t *result = (CFI_cdesc_t *)&result_raw; CFI_index_t sub[1]; int32_t *addr; int rc; rc = CFI_establish(result, NULL, CFI_attribute_other, CFI_type_int32_t, sizeof(int32_t), 1, NULL); if (rc != CFI_SUCCESS) return 1; rc = CFI_select_part(result, a, sizeof(int32_t), sizeof(int32_t)); if (rc != CFI_SUCCESS) return 2; /* y values: [100, 200, 300] */ sub[0] = result->dim[0].lower_bound; addr = (int32_t *)CFI_address(result, sub); if (*addr != 100) return 3; sub[0] = result->dim[0].lower_bound + 1; addr = (int32_t *)CFI_address(result, sub); if (*addr != 200) return 4; sub[0] = result->dim[0].lower_bound + 2; addr = (int32_t *)CFI_address(result, sub); if (*addr != 300) return 5; return 0; } /* ================================================================ * From bindc_36c.c: CFI header validation — type macros, error codes, * CFI_MAX_RANK, CFI_VERSION, type matching, errors * ================================================================ */ /* ---- CFI_MAX_RANK ---- */ int c36_check_max_rank(void) { return CFI_MAX_RANK >= 15 ? 1 : 0; } /* ---- CFI_VERSION ---- */ int c36_check_version(void) { return CFI_VERSION > 0 ? 1 : 0; } /* ---- All CFI_type_* macros exist (compile-time) ---- */ int c36_check_type_macros(void) { volatile int t; t = CFI_type_signed_char; t = CFI_type_short; t = CFI_type_int; t = CFI_type_long; t = CFI_type_long_long; t = CFI_type_size_t; t = CFI_type_int8_t; t = CFI_type_int16_t; t = CFI_type_int32_t; t = CFI_type_int64_t; t = CFI_type_int_least8_t; t = CFI_type_int_least16_t; t = CFI_type_int_least32_t; t = CFI_type_int_least64_t; t = CFI_type_int_fast8_t; t = CFI_type_int_fast16_t; t = CFI_type_int_fast32_t; t = CFI_type_int_fast64_t; t = CFI_type_intmax_t; t = CFI_type_intptr_t; t = CFI_type_ptrdiff_t; t = CFI_type_float; t = CFI_type_double; t = CFI_type_long_double; t = CFI_type_float_Complex; t = CFI_type_double_Complex; t = CFI_type_long_double_Complex; t = CFI_type_Bool; t = CFI_type_char; t = CFI_type_struct; t = CFI_type_other; (void)t; return 1; } /* ---- All error code macros exist ---- */ int c36_check_error_codes(void) { volatile int e; e = CFI_SUCCESS; if (e != 0) return 0; e = CFI_ERROR_BASE_ADDR_NULL; e = CFI_ERROR_BASE_ADDR_NOT_NULL; e = CFI_INVALID_ELEM_LEN; e = CFI_INVALID_RANK; e = CFI_INVALID_TYPE; e = CFI_INVALID_ATTRIBUTE; e = CFI_INVALID_EXTENT; e = CFI_INVALID_DESCRIPTOR; e = CFI_ERROR_MEM_ALLOCATION; e = CFI_ERROR_OUT_OF_BOUNDS; (void)e; return 1; } /* ---- Return type field from a CFI descriptor ---- */ int c36_get_cfi_type(CFI_cdesc_t *a) { return (int)a->type; } /* ---- Return expected CFI_type_* values ---- */ int c36_expected_int32(void) { return CFI_type_int32_t; } int c36_expected_float(void) { return CFI_type_float; } int c36_expected_double(void) { return CFI_type_double; } int c36_expected_float_complex(void) { return CFI_type_float_Complex; } int c36_expected_double_complex(void) { return CFI_type_double_Complex; } int c36_expected_bool(void) { return CFI_type_Bool; } int c36_expected_char(void) { return CFI_type_char; } int c36_expected_struct(void) { return CFI_type_struct; } /* ---- Error handling: CFI_establish ---- */ int c36_test_error_establish(void) { CFI_CDESC_T(1) desc_storage; CFI_cdesc_t *desc = (CFI_cdesc_t *)&desc_storage; int rc; /* Invalid rank (too large) */ rc = CFI_establish(desc, NULL, CFI_attribute_other, CFI_type_int, 0, CFI_MAX_RANK + 1, NULL); if (rc != CFI_INVALID_RANK) return 0; /* Invalid attribute */ rc = CFI_establish(desc, NULL, 99, CFI_type_int, 0, 1, NULL); if (rc != CFI_INVALID_ATTRIBUTE) return 0; /* Valid call should succeed */ CFI_index_t ext[1] = {5}; rc = CFI_establish(desc, NULL, CFI_attribute_allocatable, CFI_type_int32_t, 0, 1, ext); if (rc != CFI_SUCCESS) return 0; return 1; } /* ---- Error handling: CFI_allocate ---- */ int c36_test_error_allocate(void) { CFI_CDESC_T(1) desc_storage; CFI_cdesc_t *desc = (CFI_cdesc_t *)&desc_storage; int rc; CFI_index_t ext[1] = {5}; rc = CFI_establish(desc, NULL, CFI_attribute_allocatable, CFI_type_int32_t, 0, 1, ext); if (rc != CFI_SUCCESS) return 0; /* Allocate successfully */ CFI_index_t lb[1] = {1}; CFI_index_t ub[1] = {5}; rc = CFI_allocate(desc, lb, ub, 0); if (rc != CFI_SUCCESS) return 0; /* Allocate again with non-NULL base → error */ rc = CFI_allocate(desc, lb, ub, 0); if (rc != CFI_ERROR_BASE_ADDR_NOT_NULL) return 0; /* Clean up */ rc = CFI_deallocate(desc); if (rc != CFI_SUCCESS) return 0; return 1; } /* ---- Error handling: CFI_deallocate ---- */ int c36_test_error_deallocate(void) { CFI_CDESC_T(1) desc_storage; CFI_cdesc_t *desc = (CFI_cdesc_t *)&desc_storage; int rc; CFI_index_t ext[1] = {5}; rc = CFI_establish(desc, NULL, CFI_attribute_allocatable, CFI_type_int32_t, 0, 1, ext); if (rc != CFI_SUCCESS) return 0; /* Deallocate with NULL base → error */ rc = CFI_deallocate(desc); if (rc != CFI_ERROR_BASE_ADDR_NULL) return 0; return 1; } /* ================================================================ * From bindc_37c.c: char(len=1) 2D descriptor, CFI_section 2D, * high-rank arrays, scalar descriptor from C * ================================================================ */ /* ---- Character(len=1) 2D assumed-shape array ---- */ int c37_check_char_2d(CFI_cdesc_t *arr) { /* arr is 3x2, elem_len=1, rank=2 */ if (arr->elem_len != 1) return 0; if (arr->rank != 2) return 0; if (arr->dim[0].extent != 3) return 0; if (arr->dim[1].extent != 2) return 0; /* Check elements using CFI_address */ CFI_index_t sub[2]; char *ch; /* arr(1,1) = 'A' */ sub[0] = arr->dim[0].lower_bound; sub[1] = arr->dim[1].lower_bound; ch = (char *)CFI_address(arr, sub); if (*ch != 'A') return 0; /* arr(3,1) = 'C' */ sub[0] = arr->dim[0].lower_bound + 2; sub[1] = arr->dim[1].lower_bound; ch = (char *)CFI_address(arr, sub); if (*ch != 'C') return 0; /* arr(2,2) = 'E' */ sub[0] = arr->dim[0].lower_bound + 1; sub[1] = arr->dim[1].lower_bound + 1; ch = (char *)CFI_address(arr, sub); if (*ch != 'E') return 0; return 1; } /* ---- CFI_section on 2D array ---- */ int c37_section_2d(CFI_cdesc_t *a) { /* * Source: 4x4 matrix, a(i,j) = i*10 + j * Extract section a(2:3, 1:4:2) → rows 2-3, columns 1,3 * Result shape: (2, 2) */ CFI_CDESC_T(2) result_storage; CFI_cdesc_t *result = (CFI_cdesc_t *)&result_storage; int rc; /* Establish result descriptor */ rc = CFI_establish(result, NULL, CFI_attribute_other, a->type, a->elem_len, 2, NULL); if (rc != CFI_SUCCESS) return 0; /* Extract section: rows 2:3, columns 1:4:2 (1-based) */ CFI_index_t lb[2], ub[2], st[2]; lb[0] = a->dim[0].lower_bound + 1; /* row 2 */ ub[0] = a->dim[0].lower_bound + 2; /* row 3 */ st[0] = 1; lb[1] = a->dim[1].lower_bound; /* col 1 */ ub[1] = a->dim[1].lower_bound + 3; /* col 4 */ st[1] = 2; /* stride 2 → cols 1,3 */ rc = CFI_section(result, a, lb, ub, st); if (rc != CFI_SUCCESS) return 0; /* Verify shape */ if (result->dim[0].extent != 2) return 0; if (result->dim[1].extent != 2) return 0; /* Verify values using CFI_address */ CFI_index_t sub[2]; /* result(1,1) should be a(2,1) = 2*10+1 = 21 */ sub[0] = result->dim[0].lower_bound; sub[1] = result->dim[1].lower_bound; int32_t *addr = (int32_t *)CFI_address(result, sub); if (*addr != 21) return 0; /* result(2,1) should be a(3,1) = 3*10+1 = 31 */ sub[0] = result->dim[0].lower_bound + 1; sub[1] = result->dim[1].lower_bound; addr = (int32_t *)CFI_address(result, sub); if (*addr != 31) return 0; /* result(1,2) should be a(2,3) = 2*10+3 = 23 */ sub[0] = result->dim[0].lower_bound; sub[1] = result->dim[1].lower_bound + 1; addr = (int32_t *)CFI_address(result, sub); if (*addr != 23) return 0; /* result(2,2) should be a(3,3) = 3*10+3 = 33 */ sub[0] = result->dim[0].lower_bound + 1; sub[1] = result->dim[1].lower_bound + 1; addr = (int32_t *)CFI_address(result, sub); if (*addr != 33) return 0; return 1; } /* ---- Rank-15 array descriptor ---- */ int c37_check_rank15(CFI_cdesc_t *a) { if (a->rank != 15) return 0; /* Total elements: 2^15 = 32768 */ CFI_index_t total = 1; for (int i = 0; i < 15; i++) { if (a->dim[i].extent != 2) return 0; total *= a->dim[i].extent; } if (total != 32768) return 0; return 1; } /* ---- Scalar allocatable from C side ---- */ void c37_scalar_from_c(CFI_cdesc_t *val) { /* val is allocatable, rank 0, intent(out) → already deallocated */ CFI_index_t lb[1] = {0}; CFI_index_t ub[1] = {0}; int rc = CFI_allocate(val, lb, ub, 0); if (rc != CFI_SUCCESS) return; /* Set the value */ *(int32_t *)val->base_addr = 999; } /* ================================================================ * From bindc_41c.c: CFI function error conditions * ================================================================ */ /* ---- CFI_establish error conditions ---- */ int32_t c41_test_establish_errors(void) { CFI_CDESC_T(1) storage; CFI_cdesc_t *desc = (CFI_cdesc_t *)&storage; int rc; /* 1. Invalid type code (must fit in CFI_type_t range) */ rc = CFI_establish(desc, NULL, CFI_attribute_other, (CFI_type_t)100, sizeof(int32_t), 1, NULL); if (rc == CFI_SUCCESS) return 0; /* should fail */ /* 2. Invalid rank: > CFI_MAX_RANK */ rc = CFI_establish(desc, NULL, CFI_attribute_other, CFI_type_int32_t, 0, CFI_MAX_RANK + 1, NULL); if (rc != CFI_INVALID_RANK) return 0; /* 3. Invalid attribute code */ rc = CFI_establish(desc, NULL, 77, CFI_type_int32_t, 0, 1, NULL); if (rc == CFI_SUCCESS) return 0; /* must fail for invalid attribute */ /* 4. Valid call succeeds */ CFI_index_t ext[1] = {5}; rc = CFI_establish(desc, NULL, CFI_attribute_allocatable, CFI_type_int32_t, 0, 1, ext); if (rc != CFI_SUCCESS) return 0; /* 5. Negative rank */ rc = CFI_establish(desc, NULL, CFI_attribute_other, CFI_type_int32_t, 0, -1, NULL); if (rc == CFI_SUCCESS) return 0; /* should fail */ return 1; } /* ---- CFI_allocate error conditions ---- */ int32_t c41_test_allocate_errors(void) { CFI_CDESC_T(1) storage; CFI_cdesc_t *desc = (CFI_cdesc_t *)&storage; int rc; /* Set up an allocatable descriptor */ CFI_index_t ext[1] = {5}; rc = CFI_establish(desc, NULL, CFI_attribute_allocatable, CFI_type_int32_t, 0, 1, ext); if (rc != CFI_SUCCESS) return 0; /* 1. Successful allocate */ CFI_index_t lb[1] = {1}; CFI_index_t ub[1] = {5}; rc = CFI_allocate(desc, lb, ub, 0); if (rc != CFI_SUCCESS) return 0; /* 2. Double allocate: base_addr is non-NULL */ rc = CFI_allocate(desc, lb, ub, 0); if (rc != CFI_ERROR_BASE_ADDR_NOT_NULL) return 0; /* Clean up */ rc = CFI_deallocate(desc); if (rc != CFI_SUCCESS) return 0; /* 3. Set up a non-allocatable descriptor and try to allocate */ int32_t data[5] = {1, 2, 3, 4, 5}; rc = CFI_establish(desc, data, CFI_attribute_other, CFI_type_int32_t, sizeof(int32_t), 1, ext); if (rc != CFI_SUCCESS) return 0; rc = CFI_allocate(desc, lb, ub, 0); if (rc == CFI_SUCCESS) return 0; /* must fail */ return 1; } /* ---- CFI_deallocate error conditions ---- */ int32_t c41_test_deallocate_errors(void) { CFI_CDESC_T(1) storage; CFI_cdesc_t *desc = (CFI_cdesc_t *)&storage; int rc; /* 1. Deallocate unallocated (NULL base_addr) */ CFI_index_t ext[1] = {5}; rc = CFI_establish(desc, NULL, CFI_attribute_allocatable, CFI_type_int32_t, 0, 1, ext); if (rc != CFI_SUCCESS) return 0; rc = CFI_deallocate(desc); if (rc != CFI_ERROR_BASE_ADDR_NULL) return 0; /* 2. Deallocate non-allocatable descriptor */ int32_t data[5] = {0}; rc = CFI_establish(desc, data, CFI_attribute_other, CFI_type_int32_t, sizeof(int32_t), 1, ext); if (rc != CFI_SUCCESS) return 0; rc = CFI_deallocate(desc); if (rc == CFI_SUCCESS) return 0; /* must fail */ return 1; } /* ---- CFI_section error conditions ---- */ int32_t c41_test_section_errors(void) { /* Set up a valid 1D source array [1,2,3,4,5] */ CFI_CDESC_T(1) src_s; CFI_cdesc_t *src = (CFI_cdesc_t *)&src_s; int32_t data[5] = {1, 2, 3, 4, 5}; CFI_index_t ext[1] = {5}; int rc; rc = CFI_establish(src, data, CFI_attribute_other, CFI_type_int32_t, sizeof(int32_t), 1, ext); if (rc != CFI_SUCCESS) return 0; /* Valid section: elements 1..3 with stride 1 */ CFI_CDESC_T(1) res_s; CFI_cdesc_t *res = (CFI_cdesc_t *)&res_s; rc = CFI_establish(res, NULL, CFI_attribute_other, CFI_type_int32_t, sizeof(int32_t), 1, NULL); if (rc != CFI_SUCCESS) return 0; CFI_index_t lb[1] = {0}; CFI_index_t ub[1] = {2}; CFI_index_t st[1] = {1}; rc = CFI_section(res, src, lb, ub, st); if (rc != CFI_SUCCESS) return 0; /* Verify the section contents */ int32_t *rp = (int32_t *)res->base_addr; if (res->dim[0].extent != 3) return 0; return 1; } /* ---- CFI_setpointer error conditions ---- */ int32_t c41_test_setpointer_errors(void) { int rc; /* Create a pointer descriptor (rank 1) */ CFI_CDESC_T(1) ptr_s; CFI_cdesc_t *ptr = (CFI_cdesc_t *)&ptr_s; rc = CFI_establish(ptr, NULL, CFI_attribute_pointer, CFI_type_int32_t, 0, 1, NULL); if (rc != CFI_SUCCESS) return 0; /* Create a source (rank 1) */ int32_t data[5] = {10, 20, 30, 40, 50}; CFI_CDESC_T(1) src_s; CFI_cdesc_t *src = (CFI_cdesc_t *)&src_s; CFI_index_t ext1[1] = {5}; rc = CFI_establish(src, data, CFI_attribute_other, CFI_type_int32_t, sizeof(int32_t), 1, ext1); if (rc != CFI_SUCCESS) return 0; /* Valid setpointer */ rc = CFI_setpointer(ptr, src, NULL); if (rc != CFI_SUCCESS) return 0; /* Verify pointer now points to data */ int32_t *p = (int32_t *)ptr->base_addr; if (p[0] != 10 || p[4] != 50) return 0; /* Disassociate */ rc = CFI_setpointer(ptr, NULL, NULL); if (rc != CFI_SUCCESS) return 0; if (ptr->base_addr != NULL) return 0; return 1; } /* ---- CFI_select_part error conditions ---- */ int32_t c41_test_select_part_errors(void) { /* Create a source array of a "struct" with two int32_t fields */ typedef struct { int32_t x; int32_t y; } pair_t; pair_t data[3] = {{1, 10}, {2, 20}, {3, 30}}; CFI_CDESC_T(1) src_s; CFI_cdesc_t *src = (CFI_cdesc_t *)&src_s; CFI_index_t ext[1] = {3}; int rc; rc = CFI_establish(src, data, CFI_attribute_other, CFI_type_struct, sizeof(pair_t), 1, ext); if (rc != CFI_SUCCESS) return 0; /* Valid: select the 'y' component (offset = sizeof(int32_t)) */ CFI_CDESC_T(1) part_s; CFI_cdesc_t *part = (CFI_cdesc_t *)&part_s; rc = CFI_establish(part, NULL, CFI_attribute_other, CFI_type_int32_t, sizeof(int32_t), 1, NULL); if (rc != CFI_SUCCESS) return 0; rc = CFI_select_part(part, src, sizeof(int32_t), sizeof(int32_t)); if (rc != CFI_SUCCESS) return 0; /* Verify we got [10, 20, 30] */ CFI_index_t sub[1]; for (int i = 0; i < 3; i++) { sub[0] = part->dim[0].lower_bound + i; int32_t *val = (int32_t *)CFI_address(part, sub); if (*val != (i + 1) * 10) return 0; } return 1; } /* ---- CFI_address error conditions / valid usage ---- */ int32_t c41_test_address_errors(void) { int32_t data[6] = {10, 20, 30, 40, 50, 60}; CFI_CDESC_T(2) storage; CFI_cdesc_t *desc = (CFI_cdesc_t *)&storage; CFI_index_t ext[2] = {3, 2}; int rc; rc = CFI_establish(desc, data, CFI_attribute_other, CFI_type_int32_t, sizeof(int32_t), 2, ext); if (rc != CFI_SUCCESS) return 0; /* Valid addresses: 2D array [3 x 2], column-major */ CFI_index_t sub[2]; /* (0,0) => data[0] = 10 */ sub[0] = 0; sub[1] = 0; int32_t *p = (int32_t *)CFI_address(desc, sub); if (*p != 10) return 0; /* (2,0) => data[2] = 30 */ sub[0] = 2; sub[1] = 0; p = (int32_t *)CFI_address(desc, sub); if (*p != 30) return 0; /* (0,1) => data[3] = 40 */ sub[0] = 0; sub[1] = 1; p = (int32_t *)CFI_address(desc, sub); if (*p != 40) return 0; /* (2,1) => data[5] = 60 */ sub[0] = 2; sub[1] = 1; p = (int32_t *)CFI_address(desc, sub); if (*p != 60) return 0; return 1; } lfortran-0.63.0/integration_tests/modules_64.f900000664000175000017500000000063615174404631021673 0ustar alastairalastairMODULE xmod REAL(kind(1d0)) :: x = -666 END MODULE xmod PROGRAM modules_64 USE xmod USE xmod, ONLY: xrenamed => x REAL :: x x = 666 if (kind(xrenamed) == kind(x)) error stop if (xrenamed /= -666) error stop if (x /= 666) error stop if (kind(xrenamed) /= 8) error stop if (kind(x) /= 4) error stop END PROGRAM modules_64 lfortran-0.63.0/integration_tests/class_63_module_2.f900000664000175000017500000000060215174404631023106 0ustar alastairalastairmodule class_63_module_2 use class_63_module_1, only: AbsType type :: MyType class(AbsType), allocatable :: arr(:) contains procedure :: method end type MyType contains subroutine method(self) class(MyType), intent(inout) :: self associate ( element => self%arr(size(self%arr)) ) end associate end subroutine method end module lfortran-0.63.0/integration_tests/transfer_14.f900000664000175000017500000000102415174404631022032 0ustar alastairalastairprogram transfer_14 implicit none integer, parameter :: i4 = kind(1), i8 = selected_int_kind(15) if (transfer(epsilon(1.0) * tiny(1.0), 1_i4) /= 1_i4) error stop 1 if (transfer(nearest(0.0, 1.0), 1_i4) /= 1_i4) error stop 2 if (transfer(transfer(1_i4, 1.0), 1_i4) /= 1_i4) error stop 3 if (transfer(epsilon(1d0) * tiny(1d0), 1_i8) /= 1_i8) error stop 4 if (transfer(nearest(0d0, 1d0), 1_i8) /= 1_i8) error stop 5 if (transfer(transfer(1_i8, 1d0), 1_i8) /= 1_i8) error stop 6 end program transfer_14lfortran-0.63.0/integration_tests/modules_29_module2.f900000664000175000017500000000207215174404631023317 0ustar alastairalastairmodule fpm_manifest_dependency1 use fpm_git1, only : git_target_t, git_target_branch implicit none type :: toml_table logical :: inline = .false. end type toml_table type :: error_t character(len=:), allocatable :: message end type error_t type :: dependency_config_t character(len=:), allocatable :: name character(len=:), allocatable :: path type(git_target_t), allocatable :: git end type dependency_config_t contains subroutine new_dependency(self) type(dependency_config_t), intent(out) :: self character(len=:), allocatable :: url, obj self%git = git_target_branch(url, obj) end subroutine new_dependency subroutine new_dependencies(deps, table, root, error) type(dependency_config_t), allocatable, intent(out) :: deps(:) type(toml_table), intent(inout) :: table character(*), intent(in), optional :: root type(error_t), allocatable, intent(out) :: error end subroutine new_dependencies end module fpm_manifest_dependency1 lfortran-0.63.0/integration_tests/iso_c_binding_01.f900000664000175000017500000000051615174404631022775 0ustar alastairalastairprogram iso_c_binding_01 use, intrinsic :: iso_c_binding character(len=2, kind=c_char), parameter :: a = 'a' if (a /= 'a') error stop if (len(a) /= 2) error stop if (kind(a) /= c_char) error stop print *, "c_intptr_t:", c_intptr_t if (c_intptr_t /= 8) error stop end program iso_c_binding_01 lfortran-0.63.0/integration_tests/string_58.f900000664000175000017500000000052615174404631021532 0ustar alastairalastair! Note : gfortran fails for this, most of the other compiler don't program string_58 character(:), pointer :: str character(10), target :: str2 print *, associated(str) if(associated(str) .neqv. .false.) error stop str=> str2 print *, associated(str) if(associated(str) .neqv. .true.) error stop end programlfortran-0.63.0/integration_tests/kinds_02.f900000664000175000017500000000275615174404631021330 0ustar alastairalastairprogram kinds_02 implicit none integer, parameter :: kr1 = selected_real_kind(1), maxkr = 3, & skr2 = selected_real_kind(precision(1.0_kr1)+1), & kr2 = merge(skr2, kr1, skr2 > 0), & skr3 = selected_real_kind(precision(1.0_kr2)+1), & kr3 = merge(skr3, kr2, skr3 > 0), & allkr(maxkr+1) = [kr1, kr2, kr3, kr3], & nkr = minloc(abs(allkr(1:maxkr) - allkr(2:maxkr+1)), 1) integer :: n if (kr1 <= 0) error stop "kr1 must be a valid kind" if (kr2 < kr1) error stop "kr2 must be >= kr1" if (precision(1.0_kr1) < 1) error stop "precision(kr1) must be >= 1" if (nkr < 1 .or. nkr > maxkr) error stop "nkr out of range" if (nkr >= 2) then if (precision(1.0_kr2) <= precision(1.0_kr1)) error stop "kr2 should have higher precision" end if call realkinds(nkr) contains subroutine realkinds(nkr) integer, intent(in) :: nkr integer :: n integer :: goodkr(nkr) goodkr = allkr(1:nkr) print "(A,I0)", 'precision(1.0_kr1) = ', precision(1.0_kr1) if (nkr >= 2) print "(A,I0)", 'precision(1.0_kr2) = ', precision(1.0_kr2) if (nkr >= 3) print "(A,I0)", 'precision(1.0_kr3) = ', precision(1.0_kr3) write(*, "(A,I0,A)", advance='no') & 'Number of different real kinds = ', nkr, ', real kinds:' do n = 1, nkr write(*, "(1X,I0)", advance=merge('no ', 'yes', n < nkr)) allkr(n) end do print "(3A)", 'There ', merge('may be', 'are no', nkr >= maxkr), ' more real kinds' end subroutine realkinds end program kinds_02 lfortran-0.63.0/integration_tests/string_28.f900000664000175000017500000000046215174404631021526 0ustar alastairalastairprogram string_28 CHARACTER(100), DIMENSION(100) :: calibration_document INTEGER ::len_line, char_value calibration_document(3) = 'abc' len_line = 1 char_value = IACHAR(calibration_document(3)(len_line:len_line)) print *, char_value if (char_value /= 97) error stop end program lfortran-0.63.0/integration_tests/associate_16.f900000664000175000017500000000173715174404631022176 0ustar alastairalastairmodule stdlib_hashmaps_associate_16 implicit none type :: open_map_entry_type integer(4) :: hash_val end type open_map_entry_type type open_map_entry_ptr type(open_map_entry_type), pointer :: target => null() end type open_map_entry_ptr type :: open_hashmap_type type(open_map_entry_ptr), allocatable :: inverse(:) end type open_hashmap_type end module stdlib_hashmaps_associate_16 program associate_16 use stdlib_hashmaps_associate_16 implicit none type(open_hashmap_type) :: map integer(4) :: inv_index = 1 integer(4) :: test = 1 allocate(map % inverse(1)) allocate(map % inverse(1) % target) associate(inverse => map % inverse(inv_index)) if (associated(inverse % target)) then test = 2 end if end associate print *, test if (test /= 2) error stop deallocate(map % inverse(1) % target) end programlfortran-0.63.0/integration_tests/read_79.f900000664000175000017500000000032515174404631021137 0ustar alastairalastairprogram read_79 logical :: x integer :: stat character(len=64) :: stored_data stored_data = ' F' stat = 0 read(stored_data(2:2), *, iostat=stat) x if (stat /= 0) error stop end program read_79 lfortran-0.63.0/integration_tests/select_type_37.f900000664000175000017500000000140715174404631022540 0ustar alastairalastairprogram select_type_37 implicit none character(5) :: a(2) a(1) = 'hello' a(2) = 'world' call sub(a) contains subroutine sub(x) class(*), intent(in) :: x(:) integer :: u, n character(100) :: buf select type (x) type is (character(*)) ! Unformatted write of character array open(newunit=u, status='scratch', form='unformatted', access='stream') write(u) x close(u) ! Formatted write of character array write(buf, '(2A5)') x if (buf(1:5) /= 'hello') error stop if (buf(6:10) /= 'world') error stop class default error stop end select print *, "PASS" end subroutine end program lfortran-0.63.0/integration_tests/string_94.f900000664000175000017500000000062415174404631021531 0ustar alastairalastairprogram test_string_concat implicit none type :: string_t character(5) :: s end type string_t type(string_t) :: t character(:), allocatable :: result t%s = "World" result = "Hello " // t%s if (result /= "Hello World") error stop "wrong string" if (len(result) /= 11) error stop "wrong length" print *, "test passed" end program test_string_concat lfortran-0.63.0/integration_tests/intrinsics_269.f900000664000175000017500000001155515174404631022501 0ustar alastairalastairprogram intrinsics_269 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp) :: arg_x(15) real(sp) :: arg_y(15) real(dp) :: res_x(15) real(sp) :: res_y(15) real(dp) :: expected_res_x(15) real(sp) :: expected_res_y(15) real(dp) :: expected_x(10) real(sp) :: expected_y(10) real(dp) :: a = 0.5178181202_dp real(sp) :: b = -0.072816_sp real(dp) :: c = -0.5178181202_dp real(sp) :: d = 0.072816_sp real(dp), parameter :: res_dp(10) = acos([-0.62818828_dp, -0.51725372_dp, -0.29257208_dp, & 0.62818828_dp, 0.51725372_dp, 0.29257208_dp, 1.00_dp, 0.829362821_dp, 0.952716192_dp, -0.241626228_dp]) real(sp), parameter :: res_sp(10) = acos([-0.62818828_sp, -0.51725372_sp, -0.29257208_sp, & 0.62818828_sp, 0.51725372_sp, 0.29257208_sp, 1.00_sp, 0.829362821_sp, 0.952716192_sp, -0.241626228_sp]) expected_x = [2.2500188380589141_dp, 2.1144352537866755_dp, 1.8677118371228034_dp, & 0.89157381553087900_dp, 1.0271573998031178_dp, 1.2738808164669899_dp, 0.0000000000000000_dp, & 0.59283005557227886_dp, 0.30874327684982894_dp, 1.8148377145860481_dp] expected_y = [2.25001884_sp, 2.11443520_sp, 1.86771178_sp, & 0.891573846_sp, 1.02715743_sp, 1.27388084_sp, 0.00000000_sp, & 0.592830062_sp, 0.308743358_sp, 1.81483769_sp] arg_x = [-0.67922251126_dp, -0.54363892699177885_dp, -0.29691551032790681_dp, & 0.67922251126401767_dp, 0.54363892699177885_dp, 0.29691551032790681_dp, 0.5707963267948966_dp, & 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp, -0.7281628262782_dp, & 0.5707963267948966_dp, 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp] arg_y = [-0.679222465_sp, -0.543638885_sp, -0.296915501_sp, & 0.679222465_sp, 0.543638885_sp, 0.296915501_sp, 0.57079637_sp, & 0.077966249_sp, 0.262053013_sp, -0.244041398_sp, -0.7281628262782_sp, & 0.57079637_sp, 0.077966249_sp, 0.262053013_sp, -0.244041398_sp] res_x = acos(arg_x) res_y = acos(arg_y) expected_res_x = [2.3174990949497780_dp, 2.1455629489588066_dp, 1.8722571937442951_dp, & 0.82409355863454103_dp, 0.99602970463098672_dp, 1.2693354598454980_dp, 0.96332095907306292_dp, & 1.4927508492754979_dp, 1.3056473413839662_dp, 1.8173273965123287_dp, & 2.3864340230054486_dp, 0.96332095907306292_dp, 1.4927508492754979_dp, 1.3056473413839662_dp, & 1.8173273965123287_dp] expected_res_y = [2.31749892_sp, 2.14556289_sp, 1.87225723_sp, & 0.824093640_sp, 0.996029735_sp, 1.26933551_sp, 0.963320911_sp, & 1.49275088_sp, 1.30564737_sp, 1.81732738_sp, 2.38643408_sp, & 0.963320911_sp, 1.49275088_sp, 1.30564737_sp, & 1.81732738_sp] do i = 1, size(res_dp) print *, res_dp(i) if (abs(res_dp(i) - expected_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_x) print *, res_x(i) if (abs(res_x(i)) - abs(expected_res_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_y(i)) > 1e-5) error stop end do do i = 1, size(res_y) print *, res_y(i) if (abs(res_y(i)) - abs(expected_res_y(i)) > 1e-5) error stop end do print *, acos(a) if (abs(acos(a)) - 1.0264977928984282_dp > 1e-12) error stop print *, acos(0.5178181202_dp) if (abs(acos(0.5178181202_dp) - 1.0264977928984282_dp) > 1e-12) error stop print *, acos(b) if (acos(b) - (1.64367688_sp) > 1e-5) error stop print *, acos(-0.072816_sp) if (acos(-0.072816_sp) - (1.64367688_sp) > 1e-5) error stop print *, acos(c) if (acos(c) - (2.1150948606913649_dp) > 1e-12) error stop print *, acos(-0.5178181202_dp) if (acos(-0.5178181202_dp) - (2.1150948606913649_dp) > 1e-12) error stop print *, acos(d) if (acos(d) - (1.49791586_sp) > 1e-5) error stop print *, acos(0.072816_sp) if (acos(0.072816_sp) - (1.49791586_sp) > 1e-5) error stop a = -0.271927291_dp b = -0.6382728_sp c = 0.271927291_dp d = 0.6382728_sp print *, acos(a) if (abs(acos(a) - (1.8461915525880368_dp)) > 1e-12) error stop print *, acos(-0.271927291_dp) if (abs(acos(-0.271927291_dp) - (1.8461915525880368_dp)) > 1e-12) error stop print *, acos(b) if (acos(b) - (2.26304889_sp) > 1e-5) error stop print *, acos(-0.6382728_sp) if (acos(-0.6382728_sp) - (2.26304889_sp) > 1e-5) error stop print *, acos(c) if (acos(c) - (1.2954011010017565_dp) > 1e-12) error stop print *, acos(0.271927291_dp) if (acos(0.271927291_dp) - (1.2954011010017565_dp) > 1e-12) error stop print *, acos(d) if (acos(d) - (0.878543794_sp) > 1e-5) error stop print *, acos(0.6382728_sp) if (acos(0.6382728_sp) - (0.878543794_sp) > 1e-5) error stop end programlfortran-0.63.0/integration_tests/bindc4.f900000664000175000017500000000246515174404631021057 0ustar alastairalastairprogram bindc4 use iso_c_binding, only: c_associated, c_loc, c_ptr, c_f_pointer, c_null_ptr, c_intptr_t type(c_ptr) :: queries type(c_ptr) :: queries2 = c_null_ptr integer :: i, j integer(2), target :: xv(3, 4), yv(3,4) integer :: newshape(2) integer(2), pointer :: x(:, :), y(:,:) newshape(1) = 2 newshape(2) = 3 x => xv y => yv do i = lbound(x, 1), ubound(x, 1) do j = lbound(x, 2), ubound(x, 2) print *, i, j, transfer(c_loc(x(i, j)), 0_c_intptr_t) end do end do call c_f_pointer(queries, x, newshape) print *, transfer(c_loc(x), 0_c_intptr_t), transfer(queries, 0_c_intptr_t) do i = lbound(x, 1), ubound(x, 1) do j = lbound(x, 2), ubound(x, 2) print *, i, j, transfer(c_loc(x(i, j)), 0_c_intptr_t) end do end do call c_f_pointer(queries, x, [3, 4]) print *, transfer(c_loc(x), 0_c_intptr_t), transfer(queries, 0_c_intptr_t) do i = lbound(x, 1), ubound(x, 1) do j = lbound(x, 2), ubound(x, 2) print *, i, j, transfer(c_loc(x(i, j)), 0_c_intptr_t) end do end do if (.not. c_associated(queries, c_loc(x(1, 1)))) error stop if (.not. c_associated(queries, c_loc(x))) error stop if (c_associated(queries, c_loc(y))) error stop if (c_associated(queries2)) error stop ! TODO: Fix the following test !if (.not. c_associated(queries)) error stop queries = c_null_ptr end program lfortran-0.63.0/integration_tests/stop_03.f900000664000175000017500000000005215174404631021171 0ustar alastairalastairprogram stop_03 stop "hi" end program lfortran-0.63.0/integration_tests/operator_overloading_05_module3.f900000664000175000017500000000105215174404631026063 0ustar alastairalastairmodule operator_overloading_05_module3 use operator_overloading_05_module2, only: string_type, operator(>=), assignment(=) contains pure subroutine insert_head( array ) type(string_type), intent(inout) :: array(0:) type(string_type) :: tmp integer(4) :: i tmp = array(0) find_hole: do i=1, size(array, kind=4)-1 if ( array(i) >= tmp ) exit find_hole array(i-1) = array(i) end do find_hole array(i-1) = tmp end subroutine insert_head end module program main end program lfortran-0.63.0/integration_tests/submodule_52.f900000664000175000017500000000113615174404631022213 0ustar alastairalastairmodule submodule_52_m implicit none interface module subroutine foo() bind(C) end subroutine module integer function bar(x) bind(C, name="bar_c") integer, intent(in) :: x end function end interface end module submodule(submodule_52_m) submodule_52_m_sub implicit none contains module procedure foo print *, "foo called" end procedure module procedure bar bar = x + 1 end procedure end submodule program submodule_52 use submodule_52_m implicit none integer :: res call foo() res = bar(41) print *, res if (res /= 42) error stop end program lfortran-0.63.0/integration_tests/format_62.f900000664000175000017500000000201515174404631021502 0ustar alastairalastairprogram format_62 implicit none character(16) :: answer real :: ranswer open (10, file='format_62_tmp.txt', status='unknown', form='formatted') write (10, '(f5.4)') 0.9999 rewind (10) read (10, '(a)') answer if (trim(answer) /= '.9999') error stop rewind (10) write (10, '(a)') '.9999' rewind (10) read (10, '(f5.4)') ranswer if (abs(ranswer - 0.9999) >= 0.0001) error stop rewind (10) write (10, '(f6.4)') 0.9999 rewind (10) read (10, '(a)') answer if (trim(answer) /= '0.9999') error stop rewind (10) write (10, '(f4.3)') 0.123 rewind (10) read (10, '(a)') answer if (trim(answer) /= '.123') error stop rewind (10) write (10, '(f5.3)') 0.123 rewind (10) read (10, '(a)') answer if (trim(answer) /= '0.123') error stop rewind (10) write (10, '(f5.3)') -0.123 rewind (10) read (10, '(a)') answer if (trim(answer) /= '-.123') error stop close (10, status='delete') end program format_62 lfortran-0.63.0/integration_tests/c_f_proc_ptr_01.f900000664000175000017500000000150215174404631022642 0ustar alastairalastairprogram test_c_f_procpointer use iso_c_binding, only: c_funptr, c_funloc, c_f_procpointer implicit none abstract interface subroutine sub_interface(x) bind(c) use iso_c_binding integer(c_int), value :: x end subroutine end interface procedure(sub_interface), pointer :: f_proc type(c_funptr) :: c_proc interface subroutine c_callback(x) bind(c, name='c_callback') use iso_c_binding integer(c_int), value :: x end subroutine end interface ! Get C function pointer using c_funloc c_proc = c_funloc(c_callback) ! Convert to Fortran procedure pointer call c_f_procpointer(c_proc, f_proc) ! Call C function via Fortran procedure pointer call f_proc(42) print *, "test passed" end program test_c_f_procpointer lfortran-0.63.0/integration_tests/template_03.f900000664000175000017500000000231515174404631022023 0ustar alastairalastairmodule template_03_m requirement op(T, U, V, op) type, deferred :: T type, deferred :: U type, deferred :: V interface elemental function op(a, b) type(T), intent(in) :: a type(U), intent(in) :: b type(V) :: op end function end interface end requirement template axpy_tmpl(T, U, V, W, plus, times) public :: axpy require :: op(V, W, V, plus) require :: op(T, U, W, times) contains subroutine axpy(a, x, y) type(T), intent(in) :: a type(U), intent(in) :: x(:) type(V), intent(inout) :: y(:) integer :: i do i = 1, size(x) y(i) = plus(y(i), times(a, x(i))) end do end subroutine end template contains subroutine f() integer, parameter :: sp = kind(1.0), dp = kind(1.d0) instantiate axpy_tmpl(real, integer, real, real, operator(+), operator(*)) real :: a integer :: x(3) real :: y(3) a = 0.5 x = 2 y = 0 call axpy(a, x, y) print *, y end subroutine end module program template_03 use template_03_m, only: f call f() end programlfortran-0.63.0/integration_tests/intrinsics_316.f900000664000175000017500000000061215174404631022462 0ustar alastairalastairprogram intrinsics_316 real :: x(2) x = [1.2, 2.3] print *, max(0., x) if (any(abs(max(0., x) - [1.2, 2.3]) > 1e-5)) error stop print *, max([0., 1.], x) if (any(abs(max([0., 1.], x) - [1.2, 2.3]) > 1e-5)) error stop print *, min(0., x) if (any(abs(min(0., x) - [0.0, 0.0]) > 1e-5)) error stop print *, min([0., 1.], x) if (any(abs(min([0., 1.], x) - [0.0, 1.0]) > 1e-5)) error stop end programlfortran-0.63.0/integration_tests/procedure_18.f900000664000175000017500000000203115174404631022201 0ustar alastairalastairmodule mod1_procedure_18 implicit none private public :: f_function contains elemental function f_function(x, y) result(fx) real, intent(in) :: x real, intent(in), optional :: y real :: w_y real :: fx w_y=1.0 if (present(y)) w_y=y fx = w_y end function f_function end module mod1_procedure_18 module mod2_procedure_18 use :: mod1_procedure_18 implicit none private public :: function_interface interface function_interface module procedure f_function end interface end module mod2_procedure_18 program procedure_18 use :: mod1_procedure_18 use :: mod2_procedure_18 implicit none real :: res, eps res = 0.5 eps = 1e-8 print *, "fx is ", f_function(0.8, y=0.5) if (abs(f_function(0.8, y=0.5) - res) > eps) error stop print *, "fx is ", function_interface(0.8, 0.5) if (abs(function_interface(0.8, 0.5) - res) > eps) error stop print *, "fx is ", function_interface(0.8, y=0.5) if (abs(function_interface(0.8, y=0.5) - res) > eps) error stop end program procedure_18 lfortran-0.63.0/integration_tests/intrinsics_157.f900000664000175000017500000000443115174404631022470 0ustar alastairalastairprogram intrinsics_157 logical, parameter :: l1 = ble(10, 5) logical, parameter :: l2 = ble(10_8, -5_8) integer:: k1 = 10 integer:: k2 = 5 integer:: k3 = -5 integer:: k4 = 15 integer:: k5 = 0 integer:: k6 = -15 logical:: f = .false. logical, parameter :: ar1(4) = ble([1, 2, 4, 5], 3) logical, parameter :: ar2(4) = ble([-1, 3, -7, 5], -3) integer :: arr1(4) integer :: arr2(3) logical :: res(3) arr1 = [11, 2, 13, 4] arr2 = [-5_8, 7_8, 0_8] print *, l1 if (l1 .neqv. .false.) error stop print *, l2 if (l2 .neqv. .true.) error stop print *, ar1 if (any(ar1) .neqv. .true.) error stop print *, ar2 if (any(ar2) .neqv. .true.) error stop print*, ble(10, 5) if (ble(10, 5) .neqv. .false.) error stop print*, ble(-5, 10) if (ble(-5, 10) .neqv. .false.) error stop print*, ble(-5, 5) if (ble(-5, 5) .neqv. .false.) error stop print*, ble(-5, -15) if (ble(-5, -15) .neqv. .false.) error stop print*, ble(5, 15) if (ble(5, 15) .neqv. .true.) error stop print*, ble(5, -15) if (ble(5, -15) .neqv. .true.) error stop print*, ble(0, -5) if (ble(0, -5) .neqv. .true.) error stop print*, ble(0, 5) if (ble(0, 5) .neqv. .true.) error stop print*, ble(-5, 0) if (ble(-5, 0) .neqv. .false.) error stop print*, ble(5, 0) if (ble(5, 0) .neqv. f) error stop print*, ble(k1, k2) if (ble(k1, k2) .neqv. .false.) error stop print*, ble(k3, k1) if (ble(k3, k1) .neqv. .false.) error stop print*, ble(k3, k3) if (ble(k3, k3) .neqv. .true.) error stop print*, ble(k3, k6) if (ble(k3, k6) .neqv. .false.) error stop print*, ble(k2, k4) if (ble(k2, k4) .neqv. .true.) error stop print*, ble(k2, k6) if (ble(k2, k6) .neqv. .true.) error stop print*, ble(k5, k3) if (ble(k5, k3) .neqv. .true.) error stop print*, ble(k5, k2) if (ble(k5, k2) .neqv. .true.) error stop print*, ble(k3, k5) if (ble(k3, k5) .neqv. .false.) error stop print*, ble(k2, k5) if (ble(k2, k5) .neqv. f) error stop print *, ble(arr1, 5) if (any(ble(arr1, 5) .neqv. .true.) .neqv. .true.) error stop res = ble(arr2, k5) print *, res if (any(res .neqv. .true.) .neqv. .true.) error stop end program lfortran-0.63.0/integration_tests/expr_16.f900000664000175000017500000000025115174404631021167 0ustar alastairalastairprogram parconst implicit none integer a parameter (a = 8) integer (a) b b = 10_8 print *, b if (b /= 10_8) error stop end program parconst lfortran-0.63.0/integration_tests/string_14.f900000664000175000017500000000214515174404631021521 0ustar alastairalastairmodule string_14_stdlib_string_type type :: string_type sequence private character(len=:), allocatable :: raw end type string_type interface write(formatted) module procedure :: write_formatted end interface interface read(formatted) module procedure :: read_formatted end interface contains subroutine write_formatted(string, unit, iotype, v_list, iostat, iomsg) type(string_type), intent(in) :: string integer, intent(in) :: unit character(len=*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg end subroutine write_formatted subroutine read_formatted(string, unit, iotype, v_list, iostat, iomsg) type(string_type), intent(inout) :: string integer, intent(in) :: unit character(len=*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg character(len=:), allocatable :: line end subroutine read_formatted end module program string_14 end program lfortran-0.63.0/integration_tests/equivalence_26.f900000664000175000017500000000054715174404631022523 0ustar alastairalastairprogram equivalence_26 implicit none integer :: i1 common // i1 integer :: i2, i3, i4 equivalence (i1, i2, i3, i4) i1 = 3 i2 = 2 i3 = 3 if (i1 /= 3) error stop if (i2 /= 3) error stop i1 = 1 if (i3 /= 1) error stop i4 = i1 + i2 + i3 if (i4 /= 3) error stop end program lfortran-0.63.0/integration_tests/read_63.f900000664000175000017500000000242015174404631021126 0ustar alastairalastair! Test read into allocatable-arrays, for integers and real program read_63 implicit none integer, parameter :: n_lines = 3, n_cols = 3 integer :: i ! Integer variables integer, dimension(:,:), allocatable :: array integer :: expected(n_lines, n_cols) character(len=n_cols), dimension(n_lines) :: file_str = ['890', '781', '874'] ! Real variables real, dimension(:,:), allocatable :: r_array real :: r_expected(n_lines, n_cols) character(len=n_cols), dimension(n_lines) :: r_file_str = ['123', '456', '789'] ! --- Integer Logic --- expected(1,:) = [8, 9, 0] expected(2,:) = [7, 8, 1] expected(3,:) = [8, 7, 4] allocate(array(n_lines, n_cols)) do i = 1, n_lines read(file_str(i), '(*(I1))') array(i, :) print *, "Int Row ", i, ": ", array(i, :) end do if (any(array /= expected)) error stop ! --- Real Logic --- r_expected(1,:) = [1.0, 2.0, 3.0] r_expected(2,:) = [4.0, 5.0, 6.0] r_expected(3,:) = [7.0, 8.0, 9.0] allocate(r_array(n_lines, n_cols)) do i = 1, n_lines read(r_file_str(i), '(*(F1.0))') r_array(i, :) print *, "Real Row ", i, ": ", r_array(i, :) end do if (any(abs(r_array - r_expected) > 1e-4)) error stop end program read_63lfortran-0.63.0/integration_tests/separate_compilation_13a.f900000664000175000017500000000037515174404631024560 0ustar alastairalastairmodule separate_compilation_13a_module use, intrinsic:: ieee_arithmetic, only: ieee_quiet_nan, ieee_class_type contains subroutine check(x) real, intent(inout) :: x TYPE(ieee_class_type) :: xy xy = ieee_quiet_nan x = 151.15981 end subroutine end module lfortran-0.63.0/integration_tests/intrinsics_315.f900000664000175000017500000000471515174404631022471 0ustar alastairalastairprogram intrinsics_315 integer (kind = 4):: a1 = 2147483647 integer (kind = 8):: a2 = 2147483648_8 integer (kind = 4):: b1 = 0_4 integer (kind = 8) :: b2 = 2147483648_8 logical :: c = .TRUE. real(kind = 4) :: r1 = 1.0_4 real(kind = 8) :: r2 = 3.4028234663852886e+40_8 real(kind = 4) :: p1 = 1.0_4 real(kind = 8) :: p2 = 3.4028234663852886e+40_8 print *, OUT_OF_RANGE(2147483648_8, 0_4, .TRUE.) if (OUT_OF_RANGE(2147483648_8, 0_4, .TRUE.) .neqv. .true.) error stop print *, OUT_OF_RANGE(6372_4, 2147483648_8, .TRUE.) if (OUT_OF_RANGE(6372_4, 2147483648_8, .TRUE.) .neqv. .false.) error stop print *, OUT_OF_RANGE(6372_4, 2147_4, .TRUE.) if (OUT_OF_RANGE(6372_4, 2147_4, .TRUE.) .neqv. .false.) error stop print *, OUT_OF_RANGE(2147483648_8, 9223372036854775807_8, .TRUE.) if (OUT_OF_RANGE(2147483648_8, 9223372036854775807_8, .TRUE.) .neqv. .false.) error stop print *, OUT_OF_RANGE(a2, b1, c) if (OUT_OF_RANGE(a2, b1, c) .neqv. .true.) error stop print *, OUT_OF_RANGE(a1, b2, c) if (OUT_OF_RANGE(a1, b2, c) .neqv. .false.) error stop a1 = 6372 a2 = 2147483648_8 b1 = 2147_4 b2 = 9223372036854775807_8 print *, OUT_OF_RANGE(a1, b1, c) if (OUT_OF_RANGE(a1, b1, c) .neqv. .false.) error stop print *, OUT_OF_RANGE(a1, b2, c) if (OUT_OF_RANGE(a1, b2, c) .neqv. .false.) error stop print *, OUT_OF_RANGE(3.4028234663852886e+40_8, 1.0_4, .TRUE.) if (OUT_OF_RANGE(3.4028234663852886e+40_8, 1.0_4, .TRUE.) .neqv. .true.) error stop print *, OUT_OF_RANGE(1.0_4, 3.4028234663852886e+40_8, .TRUE.) if (OUT_OF_RANGE(1.0_4, 3.4028234663852886e+40_8, .TRUE.) .neqv. .false.) error stop print *, OUT_OF_RANGE(3.4028235e+35_4, 1.0_4, .TRUE.) if (OUT_OF_RANGE(3.4028235e+35_4, 1.0_4, .TRUE.) .neqv. .false.) error stop print *, OUT_OF_RANGE(1.7976931348623158e+308_8, 2.0_8, .TRUE.) if (OUT_OF_RANGE(1.7976931348623158e+308_8, 2.0_8, .TRUE.) .neqv. .false.) error stop print *, OUT_OF_RANGE(r2, p1, c) if (OUT_OF_RANGE(r2, p1, c) .neqv. .true.) error stop print *, OUT_OF_RANGE(r2, p2, c) if (OUT_OF_RANGE(r2, p2, c) .neqv. .false.) error stop r1 = 1.0_4 r2 = 1.7976931348623158e+308_8 p1 = 2.0_4 p2 = 3.4028235e+38_4 print *, OUT_OF_RANGE(r1, p1, c) if (OUT_OF_RANGE(r1, p1, c) .neqv. .false.) error stop print *, OUT_OF_RANGE(r2, p2, c) if (OUT_OF_RANGE(r2, p2, c) .neqv. .false.) error stop end program lfortran-0.63.0/integration_tests/submodule_01.f900000664000175000017500000000442715174404631022213 0ustar alastairalastair! Submodules test, taken from: ! https://www.ibm.com/docs/en/xl-fortran-aix/15.1.3?topic=techniques-submodules-fortran-2008 MODULE m1 TYPE Base INTEGER :: i END TYPE INTERFACE MODULE SUBROUTINE sub1(i, b) ! Module procedure interface body for sub1 INTEGER, INTENT(IN) :: i TYPE(Base), INTENT(IN) :: b END SUBROUTINE END INTERFACE END MODULE MODULE m2 USE m1 ! Use association of module m1 INTERFACE REAL MODULE FUNCTION func1() ! Module procedure interface body for func1 END FUNCTION MODULE FUNCTION func2(b) ! Module procedure interface body for func2 TYPE(Base) :: b TYPE(Base) :: func2 END FUNCTION END INTERFACE END MODULE MODULE m4 USE m1 ! Use association of module m1 TYPE, EXTENDS(Base) :: NewType REAL :: j END TYPE END MODULE SUBMODULE (m1) m1sub USE m4 ! Use association of module m4 CONTAINS MODULE SUBROUTINE sub1(i, b) ! Implementation of sub1 declared in m1 INTEGER, INTENT(IN) :: i TYPE(Base), INTENT(IN) :: b PRINT *, "sub1", i, b END SUBROUTINE END SUBMODULE SUBMODULE (m2) m2sub CONTAINS REAL MODULE FUNCTION func1() ! Implementation of func1 declared in m2 func1 = 20 END FUNCTION END SUBMODULE SUBMODULE (m2:m2sub) m2sub2 CONTAINS MODULE FUNCTION func2(b) ! Implementation of func2 declared in m2 TYPE(Base) :: b TYPE(Base) :: func2 func2 = b END FUNCTION END SUBMODULE MODULE m3 INTERFACE SUBROUTINE interfaceSub1(i, b) USE m1 INTEGER, INTENT(IN) :: i TYPE(Base), INTENT(IN) :: b END SUBROUTINE REAL FUNCTION interfaceFunc1() END FUNCTION FUNCTION interfaceFunc2(b) USE m1 TYPE(Base) :: b TYPE(Base) :: interfaceFunc2 END FUNCTION END INTERFACE TYPE Container PROCEDURE(interfaceSub1), NOPASS, POINTER :: pp1 PROCEDURE(interfaceFunc1), NOPASS, POINTER :: pp2 PROCEDURE(interfaceFunc2), NOPASS, POINTER :: pp3 END TYPE END MODULE PROGRAM example USE m1 USE m2 USE m3 TYPE(Container) :: c1 c1%pp1 => sub1 c1%pp2 => func1 c1%pp3 => func2 CALL c1%pp1(10, Base(11)) PRINT *, "func1", int(c1%pp2()) PRINT *, "func2", c1%pp3(Base(5)) END PROGRAM lfortran-0.63.0/integration_tests/implied_do_loops3.f900000664000175000017500000000077615174404631023323 0ustar alastairalastairprogram implied_do_loop3 integer::i,j,k real:: a(3) = (/(j*3,j=1,3)/) real:: b(3) = (/(j*2,j=1,3)/) ! implied do loop print *,"Loop 1" print *, ( i, ( i*j, j = 1, 3), i = 1, 3) ! nested implied do loop (double) print *,"Loop 2" print*, ((a(i)*b(j), j=1, 2), i=1, 3) print *,"Loop 3" print*, ((a(i)*b(j), i=1, 3), j=1, 2) ! nested implied do loop (triple) print *,"Loop4" print*, (i,(i+j,(i+j+k,k=1,4),j=1,2),i=1,3) print *,"Loop5" print*, (i,(i*j,((i*j)+k,k=1,4),j=1,2),i=1,3) end programlfortran-0.63.0/integration_tests/implicit_argument_casting_02.f900000664000175000017500000000037015174404631025432 0ustar alastairalastairsubroutine idz_realcomp(n, a) implicit none integer n real a(n) a = 12.5d0 end subroutine program main implicit none complex :: w(5) call idz_realcomp(10, w(1)) print *, w if (abs(real(w(1)) - 12.5) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/associate_47.f900000664000175000017500000000122315174404631022170 0ustar alastairalastairmodule associate_47_mod implicit none abstract interface function func_i() result(r) logical :: r end function end interface type :: t integer :: val = 0 end type interface t module procedure create end interface contains function create(desc, f) result(r) character(len=*), intent(in) :: desc procedure(func_i), intent(in), pointer, optional :: f type(t) :: r r%val = len(desc) end function end module program associate_47 use associate_47_mod, only : t implicit none type(t) :: x associate(me => 1) x = t("hello") end associate if (x%val /= 5) error stop print *, x%val end program lfortran-0.63.0/integration_tests/nested_06.f900000664000175000017500000000042715174404631021477 0ustar alastairalastairmodule nested_06_a implicit none contains subroutine b(x) real :: x print *, "b()" call c() contains subroutine c() print *, 5 print *, x end subroutine c end subroutine b end module program nested_06 use nested_06_a, only: b implicit none call b(6.0) end lfortran-0.63.0/integration_tests/gpu_metal_130.f900000664000175000017500000000053715174404631022252 0ustar alastairalastairprogram gpu_metal_130 ! Test: sum() inside a do loop nested within do concurrent ! Regression: Metal shader called undeclared _lcompilers_Sum helper implicit none integer :: i, j real :: a(3), r(1) a = 1.0 do concurrent (i = 1:1) do j = 1, 1 r(i) = sum(a) end do end do print *, r(1) if (abs(r(1) - 3.0) > 1e-5) error stop end program lfortran-0.63.0/integration_tests/char_array_indexing_02.f900000664000175000017500000000060315174404631024205 0ustar alastairalastairmodule mod_char_array_indexing_02 implicit none character, parameter :: chars(0:9) = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] end module mod_char_array_indexing_02 program char_array_indexing_02 use mod_char_array_indexing_02, only : chars implicit none character(len=1) :: x x = chars(3) print *, "x: ", x if (x /= "d") error stop end program lfortran-0.63.0/integration_tests/allocate_04.f900000664000175000017500000000074215174404631021777 0ustar alastairalastairprogram allocate_04 implicit none integer, allocatable :: c(:, :, :) character(len=:), allocatable :: string character(len=:), allocatable :: message character(len=20) :: num allocate(character(len=8)::string) allocate(character(len=20)::message) allocate(c(3, 3, 3)) num = "lfortran" string = trim(num) if (string /= "lfortran") error stop num = "lfortran working" message = num(1:len_trim(num)+1) print *, message end program lfortran-0.63.0/integration_tests/class_42.f900000664000175000017500000000256215174404631021324 0ustar alastairalastairmodule class_42_mod type, public :: AbsType contains procedure :: abs_method end type AbsType type, extends(AbsType) :: ConcreteType contains procedure :: abs_method => concrete_abs_method end type ConcreteType type :: Wrapper class(AbsType), allocatable :: obj class(ConcreteType), allocatable :: c_obj end type Wrapper type :: Client type(Wrapper) :: wrapped contains procedure :: caller end type Client contains subroutine concrete_abs_method(self, val) class(ConcreteType), intent(in) :: self integer, intent(in) :: val print *, "concrete_abs_method called with value", val if (val /= 37) error stop end subroutine concrete_abs_method subroutine caller(self) class(Client), intent(in) :: self call self%wrapped%c_obj%abs_method(37) call self%wrapped%obj%abs_method(42) end subroutine caller subroutine abs_method(self, val) class(AbsType), intent(in) :: self integer, intent(in) :: val print *, "abs_method called with value ", val if (val /= 42) error stop end subroutine abs_method end module class_42_mod program class_42 use class_42_mod class(Client), allocatable :: var allocate(var) allocate(ConcreteType :: var%wrapped%c_obj) allocate(var%wrapped%obj) call var%caller() end program class_42lfortran-0.63.0/integration_tests/statement1.f900000664000175000017500000000060415174404631021772 0ustar alastairalastairprogram statement1 integer :: i,j integer, parameter :: dp = kind(0.d0) real(dp) :: dfloat real :: sfloat, ti, sum integer :: ifloat sfloat(i,j) = i*j dfloat(i,j) = i+j ifloat(i,j) = i+j ti = sfloat(1,8) if (abs(ti-8) > 1e-5) error stop sum = sfloat(12,9)+12.42 if (abs(sum-120.42) > 1e-5) error stop if (abs(dfloat(5,4)-9) > 1e-10) error stop if (ifloat(5,4) /= 9) error stop end programlfortran-0.63.0/integration_tests/format_before_read_01.f900000664000175000017500000000107515174404631024015 0ustar alastairalastairprogram format_before_read_01 implicit none integer :: i, j, k character(len=7) :: input_string ! Test case: FORMAT statement precedes the READ statement ! This tests that the compiler correctly handles forward references ! to FORMAT statements input_string = "123 45 " 100 format (I3, I2, I2) read(input_string, 100) i, j, k if (i /= 123) error stop "Expected i = 123" if (j /= 4) error stop "Expected j = 4" if (k /= 5) error stop "Expected k = 5" print *, "Test passed: FORMAT before READ works correctly" end program format_before_read_01 lfortran-0.63.0/integration_tests/arrays_intrin_06.f900000664000175000017500000000047515174404631023104 0ustar alastairalastairprogram arrays_intrin_06 integer :: i, j integer, parameter :: dp = kind(0.d0) real(dp) :: x(3, 5), xdiff do i = 1, 3 do j = 1, 5 x(i, j) = (i + j) / 7._dp end do end do print *, minval(x) if (abs(minval(x) - 0.28571428571428570) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/openmp_63.f900000664000175000017500000000464115174404631021520 0ustar alastairalastairprogram openmp_63 use omp_lib implicit none integer, parameter :: n = 100 integer, parameter :: max_threads = 8 integer :: i, tid, nthreads integer :: thread_iterations(1:max_threads) = 0 ! Count iterations per thread integer :: thread_first(1:max_threads) = 1000 ! First iteration for each thread integer :: thread_last(1:max_threads) = -1 ! Last iteration for each thread integer :: expected_chunk_size logical :: test_passed = .true. ! Set number of threads call omp_set_num_threads(4) nthreads=0 !$omp parallel private(tid) !$omp single nthreads = omp_get_num_threads() !$omp end single !$omp end parallel print *, "Testing STATIC schedule with", nthreads, "threads" ! Test static schedule (default chunk) !$omp parallel do schedule(static) private(tid) do i = 1, n tid = omp_get_thread_num() + 1 !$omp critical thread_iterations(tid) = thread_iterations(tid) + 1 if (i < thread_first(tid)) thread_first(tid) = i if (i > thread_last(tid)) thread_last(tid) = i !$omp end critical end do !$omp end parallel do print*, thread_first(1:nthreads) print*, thread_last(1:nthreads) print*, thread_iterations(1:nthreads) ! Verify static behavior print *, "=== STATIC Schedule Results ===" expected_chunk_size = (n + nthreads - 1) / nthreads do i = 1, nthreads print '(A,I1,A,I3,A,I3,A,I3)', & "Thread ", i, ": iterations=", thread_iterations(i), & ", first=", thread_first(i), ", last=", thread_last(i) ! Static should give contiguous chunks if (thread_iterations(i) > 0) then ! Check contiguous iterations if (thread_last(i) - thread_first(i) + 1 /= thread_iterations(i)) then print *, "ERROR: Thread", i, "did not get contiguous iterations!" test_passed = .false. end if ! Check chunk sizes are roughly equal if (abs(thread_iterations(i) - expected_chunk_size) > 1) then print *, "ERROR: Thread", i, "chunk size deviates too much!" test_passed = .false. end if end if end do if (.not. test_passed) then error stop "STATIC schedule test FAILED!" end if print *, "STATIC schedule test PASSED!" end program openmp_63lfortran-0.63.0/integration_tests/class_94.f900000664000175000017500000000757415174404631021343 0ustar alastairalastair! Tests passing struct arrays to class array parameters module class_94_types implicit none type :: base_type integer :: value end type base_type type, extends(base_type) :: extended_type integer :: extra end type extended_type contains ! Subroutine that accepts class array subroutine process_class_array(arr) class(base_type), intent(in) :: arr(:) integer :: i do i = 1, size(arr) select type(arr) type is (base_type) if (arr(i)%value /= i * 10) error stop "Base type value mismatch" type is (extended_type) if (arr(i)%value /= i * 10) error stop "Extended type value mismatch" if (arr(i)%extra /= i * 100) error stop "Extended type extra mismatch" end select end do end subroutine process_class_array ! Subroutine that accepts class array and modifies it subroutine modify_class_array(arr) class(base_type), intent(inout) :: arr(:) integer :: i do i = 1, size(arr) select type(arr) type is (base_type) arr(i)%value = arr(i)%value + 1 type is (extended_type) arr(i)%value = arr(i)%value + 1 arr(i)%extra = arr(i)%extra + 1 end select end do end subroutine modify_class_array ! Function that accepts class array and returns sum function sum_class_values(arr) result(total) class(base_type), intent(in) :: arr(:) integer :: total, i total = 0 do i = 1, size(arr) total = total + arr(i)%value end do end function sum_class_values end module class_94_types program class_94 use class_94_types implicit none type(base_type), allocatable :: base_arr(:) type(extended_type), allocatable :: ext_arr(:) integer :: i, total ! Test 1: Pass base_type array to class array parameter print *, "Test 1: base_type array -> class array" allocate(base_arr(3)) do i = 1, 3 base_arr(i)%value = i * 10 end do call process_class_array(base_arr) print *, "Test 1 passed" !Test 2: Pass extended_type array to class array parameter print *, "Test 2: extended_type array -> class array" allocate(ext_arr(3)) do i = 1, 3 ext_arr(i)%value = i * 10 ext_arr(i)%extra = i * 100 end do call process_class_array(ext_arr) print *, "Test 2 passed" ! ! Test 3: Modify base_type array via class array parameter print *, "Test 3: Modify base_type array" call modify_class_array(base_arr) do i = 1, 3 if (base_arr(i)%value /= i * 10 + 1) error stop "Modification failed" end do print *, "Test 3 passed" !Test 4: Modify extended_type array via class array parameter print *, "Test 4: Modify extended_type array" call modify_class_array(ext_arr) do i = 1, 3 if (ext_arr(i)%value /= i * 10 + 1) error stop "Extended modification failed" if (ext_arr(i)%extra /= i * 100 + 1) error stop "Extended extra modification failed" end do print *, "Test 4 passed" ! Test 5: Use function with class array parameter print *, "Test 5: Function with class array" total = sum_class_values(base_arr) if (total /= 63) error stop "Sum of base_arr failed" ! (11 + 21 + 31) total = sum_class_values(ext_arr) if (total /= 63) error stop "Sum of ext_arr failed" ! (11 + 21 + 31) print *, "Test 5 passed" ! Test 6: Same type as class (base_type -> class(base_type)) print *, "Test 6: Same type as class" deallocate(base_arr) allocate(base_arr(2)) base_arr(1)%value = 100 base_arr(2)%value = 200 total = sum_class_values(base_arr) print *, "Total:", total if (total /= 300) error stop "Same type test failed" print *, "Test 6 passed" end program class_94 lfortran-0.63.0/integration_tests/template_lapack_01.f900000664000175000017500000000761315174404631023342 0ustar alastairalastairmodule template_lapack_01_m implicit none private public :: test_template requirement gemm_r(T, gemm) type, deferred :: T subroutine gemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc) character, intent(in) :: transa, transb integer, intent(in) :: m, n, k, lda, ldb, ldc type(T), intent(in) :: alpha, a(lda, *), b(ldb, *), beta type(T), intent(out) :: c(ldc, *) end subroutine end requirement requirement cast_r(T, U, cast) type, deferred :: T type, deferred :: U pure elemental function cast(arg) result(res) type(T), intent(in) :: arg type(U) :: res end function end requirement template external_matmul_t(T, gemm, cast_to_T) require :: gemm_r(T, gemm) require :: cast_r(real, T, cast_to_T) private contains function nonsimple_external_matmul(a,b) result(c) type(T), intent(in) :: a(:,:), b(:,:) type(T) :: c(size(a,1), size(b,2)) integer :: m, n, k m = size(a, dim=1) n = size(b, dim=2) k = size(a, dim=1) call gemm('n', 'n', m, n, k, cast_to_T(1.0), a, m, b, k, cast_to_T(0.0), c, m) end function end template contains subroutine my_gemm_real(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc) character, intent(in) :: transa, transb integer, intent(in) :: m, n, k, lda, ldb, ldc real, intent(in) :: alpha, a(lda, *), b(ldb, *), beta real, intent(out) :: c(ldc, *) end subroutine subroutine my_gemm_double(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc) integer, parameter :: dp = kind(1.d0) character, intent(in) :: transa, transb integer, intent(in) :: m, n, k, lda, ldb, ldc real(dp), intent(in) :: alpha, a(lda, *), b(ldb, *), beta real(dp), intent(out) :: c(ldc, *) end subroutine pure elemental function my_cast_to_real(a) result(b) real, intent(in) :: a real :: b b = a end function pure elemental function my_cast_to_double(a) result(b) integer, parameter :: dp = kind(1.d0) real, intent(in) :: a real(dp) :: b b = a end function function my_external_matmul(a, b) result(c) real, intent(in) :: a(:,:), b(:,:) real :: c(size(a,1), size(b,2)) integer :: m, n, k m = size(a, dim=1) n = size(b, dim=2) k = size(a, dim=1) call my_gemm_real('n', 'n', m, n, k, my_cast_to_real(1.0), a, m, b, k, my_cast_to_real(0.0), c, m) end function function simple_external_matmul {T, gemm, cast_to_T} (a, b) result(c) require :: gemm_r(T, gemm) require :: cast_r(real, T, cast_to_T) type(T), intent(in) :: a(:,:), b(:,:) type(T) :: c(size(a,1), size(b,2)) integer :: m, n, k m = size(a, dim=1) n = size(b, dim=2) k = size(a, dim=1) call gemm('n', 'n', m, n, k, cast_to_T(1.0), a, m, b, k, cast_to_T(0.0), c, m) end function subroutine test_template() integer, parameter :: dp = kind(1.d0) instantiate external_matmul_t(real, my_gemm_real, my_cast_to_real), & only: nonsimple_external_matmul_real => nonsimple_external_matmul instantiate external_matmul_t(real(dp), my_gemm_double, my_cast_to_double), & only: nonsimple_external_matmul_double => nonsimple_external_matmul real :: asp(2,2), bsp(2,2), csp(2,2) real(dp) :: adp(2,2), bdp(2,2), cdp(2,2) csp = simple_external_matmul {real, my_gemm_real, my_cast_to_real} (asp, bsp) cdp = simple_external_matmul {real(dp), my_gemm_double, my_cast_to_double} (adp, bdp) end subroutine end module program template_lapack_01 use template_lapack_01_m implicit none call test_template() end programlfortran-0.63.0/integration_tests/select_type_04.f900000664000175000017500000000036015174404631022527 0ustar alastairalastairmodule class_default_select_type_user1 use class_default_select_type_user implicit none end module class_default_select_type_user1 program select_type4 implicit none print *, "running select_type4 main program" end program select_type4 lfortran-0.63.0/integration_tests/gpu_metal_78.f900000664000175000017500000000167515174404631022211 0ustar alastairalastairprogram gpu_metal_78 ! Test that do concurrent with many allocatable arrays (>31 Metal buffers ! before packing) compiles and runs correctly on the Metal GPU backend. ! Each allocatable 3D array generates 1 data buffer + 3 dimension parameters. ! 8 arrays * 4 + 1 scalar = 33, which exceeds Metal's 31-buffer limit ! unless scalar parameters are packed into a single struct buffer. implicit none integer :: n, i real, allocatable :: a(:,:,:), b(:,:,:), c(:,:,:), d(:,:,:) real, allocatable :: e(:,:,:), f(:,:,:), g(:,:,:), r(:,:,:) n = 2 allocate(a(n,n,n), b(n,n,n), c(n,n,n), d(n,n,n)) allocate(e(n,n,n), f(n,n,n), g(n,n,n), r(n,n,n)) a = 1.0; b = 2.0; c = 3.0; d = 4.0 e = 5.0; f = 6.0; g = 7.0; r = 0.0 do concurrent(i = 1:n) r(1,1,i) = a(1,1,i) + b(1,1,i) + c(1,1,i) + d(1,1,i) & + e(1,1,i) + f(1,1,i) + g(1,1,i) end do if (abs(r(1,1,1) - 28.0) > 1e-6) error stop if (abs(r(1,1,2) - 28.0) > 1e-6) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/call_subroutine_without_type_01.f900000664000175000017500000000134215174404631026223 0ustar alastairalastairmodule module_call_subroutine_without_type_01 type :: myType real :: r contains procedure, pass(self) :: get_i end type myType contains subroutine get_i(self) class(myType), intent(inout) :: self call get_r() contains subroutine get_r() print *, "r = ", self % r if (self%r /= 1.0) error stop end subroutine get_r end subroutine get_i end module module_call_subroutine_without_type_01 program call_subroutine_without_type_01 use module_call_subroutine_without_type_01 class(myType), allocatable :: obj allocate(obj) obj%r = 1.0 call obj%get_i() end program call_subroutine_without_type_01 lfortran-0.63.0/integration_tests/print_10.f900000664000175000017500000000056315174404631021345 0ustar alastairalastairprogram print_10 implicit none character(8) :: a(2) = ['aa','bb'] character(25) :: out write(out, "(2(1X,A))") '"'//a//'"' ! Expected output (spaces are important) if (out /= ' "aa " "bb "') then print *, 'GOT : >'//out//'<' print *, 'EXPECTED: > "aa " "bb "<' error stop 1 end if end program lfortran-0.63.0/integration_tests/array_op_08.f900000664000175000017500000000065715174404631022040 0ustar alastairalastairprogram test integer :: A(3) = [1,2,3] logical :: X(3) integer :: tol = 2 real :: A2(3) = [1.0,2.0,3.0] real :: tol2 = 2.0 integer :: i X = abs(A) <= max(tol, tol * maxval(abs(A))) print *, X do i = 1, 2, 3 if (X(i) .neqv. .true.) error stop end do X = abs(A2) <= max(tol2, tol2 * maxval(abs(A2))) print *, X do i = 1, 2, 3 if (X(i) .neqv. .true.) error stop end do end programlfortran-0.63.0/integration_tests/array_section_18.f900000664000175000017500000000132215174404631023055 0ustar alastairalastair! Tests that copy-in/copy-out is skipped for array sections ! with undefined assumed-size bounds (recursive sequence association). program array_section_18 implicit none real :: a(4, 4) integer :: i, j do j = 1, 4 do i = 1, 4 a(i, j) = real(10 * j + i) end do end do call double_diag(4, a, 4) if (abs(a(1,1) - 22.0) > 0.001) error stop if (abs(a(2,2) - 44.0) > 0.001) error stop if (abs(a(3,3) - 66.0) > 0.001) error stop if (abs(a(4,4) - 88.0) > 0.001) error stop ! Off-diagonal elements should be unchanged if (abs(a(1,2) - 21.0) > 0.001) error stop if (abs(a(2,1) - 12.0) > 0.001) error stop print *, "All checks passed." end program lfortran-0.63.0/integration_tests/arrayitem_01.f900000664000175000017500000000045115174404631022202 0ustar alastairalastairmodule arrayitem_module_01 type :: block_1 integer :: a, c(5) end type type(block_1) :: struct_instance_block_1 end module program arrayitem_01 use arrayitem_module_01 struct_instance_block_1%c(1) = 19 if (struct_instance_block_1%c(1) /= 19) error stop end programlfortran-0.63.0/integration_tests/file_04_data.dat0000664000175000017500000000002015174404631022262 0ustar alastairalastair—D×£SBi»úÿ×£SÂlfortran-0.63.0/integration_tests/arrays_69.f900000664000175000017500000000733715174404631021536 0ustar alastairalastairprogram arrays_69 integer :: A(4) = [1,2,3,4] integer :: A1(3,3) = reshape([1,2,3,4,5,6,7,8,9], [3,3]) integer :: A2(2,2,2) = reshape([1,2,3,4,5,6,7,8], [2,2,2]) integer :: tmp(2,2) = reshape([5,5,5,5], [2,2]) !!!! ArrayItem = ArrayItem A([1,2]) = A([2,1]) if (A(1) /= 2 .or. A(2) /= 1) error stop A1([1,2],1) = A1([2,1],1) if (A1(1,1) /= 2 .or. A1(2,1) /= 1 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 4 .or. A1(2,2) /= 5 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 7 .or. A1(2,3) /= 8 .or. A1(3,3) /= 9) error stop A1([1,2],[2,3]) = A1([2,1],[2,3]) if (A1(1,1) /= 2 .or. A1(2,1) /= 1 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 4 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 8 .or. A1(2,3) /= 7 .or. A1(3,3) /= 9) error stop A1([1,2],1) = A1(1,[1,2]) if (A1(1,1) /= 2 .or. A1(2,1) /= 5 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 4 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 8 .or. A1(2,3) /= 7 .or. A1(3,3) /= 9) error stop A2(1,[1,2],[1,2]) = A2([1,2],[2,1],1) if (A2(1,1,1) /= 3 .or. A2(2,1,1) /= 2 .or. A2(1,2,1) /= 4 .or. A2(2,2,1) /= 4 .or. & & A2(1,1,2) /= 1 .or. A2(2,1,2) /= 6 .or. A2(1,2,2) /= 2 .or. A2(2,2,2) /= 8) error stop !!!! ArrayItem = ArrayConstant A([1,2]) = [5,5] if (A(1) /= 5 .or. A(2) /= 5) error stop A1([1,2],1) = [5,5] if (A1(1,1) /= 5 .or. A1(2,1) /= 5 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 4 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 8 .or. A1(2,3) /= 7 .or. A1(3,3) /= 9) error stop A1([1,2],[1,2]) = tmp if (A1(1,1) /= 5 .or. A1(2,1) /= 5 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 5 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 8 .or. A1(2,3) /= 7 .or. A1(3,3) /= 9) error stop A2([1,2],1,1) = [5,5] if (A2(1,1,1) /= 5 .or. A2(2,1,1) /= 5 .or. A2(1,2,1) /= 4 .or. A2(2,2,1) /= 4 .or. & & A2(1,1,2) /= 1 .or. A2(2,1,2) /= 6 .or. A2(1,2,2) /= 2 .or. A2(2,2,2) /= 8) error stop A2([1,2],1,[1,2]) = tmp if (A2(1,1,1) /= 5 .or. A2(2,1,1) /= 5 .or. A2(1,2,1) /= 4 .or. A2(2,2,1) /= 4 .or. & & A2(1,1,2) /= 5 .or. A2(2,1,2) /= 5 .or. A2(1,2,2) /= 2 .or. A2(2,2,2) /= 8) error stop !!! LHS and RHS contains common variable A = A([3,1,2,4]) if (A(1) /= 3 .or. A(2) /= 5 .or. A(3) /= 5 .or. A(4) /= 4) error stop A1 = A1(:,[3,2,1]) if (A1(1,1) /= 8 .or. A1(2,1) /= 7 .or. A1(3,1) /= 9 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 5 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 5 .or. A1(2,3) /= 5 .or. A1(3,3) /= 3) error stop A2 = A2(:,[2,1],:) if (A2(1,1,1) /= 4 .or. A2(2,1,1) /= 4 .or. A2(1,2,1) /= 5 .or. A2(2,2,1) /= 5 .or. & & A2(1,1,2) /= 2 .or. A2(2,1,2) /= 8 .or. A2(1,2,2) /= 5 .or. A2(2,2,2) /= 5) error stop A1(1,1:2) = A1(1,[2,1]) - A(1:2) if (A1(1,1) /= 2 .or. A1(2,1) /= 7 .or. A1(3,1) /= 9 .or. & & A1(1,2) /= 3 .or. A1(2,2) /= 5 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 5 .or. A1(2,3) /= 5 .or. A1(3,3) /= 3) error stop A1 = A1 * A1(1,1) if (A1(1,1) /= 4 .or. A1(2,1) /= 14 .or. A1(3,1) /= 18 .or. & & A1(1,2) /= 6 .or. A1(2,2) /= 10 .or. A1(3,2) /= 12 .or. & & A1(1,3) /= 10 .or. A1(2,3) /= 10 .or. A1(3,3) /= 6) error stop A2(:,1,:) = A2(1,:,:) * A2(1,1,1) if (A2(1,1,1) /= 16 .or. A2(2,1,1) /= 20 .or. A2(1,2,1) /= 5 .or. A2(2,2,1) /= 5 .or. & & A2(1,1,2) /= 8 .or. A2(2,1,2) /= 20 .or. A2(1,2,2) /= 5 .or. A2(2,2,2) /= 5) error stop A1([2,1],[1,2]) = A1([1,2],[3,2]) * A1(2,1) if (A1(1,1) /= 140 .or. A1(2,1) /= 140 .or. A1(3,1) /= 18 .or. & & A1(1,2) /= 140 .or. A1(2,2) /= 84 .or. A1(3,2) /= 12 .or. & & A1(1,3) /= 10 .or. A1(2,3) /= 10 .or. A1(3,3) /= 6) error stop end programlfortran-0.63.0/integration_tests/declaration_01.f900000664000175000017500000000137315174404631022476 0ustar alastairalastairprogram declaration_01 implicit none integer, parameter :: xi = 2 real, parameter :: xr = 2.0 ! real array initialized with integer constant value real, parameter :: x_real_3(3) = xi ! complex array initialized with integer constant value complex, parameter :: x_cmplx_3(3) = xi ! integer array initialized with real constant value integer, parameter :: x_int_3(3) = xr real :: y(2) = real([2, 3]) print *, x_real_3 if (any(x_real_3 /= xi)) error stop print *, x_cmplx_3 if (any(x_cmplx_3 /= (xi, 0))) error stop print *, x_int_3 if (any(x_int_3 /= xr)) error stop print *, y if (abs(y(1) - 2.0) > 1e-7) error stop if (abs(y(2) - 3.0) > 1e-7) error stop end program declaration_01 lfortran-0.63.0/integration_tests/intrinsics_416.f900000664000175000017500000000205415174404631022465 0ustar alastairalastair! This file check string concat functionality for arrays program intrinsics_416 implicit none character(:),allocatable:: str1(:), str2 character(4):: str3(2) character(4),parameter :: str4(2) = ['abc ','de '] character(2):: str5 character(16):: str6 str5 = 'xy' str1 = ['abc ', 'de '] str2 = 'abc ' str3 = ['abc ', 'de '] ! 1. Check str1 (Array) str6 = '' print "(*(A))", '"'//str1(:)//str5//'"' write(str6, "(*(A))") '"'//str1(:)//str5//'"' if ((str6) /= ('"abc xy""de xy"')) error stop ! 2. Check str2 (Scalar) str6 = '' print "(*(A))", '"'//str2//str5//'"' write(str6, "(*(A))") '"'//str2//str5//'"' if (str6 /= '"abc xy"') error stop ! 3. Check str3 (Fixed Array) str6 = '' print "(*(A))", '"'//str3//str5//'"' write(str6, "(*(A))") '"'//str3(:)//str5//'"' if (str6 /= '"abc xy""de xy"') error stop ! Check str4 (Parameter Arrays) str6 = '' print "(A)",'"'//str4//str5//'"' write(str6, "(*(A))") '"'//str4(:)//str5//'"' if (str6 /= '"abc xy""de xy"') error stop end program intrinsics_416lfortran-0.63.0/integration_tests/modules_52.f900000664000175000017500000000063215174404631021664 0ustar alastairalastairmodule module_52_fpm_cmd_new contains subroutine validate_toml_data(input) use module_52_tomlf_de, only : toml_parse use module_52_tomlf_type, only : toml_table implicit none character(len=:), intent(in), allocatable :: input(:) type(toml_table), allocatable :: table if (allocated(table)) deallocate(table) call toml_parse(table, input) end subroutine validate_toml_data end module module_52_fpm_cmd_new lfortran-0.63.0/integration_tests/separate_compilation_05b.f900000664000175000017500000000030115174404631024547 0ustar alastairalastairmodule separate_compilation_05b_module use separate_compilation_05a_module implicit none contains subroutine temp(A) real, allocatable :: A(:, :) call resol_lu(A) end subroutine end module lfortran-0.63.0/integration_tests/allocate_42.f900000664000175000017500000000170715174404631022003 0ustar alastairalastairprogram allocate_42 ! Test that allocate with mold= and source= preserves lower bounds implicit none integer :: i, ng, nz, ni, nf real(8), allocatable :: x(:,:), dx(:,:), y(:,:) ng = 4 nz = 12 ni = 1 - ng nf = nz + ng allocate( x(ni:nf, 3) ) allocate( dx, mold = x ) dx = 1.d0 if (lbound(dx, 1) /= ni) error stop if (ubound(dx, 1) /= nf) error stop if (lbound(dx, 2) /= 1) error stop if (ubound(dx, 2) /= 3) error stop do i = ni, nf if (abs(dx(i, 1) - 1.d0) > 1.d-15) error stop end do ! Test that allocate with source= preserves lower bounds and values x = 1.d0 allocate( y, source = x ) if (lbound(y, 1) /= ni) error stop if (ubound(y, 1) /= nf) error stop if (lbound(y, 2) /= 1) error stop if (ubound(y, 2) /= 3) error stop do i = ni, nf if (abs(y(i, 1) - 1.d0) > 1.d-15) error stop end do print *, "PASS" end program allocate_42 lfortran-0.63.0/integration_tests/parsing_03.f900000664000175000017500000000017015174404631021650 0ustar alastairalastairPROGRAM parsing_03 INTEGER :: tes INTEGER :: res tes = 1 res = tes * 2 print *, res, tes END PROGRAMlfortran-0.63.0/integration_tests/implicit_interface_06.f900000664000175000017500000000047115174404631024046 0ustar alastairalastairmodule implicit_interface_06_module contains function f(a, b) integer :: a real :: b f = 1 end function f end program main use implicit_interface_06_module integer :: a real :: i, b i = f(a, b) if (abs(i - 1) > 1e-6) error stop print *, i end program main lfortran-0.63.0/integration_tests/save_01.f900000664000175000017500000000145715174404631021152 0ustar alastairalastairsubroutine save_sub() real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end subroutine real function save_fun() implicit none real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end function module save_module_2 implicit none public real :: x = 5, z real, save :: y = 5 contains subroutine sub_save() real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end subroutine real function fun_save() implicit none real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end function end module program save_01 real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end program lfortran-0.63.0/integration_tests/namelist_26.f900000664000175000017500000000273215174404631022034 0ustar alastairalastairprogram namelist_26 implicit none character(len=15), allocatable :: name(:) character(len=:), allocatable :: cmd, cmd2 character(len=256) :: test namelist /mylist/ cmd, name, cmd2 cmd = repeat(' ', 132) cmd2 = repeat(' ', 132) allocate(name(2)) test = '&MYLIST ' // & 'CMD="run my_project", NAME="John Doe", CMD2="extra command" /' read(test, nml=mylist) print *, 'CMD = ', trim(cmd) print *, 'NAME(1) = ', name(1) print *, 'CMD2 = ', trim(cmd2) if (trim(cmd) /= 'run my_project') then error stop 'Incorrect CMD value read' end if if (trim(name(1)) /= 'John Doe') then error stop 'Incorrect NAME(1) value read' end if if (trim(cmd2) /= 'extra command') then error stop 'Incorrect CMD2 value read' end if ! Test without using commas test = '&MYLIST ' // & 'CMD="run your_project" ' // & 'NAME="project1" ' // & 'CMD2="Command 2" /' read(test, nml=mylist) print *, 'CMD = ', trim(cmd) print *, 'NAME(1) = ', name(1) print *, 'CMD2 = ', trim(cmd2) if (trim(cmd) /= 'run your_project') then error stop 'Incorrect CMD value read in second read' end if if (trim(name(1)) /= 'project1') then error stop 'Incorrect NAME(1) value read in second read' end if if (trim(cmd2) /= 'Command 2') then error stop 'Incorrect CMD2 value read in second read' end if end program namelist_26lfortran-0.63.0/integration_tests/allocate_20.f900000664000175000017500000000201415174404631021767 0ustar alastairalastairmodule stdlib_io_npy_load_allocate_12 implicit none integer, parameter :: dp = selected_real_kind(15) contains subroutine load_npy_csp_4() complex, allocatable :: array(:,:,:,:) integer :: stat call allocator(array, stat) if (stat /= 9) error stop if (.not. allocated(array)) error stop contains subroutine allocator(array, stat) complex, allocatable, intent(out) :: array(:,:,:,:) integer, intent(out) :: stat allocate(array(1,2,3,4), stat=stat) if ( .not. allocated(array)) error stop stat = 9 end subroutine allocator end subroutine load_npy_csp_4 subroutine load_npy_cdp_4() contains subroutine allocator(array_cdp, stat) complex(dp), allocatable, intent(out) :: array_cdp(:,:,:,:) integer, intent(out) :: stat end subroutine allocator end subroutine load_npy_cdp_4 end module stdlib_io_npy_load_allocate_12 program allocate_12 use stdlib_io_npy_load_allocate_12 call load_npy_csp_4() end program lfortran-0.63.0/integration_tests/derived_types_09c.f900000664000175000017500000000012315174404631023222 0ustar alastairalastairmodule derived_types_09c type data_t real, pointer :: A(:) end type end module lfortran-0.63.0/integration_tests/associate_19.f900000664000175000017500000000144015174404631022170 0ustar alastairalastairmodule module_xx_associate_19 type :: chaining_map_entry_pool type(chaining_map_entry_pool), pointer :: lastpool => null() end type chaining_map_entry_pool end module module_xx_associate_19 module stdlib_hashmap_chaining_associate_19 use module_xx_associate_19 contains recursive subroutine free_map_entry_pool(pool) type(chaining_map_entry_pool), intent(inout), pointer :: pool if (associated(pool % lastpool)) error stop end subroutine free_map_entry_pool end module stdlib_hashmap_chaining_associate_19 program associate_19 use stdlib_hashmap_chaining_associate_19 type(chaining_map_entry_pool), pointer :: pool allocate(pool) pool % lastpool => null() call free_map_entry_pool(pool) deallocate(pool) end program associate_19 lfortran-0.63.0/integration_tests/c_sizeof_04.f900000664000175000017500000000155415174404631022016 0ustar alastairalastairprogram c_sizeof_04 use iso_c_binding, only: c_int, c_double, c_sizeof implicit none ! bind(C) type where declaration order causes padding ! C equivalent: struct t1 { int a; double d; int b; }; ! sizeof = 4 + 4(pad) + 8 + 4 + 4(pad) = 24 type, bind(C) :: t1 integer(c_int) :: a real(c_double) :: d integer(c_int) :: b end type ! bind(C) type with no padding needed (fields already naturally packed) ! C equivalent: struct t2 { double d; int a; int b; }; ! sizeof = 8 + 4 + 4 = 16 type, bind(C) :: t2 real(c_double) :: d integer(c_int) :: a integer(c_int) :: b end type type(t1) :: x1 type(t2) :: x2 print *, c_sizeof(x1) print *, c_sizeof(x2) if (c_sizeof(x1) /= 24) error stop "FAIL: c_sizeof(t1) should be 24" if (c_sizeof(x2) /= 16) error stop "FAIL: c_sizeof(t2) should be 16" print *, "PASS" end program lfortran-0.63.0/integration_tests/parameter_12.f900000664000175000017500000000036115174404631022167 0ustar alastairalastairprogram parameter_12 implicit none integer :: i real, dimension(3), parameter :: a = [(i, i = 1, 3)] print *, a if (abs(a(1) - 1.0) > 1e-8) error stop if (abs(a(2) - 2.0) > 1e-8) error stop if (abs(a(3) - 3.0) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/intrinsics_439.f900000664000175000017500000000036115174404631022471 0ustar alastairalastairprogram intrinsics_439 character(len=1) :: mn, mx mn = minval(['x','y']) mx = maxval(['x','y']) if (mn /= 'x') error stop "minval incorrect" if (mx /= 'y') error stop "maxval incorrect" print *, mn print *, mx end program intrinsics_439 lfortran-0.63.0/integration_tests/return_01.f900000664000175000017500000000056615174404631021533 0ustar alastairalastairprogram main integer main_out main_out = main1() print *, "main1 called" contains integer function main1() integer :: i i = 10 if (i .GT. 5) then main1 = i print *, "early return" return end if print *, "normal return" main1 = i end function main1 end program lfortran-0.63.0/integration_tests/intrinsics_289.f900000664000175000017500000001036115174404631022475 0ustar alastairalastairprogram intrinsics_289 implicit none integer(4), parameter :: i1 = ishftc(1, 3) integer(8), parameter :: i2 = ishftc(5_8, -1_8) integer(4), parameter :: ar1(3) = ishftc([11, 2, 23], 1) integer(8), parameter :: ar2(3) = ishftc([1_8, 21_8, 3_8], -2_8) integer(kind=1) :: res_1 integer(kind=2) :: res_2 integer(kind=4) :: res_4 integer(kind=8) :: res_8 integer(4) :: i3 = 7 integer(8) :: i4 = 12 integer(4) :: ar3(3) = [22, 4, 46] integer(8) :: ar4(3) = [4611686018427387904_8, 4611686018427387909_8, -4611686018427387904_8] integer :: shift = 3 print *, i1 if (i1 /= 8) error stop print *, i2 if (i2 /= -9223372036854775806_8) error stop print *, ar1 if (any(ar1 /= [22, 4, 46])) error stop print *, ar2 if (any(ar2 /= [4611686018427387904_8, 4611686018427387909_8, -4611686018427387904_8])) error stop ! Does not work with LFortran yet ! print *, ishftc(i3, shift) ! if (ishftc(i3, shift) /= 56) error stop ! print *, ishftc(i4, -shift) ! if (ishftc(i4, -shift) /= -9223372036854775807_8) error stop ! print *, ishftc(ar3, shift) ! if (any(ishftc(ar3, shift) /= [176, 32, 368])) error stop ! print *, ishftc(ar4, -shift) ! if (any(ishftc(ar4, -shift) /= [576460752303423488_8, -6341068275337658368_8, 1729382256910270464_8])) error stop res_1 = ishftc(10_1, 2_1) print *, res_1 if (res_1 /= 40) error stop res_1 = ishftc(10_1, -2_1) print *, res_1 if (res_1 /= -126) error stop res_1 = ishftc(-10_1, 2_1) print *, res_1 if (res_1 /= -37) error stop res_1 = ishftc(-10_1, -2_1) print *, res_1 if (res_1 /= -67) error stop res_2 = ishftc(10_2, 2_2) print *, res_2 if (res_2 /= 40) error stop res_2 = ishftc(10_2, -2_2) print *, res_2 if (res_2 /= -32766) error stop res_2 = ishftc(-10_2, 2_2) print *, res_2 if (res_2 /= -37) error stop res_2 = ishftc(-10_2, -2_2) print *, res_2 if (res_2 /= -16387) error stop res_4 = ishftc(10_4, 2_4) print *, res_4 if (res_4 /= 40) error stop res_4 = ishftc(10_4, -2_4) print *, res_4 if (res_4 /= -2147483646) error stop res_4 = ishftc(-10_4, 2_4) print *, res_4 if (res_4 /= -37) error stop res_4 = ishftc(-10_4, -2_4) print *, res_4 if (res_4 /= -1073741827) error stop res_8 = ishftc(10_8, 2_8) print *, res_8 if (res_8 /= 40_8) error stop res_8 = ishftc(10_8, -2_8) print *, res_8 if (res_8 /= -9223372036854775806_8) error stop res_8 = ishftc(-10_8, 2_8) print *, res_8 if (res_8 /= -37_8) error stop res_8 = ishftc(-10_8, -2_8) print *, res_8 if (res_8 /= -4611686018427387907_8) error stop res_1 = ishftc(127_1, 7_1) print *, res_1 if (res_1 /= -65) error stop res_1 = ishftc(127_1, -7_1) print *, res_1 if (res_1 /= -2) error stop res_1 = ishftc(-127_1, 7_1) print *, res_1 if (res_1 /= -64) error stop res_1 = ishftc(-127_1, -7_1) print *, res_1 if (res_1 /= 3) error stop res_2 = ishftc(32767_2, 15_2) print *, res_2 if (res_2 /= -16385) error stop res_2 = ishftc(32767_2, -15_2) print *, res_2 if (res_2 /= -2) error stop res_2 = ishftc(-32767_2, 15_2) print *, res_2 if (res_2 /= -16384) error stop res_2 = ishftc(-32767_2, -15_2) print *, res_2 if (res_2 /= 3) error stop res_4 = ishftc(2147483647_4, 31_4) print *, res_4 if (res_4 /= -1073741825) error stop res_4 = ishftc(2147483647_4, -31_4) print *, res_4 if (res_4 /= -2) error stop res_4 = ishftc(-2147483647_4, 31_4) print *, res_4 if (res_4 /= -1073741824) error stop res_4 = ishftc(-2147483647_4, -31_4) print *, res_4 if (res_4 /= 3) error stop res_8 = ishftc(9223372036854775807_8, 63_8) print *, res_8 if (res_8 /= -4611686018427387905_8) error stop res_8 = ishftc(9223372036854775807_8, -63_8) print *, res_8 if (res_8 /= -2) error stop res_8 = ishftc(-9223372036854775807_8, 63_8) print *, res_8 if (res_8 /= -4611686018427387904_8) error stop res_8 = ishftc(-9223372036854775807_8, -63_8) print *, res_8 if (res_8 /= 3) error stop end program lfortran-0.63.0/integration_tests/modules_70.f900000664000175000017500000000142115174404631021661 0ustar alastairalastairmodule modules_70_constants implicit none public real, parameter :: alpha = 1.0 real, parameter :: beta = 2.0 end module modules_70_constants module modules_70_sparse_constants use modules_70_constants implicit none public integer, parameter :: ilp = selected_int_kind(9) end module modules_70_sparse_constants module modules_70_sparse_kinds use modules_70_sparse_constants implicit none private public :: ilp end module modules_70_sparse_kinds module modules_70_sparse use modules_70_sparse_kinds implicit none end module modules_70_sparse program modules_70 use modules_70_sparse implicit none real :: alpha alpha = 3.0 if (abs(alpha - 3.0) > 1e-6) error stop print *, "PASS" end program modules_70 lfortran-0.63.0/integration_tests/procedure_16.f900000664000175000017500000000216515174404631022207 0ustar alastairalastairmodule pintrf_mod implicit none private public :: OBJCON contains subroutine OBJCON(x) implicit none real, intent(in) :: x(:) end subroutine OBJCON end module pintrf_mod module cobylb_mod_procedure_16 contains subroutine cobylb(calcfc, amat) use, non_intrinsic :: pintrf_mod, only : OBJCON implicit none procedure(OBJCON) :: calcfc real, intent(in) :: amat(:,:) call evaluate(calcfc_internal) contains subroutine calcfc_internal(x_internal) implicit none real, intent(in) :: x_internal(:) call calcfc(x_internal) end subroutine calcfc_internal subroutine evaluate(calcfc) use, non_intrinsic :: pintrf_mod, only : OBJCON implicit none procedure(OBJCON) :: calcfc call calcfc([1.0, 2.0]) end subroutine evaluate end subroutine cobylb end module program procedure_16 use cobylb_mod_procedure_16 real :: amat(5, 5) call cobylb(calcfc, amat) contains subroutine calcfc(x) implicit none real, intent(in) :: x(:) print *, x if (abs(sum(x) - 3.0) > 1e-8) error stop end subroutine calcfc end program lfortran-0.63.0/integration_tests/struct_type_05.f900000664000175000017500000000031315174404631022573 0ustar alastairalastairprogram test type :: para integer :: a real :: b end type type(para), parameter :: temp(3) = [para(8, 5.0E0), para(5, 1.0E0), para(10, 12.0E0)] print *, temp end program lfortran-0.63.0/integration_tests/derived_types_39.f900000664000175000017500000000175315174404631023074 0ustar alastairalastairmodule derived_types_39_mod type :: tt integer :: ll contains procedure :: ssub procedure :: ff end type tt contains subroutine ssub(dt, checker) class(tt), intent(in) :: dt integer :: checker print *, checker , " -- ", dt%ll if(checker /= dt%ll) error stop end subroutine ssub function ff(dt) result(i) class(tt), intent(in) :: dt integer :: i i = dt%ll print *, i end function ff end module derived_types_39_mod program derived_types_39 use derived_types_39_mod type(tt) :: vals2(3) vals2(1)%ll = 11 vals2(2)%ll = 22 vals2(3)%ll = 33 ! Check derivedType subroutine call call vals2(1)%ssub(11) call vals2(2)%ssub(22) call vals2(3)%ssub(33) ! Check derivedType function call if(vals2(1)%ff() /= 11) error stop if(vals2(2)%ff() /= 22) error stop if(vals2(3)%ff() /= 33) error stop end program derived_types_39lfortran-0.63.0/integration_tests/separate_compilation_46.f900000664000175000017500000000052415174404631024421 0ustar alastairalastairprogram separate_compilation_46 use separate_compilation_46a_global, only: global_obj use separate_compilation_46a_types, only: obj_t implicit none allocate(obj_t :: global_obj) global_obj%val = 42 if (global_obj%val /= 42) error stop deallocate(global_obj) print *, "ok" end program separate_compilation_46 lfortran-0.63.0/integration_tests/intrinsics_387.f900000664000175000017500000000107415174404631022475 0ustar alastairalastairprogram intrinsics_387 implicit none character(len=:), allocatable :: temp integer :: stat = -1 temp = "echo Hello from Fortran!" call execute_command_line(temp) temp = "export LFORTRAN_TEST_VAR_INTRINSIC=42; echo $LFORTRAN_TEST_VAR_INTRINSIC" call execute_command_line(temp) call execute_command_line(temp, exitstat=stat) print *, "Exit status:", stat if ( stat /= 0 ) error stop call execute_command_line("exit 2", exitstat=stat) print *, "exitstat =", stat if (stat /= 2) error stop end program intrinsics_387 lfortran-0.63.0/integration_tests/use_03.f900000664000175000017500000000064715174404631021012 0ustar alastairalastairmodule test_use_03 use iso_fortran_env, ip => int32 implicit none integer,parameter :: i = real64 contains subroutine test_ip_working() print *, ip if ( ip /= 4 ) error stop end subroutine end module test_use_03 program use_03 use test_use_03 implicit none print *, i, ip if ( i /= 8 ) error stop if ( ip /= 4 ) error stop call test_ip_working() end program lfortran-0.63.0/integration_tests/openmp_24.f900000664000175000017500000000075615174404631021520 0ustar alastairalastairprogram openmp_24 use omp_lib integer, parameter :: n = 100000 integer :: i real, pointer :: b(:) allocate(b(n)) call omp_set_num_threads(4) !$omp parallel shared(b) private(i) !$omp do do i = 1, n b(i) = 12.91 end do !$omp end do !$omp end parallel print *, b(1), b(n) print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/template_unitring.f900000664000175000017500000000362615174404631023446 0ustar alastairalastairmodule unit_ring_m use semiring_m, only: semiring implicit none private public :: & unit_ring_only_minus, & unit_ring_only_negate, & unit_ring, & derive_unit_ring_from_minus, & derive_unit_ring_from_negate requirement unit_ring_only_minus(T, plus, zero, mult, one, minus) require :: semiring(T, plus, zero, mult, one) elemental function minus(x, y) result(difference) type(T), intent(in) :: x, y type(T) :: difference end function end requirement requirement unit_ring_only_negate(T, plus, zero, mult, one, negate) require :: semiring(T, plus, zero, mult, one) elemental function negate(x) result(negated) type(T), intent(in) :: x type(T) :: negated end function end requirement requirement unit_ring(T, plus, zero, mult, one, minus, negate) require :: unit_ring_only_minus(T, plus, zero, mult, one, minus) require :: unit_ring_only_negate(T, plus, zero, mult, one, negate) end requirement template derive_unit_ring_from_minus(T, plus, zero, mult, one, minus) require :: unit_ring_only_minus(T, plus, zero, mult, one, minus) private public :: negate contains elemental function negate(x) result(negated) type(T), intent(in) :: x type(T) :: negated negated = minus(zero(), x) end function end template template derive_unit_ring_from_negate(T, plus, zero, mult, one, negate) require :: unit_ring_only_negate(T, plus, zero, mult, one, negate) private public :: minus contains elemental function minus(x, y) result(difference) type(T), intent(in) :: x, y type(T) :: difference difference = plus(x, negate(y)) end function end template end module lfortran-0.63.0/integration_tests/string_78.f900000664000175000017500000000170115174404631021530 0ustar alastairalastair! Test is specially made to handle the nesting of the concatenation operator ! as it could lead to performance issues if not handled properly. program string_78 character(:), allocatable :: ss character(10) :: str str = "HELLOWORLD" allocate(character(300) :: ss) ss = str // str // str // str // str // str // str // str // str //& & str // str // str // str // str // str // str // str //& & str // str // str // str // str // str // str // str // str // str // str // str // str print *, ss !! HELLOWROLD * 30 if(ss /= & &"HELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLD& &HELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLD& &HELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLD") error stop end programlfortran-0.63.0/integration_tests/arrays_reshape_36.f900000664000175000017500000000270115174404631023225 0ustar alastairalastairmodule arrays_reshape_36_mod implicit none type :: multihead_attention_layer integer :: sequence_length integer :: model_dimension end type multihead_attention_layer contains subroutine test_multihead_attention_combine_heads(attention, output_flat) type(multihead_attention_layer), intent(in) :: attention real, intent(out) :: output_flat(attention%sequence_length * attention%model_dimension) real :: output(attention%sequence_length, attention%model_dimension) integer :: i, j, k ! Fill output with predictable values k = 0 do j = 1, attention%model_dimension do i = 1, attention%sequence_length k = k + 1 output(i,j) = real(k) end do end do ! Flatten the array output_flat = reshape(output, shape(output_flat)) end subroutine test_multihead_attention_combine_heads end module arrays_reshape_36_mod program arrays_reshape_36 use arrays_reshape_36_mod implicit none type(multihead_attention_layer) :: attention real, allocatable :: result(:) integer :: i attention%sequence_length = 2 attention%model_dimension = 3 allocate(result(attention%sequence_length * attention%model_dimension)) call test_multihead_attention_combine_heads(attention, result) ! Test the values do i = 1, size(result) if (result(i) /= real(i)) then error stop "incorrect reshape result" end if end do print *, "OK" end program arrays_reshape_36lfortran-0.63.0/integration_tests/test_ieee_infnan.f900000664000175000017500000000344115174404631023206 0ustar alastairalastairprogram test_ieee_infnan use,intrinsic:: ieee_arithmetic implicit none integer, parameter :: dp = kind(1d0) real(dp) :: xdp(4) xdp = [ ieee_value(1d0, ieee_positive_inf), & ieee_value(1d0, ieee_negative_inf), & ieee_value(1d0, ieee_quiet_nan), & ieee_value(1d0, ieee_signaling_nan) ] if (.not. isinfdp(xdp(1))) error stop if (.not. isinfdp(xdp(2))) error stop if ( isinfdp(xdp(3))) error stop if ( isinfdp(xdp(4))) error stop if (.not. isposinfdp(xdp(1))) error stop if ( isposinfdp(xdp(2))) error stop if ( isposinfdp(xdp(3))) error stop if ( isposinfdp(xdp(4))) error stop if ( isneginfdp(xdp(1))) error stop if (.not. isneginfdp(xdp(2))) error stop if ( isneginfdp(xdp(3))) error stop if ( isneginfdp(xdp(4))) error stop if ( isnandp(xdp(1))) error stop if ( isnandp(xdp(2))) error stop if (.not. isnandp(xdp(3))) error stop if (.not. isnandp(xdp(4))) error stop if ( isfinitedp(xdp(1))) error stop if ( isfinitedp(xdp(2))) error stop if ( isfinitedp(xdp(3))) error stop if ( isfinitedp(xdp(4))) error stop contains elemental logical function isnandp(x) real(dp), intent(in) :: x isnandp = (x /= x) end function isnandp elemental logical function isinfdp(x) real(dp), intent(in) :: x isinfdp = (abs(x) > huge(x)) end function isinfdp elemental logical function isposinfdp(x) real(dp), intent(in) :: x isposinfdp = (x > huge(x)) end function isposinfdp elemental logical function isneginfdp(x) real(dp), intent(in) :: x isneginfdp = (x < -huge(x)) end function isneginfdp elemental logical function isfinitedp(x) real(dp), intent(in) :: x isfinitedp = (abs(x) <= huge(x)) end function isfinitedp end program test_ieee_infnan lfortran-0.63.0/integration_tests/modules_33_module1.f900000664000175000017500000000405015174404631023307 0ustar alastairalastairmodule fpm_dependency_modules_33 implicit none type :: error_t character(len=:), allocatable :: message end type error_t type :: dependency_config_t character(len=:), allocatable :: name character(len=:), allocatable :: path end type dependency_config_t type, extends(dependency_config_t) :: dependency_node_t character(len=:), allocatable :: proj_dir character(len=:), allocatable :: revision logical :: done = .false. logical :: update = .false. end type dependency_node_t type :: dependency_tree_t integer :: unit integer :: verbosity character(len=:), allocatable :: dep_dir integer :: ndep type(dependency_node_t), allocatable :: dep(:) character(len=:), allocatable :: cache contains generic :: update => update_dependency procedure, private :: update_dependency generic :: add => add_project, add_project_dependencies procedure, private :: add_project procedure, private :: add_project_dependencies end type dependency_tree_t type :: package_config_t character(len=:), allocatable :: name end type package_config_t contains subroutine update_dependency(self, name, error) class(dependency_tree_t), intent(inout) :: self character(len=*), intent(in) :: name type(error_t), allocatable, intent(out) :: error end subroutine update_dependency subroutine add_project(self, package, error) class(dependency_tree_t), intent(inout) :: self type(package_config_t), intent(in) :: package type(error_t), allocatable, intent(out) :: error end subroutine add_project recursive subroutine add_project_dependencies(self, root, main, error) class(dependency_tree_t), intent(inout) :: self character(len=*), intent(in) :: root logical, intent(in) :: main type(error_t), allocatable, intent(out) :: error end subroutine add_project_dependencies end module fpm_dependency_modules_33 lfortran-0.63.0/integration_tests/select_rank_14.f900000664000175000017500000000240515174404631022504 0ustar alastairalastairprogram select_rank_14 implicit none integer :: s integer :: a(3) real :: r real :: b(2) s = 42 a = [10, 20, 30] r = 3.14 b = [1.0, 2.0] call check_int(s, 0) call check_int(a, 1) call check_real(r, 0) call check_real(b, 1) contains subroutine check_int(x, expected_rank) integer, intent(in) :: x(..) integer, intent(in) :: expected_rank integer :: y select rank (x) rank (0) if (expected_rank /= 0) error stop y = x if (y /= 42) error stop rank (1) if (expected_rank /= 1) error stop y = x(1) if (y /= 10) error stop end select end subroutine subroutine check_real(x, expected_rank) real, intent(in) :: x(..) integer, intent(in) :: expected_rank real :: y select rank (x) rank (0) if (expected_rank /= 0) error stop y = x if (abs(y - 3.14) > 0.001) error stop rank (1) if (expected_rank /= 1) error stop y = x(1) if (abs(y - 1.0) > 0.001) error stop end select end subroutine end program lfortran-0.63.0/integration_tests/gpu_metal_19.f900000664000175000017500000000077315174404631022202 0ustar alastairalastairprogram gpu_metal_19 ! Logical array operations implicit none integer, parameter :: n = 10000 integer :: a(n), b(n), c(n), c_expected(n) integer :: i do i = 1, n a(i) = i b(i) = n - i + 1 if (a(i) > b(i)) then c_expected(i) = 1 else c_expected(i) = 0 end if end do do concurrent (i = 1:n) if (a(i) > b(i)) then c(i) = 1 else c(i) = 0 end if end do do i = 1, n if (c(i) /= c_expected(i)) error stop end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/gpu_metal_190.f900000664000175000017500000000066015174404631022255 0ustar alastairalastairprogram gpu_metal_190 implicit none real :: a(2, 2), r(2, 2) integer :: i a = reshape([0.3, 0.7, 0.2, 0.9], [2, 2]) do concurrent(i = 1:2) block real :: tmp(2) tmp = merge(1.0, 0.0, a(:,i) < 0.5) r(:,i) = tmp end block end do if (abs(r(1,1) - 1.0) > 1e-6) error stop if (abs(r(2,1) - 0.0) > 1e-6) error stop if (abs(r(1,2) - 1.0) > 1e-6) error stop if (abs(r(2,2) - 0.0) > 1e-6) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/format_29.f900000664000175000017500000000134415174404631021511 0ustar alastairalastairprogram format_29 implicit none real :: x x = 1.23456 print '(F10.4)', x print '(1PF10.4)', 1.23456 print '(2PF10.4)', x print '(-1PF10.4)', 1.23456 print '(-3PF10.4)', x x = 0.001234 print '("x=0.001234")' print '(F12.6)', x print '(3PF12.6)', x x = 123456.0 print '("x=123456.0")' print '(F12.2)', x print '(-2PF12.2)', x x = -9.876 print '("x=-9.876")' print '(0PF10.3)', x print '(2PF10.3)', x x = 0.1234567 print '(F8.4)', x print '(3PF8.4)', x x = 1234567.0 print '(-2PF8.2)', x x = 9.9999 print '(F8.4)', x print '(1PF8.4)', x x = 0.00001 print '(F10.6)', x print '(4PF10.6)', x end program format_29 lfortran-0.63.0/integration_tests/matrix_03_transpose_param.f900000664000175000017500000000175315174404631024777 0ustar alastairalastairprogram matrix_03_transpose_param implicit none ! Test compile-time evaluation of transpose() in parameter initialization integer, parameter :: t1(2,2) = transpose(reshape([1,2,3,4],[2,2])) ! Non-square matrix integer, parameter :: t2(2,3) = transpose(reshape([1,2,3,4,5,6],[3,2])) ! Real parameter real, parameter :: t3(2,2) = transpose(reshape([1.0, 2.0, 3.0, 4.0],[2,2])) ! reshape([1,2,3,4],[2,2]) column-major: m(1,1)=1, m(2,1)=2, m(1,2)=3, m(2,2)=4 ! transpose: t(1,1)=1, t(2,1)=3, t(1,2)=2, t(2,2)=4 if (t1(1,1) /= 1) error stop if (t1(2,1) /= 3) error stop if (t1(1,2) /= 2) error stop if (t1(2,2) /= 4) error stop if (t2(1,1) /= 1) error stop if (t2(2,1) /= 4) error stop if (t2(1,2) /= 2) error stop if (t2(2,2) /= 5) error stop if (t2(1,3) /= 3) error stop if (t2(2,3) /= 6) error stop if (abs(t3(1,1) - 1.0) > 1.0e-6) error stop if (abs(t3(2,1) - 3.0) > 1.0e-6) error stop if (abs(t3(1,2) - 2.0) > 1.0e-6) error stop if (abs(t3(2,2) - 4.0) > 1.0e-6) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/gpu_metal_76.f900000664000175000017500000000130715174404631022177 0ustar alastairalastairprogram gpu_metal_76 implicit none real :: a(4) logical :: eq(4) integer :: l a = 1.0 do concurrent(l = 1:4) eq(l) = all(a(1:l) > 0.0) .and. all(a(1:l) > 0.0) end do if (.not. all(eq)) error stop "Test 1 failed" a(3) = -1.0 do concurrent(l = 1:4) eq(l) = all(a(1:l) > 0.0) .and. all(a(1:l) > 0.0) end do if (eq(1)) then ! expected: a(1)=1.0 > 0 else error stop "Test 2a failed" end if if (eq(2)) then ! expected: a(1:2) all > 0 else error stop "Test 2b failed" end if if (eq(3)) error stop "Test 2c failed: a(3)=-1 should make all() false" if (eq(4)) error stop "Test 2d failed: a(3)=-1 should make all() false" print *, "PASS" end program lfortran-0.63.0/integration_tests/derived_types_76.f900000664000175000017500000000072415174404631023072 0ustar alastairalastairmodule derived_type_76_mod implicit none type, abstract :: toml_value integer :: origin = -1 end type type, extends(toml_value) :: toml_table logical :: l1 = .true. end type type :: parser type(toml_table), allocatable :: s1 end type end module program derived_type_76 use derived_type_76_mod type(parser) :: v1 allocate(v1%s1) v1%s1 = toml_table() if (v1%s1%origin /= -1) error stop if (.not. v1%s1%l1) error stop end program lfortran-0.63.0/integration_tests/operator_overloading_07.f900000664000175000017500000000267015174404631024444 0ustar alastairalastair! Overloading the assignment operator `=` with a function call that would be handled by ! `subroutine_from_function` pass. So we need to make sure that the pass ! actually replaces the function call in the overloaded expression. module operator_overloading_07_mod1 implicit none interface assignment(=) module procedure :: assign_string_char end interface assignment(=) type string_type character(:), allocatable :: raw end type contains subroutine assign_string_char(lhs, rhs) type(string_type), intent(inout) :: lhs character(len=*), intent(in) :: rhs lhs%raw = rhs end subroutine assign_string_char end module operator_overloading_07_mod1 module operator_overloading_07_mod2 use operator_overloading_07_mod1 implicit none type(string_type) :: instance contains function func() result(ret_arr) character(:), allocatable :: ret_arr allocate(character(15) :: ret_arr) ret_arr = "Hello World!" end function subroutine ff() character(:), allocatable :: inp instance = func() ! pass `subroutine_from_function` takes action here. It must handle the overloading of `=`. print *, instance%raw if(instance%raw /= "Hello World!") error stop end subroutine ff end module program operator_overloading_07 use operator_overloading_07_mod2, only : ff implicit none call ff() end program lfortran-0.63.0/integration_tests/separate_compilation_07b.f900000664000175000017500000000130015174404631024551 0ustar alastairalastairmodule separate_compilation_07b_mpi implicit none interface MPI_Init module procedure MPI_Init_proc end interface MPI_Init contains subroutine MPI_Init_proc(ierr) use separate_compilation_07a_mpi_c_bindings, only: c_mpi_init use iso_c_binding, only : c_int integer, optional, intent(out) :: ierr integer :: local_ierr if (present(ierr)) then call c_mpi_init(ierr) else call c_mpi_init(local_ierr) if (local_ierr /= 5) then print *, "MPI_Init failed with error code: ", local_ierr end if end if end subroutine end module separate_compilation_07b_mpi lfortran-0.63.0/integration_tests/intrinsics_184.f900000664000175000017500000000345315174404631022473 0ustar alastairalastairprogram intrinsics_184 implicit none integer, parameter :: ascii = selected_char_kind ("ascii") integer, parameter :: ascii_case = selected_char_kind ("ASciI") integer, parameter :: default = selected_char_kind ("default") integer, parameter :: ucs4 = selected_char_kind ("ISO_10646") integer, parameter :: other = selected_char_kind ("other") character(5) :: ascii_str = "ascii" character(5) :: ascii_case_str = "ASciI" character(7) :: default_str = "default" character(9) :: ucs4_str = "ISO_10646" character(5) :: other_str = "other" print*, selected_char_kind("ascii") if (selected_char_kind("ascii") /= 1) error stop print*, selected_char_kind("ASciI") if (selected_char_kind("ASciI") /= 1) error stop print*, selected_char_kind("default") if (selected_char_kind("default") /= 1) error stop print*, selected_char_kind("ISO_10646") if (selected_char_kind("ISO_10646") /= 4) error stop print*, selected_char_kind("other") if (selected_char_kind("other") /= -1) error stop print*, selected_char_kind(ascii_str) if (selected_char_kind(ascii_str) /= 1) error stop print*, selected_char_kind(ascii_case_str) if (selected_char_kind(ascii_case_str) /= 1) error stop print*, selected_char_kind(default_str) if (selected_char_kind(default_str) /= 1) error stop print*, selected_char_kind(ucs4_str) if (selected_char_kind(ucs4_str) /= 4) error stop print*, selected_char_kind(other_str) if (selected_char_kind(other_str) /= -1) error stop print*, ascii if (ascii /= 1) error stop print*, ascii_case if (ascii_case /= 1) error stop print*, default if (default /= 1) error stop print*, ucs4 if (ucs4 /= 4) error stop print*, other if (other /= -1) error stop end program lfortran-0.63.0/integration_tests/intrinsics_379.f900000664000175000017500000000125515174404631022477 0ustar alastairalastairmodule testdrive_intrinsics_379 contains subroutine get_argument(idx, arg) integer, intent(in) :: idx !> Command line argument character(len=:), allocatable, intent(out) :: arg integer :: length, stat call get_command_argument(idx, length=length, status=stat) call get_command_argument(idx, arg, status=stat) end subroutine get_argument end module testdrive_intrinsics_379 program intrinsics_379 use testdrive_intrinsics_379 implicit none character(len=:), allocatable :: arg1, arg2 ! Get the first command line argument call get_argument(1, arg1) ! Get the second command line argument call get_argument(2, arg2) end program lfortran-0.63.0/integration_tests/intrinsics_73.f900000664000175000017500000000027215174404631022404 0ustar alastairalastairprogram intrinsics_73 real(8) :: y real :: x y = 5.2d0 x = sngl(y) if(abs(x - 5.19999981)>1e-8) error stop ! if(kind(sngl(y)) /= 4) error stop //TODO end programlfortran-0.63.0/integration_tests/transfer_09.f900000664000175000017500000000112015174404631022033 0ustar alastairalastairprogram transfer_09 integer, dimension(3) :: lhs, rhs real, dimension(3):: r1 real:: a,b,c rhs = [10, 20, 30] a = transfer(rhs(1), a) b = transfer(rhs(2), b) c = transfer(rhs(3), c) r1(1:3) = transfer(rhs, r1) lhs(1:3) = transfer(rhs, lhs) print *, "Correct Values", rhs, a, b, c print *, "Transferred Values", lhs, r1 ! Check aray transfer of same type if (lhs(1) /= rhs(1) .or. lhs(2) /= rhs(2) .or. lhs(3) /= rhs(3)) error stop !Check with scalar transfers for real type if (r1(1) /= a .or. r1(2) /= b .or. r1(3) /= c) error stop end program transfer_09lfortran-0.63.0/integration_tests/template_commutative.f900000664000175000017500000000405415174404631024140 0ustar alastairalastairmodule template_commutative_m implicit none public requirement magma_r(T, bin, equal) type, deferred :: T pure elemental function bin(x, y) result(bin) type(T), intent(in) :: x type(T), intent(in) :: y type(T) :: bin end function pure elemental function equal(x, y) result(equal) type(T), intent(in) :: x type(T), intent(in) :: y ! type(T) :: equal logical :: equal end function end requirement template commutative_prop(T, bin, equal) require :: magma_r(T, bin, equal) contains pure function commutative_p(x, y) result(prop) interface operator(==) procedure equal end interface type(T), intent(in) :: x, y type(logical) :: prop prop = bin(x,y) == bin(y,x) end function end template template alt_commutative_prop(bin, equal) require :: magma_r(integer, bin, equal) contains pure function commutative_p(x, y) result(prop) interface operator(==) procedure equal end interface type(integer), intent(in) :: x, y type(logical) :: prop prop = bin(x,y) == bin(y,x) end function end template end module template_commutative_m program test_template_commutative_p use template_commutative_m instantiate alt_commutative_prop(operator(+), operator(==)), only: plus_comm => commutative_p instantiate commutative_prop(integer, operator(+), operator(==)), only: int_plus_comm => commutative_p instantiate alt_commutative_prop(operator(-), operator(==)), only: minus_comm => commutative_p instantiate commutative_prop(integer, operator(-), operator(==)), only: int_minus_comm => commutative_p print *, "test commutative" print *, "plus_comm: ", plus_comm(3, 4) print *, "int_plus_comm: ", int_plus_comm(3, 4) print *, "minus_comm: ", minus_comm(3, 4) print *, "int_minus_comm: ", int_minus_comm(3, 4) end program lfortran-0.63.0/integration_tests/array_indices_array_section_assignment.f900000664000175000017500000000023015174404631027666 0ustar alastairalastairprogram test integer :: A(3) = [1,2,3] integer :: X(2) = [1,2] integer :: Y = 2 A(X(:)) = Y print *, A if( any(A /= [2, 2, 3]) ) error stop end program lfortran-0.63.0/integration_tests/associate_06_module.f900000664000175000017500000000060415174404631023532 0ustar alastairalastairmodule associate_06_stdlib_string_type contains elemental subroutine unused_dummy_argument(dummy) class(*), intent(in) :: dummy associate(dummy => dummy); end associate end subroutine unused_dummy_argument subroutine read_formatted(v_list) integer, intent(in) :: v_list(:) call unused_dummy_argument(v_list) end subroutine end module lfortran-0.63.0/integration_tests/line_continuation_02.f900000664000175000017500000000242015174404631023725 0ustar alastairalastairprogram line_continuation_02 implicit none ! Here are the rules for & based on the § 6.3.2.4 ("Free form statement ! continuation") in Fortran 2018 standard. ! The & character in a comment has no effect ! The & character can be used to continue a line like this: integer & :: j ! If it is used between tokens, then one can, but does not have to put another & ! on the next line: integer & &:: k ! If & is used to continue the line in the middle of a token, one must put ! another & at the next line: inte& &ger :: i i = 5 pr& &i& &nt *, i ! One can continue strings also by treating them as tokens: print *, "some string & &is continued" ! Unless the & is at the end of the line, it can be used as a regular ! character in a string: print *, "some string can contain & as a regular character & &is continued" print *, "Even here: && && <- there will be two &" ! One can put arbitrary comments and empty lines after & that will be skipped: print *, & i print *, & ! comment 1 ! comment 2 ! comment 3 i print *, & ! comment 1 ! comment 2 ! comment 3 &i ! In strings the comment cannot be after the first &, but it can be on ! subsequent lines: print *, "some string & ! comment 2 ! comment 3 &is continued" end program lfortran-0.63.0/integration_tests/save_12.f900000664000175000017500000000027615174404631021152 0ustar alastairalastairprogram save_12 implicit real(kind=8) (a-h,o-z), integer(kind=4) (i-n) save notyet logical :: notyet = .true. if (.not. notyet) error stop print *, notyet end program save_12 lfortran-0.63.0/integration_tests/shifta_02.f900000664000175000017500000000112015174404631021456 0ustar alastairalastairprogram shifta_02 integer(kind=8) :: n, x integer result n = 2**30 - 1 x = 1 result = shifta(n, x) print *, "shifta(", n, ", ", x, ") = ", result if (result /= 536870911) error stop n = 2**29 x = 32 result = shifta(n, x) print *, "shifta(", n, ", ", x, ") = ", result if (result /= 0) error stop block integer(8) :: x = 32 integer :: y = 2 result = shifta(x, y) print *, "shifta(", x, ", ", y, ") = ", result if (result /= 8) error stop "Test case failed: shifta type mismatch" end block end program lfortran-0.63.0/integration_tests/intrinsics_101.f900000664000175000017500000000056715174404631022463 0ustar alastairalastairprogram intrinsics_101 implicit none character(len=5) :: s1 character(len=10) :: s2 s1 = "242" s2 = repeat(s1, 2) print *, repeat("hello", 0) if (repeat("hello", 0) /= "") error stop print *, repeat("hello", 2) if (repeat("hello", 2) /= "hellohello") error stop print *, '-', s2, '-' if (s2 /= "242 242 ") error stop end program lfortran-0.63.0/integration_tests/array_bound_6.f900000664000175000017500000000342315174404631022441 0ustar alastairalastairmodule module_array_bound_6 implicit none contains function make_bordered(n) result(a) integer, intent(in) :: n character(len=1), allocatable :: a(:,:) integer :: i, j allocate(a(0:n+1, 0:n+1)) ! border at 0 and n+1; interior: 1..n a = '.' print *, "Inside Function (Lbound, RBound, Size)", lbound(a), ubound(a), size(a) if ((lbound(a,1) /= 0) .and. ((lbound(a,2) /= 0))) error stop if ((ubound(a,1) /= 6) .and. ((ubound(a,2) /= 6))) error stop if ((size(a,1) /= 7) .and. ((size(a,2) /= 7))) error stop end function end module module_array_bound_6 program array_bound_6 use module_array_bound_6 implicit none integer, parameter :: N = 5 character(len=1), allocatable :: a(:,:), b(:,:), c(:, :) allocate(b(0:N+1, 0:N+1)) ! Test bounds for direct assignments c = b ! Test bounds for function call results a = make_bordered(N) print *, "Array a (Lbound, RBound, Size)", lbound(a), ubound(a), shape(a) if ((lbound(a,1) /= 1) .and. ((lbound(a,2) /= 1))) error stop if ((ubound(a,1) /= 7) .and. ((ubound(a,2) /= 7))) error stop if ((size(a,1) /= 7) .and. ((size(a,2) /= 7))) error stop print *, "Array b (Lbound, RBound, Size)", lbound(b), ubound(b), shape(b) if ((lbound(b,1) /= 0) .and. ((lbound(b,2) /= 0))) error stop if ((ubound(b,1) /= 6) .and. ((ubound(b,2) /= 6))) error stop if ((size(b,1) /= 7) .and. ((size(b,2) /= 7))) error stop print *, "Array c (Lbound, RBound, Size)", lbound(c), ubound(c), shape(c) if ((lbound(c,1) /= 0) .and. ((lbound(c,2) /= 0))) error stop if ((ubound(c,1) /= 6) .and. ((ubound(c,2) /= 6))) error stop if ((size(c,1) /= 7) .and. ((size(c,2) /= 7))) error stop end program array_bound_6 lfortran-0.63.0/integration_tests/expr_10.f900000664000175000017500000000033115174404631021160 0ustar alastairalastairprogram expr_10 integer, parameter :: dp = kind(0.d0) real(dp) :: x x = 2.2e-5_dp print *, x if (abs(x-2.2e-5_dp) > 1e-10_dp) error stop x = 2.2d-5 print *, x if (abs(x-2.2e-5_dp) > 1e-10_dp) error stop end program lfortran-0.63.0/integration_tests/program_01.f900000664000175000017500000000155315174404631021660 0ustar alastairalastairprogram program_01 implicit none integer, parameter :: dp=kind(0.d0) real(dp) :: a integer :: i print *, "Normal random numbers:" do i = 1, 10 call rand(a) print *, a end do contains subroutine rand(x) ! Returns a psuedorandom scalar drawn from the standard normal distribution. ! ! [1] Marsaglia, G., & Bray, T. A. (1964). A Convenient Method for ! Generating Normal Variables. SIAM Review, 6(3), 260–264. real(dp), intent(out) :: x logical, save :: first = .true. real(dp), save :: u(2) real(dp) :: r2 if (first) then do call random_number(u) u = 2*u-1 r2 = sum(u**2) if (r2 < 1 .and. r2 > 0) exit end do u = u * sqrt(-2*log(r2)/r2) x = u(1) else x = u(2) end if first = .not. first end subroutine end program lfortran-0.63.0/integration_tests/namelist_10.f900000664000175000017500000000462115174404631022024 0ustar alastairalastairprogram test_indexing implicit none ! Test array indexing syntax: arr(i,j) = value integer :: grid(3,3) real :: vec(5) integer :: i, j namelist /indexed/ grid, vec ! Initialize to zeros grid = 0 vec = 0.0 ! Create input file with array indexing open(unit=10, file='namelist_indexed.dat', status='replace', form='formatted') write(10, '(A)') ' &INDEXED' write(10, '(A)') ' grid(2,2) = 99' write(10, '(A)') ' grid(1,3) = 42' write(10, '(A)') ' grid(3,1) = 17' write(10, '(A)') ' vec(2) = 2.5' write(10, '(A)') ' vec(4) = 4.5' write(10, '(A)') ' /' close(10) ! Read namelist with array indexing open(unit=10, file='namelist_indexed.dat', status='old', form='formatted') read(10, nml=indexed) close(10) ! Verify grid(2,2) = 99 if (grid(2,2) /= 99) then print *, "Error: grid(2,2) =", grid(2,2), "expected 99" error stop "Array indexing test failed for grid(2,2)" end if ! Verify grid(1,3) = 42 if (grid(1,3) /= 42) then print *, "Error: grid(1,3) =", grid(1,3), "expected 42" error stop "Array indexing test failed for grid(1,3)" end if ! Verify grid(3,1) = 17 if (grid(3,1) /= 17) then print *, "Error: grid(3,1) =", grid(3,1), "expected 17" error stop "Array indexing test failed for grid(3,1)" end if ! Verify vec(2) = 2.5 if (abs(vec(2) - 2.5) > 1.0e-5) then print *, "Error: vec(2) =", vec(2), "expected 2.5" error stop "Array indexing test failed for vec(2)" end if ! Verify vec(4) = 4.5 if (abs(vec(4) - 4.5) > 1.0e-5) then print *, "Error: vec(4) =", vec(4), "expected 4.5" error stop "Array indexing test failed for vec(4)" end if ! Verify other elements remain zero do j = 1, 3 do i = 1, 3 if ((i /= 2 .or. j /= 2) .and. (i /= 1 .or. j /= 3) .and. (i /= 3 .or. j /= 1)) then if (grid(i,j) /= 0) then print *, "Error: grid(", i, ",", j, ") =", grid(i,j), "expected 0" error stop "Unmodified grid element changed" end if end if end do end do if (abs(vec(1)) > 1.0e-5 .or. abs(vec(3)) > 1.0e-5 .or. abs(vec(5)) > 1.0e-5) then error stop "Unmodified vec element changed" end if print *, "Array indexing namelist test passed!" end program test_indexing lfortran-0.63.0/integration_tests/operator_overloading_08.f900000664000175000017500000000117415174404631024443 0ustar alastairalastairmodule operator_overloading_08_mod1 type :: custom_int integer :: value end type custom_int interface operator(/) module procedure custom_div end interface contains function custom_div(a, b) result(res) type(custom_int), intent(in) :: a integer, intent(in) :: b type(custom_int) :: res res%value = a%value / (b + 1) end function custom_div end module operator_overloading_08_mod1 program operator_overloading_08 use operator_overloading_08_mod1 type(custom_int) :: a a%value = 1 print *, a / 0 ! Yields 1 end program operator_overloading_08 lfortran-0.63.0/integration_tests/array_bound_1.f900000664000175000017500000000104215174404631022427 0ustar alastairalastairprogram array_bound_1 integer :: a(2:5, 3:9, 7) integer :: b(1:2, 2:4, 3:6, 4:7) integer :: c(6:10, 7) integer :: d(4) print *, lbound(a, 1), lbound(a, 2), lbound(a, 3) print *, ubound(a, 1), ubound(a, 2), ubound(a, 3) print *, lbound(b, 1), lbound(b, 2), lbound(b, 3), lbound(b, 4) print *, ubound(b, 1), ubound(b, 2), ubound(b, 3), ubound(b, 4) print *, lbound(c, 1), lbound(c, 2) print *, ubound(c, 1), ubound(c, 2) print *, lbound(d, 1) print *, ubound(d, 1) end program array_bound_1lfortran-0.63.0/integration_tests/types_09.f900000664000175000017500000000111315174404631021355 0ustar alastairalastairprogram types_09 use iso_c_binding, only: c_char implicit none integer, parameter :: ucs4=selected_char_kind("ISO_10646") character(1,ucs4), parameter :: nen=char(int(Z'5e74'),ucs4) contains subroutine f(s, s2) character(kind=c_char, len=:), allocatable, intent(in) :: s character(len=:), allocatable, intent(in) :: s2 character(kind=1, len=*), parameter :: lowercase = & & 'abcdefghijklmnopqrstuvwxyz' end subroutine subroutine s() use,intrinsic :: iso_fortran_env, only : int32 integer(int32) :: x = 1 end subroutine s end program lfortran-0.63.0/integration_tests/submodule_30b.f900000664000175000017500000000034015174404631022345 0ustar alastairalastairmodule submodule_30_mod implicit none interface module subroutine compute(x, y) integer, intent(in) :: x integer, intent(out) :: y end subroutine end interface end module lfortran-0.63.0/integration_tests/template_04.f900000664000175000017500000003646215174404631022036 0ustar alastairalastairmodule template_04_semigroup implicit none private public :: semigroup, extended_semigroup, derive_extended_semigroup requirement semigroup(T, combine) type, deferred :: T elemental function combine(x, y) result(combined) type(T), intent(in) :: x, y type(T) :: combined end function end requirement requirement extended_semigroup(T, combine, sconcat, stimes) require :: semigroup(T, combine) pure function sconcat(list) result(combined) type(T), intent(in) :: list(:) !! Must contain at least one element type(T) :: combined end function elemental function stimes(n, a) result(repeated) integer, intent(in) :: n type(T), intent(in) :: a type(T) :: repeated end function end requirement template derive_extended_semigroup(T, combine) require :: semigroup(T, combine) private public :: sconcat, stimes contains pure function sconcat(list) result(combined) type(T), intent(in) :: list(:) type(T) :: combined integer :: i if (size(list) > 0) then combined = list(1) do i = 2, size(list) combined = combine(combined, list(i)) end do else error stop "Attempted to sconcat empty list" end if end function elemental function stimes(n, a) result(repeated) integer, intent(in) :: n type(T), intent(in) :: a type(T) :: repeated integer :: i if (n < 1) error stop "n must be > 0" repeated = a do i = 2, n repeated = combine(repeated, a) end do end function end template end module module template_04_monoid use template_04_semigroup, only: semigroup, extended_semigroup, derive_extended_semigroup implicit none private public :: monoid, extended_monoid, derive_extended_monoid requirement monoid(T, combine, empty) require :: semigroup(T, combine) pure function empty() type(T) :: empty end function end requirement requirement extended_monoid(T, combine, sconcat, stimes, empty, mconcat) require :: extended_semigroup(T, combine, sconcat, stimes) require :: monoid(T, combine, empty) pure function mconcat(list) result(combined) type(T), intent(in) :: list(:) type(T) :: combined end function end requirement template derive_extended_monoid(T, combine, empty) require :: monoid(T, combine, empty) private public :: stimes, mconcat instantiate derive_extended_semigroup(T, combine), only: stimes => stimes contains pure function mconcat(list) result(combined) type(T), intent(in) :: list(:) type(T) :: combined integer :: i if (size(list) > 0) then combined = list(1) do i = 2, size(list) combined = combine(combined, list(i)) end do else combined = empty() end if end function end template end module module template_04_semiring use template_04_monoid, only: monoid implicit none private public :: semiring requirement semiring(T, plus, zero, mult, one) require :: monoid(T, plus, zero) require :: monoid(T, mult, one) end requirement end module module template_04_unitring use template_04_semiring implicit none public :: & unit_ring_only_minus, & unit_ring_only_negate, & unit_ring, & derive_unit_ring_from_minus, & derive_unit_ring_from_negate requirement unit_ring_only_minus(T, plus, zero, mult, one, minus) require :: semiring(T, plus, zero, mult, one) elemental function minus(x, y) result(difference) type(T), intent(in) :: x, y type(T) :: difference end function end requirement requirement unit_ring_only_negate(T, plus, zero, mult, one, negate) require :: semiring(T, plus, zero, mult, one) elemental function negate(x) result(negated) type(T), intent(in) :: x type(T) :: negated end function end requirement requirement unit_ring(T, plus, zero, mult, one, minus, negate) require :: unit_ring_only_minus(T, plus, zero, mult, one, minus) require :: unit_ring_only_negate(T, plus, zero, mult, one, negate) end requirement template derive_unit_ring_from_minus(T, plus, zero, mult, one, minus) require :: unit_ring_only_minus(T, plus, zero, mult, one, minus) private public :: negate contains elemental function negate(x) result(negated) type(T), intent(in) :: x type(T) :: negated negated = minus(zero(), x) end function end template template derive_unit_ring_from_negate(T, plus, zero, mult, one, negate) require :: unit_ring_only_negate(T, plus, zero, mult, one, negate) private public :: minus contains elemental function minus(x, y) result(difference) type(T), intent(in) :: x, y type(T) :: difference difference = plus(x, negate(y)) end function end template end module module template_04_field !! field is a unit_ring that also has a division or inverse operation use template_04_unitring, only: unit_ring implicit none private public :: & field_only_division, & field_only_inverse, & field, & derive_field_from_division, & derive_field_from_inverse requirement field_only_division(T, plus, zero, mult, one, minus, negate, divide) require :: unit_ring(T, plus, zero, mult, one, minus, negate) elemental function divide(x, y) result(quotient) type(T), intent(in) :: x, y type(T) :: quotient end function end requirement requirement field_only_inverse(T, plus, zero, mult, one, minus, negate, invert) require :: unit_ring(T, plus, zero, mult, one, minus, negate) elemental function invert(x) result(inverse) type(T), intent(in) :: x type(T) :: inverse end function end requirement requirement field(T, plus, zero, mult, one, minus, negate, divide, invert) require :: field_only_division(T, plus, zero, mult, one, minus, negate, divide) require :: field_only_inverse(T, plus, zero, mult, one, minus, negate, invert) end requirement template derive_field_from_division(T, plus, zero, mult, one, minus, negate, divide) require :: field_only_division(T, plus, zero, mult, one, minus, negate, divide) private public :: invert contains elemental function invert(x) result(inverse) type(T), intent(in) :: x type(T) :: inverse inverse = divide(one(), x) end function end template template derive_field_from_inverse(T, plus, zero, mult, one, minus, negate, invert) require :: field_only_inverse(T, plus, zero, mult, one, minus, negate, invert) private public :: divide contains elemental function divide_(x, y) result(quotient) type(T), intent(in) :: x, y type(T) :: quotient quotient = mult(x, invert(y)) end function end template end module module template_04_matrix use template_04_monoid, only: derive_extended_monoid use template_04_semiring, only: semiring use template_04_unitring, only: unit_ring_only_minus, derive_unit_ring_from_minus use template_04_field, only: field_only_division implicit none private public :: matrix_tmpl template matrix_tmpl(T, plus_t, zero_t, times_t, one_t, n) require :: semiring(T, plus_t, zero_t, times_t, one_t) integer :: n private public :: & matrix, & plus_matrix, & times_matrix, & zero, & one, & matrix_subtraction_tmpl type :: matrix type(T) :: elements(n, n) end type interface operator(+) procedure :: plus_matrix end interface interface operator(*) procedure times_matrix end interface template matrix_subtraction_t(minus_t) require :: unit_ring_only_minus(T, plus_t, zero_t, times_t, one_t, minus_t) private public :: minus_matrix, gaussian_solver_tmpl interface operator(-) procedure minus_matrix end interface template gaussian_solver_tmpl(div_t) instantiate derive_unit_ring_from_minus(T, plus_t, zero_t, times_t, one_t, minus_t), only: negate require :: field_only_division(T, plus_t, zero_t, times_t, one_t, minus_t, negate, div_t) contains pure function row_eschelon(x) result(reduced) type(matrix), intent(in) :: x type(matrix) :: reduced integer :: i, ii, j type(T) :: r reduced = x do i = 1, n ! Assume pivot m(i,i) is not zero do ii = i+1, n r = div_t(reduced%elements(i,i), reduced%elements(ii,i)) reduced%elements(ii, i) = zero_t() do j = i+1, n reduced%elements(ii, j) = minus_t(reduced%elements(ii, j), times_t(reduced%elements(i, j), r)) end do end do end do end function pure function back_substitute(x, y) result(solved) type(matrix), intent(in) :: x, y type(matrix) :: solved integer :: i, j type(T) :: tmp(n) solved = y do i = n, 1, -1 tmp = zero_t() do j = i+1, n tmp = plus_t(tmp, times_t(x%elements(i,j), solved%elements(:,j))) end do solved%elements(:,i) = div_t(minus_t(solved%elements(:,i), tmp), x%elements(i,i)) end do end function elemental function div_matrix(x, y) result(quotient) type(matrix), intent(in) :: x, y type(matrix) :: quotient quotient = back_substitute(row_eschelon(x), y) end function end template contains elemental function minus_matrix(x, y) result(difference) type(matrix), intent(in) :: x, y type(matrix) :: difference difference%elements = minus_t(x%elements, y%elements) end function end template contains elemental function plus_matrix(x, y) result(combined) type(matrix), intent(in) :: x, y type(matrix) :: combined integer :: i, j ! TODO: something wrong with elemental function operations ! combined%elements = plus_t(x%elements, y%elements) do i = 1, n do j = 1, n combined%elements(i,j) = plus_t(x%elements(i,j), y%elements(i,j)) end do end do end function pure function zero() type(matrix) :: zero zero%elements = zero_t() end function elemental function times_matrix(x, y) result(combined) type(matrix), intent(in) :: x, y type(matrix) :: combined integer :: i, j, k type(T) :: dot do i = 1, n do j = 1, n ! TODO: something wrong with elemental function operations ! combined%elements(i, j) = sum(times_t(x%elements(i,:), y%elements(:,j))) dot = zero_t() do k = 1, n dot = plus_t(dot, times_t(x%elements(i,k), y%elements(k,j))) end do combined%elements(i, j) = dot end do end do end function pure function one() type(matrix) :: one integer :: i one%elements = zero_t() do concurrent (i = 1:n) one%elements(i, i) = one_t() end do end function end template end module module template_04_func implicit none private public :: zero_integer, zero_real, one_integer, one_real contains pure function zero_integer() result(z) integer :: z z = 0 end function pure function one_integer() result(z) integer :: z z = 1 end function pure function zero_real() result(z) real :: z z = 0 end function pure function one_real() result(z) real :: z z = 1 end function end module program template_04 use template_04_matrix use template_04_func integer, parameter :: n = 2 instantiate matrix_tmpl(integer, operator(+), zero_integer, operator(*), one_integer, n), & only: integer_matrix => matrix, & integer_plus_matrix => plus_matrix, & integer_times_matrix => times_matrix, & integer_matrix_subtraction_t => matrix_subtraction_t instantiate integer_matrix_subtraction_t(operator(-)), & only: integer_minus_matrix => minus_matrix, & integer_gaussian_solver_tmpl => gaussian_solver_tmpl instantiate integer_gaussian_solver_tmpl(operator(/)), & only: integer_div_matrix => div_matrix type(integer_matrix) :: m1, m2, m3, m4 m1%elements(1,1) = 1 m1%elements(1,2) = 0 m1%elements(2,1) = 0 m1%elements(2,2) = 1 m2%elements(1,1) = 1 m2%elements(1,2) = 2 m2%elements(2,1) = 2 m2%elements(2,2) = 1 m3 = integer_plus_matrix(m1, m2) print *, m3%elements(1,1), m3%elements(1,2) print *, m3%elements(2,1), m3%elements(2,2), achar(10) m4 = integer_times_matrix(m3, m2) print *, m4%elements(1,1), m4%elements(1,2) print *, m4%elements(2,1), m4%elements(2,2), achar(10) instantiate matrix_tmpl(real, operator(+), zero_real, operator(*), one_real, n), & only: real_matrix => matrix, & real_plus_matrix => plus_matrix, & real_times_matrix => times_matrix, & real_matrix_subtraction_t => matrix_subtraction_t instantiate real_matrix_subtraction_t(operator(-)), & only: real_minus_matrix => minus_matrix, & real_gaussian_solver_tmpl => gaussian_solver_tmpl instantiate real_gaussian_solver_tmpl(operator(/)), & only: real_div_matrix => div_matrix type(real_matrix) :: r1, r2, r3, r4 r1%elements(1,1) = 1.2 r1%elements(1,2) = 0 r1%elements(2,1) = 0 r1%elements(2,2) = 1 r2%elements(1,1) = 1 r2%elements(1,2) = 2.5 r2%elements(2,1) = 2 r2%elements(2,2) = 1 r3 = real_plus_matrix(r1, r2) print *, r3%elements(1,1), r3%elements(1,2) print *, r3%elements(2,1), r3%elements(2,2), achar(10) r4 = real_times_matrix(r3, r2) print *, r4%elements(1,1), r4%elements(1,2) print *, r4%elements(2,1), r4%elements(2,2), achar(10) end programlfortran-0.63.0/integration_tests/parameter_07.f900000664000175000017500000000060315174404631022172 0ustar alastairalastairprogram parameter_07 integer, parameter :: n = 2 complex :: sum real, parameter :: d(3 : n+3) = [2.48574089138753566e-5,1.05142378581721974, -3.45687097222016235] print *, d(3) if (abs(d(3) - 2.48574089138753566e-5) > 1e-6) error stop print *, d(4) if (abs(d(4) - 1.05142378581721974) > 1e-6) error stop print *, d(5) if (abs(d(5) + 3.45687097222016235) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/tuple_test_04_.f900000664000175000017500000000134415174404631022541 0ustar alastairalastairmodule tuple_test_04_mod implicit none real :: eps = 1e-12 contains subroutine tests() _lfortran_tuple(_lfortran_list(integer), character(len=:)) :: ttype _lfortran_tuple(_lfortran_list(integer), character(len=:)) :: contents ttype = _lfortran_tuple_constant(_lfortran_list_constant(-1), "dimensions") contents = _lfortran_tuple_constant(_lfortran_list_constant(1, 2), "") ! TODO: Add List cmp if (_lfortran_len(_lfortran_get_item(ttype, 0)) /= 1) error stop if (len(_lfortran_get_item(contents, 1)) /= 0) error stop if (_lfortran_get_item(ttype, 1) /= "dimensions") error stop end subroutine end module program run_tuples use tuple_test_04_mod call tests() end program lfortran-0.63.0/integration_tests/pdt_09.f900000664000175000017500000000106715174404631021010 0ustar alastairalastairmodule pdt_09_module implicit none integer, parameter :: dp = kind(0.0d0) type tensor_t(k) integer, kind :: k = dp real(k) :: value end type tensor_t interface module subroutine trigger(self) class(tensor_t(dp)), intent(in) :: self end subroutine trigger end interface end module pdt_09_module program pdt_09 use pdt_09_module, only : dp, tensor_t implicit none type(tensor_t(dp)) :: x x%value = 3.0_dp if (x%k /= dp) error stop if (abs(x%value - 3.0_dp) > 1.0e-12_dp) error stop print *, "ok" end program pdt_09 lfortran-0.63.0/integration_tests/pdt_15.f900000664000175000017500000000114415174404631021001 0ustar alastairalastairmodule pdt_15_m implicit none type :: base_t(k) integer, kind :: k = 4 real(k), allocatable :: x(:) end type type, extends(base_t) :: child_t(j) integer, kind :: j = 4 end type end module program pdt_15 use pdt_15_m implicit none type(child_t) :: obj allocate(obj%x(3)) obj%x = [1.0, 2.0, 3.0] call sub(obj) contains subroutine sub(x) class(base_t), intent(in) :: x if (size(x%x) /= 3) error stop if (abs(x%x(1) - 1.0) > 1.0e-6) error stop if (abs(x%x(2) - 2.0) > 1.0e-6) error stop if (abs(x%x(3) - 3.0) > 1.0e-6) error stop end subroutine end program lfortran-0.63.0/integration_tests/separate_compilation_04.f900000664000175000017500000000025015174404631024407 0ustar alastairalastairprogram separate_compilation_04 use separate_compilation_04b_module implicit none real, allocatable :: A(:,:) allocate(A(3,3)) A = 02315.1235 call temp(A) end program lfortran-0.63.0/integration_tests/arrays_91.f900000664000175000017500000000300415174404631021514 0ustar alastairalastairmodule arrays_91_mod contains function matprod21(x, y) result(z) implicit none integer, intent(in) :: x(:, :) integer, intent(in) :: y(:) integer, allocatable :: z(:) allocate(z(size(x, 1))) z = matmul(x, y) end function matprod21 function matprod22(x, y) result(z) implicit none integer, intent(in) :: x(:, :) integer, intent(in) :: y(:, :) integer, allocatable :: z(:, :) allocate(z(size(x, 1), size(y, 2))) z = matmul(x, y) end function matprod22 function matprod12(x, y) result(z) implicit none integer, intent(in) :: x(:) integer, intent(in) :: y(:, :) integer, allocatable :: z(:) allocate(z(size(y, 2))) z = matmul(x, y) end function matprod12 end module program arrays_91 use arrays_91_mod implicit none integer :: x_1(2), x_2(2, 3), y_1(3), y_2(3, 4), z_1(2), z_2(2, 4), y_2_(2, 3), z_1_(3) x_2 = reshape([1, 2, 3, 4, 5, 6], [2, 3]) y_1 = [1, 2, 3] z_1 = matprod21(x_2, y_1) print *, "z_1: ", z_1 if (any(z_1 /= [22, 28])) error stop y_2 = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [3, 4]) z_2 = matprod22(x_2, y_2) print *, "z_2: ", z_2 if (any(z_2 /= reshape([22, 28, 49, 64, 76, 100, 103, 136], [2, 4]))) error stop x_1 = [1, 2] y_2_ = reshape([4, 5, 6, 7, 8, 9], [2, 3]) z_1_ = matprod12(x_1, y_2_) print *, "z_1_: ", z_1_ if (any(z_1_ /= [14, 20, 26])) error stop end program lfortran-0.63.0/integration_tests/derived_types_83.f900000664000175000017500000000137015174404631023066 0ustar alastairalastairmodule wrappers_derived_types_83 implicit none type :: other_type class(*), allocatable :: value end type other_type interface set module procedure set_other end interface set contains subroutine set_other( other, value ) type(other_type), intent(out) :: other class(*), intent(in) :: value allocate(other % value, source=value) end subroutine set_other end module wrappers_derived_types_83 program derived_types_83 use wrappers_derived_types_83 implicit none contains subroutine input_random_data( ) class(*), allocatable :: dummy type(other_type) :: other call set ( other, dummy ) end subroutine input_random_data end programlfortran-0.63.0/integration_tests/derived_types_45.f900000664000175000017500000000050015174404631023056 0ustar alastairalastairmodule derived_types_45_mod implicit none type myint integer :: m end type end module derived_types_45_mod program derived_types_45 use derived_types_45_mod implicit none type(myint), allocatable :: ins ins = myint(44) if (ins%m /= 44) error stop end program derived_types_45 lfortran-0.63.0/integration_tests/ilp64_file_ops_01.f900000664000175000017500000000115615174404631023026 0ustar alastairalastair! Test: file I/O operations with -fdefault-integer-8 (ILP64 mode) ! Fixes #9772 program ilp64_file_ops_01 implicit none integer :: u character(len=10) :: line u = 10 open(u, file="/tmp/test_ilp64_file_ops.txt", status="replace") write(u, '(A)') "line1" write(u, '(A)') "line2" ! Test rewind rewind(u) read(u, '(A)') line if (trim(line) /= "line1") error stop "rewind failed" ! Test backspace backspace(u) read(u, '(A)') line if (trim(line) /= "line1") error stop "backspace failed" ! Test flush flush(u) close(u) print *, "PASS" end program lfortran-0.63.0/integration_tests/nested_namelist_01.f900000664000175000017500000000065115174404631023365 0ustar alastairalastairmodule nested_namelist_01_mod contains subroutine outer() integer :: i real :: x namelist /nml/ i, x i = 2 x = 3.0 call inner() contains subroutine inner() write (*, nml=nml) end subroutine inner end subroutine outer end module program nested_namelist_01 use nested_namelist_01_mod implicit none call outer() end program lfortran-0.63.0/integration_tests/array_unbounded_01.f900000664000175000017500000000036715174404631023374 0ustar alastairalastairsubroutine sub(x, z) real :: x(1:*), z(10) x(1) = 4.29 print *, x(1) end subroutine program array_unbounded_01 real :: y(10), w(10) call sub(y, w) print *, y(1) if (abs(y(1) - 4.29) > 1e-10) error stop end program lfortran-0.63.0/integration_tests/move_alloc_pointer_alias.f900000664000175000017500000000055315174404631024741 0ustar alastairalastairprogram move_alloc_pointer_alias implicit none real, allocatable, target :: a(:), b(:) real, pointer :: c(:) allocate(a(10), source=10.0) c => a call move_alloc(a, b) if (.not. associated(c)) error stop if (size(b) /= 10) error stop if (any(b /= 10.0)) error stop c(2) = 2.0 if (b(2) /= 2.0) error stop end program lfortran-0.63.0/integration_tests/intrinsics_87.f900000664000175000017500000000060515174404631022411 0ustar alastairalastairprogram intrinsics_87 implicit none integer, allocatable :: C(:, :) complex(4) :: arr(3) allocate(C(5, 10)) C = -10 C = abs(C) print *, C if (any(C /= 10)) error stop ! test if 'abs' of complex array results in a real array arr = [(3, 4), (5, 6), (7, 8)] print *, sum(abs(arr)) if (sum(abs(arr)) - 23.4403954 > 1e-7) error stop end program lfortran-0.63.0/integration_tests/operator_overloading_36_mod_base_sub.f900000664000175000017500000000115115174404631027141 0ustar alastairalastairsubmodule(operator_overloading_36_mod_base) operator_overloading_36_mod_base_sub implicit none contains module function negate_array(a) result(c) class(array_type), intent(in) :: a type(array_type) :: c c%val = -a%val end function module function add_arrays(a, b) result(c) class(array_type), intent(in) :: a, b type(array_type) :: c c%val = a%val + b%val end function module function subtract_arrays(a, b) result(c) class(array_type), intent(in) :: a, b type(array_type) :: c c = a + (-b) end function end submodule lfortran-0.63.0/integration_tests/test_ieee_arithmetic_02.f900000664000175000017500000000033315174404631024364 0ustar alastairalastairprogram test_ieee_arithmetic_02 use , intrinsic:: ieee_arithmetic integer , parameter:: dp = kind(1d0) real:: expected = 1/3.0 if (abs(1/3.0_dp - expected) > 1e-6) error stop end program test_ieee_arithmetic_02 lfortran-0.63.0/integration_tests/intrinsics_97.f900000664000175000017500000000022215174404631022405 0ustar alastairalastairprogram intrinsics_97 real(4) a real(8) b print*, tiny(a) print*, tiny(b) print*, kind(tiny(a)) print*, kind(tiny(b)) end lfortran-0.63.0/integration_tests/nested_12.f900000664000175000017500000000125415174404631021473 0ustar alastairalastairmodule struct_var_nested_12 type :: toml_value integer :: key = 0 end type toml_value end module module nested_12_mod use struct_var_nested_12, only: toml_lexer => toml_value contains subroutine char_num() type(toml_lexer) :: lexer lexer%key = 5 call temp() contains subroutine temp() call semantics(lexer) end subroutine end subroutine subroutine semantics(lexer) class(toml_lexer), intent(inout) :: lexer if(lexer%key /= 5) error stop end subroutine semantics end module program nested_12 use struct_var_nested_12 use nested_12_mod call char_num() end programlfortran-0.63.0/integration_tests/implicit_interface_18.f900000664000175000017500000000167315174404631024056 0ustar alastairalastairprogram optional_example implicit none real(8) :: result call power_function(3.0_8, result) if (result /= 9.0_8) error stop call power_function(3.0_8, result, 3) if (result /= 27.0_8) error stop call interface_trouble(5) contains subroutine power_function(base, res, exponent) implicit none real(8), intent(in) :: base integer, intent(in), optional :: exponent real(8), intent(out) :: res integer :: exp_value if (present(exponent)) then exp_value = exponent else exp_value = 2 end if res = base ** exp_value end subroutine power_function recursive subroutine interface_trouble(n,t) implicit none integer, intent(in) :: n real(8), intent(out), optional :: t if(n <= 0) return call interface_trouble(n-1, t) end subroutine interface_trouble end program optional_example lfortran-0.63.0/integration_tests/proc_ptr_nopass_01.f900000664000175000017500000000067715174404631023432 0ustar alastairalastair module proc_ptr_nopass_01_m implicit none type :: ctx_t procedure(f_iface), pointer, nopass :: fn => null() end type ctx_t abstract interface real function f_iface(x) real, intent(in) :: x end function f_iface end interface end module proc_ptr_nopass_01_m program proc_ptr_nopass_01 use proc_ptr_nopass_01_m print *, "Test Passed Successfully!" end program proc_ptr_nopass_01 lfortran-0.63.0/integration_tests/print_03.f900000664000175000017500000000034115174404631021341 0ustar alastairalastairprogram main implicit none integer :: x(3), a real :: z(2) x(1) = 1 x(2) = 2 x(3) = 3 a = 10249275 z(1) = 20.420 z(2) = 3204.02 print *, "x is printed:", x, 42, 53, z, a end program lfortran-0.63.0/integration_tests/gpu_metal_142_mod.f900000664000175000017500000000220015174404631023101 0ustar alastairalastairmodule gpu_metal_142_act_m implicit none enum, bind(C) enumerator :: gelu = 1 end enum type, public :: act_t integer :: s = gelu contains procedure :: eval end type interface elemental module function eval(self, x) result(y) class(act_t), intent(in) :: self real, intent(in) :: x real :: y end function end interface end module gpu_metal_142_act_m submodule(gpu_metal_142_act_m) gpu_metal_142_act_s implicit none contains module procedure eval y = x * 2.0 end procedure end submodule gpu_metal_142_act_s module gpu_metal_142_net_m use gpu_metal_142_act_m, only: act_t implicit none type, public :: net_t type(act_t) :: a contains procedure :: run end type interface module subroutine run(self, x, y, n) class(net_t), intent(inout) :: self integer, intent(in) :: n real, intent(in) :: x(n) real, intent(out) :: y(n) end subroutine end interface end module gpu_metal_142_net_m submodule(gpu_metal_142_net_m) gpu_metal_142_net_s implicit none contains module procedure run integer :: i do concurrent (i = 1:n) y(i) = self%a%eval(x(i)) end do end procedure end submodule gpu_metal_142_net_s lfortran-0.63.0/integration_tests/class_102.f900000664000175000017500000000335015174404631021375 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/8303 ! Extended type with polymorphic dispatch through self%obj%method(wrap(1)%arr) ! LLVM IR verification failed with type mismatch for allocatable array argument module class_102_mod type, abstract :: AbsType contains procedure(method), deferred :: method end type AbsType abstract interface subroutine method(self,arr) import class(AbsType), intent(inout) :: self real(8), allocatable, intent(inout) :: arr(:) end subroutine method end interface type, extends(AbsType) :: MyType class(AbsType), allocatable :: obj contains procedure :: method => implementation procedure :: do_work end type MyType type :: Wrapper real(8), allocatable :: arr(:) end type Wrapper contains subroutine implementation(self,arr) class(MyType), intent(inout) :: self real(8), allocatable, intent(inout) :: arr(:) integer :: i do i = 1, size(arr) arr(i) = arr(i) * 2.0d0 end do end subroutine implementation subroutine do_work(self,wrap) class(MyType), intent(inout) :: self type(Wrapper), intent(inout) :: wrap(:) call self%obj%method(wrap(1)%arr) end subroutine do_work end module class_102_mod program class_102 use class_102_mod implicit none type(MyType) :: obj type(Wrapper) :: wrap(1) allocate(MyType :: obj%obj) allocate(wrap(1)%arr(3)) wrap(1)%arr = [1.0d0, 2.0d0, 3.0d0] call obj%do_work(wrap) if (abs(wrap(1)%arr(1) - 2.0d0) > 1.0d-10) error stop if (abs(wrap(1)%arr(2) - 4.0d0) > 1.0d-10) error stop if (abs(wrap(1)%arr(3) - 6.0d0) > 1.0d-10) error stop print *, "PASS" end program class_102 lfortran-0.63.0/integration_tests/nested_10.f900000664000175000017500000000146215174404631021472 0ustar alastairalastairprogram example_lmder1 implicit none integer, parameter :: wp = 8 integer, parameter :: n = 3 integer, parameter :: m = 15 integer :: i real(wp) :: x(n), fvec(m) x = 1 call fcn(m, n, x, fvec) print *, fvec do i = 1, m if ((abs(fvec(i)) - 1.0) > 1e-6) error stop end do contains subroutine check_deriv() call fcn2(m, n, x, fvec) end subroutine check_deriv subroutine fcn2(m, n, x, fvec) integer, intent(in) :: m integer, intent(in) :: n real(wp), intent(in) :: x(n) real(wp), intent(inout) :: fvec(m) end subroutine fcn2 subroutine fcn(m, n, x, fvec) integer, intent(in) :: m integer, intent(in) :: n real(wp), intent(in) :: x(n) real(wp), intent(out) :: fvec(m) fvec = x(1) end subroutine fcn end program lfortran-0.63.0/integration_tests/openmp_67.f900000664000175000017500000000676315174404631021533 0ustar alastairalastairprogram openmp_67 use omp_lib implicit none integer, parameter :: n = 10000 integer :: i, j real :: static_time, dynamic_time, guided_time double precision :: start_time real :: a(n), b(n), c(n) call omp_set_num_threads(4) print *, "=== Schedule Comparison Test ===" print *, "Comparing performance of different schedules" print *, "Array size:", n, "Threads:", omp_get_max_threads() ! Initialize arrays ! Alternative: Initialize arrays with deterministic values do i = 1, n b(i) = real(i) c(i) = real(n - i + 1) end do ! Test STATIC start_time = omp_get_wtime() !$omp parallel do schedule(static) do i = 1, n a(i) = sqrt(b(i)) + log(abs(c(i)) + 1.0) end do !$omp end parallel do static_time = omp_get_wtime() - start_time ! Test DYNAMIC start_time = omp_get_wtime() !$omp parallel do schedule(dynamic) do i = 1, n a(i) = sqrt(b(i)) + log(abs(c(i)) + 1.0) end do !$omp end parallel do dynamic_time = omp_get_wtime() - start_time ! Test GUIDED start_time = omp_get_wtime() !$omp parallel do schedule(guided) do i = 1, n a(i) = sqrt(b(i)) + log(abs(c(i)) + 1.0) end do !$omp end parallel do guided_time = omp_get_wtime() - start_time ! Print results print '(A,F8.6,A)', "STATIC time: ", static_time, " seconds" print '(A,F8.6,A)', "DYNAMIC time: ", dynamic_time, " seconds" print '(A,F8.6,A)', "GUIDED time: ", guided_time, " seconds" ! Analysis print *, "" print *, "Analysis:" ! For uniform workload, static should be fastest if (static_time < dynamic_time * 0.9 .and. static_time < guided_time * 0.9) then print *, "✓ STATIC is fastest for uniform workload" else if (dynamic_time < static_time * 0.9) then print *, "! DYNAMIC is fastest" else if (guided_time < static_time * 0.9) then print *, "! GUIDED is fastest" else print *, "- All schedules perform similarly" end if ! Test with non-uniform workload print *, "" print *, "Testing with non-uniform workload..." ! Make some iterations heavier do i = 1, n if (mod(i, 10) == 0) then b(i) = b(i) * 1000.0 ! Make every 10th iteration heavier end if end do ! Test STATIC with non-uniform start_time = omp_get_wtime() !$omp parallel do schedule(static) do i = 1, n if (mod(i, 10) == 0) then ! Heavy computation a(i) = 0.0 do j = 1, 100 a(i) = a(i) + sqrt(b(i)) + log(abs(c(i)) + 1.0) end do else a(i) = sqrt(b(i)) + log(abs(c(i)) + 1.0) end if end do !$omp end parallel do static_time = omp_get_wtime() - start_time ! Test DYNAMIC with non-uniform start_time = omp_get_wtime() !$omp parallel do schedule(dynamic) do i = 1, n if (mod(i, 10) == 0) then a(i) = 0.0 do j = 1, 100 a(i) = a(i) + sqrt(b(i)) + log(abs(c(i)) + 1.0) end do else a(i) = sqrt(b(i)) + log(abs(c(i)) + 1.0) end if end do !$omp end parallel do dynamic_time = omp_get_wtime() - start_time print *, "" print *, "Non-uniform workload results:" print '(A,F8.6,A)', "STATIC time: ", static_time, " seconds" print '(A,F8.6,A)', "DYNAMIC time: ", dynamic_time, " seconds" end program openmp_67lfortran-0.63.0/integration_tests/openmp_02.f900000664000175000017500000000025115174404631021502 0ustar alastairalastairprogram openmp_02 use omp_lib call omp_set_num_threads(4) print *, "Number of threads: ", omp_get_max_threads() if (omp_get_max_threads() /= 4) error stop end program lfortran-0.63.0/integration_tests/string_15.f900000664000175000017500000000060115174404631021515 0ustar alastairalastairprogram string_15 implicit none character(len = 10) :: s1 = 'abcde' character(len = 10) :: s2 = 'xyz' ! lge is >=, lgt is >, lle is <=, llt is < if (lge(s1, s2) .neqv. .false.) error stop if (lgt(s1, s2) .neqv. .false.) error stop if (lle(s1, s2) .neqv. .true.) error stop if (llt(s1, s2) .neqv. .true.) error stop print *, s1, s2 end program lfortran-0.63.0/integration_tests/format_19.f900000664000175000017500000000103315174404631021503 0ustar alastairalastairprogram format_19 implicit none real(4) :: x4 character(len=32) :: buffer x4 = 9.33264777E-43 write(buffer, "(ES0.8)") x4 print *, buffer if (buffer /= "9.33264777E-43") error stop "Incorrect formatting of x4" write(buffer, "(ES0.8)") tiny(0.0) print *, buffer if (buffer /= "1.17549435E-38") error stop "Incorrect formatting of tiny(0.0)" write(buffer, "(ES0.8)") huge(0.0) print *, buffer if (buffer /= "3.40282347E+38") error stop "Incorrect formatting of huge(0.0)" end program lfortran-0.63.0/integration_tests/derived_types_113.f900000664000175000017500000000211115174404631023132 0ustar alastairalastair! Test: finalize components of derived types at scope exit ! Fortran 2018, clause 7.5.6.2 & 7.5.6.3 ! ! When a BLOCK construct terminates, non-pointer non-allocatable ! local variables are finalized. Finalization must recursively ! finalize finalizable components, even if the outer type itself ! has no FINAL subroutine. module derived_types_113_m implicit none type :: inner_t integer :: val = 0 contains final :: finalize_inner end type ! outer_t has NO final subroutine, but has a component of a finalizable type type :: outer_t type(inner_t) :: component end type logical :: finalized = .false. contains subroutine finalize_inner(self) type(inner_t), intent(inout) :: self finalized = .true. self%val = -1 end subroutine end module program derived_types_113 use derived_types_113_m implicit none block type(outer_t) :: obj obj%component%val = 42 end block ! At end of block, obj goes out of scope. ! obj%component (of type inner_t) should be finalized. if (.not. finalized) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/external_07.f900000664000175000017500000000051015174404631022031 0ustar alastairalastairdouble precision function f(x) double precision x f = x**2 return end function f subroutine sub(f) external f double precision f print *, f(2.0d0) if (abs(f(2.0d0) - 4.0d0) > 1.0d-10) error stop return end subroutine sub recursive subroutine a() external f call sub(f) end program external_07 call a() end lfortran-0.63.0/integration_tests/format_11.f900000664000175000017500000000037015174404631021476 0ustar alastairalastairprogram format_11 implicit none logical :: b print *, 'test writing a logical' print * b = .false. print *, 'formatted write' write (*, 700) .true. write (*, 700) b print *, 'using print' print *, .true. print *, b stop 700 format (l7) end program lfortran-0.63.0/integration_tests/intrinsics_191.f900000664000175000017500000000042415174404631022464 0ustar alastairalastairprogram intrinsics_191 implicit none complex :: a complex(kind=8) :: b integer :: res a = cmplx(1) res = kind(a) print *, res if (res /= 4) error stop b = cmplx(1) res = kind(b) print *, res if (res /= 8) error stop end program lfortran-0.63.0/integration_tests/no_explicit_return_type_01.f900000664000175000017500000000241315174404631025162 0ustar alastairalastairprogram no_explicit_return_type real, dimension(3) :: arr, squared_arr real :: val arr = [1.0, 2.0, 3.0] print *, "f_elemental_real(1.0): ", f_elemental_real(1.0) if (abs(f_elemental_real(1.0) - 43.0) > 1e-12) error stop print *, "f_pure_real(1.0): ", f_pure_real(1.0) if (abs(f_pure_real(1.0) - 24.0) > 1e-12) error stop squared_arr = square(arr) print *, "squared_arr: ", squared_arr if (any(squared_arr /= [1.0, 4.0, 9.0])) error stop val = impure_log(10.0) print *, "val: ", val if ( abs(val - 2.0) > 1e-12 ) error stop contains ! elemental function without explicit type elemental function f_elemental_real(x) real, intent(in) :: x f_elemental_real = x + 42.0 end function ! pure function without explicit type pure function f_pure_real(x) real, intent(in) :: x f_pure_real = x + 23.0 end function ! pure elemental function without explicit type pure elemental function square(x) real, intent(in) :: x square = x * x end function square ! impure function without explicit type impure function impure_log(a) real, intent(in) :: a impure_log = log(a) end function impure_log end program no_explicit_return_type lfortran-0.63.0/integration_tests/interop/0000775000175000017500000000000015174404631021045 5ustar alastairalastairlfortran-0.63.0/integration_tests/interop/test_cpp.cpp0000664000175000017500000000500715174404631023374 0ustar alastairalastair// ptrdiff_t, size_t #include // int32_t #include #include #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include struct descriptor_dimension { ptrdiff_t stride; ptrdiff_t lower_bound; ptrdiff_t upper_bound; }; template struct descriptor { Type *base_addr; size_t offset; ptrdiff_t dtype; descriptor_dimension dim[Rank]; }; template descriptor c_desc(Type *array_ptr, const std::vector> &dims) { descriptor a; a.base_addr = array_ptr; a.offset = 0; for (int n=0; n < Rank; n++) { a.dim[n].lower_bound = dims[n].first; a.dim[n].upper_bound = dims[n].second; if (n == 0) { a.dim[n].stride = 1; } else { a.dim[n].stride = (a.dim[n-1].upper_bound - a.dim[n-1].lower_bound + 1) * a.dim[n-1].stride; } a.offset = a.offset - a.dim[n].lower_bound * a.dim[n].stride; } a.dtype = Rank; // 1 is INTEGER element type a.dtype |= (1 << 3); // sizeof(Type) is the size of INTEGER a.dtype |= (sizeof(Type) << 6); return a; } #include "mod2.h" TEST_CASE("f1") { int a = 1; int b = 2; CHECK(__mod1_MOD_f1(&a, &b) == 3); } TEST_CASE("f2") { int n = 3; std::vector data(3); data[0] = 1; data[1] = 2; data[2] = 3; CHECK(__mod1_MOD_f2(&n, &data[0]) == 6); } TEST_CASE("f2b") { std::vector data(3); data[0] = 1; data[1] = 2; data[2] = 3; descriptor<1, int32_t> a = c_desc<1, int32_t>(&data[0], {{1, 3}}); CHECK(__mod1_MOD_f2b(&a) == 6); } TEST_CASE("f3") { std::vector data(6); data[0] = 1; data[1] = 2; data[2] = 3; data[3] = 4; data[4] = 5; data[5] = 6; int n = 2; int m = 3; CHECK(__mod1_MOD_f3(&n, &m, &data[0]) == 21); } TEST_CASE("f3b") { std::vector data = {1, 2, 3, 4, 5, 6}; descriptor<2, int32_t> a = c_desc<2, int32_t>(&data[0], {{1, 2}, {1, 3}}); CHECK(__mod1_MOD_f3b(&a) == 21); } TEST_CASE("f4") { int a = 1; int b = 0; CHECK(__mod1_MOD_f4(&a, &b) == 0); CHECK(b == 1); } TEST_CASE("f5b") { std::vector data(6); data[0] = 1; data[1] = 2; data[2] = 3; data[3] = 4; data[4] = 5; data[5] = 6; descriptor<2, int32_t> a = c_desc<2, int32_t>(&data[0], {{1, 2}, {1, 3}}); CHECK(__mod1_MOD_f5b(&a) == 9); } lfortran-0.63.0/integration_tests/interop/wrap_cpp.py0000664000175000017500000000641615174404631023241 0ustar alastairalastair""" # Design This file converts from a GFortran module file representation (documented in the `lfortran.adapters.gfortran.mod` module) to an Abstract Semantic Representation (ASR). """ # TODO: move this into the lfortran package itself import sys sys.path.append("../..") from lfortran.asr import asr from lfortran.asr.asr_check import verify_asr from lfortran.asr.asr_to_ast import asr_to_ast from lfortran.ast.ast_to_src import ast_to_src from lfortran.adapters.gfortran.mod import mod_to_asr from lfortran.asr.builder import (make_translation_unit, translation_unit_make_module, scope_add_function, make_type_integer, make_type_real, type_eq, make_binop, scope_add_symbol, Scope, function_make_var, array_is_assumed_shape) class WrapperVisitor(asr.ASTVisitor): def visit_TranslationUnit(self, node): out = "" for s in node.global_scope.symbols: sym = node.global_scope.symbols[s] out += self.visit(sym) return out def visit_Module(self, node): name = "mod2" out = """\ #ifndef MOD2_H #define MOD2_H extern "C" { """ out += self.visit_scope(node.symtab) out += """\ } #endif // MOD2_H """ return out def visit_scope(self, symtab, parent=None): out = "" for s, sym in symtab.symbols.items(): out += self.visit(sym) return out def visit_object(self, o): if isinstance(o, Scope): return self.visit_scope(o) elif isinstance(o, list): return self.visit_sequence(o) elif isinstance(o, (str, int)) or o is None: return o else: print(type(o)) raise NotImplementedError() def visit_Function(self, node): name = self.visit_object(node.name) args2 = [] for arg in node.args: #type = self.visit(arg.type) #if array_is_assumed_shape(type): # if len(type.dims) == 1: # dname = "c_desc1_t" # elif len(type.dims) == 2: # dname = "c_desc2_t" # else: # raise NotImplementedError("Too many dimensions") # args2.append(dname) #else: # args2.append(arg) n = len(arg.type.dims) if n == 0: args2.append("int32_t *%s" % arg.name) else: if array_is_assumed_shape(arg.type): args2.append("descriptor<%s, int32_t> *%s" % (n, arg.name)) else: args2.append("int32_t *%s" % arg.name) #symtab = self.visit_object(node.symtab) #self._lookup = 1 #self._scope = symtab #args = self.visit_sequence(node.args) #body = self.visit_sequence(node.body) #return_var = self.visit(node.return_var) #self._lookup = 0 #if node.bind: # bind = self.visit(node.bind) #else: # bind = None return "int32_t __mod1_MOD_%s(%s);\n" % (name, ", ".join(args2)) #return asr.Function(name=name, args=args, body=body, bind=bind, return_var=return_var, symtab=symtab) def create_wrapper(u): v = WrapperVisitor() u2 = v.visit(u) return u2 u = mod_to_asr("mod1.mod") u2 = create_wrapper(u) print(u2) lfortran-0.63.0/integration_tests/interop/gfort_interop.f900000664000175000017500000000464715174404631024261 0ustar alastairalastairmodule gfort_interop use iso_c_binding, only: c_int, c_loc, c_ptr, c_ptrdiff_t, c_size_t, c_int32_t implicit none type, bind(c) :: descriptor_dimension integer(c_ptrdiff_t) :: stride integer(c_ptrdiff_t) :: lower_bound integer(c_ptrdiff_t) :: upper_bound end type type, bind(c) :: c_desc1_t type(c_ptr) :: base_addr integer(c_size_t) :: offset integer(c_ptrdiff_t) :: dtype type(descriptor_dimension) :: dim(1) end type type, bind(c) :: c_desc2_t type(c_ptr) :: base_addr integer(c_size_t) :: offset integer(c_ptrdiff_t) :: dtype type(descriptor_dimension) :: dim(2) end type interface c_desc module procedure c_desc1_int32 module procedure c_desc2_int32 end interface integer, parameter :: INTEGER_ELEMENT_TYPE = 1 integer, parameter :: LOGICAL_ELEMENT_TYPE = 2 integer, parameter :: REAL_ELEMENT_TYPE = 3 integer, parameter :: COMPLEX_ELEMENT_TYPE = 4 integer, parameter :: DERIVED_TYPE_ELEMENT_TYPE = 5 integer, parameter :: CHARACTER_ELEMENT_TYPE = 6 integer, parameter :: c_int8_t_size = 1 integer, parameter :: c_int16_t_size = 2 integer, parameter :: c_int32_t_size = 4 integer, parameter :: c_int64_t_size = 8 integer, parameter :: c_int128_t_size = 16 contains type(c_desc1_t) function c_desc1_int32(A) result(desc) integer(c_int32_t), intent(in), target :: A(:) desc%base_addr = c_loc(A(1)) desc%dim(1)%stride = 1 ! A must be contiguous desc%dim(1)%lower_bound = lbound(A,1) desc%dim(1)%upper_bound = ubound(A,1) desc%dtype = size(shape(A)) ! Dimension desc%dtype = ior(desc%dtype, lshift(INTEGER_ELEMENT_TYPE, 3)) desc%dtype = ior(desc%dtype, lshift(c_int32_t_size, 6)) desc%offset = -(desc%dim(1)%lower_bound * desc%dim(1)%stride) end function type(c_desc2_t) function c_desc2_int32(A) result(desc) integer(c_int32_t), intent(in), target :: A(:,:) integer :: n, dim dim = size(shape(A)) desc%base_addr = c_loc(A(1,1)) desc%offset = 0 do n = 1, dim if (n == 1) then desc%dim(n)%stride = 1 else desc%dim(n)%stride = & (desc%dim(n-1)%upper_bound - desc%dim(n-1)%lower_bound + 1) & * desc%dim(n-1)%stride end if desc%dim(n)%lower_bound = lbound(A,n) desc%dim(n)%upper_bound = ubound(A,n) desc%offset = desc%offset & - desc%dim(n)%lower_bound * desc%dim(n)%stride end do desc%dtype = dim desc%dtype = ior(desc%dtype, lshift(INTEGER_ELEMENT_TYPE, 3)) desc%dtype = ior(desc%dtype, lshift(c_int32_t_size, 6)) end function end module lfortran-0.63.0/integration_tests/interop/test_mod2.f900000664000175000017500000000101415174404631023261 0ustar alastairalastairprogram test_mod2 use mod2, only: f1, f2, f3, f4, f2b, f3b implicit none integer :: x call assert(f1(1, 2) == 3) call assert(f2(3, [1, 2, 3]) == 6) call assert(f2b([1, 2, 3]) == 6) call assert(f3(2, 3, reshape([1, 2, 3, 4, 5, 6], [2,3])) == 21) call assert(f3b(reshape([1, 2, 3, 4, 5, 6], [2,3])) == 21) x = 0 call assert(f4(1, x) == 0) call assert(x == 1) contains subroutine assert(condition) logical, intent(in) :: condition if (.not. condition) error stop "Assert failed." end subroutine end program lfortran-0.63.0/integration_tests/interop/cxxwrap.py0000664000175000017500000000411315174404631023112 0ustar alastairalastair""" Install Python wrappers to Clang: conda install -c conda-forge python-clang """ from clang.cindex import Index, CursorKind, TypeKind import sys sys.path.append("../..") from lfortran.asr import asr from lfortran.asr.asr_check import verify_asr from lfortran.asr.asr_to_ast import asr_to_ast from lfortran.ast.ast_to_src import ast_to_src from lfortran.asr.builder import (make_translation_unit, translation_unit_make_module, scope_add_function, make_type_integer, make_type_real, type_eq, make_binop, scope_add_symbol, Scope, function_make_var, array_is_assumed_shape) index = Index.create() tu = index.parse("a.h") def process(node): unit = make_translation_unit() module = translation_unit_make_module(unit, "cxx_wrapper") for child in node.get_children(): if child.kind == CursorKind.FUNCTION_DECL: process_function(module.symtab, child) else: print(child.kind.name, child.spelling, child.location) #import IPython; IPython.embed() verify_asr(unit) return unit def process_type(t): if t.kind == TypeKind.FUNCTIONPROTO: result = process_type(t.get_result()) args = [] for arg in t.argument_types(): args.append(process_type(arg)) return "result(%s), args(%s)" % (result, ", ".join(args)) elif t.kind == TypeKind.POINTER: pointee = process_type(t.get_pointee()) return "pointer(%s)" % pointee elif t.kind == TypeKind.INT: return "int" else: print(t.spelling) raise Exception("Type not supported") def process_function(scope, node): types = process_type(node.type) arg_names = [] for arg in node.get_arguments(): arg_names.append(arg.spelling) type = make_type_integer() return_var = asr.VariableOld(name=node.spelling, type=type) f = scope_add_function(scope, node.spelling, args=arg_names, return_var=return_var) for a in f.args: a.intent = "in" f.bind = asr.Bind(lang="c", name=node.spelling) u = process(tu.cursor) a = asr_to_ast(u) s = ast_to_src(a) print(s) lfortran-0.63.0/integration_tests/interop/mod1.f900000664000175000017500000000143615174404631022231 0ustar alastairalastairmodule mod1 implicit none private public f1, f2, f3, f4, f2b, f3b, f5b contains integer function f1(a, b) result(r) integer, intent(in) :: a, b r = a + b end function integer function f2(n, a) result(r) integer, intent(in) :: n, a(n) r = sum(a) end function integer function f3(n, m, a) result(r) integer, intent(in) :: n, m, a(n,m) r = sum(a) end function integer function f2b(a) result(r) integer, intent(in) :: a(:) r = sum(a) end function integer function f3b(a) result(r) integer, intent(in) :: a(:,:) r = sum(a) end function integer function f4(a, b) integer, intent(in) :: a integer, intent(out) :: b b = a f4 = 0 end function integer function f5b(a) result(r) integer, intent(in) :: a(:,:) integer :: i r = 0 do i = 1, size(a, 2) r = r + a(1, i) end do end function end module lfortran-0.63.0/integration_tests/interop/mod2.sh0000775000175000017500000000037315174404631022250 0ustar alastairalastair#!/usr/bin/env bash set -ex FC=gfortran #FC=ifort $FC -o mod2.o -c mod2.f90 $FC -o test_mod2.o -c test_mod2.f90 $FC -o gfort_interop.o -c gfort_interop.f90 $FC -o test_mod2 test_mod2.o mod2.o gfort_interop.o -L. -lmod1 -Wl,-rpath -Wl,. ./test_mod2 lfortran-0.63.0/integration_tests/interop/run.sh0000775000175000017500000000067015174404631022213 0ustar alastairalastair#!/usr/bin/env bash set -ex FFLAGS_DEBUG="-Wall -Wextra -Wimplicit-interface -fPIC -g -fcheck=all -fbacktrace" cmake \ -DBUILD_SHARED_LIBS=yes \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_Fortran_FLAGS_DEBUG="$FFLAGS_DEBUG" \ . make ctest python wrap.py > mod2.f90 ./mod2.sh python wrap2.py > mod2.f90 ./mod2.sh python wrap_cpp.py > mod2.h make python cxxwrap.py > cxx_wrapper.f90 gfortran -c cxx_wrapper.f90 -o cxx_wrapper.o lfortran-0.63.0/integration_tests/interop/mod2.h0000664000175000017500000000064315174404631022062 0ustar alastairalastair#ifndef MOD2_H #define MOD2_H extern "C" { int32_t __mod1_MOD_f1(int32_t *a, int32_t *b); int32_t __mod1_MOD_f2(int32_t *n, int32_t *a); int32_t __mod1_MOD_f2b(descriptor<1, int32_t> *a); int32_t __mod1_MOD_f3(int32_t *n, int32_t *m, int32_t *a); int32_t __mod1_MOD_f3b(descriptor<2, int32_t> *a); int32_t __mod1_MOD_f4(int32_t *a, int32_t *b); int32_t __mod1_MOD_f5b(descriptor<2, int32_t> *a); } #endif // MOD2_H lfortran-0.63.0/integration_tests/interop/a.h0000664000175000017500000000011515174404631021433 0ustar alastairalastair#ifndef A_H #define A_H int f1(int a, int b); int f2(int x, int y); #endif lfortran-0.63.0/integration_tests/interop/test_fortran.f900000664000175000017500000000224215174404631024077 0ustar alastairalastairprogram test_fortran implicit none integer :: a(3) a = [1, 2, 3] call assert(f2b(a) == 6) call assert(f2b([1, 2, 3, 4, 5, 6]) == 21) call assert(f3b(reshape([1, 2, 3, 4, 5, 6], [2,3])) == 21) contains integer function f2b(a) result(r) use gfort_interop, only: c_desc integer, intent(in) :: a(:) interface integer(c_int) function f2b_c_wrapper(a) bind(c, name="__mod1_MOD_f2b") use iso_c_binding, only: c_int use gfort_interop, only: c_desc1_t type(c_desc1_t), intent(in) :: a end function end interface r = f2b_c_wrapper(c_desc(a)) end function integer function f3b(a) result(r) use gfort_interop, only: c_desc integer, intent(in) :: a(:,:) interface integer(c_int) function f3b_c_wrapper(a) bind(c, name="__mod1_MOD_f3b") use iso_c_binding, only: c_int use gfort_interop, only: c_desc2_t type(c_desc2_t), intent(in) :: a end function end interface r = f3b_c_wrapper(c_desc(a)) end function subroutine assert(condition) logical, intent(in) :: condition if (.not. condition) error stop "Assert failed." end subroutine end program lfortran-0.63.0/integration_tests/interop/test_mod1.f900000664000175000017500000000101415174404631023260 0ustar alastairalastairprogram test_mod1 use mod1, only: f1, f2, f3, f4, f2b, f3b implicit none integer :: x call assert(f1(1, 2) == 3) call assert(f2(3, [1, 2, 3]) == 6) call assert(f2b([1, 2, 3]) == 6) call assert(f3(2, 3, reshape([1, 2, 3, 4, 5, 6], [2,3])) == 21) call assert(f3b(reshape([1, 2, 3, 4, 5, 6], [2,3])) == 21) x = 0 call assert(f4(1, x) == 0) call assert(x == 1) contains subroutine assert(condition) logical, intent(in) :: condition if (.not. condition) error stop "Assert failed." end subroutine end program lfortran-0.63.0/integration_tests/interop/wrap.py0000664000175000017500000002156515174404631022401 0ustar alastairalastair""" # Design This file converts from a GFortran module file representation (documented in the `gfort_mod_parser.py` module) to an Abstract Semantic Representation (ASR). """ # TODO: move this into the lfortran package itself import sys sys.path.append("../..") from lfortran.ast import ast from lfortran.ast.ast_to_src import ast_to_src import lfortran.adapters.gfortran.mod as gp class Type(object): pass class Intrinsic(Type): __slots__ = ["kind"] def __init__(self, kind=None): #super(Intrinsic, self).__init__() self.kind = kind class Integer(Intrinsic): def __str__(self): return "integer" class Real(Intrinsic): def __str__(self): return "real" class Complex(Intrinsic): def __repr__(self): return "Complex()" class String(Intrinsic): def __repr__(self): return "String()" class Logical(Intrinsic): def __repr__(self): return "Logical()" class Derived(Type): def __repr__(self): return "Derived()" class Array(Type): __slots__ = ["type", "ndim", "atype", "bounds"] class Arg: __slots__ = ["name", "intent", "type", "symtab", "symidx"] def get_decl(self): s = "%s, intent(%s) :: %s" % (self.type, self.intent, self.name) return s def tofortran_arg(self): return ast.arg(self.name) def tofortran_bound(self, b): if isinstance(b, gp.Integer): if b.i == 1: return "" else: return str(b.i) elif isinstance(b, gp.VarIdx): return self.symtab[b.idx].name print(b) raise NotImplementedError("Unsupported bound type") # TODO: generate ASR in these functions. The ASR will then get converted # to AST and to Fortran code. This will simplify all the declaration code # below, which is implicit in the ASR's symbol table. def tofortran_decl(self): attrs = [ ast.Attribute(name="intent", args=[ast.attribute_arg(arg=self.intent)]), ] if isinstance(self.type, Array): stype = str(self.type.type) args = [] for i in range(self.type.ndim): if self.type.atype == "explicit_shape": s = self.tofortran_bound(self.type.bounds[i][0]) if s != "": s += ":" s += self.tofortran_bound(self.type.bounds[i][1]) args.append(s) elif self.type.atype == "assumed_shape": s = self.tofortran_bound(self.type.bounds[i][0]) s += ":" args.append(s) else: assert False args = [ast.attribute_arg(arg=x) for x in args] attrs.append(ast.Attribute(name="dimension", args=args)) else: stype = str(self.type) decl = ast.decl(sym=self.name, sym_type=stype, dims=[], attrs=attrs) return ast.Declaration(vars=[decl], lineno=1, col_offset=1) def tofortran_cdecl(self): attrs = [ ast.Attribute(name="intent", args=[ast.attribute_arg(arg=self.intent)]), ] if isinstance(self.type, Array): args = [] if self.type.atype == "assumed_shape": if self.type.ndim == 1: stype = "type(c_desc1_t)" elif self.type.ndim == 2: stype = "type(c_desc2_t)" else: raise NotImplementedError("Assumed shape dim") else: stype = str(self.type.type) for i in range(self.type.ndim): if self.type.atype == "explicit_shape": s = self.tofortran_bound(self.type.bounds[i][0]) if s != "": s += ":" s += self.tofortran_bound(self.type.bounds[i][1]) args.append(s) else: assert False args = [ast.attribute_arg(arg=x) for x in args] attrs.append(ast.Attribute(name="dimension", args=args)) else: stype = str(self.type) decl = ast.decl(sym=self.name, sym_type=stype, dims=[], attrs=attrs) return ast.Declaration(vars=[decl], lineno=1, col_offset=1) class Function: __slots__ = ["name", "args", "return_type", "mangled_name"] def tofortran_impl(self): args = [x.tofortran_arg() for x in self.args] args_decl = [x.tofortran_decl() for x in self.args] iface_decl = [ ast.Interface2(name="x", procs=[self.tofortran_iface()], lineno=1, col_offset=1) ] return_var = ast.Name(id="r", lineno=1, col_offset=1) cname = self.name + "_c_wrapper" cargs = [] for x in self.args: a = ast.Name(id=x.name, lineno=1, col_offset=1) if isinstance(x.type, Array) and x.type.atype == "assumed_shape": cargs.append( ast.FuncCallOrArray( func="c_desc", args=[a], keywords=[], lineno=1, col_offset=1 ) ) else: cargs.append(a) body = [ ast.Assignment( target=return_var, value=ast.FuncCallOrArray( func=cname, args=cargs, keywords=[], lineno=1, col_offset=1 ), lineno=1, col_offset=1 ) ] return ast.Function(name=self.name, args=args, return_type=str(self.return_type), return_var=return_var, bind=None, use=[], decl=args_decl+iface_decl, body=body, contains=[], lineno=1, col_offset=1) def tofortran_iface(self): args = [x.tofortran_arg() for x in self.args] args_decl = [x.tofortran_cdecl() for x in self.args] use = [ ast.Use(module="gfort_interop", symbols=[ ast.UseSymbol(sym="c_desc1_t", rename=None), ast.UseSymbol(sym="c_desc2_t", rename=None), ], lineno=1, col_offset=1) ] cname = self.name + "_c_wrapper" bind_args = [ast.keyword(arg=None, value=ast.Name(id="c", lineno=1, col_offset=1)), ast.keyword(arg="name", value=ast.Str(s=self.mangled_name, lineno=1, col_offset=1))] bind = ast.Bind(args=bind_args) return ast.Function(name=cname, args=args, return_type=str(self.return_type), return_var=None, bind=bind, use=use, decl=args_decl, body=[], contains=[], lineno=1, col_offset=1) class Module: __slots__ = ["name", "contains"] def tofortran(self): contains = [x.tofortran_impl() for x in self.contains] use = [ ast.Use(module="gfort_interop", symbols=[ ast.UseSymbol(sym="c_desc", rename=None), ], lineno=1, col_offset=1) ] return ast.Module(name=self.name, use=use, decl=[], contains=contains) def convert_arg(table, idx): arg = table[idx] a = Arg() assert isinstance(arg.name, str) a.name = arg.name assert isinstance(arg.intent, str) a.intent = arg.intent assert isinstance(table, dict) a.symtab = table assert isinstance(idx, int) a.symidx = idx assert isinstance(arg.type, str) type_ = arg.type if arg.bounds: ar = Array() ar.type = type_ ar.ndim = len(arg.bounds) if arg.bounds[0][1] is None: ar.atype = "assumed_shape" else: ar.atype = "explicit_shape" ar.bounds = arg.bounds a.type = ar else: a.type = type_ return a def convert_function(table, f): assert isinstance(f, gp.Procedure) fn = Function() assert isinstance(f.name, str) fn.name = f.name assert isinstance(f.type, str) fn.return_type = f.type fn.mangled_name = '__' + f.mod + '_MOD_' + f.name.lower() args = [] for arg in f.args: assert isinstance(arg, gp.VarIdx) args.append(convert_arg(table, arg.idx)) fn.args = args return fn def convert_module(table, public_symbols): m = Module() contains = [] module_name = None for sym in public_symbols: s = table[sym.idx.idx] if isinstance(s, gp.Module): # Skip modules if they are listed in public symbols continue assert isinstance(s, gp.Procedure) if module_name: assert module_name == s.mod else: module_name = s.mod contains.append(convert_function(table, s)) m.name = module_name m.contains = contains return m version, orig_file, table, public_symbols = gp.load_module("mod1.mod") m = convert_module(table, public_symbols) a = m.tofortran() a.name = "mod2" s = ast_to_src(a) print(s) lfortran-0.63.0/integration_tests/interop/CMakeLists.txt0000664000175000017500000000246515174404631023614 0ustar alastairalastaircmake_minimum_required(VERSION 3.5 FATAL_ERROR) project(interop C CXX Fortran) if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type (Debug, Release)" FORCE) endif () enable_testing() add_library(mod1 mod1.f90) add_executable(test_mod1 test_mod1.f90) target_link_libraries(test_mod1 mod1) add_test(test_mod1 ${CURRENT_BINARY_DIR}/test_mod1) add_executable(test_cpp test_cpp.cpp) target_link_libraries(test_cpp mod1) target_include_directories(test_cpp BEFORE PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../src) add_test(test_cpp ${CURRENT_BINARY_DIR}/test_cpp) add_executable(test_fortran test_fortran.f90 gfort_interop.f90) target_link_libraries(test_fortran mod1) add_test(test_fortran ${CURRENT_BINARY_DIR}/test_fortran) message("\n") message("Configuration results") message("---------------------") message("Fortran compiler: ${CMAKE_Fortran_COMPILER}") message("C++ compiler : ${CMAKE_CXX_COMPILER}") message("C compiler : ${CMAKE_C_COMPILER}") message("Build type: ${CMAKE_BUILD_TYPE}") string(TOUPPER "${CMAKE_BUILD_TYPE}" BTYPE) message("Fortran compiler flags: ${CMAKE_Fortran_FLAGS_${BTYPE}}") message("C++ compiler flags : ${CMAKE_CXX_FLAGS_${BTYPE}}") message("C compiler flags : ${CMAKE_C_FLAGS_${BTYPE}}") message("Installation prefix: ${CMAKE_INSTALL_PREFIX}") lfortran-0.63.0/integration_tests/interop/wrap2.py0000664000175000017500000001455615174404631022465 0ustar alastairalastair""" # Design This file converts from a GFortran module file representation (documented in the `lfortran.adapters.gfortran.mod` module) to an Abstract Semantic Representation (ASR). """ # TODO: move this into the lfortran package itself import sys sys.path.append("../..") from lfortran.asr import asr from lfortran.asr.asr_check import verify_asr from lfortran.asr.asr_to_ast import asr_to_ast from lfortran.ast.ast_to_src import ast_to_src from lfortran.adapters.gfortran.mod import mod_to_asr from lfortran.asr.builder import (make_translation_unit, translation_unit_make_module, scope_add_function, make_type_integer, make_type_real, type_eq, make_binop, scope_add_symbol, Scope, function_make_var, array_is_assumed_shape) class NodeTransformer(asr.NodeTransformerBase): def visit_scope(self, symtab, parent=None): new_symtab = Scope(parent) self._lookup = 2 self._scope = new_symtab for s, sym in symtab.symbols.items(): new_symtab.symbols[s] = self.visit(sym) self._lookup = 0 return new_symtab def visit_sequence(self, seq): r = [] if seq is not None: for node in seq: r.append(self.visit(node)) return r def visit_object(self, o): if isinstance(o, Scope): return self.visit_scope(o) elif isinstance(o, list): return self.visit_sequence(o) elif isinstance(o, (str, int)) or o is None: return o else: print(type(o)) raise NotImplementedError() def visit_Function(self, node): name = self.visit_object(node.name) symtab = self.visit_object(node.symtab) self._lookup = 1 self._scope = symtab args = self.visit_sequence(node.args) body = self.visit_sequence(node.body) return_var = self.visit(node.return_var) self._lookup = 0 if node.bind: bind = self.visit(node.bind) else: bind = None return asr.Function(name=name, args=args, body=body, bind=bind, return_var=return_var, symtab=symtab) def visit_VariableOld(self, node): if self._lookup == 1: return self._scope.resolve(node.name) elif self._lookup == 2: v = self._scope.resolve(node.name, raise_exception=False) if v: return v name = self.visit_object(node.name) intent = self.visit_object(node.intent) dummy = self.visit_object(node.dummy) type = self.visit(node.type) return asr.VariableOld(name=name, intent=intent, dummy=dummy, type=type) class WrapperVisitor(NodeTransformer): def visit_Module(self, node): name = "mod2" #node.name + "_wrapper" self._modname = node.name symtab = self.visit_scope(node.symtab) return asr.Module(name=name, symtab=symtab) def visit_Function(self, node): name = self.visit_object(node.name) symtab = self.visit_object(node.symtab) self._lookup = 1 self._scope = symtab args = self.visit_sequence(node.args) body = self.visit_sequence(node.body) self._lookup = 0 if node.bind: bind = self.visit(node.bind) else: bind = None tmp = asr.VariableOld(name="a", type=make_type_integer()) f = asr.Function(name=name, args=args, body=body, bind=bind, symtab=symtab, return_var=tmp) return_var = function_make_var(f, name="r", type=self.visit(node.return_var.type)) return_var.dummy = True f.return_var = return_var cname = node.name + "_c_wrapper" mangled_name = '__' + self._modname + '_MOD_' + node.name.lower() bind = asr.Bind(lang="c", name=mangled_name) cargs = [] args2 = [] type1 = make_type_integer() type1.dims = [asr.dimension(asr.Num(n=1, type=make_type_integer()))] type2 = make_type_integer() type2.dims = [ asr.dimension(asr.Num(n=1, type=make_type_integer())), asr.dimension(asr.Num(n=1, type=make_type_integer())) ] c_desc1 = scope_add_function( symtab, "c_desc1_int32", args=[ asr.VariableOld( name="A", intent="in", type=type1 ) ], return_var=asr.VariableOld( name="c_desc1_int32", type=asr.Derived(name="c_desc1_t") ), module = "gfort_interop" ) c_desc2 = scope_add_function( symtab, "c_desc2_int32", args=[ asr.VariableOld( name="A", intent="in", type=type2 ) ], return_var=asr.VariableOld( name="c_desc2_int32", type=asr.Derived(name="c_desc2_t") ), module = "gfort_interop" ) for arg in node.args: type = self.visit(arg.type) if array_is_assumed_shape(type): if len(type.dims) == 1: dname = "c_desc1_t" fname = c_desc1 elif len(type.dims) == 2: dname = "c_desc2_t" fname = c_desc2 else: raise NotImplementedError("Too many dimensions") type = asr.Derived(name=dname, module="gfort_interop") args2.append(asr.FuncCall(func=fname, args=[arg], keywords=[], type=type)) else: args2.append(arg) cargs.append(asr.VariableOld( name=arg.name, intent=arg.intent, type=type, )) fw = scope_add_function(symtab, cname, args=cargs, return_var=cname) fw.bind = bind body = [ asr.Assignment(return_var, asr.FuncCall(func=fw, args=args2, keywords=[], type=fw.return_var.type) ) ] f.body = body return f def create_wrapper(u): v = WrapperVisitor() u2 = v.visit(u) verify_asr(u2) return u2 u = mod_to_asr("mod1.mod") a = asr_to_ast(u) s = ast_to_src(a) #print(s) u2 = create_wrapper(u) a = asr_to_ast(u2) s = ast_to_src(a) #print("-"*80) print(s) lfortran-0.63.0/integration_tests/realloc_lhs_19.f900000664000175000017500000000050315174404631022503 0ustar alastairalastairprogram realloc_lhs_19 implicit none integer, allocatable :: nz(:), result(:) nz = [480, 120, 1] allocate(result(1)) where (nz > 1) result = maxval(nz) end where if (size(result) /= 1) error stop if (result(1) /= 480) error stop print *, result(1) end program realloc_lhs_19 lfortran-0.63.0/integration_tests/gpu_metal_134.f900000664000175000017500000000107415174404631022253 0ustar alastairalastairprogram gpu_metal_134 ! Test: submodule function called inside do concurrent with --gpu=metal. ! Verifies that the Metal shader correctly inlines the submodule function ! body instead of generating an empty function. use gpu_metal_134_m implicit none real :: x(4), y(4) integer :: i x = [-1.0, 2.0, -3.0, 4.0] y = 0.0 do concurrent (i = 1:4) y(i) = relu(x(i)) end do print *, y(1), y(2), y(3), y(4) if (abs(y(1) - 0.0) > 1e-6) error stop if (abs(y(2) - 2.0) > 1e-6) error stop if (abs(y(3) - 0.0) > 1e-6) error stop if (abs(y(4) - 4.0) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/procedure_19.f900000664000175000017500000000154015174404631022206 0ustar alastairalastairmodule mod1_procedure_19 type :: my_type real :: value = 0.0 contains procedure :: plus generic :: g_proc => plus end type my_type contains subroutine plus(self, increment) class(my_type), intent(inout) :: self real, intent(in) :: increment self%value = self%value + increment end subroutine plus end module mod1_procedure_19 module mod2_procedure_19 use mod1_procedure_19 end module mod2_procedure_19 program procedure_19 use mod2_procedure_19 type(my_type) :: obj real :: test_increment = 5.0 call obj%g_proc(test_increment) print *, 'After adding', test_increment, ':', obj%value if (abs(obj%value - 5.0) > 1.0e-6) error stop call obj%g_proc(3.0) print *, 'After adding 3.0:', obj%value if (abs(obj%value - 8.0) > 1.0e-6) error stop end program procedure_19 lfortran-0.63.0/integration_tests/namelist_19.f900000664000175000017500000000064215174404631022034 0ustar alastairalastairprogram test_namelist_internal_derived implicit none type :: point integer :: x=0 integer :: y=0 end type point type(point) :: dot character(len=:), allocatable :: record namelist /nml_dot/ dot record = '&nml_dot dot%x=1, dot%y=2 /' read(record, nml=nml_dot) if (dot%x /= 1) error stop if (dot%y /= 2) error stop end program test_namelist_internal_derived lfortran-0.63.0/integration_tests/associate_08.f900000664000175000017500000000217615174404631022175 0ustar alastairalastairmodule associate_08_module_1 implicit none type t_1 integer :: i end type t_1 type t_2 type(t_1), pointer :: type_2(:) end type t_2 contains subroutine sub_1(type_1, i) class(t_2), intent(inout) :: type_1 integer, intent(in) :: i allocate(type_1%type_2(1)) associate(target=>type_1%type_2(1)%i) target = i end associate end subroutine sub_1 subroutine sub_2(progress) class(t_2), intent(inout), allocatable :: progress(:) allocate(progress(1)) allocate(progress(1)%type_2(1)) associate(target => progress(1)) target%type_2(1)%i = 345 end associate end subroutine sub_2 end module program associate2 use associate_08_module_1 implicit none type(t_2) :: type_1 class(t_2), allocatable :: t_2_array(:) call sub_1(type_1, 123) if (type_1%type_2(1)%i /= 123) error stop print *, type_1%type_2(1)%i deallocate(type_1%type_2) ! TODO: Fix when implementing class arrays ! call sub_2(t_2_array) ! print *, t_2_array(1)%type_2(1)%i end program associate2 lfortran-0.63.0/integration_tests/gpu_metal_06.f900000664000175000017500000000067415174404631022176 0ustar alastairalastairprogram gpu_metal_06 ! Non-parameter (runtime) loop bounds implicit none integer :: n real :: x(1000), y(1000), y_expected(1000) integer :: i n = 500 do i = 1, 1000 x(i) = real(i) y(i) = 0.0 y_expected(i) = 0.0 end do do i = 1, n y_expected(i) = x(i) * 2.0 end do do concurrent (i = 1:n) y(i) = x(i) * 2.0 end do do i = 1, 1000 if (abs(y(i) - y_expected(i)) > 1.0e-5) error stop end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/pdt_16.f900000664000175000017500000000140215174404631020777 0ustar alastairalastairprogram pdt_16 ! Test PDT structure constructor with default kind parameter. ! Both keyword and positional argument forms must work. implicit none integer, parameter :: sp = kind(1.) type :: operands_t(k) integer, kind :: k = sp real(k) :: actual, expected end type type(operands_t) :: op1, op2 ! Keyword arguments (kind parameter uses default) op1 = operands_t(actual=1.0, expected=2.0) if (abs(op1%actual - 1.0) > 1e-6) error stop if (abs(op1%expected - 2.0) > 1e-6) error stop ! Positional arguments (kind parameter given explicitly) op2 = operands_t(4, 3.0, 4.0) if (abs(op2%actual - 3.0) > 1e-6) error stop if (abs(op2%expected - 4.0) > 1e-6) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/derived_types_118.f900000664000175000017500000000405115174404631023144 0ustar alastairalastairmodule derived_types_118_mod1 implicit none type :: SomeType integer :: id real(8) :: value end type SomeType end module derived_types_118_mod1 module derived_types_118_mod2 use derived_types_118_mod1 implicit none type, abstract :: BaseType integer :: base_id end type BaseType type, abstract, extends(BaseType) :: Extended1Type class(SomeType), allocatable :: objs(:) end type Extended1Type type, extends(Extended1Type) :: Extended2Type integer :: extra_data end type Extended2Type interface Extended2Type procedure :: constructor end interface Extended2Type contains function constructor(objs) result(self) type(Extended2Type) :: self class(SomeType), intent(in) :: objs(:) self%base_id = 100 self%extra_data = 999 allocate(self%objs, source=objs) end function constructor end module derived_types_118_mod2 program derived_types_118 use derived_types_118_mod2 implicit none type(SomeType) :: input(3) type(Extended2Type) :: obj integer :: i do i = 1, 3 input(i)%id = i input(i)%value = 10.0d0 * i end do obj = Extended2Type(input) ! 1. Check inherited base member if (obj%base_id /= 100) then error stop "Base member not initialized correctly" end if ! 2. Check own member if (obj%extra_data /= 999) then error stop "Extended member not initialized correctly" end if ! 3. Check allocation if (.not. allocated(obj%objs)) then error stop "objs not allocated" end if ! 4. Check size if (size(obj%objs) /= 3) then error stop "objs size incorrect" end if ! 5. Check values copied correctly do i = 1, 3 if (obj%objs(i)%id /= i) then error stop "ID not copied correctly" end if if (abs(obj%objs(i)%value - 10.0d0*i) > 1.0d-12) then error stop "Value not copied correctly" end if end do print *, "All inheritance + constructor tests passed." end program derived_types_118lfortran-0.63.0/integration_tests/arrays_op_7.f900000664000175000017500000000034515174404631022134 0ustar alastairalastairprogram arrays_op_7 implicit none integer :: x(3), y(3) x = 3 call f(x, y) print *, y contains subroutine f(x, y) integer, intent(in) :: x(:) integer, intent(out) :: y(:) y = x end subroutine end program lfortran-0.63.0/integration_tests/allocate_38.f900000664000175000017500000000064715174404631022012 0ustar alastairalastairprogram allocate_38 implicit none character(len=:), allocatable :: a(:) a = sg() if (a(1) /= "hello" .or. a(2) /= "world") error stop "sg() returned wrong values" contains function sg() result(res) character(len=:), allocatable :: res(:) character(len=5), parameter :: unnamed(2) = ["hello", "world"] allocate(res, source=unnamed) end function sg end program allocate_38 lfortran-0.63.0/integration_tests/intrinsics_433.f900000664000175000017500000000036615174404631022470 0ustar alastairalastairprogram demo_match implicit none integer, parameter :: maxarg = 32 character(len=maxarg-1) :: argument call get_command_argument(0, argument) print *, len(argument) if (len(argument) /= 31) error stop end program demo_match lfortran-0.63.0/integration_tests/cycle_and_exit6.f900000664000175000017500000000033315174404631022744 0ustar alastairalastairprogram cycles_stuck implicit none integer :: iiter, maxit maxit = 5 do iiter = 1, maxit if ( .true. ) then cycle print *, "inside loop" end if end do print *, "End of program." end lfortran-0.63.0/integration_tests/openmp_55.f900000664000175000017500000000073615174404631021522 0ustar alastairalastair program openmp_55 use omp_lib implicit none integer :: i,n=10,counter call omp_set_num_threads(8) counter=0 !$OMP PARALLEL !$OMP MASTER do i = 1, n !$OMP TASK shared(counter) !$OMP ATOMIC counter=counter+1 print *, "Task Done by TID:-",omp_get_thread_num() !$OMP END TASK end do !$OMP END MASTER !$OMP END PARALLEL if(counter/=10) error stop end program openmp_55 lfortran-0.63.0/integration_tests/intrinsics_60.f900000664000175000017500000000063215174404631022400 0ustar alastairalastairprogram intrinsics_60 character :: c, d, e, f open(11, file="intrinsics_60_data.txt", form="formatted", access="stream", status="old") read(11, *) c, d, e, f print *, c, d, e, f print *, iachar(c), iachar(d), iachar(e), iachar(f) if (iachar(c) /= 97) error stop if (iachar(d) /= 90) error stop if (iachar(e) /= 195) error stop if (iachar(f) /= 194) error stop end program lfortran-0.63.0/integration_tests/intrinsics_209.f900000664000175000017500000002025115174404631022464 0ustar alastairalastairprogram intrinsics_209 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(sp) :: q,y,z real(dp) :: k,l,m real(dp) :: w(19) real(dp) :: large(38) real(sp) :: x(19) real(dp) :: expected_w(19) real(sp) :: expected_x(19) real(dp) :: expected_large(38) real(dp), parameter :: comp(38) = atand([988.522977022977_dp, 989.021978021978_dp, 989.520979020979_dp, & 990.01998001998_dp , 990.518981018981_dp, 991.017982017982_dp, 991.516983016983_dp, 992.015984015984_dp, & 992.514985014985_dp, 993.013986013986_dp, 993.512987012987_dp, 994.011988011988_dp, & 994.510989010989_dp, 995.00999000999_dp, 995.508991008991_dp, 996.007992007992_dp, & 996.506993006993_dp, 997.005994005994_dp, 997.504995004995_dp, & -988.522977022977_dp, -989.021978021978_dp, -989.520979020979_dp, -990.01998001998_dp , & -990.518981018981_dp, -991.017982017982_dp, -991.516983016983_dp, -992.015984015984_dp, & -992.514985014985_dp, -993.013986013986_dp, -993.512987012987_dp, -994.011988011988_dp, & -994.510989010989_dp, -995.00999000999_dp, -995.508991008991_dp, -996.007992007992_dp, & -996.506993006993_dp, -997.005994005994_dp, -997.504995004995_dp]) real(dp), parameter :: res(19) = atand([0.321_dp, 0.526_dp, 0.728_dp, -0.321_dp, -0.526_dp, -0.728_dp, & -1.0_dp, -0.9995004995004995_dp, -0.999000999000999_dp, & -0.9985014985014985_dp, -0.998001998001998_dp, -0.9975024975024975_dp, & -0.997002997002997_dp, -0.9965034965034965_dp, -0.996003996003996_dp, & -0.9955044955044955_dp, -0.995004995004995_dp, -0.9945054945054945_dp, & -0.994005994005994_dp]) real(sp), parameter :: res_x(19) = atand([0.321_sp, 0.526_sp, 0.728_sp, -0.321_sp, -0.526_sp, -0.728_sp, & -1.0_sp, -0.999_sp, -0.999_sp, -0.998_sp, -0.998_sp, -0.997_sp, & -0.997_sp, -0.996_sp, -0.996_sp, -0.995_sp, -0.995_sp, -0.994_sp, -0.994_sp]) w = [0.321_dp, 0.526_dp, 0.728_dp, -0.321_dp, -0.526_dp, -0.728_dp, & -1.0_dp, -0.9995004995004995_dp, -0.999000999000999_dp, & -0.9985014985014985_dp, -0.998001998001998_dp, -0.9975024975024975_dp, & -0.997002997002997_dp, -0.9965034965034965_dp, -0.996003996003996_dp, & -0.9955044955044955_dp, -0.995004995004995_dp, -0.9945054945054945_dp, & -0.994005994005994_dp] x = [0.321_sp, 0.526_sp, 0.728_sp, -0.321_sp, -0.526_sp, -0.728_sp, & -1.0_sp, -0.999_sp, -0.999_sp, -0.998_sp, -0.998_sp, -0.997_sp, & -0.997_sp, -0.996_sp, -0.996_sp, -0.995_sp, -0.995_sp, -0.994_sp, -0.994_sp] large = [988.522977022977_dp, 989.021978021978_dp, 989.520979020979_dp ,990.01998001998_dp , & 990.518981018981_dp, 991.017982017982_dp, 991.516983016983_dp, 992.015984015984_dp, & 992.514985014985_dp, 993.013986013986_dp, 993.512987012987_dp, 994.011988011988_dp, & 994.510989010989_dp, 995.00999000999_dp, 995.508991008991_dp, 996.007992007992_dp, & 996.506993006993_dp, 997.005994005994_dp, 997.504995004995_dp, & -988.522977022977_dp, -989.021978021978_dp, -989.520979020979_dp, -990.01998001998_dp , & -990.518981018981_dp, -991.017982017982_dp, -991.516983016983_dp, -992.015984015984_dp, & -992.514985014985_dp, -993.013986013986_dp, -993.512987012987_dp, -994.011988011988_dp, & -994.510989010989_dp, -995.00999000999_dp, -995.508991008991_dp, -996.007992007992_dp, & -996.506993006993_dp, -997.005994005994_dp, -997.504995004995_dp] expected_w = [17.796630203668819_dp, 27.744370169482565_dp, 36.054618166461040_dp, & -17.796630203668819_dp, -27.744370169482565_dp, -36.054618166461040_dp, & -45.000000000000000_dp, -44.985686790326952_dp, -44.971366429413692_dp, & -44.957038913689956_dp, -44.942704239585503_dp, -44.928362403530095_dp, & -44.914013401953525_dp, -44.899657231285609_dp, -44.885293887956209_dp, & -44.870923368395196_dp, -44.856545669032499_dp, -44.842160786298116_dp, & -44.827768716622060_dp] expected_x = [17.7966309_sp, 27.7443714_sp, 36.0546188_sp, -17.7966309_sp, & -27.7443714_sp, -36.0546188_sp, -45.0000000_sp, -44.9713364_sp, -44.9713364_sp, & -44.9426460_sp, -44.9426460_sp, -44.9139252_sp, -44.9139252_sp, -44.8851776_sp, & -44.8851776_sp, -44.8564034_sp, -44.8564034_sp, -44.8275948_sp, -44.8275948_sp] expected_large = [89.942039020538502_dp, 89.942068264142364_dp, 89.942097478252023_dp, 89.942126662912045_dp, & 89.942155818166967_dp, 89.942184944061196_dp, 89.942214040639058_dp, 89.942243107944805_dp, & 89.942272146022574_dp, 89.942301154916436_dp, 89.942330134670371_dp, 89.942359085328249_dp, & 89.942388006933868_dp, 89.942416899530954_dp, 89.942445763163107_dp, 89.942474597873883_dp, & 89.942503403706695_dp, 89.942532180704944_dp, 89.942560928911888_dp, & -89.942039020538502_dp, -89.942068264142364_dp, -89.942097478252023_dp, -89.942126662912045_dp, & -89.942155818166967_dp, -89.942184944061196_dp, -89.942214040639058_dp, -89.942243107944805_dp, & -89.942272146022574_dp, -89.942301154916436_dp, -89.942330134670371_dp, -89.942359085328249_dp, & -89.942388006933868_dp, -89.942416899530954_dp, -89.942445763163107_dp, -89.942474597873883_dp, & -89.942503403706695_dp, -89.942532180704944_dp, -89.942560928911888_dp] do i = 1, size(res) print *, res(i) if (abs(res(i) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(w) print *, atand(w(i)) if (abs(atand(w(i)) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(x) print *, atand(x(i)) if (abs(atand(x(i)) - expected_x(i)) > 1e-5_sp) error stop end do do i = 1, size(res_x) print *, res_x(i) if (abs(res_x(i) - expected_x(i)) > 1e-5_sp) error stop end do do i = 1, size(large) print *, atand(large(i)) if (abs(atand(large(i)) - expected_large(i)) > 1e-12_dp) error stop end do do i = 1, size(comp) print *, comp(i) if (abs(comp(i) - expected_large(i)) > 1e-5_sp) error stop end do q = 0.123 y = 0.876 z = 0.542 k = 0.1237382_dp l = 0.8767382_dp m = 0.5427382_dp print *, atand(q) if (atand(q) - 7.01215982_sp > 1e-5) error stop print *, atand(y) if (atand(y) - 41.2183571_sp > 1e-5) error stop print *, atand(z) if (atand(z) - 28.4576912_sp > 1e-5) error stop print *, atand(0.123_sp) if (atand(0.123_sp) - 7.01216030_sp > 1e-5) error stop print *, atand(0.876_sp) if (atand(0.876_sp) - 41.2183571_sp > 1e-5) error stop print *, atand(0.542_sp) if (atand(0.542_sp) - 28.4576931_sp > 1e-5) error stop print *, atand(k) if (atand(k) - 7.0538217578390441_dp > 1e-12) error stop print *, atand(l) if (atand(l) - 41.242282419755384_dp > 1e-12) error stop print *, atand(m) if (atand(m) - 28.490374622093171_dp > 1e-12) error stop print *, atand(0.1237382_dp) if (atand(0.1237382_dp) - 7.0538217578390441_dp > 1e-12) error stop print *, atand(0.8767382_dp) if (atand(0.8767382_dp) - 41.242282419755391_dp > 1e-12) error stop print *, atand(0.5427382_dp) if (atand(0.5427382_dp) - 528.490374622093171_dp > 1e-12) error stop q = -0.123 y = -0.876 z = -0.542 k = -0.1237382_dp l = -0.8767382_dp m = -0.5427382_dp print *, atand(q) if (atand(q) - (-7.01215982_sp) > 1e-5) error stop print *, atand(y) if (atand(y) - (-41.2183571_sp) > 1e-5) error stop print *, atand(z) if (atand(z) - (-28.4576912_sp) > 1e-5) error stop print *, atand(-0.123_sp) if (atand(-0.123_sp) - (-7.01216030_sp) > 1e-5) error stop print *, atand(-0.876_sp) if (atand(-0.876_sp) - (-41.2183571_sp) > 1e-5) error stop print *, atand(-0.542_sp) if (atand(-0.542_sp) - (-28.4576931_sp) > 1e-5) error stop print *, atand(k) if (atand(k) - (-7.0538217578390441_sp) > 1e-12) error stop print *, atand(l) if (atand(l) - (-41.242282419755384_dp) > 1e-12) error stop print *, atand(m) if (atand(m) - (-28.490374622093171_dp) > 1e-12) error stop end program lfortran-0.63.0/integration_tests/array_section_09.f900000664000175000017500000000314415174404631023061 0ustar alastairalastair! Test ILP64 array section with assumed-size arrays ! This tests that array section operations work correctly when ! -fdefault-integer-8 is used (ILP64 mode) program array_section_ilp64 implicit none integer, parameter :: n = 4 real :: a(n, n) integer :: i, j do j = 1, n do i = 1, n a(i, j) = real(i + j * 10) end do end do call test_section(a, n, 2, 3) contains subroutine test_section(a, lda, ilo, ihi) integer, intent(in) :: lda, ilo, ihi real, intent(inout) :: a(lda, *) real :: sum_val integer :: i, j sum_val = 0.0 do j = ilo, ihi do i = ilo, ihi sum_val = sum_val + a(i, j) end do end do ! Expected: a(2,2) + a(3,2) + a(2,3) + a(3,3) ! = 22 + 23 + 32 + 33 = 110 if (abs(sum_val - 110.0) > 0.001) error stop ! Test array section passed to subroutine call modify_section(a(ilo:ihi, ilo:ihi), ihi - ilo + 1) ! Verify modification: each element should be multiplied by 2 sum_val = 0.0 do j = ilo, ihi do i = ilo, ihi sum_val = sum_val + a(i, j) end do end do ! Expected: 110 * 2 = 220 if (abs(sum_val - 220.0) > 0.001) error stop end subroutine subroutine modify_section(b, n) integer, intent(in) :: n real, intent(inout) :: b(n, n) integer :: i, j do j = 1, n do i = 1, n b(i, j) = b(i, j) * 2.0 end do end do end subroutine end program lfortran-0.63.0/integration_tests/intrinsics_94.f900000664000175000017500000000063215174404631022407 0ustar alastairalastairprogram intrinsics_94 real :: x,y real(kind=8) :: a, b x = 3.0 y = 4.0 print *, hypot(x,y) if (abs(hypot(x,y) - 5.0) > 1e-6) error stop print *, hypot(3.0D0, 4.0D0) if (abs(hypot(3.0D0, 4.0D0) - 5.0D0) > 1e-9) error stop a = 12.0D0 b = 5.0D0 print *, hypot(a,b) if (abs(hypot(a,b) - 13.0D0) > 1e-9) error stop print *, hypot(12.0D0, 5.0D0) if (abs(hypot(12.0D0, 5.0D0) - 13.0D0) > 1e-9) error stop end program lfortran-0.63.0/integration_tests/file_50.f900000664000175000017500000000212515174404631021130 0ustar alastairalastairprogram file_50 implicit none integer, parameter :: unit_no = 24 character(*), parameter :: fn = 'file_50_test.bin' integer :: ioerr, iorl integer :: i, i1 logical :: l, pf character(5) :: s real :: r complex :: c complex, parameter :: cval = (12.34, 56.78) integer, parameter :: wr_order(10) = & [ 5, 3, 6, 2, 8, 1, 9, 7, 10, 4 ] open (unit_no, file=fn, status='old', iostat=ioerr) if (ioerr == 0) then close (unit_no, status='delete') end if inquire (iolength=iorl) l, s, i, r, c if (iorl /= 25) error stop open (unit_no, file=fn, access='direct', recl=iorl) do i=1, 10 i1 = wr_order(i) l = mod(i1, 2) == 0 write (unit_no, rec=i1) l, '12345', i1, i1 + 0.5, cval end do do i=1, 10 l = .false.; s = 'uini'; i1 = -42; r = -42.42 read (unit_no, rec=i) l, s, i1, r, c pf = (l .eqv. mod(i, 2) == 0) .and. & (s == '12345') .and. & (i == i1) .and. & (abs(r - (i + 0.5)) < 0.0001) .and. & (c == cval) if (.not. pf) error stop end do close (unit_no, status='delete') end program file_50 lfortran-0.63.0/integration_tests/equivalence_10.f900000664000175000017500000000036015174404631022505 0ustar alastairalastairprogram equivalence_10 REAL A, A1 DIMENSION A(26,4), A1(26,4) EQUIVALENCE (A(1,1),A1(1,1)) DATA A1(1,1) /42.0/ if (any(shape(A1) /= [26,4])) error stop if (A(1,1) /= 42.0 .or. A1(1,1) /= 42.0) error stop end program lfortran-0.63.0/integration_tests/arrays_01_multi_dim.f900000664000175000017500000000131015174404631023544 0ustar alastairalastairprogram arrays_01_multi_dim implicit none integer, parameter :: no_of_height = 3 integer, parameter :: no_of_row = 2 integer, parameter :: no_of_col = 3 integer :: arr(no_of_height, no_of_row, no_of_col) integer :: height integer :: row integer :: col do height = 1, no_of_height do row = 1, no_of_row do col = 1, no_of_col arr(height, row, col) = height * row * col end do end do end do do height = 1, no_of_height write(*,*) "height =", height do row = 1, no_of_row do col = 1, no_of_col write(*,*) arr(height, row, col) end do end do end do end program arrays_01_multi_dim lfortran-0.63.0/integration_tests/interface_32.f900000664000175000017500000000107015174404631022147 0ustar alastairalastairmodule interface_32_clientmod use interface_32_mymod use interface_32_wrappermod, only: WrapperType contains function init() result(wrap) type(WrapperType) :: wrap type(MyType) :: obj obj = MyType() wrap = WrapperType(obj) end function init end module interface_32_clientmod program interface_32 use interface_32_mymod use interface_32_wrappermod use interface_32_clientmod implicit none type(WrapperType) :: w w = init() if (w%obj%val /= 42) error stop print *, "PASS" end program interface_32 lfortran-0.63.0/integration_tests/pure_side_effects_03.f900000664000175000017500000000153015174404631023664 0ustar alastairalastairpure subroutine test_sp(a, b) implicit none complex, intent(in) :: a real, intent(out) :: b complex :: t real :: abssq abssq(t) = real(t)**2 + aimag(t)**2 b = abssq(a) end subroutine test_sp pure subroutine test_dp(a, b) implicit none complex(8), intent(in) :: a real(8), intent(out) :: b complex(8) :: t real(8) :: abssq abssq(t) = real(t, kind=8)**2 + aimag(t)**2 b = abssq(a) end subroutine test_dp program pure_side_effects_03 implicit none complex :: a_sp real :: b_sp complex(8) :: a_dp real(8) :: b_dp a_sp = (3.0, 4.0) call test_sp(a_sp, b_sp) if (abs(b_sp - 25.0) > 1e-6) error stop a_dp = (3.0d0, 4.0d0) call test_dp(a_dp, b_dp) if (abs(b_dp - 25.0d0) > 1d-12) error stop print *, b_sp print *, b_dp end program pure_side_effects_03 lfortran-0.63.0/integration_tests/gpu_metal_72.f900000664000175000017500000000063615174404631022177 0ustar alastairalastairprogram gpu_metal_72 implicit none type :: t real, allocatable :: a(:) end type type(t) :: x real :: r(4) integer :: i allocate(x%a(4)) x%a = [10.0, 20.0, 30.0, 40.0] do concurrent(i = 1:4) r(i) = x%a(i) * 2.0 end do if (abs(r(1) - 20.0) > 1e-5) error stop if (abs(r(2) - 40.0) > 1e-5) error stop if (abs(r(3) - 60.0) > 1e-5) error stop if (abs(r(4) - 80.0) > 1e-5) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/c_sizeof_02.f900000664000175000017500000000073415174404631022013 0ustar alastairalastairmodule c_sizeof_02_mod use iso_c_binding, only: c_sizeof, c_int64_t, c_int32_t implicit none type, bind(c) :: pair_t integer(c_int64_t) :: a, b end type contains subroutine check() type(pair_t) :: x integer(c_int32_t) :: i if (c_sizeof(x) /= 16) error stop if (c_sizeof(i) /= 4) error stop print *, "ok" end subroutine end module program c_sizeof_02 use c_sizeof_02_mod call check() end program lfortran-0.63.0/integration_tests/declaration_03.f900000664000175000017500000000052115174404631022472 0ustar alastairalastairprogram declaration_03 implicit none type(character(len=4)) :: str1 = 'abcd' type(real):: r1 = 1.53 type(character(len=*)),parameter:: str2='(*(g0))' print *, str1, str2, r1 if (str1 /= 'abcd') error stop if ((r1 - 1.53) > 1e-4) error stop if (str2 /= '(*(g0))') error stop end program declaration_03lfortran-0.63.0/integration_tests/string_03.f900000664000175000017500000000071615174404631021521 0ustar alastairalastairmodule string_03_mod implicit none character(len = 5), parameter :: intro = "I've " end module program string_03 use string_03_mod, only: intro implicit none character(len = 8) :: verb character(len = 5) :: posit character(len = 4) :: title character(len = 7) :: last_name character(len = 29) :: combined verb = "learned " posit = "from " title = 'the ' last_name = 'best' combined = intro//verb//posit//title//last_name//"." print *, combined end program lfortran-0.63.0/integration_tests/intrinsics_450.f900000664000175000017500000001125515174404631022466 0ustar alastairalastairprogram intrinsics_450 ! Test storage_size with proper struct alignment/padding. ! For bind(C) types, verify: storage_size(x) == c_sizeof(x) * 8 ! For all struct types, verify: storage_size(x) == sizeof(x) * 8 use iso_c_binding, only: c_ptr, c_null_ptr, c_int, c_double, c_sizeof implicit none ! --- Primitive types --- integer(1) :: i1 integer(2) :: i2 integer(4) :: i4 integer(8) :: i8 real(4) :: r4 real(8) :: r8 complex(4) :: c4 complex(8) :: c8 ! bind(C) struct: no padding needed (4 + 4 = 8) type, bind(C) :: t_nopad integer(c_int) :: a integer(c_int) :: b end type ! bind(C) struct: padding between members ! 4 + 4(pad) + 8 + 4 + 4(pad) = 24 type, bind(C) :: t_pad integer(c_int) :: a real(c_double) :: d integer(c_int) :: b end type ! bind(C) struct: no trailing padding (8 + 4 + 4 = 16) type, bind(C) :: t_notrail real(c_double) :: d integer(c_int) :: a integer(c_int) :: b end type ! bind(C) struct with c_ptr (4 + 4(pad) + 8 = 16) type, bind(C) :: t_cptr integer(c_int) :: a type(c_ptr) :: p end type ! Single-member struct type, bind(C) :: t_single type(c_ptr) :: p end type ! Non-bind(C) struct with padding type :: t_fort integer(1) :: a real(8) :: b end type ! Non-bind(C) struct: small fields only type :: t_small integer(1) :: a integer(1) :: b integer(1) :: c end type type(t_nopad) :: x1 type(t_pad) :: x2 type(t_notrail) :: x3 type(t_cptr) :: x4 type(t_single) :: x5 type(t_fort) :: x6 type(t_small) :: x7 type(c_ptr) :: cp ! Primitive checks if (storage_size(i1) /= 8) error stop "i1" if (storage_size(i2) /= 16) error stop "i2" if (storage_size(i4) /= 32) error stop "i4" if (storage_size(i8) /= 64) error stop "i8" if (storage_size(r4) /= 32) error stop "r4" if (storage_size(r8) /= 64) error stop "r8" if (storage_size(c4) /= 64) error stop "c4" if (storage_size(c8) /= 128) error stop "c8" ! c_ptr cp = c_null_ptr if (storage_size(cp) /= 64) error stop "c_ptr" ! Struct: no padding if (storage_size(x1) /= 64) error stop "t_nopad" if (storage_size(x1) /= c_sizeof(x1) * 8) error stop "t_nopad vs c_sizeof" ! Struct: padding between int and double if (storage_size(x2) /= 192) error stop "t_pad" if (storage_size(x2) /= c_sizeof(x2) * 8) error stop "t_pad vs c_sizeof" ! Struct: no trailing padding if (storage_size(x3) /= 128) error stop "t_notrail" if (storage_size(x3) /= c_sizeof(x3) * 8) error stop "t_notrail vs c_sizeof" ! Struct with c_ptr member if (storage_size(x4) /= 128) error stop "t_cptr" if (storage_size(x4) /= c_sizeof(x4) * 8) error stop "t_cptr vs c_sizeof" ! Single-member struct if (storage_size(x5) /= 64) error stop "t_single" if (storage_size(x5) /= c_sizeof(x5) * 8) error stop "t_single vs c_sizeof" ! Non-bind(C) struct: sizeof() cross-check (uses LLVM DataLayout) if (storage_size(x6) /= sizeof(x6) * 8) error stop "t_fort vs sizeof" if (storage_size(x7) /= sizeof(x7) * 8) error stop "t_small vs sizeof" ! storage_size usable as parameter call check_param() ! --- Array checks --- ! For arrays: sizeof(x) == [storage_size(x(1)) / 8] * size(x) call check_arrays() print *, "PASS" contains subroutine check_param() integer, parameter :: ss_i4 = storage_size(1_4) integer, parameter :: ss_i8 = storage_size(1_8) if (ss_i4 /= 32) error stop "param i4" if (ss_i8 /= 64) error stop "param i8" end subroutine subroutine check_arrays() integer(1) :: ai1(10) integer(4) :: ai4(5) integer(8) :: ai8(3) real(4) :: ar4(7) real(8) :: ar8(4) complex(4) :: ac4(2) complex(8) :: ac8(6) type(t_pad) :: at_pad(3) type(t_fort) :: at_fort(5) ! Primitive arrays if (sizeof(ai1) /= (storage_size(ai1(1)) / 8) * size(ai1)) & error stop "arr i1" if (sizeof(ai4) /= (storage_size(ai4(1)) / 8) * size(ai4)) & error stop "arr i4" if (sizeof(ai8) /= (storage_size(ai8(1)) / 8) * size(ai8)) & error stop "arr i8" if (sizeof(ar4) /= (storage_size(ar4(1)) / 8) * size(ar4)) & error stop "arr r4" if (sizeof(ar8) /= (storage_size(ar8(1)) / 8) * size(ar8)) & error stop "arr r8" if (sizeof(ac4) /= (storage_size(ac4(1)) / 8) * size(ac4)) & error stop "arr c4" if (sizeof(ac8) /= (storage_size(ac8(1)) / 8) * size(ac8)) & error stop "arr c8" ! Struct arrays (with padding) if (sizeof(at_pad) /= (storage_size(at_pad(1)) / 8) * size(at_pad)) & error stop "arr t_pad" if (sizeof(at_fort) /= (storage_size(at_fort(1)) / 8) * size(at_fort)) & error stop "arr t_fort" end subroutine end program lfortran-0.63.0/integration_tests/data_implied_do_01.f900000664000175000017500000000052715174404631023307 0ustar alastairalastairprogram data_implied_do_01 real :: a(5) integer :: i DATA (a(i),i=1,5) /1.0, 2.0, 3*0.0/ print *, a if (abs(a(1) - 1.0) > 1e-8) error stop if (abs(a(2) - 2.0) > 1e-8) error stop if (abs(a(3) - 0.0) > 1e-8) error stop if (abs(a(4) - 0.0) > 1e-8) error stop if (abs(a(5) - 0.0) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/nested_04.f900000664000175000017500000000062515174404631021475 0ustar alastairalastairmodule nested_04_a implicit none contains integer function b(x) integer, intent(in) :: x integer y real :: yy yy = 6.6 y = x print *, "b()" b = c(6) contains integer function c(z) integer, intent(in) :: z print *, z print *, y print *, yy c = z end function c end function b end module program nested_04 use nested_04_a, only: b implicit none integer test test = b(5) end lfortran-0.63.0/integration_tests/separate_compilation_23.f900000664000175000017500000000014215174404631024410 0ustar alastairalastairprogram separate_compilation_23 use ansi_separate_compilation_23 implicit none end programlfortran-0.63.0/integration_tests/assumed_type_02.f900000664000175000017500000000214315174404631022710 0ustar alastairalastairprogram assumed_type_02 ! Test that the CFI type field is correctly set when a concrete type ! array is passed through a type(*) Fortran wrapper to a bind(C) routine. implicit none interface subroutine check_cfi_type_int32(a, ok) bind(C) type(*), intent(in) :: a(..) integer, intent(out) :: ok end subroutine subroutine check_cfi_type_real64(a, ok) bind(C) type(*), intent(in) :: a(..) integer, intent(out) :: ok end subroutine end interface integer, allocatable :: xi(:) real(8), allocatable :: xr(:) integer :: ok allocate(xi(3)) xi = 42 call forward_int(xi) allocate(xr(2)) xr = 3.14d0 call forward_real(xr) print *, "ok" contains subroutine forward_int(a) type(*), intent(inout) :: a(..) integer :: ok call check_cfi_type_int32(a, ok) if (ok /= 1) error stop "CFI type for integer(4) is wrong" end subroutine subroutine forward_real(a) type(*), intent(inout) :: a(..) integer :: ok call check_cfi_type_real64(a, ok) if (ok /= 1) error stop "CFI type for real(8) is wrong" end subroutine end program lfortran-0.63.0/integration_tests/separate_compilation_07.f900000664000175000017500000000021715174404631024415 0ustar alastairalastairprogram separate_compilation_07 use separate_compilation_07b_mpi integer :: ierr call MPI_Init(ierr) print *, ierr end program lfortran-0.63.0/integration_tests/associate_48.f900000664000175000017500000000220315174404631022170 0ustar alastairalastairmodule associate_48_mod implicit none type :: elem_t integer, allocatable :: v end type type :: outer_t type(elem_t), allocatable :: items(:) end type type :: ptr_t type(outer_t), pointer :: ptr => null() end type contains subroutine sub(a, b) type(outer_t), intent(inout) :: a type(outer_t), intent(in) :: b integer :: i do i = 1, size(a%items) a%items(i)%v = a%items(i)%v + b%items(i)%v end do end subroutine subroutine process(arr, n) type(ptr_t), intent(inout) :: arr(:) integer, intent(in) :: n associate(x => arr(1)%ptr) if (n > 0) call sub(x, arr(1)%ptr) end associate end subroutine end module program associate_48 use associate_48_mod implicit none type(ptr_t) :: arr(1) allocate(arr(1)%ptr) allocate(arr(1)%ptr%items(2)) arr(1)%ptr%items(1)%v = 3 arr(1)%ptr%items(2)%v = 7 call process(arr, 1) if (arr(1)%ptr%items(1)%v /= 6) error stop if (arr(1)%ptr%items(2)%v /= 14) error stop print *, "done" deallocate(arr(1)%ptr) end program lfortran-0.63.0/integration_tests/select_rank_22.f900000664000175000017500000000105615174404631022504 0ustar alastairalastairprogram select_rank_22 implicit none real :: val val = 3.14 call test_sub(val) if (abs(val - 42.0) > 1.0e-5) error stop contains subroutine test_sub(x) class(*), dimension(..), intent(inout) :: x select rank(x) rank(0) select type(x) type is (real) x = 42.0 end select rank(1) select type(x) type is (real) x(1) = 42.0 end select end select end subroutine end program select_rank_22 lfortran-0.63.0/integration_tests/derived_types_09.f900000664000175000017500000000010415174404631023056 0ustar alastairalastairprogram derived_types_09 use derived_types_09b, only: f end program lfortran-0.63.0/integration_tests/spec_expr_01.f900000664000175000017500000000154415174404631022201 0ustar alastairalastairmodule spec_expr_01_mod contains pure integer function nlen(n) integer, intent(in) :: n nlen = int(log10(real(abs(n), kind(1d0)) + 0.1d0)) + 1 end function nlen end module spec_expr_01_mod program spec_expr_01 use spec_expr_01_mod, only: nlen implicit none character(22) :: cinput = '42 666 -42 -666 10 9 0' integer :: input(7), i read(cinput, *) input if (input(1) /= 42) error stop if (input(2) /= 666) error stop if (input(3) /= -42) error stop if (input(4) /= -666) error stop if (input(5) /= 10) error stop if (input(6) /= 9) error stop if (input(7) /= 0) error stop do i = 1, 7 print *, 'input was "'//i0(input(i))//'"' end do contains pure function i0(n) result(outstring) integer, intent(in) :: n character(nlen(n)+1) :: outstring write(outstring, "(I0)") n end function i0 end program spec_expr_01 lfortran-0.63.0/integration_tests/format_04.f900000664000175000017500000000213415174404631021500 0ustar alastairalastairprogram format_04 real :: a,b,c,d double precision :: r,s,t integer :: f real(8) :: p,q a = 123.456 b = 123.45678 c = 12.34 d = 123.45 f = 12345 r = 12345678 s = 23.5678 t = 0.345678 p = 2.0d0 q = 0.0d0 print *, "ok", "b" print '(a,a)', "ok", "b" print '("Success!",/,10X,A6,"World!")',"Hello 123" print '(4a4)',"dancing","in","the","moonlight" print '(A2,4(2X,A),I3)',"ab", "cdef", "ghi", "jkl","qwerty",12 print '(i3,i10.5,/i6.6,2x,i3)' , 123,456,12345,6789 print '(d10.2,d15.6,d010.2,2x,d7.2)', 123.456, -123.45678, 12.34, -123.45 print '(1pd10.2,2pd15.6,1pd010.2,2x,1pd9.2)', -a, b, -c, d print '(-1pe10.2,-2pe15.6,1pe010.2,2x,1pe9.2)', -a, b, -c, d print "(12(i3))", 1,2,3,4,5,6,7,8,9,10,11,12 print "(4(i3),' hello')", 1,2,3,4,5,6,7,8,9,10,11,12,13,14 print '(i0)', f, -f print '(d12.5,1x,d0.1,1x,d0.2)',a,b,c print '(d12.5,1x,d0.1,1x,d0.2)',-a,-b,-c print '("Hello")' print '( F13.3,1X,F9.6,1X, F0.2 )', r, s, t print '( F13.3,1X,F9.6,1X, F0.2 )', -r, -s, -t print '(1PE13.6)', p, q print '(F30.25)', 12345e-25 print '("x:", F4.2, " y:", ES7.1)', 1.123, 4.456 print '("x:", ES10.2)', 0.999, 0.1 end program lfortran-0.63.0/integration_tests/intrinsics_76.f900000664000175000017500000000071415174404631022410 0ustar alastairalastairprogram intrinsics_76 implicit none real(8) :: gamma = 1 real(8) :: x(3), xsqrt(3) gamma = 0.3612163121_8 x = [1._8, 2._8, 3._8] if( any(abs(exp(-gamma*sqrt(x)) - [0.69682824978102864_8, 0.59999316978514361_8, 0.53491629349743086_8]) > 1e-6) ) error stop print *, exp(-gamma*sqrt(x)) xsqrt = -gamma*sqrt(x) if( any(abs(exp(xsqrt) - [0.69682824978102864_8, 0.59999316978514361_8, 0.53491629349743086_8]) > 1e-6) ) error stop print *, exp(xsqrt) end program lfortran-0.63.0/integration_tests/character_09.f900000664000175000017500000000031315174404631022146 0ustar alastairalastairprogram character_09 implicit none integer, parameter :: SCK = selected_char_kind("ascii") character(kind=SCK) :: one_len one_len = "hello" if (one_len /= "h") error stop end program lfortran-0.63.0/integration_tests/format_28.f900000664000175000017500000000267415174404631021517 0ustar alastairalastairprogram format_28 implicit none integer w,io character(12) fmt real :: x = -0.0 real, parameter :: a(4) = [ 1.0, 2.0, 3.0, 4.0 ] real, parameter :: b(4) = a / SUM(a) print "(4E11.3)", b do w = 6,9 write(fmt,'(A,I0,A)') '(A,ES',w,'.2E1)' write(*,fmt,iostat=io) fmt//' ',3e20 if(io/=0) cycle end do print "(ES6.2E1)", 3e20 print "(ES7.2E1)", 3e20 print "(ES8.2E2)", 3e20 print "(ES9.2E1)", 3e20 print "(ES10.2E1)", 3e20 print "(ES11.2E1)", 3e20 write(*,"(ES0.0E0)") 0.0 write(*,"(ES0.0e0)") 10.0 write(*,"(ES0.0E0)") 3.14159 write(*,"(ES0.0E0)") 3.14159E+05 write(*,"(ES0.0E0)") 1.23456789E+10 write(*,"(ES0.0E0)") -1.23456789E+10 write(*, "(ES7.3E4)") 1.23456789E+10 write(*, "(ES7.3E4)") -1.23456789E+10 write(*,"(ES10.3E2)") 1.23e-40 write(*,"(ES10.3E2)") -1.23e-40 write(*,"(ES10.2E1)") 123.45 write(*,"(ES10.2E2)") 123.45 write(*,"(ES10.2E3)") 123.45 write(*,"(ES10.2E2)") 1.0e+2 write(*,"(ES10.2E2)") 1.0e+0 write(*,"(ES10.2E2)") 9.995e+0 write(*,"(SP,ES10.2E1)") 123.45 write(*,"(SS,ES10.2E1)") 123.45 write(*,"(ES4.1E1)") 3.14e+0 write(*,"(ES5.1E1)") 3.14e+0 write(*,"(ES6.1E1)") 0.0 write(*,"(ES0.0E0)") 0.0 print '(E7.2)', 289. print '(E7.2)', 289. print '(E8.2)', 289. print '(E7.2)', 0.289 print '(E9.2)', 1.23456789e+12 print '(E7.2)', -289. end program format_28 lfortran-0.63.0/integration_tests/allocate_43.f900000664000175000017500000000056415174404631022004 0ustar alastairalastairprogram allocate_43 use iso_c_binding, only: c_ptr, c_null_ptr, c_associated implicit none type :: my_type type(c_ptr) :: ptr end type type(my_type) :: obj obj%ptr = c_null_ptr call use_ptr(obj%ptr) if (c_associated(obj%ptr)) error stop contains subroutine use_ptr(p) type(c_ptr), intent(inout) :: p p = c_null_ptr end subroutine end program allocate_43 lfortran-0.63.0/integration_tests/string_57.f900000664000175000017500000000201215174404631021521 0ustar alastairalastairmodule module_string_57 type :: MyType character(:), allocatable :: string contains procedure :: method end type MyType contains subroutine method(self, v) class(MyType), intent(in) :: self character(len=*), intent(inout) :: v select case (self%string) case ('String1') print *, 'Method called with String1' v = 'String1 processed' case ('String2') print *, 'Method called with String2' v = 'String2 processed' case default print *, 'Method called with unknown string' v = 'Unknown string processed' end select end subroutine method end module module_string_57 program string_57 use module_string_57 implicit none type(MyType) :: obj character(len=20) :: result obj%string = 'String1' call obj%method(result) print *, 'Result after String1:', result if (trim(result) /= 'String1 processed') error stop obj%string = 'String2' call obj%method(result) print *, 'Result after String2:', result if (trim(result) /= 'String2 processed') error stop print *, 'Program completed successfully.' end program lfortran-0.63.0/integration_tests/arrays_op_6.f900000664000175000017500000000163115174404631022132 0ustar alastairalastairprogram array_op_5 implicit none real :: a(2, 2, 2), b(2, 2, 2), c(2, 2, 2) real :: d(2, 2, 2) integer :: i, j, k do i = 1, 2 do j = 1, 2 do k = 1, 2 a(i, j, k) = i*i + j*j + k*k b(i, j, k) = 2*(i*j + j*k + i*k) c(i, j, k) = 0 end do end do end do d = asquare(a, b, c) call check(d) contains function asquare(a, b, c) result(d) implicit none real :: a(:, :, :), b(:, :, :), c(:, :, :) real :: d(2, 2, 2) d = a + b + c end function asquare subroutine check(c) implicit none real, intent(in) :: c(:, :, :) integer :: i, j, k do i = lbound(c, 1), ubound(c, 1) do j = lbound(c, 2), ubound(c, 2) do k = lbound(c, 3), ubound(c, 3) if(c(i, j, k) /= (i + j + k)**2) error stop end do end do end do end subroutine check end program lfortran-0.63.0/integration_tests/derived_types_111.f900000664000175000017500000000151315174404631023135 0ustar alastairalastair! Test: finalize intent(out) dummy argument on procedure entry ! Fortran 2018, clause 7.5.6.3, paragraph 7 module derived_types_111_m implicit none integer :: finalizations = 0 type :: obj_t integer :: dummy = 0 contains final :: count_finalizations end type contains subroutine count_finalizations(self) type(obj_t), intent(inout) :: self finalizations = finalizations + 1 self%dummy = 0 end subroutine end module program derived_types_111 use derived_types_111_m implicit none type(obj_t) :: obj integer :: tally_before obj%dummy = 1 tally_before = finalizations call set_intent_out(obj) if (finalizations - tally_before /= 1) then error stop 1 end if contains subroutine set_intent_out(x) type(obj_t), intent(out) :: x x%dummy = 42 end subroutine end program lfortran-0.63.0/integration_tests/read_44.f900000664000175000017500000000062115174404631021126 0ustar alastairalastairprogram read_44 use iso_fortran_env, only: int64 implicit none type :: string_t character(len=:), allocatable :: str end type type(string_t) :: val integer(int64) :: i1, istat val%str = "111" read(val%str, *, iostat=istat) i1 print*, i1, istat if (i1 /= 111) error stop if (istat /= 0) error stop end program read_44 lfortran-0.63.0/integration_tests/file_22_data.txt0000664000175000017500000000001515174404631022335 0ustar alastairalastairHello, world!lfortran-0.63.0/integration_tests/elemental_15.f900000664000175000017500000000072015174404631022157 0ustar alastairalastairmodule elemental_15_mod implicit none type :: t integer :: v contains procedure, pass :: neq generic :: operator(/=) => neq end type contains elemental logical function neq(a,b) class(t), intent(in) :: a, b neq = a%v /= b%v end end module program elemental_15 use elemental_15_mod type(t) :: a(2) = [t(1), t(2)], b(2) = [t(1), t(2)] if (any(a /= b)) error stop a(1)%v = 2 if (.not. any(a /= b)) error stop end program lfortran-0.63.0/integration_tests/allocate_18.f900000664000175000017500000000076215174404631022006 0ustar alastairalastairprogram allocate_18 implicit none integer, allocatable :: i real, allocatable :: r complex, allocatable :: c logical, allocatable :: l allocate(i) allocate(r) allocate(c) allocate(l) i = 10 r = 4.4 c = (1, 2) l = .true. if (i /= 10) error stop if (r /= 4.4) error stop if (c /= (1, 2)) error stop if (l .neqv. .true.) error stop deallocate(i) deallocate(r) deallocate(c) deallocate(l) end program allocate_18 lfortran-0.63.0/integration_tests/subroutines_09.f900000664000175000017500000000273115174404631022602 0ustar alastairalastairmodule subroutines_09_tomlf_build_array implicit none private public :: get_value !> Getter functions to manipulate TOML arrays interface get_value module procedure :: get_elem_table module procedure :: get_elem_value_string end interface get_value contains subroutine get_elem_table(array, pos, ptr, stat) !> Instance of the TOML array integer, intent(inout) :: array !> Position in the array integer, intent(in) :: pos !> Pointer to child table integer, pointer, intent(out) :: ptr !> Status of operation logical, intent(out), optional :: stat nullify(ptr) stat = .true. end subroutine get_elem_table !> Retrieve TOML value as deferred-length character subroutine get_elem_value_string(array, pos, ptr, def, stat) !> Instance of the TOML array logical, intent(inout) :: array !> Position in the array integer, intent(in) :: pos !> Pointer to child table integer, pointer, intent(out) :: ptr !> Status of operation logical, intent(out), optional :: stat integer, intent(out), optional :: def nullify(ptr) stat = .true. end subroutine get_elem_value_string end module program main use subroutines_09_tomlf_build_array, only: get_value implicit none integer :: a = 10, pos integer, pointer :: ptr logical :: f = .false. call get_value(a, pos, ptr, stat=f) call get_value(f, pos, ptr, stat=f) end program main lfortran-0.63.0/integration_tests/arrays_04_func.f900000664000175000017500000000074715174404631022534 0ustar alastairalastairprogram arrays_04_func implicit none real :: a(3), b a(1) = 3 a(2) = 2 a(3) = 1 b = sum(a) if (abs(b-6) > 1e-5) error stop contains real function sum(a) result(r) real, intent(in) :: a(:) integer :: i print *, "sum" r = 0 do i = 1, size(a) r = r + a(i) end do end function real function abs(a) result(r) real, intent(in) :: a print *, "abs" if (a > 0) then r = a else r = -a end if end function end lfortran-0.63.0/integration_tests/array_op_10.f900000664000175000017500000000114715174404631022024 0ustar alastairalastairmodule linalg_mod_array_op_10 contains function solve(x) result(y) real :: y(5), x(5) integer :: P(5) P = [3, 4, 1, 2, 5] ! Example permutation array y(P) = x ! Handle the permutation. end function solve end module linalg_mod_array_op_10 program array_op_10 use linalg_mod_array_op_10 implicit none real :: x(5) x = [1.0, 2.0, 3.0, 4.0, 5.0] ! Example initialization x = solve(x) ! Call the solve function print *, x if ( abs(x(1) - 3.0) > 1e-8 .or. & abs(x(2) - 4.0) > 1e-8 .or. & abs(x(3) - 1.0) > 1e-8 .or. & abs(x(4) - 2.0) > 1e-8 .or. & abs(x(5) - 5.0) > 1e-8 ) error stop end program lfortran-0.63.0/integration_tests/line_continuation_03.f900000664000175000017500000000241115174404631023726 0ustar alastairalastairprogram line_continuation_03 ! The same as line_continuation_02, but we do use & to split a token implicit none ! Here are the rules for & based on the § 6.3.2.4 ("Free form statement ! continuation") in Fortran 2018 standard. ! The & character in a comment has no effect ! The & character can be used to continue a line like this: integer & :: i ! If it is used between tokens, then one can, but does not have to put another & ! on the next line: integer & &:: k i = 5 print * & , i ! One can continue strings also by treating them as tokens: print *, "some string & &is continued" ! Unless the & is at the end of the line, it can be used as a regular ! character in a string: print *, "some string can contain & as a regular character & &is continued" print *, "Even here: && && <- there will be two &" ! One can put arbitrary comments and empty lines after & that will be skipped: print *, & i print *, & ! comment 1 ! comment 2 ! comment 3 i print *, & ! comment 1 ! comment 2 ! comment 3 &i ! In strings the comment cannot be after the first &, but it can be on ! subsequent lines: print *, "some string & ! comment 2 ! comment 3 &is continued" print *, '*t',& &'' !! call set_args ( \' & !! & \n end program lfortran-0.63.0/integration_tests/class_117.f900000664000175000017500000000055715174404631021411 0ustar alastairalastair! Test same_type_as with class(*) program class_117 implicit none type :: t1 integer :: x end type t1 type :: t2 real :: y end type t2 class(*), allocatable :: a, b, c a = t1(1) b = t1(2) c = t2(3.0) if (.not. same_type_as(a, b)) error stop if (same_type_as(a, c)) error stop print *, "PASS" end program class_117 lfortran-0.63.0/integration_tests/sin_04.f900000664000175000017500000000025215174404631021000 0ustar alastairalastairprogram sin_04 use iso_fortran_env, only: dp => real64 implicit none real(dp), parameter :: x = sin(1.5_dp) if (abs(x - 0.997494996_dp) > 1e-5_dp) error stop end program lfortran-0.63.0/integration_tests/class_53.f900000664000175000017500000000132415174404631021321 0ustar alastairalastairmodule class_53_m type, abstract :: AbsType integer :: m = 0 end type AbsType type, extends(AbsType) :: MyType end type MyType interface MyType procedure :: init end interface MyType type :: Wrapper class(AbsType), allocatable :: obj contains procedure :: client end type Wrapper contains function init() result(self) type(MyType) :: self self%m = 44 end function init subroutine client(self) class(Wrapper), intent(inout) :: self self%obj = MyType() if (self%obj%m /= 44) error stop end subroutine client end module class_53_m program class_53 use class_53_m type(Wrapper) :: w call w%client() end program lfortran-0.63.0/integration_tests/proc_ptr_16.f900000664000175000017500000000065115174404631022045 0ustar alastairalastair! Test: Procedure pointer declared with type-spec (implicit interface) program proc_ptr_16 implicit none procedure(integer), pointer :: fptr => null() fptr => get_value if (fptr(5) /= 50) error stop "FAIL: expected 50" print *, "PASS: proc_ptr_16" contains function get_value(x) integer, intent(in) :: x integer :: get_value get_value = x * 10 end function end program lfortran-0.63.0/integration_tests/custom_operator_04.f900000664000175000017500000000105415174404631023435 0ustar alastairalastairmodule custom_operator_04_a implicit none public :: operator(.negation.) integer :: negation = 3 interface operator(.negation.) module procedure negative end interface contains function negative(i) result(res) integer, intent(in) :: i integer :: res res = -i print *, negation end function negative end module custom_operator_04_a program custom_operator_04 use custom_operator_04_a, only: operator(.negation.) implicit none integer :: res res = .negation. 10 print *, res end program custom_operator_04 lfortran-0.63.0/integration_tests/format_32.f900000664000175000017500000000124215174404631021500 0ustar alastairalastairprogram format_32 implicit none print "(E0.5)", 1/3.0d99 print "(E9.5)", 1/3.0d99 print "(E10.5)", 1/3.0d99 print "(E11.5)", 1/3.0d99 print "(E12.5)", 1/3.0d99 print "(E13.5)", 1/3.0d99 print "(E0.5)", 3.0d200 print "(E9.5)", 3.0d200 print "(E10.5)", 3.0d200 print "(E11.5)", 3.0d200 print "(E12.5)", 3.0d200 print "(E13.5)", 3.0d200 print "(E0.5)", 1/3.0d200 print "(E9.5)", 1/3.0d200 print "(E10.5)", 1/3.0d200 print "(E11.5)", 1/3.0d200 print "(E12.5)", 1/3.0d200 print "(E13.5)", 1/3.0d200 print "(ES6.2E1)", 3e20 print "(ES9.2)", 3e20 print "(ES9.2E1)", 3e20 end program format_32 lfortran-0.63.0/integration_tests/complex_dp.f900000664000175000017500000000026715174404631022044 0ustar alastairalastairprogram complex_dp complex(4) :: zero complex(8) :: v complex :: x zero = 0.0_4 v = (1.05_4, 1.05_4) x = (1.05_4, 1.05_8) print *, v, x, zero end programlfortran-0.63.0/integration_tests/template_travel_01.f900000664000175000017500000000563215174404631023403 0ustar alastairalastairmodule template_travel_01_math implicit none private public :: add_real, slash_real contains pure function add_real(x, y) result(total) real, intent(in) :: x, y real :: total total = x + y end function pure function slash_real(x, y) result(total) real, intent(in) :: x, y real :: total total = x / y end function end module module template_travel_01_travel use template_travel_01_math implicit none private public :: travel_tmpl requirement operations(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) type, deferred :: D type, deferred :: T type, deferred :: S pure function plus_D(l, r) result(total) type(D), intent(in) :: l, R type(D) :: total end function pure function plus_T(l, r) result(total) type(T), intent(in) :: l, R type(T) :: total end function pure function D_divided_by_T(n, d) result(quotient) type(D), intent(in) :: n type(T), intent(in) :: d type(S) :: quotient end function pure function D_divided_by_S(n, d) result(quotient) type(D), intent(in) :: n type(S), intent(in) :: d type(T) :: quotient end function end requirement template travel_tmpl(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) require :: operations(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) private public :: avg_S_from_T contains pure function avg_S_from_T(d1, t1, d2, t2) result(avg) type(D), intent(in) :: d1, d2 type(T), intent(in) :: t1, t2 type(S) :: avg avg = D_divided_by_T(plus_D(d1, d2), plus_T(t1, t2)) end function pure function avg_S_from_S(d1, s1, d2, s2) result(avg) type(D), intent(in) :: d1, d2 type(S), intent(in) :: s1, s2 type(S) :: avg avg = avg_S_from_T(d1, D_divided_by_S(d1, s1), d2, D_divided_by_S(d2, s2)) end function end template end module module template_travel_01_m use template_travel_01_math use template_travel_01_travel implicit none contains subroutine test_template() instantiate travel_tmpl(real, real, real, add_real, add_real, slash_real, slash_real), & only: avg_real_S_from_T => avg_S_from_T instantiate travel_tmpl(real, real, real, add_real, add_real, slash_real, slash_real), & only: avg_real_S_from_S => avg_S_from_S real :: s1, s2 s1 = avg_real_S_from_T(1.0, 3.0, 1.5, 4.0) s2 = avg_real_S_from_S(1.1, 0.5, 2.0, 0.75) print *, "s1=", s1 print *, "s2=", s2 end subroutine end module program template_travel_01 use template_travel_01_m implicit none call test_template() end program template_travel_01 lfortran-0.63.0/integration_tests/parsing_01.f900000664000175000017500000000136215174404631021652 0ustar alastairalastairmodule submodule implicit none integer :: complex = 1 interface module subroutine function(integer,real) integer, intent(in) :: integer integer, intent(out) :: real end subroutine function end interface contains end module submodule submodule (submodule) module contains module procedure function real = 2*integer end procedure function end submodule module program program use submodule, only: character => complex, subroutine => function implicit none integer :: integer, real integer = character associate: associate (logical=>character,complex=>real) call subroutine(logical,complex) print*, (complex) end associate associate end program program lfortran-0.63.0/integration_tests/openmp_42.f900000664000175000017500000000070415174404631021511 0ustar alastairalastairprogram openmp_42 use omp_lib ! declare variables as required integer :: ny, nx, nz , i,j integer :: iy, ix, iz ny=3 nx=4 nz=5 do j=1,2 do i =1,3 !$omp parallel do collapse(2) private(iy, ix, iz) do iy = 1, ny do ix = 1, nx do iz = 1, nz print *,"iy->", iy,"ix->", ix,"iz->", iz end do end do end do !$omp end parallel do end do end do end programlfortran-0.63.0/integration_tests/file_34.f900000664000175000017500000000142015174404631021127 0ustar alastairalastairprogram file_34 implicit none integer :: io, ios character(len=:), allocatable :: temp2 character(len=:), allocatable :: temp temp2 = 'HELLO' open(newunit=io, file="config.toml", access="stream", form="formatted", & status="replace", iostat=ios) if (ios /= 0) stop "open-for-write failed" write(io, '(a)', iostat=ios) trim(temp2) if (ios /= 0) stop "write failed" close(io) allocate(character(len=5) :: temp) open(newunit=io, file="config.toml", access="stream", form="formatted", & status="old", iostat=ios) if (ios /= 0) stop "open-for-read failed" read(io, '(a)') temp print *, "First character read =", temp close(io, status="delete") if (temp /= "HELLO") error stop end program file_34 lfortran-0.63.0/integration_tests/product_02.f900000664000175000017500000000042315174404631021665 0ustar alastairalastairprogram product_02 integer :: i, j integer(8) :: x(3, 5), xdiff do i = 1, 3 do j = 1, 5 x(i, j) = i + j end do end do xdiff = abs(product(x) - 12192768000_8) print *, xdiff if( xdiff /= 0_8 ) error stop end program lfortran-0.63.0/integration_tests/derived_types_122.f900000664000175000017500000000105115174404631023134 0ustar alastairalastairmodule derived_types_122_mod implicit none type :: child_t integer :: val = 0 end type type :: parent_t type(child_t), pointer :: first => null() end type contains subroutine test_default_constructor() type(parent_t) :: p p = parent_t() if (associated(p%first)) error stop end subroutine end module program derived_types_122 use derived_types_122_mod implicit none type(parent_t) :: p call test_default_constructor() p = parent_t() if (associated(p%first)) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/read_65.f900000664000175000017500000001101715174404631021132 0ustar alastairalastairmodule read_65_mod implicit none private public :: string_type public :: assignment(=) public :: len public :: operator(==) public :: write(unformatted), read(unformatted) integer, parameter :: long = selected_int_kind(18) type :: string_type sequence private character(len=:), allocatable :: raw end type string_type interface assignment(=) module procedure :: assign_string_char end interface interface len module procedure :: len_string end interface interface operator(==) module procedure :: eq_string_char module procedure :: eq_char_string module procedure :: eq_string_string end interface interface write(unformatted) module procedure :: write_unformatted end interface interface read(unformatted) module procedure :: read_unformatted end interface contains elemental subroutine assign_string_char(lhs, rhs) type(string_type), intent(inout) :: lhs character(len=*), intent(in) :: rhs lhs%raw = rhs end subroutine assign_string_char elemental function len_string(string) result(length) type(string_type), intent(in) :: string integer :: length if (allocated(string%raw)) then length = len(string%raw) else length = 0 end if end function len_string elemental function eq_string_char(lhs, rhs) result(is_eq) type(string_type), intent(in) :: lhs character(len=*), intent(in) :: rhs logical :: is_eq if (.not. allocated(lhs%raw)) then is_eq = (len(rhs) == 0) else is_eq = (lhs%raw == rhs) end if end function eq_string_char elemental function eq_char_string(lhs, rhs) result(is_eq) character(len=*), intent(in) :: lhs type(string_type), intent(in) :: rhs logical :: is_eq is_eq = (rhs == lhs) end function eq_char_string elemental function eq_string_string(lhs, rhs) result(is_eq) type(string_type), intent(in) :: lhs type(string_type), intent(in) :: rhs logical :: is_eq if (.not. allocated(lhs%raw) .and. .not. allocated(rhs%raw)) then is_eq = .true. else if (allocated(lhs%raw) .neqv. allocated(rhs%raw)) then is_eq = .false. else is_eq = (lhs%raw == rhs%raw) end if end function eq_string_string subroutine write_unformatted(string, unit, iostat, iomsg) type(string_type), intent(in) :: string integer, intent(in) :: unit integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg write(unit, iostat=iostat, iomsg=iomsg) int(len(string), long) if (iostat == 0) then if (len(string) > 0) then write(unit, iostat=iostat, iomsg=iomsg) string%raw else write(unit, iostat=iostat, iomsg=iomsg) '' end if end if end subroutine write_unformatted subroutine read_unformatted(string, unit, iostat, iomsg) type(string_type), intent(inout) :: string integer, intent(in) :: unit integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg character(len=:), allocatable :: buffer integer(long) :: chunk read(unit, iostat=iostat, iomsg=iomsg) chunk if (iostat == 0) then allocate(character(len=chunk) :: buffer) read(unit, iostat=iostat, iomsg=iomsg) buffer string%raw = buffer end if end subroutine read_unformatted end module read_65_mod program read_65 use read_65_mod, only: string_type, assignment(=), len, operator(==), & write(unformatted), read(unformatted) implicit none type(string_type) :: string integer :: io, stat character(len=256) :: msg string = 'Important saved value' open(newunit=io, form='unformatted', status='scratch') write(io, iostat=stat, iomsg=msg) string if (stat /= 0) then print *, 'write failed, stat=', stat, ' msg=', trim(msg) stop 1 end if string = '' rewind(io) read(io, iostat=stat, iomsg=msg) string if (stat /= 0) then print *, 'read failed, stat=', stat, ' msg=', trim(msg) stop 2 end if close(io) print *, 'len(string)=', len(string) print *, 'equal=', (string == 'Important saved value') if (len(string) /= 21 .or. .not. (string == 'Important saved value')) error stop end program read_65 lfortran-0.63.0/integration_tests/string_80.f900000664000175000017500000000061415174404631021523 0ustar alastairalastairmodule string_80_mod integer :: i = 10 end module program string_80 use string_80_mod call ff(10) call ff(3) contains subroutine ff(expected_len) integer, intent(in) :: expected_len character(i), allocatable :: cc i = 3 cc = "as" print *, len(cc) if(len(cc) /= expected_len) error stop end subroutine end programlfortran-0.63.0/integration_tests/complex_23.f900000664000175000017500000000026415174404631021662 0ustar alastairalastairprogram complex_23 complex, parameter :: arr(1) = [(1,1)] complex :: d(1) d = arr + 1 print *, d if (any(d /= [(2.0,1.0)])) error stop end program complex_23 lfortran-0.63.0/integration_tests/allocate_23.f900000664000175000017500000000124115174404631021773 0ustar alastairalastairprogram allocate_23 implicit none type :: base integer :: x = 100 end type type, extends(base) :: derived integer :: y = 200 end type type(base), allocatable :: a1, a2 type(derived), allocatable :: d1 class(base), allocatable :: c1 ! type -> type allocate(a1) a1%x = 11 allocate(a2, source=a1) if (a2%x /= 11) error stop ! type -> class allocate(d1) d1%x = 22 d1%y = 44 allocate(c1, source=d1) select type(c1) type is (derived) if (c1%x /= 22 .or. c1%y /= 44) error stop class default error stop end select end program allocate_23 lfortran-0.63.0/integration_tests/class_29.f900000664000175000017500000000267715174404631021340 0ustar alastairalastairprogram class_29 type :: toml_val integer :: x character(len=:), allocatable :: y end type type :: toml_table integer :: x character(len=:), allocatable :: y class(toml_val), allocatable :: val end type class(toml_table), pointer :: temp class(toml_table), pointer :: temp2 class(toml_table), allocatable :: temp3 type(toml_table), allocatable :: temp4 type(toml_table), target :: temp_table temp_table%x = 42 temp => temp_table nullify(temp2) if (associated(temp2) .or. .not. associated(temp)) error stop if (allocated(temp3)) error stop allocate(temp3) allocate(temp4) if (.not. allocated(temp3)) error stop temp3%y = "Hello, World!" if (allocated(temp3%val)) error stop call destroy(temp3) if (allocated(temp3%y)) error stop temp3%y = "Hello, World!" temp4%y = "Hello, World!" if (allocated(temp3%y)) then deallocate(temp3%y) end if if (allocated(temp3%y)) error stop if (allocated(temp4%y)) then deallocate(temp4%y) end if if (allocated(temp4%y)) error stop allocate(temp4%val) temp4%val%y = "Hello" if (allocated(temp4%val%y)) then deallocate(temp4%val%y) end if if (allocated(temp4%val%y)) error stop contains subroutine destroy(shlex) class(toml_table), intent(inout) :: shlex deallocate(shlex%y) end subroutine destroy end programlfortran-0.63.0/integration_tests/inquire_03.f900000664000175000017500000000243015174404631021662 0ustar alastairalastairprogram inquire_03 integer :: unit = 2 character(12) :: filename, specifier_r, specifier_w, specifier_rw filename = "dummy.txt" open(unit, file=filename, action='write') inquire(unit, write=specifier_w, read=specifier_r, readwrite=specifier_rw) print *, specifier_r, specifier_w, specifier_rw if (specifier_r /= "NO" .or. specifier_w /= "YES ".or. specifier_rw /= "NO") error stop close(unit) open(unit, file=filename, action='read') inquire(unit, write=specifier_w, read=specifier_r, readwrite=specifier_rw) print *, specifier_r, specifier_w, specifier_rw if (specifier_r /= "YES" .or. specifier_w /= "NO " .or. specifier_rw /= "NO") error stop close(unit) open(unit, file=filename, action='readwrite') inquire(unit, write=specifier_w, read=specifier_r, readwrite=specifier_rw) print *, specifier_r, specifier_w, specifier_rw if (specifier_r /= "YES" .or. specifier_w /= "YES " .or. specifier_rw /= "YES") error stop close(unit) open(unit, file=filename) inquire(unit, write=specifier_w, read=specifier_r, readwrite=specifier_rw) print *, specifier_r, specifier_w, specifier_rw if (specifier_r /= "YES" .or. specifier_w /= "YES " .or. specifier_rw /= "YES") error stop close(unit) end program inquire_03 lfortran-0.63.0/integration_tests/external_01.f900000664000175000017500000000032115174404631022023 0ustar alastairalastairprogram main double precision, external :: enorm print *, enorm(1.0d0) end program double precision function enorm(n) result(y) double precision, intent(in) :: n y = n return end function lfortran-0.63.0/integration_tests/arrays_29.f900000664000175000017500000000075515174404631021527 0ustar alastairalastairprogram arrays_29 real :: B(10, 2), rescol1, rescol2 B(:, 1) = 1 B(:, 2) = 2 rescol1 = mysum(size(B, 1), B(:, 1)) print *, rescol1 if( rescol1 /= 10.0 ) error stop rescol2 = mysum(size(B, 1), B(:, 2)) print *, rescol2 if( mysum(size(B, 1), B(:, 2)) /= 20.0 ) error stop contains real function mysum(n, A) result(r) integer, intent(in) :: n real, intent(in) :: A(n) integer :: i r = 0 do i = 1, size(A) r = r + A(i) end do end function end program lfortran-0.63.0/integration_tests/generic_name_05.f900000664000175000017500000000253115174404631022626 0ustar alastairalastairmodule generic_name_05_mod implicit none type :: SomeType end type SomeType interface SomeType procedure :: constructor end interface contains function constructor() result(self) type(SomeType) :: self end function constructor end module generic_name_05_mod module mymod implicit none type :: MyType end type MyType interface MyType procedure :: constructor end interface contains function constructor(a) result(self) real(8), optional, intent(in) :: a(:) type(MyType) :: self end function constructor end module mymod module generic_name_05_mod_2 use generic_name_05_mod use mymod, only: MyType implicit none type :: ClientType end type ClientType interface ClientType procedure :: init end interface contains function init() result(self) type(ClientType) :: self real(8) :: arr(6) class(MyType), allocatable :: obj arr = 1.0d0 allocate(obj, source = MyType(a=arr)) if (.not. allocated(obj)) then error stop "Allocation failed" end if if (any(arr /= 1.0d0)) then error stop "Array values were modified during allocation" end if end function init end module generic_name_05_mod_2 program generic_name_05 use generic_name_05_mod_2 implicit none type(ClientType) :: c c = ClientType() end program generic_name_05lfortran-0.63.0/integration_tests/procedure_14.f900000664000175000017500000000134715174404631022206 0ustar alastairalastairmodule cobylb_mod_procedure_14 contains subroutine cobylb(calcfc) implicit none interface subroutine OBJCON(x) implicit none real, intent(in) :: x(:) end subroutine OBJCON end interface procedure(OBJCON) :: calcfc call calcfc_internal([1.0, 2.0]) contains subroutine calcfc_internal(x_internal) implicit none real, intent(in) :: x_internal(:) call calcfc(x_internal) end subroutine calcfc_internal end subroutine cobylb end module program procedure_14 use cobylb_mod_procedure_14 implicit none call cobylb(calcfc) contains subroutine calcfc(x) implicit none real, intent(in) :: x(:) print *, x if ( abs(sum(x) - 3.0) > 1e-8 ) error stop end subroutine end program lfortran-0.63.0/integration_tests/class_03.f900000664000175000017500000000145215174404631021316 0ustar alastairalastairmodule hr implicit none type, public :: person character(len=20) :: first, last integer :: birthyear character(len=1) :: sgender end type person type, public :: employee type(person) :: person integer :: hire_date character(len=20) :: department end type employee end module hr program hr_code use hr, only: person, employee implicit none type(person) :: jack type(employee) :: jill jack = person( "Jack", "Smith", 1984, "M" ) jill = employee( person( "Jill", "Smith", 1984, "F" ), 2003, "sales" ) print *, jack%first, jack%last, jack%birthyear, jack%sgender print *, jill%person%first, jill%person%last, jill%person%birthyear, jill%person%sgender, jill%department, jill%hire_date end program hr_code lfortran-0.63.0/integration_tests/allocate_22.f900000664000175000017500000000043515174404631021776 0ustar alastairalastairprogram allocate_22 use iso_fortran_env, only: int64, int32 implicit none integer(int64) :: array_size, stat integer(int32), allocatable :: buf(:) array_size = 10 allocate( buf(0:array_size/2-1), stat=stat) if (stat /= 0) error stop end program allocate_22lfortran-0.63.0/integration_tests/separate_compilation_20b.f900000664000175000017500000000040115174404631024545 0ustar alastairalastairsubmodule (stdlib_error_separate_compilation_20) f18estop_separate_compilation_20 implicit none contains module procedure error_stop integer, parameter :: i = 3 code = i end procedure end submodule f18estop_separate_compilation_20lfortran-0.63.0/integration_tests/external_10.f900000664000175000017500000000072215174404631022030 0ustar alastairalastairmodule external_10_module implicit none integer :: g = 2 end module subroutine sub1_external_10 use external_10_module implicit none call sub2_external_10 (g) print *, g if (g /= 10) error stop end subroutine subroutine sub2_external_10 (x) implicit none integer, intent(inout) :: x print *, x if (x /= 2) error stop x = 10 end subroutine program external_10 implicit none call sub1_external_10 end program lfortran-0.63.0/integration_tests/cpp_pre_02.f900000664000175000017500000000012315174404631021632 0ustar alastairalastairprogram cpp_pre_02 /*/ this should be ignored */ print *, "hi" end program lfortran-0.63.0/integration_tests/goto_02.f900000664000175000017500000000107115174404631021155 0ustar alastairalastairprogram goto2 implicit none integer :: A A = 0 1 continue write(*,*) A = A + 1 if (A.GT.2) go to 95 write(*,*) 'A =', A,' Starting' if (A.EQ.1) go to 10 go to 20 10 continue write(*,*) 'A =',A,' Got to 10' goto 30 20 continue write(*,*) 'A =',A,' Got to 20' 30 continue write(*,*) 'A =',A,' Got to 30' if (A.EQ.2) go to 99 goto 1 95 continue write(*,*) 'A =',A,' Got to 95' 99 continue write(*,*) 'A =',A,' Got to 99' stop ' ' end lfortran-0.63.0/integration_tests/where_03.f900000664000175000017500000000141715174404631021324 0ustar alastairalastairsubroutine where_03 implicit none real a(4) real b(4) a = (/ 1.0, 2.0, 3.0, 4.0/) b = (/ -1.0, -2.0, 5.0, 7.0/) where (a > b) a = 1.0 endwhere where(a == 1.0) a = 2.0 else where(a == 2.0) b = 3.0 else where a = b * 2.0 / a * 3.0 endwhere if (abs(a(1) - 2.0) > 1e-7 ) error stop if (abs(a(2) - 2.0) > 1e-7 ) error stop if (abs(a(3) - 10.0) > 1e-7 ) error stop if (abs(a(4) - 10.5) > 1e-7 ) error stop if (abs(b(1) - (-1.0)) > 1e-7 ) error stop if (abs(b(2) - (-2.0)) > 1e-7 ) error stop if (abs(b(3) - 5.0) > 1e-7 ) error stop if (abs(b(4) - 7.0) > 1e-7 ) error stop print *, a print *, b end subroutine program main call where_03 end program lfortran-0.63.0/integration_tests/infer_walrus_struct_01.f900000664000175000017500000000037415174404631024315 0ustar alastairalastairprogram infer_walrus_struct_01 implicit none type :: point_t real :: x, y end type p := point_t(1.0, 2.0) if (abs(p%x - 1.0) > 1.0e-6) error stop if (abs(p%y - 2.0) > 1.0e-6) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/types_24.f900000664000175000017500000000242315174404631021357 0ustar alastairalastairmodule nf_flatten_layer implicit none private public :: flatten_layer type :: flatten_layer real, allocatable :: gradient_2d(:,:) contains procedure :: backward end type flatten_layer contains subroutine backward(self, input, gradient) class(flatten_layer), intent(in out) :: self real, intent(in) :: input(..) real, intent(in) :: gradient(:) select rank(input) rank(2) self%gradient_2d = reshape(gradient, shape(input)) rank default error stop "Unsupported rank of input" end select end subroutine backward end module nf_flatten_layer program main use nf_flatten_layer implicit none type(flatten_layer) :: layer real :: input(2,3) real :: gradient(6) integer :: i ! Initialize input input = reshape([1.,2.,3.,4.,5.,6.], shape(input)) ! Suppose this is gradient from next layer (flattened) gradient = [10.,20.,30.,40.,50.,60.] call layer%backward(input, gradient) print *, "Input:" print *, input if (any(input /= reshape([1.,2.,3.,4.,5.,6.], [2, 3]))) error stop print *, "Gradient reshaped back to 2D:" print *, layer%gradient_2d if (any(layer%gradient_2d /= reshape([10.,20.,30.,40.,50.,60.], [2, 3]))) error stop end program main lfortran-0.63.0/integration_tests/legacy_array_sections_20.f900000664000175000017500000000172315174404631024562 0ustar alastairalastair! Test sequence association: passing a scalar element of a 2D array ! to an assumed-size dummy. The callee indexes the original contiguous ! memory with its own leading dimension (ldc). program legacy_array_sections_20 implicit none real :: a(3, 3) integer :: i, j a = 0.0 call set_val(a(2,2), 3, 7.0) ! c(1,2) in the callee maps to a(2,3) in the caller: ! a(2,2) is element 5 (column-major), c(1,2) = ptr + ldc = ptr + 3 = element 8 = a(2,3) if (a(2,3) /= 7.0) error stop ! Verify no other element was modified do j = 1, 3 do i = 1, 3 if (i == 2 .and. j == 3) cycle if (a(i,j) /= 0.0) error stop end do end do ! Test with a different starting element a = 0.0 call set_val(a(1,1), 3, 42.0) if (a(1,2) /= 42.0) error stop print *, "ok" contains subroutine set_val(c, ldc, val) integer, intent(in) :: ldc real, intent(inout) :: c(ldc, *) real, intent(in) :: val c(1, 2) = val end subroutine end program lfortran-0.63.0/integration_tests/allocated_03.f900000664000175000017500000000022415174404631022135 0ustar alastairalastairprogram main implicit none real(4), allocatable :: x(:) allocate(x(10)) if (.not.allocated(x)) error stop end program main lfortran-0.63.0/integration_tests/intrinsics_148.f900000664000175000017500000000224515174404631022471 0ustar alastairalastairprogram intrinsics_148 integer :: array(3, 4) logical :: mask(3, 4) integer :: vector(13) integer :: res(13) integer :: out real :: output(2) real :: array_3(3, 4, 5) logical :: mask_3(3, 4, 5) real :: vector_3(60) real :: res_3(60) array = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [3, 4]) mask = .false. mask(1, 1) = .true. vector = [114, 2414, 3142, 4626, 575, 633, 71, 89, 9123, 1011, 1112, 1213, 1314] print *, pack(array, .true., vector) print *, sum(pack(array, .true., vector)) out = sum(pack(array, .true., vector)) if (out /= 1392) error stop print *, pack(array, mask, vector) print *, sum(pack(array, mask, vector)) out = sum(pack(array, mask, vector)) if (out /= 25324) error stop print *, pack(array, mask) print *, sum(pack(array, mask)) out = sum(pack(array, mask)) if (out /= 1) error stop array_3 = 12.141 mask_3 = .false. mask_3(1, 1, 1) = .true. vector_3 = -12.141 print *, pack(array_3, mask_3, vector_3) print *, sum(pack(array_3, mask_3, vector_3)) if (abs(sum(pack(array_3, mask_3, vector_3)) + 704.177734) > 1e-6) error stop output = pack([1, 2], .true.) print*, output if (any(abs(output - [1.00000000, 2.00000000]) > 1e-7)) error stop end program lfortran-0.63.0/integration_tests/intrinsics_330.f900000664000175000017500000000026015174404631022455 0ustar alastairalastairprogram intrinsics_330 print *, amax0(1,2,3) if (amax0(1, 2, 3) /= 3) error stop print *, max1(1.0,2.0,3.0) if (max1(1.0,2.0,3.0) /= 3.0) error stop end programlfortran-0.63.0/integration_tests/arrays_op_26.f900000664000175000017500000000106715174404631022217 0ustar alastairalastairprogram arrays_op_26 implicit none type t real, pointer :: x(:) real, pointer :: y(:) end type t real, target :: X(5), Y(5) type(t) :: t_1 t_1%x => X t_1%y => Y call sub(t_1) print '(f10.2)', X if( any(X /= 2679.00) ) error stop contains subroutine sub(t_1) type(t), intent(inout) :: t_1 real, dimension(size(t_1%x)) :: S integer :: i S = 5 t_1%x = 54 t_1%y = 21 do i = 1, size(t_1%y) t_1%x = t_1%x + t_1%y(i) * S**2 end do end subroutine sub end program arrays_op_26 lfortran-0.63.0/integration_tests/arrays_op_19.f900000664000175000017500000000066715174404631022226 0ustar alastairalastairprogram array_op_19 implicit none real :: x(10, 10), sx(10, 10) x = 2.0 sx = softmax(x) print *, sx if( any(abs(sx - 0.1) > 1e-6) ) error stop contains function softmax(x) result(y) real, intent(in) :: x(:, :) real :: y(size(x, 1), size(x, 2)) integer :: i real :: s do i = 1, size(x, 2) y(:, i) = exp(x(:, i) - maxval(x(:, i))) y(:, i) = y(:, i) / sum(y(:, i)) end do end function end program lfortran-0.63.0/integration_tests/callback_01.f900000664000175000017500000000071015174404631021737 0ustar alastairalastairmodule callback_01 contains real function cb(f, a, b) real, intent(in) :: a, b interface real function f(x) implicit none real, intent(in) :: x end function end interface cb = (b-a) + f(a) + f(b) end function subroutine foo(c, d) real :: c, d print *, cb(f, c, d) contains real function f(x) real, intent(in) :: x f = 2*x end function f end subroutine foo end module program main use callback_01 call foo(1.5, 2.0) end program lfortran-0.63.0/integration_tests/intrinsics_105.f900000664000175000017500000000044615174404631022463 0ustar alastairalastairPROGRAM intrinsics_105 INTEGER, DIMENSION(-1:1, -1:2, -1:10) :: A INTEGER :: result(3) result = shape(A) print*, shape(A) if ( result(1) /= 3 ) error stop if ( result(2) /= 4 ) error stop if ( result(3) /= 12 ) error stop if ( size(shape(42)) /= 0 ) error stop END PROGRAM lfortran-0.63.0/integration_tests/data_04.f900000664000175000017500000000061415174404631021122 0ustar alastairalastairprogram data_04 integer, parameter :: dp = kind(0.d0) double precision dmach(3) data dmach(1) /2.22044604926d-16/ data dmach(2) /2.22507385852d-308/ data dmach(3) /1.79769313485d+308/ print *, dmach if (abs(dmach(1) - 2.22044604926d-16) > 1e-15_dp) error stop if (abs(dmach(2) - 2.22507385852d-308) > 1e-15_dp) error stop if (abs(dmach(3) - 1.79769313485d+308) > 1e-15_dp) error stop end program lfortran-0.63.0/integration_tests/arrays_55.f900000664000175000017500000000053715174404631021524 0ustar alastairalastairprogram arrays_55 implicit none integer, parameter :: N = 10 real :: x(N), y(3) x = 3 y = g(x(:3))+1 if( any(y /= 6.00) ) error stop print *, y contains function g(A) result(r) real, intent(in) :: A(:) real :: r(size(A)) r = A+2 print *, "g(A) called" end function end program lfortran-0.63.0/integration_tests/transfer_08.f900000664000175000017500000000054415174404631022043 0ustar alastairalastairprogram transfer_08 implicit none character(len=:), allocatable :: lhs character(kind=1) :: rhs(3) rhs = ["A", "B", "C"] ! Transfer first 2 characters of rhs into lhs allocate(character(len=2) :: lhs) lhs(1:2) = transfer(rhs(1:2), lhs) print *, "lhs = [", lhs, "]" print *, "rhs = [", rhs, "]" end programlfortran-0.63.0/integration_tests/dcmplx_01.f900000664000175000017500000000166715174404631021506 0ustar alastairalastairprogram dcmplx_01 use, intrinsic :: iso_fortran_env, only: dp => real64 implicit none real(dp) :: x, y complex(dp) :: z ! Use values that require double precision for accurate representation ! These values would lose precision if converted to single precision x = 1.123456789012345d0 y = 2.987654321098765d0 ! Test dcmplx with single real argument z = dcmplx(x) if (abs(real(z, dp) - 1.123456789012345d0) > 1d-15) error stop if (abs(aimag(z)) > 1d-15) error stop ! Test dcmplx with two real arguments z = dcmplx(x, y) if (abs(real(z, dp) - 1.123456789012345d0) > 1d-15) error stop if (abs(aimag(z) - 2.987654321098765d0) > 1d-15) error stop ! Test dconjg z = (1.123456789012345d0, 2.987654321098765d0) z = dconjg(z) if (abs(real(z, dp) - 1.123456789012345d0) > 1d-15) error stop if (abs(aimag(z) + 2.987654321098765d0) > 1d-15) error stop end program dcmplx_01 lfortran-0.63.0/integration_tests/arrays_97.f900000664000175000017500000000226715174404631021534 0ustar alastairalastairmodule arrays_97_tomlf_diagnostic implicit none type toml_label integer :: level end type toml_label type :: toml_diagnostic type(toml_label), allocatable :: label(:) end type toml_diagnostic interface toml_label module procedure new_label end interface toml_label type :: toml_token integer :: kind end type toml_token interface toml_diagnostic module procedure new_diagnostic end interface toml_diagnostic contains pure function new_label(level) result(new) integer, intent(in) :: level type(toml_label) :: new end function new_label pure function new_diagnostic(label) result(new) type(toml_label), intent(in), optional :: label(:) type(toml_diagnostic) :: new end function end module program arrays_97 use arrays_97_tomlf_diagnostic implicit none type(toml_diagnostic), allocatable :: diagnostic call syntax_error(diagnostic) contains subroutine syntax_error(diagnostic) type(toml_diagnostic), allocatable, intent(out) :: diagnostic allocate(diagnostic) diagnostic = toml_diagnostic([toml_label(1)]) print *, "Success!" end subroutine end programlfortran-0.63.0/integration_tests/procedure_pointer_22.f900000664000175000017500000000133315174404631023740 0ustar alastairalastairmodule procedure_pointer_22_mod type :: T procedure(iface), pointer :: ptr => null() end type T abstract interface subroutine iface(self) import; class(T), intent(in) :: self end subroutine end interface type :: W class(T), allocatable :: obj end type W integer :: global_val = 0 end module procedure_pointer_22_mod program procedure_pointer_22 use procedure_pointer_22_mod type(W) :: wr allocate(wr%obj, source = T()) wr%obj%ptr => my_sub call wr%obj%ptr() if (global_val /= 42) error stop print *, global_val contains subroutine my_sub(self) class(T), intent(in) :: self global_val = 42 end subroutine end program procedure_pointer_22 lfortran-0.63.0/integration_tests/fortuno_01.f900000664000175000017500000000207015174404631021700 0ustar alastairalastairmodule fortuno_basetypes implicit none type, abstract :: test_base character(:), allocatable :: name end type test_base type :: test_ptr_item class(test_base), pointer :: item => null() end type test_ptr_item type :: test_list private type(test_ptr_item), pointer :: storage_(:) => null() integer :: nitems = 0 contains procedure :: free => test_list_free end type contains subroutine test_list_free(this) class(test_list), intent(inout) :: this if (associated(this%storage_)) then select type (item => this%storage_(1)%item) class default end select deallocate(this%storage_) end if end subroutine test_list_free end module fortuno_basetypes program fortuno_01 use fortuno_basetypes implicit none type(test_list) :: my_list call my_list%free() print *, "Test list has been freed successfully." end programlfortran-0.63.0/integration_tests/multi_file_member_access_02.f900000664000175000017500000000061115174404631025205 0ustar alastairalastairmodule jstringbuffer implicit none type :: StringBuffer integer, private :: size = 0 contains procedure :: number_of_elems end type StringBuffer contains function number_of_elems(self) result(result) class(StringBuffer), intent(in) :: self integer :: result result = self%size end function end module jstringbuffer program main print *, "OK" end program lfortran-0.63.0/integration_tests/lapack_10.f900000664000175000017500000000161015174404631021436 0ustar alastairalastairprogram lapack_10 implicit none ! Declare LSAMEN for the caller logical :: lsamen character(len=3) :: a, b integer :: n a = 'ABC' b = 'Abc' n = 3 print *, lsamen(n, a, b) end program lapack_10 logical function lsamen(n, ca, cb) implicit none integer, intent(in) :: n character(len=*), intent(in) :: ca, cb integer :: i logical :: lsame external :: lsame lsamen = .false. if (len(ca) < n .or. len(cb) < n) return do i = 1, n if (.not. lsame(ca(i:i), cb(i:i))) return end do lsamen = .true. end function lsamen logical function lsame(a, b) implicit none character(len=*), intent(in) :: a, b ! Case-insensitive comparison of single characters lsame = (iachar(a) == iachar(b) .or. & iachar(a) == iachar(b) + 32 .or. & iachar(a) + 32 == iachar(b)) end function lsame lfortran-0.63.0/integration_tests/submodule_37c.f900000664000175000017500000000063315174404631022362 0ustar alastairalastairsubmodule(submodule_37_mod) submodule_37_sub implicit none contains module procedure create t%val_ = s end procedure module procedure get_val v = self%val_ end procedure module procedure get_int_array v = int(self%get_real_array(mold=[0.])) end procedure module procedure get_real_array allocate(v(3)) read(self%val_, *) v end procedure end submodule submodule_37_sub lfortran-0.63.0/integration_tests/intrinsics_149.f900000664000175000017500000000551515174404631022475 0ustar alastairalastairprogram intrinsics_149 type :: my_type integer :: a end type integer :: vector(2) = [1, 1] logical :: mask(2,2) integer :: field(2,2), unity(2,2) real :: vector_r(6) logical :: mask_r(3,2) real :: field_r(3,2), unity_r(3,2) double precision :: vector_d(6) logical :: mask_d(6) double precision :: field_d(6), unity_d(6) real :: vector_(4) logical :: mask_(4) real :: field_(4), unity_(4) real :: unity__(4) complex :: vector_c(8) logical :: mask_c(2, 4) complex :: field_c(2, 4), unity_c(2, 4) ! ! result: unity matrix integer, parameter :: unity_comp(4) = unpack([1, 2, 3, 4], [.true., .false., .true., .false.], [5, 6, 7, 8]) real, parameter :: unity_comp_r(4) = unpack([23.12, 23.12, 23.12, 23.12], [.false., .true., .true., .false.],& [681.31, 681.31, 681.31, 681.31]) type(my_type), dimension(4) :: struct_field type(my_type), dimension(2) :: struct_vec type(my_type) :: struct_res(4) print *, unity_comp if (sum(unity_comp) /= 17) error stop print*, unity_comp_r print*, sum(unity_comp_r) if (abs(sum(unity_comp_r) - 1408.85999) > 1e-5) error stop field = 0 mask = reshape([.true., .false., .false., .true.], shape(mask)) unity = unpack(vector, mask, field) print *, unity if (sum(unity) /= 2) error stop if (unity(1,1) /= 1) error stop if (unity(2,2) /= 1) error stop vector_r = 23.12 field_r = 681.31 mask_r = reshape([.true., .false., .false., .true., .true., .false.], shape(mask_r)) unity_r = unpack(vector_r, mask_r, field_r) print *, unity_r print *, sum(unity_r) if (abs(sum(unity_r) - 2113.29004) > 1e-8) error stop vector_d = 23.12D0 mask_d = .true. field_r = 681.31D0 unity_d = unpack(vector_d, mask_d, field_d) print *, unity_d print *, sum(unity_d) if (abs(sum(unity_d) - 138.72D0) > 1e-12) error stop print *, unpack([23.12, 23.12, 23.12, 23.12], [.true., .false., .true., .false.], [1.0, 2.0, 3.0, 4.0]) unity__ = unpack([23.12, 23.12, 23.12, 23.12], [.true., .false., .true., .false.], [1.0, 2.0, 3.0, 4.0]) print *, unity__ print *, sum(unity__) if (abs(sum(unity__) - 52.2400017) > 1e-8) error stop vector_ = [23.12, 23.12, 23.12, 23.12] mask_ = [.true., .false., .true., .false.] field_ = [1.0, 2.0, 3.0, 4.0] unity_ = unpack(vector_, mask_, field_) print *, unity_ print *, sum(unity_) if (abs(sum(unity_) - 52.2400017) > 1e-8) error stop vector_c = (23.12, -23.12) mask_c = reshape([.true., .false., .true., .false., .true., .false., .true., .false.], shape(mask_c)) field_c = (1.10, -91.24) unity_c = unpack(vector_c, mask_c, field_c) print *, unity_c print *, abs(sum(unity_c)) if (abs(abs(sum(unity_c)) - 467.586426) > 1e-8) error stop struct_vec(1)%a = 10 struct_vec(2)%a = 20 struct_field = [ my_type(1), my_type(2), my_type(3), my_type(4) ] struct_res = unpack(struct_vec, mask_, struct_field) if (struct_res(1)%a /= 10 .or. struct_res(3)%a /= 20) error stop if (struct_res(2)%a /= 2 .or. struct_res(4)%a /= 4) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_93.f900000664000175000017500000000114615174404631022177 0ustar alastairalastair! Test: sum() intrinsic inside do concurrent with GPU offloading. ! Ensures the sum() call is inlined for the Metal backend. program gpu_metal_93 implicit none real :: a(3), results(2) integer :: b(4), ires(3) integer :: i a = [1.0, 2.0, 3.0] b = [10, 20, 30, 40] do concurrent (i = 1:2) results(i) = sum(a) end do if (abs(results(1) - 6.0) > 1e-6) error stop if (abs(results(2) - 6.0) > 1e-6) error stop do concurrent (i = 1:3) ires(i) = sum(b) end do if (ires(1) /= 100) error stop if (ires(2) /= 100) error stop if (ires(3) /= 100) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/intrinsics_123.f900000664000175000017500000000375115174404631022465 0ustar alastairalastairprogram intrinsics_123 integer(4) :: x, y integer(8) :: i, j integer(4) :: arg_x(5) = [12, -13, 18, 20, 67] integer(4) :: arg_y(5) = [1, 2, 3, 4, 5] integer(8) :: arg_x2(5) = [103, 87, 88, -95, -134] integer(8) :: arg_y2(5) = [11, 12, 4, 0, 10] integer(4) :: res_x(5) integer(8) :: res_x2(5) integer(4), parameter :: res(5) = shiftl([12, -13, 18, 20, 67], [1, 2, 3, 4, 5]) integer(8), parameter :: res2(5) = shiftl([103, 87, 88, -95, -134], [11, 12, 4, 0, 10]) integer(4) :: expected_res(5) = [24, -52, 144, 320, 2144] integer(8) :: expected_res2(5) = [210944, 356352, 1408, -95, -137216] integer(4), parameter :: comp1 = shiftl(12, 1) integer(8), parameter :: comp2 = shiftl(103, 11) print *, comp1 if (comp1 /= 24) error stop print *, comp2 if (comp2 /= 210944) error stop res_x = shiftl(arg_x, arg_y) res_x2 = shiftl(arg_x2, arg_y2) do i = 1, size(res) print *, res(i) if (res(i) /= expected_res(i)) error stop end do do i = 1, size(res2) print *, res2(i) if (res2(i) /= expected_res2(i)) error stop end do do i = 1, size(res_x) print *, res_x(i) if (res_x(i) /= expected_res(i)) error stop end do do i = 1, size(res_x2) print *, res_x2(i) if (res_x2(i) /= expected_res2(i)) error stop end do x = 16 y = 2 i = 8 j = 4 print*, shiftl(10_4, 0) if (.not. shiftl(10_4, 0) == 10) error stop print*, shiftl(-10_8, 1) if ( shiftl(-10_8, 1) /= -20 ) error stop print*, shiftl(not(10_4), 2) if ( shiftl(not(10_4), 2) /= -44 ) error stop print*, shiftl(not(10_8), 3) if ( shiftl(not(10_8), 3) /= -88 ) error stop print*, shiftl(-x, y) if ( shiftl(-x, y) /= -64 ) error stop print*, shiftl(i, j) if ( shiftl(i, j) /= 128 ) error stop print*, shiftl(10, 1) if ( shiftl(10, 1) /= 20 ) error stop print*, shiftl(8, 2) if ( shiftl(8, 2) /= 32 ) error stop end lfortran-0.63.0/integration_tests/bindc_49.f900000664000175000017500000000131415174404631021277 0ustar alastairalastairmodule bindc_49_m use iso_c_binding implicit none type, bind(C) :: handle_t type(c_ptr) :: info = c_null_ptr end type contains function deref(h) result(v) type(handle_t), intent(in) :: h integer(c_int) :: v integer(c_int), pointer :: p call c_f_pointer(h%info, p) v = p end function subroutine use_handle(h, v) bind(C) type(handle_t), value, intent(in) :: h integer(c_int), intent(out) :: v v = deref(h) end subroutine end module program bindc_49 use bindc_49_m implicit none type(handle_t) :: h integer(c_int) :: v integer(c_int), target, save :: d = 42 h%info = c_loc(d) call use_handle(h, v) if (v /= 42) error stop 1 print *, v end program lfortran-0.63.0/integration_tests/select_type_15.f900000664000175000017500000000351315174404631022534 0ustar alastairalastair! Testing nested variable (structType) `ll` module select_type_15 implicit none type, abstract :: abstract_t integer :: i end type type, extends(abstract_t) :: tt integer, allocatable :: arr(:) end type integer, parameter :: CONSTANT_NUMBER = 101 contains subroutine xx(ll_abstract) class(abstract_t), intent(inout) :: ll_abstract call nested1() ! Verify changed `i` value print *, ll_abstract%i if(ll_abstract%i /= -1) ERROR STOP ! Verify changed `arr` value select type(ll_abstract) type is(tt) print *, ll_abstract%arr(10) if(ll_abstract%arr(10) /= -1) error stop class default print *, "Unknown ll type" error stop end select contains subroutine nested1() call ss(ll_abstract) end subroutine nested1 end subroutine xx subroutine ss(ll_abstract) class(abstract_t), intent(inout) :: ll_abstract ! select on type + Check member value + Change it select type(ll_abstract) type is(tt) print *, "This is a tt" PRINT *, "ll_abstract%i =", ll_abstract%i IF(ll_abstract%i /=CONSTANT_NUMBER) ERROR STOP print *, ll_abstract%arr(10) IF(ll_abstract%arr(10) /= 1) error stop ll_abstract%i = -1 ll_abstract%arr(10) = -1 class default print *, "Unknown type" error stop end select end subroutine end module select_type_15 program select_type_15_prog use select_type_15 implicit none type(tt) :: ll ll%i = CONSTANT_NUMBER allocate(ll%arr(10)) ll%arr = 1 call xx(ll) end programlfortran-0.63.0/integration_tests/modules_54.f900000664000175000017500000000063715174404631021673 0ustar alastairalastairmodule module_modules_54 interface func procedure specialFunc end interface func contains function specialFunc() result(value) logical :: value value = .false. end function specialFunc end module module_modules_54 program modules_54 use module_modules_54 implicit none logical :: v v = specialFunc() print *, v if (v) error stop end program modules_54 lfortran-0.63.0/integration_tests/complex_09.f900000664000175000017500000000027415174404631021667 0ustar alastairalastairprogram complex_09 integer :: i = 42 real :: x = 3.14 complex :: z1, z2 z1 = cmplx(i, x) print *, z1, cmplx(x, kind=8) z2 = cmplx(z2, kind=8) end program complex_09lfortran-0.63.0/integration_tests/realloc_lhs_16.f900000664000175000017500000000133615174404631022505 0ustar alastairalastair! Test automatic reallocation with -fdefault-integer-8 ! This triggers the bug where hardcoded i32 constants are multiplied with i64 values program realloc_lhs_16 implicit none real, allocatable :: a(:), b(:), c(:) integer :: i ! Allocate source arrays allocate(a(10), b(10)) do i = 1, 10 a(i) = real(i) b(i) = real(i * 2) end do ! c is NOT allocated - triggers automatic reallocation ! This should compute shape and allocate c to match a + b c = a + b ! Verify result if (size(c) /= 10) error stop if (abs(c(1) - 3.0) > 0.001) error stop if (abs(c(5) - 15.0) > 0.001) error stop if (abs(c(10) - 30.0) > 0.001) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/file_12.f900000664000175000017500000000055415174404631021132 0ustar alastairalastairprogram file_12 implicit none character(1024) :: tmp character(:), allocatable :: sentence1 integer :: u = 11 integer :: ios open(u, file="file_12_data.txt", form="formatted", access="stream", status="old") read(u, "(a)", iostat=ios) tmp sentence1 = trim(tmp) print *, sentence1, ios if (ios == 0) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_195.f900000664000175000017500000000046615174404631022266 0ustar alastairalastairprogram gpu_metal_195 ! Test: do concurrent with non-default lower bound on allocatable arrays implicit none integer, allocatable :: n(:) integer :: r, l allocate(n(0:3)) n = [10, 20, 30, 40] do concurrent(l = 3:3) r = n(l) end do if (r /= 40) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/format_26.f900000664000175000017500000000052615174404631021507 0ustar alastairalastairsubroutine sub2(N,JA) implicit none integer,intent(in) :: N, ja(N) print "(*(1X,I0))",ja end subroutine sub2 program format_26 call sub(2,[42,666]) call sub2(2,[42,666]) contains subroutine sub(N,JA) implicit none integer,intent(in) :: N, ja(:) print "(*(1X,I0))",ja end subroutine sub end program format_26lfortran-0.63.0/integration_tests/arrays_reshape_16.f900000664000175000017500000000305115174404631023222 0ustar alastairalastairprogram arrays_reshape_16 implicit none integer, allocatable :: array_const_1(:, :) integer :: i23_shape(2) = [4, 2] integer :: i23_shape_e(2) real, allocatable :: w(:, :) real :: p(2) allocate(array_const_1(2, 4)) array_const_1 = reshape([-14, 3, 0, -2, 19, 1, 20, 21], [2, 4]) print *, array_const_1(1, :) print *, array_const_1(2, :) array_const_1 = reshape(array_const_1, i23_shape) print *, shape(array_const_1) print *, lbound(array_const_1, 1), ubound(array_const_1, 1) print *, lbound(array_const_1, 2), ubound(array_const_1, 2) print *, size(array_const_1, 1), size(array_const_1, 2) if( lbound(array_const_1, 1) /= 1 ) error stop if( ubound(array_const_1, 1) /= 4 ) error stop if( lbound(array_const_1, 2) /= 1 ) error stop if( ubound(array_const_1, 2) /= 2 ) error stop if( size(array_const_1, 1) /= 4 ) error stop if( size(array_const_1, 2) /= 2 ) error stop i23_shape_e = shape(array_const_1) if( i23_shape_e(1) /= 4 ) error stop if( i23_shape_e(2) /= 2 ) error stop print *, array_const_1(1, :) print *, array_const_1(2, :) print *, array_const_1(3, :) print *, array_const_1(4, :) if( array_const_1(1, 1) /= -14 ) error stop if( array_const_1(1, 2) /= 19 ) error stop if( array_const_1(2, 1) /= 3 ) error stop if( array_const_1(2, 2) /= 1 ) error stop if( array_const_1(3, 1) /= 0 ) error stop if( array_const_1(3, 2) /= 20 ) error stop if( array_const_1(4, 1) /= -2 ) error stop if( array_const_1(4, 2) /= 21 ) error stop allocate(w(2, 1)) w = reshape([1.0, 2.0], [2, 1]) p(1:2) = reshape(w, [2]) if (p(1) /= 1.0 .or. p(2) /= 2.0) error stop end program lfortran-0.63.0/integration_tests/read_12.f900000664000175000017500000000105515174404631021123 0ustar alastairalastairprogram read_12 implicit none complex :: z4 complex(8) :: z8 open(10, file='_read_12_test.dat', status='replace') write(10, *) (1.0, 2.0) write(10, *) (3.0d0, 4.0d0) close(10) open(10, file='_read_12_test.dat', status='old') read(10, *) z4 read(10, *) z8 close(10, status='delete') if (abs(real(z4) - 1.0) > 1e-5) error stop if (abs(aimag(z4) - 2.0) > 1e-5) error stop if (abs(real(z8) - 3.0d0) > 1d-10) error stop if (abs(aimag(z8) - 4.0d0) > 1d-10) error stop print *, "OK" end program lfortran-0.63.0/integration_tests/gpu_metal_03.f900000664000175000017500000000122615174404631022165 0ustar alastairalastairprogram gpu_metal_03 ! 3D do concurrent: volume initialization implicit none integer, parameter :: nx = 32, ny = 32, nz = 32 real :: vol(nx, ny, nz), vol_expected(nx, ny, nz) integer :: i, j, k do k = 1, nz do j = 1, ny do i = 1, nx vol_expected(i, j, k) = real(i) + real(j) * 2.0 + real(k) * 3.0 end do end do end do do concurrent (i = 1:nx, j = 1:ny, k = 1:nz) vol(i, j, k) = real(i) + real(j) * 2.0 + real(k) * 3.0 end do do k = 1, nz do j = 1, ny do i = 1, nx if (abs(vol(i, j, k) - vol_expected(i, j, k)) > 1.0e-5) error stop end do end do end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/format_10.f900000664000175000017500000000045715174404631021503 0ustar alastairalastairprogram format_10 implicit none integer :: n, i integer, parameter :: grid_size = 3 real :: h(grid_size) character(*), parameter :: fmt = '(i0,*(1x,es15.8e2))' h = 1 n = 3 print fmt, n, h do i = 1, grid_size if (abs(h(i) - 1.0) > 1e-9) error stop end do if (n /= 3) error stop end program format_10 lfortran-0.63.0/integration_tests/legacy_array_sections_04.f900000664000175000017500000000023215174404631024556 0ustar alastairalastairprogram legacy_array_sections_04 real :: afb(4) external :: sub afb = [ 1., 2., 3., 4. ] call sub(afb( 2 )) call sub(afb) end program lfortran-0.63.0/integration_tests/openmp_54.f900000664000175000017500000000165715174404631021524 0ustar alastairalastairprogram openmp_54 use omp_lib implicit none integer, parameter :: N = 1000 integer :: i, tid integer :: total_sum integer :: partial_sum !$omp parallel shared(total_sum) private(i, partial_sum, tid) tid = omp_get_thread_num() partial_sum = 0 total_sum = 0 !$omp barrier !$omp do do i = 1, N partial_sum = partial_sum + i end do !$omp end do ! Critical update to the shared total_sum !$omp critical total_sum = total_sum + partial_sum print *, "Thread ", tid, " added partial_sum ", partial_sum !$omp end critical !$omp barrier !$omp single if (total_sum /= N*(N+1)/2) then print *, "ERROR: total_sum = ", total_sum, " expected = ", N*(N+1)/2 error stop else print *, "Success! total_sum = ", total_sum end if !$omp end single !$omp end parallel end program openmp_54lfortran-0.63.0/integration_tests/select_rank_23.f900000664000175000017500000000100315174404631022475 0ustar alastairalastairprogram select_rank_23 implicit none real :: val val = 3.14 call test_sub(val) if (abs(val - 42.0) > 1.0e-5) error stop contains subroutine test_sub(x, y) class(*), dimension(..), intent(inout) :: x real, optional, intent(in) :: y select rank(x) rank(0) select type(x) type is (real) x = 42.0 end select end select if (present(y)) print *, y end subroutine end program select_rank_23 lfortran-0.63.0/integration_tests/transfer_02.f900000664000175000017500000000052215174404631022031 0ustar alastairalastairprogram transfer_02 integer :: result double precision :: d complex :: result1 real :: r d = 3.14D0 result = transfer(d, result) print *, result if (result /= 1374389535) error stop r = 1.0 result1 = transfer(r, result1) print *, result1 if( real(result1) /= 1.0 ) error stop end program lfortran-0.63.0/integration_tests/arrays_36.f900000664000175000017500000000055715174404631021525 0ustar alastairalastairprogram arrays_36 use iso_fortran_env, only: int16 integer(int16), allocatable :: result(:) integer(int16) :: start_, end_, step_ integer(int16) :: i allocate(result(10)) start_ = 1_int16 end_ = 10_int16 result = [(i, i=start_, end_)] print *, result i = 1_int16 do while (i <= 10_int16) if (result(i) /= i) error stop i = i + 1_int16 end do end program lfortran-0.63.0/integration_tests/parameter_13.f900000664000175000017500000000104015174404631022163 0ustar alastairalastairprogram parameter_13 implicit none integer, parameter :: N = 65535 integer, parameter :: sp = kind(1.0) integer, parameter :: dp = kind(1.d0) real(dp), parameter :: pi = 2*asin(1._dp) real(dp), parameter :: a = 0, b = pi real(dp), parameter :: dx = (b-a)/N integer :: i real(dp), parameter :: X(*) = [(sin(a+(b-a)*i/N), i = 1, N)] real(dp), parameter :: S = sum(X)*dx logical, parameter :: l = S < 2 real(kind=merge(sp, dp, l)) :: y if (kind(y) /= sp) error stop print *, S if (abs(S - 1.9999999996170159_dp) > 1e-15_dp) error stop end program lfortran-0.63.0/integration_tests/format_60.f900000664000175000017500000000071515174404631021505 0ustar alastairalastairprogram format_60 implicit none character(4) :: s1, s2, s3 open (10, file='format_60_tmp.txt', form='formatted', status='unknown') write (10, '(a)') 'abcd' write (10, '(a)') 'wxyz1234' rewind (10) s1 = '(no)'; s2 = '(no)'; s3 = '(no)' read (10, '(a4/2a4)') s1, s2, s3 if (s1 /= 'abcd') error stop if (s2 /= 'wxyz') error stop if (s3 /= '1234') error stop close (10, status='delete') end program format_60 lfortran-0.63.0/integration_tests/string_97.f900000664000175000017500000000035015174404631021530 0ustar alastairalastairprogram string_97 implicit none character(len=1), dimension(3) :: b print "(3(1X,A))", transfer('abc', ['x']) b = transfer('abc', b) if (any(b /= ['a','b','c'])) error stop 'Test failed' end program string_97 lfortran-0.63.0/integration_tests/test_ord.f900000664000175000017500000000074215174404631021533 0ustar alastairalastair! Testing Python's ord intrinsic ! -- Example -- ! i: i32 ! s = "x" ! i = ord(s) # Equivalent in LFortran is `lfortran_ord()` program test_ord implicit none if (_lfortran_ord("H") /= 72) error stop if (_lfortran_ord("c") /= 99) error stop if (_lfortran_ord("1") /= 49) error stop character(len=:), allocatable :: x x = "Hello,World" if (_lfortran_ord(x(1:1)) /= 72) error stop if (_lfortran_ord(x(6:6)) /= 44) error stop end program test_ord lfortran-0.63.0/integration_tests/intrinsics_28.f900000664000175000017500000000054015174404631022402 0ustar alastairalastairprogram debug implicit none integer, parameter :: a = 10, b = -20, c = 30 integer, parameter :: d = -40, e = 0, f = 50 if (min(a, b, c, d, e, f) /= -40) error stop if (max(a, b, c, d, e, f) /= 50) error stop if (max(a, b) /= 10) error stop if (min(a, b) /= -20) error stop if (max(a, b, c) /= 30) error stop end program lfortran-0.63.0/integration_tests/entry_10.f900000664000175000017500000000106015174404631021343 0ustar alastairalastairSUBROUTINE dinvr(x) IMPLICIT NONE DOUBLE PRECISION x DOUBLE PRECISION big,small,zx,zy,zz, zsmall, zbig LOGICAL qcond INTRINSIC abs,max,min LOGICAL qxmon SAVE qxmon(zx,zy,zz) = zx .LE. zy .AND. zy .LE. zz qcond = .NOT. qxmon(small,x,big) print *, "small = ", small print *, "x = ", x print *, "big = ", big print *, 'qcond = ', qcond IF (qcond) error stop entry distinv(zsmall, zbig) small = -1.6d0 big = 1.9d0 return end subroutine program entry_10 implicit none double precision :: x x = 0.5d0 call distinv(0.0d0, 1.0d0) call dinvr(x) end program lfortran-0.63.0/integration_tests/c_ptr_14.f900000664000175000017500000000055515174404631021325 0ustar alastairalastairprogram test_single_ptr_value use iso_c_binding implicit none integer, target :: x integer, pointer :: fptr type(c_ptr), dimension(1) :: ptr_array x = 7 ptr_array = [c_null_ptr] ptr_array(1) = c_loc(x) call c_f_pointer(ptr_array(1), fptr) print *, fptr if (fptr /= 7) error stop end program test_single_ptr_value lfortran-0.63.0/integration_tests/functions_09.f900000664000175000017500000000115715174404631022231 0ustar alastairalastairmodule stdlib_quadrature_simps interface simps38_weights module procedure simps38_weights_dp end interface simps38_weights contains function simps38_weights_dp(x) result(w) real(8), intent(in) :: x(4) real(8) :: w(size(x)) end function simps38_weights_dp subroutine simps38_weights_dp_use(x1) real(8), intent(in) :: x1(4) print *, simps38_weights(x1) end subroutine simps38_weights_dp_use end module program stdlib_quadrature use stdlib_quadrature_simps, only: simps38_weights_dp implicit none real(8) :: x1(4) print *, simps38_weights_dp(x1) end program lfortran-0.63.0/integration_tests/string_01.f900000664000175000017500000000017015174404631021511 0ustar alastairalastairprogram print_01 implicit none character(len = 7) :: my_name = 'Dominic' print *, 'My name is ', my_name end program lfortran-0.63.0/integration_tests/string_06.f900000664000175000017500000000073715174404631021527 0ustar alastairalastairprogram string_06 character(*), parameter :: s1 = " A B ", s2 = " " if (len_trim(s1) /= 4) error stop if (len_trim(s2) /= 0) error stop if (len_trim(" ") /= 0) error stop if (len_trim("") /= 0) error stop if (len_trim("xx") /= 2) error stop contains integer elemental function len_trim(string) result(r) character(len=*), intent(in) :: string r = len(string) if (r == 0) return do while(string(r:r) == " ") r = r - 1 if (r == 0) exit end do end function end program lfortran-0.63.0/integration_tests/intrinsics_155.f900000664000175000017500000000443515174404631022472 0ustar alastairalastairprogram intrinsics_155 logical, parameter :: l1 = bgt(10, 5) logical, parameter :: l2 = bgt(10_8, -5_8) integer :: k1 = 10 integer :: k2 = 5 integer :: k3 = -5 integer :: k4 = 15 integer :: k5 = 0 integer :: k6 = -15 logical :: t = .true. logical, parameter :: ar1(4) = bgt([1, 2, 4, 5], 3) logical, parameter :: ar2(4) = bgt([-1, 3, -7, 5], -3) integer :: arr1(4) integer :: arr2(3) logical :: res(3) arr1 = [11, 2, 13, 4] arr2 = [-5_8, 7_8, 0_8] print *, l1 if (l1 .neqv. .true.) error stop print *, l2 if (l2 .neqv. .false.) error stop print *, ar1 if (any(ar1) .neqv. .true.) error stop print *, ar2 if (any(ar2) .neqv. .true.) error stop print*, bgt(10, 5) if (bgt(10, 5) .neqv. .true.) error stop print*, bgt(-5, 10) if (bgt(-5, 10) .neqv. .true.) error stop print*, bgt(-5, 5) if (bgt(-5, 5) .neqv. .true.) error stop print*, bgt(-5, -15) if (bgt(-5, -15) .neqv. .true.) error stop print*, bgt(5, 15) if (bgt(5, 15) .neqv. .false.) error stop print*, bgt(5, -15) if (bgt(5, -15) .neqv. .false.) error stop print*, bgt(0, -5) if (bgt(0, -5) .neqv. .false.) error stop print*, bgt(0, 5) if (bgt(0, 5) .neqv. .false.) error stop print*, bgt(-5, 0) if (bgt(-5, 0) .neqv. .true.) error stop print*, bgt(5, 0) if (bgt(5, 0) .neqv. t) error stop print*, bgt(k1, k2) if (bgt(k1, k2) .neqv. .true.) error stop print*, bgt(k3, k1) if (bgt(k3, k1) .neqv. .true.) error stop print*, bgt(k3, k3) if (bgt(k3, k3) .neqv. .false.) error stop print*, bgt(k3, k6) if (bgt(k3, k6) .neqv. .true.) error stop print*, bgt(k2, k4) if (bgt(k2, k4) .neqv. .false.) error stop print*, bgt(k2, k6) if (bgt(k2, k6) .neqv. .false.) error stop print*, bgt(k5, k3) if (bgt(k5, k3) .neqv. .false.) error stop print*, bgt(k5, k2) if (bgt(k5, k2) .neqv. .false.) error stop print*, bgt(k3, k5) if (bgt(k3, k5) .neqv. .true.) error stop print*, bgt(k2, k5) if (bgt(k2, k5) .neqv. t) error stop print *, bgt(arr1, 5) if (any(bgt(arr1, 5) .neqv. .true.) .neqv. .true.) error stop res = bgt(arr2, k5) print *, res if (any(res .neqv. .true.) .neqv. .true.) error stop end programlfortran-0.63.0/integration_tests/implied_do_loops22.f900000664000175000017500000000157015174404631023375 0ustar alastairalastairprogram implied_do_loops22 ! Test: nested implied do loops in array constructors with derived types implicit none type :: point_t real :: x, y end type type(point_t) :: pts(1) type(point_t) :: grid(4) integer :: i, j ! Nested implied do loop with derived type constructor pts = [( [(point_t(real(i), real(j)), j=1,1)], i=1,1)] if (abs(pts(1)%x - 1.0) > 1e-6) error stop if (abs(pts(1)%y - 1.0) > 1e-6) error stop ! Larger nested implied do loop grid = [( [(point_t(real(i), real(j)), j=1,2)], i=1,2)] if (abs(grid(1)%x - 1.0) > 1e-6) error stop if (abs(grid(1)%y - 1.0) > 1e-6) error stop if (abs(grid(2)%x - 1.0) > 1e-6) error stop if (abs(grid(2)%y - 2.0) > 1e-6) error stop if (abs(grid(3)%x - 2.0) > 1e-6) error stop if (abs(grid(3)%y - 1.0) > 1e-6) error stop if (abs(grid(4)%x - 2.0) > 1e-6) error stop if (abs(grid(4)%y - 2.0) > 1e-6) error stop print *, "OK" end program lfortran-0.63.0/integration_tests/string_30.f900000664000175000017500000000574015174404631021523 0ustar alastairalastairmodule stdlib_string_type implicit none private public :: string_type public :: operator(//) type :: string_type private character(len=:), allocatable :: raw end type string_type interface operator(//) module procedure :: concat_string_string module procedure :: concat_string_char module procedure :: concat_char_string end interface operator(//) contains elemental function concat_string_string(lhs, rhs) result(string) type(string_type), intent(in) :: lhs type(string_type), intent(in) :: rhs type(string_type) :: string end function concat_string_string elemental function concat_string_char(lhs, rhs) result(string) type(string_type), intent(in) :: lhs character(len=*), intent(in) :: rhs type(string_type) :: string end function concat_string_char elemental function concat_char_string(lhs, rhs) result(string) character(len=*), intent(in) :: lhs type(string_type), intent(in) :: rhs type(string_type) :: string end function concat_char_string end module stdlib_string_type module stdlib_ansi use stdlib_string_type, only : string_type implicit none private public :: ansi_code public :: to_string, operator(//) public :: concat_left_str, concat_right_str type :: ansi_code private integer(1) :: style = -1_1 integer(1) :: bg = -1_1 integer(1) :: fg = -1_1 end type ansi_code interface to_string pure module function to_string_ansi_code(code) result(str) type(ansi_code), intent(in) :: code character(len=:), allocatable :: str end function to_string_ansi_code end interface to_string interface operator(//) pure module function concat_left_str(lval, code) result(str) type(string_type), intent(in) :: lval type(ansi_code), intent(in) :: code type(string_type) :: str end function concat_left_str pure module function concat_right_str(code, rval) result(str) type(string_type), intent(in) :: rval type(ansi_code), intent(in) :: code type(string_type) :: str end function concat_right_str end interface operator(//) end module stdlib_ansi submodule (stdlib_ansi) stdlib_ansi_operator use stdlib_string_type, only : operator(//) implicit none contains pure module function concat_left_str(lval, code) result(str) type(string_type), intent(in) :: lval type(ansi_code), intent(in) :: code type(string_type) :: str str = lval // to_string(code) end function concat_left_str pure module function concat_right_str(code, rval) result(str) type(string_type), intent(in) :: rval type(ansi_code), intent(in) :: code type(string_type) :: str str = to_string(code) // rval end function concat_right_str end submodule stdlib_ansi_operator lfortran-0.63.0/integration_tests/implied_do_loops7.f900000664000175000017500000000247615174404631023326 0ustar alastairalastairprogram implied_do_loops7 implicit none integer, parameter :: max_ij = 13, max_sum = 2 * max_ij ** 3 integer :: i, j integer, parameter :: x1(*) = [((i**3+j**3, i = 1,j), j = 1,max_ij)] real, parameter :: x2(*) = [((i*3.5 + j**2.5, i = 1,j), j = 1,max_ij)] logical, parameter :: x3(*) = [(((i + 2) > j, i = 1,j), j = 1,max_ij)] logical, parameter :: x4(*) = [(((i*2.5) > (j*1.5), i = 1,j), j = 1,max_ij)] !Character Implied Do Loop Test with Parameter Array character(len=2),parameter :: char_array(2) = (/(('AB'), i=1,2) /) !Check variable length character array assignment character(len=10),parameter :: char_array2(2) = (/(('ABCDEFGH'), i=1,2) /) character(len=2),parameter :: char_array3(2) = (/(('ABCDEFGH'), i=1,2) /) print *, sum(x1) print *, sum(x2) print *, count(x3) print *, count(x4) print *, char_array print *, char_array2, char_array3 if (sum(x1) /= 115934) error stop if (abs(sum(x2) - 28614.8848) > 10e-12) error stop if (count(x3) /= 25) error stop if (count(x4) /= 42) error stop if (char_array(1) /= 'AB' .or. char_array(2) /= 'AB') error stop if (char_array2(1) /= 'ABCDEFGH' .or. char_array2(2) /= 'ABCDEFGH') error stop if (char_array3(1) /= 'AB' .or. char_array3(2) /= 'AB') error stop end program implied_do_loops7lfortran-0.63.0/integration_tests/associate_45.f900000664000175000017500000000072015174404631022167 0ustar alastairalastairprogram associate_45 implicit none logical, target :: l(3) class(*), pointer :: generic(:) class(*), pointer :: generic2(:) l = [.true., .false., .true.] generic => l generic => l !intentionally associate twice to check memory leaks generic2 => l generic2 => l !intentionally associate twice to check memory leaks print *, associated(generic, generic2) if (.not. associated(generic, generic2)) error stop end programlfortran-0.63.0/integration_tests/legacy_array_sections_09.f900000664000175000017500000000117515174404631024572 0ustar alastairalastairprogram legacy_array_sections_09 implicit none integer :: n, lwa real, allocatable :: wa(:) n = 3 lwa = 10 allocate(wa(lwa)) wa = 0.0 call caller(n, lwa, wa) contains subroutine callee(n, diag) implicit none integer, intent(in) :: n real, intent(inout) :: diag(n) diag = diag end subroutine callee subroutine caller(n, lwa, wa) implicit none integer, intent(in) :: n integer, intent(in) :: lwa real, intent(inout) :: wa(lwa) call callee(n, wa(1)) end subroutine caller end program legacy_array_sections_09 lfortran-0.63.0/integration_tests/read_34.f900000664000175000017500000000073115174404631021127 0ustar alastairalastairprogram read_fmt_tabs implicit none character(*), parameter :: infmt = '(I6, T1, I6, TL6, I6, TL9, I6, t1, tr2, i3)' integer :: i, ia(5) integer :: iounit open (newunit=iounit, file='fort.data', form='formatted') write (iounit,'(a)') '12345' rewind (iounit) ia = -42 read (iounit, infmt) (ia(i), i=1, 5) if (.not. all(ia(1:4) == 12345)) error stop if (ia(5) /= 345) error stop close (iounit) print *, "all tests passed" end program read_fmt_tabs lfortran-0.63.0/integration_tests/iachar_achar_01.f900000664000175000017500000000026115174404631022571 0ustar alastairalastairprogram iachar_achar_01 implicit none if (iachar(achar(0)) /= 0) error stop if (iachar(achar(65)) /= 65) error stop if (achar(65) /= 'A') error stop end program lfortran-0.63.0/integration_tests/write_13.f900000664000175000017500000000055515174404631021347 0ustar alastairalastair! Test writes into substrings inside FileWrite Nodes program write_13 implicit none character(10):: string = 'ABCDEFGHIJ' character(len=5) :: string2 write(string2(1:),'(a)') "Hello" write(string(1:4),'(A)') 'abcd' print *, string, string2 if (string/='abcdEFGHIJ') error stop if (string2/='Hello') error stop end program write_13lfortran-0.63.0/integration_tests/infer_walrus_shadow_01.f900000664000175000017500000000034615174404631024255 0ustar alastairalastairprogram infer_walrus_shadow_01 implicit none x := 5 if (x /= 5) error stop block x := "hello" if (x /= "hello") error stop end block if (x /= 5) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/namelist_27.f900000664000175000017500000000160315174404631022031 0ustar alastairalastairprogram namelist_27 ! Test for handling triple-quoted strings (doubled quotes within strings) implicit none character(len=128) :: args namelist /expected/ args character(len=256) :: readme(3) args = '' readme(1) = '&EXPECTED' readme(2) = ' ARGS="""arg1"" ""-x"" ""and a long one"""' readme(3) = ' /' read(readme, nml=expected) print *, 'OK:', trim(args) if (trim(args) /= '"arg1" "-x" "and a long one"') then error stop 'Incorrect ARGS value read' end if ! Test with single quotes args = '' readme(1) = '&EXPECTED' readme(2) = " ARGS='''arg1'' ''-x'' ''and a long one'''" readme(3) = ' /' read(readme, nml=expected) print *, 'OK:', trim(args) if (trim(args) /= "'arg1' '-x' 'and a long one'") then error stop 'Incorrect ARGS value read with single quotes' end if end program namelist_27 lfortran-0.63.0/integration_tests/pass_array_by_data_02.f900000664000175000017500000000100115174404631024025 0ustar alastairalastairprogram main implicit none real :: data_x(3) = [1.0, 2.0, 3.0] call find_fit(data_x, expr) if ( abs(data_x(1) - 1.0) > 1e-16 ) error stop if ( abs(data_x(2) - 2.0) > 1e-16 ) error stop if ( abs(data_x(3) - 3.0) > 1e-16 ) error stop print *, data_x contains subroutine find_fit(data_x, expr) real, intent(in) :: data_x(:) interface function expr() result(z) real :: z end function expr end interface end subroutine find_fit function expr() result(y) real :: y end function expr end program main lfortran-0.63.0/integration_tests/allocatable_dummy_descriptor_01.f900000664000175000017500000000151715174404631026125 0ustar alastairalastairprogram allocatable_dummy_descriptor_01 implicit none type :: item_t integer :: s end type item_t type :: container_t type(item_t), allocatable :: list(:) end type container_t type(item_t), allocatable :: src(:) type(container_t), allocatable :: containers(:) allocate(src(1)) src(1)%s = 123 allocate(containers(1)) call get_list(src, containers(1)%list) if (.not. allocated(containers(1)%list)) error stop if (size(containers(1)%list) /= 1) error stop if (containers(1)%list(1)%s /= 123) error stop contains subroutine get_list(src, list) type(item_t), allocatable, intent(in) :: src(:) type(item_t), allocatable, intent(out) :: list(:) if (.not. allocated(src)) return allocate(list(size(src))) list = src end subroutine get_list end program allocatable_dummy_descriptor_01 lfortran-0.63.0/integration_tests/custom_operator_16.f900000664000175000017500000000154615174404631023446 0ustar alastairalastairmodule custom_operator_16_mod implicit none type :: scalar_t integer :: val end type type :: vector_t integer :: val contains generic :: operator(.x.) => weighted_premultiply procedure, pass(self) :: weighted_premultiply end type contains pure function weighted_premultiply(s, self) result(res) type(scalar_t), intent(in) :: s class(vector_t), intent(in) :: self integer :: res res = s%val * self%val end function end module program custom_operator_16 use custom_operator_16_mod implicit none type(scalar_t) :: f type(vector_t) :: v integer :: result f = scalar_t(3) v = vector_t(4) ! Operator .x. is defined on vector_t (RHS), not scalar_t (LHS) result = f .x. v if (result /= 12) error stop f = scalar_t(5) v = vector_t(7) result = f .x. v if (result /= 35) error stop end program lfortran-0.63.0/integration_tests/transfer_24.f900000664000175000017500000000213315174404631022035 0ustar alastairalastairprogram transfer_24 use iso_fortran_env, only: int8, int64, real32 implicit none integer(int8), target :: key(8) integer(int8), pointer :: key_ptr(:) integer(int64) :: c_ptr, c_arr real(real32), target :: rvals(2) real(real32), pointer :: rptr(:) integer(int64) :: r_bits_ptr, r_bits_arr character(1), target :: chars(8) character(1), pointer :: chars_ptr(:) integer(int64) :: ch_bits_ptr, ch_bits_arr key = [ -6_int8, -40_int8, 1_int8, 0_int8, -12_int8, -79_int8, 3_int8, 0_int8 ] key_ptr => key c_ptr = 1_int64 + transfer(key_ptr, 0_int64) c_arr = 1_int64 + transfer(key, 0_int64) if (c_ptr /= c_arr) error stop rvals = [ 1.25_real32, -2.75_real32 ] rptr => rvals r_bits_ptr = transfer(rptr, 0_int64) r_bits_arr = transfer(rvals, 0_int64) if (r_bits_ptr /= r_bits_arr) error stop chars = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' ] chars_ptr => chars ch_bits_ptr = transfer(chars_ptr, 0_int64) ch_bits_arr = transfer(chars, 0_int64) if (ch_bits_ptr /= ch_bits_arr) error stop end program transfer_24 lfortran-0.63.0/integration_tests/where_10.f900000664000175000017500000000502315174404631021317 0ustar alastairalastairprogram where_10 implicit none real, parameter :: zero = 0.0 integer :: i real :: first_array(1, 4) integer :: second_array(2, 4) logical :: third_array(2, 4) real :: first_output(1, 4) integer :: second_output(2, 4) logical :: third_output(2, 4) first_array = reshape([0.0, 1.0, 0.0, 1.0], [1, 4]) second_array = reshape([1, 2, 0, 4, 5, 0, 7, 0], [2, 4]) third_array = reshape([.false., .true., .true., .true., .false., .true., .false., .true.], [2, 4]) where (first_array(1, :) == zero) first_array(1, :) = 2.0 end where print *, first_array first_output = reshape([2.0, 1.0, 2.0, 1.0], [1, 4]) if (all(first_array /= first_output)) error stop where (second_array(:, 4) /= 0) second_array(:, 4) = 22 end where print *, second_array second_output = reshape([1, 2, 0, 4, 5, 0, 22, 0], [2, 4]) if (all(second_array /= second_output)) error stop i = 1 where (first_array(i, :) > 1.0) first_array(i, :) = 22.0 end where print *, first_array first_output = reshape([22.0, 1.0, 22.0, 1.0], [1, 4]) if (all(first_array /= first_output)) error stop where (third_array(2, :)) second_array(2, :) = 1 end where print *, second_array second_output = reshape([1, 1, 0, 1, 5, 1, 22, 1], [2, 4]) if (all(second_array /= second_output)) error stop where (third_array(2, :) .neqv. .false.) third_array(2, :) = .false. end where print *, third_array third_output = reshape([.false., .false., .true., .false., .false., .false., .false., .false.], [2, 4]) if (all(third_array .neqv. third_output)) error stop ! Assignment like: ! first_array(1, :) = first_array(1, :) + 1 ! is currently not supported inside the `WHERE` clause. ! ! Uncomment after supporting the above: ! ! where (first_array(1, :) > 1.0) ! first_array(1, :) = first_array(1, :) + 1 ! end where ! ! print *, first_array ! first_output = reshape([3.0, 1.0, 3.0, 1.0], [1, 4]) ! if (all(first_array /= first_output)) error stop ! ! ========================================================= ! ! Array section expressions like second_array(:, :) ! is currently not supported inside `WHERE` clause. ! ! Uncomment after supporting the above: ! ! where (second_array(:, :) /= 0) ! second_array(:, :) = 10 ! end where ! ! print *, second_array ! second_output = reshape([10, 10, 0, 10, 10, 0, 10, 0], [2, 4]) ! if (all(second_array /= second_output)) error stop end program where_10lfortran-0.63.0/integration_tests/subroutines_16.f900000664000175000017500000000145315174404631022600 0ustar alastairalastairmodule recursive_mod_subroutines_16 contains subroutine recursive_fun1(x, f) implicit none real(8), intent(in) :: x(:) real(8), intent(out) :: f end subroutine recursive_fun1 end module recursive_mod_subroutines_16 module test_solver_mod_subroutines_16 contains subroutine test_solver() contains subroutine temp(rec) use recursive_mod_subroutines_16 procedure(recursive_fun1) :: rec end subroutine subroutine recursive_fun2() use, non_intrinsic :: recursive_mod_subroutines_16, only : recursive_fun1 call temp(recursive_fun1) end subroutine recursive_fun2 end subroutine test_solver end module test_solver_mod_subroutines_16 program subroutines_16 use test_solver_mod_subroutines_16 end program lfortran-0.63.0/integration_tests/warning_integerstar.f900000664000175000017500000000013315174404631023756 0ustar alastairalastairprogram warning_integerstar integer*4 a integer*8 b end program warning_integerstarlfortran-0.63.0/integration_tests/test_ieee_nan_value.f900000664000175000017500000000432015174404631023702 0ustar alastairalastairprogram test_ieee_nan_value use ieee_arithmetic use iso_fortran_env, only: int32, int64, real32, real64 implicit none real(real64) :: dp_snan, dp_qnan real(real32) :: sp_qnan integer(int64) :: ibits64 integer(int32) :: ibits32 real(real64) :: dpnan(2) integer(int32) :: transfer_result(2) ! Double-precision signaling NaN bit pattern (matches gfortran) dp_snan = ieee_value(1.0_real64, ieee_signaling_nan) transfer_result = transfer(dp_snan, [1]) if (transfer_result(1) /= 0) & error stop "dp snan low word mismatch" if (transfer_result(2) /= 2146697216) & error stop "dp snan high word mismatch" ! Double-precision quiet NaN bit pattern dp_qnan = ieee_value(1.0_real64, ieee_quiet_nan) ibits64 = transfer(dp_qnan, 0_int64) if (ibits64 /= int(z'7FF8000000000000', int64)) & error stop "dp quiet NaN bit pattern mismatch" ! Single-precision quiet NaN bit pattern sp_qnan = ieee_value(1.0_real32, ieee_quiet_nan) ibits32 = transfer(sp_qnan, 0_int32) if (ibits32 /= int(z'7FC00000', int32)) & error stop "sp quiet NaN bit pattern mismatch" ! Transfer double to int32 array (tests byte reinterpretation) dp_qnan = ieee_value(1.0_real64, ieee_quiet_nan) transfer_result = transfer(dp_qnan, [1]) if (transfer_result(1) /= 0) & error stop "transfer qnan low word mismatch" if (transfer_result(2) /= 2146959360) & error stop "transfer qnan high word mismatch" ! Transfer known double (1.0d0) to int32 array transfer_result = transfer(1.0_real64, [1]) if (transfer_result(1) /= 0) & error stop "transfer 1.0d0 low word mismatch" if (transfer_result(2) /= 1072693248) & error stop "transfer 1.0d0 high word mismatch" ! Array constructor with ieee_value dpnan = ieee_value(dpnan, [ieee_signaling_nan, ieee_quiet_nan]) if (.not. ieee_is_nan(dpnan(1))) & error stop "dpnan(1) should be NaN" if (.not. ieee_is_nan(dpnan(2))) & error stop "dpnan(2) should be NaN" ibits64 = transfer(dpnan(2), 0_int64) if (ibits64 /= int(z'7FF8000000000000', int64)) & error stop "array ieee_value qnan mismatch" end program test_ieee_nan_value lfortran-0.63.0/integration_tests/intrinsics_02.f900000664000175000017500000000056615174404631022402 0ustar alastairalastairprogram intrinsics_02 real :: x = sin(1.5) real(8) :: y y = sin(1.5) print *, x, y if (abs(x - 0.997494996) > 1.e-6) error stop if (abs(sin(x) - 0.840114892) > 1.e-6) error stop if (abs(y - 0.997494995) > 1e-7) error stop if (abs(sin(sin(1.5) + sin(0.5+sin(0.5))) - 0.967188418) > 1e-7) error stop if (abs(sin(sin(y) + sin(x+sin(x))) - 0.97276188) > 1e-7) error stop end lfortran-0.63.0/integration_tests/submodule_39b.f900000664000175000017500000000127515174404631022366 0ustar alastairalastairmodule input_output_pair_m implicit none type input_output_pair_t(k) integer, kind :: k = kind(1.0) real(k) :: input end type input_output_pair_t end module input_output_pair_m module mini_batch_m use input_output_pair_m, only : input_output_pair_t implicit none type mini_batch_t(k) integer, kind :: k = kind(1.0) type(input_output_pair_t(k)), allocatable :: input_output_pairs(:) end type mini_batch_t interface pure module function make_batch(input_output_pairs) result(mini_batch) type(input_output_pair_t), intent(in) :: input_output_pairs(:) type(mini_batch_t) :: mini_batch end function make_batch end interface end module mini_batch_m lfortran-0.63.0/integration_tests/format_84.f900000664000175000017500000000170215174404631021510 0ustar alastairalastairprogram format_84 implicit none real(8), parameter :: x = 1.23456789012345d0 real(8), dimension(9), parameter :: expected_ru = [ & 2.0d0, 1.3d0, 1.24d0, 1.235d0, 1.2346d0, 1.23457d0, 1.234568d0, 1.2345679d0, 1.2345679d0 ] real(8), dimension(9), parameter :: expected_rd_rz = [ & 1.0d0, 1.2d0, 1.23d0, 1.234d0, 1.2345d0, 1.23456d0, 1.234567d0, 1.2345678d0, 1.23456789d0 ] call check_mode('RU', expected_ru) call check_mode('RD', expected_rd_rz) call check_mode('RZ', expected_rd_rz) contains subroutine check_mode(mode, expected) character(len=*), intent(in) :: mode real(8), intent(in) :: expected(9) real(8) :: got(9) character(len=80) :: line, fmt integer :: i do i = 1, 9 write(fmt, '("(",a,",d0.",i0,")")') trim(mode), i write(line, fmt) x read(line, '(d80.30)') got(i) end do if ( any(got /= expected) ) error stop end subroutine check_mode end program format_84 lfortran-0.63.0/integration_tests/lbound_01.f900000664000175000017500000000023615174404631021471 0ustar alastairalastairprogram lbound_01 integer(8) :: x(2) integer(8) :: res(1) res = lbound(x, kind = 8) print *, res if (res(1) /= 1) error stop end program lfortran-0.63.0/integration_tests/array_section_24.f900000664000175000017500000000270415174404631023057 0ustar alastairalastair! Test sequence association: passing a 2D assumed-size array element ! to a 1D assumed-size dummy argument via sequence association. program array_section_24 implicit none integer :: arr(2, 3) integer :: i, j ! Fill with known values: arr(i,j) = i + 10*j ! Column-major layout: [11, 21, 12, 22, 13, 23] do j = 1, 3 do i = 1, 2 arr(i, j) = i + 10 * j end do end do ! caller(arr,1) passes arr(1,1) with n=6: expect [11, 21, 12, 22, 13, 23] call caller(arr, 1, 6) ! caller(arr,2) passes arr(1,2) with n=4: expect [12, 22, 13, 23] call caller(arr, 2, 4) contains subroutine callee(a, n, expected) integer, intent(in) :: a(*) integer, intent(in) :: n integer, intent(in) :: expected(*) integer :: k do k = 1, n if (a(k) /= expected(k)) error stop end do end subroutine subroutine caller(arr, idx, n) integer, intent(in) :: idx, n integer, intent(in) :: arr(2, *) integer :: expected(6) integer :: i, j, k ! Build expected sequence: column-major from arr(1, idx) onward k = 1 do j = idx, idx + (n + 1) / 2 - 1 do i = 1, 2 if (k <= n) then expected(k) = i + 10 * j k = k + 1 end if end do end do call callee(arr(1, idx), n, expected) end subroutine end program lfortran-0.63.0/integration_tests/select_rank_28.f900000664000175000017500000000175015174404631022513 0ustar alastairalastairprogram select_rank_28 use iso_fortran_env, only: real32 implicit none integer :: ps(3) ps = [2, 3, 4] call foo(ps) contains subroutine foo(pool_size) integer, dimension(..), optional, intent(in) :: pool_size integer, dimension(3) :: pool_size_ pool_size_ = 2 if (present(pool_size)) then select rank(pool_size) rank(0) pool_size_ = pool_size rank(1) pool_size_(1) = pool_size(1) if (size(pool_size, dim=1) == 1) then pool_size_(2:) = pool_size(1) elseif (size(pool_size, dim=1) == 3) then pool_size_(2:) = pool_size(2:) end if end select end if if (pool_size_(1) /= 2) error stop if (pool_size_(2) /= 3) error stop if (pool_size_(3) /= 4) error stop print *, "PASS" end subroutine end program select_rank_28lfortran-0.63.0/integration_tests/file_18.f900000664000175000017500000000067115174404631021140 0ustar alastairalastairprogram file_18 implicit none integer :: j = 11, x = 43, y =-54 integer :: nlines = 0, io open(j, file="file_18_data.txt", status='old') write(j, *) x write(j, *) y close(j) open (j, file = 'file_18_data.txt', status='old') do read(j, *, iostat=io) if (io/=0) exit nlines = nlines + 1 end do close (j) print *, nlines if (nlines /= 2) error stop end program file_18 lfortran-0.63.0/integration_tests/bits_01.f900000664000175000017500000000056315174404631021152 0ustar alastairalastairprogram bits_01 use iso_fortran_env, only: int32, int64 implicit none if (ibclr(3_int32, 0) /= 2_int32) error stop if (ibclr(4_int64, 1) /= 4_int64) error stop if (ibset(1_int32, 2) /= 5_int32) error stop if (ibset(2_int64, 3) /= 10_int64) error stop if (ieor(16_int32, 2_int32) /= 18_int32) error stop if (ieor(31_int64, 3_int64) /= 28_int64) error stop end program lfortran-0.63.0/integration_tests/pass_array_by_data_10.f900000664000175000017500000000241015174404631024031 0ustar alastairalastairmodule pass_array_by_data_10_pintrf_module public :: OBJCON contains subroutine OBJCON(x, out) implicit none real, intent(in) :: x(:) real, intent(out) :: out end subroutine OBJCON end module pass_array_by_data_10_pintrf_module subroutine cobyla(x, out) implicit none real, intent(inout) :: x(:) real, intent(out) :: out call evaluate(calcfc_internal, out) contains subroutine calcfc_internal(x_internal, out) implicit none real, intent(in) :: x_internal(:) real, intent(out) :: out out = sum(x_internal**2) end subroutine calcfc_internal subroutine evaluate(calcfc, out) use, non_intrinsic :: pass_array_by_data_10_pintrf_module, only : OBJCON implicit none procedure(OBJCON) :: calcfc real, intent(out) :: out call calcfc(x, out) end subroutine evaluate end subroutine program pass_array_by_data_10 implicit none interface subroutine cobyla(x, out) real, intent(inout) :: x(:) real, intent(out) :: out end subroutine cobyla end interface real :: x(2) = [1.0, 2.0] real :: out call cobyla(x, out) print *, out if ( abs(out - 5.0 ) > 1e-8 ) error stop end program lfortran-0.63.0/integration_tests/separate_compilation_21a.f900000664000175000017500000000074715174404631024562 0ustar alastairalastairmodule math_separate_compilation_21 implicit none interface logspace module function func1(n, base) result(res) integer, intent(in) :: n integer, intent(in) :: base real :: res(max(n,0)) end function func1 module function func2(n, base) result(res) integer, intent(in) :: n real, intent(in) :: base integer :: res(max(n, 0)) end function func2 end interface end modulelfortran-0.63.0/integration_tests/format_31.f900000664000175000017500000000127715174404631021507 0ustar alastairalastairprogram format_31 implicit none call printit(3*1365+1) call printit(3*37+1) contains subroutine printit(ii) integer,intent(in) :: ii integer :: nz, kz character(len=*),parameter :: show32 = '(1x,"value=",i4,", value(bits)=",b32.32,1x,", trailz=",i3)' print '(a)', repeat('-',80) print show32, ii, ii, trailz(ii) call trimz(ii,nz,kz) print show32, kz, kz, trailz(kz) print '(b32.32)', 4096 print '(b32.16)', 4096 print '(b32)', 4096 print '(b32.8)', 4096 end subroutine printit subroutine trimz(v,nz,kz) integer,intent(in) :: v integer,intent(out) :: nz integer,intent(out) :: kz nz=trailz(v) kz=shiftr(v,nz) end subroutine trimz end program format_31lfortran-0.63.0/integration_tests/intrinsics_178.f900000664000175000017500000000532415174404631022475 0ustar alastairalastairprogram intrinsics_178 use iso_fortran_env, only: sp => real32, dp => real64 real :: y real :: z real(dp) :: w real(dp) :: x real(sp), parameter :: x1 = rrspacing(178.1387e-4) real(dp), parameter :: y1 = rrspacing(1.01_dp) real(sp), parameter :: ar1(3) = rrspacing([1.1213, 2.1643, 3.613]) real(dp), parameter :: ar2(3) = rrspacing([1.1213_dp, 2.1643_dp, 3.613_dp]) real(sp) :: arr1(3) real(dp) :: arr2(3) arr1 = [11.90_sp, 12.00_sp, 45.09_sp] arr2 = [890.4_dp, 12.00_dp, 675.45_dp] x = 4.1 y = 7.8 z = 3.2 w = 5.6 print *, x1 if (x1 - 9.56374900e+06_sp > 1e-5) error stop print*, y1 if (y1 - 4.54863562364420100e+15_dp > 1e-5) error stop print*, ar1 if (any(ar1 - [9.40614600e+06_sp, 9.07773200e+06_sp, 1.51540200e+07_sp] > 1e-5)) error stop print*, ar2 if (any(ar2 - [5.04988626217053700e+15_dp, 4.87357033675898200e+15_dp, 8.13575272684480100e+15_dp] > 1e-5)) error stop print *, rrspacing(4.1) if ((rrspacing(4.1) - 8598323.00) > 1e-7) error stop print *, rrspacing(7.8) if ((rrspacing(7.8) - 16357786.0) > 1e-7) error stop print *, rrspacing(3.2_dp) if ((rrspacing(3.2_dp) - 7205759403792794.0_dp) > 1e-7) error stop print *, rrspacing(5.6_dp) if ((rrspacing(5.6_dp) - 6305039478318694.0_dp) > 1e-7) error stop print *, rrspacing(x) if ((rrspacing(x) - 461618961805475800.0_dp) > 1e-7) error stop print *, rrspacing(y) if ((rrspacing(y) - 16357786.0) > 1e-7) error stop print *, rrspacing(z) if ((rrspacing(z) - 13421773.0 ) > 1e-7) error stop print *, rrspacing(w) if ((rrspacing(w) - 630503947831869400.0) > 1e-7) error stop print *, rrspacing(4.1_dp) if ((rrspacing(4.1_dp) - 4616189618054758.0_dp) > 1e-7) error stop print *, rrspacing(7.8_dp) if ((rrspacing(7.8_dp) - 8782019273372467.0_dp) > 1e-7) error stop print *, rrspacing(3.2_dp) if ((rrspacing(3.2_dp) - 7205759403792794.0_dp) > 1e-7) error stop print *, rrspacing(5.6_dp) if ((rrspacing(5.6_dp) - 6305039478318694.0_dp) > 1e-7) error stop print *, kind(rrspacing(4.1)) if (kind(rrspacing(4.1)) /= 4) error stop print *, kind(rrspacing(7.8_dp)) if (kind(rrspacing(7.8_dp)) /= 8) error stop print *, kind(rrspacing(y)) if (kind(rrspacing(y)) /= 4) error stop print *, kind(rrspacing(x)) if (kind(rrspacing(x)) /= 8) error stop print *, rrspacing(arr1) if (any(rrspacing(arr1) - [1.24780540e+07_sp, 1.25829120e+07_sp, 1.18200730e+07_sp] > 1e-5)) error stop print *, rrspacing(arr2) if (any(rrspacing(arr2) - [7.83204122697400300e+15_sp, 6.75539944105574400e+15_sp, & 5.94132103185039400e+15_sp] > 1e-5)) error stop end program lfortran-0.63.0/integration_tests/allocated_02.f900000664000175000017500000000026415174404631022140 0ustar alastairalastairprogram main implicit none real(4), allocatable :: x(:) allocate(x(5)) x = [1.0, 2.0, 3.0, 4.0, 5.0] if (.not.allocated(x)) error stop end program main lfortran-0.63.0/integration_tests/arrays_op_1.f900000664000175000017500000000215615174404631022130 0ustar alastairalastairprogram array_op_1 implicit none integer :: a(4), b(4) real :: c(4), d(4) integer :: i, j i = 0 ! TODO: Include i + 4 in the end ! Should be ignored. Fix to be made ! in implied_do_loops.cpp. a = [i + 1, (i + j, j = 1, i + 3)] b = [4*a(i + 1), 5*a(i + 2), 6*a(i + 3), 7*a(i + 4)] ! c = [i + 1, (i*j, j = 1, i + 3)] c(1) = i + 1 c(2) = i*1 c(3) = i*2 c(4) = i*3 print *, a(1), a(2), a(3), a(4) print *, b(1), b(2), b(3), b(4) print *, c(1), c(2), c(3), c(4) d = a + b + c print *, d(1), d(2), d(3), d(4) if( d(1) /= 6.0 ) error stop if( d(2) /= 6.0 ) error stop if( d(3) /= 14.0 ) error stop if( d(4) /= 24.0 ) error stop d = a - b*c print *, d(1), d(2), d(3), d(4) if( d(1) /= -3.0 ) error stop if( d(2) /= 1.0 ) error stop if( d(3) /= 2.0 ) error stop if( d(4) /= 3.0 ) error stop d = a*b*c print *, d(1), d(2), d(3), d(4) if( d(1) /= 4.0 ) error stop if( d(2) /= 0.0 ) error stop if( d(3) /= 0.0 ) error stop if( d(4) /= 0.0 ) error stop d = (a*b)/(c + 1) print *, d(1), d(2), d(3), d(4) if( d(1) /= 2.0 ) error stop if( d(2) /= 5.0 ) error stop if( d(3) /= 24.0 ) error stop if( d(4) /= 63.0 ) error stop end program lfortran-0.63.0/integration_tests/derived_types_12.f900000664000175000017500000000214115174404631023053 0ustar alastairalastairmodule mod implicit none type, public :: t integer :: i contains generic, public :: assignment(=) => set procedure, private :: set generic, public :: operator(>) => greater procedure, private :: greater generic, public :: operator(.mul.) => multiply procedure, private :: multiply end type t contains subroutine set(x, y) class(t), intent(out) :: x type(t), intent(in) :: y x%i = y%i + 1 end subroutine set function greater(x, y) result(is_greater) class(t), intent(in) :: x type(t), intent(in) :: y logical :: is_greater is_greater = x%i > y%i end function greater function multiply(x, y) result(product) class(t), intent(in) :: x type(t), intent(in) :: y integer :: product product = x%i * y%i end function multiply end module mod program alloc_assign use mod implicit none logical :: is_greater integer :: product type(t) :: xt, yt xt = t(5) yt = xt print *, xt%i, yt%i if( xt%i /= 6 ) error stop if( yt%i /= 7 ) error stop is_greater = (xt > yt) if (is_greater) error stop product = (xt.mul.yt) if (product /= 42) error stop end program alloc_assign lfortran-0.63.0/integration_tests/goto_01.f900000664000175000017500000000012215174404631021150 0ustar alastairalastairprogram goto_01 implicit none integer :: a a = 5 go to 1 1 print *, a end program lfortran-0.63.0/integration_tests/c_ptr_02.f900000664000175000017500000000071415174404631021317 0ustar alastairalastairprogram test_c_ptr_02 use iso_c_binding implicit none complex, target :: c_arr(2) real, pointer :: r_ptr(:) type :: test_obj type(c_ptr) :: ptr = c_NULL_ptr end type test_obj type(test_obj) :: instance type(c_ptr) :: temp_ptr temp_ptr = instance%ptr c_arr = (1, 2) call c_f_pointer(c_loc(c_arr), r_ptr, shape=[4]) print *, c_arr print *, r_ptr if (c_associated(temp_ptr) .neqv. .false.) error stop end program lfortran-0.63.0/integration_tests/intrinsics_423.f900000664000175000017500000000021715174404631022462 0ustar alastairalastairprogram intrinsics_423 ! Test num_images() intrinsic implicit none integer :: n n = num_images() if (n /= 1) error stop print *, n end program lfortran-0.63.0/integration_tests/optional_04.f900000664000175000017500000000053115174404631022034 0ustar alastairalastairmodule module_optional_04 contains subroutine sub( a ) integer, intent(in), optional :: a(10) call sub2( a(5) ) end subroutine subroutine sub2( a ) integer, intent(in), optional :: a if ( .not. present(a) ) error stop end subroutine end module program optional_04 use module_optional_04 call sub() end lfortran-0.63.0/integration_tests/interface_10.f900000664000175000017500000000060115174404631022142 0ustar alastairalastairmodule interface_10_m interface chars module procedure identity end interface contains subroutine identity(x, y) character, intent(in) :: x character(kind=1), intent(out) :: y y = x end subroutine end module program interface_10 use interface_10_m character :: x, y x = 'A' call chars(x, y) print *, x end program lfortran-0.63.0/integration_tests/print_06.f900000664000175000017500000000207515174404631021352 0ustar alastairalastairprogram print_06 ! Type declaration type even_more_nested character(10) :: s end type even_more_nested type another_type integer :: ll type(even_more_nested) :: inn end type another_type type tt type(another_type) :: another_inst integer :: internal_integer integer :: arr(5) end type tt ! Variable declaration type(tt) :: inst(2) character(100) :: output inst(1)%internal_integer = 100 inst(1)%arr = 33 inst(1)%another_inst%ll = 99 inst(1)%another_inst%inn%s = "1234567890" inst(2)%internal_integer = 101 inst(2)%arr = 33 inst(2)%another_inst%ll = 99 inst(2)%another_inst%inn%s = "1234567890" print "(I0,2X,A,10X,I0,11X,5I0)", inst write(output, "(I0,2X,A,10X,I0,11X,5I0)") inst(1) print *, output if (output /= "99 1234567890 100 3333333333") error stop write(output, "(I0,2X,A,10X,I0,11X,5I0)") inst(2) print *, output if (output /= "99 1234567890 101 3333333333") error stop end programlfortran-0.63.0/integration_tests/intrinsics_412.f900000664000175000017500000000072615174404631022465 0ustar alastairalastairprogram intrinsics_412 integer :: ii call update(ii) print *, ii if (ii /= 1) error stop contains subroutine update(return_value) integer, intent(out) :: return_value character(len=:),allocatable :: long character(len=:),allocatable,save :: shorts(:) allocate(character(len=3) :: shorts(3)) shorts = ['abc', 'def', 'ghi'] long = 'banana' return_value=maxloc([0,merge(1, 0, shorts == long)],dim=1) deallocate(shorts) deallocate(long) end subroutine update end program lfortran-0.63.0/integration_tests/c_f_proc_ptr_01.c0000664000175000017500000000024215174404631022466 0ustar alastairalastair#include #include void c_callback(int x) { if (x != 42) { printf("ERROR: expected 42, got %d\n", x); exit(1); } }lfortran-0.63.0/integration_tests/file_59.f900000664000175000017500000000121615174404631021141 0ustar alastairalastairprogram file_59 implicit none character(len=20) :: enc ! Open a file with a specific encoding open(unit=10, file="file_59_file.txt", encoding="UTF-8", form="formatted") ! Inquire the encoding of the file inquire(unit=10, encoding=enc) print *, "Encoding of file:", trim(enc) if (trim(enc) /= "UTF-8") error stop close(10) open(unit=10, file="file_59_file.txt", form="formatted") ! Inquire the encoding of the file inquire(unit=10, encoding=enc) print *, "Encoding of file:", trim(enc) if (trim(enc) /= "UNKNOWN" .and. trim(enc) /= "DEFAULT") error stop close(10) end program file_59lfortran-0.63.0/integration_tests/format_58.f900000664000175000017500000000450715174404631021517 0ustar alastairalastairprogram format_58 implicit none integer,parameter:: sp = kind(1e0), dp = kind(1d0),& sep = selected_real_kind(precision(1.0_dp)+1),& ep = (sep+dp+sign(1,sep)*(sep-dp))/2 character(11) values(3) real(sp),parameter:: xsp = 1 real(dp),parameter:: xdp = 1 real(ep),parameter:: xep = 1 write(*,"(A9,3A12)") 'kind name','sp','dp','ep' write(*,"(A9,3I12)") 'kind:',sp, dp, ep values = (/ es(real(epsilon(xsp),ep),11,2,4), & es(real(epsilon(xdp),ep),11,2,4),es(real(epsilon(xep),ep),11,2,4) /) write(*,"(4(1X,A))") 'epsilon:',values values = (/ es(real( tiny(xsp),ep),11,2,4), & es(real( tiny(xdp),ep),11,2,4),es(real( tiny(xep),ep),11,2,4) /) write(*,"(4(1X,A))") ' tiny:',values values = (/ es(real( huge(xsp),ep),11,2,4), & es(real( huge(xdp),ep),11,2,4),es(real( huge(xep),ep),11,2,4) /) write(*,"(4(1X,A))") ' huge:',values contains function cn(n) integer,intent(in)::n character(range(n)+2) cn write(cn,"(I0)") n cn = adjustl(cn) end function cn function es(x,w,d,e) real(ep),intent(in):: x integer,intent(in) :: w,d,e character(w) es, ce, c_aftere, ctenpower, csigfigs character(1) cfirstdigit, cesign, csignx, claterdigits*(d+1) real(ep) signx, absx, scaledx integer pointplace,eplace,digitsaftere,tenpower,k signx = sign(1.0_ep,x) csignx = merge(' ','-',signx>0.0_ep) if(x==0.0_ep)then es = adjustr(csignx//'0.'//repeat('0',d)//'E+'//repeat('0',e)) return end if absx = abs(x) k = int(log10(absx)) scaledx = x/10.0_ep**k write(ce,"(E"//trim(cn(w))//"."//trim(cn(d+1))//")") scaledx eplace = index(ce,'E') pointplace = index(ce,'.') csigfigs = adjustl(ce(pointplace+1:eplace-1)) c_aftere = adjustl(trim(ce(eplace+1:))) read(c_aftere,*) digitsaftere tenpower = digitsaftere + k - 1 cesign = merge('+','-',tenpower>=0) ctenpower = adjustl(trim(cn(abs(tenpower)))) cfirstdigit = csigfigs(1:1) claterdigits = csigfigs(2:) es = csignx//cfirstdigit//'.'//trim(claterdigits)//'E'//cesign// & repeat('0',e-len_trim(ctenpower))//trim(ctenpower) end function es end program format_58 lfortran-0.63.0/integration_tests/nested_25.f900000664000175000017500000000062715174404631021502 0ustar alastairalastairmodule nested_25_mod contains subroutine outer(i) integer(4), intent(in) :: i contains subroutine inner() integer(4) :: i i = 1 if (i /= 1) error stop end subroutine inner end subroutine outer end module nested_25_mod program nested_25 use nested_25_mod implicit none call outer(5) print *, "ok" end program nested_25 lfortran-0.63.0/integration_tests/operator_overloading_25.f900000664000175000017500000000407015174404631024440 0ustar alastairalastairmodule operator_overloading_25_mod implicit none type, public, abstract :: AbsType contains procedure(writeout), deferred :: writeout generic :: write(formatted) => writeout end type AbsType abstract interface subroutine writeout(self,unit,iotype,v_list,iostat,iomsg) import class(AbsType), intent(in) :: self integer, intent(in) :: unit character(*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(*), intent(inout) :: iomsg end subroutine writeout end interface type, extends(AbsType) :: MyType integer :: value contains procedure :: writeout => my_write end type MyType type :: IoType contains procedure, nopass :: output end type IoType contains subroutine my_write(self,unit,iotype,v_list,iostat,iomsg) class(MyType), intent(in) :: self integer, intent(in) :: unit character(*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(*), intent(inout) :: iomsg iostat = 0 ! Basic validation if (len_trim(iotype) == 0) then iostat = 1 iomsg = "Invalid iotype" return end if write(unit,'(A,I0)') "MyType value = ", self%value end subroutine my_write subroutine output(obj) class(AbsType), intent(in) :: obj integer :: ios character(len=200) :: msg write(*,'(DT)', iostat=ios, iomsg=msg) obj if (ios /= 0) then print *, "I/O Error:", trim(msg) error stop "DT write failed" end if end subroutine output end module operator_overloading_25_mod program operator_overloading_25 use operator_overloading_25_mod implicit none type(MyType) :: x type(IoType) :: io x%value = 42 call io%output(x) print *, "operator_overloading_25 completed successfully." end program operator_overloading_25lfortran-0.63.0/integration_tests/functions_25.f900000664000175000017500000000173415174404631022230 0ustar alastairalastairmodule f implicit none integer, parameter :: sp = selected_real_kind(6) contains module function diag_rsp_k(v, k) result(res) real(sp), intent(in) :: v(:) integer, intent(in) :: k real(sp) :: res(size(v) + abs(k), size(v) + abs(k)) integer :: i, sz sz = size(v) res = 0 if (k > 0) then do i = 1, sz res(i, k + i) = v(i) end do else if (k < 0) then do i = 1, sz res(i + abs(k), i) = v(i) end do else do i = 1, sz res(i, i) = v(i) end do end if end function diag_rsp_k end module f program functions_25 use f implicit none integer :: i integer, parameter :: n = 4 real(sp) :: a(n, n), c(n, n) c = diag_rsp_k([(1._sp, i=1, n - 1)], 1) c = transpose(c) a = diag_rsp_k([(1._sp, i = 1, n - 1)], -1) print *, all(a == c) if (.not. all(a == c)) error stop end program lfortran-0.63.0/integration_tests/file_26.f900000664000175000017500000000631515174404631021140 0ustar alastairalastairprogram file_26 implicit none integer, parameter :: n = 5 integer :: data_out(n), data_in(n) integer, allocatable :: data_out_alloc(:) real, allocatable :: data_out_alloc_real(:) real :: data_in_real(n) integer :: i, write_unit, read_unit, ios character(len=2) :: tmp character(len=3) :: tmp2 data_out = (/ 1, 2, 3, 4, 5 /) allocate(data_out_alloc(n)) allocate(data_out_alloc_real(n)) data_out_alloc = [1, 2, 3, 4, 5] data_out_alloc_real = [1, 2, 3, 4, 5] open(newunit=write_unit, file='file_26_data.dat', form='unformatted', status='replace') write(write_unit) data_out write(9, *) data_out close(write_unit) open(newunit=read_unit, file='file_26_data.dat', form='unformatted', status='old') read(read_unit) data_in close(read_unit) print *, data_out print *, data_in if (any(data_out /= data_in)) error stop open(newunit=write_unit, file='file_26_data.dat', form='unformatted', status='replace', access="stream") write(write_unit) data_out write(9, *) data_out close(write_unit) open(newunit=read_unit, file='file_26_data.dat', form='unformatted', status='old', access="stream") read(read_unit) data_in close(read_unit) print *, data_out print *, data_in if (any(data_out /= data_in)) error stop open(newunit=write_unit, file='file_26_data2.dat', form='unformatted', status='replace') write(write_unit) "Hello" close(write_unit) open(newunit=read_unit, file='file_26_data2.dat', form='unformatted', status='old') read(read_unit) tmp, tmp2 close(read_unit) print *, tmp, " ", tmp2 if (tmp /= "He" .or. tmp2 /= "llo") error stop open(newunit=write_unit, file='file_26_data2.dat', form='unformatted', status='replace', access="stream") write(write_unit) "Hello" close(write_unit) open(newunit=read_unit, file='file_26_data2.dat', form='unformatted', status='old', access="stream") read(read_unit) tmp, tmp2 close(read_unit) print *, tmp, " ", tmp2 if (tmp /= "He" .or. tmp2 /= "llo") error stop open(newunit=write_unit, file='file_26_data.dat', form='unformatted', status='replace', access="stream") write(write_unit) data_out_alloc close(write_unit) open(newunit=read_unit, file='file_26_data.dat', form='unformatted', status='old', access="stream") read(read_unit) data_in close(read_unit) print *, data_out_alloc print *, data_in if (any(data_out_alloc /= data_in)) error stop open(newunit=write_unit, file='file_26_data.dat', form='unformatted', status='replace', access="stream") write(write_unit) data_out_alloc_real close(write_unit) open(newunit=read_unit, file='file_26_data.dat', form='unformatted', status='old', access="stream") read(read_unit) data_in_real close(read_unit) print *, data_out_alloc_real print *, data_in_real if (any(data_out_alloc_real /= data_in_real)) error stop call test_sub(data_out) if(any(data_out /= [10, 20, 30, 40, 50])) error stop contains subroutine test_sub(res2) integer :: lun integer, parameter :: res(5) = [10, 20, 30, 40, 50] integer, intent(out) :: res2(:) open(newunit=lun, file="file_26_data.dat", status="replace", form="unformatted", access="stream") write(lun) res rewind(lun) read(lun) res2 close(lun) end subroutine test_sub end program lfortran-0.63.0/integration_tests/modules_53.f900000664000175000017500000000055315174404631021667 0ustar alastairalastairmodule module_modules_53 real :: x(5) end module subroutine check_x() use module_modules_53, only: x print *, x if (any(abs(x - 1.39) > 1e-9)) error stop x = -2.91 end subroutine program modules_53 use module_modules_53, only: x x = 1.39 call check_x() print *, x if (any(abs(x - (-2.91)) > 1e-9)) error stop end program lfortran-0.63.0/integration_tests/logical_arrays_logical_binop_01.f900000664000175000017500000000330215174404631026057 0ustar alastairalastairprogram main implicit none logical, parameter :: x1(2) = [.true., .false.] ! parameter variable != logical constant print *, x1 .neqv. .true. if (all((x1 .neqv. .true.) .neqv. [.false., .true.])) error stop ! logical array constant == logical array constant print *, [.false., .true.] .eqv. [.false., .true.] if (all(([.false., .true.] .eqv. [.false., .true.]) .neqv. [.true., .true.])) error stop ! parameter variable != function returning logical constant print *, x1 .neqv. get_true() if (all((x1 .neqv. get_true()) .neqv. [.false., .true.])) error stop ! logical constant == parameter variable print *, .true. .eqv. x1 if (all((.true. .eqv. x1) .neqv. [.true., .false.])) error stop ! parameter variable and logical constant print *, x1 .and. .false. if (all((x1 .and. .false.) .neqv. [.false., .false.])) error stop ! logical constant or parameter variable print *, .false. .or. x1 if (all((.false. .or. x1) .neqv. [.true., .false.])) error stop ! logical expression or logical constant print *, 1 > 2 .or. x1 if (all((1 > 2 .or. x1) .neqv. [.true., .false.])) error stop ! logical expression or logical constant print *, ((1 + 2) > 2) .or. x1 if (all((((1 + 2) > 2) .or. x1) .neqv. [.true., .true.])) error stop ! logical expression or logical constant print *, ((1 + 2) == 3) .or. x1 if (all((((1 + 2) == 3) .or. x1) .neqv. [.true., .true.])) error stop ! logical expression or logical constant print *, ((1 + 2) == 3) .or. x1 if (all((((1 + 2) == 3) .or. x1) .neqv. [.true., .true.])) error stop contains logical function get_true() result(value) value = .true. end function get_true end program main lfortran-0.63.0/integration_tests/array_indices_array_section.f900000664000175000017500000000217715174404631025452 0ustar alastairalastairprogram array_indices_array_section implicit none integer :: arr_idx(2) real :: arr_1(2, 2), arr_2(2, 2), arr_3(2, 2, 2), arr_4(2, 2, 2) real :: arr_2_reshape(2, 2), arr_4_reshape(2, 2, 2) ! Initialize the matrices and arrays arr_1 = reshape([1.0, 2.0, 3.0, 4.0], shape(arr_1)) arr_3 = reshape([1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 5.0], shape(arr_3)) arr_idx = [2, 1] ! Slicing arr_2 = arr_1(arr_idx, :) arr_2_reshape = reshape([2.0, 1.0, 4.0, 3.0], shape(arr_2_reshape)); print *, rank(arr_2) if (rank(arr_2) /= 2) error stop if (any(arr_2 /= arr_2_reshape)) error stop arr_4 = arr_3(:, :, arr_idx) arr_4_reshape = reshape([1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0], shape(arr_4_reshape)); print *, rank(arr_4) if (rank(arr_4) /= 3) error stop if (any(arr_4 /= arr_4_reshape)) error stop arr_4 = arr_3(:, arr_idx, :) arr_4_reshape = reshape([3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0], shape(arr_4_reshape)); print *, rank(arr_4) if (rank(arr_4) /= 3) error stop if (any(arr_4 /= arr_4_reshape)) error stop end program array_indices_array_section lfortran-0.63.0/integration_tests/class_124.f900000664000175000017500000000205015174404631021375 0ustar alastairalastairmodule abstypemod_124 implicit none type :: AbsType procedure(pintfc), pointer, nopass :: ptr => null() end type AbsType interface function pintfc(n) result(nres) integer, intent(in) :: n(:) integer :: nres(size(n)) end function pintfc end interface end module abstypemod_124 module clientmod_124 use abstypemod_124, only: AbsType implicit none contains subroutine client(obj) class(AbsType), intent(in) :: obj integer, allocatable :: nres(:) allocate(nres(3)) nres = obj%ptr(nres) end subroutine client end module clientmod_124 program class_124 use abstypemod_124, only: AbsType use clientmod_124, only: client implicit none type(AbsType) :: obj obj%ptr => double_it call client(obj) print *, "ok" contains function double_it(n) result(nres) integer, intent(in) :: n(:) integer :: nres(size(n)) integer :: i do i = 1, size(n) nres(i) = n(i) * 2 end do end function double_it end program class_124 lfortran-0.63.0/integration_tests/allocated_04.f900000664000175000017500000000062615174404631022144 0ustar alastairalastairmodule mm type t integer,allocatable :: arr(:) end type type(t) :: instance_arr(39) end module program allocated_04 use mm print *, allocated(instance_arr(1)%arr) if (allocated(instance_arr(1)%arr)) error stop allocate(instance_arr(1)%arr(10)) print*, allocated(instance_arr(1)%arr) if (.not. allocated(instance_arr(1)%arr)) error stop end program allocated_04lfortran-0.63.0/integration_tests/procedure_15.f900000664000175000017500000000220615174404631022202 0ustar alastairalastairmodule nested_context interface subroutine lcompilers_OBJCON(x) implicit none real, intent(in) :: x(:) end subroutine lcompilers_OBJCON end interface procedure(lcompilers_OBJCON), pointer :: lcompilers_calcfc end module nested_context module cobylb_mod_procedure_15 use nested_context, only: lcompilers_calcfc contains subroutine cobylb(calcfc) implicit none interface subroutine OBJCON(x) implicit none real, intent(in) :: x(:) end subroutine OBJCON end interface procedure(OBJCON) :: calcfc lcompilers_calcfc => calcfc call calcfc_internal([1.0, 2.0]) contains subroutine calcfc_internal(x_internal) use nested_context, only: lcompilers_calcfc implicit none real, intent(in) :: x_internal(:) call lcompilers_calcfc(x_internal) end subroutine calcfc_internal end subroutine cobylb end module cobylb_mod_procedure_15 program procedure_15 use cobylb_mod_procedure_15 implicit none call cobylb(calcfc) contains subroutine calcfc(x) implicit none real, intent(in) :: x(:) print *, x if ( abs(sum(x) - 3.0) > 1e-8 ) error stop end subroutine end program procedure_15 lfortran-0.63.0/integration_tests/intrinsics_171.f900000664000175000017500000000041715174404631022464 0ustar alastairalastairprogram intrinsics_171 character(5):: name = "hELLo" print*, _lfortran_tolowercase("HeLo#") if (_lfortran_tolowercase(name) /= "hello") error stop print*, _lfortran_tolowercase(name) if (_lfortran_tolowercase("HeLo#") /= "helo#") error stop end lfortran-0.63.0/integration_tests/read_31_data.txt0000664000175000017500000000002615174404631022333 0ustar alastairalastair100 1 7 1 50 2 3 99 lfortran-0.63.0/integration_tests/gpu_metal_75.f900000664000175000017500000000126315174404631022177 0ustar alastairalastairprogram gpu_metal_75 ! Test: VLA dimension referencing a decomposed struct member. ! When --gpu=metal decomposes a struct into flat-array kernel params, ! VLA dimensions like size(x%nodes) must be rewritten to reference ! the decomposed parameter. implicit none type :: t integer, allocatable :: nodes(:) end type type(t) :: a allocate(a%nodes(3)) a%nodes = [1, 2, 3] if (f(a)) then print *, "OK" else error stop end if contains function f(x) result(res) type(t), intent(in) :: x logical :: res integer :: i logical :: eq(size(x%nodes)) do concurrent(i = 1:size(x%nodes)) eq(i) = (x%nodes(i) > 0) end do res = all(eq) end function end program lfortran-0.63.0/integration_tests/elemental_18.f900000664000175000017500000000063515174404631022167 0ustar alastairalastairprogram elemental_18 integer :: arr(10) logical :: logi character(len=1) :: str_arr(10) str_arr = "a" arr = 97 ! ASCII equivalent of 'a' logi = all(peek(arr) == str_arr) if(logi .neqv. .true.) error stop contains elemental function peek(pos) result(ch) integer, intent(in) :: pos character(1) :: ch ch = achar(pos) end function peek end program lfortran-0.63.0/integration_tests/gpu_metal_123.f900000664000175000017500000000105715174404631022252 0ustar alastairalastairprogram gpu_metal_123 ! Test: sum() of a local array slice inside do concurrent block ! Regression: Metal shader failed with undeclared _lcompilers_Sum ! and address space mismatch when sum() was inside a block implicit none integer, parameter :: n = 3 real :: r(n) integer :: i do concurrent (i = 1:n) block real :: y(n) y = real(i) r(i) = sum(y(1:n)) end block end do print *, r(1), r(2), r(3) if (abs(r(1) - 3.0) > 1e-6) error stop if (abs(r(2) - 6.0) > 1e-6) error stop if (abs(r(3) - 9.0) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_77.f900000664000175000017500000000105115174404631022174 0ustar alastairalastairprogram gpu_metal_77 implicit none integer :: i real :: a(2, 2, 2) a = 1.0 ! 2D array section assignment inside do concurrent do concurrent (i = 1:2) a(1:1, 1:1, i) = 0.5 end do if (abs(a(1,1,1) - 0.5) > 1e-6) error stop if (abs(a(2,1,1) - 1.0) > 1e-6) error stop if (abs(a(1,2,1) - 1.0) > 1e-6) error stop if (abs(a(2,2,1) - 1.0) > 1e-6) error stop if (abs(a(1,1,2) - 0.5) > 1e-6) error stop if (abs(a(2,1,2) - 1.0) > 1e-6) error stop if (abs(a(1,2,2) - 1.0) > 1e-6) error stop if (abs(a(2,2,2) - 1.0) > 1e-6) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/modules_67_origin.f900000664000175000017500000000047415174404631023245 0ustar alastairalastairmodule modules_67_origin implicit none type :: pair_t integer :: x = 0 end type interface operator(.check.) module procedure pair_check end interface contains pure logical function pair_check(a, b) type(pair_t), intent(in) :: a, b pair_check = (a%x == b%x) end function end module lfortran-0.63.0/integration_tests/string_09.f900000664000175000017500000000123615174404631021525 0ustar alastairalastairprogram string_09 implicit none character(*), parameter :: s1 = " A B ", s2 = " " if (len_trim(s1) /= 4) error stop if (len_trim(s2) /= 0) error stop if (len_trim(" ") /= 0) error stop if (len_trim("") /= 0) error stop if (len_trim("xx") /= 2) error stop if (trim(s1) /= " A B") error stop if (trim(s2) /= "") error stop if (trim(" ") /= "") error stop if (trim("") /= "") error stop if (trim("xx") /= "xx") error stop if (len(trim(s1)) /= 4) error stop if (len(trim(s2)) /= 0) error stop if (len(trim(" ")) /= 0) error stop if (len(trim("")) /= 0) error stop if (len(trim("xx")) /= 2) error stop print *, trim("xx ") print *, len(trim("xx ")) end program lfortran-0.63.0/integration_tests/pure_side_effects_01.f900000664000175000017500000000120415174404631023660 0ustar alastairalastairmodule pure_side_effects_01_mod implicit none contains pure function square(x) result(res) integer, intent(in) :: x integer :: res res = x * x end function square function print_and_square(x) result(res) integer, intent(in) :: x integer :: res print *, x res = x * x end function print_and_square end module pure_side_effects_01_mod program pure_side_effects_01 use pure_side_effects_01_mod implicit none integer :: r r = square(3) if (r /= 9) error stop r = print_and_square(4) if (r /= 16) error stop end program pure_side_effects_01 lfortran-0.63.0/integration_tests/operator_overloading_05_module2.f900000664000175000017500000000021215174404631026057 0ustar alastairalastairmodule operator_overloading_05_module2 use operator_overloading_05_module1, only: string_type, operator(>=), assignment(=) end modulelfortran-0.63.0/integration_tests/intrinsics_42.f900000664000175000017500000000060215174404631022375 0ustar alastairalastairprogram intrinsics_42 implicit none real :: x = 3.0, y = 4.0, z = 5.0 real :: a = -6, b = 8, c = 10 real :: p = 1.2, q = 0.5, r = 1.3 if (abs(hypot(x, y) - (z * z)) > 1e5) error stop if (abs(hypot(a, b) - (c * c)) > 1e5) error stop if (abs(hypot(p, q) - (r * r)) > 1e5) error stop print *, x, y, z print *, a, b, c print *, p, q, r end program lfortran-0.63.0/integration_tests/arrays_intrin_03.f900000664000175000017500000000241615174404631023076 0ustar alastairalastairprogram arrays_intrin_03 integer :: i, j integer(8) :: x(3, 5), xmaxval, xmaxval1(5), correct1(5), correct2(5) logical :: modx(3, 5) correct1 = (/4_8, 5_8, 6_8, 7_8, 8_8/) correct2 = (/3_8, 5_8, 5_8, 7_8, 7_8/) do i = lbound(x, 1), ubound(x, 1) do j = lbound(x, 2), ubound(x, 2) x(i, j) = i + j modx(i, j) = mod(i + j, 2) == 1 end do end do xmaxval = maxval(x) print *, xmaxval if( xmaxval /= 8_8 ) error stop xmaxval = maxval(x, mask=modx) print *, xmaxval if( xmaxval /= 7_8 ) error stop xmaxval1 = maxval(x, 1) print *, xmaxval1 do i = lbound(xmaxval1, 1), ubound(xmaxval1, 1) if( xmaxval1(i) /= correct1(i) ) error stop end do xmaxval1 = maxval(x, 1, mask=modx) print *, xmaxval1 do i = lbound(xmaxval1, 1), ubound(xmaxval1, 1) if( xmaxval1(i) /= correct2(i) ) error stop end do xmaxval1 = maxval(x, dim=1) print *, xmaxval1 do i = lbound(xmaxval1, 1), ubound(xmaxval1, 1) if( xmaxval1(i) /= correct1(i) ) error stop end do xmaxval1 = maxval(x, dim=1, mask=modx) print *, xmaxval1 do i = lbound(xmaxval1, 1), ubound(xmaxval1, 1) if( xmaxval1(i) /= correct2(i) ) error stop end do end program lfortran-0.63.0/integration_tests/forall_01.f900000664000175000017500000000016315174404631021464 0ustar alastairalastairprogram forall_01 implicit none integer :: ivec(3), i forall(i=1:3) ivec(i)=i print *,ivec end program forall_01 lfortran-0.63.0/integration_tests/gpu_metal_25.f900000664000175000017500000000065715174404631022200 0ustar alastairalastairprogram gpu_metal_25 ! Test: do concurrent with array sized by derived-type member (x%n) implicit none type :: t integer :: n end type type(t) :: a a%n = 3 call sub(a) contains subroutine sub(x) type(t), intent(in) :: x integer :: i, s(x%n) do concurrent(i = 1:x%n) s(i) = i * 2 end do if (s(1) /= 2) error stop if (s(2) /= 4) error stop if (s(3) /= 6) error stop end subroutine end program lfortran-0.63.0/integration_tests/present_03.f900000664000175000017500000000037215174404631021671 0ustar alastairalastairprogram present_01 real, pointer :: tmp(:) tmp => null() call foo1(tmp) contains subroutine foo1(a) real, intent(in), optional :: a(:) ! Optional argument if (present(a)) error stop end subroutine end program lfortran-0.63.0/integration_tests/read_71.f900000664000175000017500000000113415174404631021126 0ustar alastairalastairprogram read_71 ! Test formatted READ into 2D complex array slice with ES format. ! Verifies that the exponent is correctly parsed when reading into ! an array section like arr(1,:). implicit none complex :: arr(1, 2) character(62) :: s s = " 1.000000E+00 5.000000E-01 2.000000E+00 3.000000E-01" read(s, '(es15.6,1x,es15.6,1x,es15.6,1x,es15.6)') arr(1, :) if (abs(real(arr(1,1)) - 1.0) > 1.0e-5) error stop if (abs(aimag(arr(1,1)) - 0.5) > 1.0e-5) error stop if (abs(real(arr(1,2)) - 2.0) > 1.0e-5) error stop if (abs(aimag(arr(1,2)) - 0.3) > 1.0e-5) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/procedure_22_a.f900000664000175000017500000000133115174404631022476 0ustar alastairalastairmodule procedure_22_mod_a implicit none type :: deps_t character(:), allocatable :: str contains procedure :: find_string => find_by_name generic :: find => find_string end type deps_t contains integer function find_by_name(self, name) class(deps_t), intent(in) :: self character(len=*), intent(in) :: name find_by_name = len_trim(name) end function find_by_name end module procedure_22_mod_a module procedure_22_mod_b use procedure_22_mod_a, only: deps_t contains function func(model) result(id) class(deps_t), intent(in) :: model integer :: id id = model%find(model%str) end function end module procedure_22_mod_blfortran-0.63.0/integration_tests/enum_06.f900000664000175000017500000000023715174404631021160 0ustar alastairalastairmodule enum_06_mod_lower use enum_06_mod_middle end module program pp use enum_06_mod_lower print *, red if(red /= 100) error stop end programlfortran-0.63.0/integration_tests/parsing_02.f900000664000175000017500000000266015174404631021655 0ustar alastairalastairmodule program_parsing_02_submodule implicit none integer :: complex = 1 logical :: true = .TRUE. logical :: false = .FALSE. type :: type type(type), allocatable :: types(:) end type interface module subroutine function(integer,real) integer, intent(in) :: integer integer, intent(out) :: real end subroutine function end interface contains end module program_parsing_02_submodule submodule (program_parsing_02_submodule) program_parsing_02_module contains module procedure function real = 2*integer end procedure function end submodule program_parsing_02_module program program_parsing_02 use program_parsing_02_submodule, only: character => complex, subroutine => function, & then => true, else => false, type implicit none integer :: integer, real type(type) :: types integer = character ! Thanks to https://stackoverflow.com/a/57015100/1876449 types = type(types=[type(types=[type(), type(), type()]), type()]) block: block logical :: if endif: if (then) then if = then else if (else) then if = else else if = .not.(else) .and. .not.(if) endif endif print *, if end block block associate: associate (logical=>character,complex=>real) call subroutine(logical,complex) print*, (complex) end associate associate end program program_parsing_02 lfortran-0.63.0/integration_tests/arrays_reshape_34.f900000664000175000017500000000146115174404631023225 0ustar alastairalastair! Test: reshape() with parameter array constructor used in subroutine ! Verifies that module-level parameter arrays initialized via reshape() ! with array constructors referencing other parameters work correctly ! when used as initializers in subroutine local parameters. module arrays_reshape_34_mod implicit none integer, parameter :: a(2) = [1, 2] integer, parameter :: b(2,2) = reshape([a, a], shape(b)) contains subroutine check_reshape_param() integer, parameter :: x(2,2) = b if (x(1,1) /= 1) error stop if (x(2,1) /= 2) error stop if (x(1,2) /= 1) error stop if (x(2,2) /= 2) error stop end subroutine end module program arrays_reshape_34 use arrays_reshape_34_mod implicit none call check_reshape_param() print *, "ok" end program lfortran-0.63.0/integration_tests/arrays_28.f900000664000175000017500000000452215174404631021522 0ustar alastairalastairprogram arrays_28 implicit none integer :: dim = 1, i, j, n = 6 integer(4) :: res_01(1), res_02(2) integer(8) :: res_03(1) integer(4) :: arr_01(6) = [-14, 3, 0, -2, 19, 1] integer(4) :: arr_02(3, 3) = reshape( & [-14, 30, -23, 0, -2, 1, -17, 7, -13], [3, 3]) integer(8) :: arr_03(6) = [-14_8, 3_8, 20_8, -2_8, 19_8, 1_8] real (4) :: arr_04(6) = [-14., 3., 0., -2., 19., 25.] integer(4), allocatable :: arr_05(:) real (8), allocatable :: arr_06(:) allocate(arr_05(n)) allocate(arr_06(n)) do i = 1, n arr_05(i) = arr_01(n - i + 1) end do do i = 1, n arr_06(i) = arr_04(n - i + 1) end do ! MaxLoc ! Compile-time if (minloc([-1, 0, -2, -3, -4], 1) /= 5) error stop if (minloc([-1., 0., -2., -5., -4.], 1) /= 4) error stop res_01 = minloc([-1_8, 2_8, -3_8, 4_8, -2_8]) if (res_01(1) /= 3) error stop res_03(1) = minloc([-1_8, 2_8, -3_8, 4_8, -5_8], 1, kind=8) if (res_03(1) /= 5_8) error stop ! Run-time if (minloc(arr_01, 1) /= 1) error stop res_02 = minloc(arr_02) if (res_02(1) /= 3 .or. res_02(2) /= 1) error stop res_01 = minloc(arr_03) if (res_01(1) /= 1) error stop res_01 = minloc(arr_04) if (res_01(1) /= 1) error stop if (minloc(arr_05, dim=1) /= 6) error stop res_01 = minloc(arr_06) if (res_01(1) /= 6) error stop res_03 = minloc(arr_04, kind=8) if (res_03(1) /= 1_8) error stop ! MaxLoc ! Compile-time if (maxloc([-1, 0, -2, -3, -4], 1) /= 2) error stop if (maxloc([-1., 0., -2., 3., -4.], 1) /= 4) error stop res_01 = maxloc([-1_8, 2_8, -3_8, 4_8, -5_8]) if (res_01(1) /= 4) error stop res_03(1) = maxloc([-1_8, 2_8, -3_8, 4_8, -5_8], 1, kind=8) if (res_03(1) /= 4_8) error stop ! Run-time if (maxloc(arr_01, 1) /= 5) error stop res_02 = maxloc(arr_02) if (res_02(1) /= 2 .and. res_02(2) /= 1) error stop res_01 = maxloc(arr_03) if (res_01(1) /= 3) error stop res_01 = maxloc(arr_04) if (res_01(1) /= 6) error stop if (maxloc(arr_05, dim=1) /= 2) error stop res_01 = maxloc(arr_06) if (res_01(1) /= 1) error stop res_03 = maxloc(arr_04, kind=8) if (res_03(1) /= 6_8) error stop end program arrays_28 lfortran-0.63.0/integration_tests/array_section_04.f900000664000175000017500000000153215174404631023053 0ustar alastairalastairmodule function_32_mod_array_section_04 contains subroutine istril(y) real(8), intent(inout) :: y(:, :) print *, y(2, 2) if ( abs(y(2,2) - 3.0) > 1e-8 ) error stop y(2, 2) = 4.0 end subroutine function istril_func(y) result(z) real(8), intent(inout) :: y(:, :) logical :: z print *, y(2, 2) z = .true. if ( abs(y(2,2) - 4.0) > 1e-8 ) z = .false. y(1,2) = 4.0 end function subroutine matprod(y) real(8), intent(inout) :: y(:, :) call istril(y) if(.not. istril_func(y)) error stop end subroutine end module program array_section_04 use function_32_mod_array_section_04 real(8) :: A(5, 3) A = 1.0_8 A(1,2) = 0 A(2,2) = 3.0 call matprod(A(1:2,1:2)) print *, A(2,2) if ( abs(A(2,2) - 4.0_8) > 1e-8 ) error stop if ( abs(A(1,2) - 4.0_8) > 1e-8 ) error stop end program lfortran-0.63.0/integration_tests/derived_types_121.f900000664000175000017500000000162415174404631023141 0ustar alastairalastairmodule derived_types_121_child use derived_types_121_module, only: ilp, state_type implicit none type, extends(state_type) :: child_type end type child_type contains pure function get_message(flag) result(msg) integer(ilp), intent(in) :: flag character(len=:), allocatable :: msg if (flag == 0) then msg = 'ok' else msg = 'error' end if end function get_message pure function print_msg(this) result(msg) class(child_type), intent(in) :: this character(len=:), allocatable :: msg msg = get_message(this%state) end function print_msg end module derived_types_121_child program derived_types_121 use derived_types_121_child implicit none type(child_type) :: c character(len=:), allocatable :: msg c%state = 0 msg = print_msg(c) if (msg /= 'ok') error stop c%state = 1 msg = print_msg(c) if (msg /= 'error') error stop print *, 'ok' end program derived_types_121 lfortran-0.63.0/integration_tests/nullify_02.f900000664000175000017500000000034315174404631021670 0ustar alastairalastairprogram nullify_02 implicit none real, pointer :: p1 real, target :: t1 integer, pointer :: p2 integer, target :: t2 p1=>t1 p1 = 1 p2=>t2 p2 = 2. nullify(p1, p2) end program nullify_02 lfortran-0.63.0/integration_tests/template_array_04b.f900000664000175000017500000000120715174404631023363 0ustar alastairalastairmodule template_array_04b_m implicit none private public :: test_reverse requirement default_behavior(t) type, deferred :: t end requirement contains subroutine swap{T}(x, y) require :: default_behavior(T) type(T), intent(inout) :: x, y type(T) :: tmp tmp = x x = y y = tmp end subroutine subroutine test_reverse() integer :: a(2) a = [1,2] print *, a call swap{integer}(a(1),a(2)) print *, a end subroutine end module program template_array_04b use template_array_04b_m call test_reverse() end program lfortran-0.63.0/integration_tests/intrinsics_368.f900000664000175000017500000000144015174404631022471 0ustar alastairalastairmodule intrinsics_368_test_mod implicit none logical, parameter :: param=ichar(transfer(1,'a')) == 0 end module intrinsics_368_test_mod program intrinsics_368 use intrinsics_368_test_mod implicit none integer(kind=transfer(4_1, 0)) :: x1 integer(kind=kind(0)) :: x2 integer(kind=(4+0)) :: x3 integer :: i integer(kind=sum([(i, i=0,3)])-2) :: x4 integer(kind=INT(61*BESSEL_JN(4, 2.5))) :: x5 integer,parameter::dp=kind(1d0),nextp=selected_real_kind(precision(1d0)+1) integer,parameter::ep = merge(nextp,dp,nextp>0) print *,'pi=acos(-1.0_dp)=', acos(-1.0_dp) if (abs(acos(-1.0_dp) - 3.1415926535897931) > 1e-7) error stop print *,'pi=acos(-1.0_ep)=',acos(-1.0_ep) if (abs(acos(-1.0_ep) - 3.1415926535897931) > 1e-7) error stop end programlfortran-0.63.0/integration_tests/struct_type_07.f900000664000175000017500000000102715174404631022600 0ustar alastairalastairmodule struct_type_07_m implicit none type :: t real :: a end type t contains function f() result(res) type(t) :: res(2,2) res%a = reshape([1.0,2.0,3.0,4.0],[2,2]) end function f end module struct_type_07_m program struct_type_07 use struct_type_07_m implicit none type(t) :: result(2,2) result = f() if (result(1,1)%a /= 1.0) stop 1 if (result(2,1)%a /= 2.0) stop 2 if (result(1,2)%a /= 3.0) stop 3 if (result(2,2)%a /= 4.0) stop 4 print *, "Test passed!" end program struct_type_07 lfortran-0.63.0/integration_tests/include_03.f900000664000175000017500000000021015174404631021623 0ustar alastairalastairprogram include_03 implicit none include 'i.inc' integer, dimension(i) :: x print *, i if (i /= 4) error stop end program include_03 lfortran-0.63.0/integration_tests/subroutines_03.f900000664000175000017500000000073515174404631022576 0ustar alastairalastairprogram subroutines_03 implicit none integer :: i, j, k, l i = 1 j = 1 k = 1 l = 1 call f(i, j, k, l) print *, j if (j /= 4) error stop call f(i, j, d=l, c=k) print *, j if (j /= 4) error stop call f(a=i, b=j, d=l, c=k) print *, j if (j /= 4) error stop call f(b=j, a=i, c=k, d=l) print *, j if (j /= 4) error stop contains subroutine f(a, b, c, d) integer, intent(in) :: a, c, d integer, intent(out) :: b b = a + 1 + c + d end subroutine end program lfortran-0.63.0/integration_tests/bindc_18.f900000664000175000017500000000064115174404631021275 0ustar alastairalastairsubroutine sub(s) bind(C) implicit none character(len=:), allocatable :: s s = "hello" end subroutine program bindc_18 implicit none interface subroutine sub(s) bind(C) implicit none character(len=:), allocatable :: s end subroutine end interface character(len=:), allocatable :: e call sub(e) print *, e if (len(e) /= 5) error stop if (e /= "hello") error stop end program lfortran-0.63.0/integration_tests/separate_compilation_14a.f900000664000175000017500000000021715174404631024554 0ustar alastairalastairmodule separate_compilation_14a_module integer :: global_var integer :: global_var_initialised = 89 end module separate_compilation_14a_module lfortran-0.63.0/integration_tests/derived_types_116.f900000664000175000017500000000070715174404631023146 0ustar alastairalastairmodule derived_types_116_mod implicit none type :: t real :: v contains procedure :: get_v end type type(t), parameter :: x = t(1.0) contains real function get_v(self) class(t), intent(in) :: self get_v = self%v end function end module program derived_types_116 use derived_types_116_mod, only: x implicit none real :: r r = x%get_v() if (abs(r - 1.0) > 1e-6) error stop print *, r end program derived_types_116 lfortran-0.63.0/integration_tests/pdt_02_module.f900000664000175000017500000000031315174404631022337 0ustar alastairalastairmodule pdt_02_mod type :: container(rk, ik) integer, kind :: rk = 4 integer, kind :: ik = 8 integer(kind=ik) :: i_val(20) real(kind=rk) :: r_val(20) end type container end modulelfortran-0.63.0/integration_tests/arrays_119.f900000664000175000017500000000031215174404631021574 0ustar alastairalastairprogram arrays_119 implicit none integer(8) :: ilist(1, 1) integer, parameter :: x = 1 ilist(1, 1:1) = [x] if (ilist(1, 1) /= 1) error stop print *, ilist end program arrays_119 lfortran-0.63.0/integration_tests/arrays_op_31.f900000664000175000017500000000216615174404631022214 0ustar alastairalastairmodule arrays_op_31_mod implicit none contains module function softmax_r3_sp(x, dim) result(y) real, intent(in) :: x(:, :, :) real :: y(size(x, 1), size(x, 2), size(x, 3)) integer, intent(in), optional :: dim integer :: j if (.not. present(dim)) error stop 1 do j = 1, size(x, dim=1) y(j, :, :) = softmax_r2_sp(x(j, :, :), dim=2) end do if (size(y, 1) /= size(x, 1)) error stop 2 if (size(y, 2) /= size(x, 2)) error stop 3 if (size(y, 3) /= size(x, 3)) error stop 4 end function softmax_r3_sp module function softmax_r2_sp(x, dim) result(y) real, intent(in) :: x(:, :) real :: y(size(x, 1), size(x, 2)) integer, intent(in) :: dim y = x + 0.0 * dim end function softmax_r2_sp end module arrays_op_31_mod program arrays_op_31 use arrays_op_31_mod, only: softmax_r3_sp implicit none real :: x(2, 3, 4), y(2, 3, 4) integer :: i x = reshape([(real(i), i = 1, size(x))], shape(x)) y = softmax_r3_sp(x, dim=3) if (any(y /= x)) error stop 5 end program arrays_op_31 lfortran-0.63.0/integration_tests/external_09.f900000664000175000017500000000075315174404631022044 0ustar alastairalastairsubroutine map_xi_to_c (cs, cv) implicit none real, dimension(2), intent(in) :: cs real, intent(out) :: cv real, external :: fold cv=fold(cs(1)) return end function fold (x0) implicit none real :: fold real :: x0 fold = x0 end program external_09 implicit none real :: cv = 12.91 real, dimension(2) :: cs = [12.92, -22.0] call map_xi_to_c(cs, cv) print *, cv if ( abs(cv - 12.92) > 1e-8 ) error stop end program external_09 lfortran-0.63.0/integration_tests/intrinsics_383.f900000664000175000017500000000065715174404631022477 0ustar alastairalastairprogram intrinsics_383 implicit none integer, allocatable :: arr1(:) integer, allocatable :: arr2(:, :) allocate(arr1(3)) arr1 = [1, 2, 3] print *, pack(arr1, .true.) if (any(pack(arr1, .true.) /= [1, 2, 3])) error stop allocate(arr2(2, 3)) arr2 = reshape([1, 2, 3, 4, 5, 6], [2, 3]) print *, pack(arr2, .true.) if (any(pack(arr2, .true.) /= [1, 2, 3, 4, 5, 6])) error stop end programlfortran-0.63.0/integration_tests/gpu_metal_83.f900000664000175000017500000000116315174404631022175 0ustar alastairalastairmodule gpu_metal_83_m implicit none type :: t integer, allocatable :: x(:) contains procedure :: n end type contains pure integer function n(self) class(t), intent(in) :: self n = size(self%x) end function end module program gpu_metal_83 ! Test: size() on allocatable derived-type member via type-bound procedure ! inside do concurrent (Metal GPU offload) use gpu_metal_83_m implicit none type(t) :: obj integer :: r(1) integer :: i allocate(obj%x(3)) obj%x = [10, 20, 30] do concurrent (i = 1:1) r(i) = obj%n() end do if (r(1) /= 3) error stop print *, r(1) end program lfortran-0.63.0/integration_tests/intrinsics_11.f900000664000175000017500000000015515174404631022374 0ustar alastairalastairprogram intrinsics_11 integer, parameter :: x = 3 real, parameter :: y = real(x) print*, y end program lfortran-0.63.0/integration_tests/gpu_metal_172.f900000664000175000017500000000105115174404631022250 0ustar alastairalastairprogram gpu_metal_172 implicit none real :: x(2,2), res(2,2) integer :: i x(:,1) = [1.0, 2.0] x(:,2) = [3.0, 4.0] do concurrent (i = 1:2) res(:,i) = copy(x(:,i)) end do if (abs(res(1,1) - 1.0) > 1e-6) error stop if (abs(res(2,1) - 2.0) > 1e-6) error stop if (abs(res(1,2) - 3.0) > 1e-6) error stop if (abs(res(2,2) - 4.0) > 1e-6) error stop print *, "PASS" contains pure function copy(a) result(b) real, intent(in) :: a(:) real, allocatable :: b(:) allocate(b(size(a))) b = a end function end program lfortran-0.63.0/integration_tests/arrays_intrin_04.f900000664000175000017500000000052615174404631023077 0ustar alastairalastairprogram arrays_intrin_04 integer :: i, j integer, parameter :: dp = kind(0.d0) real(dp) :: x(3, 5), xdiff do i = 1, 3 do j = 1, 5 x(i, j) = (i + j) / 7._dp end do end do xdiff = abs(maxval(x) - (8._dp / 7)) print *, xdiff, maxval(x) if( xdiff > 1e-6_dp ) error stop end program lfortran-0.63.0/integration_tests/submodule_48.f900000664000175000017500000000516715174404631022230 0ustar alastairalastairmodule submodule_48_mod use, intrinsic :: iso_fortran_env, only: real32 implicit none interface softmax module procedure softmax_r1_sp, softmax_r2_sp, softmax_r3_sp end interface interface pure module function softmax_r1_sp(x) result(y) real(real32), intent(in) :: x(:) real(real32) :: y(size(x)) end function pure module function softmax_r2_sp(x, dim) result(y) real(real32), intent(in) :: x(:,:) integer, intent(in), optional :: dim real(real32) :: y(size(x,1), size(x,2)) end function pure module function softmax_r3_sp(x, dim) result(y) real(real32), intent(in) :: x(:,:,:) integer, intent(in), optional :: dim real(real32) :: y(size(x,1), size(x,2), size(x,3)) end function end interface end module submodule_48_mod submodule (submodule_48_mod) submodule_48_smod contains pure module function softmax_r1_sp(x) result(y) real(real32), intent(in) :: x(:) real(real32) :: y(size(x)) y = exp(x - maxval(x)) y = y / sum(y) end function pure module function softmax_r2_sp(x, dim) result(y) real(real32), intent(in) :: x(:,:) integer, intent(in), optional :: dim real(real32) :: y(size(x,1), size(x,2)) integer :: dim_, j dim_ = 1 if (present(dim)) dim_ = dim if (dim_ < 2) then do j = 1, size(x, dim=2) y(:, j) = softmax(x(:, j)) end do else do j = 1, size(x, dim=1) y(j, :) = softmax(x(j, :)) end do end if end function pure module function softmax_r3_sp(x, dim) result(y) real(real32), intent(in) :: x(:,:,:) integer, intent(in), optional :: dim real(real32) :: y(size(x,1), size(x,2), size(x,3)) integer :: dim_, j dim_ = 1 if (present(dim)) dim_ = dim if (dim_ < 3) then do j = 1, size(x, dim=3) y(:,:,j) = softmax(x(:,:,j), dim=dim_) end do else do j = 1, size(x, dim=1) y(j,:,:) = softmax(x(j,:,:), dim=2) end do end if end function end submodule submodule_48_smod program submodule_48 use, intrinsic :: iso_fortran_env, only: real32 use submodule_48_mod, only: softmax implicit none real(real32), parameter :: tol = 1.0e-6_real32 real(real32) :: x(2,2,2), y(2,2,2), y_ref(2,2,2), t(2) integer :: i, k x = reshape([1.0_real32, 2.0_real32, 3.0_real32, 4.0_real32, & 5.0_real32, 6.0_real32, 7.0_real32, 8.0_real32], [2,2,2]) y = softmax(x, dim=2) do k = 1, 2 do i = 1, 2 t = exp(x(i,:,k) - maxval(x(i,:,k))) y_ref(i,:,k) = t / sum(t) end do end do print *, norm2(y-y_ref) if (norm2(y-y_ref) > tol) error stop 1 end program submodule_48 lfortran-0.63.0/integration_tests/pdt_02.f900000664000175000017500000000077015174404631021001 0ustar alastairalastairprogram pdt_02 use pdt_02_mod implicit none type(container) :: obj1 type(container(8,4)) :: obj2 type(container(8)) :: obj3 if (kind(obj1%i_val) /= 8 .or. obj1%ik /= 8) error stop if (kind(obj1%r_val) /= 4 .or. obj1%rk /= 4) error stop if (kind(obj2%i_val) /= 4 .or. obj2%ik /= 4) error stop if (kind(obj2%r_val) /= 8 .or. obj2%rk /= 8) error stop if (kind(obj3%i_val) /= 8 .or. obj3%ik /= 8) error stop if (kind(obj3%r_val) /= 8 .or. obj3%rk /= 8) error stop end program pdt_02lfortran-0.63.0/integration_tests/test_ieee_arithmetic_03.f900000664000175000017500000000114615174404631024370 0ustar alastairalastairprogram test_ieee use, intrinsic :: ieee_arithmetic, only: ieee_support_inf, ieee_support_nan implicit none real(4) :: arr_sp(5) = [1.0, 2.0, 3.0, 4.0, 5.0] real(8) :: arr_dp(3) = [1.0d0, 2.0d0, 3.0d0] logical :: result_sp(5), result_dp(3) result_sp = ieee_support_inf(arr_sp) if (.not. all(result_sp)) error stop result_sp = ieee_support_nan(arr_sp) if (.not. all(result_sp)) error stop result_dp = ieee_support_inf(arr_dp) if (.not. all(result_dp)) error stop result_dp = ieee_support_nan(arr_dp) if (.not. all(result_dp)) error stop print *, "test passed" end program test_ieee lfortran-0.63.0/integration_tests/class_62.f900000664000175000017500000000100215174404631021312 0ustar alastairalastairmodule class_62_mod implicit none contains subroutine handle_generic(generic) class(*), intent(inout) :: generic select type(generic) type is (integer) call get_args(generic) end select end subroutine handle_generic subroutine get_args(x) integer, intent(out) :: x x = 3 end subroutine get_args end module class_62_mod program class_62 use class_62_mod implicit none integer :: value call handle_generic(value) if (value /= 3) error stop end program class_62lfortran-0.63.0/integration_tests/allocatable_component_unnamed_unallocated_01.f900000664000175000017500000000060015174404631030610 0ustar alastairalastairprogram allocatable_component_unnamed_unallocated_01 implicit none type :: t integer, allocatable :: arr(:) end type t type(t) :: x(1) x(1)%arr = [1, 2, 3] if (.not. allocated(x(1)%arr)) error stop if (size(x(1)%arr) /= 3) error stop if (.not. all(x(1)%arr == [1, 2, 3])) error stop end program allocatable_component_unnamed_unallocated_01 lfortran-0.63.0/integration_tests/arrays_03_size.f900000664000175000017500000000105415174404631022542 0ustar alastairalastairprogram arrays_03_size implicit none integer :: i, a(3), b(4) integer :: size_a integer :: size_b integer :: size_fjac real :: x(3), fvec(15), fjac(size(fvec), size(x)) size_a = size(a, kind=4) size_b = size(b, dim=1, kind=4) if (size_a /= 3) error stop if (size_b /= 4) error stop ! issue - 1133 size_fjac = size(fjac, 1) if (size_fjac /= 15) error stop i = 1 size_fjac = size(fjac, i) if (size_fjac /= 15) error stop size_fjac = size(fjac, 2) if (size_fjac /= 3) error stop end lfortran-0.63.0/integration_tests/class_108.f900000664000175000017500000000057215174404631021406 0ustar alastairalastairprogram class_108 implicit none type ring_t end type type(ring_t) :: ring integer :: i logical :: b do i = 1, 2000000 b = test(ring) if (b) error stop 1 end do print *, 'done' contains logical function test(this) class(ring_t), intent(inout) :: this test = .false. end function test end program lfortran-0.63.0/integration_tests/test_ieee_is_finite.f900000664000175000017500000000510015174404631023700 0ustar alastairalastair! Test ieee_is_finite function program test_ieee_is_finite use, intrinsic :: ieee_arithmetic use, intrinsic :: iso_fortran_env, only: real32, real64 implicit none real(real32) :: x_sp, inf_sp, nan_sp, tmp_sp real(real64) :: x_dp logical :: result print *, "Testing ieee_is_finite..." tmp_sp = 1.0_real32 ! Test 1: Normal finite value x_sp = 1.0_real32 result = ieee_is_finite(x_sp) print *, "ieee_is_finite(1.0) = ", result if (.not. result) error stop "1.0 should be finite" ! Test 2: Negative finite value x_sp = -100.0_real32 result = ieee_is_finite(x_sp) print *, "ieee_is_finite(-100.0) = ", result if (.not. result) error stop "-100.0 should be finite" ! Test 3: Zero (finite) x_sp = 0.0_real32 result = ieee_is_finite(x_sp) print *, "ieee_is_finite(0.0) = ", result if (.not. result) error stop "0.0 should be finite" ! Test 4: Large but finite value x_sp = huge(tmp_sp) * 0.5_real32 result = ieee_is_finite(x_sp) print *, "ieee_is_finite(large) = ", result if (.not. result) error stop "Large value should be finite" ! Test 5: Tiny but finite value x_sp = tiny(tmp_sp) result = ieee_is_finite(x_sp) print *, "ieee_is_finite(tiny) = ", result if (.not. result) error stop "Tiny value should be finite" ! Test 6: Positive infinity (not finite) inf_sp = ieee_value(tmp_sp, ieee_positive_inf) result = ieee_is_finite(inf_sp) print *, "ieee_is_finite(+inf) = ", result if (result) error stop "+inf should not be finite" ! Test 7: Negative infinity (not finite) inf_sp = ieee_value(tmp_sp, ieee_negative_inf) result = ieee_is_finite(inf_sp) print *, "ieee_is_finite(-inf) = ", result if (result) error stop "-inf should not be finite" ! Test 8: NaN (not finite) nan_sp = ieee_value(tmp_sp, ieee_quiet_nan) result = ieee_is_finite(nan_sp) print *, "ieee_is_finite(NaN) = ", result if (result) error stop "NaN should not be finite" ! Test 9: Double precision finite x_dp = 3.14159_real64 result = ieee_is_finite(x_dp) print *, "ieee_is_finite(3.14159d0) = ", result if (.not. result) error stop "3.14159d0 should be finite" ! Test 10: Denormal (finite) x_sp = ieee_value(tmp_sp, ieee_positive_denormal) result = ieee_is_finite(x_sp) print *, "ieee_is_finite(denormal) = ", result if (.not. result) error stop "Denormal should be finite" print *, "All ieee_is_finite tests passed!" end program test_ieee_is_finite lfortran-0.63.0/integration_tests/functions_53.f900000664000175000017500000000051615174404631022226 0ustar alastairalastairprogram functions_53 implicit none type :: temp integer, allocatable :: arr(:) end type type(temp), allocatable :: x x = parse_temp() if (.not. allocated(x)) error stop contains function parse_temp() result(res) type(temp) :: res allocate(res%arr(2)) end function end programlfortran-0.63.0/integration_tests/implicit_interface_21.f900000664000175000017500000000212315174404631024037 0ustar alastairalastair! Test sequence association: passing array element D(1,J) to assumed-size dummy ! This pattern is common in legacy Fortran (e.g., LAPACK) where a 2D array column ! is passed by referencing its first element: CALL SUB(A(1, N), M) ! The callee receives a pointer to A(1,N) and accesses subsequent elements. subroutine print_sum(arr, n) implicit none real, intent(in) :: arr(*) integer, intent(in) :: n real :: s integer :: j s = 0.0 do j = 1, n s = s + arr(j) end do if (abs(s - 50.0) > 1.0e-5) error stop end subroutine program implicit_interface_21 implicit none real :: d(4, 3) integer :: i ! Initialize: column 1 = 1,2,3,4; column 2 = 11,12,13,14; column 3 = 21,22,23,24 do i = 1, 4 d(i, 1) = real(i) d(i, 2) = real(i + 10) d(i, 3) = real(i + 20) end do ! Pass D(1, 2) as start of column 2 to assumed-size dummy ! Sequence association: the subroutine sees arr(1)=11, arr(2)=12, arr(3)=13, arr(4)=14 ! Sum should be 11+12+13+14 = 50 call print_sum(d(1, 2), 4) print *, "PASSED" end program lfortran-0.63.0/integration_tests/template_02.f900000664000175000017500000000236215174404631022024 0ustar alastairalastairmodule template_02_m implicit none requirement eq(t, ne) type, deferred :: t function ne(lhs, rhs) type(t), intent(in) :: lhs, rhs logical :: ne end function end requirement template change_positions_tmpl(t, ne) require :: eq(t, ne) private public :: change_positions_t contains function change_positions_t(vec) result(mask) type(t), intent(in) :: vec(:) integer, allocatable :: pos(:), mask(:) integer :: i, j, n n = size(vec) allocate (pos(n)) if (n < 1) return pos = 0 pos(1) = 1 j = 1 do i = 2,n if (ne(vec(i), vec(i-1))) then j = j+1 pos(j) = i end if end do allocate(mask(j)) do i = 1,j mask(i) = pos(i) end do end function end template end module program template_02 use template_02_m implicit none instantiate change_positions_tmpl(integer, operator(/=)), & only: change_positions_int => change_positions_t instantiate change_positions_tmpl(character, operator(/=)), & only: change_positions_chr => change_positions_t print *, change_positions_int([3, 3, 6, 2, 2, 2, 1]) print *, change_positions_chr(["a", "a", "b", "p", "p", "p", "o"]) end program lfortran-0.63.0/integration_tests/string_82.f900000664000175000017500000000053015174404631021522 0ustar alastairalastairprogram string_82 class(*), allocatable :: x allocate(x, source='abc') select type (x) type is (character(len=*)) print *, "String type" ! print *, x ! <<<<<<<<<<<<<<<<<< unlimited polymorphic types not supported yet class default print *, "Unknown type" error stop end select end programlfortran-0.63.0/integration_tests/modules_09_b.f900000664000175000017500000000022215174404631022162 0ustar alastairalastairmodule modules_09_b implicit none private public b, i integer, parameter :: i = 5 contains integer function b() b = 5 end function end module lfortran-0.63.0/integration_tests/intrinsics_08.f900000664000175000017500000000032015174404631022374 0ustar alastairalastairprogram intrinsics_08 real, parameter :: x=tiny(1.0) real (kind = 8) :: b real (kind = 8), parameter :: y=tiny(b) real, parameter :: z=tiny([1.0, 2.0]) print*, x print*, y print*, z end program lfortran-0.63.0/integration_tests/submodule_21b.f900000664000175000017500000000131415174404631022347 0ustar alastairalastairmodule submodule_21b_string_mod implicit none private public :: string_t type string_t character(len=:), allocatable :: string_ contains generic :: assignment(=) => assign_character_to_string_t procedure, private :: assign_character_to_string_t procedure :: file_extension end type interface elemental module subroutine assign_character_to_string_t(lhs, rhs) class(string_t), intent(inout) :: lhs character(len=*), intent(in) :: rhs end subroutine elemental module function file_extension(self) result(extension) class(string_t), intent(in) :: self type(string_t) :: extension end function end interface end module submodule_21b_string_mod lfortran-0.63.0/integration_tests/intrinsics_125.f900000664000175000017500000000145015174404631022461 0ustar alastairalastairprogram intrinsic_125 implicit none real, allocatable :: array(:) integer :: freq(100), i, rand_nums_gen_limit, rand_num, min_rand_num, max_rand_num real :: expected_freq, accuracy_min, accuracy_max rand_nums_gen_limit = 5000000 expected_freq = float(rand_nums_gen_limit) / 100 freq = 0 allocate (array(rand_nums_gen_limit)) call random_number(array) do i = 1, rand_nums_gen_limit rand_num = 1 + mod(int(array(i) * 100), 100) freq(rand_num) = freq(rand_num) + 1 end do min_rand_num = minval(freq) max_rand_num = maxval(freq) accuracy_min = min_rand_num / expected_freq accuracy_max = max_rand_num / expected_freq print *, accuracy_min, accuracy_max if ((accuracy_max - accuracy_min) > 0.05) error stop end program lfortran-0.63.0/integration_tests/intrinsics_399.f900000664000175000017500000000057515174404631022505 0ustar alastairalastairprogram intrinsics_399 debugit: block integer :: j, ilen character(len=256) :: big_argument write(*,*)'arguments seen directly by program' do j=1,command_argument_count() call get_command_argument(number=j,value=big_argument,length=ilen) write(*,'(*(g0))')j,'[',big_argument(:ilen),']' end do end block debugit end program intrinsics_399lfortran-0.63.0/integration_tests/fixed_form_io_keyword_01.f900000664000175000017500000000060515174404631024563 0ustar alastairalastair program fixed_form_io_keyword_01 integer printp, readi, writej, closek common /rkcom3/ printp save /rkcom3/ printp = 1 readi = 2 writej = 3 closek = 4 if (printp /= 1) error stop if (readi /= 2) error stop if (writej /= 3) error stop if (closek /= 4) error stop print *, printp, readi, writej, closek end lfortran-0.63.0/integration_tests/assign_to1.f900000664000175000017500000000012315174404631021750 0ustar alastairalastairprogram main 1000 if (0<1) assign 15 to k 100 goto k 15 print *, "run" end program lfortran-0.63.0/integration_tests/nested_17.f900000664000175000017500000000102115174404631021470 0ustar alastairalastairmodule nested_17_mod type t integer :: i = 1 end type type(t), parameter :: t_param = t() contains subroutine ss() type(t), parameter :: t_param2 = t() call ss_in contains subroutine ss_in() print *, t_param%i if(t_param%i /= 1) error stop print *, t_param2%i if(t_param2%i /= 1) error stop end subroutine end subroutine end module program nested_17 use nested_17_mod call ss() end programlfortran-0.63.0/integration_tests/array_indices_array_item.f900000664000175000017500000000362315174404631024741 0ustar alastairalastairprogram array_indices_array_item implicit none integer :: arr_idx(2) integer, allocatable :: arr_idx2(:) integer, allocatable :: arr(:, :) real :: arr_1(2, 2), arr_2(2), arr_3(2, 2, 2), arr_4(2, 2) real :: arr_2_reshape(2), arr_4_reshape(2, 2) integer :: rank_val ! Initialize the matrices and arrays arr_1 = reshape([1.0, 2.0, 3.0, 4.0], shape(arr_1)) arr_3 = reshape([1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0], shape(arr_3)) arr_idx = [2, 1] allocate(arr_idx2(2)) arr_idx2 = [2, 1] !Slicing arr_2 = arr_1(arr_idx, 1) arr_2_reshape = reshape([2.0, 1.0], shape(arr_2_reshape)); print *, rank(arr_2) if (rank(arr_2) /= 1) error stop if (any(arr_2 /= arr_2_reshape)) error stop arr_4 = arr_3(1, arr_idx, arr_idx) arr_4_reshape = reshape([3.0, 1.0, 3.0, 1.0], shape(arr_4_reshape)); if (rank(arr_4) /= 2) error stop if (any(arr_4 /= arr_4_reshape)) error stop rank_val = rank(arr_3(1, arr_idx, 2)) print *, rank_val if (rank_val /= 1) error stop rank_val = rank(arr_3(1, [2, 1], 2)) print *, rank_val if (rank_val /= 1) error stop arr_2 = arr_1(arr_idx2, 1) arr_2_reshape = reshape([2.0, 1.0], shape(arr_2_reshape)); print *, rank(arr_2) if (rank(arr_2) /= 1) error stop if (any(arr_2 /= arr_2_reshape)) error stop arr_4 = arr_3(1, arr_idx2, arr_idx2) arr_4_reshape = reshape([3.0, 1.0, 3.0, 1.0], shape(arr_4_reshape)); print *, rank(arr_4) if (rank(arr_4) /= 2) error stop if (any(arr_4 /= arr_4_reshape)) error stop rank_val = rank(arr_3(1, arr_idx2, 2)) print *, rank_val if (rank_val /= 1) error stop allocate(arr(2, 3)) arr = reshape([1, 2, 3, 4, 5, 6], shape(arr)) rank_val = rank(arr(arr_idx, 1)) print *, rank_val if (rank_val /= 1) error stop if (any(arr(arr_idx, 1) /= [2, 1])) error stop end program array_indices_array_item lfortran-0.63.0/integration_tests/select_type_45.f900000664000175000017500000000211415174404631022533 0ustar alastairalastair! Test: Allocatable character array inside class member via select type ! Verifies that string descriptors for character arrays in heap-allocated ! struct members are correctly heap-allocated (not stack-allocated). module select_type_45_types implicit none type :: t character(len=5), allocatable :: name(:) end type contains subroutine setup(x, names) class(t), allocatable, intent(out) :: x character(len=5), allocatable, intent(in) :: names(:) allocate(t :: x) select type(x) type is (t) x%name = names end select end subroutine end module program select_type_45 use select_type_45_types implicit none integer :: i class(t), allocatable :: x character(len=5), allocatable :: names(:) allocate(names(3)) names(1) = 'aaa' names(2) = 'bbb' names(3) = 'ccc' call setup(x, names) select type(x) type is (t) if (size(x%name) /= 3) error stop if (trim(x%name(1)) /= 'aaa') error stop if (trim(x%name(2)) /= 'bbb') error stop if (trim(x%name(3)) /= 'ccc') error stop do i = 1, 3 print *, trim(x%name(i)) end do end select end program lfortran-0.63.0/integration_tests/bindc_08.f900000664000175000017500000000111615174404631021272 0ustar alastairalastairprogram optional_06 use iso_c_binding, only: c_char, c_int, c_null_char implicit none interface function c_is_dir(path) result(r) bind(c, name="c_is_dir") import c_char, c_int character(kind=c_char), intent(in) :: path(*) integer(kind=c_int) :: r end function c_is_dir end interface character(:), allocatable :: tmp_chars(:) integer :: res tmp_chars = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'] ! res = c_is_dir(tmp_chars) !! TODO: Handle descriptor array passed to bind c end program optional_06lfortran-0.63.0/integration_tests/print_07.f900000664000175000017500000000173315174404631021353 0ustar alastairalastairprogram print_07 implicit none character(20) :: output ! Test RU - Round Up write(output, "(RU,F6.2)") 1.235 print *, output if (output /= " 1.24") error stop "RU rounding failed" ! Test RD - Round Down write(output, "(RD,F6.2)") 1.235 print *, output if (output /= " 1.23") error stop "RD rounding failed" ! Test RN - Round to Nearest (round half away from zero) write(output, "(RN,F6.2)") 1.235 print *, output if (output /= " 1.24") error stop "RN rounding (1.235) failed" write(output, "(RN,F6.2)") 1.225 print *, output if (output /= " 1.23") error stop "RN rounding (1.225) failed" ! Test RZ - Round toward Zero write(output, "(RZ,F6.2)") 1.225 print *, output if (output /= " 1.22") error stop "RZ rounding (1.225) failed" write(output, "(RZ,F6.2)") 1.235 print *, output if (output /= " 1.23") error stop "RZ rounding (1.235) failed" end program lfortran-0.63.0/integration_tests/arrays_04_size.f900000664000175000017500000000233615174404631022547 0ustar alastairalastair! This test checks for handling different arrays sizes kind correctly with no runtime errors. PROGRAM arrays_04_size IMPLICIT NONE INTEGER(1) :: nang1 = 127 INTEGER(2) :: nang2 = 32767 INTEGER(4) :: nang4 = 2147483647 INTEGER(8) :: nang8 = 9223372036854775807_8 CALL my_subroutine CONTAINS SUBROUTINE my_subroutine INTEGER, DIMENSION(nang1) :: fxhv1 INTEGER, DIMENSION(nang2) :: fxhv2 INTEGER, DIMENSION(nang4) :: fxhv4 INTEGER, DIMENSION(nang8) :: fxhv8 print *, size(fxhv1, kind = 1) print *, size(fxhv1, kind = 2) print *, size(fxhv1, kind = 4) print *, size(fxhv1, kind = 8) print *, size(fxhv2, kind = 1) print *, size(fxhv2, kind = 2) print *, size(fxhv2, kind = 4) print *, size(fxhv2, kind = 8) print *, size(fxhv4, kind = 1) print *, size(fxhv4, kind = 2) print *, size(fxhv4, kind = 4) print *, size(fxhv4, kind = 8) print *, size(fxhv8, kind = 1) print *, size(fxhv8, kind = 2) print *, size(fxhv8, kind = 4) print *, size(fxhv8, kind = 8) END SUBROUTINE my_subroutine END PROGRAM arrays_04_size lfortran-0.63.0/integration_tests/derived_types_94.f900000664000175000017500000000151515174404631023071 0ustar alastairalastair! Test casting an array from C-Struct Type INTO Fortran Class {VTable +CStruct} program derived_types_94 implicit none type :: tt integer :: n end type tt type(tt), allocatable :: arr(:) allocate(arr(4)) arr(1)%n = 1 arr(2)%n = 2 arr(3)%n = 3 arr(4)%n = 4 call foo(arr) call foo2(arr) contains subroutine foo(arg) class(tt), intent(in) :: arg(:) integer :: i do i = 1, size(arg) write(*,*) "Package Name: ", arg(i)%n if(arg(i)%n /= i) error stop end do end subroutine subroutine foo2(arg) class(tt), intent(in) :: arg(4) integer :: i do i = 1, size(arg) write(*,*) "Package Name: ", arg(i)%n if(arg(i)%n /= i) error stop end do end subroutine end programlfortran-0.63.0/integration_tests/arrays_78.f900000664000175000017500000000103215174404631021520 0ustar alastairalastair! This test ensures that reshape's return gets ! assigned correctly to the LHS if it's `PointerToData`-physicalType array. program arrays_78 integer :: x(2,3) = reshape([1, 2, 3, 4, 5, 6], [2,3]) call func(x) contains subroutine func(x) integer, intent(in) :: x(:, :) integer :: y(size(x, 2), size(x, 1)) print *, reshape(x, [3,2]) y = reshape(x, shape(y)) print *, y if(any(y /= reshape([1, 2, 3, 4, 5, 6], [3,2]))) error stop end subroutine end program arrays_78 lfortran-0.63.0/integration_tests/derived_types_71.f900000664000175000017500000000134715174404631023067 0ustar alastairalastairmodule derived_type_71_mod type build_target_t integer :: key end type type build_target_ptr type(build_target_t), pointer :: ptr end type build_target_ptr end module program derived_type_71 use derived_type_71_mod type(build_target_t), pointer :: x type(build_target_t), target :: z type(build_target_ptr) :: y z%key = 12 x => z y = build_target_ptr(x) if (y%ptr%key /= 12) error stop call temp(y) if (y%ptr%key /= 15) error stop contains subroutine temp(b1) type(build_target_ptr), intent(inout) :: b1 call temp2(b1%ptr) end subroutine subroutine temp2(b2) type(build_target_t), intent(inout) :: b2 b2%key = 15 end subroutine end program lfortran-0.63.0/integration_tests/arrays_12_size.f900000664000175000017500000000057615174404631022552 0ustar alastairalastairmodule arrays_12_size_mod contains subroutine sub(xx) real, intent(in) :: xx(:) real :: buggy(int(2.0*count(xx > 0.0))) print * , size(buggy) if (size(buggy) /= 6) error stop end subroutine sub end module arrays_12_size_mod program arrays_12_size use arrays_12_size_mod real :: xx(5) = [1.1, 2.1, -1.3, 3.4, 0.0] call sub(xx) end program arrays_12_size lfortran-0.63.0/integration_tests/complex_28.f900000664000175000017500000000036015174404631021664 0ustar alastairalastair! Test: complex*16 zero parameter with complex literal program complex_28 implicit none complex*16 zero parameter (zero = (0.0, 0.0)) complex*16 t(2, 2) t(1, 1) = zero if (t(1, 1) /= zero) error stop end program lfortran-0.63.0/integration_tests/character_19.f900000664000175000017500000000152315174404631022153 0ustar alastairalastairprogram character_19 implicit none character(len=4) :: test_char = "2021" character(len=:), allocatable :: alloc_char logical :: result ! Test 1: passing character(len=4) to function expecting character(len=1) ! Should use first character only result = isdigit(test_char) if (.not. result) error stop ! Test 2: passing allocatable character with runtime length ! Should also use first character only alloc_char = "1234" result = isdigit(alloc_char) if (.not. result) error stop ! Test 3: allocatable with different content alloc_char = "9999" result = isdigit(alloc_char) if (result) error stop contains logical function isdigit(c) character(len=1), intent(in) :: c isdigit = index("12",c) > 0 end function isdigit end program character_19lfortran-0.63.0/integration_tests/intrinsics_91.f900000664000175000017500000000450215174404631022404 0ustar alastairalastairprogram intrinsics_91 character(3) :: abc = "abc" character(8) :: elephant = "elephant" character(6) :: potato = "potato" character(1) :: b = "b" character(5) :: an = "@a!n#" character(1) :: t = "t" character(2) :: ta = "ta" integer, parameter :: i1 = index("abc", "b") integer, parameter :: i2 = index("elephant", "@a!n#") integer, parameter :: i3 = index("potato", "t", back=.true.) integer, parameter :: i4 = index("potato", "t", back=.false.) integer, parameter :: i5 = index("potato", "ta", back=.true.) integer, parameter :: ar1(3) = index(["abc", "ele", "pot"], "b") integer, parameter :: ar2(3) = index(["elephant", "gfortran", "lfortran"], "@a!n#") character(3) :: arr1(3) character(8) :: arr2(3) integer :: res(3) print*, i1 if ( i1 /= 2 ) error stop print*, i2 if ( i2 /= 0 ) error stop print*, i3 if ( i3 /= 5 ) error stop print*, i4 if ( i4 /= 3 ) error stop print*, i5 if ( i5 /= 3 ) error stop print*, ar1 if ( any(ar1 /= [2, 0, 0]) ) error stop print*, ar2 if ( any(ar2 /= [0, 0, 0]) ) error stop print*, index("abc", "b") if ( index("abc", "b") /= 2 ) error stop print*, index("elephant", "@a!n#") if ( index("elephant", "@a!n#") /= 0 ) error stop print*, index("potato", "t", back=.true.) if ( index("potato", "t", back=.true.) /= 5 ) error stop print*, index("potato", "t", back=.false.) if ( index("potato", "t", back=.false.) /= 3 ) error stop print*, index("potato", "ta", back=.true.) if ( index("potato", "ta", back=.true.) /= 3 ) error stop print*, index(abc, b) if ( index(abc, b) /= 2 ) error stop print*, index(elephant, an) if ( index(elephant, an) /= 0 ) error stop print*, index(potato, t, back=.true.) if ( index(potato, t, back=.true.) /= 5 ) error stop print*, index(potato, t, back=.false.) if ( index(potato, t, back=.false.) /= 3 ) error stop print*, index(potato, ta, back=.true.) if ( index(potato, ta, back=.true.) /= 3 ) error stop arr1 = ["abc", "ele", "pot"] arr2 = ["elephant", "gfortran", "lfortran"] res = index(arr1, b) print*, res if ( any(res /= [2, 0, 0]) ) error stop res = index(arr2, an, back = .true.) print*, res if ( any(res /= [0, 0, 0]) ) error stop end program lfortran-0.63.0/integration_tests/complex_array_member_access.f900000664000175000017500000000117615174404631025427 0ustar alastairalastairprogram test complex, parameter :: x(2) = (1.0, 0.3) real :: y_re(2), y_im(2) ! Test extracting real parts y_re = x%re print *, "Real parts:", y_re ! Test extracting imaginary parts y_im = x%im print *, "Imaginary parts:", y_im ! Assert checks if (abs(y_re(1) - 1.0) > 1e-5) error stop "Real part 1 failed" if (abs(y_re(2) - 1.0) > 1e-5) error stop "Real part 2 failed" if (abs(y_im(1) - 0.3) > 1e-5) error stop "Imaginary part 1 failed" if (abs(y_im(2) - 0.3) > 1e-5) error stop "Imaginary part 2 failed" print *, x%re, x%im print *, "All tests passed!" endlfortran-0.63.0/integration_tests/file_41.f900000664000175000017500000000220415174404631021126 0ustar alastairalastairprogram file_41 implicit none integer :: unit, ios character(len=*), parameter :: fname = "test_stream.txt" character(len=*), parameter :: expected = "build" character(len=len(expected)) :: found ! ---- Write ---- open(newunit=unit, file=fname, access="stream", action="write", iostat=ios) if (ios /= 0) error stop "open(write) failed" write(unit, iostat=ios) expected if (ios /= 0) error stop "write failed" close(unit) ! ---- Read back ---- open(newunit=unit, file=fname, access="stream", action="read", iostat=ios) if (ios /= 0) error stop "open(read) failed" read(unit, iostat=ios) found if (ios /= 0) error stop "read failed" close(unit) ! ---- Verify ---- if (found /= expected) then print *, "EXPECTED:", expected print *, "FOUND: ", found error stop "content mismatch" end if ! ---- Delete file ---- open(newunit=unit, file=fname, status="old", iostat=ios) if (ios /= 0) error stop "reopen for delete failed" close(unit, status="delete") print *, "PASS: stream write/read/delete successful" end program file_41 lfortran-0.63.0/integration_tests/optional_09.f900000664000175000017500000000107515174404631022045 0ustar alastairalastairmodule optional_09_mod implicit none contains subroutine sub(x) class(*), intent(in), optional :: x(:) if (present(x)) then select type(x) type is (integer) if (x(1) /= 10) error stop if (x(2) /= 20) error stop class default error stop end select end if end subroutine end module program optional_09 use optional_09_mod implicit none integer :: a(2) a = [10, 20] call sub() call sub(a) print *, "ok" end program lfortran-0.63.0/integration_tests/allocate_14.f900000664000175000017500000000042115174404631021772 0ustar alastairalastairprogram allocate_14 implicit none type string character(:), allocatable :: str end type string type(string), allocatable :: inputs(:) inputs = [string("123"), string("456")] if ( inputs(2)%str /= "456" ) error stop end program allocate_14 lfortran-0.63.0/integration_tests/derived_types_43.f900000664000175000017500000000106515174404631023063 0ustar alastairalastairprogram derived_types_43 implicit none type :: rp1d_derived_types_43 real, dimension(:), pointer :: f end type type :: sds_derived_types_43 integer, dimension(3) :: dims type(rp1d_derived_types_43), dimension(3) :: scales real, dimension(:), pointer :: f end type type(sds_derived_types_43) :: s allocate(s%scales(1)%f(2)) s%scales(1)%f(2) = 1.0 s%scales(1)%f(1) = 2.0 print *, s%scales(1)%f if (abs(sum(s%scales(1)%f) - 3.0) > 1e-6) error stop deallocate(s%scales(1)%f) end program lfortran-0.63.0/integration_tests/procedure_25.f900000664000175000017500000000105315174404631022202 0ustar alastairalastairmodule procedure_25_module implicit none contains subroutine run(f) implicit none interface integer function f() end function f end interface procedure(f), pointer :: func_ptr integer :: x func_ptr => f x = func_ptr() print *, x if(x /= 42) error stop end subroutine run end module program procedure_25 use procedure_25_module implicit none call run(test_func) contains integer function test_func() test_func = 42 end function test_func end programlfortran-0.63.0/integration_tests/derived_types_114.f900000664000175000017500000000152115174404631023137 0ustar alastairalastair! Test: intrinsic assignment of a derived type uses defined assignment ! for components that have assignment(=) defined. program derived_types_114 use derived_types_114_module implicit none type(wrapper_t) :: a, b ! Set up a with a reference count of 1 allocate(a%counter%count_, source=1) a%val = 42 ! Intrinsic assignment of wrapper_t should use defined assignment ! for the counter component (incrementing the count) b = a ! Verify defined assignment was used: count should be 2 if (.not. associated(b%counter%count_)) error stop if (b%counter%count_ /= 2) error stop ! Verify other members are copied if (b%val /= 42) error stop ! Both a and b share the same count pointer if (.not. associated(a%counter%count_, b%counter%count_)) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/read_56.f900000664000175000017500000000042715174404631021135 0ustar alastairalastairprogram read_56 implicit none character(20) :: string = '12345678901234567890' string(1:8) = 'ABCDEFGH' if (string /= 'ABCDEFGH901234567890') error stop string(5:12) = 'XXXXXXXX' if (string /= 'ABCDXXXXXXXX34567890') error stop end program read_56lfortran-0.63.0/integration_tests/intrinsics_268.f900000664000175000017500000001171615174404631022477 0ustar alastairalastairprogram intrinsics_268 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp) :: arg_x(15) real(sp) :: arg_y(15) real(dp) :: res_x(15) real(sp) :: res_y(15) real(dp) :: expected_res_x(15) real(sp) :: expected_res_y(15) real(dp) :: expected_x(10) real(sp) :: expected_y(10) real(dp) :: a = 0.5178181202_dp real(sp) :: b = -0.072816_sp real(dp) :: c = -0.5178181202_dp real(sp) :: d = 0.072816_sp real(dp), parameter :: res_dp(10) = asin([-0.62818828_dp, -0.51725372_dp, -0.29257208_dp, & 0.62818828_dp, 0.51725372_dp, 0.29257208_dp, 1.00_dp, 0.829362821_dp, 0.952716192_dp, -0.241626228_dp]) real(sp), parameter :: res_sp(10) = asin([-0.62818828_sp, -0.51725372_sp, -0.29257208_sp, & 0.62818828_sp, 0.51725372_sp, 0.29257208_sp, 1.00_sp, 0.829362821_sp, 0.952716192_sp, -0.241626228_sp]) expected_x = [-0.67922251126401767_dp, -0.54363892699177885_dp, -0.29691551032790681_dp, & 0.67922251126401767_dp, 0.54363892699177885_dp, 0.29691551032790681_dp, 1.5707963267948966_dp, & 0.97796627122261770_dp, 1.2620530499450677_dp, -0.24404138779115148_dp] arg_x = [-0.67922251126_dp, -0.54363892699177885_dp, -0.29691551032790681_dp, & 0.67922251126401767_dp, 0.54363892699177885_dp, 0.29691551032790681_dp, 0.5707963267948966_dp, & 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp, -0.7281628262782_dp, & 0.5707963267948966_dp, 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp] arg_y = [-0.679222465_sp, -0.543638885_sp, -0.296915501_sp, & 0.679222465_sp, 0.543638885_sp, 0.296915501_sp, 0.57079637_sp, & 0.077966249_sp, 0.262053013_sp, -0.244041398_sp, -0.7281628262782_sp, & 0.57079637_sp, 0.077966249_sp, 0.262053013_sp, -0.244041398_sp] expected_y = [-0.679222465_sp, -0.543638885_sp, -0.296915501_sp, & 0.679222465_sp, 0.543638885_sp, 0.296915501_sp, 1.57079637_sp, & 0.977966249_sp, 1.26205301_sp, -0.244041398_sp] res_x = asin(arg_x) res_y = asin(arg_y) expected_res_x = [-0.84309112198096470_dp, -0.61231892714946035_dp, -0.30622442822953339_dp, & 0.84309112198919456_dp, 0.61231892714946035_dp, 0.30622442822953339_dp, 0.65287843094856091_dp, & 7.8124925903421710E-002_dp, 0.26835843496713735_dp, -0.24909920725508472_dp, & -0.95383054718869975_dp, 0.65287843094856091_dp, 7.8124925903421710E-002_dp, & 0.26835843496713735_dp, -0.24909920725508472_dp] expected_res_y = [-0.843091071_sp, -0.612318873_sp, -0.306224436_sp, & 0.843091071_sp, 0.612318873_sp, 0.306224436_sp, 0.652878463_sp, & 7.81249031E-02_sp, 0.268358380_sp, -0.249099225_sp, & -0.953830540_sp, 0.652878463_sp, 7.81249031E-02_sp, 0.268358380_sp, -0.249099225_sp] do i = 1, size(res_dp) print *, res_dp(i) if (abs(res_dp(i) - expected_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_x) print *, asin(res_x(i)) if (abs(res_x(i)) - abs(expected_res_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_y(i)) > 1e-5) error stop end do do i = 1, size(res_y) print *, asin(res_y(i)) if (abs(res_y(i)) - abs(expected_res_y(i)) > 1e-5) error stop end do print *, asin(a) if (abs(asin(a)) - 0.54429853389646843_dp > 1e-12) error stop print *, asin(0.5178181202_dp) if (abs(asin(0.5178181202_dp) - 0.54429853389646843_dp) > 1e-12) error stop print *, asin(b) if (asin(b) - (-7.28804991E-02_sp) > 1e-5) error stop print *, asin(-0.072816_sp) if (asin(-0.072816_sp) - (-7.28804991E-02_sp) > 1e-5) error stop print *, asin(c) if (asin(c) - (-5.44298533896468428e-01_dp) > 1e-12) error stop print *, asin(-0.5178181202_dp) if (asin(-0.5178181202_dp) - (-5.44298533896468428e-01_dp) > 1e-12) error stop print *, asin(d) if (asin(d) - (7.28804991E-02_sp) > 1e-5) error stop print *, asin(0.072816_sp) if (asin(0.072816_sp) - (7.28804991E-02_sp) > 1e-5) error stop a = -0.271927291_dp b = -0.6382728_sp c = 0.271927291_dp d = 0.6382728_sp print *, asin(a) if (abs(asin(a) - (-0.27539522579314013_dp)) > 1e-12) error stop print *, asin(-0.271927291_dp) if (abs(asin(-0.271927291_dp) - (-0.27539522579314013_dp)) > 1e-12) error stop print *, asin(b) if (asin(b) - (-0.692252517_sp) > 1e-5) error stop print *, asin(-0.6382728_sp) if (asin(-0.6382728_sp) - (-0.692252517_sp) > 1e-5) error stop print *, asin(c) if (asin(c) - (0.27539522579314013_dp) > 1e-12) error stop print *, asin(0.271927291_dp) if (asin(0.271927291_dp) - (0.27539522579314013_dp) > 1e-12) error stop print *, asin(d) if (asin(d) - (0.692252517_sp) > 1e-5) error stop print *, asin(0.6382728_sp) if (asin(0.6382728_sp) - (0.692252517_sp) > 1e-5) error stop end programlfortran-0.63.0/integration_tests/arrays_03_func.f900000664000175000017500000000051315174404631022522 0ustar alastairalastairprogram arrays_03_func implicit none integer :: x(10), s, i do i = 1, size(x) x(i) = i end do s = mysum(x) print *, s if (s /= 55) error stop contains integer function mysum(a) result(r) integer, intent(in) :: a(:) integer :: i r = 0 do i = 1, size(a) r = r + a(i) end do end function end lfortran-0.63.0/integration_tests/expr_12.f900000664000175000017500000000027415174404631021170 0ustar alastairalastairprogram expr_12 implicit none if ('1'//char(38)//char(35)//'1' /= '1') error stop if ('1'//char(38)//char(35)//'1'//char(0) /= '1'//char(0)) error stop end program expr_12 lfortran-0.63.0/integration_tests/attr_dim_02.f900000664000175000017500000000012115174404631022003 0ustar alastairalastairprogram attr_dim_02 dimension array(3) double precision array end programlfortran-0.63.0/integration_tests/template_monoid.f900000664000175000017500000000264015174404631023067 0ustar alastairalastairmodule monoid_m use semigroup_m, only: semigroup, extended_semigroup, derive_extended_semigroup implicit none private public :: monoid, extended_monoid, derive_extended_monoid requirement monoid(T, combine, empty) require :: semigroup(T, combine) pure function empty() type(T) :: empty end function end requirement requirement extended_monoid(T, combine, sconcat, stimes, empty, mconcat) require :: extended_semigroup(T, combine, sconcat, stimes) require :: monoid(T, combine, empty) pure function mconcat(list) result(combined) type(T), intent(in) :: list(:) type(T) :: combined end function end requirement template derive_extended_monoid(T, combine, empty) require :: monoid(T, combine, empty) private public :: stimes, mconcat instantiate derive_extended_semigroup(T, combine), only: stimes contains pure function mconcat(list) result(combined) type(T), intent(in) :: list(:) type(T) :: combined integer :: i if (size(list) > 0) then combined = list(1) do i = 2, size(list) combined = combine(combined, list(i)) end do else combined = empty() end if end function end template end module lfortran-0.63.0/integration_tests/equivalence_14.f900000664000175000017500000000214115174404631022510 0ustar alastairalastairprogram equivalence_14 implicit none call log_equiv() call comp_equiv_8913() contains subroutine log_equiv() logical :: la(2) logical :: l1 equivalence (la(1), l1) l1 = .true. la(2) = .false. if (.not. la(1)) error stop "la(1) should be true (equivalenced to l1)" if (.not. l1) error stop "l1 should be true" if (la(2)) error stop "la(2) should be false" la(1) = .false. if (l1) error stop "l1 should be false after la(1) change" end subroutine subroutine comp_equiv_8913() implicit none complex :: c1 real :: r1(6) equivalence (c1, r1(1)) r1 = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] if (abs(real(c1) - 1.0) > 1e-6) error stop "real(c1) should be 1.0" if (abs(aimag(c1) - 2.0) > 1e-6) error stop "aimag(c1) should be 2.0" c1 = (7.0, 8.0) if (abs(r1(1) - 7.0) > 1e-6) error stop "r1(1) should be 7.0 after c1 change" if (abs(r1(2) - 8.0) > 1e-6) error stop "r1(2) should be 8.0 after c1 change" if (abs(r1(3) - 3.0) > 1e-6) error stop "r1(3) should still be 3.0" end subroutine end program equivalence_14 lfortran-0.63.0/integration_tests/intrinsics_196.f900000664000175000017500000001171515174404631022476 0ustar alastairalastairprogram intrinsics_196 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(8) :: x(40) real(8) :: expected(40) real :: y(30) real :: expected_y(30) integer :: i real(dp), parameter :: res(40) = bessel_j1([3.3398640543782485_dp, 5.039184326269492_dp, 6.738504598160736_dp, & 8.43782487005198_dp, 10.137145141943222_dp, 11.836465413834466_dp, 13.53578568572571_dp, 15.235105957616954_dp, & 16.934426229508198_dp, 18.63374650139944_dp, 1.999201299880048d+306, 1.199520279928029d+307, & 2.1991204298680527d+307, 3.198720579808077d+307, 4.198320729748101d+307, 5.197920879688125d+307, & 6.197521029628149d+307, 7.197121179568173d+307, 8.196721329508197d+307, 9.196321479448221d+307, & -0.8439824070371851_dp, -1.0638944422231107_dp, -1.2838064774090363_dp, -1.503718512594962_dp, & -1.7236305477808875_dp, -1.9435425829668134_dp, -2.163454618152739_dp, -2.3833666533386646_dp, & -2.60327868852459_dp, -2.823190723710516_dp, .8439824070371851_dp, 1.0638944422231107_dp, & 1.2838064774090363_dp, 1.503718512594962_dp, 1.7236305477808875_dp, 1.9435425829668134_dp, & 2.163454618152739_dp, 2.3833666533386646_dp, 2.60327868852459_dp, 2.823190723710516_dp]) x = [3.3398640543782485_dp, 5.039184326269492_dp, 6.738504598160736_dp, 8.43782487005198_dp, & 10.137145141943222_dp, 11.836465413834466_dp, 13.53578568572571_dp, 15.235105957616954_dp, & 16.934426229508198_dp, 18.63374650139944_dp, 1.999201299880048d+306, 1.199520279928029d+307, & 2.1991204298680527d+307, 3.198720579808077d+307, 4.198320729748101d+307, 5.197920879688125d+307, & 6.197521029628149d+307, 7.197121179568173d+307, 8.196721329508197d+307, 9.196321479448221d+307, & -0.8439824070371851_dp, -1.0638944422231107_dp, -1.2838064774090363_dp, -1.503718512594962_dp, & -1.7236305477808875_dp, -1.9435425829668134_dp, -2.163454618152739_dp, -2.3833666533386646_dp, & -2.60327868852459_dp, -2.823190723710516_dp, .8439824070371851_dp, 1.0638944422231107_dp, & 1.2838064774090363_dp, 1.503718512594962_dp, 1.7236305477808875_dp, 1.9435425829668134_dp, & 2.163454618152739_dp, 2.3833666533386646_dp, 2.60327868852459_dp, 2.823190723710516_dp] expected = [0.20421621687655644_dp, -0.33171193864355270_dp, -8.3784683987487160E-002_dp, 0.27198866581429970_dp, & 9.0842803254412019E-003_dp, -0.23134340809868278_dp, 4.5606105201175973E-002_dp, 0.19306664290638995_dp, & -8.6684684328497116E-002_dp, -0.15370371403787708_dp, 1.2435438521419326E-155_dp, -2.8314187014586877E-155_dp, & -1.5668960835696801E-154_dp, -1.2962049361081139E-154_dp, 1.2232544148395820E-154_dp, -8.9027017266527920E-155_dp, & 7.4652062949806537E-156_dp, 1.0051338573860275E-155_dp, 7.9153155792012788E-155_dp, 7.0791696617318761E-155_dp, & -0.38551658341791684_dp, -0.46015216947899512_dp, -0.51843459851029450_dp, -0.55845382793597553_dp, -0.57902364849354149_dp, & -0.57972422117951550_dp, -0.56091267269977430_dp, -0.52370145724258965_dp, -0.46990557508027103_dp, -0.40196106888470001_dp, & 0.38551658341791684_dp, 0.46015216947899512_dp, 0.51843459851029450_dp, 0.55845382793597553_dp, 0.57902364849354149_dp, & 0.57972422117951550_dp, 0.56091267269977430_dp, 0.52370145724258965_dp, 0.46990557508027103_dp, 0.40196106888470001_dp] do i = 1, size(x) print *, bessel_j1(x(i)), "i = ", i if (abs(bessel_j1(x(i)) - expected(i)) > 1e-12) error stop end do do i = 1, size(res) print *, res(i) if (abs(res(i) - expected(i)) > 1e-12_dp) error stop end do y = [3.3398640543782485_sp, 5.039184326269492_sp, 6.738504598160736_sp, 8.43782487005198_sp, & 10.137145141943222_sp, 11.836465413834466_sp, 13.53578568572571_sp, 15.235105957616954_sp, & 16.934426229508198_sp, 18.63374650139944_sp, & -0.8439824070371851_sp, -1.0638944422231107_sp, -1.2838064774090363_sp, -1.503718512594962_sp, & -1.7236305477808875_sp, -1.9435425829668134_sp, -2.163454618152739_sp, -2.3833666533386646_sp, & -2.60327868852459_sp, -2.823190723710516_sp, .8439824070371851_sp, 1.0638944422231107_sp, & 1.2838064774090363_sp, 1.503718512594962_sp, 1.7236305477808875_sp, 1.9435425829668134_sp, & 2.163454618152739_sp, 2.3833666533386646_sp, 2.60327868852459_sp, 2.823190723710516_sp] expected_y = [0.204216227_sp, -0.331711948_sp, -8.37847441E-02_sp, 0.271988720_sp, & 9.08430573E-03_sp, -0.231343403_sp, 4.56061028E-02_sp, 0.193066686_sp, & -8.66845325E-02_sp, -0.153703660_sp, -0.385516584_sp, -0.460152149_sp, & -0.518434584_sp, -0.558453798_sp, -0.579023659_sp, -0.579724193_sp, & -0.560912728_sp, -0.523701489_sp, -0.469905645_sp, -0.401961178_sp, & 0.385516584_sp, 0.460152149_sp, 0.518434584_sp, 0.558453798_sp, & 0.579023659_sp, 0.579724193_sp, 0.560912728_sp, 0.523701489_sp, & 0.469905645_sp, 0.401961178_sp] do i = 1, size(y) print *, bessel_j1(y(i)), "i = ", i if (abs(bessel_j1(y(i)) - expected_y(i)) > 1e-6) error stop end do end program lfortran-0.63.0/integration_tests/intrinsics_18.f900000664000175000017500000000440215174404631022402 0ustar alastairalastairprogram intrinsics_18 ! This program tests all trigonometric intrinsics, both in declarations ! and in executable statements. Single and double precision, real only. integer, parameter :: dp = kind(0.d0) real, parameter :: & s1 = sin(0.5), & s2 = cos(0.5), & s3 = tan(0.5), & s4 = asin(0.5), & s5 = acos(0.5), & s6 = atan(0.5), & s7 = sinh(0.5), & s8 = cosh(0.5), & s9 = tanh(0.5), & s10 = asinh(0.5), & s11 = acosh(1.5), & s12 = atanh(0.5) real(dp), parameter :: & d1 = sin(0.5_dp), & d2 = cos(0.5_dp), & d3 = tan(0.5_dp), & d4 = asin(0.5_dp), & d5 = acos(0.5_dp), & d6 = atan(0.5_dp), & d7 = sinh(0.5_dp), & d8 = cosh(0.5_dp), & d9 = tanh(0.5_dp), & d10 = asinh(0.5_dp), & d11 = acosh(1.5_dp), & d12 = atanh(0.5_dp) real :: x, x2 real(dp) :: y, y2 x = 0.5 y = 0.5_dp x2 = 1.5 y2 = 1.5_dp print *, sin(0.5), sin(0.5_dp), s1, d1, sin(x), sin(y) print *, cos(0.5), cos(0.5_dp), s2, d2, cos(x), cos(y) print *, tan(0.5), tan(0.5_dp), s3, d3, tan(x), tan(y) print *, asin(0.5), asin(0.5_dp), s4, d4, asin(x), asin(y) if (abs(asin(0.5) - 0.523598790) > 1e-7) error stop if (abs(asin(x) - 0.523598790) > 1e-7) error stop if (abs(asin(0.5_dp) - 0.52359877559829893_dp) > 1e-15) error stop if (abs(asin(y) - 0.52359877559829882_dp) > 1e-15) error stop print *, acos(0.5), acos(0.5_dp), s5, d5, acos(x), acos(y) if (abs(acos(0.5) - 1.04719758) > 1e-7) error stop if (abs(acos(x) - 1.04719758) > 1e-6) error stop if (abs(acos(0.5_dp) - 1.0471975511965979_dp) > 1e-15) error stop if (abs(acos(y) - 1.0471975511965979_dp) > 1e-15) error stop print *, atan(0.5), atan(0.5_dp), s6, d6, atan(x), atan(y) if (abs(atan(0.5) - 0.463647604) > 1e-7) error stop if (abs(atan(x) - 0.463647604) > 1e-6) error stop if (abs(atan(0.5_dp) - 0.46364760900080609_dp) > 1e-15) error stop if (abs(atan(y) - 0.46364760900080609_dp) > 1e-15) error stop print *, sinh(0.5), sinh(0.5_dp), s7, d7, sinh(x), sinh(y) print *, cosh(0.5), cosh(0.5_dp), s8, d8, cosh(x), cosh(y) print *, tanh(0.5), tanh(0.5_dp), s9, d9, tanh(x), tanh(y) print *, asinh(0.5), asinh(0.5_dp), s10, d10, asinh(x), asinh(y) print *, acosh(1.5), acosh(1.5_dp), s11, d11, acosh(x2), acosh(y2) print *, atanh(0.5), atanh(0.5_dp), s12, d12, atanh(x), atanh(y) end lfortran-0.63.0/integration_tests/format_12.f900000664000175000017500000000072415174404631021502 0ustar alastairalastairprogram format_12 implicit none print *, 'testing output using formatting' write (*, 700) 1, 1.23, (7., 8.), 'Hello', .true. write (*, 701) write (*, 702) 700 format (i5, e12.4e3, 2f8.2, 1x, a3, l7) 701 format ('12345678901234567890123456789012345678901234567890') 702 format (' 1 2 3 4 5') write(*, '(i5, e12.4e3, 2f8.2, 1x, a3, l7)') 1, 1.23, (7.,8.), 'Hello', .true. print *, 'end output formatting test' print * end program lfortran-0.63.0/integration_tests/separate_compilation_27b.f900000664000175000017500000000040515174404631024560 0ustar alastairalastairsubmodule (error_separate_compilation_27) estop_separate_compilation_27 implicit none contains module subroutine error_sub(code) integer, intent(inout) :: code code = code + 2 end subroutine error_sub end submodule estop_separate_compilation_27lfortran-0.63.0/integration_tests/intrinsics_199.f900000664000175000017500000000026415174404631022476 0ustar alastairalastairprogram intrinsics_199 integer, parameter :: n = 10 logical :: x(n) integer :: res x = .false. x(1:5) = .true. res = count(x, 1) print *, res if (res /= 5) error stop end program lfortran-0.63.0/integration_tests/iso_fortran_env_01.f900000664000175000017500000000066715174404631023413 0ustar alastairalastairprogram iso_fortran_env_01 use, intrinsic :: iso_fortran_env, only: numeric_storage_size, character_storage_size, iostat_eor print *, "numeric_storage_size: ", numeric_storage_size if (numeric_storage_size /= 32) error stop print *, "character_storage_size: ", character_storage_size if (character_storage_size /= 8) error stop print *, "iostat_eor: ", iostat_eor if (iostat_eor /= -2) error stop end program lfortran-0.63.0/integration_tests/transfer_23.f900000664000175000017500000000173615174404631022044 0ustar alastairalastairprogram transfer_23 integer :: i = -1974590819 integer, parameter :: m3 = int(z'E9139917', 4) integer(2) :: j(2) = [8028, 6459] integer(8) :: len integer :: len32_lb(0:1) integer :: len32_ref(2) real(4), parameter :: r0 = 1.5_4 integer(2), parameter :: jr(2) = transfer(r0, 0_2, 2) real(4), parameter :: r1 = transfer(jr, 0.0_4) character(4), parameter :: c0 = 'ABCD' integer(1), parameter :: cb(4) = transfer(c0, [0_1]) character(4), parameter :: c1 = transfer(cb, ' ') j = transfer( i, 0_2, 2 ) j = j * transfer( m3, 0_2, 2 ) print *, j if (j(1) /= -3813 .or. j(2) /= 16842) error stop print *, jr print *, r1 if (r1 /= r0) error stop print *, c1 if (c1 /= c0) error stop len = 912320821391_8 len32_lb = transfer(len, 0, 2) len32_ref = transfer(len, 0, 2) if (len32_lb(0) /= len32_ref(1) .or. len32_lb(1) /= len32_ref(2)) error stop print *, len32_lb end program transfer_23lfortran-0.63.0/integration_tests/implicit_typing_09.f900000664000175000017500000000423315174404631023423 0ustar alastairalastair module implicit_typing_09_mthdef cx integer(kind=4), parameter :: isngl=4 integer(kind=4), parameter :: idble=8 integer(kind=4), parameter :: rsngl=4 integer(kind=4), parameter :: rdble=8 integer(kind=4), parameter :: rquad=16 c integer(kind=4), parameter :: iknd=isngl integer(kind=4), parameter :: rknd=rdble cy end module program implicit_typing_09 use implicit_typing_09_mthdef cx implicit real(kind=rsngl) (a-c) implicit integer(kind=iknd) (i-k) implicit real(kind=4) (l-n) a = 1.323459_rsngl b = 2.0_rsngl c = a + b i = 5 j = 10 k = i + j l = 1.0 m = 3.0 n = l + m if (abs(c - 3.323459_rsngl) > 1.0e-6) error stop 1 if (k /= 15) error stop 2 if (abs(n - 4.0) > 1.0e-6) error stop 3 call test_implicit_real_subroutine() print *, test_implicit_complex() contains subroutine test_implicit_real_subroutine() use implicit_typing_09_mthdef implicit real(kind=idble) (q-s) q = 1.23456789d0 r = 9.87654321d0 s = q + r if (abs(s - 11.11111110d0) > 1.0d-6) error stop 4 end subroutine integer function test_implicit_complex() use implicit_typing_09_mthdef implicit complex(kind=rdble) (t-v) t = cmplx(1.0, 2.0) u = cmplx(3.0, 4.0) v = t + u if (abs(real(v) - 4.0) > 1.0d-6) error stop 5 if (abs(aimag(v) - 6.0) > 1.0d-6) error stop 6 test_implicit_complex = 1 end function end program lfortran-0.63.0/integration_tests/functions_29.f900000664000175000017500000000046415174404631022233 0ustar alastairalastairprogram function_29 implicit none integer, allocatable :: x(:) allocate(x(2)) x = [1, 2] call my_func(x) contains subroutine my_func(arr) integer, intent(in) :: arr(2) print *, arr if (any(arr /= [1, 2])) error stop end subroutine my_func end program function_29 lfortran-0.63.0/integration_tests/derived_types_117.f900000664000175000017500000000165315174404631023150 0ustar alastairalastairmodule derived_types_117_mod implicit none type :: point real :: x, y contains procedure :: norm end type type(point), parameter :: origin = point(0.0, 0.0) type(point), parameter :: unit_x = point(1.0, 0.0) type(point), parameter :: unit_y = point(0.0, 1.0) contains real function norm(self) class(point), intent(in) :: self norm = sqrt(self%x**2 + self%y**2) end function end module program derived_types_117 use derived_types_117_mod, only: origin, unit_x, unit_y, point implicit none real :: r type(point) :: p ! Call type-bound procedure on parameter structs r = origin%norm() if (abs(r) > 1e-6) error stop r = unit_x%norm() if (abs(r - 1.0) > 1e-6) error stop r = unit_y%norm() if (abs(r - 1.0) > 1e-6) error stop ! Also test with a local variable p = point(3.0, 4.0) r = p%norm() if (abs(r - 5.0) > 1e-6) error stop print *, "PASS" end program derived_types_117 lfortran-0.63.0/integration_tests/procedure_27.f900000664000175000017500000000245615174404631022214 0ustar alastairalastair! Test procedure pointer component in a derived type with allocatable ! character component, accessed via a class (polymorphic) dummy argument. ! This triggered a GEP type mismatch in codegen when the subroutine_from_function ! pass incorrectly double-wrapped the m_dt StructInstanceMember expression. module procedure_27_mod implicit none type :: result_t logical :: passed = .false. end type abstract interface function result_fn_i() result(r) import result_t type(result_t) :: r end function end interface type :: desc_t character(len=:), allocatable :: text procedure(result_fn_i), pointer, nopass :: get_result => null() contains procedure :: run end type contains function make_pass() result(r) type(result_t) :: r r%passed = .true. end function subroutine run(self) class(desc_t), intent(in) :: self type(result_t) :: res if (associated(self%get_result)) then res = self%get_result() if (.not. res%passed) error stop end if end subroutine end module program procedure_27 use procedure_27_mod implicit none type(desc_t) :: d ! Test with null procedure pointer (should not call) call d%run() ! Test with assigned procedure pointer d%get_result => make_pass call d%run() print *, "ok" end program lfortran-0.63.0/integration_tests/test_ieee_is_negative.f900000664000175000017500000000473615174404631024242 0ustar alastairalastair! Test ieee_is_negative function program ieee_is_negative_01 use, intrinsic :: ieee_arithmetic, only: ieee_is_negative use, intrinsic :: iso_fortran_env, only: real32, real64 implicit none real(4) :: x_sp, neg_zero_sp real(8) :: x_dp, neg_zero_dp print *, "Testing ieee_is_negative..." ! Test 1: Positive value x_sp = 1.0 print *, "ieee_is_negative(1.0) =", ieee_is_negative(x_sp) if (ieee_is_negative(x_sp)) error stop "1.0 should not be negative" ! Test 2: Negative value x_sp = -1.0 print *, "ieee_is_negative(-1.0) =", ieee_is_negative(x_sp) if (.not. ieee_is_negative(x_sp)) error stop "-1.0 should be negative" ! Test 3: Positive zero x_sp = 0.0 print *, "ieee_is_negative(+0.0) =", ieee_is_negative(x_sp) if (ieee_is_negative(x_sp)) error stop "+0.0 should not be negative" ! Test 4: Negative zero (critical test!) neg_zero_sp = -0.0 print *, "ieee_is_negative(-0.0) =", ieee_is_negative(neg_zero_sp) if (.not. ieee_is_negative(neg_zero_sp)) error stop "-0.0 should be negative" ! Test 5: Negative zero created by calculation neg_zero_sp = -1.0 * 0.0 print *, "ieee_is_negative(-1.0 * 0.0) =", ieee_is_negative(neg_zero_sp) if (.not. ieee_is_negative(neg_zero_sp)) error stop "Calculated -0.0 should be negative" ! Test 6: Small negative value x_sp = -1.0e-30 print *, "ieee_is_negative(-1.0e-30) =", ieee_is_negative(x_sp) if (.not. ieee_is_negative(x_sp)) error stop "Small negative should be negative" ! Test 7: Small positive value x_sp = 1.0e-30 print *, "ieee_is_negative(1.0e-30) =", ieee_is_negative(x_sp) if (ieee_is_negative(x_sp)) error stop "Small positive should not be negative" ! Test 8: Double precision negative zero neg_zero_dp = -0.0d0 print *, "ieee_is_negative(-0.0d0) =", ieee_is_negative(neg_zero_dp) if (.not. ieee_is_negative(neg_zero_dp)) error stop "Double precision -0.0 should be negative" ! Test 9: Large negative value x_sp = -huge(x_sp) print *, "ieee_is_negative(-huge) =", ieee_is_negative(x_sp) if (.not. ieee_is_negative(x_sp)) error stop "-huge should be negative" ! Test 10: Large positive value x_sp = huge(x_sp) print *, "ieee_is_negative(+huge) =", ieee_is_negative(x_sp) if (ieee_is_negative(x_sp)) error stop "+huge should not be negative" print *, "All ieee_is_negative tests passed!" end program ieee_is_negative_01 lfortran-0.63.0/integration_tests/arrays_92.f900000664000175000017500000000050615174404631021521 0ustar alastairalastairmodule arrays_92_mod implicit none integer, parameter :: ints(0:9) = [11, 12, 13, 14, 15, 16, 17, 18, 19, 20] integer :: e = 3 end module arrays_92_mod program arrays_92 use arrays_92_mod, only : e, ints integer :: x x = ints(e) print *, "x: ", x if (x /= 14) error stop end program arrays_92 lfortran-0.63.0/integration_tests/flush_02.f900000664000175000017500000000026115174404631021326 0ustar alastairalastairprogram flush_02 implicit none open(10, file="file_01_data.txt") open(11, file="file_02_data.txt") call FLUSH() close(10) close(11) end program flush_02 lfortran-0.63.0/integration_tests/datastmt_01.f900000664000175000017500000000061515174404631022030 0ustar alastairalastairprogram datastmt_01 integer :: arr(3) integer :: arr2(3) integer :: arr3(3) integer :: arr4(3) data arr(1:3) /1, 2, 3/ data arr2(1:2) /1, 2/ data arr3(1:3) /3*1/ data arr4(1:2) /2*1/ if (any(arr /= [1,2,3])) error stop if (any(arr2(1:2) /= [1,2])) error stop if (any(arr3 /= [1,1,1])) error stop if (any(arr4(1:2) /= [1,1])) error stop end program lfortran-0.63.0/integration_tests/interface_12.f900000664000175000017500000000052015174404631022144 0ustar alastairalastairsubroutine find_fit(expr) interface function expr() result(y) implicit none real :: y(1) end function end interface end subroutine program main implicit none call find_fit(expression) contains function expression() result(y) real :: y(1) end function end program lfortran-0.63.0/integration_tests/pointer_12.f900000664000175000017500000000077715174404631021702 0ustar alastairalastairprogram pointer_12 implicit none real, target :: w(4) integer :: i w = [1.0, 2.0, 3.0, 4.0] call check(w) print *, "OK" contains subroutine check(w) real, intent(in), target :: w(:) real, pointer :: p(:) => null() p(1:size(w)) => w if (size(p) /= 4) error stop "FAIL: size mismatch" if (abs(p(1) - 1.0) > 1e-6) error stop "FAIL: p(1)" if (abs(p(4) - 4.0) > 1e-6) error stop "FAIL: p(4)" end subroutine check end program pointer_12 lfortran-0.63.0/integration_tests/intrinsics_229.f900000664000175000017500000000144615174404631022473 0ustar alastairalastairprogram intrinsics_229 use, intrinsic :: iso_fortran_env, only: dp => real64 real(dp) :: x, y, z x = 6.738377383_dp y = 3.1473863781_dp z = 7389.83936383_dp print *, derfc(x) if (abs(derfc(x) - 1.5803544202317088e-021_dp) > 1e-12) error stop print *, derfc(y) if (abs(derfc(y) - 8.5440894639449411e-006_dp) > 1e-12) error stop print *, derfc(z) if (abs(derfc(z) - 0.0000000000000000_dp) > 1e-12) error stop x = -6.738377383_dp y = -3.1473863781_dp z = -7389.83936383_dp print *, derfc(x) if (abs(derfc(x) - 2.0000000000000000_dp) > 1e-12) error stop print *, derfc(y) if (abs(derfc(y) - 1.9999914559105361_dp) > 1e-12) error stop print *, derfc(z) if (abs(derfc(z) - 2.0000000000000000_dp) > 1e-12) error stop end programlfortran-0.63.0/integration_tests/class_81.f900000664000175000017500000000174115174404631021325 0ustar alastairalastairmodule bar_type implicit none private public :: bar_destroy type, public :: bar integer :: v = 0 contains final :: bar_destroy end type bar interface bar_destroy module procedure bar_destroy end interface bar_destroy contains subroutine bar_destroy(this) type(bar), intent(inout) :: this this%v = -1 end subroutine end module bar_type module foo_type implicit none type :: foo contains procedure :: f end type contains subroutine f(this, x) use bar_type, only: bar class(foo), intent(in) :: this type(bar), intent(in) :: x print *, "foo%f called, x%v =", x%v if (x%v /= 42) error stop end subroutine end module foo_type program class_81 use foo_type use bar_type implicit none type(foo) :: a type(bar) :: b b%v = 42 print *, "Before call: b%v =", b%v if (b%v /= 42) error stop call a%f(b) print *, "After call: b%v =", b%v if (b%v /= 42) error stop end program class_81lfortran-0.63.0/integration_tests/class_105.f900000664000175000017500000000206415174404631021401 0ustar alastairalastairmodule class_105_mod implicit none type :: AbsType integer :: value end type AbsType type :: MyType class(AbsType), allocatable :: arr(:) end type MyType contains function tester() result(obj) class(MyType), allocatable :: obj obj = MyType() allocate(obj%arr(1)) obj%arr(1)%value = 42 end function tester end module class_105_mod program class_105 use class_105_mod implicit none class(MyType), allocatable :: result_obj allocate(result_obj) result_obj = tester() if (.not. allocated(result_obj)) error stop "result_obj is not allocated" select type (result_obj) type is (MyType) if (.not. allocated(result_obj%arr)) error stop "result_obj%arr is not allocated" if (size(result_obj%arr) /= 1) error stop "result_obj%arr has wrong size" if (result_obj%arr(1)%value /= 42) error stop "result_obj%arr(1)%value has wrong value" class default error stop "result_obj has wrong dynamic type" end select end program class_105 lfortran-0.63.0/integration_tests/module_function_without_nopass.f900000664000175000017500000000326415174404631026252 0ustar alastairalastair!> This test file makes sure that optional arguments !> are passed correctly for StructMethodDeclaration with/without nopass module modules_module_function_without_nopass implicit none private public :: calculator, SQUARE ! Expose both the type and the SQUARE function type :: calculator contains procedure :: SQUARE ! Associate SQUARE with the calculator type procedure :: AREA end type calculator contains ! Define SQUARE as a module procedure. function SQUARE(this, x) result(square_result) class(calculator), intent(in) :: this integer, optional, intent(in) :: x integer :: square_result if (present(x)) then square_result = x * x else square_result = 1 end if end function SQUARE function AREA(this, x, y) result(area_result) class(calculator), intent(in) :: this integer, optional, intent(in) :: x integer, optional, intent(in) :: y integer :: area_result if (present(x) .and. present(y)) then area_result = x * y else area_result = 1 end if end function end module modules_module_function_without_nopass program module_function_without_nopass use modules_module_function_without_nopass implicit none type(calculator) :: calc integer :: number, result, area1, area2, area3 number = 4 result = calc%SQUARE(number) if (result /= 16) error stop area1 = calc%AREA() if (area1 /= 1) error stop area2 = calc%AREA(1, 2) if (area2 /= 2) error stop area3 = calc%AREA(1) if (area3 /= 1) error stop end program module_function_without_nopass lfortran-0.63.0/integration_tests/intrinsics_277.f900000664000175000017500000000305515174404631022474 0ustar alastairalastairprogram intrinsics_277 implicit none integer :: a1 = 5, a2 = 8 integer(8) :: a3 = -1, a4 = -4 integer :: a5 = -2, a6 = -5 integer, parameter :: i1 = xor(5, 8) integer, parameter :: i2 = xor(-1, 5) integer, parameter :: i3 = xor(-4_8, 2_8) integer(8), parameter :: i4 = xor(-2_8, 5_8) logical, parameter :: l1 = xor(.true., .false.) logical, parameter :: l2 = xor(.false., .false.) logical :: true = .true., false = .false. integer :: arr1(3), arr3(3) integer(8) :: arr2(3) integer :: res(3) arr1 = [5, 8, 9] arr3 = [8, 5, 2] arr2 = [-1_8, -5_8, -10_8] print *, i1 if (i1 /= 13) error stop print *, i2 if (i2 /= -6) error stop print *, i3 if (i3 /= -2) error stop print *, i4 if (i4 /= -5) error stop print *, l1 if (l1 .neqv. .true.) error stop print *, l2 if (l2 .neqv. .false.) error stop print *, xor(true, false) if (xor(true, false) .neqv. .true.) error stop print *, xor(false, false) if (xor(false, false) .neqv. .false.) error stop print*, xor(5, 8) if (xor(5, 8) /= 13) error stop print*, xor(-1, 5) if (xor(-1, 5) /= -6) error stop print*, xor(8, -4) if (xor(8, -4) /= -12) error stop print*, xor(-2, -5) if (xor(-2, -5) /= 5) error stop print*, xor(a1, a2) if (xor(a1, a2) /= 13) error stop print*, xor(a3, a4) if (xor(a3, a4) /= 3) error stop print*, xor(a2, a5) if (xor(a2, a5) /= -10) error stop print*, xor(a5, a6) if (xor(a5, a6) /= 5) error stop end program lfortran-0.63.0/integration_tests/modules_55.f900000664000175000017500000000074715174404631021676 0ustar alastairalastairmodule stdlib_kinds_modules_55 use iso_fortran_env, only: int64 implicit none private public :: int64 end module stdlib_kinds_modules_55 module stdlib_hashmaps_modules_55 use stdlib_kinds_modules_55, only: int64 implicit none private integer, parameter, public :: int_calls = int64 end module stdlib_hashmaps_modules_55 program modules_55 use stdlib_hashmaps_modules_55 implicit none print *, int_calls if( int_calls /= 8 ) error stop end program lfortran-0.63.0/integration_tests/openmp_50.f900000664000175000017500000000056115174404631021511 0ustar alastairalastair program openmp_50 use omp_lib implicit none integer :: i=0,n=10 call omp_set_num_threads(8) !$OMP PARALLEL !$OMP MASTER do i = 1, n !$OMP TASK private(i) print *, "Task ",i,"done by TID:-",omp_get_thread_num() !$OMP END TASK end do !$OMP END MASTER !$OMP END PARALLEL end program openmp_50 lfortran-0.63.0/integration_tests/any_02.f900000664000175000017500000000261215174404631020776 0ustar alastairalastairprogram any_02 logical :: l, c(2, 3, 4) logical :: c1(2), c2(3), c3(4) logical :: c4(2, 3), c5(2, 4), c6(3, 4) integer :: a(2, 3, 4), b(2, 3, 4), i, j, k a = 1 b(1, :, :) = 1 b(2, :, :) = 2 c = a == b c6 = any(a == b, 1) print *, "c6", c6 do i = lbound(c6, 1), ubound(c6, 1) do j = lbound(c6, 2), ubound(c6, 2) if (.not. c6(i, j)) error stop end do end do c5 = any(c, 2) print *, "c5", c5 do j = lbound(c5, 2), ubound(c5, 2) if (.not. c5(1, j)) error stop end do do j = lbound(c5, 1), ubound(c5, 1) if (c5(2, j)) error stop end do c4 = any(c, 3) print *, "c4", c4 do j = lbound(c4, 2), ubound(c4, 2) if (.not. c4(1, j)) error stop end do do j = lbound(c4, 1), ubound(c4, 1) if (c4(2, j)) error stop end do c3 = any(any(c, dim=1), 1) print *, "c3", c3 do i = lbound(c3, 1), ubound(c3, 1) if (.not. c3(i)) error stop end do c2 = any(any(c, 1), 2) print *, "c2", c2 do i = lbound(c2, 1), ubound(c2, 1) if (.not. c2(i)) error stop end do c1 = any(any(c, 2), dim=2) print *, "c1", c1 if (.not. c1(1)) error stop if (c1(2)) error stop l = any(c) print *, l if (.not. l) error stop l = any(any(any(c, 2), dim=2), 1) print *, l if (.not. l) error stop end program any_02 lfortran-0.63.0/integration_tests/test_ieee_support.f900000664000175000017500000000546015174404631023454 0ustar alastairalastair! Test ieee_support_* inquiry functions program test_ieee_support use, intrinsic :: ieee_arithmetic use, intrinsic :: iso_fortran_env, only: real32, real64 implicit none real(real32) :: x_sp real(real64) :: x_dp logical :: result print *, "Testing ieee_support_* functions..." ! Test ieee_support_denormal result = ieee_support_denormal(x_sp) print *, "ieee_support_denormal(real32) = ", result if (.not. result) error stop "Should support denormals" result = ieee_support_denormal(x_dp) print *, "ieee_support_denormal(real64) = ", result if (.not. result) error stop "Should support denormals" ! Test ieee_support_divide result = ieee_support_divide(x_sp) print *, "ieee_support_divide(real32) = ", result if (.not. result) error stop "Should support divide" result = ieee_support_divide(x_dp) print *, "ieee_support_divide(real64) = ", result if (.not. result) error stop "Should support divide" ! Test ieee_support_sqrt result = ieee_support_sqrt(x_sp) print *, "ieee_support_sqrt(real32) = ", result if (.not. result) error stop "Should support sqrt" result = ieee_support_sqrt(x_dp) print *, "ieee_support_sqrt(real64) = ", result if (.not. result) error stop "Should support sqrt" ! Test ieee_support_standard result = ieee_support_standard(x_sp) print *, "ieee_support_standard(real32) = ", result if (.not. result) error stop "Should support standard" result = ieee_support_standard(x_dp) print *, "ieee_support_standard(real64) = ", result if (.not. result) error stop "Should support standard" ! Test ieee_support_io result = ieee_support_io(x_sp) print *, "ieee_support_io(real32) = ", result if (.not. result) error stop "Should support I/O" result = ieee_support_io(x_dp) print *, "ieee_support_io(real64) = ", result if (.not. result) error stop "Should support I/O" ! Test ieee_support_rounding result = ieee_support_rounding(ieee_nearest, x_sp) print *, "ieee_support_rounding(ieee_nearest, real32) = ", result if (.not. result) error stop "Should support rounding" result = ieee_support_rounding(ieee_to_zero, x_dp) print *, "ieee_support_rounding(ieee_to_zero, real64) = ", result if (.not. result) error stop "Should support rounding" ! Test ieee_support_datatype result = ieee_support_datatype(x_sp) print *, "ieee_support_datatype(real32) = ", result if (.not. result) error stop "Should support datatype" result = ieee_support_datatype(x_dp) print *, "ieee_support_datatype(real64) = ", result if (.not. result) error stop "Should support datatype" print *, "All ieee_support_* tests passed!" end program test_ieee_support lfortran-0.63.0/integration_tests/str_to_char.f900000664000175000017500000000064315174404631022217 0ustar alastairalastairprogram str_to_char implicit none character(kind=1, len=3) :: text = "hej" character(kind=1, len=*), parameter :: lowercase = "abcdefghijklmnopqrstuvwxyz" integer :: it = 1 call get_index(text(it:)) contains subroutine get_index(c) character(kind=1), intent(in) :: c if (len(c) /= 1) error stop if (index(lowercase, c) /= 8) error stop end subroutine end program str_to_char lfortran-0.63.0/integration_tests/func_parameter_type_02.f900000664000175000017500000000035215174404631024242 0ustar alastairalastairSUBROUTINE sub(f) EXTERNAL f H=HINIT853(f) RETURN END REAL FUNCTION HINIT853(f) HINIT853 = f(3.0) END Real function f(x) real :: x f = x end function program main EXTERNAL f call sub(f) end programlfortran-0.63.0/integration_tests/case_05.f900000664000175000017500000000074215174404631021127 0ustar alastairalastairprogram case_05 implicit none ! local variable declaration character :: grade = 'B' select case (grade) case ('A') print*, "Excellent!" case ('B') case ('C') print*, "Well done" case ('D') print*, "You passed" case ('F') print*, "Better try again" case default print*, "Invalid grade" end select print*, "Your grade is ", grade end program case_05lfortran-0.63.0/integration_tests/intrinsics_210.f900000664000175000017500000001407415174404631022462 0ustar alastairalastairprogram intrinsics_210 use lcompilers_test_module use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer(4) :: n(40) real(dp) :: x(40) real(dp) :: expected(40) real(dp) :: expected_res(32) integer :: i real :: y(28) real :: expected_y(28) real(dp), parameter :: res(32) = bessel_jn( [0, 1, 2, 3, & 4, 5, 6, 7, & 8, 9, 10, 11, & 12, 13, 14, 15, & 16, 17, 18, 19, & 20, 21, 22, 23, & 24, 25, 26, 27, & 28, 29, 30, 31], [9.98600559790084e307_dp,9.98800479820072e307_dp,9.9900039985006e307_dp, & 9.99200319880048e307_dp, 1036.462826483388272_dp, 1.7197292882018389_dp, & 10.2368267382872828_dp, 0.17197292882018389_dp, 152.67283628_dp, & 632.92729728_dp, 1.2728272919_dp, 1.265228272919_dp, & 29.82407037185126_dp, 35.2459016393_dp, 46.2634946_dp, 24.7740903638_dp, & 15.8978408636372_dp, 8.801468212714914_dp, 8.798080767692923_dp, 8.791287884846061575_dp, & 0.6635324560331525_dp, 0.6633115808685429_dp, 0.6630906573122884_dp, 0.6628696853957159_dp, & 0.5042349934053336_dp, 0.5041796815747646_dp, 0.5041242821300232_dp, 0.50401322049655_dp, & 499.19032387045183_dp, 499.2802878848461_dp, 499.3702518992403_dp, 499.5501799280288_dp]) expected_res = [ 1.1242697836494344E-156_dp, -7.0751499885966521E-155_dp, 6.6185432736853706E-155_dp, & 7.7717941781117294E-156_dp, 1.2534227302224874E-002_dp, 3.4591630672860707E-003_dp, & -6.6635959548975512E-002_dp, 6.8893572859763076E-012_dp, 1.7296961499438702E-002_dp, & -2.1516112626678387E-002_dp, 2.8947852994014139E-009_dp, 1.5735107612153680E-010_dp, & 0.15234385509729706_dp, -0.10168238671155572_dp, 0.10624777824227472_dp, 6.9944761409615891E-002_dp, & 0.17105291318716473_dp, 8.0781549836989616E-005_dp, 2.0878989572444657E-005_dp, 5.0408349875562356E-006_dp, & 1.0671913964996569E-028_dp, 1.6746487669899214E-030_dp, 2.5066961782596647E-032_dp, 3.5865372175913752E-034_dp, & 6.9929712255690990E-039_dp, 7.0335789790577674E-041_dp, 6.8007546900796684E-043_dp, 6.3118158714187534E-045_dp, & -3.3890445848758326E-002_dp, 6.2626337984015854E-003_dp, 3.5724011188705031E-002_dp, 7.5701847451948119E-003_dp] call lcompilers_test(res, expected_res) n = [0, 1, 2, 3, & 4, 5, 6, 7, & 8, 9, 10, 11, & 12, 13, 14, 15, & 16, 17, 18, 19, & 20, 21, 22, 23, & 24, 25, 26, 27, & 28, 29, 30, 31, & 32, 33, 34, 35, & 36, 37, 38, 39] x = [9.98600559790084e307_dp, 9.98800479820072e307_dp, 9.9900039985006e307_dp, 9.99200319880048e307_dp, & 1036.462826483388272_dp, 1.7197292882018389_dp, 10.2368267382872828_dp, 0.17197292882018389_dp, & 152.67283628_dp, 632.92729728_dp, 1.2728272919_dp, 1.265228272919_dp, & 3.229995504589554d-153, 1.9201212555874555d-153, 6.809537363878625d-155, 5.690181373063991d-154, & 29.82407037185126_dp, 35.2459016393_dp, 46.2634946_dp, 24.7740903638_dp, & 15.8978408636372_dp, 8.801468212714914_dp, 8.798080767692923_dp, 8.791287884846061575_dp, & 0.6635324560331525_dp, 0.6633115808685429_dp, 0.6630906573122884_dp, 0.6628696853957159_dp, & 0.5042349934053336_dp, 0.5041796815747646_dp, 0.5041242821300232_dp, 0.50401322049655_dp, & 1.3994502099160337d-303, 1.199530179928029d-303, 9.99610149940024d-304, 5.9977008996401444d-304, & 499.19032387045183_dp, 499.2802878848461_dp, 499.3702518992403_dp, 499.5501799280288_dp] expected = [1.1242697836494346E-156_dp, -7.0751499885966513E-155_dp, 6.6185432736853698E-155_dp, & 7.7717941781117305E-156_dp, 1.2534227302224872E-002_dp, 3.4591630672860703E-003_dp, & -6.6635959548975499E-002_dp, 6.8893572859763092E-012_dp, 1.7296961499438702E-002_dp, & -2.1516112626678383E-002_dp, 2.8947852994014131E-009_dp, 1.5735107612153680E-010_dp, & 0.0000000000000000_dp, 0.0000000000000000_dp, 0.0000000000000000_dp, 0.0000000000000000_dp, & -6.8962897404005893E-002_dp, 0.11600081741700101_dp, -3.9325959159357701E-002_dp, -5.4809072994286029E-002_dp, & 1.5966478032830803E-002_dp, 2.6042180275774077E-007_dp, 5.3826197741831827E-008_dp, 1.0507745589842931E-008_dp, & 5.0740445951464912E-036_dp, 6.6789232767890394E-038_dp, 8.4475056518481737E-040_dp, 1.0281670110849426E-041_dp, & 5.7516289094274354E-047_dp, 4.9847818101108337E-049_dp, 4.1752109811469430E-051_dp, 3.3719895152572157E-053_dp, & 0.0000000000000000_dp, 0.0000000000000000_dp, 0.0000000000000000_dp, 0.0000000000000000_dp, & -3.5113774172006770E-002_dp, -1.2362051018001158E-002_dp, 3.1067922823692470E-002_dp, 2.5002750863701195E-002_dp] call lcompilers_test(bessel_jn(n, x), expected) y = [1036.462826483388272_sp, 1.7197292882018389_sp, 10.2368267382872828_sp, 0.17197292882018389_sp, & 152.67283628_sp, 632.92729728_sp, 1.2728272919_sp, 1.2828272919_sp, & 29.82407037185126_sp, 35.2459016393_sp, 46.2634946_sp, 24.7740903638_sp, & 15.8978408636372_sp, 8.801468212714914_sp, 8.798080767692923_sp, 8.791287884846061575_sp, & 0.6635324560331525_sp, 0.6633115808685429_sp, 0.6630906573122884_sp, 0.6628696853957159_sp, & 0.5042349934053336_sp, 0.5041796815747646_sp, 0.5041242821300232_sp, 0.50401322049655_sp, & 499.19032387045183_sp, 499.2802878848461_sp, 499.3702518992403_sp, 499.5501799280288_sp] expected_y = [1.23675410E-02_sp, 0.578831732_sp, 0.246125504_sp, 1.05763575E-04_sp, & 2.68192869E-02_sp, -2.04640366E-02_sp, 8.70731674E-05_sp, 8.41663041E-06_sp, & 3.94373797E-02_sp, -0.118844219_sp, 0.100343116_sp, -0.164519981_sp, & 0.127764359_sp, 8.69522523E-03_sp, 3.02742911E-03_sp, 9.63504543E-04_sp, & 1.02301633E-21_sp, 1.98594108E-23_sp, 3.63846685E-25_sp, 6.31080674E-27_sp, & 4.41184424E-31_sp, 5.28522317E-33_sp, 6.04228548E-35_sp, 6.58917622E-37_sp, & -3.08027826E-02_sp, 1.36694657E-02_sp, 3.46039571E-02_sp, -6.74327370E-04_sp] call lcompilers_test(bessel_jn(n(1:size(y)), y), expected_y, 10.0_sp) end program lfortran-0.63.0/integration_tests/pass_array_by_data_04.f900000664000175000017500000000140515174404631024037 0ustar alastairalastairmodule pass_array_by_data_04_find_fit_module contains subroutine find_fit(data_x) real, intent(in) :: data_x(:) real :: y y = 0 call fcn(data_x, y) print *, y if (abs(y - 6.0) > 1e-6) error stop contains subroutine fcn(data_x, y) real, intent(in) :: data_x(:) real, intent(out) :: y integer :: i do i = 1, size(data_x) y = y + data_x(i) end do end subroutine fcn end subroutine find_fit end module program main use pass_array_by_data_04_find_fit_module, only: find_fit implicit none real :: data_x(3) integer :: i do i = 1, 3 data_x(i) = i end do call find_fit(data_x) end program main lfortran-0.63.0/integration_tests/intrinsics_169.f900000664000175000017500000000024115174404631022466 0ustar alastairalastairprogram intrinsics_169 implicit none integer(4) :: a a = -huge(-1) - 1 print *, mod(a, 10) if (mod(a, 10) /= -8) error stop end program lfortran-0.63.0/integration_tests/class_77.f900000664000175000017500000000155015174404631021330 0ustar alastairalastairmodule class_77_mod implicit none type :: toml_value integer, allocatable :: x(:) end type toml_value type, extends(toml_value) :: toml_table class(toml_value), allocatable :: table_key end type toml_table end module class_77_mod program class_77 use class_77_mod implicit none type(toml_table), allocatable :: table class(toml_value), allocatable :: value allocate(table) allocate(toml_table :: table%table_key) allocate(table%table_key%x(5)) table%table_key%x = [1,2,3,4,5] value = table select type(value) type is (toml_table) print *, allocated(value%table_key), value%table_key%x if (.not. allocated(value%table_key)) error stop if (any(value%table_key%x /= [1,2,3,4,5])) error stop class default error stop end select end program class_77 lfortran-0.63.0/integration_tests/arrayitem_02.f900000664000175000017500000000065715174404631022213 0ustar alastairalastairprogram arrayitem_02 implicit none type :: a1 integer, allocatable :: x(:) end type type :: a2 type(a1) :: y(4) end type type :: a3 type(a2) :: z(3) end type type :: a4 type(a3) :: w(2) end type type(a4) :: obj allocate(obj%w(1)%z(2)%y(3)%x(50)) print *, size(obj%w(1)%z(2)%y(3)%x) if(size(obj%w(1)%z(2)%y(3)%x) /= 50) error stop end programlfortran-0.63.0/integration_tests/arrays_31.f900000664000175000017500000000021515174404631021507 0ustar alastairalastairprogram arrays_31 implicit none integer :: x(5) integer :: pqr = size(x) print *, pqr if (pqr /= 5) error stop end program lfortran-0.63.0/integration_tests/nested_07.f900000664000175000017500000000076015174404631021500 0ustar alastairalastairmodule nested_07_testmod_der1 private public fcn contains subroutine fcn(x, fvec) real, intent(in) :: x real, intent(out) :: fvec integer :: i do i = 1, 3 print *, "x(1) = ", x fvec = x+1 print *, "fvec(i) = ", fvec end do end subroutine end module program main use nested_07_testmod_der1, only: fcn real :: x, fvec ! The following starting values provide a rough fit. x = 1.0 call check_deriv() contains subroutine check_deriv() call fcn(x, fvec) end subroutine end program lfortran-0.63.0/integration_tests/arrays_85.f900000664000175000017500000000166515174404631021532 0ustar alastairalastairprogram arrays_85 use iso_fortran_env, only: int8 integer(int8), target :: full_key(1:4, 1:3) integer(int8), pointer :: full_key_ptr(:, :) full_key = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [4, 3]) if( lbound(full_key, 1) /= 1 ) error stop if( any(full_key /= reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [4, 3])) ) error stop full_key_ptr => full_key call process_key(full_key_ptr) print *, full_key if( any(full_key /= reshape([1, 2, 2, 4, 5, 6, 99, 8, 9, 10, 11, 12], [4, 3]) ) ) error stop call process_key(full_key(2:4, 1:2)) print *, full_key if( any(full_key /= reshape([1, 2, 2, 2, 5, 6, 99, 99, 9, 10, 11, 12], [4, 3]) ) ) error stop contains subroutine process_key(key) integer(int8), intent(inout) :: key(0:, :) if( lbound(key, 1) /= 0 ) error stop key(2, 1) = 2 key(2, 2) = 99 end subroutine process_key end program arrays_85 lfortran-0.63.0/integration_tests/iso_c_binding_04.f900000664000175000017500000000141215174404631022774 0ustar alastairalastairmodule iso_c_binding_04_mod use iso_c_binding, only: c_ptr, c_f_pointer, c_loc, c_int implicit none contains subroutine set_data(p, data) type(c_ptr), intent(in) :: p type(c_ptr), intent(in) :: data type(c_ptr), pointer :: ptr_data call c_f_pointer(p, ptr_data) ptr_data = data end subroutine end module program iso_c_binding_04 use iso_c_binding_04_mod use iso_c_binding, only: c_ptr, c_loc, c_int, c_f_pointer implicit none type(c_ptr), target :: storage integer(c_int), target :: val integer(c_int), pointer :: iptr val = 42 storage = c_loc(val) call set_data(c_loc(storage), storage) call c_f_pointer(storage, iptr) if (iptr /= 42) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/intrinsics_252.f900000664000175000017500000000373615174404631022473 0ustar alastairalastairprogram intrinsics_252 use, intrinsic :: iso_fortran_env, only: dp => real64 real(dp), parameter :: r1 = derf(1.1_dp) real(dp), parameter :: r2 = derf(40.12_dp) real(dp), parameter :: ar1(3) = derf([0.5_dp, -1.5_dp, 2.2_dp]) real(dp), parameter :: ar2(2) = derf([-0.2_dp, 0.0_dp]) real(dp) :: x, y, z real(dp) :: arr1(3), arr2(3), res(3) x = 6.738377383_dp y = 3.1473863781_dp z = 7389.83936383_dp print *, derf(x) if (abs(derf(x) - 1.00000000000000000e+00_dp) > 1e-12) error stop print *, derf(y) if (abs(derf(y) - 9.99991455910536065e-01_dp) > 1e-12) error stop print *, derf(z) if (abs(derf(z) - 1.00000000000000000e+00_dp) > 1e-12) error stop x = -6.738377383_dp y = -3.1473863781_dp z = -7389.83936383_dp print *, derf(x) if (abs(derf(x) - (-1.00000000000000000e+00_dp)) > 1e-12) error stop print *, derf(y) if (abs(derf(y) - (-9.99991455910536065e-01_dp)) > 1e-12) error stop print *, derf(z) if (abs(derf(z) - (-1.00000000000000000e+00_dp)) > 1e-12) error stop print *, r1 if (abs(r1 - 8.80205069574081733e-01_dp) > 1e-12_dp) error stop print *, r2 if (abs(r2 - 1.00000000000000000e+00_dp) > 1e-12_dp) error stop print *, ar1 if (any(abs(ar1 - [5.20499877813046519e-01_dp, -9.66105146475310761e-01_dp, & 9.98137153702018165e-01_dp]) > 1e-12_dp)) error stop print *, ar2 if (any(abs(ar2 - [-2.22702589210478474e-01_dp, 0.00000000000000000e+00_dp]) > 1e-12_dp)) error stop arr1 = [-6.738377383_dp, -3.1473863781_dp, -7389.83936383_dp] print *, derf(arr1) if (any(abs(derf(arr1) - [-1.00000000000000000e+00_dp, -9.99991455910536065e-01_dp, & -1.00000000000000000e+00_dp]) > 1e-12_dp)) error stop arr2 = [6.738377383_dp, 3.1473863781_dp, 7389.83936383_dp] res = derf(arr2) print *, res if (any(abs(res - [1.00000000000000000e+00_dp, 9.99991455910536065e-01_dp, & 1.00000000000000000e+00_dp]) > 1e-12_dp)) error stop end programlfortran-0.63.0/integration_tests/openmp_28.f900000664000175000017500000000236415174404631021521 0ustar alastairalastairsubroutine csr_matvec(Ap, Aj, Ax, x, y) ! Compute y = A*x for CSR matrix A and dense vectors x, y integer, intent(in) :: Ap(:), Aj(:) real, intent(in) :: Ax(:), x(:) real, intent(inout) :: y(size(Ap)-1) integer :: i, j ! Initialize y to zero y = 0.0 !$omp parallel shared(Ap, Aj, Ax, x, y) private(i, j) !$omp do do i = 1, size(Ap)-1 do j = Ap(i), Ap(i+1)-1 y(i) = y(i) + Ax(j)*x(Aj(j)) end do end do !$omp end do !$omp end parallel print *, sum(y(1:10)) if (abs(sum(y(1:10)) - 950.00) > 1e-8) error stop end subroutine program openmp_28 use omp_lib implicit none interface subroutine csr_matvec(Ap, Aj, Ax, x, y) integer, intent(in) :: Ap(:), Aj(:) real, intent(in) :: Ax(:), x(:) real, intent(inout) :: y(size(Ap)-1) end subroutine end interface integer, parameter :: n = 100 integer :: i real :: x(n), y(n) integer, allocatable :: Ap(:), Aj(:) real, allocatable :: Ax(:) ! Initialize CSR matrix A allocate(Ap(n+1), Aj(3*n), Ax(3*n)) Ap = [(3*(i-1)+1, i=1,n+1)] Aj = [(mod(i-1, n)+1, i=1,3*n)] Ax = [(1.0, 2.0, 3.0, i=1,n)] ! Initialize vector x x = [(i, i=1,n)] ! Initialize y to zero y = 0.0 ! Compute y = A*x call csr_matvec(Ap, Aj, Ax, x, y) ! Print the result print *, sum(y) if (abs(sum(y) - 30300.00) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/arrays_52.f900000664000175000017500000000134515174404631021517 0ustar alastairalastair! ! Check that lcompilers_get_i() returns mutated value of i not just hard coded value of 4 program arrays_52 implicit none integer(4), dimension(11) :: cs integer(4), save :: nx = 4 cs = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] call test_1(cs) nx = 10 call test_2(cs) contains subroutine test_1(x) integer(4), dimension(nx), intent(in) :: x print *, "Size of array x : ", size(x) if (size(x) /= 4) error stop end subroutine test_1 subroutine test_2(x) integer(4), dimension(nx), intent(in) :: x print *, "Size of array x : ", size(x) if (size(x) /= 10) error stop end subroutine test_2 end program arrays_52 lfortran-0.63.0/integration_tests/intrinsics_156.f900000664000175000017500000000443215174404631022470 0ustar alastairalastairprogram intrinsics_156 logical, parameter :: l1 = blt(10, 5) logical, parameter :: l2 = blt(10_8, -5_8) integer:: k1 = 10 integer:: k2 = 5 integer:: k3 = -5 integer:: k4 = 15 integer:: k5 = 0 integer:: k6 = -15 logical:: f = .false. logical, parameter :: ar1(4) = blt([1, 2, 4, 5], 3) logical, parameter :: ar2(4) = blt([-1, 3, -7, 5], -3) integer :: arr1(4) integer :: arr2(3) logical :: res(3) arr1 = [11, 2, 13, 4] arr2 = [-5_8, 7_8, 0_8] print *, l1 if (l1 .neqv. .false.) error stop print *, l2 if (l2 .neqv. .true.) error stop print *, ar1 if (any(ar1) .neqv. .true.) error stop print *, ar2 if (any(ar2) .neqv. .true.) error stop print*, blt(10, 5) if (blt(10, 5) .neqv. .false.) error stop print*, blt(-5, 10) if (blt(-5, 10) .neqv. .false.) error stop print*, blt(-5, 5) if (blt(-5, 5) .neqv. .false.) error stop print*, blt(-5, -15) if (blt(-5, -15) .neqv. .false.) error stop print*, blt(5, 15) if (blt(5, 15) .neqv. .true.) error stop print*, blt(5, -15) if (blt(5, -15) .neqv. .true.) error stop print*, blt(0, -5) if (blt(0, -5) .neqv. .true.) error stop print*, blt(0, 5) if (blt(0, 5) .neqv. .true.) error stop print*, blt(-5, 0) if (blt(-5, 0) .neqv. .false.) error stop print*, blt(5, 0) if (blt(5, 0) .neqv. f) error stop print*, blt(k1, k2) if (blt(k1, k2) .neqv. .false.) error stop print*, blt(k3, k1) if (blt(k3, k1) .neqv. .false.) error stop print*, blt(k3, k3) if (blt(k3, k3) .neqv. .false.) error stop print*, blt(k3, k6) if (blt(k3, k6) .neqv. .false.) error stop print*, blt(k2, k4) if (blt(k2, k4) .neqv. .true.) error stop print*, blt(k2, k6) if (blt(k2, k6) .neqv. .true.) error stop print*, blt(k5, k3) if (blt(k5, k3) .neqv. .true.) error stop print*, blt(k5, k2) if (blt(k5, k2) .neqv. .true.) error stop print*, blt(k3, k5) if (blt(k3, k5) .neqv. .false.) error stop print*, blt(k2, k5) if (blt(k2, k5) .neqv. f) error stop print *, blt(arr1, 5) if (any(blt(arr1, 5) .neqv. .true.) .neqv. .true.) error stop res = blt(arr2, k5) print *, res if (any(res .neqv. .true.) .neqv. .true.) error stop end program lfortran-0.63.0/integration_tests/openmp_03.f900000664000175000017500000000046415174404631021511 0ustar alastairalastairsubroutine omp_func(n) implicit none integer :: i, n !$omp parallel shared(i, n) !$omp do do i = 1, n end do !$omp end do !$omp end parallel print *, "n = ", n if (n /= 100) error stop end subroutine program openmp_03 integer, parameter :: n = 100 call omp_func(n) print *, "Done for n = ", n end program lfortran-0.63.0/integration_tests/character_23.f900000664000175000017500000000066415174404631022153 0ustar alastairalastairprogram character_23 implicit none character,parameter:: abc*(*) = 'abc' character,parameter:: x*(*) = 'hello' character*(*),parameter:: y = 'world' if (abc /= 'abc') error stop if (len(abc) /= 3) error stop if (x /= 'hello') error stop if (len(x) /= 5) error stop if (y /= 'world') error stop if (len(y) /= 5) error stop print *, abc print *, x print *, y end program character_23 lfortran-0.63.0/integration_tests/file_49.f900000664000175000017500000000066515174404631021147 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/4647 ! Scratch file with form='unformatted' ! Exact MRE from issue body program file_49 implicit none integer :: unit_no character :: q*12 open(newunit=unit_no, status='scratch', form='unformatted') write(unit_no) 'Hello world!' rewind unit_no read(unit_no) q close(unit_no) print *, q if (q /= 'Hello world!') error stop end program file_49 lfortran-0.63.0/integration_tests/mangle_underscore_01.f900000664000175000017500000000050615174404631023702 0ustar alastairalastairsubroutine add(x, y) real :: x, y print *, x + y if (abs(x + y - 0.7) > 1e-7) error stop end subroutine subroutine sub(x,y) real :: x, y print *, x - y if (abs(x - y - (-4.5)) > 1e-7) error stop end subroutine program mangle_underscore_01 call add(-1.9, 2.6) call sub(-1.9, 2.6) end program lfortran-0.63.0/integration_tests/arrays_53.f900000664000175000017500000000014015174404631021510 0ustar alastairalastairprogram arrays_53 logical :: k(5) = .false. print *, "k: ", k if(any(k)) error stop end program lfortran-0.63.0/integration_tests/c_ptr_13.f900000664000175000017500000000074115174404631021321 0ustar alastairalastairprogram c_ptr_13 use iso_c_binding, only: c_ptr, c_f_pointer, c_loc implicit none integer, target :: mydata(4,4) integer, pointer :: local_slice(:,:) type(c_ptr) :: p integer :: i, j mydata = reshape([(i, i=1,16)], [4,4]) p = c_loc(mydata) call c_f_pointer(p, local_slice, shape(mydata)) do j = 1, 4 do i = 1, 4 if (local_slice(i,j) /= mydata(i,j)) error stop "mismatch" end do end do end program c_ptr_13 lfortran-0.63.0/integration_tests/pointer_06.f900000664000175000017500000000062315174404631021673 0ustar alastairalastairprogram a implicit none ! Declare an unlimited polymorphic pointer class(*), pointer :: ptr character(5), target :: t t = 'abcde' ptr => t select type (p => ptr) type is (character(*)) print *, p if (p /= 'abcde') error stop p = 'vwxyz' class default print *, "Unknown" error stop end select print *, t if (t /= 'vwxyz') error stop end program alfortran-0.63.0/integration_tests/allocate_08.f900000664000175000017500000000134215174404631022000 0ustar alastairalastairprogram allocate_08 implicit none call allocate_08_split1() contains subroutine allocate_08_split1() implicit none character(len=:), allocatable :: array(:) integer :: ireturn, imax, i ireturn = 5 imax = 5 allocate(character(len=imax) :: array(ireturn)) do i = 1, 3 array(i) = 'hello' end do do i = 4, 5 array(i) = 'hi' end do do i = 1, 3 print *, array(i) if( array(i) /= 'hello' ) error stop end do do i = 4, 5 print *, array(i) if( array(i) /= 'hi' ) error stop end do end subroutine allocate_08_split1 end program allocate_08 lfortran-0.63.0/integration_tests/assumed_type_03.c0000664000175000017500000000217315174404631022540 0ustar alastairalastair#include #include #include void check_dt_char_inline(CFI_cdesc_t *desc, int32_t *ok) { /* * Verify that the 5-byte string "hello" appears physically inside the * raw struct bytes described by the CFI descriptor. If the Fortran * compiler stores character(len=5) inline in the derived type (correct * per Fortran standard for non-pointer, non-allocatable components), * the bytes are part of the struct and we find them. If the compiler * stores a heap pointer instead, the struct contains an address, not * the character data, and this search fails. */ const char *base = (const char *)desc->base_addr; size_t len = desc->elem_len; *ok = 0; for (size_t i = 0; i + 5 <= len; i++) { if (memcmp(base + i, "hello", 5) == 0) { *ok = 1; return; } } } void copy_via_cfi(CFI_cdesc_t *src, CFI_cdesc_t *dst) { /* * Raw byte copy — exactly what GASNet's gex_Coll_BroadcastNB does * inside caffeine's caf_co_broadcast. */ memcpy(dst->base_addr, src->base_addr, src->elem_len); } lfortran-0.63.0/integration_tests/read_26.f900000664000175000017500000000062315174404631021130 0ustar alastairalastairprogram read_26 implicit none character(8) :: string = 'abcd' integer :: unit open(newunit=unit, file='foobar_test', status='replace') write(unit, "(A)") string(1:4) rewind(unit) read(unit, "(A)") string(5:8) close(unit, status='delete') if (string /= 'abcdabcd') error stop 'Expected: abcdabcd, got: ' // string print "(A)", string end program read_26lfortran-0.63.0/integration_tests/openmp_44.f900000664000175000017500000000155515174404631021520 0ustar alastairalastairmodule openmp_44_parallel_sections implicit none contains subroutine compute_a() print *, "Computing A" end subroutine compute_a subroutine compute_b() print *, "Computing B" end subroutine compute_b subroutine compute_c() print *, "Computing C" end subroutine compute_c end module openmp_44_parallel_sections program openmp_44 use omp_lib use openmp_44_parallel_sections implicit none integer :: tid=0 !$omp parallel sections reduction(+:tid) !$omp section call compute_a() tid = tid + omp_get_thread_num() print *, "Thread ID:", tid !$omp section call compute_b() tid = tid + omp_get_thread_num() print *, "Thread ID:", tid !$omp section call compute_c() tid = tid + omp_get_thread_num() print *, "Thread ID:", tid !$omp end parallel sections print *, "Final Thread ID:", tid end program openmp_44lfortran-0.63.0/integration_tests/intrinsics_117.f900000664000175000017500000000047715174404631022472 0ustar alastairalastairprogram intrinsics_117 print *, mod( a = 17.5, p = 5.5 ) print *, mod( a = 17.5d0, p = 5.5 ) print *, mod( a = 17.5, p = 5.5d0 ) if ( .not. mod( a = 17, p = 3 ) == 2 ) error stop if ( .not. mod( 17, p = 3 ) == 2 ) error stop if ( .not. mod( 17, 3 ) == 2 ) error stop end program intrinsics_117 lfortran-0.63.0/integration_tests/intrinsics_104.f900000664000175000017500000000044415174404631022460 0ustar alastairalastairprogram intrinsics_104 implicit none integer, parameter :: new_len = len(new_line('a')) integer, parameter :: new_len2 = len(adjustl('a')) print *, new_len if (new_len /= 1) error stop print*, new_len2 if (new_len2 /= 1) error stop end program lfortran-0.63.0/integration_tests/class_59.f900000664000175000017500000000014115174404631021323 0ustar alastairalastairprogram class_59 class(*), allocatable :: dum allocate(dum , source="sss") end program lfortran-0.63.0/integration_tests/c_ptr_01.f900000664000175000017500000000134715174404631021321 0ustar alastairalastairsubroutine idz_realcomp(n,a) integer n real*8 a(n) a = 12.5d0 return end subroutine idzp_svd(ls, w) use iso_c_binding, only: c_f_pointer, c_loc real*8 eps complex*16, target :: w(*) integer :: ls, isi, i real(8), pointer :: w_cast(:) isi = 1 call c_f_pointer(c_loc(w(isi)), w_cast, [ls]) call idz_realcomp(ls,w_cast) do i = 1, ls if (abs(w_cast(i) - 12.5d0) > 1e-12) error stop end do print *, w_cast return end program main complex*16, target :: w(5) interface subroutine idzp_svd(ls, w) use iso_c_binding, only: c_f_pointer, c_loc complex*16, target :: w(*) integer :: ls end subroutine end interface call idzp_svd(5, w) end program lfortran-0.63.0/integration_tests/intrinsics_04s.f900000664000175000017500000000026315174404631022561 0ustar alastairalastairprogram intrinsics_04s complex :: z z = (1.5, 0.1) z = tan(z) print *, z if (abs(real(z) - 4.69238520) > 1e-5) error stop !if (abs(aimag(z) - 6.69462872) > 1e-5) error stop end lfortran-0.63.0/integration_tests/modules_43.f900000664000175000017500000000155715174404631021673 0ustar alastairalastairmodule modules_43_fpm_sources implicit none type srcfile_t character(:), allocatable :: file_name character(:), allocatable :: exe_name integer(8) :: digest end type srcfile_t contains subroutine add_sources_from_dir(sources) type(srcfile_t), allocatable, intent(inout), target :: sources(:) logical :: exclude_source(10) type(srcfile_t), allocatable :: dir_sources(:) allocate(dir_sources(1)) if (.not. allocated(sources)) then sources = pack(dir_sources, .not. exclude_source) else sources = [sources, pack(dir_sources, .not. exclude_source)] end if end subroutine add_sources_from_dir end module modules_43_fpm_sources program modules_43 use modules_43_fpm_sources implicit none type(srcfile_t), allocatable, target :: sources(:) allocate(sources(1)) call add_sources_from_dir(sources) end program modules_43 lfortran-0.63.0/integration_tests/format_69.f900000664000175000017500000000060315174404631021512 0ustar alastairalastairprogram format_69 implicit none integer :: i, u character :: c i = 69 open(newunit=u, file="format_69.txt", status="replace", action="write") write(u, '(a)') i close(u) open(newunit=u, file="format_69.txt", action="read", status="old") read(u, '(a1)') c close(u, status="delete") if (c /= 'E') error stop "ASCII mismatch" end program format_69lfortran-0.63.0/integration_tests/allocate_34.f900000664000175000017500000000113715174404631022001 0ustar alastairalastairprogram allocate_34 implicit none type :: t1 integer, allocatable :: arr(:) end type t1 type :: t2 type(t1), allocatable :: arr(:) end type t2 type :: t3 type(t2), allocatable :: z(:) end type t3 type(t3) :: obj if (.not. allocated(obj%z)) then allocate(obj%z(2)) end if if (.not. allocated(obj%z(1)%arr)) then allocate(obj%z(1)%arr(3)) end if if (.not. allocated(obj%z(1)%arr(1)%arr)) then allocate(obj%z(1)%arr(1)%arr(5)) end if if (size(obj%z(1)%arr(1)%arr) /= 5) error stop end program lfortran-0.63.0/integration_tests/nested_vars_02.f900000664000175000017500000000645015174404631022530 0ustar alastairalastairmodule nested_vars_02_mod implicit none type :: linop_type procedure(vector_sub), nopass, pointer :: matvec => null() end type abstract interface subroutine vector_sub(x, y, alpha, beta, op) real, intent(in) :: x(:) real, intent(inout) :: y(:) real, intent(in) :: alpha real, intent(in) :: beta character(1), intent(in) :: op end subroutine vector_sub end interface contains subroutine run_repro() call case_struct_member_dispatch() call case_reassociate_pointer_then_dispatch() end subroutine run_repro subroutine case_struct_member_dispatch() type(linop_type) :: a real :: x(2), y(2) logical, target :: di(2) logical, pointer :: di_(:) x = [1.0, 2.0] y = [3.0, 4.0] di = [.true., .false.] di_ => di a%matvec => matvec call a%matvec(x, y, 1.0, 0.0, 'N') if (abs(y(1) - 0.0) > 1e-6) error stop "nested_vars_02 case0: y(1) mismatch" if (abs(y(2) - 4.0) > 1e-6) error stop "nested_vars_02 case0: y(2) mismatch" contains subroutine matvec(x, y, alpha, beta, op) real, intent(in) :: x(:) real, intent(inout) :: y(:) real, intent(in) :: alpha real, intent(in) :: beta character(1), intent(in) :: op if (abs(alpha - 1.0) > 1e-6) error stop "nested_vars_02 case0: alpha mismatch" if (abs(beta - 0.0) > 1e-6) error stop "nested_vars_02 case0: beta mismatch" if (op /= 'N') error stop "nested_vars_02 case0: op mismatch" y = merge(0.0, y, di_) end subroutine matvec end subroutine case_struct_member_dispatch subroutine case_reassociate_pointer_then_dispatch() type(linop_type) :: a real :: x(2), y(2) logical, target :: di_a(2), di_b(2) logical, pointer :: di_(:) x = [1.0, 2.0] y = [7.0, 8.0] di_a = [.true., .false.] di_b = [.false., .true.] di_ => di_a a%matvec => matvec call a%matvec(x, y, 1.0, 0.0, 'N') if (abs(y(1) - 0.0) > 1e-6) error stop "nested_vars_02 case1a: y(1) mismatch" if (abs(y(2) - 8.0) > 1e-6) error stop "nested_vars_02 case1a: y(2) mismatch" y = [7.0, 8.0] di_ => di_b call a%matvec(x, y, 1.0, 0.0, 'N') if (abs(y(1) - 7.0) > 1e-6) error stop "nested_vars_02 case1b: y(1) mismatch" if (abs(y(2) - 0.0) > 1e-6) error stop "nested_vars_02 case1b: y(2) mismatch" contains subroutine matvec(x, y, alpha, beta, op) real, intent(in) :: x(:) real, intent(inout) :: y(:) real, intent(in) :: alpha real, intent(in) :: beta character(1), intent(in) :: op if (abs(alpha - 1.0) > 1e-6) error stop "nested_vars_02: alpha mismatch" if (abs(beta - 0.0) > 1e-6) error stop "nested_vars_02: beta mismatch" if (op /= 'N') error stop "nested_vars_02: op mismatch" y = merge(0.0, y, di_) end subroutine matvec end subroutine case_reassociate_pointer_then_dispatch end module nested_vars_02_mod program nested_vars_02 use nested_vars_02_mod implicit none call run_repro() end program nested_vars_02lfortran-0.63.0/integration_tests/openmp_17.f900000664000175000017500000000172615174404631021520 0ustar alastairalastairsubroutine initialize_array(n, b) use omp_lib implicit none integer, intent(in) :: n real, intent(inout) :: b(:) integer :: i !$omp parallel shared(b) private(i) !$omp do do i = 1, n b(i) = 12.91 end do !$omp end do !$omp end parallel print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end subroutine program openmp_17 use omp_lib integer, parameter :: n = 100000 real, dimension(n) :: a interface subroutine initialize_array(n, b) implicit none integer, intent(in) :: n real, intent(inout) :: b(:) end subroutine end interface print *, a(2) call omp_set_num_threads(4) call initialize_array(n, a) print *, a(1), a(n), a(12), a(12841) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(n) - 12.91) > 1e-8) error stop if (abs(a(12) - 12.91) > 1e-8) error stop if (abs(a(12841) - 12.91) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/class_109.f900000664000175000017500000000467215174404631021414 0ustar alastairalastairmodule class_109_module implicit none type :: base_type integer :: k contains procedure :: nelements end type base_type type :: wrapper class(base_type), allocatable :: obj contains procedure :: caller end type wrapper contains pure function nelements(self, i) result(n) class(base_type), intent(in) :: self integer, intent(in) :: i integer :: n n = self%k end function nelements subroutine caller(self) class(wrapper), intent(in) :: self real(8), dimension(self%obj%nelements(20)) :: a if (size(a) /= self%obj%k) error stop 1 end subroutine caller end module class_109_module module class_109_abstract_module implicit none type, abstract :: abstract_type contains procedure(nelements_abstract_iface), deferred :: nelements end type abstract_type abstract interface pure function nelements_abstract_iface(self, i) result(n) import :: abstract_type class(abstract_type), intent(in) :: self integer, intent(in) :: i integer :: n end function nelements_abstract_iface end interface type, extends(abstract_type) :: concrete_type integer :: k contains procedure :: nelements => concrete_nelements end type concrete_type type :: wrapper_abstract class(abstract_type), allocatable :: obj contains procedure :: caller_abstract end type wrapper_abstract contains pure function concrete_nelements(self, i) result(n) class(concrete_type), intent(in) :: self integer, intent(in) :: i integer :: n n = self%k end function concrete_nelements subroutine caller_abstract(self) class(wrapper_abstract), intent(in) :: self real(8), dimension(self%obj%nelements(20)) :: a if (size(a) /= 5) error stop 2 end subroutine caller_abstract end module class_109_abstract_module program class_109 use class_109_module use class_109_abstract_module implicit none type(wrapper) :: w type(wrapper_abstract) :: wa allocate(base_type :: w%obj) w%obj%k = 4 call w%caller() allocate(concrete_type :: wa%obj) select type (obj => wa%obj) type is (concrete_type) obj%k = 5 class default error stop 3 end select call wa%caller_abstract() print *, "ok" end program class_109 lfortran-0.63.0/integration_tests/arrays_105.f900000664000175000017500000000141615174404631021575 0ustar alastairalastairmodule arrays_105_mod implicit none type :: t integer :: x = 0 end type interface t module procedure construct end interface contains pure function construct(x) result(res) integer, intent(in) :: x type(t) :: res res%x = x end function pure function f(a) result(r) type(t), intent(in) :: a integer :: r r = a%x end function end module program arrays_105 use arrays_105_mod implicit none call sub contains subroutine sub real :: arr(f(t(3))) integer :: i do i = 1, size(arr) arr(i) = real(i) end do if (size(arr) /= 3) error stop if (abs(arr(1) - 1.0) > 1e-6) error stop if (abs(arr(2) - 2.0) > 1e-6) error stop if (abs(arr(3) - 3.0) > 1e-6) error stop end subroutine end program lfortran-0.63.0/integration_tests/lfortran_intrinsic_sin.f900000664000175000017500000003223715174404631024476 0ustar alastairalastairmodule lfortran_intrinsic_sin ! Implicit dependencies ! abs impure/math ! modulo pure/math2 ! min builtin/array ! max builtin/array use iso_c_binding, only: c_double, c_int use, intrinsic :: iso_fortran_env, only: sp => real32, dp => real64 implicit none private public sin interface sin module procedure dsin end interface real(dp), parameter :: pi = 3.1415926535897932384626433832795_dp contains ! sin -------------------------------------------------------------------------- ! Our implementation here is based off of the C files from the Sun compiler ! ! Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. ! ! Developed at SunSoft, a Sun Microsystems, Inc. business. ! Permission to use, copy, modify, and distribute this ! software is freely granted, provided that this notice ! is preserved. ! sin(x) ! https://www.netlib.org/fdlibm/s_sin.c ! Return sine function of x. ! ! kernel function: ! __kernel_sin ... sine function on [-pi/4,pi/4] ! __kernel_cos ... cose function on [-pi/4,pi/4] ! __ieee754_rem_pio2 ... argument reduction routine ! ! Method. ! Let S,C and T denote the sin, cos and tan respectively on ! [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 ! in [-pi/4 , +pi/4], and let n = k mod 4. ! We have ! ! n sin(x) cos(x) tan(x) ! ---------------------------------------------------------- ! 0 S C T ! 1 C -S -1/T ! 2 -S -C T ! 3 -C S -1/T ! ---------------------------------------------------------- ! ! Special cases: ! Let trig be any of sin, cos, or tan. ! trig(+-INF) is NaN, with signals; ! trig(NaN) is that NaN; ! ! Accuracy: ! TRIG(x) returns trig(x) nearly rounded ! real(dp) function dsin(x) result(r) real(dp), intent(in) :: x real(dp) :: y(2) integer :: n if (abs(x) < pi/4) then r = kernel_dsin(x, 0.0_dp, 0) else n = rem_pio2_c(x, y) select case (modulo(n, 4)) case (0) r = kernel_dsin(y(1), y(2), 1) case (1) r = kernel_dcos(y(1), y(2)) case (2) r = -kernel_dsin(y(1), y(2), 1) case default r = -kernel_dcos(y(1), y(2)) end select end if end function ! __kernel_sin( x, y, iy) ! http://www.netlib.org/fdlibm/k_sin.c ! kernel sin function on [-pi/4, pi/4], pi/4 ~ 0.7854 ! Input x is assumed to be bounded by ~pi/4 in magnitude. ! Input y is the tail of x. ! Input iy indicates whether y is 0. (if iy=0, y assume to be 0). ! ! Algorithm ! 1. Since sin(-x) = -sin(x), we need only to consider positive x. ! 2. if x < 2^-27 (hx<0x3e400000 0), return x with inexact if x!=0. ! 3. sin(x) is approximated by a polynomial of degree 13 on ! [0,pi/4] ! 3 13 ! sin(x) ~ x + S1*x + ... + S6*x ! where ! ! |sin(x) 2 4 6 8 10 12 | -58 ! |----- - (1+S1*x +S2*x +S3*x +S4*x +S5*x +S6*x )| <= 2 ! | x | ! ! 4. sin(x+y) = sin(x) + sin'(x')*y ! ~ sin(x) + (1-x*x/2)*y ! For better accuracy, let ! 3 2 2 2 2 ! r = x! (S2+x! (S3+x! (S4+x! (S5+x! S6)))) ! then 3 2 ! sin(x) = x + (S1*x + (x! (r-y/2)+y)) elemental real(dp) function kernel_dsin(x, y, iy) result(res) real(dp), intent(in) :: x, y integer, intent(in) :: iy real(dp), parameter :: half = 5.00000000000000000000e-01_dp real(dp), parameter :: S1 = -1.66666666666666324348e-01_dp real(dp), parameter :: S2 = 8.33333333332248946124e-03_dp real(dp), parameter :: S3 = -1.98412698298579493134e-04_dp real(dp), parameter :: S4 = 2.75573137070700676789e-06_dp real(dp), parameter :: S5 = -2.50507602534068634195e-08_dp real(dp), parameter :: S6 = 1.58969099521155010221e-10_dp real(dp) :: z, r, v if (abs(x) < 2.0_dp**(-27)) then res = x return end if z = x*x v = z*x r = S2+z*(S3+z*(S4+z*(S5+z*S6))) if (iy == 0) then res = x + v*(S1+z*r) else res = x-((z*(half*y-v*r)-y)-v*S1) end if end function ! __kernel_cos( x, y ) ! https://www.netlib.org/fdlibm/k_cos.c ! kernel cos function on [-pi/4, pi/4], pi/4 ~ 0.785398164 ! Input x is assumed to be bounded by ~pi/4 in magnitude. ! Input y is the tail of x. ! ! Algorithm ! 1. Since cos(-x) = cos(x), we need only to consider positive x. ! 2. if x < 2^-27 (hx<0x3e400000 0), return 1 with inexact if x!=0. ! 3. cos(x) is approximated by a polynomial of degree 14 on ! [0,pi/4] ! 4 14 ! cos(x) ~ 1 - x*x/2 + C1*x + ... + C6*x ! where the remez error is ! ! | 2 4 6 8 10 12 14 | -58 ! |cos(x)-(1-.5*x +C1*x +C2*x +C3*x +C4*x +C5*x +C6*x )| <= 2 ! | | ! ! 4 6 8 10 12 14 ! 4. let r = C1*x +C2*x +C3*x +C4*x +C5*x +C6*x , then ! cos(x) = 1 - x*x/2 + r ! since cos(x+y) ~ cos(x) - sin(x)*y ! ~ cos(x) - x*y, ! a correction term is necessary in cos(x) and hence ! cos(x+y) = 1 - (x*x/2 - (r - x*y)) ! For better accuracy when x > 0.3, let qx = |x|/4 with ! the last 32 bits mask off, and if x > 0.78125, let qx = 0.28125. ! Then ! cos(x+y) = (1-qx) - ((x*x/2-qx) - (r-x*y)). ! Note that 1-qx and (x*x/2-qx) is EXACT here, and the ! magnitude of the latter is at least a quarter of x*x/2, ! thus, reducing the rounding error in the subtraction. elemental real(dp) function kernel_dcos(x, y) result(res) real(dp), intent(in) :: x, y real(dp), parameter :: one= 1.00000000000000000000e+00_dp real(dp), parameter :: C1 = 4.16666666666666019037e-02_dp real(dp), parameter :: C2 = -1.38888888888741095749e-03_dp real(dp), parameter :: C3 = 2.48015872894767294178e-05_dp real(dp), parameter :: C4 = -2.75573143513906633035e-07_dp real(dp), parameter :: C5 = 2.08757232129817482790e-09_dp real(dp), parameter :: C6 = -1.13596475577881948265e-11_dp real(dp) :: z, r, qx, hz, a if (abs(x) < 2.0_dp**(-27)) then res = one return end if z = x*x r = z*(C1+z*(C2+z*(C3+z*(C4+z*(C5+z*C6))))) if (abs(x) < 0.3_dp) then res = one - (0.5_dp*z - (z*r - x*y)) else if (abs(x) > 0.78125_dp) then qx = 0.28125_dp else qx = abs(x)/4 end if hz = 0.5_dp*z-qx a = one-qx res = a - (hz - (z*r-x*y)) end if end function integer function rem_pio2_c(x, y) result(n) ! Computes 128bit float approximation of modulo(x, pi/2) returned ! as the sum of two 64bit floating point numbers y(1)+y(2) ! This function roughly implements: ! y(1) = modulo(x, pi/2) ! 64bit float ! y(2) = modulo(x, pi/2) - y(1) ! The exact tail ! n = (x-y(1)) / (pi/2) ! The y(1) is the modulo, and y(2) is a tail. When added directly ! as y(1) + y(2) it will be equal to just y(1) in 64bit floats, but ! if used separately in polynomial approximations one can use y(2) to get ! higher accuracy. real(dp), intent(in) :: x real(dp), intent(out) :: y(2) interface integer(c_int) function ieee754_rem_pio2(x, y) bind(c) use iso_c_binding, only: c_double, c_int real(c_double), value, intent(in) :: x real(c_double), intent(out) :: y(2) end function end interface n = ieee754_rem_pio2(x, y) end function ! Our implementation here is designed around range reduction to [-pi/2, pi/2] ! Subsequently, we fit a 64 bit precision polynomials via Sollya (https://www.sollya.org/) ! -- Chebyshev (32 terms) -- ! This has a theoretical approximation error bound of [-7.9489615048122632526e-41;7.9489615048122632526e-41] ! Due to rounding errors; we obtain a maximum error (w.r.t. gfortran) of ~ E-15 over [-10, 10] ! -- Remez (16 terms) -- [DEFAULT] (fewer terms) ! Due to rounding errors; we obtain a maximum error (w.r.t. gfortran) of ~ E-16 over [-10, 10] ! For large values, e.g. 2E10 we have an absolute error of E-7 ! For huge(0) we have an absolute error of E-008 ! TODO: Deal with very large numbers; the errors get worse above 2E10 ! For huge(0.0) we have 3.4028234663852886E+038 -0.52187652333365853 0.99999251142364332 1.5218690347573018 ! value gfortran sin lfortran sin absolute error elemental real(dp) function dsin2(x) result(r) real(dp), intent(in) :: x real(dp) :: y integer :: n y = modulo(x, 2*pi) y = min(y, pi - y) y = max(y, -pi - y) y = min(y, pi - y) r = kernel_dsin2(y) end function ! Accurate on [-pi/2,pi/2] to about 1e-16 elemental real(dp) function kernel_dsin2(x) result(res) real(dp), intent(in) :: x real(dp), parameter :: S1 = 0.9999999999999990771_dp real(dp), parameter :: S2 = -0.16666666666664811048_dp real(dp), parameter :: S3 = 8.333333333226519387e-3_dp real(dp), parameter :: S4 = -1.9841269813888534497e-4_dp real(dp), parameter :: S5 = 2.7557315514280769795e-6_dp real(dp), parameter :: S6 = -2.5051823583393710429e-8_dp real(dp), parameter :: S7 = 1.6046585911173017112e-10_dp real(dp), parameter :: S8 = -7.3572396558796051923e-13_dp real(dp) :: z z = x*x res = x * (S1+z*(S2+z*(S3+z*(S4+z*(S5+z*(S6+z*(S7+z*S8))))))) end function elemental real(dp) function kernel_dcos2(x) result(res) real(dp), intent(in) :: x real(dp), parameter :: C1 = 0.99999999999999999317_dp real(dp), parameter :: C2 = 4.3522024034217346524e-18_dp real(dp), parameter :: C3 = -0.49999999999999958516_dp real(dp), parameter :: C4 = -8.242872826356848038e-17_dp real(dp), parameter :: C5 = 4.166666666666261697e-2_dp real(dp), parameter :: C6 = 4.0485005435941782636e-16_dp real(dp), parameter :: C7 = -1.3888888888731381616e-3_dp real(dp), parameter :: C8 = -8.721570096570797013e-16_dp real(dp), parameter :: C9 = 2.4801587270604889267e-5_dp real(dp), parameter :: C10 = 9.352687193379247843e-16_dp real(dp), parameter :: C11 = -2.7557315787234544468e-7_dp real(dp), parameter :: C12 = -5.2320806585871644286e-16_dp real(dp), parameter :: C13 = 2.0876532326120694722e-9_dp real(dp), parameter :: C14 = 1.4637857803935104813e-16_dp real(dp), parameter :: C15 = -1.146215379106821115e-11_dp real(dp), parameter :: C16 = -1.6185683697669940221e-17_dp real(dp), parameter :: C17 = 4.6012969591571265687e-14_dp ! Remez16 res = C1 + x * (C2 + x * & (C3 + x * (C4 + x * & (C5 + x * (C6 + x * & (C7 + x * (C8 + x * & (C9 + x * (C10 + x * & (C11 + x * (C12 + x * & (C13 + x * (C14 + x * & (C15 + x * (C16 + x * C17))))))))))))))) end function real(dp) function dsin3(x) result(r) real(dp), intent(in) :: x real(dp) :: y integer :: n if (abs(x) < pi/4) then r = kernel_dsin2(x) else n = rem_pio2(x, y) select case (modulo(n, 4)) case (0) r = kernel_dsin2(y) case (1) r = kernel_dcos2(y) case (2) r = -kernel_dsin2(y) case default r = -kernel_dcos2(y) end select end if end function integer function rem_pio2(x, y) result(n) real(dp), intent(in) :: x real(dp), intent(out) :: y y = modulo(x, pi/2) if (y > pi/4) y = y-pi/2 n = (x-y) / (pi/2) end function end module program main use iso_fortran_env, only: sp => real32, dp => real64 use lfortran_intrinsic_sin implicit none real(dp) :: x x = 0.0_dp print*, sin(x) if (abs(sin(x) - 0.0_dp) > 1e-12) error stop x = 1.0_dp print*, sin(x) if (abs(sin(x) - 0.84147098480789650665_dp) > 1e-12) error stop x = 1.57_dp print*, sin(x) if (abs(sin(x) - 0.999999682931834610503_dp) > 1e-12) error stop end programlfortran-0.63.0/integration_tests/assumed_rank_02.f900000664000175000017500000000114015174404631022656 0ustar alastairalastairmodule assumed_rank_02_mod implicit none type :: t integer :: v = 0 end type interface t module procedure new_t end interface contains type(t) function new_t(flag, a1) integer, intent(in) :: flag integer, intent(in), dimension(..) :: a1 new_t%v = flag end function end module program assumed_rank_02 use assumed_rank_02_mod implicit none integer :: arr(3) type(t) :: x, y arr = [10, 20, 30] x = t(1, 2) if (x%v /= 1) error stop y = t(42, arr) if (y%v /= 42) error stop print *, x%v, y%v end program lfortran-0.63.0/integration_tests/read_60.f900000664000175000017500000000053315174404631021126 0ustar alastairalastairprogram read_60 implicit none character(len=10) :: s character(5), allocatable :: a(:) integer :: ios allocate(a(1)) s = "hello" read(s, *, iostat=ios) a if (ios /= 0) then error stop "READ failed" end if if (a(1) /= "hello") then error stop "Wrong value in a(1)" end if print *, "PASS" end program read_60lfortran-0.63.0/integration_tests/attr_dim_03.f900000664000175000017500000000026515174404631022015 0ustar alastairalastairsubroutine sub (array) dimension array(*) double precision array end subroutine program attr_dim_03 double precision , dimension(3) :: arr call sub(arr) end programlfortran-0.63.0/integration_tests/cmake_minimal_test_01.f900000664000175000017500000000053615174404631024036 0ustar alastairalastairsubroutine test_real() implicit none real :: a(3) = -9.13 double precision :: b(9) = 3.14D0 print *, a if(any(abs(a - (-9.13) ) > 1e-9)) error stop print *, b if(any(abs(b - 3.14D0) > 1d-9)) error stop end subroutine program cmake_minimal_test_01 implicit none integer :: i(3) = 9 print *, i if(any(i /= 9)) error stop call test_real() end program lfortran-0.63.0/integration_tests/intrinsics_27.f900000664000175000017500000000024315174404631022401 0ustar alastairalastairprogram intrinsics_27 integer, dimension(-1:1, -1:2) :: a print *, shape(a) ! (/ 3, 4 /) print *, size(shape(42)) ! (/ /) end program lfortran-0.63.0/integration_tests/character_18.f900000664000175000017500000000146715174404631022161 0ustar alastairalastair! Test: CHARACTER(*) assumed-size array via nested EXTERNAL declaration ! This is the actual LAPACK pattern where an intermediate subroutine ! has an EXTERNAL declaration and calls through implicit interface. ! Currently FAILING - see issue #9381 ! ! Pattern: main -> schkhs (has EXTERNAL slatme) -> slatme (has CHARACTER(*)) program character_18 implicit none character(1) :: adumma(1) adumma(1) = ' ' call schkhs(adumma) end program character_18 subroutine schkhs(adumma) implicit none character(1) :: adumma(1) external :: slatme call slatme(adumma) end subroutine schkhs subroutine slatme(ei) implicit none character(1) :: ei(*) if (ei(1) == ' ') then print *, 'PASS' else error stop 'FAIL: expected space character' end if end subroutine slatme lfortran-0.63.0/integration_tests/present_04.f900000664000175000017500000000112115174404631021663 0ustar alastairalastairmodule present_04_mod implicit none integer, save :: called = 0 contains subroutine s(f) implicit none external :: f optional :: f if (present(f)) call f() end subroutine s end module present_04_mod program present_04 use present_04_mod, only: called, s implicit none external :: f called = 0 call s() if (called /= 0) error stop call s(f) if (called /= 1) error stop end program present_04 subroutine f() use present_04_mod, only: called implicit none called = called + 1 end subroutine f lfortran-0.63.0/integration_tests/array_section_10.f900000664000175000017500000000141215174404631023045 0ustar alastairalastairprogram array_section_10 ! Test valid array section assignments with matching shapes implicit none integer :: a(1), b(2), c(3) integer :: temp(5) integer :: i ! Valid: single element section to size-1 array i = 2 a = temp(i:i) if (size(a) /= 1) error stop ! Valid: expression section (i+1:i+1) to size-1 array i = 1 a = temp(i+1:i+1) if (size(a) /= 1) error stop ! Valid: expression section (2*i:2*i) to size-1 array i = 2 a = temp(2*i:2*i) if (size(a) /= 1) error stop ! Valid: two element section to size-2 array b = temp(1:2) if (size(b) /= 2) error stop ! Valid: three element section to size-3 array c = temp(2:4) if (size(c) /= 3) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/allocate_07.f900000664000175000017500000000105515174404631022000 0ustar alastairalastairprogram main implicit none call compare_solutions() contains subroutine compare_solutions() real, dimension(:), allocatable :: temp integer :: i temp = solution() print *, temp do i = lbound(temp, 1), ubound(temp, 1) if (abs(temp(i) * i - 1.0) > 1e-5) error stop end do end subroutine compare_solutions pure function solution() result(x) real, dimension(:), allocatable :: x x = [1.0, 0.5, 1.0/3.0, 0.25, 0.2] end function solution end program main lfortran-0.63.0/integration_tests/gpu_metal_108.f900000664000175000017500000000077615174404631022264 0ustar alastairalastairprogram gpu_metal_108 implicit none real :: a(2,3), b(3,2) integer :: i, j a(1,1) = 1.0; a(2,1) = 2.0 a(1,2) = 3.0; a(2,2) = 4.0 a(1,3) = 5.0; a(2,3) = 6.0 do concurrent (i = 1:1) b = transpose(a) end do if (abs(b(1,1) - 1.0) > 1e-6) error stop if (abs(b(2,1) - 3.0) > 1e-6) error stop if (abs(b(3,1) - 5.0) > 1e-6) error stop if (abs(b(1,2) - 2.0) > 1e-6) error stop if (abs(b(2,2) - 4.0) > 1e-6) error stop if (abs(b(3,2) - 6.0) > 1e-6) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/format_33.f900000664000175000017500000000047715174404631021512 0ustar alastairalastairprogram format_33 implicit none ! file backspace.f90 character(20):: string integer :: unit_no open(newunit=unit_no, status='scratch') write(unit_no, "(A)") 'Hello world' backspace unit_no read(unit_no, "(A)") string print "(A)", string if (string /= 'Hello world') error stop end program format_33 lfortran-0.63.0/integration_tests/legacy_array_sections_15.f900000664000175000017500000000114315174404631024562 0ustar alastairalastair! Test legacy array sections with 64-bit default integers ! Tests that ArrayBound nodes use correct integer kind when -fdefault-integer-8 is used subroutine caller(work, lwork, n) integer :: lwork, n real :: work(lwork) call callee(work(n+1), lwork-n) end subroutine subroutine callee(x, m) integer :: m real :: x(m) x(1) = 42.0 end subroutine program legacy_array_sections_15 implicit none real :: w(100) integer :: i w = 0.0 call caller(w, 100, 10) if (abs(w(11) - 42.0) > 1e-6) error stop "Test failed: w(11) should be 42.0" print *, "PASS" end program lfortran-0.63.0/integration_tests/associate_46.f900000664000175000017500000000215515174404631022174 0ustar alastairalastairmodule associate_46_mod implicit none type :: BaseType integer :: val = 0 end type BaseType type :: MyType class(BaseType), allocatable :: baseobj end type MyType type :: WrapperType class(MyType), allocatable :: myobj(:) end type WrapperType end module associate_46_mod program main use associate_46_mod implicit none type(WrapperType) :: wrap class(MyType), allocatable :: myobj(:) allocate(MyType :: myobj(2)) allocate(wrap%myobj, source = myobj) ! Associate with unallocated polymorphic member (should not crash) associate( obj1 => wrap%myobj(1)%baseobj ) end associate ! Now allocate baseobj and verify associate works with allocated member allocate(BaseType :: wrap%myobj(1)%baseobj) select type(b => wrap%myobj(1)%baseobj) type is (BaseType) b%val = 42 end select associate( obj2 => wrap%myobj(1)%baseobj ) select type(obj2) type is (BaseType) if (obj2%val /= 42) error stop print *, obj2%val class default error stop end select end associate print *, "ok" end program main lfortran-0.63.0/integration_tests/arrays_op_11.f900000664000175000017500000000122515174404631022205 0ustar alastairalastairprogram main implicit none real :: z(2) print *, solution() z = solution() print *, z call compare_solutions(z) contains subroutine compare_solutions(x) real, dimension(:), intent(in) :: x real, dimension(size(x)) :: diff diff = solution() - x if (diff(1) /= 0.0) error stop if (diff(2) /= 0.0) error stop diff = x - solution() if (diff(1) /= 0.0) error stop if (diff(2) /= 0.0) error stop end subroutine pure function solution() result(x) real, dimension(:), allocatable :: x x = [1.0, 2.0] end function solution end program main lfortran-0.63.0/integration_tests/sum_01.f900000664000175000017500000000226115174404631021012 0ustar alastairalastairprogram test_sum integer :: x(5, 10), i, j, xsum, xsum1(10), correct1(10), correct2(10) logical :: modx(5, 10) correct1 = (/20, 25, 30, 35, 40, 45, 50, 55, 60, 65/) correct2 = (/8, 15, 12, 21, 16, 27, 20, 33, 24, 39/) do i = lbound(x, 1), ubound(x, 1) do j = lbound(x, 2), ubound(x, 2) x(i, j) = i + j modx(i, j) = mod(i + j, 2) == 1 end do end do xsum = sum(x) print *, xsum if( xsum /= 425 ) error stop xsum = sum(x, mask=modx) print *, xsum if( xsum /= 215 ) error stop xsum1 = sum(x, 1) print *, xsum1 do i = lbound(xsum1, 1), ubound(xsum1, 1) if( xsum1(i) /= correct1(i) ) error stop end do xsum1 = sum(x, 1, mask=modx) print *, xsum1 do i = lbound(xsum1, 1), ubound(xsum1, 1) if( xsum1(i) /= correct2(i) ) error stop end do xsum1 = sum(x, dim=1) print *, xsum1 do i = lbound(xsum1, 1), ubound(xsum1, 1) if( xsum1(i) /= correct1(i) ) error stop end do xsum1 = sum(x, dim=1, mask=modx) print *, xsum1 do i = lbound(xsum1, 1), ubound(xsum1, 1) if( xsum1(i) /= correct2(i) ) error stop end do end program lfortran-0.63.0/integration_tests/functions_11.f900000664000175000017500000000076715174404631022230 0ustar alastairalastairprogram functions_11 implicit none real :: x=5, y real :: p=5, q real :: a, b, c y = f(x) print *, y q = f_real(p) print *, q contains double precision function f(a) result(b) real, intent(in) :: a real :: x x = 2 b = a + f_real(0.0) end function double precision function f_real(a) result(b) real, intent(in) :: a if( a == 0.0 ) then b = 2.0 else b = a + f(1.0) end if end function end program lfortran-0.63.0/integration_tests/array_op_12.f900000664000175000017500000000073515174404631022030 0ustar alastairalastairfunction f(x) result(r) real, intent(in) :: x(:) real :: r(size(x)) r = x end function program array_op_12 implicit none interface function f(x) result(r) real, intent(in) :: x(:) real :: r(size(x)) end function end interface integer :: i real :: a(2) a = f([(real(i), i=1,2)]) + 1.0 if (abs(a(1) - 2.0) > 1e-6) error stop if (abs(a(2) - 3.0) > 1e-6) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/error_stop_02.f900000664000175000017500000000026515174404631022407 0ustar alastairalastairprogram error_stop_02 implicit none integer :: x x = 5 print *, x x = x + 2 print *, x error stop x = x + 2 print *, x end program lfortran-0.63.0/integration_tests/hashmap_nested_dealloc_derived_pointer.f900000664000175000017500000000200015174404631027605 0ustar alastairalastairmodule stdlib_hashmaps_hashmap_nested_dealloc_derived_pointer implicit none type :: open_map_entry_type integer :: slots end type open_map_entry_type type :: open_map_entry_pool type(open_map_entry_type), allocatable :: more_map_entries(:) end type open_map_entry_pool type :: open_hashmap_type type(open_map_entry_pool), pointer :: cache => null() end type open_hashmap_type end module stdlib_hashmaps_hashmap_nested_dealloc_derived_pointer program hashmap_nested_dealloc_derived_pointer use stdlib_hashmaps_hashmap_nested_dealloc_derived_pointer implicit none type(open_hashmap_type) :: map type(open_map_entry_pool), pointer :: map_entry_pool_head allocate(map_entry_pool_head) allocate(map_entry_pool_head % more_map_entries(10)) do while(associated(map % cache)) deallocate( map_entry_pool_head % more_map_entries ) end do deallocate(map_entry_pool_head) end program hashmap_nested_dealloc_derived_pointerlfortran-0.63.0/integration_tests/template_travel_02.f900000664000175000017500000000545515174404631023407 0ustar alastairalastairmodule template_travel_02_math implicit none private public :: add_real, slash_real contains pure function add_real(x, y) result(total) real, intent(in) :: x, y real :: total total = x + y end function pure function slash_real(x, y) result(total) real, intent(in) :: x, y real :: total total = x / y end function end module module template_travel_02_travel use template_travel_02_math implicit none private public :: travel_tmpl requirement operations(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) type, deferred :: D type, deferred :: T type, deferred :: S pure function plus_D(l, r) result(total) type(D), intent(in) :: l, R type(D) :: total end function pure function plus_T(l, r) result(total) type(T), intent(in) :: l, R type(T) :: total end function pure function D_divided_by_T(n, d) result(quotient) type(D), intent(in) :: n type(T), intent(in) :: d type(S) :: quotient end function pure function D_divided_by_S(n, d) result(quotient) type(D), intent(in) :: n type(S), intent(in) :: d type(T) :: quotient end function end requirement template travel_tmpl(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) require :: operations(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) private public :: avg_S_from_T contains pure function avg_S_from_T(d1, t1, d2, t2) result(avg) type(D), intent(in) :: d1, d2 type(T), intent(in) :: t1, t2 type(S) :: avg avg = D_divided_by_T(plus_D(d1, d2), plus_T(t1, t2)) end function pure function avg_S_from_S(d1, s1, d2, s2) result(avg) type(D), intent(in) :: d1, d2 type(S), intent(in) :: s1, s2 type(S) :: avg avg = avg_S_from_T(d1, D_divided_by_S(d1, s1), d2, D_divided_by_S(d2, s2)) end function end template template travel_tmpl2(T, plus, div) require :: operations(T, T, T, plus, plus, div, div) instantiate travel_tmpl(T, T, T, plus, plus, div, div) end template end module module template_travel_02_m use template_travel_02_math use template_travel_02_travel implicit none contains subroutine test_template() instantiate travel_tmpl2(real, add_real, slash_real), & only: avg_real_S_from_S => avg_S_from_S real :: s s = avg_real_S_from_S(1.1, 0.5, 2.0, 0.75) print *, "s=", s end subroutine end module program template_travel_02 use template_travel_02_m implicit none call test_template() end program lfortran-0.63.0/integration_tests/gpu_metal_138.f900000664000175000017500000000047315174404631022261 0ustar alastairalastairprogram gpu_metal_138 implicit none integer :: i real, allocatable :: y(:) do concurrent (i = 1:1) y = f() end do print *, y(1) if (abs(y(1) - 1.0) > 1e-6) error stop contains pure function f() result(v) real, allocatable :: v(:) allocate(v(1)) v(1) = 1.0 end function end program lfortran-0.63.0/integration_tests/modules_34_module3.f900000664000175000017500000000063115174404631023313 0ustar alastairalastairmodule fpm_modules_34 use fpm_manifest_modules_34, only : package_config_t implicit none contains subroutine build_model(package) type(package_config_t), intent(in) :: package character(len=:), allocatable :: version integer :: i associate(ii => i) print *, ii call package%version%to_string(version) end associate end subroutine build_model end module fpm_modules_34 lfortran-0.63.0/integration_tests/intrinsics_25.f900000664000175000017500000000322015174404631022375 0ustar alastairalastairprogram intrinsics_25 implicit none integer(4), parameter:: x = ishft(123, 5) integer(4), parameter:: y = ishft(25, 0) integer(8), parameter:: z = ishft(1000000000, -2) integer(4), parameter:: i1 = ishft(-1921, -4) integer(8), parameter:: i2 = ishft(-6_8, -32_8) integer(8), parameter:: i3 = ishft( 29382382013459_8, 12_8) integer(8), parameter:: i4 = ishft(-987236238948_8, -23_8) integer(1), parameter:: i5 = ishft(3, -4) integer(1), parameter:: i6 = ishft(-4, 2) integer(1), parameter:: i7 = ishft(123, -3) integer(1), parameter:: i8 = ishft(-16, 1) integer(2), parameter:: i9 = ishft(3, -4) integer(2), parameter:: i10 = ishft(-4, 2) integer(2), parameter:: i11 = ishft(123, -3) integer(8) :: a1, a2, a3, a4 integer(4) :: b1, b2, b3, b4 a1 = -1921 a2 = -6_8 a3 = 29382382013459_8 a4 = -987236238948_8 a1 = ishft(a1, -4) a2 = ishft(a2, -32_8) a3 = ishft(a3, 12_8) a4 = ishft(a4, -23_8) b1 = -1921 b2 = -6 b3 = 29382382 b4 = -9872362 b1 = ishft(b1, -4) b2 = ishft(b2, -31) b3 = ishft(b3, 12) b4 = ishft(b4, -23) print *, b1, b2, b3, b4 print *, a1, a2, a3, a4 print *, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11 print *, x, y, z if (x /= 3936 .or. y /= 25 .or. z /= 250000000) error stop if (a1 /= 1152921504606846855_8 .or. a2 /= 4294967295_8 .or. & a3 /= 120350236727128064_8 .or. a4 /= 2199023137864_8) error stop if (b1 /= 268435335 .or. b2 /= 1 .or. & b3 /= 91152384 .or. b4 /= 510) error stop if (i1 /= 268435335_8 .or. i2 /= 4294967295_8 .or. & i3 /= 120350236727128064_8 .or. i4 /= 2199023137864_8 .or. & i5 /= 0 .or. i6 /= -16 .or. i7 /= 15 .or. i8 /= -32 .or. & i9 /= 0 .or. i10 /= -16 .or. i11 /= 15) error stop end program intrinsics_25lfortran-0.63.0/integration_tests/types_15.f900000664000175000017500000000164215174404631021361 0ustar alastairalastairprogram types_15 implicit none integer, parameter :: dp = kind(0.d0) integer(kind=4) :: n_src, n_des real(kind=4) :: z_src, z_des integer(kind=8) :: n_big_src, n_big_des real(dp) :: z_big_src, z_big_des n_src = 2 n_big_src = 2_8 z_src = 3.14 z_big_src = 3.14_dp print *, n_src, n_big_src, z_src, z_big_src n_des = n_src n_big_des = n_big_src z_des = z_src z_big_des = z_big_src print *, n_des, n_big_des, z_des, z_big_des n_des = n_big_src n_big_des = z_src z_des = z_big_src z_big_des = n_src print *, n_des, n_big_des, z_des, z_big_des n_des = z_src n_big_des = z_big_src z_des = n_src z_big_des = n_big_src print *, n_des, n_big_des, z_des, z_big_des n_des = z_big_src n_big_des = n_src z_des = n_big_src z_big_des = z_src print *, n_des, n_big_des, z_des, z_big_des end program lfortran-0.63.0/integration_tests/array_section_21.f900000664000175000017500000000071615174404631023055 0ustar alastairalastairprogram array_section_21 implicit none ! Use n = 200000 to trigger segfault without the fix integer, parameter :: n = 100 real, allocatable :: a(:,:) real :: s integer :: i allocate(a(1,n)) a = 1.0 s = 0.0 do i = 1, n call use_arr(a(:,i), s) end do if (nint(s) /= n) error stop print *, "ok" contains subroutine use_arr(x, s) real, intent(in) :: x(:) real, intent(inout) :: s s = s + x(1) end subroutine end program lfortran-0.63.0/integration_tests/class_130.f900000664000175000017500000000064315174404631021400 0ustar alastairalastairmodule class_130_mod implicit none type :: any_vector class(*), allocatable :: value(:) contains procedure :: get_value end type contains subroutine get_value(this, value) class(any_vector), intent(in) :: this class(*), allocatable, intent(out) :: value(:) value = this%value end subroutine end module program class_130 use class_130_mod implicit none print *, "PASS" end program lfortran-0.63.0/integration_tests/precision_01.f900000664000175000017500000000030415174404631022175 0ustar alastairalastairprogram precision_01 double precision :: x,x1, x2 x1 = 1.234D0 x2 = 4.567D0 x = 1.0 - x1 / x2 print *, x if (abs(x - 0.72980074447120646D0) > 1d-10) error stop end program lfortran-0.63.0/integration_tests/submodule_25c.f900000664000175000017500000000101415174404631022351 0ustar alastairalastairsubmodule(submodule_25_m) submodule_25_s implicit none contains module procedure apply allocate(out(size(vec))) out = 2.0d0 * vec end procedure module procedure make_tensor r%n_ = n allocate(r%data_(size(data))) r%data_ = data end procedure module procedure compute ! Bug: keyword argument not found when using user-defined operator result ! directly as a positional argument to a generic interface call. t = tensor_t(op_t() .x. [1.0d0, 2.0d0], n=2) end procedure end submodule lfortran-0.63.0/integration_tests/gpu_metal_44.f900000664000175000017500000000116015174404631022167 0ustar alastairalastair! Test: associate variable used inside a block within do concurrent. ! The gpu_offload pass must resolve associate aliases in both block ! body statements and block-local type expressions before kernel ! extraction, because the kernel scope cannot access the ! AssociateBlock's symbol table. program gpu_metal_44 implicit none integer :: x, l, res(3) x = 3 res = 0 associate(n => x) do concurrent (l = 1:n) block integer :: tmp tmp = n + l res(l) = tmp end block end do end associate if (res(1) /= 4) error stop if (res(2) /= 5) error stop if (res(3) /= 6) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/arrays_111.f900000664000175000017500000000104615174404631021571 0ustar alastairalastairprogram arrays_111 implicit none integer, parameter :: k = 2000 integer :: i, nsize real :: y(k) = 1.0 do i = 1000, k, 500 nsize = size(outprod(y(1:i), y(1:i))) if (nsize /= i * i) error stop print "(2(1X,I0))", i, nsize end do contains function outprod(y, z) result(x) implicit none real, intent(in) :: y(:), z(:) real :: x(size(y), size(z)) integer :: i, j do i = 1, size(y) do j = 1, size(z) x(i, j) = y(i) * z(j) end do end do end function outprod end program arrays_111 lfortran-0.63.0/integration_tests/class_05.f900000664000175000017500000000323115174404631021315 0ustar alastairalastair! Source - Page 44 of https://personalpages.manchester.ac.uk/staff/david.d.apsley/lectures/fortran/fortranB.pdf module Defs implicit none private public point, point2d, point3d type, abstract :: point contains procedure(func), deferred :: radius end type point abstract interface real function func( this ) import point class(point) this end function func end interface type, extends(point) :: point2d real x, y contains procedure :: radius => r2d end type point2d type, extends(point2d) :: point3d real z contains procedure :: radius => r3d end type point3d contains real function r2d( this ) class(point2d) this r2d = sqrt( this%x ** 2 + this%y ** 2 ) end function r2d real function r3d( this ) class(point3d) this r3d = sqrt( this%x ** 2 + this%y ** 2 + this%z ** 2 ) end function r3d end module Defs program main use Defs implicit none class(point), pointer :: ptr type(point2d), target :: p2d = point2d( 3, 4 ) type(point3d), target :: p3d = point3d( 3, 4, 5 ) real :: result print *, p2d%x, p2d%y print *, p3d%x, p3d%y, p3d%z ptr => p2d result = ptr%radius() print *, "2-d radius is ", result if( abs(result - 5.0) > 1e-8 ) error stop ptr => p3d result = ptr%radius() print *, "3-d radius is ", result if( abs(result - 7.07106781) > 1e-8 ) error stop p3d%x = 3.0 p3d%y = 4.0 p3d%z = 0.0 result = ptr%radius() print *, "3-d radius is ", result if( abs(result - 5.0) > 1e-8 ) error stop end program main lfortran-0.63.0/integration_tests/character_14.f900000664000175000017500000000047515174404631022153 0ustar alastairalastairprogram character_14 implicit none integer, parameter :: tfc = selected_char_kind('DEFAULT') character(1, tfc) :: hash = tfc_"a" print *, tfc_"a" == hash hash = 1_"a" if (len(hash) /= 1) error stop if (len(1_"a") /= 1) error stop if (hash /= 1_"a") error stop end program character_14lfortran-0.63.0/integration_tests/common_06.f900000664000175000017500000000020115174404631021473 0ustar alastairalastairsubroutine solsy() double precision rowns common /ls0001/ rowns(209) end program common_06 call solsy() end program lfortran-0.63.0/integration_tests/proc_ptr_17.f900000664000175000017500000000040315174404631022041 0ustar alastairalastairfunction isquare(n) integer, intent(in) :: n integer :: isquare isquare = n * n end function program proc_ptr_17 pointer :: ifp external :: ifp, isquare ifp => isquare if (ifp(7) /= 49) error stop print *, ifp(7) end program lfortran-0.63.0/integration_tests/class_106.f900000664000175000017500000000046715174404631021407 0ustar alastairalastairprogram test use class_106b_mod use class_106a_mod, only : MyType implicit none type(Client) :: c class(MyType), allocatable :: arr(:) call c%method(arr) if (.not. allocated(arr)) then error stop "arr not allocated" end if print *, "Test passed" end program test lfortran-0.63.0/integration_tests/modules_13.f900000664000175000017500000000037415174404631021664 0ustar alastairalastairmodule module_13 implicit none contains integer function f1() f1 = f2() end function integer function f2() f2 = 5 end function end module module_13 program main use module_13 implicit none integer :: f f = f1() print *, f end program main lfortran-0.63.0/integration_tests/submodule_28.f900000664000175000017500000000167615174404631022227 0ustar alastairalastairmodule submodule_28_mod implicit none interface module subroutine compute(x, y) integer, intent(in) :: x integer, intent(out) :: y end subroutine end interface end module submodule(submodule_28_mod) submodule_28_child implicit none contains module procedure compute y = helper(x) end procedure function helper(x) result(y) integer, intent(in) :: x integer :: y y = x * 3 end function end submodule submodule(submodule_28_mod:submodule_28_child) submodule_28_grandchild implicit none contains subroutine compute_via_helper(x, y) integer, intent(in) :: x integer, intent(out) :: y y = helper(x) end subroutine end submodule program submodule_28 use submodule_28_mod, only: compute implicit none integer :: x, y x = 5 call compute(x, y) if (y /= 15) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/gpu_metal_116.f900000664000175000017500000000051515174404631022252 0ustar alastairalastairprogram gpu_metal_116 implicit none integer :: i real :: z(4), a(4) integer :: ix(3), iy(3) z = 1.0 ix = 2 do concurrent (i = 1:4) a(i) = -z(i) end do if (any(abs(a - (-1.0)) > 1e-6)) error stop do concurrent (i = 1:3) iy(i) = -ix(i) end do if (any(iy /= -2)) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/data_02.f900000664000175000017500000000152215174404631021117 0ustar alastairalastairprogram data2 implicit none integer :: j data j / 5 / integer :: i, iarx(3,1), iary(3,1) print *, "1", j if (.true.) then print *, "2" data(iarx(i,1), iary(i,1),i=1,3)/ 1, 9, 1950,1350, 4350, 4/ print *, iarx(1, 1) if (iarx(1, 1) /= 1) error stop print *, iary(1, 1) if (iary(1, 1) /= 9) error stop print *, iarx(2, 1) if (iarx(2, 1) /= 1950) error stop print *, iary(2, 1) if (iary(2, 1) /= 1350) error stop print *, iarx(3, 1) if (iarx(3, 1) /= 4350) error stop print *, iary(3, 1) if (iary(3, 1) /= 4) error stop else data(iarx(i,1), iary(i,1),i=1,3)/ 1, 9, 1950,1350, 4350, 4/ print *, "3" end if print *, "4" data(iary(i,1),i=1,3)/ 1, 9, 1950 / print *, "5" end program lfortran-0.63.0/integration_tests/iso_c_binding_02.f900000664000175000017500000000055415174404631023000 0ustar alastairalastairprogram iso_c_binding_02 use iso_c_binding implicit none type(c_funptr) :: fptr type(c_ptr) :: ptr fptr = c_null_funptr ptr = c_null_ptr ! check if ptr is null if (c_associated(ptr)) error stop ! check if fptr is null if (c_associated(fptr)) error stop print *, "Null function pointer assigned successfully." end program iso_c_binding_02 lfortran-0.63.0/integration_tests/generic_name_02.f900000664000175000017500000000025515174404631022624 0ustar alastairalastairprogram generic_name_02 call p("abc") contains subroutine p(a) Class(*), intent(in) :: a print *, "Hello World" end subroutine end program lfortran-0.63.0/integration_tests/arrays_06.f900000664000175000017500000000061015174404631021510 0ustar alastairalastairprogram arrays_06 implicit none integer, dimension(3, 3, 3) :: A integer :: i, j, k integer, dimension(6) :: x j = 4 x = [(i*2, i = 1, 6)] print *, x x = [(i+1, i*2, i = 1, 3)] print *, x x = [(i+1, i**2, i*2, i = 1, 2)] print *, x x = [(2*i, 3*i, 4*i, i+1, i**2, i*2, i = 2, 2)] print *, x A = 3.0 + 4 print *, A ! print '("Matrix A"/(10F8.2))', ((A(i, j), i = 1, 2), j = 1, 2) end program lfortran-0.63.0/integration_tests/separate_compilation_38.f900000664000175000017500000000014615174404631024422 0ustar alastairalastairprogram separate_compilation_38 implicit none print *, "PASS" end program separate_compilation_38 lfortran-0.63.0/integration_tests/expr_11.f900000664000175000017500000000020015174404631021154 0ustar alastairalastairprogram expr_11 ! Test parantheses in expressions with type casts (#1043) real*8 x x=(2.0*x+1.0)/(x*(x+1)) end program lfortran-0.63.0/integration_tests/data_20.f900000664000175000017500000000041715174404631021121 0ustar alastairalastairprogram data_chars2 implicit none character(2) :: s(3) data s / 'h', 'el', 'lo' / if (s(1) /= 'h ') error stop "s(1) incorrect" if (s(2) /= 'el') error stop "s(2) incorrect" if (s(3) /= 'lo') error stop "s(3) incorrect" print *, "Test passed" end programlfortran-0.63.0/integration_tests/simd_01.f900000664000175000017500000000017715174404631021146 0ustar alastairalastairprogram simd_01 !LF$ attributes simd :: A, B, C real :: A(8), B(8), C(8) A = 1 B = 2 C = A + B end program lfortran-0.63.0/integration_tests/intrinsics_265.f900000664000175000017500000000607115174404631022472 0ustar alastairalastairprogram intrinsics_265 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real(sp), parameter :: a1 = cos(1.0_sp) real(dp), parameter :: a2 = cos(1.0_dp) complex(sp), parameter :: a3 = cos((1.0_sp, 1.5_sp)) complex(dp), parameter :: a4 = cos((1.0_dp, 1.5_dp)) real(sp), parameter :: ar1(3) = cos([1.0_sp, 1.5_sp, 2.0_sp]) real(dp), parameter :: ar2(3) = cos([1.0_dp, 1.5_dp, 2.0_dp]) complex(sp), parameter :: ac1(3) = cos([(1.0_sp, 1.5_sp), (2.0_sp, 2.5_sp), (3.0_sp, 3.5_sp)]) complex(dp), parameter :: ac2(3) = cos([(1.0_dp, 1.5_dp), (2.0_dp, 2.5_dp), (3.0_dp, 3.5_dp)]) real(sp) :: b1 = 0.5_sp real(dp) :: b2 = 0.7_dp complex(sp) :: b3 = (0.5_sp, 0.7_sp) complex(dp) :: b4 = (0.5_dp, 0.7_dp) real(sp) :: br1(3) = [0.5_sp, 0.7_sp, 0.9_sp] real(dp) :: br2(3) = [0.5_dp, 0.7_dp, 0.9_dp] complex(sp) :: bc1(3) = [(0.5_sp, 0.7_sp), (0.9_sp, 1.1_sp), (1.3_sp, 1.5_sp)] complex(dp) :: bc2(3) = [(0.5_dp, 0.7_dp), (0.9_dp, 1.1_dp), (1.3_dp, 1.5_dp)] print *, a1 if (abs(a1 - 0.540302277_sp) > 1e-6_sp) error stop print *, a2 if (abs(a2 - 0.54030230586813977_dp) > 1e-12_dp) error stop print *, a3 if (abs(a3 - (1.27101231_sp, -1.79172683_sp)) > 1e-6_sp) error stop print *, a4 if (abs(a4 - (1.2710123394623098_dp, -1.7917268800098574_dp)) > 1e-12_dp) error stop print *, ar1 if (any(abs(ar1 - [0.540302277_sp, 0.0707372017_sp, -0.416146845_sp]) > 1e-6_sp)) error stop print *, ar2 if (any(abs(ar2 - [0.54030230586813977_dp, 0.070737201667702906_dp, -0.41614683654714241_dp]) > 1e-12_dp)) error stop print *, ac1 if (any(abs(ac1 - [(1.27101231_sp, -1.79172683_sp), (-2.55193281_sp, -5.50143528_sp), & (-16.4069729_sp, -2.33449578_sp)]) > 1e-6_sp)) error stop print *, ac2 if (any(abs(ac2 - [(1.2710123394623098_dp, -1.7917268800098574_dp), (-2.5519328677533650_dp, -5.5014353663786872_dp), & (-16.406972071821489_dp, -2.3344956961624304_dp)]) > 1e-12_dp)) error stop print *, cos(b1) if (abs(cos(b1) - 0.877582550_sp) > 1e-6_sp) error stop print *, cos(b2) if (abs(cos(b2) - 0.76484218728448850_dp) > 1e-12_dp) error stop print *, cos(b3) if (abs(cos(b3) - (1.10151446_sp, -0.363684386_sp)) > 1e-6_sp) error stop print *, cos(b4) if (abs(cos(b4) - (1.1015144315669947_dp, -0.36368439983078843_dp)) > 1e-12_dp) error stop print *, cos(br1) if (any(abs(cos(br1) - [0.877582550_sp, 0.764842212_sp, 0.621609986_sp]) > 1e-6_sp)) error stop print *, cos(br2) if (any(abs(cos(br2) - [0.87758256189037276_dp, 0.76484218728448850_dp, 0.62160996827066439_dp]) > 1e-12_dp)) error stop print *, cos(bc1) if (any(abs(cos(bc1) - [(1.10151446_sp, -0.363684386_sp), (1.03716779_sp, -1.04624867_sp), & (0.629266918_sp, -2.05168462_sp)]) > 1e-6_sp)) error stop print *, cos(bc2) if (any(abs(cos(bc2) - [(1.1015144315669947_dp, -0.36368439983078843_dp), (1.0371677653004676_dp, & -1.0462486051241380_dp), (0.62926681652278482_dp, -2.0516846479972717_dp)]) > 1e-12_dp)) error stop end programlfortran-0.63.0/integration_tests/array_01.f900000664000175000017500000000020615174404631021321 0ustar alastairalastairprogram main implicit none real(8) :: x(3) x = [1., 2., 3.] print *, x print *, sin(x) end program lfortran-0.63.0/integration_tests/complex_35.f900000664000175000017500000000131315174404631021661 0ustar alastairalastairmodule complex_35_mod implicit none complex :: x(2) = [(1.0, 2.0), (3.0, 4.0)] complex(8) :: y(3) = [(1.0d0, 2.0d0), (3.0d0, 4.0d0), (5.0d0, 6.0d0)] end module program complex_35 use complex_35_mod implicit none if (abs(real(x(1)) - 1.0) > 1e-6) error stop if (abs(aimag(x(1)) - 2.0) > 1e-6) error stop if (abs(real(x(2)) - 3.0) > 1e-6) error stop if (abs(aimag(x(2)) - 4.0) > 1e-6) error stop if (abs(real(y(1)) - 1.0d0) > 1d-12) error stop if (abs(aimag(y(1)) - 2.0d0) > 1d-12) error stop if (abs(real(y(2)) - 3.0d0) > 1d-12) error stop if (abs(aimag(y(2)) - 4.0d0) > 1d-12) error stop if (abs(real(y(3)) - 5.0d0) > 1d-12) error stop if (abs(aimag(y(3)) - 6.0d0) > 1d-12) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/arrays_23.f900000664000175000017500000000173115174404631021514 0ustar alastairalastairmodule arrays_23 implicit none type :: toml_context !> Current internal position integer :: pos !> Current internal count integer :: num !> Current internal location on the string buffer character(len=:), pointer :: ptr end type toml_context contains subroutine add_context(message, context) !> A detailed message describing the error, requiring some more context character(len=:), allocatable, intent(inout) :: message !> Current context producing the error type(toml_context), intent(in) :: context character(len=20) :: num integer :: line_break if (context%num > 0) then write(num, '("line",1x,i0,":")') context%num message = num(1:len_trim(num)+1) // message end if message = message // & & ' | '// context%ptr(1:line_break) // & & ' |' end subroutine add_context end module arrays_23 program main use arrays_23 implicit none print *, "working" end program main lfortran-0.63.0/integration_tests/intrinsics_336.f900000664000175000017500000000024715174404631022470 0ustar alastairalastairprogram intrinsics_336 integer, parameter :: SIMPLE_FACTORS(*) = [3,5,7,11,13,17,19,23] integer :: n n = 1 if(any(mod(n,SIMPLE_FACTORS)==0)) error stop end programlfortran-0.63.0/integration_tests/elemental_22.f900000664000175000017500000000106515174404631022160 0ustar alastairalastairprogram elemental_22 implicit none integer :: body(1,2) integer :: r(4) body = 1 r = f(body) print *, r if (r(1) /= 4) error stop if (r(2) /= 4) error stop if (r(3) /= 4) error stop if (r(4) /= 4) error stop contains elemental function g(x) result(r) integer, intent(in) :: x integer :: r r = x end function pure function f(body) result(lines) integer, intent(in) :: body(:,:) integer, parameter :: n = 1 integer :: lines(size(body,1) + rank(body) + n) lines = 4 lines = g(lines) end function end program lfortran-0.63.0/integration_tests/implied_do_loops13.f900000664000175000017500000000046015174404631023372 0ustar alastairalastairprogram implied_do_loops13 implicit none character(:), allocatable :: tmp_line character(len=5) :: values(3) integer :: i tmp_line = "Hello" values = [(tmp_line, i = 1, 3)] do i = 1, 3 if (values(i) /= "Hello") error stop 1 end do end program implied_do_loops13 lfortran-0.63.0/integration_tests/operator_overloading_32.f900000664000175000017500000000165015174404631024437 0ustar alastairalastairmodule mod_a_32 implicit none type :: type_a end type interface operator(==) module procedure eq_a end interface contains elemental logical function eq_a(l, r) type(type_a), intent(in) :: l character(len=*), intent(in) :: r eq_a = .false. end function end module module mod_b_32 implicit none type :: type_b end type interface operator(==) module procedure eq_b end interface contains pure logical function eq_b(l, r) type(type_b), intent(in) :: l character(len=*), dimension(:), intent(in) :: r eq_b = .false. end function end module program main use mod_a_32, only: operator(==) use mod_b_32, only: type_b, operator(==) implicit none type(type_b) :: x character(len=1) :: arr(1) logical :: res arr(1) = "a" res = (x == arr) if (res) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/openmp_46.f900000664000175000017500000000131415174404631021513 0ustar alastairalastairprogram omp_task_mre use omp_lib implicit none integer, parameter :: n = 10 real :: array(n) integer :: i ! Initialize the array do i = 1, n array(i) = real(i) end do !$OMP PARALLEL SECTIONS SHARED(array) !$OMP SECTION do i = 1, n !$OMP TASK FIRSTPRIVATE(i) SHARED(array) array(i) = array(i) * real(i) print *, "Task: i = ", i, ", computed by thread ", omp_get_thread_num() !$OMP END TASK end do !$OMP SECTION print*, "All tasks submitted. Waiting for completion." !$OMP END PARALLEL SECTIONS ! Print the updated array print *, "Updated array:" do i = 1, n print *, "array(", i, ") = ", array(i) end do end program omp_task_mrelfortran-0.63.0/integration_tests/operator_overloading_22.f900000664000175000017500000000240515174404631024435 0ustar alastairalastair! Regression test for unary defined operator with elemental function ! Covers: ! - OPERATOR(.rw.) defined via MODULE PROCEDURE ! - ELEMENTAL function used in expression context ! - Use inside another elemental function ! - Use from main program module operator_overloading_22_mod implicit none private public :: myt, afunc, operator(.rw.) type myt sequence integer :: x integer :: y integer :: z end type myt interface operator(.rw.) module procedure rw end interface contains integer elemental function rw(t) implicit none type(myt), intent(in) :: t rw = 1 end function rw logical elemental function afunc(t) implicit none type(myt), intent(in) :: t if (.rw. t <= 5) then afunc = .true. else afunc = .false. end if end function afunc end module operator_overloading_22_mod program operator_overloading_22 use operator_overloading_22_mod implicit none type(myt) :: t logical :: z integer :: x t = myt(1, 2, 3) x = .rw. t z = afunc(t) print *, x print *, z end program operator_overloading_22 lfortran-0.63.0/integration_tests/intrinsics_390.f900000664000175000017500000000050515174404631022465 0ustar alastairalastairprogram intrinsics_390 use iso_c_binding type(c_ptr) :: cptr character(len=5,kind=c_char), pointer :: sptr character(len= 6, kind=c_char), target :: cbuf cbuf = "Hello"// c_null_char cptr = c_loc(cbuf) call c_f_pointer(cptr, sptr) print *, sptr if(sptr /= "Hello") error stop end program intrinsics_390lfortran-0.63.0/integration_tests/bindc_02c.h0000664000175000017500000000042715174404631021264 0ustar alastairalastair#ifndef BINDC_02C #define BINDC_02C void driver(); void print_ptr1(int n, float *A); void print_ptr2(int *n, float *A); void callback1(int n, float *A); void callback1b(int n, float *A); void callback2(int *n, float *A); void callback2b(int *n, float *A); #endif // BINDC_02C lfortran-0.63.0/integration_tests/array_03_transfer.f900000664000175000017500000000013015174404631023223 0ustar alastairalastairprogram array_03_transfer integer :: x = 21432 print *, transfer(x, 1.0) end programlfortran-0.63.0/integration_tests/use_04.f900000664000175000017500000000060415174404631021004 0ustar alastairalastairmodule use_04_mod implicit none private contains subroutine increment(x) integer, intent(inout) :: x x = x + 2 end subroutine end module use_04_mod program use_04 use use_04_mod implicit none integer :: x x = 5 call increment(x) if (x /= 6) error stop contains subroutine increment(x) integer, intent(out) :: x x = x + 1 end subroutine end programlfortran-0.63.0/integration_tests/modules_62_parser.f900000664000175000017500000000126415174404631023243 0ustar alastairalastairmodule modules_62_parser use modules_62_terminal, only: toml_terminal implicit none private public :: parser_config, parse ! Type with toml_terminal as component WITH DEFAULT INITIALIZATION ! This triggers the bug: the default toml_terminal() constructor contains ! references to ansi_code type which isn't explicitly imported type :: parser_config type(toml_terminal) :: color = toml_terminal() integer :: level = 0 end type parser_config contains subroutine parse(config, val) type(parser_config), intent(in) :: config integer, intent(out) :: val val = config%level + config%color%reset%style end subroutine parse end module modules_62_parser lfortran-0.63.0/integration_tests/test_rep.f900000664000175000017500000000077415174404631021542 0ustar alastairalastairmodule rep_test_mod implicit none contains subroutine f() character(len=:), allocatable :: x, y, z x = "Hello" z = "Aa1" y = _lfortran_rep(x, 3) if ( y /= "HelloHelloHello" ) error stop y = _lfortran_rep(z, 5) if ( y /= "Aa1Aa1Aa1Aa1Aa1" ) error stop ! TODO: Handle negative numbers ! y = _lfortran_rep(z, -1) end subroutine end module program main use rep_test_mod implicit none call f() end program lfortran-0.63.0/integration_tests/intrinsics_313.f900000664000175000017500000000350215174404631022460 0ustar alastairalastairprogram intrinsics_313 implicit none integer(4), parameter :: i1(1) = maxloc([1,2,3]) integer(4), parameter :: i2(1) = maxloc([1.0, 2.0, 3.0]) integer(4), parameter :: i3(1) = maxloc(["aa", "db", "ca"]) integer(4), parameter :: i4(1) = maxloc([1,2,3], 1, [.true., .true., .true.]) integer(8), parameter :: i5(1) = maxloc([1,2,3], 1, mask=[.true., .false., .true.], kind = 8) integer(4), parameter :: i6(1) = maxloc([1,2,3], mask=[.true., .false., .true.], dim=1) integer(4), parameter :: i7(1) = maxloc(["aa", "db", "ca"], 1, mask=[.true., .false., .true.]) integer(4), parameter :: i8(1) = maxloc(["aa", "db", "ca"], mask=[.true., .false., .true.], dim = 1) integer(4), parameter :: i9(1) = maxloc([1, 3, 2], 1, mask = [.true., .false., .true.], back = .true.) integer(4), parameter :: i10(1) = maxloc([3, 2, 1, 3], back = .true.) integer(4), parameter :: i11(1) = maxloc([3.0, 2.0, 1.0, 3.0], back = .true.) integer(4), parameter :: i12(1) = maxloc(["aa", "db", "ca"], 1, mask = [.false., .false., .false.], kind = 4) print *, i1 if (i1(1) /= 3) error stop print *, i2 if (i2(1) /= 3) error stop print *, i3 if (i3(1) /= 2) error stop print *, i4 if (i4(1) /= 3) error stop print *, i5 if (i5(1) /= 3) error stop print *, i6 if (i6(1) /= 3) error stop print *, i7 if (i7(1) /= 3) error stop print *, i8 if (i8(1) /= 3) error stop print *, i9 if (i9(1) /= 3) error stop print *, i10 if (i10(1) /= 4) error stop print *, i11 if (i11(1) /= 4) error stop print *, i12 if (i12(1) /= 0) error stop print *, kind(maxloc(["aa", "db", "ca"], 1, mask = [.false., .false., .false.], kind = 8)) if (kind(maxloc(["aa", "db", "ca"], 1, mask = [.false., .false., .false.], kind = 8)) /= 8) error stop end program lfortran-0.63.0/integration_tests/types_04.f900000664000175000017500000000032715174404631021356 0ustar alastairalastairprogram types_04 implicit none real :: r, x integer :: i r = 1.5 i = 2 x = i*i x = r*r x = i*r x = r*i x = i+i x = r+r x = r+i x = i+r x = i-i x = r-r x = r-i x = i-r x = i/i x = r/r x = i/r x = r/i end program lfortran-0.63.0/integration_tests/functions_06.f900000664000175000017500000000153315174404631022224 0ustar alastairalastairmodule functions_06_m implicit none contains function trim_wrapper(s) result(r) character(len=*) :: s character(len=len(s)) :: r r = trim(s) end function function int_return(s) result(r) character(len=*) :: s integer :: r(len(s)) integer :: i do i = 1, len(s) r(i) = 2 end do end function function real_return(s) result(r) character(len=*) :: s real :: r(len(s)) integer :: i do i = 1, len(s) r(i) = 2.0 end do end function end module program functions_06 use :: functions_06_m, only: trim_wrapper, int_return, real_return implicit none character(len=5) :: string = " abc" print *, trim_wrapper(string) print *, int_return(string) print *, real_return(string) end program lfortran-0.63.0/integration_tests/tuple_test_01_.f900000664000175000017500000000222115174404631022531 0ustar alastairalastairmodule tuple_test_01_mod implicit none contains subroutine f() type(_lfortran_tuple(integer, real, character(len=:), logical)) :: t1, t2 type(_lfortran_tuple(integer, integer)) :: t3 type(_lfortran_tuple(real, real)) :: t4 integer :: a, b real :: af, bf t1 = _lfortran_tuple_constant(1, 2.0, "3", .true.) t2 = _lfortran_tuple_constant(2, 3.0, "3", .false.) if (_lfortran_get_item(t2, 0) - _lfortran_get_item(t1, 0) /= 1) error stop if (abs(_lfortran_get_item(t2, 1) - _lfortran_get_item(t1, 1) - 1.0) > 1e-12) error stop if (_lfortran_get_item(t1, 2) /= _lfortran_get_item(t2, 2)) error stop if (.not. (_lfortran_get_item(t1, 3) .or. _lfortran_get_item(t2, 3))) error stop t3 = _lfortran_tuple_constant(1, 2) t4 = _lfortran_tuple_constant(1.0, 2.0) a = _lfortran_get_item(t3, 0) b = _lfortran_get_item(t3, 1) af = _lfortran_get_item(t4, 0) bf = _lfortran_get_item(t4, 1) if (af /= real(a)) error stop if (bf /= real(b)) error stop end subroutine end module program main use tuple_test_01_mod implicit none call f() end program lfortran-0.63.0/integration_tests/procedure_03.f900000664000175000017500000000156015174404631022201 0ustar alastairalastairmodule procedure_03_mod implicit none interface subroutine func(x, y, n) implicit none integer, intent(in) :: n real, intent(in) :: x(n) real, intent(out) :: y(n) end subroutine end interface contains subroutine hybrd(fcn) procedure(func) :: fcn integer, parameter :: m = 3 real, parameter :: eps = 1e-5 real :: a(m), b(m) a = [1, 2, 3] print *, lbound(a, 1), ubound(a, 1) call fcn(a, b, m) print *, a print *, b if ((b(1) - 3) > eps) error stop if ((b(2) - 6) > eps) error stop if ((b(3) - 9) > eps) error stop end subroutine end module program procedure_03 use procedure_03_mod, only: hybrd implicit none call hybrd(fn) contains subroutine fn(x, y, k) integer, intent(in) :: k real, intent(in) :: x(k) real, intent(out) :: y(k) y = x * 3 end subroutine end program lfortran-0.63.0/integration_tests/transfer_11.f900000664000175000017500000000066115174404631022035 0ustar alastairalastairprogram transfer_string_to_int8 ! Test transfer of character string to integer(1) array implicit none integer(1) :: bytes(5) character(len=5) :: str integer :: i integer(1), parameter :: expected(5) = [104_1, 101_1, 108_1, 108_1, 111_1] ! "hello" str = "hello" bytes = transfer(str, bytes) do i = 1, 5 if (bytes(i) /= expected(i)) error stop end do print *, "PASS" end program lfortran-0.63.0/integration_tests/namelist_13.f900000664000175000017500000000175715174404631022036 0ustar alastairalastairprogram test_module_namelist use config_module implicit none ! Write module namelist to file open(10, file='config.dat', status='replace', form='formatted') write(10, nml=config) close(10) ! Modify values param1 = 0 param2 = 0 tolerance = 0.0 ! Read from file open(10, file='config.dat', status='old', form='formatted') read(10, nml=config) close(10) ! Verify if (param1 /= 10) then print *, "Error: param1 =", param1, "expected 10" error stop "Module namelist test failed for param1" end if if (param2 /= 20) then print *, "Error: param2 =", param2, "expected 20" error stop "Module namelist test failed for param2" end if if (abs(tolerance - 1.0e-6) > 1.0e-10) then print *, "Error: tolerance =", tolerance, "expected 1.0e-6" error stop "Module namelist test failed for tolerance" end if print *, "Module namelist test passed!" end program test_module_namelist lfortran-0.63.0/integration_tests/class_27.f900000664000175000017500000000113015174404631021315 0ustar alastairalastairmodule class_27_mod implicit none type :: toml_value integer :: key end type toml_value type, extends(toml_value) :: toml_table logical :: implicit = .false. end type toml_table end module class_27_mod program class_27 use class_27_mod implicit none class(toml_value), allocatable, target :: val type(toml_table), pointer :: tmp allocate(toml_table :: val) select type(val) type is(toml_table) val%key = 2 tmp => val end select print *, "Key value: ", tmp%key if (tmp%key /= 2) error stop end program lfortran-0.63.0/integration_tests/implicit_interface_16b.f900000664000175000017500000000013115174404631024202 0ustar alastairalastairlogical function sisnan( sin ) real, intent(in) :: sin sisnan = (sin.ne.sin) return end lfortran-0.63.0/integration_tests/openmp_bindc_03.f900000664000175000017500000000662015174404631022650 0ustar alastairalastairmodule bindc_03_thread_data_module use, intrinsic :: iso_c_binding type, bind(C) :: thread_data integer(c_int) :: n type(c_ptr) :: a end type thread_data end module bindc_03_thread_data_module module module_openmp_bindc_03 use iso_c_binding implicit none interface subroutine GOMP_parallel (fn, data, num_threads, flags) bind (C, name="GOMP_parallel") import :: c_funptr, c_ptr, c_int type(c_funptr), value :: fn type(c_ptr), value :: data integer(c_int), value :: num_threads integer(c_int), value :: flags end subroutine subroutine GOMP_barrier() bind(C, name="GOMP_barrier") end subroutine subroutine GOMP_critical_start() bind(C, name="GOMP_critical_start") end subroutine subroutine GOMP_critical_end() bind(C, name="GOMP_critical_end") end subroutine function omp_get_max_threads() bind(c, name="omp_get_max_threads") import :: c_int integer(c_int) :: omp_get_max_threads end function omp_get_max_threads function omp_get_thread_num() bind(c, name="omp_get_thread_num") import :: c_int integer(c_int) :: omp_get_thread_num end function omp_get_thread_num subroutine omp_set_num_threads(n) bind(c, name="omp_set_num_threads") import :: c_int integer(c_int), value :: n end subroutine omp_set_num_threads subroutine GOMP_atomic_start() bind(C, name="GOMP_atomic_start") end subroutine subroutine GOMP_atomic_end() bind(C, name="GOMP_atomic_end") end subroutine end interface end module subroutine lcompilers_initialise_array(data) bind(C) use bindc_03_thread_data_module use iso_c_binding use module_openmp_bindc_03 implicit none type(c_ptr), value :: data type(thread_data), pointer :: tdata real(c_float), pointer :: a(:) integer(c_int) :: i, n, num_threads, chunk, leftovers, thread_num, start, end call c_f_pointer(data, tdata) n = tdata%n call c_f_pointer(tdata%a, a, [n]) num_threads = omp_get_max_threads() chunk = n / num_threads leftovers = mod(n, num_threads) thread_num = omp_get_thread_num() start = chunk * thread_num if (thread_num < leftovers) then start = start + thread_num else start = start + leftovers end if end = start + chunk if (thread_num < leftovers) then end = end + 1 end if do i = start + 1, end ! print *, "Thread ", thread_num, " is processing element ", i a(i) = 12.91 end do call GOMP_barrier() end subroutine subroutine initialize_array(n, a) use bindc_03_thread_data_module use module_openmp_bindc_03 implicit none interface subroutine lcompilers_initialise_array(data) bind(C) use iso_c_binding type(c_ptr), value :: data end subroutine end interface integer(c_int), intent(in) :: n real(c_float), dimension(:), intent(inout), pointer :: a type(thread_data), target :: data type(c_ptr) :: tdata data%n = n allocate(a(data%n)) data%a = c_loc(a) tdata = c_loc(data) call GOMP_parallel(c_funloc(lcompilers_initialise_array), tdata, 0, 0) end subroutine program openmp_bindc_03 use omp_lib use module_openmp_bindc_03 use bindc_03_thread_data_module implicit none interface subroutine initialize_array(n, a) use iso_c_binding integer(c_int), intent(in) :: n real(c_float), intent(inout), dimension(:), pointer :: a end subroutine end interface integer(c_int) :: n = 1000000 real(c_float), dimension(:), pointer :: a call omp_set_num_threads(4) call initialize_array(n, a) print *, "Done" print *, "a[1] = ", a(1) print * , "a[1000000] = ", a(1000000) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(1000000) - 12.91) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/read_20.f900000664000175000017500000000141615174404631021123 0ustar alastairalastairprogram read_20 ! Test iostat is set correctly on integer overflow implicit none integer :: x, u, ios open(newunit=u, file='_test_overflow.txt', status='replace') write(u, '(A)') "2719" write(u, '(A)') "2147483648" ! INT32_MAX + 1 close(u) open(newunit=u, file='_test_overflow.txt', status='old') ! First read should succeed read(u, *, iostat=ios) x if (ios /= 0) error stop "First read should succeed" if (x /= 2719) error stop "First value should be 2719" ! Second read should fail with overflow, iostat should be non-zero read(u, *, iostat=ios) x if (ios == 0) error stop "Second read should fail (overflow)" close(u, status='delete') print *, "PASS: iostat correctly set on overflow" end program read_20 lfortran-0.63.0/integration_tests/intrinsics_23.f900000664000175000017500000000045415174404631022401 0ustar alastairalastairprogram intrinsics_23 implicit none integer(kind=4), parameter :: i32 = huge(0) integer(kind=8), parameter :: i64 = huge(0_8) real(kind=4), parameter :: y = huge(0.0) real(kind=8), parameter :: z = huge(0.0d0) print *, i32, i64, y, z print *, huge(0), huge(0_8), huge(0.0), huge(0.0d0) end program lfortran-0.63.0/integration_tests/array_op_06.f900000664000175000017500000000126615174404631022033 0ustar alastairalastairprogram array_op_06 implicit none integer, parameter :: dim = 2 integer, parameter :: n = 3 integer :: x(n, n) logical :: mask(n, n) real :: res x = reshape((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/n, n/)) mask = reshape((/.true., .false., .true., .false., .true., .false., .true., .false., .true./), (/n, n/)) res = var_mask_2_iint8_dp(x, dim, mask) print *, res if (abs(res - 5.0) > 1e-8) error stop contains function var_mask_2_iint8_dp(x, dim, mask) result(res) integer, intent(in) :: x(:,:) integer, intent(in) :: dim logical, intent(in) :: mask(:,:) real :: res real :: n(merge(size(x, 1), size(x, 2), mask=1> Side 1 changed variable value to :", str call ff print *,"Side 1 : ", str if(str /="123") error stop end program lfortran-0.63.0/integration_tests/gpu_metal_127.f900000664000175000017500000000113115174404631022247 0ustar alastairalastairprogram gpu_metal_127 ! Test: pure function returning a derived-type array called inside ! do concurrent. Verifies that the Metal backend emits the function ! definition once (not duplicated) and passes array parameters correctly. implicit none type :: t real :: v end type type(t) :: a(2) real :: res(2) integer :: i do concurrent (i = 1:2) a = f() res(i) = a(i)%v end do if (abs(res(1) - 1.0) > 1e-6) error stop if (abs(res(2) - 2.0) > 1e-6) error stop print *, "PASSED" contains pure function f() result(r) type(t) :: r(2) r(1)%v = 1.0 r(2)%v = 2.0 end function end program lfortran-0.63.0/integration_tests/pointer_13.f900000664000175000017500000000054115174404631021670 0ustar alastairalastairprogram pointer_13 integer, target :: i pointer :: iptr procedure(), pointer :: ifptr i = 10 iptr => i ifptr => iprint if (iptr /= 10) error stop if (ifptr() /= 100) error stop print *, iptr print *, ifptr() contains function iprint() iprint = 100 end function iprint end program pointer_13 lfortran-0.63.0/integration_tests/global_array_pointer_01.f900000664000175000017500000000132415174404631024403 0ustar alastairalastairmodule global_array_pointer_01_mod implicit none integer, dimension(:), pointer :: ptr_in integer, target :: i(1) contains subroutine sub_arr_pointer1 ptr_in => i i = [343] print *, ptr_in(1) print *, i(1) if(ptr_in(1) /= 343) error stop end subroutine sub_arr_pointer1 subroutine sub_arr_pointer2 ptr_in(1) = 0 print *, ptr_in(1) print *, i(1) if(i(1) /= 0) error stop end subroutine sub_arr_pointer2 end module global_array_pointer_01_mod program global_array_pointer_01 use global_array_pointer_01_mod implicit none call sub_arr_pointer1 call sub_arr_pointer2 end program global_array_pointer_01 lfortran-0.63.0/integration_tests/gpu_metal_12.f900000664000175000017500000000116515174404631022167 0ustar alastairalastairprogram gpu_metal_12 ! Min and max intrinsics inside do concurrent implicit none integer, parameter :: n = 10000 real :: a(n), b(n), c_min(n), c_max(n) real :: c_min_expected(n), c_max_expected(n) integer :: i do i = 1, n a(i) = sin(real(i)) b(i) = cos(real(i)) c_min_expected(i) = min(a(i), b(i)) c_max_expected(i) = max(a(i), b(i)) end do do concurrent (i = 1:n) c_min(i) = min(a(i), b(i)) c_max(i) = max(a(i), b(i)) end do do i = 1, n if (abs(c_min(i) - c_min_expected(i)) > 1.0e-5) error stop if (abs(c_max(i) - c_max_expected(i)) > 1.0e-5) error stop end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/associate_11.f900000664000175000017500000000036615174404631022166 0ustar alastairalastairprogram associate_11 implicit none integer :: x(2) integer :: i, j x = 123 associate(a => x(:)) a(1) = 124 end associate print *, x if( x(1) /= 124 ) error stop if( x(2) /= 123 ) error stop end program lfortran-0.63.0/integration_tests/intrinsics_103.f900000664000175000017500000000044615174404631022461 0ustar alastairalastairprogram intrinsics_103 implicit none character(len=*), parameter :: magic_number = char(60 + 5) character(len=*), parameter :: magic_number2 = char(int(z"41")) print *, magic_number print *, magic_number2 if (magic_number /= "A") error stop if (magic_number2 /= "A") error stop end program lfortran-0.63.0/integration_tests/arrays_01_complex.f900000664000175000017500000000137415174404631023242 0ustar alastairalastairprogram arrays_01_complex implicit none integer :: i, j complex(4) :: a(3), b(4), c(2, 2) do i = 1, 3 a(i) = i+10 end do if (a(1) /= 11) error stop if (a(2) /= 12) error stop if (a(3) /= 13) error stop do i = 11, 14 b(i-10) = i end do if (b(1) /= 11) error stop if (b(2) /= 12) error stop if (b(3) /= 13) error stop if (b(4) /= 14) error stop do i = 1, 3 b(i) = a(i)-10 end do if (b(1) /= 1) error stop if (b(2) /= 2) error stop if (b(3) /= 3) error stop b(4) = b(1)+b(2)+b(3)+a(1) if (b(4) /= 17) error stop b(4) = a(1) if (b(4) /= 11) error stop do i = 1, 2 do j = 1, 2 c(i, j) = i + j + 10 end do end do if (c(1, 1) /= 12) error stop if (c(1, 2) /= 13) error stop if (c(2, 1) /= 13) error stop if (c(2, 2) /= 14) error stop end lfortran-0.63.0/integration_tests/allocatable_component_assign_01.f900000664000175000017500000000105715174404631026101 0ustar alastairalastairmodule hashmap_wrappers_assign implicit none type :: key_type integer, allocatable :: value(:) end type key_type end module hashmap_wrappers_assign program allocatable_component_assign_01 use hashmap_wrappers_assign implicit none type(key_type) :: key integer :: test(5) = [1, 2, 3, 4, 5] key%value = test if (size(key%value) /= 5) error stop if (key%value(1) /= 1) error stop if (key%value(5) /= 5) error stop if (.not. all(key%value == test)) error stop end program allocatable_component_assign_01 lfortran-0.63.0/integration_tests/procedure_43.f900000664000175000017500000000027715174404631022211 0ustar alastairalastairprogram procedure_43 use procedure_43_module implicit none type(MyType) :: obj ! No runtime use required — we just ensure compilation succeeds end program procedure_43lfortran-0.63.0/integration_tests/test_ieee_is_normal.f900000664000175000017500000000511715174404631023722 0ustar alastairalastair! Test ieee_is_normal function program test_ieee_is_normal use, intrinsic :: ieee_arithmetic use, intrinsic :: iso_fortran_env, only: real32, real64 implicit none real(real32) :: x_sp, inf_sp, nan_sp, denorm_sp, tmp_sp real(real64) :: x_dp logical :: result print *, "Testing ieee_is_normal..." ! Test 1: Normal positive value x_sp = 1.0_real32 result = ieee_is_normal(x_sp) print *, "ieee_is_normal(1.0) = ", result if (.not. result) error stop "1.0 should be normal" ! Test 2: Normal negative value x_sp = -5.0_real32 result = ieee_is_normal(x_sp) print *, "ieee_is_normal(-5.0) = ", result if (.not. result) error stop "-5.0 should be normal" ! Test 3: Large normal value x_sp = 1.0e30_real32 result = ieee_is_normal(x_sp) print *, "ieee_is_normal(1.0e30) = ", result if (.not. result) error stop "1.0e30 should be normal" ! Test 4: Small normal value (just above tiny) tmp_sp = 0.0_real32 x_sp = tiny(tmp_sp) result = ieee_is_normal(x_sp) print *, "ieee_is_normal(tiny) = ", result if (.not. result) error stop "tiny should be normal" ! Test 5: Zero (not normal) x_sp = 0.0_real32 result = ieee_is_normal(x_sp) print *, "ieee_is_normal(0.0) = ", result if (result) error stop "0.0 should not be normal" ! Test 6: Infinity (not normal) tmp_sp = 1.0_real32 inf_sp = ieee_value(tmp_sp, ieee_positive_inf) result = ieee_is_normal(inf_sp) print *, "ieee_is_normal(+inf) = ", result if (result) error stop "+inf should not be normal" ! Test 7: Negative infinity (not normal) inf_sp = ieee_value(tmp_sp, ieee_negative_inf) result = ieee_is_normal(inf_sp) print *, "ieee_is_normal(-inf) = ", result if (result) error stop "-inf should not be normal" ! Test 8: NaN (not normal) nan_sp = ieee_value(tmp_sp, ieee_quiet_nan) result = ieee_is_normal(nan_sp) print *, "ieee_is_normal(NaN) = ", result if (result) error stop "NaN should not be normal" ! Test 9: Denormal number (not normal) denorm_sp = ieee_value(tmp_sp, ieee_positive_denormal) result = ieee_is_normal(denorm_sp) print *, "ieee_is_normal(denormal) = ", result if (result) error stop "Denormal should not be normal" ! Test 10: Double precision normal x_dp = 2.5_real64 result = ieee_is_normal(x_dp) print *, "ieee_is_normal(2.5d0) = ", result if (.not. result) error stop "2.5d0 should be normal" print *, "All ieee_is_normal tests passed!" end program test_ieee_is_normal lfortran-0.63.0/integration_tests/intrinsics_235.f900000664000175000017500000000606015174404631022465 0ustar alastairalastairprogram intrinsics_235 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 ! real(sp) :: x real(sp) :: y, z real(dp) :: a, b, c ! x = 971.72820_sp y = 23.82920_sp z = 62.739713_sp a = 9271.72826260_dp b = 23.82926260_dp c = 62.73971326260_dp ! print *, lgamma(x) ! if (abs(lgamma(x) - 5710.34375) > 1e-5) error stop print *, lgamma(y) if (abs(lgamma(y) - 5.10680733e+01) > 1e-5) error stop print *, lgamma(23.82920) if (abs(lgamma(23.82920) - 5.10680733e+01) > 1e-5) error stop ! print *, lgamma(z) ! if (abs(lgamma(z) - 1.95790390e+02) > 1e-5) error stop print *, lgamma(62.739713) if (abs(lgamma(62.739713) - 1.95790390e+02) > 1e-5) error stop print *, lgamma(a) if (abs(lgamma(a) - 7.54193119924598432e+04_dp) > 1e-12) error stop print *, lgamma(9271.72826260_dp) if (abs(lgamma(9271.72826260_dp) - 7.54193119924598432e+04_dp) > 1e-12) error stop print *, lgamma(b) if (abs(lgamma(b) - 5.10682662991165941e+01_dp) > 1e-12) error stop print *, lgamma(23.82926260_dp) if (abs(lgamma(23.82926260_dp) - 5.10682662991165941e+01_dp) > 1e-12) error stop print *, lgamma(c) if (abs(lgamma(c) - 1.95790392620801725e+02_dp) > 1e-12) error stop print *, lgamma(62.73971326260_dp) if (abs(lgamma(62.73971326260_dp) - 1.95790392620801725e+02_dp) > 1e-12) error stop print *, algama(y) if (abs(algama(y) - 5.10680733e+01) > 1e-5) error stop print *, algama(23.82920) if (abs(algama(23.82920) - 5.10680733e+01) > 1e-5) error stop ! print *, algama(z) ! if (abs(algama(z) - 1.95790390e+02) > 1e-5) error stop print *, algama(62.739713) if (abs(algama(62.739713) - 1.95790390e+02) > 1e-5) error stop print *, algama(a) if (abs(algama(a) - 7.54193119924598432e+04_dp) > 1e-12) error stop print *, algama(9271.72826260_dp) if (abs(algama(9271.72826260_dp) - 7.54193119924598432e+04_dp) > 1e-12) error stop print *, algama(b) if (abs(algama(b) - 5.10682662991165941e+01_dp) > 1e-12) error stop print *, algama(23.82926260_dp) if (abs(algama(23.82926260_dp) - 5.10682662991165941e+01_dp) > 1e-12) error stop print *, algama(c) if (abs(algama(c) - 1.95790392620801725e+02_dp) > 1e-12) error stop print *, algama(62.73971326260_dp) if (abs(algama(62.73971326260_dp) - 1.95790392620801725e+02_dp) > 1e-12) error stop print *, dlgama(a) if (abs(dlgama(a) - 7.54193119924598432e+04_dp) > 1e-12) error stop print *, dlgama(9271.72826260_dp) if (abs(dlgama(9271.72826260_dp) - 7.54193119924598432e+04_dp) > 1e-12) error stop print *, dlgama(b) if (abs(dlgama(b) - 5.10682662991165941e+01_dp) > 1e-12) error stop print *, dlgama(23.82926260_dp) if (abs(dlgama(23.82926260_dp) - 5.10682662991165941e+01_dp) > 1e-12) error stop print *, dlgama(c) if (abs(dlgama(c) - 1.95790392620801725e+02_dp) > 1e-12) error stop print *, dlgama(62.73971326260_dp) if (abs(dlgama(62.73971326260_dp) - 1.95790392620801725e+02_dp) > 1e-12) error stop end programlfortran-0.63.0/integration_tests/format_47.f900000664000175000017500000000036615174404631021514 0ustar alastairalastairprogram format_47 implicit none integer :: i1, i2 character(8) :: cdata cdata = '1 1 ' read (cdata, 100) i1, i2 if (i1 /= 1) error stop if (i2 /= 1000) error stop 100 format (bn, i4, bz, i4) end program format_47lfortran-0.63.0/integration_tests/derived_types_92.f900000664000175000017500000000173615174404631023074 0ustar alastairalastairprogram derived_types_92 implicit none type :: package_t integer :: num character(:),allocatable :: str end type package_t class(package_t), allocatable :: instance(:) allocate(instance(1)) instance(1)%num = 1 instance(1)%str = "Hi" print *, instance(1)%num if(instance(1)%num /= 1) error stop print *, instance(1)%str if(instance(1)%str /= "Hi") error stop call foo(instance) call foo2(instance) contains subroutine foo(arg) class(package_t), allocatable :: arg(:) print *, arg(1)%num if(arg(1)%num /= 1) error stop print *, arg(1)%str if(arg(1)%str /= "Hi") error stop arg(1)%num = 10 arg(1)%str = "bye" end subroutine subroutine foo2(arg) class(package_t):: arg(:) print *, arg(1)%num if(arg(1)%num /= 10) error stop print *, arg(1)%str if(arg(1)%str /= "bye") error stop end subroutine end program lfortran-0.63.0/integration_tests/string_86.f900000664000175000017500000000122515174404631021530 0ustar alastairalastairmodule string_86_mod implicit none contains integer pure function blabla(inp) result(r) integer, intent(in) :: inp r = inp * 2 end function blabla end module string_86_mod program string_86 use string_86_mod implicit none integer :: n(5) character(:), allocatable :: x integer :: str_len n(3) = 5 str_len = n(3) allocate(character(str_len) :: x) x = tolower(str_len) print *, x if (x /= "Hello") error stop if (len(x) /= 5) error stop contains function tolower(len_needed) result(res) integer, intent(in) :: len_needed character(len_needed) :: res res = "Hello" end function tolower end program string_86lfortran-0.63.0/integration_tests/read_35.f900000664000175000017500000000112215174404631021123 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/6811 ! Reading from character variable into integer array ! Exact MRE from issue body program read_35 implicit none character(23) :: cinput = '42 666 -42 -666 10 9 0 ' integer :: input(7) read(cinput, *) input print "(A,7(1X,I0))", 'input was ', input if (input(1) /= 42) error stop if (input(2) /= 666) error stop if (input(3) /= -42) error stop if (input(4) /= -666) error stop if (input(5) /= 10) error stop if (input(6) /= 9) error stop if (input(7) /= 0) error stop end program read_35 lfortran-0.63.0/integration_tests/string_13.f900000664000175000017500000000046615174404631021524 0ustar alastairalastairprogram string_13 implicit none integer, parameter :: ia0 = iachar('0') integer, parameter :: ia5 = iachar('5') integer, parameter :: ia9 = iachar('9') if (ia0 /= 48) error stop if (ia5 /= 53) error stop if (ia9 /= 57) error stop print *, ia0, ia5, ia9 end programlfortran-0.63.0/integration_tests/arrays_op_13.f900000664000175000017500000000177315174404631022217 0ustar alastairalastairmodule arrays_op_13 use, intrinsic :: iso_c_binding, only : c_char, c_null_char use iso_fortran_env, only: int64 private public :: fpm_model_t, package_t, srcfile_t !> Source type unknown integer, parameter :: FPM_UNIT_UNKNOWN = -1 type srcfile_t !> Type of source unit integer :: unit_type = FPM_UNIT_UNKNOWN end type srcfile_t type package_t !> Array of sources type(srcfile_t), allocatable :: sources(:) end type package_t type :: fpm_model_t !> Array of packages (including the root package) type(package_t), allocatable :: packages(:) end type fpm_model_t contains subroutine build_target_list(model) type(fpm_model_t), intent(inout), target :: model associate(sources=>model%packages(0)%sources) end associate end subroutine build_target_list end module arrays_op_13 program arrays_op_13_main implicit none print *, "working ok" end program arrays_op_13_main lfortran-0.63.0/integration_tests/intrinsics_134.f900000664000175000017500000000117615174404631022466 0ustar alastairalastairprogram intrinsics_134 character(4), parameter :: y = adjustl("okay") character(len=5) :: x character(len=20) :: str = ' gfortran' str = adjustl(str) print *, str if (str /= 'gfortran') error stop str = adjustl(' gfortran') print *, str if (str /= 'gfortran') error stop print *, "|"//adjustl(" abc")//"|" if ("|"//adjustl(" abc")//"|" /= '|abc |') error stop x = " " print *, adjustl(x) print *, adjustl(" ") if (adjustl(" ") /= " ") error stop if (adjustl(x) /= " ") error stop if (y /= "okay") error stop end program lfortran-0.63.0/integration_tests/allocate_array_descriptor_01.f900000664000175000017500000000131615174404631025426 0ustar alastairalastairprogram allocate_array_descriptor_01 implicit none integer, allocatable :: arr(:) integer :: i real, allocatable :: matrix(:, :) integer :: j allocate(arr(10)) do i = 1, 10 arr(i) = i end do do i = 1, 10 if (arr(i) /= i) error stop "Array value mismatch" end do deallocate(arr) allocate(matrix(5, 5)) do i = 1, 5 do j = 1, 5 matrix(i, j) = i * 10 + j end do end do do i = 1, 5 do j = 1, 5 if (abs(matrix(i, j) - (i * 10 + j)) > 1e-10) error stop "Matrix value mismatch" end do end do deallocate(matrix) print *, "All tests passed!" end program allocate_array_descriptor_01 lfortran-0.63.0/integration_tests/derived_types_32.f900000664000175000017500000000121315174404631023054 0ustar alastairalastairmodule testdrive_derived_types_32 implicit none private public :: real_dp_to_string contains pure function real_dp_to_string(val) result(string) real(8), intent(in) :: val character(len=:), allocatable :: string integer, parameter :: buffer_len = 128 character(len=buffer_len) :: buffer write(buffer, '(g0)') val string = trim(buffer) end function real_dp_to_string end module testdrive_derived_types_32 program main use testdrive_derived_types_32 implicit none real(8) :: value value = 10.0 print *, real_dp_to_string(value) if( real_dp_to_string(value) /= "10.000000000000000" ) error stop end program lfortran-0.63.0/integration_tests/intrinsics_398.f900000664000175000017500000000064215174404631022477 0ustar alastairalastairprogram main use, intrinsic :: iso_fortran_env, only: int64 implicit none integer(int64) :: m, arr(10) integer :: i do i = 1, 10 arr(i) = i**5 end do m = findloc(arr(1:5), value=arr(3), dim=1) if (m /= 3) error stop m = findloc(arr(2) + arr(3) + arr(4) + arr(1:5), value=arr(6), dim=1) if (m /= 0) error stop m = findloc(arr(1) + arr(2:6), value=arr(1) + arr(3), dim=1) if (m /= 2) error stop end program main lfortran-0.63.0/integration_tests/read_73.f900000664000175000017500000000147315174404631021136 0ustar alastairalastairprogram read_73 implicit none character :: s160 character(2) :: s230 common s160(60), s230(30) character(*), parameter :: s1 = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ =+-*/(),.*0*1.2,3)4(5/6' character(*), parameter :: s2 = '6/5(4)3,2.1*0*.,)(/*-+= ZYXWVUTSRQPONMLKJIHGFEDCBA9876543210' logical :: pf 100 format (60A1) 101 format (30a2) open (42, file='fort.42', status='replace', form='formatted') write (42, '(a)') s1 write (42, '(a)') s2 rewind (42) s160 = '?' read (42,100) s160 pf = all (s160 == transfer (s1, mold=s160)) if (.not. pf) then print *, 's160 test failed' error stop end if s230 = '??' read (42,101) s230 pf = all (s230 == transfer (s2, mold=s230)) if (.not. pf) then print *, 's230 test failed' error stop end if close (42) end program read_73lfortran-0.63.0/integration_tests/array_section_14.f900000664000175000017500000000053415174404631023055 0ustar alastairalastairprogram array_section_14 implicit none integer, parameter :: k = selected_int_kind(9) integer :: iarray(3,4) iarray(1,1:2) = [bit_size(1_k), huge(1_k)] if (iarray(1,1) /= bit_size(1_k)) error stop if (iarray(1,2) /= huge(1_k)) error stop if (kind(1_k) /= k) error stop print *, kind(1_k), iarray(1,1:2) end program array_section_14 lfortran-0.63.0/integration_tests/read_23.f900000664000175000017500000000157615174404631021135 0ustar alastairalastairprogram read_23 ! Test READ with implied-do loop into assumed-size array dummy argument ! Reproduces LAPACK sdrgvx.f pattern: READ(NIN,*) (STRU(I), I=1,N) implicit none real :: work(100) integer :: i open(10, file='_read_23_test.dat', status='replace') write(10, *) 1.5, 2.5, 3.5, 4.5 close(10) call read_into_assumed(work, 4) close(10, status='delete') if (abs(work(1) - 1.5) > 1e-5) error stop if (abs(work(2) - 2.5) > 1e-5) error stop if (abs(work(3) - 3.5) > 1e-5) error stop if (abs(work(4) - 4.5) > 1e-5) error stop print *, "PASSED" contains subroutine read_into_assumed(arr, n) integer, intent(in) :: n real, intent(out) :: arr(*) integer :: i open(10, file='_read_23_test.dat', status='old') read(10, *) (arr(i), i = 1, n) close(10) end subroutine end program lfortran-0.63.0/integration_tests/gpu_metal_167.f900000664000175000017500000000243015174404631022256 0ustar alastairalastairmodule gpu_metal_167_activation_m implicit none type :: activation_t integer :: k = 1 contains procedure :: f end type contains elemental function f(self, x) result(r) class(activation_t), intent(in) :: self real, intent(in) :: x real :: r r = x * self%k end function end module module gpu_metal_167_m use gpu_metal_167_activation_m implicit none type :: t integer :: n = 3 type(activation_t) :: act end type contains pure function get_vals(a, i) result(v) real, intent(in) :: a(:,:) integer, intent(in) :: i real, allocatable :: v(:) allocate(v(size(a, 1))) v = a(:, i) end function subroutine run(self, a, nb, d) type(t), intent(in) :: self real, intent(in) :: a(:,:) integer, intent(in) :: nb real, intent(out) :: d(:) integer :: i real :: z(3) z = 1.0 d = 0.0 do concurrent (i = 1:nb) associate(y => get_vals(a, i)) d(i) = y(1) * self%act%f(z(1)) end associate end do end subroutine end module program gpu_metal_167 use gpu_metal_167_m implicit none type(t) :: obj real :: a(3, 2), d(2) a = 0.5 call run(obj, a, 2, d) print *, d(1) print *, d(2) if (abs(d(1) - 0.5) > 1e-6) error stop if (abs(d(2) - 0.5) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/file_46.f900000664000175000017500000000131515174404631021135 0ustar alastairalastairprogram file_46 implicit none character(len=40), parameter :: help_text(2) = [character(len=40) :: & 'NAME', 'DESCRIPTION'] integer :: i, lun character(len=200) :: line integer :: expected_len integer :: filesize open(newunit=lun, file='out.txt', status='replace', action='write') write(lun,'(g0)') (trim(help_text(i)), i=1, size(help_text)) expected_len = len('NAME'//new_line('a')//'DESCRIPTION'//new_line('a')) inquire(file='out.txt', size=filesize) if (filesize /= expected_len) then error stop 'EXTRA BYTES WRITTEN (LIKELY SPACES)' end if print *, 'PASSED: no trailing spaces written' close(lun, status='delete') end program file_46 lfortran-0.63.0/integration_tests/character_05.f900000664000175000017500000000026315174404631022146 0ustar alastairalastairprogram character_05 character(1) :: b b = "X" call f(b) contains subroutine f(s) bind(c) character(1) :: s if (s /= "X") error stop end subroutine end program lfortran-0.63.0/integration_tests/template_03b.f900000664000175000017500000000352215174404631022166 0ustar alastairalastairprogram template_03 requirement op(T, U, V, op) type, deferred :: T type, deferred :: U type, deferred :: V elemental function op(a, b) result(op) type(T), intent(in) :: a type(U), intent(in) :: b type(V) :: op end function end requirement template axpy_tmpl(T, U, V, W, plus, times) public :: axpy require :: op(V, W, V, plus) require :: op(T, U, W, times) contains subroutine axpy(a, x, y) type(T), intent(in) :: a type(U), intent(in) :: x(:) type(V), intent(inout) :: y(:) y = plus(y, times(a, x)) end subroutine end template call f() contains elemental function my_mul(a, b) result(op) integer, parameter :: sp = kind(1.0) real(sp), intent(in) :: a integer, intent(in) :: b real(sp) :: op op = a * b end function elemental function my_add(a, b) result(op) integer, parameter :: sp = kind(1.0), dp = kind(1.d0) real(dp), intent(in) :: a real(sp), intent(in) :: b real(dp) :: op op = a + b end function subroutine my_axpy(a, x, y) integer, parameter :: sp = kind(1.0), dp = kind(1.d0) real(sp), intent(in) :: a integer, intent(in) :: x(:) real(dp), intent(inout) :: y(:) y = my_add(y, my_mul(a, x)) end subroutine subroutine f() integer, parameter :: sp = kind(1.0), dp = kind(1.d0) instantiate axpy_tmpl(real(sp), integer, real(dp), real(sp), operator(+), operator(*)) real(sp) :: a integer :: x(3) real(dp) :: y(3) a = 0.5 x = 2 y = 2 call axpy(a, x, y) ! call my_axpy(a, x, y) ! non-generic does not work too end subroutine end programlfortran-0.63.0/integration_tests/array_section_16.f900000664000175000017500000000116015174404631023053 0ustar alastairalastairmodule array_section_16_mod contains subroutine test_pointer(w_ptr, w) real, pointer, intent(out) :: w_ptr(:) real, intent(in), target :: w(:) w_ptr(1:size(w)) => w end subroutine test_pointer end module array_section_16_mod program array_section_16 use array_section_16_mod implicit none real, pointer :: wptr(:) real, allocatable :: w(:) real, target :: arg(6) arg = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] call test_pointer(wptr, arg) allocate(w(size(wptr))) w(1:size(wptr)) = wptr if (size(w) /= 6 .or. size(wptr) /= 6) error stop if (any(w /= arg)) error stop end program array_section_16lfortran-0.63.0/integration_tests/complex_16.f900000664000175000017500000000035615174404631021666 0ustar alastairalastairprogram complex_16 implicit none complex :: x real :: y x % re = 1.2 print *, x x % im = -3.4 print *, x if (abs(x - (1.2, -3.4)) > 1e-6) error stop y = sign(12.38, x % im) print *, y if (abs(y - (-12.38)) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/read_77.f900000664000175000017500000000103415174404631021133 0ustar alastairalastairprogram read_77 implicit none integer :: i, i1, i2, idata(4) open (42, file='fort.42', status='replace', form='formatted') write (42, '(a)') '1234567890' write (42, '(a)') ' 12345' rewind (42) read (42, 100) i1, i2 100 format (tr4, i2, tl2, i3) if (i1 /= 56) then error stop end if if (i2 /= 567) then error stop end if idata = -42 read (42, 101) (idata(i), i=1,4) 101 format (i6.6, t1, i6.4, tl6, i6.3, tl9, i6.0) if (.not. all(idata == 12345)) then error stop end if end program read_77lfortran-0.63.0/integration_tests/common_10.f900000664000175000017500000000011615174404631021473 0ustar alastairalastairprogram common_10 real :: x common /timing/ x x = 0.0D0 end program lfortran-0.63.0/integration_tests/bits_07.f900000664000175000017500000000350415174404631021156 0ustar alastairalastairprogram bits_07 ! Test bgt/blt/bge/ble with int64 values > 2^32 (overflow-safe unsigned comparison) implicit none integer(8) :: a, b, c, d a = 8589934591_8 ! 2^33 - 1 b = 4294967296_8 ! 2^32 c = -1_8 ! all bits set (largest unsigned) d = 0_8 ! bgt tests print *, bgt(a, b) if (.not. bgt(a, b)) error stop "bgt(2^33-1, 2^32) should be true" print *, bgt(b, a) if (bgt(b, a)) error stop "bgt(2^32, 2^33-1) should be false" print *, bgt(c, a) if (.not. bgt(c, a)) error stop "bgt(-1, 2^33-1) should be true" print *, bgt(a, c) if (bgt(a, c)) error stop "bgt(2^33-1, -1) should be false" print *, bgt(a, a) if (bgt(a, a)) error stop "bgt(x, x) should be false" print *, bgt(c, d) if (.not. bgt(c, d)) error stop "bgt(-1, 0) should be true" print *, bgt(d, c) if (bgt(d, c)) error stop "bgt(0, -1) should be false" ! blt tests print *, blt(b, a) if (.not. blt(b, a)) error stop "blt(2^32, 2^33-1) should be true" print *, blt(a, b) if (blt(a, b)) error stop "blt(2^33-1, 2^32) should be false" print *, blt(a, c) if (.not. blt(a, c)) error stop "blt(2^33-1, -1) should be true" print *, blt(a, a) if (blt(a, a)) error stop "blt(x, x) should be false" ! bge tests print *, bge(a, b) if (.not. bge(a, b)) error stop "bge(2^33-1, 2^32) should be true" print *, bge(a, a) if (.not. bge(a, a)) error stop "bge(x, x) should be true" print *, bge(b, a) if (bge(b, a)) error stop "bge(2^32, 2^33-1) should be false" print *, bge(c, a) if (.not. bge(c, a)) error stop "bge(-1, 2^33-1) should be true" ! ble tests print *, ble(b, a) if (.not. ble(b, a)) error stop "ble(2^32, 2^33-1) should be true" print *, ble(a, a) if (.not. ble(a, a)) error stop "ble(x, x) should be true" print *, ble(a, b) if (ble(a, b)) error stop "ble(2^33-1, 2^32) should be false" print *, ble(a, c) if (.not. ble(a, c)) error stop "ble(2^33-1, -1) should be true" end program lfortran-0.63.0/integration_tests/intrinsics_342.f900000664000175000017500000000063215174404631022463 0ustar alastairalastairprogram intrinsics_342 integer, allocatable :: i(:) integer :: ii(4,4) allocate(i(4)) i = [1, 2, 3 ,4] ! ii = spread(i, dim = 2, ncopies=4) ! Code generation error while trying to pass `i` to `lcompilers_spread` print *, spread(i, dim = 2, ncopies=4) if (any(spread(i,dim = 2, ncopies=4) /= reshape([1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4], [4, 4]))) error stop end programlfortran-0.63.0/integration_tests/transfer_06.f900000664000175000017500000000045015174404631022035 0ustar alastairalastairprogram transfer_06 integer :: i character(1) :: res i = 321 res = transfer(i, res) print *, res if(res /= 'A') error stop ! -------------------------------------------- ! i = 65 res = transfer(i, res) print *, res if(res /= 'A') error stop end programlfortran-0.63.0/integration_tests/modules_08_b.f900000664000175000017500000000020115174404631022156 0ustar alastairalastairmodule modules_08_b implicit none private public b contains integer function b() b = 5 + kind(.true.) end function end module lfortran-0.63.0/integration_tests/data_implied_do_02.f900000664000175000017500000000060015174404631023300 0ustar alastairalastairprogram data_implied_do_02 integer i double precision coef(5,4) data (coef(i,1),i=1,5)/1.0D0,1.0D0,3*0.0D0/ if (abs(coef(1,1) - 1.0D0) > 1e-12) error stop if (abs(coef(2,1) - 1.0D0) > 1e-12) error stop if (abs(coef(3,1) - 0.0D0) > 1e-12) error stop if (abs(coef(4,1) - 0.0D0) > 1e-12) error stop if (abs(coef(5,1) - 0.0D0) > 1e-12) error stop end program lfortran-0.63.0/integration_tests/allocate_16.f900000664000175000017500000000060215174404631021775 0ustar alastairalastairprogram allocate_16 implicit none integer :: i, s s = 0 call prg(10, 10, 10, s) print *, s if( s /= 200000000 ) error stop contains subroutine prg(d1, d2, d3, s) integer, intent(in) :: d1, d2, d3 integer, intent(out) :: s integer, allocatable :: d(:, :, :) s = 0 do i = 1, 200000 allocate(d(d1, d2, d3)) s = s + size(d) deallocate(d) end do end subroutine end program lfortran-0.63.0/integration_tests/callback_05.f900000664000175000017500000000131315174404631021743 0ustar alastairalastairmodule callback_05 implicit none contains subroutine px_call3(f, x) integer, intent(in) :: x interface subroutine f(x) integer, intent(in) :: x end subroutine end interface call f(x) end subroutine subroutine px_call2(f, x) integer, intent(in) :: x interface subroutine f(x) integer, intent(in) :: x end subroutine end interface call px_call3(f, x) end subroutine subroutine px_call1(x) integer, intent(in) :: x call px_call2(printx, x) contains subroutine printx(x) integer, intent(in) :: x print *, x end subroutine end subroutine end module callback_05 program main use callback_05 implicit none integer :: x = 5 call px_call1(x) end program main lfortran-0.63.0/integration_tests/submodule_30a.f900000664000175000017500000000027715174404631022355 0ustar alastairalastairprogram submodule_30 use submodule_30_mod, only: compute implicit none integer :: x, y x = 5 call compute(x, y) if (y /= 35) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/logical_kind_04.f900000664000175000017500000001023315174404631022626 0ustar alastairalastairprogram logical_kind_04 implicit none integer, parameter :: lp1 = 1, lp2 = 2, lp4 = 4, lp8 = 8 ! --- Numeric kind suffixes --- logical(1) :: n1t, n1f logical(2) :: n2t, n2f logical(4) :: n4t, n4f logical(8) :: n8t, n8f ! --- Named-parameter kind suffixes --- logical(lp1) :: p1t, p1f logical(lp2) :: p2t, p2f logical(lp4) :: p4t, p4f logical(lp8) :: p8t, p8f ! --- Capitalization variants (kind 4) --- logical(4) :: cap1, cap2, cap3, cap4, cap5, cap6 ! ===== Section 1: numeric kind literals ===== n1t = .true._1 n1f = .false._1 n2t = .true._2 n2f = .false._2 n4t = .true._4 n4f = .false._4 n8t = .true._8 n8f = .false._8 ! Check truth values if (n1t .neqv. .true.) error stop if (n1f .neqv. .false.) error stop if (n2t .neqv. .true.) error stop if (n2f .neqv. .false.) error stop if (n4t .neqv. .true.) error stop if (n4f .neqv. .false.) error stop if (n8t .neqv. .true.) error stop if (n8f .neqv. .false.) error stop ! Check kinds via storage_size (returns size in bits) if (storage_size(n1t) /= 8) error stop if (storage_size(n1f) /= 8) error stop if (storage_size(n2t) /= 16) error stop if (storage_size(n2f) /= 16) error stop if (storage_size(n4t) /= 32) error stop if (storage_size(n4f) /= 32) error stop if (storage_size(n8t) /= 64) error stop if (storage_size(n8f) /= 64) error stop ! Check kind() of the literal itself if (kind(.true._1) /= 1) error stop if (kind(.false._1) /= 1) error stop if (kind(.true._2) /= 2) error stop if (kind(.false._2) /= 2) error stop if (kind(.true._4) /= 4) error stop if (kind(.false._4) /= 4) error stop if (kind(.true._8) /= 8) error stop if (kind(.false._8) /= 8) error stop ! ===== Section 2: named-parameter kind literals ===== p1t = .true._lp1 p1f = .false._lp1 p2t = .true._lp2 p2f = .false._lp2 p4t = .true._lp4 p4f = .false._lp4 p8t = .true._lp8 p8f = .false._lp8 ! Check truth values if (p1t .neqv. .true.) error stop if (p1f .neqv. .false.) error stop if (p2t .neqv. .true.) error stop if (p2f .neqv. .false.) error stop if (p4t .neqv. .true.) error stop if (p4f .neqv. .false.) error stop if (p8t .neqv. .true.) error stop if (p8f .neqv. .false.) error stop ! Check kinds via storage_size if (storage_size(p1t) /= 8) error stop if (storage_size(p1f) /= 8) error stop if (storage_size(p2t) /= 16) error stop if (storage_size(p2f) /= 16) error stop if (storage_size(p4t) /= 32) error stop if (storage_size(p4f) /= 32) error stop if (storage_size(p8t) /= 64) error stop if (storage_size(p8f) /= 64) error stop ! Check kind() of named-parameter literals if (kind(.true._lp1) /= 1) error stop if (kind(.false._lp1) /= 1) error stop if (kind(.true._lp2) /= 2) error stop if (kind(.false._lp2) /= 2) error stop if (kind(.true._lp4) /= 4) error stop if (kind(.false._lp4) /= 4) error stop if (kind(.true._lp8) /= 8) error stop if (kind(.false._lp8) /= 8) error stop ! ===== Section 3: capitalization variants ===== cap1 = .true._4 cap2 = .TRUE._4 cap3 = .True._4 cap4 = .false._4 cap5 = .FALSE._4 cap6 = .False._4 if (cap1 .neqv. .true.) error stop if (cap2 .neqv. .true.) error stop if (cap3 .neqv. .true.) error stop if (cap4 .neqv. .false.) error stop if (cap5 .neqv. .false.) error stop if (cap6 .neqv. .false.) error stop ! Also with named parameter kinds and mixed case if (.TRUE._lp1 .neqv. .true.) error stop if (.True._lp2 .neqv. .true.) error stop if (.FALSE._lp1 .neqv. .false.) error stop if (.False._lp2 .neqv. .false.) error stop if (kind(.TRUE._lp8) /= 8) error stop if (kind(.False._lp1) /= 1) error stop ! ===== Section 4: cross-kind assignment ===== n8t = .true._1 if (n8t .neqv. .true.) error stop if (storage_size(n8t) /= 64) error stop n1f = .false._8 if (n1f .neqv. .false.) error stop if (storage_size(n1f) /= 8) error stop print *, "All logical_kind_04 tests passed." end program lfortran-0.63.0/integration_tests/class_30.f900000664000175000017500000000117115174404631021314 0ustar alastairalastair module class_30_mod type :: abstract_lexer end type type :: stack_item integer :: scope end type stack_item type, extends(abstract_lexer) :: toml_lexer integer :: top = 1 type(stack_item), allocatable :: stack(:) end type toml_lexer end module program class_30 use class_30_mod type(toml_lexer) :: lexer allocate(lexer%stack(10)) lexer%stack(lexer%top)%scope = 1 call check_scope(lexer) contains subroutine check_scope(lex) class(toml_lexer), intent(in) :: lex if (lex%stack(lex%top)%scope /= 1) error stop end subroutine check_scope end programlfortran-0.63.0/integration_tests/write_24.f900000664000175000017500000000152215174404631021344 0ustar alastairalastairprogram write_24 ! Internal WRITE to an allocatable character variable must not ! reallocate. The variable should keep its original allocated length. implicit none character(:), allocatable :: s integer :: n ! Case 1: allocate to length 10, write a short value allocate(character(len=10) :: s) write(s, "(i0)") 5 if (len(s) /= 10) error stop if (s(1:1) /= "5") error stop ! Case 2: write a longer formatted value s = repeat(" ", 10) write(s, "(a)") "hello" if (len(s) /= 10) error stop if (s(1:5) /= "hello") error stop ! Case 3: write with fixed-width format s = repeat(" ", 10) write(s, "(i5)") 42 if (len(s) /= 10) error stop ! Case 4: reallocate to a different length, then write deallocate(s) allocate(character(len=20) :: s) write(s, "(i0)") 12345 if (len(s) /= 20) error stop if (s(1:5) /= "12345") error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/array_03_pack.f900000664000175000017500000000065315174404631022327 0ustar alastairalastairprogram array_03_pack implicit none character(len=1), dimension(:,:), allocatable :: array integer :: packoutput(10) allocate(array(3, 5)) array(1, :) = "a" array(2, :) = "." array(3, :) = "c" print *, ichar(pack(array, mask=(array /= '.'))) packoutput = ichar(pack(array, mask=(array /= '.'))) if( any(packoutput /= [97, 99, 97, 99, 97, 99, 97, 99, 97, 99]) ) error stop end program lfortran-0.63.0/integration_tests/struct_type_08.f900000664000175000017500000000162415174404631022604 0ustar alastairalastairmodule struct_type_08_mod implicit none type :: Arrival integer :: NTopBnc, NBotBnc real :: A, Phase complex :: delay end type type(Arrival), allocatable :: Arr(:, :, :) integer, allocatable :: NArr(:, :) integer :: MaxNArr contains subroutine AddArr(id, ir, Amp) integer, intent(in) :: id, ir real, intent(in) :: Amp integer :: iArr(1), Nt Nt = NArr(id, ir) if (Nt >= MaxNArr) then iArr = MINLOC( Arr(id, ir, :)%A ) if (Amp > Arr(id, ir, iArr(1))%A) then Arr(id, ir, iArr(1))%A = Amp end if end if end subroutine end module program struct_type_08 use struct_type_08_mod implicit none MaxNArr = 5 allocate( Arr(2, 2, MaxNArr), NArr(2, 2) ) NArr = 0 Arr%A = 1.0 NArr(1,1) = 5 call AddArr(1, 1, 2.0) if (abs(Arr(1, 1, 1)%A - 2.0) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/submodule_37b.f900000664000175000017500000000205015174404631022354 0ustar alastairalastairmodule submodule_37_mod implicit none private public :: mytype type mytype private character(len=:), allocatable :: val_ contains procedure :: get_val generic :: get => get_int_array, get_real_array procedure, private :: get_int_array procedure, private :: get_real_array end type interface mytype elemental module function create(s) result(t) character(len=*), intent(in) :: s type(mytype) t end function end interface interface pure module function get_val(self) result(v) class(mytype), intent(in) :: self character(len=:), allocatable :: v end function pure module function get_int_array(self, mold) result(v) class(mytype), intent(in) :: self integer, intent(in) :: mold(:) integer, allocatable :: v(:) end function pure module function get_real_array(self, mold) result(v) class(mytype), intent(in) :: self real, intent(in) :: mold(:) real, allocatable :: v(:) end function end interface end module submodule_37_mod lfortran-0.63.0/integration_tests/select_rank_01.f900000664000175000017500000000134615174404631022503 0ustar alastairalastair program select_rank_test implicit none integer :: b(2) = [1,2] integer :: c(2,2) = reshape([1,2,3,4],[2,2]) integer :: d(2,2,2) = reshape([1,2,3,4,5,6,7,8],[2,2,2]) call check(b, 1) call check(c, 2) call check(d, 3) contains subroutine check(x, expected) integer, dimension(..), intent(in) :: x integer, intent(in) :: expected select rank(x) rank(0) if (expected /= 0) error stop rank(1) if (expected /= 1) error stop rank(2) if (expected /= 2) error stop rank(3) if (expected /= 3) error stop end select end subroutine check end program select_rank_test lfortran-0.63.0/integration_tests/reserved_02.f900000664000175000017500000000031715174404631022026 0ustar alastairalastairprogram reserved_02 implicit none if (integer() /= 1) error stop contains integer function integer() integer function function = 5 function = function/function integer = function end function end program lfortran-0.63.0/integration_tests/assign_to3.f900000664000175000017500000000010315174404631021750 0ustar alastairalastairprogram main integer :: k 15 assign 15 to k print *, k end program lfortran-0.63.0/integration_tests/arrays_88.f900000664000175000017500000000150415174404631021525 0ustar alastairalastairprogram arrays_88 implicit none integer, parameter :: n = 5 integer :: offset(n) real :: offsetr(n) integer :: pos integer :: offset_date offset = (/1, 2, 3, 4, 5/) offsetr = (/1.0, 2.0, 3.0, 4.0, 5.0/) pos = 10 offset_date = 3 print *, peek(pos + offset(:offset_date)) if( any(peek(pos + offset(:offset_date)) /= [110, 120, 130]) ) error stop print *, peekr(pos + offsetr(:offset_date)) if( any(peekr(pos + offsetr(:offset_date)) /= [110.0, 120.0, 130.0]) ) error stop contains function peek(x) result(y) integer, intent(in) :: x(:) integer :: y(size(x)) y = x * 10 end function peek function peekr(x) result(y) real, intent(in) :: x(:) real :: y(size(x)) y = x * 10 end function peekr end program arrays_88 lfortran-0.63.0/integration_tests/const_array_02.f900000664000175000017500000000033315174404631022531 0ustar alastairalastairprogram const_array_02 implicit none integer, parameter :: dp = kind(0.d0) real(dp), parameter :: A(5) = [1.1_dp, 3.0_dp, 10.0_dp, 2.1_dp, 5.5_dp] integer, parameter :: B(5) = [1, 3, 10, 2, 5] print *, A print *, B end lfortran-0.63.0/integration_tests/include_04/0000775000175000017500000000000015174404631021313 5ustar alastairalastairlfortran-0.63.0/integration_tests/include_04/vals.inc0000664000175000017500000000010615174404631022750 0ustar alastairalastair integer, parameter :: x = 42 integer, parameter :: y = 10 lfortran-0.63.0/integration_tests/class_96.f900000664000175000017500000000073215174404631021332 0ustar alastairalastairprogram class_95 implicit none character(len=5) :: arr(2) = ["hello", "world"] call ss(arr) contains subroutine ss(generic) class(*) :: generic(:) select type (generic) type is (character(len=*)) call ff(generic) end select end subroutine subroutine ff(x) character(len=*) :: x(:) if(x(1) /= "hello") error stop if(x(2) /= "world") error stop end subroutine end programlfortran-0.63.0/integration_tests/subroutines_20.f900000664000175000017500000000074615174404631022577 0ustar alastairalastairprogram subroutines_20 type :: regex_token character(len=:), allocatable :: ccl end type regex_token type :: regex_pattern type(regex_token) :: pattern end type regex_pattern type(regex_pattern) :: my_pattern call temp(my_pattern%pattern) if (my_pattern%pattern%ccl /= "abc") error stop contains subroutine temp(pattern) type(regex_token), intent(out) :: pattern pattern%ccl = 'abc' end subroutine temp end program lfortran-0.63.0/integration_tests/bindc_iso_fb_01c.c0000664000175000017500000003061415174404631022600 0ustar alastairalastair/* * Consolidated C helpers for bindc_iso_fb_01 * * Merged from: * - bindc_18c.c: CFI descriptor sums (int32/int64/float/double), * double-in-place, assumed-rank queries, allocatable, * pointer, contiguity, optional * - bindc_19c.c: complex float/double sums, logical count/flip, * character helpers, CONTIGUOUS attribute * - bindc_24c.c: scalar type operations (int8, int16, short, long, * long_long, size_t, intptr_t, ptrdiff_t), VALUE with * bool/complex/character, small-int array sums, * complex return values * * NOTE: bindc_18c.c and bindc_19c.c both defined an identical * static int32_t sum_i32(...) helper. Only one copy is kept * (from bindc_18c.c) and shared by both sets of functions. */ #include #include #include #include #include #include /* ================================================================ * From bindc_18c.c * ================================================================ */ /* ---------------------------------------------------------------- * int32 — sum (any rank via recursive descent on descriptor dims) * ---------------------------------------------------------------- */ static int32_t sum_i32(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) return *(int32_t *)base; int32_t total = 0; for (CFI_index_t i = 0; i < d[k].extent; i++) total += sum_i32(base + i * d[k].sm, d, rank, k + 1); return total; } static int32_t sum_i32_entry(CFI_cdesc_t *a) { return sum_i32((char *)a->base_addr, a->dim, (int)a->rank, 0); } int32_t c_sum_int32_1d(CFI_cdesc_t *a) { return sum_i32_entry(a); } int32_t c_sum_int32_2d(CFI_cdesc_t *a) { return sum_i32_entry(a); } int32_t c_sum_int32_3d(CFI_cdesc_t *a) { return sum_i32_entry(a); } int32_t c_sum_int32_ar(CFI_cdesc_t *a) { return sum_i32_entry(a); } /* ---------------------------------------------------------------- * int64 — sum (any rank) * ---------------------------------------------------------------- */ static int64_t sum_i64(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) return *(int64_t *)base; int64_t total = 0; for (CFI_index_t i = 0; i < d[k].extent; i++) total += sum_i64(base + i * d[k].sm, d, rank, k + 1); return total; } static int64_t sum_i64_entry(CFI_cdesc_t *a) { return sum_i64((char *)a->base_addr, a->dim, (int)a->rank, 0); } int64_t c_sum_int64_1d(CFI_cdesc_t *a) { return sum_i64_entry(a); } int64_t c_sum_int64_2d(CFI_cdesc_t *a) { return sum_i64_entry(a); } int64_t c_sum_int64_3d(CFI_cdesc_t *a) { return sum_i64_entry(a); } /* ---------------------------------------------------------------- * float — sum (any rank) * ---------------------------------------------------------------- */ static float sum_f32(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) return *(float *)base; float total = 0; for (CFI_index_t i = 0; i < d[k].extent; i++) total += sum_f32(base + i * d[k].sm, d, rank, k + 1); return total; } static float sum_f32_entry(CFI_cdesc_t *a) { return sum_f32((char *)a->base_addr, a->dim, (int)a->rank, 0); } float c_sum_float_1d(CFI_cdesc_t *a) { return sum_f32_entry(a); } float c_sum_float_2d(CFI_cdesc_t *a) { return sum_f32_entry(a); } float c_sum_float_3d(CFI_cdesc_t *a) { return sum_f32_entry(a); } /* ---------------------------------------------------------------- * double — sum (any rank) * ---------------------------------------------------------------- */ static double sum_f64(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) return *(double *)base; double total = 0; for (CFI_index_t i = 0; i < d[k].extent; i++) total += sum_f64(base + i * d[k].sm, d, rank, k + 1); return total; } static double sum_f64_entry(CFI_cdesc_t *a) { return sum_f64((char *)a->base_addr, a->dim, (int)a->rank, 0); } double c_sum_double_1d(CFI_cdesc_t *a) { return sum_f64_entry(a); } double c_sum_double_2d(CFI_cdesc_t *a) { return sum_f64_entry(a); } double c_sum_double_3d(CFI_cdesc_t *a) { return sum_f64_entry(a); } /* ---------------------------------------------------------------- * int32 — double-in-place (any rank) * ---------------------------------------------------------------- */ static void dbl_i32(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) { *(int32_t *)base *= 2; return; } for (CFI_index_t i = 0; i < d[k].extent; i++) dbl_i32(base + i * d[k].sm, d, rank, k + 1); } static void dbl_i32_entry(CFI_cdesc_t *a) { dbl_i32((char *)a->base_addr, a->dim, (int)a->rank, 0); } void c_double_int32_1d(CFI_cdesc_t *a) { dbl_i32_entry(a); } void c_double_int32_2d(CFI_cdesc_t *a) { dbl_i32_entry(a); } void c_double_int32_3d(CFI_cdesc_t *a) { dbl_i32_entry(a); } /* ---------------------------------------------------------------- * Assumed-rank queries (type(*), dimension(..)) * ---------------------------------------------------------------- */ int c_get_rank(CFI_cdesc_t *a) { return (int)a->rank; } int c_get_elem_size(CFI_cdesc_t *a) { return (int)a->elem_len; } /* ---------------------------------------------------------------- * Allocatable arrays — same sum logic, separate entry points * ---------------------------------------------------------------- */ int32_t c_sum_alloc_1d(CFI_cdesc_t *a) { return sum_i32_entry(a); } int c_attr_alloc(CFI_cdesc_t *a) { return a->attribute == CFI_attribute_allocatable; } void c_double_alloc_1d(CFI_cdesc_t *a) { dbl_i32_entry(a); } /* ---------------------------------------------------------------- * Pointer arrays — same sum logic, separate entry points * ---------------------------------------------------------------- */ int32_t c_sum_ptr_1d(CFI_cdesc_t *a) { return sum_i32_entry(a); } int c_attr_ptr(CFI_cdesc_t *a) { return a->attribute == CFI_attribute_pointer; } /* ---------------------------------------------------------------- * Attribute / contiguity queries for assumed-shape (other) * ---------------------------------------------------------------- */ int c_attr_other(CFI_cdesc_t *a) { return a->attribute == CFI_attribute_other; } int c_is_contiguous(CFI_cdesc_t *a) { CFI_index_t expected = (CFI_index_t)a->elem_len; for (int i = 0; i < (int)a->rank; i++) { if (a->dim[i].sm != expected) return 0; expected *= a->dim[i].extent; } return 1; } /* ---------------------------------------------------------------- * Optional argument — NULL descriptor when absent * ---------------------------------------------------------------- */ int c_is_present(CFI_cdesc_t *a) { return (a != NULL) ? 1 : 0; } /* ================================================================ * From bindc_19c.c * * NOTE: The duplicate static sum_i32() that was in bindc_19c.c has * been removed. The c19_sum_contiguous() function below uses the * single sum_i32() defined above (from bindc_18c.c). * ================================================================ */ /* ---- complex float (2 floats per element) ---- */ void c19_sum_cfloat_1d(CFI_cdesc_t *a, float *re, float *im) { *re = 0; *im = 0; char *base = (char *)a->base_addr; for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { float *c = (float *)(base + i * a->dim[0].sm); *re += c[0]; *im += c[1]; } } void c19_sum_cfloat_2d(CFI_cdesc_t *a, float *re, float *im) { *re = 0; *im = 0; char *base = (char *)a->base_addr; for (CFI_index_t j = 0; j < a->dim[1].extent; j++) for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { float *c = (float *)(base + i * a->dim[0].sm + j * a->dim[1].sm); *re += c[0]; *im += c[1]; } } void c19_scale_cfloat_1d(CFI_cdesc_t *a) { char *base = (char *)a->base_addr; for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { float *c = (float *)(base + i * a->dim[0].sm); c[0] *= 2; c[1] *= 2; } } /* ---- complex double (2 doubles per element) ---- */ void c19_sum_cdouble_1d(CFI_cdesc_t *a, double *re, double *im) { *re = 0; *im = 0; char *base = (char *)a->base_addr; for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { double *c = (double *)(base + i * a->dim[0].sm); *re += c[0]; *im += c[1]; } } void c19_sum_cdouble_2d(CFI_cdesc_t *a, double *re, double *im) { *re = 0; *im = 0; char *base = (char *)a->base_addr; for (CFI_index_t j = 0; j < a->dim[1].extent; j++) for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { double *c = (double *)(base + i * a->dim[0].sm + j * a->dim[1].sm); *re += c[0]; *im += c[1]; } } /* ---- logical (c_bool = 1 byte typically) ---- */ static int count_true(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) { /* c_bool: nonzero means true */ return (*(unsigned char *)base) ? 1 : 0; } int total = 0; for (CFI_index_t i = 0; i < d[k].extent; i++) total += count_true(base + i * d[k].sm, d, rank, k + 1); return total; } int c19_count_true_1d(CFI_cdesc_t *a) { return count_true((char *)a->base_addr, a->dim, (int)a->rank, 0); } int c19_count_true_2d(CFI_cdesc_t *a) { return count_true((char *)a->base_addr, a->dim, (int)a->rank, 0); } void c19_flip_bool_1d(CFI_cdesc_t *a) { char *base = (char *)a->base_addr; for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { unsigned char *v = (unsigned char *)(base + i * a->dim[0].sm); *v = (*v) ? 0 : 1; } } /* ---- character ---- */ int c19_char_sum_1d(CFI_cdesc_t *a) { int total = 0; char *base = (char *)a->base_addr; for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { unsigned char *ch = (unsigned char *)(base + i * a->dim[0].sm); total += *ch; } return total; } int c19_char_elem_len(CFI_cdesc_t *a) { return (int)a->elem_len; } /* ---- CONTIGUOUS (uses shared sum_i32 from bindc_18c.c section) ---- */ int c19_sum_contiguous(CFI_cdesc_t *a) { return (int)sum_i32((char *)a->base_addr, a->dim, (int)a->rank, 0); } int c19_is_contiguous_check(CFI_cdesc_t *a) { CFI_index_t expected = (CFI_index_t)a->elem_len; for (int i = 0; i < (int)a->rank; i++) { if (a->dim[i].sm != expected) return 0; expected *= a->dim[i].extent; } return 1; } /* ================================================================ * From bindc_24c.c * ================================================================ */ /* ---- int8 ---- */ int8_t c24_add_int8(int8_t a, int8_t b) { return a + b; } void c24_double_int8(int8_t *a) { *a *= 2; } /* ---- int16 ---- */ int16_t c24_add_int16(int16_t a, int16_t b) { return a + b; } void c24_double_int16(int16_t *a) { *a *= 2; } /* ---- short ---- */ short c24_add_short(short a, short b) { return a + b; } /* ---- long ---- */ long c24_add_long(long a, long b) { return a + b; } /* ---- long long ---- */ long long c24_add_long_long(long long a, long long b) { return a + b; } /* ---- size_t ---- */ size_t c24_add_size_t(size_t a, size_t b) { return a + b; } /* ---- intptr_t ---- */ intptr_t c24_add_intptr(intptr_t a, intptr_t b) { return a + b; } /* ---- ptrdiff_t ---- */ ptrdiff_t c24_add_ptrdiff(ptrdiff_t a, ptrdiff_t b) { return a + b; } /* ---- VALUE with logical (c_bool = _Bool) ---- */ int c24_bool_to_int(_Bool x) { return x ? 1 : 0; } /* ---- VALUE with complex ---- */ float c24_cabs_float(float _Complex z) { return (float)sqrt((double)(crealf(z)*crealf(z) + cimagf(z)*cimagf(z))); } double c24_cabs_double(double _Complex z) { return sqrt(creal(z)*creal(z) + cimag(z)*cimag(z)); } /* ---- VALUE with character ---- */ int c24_char_to_int(char ch) { return (int)(unsigned char)ch; } /* ---- int8/int16 arrays via descriptor ---- */ int c24_sum_int8_1d(CFI_cdesc_t *a) { int total = 0; char *base = (char *)a->base_addr; for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { total += *(int8_t *)(base + i * a->dim[0].sm); } return total; } int c24_sum_int16_1d(CFI_cdesc_t *a) { int total = 0; char *base = (char *)a->base_addr; for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { total += *(int16_t *)(base + i * a->dim[0].sm); } return total; } /* ---- function returning complex ---- */ float _Complex c24_make_complex(float re, float im) { return re + im * I; } double _Complex c24_make_dcomplex(double re, double im) { return re + im * I; } lfortran-0.63.0/integration_tests/matmul_06.f900000664000175000017500000000120515174404631021507 0ustar alastairalastairmodule matmul_06_mod implicit none contains pure function diag(v) result(res) real, intent(in) :: v(:) real :: res(size(v), size(v)) integer :: i res = 0.0 do i = 1, size(v) res(i, i) = v(i) end do end function end module program matmul_06 use matmul_06_mod, only: diag implicit none real :: s(2), vt(2,2), r(2,2) s = [2.0, 3.0] vt = reshape([1.0, 0.0, 0.0, 1.0], [2, 2]) r = matmul(diag(s), vt) print *, r(1,1), r(2,1), r(1,2), r(2,2) if (abs(r(1,1) - 2.0) > 1e-6) error stop if (abs(r(2,1) - 0.0) > 1e-6) error stop if (abs(r(1,2) - 0.0) > 1e-6) error stop if (abs(r(2,2) - 3.0) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/file_39.f900000664000175000017500000000214715174404631021143 0ustar alastairalastairprogram file_39 ! Test position='append' in OPEN statement implicit none integer :: u, a(3), b(3) character(*), parameter :: filename = "file_39_test.txt" ! Write first line open(newunit=u, file=filename, action='write', status='replace', & access='stream', form='formatted') write(u, *) 1, 2, 3 close(u) ! Append second line using position='append' open(newunit=u, file=filename, action='write', position='append', & status='old', access='stream', form='formatted') write(u, *) 4, 5, 6 close(u) ! Read both lines back open(newunit=u, file=filename, action='read', status='old', & access='stream', form='formatted') read(u, *) a read(u, *) b close(u) ! Verify first line is [1,2,3], second line is [4,5,6] if (.not. all(a == [1, 2, 3])) then print *, "FAIL: first line should be [1,2,3], got", a error stop end if if (.not. all(b == [4, 5, 6])) then print *, "FAIL: second line should be [4,5,6], got", b error stop end if print *, "PASS" end program lfortran-0.63.0/integration_tests/case_01.f900000664000175000017500000000074315174404631021124 0ustar alastairalastairprogram case_01 implicit none integer(8) :: i, out i = 4 select case(i) case (1) out = 10 print *, "1" case (2) out = 20 print *, "2" case (3) out = 30 print *, "3" case (4) out = 40 print *, "4" end select if (out /= 40) error stop selectcase(i) case (1) out = 11 print *, "1" case (2,3,4) out = 22 print *, "2,3,4" end select if (out /= 22) error stop end lfortran-0.63.0/integration_tests/equivalence_25.f900000664000175000017500000000046115174404631022515 0ustar alastairalastairprogram equivalence_25 implicit none integer :: i1, i2, i3 equivalence (i1, i2), (i2, i3) i1 = 1 i2 = 2 i3 = 3 if (i1 /= 3) error stop if (i2 /= 3) error stop if (i3 /= 3) error stop i1 = 42 if (i2 /= 42) error stop if (i3 /= 42) error stop end program lfortran-0.63.0/integration_tests/submodule_14.f900000664000175000017500000000115415174404631022211 0ustar alastairalastairmodule the_interface_submodule_14 implicit none integer,parameter:: dp = selected_real_kind(15) interface real(dp) module function pi() end function pi end interface end module the_interface_submodule_14 submodule (the_interface_submodule_14) the_calculation_submodule_14 implicit none contains real(dp) module function pi() pi = acos(-1.0_dp) end function pi end submodule the_calculation_submodule_14 program submodule_14 use the_interface_submodule_14 implicit none real(dp) :: result = 1.0_dp result = pi() print *, result if (result /= acos(-1.0_dp)) error stop end programlfortran-0.63.0/integration_tests/implicit_typing_05.f900000664000175000017500000000046515174404631023422 0ustar alastairalastairsubroutine outer() print *, f(2.0_8) if ( abs(f(2.0_8) - 14.928527864588919) > 1e-7 ) error stop contains function f(r) implicit real(kind=8) (f, r, n) n = 3.9_8 f = r**n end function f end subroutine outer program implicit_typing_05 call outer() end program implicit_typing_05 lfortran-0.63.0/integration_tests/intrinsics_443.f900000664000175000017500000000025015174404631022461 0ustar alastairalastairprogram intrinsics_443 implicit none character(kind=4, len=1), parameter :: ar2(4) = char([31, 57, 56, 67], kind=4) print *, ar2 end program intrinsics_443 lfortran-0.63.0/integration_tests/dealloc_04.f900000664000175000017500000000135015174404631021612 0ustar alastairalastairmodule dealloc_04 type, abstract :: toml_value integer, allocatable :: key end type type, extends(toml_value) :: toml_table logical :: implicit = .false. end type toml_table contains subroutine new_table(self) class(toml_value), allocatable, intent(out) :: self allocate(self, source=toml_table()) allocate(self%key) self%key = 5678 end subroutine new_table end module program test use dealloc_04 class(toml_value), allocatable :: tmp allocate(tmp, source=toml_table()) allocate(tmp%key) tmp%key = 1234 print *, "Key in tmp: ", tmp%key call new_table(tmp) print *, "Key in tmp after new_table call: ", tmp%key if (tmp%key /= 5678) error stop end program lfortran-0.63.0/integration_tests/array_slice_03.f900000664000175000017500000000071715174404631022511 0ustar alastairalastairprogram array_slice_03 implicit none integer :: x(4) integer :: y(2) x = [1, 2, 3, 4] call sub(x, y) print *, "y: ", y(1), y(2) if( y(1) /= 2 ) error stop if( y(2) /= 3 ) error stop contains subroutine sub(x,y) integer, intent(in) :: x(:) integer, intent(out) :: y(:) y = x(2:3) if( y(1) /= 2 ) error stop if( y(2) /= 3 ) error stop end subroutine sub end program array_slice_03 lfortran-0.63.0/integration_tests/expr_20.f900000664000175000017500000000016715174404631021170 0ustar alastairalastairprogram expr_20 integer :: n n = -123 n = n / 10 print *, n if (n /= -12) error stop end program lfortran-0.63.0/integration_tests/operator_overloading_21.f900000664000175000017500000000156715174404631024444 0ustar alastairalastairmodule operator_overloading_21_mod implicit none type :: temp integer :: v = 0 contains procedure, pass :: not_equal generic :: operator(/=) => not_equal end type temp contains elemental logical function not_equal(lhs, rhs) class(temp), intent(in) :: lhs, rhs not_equal = lhs%v /= rhs%v end function not_equal end module operator_overloading_21_mod program operator_overloading_21 use operator_overloading_21_mod implicit none type(temp), allocatable :: a(:), b(:) allocate(a(3)) allocate(b(3)) a%v = [1, 2, 3] b%v = [1, 0, 3] print *, "any(a /= b) =", any(a /= b) if (.not. any(a /= b)) then error stop end if b%v = [1, 2, 3] print *, "any(a /= b) =", any(a /= b) if (any(a /= b)) then error stop end if end program operator_overloading_21 lfortran-0.63.0/integration_tests/read_53.f900000664000175000017500000000061615174404631021132 0ustar alastairalastairprogram test_read_int_iostat implicit none integer i, n, ios character(4):: input(3) = ['42 ','3.14','abcd'] do i = 1, 3 read(input(i), "(I4)", iostat=ios) n if (ios /= 0) exit print "(A,I0)", 'You said ', n end do if (i /= 2) error stop "expected exit on iteration 2" if (ios == 0) error stop "iostat should be nonzero for '3.14'" print *, "Test passed" end programlfortran-0.63.0/integration_tests/nested_18.f900000664000175000017500000000401115174404631021473 0ustar alastairalastair! Test for nested function global variables passes ! with function calls in conditions ! Test for both, scalars and arrays ! Test 1: Do-while loop with function call in condition (3 iterations) ! Test 2: IF block with function call in condition module nested_18_temp contains subroutine demo() implicit none integer :: a integer :: arr(5) integer :: counter ! Test 1: Do-While loop - runs 6 times ! Check Upodates from Main to Function ! And from function to Main a = 0 arr(1:5) = 0 counter = 0 GET_ARGS: do while(increment()) ! Check updates from function to main counter = counter + 1 if (counter == 1 .and. a /= 1 .and. arr(1) /= 1) error stop if (counter == 3 .and. a /= 3 .and. arr(3) /= 3) error stop if (counter == 5 .and. a /= 5 .and. arr(5) /= 3) error stop print *, "Iteration", counter, ": a =", a, ": arr =", arr ! Update a inside main to check from main to function a = a + 1 arr = arr + 1 counter = counter + 1 print *, "Iteration", counter, ": a =", a, ": arr =", arr if (counter == 6) exit GET_ARGS end do GET_ARGS print *, "a =", a print *, "arr =", arr if (a /= 6) error stop if (arr(1) /= 6) error stop ! Test 2: IF block with function call in condition a = 10 if (set_value(25)) then print *, "In IF body: a =", a if (a /= 25) error stop a = a + 5 end if print *, a if (a /= 30) error stop contains logical function increment() arr = arr + 1 a = a + 1 increment = .true. end function increment logical function set_value(val) integer, intent(in) :: val a = val set_value = .true. end function set_value end subroutine demo end module nested_18_temp program nested_18 use nested_18_temp implicit none call demo() print *, "Nested variable test passed" end program nested_18lfortran-0.63.0/integration_tests/arrays_26.f900000664000175000017500000000024515174404631021516 0ustar alastairalastairprogram arrays_26 type :: my_struct integer :: i end type type(my_struct), allocatable :: s(:) allocate(s(1)) s(1)%i = 5 if (s(1)%i /= 5) error stop end program lfortran-0.63.0/integration_tests/gpu_metal_39.f900000664000175000017500000000055215174404631022177 0ustar alastairalastairprogram gpu_metal_39 ! Test: associate variable used as do concurrent loop bound implicit none integer :: i, m, s integer :: a(10) m = 10 s = 0 do i = 1, m a(i) = 0 end do associate(n => m) do concurrent(i = 1:n) a(i) = i * 3 end do end associate do i = 1, m s = s + a(i) end do if (s /= 165) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/deferred_shape_01.f900000664000175000017500000000102215174404631023140 0ustar alastairalastairprogram deferred_shape_01 implicit none integer, dimension(*), parameter :: arr = [1, 2, 3] character(*), dimension(*), parameter :: keys = [character(5) :: & & "one", "two", "three" & & ] if (size(arr) /= 3) error stop if (arr(1) /= 1) error stop if (arr(2) /= 2) error stop if (arr(3) /= 3) error stop if (size(keys) /= 3) error stop if (trim(keys(1)) /= "one") error stop if (trim(keys(2)) /= "two") error stop if (trim(keys(3)) /= "three") error stop end program lfortran-0.63.0/integration_tests/subroutines_19.f900000664000175000017500000000036015174404631022577 0ustar alastairalastairprogram subroutines_19 implicit none integer :: x = 1 call f(x) contains subroutine f(a) integer :: a intent(in) :: a print * , a if (a /= 1) error stop end subroutine end program lfortran-0.63.0/integration_tests/read_21.f900000664000175000017500000000030615174404631021121 0ustar alastairalastairprogram test_read implicit none integer :: i1, i2 character(len=8) :: cdata = ' 1 2' read (cdata, '(i4, i4)') i1, i2 if(i1 /= 1 .or. i2 /= 2) error stop print *, "OK" end programlfortran-0.63.0/integration_tests/array_section_assign_01.f900000664000175000017500000000033315174404631024412 0ustar alastairalastairprogram array_section_assign_01 implicit none integer :: ilist(6,6) ilist(1,1:3) = [1,2,4] print "(3(1X,I0))", ilist(1,1:3) if (any(ilist(1,1:3) /= [1, 2, 4])) error stop end program array_section_assign_01lfortran-0.63.0/integration_tests/namelist_22.f900000664000175000017500000000076715174404631022036 0ustar alastairalastairprogram namelist_22 character(len=1), allocatable :: a(:) character(len=200) :: buf integer :: u, ios logical :: found namelist /n/ a allocate(a(1)) a(1) = "x" open(newunit=u, status="scratch", action="readwrite") write(u, nml=n) rewind(u) found = .false. do read(u, "(A)", iostat=ios) buf if (ios /= 0) exit if (index(buf, "x") /= 0) found = .true. end do close(u) if (.not. found) error stop end program namelist_22 lfortran-0.63.0/integration_tests/present_06.f900000664000175000017500000000157515174404631021702 0ustar alastairalastair! Test: procedure dummy passed through to another routine without being called subroutine inner(func, x, y) implicit none double precision :: func external :: func double precision, intent(in) :: x double precision, intent(out) :: y y = func(x) end subroutine inner subroutine outer(f, a, b) implicit none double precision :: f external :: f double precision, intent(in) :: a double precision, intent(out) :: b call inner(f, a, b) end subroutine outer double precision function myfunc(x) implicit none double precision, intent(in) :: x myfunc = x * 2.0d0 end function myfunc program present_06 implicit none double precision :: result double precision, external :: myfunc call outer(myfunc, 2.0d0, result) if (abs(result - 4.0d0) > 1.0d-10) error stop "Expected 4.0" print *, "PASS" end program present_06 lfortran-0.63.0/integration_tests/random_number_01.f900000664000175000017500000000162315174404631023037 0ustar alastairalastairprogram random_number_01 ! Verify that random_number() produces a deterministic, repeatable ! sequence when seeded with the same value. implicit none integer :: n integer, allocatable :: seed(:) real :: x1, x2, y1, y2 call random_seed(size=n) allocate(seed(n)) seed = 42 ! Seed and generate two numbers call random_seed(put=seed) call random_number(x1) call random_number(x2) ! Re-seed with the same value and generate again call random_seed(put=seed) call random_number(y1) call random_number(y2) ! Sequences from the same seed must be identical if (abs(x1 - y1) > 1e-8) error stop if (abs(x2 - y2) > 1e-8) error stop ! Values must be in [0, 1) if (x1 < 0.0 .or. x1 >= 1.0) error stop if (x2 < 0.0 .or. x2 >= 1.0) error stop ! Consecutive values should differ if (abs(x1 - x2) < 1e-8) error stop end program lfortran-0.63.0/integration_tests/template_array_01.f900000664000175000017500000000225715174404631023224 0ustar alastairalastairmodule template_array_01_m implicit none private public :: test_template requirement r(t) type, deferred :: t end requirement template array_tmpl(t) require :: r(t) private public :: insert_t contains function insert_t(lst, i) result(r) type(t), intent(in) :: lst(:), i type(t) :: r lst(1) = i r = lst(1) end function function insert_t_n(n, lst, i) result(r) integer, intent(in) :: n type(t), intent(in) :: lst(n), i type(t) :: r lst(1) = i r = lst(1) end function end template contains subroutine test_template() instantiate array_tmpl(integer), only: insert_int => insert_t, insert_int_n => insert_t_n integer :: a(1), i, r a(1) = 0 i = 1 print *, a(1) r = insert_int(a, i) print *, a(1) a(1) = 0 print *, a(1) r = insert_int_n(size(a), a, i) print *, a(1) end subroutine end module program template_array_01 use template_array_01_m implicit none call test_template() end lfortran-0.63.0/integration_tests/array_shape_func_call.f900000664000175000017500000000073415174404631024215 0ustar alastairalastairprogram array_shape_func_call integer :: call_count = 0 call ss(ff(f(), 20)) if (call_count /= 1) then error stop "f() called more than once" end if contains function ff(x, y) result(str) integer :: x integer :: y integer :: str(x) end function function f() result(ret) integer :: ret call_count = call_count + 1 ret = 10 end function subroutine ss(x) integer :: x(*) end subroutine end program array_shape_func_call lfortran-0.63.0/integration_tests/arrays_16_func.f900000664000175000017500000000065315174404631022533 0ustar alastairalastairprogram arrays_16_func real :: arr(17) integer :: i real :: sum2 do i = 1, 17 arr(i) = i end do call imply(arr, 17, sum2) print *, sum2 if( sum2 /= 153 ) error stop contains subroutine imply(f1, l1out, sum2) integer, intent(in) :: l1out real :: f1(l1out) real, intent(out) :: sum2 integer :: i1 sum2 = 0.0 do i1 = 1, l1out sum2 = sum2 + f1(i1) end do end subroutine end program lfortran-0.63.0/integration_tests/select_type_32.f900000664000175000017500000000136015174404631022531 0ustar alastairalastairmodule select_type_32_mod character(:), pointer, private :: string => null() contains function get() class(*), pointer :: get if (.not.associated(string)) allocate(string, source='foo') get => string end function subroutine set(arg) class(*), intent(in) :: arg select type (arg) type is (character(*)) if (arg /= 'foo') error stop end select end subroutine subroutine cleanup() if (associated(string)) deallocate(string) end subroutine end module program select_type_32 use select_type_32_mod logical :: entered entered = .false. select type (s => get()) type is (character(*)) entered = .true. call set(s) end select if (.not. entered) error stop call cleanup() end program lfortran-0.63.0/integration_tests/allocatable_oob_01.f900000664000175000017500000000031015174404631023301 0ustar alastairalastairprogram allocatable_oob_01 implicit none character(len=10), allocatable :: recvBuffer(:) allocate(recvBuffer(1)) recvBuffer = '' print *, trim(recvBuffer(11)) end program allocatable_oob_01 lfortran-0.63.0/integration_tests/intrinsics_358.f900000664000175000017500000000073515174404631022476 0ustar alastairalastairmodule rand_mod_intrinsic_358 implicit none contains subroutine getseed(seed) integer, intent(out) :: seed(:) call random_seed(get=seed) end subroutine getseed function rand0() result(x) use iso_fortran_env, only: RP => REAL64 real(RP) :: x call random_number(harvest=x) end function rand0 end module rand_mod_intrinsic_358 program main use rand_mod_intrinsic_358 implicit none integer :: seed(8) call getseed(seed) call random_seed(put=seed) print *, rand0() end program lfortran-0.63.0/integration_tests/gpu_metal_117.f900000664000175000017500000000133115174404631022250 0ustar alastairalastairprogram gpu_metal_117 ! Test that float literals in max/min inside do concurrent are ! correctly emitted in Metal codegen (not truncated to integers). implicit none real :: x(4) integer :: i x(1) = -1.0 x(2) = 0.5 x(3) = -3.0 x(4) = 2.0 do concurrent (i = 1:4) x(i) = max(0.0, x(i)) end do if (abs(x(1)) > 1e-6) error stop if (abs(x(2) - 0.5) > 1e-6) error stop if (abs(x(3)) > 1e-6) error stop if (abs(x(4) - 2.0) > 1e-6) error stop x(1) = 5.0 x(2) = 0.5 x(3) = 3.0 x(4) = -1.0 do concurrent (i = 1:4) x(i) = min(1.0, x(i)) end do if (abs(x(1) - 1.0) > 1e-6) error stop if (abs(x(2) - 0.5) > 1e-6) error stop if (abs(x(3) - 1.0) > 1e-6) error stop if (abs(x(4) - (-1.0)) > 1e-6) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/arrays_03_func_pass_arr_dims.f900000664000175000017500000000060115174404631025426 0ustar alastairalastairprogram arrays_03_func implicit none integer :: x(10), s, i do i = 1, size(x) x(i) = i end do s = mysum(size(x, dim=1), x) print *, s if (s /= 55) error stop contains integer function mysum(na1, a) result(r) integer, intent(in) :: na1 integer, intent(in) :: a(na1) integer :: i r = 0 do i = 1, size(a) r = r + a(i) end do end function end lfortran-0.63.0/integration_tests/intrinsics_66.f900000664000175000017500000000047315174404631022411 0ustar alastairalastairprogram intrinsics_66 real :: x,y(2) x = 1.0 y = 2.0 print *, sign(y(1),x) print *, sign(y(2),x) print *, sign(y(2), -x) if (abs(sign(y(1),x) - 2.0) > 1e-9) error stop if (abs(sign(y(2),x) - 2.0) > 1e-9) error stop if (abs(sign(y(2),-x) - (-2.0)) > 1e-9) error stop end program lfortran-0.63.0/integration_tests/modules_23.f900000664000175000017500000000007515174404631021663 0ustar alastairalastairprogram module_23 use string_module implicit none end programlfortran-0.63.0/integration_tests/intrinsics_320.f900000664000175000017500000000311715174404631022460 0ustar alastairalastairprogram intrinsics_240 character(len=100) :: line1 = " Hello, World!" character(len=7) :: line2 = "Okay " character(5) :: line3 = " #o$ " character(1) :: line4 = " " integer, parameter :: l1 = len_trim(" Hello, World!") integer, parameter :: l2 = len_trim("Okay ") integer, parameter :: l3 = len_trim(" #o$ ") integer, parameter :: l4 = len_trim(" ") character(len = 3) :: arr1(3) = [" bc", "d f", "gh "] character :: arr2(3) = [" ", "y ", "o "] integer, parameter :: l5(3) = len_trim([" bc", "d f", "gh "]) integer, parameter :: l6(4) = len_trim([" ", "ok", "y ", "o "]) print*, l1 if (l1 /= 18 ) error stop print*, l2 if (l2 /= 4 ) error stop print*, l3 if (l3 /= 4 ) error stop print*, l4 if (l4 /= 0 ) error stop print*, len_trim(line1) if (len_trim(line1) /= 18 ) error stop print*, len_trim(line2) if (len_trim(line2) /= 4 ) error stop print*, len_trim(line3) if (len_trim(line3) /= 4 ) error stop print*, len_trim(line4) if (len_trim(line4) /= 0 ) error stop print*, l5 if (l5(1) /= 3 ) error stop if (l5(2) /= 3 ) error stop if (l5(3) /= 2 ) error stop print*, l6 if (l6(1) /= 0 ) error stop if (l6(2) /= 2 ) error stop if (l6(3) /= 1 ) error stop if (l6(4) /= 1 ) error stop print*, len_trim(arr1(1)) if (len_trim(arr1(1)) /= 3 ) error stop print*, len_trim(arr1(2)) if (len_trim(arr1(2)) /= 3 ) error stop print*, len_trim(arr1(3)) if (len_trim(arr1(3)) /= 2 ) error stop print*, len_trim(arr2(1)) if (len_trim(arr2(1)) /= 0 ) error stop print*, len_trim(arr2(2)) if (len_trim(arr2(2)) /= 1 ) error stop print*, len_trim(arr2(3)) if (len_trim(arr2(3)) /= 1 ) error stop end program lfortran-0.63.0/integration_tests/const_real_dp.f900000664000175000017500000000026015174404631022517 0ustar alastairalastairprogram const_real_dp real(4) :: zero real(8) :: v, u real :: x zero = 0.0_4 u = 1.05_4 v = 1.05_8 x = 1.05 print *, zero, v, x, u end programlfortran-0.63.0/integration_tests/derived_types_50.f900000664000175000017500000000430615174404631023062 0ustar alastairalastairmodule stdlib_bitsets implicit none public :: & bitset_type, & bitset_large, & bitset_64, & bitset_64_concrete type, abstract :: bitset_type integer(4) :: num_bits contains procedure(clear_bit_abstract), deferred, pass(self) :: clear_bit procedure(clear_range_abstract), deferred, pass(self) :: clear_range generic :: clear => clear_bit, clear_range end type bitset_type abstract interface elemental subroutine clear_bit_abstract(self, pos) import :: bitset_type class(bitset_type), intent(inout) :: self integer(4), intent(in) :: pos end subroutine clear_bit_abstract pure subroutine clear_range_abstract(self, start_pos, stop_pos) import :: bitset_type class(bitset_type), intent(inout) :: self integer(4), intent(in) :: start_pos, stop_pos end subroutine clear_range_abstract end interface type, abstract, extends(bitset_type) :: bitset_large private integer(8), private, allocatable :: blocks(:) contains end type bitset_large type, abstract, extends(bitset_type) :: bitset_64 private integer(8), private :: block = 0 contains end type bitset_64 type, extends(bitset_64) :: bitset_64_concrete contains procedure, pass(self) :: clear_bit => clear_bit_impl procedure, pass(self) :: clear_range => clear_range_impl end type bitset_64_concrete contains elemental subroutine clear_bit_impl(self, pos) class(bitset_64_concrete), intent(inout) :: self integer(4), intent(in) :: pos ! Dummy implementation end subroutine clear_bit_impl pure subroutine clear_range_impl(self, start_pos, stop_pos) class(bitset_64_concrete), intent(inout) :: self integer(4), intent(in) :: start_pos, stop_pos ! Dummy implementation end subroutine clear_range_impl end module stdlib_bitsets program derived_types_50 use stdlib_bitsets implicit none type(bitset_64_concrete) :: set0, set1 set0%num_bits = 64 set1 = set0 if (set1%num_bits /= 64) error stop end program derived_types_50 lfortran-0.63.0/integration_tests/allocate_56.f900000664000175000017500000000165015174404631022005 0ustar alastairalastairprogram allocate_56 ! Test: allocate array with scalar source= and kind suffix on logical literal ! Also tests any()/all() with non-default logical kinds use iso_c_binding, only: c_bool implicit none integer, parameter :: LP = c_bool logical(LP), allocatable :: mask(:) integer, allocatable :: arr(:) integer :: i ! Scalar logical source with kind suffix allocate(mask(1:5), source=.false._LP) do i = 1, 5 if (mask(i) .neqv. .false.) error stop end do ! Test any() with non-default logical kind if (any(mask)) error stop ! Scalar logical source without kind suffix (default kind) deallocate(mask) allocate(mask(1:3), source=.true._LP) do i = 1, 3 if (mask(i) .neqv. .true.) error stop end do ! Test all() with non-default logical kind if (.not. all(mask)) error stop ! Scalar integer source for array allocation allocate(arr(1:4), source=42) do i = 1, 4 if (arr(i) /= 42) error stop end do print *, "PASS" end program lfortran-0.63.0/integration_tests/class_56.f900000664000175000017500000000324415174404631021327 0ustar alastairalastairmodule class_56_mod1 implicit none type :: toml_value integer :: x = 0 contains procedure :: accept end type type :: string_t character(len=:), allocatable :: s end type string_t contains subroutine accept(self) class(toml_value), intent(inout) :: self self%x = self%x + 1 end subroutine end module module class_56_mod2 use class_56_mod1 implicit none type :: ser_config contains procedure :: temp procedure :: temp2 end type contains subroutine temp(self, val) class(ser_config), intent(inout) :: self class(toml_value), intent(inout) :: val select type(val) type is (toml_value) call val%accept() class default print *, "Unknown type" end select end subroutine subroutine temp2(self, val) class(ser_config), intent(inout) :: self class(toml_value), intent(inout) :: val select type(val) class is (toml_value) call val%accept() class default print *, "Unknown type" end select end subroutine subroutine pkgcfg_list_all(descriptions) type(string_t), optional, allocatable, intent(out) :: descriptions(:) allocate(descriptions(2)) descriptions(1)%s = "Package 1" descriptions(2)%s = "Package 2" end subroutine end module program class_56 use class_56_mod2 implicit none type(ser_config) :: cfg type(toml_value) :: v type(string_t), allocatable :: descriptions(:) v%x = 1 call cfg%temp(v) if (v%x /= 2) error stop call cfg%temp2(v) if (v%x /= 3) error stop call pkgcfg_list_all(descriptions) if (descriptions(1)%s /= "Package 1") error stop if (descriptions(2)%s /= "Package 2") error stop end program lfortran-0.63.0/integration_tests/types_14.f900000664000175000017500000000021015174404631021346 0ustar alastairalastairprogram types_14 use iso_fortran_env, only: dp=>real64 implicit none double precision :: r, s(5) r = 1.0_dp end program lfortran-0.63.0/integration_tests/implicit_interface_05.f900000664000175000017500000000036715174404631024051 0ustar alastairalastairmodule implicit_interface_05_module contains function f() f = 1 end function f end program main use implicit_interface_05_module real :: i i = f() if (abs(i - 1) > 1e-6) error stop print *, i end program main lfortran-0.63.0/integration_tests/intrinsics_86.f900000664000175000017500000000067015174404631022412 0ustar alastairalastairprogram intrinsics_86 real(4) :: x integer :: res res = kind(3.0) print *, res if (res /= 4) error stop res = kind(x) print *, res if (res /= 4) error stop res = kind(3) print *, res if (res /= 4) error stop res = kind(3.0d0) print *, res if (res /= 8) error stop res = kind(3d0) print *, res if (res /= 8) error stop res = kind(3.0e0) print *, res if (res /= 4) error stop res = kind("a") print *, res if (res /= 1) error stop end program lfortran-0.63.0/integration_tests/pdt_11_module.f900000664000175000017500000000056515174404631022350 0ustar alastairalastairmodule pdt_11_module implicit none integer, parameter :: dp = kind(0.0d0) type tensor_t(k) integer, kind :: k = dp contains procedure :: values end type tensor_t contains pure real(dp) function values(self) class(tensor_t(dp)), intent(in) :: self values = 42.0_dp end function values end module pdt_11_module lfortran-0.63.0/integration_tests/intrinsics_186.f900000664000175000017500000000056715174404631022500 0ustar alastairalastairprogram intrinsic_186 implicit none character(7) :: string print*, verify(maybe(string), "foo") if (verify(maybe(string), "foo") /= 3) error stop contains function maybe(string) result(maybe_string) character(7) :: string character(len=len(string)) :: maybe_string maybe_string = "fortran" end function maybe end program lfortran-0.63.0/integration_tests/transfer_16.f900000664000175000017500000000123215174404631022035 0ustar alastairalastairmodule transfer_16_mod implicit none contains elemental integer function add_one(x) result(y) integer, intent(in) :: x y = x + 1 end function subroutine test_transfer_elemental() integer :: a, b(2) a = 5 ! transfer(elemental_func(array_constructor), mold) used to ICE with ! "More actual arguments than formal arguments in call" in the ! subroutine_from_function pass. b = transfer(add_one([a, a]), b) if (b(1) /= 6) error stop if (b(2) /= 6) error stop end subroutine end module program transfer_16 use transfer_16_mod implicit none call test_transfer_elemental() print *, "All tests passed." end program lfortran-0.63.0/integration_tests/functions_31.f900000664000175000017500000000121615174404631022220 0ustar alastairalastairprogram function_31 integer :: x(2,3) = reshape([1, 2, 3, 4, 5, 6], [2,3]) call func(x) contains subroutine func(x) integer, intent(in) :: x(:, :) integer :: y2(size(x, 2), size(x, 1) + 1) y2 = reshape([allocate_return_type_func(x), x(1,:)], shape(y2)) print *, y2 if(any(y2(:, 1) /= [1,2,3]) .or. any(y2(:, 2) /= [4,5,6]) .or. any(y2(:, 3) /= [1,3,5])) error stop end subroutine function allocate_return_type_func(x) result(z) integer, intent(in) :: x(:, :) integer, allocatable :: z(:, :) allocate(z(size(x,1), size(x,2))) z = x end function end program lfortran-0.63.0/integration_tests/arrays_42.f900000664000175000017500000000077315174404631021522 0ustar alastairalastairmodule module_arrays_42 contains function var_2_iint8_dp(x, dim) result(res) use iso_fortran_env, only: dp => real64 integer, intent(in) :: x(:,:) integer, intent(in) :: dim real(dp) :: res res = sum(sum(real(x, dp), dim)) end function var_2_iint8_dp end module program arrays_42 use module_arrays_42 use iso_fortran_env, only: dp => real64 integer :: x(3,3) = reshape([1,2,3,4,5,6,7,8,9], [3,3]) real(dp) :: res res = var_2_iint8_dp(x, 1) print *, res if (abs(res - 45.0) > 1e-16) error stop end program lfortran-0.63.0/integration_tests/submodule_22.f900000664000175000017500000000200215174404631022201 0ustar alastairalastairmodule submodule_22_mod implicit none interface pure module function separated_values(separator, mold) result(format_string) character(len=*), intent(in) :: separator class(*), intent(in) :: mold(..) character(len=:), allocatable :: format_string end function end interface end module submodule_22_mod submodule(submodule_22_mod) submodule_22_sub implicit none contains pure module function separated_values(separator, mold) result(format_string) character(len=*), intent(in) :: separator class(*), intent(in) :: mold(..) character(len=:), allocatable :: format_string format_string = "(*(G25.20,:,'" // separator // "'))" end function end submodule submodule_22_sub program submodule_22 use submodule_22_mod implicit none character(len=100) :: output real, parameter :: vals(*) = [1.0, 2.0, 3.0] write(output, fmt=separated_values(separator=",", mold=[real::])) vals if (len_trim(output) == 0) error stop print *, trim(output) end program submodule_22 lfortran-0.63.0/integration_tests/intrinsics_374.f900000664000175000017500000000162215174404631022470 0ustar alastairalastairprogram intrinsics_370 implicit none integer :: input(6, 9) character(len=2) :: str_arr(2, 2) integer, dimension(2) :: result input = reshape([& 1, 2, 3, 4, 5, 7, 8, 9, 10, & 11, 12, 13, 14, 7, 16, 17, 18, 19, & 21, 22, 7, 24, 25, 26, 27, 28, 29, & 31, 32, 33, 34, 35, 36, 37, 38, 39, & 41, 42, 43, 44, 45, 46, 7, 48, 49, & 51, 52, 53, 54, 55, 56, 57, 58, 7], [6, 9]) str_arr = reshape(["aa", "bb", "cc", "aa"], [2, 2]) result = findloc(input, 7) print *, result if (any(result /= [6, 1])) error stop result = findloc(input, 34) print *, result if (any(result /= [1, 6])) error stop result = findloc(input, 7, back=.true.) print *, result if (any(result /= [6, 9])) error stop result = findloc(str_arr, "cc") print *, result if (any(result /= [1, 2])) error stop end program lfortran-0.63.0/integration_tests/intrinsics_375.f900000664000175000017500000000062515174404631022473 0ustar alastairalastairsubroutine sub() character(len=:), allocatable :: buffer character(:), allocatable :: dummy allocate(character((5)) :: dummy) dummy = "12345" call move_alloc( dummy, buffer ) print *, allocated(buffer) print *, buffer if (allocated(buffer) .neqv. .true.) error stop if (buffer /= "12345") error stop end subroutine program intrinsics_375 call sub() end programlfortran-0.63.0/integration_tests/print_11.f900000664000175000017500000000036315174404631021344 0ustar alastairalastairprogram print_11 implicit none character(50) :: out write(out, *) '"', '?', '"' if (trim(adjustl(out)) /= '"?"') error stop write(out, *) 'A', 'B', 'C' if (trim(adjustl(out)) /= 'ABC') error stop end program print_11 lfortran-0.63.0/integration_tests/array_slice_02.f900000664000175000017500000000135315174404631022505 0ustar alastairalastairprogram array_slice_02 implicit none integer(1) :: decoder_txt(10) = (/97, 98, 99, 65, 66, 100, 67, 69, 70, 71/) integer :: start, end character(:), allocatable :: txt start = 3 end = 8 if( lbound(decoder_txt(start:end), 1) /= 1 ) error stop if( ubound(decoder_txt(start:end), 1) /= end - start + 1 ) error stop txt = c2s(decoder_txt(start:end)) print *, txt if( txt /= 'cABdCE' ) error stop contains function c2s(x) result(y) integer(1), intent(in) :: x(:) character(:), allocatable :: y integer :: i print *, lbound(x, 1), ubound(x, 1), size(x) if( lbound(x, 1) /= 1 ) error stop if( ubound(x, 1) /= size(x) ) error stop allocate(character(size(x)) :: y) do i = 1, size(x) y(i:i) = char(int(x(i), 4)) end do end function end program lfortran-0.63.0/integration_tests/realloc_lhs_21.f900000664000175000017500000000105515174404631022477 0ustar alastairalastairprogram realloc_lhs_21 implicit none character(len=100), allocatable :: dst(:) character(len=:), allocatable :: src(:) allocate(character(len=10) :: src(1)) src(1) = "world" ! Assigning a deferred-length character array to a fixed-length allocatable ! character array should allocate dst with len=100, not len=10. dst = src if (len(dst(1)) /= 100) error stop if (trim(dst(1)) /= "world") error stop ! Reading twice ensures no heap corruption from undersized allocation if (trim(dst(1)) /= "world") error stop print *, "PASSED" end program realloc_lhs_21 lfortran-0.63.0/integration_tests/template_travel_01b.f900000664000175000017500000000432015174404631023536 0ustar alastairalastairmodule template_travel_01b_m implicit none private public :: travel_tmpl, test_template requirement operation(A, B, C, op) type, deferred :: A type, deferred :: B type, deferred :: C pure function op(l, r) result(res) type(A), intent(in) :: l type(B), intent(in) :: r type(C) :: res end function end requirement template travel_tmpl(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) require :: operation(D, D, D, plus_D) require :: operation(T, T, T, plus_T) require :: operation(D, T, S, D_divided_by_T) require :: operation(D, S, T, D_divided_by_S) private public :: avg_S_from_T, avg_S_from_S contains pure function avg_S_from_T(d1, t1, d2, t2) result(avg) type(D), intent(in) :: d1, d2 type(T), intent(in) :: t1, t2 type(S) :: avg avg = D_divided_by_T(plus_D(d1, d2), plus_T(t1, t2)) end function pure function avg_S_from_S(d1, s1, d2, s2) result(avg) type(D), intent(in) :: d1, d2 type(S), intent(in) :: s1, s2 type(S) :: avg avg = avg_S_from_T(d1, D_divided_by_S(d1, s1), d2, D_divided_by_S(d2, s2)) end function end template contains subroutine test_template() instantiate travel_tmpl(real, real, real, operator(+), operator(+), operator(/), operator(/)), & only: avg_real_S_from_T => avg_S_from_T, avg_real_S_from_S => avg_S_from_S instantiate travel_tmpl(integer, integer, integer, operator(+), operator(+), operator(/), operator(/)), & only: avg_integer_S_from_T => avg_S_from_T, avg_integer_S_from_S => avg_S_from_S real :: s1, s2 integer :: i1, i2 s1 = avg_real_S_from_T(1.0, 3.0, 1.5, 4.0) s2 = avg_real_S_from_S(1.1, s1, 2.0, s1) i1 = avg_integer_S_from_T(1, 3, 20, 4) i2 = avg_integer_S_from_S(1, i1, 15, i1) print *, "s1=", s1 print *, "s2=", s2 print *, "i1=", i1 print *, "i2=", i2 end subroutine end module program template_travel_01b use template_travel_01b_m implicit none call test_template() end programlfortran-0.63.0/integration_tests/intrinsics_74.f900000664000175000017500000000063115174404631022404 0ustar alastairalastairprogram intrinsics_74 implicit none real :: x(1,2) x = 0 print *, x ! 0.0 floating point number is exact, we can compare it directly in here, ! this makes the test robust, since we do not know what random number we get (can be very small) if (x(1,1) /= 0.0) error stop if (x(1,2) /= 0.0) error stop call random_number(x(1,2)) print *, x if (x(1,1) /= 0.0) error stop if (x(1,2) == 0.0) error stop end program lfortran-0.63.0/integration_tests/nested_15.f900000664000175000017500000000110015174404631021464 0ustar alastairalastairmodule nested_15_mod type :: child character(:), allocatable :: value logical :: par = .true. end type child contains subroutine temp_sub(model) type(child), intent(inout) :: model call nested_sub() contains subroutine nested_sub() if (.not. model%par) error stop if (model%value /= "Hello") error stop end subroutine end subroutine end module program nested_15 use nested_15_mod type(child) :: model model%value = "Hello" call temp_sub(model) end program nested_15lfortran-0.63.0/integration_tests/nested_external_dedup_01.f900000664000175000017500000000063715174404631024560 0ustar alastairalastairprogram nested_external_dedup_01 implicit none call outer() contains subroutine outer() integer :: a a = 0 call inner1() call inner2() contains subroutine inner1() a = a + 1 end subroutine inner1 subroutine inner2() a = a + 2 end subroutine inner2 end subroutine outer end program nested_external_dedup_01 lfortran-0.63.0/integration_tests/present_07.f900000664000175000017500000000155015174404631021674 0ustar alastairalastairmodule present_07_mod abstract interface subroutine my_fun(x) real, intent(in) :: x end subroutine my_fun end interface contains subroutine with_fun(sub) procedure(my_fun), optional :: sub if (present(sub)) error stop "Expected not present" end subroutine subroutine with_fun_present(sub) procedure(my_fun), optional :: sub if (.not. present(sub)) error stop "Expected present" end subroutine subroutine real_sub(x) real, intent(in) :: x end subroutine end module present_07_mod program present_07 use present_07_mod procedure(my_fun), pointer :: ptr_null => null() procedure(my_fun), pointer :: ptr_assoc ptr_assoc => real_sub call with_fun() call with_fun(sub=ptr_null) call with_fun_present(sub=ptr_assoc) call with_fun_present(sub=real_sub) print *, "PASS" end program present_07 lfortran-0.63.0/integration_tests/intrinsics_26.f900000664000175000017500000000110115174404631022372 0ustar alastairalastairmodule stdlib_bitsets_64 implicit none contains logical function all_set(x, num_bits) result(res) integer, intent(in) :: x integer, intent(in) :: num_bits logical, intrinsic :: btest integer :: pos res = .true. do pos = 0, num_bits - 1 if ( .not. btest(x, pos) ) then res = .false. end if end do end function all_set end module program intrinsics_26 use stdlib_bitsets_64, only : all_set implicit none integer :: i = 31 print *, all_set(i, 5) end programlfortran-0.63.0/integration_tests/read_62.f900000664000175000017500000000042315174404631021126 0ustar alastairalastairprogram read_62 use iso_fortran_env, only: dp => real64 implicit none character(10) :: s real(dp) :: x s = '12345D+01' read(s, '(f10.5)') x if (abs(x - 1.2345_dp) > 1.0e-12_dp) error stop 'f10.5 + D exponent parsing failed' end program read_62 lfortran-0.63.0/integration_tests/intrinsics_278.f900000664000175000017500000000206515174404631022475 0ustar alastairalastairprogram intrinsics_278 use iso_fortran_env, only: dp => real64, sp => real32 implicit none real, parameter :: x = tiny(1.0) real (kind = dp) :: b real (kind = dp), parameter :: y = tiny(b) real, parameter :: z = tiny([1.0_sp, 2.0_sp]) real(sp) :: r1 = 2.3_sp real(dp) :: r2 = 4.5_dp real(sp) :: ar1(3) = [1.0_sp, 2.0_sp, 3.0_sp] real(dp) :: ar2(3) = [4.0_dp, 5.0_dp, 6.0_dp] print*, x if (abs(x - 1.17549435e-38_sp) > 1e-6_sp) error stop print*, y if (abs(y - 2.2250738585072014e-308_dp) > 1e-6_dp) error stop print*, z if (abs(z - 1.17549435e-38_sp) > 1e-6_sp) error stop print*, tiny(r1) if (abs(tiny(r1) - 1.17549435e-38_sp) > 1e-6_sp) error stop print*, tiny(r2) if (abs(tiny(r2) - 2.2250738585072014e-308_dp) > 1e-6_dp) error stop print*, tiny(ar1) if (abs(tiny(ar1) - 1.17549435e-38_sp) > 1e-6_sp) error stop print*, tiny(ar2) if (abs(tiny(ar2) - 2.2250738585072014e-308_dp) > 1e-6_dp) error stop print *, kind(tiny(1.0)) print *, kind(tiny(1.0_dp)) end program lfortran-0.63.0/integration_tests/intrinsics_150.f900000664000175000017500000000472715174404631022471 0ustar alastairalastairprogram intrinsic_150 integer :: a,b integer(8) :: c, d integer(8) :: result integer :: i integer(4) :: arg_x(5) = [12, 11, 18, 20, 30] integer(8) :: arg_x2(5) = [33, 48, 58, 55, 54] integer(4) :: res_x(5) integer(8) :: res_x2(5) integer(4), parameter :: res(5) = maskr([12, 11, 18, 20, 30]) integer(8), parameter :: res2(5) = maskr([33, 48, 58, 55, 54],8) integer(4) :: expected_res(5) = [4095, 2047, 262143, 1048575, 1073741823] integer(8) :: expected_res2(5) = [8589934591_8, 281474976710655_8, 288230376151711743_8, & 36028797018963967_8, 18014398509481983_8] integer(4), parameter :: comp1 = maskr(12) integer(8), parameter :: comp2 = maskr(43, 8) print *, comp1 if (comp1 /= 4095) error stop print *, comp2 if (comp2 /= 8796093022207_8) error stop res_x = maskr(arg_x) res_x2 = maskr(arg_x2, 8) do i = 1, size(res) print *, res(i) if (res(i) /= expected_res(i)) error stop end do do i = 1, size(res2) print *, res2(i) if (res2(i) /= expected_res2(i)) error stop end do do i = 1, size(res_x) print *, res_x(i) if (res_x(i) /= expected_res(i)) error stop end do do i = 1, size(res_x2) print *, res_x2(i) ! if (res_x2(i) /= expected_res2(i)) error stop end do a = 10 b = 31 c = 63 d = 54 result = maskr(10) print *, result if (result /= 1023) error stop result = maskr(31) print *, result if (result /= 2147483647) error stop result = maskr(63, 8) print *, result if (result /= 9223372036854775807_8) error stop result = maskr(54, 8) print *, result if (result /= 18014398509481983_8) error stop result = maskr(a) print *, result if (result /= 1023) error stop result = maskr(b) print *, result if (result /= 2147483647) error stop result = maskr(c, 8) print *, result if (result /= 9223372036854775807_8) error stop result = maskr(d, 8) print *, result if (result /= 18014398509481983_8) error stop result = maskr(10,8) print *, kind(result) if (kind(result) /= 8) error stop print *, kind(maskr(10,8)) if (kind(maskr(10,8)) /= 8) error stop print *, kind(maskr(10)) if (kind(maskr(10)) /= 4) error stop print *, kind(maskr(a,4)) if (kind(maskr(a,4)) /= 4) error stop print *, kind(maskr(a,8)) if (kind(maskr(a,8)) /= 8) error stop end program lfortran-0.63.0/integration_tests/reserved_01.f900000664000175000017500000000045415174404631022027 0ustar alastairalastairprogram reserved_01 implicit none if (end(1, 2) /= 2) error stop if (end(2, 1) /= 2) error stop contains integer function end(return,& integer)result(function);;;;& integer integer,return;;;;;;& ;;function=return;if(return>& integer)return;;;;;function=& integer;;end function end;;;; end program lfortran-0.63.0/integration_tests/conv_complex2real.f900000664000175000017500000000015215174404631023325 0ustar alastairalastairprogram conv_complex2real complex Z real x Z = (3.0, 4.0) X=DBLE(Z) if (abs(X-3.0) > 1e-5) error stop end lfortran-0.63.0/integration_tests/subroutines_14.f900000664000175000017500000000073315174404631022576 0ustar alastairalastairsubroutine check_logical(expression) logical, intent(in) :: expression print *, expression if (.not. expression) error stop end subroutine check_logical subroutine test_trueloc_empty() real, allocatable :: avec(:), bvec(:) allocate(avec(10)) allocate(bvec(10)) avec = 0 bvec = 0 call check_logical(all(bvec == avec)) end subroutine test_trueloc_empty program subroutines_14 call test_trueloc_empty() end program lfortran-0.63.0/integration_tests/arrays_57.f900000664000175000017500000000107615174404631021525 0ustar alastairalastairprogram arrays_57 real :: A(2,2) = reshape([1.0,2.0,3.0,4.0], [2,2]) call trans(A) print *, A if ( any(abs( A - 12.91 ) > 1e-6) ) error stop call trans_2(A) print *, A if ( any(abs( A - 12.91 ) > 1e-6) ) error stop contains subroutine trans(A) real, intent(inout) :: A(2, 2) A = matprod(transpose(A)) end subroutine subroutine trans_2(A) real, intent(inout) :: A(2, 2) integer, parameter :: x = 2 A = matprod(abs(A(1:x,:))) end subroutine function matprod(x) result(k) real,intent(in) :: x(:,:) real :: k(size(x, 1), size(x, 2)) k = 12.91 end function end program lfortran-0.63.0/integration_tests/gpu_metal_140.f900000664000175000017500000000116015174404631022244 0ustar alastairalastairprogram gpu_metal_140 ! Test: type-bound procedure in a submodule called from do concurrent ! with --gpu=metal --separate-compilation. Verifies that the Metal ! shader includes the submodule function body for struct methods. use gpu_metal_140_m, only: transform_t implicit none type(transform_t) :: t real :: x(4), y(4) integer :: i x = [1.0, 2.0, 3.0, 4.0] y = 0.0 do concurrent (i = 1:4) block y(i) = t%apply(x(i)) end block end do print *, y if (abs(y(1) - 2.0) > 1e-6) error stop if (abs(y(2) - 4.0) > 1e-6) error stop if (abs(y(3) - 6.0) > 1e-6) error stop if (abs(y(4) - 8.0) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/class_52.f900000664000175000017500000000075715174404631021331 0ustar alastairalastairmodule class_52_m type, abstract :: AbsType integer :: n = 10 end type AbsType type, extends(AbsType) :: MyType end type MyType interface MyType procedure :: init end interface MyType contains function init() result(self) type(MyType) :: self self%n = 44 end function init end module class_52_m program class_52 use class_52_m class(AbsType), allocatable :: obj obj = MyType() if (obj%n /= 44) error stop end program class_52 lfortran-0.63.0/integration_tests/double_complex_01.f900000664000175000017500000000011115174404631023177 0ustar alastairalastairdouble complex function wzdtoc() end function program main end program lfortran-0.63.0/integration_tests/intrinsics_244.f900000664000175000017500000000263715174404631022473 0ustar alastairalastairprogram intrinsics_244 integer, parameter :: x1(4) = cshift([1, 2, 3, 4], 2) real, parameter :: y1(4) = cshift([1.0, 2.0, 3.0, 4.0], -2) logical, parameter :: z1(4) = cshift([.true., .false., .true., .false.], -1) character(len=2), parameter :: c1(4) = cshift(["ab", "bc", "cd", "de"], 2) integer :: x(4) = [1, 2, 3, 4] real :: y(4) = [1.0, 2.0, 3.0, 4.0] logical :: z(4) = [.true., .false., .true., .false.] character(len=2) :: c(4) = ["ab", "bc", "cd", "de"] integer :: shift(4) = [1, -2, -3, 2] integer :: shift_val = -2 print*, cshift(x, shift(1)) if (any(cshift(x, shift(1)) /= [2, 3, 4, 1])) error stop print*, cshift(y, shift(2)) if (any(cshift(y, shift(2)) /= [3.0, 4.0, 1.0, 2.0])) error stop print*, cshift(z, shift(3)) if (any(cshift(z, shift(3)) .neqv. [.false., .true., .false., .true.])) error stop print*, cshift(c, shift(4)) if (any(cshift(c, shift(4)) /= ["cd", "de", "ab", "bc"])) error stop print*, x1 if (any(x1 /= [3, 4, 1, 2])) error stop print*, y1 if (any(y1 /= [3.0, 4.0, 1.0, 2.0])) error stop print*, z1 if (z1(1) .neqv. .false. .or. z1(2) .neqv. .true. .or. z1(3) .neqv. .false. .or. z1(4) .neqv. .true.) error stop print *, cshift(x, shift_val) if (any(y1 /= [3.0, 4.0, 1.0, 2.0])) error stop print *, shift_val if (shift_val /= -2) error stop ! print*, c1 ! gives segfault end program lfortran-0.63.0/integration_tests/intrinsics_75.f900000664000175000017500000000035615174404631022411 0ustar alastairalastairprogram intrinsics_75 implicit none real(8) :: lambda = 1.123 real(8) :: x(10) integer :: i_max = 2 x = 23. print *, exp(-lambda * (x(i_max:i_max+4)-x(1))) if( any(exp(-lambda * (x(i_max:i_max+4)-x(1))) /= 1.0) ) error stop end program lfortran-0.63.0/integration_tests/intrinsics_415.f900000664000175000017500000000053615174404631022467 0ustar alastairalastairprogram intrinsics_415 real(4) :: x(5) = [1.0, 2.0, 3.0, 4.0, 5.0] integer :: y(5) = [1, 2, 3, 4, 5] if (abs(sum(x, mask = .true.) - 15.0) > 1e-6) error stop if (sum(y, mask = .true.) /= 15) error stop if (abs(product(x, mask = .true.) - 120.0) > 1e-6) error stop if (product(y, mask = .true.) /= 120) error stop end program lfortran-0.63.0/integration_tests/pointer_16.f900000664000175000017500000000040715174404631021674 0ustar alastairalastairprogram pointer_16 implicit none class(*), pointer :: ptr call ss(ptr) contains subroutine ss(xx) class(*), pointer :: xx character(len=10), pointer :: ii allocate(ii) xx => ii deallocate(ii) end subroutine ss end program lfortran-0.63.0/integration_tests/intrinsics_135.f900000664000175000017500000000526515174404631022472 0ustar alastairalastairprogram intrinsics_133 real :: w = -5.1 real :: x = 5.8 real :: y = 6.0 real :: z = -5.8 double precision :: v = 1e12_8 integer(kind = 4) :: res_4 integer(kind = 8) :: res_8 integer, parameter :: x1 = nint(1.0) integer, parameter :: x2 = nint(1.21_8) integer, parameter :: ar1(3) = nint([91.0, 21.20, 33.10]) integer, parameter :: ar2(3) = nint([91.0, 21.20, 33.10], 8) real(4) :: arr1(3) = [91.0, 21.20, 33.10] real(8) :: arr2(3) = [91.0, 21.20, 33.10] print *, x1 if (x1 /= 1) error stop print *, x2 if (x2 /= 1) error stop print *, ar1 if (any(ar1 /= [91, 21, 33])) error stop print *, ar2 if (any(ar2 /= [91, 21, 33])) error stop print *, nint(arr1) if (any(nint(arr1) /= [91, 21, 33])) error stop print *, nint(arr2, 8) if (any(nint(arr2, 8) /= [91, 21, 33])) error stop res_4 = nint(w) print *, res_4 if (res_4 /= -5) error stop res_8 = nint(w, 8) print *, res_8 if (res_8 /= -5) error stop res_4 = nint(w, 4) print *, res_4 if (res_4 /= -5) error stop res_4 = nint(x) print *, res_4 if (res_4 /= 6) error stop res_8 = nint(x, 8) print *, res_8 if (res_8 /= 6) error stop res_4 = nint(x, 4) print *, res_4 if (res_4 /= 6) error stop res_4 = nint(y) print *, res_4 if (res_4 /= 6) error stop res_8 = nint(y, 8) print *, res_8 if (res_8 /= 6) error stop res_4 = nint(y, 4) print *, res_4 if (res_4 /= 6) error stop res_4 = nint(z) print *, res_4 if (res_4 /= -6) error stop res_8 = nint(z, 8) print *, res_8 if (res_8 /= -6) error stop res_4 = nint(z, 4) print *, res_4 if (res_4 /= -6) error stop res_4 = nint(5.8) print *, res_4 if (res_4 /= 6) error stop res_8 = nint(5.8, 8) print *, res_8 if (res_8 /= 6) error stop res_4 = nint(6.00, 8) print *, res_4 if (res_4 /= 6) error stop res_8 = nint(6.00, 8) print *, res_8 if (res_8 /= 6) error stop res_4 = nint(0.0) print *, res_4 if (res_4 /= 0) error stop res_8 = nint(0.0, 8) print *, res_8 if (res_8 /= 0) error stop res_4 = nint(-412.124) print *, res_4 if (res_4 /= -412) error stop res_8 = nint(-412.124, 8) print *, res_8 if (res_8 /= -412) error stop res_4 = nint(-412.00) print *, res_4 if (res_4 /= -412) error stop res_8 = nint(-412.00, 8) print *, res_8 if (res_8 /= -412) error stop res_8 = nint(1e12_8, 8) print *, res_8 if (res_8 /= 1000000000000_8) error stop res_8 = nint(v, 8) print *, res_8 if (res_8 /= 1000000000000_8) error stop end program lfortran-0.63.0/integration_tests/intent_out_allocatable_component_dealloc.f900000664000175000017500000000140715174404631030167 0ustar alastairalastairmodule intent_out_allocatable_component_dealloc_m implicit none type :: container_t integer, allocatable :: a(:) end type container_t contains subroutine set_zero_len(x) integer, allocatable, intent(out) :: x(:) if (allocated(x)) error stop 1 allocate(x(0)) end subroutine set_zero_len end module intent_out_allocatable_component_dealloc_m program intent_out_allocatable_component_dealloc use intent_out_allocatable_component_dealloc_m, only: container_t, set_zero_len implicit none type(container_t) :: c allocate(c%a(2)) c%a = [1, 2] call set_zero_len(c%a) if (.not. allocated(c%a)) error stop 2 if (size(c%a) /= 0) error stop 3 end program intent_out_allocatable_component_dealloc lfortran-0.63.0/integration_tests/modules_65_child.f900000664000175000017500000000030615174404631023031 0ustar alastairalastairmodule modules_65_child use modules_65_base, only: base_t implicit none type, extends(base_t) :: child_t integer :: extra = 42 end type child_t end module modules_65_child lfortran-0.63.0/integration_tests/openmp_69.f900000664000175000017500000000072715174404631021527 0ustar alastairalastairprogram openmp_69 use omp_lib implicit none integer :: flags(4) integer :: i flags = 0 !$omp parallel num_threads(4) private(i) i = omp_get_thread_num() !$omp critical flags(i+1) = 1 !$omp end critical !$omp end parallel do i = 1, 4 if (flags(i) /= 1) then print *, 'Error: Thread ', i-1, ' did not execute!' error stop end if end do print *, 'Test passed: num_threads(', 4, ') used correctly.' end program openmp_69 lfortran-0.63.0/integration_tests/struct_type_04.f900000664000175000017500000000037615174404631022603 0ustar alastairalastairprogram struct_type_04 implicit none type :: stone integer :: value = 2 end type stone type(stone),dimension(:),allocatable :: s allocate(s(2)) print* , s%value print* , sum(s%value) if (sum(s%value) /= 4) error stop end programlfortran-0.63.0/integration_tests/functions_54.f900000664000175000017500000000222115174404631022222 0ustar alastairalastairmodule mod_functions_54 implicit none type,public :: string character(len=:),allocatable :: str end type string contains elemental function string_to_int(me) result(i) class(string),intent(in) :: me integer :: i i = len(me%str) end function string_to_int function split(str,token) result(vals) implicit none character(len=*),intent(in) :: str character(len=*),intent(in) :: token type(string),dimension(:),allocatable :: vals allocate(vals(1)) vals(1)%str = str end function split function parse_nums64(line) result(ints) character(len=*),intent(in) :: line integer(4),dimension(:), allocatable :: ints type(string),dimension(:),allocatable :: vals ints = string_to_int(split(line, ' ')) end function parse_nums64 end module mod_functions_54 program functions_54 use mod_functions_54 character(len=100) :: single_line integer(4), allocatable :: results(:) single_line = "10 20 30" results = parse_nums64(single_line) print *, results if (results(1) /= 100) error stop end program functions_54lfortran-0.63.0/integration_tests/do_concurrent_12.f900000664000175000017500000000127215174404631023055 0ustar alastairalastair! equivalent to openmp_30.f90 subroutine matrix_multiplication(l, m, n) use omp_lib integer, parameter :: dp = kind(0.d0) integer :: l, m, n, i, j, k integer :: seed real(dp) :: a(l, n), b(l, m), c(m, n) real(dp) :: start_time, end_time seed = 123456789 b = 121.124D0 c = 29124.012D0 do concurrent (j = 1:n) shared(a, b, c, l, m, n) local(i, k) do concurrent (i = 1:l) a(i,j) = 0 do concurrent (k = 1:m) a(i,j) = a(i,j) + b(i,k) * c(k,j) end do end do end do print *, "sum(a): ", sum(a) if (abs(sum(a) - (4.40952103686020386e+11_dp)) > 1e-12_dp) error stop end subroutine program do_concurrent_12 call matrix_multiplication(50, 50, 50) end program lfortran-0.63.0/integration_tests/complex_dp_param.f900000664000175000017500000000034015174404631023214 0ustar alastairalastairprogram complex_dp_param integer, parameter :: prec1 = 4, prec2 = 8 complex(prec1) :: u = (1.05, 1.05) complex(prec2) :: v = (1.05, 1.05_8) complex(prec2) :: zero = 0.0_4 print *, u, v, zero end programlfortran-0.63.0/integration_tests/test_inquire_size.f900000664000175000017500000000065015174404631023453 0ustar alastairalastairprogram test_inquire_size implicit none integer :: fh integer :: length character(*), parameter :: test_lines = 'build.f90' open(newunit=fh, file="test_inquire_size_test.txt", access="stream", form='unformatted', status='replace') write(fh) test_lines inquire(fh, size=length) close(fh) print *, "File size =", length, "bytes" if(length /= 9) error stop end program test_inquire_size lfortran-0.63.0/integration_tests/format_57.f900000664000175000017500000000200615174404631021506 0ustar alastairalastair program format_57 implicit none integer,parameter:: sp = kind(1e0), dp = kind(1d0),& sep = selected_real_kind(precision(1.0_dp)+1),& ep = merge(sep,dp,sep>0) real(sp),parameter:: xsp = 1 real(dp),parameter:: xdp = 1 real(ep),parameter:: xep = 1 write(*,"(A)") 'kind sp dp ep' write(*,"(A,3(E12.3E4))")'epsilon:',epsilon(xsp),epsilon(xdp),epsilon(xep) write(*,"(A,3(E12.3E4))")'tiny :', tiny(xsp), tiny(xdp), tiny(xep) write(*,"(A,3(E12.3E4))")'huge :', huge(xsp), huge(xdp), huge(xep) write(*,"(A,3(ES11.2E4))")'epsilon:',epsilon(xsp),epsilon(xdp),epsilon(xep) write(*,"(A,3(ES11.2E4))")'tiny :', tiny(xsp), tiny(xdp), tiny(xep) write(*,"(A,3(ES11.2E4))")'huge :', huge(xsp), huge(xdp), huge(xep) print "(A,E 0.5,A)", '"',2/9.0d200,'"' print "(A,E12.5,A)", '"',2/9.0d200,'"' print "(A,ES 0.5,A)", '"',2/9.0d200,'"' print "(A,ES12.5,A)", '"',2/9.0d200,'"' end program format_57 lfortran-0.63.0/integration_tests/complex_06.f900000664000175000017500000000040215174404631021655 0ustar alastairalastairprogram complex_06 implicit none real, parameter :: a = 3.0, b = 4.0 complex, parameter :: i_ = (0, 1) complex, parameter :: z = a + i_*b real, parameter :: x = z real, parameter :: y = real(z) real, parameter :: w = aimag(z) print *, x, y, w end program lfortran-0.63.0/integration_tests/gpu_metal_154.f900000664000175000017500000000141515174404631022254 0ustar alastairalastairprogram gpu_metal_154 ! Test: ArrayBound UBound for assumed-shape 2D array inside do concurrent. ! Verifies that array section x(:,i) on a 2D assumed-shape argument ! correctly resolves per-dimension sizes in GPU kernels. implicit none real :: x(3, 2) integer :: i, j x = 2.0 call compute(x) ! After compute, x should be unchanged (copy to self) do j = 1, 2 do i = 1, 3 if (abs(x(i,j) - 2.0) > 1.0e-6) error stop end do end do ! Test with a different value x = 5.0 call compute(x) do j = 1, 2 do i = 1, 3 if (abs(x(i,j) - 5.0) > 1.0e-6) error stop end do end do print *, "ok" contains subroutine compute(x) real, intent(inout) :: x(:,:) integer :: i do concurrent (i = 1:2) x(:,i) = x(:,i) end do end subroutine end program lfortran-0.63.0/integration_tests/binop_02.f900000664000175000017500000000145515174404631021322 0ustar alastairalastairprogram binop_02 use iso_fortran_env real(8) :: v integer(2), parameter :: exp_2 = 2 integer(4), parameter :: exp_3 = 3 integer(8), parameter :: exp_4 = 4 logical :: fast = .false. if (index(compiler_options(), '--fast') /= 0) then print *, '--fast is specified, disabling some tests' fast = .true. end if v = 3.733689483637092187962025491287931799888610839_8 print "(es23.16)", v*v print "(es23.16)", v**exp_2 if(v*v /= v**exp_2) error stop print "(es23.16)", v*v*v print "(es23.16)", v**exp_3 if (.not. fast) then if(v*v*v /= v**exp_3) error stop end if print "(es23.16)", v*v*v*v print "(es23.16)", v**exp_4 if (.not. fast) then if(v*v*v*v /= v**exp_4) error stop end if end program binop_02 lfortran-0.63.0/integration_tests/intrinsics_36.f900000664000175000017500000000177315174404631022412 0ustar alastairalastairprogram intrinsics_36 implicit none character(len=25) :: empty = adjustl('') character(len=25) :: all_spaces = adjustl(' ') character(len=25) :: simple = adjustl('gfortran') character(len=25) :: space_at_start = adjustl(' gfortran') character(len=25) :: space_at_end = adjustl('gfortran ') character(len=25) :: space_in_between = adjustl(' g for tran ') character(len=25) :: spaces_with_symbols = adjustl(' # gfor* t $ ran & ') print *, empty if (empty /= '') error stop print *, all_spaces if (all_spaces /= ' ') error stop print *, simple if (simple /= 'gfortran') error stop print *, space_at_start if (space_at_start /= 'gfortran ') error stop print *, space_at_end if (space_at_end /= 'gfortran ') error stop print *, space_in_between if (space_in_between /= 'g for tran ') error stop print *, spaces_with_symbols if (spaces_with_symbols /= '# gfor* t $ ran & ') error stop end program lfortran-0.63.0/integration_tests/matrix_02_matmul.f900000664000175000017500000000076115174404631023075 0ustar alastairalastairprogram matrix_02_matmul implicit none integer :: i, j, k, a(3, 4) real :: b(4, 3), cmat(3, 3), centry a = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], shape(a)) b = reshape([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0], shape(b)) cmat = matmul(a, b) do i = 1, 3 do j = 1, 3 centry = 0 do k = 1, 4 centry = centry + a(i, k) * b(k, j) end do if( cmat(i, j) /= centry ) error stop end do end do end program matrix_02_matmullfortran-0.63.0/integration_tests/allocate_45.f900000664000175000017500000000066215174404631022005 0ustar alastairalastairprogram allocate_45 implicit none character(*), parameter :: fmt = "(A,2(1X,I0))" call test(n=100) call test(n=200) contains subroutine test(n) integer, intent(in) :: n integer, allocatable :: arr(:) allocate(arr(2), source=n) if (arr(1) /= n) error stop if (arr(2) /= n) error stop if (size(arr) /= 2) error stop print fmt, 'subroutine result', arr end subroutine test end program allocate_45 lfortran-0.63.0/integration_tests/custom_operator_18.f900000664000175000017500000000174115174404631023445 0ustar alastairalastairmodule custom_operator_18_mod implicit none interface operator(.pinv.) module procedure pinv_18 end interface contains function pinv_18(a) result(r) real, intent(in) :: a(:,:) real :: r(size(a,2),size(a,1)) integer :: i, j do i = 1, size(a,2) do j = 1, size(a,1) r(i,j) = a(j,i) end do end do end function end module program custom_operator_18 use custom_operator_18_mod, only: operator(.pinv.) implicit none real :: A(3,2), B(2,3) integer :: i, j, k k = 1 do i = 1, 3 do j = 1, 2 A(i,j) = real(k) k = k + 1 end do end do B = .pinv.A ! A = [[1,2],[3,4],[5,6]] ! B (transpose) = [[1,3,5],[2,4,6]] if (abs(B(1,1) - 1.0) > 1e-6) error stop if (abs(B(1,2) - 3.0) > 1e-6) error stop if (abs(B(1,3) - 5.0) > 1e-6) error stop if (abs(B(2,1) - 2.0) > 1e-6) error stop if (abs(B(2,2) - 4.0) > 1e-6) error stop if (abs(B(2,3) - 6.0) > 1e-6) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/string_23.f900000664000175000017500000000031315174404631021514 0ustar alastairalastairprogram string_23 type :: string character(:), allocatable :: s end type type(string) :: z allocate(character(1) :: z%s) z%s(1:1) = "x" print *, z%s(1:1) if (z%s(1:1) /= "x") error stop end program lfortran-0.63.0/integration_tests/openmp_41.f900000664000175000017500000000113315174404631021505 0ustar alastairalastairprogram openmp_41 integer :: i, j, k, res=0, resi=0, resj=0, resk=0 print *,"----","i","j","k" do concurrent (i = 1:4 ,j = 1:3 ,k = 1:2) reduce(+:res,resi,resj,resk) print *, "----" ,i,j,k res=res+1 resi=resi+i resj=resj+j resk=resk+k end do print *,"res = ",res print *,"resi = ",resi print *,"resj = ",resj print *,"resk = ",resk ! Check the result if ( resi /= 60 ) error stop ! (1+2+3+4) * 3 * 2=60 if ( resj /= 48 ) error stop ! (1+2+3) * 4 * 2 = 48 if ( resk /= 36 ) error stop ! (1+2) * 4* 3 = 36 if ( res /= 24 ) error stop ! Total iterations = 4 * 3 * 2 = 24 end programlfortran-0.63.0/integration_tests/array_op_13.f900000664000175000017500000000101315174404631022017 0ustar alastairalastairprogram array_op_13 implicit none integer, parameter :: dp = kind(1.0d0) real(dp) :: c(2,2), r(2) c = 0.0_dp r = f(c, 1) - [1.0, 2.0] print *, r(1), r(2) if (abs(r(1) - (-1.0_dp)) > 1.0e-12_dp) error stop if (abs(r(2) - (-2.0_dp)) > 1.0e-12_dp) error stop contains function f(x, dim) result(res) real(dp), intent(in) :: x(:,:) integer, intent(in) :: dim real(dp) :: res(merge(size(x, 1), size(x, 2), mask=1 real64 implicit none real(dp), parameter :: x1 = dgamma(1.0_dp) real(dp), parameter :: x2 = dgamma(3.14_dp) real(dp), parameter :: x3(2) = dgamma([1.0_dp, 3.14_dp]) real(dp) :: x = 1.0_dp real(dp) :: y = 3.14_dp real(dp) :: z(2) = [1.0_dp, 3.14_dp] print *, x1 if (abs(x1 - 1.0000000000000000_dp) > 1e-12) error stop print *, x2 if (abs(x2 - 2.2844806338178012_dp) > 1e-12) error stop print *, x3 if (any(abs(x3 - [1.0000000000000000_dp, 2.2844806338178012_dp]) > 1e-12)) error stop print *, dgamma(x) if (abs(dgamma(x) - 1.0000000000000000_dp) > 1e-12) error stop print *, dgamma(y) if (abs(dgamma(y) - 2.2844806338178012_dp) > 1e-12) error stop print *, dgamma(z) if (any(abs(dgamma(z) - [1.0000000000000000_dp, 2.2844806338178012_dp]) > 1e-12)) error stop end programlfortran-0.63.0/integration_tests/arrays_67.f900000664000175000017500000000041415174404631021521 0ustar alastairalastairprogram arrays_67 integer :: A(4) = [1,2,3,4] call temp(A) print *, A if (A(1) /= 5) error stop if (A(2) /= 5) error stop contains subroutine temp(A) integer, intent(inout) :: A(:) A([1,2]) = [5,5] end subroutine end programlfortran-0.63.0/integration_tests/intrinsics_255.f900000664000175000017500000000234115174404631022465 0ustar alastairalastairprogram intrinsics_255 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 print*, dbesjn(0, 2.0_dp) if (abs(dbesjn(0, 2.0_dp) - 0.22389077914123567_dp) > 10e-5_dp) error stop print *, dbesjn(1, 1.0_dp) if (abs(dbesjn(1, 1.0_dp) - 0.440050585744933_dp) > 10e-5_dp) error stop print *, dbesjn(2, 7.0_dp) if (abs(dbesjn(2, 7.0_dp) - (-0.30141722008594013_dp)) > 10e-5_dp) error stop print *, dbesjn(3, 0.5_dp) if (abs(dbesjn(3, 0.5_dp) - 2.5637299945872440E-003_dp) > 10e-5_dp) error stop print *, dbesjn(4, -13.6_dp) if (abs(dbesjn(4, -13.6_dp) - 0.14930687731069392_dp) > 10e-5_dp) error stop print *, dbesyn(0, 2.0_dp) if (abs(dbesyn(0, 2.0_dp) - 0.510375672649745_dp) > 10e-5_dp) error stop print *, dbesyn(1, 1.0_dp) if (abs(dbesyn(1, 1.0_dp) - (-0.7812128213002889_dp)) > 10e-5_dp) error stop print *, dbesyn(2, 7.0_dp) if (abs(dbesyn(2, 7.0_dp) - (-6.0526609468272125E-002_dp)) > 10e-5_dp) error stop print *, dbesyn(3, 0.5_dp) if (abs(dbesyn(3, 0.5_dp) - (-42.0594943047238914_dp)) > 10e-5_dp) error stop print *, dbesyn(4, 10.0_dp) if (abs(dbesyn(4, 10.0_dp) - (-1.44949511868093739e-01_dp)) > 10e-5_dp) error stop end programlfortran-0.63.0/integration_tests/string_81.f900000664000175000017500000000055615174404631021531 0ustar alastairalastairmodule string_81_mod implicit none contains subroutine ff() character(10000) :: ss character(10000) :: ss2 ss(1:1) = "a" ! just to use the variable ss2(1:1) = "a" ! just to use the variable end subroutine end module program string_81 use string_81_mod integer :: i do i =0 , 2 call ff() end do end programlfortran-0.63.0/integration_tests/modules_52_module3.f900000664000175000017500000000023715174404631023315 0ustar alastairalastairmodule module_52_tomlf_error type :: toml_error integer :: stat character(len=:), allocatable :: message end type toml_error end module lfortran-0.63.0/integration_tests/arrays_op_16.f900000664000175000017500000000042315174404631022211 0ustar alastairalastairprogram arrays_op_16 implicit none integer:: x(10) = (/1, 2, 3, 4, 5, 6, 7, 8, 9, 10/), i integer, allocatable :: y(:) allocate(y(10)) y(:) = x(:) print *, x, y do i = 1, 10 if( y(i) /= i ) error stop end do end program arrays_op_16 lfortran-0.63.0/integration_tests/selected_int_kind_01.f900000664000175000017500000000310515174404631023653 0ustar alastairalastairsubroutine test_selected_int_kind(R, expected_value) integer :: R, expected_value print *, "selected_int_kind(R) = ", selected_int_kind(R) if (selected_int_kind(R) /= expected_value) error stop end subroutine subroutine test_compile_time_selected_int_kind() print *, selected_int_kind(1) if (selected_int_kind(1) /= 1) error stop print *, selected_int_kind(2) if (selected_int_kind(2) /= 1) error stop print *, selected_int_kind(3) if (selected_int_kind(3) /= 2) error stop print *, selected_int_kind(4) if (selected_int_kind(4) /= 2) error stop print *, selected_int_kind(5) if (selected_int_kind(5) /= 4) error stop print *, selected_int_kind(6) if (selected_int_kind(6) /= 4) error stop print *, selected_int_kind(7) if (selected_int_kind(7) /= 4) error stop print *, selected_int_kind(8) if (selected_int_kind(8) /= 4) error stop print *, selected_int_kind(9) if (selected_int_kind(9) /= 4) error stop print *, selected_int_kind(10) if (selected_int_kind(10) /= 8) error stop print *, selected_int_kind(11) if (selected_int_kind(11) /= 8) error stop end subroutine program selected_int_kind_01 integer :: x x = 1 do while (x < 3) call test_selected_int_kind(x, 1) x = x + 1 end do do while (x < 5) call test_selected_int_kind(x, 2) x = x + 1 end do do while (x < 10) call test_selected_int_kind(x, 4) x = x + 1 end do call test_selected_int_kind(x, 8) call test_compile_time_selected_int_kind() end program lfortran-0.63.0/integration_tests/gpu_metal_144.f900000664000175000017500000000105115174404631022247 0ustar alastairalastairprogram gpu_metal_144 ! Test: do concurrent calling a submodule function whose implementation ! uses a separate module (transitive dependency). With --gpu=metal ! --separate-compilation, the GPU offload pass must load the transitive ! module dependency when resolving the submodule's ExternalSymbol. use gpu_metal_144_m, only : compute implicit none integer :: i, y(4) do concurrent (i = 1:4) y(i) = compute(i) end do print *, y if (y(1) /= 11) error stop if (y(2) /= 12) error stop if (y(3) /= 13) error stop if (y(4) /= 14) error stop end program lfortran-0.63.0/integration_tests/arrays_66.f900000664000175000017500000000146315174404631021525 0ustar alastairalastairprogram arrays_66 real :: Q(8, 8) integer :: i, j do i = 1, 8 do j = 1, 8 Q(i, j) = i*j + i + j + 1 end do end do call qradd_Rdiag(Q, 1) print *, Q(:, 1) if( any(Q(:, 1) /= [4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0]) ) error stop do j = 2, 8 if( any(Q(:, j) /= 1.0) ) error stop end do contains function matprod(Q, G) result(R) real, intent(in) :: Q(:, :), G(:, :) real :: R(size(Q, 1), size(G, 2)) R = 1.0 end function subroutine qradd_Rdiag(Q, n) ! Used in COBYLA ! In-outputs integer(4), intent(in) :: n real(4), intent(inout) :: Q(:, :) ! Q(M, M) integer(4) :: k integer(4) :: m real(4) :: G(2, 2) ! Sizes m = int(size(Q, 2), kind(m)) do k = m - 1_4, n + 1_4, -1 Q(:, [k, k + 1_4]) = matprod(Q(:, [k, k + 1_4]), transpose(G)) end do end subroutine qradd_Rdiag end program lfortran-0.63.0/integration_tests/complex_02.f900000664000175000017500000000026115174404631021654 0ustar alastairalastairprogram complex_02 implicit none complex :: x, z, w, i_ real :: a, b x = (1.0,-3.0) a = 3.0 b = 4.0 i_ = (0, 1) z = a + i_*b w = a+b + i_*(a-b) print *, x, z, w end program lfortran-0.63.0/integration_tests/class_06.f900000664000175000017500000000052215174404631021316 0ustar alastairalastairmodule class_06_mod private type, abstract :: tester contains procedure(testing), deferred, pass :: testing end type tester abstract interface subroutine testing(self) import tester class(tester), intent(inout) :: self end subroutine testing end interface end module program class_06 use class_06_mod end program lfortran-0.63.0/integration_tests/proc_ptr_15.f900000664000175000017500000000126515174404631022046 0ustar alastairalastairprogram proc_ptr_15 implicit none abstract interface function int_func(x) result(r) integer, intent(in) :: x integer :: r end function end interface type :: hybrid_t integer, pointer :: data_ptr => null() procedure(int_func), pointer, nopass :: func_ptr => null() end type type(hybrid_t) :: h integer, target :: val val = 7 h%data_ptr => val h%func_ptr => square if (h%func_ptr(h%data_ptr) /= 49) error stop print *, h%func_ptr(h%data_ptr) contains function square(x) result(r) integer, intent(in) :: x integer :: r r = x * x end function end program lfortran-0.63.0/integration_tests/derived_types_97_mod1.f900000664000175000017500000000057015174404631024014 0ustar alastairalastairmodule derived_types_97_mod1 implicit none type :: point_t integer :: x integer :: y end type point_t interface point_t module procedure point_new end interface point_t contains type(point_t) function point_new() result(p) p%x = 0 p%y = 0 end function point_new end module derived_types_97_mod1 lfortran-0.63.0/integration_tests/bindc2.f900000664000175000017500000000157215174404631021053 0ustar alastairalastairprogram bindc2 use iso_c_binding, only: c_loc, c_ptr, c_f_pointer type(c_ptr) :: queries integer :: idx = 1 integer(2), target :: xv(3, 4) integer :: newshape(2) integer(2), pointer :: x(:, :) newshape(1) = 2 newshape(2) = 3 x => xv if( lbound(xv, 1) /= 1) error stop if( ubound(xv, 1) /= 3) error stop if( lbound(xv, 2) /= 1) error stop if( ubound(xv, 2) /= 4) error stop if( size(xv) /= 12 ) error stop call c_f_pointer(queries, x, newshape) if( lbound(xv, 1) /= 1) error stop if( ubound(xv, 1) /= 3) error stop if( lbound(xv, 2) /= 1) error stop if( ubound(xv, 2) /= 4) error stop if( size(xv) /= 12 ) error stop print *, lbound(x, 1), ubound(x, 1) print *, lbound(x, 2), ubound(x, 2) print *, size(x) if( lbound(x, 1) /= 1) error stop if( ubound(x, 1) /= 2) error stop if( lbound(x, 2) /= 1) error stop if( ubound(x, 2) /= 3) error stop if( size(x) /= 6 ) error stop end program lfortran-0.63.0/integration_tests/forall_03.f900000664000175000017500000000142215174404631021465 0ustar alastairalastairprogram forall_03 implicit none integer :: i, j, k real :: a(3,3) integer :: b(2,3,2) ! Test forall with two control variables a = 0.0 forall(i=1:3, j=1:3) a(i,j) = real(i + j) if (abs(a(1,1) - 2.0) > 1e-6) error stop if (abs(a(2,3) - 5.0) > 1e-6) error stop if (abs(a(3,3) - 6.0) > 1e-6) error stop print *, a ! Test forall with three control variables b = 0 forall(i=1:2, j=1:3, k=1:2) b(i,j,k) = i * 100 + j * 10 + k if (b(1,1,1) /= 111) error stop if (b(2,3,2) /= 232) error stop if (b(1,2,2) /= 122) error stop print *, b ! Test forall with two variables and increment a = 0.0 forall(i=1:3:2, j=1:3) a(i,j) = real(i * j) if (abs(a(1,1) - 1.0) > 1e-6) error stop if (abs(a(3,2) - 6.0) > 1e-6) error stop if (abs(a(2,1) - 0.0) > 1e-6) error stop print *, a end program forall_03 lfortran-0.63.0/integration_tests/class_118.f900000664000175000017500000000167315174404631021412 0ustar alastairalastair! Test extends_type_of with class(*) program class_118 implicit none type :: animal integer :: legs end type animal type, extends(animal) :: dog character(len=20) :: breed end type dog type :: plant integer :: leaves end type plant class(*), allocatable :: a, b, c, d a = dog(legs=4, breed="poodle") b = animal(legs=2) c = dog(legs=4, breed="labrador") d = plant(leaves=5) ! dog extends animal if (.not. extends_type_of(a, b)) error stop ! animal does not extend dog if (extends_type_of(b, a)) error stop ! dog extends dog (same type) if (.not. extends_type_of(a, c)) error stop ! animal extends animal (same type) if (.not. extends_type_of(b, b)) error stop ! dog does not extend plant (unrelated) if (extends_type_of(a, d)) error stop ! plant does not extend animal (unrelated) if (extends_type_of(d, b)) error stop print *, "PASS" end program class_118 lfortran-0.63.0/integration_tests/interface_02.f900000664000175000017500000000062115174404631022145 0ustar alastairalastairmodule interface_02_mod implicit none interface subroutine a1(a) integer, intent(inout) :: a end subroutine end interface interface subroutine a2(a) integer, intent(inout) :: a end subroutine subroutine a3(a) real, intent(inout) :: a end subroutine endinterface end module program interface_02 use interface_02_mod, only: a1, a2, a3 implicit none end program lfortran-0.63.0/integration_tests/save_13.f900000664000175000017500000000225115174404631021146 0ustar alastairalastairprogram save_13 implicit none integer, parameter :: k(5) = [-1, 2, 3, 3, 3], ksize = size(k) integer :: n integer :: diffs1(ksize-1) = [(abs(k(n)-k(n-1)), n=2,ksize)] integer, parameter :: diffs_p(ksize-1) = [(abs(k(n)-k(n-1)), n=2,ksize)] if (diffs1(1) /= 3) error stop if (diffs1(2) /= 1) error stop if (diffs1(3) /= 0) error stop if (diffs1(4) /= 0) error stop if (diffs_p(1) /= 3) error stop if (diffs_p(2) /= 1) error stop if (diffs_p(3) /= 0) error stop if (diffs_p(4) /= 0) error stop call subprogram_save call subprogram_param contains subroutine subprogram_save integer, save :: n, diffs2(ksize-1) = [(abs(k(n)-k(n-1)), n=2,ksize)] if (diffs2(1) /= 3) error stop if (diffs2(2) /= 1) error stop if (diffs2(3) /= 0) error stop if (diffs2(4) /= 0) error stop end subroutine subprogram_save subroutine subprogram_param integer :: i do i = 1, ksize - 1 if (i == 1 .and. diffs_p(i) /= 3) error stop if (i == 2 .and. diffs_p(i) /= 1) error stop if (i == 3 .and. diffs_p(i) /= 0) error stop if (i == 4 .and. diffs_p(i) /= 0) error stop end do end subroutine subprogram_param end program save_13 lfortran-0.63.0/integration_tests/procedure_30.f900000664000175000017500000000062715174404631022204 0ustar alastairalastairprogram procedure_30 implicit none abstract interface function intfc() result(res) class(*), allocatable :: res end function intfc end interface procedure(intfc), pointer :: ptr call set(ptr) if (associated(ptr)) error stop contains subroutine set(ptr) procedure(intfc), pointer :: ptr ptr => null() end subroutine set end program procedure_30 lfortran-0.63.0/integration_tests/arrays_reshape_33.f900000664000175000017500000000164315174404631023226 0ustar alastairalastair! Test: reshape of derived type array with allocatable component ! Ensures reshape does a deep copy (not shallow) of allocatable members. program arrays_reshape_33 implicit none type :: t real, allocatable :: v(:) end type type(t), allocatable :: a(:), b(:,:) allocate(a(2)) a(1)%v = [1.0, 2.0] a(2)%v = [3.0, 4.0] b = reshape(a, [1, 2]) ! Verify reshaped values if (size(b, 1) /= 1) error stop if (size(b, 2) /= 2) error stop if (size(b(1,1)%v) /= 2) error stop if (size(b(1,2)%v) /= 2) error stop if (abs(b(1,1)%v(1) - 1.0) > 1e-6) error stop if (abs(b(1,1)%v(2) - 2.0) > 1e-6) error stop if (abs(b(1,2)%v(1) - 3.0) > 1e-6) error stop if (abs(b(1,2)%v(2) - 4.0) > 1e-6) error stop ! Verify source array is unaffected (deep copy, not shared) a(1)%v(1) = 99.0 if (abs(b(1,1)%v(1) - 1.0) > 1e-6) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/pointer_10.f900000664000175000017500000000105015174404631021661 0ustar alastairalastairprogram pointer_association implicit none type :: box integer, pointer :: n => null() end type class(*), allocatable :: x type(box) :: b integer, pointer :: xp allocate(b%n) b%n = 1 x = b ! polymorphic assignment should preserve pointer association select type (x) type is (box) xp => x%n end select if (.not. associated(xp, b%n)) then print *, "FAIL: pointer not associated with original target" error stop 1 else print *, "test passed" end if deallocate(b%n) end program pointer_associationlfortran-0.63.0/integration_tests/intrinsics_153.f900000664000175000017500000000561315174404631022467 0ustar alastairalastairprogram intrinsics_153 implicit none integer, parameter :: dp = kind(0.d0) integer, parameter :: a1 = dim(11, 31) integer(8), parameter :: a2 = dim(11_8, 31_8) real, parameter :: a3 = dim(11.0, 31.0) real(dp), parameter :: a4 = dim(11.0_dp, 31.0_dp) integer, parameter :: ar1(5) = dim([11, 31, 41, 51, 61], [1, 2, 3, 4, 5]) integer(8), parameter :: ar2(5) = dim([11_8, 31_8, 41_8, 51_8, 61_8], [1_8, 2_8, 3_8, 4_8, 5_8]) real, parameter :: ar3(5) = dim([11.0, 31.0, 41.0, 51.0, 61.0], [1.0, 2.0, 3.0, 4.0, 5.0]) real(dp), parameter :: ar4(5) = dim([11.0_dp, 31.0_dp, 41.0_dp, 51.0_dp, 61.0_dp], [1.0_dp, 2.0_dp, 3.0_dp, 4.0_dp, 5.0_dp]) real :: i,j real(dp) :: x,y integer :: a, b integer(8) :: c, d real(dp) :: res_dp integer :: arr1(4) integer(8) :: arr2(4) real(4) :: arr3(4) real(8) :: arr4(4) i = 30.0 j = 20.0 x = 10.0_dp y = 15.0_dp a = 30 b = 20 c = 10 d = 15 print *, a1 if (a1 /= 0) error stop print *, a2 if (a2 /= 0) error stop print *, a3 if (a3 /= 0.0) error stop print *, a4 if (abs(a4 - (0.0_dp)) > 1e-14_dp) error stop print *, ar1 if (any(ar1 /= [10, 29, 38, 47, 56])) error stop print *, ar2 if (any(ar2 /= [10, 29, 38, 47, 56])) error stop print *, ar3 if (any(abs(ar3 - [10.0, 29.0, 38.0, 47.0, 56.0]) > 1e-7)) error stop print *, ar4 if (any(abs(ar4 - [10.0_dp, 29.0_dp, 38.0_dp, 47.0_dp, 56.0_dp]) > 1e-14_dp)) error stop res_dp = dim(i, j) print *, res_dp if (abs(res_dp - (10.0_dp)) > 1e-14_dp) error stop res_dp = dim(x, y) print *, res_dp if (abs(res_dp - (0.0_dp)) > 1e-14_dp) error stop print *, dim(a, b) if (dim(a, b) /= 10) error stop print *, dim(c, d) if (dim(c, d) /= 0) error stop res_dp = dim(30.0, 20.0) print *, res_dp if (abs(res_dp - (10.0_dp)) > 1e-14_dp) error stop print *, dim(10.0, 15.0) if (abs(dim(10.0, 15.0) - (0.0)) > 1e-7) error stop print *, dim(30, 20) if (dim(30, 20) /= 10) error stop print *, dim(10, 15) if (dim(10, 15) /= 0) error stop print *, kind(dim(30, 20)) if (kind(dim(30, 20)) /= 4) error stop print *, kind(dim(10_8, 15_8)) if (kind(dim(10_8, 15_8)) /= 8) error stop print *, kind(dim(i, j)) if (kind(dim(i, j)) /= 4) error stop print *, kind(dim(a, b)) if (kind(dim(a, b)) /= 4) error stop print *, kind(dim(c, d)) if (kind(dim(c, d)) /= 8) error stop print *, kind(dim(x, y)) if (kind(dim(x, y)) /= 8) error stop arr1 = [33, 12, 31, 4] arr2 = [13_8, 131_8, 3_8, 4_8] arr3 = [41.0, 11.0, 30.0, 3.0] arr4 = [1.0_dp, 3.0_dp, 3.0_dp, 2.0_dp] print *, dim(arr1, arr2) if (any(dim(arr1, arr2) /= [20, 0, 28, 0])) error stop print *, dim(arr3, arr4) if (any(abs(dim(arr3, arr4) - [40.0, 8.0, 27.0, 1.0]) > 1e-7)) error stop end program lfortran-0.63.0/integration_tests/operator_overloading_03.f900000664000175000017500000000271415174404631024437 0ustar alastairalastairmodule operator_overloading_01_overload_comp_m implicit none public operator (>) interface operator (>) module procedure greater_than_inverse end interface interface operator (<) module procedure less_than_inverse end interface contains pure logical function greater_than_inverse(log1, log2) logical, intent (in) :: log1, log2 if( log1 .eqv. .true. .and. log2 .eqv. .false. ) then greater_than_inverse = .true. else greater_than_inverse = .false. end if end function pure logical function less_than_inverse(log1, log2) logical, intent (in) :: log1, log2 if( log1 .eqv. .false. .and. log2 .eqv. .true. ) then less_than_inverse = .true. else less_than_inverse = .false. end if end function pure logical function less_than_overload_use(log1, log2) logical, intent (in) :: log1, log2 less_than_overload_use = log1 < log2 end function end module program operator_overloading_01 use operator_overloading_01_overload_comp_m implicit none logical, parameter :: T = .true., F = .false. print *, "T>T:", T>T ! Yields: F print *, "T>F:", T>F ! Yields: F print *, "F>T:", F>T ! Yields: T print *, "F>F:", F>F ! Yields: F print *, "T 1.0d-12) then error stop "real64 precision lost" end if print *, "3-layer PDT keyword resolution pdt_05 passed." end program pdt_05lfortran-0.63.0/integration_tests/arrays_10_size.f900000664000175000017500000000157715174404631022552 0ustar alastairalastairmodule mod_ext_arrays_10_size real :: ext_var = 0.0 end module module mod_arrays_10_size contains subroutine OBJ(x) real, intent(inout) :: x(:) end subroutine subroutine sub(calfun, yy, xx) use mod_ext_arrays_10_size, only: ext_var procedure(OBJ) :: calfun integer, intent(in) :: yy real, intent(in) :: xx(:) real :: buggy(2*count(xx > 0.0)) real :: buggy2(2*count(xx > ext_var)) real :: buggy3(2*count(xx > -ext_var)) print * , size(buggy) if (size(buggy) /= 6) error stop print * , size(buggy2) if (size(buggy2) /= 4) error stop print * , size(buggy3) if (size(buggy3) /= 8) error stop end subroutine sub end module mod_arrays_10_size program arrays_10_size use mod_arrays_10_size use mod_ext_arrays_10_size real :: xx(5) = [1.1, 2.1, -1.3, 3.4, 0.0] ext_var = 1.1 call sub(OBJ ,2, xx) end program arrays_10_size lfortran-0.63.0/integration_tests/intrinsics_420.f900000664000175000017500000000133515174404631022461 0ustar alastairalastairprogram intrinsics_420 ! Test dble() and float() with array constructor arguments implicit none integer, parameter :: dp = kind(1.0d0) real(dp) :: rhs(5) real :: rhs_f(3) integer :: i rhs = dble([0, 0, 5, 0, 0]) if (abs(rhs(1) - 0.0_dp) > 1e-12_dp) error stop if (abs(rhs(2) - 0.0_dp) > 1e-12_dp) error stop if (abs(rhs(3) - 5.0_dp) > 1e-12_dp) error stop if (abs(rhs(4) - 0.0_dp) > 1e-12_dp) error stop if (abs(rhs(5) - 0.0_dp) > 1e-12_dp) error stop rhs_f = float([1, 2, 3]) if (abs(rhs_f(1) - 1.0) > 1e-6) error stop if (abs(rhs_f(2) - 2.0) > 1e-6) error stop if (abs(rhs_f(3) - 3.0) > 1e-6) error stop print *, "All tests passed." end program intrinsics_420 lfortran-0.63.0/integration_tests/gpu_metal_143.f900000664000175000017500000000132415174404631022251 0ustar alastairalastairmodule gpu_metal_143_m implicit none type :: t real :: s contains procedure :: f end type contains pure real function g(x) real, intent(in) :: x g = x end function pure real function f(self, x) class(t), intent(in) :: self real, intent(in) :: x f = g(x * self%s) end function end module program gpu_metal_143 use gpu_metal_143_m, only: t implicit none type(t) :: o real :: b(4) integer :: i o%s = 2.0 do concurrent(i=1:4) b(i) = o%f(real(i)) end do print *, b(1), b(2), b(3), b(4) if (abs(b(1) - 2.0) > 1e-6) error stop if (abs(b(2) - 4.0) > 1e-6) error stop if (abs(b(3) - 6.0) > 1e-6) error stop if (abs(b(4) - 8.0) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/assumed_rank_01.f900000664000175000017500000000077115174404631022666 0ustar alastairalastairprogram assumed_rank_01 implicit none integer :: a(3) = [1,2,3] integer :: b(2, 2, 1) = reshape([1, 2, 3, 4], [2, 2, 1]) call show(a, 3, 1) call show(b, 4, 3) contains subroutine show(x, expected_size, expected_rank) integer :: x(..) integer, intent(in) :: expected_size, expected_rank if (size(x) /= expected_size) error stop if (rank(x) /= expected_rank) error stop print *, size(x) print *, rank(x) end subroutine end program lfortran-0.63.0/integration_tests/intrinsics_79.f900000664000175000017500000000407015174404631022412 0ustar alastairalastairprogram intrinsics_79 implicit none integer :: x, result ! Test case 1: x = 0 x = 0 result = trailz(x) print *, "Test case 1: trailz(", x, ") = ", result if (result /= 32) error stop "Test case 1 failed" ! Test case 2: x = 1 x = 1 result = trailz(x) print *, "Test case 2: trailz(", x, ") = ", result if (result /= 0) error stop "Test case 2 failed" ! Test case 3: x = 2 x = 2 result = trailz(x) print *, "Test case 3: trailz(", x, ") = ", result if (result /= 1) error stop "Test case 3 failed" ! Test case 4: x = 3 x = 3 result = trailz(x) print *, "Test case 4: trailz(", x, ") = ", result if (result /= 0) error stop "Test case 4 failed" ! Test case 5: x = 4 x = 4 result = trailz(x) print *, "Test case 5: trailz(", x, ") = ", result if (result /= 2) error stop "Test case 5 failed" ! Test case 6: x = 8 x = 8 result = trailz(x) print *, "Test case 6: trailz(", x, ") = ", result if (result /= 3) error stop "Test case 6 failed" ! Test case 7: x = 16 x = 16 result = trailz(x) print *, "Test case 7: trailz(", x, ") = ", result if (result /= 4) error stop "Test case 7 failed" ! Test case 8: x = 2147483647 (maximum 32-bit integer) x = 2147483647 result = trailz(x) print *, "Test case 8: trailz(", x, ") = ", result if (result /= 0) error stop "Test case 8 failed" ! Test case 9: x = -1 (all bits set) x = -1 result = trailz(x) print *, "Test case 9: trailz(", x, ") = ", result if (result /= 0) error stop "Test case 9 failed" ! Test case 10: x = -2147483648 (minimum 32-bit integer) x = -2147483647 result = trailz(x) print *, "Test case 10: trailz(", x, ") = ", result if (result /= 0) error stop "Test case 10 failed" ! Test case 11: x = 1431655765 (1010101010101010101010101010101 in binary) x = 1431655765 result = trailz(x) print *, "Test case 11: trailz(", x, ") = ", result if (result /= 0) error stop "Test case 11 failed" end program intrinsics_79 lfortran-0.63.0/integration_tests/array_section_15.f900000664000175000017500000000053415174404631023056 0ustar alastairalastairprogram array_section_15 implicit none integer, parameter :: k = selected_int_kind(0) integer :: iarray(3,4) iarray(1,1:2) = [bit_size(1_k), huge(1_k)] if (kind(1_k) /= k) error stop if (iarray(1,1) /= bit_size(1_k)) error stop if (iarray(1,2) /= huge(1_k)) error stop print *, kind(1_k), iarray(1,1:2) end program array_section_15 lfortran-0.63.0/integration_tests/string_22.f900000664000175000017500000000062015174404631021514 0ustar alastairalastairprogram test_string_22 implicit none type :: string character(:), allocatable :: s end type type(string) :: a, b a%s = "abc" b = a print *, a%s, b%s if (a%s /= "abc") error stop if (b%s /= "abc") error stop b%s = "xyz" print *, a%s, b%s if (a%s /= "abc") error stop if (b%s /= "xyz") error stop a%s = "def" print *, a%s, b%s if (a%s /= "def") error stop if (b%s /= "xyz") error stop end program lfortran-0.63.0/integration_tests/data_19.f900000664000175000017500000000020015174404631021117 0ustar alastairalastairprogram data_19 implicit none character(6) :: s data s(1:6) / 'hello!'/ if (s /= 'hello!') error stop end program lfortran-0.63.0/integration_tests/gpu_metal_115.f900000664000175000017500000000062315174404631022251 0ustar alastairalastairprogram gpu_metal_115 implicit none integer :: i real :: r(4) r = 0.0 do concurrent(i = 1:4) block real :: a(2, 2) a(1, 1) = real(i) r(i) = a(1, 1) end block end do if (abs(r(1) - 1.0) > 1e-6) error stop if (abs(r(2) - 2.0) > 1e-6) error stop if (abs(r(3) - 3.0) > 1e-6) error stop if (abs(r(4) - 4.0) > 1e-6) error stop print *, "ALL PASSED" end program lfortran-0.63.0/integration_tests/derived_types_65.f900000664000175000017500000000160715174404631023071 0ustar alastairalastairmodule derived_types_65_m implicit none type :: t_date integer :: year, month, day end type type :: t_address character(len=:), allocatable :: city, road_name integer :: house_number end type type :: t_person character(len=:), allocatable :: first_name, last_name, e_mail end type type, extends(t_person) :: t_employee type(t_date) :: hired_date character(len=:), allocatable :: position real :: monthly_salary end type end module derived_types_65_m program derived_types_65 use derived_types_65_m implicit none type(t_employee) :: employee employee%first_name = 'John' employee%last_name = 'Doe' employee%hired_date%year = 2020 print *, 'Employee hired in year', employee%hired_date%year if (employee%hired_date%year /= 2020) error stop end program derived_types_65lfortran-0.63.0/integration_tests/arrays_76.f900000664000175000017500000000051615174404631021524 0ustar alastairalastairprogram array_76 integer :: i integer :: arr(10) integer :: arr_indecies(10) integer,allocatable :: arr_res(:) allocate(arr_res(11)) do i =1,10 arr(i) = i arr_indecies(i) = i end do arr_res = [arr(arr_indecies),11] print *, arr_res do i = 1 , 11 if (arr_res(i) /= i) error stop end do end program lfortran-0.63.0/integration_tests/format_52.f900000664000175000017500000000075215174404631021507 0ustar alastairalastairprogram format_52 implicit none integer :: i character(2) :: which(2) = ['st','nd'] character(10) :: output print "(I0,A,I0,A)", 1, which(1), 2, which(2) write(output, "(I0,A,I0,A)") 1, which(1), 2, which(2) if (trim(output) /= "1st2nd") error stop "Format reuse failed" write(output, "(I0,A)") 1, which(1) if (trim(output) /= "1st") error stop "Single format failed" print "(I0,A)", (i, which(i), i = 1, 2) end program format_52 lfortran-0.63.0/integration_tests/arrays_60.f900000664000175000017500000000167715174404631021526 0ustar alastairalastairprogram arrays_60 implicit none ! Declare variables integer, dimension(5) :: array real :: scalar_value integer :: i real, dimension(5) :: x, y, z array = (/ 1, 0, 3, 0, 5 /) x = (/ 1.0, 2.0, 3.0, 4.0, 5.0 /) y = (/ 2.0, 4.0, 6.0, 8.0, 10.0 /) scalar_value = 2.5 print *, "Result:", square(scalar_value) z = array_function(x, y) print *, "Result (z):", z if( any(abs(z - 2.41421366) > 1e-6) ) error stop where (array == 0) array = 10 end where do i = 1, size(array) print *, "array(", i, ") squared =", square(real(array(i))) end do contains real function square(a) real, intent(in) :: a square = a * a end function real function array_function(a, b) real, intent(in) :: a(:), b(:) real :: temp(size(a)) array_function = 0.0 temp = a + sqrt(b) array_function = temp(1) end function end program arrays_60 lfortran-0.63.0/integration_tests/gpu_metal_80.f900000664000175000017500000000064015174404631022171 0ustar alastairalastairprogram gpu_metal_80 ! Test: size() of allocatable derived-type member inside block in do concurrent implicit none type :: t integer, allocatable :: x(:) end type type(t) :: s integer :: i real :: r(3) allocate(s%x(3)) s%x = [1, 2, 3] do concurrent (i = 1:3) block integer :: n n = size(s%x) r(i) = real(n) end block end do if (any(r /= 3.0)) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/openmp_bindc_02.f900000664000175000017500000000573015174404631022650 0ustar alastairalastairmodule module_openmp_bindc_02 use iso_c_binding implicit none interface subroutine GOMP_parallel (fn, data, num_threads, flags) bind (C, name="GOMP_parallel") import :: c_funptr, c_ptr, c_int type(c_funptr), value :: fn type(c_ptr), value :: data integer(c_int), value :: num_threads integer(c_int), value :: flags end subroutine subroutine GOMP_barrier() bind(C, name="GOMP_barrier") end subroutine subroutine GOMP_critical_start() bind(C, name="GOMP_critical_start") end subroutine subroutine GOMP_critical_end() bind(C, name="GOMP_critical_end") end subroutine function omp_get_max_threads() bind(c, name="omp_get_max_threads") import :: c_int integer(c_int) :: omp_get_max_threads end function omp_get_max_threads function omp_get_thread_num() bind(c, name="omp_get_thread_num") import :: c_int integer(c_int) :: omp_get_thread_num end function omp_get_thread_num subroutine omp_set_num_threads(n) bind(c, name="omp_set_num_threads") import :: c_int integer(c_int), value :: n end subroutine omp_set_num_threads subroutine GOMP_atomic_start() bind(C, name="GOMP_atomic_start") end subroutine subroutine GOMP_atomic_end() bind(C, name="GOMP_atomic_end") end subroutine end interface end module module thread_data_module use, intrinsic :: iso_c_binding type, bind(C) :: thread_data integer(c_int) :: n, ctr end type thread_data end module thread_data_module subroutine lcompilers_increment_ctr(data) bind(C) use thread_data_module use iso_c_binding use module_openmp_bindc_02 implicit none type(c_ptr), value :: data type(thread_data), pointer :: tdata integer(c_int) :: n, local_ctr integer(c_int) :: i, num_threads, chunk, leftovers, thread_num, start, end call c_f_pointer(data, tdata) n = tdata%n num_threads = omp_get_max_threads() chunk = n / num_threads leftovers = mod(n, num_threads) thread_num = omp_get_thread_num() start = chunk * thread_num if (thread_num < leftovers) then start = start + thread_num else start = start + leftovers end if end = start + chunk if (thread_num < leftovers) then end = end + 1 end if local_ctr = 0 do i = start + 1, end local_ctr = local_ctr + 1 end do call GOMP_barrier() call GOMP_atomic_start() tdata%ctr = tdata%ctr + local_ctr call GOMP_atomic_end() end subroutine subroutine increment_ctr(n, ctr) use thread_data_module use module_openmp_bindc_02 implicit none integer(c_int), intent(in) :: n integer(c_int), intent(inout) :: ctr type(thread_data), target :: data type(c_ptr) :: tdata interface subroutine lcompilers_increment_ctr(data) bind(C) use iso_c_binding type(c_ptr), value :: data end subroutine end interface data%n = n data%ctr = ctr tdata = c_loc(data) call GOMP_parallel(c_funloc(lcompilers_increment_ctr), tdata, 0, 0) ctr = data%ctr end subroutine program openmp_bindc_02 use module_openmp_bindc_02 use thread_data_module implicit none integer(c_int) :: n = 1000000, ctr call omp_set_num_threads(4) ctr = 0 call increment_ctr(n, ctr) print *, ctr if (ctr /= 1000000) error stop end program lfortran-0.63.0/integration_tests/modules_30_module1.f900000664000175000017500000000076515174404631023315 0ustar alastairalastairmodule fpm_git_modules_30 implicit none type :: git_target_t character(len=:), allocatable :: url character(len=:), allocatable :: object end type git_target_t contains function git_target_branch(url, branch) result(self) character(len=*), intent(in) :: url character(len=*), intent(in) :: branch type(git_target_t) :: self self%url = url self%object = branch end function git_target_branch end module fpm_git_modules_30 lfortran-0.63.0/integration_tests/string_10.f900000664000175000017500000000075015174404631021515 0ustar alastairalastairprogram string_10 character(len=2) :: c = "BC" character(len=3) :: num logical :: is_alpha is_alpha = (c >= 'A' .and. c <= 'Z') .or. (c >= 'a' .and. c <= 'z') print *, is_alpha c = "@a" is_alpha = (c >= 'A' .and. c <= 'Z') .or. (c >= 'a' .and. c <= 'z') print *, is_alpha c = "a@" is_alpha = (c >= 'A' .and. c <= 'Z') .or. (c >= 'a' .and. c <= 'z') print *, is_alpha num(1:3) = 'sbs' if (num /= "sbs") error stop end program string_10 lfortran-0.63.0/integration_tests/class_32.f900000664000175000017500000000403515174404631021320 0ustar alastairalastairmodule class_32_test_module implicit none type :: Composed integer :: x end type Composed type :: Base class(Composed), allocatable :: obj end type type :: Super integer :: x end type Super type, extends(Super) :: Derived integer :: y end type end module class_32_test_module program class_32 use class_32_test_module implicit none class(Composed), allocatable :: c class(Composed), allocatable :: d class(Base), allocatable :: c_base class(Base), allocatable :: d_base class(Super), allocatable :: c_super class(Derived), allocatable :: d_derived ! test case 1: assignment of class var to class var allocate(c) c%x = 1 print *, "c%x: ", c%x allocate(d) d%x = 42 print *, "d%x: ", d%x c = d print *, "c%x after assignment: ", c%x if (c%x /= 42) error stop d%x = 3 print *, "d%x: ", d%x ! verify deep copy print *, "c%x: ", c%x if (c%x == 3) error stop ! test case 2: assignment of class var to struct member class allocate(c_base) allocate(d_base) allocate(c_base%obj) ! needed because lfortran does not automatically allocate this allocate(d_base%obj) ! needed because lfortran does not automatically allocate this c_base%obj = c d_base%obj = d print *, "c_base%obj%x: ", c_base%obj%x if (c_base%obj%x /= 42) error stop print *, "d_base%obj%x: ", d_base%obj%x if (d_base%obj%x /= 3) error stop c%x = 20 print *, "c%x: ", c%x ! verify deep copy print *, "c_base%obj%x: ", c_base%obj%x if (c_base%obj%x == 20) error stop ! test case 3: assignment of derived class var to base class var allocate(c_super) c_super%x = 1 print *, "c_super%x: ", c_super%x allocate(d_derived) d_derived%x = 42 print *, "d_derived%x: ", d_derived%x c_super = d_derived print *, "c_super%x after assignment: ", c_super%x d_derived%x = 2 ! verify deep copy print *, "c_super%x after assignment: ", c_super%x if (c_super%x == 2) error stop end program class_32lfortran-0.63.0/integration_tests/derived_types_66.f900000664000175000017500000000034015174404631023063 0ustar alastairalastairprogram derived_types_66 implicit none type :: val_type integer :: origin = 3 end type type(val_type), allocatable :: val allocate(val) if (val%origin /= 3) error stop end program derived_types_66 lfortran-0.63.0/integration_tests/array_section_11.f900000664000175000017500000000107615174404631023054 0ustar alastairalastairprogram test_array_section implicit none real, allocatable :: arr(:,:) real, allocatable :: section(:,:) integer :: i, j allocate(arr(4,4)) allocate(section(2,2)) do j = 1, 4 do i = 1, 4 arr(i, j) = real(i + j * 10) end do end do section = arr(2:3, 2:3) if (abs(section(1,1) - 22.0) > 0.001) error stop 1 if (abs(section(2,1) - 23.0) > 0.001) error stop 2 if (abs(section(1,2) - 32.0) > 0.001) error stop 3 if (abs(section(2,2) - 33.0) > 0.001) error stop 4 print *, "PASS" end program lfortran-0.63.0/integration_tests/intrinsics_70.f900000664000175000017500000000374015174404631022404 0ustar alastairalastairprogram intrinsics_70 implicit none real :: x real, parameter :: epsilon = 1e-10 real :: res_real(4) real, parameter :: r1 = aint(11.21) real(4), parameter :: r2 = aint(11.21_8, 4) real(8), parameter :: r3 = aint(231.3, 8) real, parameter :: ar1(4) = aint([1.2, 3.5, 3.4, 2.1]) real(8), parameter :: ar3(4) = aint([1.2_4, 3.5_4, 3.4_4, 2.1_4], 8) real :: arr1(4) = [1.2, 3.5, 3.4, 2.1] real(4) :: arr2(4) = [1.2_4, 3.5_4, 3.4_4, 2.1_4] real(8) :: arr3(4) = [1.2_8, 3.5_8, 3.4_8, 2.1_8] print *, aint(arr1) if (any(abs(aint(arr1) - [1.0, 3.0, 3.0, 2.0]) > epsilon)) error stop print *, aint(arr2, 4) if (any(abs(aint(arr2, 4) - [1.0, 3.0, 3.0, 2.0]) > epsilon)) error stop print *, aint(arr3, 8) if (any(abs(aint(arr3, 8) - [1.0, 3.0, 3.0, 2.0]) > epsilon)) error stop print *, r1 if (abs(r1 - 11.0) > epsilon) error stop print *, r2 if (abs(r2 - 11.0) > epsilon) error stop print *, r3 if (abs(r3 - 231.0) > epsilon) error stop print *, ar1 if (any(abs(ar1 - [1.0, 3.0, 3.0, 2.0]) > epsilon)) error stop print *, ar3 if (any(abs(ar3 - [1.0, 3.0, 3.0, 2.0]) > epsilon)) error stop x = 4.23 print *, aint(x) if (abs(aint(x) - 4.0) > epsilon) error stop x = -4.23 print *, aint(x) if (abs(aint(x) - (-4.0)) > epsilon) error stop print *, aint(0.0) if (abs(aint(0.0) - 0.0) > epsilon) error stop print *, aint(4.23) if (abs(aint(4.23) - 4.0) > epsilon) error stop print *, aint(-4.23, 4) if (abs(aint(-4.23, 4) - (-4.0)) > epsilon) error stop ! Compile time broadcasting res_real = aint([real :: 1.2, 3.5, 3.4, 2.1]) print *, res_real if (abs(res_real(1) - 1.0) > epsilon) error stop print *, res_real(2) if (abs(res_real(2) - 3.0) > epsilon) error stop print *, res_real(3) if (abs(res_real(3) - 3.0) > epsilon) error stop print *, res_real(4) if (abs(res_real(4) - 2.0) > epsilon) error stop end program lfortran-0.63.0/integration_tests/intrinsics_54.f900000664000175000017500000000045715174404631022410 0ustar alastairalastairprogram intrinsics_54 integer :: a, b, c, d, e, f a = 2 b = -3 c = 5 d = 10 e = 20 f = -30 if (max0(10,20) /= 20) error stop if (max0(3,5,4) /= 5) error stop if (max0(a,b) /= a) error stop if (max0(a,b,c) /= c) error stop if (max0(d,e,f,a,b,c) /= e) error stop end lfortran-0.63.0/integration_tests/while_06.f900000664000175000017500000000040115174404631021315 0ustar alastairalastairprogram while_06 integer :: x = 0 integer, parameter :: skip_tokens(*) = [0,1,2] integer :: hit = 0 do while(any(x == skip_tokens)) print *, "Hi" x = 16 hit = hit + 1 end do if(hit /= 1) error stop end programlfortran-0.63.0/integration_tests/template_array_05.f900000664000175000017500000000357115174404631023230 0ustar alastairalastairmodule template_array_05_m implicit none private public :: vector_t, matrix_t requirement op(t, plus_t) type, deferred :: t pure elemental function plus_t(l, r) result(rs) type(t), intent(in) :: l, r type(t) :: rs end function end requirement template vector_t(t, plus_t, n) require :: op(t, plus_t) integer :: n private public :: add_array type :: vector type(t) :: elements(n) end type contains pure function add_vector(a, b) result(r) type(vector), intent(in) :: a, b type(vector) :: r r%elements = plus_t(a%elements, b%elements) end function end template template matrix_t(t, plus_t, n) require :: op(t, plus_t) integer :: n private public :: add_matrix type :: matrix type(t) :: elements(n, n) end type contains pure function add_matrix(a, b) result(r) type(matrix), intent(in) :: a, b type(matrix) :: r r%elements = plus_t(a%elements, b%elements) end function end template end module program template_array_05 use template_array_05_m integer, parameter :: n = 10 instantiate vector_t(integer, operator(+), n), & only: int_vector => vector, & int_add_vector => add_vector type(int_vector) :: a, b, c integer :: i, j do i = 1, n a%elements(i) = i b%elements(i) = i end do c = int_add_vector(a, b) print *, c%elements instantiate matrix_t(integer, operator(+), n), & only: int_matrix => matrix, & int_add_matrix => add_matrix type(int_matrix) :: am, bm, cm do i = 1, n do j = 1, n am%elements(i,j) = i + j bm%elements(i,j) = i + j end do end do cm = int_add_matrix(am, bm) print *, cm%elements endlfortran-0.63.0/integration_tests/external_05.f900000664000175000017500000000034615174404631022036 0ustar alastairalastairsubroutine idz_snorm(matvec) external matvec call matvec(n,v,m,u,p1,p2,p3,p4) end subroutine idz_diffsnorm0(matvec) external matvec call matvec(n,v,m,u1,p1,p2,p3,p4) return end program external_04 end program lfortran-0.63.0/integration_tests/equivalence_02.f900000664000175000017500000000111415174404631022504 0ustar alastairalastairprogram equivalence_02 use iso_c_binding, only: c_loc, c_f_pointer implicit none integer, pointer :: mcheps(:) integer, pointer :: minmag(:) integer, pointer :: maxmag(:) double precision, target :: dmach(3) call c_f_pointer(c_loc(dmach(1)), mcheps, [4]) call c_f_pointer(c_loc(dmach(2)), minmag, [4]) call c_f_pointer(c_loc(dmach(3)), maxmag, [4]) minmag = 2 mcheps = 1 if(minmag(1) /= 1) error stop if(minmag(2) /= 1) error stop if(minmag(3) /= 2) error stop if(minmag(4) /= 2) error stop if(mcheps(1) /= 1) error stop endlfortran-0.63.0/integration_tests/while_04.f900000664000175000017500000000076715174404631021332 0ustar alastairalastair! Check handling while's test expression when a temporary is needed program while_04 integer :: flag = 1 integer :: hit = 0 do while(foo(flag) == "Hello") print *, "hi" flag = -1 hit = hit + 1 end do if(hit /= 1) error stop contains function foo(x) result (str) integer :: x character(:),allocatable :: str if(x == 1) then str = "Hello" else str = "bla-bla" end if end function end program lfortran-0.63.0/integration_tests/derived_types_110.f900000664000175000017500000000155615174404631023143 0ustar alastairalastair! Test: finalize non-pointer non-allocatable local variable at END ! Fortran 2018, clause 7.5.6.3, paragraph 3 module derived_types_110_m implicit none integer :: finalizations = 0 type :: obj_t integer :: dummy = 0 contains final :: count_finalizations end type contains subroutine count_finalizations(self) type(obj_t), intent(inout) :: self finalizations = finalizations + 1 self%dummy = 0 end subroutine subroutine my_sub() type(obj_t) :: local_obj local_obj%dummy = 1 end subroutine ! local_obj should be finalized here end module program derived_types_110 use derived_types_110_m implicit none integer :: tally_before tally_before = finalizations call my_sub() if (finalizations - tally_before == 1) then print *, "Test passed" else print *, "Test FAILED" error stop 1 end if end program lfortran-0.63.0/integration_tests/product_01.f900000664000175000017500000000250215174404631021664 0ustar alastairalastairprogram test_product integer :: i, j integer(8) :: x(3, 5), xproduct, xproduct1(5), correct1(5), correct2(5) logical :: modx(3, 5) correct1 = (/24_8, 60_8, 120_8, 210_8, 336_8/) correct2 = (/3_8, 15_8, 5_8, 35_8, 7_8/) do i = lbound(x, 1), ubound(x, 1) do j = lbound(x, 2), ubound(x, 2) x(i, j) = i + j modx(i, j) = mod(i + j, 2) == 1 end do end do xproduct = product(x) print *, xproduct if( xproduct /= 12192768000_8 ) error stop xproduct = product(x, mask=modx) print *, xproduct if( xproduct /= 55125 ) error stop xproduct1 = product(x, 1) print *, xproduct1 do i = lbound(xproduct1, 1), ubound(xproduct1, 1) if( xproduct1(i) /= correct1(i) ) error stop end do xproduct1 = product(x, 1, mask=modx) print *, xproduct1 do i = lbound(xproduct1, 1), ubound(xproduct1, 1) if( xproduct1(i) /= correct2(i) ) error stop end do xproduct1 = product(x, dim=1) print *, xproduct1 do i = lbound(xproduct1, 1), ubound(xproduct1, 1) if( xproduct1(i) /= correct1(i) ) error stop end do xproduct1 = product(x, dim=1, mask=modx) print *, xproduct1 do i = lbound(xproduct1, 1), ubound(xproduct1, 1) if( xproduct1(i) /= correct2(i) ) error stop end do end program lfortran-0.63.0/integration_tests/arrays_op_17.f900000664000175000017500000000046715174404631022222 0ustar alastairalastairprogram arrays_op_17 implicit none integer, allocatable :: g(:), y(:, :) integer :: b(20), i allocate(y(20, 20), g(20)) b = 2 y = 4 g = 8 do i = 1, 20 y(i, :) = g(:) * y(i, :) + b(:) end do print *, y if( any(y /= 34) ) error stop end program arrays_op_17 lfortran-0.63.0/integration_tests/intrinsics_20.f900000664000175000017500000000056515174404631022401 0ustar alastairalastairprogram intrinsics_20 integer, parameter :: dp = kind(0.d0) real, parameter :: pi = acos(-1.) real(dp), parameter :: pi_dp = acos(-1._dp) real, parameter :: x = cos((3+4)*7.) integer :: y integer, parameter :: y2 = 3 print *, pi print *, pi_dp print *, x y = 3 print *, cos((3+4)*7.) print *, cos((y+4)*7.) print *, cos((y2+4)*7.) print *, cos(x+1)**2 + sin(x+1)**2 end lfortran-0.63.0/integration_tests/arrays_103.f900000664000175000017500000000135415174404631021574 0ustar alastairalastairmodule arrays_103_mod_1 implicit none real(8), allocatable :: a(:,:) end module arrays_103_mod_1 module arrays_103_mod_2 use arrays_103_mod_1 implicit none contains subroutine automatic_array() implicit none real(8), dimension(size(a,1)) :: b integer :: i do i = 1, size(a,1) b(i) = sum(a(i,:)) end do if (any(b /= [10.0d0, 20.0d0, 30.0d0])) error stop end subroutine automatic_array end module arrays_103_mod_2 program arrays_103 use arrays_103_mod_1 use arrays_103_mod_2 implicit none integer :: i, j allocate(a(3,4)) do i = 1, 3 do j = 1, 4 a(i,j) = real(i*j, 8) end do end do call automatic_array() end program arrays_103 lfortran-0.63.0/integration_tests/bindc1.f900000664000175000017500000000016515174404631021047 0ustar alastairalastairprogram bindc1 use iso_c_binding, only: c_loc, c_ptr integer, pointer :: x type(c_ptr) :: p p = c_loc(x) end program lfortran-0.63.0/integration_tests/data_12.f900000664000175000017500000000162415174404631021123 0ustar alastairalastair! testing data statements in a module module data_12_module implicit none integer :: x, td real :: y, z, c1(4), bf1, xx90, xx95, b data x, td, b /1, 4, 3/ data y, z /2.0, 3.0/ data c1 /0.0, 0.22, -0.14, -0.21/ data bf1 /0.8/, xx90, xx95 /0.55, 0.62/ end module data_12_module program data_12_program use data_12_module implicit none print *, x if (x /= 1) error stop print *, y if (abs(y-2.0) > 1e-5) error stop print *, z if (abs(z-3.0) > 1e-5) error stop print *, c1(1) if (abs(c1(1)-0.0) > 1e-5) error stop print *, c1(2) if (abs(c1(2)-0.22) > 1e-5) error stop print *, c1(4) if (abs(c1(4)+0.21) > 1e-5) error stop print *, bf1 if (abs(bf1-0.8) > 1e-5) error stop print *, xx90 if (abs(xx90-0.55) > 1e-5) error stop print *, xx95 if (abs(xx95-0.62) > 1e-5) error stop end program data_12_program lfortran-0.63.0/integration_tests/intrinsics_353.f900000664000175000017500000000035215174404631022464 0ustar alastairalastairprogram intrinsics_353 implicit none real, dimension(8) :: x real :: y call random_number(harvest=x) print *, 'Random numbers:', x call random_number(harvest=y) print *, 'Random numbers:', y end programlfortran-0.63.0/integration_tests/functions_40.f900000664000175000017500000000204515174404631022221 0ustar alastairalastairmodule mod1_functions_40_integers integer(4) :: n end module mod1_functions_40_integers module mod2_functions_40_interfaces interface subroutine some_routine(a) use mod1_functions_40_integers ! symbol present in dimension, hence in FunctionType ASR node real(8), dimension(n:,:) :: a end subroutine some_routine end interface end module mod2_functions_40_interfaces program functions_40 use mod2_functions_40_interfaces use mod1_functions_40_integers implicit none real(8), allocatable:: a(:,:) n = 42 allocate(a(n:n+1,2)) call some_routine(a) end program functions_40 subroutine some_routine(a) use mod1_functions_40_integers real(8), dimension(n:,:) :: a print *, "lbound(a, 1): ", lbound(a, 1) if (lbound(a, 1) /= 42) error stop print *, "lbound(a, 2): ", lbound(a, 2) if (lbound(a, 2) /= 1) error stop print *, "ubound(a, 1): ", ubound(a, 1) if (ubound(a, 1) /= 43) error stop print *, "ubound(a, 2): ", ubound(a, 2) if (ubound(a, 2) /= 2) error stop end subroutine some_routine lfortran-0.63.0/integration_tests/submodule_29d.f900000664000175000017500000000037515174404631022367 0ustar alastairalastairsubmodule(submodule_29_mod:submodule_29_child) submodule_29_grandchild implicit none contains subroutine helper(x, y) integer, intent(in) :: x integer, intent(out) :: y y = x + multiplier end subroutine end submodule lfortran-0.63.0/integration_tests/interface_31.f900000664000175000017500000000265415174404631022157 0ustar alastairalastair! Test: abstract interface defined after the generic interface that uses it. ! Fortran allows forward references within a module specification section. module interface_31_mod implicit none type :: result_t integer :: status = 0 end type abstract interface subroutine callback_iface(x) integer, intent(in) :: x end subroutine end interface interface run module function run_impl(cmd, callback) result(res) character(*), intent(in) :: cmd procedure(callback_iface), optional :: callback type(result_t) :: res end function end interface end module submodule (interface_31_mod) interface_31_sub contains module function run_impl(cmd, callback) result(res) character(*), intent(in) :: cmd procedure(callback_iface), optional :: callback type(result_t) :: res res%status = 1 if (present(callback)) then call callback(42) res%status = 2 end if end function end submodule program interface_31 use interface_31_mod, only: result_t, run implicit none type(result_t) :: r r = run("test", callback=my_cb) if (r%status /= 2) error stop r = run("test2") if (r%status /= 1) error stop print *, "PASS" contains subroutine my_cb(x) integer, intent(in) :: x if (x /= 42) error stop end subroutine end program lfortran-0.63.0/integration_tests/separate_compilation_17b.f900000664000175000017500000000072115174404631024560 0ustar alastairalastairsubmodule(mod_separate_compilation_17) submod_separate_compilation_17 implicit none contains module function int8_fnv_1( key ) result(hash_code) integer(1), intent(inout) :: key(:) integer(4) :: hash_code integer(1), parameter :: array(4) = [1, 2, 3, 4] integer(4), parameter :: result = 5 hash_code = result key = array end function int8_fnv_1 end submodule submod_separate_compilation_17lfortran-0.63.0/integration_tests/class_allocate_06.f900000664000175000017500000000156215174404631023167 0ustar alastairalastair! Test: intrinsic assignment of class(*) array to class(*) allocatable ! component when the actual argument is also class(*). module class_allocate_06_mod implicit none type :: box class(*), allocatable :: val(:) end type contains subroutine assign_val(b, v) type(box), intent(out) :: b class(*), intent(in) :: v(:) b%val = v end subroutine end module program class_allocate_06 use class_allocate_06_mod implicit none type(box) :: b class(*), allocatable :: arr(:) allocate(integer :: arr(3)) select type(arr) type is (integer) arr = [10, 20, 30] end select call assign_val(b, arr) select type (x => b%val) type is (integer) if (size(x) /= 3) error stop if (x(1) /= 10) error stop if (x(2) /= 20) error stop if (x(3) /= 30) error stop class default error stop end select print *, "PASS" end program lfortran-0.63.0/integration_tests/gpu_metal_52.f900000664000175000017500000000064715174404631022177 0ustar alastairalastairprogram gpu_metal_52 implicit none integer :: n(2) real :: b(3,2) integer :: l n = [2, 3] b = 0.0 do concurrent(l = 1:2) b(1:n(l),l) = 1.0 end do if (abs(b(1,1) - 1.0) > 0.01) error stop if (abs(b(2,1) - 1.0) > 0.01) error stop if (abs(b(3,1) - 0.0) > 0.01) error stop if (abs(b(1,2) - 1.0) > 0.01) error stop if (abs(b(2,2) - 1.0) > 0.01) error stop if (abs(b(3,2) - 1.0) > 0.01) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/intrinsics_346.f900000664000175000017500000000276015174404631022473 0ustar alastairalastairmodule intrinsics_346_asciimod ! f95-compliant file asciiB.f90: [] only in character strings implicit none public iascii,ascii interface ascii module procedure asciiarray,asciiscalar end interface ascii contains pure function iascii( string) character,intent(in):: string*(*) integer iascii(len(string)), i do i = 1, len(string) iascii(i) = iachar(string(i:i)) end do end function iascii pure function asciiarray( codes) integer,intent(in):: codes(:) character(len = size(codes)) :: asciiarray integer i do i = 1, size(codes) asciiarray(i:i) = achar(codes(i)) end do end function asciiarray pure function asciiscalar(codes) integer,intent(in):: codes character asciiscalar*1 asciiscalar = asciiarray((/codes/)) end function asciiscalar end module program intrinsics_346 use intrinsics_346_asciimod implicit none ! Variables character(len=5) :: inputString integer, allocatable :: asciiCodes(:) character(len=:), allocatable :: outputString inputString = "Hi!" allocate(asciiCodes(len(inputString))) asciiCodes = iascii(inputString) print *, "ASCII codes for '", inputString, "':", asciiCodes if (any(asciiCodes /= [72, 105, 33, 32, 32])) error stop outputString = ascii(asciiCodes) print *, "Converted back to string:", outputString if (outputString /= "Hi!") error stop end program lfortran-0.63.0/integration_tests/procedure_49.f900000664000175000017500000000112215174404631022205 0ustar alastairalastairmodule procedure_mod contains subroutine square(a) integer, intent(inout) :: a a = a * 2 end subroutine square end module procedure_mod module class_mod use procedure_mod implicit none type :: my_type contains procedure, public, nopass :: square end type my_type end module class_mod program class_procedure_use_assoc_nopass_01 use class_mod implicit none type(my_type) :: t integer :: i i = 2 call t%square(i) if (i /= 4) error stop end program class_procedure_use_assoc_nopass_01lfortran-0.63.0/integration_tests/string_110.f900000664000175000017500000000201715174404631021574 0ustar alastairalastair! Test character array section substring: s1(:)(1:4) program string_110 implicit none character(5) :: s1(2) character(4) :: s2(2) s1 = ['hello', 'world'] s2 = ['hell', 'worl'] ! s1(:)(1:4) should produce a character(4) array call check(s1(:)(1:4), s2) ! Also test with explicit bounds call check(s1(1:2)(1:4), s2) ! Test with substring starting at offset > 1 call check_mid(s1(:)(2:4), ['ell', 'orl']) contains subroutine check(a, b) character(*), intent(in) :: a(:), b(:) integer :: i if (len(a) /= len(b)) error stop if (size(a) /= size(b)) error stop do i = 1, size(a) if (a(i) /= b(i)) error stop end do end subroutine subroutine check_mid(a, b) character(*), intent(in) :: a(:), b(:) integer :: i if (len(a) /= len(b)) error stop if (size(a) /= size(b)) error stop do i = 1, size(a) if (a(i) /= b(i)) error stop end do end subroutine end program lfortran-0.63.0/integration_tests/implicit_interface_15.f900000664000175000017500000000026615174404631024050 0ustar alastairalastairprogram implicit_interface_15 real a(3) a = [1.0, 12.512, -3.512] call stfsm(a) end program subroutine stfsm( a ) real :: a( 0: * ) external :: strsm call strsm( a, 3 ) return end lfortran-0.63.0/integration_tests/char_array_01.f900000664000175000017500000000066415174404631022326 0ustar alastairalastairprogram char_array_01 character char_arr1(4) character char_arr2(2) char_arr1(:) = "A" char_arr2(:) = " " print *, char_arr1 if (char_arr1(1) /= "A") error stop if (char_arr1(2) /= "A") error stop if (char_arr1(3) /= "A") error stop if (char_arr1(4) /= "A") error stop print *, char_arr2 if (char_arr2(1) /= " ") error stop if (char_arr2(2) /= " ") error stop end program char_array_01 lfortran-0.63.0/integration_tests/generic_name_03.f900000664000175000017500000000177315174404631022633 0ustar alastairalastairmodule generic_name_03_mod use iso_c_binding, only: c_funptr, c_funloc implicit none abstract interface integer function my_func_i() end function end interface type :: wrapper_t integer :: x end type interface wrapper_t module procedure construct_from_int module procedure construct_from_funloc end interface contains pure function construct_from_int(x) result(res) integer, intent(in) :: x type(wrapper_t) :: res res%x = x end function pure function construct_from_funloc(p) result(res) type(c_funptr), intent(in) :: p type(wrapper_t) :: res res%x = 0 end function end module program generic_name_03 use generic_name_03_mod implicit none type(wrapper_t) :: w procedure(my_func_i), pointer :: fptr fptr => my_func w = wrapper_t(c_funloc(fptr)) print *, w%x if (w%x /= 0) error stop w = wrapper_t(42) print *, w%x if (w%x /= 42) error stop contains integer function my_func() my_func = 42 end function end program lfortran-0.63.0/integration_tests/enum_08.f900000664000175000017500000000155515174404631021166 0ustar alastairalastairprogram enum_08 implicit none enum, bind(c) enumerator :: OPTION_A = 1 enumerator :: OPTION_B = 2 enumerator :: OPTION_C = 4 enumerator :: OPTION_D = 8 enumerator :: OPTION_E = 16 end enum enum, bind(c) enumerator :: STATUS_OK, STATUS_WARN, STATUS_ERR end enum enum, bind(c) enumerator :: COLOR_RED = 5 enumerator :: COLOR_GREEN enumerator :: COLOR_BLUE end enum if (OPTION_A /= 1) error stop if (OPTION_B /= 2) error stop if (OPTION_C /= 4) error stop if (OPTION_D /= 8) error stop if (OPTION_E /= 16) error stop if (STATUS_OK /= 0) error stop if (STATUS_WARN /= 1) error stop if (STATUS_ERR /= 2) error stop if (COLOR_RED /= 5) error stop if (COLOR_GREEN /= 6) error stop if (COLOR_BLUE /= 7) error stop end program enum_08 lfortran-0.63.0/integration_tests/intrinsics_449.f900000664000175000017500000000054115174404631022472 0ustar alastairalastairprogram intrinsics_449 use iso_c_binding, only: c_ptr, c_null_ptr implicit none type :: t type(c_ptr) :: p end type type(c_ptr) :: p type(t) :: x p = c_null_ptr x%p = c_null_ptr print *, storage_size(p) if (storage_size(p) /= 64) error stop 1 print *, storage_size(x) if (storage_size(x) /= 64) error stop 2 end program lfortran-0.63.0/integration_tests/intrinsics_238.f900000664000175000017500000000033015174404631022462 0ustar alastairalastairprogram intrinsics_238 implicit none integer :: i integer, parameter :: res(5) = [ (maskl(i), i=1, 5) ] do i = 1, 5 print*, res(i), maskl(i) if (maskl(i) /= res(i) ) error stop end do print *, maskl(1, 8) end programlfortran-0.63.0/integration_tests/functions_44.f900000664000175000017500000000104515174404631022224 0ustar alastairalastairmodule functions_44_mod implicit none type string_t character(len=:), allocatable :: string_ end type string_t contains function bracket(x) result(res) class(string_t), intent(in) :: x type(string_t) :: res res%string_ = "2" res%string_ = x%string_ end function bracket end module functions_44_mod program functions_44 use functions_44_mod implicit none type(string_t) :: lines(5) lines(1)%string_ = "1" lines(1) = bracket(lines(1)) if (lines(1)%string_ /= "1") error stop end program functions_44 lfortran-0.63.0/integration_tests/file_51.f900000664000175000017500000000257515174404631021142 0ustar alastairalastairprogram file_51 implicit none logical :: l_1d(8), l_2d(2,2), l_3d(2,2,2) logical :: larray(8) integer :: i10, i, j, k open (newunit=i10, file='file_51_direct.dat', access='direct', recl=40, status='unknown') ! Write record 1: all true larray = .true. write (i10, rec=1) larray ! Write record 2: all false larray = .false. write (i10, rec=2) larray ! --- Test 1: Element-by-element read from multiple arrays --- l_1d = .false.; l_2d = .false.; l_3d = .false. read (i10, rec=1) l_1d(1), l_1d(2), l_2d(1,2), l_2d(2,2), l_3d(1,1,2), & l_3d(2,1,2), l_1d(7), l_1d(8) if (.not. all(l_1d(1:2))) error stop "Test 1a: l_1d(1:2) should be true" if (.not. all(l_2d(1:2,2))) error stop "Test 1b: l_2d(1:2,2) should be true" if (.not. all(l_3d(1:2,1,2))) error stop "Test 1c: l_3d(1:2,1,2) should be true" if (.not. all(l_1d(7:8))) error stop "Test 1d: l_1d(7:8) should be true" ! Verify elements that were NOT read remain false if (any(l_1d(3:6))) error stop "Test 1e: l_1d(3:6) should be false" if (any(l_2d(1:2,1))) error stop "Test 1f: l_2d(1:2,1) should be false" ! --- Test 2: Nested implied do loop read --- l_3d = .true. read (i10, rec=2) (((l_3d(j,k,i), i=1,2), k=1,2), j=1,2) if (any(l_3d)) error stop "Test 2: l_3d should be all false after reading record 2" close (i10, status='delete') print *, "All tests passed." end program file_51 lfortran-0.63.0/integration_tests/arrays_56.f900000664000175000017500000000073715174404631021527 0ustar alastairalastairprogram arrays_56 implicit none integer, parameter :: N = 10 real :: x(N), y(N) x = 3 y = 4 call f(g(g(x(:4)-y(:4))**2), 3.0) contains subroutine f(A, correct) real, intent(in) :: A(:) real, intent(in) :: correct print *, A if( any(A /= correct) ) error stop end subroutine function g(A) result(r) real, intent(in) :: A(:) real :: r(size(A)) r = A+2 end function end program lfortran-0.63.0/integration_tests/intrinsics_258.f900000664000175000017500000000025515174404631022472 0ustar alastairalastairprogram intrinsics_258 real :: x(5) = [1, 2, 3, 4, 5] integer:: mean mean = sum(x) / 5 print*, sum(abs(x - mean)**2) / (5 - merge(1, 0, .true.)) end programlfortran-0.63.0/integration_tests/intrinsics_120.f900000664000175000017500000000047615174404631022463 0ustar alastairalastairprogram intrinsics_120 integer :: x(5) = [ 1, 2, 3, 4 ,5 ] logical :: mask(5) = [ .TRUE., .FALSE., .TRUE., .FALSE., .TRUE. ] if ( .not. product( array = x, mask = mask ) == 15 ) error stop if ( .not. product( x, mask = mask ) == 15 ) error stop if ( .not. product( x, mask ) == 15 ) error stop end lfortran-0.63.0/integration_tests/logical_kind_06.f900000664000175000017500000000234415174404631022634 0ustar alastairalastairprogram logical_kind_06 implicit none logical(1) :: x logical(1) :: arr(3) logical :: res ! Test scalar .eqv. with kind mismatch x = .true. res = x .eqv. .true. if (res .neqv. .true.) error stop x = .false. res = x .eqv. .true. if (res .neqv. .false.) error stop ! Test passing .eqv. result to subroutine expecting default logical x = .true. call check_val(x .eqv. .true., .true.) call check_val(x .eqv. .false., .false.) call check_val(x .neqv. .true., .false.) call check_val(x .neqv. .false., .true.) ! Test with all() intrinsic and .eqv. arr = .true. call check_val(all(arr) .eqv. .true., .true.) arr(2) = .false. call check_val(all(arr) .eqv. .true., .false.) ! Test with generic interface call check_generic(all(arr) .eqv. .false., "test") print *, "All tests passed" contains subroutine check_val(actual, expected) logical, intent(in) :: actual, expected if (actual .neqv. expected) error stop end subroutine subroutine check_generic(expression, msg) logical, intent(in) :: expression character(*), intent(in) :: msg if (.not. expression) error stop msg end subroutine end program lfortran-0.63.0/integration_tests/infer_walrus_struct_02.f900000664000175000017500000000072215174404631024313 0ustar alastairalastairprogram infer_walrus_struct_02 implicit none type :: pair_t integer :: a, b end type call test() contains function make_pair(x, y) result(res) integer, intent(in) :: x, y type(pair_t) :: res res%a = x res%b = y end function subroutine test() q := make_pair(10, 20) if (q%a /= 10) error stop if (q%b /= 20) error stop print *, "PASSED" end subroutine end program lfortran-0.63.0/integration_tests/external_03.f900000664000175000017500000000021515174404631022027 0ustar alastairalastair subroutine dfctr() external dmprec double precision dmprec return end subroutine program external_03 call dfctr() end program lfortran-0.63.0/integration_tests/intrinsics_09.f900000664000175000017500000000014415174404631022401 0ustar alastairalastairprogram intrinsics_09 real :: z=0.0 if (z < tiny(1.0)) then print*, z end if end program lfortran-0.63.0/integration_tests/block_04.f900000664000175000017500000000105715174404631021305 0ustar alastairalastairsubroutine hybrd() implicit none real, dimension(3):: wa3 real :: temp interface subroutine fcn(n) implicit none integer, intent(in) :: n end subroutine fcn end interface main : block temp = enorm(3, Wa3) end block main contains real function enorm(n, x) result(y) implicit none integer, intent(in) :: n real, dimension(n), intent(in) :: x y = 0.0 end function enorm end subroutine program main implicit none call hybrd() end program lfortran-0.63.0/integration_tests/intrinsics_89.f900000664000175000017500000000023515174404631022412 0ustar alastairalastair! gh2941 program intrinsics_89 implicit none integer :: x x = (2+3)*5 print *, x, sin(0.5) if (abs(sin(0.5) - 0.479425550) > 1e-7) error stop end program lfortran-0.63.0/integration_tests/intrinsics_63.f900000664000175000017500000000025315174404631022402 0ustar alastairalastairprogram intrinsics_63 implicit none complex, allocatable :: a5(:, :) allocate(a5(5, 10)) a5 = (5.0, 6.0) print *, a5 if( any(a5 /= (5.0, 6.0)) ) error stop end program lfortran-0.63.0/integration_tests/line_continuation_05.f900000664000175000017500000000077615174404631023744 0ustar alastairalastairprogram main implicit none character(len=28),allocatable :: textblock(:) integer :: i, n n = 7 allocate(textblock(n)) textblock = [character(len=28) :: & '!'//repeat(' ', 27), & 's=&'//repeat(' ', 24), & '& !'//repeat(' ', 24), & ' & ! 225'//repeat(' ', 19), & '( 0.0,-1.0 ) ! 270'//repeat(' ', 13), & ' do i=1,size(vals)'//repeat(' ', 3), & ''//repeat(' ', 28) ] do i = 1, n print *, textblock(i) end do deallocate(textblock) end program main lfortran-0.63.0/integration_tests/derived_types_05.f900000664000175000017500000000372015174404631023061 0ustar alastairalastairmodule derived_types_05_stdlib_string_type implicit none type :: string_type character(len=:), allocatable :: raw end type string_type interface string_type pure elemental module function new_string(string) result(new) character(len=*), intent(in), optional :: string type(string_type) :: new end function new_string pure elemental module function new_string_from_integer_int32(val) result(new) integer(4), intent(in) :: val type(string_type) :: new end function new_string_from_integer_int32 pure elemental module function new_string_from_integer_int64(val) result(new) integer(8), intent(in) :: val type(string_type) :: new end function new_string_from_integer_int64 pure elemental module function new_string_from_logical_lk(val) result(new) logical, intent(in) :: val type(string_type) :: new end function new_string_from_logical_lk end interface string_type end module submodule(derived_types_05_stdlib_string_type) stdlib_string_type_constructor contains elemental module function new_string(string) result(new) character(len=*), intent(in), optional :: string type(string_type) :: new end function new_string elemental module function new_string_from_integer_int32(val) result(new) integer(4), intent(in) :: val type(string_type) :: new end function new_string_from_integer_int32 elemental module function new_string_from_integer_int64(val) result(new) integer(8), intent(in) :: val type(string_type) :: new end function new_string_from_integer_int64 elemental module function new_string_from_logical_lk(val) result(new) logical, intent(in) :: val type(string_type) :: new end function new_string_from_logical_lk end submodule stdlib_string_type_constructor program derived_type_05 end program lfortran-0.63.0/integration_tests/modules_60.f900000664000175000017500000000102115174404631021654 0ustar alastairalastairmodule inf_mod_1 interface is_finite module procedure is_finite_1 end interface is_finite contains subroutine is_finite_1() end subroutine is_finite_1 end module inf_mod_1 module infnan_mod_1 use inf_mod_1, only : is_finite contains subroutine is_finite_1(x) integer , intent(in) :: x print *, x if (x /= 1) error stop end subroutine is_finite_1 end module infnan_mod_1 program bobyqa_exmp use infnan_mod_1 call is_finite_1(1) end program bobyqa_exmp lfortran-0.63.0/integration_tests/arrays_14.f900000664000175000017500000000044715174404631021517 0ustar alastairalastairprogram array_14 integer :: a = 10 integer :: b(2) b = [14, 12] call foo() if( b(1) /= 243 ) error stop if( b(2) /= 930 ) error stop contains subroutine foo() if( a /= 10 ) error stop if( b(1) /= 14 ) error stop if( b(2) /= 12 ) error stop b(1) = 243 b(2) = 930 end subroutine end program lfortran-0.63.0/integration_tests/derived_types_48.f900000664000175000017500000000063215174404631023067 0ustar alastairalastairmodule derived_types_48_m implicit none type t integer :: x = 1 integer :: y = 2 end type type, extends(t) :: ext_t type(t) :: ins = t() end type end module derived_types_48_m program derived_types_48 use derived_types_48_m implicit none type(ext_t) :: i if (i%ins%x /= 1) error stop if (i%ins%y /= 2) error stop end program derived_types_48 lfortran-0.63.0/integration_tests/tsunami.f900000664000175000017500000000301415174404631021363 0ustar alastairalastairprogram tsunami ! This version solves the linearized 1-d advection equation: ! ! du/dt + c du/dx = 0 implicit none integer :: i, n integer, parameter :: grid_size = 100 ! grid size in x integer, parameter :: num_time_steps = 100 ! number of time steps real, parameter :: dt = 1 ! time step [s] real, parameter :: dx = 1 ! grid spacing [m] real, parameter :: c = 1 ! background flow speed [m/s] real :: h(grid_size), dh(grid_size) integer, parameter :: icenter = 25 real, parameter :: decay = 0.02 character(*), parameter :: fmt = '(i0,*(1x,es15.8e2))' ! check input parameter values if (grid_size <= 0) stop 'grid_size must be > 0' if (dt <= 0) stop 'time step dt must be > 0' if (dx <= 0) stop 'grid spacing dx must be > 0' if (c <= 0) stop 'background flow speed c must be > 0' ! initialize water height to a Gaussian shape do concurrent(i = 1:grid_size) h(i) = exp(-decay * (i - icenter)**2) end do ! write initial state to screen print fmt, 0, h time_loop: do n = 1, num_time_steps ! apply the periodic boundary condition dh(1) = h(1) - h(grid_size) ! calculate the difference of u in space do concurrent (i = 2:grid_size) dh(i) = h(i) - h(i-1) end do ! compute u at next time step do concurrent (i = 1:grid_size) h(i) = h(i) - c * dh(i) / dx * dt end do ! write current state to screen print fmt, n, h end do time_loop print *, "sum(h): ", sum(h) if (abs(sum(h) - 12.5331345) > 1e-7) error stop end program tsunamilfortran-0.63.0/integration_tests/separate_compilation_class_star_02.f900000664000175000017500000000026115174404631026625 0ustar alastairalastairprogram separate_compilation_class_star_02 use separate_compilation_class_star_02_mod, only: create implicit none print *, "ok" end program separate_compilation_class_star_02 lfortran-0.63.0/integration_tests/intrinsics_203.f900000664000175000017500000001241315174404631022457 0ustar alastairalastairprogram intrinsics_203 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(sp) :: x,y,z real(dp) :: i,j,k integer :: iterator real(dp) :: w(19) real(sp) :: u(19) real(sp) :: res_u(19) real(dp) :: res_w(19) real(dp) :: expected_w(19) real(sp) :: expected_u(19) real(dp), parameter :: res1(19) = asind([0.321_dp, 0.526_dp, 0.728_dp, -0.321_dp, -0.526_dp, -0.728_dp, & -1.0_dp, -0.9995004995004995_dp, -0.999000999000999_dp, & -0.9985014985014985_dp, -0.998001998001998_dp, -0.9975024975024975_dp, & -0.997002997002997_dp, -0.9965034965034965_dp, -0.996003996003996_dp, & -0.9955044955044955_dp, -0.995004995004995_dp, -0.9945054945054945_dp, & -0.994005994005994_dp]) real(sp), parameter :: res_2(19) = asind([0.321_sp, 0.526_sp, 0.728_sp, -0.321_sp, -0.526_sp, -0.728_sp, & -1.0_sp, -0.9995004995004995_sp, -0.999000999000999_sp, & -0.9985014985014985_sp, -0.998001998001998_sp, -0.9975024975024975_sp, & -0.997002997002997_sp, -0.9965034965034965_sp, -0.996003996003996_sp, & -0.9955044955044955_sp, -0.995004995004995_sp, -0.9945054945054945_sp, & -0.994005994005994_sp]) w = [0.321_dp, 0.526_dp, 0.728_dp, -0.321_dp, -0.526_dp, -0.728_dp, & -1.0_dp, -0.9995004995004995_dp, -0.999000999000999_dp, & -0.9985014985014985_dp, -0.998001998001998_dp, -0.9975024975024975_dp, & -0.997002997002997_dp, -0.9965034965034965_dp, -0.996003996003996_dp, & -0.9955044955044955_dp, -0.995004995004995_dp, -0.9945054945054945_dp, & -0.994005994005994_dp] u = [0.321_sp, 0.526_sp, 0.728_sp, -0.321_sp, -0.526_sp, -0.728_sp, & -1.0_sp, -0.9995004995004995_sp, -0.999000999000999_sp, & -0.9985014985014985_sp, -0.998001998001998_sp, -0.9975024975024975_sp, & -0.997002997002997_sp, -0.9965034965034965_sp, -0.996003996003996_sp, & -0.9955044955044955_sp, -0.995004995004995_sp, -0.9945054945054945_sp, & -0.994005994005994_sp] expected_w = [18.7234114226922479_dp, 31.7355871858161613_dp, 46.7189879975828859_dp, & -18.7234114226922479_dp, -31.7355871858161613_dp, -46.7189879975828859_dp, & -90.0000000000000000_dp, -88.1889782219856926_dp, -87.4387217993888584_dp, & -86.8629570229495442_dp, -86.3775039053440139_dp, -85.9497575149846398_dp, & -85.5629967823348778_dp, -85.2072890476047604_dp, -84.8761629060389708_dp, & -84.5651234927047142_dp, -84.2708982602068915_dp, -83.9910168022338581_dp, & -83.7235599383380418_dp] expected_u = [18.7234116_sp, 31.7355881_sp, 46.7189827_sp, & -18.7234116_sp, -31.7355881_sp, -46.7189827_sp, & -90.0000000_sp, -88.1890030_sp, -87.4387589_sp, & -86.8629379_sp, -86.3774948_sp, -85.9497604_sp, & -85.5630112_sp, -85.2072754_sp, -84.8761520_sp, & -84.5651245_sp, -84.2709045_sp, -83.9909973_sp, & -83.7235489_sp] res_w = asind(w) res_u = asind(u) do iterator = 1, size(res1) print *, res1(iterator) if (abs(res1(iterator) - expected_w(iterator)) > 1e-12_dp) error stop end do do iterator = 1, size(res_2) print *, res_2(iterator) if (abs(res_2(iterator) - expected_u(iterator)) > 1e-5_sp) error stop end do do iterator = 1, size(res_w) print *, asind(res_w(iterator)) if (abs(res_w(iterator) - expected_w(iterator)) > 1e-12_dp) error stop end do do iterator = 1, size(res_u) print *, asind(res_u(iterator)) if (abs(res_u(iterator) - expected_u(iterator)) > 1e-5_sp) error stop end do x = 0.123 y = 0.876 z = 0.542 i = 0.321 j = 0.526 k = 0.728 print *, asind(x) if (asind(x) - 7.06527281 > 1e-5) error stop print *, asind(y) if (asind(y) - 61.1635399 > 1e-5) error stop print *, asind(z) if (asind(z) - 32.8198891 > 1e-5) error stop print *, asind(i) if (asind(i) - 18.723412014063609_dp > 1e-12) error stop print *, asind(j) if (asind(j) - 31.735588727756351_dp > 1e-12) error stop print *, asind(k) if (asind(k) - 46.7189879975828859_dp > 1e-12) error stop print *, asind(0.123_sp) if (asind(0.123_sp) - 7.06527328 > 1e-5) error stop print *, asind(0.876_sp) if (asind(0.876_sp) - 61.1635437 > 1e-5) error stop print *, asind(0.542_sp) if (asind(0.542_sp) - 32.8198929 > 1e-5) error stop print *, asind(0.321_dp) if (asind(0.321_dp) - 18.723411422692248_dp > 1e-12) error stop print *, asind(0.526_dp) if (asind(0.526_dp) - 31.735587185816161_dp > 1e-12) error stop print *, asind(0.728_dp) if (asind(0.728_dp) - 46.718987997582886_dp > 1e-12) error stop x = -0.123 y = -0.876 z = -0.542 i = -0.321 j = -0.526 k = -0.728 print *, asind(x) if (asind(x) - (-7.06527281) > 1e-5) error stop print *, asind(y) if (asind(y) - (-61.1635399) > 1e-5) error stop print *, asind(z) if (asind(z) - (-32.8198891) > 1e-5) error stop print *, asind(i) if (asind(i) - (-18.7234114226922479_dp) > 1e-12) error stop print *, asind(j) if (asind(j) - (-31.7355871858161613_dp) > 1e-12) error stop print *, asind(k) if (asind(k) - (-46.718986762209930_dp) > 1e-12) error stop end program lfortran-0.63.0/integration_tests/class_101.f900000664000175000017500000000314215174404631021373 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/7640 ! Deferred function on polymorphic member returned wrong results (all zeros) ! MRE from issue comment by kmr-srbh module class_101_mod type, abstract :: AbsType contains procedure(method2), deferred :: method2 end type AbsType abstract interface function method2(self,arr) result(a) import class(AbsType), intent(in) :: self integer, intent(in) :: arr(:) integer :: a(size(arr)) end function method2 end interface type :: SomeType integer, allocatable :: arr(:) class(AbsType), allocatable :: obj contains procedure :: method1 end type SomeType type, extends(AbsType) :: MyType contains procedure :: method2 => my_method2 end type MyType contains subroutine method1(self) class(SomeType), intent(inout) :: self self%arr = self%obj%method2(self%arr) end subroutine method1 function my_method2(self, arr) result(a) class(MyType), intent(in) :: self integer, intent(in) :: arr(:) integer :: a(size(arr)) integer :: i do i = 1, size(arr) a(i) = arr(i) * 2 end do end function my_method2 end module class_101_mod program class_101 use class_101_mod implicit none class(SomeType), allocatable :: s allocate(s) allocate(s%arr(3)) allocate(MyType :: s%obj) s%arr = [1, 2, 3] call s%method1() if (s%arr(1) /= 2) error stop if (s%arr(2) /= 4) error stop if (s%arr(3) /= 6) error stop print *, "PASS" end program class_101 lfortran-0.63.0/integration_tests/bindc_iso_fb_05c.c0000664000175000017500000005036315174404631022607 0ustar alastairalastair/* * Consolidated C helpers for bindc_iso_fb_05 * * Merged from: bindc_21c, bindc_23c, bindc_25c, bindc_29c, * bindc_34c, bindc_40c, bindc_42c, bindc_44c */ #include #include #include #include #include #include #include /* ============================================================ * Shared static helpers * (identical definition in bindc_21c, bindc_23c, bindc_29c — kept once) * ============================================================ */ static int32_t sum_i32(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) return *(int32_t *)base; int32_t total = 0; for (CFI_index_t i = 0; i < d[k].extent; i++) total += sum_i32(base + i * d[k].sm, d, rank, k + 1); return total; } /* ============================================================ * From bindc_21c.c * ============================================================ */ static void dbl_i32(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) { *(int32_t *)base *= 2; return; } for (CFI_index_t i = 0; i < d[k].extent; i++) dbl_i32(base + i * d[k].sm, d, rank, k + 1); } /* ---- assumed-rank inout ---- */ void c21_double_ar(CFI_cdesc_t *a) { dbl_i32((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- assumed-rank typed sums ---- */ static int64_t sum_i64(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) return *(int64_t *)base; int64_t total = 0; for (CFI_index_t i = 0; i < d[k].extent; i++) total += sum_i64(base + i * d[k].sm, d, rank, k + 1); return total; } int64_t c21_sum_ar_i64(CFI_cdesc_t *a) { return sum_i64((char *)a->base_addr, a->dim, (int)a->rank, 0); } static double sum_f64(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) return *(double *)base; double total = 0; for (CFI_index_t i = 0; i < d[k].extent; i++) total += sum_f64(base + i * d[k].sm, d, rank, k + 1); return total; } int c21_sum_ar_dbl(CFI_cdesc_t *a) { return (int)sum_f64((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- optional assumed-rank ---- */ int c21_opt_ar_present(CFI_cdesc_t *a) { return (a != NULL) ? 1 : 0; } /* ---- optional scalar ---- */ int c21_opt_scalar_present(int32_t *x) { return (x != NULL) ? 1 : 0; } int32_t c21_opt_scalar_value(int32_t *x) { return (x != NULL) ? *x : 0; } /* ---- multiple descriptor arguments ---- */ int32_t c21_dot_product(CFI_cdesc_t *a, CFI_cdesc_t *b) { int32_t total = 0; char *ba = (char *)a->base_addr; char *bb = (char *)b->base_addr; for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { int32_t va = *(int32_t *)(ba + i * a->dim[0].sm); int32_t vb = *(int32_t *)(bb + i * b->dim[0].sm); total += va * vb; } return total; } void c21_add_arrays(CFI_cdesc_t *a, CFI_cdesc_t *b, CFI_cdesc_t *c) { char *ba = (char *)a->base_addr; char *bb = (char *)b->base_addr; char *bc = (char *)c->base_addr; for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { int32_t va = *(int32_t *)(ba + i * a->dim[0].sm); int32_t vb = *(int32_t *)(bb + i * b->dim[0].sm); *(int32_t *)(bc + i * c->dim[0].sm) = va + vb; } } /* ============================================================ * From bindc_23c.c * (sum_i32 already defined above as shared helper) * ============================================================ */ /* ---- character assumed-shape ---- */ int c23_char_sum_1d(CFI_cdesc_t *a) { int total = 0; char *base = (char *)a->base_addr; for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { unsigned char *ch = (unsigned char *)(base + i * a->dim[0].sm); total += *ch; } return total; } /* ---- assumed-rank rank query (scalar = rank 0) ---- */ int c23_get_rank(CFI_cdesc_t *a) { return (int)a->rank; } /* ---- optional allocatable ---- */ int c23_opt_alloc_present(CFI_cdesc_t *a) { return (a != NULL) ? 1 : 0; } int32_t c23_opt_alloc_sum(CFI_cdesc_t *a) { if (a == NULL) return 0; return sum_i32((char *)a->base_addr, a->dim, (int)a->rank, 0); } /* ---- optional pointer ---- */ int c23_opt_ptr_present(CFI_cdesc_t *a) { return (a != NULL) ? 1 : 0; } /* ---- C calling Fortran with descriptor ---- */ extern int32_t fortran_sum_1d(CFI_cdesc_t *a); int32_t c23_call_fortran_sum(CFI_cdesc_t *a) { return fortran_sum_1d(a); } /* ============================================================ * From bindc_25c.c * ============================================================ */ /* Fortran procedure declarations */ extern void f25_double_1d(CFI_cdesc_t *a); extern int32_t f25_sum_1d(CFI_cdesc_t *a); extern int32_t f25_sum_2d(CFI_cdesc_t *a); extern int f25_get_rank(CFI_cdesc_t *a); extern int f25_opt_present(CFI_cdesc_t *a); extern int32_t f25_sum_contig(CFI_cdesc_t *a); extern void f25_fill_array(CFI_cdesc_t *a); extern int32_t f25_dot(CFI_cdesc_t *a, CFI_cdesc_t *b); extern void f25_add(CFI_cdesc_t *a, CFI_cdesc_t *b, CFI_cdesc_t *c); extern int32_t f25_sum_pairs(CFI_cdesc_t *pts); extern void f25_sum_complex(CFI_cdesc_t *a, float *re, float *im); extern int f25_count_true(CFI_cdesc_t *a); extern int32_t f25_square(int32_t x); extern float _Complex f25_conj(float _Complex z); typedef struct { int32_t a; int32_t b; } pair_t; /* Helper: set up a 1D int32 descriptor */ static void setup_1d_i32(CFI_cdesc_t *desc, int32_t *data, CFI_index_t n, CFI_attribute_t attr) { CFI_index_t extents[1] = { n }; CFI_establish(desc, data, attr, CFI_type_int32_t, sizeof(int32_t), 1, extents); } /* Helper: set up a 2D int32 descriptor */ static void setup_2d_i32(CFI_cdesc_t *desc, int32_t *data, CFI_index_t n1, CFI_index_t n2) { CFI_index_t extents[2] = { n1, n2 }; CFI_establish(desc, data, CFI_attribute_other, CFI_type_int32_t, sizeof(int32_t), 2, extents); } int c25_run_all_tests(void) { /* ---- Test 1: C calls Fortran subroutine with assumed-shape 1D ---- */ { int32_t data[4] = {1, 2, 3, 4}; CFI_CDESC_T(1) desc; setup_1d_i32((CFI_cdesc_t *)&desc, data, 4, CFI_attribute_other); f25_double_1d((CFI_cdesc_t *)&desc); if (data[0] != 2 || data[1] != 4 || data[2] != 6 || data[3] != 8) return 1; } /* ---- Test 2: C calls Fortran function with assumed-shape 1D ---- */ { int32_t data[5] = {10, 20, 30, 40, 50}; CFI_CDESC_T(1) desc; setup_1d_i32((CFI_cdesc_t *)&desc, data, 5, CFI_attribute_other); if (f25_sum_1d((CFI_cdesc_t *)&desc) != 150) return 2; } /* ---- Test 3: C calls Fortran with assumed-shape 2D ---- */ { int32_t data[6] = {1, 2, 3, 4, 5, 6}; CFI_CDESC_T(2) desc; setup_2d_i32((CFI_cdesc_t *)&desc, data, 2, 3); if (f25_sum_2d((CFI_cdesc_t *)&desc) != 21) return 3; } /* ---- Test 4: C calls Fortran with assumed-rank (1D and 2D) ---- */ { int32_t data1[3] = {1, 2, 3}; CFI_CDESC_T(1) desc1; setup_1d_i32((CFI_cdesc_t *)&desc1, data1, 3, CFI_attribute_other); if (f25_get_rank((CFI_cdesc_t *)&desc1) != 1) return 4; int32_t data2[6] = {1, 2, 3, 4, 5, 6}; CFI_CDESC_T(2) desc2; setup_2d_i32((CFI_cdesc_t *)&desc2, data2, 2, 3); if (f25_get_rank((CFI_cdesc_t *)&desc2) != 2) return 5; } /* ---- Test 5: C calls Fortran with optional (present) ---- */ { int32_t data[2] = {1, 2}; CFI_CDESC_T(1) desc; setup_1d_i32((CFI_cdesc_t *)&desc, data, 2, CFI_attribute_other); if (f25_opt_present((CFI_cdesc_t *)&desc) != 1) return 5; } /* ---- Test 6: C calls Fortran with optional (absent = NULL) ---- */ { if (f25_opt_present(NULL) != 0) return 6; } /* ---- Test 7: C calls Fortran with CONTIGUOUS ---- */ { int32_t data[4] = {1, 2, 3, 4}; CFI_CDESC_T(1) desc; setup_1d_i32((CFI_cdesc_t *)&desc, data, 4, CFI_attribute_other); if (f25_sum_contig((CFI_cdesc_t *)&desc) != 10) return 7; } /* ---- Test 8: C calls Fortran with intent(out) ---- */ { int32_t data[3] = {0, 0, 0}; CFI_CDESC_T(1) desc; setup_1d_i32((CFI_cdesc_t *)&desc, data, 3, CFI_attribute_other); f25_fill_array((CFI_cdesc_t *)&desc); if (data[0] != 10 || data[1] != 20 || data[2] != 30) return 8; } /* ---- Test 9: C calls Fortran with multiple descriptors (dot) ---- */ { int32_t a[3] = {1, 2, 3}; int32_t b[3] = {4, 5, 6}; CFI_CDESC_T(1) da, db; setup_1d_i32((CFI_cdesc_t *)&da, a, 3, CFI_attribute_other); setup_1d_i32((CFI_cdesc_t *)&db, b, 3, CFI_attribute_other); /* dot = 1*4 + 2*5 + 3*6 = 32 */ if (f25_dot((CFI_cdesc_t *)&da, (CFI_cdesc_t *)&db) != 32) return 9; } /* ---- Test 10: C calls Fortran with 3 descriptors (add) ---- */ { int32_t a[3] = {10, 20, 30}; int32_t b[3] = {1, 2, 3}; int32_t c[3] = {0, 0, 0}; CFI_CDESC_T(1) da, db, dc; setup_1d_i32((CFI_cdesc_t *)&da, a, 3, CFI_attribute_other); setup_1d_i32((CFI_cdesc_t *)&db, b, 3, CFI_attribute_other); setup_1d_i32((CFI_cdesc_t *)&dc, c, 3, CFI_attribute_other); f25_add((CFI_cdesc_t *)&da, (CFI_cdesc_t *)&db, (CFI_cdesc_t *)&dc); if (c[0] != 11 || c[1] != 22 || c[2] != 33) return 10; } /* ---- Test 11: C calls Fortran with derived type array ---- */ { pair_t pts[3] = {{1, 10}, {2, 20}, {3, 30}}; CFI_CDESC_T(1) desc; CFI_index_t ext[1] = {3}; CFI_establish((CFI_cdesc_t *)&desc, pts, CFI_attribute_other, CFI_type_struct, sizeof(pair_t), 1, ext); /* sum = (1+10) + (2+20) + (3+30) = 66 */ if (f25_sum_pairs((CFI_cdesc_t *)&desc) != 66) return 11; } /* ---- Test 12: C calls Fortran with complex array ---- */ { float _Complex cdata[3]; cdata[0] = 1.0f + 2.0f * I; cdata[1] = 3.0f + 4.0f * I; cdata[2] = 5.0f + 6.0f * I; CFI_CDESC_T(1) desc; CFI_index_t ext[1] = {3}; CFI_establish((CFI_cdesc_t *)&desc, cdata, CFI_attribute_other, CFI_type_float_Complex, sizeof(float _Complex), 1, ext); float re = 0, im = 0; f25_sum_complex((CFI_cdesc_t *)&desc, &re, &im); if (re < 8.9f || re > 9.1f) return 12; if (im < 11.9f || im > 12.1f) return 13; } /* ---- Test 13: C calls Fortran with logical array ---- */ { unsigned char bdata[5] = {1, 0, 1, 1, 0}; CFI_CDESC_T(1) desc; CFI_index_t ext[1] = {5}; CFI_establish((CFI_cdesc_t *)&desc, bdata, CFI_attribute_other, CFI_type_Bool, sizeof(unsigned char), 1, ext); if (f25_count_true((CFI_cdesc_t *)&desc) != 3) return 14; } /* ---- Test 14: C calls Fortran function returning scalar ---- */ { if (f25_square(7) != 49) return 15; if (f25_square(-5) != 25) return 16; } /* ---- Test 15: C calls Fortran function returning complex ---- */ { float _Complex z = 3.0f + 4.0f * I; float _Complex result = f25_conj(z); float re = crealf(result); float im = cimagf(result); if (re < 2.9f || re > 3.1f) return 17; if (im < -4.1f || im > -3.9f) return 18; } return 0; } /* ============================================================ * From bindc_29c.c * (sum_i32 already defined above as shared helper) * ============================================================ */ /* ---- C global variables bound to Fortran module variables ---- */ int32_t c29_global_arr[4] = {10, 20, 30, 40}; typedef struct { double x; double y; double z; } vec3_t; vec3_t c29_global_vec = {1.0, 2.0, 3.0}; _Bool c29_global_flag = 1; int32_t c29_global_counter = 42; /* ---- check globals are initialized ---- */ int c29_check_globals(void) { if (c29_global_arr[0] != 10) return 1; if (c29_global_arr[1] != 20) return 2; if (c29_global_arr[2] != 30) return 3; if (c29_global_arr[3] != 40) return 4; if (c29_global_vec.x != 1.0) return 5; if (c29_global_vec.y != 2.0) return 6; if (c29_global_vec.z != 3.0) return 7; if (!c29_global_flag) return 8; if (c29_global_counter != 42) return 9; return 0; } /* ---- verify Fortran writes ---- */ int c29_verify_writes(void) { if (c29_global_arr[0] != 100) return 1; if (c29_global_arr[1] != 200) return 2; if (c29_global_arr[2] != 300) return 3; if (c29_global_arr[3] != 400) return 4; if (c29_global_counter != 99) return 5; return 0; } /* ---- descriptor type code queries ---- * Return 1 if the descriptor's type matches the expected CFI_type_* macro, * 0 otherwise. The numeric values of type codes are implementation-defined * (GFortran uses a bitfield encoding, Flang uses sequential integers), * so we must compare against the macros on the C side. */ int c29_check_type_int32(CFI_cdesc_t *a) { return (a->type == CFI_type_int32_t) ? 1 : 0; } int c29_check_type_double(CFI_cdesc_t *a) { return (a->type == CFI_type_double) ? 1 : 0; } int c29_check_type_float(CFI_cdesc_t *a) { return (a->type == CFI_type_float) ? 1 : 0; } /* ---- same array to multiple descriptors ---- */ int32_t c29_self_dot(CFI_cdesc_t *a, CFI_cdesc_t *b) { int32_t total = 0; char *ba = (char *)a->base_addr; char *bb = (char *)b->base_addr; for (CFI_index_t i = 0; i < a->dim[0].extent; i++) { int32_t va = *(int32_t *)(ba + i * a->dim[0].sm); int32_t vb = *(int32_t *)(bb + i * b->dim[0].sm); total += va * vb; } return total; } /* ============================================================ * From bindc_34c.c * ============================================================ */ /* ---- ENUM ---- */ enum { COLOR_RED = 0, COLOR_GREEN = 1, COLOR_BLUE = 2 }; int c34_get_color(int idx) { switch (idx) { case 0: return COLOR_RED; case 1: return COLOR_GREEN; case 2: return COLOR_BLUE; default: return -1; } } int c34_check_color(int val, int expected) { return val == expected ? 1 : 0; } /* ---- Derived type with fixed array component ---- */ typedef struct { int32_t data[5]; } vec5_t; int32_t c34_sum_vec5(vec5_t *v) { int32_t s = 0; int i; for (i = 0; i < 5; i++) s += v->data[i]; return s; } int32_t c34_get_vec5_elem(vec5_t *v, int idx) { return v->data[idx]; } /* ---- c_f_procpointer: provide a C function ---- */ static int c34_double_impl(int x) { return x * 2; } typedef void (*generic_func_t)(void); generic_func_t c34_get_func_ptr(void) { return (generic_func_t)c34_double_impl; } /* ---- Module bind(C) variables ---- */ extern char g34_char; extern float _Complex g34_cmplx; void c34_set_globals(char c, float re, float im) { g34_char = c; /* Portable complex construction */ float parts[2]; parts[0] = re; parts[1] = im; __builtin_memcpy(&g34_cmplx, parts, sizeof(g34_cmplx)); } char c34_get_char(void) { return g34_char; } float c34_get_cmplx_re(void) { return crealf(g34_cmplx); } float c34_get_cmplx_im(void) { return cimagf(g34_cmplx); } /* ---- COMMON block with BIND(C) ---- */ extern struct { int32_t x; int32_t y; } c34_common; void c34_set_common(int32_t x, int32_t y) { c34_common.x = x; c34_common.y = y; } int32_t c34_get_common_x(void) { return c34_common.x; } int32_t c34_get_common_y(void) { return c34_common.y; } /* ============================================================ * From bindc_40c.c * ============================================================ */ /* ---- CFI_type_cptr ---- */ int32_t c40_check_cptr_type(CFI_cdesc_t *arr) { return (arr->type == CFI_type_cptr) ? 1 : 0; } /* ---- CFI_type_cfunptr ---- */ int32_t c40_check_cfunptr_type(CFI_cdesc_t *arr) { return (arr->type == CFI_type_cfunptr) ? 1 : 0; } /* ---- Deferred-length allocatable character ---- */ int32_t c40_check_deferred_char(CFI_cdesc_t *s) { if (s->attribute != CFI_attribute_allocatable) return -1; return (int32_t)s->elem_len; } /* ---- Explicit-shape 2D: passed as raw pointer ---- */ int32_t c40_sum_explicit_2d(const int32_t *arr, int32_t r, int32_t c) { int32_t sum = 0; for (int i = 0; i < r * c; i++) sum += arr[i]; return sum; } /* ---- Explicit-shape 3D: passed as raw pointer ---- */ int32_t c40_sum_explicit_3d(const int32_t *arr, int32_t d1, int32_t d2, int32_t d3) { int32_t sum = 0; for (int i = 0; i < d1 * d2 * d3; i++) sum += arr[i]; return sum; } /* ---- Internal BIND(C) proc: C calls back via function pointer ---- */ int32_t c40_call_internal(int32_t (*fp)(int32_t), int32_t x) { return fp(x); } /* ============================================================ * From bindc_42c.c * ============================================================ */ /* ---- Negative-stride CFI_section from C side ---- */ int32_t c42_test_negative_stride_section(void) { /* Create a 1D array [10, 20, 30, 40, 50] */ int32_t data[5] = {10, 20, 30, 40, 50}; CFI_CDESC_T(1) src_s; CFI_cdesc_t *src = (CFI_cdesc_t *)&src_s; CFI_index_t ext[1] = {5}; int rc; rc = CFI_establish(src, data, CFI_attribute_other, CFI_type_int32_t, sizeof(int32_t), 1, ext); if (rc != CFI_SUCCESS) return 0; /* Create section with negative stride: reverse the array */ CFI_CDESC_T(1) res_s; CFI_cdesc_t *res = (CFI_cdesc_t *)&res_s; rc = CFI_establish(res, NULL, CFI_attribute_other, CFI_type_int32_t, sizeof(int32_t), 1, NULL); if (rc != CFI_SUCCESS) return 0; CFI_index_t lb[1] = {4}; /* start from last element */ CFI_index_t ub[1] = {0}; /* end at first */ CFI_index_t st[1] = {-1}; /* negative stride */ rc = CFI_section(res, src, lb, ub, st); if (rc != CFI_SUCCESS) return 0; /* Verify reversed: [50, 40, 30, 20, 10] */ if (res->dim[0].extent != 5) return 0; for (CFI_index_t i = 0; i < 5; i++) { CFI_index_t sub[1] = { res->dim[0].lower_bound + i }; int32_t *val = (int32_t *)CFI_address(res, sub); int32_t expected = (5 - (int)i) * 10; if (*val != expected) return 0; } return 1; } /* ---- SAVE+BIND(C) variable ---- */ extern int32_t g42_save_var; void c42_set_save_var(int32_t val) { g42_save_var = val; } int32_t c42_get_save_var(void) { return g42_save_var; } /* ---- PROTECTED+BIND(C): C can still read (link-level access) ---- */ extern int32_t g42_protected; int32_t c42_get_protected(void) { return g42_protected; } /* ---- Optional allocatable scalar ---- */ int32_t c42_opt_alloc_scalar(CFI_cdesc_t *x) { if (x == NULL) return -1; if (x->base_addr == NULL) return -1; return *(int32_t *)x->base_addr; } /* ---- Optional pointer scalar ---- */ int32_t c42_opt_ptr_scalar(CFI_cdesc_t *x) { if (x == NULL) return -1; if (x->base_addr == NULL) return -1; return *(int32_t *)x->base_addr; } /* ============================================================ * From bindc_44c.c * ============================================================ */ int32_t c44_get_rank(CFI_cdesc_t *a) { return (int32_t)a->rank; } int32_t c44_get_elem_len(CFI_cdesc_t *a) { return (int32_t)a->elem_len; } int32_t c44_total_size(CFI_cdesc_t *a) { if (a->rank == 0) return 1; int32_t total = 1; for (int i = 0; i < a->rank; i++) { total *= (int32_t)a->dim[i].extent; } return total; } static int32_t sum_int32(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) return *(int32_t *)base; int32_t total = 0; for (CFI_index_t i = 0; i < d[k].extent; i++) total += sum_int32(base + i * d[k].sm, d, rank, k + 1); return total; } static int32_t sum_float(char *base, CFI_dim_t *d, int rank, int k) { if (k == rank) return (int32_t)(*(float *)base); int32_t total = 0; for (CFI_index_t i = 0; i < d[k].extent; i++) total += sum_float(base + i * d[k].sm, d, rank, k + 1); return total; } int32_t c44_sum_star(CFI_cdesc_t *a) { if (a->type == CFI_type_int32_t || a->type == CFI_type_int) { return sum_int32((char *)a->base_addr, a->dim, (int)a->rank, 0); } if (a->type == CFI_type_float) { return sum_float((char *)a->base_addr, a->dim, (int)a->rank, 0); } return -999; } int32_t c44_opt_rank(CFI_cdesc_t *a) { if (a == NULL) return -1; return (int32_t)a->rank; } lfortran-0.63.0/integration_tests/equivalence_17.f900000664000175000017500000000355115174404631022521 0ustar alastairalastairprogram equivalence_17 implicit none call test_complex_real_array() call test_real_array_complex() call test_scalar_scalar() call test_array_array() contains subroutine test_complex_real_array() complex :: c1 real :: r1(2) equivalence (c1, r1) r1 = [-42.0, -43.0] c1 = cmplx(0.0, 0.0) if (abs(r1(1)) > 1e-6) error stop "r1(1) should be 0.0 after c1 assignment" if (abs(r1(2)) > 1e-6) error stop "r1(2) should be 0.0 after c1 assignment" r1 = [3.0, 4.0] if (abs(real(c1) - 3.0) > 1e-6) error stop "real(c1) should be 3.0" if (abs(aimag(c1) - 4.0) > 1e-6) error stop "aimag(c1) should be 4.0" end subroutine subroutine test_real_array_complex() real :: r2(2) complex :: c2 equivalence (r2, c2) c2 = cmplx(5.0, 6.0) if (abs(r2(1) - 5.0) > 1e-6) error stop "r2(1) should be 5.0" if (abs(r2(2) - 6.0) > 1e-6) error stop "r2(2) should be 6.0" r2 = [7.0, 8.0] if (abs(real(c2) - 7.0) > 1e-6) error stop "real(c2) should be 7.0" if (abs(aimag(c2) - 8.0) > 1e-6) error stop "aimag(c2) should be 8.0" end subroutine subroutine test_scalar_scalar() integer :: i1 integer :: i2 equivalence (i1, i2) i1 = 42 if (i2 /= 42) error stop "i2 should be 42 after i1 assignment" i2 = 99 if (i1 /= 99) error stop "i1 should be 99 after i2 assignment" end subroutine subroutine test_array_array() integer :: a1(4) integer :: a2(4) equivalence (a1, a2) a1 = [10, 20, 30, 40] if (a2(1) /= 10) error stop "a2(1) should be 10" if (a2(2) /= 20) error stop "a2(2) should be 20" if (a2(3) /= 30) error stop "a2(3) should be 30" if (a2(4) /= 40) error stop "a2(4) should be 40" a2 = [50, 60, 70, 80] if (a1(1) /= 50) error stop "a1(1) should be 50" if (a1(4) /= 80) error stop "a1(4) should be 80" end subroutine end program equivalence_17 lfortran-0.63.0/integration_tests/class_106b.f900000664000175000017500000000167615174404631021554 0ustar alastairalastairmodule class_106b_mod use class_106a_mod, only : AbsType, MyType, ConcreteType implicit none private type, public :: Client contains procedure :: method end type Client contains subroutine method(self, arr) class(Client), intent(in) :: self class(MyType), allocatable, intent(out) :: arr(:) integer :: l, n, nd integer, allocatable :: ints(:) class(AbsType), allocatable :: obj nd = 3 allocate(ints(2)) ints = [1, 2] allocate(ConcreteType :: obj) allocate(MyType :: arr(nd)) arr = MyType(ints, obj) do l = nd-1, 1, -1 do n = 1, nd-l call arr(l)%my_method() end do end do if (.not. allocated(arr)) error stop "arr not allocated" if (size(arr) /= nd) error stop "wrong arr size" end subroutine method end module class_106b_mod lfortran-0.63.0/integration_tests/abort_01.f900000664000175000017500000000010715174404631021312 0ustar alastairalastairprogram abort1 implicit none if (.false.) call abort() end program lfortran-0.63.0/integration_tests/arrays_38.f900000664000175000017500000000111315174404631021514 0ustar alastairalastairpure function linspace_n_1_cdp_cdp(n) result(res) integer, intent(in) :: n complex :: res(max(n, 0)) res = (1.0, 3.0) end function linspace_n_1_cdp_cdp program arrays_38 implicit none integer :: n, i complex :: res(5) complex :: res2(0) interface pure function linspace_n_1_cdp_cdp(n) result(res) integer, intent(in) :: n complex :: res(max(n, 0)) end function linspace_n_1_cdp_cdp end interface res = linspace_n_1_cdp_cdp(5) print *, res do i = 1, 5 if (abs(res(i) - (1.0, 3.0)) > 1e-8) error stop end do res2 = linspace_n_1_cdp_cdp(-3) print *, res2 end program lfortran-0.63.0/integration_tests/read_59.f900000664000175000017500000000200515174404631021132 0ustar alastairalastairmodule read_59_mod implicit none type :: t integer :: x = 0 contains procedure :: ru generic :: read(unformatted) => ru end type t contains subroutine ru(dtv, unit, iostat, iomsg) class(t), intent(inout) :: dtv integer, intent(in) :: unit integer, intent(out) :: iostat character(*), intent(inout) :: iomsg read(unit, iostat=iostat, iomsg=iomsg) dtv%x end subroutine ru end module read_59_mod program read_59 use read_59_mod implicit none type(t) :: a integer :: unit integer :: iostat character(100) :: iomsg open(newunit=unit, file="tmp.bin", form="unformatted", status="replace") write(unit) 42 close(unit) open(newunit=unit, file="tmp.bin", form="unformatted", status="old") read(unit, iostat=iostat, iomsg=iomsg) a close(unit) if (iostat /= 0) error stop "read failed" if (a%x /= 42) error stop "incorrect value" print *, "value:", a%x end program read_59lfortran-0.63.0/integration_tests/intrinsics_154.f900000664000175000017500000000021115174404631022455 0ustar alastairalastairprogram intrinsics_154 integer(8) :: n = 921092378411_8 print *, mod(n, 10_8) if (mod(n, 10_8) /= 1) error stop end program lfortran-0.63.0/integration_tests/modules_11.f900000664000175000017500000000055215174404631021660 0ustar alastairalastairmodule modules_11_module11 implicit none integer :: i = 1 integer :: j = 2 contains subroutine access_internally() print*, "i = ", i end subroutine access_internally end module program access_externally use modules_11_module11 implicit none print*, "j = ", j call access_internally() end program access_externally lfortran-0.63.0/integration_tests/attr_dim_01.f900000664000175000017500000000026515174404631022013 0ustar alastairalastairsubroutine sub (array) dimension array(3) double precision array end subroutine program attr_dim_01 double precision , dimension(3) :: arr call sub(arr) end programlfortran-0.63.0/integration_tests/format_02.f900000664000175000017500000000022015174404631021470 0ustar alastairalastair program format_02 implicit none integer :: i6, format(3) i6 = 2 format(i6) = 3 1 format(i6) end program lfortran-0.63.0/integration_tests/elemental_14.f900000664000175000017500000000174615174404631022167 0ustar alastairalastairmodule elemental_14_mod implicit none type :: number_t real :: val contains procedure :: is_positive end type number_t type :: dec type(number_t), allocatable :: nums(:) end type contains elemental logical function is_positive(self) class(number_t), intent(in) :: self is_positive = self%val > 0.0 end function is_positive end module elemental_14_mod program elemental_14 use elemental_14_mod implicit none type(number_t), dimension(5) :: nums type(dec) :: ele logical :: result integer :: i nums(1)%val = -1.0 nums(2)%val = -2.0 nums(3)%val = -3.0 nums(4)%val = -5.0 nums(5)%val = -6.0 result = any(nums%is_positive()) if (result .neqv. .false.) error stop nums(1)%val = 1.0 result = any(nums%is_positive()) if (result .neqv. .true.) error stop allocate(ele%nums(2)) ele%nums(2)%val = -1.0 ele%nums(1)%val = -1.0 result = any(ele%nums%is_positive()) if (result .neqv. .false.) error stop end program elemental_14lfortran-0.63.0/integration_tests/associate_30.f900000664000175000017500000000110215174404631022154 0ustar alastairalastair! Test: associate with implied-do array constructor (runtime-sized) module associate_30_mod implicit none contains logical function f(args) character(len=*), intent(in) :: args(:) integer :: i associate(lengths => [(len(trim(args(i))), i = 1, size(args))]) f = any(lengths > 0) end associate end function end module program associate_30 use associate_30_mod, only : f logical :: res res = f(["hello"]) if (.not. res) error stop res = f(["hello", "world"]) if (.not. res) error stop res = f([" "]) if (res) error stop end program lfortran-0.63.0/integration_tests/string_33.f900000664000175000017500000000024315174404631021517 0ustar alastairalastairprogram string_33 implicit none character(len=1) :: str write(str, '(a)') "A" print *, "|"//str//"|" if (str /= "A") error stop end program lfortran-0.63.0/integration_tests/pdt_04.f900000664000175000017500000000253215174404631021001 0ustar alastairalastairmodule pdt_04_mod use iso_fortran_env implicit none type :: base(ik) integer, kind :: ik = int32 integer(ik) :: a end type base type, extends(base) :: mid(rk) integer, kind :: rk = real32 real(rk) :: b end type mid type, extends(mid) :: leaf(ck) integer, kind :: ck = int8 integer(ck) :: c end type leaf end module pdt_04_mod program pdt_04 use pdt_04_mod use iso_fortran_env implicit none type(leaf) :: d0 ! all defaults type(leaf(ck=int16)) :: d1 ! override leaf only type(leaf(ik=int64)) :: d2 ! override base only type(leaf(int64, real64, int32)) :: d3 ! positional ! Default check if (d0%ik /= int32) error stop "default ik wrong" if (d0%rk /= real32) error stop "default rk wrong" if (d0%ck /= int8) error stop "default ck wrong" ! Leaf-only override if (d1%ck /= int16) error stop "ck override failed" if (d1%ik /= int32) error stop "ik changed unexpectedly" ! Base-only override if (d2%ik /= int64) error stop "ik override failed" if (storage_size(d2%a) /= 64) error stop "storage mismatch" ! Positional if (d3%ik /= int64) error stop "pos ik wrong" if (d3%rk /= real64) error stop "pos rk wrong" if (d3%ck /= int32) error stop "pos ck wrong" print *, "MRE 2 passed" end program pdt_04lfortran-0.63.0/integration_tests/arrays_115.f900000664000175000017500000000254415174404631021601 0ustar alastairalastairmodule arrays_115_mod implicit none type :: multihead_attention_layer integer :: sequence_length integer :: model_dimension end type multihead_attention_layer contains function combine_heads(self, input) result(output) class(multihead_attention_layer), intent(in) :: self real, intent(in), target :: input(:, :, :) real :: output(self%sequence_length, self%model_dimension) integer :: seq, i, j ! Pointer used to mimic temporary flattening do concurrent (seq = 1:self%sequence_length) output(seq, :) = reshape(input(:, :, 1), [self%model_dimension]) end do end function combine_heads end module arrays_115_mod program arrays_115 use arrays_115_mod implicit none type(multihead_attention_layer) :: self real :: input(2,2,1) real, allocatable :: output(:,:) integer :: i,j self%sequence_length = 3 self%model_dimension = 4 ! initialize input input(:,:,1) = reshape([1.0,2.0,3.0,4.0],[2,2]) output = combine_heads(self, input) if (size(output,1) /= self%sequence_length .or. size(output,2) /= self%model_dimension) then error stop "output size mismatch" end if ! Check output values do i = 1, self%sequence_length if (any(output(i, :) /= [1.0, 2.0, 3.0, 4.0])) then error stop "output values mismatch" end if end do print *, "Passed" end program arrays_115lfortran-0.63.0/integration_tests/derived_types_97.f900000664000175000017500000000040215174404631023066 0ustar alastairalastairprogram test_derived_types_97 use derived_types_97_mod2 implicit none type(point_t) :: p call create_point(p) if (p%x /= 10) error stop if (p%y /= 20) error stop print *, "OK" end program test_derived_types_97 lfortran-0.63.0/integration_tests/intrinsic_reduce_01.f900000664000175000017500000000102315174404631023532 0ustar alastairalastair! MRE for Fortran 2018 reduce(array, operation, dim=...) program intrinsic_reduce_01 implicit none integer :: a(2, 3) integer :: expected(2) integer :: i a = reshape([(i, i = 1, 6)], [2, 3]) ! reduce along dim 2: row 1 -> 1+3+5 = 9, row 2 -> 2+4+6 = 12 expected = reduce(a, add_i, dim=2) if (expected(1) /= 9) error stop if (expected(2) /= 12) error stop contains pure integer function add_i(x, y) integer, intent(in) :: x, y add_i = x + y end function add_i end program lfortran-0.63.0/integration_tests/string_74.f900000664000175000017500000000052115174404631021523 0ustar alastairalastair ! This tests the speed of assigning substrings of a string to another string. ! It used to fill the memory and kills the process. program string_74 character(100000) :: str character(100000) :: str_2 integer :: i str = "whatever" do i =1 , 100000 str_2 = str_2(1:i) end do end program string_74lfortran-0.63.0/integration_tests/derived_types_115_module.f900000664000175000017500000000116115174404631024505 0ustar alastairalastair! Test: defined assignment with non-struct RHS should not be called ! when doing intrinsic struct-to-struct copy. module derived_types_115_module implicit none type :: inner_t logical :: test_passed = .false. contains procedure :: assign_logical generic :: assignment(=) => assign_logical end type type :: outer_t type(inner_t) :: component integer :: val = 0 end type contains subroutine assign_logical(lhs, rhs) class(inner_t), intent(out) :: lhs logical, intent(in) :: rhs lhs%test_passed = rhs end subroutine end module lfortran-0.63.0/integration_tests/format_18.f900000664000175000017500000000175015174404631021510 0ustar alastairalastairmodule format_18_mod implicit none contains character(100) function logical_to_string(value, format) logical :: value character(len=*) :: format ! character(len=100), allocatable :: string character(len=100) :: buffer integer :: stat ! If format isn't equal to `l`, it should raise a runtime error ! but instead it would just set stat to not 0 (which indicates an error) write(buffer, "(" // format // ")", iostat=stat) value ! Note : if iostat isn't passed a runtime error would be raised. if (stat == 0) then logical_to_string = trim(buffer) else logical_to_string = "[*]" end if end function logical_to_string end module format_18_mod program name use format_18_mod implicit none logical :: logi character(100) :: str logi = .true. str = logical_to_string(logi, "(I5)") print *, str if(str /= "[*]") error stop end program name lfortran-0.63.0/integration_tests/pointer_11.f900000664000175000017500000000156315174404631021673 0ustar alastairalastairprogram pointer_11 implicit none real, allocatable, target :: a(:) real, pointer :: p(:) integer :: i allocate(a(5)) do i = 1, 5 a(i) = real(i * 10) end do ! Pointer bounds remapping: p(1:5) => a p(1:5) => a if (size(p) /= 5) error stop do i = 1, 5 if (abs(p(i) - a(i)) > 1.0e-6) error stop end do ! Pointer bounds remapping with different lower bound: p(0:4) => a p(0:4) => a if (size(p) /= 5) error stop if (lbound(p, 1) /= 0) error stop if (ubound(p, 1) /= 4) error stop do i = 0, 4 if (abs(p(i) - a(i + 1)) > 1.0e-6) error stop end do ! Pointer bounds remapping to a subsection: p(1:3) => a(1:3) p(1:3) => a(1:3) if (size(p) /= 3) error stop do i = 1, 3 if (abs(p(i) - a(i)) > 1.0e-6) error stop end do print *, "PASS" end program pointer_11 lfortran-0.63.0/integration_tests/doloop_01.f900000664000175000017500000000223315174404631021501 0ustar alastairalastairprogram doloop_01 implicit none integer :: i, j j = 0 do i = 1, 10 j = j + i end do if (j /= 55) error stop print *, j j = 0 do i = 10, 1, -1 j = j + i end do if (j /= 55) error stop print *, j j = 0 do i = 1, 9, 2 j = j + i end do if (j /= 25) error stop print *, j j = 0 do i = 9, 1, -2 j = j + i end do if (j /= 25) error stop print *, j j = 0 do i = 1, 10, 2 j = j + i end do if (j /= 25) error stop print *, j j = 0 do i = 1, 10, 3 j = j + i end do if (j /= 22) error stop print *, j j = 0 do i = 10, 1, -3 j = j + i end do if (j /= 22) error stop print *, j j = 0 do i = 1, 1 j = j + i end do if (j /= 1) error stop print *, j j = 0 do i = 1, 1, -1 j = j + i end do if (j /= 1) error stop print *, j j = 0 do i = 1, 0 j = j + i end do if (j /= 0) error stop print *, j j = 0 do i = 0, 1, -1 j = j + i end do if (j /= 0) error stop print *, j end lfortran-0.63.0/integration_tests/declaration_04.f900000664000175000017500000000064615174404631022503 0ustar alastairalastair! Handle assignment from parameters of struct type ! Inside Declaration using type() syntax program declaration_04 implicit none type class_t integer :: i character(len=5) :: s end type type(class_t) , parameter :: T_ONE = class_t(15,'abcde') type(class_t) :: my_class = T_ONE print *, my_class if ((my_class%i) /= 15) error stop if ((my_class%s) /= 'abcde') error stop end program declaration_04lfortran-0.63.0/integration_tests/intrinsics_367.f900000664000175000017500000000155115174404631022473 0ustar alastairalastairPROGRAM intrinsics_367 CHARACTER(len=255) :: test_env_var integer :: stat CALL get_environment_variable("LFORTRAN_TEST_ENV_VAR", test_env_var) WRITE (*,*) TRIM(test_env_var) if (trim(test_env_var) /= "STATUS OK!") error stop test_env_var = "" call get_environment_variable("LFORTRAN_TEST_ENV_VAR", test_env_var, status=stat) print *, trim(test_env_var) if (stat /= 0) error stop if (trim(test_env_var) /= "STATUS OK!") error stop test_env_var = "" call get_environment_variable("LFORTRAN_TEST_ENV_VAR_MISSING", test_env_var, status=stat) if (stat == 0) error stop if (trim(test_env_var) /= "") error stop ! Test with only name and status (no value parameter) call get_environment_variable("LFORTRAN_TEST_ENV_VAR", status=stat) if (stat /= 0) error stop call get_environment_variable("LFORTRAN_TEST_ENV_VAR_MISSING", status=stat) if (stat == 0) error stop END PROGRAM lfortran-0.63.0/integration_tests/interface_16.f900000664000175000017500000000357215174404631022162 0ustar alastairalastair! This integration test tests for the comparison of `Var_t` expressions ! at runtime. ! ! The test is framed such that it checks if a variable passed from ! one subroutine to another for setting the dimension of an array works. ! ! The underlying idea is that when a variable is used to set the dimension ! of an array in a subroutine, the passed variable is internally checked for ! equality of expression with the parameter variable. If the variable ! expressions are equal, the program will execute, else it will fail. ! ! ! This means that for a subroutine ! ! SUBROUTINE subroutine_1 ( arr_1, nx ) ! ! INTEGER, DIMENSION(nx), INTENT(IN) :: arr_1 ! ! INTEGER, INTENT(IN) :: nx ! ! END SUBROUTINE subroutine_1 ! ! and another subroutine ! ! SUBROUTINE subroutine_2 ( arr_2, ny ) ! ! INTEGER, DIMENSION(ny):: arr_2 ! ! INTEGER, INTENT(IN) :: ny ! ! CALL subroutine_1 ( arr_2, ny ) ! ! END SUBROUTINE subroutine_2 ! ! ! the expression type of the argument variable `ny` to `subroutine_1` must be equal to ! the parameter variable `nx`. MODULE module_interface_16 INTERFACE sub MODULE PROCEDURE subroutine_1 END INTERFACE sub CONTAINS SUBROUTINE subroutine_1 ( arr_1, nx ) INTEGER, DIMENSION(nx), INTENT(IN) :: arr_1 INTEGER, INTENT(IN) :: nx PRINT *, nx IF (nx /= 4) ERROR STOP PRINT *, arr_1 IF (all(arr_1 /= [1, 2, 3, 4])) ERROR STOP END SUBROUTINE subroutine_1 SUBROUTINE subroutine_2 ( arr_2, ny ) INTEGER, DIMENSION(ny):: arr_2 INTEGER, INTENT(IN) :: ny CALL subroutine_1 ( arr_2, ny ) END SUBROUTINE subroutine_2 END MODULE module_interface_16 PROGRAM interface_16 USE module_interface_16 IMPLICIT NONE INTEGER :: n INTEGER, DIMENSION(4) :: test_arr n = 4 test_arr = [1, 2, 3, 4] CALL subroutine_2( test_arr, n ) END PROGRAM interface_16 lfortran-0.63.0/integration_tests/realloc_lhs_20.f900000664000175000017500000000056715174404631022505 0ustar alastairalastairprogram realloc_lhs_20 implicit none type :: t integer, allocatable :: arr(:) end type t type(t) :: a, b allocate(a%arr(0:3)) a%arr = [2, 3, 3, 1] b%arr = a%arr if (.not. allocated(b%arr)) error stop if (size(b%arr) /= size(a%arr)) error stop if (any(b%arr /= a%arr)) error stop end program realloc_lhs_20 lfortran-0.63.0/integration_tests/allocate_47.f900000664000175000017500000000064715174404631022012 0ustar alastairalastairprogram allocate_47 implicit none character(:), allocatable :: stuff(:) allocate(character(5) :: stuff(3)) stuff(1) = 'hello' stuff(2) = 'world' stuff(3) = 'test!' if (len(stuff(1)) /= 5) error stop if (size(stuff) /= 3) error stop if (stuff(1) /= 'hello') error stop if (stuff(2) /= 'world') error stop if (stuff(3) /= 'test!') error stop print *, stuff deallocate(stuff) end program allocate_47 lfortran-0.63.0/integration_tests/gpu_metal_194.f900000664000175000017500000000057215174404631022263 0ustar alastairalastairprogram gpu_metal_194 ! Test: all() on a 2D array section inside do concurrent iterates ! over all elements, not just the diagonal. implicit none real :: a(2, 2), b(2, 2) logical :: res integer :: l a = 1.0 b = 1.0 a(1, 2) = 2.0 do concurrent(l = 1:1) res = all(a(1:2, 1:2) == b(1:2, 1:2)) end do if (res) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/namelist_02.f900000664000175000017500000000047715174404631022032 0ustar alastairalastairprogram namelist_01 implicit none integer :: count = 10 integer :: max_iter = 100 real :: tolerance = 1.0e-6 real :: factor = 1.5 logical :: verbose = .false. character(len=30) :: method = 'default' namelist /config/ count, max_iter, tolerance, factor, verbose, method end program namelist_01 lfortran-0.63.0/integration_tests/select_rank_07.f900000664000175000017500000000140115174404631022501 0ustar alastairalastairprogram select_rank_07 implicit none integer :: a(2) = [4, 2] integer :: b(2, 3) = reshape([1, 2, 3, 4, 5, 6], [2, 3]) call check(a) call check(b) contains subroutine check(x) integer, intent(inout) :: x(..) integer, save :: a(2) = [5, 3] integer, save :: b(2, 3) = reshape([6, 5, 4, 3, 2, 1], [2, 3]) select rank(x) rank (1) x = a print *, x if (x(1) /= 5 .or. x(2) /= 3) error stop rank (2) x = b print *, x if (x(1,1) /= 6 .or. x(2,1) /= 5 .or. x(1,2) /= 4 .or. & x(2,2) /= 3 .or. x(1,3) /= 2 .or. x(2,3) /= 1) error stop end select end subroutine check end program select_rank_07 lfortran-0.63.0/integration_tests/modules_58.f900000664000175000017500000000021715174404631021671 0ustar alastairalastairprogram test_external_symbol use module_58_module02 call mms_allocate() call test_alocate_external end program test_external_symbollfortran-0.63.0/integration_tests/implied_do_loops_strings.f900000664000175000017500000000102315174404631024773 0ustar alastairalastairprogram test_implied_do_loops_string implicit none integer :: i character(len=:), allocatable :: keywords(:) character(len=10) :: val character(len=5), allocatable :: fixed_str(:) keywords = [(val, i=1, 3)] if (size(keywords) /= 3) error stop "Test 1 Failed: size mismatch" fixed_str = [("test"//char(i+48), i=0, 2)] if (size(fixed_str) /= 3) error stop "Test 2 Failed: size mismatch" print *, "All tests passed!" end program test_implied_do_loops_string lfortran-0.63.0/integration_tests/intrinsics_251.f900000664000175000017500000000361615174404631022467 0ustar alastairalastairprogram intrinsics_251 use, intrinsic :: iso_fortran_env, only: sp => real32, dp => real64 real(sp), parameter :: r1 = erf(1.1_sp) real(dp), parameter :: r2 = erf(40.12_dp) real(sp), parameter :: ar1(3) = erf([0.5_sp, -1.5_sp, 2.2_sp]) real(dp), parameter :: ar2(2) = erf([-0.2_dp, 0.0_dp]) real(sp) :: x real(dp) :: y, z real(sp) :: arr1(3) real(dp) :: arr2(3), res(3) x = 6.738377383_sp y = 3.1473863781_dp z = 7389.83936383_dp print *, erf(x) if (abs(erf(x) - 1.00000000e+00_sp) > 1e-6) error stop print *, erf(y) if (abs(erf(y) - 9.99991455910536065e-01_dp) > 1e-12) error stop print *, erf(z) if (abs(erf(z) - 1.00000000000000000e+00_dp) > 1e-12) error stop x = -6.738377383_sp y = -3.1473863781_dp z = -7389.83936383_dp print *, erf(x) if (abs(erf(x) - (-1.00000000e+00_sp)) > 1e-6) error stop print *, erf(y) if (abs(erf(y) - (-9.99991455910536065e-01_dp)) > 1e-12) error stop print *, erf(z) if (abs(erf(z) - (-1.00000000000000000e+00_dp)) > 1e-12) error stop print *, r1 if (abs(r1 - 8.80205095e-01_sp) > 1e-6_sp) error stop print *, r2 if (abs(r2 - 1.00000000000000000e+00_dp) > 1e-12_dp) error stop print *, ar1 if (any(abs(ar1 - [5.20499885e-01_sp, -9.66105163e-01_sp, 9.98137176e-01_sp]) > 1e-6_sp)) error stop print *, ar2 if (any(abs(ar2 - [-2.22702589210478474e-01_dp, 0.00000000000000000e+00_dp]) > 1e-12_dp)) error stop arr1 = [-6.738377383_sp, -3.1473863781_sp, -7389.83936383_sp] print *, erf(arr1) if (any(abs(erf(arr1) - [-1.00000000e+00_sp, -9.99991477e-01_sp, -1.00000000e+00_sp]) > 1e-6_sp)) error stop arr2 = [6.738377383_dp, 3.1473863781_dp, 7389.83936383_dp] res = erf(arr2) print *, res if (any(abs(res - [1.00000000000000000e+00_dp, 9.99991455910536065e-01_dp, 1.00000000000000000e+00_dp]) > 1e-12_dp)) error stop end programlfortran-0.63.0/integration_tests/select_type_05.f900000664000175000017500000000407515174404631022537 0ustar alastairalastairprogram select_type_05 implicit none type point real :: x, y end type point type line type(point) :: start type(point) :: end end type line ! TODO: test with point_arr(10) type(point) :: point_arr type(line) :: line_arr integer :: case_int, case_real, case_default, case_point, case_line integer :: intarr(10) real(8) :: realarr(10) complex :: complexarr(10) call get_sum(intarr, case_int) call get_sum(realarr, case_real) call get_sum(complexarr, case_default) call get_sum_polymorphic(point_arr, case_point) call get_sum_polymorphic(line_arr, case_line) print *, case_int, case_real, case_default, case_point, case_line if (case_int /= 0) error stop if (case_real /= 1) error stop if (case_default /= 2) error stop if (case_point /= 3) error stop if (case_line /= 4) error stop contains subroutine get_sum(generic, selected_case) class(*) :: generic(:) integer, intent(out) :: selected_case integer :: i, isum real :: rsum ! TODO: Add case type is (point) select type(generic) type is (integer) isum = 0 do i = 1, 10 isum = isum + generic(i) end do print *, isum selected_case = 0 type is (real(8)) rsum = 0.0 do i = 1, 10 rsum = rsum + generic(i) end do print *, rsum selected_case = 1 class default print *, '*get_sum* crud -- procedure does not know about this type' selected_case = 2 end select end subroutine get_sum subroutine get_sum_polymorphic(generic, selected_case) class(*) :: generic integer, intent(out) :: selected_case select type(generic) type is (point) print *, "point" selected_case = 3 type is (line) print *, "line" selected_case = 4 class default print *, '*get_sum_polymorphic* crud -- procedure does not know about this type' selected_case = 2 end select end subroutine get_sum_polymorphic end program select_type_05 lfortran-0.63.0/integration_tests/cond_03.f900000664000175000017500000000045715174404631021140 0ustar alastairalastair program cond_03 implicit none real, pointer :: d1, d2 real, target :: t1, t2 ! Initialize target objects t1 = 4 t2 = 5 ! Assign pointers d1 => t1 d2 => t2 if ( d1 > d2) error stop "Test_1 failed" t1 = 7 t2 = 6 if ( d1 < d2) error stop "Test_2 failed" end program cond_03lfortran-0.63.0/integration_tests/generic_name_07.f900000664000175000017500000000174515174404631022636 0ustar alastairalastair! Test: generic interfaces with the same name imported from multiple ! modules via `use` are merged (F2018 C1515). Here `delete` is a generic ! in both `a_m` and `b_m`; each specific dispatches on its own derived type. module generic_name_07_a_m implicit none type :: a_t integer :: i = 0 end type interface delete module procedure del_a end interface contains subroutine del_a(x) type(a_t), intent(out) :: x x%i = -1 end subroutine end module module generic_name_07_b_m implicit none type :: b_t integer :: j = 0 end type interface delete module procedure del_b end interface contains subroutine del_b(x) type(b_t), intent(out) :: x x%j = -2 end subroutine end module program generic_name_07 use generic_name_07_a_m use generic_name_07_b_m implicit none type(a_t) :: a type(b_t) :: b a%i = 5 b%j = 7 call delete(a) call delete(b) if (a%i /= -1) error stop if (b%j /= -2) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/modules_19b.f900000664000175000017500000000065715174404631022040 0ustar alastairalastairmodule modules_19b implicit none contains integer elemental function len_trim(string) result(r) character(len=*), intent(in) :: string r = len(string) if (r == 0) return do while(string(r:r) == " ") r = r - 1 if (r == 0) exit end do end function function trim(x) result(r) character(len=*),intent(in) :: x character(len=len_trim(x)) :: r integer :: i do i = 1, len(r) r(i:i) = x(i:i) end do end function end module lfortran-0.63.0/integration_tests/class_75.f900000664000175000017500000000142115174404631021323 0ustar alastairalastairmodule class_75_mod implicit none type :: x integer :: i = 66 end type x type, extends(x) :: z integer :: z_a end type z type, extends(x) :: y integer, allocatable :: arr(:) character(len=:), allocatable :: str end type y end module class_75_mod program class_75 use class_75_mod implicit none class(y), allocatable :: c, v type(y) :: yy allocate(c) yy%i = 42 allocate(yy%arr(3)) yy%arr = [1,2,3] yy%str = "hello" v = yy c = v select type(c) type is (y) print *, "i:", c%i print *, "arr:", c%arr print *, "str:", c%str if (c%i /= 42) error stop if (any(c%arr /= [1,2,3])) error stop if (c%str /= "hello") error stop class default error stop end select end program class_75 lfortran-0.63.0/integration_tests/bindc_06b.c0000664000175000017500000000023315174404631021255 0ustar alastairalastair#include #include int c_int4 = 1; int64_t c_int8 = 2; int tmp_value = 12; bool c_logical = false; void *c_type_c_ptr = &tmp_value; lfortran-0.63.0/integration_tests/intrinsics_29.f900000664000175000017500000000030415174404631022401 0ustar alastairalastairprogram intrinsics_29 implicit none real(4) :: random_sp real(8) :: random_dp call random_number(random_sp) call random_number(random_dp) print*, random_sp, random_dp end program intrinsics_29 lfortran-0.63.0/integration_tests/separate_compilation_28b.f900000664000175000017500000000031015174404631024554 0ustar alastairalastair! Common block with CHARACTER - reader subroutine subroutine print_name() implicit none character(32) :: srnamt common /srnamc/ srnamt if (srnamt /= 'HELLO') error stop end subroutine lfortran-0.63.0/integration_tests/arrays_62.f900000664000175000017500000000046515174404631021522 0ustar alastairalastairprogram arrays_62 real :: xpt(1, 1) xpt = 25.0 call rescue(xpt) print *, xpt if (any(abs(xpt - 625.0) > 1e-7)) error stop contains subroutine rescue(xpt) real, intent(inout) :: xpt(1, 1) print *, sum(xpt**2) xpt = sum(xpt**2) end subroutine end program lfortran-0.63.0/integration_tests/implicit_interface_13.f900000664000175000017500000000053715174404631024047 0ustar alastairalastairmodule implicit_interface_13_module contains function f() implicit complex(8) (f) f = (1.0, 1.0) end function f end program main use implicit_interface_13_module complex(8) :: i i = f() if (abs(real(i) - 1.0) > 1e-16) error stop if (abs(aimag(i) - 1.0) > 1e-16) error stop print *, i end program main lfortran-0.63.0/integration_tests/allocatable_nested_types_01.f900000664000175000017500000000110315174404631025231 0ustar alastairalastairprogram allocatable_nested_types_01 implicit none type :: t1 integer, allocatable :: ll end type type :: t2 type(t1), allocatable :: arr(:) end type t2 type :: t3 type(t2), allocatable :: z(:) end type call ss contains subroutine ss type(t3), allocatable :: t2 allocate(t2) if (.not. allocated(t2)) error stop allocate(t2%z(10)) if (size(t2%z) /= 10) error stop allocate(t2%z(1)%arr(5)) if (size(t2%z(1)%arr) /= 5) error stop end subroutine end program lfortran-0.63.0/integration_tests/submodule_41.f900000664000175000017500000000155715174404631022220 0ustar alastairalastair! Test: associate block with reshape in submodule procedure ! Regression test for ICE in pass_array_by_data when duplicating a ! submodule procedure containing an associate block with reshape. module submodule_41_m implicit none interface module subroutine make(a) integer, intent(in) :: a(:) end subroutine end interface end module submodule(submodule_41_m) submodule_41_s implicit none contains module procedure make integer :: k real, allocatable :: arr(:,:) associate(n => size(a)) arr = reshape([(real(k), k=1,5)], [5, 1]) end associate if (size(arr, 1) /= 5) error stop if (size(arr, 2) /= 1) error stop if (abs(arr(3, 1) - 3.0) > 1e-6) error stop end procedure end submodule program submodule_41 use submodule_41_m implicit none integer :: a(3) a = [1, 2, 3] call make(a) print *, "ok" end program lfortran-0.63.0/integration_tests/write_14.f900000664000175000017500000000134015174404631021341 0ustar alastairalastairprogram write_err_01 ! Test WRITE with ERR= label (valid in Fortran) implicit none character(100) :: buffer integer :: iostat character(256) :: iomsg ! Test basic WRITE with ERR= write(buffer, '(a, i0)', err=999, iostat=iostat, iomsg=iomsg) "Value: ", 42 if (trim(adjustl(buffer)) /= "Value: 42") error stop "Expected 'Value: 42'" if (iostat /= 0) error stop "iostat should be 0" ! Test WRITE with ERR= only (no iostat/iomsg) write(buffer, '(a)', err=999) "Hello World" if (trim(adjustl(buffer)) /= "Hello World") error stop "Expected 'Hello World'" print *, "PASS: WRITE with ERR= works correctly" stop 999 print *, "Error occurred unexpectedly" error stop 1 end program lfortran-0.63.0/integration_tests/struct_allocate.f900000664000175000017500000000064015174404631023075 0ustar alastairalastairmodule mod_struct_allocate implicit none integer, parameter, private :: mxdim = 3 type :: rp1d real(8), dimension(:), pointer :: f end type type :: sds type(rp1d), dimension(mxdim) :: scales end type end module program struct_allocate use mod_struct_allocate implicit none type(sds) :: s allocate(s%scales(1)%f(4)) allocate(s%scales(2)%f(3)) end program lfortran-0.63.0/integration_tests/modules_20b.f900000664000175000017500000000060715174404631022023 0ustar alastairalastairmodule modules_20b implicit none integer, public, parameter :: tfc = selected_char_kind('DEFAULT') type t character(len=1, kind=tfc) :: newline = achar(10, kind=tfc) end type t contains subroutine trim2(x) character(len=*),intent(in) :: x integer :: len_trim len_trim = 1 print *, len_trim, trim(x) end subroutine end module lfortran-0.63.0/integration_tests/array_indices_array_item_assignment_1.f900000664000175000017500000000055215174404631027407 0ustar alastairalastairprogram array_indices_array_item_assignment integer :: A(3, 2) = reshape([1, 2, 3, 4, 5, 6], [3, 2]), Acorrect(6) integer :: B(3, 2) integer :: X(2) = [1,2] integer, allocatable :: Y(:) ! integer :: i, j, k allocate(Y(2)) Y = 2 B = 2 A(X, X) = B(X, Y) Acorrect = reshape(A, [6]) print *, Acorrect if( any(Acorrect /= [2, 2, 3, 2, 2, 6]) ) error stop end program lfortran-0.63.0/integration_tests/derived_types_10.f900000664000175000017500000000103515174404631023052 0ustar alastairalastairprogram debug implicit none type :: char_struct !> Newline character character(len=1) :: f = achar(70) !> Tabulators are allowed as whitespace and in strings character(len=1) :: g = achar(71) end type char_struct type(char_struct) :: alphabets if( alphabets%f /= 'F' ) error stop if( alphabets%g /= 'G' ) error stop print *, alphabets%f, alphabets%g alphabets%f = achar(80) alphabets%g = achar(81) if( alphabets%f /= 'P' ) error stop if( alphabets%g /= 'Q' ) error stop print *, alphabets%f, alphabets%g end program debug lfortran-0.63.0/integration_tests/intrinsics_402.f900000664000175000017500000000100215174404631022450 0ustar alastairalastairprogram intrinsics_402 implicit none intrinsic :: iabs call xub (iabs, 42) call xub (iabs, -99) contains subroutine xub (ifn, val) implicit none interface function ifn(x) result(r) integer, intent(in) :: x integer :: r end function end interface integer :: val integer :: result result = ifn (val) print *, result if (val == 42 .and. result /= 42) error stop "Expected 42" if (val == -99 .and. result /= 99) error stop "Expected 99" end subroutine end program lfortran-0.63.0/integration_tests/arrays_120.f900000664000175000017500000000025015174404631021565 0ustar alastairalastairprogram arrays_120 implicit none integer(8) :: ilist(1, 1) ilist(1, 1:1) = 1 if (ilist(1, 1) /= 1) error stop print *, ilist end program arrays_120 lfortran-0.63.0/integration_tests/separate_compilation_34.f900000664000175000017500000000017315174404631024416 0ustar alastairalastairprogram separate_compilation_34 use separate_compilation_34a, only: call_it implicit none call call_it() end program lfortran-0.63.0/integration_tests/intrinsics_380.f900000664000175000017500000000147515174404631022473 0ustar alastairalastairmodule testdrive_intrinsics_380 implicit none contains !> Obtain the value of an environment variable subroutine get_variable(var, val) !> Name of variable character(len=*), intent(in) :: var !> Value of variable character(len=:), allocatable, intent(out) :: val integer :: length, stat call get_environment_variable(var, length=length, status=stat) allocate(character(len=length) :: val, stat=stat) if (length > 0) then call get_environment_variable(var, val, status=stat) end if end subroutine get_variable end module testdrive_intrinsics_380 program intrinsics_380 use testdrive_intrinsics_380 character(len=:), allocatable :: val call get_variable("LFORTRAN_TEST_ENV_VAR", val) write(*,*) trim(val) if (trim(val) /= "STATUS OK!") error stop end program lfortran-0.63.0/integration_tests/arrays_63.f900000664000175000017500000000031015174404631021510 0ustar alastairalastairprogram arrays_63 integer :: X(3,3) = reshape([1,2,3,4,5,6,7,8,9], [3,3]) integer, allocatable :: Y(:) allocate(Y(size(X,1))) Y = [1,2,3] print *, X(Y,:) if (sum(X(Y,:)) /= 45) error stop end program lfortran-0.63.0/integration_tests/common_19.f900000664000175000017500000000270215174404631021507 0ustar alastairalastair! Test: CHARACTER variables in COMMON blocks (F2018 8.10.3) ! Verifies that CHARACTER data persists across program units via storage association. ! Tests both same-layout access and different variable names for same storage. program common_19 implicit none character(len=8) :: str1 character(len=4) :: str2 integer :: icheck common/charblk/str1, str2, icheck str1 = "ABCDEFGH" str2 = "1234" icheck = 999 call sub_same_layout() call sub_diff_names() print *, "PASS: common_19" end program subroutine sub_same_layout() implicit none ! Same layout as main program character(len=8) :: s1 character(len=4) :: s2 integer :: ival common/charblk/s1, s2, ival ! Verify values match what was set in main if (s1 /= "ABCDEFGH") error stop "s1 should be ABCDEFGH" if (s2 /= "1234") error stop "s2 should be 1234" if (ival /= 999) error stop "ival should be 999" ! Modify values s1 = "XXXXXXXX" s2 = "YYYY" ival = 123 end subroutine subroutine sub_diff_names() implicit none ! Different variable names, same layout character(len=8) :: name1 character(len=4) :: name2 integer :: num common/charblk/name1, name2, num ! Verify modified values from sub_same_layout if (name1 /= "XXXXXXXX") error stop "name1 should be XXXXXXXX" if (name2 /= "YYYY") error stop "name2 should be YYYY" if (num /= 123) error stop "num should be 123" end subroutine lfortran-0.63.0/integration_tests/intrinsics_247.f900000664000175000017500000000350715174404631022473 0ustar alastairalastairprogram intrinsics_247 implicit none character(len = 11), parameter :: space_at_end_ = adjustr('gfortran ') character(len = 16), parameter :: space_in_between_ = adjustr(' g for tran ') character(len = 25), parameter :: spaces_with_symbols_ = adjustr(' # gfor* t $ ran & ') character(len = 2), parameter :: a(4) = adjustr(["ab", "cd", "ef", "gh"]) character(len = 7), parameter :: b(3) = adjustr([" hello", " world", "fortran"]) character(len = 10) :: c1 character(len = 10) :: c2 character(len = 10) :: c3(3) character(len = 10) :: res(3) c1 = "lfortran " c2 = " gfortran" c3 = [" fort ran ", " lfortran", "gfortran "] print *, adjustr(c1) if (adjustr(c1) /= " lfortran") error stop print *, adjustr(c2) if (adjustr(c2) /= " gfortran") error stop print *, space_at_end_ if (space_at_end_ /= " gfortran") error stop print *, space_in_between_ if (space_in_between_ /= " g for tran") error stop print *, spaces_with_symbols_ if (spaces_with_symbols_ /= " # gfor* t $ ran &") error stop print *, a if (any(a /= ["ab", "cd", "ef", "gh"])) error stop print *, b if (any(b /= [" hello", " world", "fortran"])) error stop print *, adjustr(["|a ", "b2 ", "3 c", " d4", "e| "]) if (any(adjustr(["|a ", "b2 ", "3 c", " d4", "e| "]) /= [" |a", " b2", "3 c", " d4", " e|"])) error stop print *, adjustr(["lfortran ", " compiler ", "opensource"]) if (any(adjustr(["lfortran ", " compiler ", "opensource"]) /= [" lfortran", " compiler", "opensource"])) error stop print *, adjustr([c1, c2]) if (any(adjustr([c1, c2]) /= [" lfortran", " gfortran"])) error stop res = adjustr([c1, c2, c3(1)]) print *, res if (any(res /= [" lfortran", " gfortran", " fort ran"])) error stop end programlfortran-0.63.0/integration_tests/expr_19.f900000664000175000017500000000017715174404631021201 0ustar alastairalastairprogram expr_19 complex(8), parameter :: x = (5, 6) print *, x if (abs(x - (5, 6)) > 1e-5) error stop end program lfortran-0.63.0/integration_tests/pointer_15.f900000664000175000017500000000106215174404631021671 0ustar alastairalastairprogram pointer_15 implicit none type :: base integer :: v end type class(base), pointer :: y class(base), pointer :: mmm call ss(y, 1000) call ss(mmm, 2222) print *, y%v if(y%v /= 1000) error stop print *, mmm%v if(mmm%v /= 2222) error stop deallocate(y) deallocate(mmm) contains subroutine ss(xxx, inn) integer :: inn class(base), pointer :: xxx type(base), pointer :: t allocate(t) t%v = inn xxx => t end subroutine end program lfortran-0.63.0/integration_tests/pdt_06_module.f900000664000175000017500000000017715174404631022353 0ustar alastairalastairmodule pdt_06_inner_m implicit none type inner(k) integer, kind :: k = kind(1.) real(k) :: v end type end module lfortran-0.63.0/integration_tests/derived_types_121_module.f900000664000175000017500000000026615174404631024507 0ustar alastairalastairmodule derived_types_121_module implicit none integer, parameter :: ilp = 4 type :: state_type integer(ilp) :: state = 0 end type state_type end module derived_types_121_module lfortran-0.63.0/integration_tests/pass_array_by_data_08.f900000664000175000017500000000104315174404631024041 0ustar alastairalastairprogram pass_array_by_data_08 implicit none integer, dimension(10) :: a interface subroutine fill_array(aa) integer, dimension(:), intent(out) :: aa integer :: i end subroutine fill_array end interface call fill_array(a) print *, a if( any(a /= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) ) error stop end program pass_array_by_data_08 subroutine fill_array(a) implicit none integer, dimension(:), intent(out) :: a integer :: i do i = 1, 10 a(i) = i end do end subroutine fill_array lfortran-0.63.0/integration_tests/intrinsics_241.f900000664000175000017500000000265415174404631022467 0ustar alastairalastairprogram intrinsics_241 logical :: a, b logical(8) :: c, d logical(8), parameter :: e = logical(.true., 8) logical(4), parameter :: f = logical(.false., 4) logical(4), parameter :: ar1(3) = logical([.true., .false., .true.], 4) logical :: x a = .true. b = .false. c = .true. d = .false. x = .true. print *, e if (e .neqv. .true.) error stop print *, kind(f) if (f .neqv. .false.) error stop print *, kind(logical(a, 8)) if(kind(logical(a, 8)) /= 8) error stop print *, kind(logical(b, 4)) if(kind(logical(b, 4)) /= 4) error stop print *, kind(logical(c, 8)) if(kind(logical(c, 8)) /= 8) error stop print *, kind(logical(d, 4)) if(kind(logical(d, 4)) /= 4) error stop print *, kind(logical(.true., 8)) if(kind(logical(.true., 8)) /= 8) error stop print *, kind(logical(.false., 4)) if(kind(logical(.false., 4)) /= 4) error stop print *, kind(logical(.true._8, 8)) if(kind(logical(.true._8, 8)) /= 8) error stop print *, kind(logical(.false._8, 4)) if(kind(logical(.false._8, 4)) /= 4) error stop print *, ar1 if(any(ar1 .neqv. [.true., .false., .true.])) error stop x = logical(get_bool(), 4) if (kind(logical(get_bool(), 4)) /= 4) error stop print *, x if (x .neqv. .false.) error stop contains logical function get_bool() get_bool = .false. end function get_bool end program lfortran-0.63.0/integration_tests/logical4.f900000664000175000017500000000032315174404631021401 0ustar alastairalastairprogram logical4 ! this program checks logical operators implicit none ! variable declaration logical :: a, b, c ! assigning values a = 2 b = -1 c = 0 print *, a, b, c end program logical4 lfortran-0.63.0/integration_tests/common_23.f900000664000175000017500000000153115174404631021501 0ustar alastairalastair! Test: Blank (unnamed) COMMON block (F2018 8.10.3.1) ! The blank common block (declared without a name) is a special case that ! provides global storage shared across all program units. Unlike named ! COMMON blocks, blank common cannot be initialized in BLOCK DATA. program common_23 implicit none integer :: i, j real :: x common i, j, x ! Blank common (no name) i = 42 j = 84 x = 3.14 call sub_blank_access() if (i /= 100) error stop "i should be 100 after subroutine" print *, "PASS: common_23" end program subroutine sub_blank_access() implicit none integer :: a, b real :: c common a, b, c ! Same blank common if (a /= 42) error stop "a should be 42" if (b /= 84) error stop "b should be 84" if (abs(c - 3.14) > 0.001) error stop "c should be 3.14" a = 100 end subroutine lfortran-0.63.0/integration_tests/implicit_interface_20.f900000664000175000017500000000116615174404631024044 0ustar alastairalastairprogram implicit_interface_20 use, intrinsic :: iso_fortran_env, only: dp => real64 implicit none real(dp) :: a(2) a(1) = 1.0d0 a(2) = 2.0d0 call wrapper(a) end program implicit_interface_20 subroutine wrapper(a) use, intrinsic :: iso_fortran_env, only: dp => real64 implicit none real(dp) :: a(*) external :: worker call worker(a) end subroutine wrapper subroutine worker(a) use, intrinsic :: iso_fortran_env, only: dp => real64 implicit none real(dp) :: a(*) if (a(1) /= 1.0d0) error stop if (a(2) /= 2.0d0) error stop print *, a(1) end subroutine worker lfortran-0.63.0/integration_tests/interface_20.f900000664000175000017500000000077515174404631022157 0ustar alastairalastairmodule mod_interface_20 implicit none interface free_map_entry_pool module procedure free_map_entry_pool end interface free_map_entry_pool contains subroutine free_map_entry_pool(pool) integer, intent(inout) :: pool pool = 3 end subroutine free_map_entry_pool end module mod_interface_20 program interface_20 use mod_interface_20 implicit none integer :: i = 1 call free_map_entry_pool(i) print *, i if (i /= 3) error stop end programlfortran-0.63.0/integration_tests/submodule_18a.f900000664000175000017500000000035315174404631022356 0ustar alastairalastairprogram submodule_18b use julienne_m_submodule_18b implicit none character(len=:), allocatable :: fmt_str integer :: i fmt_str = separated_values(i) if (fmt_str /= "(*(G25.20,:,','))") error stop end program submodule_18b lfortran-0.63.0/integration_tests/equivalence_13.f900000664000175000017500000000071115174404631022510 0ustar alastairalastairprogram equivalence_13 implicit none integer :: ia(5), ic logical :: la(2), lc equivalence (la(1),lc), (ia(5), ic) ic = -42 ia = [1, 2, 3, 4, 5] if (ia(5) /= 5) error stop "ia(5) should be 5" if (ic /= 5) error stop "ic should be 5 (equivalenced to ia(5))" lc = .false. la = .true. if (.not. la(1)) error stop "la(1) should be true" if (.not. lc) error stop "lc should be true (equivalenced to la(1))" end program equivalence_13 lfortran-0.63.0/integration_tests/enum_07_module.f900000664000175000017500000000065715174404631022534 0ustar alastairalastairmodule enum_07_m_constants implicit none enum, bind(C) enumerator :: sparse_full = 0 end enum end module module enum_07_parent_mod use enum_07_m_constants implicit none public :: sparse_full enum, bind(C) enumerator :: wksp_a = 3 end enum interface module subroutine do_work(x) integer, intent(inout) :: x end subroutine end interface end module lfortran-0.63.0/integration_tests/intrinsics_281.f900000664000175000017500000001166215174404631022472 0ustar alastairalastairprogram intrinsics_268 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp) :: arg_x(15) real(sp) :: arg_y(15) real(dp) :: res_x(15) real(sp) :: res_y(15) real(dp) :: expected_res_x(15) real(sp) :: expected_res_y(15) real(dp) :: expected_x(10) real(sp) :: expected_y(10) real(dp) :: a = 0.5178181202_dp real(sp) :: b = -0.072816_sp real(dp) :: c = -0.5178181202_dp real(sp) :: d = 0.072816_sp real(dp), parameter :: res_dp(10) = tanh([-0.62818828_dp, -0.51725372_dp, -0.29257208_dp, & 0.62818828_dp, 0.51725372_dp, 0.29257208_dp, 1.00_dp, 0.829362821_dp, 0.952716192_dp, -0.241626228_dp]) real(sp), parameter :: res_sp(10) = tanh([-0.62818828_sp, -0.51725372_sp, -0.29257208_sp, & 0.62818828_sp, 0.51725372_sp, 0.29257208_sp, 1.00_sp, 0.829362821_sp, 0.952716192_sp, -0.241626228_sp]) expected_x = [-0.55680344433989626_dp, -0.47557764686289139_dp, -0.28450043308229522_dp, & 0.55680344433989626_dp, 0.47557764686289139_dp, 0.28450043308229522_dp, 0.76159415595576485_dp, & 0.68013372295360075_dp, 0.74101025957155131_dp, -0.23703120039784659_dp] arg_x = [-0.67922251126_dp, -0.54363892699177885_dp, -0.29691551032790681_dp, & 0.67922251126401767_dp, 0.54363892699177885_dp, 0.29691551032790681_dp, 0.5707963267948966_dp, & 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp, -0.7281628262782_dp, & 0.5707963267948966_dp, 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp] arg_y = [-0.679222465_sp, -0.543638885_sp, -0.296915501_sp, & 0.679222465_sp, 0.543638885_sp, 0.296915501_sp, 0.57079637_sp, & 0.077966249_sp, 0.262053013_sp, -0.244041398_sp, -0.7281628262782_sp, & 0.57079637_sp, 0.077966249_sp, 0.262053013_sp, -0.244041398_sp] expected_y = [-0.556803405_sp, -0.475577623_sp, -0.284500420_sp, & 0.556803405_sp, 0.475577623_sp, 0.284500420_sp, 0.761594176_sp, & 0.680133700_sp, 0.741010249_sp, -0.237031206_sp] res_x = tanh(arg_x) res_y = tanh(arg_y) expected_res_x = [-0.59101371380532286_dp, -0.49573755452355417_dp, -0.28848735226454980_dp, & 0.59101371380793721_dp, 0.49573755452355417_dp, 0.28848735226454980_dp, 0.51594386420508198_dp, & 7.7808675521968823E-002_dp, 0.25621481487810227_dp, -0.23930935875580195_dp, -0.62194009906582415_dp, & 0.51594386420508198_dp, 7.7808675521968823E-002_dp, 0.25621481487810227_dp, -0.23930935875580195_dp] expected_res_y = [-0.591013670_sp, -0.495737523_sp, -0.288487345_sp, & 0.591013670_sp, 0.495737523_sp, 0.288487345_sp, 0.515943885_sp, & 7.78086558E-02_sp, 0.256214768_sp, -0.239309371_sp, -0.621940076_sp, & 0.515943885_sp, 7.78086558E-02_sp, 0.256214768_sp, -0.239309371_sp] do i = 1, size(res_dp) print *, res_dp(i) if (abs(res_dp(i) - expected_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_x) print *, res_x(i) if (abs(res_x(i)) - abs(expected_res_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_y(i)) > 1e-5) error stop end do do i = 1, size(res_y) print *, res_y(i) if (abs(res_y(i)) - abs(expected_res_y(i)) > 1e-5) error stop end do print *, tanh(a) if (abs(tanh(a)) - 0.47601427711167560_dp > 1e-12) error stop print *, tanh(0.5178181202_dp) if (abs(tanh(0.5178181202_dp) - 0.47601427711167560_dp) > 1e-12) error stop print *, tanh(b) if (tanh(b) - (-7.26875812E-02_sp) > 1e-5) error stop print *, tanh(-0.072816_sp) if (tanh(-0.072816_sp) - (-7.26875812E-02_sp) > 1e-5) error stop print *, tanh(c) if (tanh(c) - (-0.47601427711167560_dp) > 1e-12) error stop print *, tanh(-0.5178181202_dp) if (tanh(-0.5178181202_dp) - (-0.47601427711167560_dp) > 1e-12) error stop print *, tanh(d) if (tanh(d) - (7.26875812E-02_sp) > 1e-5) error stop print *, tanh(0.072816_sp) if (tanh(0.072816_sp) - (7.26875812E-02_sp) > 1e-5) error stop a = -0.271927291_dp b = -0.6382728_sp c = 0.271927291_dp d = 0.6382728_sp print *, tanh(a) if (abs(tanh(a) - (-0.265417270575538994_dp)) > 1e-12) error stop print *, tanh(-0.271927291_dp) if (abs(tanh(-0.271927291_dp) - (-0.265417270575538994_dp)) > 1e-12) error stop print *, tanh(b) if (tanh(b) - (-0.563722372_sp) > 1e-5) error stop print *, tanh(-0.6382728_sp) if (tanh(-0.6382728_sp) - (-0.563722372_sp) > 1e-5) error stop print *, tanh(c) if (tanh(c) - (0.26541727057553899_dp) > 1e-12) error stop print *, tanh(0.271927291_dp) if (tanh(0.271927291_dp) - (0.26541727057553899_dp) > 1e-12) error stop print *, tanh(d) if (tanh(d) - (0.563722372_sp) > 1e-5) error stop print *, tanh(0.6382728_sp) if (tanh(0.6382728_sp) - (0.563722372_sp) > 1e-5) error stop end programlfortran-0.63.0/integration_tests/implied_do_loops24.f900000664000175000017500000000312715174404631023377 0ustar alastairalastair! Test: nested implied-do array constructor where the inner expression ! references the outer loop variable but the inner loop bounds do not. ! [([(i+j, j=1,M)], i=1,N)] must produce M*N elements, not N*(N+1)/2. program implied_do_loops24 implicit none integer :: i, j integer, allocatable :: a(:) ! Basic case: inner expr references outer var, constant bounds a = [([(i + j, j = 1, 3)], i = 1, 3)] if (size(a) /= 9) error stop "test 1: wrong size" ! Expected: [2,3,4, 3,4,5, 4,5,6] if (a(1) /= 2) error stop "test 1: a(1)" if (a(2) /= 3) error stop "test 1: a(2)" if (a(3) /= 4) error stop "test 1: a(3)" if (a(4) /= 3) error stop "test 1: a(4)" if (a(5) /= 4) error stop "test 1: a(5)" if (a(6) /= 5) error stop "test 1: a(6)" if (a(7) /= 4) error stop "test 1: a(7)" if (a(8) /= 5) error stop "test 1: a(8)" if (a(9) /= 6) error stop "test 1: a(9)" ! Non-square case: M > N a = [([(i * j, j = 1, 4)], i = 1, 2)] if (size(a) /= 8) error stop "test 2: wrong size" ! Expected: [1,2,3,4, 2,4,6,8] if (a(1) /= 1) error stop "test 2: a(1)" if (a(4) /= 4) error stop "test 2: a(4)" if (a(5) /= 2) error stop "test 2: a(5)" if (a(8) /= 8) error stop "test 2: a(8)" ! Non-square case: M < N (under-allocation was the original crash) a = [([(i + j, j = 1, 2)], i = 1, 4)] if (size(a) /= 8) error stop "test 3: wrong size" ! Expected: [2,3, 3,4, 4,5, 5,6] if (a(1) /= 2) error stop "test 3: a(1)" if (a(2) /= 3) error stop "test 3: a(2)" if (a(7) /= 5) error stop "test 3: a(7)" if (a(8) /= 6) error stop "test 3: a(8)" print *, "All tests passed." end program lfortran-0.63.0/integration_tests/derived_types_36.f900000664000175000017500000000233315174404631023064 0ustar alastairalastairmodule derived_types_36_my_mod type :: my_type sequence character(len=:), allocatable :: a end type interface write(formatted) module procedure :: write_formatted end interface contains subroutine write_formatted(mt, unit, iotype, v_list, iostat, iomsg) type(my_type), intent(in) :: mt integer, intent(in) :: unit character(len=*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg write(unit, '(a)') mt%a end subroutine end module program derived_types_36 use derived_types_36_my_mod, only: my_type, write(formatted) implicit none type(my_type) :: x integer :: iostat character(len=20) :: iomsg, tmp character(len=20) :: arr_iomsg(2) x%a = "tmp234" tmp = "tmp1" print *, tmp open(10, form="formatted", file="derived_types_36_file.txt") write(10, '(dt)', iostat=iostat, iomsg=iomsg) x close(10) open(10, form="formatted", file="derived_types_36_file.txt") read(10, '(a)', iostat=iostat, iomsg=arr_iomsg(1)) tmp close(10) print *, tmp if (tmp /= "tmp234") error stop end program lfortran-0.63.0/integration_tests/arrays_34.f900000664000175000017500000000107415174404631021516 0ustar alastairalastairprogram arrays_34 implicit none integer, pointer :: x(:) call sub(x, 1) print *, x if( any(x /= 1) ) error stop deallocate(x) contains subroutine sub(x, z) integer, intent(out), pointer :: x(:) integer, intent(in) :: z integer :: n select case (z) case (1) n = 1 allocate(x(n)) x = (/ 1 /) case default print *, "z =", z print *, "z not supported." end select end subroutine sub end program lfortran-0.63.0/integration_tests/where_14.f900000664000175000017500000000146015174404631021324 0ustar alastairalastair! Test that `BinOp` on arrays inside `where` works and result in correct `BinOp` after indexing. program where_14 real :: A(4) call temp(A) contains subroutine temp(A) real, intent(in) :: A(:) integer :: xbdi(size(A)) integer :: ssq(size(A)) xbdi = [212334,0,212121,0] ssq = [1,10,1,-1] where (xbdi == 0) ssq = max(0, ssq - xbdi) print *, ssq if(any(ssq /= [1, 10, 1, 0])) error stop ssq = [100,0,100,3] where (xbdi == 0) ssq = max(0, 2 - ssq) print *, ssq if(any(ssq /= [100, 2, 100, 0])) error stop ssq = [100,0,100,3] where (xbdi == 0) ssq = max(0,ssq - 2) print *, ssq if(any(ssq /= [100, 0, 100, 1])) error stop end subroutine end programlfortran-0.63.0/integration_tests/transfer_07.f900000664000175000017500000000050415174404631022036 0ustar alastairalastairprogram transfer_07 integer(4), parameter :: scalar = 4 integer(2), parameter :: mold = 0 integer(2) :: array(2) array = transfer( scalar, mold, 2 ) print *, array(1) if (array(1) /= 4) error stop ! TODO : Add test for complete array with error stop after fixing transfer completely end programlfortran-0.63.0/integration_tests/format_03.f0000664000175000017500000000051115174404631021323 0ustar alastairalastair program format_03 1000 FORMAT + (/' --- PROBLEM SIZE:'/ + ' N = ',I5, + ' (NUMBER WITH NONZERO WEIGHT = ',I5,')'/ + ' NQ = ',I5/ + ' M = ',I5/ + ' NP = ',I5, + ' (NUMBER UNFIXED = ',I5,')') end program lfortran-0.63.0/integration_tests/intrinsics_242.f900000664000175000017500000000046515174404631022466 0ustar alastairalastairprogram intrinsics_242 integer, parameter :: dp = kind(0.d0) print*, nint(1e12_dp, dp) if (nint(1e12_dp, dp) /= 1000000000000_dp) error stop print*, nint(1000000000000.0000000000000000_dp, dp) if (nint(1000000000000.0000000000000000_dp, dp) /= 1000000000000_dp) error stop end program lfortran-0.63.0/integration_tests/intent_out_array_01.f900000664000175000017500000000155515174404631023601 0ustar alastairalastair! Test for intent(out) allocatable array of derived type with nested allocatables ! Issue #9097: nested allocatables must be deallocated before outer array on re-entry program intent_out_array_01 implicit none type :: node_t integer, allocatable :: data(:) end type type(node_t), allocatable :: nodes(:) call create_nodes(nodes, 3, 5) call create_nodes(nodes, 2, 4) ! Re-entry: must dealloc nested first if (size(nodes) /= 2) error stop if (size(nodes(1)%data) /= 4) error stop print *, "PASS" contains subroutine create_nodes(nodes, n, sz) type(node_t), allocatable, intent(out) :: nodes(:) integer, intent(in) :: n, sz integer :: i allocate(nodes(n)) do i = 1, n allocate(nodes(i)%data(sz)) nodes(i)%data = i * 10 end do end subroutine end program lfortran-0.63.0/integration_tests/equivalence_18.f900000664000175000017500000000026215174404631022516 0ustar alastairalastairprogram equivalence_18 implicit none integer :: i1, i2 equivalence (i1, i2) data i1/19/ if (i2 /= 19) error stop print *, 'i2 =', i2, merge(': pass', ': fail', i2 == 19) end lfortran-0.63.0/integration_tests/modules_34_module2.f900000664000175000017500000000021615174404631023311 0ustar alastairalastairmodule fpm_manifest_modules_34 use fpm_manifest_package_modules_34, only : package_config_t implicit none end module fpm_manifest_modules_34 lfortran-0.63.0/integration_tests/modules_14_a.f900000664000175000017500000000045615174404631022166 0ustar alastairalastairmodule modules_14_a implicit none interface a module procedure a1 module procedure a2 end interface contains subroutine a1(a) integer, intent(inout) :: a a = a + 1 end subroutine subroutine a2(a) real, intent(inout) :: a a = a + 1 end subroutine end module lfortran-0.63.0/integration_tests/sum_02.f900000664000175000017500000000036015174404631021011 0ustar alastairalastairprogram sum_02 integer :: x(5, 10), xdiff, i, j do i = 1, 5 do j = 1, 10 x(i, j) = i + j end do end do xdiff = abs(sum(x) - 425) print *, xdiff if( xdiff /= 0 ) error stop end program lfortran-0.63.0/integration_tests/intrinsics_230.f900000664000175000017500000000612115174404631022456 0ustar alastairalastairprogram intrinsic_230 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 implicit none real(dp), parameter :: res0_j0(2) = bessel_j0([3.3398640543782485_dp, 3.3398640543782485_dp]) real(dp), parameter :: res0_j1(2) = bessel_j1([3.3398640543782485_dp, 5.039184326269492_dp]) real(dp), parameter :: res0_jn(2) = bessel_jn(1, [3.3398640543782485_dp, 5.039184326269492_dp]) real(dp), parameter :: res0_y0(2) = bessel_y0([3.3398640543782485_dp, 3.3398640543782485_dp]) real(dp), parameter :: res0_y1(2) = bessel_y1([3.3398640543782485_dp, 5.039184326269492_dp]) real(dp), parameter :: res0_yn(2) = bessel_yn(1, [3.3398640543782485_dp, 5.039184326269492_dp]) real(dp) :: res1_j0(2) real(dp) :: res1_j1(2) real(dp) :: res1_jn(2) real(dp) :: res1_y0(2) real(dp) :: res1_y1(2) real(dp) :: res1_yn(2) res1_j0 = bessel_j0([3.3398640543782485_dp, 3.3398640543782485_dp]) res1_j1 = bessel_j1([3.3398640543782485_dp, 5.039184326269492_dp]) res1_jn = bessel_jn(1, [3.3398640543782485_dp, 5.039184326269492_dp]) res1_y0 = bessel_y0([3.3398640543782485_dp, 3.3398640543782485_dp]) res1_y1 = bessel_y1([3.3398640543782485_dp, 5.039184326269492_dp]) res1_yn = bessel_yn(1, [3.3398640543782485_dp, 5.039184326269492_dp]) print*, res0_j0 if (abs(res0_j0(1) - (-0.35276533724012676)) > 1e-6) error stop if (abs(res0_j0(2) - (-0.35276533724012676)) > 1e-6) error stop print*, res0_j1 if (abs(res0_j1(1) - 0.20421621687655642) > 1e-6) error stop if (abs(res0_j1(2) - (-0.33171193864355270)) > 1e-6) error stop print*, res0_jn if (abs(res0_jn(1) - 0.20421621687655642) > 1e-6) error stop if (abs(res0_jn(2) - (-0.33171193864355270)) > 1e-6) error stop print*, res0_y0 if (abs(res0_y0(1) - 0.25351438512601238) > 1e-6) error stop if (abs(res0_y0(2) - 0.25351438512601238) > 1e-6) error stop print*, res0_y1 if (abs(res0_y1(1) - 0.39357815895597936) > 1e-6) error stop if (abs(res0_y1(2) - 0.13456148643731775) > 1e-6) error stop print*, res0_yn if (abs(res0_yn(1) - 0.39357815895597936) > 1e-6) error stop if (abs(res0_yn(2) - 0.13456148643731775) > 1e-6) error stop print*, res1_j0 if (abs(res1_j0(1) - (-0.35276533724012676)) > 1e-6) error stop if (abs(res1_j0(2) - (-0.35276533724012676)) > 1e-6) error stop print*, res1_j1 if (abs(res1_j1(1) - 0.20421621687655642) > 1e-6) error stop if (abs(res1_j1(2) - (-0.33171193864355270)) > 1e-6) error stop print*, res1_jn if (abs(res1_jn(1) - 0.20421621687655642) > 1e-6) error stop if (abs(res1_jn(2) - (-0.33171193864355270)) > 1e-6) error stop print*, res1_y0 if (abs(res1_y0(1) - 0.25351438512601238) > 1e-6) error stop if (abs(res1_y0(2) - 0.25351438512601238) > 1e-6) error stop print*, res1_y1 if (abs(res1_y1(1) - 0.39357815895597936) > 1e-6) error stop if (abs(res1_y1(2) - 0.13456148643731775) > 1e-6) error stop print*, res1_yn if (abs(res1_yn(1) - 0.39357815895597936) > 1e-6) error stop if (abs(res1_yn(2) - 0.13456148643731775) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/arrays_02.f900000664000175000017500000000027015174404631021506 0ustar alastairalastairprogram arrays_02 implicit none integer, parameter :: dp = kind(0.d0) real(dp) :: a(3), b a(1) = 3._dp a(2) = 2._dp a(3) = 1._dp b = sum(a) if (abs(b-6._dp) > 1e-12_dp) error stop end lfortran-0.63.0/integration_tests/implicit_interface_02.f900000664000175000017500000000071115174404631024037 0ustar alastairalastairprogram main integer :: b(3) = [10, 20, 30] integer :: n = 3 call driver(implicit_interface_check, b) contains subroutine driver(fnc, arr) integer, intent(in) :: arr(3) print *, abs(-1.0) ! This loads the runtime library(bug fixed) call fnc(arr) end subroutine subroutine implicit_interface_check(arr1) integer, intent(in) :: arr1(3) if (arr1(1) /= 10) error stop if (arr1(2) /= 20) error stop if (arr1(3) /= 30) error stop end subroutine end program lfortran-0.63.0/integration_tests/openmp_59.f900000664000175000017500000000033415174404631021520 0ustar alastairalastairprogram openmp_59 use omp_lib integer :: sum=0 !$omp teams num_teams(3) reduction(+:sum) print*, omp_get_team_num() sum=sum+omp_get_team_num() !$omp end teams if(sum/=3) error stop end program openmp_59lfortran-0.63.0/integration_tests/submodule_27a.f900000664000175000017500000000110015174404631022345 0ustar alastairalastair! Test that a module with an abstract interface used as procedure pointer ! type in a module function is deserialized correctly when the submodule ! is loaded during separate compilation. program submodule_27 use submodule_27_m, only: vec_t, fn_i, make_vec implicit none type(vec_t) :: v procedure(fn_i), pointer :: f f => double_it v = make_vec(f) if (abs(v%val - 6.0d0) > 1.0d-10) error stop print *, "ok" contains pure function double_it(x) result(y) real(8), intent(in) :: x real(8) :: y y = 2.0d0 * x end function end program submodule_27 lfortran-0.63.0/integration_tests/arrays_11.f900000664000175000017500000000114515174404631021510 0ustar alastairalastairprogram arrays_11 implicit none integer :: x(10), y(10), i logical :: r do i = 1, size(x) x(i) = i end do call sub(size(x), x, y) r = verify(x, y) print *, r if (.not. r) error stop contains subroutine sub(n, a, b) integer, intent(in) :: n integer, intent(in) :: a(n) integer, intent(out) :: b(n) integer :: i do i = 1, size(a) b(i) = a(i) end do end subroutine logical function verify(a, b) result(r) integer, intent(in) :: a(:), b(:) integer :: i r = .true. do i = 1, size(a) r = r .and. (a(i) == b(i)) end do end function end lfortran-0.63.0/integration_tests/arrays_op_21.f900000664000175000017500000000075015174404631022210 0ustar alastairalastairprogram arrays_op_20 implicit none real, allocatable :: array(:, :), arrayoutput(:, :) integer :: i, j allocate(array(2:5, 5:10)) allocate(arrayoutput(2:5, 5:10)) array = 3.0 arrayoutput = f(5, array) print *, size(arrayoutput) print *, arrayoutput if( size(arrayoutput) /= 24 ) error stop if( any(arrayoutput /= 3.0) ) error stop contains function f(m, input) result(output) integer :: m real :: input(2:m, m:2*m) real :: output(2:m, m:2*m) output = input end function end program lfortran-0.63.0/integration_tests/system_clock_01.f900000664000175000017500000000024715174404631022707 0ustar alastairalastairprogram system_clock_01 implicit none integer :: arg = 0 call system_clock(arg) print *, arg if (arg == 0) error stop end program system_clock_01 lfortran-0.63.0/integration_tests/implied_do_loops14.f900000664000175000017500000000115415174404631023374 0ustar alastairalastairprogram implied_do_loops14 implicit none character(:), allocatable :: tmp_line character(len=5) :: values(3) character(len=5) :: padded character(:), allocatable :: trimmed(:) integer :: i tmp_line = "Hello" values = [(tmp_line, i = 1, 3)] do i = 1, 3 if (values(i) /= "Hello") error stop 1 end do padded = "Hell " allocate(character(len=len(trim(padded))) :: trimmed(3)) trimmed = [(trim(padded), i = 1, 3)] do i = 1, 3 if (trimmed(i) /= "Hell") error stop 2 end do print *, (trim(padded), i = 1, 3) end program implied_do_loops14 lfortran-0.63.0/integration_tests/cond_04.f900000664000175000017500000000232415174404631021134 0ustar alastairalastairmodule cond_04_mod implicit none type :: Integer32Complex32Pair integer :: first complex :: second contains end type Integer32Complex32Pair interface operator(==) module procedure map_p_equal end interface operator(==) contains logical function map_p_equal(a, b) result(equal) type(Integer32Complex32Pair), target, intent(in) :: a type(Integer32Complex32Pair), target, intent(in) :: b equal = (a%first == b%first) .and. (a%second == b%second) end function map_p_equal end module cond_04_mod program cond_04 use cond_04_mod implicit none type(Integer32Complex32Pair), target :: p1, p2, p3 type(Integer32Complex32Pair), pointer :: ptr_p1 logical :: result ptr_p1 => p1 p1%first = 10 p1%second = (3.0, 4.0) p2%first = 10 p2%second = (3.0, 4.0) p3%first = 20 p3%second = (3.0, 4.0) result = (ptr_p1 == p2) print *, "result: ", result if (.not. result) error stop result = (p2 == ptr_p1) print *, "result: ", result if (.not. result) error stop result = (ptr_p1 == p3) print *, "result: ", result if (result) error stop result = (p3 == ptr_p1) print *, "result: ", result if (result) error stop end program cond_04 lfortran-0.63.0/integration_tests/modules_56.f900000664000175000017500000000071715174404631021674 0ustar alastairalastairmodule modules_56_module contains logical function is_close_rsp(a) result(res) use, intrinsic :: ieee_arithmetic, only: ieee_is_nan real, intent(in) :: a res = ieee_is_nan(a) end function is_close_rsp end module program main use modules_56_module implicit none real :: a logical :: res a = 0.0 ! Initialize the variable 'a' res = is_close_rsp(a) print *, res if (res) error stop end program main lfortran-0.63.0/integration_tests/bindc_50.f900000664000175000017500000000126515174404631021274 0ustar alastairalastairmodule bindc_50_mod use iso_c_binding, only: c_int implicit none ! bind(c, name='') on a module variable: per F2018 18.3.7.1 the ! binding label is empty, so no C binding is established. This ! exercises the LLVM codegen branch that falls back to the mangled ! Fortran name. integer(c_int), bind(c, name='') :: v_empty integer(c_int), bind(c) :: v_noname integer(c_int), bind(c, name='v_explicit') :: v_named end module program bindc_50 use bindc_50_mod implicit none v_empty = 11 v_noname = 22 v_named = 33 if (v_empty /= 11) error stop if (v_noname /= 22) error stop if (v_named /= 33) error stop print *, v_empty, v_noname, v_named end program lfortran-0.63.0/integration_tests/submodule_50c.f900000664000175000017500000000056615174404631022362 0ustar alastairalastairsubmodule(submodule_50_mod) submodule_50_sub implicit none contains module subroutine setup_impl(this, lengths) class(container_type), intent(inout) :: this integer, dimension(this%rank), intent(in) :: lengths integer :: i do i = 1, this%rank if (lengths(i) < 0) error stop end do end subroutine end submodule lfortran-0.63.0/integration_tests/data_14.f900000664000175000017500000000023615174404631021123 0ustar alastairalastairprogram data_14 integer, parameter :: n = 4 real, dimension(n) :: arr data (arr(i), integer :: i = 1,n) /0.0, 0.0, 0.0, 0.0/ print *, arr end program lfortran-0.63.0/integration_tests/gpu_metal_142.f900000664000175000017500000000112615174404631022250 0ustar alastairalastairprogram gpu_metal_142 ! Test: bind(C) enum in a submodule type-bound procedure called from ! do concurrent with --gpu=metal --separate-compilation. Verifies the ! gpu_offload pass resolves ExternalSymbols for nameless enum modules ! when loading submodule (.smod) files. use gpu_metal_142_net_m, only: net_t implicit none type(net_t) :: net real :: x(4), y(4) x = [1.0, 2.0, 3.0, 4.0] y = 0.0 call net%run(x, y, 4) print *, y if (abs(y(1) - 2.0) > 1e-6) error stop if (abs(y(2) - 4.0) > 1e-6) error stop if (abs(y(3) - 6.0) > 1e-6) error stop if (abs(y(4) - 8.0) > 1e-6) error stop end program lfortran-0.63.0/integration_tests/openmp_35.f900000664000175000017500000000303315174404631021511 0ustar alastairalastairsubroutine operations(n, ctr, sum_v1, sum_v2,sum_v3) use omp_lib implicit none integer, intent(in) :: n double precision, intent(inout) :: ctr double precision, intent(inout) :: sum_v1, sum_v2, sum_v3 integer :: local_ctr double precision :: local_sum_v1, local_sum_v2,local_sum_v3 integer :: i local_ctr = 0 local_sum_v1 = 0.0 local_sum_v2 = 1.0 local_sum_v3 = 0.0 !$omp parallel private(i) reduction(+:local_ctr, local_sum_v1, local_sum_v3) reduction(*:local_sum_v2) !$omp do do i = 1, n local_ctr = local_ctr + 1 ! Counting increment local_sum_v2 = local_sum_v2 * i ! Sample multiplication operation for v2 local_sum_v1 = local_sum_v1 + i ! Sample sum operation for v1 local_sum_v3 = local_sum_v3 - i ! Sample subtraction operation for v3 end do !$omp end do !$omp end parallel ctr = ctr + local_ctr sum_v1 = sum_v1 + local_sum_v1 sum_v2 = sum_v2 * local_sum_v2 sum_v3 = sum_v3 + local_sum_v3 end subroutine program openmp_35 use omp_lib integer, parameter :: n = 16 double precision :: ctr, sum_v1, sum_v2, sum_v3 call omp_set_num_threads(8) ctr = 0.0 sum_v1 = 0.0 sum_v2 = 1.0 ! Initializing for multiplicative reduction sum_v3 = 0.0 call operations(n, ctr, sum_v1, sum_v2,sum_v3) print *, "Total count: ", ctr print *, "Sum of v1: ", sum_v1 print *, "Product result for v2: ", sum_v2 print *, "Difference result for v3: ", sum_v3 end programlfortran-0.63.0/integration_tests/realloc_lhs_01.f900000664000175000017500000000022515174404631022473 0ustar alastairalastairprogram realloc_lhs_01 integer, allocatable :: x(:) x = [1, 2, 3] x = [4, 5] if (size(x) /= 2) error stop end program realloc_lhs_01 lfortran-0.63.0/integration_tests/class_111.f900000664000175000017500000000166515174404631021404 0ustar alastairalastairmodule class_111_mod type :: MyType procedure(factory), pointer, nopass :: val => null() contains procedure :: get end type MyType abstract interface subroutine factory() end subroutine factory end interface contains recursive subroutine get(self, key, val) class(MyType), intent(in) :: self character(*), intent(in) :: key procedure(factory), pointer, intent(out) :: val val => self%val end subroutine get end module class_111_mod program class_111 use class_111_mod character(*), parameter :: key = 'test' procedure(factory), pointer :: val type(MyType) :: obj obj%val => my_factory call obj%get(key, val) if (.not. associated(val)) error stop if (.not. associated(val, my_factory)) error stop print *, "PASS" contains subroutine my_factory() end subroutine my_factory end program class_111 lfortran-0.63.0/integration_tests/legacy_array_sections_11.f900000664000175000017500000000526415174404631024566 0ustar alastairalastair PROGRAM LEGACY_ARRAY_SECTIONS_11 CHARACTER TRANS INTEGER IRESID, LDA, LDB, LDX, LWORK, M, N, NRHS REAL A( 1, 1 ), B( 1, 1 ), C( 1, 1 ), WORK( 1 ), $ X( 1, 1 ) REAL SQRT17, R TRANS = 'N' IRESID = 1 M = 0 N = 1 NRHS = 1 LDA = 1 LDB = 1 LDX = 1 LWORK = 1 R = SQRT17( TRANS, IRESID, M, N, NRHS, A, LDA, X, LDX, B, LDB, $ C, WORK, LWORK ) IF( R.NE.0.0E0 ) STOP 1 END REAL FUNCTION SQRT17( TRANS, IRESID, M, N, NRHS, A, $ LDA, X, LDX, B, LDB, C, WORK, LWORK ) CHARACTER TRANS INTEGER IRESID, LDA, LDB, LDX, LWORK, M, N, NRHS REAL A( LDA, * ), B( LDB, * ), C( LDB, * ), $ WORK( LWORK ), X( LDX, * ) REAL ZERO, ONE PARAMETER ( ZERO = 0.0E0, ONE = 1.0E0 ) INTEGER INFO, ISCL, NCOLS, NROWS REAL ERR, NORMA, NORMB, NORMRS, SMLNUM REAL RWORK( 1 ) LOGICAL LSAME REAL SLAMCH, SLANGE EXTERNAL LSAME, SLAMCH, SLANGE EXTERNAL SGEMM, SLACPY, SLASCL, XERBLA INTRINSIC MAX, REAL SQRT17 = ZERO IF( LSAME( TRANS, 'N' ) ) THEN NROWS = M NCOLS = N ELSE IF( LSAME( TRANS, 'T' ) ) THEN NROWS = N NCOLS = M ELSE CALL XERBLA( 'SQRT17', 1 ) RETURN END IF IF( LWORK.LT.NCOLS*NRHS ) THEN CALL XERBLA( 'SQRT17', 13 ) RETURN END IF IF( M.LE.0 .OR. N.LE.0 .OR. NRHS.LE.0 ) THEN RETURN END IF NORMA = SLANGE( 'One-norm', M, N, A, LDA, RWORK ) SMLNUM = SLAMCH( 'Safe minimum' ) / SLAMCH( 'Precision' ) ISCL = 0 IF( NORMA.GT.ZERO .AND. NORMA.LT.SMLNUM ) THEN ISCL = 1 CALL SLASCL( 'General', 0, 0, NORMA, SMLNUM, M, N, A, LDA, $ INFO ) END IF CALL SLACPY( 'All', NROWS, NRHS, B, LDB, C, LDB ) CALL SGEMM( 'Transpose', TRANS, NRHS, NCOLS, NROWS, ONE, C, LDB, $ A, LDA, ZERO, WORK, NRHS ) ERR = SLANGE( 'One-norm', NRHS, NCOLS, WORK, NRHS, RWORK ) NORMB = SLANGE( 'One-norm', NROWS, NRHS, B, LDB, RWORK ) IF( NORMB.NE.ZERO ) THEN NORMRS = ERR / NORMB ELSE NORMRS = ERR END IF IF( ISCL.EQ.1 ) THEN CALL SLASCL( 'General', 0, 0, SMLNUM, NORMA, M, N, A, LDA, $ INFO ) END IF IF( NORMRS.GT.SQRT17 ) THEN SQRT17 = NORMRS END IF RETURN END lfortran-0.63.0/integration_tests/string_47.f900000664000175000017500000000164215174404631021530 0ustar alastairalastairprogram string_47 implicit none type :: string character(:), allocatable :: s end type type(string), allocatable :: tokens(:) tokens = bpe("abc") print *, tokens(1)%s, tokens(2)%s, tokens(3)%s if( tokens(1)%s /= "a" ) error stop if( tokens(2)%s /= "b" ) error stop if( tokens(3)%s /= "c" ) error stop contains function merge_utf8_pairs(intokens) result(tokens) type(string), intent(in) :: intokens(:) type(string), allocatable :: tokens(:) allocate(tokens(size(intokens))) tokens = intokens end function function bpe(token) result(tokens) character(*), intent(in) :: token type(string), allocatable :: tokens(:) integer :: i allocate(tokens(len(token))) do i = 1, len(token) tokens(i)%s = token(i:i) end do tokens = merge_utf8_pairs(tokens) end function end program lfortran-0.63.0/integration_tests/intrinsics_207.f900000664000175000017500000000710615174404631022466 0ustar alastairalastairprogram intrinsics_207 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: x real :: x4 real(8) :: x8 complex(8) :: z8 print*, dacosh(1.0_dp) if( abs(dacosh(1.0_dp) - 0.0_dp) > 10e-5 ) error stop print*, dacos(1.0_dp) if( abs(dacos(1.0_dp) - 0.0_dp) > 10e-5 ) error stop print*, dasin(1.0_8) if (abs(dasin(1.0_8) - 1.570796326794896_sp) > 10e-5 ) error stop print*, dasinh(1.0_8) if (abs(dasinh(1.0_8) - 0.881373587019543_sp) > 10e-5 ) error stop print*, datanh(0.0_dp) if (abs(datanh(0.0_dp) - 0.0_dp) > 10e-5 ) error stop print*, isign(1, 1) if (isign(1, 1) /= 1) error stop print*, alog(1.0) if (abs(alog(1.0) - 0.0) > 10e-5 ) error stop print*, alog10(1.0) if (abs(alog10(1.0) - 0.0) > 10e-5 ) error stop print*, imagpart((1.0_8, 2.0_8)) if (abs(imagpart((1.0_8, 2.0_8)) - 2.0_8) > 10e-5 ) error stop print*, dint(1.0_8) if (abs(dint(1.0_8) - 1.0_8) > 10e-5 ) error stop print*, dnint(1.0_8) if (abs(dnint(1.0_8) - 1.0_8) > 10e-5 ) error stop print*, dbesj0(1.0_8) if (abs(dbesj0(1.0_8) - 0.765197686557967_sp) > 10e-5 ) error stop print*, dbesj1(1.0_8) if (abs(dbesj1(1.0_8) - 0.440050585744933_sp) > 10e-5 ) error stop print*, dbesy0(1.0_8) if (abs(dbesy0(1.0_8) - 0.088256964215676_sp) > 10e-5 ) error stop print*, dbesy1(1.0_8) if (abs(dbesy1(1.0_8) - (-7.81212821300288685e-01_sp)) > 10e-5 ) error stop print*, idim(1, 1) if (idim(1, 1) /= 0) error stop print*, ddim(1.0_8, 1.0_8) if (abs(ddim(1.0_8, 1.0_8) - 0.0_8) > 10e-5 ) error stop print*, dconjg((1.0_8, 2.0_8)) if (abs(dconjg((1.0_8, 2.0_8)) - (1.0_8, -2.0_8)) > 10e-5 ) error stop print*, amod(1.0, 1.0) if (amod(1.0, 1.0) /= 0.0) error stop print*, dmod(1.0_8, 1.0_8) if (abs(dmod(1.0_8, 1.0_8) - 0.0_8) > 10e-5 ) error stop x4 = 1.0 x8 = 1.0_dp print*, dacosh(x8) if (abs(dacosh(x8) - 0.0) > 10e-5 ) error stop print*, dacos(x8) if (abs(dacos(x8) - 0.0_dp) > 10e-5 ) error stop print*, dasin(x8) if (abs(dasin(x8) - 1.570796326794896_sp) > 10e-5 ) error stop print*, dasinh(x8) if (abs(dasinh(x8) - 0.881373587019543_sp) > 10e-5 ) error stop x8 = 0.0_dp print*, datanh(x8) if (abs(datanh(x8) - 0.0_sp) > 10e-5 ) error stop x = 1 print*, isign(x, x) if (isign(x, x) /= 1) error stop print*, alog(x4) if (abs(alog(x4) - 0.0) > 10e-5 ) error stop print*, alog10(x4) if (abs(alog10(x4) - 0.0) > 10e-5 ) error stop z8 = (1.0_dp, 2.0_dp) print*, imagpart(z8) if (abs(imagpart(z8) - 2.0) > 10e-5 ) error stop x8 = 1.0_dp print*, dint(x8) if (abs(dint(x8) - 1.0) > 10e-5 ) error stop print*, dnint(x8) if (abs(dnint(x8) - 1.0) > 10e-5 ) error stop print*, dbesj0(x8) if (abs(dbesj0(x8) - 0.765197686557967) > 10e-5 ) error stop print*, dbesj1(x8) if (abs(dbesj1(x8) - 0.440050585744933) > 10e-5 ) error stop print*, dbesy0(x8) if (abs(dbesy0(x8) - 0.088256964215676) > 10e-5 ) error stop print*, dbesy1(x8) if (abs(dbesy1(x8) - (-7.81212821300288685e-01)) > 10e-5 ) error stop print*, idim(x, x) if (idim(x, x) /= 0) error stop print*, ddim(x8, x8) if (abs(ddim(x8, x8) - 0.0) > 10e-5 ) error stop print*, dconjg(z8) if (abs(dconjg(z8) - (1.0_dp, -2.0_dp)) > 10e-5 ) error stop print*, amod(x4, x4) if (amod(x4, x4) /= 0.0) error stop print*, dmod(x8, x8) if (abs(dmod(x8, x8) - 0.0) > 10e-5 ) error stop end program lfortran-0.63.0/integration_tests/bindc_02c.c0000664000175000017500000000155715174404631021264 0ustar alastairalastair#include #include #include "bindc_02c.h" void driver() { float A[12]; printf("driver: initializing A[i] = i\n"); for (int i=0; i < 12; i++) { A[i] = i; } printf("driver: calling callback1(12, A)\n"); callback1(12, A); printf("driver: calling callback1b(12, A)\n"); callback1b(12, A); int n = 12; printf("driver: calling callback2(&n, A)\n"); callback2(&n, A); printf("driver: calling callback2b(&n, A)\n"); callback2b(&n, A); } void print_ptr1(int n, float *A) { printf("print_ptr1: n = %d\n", n); printf("[ "); for (int i=0; i < n; i++) { printf("%f ", A[i]); } printf("]\n"); } void print_ptr2(int *n, float *A) { printf("print_ptr2: n = %d\n", *n); printf("[ "); for (int i=0; i < *n; i++) { printf("%f ", A[i]); } printf("]\n"); } lfortran-0.63.0/integration_tests/string_concat_deferred_len.f900000664000175000017500000000047015174404631025241 0ustar alastairalastairprogram string_concat_deferred_len implicit none character(len=:), allocatable :: p, c p = '././src/fpm_meta.f90' c = '' if (p(1:1) /= '.') c = c // p(1:1) // '/' c = c // p(5:len(p)) // '/' if (len(c) > 1 .and. c(len(c):) == '/') c = c(:len(c)-1) if (trim(c) /= 'src/fpm_meta.f90') error stop 1 end program lfortran-0.63.0/integration_tests/intrinsics_225.f900000664000175000017500000000130615174404631022462 0ustar alastairalastairprogram intrinsics_225 implicit none integer(1) :: a1(2) integer(4) :: b1(5) integer(8) :: c1(10) integer(1), parameter :: a2 = iany([1, 2, 3, 4, 5]) integer(4), parameter :: b2 = iany([3, 5, 7, 9, 11]) integer(8), parameter :: c2 = iany([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) a1 = [3, 5] b1 = [3, 5, 7, 9, 11] c1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] print*, iany(a1) if (iany(a1) /= 7) error stop print*, iany(b1) if (iany(b1) /= 15) error stop print*, iany(c1) if (iany(c1) /= 15) error stop print*, a2 if (a2 /= 7) error stop print*, b2 if (b2 /= 15) error stop print*, c2 if (c2 /= 15) error stop end program lfortran-0.63.0/integration_tests/allocate_30.f900000664000175000017500000000321315174404631021772 0ustar alastairalastairprogram allocate_30 implicit none call test_fixed_length_char_array() call test_deferred_length_char_array() call test_zero_size_char_array() contains subroutine test_fixed_length_char_array() character(len=10), allocatable :: from(:), to(:) allocate(from(3)) from(1) = "Hello" from(2) = "World" from(3) = "Test" call move_alloc(from, to) if (allocated(from)) error stop if (.not. allocated(to)) error stop if (size(to) /= 3) error stop if (len(to) /= 10) error stop if (to(1) /= "Hello") error stop if (to(2) /= "World") error stop if (to(3) /= "Test") error stop end subroutine test_fixed_length_char_array subroutine test_deferred_length_char_array() character(len=:), allocatable :: from(:), to(:) allocate(character(len=5) :: from(2)) from(1) = "12345" from(2) = "abcde" call move_alloc(from, to) if (allocated(from)) error stop if (.not. allocated(to)) error stop if (size(to) /= 2) error stop if (len(to) /= 5) error stop if (to(1) /= "12345") error stop if (to(2) /= "abcde") error stop end subroutine test_deferred_length_char_array subroutine test_zero_size_char_array() character(len=:), allocatable :: from(:), to(:) allocate(character(len=8) :: from(0)) call move_alloc(from, to) if (allocated(from)) error stop if (.not. allocated(to)) error stop if (size(to) /= 0) error stop if (len(to) /= 8) error stop end subroutine test_zero_size_char_array end program allocate_30lfortran-0.63.0/integration_tests/intrinsics_362.f900000664000175000017500000000162515174404631022470 0ustar alastairalastairprogram intrinsics_362 implicit none integer :: a(10) integer :: b(5, 3) a = [1,2,3,4,5,6,7,8,9,10] print *, is_contiguous(b(1:, 1:)) if (is_contiguous(b(1:, 1:)) .neqv. .true.) error stop print *, is_contiguous(a(::2)) if (is_contiguous(a(::2)) .neqv. .false.) error stop print *, is_contiguous(b(1:2, 1:2)) if (is_contiguous(b(1:2, 1:2)) .neqv. .false.) error stop print *, is_contiguous(b(1:2, 1:2:2)) if (is_contiguous(b(1:2, 1:2:2)) .neqv. .false.) error stop print *, is_contiguous(b) if (is_contiguous(b) .neqv. .true.) error stop call sub(a(::2)) call sub(a) call sub(a(::1)) call sub(a(::-1)) call sub(a(1:9)) contains subroutine sub (x) integer :: x(:) if (is_contiguous (x)) then print *, 'X is contiguous' else print *, 'X is not contiguous' end if end subroutine sub end programlfortran-0.63.0/integration_tests/where_12.f900000664000175000017500000000111115174404631021313 0ustar alastairalastairprogram where_12 integer ::arr(3,3,3) integer ::arr2(3,3,3) arr = 10 arr2 = 11 arr(:,2,:) = 0 where(arr == 0) arr = 555 arr2 = 555 end where print *, arr if(any(arr(:,2,:) /= 555) .or. any(arr(:,1,:) /= 10) .or. any(arr(:,3,:) /= 10)) error stop ! Test whether the other array got affected or not, just to make sure assignments inside if are handled correctly by where pass. print *, arr2 if(any(arr2(:,2,:) /= 555) .or. any(arr2(:,1,:) /= 11) .or. any(arr2(:,3,:) /= 11)) error stop end program where_12lfortran-0.63.0/integration_tests/entry_01.f900000664000175000017500000000031215174404631021342 0ustar alastairalastairSUBROUTINE dzror() print *, "in dzror" ENTRY dstzr() print *, "in dztzr" RETURN END program main print *, "Call dzror" call dzror() print *, "Call dstzr" call dstzr() end program lfortran-0.63.0/integration_tests/derived_types_27.f900000664000175000017500000000053015174404631023061 0ustar alastairalastairprogram derived_types_27 type :: int_container integer, dimension(2) :: my_int end type integer :: my_int, i type(int_container) :: t my_int = 12 t%my_int(:) = 39 print *, t%my_int(:), my_int do i = 1, 2 if (t%my_int(i) /= 39) error stop end do if (my_int /= 12) error stop end program lfortran-0.63.0/integration_tests/tuple_test_concat_.f900000664000175000017500000000560115174404631023565 0ustar alastairalastairprogram test_tuple_concat implicit none call tuple_concat() contains subroutine tuple_concat() _lfortran_tuple(integer, integer) :: t1 _lfortran_tuple(real, character(len=:), integer) :: t2 _lfortran_tuple(real) :: t3 _lfortran_tuple(integer, integer, real, character(len=:), integer, real) :: t4 _lfortran_tuple(integer, real) :: t5 _lfortran_tuple(integer, real, integer, real) :: t6 _lfortran_tuple(integer, real, integer, real, integer, real) :: t7 _lfortran_tuple(integer, real, integer, real, integer, real, integer, real) :: t8 _lfortran_list(_lfortran_tuple(integer, real)) :: l1 integer:: start, i _lfortran_tuple(_lfortran_tuple(_lfortran_tuple(integer, integer), _lfortran_tuple(integer, real)), _lfortran_tuple(real, character(len=:), integer)) :: t9 t1 = _lfortran_tuple_constant(1, 2) t2 = _lfortran_tuple_constant(3.0, "abc", -10) t3 = _lfortran_tuple_constant(10.0) t4 = _lfortran_concat(t1, _lfortran_concat(t2, t3)) if ( .not. _lfortran_eq(t4, _lfortran_tuple_constant(_lfortran_get_item(t1, 0), & _lfortran_get_item(t1, 1), _lfortran_get_item(t2, 0),_lfortran_get_item(t2, 1), & _lfortran_get_item(t2, 2),_lfortran_get_item(t3, 0))) ) error stop if ( .not. _lfortran_eq(_lfortran_concat(t4, t3), _lfortran_concat(t1, t2, t3, & _lfortran_tuple_constant(_lfortran_get_item(t3, 0)))) ) error stop start = 117 do i = start, start + 2 t5 = _lfortran_tuple_constant(i, real(i*i)) call _lfortran_list_append(l1, t5) if (i == start) then t6 = _lfortran_concat(t5, _lfortran_get_item(l1, -1)) else if (i == start + 1) then t7 = _lfortran_concat(t6, _lfortran_get_item(l1, -1)) else t8 = _lfortran_concat(t7, _lfortran_get_item(l1, -1)) end if end do if ( .not. _lfortran_eq(t6, _lfortran_concat(_lfortran_get_item(l1, 0), & _lfortran_get_item(l1, 0)))) error stop if ( .not. _lfortran_eq(t7, _lfortran_concat(t6, _lfortran_get_item(l1, 1)))) error stop if ( .not. _lfortran_eq(t8, _lfortran_concat(t7, _lfortran_get_item(l1, 2)))) error stop t9 = _lfortran_concat(_lfortran_tuple_constant(_lfortran_tuple_constant(t1, t5)), _lfortran_tuple_constant(t2)) if ( .not. (_lfortran_eq(_lfortran_get_item(_lfortran_get_item(t9, 0), 0), t1) .and. & _lfortran_eq(_lfortran_get_item(_lfortran_get_item(t9, 0), 1), t5) .and. & _lfortran_eq(_lfortran_get_item(t9, 1), t2)) ) error stop end subroutine end program test_tuple_concat lfortran-0.63.0/integration_tests/intrinsics_32.f900000664000175000017500000000067115174404631022402 0ustar alastairalastairprogram intrinsics_32 implicit none real, dimension(6) :: tsource, fsource, result logical, dimension(6) :: mask integer :: i do i = 1, 6 tsource(i) = i*2 fsource(i) = -i*2 end do mask(1) = .true. mask(2) = .false. mask(3) = .false. mask(4) = .true. mask(5) = .true. mask(6) = .false. result = merge(tsource, fsource, mask) print *, result end program intrinsics_32 lfortran-0.63.0/integration_tests/subroutines_21.f900000664000175000017500000000145515174404631022576 0ustar alastairalastair! Test sequence association: passing an array element to an ! explicit-shape array dummy argument (F2018 15.5.2.11). subroutine sum_n(n, x, s) integer, intent(in) :: n integer, intent(in) :: x(n) integer, intent(out) :: s integer :: i s = 0 do i = 1, n s = s + x(i) end do end subroutine program main implicit none integer :: work(6), res work = [10, 20, 30, 40, 50, 60] ! Pass work(3) — sequence association gives callee elements 30,40,50,60 call sum_n(4, work(3), res) print *, res if (res /= 180) error stop ! Pass work(1) — full array via sequence association call sum_n(6, work(1), res) print *, res if (res /= 210) error stop ! Pass work(5) — last two elements: 50+60 call sum_n(2, work(5), res) print *, res if (res /= 110) error stop end program lfortran-0.63.0/integration_tests/where_09.f900000664000175000017500000000037515174404631021334 0ustar alastairalastairprogram where_09 implicit none integer :: a(3) integer :: b(3) a = [1,0,-1] b = 0 where(abs(a) == 1) b = 555 print *, b if (b(1) /= 555) error stop if (b(2) /= 0) error stop if (b(3) /= 555) error stop end program where_09 lfortran-0.63.0/integration_tests/gpu_metal_26.f900000664000175000017500000000132715174404631022174 0ustar alastairalastairmodule gpu_metal_26_m implicit none type :: inner_t contains procedure :: eval end type type :: outer_t type(inner_t) :: f end type contains elemental function eval(self, x) result(y) class(inner_t), intent(in) :: self real, intent(in) :: x real :: y y = x * 2.0 end function end module program gpu_metal_26 use gpu_metal_26_m implicit none type(outer_t) :: o real :: x(4), y(4) integer :: i x = [1.0, 2.0, 3.0, 4.0] do concurrent (i = 1:4) y(i) = o%f%eval(x(i)) end do if (abs(y(1) - 2.0) > 1e-5) error stop if (abs(y(2) - 4.0) > 1e-5) error stop if (abs(y(3) - 6.0) > 1e-5) error stop if (abs(y(4) - 8.0) > 1e-5) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/select_type_22.f900000664000175000017500000000075115174404631022533 0ustar alastairalastairmodule m implicit none type :: t contains procedure :: init end type contains subroutine init(self) class(t), intent(inout) :: self print *, "init" end subroutine end module program p use m implicit none class(t), allocatable :: x logical :: called called = .false. allocate(t :: x) select type(y => x) class default call y%init() called = .true. end select if (.not. called) error stop end program lfortran-0.63.0/integration_tests/separate_compilation_02.f900000664000175000017500000000053515174404631024413 0ustar alastairalastairprogram separate_compilation_02 use separate_compilation_02_module implicit none integer :: i interface subroutine sub end subroutine sub integer function fn() end function fn end interface call sub call m_sub i = fn() print *, i if ( i /= 19 ) error stop end program separate_compilation_02 lfortran-0.63.0/integration_tests/minpack_01_func.f900000664000175000017500000000022515174404631022641 0ustar alastairalastair double precision function enorm1(n) result(y) double precision n y = dabs(n) return end function lfortran-0.63.0/integration_tests/bindc_39c.c0000664000175000017500000000222715174404631021271 0ustar alastairalastair#include #include /* ---- TYPE(*) scalar ---- */ int32_t c39_type_star_scalar(const void *x) { /* We know it's int32_t from the Fortran call site */ return *(const int32_t *)x; } /* ---- TYPE(*) assumed-size ---- */ int32_t c39_type_star_assumed_size(const void *x, int32_t n) { const int32_t *arr = (const int32_t *)x; int32_t sum = 0; for (int i = 0; i < n; i++) sum += arr[i]; return sum; } /* ---- Assumed-size integer array ---- */ int32_t c39_sum_assumed_size_int(const int32_t *arr, int32_t n) { int32_t sum = 0; for (int i = 0; i < n; i++) sum += arr[i]; return sum; } /* ---- Assumed-size real(c_double) array ---- */ double c39_sum_assumed_size_dbl(const double *arr, int32_t n) { double sum = 0.0; for (int i = 0; i < n; i++) sum += arr[i]; return sum; } /* ---- BLOCK DATA common block ---- * The common block /c39_bd_common/ has BIND(C, NAME="c39_bd_common") * so it appears as a C struct with two int32_t members. */ extern struct { int32_t a, b; } c39_bd_common; int32_t c39_get_common_a(void) { return c39_bd_common.a; } int32_t c39_get_common_b(void) { return c39_bd_common.b; } lfortran-0.63.0/integration_tests/intrinsics_100.f900000664000175000017500000000133415174404631022453 0ustar alastairalastairprogram intrinsics_100 implicit none integer(1) :: ix_8, iy_8 integer(2) :: ix_16, iy_16 integer :: iresult integer(8) :: ix_64, iy_64 ix_8 = 127_1 iy_8 = 23_1 iresult = mod(ix_8, iy_8) print *, "Test 1: mod( ", ix_8, ",", iy_8, ") = ", iresult if (iresult /= 12) error stop "Test 1 failed" ix_16 = -32767_2 iy_16 = 17_2 iresult = mod(ix_16, iy_16) print *, "Test 2: mod( ", ix_16, ",", iy_16, ") = ", iresult if (iresult /= -8) error stop "Test 2 failed" ix_64 = 43256_8 iy_64 = 53_8 iresult = mod(ix_64, iy_64) print *, "Test 3: mod( ", ix_64, ",", iy_64, ") = ", iresult if (iresult /= 8) error stop "Test 3 failed" end program intrinsics_100 lfortran-0.63.0/integration_tests/separate_compilation_29a.f900000664000175000017500000000051215174404631024560 0ustar alastairalastairmodule separate_compilation_29a_module implicit none type :: t integer :: x end type t type(t) :: targets contains subroutine sa() targets%x = 1 end subroutine sa integer function get_a() get_a = targets%x end function get_a end module separate_compilation_29a_module lfortran-0.63.0/integration_tests/exit_02.f900000664000175000017500000000021615174404631021156 0ustar alastairalastairprogram exit_02 integer :: i, N N = 10 do i = 1, N print *, i if ( i .eq. 5 ) then call exit(0) end if end do end program lfortran-0.63.0/integration_tests/statement_04.f900000664000175000017500000000034715174404631022220 0ustar alastairalastairprogram statement integer, parameter :: wp = kind(1.e0) real(wp) :: g2 complex(wp) :: g, t real(wp) :: ABSSQ ABSSQ( t ) = real( t )**2 + aimag( t )**2 g = (3.0, 4.0) g2 = ABSSQ(g) print *, g2 end program lfortran-0.63.0/integration_tests/char_param_reshape_01.f900000664000175000017500000000111315174404631024005 0ustar alastairalastairmodule char_param_mod implicit none character(7), parameter :: ch_arr(1:2,1:3) = reshape([ & 'a ', '1 ', & 'b ', '2 ', & 'c ', '3 ' & ], [2,3]) contains function test(i) integer, intent(in) :: i character(:), allocatable :: test test = ch_arr(1, i) end function test end module program char_param_reshape_01 use char_param_mod implicit none if (trim(test(1)) /= "a") error stop if (trim(test(2)) /= "b") error stop if (trim(test(3)) /= "c") error stop end program char_param_reshape_01 lfortran-0.63.0/integration_tests/gpu_metal_173.f900000664000175000017500000000106715174404631022260 0ustar alastairalastairprogram gpu_metal_173 ! Test: do concurrent with non-1 lower bound arrays + liveout scalars ! Verifies that the Metal backend correctly handles: ! 1. Arrays with lower bound 0 (n(0:2)) — index offset must use actual ! lower bound, not assume 1-based. ! 2. Scalars assigned inside do concurrent that are read after the loop ! (liveout scalars) — must be passed as device buffers and read back. implicit none integer :: n(0:2), r, l n = [10, 20, 30] r = 0 do concurrent(l = 1:1) r = n(1) end do if (r /= 20) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/write_18.f900000664000175000017500000000163315174404631021352 0ustar alastairalastairmodule write_18_mod type :: MyType integer :: a, b end type MyType interface write(formatted) procedure :: output end interface write(formatted) contains subroutine output(self, unit, iotype, v_list, iostat, iomsg) class(MyType), intent(in) :: self integer, intent(in) :: unit character(*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(*), intent(inout) :: iomsg ! The iotype must be "DT", not "(dt)" or any other form if (iotype /= 'DT') error stop if (self%a /= 10) error stop if (self%b /= 20) error stop iostat = 0 end subroutine output end module write_18_mod program write_18 use write_18_mod type(MyType) :: obj obj%a = 10 obj%b = 20 write(*, '(dt)') obj print '(dt)', obj print *, "ok" end program write_18 lfortran-0.63.0/integration_tests/intrinsics_21.f900000664000175000017500000000420115174404631022371 0ustar alastairalastairprogram intrinsics_21 ! Test mod / modulo intrinsics both declarations and executable statements. ! Single and double precision, real only. integer, parameter :: dp = kind(0.d0) real, parameter :: & s1 = modulo(-5., 3.), & s2 = modulo(5., -3.), & s3 = modulo(-5., -3.), & s4 = modulo(5., 3.), & s1b = mod(-5., 3.), & s2b = mod(5., -3.), & s3b = mod(-5., -3.), & s4b = mod(5., 3.) real(dp), parameter :: & d1 = modulo(-5._dp, 3._dp), & d2 = modulo(5._dp, -3._dp), & d3 = modulo(-5._dp, -3._dp), & d4 = modulo(5._dp, 3._dp), & d1b = mod(-5._dp, 3._dp), & d2b = mod(5._dp, -3._dp), & d3b = mod(-5._dp, -3._dp), & d4b = mod(5._dp, 3._dp) integer, parameter :: & j1 = modulo(-5, 3), & j2 = modulo(5, -3), & j3 = modulo(-5, -3), & j4 = modulo(5, 3), & j1b = mod(-5, 3), & j2b = mod(5, -3), & j3b = mod(-5, -3), & j4b = mod(5, 3) real :: x1, x2 real(dp) :: y1, y2 integer :: i1, i2 i1 = -5; i2 = 3 x1 = i1; y1 = i1; x2 = i2; y2 = i2; print *, modulo(-5., 3.), modulo(-5._dp, 3._dp), modulo(x1, x2), modulo(y1, y2), s1, d1 print *, mod(-5., 3.), mod(-5._dp, 3._dp), mod(x1, x2), mod(y1, y2), s1b, d1b print *, modulo(-5, 3), modulo(i1, i2), j1 print *, mod(-5, 3), mod(i1, i2), j1b i1 = 5; i2 = -3 x1 = i1; y1 = i1; x2 = i2; y2 = i2; print *, modulo(5., -3.), modulo(5._dp, -3._dp), modulo(x1, x2), modulo(y1, y2), s2, d2 print *, mod(5., -3.), mod(5._dp, -3._dp), mod(x1, x2), mod(y1, y2), s2b, d2b print *, modulo(5, -3), modulo(i1, i2), j2 print *, mod(5, -3), mod(i1, i2), j2b i1 = -5; i2 = -3 x1 = i1; y1 = i1; x2 = i2; y2 = i2; print *, modulo(-5., -3.), modulo(-5._dp, -3._dp), modulo(x1, x2),modulo(y1, y2), s3, d3 print *, mod(-5., -3.), mod(-5._dp, -3._dp), mod(x1, x2), mod(y1, y2), s3b, d3b print *, modulo(-5, -3), modulo(i1, i2), j3 print *, mod(-5, -3), mod(i1, i2), j3b i1 = 5; i2 = 3 x1 = i1; y1 = i1; x2 = i2; y2 = i2; print *, modulo(5., 3.), modulo(5._dp, 3._dp), modulo(x1, x2), modulo(y1, y2), s4, d4 print *, mod(5., 3.), mod(5._dp, 3._dp), mod(x1, x2), mod(y1, y2), s4b, d4b print *, modulo(5, 3), modulo(i1, i2), j4 print *, mod(5, 3), mod(i1, i2), j4b end lfortran-0.63.0/integration_tests/functions_15.f900000664000175000017500000000237615174404631022232 0ustar alastairalastairmodule functions_15_module_1 implicit none contains subroutine sub_1(a, b, c, d, e, f) integer, intent(inout) :: a real, intent(inout) :: b logical, intent(in) :: c real, intent(in), optional :: d integer, intent(in), optional :: e real, intent(in) :: f if (present(d)) then a = b ** 2 + d if (present(e)) then b = b * f + e else b = b * f end if else a = b ** 2 if (present(e)) then b = b * f + e else b = b * f end if end if end subroutine sub_1 end module program functions_15 use functions_15_module_1, only: sub_1 implicit none integer :: a real :: b a = 1 b = 2 call sub_1(a, b, .true., d=12.0, e=5, f=6.0) call sub_1(a, b, .false., f=6.0) call sub_1(a, b, .true., e=78, f=117.0) call sub_1(a, b, .false., d=58.0, f=123.0) print *, a, b if (a /= 144288208) error stop if (b /= 1477476.00) error stop print *, f(), f(42) ! "f t" contains logical function f(x) integer, intent(in), optional :: x f = present(x) end function end program functions_15 lfortran-0.63.0/integration_tests/submodule_29c.f900000664000175000017500000000024015174404631022355 0ustar alastairalastairsubmodule(submodule_29_mod) submodule_29_child implicit none contains module procedure greet y = x * multiplier end procedure end submodule lfortran-0.63.0/integration_tests/contig_stmt_01.f900000664000175000017500000000102215174404631022532 0ustar alastairalastairprogram contig_stmt_01 implicit none character(len=1) :: nml(1) real(8) :: nmv(1) call eval_equation("x", nml, nmv) contains subroutine eval_equation(ln, nml, nmv) character(*), intent(in) :: ln character(*), dimension(:), intent(in) :: nml real(8), dimension(:), intent(inout) :: nmv contiguous :: nml, nmv if (ln /= "x") error stop nmv(1) = 42.0d0 print *, "PASS" end subroutine eval_equation end program contig_stmt_01 lfortran-0.63.0/integration_tests/callback_06.f900000664000175000017500000000073415174404631021752 0ustar alastairalastairprogram callback_06 implicit none integer, allocatable :: v(:) allocate(v(2)) call run(f) if (v(1) /= 1) error stop if (v(2) /= 2) error stop print *, v contains subroutine run(F) interface subroutine cb(x) integer, intent(in) :: x(:) end subroutine end interface procedure(cb) :: F call F([1, 2]) end subroutine subroutine f(x) integer, intent(in) :: x(:) v = reshape(x, shape(v)) end subroutine end program lfortran-0.63.0/integration_tests/sizeof_01.f900000664000175000017500000000052215174404631021503 0ustar alastairalastairprogram sizeof_01 use iso_c_binding, only: c_int, c_double, c_size_t implicit none integer(c_int) :: x real(c_double) :: y integer(c_size_t) :: sx, sy sx = sizeof(x) if (sx /= 4) error stop "sizeof(c_int) should be 4" sy = sizeof(y) if (sy /= 8) error stop "sizeof(c_double) should be 8" end program lfortran-0.63.0/integration_tests/select_type_19.f900000664000175000017500000000116615174404631022542 0ustar alastairalastairmodule select_type_19_m implicit none contains subroutine takes_logical_array(a) logical, intent(in) :: a(:) if (count(a) /= 2) error stop end subroutine takes_logical_array end module select_type_19_m program select_type_19 use select_type_19_m, only: takes_logical_array implicit none logical, target :: l(3) class(*), pointer :: generic(:) l = [.true., .false., .true.] generic => l select type (generic) type is (logical) call takes_logical_array(generic) class default error stop end select print *, "ok" end program select_type_19 lfortran-0.63.0/integration_tests/submodule_50a.f900000664000175000017500000000036715174404631022357 0ustar alastairalastairprogram submodule_50a use submodule_50_mod implicit none type(wrapper_type) :: w integer :: i allocate(w%containers(3)) do i = 1, 3 call w%containers(i)%setup([10, 20]) end do print *, "PASS" end program lfortran-0.63.0/integration_tests/class_22.f900000664000175000017500000000143415174404631021317 0ustar alastairalastairmodule class_22_m implicit none private public :: inner_class, cast_integer, expect_pointer ! Define the inner class with some integer data type :: inner_class integer :: value end type inner_class contains function cast_integer(obj) result(x) class(inner_class), intent(in), allocatable :: obj logical :: x x = .true. end function cast_integer subroutine expect_pointer(x) type(inner_class), pointer, intent(in) :: x if (x%value /= 50) error stop end subroutine expect_pointer end module class_22_m program class_22 use class_22_m implicit none class(inner_class), allocatable :: inner_obj type(inner_class), target :: x x%value = 50 if (cast_integer(inner_obj) .neqv. .true.) error stop call expect_pointer(x) end program class_22 lfortran-0.63.0/integration_tests/gpu_metal_90.f900000664000175000017500000000105315174404631022171 0ustar alastairalastairprogram gpu_metal_90 ! Test: indexing allocatable array member of a derived type array ! in do concurrent (Metal GPU offload). The allocatable data for ! each struct element must be flattened into a separate device buffer. implicit none type :: t real, allocatable :: v(:) end type type(t) :: a(2) real :: r(2) integer :: i allocate(a(1)%v(1), a(2)%v(1)) a(1)%v(1) = 1.0 a(2)%v(1) = 2.0 do concurrent (i = 1:2) r(i) = a(i)%v(1) end do if (abs(r(1) - 1.0) > 0.001) error stop if (abs(r(2) - 2.0) > 0.001) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/where_02.f900000664000175000017500000000044515174404631021323 0ustar alastairalastairprogram main implicit none real a(2) real b(2) a(1) = 1.0 a(2) = 2.0 b(1) = 0.5 b(2) = 3.5 where (a > b) a = 1.5 endwhere print *, a if (abs(a(1) - 1.5) > 1e-7) error stop if (abs(a(2) - 2.0) > 1e-7) error stop end program lfortran-0.63.0/integration_tests/external_14.f900000664000175000017500000000127415174404631022037 0ustar alastairalastairmodule external_14_mod_2 use iso_c_binding use external_14_mod_1, only : f_string implicit none contains function get_ptr() result(r) type(c_ptr) :: r character(kind=c_char), target, save :: buf(6) buf = [ 'h','e','l','l','o', c_null_char ] r = c_loc(buf) end function get_ptr subroutine test() character(:), allocatable :: s s = f_string(get_ptr()) print *, s if (s /= "hello") then error stop "Wrong string returned" end if end subroutine test end module external_14_mod_2 program external_14 use external_14_mod_2 implicit none call test() end program external_14 lfortran-0.63.0/integration_tests/openmp_04.f900000664000175000017500000000077215174404631021514 0ustar alastairalastairsubroutine omp_func(n) use omp_lib implicit none integer, intent(in) :: n integer :: i !$omp parallel private(i) shared(n) !$omp do do i = 1, n print *, "xyz" print *, "i = ", i, "from thread = ", omp_get_thread_num() if (omp_get_thread_num() > 4) error stop end do !$omp end do !$omp end parallel print *, "n = ", n if (n /= 10) error stop end subroutine program openmp_04 use omp_lib integer :: n = 10 call omp_set_num_threads(4) call omp_func(n) print *, "Done for n = ", n end program lfortran-0.63.0/integration_tests/gpu_metal_147_activation.f900000664000175000017500000000051115174404631024473 0ustar alastairalastairmodule gpu_metal_147_activation implicit none type activation_t contains procedure :: evaluate => default_real_evaluate end type contains elemental function default_real_evaluate(self, x) result(y) class(activation_t), intent(in) :: self real, intent(in) :: x real y y = x end function end module lfortran-0.63.0/integration_tests/data_18.f900000664000175000017500000000040015174404631021120 0ustar alastairalastairprogram data_18 implicit none real :: array(5) integer, parameter :: nelems = 5 integer :: i DATA (array(i), i=1,5) /nelems*3.1415/ do i = 1, 5 if (abs(array(i) - 3.1415) > 1.0e-5) error stop end do end program data_18 lfortran-0.63.0/integration_tests/intrinsics_275.f900000664000175000017500000000307615174404631022475 0ustar alastairalastairprogram intrinsics_275 implicit none integer :: a1 = 5, a2 = 8 integer(8) :: a3 = -1, a4 = -4 integer :: a5 = -2, a6 = -5 integer, parameter :: i1 = and(5, 8) integer, parameter :: i2 = and(-1, 5) integer, parameter :: i3 = and(-4_8, 2_8) integer(8), parameter :: i4 = and(-2_8, 5_8) logical, parameter :: l1 = and(.true., .false.) logical, parameter :: l2 = and(.true., .true.) logical :: true = .true., false = .false. print *, i1 if (i1 /= 0) error stop print *, i2 if (i2 /= 5) error stop print *, i3 if (i3 /= 0) error stop print *, i4 if (i4 /= 4) error stop ! logical argument testing print *, l1 if (l1 .neqv. .false.) error stop print *, l2 if (l2 .neqv. .true.) error stop print *, and(true, false) if (and(true, false) .neqv. .false.) error stop print *, and(true, true) if (and(true, true) .neqv. .true.) error stop print*, and(5, 8) if (and(5, 8) /= 0) error stop print*, and(-1, 5) if (and(-1, 5) /= 5) error stop print*, and(8, -4) if (and(8, -4) /= 8) error stop print*, and(-2, -5) if (and(-2, -5) /= -6) error stop print*, and(a1, a2) if (and(a1, a2) /= 0) error stop print*, and(a3, a4) if (and(a3, a4) /= -4) error stop print*, and(a2, a5) if (and(a2, a5) /= 8) error stop print*, and(a5, a6) if (and(a5, a6) /= -6) error stop print *, kind(and(5, 8)) if (kind(and(5, 8)) /= 4) error stop print *, kind(and(-1_8, 5_8)) if (kind(and(-1_8, 5_8)) /= 8) error stop end program lfortran-0.63.0/integration_tests/cos_01.f900000664000175000017500000000027215174404631020772 0ustar alastairalastairprogram cos_01 use iso_fortran_env, only: dp => real64 implicit none real(dp) :: x x = cos(1.5_dp) print *, x if (abs(x - 7.07372016677029064e-02_dp) > 1e-16_dp) error stop end program lfortran-0.63.0/integration_tests/submodule_03.f900000664000175000017500000000101515174404631022203 0ustar alastairalastairmodule submodule_03_mod implicit none interface module function f(a) result(r) integer, intent(in) :: a integer :: r end function end interface end module submodule (submodule_03_mod) submodule_03_submod contains module function f(a) result(r) integer, intent(in) :: a integer :: r r = a + 1 end function end submodule program submodules_03_prog use submodule_03_mod, only: f implicit none integer :: i i = f(5) print *, i if (i /= 6) error stop end program lfortran-0.63.0/integration_tests/implied_do_loops5.f900000664000175000017500000000065615174404631023322 0ustar alastairalastairMODULE module_implied_do_loops5 INTEGER, DIMENSION(5) :: fixup_counter INTEGER :: n END MODULE module_implied_do_loops5 PROGRAM implied_do_loops5 USE module_implied_do_loops5 IMPLICIT NONE INTEGER, DIMENSION(5) :: result_array PRINT *, (fixup_counter(n) + n, n = 1, 5) result_array = [(fixup_counter(n) + n, n = 1, 5)] if (all(result_array /= [1, 2, 3, 4, 5])) ERROR STOP END PROGRAM implied_do_loops5 lfortran-0.63.0/integration_tests/modules_27_module2.f900000664000175000017500000000177015174404631023321 0ustar alastairalastairmodule tomlf_build_array use tomlf_build_keyval, only : get_value, GLOBAL_VAR implicit none interface get_value module procedure :: get_elem_table module procedure :: get_elem_array module procedure :: get_elem_keyval end interface get_value contains subroutine get_elem_table(array, pos, ptr, stat) integer, intent(inout) :: array integer, intent(in) :: pos real, pointer, intent(out) :: ptr integer, intent(out), optional :: stat GLOBAL_VAR = 1.0 end subroutine get_elem_table subroutine get_elem_array(array, pos, ptr, stat) complex, intent(inout) :: array integer, intent(in) :: pos real, pointer, intent(out) :: ptr integer, intent(out), optional :: stat end subroutine get_elem_array subroutine get_elem_keyval(array, pos, ptr, stat) integer, intent(inout) :: array integer, intent(in) :: pos complex, pointer, intent(out) :: ptr integer, intent(out), optional :: stat end subroutine get_elem_keyval end module tomlf_build_array lfortran-0.63.0/integration_tests/intrinsics_344.f900000664000175000017500000000041415174404631022463 0ustar alastairalastairprogram main integer, dimension(2, 2) :: x integer(8), dimension(2, 2) :: y integer(8), dimension(2, 2) :: ans x = 2 ans = maskl(x, 8) y = -4611686018427387904_8 print *, ans print *, y if (any(ans /= y)) error stop end program lfortran-0.63.0/integration_tests/operator_overloading_02.f900000664000175000017500000000132115174404631024427 0ustar alastairalastairmodule overload_assignment_m implicit none private public assignment (=) interface assignment (=) module procedure logical_gets_integer end interface contains subroutine logical_gets_integer(tf, i) logical, intent (out) :: tf integer, intent (in) :: i tf = (i == 0) end subroutine subroutine logical_gets_integer_use(tf, i) logical, intent (out) :: tf integer, intent (in) :: i tf = i end subroutine end module program main use overload_assignment_m, only: assignment(=) implicit none logical :: tf tf = 0 print *, "tf=0:", tf ! Yields: T tf = 1 print *, "tf=1:", tf ! Yields: F end program lfortran-0.63.0/integration_tests/equivalence_28.f900000664000175000017500000000044015174404631022515 0ustar alastairalastairprogram equivalence_28 implicit none integer :: ia1(4), ia2(4) equivalence (ia1, ia2(3)) ia1 = [11, 12, 13, 14] ia2 = [ 1, 2, 3, 4] if (.not. all(ia1 == [3, 4, 13, 14])) error stop if (.not. all(ia2 == [1, 2, 3, 4])) error stop end program equivalence_28lfortran-0.63.0/integration_tests/print_arr_09.f900000664000175000017500000000026415174404631022217 0ustar alastairalastairprogram print_arr_09 implicit none character(len=100) :: str1 write(str1, "(6(1X,I0))") [1,2,3,4,5,6] if (trim(str1) /= " 1 2 3 4 5 6") error stop end program print_arr_09 lfortran-0.63.0/integration_tests/legacy_array_sections_07.f900000664000175000017500000000174315174404631024571 0ustar alastairalastairmodule legacy_array_sections_07_module !! [order = polynomial degree + 1] interface db1ink module procedure :: db1ink_default end interface public :: db1ink contains pure subroutine db1ink_default(x) implicit none real(4), dimension(:), intent(in) :: x call check_inputs(x=x) end subroutine db1ink_default pure subroutine check_inputs(x, y) implicit none real(4), dimension(:), intent(in), optional :: x, y end subroutine check_inputs end module legacy_array_sections_07_module program legacy_array_sections_07 use legacy_array_sections_07_module implicit none real :: x(5), y(2) x = [1.0, 2.0, 3.0, 4.0, 5.0] y = [6.0, 7.0] call db1ink_default(x) print *, x if (any(x - [1.0, 2.0, 3.0, 4.0, 5.0] > 1e-6)) error stop call check_inputs(x, y) print *, y if (any(y - [6.0, 7.0] > 1e-6)) error stop end program legacy_array_sections_07lfortran-0.63.0/integration_tests/submodule_11.f900000664000175000017500000000104515174404631022205 0ustar alastairalastairmodule math_submodule_11 implicit none interface logspace module subroutine logspace_sub(n) integer, intent(inout) :: n end subroutine logspace_sub end interface end module submodule (math_submodule_11) math_submodule_11_logspace implicit none contains module procedure logspace_sub n = 3 end procedure end submodule program submodule_11 use math_submodule_11 implicit none integer :: n = 2 call logspace(n) print *, n if (n /= 3) error stop end programlfortran-0.63.0/integration_tests/global_allocatable_02.f900000664000175000017500000000126515174404631023775 0ustar alastairalastair! Checking global scope of f allocatable array. module mod_test_allocatable_02 implicit none integer, allocatable, dimension(:,:) :: f end module mod_test_allocatable_02 subroutine r use mod_test_allocatable_02 implicit none logical :: ret ret = all (f(1,:) == [1,2,3,4]) if (ret .eqv. .false.) error stop deallocate(f) allocate(f(6,6)) f(2,:) = [10,10,10,10,10,10] end subroutine r program mm use mod_test_allocatable_02 implicit none logical :: ret allocate(f(4,4)) f(1,:) = [1, 2, 3, 4] print *,f call r print *,f ret = all (f(2,:) == [10,10,10,10,10,10]) if(ret .eqv. .false.) error stop end program mmlfortran-0.63.0/integration_tests/implicit_interface_23.f900000664000175000017500000000232615174404631024046 0ustar alastairalastair! Test implicit interface procedure dummy with mixed call patterns ! When a procedure dummy f is: ! 1. Passed as argument to another subroutine ! 2. Called with both variable args f(x) and expression args f(x+1) ! All calls should use consistent by-reference calling convention program implicit_interface_23 implicit none double precision :: x, result x = 2.0d0 call compute(square, x, result) ! Expected: square(2) + square(3) = 4 + 9 = 13 if (abs(result - 13.0d0) > 1.0d-10) error stop print *, "PASS" contains double precision function square(y) double precision, intent(in) :: y square = y * y end function end program subroutine compute(f, x, result) implicit none double precision, intent(in) :: x double precision, intent(out) :: result double precision :: f, tmp external :: f ! Pass f to another subroutine first (creates implicit interface) tmp = x call use_func(f, tmp) ! Then call f with both variable and expression arguments result = f(x) + f(x + 1.0d0) end subroutine subroutine use_func(g, z) implicit none double precision, intent(inout) :: z double precision :: g external :: g z = g(z) end subroutine lfortran-0.63.0/integration_tests/arrays_01_real.f900000664000175000017500000000136615174404631022517 0ustar alastairalastairprogram arrays_01_real implicit none integer :: i, j real(8) :: a(3), b(4), c(2, 2) do i = 1, 3 a(i) = i+10 end do if (a(1) /= 11) error stop if (a(2) /= 12) error stop if (a(3) /= 13) error stop do i = 11, 14 b(i-10) = i end do if (b(1) /= 11) error stop if (b(2) /= 12) error stop if (b(3) /= 13) error stop if (b(4) /= 14) error stop do i = 1, 3 b(i) = a(i)-10 end do if (b(1) /= 1) error stop if (b(2) /= 2) error stop if (b(3) /= 3) error stop b(4) = b(1)+b(2)+b(3)+a(1) if (b(4) /= 17) error stop b(4) = a(1) if (b(4) /= 11) error stop do i = 1, 2 do j = 1, 2 c(i, j) = i + j + 10 end do end do if (c(1, 1) /= 12) error stop if (c(1, 2) /= 13) error stop if (c(2, 1) /= 13) error stop if (c(2, 2) /= 14) error stop end lfortran-0.63.0/integration_tests/gpu_metal_179.f900000664000175000017500000000101415174404631022256 0ustar alastairalastair! Test: user-defined function named 'or' (C++ alternative operator token) ! must be renamed in Metal shader to avoid keyword clash. module gpu_metal_179_m implicit none contains pure real function or(x) real, intent(in) :: x or = x end function end module program gpu_metal_179 use gpu_metal_179_m implicit none real :: a(4), b(4) integer :: i a = [1.0, 2.0, 3.0, 4.0] do concurrent(i=1:4) b(i) = or(a(i)) end do if (any(abs(b - a) > 1e-6)) error stop "FAIL" print *, "PASS" end program lfortran-0.63.0/integration_tests/external_04.f900000664000175000017500000000041015174404631022025 0ustar alastairalastairsubroutine sub() external f double precision f, y y = f(1.0d0) if (abs(y-1.0d0) >= 1e-8) error stop print *, y end subroutine double precision function f(x) double precision x f = x end function program external_05 call sub() end program lfortran-0.63.0/integration_tests/intrinsics_35.f900000664000175000017500000000045215174404631022402 0ustar alastairalastairprogram intrinsics_35 logical l l = any((/.true., .true., .true./)) print *, l call section() contains subroutine section() integer :: a(2, 3), b(2, 3) a = 1 b = 1 b(2, 2) = 2 print *, any(a == b, 1) print *, any(a == b, 2) end subroutine section end program intrinsics_35lfortran-0.63.0/integration_tests/CMakeLists.txt0000664000175000017500000107022015174404631022127 0ustar alastairalastaircmake_minimum_required(VERSION 3.10 FATAL_ERROR) project(lfort C Fortran) if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type (Debug, Release)" FORCE) endif () set(LFORTRAN_BACKEND no CACHE STRING "Only compile the LFortran subset for the given backend") set(FAST no CACHE BOOL "Run supported tests with --fast") set(DETECT_LEAKS no CACHE BOOL "Run tests with --detect-leaks") set(NOFAST_LLVM16 no CACHE BOOL "Don't run unsupported tests with --fast when llvm < 17") set(STD_F23 no CACHE BOOL "Run tests with --std-f23") set(LLVM_GOC no CACHE BOOL "Run tests with --separate-compilation") enable_testing() message("\n") message("Configuration results") message("---------------------") message("Fortran compiler: ${CMAKE_Fortran_COMPILER}") message("C compiler : ${CMAKE_C_COMPILER}") message("Build type: ${CMAKE_BUILD_TYPE}") string(TOUPPER "${CMAKE_BUILD_TYPE}" BTYPE) message("Fortran compiler flags: ${CMAKE_Fortran_FLAGS_${BTYPE}}") message("C compiler flags : ${CMAKE_C_FLAGS_${BTYPE}}") message("Installation prefix: ${CMAKE_INSTALL_PREFIX}") message("LFORTRAN_BACKEND: ${LFORTRAN_BACKEND}") message("FAST: ${FAST}") message("DETECT_LEAKS: ${DETECT_LEAKS}") message("NOFAST_LLVM16: ${NOFAST_LLVM16}") message("STD_F23: ${STD_F23}") message("LLVM_GOC: ${LLVM_GOC}") # Make ISO_Fortran_binding.h available to the C compiler. # LFortran ships its own header in src/libasr/runtime/. # GFortran on macOS needs special handling: its include/ directory also # contains stddef.h and other headers that conflict with the system C # compiler (Clang), so we copy just the one header into a clean directory. # On Linux, GCC's C compiler can find the header automatically. # Flang/Clang can also find it automatically. if (LFORTRAN_BACKEND AND NOT LFORTRAN_BACKEND STREQUAL "flang") # LFortran set(ISO_FORTRAN_BINDING_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/../src/libasr/runtime") elseif (NOT LFORTRAN_BACKEND AND APPLE) # GFortran on macOS find_file(ISO_FORTRAN_BINDING_H ISO_Fortran_binding.h PATHS ${CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES} NO_DEFAULT_PATH) if (ISO_FORTRAN_BINDING_H) set(ISO_FORTRAN_BINDING_INCLUDE_DIR "${CMAKE_BINARY_DIR}/fortran_c_interop") file(MAKE_DIRECTORY ${ISO_FORTRAN_BINDING_INCLUDE_DIR}) file(COPY ${ISO_FORTRAN_BINDING_H} DESTINATION ${ISO_FORTRAN_BINDING_INCLUDE_DIR}) endif() endif() macro(RUN_UTIL RUN_FAIL RUN_NAME RUN_FILE_NAME RUN_LABELS RUN_EXTRAFILES RUN_EXTRA_ARGS RUN_COPY_TO_BIN RUN_GFORTRAN_ARGS) set(fail ${${RUN_FAIL}}) set(name ${${RUN_NAME}}) set(file_name ${${RUN_FILE_NAME}}) set(labels ${${RUN_LABELS}}) set(extra_files ${${RUN_EXTRAFILES}}) set(extra_args ${${RUN_EXTRA_ARGS}}) set(copy_to_bin ${${RUN_COPY_TO_BIN}}) set(gfortran_args ${${RUN_GFORTRAN_ARGS}}) if (NOT name) message(FATAL_ERROR "Must specify the NAME argument") endif() if (LFORTRAN_BACKEND) if (${LFORTRAN_BACKEND} IN_LIST labels) # Test is supported by the given LFortran backend set(ADD_TEST ON) else() # Test is not supported by the given LFortran backend set(ADD_TEST OFF) endif() else() # GFortran if ("gfortran" IN_LIST labels) set(ADD_TEST ON) elseif ("gfortranImplicitArgument" IN_LIST labels) set(ADD_TEST ON) else() set(ADD_TEST OFF) endif() endif() if (ADD_TEST) if ((LFORTRAN_BACKEND STREQUAL "cpp") OR (LFORTRAN_BACKEND STREQUAL "x86") OR (LFORTRAN_BACKEND STREQUAL "c") OR (LFORTRAN_BACKEND STREQUAL "fortran")) add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC ${extra_args} --backend=${LFORTRAN_BACKEND}) target_link_options(${name} PUBLIC --backend=${LFORTRAN_BACKEND}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "wasm") # wasm test execute_process(COMMAND lfortran ${extra_args} --backend=wasm ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 -o ${name}) find_program(WASM_EXEC_RUNTIME node) execute_process(COMMAND "${WASM_EXEC_RUNTIME}" --version OUTPUT_VARIABLE WASM_EXEC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) string(REGEX REPLACE "v([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1" NODE_MAJOR_VERSION "${WASM_EXEC_VERSION}") if (NODE_MAJOR_VERSION LESS 16) message(STATUS "${WASM_EXEC_RUNTIME} version: ${WASM_EXEC_VERSION}") set(WASM_EXEC_FLAGS "--experimental-wasm-bigint") endif() set(WASM_EXEC_FLAGS ${WASM_EXEC_FLAGS} "--experimental-wasi-unstable-preview1") add_test(${name} ${WASM_EXEC_RUNTIME} ${WASM_EXEC_FLAGS} ${CURRENT_BINARY_DIR}/${name}.js) elseif (LFORTRAN_BACKEND STREQUAL "llvm_wasm") find_program(WASM_EXEC_RUNTIME wasmtime) execute_process(COMMAND "${WASM_EXEC_RUNTIME}" --version OUTPUT_VARIABLE WASM_EXEC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC ${extra_args} --backend=llvm --target=wasm32-wasi) target_link_options(${name} PUBLIC --backend=llvm --target=wasm32-wasi -Wl,-zstack-size=52428800 -Wl,--initial-memory=268435456 -Wl,--max-memory=268435456) add_test(${name} ${WASM_EXEC_RUNTIME} ${CURRENT_BINARY_DIR}/${name} --dir=.) elseif (LFORTRAN_BACKEND STREQUAL "llvm_wasm_emcc") find_program(WASM_EXEC_RUNTIME node) execute_process(COMMAND "${WASM_EXEC_RUNTIME}" --version OUTPUT_VARIABLE WASM_EXEC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC ${extra_args} --backend=llvm --target=wasm32-unknown-emscripten) target_link_options(${name} PUBLIC --backend=llvm --target=wasm32-unknown-emscripten) if (copy_to_bin) target_link_options(${name} PUBLIC --emcc-embed ${copy_to_bin}) endif() add_test(${name} ${WASM_EXEC_RUNTIME} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvm2") add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC --separate-compilation ${extra_args}) target_link_options(${name} PUBLIC --separate-compilation ${extra_args}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvm_rtlib") add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC --separate-compilation ${extra_args}) set_source_files_properties(${file_name}.f90 PROPERTIES COMPILE_OPTIONS "--rtlib") add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvmImplicit") execute_process(COMMAND lfortran ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 ${extra_args} --implicit-typing --implicit-interface -o ${name}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvmStackArray") execute_process(COMMAND lfortran ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 ${extra_args} --stack-arrays=true -o ${name}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvm_integer_8") execute_process(COMMAND lfortran ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 ${extra_args} -fdefault-integer-8 -o ${name}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvm_infer") execute_process(COMMAND lfortran ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 ${extra_args} --infer -o ${name}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvm_nopragma") add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC --ignore-pragma ${extra_args}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "c_nopragma") add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC --backend=c --ignore-pragma ${extra_args}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvm_single_invocation") set(extra_files_full ${extra_files}) list(TRANSFORM extra_files_full PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/") add_custom_command( OUTPUT ${CURRENT_BINARY_DIR}/${name} COMMAND lfortran -I${CMAKE_CURRENT_SOURCE_DIR} ${extra_args} ${extra_files_full} ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 -o ${CURRENT_BINARY_DIR}/${name} DEPENDS ${extra_files_full} ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) add_custom_target(${name}_single_invocation ALL DEPENDS ${CURRENT_BINARY_DIR}/${name}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvm") add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC $<$:${extra_args}>) if (ISO_FORTRAN_BINDING_INCLUDE_DIR) target_include_directories(${name} PRIVATE ${ISO_FORTRAN_BINDING_INCLUDE_DIR}) endif() add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvm_omp") add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC --openmp --openmp-lib-dir=$ENV{CONDA_PREFIX}/lib ${extra_args}) target_link_options(${name} PUBLIC --openmp --openmp-lib-dir=$ENV{CONDA_PREFIX}/lib ${extra_args}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) set_tests_properties(${name} PROPERTIES ENVIRONMENT "KMP_TEAMS_THREAD_LIMIT=32" ) elseif (LFORTRAN_BACKEND STREQUAL "target_offload") set(c_file "${CURRENT_BINARY_DIR}/${file_name}.c") execute_process( COMMAND lfortran ${extra_args} --openmp --show-c --target-offload ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 OUTPUT_FILE ${c_file} RESULT_VARIABLE convert_result ) configure_file( ${CMAKE_SOURCE_DIR}/../src/libasr/config.h.in ${CMAKE_SOURCE_DIR}/../src/libasr/config.h @ONLY ) add_executable(${name} ${CMAKE_SOURCE_DIR}/../src/libasr/runtime/lfortran_intrinsics.c ${CMAKE_SOURCE_DIR}/../src/libasr/runtime/cuda_cpu_runtime.c ${c_file} ) target_include_directories(${name} PUBLIC ${CMAKE_SOURCE_DIR}/../src/ ${CMAKE_SOURCE_DIR}/../src/libasr/runtime ) target_compile_options(${name} PUBLIC -fopenmp) target_link_libraries(${name} PUBLIC m) target_link_options(${name} PUBLIC -fopenmp) target_link_options(${name} PUBLIC -L$ENV{CONDA_PREFIX}/lib ${extra_args}) add_test(NAME ${name} COMMAND ${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvm_submodule") set(object_files "") set(prev_file "") foreach(extra_file ${extra_files}) get_filename_component(obj_name ${extra_file} NAME_WE) add_library(${obj_name} OBJECT ${extra_file}) target_compile_options(${obj_name} PUBLIC $<$:${extra_args}>) if (prev_file) add_dependencies(${obj_name} ${prev_file}) endif() set(prev_file ${obj_name}) list(APPEND object_files $) endforeach() add_executable(${name} ${file_name}.f90 ${object_files}) target_compile_options(${name} PUBLIC $<$:${extra_args}>) add_dependencies(${name} ${prev_file}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "gfortranModfileCompilation") execute_process(COMMAND gfortran ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 -c) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "mlir") execute_process(COMMAND lfortran ${extra_args} --backend=mlir ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 -o ${name}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "mlir_omp") execute_process(COMMAND lfortran ${extra_args} --backend=mlir --openmp --openmp-lib-dir=$ENV{CONDA_PREFIX}/lib --mlir-gpu-offloading ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 -o ${name}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "mlir_llvm_omp") execute_process(COMMAND lfortran ${extra_args} --backend=llvm --openmp --openmp-lib-dir=$ENV{CONDA_PREFIX}/lib --mlir-gpu-offloading ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 -o ${name}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "metal") add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC $<$:--gpu=metal ${extra_args}>) target_link_options(${name} PUBLIC --gpu=metal) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "cuda") add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC $<$:--gpu=cuda ${extra_args}>) target_link_options(${name} PUBLIC --gpu=cuda) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "flang") add_executable(${name} ${file_name}.f90 ${extra_files}) if (ISO_FORTRAN_BINDING_INCLUDE_DIR) target_include_directories(${name} PRIVATE ${ISO_FORTRAN_BINDING_INCLUDE_DIR}) endif() add_test(${name} ${CURRENT_BINARY_DIR}/${name}) else () add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC $<$:${gfortran_args}>) target_link_options(${name} PUBLIC ${gfortran_args}) if (ISO_FORTRAN_BINDING_INCLUDE_DIR) target_include_directories(${name} PRIVATE ${ISO_FORTRAN_BINDING_INCLUDE_DIR}) endif() add_test(${name} ${CURRENT_BINARY_DIR}/${name}) endif() if (labels) set_tests_properties(${name} PROPERTIES LABELS "${labels}") endif() if (fail) set_tests_properties(${name} PROPERTIES WILL_FAIL TRUE) endif() if (copy_to_bin) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${copy_to_bin} DESTINATION ${CURRENT_BINARY_DIR}) endif() endif() endmacro(RUN_UTIL) macro(RUN) set(options FAIL NOFAST_TILL_LLVM16 NO_FAST NO_FAST_MATH NO_DETECT_LEAKS NO_STD_F23 NO_LLVM_GOC) set(oneValueArgs NAME FILE INCLUDE_PATH COPY_TO_BIN) set(multiValueArgs LABELS EXTRAFILES EXTRA_ARGS GFORTRAN_ARGS) cmake_parse_arguments(RUN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) foreach(b ${RUN_LABELS}) if (NOT (b MATCHES "^(llvm|llvm2|llvm_rtlib|c|cpp|x86|wasm|gfortran|flang|llvmImplicit|llvmStackArray|llvm_integer_8|llvm_infer|fortran|c_nopragma|llvm_nopragma|llvm_wasm|llvm_wasm_emcc|llvm_omp|target_offload|llvm_submodule|mlir|mlir_omp|mlir_llvm_omp|llvm_single_invocation|metal|cuda)$")) message(FATAL_ERROR "Unsupported backend: ${b}") endif() endforeach() # Use FILE if provided, otherwise use NAME as the file name if (RUN_FILE) set(RUN_FILE_NAME ${RUN_FILE}) else() set(RUN_FILE_NAME ${RUN_NAME}) endif() if (RUN_INCLUDE_PATH) # Only one include path supported for now # Later add support for multiple include paths by looping over and appending to extra args set(RUN_EXTRA_ARGS ${RUN_EXTRA_ARGS} -I${CMAKE_CURRENT_SOURCE_DIR}/${RUN_INCLUDE_PATH}) set(RUN_GFORTRAN_ARGS ${RUN_GFORTRAN_ARGS} -I${CMAKE_CURRENT_SOURCE_DIR}/${RUN_INCLUDE_PATH}) endif() if ((STD_F23) AND (NOT RUN_NO_STD_F23)) set(RUN_EXTRA_ARGS ${RUN_EXTRA_ARGS} --std=f23) set(RUN_NAME "${RUN_NAME}_STD_F23") endif() if ((LLVM_GOC) AND (NOT RUN_NO_LLVM_GOC) AND (NOT LFORTRAN_BACKEND STREQUAL "fortran")) set(RUN_EXTRA_ARGS ${RUN_EXTRA_ARGS} --separate-compilation) set(RUN_NAME "${RUN_NAME}_LLVM_GOC") endif() if (DETECT_LEAKS AND (NOT RUN_NO_DETECT_LEAKS)) set(RUN_EXTRA_ARGS ${RUN_EXTRA_ARGS} --detect-leaks) set(RUN_NAME "${RUN_NAME}_DETECT_LEAKS") endif() if (FAST AND ((NOT NOFAST_LLVM16)) AND (NOT RUN_NO_FAST)) set(RUN_EXTRA_ARGS ${RUN_EXTRA_ARGS} --fast) if (RUN_NO_FAST_MATH) set(RUN_EXTRA_ARGS ${RUN_EXTRA_ARGS} --no-fast-math) endif() set(RUN_NAME "${RUN_NAME}_FAST") list(REMOVE_ITEM RUN_LABELS gfortran) # remove gfortran from --fast test RUN_UTIL(RUN_FAIL RUN_NAME RUN_FILE_NAME RUN_LABELS RUN_EXTRAFILES RUN_EXTRA_ARGS RUN_COPY_TO_BIN RUN_GFORTRAN_ARGS) else () RUN_UTIL(RUN_FAIL RUN_NAME RUN_FILE_NAME RUN_LABELS RUN_EXTRAFILES RUN_EXTRA_ARGS RUN_COPY_TO_BIN RUN_GFORTRAN_ARGS) endif() endmacro(RUN) # only compiles till object file # to make sure that the ASR generation is successful macro(COMPILE) set(oneValueArgs NAME) set(multiValueArgs COMPILERS) cmake_parse_arguments(COMPILE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) set(name ${COMPILE_NAME}) set(compilers ${COMPILE_COMPILERS}) if (NOT name) message(FATAL_ERROR "Must specify the NAME argument") endif() if (NOT compilers) message(FATAL_ERROR "Must specify the COMPILER argument") endif() foreach(compiler ${compilers}) if (compiler STREQUAL "lfortran" AND ${LFORTRAN_BACKEND} STREQUAL "llvm") add_custom_command( OUTPUT ${name}_lfortran.mod COMMAND lfortran -c ${CMAKE_CURRENT_SOURCE_DIR}/${name}.f90) add_library(${name}_lfortran OBJECT ${name}_lfortran.mod) elseif(compiler STREQUAL "gfortran" AND ${LFORTRAN_BACKEND} STREQUAL "no") add_custom_command( OUTPUT ${name}_gfortran.mod COMMAND gfortran -c ${CMAKE_CURRENT_SOURCE_DIR}/${name}.f90) add_library(${name}_gfortran OBJECT ${name}_gfortran.mod) endif() endforeach() endmacro(COMPILE) # The supported test labels are: # # gfortran --- compile with GFortran # fortran --- convert to Fortran code and compile with GFortran # llvm --- compile with LFortran, only generate binary code at the very end # llvm2 --- compile with LFortran, generate object files # llvm_rtlib --- compile with LFortran loading ASR runtime library, generate object files # cpp --- compile to C++, compile C++ to binary # x86 --- compile to x86 binary directly # wasm --- compile to WASM binary directly # mlir --- generate mlir, convert to llvm ir and compile to binary # mlir_omp --- generate mlir with OpenMP, convert to llvm ir and compile to binary # llvm_single_invocation --- compile all sources in a single LFortran invocation # mlir_llvm_omp --- generate mlir for a module with OpenMP, convert and link # it with the existing llvm ir and compile to binary # `reduce` is not supported by GFortran yet: # RUN(NAME doconcurrentloop_02 LABELS gfortran) # GFortran + LFortran LLVM + LFortran C++ RUN(NAME program_cmake_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran) RUN(NAME program_cmake_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran) RUN(NAME internal_subr_host_vars_01 LABELS gfortran llvm) RUN(NAME nested_callback_arrays LABELS gfortran llvm) RUN(NAME nested_callback_interface_01 LABELS gfortran llvm) RUN(NAME abort_01 LABELS gfortran llvm) RUN(NAME error_stop_01 FAIL LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm llvm2 fortran) RUN(NAME error_stop_02 FAIL LABELS llvm llvm_wasm llvm_wasm_emcc wasm llvm2 fortran) RUN(NAME error_stop_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME error_stop_04 FAIL LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME stop_01 LABELS llvm llvm_wasm llvm_wasm_emcc wasm llvm2 c fortran) RUN(NAME stop_02 FAIL LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME stop_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME ilp64_stop_01 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME ilp64_file_ops_01 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME ilp64_logical_read_01 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME ilp64_complex_literal_01 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME ilp64_logical_compare_01 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME print_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp llvm2 wasm fortran mlir) RUN(NAME print_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2 wasm fortran) RUN(NAME print_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2 wasm c fortran) RUN(NAME print_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2 fortran) RUN(NAME print_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2 fortran) RUN(NAME print_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME print_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2 fortran) RUN(NAME print_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2 fortran) RUN(NAME print_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2) RUN(NAME print_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2) RUN(NAME print_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2) RUN(NAME print_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME print_arr_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2 wasm c fortran) RUN(NAME print_arr_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2 wasm c fortran) RUN(NAME print_arr_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2 fortran) RUN(NAME print_arr_04 LABELS llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --apply-fortran-mangling) RUN(NAME print_arr_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME crlf_fixed_form LABELS gfortran llvm EXTRA_ARGS --fixed-form GFORTRAN_ARGS -ffixed-form) RUN(NAME fixed_form_select_case_01 LABELS gfortran llvm EXTRA_ARGS --fixed-form GFORTRAN_ARGS -ffixed-form) RUN(NAME fixed_form_select_case_02 LABELS gfortran llvm EXTRA_ARGS --fixed-form GFORTRAN_ARGS -ffixed-form) RUN(NAME fixed_form_select_rank_01 LABELS gfortran llvm EXTRA_ARGS --fixed-form GFORTRAN_ARGS -ffixed-form) RUN(NAME fixed_form_comment_01 LABELS gfortran llvm EXTRA_ARGS --fixed-form GFORTRAN_ARGS -ffixed-form) RUN(NAME fixed_form_io_keyword_01 LABELS gfortran llvm EXTRA_ARGS --fixed-form GFORTRAN_ARGS -ffixed-form) RUN(NAME fixed_form_io_keyword_02 LABELS gfortran llvm EXTRA_ARGS --fixed-form GFORTRAN_ARGS -ffixed-form) RUN(NAME print_arr_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran mlir) RUN(NAME print_arr_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME include_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME include_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME include_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran INCLUDE_PATH include_03) RUN(NAME include_04 LABELS gfortran llvm EXTRA_ARGS --fixed-form GFORTRAN_ARGS -ffixed-form INCLUDE_PATH include_04) RUN(NAME use_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm fortran) RUN(NAME use_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm fortran) RUN(NAME use_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm) RUN(NAME use_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm) RUN(NAME symbol_table_jloop_01 LABELS gfortran llvm) RUN(NAME value_attribute_01 LABELS gfortran llvm) RUN(NAME volatile_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME volatile_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME volatile_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME cond_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran) RUN(NAME cond_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME cond_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME cond_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME cond_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME cond_06 LABELS gfortran llvm) RUN(NAME complex_cloc_01 LABELS gfortran llvm) RUN(NAME complex_solutions LABELS gfortran llvm) RUN(NAME expr_01 FAIL LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran) RUN(NAME expr_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran mlir) RUN(NAME expr_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran mlir) RUN(NAME expr_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm c fortran) RUN(NAME expr_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp c fortran) # it contains pow, wasm supports only x**2 RUN(NAME expr_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran mlir) RUN(NAME expr_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran mlir) RUN(NAME expr_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME expr_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME expr_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME expr_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) # it uses string compare RUN(NAME expr_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME expr_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME expr_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME string_concat_deferred_len LABELS gfortran llvm) RUN(NAME expr_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME expr_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME expr_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME expr_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c) RUN(NAME expr_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME expr_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST_MATH) RUN(NAME data_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME data_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME data_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME data_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME data_05 LABELS gfortran) # llvmImplicit removed RUN(NAME data_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c) RUN(NAME data_07 LABELS gfortran) # TODO: Fix this test RUN(NAME data_08 LABELS gfortran llvmImplicit) RUN(NAME data_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME data_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_11 LABELS gfortran llvmImplicit) RUN(NAME data_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME data_16 LABELS gfortran llvmImplicit) RUN(NAME data_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME datastmt_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME slash_init_01 LABELS gfortran llvm) RUN(NAME max_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME max_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME min_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME min_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME minmax_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME arithmetic_if_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) # arithmetic tests use goto RUN(NAME arithmetic_if_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME arithmetic_if_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME arithmetic_if_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME if_label_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_label_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_case_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_case_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_case_03 LABELS gfortran llvm EXTRA_ARGS --separate-compilation) RUN(NAME variables_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran) RUN(NAME variables_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran) RUN(NAME variables_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm c fortran) RUN(NAME if_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran) RUN(NAME if_02 FAIL LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c) RUN(NAME if_03 FAIL LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c) RUN(NAME if_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran) RUN(NAME if_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm c fortran) RUN(NAME if_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # select case range RUN(NAME while_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran) RUN(NAME while_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm c fortran) RUN(NAME while_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm EXTRA_ARGS --fixed-form fortran) RUN(NAME while_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME while_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME while_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME while_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME doloop_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c cpp x86 wasm fortran) RUN(NAME doloop_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c cpp x86 wasm mlir fortran) RUN(NAME doloop_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c cpp wasm fortran) RUN(NAME doloop_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # uses goto target RUN(NAME doloop_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # uses goto RUN(NAME doloop_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c cpp wasm fortran) RUN(NAME doloop_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c cpp wasm fortran) RUN(NAME doloop_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c cpp wasm fortran) RUN(NAME doloop_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # nested subroutine RUN(NAME doloop_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # implicit cast loop variable RUN(NAME doloop_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm EXTRA_ARGS --use-loop-variable-after-loop) RUN(NAME doloop_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME doloop_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --use-loop-variable-after-loop) RUN(NAME doloop_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --use-loop-variable-after-loop) RUN(NAME doloop_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --use-loop-variable-after-loop) RUN(NAME doloop_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --use-loop-variable-after-loop) RUN(NAME doloop_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME doloop_18 LABELS gfortran llvm) RUN(NAME cycle_and_exit1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME cycle_and_exit2 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME cycle_and_exit3 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME cycle_and_exit4 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME cycle_and_exit5 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME cycle_and_exit6 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME goto_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME goto_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME goto_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME goto_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME goto_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME subroutines_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm mlir fortran) RUN(NAME subroutines_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm fortran) RUN(NAME subroutines_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME subroutines_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME subroutines_06 LABELS gfortran llvm) RUN(NAME subroutines_07 LABELS gfortran llvm) RUN(NAME subroutines_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME subroutines_09 LABELS gfortran llvm) RUN(NAME subroutines_10 LABELS gfortran) RUN(NAME subroutines_11 LABELS gfortran llvm fortran) RUN(NAME subroutines_12 LABELS gfortran llvm fortran) RUN(NAME subroutines_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME subroutines_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays fortran) RUN(NAME subroutines_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME subroutines_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME subroutines_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME subroutines_18 LABELS gfortran llvm) RUN(NAME subroutines_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME subroutines_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME subroutines_21 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections) RUN(NAME functions_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm mlir fortran) RUN(NAME functions_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME functions_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME functions_06 LABELS gfortran llvm) RUN(NAME functions_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_09 LABELS gfortran llvm fortran) RUN(NAME functions_10 LABELS gfortran llvm) RUN(NAME functions_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME functions_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME functions_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME functions_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_16 LABELS gfortran llvm) RUN(NAME functions_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --fixed-form) RUN(NAME functions_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran NO_FAST_MATH) RUN(NAME functions_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_33 LABELS gfortran llvm) RUN(NAME functions_34 LABELS gfortran llvm) RUN(NAME functions_35 LABELS gfortran llvm) RUN(NAME functions_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_38 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_39 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_40 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_41 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_42 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_43 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_44 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_45 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_46 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME functions_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_50 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_51 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_52 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_53 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_54 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME functions_55 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME functions_56 LABELS gfortran llvm EXTRAFILES functions_56_mod.f90 EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME functions_57 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME functions_58 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_01 LABELS gfortran) RUN(NAME types_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm fortran) RUN(NAME types_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm fortran) RUN(NAME types_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm fortran) RUN(NAME types_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm fortran) RUN(NAME types_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm fortran) RUN(NAME types_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm fortran) # GFortran + LFortran C++ RUN(NAME doconcurrentloop_01 LABELS gfortran cpp) RUN(NAME arrays_01 LABELS gfortran cpp llvm llvmStackArray wasm) RUN(NAME arrays_01_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_02_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_03_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_04_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_05_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_06_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_07_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_08_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_09_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_10_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_11_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_12_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_13_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME matrix_01_transpose LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME matrix_02_matmul LABELS gfortran fortran) RUN(NAME matrix_03_transpose_param LABELS gfortran llvm) RUN(NAME array_01_pack LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME array_01_transfer LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME array_02_pack LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME array_03_pack LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME array_04_pack LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME array_02_transfer LABELS gfortran) RUN(NAME array_03_transfer LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME array_04_transfer LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_05_transfer LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME array_06_transfer LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_07_transfer LABELS gfortran llvm) RUN(NAME array_08_transfer LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME array_04_all LABELS gfortran fortran) RUN(NAME arrays_01_real LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_01_complex LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME block_data_01 LABELS llvm gfortran) RUN(NAME block_data_complex LABELS llvm gfortran) RUN(NAME block_data_string_01 LABELS llvm gfortran) RUN(NAME arrays_01_logical LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME block_data_parameter_01 LABELS gfortran llvmImplicit) RUN(NAME arrays_01_multi_dim LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME integer_bin_op_dim_external_module LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME array_bound_1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME array_bound_2 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME array_bound_3 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME array_bound_4 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME array_bound_5 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_bound_6 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays fortran) RUN(NAME arrays_op_1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_op_2 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_op_3 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_op_4 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_5 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_op_6 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_7 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_op_8 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_9 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_op_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --realloc-lhs-arrays fortran) RUN(NAME arrays_op_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_op_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_op_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME arrays_op_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --realloc-lhs-arrays fortran) RUN(NAME arrays_op_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME arrays_op_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_31 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME arrays_reshape_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME arrays_reshape_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray NO_STD_F23) RUN(NAME arrays_reshape_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_reshape_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_reshape_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_reshape_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME arrays_reshape_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_reshape_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_reshape_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_33 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME arrays_reshape_34 LABELS gfortran llvm) RUN(NAME arrays_reshape_35 LABELS gfortran llvm) RUN(NAME arrays_reshape_36 LABELS gfortran llvm) RUN(NAME arrays_reshape_37 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME arrays_reshape_38 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME arrays_reshape_39 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_reshape_40 LABELS gfortran llvm) RUN(NAME arrays_reshape_41 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME arrays_reshape_42 LABELS gfortran llvm) RUN(NAME array_reshape_pad_01 LABELS gfortran llvm) RUN(NAME arrays_elemental_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_03_func LABELS gfortran cpp llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_03_func_pass_arr_dims LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_04_func LABELS gfortran cpp llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_04_func_pass_arr_dims LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_18_func LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME arrays_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME arrays_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME arrays_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME arrays_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray llvm_integer_8) # maxloc, minloc RUN(NAME arrays_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray llvm_integer_8) # maxloc RUN(NAME arrays_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) # init expr with fixed size arr as dependency RUN(NAME arrays_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_35 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_38 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_39 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_40 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_41 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_42 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_43 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_44 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME arrays_45 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_46 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_50 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES arrays_50_mod.f90) RUN(NAME arrays_51 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_52 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_53 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_54 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_55 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_56 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_57 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_58 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_59 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_60 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_61 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_62 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_63 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_64 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_65 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_66 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_67 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_68 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_69 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_70 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_71 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_72 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_73 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_74 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_75 LABELS gfortran llvm) RUN(NAME arrays_76 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_77 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_78 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_79 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_80 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_81 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_82 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_83 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_84 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_85 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_86 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_87 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_88 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_89 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_90 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_91 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_92 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_93 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_94 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_95 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_96 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_97 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_98 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_99 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_100 LABELS gfortran llvm) RUN(NAME arrays_101 LABELS gfortran llvm) RUN(NAME arrays_102 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME arrays_103 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_104 LABELS gfortran llvm) RUN(NAME arrays_105 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_106 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_107 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --legacy-array-sections) RUN(NAME arrays_108 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_109 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_110 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME arrays_111 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_112 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_113 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_114 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_115 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME arrays_116 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_117 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_118 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_119 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_120 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_121 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_122 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_123 LABELS gfortran llvm) # DISABLED: #8115 - ICE: get_struct_sym_from_struct_expr returns nullptr for empty struct array constructors [tp ::] # RUN(NAME array_init LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME assumed_rank_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME assumed_rank_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME assumed_rank_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME assumed_rank_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME assumed_rank_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME assumed_rank_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME assumed_rank_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME assume_rank_shape_product_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME select_rank_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME select_rank_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME select_rank_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME select_rank_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_27 LABELS gfortran llvm) RUN(NAME select_rank_28 LABELS gfortran llvm) RUN(NAME global_allocatable_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME global_allocatable_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME global_array_pointer_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME global_array_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME pointer_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME pointer_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME pointer_03 LABELS gfortran llvm fortran) RUN(NAME pointer_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME pointer_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME pointer_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME pointer_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME pointer_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME pointer_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME pointer_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME pointer_11 LABELS gfortran llvm fortran) RUN(NAME pointer_12 LABELS gfortran llvm fortran) RUN(NAME pointer_13 LABELS gfortran llvmImplicit) RUN(NAME pointer_14 LABELS gfortran llvm) RUN(NAME pointer_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME pointer_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_section_is_non_allocatable LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME array_indices_array_section LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME array_indices_array_section_assignment LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_constructor_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME array_constructor_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME array_constructor_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME array_constructor_04 LABELS gfortran llvm fortran EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME array_constructor_05 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME array_constructor_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME allocatble_c_ptr LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME hashmap_struct_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME hashmap_nested_dealloc_derived_pointer LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME hashmap_derived_pointer_associated LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME call_subroutine_without_type LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME call_subroutine_without_type_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # GFortran RUN(NAME arrays_02 LABELS gfortran llvm fortran) RUN(NAME arrays_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_08_func LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_08_func_pass_arr_dims LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_09 LABELS gfortran llvm fortran) RUN(NAME arrays_10 LABELS gfortran llvm fortran) RUN(NAME arrays_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray cpp fortran) RUN(NAME arrays_12 LABELS gfortran fortran) # constant arrays RUN(NAME arrays_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) # constant arrays RUN(NAME arrays_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_inputs_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) # constant arrays RUN(NAME arrays_16_func LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_intrin_01 LABELS gfortran llvm fortran) # minval, maxval RUN(NAME arrays_intrin_02 LABELS gfortran fortran) # all, any RUN(NAME arrays_intrin_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) # maxval RUN(NAME arrays_intrin_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) # maxval RUN(NAME arrays_intrin_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) # minval RUN(NAME arrays_intrin_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) # minval RUN(NAME arrays_intrin_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) # min RUN(NAME arrays_intrin_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_intrin_09 LABELS gfortran llvm fortran) # any/count logical mask RUN(NAME any_01 LABELS gfortran fortran) RUN(NAME any_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME any_03 LABELS gfortran llvm fortran) RUN(NAME sum_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME sum_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME sum_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME intrinsic_reduce_01 LABELS llvm GFORTRAN_ARGS -std=f2018) RUN(NAME intrinsic_reduce_derived_type_01 LABELS llvm) RUN(NAME product_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME product_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME reserved_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME reserved_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME reserved_03 LABELS gfortran llvm fortran) RUN(NAME namelist_01 LABELS gfortran llvm fortran) RUN(NAME namelist_02 LABELS gfortran llvm fortran) RUN(NAME namelist_03 LABELS gfortran llvm fortran) RUN(NAME namelist_04 LABELS gfortran llvm fortran) RUN(NAME namelist_05 LABELS gfortran llvm fortran) RUN(NAME namelist_06 LABELS gfortran llvm fortran) RUN(NAME namelist_07 LABELS gfortran llvm fortran) RUN(NAME namelist_08 LABELS gfortran llvm fortran) RUN(NAME namelist_09 LABELS gfortran llvm fortran) RUN(NAME namelist_10 LABELS gfortran llvm fortran) RUN(NAME namelist_11 LABELS gfortran llvm fortran) RUN(NAME namelist_12 LABELS gfortran llvm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME namelist_13 LABELS gfortran llvm EXTRAFILES namelist_13_module.f90) RUN(NAME namelist_14 LABELS gfortran llvm) RUN(NAME namelist_15 LABELS gfortran llvm) RUN(NAME namelist_16 LABELS gfortran llvm) RUN(NAME namelist_17 LABELS gfortran llvm) RUN(NAME namelist_18 LABELS gfortran llvm) RUN(NAME namelist_19 LABELS gfortran llvm) RUN(NAME namelist_20 LABELS gfortran llvm) RUN(NAME namelist_21 LABELS gfortran llvm) RUN(NAME namelist_22 LABELS gfortran llvm) RUN(NAME namelist_23 LABELS gfortran llvm) RUN(NAME namelist_24 LABELS gfortran llvm) RUN(NAME namelist_25 LABELS gfortran llvm) RUN(NAME namelist_26 LABELS gfortran llvm) RUN(NAME namelist_27 LABELS gfortran llvm) RUN(NAME namelist_28 LABELS gfortran llvm) RUN(NAME namelist_29 LABELS gfortran llvm) RUN(NAME namelist_30 LABELS gfortran llvm) RUN(NAME nested_namelist_01 LABELS gfortran llvm) RUN(NAME format_quotes_01 LABELS gfortran llvm) RUN(NAME format_01 LABELS gfortran llvm fortran) RUN(NAME format_02 LABELS gfortran llvm fortran) RUN(NAME format_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_08s LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_35 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_38 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_39 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_40 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_41 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_42 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_43 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_44 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_45 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_46 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_50 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_51 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_52 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_53 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_54 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_55 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_56 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --fixed-form GFORTRAN_ARGS -ffixed-form) RUN(NAME format_57 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_58 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_59 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_60 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_61 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_62 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_63 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_64 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_65 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST_MATH) RUN(NAME format_66 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_67 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_68 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_69 LABELS gfortran llvm) RUN(NAME format_70 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_71 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_72 LABELS gfortran llvm) RUN(NAME format_73 LABELS gfortran llvm) RUN(NAME format_74 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_75 LABELS gfortran llvm) RUN(NAME format_76 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_77 LABELS gfortran llvm) RUN(NAME format_78 LABELS gfortran llvm) RUN(NAME format_79 LABELS gfortran llvm) RUN(NAME format_80 LABELS gfortran llvm) RUN(NAME format_81 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_82 LABELS gfortran llvm) RUN(NAME format_83 LABELS gfortran llvm) RUN(NAME format_84 LABELS gfortran llvm) RUN(NAME format_85 LABELS gfortran llvm) RUN(NAME format_86 LABELS gfortran llvm) RUN(NAME submodule_01 LABELS gfortran) RUN(NAME submodule_02 LABELS gfortran fortran) RUN(NAME submodule_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_16 LABELS gfortran llvm) RUN(NAME submodule_17 LABELS gfortran llvm) RUN(NAME submodule_18a LABELS gfortran llvm_submodule EXTRAFILES submodule_18b.f90 submodule_18c.f90) RUN(NAME submodule_19a LABELS gfortran llvm_submodule EXTRAFILES submodule_19b.f90 submodule_19c.f90) RUN(NAME submodule_20a LABELS gfortran llvm_submodule EXTRAFILES submodule_20b.f90 submodule_20c.f90) RUN(NAME submodule_21a LABELS gfortran llvm_submodule EXTRAFILES submodule_21b.f90 submodule_21c.f90) RUN(NAME submodule_22 LABELS gfortran llvm) RUN(NAME submodule_23a LABELS gfortran llvm_submodule EXTRAFILES submodule_23b.f90 submodule_23c.f90) RUN(NAME submodule_24 LABELS gfortran llvm) RUN(NAME submodule_25a LABELS gfortran llvm_submodule EXTRAFILES submodule_25b.f90 submodule_25c.f90) RUN(NAME submodule_26 LABELS gfortran llvm) RUN(NAME submodule_27a LABELS gfortran llvm_submodule EXTRAFILES submodule_27b.f90 submodule_27c.f90) RUN(NAME submodule_28 LABELS gfortran llvm) RUN(NAME submodule_29a LABELS gfortran llvm_submodule EXTRAFILES submodule_29b.f90 submodule_29c.f90 submodule_29d.f90) RUN(NAME submodule_30a LABELS gfortran llvm_submodule EXTRAFILES submodule_30b.f90 submodule_30c.f90 submodule_30d.f90) RUN(NAME submodule_31 LABELS gfortran llvm) RUN(NAME submodule_32 LABELS gfortran llvm) RUN(NAME submodule_33 LABELS gfortran llvm) RUN(NAME submodule_34a LABELS gfortran llvm_submodule EXTRAFILES submodule_34b.f90) RUN(NAME submodule_35 LABELS gfortran llvm) # submodule function via interface RUN(NAME submodule_36 LABELS gfortran llvm) RUN(NAME submodule_37a LABELS gfortran llvm_submodule EXTRAFILES submodule_37b.f90 submodule_37c.f90 submodule_37d.f90 EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME submodule_38a LABELS gfortran llvm_submodule EXTRAFILES submodule_38b.f90 submodule_38c.f90 EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME submodule_39a LABELS gfortran llvm_submodule EXTRAFILES submodule_39b.f90 submodule_39c.f90 EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME submodule_40a LABELS gfortran llvm_submodule EXTRAFILES submodule_40b.f90 submodule_40c.f90 EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME submodule_41 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME submodule_42 LABELS gfortran llvm) RUN(NAME submodule_43 LABELS gfortran llvm) RUN(NAME submodule_44a LABELS gfortran llvm_submodule EXTRAFILES submodule_44b.f90) RUN(NAME c_sizeof_02 LABELS gfortran llvm) RUN(NAME c_sizeof_03 LABELS gfortran llvm) RUN(NAME c_sizeof_04 LABELS gfortran llvm) RUN(NAME c_sizeof_05 LABELS gfortran llvm) RUN(NAME c_sizeof_06 LABELS gfortran llvm) RUN(NAME sizeof_01 LABELS gfortran llvm) RUN(NAME iso_c_binding_04 LABELS gfortran llvm) RUN(NAME submodule_45 LABELS gfortran llvm) RUN(NAME submodule_46 LABELS gfortran llvm) RUN(NAME submodule_47 LABELS gfortran llvm) RUN(NAME submodule_48 LABELS gfortran llvm) RUN(NAME submodule_49 LABELS gfortran llvm) RUN(NAME submodule_50a LABELS gfortran llvm_submodule EXTRAFILES submodule_50b.f90 submodule_50c.f90) RUN(NAME submodule_51a LABELS gfortran llvm_submodule EXTRAFILES submodule_51b.f90) RUN(NAME submodule_52 LABELS gfortran llvm) RUN(NAME procedure_pointer_12 LABELS gfortran llvm) RUN(NAME procedure_pointer_13 LABELS gfortran llvm) RUN(NAME procedure_pointer_14 LABELS gfortran llvm) RUN(NAME procedure_pointer_15 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME procedure_pointer_16 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME procedure_pointer_17 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME procedure_pointer_18 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME procedure_pointer_19 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME procedure_pointer_20 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME procedure_pointer_21 LABELS gfortran llvm) RUN(NAME procedure_pointer_22 LABELS gfortran llvm) RUN(NAME procedure_pointer_23 LABELS gfortran llvm) RUN(NAME procedure_pointer_24 LABELS gfortran llvm) RUN(NAME bindc_assumed_rank_01 LABELS gfortran llvm) RUN(NAME floor_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # floor body RUN(NAME floor_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # floor symboltable RUN(NAME floor_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME modulo_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME modulo_02 LABELS gfortran llvm) RUN(NAME int_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # int body RUN(NAME int_02 LABELS gfortran wasm fortran) # int symboltable RUN(NAME int_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # large int and prints array RUN(NAME intrinsics_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sqrt, abs, log RUN(NAME intrinsics_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sin RUN(NAME intrinsics_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cos RUN(NAME intrinsics_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # tan RUN(NAME intrinsics_04s LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ctan RUN(NAME intrinsics_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # hyperbolics RUN(NAME intrinsics_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # inverse trignometric RUN(NAME intrinsics_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # kind RUN(NAME intrinsics_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # tiny symboltable RUN(NAME intrinsics_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # tiny body RUN(NAME intrinsics_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # real body RUN(NAME intrinsics_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # real symboltable RUN(NAME intrinsics_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # kind body RUN(NAME intrinsics_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # kind symboltable RUN(NAME intrinsics_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # selected_real,int_kind body RUN(NAME intrinsics_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # real RUN(NAME intrinsics_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # aimag RUN(NAME intrinsics_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # exp, log, erf RUN(NAME intrinsics_17b LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) # log RUN(NAME intrinsics_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # trig RUN(NAME intrinsics_18c LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # trig RUN(NAME intrinsics_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # multiple intrinsics RUN(NAME intrinsics_19c LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # exp, log, sqrt RUN(NAME intrinsics_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # trig RUN(NAME intrinsics_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # modulo and mod RUN(NAME intrinsics_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # min, max RUN(NAME intrinsics_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # huge RUN(NAME intrinsics_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # System_clock RUN(NAME intrinsics_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ishft RUN(NAME intrinsics_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # btest RUN(NAME intrinsics_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # shape RUN(NAME intrinsics_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # min, max RUN(NAME intrinsics_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # random_number RUN(NAME intrinsics_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # range RUN(NAME intrinsics_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # ceiling RUN(NAME intrinsics_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # merge RUN(NAME intrinsics_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # new_line RUN(NAME intrinsics_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) # epsilon refer: #5222 RUN(NAME intrinsics_35 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # any RUN(NAME intrinsics_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # adjustl RUN(NAME intrinsics_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # merge RUN(NAME intrinsics_38 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # adjustr RUN(NAME intrinsics_39 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # date_and_time RUN(NAME intrinsics_40 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # aint, anint RUN(NAME intrinsics_41 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # command_argument_count RUN(NAME intrinsics_42 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # hypot RUN(NAME intrinsics_43 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dim RUN(NAME intrinsics_44 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # cshift RUN(NAME intrinsics_45 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # iso_fortran_env RUN(NAME intrinsics_46 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # ichar & iachar RUN(NAME intrinsics_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # all RUN(NAME intrinsics_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # log_gamma RUN(NAME intrinsics_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # cmplx, sin RUN(NAME intrinsics_50 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intrinsics_51 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) #trig RUN(NAME intrinsics_52 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # max0, min0 RUN(NAME intrinsics_53 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # repeat RUN(NAME intrinsics_54 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # max0 RUN(NAME intrinsics_open_close_read_write LABELS gfortran llvm) RUN(NAME intrinsics_55 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) #min RUN(NAME intrinsics_56 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # merge RUN(NAME intrinsics_57 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # merge RUN(NAME intrinsics_58 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sign RUN(NAME intrinsics_59 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sign RUN(NAME intrinsics_60 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN intrinsics_60_data.txt) # iachar for extended ascii RUN(NAME intrinsics_61 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # char RUN(NAME intrinsics_62 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # shape RUN(NAME intrinsics_63 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # any RUN(NAME intrinsics_64 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # sign RUN(NAME intrinsics_65 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # matmul RUN(NAME intrinsics_66 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sign RUN(NAME intrinsics_67 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dcosh, dsinh, dtanh, dtan RUN(NAME intrinsics_68 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dsign RUN(NAME intrinsics_69 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # radix RUN(NAME intrinsics_70 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # aint RUN(NAME intrinsics_71 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # matmul RUN(NAME intrinsics_72 LABELS gfortran llvmImplicit) # datan2 RUN(NAME intrinsics_73 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sngl RUN(NAME intrinsics_74 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) # random_number RUN(NAME intrinsics_75 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # exp RUN(NAME intrinsics_76 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # exp RUN(NAME intrinsics_77 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # maxval RUN(NAME intrinsics_78 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # mod RUN(NAME intrinsics_79 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # Trailz RUN(NAME intrinsics_80 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sum RUN(NAME intrinsics_81 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # maxval RUN(NAME intrinsics_82 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # array support tan, cosh, sinh, tanh RUN(NAME intrinsics_83 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # kind RUN(NAME intrinsics_84 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # minexponent RUN(NAME intrinsics_85 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # maxexponent RUN(NAME intrinsics_86 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # kind RUN(NAME intrinsics_87 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # abs RUN(NAME intrinsics_88 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # min for strings RUN(NAME intrinsics_89 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sin RUN(NAME intrinsics_90 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # min RUN(NAME intrinsics_91 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # index RUN(NAME intrinsics_92 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # anint RUN(NAME intrinsics_93 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # digits RUN(NAME intrinsics_94 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # hypot RUN(NAME intrinsics_95 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sign RUN(NAME intrinsics_96 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # char RUN(NAME intrinsics_97 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # tiny RUN(NAME intrinsics_98 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # shape RUN(NAME intrinsics_99 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # size RUN(NAME intrinsics_100 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # mod RUN(NAME intrinsics_101 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # repeat RUN(NAME intrinsics_102 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sin RUN(NAME intrinsics_103 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # char RUN(NAME intrinsics_104 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm fortran) RUN(NAME intrinsics_105 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # shape RUN(NAME intrinsics_106 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # merge RUN(NAME intrinsics_107 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # trailz RUN(NAME intrinsics_108 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # shiftr RUN(NAME intrinsics_109 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # reshape, matmul RUN(NAME intrinsics_110 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # min0 RUN(NAME intrinsics_111 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # min RUN(NAME intrinsics_112 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # max0 RUN(NAME intrinsics_113 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sign RUN(NAME intrinsics_114 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # aint RUN(NAME intrinsics_115 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # anint RUN(NAME intrinsics_116 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # atan2 RUN(NAME intrinsics_117 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # mod RUN(NAME intrinsics_118 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # hypot RUN(NAME intrinsics_119 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sum RUN(NAME intrinsics_120 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # product RUN(NAME intrinsics_121 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # leadz RUN(NAME intrinsics_122 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # rank RUN(NAME intrinsics_123 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # shiftl RUN(NAME intrinsics_124 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # lshift RUN(NAME intrinsics_125 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # random_number RUN(NAME intrinsics_126 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # random_number RUN(NAME intrinsics_127 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ifix RUN(NAME intrinsics_128 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # idint RUN(NAME intrinsics_129 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # abs RUN(NAME intrinsics_130 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ishft RUN(NAME intrinsics_131 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # max for strings RUN(NAME intrinsics_132 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # Floor RUN(NAME intrinsics_133 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # Ceiling RUN(NAME intrinsics_134 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # Adjustl RUN(NAME intrinsics_135 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # nint RUN(NAME intrinsics_136 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # rshift RUN(NAME intrinsics_137 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # huge RUN(NAME intrinsics_138 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # precision RUN(NAME intrinsics_139 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # modulo RUN(NAME intrinsics_140 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # selected_int_kind RUN(NAME intrinsics_141 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # scale RUN(NAME intrinsics_142 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dot_product RUN(NAME intrinsics_143 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dot_product RUN(NAME intrinsics_144 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dot_product RUN(NAME intrinsics_145 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dot_product RUN(NAME intrinsics_146 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dprod RUN(NAME intrinsics_147 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # pack RUN(NAME intrinsics_148 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # pack RUN(NAME intrinsics_149 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran NO_FAST_MATH) # unpack RUN(NAME intrinsics_150 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # maskr RUN(NAME intrinsics_151 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # maskl RUN(NAME intrinsics_152 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # selected_real_kind RUN(NAME intrinsics_153 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dim RUN(NAME intrinsics_154 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # mod RUN(NAME intrinsics_155 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # bgt RUN(NAME intrinsics_156 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # blt RUN(NAME intrinsics_157 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ble RUN(NAME intrinsics_158 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # bge RUN(NAME intrinsics_159 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # matmul RUN(NAME intrinsics_160 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ior RUN(NAME intrinsics_161 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ieor RUN(NAME intrinsics_162 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # Not RUN(NAME intrinsics_163 LABELS gfortran llvm fortran) # ishftc RUN(NAME intrinsics_164 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # iand RUN(NAME intrinsics_165 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # sum RUN(NAME intrinsics_166 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ibset RUN(NAME intrinsics_167 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # btest RUN(NAME intrinsics_168 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ibclr RUN(NAME intrinsics_169 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # mod RUN(NAME intrinsics_170 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # exponent RUN(NAME intrinsics_171 LABELS llvm llvm_wasm llvm_wasm_emcc) # tolowercase RUN(NAME intrinsics_172 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # count RUN(NAME intrinsics_173 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # fraction RUN(NAME intrinsics_174 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # shape RUN(NAME intrinsics_175 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # pack RUN(NAME intrinsics_176 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # set_exponent RUN(NAME intrinsics_177 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # adjustr RUN(NAME intrinsics_178 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # rrspacing RUN(NAME intrinsics_179 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sum RUN(NAME intrinsics_180 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # scan RUN(NAME intrinsics_181 LABELS gfortran llvm fortran) # repeat RUN(NAME intrinsics_182 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dshiftl RUN(NAME intrinsics_183 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ibits RUN(NAME intrinsics_184 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # selected_char_kind RUN(NAME intrinsics_185 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # verify RUN(NAME intrinsics_186 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # verify RUN(NAME intrinsics_187 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # popcnt RUN(NAME intrinsics_188 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # lgt, lge, lle, llt RUN(NAME intrinsics_189 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # scan RUN(NAME intrinsics_190 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # kind RUN(NAME intrinsics_191 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # kind RUN(NAME intrinsics_192 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # bessel_j0 RUN(NAME intrinsics_193 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # poppar RUN(NAME intrinsics_194 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # min RUN(NAME intrinsics_195 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # max RUN(NAME intrinsics_196 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # bessel_j1 RUN(NAME intrinsics_197 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # bessel_y0 RUN(NAME intrinsics_198 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sum RUN(NAME intrinsics_199 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # count RUN(NAME intrinsics_200 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --realloc-lhs-arrays) # pack RUN(NAME intrinsics_201 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # any RUN(NAME intrinsics_202 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) #parameter RUN(NAME intrinsics_203 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # asind RUN(NAME intrinsics_204 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # bessel_y1 RUN(NAME intrinsics_205 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # acosd RUN(NAME intrinsics_206 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # poppar RUN(NAME intrinsics_207 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # double precision intrinsics RUN(NAME intrinsics_208 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # bit_size RUN(NAME intrinsics_209 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # atand RUN(NAME intrinsics_210 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES lcompilers_test_module.f90) # bessel_jn RUN(NAME intrinsics_211 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # bessel_yn RUN(NAME intrinsics_212 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # specific type intrinsics RUN(NAME intrinsics_213 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # cpu_time RUN(NAME intrinsics_214 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # sind RUN(NAME intrinsics_215 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # cosd RUN(NAME intrinsics_216 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # tand RUN(NAME intrinsics_217 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # all RUN(NAME intrinsics_218 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # new_line RUN(NAME intrinsics_219 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) #parameter, sum RUN(NAME intrinsics_220 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # merge_bits RUN(NAME intrinsics_221 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sum RUN(NAME intrinsics_222 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dreal RUN(NAME intrinsics_223 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # nearest RUN(NAME intrinsics_224 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # spacing RUN(NAME intrinsics_225 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # iany RUN(NAME intrinsics_226 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # iall RUN(NAME intrinsics_227 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # norm2 RUN(NAME intrinsics_228 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # derf RUN(NAME intrinsics_229 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # derfc RUN(NAME intrinsics_230 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # bessel RUN(NAME intrinsics_231 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dgamma RUN(NAME intrinsics_232 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # iparity RUN(NAME intrinsics_233 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # isnan RUN(NAME intrinsics_234 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # parity RUN(NAME intrinsics_235 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # lgamma algama dlgama RUN(NAME intrinsics_236 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # bit_size, huge RUN(NAME intrinsics_237 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sngl RUN(NAME intrinsics_238 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # maskl, idl RUN(NAME intrinsics_239 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # erfc_scaled RUN(NAME intrinsics_240 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dshiftr RUN(NAME intrinsics_241 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # logical RUN(NAME intrinsics_242 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # nint RUN(NAME intrinsics_243 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # sqrt, abs, log (all kind of real) RUN(NAME intrinsics_244 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cshift RUN(NAME intrinsics_245 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cmplx RUN(NAME intrinsics_246 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # adjustl RUN(NAME intrinsics_247 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # adjustr RUN(NAME intrinsics_248 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # eoshift RUN(NAME intrinsics_249 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # nested_sum RUN(NAME intrinsics_250 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sum RUN(NAME intrinsics_251 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # erf RUN(NAME intrinsics_252 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # derf RUN(NAME intrinsics_253 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # erfc RUN(NAME intrinsics_254 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # derfc RUN(NAME intrinsics_255 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dbesjn, dbesyn RUN(NAME intrinsics_256 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # minval RUN(NAME intrinsics_257 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran NO_FAST_MATH) # product RUN(NAME intrinsics_product_nodes_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # product RUN(NAME intrinsics_258 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # abs RUN(NAME intrinsics_259 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # lgt, llt, lge, lle RUN(NAME intrinsics_260 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran NO_FAST_MATH) # sum RUN(NAME intrinsics_261 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ceiling RUN(NAME intrinsics_262 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # floor RUN(NAME intrinsics_263 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # maxval RUN(NAME intrinsics_264 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # sin RUN(NAME intrinsics_265 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # cos RUN(NAME intrinsics_266 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # tan RUN(NAME intrinsics_267 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dsin, dcos, dtan RUN(NAME intrinsics_268 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # asin RUN(NAME intrinsics_269 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # acos RUN(NAME intrinsics_270 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # atan RUN(NAME intrinsics_271 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # leadz RUN(NAME intrinsics_272 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # trailz RUN(NAME intrinsics_273 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dprod RUN(NAME intrinsics_274 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # epsilon refer: #5222 RUN(NAME intrinsics_275 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # and RUN(NAME intrinsics_276 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # or RUN(NAME intrinsics_277 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # xor RUN(NAME intrinsics_278 LABELS gfortran llvm fortran) # tiny RUN(NAME intrinsics_279 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # sinh RUN(NAME intrinsics_280 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # cosh RUN(NAME intrinsics_281 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # tanh RUN(NAME intrinsics_282 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # hypot RUN(NAME intrinsics_283 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # asinh RUN(NAME intrinsics_284 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # acosh RUN(NAME intrinsics_285 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # real RUN(NAME intrinsics_286 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # atanh RUN(NAME intrinsics_288 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # spread RUN(NAME intrinsics_289 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # ishftc RUN(NAME intrinsics_290 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # log10 RUN(NAME intrinsics_291 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # gamma RUN(NAME intrinsics_292 LABELS gfortran llvm fortran) # command_argument_count RUN(NAME intrinsics_293 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dgamma RUN(NAME intrinsics_294 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # log_gamma RUN(NAME intrinsics_295 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # exp RUN(NAME intrinsics_296 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # storage_size RUN(NAME intrinsics_297 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # poppar RUN(NAME intrinsics_298 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dot_product RUN(NAME intrinsics_299 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # command_argument_count RUN(NAME intrinsics_300 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # kind RUN(NAME intrinsics_301 LABELS llvm llvm_wasm llvm_wasm_emcc) # findloc RUN(NAME intrinsics_302 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # is_contiguous RUN(NAME intrinsics_303 LABELS gfortran llvm) # random_seed RUN(NAME intrinsics_304 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sign RUN(NAME intrinsics_305 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # realpart RUN(NAME intrinsics_306 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # imagpart RUN(NAME intrinsics_307 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # imag RUN(NAME intrinsics_308 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dgamma RUN(NAME intrinsics_309 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # pack RUN(NAME intrinsics_310 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # digits RUN(NAME intrinsics_311 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) # minloc RUN(NAME intrinsics_312 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # minloc RUN(NAME intrinsics_313 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # maxloc RUN(NAME intrinsics_314 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dshift RUN(NAME intrinsics_315 LABELS llvm llvm_wasm llvm_wasm_emcc) # out_of_range RUN(NAME intrinsics_316 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # max, min RUN(NAME intrinsics_317 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # get_command_argument RUN(NAME intrinsics_318 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # cpu_time RUN(NAME intrinsics_319 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # system_clock RUN(NAME intrinsics_320 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # len_trim RUN(NAME intrinsics_321 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # trim RUN(NAME intrinsics_322 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # index RUN(NAME intrinsics_323 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dot_product RUN(NAME intrinsics_324 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # max RUN(NAME intrinsics_325 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # spread RUN(NAME intrinsics_326 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # minloc RUN(NAME intrinsics_327 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # transpose RUN(NAME intrinsics_328 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intrinsics_329 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # idnint RUN(NAME intrinsics_330 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) #amax0, max1 RUN(NAME intrinsics_331 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cshift RUN(NAME intrinsics_332 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME intrinsics_333 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME intrinsics_334 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # move_alloc RUN(NAME move_alloc_pointer_alias LABELS gfortran llvm) RUN(NAME intrinsics_335 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) #kind, real RUN(NAME intrinsics_336 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) #any RUN(NAME intrinsics_337 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dble, dfloat, float, shifta RUN(NAME intrinsics_338 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # compiler_options RUN(NAME intrinsics_339 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # minloc RUN(NAME intrinsics_340 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # leadz RUN(NAME intrinsics_341 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # trailz RUN(NAME intrinsics_342 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # spread RUN(NAME intrinsics_343 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cshift RUN(NAME intrinsics_344 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # maskl RUN(NAME intrinsics_345 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # findloc RUN(NAME intrinsics_346 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # iachar RUN(NAME intrinsics_347 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # reshape RUN(NAME intrinsics_348 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # reshape RUN(NAME intrinsics_349 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # pack RUN(NAME intrinsics_350 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # spread RUN(NAME intrinsics_351 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran NO_FAST_MATH) # spread RUN(NAME intrinsics_352 LABELS gfortran llvm) # random_seed RUN(NAME intrinsics_353 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # random_number RUN(NAME intrinsics_354 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # minval RUN(NAME intrinsics_355 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # system_clock RUN(NAME intrinsics_356 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME intrinsics_357 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME intrinsics_358 LABELS gfortran llvm) # getseed RUN(NAME intrinsics_359 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # pack RUN(NAME intrinsics_360 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # findloc RUN(NAME intrinsics_361 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME intrinsics_362 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # is_contiguous RUN(NAME intrinsics_363 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cshift RUN(NAME intrinsics_364 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cshift RUN(NAME intrinsics_365 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # is_contiguous RUN(NAME intrinsics_366 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # shiftl, shiftr, trailz, btest, ibclr RUN(NAME intrinsics_367 LABELS gfortran llvm) # get_environment_variable RUN(NAME intrinsics_368 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # kind RUN(NAME intrinsics_369 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intrinsics_370 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # findloc RUN(NAME intrinsics_371 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # findloc RUN(NAME intrinsics_372 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cmplx RUN(NAME intrinsics_373 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intrinsics_374 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intrinsics_375 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # move_alloc for string RUN(NAME intrinsics_376 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # present RUN(NAME intrinsics_377 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # minval, maxval RUN(NAME intrinsics_378 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # move_alloc RUN(NAME intrinsics_379 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # get_command_argument RUN(NAME intrinsics_380 LABELS gfortran llvm) # get_environment_variable RUN(NAME intrinsics_381 LABELS gfortran llvm) # get_environment_variable RUN(NAME intrinsics_382 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # pack RUN(NAME intrinsics_383 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # pack RUN(NAME intrinsics_384 LABELS gfortran llvm fortran) # eoshift RUN(NAME intrinsics_385 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # nearest RUN(NAME intrinsics_386 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # product RUN(NAME intrinsics_387 LABELS gfortran llvm) # execute_command_line RUN(NAME intrinsics_388 LABELS gfortran llvm) # execute_command_line RUN(NAME intrinsics_389 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # loc RUN(NAME intrinsics_390 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # c_f_ptr RUN(NAME intrinsics_391 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # sum, selected_real_kind, minloc, merge RUN(NAME intrinsics_392 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # present RUN(NAME intrinsics_393 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cmplx RUN(NAME intrinsics_394 LABELS gfortran llvm) # execute_command_line RUN(NAME intrinsics_395 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cmplx kind cast regression RUN(NAME intrinsics_396 LABELS gfortran llvm) RUN(NAME intrinsics_397 LABELS llvm llvm_wasm llvm_wasm_emcc) # selected_logical_kind RUN(NAME intrinsics_398 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # findloc RUN(NAME intrinsics_399 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # intrinsic impure subroutine RUN(NAME intrinsics_400 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # compiler_options RUN(NAME intrinsics_401 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # minloc RUN(NAME intrinsics_402 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # intrinsic statement with procedure argument RUN(NAME intrinsics_403 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # min1, max1 RUN(NAME intrinsics_404 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intrinsics_405 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intrinsics_406 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # iachar with array arguments RUN(NAME intrinsics_407 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # complex abs() overflow RUN(NAME intrinsics_408 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # complex abs() underflow RUN(NAME intrinsics_409 LABELS gfortran llvm) # execute_command_line with file flush RUN(NAME intrinsics_410 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) # maxloc/minloc/shape with -fdefault-integer-8 RUN(NAME intrinsics_411 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # iachar with transfer of assumed-length strings RUN(NAME intrinsics_412 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intrinsics_413 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # iachar(char(0)) RUN(NAME intrinsics_414 LABELS gfortran llvm) # system RUN(NAME intrinsics_415 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # sum/product with scalar mask = .true. RUN(NAME intrinsics_416 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) # string concat RUN(NAME intrinsics_417 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # sleep RUN(NAME intrinsics_418 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME intrinsics_419 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # maxval/minval with dim on pointer arrays RUN(NAME intrinsics_420 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dble/float with array constructor RUN(NAME intrinsics_421 LABELS gfortran llvm) # execute_command_line cmdstat/cmdmsg RUN(NAME intrinsics_422 LABELS llvm llvm_wasm llvm_wasm_emcc) # this_image RUN(NAME intrinsics_423 LABELS llvm llvm_wasm llvm_wasm_emcc) # num_images RUN(NAME intrinsics_424 LABELS llvm llvm_wasm llvm_wasm_emcc) # co_sum RUN(NAME intrinsics_425 LABELS llvm llvm_wasm llvm_wasm_emcc) # co_sum with optional args RUN(NAME intrinsics_426 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # count(mask, dim) with variable dim RUN(NAME intrinsics_427 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # maxval with derived-type component in declaration RUN(NAME intrinsics_428 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) # merge array mask in loop RUN(NAME intrinsics_429 LABELS gfortran llvm) # random_seed put resets RNG RUN(NAME intrinsics_430 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # is_contiguous with struct component sections RUN(NAME intrinsics_431 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) #char RUN(NAME intrinsics_432 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # nested bitwise intrinsics with value args RUN(NAME intrinsics_433 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intrinsics_434 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # selected_int_kind RUN(NAME intrinsics_435 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # minloc/maxloc with dim and array mask RUN(NAME intrinsics_436 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # rand RUN(NAME intrinsics_437 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # norm2 with dim argument RUN(NAME intrinsics_438 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # norm2 with variable dim argument RUN(NAME intrinsics_439 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # minval/maxval for strings RUN(NAME intrinsics_440 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # atan2d RUN(NAME intrinsics_441 LABELS llvm llvm_wasm llvm_wasm_emcc) # sinpi/cospi/tanpi/asinpi/acospi/atanpi/atan2pi <--- GFortran does not have support for these intrinsics RUN(NAME intrinsics_442 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # ascii kind string literal (ascii_"...") RUN(NAME intrinsics_443 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # char with kind RUN(NAME intrinsics_444 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # anint parameter array RUN(NAME intrinsics_445 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # log_gamma RUN(NAME intrinsics_446 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # spread RUN(NAME intrinsics_447 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sngl RUN(NAME intrinsics_448 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # achar RUN(NAME intrinsics_449 LABELS gfortran llvm) # storage_size with c_ptr RUN(NAME intrinsics_450 LABELS llvm) # storage_size struct alignment RUN(NAME intrinsics_451 LABELS gfortran llvm) # findloc with character ExpressionLength RUN(NAME intrinsics_452 LABELS gfortran llvm) # findloc with Pointer-wrapped ExpressionLength RUN(NAME intrinsics_453 LABELS gfortran llvm) # Lgt intrinsic as while loop condition RUN(NAME la_constants LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # LAPACK constants RUN(NAME integer_boz_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_dshiftr LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME passing_array_01 LABELS gfortran fortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME passing_array_02 LABELS gfortran fortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME passing_array_03 LABELS gfortran fortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME passing_array_04 LABELS gfortran fortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME passing_array_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME parameter_01 LABELS gfortran llvm) RUN(NAME parameter_02 LABELS gfortran llvm) RUN(NAME parameter_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) #kind RUN(NAME parameter_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # selected_real,int_kind symboltable RUN(NAME parameter_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # Implicit IntegerToReal RUN(NAME parameter_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cmplx RUN(NAME parameter_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME parameter_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME parameter_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME parameter_10 LABELS gfortran llvm fortran) # sin RUN(NAME parameter_11 LABELS gfortran llvm fortran) # merge RUN(NAME parameter_12 LABELS gfortran llvm fortran) # implied do loops RUN(NAME parameter_13 LABELS gfortran llvm) # compile time example RUN(NAME parameter_14 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME parameter_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME parameter_16 LABELS gfortran llvm) RUN(NAME fortuno_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran mlir) RUN(NAME modules_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME modules_03 LABELS gfortran llvm) RUN(NAME modules_04 LABELS gfortran llvm) RUN(NAME modules_05 LABELS gfortran llvm) RUN(NAME modules_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME modules_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_07_module.f90) RUN(NAME modules_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_22_module.f90) RUN(NAME modules_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_23_module.f90) RUN(NAME modules_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_08_a.f90 modules_08_b.f90) RUN(NAME modules_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_09_b.f90 modules_09_a.f90) RUN(NAME modules_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME modules_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_12 LABELS gfortran llvm) RUN(NAME modules_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME modules_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_14_a.f90) RUN(NAME modules_15 LABELS gfortran llvm EXTRAFILES modules_15b.f90 modules_15c.c NOFAST_TILL_LLVM16) RUN(NAME modules_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_16b.f90) RUN(NAME modules_18 LABELS gfortran llvm EXTRAFILES modules_18b.f90 modules_18c.c) RUN(NAME modules_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_19b.f90) RUN(NAME modules_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_20b.f90) RUN(NAME modules_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_21b.f90) RUN(NAME modules_24 LABELS gfortran llvm) RUN(NAME modules_25 LABELS gfortran EXTRAFILES modules_25_module.f90 modules_25_module1.f90) RUN(NAME modules_27 LABELS gfortran EXTRAFILES modules_27_module1.f90 modules_27_module2.f90) RUN(NAME modules_28 LABELS gfortran EXTRAFILES modules_28_module1.f90 modules_28_module2.f90) RUN(NAME modules_29 LABELS gfortran EXTRAFILES modules_29_module1.f90 modules_29_module2.f90 modules_29_module3.f90) RUN(NAME modules_30 LABELS gfortran EXTRAFILES modules_30_module1.f90 modules_30_module2.f90 modules_30_module3.f90 modules_30_module4.f90) RUN(NAME modules_31 LABELS gfortran EXTRAFILES modules_31_module1.f90 modules_31_module2.f90) RUN(NAME modules_32 LABELS gfortran llvm) RUN(NAME modules_33 LABELS gfortran EXTRAFILES modules_33_module1.f90 modules_33_module2.f90 modules_33_module3.f90) RUN(NAME modules_34 LABELS gfortran EXTRAFILES modules_34_module1a.f90 modules_34_module1.f90 modules_34_module2.f90 modules_34_module3.f90) RUN(NAME modules_35 LABELS gfortran) RUN(NAME modules_36 LABELS gfortran) RUN(NAME modules_37 LABELS gfortran llvm) RUN(NAME modules_38 LABELS gfortran llvm) RUN(NAME modules_39 LABELS gfortran EXTRAFILES modules_39_module.f90) RUN(NAME modules_44 LABELS gfortran EXTRAFILES modules_44_module.f90) RUN(NAME modules_40 LABELS gfortran llvm) RUN(NAME modules_41 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_42 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_43 LABELS gfortran) RUN(NAME modules_45 LABELS gfortran) RUN(NAME modules_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_STD_F23) RUN(NAME modules_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_50 LABELS gfortran llvm) RUN(NAME modules_51 LABELS gfortran llvmImplicit) RUN(NAME modules_53 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_54 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_55 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_56 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_57 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_58 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_58_module.f90) RUN(NAME modules_59 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_60 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_61 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_62 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_62_terminal.f90 modules_62_parser.f90) RUN(NAME modules_63 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_63_module.f90) RUN(NAME modules_64 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_65 LABELS gfortran llvm EXTRAFILES modules_65_base.f90 modules_65_child.f90 modules_65_worker.f90) RUN(NAME modules_66 LABELS gfortran llvm EXTRAFILES modules_66_base.f90 modules_66_worker.f90) RUN(NAME modules_67 LABELS gfortran llvm EXTRAFILES modules_67_origin.f90 modules_67_reexport.f90 modules_67_consumer.f90) RUN(NAME modules_68 LABELS gfortran llvm) RUN(NAME modules_69 LABELS gfortran llvm) RUN(NAME modules_70 LABELS gfortran llvm) RUN(NAME modules_71 LABELS gfortran llvm) RUN(NAME modules_72 LABELS gfortran llvm EXTRAFILES modules_72_stypemod.f90 modules_72_otypemod.f90) RUN(NAME associate_06 LABELS gfortran EXTRAFILES associate_06_module.f90) RUN(NAME lfortran_intrinsic_sin LABELS gfortran llvm EXTRAFILES lfortran_intrinsic_sin_c.c) RUN(NAME bindc1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME bindc2 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME bindc3 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME bindc4 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME bindc5 LABELS gfortran llvm) RUN(NAME bindc6 LABELS gfortran llvm EXTRAFILES bindc6_sum.c) RUN(NAME bindc_01 LABELS gfortran llvm EXTRAFILES bindc_01b.f90 bindc_01c.c) RUN(NAME bindc_02 LABELS gfortran llvm EXTRAFILES bindc_02b.f90 bindc_02c.c) RUN(NAME bindc_03 LABELS gfortran llvm EXTRAFILES bindc_03c.c) RUN(NAME bindc_04 LABELS gfortran llvm EXTRAFILES bindc_04c.c) RUN(NAME bindc_05 LABELS gfortran llvm EXTRAFILES bindc_05c.c) RUN(NAME bindc_06 LABELS gfortran llvm EXTRAFILES bindc_06b.c) RUN(NAME bindc_07 LABELS gfortran llvm EXTRAFILES bindc_07.c) RUN(NAME bindc_08 LABELS gfortran llvm EXTRAFILES bindc_08.c EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME bindc_09 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME bindc_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME bindc_11 LABELS gfortran llvm) RUN(NAME bindc_12 LABELS gfortran llvm) RUN(NAME bindc_13 LABELS gfortran llvm) RUN(NAME bindc_14 LABELS gfortran llvm) RUN(NAME bindc_15 LABELS llvm) RUN(NAME bindc_16 LABELS gfortran llvm) RUN(NAME bindc_17 LABELS gfortran llvm EXTRAFILES bindc_17.c) RUN(NAME bindc_18 LABELS gfortran llvm) RUN(NAME bindc_19 LABELS gfortran llvm) RUN(NAME bindc_35 LABELS gfortran flang EXTRAFILES bindc_35c.c) RUN(NAME bindc_38 LABELS gfortran flang EXTRAFILES bindc_38c.c) RUN(NAME bindc_39 LABELS gfortran flang EXTRAFILES bindc_39c.c) RUN(NAME bindc_43 LABELS gfortran flang EXTRAFILES bindc_43c.c) RUN(NAME bindc_45 LABELS gfortran flang EXTRAFILES bindc_45c.c) RUN(NAME bindc_46 LABELS gfortran llvm) RUN(NAME bindc_47 LABELS gfortran llvm EXTRAFILES bindc_47c.c) RUN(NAME bindc_48 LABELS gfortran llvm EXTRAFILES bindc_48_mod.f90) RUN(NAME bindc_49 LABELS gfortran llvm) RUN(NAME bindc_50 LABELS gfortran llvm) RUN(NAME bindc_iso_fb_01 LABELS gfortran llvm flang EXTRAFILES bindc_iso_fb_01c.c) RUN(NAME bindc_iso_fb_02 LABELS gfortran llvm flang EXTRAFILES bindc_iso_fb_02c.c) RUN(NAME bindc_iso_fb_03 LABELS gfortran llvm flang EXTRAFILES bindc_iso_fb_03c.c) RUN(NAME bindc_iso_fb_04 LABELS flang llvm EXTRAFILES bindc_iso_fb_04c.c) RUN(NAME bindc_iso_fb_05 LABELS gfortran llvm EXTRAFILES bindc_iso_fb_05c.c) RUN(NAME bindc_iso_fb_06 LABELS gfortran llvm EXTRAFILES bindc_iso_fb_06c.c) RUN(NAME bindc_iso_fb_07 LABELS gfortran llvm EXTRAFILES bindc_iso_fb_07c.c) RUN(NAME bindc_iso_fb_08 LABELS gfortran llvm EXTRAFILES bindc_iso_fb_08c.c) RUN(NAME case_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp) RUN(NAME case_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME case_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp) RUN(NAME case_04 LABELS gfortran) RUN(NAME case_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp) RUN(NAME case_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp) RUN(NAME case_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME case_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME case_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_04 LABELS gfortran EXTRAFILES select_type_03_module.f90 select_type_03.f90) RUN(NAME select_type_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_STD_F23) RUN(NAME select_type_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST) RUN(NAME select_type_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME select_type_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME select_type_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_38 LABELS gfortran llvm) RUN(NAME select_type_39 LABELS gfortran llvm) RUN(NAME select_type_40 LABELS gfortran llvm) RUN(NAME select_type_41 LABELS gfortran llvm) RUN(NAME select_type_42 LABELS gfortran llvm) RUN(NAME select_type_43 LABELS gfortran llvm) RUN(NAME select_type_44 LABELS gfortran llvm) RUN(NAME select_type_45 LABELS gfortran llvm) RUN(NAME select_type_46 LABELS gfortran llvm) RUN(NAME select_type_47 LABELS gfortran llvm) RUN(NAME select_type_48 LABELS gfortran llvm) RUN(NAME select_type_49 LABELS gfortran llvm) RUN(NAME where_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME where_04 LABELS gfortran) # TODO: Fix this test #1631 RUN(NAME where_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME where_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME where_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_17 LABELS gfortran llvm) RUN(NAME forallloop_01 LABELS gfortran) RUN(NAME forall_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME forall_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --implicit-typing) RUN(NAME forall_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME forall_04 LABELS gfortran llvm) RUN(NAME parsing_01 LABELS gfortran) RUN(NAME parsing_02 LABELS gfortran) RUN(NAME parsing_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME interface_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME interface_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME interface_03 LABELS gfortran llvm) RUN(NAME interface_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME interface_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME interface_06 LABELS gfortran) RUN(NAME interface_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME interface_09 LABELS gfortran) RUN(NAME interface_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME interface_12a LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES interface_12b.f90) RUN(NAME interface_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME interface_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME interface_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME interface_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME interface_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME interface_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME interface_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME interface_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME interface_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME interface_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME interface_31 LABELS gfortran llvm) RUN(NAME interface_32 LABELS gfortran llvm EXTRAFILES interface_32_module.f90 EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_01 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_02 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_03 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_04 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_05 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_06 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_07 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_08 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_09 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_10 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_11 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_12 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_13 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_14 LABELS gfortran) # ! TODO: fix this test RUN(NAME implicit_interface_15 LABELS gfortran llvm2 EXTRA_ARGS --implicit-interface EXTRAFILES implicit_interface_15b.f90) RUN(NAME implicit_interface_16 LABELS gfortran llvm2 EXTRA_ARGS --implicit-interface EXTRAFILES implicit_interface_16b.f90) RUN(NAME implicit_interface_17 LABELS gfortran llvm2 EXTRA_ARGS --implicit-interface EXTRAFILES implicit_interface_17b.f90) RUN(NAME implicit_interface_18 LABELS gfortran llvmImplicit EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_19 LABELS gfortran llvm EXTRA_ARGS --implicit-typing --implicit-interface EXTRAFILES implicit_interface_19b.f90) RUN(NAME implicit_interface_20 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_21 LABELS gfortran llvm EXTRA_ARGS --implicit-interface --legacy-array-sections) RUN(NAME implicit_interface_22 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_23 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_24 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_25 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_26 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_27 LABELS gfortran llvm EXTRA_ARGS --implicit-interface EXTRAFILES implicit_interface_27b.f90) RUN(NAME implicit_interface_28 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_29 LABELS gfortran llvm EXTRA_ARGS --implicit-interface --separate-compilation EXTRAFILES implicit_interface_29b.f90) RUN(NAME implicit_interface_30 LABELS gfortran llvm EXTRA_ARGS --implicit-typing --implicit-interface) RUN(NAME implicit_interface_31 LABELS gfortran llvm EXTRA_ARGS --implicit-typing --implicit-interface) RUN(NAME implicit_interface_32 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_33 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_34 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_35 LABELS gfortran llvm EXTRA_ARGS --implicit-typing --implicit-interface) RUN(NAME implicit_interface_36 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_37 LABELS gfortran llvm EXTRA_ARGS --implicit-interface --legacy-array-sections) RUN(NAME implicit_typing_01 LABELS gfortran llvmImplicit) RUN(NAME implicit_typing_02 LABELS gfortran llvmImplicit) RUN(NAME implicit_typing_03 LABELS gfortran llvmImplicit) RUN(NAME implicit_typing_04 LABELS gfortran llvmImplicit EXTRA_ARGS --implicit-interface) RUN(NAME implicit_typing_05 LABELS gfortran llvm EXTRA_ARGS --implicit-typing) RUN(NAME implicit_typing_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --implicit-typing) RUN(NAME implicit_typing_07 LABELS gfortran llvm EXTRA_ARGS --implicit-typing) RUN(NAME implicit_typing_08 LABELS gfortran llvm EXTRA_ARGS --implicit-typing) RUN(NAME implicit_typing_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --implicit-typing --fixed-form GFORTRAN_ARGS -ffixed-form) RUN(NAME generic_name_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME generic_name_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME generic_name_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME generic_name_04 LABELS gfortran llvm) RUN(NAME generic_name_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME generic_name_06 LABELS gfortran llvm) RUN(NAME generic_name_07 LABELS gfortran llvm) RUN(NAME generic_name_08 LABELS gfortran llvm) RUN(NAME operator_overloading_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_04 LABELS gfortran llvm) RUN(NAME operator_overloading_05_module3 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES operator_overloading_05_module1.f90 operator_overloading_05_module2.f90) RUN(NAME operator_overloading_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_34 LABELS gfortran llvm EXTRAFILES operator_overloading_34_mod.f90) RUN(NAME operator_overloading_35 LABELS gfortran llvm EXTRAFILES operator_overloading_35_mod.f90) RUN(NAME operator_overloading_36 LABELS gfortran llvm_submodule EXTRAFILES operator_overloading_36_mod_base.f90 operator_overloading_36_mod_base_sub.f90) RUN(NAME custom_unary_operator_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_unary_operator_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME custom_operator_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_14 LABELS gfortran llvm) RUN(NAME custom_operator_15 LABELS gfortran llvm) RUN(NAME custom_operator_16 LABELS gfortran llvm) RUN(NAME custom_operator_17 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME custom_operator_18 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME custom_operator_19 LABELS gfortran llvm) RUN(NAME types_07 LABELS gfortran) RUN(NAME types_08 LABELS gfortran) RUN(NAME types_09 LABELS gfortran llvm) RUN(NAME types_10 LABELS gfortran llvm) RUN(NAME types_11 LABELS gfortran llvm) RUN(NAME types_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME types_13 LABELS gfortran) RUN(NAME types_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME types_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME types_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME types_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME types_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME complex_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME complex_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME complex_03 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME complex_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME complex_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME complex_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME complex_07 LABELS gfortran llvm) # cmplx RUN(NAME complex_08 LABELS gfortran llvm fortran) # conjg RUN(NAME complex_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cmplx RUN(NAME complex_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # conjg RUN(NAME complex_11 LABELS gfortran llvmImplicit wasm fortran) RUN(NAME complex_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME complex_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME complex_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME complex_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME complex_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME complex_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME complex_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME complex_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME complex_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME complex_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME complex_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME complex_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME complex_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME complex_35 LABELS gfortran llvm) RUN(NAME complex_36 LABELS gfortran llvm) RUN(NAME complex_array_member_access LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_implicit_cast LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME complex_sub_test LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME complex_mul_test LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME complex_div_test LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_pow_test LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_unary_minus_03 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME dcmplx_01 LABELS gfortran llvm) # dcmplx, dconjg RUN(NAME logical_to_integer_cast LABELS gfortran llvm EXTRA_ARGS --logical-casting NO_STD_F23) RUN(NAME logical1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME logical2 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME logical3 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME logical4 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME logical_casting_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --logical-casting NO_STD_F23) RUN(NAME logical_kind_01 LABELS gfortran llvm) RUN(NAME logical_kind_02 LABELS gfortran llvm) RUN(NAME logical_kind_03 LABELS gfortran llvm) RUN(NAME logical_kind_07 LABELS gfortran llvm) RUN(NAME logical_kind_04 LABELS gfortran llvm) RUN(NAME logical_kind_05 LABELS gfortran llvm EXTRA_ARGS --fixed-form) RUN(NAME logical_kind_06 LABELS gfortran llvm) RUN(NAME tsunami LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST_MATH) RUN(NAME pdt_01 LABELS gfortran llvm) RUN(NAME pdt_02 LABELS gfortran llvm EXTRAFILES pdt_02_module.f90) RUN(NAME pdt_03 LABELS gfortran llvm) RUN(NAME pdt_04 LABELS gfortran llvm) RUN(NAME pdt_05 LABELS gfortran llvm) RUN(NAME pdt_06 LABELS gfortran llvm EXTRAFILES pdt_06_module.f90) RUN(NAME pdt_07 LABELS gfortran llvm) RUN(NAME pdt_08 LABELS gfortran llvm) RUN(NAME pdt_09 LABELS llvm) RUN(NAME pdt_10 LABELS llvm) RUN(NAME pdt_11 LABELS llvm EXTRAFILES pdt_11_module.f90 EXTRA_ARGS --separate-compilation) RUN(NAME pdt_12 LABELS llvm) RUN(NAME pdt_13 LABELS llvm EXTRA_ARGS --separate-compilation) RUN(NAME pdt_14 LABELS llvm EXTRA_ARGS --separate-compilation) RUN(NAME pdt_15 LABELS gfortran llvm) RUN(NAME pdt_16 LABELS gfortran llvm) RUN(NAME derived_types_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_02 LABELS gfortran llvm) RUN(NAME derived_types_03 LABELS gfortran llvm) RUN(NAME derived_types_04 LABELS gfortran llvm) RUN(NAME derived_types_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_05 LABELS gfortran llvm) RUN(NAME derived_types_07 LABELS gfortran llvm) RUN(NAME derived_types_08 LABELS gfortran llvm) RUN(NAME derived_types_09 LABELS gfortran EXTRAFILES derived_types_09b.f90 derived_types_09c.f90) RUN(NAME derived_types_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_15 LABELS gfortran llvm) RUN(NAME derived_types_14 LABELS gfortran EXTRAFILES derived_types_14_module.f90) RUN(NAME derived_types_16_module LABELS gfortran) RUN(NAME derived_types_18 LABELS gfortran) RUN(NAME derived_types_19 LABELS gfortran EXTRAFILES derived_types_19_module.f90) RUN(NAME derived_types_20 LABELS gfortran EXTRAFILES derived_types_20_module2.f90 derived_types_20_module1.f90) RUN(NAME derived_types_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME derived_types_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME derived_types_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_32 LABELS gfortran) RUN(NAME derived_types_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_35 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN derived_types_35_file.txt) RUN(NAME derived_types_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_38 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_39 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_40 LABELS gfortran llvm) RUN(NAME derived_types_41 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_42 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_43 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_44 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_45 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_46 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_50 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_51 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_52 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_53 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_54 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_55 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_56 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_57 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_58 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_59 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_60 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_61 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_62 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_63 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_64 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_65 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_66 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_67 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_68 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_69 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_70 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_71 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_72 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_73 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_74 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_75 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_76 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_77 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_78 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_79 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_80 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_81 LABELS gfortran llvm) RUN(NAME derived_types_82 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_83 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_84 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES derived_types_84_module.f90 EXTRA_ARGS --separate-compilation) RUN(NAME derived_types_85 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_86 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_87 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_88 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_89 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME derived_types_90 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME derived_types_91 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_92 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_93 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_94 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_96 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_97 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES derived_types_97_mod1.f90 derived_types_97_mod2.f90) RUN(NAME derived_types_98 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_99 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_100 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_101 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_102 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_103 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_104 LABELS gfortran llvm) RUN(NAME derived_types_105 LABELS gfortran llvm) RUN(NAME derived_types_106 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_107 LABELS gfortran llvm) RUN(NAME derived_types_108 LABELS gfortran llvm) RUN(NAME derived_types_109 LABELS gfortran llvm) RUN(NAME derived_types_110 LABELS gfortran llvm) RUN(NAME derived_types_111 LABELS gfortran llvm) RUN(NAME derived_types_112 LABELS llvm) RUN(NAME derived_types_113 LABELS gfortran llvm) RUN(NAME derived_types_114 LABELS gfortran llvm EXTRAFILES derived_types_114_module.f90 EXTRA_ARGS --separate-compilation) RUN(NAME derived_types_115 LABELS gfortran llvm EXTRAFILES derived_types_115_module.f90 EXTRA_ARGS --separate-compilation) RUN(NAME derived_types_116 LABELS gfortran llvm) RUN(NAME derived_types_117 LABELS gfortran llvm) RUN(NAME derived_types_118 LABELS gfortran llvm) RUN(NAME derived_types_119 LABELS gfortran llvm) RUN(NAME derived_types_120 LABELS gfortran llvm) RUN(NAME derived_types_121 LABELS gfortran llvm EXTRAFILES derived_types_121_module.f90 EXTRA_ARGS --separate-compilation) RUN(NAME derived_types_122 LABELS gfortran llvm) RUN(NAME derived_types_123 LABELS gfortran llvm EXTRA_ARGS -g GFORTRAN_ARGS -g) RUN(NAME derived_types_124 LABELS gfortran llvm) RUN(NAME derived_types_125 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_126 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_127 LABELS gfortran llvm) RUN(NAME derived_types_128 LABELS gfortran llvm) RUN(NAME derived_types_129 LABELS gfortran llvm) RUN(NAME derived_types_130 LABELS gfortran llvm) RUN(NAME derived_types_131 LABELS gfortran llvm) RUN(NAME derived_types_132 LABELS gfortran llvm) RUN(NAME derived_types_133 LABELS gfortran llvm) RUN(NAME derived_types_134 LABELS gfortran llvm EXTRAFILES derived_types_134_module.f90 EXTRA_ARGS --separate-compilation) RUN(NAME derived_types_135 LABELS gfortran llvm) RUN(NAME derived_types_136 LABELS gfortran llvm) RUN(NAME derived_types_137 LABELS gfortran llvm) RUN(NAME derived_types_apply_clip_01 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_type_with_default_init LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_type_with_default_init_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME multi_file_member_access_01 LABELS gfortran llvm llvm_single_invocation EXTRAFILES multi_file_member_access_01_mod.f90) RUN(NAME multi_file_member_access_02 LABELS gfortran llvm_single_invocation EXTRAFILES multi_file_member_access_02_mod.f90) RUN(NAME type_bound_generic_member_access_01 LABELS gfortran llvm) RUN(NAME type_bound_generic_member_access_02 LABELS gfortran llvm) RUN(NAME type_parameter_inquiry_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME line_continuation_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME line_continuation_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME line_continuation_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME line_continuation_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME line_continuation_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME program_01 LABELS gfortran) RUN(NAME program_02 LABELS gfortran llvm) RUN(NAME program_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME program_04 LABELS gfortran llvm) RUN(NAME init_values LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME param_pass_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME allocate_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocate_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocate_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays fortran) RUN(NAME allocate_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocate_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocate_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME allocate_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocate_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME allocate_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME allocate_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_source_ptr_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_array_descriptor_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocate_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_35 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocate_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_38 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_39 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_40 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_41 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocate_42 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_43 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_44 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_45 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_46 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_49 LABELS gfortran llvm) RUN(NAME allocate_51 LABELS gfortran llvm) RUN(NAME allocate_52 LABELS gfortran llvm) RUN(NAME allocate_53 LABELS gfortran llvm) RUN(NAME allocate_54 LABELS gfortran llvm) RUN(NAME allocate_55 LABELS gfortran llvm) RUN(NAME allocate_56 LABELS gfortran llvm) RUN(NAME allocate_57 LABELS gfortran llvm) RUN(NAME allocate_58 LABELS gfortran llvm) RUN(NAME allocate_59 LABELS gfortran llvm) RUN(NAME allocate_60 LABELS gfortran llvm) RUN(NAME allocate_61 LABELS gfortran llvm EXTRAFILES allocate_61_mod.f90 allocate_61_mod2.f90 EXTRA_ARGS --separate-compilation) RUN(NAME allocate_62 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_63 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME allocate_64 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_65 LABELS gfortran llvm) RUN(NAME allocate_66 LABELS gfortran llvm) RUN(NAME allocate_67 LABELS gfortran llvm) RUN(NAME allocate_68 LABELS gfortran llvm) RUN(NAME realloc_lhs_01 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME realloc_lhs_16 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 --realloc-lhs-arrays GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME realloc_lhs_17 FILE realloc_lhs_16 LABELS llvm EXTRA_ARGS --descriptor-index-64 --realloc-lhs-arrays) RUN(NAME realloc_lhs_18 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME realloc_lhs_19 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME realloc_lhs_20 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME realloc_lhs_21 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME realloc_lhs_22 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME automatic_allocation_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --std=f23) RUN(NAME automatic_allocation_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --std=f23) RUN(NAME automatic_allocation_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --std=f23) RUN(NAME block_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME block_02 LABELS gfortran llvm fortran) RUN(NAME block_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME block_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME block_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME block_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME block_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME block_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME block_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME block_10 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME block_11 LABELS gfortran llvm) RUN(NAME block_12 LABELS gfortran llvm) RUN(NAME block_13 LABELS gfortran llvm) RUN(NAME block_14 LABELS gfortran llvm) RUN(NAME block_15 LABELS gfortran llvm EXTRAFILES block_15_mod.f90) RUN(NAME block_16 LABELS gfortran llvm) RUN(NAME associate_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_08 LABELS gfortran llvm) RUN(NAME associate_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES associate_18_module.f90) RUN(NAME associate_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES associate_21_mod.f90) RUN(NAME associate_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_24 LABELS gfortran llvm) RUN(NAME associate_25 LABELS gfortran llvm) RUN(NAME associate_26 LABELS llvm) RUN(NAME associate_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_28 LABELS gfortran llvm) RUN(NAME associate_29 LABELS gfortran llvm) RUN(NAME associate_30 LABELS gfortran llvm) RUN(NAME associate_31 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME associate_32 LABELS llvm) RUN(NAME associate_33 LABELS gfortran llvm) RUN(NAME associate_34 LABELS gfortran llvm) RUN(NAME associate_35 LABELS gfortran llvm) RUN(NAME associate_36 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME associate_37 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME associate_38 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME associate_39 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME associate_40 LABELS gfortran llvm) RUN(NAME associate_41 LABELS gfortran llvm) RUN(NAME associate_42 LABELS gfortran llvm) RUN(NAME associate_43 LABELS gfortran llvm) RUN(NAME associate_44 LABELS gfortran llvm) RUN(NAME associate_45 LABELS gfortran llvm) RUN(NAME associate_46 LABELS gfortran llvm) RUN(NAME associate_47 LABELS gfortran llvm) RUN(NAME associate_48 LABELS gfortran llvm) RUN(NAME associate_49 LABELS gfortran llvm) RUN(NAME associate_50 LABELS gfortran llvm) RUN(NAME attr_dim_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME attr_dim_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME attr_dim_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME attr_dim_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmImplicit fortran) RUN(NAME real_dp_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME real_dp_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME bin_op_real_dp LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME bin_op_real_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME bin_op_real_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST_MATH) RUN(NAME const_real_dp LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME real_dp_param LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME int_dp LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME int_dp_param LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME complex_dp LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME bin_op_complex_dp LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME complex_dp_param LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME const_kind_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME const_kind_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME kinds_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME kinds_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME kinds_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME const_array_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME const_array_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME concat_char_arrays_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME huge_string_read LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm fortran) RUN(NAME string_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME string_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # lge, lgt lle, llt RUN(NAME string_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # achar RUN(NAME string_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # len RUN(NAME string_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) COMPILE(NAME string_30 COMPILERS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_35 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_38 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME string_39 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_40 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME string_41 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME string_42 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_43 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME string_44 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_45 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_46 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_50 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_51 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_52 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_53 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_54 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_55 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_56 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME string_57 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_58 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_59 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_60 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_61 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_62 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES string_62b.f90) RUN(NAME string_63 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_64 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_65 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_66 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_67 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_68 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_69 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME string_70 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_71 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_72 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_73 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_74 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_75 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_76 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_77 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_78 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_79 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_80 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_81 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_82 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_83 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_84 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_85 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_86 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_87 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_88 LABELS llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) # remove gfortran label, as functionality gave incorrect results RUN(NAME string_89 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME string_90 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_91 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_92 LABELS gfortran llvm) RUN(NAME string_93 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_94 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME string_95 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_96 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME string_97 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_98 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_99 LABELS gfortran llvm) RUN(NAME string_100 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_101 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_102 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_103 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_104 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_105 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_106 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_107 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_108 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_109 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_110 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_111 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_112 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_113 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_114 LABELS gfortran llvm) RUN(NAME string_115 LABELS gfortran llvm) RUN(NAME substring_read LABELS gfortran llvm) RUN(NAME nested_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME nested_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_25 LABELS gfortran llvm) RUN(NAME nested_vars1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME nested_vars2 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME nested_vars3 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_vars_allocatable_call LABELS gfortran llvm) RUN(NAME nbody LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intent_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intent_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intent_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME callback_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME callback_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME callback_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME callback_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME callback_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME callback_06 LABELS gfortran llvm) RUN(NAME recursion_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME recursion_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME recursion_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME return_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME return_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # contains module RUN(NAME return_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME return_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME return_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME return_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME exponent_inf_01 LABELS gfortran llvm) RUN(NAME file_01 LABELS gfortran llvm COPY_TO_BIN file_01_data.txt) RUN(NAME file_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_01_data.txt) RUN(NAME file_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran COPY_TO_BIN file_03_data.txt) RUN(NAME file_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_04_data.dat) RUN(NAME file_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_05_data.dat) RUN(NAME file_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_06_data.dat) RUN(NAME file_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_07_data.dat) RUN(NAME file_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran COPY_TO_BIN file_08.txt) RUN(NAME file_09 LABELS gfortran llvm COPY_TO_BIN file_01_data.txt) RUN(NAME file_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_10_data.txt) RUN(NAME file_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_01_data.txt) RUN(NAME file_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_12_data.txt) RUN(NAME file_13 LABELS gfortran llvm llvm_wasm COPY_TO_BIN file_01_data.txt) RUN(NAME file_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_08.txt) RUN(NAME file_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran COPY_TO_BIN file_03_data.txt) RUN(NAME file_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_18_data.txt) RUN(NAME file_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_19_data.txt) # the below test case writes and reads that same file for testing purpose RUN(NAME file_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_21_data.txt) RUN(NAME file_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_22_data.txt) RUN(NAME file_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_23_data.txt) RUN(NAME file_24 LABELS gfortran llvm COPY_TO_BIN "file 24 data.txt" file_22_data.txt) RUN(NAME file_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --cpp) RUN(NAME file_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_35 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_STD_F23) RUN(NAME file_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_38 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_39 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_40 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_41 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_42 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_43 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_44 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_45 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_46 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_50 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_51 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_52 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_53 LABELS gfortran llvm) RUN(NAME file_54 LABELS gfortran llvm) RUN(NAME file_55 LABELS gfortran llvm) RUN(NAME file_56 LABELS gfortran llvm) RUN(NAME file_57 LABELS gfortran llvm) RUN(NAME file_58 LABELS gfortran llvm) RUN(NAME file_59 LABELS gfortran llvm) RUN(NAME file_60 LABELS gfortran llvm) RUN(NAME file_61 LABELS gfortran llvm) RUN(NAME file_62 LABELS gfortran llvm) RUN(NAME file_63 LABELS gfortran llvm) RUN(NAME file_close_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_open_01 LABELS llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME file_open_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_open_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME file_open_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME file_open_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME file_open_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME file_open_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_open_08 LABELS gfortran llvm) RUN(NAME file_overwrite LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME inquire_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME inquire_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME inquire_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME inquire_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME inquire_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME inquire_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME inquire_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME inquire_08 LABELS gfortran llvm) RUN(NAME inquire_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME inquire_10 LABELS gfortran llvm) RUN(NAME inquire_11 LABELS gfortran llvm) RUN(NAME inquire_12 LABELS gfortran llvm) RUN(NAME inquire_13 LABELS gfortran llvm) RUN(NAME inquire_14 LABELS llvm EXTRA_ARGS --cpp) RUN(NAME test_inquire_size LABELS gfortran llvm ) RUN(NAME test_backspace_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_01_data.txt) RUN(NAME test_endfile_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_01 LABELS gfortran llvm) RUN(NAME class_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_03 LABELS gfortran llvm) RUN(NAME class_04 LABELS gfortran llvm fortran) RUN(NAME class_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_35 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_38 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_39 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_40 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_41 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_42 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_43 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_44 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_45 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_46 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME class_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME class_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_50 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_51 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_52 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_53 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_54 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_55 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME class_56 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_57 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_58 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_59 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_60 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_61 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME class_62 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_63 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS -c --cpp EXTRAFILES class_63_module_1.f90 class_63_module_2.f90) RUN(NAME class_64 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_65 LABELS gfortran) RUN(NAME class_66 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_67 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_68 LABELS gfortran) RUN(NAME class_69 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_70 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_71 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_72 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_73 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_74 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_75 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_76 LABELS gfortran llvm) RUN(NAME class_77 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_78 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_79 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_80 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_81 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_82 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_83 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME class_84 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME class_85 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME class_86 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_87 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_88 LABELS llvm) RUN(NAME class_89 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_90 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_STD_F23) RUN(NAME class_91 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_92 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_93 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_94 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_95 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_96 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_97 LABELS gfortran llvm) RUN(NAME class_98 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_99 LABELS gfortran llvm) RUN(NAME class_100 LABELS gfortran llvm) RUN(NAME class_101 LABELS gfortran llvm) RUN(NAME class_102 LABELS gfortran llvm) RUN(NAME class_103 LABELS gfortran llvm) RUN(NAME class_104 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_105 LABELS gfortran llvm) RUN(NAME class_106 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES class_106a.f90 class_106b.f90) RUN(NAME class_107 LABELS gfortran llvm) RUN(NAME class_108 LABELS gfortran llvm) RUN(NAME class_109 LABELS gfortran llvm) RUN(NAME class_110 LABELS gfortran llvm EXTRAFILES class_110_module.f90) RUN(NAME class_111 LABELS gfortran llvm) RUN(NAME class_112 LABELS gfortran llvm) RUN(NAME class_113 LABELS gfortran llvm) RUN(NAME class_114 LABELS gfortran llvm) RUN(NAME class_115 LABELS gfortran llvm) RUN(NAME class_116 LABELS gfortran llvm) RUN(NAME class_117 LABELS gfortran llvm) RUN(NAME class_118 LABELS gfortran llvm) RUN(NAME class_119 LABELS gfortran llvm) RUN(NAME class_120 LABELS gfortran llvm) RUN(NAME class_121 LABELS gfortran llvm) RUN(NAME class_122 LABELS gfortran llvm) RUN(NAME class_123 LABELS gfortran llvm) RUN(NAME class_124 LABELS gfortran llvm) RUN(NAME class_127 LABELS gfortran llvm) RUN(NAME class_128 LABELS gfortran llvm) RUN(NAME class_129 LABELS gfortran llvm) RUN(NAME class_130 LABELS gfortran llvm) RUN(NAME class_131 LABELS gfortran llvm) RUN(NAME class_132 LABELS gfortran llvm) RUN(NAME class_133 LABELS gfortran llvm) RUN(NAME class_134 LABELS gfortran llvm) RUN(NAME class_135 LABELS gfortran llvm) RUN(NAME class_137 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME class_138 LABELS gfortran llvm) RUN(NAME class_139 LABELS gfortran llvm) RUN(NAME class_140 LABELS gfortran llvm) RUN(NAME class_141 LABELS gfortran llvm) RUN(NAME class_142 LABELS gfortran llvm) RUN(NAME class_143 LABELS gfortran llvm) RUN(NAME class_144 LABELS gfortran llvm) RUN(NAME class_145 LABELS gfortran llvm) RUN(NAME class_146 LABELS gfortran llvm) RUN(NAME class_147 LABELS gfortran llvm) RUN(NAME class_procedure_args_01 LABELS gfortran llvm) RUN(NAME derived_type_member_procedure_call_01 LABELS gfortran llvm) RUN(NAME derived_type_member_procedure_call_02 LABELS gfortran llvm) RUN(NAME class_allocate_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_allocate_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_allocate_03 LABELS gfortran llvm) RUN(NAME class_allocate_04 LABELS gfortran llvm) RUN(NAME class_allocate_05 LABELS gfortran llvm) RUN(NAME class_allocate_06 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME class_optional_01 LABELS gfortran llvm) RUN(NAME kwargs_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME kwargs_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_iso_c_binding LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME test_iso_c_binding_constants LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME test_iso_fortran_env LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME test_ieee_arithmetic LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_arithmetic_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_arithmetic_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_arithmetic_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST_MATH) RUN(NAME test_ieee_arithmetic_fast_01 LABELS gfortran llvm) RUN(NAME iso_fortran_env_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME iso_fortran_env_02 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME iso_fortran_env_03 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME iso_fortran_env_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_next LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_next_up LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_next_down LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_logb LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_rem LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_is_negative LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_scalb LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_rint LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_int LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_real LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_copy_sign LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_is_normal LABELS llvm llvm_wasm llvm_wasm_emcc NO_FAST) RUN(NAME test_ieee_nan_value LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_value_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST_MATH) RUN(NAME test_ieee_is_finite LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST) RUN(NAME test_ieee_unordered LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST) RUN(NAME test_ieee_support LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST) RUN(NAME test_ieee_infnan LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST) RUN(NAME test_format_inf_nan LABELS gfortran llvm) RUN(NAME test_ieee_underflow_mode LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_inf_nan_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST_MATH) RUN(NAME abs_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran mlir) RUN(NAME abs_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME abs_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME abs_04 LABELS gfortran llvm) RUN(NAME abs_05 LABELS gfortran llvm) RUN(NAME abs_06 LABELS gfortran llvm NO_FAST_MATH) RUN(NAME sqrt_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME sqrt_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME sin_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME sin_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME sin_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME sin_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME cos_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME bits_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME bits_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME bits_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME bits_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) #bgt, #bge, #blt, #ble RUN(NAME bits_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) #ibits RUN(NAME bits_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME bits_07 LABELS gfortran llvm) RUN(NAME cpu_time_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # RUN(NAME cpu_time_02_wasm LABELS wasm) RUN(NAME system_clock_01 LABELS gfortran llvm) RUN(NAME boz_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME boz_02 LABELS llvm llvm_wasm llvm_wasm_emcc) #remove gfortran label, as functionality is not supported by gfortran RUN(NAME cmd_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME cmd_02 LABELS gfortran llvm) RUN(NAME cmd_03 LABELS gfortran llvm) # get_command_argument loop until empty RUN(NAME flip_sign LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME div_to_mul LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME fma LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME fma_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME fma_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME loop_unroll_small LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME loop_unroll_large LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME loop_var_use_after_loop LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm EXTRA_ARGS --use-loop-variable-after-loop) RUN(NAME sign_from_value LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME rewind_inquire_flush LABELS gfortran) RUN(NAME rewind_01 LABELS gfortran llvm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME flush_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_01_data.txt) RUN(NAME flush_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_01_data.txt file_02_data.txt) RUN(NAME flush_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME flush_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME flush_05 LABELS gfortran llvm) RUN(NAME assign_to1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME assign_to2 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME assign_to3 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME conv_complex2real LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_02 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME template_03 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) # DISABLED: #8115 - ASR verify: FunctionType contains types tied to scope after template instantiation # RUN(NAME template_04 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME template_05 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_add_01 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_add_01b LABELS llvm llvm_wasm llvm_wasm_emcc) # FIXME: add visit_OverloadedBinOp to wasm RUN(NAME template_add_01c LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_add_02 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_add_03 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_add_04 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_nested LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_travel_01 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_travel_01b LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_travel_02 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_triple LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_array_01 LABELS llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME template_array_02 LABELS llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME template_array_03 LABELS llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME template_array_04 LABELS llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME template_array_04b LABELS llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) # DISABLED: #8115 - ASR verify: FunctionType contains types tied to scope after template instantiation # RUN(NAME template_matrix_01 LABELS llvm llvm_wasm llvm_wasm_emcc) # DISABLED: #8115 - ASR verify: FunctionType contains types tied to scope after template instantiation # RUN(NAME template_matrix_test LABELS llvm llvm_wasm llvm_wasm_emcc EXTRAFILES # template_semigroup.f90 # template_monoid.f90 # template_semiring.f90 # template_unitring.f90 # template_field.f90 # template_matrix.f90 # ) RUN(NAME template_struct_01 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME template_vector LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME template_simple_01 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_simple_02 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_simple_03 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_simple_04 LABELS llvm llvm_wasm llvm_wasm_emcc) # FIXME: add visit_OverloadedBinOp to wasm RUN(NAME template_sort_01 LABELS llvm llvm_wasm llvm_wasm_emcc NOFAST_TILL_LLVM16) # FIXME: This test had worked before, but fails now with --fast. RUN(NAME template_sort_02 LABELS llvm llvm_wasm llvm_wasm_emcc NOFAST_TILL_LLVM16) # FIXME: This test had worked before, but fails now with --fast. RUN(NAME template_lapack_01 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_interface_01 LABELS llvm llvm_wasm llvm_wasm_emcc) # FIXME: add visit_OverloadedBinOp to wasm RUN(NAME template_commutative LABELS llvm llvm_wasm llvm_wasm_emcc) # FIXME: add visit_OverloadedBinOp to wasm RUN(NAME statement1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME dlaswap LABELS gfortran llvm) RUN(NAME implied_do_loops1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops2 LABELS gfortran fortran) RUN(NAME implied_do_loops3 LABELS gfortran fortran) RUN(NAME implied_do_loops4 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops5 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops6 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops7 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops8 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops9 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran NO_FAST) RUN(NAME implied_do_loops15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --implicit-typing) RUN(NAME implied_do_loops16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME implied_do_loops17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME implied_do_loops18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME implied_do_loops19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME implied_do_loops22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops23 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME implied_do_loops24 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME implied_do_loops25 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME implied_do_loops26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --use-loop-variable-after-loop) RUN(NAME implied_do_loops_strings LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME implied_do_loops_print LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops27 LABELS gfortran llvm) RUN(NAME implied_do_loops28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME implied_do_loops29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME implied_do_loops30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME minpack_01 LABELS gfortran llvm_rtlib EXTRAFILES minpack_01_module.f90 minpack_01_func.f90) RUN(NAME minpack_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME external_01 LABELS gfortran llvmImplicit) RUN(NAME external_02 LABELS gfortran llvmImplicit) RUN(NAME external_03 LABELS gfortran llvmImplicit) RUN(NAME external_04 LABELS gfortran llvmImplicit) RUN(NAME external_05 LABELS gfortran llvmImplicit) RUN(NAME external_06 LABELS gfortran llvmImplicit) RUN(NAME external_07 LABELS gfortran llvmImplicit) RUN(NAME external_08 LABELS gfortran llvmImplicit) RUN(NAME external_09 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME external_10 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME external_11 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME external_12 LABELS gfortran llvm EXTRAFILES external_12_module.f90) RUN(NAME external_13 LABELS gfortran llvm EXTRA_ARGS --implicit-interface --mangle-underscore-external) RUN(NAME external_14 LABELS gfortran llvm EXTRAFILES external_14_module.f90) RUN(NAME external_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --implicit-interface) RUN(NAME external_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --implicit-interface) RUN(NAME interface_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME private1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME spec_expr_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME enum_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME enum_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES enum_02_module.f90) RUN(NAME enum_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME enum_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME enum_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME enum_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES enum_06_module.f90) RUN(NAME enum_07 LABELS gfortran llvm_submodule EXTRAFILES enum_07_module.f90 enum_07_submodule.f90) RUN(NAME enum_08 LABELS gfortran llvm) RUN(NAME array_section_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME array_section_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME array_section_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME array_section_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME array_section_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME array_section_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME array_section_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME array_section_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME array_section_09 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME array_section_10 LABELS gfortran llvm) RUN(NAME array_section_11 LABELS gfortran llvm EXTRA_ARGS --descriptor-index-64) RUN(NAME array_section_12 LABELS gfortran llvm) RUN(NAME array_section_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_section_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_section_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_section_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_section_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_section_18 LABELS gfortran llvm EXTRAFILES array_section_18b.f90 EXTRA_ARGS --implicit-interface --legacy-array-sections) RUN(NAME array_section_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_section_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_section_21 LABELS gfortran llvm) RUN(NAME array_section_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_section_23 LABELS gfortran llvm) RUN(NAME array_section_24 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections) RUN(NAME nested_vars_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME nested_vars_02 LABELS gfortran llvm) RUN(NAME nested_vars_03 LABELS gfortran llvm) RUN(NAME nested_vars_04 LABELS gfortran llvm) RUN(NAME pass_array_by_data_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME pass_array_by_data_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME pass_array_by_data_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_13 LABELS gfortran llvm) RUN(NAME pass_array_by_data_extname_01 LABELS gfortran llvm) RUN(NAME implicit_deallocate_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME deallocate_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME deallocate_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME finalization_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME finalization_02 LABELS gfortran llvm) RUN(NAME finalization_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME finalization_04 LABELS gfortran llvm) RUN(NAME read_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN read_02_data.txt) RUN(NAME read_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN read_03_data.txt) RUN(NAME read_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME read_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN read_07_data.txt) RUN(NAME read_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_20 LABELS gfortran llvm) RUN(NAME read_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST_MATH) RUN(NAME read_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST) RUN(NAME read_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST) RUN(NAME read_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_28 LABELS gfortran llvm) RUN(NAME read_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN read_31_data.txt) RUN(NAME read_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_35 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_38 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_39 LABELS gfortran llvm) RUN(NAME read_40 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_41 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_42 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_43 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_44 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_45 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_46 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_50 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_51 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST_MATH) RUN(NAME read_52 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST_MATH) RUN(NAME read_53 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_54 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_55 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_56 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_57 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_58 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_59 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_60 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_61 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_62 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_63 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME read_64 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME read_65 LABELS gfortran llvm) RUN(NAME read_66 LABELS gfortran llvm) RUN(NAME read_67 LABELS gfortran llvm) RUN(NAME read_68 LABELS gfortran llvm) RUN(NAME read_69 LABELS gfortran llvm) RUN(NAME read_70 LABELS gfortran llvm) RUN(NAME read_71 LABELS gfortran llvm) RUN(NAME read_72 LABELS gfortran llvm) RUN(NAME read_73 LABELS gfortran llvm) RUN(NAME read_74 LABELS gfortran llvm) RUN(NAME read_75 LABELS gfortran llvm) RUN(NAME read_76 LABELS gfortran llvm) RUN(NAME read_77 LABELS gfortran llvm) RUN(NAME read_78 LABELS gfortran llvm) RUN(NAME read_79 LABELS gfortran llvm) RUN(NAME write_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME write_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME write_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME write_14 LABELS gfortran llvm) RUN(NAME write_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_18 LABELS gfortran llvm) RUN(NAME write_19 LABELS gfortran llvm EXTRAFILES write_19_module.f90 EXTRA_ARGS --separate-compilation) RUN(NAME write_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_22 LABELS gfortran llvm) RUN(NAME write_23 LABELS gfortran llvm) RUN(NAME write_24 LABELS gfortran llvm) RUN(NAME write_25 LABELS gfortran llvm) RUN(NAME write_26 LABELS gfortran llvm) RUN(NAME write_fortran_01 LABELS gfortran llvm fortran) RUN(NAME write_fortran_02 LABELS gfortran llvm fortran) RUN(NAME do_loop_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME iso_c_binding_01 LABELS gfortran llvm fortran) RUN(NAME iso_c_binding_02 LABELS gfortran llvm) RUN(NAME iso_c_binding_05 LABELS gfortran llvm) RUN(NAME array_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME array_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME array_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME do_loop_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME do_loop_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --use-loop-variable-after-loop) RUN(NAME do_loop_04 LABELS llvm) # This test is not supported by gfortran, as it uses a loop variable after the loop ( bad code practice ) RUN(NAME do_loop_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME do_loop_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME do_loop_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME do_loop_08 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME array_op_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) #TODO: fix mlir, commented in PR: #6060 RUN(NAME array_op_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME array_op_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME array_op_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME array_op_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_op_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME array_op_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_op_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_op_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_op_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_op_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_op_12 LABELS gfortran llvm) RUN(NAME array_op_13 LABELS gfortran llvm) RUN(NAME array_slice_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray c) RUN(NAME array_slice_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME array_slice_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray c) RUN(NAME array_slice_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME declaration_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME declaration_02 LABELS gfortran llvm) RUN(NAME declaration_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME declaration_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME declaration_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_05 LABELS gfortran llvmImplicit) RUN(NAME procedure_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_09_b LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES procedure_09_a.f90) RUN(NAME procedure_10 LABELS gfortran llvm) RUN(NAME procedure_11 LABELS gfortran llvm) RUN(NAME procedure_12 LABELS gfortran llvm) RUN(NAME procedure_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES procedure_22_a.f90) RUN(NAME procedure_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_29 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME procedure_30 LABELS llvm) RUN(NAME procedure_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_32 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME procedure_35 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_36 LABELS gfortran llvm) RUN(NAME procedure_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_38 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_39 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_40 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_41 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_42 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_43 LABELS gfortran llvm EXTRAFILES procedure_43_module.f90 EXTRA_ARGS --separate-compilation) RUN(NAME procedure_44 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_45 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_46 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_pointer_abstract_01 LABELS gfortran llvm) RUN(NAME procedure_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_50 LABELS gfortran llvm) RUN(NAME procedure_pointer_abstract_02 LABELS gfortran llvm) RUN(NAME procedure_pointer_keyword_01 LABELS gfortran llvm) RUN(NAME allocated_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocated_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocated_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocated_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocated_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_07 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocate_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME allocate_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME dealloc_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME dealloc_02 LABELS gfortran) RUN(NAME dealloc_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME dealloc_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME dealloc_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME dealloc_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME double_complex_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME lapack_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME lapack_02 LABELS gfortran llvm EXTRA_ARGS --fixed-form --legacy-array-sections --implicit-interface GFORTRAN_ARGS -ffixed-form) RUN(NAME lapack_03 LABELS gfortran llvm EXTRA_ARGS --fixed-form --legacy-array-sections --implicit-interface --cpp-infer GFORTRAN_ARGS -ffixed-form) RUN(NAME lapack_04 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections --implicit-interface) RUN(NAME lapack_05 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections --implicit-interface) RUN(NAME lapack_06 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections --implicit-interface) RUN(NAME lapack_07 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections --implicit-interface) RUN(NAME lapack_08 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections --implicit-interface) RUN(NAME lapack_09 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections --implicit-interface) RUN(NAME lapack_10 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections --implicit-interface) RUN(NAME common_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_04 LABELS gfortran llvm) # TODO: Fix these tests RUN(NAME common_05 LABELS gfortran) RUN(NAME common_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmImplicit) RUN(NAME common_07 LABELS gfortran llvmImplicit) RUN(NAME common_08 LABELS gfortran llvmImplicit) RUN(NAME common_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmImplicit) RUN(NAME common_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_24 LABELS gfortran llvm llvm2 EXTRAFILES common_24a.f90 common_24b.f90 EXTRA_ARGS --implicit-interface --separate-compilation) RUN(NAME common_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_28 LABELS gfortran llvm EXTRA_ARGS --implicit-typing) RUN(NAME common_29 LABELS gfortran llvm) RUN(NAME common_30 LABELS gfortran llvm) RUN(NAME common_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_substring_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME statement_01 LABELS llvm gfortran llvmImplicit) RUN(NAME statement_02 LABELS gfortran llvmImplicit) RUN(NAME statement_03 LABELS gfortran llvmImplicit) RUN(NAME statement_04 LABELS llvm gfortran llvmImplicit) RUN(NAME statement_05 LABELS llvm gfortran llvmImplicit) RUN(NAME statement_06 LABELS llvm gfortran) RUN(NAME statement_07 LABELS gfortran llvmImplicit) RUN(NAME data_implied_do_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_implied_do_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_implied_do_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_implied_do_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_implied_do_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_implied_do_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_implied_do_07 LABELS gfortran llvm) RUN(NAME data_implied_do_08 LABELS gfortran llvm) RUN(NAME save_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME save_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME save_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME save_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME save_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME save_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME save_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME save_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME save_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME save_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME save_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME save_12 LABELS gfortran llvmImplicit) RUN(NAME save_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME save_14 LABELS gfortran llvm) RUN(NAME entry_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME entry_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME entry_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME entry_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME entry_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME entry_06 LABELS gfortran llvm) RUN(NAME entry_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME entry_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME entry_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME entry_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME entry_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME entry_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME entry_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME entry_14 LABELS gfortran llvm) RUN(NAME character_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME character_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_09 LABELS gfortran llvm fortran) RUN(NAME character_10 LABELS gfortran EXTRAFILES character_10c.c) RUN(NAME character_11 LABELS gfortran EXTRAFILES character_11c.c) RUN(NAME character_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME character_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME character_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_17 LABELS gfortran llvmImplicit) RUN(NAME character_18 LABELS gfortran llvmImplicit) RUN(NAME character_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME character_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME character_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME character_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --implicit-interface) RUN(NAME character_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_26 LABELS gfortran llvm) RUN(NAME char_array_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME char_array_indexing LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME char_array_indexing_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME character_parameter_padding_trimming LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME character_array_parameter_padding_trimming LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME character_max_parameter_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME c_ptr_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME c_ptr_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME c_ptr_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME c_ptr_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME c_ptr_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME c_ptr_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME c_ptr_07 LABELS gfortran llvm) RUN(NAME c_ptr_08 LABELS gfortran llvm) RUN(NAME c_ptr_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME c_ptr_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME c_ptr_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME c_ptr_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME c_ptr_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME c_ptr_14 LABELS gfortran llvm) RUN(NAME c_ptr_15 LABELS gfortran llvm) RUN(NAME c_f_proc_ptr_01 LABELS gfortran llvm EXTRAFILES c_f_proc_ptr_01.c) # c_f_procpointer RUN(NAME arrayitem_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME arrayitem_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME array_indices_array_item LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME array_indices_array_item_assignment LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_indices_array_item_assignment_1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_indices_array_item_assignment_2 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_indices_array_item_assignment_3 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME implicit_argument_casting_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --implicit-argument-casting --legacy-array-sections GFORTRAN_ARGS -fallow-argument-mismatch) RUN(NAME implicit_argument_casting_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --implicit-argument-casting --legacy-array-sections GFORTRAN_ARGS -fallow-argument-mismatch) RUN(NAME implicit_argument_casting_03 LABELS gfortran llvm EXTRA_ARGS --implicit-interface --implicit-argument-casting GFORTRAN_ARGS -fallow-argument-mismatch) RUN(NAME implicit_argument_casting_04 LABELS gfortran llvm EXTRA_ARGS --implicit-argument-casting) RUN(NAME specfun_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --use-loop-variable-after-loop --implicit-typing) RUN(NAME cpp_pre_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME cpp_pre_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME cpp_pre_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME cpp_pre_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME cpp_pre_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME cpp_pre_06 LABELS gfortran llvm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME cpp_pre_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME cpp_pre_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME cpp_pre_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME cpp_pre_10 LABELS gfortran llvm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME cpp_pre_11 LABELS gfortran llvm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME cpp_pre_12 LABELS gfortran llvm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME cpp_pre_13 LABELS gfortran llvm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME cpp_pre_14 LABELS gfortran llvm EXTRA_ARGS --cpp COPY_TO_BIN cpp_pre_14_include.h GFORTRAN_ARGS -cpp) RUN(NAME cpp_pre_15 LABELS gfortran llvm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME dabs_01 LABELS gfortran llvmImplicit) RUN(NAME minpack_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME optional_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME optional_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME optional_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME optional_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME optional_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME optional_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME optional_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME optional_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME optional_09 LABELS gfortran llvm) RUN(NAME optional_10 LABELS gfortran llvm) RUN(NAME optional_11 LABELS gfortran llvm) RUN(NAME end_name_match LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME mangle_underscore_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --mangle-underscore --all-mangling NO_FAST_MATH) RUN(NAME nan_handling_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME precision_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME precision_02 LABELS gfortran) # TODO fix this test RUN(NAME precision_03 LABELS gfortran llvm) RUN(NAME array_unbounded_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME array_unbounded_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME matmul_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm_nopragma) RUN(NAME matmul_02 LABELS gfortran) RUN(NAME matmul_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME matmul_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME matmul_05 LABELS gfortran llvm) RUN(NAME matmul_06 LABELS gfortran llvm) RUN(NAME simd_01 LABELS gfortran c llvm llvm_nopragma c_nopragma) RUN(NAME simd_02 LABELS gfortran c llvm llvm_nopragma c_nopragma NO_FAST_MATH) RUN(NAME legacy_array_sections_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --legacy-array-sections --implicit-interface) RUN(NAME legacy_array_sections_04 LABELS gfortran llvm2 EXTRA_ARGS --implicit-interface --legacy-array-sections EXTRAFILES legacy_array_sections_04b.f90) RUN(NAME legacy_array_sections_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_10 LABELS gfortran llvm llvm2 EXTRAFILES legacy_array_sections_10_foo.f90 EXTRA_ARGS --legacy-array-sections --implicit-interface --separate-compilation) RUN(NAME legacy_array_sections_11 LABELS gfortran llvm EXTRAFILES legacy_array_sections_11_stubs.c EXTRA_ARGS --fixed-form --implicit-interface --implicit-typing --legacy-array-sections --separate-compilation GFORTRAN_ARGS -ffixed-form -fno-underscoring) RUN(NAME legacy_array_sections_12 LABELS gfortran llvm EXTRA_ARGS --implicit-interface --legacy-array-sections) RUN(NAME legacy_array_sections_13 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_14 LABELS gfortran llvm EXTRAFILES legacy_array_sections_14_foo.f90 EXTRA_ARGS --legacy-array-sections --implicit-interface --separate-compilation) RUN(NAME legacy_array_sections_15 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME legacy_array_sections_16 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_17 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_18 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_19 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_20 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_21 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_22 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections) RUN(NAME cmake_minimal_test_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME char_array_initialization_declaration LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME ip_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME shifta_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME shifta_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_12 LABELS gfortran) RUN(NAME equivalence_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST) RUN(NAME equivalence_16 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME equivalence_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_21 LABELS gfortran llvm EXTRA_ARGS --implicit-typing) RUN(NAME equivalence_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_24 LABELS gfortran llvm) RUN(NAME equivalence_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_30 LABELS gfortran llvm) RUN(NAME fortran_primes_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME goto_gototarget_return_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME selected_int_kind_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME capital_01 LABELS gfortran llvmImplicit) RUN(NAME do_concurrent_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc mlir mlir_omp mlir_llvm_omp) RUN(NAME do_concurrent_02 LABELS llvm_omp llvm) RUN(NAME do_concurrent_03 LABELS llvm_omp) RUN(NAME do_concurrent_04 LABELS llvm_omp) RUN(NAME do_concurrent_05 LABELS llvm_omp) RUN(NAME do_concurrent_06 LABELS llvm_omp) RUN(NAME do_concurrent_07 LABELS llvm_omp) RUN(NAME do_concurrent_08 LABELS llvm_omp) RUN(NAME do_concurrent_09 LABELS llvm_omp) RUN(NAME do_concurrent_10 LABELS llvm_omp) RUN(NAME do_concurrent_11 LABELS llvm_omp llvm) # every other `do_concurrent` test can work with llvm, the only reason RUN(NAME do_concurrent_12 LABELS llvm_omp llvm NO_FAST_MATH) # to not include is that we do a `omp_set_num_threads(xx)` call RUN(NAME do_concurrent_13 LABELS llvm_omp llvm) # to not include is that we do a `omp_set_num_threads(xx)` call RUN(NAME transfer_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME transfer_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME transfer_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME transfer_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME transfer_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME transfer_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME transfer_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME transfer_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME transfer_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME transfer_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME transfer_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME transfer_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME transfer_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME transfer_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME transfer_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME transfer_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME transfer_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME transfer_18 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME transfer_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME transfer_20 LABELS gfortran llvm) RUN(NAME transfer_21 LABELS gfortran llvm) RUN(NAME transfer_22 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME transfer_23 LABELS gfortran llvm) RUN(NAME transfer_24 LABELS gfortran llvm) RUN(NAME transfer_25 LABELS gfortran llvm) RUN(NAME transfer_26 LABELS gfortran llvm) RUN(NAME transfer_27 LABELS gfortran llvm) RUN(NAME transfer_28 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME transfer_29 LABELS gfortran llvm) RUN(NAME transfer_assumed_shape_01 LABELS gfortran llvm) RUN(NAME present_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME present_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME present_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME present_04 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME present_05 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME present_06 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME present_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME present_08 LABELS gfortran llvm) RUN(NAME types_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrayprint_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME print_arr_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME print_arr_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME pointer_to_cptr LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME binop_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME binop_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME binop_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME logical_arrays_logical_binop_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME dfloat_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME elemental_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME elemental_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME elemental_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME elemental_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME elemental_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME elemental_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME elemental_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME elemental_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME elemental_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME elemental_21 LABELS gfortran llvm) RUN(NAME elemental_22 LABELS gfortran llvm) RUN(NAME elemental_23 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME types_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME types_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME types_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME types_24 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME types_real_to_complex_cast LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME types_real_array_to_complex_array_cast LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME lbound_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME module_function_with_nopass LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME module_function_without_nopass LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME polymorphic_arguments_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME polymorphic_arguments_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocatable_polymorphic_mold_01 LABELS gfortran llvm fortran) RUN(NAME allocatable_polymorphic_assign_01 LABELS gfortran llvm) RUN(NAME allocatable_dummy_descriptor_01 LABELS gfortran llvm) RUN(NAME polymorphic_class_compare LABELS gfortran) RUN(NAME nested_struct_proc_01 LABELS gfortran llvm) RUN(NAME binop_of_struct_instance_in_function_call gfortran llvm fortran) RUN(NAME test_call_arg_structinstance_member gfortran llvm fortran) RUN(NAME openmp_bindc_01 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_bindc_02 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_bindc_03 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_bindc_04 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_01 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_02 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_03 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_04 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_05 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_06 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_07 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_08 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_09 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_10 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_11 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_12 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_13 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_14 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_15 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_16 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_17 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_18 LABELS gfortran llvm_omp EXTRA_ARGS --fast GFORTRAN_ARGS -fopenmp) # compute pi RUN(NAME openmp_19 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_20 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_21 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_22 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_23 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_24 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_25 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_26 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_27 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_28 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_29 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_30 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) # matmul RUN(NAME openmp_31 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_32 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_33 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) # mandelbrot RUN(NAME openmp_34 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) # Ensure uniform load distribution over threads RUN(NAME openmp_35 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_36 LABELS gfortran llvm GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_37 LABELS gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_38 LABELS gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_39 LABELS gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_40 LABELS llvm_omp llvm) RUN(NAME openmp_41 LABELS llvm_omp llvm) RUN(NAME openmp_42 LABELS llvm_omp llvm) RUN(NAME openmp_43 LABELS llvm_omp llvm) RUN(NAME openmp_44 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_45 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_47 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_48 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_49 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_50 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_51 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_52 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_53 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_54 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_55 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_56 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_57 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_58 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_59 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_60 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_61 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_62 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_63 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_64 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_65 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_66 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_67 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_68 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_69 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_70 LABELS target_offload) RUN(NAME openmp_71 LABELS target_offload) RUN(NAME openmp_72 LABELS target_offload) RUN(NAME openmp_73 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_74 LABELS gfortran llvm) RUN(NAME nullify_01 LABELS gfortran fortran llvm) RUN(NAME nullify_02 LABELS gfortran fortran llvm) RUN(NAME nullify_03 LABELS gfortran llvm) RUN(NAME nullify_04 LABELS gfortran llvm) RUN(NAME nullify_05 LABELS gfortran llvm) RUN(NAME nullify_06 LABELS gfortran llvm) RUN(NAME nullify_07 LABELS gfortran llvm) RUN(NAME fortran_01 LABELS gfortran llvm fortran) RUN(NAME fortran_02 LABELS gfortran fortran) RUN(NAME contig LABELS gfortran llvm) RUN(NAME contig_stmt_01 LABELS gfortran llvm) RUN(NAME compiler_version_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME compiler_version_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME compiler_version_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME exit_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME exit_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME exit_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME struct_type_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME struct_type_02 LABELS gfortran llvm) RUN(NAME struct_type_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME struct_type_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME struct_type_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME struct_type_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME struct_type_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME struct_type_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME struct_type_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME struct_type_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME struct_type_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME struct_type_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME func_parameter_type_02 LABELS gfortran) # function passed in other argument of function RUN(NAME logical_not_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME assign_allocatable_array_of_struct_instances LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocatable_component_struct_array_01 LABELS gfortran llvm) RUN(NAME derived_component_section_01 LABELS gfortran llvm) RUN(NAME derived_component_section_02 LABELS gfortran llvm) RUN(NAME generic_interface_function_call_of_function_call LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME elemental_function_scalar_array_arg LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME elemental_function_overloaded_compare LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME procedure_decl_01_a LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES procedure_decl_01_b.f90) RUN(NAME array_concat LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # array passed in ArrayInitializer RUN(NAME multiple_objects_args LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME module_array_init LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME attr_intrinsic LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME separate_compilation_01 LABELS gfortran llvm EXTRAFILES separate_compilation_01b.f90) RUN(NAME separate_compilation_02 LABELS gfortran llvm EXTRAFILES separate_compilation_02b.f90) RUN(NAME separate_compilation_03 LABELS gfortran llvm EXTRAFILES separate_compilation_03a.f90 separate_compilation_03b.f90 EXTRA_ARGS --skip-pass=pass_array_by_data) RUN(NAME separate_compilation_04 LABELS gfortran llvm EXTRAFILES separate_compilation_04a.f90 separate_compilation_04b.f90) RUN(NAME separate_compilation_05 LABELS gfortran llvm EXTRAFILES separate_compilation_05a.f90 separate_compilation_05b.f90) RUN(NAME separate_compilation_06 LABELS gfortran llvm EXTRAFILES separate_compilation_06a.f90 separate_compilation_06b.f90) RUN(NAME separate_compilation_07 LABELS gfortran llvm EXTRAFILES separate_compilation_07a.f90 separate_compilation_07b.f90 separate_compilation_07c.c) RUN(NAME separate_compilation_08 LABELS gfortran llvm EXTRAFILES separate_compilation_08a.f90 separate_compilation_08b.f90) RUN(NAME separate_compilation_09 LABELS gfortran llvm EXTRAFILES separate_compilation_09a.f90 separate_compilation_09b.f90 separate_compilation_09c.c) RUN(NAME separate_compilation_10 LABELS gfortran llvm EXTRAFILES separate_compilation_10a.f90) RUN(NAME separate_compilation_11 LABELS gfortran llvm EXTRAFILES separate_compilation_11a.f90) RUN(NAME separate_compilation_12 LABELS gfortran llvm EXTRAFILES separate_compilation_12a.f90) RUN(NAME separate_compilation_13 LABELS gfortran llvm EXTRAFILES separate_compilation_13a.f90) RUN(NAME separate_compilation_class_star_01 LABELS gfortran llvm EXTRAFILES separate_compilation_class_star_01a.f90) RUN(NAME separate_compilation_class_star_02 LABELS gfortran llvm EXTRAFILES separate_compilation_class_star_02a.f90) RUN(NAME separate_compilation_14 LABELS gfortran llvm EXTRAFILES separate_compilation_14a.f90) RUN(NAME separate_compilation_15 LABELS gfortran llvm EXTRAFILES separate_compilation_15a.f90) RUN(NAME separate_compilation_16 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_16a.f90 separate_compilation_16b.f90) RUN(NAME separate_compilation_17 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_17a.f90 separate_compilation_17b.f90) RUN(NAME separate_compilation_18 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_18a.f90 separate_compilation_18b.f90) RUN(NAME separate_compilation_19 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_19a.f90 separate_compilation_19b.f90) RUN(NAME separate_compilation_20 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_20a.f90 separate_compilation_20b.f90) RUN(NAME separate_compilation_21 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_21a.f90 separate_compilation_21b.f90) RUN(NAME separate_compilation_22 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_22a.f90 separate_compilation_22b.f90) RUN(NAME separate_compilation_23 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_23a.f90 separate_compilation_23b.f90) RUN(NAME separate_compilation_24 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_24a.f90 separate_compilation_24b.f90) RUN(NAME separate_compilation_25 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_25a.f90 separate_compilation_25b.f90) RUN(NAME separate_compilation_26 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_26a.f90 separate_compilation_26b.f90) RUN(NAME separate_compilation_27 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_27a.f90 separate_compilation_27b.f90) RUN(NAME separate_compilation_28 LABELS gfortran llvm EXTRAFILES separate_compilation_28a.f90 separate_compilation_28b.f90 EXTRA_ARGS --implicit-interface) RUN(NAME separate_compilation_29 LABELS gfortran llvm EXTRAFILES separate_compilation_29a.f90 separate_compilation_29b.f90 EXTRA_ARGS --separate-compilation) RUN(NAME separate_compilation_30 LABELS gfortran llvm EXTRAFILES separate_compilation_30a.f90 separate_compilation_30b.f90 EXTRA_ARGS --separate-compilation) RUN(NAME separate_compilation_31 LABELS gfortran llvm EXTRAFILES separate_compilation_31a.f90 separate_compilation_31b.f90 EXTRA_ARGS --separate-compilation) RUN(NAME separate_compilation_32 LABELS gfortran llvm EXTRAFILES separate_compilation_32a.f90 separate_compilation_32b.f90 EXTRA_ARGS --separate-compilation) RUN(NAME separate_compilation_33 LABELS llvm EXTRAFILES separate_compilation_33a.f90 EXTRA_ARGS --separate-compilation) RUN(NAME separate_compilation_34 LABELS gfortran llvm EXTRAFILES separate_compilation_34a.f90 EXTRA_ARGS --separate-compilation) RUN(NAME separate_compilation_35 LABELS gfortran llvm EXTRAFILES separate_compilation_35a.f90 EXTRA_ARGS --separate-compilation) RUN(NAME separate_compilation_36 LABELS gfortran llvm EXTRAFILES separate_compilation_36a.f90 EXTRA_ARGS --separate-compilation) RUN(NAME separate_compilation_37 LABELS gfortran llvm EXTRAFILES separate_compilation_37a.f90 separate_compilation_37b.f90 EXTRA_ARGS --separate-compilation) RUN(NAME separate_compilation_38 LABELS gfortran llvm EXTRAFILES separate_compilation_38a.f90 EXTRA_ARGS --separate-compilation) RUN(NAME separate_compilation_39 LABELS llvm EXTRAFILES separate_compilation_39a.f90 separate_compilation_39b.f90 EXTRA_ARGS --separate-compilation) RUN(NAME separate_compilation_40 LABELS llvm EXTRA_ARGS --separate-compilation) RUN(NAME separate_compilation_41 LABELS gfortran llvm EXTRAFILES separate_compilation_41a.f90 separate_compilation_41b.f90 separate_compilation_41c.f90 EXTRA_ARGS --separate-compilation) RUN(NAME separate_compilation_42 LABELS llvm EXTRA_ARGS --separate-compilation) RUN(NAME separate_compilation_43 LABELS gfortran llvm EXTRAFILES separate_compilation_43a.f90 separate_compilation_43b.f90 EXTRA_ARGS --separate-compilation) RUN(NAME separate_compilation_44 LABELS gfortran llvm EXTRAFILES separate_compilation_44a.f90 separate_compilation_44b.f90 EXTRA_ARGS --separate-compilation) RUN(NAME separate_compilation_45 LABELS gfortran llvm EXTRAFILES separate_compilation_45a.f90 EXTRA_ARGS --separate-compilation) RUN(NAME separate_compilation_46 LABELS gfortran llvm EXTRAFILES separate_compilation_46a.f90 EXTRA_ARGS --separate-compilation) RUN(NAME separate_compilation_47 LABELS gfortran llvm EXTRAFILES separate_compilation_47a.f90 EXTRA_ARGS --separate-compilation) RUN(NAME separate_compilation_48 LABELS gfortran llvm EXTRAFILES separate_compilation_48a.f90 EXTRA_ARGS --separate-compilation) RUN(NAME no_explicit_return_type_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --implicit-typing) RUN(NAME logical_testing LABELS gfortran llvm) RUN(NAME formatted_read_01 LABELS gfortran llvm COPY_TO_BIN formatted_read_input_01.txt) RUN(NAME formatted_read_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME formatted_read_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME formatted_read_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME formatted_read_05 LABELS gfortran llvm) RUN(NAME format_before_read_01 LABELS gfortran llvm) # LFortran extensions (lists, dicts, etc.) RUN(NAME list_test_01 LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME list_of_lists_test LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME set_test_01 LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME dict_test_01 LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME list_of_tuples_test LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran # Completely ported tests RUN(NAME list_test_01_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME list_test_02_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME list_test_03_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME list_test_04_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME list_test_06_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME list_test_08_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME list_test_09_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME tuple_test_01_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME tuple_test_02_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME tuple_test_03_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME tuple_test_04_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME tuple_test_concat_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME tuple_test_nested_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME dict_test_01_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME dict_test_02_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran # RUN(NAME dict_test_03_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran # Fix segault RUN(NAME dict_test_04_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME dict_test_07_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME dict_test_13_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran # LFortran extensions (union) RUN(NAME union_test_01 LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME union_test_02 LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME union_test_03 LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran # LFortran extensions (unsigned int) RUN(NAME test_unsigned LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran # LFortran extenstion (Python's str) RUN(NAME test_str LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME test_ord LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME test_rep LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME str_to_char LABELS gfortran llvm) # test for polymorphic select type RUN(NAME polymorphic_select_type_01 LABELS gfortran llvm) RUN(NAME polymorphic_select_type_02 LABELS gfortran llvm) RUN(NAME defined_op_match_01 LABELS gfortran llvm) #test for forward declaration of derived type RUN(NAME proc_ptr_nopass_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME proc_ptr_14 LABELS gfortran llvm) RUN(NAME proc_ptr_15 LABELS gfortran llvm) RUN(NAME proc_ptr_16 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME proc_ptr_17 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME write_substr_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME move_alloc_derived_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_section_assign_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intent_out_array_01 LABELS gfortran llvm) RUN(NAME intent_out_allocatable_component_dealloc LABELS gfortran llvm) RUN(NAME intent_out_struct_member_no_dealloc LABELS gfortran llvm) RUN(NAME intent_out_module_dealloc LABELS gfortran llvm) RUN(NAME array_shape_func_call LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_neg_extent_01 LABELS gfortran llvm) RUN(NAME ilp64_kind_arg_01 LABELS llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) # Type inference with := syntax RUN(NAME infer_walrus_01 LABELS llvm_infer NO_STD_F23) RUN(NAME infer_walrus_02 LABELS llvm_infer NO_STD_F23) RUN(NAME infer_walrus_03 LABELS llvm_infer NO_STD_F23) # Type inference with := syntax (arrays) RUN(NAME infer_walrus_array_01 LABELS llvm_infer NO_STD_F23) RUN(NAME infer_walrus_array_02 LABELS llvm_infer NO_STD_F23) RUN(NAME infer_walrus_array_03 LABELS llvm_infer NO_STD_F23) # Type inference with := syntax (derived types) RUN(NAME infer_walrus_struct_01 LABELS llvm_infer NO_STD_F23) RUN(NAME infer_walrus_struct_02 LABELS llvm_infer NO_STD_F23) RUN(NAME infer_walrus_struct_03 LABELS llvm_infer NO_STD_F23) # Type inference scope shadowing RUN(NAME infer_walrus_shadow_01 LABELS llvm_infer NO_STD_F23) RUN(NAME infer_walrus_shadow_02 LABELS llvm_infer NO_STD_F23) RUN(NAME infer_walrus_shadow_03 LABELS llvm_infer NO_STD_F23) RUN(NAME verify_intent_external_01 LABELS gfortran llvm EXTRAFILES verify_intent_external_01_mod1.f90 verify_intent_external_01_mod2.f90) # UTF-8 BOM handling RUN(NAME utf8_bom_01 LABELS gfortran llvm) RUN(NAME allocatable_lhs_finalization_01 LABELS llvm) RUN(NAME deferred_shape_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME assumed_type_01 LABELS gfortran llvm) RUN(NAME assumed_type_02 LABELS gfortran llvm EXTRAFILES assumed_type_02.c) RUN(NAME assumed_type_03 LABELS gfortran llvm EXTRAFILES assumed_type_03.c) RUN(NAME assumed_type_04 LABELS gfortran llvm EXTRAFILES assumed_type_04.c) RUN(NAME allocatable_cchar_01 LABELS gfortran llvm) RUN(NAME allocatable_nested_types_01 LABELS gfortran llvm) RUN(NAME allocatable_derived_array_01 LABELS gfortran llvm) RUN(NAME allocatable_component_assign_01 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocatable_component_reshape_unallocated_01 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocatable_component_unnamed_unallocated_01 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocatable_oob_01 FAIL LABELS gfortran llvm NO_FAST GFORTRAN_ARGS -fcheck=bounds) RUN(NAME sync_all_01 LABELS llvm) RUN(NAME sync_memory_01 LABELS llvm) RUN(NAME random_init_01 LABELS gfortran llvm) RUN(NAME random_init_02 LABELS gfortran llvm) RUN(NAME random_number_01 LABELS gfortran llvm) RUN(NAME random_seed_01 LABELS gfortran llvm) RUN(NAME pure_side_effects_01 LABELS gfortran llvm) RUN(NAME pure_side_effects_02 LABELS gfortran llvm) RUN(NAME set_exponent_01 LABELS gfortran llvm) RUN(NAME count_param_01 LABELS gfortran llvm) RUN(NAME char_param_reshape_01 LABELS gfortran llvm) RUN(NAME insertion_sort_01 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME iachar_achar_01 LABELS gfortran llvm) RUN(NAME stdlib_bitsets_01 LABELS gfortran llvm) RUN(NAME pure_side_effects_03 LABELS gfortran llvm) RUN(NAME merge_str_01 LABELS gfortran llvm) RUN(NAME io_direct_slash LABELS gfortran llvm) #test for coarray RUN(NAME coarray_01 LABELS gfortran llvm GFORTRAN_ARGS -fcoarray=single) RUN(NAME gpu_metal_01 LABELS gfortran llvm metal) RUN(NAME gpu_metal_02 LABELS gfortran llvm metal) RUN(NAME gpu_metal_03 LABELS gfortran llvm metal) RUN(NAME gpu_metal_04 LABELS gfortran llvm metal) RUN(NAME gpu_metal_05 LABELS gfortran llvm metal cuda) RUN(NAME gpu_metal_06 LABELS gfortran llvm metal cuda) RUN(NAME gpu_metal_07 LABELS gfortran llvm metal cuda) RUN(NAME gpu_metal_08 LABELS gfortran llvm metal cuda) RUN(NAME gpu_metal_09 LABELS gfortran llvm metal) RUN(NAME gpu_metal_10 LABELS gfortran llvm metal) RUN(NAME gpu_metal_11 LABELS gfortran llvm metal) RUN(NAME gpu_metal_12 LABELS gfortran llvm metal) RUN(NAME gpu_metal_13 LABELS gfortran llvm metal) RUN(NAME gpu_metal_14 LABELS gfortran llvm metal) RUN(NAME gpu_metal_15 LABELS gfortran llvm metal) RUN(NAME gpu_metal_16 LABELS gfortran llvm metal) RUN(NAME gpu_metal_17 LABELS gfortran llvm metal) RUN(NAME gpu_metal_18 LABELS gfortran llvm metal) RUN(NAME gpu_metal_19 LABELS gfortran llvm metal) RUN(NAME gpu_metal_20 LABELS gfortran llvm metal) RUN(NAME gpu_metal_21 LABELS llvm metal) RUN(NAME gpu_metal_22 LABELS gfortran llvm metal) RUN(NAME gpu_metal_23 LABELS gfortran llvm metal) RUN(NAME gpu_metal_24 LABELS gfortran llvm metal) RUN(NAME gpu_metal_25 LABELS gfortran llvm metal) RUN(NAME gpu_metal_26 LABELS gfortran llvm metal) RUN(NAME gpu_metal_27 LABELS gfortran llvm metal) RUN(NAME gpu_metal_28 LABELS gfortran llvm metal) RUN(NAME gpu_metal_29 LABELS gfortran llvm metal) RUN(NAME gpu_metal_30 LABELS gfortran llvm metal) RUN(NAME gpu_metal_31 LABELS gfortran llvm metal) RUN(NAME gpu_metal_32 LABELS gfortran llvm metal) RUN(NAME gpu_metal_33 LABELS gfortran llvm metal) RUN(NAME gpu_metal_34 LABELS gfortran llvm metal) RUN(NAME gpu_metal_35 LABELS gfortran llvm metal) RUN(NAME gpu_metal_36 LABELS gfortran llvm metal) RUN(NAME gpu_metal_37 LABELS gfortran llvm metal) RUN(NAME gpu_metal_38 LABELS gfortran llvm metal) RUN(NAME gpu_metal_39 LABELS gfortran llvm metal) RUN(NAME gpu_metal_40 LABELS gfortran llvm metal) RUN(NAME gpu_metal_41 LABELS gfortran llvm metal) RUN(NAME gpu_metal_42 LABELS gfortran llvm metal) RUN(NAME gpu_metal_43 LABELS gfortran llvm metal) RUN(NAME gpu_metal_44 LABELS gfortran llvm metal) RUN(NAME gpu_metal_45 LABELS gfortran llvm metal) RUN(NAME gpu_metal_46 LABELS gfortran llvm metal) RUN(NAME gpu_metal_47 LABELS gfortran llvm metal) RUN(NAME gpu_metal_48 LABELS gfortran llvm metal) RUN(NAME gpu_metal_49 LABELS gfortran llvm metal) RUN(NAME gpu_metal_50 LABELS gfortran llvm metal) RUN(NAME gpu_metal_51 LABELS gfortran llvm metal) RUN(NAME gpu_metal_52 LABELS gfortran llvm metal) RUN(NAME gpu_metal_53 LABELS gfortran llvm metal) RUN(NAME gpu_metal_54 LABELS gfortran llvm metal) RUN(NAME gpu_metal_55 LABELS gfortran llvm metal) RUN(NAME gpu_metal_56 LABELS gfortran llvm metal) RUN(NAME gpu_metal_57 LABELS gfortran llvm metal) RUN(NAME gpu_metal_58 LABELS gfortran llvm metal) RUN(NAME gpu_metal_59 LABELS gfortran llvm metal) RUN(NAME gpu_metal_60 LABELS gfortran llvm metal) RUN(NAME gpu_metal_61 LABELS gfortran llvm metal) RUN(NAME gpu_metal_62 LABELS llvm metal) RUN(NAME gpu_metal_63 LABELS gfortran llvm metal) RUN(NAME gpu_metal_64 LABELS gfortran llvm metal) RUN(NAME gpu_metal_65 LABELS gfortran llvm metal) RUN(NAME gpu_metal_66 LABELS gfortran llvm metal) RUN(NAME gpu_metal_67 LABELS gfortran llvm metal) RUN(NAME gpu_metal_68 LABELS gfortran llvm metal) RUN(NAME gpu_metal_69 LABELS gfortran llvm metal) RUN(NAME gpu_metal_70 LABELS gfortran llvm metal) RUN(NAME gpu_metal_71 LABELS gfortran llvm metal) RUN(NAME gpu_metal_72 LABELS gfortran llvm metal) RUN(NAME gpu_metal_73 LABELS gfortran llvm metal) RUN(NAME gpu_metal_74 LABELS gfortran llvm metal) RUN(NAME gpu_metal_75 LABELS gfortran llvm metal) RUN(NAME gpu_metal_76 LABELS gfortran llvm metal) RUN(NAME gpu_metal_77 LABELS gfortran llvm metal) RUN(NAME gpu_metal_78 LABELS gfortran llvm metal) RUN(NAME gpu_metal_79 LABELS gfortran llvm metal) RUN(NAME gpu_metal_80 LABELS gfortran llvm metal) RUN(NAME gpu_metal_81 LABELS gfortran llvm metal) RUN(NAME gpu_metal_82 LABELS gfortran llvm metal) RUN(NAME gpu_metal_83 LABELS gfortran llvm metal) RUN(NAME gpu_metal_84 LABELS gfortran llvm metal) RUN(NAME gpu_metal_85 LABELS gfortran llvm metal) RUN(NAME gpu_metal_86 LABELS gfortran llvm metal) RUN(NAME gpu_metal_87 LABELS gfortran llvm metal) RUN(NAME gpu_metal_88 LABELS gfortran llvm metal) RUN(NAME gpu_metal_89 LABELS gfortran llvm metal) RUN(NAME gpu_metal_90 LABELS gfortran llvm metal) RUN(NAME gpu_metal_91 LABELS gfortran llvm metal) RUN(NAME gpu_metal_92 LABELS gfortran llvm metal) RUN(NAME gpu_metal_93 LABELS gfortran llvm metal) RUN(NAME gpu_metal_94 LABELS gfortran llvm metal) RUN(NAME gpu_metal_95 LABELS gfortran llvm metal) RUN(NAME gpu_metal_96 LABELS gfortran llvm metal) RUN(NAME gpu_metal_97 LABELS gfortran llvm metal) RUN(NAME gpu_metal_98 LABELS gfortran llvm metal) RUN(NAME gpu_metal_99 LABELS gfortran llvm metal) RUN(NAME gpu_metal_100 LABELS gfortran llvm metal) RUN(NAME gpu_metal_101 LABELS gfortran llvm metal) RUN(NAME gpu_metal_102 LABELS gfortran llvm metal) RUN(NAME gpu_metal_103 LABELS gfortran llvm metal) RUN(NAME gpu_metal_104 LABELS gfortran llvm metal) RUN(NAME gpu_metal_105 LABELS gfortran llvm metal) RUN(NAME gpu_metal_106 LABELS gfortran llvm metal) RUN(NAME gpu_metal_107 LABELS gfortran llvm metal) RUN(NAME gpu_metal_108 LABELS gfortran llvm metal) RUN(NAME gpu_metal_109 LABELS gfortran llvm metal) RUN(NAME gpu_metal_110 LABELS gfortran llvm metal) RUN(NAME gpu_metal_111 LABELS gfortran llvm metal) RUN(NAME gpu_metal_112 LABELS gfortran llvm metal) RUN(NAME gpu_metal_113 LABELS gfortran llvm metal) RUN(NAME gpu_metal_114 LABELS gfortran llvm metal) RUN(NAME gpu_metal_115 LABELS gfortran llvm metal) RUN(NAME gpu_metal_116 LABELS gfortran llvm metal) RUN(NAME gpu_metal_117 LABELS gfortran llvm metal) RUN(NAME gpu_metal_118 LABELS gfortran llvm metal) RUN(NAME gpu_metal_119 LABELS gfortran llvm metal) RUN(NAME gpu_metal_120 LABELS gfortran llvm metal) RUN(NAME gpu_metal_121 LABELS gfortran llvm metal) RUN(NAME gpu_metal_122 LABELS gfortran llvm metal) RUN(NAME gpu_metal_123 LABELS gfortran llvm metal) RUN(NAME gpu_metal_124 LABELS gfortran llvm metal) RUN(NAME gpu_metal_125 LABELS gfortran llvm metal) RUN(NAME gpu_metal_126 LABELS gfortran llvm metal) RUN(NAME gpu_metal_127 LABELS gfortran llvm metal) RUN(NAME gpu_metal_128 LABELS gfortran llvm metal) RUN(NAME gpu_metal_129 LABELS gfortran llvm metal) RUN(NAME gpu_metal_130 LABELS gfortran llvm metal) RUN(NAME gpu_metal_131 LABELS gfortran llvm metal) RUN(NAME gpu_metal_132 LABELS gfortran llvm metal) RUN(NAME gpu_metal_133 LABELS gfortran llvm metal EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME gpu_metal_134 LABELS gfortran llvm metal EXTRAFILES gpu_metal_134_mod.f90 EXTRA_ARGS --separate-compilation) RUN(NAME gpu_metal_135 LABELS gfortran llvm metal EXTRAFILES gpu_metal_135_mod.f90 EXTRA_ARGS --separate-compilation) RUN(NAME gpu_metal_136 LABELS gfortran llvm metal EXTRAFILES gpu_metal_136_mod.f90 EXTRA_ARGS --separate-compilation) RUN(NAME gpu_metal_137 LABELS gfortran llvm metal) RUN(NAME gpu_metal_138 LABELS gfortran llvm metal) RUN(NAME gpu_metal_139 LABELS gfortran llvm metal) RUN(NAME gpu_metal_140 LABELS gfortran llvm metal EXTRAFILES gpu_metal_140_mod.f90 EXTRA_ARGS --separate-compilation) RUN(NAME gpu_metal_141 LABELS gfortran llvm metal) RUN(NAME gpu_metal_142 LABELS gfortran llvm metal EXTRAFILES gpu_metal_142_mod.f90 EXTRA_ARGS --separate-compilation) RUN(NAME gpu_metal_143 LABELS gfortran llvm metal) RUN(NAME gpu_metal_144 LABELS gfortran llvm metal EXTRAFILES gpu_metal_144_mod.f90 EXTRA_ARGS --separate-compilation) RUN(NAME gpu_metal_145 LABELS gfortran llvm metal) RUN(NAME gpu_metal_146 LABELS gfortran llvm metal) RUN(NAME gpu_metal_147 LABELS gfortran llvm metal EXTRAFILES gpu_metal_147_activation.f90 gpu_metal_147_neural_network.f90 EXTRA_ARGS --separate-compilation) RUN(NAME gpu_metal_148 LABELS gfortran llvm metal) RUN(NAME gpu_metal_149 LABELS gfortran llvm metal) RUN(NAME gpu_metal_150 LABELS gfortran llvm metal) RUN(NAME gpu_metal_151 LABELS gfortran llvm metal EXTRAFILES gpu_metal_151_dep.f90 gpu_metal_151_net.f90 EXTRA_ARGS --separate-compilation) RUN(NAME gpu_metal_152 LABELS gfortran llvm metal) RUN(NAME gpu_metal_153 LABELS gfortran llvm metal) RUN(NAME gpu_metal_154 LABELS gfortran llvm metal) RUN(NAME gpu_metal_155 LABELS gfortran llvm metal) RUN(NAME gpu_metal_156 LABELS gfortran llvm metal) RUN(NAME gpu_metal_157 LABELS gfortran llvm metal) RUN(NAME gpu_metal_158 LABELS gfortran llvm metal) RUN(NAME gpu_metal_159 LABELS gfortran llvm metal) RUN(NAME gpu_metal_160 LABELS gfortran llvm metal) RUN(NAME gpu_metal_161 LABELS gfortran llvm metal EXTRAFILES gpu_metal_161_mod.f90 EXTRA_ARGS --separate-compilation) RUN(NAME gpu_metal_162 LABELS gfortran llvm metal) RUN(NAME gpu_metal_163 LABELS gfortran llvm metal) RUN(NAME gpu_metal_164 LABELS gfortran llvm metal) RUN(NAME gpu_metal_165 LABELS gfortran llvm metal) RUN(NAME gpu_metal_166 LABELS gfortran llvm metal) RUN(NAME gpu_metal_167 LABELS gfortran llvm metal) RUN(NAME gpu_metal_168 LABELS gfortran llvm metal) RUN(NAME gpu_metal_169 LABELS gfortran llvm metal) RUN(NAME gpu_metal_170 LABELS gfortran llvm metal) RUN(NAME gpu_metal_171 LABELS gfortran llvm metal) RUN(NAME gpu_metal_172 LABELS gfortran llvm metal) RUN(NAME gpu_metal_173 LABELS gfortran llvm metal) RUN(NAME gpu_metal_174 LABELS gfortran llvm metal) RUN(NAME gpu_metal_175 LABELS gfortran llvm metal) RUN(NAME gpu_metal_176 LABELS gfortran llvm metal) RUN(NAME gpu_metal_177 LABELS gfortran llvm metal) RUN(NAME gpu_metal_178 LABELS gfortran llvm metal) RUN(NAME gpu_metal_179 LABELS gfortran llvm metal) RUN(NAME gpu_metal_180 LABELS gfortran llvm metal) RUN(NAME gpu_metal_181 LABELS gfortran llvm metal) RUN(NAME gpu_metal_182 LABELS gfortran llvm metal) RUN(NAME gpu_metal_183 LABELS gfortran llvm metal) RUN(NAME gpu_metal_184 LABELS gfortran llvm metal) RUN(NAME gpu_metal_185 LABELS gfortran llvm metal) RUN(NAME gpu_metal_186 LABELS gfortran llvm metal) RUN(NAME gpu_metal_187 LABELS gfortran llvm metal) RUN(NAME gpu_metal_188 LABELS gfortran llvm metal) RUN(NAME gpu_metal_189 LABELS gfortran llvm metal) RUN(NAME gpu_metal_190 LABELS gfortran llvm metal) RUN(NAME gpu_metal_191 LABELS gfortran llvm metal EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME gpu_metal_192 LABELS gfortran llvm metal) RUN(NAME gpu_metal_193 LABELS gfortran llvm metal) RUN(NAME gpu_metal_194 LABELS gfortran llvm metal) RUN(NAME gpu_metal_195 LABELS gfortran llvm metal) lfortran-0.63.0/integration_tests/associate_15.f900000664000175000017500000000073315174404631022170 0ustar alastairalastairmodule list_module type :: list type(list), pointer :: child => null() contains procedure :: method end type list contains subroutine method(self) class(list), intent(inout) :: self if( associated(self%child) ) error stop write(*,*) 'associated: ', associated(self%child) end subroutine method end module list_module program associate_15 use list_module type(list) :: lst call lst%method() end program associate_15 lfortran-0.63.0/integration_tests/file_56.f900000664000175000017500000000244115174404631021137 0ustar alastairalastairprogram read_fmt9 implicit none real :: r1, r2, r3 double precision :: d1, d2, d3, d4 open (10, file='file_56_fort.10', status='replace', form='formatted') ! Test E format write (10,'(a13)') '+0.339567E+02' write (10,'(a13)') ' + .339567+2' ! Not read correctly write (10,'(a13)') ' + 3.395670E1' rewind (10) r1 = 0.0; r2 = 0.0; r3 = 0.0 read (10, '(e13.6)') r1, r2, r3 write (*, '(a,e17.6,a)') 'r1 =', r1 if(abs (r1-33.9567) >= 0.01) error stop write (*, '(a,e17.6,a)') 'r2 =', r2 if(abs (r2-33.9567) >= 0.01) error stop write (*, '(a,e17.6,a)') 'r3 =', r3 if(abs (r3-33.9567) >= 0.01) error stop ! Test F format rewind (10) write (10,'(a18)') ' 0.96295134244D+04', ' .96295134244D04' write (10,'(a18)') ' 0.96295134244+4' ! Not read correctly write (10,'(a18)') ' +.96295134244D4' rewind (10) d1 = 0.0; d2 = 0.0; d3 = 0.0 read (10, '(f18.11)') d1, d2, d3, d4 write (*, '(a,f18.11,a)') 'd1 =', d1 if(abs (d1-9629.5134244d0) >= 0.01) error stop write (*, '(a,f18.11,a)') 'd2 =', d2 if(abs (d2-9629.5134244d0) >= 0.01) error stop write (*, '(a,f18.11,a)') 'd3 =', d3 if(abs (d3-9629.5134244d0) >= 0.01) error stop write (*, '(a,f18.11,a)') 'd4 =', d4 if(abs (d4-9629.5134244d0) >= 0.01) error stop end program lfortran-0.63.0/integration_tests/intrinsics_335.f900000664000175000017500000000147315174404631022471 0ustar alastairalastair program intrinsics_335 integer(4) :: i1 integer(8) :: i2 real(4) :: r1 real(8) :: r2 complex(4) :: c1 complex(8) :: c2 complex(8) :: arr2(3) = [(5._8, 7._8), (8.2_8, 7.12_8), (1.2_8, 3.4_8)] i1 = 2 i2 = 5 r1 = 2.0 r2 = 5._8 c1 = (1.0, 2.0) c2 = (1._8, 2._8) print *, kind(real(i1)) if (kind(real(i1)) /= 4) error stop print *, kind(real(i2)) if (kind(real(i2)) /= 4) error stop print *, kind(real(r1)) if (kind(real(r1)) /= 4) error stop print *, kind(real(r2)) if (kind(real(r2)) /= 4) error stop print *, kind(real(c1)) if (kind(real(c1)) /= 4) error stop print *, kind(real(c2)) if (kind(real(c2)) /= 8) error stop print *, kind(real(arr2)) if (kind(real(arr2)) /= 8) error stop end program lfortran-0.63.0/integration_tests/select_rank_04.f900000664000175000017500000000060715174404631022505 0ustar alastairalastairprogram select_rank_04 implicit none integer :: a(2) = [4, 2] call check(a) contains subroutine check(x) integer, intent(in) :: x(..) integer :: l1(1) integer :: l2(2) select rank(x) rank (1) print *, x rank (2) print *, x end select end subroutine check end program select_rank_04lfortran-0.63.0/integration_tests/format_14.f900000664000175000017500000000304415174404631021502 0ustar alastairalastair! test "T"/"TL"/"TR" format specifier program format_14 implicit none character(len=30) wr character(len=20) :: hello_god hello_god = "Hello God!" ! Test "T" format specifier (tab) write(wr, '(I5, T6, F5.2)') 1, sqrt(real(1)) print *, wr if (wr /= " 1 1.00") error stop write(wr, '(I5, T6, F5.2)') 2, sqrt(real(2)) print *, wr if (wr /= " 2 1.41") error stop write(wr, '(I5, T10, F5.2)') 1, sqrt(real(1)) print *, wr if (wr /= " 1 1.00") error stop write(wr, '(I5, T10, F5.2)') 2, sqrt(real(2)) print *, wr if (wr /= " 2 1.41") error stop write(wr, '(I4, T5, I4)') 2, 1 print *, wr if (wr /= " 2 1") error stop write(wr, '(I4, T5, I4, T10, I5)') 2, 1, 1 print *, wr if (wr /= " 2 1 1") error stop ! Test "TL" format specifier (tab left) write(wr, '(I4, T10, TL2, F5.2)') 5, sqrt(real(5)) print *, wr if (wr /= " 5 2.24") error stop write(wr, '(I4, T10, TL3, F5.2)') 6, sqrt(real(6)) print *, wr if (wr /= " 6 2.45") error stop write(wr, "(TR7, TL3, A)") hello_god print *, wr if (wr /= " Hello God!") error stop ! Test "TR" format specifier (tab right) write(wr, '(I4, TR2, F5.2)') 3, sqrt(real(3)) print *, wr if (wr /= " 3 1.73") error stop write(wr, '(I4, TR4, F5.2)') 4, sqrt(real(4)) print *, wr if (wr /= " 4 2.00") error stop write(wr, "(TR5, A)") hello_god print *, wr if (wr /= " Hello God!") error stop end program format_14 lfortran-0.63.0/integration_tests/write_17.f900000664000175000017500000000140515174404631021346 0ustar alastairalastairprogram write_17 real:: x(3) = [ 1.1, 2.2, 3.3 ] integer i character(4)::cx1(3), cx2(2), cx3(3) = " 6.0" ! Check full-array assignment write(cx1,"(F4.1)") x print "(3A)", cx1 if (cx1(1) /= " 1.1" .and. cx1(2) /= " 2.2" .and. cx1(3) /= " 3.3") error stop ! Check do-loops on RHS write(cx2,"(F4.1)") (x(i),i=2,3) print "(3A)", cx2 if (cx2(1) /= " 2.2" .and. cx2(2) /= " 3.3") error stop ! Check do-loops on LHS and RHS, with different bounds write(cx3(2:3),"(F4.1)") (x(i), i=1,2) print "(3A)", cx3 if (cx3(1) /= " 6.0" .and. cx3(2) /= " 1.1" .and. cx3(3) /= " 2.2") error stop write(cx3(2:3),"(F4.1)") (x(i), i=2,3) print "(3A)", cx3 if (cx3(1) /= " 6.0" .and. cx3(2) /= " 2.2" .and. cx3(3) /= " 3.3") error stop end program write_17 lfortran-0.63.0/integration_tests/read_07_data.txt0000664000175000017500000000001115174404631022330 0ustar alastairalastairABCDEF T lfortran-0.63.0/integration_tests/intrinsics_351.f900000664000175000017500000000061715174404631022466 0ustar alastairalastairprogram intrinsics_351 real :: xx(3,20) real :: x(20) integer :: j, n integer, allocatable :: i(:) integer :: ii(4,4) allocate(i(4)) i = [1,2,3,4] ii = spread(i, dim = 2, ncopies=4) print *, sum(ii) if ( sum(ii) /= 40 ) error stop do j = 1, 20 xx(:,j) = j x(j) = j end do n = 3 xx = xx / spread(x, dim = 1, ncopies = n) print *, xx if (any(xx /= 1)) error stop end program intrinsics_351 lfortran-0.63.0/integration_tests/arrays_27.f900000664000175000017500000000057115174404631021521 0ustar alastairalastairprogram arrays_27 implicit none integer :: x(3) = [1, 2, 3] integer :: m = 3 call f(3, x) call f(m, x) contains subroutine f(n, x) integer, intent(in) :: x(n) integer :: n if (n /= 3) error stop if (x(1) /= 1) error stop if (x(3) /= 3) error stop end subroutine end program lfortran-0.63.0/integration_tests/intrinsics_386.f900000664000175000017500000000021615174404631022471 0ustar alastairalastairprogram main complex :: x(2) = [(1.0, 2.0), (3.0, 4.0)] print *, product(x) if (product(x) /= (-5.0, 10.0)) error stop end programlfortran-0.63.0/integration_tests/string_51.f900000664000175000017500000000031415174404631021516 0ustar alastairalastairprogram string_51 implicit none character(len=4) :: array(2) print*, len(array) if (len(array) /= 4) error stop print*, len(array(1)) if (len(array(1)) /= 4) error stop end programlfortran-0.63.0/integration_tests/submodule_04.f900000664000175000017500000000203115174404631022203 0ustar alastairalastairmodule mod_submodule_04 implicit none private public :: open_hashmap_type type :: open_hashmap_type contains procedure :: map_entry => map_open_entry end type open_hashmap_type interface module subroutine map_open_entry(map, key) class(open_hashmap_type), intent(inout) :: map integer, intent(inout) :: key end subroutine map_open_entry end interface end module mod_submodule_04 submodule(mod_submodule_04) submod_submodule_04 implicit none contains module subroutine map_open_entry(map, key) class(open_hashmap_type), intent(inout) :: map integer, intent(inout) :: key integer, parameter :: i = 5 key = i end subroutine map_open_entry end submodule submod_submodule_04 program submodule_04 use mod_submodule_04, only : open_hashmap_type implicit none type(open_hashmap_type) :: map integer :: key = 1 call map % map_entry( key ) print *, key if (key /= 5) error stop end programlfortran-0.63.0/integration_tests/openmp_22.f900000664000175000017500000000073615174404631021514 0ustar alastairalastairprogram openmp_22 use omp_lib integer, parameter :: n = 100000 integer :: i real, allocatable :: b(:) allocate(b(n)) call omp_set_num_threads(4) !$omp parallel shared(b) private(i) !$omp do do i = 1, n b(i) = 12.91 end do !$omp end do !$omp end parallel print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end program lfortran-0.63.0/integration_tests/intrinsics_137.f900000664000175000017500000000376015174404631022472 0ustar alastairalastairprogram intrinsics_137 use iso_fortran_env, only: int32, int64 implicit none integer, parameter :: sp = kind(0.0) integer, parameter :: dp = kind(0.d0) integer, parameter :: i1 = huge(0) integer(8), parameter :: i2 = huge(12_dp) real, parameter :: i3 = huge(1.1_sp) real(8), parameter :: i4 = huge(1.5_dp) integer, parameter :: ar1(3) = huge([1, 2, 45]) real, parameter :: ar2(3) = huge([1.0, 2.0, 45.0]) integer(int32) :: i integer(int64) :: j real(sp) :: r real(dp) :: d integer :: arr1(3) = [11, 13, 7] real :: arr2(3) = [11.0, 13.0, 7.0] i = 0 j = 1 r = 0.0_sp d = 0.0_dp print *, i1 if (i1 /= 2147483647) error stop print *, i2 if (i2 /= 9223372036854775807_int64) error stop print *, i3 if (abs((i3 - 3.40282347e+38_sp) / 3.40282347e+38_sp) > 1e-6_sp) error stop print *, i4 if (abs(i4 - 1.79769313486231571e+308_dp) > 1e-12_dp) error stop print *, ar1 if (any(ar1 /= [2147483647, 2147483647, 2147483647])) error stop print *, ar2 if (any(abs((ar2 - [3.40282347e+38_sp, 3.40282347e+38_sp, 3.40282347e+38_sp]) / 3.40282347e+38_sp) > 1e-6_sp)) error stop print *, huge(i) if (huge(i) /= 2147483647_int32) error stop print*, huge(j) if (huge(j) /= 9223372036854775807_int64) error stop print*, huge(r) if ((huge(r) - 3.40282347e+38) / 3.40282347e+38 > 1e-8_sp) error stop print*, huge(d) if (abs(huge(d) - 1.79769313486231571e+308_dp) > 1e-8_dp) error stop print *, kind(huge(1)) if (kind(huge(1)) /= int32) error stop print *, kind(huge(1.0)) if (kind(huge(1.0)) /= sp) error stop print *, kind(huge(1.0_dp)) if (kind(huge(1.0_dp)) /= dp) error stop print *, huge(arr1) if (any(huge(arr1) /= [2147483647, 2147483647, 2147483647])) error stop print *, huge(arr2) if (any(abs((huge(arr2) - [3.40282347e+38, 3.40282347e+38, 3.40282347e+38]) / 3.40282347e+38) > 1e-6)) error stop end program intrinsics_137 lfortran-0.63.0/integration_tests/subroutines_10.f900000664000175000017500000000073415174404631022573 0ustar alastairalastairprogram subroutines_10 implicit none real :: x call subroutines_10_sub(x, 3, *100, *200) if (x < 0 .and. x > 10) error stop stop 100 print*, "Negative input value" error stop 200 print*, "Input value too large" error stop end program subroutines_10 subroutine subroutines_10_sub(x, i, *, *) real, intent(out) :: x integer, intent(in) :: i if (i<0) return 1 if (i>10) return 2 x = i end subroutine subroutines_10_sub lfortran-0.63.0/integration_tests/data_implied_do_08.f900000664000175000017500000000074715174404631023322 0ustar alastairalastairmodule data_implied_do_08_mod implicit none integer :: i integer(4) :: kr(2,2) data ( kr(i,1), i=1,2 ) / 1, 0 / data ( kr(i,2), i=1,2 ) / 0, 1 / end module data_implied_do_08_mod program data_implied_do_08 use data_implied_do_08_mod implicit none print *, kr(1,1), kr(2,1), kr(1,2), kr(2,2) if (kr(1,1) /= 1) error stop if (kr(2,1) /= 0) error stop if (kr(1,2) /= 0) error stop if (kr(2,2) /= 1) error stop end program data_implied_do_08 lfortran-0.63.0/integration_tests/templates/0000775000175000017500000000000015174404631021363 5ustar alastairalastairlfortran-0.63.0/integration_tests/templates/sort.f900000664000175000017500000001041115174404631022667 0ustar alastairalastairmodule sort_m implicit none private public :: sort_tmpl requirement comparable(T, lt, gt) type, deferred :: T elemental function lt(lhs, rhs) type(T), intent(in) :: lhs, rhs logical :: lt end function elemental function gt(lhs, rhs) type(T), intent(in) :: lhs, rhs logical :: gt end function end requirement template sort_tmpl(T, lt, gt) private public :: sorted_order, sorted, sort require :: comparable(T, lt, gt) generic :: operator(<) => lt generic :: operator(>) => gt generic :: sorted_order => sorted_order_ generic :: sorted => sorted_ generic :: sort => sort_ contains pure recursive function sorted_order_(array) result(sorted_indices) type(T), intent(in) :: array(:) integer, allocatable :: sorted_indices(:) integer :: i associate(n => size(array)) select case (n) case (0) allocate(sorted_indices(0)) case (1) sorted_indices = [1] case (2) if (array(1) > array(2)) then sorted_indices = [2, 1] else sorted_indices = [1, 2] end if case default associate(pivot => (n/2 + 1), indices => [(i, i = 1, n)]) associate( & less_than_pivot => array < array(pivot), & greater_than_pivot => array > array(pivot)) associate( & indices_less_than_pivot => pack(indices, less_than_pivot), & indices_greater_than_pivot => pack(indices, greater_than_pivot), & indices_equal_pivot => pack(indices, .not.(less_than_pivot.or.greater_than_pivot))) associate( & sorted_less_than => sorted_order_(array(indices_less_than_pivot)), & sorted_greater_than => sorted_order_(array(indices_greater_than_pivot))) sorted_indices = & [ indices_less_than_pivot(sorted_less_than) & , indices_equal_pivot & , indices_greater_than_pivot(sorted_greater_than) & ] end associate end associate end associate end associate end select end associate end function pure function sorted_(array) type(T), intent(in) :: array(:) type(T), allocatable :: sorted_ sorted_ = array(sorted_order(array)) end function pure subroutine sort_(array) type(T), intent(inout) :: array(:) array = sorted(array) end subroutine end template end module program test_sort use sort_m, only: sort_tmpl implicit none instantiate sort_tmpl(real, operator(<), operator(>)), only: sorted_order instantiate sort_tmpl(integer, operator(<), operator(>)), only: sorted_order instantiate sort_tmpl(real, operator(>), operator(<)), only: reverse_sorted_order => sorted_order associate(real_order => sorted_order([3.0, 2.0, 2.0, 1.0])) if (.not.all(real_order == [4, 2, 3, 1])) then print *, "real_order was ", real_order, " but should have been ", [4, 2, 3, 1] end if end associate associate(int_order => sorted_order([3, 2, 2, 1])) if (.not.all(int_order == [4, 2, 3, 1])) then print *, "int_order was ", int_order, " but should have been ", [4, 2, 3, 1] end if end associate associate(reverse_order => reverse_sorted_order([1.0, 2.0, 2.0, 3.0])) if (.not.all(reverse_order == [4, 2, 3, 1])) then print *, "reverse_order was ", reverse_order, " but should have been ", [4, 2, 3, 1] end if end associate end programlfortran-0.63.0/integration_tests/templates/add.f900000664000175000017500000000225415174404631022436 0ustar alastairalastairmodule template_add_m implicit none private public :: add_t requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = F(x, y) end function end template contains subroutine test_template() instantiate add_t(real, operator(+)), only: add_real => add_generic instantiate add_t(integer, operator(+)), only: add_integer => add_generic real :: x, y integer :: a, b x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) if (abs(add_real(x, y) - 12.3) > 1e-5) error stop a = 5 b = 9 print*, "The result is ", add_integer(a, b) if (add_integer(a, b) /= 14) error stop end subroutine end module program template_add use template_add_m implicit none call test_template() end program template_add lfortran-0.63.0/integration_tests/templates/sum.f900000664000175000017500000000316415174404631022513 0ustar alastairalastairmodule sum_m private public :: sum_t requirement R(T, Tadd, Tzero) type :: T; end type function Tadd(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function function Tzero() result(z) type(T) :: z end function end requirement template sum_t(T, Tadd, Tzero) require :: R(T, Tadd, Tzero) private public :: sum_generic contains function sum_generic(x) result(r) type(T), intent(in) :: x(:) type(T) :: r integer :: i r = Tzero() do i = 1, size(x) r = Tadd(r, x(i)) end do end function end template contains real function real_add(x, y) result(z) real, intent(in) :: x, y z = x + y end function real function real_zero() result(z) z = 0 end function integer function int_add(x, y) result(z) integer, intent(in) :: x, y z = x + y end function integer function int_zero() result(z) z = 0 end function subroutine test_template() instantiate sum_t(real, real_add, real_zero), only: sum_real => sum_generic instantiate sum_t(integer, int_add, int_zero), only: sum_integer => sum_generic real :: x(10) integer :: y(10) x = 1 print*, "The result is ", sum_real(x) if (abs(sum_real(x) - 10.0) > 1e-5) error stop y = 1 print*, "The result is ", sum_integer(a, b) if (sum_integer(a, b) /= 10) error stop end subroutine end module program sum use sum_m, only: test_template call test_template() end program lfortran-0.63.0/integration_tests/implied_do_loops28.f900000664000175000017500000000423215174404631023401 0ustar alastairalastairmodule mre_types_m implicit none type :: operands_t real :: actual, expected end type type :: diagnosis_t logical :: passed = .false. character(len=:), allocatable :: diagnostics_string end type type :: tensor_t real, allocatable :: vals(:) contains procedure :: values end type interface operator(.approximates.) module procedure approx end interface interface operator(.within.) module procedure within_tol end interface interface operator(.all.) module procedure all_pass end interface contains pure function values(self) result(v) class(tensor_t), intent(in) :: self real, allocatable :: v(:) v = self%vals end function elemental function approx(a, b) result(ops) real, intent(in) :: a, b type(operands_t) :: ops ops%actual = a ops%expected = b end function elemental function within_tol(ops, tol) result(res) type(operands_t), intent(in) :: ops real, intent(in) :: tol type(diagnosis_t) :: res res%passed = abs(ops%actual - ops%expected) <= tol end function pure function all_pass(diagnoses) result(res) type(diagnosis_t), intent(in) :: diagnoses(:) type(diagnosis_t) :: res res%passed = all(diagnoses%passed) end function end module mre_types_m program implied_do_loops28 use mre_types_m implicit none type(tensor_t), allocatable :: inputs(:), outputs(:) type(diagnosis_t) :: test_result, diagnoses_i integer :: i, n real, parameter :: tolerance = 1.0e-6 n = 5 allocate(inputs(n), outputs(n)) do i = 1, n inputs(i) = tensor_t([real(i), real(2*i)]) outputs(i) = tensor_t([real(i), real(2*i)]) end do do i = 1, n diagnoses_i = all_pass(outputs(i)%values() .approximates. inputs(i)%values() .within. tolerance) if (.not. diagnoses_i%passed) error stop end do test_result = .all. [(outputs(i)%values() .approximates. inputs(i)%values() .within. tolerance, i=1,n)] if (.not. test_result%passed) error stop end program implied_do_loops28lfortran-0.63.0/integration_tests/associate_34.f900000664000175000017500000000166715174404631022200 0ustar alastairalastair! Test: intrinsic // inside associate when user-defined operator(//) is in scope module associate_34_mod implicit none type :: string_t character(len=:), allocatable :: s end type interface operator(//) elemental module function char_cat_string(lhs, rhs) result(res) character(len=*), intent(in) :: lhs type(string_t), intent(in) :: rhs type(string_t) :: res end function end interface end module submodule (associate_34_mod) associate_34_sub implicit none contains elemental module function char_cat_string(lhs, rhs) result(res) character(len=*), intent(in) :: lhs type(string_t), intent(in) :: rhs type(string_t) :: res res%s = lhs // rhs%s end function end submodule program associate_34 use associate_34_mod implicit none character(len=:), allocatable :: a a = "world" associate(str => a) if ("hello " // str /= "hello world") error stop end associate end program lfortran-0.63.0/integration_tests/intrinsics_111.f900000664000175000017500000000037115174404631022455 0ustar alastairalastairprogram intrinsics_111 integer :: a, b, result a = 10 b = 7 if ( .not. min( a1 = a, a2 = b ) == 7 ) error stop if ( .not. min( a, a2 = b ) == 7 ) error stop if ( .not. min( a, b ) == 7 ) error stop end program intrinsics_111 lfortran-0.63.0/integration_tests/modules_16.f900000664000175000017500000000016615174404631021666 0ustar alastairalastair! This is a test for https://gitlab.com/lfortran/lfortran/-/issues/532 program modules_16 use modules_16b end program lfortran-0.63.0/integration_tests/arrays_41.f900000664000175000017500000000101315174404631021505 0ustar alastairalastairprogram arrays_41 use iso_fortran_env, only: dp => real64 integer, parameter :: n = 1000 integer, parameter :: m = 1000 integer :: i, j integer, dimension(n,m) :: x real(dp) :: res x = 18 res = var_2_iint8_dp(x, 1) print *, res if (abs(res - 18000000.000000000) > 1e-16) error stop contains function var_2_iint8_dp(x, dim) result(res) use iso_fortran_env, only: dp => real64 integer, intent(in) :: x(:,:) integer, intent(in) :: dim real(dp) :: res res = sum(sum(real(x, dp), dim)) end function var_2_iint8_dp end program lfortran-0.63.0/integration_tests/gpu_metal_114.f900000664000175000017500000000116515174404631022252 0ustar alastairalastairmodule gpu_metal_114_m implicit none type :: t contains procedure :: eval => my_eval end type contains elemental function my_eval(self, x) result(y) class(t), intent(in) :: self real, intent(in) :: x real :: y y = x * 2.0 end function end module program gpu_metal_114 use gpu_metal_114_m implicit none type(t) :: obj integer :: i real :: z(3), a(3) z = [1.0, 2.0, 3.0] a = 0.0 do concurrent (i = 1:1) a = obj%eval(z) end do if (abs(a(1) - 2.0) > 1e-6) error stop if (abs(a(2) - 4.0) > 1e-6) error stop if (abs(a(3) - 6.0) > 1e-6) error stop print *, a end program lfortran-0.63.0/integration_tests/derived_types_128.f900000664000175000017500000000253115174404631023146 0ustar alastairalastairmodule derived_types_128_mod implicit none type :: point real :: x, y contains procedure, pass(self) :: add_default procedure, pass(pt) :: add_named end type point contains function add_default(self, other) result(res) class(point), intent(in) :: self, other type(point) :: res res%x = self%x + other%x res%y = self%y + other%y end function function add_named(scale, pt) result(res) real, intent(in) :: scale class(point), intent(in) :: pt type(point) :: res res%x = pt%x * scale res%y = pt%y * scale end function end module derived_types_128_mod program derived_types_128 use derived_types_128_mod implicit none type(point) :: p1, p2, result p1 = point(1.0, 2.0) p2 = point(3.0, 4.0) ! pass(self) where self is the first argument (default position) result = p1%add_default(p2) if (abs(result%x - 4.0) > 1e-6) error stop if (abs(result%y - 6.0) > 1e-6) error stop ! pass(pt) where pt is the second argument ! p1%add_named(10.0) should pass: add_named(10.0, p1) ! i.e., scale=10.0 and pt=p1 result = p1%add_named(10.0) if (abs(result%x - 10.0) > 1e-6) error stop if (abs(result%y - 20.0) > 1e-6) error stop print *, "All tests passed." end program derived_types_128 lfortran-0.63.0/integration_tests/allocate_49.f900000664000175000017500000000273115174404631022010 0ustar alastairalastairprogram allocate_49 ! Test allocate with mold= where the mold is an assumed-rank ! array inside a select rank block. implicit none real, allocatable :: a(:,:) integer, allocatable :: b(:) real, allocatable :: c(:,:) real :: m(2,3) integer :: n(5) m = 1.0 n = 42 ! Test 1: mold is assumed-rank, target is fixed-rank call alloc_with_mold_real(a, m) if (size(a, 1) /= 2) error stop if (size(a, 2) /= 3) error stop ! Test 2: mold is assumed-rank, target is fixed-rank (integer) call alloc_with_mold_int(b, n) if (size(b) /= 5) error stop ! Test 3: both target and mold are assumed-rank call alloc_both_assumed(c, m) if (size(c, 1) /= 2) error stop if (size(c, 2) /= 3) error stop print *, "PASS" contains subroutine alloc_with_mold_real(x, mold_arg) real, allocatable, intent(inout) :: x(:,:) real, intent(in) :: mold_arg(..) select rank(mold_arg) rank(2) allocate(x, mold=mold_arg) end select end subroutine subroutine alloc_with_mold_int(x, mold_arg) integer, allocatable, intent(inout) :: x(:) integer, intent(in) :: mold_arg(..) select rank(mold_arg) rank(1) allocate(x, mold=mold_arg) end select end subroutine subroutine alloc_both_assumed(x, mold_arg) real, allocatable, intent(inout) :: x(..) real, intent(in) :: mold_arg(..) select rank(x) rank(2) select rank(mold_arg) rank(2) allocate(x, mold=mold_arg) end select end select end subroutine end program lfortran-0.63.0/integration_tests/file_09.f900000664000175000017500000000115115174404631021132 0ustar alastairalastairprogram file_09 implicit none integer :: u = 11, i, j character :: arr(2, 2) character, allocatable :: alloc_arr(:, :) print *, "1" open(u, file="file_01_data.txt", form="unformatted", access="stream", status="old") read(u) arr close(u) if (arr(1, 1) /= '1' .or. arr(1, 2) /= '1') error stop print *, arr open(u, file="file_01_data.txt", form="unformatted", access="stream", status="old") allocate(alloc_arr(2, 2)) read(u) alloc_arr close(u) if (alloc_arr(2, 1) /= '0' .or. alloc_arr(2, 2) /= '3') error stop print *, alloc_arr end program file_09 lfortran-0.63.0/integration_tests/read_02.f900000664000175000017500000000122315174404631021117 0ustar alastairalastairprogram read_02 implicit none integer :: i character(len=10) :: tmp integer :: u open(newunit=u, file="read_02_data.txt") read(u, '(A)', iostat=i) tmp print *, i, tmp, len(tmp) if (trim(tmp) /= "aa") error stop read(u, '(A)', iostat=i) tmp print *, i, tmp, len(tmp) if (trim(tmp) /= "bb") error stop read(u, '(A)', iostat=i) tmp print *, i, tmp, len(tmp) if (trim(tmp) /= "cc") error stop read(u, '(A)', iostat=i) tmp print *, i, tmp, len(tmp) if (trim(tmp) /= "dd") error stop read(u, '(A)', iostat=i) tmp print *, i, tmp, len(tmp) if (trim(tmp) /= "ee") error stop close(u) end program lfortran-0.63.0/integration_tests/select_type_07.f900000664000175000017500000000335415174404631022540 0ustar alastairalastairprogram select_type_07 implicit none class(*), allocatable :: obj type :: structType integer :: code character(len=20) :: message end type structType type(structType) :: err integer :: y = 0 call print_obj(42, y) if (y /= 1) error stop call print_obj(3.14, y) if (y /= 2) error stop call print_obj("Hello", y) if (y /= 3) error stop err%code = 500 err%message = "Server Error" call print_obj(err, y) if (y /= 4) error stop contains subroutine print_obj(x, y) class(*), intent(in) :: x integer, intent(out) :: y integer :: val1 real :: val2 doubleprecision :: dbval character(len=:), allocatable :: val3 type(structType) :: val4 select type(x) type is (integer) val1 = x dbval = x print *, val1 if (val1 /= 42) error stop if (dbval /= 42.0d0) error stop y = 1 type is (real) val2 = x dbval = x print *, val2 if (val2 /= 3.14) error stop if (dbval /= 3.14) error stop y = 2 type is (character(*)) call check_char(x, y) type is (structType) val4 = x print *, val4%code print *, val4%message if (val4%code /= 500) error stop if (val4%message /= "Server Error") error stop y = 4 end select end subroutine print_obj subroutine check_char(val, y) character(len=*) :: val integer, intent(out) :: y print *, val if (val /= "Hello") error stop y = 3 end subroutine check_char end program select_type_07 lfortran-0.63.0/integration_tests/statement_06.f900000664000175000017500000000055515174404631022223 0ustar alastairalastairSUBROUTINE st_fn_bug2() COMPLEX ZDUM,ZDUM1,ZDUM2,CSIGN1 REAL CABS1 CABS1(ZDUM) = ABS(REAL(ZDUM)) + ABS(AIMAG(ZDUM)) CSIGN1(ZDUM1,ZDUM2) = CABS1(ZDUM1)*(ZDUM2/CABS1(ZDUM2)) ZDUM1 = (1.0, 2.0) ZDUM2 = (2.0, 3.0) print *, CABS1(CSIGN1(ZDUM1,ZDUM2)) if ( abs(CABS1(CSIGN1(ZDUM1,ZDUM2)) - 3.0) > 1e-8 ) error stop END program statement_02 call st_fn_bug2() end program lfortran-0.63.0/integration_tests/modules_30_module3.f900000664000175000017500000000116415174404631023311 0ustar alastairalastairmodule fpm_manifest_executable_modules_30 implicit none public :: executable_config type :: executable_config character(len=:), allocatable :: name character(len=:), allocatable :: source_dir character(len=:), allocatable :: main end type executable_config contains subroutine default_executable(self, name) type(executable_config), intent(out) :: self character(len=*), intent(inout) :: name self%name = name self%source_dir = "app" self%main = "main.f90" end subroutine default_executable end module fpm_manifest_executable_modules_30 lfortran-0.63.0/integration_tests/intrinsics_366.f900000664000175000017500000000201015174404631022461 0ustar alastairalastairprogram intrinsics_366 implicit none integer :: x, v, ntz, y, i integer, parameter :: ITRLim = 80 ! Testing Collatz sequence using bit intrinsics ! Example1: using shiftl and ibclr x = 37 do i = 1, ITRLim if (btest(x, 0)) then ! odd v = shiftl(x, 2) - ibclr(x, 0) ! v = 4*x - (x-1) else v = x end if ntz = trailz(v) y = shiftr(v, ntz) print '(3i8)', x, v, y x = y if (x == 1) exit end do if (v /= 16) error stop if (y /= 1) error stop ! Example2: using simple 3x + 1 x = 37 do i = 1, ITRLim if (btest(x, 0)) then ! odd v = 3 * x + 1 else v = x end if ntz = trailz(v) y = shiftr(v, ntz) print '(3i8, 4x, i2)', x, v, y, ntz x = y if (x == 1) exit end do if (v /= 16) error stop if (y /= 1) error stop if (ntz /= 4) error stop end programlfortran-0.63.0/integration_tests/string_02.f900000664000175000017500000000047015174404631021515 0ustar alastairalastairprogram string_02 implicit none character(len = 15) :: surname, firstname character(len = 6) :: title character(len = 25)::greetings title = 'Mr. ' firstname = 'Rowan ' surname = 'Atkinson' greetings = 'A big hello from Mr. Bean' print *, 'Here is ', title, firstname, surname print *, greetings end program lfortran-0.63.0/integration_tests/bindc_04c.c0000664000175000017500000000153115174404631021256 0ustar alastairalastair#include void a_func(void *func(void*)) { float array[5]; for (int i = 0; i < 5; i++) { array[i] = i; } struct thread_data { float* a; int n; } data; data.a = array; // print &array as integer printf("Array address in C: %ld\n", (long int) array); printf("Array[0] address in C: %ld\n", (long int) &array[0]); data.n = 5; func(&data); } void b_func(void *func(void*)) { float array[5]; for (int i = 0; i < 5; i++) { array[i] = i; } float *data = array; // print &array as integer printf("Array address in C for b_func: %ld\n", (long int) array); func(data); } void c_func(void *array) { printf("Printing array in C for c_func\n"); float *data = array; for (int i = 0; i < 5; i++) { printf("%f\n", data[i]); } } lfortran-0.63.0/integration_tests/functions_42.f900000664000175000017500000000102615174404631022221 0ustar alastairalastairmodule functions_42_mod implicit none type string_t character(len=:), allocatable :: string_ end type string_t contains function bracket(x) result(res) class(string_t), intent(in) :: x type(string_t) :: res res%string_ = "2" res%string_ = x%string_ end function bracket end module functions_42_mod program functions_42 use functions_42_mod implicit none type(string_t) :: lines lines%string_ = "1" lines = bracket(lines) if (lines%string_ /= "1") error stop end program functions_42 lfortran-0.63.0/integration_tests/complex_div_test.f900000664000175000017500000000020315174404631023250 0ustar alastairalastairprogram complex2 complex :: x x = (3.0, 4.0) x = x/4.0 print *, x x = 2/x print *, x x = 1/(x + (0.0, 3.0)) print *, x end program lfortran-0.63.0/integration_tests/polymorphic_arguments_01.f900000664000175000017500000000107215174404631024637 0ustar alastairalastairprogram polymorphic_argument_01 implicit none type :: MyStruct integer :: intMember real :: realMember end type MyStruct type(MyStruct) :: structInstance call unused_dummy_argument(structInstance) contains subroutine unused_dummy_argument(dummy) class(*), intent(in) :: dummy select type(dummy) type is (MyStruct) print *, "Hello world" class default print *, "Surprise!!" end select end subroutine end program polymorphic_argument_01 lfortran-0.63.0/integration_tests/intrinsics_122.f900000664000175000017500000000503615174404631022462 0ustar alastairalastairprogram intrinsic_122 implicit none integer :: a(2,3), b(3,2), c(2), d real, allocatable :: e(:,:) integer, parameter :: x1 = rank(1) integer, parameter :: x2 = rank(4.0) integer, parameter :: x3 = rank(.false.) integer, parameter :: x4 = rank((1.0, 2.9)) integer, parameter :: x5 = rank("abc") integer, parameter :: ar1 = rank([445, 32, 12]) integer, parameter :: ar2 = rank([9.08, 0.1, 0.2]) integer, parameter :: ar3 = rank([.true., .false.]) integer, parameter :: ar4 = rank([(1.0, 2.9), (3.0, 4.0)]) integer, parameter :: ar5 = rank(["abc", "def"]) integer :: i = 789 real :: r = 120.34 character(len=3) :: s = "abc" logical :: l = .true. complex :: ci = (1.0, 2.0) integer :: arr1(4) = [11, 14, 66, 32] real :: arr2(4) = [1.0, 2.0, 3.0, 4.0] complex :: arr3(4) = [(1.0, 2.0), (3.0, 4.0), (5.0, 6.0), (7.0, 8.0)] logical :: arr4(4) = [.true., .false., .true., .false.] character(len=3) :: arr5(4) = ["abc", "def", "ghi", "jkl"] print *, x1 if (x1 /= 0) error stop print *, x2 if (x2 /= 0) error stop print *, x3 if (x3 /= 0) error stop print *, x4 if (x4 /= 0) error stop print *, x5 if (x5 /= 0) error stop print *, ar1 if (ar1 /= 1) error stop print *, ar2 if (ar2 /= 1) error stop print *, ar3 if (ar3 /= 1) error stop print *, ar4 if (ar4 /= 1) error stop print *, ar5 if (ar5 /= 1) error stop print *, rank(i) if (rank(i) /= 0) error stop print *, rank(r) if (rank(r) /= 0) error stop print *, rank(s) if (rank(s) /= 0) error stop print *, rank(l) if (rank(l) /= 0) error stop print *, rank(ci) if (rank(ci) /= 0) error stop print *, rank(arr1) if (rank(arr1) /= 1) error stop print *, rank(arr2) if (rank(arr2) /= 1) error stop print *, rank(arr3) if (rank(arr3) /= 1) error stop print *, rank(arr4) if (rank(arr4) /= 1) error stop print *, rank(arr5) if (rank(arr5) /= 1) error stop a = reshape([1, 2, 3, 4, 5, 6], [2, 3]) b = reshape([10, 20, 30, 40, 50, 60], [3, 2]) print*, rank(1) if ( rank(1) /= 0 ) error stop print*, rank([.true., .false.]) if ( rank([.true., .false.]) /= 1 ) error stop print*, rank(a) if ( rank(a) /= 2 ) error stop print*, rank(b) if ( rank(b) /= 2 ) error stop print*, rank(c) if ( rank(c) /= 1 ) error stop print*, rank(d) if ( rank(d) /= 0 ) error stop print*, rank(e) if ( rank(e) /= 2 ) error stop endlfortran-0.63.0/integration_tests/if_03.f900000664000175000017500000000006715174404631020610 0ustar alastairalastairprogram if_03 implicit none if (1 == 1) error stop end lfortran-0.63.0/integration_tests/file_01.f900000664000175000017500000000070315174404631021124 0ustar alastairalastairprogram fileops implicit none integer :: j, i character(len=1) :: c integer(8) :: d real :: z j = 11 open(j, file="file_01_data.txt") read(j, *) i read(j, *) c read(j, *) z read(j, *) d rewind(j) close(j) print *, i, c, z, d if (i /= 10130) error stop if (c /= "c") error stop if (abs(z - 4.20) > 1e-6) error stop if (d /= 9223372036854775804_8) error stop end program fileops lfortran-0.63.0/integration_tests/arrays_reshape_21.f900000664000175000017500000000042515174404631023220 0ustar alastairalastairprogram arrays_reshape_21 implicit none integer, parameter :: arr1(*, *) = reshape( [1, 2, 3, 4], [2, 2] ) integer, parameter :: arr2(*) = reshape(arr1, [4]) print *, arr1 print *, arr2 if( any(arr2 /= [1, 2, 3, 4]) ) error stop end program arrays_reshape_21 lfortran-0.63.0/integration_tests/procedure_pointer_23.f900000664000175000017500000000115715174404631023745 0ustar alastairalastairmodule procedure_pointer_23_mod implicit none abstract interface subroutine sub_i() end subroutine end interface contains function get_ptr(fp) result(res) procedure(sub_i) :: fp procedure(sub_i), pointer :: res res => fp end function subroutine use_ptr(fp) procedure(sub_i), pointer, intent(in) :: fp call fp() end subroutine subroutine dosomething() integer :: x x = 42 if (x /= 42) error stop end subroutine end module program procedure_pointer_23 use procedure_pointer_23_mod implicit none call use_ptr(get_ptr(dosomething)) print *, "ok" end program lfortran-0.63.0/integration_tests/character_06.f900000664000175000017500000000040015174404631022140 0ustar alastairalastairprogram character_06 integer :: a character :: b(1) a = 1 call error_subroutine(b,a) contains subroutine error_subroutine(b, a) integer :: a, i character :: b(a) b = 'x' print *, b do i = 1, a if (b(i) /= 'x') error stop end do return end end program lfortran-0.63.0/integration_tests/associate_32.f900000664000175000017500000000103315174404631022161 0ustar alastairalastairprogram associate_32 ! Test: associate with deferred-length string concatenation expression implicit none associate(result => get_str() // "bar") if (result /= "foobar") error stop end associate associate(result => "hello" // " " // "world") if (result /= "hello world") error stop end associate associate(result => get_str()) if (result /= "foo") error stop end associate contains pure function get_str() result(s) character(len=:), allocatable :: s s = "foo" end function end program associate_32 lfortran-0.63.0/integration_tests/intrinsics_17.f900000664000175000017500000000057715174404631022412 0ustar alastairalastairprogram intrinsics_17 use iso_fortran_env, only: sp=>real32, dp=>real64 real(sp) :: x real(dp) :: y x = exp(1.5_sp) print *, x y = exp(1.5_dp) print *, y x = log(1.5_sp) print *, x y = log(1.5_dp) print *, y x = erf(1.5_sp) print *, x y = erf(1.5_dp) print *, y x = atan2(1.5_sp, 2.5_sp) print *, x y = atan2(1.5_dp, 2.5_dp) print *, y y = datan2(1.5_dp, 2.5_dp) print *, y end lfortran-0.63.0/integration_tests/separate_compilation_31b.f900000664000175000017500000000065115174404631024556 0ustar alastairalastairmodule separate_compilation_31b_module use separate_compilation_31a_module, only: AbsType, MyType implicit none contains function get_my_obj() result(myobj) class(MyType), allocatable :: myobj myobj = MyType(get_obj()) end function get_my_obj function get_obj() result(obj) class(AbsType), allocatable :: obj end function get_obj end module separate_compilation_31b_module lfortran-0.63.0/integration_tests/callback_03.f900000664000175000017500000000120115174404631021735 0ustar alastairalastairmodule callback_03 contains real function cb(f, a, b) real, intent(in) :: a, b interface real function f(x) implicit none real, intent(in) :: x end function end interface cb = (b-a) + f(a) + f(b) end function subroutine foo1(c, d) real :: c, d print *, cb(f, c, d) contains real function f(x) real, intent(in) :: x f = 2*x end function f end subroutine foo1 subroutine foo2(c, d) real :: c, d print *, cb(f, c, d) contains real function f(x) real, intent(in) :: x f = -2*x end function f end subroutine foo2 end module program main use callback_03 call foo1(1.5, 2.0) call foo2(1.5, 2.0) end program main lfortran-0.63.0/integration_tests/array_section_06.f900000664000175000017500000000026715174404631023061 0ustar alastairalastairprogram array_section_06 integer, allocatable :: arr(:, :) allocate(arr(2, 2)) arr = reshape([1, 2, 3, 4], [2, 2]) if (size(arr(4:2, 1)) /= 0) error stop end program lfortran-0.63.0/integration_tests/file_14.f900000664000175000017500000000055515174404631021135 0ustar alastairalastairprogram file_14 implicit none real, pointer :: line(:) integer :: u = 10 open(u, file='file_08.txt', action='read') allocate(line(4)) read(u, *) line close(u) if (line(1) /= 1.) error stop if (line(2) /= 2.) error stop if (line(3) /= 3.) error stop if (line(4) /= 4.) error stop deallocate(line) end program file_14 lfortran-0.63.0/integration_tests/openmp_08.f900000664000175000017500000000125115174404631021511 0ustar alastairalastairsubroutine increment_ctr(n, ctr) use omp_lib implicit none integer, intent(in) :: n real, intent(out) :: ctr real :: local_ctr integer :: i local_ctr = 1 !$omp parallel private(i) reduction(*:local_ctr) !$omp do do i = 1, n local_ctr = local_ctr * 1.5 end do !$omp end do !$omp end parallel ctr = ctr + local_ctr end subroutine program openmp_08 use omp_lib integer, parameter :: n = 10 real :: ctr real :: res = 1.5**10 call omp_set_num_threads(8) ctr = 0 call increment_ctr(n, ctr) print *, ctr if(abs((ctr - res)) > 0.0002 ) error stop end program lfortran-0.63.0/integration_tests/arrays_01.f900000664000175000017500000000102715174404631021506 0ustar alastairalastairprogram arrays_01 implicit none integer :: i, a(3), b(4) do i = 1, 3 a(i) = i+10 end do if (a(1) /= 11) error stop if (a(2) /= 12) error stop if (a(3) /= 13) error stop do i = 11, 14 b(i-10) = i end do if (b(1) /= 11) error stop if (b(2) /= 12) error stop if (b(3) /= 13) error stop if (b(4) /= 14) error stop do i = 1, 3 b(i) = a(i)-10 end do if (b(1) /= 1) error stop if (b(2) /= 2) error stop if (b(3) /= 3) error stop b(4) = b(1)+b(2)+b(3)+a(1) if (b(4) /= 17) error stop b(4) = a(1) if (b(4) /= 11) error stop end lfortran-0.63.0/integration_tests/intrinsics_14.f900000664000175000017500000000211215174404631022372 0ustar alastairalastairprogram intrinsics_14 integer, parameter :: & k1 = selected_int_kind(5), & k2 = selected_int_kind(5_4), & k3 = selected_int_kind(5_8), & k4 = selected_int_kind(8), & k5 = selected_int_kind(10), & k6 = selected_real_kind(5), & k7 = selected_real_kind(5_4), & k8 = selected_real_kind(5_8), & k9 = selected_real_kind(8), & k10 = selected_char_kind("default"), & k11 = selected_real_kind(p=5), & k12 = selected_real_kind(p=10) integer :: i1 character(7) :: s1 s1 = "default" i1 = 5 print*,selected_int_kind(5), k1 ! 4 print*,selected_int_kind(5_4), k2 ! 4 print*,selected_int_kind(5_8), k3 ! 4 print*,selected_int_kind(8), k4 ! 4 print*,selected_int_kind(10), k5 ! 8 print*,selected_real_kind(5), k6 ! 4 print*,selected_real_kind(5_4), k7 ! 4 print*,selected_real_kind(5_8), k8 ! 4 print*,selected_real_kind(8), k9 ! 8 print*,selected_char_kind("default"), k10 ! 1 print *, selected_int_kind(i1) print *, selected_real_kind(i1) print *, selected_char_kind(s1) print *, selected_real_kind(p=5), k11 print *, selected_real_kind(p=10), k12 end program lfortran-0.63.0/integration_tests/array_02_transfer.f900000664000175000017500000000016515174404631023232 0ustar alastairalastairprogram array_02_transfer integer :: m(7) m = [ 1, 0, 0, 0, 5, 0, 0 ] print *, transfer(m, [ 1.0 ]) end programlfortran-0.63.0/integration_tests/fortran_01.f900000664000175000017500000000023615174404631021661 0ustar alastairalastairprogram fortran_01 use iso_c_binding, only: c_ptr, c_loc implicit none integer, pointer :: x type(c_ptr) :: ptr ptr = c_loc(x) end programlfortran-0.63.0/integration_tests/arrays_61.f900000664000175000017500000000054515174404631021520 0ustar alastairalastairprogram arrays_61 real(4) :: xpt(2, 2) xpt = 25.0 call rescue(xpt) print *, sum(xpt) if (abs(sum(xpt) - 120.710678) > 1e-8) error stop contains subroutine rescue(xpt) real(4), intent(inout) :: xpt(:, :) print *, sqrt(sum(xpt**2, dim=1)) xpt(1, :) = sqrt(sum(xpt**2, dim=1)) end subroutine end program lfortran-0.63.0/integration_tests/return_04.f900000664000175000017500000000033115174404631021524 0ustar alastairalastairprogram return_04 implicit none call sub() contains subroutine sub() integer :: n if (n <= 1) then return end if if (n == 4) then n = 1 end if end subroutine end program lfortran-0.63.0/integration_tests/transfer_17.f900000664000175000017500000000166615174404631022051 0ustar alastairalastairprogram transfer_17 use, intrinsic :: iso_fortran_env, only: int8, int32 implicit none integer(int32) :: a = 1, b = 2 integer(int8) :: x(8) integer(int32) :: c(2) integer(int8) :: y(4) ! transfer() with array constructor source and differently-sized mold x = transfer([a, b], x) if (x(1) /= 1) error stop if (x(2) /= 0) error stop if (x(3) /= 0) error stop if (x(4) /= 0) error stop if (x(5) /= 2) error stop if (x(6) /= 0) error stop if (x(7) /= 0) error stop if (x(8) /= 0) error stop ! transfer() with array variable source and differently-sized mold c = [3, 4] x = transfer(c, x) if (x(1) /= 3) error stop if (x(5) /= 4) error stop ! transfer() with larger-element mold from smaller-element source y = transfer(256, y) if (y(1) /= 0) error stop if (y(2) /= 1) error stop if (y(3) /= 0) error stop if (y(4) /= 0) error stop end program lfortran-0.63.0/integration_tests/include_01/0000775000175000017500000000000015174404631021310 5ustar alastairalastairlfortran-0.63.0/integration_tests/include_01/a.f900000664000175000017500000000013015174404631022042 0ustar alastairalastairsubroutine a() include "include_01/nested/b.f90" print *, "From A" end subroutine lfortran-0.63.0/integration_tests/include_01/c.f900000664000175000017500000000002215174404631022044 0ustar alastairalastairprint *, "From C" lfortran-0.63.0/integration_tests/include_01/nested/0000775000175000017500000000000015174404631022572 5ustar alastairalastairlfortran-0.63.0/integration_tests/include_01/nested/b.f900000664000175000017500000000005515174404631023333 0ustar alastairalastairprint *, "From B" include "include_01/c.f90" lfortran-0.63.0/integration_tests/bindc_iso_fb_06c.c0000664000175000017500000000063215174404631022602 0ustar alastairalastair#include #include #include int cfi_type_int32(void) { return CFI_type_int32_t; } int cfi_type_float(void) { return CFI_type_float; } void check_cfi_type(CFI_cdesc_t *desc, int expected_type) { if ((int)desc->type != expected_type) { printf("FAIL: CFI type = %d, expected %d\n", (int)desc->type, expected_type); exit(1); } } lfortran-0.63.0/integration_tests/subroutines_01.f900000664000175000017500000000102715174404631022567 0ustar alastairalastairprogram subroutines_01 implicit none integer :: i, j i = 1 j = 1 if (j /= 1) error stop call f(i, j) print *, i, j if (i /= 1) error stop if (j /= 2) error stop j = 1 if (j /= 1) error stop call f(3, j) print *, j if (j /= 4) error stop j = 1 if (j /= 1) error stop call f(1+2, j) print *, j if (j /= 4) error stop j = 1 if (j /= 1) error stop call f(i+2, j) print *, j if (j /= 4) error stop contains subroutine f(a, b) integer, intent(in) :: a integer, intent(out) :: b b = a + 1 end subroutine end program lfortran-0.63.0/integration_tests/intrinsics_204.f900000664000175000017500000001373515174404631022470 0ustar alastairalastairprogram intrinsics_204 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(dp) :: x(40) real(dp) :: expected(40) real(dp) :: expected_res(32) integer :: i real :: y(28) real :: expected_y(28) real(dp), parameter :: res(32) = bessel_y1([9.98600559790084e307_dp,9.98800479820072e307_dp,9.9900039985006e307_dp, & 9.99200319880048e307_dp, 1036.462826483388272_dp, 1.7197292882018389_dp, & 10.2368267382872828_dp, 0.17197292882018389_dp, 152.67283628_dp, & 632.92729728_dp, 1.2728272919_dp, 1.265228272919_dp, & 29.82407037185126_dp, 35.2459016393_dp, 46.2634946_dp, 24.7740903638_dp, & 15.8978408636372_dp, 8.801468212714914_dp, 8.798080767692923_dp, 8.791287884846061575_dp, & 0.6635324560331525_dp, 0.6633115808685429_dp, 0.6630906573122884_dp, 0.6628696853957159_dp, & 0.5042349934053336_dp, 0.5041796815747646_dp, 0.5041242821300232_dp, 0.50401322049655_dp, & 499.19032387045183_dp, 499.2802878848461_dp, 499.3702518992403_dp, 499.5501799280288_dp]) expected_res = [-1.1242697836494346E-156_dp, -3.6987410577069675E-155_dp, 6.6185432736853698E-155_dp, & -7.9441122443324676E-155_dp, & -1.2379145453411093E-002_dp, -0.27253834632671181_dp, 0.24932183511315256_dp, -3.8313116038851942_dp, & -2.9667345859170198E-002_dp, 2.4613344707389746E-002_dp, -0.56789241609783492_dp, -0.57335504482194688_dp, & 0.10420535567671903_dp, 0.13391492370821437_dp, -7.8417916615948820E-003_dp, -6.8571787853437760E-002_dp, & 0.16838460392882040_dp, 5.4736765729333475E-002_dp, 5.3856989331157942E-002_dp, 5.2089913683587979E-002_dp, & -1.1559813724346837_dp, -1.1563150553800137_dp, -1.1566489944373206_dp, -1.1569831898838661_dp, & -1.4609752198895190_dp, -1.4611112512331177_dp, -1.4612475261578066_dp, -1.4615208070815726_dp, & 1.5957661062982142E-002_dp, 1.8761706846965608E-002_dp, 2.1413515766267922E-002_dp, 2.6176157352140857E-002_dp] do i = 1, size(res) print *, res(i) if (abs(res(i) - expected_res(i)) > 1e-5_dp) error stop end do x = [9.98600559790084e307_dp,9.98800479820072e307_dp,9.9900039985006e307_dp,9.99200319880048e307_dp, & 1036.462826483388272_dp, 1.7197292882018389_dp, 10.2368267382872828_dp, 0.17197292882018389_dp, & 152.67283628_dp, 632.92729728_dp, 1.2728272919_dp, 1.265228272919_dp, & 3.229995504589554d-153, 1.9201212555874555d-153, 6.809537363878625d-155, 5.690181373063991d-154, & 29.82407037185126_dp, 35.2459016393_dp, 46.2634946_dp, 24.7740903638_dp, & 15.8978408636372_dp, 8.801468212714914_dp, 8.798080767692923_dp, 8.791287884846061575_dp, & 0.6635324560331525_dp, 0.6633115808685429_dp, 0.6630906573122884_dp, 0.6628696853957159_dp, & 0.5042349934053336_dp, 0.5041796815747646_dp, 0.5041242821300232_dp, 0.50401322049655_dp, & 1.3994502099160337d-303, 1.199530179928029d-303, 9.99610149940024d-304, 5.9977008996401444d-304, & 499.19032387045183_dp, 499.2802878848461_dp, 499.3702518992403_dp, 499.5501799280288_dp] expected = [-1.1242697836494346E-156_dp, -3.6987410577069675E-155_dp, 6.6185432736853698E-155_dp, & -7.9441122443324676E-155_dp, & -1.2379145453411093E-002_dp, -0.27253834632671181_dp, 0.24932183511315256_dp, -3.8313116038851942_dp, & -2.9667345859170198E-002_dp, 2.4613344707389746E-002_dp, -0.56789241609783492_dp, -0.57335504482194688_dp, & -1.9709617906990824E+152_dp, -3.3155185929797410E+152_dp, -9.3489430830433235E+153_dp, -1.1188040075158112E+153_dp, & 0.10420535567671903_dp, 0.13391492370821437_dp, -7.8417916615948820E-003_dp, -6.8571787853437760E-002_dp, & 0.16838460392882040_dp, 5.4736765729333475E-002_dp, 5.3856989331157942E-002_dp, 5.2089913683587979E-002_dp, & -1.1559813724346837_dp, -1.1563150553800137_dp, -1.1566489944373206_dp, -1.1569831898838661_dp, & -1.4609752198895190_dp, -1.4611112512331177_dp, -1.4612475261578066_dp, -1.4615208070815726_dp, & -4.5490705411075559E+302_dp, -5.3072426439973200E+302_dp, -6.3686805541718252E+302_dp, -1.0614396800043461E+303_dp, & 1.5957661062982142E-002_dp, 1.8761706846965608E-002_dp, 2.1413515766267922E-002_dp, 2.6176157352140857E-002_dp] do i = 1, size(x) print *, bessel_y1(x(i)), "i = ", i if (abs(bessel_y1(x(i)) - expected(i)) > 1e-12_dp) error stop end do y = [1036.462826483388272_sp, 1.7197292882018389_sp, 10.2368267382872828_sp, 0.17197292882018389_sp, & 152.67283628_sp, 632.92729728_sp, 1.2728272919_sp, 1.2828272919_sp, & 29.82407037185126_sp, 35.2459016393_sp, 46.2634946_sp, 24.7740903638_sp, & 15.8978408636372_sp, 8.801468212714914_sp, 8.798080767692923_sp, 8.791287884846061575_sp, & 0.6635324560331525_sp, 0.6633115808685429_sp, 0.6630906573122884_sp, 0.6628696853957159_sp, & 0.5042349934053336_sp, 0.5041796815747646_sp, 0.5041242821300232_sp, 0.50401322049655_sp, & 499.19032387045183_sp, 499.2802878848461_sp, 499.3702518992403_sp, 499.5501799280288_sp] expected_y = [-1.23779038E-02_sp, -0.272538334_sp, 0.249321833_sp, -3.83131123_sp, & -2.96673458E-02_sp, 2.46131476E-02_sp, -0.567892432_sp, -0.560734272_sp, & 0.104205415_sp, 0.133914948_sp, -7.84158148E-03_sp, -6.85717091E-02_sp, & 0.168384567_sp, 5.47366850E-02_sp, 5.38569130E-02_sp, 5.20897955E-02_sp, & -1.15598142_sp, -1.15631497_sp, -1.15664887_sp, -1.15698314_sp, & -1.46097517_sp, -1.46111119_sp, -1.46124744_sp, -1.46152067_sp, & 1.59581173E-02_sp, 1.87612697E-02_sp, 2.14131586E-02_sp, 2.61759404E-02_sp ] do i = 1, size(y) print *, bessel_y1(y(i)), "i = ", i if (abs(bessel_y1(y(i)) - expected_y(i)) > 1e-6) error stop end do end program lfortran-0.63.0/integration_tests/modules_45.f900000664000175000017500000000540015174404631021664 0ustar alastairalastairmodule modules_45_fpm_manifest_profile implicit none type :: file_scope_flag end type file_scope_flag type :: profile_config_t character(len=:), allocatable :: profile_name character(len=:), allocatable :: compiler integer :: os_type character(len=:), allocatable :: flags character(len=:), allocatable :: c_flags character(len=:), allocatable :: cxx_flags character(len=:), allocatable :: link_time_flags type(file_scope_flag), allocatable :: file_scope_flags(:) logical :: is_built_in end type profile_config_t contains function new_profile(profile_name, compiler, os_type, flags, c_flags, cxx_flags, & link_time_flags, file_scope_flags, is_built_in) & & result(profile) character(len=*), intent(in) :: profile_name character(len=*), intent(in) :: compiler integer, intent(in) :: os_type character(len=*), optional, intent(in) :: flags character(len=*), optional, intent(in) :: c_flags character(len=*), optional, intent(in) :: cxx_flags character(len=*), optional, intent(in) :: link_time_flags type(file_scope_flag), optional, intent(in) :: file_scope_flags(:) logical, optional, intent(in) :: is_built_in type(profile_config_t) :: profile end function new_profile subroutine get_flags(profile_name, compiler_name, os_type, profiles, profindex, os_valid) character(len=:), allocatable, intent(in) :: profile_name character(len=:), allocatable, intent(in) :: compiler_name integer, intent(in) :: os_type type(profile_config_t), allocatable, intent(inout) :: profiles(:) integer, intent(inout) :: profindex logical, intent(in) :: os_valid character(len=:), allocatable :: flags, c_flags, cxx_flags, link_time_flags, key_name, file_name, file_flags, err_message type(file_scope_flag), allocatable :: file_scope_flags(:) integer :: ikey, ifile, stat logical :: is_valid profiles(profindex) = new_profile(profile_name, compiler_name, os_type, & & flags, c_flags, cxx_flags, link_time_flags, file_scope_flags) profindex = profindex + 1 end subroutine get_flags end module modules_45_fpm_manifest_profile program modules_45 use modules_45_fpm_manifest_profile implicit none character(len=:), allocatable :: profile_name, compiler_name integer :: os_type, profindex logical :: os_valid type(profile_config_t), allocatable :: profiles(:) allocate(character(len=40) :: profile_name) allocate(character(len=40) :: compiler_name) allocate(profiles(5)) call get_flags(profile_name, compiler_name, os_type, & profiles, profindex, os_valid) end program lfortran-0.63.0/integration_tests/intrinsics_139.f900000664000175000017500000000523715174404631022475 0ustar alastairalastairprogram intrinsic_139 integer :: i = 17, j = 3 real :: f = 17.5_4, f2 = 5.5_4 real :: r = 17.5_8, r2 = 5.5_8 integer, parameter :: x1 = modulo(11, 2) integer(8), parameter :: x2 = modulo(11, -2) real, parameter :: x3 = modulo(11.0_4, 2.0_4) real, parameter :: x4 = modulo(11.0_8, -2.0_4) real(8), parameter :: x5 = modulo(11.0_8, 2.0_8) integer, parameter :: ar1(3) = modulo([1, 2, 3], 2) integer(8), parameter :: ar2(3) = modulo([11_8, -2_8, 31_8], 2) real, parameter :: ar3(3) = modulo([1.0, 2.0, 3.0], 2.0) real(8), parameter :: ar4(3) = modulo([1.0_8, -2.0_8, 3.0_8], 2.0_8) print *, x1 if ( x1 /= 1 ) error stop print *, x2 if ( x2 /= -1 ) error stop print *, x3 if ( abs(x3 - 1.00000000) > 1e-5 ) error stop print *, x4 if ( abs(x4 - (-1.00000000)) > 1e-5 ) error stop print *, x5 if ( abs(x5 - 1.00000000) > 1e-5 ) error stop print *, ar1 if ( any(ar1 /= [1, 0, 1]) ) error stop print *, ar2 if ( any(ar2 /= [1, 0, 1]) ) error stop print *, ar3 if ( any(abs(ar3 - [1.00000000, 0.00000000, 1.00000000]) > 1e-5) ) error stop print *, ar4 if ( any(abs(ar4 - [1.00000000, 0.00000000, 1.00000000]) > 1e-5) ) error stop print *, modulo(i,j) if ( modulo(i,j) /= 2 ) error stop print *, modulo(f,f2) if ( abs(modulo(f,f2) - 1.00000000) > 1e-5 ) error stop print *, modulo(r,f2) if ( abs(modulo(r,f2) - 1.00000000) > 1e-5 ) error stop print *, modulo(f,r2) if ( abs(modulo(f,r2) - 1.00000000) > 1e-5 ) error stop print *, modulo(-i,j) if ( modulo(-i,j) /= 1 ) error stop print *, modulo(-f,f2) if ( abs(modulo(-f,f2) - 4.50000000) > 1e-5 ) error stop print *, modulo(-r,f2) if ( abs(modulo(-r,f2) - 4.50000000) > 1e-5 ) error stop print *, modulo(-f,r2) if ( abs(modulo(-f,r2) - 4.50000000) > 1e-5 ) error stop print *, modulo(i,-j) if ( modulo(i,-j) /= -1 ) error stop print *, modulo(f,-f2) if ( abs(modulo(f,-f2) + 4.50000000 ) > 1e-5 ) error stop print *, modulo(r,-f2) if ( abs(modulo(r,-f2) + 4.50000000) > 1e-5 ) error stop print *, modulo(f,-r2) if ( abs(modulo(f,-r2) + 4.50000000) > 1e-5 ) error stop print *, modulo(-i,-j) if ( modulo(-i,-j) /= -2 ) error stop print *, modulo(-f,-f2) if ( abs(modulo(-f,-f2) + 1.00000000) > 1e-5 ) error stop print *, modulo(-r,-f2) if ( abs(modulo(-r,-f2) + 1.00000000) > 1e-5 ) error stop print *, modulo(-f,-r2) if ( abs(modulo(-f,-r2) + 1.00000000) > 1e-5 ) error stop print *, modulo(17,-3) if ( modulo(17,-3) /= -1 ) error stop print*, modulo(-17, 3) if ( modulo(-17,3) /= 1 ) error stop end program lfortran-0.63.0/integration_tests/associate_22.f900000664000175000017500000000132115174404631022160 0ustar alastairalastairprogram associate_22 implicit none type base real :: r character(len=:), allocatable :: s integer, pointer :: x(:) end type integer, pointer :: p_int_var(:), t_int_var(:) type(base), pointer :: p_base_var(:), t_base_var(:) allocate( p_int_var(0), t_int_var(0) ) print*, associated( p_int_var, t_int_var ) if ( associated( p_int_var, t_int_var ) ) error stop deallocate(p_int_var) nullify( p_int_var ) allocate( p_base_var(0), t_base_var(0) ) print*, associated( p_base_var, t_base_var ) if ( associated( p_base_var, t_base_var ) ) error stop deallocate(p_base_var) nullify( p_base_var ) deallocate(t_int_var) deallocate(t_base_var) end program lfortran-0.63.0/integration_tests/present_01.f900000664000175000017500000000054315174404631021667 0ustar alastairalastairmodule present_01_module implicit none contains subroutine foo1(a) real, intent(in), optional :: a(:) call foo2(a) end subroutine subroutine foo2(a) real, intent(in), optional :: a(..) if (present(a)) error stop end subroutine end module program present_01 use present_01_module implicit none call foo1() end lfortran-0.63.0/integration_tests/matmul_05.f900000664000175000017500000000104415174404631021507 0ustar alastairalastairmodule matmul_05_mod implicit none contains pure function dense(n) result(B) integer, intent(in) :: n double precision, allocatable :: B(:,:) allocate(B(n,n)) B = 1.0d0 end function end module program matmul_05 use matmul_05_mod, only: dense implicit none integer, parameter :: n = 5 double precision :: x(n), y(n) integer :: i x = 1.0d0 y = matmul(dense(n), x) do i = 1, n if (abs(y(i) - 5.0d0) > 1.0d-12) error stop end do print *, "PASS" end program lfortran-0.63.0/integration_tests/class_procedure_args_01.f900000664000175000017500000000171515174404631024402 0ustar alastairalastairmodule class_procedure_args_01 type,public :: clock contains procedure,public :: toc => clock_end procedure :: increment end type clock type(clock),public :: clk contains subroutine clock_end(me, case_str) class(clock),intent(inout) :: me character(len=*),intent(in) :: case_str print *, case_str if (case_str /= "5") stop end subroutine clock_end subroutine sub(case_str) character(len=*),intent(in) :: case_str print *, case_str if (case_str /= "6") error stop end subroutine sub function increment(me, x) result(res) class(clock),intent(inout) :: me integer, intent(in) :: x integer :: res res = x + 1 end function increment end module class_procedure_args_01 program main use class_procedure_args_01 procedure(sub), pointer :: toc call clk%toc("5") toc => sub call toc("6") if (clk%increment(x=5) /= 6) error stop end program main lfortran-0.63.0/integration_tests/derived_types_134.f900000664000175000017500000000165415174404631023150 0ustar alastairalastairmodule derived_types_134_core use derived_types_134_module, only: ctx_t, get_default, set_default, create_ctx implicit none contains subroutine do_init() type(ctx_t), pointer :: ctx ctx => get_default() if (.not. associated(ctx)) then ctx => create_ctx() call set_default(ctx) end if ctx%val = 42 ctx%sub%x = 10 end subroutine do_init subroutine do_shutdown() type(ctx_t), pointer :: ctx ctx => get_default() if (.not. associated(ctx)) return call ctx%shutdown() call set_default(null()) end subroutine do_shutdown end module derived_types_134_core program derived_types_134 use derived_types_134_core, only: do_init use derived_types_134_module, only: get_default, ctx_t implicit none type(ctx_t), pointer :: ctx call do_init() ctx => get_default() if (ctx%val /= 42) error stop if (ctx%sub%x /= 10) error stop deallocate(ctx) print *, "PASS" end program derived_types_134 lfortran-0.63.0/integration_tests/matmul_04.f900000664000175000017500000000071715174404631021514 0ustar alastairalastairprogram matmul_04 implicit none real, allocatable :: A(:,:), B(:,:), C(:,:) real :: expected allocate(A(3, 4), B(4, 2)) A = 1.0 B = 1.0 ! C is not allocated - should be auto-allocated with --realloc-lhs-arrays C = matmul(A, B) expected = 4.0 if (abs(C(1,1) - expected) > 1e-6) error stop if (abs(C(3,2) - expected) > 1e-6) error stop if (size(C, 1) /= 3) error stop if (size(C, 2) /= 2) error stop print *, "OK: matmul with auto-allocated result" end program lfortran-0.63.0/integration_tests/write_11.f900000664000175000017500000000066015174404631021342 0ustar alastairalastairprogram write_11 implicit none character(len=*), parameter :: temp_file = "_lfortran_temporary_file" character(len=*), parameter :: test_line = "HelloWorld!" integer :: unit, ios ios = 0 unit = 1 open(newunit=unit, file=temp_file) write(unit, iostat=ios) test_line close(unit) print *, ios if(ios <= 0) error stop "IOS should be positive -- as a runtime error should occur" end programlfortran-0.63.0/integration_tests/warning_complexstar.f900000664000175000017500000000007315174404631023773 0ustar alastairalastairprogram warning_complexstar complex*8 :: x end program lfortran-0.63.0/integration_tests/pointer_02.f900000664000175000017500000000124315174404631021666 0ustar alastairalastairMODULE solvar_module REAL, DIMENSION(:,:), POINTER :: ptr_out CONTAINS SUBROUTINE solvar_allocate NULLIFY(ptr_out) ALLOCATE(ptr_out(5,1)) END SUBROUTINE solvar_allocate SUBROUTINE dim3_sweep(ptr_out) REAL, DIMENSION(5), INTENT(OUT) :: ptr_out PRINT *, ptr_out STOP END SUBROUTINE dim3_sweep SUBROUTINE octsweep !REAL, DIMENSION(5), pointer :: x !x = ptr_out(:,1) CALL dim3_sweep( ptr_out(:,1) ) END SUBROUTINE octsweep END MODULE solvar_module PROGRAM snap_main USE solvar_module, ONLY: solvar_allocate, octsweep CALL solvar_allocate CALL octsweep END PROGRAM snap_mainlfortran-0.63.0/integration_tests/separate_compilation_48.f900000664000175000017500000000243515174404631024426 0ustar alastairalastairmodule separate_compilation_48_targets use separate_compilation_48a_types implicit none type :: build_target_ptr type(build_target_t), pointer :: ptr => null() end type type :: build_target_t type(string_t), allocatable :: macros(:) end type contains subroutine build_target_list(targets, model) type(build_target_ptr), intent(out), allocatable :: targets(:) type(fpm_model_t), intent(inout), target :: model integer :: i, j do j=1,size(model%packages) associate(sources=>model%packages(j)%sources) do i=1,size(sources) call add_new_target(targets, package=model%packages(j)%name, & type=3, output_name='obj', source=sources(i)) end do end associate end do end subroutine subroutine add_new_target(targets, package, type, output_name, source) type(build_target_ptr), allocatable, intent(inout) :: targets(:) character(*), intent(in) :: package integer, intent(in) :: type character(*), intent(in) :: output_name type(srcfile_t), intent(in), optional :: source end subroutine end module program separate_compilation_48 use separate_compilation_48a_types use separate_compilation_48_targets implicit none type(fpm_model_t) :: model allocate(model%packages(0)) print *, "ok" end program lfortran-0.63.0/integration_tests/expr_08.f900000664000175000017500000000037315174404631021175 0ustar alastairalastairprogram expr_08 implicit none integer, parameter :: dp = kind(0.d0) real :: x4, y4 real(dp) :: x, y y4 = 3 x4 = y4 ** 2 print *, y4, x4 if (abs(x4 - 9) > 1e-6) error stop y = 3 x = y**2 print *, y, x if (abs(x - 9) > 1e-12_dp) error stop end program lfortran-0.63.0/integration_tests/procedure_pointer_24.f900000664000175000017500000000063515174404631023746 0ustar alastairalastairprogram procedure_pointer_24 implicit none type :: t integer :: x end type type(t) :: obj procedure(sub), pointer :: p p => f(sub) obj%x = 42 call p(obj) contains subroutine sub(a) type(t), intent(in) :: a if (a%x /= 42) error stop print *, "PASS" end subroutine function f(fp) procedure(sub) :: fp procedure(sub), pointer :: f f => fp end function end program lfortran-0.63.0/integration_tests/format_63.f900000664000175000017500000000063115174404631021505 0ustar alastairalastairprogram format_63 implicit none character :: s(5) open (10, file='format_63_tmp.txt', status='unknown', form='formatted') write (10, '(a5)') '12345' rewind (10) s = '?' read (10, '(5a1)') s if (s(1) /= '1') error stop if (s(2) /= '2') error stop if (s(3) /= '3') error stop if (s(4) /= '4') error stop if (s(5) /= '5') error stop close(10, status='delete') end program format_63 lfortran-0.63.0/integration_tests/class_66.f900000664000175000017500000000177615174404631021340 0ustar alastairalastairmodule class_66_mod implicit none type, abstract :: bitset_type integer :: n = 0 contains procedure(print_abstract), deferred, pass(self) :: print_base generic :: print => print_base end type bitset_type abstract interface subroutine print_abstract(self) import :: bitset_type class(bitset_type), intent(inout) :: self end subroutine print_abstract end interface type, extends(bitset_type) :: bitset_64 integer :: extra = 64 contains procedure, pass(self) :: print_base => print_bitset_64 end type bitset_64 contains subroutine print_bitset_64(self) class(bitset_64), intent(inout) :: self self%n = 10 self%extra = 20 end subroutine print_bitset_64 end module class_66_mod program class_66 use class_66_mod class(bitset_64), allocatable :: b allocate(bitset_64 :: b) call b%print() if (b%n /= 10 .or. b%extra /= 20) error stop end program class_66 lfortran-0.63.0/integration_tests/arrays_op_28.f900000664000175000017500000000064315174404631022220 0ustar alastairalastairprogram arrays_op_28 implicit none real :: R(5), V(5), Vmid(3) R = 45 V = 23 Vmid(:3) = func(R(:4), V(:4)) print '(f10.2)', Vmid if( any(Vmid /= 1035.00) ) error stop contains function func(R, V) result(Vmid) real, intent(in) :: R(:), V(:) real :: Vmid(size(R)-1) integer :: i do i = 1, size(Vmid) Vmid(i) = R(i)*V(i) end do end function end program arrays_op_28 lfortran-0.63.0/integration_tests/functions_52.f900000664000175000017500000000050315174404631022221 0ustar alastairalastairprogram functions_52 integer, allocatable :: b if (allocated(b) /= .false.) error stop b = my() if (allocated(b) /= .true.) error stop if (b /= 44) error stop contains function my() result(ret) integer, allocatable :: ret ret = 44 end function end program lfortran-0.63.0/integration_tests/intrinsics_356.f900000664000175000017500000000046715174404631022476 0ustar alastairalastairprogram intrinsics_356 implicit none integer :: m real :: A(3) m = 3 A = rand1(m) contains impure function rand1(m) result(x) implicit none integer, intent(in) :: m real :: x(max(m, 0)) call random_number(harvest=x) end function end programlfortran-0.63.0/integration_tests/external_16.f900000664000175000017500000000037015174404631022035 0ustar alastairalastaircharacter(8) function sin() sin = 'Peccavi!' end function sin program external_16 implicit none character(8), external :: sin character(8) :: res res = sin() if (res /= 'Peccavi!') error stop print '(A)', res end program external_16 lfortran-0.63.0/integration_tests/logical2.f900000664000175000017500000000047015174404631021402 0ustar alastairalastairprogram logical2 ! this program checks logical operators implicit none ! variable declaration logical :: a, b ! assigning values a = .true. b = .false. if (a .and. b) then print *, "Line 1 - Condition is true" else print *, "Line 1 - Condition is false" end if end program logical2 lfortran-0.63.0/integration_tests/implicit_interface_09.f900000664000175000017500000000041415174404631024046 0ustar alastairalastairmodule implicit_interface_09_module contains function f() implicit integer (f) f = 1 end function f end program main use implicit_interface_09_module integer :: j j = f() if (j /= 1) error stop print *, j end program main lfortran-0.63.0/integration_tests/class_allocate_04.f900000664000175000017500000000077615174404631023173 0ustar alastairalastairprogram class_allocate_04 ! Test allocate with type-spec for class(*) arrays implicit none class(*), allocatable :: arr(:) integer :: i allocate(integer :: arr(5)) select type(arr) type is (integer) do i = 1, 5 arr(i) = i * 10 end do do i = 1, 5 if (arr(i) /= i * 10) error stop end do class default error stop end select print *, "PASS" end program class_allocate_04 lfortran-0.63.0/integration_tests/derived_types_38.f900000664000175000017500000000143415174404631023067 0ustar alastairalastairmodule derived_types_38_mod type :: m integer :: i end type m end module derived_types_38_mod program derived_types_38 use derived_types_38_mod ! Uncomment below test case after supporting procedure ! declaration using subroutine, inside a derived type declared ! in `program`. type :: t integer :: i ! procedure(f), nopass, pointer :: proc end type t type(m) :: m_var type(t) :: t_var m_var%i = 1 t_var%i = 2 call f() call g() ! t_var%proc => g ! call t_var%proc() print *, t_var%i if (t_var%i /= 3) error stop contains subroutine f() print *, m_var if (m_var%i /= 1) error stop end subroutine f subroutine g() t_var%i = t_var%i + 1 end subroutine g end program derived_types_38 lfortran-0.63.0/integration_tests/array_05_transfer.f900000664000175000017500000000043515174404631023235 0ustar alastairalastairprogram array_05_transfer implicit none real :: value(5) = [1.1, 1.2, 1.3, 1.4, 1.5] integer, allocatable :: val(:) val = transfer(value, val, 5) print * , val if (all(val /= [1066192077, 1067030938, 1067869798, 1068708659, 1069547520])) error stop end program lfortran-0.63.0/integration_tests/bindc_iso_fb_01.f900000664000175000017500000006763715174404631022630 0ustar alastairalastair! Consolidated integration test: bindc_iso_fb_01 ! ! Merged from: ! - bindc_18.f90: Basic array descriptors (int32/int64/float/double sums, ! assumed-rank, allocatable, pointer, sections, optional) ! - bindc_19.f90: Additional type coverage (complex float/double, logical, ! CONTIGUOUS attribute) ! - bindc_24.f90: Scalar types and VALUE attribute (int8, int16, short, long, ! long_long, size_t, intptr_t, ptrdiff_t, bool, complex, ! character, small-int arrays, complex return values) ! ! Features covered: ! - CFI descriptors for assumed-shape arrays (ranks 1-3) ! - Assumed-rank (type(*), dimension(..)) ! - Allocatable and pointer arrays through C ! - Array sections and contiguity ! - Optional arguments ! - Complex, logical, and character types through descriptors ! - CONTIGUOUS attribute on assumed-shape ! - Scalar VALUE attribute for all ISO C binding integer kinds ! - VALUE attribute with logical, complex, character scalars ! - Functions returning complex values module bindc_18_mod use iso_c_binding, only: c_int, c_int32_t, c_int64_t, c_float, c_double implicit none interface ! ---- int32 sum: ranks 1, 2, 3 and assumed rank ---- integer(c_int32_t) function c_sum_int32_1d(a) bind(C, name="c_sum_int32_1d") import :: c_int32_t integer(c_int32_t), intent(in) :: a(:) end function integer(c_int32_t) function c_sum_int32_2d(a) bind(C, name="c_sum_int32_2d") import :: c_int32_t integer(c_int32_t), intent(in) :: a(:,:) end function integer(c_int32_t) function c_sum_int32_3d(a) bind(C, name="c_sum_int32_3d") import :: c_int32_t integer(c_int32_t), intent(in) :: a(:,:,:) end function integer(c_int32_t) function c_sum_int32_ar(a) bind(C, name="c_sum_int32_ar") import :: c_int32_t integer(c_int32_t), intent(in) :: a(..) end function ! ---- int64 sum: ranks 1, 2, 3 ---- integer(c_int64_t) function c_sum_int64_1d(a) bind(C, name="c_sum_int64_1d") import :: c_int64_t integer(c_int64_t), intent(in) :: a(:) end function integer(c_int64_t) function c_sum_int64_2d(a) bind(C, name="c_sum_int64_2d") import :: c_int64_t integer(c_int64_t), intent(in) :: a(:,:) end function integer(c_int64_t) function c_sum_int64_3d(a) bind(C, name="c_sum_int64_3d") import :: c_int64_t integer(c_int64_t), intent(in) :: a(:,:,:) end function ! ---- float sum: ranks 1, 2, 3 ---- real(c_float) function c_sum_float_1d(a) bind(C, name="c_sum_float_1d") import :: c_float real(c_float), intent(in) :: a(:) end function real(c_float) function c_sum_float_2d(a) bind(C, name="c_sum_float_2d") import :: c_float real(c_float), intent(in) :: a(:,:) end function real(c_float) function c_sum_float_3d(a) bind(C, name="c_sum_float_3d") import :: c_float real(c_float), intent(in) :: a(:,:,:) end function ! ---- double sum: ranks 1, 2, 3 ---- real(c_double) function c_sum_double_1d(a) bind(C, name="c_sum_double_1d") import :: c_double real(c_double), intent(in) :: a(:) end function real(c_double) function c_sum_double_2d(a) bind(C, name="c_sum_double_2d") import :: c_double real(c_double), intent(in) :: a(:,:) end function real(c_double) function c_sum_double_3d(a) bind(C, name="c_sum_double_3d") import :: c_double real(c_double), intent(in) :: a(:,:,:) end function ! ---- int32 double-in-place: ranks 1, 2, 3 ---- subroutine c_scale_int32_1d(a) bind(C, name="c_double_int32_1d") import :: c_int32_t integer(c_int32_t), intent(inout) :: a(:) end subroutine subroutine c_scale_int32_2d(a) bind(C, name="c_double_int32_2d") import :: c_int32_t integer(c_int32_t), intent(inout) :: a(:,:) end subroutine subroutine c_scale_int32_3d(a) bind(C, name="c_double_int32_3d") import :: c_int32_t integer(c_int32_t), intent(inout) :: a(:,:,:) end subroutine ! ---- assumed-rank queries: type(*), dimension(..) ---- integer(c_int) function c_get_rank(a) bind(C, name="c_get_rank") import :: c_int type(*), intent(in) :: a(..) end function integer(c_int) function c_get_elem_size(a) bind(C, name="c_get_elem_size") import :: c_int type(*), intent(in) :: a(..) end function ! ---- allocatable arrays ---- integer(c_int32_t) function c_sum_alloc_1d(a) bind(C, name="c_sum_alloc_1d") import :: c_int32_t integer(c_int32_t), allocatable, intent(in) :: a(:) end function integer(c_int) function c_attr_alloc(a) bind(C, name="c_attr_alloc") import :: c_int, c_int32_t integer(c_int32_t), allocatable, intent(in) :: a(:) end function subroutine c_double_alloc_1d(a) bind(C, name="c_double_alloc_1d") import :: c_int32_t integer(c_int32_t), allocatable, intent(inout) :: a(:) end subroutine ! ---- pointer arrays ---- integer(c_int32_t) function c_sum_ptr_1d(a) bind(C, name="c_sum_ptr_1d") import :: c_int32_t integer(c_int32_t), pointer, intent(in) :: a(:) end function integer(c_int) function c_attr_ptr(a) bind(C, name="c_attr_ptr") import :: c_int, c_int32_t integer(c_int32_t), pointer, intent(in) :: a(:) end function ! ---- attribute / contiguity for assumed-shape (other) ---- integer(c_int) function c_attr_other(a) bind(C, name="c_attr_other") import :: c_int, c_int32_t integer(c_int32_t), intent(in) :: a(:) end function integer(c_int) function c_is_contiguous(a) bind(C, name="c_is_contiguous") import :: c_int, c_int32_t integer(c_int32_t), intent(in) :: a(:) end function ! ---- optional argument ---- integer(c_int) function c_is_present(a) bind(C, name="c_is_present") import :: c_int, c_int32_t integer(c_int32_t), optional, intent(in) :: a(:) end function end interface end module module bindc_19_mod use iso_c_binding, only: c_int, c_float, c_double, c_bool, & c_float_complex, c_double_complex implicit none interface ! ---- complex(c_float_complex) arrays ---- subroutine c19_sum_cfloat_1d(a, re, im) bind(C, name="c19_sum_cfloat_1d") import :: c_float_complex, c_float complex(c_float_complex), intent(in) :: a(:) real(c_float), intent(out) :: re, im end subroutine subroutine c19_sum_cfloat_2d(a, re, im) bind(C, name="c19_sum_cfloat_2d") import :: c_float_complex, c_float complex(c_float_complex), intent(in) :: a(:,:) real(c_float), intent(out) :: re, im end subroutine subroutine c19_scale_cfloat_1d(a) bind(C, name="c19_scale_cfloat_1d") import :: c_float_complex complex(c_float_complex), intent(inout) :: a(:) end subroutine ! ---- complex(c_double_complex) arrays ---- subroutine c19_sum_cdouble_1d(a, re, im) bind(C, name="c19_sum_cdouble_1d") import :: c_double_complex, c_double complex(c_double_complex), intent(in) :: a(:) real(c_double), intent(out) :: re, im end subroutine subroutine c19_sum_cdouble_2d(a, re, im) bind(C, name="c19_sum_cdouble_2d") import :: c_double_complex, c_double complex(c_double_complex), intent(in) :: a(:,:) real(c_double), intent(out) :: re, im end subroutine ! ---- logical(c_bool) arrays ---- integer(c_int) function c19_count_true_1d(a) bind(C, name="c19_count_true_1d") import :: c_int, c_bool logical(c_bool), intent(in) :: a(:) end function integer(c_int) function c19_count_true_2d(a) bind(C, name="c19_count_true_2d") import :: c_int, c_bool logical(c_bool), intent(in) :: a(:,:) end function subroutine c19_flip_bool_1d(a) bind(C, name="c19_flip_bool_1d") import :: c_bool logical(c_bool), intent(inout) :: a(:) end subroutine ! ---- CONTIGUOUS attribute on assumed-shape ---- integer(c_int) function c19_sum_contiguous(a) bind(C, name="c19_sum_contiguous") import :: c_int integer(c_int), contiguous, intent(in) :: a(:) end function integer(c_int) function c19_is_contiguous_check(a) & bind(C, name="c19_is_contiguous_check") import :: c_int integer(c_int), contiguous, intent(in) :: a(:) end function end interface end module module bindc_24_mod use iso_c_binding, only: c_int8_t, c_int16_t, c_short, c_long, & c_long_long, c_size_t, c_intptr_t, c_ptrdiff_t, & c_bool, c_float_complex, c_double_complex, c_char, & c_int, c_float, c_double, c_int32_t implicit none interface ! ---- int8 ---- integer(c_int8_t) function c24_add_int8(a, b) & bind(C, name="c24_add_int8") import :: c_int8_t integer(c_int8_t), value :: a, b end function subroutine c24_double_int8(a) bind(C, name="c24_double_int8") import :: c_int8_t integer(c_int8_t), intent(inout) :: a end subroutine ! ---- int16 ---- integer(c_int16_t) function c24_add_int16(a, b) & bind(C, name="c24_add_int16") import :: c_int16_t integer(c_int16_t), value :: a, b end function subroutine c24_double_int16(a) bind(C, name="c24_double_int16") import :: c_int16_t integer(c_int16_t), intent(inout) :: a end subroutine ! ---- short ---- integer(c_short) function c24_add_short(a, b) & bind(C, name="c24_add_short") import :: c_short integer(c_short), value :: a, b end function ! ---- long ---- integer(c_long) function c24_add_long(a, b) & bind(C, name="c24_add_long") import :: c_long integer(c_long), value :: a, b end function ! ---- long_long ---- integer(c_long_long) function c24_add_long_long(a, b) & bind(C, name="c24_add_long_long") import :: c_long_long integer(c_long_long), value :: a, b end function ! ---- size_t ---- integer(c_size_t) function c24_add_size_t(a, b) & bind(C, name="c24_add_size_t") import :: c_size_t integer(c_size_t), value :: a, b end function ! ---- intptr_t ---- integer(c_intptr_t) function c24_add_intptr(a, b) & bind(C, name="c24_add_intptr") import :: c_intptr_t integer(c_intptr_t), value :: a, b end function ! ---- ptrdiff_t ---- integer(c_ptrdiff_t) function c24_add_ptrdiff(a, b) & bind(C, name="c24_add_ptrdiff") import :: c_ptrdiff_t integer(c_ptrdiff_t), value :: a, b end function ! ---- VALUE with logical(c_bool) ---- integer(c_int) function c24_bool_to_int(x) & bind(C, name="c24_bool_to_int") import :: c_int, c_bool logical(c_bool), value :: x end function ! ---- VALUE with complex(c_float_complex) ---- real(c_float) function c24_cabs_float(z) & bind(C, name="c24_cabs_float") import :: c_float, c_float_complex complex(c_float_complex), value :: z end function ! ---- VALUE with complex(c_double_complex) ---- real(c_double) function c24_cabs_double(z) & bind(C, name="c24_cabs_double") import :: c_double, c_double_complex complex(c_double_complex), value :: z end function ! ---- VALUE with character(c_char) ---- integer(c_int) function c24_char_to_int(ch) & bind(C, name="c24_char_to_int") import :: c_int, c_char character(kind=c_char, len=1), value :: ch end function ! ---- int8/int16 arrays through descriptors ---- integer(c_int) function c24_sum_int8_1d(a) & bind(C, name="c24_sum_int8_1d") import :: c_int, c_int8_t integer(c_int8_t), intent(in) :: a(:) end function integer(c_int) function c24_sum_int16_1d(a) & bind(C, name="c24_sum_int16_1d") import :: c_int, c_int16_t integer(c_int16_t), intent(in) :: a(:) end function ! ---- function returning complex ---- complex(c_float_complex) function c24_make_complex(re, im) & bind(C, name="c24_make_complex") import :: c_float_complex, c_float real(c_float), value :: re, im end function complex(c_double_complex) function c24_make_dcomplex(re, im) & bind(C, name="c24_make_dcomplex") import :: c_double_complex, c_double real(c_double), value :: re, im end function end interface end module program bindc_iso_fb_01 use bindc_18_mod use bindc_19_mod use bindc_24_mod use iso_c_binding implicit none ! --- Tests from bindc_18 --- call test_sum_int32() call test_sum_int64() call test_sum_float() call test_sum_double() call test_double_inplace() call test_assumed_rank() call test_allocatable() call test_pointer() call test_sections() call test_optional() ! --- Tests from bindc_19 --- call test_complex_float() call test_complex_double() call test_logical() call test_contiguous() ! --- Tests from bindc_24 --- call test_int8() call test_int16() call test_short() call test_long() call test_long_long() call test_size_t() call test_intptr() call test_ptrdiff() call test_bool_value() call test_complex_value() call test_char_value() call test_small_int_arrays() call test_complex_return() print *, "All bindc_iso_fb_01 tests passed." contains ! ================================================================== ! Tests from bindc_18: basic array descriptors ! ================================================================== subroutine test_sum_int32() integer(c_int32_t) :: a1(4), a2(2,3), a3(2,3,2) integer :: i a1 = [1, 2, 3, 4] a2 = reshape([1, 2, 3, 4, 5, 6], [2, 3]) a3 = reshape([(i, i=1,12)], [2, 3, 2]) if (c_sum_int32_1d(a1) /= 10) error stop "FAIL: int32 1d sum" if (c_sum_int32_2d(a2) /= 21) error stop "FAIL: int32 2d sum" if (c_sum_int32_3d(a3) /= 78) error stop "FAIL: int32 3d sum" end subroutine subroutine test_sum_int64() integer(c_int64_t) :: a1(4), a2(2,3), a3(2,3,2) integer :: i a1 = [1_c_int64_t, 2_c_int64_t, 3_c_int64_t, 4_c_int64_t] a2 = reshape([1_c_int64_t, 2_c_int64_t, 3_c_int64_t, & 4_c_int64_t, 5_c_int64_t, 6_c_int64_t], [2, 3]) a3 = reshape([(int(i, c_int64_t), i=1,12)], [2, 3, 2]) if (c_sum_int64_1d(a1) /= 10_c_int64_t) error stop "FAIL: int64 1d sum" if (c_sum_int64_2d(a2) /= 21_c_int64_t) error stop "FAIL: int64 2d sum" if (c_sum_int64_3d(a3) /= 78_c_int64_t) error stop "FAIL: int64 3d sum" end subroutine subroutine test_sum_float() real(c_float) :: a1(4), a2(2,3), a3(2,3,2) integer :: i a1 = [1.0, 2.0, 3.0, 4.0] a2 = reshape([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], [2, 3]) a3 = reshape([(real(i), i=1,12)], [2, 3, 2]) if (abs(c_sum_float_1d(a1) - 10.0) > 1.0e-5) error stop "FAIL: float 1d sum" if (abs(c_sum_float_2d(a2) - 21.0) > 1.0e-5) error stop "FAIL: float 2d sum" if (abs(c_sum_float_3d(a3) - 78.0) > 1.0e-5) error stop "FAIL: float 3d sum" end subroutine subroutine test_sum_double() real(c_double) :: a1(4), a2(2,3), a3(2,3,2) integer :: i a1 = [1.0d0, 2.0d0, 3.0d0, 4.0d0] a2 = reshape([1.0d0, 2.0d0, 3.0d0, 4.0d0, 5.0d0, 6.0d0], [2, 3]) a3 = reshape([(dble(i), i=1,12)], [2, 3, 2]) if (abs(c_sum_double_1d(a1) - 10.0d0) > 1.0d-10) error stop "FAIL: double 1d sum" if (abs(c_sum_double_2d(a2) - 21.0d0) > 1.0d-10) error stop "FAIL: double 2d sum" if (abs(c_sum_double_3d(a3) - 78.0d0) > 1.0d-10) error stop "FAIL: double 3d sum" end subroutine subroutine test_double_inplace() integer(c_int32_t) :: a1(4), a2(2,3), a3(2,3,2) integer :: i ! rank 1 a1 = [1, 2, 3, 4] call c_scale_int32_1d(a1) if (a1(1) /= 2 .or. a1(4) /= 8) error stop "FAIL: scale int32 1d" if (c_sum_int32_1d(a1) /= 20) error stop "FAIL: scale int32 1d sum" ! rank 2 a2 = reshape([1, 2, 3, 4, 5, 6], [2, 3]) call c_scale_int32_2d(a2) if (a2(1,1) /= 2 .or. a2(2,3) /= 12) error stop "FAIL: scale int32 2d" if (c_sum_int32_2d(a2) /= 42) error stop "FAIL: scale int32 2d sum" ! rank 3 a3 = reshape([(i, i=1,12)], [2, 3, 2]) call c_scale_int32_3d(a3) if (a3(1,1,1) /= 2 .or. a3(2,3,2) /= 24) error stop "FAIL: scale int32 3d" if (c_sum_int32_3d(a3) /= 156) error stop "FAIL: scale int32 3d sum" end subroutine subroutine test_assumed_rank() integer(c_int32_t) :: ai1(4), ai2(2,3), ai3(2,3,2) real(c_double) :: ad1(3) integer(c_int64_t) :: al1(2) integer :: i ai1 = [1, 2, 3, 4] ai2 = reshape([1, 2, 3, 4, 5, 6], [2, 3]) ai3 = reshape([(i, i=1,12)], [2, 3, 2]) ad1 = [1.0d0, 2.0d0, 3.0d0] al1 = [10_c_int64_t, 20_c_int64_t] ! rank query if (c_get_rank(ai1) /= 1) error stop "FAIL: rank of ai1" if (c_get_rank(ai2) /= 2) error stop "FAIL: rank of ai2" if (c_get_rank(ai3) /= 3) error stop "FAIL: rank of ai3" if (c_get_rank(ad1) /= 1) error stop "FAIL: rank of ad1" if (c_get_rank(al1) /= 1) error stop "FAIL: rank of al1" ! element size query if (c_get_elem_size(ai1) /= 4) error stop "FAIL: elem_size int32" if (c_get_elem_size(ad1) /= 8) error stop "FAIL: elem_size double" if (c_get_elem_size(al1) /= 8) error stop "FAIL: elem_size int64" ! assumed-rank sum (int32 passed as rank 1, 2, 3) if (c_sum_int32_ar(ai1) /= 10) error stop "FAIL: assumed-rank int32 1d" if (c_sum_int32_ar(ai2) /= 21) error stop "FAIL: assumed-rank int32 2d" if (c_sum_int32_ar(ai3) /= 78) error stop "FAIL: assumed-rank int32 3d" end subroutine subroutine test_allocatable() integer(c_int32_t), allocatable :: a(:) allocate(a(4)) a = [1, 2, 3, 4] ! sum through C if (c_sum_alloc_1d(a) /= 10) error stop "FAIL: alloc sum" ! attribute == CFI_attribute_allocatable if (c_attr_alloc(a) /= 1) error stop "FAIL: alloc attribute" ! in-place modification through C call c_double_alloc_1d(a) if (a(1) /= 2 .or. a(4) /= 8) error stop "FAIL: alloc double" if (c_sum_alloc_1d(a) /= 20) error stop "FAIL: alloc double sum" deallocate(a) end subroutine subroutine test_pointer() integer(c_int32_t), target :: tgt(6) integer(c_int32_t), pointer :: p(:) tgt = [10, 20, 30, 40, 50, 60] p => tgt ! sum full pointer if (c_sum_ptr_1d(p) /= 210) error stop "FAIL: ptr sum" ! attribute == CFI_attribute_pointer if (c_attr_ptr(p) /= 1) error stop "FAIL: ptr attribute" ! pointer to contiguous section p => tgt(2:4) if (c_sum_ptr_1d(p) /= 90) error stop "FAIL: ptr section sum" ! pointer to strided section p => tgt(1::2) if (c_sum_ptr_1d(p) /= 90) error stop "FAIL: ptr stride sum" end subroutine subroutine test_sections() integer(c_int32_t) :: arr(6) arr = [1, 2, 3, 4, 5, 6] ! stride-2: elements 1, 3, 5 if (c_sum_int32_1d(arr(::2)) /= 9) error stop "FAIL: stride-2" ! contiguous subarray: elements 2, 3, 4 if (c_sum_int32_1d(arr(2:4)) /= 9) error stop "FAIL: subarray" ! stride-3: elements 1, 4 if (c_sum_int32_1d(arr(1::3)) /= 5) error stop "FAIL: stride-3" ! contiguity: full array is contiguous if (c_is_contiguous(arr) /= 1) error stop "FAIL: contiguous" ! contiguity: strided section is not contiguous if (c_is_contiguous(arr(::2)) /= 0) error stop "FAIL: non-contiguous" ! attribute: regular assumed-shape has CFI_attribute_other if (c_attr_other(arr) /= 1) error stop "FAIL: other attr" end subroutine subroutine test_optional() integer(c_int32_t) :: arr(3) arr = [1, 2, 3] ! present argument if (c_is_present(arr) /= 1) error stop "FAIL: present" ! absent optional argument if (c_is_present() /= 0) error stop "FAIL: absent" end subroutine ! ================================================================== ! Tests from bindc_19: complex, logical, CONTIGUOUS ! ================================================================== subroutine test_complex_float() complex(c_float_complex) :: a1(3), a2(2,2) real(c_float) :: re, im a1 = [(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)] call c19_sum_cfloat_1d(a1, re, im) if (abs(re - 9.0) > 1.0e-5) error stop "FAIL: cfloat 1d real" if (abs(im - 12.0) > 1.0e-5) error stop "FAIL: cfloat 1d imag" a2 = reshape([(1.0, 1.0), (2.0, 2.0), (3.0, 3.0), (4.0, 4.0)], [2, 2]) call c19_sum_cfloat_2d(a2, re, im) if (abs(re - 10.0) > 1.0e-5) error stop "FAIL: cfloat 2d real" if (abs(im - 10.0) > 1.0e-5) error stop "FAIL: cfloat 2d imag" a1 = [(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)] call c19_scale_cfloat_1d(a1) if (abs(real(a1(1)) - 2.0) > 1.0e-5) error stop "FAIL: cfloat scale re" if (abs(aimag(a1(1)) - 4.0) > 1.0e-5) error stop "FAIL: cfloat scale im" end subroutine subroutine test_complex_double() complex(c_double_complex) :: a1(3), a2(2,2) real(c_double) :: re, im a1 = [(1.0d0, 2.0d0), (3.0d0, 4.0d0), (5.0d0, 6.0d0)] call c19_sum_cdouble_1d(a1, re, im) if (abs(re - 9.0d0) > 1.0d-10) error stop "FAIL: cdouble 1d real" if (abs(im - 12.0d0) > 1.0d-10) error stop "FAIL: cdouble 1d imag" a2 = reshape([(1.0d0, 1.0d0), (2.0d0, 2.0d0), & (3.0d0, 3.0d0), (4.0d0, 4.0d0)], [2, 2]) call c19_sum_cdouble_2d(a2, re, im) if (abs(re - 10.0d0) > 1.0d-10) error stop "FAIL: cdouble 2d real" if (abs(im - 10.0d0) > 1.0d-10) error stop "FAIL: cdouble 2d imag" end subroutine subroutine test_logical() logical(c_bool) :: a1(5), a2(2,3) a1 = [.true., .false., .true., .true., .false.] if (c19_count_true_1d(a1) /= 3) error stop "FAIL: bool count 1d" a2 = reshape([.true., .false., .true., .false., .true., .true.], [2, 3]) if (c19_count_true_2d(a2) /= 4) error stop "FAIL: bool count 2d" a1 = [.true., .false., .true., .true., .false.] call c19_flip_bool_1d(a1) if (a1(1) .neqv. .false.) error stop "FAIL: flip 1" if (a1(2) .neqv. .true.) error stop "FAIL: flip 2" end subroutine subroutine test_contiguous() integer(c_int) :: arr(6) integer :: i arr = [(i, i=1,6)] if (c19_sum_contiguous(arr) /= 21) error stop "FAIL: contiguous sum" if (c19_is_contiguous_check(arr) /= 1) error stop "FAIL: contiguous check" end subroutine ! ================================================================== ! Tests from bindc_24: scalar types and VALUE attribute ! ================================================================== subroutine test_int8() integer(c_int8_t) :: a, b, r, x a = 10_c_int8_t b = 20_c_int8_t r = c24_add_int8(a, b) if (r /= 30_c_int8_t) error stop "FAIL: int8 add" x = 7_c_int8_t call c24_double_int8(x) if (x /= 14_c_int8_t) error stop "FAIL: int8 double" end subroutine subroutine test_int16() integer(c_int16_t) :: a, b, r, x a = 1000_c_int16_t b = 2000_c_int16_t r = c24_add_int16(a, b) if (r /= 3000_c_int16_t) error stop "FAIL: int16 add" x = 123_c_int16_t call c24_double_int16(x) if (x /= 246_c_int16_t) error stop "FAIL: int16 double" end subroutine subroutine test_short() integer(c_short) :: r r = c24_add_short(100_c_short, 200_c_short) if (r /= 300_c_short) error stop "FAIL: short add" end subroutine subroutine test_long() integer(c_long) :: r r = c24_add_long(100000_c_long, 200000_c_long) if (r /= 300000_c_long) error stop "FAIL: long add" end subroutine subroutine test_long_long() integer(c_long_long) :: r r = c24_add_long_long(1000000000_c_long_long, & 2000000000_c_long_long) if (r /= 3000000000_c_long_long) error stop "FAIL: long_long add" end subroutine subroutine test_size_t() integer(c_size_t) :: r r = c24_add_size_t(100_c_size_t, 200_c_size_t) if (r /= 300_c_size_t) error stop "FAIL: size_t add" end subroutine subroutine test_intptr() integer(c_intptr_t) :: r r = c24_add_intptr(1000_c_intptr_t, 2000_c_intptr_t) if (r /= 3000_c_intptr_t) error stop "FAIL: intptr add" end subroutine subroutine test_ptrdiff() integer(c_ptrdiff_t) :: r r = c24_add_ptrdiff(500_c_ptrdiff_t, 600_c_ptrdiff_t) if (r /= 1100_c_ptrdiff_t) error stop "FAIL: ptrdiff add" end subroutine subroutine test_bool_value() logical(c_bool) :: t, f t = .true. f = .false. if (c24_bool_to_int(t) /= 1) error stop "FAIL: bool true" if (c24_bool_to_int(f) /= 0) error stop "FAIL: bool false" end subroutine subroutine test_complex_value() complex(c_float_complex) :: zf complex(c_double_complex) :: zd real(c_float) :: rf real(c_double) :: rd zf = (3.0, 4.0) rf = c24_cabs_float(zf) if (abs(rf - 5.0) > 1.0e-5) error stop "FAIL: cabs float" zd = (3.0d0, 4.0d0) rd = c24_cabs_double(zd) if (abs(rd - 5.0d0) > 1.0d-10) error stop "FAIL: cabs double" end subroutine subroutine test_char_value() if (c24_char_to_int('A') /= 65) error stop "FAIL: char A" if (c24_char_to_int('0') /= 48) error stop "FAIL: char 0" end subroutine subroutine test_small_int_arrays() integer(c_int8_t) :: a8(4) integer(c_int16_t) :: a16(4) a8 = [1_c_int8_t, 2_c_int8_t, 3_c_int8_t, 4_c_int8_t] if (c24_sum_int8_1d(a8) /= 10) error stop "FAIL: int8 array sum" a16 = [100_c_int16_t, 200_c_int16_t, 300_c_int16_t, 400_c_int16_t] if (c24_sum_int16_1d(a16) /= 1000) error stop "FAIL: int16 array sum" end subroutine subroutine test_complex_return() complex(c_float_complex) :: zf complex(c_double_complex) :: zd zf = c24_make_complex(3.0, 4.0) if (abs(real(zf) - 3.0) > 1.0e-5) error stop "FAIL: make_complex re" if (abs(aimag(zf) - 4.0) > 1.0e-5) error stop "FAIL: make_complex im" zd = c24_make_dcomplex(5.0d0, 6.0d0) if (abs(real(zd) - 5.0d0) > 1.0d-10) error stop "FAIL: make_dcomplex re" if (abs(aimag(zd) - 6.0d0) > 1.0d-10) error stop "FAIL: make_dcomplex im" end subroutine end program lfortran-0.63.0/integration_tests/intrinsics_284.f900000664000175000017500000001151515174404631022472 0ustar alastairalastairprogram intrinsics_284 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp) :: arg_x(15) real(sp) :: arg_y(15) real(dp) :: res_x(15) real(sp) :: res_y(15) real(dp) :: expected_res_x(15) real(sp) :: expected_res_y(15) real(dp) :: expected_x(10) real(sp) :: expected_y(10) real(dp) :: a = 1.5178181202_dp real(sp) :: b = 1.072816_sp real(dp) :: c = 1.5178181202_dp real(sp) :: d = 1.072816_sp real(dp), parameter :: res_dp(10) = acosh([1.62818828_dp, 1.51725372_dp, 1.29257208_dp, & 1.62818828_dp, 1.51725372_dp, 1.29257208_dp, 1.00_dp, 1.829362821_dp, 1.952716192_dp, 1.241626228_dp]) real(sp), parameter :: res_sp(10) = acosh([1.62818828_sp, 1.51725372_sp, 1.29257208_sp, & 1.62818828_sp, 1.51725372_sp, 1.29257208_sp, 1.00_sp, 1.829362821_sp, 1.952716192_sp, 1.241626228_sp]) expected_x = [1.0692176655903725_dp, 0.97769872817826375_dp, 0.74742740658933504_dp, & 1.0692176655903725_dp, 0.97769872817826375_dp, 0.74742740658933504_dp, 0.00_dp, & 1.2123022470110765_dp, 1.2892178294282344_dp, 0.68187653246421109_dp] arg_x = [1.67922251126_dp, 1.54363892699177885_dp, 1.29691551032790681_dp, & 1.67922251126401767_dp, 1.54363892699177885_dp, 1.29691551032790681_dp, 1.5707963267948966_dp, & 1.07796627122261770_dp, 1.2620530499450677_dp, 1.24404138779115148_dp, 1.7281628262782_dp, & 1.5707963267948966_dp, 1.07796627122261770_dp, 1.2620530499450677_dp, 1.24404138779115148_dp] arg_y = [1.679222465_sp, 1.543638885_sp, 1.296915501_sp, & 1.679222465_sp, 1.543638885_sp, 1.296915501_sp, 1.57079637_sp, & 1.077966249_sp, 1.262053013_sp, 1.244041398_sp, 1.7281628262782_sp, & 1.57079637_sp, 1.077966249_sp, 1.262053013_sp, 1.244041398_sp] expected_y = [1.06921768_sp, 0.977698743_sp, 0.747427344_sp, & 1.06921768_sp, 0.977698743_sp, 0.747427344_sp, 0.00_sp, & 1.21230233_sp, 1.28921783_sp, 0.681876600_sp] res_x = acosh(arg_x) res_y = acosh(arg_y) expected_res_x = [1.1079742559357899_dp, 1.0004749128435737_dp, 0.75270877751131104_dp, & 1.1079742559387682_dp, 1.0004749128435737_dp, 0.75270877751131104_dp, 1.0232274785475506_dp, & 0.39236130842345907_dp, 0.70900761659991784_dp, 0.68514914208529898_dp, 1.1434619762512719_dp, & 1.0232274785475506_dp, 0.39236130842345907_dp, 0.70900761659991784_dp, 0.68514914208529898_dp] expected_res_y = [1.10797417_sp, 1.00047481_sp, 0.752708793_sp, & 1.10797417_sp, 1.00047481_sp, 0.752708793_sp, 1.02322757_sp, & 0.392361164_sp, 0.709007561_sp, 0.685149193_sp, 1.14346206_sp, & 1.02322757_sp, 0.392361164_sp, 0.709007561_sp, 0.685149193_sp] do i = 1, size(res_dp) print *, res_dp(i) if (abs(res_dp(i) - expected_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_x) print *, res_x(i) if (abs(res_x(i)) - abs(expected_res_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_y(i)) > 1e-5) error stop end do do i = 1, size(res_y) print *, res_y(i) if (abs(res_y(i)) - abs(expected_res_y(i)) > 1e-5) error stop end do print *, acosh(a) if (abs(acosh(a)) - 0.97819318581773873_dp > 1e-12) error stop print *, acosh(1.5178181202_dp) if (abs(acosh(1.5178181202_dp) - 0.97819318581773873_dp) > 1e-12) error stop print *, acosh(b) if (acosh(b) - (0.379339129_sp) > 1e-5) error stop print *, acosh(1.072816_sp) if (acosh(1.072816_sp) - (0.379339129_sp) > 1e-5) error stop print *, acosh(c) if (acosh(c) - (0.97819318581773873_dp) > 1e-12) error stop print *, acosh(1.5178181202_dp) if (acosh(1.5178181202_dp) - (0.97819318581773873_dp) > 1e-12) error stop print *, acosh(d) if (acosh(d) - (0.379339129_sp) > 1e-5) error stop print *, acosh(1.072816_sp) if (acosh(1.072816_sp) - (0.379339129_sp) > 1e-5) error stop a = 1.271927291_dp b = 1.6382728_sp c = 1.271927291_dp d = 1.6382728_sp print *, acosh(a) if (abs(acosh(a) - (0.72170024457681714_dp)) > 1e-12) error stop print *, acosh(1.271927291_dp) if (abs(acosh(1.271927291_dp) - (0.72170024457681714_dp)) > 1e-12) error stop print *, acosh(b) if (acosh(b) - (1.07702732_sp) > 1e-5) error stop print *, acosh(1.6382728_sp) if (acosh(1.6382728_sp) - (1.07702732_sp) > 1e-5) error stop print *, acosh(c) if (acosh(c) - (0.72170024457681714_dp) > 1e-12) error stop print *, acosh(1.271927291_dp) if (acosh(1.271927291_dp) - (0.72170024457681714_dp) > 1e-12) error stop print *, acosh(d) if (acosh(d) - (1.07702732_sp) > 1e-5) error stop print *, acosh(1.6382728_sp) if (acosh(1.6382728_sp) - (1.07702732_sp) > 1e-5) error stop end programlfortran-0.63.0/integration_tests/assumed_type_02.c0000664000175000017500000000043315174404631022534 0ustar alastairalastair#include #include void check_cfi_type_int32(CFI_cdesc_t *desc, int32_t *ok) { *ok = (desc->type == CFI_type_int32_t) ? 1 : 0; } void check_cfi_type_real64(CFI_cdesc_t *desc, int32_t *ok) { *ok = (desc->type == CFI_type_double) ? 1 : 0; } lfortran-0.63.0/integration_tests/intrinsics_339.f900000664000175000017500000000106715174404631022474 0ustar alastairalastairprogram intrinsics_339 integer :: score(4) = [-1,1,1,2] print *, minloc([-1,1,1,2], 1, [.false., .true., .true., .true.]) if (minloc([-1,1,1,2], 1, [.false., .true., .true., .true.]) /= 2) error stop print *, minloc(score, mask=(score > 0)) if (any(minloc(score, mask=(score > 0)) /= 2)) error stop print *, minloc(score, 1, [.false., .true., .true., .true.]) if (minloc(score, 1, [.false., .true., .true., .true.]) /= 2) error stop print*, minloc([1, 2, 3], 1, .true.) if (minloc([1, 2, 3], 1, .true.) /= 1) error stop end programlfortran-0.63.0/integration_tests/file_18_data.txt0000664000175000017500000000001315174404631022340 0ustar alastairalastair 10001 lfortran-0.63.0/integration_tests/class_34.f900000664000175000017500000000065615174404631021327 0ustar alastairalastairprogram class_34 implicit none type :: val_type integer :: origin = 3 end type class(val_type), allocatable :: val1 allocate(val1) call sub(val1) print *, "Outside val1%origin: ", val1%origin if (val1%origin /= 5) error stop contains subroutine sub(val) type(val_type), allocatable, intent(out) :: val allocate(val) val%origin = 5 end subroutine sub end program class_34 lfortran-0.63.0/integration_tests/gpu_metal_22.f900000664000175000017500000000113115174404631022161 0ustar alastairalastairprogram gpu_metal_22 ! 2D matrix element-wise multiply (Hadamard product) implicit none integer, parameter :: m = 100, n = 100 real :: a(m, n), b(m, n), c(m, n), c_expected(m, n) integer :: i, j do j = 1, n do i = 1, m a(i, j) = real(i) * 0.1 b(i, j) = real(j) * 0.2 c(i, j) = 0.0 c_expected(i, j) = real(i) * 0.1 * real(j) * 0.2 end do end do do concurrent (i = 1:m, j = 1:n) c(i, j) = a(i, j) * b(i, j) end do do j = 1, n do i = 1, m if (abs(c(i, j) - c_expected(i, j)) > 1.0e-4) error stop end do end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/test_unsigned.f900000664000175000017500000000115715174404631022564 0ustar alastairalastairprogram unsigned_test implicit none ! 4 byte unsigned int type(unsigned) :: x integer(kind=4) :: y integer :: i x = 1 y = 1 do i = 1, 30 x = x * _lfortran_unsigned(2) y = y * 2 if ( x < _lfortran_unsigned(0) ) error stop if ( y < 0 ) error stop end do x = x * _lfortran_unsigned(2) y = y * 2 if ( x < _lfortran_unsigned(0) ) error stop if ( y > 0 ) error stop x = x * _lfortran_unsigned(2) y = y * 2 if ( x /= _lfortran_unsigned(0) ) error stop if ( y /= 0 ) error stop end program unsigned_test lfortran-0.63.0/integration_tests/arrays_op_14.f900000664000175000017500000000075515174404631022217 0ustar alastairalastairprogram arrays_op_14 implicit none integer :: y(3) real :: x(3), fvec(15) x = 1 y = 2.0 fvec = x(1) print *, fvec call verify(fvec, 1.0) fvec = y(2) print *, fvec call verify(fvec, 2.0) contains subroutine verify(array, value) real, intent(in) :: array(:), value integer :: i do i = lbound(array, 1), ubound(array, 1) if (abs(array(i) - value) > 1e-6) error stop end do end subroutine end program lfortran-0.63.0/integration_tests/flush_05.f900000664000175000017500000000034515174404631021334 0ustar alastairalastairprogram flush_05 implicit none integer :: ios character(len=256) :: msg flush(unit=10, iostat=ios, iomsg=msg) print *, 'ios =', ios if (ios == 0) error stop if (len_trim(msg) == 0) error stop end program flush_05 lfortran-0.63.0/integration_tests/openmp_30.f900000664000175000017500000000135015174404631021504 0ustar alastairalastairsubroutine matrix_multiplication(l, m, n) use omp_lib integer :: l, m, n, i, j, k integer :: seed double precision :: a(l, n), b(l, m), c(m, n) double precision :: start_time, end_time seed = 123456789 b = 121.124D0 c = 29124.012D0 start_time = omp_get_wtime() !$omp parallel do shared(a, b, c, l, m, n) private(i, j, k) do j = 1, n do i = 1, l a(i,j) = 0.0D+00 do k = 1, m a(i,j) = a(i,j) + b(i,k) * c(k,j) end do end do end do !$omp end parallel do end_time = omp_get_wtime() print *, "Time: ", end_time - start_time print *, "sum(a): ", sum(a) if (abs(sum(a) - (440952103687207.56D0)) > 1D-12) error stop end subroutine program openmp_30 call matrix_multiplication(500, 500, 500) end program lfortran-0.63.0/integration_tests/gpu_metal_187.f900000664000175000017500000000114615174404631022263 0ustar alastairalastairprogram gpu_metal_187 ! erf() called through a function invoked from do concurrent (GPU offload) implicit none integer, parameter :: n = 64 real :: x(n), y(n), y_expected(n) integer :: i do i = 1, n x(i) = real(i - 1) * 0.05 - 1.5 y_expected(i) = gelu_approx(x(i)) end do do concurrent (i = 1:n) y(i) = gelu_approx(x(i)) end do do i = 1, n if (abs(y(i) - y_expected(i)) > 1.0e-5) error stop end do print *, "PASSED" contains pure function gelu_approx(x) result(y) real, intent(in) :: x real :: y y = 0.5 * x * (1.0 + erf(x / sqrt(2.0))) end function end program lfortran-0.63.0/integration_tests/openmp_66.f900000664000175000017500000000114315174404631021515 0ustar alastairalastairprogram openmp_66 implicit none integer, parameter :: N = 100 integer :: i, sum_expected, sum_actual sum_actual = 0 sum_expected = (N*(N+1)) / 2 ! sum from 1 to N !$omp parallel do private(i) do i = 1, N !$omp atomic sum_actual = sum_actual + i !$omp end atomic end do !$omp end parallel do if (sum_actual /= sum_expected) then print *, 'Error: Incorrect result from atomic addition.' print *, 'Expected:', sum_expected, ' Got:', sum_actual error stop else print *, 'Test passed: atomic addition is correct. Sum =', sum_actual end if end program openmp_66lfortran-0.63.0/integration_tests/gpu_metal_01.f900000664000175000017500000000062115174404631022161 0ustar alastairalastairprogram gpu_metal_01 implicit none integer, parameter :: n = 1000 real :: x(n), y(n), y_expected(n), a integer :: i a = 2.0 do i = 1, n x(i) = real(i) y(i) = real(i) * 0.5 y_expected(i) = a * real(i) + real(i) * 0.5 end do do concurrent (i = 1:n) y(i) = a * x(i) + y(i) end do do i = 1, n if (abs(y(i) - y_expected(i)) > 1.0e-5) error stop end do print *, "PASSED" end program lfortran-0.63.0/integration_tests/operator_overloading_19.f900000664000175000017500000000265115174404631024446 0ustar alastairalastairmodule operator_overloading_19_mod1 implicit none ! Abstract base type type, abstract :: temp contains procedure(is_equal), deferred :: is_same generic :: operator(==) => is_same end type temp abstract interface logical function is_equal(this, other) import :: temp class(temp), intent(in) :: this, other end function is_equal end interface end module operator_overloading_19_mod1 module operator_overloading_19_mod2 use operator_overloading_19_mod1 implicit none type, extends(temp) :: temp1 integer :: id contains procedure :: is_same => temp1_is_same end type temp1 type, extends(temp1) :: temp2 real :: extra end type temp2 contains ! Compare two temp1 objects logical function temp1_is_same(this, other) class(temp1), intent(in) :: this class(temp), intent(in) :: other class(temp1), pointer :: other_t1 temp1_is_same = .false. select type(other_t1 => other) type is (temp1) temp1_is_same = (this%id == other_t1%id) type is (temp2) temp1_is_same = (this%id == other_t1%id) end select end function temp1_is_same end module operator_overloading_19_mod2 program operator_overloading_19 use operator_overloading_19_mod1 use operator_overloading_19_mod2 ! implicit none class(temp2), allocatable :: a, b allocate(a, b) a%id = 5 b%id = 5 if (.not. a == b) error stop end program operator_overloading_19 lfortran-0.63.0/integration_tests/intrinsics_174.f900000664000175000017500000000072115174404631022465 0ustar alastairalastairprogram intrinsics_174 integer :: y(1) integer :: z(1) integer :: w(1) y = [6] z = [5] w = [5] print *, shape([[1., 2., 3.], [4., 5., 6.]]) if (any(shape([[1., 2., 3.], [4., 5., 6.]]) /= y)) error stop print *, shape([[1., 2., 3.], [4., 5.]]) if (any(shape([[1., 2., 3.], [4., 5.]]) /= z)) error stop print *, shape([[1., 2.], [4., 5., 6.]]) if (any(shape([[1., 2.], [4., 5., 6.]]) /= w)) error stop end program lfortran-0.63.0/integration_tests/procedure_06.f900000664000175000017500000000130715174404631022203 0ustar alastairalastairmodule procedure_06_module contains subroutine cb(a,terminate) implicit none integer, intent(in), optional :: a logical, intent(out), optional :: terminate if (present(terminate)) then print *, 'terminate = ', terminate if (terminate) error stop end if end subroutine cb end module procedure_06_module program procedure_06 use procedure_06_module logical :: terminate_var call temp(cb) contains subroutine temp(call_back) implicit none procedure(cb) :: call_back logical :: terminate_var = .false. call call_back(terminate = terminate_var) end subroutine temp end program procedure_06 lfortran-0.63.0/integration_tests/assumed_rank_05.f900000664000175000017500000000074415174404631022672 0ustar alastairalastairprogram assumed_rank_05 implicit none real :: x(2,2,2) x = 1.0 if (.not. assumed(x)) error stop if (.not. all(elementl(x))) error stop print *, 'assumed rank:', assumed(x) print *, 'elemental :', elementl(x) contains pure logical function assumed(x) real, intent(in) :: x(..) assumed = .true. end function assumed elemental logical function elementl(x) real, intent(in) :: x elementl = .true. end function elementl end program assumed_rank_05 lfortran-0.63.0/integration_tests/allocate_46.f900000664000175000017500000000070215174404631022001 0ustar alastairalastairmodule allocate_46_mod implicit none contains subroutine test(n) integer, intent(in) :: n integer, allocatable :: arr(:) allocate(arr(2), source=n) if (arr(1) /= n) error stop if (arr(2) /= n) error stop if (size(arr) /= 2) error stop print *, arr end subroutine test end module allocate_46_mod program allocate_46 use allocate_46_mod implicit none call test(n=100) call test(n=200) end program allocate_46 lfortran-0.63.0/integration_tests/save_10.f900000664000175000017500000000054315174404631021145 0ustar alastairalastairsubroutine foo_save_10(reference) integer, intent(in) :: reference(2) integer, save :: calls(2) = [1, 1] calls = calls + 1 print *, 'FOO: ', calls, reference if (all(calls /= reference)) error stop end subroutine foo_save_10 program save_10 integer i do i=2,4 call foo_save_10([i,i]) end do end program save_10lfortran-0.63.0/integration_tests/iso_fortran_env_02.f900000664000175000017500000000475115174404631023412 0ustar alastairalastairprogram iso_fortran_env_02 use iso_fortran_env, only: character_storage_size, file_storage_size, & numeric_storage_size, iostat_eor, iostat_end, & integer_kinds, real_kinds, character_kinds, logical_kinds, & int8, int16, int32, int64, real32, real64, & input_unit, output_unit, error_unit, & iostat_inquire_internal_unit, & stat_unlocked, stat_locked, stat_locked_other_image, & stat_stopped_image, & compiler_version, compiler_options implicit none ! F2003: Storage sizes if (numeric_storage_size /= 32) error stop if (character_storage_size /= 8) error stop if (file_storage_size /= 8) error stop ! F2003: I/O status constants if (iostat_eor /= -2) error stop if (iostat_end /= -1) error stop ! F2008: I/O status constants ! iostat_inquire_internal_unit must be negative and different from ! iostat_end and iostat_eor if (iostat_inquire_internal_unit >= 0) error stop if (iostat_inquire_internal_unit == iostat_end) error stop if (iostat_inquire_internal_unit == iostat_eor) error stop ! F2003: I/O units if (input_unit /= 5) error stop if (output_unit /= 6) error stop if (error_unit /= 0) error stop ! F2003: Kind type parameters if (int8 /= 1) error stop if (int16 /= 2) error stop if (int32 /= 4) error stop if (int64 /= 8) error stop if (real32 /= 4) error stop if (real64 /= 8) error stop ! F2008/F2018: Kind arrays if (size(integer_kinds) /= 4) error stop if (integer_kinds(1) /= 1) error stop if (integer_kinds(2) /= 2) error stop if (integer_kinds(3) /= 4) error stop if (integer_kinds(4) /= 8) error stop if (size(real_kinds) /= 2) error stop if (real_kinds(1) /= 4) error stop if (real_kinds(2) /= 8) error stop if (size(character_kinds) /= 1) error stop if (character_kinds(1) /= 1) error stop if (size(logical_kinds) /= 4) error stop if (logical_kinds(1) /= 1) error stop if (logical_kinds(2) /= 2) error stop if (logical_kinds(3) /= 4) error stop if (logical_kinds(4) /= 8) error stop ! F2008: Coarray stat constants ! These just need to be defined and have distinct values from each other if (stat_unlocked == stat_locked) error stop if (stat_locked == stat_locked_other_image) error stop ! compiler_version and compiler_options if (len(compiler_version()) == 0) error stop if (len(compiler_options()) < 0) error stop end program iso_fortran_env_02 lfortran-0.63.0/integration_tests/matmul_01.f900000664000175000017500000001261415174404631021510 0ustar alastairalastair! Compile and run in Release mode with: ! gfortran -O3 -march=native -ffast-math -funroll-loops matmul_01.f90 && ./a.out ! To develop, compile and run with: ! gfortran -Wall -Wextra -Wimplicit-interface -g -fcheck=all -fbacktrace matmul_01.f90 && ./a.out module matmul_01_cpu implicit none contains subroutine matmul1(A, B, C) real, intent(in) :: A(:,:), B(:,:) real, intent(out) :: C(:,:) integer :: n integer :: i, j, k n = size(A, 1) C = 0 do j = 1, n do k = 1, n do i = 1, n C(i,j) = C(i,j) + A(i,k)*B(k,j) end do end do end do end subroutine ! The arguments A, B are swapped, ! and all accesses to A, B, C are tranposed subroutine kernel2(B, A, C, x, y, i1, s1) real, intent(in) :: A(:,:), B(:,:) real, intent(out) :: C(:,:) integer, intent(in) :: x, y, i1, s1 integer :: k !LF$ attributes simd :: A0, A1, A2, A3, A4, A5 real, dimension(8) :: A0, A1, A2, A3, A4, A5 !LF$ attributes simd :: u00, u01, u10, u11, u20, u21 !LF$ attributes simd :: u30, u31, u40, u41, u50, u51 real, dimension(8) :: u00, u01, u10, u11, u20, u21, u30, u31, & u40, u41, u50, u51 ! This function computes: !C(x:x+6-1, y:y+16-1) = C(x:x+6-1, y:y+16-1) + matmul( & ! A(x:x+6-1, i1:i1+s1-1), & ! B(i1:i1+s1-1, y:y+16-1) ) u00 = C(y :y+ 7,x+0) u01 = C(y+8:y+15,x+0) u10 = C(y :y+ 7,x+1) u11 = C(y+8:y+15,x+1) u20 = C(y :y+ 7,x+2) u21 = C(y+8:y+15,x+2) u30 = C(y :y+ 7,x+3) u31 = C(y+8:y+15,x+3) u40 = C(y :y+ 7,x+4) u41 = C(y+8:y+15,x+4) u50 = C(y :y+ 7,x+5) u51 = C(y+8:y+15,x+5) do k = i1, i1+s1-1 A0 = A(k,x+0) u00 = u00 + A0 * B(y :y+ 7,k) u01 = u01 + A0 * B(y+8:y+15,k) A1 = A(k,x+1) u10 = u10 + A1 * B(y :y+ 7,k) u11 = u11 + A1 * B(y+8:y+15,k) A2 = A(k,x+2) u20 = u20 + A2 * B(y :y+ 7,k) u21 = u21 + A2 * B(y+8:y+15,k) A3 = A(k,x+3) u30 = u30 + A3 * B(y :y+ 7,k) u31 = u31 + A3 * B(y+8:y+15,k) A4 = A(k,x+4) u40 = u40 + A4 * B(y :y+ 7,k) u41 = u41 + A4 * B(y+8:y+15,k) A5 = A(k,x+5) u50 = u50 + A5 * B(y :y+ 7,k) u51 = u51 + A5 * B(y+8:y+15,k) end do C(y :y+ 7,x+0) = u00 C(y+8:y+15,x+0) = u01 C(y :y+ 7,x+1) = u10 C(y+8:y+15,x+1) = u11 C(y :y+ 7,x+2) = u20 C(y+8:y+15,x+2) = u21 C(y :y+ 7,x+3) = u30 C(y+8:y+15,x+3) = u31 C(y :y+ 7,x+4) = u40 C(y+8:y+15,x+4) = u41 C(y :y+ 7,x+5) = u50 C(y+8:y+15,x+5) = u51 end subroutine subroutine matmul2(A, B, C) real, intent(in) :: A(:,:), B(:,:) real, intent(out) :: C(:,:) integer :: s1, s2, s3, n integer :: i1, i2, i3, x, y n = size(A, 1) ! Use the commented out numbers for a good benchmark s3 = 48 ! 64 s2 = 12 ! 120 s1 = 24 ! 240 C = 0 do i3 = 1, n, s3 do i2 = 1, n, s2 do i1 = 1, n, s1 do x = i2, i2+s2-1, 6 do y = i3, i3+s3-1, 16 call kernel2(A, B, C, x, y, i1, s1) end do end do end do end do end do end subroutine end module program matmul_01 use matmul_01_cpu, only: matmul1, matmul2 implicit none integer, parameter :: dp = kind(0.d0) integer :: n, iter, i real(dp) :: t1, t2, t, GHz, fma_clock, freq, measured, percent_peak real, allocatable :: A(:,:), B(:,:), C(:,:), C2(:,:) real :: err ! Use n = 960 for a good benchmark n = 96 ! Increase `iter` so that the total time for a given benchmark is about 1s ! in order to get accurate timings iter = 1 print *, "Size (n x n): n =", n print *, "Iter =", iter print *, "Size MB:", 4._dp*n*n/1024**2 allocate(A(n,n), B(n,n), C(n,n), C2(n,n)) call random_number(A) call random_number(B) print *, "Fortran intrinsic matmul:" call cpu_time(t1) do i = 1, iter C = matmul(A, B) end do call cpu_time(t2) t = (t2-t1)/iter GHz = 1e9_dp fma_clock = 0.0625_dp ! This is CPU specific (Apple M1 number here) freq = 3.2_dp*GHz measured = t * freq / n**3 percent_peak = fma_clock / measured * 100 print *, "Time: ", t print *, "Clock cycles per element:" print *, "Theoretical performance peak:", fma_clock, "cycles" print *, "Measured: ", measured, "cycles" print *, "Percent peak: ", percent_peak, "%" print * print *, "matmul2:" call cpu_time(t1) do i = 1, iter call matmul2(A, B, C2) end do call cpu_time(t2) err = maxval(abs(C-C2)) print *, "Error:", err t = (t2-t1)/iter GHz = 1e9_dp fma_clock = 0.0625_dp freq = 3.2_dp*GHz measured = t * freq / n**3 percent_peak = fma_clock / measured * 100 print *, "Time: ", t print *, "Clock cycles per element:" print *, "Theoretical performance peak:", fma_clock, "cycles" print *, "Measured: ", measured, "cycles" print *, "Percent peak: ", percent_peak, "%" if (err > 1e-3) error stop print * print *, "matmul1:" call cpu_time(t1) do i = 1, iter call matmul1(A, B, C2) end do call cpu_time(t2) err = maxval(abs(C-C2)) print *, "Error:", err t = (t2-t1)/iter GHz = 1e9_dp fma_clock = 0.0625_dp freq = 3.2_dp*GHz measured = t * freq / n**3 percent_peak = fma_clock / measured * 100 print *, "Time: ", t print *, "Clock cycles per element:" print *, "Theoretical performance peak:", fma_clock, "cycles" print *, "Measured: ", measured, "cycles" print *, "Percent peak: ", percent_peak, "%" if (err > 1e-3) error stop end program lfortran-0.63.0/integration_tests/intrinsics_271.f900000664000175000017500000000205515174404631022465 0ustar alastairalastairprogram intrinsics_271 implicit none integer(4), parameter :: i1 = leadz(1050) integer(8), parameter :: i2 = leadz(00) integer, parameter :: ar1(3) = leadz([82471095, 829012001, 039024800]) integer(4) :: i3 = 283200001 integer(8) :: i4 = 289000001 integer(4) :: arr1(3) = [82471095, 829012001, 039024800] integer(8) :: arr2(3) = [13471095, 8290000, 0392414800] print *, i1 if (i1 /= 21) error stop print *, i2 if (i2 /= 32) error stop print *, ar1 if (any(ar1 /= [5, 2, 6])) error stop print *, leadz(i3) if (leadz(i3) /= 3) error stop print *, leadz(i4) if (leadz(i4) /= 35) error stop print *, leadz(arr1) if (any(leadz(arr1) /= [5, 2, 6])) error stop print *, leadz(arr2) if (any(leadz(arr2) /= [40, 41, 35])) error stop print *, kind(leadz(0)) if (kind(leadz(0)) /= 4) error stop print *, kind(leadz(0_4)) if (kind(leadz(0_4)) /= 4) error stop print *, kind(leadz(0_8)) ! if (kind(leadz(0_8)) /= 4) error stop ! Gives wrong output #4361 end programlfortran-0.63.0/integration_tests/implicit_interface_19.f900000664000175000017500000000055115174404631024051 0ustar alastairalastairsubroutine xyzzy (i) integer :: i i = max (i, ifunc (42)) print *, ifunc (42) end subroutine subroutine xyyzzy (i) integer :: i i = dim (i, ifunc (42)) print *, ifunc (42) end subroutine program implicit_interface_19 integer :: i i = 1245 call xyzzy (i) print *, i if ( i /= 38304 ) error stop call xyyzzy (i) print *, i if ( i /= 0 ) error stop end program lfortran-0.63.0/integration_tests/intrinsics_326.f900000664000175000017500000000060315174404631022463 0ustar alastairalastairprogram intrinsics_326 integer :: A(3) A = [1, 9, -1] call temp(A) contains subroutine temp(xpt) integer, intent(in) :: xpt(:) logical :: y(size(xpt)) integer :: iubd real :: subd_test(size(xpt)) subd_test = [1.0, 9.0, -1.0] y = .true. print *, minloc(subd_test, mask = y) if (any(minloc(subd_test, mask = y) /= 3)) error stop end subroutine end program lfortran-0.63.0/integration_tests/format_46.f900000664000175000017500000000107615174404631021512 0ustar alastairalastairprogram format_46 implicit none integer :: i, j real :: x character(8) :: string1, string2 string1 = '42' read (string1, 100) i print 100, i if (i /= 42) error stop 100 format (I3) string1 = ' 123 ' read (string1, '(I5)') j if (j /= 123) error stop print *, 'j =', j string2 = '3.14159 ' read (string2, '(F7.5)') x if (abs(x - 3.14159) > 0.0001) error stop print *, 'x =', x string1 = '-99 ' read (string1, '(I4)') i if (i /= -99) error stop print *, 'i =', i end program format_46 lfortran-0.63.0/integration_tests/print_arr_04.f900000664000175000017500000000016015174404631022205 0ustar alastairalastairprogram expr2 implicit none integer :: _arr(1) = [89] if (_arr(1) /= 89) error stop print *, _arr end program lfortran-0.63.0/integration_tests/test_ieee_real.f900000664000175000017500000000350015174404631022654 0ustar alastairalastair! Test ieee_real function program test_ieee_real use, intrinsic :: ieee_arithmetic use, intrinsic :: iso_fortran_env, only: real32, real64, int64 implicit none integer :: i32 integer(int64) :: i64 real(real32) :: r_sp, x_sp real(real64) :: r_dp, x_dp print *, "Testing ieee_real..." ! Test 1: Convert integer to single precision i32 = 42 x_sp = 0.0_real32 ! Used for kind r_sp = ieee_real(i32, x_sp) print *, "ieee_real(42, real32) = ", r_sp if (abs(r_sp - 42.0_real32) > 1.0e-6) error stop "42 should convert to 42.0" ! Test 2: Negative integer i32 = -17 r_sp = ieee_real(i32, x_sp) print *, "ieee_real(-17, real32) = ", r_sp if (abs(r_sp - (-17.0_real32)) > 1.0e-6) error stop "-17 should convert to -17.0" ! Test 3: Zero i32 = 0 r_sp = ieee_real(i32, x_sp) print *, "ieee_real(0, real32) = ", r_sp if (r_sp /= 0.0_real32) error stop "0 should convert to 0.0" ! Test 4: Convert integer to double precision i32 = 100 x_dp = 0.0_real64 ! Used for kind r_dp = ieee_real(i32, x_dp) print *, "ieee_real(100, real64) = ", r_dp if (abs(r_dp - 100.0_real64) > 1.0e-10) error stop "100 should convert to 100.0d0" ! Test 5: Large integer (int64) to single precision i64 = 999_int64 r_sp = ieee_real(i64, x_sp) print *, "ieee_real(999_int64, real32) = ", r_sp if (abs(r_sp - 999.0_real32) > 1.0e-6) error stop "999 should convert to 999.0" ! Test 6: Large integer (int64) to double precision i64 = 123456_int64 r_dp = ieee_real(i64, x_dp) print *, "ieee_real(123456_int64, real64) = ", r_dp if (abs(r_dp - 123456.0_real64) > 1.0e-10) error stop "123456 should convert to 123456.0d0" print *, "All ieee_real tests passed!" end program test_ieee_real lfortran-0.63.0/integration_tests/bindc_01.f900000664000175000017500000000120415174404631021261 0ustar alastairalastair! Tests c_ptr, c_f_pointer, c_loc program bindc_01 use iso_c_binding, only: c_ptr, c_loc, c_f_pointer use bindc_01b, only: ret_ptr, ret_ptr_unspecified_intent, print_ptr implicit none type(c_ptr) :: cptr type(c_ptr) :: cptr1 real, pointer :: a(:) real, pointer :: a1(:) real, target :: b(3) integer :: i call ret_ptr(cptr) call c_f_pointer(cptr, a, [12]) do i = 1, size(a) a(i) = i end do call print_ptr(12, c_loc(a)) call ret_ptr_unspecified_intent(cptr1) call c_f_pointer(cptr1, a1, [12]) do i = 1, size(a1) a1(i) = i end do call print_ptr(12, c_loc(a1)) do i = 1, size(b) b(i) = 10 + i end do call print_ptr(3, c_loc(b)) end lfortran-0.63.0/integration_tests/arrays_68.f900000664000175000017500000000023515174404631021523 0ustar alastairalastairprogram arrays_68 integer :: A(4) = [1,2,3,4] A([1,2]) = [5,5] print *, A if (A(1) /= 5) error stop if (A(2) /= 5) error stop end programlfortran-0.63.0/integration_tests/namelist_12.f900000664000175000017500000001007015174404631022021 0ustar alastairalastairprogram test_iostat implicit none integer :: arr(10) real :: val integer :: iostat_val integer :: i namelist /test/ arr, val ! Test 1: Successful read (iostat = 0) arr = -999 val = -999.0 open(unit=10, file='namelist_iostat_success.dat', status='replace', form='formatted') write(10, '(A)') ' &TEST' write(10, '(A)') ' arr = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10' write(10, '(A)') ' val = 42.5' write(10, '(A)') ' /' close(10) open(unit=10, file='namelist_iostat_success.dat', status='old', form='formatted') read(10, nml=test, iostat=iostat_val) close(10) if (iostat_val /= 0) then print *, "Error: Expected iostat=0 for successful read, got", iostat_val error stop "Test 1 failed" end if if (arr(5) /= 5 .or. abs(val - 42.5) > 1.0e-5) then print *, "Error: Data read incorrectly" error stop "Test 1 failed - data mismatch" end if print *, "Test 1 passed: Successful read with iostat=0" ! Test 2: Array index out of bounds (iostat = 5015) arr = -999 open(unit=20, file='namelist_iostat_bounds.dat', status='replace', form='formatted') write(20, '(A)') ' &TEST' write(20, '(A)') ' arr(20) = 99' ! Index 20 is out of bounds (array size is 10) write(20, '(A)') ' /' flush(20) close(20) open(unit=20, file='namelist_iostat_bounds.dat', status='old', form='formatted') read(20, nml=test, iostat=iostat_val) close(20) #ifdef __LFORTRAN__ if (iostat_val /= 5015) then #else if (iostat_val == 0) then #endif print *, "Error: Expected iostat=5015 for bounds error, got", iostat_val error stop "Test 2 failed" end if print *, "Test 2 passed: Bounds error detected with iostat=5015, got", iostat_val ! Test 3: Repeat count overflow (iostat = 5015) arr = -999 open(unit=30, file='namelist_iostat_repeat.dat', status='replace', form='formatted') write(30, '(A)') ' &TEST' write(30, '(A)') ' arr = 15*1' ! Repeat count 15 exceeds array size 10 write(30, '(A)') ' /' flush(30) close(30) open(unit=30, file='namelist_iostat_repeat.dat', status='old', form='formatted') read(30, nml=test, iostat=iostat_val) close(30) #ifdef __LFORTRAN__ if (iostat_val /= 5015) then #else if (iostat_val == 0) then #endif print *, "Error: Expected iostat=5015 for repeat overflow, got", iostat_val error stop "Test 3 failed" end if print *, "Test 3 passed: Repeat count overflow detected with iostat=5015, got", iostat_val ! Test 4: Unknown variable (iostat = 5012) arr = -999 open(unit=40, file='namelist_iostat_unknown.dat', status='replace', form='formatted') write(40, '(A)') ' &TEST' write(40, '(A)') ' unknown_var = 123' write(40, '(A)') ' /' flush(40) close(40) open(unit=40, file='namelist_iostat_unknown.dat', status='old', form='formatted') read(40, nml=test, iostat=iostat_val) close(40) #ifdef __LFORTRAN__ if (iostat_val /= 5012) then #else if (iostat_val == 0) then #endif print *, "Error: Expected iostat=5012 for unknown variable, got", iostat_val error stop "Test 4 failed" end if print *, "Test 4 passed: Unknown variable detected with iostat=5012, got", iostat_val ! Test 5: Group not found (iostat = 5010) arr = -999 open(unit=50, file='namelist_iostat_notfound.dat', status='replace', form='formatted') write(50, '(A)') ' &WRONG_GROUP' write(50, '(A)') ' arr = 1, 2, 3' write(50, '(A)') ' /' flush(50) close(50) open(unit=50, file='namelist_iostat_notfound.dat', status='old', form='formatted') read(50, nml=test, iostat=iostat_val) close(50) #ifdef __LFORTRAN__ if (iostat_val /= 5010) then #else if (iostat_val == 0) then #endif print *, "Error: Expected iostat=5010 for group not found, got", iostat_val error stop "Test 5 failed" end if print *, "Test 5 passed: Group not found detected with iostat=5010, got", iostat_val print *, "All IOSTAT error handling tests passed!" end program test_iostat lfortran-0.63.0/integration_tests/lapack_06.f900000664000175000017500000000104015174404631021440 0ustar alastairalastair! MRE from LAPACK stfsm.f: 0-based assumed-size dummy A(0:*) ! Pattern: sequence association when passing A(m) to X(*) program lapack_06 implicit none real :: A(0:10) A = 1.0 call stfsm(A) print *, "PASS" end program subroutine stfsm(A) implicit none real :: A(0:*) integer :: M M = 5 ! Sequence association: pass element A(M) to assumed-size dummy X(*) call sub(A(M)) end subroutine subroutine sub(X) implicit none real :: X(*) if (X(1) /= 1.0) error stop "Wrong value" end subroutine lfortran-0.63.0/integration_tests/format_51.f900000664000175000017500000000170015174404631021500 0ustar alastairalastairprogram format_51 ! Test binary (B) format descriptor implicit none integer :: i character(50) :: str ! Binary format tests print "(A,B32.32)", 'binary 2: ', 2 print "(A,B8.8)", 'binary 255: ', 255 print "(A,B16.16)", 'binary -1: ', -1 print "(A,B0)", 'binary 42: ', 42 print "(A,B10)", 'binary 7: ', 7 print "(B5.5)", 15 print "(B3.3)", 4 ! Verify with write statements write(str, "(B32.32)") 2 if (trim(adjustl(str)) /= "00000000000000000000000000000010") error stop "B32.32 failed" write(str, "(B8.8)") 255 if (trim(adjustl(str)) /= "11111111") error stop "B8.8 failed" write(str, "(B0)") 42 if (trim(adjustl(str)) /= "101010") error stop "B0 failed" write(str, "(B10)") 7 if (trim(adjustl(str)) /= "111") error stop "B10 failed" write(str, "(B5.5)") 15 if (trim(adjustl(str)) /= "01111") error stop "B5.5 failed" print *, "PASSED" end program format_51 lfortran-0.63.0/integration_tests/gpu_metal_135_mod.f900000664000175000017500000000053715174404631023116 0ustar alastairalastairmodule gpu_metal_135_m implicit none type :: my_t integer :: val end type interface pure module function make_t(v) result(t) integer, intent(in) :: v type(my_t) :: t end function end interface end module submodule(gpu_metal_135_m) gpu_metal_135_sub implicit none contains module procedure make_t t%val = v end procedure end submodule lfortran-0.63.0/integration_tests/modules_34_module1.f900000664000175000017500000000043615174404631023314 0ustar alastairalastairmodule fpm_manifest_package_modules_34 use fpm_versioning_modules_34, only : version_t implicit none type :: package_config_t character(len=:), allocatable :: name type(version_t) :: version end type package_config_t end module fpm_manifest_package_modules_34 lfortran-0.63.0/integration_tests/string_17.f900000664000175000017500000000163715174404631021531 0ustar alastairalastairmodule string_17_string_module implicit none type :: string_type sequence private character(len=:), allocatable :: raw end type string_type interface len module procedure :: len_string end interface contains elemental function len_string(string) result(length) type(string_type), intent(in) :: string integer :: length if (allocated(string%raw)) then length = len(string%raw) else length = 0 end if end function len_string pure function maybe(string) result(maybe_string) type(string_type), intent(in) :: string character(len=len(string)) :: maybe_string if (allocated(string%raw)) then maybe_string = string%raw else maybe_string = '' end if end function maybe end modulelfortran-0.63.0/integration_tests/derived_types_42.f900000664000175000017500000000117115174404631023060 0ustar alastairalastairmodule derived_types_42_mod implicit none type twoint integer :: m1 integer :: m2 end type interface twoint procedure :: reverse_constructor end interface contains function reverse_constructor(i, j) result(n) integer, intent(in) :: i, j type(twoint) :: n n%m1 = j n%m2 = i end function end module derived_types_42_mod program derived_types_42 use derived_types_42_mod implicit none type(twoint) :: ins ins = twoint(1, 2) if (ins%m1 /= 2 .or. ins%m2 /= 1) error stop end program derived_types_42 lfortran-0.63.0/integration_tests/format_34.f900000664000175000017500000000044115174404631021502 0ustar alastairalastairprogram format_34 implicit none integer,parameter:: k(3) = [-1,2,3] print "(A,3(1X,I0))",'mainline k =', k call format_34_subprogram contains subroutine format_34_subprogram print "(A,3(1X,I0))",'internal k =', k end subroutine format_34_subprogram end program format_34 lfortran-0.63.0/integration_tests/gpu_metal_82.f900000664000175000017500000000155315174404631022177 0ustar alastairalastairprogram gpu_metal_82 ! Whole-array scalar assignment inside do concurrent implicit none integer :: i real :: x(4) real :: y(2, 3) integer :: a(3) ! 1D array broadcast do concurrent (i = 1:1) x = 2.5 end do if (abs(x(1) - 2.5) > 1.0e-5) error stop if (abs(x(2) - 2.5) > 1.0e-5) error stop if (abs(x(3) - 2.5) > 1.0e-5) error stop if (abs(x(4) - 2.5) > 1.0e-5) error stop ! 2D array broadcast do concurrent (i = 1:1) y = 3.0 end do if (abs(y(1,1) - 3.0) > 1.0e-5) error stop if (abs(y(2,1) - 3.0) > 1.0e-5) error stop if (abs(y(1,2) - 3.0) > 1.0e-5) error stop if (abs(y(2,2) - 3.0) > 1.0e-5) error stop if (abs(y(1,3) - 3.0) > 1.0e-5) error stop if (abs(y(2,3) - 3.0) > 1.0e-5) error stop ! Integer array broadcast do concurrent (i = 1:1) a = 7 end do if (a(1) /= 7) error stop if (a(2) /= 7) error stop if (a(3) /= 7) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/intrinsics_340.f900000664000175000017500000000040215174404631022454 0ustar alastairalastairprogram intrinsics_340 print *, leadz(0_8) if (leadz(0_8) /= 64) error stop if (kind(leadz(0_8)) /= 4) error stop print *, leadz(5_8) if (leadz(5_8) /= 61) error stop if (kind(leadz(5_8)) /= 4) error stop end program intrinsics_340lfortran-0.63.0/integration_tests/case_02.f900000664000175000017500000000323315174404631021122 0ustar alastairalastairprogram case_02 implicit none ! local variable declaration integer :: marks, out marks = 81 select case (marks) case (91:100) out = 0 print*, "Excellent!" case (81:90) out = 1 print*, "Very good!" case (71:80) out = 2 print*, "Well done!" case (61:70) out = 3 print*, "Not bad!" case (41:60) out = 4 print*, "You passed!" case (:40) out = 5 print*, "Better try again!" case default out = 6 print*, "Invalid marks" end select print*, "Your marks are ", marks if (out /= 1) error stop ! case default at the top select case (marks) case default print*, "Invalid marks" case (91:100) print*, "Excellent!" case (81:90) print*, "Very good!" case (71:80) print*, "Well done!" case (61:70) print*, "Not bad!" case (41:60) print*, "You passed!" case (:40) print*, "Better try again!" end select print*, "Your marks are ", marks ! case default in the middle select case (marks) case (91:100) print*, "Excellent!" case (81:90) print*, "Very good!" case default print*, "Invalid marks" case (71:80) print*, "Well done!" case (61:70) print*, "Not bad!" case (41:60) print*, "You passed!" case (:40) print*, "Better try again!" end select print*, "Your marks are ", marks end program lfortran-0.63.0/integration_tests/gpu_metal_85.f900000664000175000017500000000111715174404631022176 0ustar alastairalastairmodule gpu_metal_85_m implicit none contains pure function compute(x) result(r) real, intent(in) :: x real, allocatable :: r(:) allocate(r(1)) r(1) = x * 2.0 end function end module program gpu_metal_85 use gpu_metal_85_m implicit none real :: a(4), b(4) integer :: i b = [1.0, 2.0, 3.0, 4.0] do concurrent (i = 1:4) a(i:i) = compute(b(i)) end do if (abs(a(1) - 2.0) > 1e-5) error stop if (abs(a(2) - 4.0) > 1e-5) error stop if (abs(a(3) - 6.0) > 1e-5) error stop if (abs(a(4) - 8.0) > 1e-5) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/gpu_metal_81.f900000664000175000017500000000257515174404631022203 0ustar alastairalastairprogram gpu_metal_81 ! matmul inside do concurrent (matrix-vector and matrix-matrix) implicit none real :: a(2,2), b(2), c(2) real :: m1(2,3), m2(3,2), m3(2,2) real :: v(2), w(3) integer :: i ! Matrix-vector: a(2,2) * b(2) = c(2) a(1,1) = 1.0; a(2,1) = 3.0 a(1,2) = 2.0; a(2,2) = 4.0 b(1) = 5.0; b(2) = 6.0 do concurrent (i = 1:1) c = matmul(a, b) end do ! c(1) = 1*5 + 2*6 = 17, c(2) = 3*5 + 4*6 = 39 if (abs(c(1) - 17.0) > 1.0e-5) error stop if (abs(c(2) - 39.0) > 1.0e-5) error stop ! Vector-matrix: v(2) * m1(2,3) = w(3) m1(1,1) = 1.0; m1(2,1) = 2.0 m1(1,2) = 3.0; m1(2,2) = 4.0 m1(1,3) = 5.0; m1(2,3) = 6.0 v(1) = 1.0; v(2) = 2.0 do concurrent (i = 1:1) w = matmul(v, m1) end do ! w(1) = 1*1 + 2*2 = 5, w(2) = 1*3 + 2*4 = 11, w(3) = 1*5 + 2*6 = 17 if (abs(w(1) - 5.0) > 1.0e-5) error stop if (abs(w(2) - 11.0) > 1.0e-5) error stop if (abs(w(3) - 17.0) > 1.0e-5) error stop ! Matrix-matrix: m1(2,3) * m2(3,2) = m3(2,2) m2(1,1) = 1.0; m2(2,1) = 3.0; m2(3,1) = 5.0 m2(1,2) = 2.0; m2(2,2) = 4.0; m2(3,2) = 6.0 do concurrent (i = 1:1) m3 = matmul(m1, m2) end do ! m3(1,1) = 1*1+3*3+5*5 = 35, m3(2,1) = 2*1+4*3+6*5 = 44 ! m3(1,2) = 1*2+3*4+5*6 = 44, m3(2,2) = 2*2+4*4+6*6 = 56 if (abs(m3(1,1) - 35.0) > 1.0e-5) error stop if (abs(m3(2,1) - 44.0) > 1.0e-5) error stop if (abs(m3(1,2) - 44.0) > 1.0e-5) error stop if (abs(m3(2,2) - 56.0) > 1.0e-5) error stop print *, "PASSED" end program lfortran-0.63.0/integration_tests/openmp_16.f900000664000175000017500000000163415174404631021515 0ustar alastairalastairsubroutine initialize_array(n, m, b) implicit none integer, intent(in) :: n, m double precision, intent(out) :: b(n, m) integer :: i !$omp parallel shared(b, n) private(i) !$omp do do i = 1, n b(i, :) = 12.9d0 end do !$omp end do !$omp end parallel end subroutine subroutine parallel_sum(n, m, b) implicit none integer, intent(in) :: n, m double precision, intent(out) :: b(n, m) double precision :: res integer :: i res = 0.0d0 !$omp parallel shared(b, n) private(i) reduction(+:res) !$omp do do i = 1, n res = res + sum(b(i, :)) end do !$omp end do !$omp end parallel print *, 'Sum = ', res if (abs(res - 7455168.0000000438d0) > 1e-12) error stop end subroutine program openmp_16 use omp_lib integer, parameter :: n = 1920, m = 301 double precision, dimension(n, m) :: a print *, a(2, 3) call omp_set_num_threads(8) call initialize_array(n, m, a) print *, a(2, 3) call parallel_sum(n, m, a) end program lfortran-0.63.0/integration_tests/arrays_79.f900000664000175000017500000000074415174404631021532 0ustar alastairalastairmodule arrays_79_mod contains subroutine ff(q) integer, intent(in) :: q(:,:) integer :: anew(size(q)) integer :: anew2(4) anew2 = [q] print *, anew2 anew = reshape(anew2, [size(q)]) print *, anew if(any(anew /= [1,2,3,4])) error stop end subroutine ff end module arrays_79_mod program arrays_79 use arrays_79_mod integer :: arr(2,2) arr = reshape([1,2,3,4], [2,2]) call ff(arr) end program arrays_79lfortran-0.63.0/integration_tests/procedure_39.f900000664000175000017500000000253215174404631022212 0ustar alastairalastair! Test that the promote_allocatable_to_nonallocatable optimization pass ! does not crash when a procedure pointer component in a derived type ! with an allocatable character component is called via a class (polymorphic) ! dummy argument. The subroutine_from_function pass can produce calls ! where n_args exceeds the function type's n_arg_types. module procedure_39_mod implicit none type :: result_t logical :: passed = .false. end type abstract interface function result_fn_i() result(r) import result_t type(result_t) :: r end function end interface type :: desc_t character(len=:), allocatable :: text procedure(result_fn_i), pointer, nopass :: get_result => null() contains procedure :: run end type contains function make_pass() result(r) type(result_t) :: r r%passed = .true. end function subroutine run(self) class(desc_t), intent(in) :: self type(result_t) :: res if (associated(self%get_result)) then res = self%get_result() if (.not. res%passed) error stop end if end subroutine end module program procedure_39 use procedure_39_mod implicit none type(desc_t) :: d ! Test with null procedure pointer (should not call) call d%run() ! Test with assigned procedure pointer d%get_result => make_pass call d%run() print *, "ok" end program lfortran-0.63.0/integration_tests/string_41.f900000664000175000017500000000063115174404631021517 0ustar alastairalastairprogram string_41 print *, real_sp_to_string() if (real_sp_to_string() /= 'TestingLFortran') error stop contains pure function real_sp_to_string() result(string) character(len=:), allocatable :: string integer, parameter :: buffer_len = 128 character(len=buffer_len) :: buffer buffer = 'TestingLFortran' string = trim(buffer) end function real_sp_to_string end program lfortran-0.63.0/integration_tests/pointer_14.f900000664000175000017500000000053015174404631021667 0ustar alastairalastairprogram pointer_14 implicit none type :: my_type integer :: x end type my_type type(my_type), target :: my_var type(my_type), pointer :: p => my_var my_var%x = 123 if (.not. associated(p)) error stop if (p%x /= 123) error stop p%x = 321 if (my_var%x /= 321) error stop end program pointer_14 lfortran-0.63.0/integration_tests/intrinsics_314.f900000664000175000017500000000015715174404631022464 0ustar alastairalastairprogram intrinsics_314 print *, dshiftl( z"A", 10, 5) if (dshiftl( z"A", 10, 5) /= 320) error stop end program lfortran-0.63.0/integration_tests/intrinsics_453.f900000664000175000017500000000155215174404631022470 0ustar alastairalastairprogram intrinsics_453 implicit none type CFG_var_t character(len=100) :: var_name end type CFG_var_t type(CFG_var_t) :: list(2) integer :: marker list(1)%var_name = "zeta" list(2)%var_name = "alpha" call partition_var_list(list, marker) if (marker /= 2) error stop contains subroutine partition_var_list(list, marker) type(CFG_var_t), intent(inout) :: list(:) integer, intent(out) :: marker integer :: right character(len=100) :: pivot_value right = size(list) pivot_value = list(1)%var_name do while (lgt(list(right)%var_name, pivot_value)) right = right - 1 if (right < 1) error stop end do marker = right end subroutine partition_var_list end program intrinsics_453 lfortran-0.63.0/integration_tests/intrinsics_361.f900000664000175000017500000000604215174404631022465 0ustar alastairalastairprogram intrinsics_1arg implicit none real :: x1 complex :: z1 integer :: i1 character(len=10) :: str real, parameter :: eps = 1e-8 x1 = abs(a = -4.0) print *, x1 if (abs(x1 - 4.0) > eps) error stop x1 = acos(x = 0.5) print *, x1 if (abs(x1 - 1.04719755) > eps) error stop x1 = acosd(x = 0.5) print *, x1 if (abs(x1 - 60.0) > eps) error stop x1 = acosh(x = 1.5) print *, x1 if (abs(x1 - 0.962423623) > eps) error stop str = adjustl(string = "text") print *, str str = adjustr(string = "text") print *, str x1 = aimag(z = (1.0, 2.0)) print *, x1 if (abs(x1 - 2.0) > eps) error stop x1 = asin(x = -1.0) print *, x1 if (abs(x1 - (-1.57079637e+00)) > eps) error stop x1 = asind(x = 0.5) print *, x1 if (abs(x1 - 30.0) > eps) error stop x1 = asinh(x = 0.5) print *, x1 if (abs(x1 - 0.481211811) > eps) error stop x1 = atan(x = 1.0) print *, x1 if (abs(x1 - 0.78539816) > eps) error stop x1 = atanh(x = 0.5) print *, x1 if (abs(x1 - 0.549306154) > eps) error stop i1 = bit_size(i = 8) print *, i1 if (i1 /= 32) error stop z1 = conjg(z = (3.0, -4.0)) print *, z1 x1 = cos(x = 0.0) print *, x1 if (abs(x1 - 1.0) > eps) error stop x1 = cosd(x = 60.0) print *, x1 if (abs(x1 - 0.5) > eps) error stop x1 = cosh(x = 1.0) print *, x1 if (abs(x1 - 1.54308069) > eps) error stop x1 = erf(x = 1.0) print *, x1 x1 = erfc(x = 1.0) print *, x1 x1 = exp(x = 1.0) print *, x1 if (abs(x1 - 2.71828175) > eps) error stop x1 = gamma(x = 0.5) print *, x1 if (abs(x1 - 1.77245390) > eps) error stop x1 = log(x = 2.0) print *, x1 if (abs(x1 - 0.693147182) > eps) error stop x1 = log10(x = 10.0) print *, x1 if (abs(x1 - 1.0) > eps) error stop x1 = log_gamma(x = 2.0) print *, x1 x1 = sin(x = 1.0) print *, x1 if (abs(x1 - 0.841470957) > eps) error stop x1 = sinh(x = 1.0) print *, x1 if (abs(x1 - 1.17520118) > eps) error stop x1 = sqrt(x = 4.0) print *, x1 if (abs(x1 - 2) > eps) error stop x1 = tan(x = 1.0) print *, x1 if (abs(x1 - 1.55740774) > eps) error stop x1 = tanh(x = 1.0) print *, x1 if (abs(x1 - 0.761594176) > eps) error stop x1 = tand(x = 45.0) print *, x1 if (abs(x1 - 1) > eps) error stop x1 = not(i = 0) print *, x1 i1 = precision(x = 1.0) print *, i1 i1 = range(x = 1.0) print *, i1 x1 = tiny(x = 1.0) print *, x1 if (abs(x1 - 1.17549435e-38) > eps) error stop x1 = huge(x = 1.0) print *, x1 if (abs(x1 - 3.40282347e+38) > eps) error stop x1 = epsilon(x = 1.0) print *, x1 if (abs(x1 - 1.19209290e-07) > eps) error stop i1 = digits(x = 1.0) print *, i1 if (i1 /= 24) error stop i1 = leadz(i = 8) print *, i1 if (i1 /= 28) error stop i1 = trailz(i = 8) print *, i1 if (i1 /= 3) error stop end program intrinsics_1arg lfortran-0.63.0/integration_tests/test_ieee_next.f900000664000175000017500000000551115174404631022713 0ustar alastairalastair! Test ieee_next_after function (Fortran 2003 standard) program ieee_next_01 use, intrinsic :: ieee_arithmetic, only: ieee_next_after use, intrinsic :: iso_fortran_env, only: real32, real64 implicit none real(4) :: x_sp, next_sp, inf_sp real(8) :: x_dp, next_dp, inf_dp print *, "Testing ieee_next_after..." ! Test 1: ieee_next_after toward larger value x_sp = 1.0_real32 next_sp = ieee_next_after(x_sp, 2.0_real32) print *, "ieee_next_after(1.0, 2.0) =", next_sp if (next_sp <= x_sp) error stop "next_after toward larger should be greater than x" ! Test 2: ieee_next_after toward smaller value x_sp = 1.0_real32 next_sp = ieee_next_after(x_sp, 0.0_real32) print *, "ieee_next_after(1.0, 0.0) =", next_sp if (next_sp >= x_sp) error stop "next_after toward smaller should be less than x" ! Test 3: ieee_next_after toward same value should return same value x_sp = 1.0_real32 next_sp = ieee_next_after(x_sp, x_sp) print *, "ieee_next_after(1.0, 1.0) =", next_sp if (next_sp /= x_sp) error stop "next_after(x, x) should equal x" ! Test 4: Verify inverse property x_sp = 1.0_real32 next_sp = ieee_next_after(x_sp, 2.0_real32) next_sp = ieee_next_after(next_sp, 0.0_real32) if (next_sp /= x_sp) error stop "Should be able to go forward and back" print *, "Inverse property verified for single precision" ! Test 5: From 0.0 toward positive should give smallest positive x_sp = 0.0_real32 next_sp = ieee_next_after(x_sp, 1.0_real32) print *, "ieee_next_after(0.0, 1.0) =", next_sp if (next_sp <= 0.0) error stop "Should be positive" ! Test 6: From 0.0 toward negative should give smallest negative x_sp = 0.0_real32 next_sp = ieee_next_after(x_sp, -1.0_real32) print *, "ieee_next_after(0.0, -1.0) =", next_sp if (next_sp >= 0.0) error stop "Should be negative" ! Test 7: Double precision tests x_dp = 1.0_real64 next_dp = ieee_next_after(x_dp, 2.0_real64) print *, "ieee_next_after(1.0d0, 2.0d0) =", next_dp if (next_dp <= x_dp) error stop "Should be greater" x_dp = 1.0_real64 next_dp = ieee_next_after(x_dp, 0.0_real64) print *, "ieee_next_after(1.0d0, 0.0d0) =", next_dp if (next_dp >= x_dp) error stop "Should be less" ! Test 8: Verify spacing relationship for positive x toward larger x_sp = 1.0_real32 next_sp = ieee_next_after(x_sp, 2.0_real32) print *, "Difference: next_after(1.0, 2.0) - 1.0 =", next_sp - x_sp print *, "spacing(1.0) =", spacing(x_sp) ! The difference should equal spacing(x) for positive x if (abs((next_sp - x_sp) - spacing(x_sp)) > 1e-10) then error stop "next_after - x should equal spacing(x)" end if print *, "All ieee_next_after tests passed!" end program ieee_next_01 lfortran-0.63.0/integration_tests/derived_type_member_procedure_call_01.f900000664000175000017500000000217015174404631027262 0ustar alastairalastairmodule derived_type_member_procedure_call_01_m implicit none type :: primary integer :: x contains procedure :: get_value => fun_get_value procedure :: set_value => fun_set_value end type primary type :: secondary type(primary) :: t end type secondary contains function fun_get_value(self) result(val) class(primary), intent(in) :: self integer :: val val = self%x end function fun_get_value subroutine fun_set_value(self, new_val) class(primary), intent(inout) :: self integer, intent(in) :: new_val self%x = new_val end subroutine fun_set_value end module derived_type_member_procedure_call_01_m program derived_type_member_procedure_call_01 use derived_type_member_procedure_call_01_m implicit none type(secondary) :: vals integer :: result_val vals%t%x = 5 result_val = vals%t%get_value() print *, result_val if (result_val /= 5) error stop call vals%t%set_value(42) result_val = vals%t%get_value() print *, result_val if (result_val /= 42) error stop end program derived_type_member_procedure_call_01 lfortran-0.63.0/integration_tests/derived_types_101.f900000664000175000017500000000125015174404631023132 0ustar alastairalastairprogram derived_types_101 implicit none type :: base integer, allocatable :: s(:) end type base type, extends(base) :: string_t integer, allocatable :: keys(:) end type string_t type(string_t) :: arg print *, "First call" call new(arg) print *, "Second call" call new(arg) contains subroutine new(args) type(string_t), intent(out) :: args if (allocated(args%s)) error stop "ERROR: args%s is allocated" if (allocated(args%keys)) error stop "ERROR: args%keys is allocated" allocate(args%s(10)) allocate(args%keys(10)) end subroutine new end program derived_types_101 lfortran-0.63.0/integration_tests/intrinsics_440.f900000664000175000017500000000045715174404631022467 0ustar alastairalastairprogram intrinsics_440 real(8) :: y, x y = 1.0 x = 1.0 if (atan2d(y, x) /= 45) error stop if (atan2d(1.0, 0.0) /= 90) error stop if (atan2d(-1.0, 0.0) /= -90) error stop if (atan2d(0.0, 1.0) /= 0) error stop if (atan2d(0.0, -1.0) /= 180) error stop end program intrinsics_440 lfortran-0.63.0/integration_tests/bindc_assumed_rank_01.f900000664000175000017500000000105315174404631024017 0ustar alastairalastairmodule bindc_assumed_rank_01_mod use iso_c_binding, only: c_int, c_ptr, c_null_ptr, c_loc implicit none contains subroutine c_process(a, n) bind(C, name="c_process_impl") type(*) :: a(..) integer(c_int), value :: n end subroutine subroutine do_process(a) type(*), intent(inout), target :: a(..) integer(c_int) :: n n = 1 call c_process(a, n) end subroutine end module program bindc_assumed_rank_01 use bindc_assumed_rank_01_mod implicit none print *, "ok" end program lfortran-0.63.0/integration_tests/modules_15b.f900000664000175000017500000002650715174404631022036 0ustar alastairalastairmodule modules_15b use iso_c_binding, only: c_int, c_long_long, c_float, c_double, c_char, & c_null_char, c_float_complex, c_double_complex, c_int32_t, c_int64_t implicit none interface ! int f_int_float(int *a, float *b) integer(c_int) function f_int_float(a, b) result(r) bind(c) import :: c_int, c_float integer(c_int), intent(in) :: a real(c_float), intent(in) :: b end function ! int f_int_double(int *a, double *b) integer(c_int) function f_int_double(a, b) result(r) bind(c) import :: c_int, c_double integer(c_int), intent(in) :: a real(c_double), intent(in) :: b end function ! int f_int_float_complex(int *a, float_complex_t *b) integer(c_int) function f_int_float_complex(a, b) result(r) bind(c) import :: c_int, c_float integer(c_int), intent(in) :: a complex(c_float), intent(in) :: b end function ! int f_int_double_complex(int *a, double_complex_t *b) integer(c_int) function f_int_double_complex(a, b) result(r) bind(c) import :: c_int, c_double integer(c_int), intent(in) :: a complex(c_double), intent(in) :: b end function integer(c_int) function f_int_float_complex2(a, b) result(r) & bind(c, name="f_int_float_complex") import :: c_int, c_float_complex integer(c_int), intent(in) :: a complex(c_float_complex), intent(in) :: b end function ! int f_int_double_complex(int *a, double_complex_t *b) integer(c_int) function f_int_double_complex2(a, b) result(r) & bind(c, name="f_int_double_complex") import :: c_int, c_double_complex integer(c_int), intent(in) :: a complex(c_double_complex), intent(in) :: b end function ! int f_int_float_complex_value(int a, float_complex_t b) integer(c_int) function f_int_float_complex_value(a, b) result(r) bind(c) import :: c_int, c_float integer(c_int), value, intent(in) :: a complex(c_float), value, intent(in) :: b end function ! int f_int_double_complex_value(int a, double_complex_t b) integer(c_int) function f_int_double_complex_value(a, b) result(r) bind(c) import :: c_int, c_double integer(c_int), value, intent(in) :: a complex(c_double), value, intent(in) :: b end function ! float_complex_t f_float_complex_value_return(float_complex_t b) complex(c_float) function f_float_complex_value_return(b) result(r) bind(c) import :: c_float complex(c_float), value, intent(in) :: b end function ! double_complex_t f_double_complex_value_return(double_complex_t b) complex(c_double) function f_double_complex_value_return(b) result(r)bind(c) import :: c_double complex(c_double), value, intent(in) :: b end function ! int f_int_float_value(int a, float b) integer(c_int) function f_int_float_value(a, b) result(r) bind(c) import :: c_int, c_float integer(c_int), value, intent(in) :: a real(c_float), value, intent(in) :: b end function ! int f_int_double_value(int a, double b) integer(c_int) function f_int_double_value(a, b) result(r) bind(c) import :: c_int, c_double integer(c_int), value, intent(in) :: a real(c_double), value, intent(in) :: b end function ! int f_int_intarray(int n, int *b) integer(c_int) function f_int_intarray(n, b) result(r) bind(c) import :: c_int integer(c_int), value, intent(in) :: n integer(c_int), intent(in) :: b(n) end function ! float f_int_floatarray(int n, float *b) real(c_float) function f_int_floatarray(n, b) result(r) bind(c) import :: c_int, c_float integer(c_int), value, intent(in) :: n real(c_float), intent(in) :: b(n) end function ! double f_int_doublearray(int n, double *b) real(c_double) function f_int_doublearray(n, b) result(r) bind(c) import :: c_int, c_double integer(c_int), value, intent(in) :: n real(c_double), intent(in) :: b(n) end function ! int f_int_intarray(int n, int *b) integer(c_int) function f_int_intarray_star(n, b) result(r) & bind(c, name="f_int_intarray") import :: c_int integer(c_int), value, intent(in) :: n integer(c_int), intent(in) :: b(*) end function ! float f_int_floatarray_star(int n, float *b) real(c_float) function f_int_floatarray_star(n, b) result(r) bind(c) import :: c_int, c_float integer(c_int), value, intent(in) :: n real(c_float), intent(in) :: b(*) end function ! double f_int_doublearray(int n, double *b) real(c_double) function f_int_doublearray_star(n, b) result(r) & bind(c, name="f_int_doublearray") import :: c_int, c_double integer(c_int), value, intent(in) :: n real(c_double), intent(in) :: b(*) end function ! int f_int_double_value(int a, double b) integer(c_int) function f_int_double_value_name(a, b) result(r) & bind(c, name="f_int_double_value") import :: c_int, c_double integer(c_int), value, intent(in) :: a real(c_double), value, intent(in) :: b end function !---------------------------------------------------------------------------- ! void sub_int_float(int *a, float *b, int *r) subroutine sub_int_float(a, b, r) bind(c) import :: c_int, c_float integer(c_int), intent(in) :: a real(c_float), intent(in) :: b integer(c_int), intent(out) :: r end subroutine ! void sub_int_double(int *a, double *b, int *r) subroutine sub_int_double(a, b, r) bind(c) import :: c_int, c_double integer(c_int), intent(in) :: a real(c_double), intent(in) :: b integer(c_int), intent(out) :: r end subroutine ! void sub_int_float_complex(int *a, float_complex_t *b, int *r) subroutine sub_int_float_complex(a, b, r) bind(c) import :: c_int, c_float integer(c_int), intent(in) :: a complex(c_float), intent(in) :: b integer(c_int), intent(out) :: r end subroutine ! void sub_int_double_complex(int *a, double_complex_t *b, int *r) subroutine sub_int_double_complex(a, b, r) bind(c) import :: c_int, c_double integer(c_int), intent(in) :: a complex(c_double), intent(in) :: b integer(c_int), intent(out) :: r end subroutine ! void sub_int_float_value(int a, float b, int *r) subroutine sub_int_float_value(a, b, r) bind(c) import :: c_int, c_float integer(c_int), value, intent(in) :: a real(c_float), value, intent(in) :: b integer(c_int), intent(out) :: r end subroutine ! void sub_int_double_value(int a, double b, int *r) subroutine sub_int_double_value(a, b, r) bind(c) import :: c_int, c_double integer(c_int), value, intent(in) :: a real(c_double), value, intent(in) :: b integer(c_int), intent(out) :: r end subroutine ! void sub_int_float_complex_value(int a, float_complex_t b, int *r) subroutine sub_int_float_complex_value(a, b, r) bind(c) import :: c_int, c_float integer(c_int), value, intent(in) :: a complex(c_float), value, intent(in) :: b integer(c_int), intent(out) :: r end subroutine ! void sub_int_double_complex_value(int a, double_complex_t b, int *r) subroutine sub_int_double_complex_value(a, b, r) bind(c) import :: c_int, c_double integer(c_int), value, intent(in) :: a complex(c_double), value, intent(in) :: b integer(c_int), intent(out) :: r end subroutine ! void sub_int_intarray(int n, int *b, int *r) subroutine sub_int_intarray(n, b, r) bind(c) import :: c_int integer(c_int), value, intent(in) :: n integer(c_int), intent(in) :: b(n) integer(c_int), intent(out) :: r end subroutine ! void sub_int_floatarray(int n, float *b, float *r) subroutine sub_int_floatarray(n, b, r) bind(c) import :: c_int, c_float integer(c_int), value, intent(in) :: n real(c_float), intent(in) :: b(n) real(c_float), intent(out) :: r end subroutine ! void sub_int_doublearray(int n, double *b, double *r) subroutine sub_int_doublearray(n, b, r) bind(c) import :: c_int, c_double integer(c_int), value, intent(in) :: n real(c_double), intent(in) :: b(n) real(c_double), intent(out) :: r end subroutine ! void sub_int_double_value(int a, double b, int *r) subroutine sub_int_double_value_name(a, b, r) & bind(c, name="sub_int_double_value") import :: c_int, c_double integer(c_int), value, intent(in) :: a real(c_double), value, intent(in) :: b integer(c_int), intent(out) :: r end subroutine ! int f_string(char *s) integer(c_int) function f_string0(s) result(r) bind(c, name="f_string") import :: c_int, c_char character(len=1, kind=c_char), intent(in) :: s end function integer(c_int) function call_fortran_i32(i) result(r) bind(c) import :: c_int integer(c_int), value, intent(in) :: i end function integer(c_int) function call_fortran_i32_value(i) result(r) bind(c) import :: c_int integer(c_int), value, intent(in) :: i end function integer(c_int32_t) function call_fortran_i32_value2(i) result(r) & bind(c, name="call_fortran_i32_value") import :: c_int32_t integer(c_int32_t), value, intent(in) :: i end function integer(c_long_long) function call_fortran_i64(i) result(r) bind(c) import :: c_long_long integer(c_long_long), value, intent(in) :: i end function integer(c_long_long) function call_fortran_i64_value(i) result(r) bind(c) import :: c_long_long integer(c_long_long), value, intent(in) :: i end function integer(c_int64_t) function call_fortran_i64_value2(i) result(r) & bind(c, name="call_fortran_i64_value") import :: c_int64_t integer(c_int64_t), value, intent(in) :: i end function real(c_float) function call_fortran_f32(i) result(r) bind(c) import :: c_float real(c_float), value, intent(in) :: i end function real(c_float) function call_fortran_f32_value(i) result(r) bind(c) import :: c_float real(c_float), value, intent(in) :: i end function real(c_double) function call_fortran_f64(i) result(r) bind(c) import :: c_double real(c_double), value, intent(in) :: i end function real(c_double) function call_fortran_f64_value(i) result(r) bind(c) import :: c_double real(c_double), value, intent(in) :: i end function end interface contains integer function f_string(s) result(r) character(*), intent(in) :: s r = f_string0(s // c_null_char) end function integer(c_int) function fortran_i32(i) result(r) bind(c) integer(c_int), intent(in) :: i r = i + 2 end function integer(c_int) function fortran_i32_value(i) result(r) bind(c) integer(c_int), value, intent(in) :: i r = i + 2 end function integer(c_long_long) function fortran_i64(i) result(r) bind(c) integer(c_long_long), intent(in) :: i r = i + 2 end function integer(c_long_long) function fortran_i64_value(i) result(r) bind(c) integer(c_long_long), value, intent(in) :: i r = i + 2 end function real(c_float) function fortran_f32(i) result(r) bind(c) real(c_float), intent(in) :: i r = i + 2.3_c_float end function real(c_float) function fortran_f32_value(i) result(r) bind(c) real(c_float), value, intent(in) :: i r = i + 2.3_c_float end function real(c_double) function fortran_f64(i) result(r) bind(c) real(c_double), intent(in) :: i r = i + 2.3_c_double end function real(c_double) function fortran_f64_value(i) result(r) bind(c) real(c_double), value, intent(in) :: i r = i + 2.3_c_double end function end module lfortran-0.63.0/integration_tests/equivalence_05.f900000664000175000017500000000047515174404631022520 0ustar alastairalastairprogram equivalence_05 implicit none INTEGER IMACH(16), OUTPUT, SMALL(2) REAL RMACH EQUIVALENCE (IMACH(4),OUTPUT), (RMACH,SMALL(1)) imach(4) = 6 if(output /= 6) error stop small = 99 rmach = 5.6_8 if(small(1) /= 1085485875) error stop if(small(2) /= 99) error stop end program lfortran-0.63.0/integration_tests/assign_allocatable_array_of_struct_instances.f900000664000175000017500000000165415174404631031057 0ustar alastairalastairprogram assign_allocatable_array_of_struct_instances implicit none integer :: i type :: string character(:), allocatable :: s end type type(string), allocatable :: tokens(:) allocate(tokens(5)) do i = 1, 5 tokens(i)%s = "a" end do tokens = merge_pair(tokens, 1) contains function merge_pair(intokens, idx) result(tkns) ! Merge the pair `idx` type(string), intent(in) :: intokens(:) integer, intent(in) :: idx type(string), allocatable :: tkns(:) type(string) :: merged_token merged_token%s = intokens(idx)%s // intokens(idx+1)%s ! The segmentation fault occurs at the below line, when used with ! `--experimental-simplifier` flag (i.e. simplifier pass enabled) and ! no `--realloc-lhs` flag is enabled for it tkns = [intokens(:idx-1), merged_token, intokens(idx+2:)] end function end program lfortran-0.63.0/integration_tests/flush_03.f900000664000175000017500000000022315174404631021325 0ustar alastairalastairprogram flush_03 use iso_fortran_env implicit none FLUSH(INPUT_UNIT) FLUSH(OUTPUT_UNIT) FLUSH(ERROR_UNIT) end program flush_03 lfortran-0.63.0/integration_tests/intrinsics_318.f900000664000175000017500000000032315174404631022463 0ustar alastairalastairprogram test_cpu_time real :: start, finish call cpu_time(start) ! put code to test here call cpu_time(finish) print '("Time = ",f6.3," seconds.")',finish-start end program test_cpu_time lfortran-0.63.0/integration_tests/operator_overloading_17.f900000664000175000017500000000451215174404631024442 0ustar alastairalastairmodule operator_overloading_17_mod type, abstract :: base contains procedure(if_equal), deferred :: is_equal generic :: operator(==) => is_equal end type base abstract interface logical function if_equal(lhs, rhs) import base class(base), intent(in) :: lhs, rhs end function if_equal end interface type, extends(base) :: container integer :: x contains procedure :: is_equal => container_equal end type container type, public :: string_t character(len=:), allocatable :: str end type string_t interface operator(==) module procedure string_equal module procedure string_array_equal end interface operator(==) ! type :: derived_1 ! type(string_t), allocatable :: link(:) ! end type derived_1 contains logical function container_equal(lhs, rhs) class(base), intent(in) :: rhs class(container), intent(in) :: lhs container_equal = .false. select type(rhs) type is(container) container_equal = rhs%x == lhs%x end select end function container_equal logical function string_equal(a, b) type(string_t), allocatable, intent(in) :: a, b if (.not. allocated(a) .or. .not. allocated(b)) then string_equal = .false. return end if string_equal = (a%str == b%str) end function string_equal logical function string_array_equal(a, b) type(string_t), intent(in) :: a(:), b(:) integer :: i if (size(a) /= size(b)) then string_array_equal = .false. return end if string_array_equal = .true. do i = 1, size(a) if (a(i)%str /= b(i)%str) then string_array_equal = .false. return end if end do end function end module operator_overloading_17_mod program operator_overloading_17 use operator_overloading_17_mod type(string_t), allocatable :: a(:), other(:) type(string_t), allocatable :: x, y type(container) :: c1, c2 allocate(a(2), other(2)) a(1)%str = "hello" a(2)%str = "world" other(1)%str = "hello" other(2)%str = "world" if (.not. other == a) error stop allocate(x, y) x%str = "hello" y%str = "HelloWorld" if (x == y) error stop c1%x = 5 c2%x = 5 if (.not. c1 == c2) error stop c2%x = 6 if (c1 == c2) error stop associate(temp => a) if (.not. temp == other) error stop end associate end program operator_overloading_17 lfortran-0.63.0/integration_tests/gpu_metal_69.f900000664000175000017500000000074515174404631022206 0ustar alastairalastairprogram gpu_metal_69 ! Test: all() with array binary operation inside do concurrent ! Ensures the GPU offload pass inlines all() when the mask ! contains element-wise arithmetic (e.g. a - b < tol). implicit none integer :: n(3) real :: a(3,3), b(3,3) logical :: eq(3) integer :: l n = [2, 3, 1] a = 1.0 b = 1.0 do concurrent(l = 1:3) eq(l) = all(a(1:n(l),l) - b(1:n(l),l) < 1.0e-06) end do if (.not. all(eq)) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/arrays_73.f900000664000175000017500000000305415174404631021521 0ustar alastairalastairprogram arrays_73 implicit none integer :: A(4) = [1,2,3,4] integer :: A1(3,3) = reshape([1,2,3,4,5,6,7,8,9], [3,3]) integer :: A3(3,3) = reshape([1,2,3,4,5,6,7,8,9], [3,3]) integer :: A2(2,2,2) = reshape([1,2,3,4,5,6,7,8], [2,2,2]) integer :: tmp(2,2) = reshape([5,5,5,5], [2,2]) call temp(A, A1, A2, A3, tmp) contains subroutine temp(A, A1, A2, A3, tmp) integer, intent(inout) :: A(:) integer, intent(inout) :: A1(:,:) integer, intent(inout) :: A3(:,:) integer, intent(inout) :: A2(:,:,:) integer, intent(inout) :: tmp(:,:) integer, save :: X(4) = [2,1,4,3] A1(:,[2,1]) = A3(:,[2,3]) if (A1(1,1) /= 7 .or. A1(2,1) /= 8 .or. A1(3,1) /= 9 .or. & & A1(1,2) /= 4 .or. A1(2,2) /= 5 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 7 .or. A1(2,3) /= 8 .or. A1(3,3) /= 9) error stop A1(:,1:2) = A3([2,1,3],[2,1]) if (A1(1,1) /= 5 .or. A1(2,1) /= 4 .or. A1(3,1) /= 6 .or. & & A1(1,2) /= 2 .or. A1(2,2) /= 1 .or. A1(3,2) /= 3 .or. & & A1(1,3) /= 7 .or. A1(2,3) /= 8 .or. A1(3,3) /= 9) error stop A1(1:2,2:3) = A3(2:3,1:2) if (A1(1,1) /= 5 .or. A1(2,1) /= 4 .or. A1(3,1) /= 6 .or. & & A1(1,2) /= 2 .or. A1(2,2) /= 3 .or. A1(3,2) /= 3 .or. & & A1(1,3) /= 5 .or. A1(2,3) /= 6 .or. A1(3,3) /= 9) error stop !! TODO: Handle cases by creating Temporary for RHS where LHS and RHS has common variable A(X) = A if (any(A /= [2, 1, 4, 3])) error stop end subroutine end programlfortran-0.63.0/integration_tests/types_13.f900000664000175000017500000000320215174404631021351 0ustar alastairalastairprogram types_13 use iso_c_binding, only: c_int, c_double, c_char implicit none interface subroutine g(d) character*(*) :: d end subroutine subroutine g2(d) character(len=*) :: d end subroutine subroutine g3(d) import :: c_char character(len=*, kind=c_char) :: d end subroutine subroutine g4(d) import :: c_char character(*, kind=c_char) :: d end subroutine subroutine g5(d) import :: c_char character(kind=c_char, len=*) :: d end subroutine subroutine g6(d) character*5 :: d end subroutine integer(c_int) function f1(a, b, c, d) result(r) bind(c) import :: c_int, c_double integer*4, value, intent(in) :: a real*8, value, intent(in) :: b logical*4 :: c end function integer(c_int) function f2(a, b, c, d) bind(c) result(r) import :: c_int, c_double integer*4, value, intent(in) :: a real*8, value, intent(in) :: b logical*4 :: c end function function f3(a, b, c, d) result(r) bind(c) import :: c_int, c_double integer(c_int) :: r integer*4, value, intent(in) :: a real*8, value, intent(in) :: b logical*4 :: c end function function f4(a, b, c, d) bind(c) result(r) import c_int, c_double integer(c_int) :: r integer*4, value, intent(in) :: a real*8, value, intent(in) :: b logical*4 :: c end function subroutine f5(a, b, c) bind(C, name="_cf5") import :: c_int import :: c_double integer(c_int) :: r integer(c_int), value, intent(in) :: a real(c_double), value, intent(in) :: b logical :: c end subroutine end interface end program lfortran-0.63.0/integration_tests/class_113.f900000664000175000017500000000076215174404631021403 0ustar alastairalastairprogram class_113 implicit none integer :: i real :: r class(*), allocatable :: obj i = 77 obj = i select type(obj) type is (integer) print *, obj if (obj /= 77) error stop class default error stop end select r = 1.5 obj = r select type(obj) type is (real(4)) if (abs(obj - 1.5) > 1.0e-5) error stop class default error stop end select print *, "All tests passed." end program class_113 lfortran-0.63.0/integration_tests/tuple_test_02_.f900000664000175000017500000000505715174404631022544 0ustar alastairalastairmodule tuple_test_02_mod implicit none real :: eps = 1e-12 contains function set_tuple(a, b) result(t) integer, intent(in) :: a real, intent(in) :: b type(_lfortran_tuple(integer, real, character(len=:), complex)) :: t character(len=:), allocatable :: s s = "" t = _lfortran_tuple_constant(a, b, s, cmplx(a, b)) end function function merge_tuple(a, b) result(c) type(_lfortran_tuple(integer, real, character(len=:), complex)), intent(in) :: a, b type(_lfortran_tuple(integer, real, character(len=:), complex)) :: c integer :: a0, b0 real :: a1, b1 character(len=:), allocatable :: s complex :: a3, b3 a0 = _lfortran_get_item(a, 0) b0 = _lfortran_get_item(b, 0) a1 = _lfortran_get_item(a, 1) b1 = _lfortran_get_item(b, 1) a3 = _lfortran_get_item(a, 3) b3 = _lfortran_get_item(b, 3) s = trim(to_string(a0)) // trim(to_string(b0)) c = _lfortran_tuple_constant(a0 + b0, a1 + b1, s, a3 + b3) end function subroutine f() type(_lfortran_tuple(integer, real, character(len=:), complex)) :: t1, t2 integer :: i real :: j integer :: x real :: y character(len=:), allocatable :: s complex :: z t1 = set_tuple(0, 0.0) do i = 0, 10 j = real(i) t2 = set_tuple(i, j) t1 = merge_tuple(t1, t2) end do x = _lfortran_get_item(t1, 0) y = _lfortran_get_item(t1, 1) s = _lfortran_get_item(t1, 2) z = _lfortran_get_item(t1, 3) if (x /= 55) error stop if (abs(y - 55.0) > eps) error stop if (s /= "4510") error stop if (abs(z - cmplx(55.0, 55.0)) > eps) error stop print *, x, y, s, z end subroutine function g_check(x, y) result(res) type(_lfortran_tuple(integer, integer)), intent(in) :: x, y logical :: res res = _lfortran_get_item(x, 0) == _lfortran_get_item(y, 0) end function subroutine test_issue_1348() type(_lfortran_tuple(integer, integer)) :: a11, b11 a11 = _lfortran_tuple_constant(1, 2) b11 = _lfortran_tuple_constant(1, 2) if (.not. g_check(a11, b11)) error stop end subroutine subroutine tests() call f() call test_issue_1348() end subroutine pure function to_string(i) result(s) integer, intent(in) :: i character(len=:), allocatable :: s character(len=32) :: buffer write(buffer, '(I0)') i s = trim(buffer) end function end module program run_tuples use tuple_test_02_mod call tests() end program lfortran-0.63.0/integration_tests/class_07.f900000664000175000017500000000055415174404631021324 0ustar alastairalastairmodule class_07_mod private type, abstract :: tester contains procedure(testing_method), deferred, nopass :: testing end type tester abstract interface pure function testing_method() result(n) integer :: n end function testing_method end interface end module program class_07 use class_07_mod end program lfortran-0.63.0/integration_tests/procedure_50.f900000664000175000017500000000063015174404631022200 0ustar alastairalastairmodule procedure_50_mod implicit none procedure(set_value), pointer :: test => set_value contains subroutine set_value(x) integer, intent(inout) :: x x = x + 42 end subroutine set_value end module procedure_50_mod program procedure_50 use procedure_50_mod implicit none integer :: x x = 0 call test(x) if (x /= 42) error stop end program procedure_50 lfortran-0.63.0/integration_tests/format_30.f900000664000175000017500000000140515174404631021477 0ustar alastairalastairprogram format_30 print "(2E13.3)", 1.0, 2.0 print "(2ES13.3)", epsilon(1e0), epsilon(3e0) print "(3F10.4)", 1.2345, 2.3456, 3.4567 print "(2EN12.3)", 123.0, 456.0 print "(2ES13.3)", epsilon(1e0), epsilon(3e0) print "(2E13.3E2)", epsilon(1e0),epsilon(1d0) write(*,"(ES0.0E0)") 1.23456789E+10 print "(ES0.15)", 1/3.0d-200 print "(SP,E60.50)", 1.23456789101112e-62_8 write(*,"(ES0.0E0)") 0.0 write(*,"(ES0.0E0)") 10.0 write(*,"(ES0.0E0)") 3.14159 write(*,"(ES0.0E0)") 3.14159E+05 ! print "(E67.62)", 1.23456789101112e-62_8 print "(ES0.15)", 3.0d-100 print "(ES0.0)", 1.0 print "(ES300.0)", 1.0 print "(ES0.8)", tiny(1.0_8) print "(ES0.8)", huge(1.0_8) print "(E14.7)", 0.0 end program format_30 lfortran-0.63.0/integration_tests/array_op_01.f900000664000175000017500000000053315174404631022022 0ustar alastairalastairsubroutine chkder(m, Err) implicit none integer, intent(in) :: m real, intent(out) :: Err(m) real :: zero zero = 0.0 Err = zero end subroutine chkder program main implicit none integer :: i real :: Err(2) call chkder(2, Err) do i = 1, 2 if (Err(i) /= 0.0) error stop end do end program lfortran-0.63.0/integration_tests/derived_types_100.f900000664000175000017500000000223315174404631023133 0ustar alastairalastairmodule derived_types_100_mod implicit none type :: person character(len=50) :: name integer, allocatable :: scores(:) end type person contains function update_person(original) result(updated) type(person), pointer, intent(in) :: original type(person), pointer :: updated integer :: n allocate(updated) updated%name = "MODIFIED: " // trim(original%name) n = size(original%scores) allocate(updated%scores(n+1)) updated%scores(1:n) = original%scores updated%scores(n+1) = 999 end function update_person end module derived_types_100_mod program derived_types_100 use derived_types_100_mod implicit none type(person), pointer :: x, old_x allocate(x) x%name = "John Doe" allocate(x%scores(3)) x%scores = [85, 92, 78] old_x => x x => update_person(x) deallocate(old_x) print *, x%name print *, x%scores if ( x%name /= "MODIFIED: John Doe") error stop "Test failed: name mismatch" if ( size(x%scores) /= 4 ) error stop "Test failed: scores size mismatch" if ( any(x%scores /= [85, 92, 78, 999]) ) error stop "Test failed: last score mismatch" deallocate(x) end program derived_types_100 lfortran-0.63.0/integration_tests/gpu_metal_125.f900000664000175000017500000000134415174404631022253 0ustar alastairalastair! Test: struct with allocatable member in do concurrent reads struct data ! and computes a result. Exercises correct Metal buffer index counting: ! struct array args with allocatable members need 3 extra buffers per ! allocatable member (data, offsets, sizes). program gpu_metal_125 implicit none type :: t real, allocatable :: v(:) end type integer, parameter :: n = 3 type(t) :: a(n) real :: s(n) integer :: i do i = 1, n allocate(a(i)%v(2)) a(i)%v = [real(i), real(i) * 10.0] end do do concurrent(i=1:n) s(i) = a(i)%v(1) + a(i)%v(2) end do if (abs(s(1) - 11.0) > 1e-5) error stop if (abs(s(2) - 22.0) > 1e-5) error stop if (abs(s(3) - 33.0) > 1e-5) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/character_11c.c0000664000175000017500000000151415174404631022132 0ustar alastairalastair#include #include char f_string01_c( char *str ){ printf("C Side : f_string01_c called with input argument [ %s ]\n", str); str[1] = 'X'; return str[0]; } char f_string02_c( char str ){ printf("C Side : f_string02_c called with input argument [ %C ]\n", str); return str; } char f_string03_c( char *str ){ printf("C Side : f_string03_c called with input argument [ %s ]\n", str); str[1] = 'X'; return str[0]; } char f_string04_c( char *str ){ printf("C Side : f_string04_c called with input argument [ %s ]\n", str); str[1] = 'X'; return str[0]; } char f_string05_c( CFI_cdesc_t *str ){ printf("C Side : f_string05_c called with input argument [ %s ]\n", (char*)str->base_addr); ((char*)str->base_addr)[1] = 'X'; return ((char*)str->base_addr)[0]; } lfortran-0.63.0/integration_tests/allocate_62.f900000664000175000017500000000365615174404631022012 0ustar alastairalastairmodule allocate62_mod implicit none type :: token_stack integer :: dummy = 0 end type token_stack type, public :: equation_parser character(:), allocatable :: equation character(:), allocatable :: variable_name character(:), allocatable :: infix_formula integer :: n_indep_vars type(indep_var), dimension(:), allocatable :: indep_vars type(token_stack) :: infix type(token_stack) :: postfix contains procedure :: touch end type equation_parser type :: indep_var character(:), allocatable :: value end type indep_var interface equation_parser procedure construct_equation_parser end interface equation_parser contains function construct_equation_parser(indep_vars) result(parser) type(equation_parser) :: parser character(*) :: indep_vars(:) integer :: i integer :: n_indep_vars n_indep_vars = size(indep_vars) allocate(parser%indep_vars(1:n_indep_vars)) parser%n_indep_vars = n_indep_vars do i = 1, n_indep_vars parser%indep_vars(i)%value = trim(indep_vars(i)) end do end function construct_equation_parser subroutine touch(parser) class(equation_parser), intent(inout) :: parser if (parser%n_indep_vars > 0) then parser%n_indep_vars = parser%n_indep_vars end if end subroutine touch end module allocate62_mod program allocate_62 use allocate62_mod implicit none type(equation_parser) :: parser character(10) :: names(2) names = [character(10) :: "x", "y"] parser = equation_parser(names) call parser%touch() if (parser%n_indep_vars /= 2) error stop 1 if (parser%indep_vars(1)%value /= "x") error stop 2 if (parser%indep_vars(2)%value /= "y") error stop 3 end program allocate_62 lfortran-0.63.0/integration_tests/derived_types_52.f900000664000175000017500000000174315174404631023066 0ustar alastairalastairmodule bit_type_52 implicit none type, abstract :: bitset_type integer :: flag contains procedure(from_string_abstract), deferred, pass(self) :: from_string end type bitset_type type, extends(bitset_type) :: bitset_large contains procedure, pass(self) :: from_string => from_string_large end type bitset_large type, extends(bitset_large) :: mytype end type mytype abstract interface subroutine from_string_abstract(self) import :: bitset_type class(bitset_type), intent(out) :: self end subroutine from_string_abstract end interface contains subroutine from_string_large(self) class(bitset_large), intent(out) :: self if (self%flag /= 1) error stop end subroutine from_string_large end module program derived_types_52 use bit_type_52 implicit none type(mytype) :: b b%flag = 1 call b%from_string() end program derived_types_52 lfortran-0.63.0/integration_tests/gpu_metal_58.f900000664000175000017500000000130115174404631022171 0ustar alastairalastairmodule gpu_metal_58_m implicit none type :: t contains procedure :: f end type contains elemental real function f(self, x) class(t), intent(in) :: self real, intent(in) :: x f = x + 1.0 end function end module gpu_metal_58_m program gpu_metal_58 use gpu_metal_58_m implicit none type(t) :: o integer :: i real :: x(4), y(4) x = [1.0, 2.0, 3.0, 4.0] y = 0.0 associate(a => 1) do concurrent (i = 1:4) y(i) = o%f(x(i)) end do end associate if (abs(y(1) - 2.0) > 1e-6) error stop if (abs(y(2) - 3.0) > 1e-6) error stop if (abs(y(3) - 4.0) > 1e-6) error stop if (abs(y(4) - 5.0) > 1e-6) error stop print *, "PASS" end program gpu_metal_58 lfortran-0.63.0/integration_tests/select_type_26.f900000664000175000017500000000322215174404631022533 0ustar alastairalastairmodule select_type_26_mod implicit none type, abstract :: base_getter contains procedure(get_iface), deferred :: get end type base_getter abstract interface function get_iface(self, key) result(res) import class(base_getter), intent(in) :: self character(*), intent(in) :: key class(*), allocatable :: res end function get_iface end interface type, abstract :: base_type end type base_type type, extends(base_type) :: my_type integer :: val end type my_type type, extends(base_getter) :: my_getter contains procedure :: get => my_getter_get end type my_getter contains function my_getter_get(self, key) result(res) class(my_getter), intent(in) :: self character(*), intent(in) :: key class(*), allocatable :: res if (key == "base_type") then allocate(res, source=my_type(42)) end if end function my_getter_get subroutine test_select_type_func_call(g, val) class(base_getter), intent(in) :: g integer, intent(out) :: val val = 0 select type(obj => g%get("base_type")) class is (base_type) select type(obj) type is (my_type) val = obj%val end select end select end subroutine test_select_type_func_call end module select_type_26_mod program select_type_26 use select_type_26_mod implicit none type(my_getter) :: g integer :: val call test_select_type_func_call(g, val) print *, val if (val /= 42) error stop end program select_type_26 lfortran-0.63.0/integration_tests/string_29.f900000664000175000017500000000134315174404631021526 0ustar alastairalastairfunction c2s(n, x) result(y) integer, intent(in) :: n character, intent(in) :: x(:) character(:), allocatable :: y integer :: i allocate(character(n) :: y) do i = 1, n y(i:i) = x(i) end do end function program string_29 character(len=1) :: s(3) integer :: i s(1) = "a" s(2) = "b" s(3) = "c" i = fortran_string(3, s) print *, i if (i /= 3) error stop contains integer function fortran_string(n,s) result(r) bind(c) integer :: n character(len=1), intent(in) :: s(:) interface function c2s(n, x) result(y) integer, intent(in) :: n character, intent(in) :: x(:) character(:), allocatable :: y end function end interface print *, c2s(n,s) if (c2s(n,s) /= "abc") error stop r = len(c2s(n,s)) end function end program lfortran-0.63.0/integration_tests/derived_types_03.f900000664000175000017500000000050715174404631023057 0ustar alastairalastairprogram derived_types_03 implicit none type :: X integer :: i end type type(X) :: b contains subroutine Y() type :: A integer :: i end type type(A) :: b end subroutine integer function Z() type :: A integer :: i end type type(A) :: b Z = 5 end function end lfortran-0.63.0/integration_tests/modules_67.f900000664000175000017500000000025015174404631021666 0ustar alastairalastairprogram modules_67 use modules_67_consumer, only : test_pairs implicit none if (test_pairs()) then print *, "PASS" else error stop end if end program lfortran-0.63.0/integration_tests/array_indices_array_item_assignment_2.f900000664000175000017500000000141215174404631027404 0ustar alastairalastairprogram array_indices_array_item_assignment_2 real :: Q(4), R(4), S(4), X(2,2) logical, save :: mask(2) = [.true.,.false.] R = [1, 4, 2, 3] S = [3, 2, 1, 4] Q = 5.0 X = reshape(R, shape(X)) Q(trueloc(R < S)) = Q(trueloc(R < S)) + 1.0 Q(trueloc(R >= S)) = -Q(trueloc(R >= S)) - 1.0 print *, Q if( any(Q /= [6.0, -6.0, -6.0, 6.0]) ) error stop X([1,2], trueloc(mask)) = X([2,1], trueloc(mask)) print *, X if( X(1,1) /= 4.0 .or. X(2,1) /= 1.0 .or. X(1,2) /= 2.0 .or. X(2,2) /= 3.0 ) error stop contains function trueloc(x) result(loc) logical, intent(in) :: x(:) integer(4), allocatable :: loc(:) integer :: i, j allocate(loc(count(x))) j = 1 do i = 1, size(x) if( x(i) ) then loc(j) = i j = j + 1 end if end do end function trueloc end program lfortran-0.63.0/integration_tests/parameter_15.f900000664000175000017500000000107715174404631022177 0ustar alastairalastairprogram parameter_15 implicit none integer i1 real r1 integer(8) i2 real(8) r2 parameter (i1=1_8) parameter (r1=1.0D+0) parameter (i2=1) parameter (r2=1.0) print *, i1, kind(i1) if (i1 /= 1) error stop if (kind(i1) /= 4) error stop print *, r1, kind(r1) if ((r1 - 1.0) > 1e-6) error stop if (kind(r1) /= 4) error stop print *, i2, kind(i2) if (i2 /= 1) error stop if (kind(i2) /= 8) error stop print *, r2, kind(r2) if ((r2 - 1.0) > 1e-6) error stop if (kind(r2) /= 8) error stop end programlfortran-0.63.0/integration_tests/arrays_122.f900000664000175000017500000000051215174404631021570 0ustar alastairalastairprogram arrays_122 implicit none real :: a(2, 3) = reshape([1, 2, 3, 4, 5, 6], [2, 3]) if (a(1, 1) /= 1) error stop if (a(2, 1) /= 2) error stop if (a(1, 2) /= 3) error stop if (a(2, 2) /= 4) error stop if (a(1, 3) /= 5) error stop if (a(2, 3) /= 6) error stop print *, a end program arrays_122lfortran-0.63.0/integration_tests/intrinsics_448.f900000664000175000017500000000035215174404631022471 0ustar alastairalastairprogram intrinsics_448 implicit none character(kind=4), parameter :: ar1(5) = achar([57, 59, 65, 90, 93], kind=4) if (any(iachar(ar1, kind=4) /= [57, 59, 65, 90, 93])) error stop print *, ar1 end program intrinsics_448lfortran-0.63.0/integration_tests/gpu_metal_33.f900000664000175000017500000000102415174404631022164 0ustar alastairalastairprogram gpu_metal_33 ! Test: associate variable referencing derived-type array component ! inside do concurrent. Verifies that the gpu_offload pass correctly ! resolves associate(n => v%x) when lowering to a GPU kernel. implicit none type :: t integer :: x(4) end type type(t) :: v integer :: i v%x = 0 associate(n => v%x) do concurrent (i = 1:4) n(i) = i * 10 end do end associate if (v%x(1) /= 10) error stop if (v%x(2) /= 20) error stop if (v%x(3) /= 30) error stop if (v%x(4) /= 40) error stop end program lfortran-0.63.0/integration_tests/modules_57.f900000664000175000017500000000031215174404631021664 0ustar alastairalastairmodule module_modules_57 complex :: c = (3.0, 4.0) end module module_modules_57 program modules_57 use module_modules_57 print *, abs(c) if (abs(abs(c) - 5.0) > 1e-8) error stop end program modules_57 lfortran-0.63.0/integration_tests/allocate_10.f900000664000175000017500000000114015174404631021765 0ustar alastairalastairmodule A_allocate_10 implicit none contains subroutine f(argument, is_allocated) character(len=:), allocatable, intent(inout) :: argument logical, intent(out) :: is_allocated call g() is_allocated = allocated(argument) contains subroutine g() allocate(character(len=10) :: argument) end subroutine end subroutine end module program allocate_10 use A_allocate_10 implicit none character(len=:), allocatable :: allocA logical :: is_allocated_allocA is_allocated_allocA = .false. call f(allocA, is_allocated_allocA) print *, is_allocated_allocA if( .not. is_allocated_allocA ) error stop end program lfortran-0.63.0/integration_tests/intrinsics_266.f900000664000175000017500000000613715174404631022476 0ustar alastairalastairprogram intrinsics_266 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real(sp), parameter :: a1 = tan(1.0_sp) real(dp), parameter :: a2 = tan(1.0_dp) complex(sp), parameter :: a3 = tan((1.0_sp, 1.5_sp)) complex(dp), parameter :: a4 = tan((1.0_dp, 1.5_dp)) real(sp), parameter :: ar1(3) = tan([1.0_sp, 1.5_sp, 2.0_sp]) real(dp), parameter :: ar2(3) = tan([1.0_dp, 1.5_dp, 2.0_dp]) complex(sp), parameter :: ac1(3) = tan([(1.0_sp, 1.5_sp), (2.0_sp, 2.5_sp), (3.0_sp, 3.5_sp)]) complex(dp), parameter :: ac2(3) = tan([(1.0_dp, 1.5_dp), (2.0_dp, 2.5_dp), (3.0_dp, 3.5_dp)]) real(sp) :: b1 = 0.5_sp real(dp) :: b2 = 0.7_dp complex(sp) :: b3 = (0.5_sp, 0.7_sp) complex(dp) :: b4 = (0.5_dp, 0.7_dp) real(sp) :: br1(3) = [0.5_sp, 0.7_sp, 0.9_sp] real(dp) :: br2(3) = [0.5_dp, 0.7_dp, 0.9_dp] complex(sp) :: bc1(3) = [(0.5_sp, 0.7_sp), (0.9_sp, 1.1_sp), (1.3_sp, 1.5_sp)] complex(dp) :: bc2(3) = [(0.5_dp, 0.7_dp), (0.9_dp, 1.1_dp), (1.3_dp, 1.5_dp)] print *, a1 if (abs(a1 - 1.55740772e+00_sp) > 1e-6_sp) error stop print *, a2 if (abs(a2 - 1.55740772465490223_dp) > 1e-12_dp) error stop print *, a3 if (abs(a3 - (9.421291947E-02_sp, 1.03795874_sp)) > 1e-6_sp) error stop print *, a4 if (abs(a4 - (9.42129201295443947E-002_dp, 1.0379587828579324_dp)) > 1e-12_dp) error stop print *, ar1 if (any(abs(ar1 - [1.55740772_sp, 14.1014194_sp, -2.18503976_sp]) > 1e-6_sp)) error stop print *, ar2 if (any(abs(ar2 - [1.55740772465490223_dp, 14.101419947171719_dp, -2.185039863261519_dp]) > 1e-12_dp)) error stop print *, ac1 if (any(abs(ac1 - [(9.421291947E-02_sp, 1.03795874_sp), (-1.028875075E-02_sp, 1.00879467_sp), & (-5.086967140E-04_sp, 0.998250306_sp)]) > 1e-6_sp)) error stop print *, ac2 if (any(abs(ac2 - [(9.42129201295443947E-002_dp, 1.0379587828579324_dp), (-1.02887508595820281E-002_dp, & 1.0087947005319189_dp), (-5.08696693455815119E-004_dp, 0.99825027844029535_dp)]) > 1e-12_dp)) error stop print *, tan(b1) if (abs(tan(b1) - 0.546302497_sp) > 1e-6_sp) error stop print *, tan(b2) if (abs(tan(b2) - 0.84228838046307941_dp) > 1e-12_dp) error stop print *, tan(b3) if (abs(tan(b3) - (0.312674940_sp, 0.707602859_sp)) > 1e-6_sp) error stop print *, tan(b4) if (abs(tan(b4) - (0.31267491960977922_dp, 0.70760291160255895_dp)) > 1e-12_dp) error stop print *, tan(br1) if (any(abs(tan(br1) - [0.546302497_sp, 0.842288375_sp, 1.26015818_sp]) > 1e-6_sp)) error stop print *, tan(br2) if (any(abs(tan(br2) - [0.54630248984379048_dp, 0.84228838046307941_dp, 1.2601582175503392_dp]) > 1e-12_dp)) error stop print *, tan(bc1) if (any(abs(tan(bc1) - [(0.312674940_sp, 0.707602859_sp), (0.224352330_sp, 1.02681565_sp), & (5.596723780E-02_sp, 1.08762586_sp)]) > 1e-6_sp)) error stop print *, tan(bc2) if (any(abs(tan(bc2) - [(0.31267491960977922_dp, 0.70760291160255895_dp), (0.22435234690709807_dp, 1.0268156677854674_dp), & (5.59672199341484863E-002_dp, 1.0876258337665916_dp)]) > 1e-12_dp)) error stop end programlfortran-0.63.0/integration_tests/string_84.f900000664000175000017500000000053215174404631021526 0ustar alastairalastairprogram string_84 implicit none character(len=:), pointer :: str character(5), target :: temp_str temp_str = "Hello" str => temp_str str(2:2) = "?" print *, temp_str if(temp_str /= "H?llo") error stop if(.not. associated(str)) error stop nullify(str) if(associated(str)) error stop end program lfortran-0.63.0/integration_tests/dabs_01.f900000664000175000017500000000062015174404631021114 0ustar alastairalastairsubroutine e1z(z) implicit complex*16 (c,z) implicit double precision (a,d-h,o-y) if (abs(dabs(dimag(z))) > 1d-10) error stop if (abs(dabs(0.0d0)) > 1d-10) error stop print *, "dimag(z) =", dimag(z) print *, "dabs(dimag(z)) =", dabs(dimag(z)) print *, "dabs(0.0) = ", dabs(0.0d0) return end program dabs_01 complex*16 z z = (-1.0d0, -0.0d0) call e1z(z) end program lfortran-0.63.0/integration_tests/intrinsics_133.f900000664000175000017500000000464415174404631022470 0ustar alastairalastairprogram intrinsics_133 real :: x = 5.8 real :: y = 6.0 integer, parameter :: array_size = 3 integer(kind = 4) :: res_4 integer(kind = 8) :: res_8 integer(kind=4) :: res_4_arr(array_size) integer(kind=8) :: res_8_arr(array_size) res_4 = Ceiling(x) print *, res_4 if (res_4 /= 6) error stop res_8 = Ceiling(x, 8) print *, res_8 if (res_8 /= 6) error stop res_4 = Ceiling(x, 4) print *, res_4 if (res_4 /= 6) error stop res_4 = Ceiling(y) print *, res_4 if (res_4 /= 6) error stop res_8 = Ceiling(y, 8) print *, res_8 if (res_8 /= 6) error stop res_4 = Ceiling(y, 4) print *, res_4 if (res_4 /= 6) error stop res_4 = Ceiling(5.8) print *, res_4 if (res_4 /= 6) error stop res_8 = Ceiling(5.8, 8) print *, res_8 if (res_8 /= 6) error stop res_4 = Ceiling(6.00, 8) print *, res_4 if (res_4 /= 6) error stop res_8 = Ceiling(6.00, 8) print *, res_8 if (res_8 /= 6) error stop res_4 = Ceiling(0.0) print *, res_4 if (res_4 /= 0) error stop res_8 = Ceiling(0.0, 8) print *, res_8 if (res_8 /= 0) error stop res_4 = Ceiling(-412.124) print *, res_4 if (res_4 /= -412) error stop res_8 = Ceiling(-412.124, 8) print *, res_8 if (res_8 /= -412) error stop res_4 = Ceiling(-412.00) print *, res_4 if (res_4 /= -412) error stop res_8 = Ceiling(-412.00, 8) print *, res_8 if (res_8 /= -412) error stop ! Compile time broadcasting res_4_arr = Ceiling([real :: 1.2, 3.3, 5]) print *, res_4_arr(1) if (res_4_arr(1) /= 2) error stop print *, res_4_arr(2) if (res_4_arr(2) /= 4) error stop print *, res_4_arr(3) if (res_4_arr(3) /= 5) error stop ! Compile time broadcasting res_4_arr = Ceiling([real :: 1.2, 3.3, 5]) print *, res_4_arr(1) if (res_4_arr(1) /= 2) error stop print *, res_4_arr(2) if (res_4_arr(2) /= 4) error stop print *, res_4_arr(3) if (res_4_arr(3) /= 5) error stop res_8_arr = Ceiling([real(8) :: 1.2, 3.3, 5], kind=8) print *, res_8_arr(1) if (res_8_arr(1) /= 2) error stop if (kind(res_8_arr(1)) /= 8) error stop print *, res_8_arr(2) if (res_8_arr(2) /= 4) error stop if (kind(res_8_arr(2)) /= 8) error stop print *, res_8_arr(3) if (res_8_arr(3) /= 5) error stop if (kind(res_8_arr(3)) /= 8) error stop end program lfortran-0.63.0/integration_tests/derived_types_14.f900000664000175000017500000000245315174404631023063 0ustar alastairalastairmodule derived_types_14_module1 use derived_types_14_module implicit none contains !> Determine TOML value type function toml_get_value_type(raw) result(vtype) !> Raw representation of TOML string character(len=*), intent(in) :: raw !> Value type integer :: vtype if (check(raw)) then vtype = toml_type%string return end if if (check(raw)) then vtype = toml_type%boolean return end if if (check(raw)) then vtype = toml_type%int return end if if (check(raw)) then vtype = toml_type%float return end if if (check(raw)) then vtype = toml_type%datetime return end if vtype = toml_type%invalid end function function check(raw) result(res) !> Raw representation of TOML string character(len=*), intent(in) :: raw !> Value type logical :: res res = .true. end function end module derived_types_14_module1 program main implicit none print *, "running derived_types_14 main program" end program main lfortran-0.63.0/integration_tests/read_75.f900000664000175000017500000000222615174404631021135 0ustar alastairalastairprogram read_75 implicit none ! Test list-directed read with null values and repeat-count syntax. ! Input: ", (2.0, 3.0),,6.0D0, 2*," ! d1 -> null (keep 1.0), c1 -> (2.0,3.0), c2 -> null (keep (4.0,5.0)), ! d2 -> 6.0, c3 -> null via 2* (keep (7.0,8.0)), d3 -> null via 2* (keep 9.0) character(*), parameter :: cdata = ", (2.0, 3.0),,6.0D0, 2*," double precision :: d1, d2, d3 complex :: c1, c2, c3 open (42, file='read_75.dat', status='replace', form='formatted') write (42,'(a)') cdata rewind (42) d1 = 1.0d0 c2 = (4.0, 5.0) c3 = (7.0, 8.0) d3 = 9.0d0 read (42, *) d1, c1, c2, d2, c3, d3 if (abs(d1 - 1.0d0) > 0.0001d0) error stop "d1 failed" if (abs(real(c1) - 2.0) > 0.0001 .or. abs(aimag(c1) - 3.0) > 0.0001) error stop "c1 failed" if (abs(real(c2) - 4.0) > 0.0001 .or. abs(aimag(c2) - 5.0) > 0.0001) error stop "c2 failed" if (abs(d2 - 6.0d0) > 0.0001d0) error stop "d2 failed" if (abs(real(c3) - 7.0) > 0.0001 .or. abs(aimag(c3) - 8.0) > 0.0001) error stop "c3 failed" if (abs(d3 - 9.0d0) > 0.0001d0) error stop "d3 failed" close (42, status='delete') print *, "ok" end program lfortran-0.63.0/integration_tests/derived_types_81.f900000664000175000017500000000214015174404631023060 0ustar alastairalastairmodule hashmap_wrappers_derived_types_81 implicit none type :: key_type integer(4) :: value end type key_type abstract interface pure function hasher_fun( key ) result(hash_value) import key_type type(key_type), intent(in) :: key integer(4) :: hash_value end function hasher_fun end interface contains pure function fnv_1_hasher( key ) type(key_type), intent(in) :: key integer(4) :: fnv_1_hasher fnv_1_hasher = key % value + 1 end function fnv_1_hasher end module module hashmaps_derived_types_81 use hashmap_wrappers_derived_types_81 implicit none type :: hashmap_type procedure(hasher_fun), pointer, nopass :: hasher => fnv_1_hasher end type hashmap_type end module program derived_types_81 use hashmaps_derived_types_81 implicit none type(hashmap_type) :: hmap type(key_type) :: key integer(4) :: result key % value = 1 result = hmap % hasher(key) print *, result if (result /= 2) error stop end programlfortran-0.63.0/integration_tests/intrinsics_408.f900000664000175000017500000000076615174404631022476 0ustar alastairalastairprogram intrinsics_408 use iso_fortran_env, only: real64 implicit none complex(real64) :: z real(real64) :: r ! This stresses abs(complex) lowering for very small magnitudes: ! naive hypot = sqrt(x*x + y*y) underflows to 0.0 for x=y=1e-200 (real64), ! while a scaled hypot algorithm must return a positive value. z = cmplx(1.0e-200_real64, 1.0e-200_real64, kind=real64) r = abs(z) if (r == 0.0_real64) error stop print *, "ok" end program intrinsics_408 lfortran-0.63.0/integration_tests/intrinsics_309.f900000664000175000017500000000316015174404631022465 0ustar alastairalastairprogram intrinsics_309 implicit none integer :: k integer(1), parameter :: xi1(2) = pack([1_1, 2_1, 3_1], [.true., .false., .true.]) integer(2), parameter :: xi2(3) = pack([1_2, 2_2, 3_2], [.true., .true., .true.]) integer(4), parameter :: xi3(2) = pack([1, 2, 3], [.true., .false., .true.]) integer(8), parameter :: xi4(3) = pack([1_8, 2_8, 3_8], [.true., .true., .true.]) integer(4), parameter :: xi5(*) = pack([(k**2, k = 1,3)], [(.true., k = 1,2), .false.]) real, parameter :: x3(2) = pack([1.0, 2.0, 3.0], [.true., .false., .true.]) real(8), parameter :: x4(3) = pack([1.0_8, 2.0_8, 3.0_8], [.true., .true., .true.]) complex, parameter :: x5(2) = pack([(1.0, 1.0), (2.0, 2.0), (3.0, 3.0)], [.true., .false., .true.]) complex(8), parameter :: x6(3) = pack([(1.0_8, 1.0_8), (2.0_8, 2.0_8), (3.0_8, 3.0_8)], [.true., .true., .true.]) logical, parameter :: x7(2) = pack([.true., .false., .true.], [.true., .false., .true.]) print *, xi1 if (any(xi1 /= [1, 3])) error stop print *, xi2 if (any(xi2 /= [1, 2, 3])) error stop print *, xi3 if (any(xi3 /= [1, 3])) error stop print *, xi4 if (any(xi4 /= [1, 2, 3])) error stop print *, xi5 if (any(xi5 /= [1, 4])) error stop print *, x3 if (any(x3 - [1.0, 3.0] > 1e-6)) error stop print *, x4 if (any(x4 - [1.0_8, 2.0_8, 3.0_8] > 1e-12)) error stop print *, x5 if (any(x5 /= [(1.0, 1.0), (3.0, 3.0)])) error stop print *, x6 if (any(x6 /= [(1.0_8, 1.0_8), (2.0_8, 2.0_8), (3.0_8, 3.0_8)])) error stop print *, x7 if (any(x7 .neqv. [.true., .true.])) error stop end programlfortran-0.63.0/integration_tests/file_47.f900000664000175000017500000000116615174404631021142 0ustar alastairalastairprogram daio_test implicit none ! Simple direct access I/O test with LOGICAL arrays integer :: daunit, dall integer :: i logical :: l(10), lanswer dall = -42 inquire (iolength=dall) l print *, 'logical record iolength =', dall open (newunit=daunit, file='xyzzy.dat', access='direct', form='unformatted', recl=dall) l = .true. do, i=1, 5 l = .not. l write (daunit, rec=i) l end do lanswer = .true. do, i=5, 1, -1 lanswer = .not. lanswer read (daunit, rec=i) l print *, 'record', i if (any(l .neqv. lanswer)) error stop end do close (daunit, status='delete') end programlfortran-0.63.0/integration_tests/type_parameter_inquiry_01.f900000664000175000017500000000133715174404631025012 0ustar alastairalastairprogram type_parameter_inquiry_01 real(kind=8) :: real8 complex :: c character(len=10) :: s integer(kind=1) :: iarr(5) character(len=1) :: carr(5) iarr = [1, 2, 3, 4, 5] carr = [character(len=1) :: "a", "b", "c", "d", "e"] if (s%len /= 10 .or. s%len /= len(s)) error stop if (carr%len /= 1 .or. carr%len /= len(carr)) error stop if (carr(2)%len /= 1 .or. carr(2)%len /= len(carr(2))) error stop if (real8%kind /= 8 .or. real8%kind /= kind(real8)) error stop if (c%kind /= 4 .or. c%kind /= kind(c)) error stop if (iarr%kind /= 1 .or. iarr%kind /= kind(iarr)) error stop if (iarr(3)%kind /= 1 .or. iarr(3)%kind /= kind(iarr(3))) error stop end program type_parameter_inquiry_01 lfortran-0.63.0/integration_tests/arrays_op_23.f900000664000175000017500000000124115174404631022206 0ustar alastairalastairprogram arrays_op_23 implicit none real :: array(10, 10), output(10, 10) array = 3.0 output = attention(10, 10, 10, array) print *, output if( any(abs(output - 8.52982235) > 1e-6) ) error stop contains function attention(l, n, m, mask) result(y) integer, intent(in) :: l, n, m real, intent(in) :: mask(n, m) real :: y(l, m) real :: tmp(n, m) tmp = 4.0 call copy_array(twice(tmp / sqrt(real(l, 4)) + mask), y) end function function twice(x) result(y) real, intent(in) :: x(:, :) real :: y(size(x, 1), size(x, 2)) y = 2*x end function subroutine copy_array(src, dest) real, intent(in) :: src(:, :) real, intent(out) :: dest(:, :) dest = src end subroutine end program lfortran-0.63.0/integration_tests/array_op_09.f900000664000175000017500000000025415174404631022032 0ustar alastairalastairprogram test integer :: A(3,2) = reshape([1,2,3,4,5,6], [3,2]) integer :: X(2) X = abs(sum(A, dim=1)) if(X(1) /= 6) error stop if(X(2) /= 15) error stop end programlfortran-0.63.0/integration_tests/arrays_reshape_26.f900000664000175000017500000000063715174404631023232 0ustar alastairalastairprogram arrays_reshape_26 implicit none integer, parameter :: n = 2 integer, parameter :: arr(4) = [1,2,3,4] real :: b(2,2) = reshape(arr, [n,n]) if (b(1,1) /= 1.0) error stop "Mismatch at b(1,1)" if (b(2,1) /= 2.0) error stop "Mismatch at b(2,1)" if (b(1,2) /= 3.0) error stop "Mismatch at b(1,2)" if (b(2,2) /= 4.0) error stop "Mismatch at b(2,2)" end program arrays_reshape_26 lfortran-0.63.0/integration_tests/do_concurrent_06.f900000664000175000017500000000146115174404631023060 0ustar alastairalastair! equivalent to openmp_09.f90 subroutine parallel_factorial(n, ctr) use omp_lib use iso_fortran_env implicit none integer, intent(in) :: n integer(kind =int64), intent(inout) :: ctr integer(kind =int64) :: local_ctr integer :: i local_ctr = 1 do concurrent (i=1:n) reduce(*:local_ctr) local_ctr = local_ctr * i end do ctr = ctr + local_ctr end subroutine program do_concurrent_06 use omp_lib use iso_fortran_env integer, parameter :: n = 20 integer(kind =int64) :: ctr integer(kind =int64) :: res res = 2432902008176640000_int64 ! Factorial of 20 call omp_set_num_threads(8) ctr = 0 call parallel_factorial(n, ctr) print *, ctr if(ctr /= res) error stop end program lfortran-0.63.0/integration_tests/implicit_interface_04.f900000664000175000017500000000075415174404631024050 0ustar alastairalastairprogram main integer :: b(3) = [10, 20, 30] integer :: n = 3 call driver(implicit_interface_check, b, n) contains subroutine driver(fnc, arr, m) integer, intent(in) :: m, arr(m) print *, abs(-1.0) call fnc(arr, m, arr(3)) end subroutine subroutine implicit_interface_check(arr1, m, c) integer, intent(in) :: m, arr1(m), c if (m /= 3) error stop if (c /= 30) error stop if (arr1(1) /= 10) error stop if (arr1(2) /= 20) error stop if (arr1(3) /= 30) error stop end subroutine end program lfortran-0.63.0/integration_tests/arrays_reshape_37.f900000664000175000017500000000175115174404631023232 0ustar alastairalastairprogram arrays_reshape_37 ! Test reshape of character array assigned to deferred-length ! allocatable character array (realloc-lhs). implicit none character(:), allocatable :: a(:,:) character(:), allocatable :: b(:) ! 2D reshape of character array a = reshape(['ab','cd'], shape=[1,2]) if (a(1,1) /= 'ab') error stop if (a(1,2) /= 'cd') error stop if (size(a,1) /= 1) error stop if (size(a,2) /= 2) error stop if (len(a) /= 2) error stop ! Reassign with different shape a = reshape(['xx','yy','zz','ww'], shape=[2,2]) if (a(1,1) /= 'xx') error stop if (a(2,1) /= 'yy') error stop if (a(1,2) /= 'zz') error stop if (a(2,2) /= 'ww') error stop if (size(a,1) /= 2) error stop if (size(a,2) /= 2) error stop ! 1D character array assignment b = ['hello','world'] if (b(1) /= 'hello') error stop if (b(2) /= 'world') error stop if (len(b) /= 5) error stop ! Verify any() with reshape of character array if (any(a /= reshape(['xx','yy','zz','ww'], shape=[2,2]))) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/modules_49.f900000664000175000017500000000232515174404631021673 0ustar alastairalastairmodule modules_49_fpm_strings implicit none contains pure function replace(string, charset, target_char) result(res) character(*), intent(in) :: string character(len=1), intent(in) :: charset(:), target_char character(len(string)) :: res integer :: n, m, one one = 1 res = string do n = 1, len(string) ! TODO: To be fixed, after making any work for character types ! if (any(string(n:n) == charset)) then ! res(n:n) = target_char ! end if do m = lbound(charset, 1), ubound(charset, 1) if(string(n:n) == charset(m)) then res(n:n) = target_char(one:one) exit end if end do end do end function replace pure function to_fortran_name(string) result(res) character(*), intent(in) :: string character(len(string)) :: res character, parameter :: SPECIAL_CHARACTERS(*) = ['-'] res = replace(string, SPECIAL_CHARACTERS, '_') end function to_fortran_name end module program modules_49 use modules_49_fpm_strings implicit none character(len=40) :: name = "--gnu-gfortran-11" print *, name, to_fortran_name(name) if( to_fortran_name(name) /= "__gnu_gfortran_11" ) error stop end program lfortran-0.63.0/integration_tests/select_type_28.f900000664000175000017500000000176015174404631022542 0ustar alastairalastair! Test struct constructor with class member inside select type ! Verifies no double free when constructing a struct from a ! select type associated variable module select_type_28_type1mod type :: Type1 end type Type1 contains function get_Type1() result(res) class(*), allocatable :: res res = Type1() end function get_Type1 end module select_type_28_type1mod module select_type_28_type2mod use select_type_28_type1mod type :: Type2 class(Type1), allocatable :: field end type Type2 contains function get_Type2() result(res) class(*), allocatable :: res select type( obj => get_Type1() ) class is (Type1) res = Type2(obj) end select end function get_Type2 end module select_type_28_type2mod program select_type_28 use select_type_28_type2mod class(Type2), allocatable :: res select type( obj => get_Type2() ) class is (Type2) res = obj end select print *, "PASS" end program select_type_28 lfortran-0.63.0/integration_tests/bindc_04.f900000664000175000017500000000374515174404631021300 0ustar alastairalastairmodule thread_data_module use, intrinsic :: iso_c_binding type, bind(C) :: thread_data type(c_ptr) :: a integer(c_int) :: n end type thread_data end module thread_data_module subroutine lcompilers_initialise_array(data) bind(C) use thread_data_module use iso_c_binding implicit none type(c_ptr), intent(in), value :: data type(thread_data), pointer :: tdata real(c_float), pointer :: a(:) call c_f_pointer(data, tdata) call c_f_pointer(tdata%a, a, [5]) print *, "Array address in fortran :", transfer(tdata%a, 0_c_intptr_t) print *, "c_loc(a) :", transfer(c_loc(a), 0_c_intptr_t) print *, sum(a) if (abs(sum(a) - 10.0) > 1.0e-8) error stop end subroutine subroutine b_func_fortran(data) bind(C) use thread_data_module use iso_c_binding implicit none type(c_ptr), intent(in), value :: data real(c_float), pointer :: a(:) call c_f_pointer(data, a, [5]) print *, "Array address in fortran b_func_fortran:", transfer(data, 0_c_intptr_t) print *, "c_loc(a) b_func_fortran:", transfer(c_loc(a), 0_c_intptr_t) print *, sum(a) if (abs(sum(a) - 10.0) > 1.0e-8) error stop end subroutine program bindc_04 use iso_c_binding use thread_data_module interface subroutine lcompilers_initialise_array(data) bind(C) import :: c_ptr type(c_ptr), intent(in), value :: data end subroutine subroutine a_func(fn) bind(C, name="a_func") import :: c_funptr type(c_funptr), value :: fn end subroutine subroutine b_func_fortran(data) bind(C) import :: c_ptr type(c_ptr), intent(in), value :: data end subroutine subroutine b_func(fn) bind(C, name="b_func") import :: c_funptr type(c_funptr), value :: fn end subroutine subroutine c_func(arr) bind(C, name="c_func") import :: c_ptr type(c_ptr), value :: arr end subroutine end interface type(thread_data), target :: tdata real(c_float), dimension(:), pointer :: a allocate(a(5)) a = [1.0, 2.0, 3.0, 4.0, 5.0] tdata%a = c_loc(a) tdata%n = 5 call a_func(c_funloc(lcompilers_initialise_array)) call b_func(c_funloc(b_func_fortran)) call c_func(c_loc(a)) deallocate(a) end program bindc_04 lfortran-0.63.0/integration_tests/arrays_110.f900000664000175000017500000000165215174404631021573 0ustar alastairalastairprogram arrays_110 implicit none integer, parameter :: a(*) = pack([1, 2, 3, 4, 5], & [.true., .false., .true., .false., .true.]) integer, parameter :: b(*) = pack([10, 20, 30], [.true., .true., .true.]) integer, parameter :: c(*) = pack([7, 8, 9, 10], [.false., .true., .false., .true.]) integer, parameter :: max_ij = 13, max_sum = 2 * max_ij ** 3 integer :: i, j, k integer, allocatable :: s2cube(:) if (size(a) /= 3) error stop if (a(1) /= 1) error stop if (a(2) /= 3) error stop if (a(3) /= 5) error stop if (size(b) /= 3) error stop if (b(1) /= 10) error stop if (b(2) /= 20) error stop if (b(3) /= 30) error stop if (size(c) /= 2) error stop if (c(1) /= 8) error stop if (c(2) /= 10) error stop s2cube = pack( [ (k, k = 1,max_sum)], & [ ( count( [((i**3+j**3, i = 1,j), & j = 1,max_ij)] == k ) > 1, & k = 1,max_sum )] ) if (size(s2cube) /= 1) error stop if (s2cube(1) /= 1729) error stop end program arrays_110lfortran-0.63.0/integration_tests/submodule_51a.f900000664000175000017500000000026315174404631022353 0ustar alastairalastairprogram submodule_51_main use submodule_51_mod implicit none real, parameter :: x(2,3) = reshape([1., 2., 3., 4., 5., 6.], [2, 3]) call show(x < 3.) print *, "PASSED" end program lfortran-0.63.0/integration_tests/implicit_interface_30.f900000664000175000017500000000031115174404631024034 0ustar alastairalastairsubroutine mysub (nint, in, iout) iout = nint (in) end subroutine program implicit_interface_30 integer :: ival intrinsic :: iabs call mysub (iabs, -42, ival) if (ival /= 42) error stop end programlfortran-0.63.0/integration_tests/associate_26.f900000664000175000017500000000127615174404631022175 0ustar alastairalastairprogram associate_26 implicit none type :: str integer :: data integer(1) :: a end type type(str), target :: e(8) integer :: i,j,array_sum,loop_sum integer, pointer :: dd(:) integer, parameter :: idx(8) = [(i,i=1,8)] ! Set data e%data = idx !dd=>idx ! OK dd=>e%data ! ICE array_sum = sum(idx(dd)) loop_sum = 0 do j=1,size(dd) loop_sum = loop_sum+idx(dd(j)) end do print *, 'expected =',sum(idx) print *, 'array_sum=',array_sum print *, ' loop_sum=', loop_sum if (array_sum/=sum(idx)) error stop 'array sum result is wrong' if ( loop_sum/=sum(idx)) error stop 'loop sum result is wrong' stop 0 end program lfortran-0.63.0/integration_tests/nullify_01.f900000664000175000017500000000025215174404631021666 0ustar alastairalastairprogram nullify_01 implicit none integer, pointer :: p1, p2 integer, target :: t1 p1=>t1 p2=>t1 p1 = 1 nullify(p1, p2) end program nullify_01 lfortran-0.63.0/integration_tests/gpu_metal_98.f900000664000175000017500000000075115174404631022205 0ustar alastairalastairprogram gpu_metal_98 implicit none integer, parameter :: n = 2, m = 2 real :: v(m, n), w(m, m), r(m, n) integer :: i w = reshape([2.0, 0.0, 0.0, 2.0], [m, m]) v = reshape([1.0, 2.0, 3.0, 4.0], [m, n]) do concurrent (i = 1:n) r(:, i) = matmul(w, v(:, i)) end do if (abs(r(1,1) - 2.0) > 1e-6) error stop if (abs(r(2,1) - 4.0) > 1e-6) error stop if (abs(r(1,2) - 6.0) > 1e-6) error stop if (abs(r(2,2) - 8.0) > 1e-6) error stop print *, "ALL PASSED" end program lfortran-0.63.0/integration_tests/arrays_95.f900000664000175000017500000000076515174404631021533 0ustar alastairalastairmodule module_arrays_95_mm contains function foo(ii) result(res) integer :: ii integer :: res(10) res = -8 res(ii) = 9 end function end module program arrays_95 use module_arrays_95_mm integer :: inn integer :: res(10) inn = 1 print *, foo(inn) res = foo(inn) if (res(inn) /= 9) error stop "Test failed" if (size(foo(inn)) /= 10) error stop "Test failed" if (all(res(inn:) == -8)) error stop "Test failed" end program lfortran-0.63.0/integration_tests/cpp_pre_14_include.h0000664000175000017500000000023215174404631023172 0ustar alastairalastair#ifndef CPP_PRE_14_INCLUDE_H #define CPP_PRE_14_INCLUDE_H #define CPP_PRE_14_VAL 42 #if CPP_PRE_14_VAL > 0 use iso_c_binding, only: c_int #endif #endif lfortran-0.63.0/integration_tests/select_rank_11.f900000664000175000017500000000101015174404631022470 0ustar alastairalastairprogram select_rank_11 implicit none call check_scalar(5, 0) print *, "All tests passed" contains subroutine check_scalar(x, expected) integer, intent(in) :: x(..) integer, intent(in) :: expected select rank(x) rank(0) if (expected /= 0) error stop "Expected rank 0 for scalar" rank default error stop "Unexpected rank for scalar input" end select end subroutine check_scalar end program select_rank_11 lfortran-0.63.0/integration_tests/intrinsics_05.f900000664000175000017500000000016615174404631022401 0ustar alastairalastairprogram intrinsics_05 real :: x x = sinh(1.0) print *, x x = cosh(1.0) print *, x x = tanh(1.0) print *, x end lfortran-0.63.0/integration_tests/cycle_and_exit1.f900000664000175000017500000000141115174404631022735 0ustar alastairalastairprogram test_loops integer :: i, j, k, l l1 : do i = 1, 5 l2 : do j = 1, 4 if (j > 2) then exit l1 end if print *, "l1", i, "l2", j if (j > 2) then print *, "error l2 1" end if end do l2 if (j > 2) then print *, "error l2 2" end if end do l1 k = 0 l3 : do while(.true.) l4 : do l = 1, 2 if (k > 3) then exit l3 end if print *, "l3", k, "l4", l if (k > 3) then print *, "error l3 1" end if end do l4 if (k > 3) then print *, "error l3 2" end if k = k + 1 end do l3 if (i == 1 .and. j == 3 .and. k == 4 .and. l == 1) then print *, "pass" else print *, "error", i, j, k, l end if end programlfortran-0.63.0/integration_tests/separate_compilation_class_star_01a.f900000664000175000017500000000046515174404631026773 0ustar alastairalastairmodule separate_compilation_class_star_01_mod implicit none private public :: get_value contains subroutine get_value(g) class(*), intent(out) :: g select type(g) type is (integer) g = 42 end select end subroutine get_value end module separate_compilation_class_star_01_mod lfortran-0.63.0/integration_tests/arrays_reshape_19.f900000664000175000017500000000101315174404631023221 0ustar alastairalastairmodule arrays_reshape_19_mod contains subroutine another_func(q) integer, intent(in) :: q(:,:) integer :: anew(18) anew = reshape([0,q,17], [18]) print *, anew if(any(anew /= [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])) error stop end subroutine another_func end module program arrays_reshape_19 use arrays_reshape_19_mod integer :: q(4,4) q = reshape([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16], [4,4]) call another_func(q) end program arrays_reshape_19lfortran-0.63.0/integration_tests/types_06.f900000664000175000017500000000121515174404631021355 0ustar alastairalastairprogram types_06 implicit none real :: r integer :: i r = 2 i = 2 if (i < i) error stop if (r < r) error stop if (r < i) error stop if (i < r) error stop if (i > i) error stop if (r > r) error stop if (r > i) error stop if (i > r) error stop if (i /= i) error stop if (r /= r) error stop if (r /= i) error stop if (i /= r) error stop if (i+1 <= i) error stop if (r+1 <= r) error stop if (r+1 <= i) error stop if (i+1 <= r) error stop if (i >= i+1) error stop if (r >= r+1) error stop if (r >= i+1) error stop if (i >= r+1) error stop if (i == i+1) error stop if (r == r+1) error stop if (r == i+1) error stop if (i == r+1) error stop end program lfortran-0.63.0/integration_tests/types_17.f900000664000175000017500000000034115174404631021356 0ustar alastairalastairprogram types_17 implicit none contains subroutine f1() integer, pointer :: ptr nullify(ptr) end subroutine subroutine f2() character(len=2), pointer :: ptr nullify(ptr) end subroutine end program lfortran-0.63.0/integration_tests/character_12.f900000664000175000017500000000144515174404631022147 0ustar alastairalastairprogram character_12 use iso_c_binding, only: c_char implicit none character(:), allocatable :: text character(kind=c_char, len=:), allocatable :: y text = "Hello" if (.not. expect_h(text)) error stop if (.not. expect_h("Hello")) error stop if (expect_h("World")) error stop y = 'Hello' // achar(0) if (.not. temp(y)) error stop contains logical function expect_h(x) character, intent(in) :: x(*) expect_h = (x(1) == 'H') end function expect_h logical function temp(x) character(kind=c_char), intent(in) :: x(*) integer :: i i = 1 temp = .false. if (ichar(x(i)) >= ichar('A') .and. ichar(x(i)) <= ichar('Z')) then temp = .true. end if end function temp end program character_12 lfortran-0.63.0/integration_tests/separate_compilation_33.f900000664000175000017500000000033215174404631024412 0ustar alastairalastairprogram separate_compilation_33 use separate_compilation_33a, only: divergence_1d_t implicit none type(divergence_1d_t) :: x if (storage_size(x) <= 0) error stop 1 end program separate_compilation_33 lfortran-0.63.0/integration_tests/arrays_109.f900000664000175000017500000000055615174404631021605 0ustar alastairalastairprogram arrays_109 implicit none integer :: M(2) call my_sub(M) if (M(1) /= 1) error stop if (M(2) /= 1) error stop contains function make_vec() result(C) integer :: C(2) C = 1 end function subroutine my_sub(M) integer, intent(out) :: M(2) M = make_vec() end subroutine end program arrays_109 lfortran-0.63.0/integration_tests/gpu_metal_162.f900000664000175000017500000000131315174404631022250 0ustar alastairalastair! Test: sum() of array expression inside associate block within do concurrent. ! Previously, the GPU offload pass did not recurse into AssociateBlockCall ! when inlining sum(), causing a call to _lcompilers_Sum (unavailable in ! Metal shader) and "unknown array size" placeholders. program gpu_metal_162 implicit none integer :: i real :: a(3), b(3), results(4) a = [1.0, 2.0, 3.0] b = [0.5, 0.5, 0.5] do concurrent (i = 1:4) block associate(x => a, y => b) results(i) = sum((x - y)**2) end associate end block end do ! sum((0.5^2 + 1.5^2 + 2.5^2)) = 0.25 + 2.25 + 6.25 = 8.75 do i = 1, 4 if (abs(results(i) - 8.75) > 1.0e-5) error stop end do print *, "PASS" end program lfortran-0.63.0/integration_tests/pass_array_by_data_extname_01.f900000664000175000017500000000145715174404631025564 0ustar alastairalastairmodule pass_array_extname_mod_a implicit none contains subroutine process(arr) real, intent(inout) :: arr(:) arr = arr + 1.0 end subroutine end module module pass_array_extname_mod_b implicit none contains subroutine process(arr) real, intent(inout) :: arr(:) arr = arr * 2.0 end subroutine end module program pass_array_by_data_extname_01 use pass_array_extname_mod_a, only: process_a => process use pass_array_extname_mod_b, only: process_b => process implicit none real :: x(4) x = 1.0 call process_a(x) call process_b(x) if (abs(x(1) - 4.0) > 1.0e-6) error stop if (abs(x(2) - 4.0) > 1.0e-6) error stop if (abs(x(3) - 4.0) > 1.0e-6) error stop if (abs(x(4) - 4.0) > 1.0e-6) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/arrays_op_27.f900000664000175000017500000000045115174404631022214 0ustar alastairalastairprogram arrays_op_27 implicit none integer :: R(4), V(4), U(4) R = 23 V = 9 U = 1 R(2:4) = V(2:4) * 1 * U(2:4) print *, R if (R(1) /= 23) error stop if (R(2) /= 9) error stop if (R(3) /= 9) error stop if (R(4) /= 9) error stop end program arrays_op_27 lfortran-0.63.0/integration_tests/arrays_32.f900000664000175000017500000000177315174404631021522 0ustar alastairalastairprogram array_32 implicit none type :: der_type real :: r integer :: i end type real, dimension(5) :: a, b complex, dimension(6) :: x integer, dimension(3) :: c logical, dimension(2) :: d type(der_type), dimension(7) :: p real, dimension(2,3) :: e complex, dimension(6,8) :: y integer, dimension(3,4) :: f logical, dimension(5,2) :: g type(der_type), dimension(7,9) :: q real, dimension(2:3,3:4,4:5) :: h complex, dimension(6:7,8:10,11:13) :: z integer, dimension(3:4,4:5,3:4) :: i logical, dimension(5:6,2:3,2:4) :: j type(der_type), dimension(7:10,9:15,16:18) :: r if( lbound(p, 1) /= 1 ) error stop if( ubound(p, 1) /= 7 ) error stop if( lbound(q, 1) /= 1 ) error stop if( ubound(q, 1) /= 7 ) error stop if( lbound(q, 2) /= 1 ) error stop if( ubound(q, 2) /= 9 ) error stop if( lbound(r, 1) /= 7 ) error stop if( ubound(r, 1) /= 10 ) error stop if( lbound(r, 2) /= 9 ) error stop if( ubound(r, 2) /= 15 ) error stop if( lbound(r, 3) /= 16 ) error stop if( ubound(r, 3) /= 18 ) error stop end program lfortran-0.63.0/integration_tests/procedure_09_b.f900000664000175000017500000000055215174404631022510 0ustar alastairalastairmodule test contains subroutine temp(call_back) use procedure_09_module implicit none procedure(cb) :: call_back logical :: terminate_var real :: x3(2) call call_back(x3, terminate = terminate_var) end subroutine temp end module program procedure_09 use procedure_09_module use test call temp(cb) end program procedure_09lfortran-0.63.0/integration_tests/class_11.f900000664000175000017500000000052315174404631021313 0ustar alastairalastairprogram class_11 implicit none type t_1 character(:), allocatable :: s end type t_1 type t class(t_1), allocatable :: x end type t type(t) :: type_1 allocate(type_1%x) allocate(character(4) :: type_1%x%s) type_1%x%s = "1234" if (type_1%x%s /= "1234") error stop end program class_11 lfortran-0.63.0/integration_tests/file_17.f900000664000175000017500000000105515174404631021134 0ustar alastairalastairprogram file_17 integer :: i real :: arr(3) real :: a, b, c arr(1) = 100.123 arr(2) = -2.14 arr(3) = 528.156 open(10, file="file_17_util.txt", status="replace") write(10, "((es23.16))") (arr(i), i=1, size(arr)) close(10) open(10, file="file_17_util.txt") read(10, *) a, b, c close(10) print *, arr(1), a print *, arr(2), b print *, arr(3), c if (abs(arr(1) - a) > 1e-5) error stop if (abs(arr(2) - b) > 1e-5) error stop if (abs(arr(3) - c) > 1e-5) error stop end program file_17 lfortran-0.63.0/integration_tests/bindc_45c.c0000664000175000017500000000052715174404631021267 0ustar alastairalastair/* * C function for bindc_45: mutual recursion with Fortran * * c45_mutual_fib calls back into Fortran's f45_fib, which in turn * calls c45_mutual_fib for sub-problems, creating a Fortran<->C * recursive call chain. */ #include extern int32_t f45_fib(int32_t n); int32_t c45_mutual_fib(int32_t n) { return f45_fib(n); } lfortran-0.63.0/integration_tests/intrinsics_145.f900000664000175000017500000000171215174404631022464 0ustar alastairalastairprogram intrinsics_145 complex :: a(3), b(3) complex :: res complex(8) :: c(3), d(3) complex(8) :: res_8 a = [(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)] b = [(7.0, 8.0), (9.0, 10.0), (11.0, 12.0)] res = dot_product([(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)], [(7.0, 8.0), (9.0, 10.0), (11.0, 12.0)]) print *, abs(res) if (abs(abs(res) - 217.745270) > 1e-8) error stop res = dot_product(a, b) print *, abs(res) if (abs(abs(res) - 217.745270) > 1e-8) error stop c = [(1.0D0, 2.0D0), (3.0D0, 4.0D0), (5.0D0, 6.0D0)] d = [(7.0D0, 8.0D0), (9.0D0, 10.0D0), (11.0D0, 12.0D0)] res_8 = dot_product(c, d) print *, abs(res_8) if (abs(abs(res_8) - 217.74526401279087D0) > 1e-12) error stop res_8 = dot_product([(1.0D0, 2.0D0), (3.0D0, 4.0D0), (5.0D0, 6.0D0)], [(7.0D0, 8.0D0), (9.0D0, 10.0D0), (11.0D0, 12.0D0)]) print *, abs(res_8) if (abs(abs(res_8) - 217.74526401279087D0) > 1e-12) error stop end program lfortran-0.63.0/integration_tests/modulo_01.f900000664000175000017500000000031615174404631021504 0ustar alastairalastairprogram modulo_01 real :: x1 integer :: i1 x1 = 3.3 print*, modulo(x1, 3.) print*, modulo(x1, 2.) print*, modulo(x1, 1.) i1 = 4 print*, modulo(i1, 6) print*, modulo(i1, 3) print*, modulo(i1, 1) end program lfortran-0.63.0/integration_tests/format_74.f900000664000175000017500000000133515174404631021511 0ustar alastairalastairprogram format_74 implicit none integer :: u character(len=120) :: line1, line2 open (newunit=u, file='format_74_data.txt', status='replace', form='formatted') write (u, 100) 1, 2, 3, 4 close (u) open (newunit=u, file='format_74_data.txt', status='old', form='formatted') read (u, '(A)') line1 read (u, '(A)') line2 close (u) if (index(line1, '1 **') == 0) error stop "missing first item" if (index(line1, "2 ''") == 0) error stop "missing quoted literal" if (index(line1, '3 ((') == 0) error stop "missing literal parentheses" if (index(line2, "4 ''") == 0) error stop "missing reverted-format item" 100 format (27X,I4," **",1(27X,I4," ''",(I4," (("))) end program format_74 lfortran-0.63.0/integration_tests/union_test_02.f900000664000175000017500000000152215174404631022375 0ustar alastairalastairmodule lp_union_test_02_mod implicit none _lfortran_union_type :: test_type integer :: x real :: y end _lfortran_union_type _lfortran_union_type :: test_type1 integer :: x integer(kind=8) :: y end _lfortran_union_type end module program lp_union_test_02 use lp_union_test_02_mod implicit none real ::eps = 1e-6, x integer :: y, z type(test_type) :: test_union type(test_type1) :: test_union1 ! Memory value of pi test_union%x = 1078530011 ! Doesn't currently support direct operations x = test_union%y if ( abs(x - 3.141593) > eps ) error stop test_union1%x = 121222 y = test_union1%x z = int(test_union1%y) ! FIX: hack work around if ( abs(y-z) > eps ) error stop end program lfortran-0.63.0/integration_tests/intrinsics_201.f900000664000175000017500000000132315174404631022453 0ustar alastairalastairprogram intrinsics_201 real, dimension(3) :: x = [1.0, 2.0, 3.0] logical, dimension(3) :: mask = [.true., .false., .true.] integer, dimension(3) :: y = [1, 2, 3] print *, median_all_1_rsp_sp(x) if (median_all_1_rsp_sp(x)) error stop print *, median_all_mask_1_iint8_dp(y, mask) if (median_all_mask_1_iint8_dp(y, mask)) error stop contains function median_all_1_rsp_sp (x) result(res) use ieee_arithmetic real, intent(in) :: x(:) logical :: res res = any(ieee_is_nan(x)) end function median_all_1_rsp_sp function median_all_mask_1_iint8_dp(x, mask) result(res) integer, intent(in) :: x(:) logical, intent(in) :: mask(:) logical :: res res = any(shape(x) /= shape(mask)) end function median_all_mask_1_iint8_dp end program lfortran-0.63.0/integration_tests/implicit_interface_19b.f900000664000175000017500000000010415174404631024205 0ustar alastairalastairinteger function ifunc(i) integer :: i ifunc = i * 912 end function lfortran-0.63.0/integration_tests/logical_testing.f900000664000175000017500000000250015174404631023051 0ustar alastairalastairprogram logicalStringInput implicit none integer, parameter :: n = 6 logical :: x character(len=1) :: actual(n), expected(n) integer :: ios, i, unit_no character(len=20), dimension(n) :: inputs = [ & ".true. ", ".false. ", "true ", "false ", & "True ", "False " ] ! as suggested, creating array for the expected tests expected = ['T', 'F', 'T', 'F', 'T', 'F'] ! as suggested, using the scratch file over .txt file open(newunit=unit_no, status="scratch") ! writing in the scratch file do i = 1, n write(unit_no, '(A)') trim(inputs(i)) end do rewind(unit_no) ! reading do i = 1, n read(unit_no, *, iostat=ios) x if (ios /= 0) then print *, "Error reading logical at index", i stop 1 end if if (x) then actual(i) = 'T' else actual(i) = 'F' end if end do close(unit_no) ! array se check validation do i = 1, n if (actual(i) /= expected(i)) then print *, "Test failed at index", i print *, "Expected:", expected(i), " but got:", actual(i) stop 1 end if end do print *, "Tests Working Correctly!" end program logicalStringInput lfortran-0.63.0/integration_tests/class_09.f900000664000175000017500000000314315174404631021323 0ustar alastairalastairmodule class_09_module implicit none private public point, point2d, point3d type, abstract :: point real res contains procedure(func), deferred :: radius end type point abstract interface subroutine func( this ) import point class(point) this end subroutine func end interface type, extends(point) :: point2d real x, y contains procedure :: radius => r2d end type point2d type, extends(point2d) :: point3d real z contains procedure :: radius => r3d end type point3d contains subroutine r2d( this ) class(point2d) this this%res = sqrt( this%x ** 2 + this%y ** 2 ) print *, this%res end subroutine r2d subroutine r3d( this ) class(point3d) this this%res = sqrt( this%x ** 2 + this%y ** 2 + this%z ** 2 ) print *, this%res end subroutine r3d end module class_09_module program class_09_program use class_09_module implicit none class(point), pointer :: ptr type(point2d), target :: p2d = point2d( 0, 3, 4 ) type(point3d), target :: p3d = point3d( 0, 3, 4, 5 ) print *, p2d%x, p2d%y print *, p3d%x, p3d%y, p3d%z ptr => p2d print *, "2-d radius is: " call ptr%radius() if (ptr%res /= 5.) error stop ptr => p3d print *, "3-d radius is: " call ptr%radius() if (abs(ptr%res - 7.07106781) > 1e-7) error stop p3d%x = 3.0 p3d%y = 4.0 p3d%z = 0.0 print *, "3-d radius is: " call ptr%radius() if (ptr%res /= 5.) error stop end program class_09_program lfortran-0.63.0/integration_tests/intrinsics_72.f900000664000175000017500000000027215174404631022403 0ustar alastairalastairprogram intrinsics_72 real(8) :: x, y, datan2 x = 2.33D0 y = 3.41D0 print *, datan2(x,y) if(abs(datan2(x,y) - 0.59941916594660438) > 1d-6) error stop end programlfortran-0.63.0/integration_tests/legacy_array_sections_19.f900000664000175000017500000000136615174404631024575 0ustar alastairalastairmodule legacy_array_sections_19_m1 implicit none contains subroutine update(c, n) integer, intent(in) :: n real, intent(inout) :: c(n, *) c(1, 1) = c(1, 1) + 10.0 c(2, 1) = c(2, 1) + 20.0 end subroutine end module module legacy_array_sections_19_m2 use legacy_array_sections_19_m1 implicit none contains subroutine work(a, n) integer, intent(in) :: n real, intent(inout) :: a(n, *) call update(a(2, 2), n) end subroutine end module program legacy_array_sections_19 use legacy_array_sections_19_m2 implicit none real :: A(3,3) A = 0.0 call work(A, 3) if (A(2,2) /= 10.0) error stop if (A(3,2) /= 20.0) error stop print *, "PASS" end program lfortran-0.63.0/integration_tests/allocatable_component_reshape_unallocated_01.f900000664000175000017500000000117015174404631030613 0ustar alastairalastairprogram allocatable_component_reshape_unallocated_01 implicit none type :: t real, allocatable :: arr(:,:) end type t type(t) :: x real :: input(2, 3) real :: gradient(6) input = reshape([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], [2, 3]) gradient = [10.0, 20.0, 30.0, 40.0, 50.0, 60.0] x%arr = reshape(gradient, shape(input)) if (.not. allocated(x%arr)) error stop if (size(x%arr, 1) /= 2) error stop if (size(x%arr, 2) /= 3) error stop if (any(x%arr /= reshape([10.0, 20.0, 30.0, 40.0, 50.0, 60.0], [2, 3]))) error stop end program allocatable_component_reshape_unallocated_01 lfortran-0.63.0/integration_tests/class_26.f900000664000175000017500000000040115174404631021314 0ustar alastairalastairprogram class_26 implicit none type :: other_type class(*), allocatable :: value integer :: val = 1 end type other_type type(other_type) :: other print * , other % val if (other % val /= 1) error stop end program lfortran-0.63.0/integration_tests/arrays_98.f900000664000175000017500000000135115174404631021526 0ustar alastairalastairmodule arrays_98_mod character(*), parameter :: hello = "HELLO" character(*), parameter :: bye = "BYE" contains logical function ff(lhs) character(*), dimension(:), intent(in) :: lhs ff = ff2(lhs) end function ff logical function ff2(lhs) character(len=*), dimension(:), intent(in) :: lhs ff2 = all(lhs==hello) end function ff2 end module program arrays_98 use arrays_98_mod character(5) :: arr(20) arr = hello call ss(arr,.true.) arr = bye call ss(arr, .false.) contains subroutine ss(s, expected) character(*) :: s(:) logical :: expected if ( expected .neqv. ff(arr) ) error stop end subroutine end program lfortran-0.63.0/integration_tests/integer_bin_op_dim_external_module.f900000664000175000017500000000274215174404631026775 0ustar alastairalastairmodule xx integer :: nx = 4 integer :: ny = 1 integer :: nz = 1 end module xx subroutine a(cs) use xx integer, dimension(nx * ny - 1), intent(in) :: cs print *, cs if (all(cs /= [1, 2, 3])) error stop end subroutine subroutine b(cs) use xx integer, dimension(nx * ny), intent(in) :: cs print *, cs if (all(cs /= [1, 2, 3, 4])) error stop end subroutine subroutine c(cs) use xx integer, dimension(2 + 3), intent(in) :: cs print *, cs if (all(cs /= [1, 2, 3, 4, 5])) error stop end subroutine subroutine d(cs) use xx integer, dimension(nx - 1), intent(in) :: cs print *, cs if (all(cs /= [1, 2, 3])) error stop end subroutine subroutine e(cs) use xx integer, dimension(1 + nx * ny), intent(in) :: cs print *, cs if (all(cs /= [1, 2, 3, 4, 5])) error stop end subroutine subroutine f(cs) use xx integer, dimension(nx * ny * nz), intent(in) :: cs print *, cs if (all(cs /= [1, 2, 3, 4])) error stop end subroutine subroutine g(cs) use xx integer, dimension(1 + 2 + 3), intent(in) :: cs print *, cs if (all(cs /= [1, 2, 3, 4, 5, 6])) error stop end subroutine subroutine h(cs) use xx integer, dimension(nx * ny + ny * nz), intent(in) :: cs print *, cs if (all(cs /= [1, 2, 3, 4, 5])) error stop end subroutine program main integer, dimension(8) :: cs cs = [1, 2, 3, 4, 5, 6, 7, 8] call a(cs) call b(cs) call c(cs) call d(cs) call f(cs) call g(cs) call h(cs) end program lfortran-0.63.0/integration_tests/use_01.f900000664000175000017500000000103515174404631021000 0ustar alastairalastairMODULE one IMPLICIT NONE INTEGER :: nx = 1 CONTAINS SUBROUTINE sub (n) INTEGER, INTENT(INOUT) :: n n = n + 1 END SUBROUTINE sub INTEGER FUNCTION fun() result(i) i = 3 END FUNCTION END MODULE one MODULE two USE one, ONLY: nx, sub, fun IMPLICIT NONE END MODULE two PROGRAM test USE two USE one, ONLY: nx, sub, fun PRINT *, nx IF (nx /= 1) ERROR STOP CALL sub ( nx ) PRINT *, nx IF (nx /= 2) ERROR STOP PRINT *, fun() if (fun() /= 3) ERROR STOP END PROGRAM test lfortran-0.63.0/integration_tests/custom_operator_08.f900000664000175000017500000000212515174404631023441 0ustar alastairalastairmodule custom_operator_08_a implicit none public :: string_t public :: operator(//) type string_t character(len=:), allocatable :: string_ end type interface operator(//) module procedure string_t_cat_string_t end interface contains elemental module function from_characters(string) result(new_string) implicit none character(len=*), intent(in) :: string type(string_t) new_string new_string%string_ = string end function pure module function string_t_cat_string_t(lhs, rhs) result(lhs_cat_rhs) implicit none class(string_t), intent(in) :: lhs, rhs type(string_t) lhs_cat_rhs lhs_cat_rhs = string_t(lhs%string_ // rhs%string_) end function end module custom_operator_08_a module custom_operator_08_b use custom_operator_08_a implicit none contains subroutine test_concat type(string_t) :: str str = string_t("a") // string_t("b") end subroutine test_concat end module custom_operator_08_b program custom_operator_08 use custom_operator_08_b implicit none call test_concat() end program custom_operator_08 lfortran-0.63.0/integration_tests/select_rank_15.f900000664000175000017500000000144715174404631022512 0ustar alastairalastairprogram select_rank_15 implicit none type :: my_type integer :: value end type type(my_type) :: s type(my_type) :: a(3) s = my_type(42) a = [my_type(10), my_type(20), my_type(30)] call check_struct(s, 0) call check_struct(a, 1) contains subroutine check_struct(x, expected_rank) type(my_type), intent(in) :: x(..) integer, intent(in) :: expected_rank type(my_type) :: y select rank (x) rank (0) if (expected_rank /= 0) error stop y = x if (y%value /= 42) error stop rank (1) if (expected_rank /= 1) error stop y = x(1) if (y%value /= 10) error stop end select end subroutine end program lfortran-0.63.0/integration_tests/intrinsics_332.f900000664000175000017500000000044515174404631022464 0ustar alastairalastairprogram intrinsics_332 real, allocatable :: x(:, :), x1(:, :) real :: y allocate(x(4, 2), x1(4, 2)) x(:, 1) = -3.0 x(:, 2) = 4.0 y = maxval([sum(abs(x), 2), 0.0_4]) print *, y if( y /= 7.0 ) error stop y = maxval([sum(abs(x), 1), 0.0_4]) print *, y if( y /= 16.0 ) error stop end program lfortran-0.63.0/integration_tests/arrays_reshape_15.f900000664000175000017500000000106115174404631023220 0ustar alastairalastairprogram arrays_reshape_15 implicit none real, dimension(6) :: arr = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] real :: s(2, 3) integer :: i, j real, parameter :: eps = 1e-5 s = reshape(arr, shape(s)) if (abs(s(1, 1) - 1.0) > eps) error stop if (abs(s(2, 1) - 2.0) > eps) error stop if (abs(s(1, 2) - 3.0) > eps) error stop if (abs(s(2, 2) - 4.0) > eps) error stop if (abs(s(1, 3) - 5.0) > eps) error stop if (abs(s(2, 3) - 6.0) > eps) error stop do i = 1, 2 do j = 1, 3 write(*, '(F5.1)', advance='no') s(i, j) end do write(*, *) end do end program lfortran-0.63.0/integration_tests/expr_05.f900000664000175000017500000000232315174404631021167 0ustar alastairalastairprogram expr_05 ! Test parantheses in expressions implicit none integer :: x, a, b, c logical :: l a = 3 b = 4 c = 5 x = 2*3 x = -2*3 x = 2*(-3) x = -2*(-3) x = (-2)*(-3) x = -2**3 x = -(2**3) x = -(2*3) x = 2**(-3) x = a x = (a) x = a*b x = -a*b x = -(a*b) x = a*(-b) x = (-a)*(-b) x = a*b*c x = -a*b*c x = a*(-b)*c x = a*b*(-c) x = (-a)*(-b)*(-c) x = 3+4*5 x = (3+4)*5 x = a*(b + 5*(c - b)) x = (3-2*a*b)*5 x = (-2*a*b+3)*5 x = (-2*a*b+3*b*a)*5 x = (-2*(a/b)+(a+(-b))**2)*5 x = (+2*a*b+3)*5 x = a**2 + 2*a*b + b**2 x = (a + b)*(a - b) x = (a + b)**2 x = (a + b)*(a**2 - a*b + b**2) x = (a - b)*(a + b)*(a**2 + b**2) x = 1/(a*b) x = 1/a*b x = (1/a)*b x = 1/(a*b+1) x = 1/a*b+1 x = (1/a)*b+1 x = 2-(-2) x = a-(-b-c) x = a-(-2*b) x = c-(-2/b) x = a-(2+3+4) x = a+(2+3+4) x = 2*a+a*b-(a*b+2*a) x = 2*a+a*b-(a*b-2*a) x = a-(b-(c-1)) x = a-b x= a-(b-c) x= a-b-c x = -(a-(-b+(-b-(-b*b)))) x = -(3+5) x = -(a+5) l = x**3*4+a <= 4 .or. x<5 .and. x<6 .eqv. .true. .or. .not. .false. .and..true. l = l .or. l .and. l l = (l .or. l) .and. l l = l .and. l .or. l l = l .and. (l .or. l) l = l .or. .not. l .and. l l = l .or. l .and. .not. l l = l .and. l .or. .not. l l = l .and. .not. l .or. l l = l .and. .not. (l .or. l) end program lfortran-0.63.0/integration_tests/string_100.f900000664000175000017500000000134015174404631021571 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/5901 ! Allocatable scalar character string with merge and concatenation ! Exact MRE from issue body module integertostring implicit none integer :: n(2) = [42,-1] contains pure function i0(n) character(:),allocatable :: i0 integer,intent(in) :: n character(range(n)+2) :: result write(result,"(I0)") n i0 = trim(adjustl(result)) end function i0 end module integertostring program initialtest use integertostring, only: i0, n implicit none character(:),allocatable:: string string = 'The answer is '//merge(i0(n(1)),i0(n(2)),n(1)>0)//'.' print *,'"'//string//'"' if (string /= 'The answer is 42.') error stop end program initialtest lfortran-0.63.0/integration_tests/intrinsics_22.f900000664000175000017500000000206715174404631022402 0ustar alastairalastairprogram intrinsics_22 ! Test min/max intrinsics both declarations and executable statements. ! Single and double precision, real only. integer, parameter :: dp = kind(0.d0) real, parameter :: & s1 = min(-5., 3.), & s1b = max(-5., 3.) real(dp), parameter :: & d1 = min(-5._dp, 3._dp), & d1b = max(-5._dp, 3._dp) integer, parameter :: & j1 = min(-5, 3), & j1b = max(-5, 3) real :: x1, x2 real(dp) :: y1, y2, p1, p2 integer :: i1, i2 i1 = -5; i2 = 3 x1 = i1; y1 = i1; x2 = i2; y2 = i2; p1 = 5.0; p2 = 23.0; print *, min(-5., 3.), min(-5._dp, 3._dp), min(x1, x2), min(y1, y2), s1, d1 print *, max(-5., 3.), max(-5._dp, 3._dp), max(x1, x2), max(y1, y2), s1b, d1b print *, min(-5, 3), min(i1, i2), j1 print *, max(-5, 3), max(i1, i2), j1b if (abs(dmin1(p1, p2) - 5.0) > 1e-5) error stop if (abs(dmax1(p1, p2) - 23.0) > 1e-5) error stop if (abs(dmin1(12.0, -13.0) + 13.0) > 1e-5) error stop if (abs(dmax1(10.5, 12424.0) - 12424.0) > 1e-5) error stop if (abs(dmax1(0.0, -2.24) - 0.0) > 1e-5) error stop if (abs(dmin1(-12.3, 0.0) + 12.3) > 1e-5) error stop end lfortran-0.63.0/integration_tests/file_45.f900000664000175000017500000002155315174404631021142 0ustar alastairalastairprogram inquiries implicit none ! Test Fortran-77-ish subset of INQUIRE capabilities integer :: unit, unit_no logical :: exists, opened, named character(32) :: name, access, seq, direct, blank character(32) :: form, formatted, unformatted integer :: recl, nextrec integer :: i character(*), parameter :: testfn = 'inqtest.dat' character(*), parameter :: uninitc = '(uninit)' print *, unit ! Sequential formatted by filename print *, 'sequential formatted by filename' open (newunit=unit, file=testfn, form='formatted', status='unknown') write (unit, '(i4)') 42 rewind (unit) call init_test () inquire (file=testfn, exist=exists, opened=opened, number=unit_no, & named=named, name=name, access=access, sequential=seq, direct=direct, & form=form, formatted=formatted, unformatted=unformatted, blank=blank) print *, 'exist = ', exists, ' :', pf (exists) print *, 'opened = ', opened, ' :', pf (opened) print *, 'number = ', unit_no, ' :', pf (unit == unit_no) print *, 'named = ', named, ' :', pf (named) print *, 'name = ', trim (name), ' :', pf (name == testfn) print *, 'access = ', trim (access), ' :', pf (access == 'SEQUENTIAL') print *, 'sequential = ', trim (seq), ' :', pf (seq == 'YES') print *, 'direct = ', trim (direct), ' :', pf (direct == 'NO') print *, 'form = ', trim (form), ' :', pf (form == 'FORMATTED') print *, 'formatted = ', trim (formatted), ' :', pf (formatted == 'YES') print *, 'unformatted =', trim (unformatted), ' :', pf (unformatted == 'NO') print *, 'blank = ', trim (blank), ' :', pf (blank == 'NULL') close (unit, status='keep') ! Sequential formatted by unitno print *; print *, 'sequential formatted by unitno' open (newunit=unit, file=testfn, form='formatted', status='old', blank='zero') write (unit, '(i4)') 42 rewind (unit) call init_test () inquire (unit=unit, exist=exists, opened=opened, number=unit_no, & named=named, name=name, access=access, sequential=seq, direct=direct, & form=form, formatted=formatted, unformatted=unformatted, blank=blank) print *, 'exist = ', exists, ' :', pf (exists) print *, 'opened = ', opened, ' :', pf (opened) print *, 'number = ', unit_no, ' :', pf (unit == unit_no) print *, 'named = ', named, ' :', pf (named) print *, 'name = ', trim (name), ' :', pf (name == testfn) print *, 'access = ', trim (access), ' :', pf (access == 'SEQUENTIAL') print *, 'sequential = ', trim (seq), ' :', pf (seq == 'YES') print *, 'direct = ', trim (direct), ' :', pf (direct == 'NO') print *, 'form = ', trim (form), ' :', pf (form == 'FORMATTED') print *, 'formatted = ', trim (formatted), ' :', pf (formatted == 'YES') print *, 'unformatted =', trim (unformatted), ' :', pf (unformatted == 'NO') print *, 'blank = ', trim (blank), ' :', pf (blank == 'ZERO') close (unit, status='delete') ! Sequential unformatted by filename print *; print *, 'sequential formatted by filename' open (newunit=unit, file=testfn, form='unformatted', status='new') write (unit) 42 rewind (unit) call init_test () inquire (file=testfn, exist=exists, opened=opened, number=unit_no, & named=named, name=name, access=access, sequential=seq, direct=direct, & form=form, formatted=formatted, unformatted=unformatted, blank=blank) print *, 'exist = ', exists, ' :', pf (exists) print *, 'opened = ', opened, ' :', pf (opened) print *, 'number = ', unit_no, ' :', pf (unit == unit_no) print *, 'named = ', named, ' :', pf (named) print *, 'name = ', trim (name), ' :', pf (name == testfn) print *, 'access = ', trim (access), ' :', pf (access == 'SEQUENTIAL') print *, 'sequential = ', trim (seq), ' :', pf (seq == 'YES') print *, 'direct = ', trim (direct), ' :', pf (direct == 'NO') print *, 'form = ', trim (form), ' :', pf (form == 'UNFORMATTED') print *, 'formatted = ', trim (formatted), ' :', pf (formatted == 'NO') print *, 'unformatted =', trim (unformatted), ' :', pf (unformatted == 'YES') print *, 'blank = ', trim (blank), ' :', pf (blank == 'UNDEFINED') close (unit, status='keep') ! Sequential unformatted by unitno print *; print *, 'sequential formatted by unitno' open (newunit=unit, file=testfn, form='unformatted', status='old') write (unit) 42 rewind (unit) call init_test () inquire (unit=unit, exist=exists, opened=opened, number=unit_no, & named=named, name=name, access=access, sequential=seq, direct=direct, & form=form, formatted=formatted, unformatted=unformatted, blank=blank) print *, 'exist = ', exists, ' :', pf (exists) print *, 'opened = ', opened, ' :', pf (opened) print *, 'number = ', unit_no, ' :', pf (unit == unit_no) print *, 'named = ', named, ' :', pf (named) print *, 'name = ', trim (name), ' :', pf (name == testfn) print *, 'access = ', trim (access), ' :', pf (access == 'SEQUENTIAL') print *, 'sequential = ', trim (seq), ' :', pf (seq == 'YES') print *, 'direct = ', trim (direct), ' :', pf (direct == 'NO') print *, 'form = ', trim (form), ' :', pf (form == 'UNFORMATTED') print *, 'formatted = ', trim (formatted), ' :', pf (formatted == 'NO') print *, 'unformatted =', trim (unformatted), ' :', pf (unformatted == 'YES') print *, 'blank = ', trim (blank), ' :', pf (blank == 'UNDEFINED') close (unit, status='delete') ! Record length inquiry inquire (iolength=recl) 42, 42.0, 'xyzzy' print *; print *, 'record length =', recl ! Direct unformatted by filename print *; print *, 'direct formatted by filename' open (newunit=unit, file=testfn, access='direct', recl=recl, form='unformatted', status='new') do, i=1, 5 write (unit, rec=i) 42+i, 42.0+i, 'xyzzy' end do call init_test () inquire (file=testfn, exist=exists, opened=opened, number=unit_no, & named=named, name=name, access=access, sequential=seq, direct=direct, & form=form, formatted=formatted, unformatted=unformatted, & recl=recl, nextrec=nextrec) print *, 'exist = ', exists, ' :', pf (exists) print *, 'opened = ', opened, ' :', pf (opened) print *, 'number = ', unit_no, ' :', pf (unit == unit_no) print *, 'named = ', named, ' :', pf (named) print *, 'name = ', trim (name), ' :', pf (name == testfn) print *, 'access = ', trim (access), ' :', pf (access == 'DIRECT') print *, 'sequential = ', trim (seq), ' :', pf (seq == 'NO') print *, 'direct = ', trim (direct), ' :', pf (direct == 'YES') print *, 'form = ', trim (form), ' :', pf (form == 'UNFORMATTED') print *, 'formatted = ', trim (formatted), ' :', pf (formatted == 'NO') print *, 'unformatted =', trim (unformatted), ' :', pf (unformatted == 'YES') print *, 'recl = ', recl, ' :', pf (recl == 13) ! print *, 'nextrec = ', nextrec, ' :', pf (nextrec == 6) close (unit, status='keep') ! Direct unformatted by unitno print *; print *, 'direct formatted by unitno' open (newunit=unit, file=testfn, access='direct', recl=recl, form='unformatted', status='old') do, i=1, 5 write (unit, rec=i) 42+i, 42.0+i, 'xyzzy' end do call init_test () inquire (unit=unit, exist=exists, opened=opened, number=unit_no, & named=named, name=name, access=access, sequential=seq, direct=direct, & form=form, formatted=formatted, unformatted=unformatted, & recl=recl, nextrec=nextrec) print *, 'exist = ', exists, ' :', pf (exists) print *, 'opened = ', opened, ' :', pf (opened) print *, 'number = ', unit_no, ' :', pf (unit == unit_no) print *, 'named = ', named, ' :', pf (named) print *, 'name = ', trim (name), ' :', pf (name == testfn) print *, 'access = ', trim (access), ' :', pf (access == 'DIRECT') print *, 'sequential = ', trim (seq), ' :', pf (seq == 'NO') print *, 'direct = ', trim (direct), ' :', pf (direct == 'YES') print *, 'form = ', trim (form), ' :', pf (form == 'UNFORMATTED') print *, 'formatted = ', trim (formatted), ' :', pf (formatted == 'NO') print *, 'unformatted =', trim (unformatted), ' :', pf (unformatted == 'YES') print *, 'recl = ', recl, ' :', pf (recl == 13) ! print *, 'nextrec = ', nextrec, ' :', pf (nextrec == 6) close (unit, status='delete') contains subroutine init_test () exists = .false.; opened = .false.; unit_no = -99999 named = .false.; name = uninitc access = uninitc; seq = uninitc; direct = uninitc form = uninitc; formatted = uninitc; unformatted = uninitc blank = uninitc recl = -99999; nextrec = -99999 end subroutine function pf (l) logical, intent(in) :: l character(4) :: pf pf = merge ('pass', 'FAIL', l) if (.not. l) error stop end function end program lfortran-0.63.0/integration_tests/bindc_06.f900000664000175000017500000000157415174404631021300 0ustar alastairalastair! this tests module variables with bindC are ! correctly assigned in the C file module bindc_06_mod use iso_c_binding, only: c_ptr implicit none integer, bind(C, name="c_int4") :: f_int4 logical, bind(C, name="c_logical") :: f_logical type(c_ptr), bind(C, name="c_type_c_ptr") :: f_type_c_ptr integer(8), bind(C, name="c_int8") :: f_int8 end module program bindc_06 use bindc_06_mod use iso_c_binding, only: c_f_pointer, c_int implicit none integer(c_int), pointer :: ptr_f_type_c_ptr print *, "f_int4: ", f_int4 if (f_int4 /= 1) error stop print *, "f_int8: ", f_int8 if (f_int8 /= 2) error stop print *, "f_logical: ", f_logical if (f_logical .neqv. .false.) error stop call c_f_pointer(f_type_c_ptr, ptr_f_type_c_ptr) print *, "ptr_f_type_c_ptr: ", ptr_f_type_c_ptr if (ptr_f_type_c_ptr /= 12) error stop end program bindc_06 lfortran-0.63.0/integration_tests/procedure_47.f900000664000175000017500000000243015174404631022206 0ustar alastairalastairmodule bspline_sub_module_47 implicit none private abstract interface function b1fqad_func(x) result(f) implicit none real(4),intent(in) :: x real(4) :: f end function b1fqad_func end interface public :: b1fqad_func, dbsgq8 contains subroutine dbsgq8(fun, res) implicit none procedure(b1fqad_func) :: fun real(4), intent(out) :: res call g8(res) contains subroutine g8(res) real(4),intent(out) :: res real(4),dimension(8) :: v v(2) = 3.0 res = fun(v(2)) end subroutine g8 end subroutine dbsgq8 end module bspline_sub_module_47 program procedure_47 use bspline_sub_module_47 implicit none real(4) :: res call dbsgq8(square, res) if (abs(res - 9.0) > 1e-6) error stop call dbsgq8(cube, res) if (abs(res - 27.0) > 1e-6) error stop contains function square(x) result(f) implicit none real(4),intent(in) :: x real(4) :: f f = x * x end function square function cube(x) result(f) implicit none real(4),intent(in) :: x real(4) :: f f = x * x * x end function cube end program procedure_47lfortran-0.63.0/integration_tests/gpu_metal_126.f900000664000175000017500000000133615174404631022255 0ustar alastairalastair! Test: multiple do concurrent loops calling the same module function ! should not produce duplicate function definitions in the Metal shader. module gpu_metal_126_m implicit none contains pure integer function f(x) integer, intent(in) :: x f = x + 1 end function end module program gpu_metal_126 use gpu_metal_126_m implicit none integer :: a(4), b(4), i do concurrent (i = 1:4) a(i) = f(i) end do do concurrent (i = 1:4) b(i) = f(i) end do if (a(1) /= 2) error stop if (a(2) /= 3) error stop if (a(3) /= 4) error stop if (a(4) /= 5) error stop if (b(1) /= 2) error stop if (b(2) /= 3) error stop if (b(3) /= 4) error stop if (b(4) /= 5) error stop print *, "ok" end program lfortran-0.63.0/integration_tests/elemental_20.f900000664000175000017500000000160715174404631022160 0ustar alastairalastair! Test elemental defined assignment(=) with array arguments. ! The elemental subroutine must be called element-by-element. module elemental_20_mod implicit none type :: t integer :: val end type t interface assignment(=) module procedure :: assign_t_char end interface contains elemental subroutine assign_t_char(lhs, rhs) type(t), intent(inout) :: lhs character(len=*), intent(in) :: rhs lhs%val = len(rhs) end subroutine end module elemental_20_mod program elemental_20 use elemental_20_mod implicit none type(t) :: arr(3) arr = "hello" if (arr(1)%val /= 5) error stop if (arr(2)%val /= 5) error stop if (arr(3)%val /= 5) error stop arr = "ab" if (arr(1)%val /= 2) error stop if (arr(2)%val /= 2) error stop if (arr(3)%val /= 2) error stop print *, "PASS" end program elemental_20 lfortran-0.63.0/integration_tests/cond_01.f900000664000175000017500000000030215174404631021123 0ustar alastairalastairprogram cond_01 implicit none if (.false.) error stop if (1 == 2) error stop if (1 /= 1) error stop if (1 > 2) error stop if (1 >= 2) error stop if (2 < 1) error stop if (2 <= 1) error stop end lfortran-0.63.0/integration_tests/recursion_03.f900000664000175000017500000000173115174404631022222 0ustar alastairalastairmodule recursion_03 implicit none contains integer function solver_caller(f, iter) interface integer function f() end function end interface integer, intent(in) :: iter solver_caller = solver(f, iter) end function integer function solver(f, iter) interface integer function f() end function end interface !procedure(f_type) :: f integer, intent(in) :: iter integer f_val f_val = f() print *, "before:", f_val solver = sub1(2, iter-1) !solver = sub1(2, iter-1) + f() f_val = f() print *, "after:", f_val end function integer function sub1(y, iter) integer, intent(in):: y, iter integer x integer tmp x = y print *, "in sub1" if (iter == 1) then sub1 = 1 return end if tmp = getx() sub1 = solver_caller(getx, iter) contains integer function getx() print *, "x in getx", x getx = x end function end function end module recursion_03 program main use recursion_03 implicit none integer :: r r = sub1(3, 3) print *, "r =", r end program main lfortran-0.63.0/integration_tests/character_11.f900000664000175000017500000001043015174404631022140 0ustar alastairalastairmodule character_11_mod use iso_c_binding interface function f_string01_c(s) result(r) bind(c, name="f_string01_c") import c_char character(len=1, kind=c_char), intent(in) :: s character(len=1, kind=c_char) :: r end function function f_string02_c(s) result(r) bind(c, name="f_string02_c") import c_char character(len=1,kind=c_char), value, intent(in) :: s character(len=1, kind=c_char) :: r end function function f_string03_c(s, n) result(r) bind(c, name="f_string03_c") ! eqivalent to f_string01_c import :: c_int, c_char integer(c_int), intent(in) :: n character(len=1, kind=c_char),intent(in) :: s(n) character(len=1, kind=c_char) :: r end function function f_string04_c(s) result(r) bind(c, name="f_string04_c") ! eqivalent to f_string01_c import :: c_char character(len=1, kind=c_char),intent(in) :: s(*) character(len=1, kind=c_char) :: r end function function f_string05_c(s) result(r) bind(c, name="f_string05_c") ! eqivalent to f_string01_c (but argument is an ISO descriptor) import :: c_char character(len=1, kind=c_char),intent(in) :: s(:) character(len=1, kind=c_char) :: r end function end interface contains ! Expected Behavior : ! C Implementation printing the passed message (Whole message, Although the interface says len = 1. It's due to being passed by reference `char*`) + ! The return should be the first character of the passed string + ! Second char in passed argument should be modified subroutine f_string01_test() character(len=3) :: s character(len=2) :: r s = "Hi" // c_null_char r = f_string01_c(s) print "( '[', a, ']' )", r if(r /= "H ") error stop print "( '[', a, ']' )", s if(s(1:1) /= "H") error stop if(s(2:2) /= "X") error stop end subroutine ! Expected Behavior : ! C Implementation printing only first character (due to passing by value) + ! The return should be the first character of the passed string subroutine f_string02_test() character(len=3) :: s character(len=2) :: r s = "Hi" // c_null_char r = f_string02_c(s) print "( '[', a, ']' )", r if(r /= "H ") error stop print "( '[', a, ']' )", s end subroutine ! Expected Behavior : ! C Implementation printing the passed message + ! The return should be the first character of the passed string + ! Second char in passed argument should be modified By C's implementation subroutine f_string03_test() character(len=4) :: s character(len=2) :: r s = "Bye" // c_null_char r = f_string03_c(s, 100000) ! Array's size is irrelevant print "( '[', a, ']' )", r if(r /= "B ") error stop print "( '[', a, ']' )", s if(s(1:1) /= "B") error stop if(s(2:2) /= "X") error stop if(s(3:3) /= "e") error stop end subroutine ! Expected Behavior : ! C Implementation printing the passed message + ! The return should be the first character of the passed string + ! Second char in passed argument should be modified By C's implementation subroutine f_string04_test() character(len=4) :: s character(len=2) :: r s = "Bye" // c_null_char r = f_string04_c(s) print "( '[', a, ']' )", r if(r /= "B ") error stop print "( '[', a, ']' )", s if(s(1:1) /= "B") error stop if(s(2:2) /= "X") error stop if(s(3:3) /= "e") error stop end subroutine ! Expected Behavior : ! C Implementation printing the passed message + ! The return should be the first character of the passed string + ! Second char in passed argument should be modified By C's implementation subroutine f_string05_test() character(len=4) :: s(1) character(len=2) :: r s(1) = "Bye" // c_null_char r = f_string05_c(s) print "( '[', a, ']' )", r if(r /= "B ") error stop print "( '[', a, ']' )", s if(s(1)(1:1) /= "B") error stop if(s(1)(2:2) /= "X") error stop if(s(1)(3:3) /= "e") error stop end subroutine end module program character_11 use character_11_mod call f_string01_test() call f_string02_test() call f_string03_test() call f_string04_test() call f_string05_test() end programlfortran-0.63.0/integration_tests/modules_18c.h0000664000175000017500000000421315174404631021661 0ustar alastairalastair#ifndef MODULES_18C #define MODULES_18C #include #include #if _WIN32 typedef _Fcomplex float_complex_t; typedef _Dcomplex double_complex_t; #else typedef float _Complex float_complex_t; typedef double _Complex double_complex_t; #endif int f_int_float(int *a, float *b); int f_int_double(int *a, double *b); int f_int_float_complex(int *a, float_complex_t *b); int f_int_double_complex(int *a, double_complex_t *b); int f_int_float_complex_value(int a, float_complex_t b); int f_int_double_complex_value(int a, double_complex_t b); float_complex_t f_float_complex_value_return(float_complex_t b); double_complex_t f_double_complex_value_return(double_complex_t b); int f_int_float_value(int a, float b); int f_int_double_value(int a, double b); int f_int_intarray(int n, int *b); float f_int_floatarray(int n, float *b); double f_int_doublearray(int n, double *b); float f_int_floatarray_star(int n, float *b); void sub_int_float(int *a, float *b, int *r); void sub_int_double(int *a, double *b, int *r); void sub_int_float_complex(int *a, float_complex_t *b, int *r); void sub_int_double_complex(int *a, double_complex_t *b, int *r); void sub_int_float_value(int a, float b, int *r); void sub_int_double_value(int a, double b, int *r); void sub_int_float_complex_value(int a, float_complex_t b, int *r); void sub_int_double_complex_value(int a, double_complex_t b, int *r); void sub_int_intarray(int n, int *b, int *r); void sub_int_floatarray(int n, float *b, float *r); void sub_int_doublearray(int n, double *b, double *r); int f_string(char *s); int32_t call_fortran_i32(int32_t i); int32_t call_fortran_i32_value(int32_t i); int64_t call_fortran_i64(int64_t i); int64_t call_fortran_i64_value(int64_t i); float call_fortran_f32(float i); float call_fortran_f32_value(float i); double call_fortran_f64(double i); double call_fortran_f64_value(double i); int32_t fortran_i32(int32_t *i); int32_t fortran_i32_value(int32_t i); int64_t fortran_i64(int64_t *i); int64_t fortran_i64_value(int64_t i); float fortran_f32(float *i); float fortran_f32_value(float i); double fortran_f64(double *i); double fortran_f64_value(double i); #endif // MODULES_18C lfortran-0.63.0/integration_tests/submodule_38b.f900000664000175000017500000000071215174404631022360 0ustar alastairalastairmodule submodule_38_mod implicit none type :: base_t end type type, extends(base_t) :: child_t integer :: k_ contains generic :: operator(.x.) => multiply procedure, private :: multiply end type interface module function multiply(self, vec) result(r) class(child_t), intent(in) :: self double precision, intent(in) :: vec(:) double precision, allocatable :: r(:) end function end interface end module lfortran-0.63.0/integration_tests/derived_types_64.f900000664000175000017500000000172215174404631023066 0ustar alastairalastairmodule mod_derived_types_64 implicit none ! derived type with the same name as interface type :: toml_datetime character(len=:), allocatable :: date end type toml_datetime ! same name is derived type above interface toml_datetime module procedure :: toml_datetime_ctor end interface contains function toml_datetime_ctor(date_str, time_str) result(dt) character(len=*), intent(in) :: date_str, time_str type(toml_datetime) :: dt ! raise an error if this function is executed error stop print *, "This function isn't executed" dt%date = date_str end function toml_datetime_ctor end module program derived_types_64 use mod_derived_types_64 implicit none type(toml_datetime) :: ts1 character(len=10) :: tmp = "2025-06-11" ts1 = toml_datetime(tmp) print *, "Date: ", ts1%date if (ts1%date /= "2025-06-11") error stop end program derived_types_64 lfortran-0.63.0/integration_tests/subroutines_15.f900000664000175000017500000000075715174404631022605 0ustar alastairalastairmodule subroutines_15_module contains subroutine cb(a,x) implicit none integer, intent(in) :: a integer, intent(in), optional :: x(:) end subroutine cb end module subroutines_15_module program subroutines_15 use subroutines_15_module call temp(cb) contains subroutine temp(call_back) implicit none procedure(cb), optional :: call_back integer :: a call call_back(a) end subroutine temp end program subroutines_15 lfortran-0.63.0/integration_tests/do_concurrent_05.f900000664000175000017500000000120415174404631023052 0ustar alastairalastair! equivalent to openmp_08.f90 subroutine increment_ctr(n, ctr) use omp_lib implicit none integer, intent(in) :: n real, intent(out) :: ctr real :: local_ctr integer :: i local_ctr = 1 do concurrent (i=1:n) reduce(*:local_ctr) local_ctr = local_ctr * 1.5 end do ctr = ctr + local_ctr end subroutine program do_concurrent_05 use omp_lib integer, parameter :: n = 10 real :: ctr real :: res = 1.5**10 call omp_set_num_threads(8) ctr = 0 call increment_ctr(n, ctr) print *, ctr if(abs((ctr - res)) > 0.0002 ) error stop end program lfortran-0.63.0/integration_tests/modules_06.f900000664000175000017500000000033615174404631021664 0ustar alastairalastairmodule modules_06_a implicit none contains integer function b() result(r) print *, "b()" r = 5 end function end module program modules_06 use modules_06_a, only: b implicit none integer :: i i = b() print *, i end lfortran-0.63.0/integration_tests/modules_24.f900000664000175000017500000000177015174404631021667 0ustar alastairalastairmodule tomlf_de_tokenizer_24 implicit none type :: toml_table logical :: inline = .false. end type toml_table type, abstract :: toml_tokenizer type(toml_table), pointer :: current => null() end type toml_tokenizer type, extends(toml_tokenizer) :: toml_tokenizer_ end type toml_tokenizer_ contains subroutine parse_select(de) class(toml_tokenizer), intent(inout), target :: de type(toml_table), pointer :: table nullify(table) de%current => table end subroutine parse_select end module tomlf_de_tokenizer_24 program modules_24 use tomlf_de_tokenizer_24 implicit none type(toml_tokenizer_), target :: tokenizer class(toml_tokenizer), pointer :: tokenizer_ptr tokenizer_ptr => tokenizer call parse_select(tokenizer) ! TODO: Uncomment and fix the ASR verify pass ! error. Struct() is pointing to tomlf_de_tokenizer's ! toml_table but it should instead point to the imported ! toml_table ! print *, tokenizer%current end program lfortran-0.63.0/integration_tests/functions_51.f900000664000175000017500000000100215174404631022213 0ustar alastairalastairmodule functions_51_mod implicit none contains integer pure function multiply_2(inp) result(r) integer, intent(in) :: inp r = inp * 2 end function multiply_2 end module functions_51_mod program functions_51 use functions_51_mod implicit none integer :: n(5) character(:), allocatable :: x n(3) = 5 x = sayHi() if (x /= "Hello") error stop print *, x contains character(multiply_2(5)) function sayHi() result(res) res = "Hello" end function sayHi end program functions_51 lfortran-0.63.0/integration_tests/arrays_op_25.f900000664000175000017500000000013615174404631022212 0ustar alastairalastairprogram arrays_op_25 real :: b(3, 5) call random_number(b) print *, b end program lfortran-0.63.0/integration_tests/intrinsics_220.f900000664000175000017500000000304615174404631022460 0ustar alastairalastairprogram intrinsics_220 integer :: a, b, i integer(8) :: c, d, e integer(4) :: expected_1(3) integer(8) :: expected_2(3) integer :: iterator integer(4), parameter :: result_1(3) = merge_bits([-10, 10, -10], [-15, 15, 15], [-2, 2, -2]) integer(8), parameter :: result_2(3) = merge_bits([1005627, -1005627827, 92748272], & [1027293, 1026271812, -82927282], [10098, -1628291, -10098]) expected_1 = [-9, 15, -9] expected_2 = [1018047_8, -1005613491_8, 92748224_8] do iterator = 1, size(result_1) print *, result_1(iterator) if (result_1(iterator) /= expected_1(iterator)) error stop end do do iterator = 1, size(result_2) print *, result_2(iterator) if (result_2(iterator) /= expected_2(iterator)) error stop end do a = -10 b = -15 i = -2 c = 1005627 d = 1027293 e = 10098 print *, merge_bits(a, b, i) if(merge_bits(a, b, i) /= -9) error stop print *, merge_bits(c, d, e) if(merge_bits(c, d, e) /= 1018047) error stop a = 10 b = 15 i = 2 c = -1005627827 d = 1026271812 e = -1628291 print *, merge_bits(a, b, i) if(merge_bits(a, b, i) /= 15) error stop print *, merge_bits(c, d, e) if(merge_bits(c, d, e) /= -1005613491) error stop a = -10 b = 15 i = -2 c = 92748272 d = -82927282 e = -10098 print *, merge_bits(a, b, i) if(merge_bits(a, b, i) /= -9) error stop print *, merge_bits(c, d, e) if(merge_bits(c, d, e) /= 92748224) error stop end programlfortran-0.63.0/integration_tests/class_10.f900000664000175000017500000000302615174404631021313 0ustar alastairalastairmodule class_10_module implicit none private public :: toml_vector, toml_value, toml_node type, abstract :: toml_value character(len=:), allocatable :: key contains procedure :: match_key end type toml_value type :: toml_node !> TOML value payload class(toml_value), allocatable :: val end type toml_node !> Stores TOML values in a list of pointers type :: toml_vector !> Current number of stored TOML values integer :: n = 0 !> List of TOML values type(toml_node), allocatable :: lst(:) contains procedure :: delete end type toml_vector contains !> Compare raw key of TOML value to input key pure function match_key(self, key) result(match) !> TOML value instance. class(toml_value), intent(in) :: self !> TOML raw key to compare to character(len=*), intent(in) :: key logical :: match end function match_key !> Delete TOML value at a given key subroutine delete(self, key) !> Instance of the structure class(toml_vector), intent(inout), target :: self !> Key to the TOML value character(len=*), intent(in) :: key integer :: i if (self%lst(i)%val%match_key(key)) then ! TODO ! Improve this test to print or test something end if end subroutine delete end module class_10_module program class_10_program use class_10_module implicit none print *, "ok" end program class_10_program lfortran-0.63.0/CODE_OF_CONDUCT.md0000664000175000017500000000627515174404631016431 0ustar alastairalastair# Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing or otherwise unacceptable behavior may be reported by contacting one of the project maintainers at ondrej@certik.us or milancurcic@hey.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version] [homepage]: https://contributor-covenant.org [version]: https://contributor-covenant.org/version/1/4/ lfortran-0.63.0/src/0000775000175000017500000000000015174404631014407 5ustar alastairalastairlfortran-0.63.0/src/tests/0000775000175000017500000000000015174404631015551 5ustar alastairalastairlfortran-0.63.0/src/tests/doctest.h0000664000175000017500000113350715174404631017401 0ustar alastairalastair// ====================================================================== lgtm [cpp/missing-header-guard] // == DO NOT MODIFY THIS FILE BY HAND - IT IS AUTO GENERATED BY CMAKE! == // ====================================================================== // // doctest.h - the lightest feature-rich C++ single-header testing framework for unit tests and TDD // // Copyright (c) 2016-2021 Viktor Kirilov // // Distributed under the MIT Software License // See accompanying file LICENSE.txt or copy at // https://opensource.org/licenses/MIT // // The documentation can be found at the library's page: // https://github.com/doctest/doctest/blob/master/doc/markdown/readme.md // // ================================================================================================= // ================================================================================================= // ================================================================================================= // // The library is heavily influenced by Catch - https://github.com/catchorg/Catch2 // which uses the Boost Software License - Version 1.0 // see here - https://github.com/catchorg/Catch2/blob/master/LICENSE.txt // // The concept of subcases (sections in Catch) and expression decomposition are from there. // Some parts of the code are taken directly: // - stringification - the detection of "ostream& operator<<(ostream&, const T&)" and StringMaker<> // - the Approx() helper class for floating point comparison // - colors in the console // - breaking into a debugger // - signal / SEH handling // - timer // - XmlWriter class - thanks to Phil Nash for allowing the direct reuse (AKA copy/paste) // // The expression decomposing templates are taken from lest - https://github.com/martinmoene/lest // which uses the Boost Software License - Version 1.0 // see here - https://github.com/martinmoene/lest/blob/master/LICENSE.txt // // ================================================================================================= // ================================================================================================= // ================================================================================================= #ifndef DOCTEST_LIBRARY_INCLUDED #define DOCTEST_LIBRARY_INCLUDED // ================================================================================================= // == VERSION ====================================================================================== // ================================================================================================= #define DOCTEST_VERSION_MAJOR 2 #define DOCTEST_VERSION_MINOR 4 #define DOCTEST_VERSION_PATCH 8 // util we need here #define DOCTEST_TOSTR_IMPL(x) #x #define DOCTEST_TOSTR(x) DOCTEST_TOSTR_IMPL(x) #define DOCTEST_VERSION_STR \ DOCTEST_TOSTR(DOCTEST_VERSION_MAJOR) "." \ DOCTEST_TOSTR(DOCTEST_VERSION_MINOR) "." \ DOCTEST_TOSTR(DOCTEST_VERSION_PATCH) #define DOCTEST_VERSION \ (DOCTEST_VERSION_MAJOR * 10000 + DOCTEST_VERSION_MINOR * 100 + DOCTEST_VERSION_PATCH) // ================================================================================================= // == COMPILER VERSION ============================================================================= // ================================================================================================= // ideas for the version stuff are taken from here: https://github.com/cxxstuff/cxx_detect #define DOCTEST_COMPILER(MAJOR, MINOR, PATCH) ((MAJOR)*10000000 + (MINOR)*100000 + (PATCH)) // GCC/Clang and GCC/MSVC are mutually exclusive, but Clang/MSVC are not because of clang-cl... #if defined(_MSC_VER) && defined(_MSC_FULL_VER) #if _MSC_VER == _MSC_FULL_VER / 10000 #define DOCTEST_MSVC DOCTEST_COMPILER(_MSC_VER / 100, _MSC_VER % 100, _MSC_FULL_VER % 10000) #else // MSVC #define DOCTEST_MSVC \ DOCTEST_COMPILER(_MSC_VER / 100, (_MSC_FULL_VER / 100000) % 100, _MSC_FULL_VER % 100000) #endif // MSVC #endif // MSVC #if defined(__clang__) && defined(__clang_minor__) #define DOCTEST_CLANG DOCTEST_COMPILER(__clang_major__, __clang_minor__, __clang_patchlevel__) #elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) && \ !defined(__INTEL_COMPILER) #define DOCTEST_GCC DOCTEST_COMPILER(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) #endif // GCC #ifndef DOCTEST_MSVC #define DOCTEST_MSVC 0 #endif // DOCTEST_MSVC #ifndef DOCTEST_CLANG #define DOCTEST_CLANG 0 #endif // DOCTEST_CLANG #ifndef DOCTEST_GCC #define DOCTEST_GCC 0 #endif // DOCTEST_GCC // ================================================================================================= // == COMPILER WARNINGS HELPERS ==================================================================== // ================================================================================================= #if DOCTEST_CLANG #define DOCTEST_PRAGMA_TO_STR(x) _Pragma(#x) #define DOCTEST_CLANG_SUPPRESS_WARNING_PUSH _Pragma("clang diagnostic push") #define DOCTEST_CLANG_SUPPRESS_WARNING(w) DOCTEST_PRAGMA_TO_STR(clang diagnostic ignored w) #define DOCTEST_CLANG_SUPPRESS_WARNING_POP _Pragma("clang diagnostic pop") #define DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH(w) \ DOCTEST_CLANG_SUPPRESS_WARNING_PUSH DOCTEST_CLANG_SUPPRESS_WARNING(w) #else // DOCTEST_CLANG #define DOCTEST_CLANG_SUPPRESS_WARNING_PUSH #define DOCTEST_CLANG_SUPPRESS_WARNING(w) #define DOCTEST_CLANG_SUPPRESS_WARNING_POP #define DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH(w) #endif // DOCTEST_CLANG #if DOCTEST_GCC #define DOCTEST_PRAGMA_TO_STR(x) _Pragma(#x) #define DOCTEST_GCC_SUPPRESS_WARNING_PUSH _Pragma("GCC diagnostic push") #define DOCTEST_GCC_SUPPRESS_WARNING(w) DOCTEST_PRAGMA_TO_STR(GCC diagnostic ignored w) #define DOCTEST_GCC_SUPPRESS_WARNING_POP _Pragma("GCC diagnostic pop") #define DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH(w) \ DOCTEST_GCC_SUPPRESS_WARNING_PUSH DOCTEST_GCC_SUPPRESS_WARNING(w) #else // DOCTEST_GCC #define DOCTEST_GCC_SUPPRESS_WARNING_PUSH #define DOCTEST_GCC_SUPPRESS_WARNING(w) #define DOCTEST_GCC_SUPPRESS_WARNING_POP #define DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH(w) #endif // DOCTEST_GCC #if DOCTEST_MSVC #define DOCTEST_MSVC_SUPPRESS_WARNING_PUSH __pragma(warning(push)) #define DOCTEST_MSVC_SUPPRESS_WARNING(w) __pragma(warning(disable : w)) #define DOCTEST_MSVC_SUPPRESS_WARNING_POP __pragma(warning(pop)) #define DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(w) \ DOCTEST_MSVC_SUPPRESS_WARNING_PUSH DOCTEST_MSVC_SUPPRESS_WARNING(w) #else // DOCTEST_MSVC #define DOCTEST_MSVC_SUPPRESS_WARNING_PUSH #define DOCTEST_MSVC_SUPPRESS_WARNING(w) #define DOCTEST_MSVC_SUPPRESS_WARNING_POP #define DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(w) #endif // DOCTEST_MSVC // ================================================================================================= // == COMPILER WARNINGS ============================================================================ // ================================================================================================= // both the header and the implementation suppress all of these, // so it only makes sense to aggregrate them like so #define DOCTEST_SUPPRESS_COMMON_WARNINGS_PUSH \ DOCTEST_CLANG_SUPPRESS_WARNING_PUSH \ DOCTEST_CLANG_SUPPRESS_WARNING("-Wunknown-pragmas") \ DOCTEST_CLANG_SUPPRESS_WARNING("-Wweak-vtables") \ DOCTEST_CLANG_SUPPRESS_WARNING("-Wpadded") \ DOCTEST_CLANG_SUPPRESS_WARNING("-Wmissing-prototypes") \ DOCTEST_CLANG_SUPPRESS_WARNING("-Wunused-local-typedef") \ DOCTEST_CLANG_SUPPRESS_WARNING("-Wc++98-compat") \ DOCTEST_CLANG_SUPPRESS_WARNING("-Wc++98-compat-pedantic") \ \ DOCTEST_GCC_SUPPRESS_WARNING_PUSH \ DOCTEST_GCC_SUPPRESS_WARNING("-Wunknown-pragmas") \ DOCTEST_GCC_SUPPRESS_WARNING("-Wpragmas") \ DOCTEST_GCC_SUPPRESS_WARNING("-Weffc++") \ DOCTEST_GCC_SUPPRESS_WARNING("-Wstrict-overflow") \ DOCTEST_GCC_SUPPRESS_WARNING("-Wstrict-aliasing") \ DOCTEST_GCC_SUPPRESS_WARNING("-Wmissing-declarations") \ DOCTEST_GCC_SUPPRESS_WARNING("-Wunused-local-typedefs") \ DOCTEST_GCC_SUPPRESS_WARNING("-Wuseless-cast") \ DOCTEST_GCC_SUPPRESS_WARNING("-Wnoexcept") \ \ DOCTEST_MSVC_SUPPRESS_WARNING_PUSH \ /* these 4 also disabled globally via cmake: */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4514) /* unreferenced inline function has been removed */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4571) /* SEH related */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4710) /* function not inlined */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4711) /* function selected for inline expansion*/ \ /* */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4616) /* invalid compiler warning */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4619) /* invalid compiler warning */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4996) /* The compiler encountered a deprecated declaration */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4706) /* assignment within conditional expression */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4512) /* 'class' : assignment operator could not be generated */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4127) /* conditional expression is constant */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4820) /* padding */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4625) /* copy constructor was implicitly deleted */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4626) /* assignment operator was implicitly deleted */ \ DOCTEST_MSVC_SUPPRESS_WARNING(5027) /* move assignment operator implicitly deleted */ \ DOCTEST_MSVC_SUPPRESS_WARNING(5026) /* move constructor was implicitly deleted */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4640) /* construction of local static object not thread-safe */ \ DOCTEST_MSVC_SUPPRESS_WARNING(5045) /* Spectre mitigation for memory load */ \ /* static analysis */ \ DOCTEST_MSVC_SUPPRESS_WARNING(26439) /* Function may not throw. Declare it 'noexcept' */ \ DOCTEST_MSVC_SUPPRESS_WARNING(26495) /* Always initialize a member variable */ \ DOCTEST_MSVC_SUPPRESS_WARNING(26451) /* Arithmetic overflow ... */ \ DOCTEST_MSVC_SUPPRESS_WARNING(26444) /* Avoid unnamed objects with custom ctor and dtor... */ \ DOCTEST_MSVC_SUPPRESS_WARNING(26812) /* Prefer 'enum class' over 'enum' */ #define DOCTEST_SUPPRESS_COMMON_WARNINGS_POP \ DOCTEST_CLANG_SUPPRESS_WARNING_POP \ DOCTEST_GCC_SUPPRESS_WARNING_POP \ DOCTEST_MSVC_SUPPRESS_WARNING_POP DOCTEST_SUPPRESS_COMMON_WARNINGS_PUSH DOCTEST_CLANG_SUPPRESS_WARNING_PUSH DOCTEST_CLANG_SUPPRESS_WARNING("-Wnon-virtual-dtor") DOCTEST_CLANG_SUPPRESS_WARNING("-Wdeprecated") DOCTEST_GCC_SUPPRESS_WARNING_PUSH DOCTEST_GCC_SUPPRESS_WARNING("-Wctor-dtor-privacy") DOCTEST_GCC_SUPPRESS_WARNING("-Wnon-virtual-dtor") DOCTEST_GCC_SUPPRESS_WARNING("-Wsign-promo") DOCTEST_MSVC_SUPPRESS_WARNING_PUSH DOCTEST_MSVC_SUPPRESS_WARNING(4623) // default constructor was implicitly defined as deleted #define DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN \ DOCTEST_MSVC_SUPPRESS_WARNING_PUSH \ DOCTEST_MSVC_SUPPRESS_WARNING(4548) /* before comma no effect; expected side - effect */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4265) /* virtual functions, but destructor is not virtual */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4986) /* exception specification does not match previous */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4350) /* 'member1' called instead of 'member2' */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4668) /* not defined as a preprocessor macro */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4365) /* signed/unsigned mismatch */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4774) /* format string not a string literal */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4820) /* padding */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4625) /* copy constructor was implicitly deleted */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4626) /* assignment operator was implicitly deleted */ \ DOCTEST_MSVC_SUPPRESS_WARNING(5027) /* move assignment operator implicitly deleted */ \ DOCTEST_MSVC_SUPPRESS_WARNING(5026) /* move constructor was implicitly deleted */ \ DOCTEST_MSVC_SUPPRESS_WARNING(4623) /* default constructor was implicitly deleted */ \ DOCTEST_MSVC_SUPPRESS_WARNING(5039) /* pointer to pot. throwing function passed to extern C */ \ DOCTEST_MSVC_SUPPRESS_WARNING(5045) /* Spectre mitigation for memory load */ \ DOCTEST_MSVC_SUPPRESS_WARNING(5105) /* macro producing 'defined' has undefined behavior */ #define DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END DOCTEST_MSVC_SUPPRESS_WARNING_POP // ================================================================================================= // == FEATURE DETECTION ============================================================================ // ================================================================================================= // general compiler feature support table: https://en.cppreference.com/w/cpp/compiler_support // MSVC C++11 feature support table: https://msdn.microsoft.com/en-us/library/hh567368.aspx // GCC C++11 feature support table: https://gcc.gnu.org/projects/cxx-status.html // MSVC version table: // https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering // MSVC++ 14.3 (17) _MSC_VER == 1930 (Visual Studio 2022) // MSVC++ 14.2 (16) _MSC_VER == 1920 (Visual Studio 2019) // MSVC++ 14.1 (15) _MSC_VER == 1910 (Visual Studio 2017) // MSVC++ 14.0 _MSC_VER == 1900 (Visual Studio 2015) // MSVC++ 12.0 _MSC_VER == 1800 (Visual Studio 2013) // MSVC++ 11.0 _MSC_VER == 1700 (Visual Studio 2012) // MSVC++ 10.0 _MSC_VER == 1600 (Visual Studio 2010) // MSVC++ 9.0 _MSC_VER == 1500 (Visual Studio 2008) // MSVC++ 8.0 _MSC_VER == 1400 (Visual Studio 2005) // Universal Windows Platform support #if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) #define DOCTEST_CONFIG_NO_WINDOWS_SEH #endif // WINAPI_FAMILY #if DOCTEST_MSVC && !defined(DOCTEST_CONFIG_WINDOWS_SEH) #define DOCTEST_CONFIG_WINDOWS_SEH #endif // MSVC #if defined(DOCTEST_CONFIG_NO_WINDOWS_SEH) && defined(DOCTEST_CONFIG_WINDOWS_SEH) #undef DOCTEST_CONFIG_WINDOWS_SEH #endif // DOCTEST_CONFIG_NO_WINDOWS_SEH #if !defined(_WIN32) && !defined(__QNX__) && !defined(DOCTEST_CONFIG_POSIX_SIGNALS) && \ !defined(__EMSCRIPTEN__) #define DOCTEST_CONFIG_POSIX_SIGNALS #endif // _WIN32 #if defined(DOCTEST_CONFIG_NO_POSIX_SIGNALS) && defined(DOCTEST_CONFIG_POSIX_SIGNALS) #undef DOCTEST_CONFIG_POSIX_SIGNALS #endif // DOCTEST_CONFIG_NO_POSIX_SIGNALS #ifndef DOCTEST_CONFIG_NO_EXCEPTIONS #if !defined(__cpp_exceptions) && !defined(__EXCEPTIONS) && !defined(_CPPUNWIND) #define DOCTEST_CONFIG_NO_EXCEPTIONS #endif // no exceptions #endif // DOCTEST_CONFIG_NO_EXCEPTIONS #ifdef DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS #ifndef DOCTEST_CONFIG_NO_EXCEPTIONS #define DOCTEST_CONFIG_NO_EXCEPTIONS #endif // DOCTEST_CONFIG_NO_EXCEPTIONS #endif // DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS #if defined(DOCTEST_CONFIG_NO_EXCEPTIONS) && !defined(DOCTEST_CONFIG_NO_TRY_CATCH_IN_ASSERTS) #define DOCTEST_CONFIG_NO_TRY_CATCH_IN_ASSERTS #endif // DOCTEST_CONFIG_NO_EXCEPTIONS && !DOCTEST_CONFIG_NO_TRY_CATCH_IN_ASSERTS #if defined(DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN) && !defined(DOCTEST_CONFIG_IMPLEMENT) #define DOCTEST_CONFIG_IMPLEMENT #endif // DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #if defined(_WIN32) || defined(__CYGWIN__) #if DOCTEST_MSVC #define DOCTEST_SYMBOL_EXPORT __declspec(dllexport) #define DOCTEST_SYMBOL_IMPORT __declspec(dllimport) #else // MSVC #define DOCTEST_SYMBOL_EXPORT __attribute__((dllexport)) #define DOCTEST_SYMBOL_IMPORT __attribute__((dllimport)) #endif // MSVC #else // _WIN32 #define DOCTEST_SYMBOL_EXPORT __attribute__((visibility("default"))) #define DOCTEST_SYMBOL_IMPORT #endif // _WIN32 #ifdef DOCTEST_CONFIG_IMPLEMENTATION_IN_DLL #ifdef DOCTEST_CONFIG_IMPLEMENT #define DOCTEST_INTERFACE DOCTEST_SYMBOL_EXPORT #else // DOCTEST_CONFIG_IMPLEMENT #define DOCTEST_INTERFACE DOCTEST_SYMBOL_IMPORT #endif // DOCTEST_CONFIG_IMPLEMENT #else // DOCTEST_CONFIG_IMPLEMENTATION_IN_DLL #define DOCTEST_INTERFACE #endif // DOCTEST_CONFIG_IMPLEMENTATION_IN_DLL #define DOCTEST_EMPTY #if DOCTEST_MSVC #define DOCTEST_NOINLINE __declspec(noinline) #define DOCTEST_UNUSED #define DOCTEST_ALIGNMENT(x) #elif DOCTEST_CLANG && DOCTEST_CLANG < DOCTEST_COMPILER(3, 5, 0) #define DOCTEST_NOINLINE #define DOCTEST_UNUSED #define DOCTEST_ALIGNMENT(x) #else #define DOCTEST_NOINLINE __attribute__((noinline)) #define DOCTEST_UNUSED __attribute__((unused)) #define DOCTEST_ALIGNMENT(x) __attribute__((aligned(x))) #endif #ifndef DOCTEST_NORETURN #if DOCTEST_MSVC && (DOCTEST_MSVC < DOCTEST_COMPILER(19, 0, 0)) #define DOCTEST_NORETURN #else // DOCTEST_MSVC #define DOCTEST_NORETURN [[noreturn]] #endif // DOCTEST_MSVC #endif // DOCTEST_NORETURN #ifndef DOCTEST_NOEXCEPT #if DOCTEST_MSVC && (DOCTEST_MSVC < DOCTEST_COMPILER(19, 0, 0)) #define DOCTEST_NOEXCEPT #else // DOCTEST_MSVC #define DOCTEST_NOEXCEPT noexcept #endif // DOCTEST_MSVC #endif // DOCTEST_NOEXCEPT #ifndef DOCTEST_CONSTEXPR #if DOCTEST_MSVC && (DOCTEST_MSVC < DOCTEST_COMPILER(19, 0, 0)) #define DOCTEST_CONSTEXPR const #else // DOCTEST_MSVC #define DOCTEST_CONSTEXPR constexpr #endif // DOCTEST_MSVC #endif // DOCTEST_CONSTEXPR // ================================================================================================= // == FEATURE DETECTION END ======================================================================== // ================================================================================================= // internal macros for string concatenation and anonymous variable name generation #define DOCTEST_CAT_IMPL(s1, s2) s1##s2 #define DOCTEST_CAT(s1, s2) DOCTEST_CAT_IMPL(s1, s2) #ifdef __COUNTER__ // not standard and may be missing for some compilers #define DOCTEST_ANONYMOUS(x) DOCTEST_CAT(x, __COUNTER__) #else // __COUNTER__ #define DOCTEST_ANONYMOUS(x) DOCTEST_CAT(x, __LINE__) #endif // __COUNTER__ #ifndef DOCTEST_CONFIG_ASSERTION_PARAMETERS_BY_VALUE #define DOCTEST_REF_WRAP(x) x& #else // DOCTEST_CONFIG_ASSERTION_PARAMETERS_BY_VALUE #define DOCTEST_REF_WRAP(x) x #endif // DOCTEST_CONFIG_ASSERTION_PARAMETERS_BY_VALUE // not using __APPLE__ because... this is how Catch does it #ifdef __MAC_OS_X_VERSION_MIN_REQUIRED #define DOCTEST_PLATFORM_MAC #elif defined(__IPHONE_OS_VERSION_MIN_REQUIRED) #define DOCTEST_PLATFORM_IPHONE #elif defined(_WIN32) #define DOCTEST_PLATFORM_WINDOWS #else // DOCTEST_PLATFORM #define DOCTEST_PLATFORM_LINUX #endif // DOCTEST_PLATFORM namespace doctest { namespace detail { static DOCTEST_CONSTEXPR int consume(const int*, int) { return 0; } }} #define DOCTEST_GLOBAL_NO_WARNINGS(var, ...) \ DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wglobal-constructors") \ static const int var = doctest::detail::consume(&var, __VA_ARGS__); \ DOCTEST_CLANG_SUPPRESS_WARNING_POP #ifndef DOCTEST_BREAK_INTO_DEBUGGER // should probably take a look at https://github.com/scottt/debugbreak #ifdef DOCTEST_PLATFORM_LINUX #if defined(__GNUC__) && (defined(__i386) || defined(__x86_64)) // Break at the location of the failing check if possible #define DOCTEST_BREAK_INTO_DEBUGGER() __asm__("int $3\n" : :) // NOLINT (hicpp-no-assembler) #else #include #define DOCTEST_BREAK_INTO_DEBUGGER() raise(SIGTRAP) #endif #elif defined(DOCTEST_PLATFORM_MAC) #if defined(__x86_64) || defined(__x86_64__) || defined(__amd64__) || defined(__i386) #define DOCTEST_BREAK_INTO_DEBUGGER() __asm__("int $3\n" : :) // NOLINT (hicpp-no-assembler) #else #define DOCTEST_BREAK_INTO_DEBUGGER() __asm__("brk #0"); // NOLINT (hicpp-no-assembler) #endif #elif DOCTEST_MSVC #define DOCTEST_BREAK_INTO_DEBUGGER() __debugbreak() #elif defined(__MINGW32__) DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH("-Wredundant-decls") extern "C" __declspec(dllimport) void __stdcall DebugBreak(); DOCTEST_GCC_SUPPRESS_WARNING_POP #define DOCTEST_BREAK_INTO_DEBUGGER() ::DebugBreak() #else // linux #define DOCTEST_BREAK_INTO_DEBUGGER() (static_cast(0)) #endif // linux #endif // DOCTEST_BREAK_INTO_DEBUGGER // this is kept here for backwards compatibility since the config option was changed #ifdef DOCTEST_CONFIG_USE_IOSFWD #define DOCTEST_CONFIG_USE_STD_HEADERS #endif // DOCTEST_CONFIG_USE_IOSFWD // for clang - always include ciso646 (which drags some std stuff) because // we want to check if we are using libc++ with the _LIBCPP_VERSION macro in // which case we don't want to forward declare stuff from std - for reference: // https://github.com/doctest/doctest/issues/126 // https://github.com/doctest/doctest/issues/356 #if DOCTEST_CLANG #include #ifdef _LIBCPP_VERSION #define DOCTEST_CONFIG_USE_STD_HEADERS #endif // _LIBCPP_VERSION #endif // clang #ifdef DOCTEST_CONFIG_USE_STD_HEADERS #ifndef DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS #define DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS #endif // DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS #include #include #include #else // DOCTEST_CONFIG_USE_STD_HEADERS // Forward declaring 'X' in namespace std is not permitted by the C++ Standard. DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(4643) namespace std { // NOLINT (cert-dcl58-cpp) typedef decltype(nullptr) nullptr_t; template struct char_traits; template <> struct char_traits; template class basic_ostream; typedef basic_ostream> ostream; template class basic_istream; typedef basic_istream> istream; template class tuple; #if DOCTEST_MSVC >= DOCTEST_COMPILER(19, 20, 0) // see this issue on why this is needed: https://github.com/doctest/doctest/issues/183 template class allocator; template class basic_string; using string = basic_string, allocator>; #endif // VS 2019 } // namespace std DOCTEST_MSVC_SUPPRESS_WARNING_POP #endif // DOCTEST_CONFIG_USE_STD_HEADERS #ifdef DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS #include #endif // DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS namespace doctest { DOCTEST_INTERFACE extern bool is_running_in_test; // A 24 byte string class (can be as small as 17 for x64 and 13 for x86) that can hold strings with length // of up to 23 chars on the stack before going on the heap - the last byte of the buffer is used for: // - "is small" bit - the highest bit - if "0" then it is small - otherwise its "1" (128) // - if small - capacity left before going on the heap - using the lowest 5 bits // - if small - 2 bits are left unused - the second and third highest ones // - if small - acts as a null terminator if strlen() is 23 (24 including the null terminator) // and the "is small" bit remains "0" ("as well as the capacity left") so its OK // Idea taken from this lecture about the string implementation of facebook/folly - fbstring // https://www.youtube.com/watch?v=kPR8h4-qZdk // TODO: // - optimizations - like not deleting memory unnecessarily in operator= and etc. // - resize/reserve/clear // - substr // - replace // - back/front // - iterator stuff // - find & friends // - push_back/pop_back // - assign/insert/erase // - relational operators as free functions - taking const char* as one of the params class DOCTEST_INTERFACE String { static const unsigned len = 24; //!OCLINT avoid private static members static const unsigned last = len - 1; //!OCLINT avoid private static members struct view // len should be more than sizeof(view) - because of the final byte for flags { char* ptr; unsigned size; unsigned capacity; }; union { char buf[len]; view data; }; char* allocate(unsigned sz); bool isOnStack() const { return (buf[last] & 128) == 0; } void setOnHeap(); void setLast(unsigned in = last); void copy(const String& other); public: String(); ~String(); // cppcheck-suppress noExplicitConstructor String(const char* in); String(const char* in, unsigned in_size); String(std::istream& in, unsigned in_size); String(const String& other); String& operator=(const String& other); String& operator+=(const String& other); String(String&& other); String& operator=(String&& other); char operator[](unsigned i) const; char& operator[](unsigned i); // the only functions I'm willing to leave in the interface - available for inlining const char* c_str() const { return const_cast(this)->c_str(); } // NOLINT char* c_str() { if(isOnStack()) return reinterpret_cast(buf); return data.ptr; } unsigned size() const; unsigned capacity() const; int compare(const char* other, bool no_case = false) const; int compare(const String& other, bool no_case = false) const; }; DOCTEST_INTERFACE String operator+(const String& lhs, const String& rhs); DOCTEST_INTERFACE bool operator==(const String& lhs, const String& rhs); DOCTEST_INTERFACE bool operator!=(const String& lhs, const String& rhs); DOCTEST_INTERFACE bool operator<(const String& lhs, const String& rhs); DOCTEST_INTERFACE bool operator>(const String& lhs, const String& rhs); DOCTEST_INTERFACE bool operator<=(const String& lhs, const String& rhs); DOCTEST_INTERFACE bool operator>=(const String& lhs, const String& rhs); DOCTEST_INTERFACE std::ostream& operator<<(std::ostream& s, const String& in); namespace Color { enum Enum { None = 0, White, Red, Green, Blue, Cyan, Yellow, Grey, Bright = 0x10, BrightRed = Bright | Red, BrightGreen = Bright | Green, LightGrey = Bright | Grey, BrightWhite = Bright | White }; DOCTEST_INTERFACE std::ostream& operator<<(std::ostream& s, Color::Enum code); } // namespace Color namespace assertType { enum Enum { // macro traits is_warn = 1, is_check = 2 * is_warn, is_require = 2 * is_check, is_normal = 2 * is_require, is_throws = 2 * is_normal, is_throws_as = 2 * is_throws, is_throws_with = 2 * is_throws_as, is_nothrow = 2 * is_throws_with, is_false = 2 * is_nothrow, is_unary = 2 * is_false, // not checked anywhere - used just to distinguish the types is_eq = 2 * is_unary, is_ne = 2 * is_eq, is_lt = 2 * is_ne, is_gt = 2 * is_lt, is_ge = 2 * is_gt, is_le = 2 * is_ge, // macro types DT_WARN = is_normal | is_warn, DT_CHECK = is_normal | is_check, DT_REQUIRE = is_normal | is_require, DT_WARN_FALSE = is_normal | is_false | is_warn, DT_CHECK_FALSE = is_normal | is_false | is_check, DT_REQUIRE_FALSE = is_normal | is_false | is_require, DT_WARN_THROWS = is_throws | is_warn, DT_CHECK_THROWS = is_throws | is_check, DT_REQUIRE_THROWS = is_throws | is_require, DT_WARN_THROWS_AS = is_throws_as | is_warn, DT_CHECK_THROWS_AS = is_throws_as | is_check, DT_REQUIRE_THROWS_AS = is_throws_as | is_require, DT_WARN_THROWS_WITH = is_throws_with | is_warn, DT_CHECK_THROWS_WITH = is_throws_with | is_check, DT_REQUIRE_THROWS_WITH = is_throws_with | is_require, DT_WARN_THROWS_WITH_AS = is_throws_with | is_throws_as | is_warn, DT_CHECK_THROWS_WITH_AS = is_throws_with | is_throws_as | is_check, DT_REQUIRE_THROWS_WITH_AS = is_throws_with | is_throws_as | is_require, DT_WARN_NOTHROW = is_nothrow | is_warn, DT_CHECK_NOTHROW = is_nothrow | is_check, DT_REQUIRE_NOTHROW = is_nothrow | is_require, DT_WARN_EQ = is_normal | is_eq | is_warn, DT_CHECK_EQ = is_normal | is_eq | is_check, DT_REQUIRE_EQ = is_normal | is_eq | is_require, DT_WARN_NE = is_normal | is_ne | is_warn, DT_CHECK_NE = is_normal | is_ne | is_check, DT_REQUIRE_NE = is_normal | is_ne | is_require, DT_WARN_GT = is_normal | is_gt | is_warn, DT_CHECK_GT = is_normal | is_gt | is_check, DT_REQUIRE_GT = is_normal | is_gt | is_require, DT_WARN_LT = is_normal | is_lt | is_warn, DT_CHECK_LT = is_normal | is_lt | is_check, DT_REQUIRE_LT = is_normal | is_lt | is_require, DT_WARN_GE = is_normal | is_ge | is_warn, DT_CHECK_GE = is_normal | is_ge | is_check, DT_REQUIRE_GE = is_normal | is_ge | is_require, DT_WARN_LE = is_normal | is_le | is_warn, DT_CHECK_LE = is_normal | is_le | is_check, DT_REQUIRE_LE = is_normal | is_le | is_require, DT_WARN_UNARY = is_normal | is_unary | is_warn, DT_CHECK_UNARY = is_normal | is_unary | is_check, DT_REQUIRE_UNARY = is_normal | is_unary | is_require, DT_WARN_UNARY_FALSE = is_normal | is_false | is_unary | is_warn, DT_CHECK_UNARY_FALSE = is_normal | is_false | is_unary | is_check, DT_REQUIRE_UNARY_FALSE = is_normal | is_false | is_unary | is_require, }; } // namespace assertType DOCTEST_INTERFACE const char* assertString(assertType::Enum at); DOCTEST_INTERFACE const char* failureString(assertType::Enum at); DOCTEST_INTERFACE const char* skipPathFromFilename(const char* file); struct DOCTEST_INTERFACE TestCaseData { String m_file; // the file in which the test was registered (using String - see #350) unsigned m_line; // the line where the test was registered const char* m_name; // name of the test case const char* m_test_suite; // the test suite in which the test was added const char* m_description; bool m_skip; bool m_no_breaks; bool m_no_output; bool m_may_fail; bool m_should_fail; int m_expected_failures; double m_timeout; }; struct DOCTEST_INTERFACE AssertData { // common - for all asserts const TestCaseData* m_test_case; assertType::Enum m_at; const char* m_file; int m_line; const char* m_expr; bool m_failed; // exception-related - for all asserts bool m_threw; String m_exception; // for normal asserts String m_decomp; // for specific exception-related asserts bool m_threw_as; const char* m_exception_type; const char* m_exception_string; }; struct DOCTEST_INTERFACE MessageData { String m_string; const char* m_file; int m_line; assertType::Enum m_severity; }; struct DOCTEST_INTERFACE SubcaseSignature { String m_name; const char* m_file; int m_line; bool operator<(const SubcaseSignature& other) const; }; struct DOCTEST_INTERFACE IContextScope { IContextScope(); virtual ~IContextScope(); virtual void stringify(std::ostream*) const = 0; }; namespace detail { struct DOCTEST_INTERFACE TestCase; } // namespace detail struct ContextOptions //!OCLINT too many fields { std::ostream* cout = nullptr; // stdout stream String binary_name; // the test binary name const detail::TestCase* currentTest = nullptr; // == parameters from the command line String out; // output filename String order_by; // how tests should be ordered unsigned rand_seed; // the seed for rand ordering unsigned first; // the first (matching) test to be executed unsigned last; // the last (matching) test to be executed int abort_after; // stop tests after this many failed assertions int subcase_filter_levels; // apply the subcase filters for the first N levels bool success; // include successful assertions in output bool case_sensitive; // if filtering should be case sensitive bool exit; // if the program should be exited after the tests are ran/whatever bool duration; // print the time duration of each test case bool minimal; // minimal console output (only test failures) bool quiet; // no console output bool no_throw; // to skip exceptions-related assertion macros bool no_exitcode; // if the framework should return 0 as the exitcode bool no_run; // to not run the tests at all (can be done with an "*" exclude) bool no_intro; // to not print the intro of the framework bool no_version; // to not print the version of the framework bool no_colors; // if output to the console should be colorized bool force_colors; // forces the use of colors even when a tty cannot be detected bool no_breaks; // to not break into the debugger bool no_skip; // don't skip test cases which are marked to be skipped bool gnu_file_line; // if line numbers should be surrounded with :x: and not (x): bool no_path_in_filenames; // if the path to files should be removed from the output bool no_line_numbers; // if source code line numbers should be omitted from the output bool no_debug_output; // no output in the debug console when a debugger is attached bool no_skipped_summary; // don't print "skipped" in the summary !!! UNDOCUMENTED !!! bool no_time_in_output; // omit any time/timestamps from output !!! UNDOCUMENTED !!! bool help; // to print the help bool version; // to print the version bool count; // if only the count of matching tests is to be retrieved bool list_test_cases; // to list all tests matching the filters bool list_test_suites; // to list all suites matching the filters bool list_reporters; // lists all registered reporters }; namespace detail { template struct enable_if {}; template struct enable_if { typedef TYPE type; }; // clang-format off template struct remove_reference { typedef T type; }; template struct remove_reference { typedef T type; }; template struct remove_reference { typedef T type; }; template U declval(int); template T declval(long); template auto declval() DOCTEST_NOEXCEPT -> decltype(declval(0)) ; template struct is_lvalue_reference { const static bool value=false; }; template struct is_lvalue_reference { const static bool value=true; }; template struct is_rvalue_reference { const static bool value=false; }; template struct is_rvalue_reference { const static bool value=true; }; template inline T&& forward(typename remove_reference::type& t) DOCTEST_NOEXCEPT { return static_cast(t); } template inline T&& forward(typename remove_reference::type&& t) DOCTEST_NOEXCEPT { static_assert(!is_lvalue_reference::value, "Can not forward an rvalue as an lvalue."); return static_cast(t); } template struct remove_const { typedef T type; }; template struct remove_const { typedef T type; }; #ifdef DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS template struct is_enum : public std::is_enum {}; template struct underlying_type : public std::underlying_type {}; #else // Use compiler intrinsics template struct is_enum { DOCTEST_CONSTEXPR static bool value = __is_enum(T); }; template struct underlying_type { typedef __underlying_type(T) type; }; #endif // clang-format on template struct deferred_false // cppcheck-suppress unusedStructMember { static const bool value = false; }; namespace has_insertion_operator_impl { std::ostream &os(); template DOCTEST_REF_WRAP(T) val(); template struct check { static DOCTEST_CONSTEXPR bool value = false; }; template struct check(), void())> { static DOCTEST_CONSTEXPR bool value = true; }; } // namespace has_insertion_operator_impl template using has_insertion_operator = has_insertion_operator_impl::check; DOCTEST_INTERFACE std::ostream* tlssPush(); DOCTEST_INTERFACE String tlssPop(); template struct StringMakerBase { template static String convert(const DOCTEST_REF_WRAP(T)) { return "{?}"; } }; // Vector and various type other than pointer or array. template struct filldata { static void fill(std::ostream* stream, const T &in) { *stream << in; } }; template struct filldata { static void fill(std::ostream* stream, const T (&in)[N]) { for (unsigned long i = 0; i < N; i++) { *stream << in[i]; } } }; // Specialized since we don't want the terminating null byte! template struct filldata { static void fill(std::ostream* stream, const char(&in)[N]) { *stream << in; } }; template void filloss(std::ostream* stream, const T& in) { filldata::fill(stream, in); } template void filloss(std::ostream* stream, const T (&in)[N]) { // T[N], T(&)[N], T(&&)[N] have same behaviour. // Hence remove reference. filldata::type>::fill(stream, in); } template <> struct StringMakerBase { template static String convert(const DOCTEST_REF_WRAP(T) in) { /* When parameter "in" is a null terminated const char* it works. * When parameter "in" is a T arr[N] without '\0' we can fill the * stringstream with N objects (T=char).If in is char pointer * * without '\0' , it would cause segfault * stepping over unaccessible memory. */ std::ostream* stream = tlssPush(); filloss(stream, in); return tlssPop(); } }; DOCTEST_INTERFACE String rawMemoryToString(const void* object, unsigned size); template String rawMemoryToString(const DOCTEST_REF_WRAP(T) object) { return rawMemoryToString(&object, sizeof(object)); } template const char* type_to_string() { return "<>"; } } // namespace detail template struct StringMaker : public detail::StringMakerBase::value> {}; template struct StringMaker { template static String convert(U* p) { if(p) return detail::rawMemoryToString(p); return "NULL"; } }; template struct StringMaker { static String convert(R C::*p) { if(p) return detail::rawMemoryToString(p); return "NULL"; } }; template ::value, bool>::type = true> String toString(const DOCTEST_REF_WRAP(T) value) { return StringMaker::convert(value); } #ifdef DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING DOCTEST_INTERFACE String toString(char* in); DOCTEST_INTERFACE String toString(const char* in); #endif // DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING DOCTEST_INTERFACE String toString(bool in); DOCTEST_INTERFACE String toString(float in); DOCTEST_INTERFACE String toString(double in); DOCTEST_INTERFACE String toString(double long in); DOCTEST_INTERFACE String toString(char in); DOCTEST_INTERFACE String toString(char signed in); DOCTEST_INTERFACE String toString(char unsigned in); DOCTEST_INTERFACE String toString(int short in); DOCTEST_INTERFACE String toString(int short unsigned in); DOCTEST_INTERFACE String toString(int in); DOCTEST_INTERFACE String toString(int unsigned in); DOCTEST_INTERFACE String toString(int long in); DOCTEST_INTERFACE String toString(int long unsigned in); DOCTEST_INTERFACE String toString(int long long in); DOCTEST_INTERFACE String toString(int long long unsigned in); DOCTEST_INTERFACE String toString(std::nullptr_t in); template ::value, bool>::type = true> String toString(const DOCTEST_REF_WRAP(T) value) { typedef typename detail::underlying_type::type UT; return toString(static_cast(value)); } #if DOCTEST_MSVC >= DOCTEST_COMPILER(19, 20, 0) // see this issue on why this is needed: https://github.com/doctest/doctest/issues/183 DOCTEST_INTERFACE String toString(const std::string& in); #endif // VS 2019 class DOCTEST_INTERFACE Approx { public: explicit Approx(double value); Approx operator()(double value) const; #ifdef DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS template explicit Approx(const T& value, typename detail::enable_if::value>::type* = static_cast(nullptr)) { *this = Approx(static_cast(value)); } #endif // DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS Approx& epsilon(double newEpsilon); #ifdef DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS template typename detail::enable_if::value, Approx&>::type epsilon( const T& newEpsilon) { m_epsilon = static_cast(newEpsilon); return *this; } #endif // DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS Approx& scale(double newScale); #ifdef DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS template typename detail::enable_if::value, Approx&>::type scale( const T& newScale) { m_scale = static_cast(newScale); return *this; } #endif // DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS // clang-format off DOCTEST_INTERFACE friend bool operator==(double lhs, const Approx & rhs); DOCTEST_INTERFACE friend bool operator==(const Approx & lhs, double rhs); DOCTEST_INTERFACE friend bool operator!=(double lhs, const Approx & rhs); DOCTEST_INTERFACE friend bool operator!=(const Approx & lhs, double rhs); DOCTEST_INTERFACE friend bool operator<=(double lhs, const Approx & rhs); DOCTEST_INTERFACE friend bool operator<=(const Approx & lhs, double rhs); DOCTEST_INTERFACE friend bool operator>=(double lhs, const Approx & rhs); DOCTEST_INTERFACE friend bool operator>=(const Approx & lhs, double rhs); DOCTEST_INTERFACE friend bool operator< (double lhs, const Approx & rhs); DOCTEST_INTERFACE friend bool operator< (const Approx & lhs, double rhs); DOCTEST_INTERFACE friend bool operator> (double lhs, const Approx & rhs); DOCTEST_INTERFACE friend bool operator> (const Approx & lhs, double rhs); DOCTEST_INTERFACE friend String toString(const Approx& in); #ifdef DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS #define DOCTEST_APPROX_PREFIX \ template friend typename detail::enable_if::value, bool>::type DOCTEST_APPROX_PREFIX operator==(const T& lhs, const Approx& rhs) { return operator==(double(lhs), rhs); } DOCTEST_APPROX_PREFIX operator==(const Approx& lhs, const T& rhs) { return operator==(rhs, lhs); } DOCTEST_APPROX_PREFIX operator!=(const T& lhs, const Approx& rhs) { return !operator==(lhs, rhs); } DOCTEST_APPROX_PREFIX operator!=(const Approx& lhs, const T& rhs) { return !operator==(rhs, lhs); } DOCTEST_APPROX_PREFIX operator<=(const T& lhs, const Approx& rhs) { return double(lhs) < rhs.m_value || lhs == rhs; } DOCTEST_APPROX_PREFIX operator<=(const Approx& lhs, const T& rhs) { return lhs.m_value < double(rhs) || lhs == rhs; } DOCTEST_APPROX_PREFIX operator>=(const T& lhs, const Approx& rhs) { return double(lhs) > rhs.m_value || lhs == rhs; } DOCTEST_APPROX_PREFIX operator>=(const Approx& lhs, const T& rhs) { return lhs.m_value > double(rhs) || lhs == rhs; } DOCTEST_APPROX_PREFIX operator< (const T& lhs, const Approx& rhs) { return double(lhs) < rhs.m_value && lhs != rhs; } DOCTEST_APPROX_PREFIX operator< (const Approx& lhs, const T& rhs) { return lhs.m_value < double(rhs) && lhs != rhs; } DOCTEST_APPROX_PREFIX operator> (const T& lhs, const Approx& rhs) { return double(lhs) > rhs.m_value && lhs != rhs; } DOCTEST_APPROX_PREFIX operator> (const Approx& lhs, const T& rhs) { return lhs.m_value > double(rhs) && lhs != rhs; } #undef DOCTEST_APPROX_PREFIX #endif // DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS // clang-format on private: double m_epsilon; double m_scale; double m_value; }; DOCTEST_INTERFACE String toString(const Approx& in); DOCTEST_INTERFACE const ContextOptions* getContextOptions(); #if !defined(DOCTEST_CONFIG_DISABLE) namespace detail { // clang-format off #ifdef DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING template struct decay_array { typedef T type; }; template struct decay_array { typedef T* type; }; template struct decay_array { typedef T* type; }; template struct not_char_pointer { enum { value = 1 }; }; template<> struct not_char_pointer { enum { value = 0 }; }; template<> struct not_char_pointer { enum { value = 0 }; }; template struct can_use_op : public not_char_pointer::type> {}; #endif // DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING // clang-format on struct DOCTEST_INTERFACE TestFailureException { }; DOCTEST_INTERFACE bool checkIfShouldThrow(assertType::Enum at); #ifndef DOCTEST_CONFIG_NO_EXCEPTIONS DOCTEST_NORETURN #endif // DOCTEST_CONFIG_NO_EXCEPTIONS DOCTEST_INTERFACE void throwException(); struct DOCTEST_INTERFACE Subcase { SubcaseSignature m_signature; bool m_entered = false; Subcase(const String& name, const char* file, int line); ~Subcase(); operator bool() const; }; template String stringifyBinaryExpr(const DOCTEST_REF_WRAP(L) lhs, const char* op, const DOCTEST_REF_WRAP(R) rhs) { // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) return toString(lhs) + op + toString(rhs); } #if DOCTEST_CLANG && DOCTEST_CLANG < DOCTEST_COMPILER(3, 6, 0) DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wunused-comparison") #endif // This will check if there is any way it could find a operator like member or friend and uses it. // If not it doesn't find the operator or if the operator at global scope is defined after // this template, the template won't be instantiated due to SFINAE. Once the template is not // instantiated it can look for global operator using normal conversions. #define SFINAE_OP(ret,op) decltype((void)(doctest::detail::declval() op doctest::detail::declval()),ret{}) #define DOCTEST_DO_BINARY_EXPRESSION_COMPARISON(op, op_str, op_macro) \ template \ DOCTEST_NOINLINE SFINAE_OP(Result,op) operator op(const R&& rhs) { \ bool res = op_macro(doctest::detail::forward(lhs), doctest::detail::forward(rhs)); \ if(m_at & assertType::is_false) \ res = !res; \ if(!res || doctest::getContextOptions()->success) \ return Result(res, stringifyBinaryExpr(lhs, op_str, rhs)); \ return Result(res); \ } \ template ::value, void >::type* = nullptr> \ DOCTEST_NOINLINE SFINAE_OP(Result,op) operator op(const R& rhs) { \ bool res = op_macro(doctest::detail::forward(lhs), rhs); \ if(m_at & assertType::is_false) \ res = !res; \ if(!res || doctest::getContextOptions()->success) \ return Result(res, stringifyBinaryExpr(lhs, op_str, rhs)); \ return Result(res); \ } // more checks could be added - like in Catch: // https://github.com/catchorg/Catch2/pull/1480/files // https://github.com/catchorg/Catch2/pull/1481/files #define DOCTEST_FORBIT_EXPRESSION(rt, op) \ template \ rt& operator op(const R&) { \ static_assert(deferred_false::value, \ "Expression Too Complex Please Rewrite As Binary Comparison!"); \ return *this; \ } struct DOCTEST_INTERFACE Result { bool m_passed; String m_decomp; Result() = default; Result(bool passed, const String& decomposition = String()); // forbidding some expressions based on this table: https://en.cppreference.com/w/cpp/language/operator_precedence DOCTEST_FORBIT_EXPRESSION(Result, &) DOCTEST_FORBIT_EXPRESSION(Result, ^) DOCTEST_FORBIT_EXPRESSION(Result, |) DOCTEST_FORBIT_EXPRESSION(Result, &&) DOCTEST_FORBIT_EXPRESSION(Result, ||) DOCTEST_FORBIT_EXPRESSION(Result, ==) DOCTEST_FORBIT_EXPRESSION(Result, !=) DOCTEST_FORBIT_EXPRESSION(Result, <) DOCTEST_FORBIT_EXPRESSION(Result, >) DOCTEST_FORBIT_EXPRESSION(Result, <=) DOCTEST_FORBIT_EXPRESSION(Result, >=) DOCTEST_FORBIT_EXPRESSION(Result, =) DOCTEST_FORBIT_EXPRESSION(Result, +=) DOCTEST_FORBIT_EXPRESSION(Result, -=) DOCTEST_FORBIT_EXPRESSION(Result, *=) DOCTEST_FORBIT_EXPRESSION(Result, /=) DOCTEST_FORBIT_EXPRESSION(Result, %=) DOCTEST_FORBIT_EXPRESSION(Result, <<=) DOCTEST_FORBIT_EXPRESSION(Result, >>=) DOCTEST_FORBIT_EXPRESSION(Result, &=) DOCTEST_FORBIT_EXPRESSION(Result, ^=) DOCTEST_FORBIT_EXPRESSION(Result, |=) }; #ifndef DOCTEST_CONFIG_NO_COMPARISON_WARNING_SUPPRESSION DOCTEST_CLANG_SUPPRESS_WARNING_PUSH DOCTEST_CLANG_SUPPRESS_WARNING("-Wsign-conversion") DOCTEST_CLANG_SUPPRESS_WARNING("-Wsign-compare") //DOCTEST_CLANG_SUPPRESS_WARNING("-Wdouble-promotion") //DOCTEST_CLANG_SUPPRESS_WARNING("-Wconversion") //DOCTEST_CLANG_SUPPRESS_WARNING("-Wfloat-equal") DOCTEST_GCC_SUPPRESS_WARNING_PUSH DOCTEST_GCC_SUPPRESS_WARNING("-Wsign-conversion") DOCTEST_GCC_SUPPRESS_WARNING("-Wsign-compare") //DOCTEST_GCC_SUPPRESS_WARNING("-Wdouble-promotion") //DOCTEST_GCC_SUPPRESS_WARNING("-Wconversion") //DOCTEST_GCC_SUPPRESS_WARNING("-Wfloat-equal") DOCTEST_MSVC_SUPPRESS_WARNING_PUSH // https://stackoverflow.com/questions/39479163 what's the difference between 4018 and 4389 DOCTEST_MSVC_SUPPRESS_WARNING(4388) // signed/unsigned mismatch DOCTEST_MSVC_SUPPRESS_WARNING(4389) // 'operator' : signed/unsigned mismatch DOCTEST_MSVC_SUPPRESS_WARNING(4018) // 'expression' : signed/unsigned mismatch //DOCTEST_MSVC_SUPPRESS_WARNING(4805) // 'operation' : unsafe mix of type 'type' and type 'type' in operation #endif // DOCTEST_CONFIG_NO_COMPARISON_WARNING_SUPPRESSION // clang-format off #ifndef DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING #define DOCTEST_COMPARISON_RETURN_TYPE bool #else // DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING #define DOCTEST_COMPARISON_RETURN_TYPE typename enable_if::value || can_use_op::value, bool>::type // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) inline bool eq(const char* lhs, const char* rhs) { return String(lhs) == String(rhs); } inline bool ne(const char* lhs, const char* rhs) { return String(lhs) != String(rhs); } inline bool lt(const char* lhs, const char* rhs) { return String(lhs) < String(rhs); } inline bool gt(const char* lhs, const char* rhs) { return String(lhs) > String(rhs); } inline bool le(const char* lhs, const char* rhs) { return String(lhs) <= String(rhs); } inline bool ge(const char* lhs, const char* rhs) { return String(lhs) >= String(rhs); } #endif // DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING // clang-format on #define DOCTEST_RELATIONAL_OP(name, op) \ template \ DOCTEST_COMPARISON_RETURN_TYPE name(const DOCTEST_REF_WRAP(L) lhs, \ const DOCTEST_REF_WRAP(R) rhs) { \ return lhs op rhs; \ } DOCTEST_RELATIONAL_OP(eq, ==) DOCTEST_RELATIONAL_OP(ne, !=) DOCTEST_RELATIONAL_OP(lt, <) DOCTEST_RELATIONAL_OP(gt, >) DOCTEST_RELATIONAL_OP(le, <=) DOCTEST_RELATIONAL_OP(ge, >=) #ifndef DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING #define DOCTEST_CMP_EQ(l, r) l == r #define DOCTEST_CMP_NE(l, r) l != r #define DOCTEST_CMP_GT(l, r) l > r #define DOCTEST_CMP_LT(l, r) l < r #define DOCTEST_CMP_GE(l, r) l >= r #define DOCTEST_CMP_LE(l, r) l <= r #else // DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING #define DOCTEST_CMP_EQ(l, r) eq(l, r) #define DOCTEST_CMP_NE(l, r) ne(l, r) #define DOCTEST_CMP_GT(l, r) gt(l, r) #define DOCTEST_CMP_LT(l, r) lt(l, r) #define DOCTEST_CMP_GE(l, r) ge(l, r) #define DOCTEST_CMP_LE(l, r) le(l, r) #endif // DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING template // cppcheck-suppress copyCtorAndEqOperator struct Expression_lhs { L lhs; assertType::Enum m_at; explicit Expression_lhs(L&& in, assertType::Enum at) : lhs(doctest::detail::forward(in)) , m_at(at) {} DOCTEST_NOINLINE operator Result() { // this is needed only for MSVC 2015 DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(4800) // 'int': forcing value to bool bool res = static_cast(lhs); DOCTEST_MSVC_SUPPRESS_WARNING_POP if(m_at & assertType::is_false) //!OCLINT bitwise operator in conditional res = !res; if(!res || getContextOptions()->success) return Result(res, toString(lhs)); return Result(res); } /* This is required for user-defined conversions from Expression_lhs to L */ operator L() const { return lhs; } // clang-format off DOCTEST_DO_BINARY_EXPRESSION_COMPARISON(==, " == ", DOCTEST_CMP_EQ) //!OCLINT bitwise operator in conditional DOCTEST_DO_BINARY_EXPRESSION_COMPARISON(!=, " != ", DOCTEST_CMP_NE) //!OCLINT bitwise operator in conditional DOCTEST_DO_BINARY_EXPRESSION_COMPARISON(>, " > ", DOCTEST_CMP_GT) //!OCLINT bitwise operator in conditional DOCTEST_DO_BINARY_EXPRESSION_COMPARISON(<, " < ", DOCTEST_CMP_LT) //!OCLINT bitwise operator in conditional DOCTEST_DO_BINARY_EXPRESSION_COMPARISON(>=, " >= ", DOCTEST_CMP_GE) //!OCLINT bitwise operator in conditional DOCTEST_DO_BINARY_EXPRESSION_COMPARISON(<=, " <= ", DOCTEST_CMP_LE) //!OCLINT bitwise operator in conditional // clang-format on // forbidding some expressions based on this table: https://en.cppreference.com/w/cpp/language/operator_precedence DOCTEST_FORBIT_EXPRESSION(Expression_lhs, &) DOCTEST_FORBIT_EXPRESSION(Expression_lhs, ^) DOCTEST_FORBIT_EXPRESSION(Expression_lhs, |) DOCTEST_FORBIT_EXPRESSION(Expression_lhs, &&) DOCTEST_FORBIT_EXPRESSION(Expression_lhs, ||) DOCTEST_FORBIT_EXPRESSION(Expression_lhs, =) DOCTEST_FORBIT_EXPRESSION(Expression_lhs, +=) DOCTEST_FORBIT_EXPRESSION(Expression_lhs, -=) DOCTEST_FORBIT_EXPRESSION(Expression_lhs, *=) DOCTEST_FORBIT_EXPRESSION(Expression_lhs, /=) DOCTEST_FORBIT_EXPRESSION(Expression_lhs, %=) DOCTEST_FORBIT_EXPRESSION(Expression_lhs, <<=) DOCTEST_FORBIT_EXPRESSION(Expression_lhs, >>=) DOCTEST_FORBIT_EXPRESSION(Expression_lhs, &=) DOCTEST_FORBIT_EXPRESSION(Expression_lhs, ^=) DOCTEST_FORBIT_EXPRESSION(Expression_lhs, |=) // these 2 are unfortunate because they should be allowed - they have higher precedence over the comparisons, but the // ExpressionDecomposer class uses the left shift operator to capture the left operand of the binary expression... DOCTEST_FORBIT_EXPRESSION(Expression_lhs, <<) DOCTEST_FORBIT_EXPRESSION(Expression_lhs, >>) }; #ifndef DOCTEST_CONFIG_NO_COMPARISON_WARNING_SUPPRESSION DOCTEST_CLANG_SUPPRESS_WARNING_POP DOCTEST_MSVC_SUPPRESS_WARNING_POP DOCTEST_GCC_SUPPRESS_WARNING_POP #endif // DOCTEST_CONFIG_NO_COMPARISON_WARNING_SUPPRESSION #if DOCTEST_CLANG && DOCTEST_CLANG < DOCTEST_COMPILER(3, 6, 0) DOCTEST_CLANG_SUPPRESS_WARNING_POP #endif struct DOCTEST_INTERFACE ExpressionDecomposer { assertType::Enum m_at; ExpressionDecomposer(assertType::Enum at); // The right operator for capturing expressions is "<=" instead of "<<" (based on the operator precedence table) // but then there will be warnings from GCC about "-Wparentheses" and since "_Pragma()" is problematic this will stay for now... // https://github.com/catchorg/Catch2/issues/870 // https://github.com/catchorg/Catch2/issues/565 template Expression_lhs operator<<(const L &&operand) { return Expression_lhs(doctest::detail::forward(operand), m_at); } template ::value,void >::type* = nullptr> Expression_lhs operator<<(const L &operand) { return Expression_lhs(operand, m_at); } }; struct DOCTEST_INTERFACE TestSuite { const char* m_test_suite = nullptr; const char* m_description = nullptr; bool m_skip = false; bool m_no_breaks = false; bool m_no_output = false; bool m_may_fail = false; bool m_should_fail = false; int m_expected_failures = 0; double m_timeout = 0; TestSuite& operator*(const char* in); template TestSuite& operator*(const T& in) { in.fill(*this); return *this; } }; typedef void (*funcType)(); struct DOCTEST_INTERFACE TestCase : public TestCaseData { funcType m_test; // a function pointer to the test case const char* m_type; // for templated test cases - gets appended to the real name int m_template_id; // an ID used to distinguish between the different versions of a templated test case String m_full_name; // contains the name (only for templated test cases!) + the template type TestCase(funcType test, const char* file, unsigned line, const TestSuite& test_suite, const char* type = "", int template_id = -1); TestCase(const TestCase& other); DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(26434) // hides a non-virtual function TestCase& operator=(const TestCase& other); DOCTEST_MSVC_SUPPRESS_WARNING_POP TestCase& operator*(const char* in); template TestCase& operator*(const T& in) { in.fill(*this); return *this; } bool operator<(const TestCase& other) const; }; // forward declarations of functions used by the macros DOCTEST_INTERFACE int regTest(const TestCase& tc); DOCTEST_INTERFACE int setTestSuite(const TestSuite& ts); DOCTEST_INTERFACE bool isDebuggerActive(); template int instantiationHelper(const T&) { return 0; } namespace binaryAssertComparison { enum Enum { eq = 0, ne, gt, lt, ge, le }; } // namespace binaryAssertComparison // clang-format off template struct RelationalComparator { bool operator()(const DOCTEST_REF_WRAP(L), const DOCTEST_REF_WRAP(R) ) const { return false; } }; #define DOCTEST_BINARY_RELATIONAL_OP(n, op) \ template struct RelationalComparator { bool operator()(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) const { return op(lhs, rhs); } }; // clang-format on DOCTEST_BINARY_RELATIONAL_OP(0, doctest::detail::eq) DOCTEST_BINARY_RELATIONAL_OP(1, doctest::detail::ne) DOCTEST_BINARY_RELATIONAL_OP(2, doctest::detail::gt) DOCTEST_BINARY_RELATIONAL_OP(3, doctest::detail::lt) DOCTEST_BINARY_RELATIONAL_OP(4, doctest::detail::ge) DOCTEST_BINARY_RELATIONAL_OP(5, doctest::detail::le) struct DOCTEST_INTERFACE ResultBuilder : public AssertData { ResultBuilder(assertType::Enum at, const char* file, int line, const char* expr, const char* exception_type = "", const char* exception_string = ""); void setResult(const Result& res); template DOCTEST_NOINLINE bool binary_assert(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) { m_failed = !RelationalComparator()(lhs, rhs); if(m_failed || getContextOptions()->success) m_decomp = stringifyBinaryExpr(lhs, ", ", rhs); return !m_failed; } template DOCTEST_NOINLINE bool unary_assert(const DOCTEST_REF_WRAP(L) val) { m_failed = !val; if(m_at & assertType::is_false) //!OCLINT bitwise operator in conditional m_failed = !m_failed; if(m_failed || getContextOptions()->success) m_decomp = toString(val); return !m_failed; } void translateException(); bool log(); void react() const; }; namespace assertAction { enum Enum { nothing = 0, dbgbreak = 1, shouldthrow = 2 }; } // namespace assertAction DOCTEST_INTERFACE void failed_out_of_a_testing_context(const AssertData& ad); DOCTEST_INTERFACE bool decomp_assert(assertType::Enum at, const char* file, int line, const char* expr, Result result); #define DOCTEST_ASSERT_OUT_OF_TESTS(decomp) \ do { \ if(!is_running_in_test) { \ if(failed) { \ ResultBuilder rb(at, file, line, expr); \ rb.m_failed = failed; \ rb.m_decomp = decomp; \ failed_out_of_a_testing_context(rb); \ if(isDebuggerActive() && !getContextOptions()->no_breaks) \ DOCTEST_BREAK_INTO_DEBUGGER(); \ if(checkIfShouldThrow(at)) \ throwException(); \ } \ return !failed; \ } \ } while(false) #define DOCTEST_ASSERT_IN_TESTS(decomp) \ ResultBuilder rb(at, file, line, expr); \ rb.m_failed = failed; \ if(rb.m_failed || getContextOptions()->success) \ rb.m_decomp = decomp; \ if(rb.log()) \ DOCTEST_BREAK_INTO_DEBUGGER(); \ if(rb.m_failed && checkIfShouldThrow(at)) \ throwException() template DOCTEST_NOINLINE bool binary_assert(assertType::Enum at, const char* file, int line, const char* expr, const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) { bool failed = !RelationalComparator()(lhs, rhs); // ################################################################################### // IF THE DEBUGGER BREAKS HERE - GO 1 LEVEL UP IN THE CALLSTACK FOR THE FAILING ASSERT // THIS IS THE EFFECT OF HAVING 'DOCTEST_CONFIG_SUPER_FAST_ASSERTS' DEFINED // ################################################################################### DOCTEST_ASSERT_OUT_OF_TESTS(stringifyBinaryExpr(lhs, ", ", rhs)); DOCTEST_ASSERT_IN_TESTS(stringifyBinaryExpr(lhs, ", ", rhs)); return !failed; } template DOCTEST_NOINLINE bool unary_assert(assertType::Enum at, const char* file, int line, const char* expr, const DOCTEST_REF_WRAP(L) val) { bool failed = !val; if(at & assertType::is_false) //!OCLINT bitwise operator in conditional failed = !failed; // ################################################################################### // IF THE DEBUGGER BREAKS HERE - GO 1 LEVEL UP IN THE CALLSTACK FOR THE FAILING ASSERT // THIS IS THE EFFECT OF HAVING 'DOCTEST_CONFIG_SUPER_FAST_ASSERTS' DEFINED // ################################################################################### DOCTEST_ASSERT_OUT_OF_TESTS(toString(val)); DOCTEST_ASSERT_IN_TESTS(toString(val)); return !failed; } struct DOCTEST_INTERFACE IExceptionTranslator { IExceptionTranslator(); virtual ~IExceptionTranslator(); virtual bool translate(String&) const = 0; }; template class ExceptionTranslator : public IExceptionTranslator //!OCLINT destructor of virtual class { public: explicit ExceptionTranslator(String (*translateFunction)(T)) : m_translateFunction(translateFunction) {} bool translate(String& res) const override { #ifndef DOCTEST_CONFIG_NO_EXCEPTIONS try { throw; // lgtm [cpp/rethrow-no-exception] // cppcheck-suppress catchExceptionByValue } catch(T ex) { // NOLINT res = m_translateFunction(ex); //!OCLINT parameter reassignment return true; } catch(...) {} //!OCLINT - empty catch statement #endif // DOCTEST_CONFIG_NO_EXCEPTIONS static_cast(res); // to silence -Wunused-parameter return false; } private: String (*m_translateFunction)(T); }; DOCTEST_INTERFACE void registerExceptionTranslatorImpl(const IExceptionTranslator* et); template struct StringStreamBase { template static void convert(std::ostream* s, const T& in) { *s << toString(in); } // always treat char* as a string in this context - no matter // if DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING is defined static void convert(std::ostream* s, const char* in) { *s << String(in); } }; template <> struct StringStreamBase { template static void convert(std::ostream* s, const T& in) { *s << in; } }; template struct StringStream : public StringStreamBase::value> {}; template void toStream(std::ostream* s, const T& value) { StringStream::convert(s, value); } #ifdef DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING DOCTEST_INTERFACE void toStream(std::ostream* s, char* in); DOCTEST_INTERFACE void toStream(std::ostream* s, const char* in); #endif // DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING DOCTEST_INTERFACE void toStream(std::ostream* s, bool in); DOCTEST_INTERFACE void toStream(std::ostream* s, float in); DOCTEST_INTERFACE void toStream(std::ostream* s, double in); DOCTEST_INTERFACE void toStream(std::ostream* s, double long in); DOCTEST_INTERFACE void toStream(std::ostream* s, char in); DOCTEST_INTERFACE void toStream(std::ostream* s, char signed in); DOCTEST_INTERFACE void toStream(std::ostream* s, char unsigned in); DOCTEST_INTERFACE void toStream(std::ostream* s, int short in); DOCTEST_INTERFACE void toStream(std::ostream* s, int short unsigned in); DOCTEST_INTERFACE void toStream(std::ostream* s, int in); DOCTEST_INTERFACE void toStream(std::ostream* s, int unsigned in); DOCTEST_INTERFACE void toStream(std::ostream* s, int long in); DOCTEST_INTERFACE void toStream(std::ostream* s, int long unsigned in); DOCTEST_INTERFACE void toStream(std::ostream* s, int long long in); DOCTEST_INTERFACE void toStream(std::ostream* s, int long long unsigned in); // ContextScope base class used to allow implementing methods of ContextScope // that don't depend on the template parameter in doctest.cpp. class DOCTEST_INTERFACE ContextScopeBase : public IContextScope { protected: ContextScopeBase(); ContextScopeBase(ContextScopeBase&& other); void destroy(); bool need_to_destroy{true}; }; template class ContextScope : public ContextScopeBase { const L lambda_; public: explicit ContextScope(const L &lambda) : lambda_(lambda) {} ContextScope(ContextScope &&other) : ContextScopeBase(static_cast(other)), lambda_(other.lambda_) {} void stringify(std::ostream* s) const override { lambda_(s); } ~ContextScope() override { if (need_to_destroy) { destroy(); } } }; struct DOCTEST_INTERFACE MessageBuilder : public MessageData { std::ostream* m_stream; bool logged = false; MessageBuilder(const char* file, int line, assertType::Enum severity); MessageBuilder() = delete; ~MessageBuilder(); // the preferred way of chaining parameters for stringification template MessageBuilder& operator,(const T& in) { toStream(m_stream, in); return *this; } // kept here just for backwards-compatibility - the comma operator should be preferred now template MessageBuilder& operator<<(const T& in) { return this->operator,(in); } // the `,` operator has the lowest operator precedence - if `<<` is used by the user then // the `,` operator will be called last which is not what we want and thus the `*` operator // is used first (has higher operator precedence compared to `<<`) so that we guarantee that // an operator of the MessageBuilder class is called first before the rest of the parameters template MessageBuilder& operator*(const T& in) { return this->operator,(in); } bool log(); void react(); }; template ContextScope MakeContextScope(const L &lambda) { return ContextScope(lambda); } } // namespace detail #define DOCTEST_DEFINE_DECORATOR(name, type, def) \ struct name \ { \ type data; \ name(type in = def) \ : data(in) {} \ void fill(detail::TestCase& state) const { state.DOCTEST_CAT(m_, name) = data; } \ void fill(detail::TestSuite& state) const { state.DOCTEST_CAT(m_, name) = data; } \ } DOCTEST_DEFINE_DECORATOR(test_suite, const char*, ""); DOCTEST_DEFINE_DECORATOR(description, const char*, ""); DOCTEST_DEFINE_DECORATOR(skip, bool, true); DOCTEST_DEFINE_DECORATOR(no_breaks, bool, true); DOCTEST_DEFINE_DECORATOR(no_output, bool, true); DOCTEST_DEFINE_DECORATOR(timeout, double, 0); DOCTEST_DEFINE_DECORATOR(may_fail, bool, true); DOCTEST_DEFINE_DECORATOR(should_fail, bool, true); DOCTEST_DEFINE_DECORATOR(expected_failures, int, 0); template int registerExceptionTranslator(String (*translateFunction)(T)) { DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wexit-time-destructors") static detail::ExceptionTranslator exceptionTranslator(translateFunction); DOCTEST_CLANG_SUPPRESS_WARNING_POP detail::registerExceptionTranslatorImpl(&exceptionTranslator); return 0; } } // namespace doctest // in a separate namespace outside of doctest because the DOCTEST_TEST_SUITE macro // introduces an anonymous namespace in which getCurrentTestSuite gets overridden namespace doctest_detail_test_suite_ns { DOCTEST_INTERFACE doctest::detail::TestSuite& getCurrentTestSuite(); } // namespace doctest_detail_test_suite_ns namespace doctest { #else // DOCTEST_CONFIG_DISABLE template int registerExceptionTranslator(String (*)(T)) { return 0; } #endif // DOCTEST_CONFIG_DISABLE namespace detail { typedef void (*assert_handler)(const AssertData&); struct ContextState; } // namespace detail class DOCTEST_INTERFACE Context { detail::ContextState* p; void parseArgs(int argc, const char* const* argv, bool withDefaults = false); public: explicit Context(int argc = 0, const char* const* argv = nullptr); ~Context(); void applyCommandLine(int argc, const char* const* argv); void addFilter(const char* filter, const char* value); void clearFilters(); void setOption(const char* option, bool value); void setOption(const char* option, int value); void setOption(const char* option, const char* value); bool shouldExit(); void setAsDefaultForAssertsOutOfTestCases(); void setAssertHandler(detail::assert_handler ah); void setCout(std::ostream* out); int run(); }; namespace TestCaseFailureReason { enum Enum { None = 0, AssertFailure = 1, // an assertion has failed in the test case Exception = 2, // test case threw an exception Crash = 4, // a crash... TooManyFailedAsserts = 8, // the abort-after option Timeout = 16, // see the timeout decorator ShouldHaveFailedButDidnt = 32, // see the should_fail decorator ShouldHaveFailedAndDid = 64, // see the should_fail decorator DidntFailExactlyNumTimes = 128, // see the expected_failures decorator FailedExactlyNumTimes = 256, // see the expected_failures decorator CouldHaveFailedAndDid = 512 // see the may_fail decorator }; } // namespace TestCaseFailureReason struct DOCTEST_INTERFACE CurrentTestCaseStats { int numAssertsCurrentTest; int numAssertsFailedCurrentTest; double seconds; int failure_flags; // use TestCaseFailureReason::Enum bool testCaseSuccess; }; struct DOCTEST_INTERFACE TestCaseException { String error_string; bool is_crash; }; struct DOCTEST_INTERFACE TestRunStats { unsigned numTestCases; unsigned numTestCasesPassingFilters; unsigned numTestSuitesPassingFilters; unsigned numTestCasesFailed; int numAsserts; int numAssertsFailed; }; struct QueryData { const TestRunStats* run_stats = nullptr; const TestCaseData** data = nullptr; unsigned num_data = 0; }; struct DOCTEST_INTERFACE IReporter { // The constructor has to accept "const ContextOptions&" as a single argument // which has most of the options for the run + a pointer to the stdout stream // Reporter(const ContextOptions& in) // called when a query should be reported (listing test cases, printing the version, etc.) virtual void report_query(const QueryData&) = 0; // called when the whole test run starts virtual void test_run_start() = 0; // called when the whole test run ends (caching a pointer to the input doesn't make sense here) virtual void test_run_end(const TestRunStats&) = 0; // called when a test case is started (safe to cache a pointer to the input) virtual void test_case_start(const TestCaseData&) = 0; // called when a test case is reentered because of unfinished subcases (safe to cache a pointer to the input) virtual void test_case_reenter(const TestCaseData&) = 0; // called when a test case has ended virtual void test_case_end(const CurrentTestCaseStats&) = 0; // called when an exception is thrown from the test case (or it crashes) virtual void test_case_exception(const TestCaseException&) = 0; // called whenever a subcase is entered (don't cache pointers to the input) virtual void subcase_start(const SubcaseSignature&) = 0; // called whenever a subcase is exited (don't cache pointers to the input) virtual void subcase_end() = 0; // called for each assert (don't cache pointers to the input) virtual void log_assert(const AssertData&) = 0; // called for each message (don't cache pointers to the input) virtual void log_message(const MessageData&) = 0; // called when a test case is skipped either because it doesn't pass the filters, has a skip decorator // or isn't in the execution range (between first and last) (safe to cache a pointer to the input) virtual void test_case_skipped(const TestCaseData&) = 0; // doctest will not be managing the lifetimes of reporters given to it but this would still be nice to have virtual ~IReporter(); // can obtain all currently active contexts and stringify them if one wishes to do so static int get_num_active_contexts(); static const IContextScope* const* get_active_contexts(); // can iterate through contexts which have been stringified automatically in their destructors when an exception has been thrown static int get_num_stringified_contexts(); static const String* get_stringified_contexts(); }; namespace detail { typedef IReporter* (*reporterCreatorFunc)(const ContextOptions&); DOCTEST_INTERFACE void registerReporterImpl(const char* name, int prio, reporterCreatorFunc c, bool isReporter); template IReporter* reporterCreator(const ContextOptions& o) { return new Reporter(o); } } // namespace detail template int registerReporter(const char* name, int priority, bool isReporter) { detail::registerReporterImpl(name, priority, detail::reporterCreator, isReporter); return 0; } } // namespace doctest // if registering is not disabled #if !defined(DOCTEST_CONFIG_DISABLE) // common code in asserts - for convenience #define DOCTEST_ASSERT_LOG_REACT_RETURN(b) \ if(b.log()) \ DOCTEST_BREAK_INTO_DEBUGGER(); \ b.react(); \ return !b.m_failed #ifdef DOCTEST_CONFIG_NO_TRY_CATCH_IN_ASSERTS #define DOCTEST_WRAP_IN_TRY(x) x; #else // DOCTEST_CONFIG_NO_TRY_CATCH_IN_ASSERTS #define DOCTEST_WRAP_IN_TRY(x) \ try { \ x; \ } catch(...) { DOCTEST_RB.translateException(); } #endif // DOCTEST_CONFIG_NO_TRY_CATCH_IN_ASSERTS #ifdef DOCTEST_CONFIG_VOID_CAST_EXPRESSIONS #define DOCTEST_CAST_TO_VOID(...) \ DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH("-Wuseless-cast") \ static_cast(__VA_ARGS__); \ DOCTEST_GCC_SUPPRESS_WARNING_POP #else // DOCTEST_CONFIG_VOID_CAST_EXPRESSIONS #define DOCTEST_CAST_TO_VOID(...) __VA_ARGS__; #endif // DOCTEST_CONFIG_VOID_CAST_EXPRESSIONS // registers the test by initializing a dummy var with a function #define DOCTEST_REGISTER_FUNCTION(global_prefix, f, decorators) \ global_prefix DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_ANONYMOUS(DOCTEST_ANON_VAR_), \ doctest::detail::regTest( \ doctest::detail::TestCase( \ f, __FILE__, __LINE__, \ doctest_detail_test_suite_ns::getCurrentTestSuite()) * \ decorators)) #define DOCTEST_IMPLEMENT_FIXTURE(der, base, func, decorators) \ namespace { \ struct der : public base \ { \ void f(); \ }; \ static void func() { \ der v; \ v.f(); \ } \ DOCTEST_REGISTER_FUNCTION(DOCTEST_EMPTY, func, decorators) \ } \ inline DOCTEST_NOINLINE void der::f() #define DOCTEST_CREATE_AND_REGISTER_FUNCTION(f, decorators) \ static void f(); \ DOCTEST_REGISTER_FUNCTION(DOCTEST_EMPTY, f, decorators) \ static void f() #define DOCTEST_CREATE_AND_REGISTER_FUNCTION_IN_CLASS(f, proxy, decorators) \ static doctest::detail::funcType proxy() { return f; } \ DOCTEST_REGISTER_FUNCTION(inline, proxy(), decorators) \ static void f() // for registering tests #define DOCTEST_TEST_CASE(decorators) \ DOCTEST_CREATE_AND_REGISTER_FUNCTION(DOCTEST_ANONYMOUS(DOCTEST_ANON_FUNC_), decorators) // for registering tests in classes - requires C++17 for inline variables! #if __cplusplus >= 201703L || (DOCTEST_MSVC >= DOCTEST_COMPILER(19, 12, 0) && _MSVC_LANG >= 201703L) #define DOCTEST_TEST_CASE_CLASS(decorators) \ DOCTEST_CREATE_AND_REGISTER_FUNCTION_IN_CLASS(DOCTEST_ANONYMOUS(DOCTEST_ANON_FUNC_), \ DOCTEST_ANONYMOUS(DOCTEST_ANON_PROXY_), \ decorators) #else // DOCTEST_TEST_CASE_CLASS #define DOCTEST_TEST_CASE_CLASS(...) \ TEST_CASES_CAN_BE_REGISTERED_IN_CLASSES_ONLY_IN_CPP17_MODE_OR_WITH_VS_2017_OR_NEWER #endif // DOCTEST_TEST_CASE_CLASS // for registering tests with a fixture #define DOCTEST_TEST_CASE_FIXTURE(c, decorators) \ DOCTEST_IMPLEMENT_FIXTURE(DOCTEST_ANONYMOUS(DOCTEST_ANON_CLASS_), c, \ DOCTEST_ANONYMOUS(DOCTEST_ANON_FUNC_), decorators) // for converting types to strings without the header and demangling #define DOCTEST_TYPE_TO_STRING_IMPL(...) \ template <> \ inline const char* type_to_string<__VA_ARGS__>() { \ return "<" #__VA_ARGS__ ">"; \ } #define DOCTEST_TYPE_TO_STRING(...) \ namespace doctest { namespace detail { \ DOCTEST_TYPE_TO_STRING_IMPL(__VA_ARGS__) \ } \ } \ static_assert(true, "") #define DOCTEST_TEST_CASE_TEMPLATE_DEFINE_IMPL(dec, T, iter, func) \ template \ static void func(); \ namespace { \ template \ struct iter; \ template \ struct iter> \ { \ iter(const char* file, unsigned line, int index) { \ doctest::detail::regTest(doctest::detail::TestCase(func, file, line, \ doctest_detail_test_suite_ns::getCurrentTestSuite(), \ doctest::detail::type_to_string(), \ int(line) * 1000 + index) \ * dec); \ iter>(file, line, index + 1); \ } \ }; \ template <> \ struct iter> \ { \ iter(const char*, unsigned, int) {} \ }; \ } \ template \ static void func() #define DOCTEST_TEST_CASE_TEMPLATE_DEFINE(dec, T, id) \ DOCTEST_TEST_CASE_TEMPLATE_DEFINE_IMPL(dec, T, DOCTEST_CAT(id, ITERATOR), \ DOCTEST_ANONYMOUS(DOCTEST_ANON_TMP_)) #define DOCTEST_TEST_CASE_TEMPLATE_INSTANTIATE_IMPL(id, anon, ...) \ DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_CAT(anon, DUMMY), \ doctest::detail::instantiationHelper( \ DOCTEST_CAT(id, ITERATOR)<__VA_ARGS__>(__FILE__, __LINE__, 0))) #define DOCTEST_TEST_CASE_TEMPLATE_INVOKE(id, ...) \ DOCTEST_TEST_CASE_TEMPLATE_INSTANTIATE_IMPL(id, DOCTEST_ANONYMOUS(DOCTEST_ANON_TMP_), std::tuple<__VA_ARGS__>) \ static_assert(true, "") #define DOCTEST_TEST_CASE_TEMPLATE_APPLY(id, ...) \ DOCTEST_TEST_CASE_TEMPLATE_INSTANTIATE_IMPL(id, DOCTEST_ANONYMOUS(DOCTEST_ANON_TMP_), __VA_ARGS__) \ static_assert(true, "") #define DOCTEST_TEST_CASE_TEMPLATE_IMPL(dec, T, anon, ...) \ DOCTEST_TEST_CASE_TEMPLATE_DEFINE_IMPL(dec, T, DOCTEST_CAT(anon, ITERATOR), anon); \ DOCTEST_TEST_CASE_TEMPLATE_INSTANTIATE_IMPL(anon, anon, std::tuple<__VA_ARGS__>) \ template \ static void anon() #define DOCTEST_TEST_CASE_TEMPLATE(dec, T, ...) \ DOCTEST_TEST_CASE_TEMPLATE_IMPL(dec, T, DOCTEST_ANONYMOUS(DOCTEST_ANON_TMP_), __VA_ARGS__) // for subcases #define DOCTEST_SUBCASE(name) \ if(const doctest::detail::Subcase & DOCTEST_ANONYMOUS(DOCTEST_ANON_SUBCASE_) DOCTEST_UNUSED = \ doctest::detail::Subcase(name, __FILE__, __LINE__)) // for grouping tests in test suites by using code blocks #define DOCTEST_TEST_SUITE_IMPL(decorators, ns_name) \ namespace ns_name { namespace doctest_detail_test_suite_ns { \ static DOCTEST_NOINLINE doctest::detail::TestSuite& getCurrentTestSuite() { \ DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(4640) \ DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wexit-time-destructors") \ DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH("-Wmissing-field-initializers") \ static doctest::detail::TestSuite data{}; \ static bool inited = false; \ DOCTEST_MSVC_SUPPRESS_WARNING_POP \ DOCTEST_CLANG_SUPPRESS_WARNING_POP \ DOCTEST_GCC_SUPPRESS_WARNING_POP \ if(!inited) { \ data* decorators; \ inited = true; \ } \ return data; \ } \ } \ } \ namespace ns_name #define DOCTEST_TEST_SUITE(decorators) \ DOCTEST_TEST_SUITE_IMPL(decorators, DOCTEST_ANONYMOUS(DOCTEST_ANON_SUITE_)) // for starting a testsuite block #define DOCTEST_TEST_SUITE_BEGIN(decorators) \ DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_ANONYMOUS(DOCTEST_ANON_VAR_), \ doctest::detail::setTestSuite(doctest::detail::TestSuite() * decorators)) \ static_assert(true, "") // for ending a testsuite block #define DOCTEST_TEST_SUITE_END \ DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_ANONYMOUS(DOCTEST_ANON_VAR_), \ doctest::detail::setTestSuite(doctest::detail::TestSuite() * "")) \ typedef int DOCTEST_ANONYMOUS(DOCTEST_ANON_FOR_SEMICOLON_) // for registering exception translators #define DOCTEST_REGISTER_EXCEPTION_TRANSLATOR_IMPL(translatorName, signature) \ inline doctest::String translatorName(signature); \ DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_ANONYMOUS(DOCTEST_ANON_TRANSLATOR_), \ doctest::registerExceptionTranslator(translatorName)) \ doctest::String translatorName(signature) #define DOCTEST_REGISTER_EXCEPTION_TRANSLATOR(signature) \ DOCTEST_REGISTER_EXCEPTION_TRANSLATOR_IMPL(DOCTEST_ANONYMOUS(DOCTEST_ANON_TRANSLATOR_), \ signature) // for registering reporters #define DOCTEST_REGISTER_REPORTER(name, priority, reporter) \ DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_ANONYMOUS(DOCTEST_ANON_REPORTER_), \ doctest::registerReporter(name, priority, true)) \ static_assert(true, "") // for registering listeners #define DOCTEST_REGISTER_LISTENER(name, priority, reporter) \ DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_ANONYMOUS(DOCTEST_ANON_REPORTER_), \ doctest::registerReporter(name, priority, false)) \ static_assert(true, "") // clang-format off // for logging - disabling formatting because it's important to have these on 2 separate lines - see PR #557 #define DOCTEST_INFO(...) \ DOCTEST_INFO_IMPL(DOCTEST_ANONYMOUS(DOCTEST_CAPTURE_), \ DOCTEST_ANONYMOUS(DOCTEST_CAPTURE_OTHER_), \ __VA_ARGS__) // clang-format on #define DOCTEST_INFO_IMPL(mb_name, s_name, ...) \ auto DOCTEST_ANONYMOUS(DOCTEST_CAPTURE_) = doctest::detail::MakeContextScope( \ [&](std::ostream* s_name) { \ doctest::detail::MessageBuilder mb_name(__FILE__, __LINE__, doctest::assertType::is_warn); \ mb_name.m_stream = s_name; \ mb_name * __VA_ARGS__; \ }) #define DOCTEST_CAPTURE(x) DOCTEST_INFO(#x " := ", x) #define DOCTEST_ADD_AT_IMPL(type, file, line, mb, ...) \ [&] { \ doctest::detail::MessageBuilder mb(file, line, doctest::assertType::type); \ mb * __VA_ARGS__; \ if(mb.log()) \ DOCTEST_BREAK_INTO_DEBUGGER(); \ mb.react(); \ }() // clang-format off #define DOCTEST_ADD_MESSAGE_AT(file, line, ...) DOCTEST_ADD_AT_IMPL(is_warn, file, line, DOCTEST_ANONYMOUS(DOCTEST_MESSAGE_), __VA_ARGS__) #define DOCTEST_ADD_FAIL_CHECK_AT(file, line, ...) DOCTEST_ADD_AT_IMPL(is_check, file, line, DOCTEST_ANONYMOUS(DOCTEST_MESSAGE_), __VA_ARGS__) #define DOCTEST_ADD_FAIL_AT(file, line, ...) DOCTEST_ADD_AT_IMPL(is_require, file, line, DOCTEST_ANONYMOUS(DOCTEST_MESSAGE_), __VA_ARGS__) // clang-format on #define DOCTEST_MESSAGE(...) DOCTEST_ADD_MESSAGE_AT(__FILE__, __LINE__, __VA_ARGS__) #define DOCTEST_FAIL_CHECK(...) DOCTEST_ADD_FAIL_CHECK_AT(__FILE__, __LINE__, __VA_ARGS__) #define DOCTEST_FAIL(...) DOCTEST_ADD_FAIL_AT(__FILE__, __LINE__, __VA_ARGS__) #define DOCTEST_TO_LVALUE(...) __VA_ARGS__ // Not removed to keep backwards compatibility. #ifndef DOCTEST_CONFIG_SUPER_FAST_ASSERTS #define DOCTEST_ASSERT_IMPLEMENT_2(assert_type, ...) \ DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Woverloaded-shift-op-parentheses") \ doctest::detail::ResultBuilder DOCTEST_RB(doctest::assertType::assert_type, __FILE__, \ __LINE__, #__VA_ARGS__); \ DOCTEST_WRAP_IN_TRY(DOCTEST_RB.setResult( \ doctest::detail::ExpressionDecomposer(doctest::assertType::assert_type) \ << __VA_ARGS__)) \ DOCTEST_ASSERT_LOG_REACT_RETURN(DOCTEST_RB) \ DOCTEST_CLANG_SUPPRESS_WARNING_POP #define DOCTEST_ASSERT_IMPLEMENT_1(assert_type, ...) \ [&] { \ DOCTEST_ASSERT_IMPLEMENT_2(assert_type, __VA_ARGS__); \ }() #else // DOCTEST_CONFIG_SUPER_FAST_ASSERTS // necessary for _MESSAGE #define DOCTEST_ASSERT_IMPLEMENT_2 DOCTEST_ASSERT_IMPLEMENT_1 #define DOCTEST_ASSERT_IMPLEMENT_1(assert_type, ...) \ DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Woverloaded-shift-op-parentheses") \ doctest::detail::decomp_assert( \ doctest::assertType::assert_type, __FILE__, __LINE__, #__VA_ARGS__, \ doctest::detail::ExpressionDecomposer(doctest::assertType::assert_type) \ << __VA_ARGS__) DOCTEST_CLANG_SUPPRESS_WARNING_POP #endif // DOCTEST_CONFIG_SUPER_FAST_ASSERTS #define DOCTEST_WARN(...) DOCTEST_ASSERT_IMPLEMENT_1(DT_WARN, __VA_ARGS__) #define DOCTEST_CHECK(...) DOCTEST_ASSERT_IMPLEMENT_1(DT_CHECK, __VA_ARGS__) #define DOCTEST_REQUIRE(...) DOCTEST_ASSERT_IMPLEMENT_1(DT_REQUIRE, __VA_ARGS__) #define DOCTEST_WARN_FALSE(...) DOCTEST_ASSERT_IMPLEMENT_1(DT_WARN_FALSE, __VA_ARGS__) #define DOCTEST_CHECK_FALSE(...) DOCTEST_ASSERT_IMPLEMENT_1(DT_CHECK_FALSE, __VA_ARGS__) #define DOCTEST_REQUIRE_FALSE(...) DOCTEST_ASSERT_IMPLEMENT_1(DT_REQUIRE_FALSE, __VA_ARGS__) // clang-format off #define DOCTEST_WARN_MESSAGE(cond, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_ASSERT_IMPLEMENT_2(DT_WARN, cond); }() #define DOCTEST_CHECK_MESSAGE(cond, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_ASSERT_IMPLEMENT_2(DT_CHECK, cond); }() #define DOCTEST_REQUIRE_MESSAGE(cond, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_ASSERT_IMPLEMENT_2(DT_REQUIRE, cond); }() #define DOCTEST_WARN_FALSE_MESSAGE(cond, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_ASSERT_IMPLEMENT_2(DT_WARN_FALSE, cond); }() #define DOCTEST_CHECK_FALSE_MESSAGE(cond, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_ASSERT_IMPLEMENT_2(DT_CHECK_FALSE, cond); }() #define DOCTEST_REQUIRE_FALSE_MESSAGE(cond, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_ASSERT_IMPLEMENT_2(DT_REQUIRE_FALSE, cond); }() // clang-format on #define DOCTEST_ASSERT_THROWS_AS(expr, assert_type, message, ...) \ [&] { \ if(!doctest::getContextOptions()->no_throw) { \ doctest::detail::ResultBuilder DOCTEST_RB(doctest::assertType::assert_type, __FILE__, \ __LINE__, #expr, #__VA_ARGS__, message); \ try { \ DOCTEST_CAST_TO_VOID(expr) \ } catch(const typename doctest::detail::remove_const< \ typename doctest::detail::remove_reference<__VA_ARGS__>::type>::type&) { \ DOCTEST_RB.translateException(); \ DOCTEST_RB.m_threw_as = true; \ } catch(...) { DOCTEST_RB.translateException(); } \ DOCTEST_ASSERT_LOG_REACT_RETURN(DOCTEST_RB); \ } else { \ return false; \ } \ }() #define DOCTEST_ASSERT_THROWS_WITH(expr, expr_str, assert_type, ...) \ [&] { \ if(!doctest::getContextOptions()->no_throw) { \ doctest::detail::ResultBuilder DOCTEST_RB(doctest::assertType::assert_type, __FILE__, \ __LINE__, expr_str, "", __VA_ARGS__); \ try { \ DOCTEST_CAST_TO_VOID(expr) \ } catch(...) { DOCTEST_RB.translateException(); } \ DOCTEST_ASSERT_LOG_REACT_RETURN(DOCTEST_RB); \ } else { \ return false; \ } \ }() #define DOCTEST_ASSERT_NOTHROW(assert_type, ...) \ [&] { \ doctest::detail::ResultBuilder DOCTEST_RB(doctest::assertType::assert_type, __FILE__, \ __LINE__, #__VA_ARGS__); \ try { \ DOCTEST_CAST_TO_VOID(__VA_ARGS__) \ } catch(...) { DOCTEST_RB.translateException(); } \ DOCTEST_ASSERT_LOG_REACT_RETURN(DOCTEST_RB); \ }() // clang-format off #define DOCTEST_WARN_THROWS(...) DOCTEST_ASSERT_THROWS_WITH((__VA_ARGS__), #__VA_ARGS__, DT_WARN_THROWS, "") #define DOCTEST_CHECK_THROWS(...) DOCTEST_ASSERT_THROWS_WITH((__VA_ARGS__), #__VA_ARGS__, DT_CHECK_THROWS, "") #define DOCTEST_REQUIRE_THROWS(...) DOCTEST_ASSERT_THROWS_WITH((__VA_ARGS__), #__VA_ARGS__, DT_REQUIRE_THROWS, "") #define DOCTEST_WARN_THROWS_AS(expr, ...) DOCTEST_ASSERT_THROWS_AS(expr, DT_WARN_THROWS_AS, "", __VA_ARGS__) #define DOCTEST_CHECK_THROWS_AS(expr, ...) DOCTEST_ASSERT_THROWS_AS(expr, DT_CHECK_THROWS_AS, "", __VA_ARGS__) #define DOCTEST_REQUIRE_THROWS_AS(expr, ...) DOCTEST_ASSERT_THROWS_AS(expr, DT_REQUIRE_THROWS_AS, "", __VA_ARGS__) #define DOCTEST_WARN_THROWS_WITH(expr, ...) DOCTEST_ASSERT_THROWS_WITH(expr, #expr, DT_WARN_THROWS_WITH, __VA_ARGS__) #define DOCTEST_CHECK_THROWS_WITH(expr, ...) DOCTEST_ASSERT_THROWS_WITH(expr, #expr, DT_CHECK_THROWS_WITH, __VA_ARGS__) #define DOCTEST_REQUIRE_THROWS_WITH(expr, ...) DOCTEST_ASSERT_THROWS_WITH(expr, #expr, DT_REQUIRE_THROWS_WITH, __VA_ARGS__) #define DOCTEST_WARN_THROWS_WITH_AS(expr, message, ...) DOCTEST_ASSERT_THROWS_AS(expr, DT_WARN_THROWS_WITH_AS, message, __VA_ARGS__) #define DOCTEST_CHECK_THROWS_WITH_AS(expr, message, ...) DOCTEST_ASSERT_THROWS_AS(expr, DT_CHECK_THROWS_WITH_AS, message, __VA_ARGS__) #define DOCTEST_REQUIRE_THROWS_WITH_AS(expr, message, ...) DOCTEST_ASSERT_THROWS_AS(expr, DT_REQUIRE_THROWS_WITH_AS, message, __VA_ARGS__) #define DOCTEST_WARN_NOTHROW(...) DOCTEST_ASSERT_NOTHROW(DT_WARN_NOTHROW, __VA_ARGS__) #define DOCTEST_CHECK_NOTHROW(...) DOCTEST_ASSERT_NOTHROW(DT_CHECK_NOTHROW, __VA_ARGS__) #define DOCTEST_REQUIRE_NOTHROW(...) DOCTEST_ASSERT_NOTHROW(DT_REQUIRE_NOTHROW, __VA_ARGS__) #define DOCTEST_WARN_THROWS_MESSAGE(expr, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_WARN_THROWS(expr); }() #define DOCTEST_CHECK_THROWS_MESSAGE(expr, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_CHECK_THROWS(expr); }() #define DOCTEST_REQUIRE_THROWS_MESSAGE(expr, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_REQUIRE_THROWS(expr); }() #define DOCTEST_WARN_THROWS_AS_MESSAGE(expr, ex, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_WARN_THROWS_AS(expr, ex); }() #define DOCTEST_CHECK_THROWS_AS_MESSAGE(expr, ex, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_CHECK_THROWS_AS(expr, ex); }() #define DOCTEST_REQUIRE_THROWS_AS_MESSAGE(expr, ex, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_REQUIRE_THROWS_AS(expr, ex); }() #define DOCTEST_WARN_THROWS_WITH_MESSAGE(expr, with, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_WARN_THROWS_WITH(expr, with); }() #define DOCTEST_CHECK_THROWS_WITH_MESSAGE(expr, with, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_CHECK_THROWS_WITH(expr, with); }() #define DOCTEST_REQUIRE_THROWS_WITH_MESSAGE(expr, with, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_REQUIRE_THROWS_WITH(expr, with); }() #define DOCTEST_WARN_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_WARN_THROWS_WITH_AS(expr, with, ex); }() #define DOCTEST_CHECK_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_CHECK_THROWS_WITH_AS(expr, with, ex); }() #define DOCTEST_REQUIRE_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_REQUIRE_THROWS_WITH_AS(expr, with, ex); }() #define DOCTEST_WARN_NOTHROW_MESSAGE(expr, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_WARN_NOTHROW(expr); }() #define DOCTEST_CHECK_NOTHROW_MESSAGE(expr, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_CHECK_NOTHROW(expr); }() #define DOCTEST_REQUIRE_NOTHROW_MESSAGE(expr, ...) [&] {DOCTEST_INFO(__VA_ARGS__); DOCTEST_REQUIRE_NOTHROW(expr); }() // clang-format on #ifndef DOCTEST_CONFIG_SUPER_FAST_ASSERTS #define DOCTEST_BINARY_ASSERT(assert_type, comp, ...) \ [&] { \ doctest::detail::ResultBuilder DOCTEST_RB(doctest::assertType::assert_type, __FILE__, \ __LINE__, #__VA_ARGS__); \ DOCTEST_WRAP_IN_TRY( \ DOCTEST_RB.binary_assert( \ __VA_ARGS__)) \ DOCTEST_ASSERT_LOG_REACT_RETURN(DOCTEST_RB); \ }() #define DOCTEST_UNARY_ASSERT(assert_type, ...) \ [&] { \ doctest::detail::ResultBuilder DOCTEST_RB(doctest::assertType::assert_type, __FILE__, \ __LINE__, #__VA_ARGS__); \ DOCTEST_WRAP_IN_TRY(DOCTEST_RB.unary_assert(__VA_ARGS__)) \ DOCTEST_ASSERT_LOG_REACT_RETURN(DOCTEST_RB); \ }() #else // DOCTEST_CONFIG_SUPER_FAST_ASSERTS #define DOCTEST_BINARY_ASSERT(assert_type, comparison, ...) \ doctest::detail::binary_assert( \ doctest::assertType::assert_type, __FILE__, __LINE__, #__VA_ARGS__, __VA_ARGS__) #define DOCTEST_UNARY_ASSERT(assert_type, ...) \ doctest::detail::unary_assert(doctest::assertType::assert_type, __FILE__, __LINE__, \ #__VA_ARGS__, __VA_ARGS__) #endif // DOCTEST_CONFIG_SUPER_FAST_ASSERTS #define DOCTEST_WARN_EQ(...) DOCTEST_BINARY_ASSERT(DT_WARN_EQ, eq, __VA_ARGS__) #define DOCTEST_CHECK_EQ(...) DOCTEST_BINARY_ASSERT(DT_CHECK_EQ, eq, __VA_ARGS__) #define DOCTEST_REQUIRE_EQ(...) DOCTEST_BINARY_ASSERT(DT_REQUIRE_EQ, eq, __VA_ARGS__) #define DOCTEST_WARN_NE(...) DOCTEST_BINARY_ASSERT(DT_WARN_NE, ne, __VA_ARGS__) #define DOCTEST_CHECK_NE(...) DOCTEST_BINARY_ASSERT(DT_CHECK_NE, ne, __VA_ARGS__) #define DOCTEST_REQUIRE_NE(...) DOCTEST_BINARY_ASSERT(DT_REQUIRE_NE, ne, __VA_ARGS__) #define DOCTEST_WARN_GT(...) DOCTEST_BINARY_ASSERT(DT_WARN_GT, gt, __VA_ARGS__) #define DOCTEST_CHECK_GT(...) DOCTEST_BINARY_ASSERT(DT_CHECK_GT, gt, __VA_ARGS__) #define DOCTEST_REQUIRE_GT(...) DOCTEST_BINARY_ASSERT(DT_REQUIRE_GT, gt, __VA_ARGS__) #define DOCTEST_WARN_LT(...) DOCTEST_BINARY_ASSERT(DT_WARN_LT, lt, __VA_ARGS__) #define DOCTEST_CHECK_LT(...) DOCTEST_BINARY_ASSERT(DT_CHECK_LT, lt, __VA_ARGS__) #define DOCTEST_REQUIRE_LT(...) DOCTEST_BINARY_ASSERT(DT_REQUIRE_LT, lt, __VA_ARGS__) #define DOCTEST_WARN_GE(...) DOCTEST_BINARY_ASSERT(DT_WARN_GE, ge, __VA_ARGS__) #define DOCTEST_CHECK_GE(...) DOCTEST_BINARY_ASSERT(DT_CHECK_GE, ge, __VA_ARGS__) #define DOCTEST_REQUIRE_GE(...) DOCTEST_BINARY_ASSERT(DT_REQUIRE_GE, ge, __VA_ARGS__) #define DOCTEST_WARN_LE(...) DOCTEST_BINARY_ASSERT(DT_WARN_LE, le, __VA_ARGS__) #define DOCTEST_CHECK_LE(...) DOCTEST_BINARY_ASSERT(DT_CHECK_LE, le, __VA_ARGS__) #define DOCTEST_REQUIRE_LE(...) DOCTEST_BINARY_ASSERT(DT_REQUIRE_LE, le, __VA_ARGS__) #define DOCTEST_WARN_UNARY(...) DOCTEST_UNARY_ASSERT(DT_WARN_UNARY, __VA_ARGS__) #define DOCTEST_CHECK_UNARY(...) DOCTEST_UNARY_ASSERT(DT_CHECK_UNARY, __VA_ARGS__) #define DOCTEST_REQUIRE_UNARY(...) DOCTEST_UNARY_ASSERT(DT_REQUIRE_UNARY, __VA_ARGS__) #define DOCTEST_WARN_UNARY_FALSE(...) DOCTEST_UNARY_ASSERT(DT_WARN_UNARY_FALSE, __VA_ARGS__) #define DOCTEST_CHECK_UNARY_FALSE(...) DOCTEST_UNARY_ASSERT(DT_CHECK_UNARY_FALSE, __VA_ARGS__) #define DOCTEST_REQUIRE_UNARY_FALSE(...) DOCTEST_UNARY_ASSERT(DT_REQUIRE_UNARY_FALSE, __VA_ARGS__) #ifdef DOCTEST_CONFIG_NO_EXCEPTIONS #undef DOCTEST_WARN_THROWS #undef DOCTEST_CHECK_THROWS #undef DOCTEST_REQUIRE_THROWS #undef DOCTEST_WARN_THROWS_AS #undef DOCTEST_CHECK_THROWS_AS #undef DOCTEST_REQUIRE_THROWS_AS #undef DOCTEST_WARN_THROWS_WITH #undef DOCTEST_CHECK_THROWS_WITH #undef DOCTEST_REQUIRE_THROWS_WITH #undef DOCTEST_WARN_THROWS_WITH_AS #undef DOCTEST_CHECK_THROWS_WITH_AS #undef DOCTEST_REQUIRE_THROWS_WITH_AS #undef DOCTEST_WARN_NOTHROW #undef DOCTEST_CHECK_NOTHROW #undef DOCTEST_REQUIRE_NOTHROW #undef DOCTEST_WARN_THROWS_MESSAGE #undef DOCTEST_CHECK_THROWS_MESSAGE #undef DOCTEST_REQUIRE_THROWS_MESSAGE #undef DOCTEST_WARN_THROWS_AS_MESSAGE #undef DOCTEST_CHECK_THROWS_AS_MESSAGE #undef DOCTEST_REQUIRE_THROWS_AS_MESSAGE #undef DOCTEST_WARN_THROWS_WITH_MESSAGE #undef DOCTEST_CHECK_THROWS_WITH_MESSAGE #undef DOCTEST_REQUIRE_THROWS_WITH_MESSAGE #undef DOCTEST_WARN_THROWS_WITH_AS_MESSAGE #undef DOCTEST_CHECK_THROWS_WITH_AS_MESSAGE #undef DOCTEST_REQUIRE_THROWS_WITH_AS_MESSAGE #undef DOCTEST_WARN_NOTHROW_MESSAGE #undef DOCTEST_CHECK_NOTHROW_MESSAGE #undef DOCTEST_REQUIRE_NOTHROW_MESSAGE #ifdef DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS #define DOCTEST_WARN_THROWS(...) ([] { return false; }) #define DOCTEST_CHECK_THROWS(...) ([] { return false; }) #define DOCTEST_REQUIRE_THROWS(...) ([] { return false; }) #define DOCTEST_WARN_THROWS_AS(expr, ...) ([] { return false; }) #define DOCTEST_CHECK_THROWS_AS(expr, ...) ([] { return false; }) #define DOCTEST_REQUIRE_THROWS_AS(expr, ...) ([] { return false; }) #define DOCTEST_WARN_THROWS_WITH(expr, ...) ([] { return false; }) #define DOCTEST_CHECK_THROWS_WITH(expr, ...) ([] { return false; }) #define DOCTEST_REQUIRE_THROWS_WITH(expr, ...) ([] { return false; }) #define DOCTEST_WARN_THROWS_WITH_AS(expr, with, ...) ([] { return false; }) #define DOCTEST_CHECK_THROWS_WITH_AS(expr, with, ...) ([] { return false; }) #define DOCTEST_REQUIRE_THROWS_WITH_AS(expr, with, ...) ([] { return false; }) #define DOCTEST_WARN_NOTHROW(...) ([] { return false; }) #define DOCTEST_CHECK_NOTHROW(...) ([] { return false; }) #define DOCTEST_REQUIRE_NOTHROW(...) ([] { return false; }) #define DOCTEST_WARN_THROWS_MESSAGE(expr, ...) ([] { return false; }) #define DOCTEST_CHECK_THROWS_MESSAGE(expr, ...) ([] { return false; }) #define DOCTEST_REQUIRE_THROWS_MESSAGE(expr, ...) ([] { return false; }) #define DOCTEST_WARN_THROWS_AS_MESSAGE(expr, ex, ...) ([] { return false; }) #define DOCTEST_CHECK_THROWS_AS_MESSAGE(expr, ex, ...) ([] { return false; }) #define DOCTEST_REQUIRE_THROWS_AS_MESSAGE(expr, ex, ...) ([] { return false; }) #define DOCTEST_WARN_THROWS_WITH_MESSAGE(expr, with, ...) ([] { return false; }) #define DOCTEST_CHECK_THROWS_WITH_MESSAGE(expr, with, ...) ([] { return false; }) #define DOCTEST_REQUIRE_THROWS_WITH_MESSAGE(expr, with, ...) ([] { return false; }) #define DOCTEST_WARN_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) ([] { return false; }) #define DOCTEST_CHECK_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) ([] { return false; }) #define DOCTEST_REQUIRE_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) ([] { return false; }) #define DOCTEST_WARN_NOTHROW_MESSAGE(expr, ...) ([] { return false; }) #define DOCTEST_CHECK_NOTHROW_MESSAGE(expr, ...) ([] { return false; }) #define DOCTEST_REQUIRE_NOTHROW_MESSAGE(expr, ...) ([] { return false; }) #else // DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS #undef DOCTEST_REQUIRE #undef DOCTEST_REQUIRE_FALSE #undef DOCTEST_REQUIRE_MESSAGE #undef DOCTEST_REQUIRE_FALSE_MESSAGE #undef DOCTEST_REQUIRE_EQ #undef DOCTEST_REQUIRE_NE #undef DOCTEST_REQUIRE_GT #undef DOCTEST_REQUIRE_LT #undef DOCTEST_REQUIRE_GE #undef DOCTEST_REQUIRE_LE #undef DOCTEST_REQUIRE_UNARY #undef DOCTEST_REQUIRE_UNARY_FALSE #endif // DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS #endif // DOCTEST_CONFIG_NO_EXCEPTIONS // ================================================================================================= // == WHAT FOLLOWS IS VERSIONS OF THE MACROS THAT DO NOT DO ANY REGISTERING! == // == THIS CAN BE ENABLED BY DEFINING DOCTEST_CONFIG_DISABLE GLOBALLY! == // ================================================================================================= #else // DOCTEST_CONFIG_DISABLE #define DOCTEST_IMPLEMENT_FIXTURE(der, base, func, name) \ namespace { \ template \ struct der : public base \ { void f(); }; \ } \ template \ inline void der::f() #define DOCTEST_CREATE_AND_REGISTER_FUNCTION(f, name) \ template \ static inline void f() // for registering tests #define DOCTEST_TEST_CASE(name) \ DOCTEST_CREATE_AND_REGISTER_FUNCTION(DOCTEST_ANONYMOUS(DOCTEST_ANON_FUNC_), name) // for registering tests in classes #define DOCTEST_TEST_CASE_CLASS(name) \ DOCTEST_CREATE_AND_REGISTER_FUNCTION(DOCTEST_ANONYMOUS(DOCTEST_ANON_FUNC_), name) // for registering tests with a fixture #define DOCTEST_TEST_CASE_FIXTURE(x, name) \ DOCTEST_IMPLEMENT_FIXTURE(DOCTEST_ANONYMOUS(DOCTEST_ANON_CLASS_), x, \ DOCTEST_ANONYMOUS(DOCTEST_ANON_FUNC_), name) // for converting types to strings without the header and demangling #define DOCTEST_TYPE_TO_STRING(...) static_assert(true, "") #define DOCTEST_TYPE_TO_STRING_IMPL(...) // for typed tests #define DOCTEST_TEST_CASE_TEMPLATE(name, type, ...) \ template \ inline void DOCTEST_ANONYMOUS(DOCTEST_ANON_TMP_)() #define DOCTEST_TEST_CASE_TEMPLATE_DEFINE(name, type, id) \ template \ inline void DOCTEST_ANONYMOUS(DOCTEST_ANON_TMP_)() #define DOCTEST_TEST_CASE_TEMPLATE_INVOKE(id, ...) static_assert(true, "") #define DOCTEST_TEST_CASE_TEMPLATE_APPLY(id, ...) static_assert(true, "") // for subcases #define DOCTEST_SUBCASE(name) // for a testsuite block #define DOCTEST_TEST_SUITE(name) namespace // for starting a testsuite block #define DOCTEST_TEST_SUITE_BEGIN(name) static_assert(true, "") // for ending a testsuite block #define DOCTEST_TEST_SUITE_END typedef int DOCTEST_ANONYMOUS(DOCTEST_ANON_FOR_SEMICOLON_) #define DOCTEST_REGISTER_EXCEPTION_TRANSLATOR(signature) \ template \ static inline doctest::String DOCTEST_ANONYMOUS(DOCTEST_ANON_TRANSLATOR_)(signature) #define DOCTEST_REGISTER_REPORTER(name, priority, reporter) #define DOCTEST_REGISTER_LISTENER(name, priority, reporter) #define DOCTEST_INFO(...) (static_cast(0)) #define DOCTEST_CAPTURE(x) (static_cast(0)) #define DOCTEST_ADD_MESSAGE_AT(file, line, ...) (static_cast(0)) #define DOCTEST_ADD_FAIL_CHECK_AT(file, line, ...) (static_cast(0)) #define DOCTEST_ADD_FAIL_AT(file, line, ...) (static_cast(0)) #define DOCTEST_MESSAGE(...) (static_cast(0)) #define DOCTEST_FAIL_CHECK(...) (static_cast(0)) #define DOCTEST_FAIL(...) (static_cast(0)) #ifdef DOCTEST_CONFIG_EVALUATE_ASSERTS_EVEN_WHEN_DISABLED #define DOCTEST_WARN(...) [&] { return __VA_ARGS__; }() #define DOCTEST_CHECK(...) [&] { return __VA_ARGS__; }() #define DOCTEST_REQUIRE(...) [&] { return __VA_ARGS__; }() #define DOCTEST_WARN_FALSE(...) [&] { return !(__VA_ARGS__); }() #define DOCTEST_CHECK_FALSE(...) [&] { return !(__VA_ARGS__); }() #define DOCTEST_REQUIRE_FALSE(...) [&] { return !(__VA_ARGS__); }() #define DOCTEST_WARN_MESSAGE(cond, ...) [&] { return cond; }() #define DOCTEST_CHECK_MESSAGE(cond, ...) [&] { return cond; }() #define DOCTEST_REQUIRE_MESSAGE(cond, ...) [&] { return cond; }() #define DOCTEST_WARN_FALSE_MESSAGE(cond, ...) [&] { return !(cond); }() #define DOCTEST_CHECK_FALSE_MESSAGE(cond, ...) [&] { return !(cond); }() #define DOCTEST_REQUIRE_FALSE_MESSAGE(cond, ...) [&] { return !(cond); }() namespace doctest { namespace detail { #define DOCTEST_RELATIONAL_OP(name, op) \ template \ bool name(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) { return lhs op rhs; } DOCTEST_RELATIONAL_OP(eq, ==) DOCTEST_RELATIONAL_OP(ne, !=) DOCTEST_RELATIONAL_OP(lt, <) DOCTEST_RELATIONAL_OP(gt, >) DOCTEST_RELATIONAL_OP(le, <=) DOCTEST_RELATIONAL_OP(ge, >=) } // namespace detail } // namespace doctest #define DOCTEST_WARN_EQ(...) [&] { return doctest::detail::eq(__VA_ARGS__); }() #define DOCTEST_CHECK_EQ(...) [&] { return doctest::detail::eq(__VA_ARGS__); }() #define DOCTEST_REQUIRE_EQ(...) [&] { return doctest::detail::eq(__VA_ARGS__); }() #define DOCTEST_WARN_NE(...) [&] { return doctest::detail::ne(__VA_ARGS__); }() #define DOCTEST_CHECK_NE(...) [&] { return doctest::detail::ne(__VA_ARGS__); }() #define DOCTEST_REQUIRE_NE(...) [&] { return doctest::detail::ne(__VA_ARGS__); }() #define DOCTEST_WARN_LT(...) [&] { return doctest::detail::lt(__VA_ARGS__); }() #define DOCTEST_CHECK_LT(...) [&] { return doctest::detail::lt(__VA_ARGS__); }() #define DOCTEST_REQUIRE_LT(...) [&] { return doctest::detail::lt(__VA_ARGS__); }() #define DOCTEST_WARN_GT(...) [&] { return doctest::detail::gt(__VA_ARGS__); }() #define DOCTEST_CHECK_GT(...) [&] { return doctest::detail::gt(__VA_ARGS__); }() #define DOCTEST_REQUIRE_GT(...) [&] { return doctest::detail::gt(__VA_ARGS__); }() #define DOCTEST_WARN_LE(...) [&] { return doctest::detail::le(__VA_ARGS__); }() #define DOCTEST_CHECK_LE(...) [&] { return doctest::detail::le(__VA_ARGS__); }() #define DOCTEST_REQUIRE_LE(...) [&] { return doctest::detail::le(__VA_ARGS__); }() #define DOCTEST_WARN_GE(...) [&] { return doctest::detail::ge(__VA_ARGS__); }() #define DOCTEST_CHECK_GE(...) [&] { return doctest::detail::ge(__VA_ARGS__); }() #define DOCTEST_REQUIRE_GE(...) [&] { return doctest::detail::ge(__VA_ARGS__); }() #define DOCTEST_WARN_UNARY(...) [&] { return __VA_ARGS__; }() #define DOCTEST_CHECK_UNARY(...) [&] { return __VA_ARGS__; }() #define DOCTEST_REQUIRE_UNARY(...) [&] { return __VA_ARGS__; }() #define DOCTEST_WARN_UNARY_FALSE(...) [&] { return !(__VA_ARGS__); }() #define DOCTEST_CHECK_UNARY_FALSE(...) [&] { return !(__VA_ARGS__); }() #define DOCTEST_REQUIRE_UNARY_FALSE(...) [&] { return !(__VA_ARGS__); }() #else // DOCTEST_CONFIG_EVALUATE_ASSERTS_EVEN_WHEN_DISABLED #define DOCTEST_WARN(...) ([] { return false; }) #define DOCTEST_CHECK(...) ([] { return false; }) #define DOCTEST_REQUIRE(...) ([] { return false; }) #define DOCTEST_WARN_FALSE(...) ([] { return false; }) #define DOCTEST_CHECK_FALSE(...) ([] { return false; }) #define DOCTEST_REQUIRE_FALSE(...) ([] { return false; }) #define DOCTEST_WARN_MESSAGE(cond, ...) ([] { return false; }) #define DOCTEST_CHECK_MESSAGE(cond, ...) ([] { return false; }) #define DOCTEST_REQUIRE_MESSAGE(cond, ...) ([] { return false; }) #define DOCTEST_WARN_FALSE_MESSAGE(cond, ...) ([] { return false; }) #define DOCTEST_CHECK_FALSE_MESSAGE(cond, ...) ([] { return false; }) #define DOCTEST_REQUIRE_FALSE_MESSAGE(cond, ...) ([] { return false; }) #define DOCTEST_WARN_EQ(...) ([] { return false; }) #define DOCTEST_CHECK_EQ(...) ([] { return false; }) #define DOCTEST_REQUIRE_EQ(...) ([] { return false; }) #define DOCTEST_WARN_NE(...) ([] { return false; }) #define DOCTEST_CHECK_NE(...) ([] { return false; }) #define DOCTEST_REQUIRE_NE(...) ([] { return false; }) #define DOCTEST_WARN_GT(...) ([] { return false; }) #define DOCTEST_CHECK_GT(...) ([] { return false; }) #define DOCTEST_REQUIRE_GT(...) ([] { return false; }) #define DOCTEST_WARN_LT(...) ([] { return false; }) #define DOCTEST_CHECK_LT(...) ([] { return false; }) #define DOCTEST_REQUIRE_LT(...) ([] { return false; }) #define DOCTEST_WARN_GE(...) ([] { return false; }) #define DOCTEST_CHECK_GE(...) ([] { return false; }) #define DOCTEST_REQUIRE_GE(...) ([] { return false; }) #define DOCTEST_WARN_LE(...) ([] { return false; }) #define DOCTEST_CHECK_LE(...) ([] { return false; }) #define DOCTEST_REQUIRE_LE(...) ([] { return false; }) #define DOCTEST_WARN_UNARY(...) ([] { return false; }) #define DOCTEST_CHECK_UNARY(...) ([] { return false; }) #define DOCTEST_REQUIRE_UNARY(...) ([] { return false; }) #define DOCTEST_WARN_UNARY_FALSE(...) ([] { return false; }) #define DOCTEST_CHECK_UNARY_FALSE(...) ([] { return false; }) #define DOCTEST_REQUIRE_UNARY_FALSE(...) ([] { return false; }) #endif // DOCTEST_CONFIG_EVALUATE_ASSERTS_EVEN_WHEN_DISABLED // TODO: think about if these also need to work properly even when doctest is disabled #define DOCTEST_WARN_THROWS(...) ([] { return false; }) #define DOCTEST_CHECK_THROWS(...) ([] { return false; }) #define DOCTEST_REQUIRE_THROWS(...) ([] { return false; }) #define DOCTEST_WARN_THROWS_AS(expr, ...) ([] { return false; }) #define DOCTEST_CHECK_THROWS_AS(expr, ...) ([] { return false; }) #define DOCTEST_REQUIRE_THROWS_AS(expr, ...) ([] { return false; }) #define DOCTEST_WARN_THROWS_WITH(expr, ...) ([] { return false; }) #define DOCTEST_CHECK_THROWS_WITH(expr, ...) ([] { return false; }) #define DOCTEST_REQUIRE_THROWS_WITH(expr, ...) ([] { return false; }) #define DOCTEST_WARN_THROWS_WITH_AS(expr, with, ...) ([] { return false; }) #define DOCTEST_CHECK_THROWS_WITH_AS(expr, with, ...) ([] { return false; }) #define DOCTEST_REQUIRE_THROWS_WITH_AS(expr, with, ...) ([] { return false; }) #define DOCTEST_WARN_NOTHROW(...) ([] { return false; }) #define DOCTEST_CHECK_NOTHROW(...) ([] { return false; }) #define DOCTEST_REQUIRE_NOTHROW(...) ([] { return false; }) #define DOCTEST_WARN_THROWS_MESSAGE(expr, ...) ([] { return false; }) #define DOCTEST_CHECK_THROWS_MESSAGE(expr, ...) ([] { return false; }) #define DOCTEST_REQUIRE_THROWS_MESSAGE(expr, ...) ([] { return false; }) #define DOCTEST_WARN_THROWS_AS_MESSAGE(expr, ex, ...) ([] { return false; }) #define DOCTEST_CHECK_THROWS_AS_MESSAGE(expr, ex, ...) ([] { return false; }) #define DOCTEST_REQUIRE_THROWS_AS_MESSAGE(expr, ex, ...) ([] { return false; }) #define DOCTEST_WARN_THROWS_WITH_MESSAGE(expr, with, ...) ([] { return false; }) #define DOCTEST_CHECK_THROWS_WITH_MESSAGE(expr, with, ...) ([] { return false; }) #define DOCTEST_REQUIRE_THROWS_WITH_MESSAGE(expr, with, ...) ([] { return false; }) #define DOCTEST_WARN_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) ([] { return false; }) #define DOCTEST_CHECK_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) ([] { return false; }) #define DOCTEST_REQUIRE_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) ([] { return false; }) #define DOCTEST_WARN_NOTHROW_MESSAGE(expr, ...) ([] { return false; }) #define DOCTEST_CHECK_NOTHROW_MESSAGE(expr, ...) ([] { return false; }) #define DOCTEST_REQUIRE_NOTHROW_MESSAGE(expr, ...) ([] { return false; }) #endif // DOCTEST_CONFIG_DISABLE // clang-format off // KEPT FOR BACKWARDS COMPATIBILITY - FORWARDING TO THE RIGHT MACROS #define DOCTEST_FAST_WARN_EQ DOCTEST_WARN_EQ #define DOCTEST_FAST_CHECK_EQ DOCTEST_CHECK_EQ #define DOCTEST_FAST_REQUIRE_EQ DOCTEST_REQUIRE_EQ #define DOCTEST_FAST_WARN_NE DOCTEST_WARN_NE #define DOCTEST_FAST_CHECK_NE DOCTEST_CHECK_NE #define DOCTEST_FAST_REQUIRE_NE DOCTEST_REQUIRE_NE #define DOCTEST_FAST_WARN_GT DOCTEST_WARN_GT #define DOCTEST_FAST_CHECK_GT DOCTEST_CHECK_GT #define DOCTEST_FAST_REQUIRE_GT DOCTEST_REQUIRE_GT #define DOCTEST_FAST_WARN_LT DOCTEST_WARN_LT #define DOCTEST_FAST_CHECK_LT DOCTEST_CHECK_LT #define DOCTEST_FAST_REQUIRE_LT DOCTEST_REQUIRE_LT #define DOCTEST_FAST_WARN_GE DOCTEST_WARN_GE #define DOCTEST_FAST_CHECK_GE DOCTEST_CHECK_GE #define DOCTEST_FAST_REQUIRE_GE DOCTEST_REQUIRE_GE #define DOCTEST_FAST_WARN_LE DOCTEST_WARN_LE #define DOCTEST_FAST_CHECK_LE DOCTEST_CHECK_LE #define DOCTEST_FAST_REQUIRE_LE DOCTEST_REQUIRE_LE #define DOCTEST_FAST_WARN_UNARY DOCTEST_WARN_UNARY #define DOCTEST_FAST_CHECK_UNARY DOCTEST_CHECK_UNARY #define DOCTEST_FAST_REQUIRE_UNARY DOCTEST_REQUIRE_UNARY #define DOCTEST_FAST_WARN_UNARY_FALSE DOCTEST_WARN_UNARY_FALSE #define DOCTEST_FAST_CHECK_UNARY_FALSE DOCTEST_CHECK_UNARY_FALSE #define DOCTEST_FAST_REQUIRE_UNARY_FALSE DOCTEST_REQUIRE_UNARY_FALSE #define DOCTEST_TEST_CASE_TEMPLATE_INSTANTIATE(id, ...) DOCTEST_TEST_CASE_TEMPLATE_INVOKE(id,__VA_ARGS__) // clang-format on // BDD style macros // clang-format off #define DOCTEST_SCENARIO(name) DOCTEST_TEST_CASE(" Scenario: " name) #define DOCTEST_SCENARIO_CLASS(name) DOCTEST_TEST_CASE_CLASS(" Scenario: " name) #define DOCTEST_SCENARIO_TEMPLATE(name, T, ...) DOCTEST_TEST_CASE_TEMPLATE(" Scenario: " name, T, __VA_ARGS__) #define DOCTEST_SCENARIO_TEMPLATE_DEFINE(name, T, id) DOCTEST_TEST_CASE_TEMPLATE_DEFINE(" Scenario: " name, T, id) #define DOCTEST_GIVEN(name) DOCTEST_SUBCASE(" Given: " name) #define DOCTEST_WHEN(name) DOCTEST_SUBCASE(" When: " name) #define DOCTEST_AND_WHEN(name) DOCTEST_SUBCASE("And when: " name) #define DOCTEST_THEN(name) DOCTEST_SUBCASE(" Then: " name) #define DOCTEST_AND_THEN(name) DOCTEST_SUBCASE(" And: " name) // clang-format on // == SHORT VERSIONS OF THE MACROS #if !defined(DOCTEST_CONFIG_NO_SHORT_MACRO_NAMES) #define TEST_CASE(name) DOCTEST_TEST_CASE(name) #define TEST_CASE_CLASS(name) DOCTEST_TEST_CASE_CLASS(name) #define TEST_CASE_FIXTURE(x, name) DOCTEST_TEST_CASE_FIXTURE(x, name) #define TYPE_TO_STRING(...) DOCTEST_TYPE_TO_STRING(__VA_ARGS__) #define TEST_CASE_TEMPLATE(name, T, ...) DOCTEST_TEST_CASE_TEMPLATE(name, T, __VA_ARGS__) #define TEST_CASE_TEMPLATE_DEFINE(name, T, id) DOCTEST_TEST_CASE_TEMPLATE_DEFINE(name, T, id) #define TEST_CASE_TEMPLATE_INVOKE(id, ...) DOCTEST_TEST_CASE_TEMPLATE_INVOKE(id, __VA_ARGS__) #define TEST_CASE_TEMPLATE_APPLY(id, ...) DOCTEST_TEST_CASE_TEMPLATE_APPLY(id, __VA_ARGS__) #define SUBCASE(name) DOCTEST_SUBCASE(name) #define TEST_SUITE(decorators) DOCTEST_TEST_SUITE(decorators) #define TEST_SUITE_BEGIN(name) DOCTEST_TEST_SUITE_BEGIN(name) #define TEST_SUITE_END DOCTEST_TEST_SUITE_END #define REGISTER_EXCEPTION_TRANSLATOR(signature) DOCTEST_REGISTER_EXCEPTION_TRANSLATOR(signature) #define REGISTER_REPORTER(name, priority, reporter) DOCTEST_REGISTER_REPORTER(name, priority, reporter) #define REGISTER_LISTENER(name, priority, reporter) DOCTEST_REGISTER_LISTENER(name, priority, reporter) #define INFO(...) DOCTEST_INFO(__VA_ARGS__) #define CAPTURE(x) DOCTEST_CAPTURE(x) #define ADD_MESSAGE_AT(file, line, ...) DOCTEST_ADD_MESSAGE_AT(file, line, __VA_ARGS__) #define ADD_FAIL_CHECK_AT(file, line, ...) DOCTEST_ADD_FAIL_CHECK_AT(file, line, __VA_ARGS__) #define ADD_FAIL_AT(file, line, ...) DOCTEST_ADD_FAIL_AT(file, line, __VA_ARGS__) #define MESSAGE(...) DOCTEST_MESSAGE(__VA_ARGS__) #define FAIL_CHECK(...) DOCTEST_FAIL_CHECK(__VA_ARGS__) #define FAIL(...) DOCTEST_FAIL(__VA_ARGS__) #define TO_LVALUE(...) DOCTEST_TO_LVALUE(__VA_ARGS__) #define WARN(...) DOCTEST_WARN(__VA_ARGS__) #define WARN_FALSE(...) DOCTEST_WARN_FALSE(__VA_ARGS__) #define WARN_THROWS(...) DOCTEST_WARN_THROWS(__VA_ARGS__) #define WARN_THROWS_AS(expr, ...) DOCTEST_WARN_THROWS_AS(expr, __VA_ARGS__) #define WARN_THROWS_WITH(expr, ...) DOCTEST_WARN_THROWS_WITH(expr, __VA_ARGS__) #define WARN_THROWS_WITH_AS(expr, with, ...) DOCTEST_WARN_THROWS_WITH_AS(expr, with, __VA_ARGS__) #define WARN_NOTHROW(...) DOCTEST_WARN_NOTHROW(__VA_ARGS__) #define CHECK(...) DOCTEST_CHECK(__VA_ARGS__) #define CHECK_FALSE(...) DOCTEST_CHECK_FALSE(__VA_ARGS__) #define CHECK_THROWS(...) DOCTEST_CHECK_THROWS(__VA_ARGS__) #define CHECK_THROWS_AS(expr, ...) DOCTEST_CHECK_THROWS_AS(expr, __VA_ARGS__) #define CHECK_THROWS_WITH(expr, ...) DOCTEST_CHECK_THROWS_WITH(expr, __VA_ARGS__) #define CHECK_THROWS_WITH_AS(expr, with, ...) DOCTEST_CHECK_THROWS_WITH_AS(expr, with, __VA_ARGS__) #define CHECK_NOTHROW(...) DOCTEST_CHECK_NOTHROW(__VA_ARGS__) #define REQUIRE(...) DOCTEST_REQUIRE(__VA_ARGS__) #define REQUIRE_FALSE(...) DOCTEST_REQUIRE_FALSE(__VA_ARGS__) #define REQUIRE_THROWS(...) DOCTEST_REQUIRE_THROWS(__VA_ARGS__) #define REQUIRE_THROWS_AS(expr, ...) DOCTEST_REQUIRE_THROWS_AS(expr, __VA_ARGS__) #define REQUIRE_THROWS_WITH(expr, ...) DOCTEST_REQUIRE_THROWS_WITH(expr, __VA_ARGS__) #define REQUIRE_THROWS_WITH_AS(expr, with, ...) DOCTEST_REQUIRE_THROWS_WITH_AS(expr, with, __VA_ARGS__) #define REQUIRE_NOTHROW(...) DOCTEST_REQUIRE_NOTHROW(__VA_ARGS__) #define WARN_MESSAGE(cond, ...) DOCTEST_WARN_MESSAGE(cond, __VA_ARGS__) #define WARN_FALSE_MESSAGE(cond, ...) DOCTEST_WARN_FALSE_MESSAGE(cond, __VA_ARGS__) #define WARN_THROWS_MESSAGE(expr, ...) DOCTEST_WARN_THROWS_MESSAGE(expr, __VA_ARGS__) #define WARN_THROWS_AS_MESSAGE(expr, ex, ...) DOCTEST_WARN_THROWS_AS_MESSAGE(expr, ex, __VA_ARGS__) #define WARN_THROWS_WITH_MESSAGE(expr, with, ...) DOCTEST_WARN_THROWS_WITH_MESSAGE(expr, with, __VA_ARGS__) #define WARN_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) DOCTEST_WARN_THROWS_WITH_AS_MESSAGE(expr, with, ex, __VA_ARGS__) #define WARN_NOTHROW_MESSAGE(expr, ...) DOCTEST_WARN_NOTHROW_MESSAGE(expr, __VA_ARGS__) #define CHECK_MESSAGE(cond, ...) DOCTEST_CHECK_MESSAGE(cond, __VA_ARGS__) #define CHECK_FALSE_MESSAGE(cond, ...) DOCTEST_CHECK_FALSE_MESSAGE(cond, __VA_ARGS__) #define CHECK_THROWS_MESSAGE(expr, ...) DOCTEST_CHECK_THROWS_MESSAGE(expr, __VA_ARGS__) #define CHECK_THROWS_AS_MESSAGE(expr, ex, ...) DOCTEST_CHECK_THROWS_AS_MESSAGE(expr, ex, __VA_ARGS__) #define CHECK_THROWS_WITH_MESSAGE(expr, with, ...) DOCTEST_CHECK_THROWS_WITH_MESSAGE(expr, with, __VA_ARGS__) #define CHECK_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) DOCTEST_CHECK_THROWS_WITH_AS_MESSAGE(expr, with, ex, __VA_ARGS__) #define CHECK_NOTHROW_MESSAGE(expr, ...) DOCTEST_CHECK_NOTHROW_MESSAGE(expr, __VA_ARGS__) #define REQUIRE_MESSAGE(cond, ...) DOCTEST_REQUIRE_MESSAGE(cond, __VA_ARGS__) #define REQUIRE_FALSE_MESSAGE(cond, ...) DOCTEST_REQUIRE_FALSE_MESSAGE(cond, __VA_ARGS__) #define REQUIRE_THROWS_MESSAGE(expr, ...) DOCTEST_REQUIRE_THROWS_MESSAGE(expr, __VA_ARGS__) #define REQUIRE_THROWS_AS_MESSAGE(expr, ex, ...) DOCTEST_REQUIRE_THROWS_AS_MESSAGE(expr, ex, __VA_ARGS__) #define REQUIRE_THROWS_WITH_MESSAGE(expr, with, ...) DOCTEST_REQUIRE_THROWS_WITH_MESSAGE(expr, with, __VA_ARGS__) #define REQUIRE_THROWS_WITH_AS_MESSAGE(expr, with, ex, ...) DOCTEST_REQUIRE_THROWS_WITH_AS_MESSAGE(expr, with, ex, __VA_ARGS__) #define REQUIRE_NOTHROW_MESSAGE(expr, ...) DOCTEST_REQUIRE_NOTHROW_MESSAGE(expr, __VA_ARGS__) #define SCENARIO(name) DOCTEST_SCENARIO(name) #define SCENARIO_CLASS(name) DOCTEST_SCENARIO_CLASS(name) #define SCENARIO_TEMPLATE(name, T, ...) DOCTEST_SCENARIO_TEMPLATE(name, T, __VA_ARGS__) #define SCENARIO_TEMPLATE_DEFINE(name, T, id) DOCTEST_SCENARIO_TEMPLATE_DEFINE(name, T, id) #define GIVEN(name) DOCTEST_GIVEN(name) #define WHEN(name) DOCTEST_WHEN(name) #define AND_WHEN(name) DOCTEST_AND_WHEN(name) #define THEN(name) DOCTEST_THEN(name) #define AND_THEN(name) DOCTEST_AND_THEN(name) #define WARN_EQ(...) DOCTEST_WARN_EQ(__VA_ARGS__) #define CHECK_EQ(...) DOCTEST_CHECK_EQ(__VA_ARGS__) #define REQUIRE_EQ(...) DOCTEST_REQUIRE_EQ(__VA_ARGS__) #define WARN_NE(...) DOCTEST_WARN_NE(__VA_ARGS__) #define CHECK_NE(...) DOCTEST_CHECK_NE(__VA_ARGS__) #define REQUIRE_NE(...) DOCTEST_REQUIRE_NE(__VA_ARGS__) #define WARN_GT(...) DOCTEST_WARN_GT(__VA_ARGS__) #define CHECK_GT(...) DOCTEST_CHECK_GT(__VA_ARGS__) #define REQUIRE_GT(...) DOCTEST_REQUIRE_GT(__VA_ARGS__) #define WARN_LT(...) DOCTEST_WARN_LT(__VA_ARGS__) #define CHECK_LT(...) DOCTEST_CHECK_LT(__VA_ARGS__) #define REQUIRE_LT(...) DOCTEST_REQUIRE_LT(__VA_ARGS__) #define WARN_GE(...) DOCTEST_WARN_GE(__VA_ARGS__) #define CHECK_GE(...) DOCTEST_CHECK_GE(__VA_ARGS__) #define REQUIRE_GE(...) DOCTEST_REQUIRE_GE(__VA_ARGS__) #define WARN_LE(...) DOCTEST_WARN_LE(__VA_ARGS__) #define CHECK_LE(...) DOCTEST_CHECK_LE(__VA_ARGS__) #define REQUIRE_LE(...) DOCTEST_REQUIRE_LE(__VA_ARGS__) #define WARN_UNARY(...) DOCTEST_WARN_UNARY(__VA_ARGS__) #define CHECK_UNARY(...) DOCTEST_CHECK_UNARY(__VA_ARGS__) #define REQUIRE_UNARY(...) DOCTEST_REQUIRE_UNARY(__VA_ARGS__) #define WARN_UNARY_FALSE(...) DOCTEST_WARN_UNARY_FALSE(__VA_ARGS__) #define CHECK_UNARY_FALSE(...) DOCTEST_CHECK_UNARY_FALSE(__VA_ARGS__) #define REQUIRE_UNARY_FALSE(...) DOCTEST_REQUIRE_UNARY_FALSE(__VA_ARGS__) // KEPT FOR BACKWARDS COMPATIBILITY #define FAST_WARN_EQ(...) DOCTEST_FAST_WARN_EQ(__VA_ARGS__) #define FAST_CHECK_EQ(...) DOCTEST_FAST_CHECK_EQ(__VA_ARGS__) #define FAST_REQUIRE_EQ(...) DOCTEST_FAST_REQUIRE_EQ(__VA_ARGS__) #define FAST_WARN_NE(...) DOCTEST_FAST_WARN_NE(__VA_ARGS__) #define FAST_CHECK_NE(...) DOCTEST_FAST_CHECK_NE(__VA_ARGS__) #define FAST_REQUIRE_NE(...) DOCTEST_FAST_REQUIRE_NE(__VA_ARGS__) #define FAST_WARN_GT(...) DOCTEST_FAST_WARN_GT(__VA_ARGS__) #define FAST_CHECK_GT(...) DOCTEST_FAST_CHECK_GT(__VA_ARGS__) #define FAST_REQUIRE_GT(...) DOCTEST_FAST_REQUIRE_GT(__VA_ARGS__) #define FAST_WARN_LT(...) DOCTEST_FAST_WARN_LT(__VA_ARGS__) #define FAST_CHECK_LT(...) DOCTEST_FAST_CHECK_LT(__VA_ARGS__) #define FAST_REQUIRE_LT(...) DOCTEST_FAST_REQUIRE_LT(__VA_ARGS__) #define FAST_WARN_GE(...) DOCTEST_FAST_WARN_GE(__VA_ARGS__) #define FAST_CHECK_GE(...) DOCTEST_FAST_CHECK_GE(__VA_ARGS__) #define FAST_REQUIRE_GE(...) DOCTEST_FAST_REQUIRE_GE(__VA_ARGS__) #define FAST_WARN_LE(...) DOCTEST_FAST_WARN_LE(__VA_ARGS__) #define FAST_CHECK_LE(...) DOCTEST_FAST_CHECK_LE(__VA_ARGS__) #define FAST_REQUIRE_LE(...) DOCTEST_FAST_REQUIRE_LE(__VA_ARGS__) #define FAST_WARN_UNARY(...) DOCTEST_FAST_WARN_UNARY(__VA_ARGS__) #define FAST_CHECK_UNARY(...) DOCTEST_FAST_CHECK_UNARY(__VA_ARGS__) #define FAST_REQUIRE_UNARY(...) DOCTEST_FAST_REQUIRE_UNARY(__VA_ARGS__) #define FAST_WARN_UNARY_FALSE(...) DOCTEST_FAST_WARN_UNARY_FALSE(__VA_ARGS__) #define FAST_CHECK_UNARY_FALSE(...) DOCTEST_FAST_CHECK_UNARY_FALSE(__VA_ARGS__) #define FAST_REQUIRE_UNARY_FALSE(...) DOCTEST_FAST_REQUIRE_UNARY_FALSE(__VA_ARGS__) #define TEST_CASE_TEMPLATE_INSTANTIATE(id, ...) DOCTEST_TEST_CASE_TEMPLATE_INSTANTIATE(id, __VA_ARGS__) #endif // DOCTEST_CONFIG_NO_SHORT_MACRO_NAMES #if !defined(DOCTEST_CONFIG_DISABLE) // this is here to clear the 'current test suite' for the current translation unit - at the top DOCTEST_TEST_SUITE_END(); // add stringification for primitive/fundamental types namespace doctest { namespace detail { DOCTEST_TYPE_TO_STRING_IMPL(bool) DOCTEST_TYPE_TO_STRING_IMPL(float) DOCTEST_TYPE_TO_STRING_IMPL(double) DOCTEST_TYPE_TO_STRING_IMPL(long double) DOCTEST_TYPE_TO_STRING_IMPL(char) DOCTEST_TYPE_TO_STRING_IMPL(signed char) DOCTEST_TYPE_TO_STRING_IMPL(unsigned char) #if !DOCTEST_MSVC || defined(_NATIVE_WCHAR_T_DEFINED) DOCTEST_TYPE_TO_STRING_IMPL(wchar_t) #endif // not MSVC or wchar_t support enabled DOCTEST_TYPE_TO_STRING_IMPL(short int) DOCTEST_TYPE_TO_STRING_IMPL(unsigned short int) DOCTEST_TYPE_TO_STRING_IMPL(int) DOCTEST_TYPE_TO_STRING_IMPL(unsigned int) DOCTEST_TYPE_TO_STRING_IMPL(long int) DOCTEST_TYPE_TO_STRING_IMPL(unsigned long int) DOCTEST_TYPE_TO_STRING_IMPL(long long int) DOCTEST_TYPE_TO_STRING_IMPL(unsigned long long int) }} // namespace doctest::detail #endif // DOCTEST_CONFIG_DISABLE DOCTEST_CLANG_SUPPRESS_WARNING_POP DOCTEST_MSVC_SUPPRESS_WARNING_POP DOCTEST_GCC_SUPPRESS_WARNING_POP DOCTEST_SUPPRESS_COMMON_WARNINGS_POP #endif // DOCTEST_LIBRARY_INCLUDED #ifndef DOCTEST_SINGLE_HEADER #define DOCTEST_SINGLE_HEADER #endif // DOCTEST_SINGLE_HEADER #if defined(DOCTEST_CONFIG_IMPLEMENT) || !defined(DOCTEST_SINGLE_HEADER) #ifndef DOCTEST_SINGLE_HEADER #include "doctest_fwd.h" #endif // DOCTEST_SINGLE_HEADER DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wunused-macros") #ifndef DOCTEST_LIBRARY_IMPLEMENTATION #define DOCTEST_LIBRARY_IMPLEMENTATION DOCTEST_CLANG_SUPPRESS_WARNING_POP DOCTEST_SUPPRESS_COMMON_WARNINGS_PUSH DOCTEST_CLANG_SUPPRESS_WARNING_PUSH DOCTEST_CLANG_SUPPRESS_WARNING("-Wglobal-constructors") DOCTEST_CLANG_SUPPRESS_WARNING("-Wexit-time-destructors") DOCTEST_CLANG_SUPPRESS_WARNING("-Wsign-conversion") DOCTEST_CLANG_SUPPRESS_WARNING("-Wshorten-64-to-32") DOCTEST_CLANG_SUPPRESS_WARNING("-Wmissing-variable-declarations") DOCTEST_CLANG_SUPPRESS_WARNING("-Wswitch") DOCTEST_CLANG_SUPPRESS_WARNING("-Wswitch-enum") DOCTEST_CLANG_SUPPRESS_WARNING("-Wcovered-switch-default") DOCTEST_CLANG_SUPPRESS_WARNING("-Wmissing-noreturn") DOCTEST_CLANG_SUPPRESS_WARNING("-Wdisabled-macro-expansion") DOCTEST_CLANG_SUPPRESS_WARNING("-Wmissing-braces") DOCTEST_CLANG_SUPPRESS_WARNING("-Wmissing-field-initializers") DOCTEST_CLANG_SUPPRESS_WARNING("-Wunused-member-function") DOCTEST_CLANG_SUPPRESS_WARNING("-Wnonportable-system-include-path") DOCTEST_GCC_SUPPRESS_WARNING_PUSH DOCTEST_GCC_SUPPRESS_WARNING("-Wconversion") DOCTEST_GCC_SUPPRESS_WARNING("-Wsign-conversion") DOCTEST_GCC_SUPPRESS_WARNING("-Wmissing-field-initializers") DOCTEST_GCC_SUPPRESS_WARNING("-Wmissing-braces") DOCTEST_GCC_SUPPRESS_WARNING("-Wswitch") DOCTEST_GCC_SUPPRESS_WARNING("-Wswitch-enum") DOCTEST_GCC_SUPPRESS_WARNING("-Wswitch-default") DOCTEST_GCC_SUPPRESS_WARNING("-Wunsafe-loop-optimizations") DOCTEST_GCC_SUPPRESS_WARNING("-Wold-style-cast") DOCTEST_GCC_SUPPRESS_WARNING("-Wunused-function") DOCTEST_GCC_SUPPRESS_WARNING("-Wmultiple-inheritance") DOCTEST_GCC_SUPPRESS_WARNING("-Wsuggest-attribute") DOCTEST_MSVC_SUPPRESS_WARNING_PUSH DOCTEST_MSVC_SUPPRESS_WARNING(4267) // 'var' : conversion from 'x' to 'y', possible loss of data DOCTEST_MSVC_SUPPRESS_WARNING(4530) // C++ exception handler used, but unwind semantics not enabled DOCTEST_MSVC_SUPPRESS_WARNING(4577) // 'noexcept' used with no exception handling mode specified DOCTEST_MSVC_SUPPRESS_WARNING(4774) // format string expected in argument is not a string literal DOCTEST_MSVC_SUPPRESS_WARNING(4365) // conversion from 'int' to 'unsigned', signed/unsigned mismatch DOCTEST_MSVC_SUPPRESS_WARNING(5039) // pointer to potentially throwing function passed to extern C DOCTEST_MSVC_SUPPRESS_WARNING(4800) // forcing value to bool 'true' or 'false' (performance warning) DOCTEST_MSVC_SUPPRESS_WARNING(5245) // unreferenced function with internal linkage has been removed DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN // required includes - will go only in one translation unit! #include #include #include // borland (Embarcadero) compiler requires math.h and not cmath - https://github.com/doctest/doctest/pull/37 #ifdef __BORLANDC__ #include #endif // __BORLANDC__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef DOCTEST_PLATFORM_MAC #include #include #include #endif // DOCTEST_PLATFORM_MAC #ifdef DOCTEST_PLATFORM_WINDOWS // defines for a leaner windows.h #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif // WIN32_LEAN_AND_MEAN #ifndef NOMINMAX #define NOMINMAX #endif // NOMINMAX // not sure what AfxWin.h is for - here I do what Catch does #ifdef __AFXDLL #include #else #include #endif #include #else // DOCTEST_PLATFORM_WINDOWS #include #include #endif // DOCTEST_PLATFORM_WINDOWS // this is a fix for https://github.com/doctest/doctest/issues/348 // https://mail.gnome.org/archives/xml/2012-January/msg00000.html #if !defined(HAVE_UNISTD_H) && !defined(STDOUT_FILENO) #define STDOUT_FILENO fileno(stdout) #endif // HAVE_UNISTD_H DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END // counts the number of elements in a C array #define DOCTEST_COUNTOF(x) (sizeof(x) / sizeof(x[0])) #ifdef DOCTEST_CONFIG_DISABLE #define DOCTEST_BRANCH_ON_DISABLED(if_disabled, if_not_disabled) if_disabled #else // DOCTEST_CONFIG_DISABLE #define DOCTEST_BRANCH_ON_DISABLED(if_disabled, if_not_disabled) if_not_disabled #endif // DOCTEST_CONFIG_DISABLE #ifndef DOCTEST_CONFIG_OPTIONS_PREFIX #define DOCTEST_CONFIG_OPTIONS_PREFIX "dt-" #endif #ifndef DOCTEST_THREAD_LOCAL #if DOCTEST_MSVC && (DOCTEST_MSVC < DOCTEST_COMPILER(19, 0, 0)) #define DOCTEST_THREAD_LOCAL #else // DOCTEST_MSVC #define DOCTEST_THREAD_LOCAL thread_local #endif // DOCTEST_MSVC #endif // DOCTEST_THREAD_LOCAL #ifndef DOCTEST_MULTI_LANE_ATOMICS_THREAD_LANES #define DOCTEST_MULTI_LANE_ATOMICS_THREAD_LANES 32 #endif #ifndef DOCTEST_MULTI_LANE_ATOMICS_CACHE_LINE_SIZE #define DOCTEST_MULTI_LANE_ATOMICS_CACHE_LINE_SIZE 64 #endif #ifdef DOCTEST_CONFIG_NO_UNPREFIXED_OPTIONS #define DOCTEST_OPTIONS_PREFIX_DISPLAY DOCTEST_CONFIG_OPTIONS_PREFIX #else #define DOCTEST_OPTIONS_PREFIX_DISPLAY "" #endif #if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) #define DOCTEST_CONFIG_NO_MULTI_LANE_ATOMICS #endif #ifndef DOCTEST_CDECL #define DOCTEST_CDECL __cdecl #endif namespace doctest { bool is_running_in_test = false; namespace { using namespace detail; template DOCTEST_NORETURN void throw_exception(Ex const& e) { #ifndef DOCTEST_CONFIG_NO_EXCEPTIONS throw e; #else // DOCTEST_CONFIG_NO_EXCEPTIONS std::cerr << "doctest will terminate because it needed to throw an exception.\n" << "The message was: " << e.what() << '\n'; std::terminate(); #endif // DOCTEST_CONFIG_NO_EXCEPTIONS } #ifndef DOCTEST_INTERNAL_ERROR #define DOCTEST_INTERNAL_ERROR(msg) \ throw_exception(std::logic_error( \ __FILE__ ":" DOCTEST_TOSTR(__LINE__) ": Internal doctest error: " msg)) #endif // DOCTEST_INTERNAL_ERROR // case insensitive strcmp int stricmp(const char* a, const char* b) { for(;; a++, b++) { const int d = tolower(*a) - tolower(*b); if(d != 0 || !*a) return d; } } template String fpToString(T value, int precision) { std::ostringstream oss; oss << std::setprecision(precision) << std::fixed << value; std::string d = oss.str(); size_t i = d.find_last_not_of('0'); if(i != std::string::npos && i != d.size() - 1) { if(d[i] == '.') i++; d = d.substr(0, i + 1); } return d.c_str(); } struct Endianness { enum Arch { Big, Little }; static Arch which() { int x = 1; // casting any data pointer to char* is allowed auto ptr = reinterpret_cast(&x); if(*ptr) return Little; return Big; } }; } // namespace namespace detail { String rawMemoryToString(const void* object, unsigned size) { // Reverse order for little endian architectures int i = 0, end = static_cast(size), inc = 1; if(Endianness::which() == Endianness::Little) { i = end - 1; end = inc = -1; } unsigned const char* bytes = static_cast(object); std::ostream* oss = tlssPush(); *oss << "0x" << std::setfill('0') << std::hex; for(; i != end; i += inc) *oss << std::setw(2) << static_cast(bytes[i]); return tlssPop(); } DOCTEST_THREAD_LOCAL class { std::vector stack; std::stringstream ss; public: std::ostream* push() { stack.push_back(ss.tellp()); return &ss; } String pop() { if (stack.empty()) DOCTEST_INTERNAL_ERROR("TLSS was empty when trying to pop!"); std::streampos pos = stack.back(); stack.pop_back(); unsigned sz = static_cast(ss.tellp() - pos); ss.rdbuf()->pubseekpos(pos, std::ios::in | std::ios::out); return String(ss, sz); } } g_oss; std::ostream* tlssPush() { return g_oss.push(); } String tlssPop() { return g_oss.pop(); } #ifndef DOCTEST_CONFIG_DISABLE namespace timer_large_integer { #if defined(DOCTEST_PLATFORM_WINDOWS) typedef ULONGLONG type; #else // DOCTEST_PLATFORM_WINDOWS typedef std::uint64_t type; #endif // DOCTEST_PLATFORM_WINDOWS } typedef timer_large_integer::type ticks_t; #ifdef DOCTEST_CONFIG_GETCURRENTTICKS ticks_t getCurrentTicks() { return DOCTEST_CONFIG_GETCURRENTTICKS(); } #elif defined(DOCTEST_PLATFORM_WINDOWS) ticks_t getCurrentTicks() { static LARGE_INTEGER hz = {0}, hzo = {0}; if(!hz.QuadPart) { QueryPerformanceFrequency(&hz); QueryPerformanceCounter(&hzo); } LARGE_INTEGER t; QueryPerformanceCounter(&t); return ((t.QuadPart - hzo.QuadPart) * LONGLONG(1000000)) / hz.QuadPart; } #else // DOCTEST_PLATFORM_WINDOWS ticks_t getCurrentTicks() { timeval t; gettimeofday(&t, nullptr); return static_cast(t.tv_sec) * 1000000 + static_cast(t.tv_usec); } #endif // DOCTEST_PLATFORM_WINDOWS struct Timer { void start() { m_ticks = getCurrentTicks(); } unsigned int getElapsedMicroseconds() const { return static_cast(getCurrentTicks() - m_ticks); } //unsigned int getElapsedMilliseconds() const { // return static_cast(getElapsedMicroseconds() / 1000); //} double getElapsedSeconds() const { return static_cast(getCurrentTicks() - m_ticks) / 1000000.0; } private: ticks_t m_ticks = 0; }; #ifdef DOCTEST_CONFIG_NO_MULTI_LANE_ATOMICS template using AtomicOrMultiLaneAtomic = std::atomic; #else // DOCTEST_CONFIG_NO_MULTI_LANE_ATOMICS // Provides a multilane implementation of an atomic variable that supports add, sub, load, // store. Instead of using a single atomic variable, this splits up into multiple ones, // each sitting on a separate cache line. The goal is to provide a speedup when most // operations are modifying. It achieves this with two properties: // // * Multiple atomics are used, so chance of congestion from the same atomic is reduced. // * Each atomic sits on a separate cache line, so false sharing is reduced. // // The disadvantage is that there is a small overhead due to the use of TLS, and load/store // is slower because all atomics have to be accessed. template class MultiLaneAtomic { struct CacheLineAlignedAtomic { std::atomic atomic{}; char padding[DOCTEST_MULTI_LANE_ATOMICS_CACHE_LINE_SIZE - sizeof(std::atomic)]; }; CacheLineAlignedAtomic m_atomics[DOCTEST_MULTI_LANE_ATOMICS_THREAD_LANES]; static_assert(sizeof(CacheLineAlignedAtomic) == DOCTEST_MULTI_LANE_ATOMICS_CACHE_LINE_SIZE, "guarantee one atomic takes exactly one cache line"); public: T operator++() DOCTEST_NOEXCEPT { return fetch_add(1) + 1; } T operator++(int) DOCTEST_NOEXCEPT { return fetch_add(1); } T fetch_add(T arg, std::memory_order order = std::memory_order_seq_cst) DOCTEST_NOEXCEPT { return myAtomic().fetch_add(arg, order); } T fetch_sub(T arg, std::memory_order order = std::memory_order_seq_cst) DOCTEST_NOEXCEPT { return myAtomic().fetch_sub(arg, order); } operator T() const DOCTEST_NOEXCEPT { return load(); } T load(std::memory_order order = std::memory_order_seq_cst) const DOCTEST_NOEXCEPT { auto result = T(); for(auto const& c : m_atomics) { result += c.atomic.load(order); } return result; } T operator=(T desired) DOCTEST_NOEXCEPT { // lgtm [cpp/assignment-does-not-return-this] store(desired); return desired; } void store(T desired, std::memory_order order = std::memory_order_seq_cst) DOCTEST_NOEXCEPT { // first value becomes desired", all others become 0. for(auto& c : m_atomics) { c.atomic.store(desired, order); desired = {}; } } private: // Each thread has a different atomic that it operates on. If more than NumLanes threads // use this, some will use the same atomic. So performance will degrade a bit, but still // everything will work. // // The logic here is a bit tricky. The call should be as fast as possible, so that there // is minimal to no overhead in determining the correct atomic for the current thread. // // 1. A global static counter laneCounter counts continuously up. // 2. Each successive thread will use modulo operation of that counter so it gets an atomic // assigned in a round-robin fashion. // 3. This tlsLaneIdx is stored in the thread local data, so it is directly available with // little overhead. std::atomic& myAtomic() DOCTEST_NOEXCEPT { static std::atomic laneCounter; DOCTEST_THREAD_LOCAL size_t tlsLaneIdx = laneCounter++ % DOCTEST_MULTI_LANE_ATOMICS_THREAD_LANES; return m_atomics[tlsLaneIdx].atomic; } }; template using AtomicOrMultiLaneAtomic = MultiLaneAtomic; #endif // DOCTEST_CONFIG_NO_MULTI_LANE_ATOMICS // this holds both parameters from the command line and runtime data for tests struct ContextState : ContextOptions, TestRunStats, CurrentTestCaseStats { AtomicOrMultiLaneAtomic numAssertsCurrentTest_atomic; AtomicOrMultiLaneAtomic numAssertsFailedCurrentTest_atomic; std::vector> filters = decltype(filters)(9); // 9 different filters std::vector reporters_currently_used; assert_handler ah = nullptr; Timer timer; std::vector stringifiedContexts; // logging from INFO() due to an exception // stuff for subcases std::vector subcasesStack; std::set subcasesPassed; int subcasesCurrentMaxLevel; bool should_reenter; std::atomic shouldLogCurrentException; void resetRunData() { numTestCases = 0; numTestCasesPassingFilters = 0; numTestSuitesPassingFilters = 0; numTestCasesFailed = 0; numAsserts = 0; numAssertsFailed = 0; numAssertsCurrentTest = 0; numAssertsFailedCurrentTest = 0; } void finalizeTestCaseData() { seconds = timer.getElapsedSeconds(); // update the non-atomic counters numAsserts += numAssertsCurrentTest_atomic; numAssertsFailed += numAssertsFailedCurrentTest_atomic; numAssertsCurrentTest = numAssertsCurrentTest_atomic; numAssertsFailedCurrentTest = numAssertsFailedCurrentTest_atomic; if(numAssertsFailedCurrentTest) failure_flags |= TestCaseFailureReason::AssertFailure; if(Approx(currentTest->m_timeout).epsilon(DBL_EPSILON) != 0 && Approx(seconds).epsilon(DBL_EPSILON) > currentTest->m_timeout) failure_flags |= TestCaseFailureReason::Timeout; if(currentTest->m_should_fail) { if(failure_flags) { failure_flags |= TestCaseFailureReason::ShouldHaveFailedAndDid; } else { failure_flags |= TestCaseFailureReason::ShouldHaveFailedButDidnt; } } else if(failure_flags && currentTest->m_may_fail) { failure_flags |= TestCaseFailureReason::CouldHaveFailedAndDid; } else if(currentTest->m_expected_failures > 0) { if(numAssertsFailedCurrentTest == currentTest->m_expected_failures) { failure_flags |= TestCaseFailureReason::FailedExactlyNumTimes; } else { failure_flags |= TestCaseFailureReason::DidntFailExactlyNumTimes; } } bool ok_to_fail = (TestCaseFailureReason::ShouldHaveFailedAndDid & failure_flags) || (TestCaseFailureReason::CouldHaveFailedAndDid & failure_flags) || (TestCaseFailureReason::FailedExactlyNumTimes & failure_flags); // if any subcase has failed - the whole test case has failed testCaseSuccess = !(failure_flags && !ok_to_fail); if(!testCaseSuccess) numTestCasesFailed++; } }; ContextState* g_cs = nullptr; // used to avoid locks for the debug output // TODO: figure out if this is indeed necessary/correct - seems like either there still // could be a race or that there wouldn't be a race even if using the context directly DOCTEST_THREAD_LOCAL bool g_no_colors; #endif // DOCTEST_CONFIG_DISABLE } // namespace detail char* String::allocate(unsigned sz) { if (sz <= last) { buf[sz] = '\0'; setLast(last - sz); return buf; } else { setOnHeap(); data.size = sz; data.capacity = data.size + 1; data.ptr = new char[data.capacity]; data.ptr[sz] = '\0'; return data.ptr; } } void String::setOnHeap() { *reinterpret_cast(&buf[last]) = 128; } void String::setLast(unsigned in) { buf[last] = char(in); } void String::copy(const String& other) { if(other.isOnStack()) { memcpy(buf, other.buf, len); } else { memcpy(allocate(other.data.size), other.data.ptr, other.data.size); } } String::String() { buf[0] = '\0'; setLast(); } String::~String() { if(!isOnStack()) delete[] data.ptr; // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) } String::String(const char* in) : String(in, strlen(in)) {} String::String(const char* in, unsigned in_size) { memcpy(allocate(in_size), in, in_size); } String::String(std::istream& in, unsigned in_size) { in.read(allocate(in_size), in_size); } String::String(const String& other) { copy(other); } String& String::operator=(const String& other) { if(this != &other) { if(!isOnStack()) delete[] data.ptr; copy(other); } return *this; } String& String::operator+=(const String& other) { const unsigned my_old_size = size(); const unsigned other_size = other.size(); const unsigned total_size = my_old_size + other_size; if(isOnStack()) { if(total_size < len) { // append to the current stack space memcpy(buf + my_old_size, other.c_str(), other_size + 1); // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) setLast(last - total_size); } else { // alloc new chunk char* temp = new char[total_size + 1]; // copy current data to new location before writing in the union memcpy(temp, buf, my_old_size); // skip the +1 ('\0') for speed // update data in union setOnHeap(); data.size = total_size; data.capacity = data.size + 1; data.ptr = temp; // transfer the rest of the data memcpy(data.ptr + my_old_size, other.c_str(), other_size + 1); } } else { if(data.capacity > total_size) { // append to the current heap block data.size = total_size; memcpy(data.ptr + my_old_size, other.c_str(), other_size + 1); } else { // resize data.capacity *= 2; if(data.capacity <= total_size) data.capacity = total_size + 1; // alloc new chunk char* temp = new char[data.capacity]; // copy current data to new location before releasing it memcpy(temp, data.ptr, my_old_size); // skip the +1 ('\0') for speed // release old chunk delete[] data.ptr; // update the rest of the union members data.size = total_size; data.ptr = temp; // transfer the rest of the data memcpy(data.ptr + my_old_size, other.c_str(), other_size + 1); } } return *this; } String::String(String&& other) { memcpy(buf, other.buf, len); other.buf[0] = '\0'; other.setLast(); } String& String::operator=(String&& other) { if(this != &other) { if(!isOnStack()) delete[] data.ptr; memcpy(buf, other.buf, len); other.buf[0] = '\0'; other.setLast(); } return *this; } char String::operator[](unsigned i) const { return const_cast(this)->operator[](i); // NOLINT } char& String::operator[](unsigned i) { if(isOnStack()) return reinterpret_cast(buf)[i]; return data.ptr[i]; } DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH("-Wmaybe-uninitialized") unsigned String::size() const { if(isOnStack()) return last - (unsigned(buf[last]) & 31); // using "last" would work only if "len" is 32 return data.size; } DOCTEST_GCC_SUPPRESS_WARNING_POP unsigned String::capacity() const { if(isOnStack()) return len; return data.capacity; } int String::compare(const char* other, bool no_case) const { if(no_case) return doctest::stricmp(c_str(), other); return std::strcmp(c_str(), other); } int String::compare(const String& other, bool no_case) const { return compare(other.c_str(), no_case); } // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) String operator+(const String& lhs, const String& rhs) { return String(lhs) += rhs; } // clang-format off bool operator==(const String& lhs, const String& rhs) { return lhs.compare(rhs) == 0; } bool operator!=(const String& lhs, const String& rhs) { return lhs.compare(rhs) != 0; } bool operator< (const String& lhs, const String& rhs) { return lhs.compare(rhs) < 0; } bool operator> (const String& lhs, const String& rhs) { return lhs.compare(rhs) > 0; } bool operator<=(const String& lhs, const String& rhs) { return (lhs != rhs) ? lhs.compare(rhs) < 0 : true; } bool operator>=(const String& lhs, const String& rhs) { return (lhs != rhs) ? lhs.compare(rhs) > 0 : true; } // clang-format on std::ostream& operator<<(std::ostream& s, const String& in) { return s << in.c_str(); } namespace { void color_to_stream(std::ostream&, Color::Enum) DOCTEST_BRANCH_ON_DISABLED({}, ;) } // namespace namespace Color { std::ostream& operator<<(std::ostream& s, Color::Enum code) { color_to_stream(s, code); return s; } } // namespace Color // clang-format off const char* assertString(assertType::Enum at) { DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(4062) // enum 'x' in switch of enum 'y' is not handled switch(at) { //!OCLINT missing default in switch statements case assertType::DT_WARN : return "WARN"; case assertType::DT_CHECK : return "CHECK"; case assertType::DT_REQUIRE : return "REQUIRE"; case assertType::DT_WARN_FALSE : return "WARN_FALSE"; case assertType::DT_CHECK_FALSE : return "CHECK_FALSE"; case assertType::DT_REQUIRE_FALSE : return "REQUIRE_FALSE"; case assertType::DT_WARN_THROWS : return "WARN_THROWS"; case assertType::DT_CHECK_THROWS : return "CHECK_THROWS"; case assertType::DT_REQUIRE_THROWS : return "REQUIRE_THROWS"; case assertType::DT_WARN_THROWS_AS : return "WARN_THROWS_AS"; case assertType::DT_CHECK_THROWS_AS : return "CHECK_THROWS_AS"; case assertType::DT_REQUIRE_THROWS_AS : return "REQUIRE_THROWS_AS"; case assertType::DT_WARN_THROWS_WITH : return "WARN_THROWS_WITH"; case assertType::DT_CHECK_THROWS_WITH : return "CHECK_THROWS_WITH"; case assertType::DT_REQUIRE_THROWS_WITH : return "REQUIRE_THROWS_WITH"; case assertType::DT_WARN_THROWS_WITH_AS : return "WARN_THROWS_WITH_AS"; case assertType::DT_CHECK_THROWS_WITH_AS : return "CHECK_THROWS_WITH_AS"; case assertType::DT_REQUIRE_THROWS_WITH_AS : return "REQUIRE_THROWS_WITH_AS"; case assertType::DT_WARN_NOTHROW : return "WARN_NOTHROW"; case assertType::DT_CHECK_NOTHROW : return "CHECK_NOTHROW"; case assertType::DT_REQUIRE_NOTHROW : return "REQUIRE_NOTHROW"; case assertType::DT_WARN_EQ : return "WARN_EQ"; case assertType::DT_CHECK_EQ : return "CHECK_EQ"; case assertType::DT_REQUIRE_EQ : return "REQUIRE_EQ"; case assertType::DT_WARN_NE : return "WARN_NE"; case assertType::DT_CHECK_NE : return "CHECK_NE"; case assertType::DT_REQUIRE_NE : return "REQUIRE_NE"; case assertType::DT_WARN_GT : return "WARN_GT"; case assertType::DT_CHECK_GT : return "CHECK_GT"; case assertType::DT_REQUIRE_GT : return "REQUIRE_GT"; case assertType::DT_WARN_LT : return "WARN_LT"; case assertType::DT_CHECK_LT : return "CHECK_LT"; case assertType::DT_REQUIRE_LT : return "REQUIRE_LT"; case assertType::DT_WARN_GE : return "WARN_GE"; case assertType::DT_CHECK_GE : return "CHECK_GE"; case assertType::DT_REQUIRE_GE : return "REQUIRE_GE"; case assertType::DT_WARN_LE : return "WARN_LE"; case assertType::DT_CHECK_LE : return "CHECK_LE"; case assertType::DT_REQUIRE_LE : return "REQUIRE_LE"; case assertType::DT_WARN_UNARY : return "WARN_UNARY"; case assertType::DT_CHECK_UNARY : return "CHECK_UNARY"; case assertType::DT_REQUIRE_UNARY : return "REQUIRE_UNARY"; case assertType::DT_WARN_UNARY_FALSE : return "WARN_UNARY_FALSE"; case assertType::DT_CHECK_UNARY_FALSE : return "CHECK_UNARY_FALSE"; case assertType::DT_REQUIRE_UNARY_FALSE : return "REQUIRE_UNARY_FALSE"; } DOCTEST_MSVC_SUPPRESS_WARNING_POP return ""; } // clang-format on const char* failureString(assertType::Enum at) { if(at & assertType::is_warn) //!OCLINT bitwise operator in conditional return "WARNING"; if(at & assertType::is_check) //!OCLINT bitwise operator in conditional return "ERROR"; if(at & assertType::is_require) //!OCLINT bitwise operator in conditional return "FATAL ERROR"; return ""; } DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wnull-dereference") DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH("-Wnull-dereference") // depending on the current options this will remove the path of filenames const char* skipPathFromFilename(const char* file) { #ifndef DOCTEST_CONFIG_DISABLE if(getContextOptions()->no_path_in_filenames) { auto back = std::strrchr(file, '\\'); auto forward = std::strrchr(file, '/'); if(back || forward) { if(back > forward) forward = back; return forward + 1; } } #endif // DOCTEST_CONFIG_DISABLE return file; } DOCTEST_CLANG_SUPPRESS_WARNING_POP DOCTEST_GCC_SUPPRESS_WARNING_POP bool SubcaseSignature::operator<(const SubcaseSignature& other) const { if(m_line != other.m_line) return m_line < other.m_line; if(std::strcmp(m_file, other.m_file) != 0) return std::strcmp(m_file, other.m_file) < 0; return m_name.compare(other.m_name) < 0; } IContextScope::IContextScope() = default; IContextScope::~IContextScope() = default; #ifdef DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING String toString(char* in) { return toString(static_cast(in)); } // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) String toString(const char* in) { return String("\"") + (in ? in : "{null string}") + "\""; } #endif // DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING String toString(bool in) { return in ? "true" : "false"; } String toString(float in) { return fpToString(in, 5) + "f"; } String toString(double in) { return fpToString(in, 10); } String toString(double long in) { return fpToString(in, 15); } #define DOCTEST_TO_STRING_OVERLOAD(type, fmt) \ String toString(type in) { \ char buf[64]; \ std::snprintf(buf, 64, fmt, in); \ return buf; \ } DOCTEST_TO_STRING_OVERLOAD(char, "%d") DOCTEST_TO_STRING_OVERLOAD(char signed, "%d") DOCTEST_TO_STRING_OVERLOAD(char unsigned, "%u") DOCTEST_TO_STRING_OVERLOAD(int short, "%d") DOCTEST_TO_STRING_OVERLOAD(int short unsigned, "%u") DOCTEST_TO_STRING_OVERLOAD(int, "%d") DOCTEST_TO_STRING_OVERLOAD(unsigned, "%u") DOCTEST_TO_STRING_OVERLOAD(int long, "%ld") DOCTEST_TO_STRING_OVERLOAD(int long unsigned, "%lu") DOCTEST_TO_STRING_OVERLOAD(int long long, "%lld") DOCTEST_TO_STRING_OVERLOAD(int long long unsigned, "%llu") String toString(std::nullptr_t) { return "NULL"; } #if DOCTEST_MSVC >= DOCTEST_COMPILER(19, 20, 0) // see this issue on why this is needed: https://github.com/doctest/doctest/issues/183 String toString(const std::string& in) { return in.c_str(); } #endif // VS 2019 Approx::Approx(double value) : m_epsilon(static_cast(std::numeric_limits::epsilon()) * 100) , m_scale(1.0) , m_value(value) {} Approx Approx::operator()(double value) const { Approx approx(value); approx.epsilon(m_epsilon); approx.scale(m_scale); return approx; } Approx& Approx::epsilon(double newEpsilon) { m_epsilon = newEpsilon; return *this; } Approx& Approx::scale(double newScale) { m_scale = newScale; return *this; } bool operator==(double lhs, const Approx& rhs) { // Thanks to Richard Harris for his help refining this formula return std::fabs(lhs - rhs.m_value) < rhs.m_epsilon * (rhs.m_scale + std::max(std::fabs(lhs), std::fabs(rhs.m_value))); } bool operator==(const Approx& lhs, double rhs) { return operator==(rhs, lhs); } bool operator!=(double lhs, const Approx& rhs) { return !operator==(lhs, rhs); } bool operator!=(const Approx& lhs, double rhs) { return !operator==(rhs, lhs); } bool operator<=(double lhs, const Approx& rhs) { return lhs < rhs.m_value || lhs == rhs; } bool operator<=(const Approx& lhs, double rhs) { return lhs.m_value < rhs || lhs == rhs; } bool operator>=(double lhs, const Approx& rhs) { return lhs > rhs.m_value || lhs == rhs; } bool operator>=(const Approx& lhs, double rhs) { return lhs.m_value > rhs || lhs == rhs; } bool operator<(double lhs, const Approx& rhs) { return lhs < rhs.m_value && lhs != rhs; } bool operator<(const Approx& lhs, double rhs) { return lhs.m_value < rhs && lhs != rhs; } bool operator>(double lhs, const Approx& rhs) { return lhs > rhs.m_value && lhs != rhs; } bool operator>(const Approx& lhs, double rhs) { return lhs.m_value > rhs && lhs != rhs; } String toString(const Approx& in) { // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) return "Approx( " + doctest::toString(in.m_value) + " )"; } const ContextOptions* getContextOptions() { return DOCTEST_BRANCH_ON_DISABLED(nullptr, g_cs); } } // namespace doctest #ifdef DOCTEST_CONFIG_DISABLE namespace doctest { Context::Context(int, const char* const*) {} Context::~Context() = default; void Context::applyCommandLine(int, const char* const*) {} void Context::addFilter(const char*, const char*) {} void Context::clearFilters() {} void Context::setOption(const char*, bool) {} void Context::setOption(const char*, int) {} void Context::setOption(const char*, const char*) {} bool Context::shouldExit() { return false; } void Context::setAsDefaultForAssertsOutOfTestCases() {} void Context::setAssertHandler(detail::assert_handler) {} void Context::setCout(std::ostream* out) {} int Context::run() { return 0; } IReporter::~IReporter() = default; int IReporter::get_num_active_contexts() { return 0; } const IContextScope* const* IReporter::get_active_contexts() { return nullptr; } int IReporter::get_num_stringified_contexts() { return 0; } const String* IReporter::get_stringified_contexts() { return nullptr; } int registerReporter(const char*, int, IReporter*) { return 0; } } // namespace doctest #else // DOCTEST_CONFIG_DISABLE #if !defined(DOCTEST_CONFIG_COLORS_NONE) #if !defined(DOCTEST_CONFIG_COLORS_WINDOWS) && !defined(DOCTEST_CONFIG_COLORS_ANSI) #ifdef DOCTEST_PLATFORM_WINDOWS #define DOCTEST_CONFIG_COLORS_WINDOWS #else // linux #define DOCTEST_CONFIG_COLORS_ANSI #endif // platform #endif // DOCTEST_CONFIG_COLORS_WINDOWS && DOCTEST_CONFIG_COLORS_ANSI #endif // DOCTEST_CONFIG_COLORS_NONE namespace doctest_detail_test_suite_ns { // holds the current test suite doctest::detail::TestSuite& getCurrentTestSuite() { static doctest::detail::TestSuite data{}; return data; } } // namespace doctest_detail_test_suite_ns namespace doctest { namespace { // the int (priority) is part of the key for automatic sorting - sadly one can register a // reporter with a duplicate name and a different priority but hopefully that won't happen often :| typedef std::map, reporterCreatorFunc> reporterMap; reporterMap& getReporters() { static reporterMap data; return data; } reporterMap& getListeners() { static reporterMap data; return data; } } // namespace namespace detail { #define DOCTEST_ITERATE_THROUGH_REPORTERS(function, ...) \ for(auto& curr_rep : g_cs->reporters_currently_used) \ curr_rep->function(__VA_ARGS__) bool checkIfShouldThrow(assertType::Enum at) { if(at & assertType::is_require) //!OCLINT bitwise operator in conditional return true; if((at & assertType::is_check) //!OCLINT bitwise operator in conditional && getContextOptions()->abort_after > 0 && (g_cs->numAssertsFailed + g_cs->numAssertsFailedCurrentTest_atomic) >= getContextOptions()->abort_after) return true; return false; } #ifndef DOCTEST_CONFIG_NO_EXCEPTIONS DOCTEST_NORETURN void throwException() { g_cs->shouldLogCurrentException = false; throw TestFailureException(); } // NOLINT(cert-err60-cpp) #else // DOCTEST_CONFIG_NO_EXCEPTIONS void throwException() {} #endif // DOCTEST_CONFIG_NO_EXCEPTIONS } // namespace detail namespace { using namespace detail; // matching of a string against a wildcard mask (case sensitivity configurable) taken from // https://www.codeproject.com/Articles/1088/Wildcard-string-compare-globbing int wildcmp(const char* str, const char* wild, bool caseSensitive) { const char* cp = str; const char* mp = wild; while((*str) && (*wild != '*')) { if((caseSensitive ? (*wild != *str) : (tolower(*wild) != tolower(*str))) && (*wild != '?')) { return 0; } wild++; str++; } while(*str) { if(*wild == '*') { if(!*++wild) { return 1; } mp = wild; cp = str + 1; } else if((caseSensitive ? (*wild == *str) : (tolower(*wild) == tolower(*str))) || (*wild == '?')) { wild++; str++; } else { wild = mp; //!OCLINT parameter reassignment str = cp++; //!OCLINT parameter reassignment } } while(*wild == '*') { wild++; } return !*wild; } //// C string hash function (djb2) - taken from http://www.cse.yorku.ca/~oz/hash.html //unsigned hashStr(unsigned const char* str) { // unsigned long hash = 5381; // char c; // while((c = *str++)) // hash = ((hash << 5) + hash) + c; // hash * 33 + c // return hash; //} // checks if the name matches any of the filters (and can be configured what to do when empty) bool matchesAny(const char* name, const std::vector& filters, bool matchEmpty, bool caseSensitive) { if(filters.empty() && matchEmpty) return true; for(auto& curr : filters) if(wildcmp(name, curr.c_str(), caseSensitive)) return true; return false; } } // namespace namespace detail { Subcase::Subcase(const String& name, const char* file, int line) : m_signature({name, file, line}) { auto* s = g_cs; // check subcase filters if(s->subcasesStack.size() < size_t(s->subcase_filter_levels)) { if(!matchesAny(m_signature.m_name.c_str(), s->filters[6], true, s->case_sensitive)) return; if(matchesAny(m_signature.m_name.c_str(), s->filters[7], false, s->case_sensitive)) return; } // if a Subcase on the same level has already been entered if(s->subcasesStack.size() < size_t(s->subcasesCurrentMaxLevel)) { s->should_reenter = true; return; } // push the current signature to the stack so we can check if the // current stack + the current new subcase have been traversed s->subcasesStack.push_back(m_signature); if(s->subcasesPassed.count(s->subcasesStack) != 0) { // pop - revert to previous stack since we've already passed this s->subcasesStack.pop_back(); return; } s->subcasesCurrentMaxLevel = s->subcasesStack.size(); m_entered = true; DOCTEST_ITERATE_THROUGH_REPORTERS(subcase_start, m_signature); } DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(4996) // std::uncaught_exception is deprecated in C++17 DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH("-Wdeprecated-declarations") DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wdeprecated-declarations") Subcase::~Subcase() { if(m_entered) { // only mark the subcase stack as passed if no subcases have been skipped if(g_cs->should_reenter == false) g_cs->subcasesPassed.insert(g_cs->subcasesStack); g_cs->subcasesStack.pop_back(); #if defined(__cpp_lib_uncaught_exceptions) && __cpp_lib_uncaught_exceptions >= 201411L && (!defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) if(std::uncaught_exceptions() > 0 #else if(std::uncaught_exception() #endif && g_cs->shouldLogCurrentException) { DOCTEST_ITERATE_THROUGH_REPORTERS( test_case_exception, {"exception thrown in subcase - will translate later " "when the whole test case has been exited (cannot " "translate while there is an active exception)", false}); g_cs->shouldLogCurrentException = false; } DOCTEST_ITERATE_THROUGH_REPORTERS(subcase_end, DOCTEST_EMPTY); } } DOCTEST_CLANG_SUPPRESS_WARNING_POP DOCTEST_GCC_SUPPRESS_WARNING_POP DOCTEST_MSVC_SUPPRESS_WARNING_POP Subcase::operator bool() const { return m_entered; } Result::Result(bool passed, const String& decomposition) : m_passed(passed) , m_decomp(decomposition) {} ExpressionDecomposer::ExpressionDecomposer(assertType::Enum at) : m_at(at) {} TestSuite& TestSuite::operator*(const char* in) { m_test_suite = in; return *this; } TestCase::TestCase(funcType test, const char* file, unsigned line, const TestSuite& test_suite, const char* type, int template_id) { m_file = file; m_line = line; m_name = nullptr; // will be later overridden in operator* m_test_suite = test_suite.m_test_suite; m_description = test_suite.m_description; m_skip = test_suite.m_skip; m_no_breaks = test_suite.m_no_breaks; m_no_output = test_suite.m_no_output; m_may_fail = test_suite.m_may_fail; m_should_fail = test_suite.m_should_fail; m_expected_failures = test_suite.m_expected_failures; m_timeout = test_suite.m_timeout; m_test = test; m_type = type; m_template_id = template_id; } TestCase::TestCase(const TestCase& other) : TestCaseData() { *this = other; } DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(26434) // hides a non-virtual function DOCTEST_MSVC_SUPPRESS_WARNING(26437) // Do not slice TestCase& TestCase::operator=(const TestCase& other) { static_cast(*this) = static_cast(other); m_test = other.m_test; m_type = other.m_type; m_template_id = other.m_template_id; m_full_name = other.m_full_name; if(m_template_id != -1) m_name = m_full_name.c_str(); return *this; } DOCTEST_MSVC_SUPPRESS_WARNING_POP TestCase& TestCase::operator*(const char* in) { m_name = in; // make a new name with an appended type for templated test case if(m_template_id != -1) { m_full_name = String(m_name) + m_type; // redirect the name to point to the newly constructed full name m_name = m_full_name.c_str(); } return *this; } bool TestCase::operator<(const TestCase& other) const { // this will be used only to differentiate between test cases - not relevant for sorting if(m_line != other.m_line) return m_line < other.m_line; const int name_cmp = strcmp(m_name, other.m_name); if(name_cmp != 0) return name_cmp < 0; const int file_cmp = m_file.compare(other.m_file); if(file_cmp != 0) return file_cmp < 0; return m_template_id < other.m_template_id; } // all the registered tests std::set& getRegisteredTests() { static std::set data; return data; } } // namespace detail namespace { using namespace detail; // for sorting tests by file/line bool fileOrderComparator(const TestCase* lhs, const TestCase* rhs) { // this is needed because MSVC gives different case for drive letters // for __FILE__ when evaluated in a header and a source file const int res = lhs->m_file.compare(rhs->m_file, bool(DOCTEST_MSVC)); if(res != 0) return res < 0; if(lhs->m_line != rhs->m_line) return lhs->m_line < rhs->m_line; return lhs->m_template_id < rhs->m_template_id; } // for sorting tests by suite/file/line bool suiteOrderComparator(const TestCase* lhs, const TestCase* rhs) { const int res = std::strcmp(lhs->m_test_suite, rhs->m_test_suite); if(res != 0) return res < 0; return fileOrderComparator(lhs, rhs); } // for sorting tests by name/suite/file/line bool nameOrderComparator(const TestCase* lhs, const TestCase* rhs) { const int res = std::strcmp(lhs->m_name, rhs->m_name); if(res != 0) return res < 0; return suiteOrderComparator(lhs, rhs); } DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wdeprecated-declarations") void color_to_stream(std::ostream& s, Color::Enum code) { static_cast(s); // for DOCTEST_CONFIG_COLORS_NONE or DOCTEST_CONFIG_COLORS_WINDOWS static_cast(code); // for DOCTEST_CONFIG_COLORS_NONE #ifdef DOCTEST_CONFIG_COLORS_ANSI if(g_no_colors || (isatty(STDOUT_FILENO) == false && getContextOptions()->force_colors == false)) return; auto col = ""; // clang-format off switch(code) { //!OCLINT missing break in switch statement / unnecessary default statement in covered switch statement case Color::Red: col = "[0;31m"; break; case Color::Green: col = "[0;32m"; break; case Color::Blue: col = "[0;34m"; break; case Color::Cyan: col = "[0;36m"; break; case Color::Yellow: col = "[0;33m"; break; case Color::Grey: col = "[1;30m"; break; case Color::LightGrey: col = "[0;37m"; break; case Color::BrightRed: col = "[1;31m"; break; case Color::BrightGreen: col = "[1;32m"; break; case Color::BrightWhite: col = "[1;37m"; break; case Color::Bright: // invalid case Color::None: case Color::White: default: col = "[0m"; } // clang-format on s << "\033" << col; #endif // DOCTEST_CONFIG_COLORS_ANSI #ifdef DOCTEST_CONFIG_COLORS_WINDOWS if(g_no_colors || (_isatty(_fileno(stdout)) == false && getContextOptions()->force_colors == false)) return; static struct ConsoleHelper { HANDLE stdoutHandle; WORD origFgAttrs; WORD origBgAttrs; ConsoleHelper() { stdoutHandle = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_SCREEN_BUFFER_INFO csbiInfo; GetConsoleScreenBufferInfo(stdoutHandle, &csbiInfo); origFgAttrs = csbiInfo.wAttributes & ~(BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_INTENSITY); origBgAttrs = csbiInfo.wAttributes & ~(FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY); } } ch; #define DOCTEST_SET_ATTR(x) SetConsoleTextAttribute(ch.stdoutHandle, x | ch.origBgAttrs) // clang-format off switch (code) { case Color::White: DOCTEST_SET_ATTR(FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE); break; case Color::Red: DOCTEST_SET_ATTR(FOREGROUND_RED); break; case Color::Green: DOCTEST_SET_ATTR(FOREGROUND_GREEN); break; case Color::Blue: DOCTEST_SET_ATTR(FOREGROUND_BLUE); break; case Color::Cyan: DOCTEST_SET_ATTR(FOREGROUND_BLUE | FOREGROUND_GREEN); break; case Color::Yellow: DOCTEST_SET_ATTR(FOREGROUND_RED | FOREGROUND_GREEN); break; case Color::Grey: DOCTEST_SET_ATTR(0); break; case Color::LightGrey: DOCTEST_SET_ATTR(FOREGROUND_INTENSITY); break; case Color::BrightRed: DOCTEST_SET_ATTR(FOREGROUND_INTENSITY | FOREGROUND_RED); break; case Color::BrightGreen: DOCTEST_SET_ATTR(FOREGROUND_INTENSITY | FOREGROUND_GREEN); break; case Color::BrightWhite: DOCTEST_SET_ATTR(FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE); break; case Color::None: case Color::Bright: // invalid default: DOCTEST_SET_ATTR(ch.origFgAttrs); } // clang-format on #endif // DOCTEST_CONFIG_COLORS_WINDOWS } DOCTEST_CLANG_SUPPRESS_WARNING_POP std::vector& getExceptionTranslators() { static std::vector data; return data; } String translateActiveException() { #ifndef DOCTEST_CONFIG_NO_EXCEPTIONS String res; auto& translators = getExceptionTranslators(); for(auto& curr : translators) if(curr->translate(res)) return res; // clang-format off DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH("-Wcatch-value") try { throw; } catch(std::exception& ex) { return ex.what(); } catch(std::string& msg) { return msg.c_str(); } catch(const char* msg) { return msg; } catch(...) { return "unknown exception"; } DOCTEST_GCC_SUPPRESS_WARNING_POP // clang-format on #else // DOCTEST_CONFIG_NO_EXCEPTIONS return ""; #endif // DOCTEST_CONFIG_NO_EXCEPTIONS } } // namespace namespace detail { // used by the macros for registering tests int regTest(const TestCase& tc) { getRegisteredTests().insert(tc); return 0; } // sets the current test suite int setTestSuite(const TestSuite& ts) { doctest_detail_test_suite_ns::getCurrentTestSuite() = ts; return 0; } #ifdef DOCTEST_IS_DEBUGGER_ACTIVE bool isDebuggerActive() { return DOCTEST_IS_DEBUGGER_ACTIVE(); } #else // DOCTEST_IS_DEBUGGER_ACTIVE #ifdef DOCTEST_PLATFORM_LINUX class ErrnoGuard { public: ErrnoGuard() : m_oldErrno(errno) {} ~ErrnoGuard() { errno = m_oldErrno; } private: int m_oldErrno; }; // See the comments in Catch2 for the reasoning behind this implementation: // https://github.com/catchorg/Catch2/blob/v2.13.1/include/internal/catch_debugger.cpp#L79-L102 bool isDebuggerActive() { ErrnoGuard guard; std::ifstream in("/proc/self/status"); for(std::string line; std::getline(in, line);) { static const int PREFIX_LEN = 11; if(line.compare(0, PREFIX_LEN, "TracerPid:\t") == 0) { return line.length() > PREFIX_LEN && line[PREFIX_LEN] != '0'; } } return false; } #elif defined(DOCTEST_PLATFORM_MAC) // The following function is taken directly from the following technical note: // https://developer.apple.com/library/archive/qa/qa1361/_index.html // Returns true if the current process is being debugged (either // running under the debugger or has a debugger attached post facto). bool isDebuggerActive() { int mib[4]; kinfo_proc info; size_t size; // Initialize the flags so that, if sysctl fails for some bizarre // reason, we get a predictable result. info.kp_proc.p_flag = 0; // Initialize mib, which tells sysctl the info we want, in this case // we're looking for information about a specific process ID. mib[0] = CTL_KERN; mib[1] = KERN_PROC; mib[2] = KERN_PROC_PID; mib[3] = getpid(); // Call sysctl. size = sizeof(info); if(sysctl(mib, DOCTEST_COUNTOF(mib), &info, &size, 0, 0) != 0) { std::cerr << "\nCall to sysctl failed - unable to determine if debugger is active **\n"; return false; } // We're being debugged if the P_TRACED flag is set. return ((info.kp_proc.p_flag & P_TRACED) != 0); } #elif DOCTEST_MSVC || defined(__MINGW32__) || defined(__MINGW64__) bool isDebuggerActive() { return ::IsDebuggerPresent() != 0; } #else bool isDebuggerActive() { return false; } #endif // Platform #endif // DOCTEST_IS_DEBUGGER_ACTIVE void registerExceptionTranslatorImpl(const IExceptionTranslator* et) { if(std::find(getExceptionTranslators().begin(), getExceptionTranslators().end(), et) == getExceptionTranslators().end()) getExceptionTranslators().push_back(et); } #ifdef DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING void toStream(std::ostream* s, char* in) { *s << in; } void toStream(std::ostream* s, const char* in) { *s << in; } #endif // DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING void toStream(std::ostream* s, bool in) { *s << std::boolalpha << in << std::noboolalpha; } void toStream(std::ostream* s, float in) { *s << in; } void toStream(std::ostream* s, double in) { *s << in; } void toStream(std::ostream* s, double long in) { *s << in; } void toStream(std::ostream* s, char in) { *s << in; } void toStream(std::ostream* s, char signed in) { *s << in; } void toStream(std::ostream* s, char unsigned in) { *s << in; } void toStream(std::ostream* s, int short in) { *s << in; } void toStream(std::ostream* s, int short unsigned in) { *s << in; } void toStream(std::ostream* s, int in) { *s << in; } void toStream(std::ostream* s, int unsigned in) { *s << in; } void toStream(std::ostream* s, int long in) { *s << in; } void toStream(std::ostream* s, int long unsigned in) { *s << in; } void toStream(std::ostream* s, int long long in) { *s << in; } void toStream(std::ostream* s, int long long unsigned in) { *s << in; } DOCTEST_THREAD_LOCAL std::vector g_infoContexts; // for logging with INFO() ContextScopeBase::ContextScopeBase() { g_infoContexts.push_back(this); } ContextScopeBase::ContextScopeBase(ContextScopeBase&& other) { if (other.need_to_destroy) { other.destroy(); } other.need_to_destroy = false; g_infoContexts.push_back(this); } DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(4996) // std::uncaught_exception is deprecated in C++17 DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH("-Wdeprecated-declarations") DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wdeprecated-declarations") // destroy cannot be inlined into the destructor because that would mean calling stringify after // ContextScope has been destroyed (base class destructors run after derived class destructors). // Instead, ContextScope calls this method directly from its destructor. void ContextScopeBase::destroy() { #if defined(__cpp_lib_uncaught_exceptions) && __cpp_lib_uncaught_exceptions >= 201411L && (!defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) if(std::uncaught_exceptions() > 0) { #else if(std::uncaught_exception()) { #endif std::ostringstream s; this->stringify(&s); g_cs->stringifiedContexts.push_back(s.str().c_str()); } g_infoContexts.pop_back(); } DOCTEST_CLANG_SUPPRESS_WARNING_POP DOCTEST_GCC_SUPPRESS_WARNING_POP DOCTEST_MSVC_SUPPRESS_WARNING_POP } // namespace detail namespace { using namespace detail; #if !defined(DOCTEST_CONFIG_POSIX_SIGNALS) && !defined(DOCTEST_CONFIG_WINDOWS_SEH) struct FatalConditionHandler { static void reset() {} static void allocateAltStackMem() {} static void freeAltStackMem() {} }; #else // DOCTEST_CONFIG_POSIX_SIGNALS || DOCTEST_CONFIG_WINDOWS_SEH void reportFatal(const std::string&); #ifdef DOCTEST_PLATFORM_WINDOWS struct SignalDefs { DWORD id; const char* name; }; // There is no 1-1 mapping between signals and windows exceptions. // Windows can easily distinguish between SO and SigSegV, // but SigInt, SigTerm, etc are handled differently. SignalDefs signalDefs[] = { {static_cast(EXCEPTION_ILLEGAL_INSTRUCTION), "SIGILL - Illegal instruction signal"}, {static_cast(EXCEPTION_STACK_OVERFLOW), "SIGSEGV - Stack overflow"}, {static_cast(EXCEPTION_ACCESS_VIOLATION), "SIGSEGV - Segmentation violation signal"}, {static_cast(EXCEPTION_INT_DIVIDE_BY_ZERO), "Divide by zero error"}, }; struct FatalConditionHandler { static LONG CALLBACK handleException(PEXCEPTION_POINTERS ExceptionInfo) { // Multiple threads may enter this filter/handler at once. We want the error message to be printed on the // console just once no matter how many threads have crashed. static std::mutex mutex; static bool execute = true; { std::lock_guard lock(mutex); if(execute) { bool reported = false; for(size_t i = 0; i < DOCTEST_COUNTOF(signalDefs); ++i) { if(ExceptionInfo->ExceptionRecord->ExceptionCode == signalDefs[i].id) { reportFatal(signalDefs[i].name); reported = true; break; } } if(reported == false) reportFatal("Unhandled SEH exception caught"); if(isDebuggerActive() && !g_cs->no_breaks) DOCTEST_BREAK_INTO_DEBUGGER(); } execute = false; } std::exit(EXIT_FAILURE); } static void allocateAltStackMem() {} static void freeAltStackMem() {} FatalConditionHandler() { isSet = true; // 32k seems enough for doctest to handle stack overflow, // but the value was found experimentally, so there is no strong guarantee guaranteeSize = 32 * 1024; // Register an unhandled exception filter previousTop = SetUnhandledExceptionFilter(handleException); // Pass in guarantee size to be filled SetThreadStackGuarantee(&guaranteeSize); // On Windows uncaught exceptions from another thread, exceptions from // destructors, or calls to std::terminate are not a SEH exception // The terminal handler gets called when: // - std::terminate is called FROM THE TEST RUNNER THREAD // - an exception is thrown from a destructor FROM THE TEST RUNNER THREAD original_terminate_handler = std::get_terminate(); std::set_terminate([]() DOCTEST_NOEXCEPT { reportFatal("Terminate handler called"); if(isDebuggerActive() && !g_cs->no_breaks) DOCTEST_BREAK_INTO_DEBUGGER(); std::exit(EXIT_FAILURE); // explicitly exit - otherwise the SIGABRT handler may be called as well }); // SIGABRT is raised when: // - std::terminate is called FROM A DIFFERENT THREAD // - an exception is thrown from a destructor FROM A DIFFERENT THREAD // - an uncaught exception is thrown FROM A DIFFERENT THREAD prev_sigabrt_handler = std::signal(SIGABRT, [](int signal) DOCTEST_NOEXCEPT { if(signal == SIGABRT) { reportFatal("SIGABRT - Abort (abnormal termination) signal"); if(isDebuggerActive() && !g_cs->no_breaks) DOCTEST_BREAK_INTO_DEBUGGER(); std::exit(EXIT_FAILURE); } }); // The following settings are taken from google test, and more // specifically from UnitTest::Run() inside of gtest.cc // the user does not want to see pop-up dialogs about crashes prev_error_mode_1 = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOALIGNMENTFAULTEXCEPT | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX); // This forces the abort message to go to stderr in all circumstances. prev_error_mode_2 = _set_error_mode(_OUT_TO_STDERR); // In the debug version, Visual Studio pops up a separate dialog // offering a choice to debug the aborted program - we want to disable that. prev_abort_behavior = _set_abort_behavior(0x0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT); // In debug mode, the Windows CRT can crash with an assertion over invalid // input (e.g. passing an invalid file descriptor). The default handling // for these assertions is to pop up a dialog and wait for user input. // Instead ask the CRT to dump such assertions to stderr non-interactively. prev_report_mode = _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); prev_report_file = _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); } static void reset() { if(isSet) { // Unregister handler and restore the old guarantee SetUnhandledExceptionFilter(previousTop); SetThreadStackGuarantee(&guaranteeSize); std::set_terminate(original_terminate_handler); std::signal(SIGABRT, prev_sigabrt_handler); SetErrorMode(prev_error_mode_1); _set_error_mode(prev_error_mode_2); _set_abort_behavior(prev_abort_behavior, _WRITE_ABORT_MSG | _CALL_REPORTFAULT); static_cast(_CrtSetReportMode(_CRT_ASSERT, prev_report_mode)); static_cast(_CrtSetReportFile(_CRT_ASSERT, prev_report_file)); isSet = false; } } ~FatalConditionHandler() { reset(); } private: static UINT prev_error_mode_1; static int prev_error_mode_2; static unsigned int prev_abort_behavior; static int prev_report_mode; static _HFILE prev_report_file; static void (DOCTEST_CDECL *prev_sigabrt_handler)(int); static std::terminate_handler original_terminate_handler; static bool isSet; static ULONG guaranteeSize; static LPTOP_LEVEL_EXCEPTION_FILTER previousTop; }; UINT FatalConditionHandler::prev_error_mode_1; int FatalConditionHandler::prev_error_mode_2; unsigned int FatalConditionHandler::prev_abort_behavior; int FatalConditionHandler::prev_report_mode; _HFILE FatalConditionHandler::prev_report_file; void (DOCTEST_CDECL *FatalConditionHandler::prev_sigabrt_handler)(int); std::terminate_handler FatalConditionHandler::original_terminate_handler; bool FatalConditionHandler::isSet = false; ULONG FatalConditionHandler::guaranteeSize = 0; LPTOP_LEVEL_EXCEPTION_FILTER FatalConditionHandler::previousTop = nullptr; #else // DOCTEST_PLATFORM_WINDOWS struct SignalDefs { int id; const char* name; }; SignalDefs signalDefs[] = {{SIGINT, "SIGINT - Terminal interrupt signal"}, {SIGILL, "SIGILL - Illegal instruction signal"}, {SIGFPE, "SIGFPE - Floating point error signal"}, {SIGSEGV, "SIGSEGV - Segmentation violation signal"}, {SIGTERM, "SIGTERM - Termination request signal"}, {SIGABRT, "SIGABRT - Abort (abnormal termination) signal"}}; struct FatalConditionHandler { static bool isSet; static struct sigaction oldSigActions[DOCTEST_COUNTOF(signalDefs)]; static stack_t oldSigStack; static size_t altStackSize; static char* altStackMem; static void handleSignal(int sig) { const char* name = ""; for(std::size_t i = 0; i < DOCTEST_COUNTOF(signalDefs); ++i) { SignalDefs& def = signalDefs[i]; if(sig == def.id) { name = def.name; break; } } reset(); reportFatal(name); raise(sig); } static void allocateAltStackMem() { altStackMem = new char[altStackSize]; } static void freeAltStackMem() { delete[] altStackMem; } FatalConditionHandler() { isSet = true; stack_t sigStack; sigStack.ss_sp = altStackMem; sigStack.ss_size = altStackSize; sigStack.ss_flags = 0; sigaltstack(&sigStack, &oldSigStack); struct sigaction sa = {}; sa.sa_handler = handleSignal; // NOLINT sa.sa_flags = SA_ONSTACK; for(std::size_t i = 0; i < DOCTEST_COUNTOF(signalDefs); ++i) { sigaction(signalDefs[i].id, &sa, &oldSigActions[i]); } } ~FatalConditionHandler() { reset(); } static void reset() { if(isSet) { // Set signals back to previous values -- hopefully nobody overwrote them in the meantime for(std::size_t i = 0; i < DOCTEST_COUNTOF(signalDefs); ++i) { sigaction(signalDefs[i].id, &oldSigActions[i], nullptr); } // Return the old stack sigaltstack(&oldSigStack, nullptr); isSet = false; } } }; bool FatalConditionHandler::isSet = false; struct sigaction FatalConditionHandler::oldSigActions[DOCTEST_COUNTOF(signalDefs)] = {}; stack_t FatalConditionHandler::oldSigStack = {}; size_t FatalConditionHandler::altStackSize = 4 * SIGSTKSZ; char* FatalConditionHandler::altStackMem = nullptr; #endif // DOCTEST_PLATFORM_WINDOWS #endif // DOCTEST_CONFIG_POSIX_SIGNALS || DOCTEST_CONFIG_WINDOWS_SEH } // namespace namespace { using namespace detail; #ifdef DOCTEST_PLATFORM_WINDOWS #define DOCTEST_OUTPUT_DEBUG_STRING(text) ::OutputDebugStringA(text) #else // TODO: integration with XCode and other IDEs #define DOCTEST_OUTPUT_DEBUG_STRING(text) // NOLINT(clang-diagnostic-unused-macros) #endif // Platform void addAssert(assertType::Enum at) { if((at & assertType::is_warn) == 0) //!OCLINT bitwise operator in conditional g_cs->numAssertsCurrentTest_atomic++; } void addFailedAssert(assertType::Enum at) { if((at & assertType::is_warn) == 0) //!OCLINT bitwise operator in conditional g_cs->numAssertsFailedCurrentTest_atomic++; } #if defined(DOCTEST_CONFIG_POSIX_SIGNALS) || defined(DOCTEST_CONFIG_WINDOWS_SEH) void reportFatal(const std::string& message) { g_cs->failure_flags |= TestCaseFailureReason::Crash; DOCTEST_ITERATE_THROUGH_REPORTERS(test_case_exception, {message.c_str(), true}); while(g_cs->subcasesStack.size()) { g_cs->subcasesStack.pop_back(); DOCTEST_ITERATE_THROUGH_REPORTERS(subcase_end, DOCTEST_EMPTY); } g_cs->finalizeTestCaseData(); DOCTEST_ITERATE_THROUGH_REPORTERS(test_case_end, *g_cs); DOCTEST_ITERATE_THROUGH_REPORTERS(test_run_end, *g_cs); } #endif // DOCTEST_CONFIG_POSIX_SIGNALS || DOCTEST_CONFIG_WINDOWS_SEH } // namespace namespace detail { ResultBuilder::ResultBuilder(assertType::Enum at, const char* file, int line, const char* expr, const char* exception_type, const char* exception_string) { m_test_case = g_cs->currentTest; m_at = at; m_file = file; m_line = line; m_expr = expr; m_failed = true; m_threw = false; m_threw_as = false; m_exception_type = exception_type; m_exception_string = exception_string; #if DOCTEST_MSVC if(m_expr[0] == ' ') // this happens when variadic macros are disabled under MSVC ++m_expr; #endif // MSVC } void ResultBuilder::setResult(const Result& res) { m_decomp = res.m_decomp; m_failed = !res.m_passed; } void ResultBuilder::translateException() { m_threw = true; m_exception = translateActiveException(); } bool ResultBuilder::log() { if(m_at & assertType::is_throws) { //!OCLINT bitwise operator in conditional m_failed = !m_threw; } else if((m_at & assertType::is_throws_as) && (m_at & assertType::is_throws_with)) { //!OCLINT m_failed = !m_threw_as || (m_exception != m_exception_string); } else if(m_at & assertType::is_throws_as) { //!OCLINT bitwise operator in conditional m_failed = !m_threw_as; } else if(m_at & assertType::is_throws_with) { //!OCLINT bitwise operator in conditional m_failed = m_exception != m_exception_string; } else if(m_at & assertType::is_nothrow) { //!OCLINT bitwise operator in conditional m_failed = m_threw; } if(m_exception.size()) m_exception = "\"" + m_exception + "\""; if(is_running_in_test) { addAssert(m_at); DOCTEST_ITERATE_THROUGH_REPORTERS(log_assert, *this); if(m_failed) addFailedAssert(m_at); } else if(m_failed) { failed_out_of_a_testing_context(*this); } return m_failed && isDebuggerActive() && !getContextOptions()->no_breaks && (g_cs->currentTest == nullptr || !g_cs->currentTest->m_no_breaks); // break into debugger } void ResultBuilder::react() const { if(m_failed && checkIfShouldThrow(m_at)) throwException(); } void failed_out_of_a_testing_context(const AssertData& ad) { if(g_cs->ah) g_cs->ah(ad); else std::abort(); } bool decomp_assert(assertType::Enum at, const char* file, int line, const char* expr, Result result) { bool failed = !result.m_passed; // ################################################################################### // IF THE DEBUGGER BREAKS HERE - GO 1 LEVEL UP IN THE CALLSTACK FOR THE FAILING ASSERT // THIS IS THE EFFECT OF HAVING 'DOCTEST_CONFIG_SUPER_FAST_ASSERTS' DEFINED // ################################################################################### DOCTEST_ASSERT_OUT_OF_TESTS(result.m_decomp); DOCTEST_ASSERT_IN_TESTS(result.m_decomp); // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) return !failed; } MessageBuilder::MessageBuilder(const char* file, int line, assertType::Enum severity) { m_stream = tlssPush(); m_file = file; m_line = line; m_severity = severity; } MessageBuilder::~MessageBuilder() { if (!logged) tlssPop(); } IExceptionTranslator::IExceptionTranslator() = default; IExceptionTranslator::~IExceptionTranslator() = default; bool MessageBuilder::log() { if (!logged) { m_string = tlssPop(); logged = true; } DOCTEST_ITERATE_THROUGH_REPORTERS(log_message, *this); const bool isWarn = m_severity & assertType::is_warn; // warn is just a message in this context so we don't treat it as an assert if(!isWarn) { addAssert(m_severity); addFailedAssert(m_severity); } return isDebuggerActive() && !getContextOptions()->no_breaks && !isWarn && (g_cs->currentTest == nullptr || !g_cs->currentTest->m_no_breaks); // break into debugger } void MessageBuilder::react() { if(m_severity & assertType::is_require) //!OCLINT bitwise operator in conditional throwException(); } } // namespace detail namespace { using namespace detail; // clang-format off // ================================================================================================= // The following code has been taken verbatim from Catch2/include/internal/catch_xmlwriter.h/cpp // This is done so cherry-picking bug fixes is trivial - even the style/formatting is untouched. // ================================================================================================= class XmlEncode { public: enum ForWhat { ForTextNodes, ForAttributes }; XmlEncode( std::string const& str, ForWhat forWhat = ForTextNodes ); void encodeTo( std::ostream& os ) const; friend std::ostream& operator << ( std::ostream& os, XmlEncode const& xmlEncode ); private: std::string m_str; ForWhat m_forWhat; }; class XmlWriter { public: class ScopedElement { public: ScopedElement( XmlWriter* writer ); ScopedElement( ScopedElement&& other ) DOCTEST_NOEXCEPT; ScopedElement& operator=( ScopedElement&& other ) DOCTEST_NOEXCEPT; ~ScopedElement(); ScopedElement& writeText( std::string const& text, bool indent = true ); template ScopedElement& writeAttribute( std::string const& name, T const& attribute ) { m_writer->writeAttribute( name, attribute ); return *this; } private: mutable XmlWriter* m_writer = nullptr; }; XmlWriter( std::ostream& os = std::cout ); ~XmlWriter(); XmlWriter( XmlWriter const& ) = delete; XmlWriter& operator=( XmlWriter const& ) = delete; XmlWriter& startElement( std::string const& name ); ScopedElement scopedElement( std::string const& name ); XmlWriter& endElement(); XmlWriter& writeAttribute( std::string const& name, std::string const& attribute ); XmlWriter& writeAttribute( std::string const& name, const char* attribute ); XmlWriter& writeAttribute( std::string const& name, bool attribute ); template XmlWriter& writeAttribute( std::string const& name, T const& attribute ) { std::stringstream rss; rss << attribute; return writeAttribute( name, rss.str() ); } XmlWriter& writeText( std::string const& text, bool indent = true ); //XmlWriter& writeComment( std::string const& text ); //void writeStylesheetRef( std::string const& url ); //XmlWriter& writeBlankLine(); void ensureTagClosed(); private: void writeDeclaration(); void newlineIfNecessary(); bool m_tagIsOpen = false; bool m_needsNewline = false; std::vector m_tags; std::string m_indent; std::ostream& m_os; }; // ================================================================================================= // The following code has been taken verbatim from Catch2/include/internal/catch_xmlwriter.h/cpp // This is done so cherry-picking bug fixes is trivial - even the style/formatting is untouched. // ================================================================================================= using uchar = unsigned char; namespace { size_t trailingBytes(unsigned char c) { if ((c & 0xE0) == 0xC0) { return 2; } if ((c & 0xF0) == 0xE0) { return 3; } if ((c & 0xF8) == 0xF0) { return 4; } DOCTEST_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered"); } uint32_t headerValue(unsigned char c) { if ((c & 0xE0) == 0xC0) { return c & 0x1F; } if ((c & 0xF0) == 0xE0) { return c & 0x0F; } if ((c & 0xF8) == 0xF0) { return c & 0x07; } DOCTEST_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered"); } void hexEscapeChar(std::ostream& os, unsigned char c) { std::ios_base::fmtflags f(os.flags()); os << "\\x" << std::uppercase << std::hex << std::setfill('0') << std::setw(2) << static_cast(c); os.flags(f); } } // anonymous namespace XmlEncode::XmlEncode( std::string const& str, ForWhat forWhat ) : m_str( str ), m_forWhat( forWhat ) {} void XmlEncode::encodeTo( std::ostream& os ) const { // Apostrophe escaping not necessary if we always use " to write attributes // (see: https://www.w3.org/TR/xml/#syntax) for( std::size_t idx = 0; idx < m_str.size(); ++ idx ) { uchar c = m_str[idx]; switch (c) { case '<': os << "<"; break; case '&': os << "&"; break; case '>': // See: https://www.w3.org/TR/xml/#syntax if (idx > 2 && m_str[idx - 1] == ']' && m_str[idx - 2] == ']') os << ">"; else os << c; break; case '\"': if (m_forWhat == ForAttributes) os << """; else os << c; break; default: // Check for control characters and invalid utf-8 // Escape control characters in standard ascii // see https://stackoverflow.com/questions/404107/why-are-control-characters-illegal-in-xml-1-0 if (c < 0x09 || (c > 0x0D && c < 0x20) || c == 0x7F) { hexEscapeChar(os, c); break; } // Plain ASCII: Write it to stream if (c < 0x7F) { os << c; break; } // UTF-8 territory // Check if the encoding is valid and if it is not, hex escape bytes. // Important: We do not check the exact decoded values for validity, only the encoding format // First check that this bytes is a valid lead byte: // This means that it is not encoded as 1111 1XXX // Or as 10XX XXXX if (c < 0xC0 || c >= 0xF8) { hexEscapeChar(os, c); break; } auto encBytes = trailingBytes(c); // Are there enough bytes left to avoid accessing out-of-bounds memory? if (idx + encBytes - 1 >= m_str.size()) { hexEscapeChar(os, c); break; } // The header is valid, check data // The next encBytes bytes must together be a valid utf-8 // This means: bitpattern 10XX XXXX and the extracted value is sane (ish) bool valid = true; uint32_t value = headerValue(c); for (std::size_t n = 1; n < encBytes; ++n) { uchar nc = m_str[idx + n]; valid &= ((nc & 0xC0) == 0x80); value = (value << 6) | (nc & 0x3F); } if ( // Wrong bit pattern of following bytes (!valid) || // Overlong encodings (value < 0x80) || ( value < 0x800 && encBytes > 2) || // removed "0x80 <= value &&" because redundant (0x800 < value && value < 0x10000 && encBytes > 3) || // Encoded value out of range (value >= 0x110000) ) { hexEscapeChar(os, c); break; } // If we got here, this is in fact a valid(ish) utf-8 sequence for (std::size_t n = 0; n < encBytes; ++n) { os << m_str[idx + n]; } idx += encBytes - 1; break; } } } std::ostream& operator << ( std::ostream& os, XmlEncode const& xmlEncode ) { xmlEncode.encodeTo( os ); return os; } XmlWriter::ScopedElement::ScopedElement( XmlWriter* writer ) : m_writer( writer ) {} XmlWriter::ScopedElement::ScopedElement( ScopedElement&& other ) DOCTEST_NOEXCEPT : m_writer( other.m_writer ){ other.m_writer = nullptr; } XmlWriter::ScopedElement& XmlWriter::ScopedElement::operator=( ScopedElement&& other ) DOCTEST_NOEXCEPT { if ( m_writer ) { m_writer->endElement(); } m_writer = other.m_writer; other.m_writer = nullptr; return *this; } XmlWriter::ScopedElement::~ScopedElement() { if( m_writer ) m_writer->endElement(); } XmlWriter::ScopedElement& XmlWriter::ScopedElement::writeText( std::string const& text, bool indent ) { m_writer->writeText( text, indent ); return *this; } XmlWriter::XmlWriter( std::ostream& os ) : m_os( os ) { writeDeclaration(); } XmlWriter::~XmlWriter() { while( !m_tags.empty() ) endElement(); } XmlWriter& XmlWriter::startElement( std::string const& name ) { ensureTagClosed(); newlineIfNecessary(); m_os << m_indent << '<' << name; m_tags.push_back( name ); m_indent += " "; m_tagIsOpen = true; return *this; } XmlWriter::ScopedElement XmlWriter::scopedElement( std::string const& name ) { ScopedElement scoped( this ); startElement( name ); return scoped; } XmlWriter& XmlWriter::endElement() { newlineIfNecessary(); m_indent = m_indent.substr( 0, m_indent.size()-2 ); if( m_tagIsOpen ) { m_os << "/>"; m_tagIsOpen = false; } else { m_os << m_indent << ""; } m_os << std::endl; m_tags.pop_back(); return *this; } XmlWriter& XmlWriter::writeAttribute( std::string const& name, std::string const& attribute ) { if( !name.empty() && !attribute.empty() ) m_os << ' ' << name << "=\"" << XmlEncode( attribute, XmlEncode::ForAttributes ) << '"'; return *this; } XmlWriter& XmlWriter::writeAttribute( std::string const& name, const char* attribute ) { if( !name.empty() && attribute && attribute[0] != '\0' ) m_os << ' ' << name << "=\"" << XmlEncode( attribute, XmlEncode::ForAttributes ) << '"'; return *this; } XmlWriter& XmlWriter::writeAttribute( std::string const& name, bool attribute ) { m_os << ' ' << name << "=\"" << ( attribute ? "true" : "false" ) << '"'; return *this; } XmlWriter& XmlWriter::writeText( std::string const& text, bool indent ) { if( !text.empty() ){ bool tagWasOpen = m_tagIsOpen; ensureTagClosed(); if( tagWasOpen && indent ) m_os << m_indent; m_os << XmlEncode( text ); m_needsNewline = true; } return *this; } //XmlWriter& XmlWriter::writeComment( std::string const& text ) { // ensureTagClosed(); // m_os << m_indent << ""; // m_needsNewline = true; // return *this; //} //void XmlWriter::writeStylesheetRef( std::string const& url ) { // m_os << "\n"; //} //XmlWriter& XmlWriter::writeBlankLine() { // ensureTagClosed(); // m_os << '\n'; // return *this; //} void XmlWriter::ensureTagClosed() { if( m_tagIsOpen ) { m_os << ">" << std::endl; m_tagIsOpen = false; } } void XmlWriter::writeDeclaration() { m_os << "\n"; } void XmlWriter::newlineIfNecessary() { if( m_needsNewline ) { m_os << std::endl; m_needsNewline = false; } } // ================================================================================================= // End of copy-pasted code from Catch // ================================================================================================= // clang-format on struct XmlReporter : public IReporter { XmlWriter xml; std::mutex mutex; // caching pointers/references to objects of these types - safe to do const ContextOptions& opt; const TestCaseData* tc = nullptr; XmlReporter(const ContextOptions& co) : xml(*co.cout) , opt(co) {} void log_contexts() { int num_contexts = get_num_active_contexts(); if(num_contexts) { auto contexts = get_active_contexts(); std::stringstream ss; for(int i = 0; i < num_contexts; ++i) { contexts[i]->stringify(&ss); xml.scopedElement("Info").writeText(ss.str()); ss.str(""); } } } unsigned line(unsigned l) const { return opt.no_line_numbers ? 0 : l; } void test_case_start_impl(const TestCaseData& in) { bool open_ts_tag = false; if(tc != nullptr) { // we have already opened a test suite if(std::strcmp(tc->m_test_suite, in.m_test_suite) != 0) { xml.endElement(); open_ts_tag = true; } } else { open_ts_tag = true; // first test case ==> first test suite } if(open_ts_tag) { xml.startElement("TestSuite"); xml.writeAttribute("name", in.m_test_suite); } tc = ∈ xml.startElement("TestCase") .writeAttribute("name", in.m_name) .writeAttribute("filename", skipPathFromFilename(in.m_file.c_str())) .writeAttribute("line", line(in.m_line)) .writeAttribute("description", in.m_description); if(Approx(in.m_timeout) != 0) xml.writeAttribute("timeout", in.m_timeout); if(in.m_may_fail) xml.writeAttribute("may_fail", true); if(in.m_should_fail) xml.writeAttribute("should_fail", true); } // ========================================================================================= // WHAT FOLLOWS ARE OVERRIDES OF THE VIRTUAL METHODS OF THE REPORTER INTERFACE // ========================================================================================= void report_query(const QueryData& in) override { test_run_start(); if(opt.list_reporters) { for(auto& curr : getListeners()) xml.scopedElement("Listener") .writeAttribute("priority", curr.first.first) .writeAttribute("name", curr.first.second); for(auto& curr : getReporters()) xml.scopedElement("Reporter") .writeAttribute("priority", curr.first.first) .writeAttribute("name", curr.first.second); } else if(opt.count || opt.list_test_cases) { for(unsigned i = 0; i < in.num_data; ++i) { xml.scopedElement("TestCase").writeAttribute("name", in.data[i]->m_name) .writeAttribute("testsuite", in.data[i]->m_test_suite) .writeAttribute("filename", skipPathFromFilename(in.data[i]->m_file.c_str())) .writeAttribute("line", line(in.data[i]->m_line)) .writeAttribute("skipped", in.data[i]->m_skip); } xml.scopedElement("OverallResultsTestCases") .writeAttribute("unskipped", in.run_stats->numTestCasesPassingFilters); } else if(opt.list_test_suites) { for(unsigned i = 0; i < in.num_data; ++i) xml.scopedElement("TestSuite").writeAttribute("name", in.data[i]->m_test_suite); xml.scopedElement("OverallResultsTestCases") .writeAttribute("unskipped", in.run_stats->numTestCasesPassingFilters); xml.scopedElement("OverallResultsTestSuites") .writeAttribute("unskipped", in.run_stats->numTestSuitesPassingFilters); } xml.endElement(); } void test_run_start() override { // remove .exe extension - mainly to have the same output on UNIX and Windows std::string binary_name = skipPathFromFilename(opt.binary_name.c_str()); #ifdef DOCTEST_PLATFORM_WINDOWS if(binary_name.rfind(".exe") != std::string::npos) binary_name = binary_name.substr(0, binary_name.length() - 4); #endif // DOCTEST_PLATFORM_WINDOWS xml.startElement("doctest").writeAttribute("binary", binary_name); if(opt.no_version == false) xml.writeAttribute("version", DOCTEST_VERSION_STR); // only the consequential ones (TODO: filters) xml.scopedElement("Options") .writeAttribute("order_by", opt.order_by.c_str()) .writeAttribute("rand_seed", opt.rand_seed) .writeAttribute("first", opt.first) .writeAttribute("last", opt.last) .writeAttribute("abort_after", opt.abort_after) .writeAttribute("subcase_filter_levels", opt.subcase_filter_levels) .writeAttribute("case_sensitive", opt.case_sensitive) .writeAttribute("no_throw", opt.no_throw) .writeAttribute("no_skip", opt.no_skip); } void test_run_end(const TestRunStats& p) override { if(tc) // the TestSuite tag - only if there has been at least 1 test case xml.endElement(); xml.scopedElement("OverallResultsAsserts") .writeAttribute("successes", p.numAsserts - p.numAssertsFailed) .writeAttribute("failures", p.numAssertsFailed); xml.startElement("OverallResultsTestCases") .writeAttribute("successes", p.numTestCasesPassingFilters - p.numTestCasesFailed) .writeAttribute("failures", p.numTestCasesFailed); if(opt.no_skipped_summary == false) xml.writeAttribute("skipped", p.numTestCases - p.numTestCasesPassingFilters); xml.endElement(); xml.endElement(); } void test_case_start(const TestCaseData& in) override { test_case_start_impl(in); xml.ensureTagClosed(); } void test_case_reenter(const TestCaseData&) override {} void test_case_end(const CurrentTestCaseStats& st) override { xml.startElement("OverallResultsAsserts") .writeAttribute("successes", st.numAssertsCurrentTest - st.numAssertsFailedCurrentTest) .writeAttribute("failures", st.numAssertsFailedCurrentTest) .writeAttribute("test_case_success", st.testCaseSuccess); if(opt.duration) xml.writeAttribute("duration", st.seconds); if(tc->m_expected_failures) xml.writeAttribute("expected_failures", tc->m_expected_failures); xml.endElement(); xml.endElement(); } void test_case_exception(const TestCaseException& e) override { std::lock_guard lock(mutex); xml.scopedElement("Exception") .writeAttribute("crash", e.is_crash) .writeText(e.error_string.c_str()); } void subcase_start(const SubcaseSignature& in) override { xml.startElement("SubCase") .writeAttribute("name", in.m_name) .writeAttribute("filename", skipPathFromFilename(in.m_file)) .writeAttribute("line", line(in.m_line)); xml.ensureTagClosed(); } void subcase_end() override { xml.endElement(); } void log_assert(const AssertData& rb) override { if(!rb.m_failed && !opt.success) return; std::lock_guard lock(mutex); xml.startElement("Expression") .writeAttribute("success", !rb.m_failed) .writeAttribute("type", assertString(rb.m_at)) .writeAttribute("filename", skipPathFromFilename(rb.m_file)) .writeAttribute("line", line(rb.m_line)); xml.scopedElement("Original").writeText(rb.m_expr); if(rb.m_threw) xml.scopedElement("Exception").writeText(rb.m_exception.c_str()); if(rb.m_at & assertType::is_throws_as) xml.scopedElement("ExpectedException").writeText(rb.m_exception_type); if(rb.m_at & assertType::is_throws_with) xml.scopedElement("ExpectedExceptionString").writeText(rb.m_exception_string); if((rb.m_at & assertType::is_normal) && !rb.m_threw) xml.scopedElement("Expanded").writeText(rb.m_decomp.c_str()); log_contexts(); xml.endElement(); } void log_message(const MessageData& mb) override { std::lock_guard lock(mutex); xml.startElement("Message") .writeAttribute("type", failureString(mb.m_severity)) .writeAttribute("filename", skipPathFromFilename(mb.m_file)) .writeAttribute("line", line(mb.m_line)); xml.scopedElement("Text").writeText(mb.m_string.c_str()); log_contexts(); xml.endElement(); } void test_case_skipped(const TestCaseData& in) override { if(opt.no_skipped_summary == false) { test_case_start_impl(in); xml.writeAttribute("skipped", "true"); xml.endElement(); } } }; DOCTEST_REGISTER_REPORTER("xml", 0, XmlReporter); void fulltext_log_assert_to_stream(std::ostream& s, const AssertData& rb) { if((rb.m_at & (assertType::is_throws_as | assertType::is_throws_with)) == 0) //!OCLINT bitwise operator in conditional s << Color::Cyan << assertString(rb.m_at) << "( " << rb.m_expr << " ) " << Color::None; if(rb.m_at & assertType::is_throws) { //!OCLINT bitwise operator in conditional s << (rb.m_threw ? "threw as expected!" : "did NOT throw at all!") << "\n"; } else if((rb.m_at & assertType::is_throws_as) && (rb.m_at & assertType::is_throws_with)) { //!OCLINT s << Color::Cyan << assertString(rb.m_at) << "( " << rb.m_expr << ", \"" << rb.m_exception_string << "\", " << rb.m_exception_type << " ) " << Color::None; if(rb.m_threw) { if(!rb.m_failed) { s << "threw as expected!\n"; } else { s << "threw a DIFFERENT exception! (contents: " << rb.m_exception << ")\n"; } } else { s << "did NOT throw at all!\n"; } } else if(rb.m_at & assertType::is_throws_as) { //!OCLINT bitwise operator in conditional s << Color::Cyan << assertString(rb.m_at) << "( " << rb.m_expr << ", " << rb.m_exception_type << " ) " << Color::None << (rb.m_threw ? (rb.m_threw_as ? "threw as expected!" : "threw a DIFFERENT exception: ") : "did NOT throw at all!") << Color::Cyan << rb.m_exception << "\n"; } else if(rb.m_at & assertType::is_throws_with) { //!OCLINT bitwise operator in conditional s << Color::Cyan << assertString(rb.m_at) << "( " << rb.m_expr << ", \"" << rb.m_exception_string << "\" ) " << Color::None << (rb.m_threw ? (!rb.m_failed ? "threw as expected!" : "threw a DIFFERENT exception: ") : "did NOT throw at all!") << Color::Cyan << rb.m_exception << "\n"; } else if(rb.m_at & assertType::is_nothrow) { //!OCLINT bitwise operator in conditional s << (rb.m_threw ? "THREW exception: " : "didn't throw!") << Color::Cyan << rb.m_exception << "\n"; } else { s << (rb.m_threw ? "THREW exception: " : (!rb.m_failed ? "is correct!\n" : "is NOT correct!\n")); if(rb.m_threw) s << rb.m_exception << "\n"; else s << " values: " << assertString(rb.m_at) << "( " << rb.m_decomp << " )\n"; } } // TODO: // - log_message() // - respond to queries // - honor remaining options // - more attributes in tags struct JUnitReporter : public IReporter { XmlWriter xml; std::mutex mutex; Timer timer; std::vector deepestSubcaseStackNames; struct JUnitTestCaseData { static std::string getCurrentTimestamp() { // Beware, this is not reentrant because of backward compatibility issues // Also, UTC only, again because of backward compatibility (%z is C++11) time_t rawtime; std::time(&rawtime); auto const timeStampSize = sizeof("2017-01-16T17:06:45Z"); std::tm timeInfo; #ifdef DOCTEST_PLATFORM_WINDOWS gmtime_s(&timeInfo, &rawtime); #else // DOCTEST_PLATFORM_WINDOWS gmtime_r(&rawtime, &timeInfo); #endif // DOCTEST_PLATFORM_WINDOWS char timeStamp[timeStampSize]; const char* const fmt = "%Y-%m-%dT%H:%M:%SZ"; std::strftime(timeStamp, timeStampSize, fmt, &timeInfo); return std::string(timeStamp); } struct JUnitTestMessage { JUnitTestMessage(const std::string& _message, const std::string& _type, const std::string& _details) : message(_message), type(_type), details(_details) {} JUnitTestMessage(const std::string& _message, const std::string& _details) : message(_message), type(), details(_details) {} std::string message, type, details; }; struct JUnitTestCase { JUnitTestCase(const std::string& _classname, const std::string& _name) : classname(_classname), name(_name), time(0), failures() {} std::string classname, name; double time; std::vector failures, errors; }; void add(const std::string& classname, const std::string& name) { testcases.emplace_back(classname, name); } void appendSubcaseNamesToLastTestcase(std::vector nameStack) { for(auto& curr: nameStack) if(curr.size()) testcases.back().name += std::string("/") + curr.c_str(); } void addTime(double time) { if(time < 1e-4) time = 0; testcases.back().time = time; totalSeconds += time; } void addFailure(const std::string& message, const std::string& type, const std::string& details) { testcases.back().failures.emplace_back(message, type, details); ++totalFailures; } void addError(const std::string& message, const std::string& details) { testcases.back().errors.emplace_back(message, details); ++totalErrors; } std::vector testcases; double totalSeconds = 0; int totalErrors = 0, totalFailures = 0; }; JUnitTestCaseData testCaseData; // caching pointers/references to objects of these types - safe to do const ContextOptions& opt; const TestCaseData* tc = nullptr; JUnitReporter(const ContextOptions& co) : xml(*co.cout) , opt(co) {} unsigned line(unsigned l) const { return opt.no_line_numbers ? 0 : l; } // ========================================================================================= // WHAT FOLLOWS ARE OVERRIDES OF THE VIRTUAL METHODS OF THE REPORTER INTERFACE // ========================================================================================= void report_query(const QueryData&) override {} void test_run_start() override {} void test_run_end(const TestRunStats& p) override { // remove .exe extension - mainly to have the same output on UNIX and Windows std::string binary_name = skipPathFromFilename(opt.binary_name.c_str()); #ifdef DOCTEST_PLATFORM_WINDOWS if(binary_name.rfind(".exe") != std::string::npos) binary_name = binary_name.substr(0, binary_name.length() - 4); #endif // DOCTEST_PLATFORM_WINDOWS xml.startElement("testsuites"); xml.startElement("testsuite").writeAttribute("name", binary_name) .writeAttribute("errors", testCaseData.totalErrors) .writeAttribute("failures", testCaseData.totalFailures) .writeAttribute("tests", p.numAsserts); if(opt.no_time_in_output == false) { xml.writeAttribute("time", testCaseData.totalSeconds); xml.writeAttribute("timestamp", JUnitTestCaseData::getCurrentTimestamp()); } if(opt.no_version == false) xml.writeAttribute("doctest_version", DOCTEST_VERSION_STR); for(const auto& testCase : testCaseData.testcases) { xml.startElement("testcase") .writeAttribute("classname", testCase.classname) .writeAttribute("name", testCase.name); if(opt.no_time_in_output == false) xml.writeAttribute("time", testCase.time); // This is not ideal, but it should be enough to mimic gtest's junit output. xml.writeAttribute("status", "run"); for(const auto& failure : testCase.failures) { xml.scopedElement("failure") .writeAttribute("message", failure.message) .writeAttribute("type", failure.type) .writeText(failure.details, false); } for(const auto& error : testCase.errors) { xml.scopedElement("error") .writeAttribute("message", error.message) .writeText(error.details); } xml.endElement(); } xml.endElement(); xml.endElement(); } void test_case_start(const TestCaseData& in) override { testCaseData.add(skipPathFromFilename(in.m_file.c_str()), in.m_name); timer.start(); } void test_case_reenter(const TestCaseData& in) override { testCaseData.addTime(timer.getElapsedSeconds()); testCaseData.appendSubcaseNamesToLastTestcase(deepestSubcaseStackNames); deepestSubcaseStackNames.clear(); timer.start(); testCaseData.add(skipPathFromFilename(in.m_file.c_str()), in.m_name); } void test_case_end(const CurrentTestCaseStats&) override { testCaseData.addTime(timer.getElapsedSeconds()); testCaseData.appendSubcaseNamesToLastTestcase(deepestSubcaseStackNames); deepestSubcaseStackNames.clear(); } void test_case_exception(const TestCaseException& e) override { std::lock_guard lock(mutex); testCaseData.addError("exception", e.error_string.c_str()); } void subcase_start(const SubcaseSignature& in) override { deepestSubcaseStackNames.push_back(in.m_name); } void subcase_end() override {} void log_assert(const AssertData& rb) override { if(!rb.m_failed) // report only failures & ignore the `success` option return; std::lock_guard lock(mutex); std::ostringstream os; os << skipPathFromFilename(rb.m_file) << (opt.gnu_file_line ? ":" : "(") << line(rb.m_line) << (opt.gnu_file_line ? ":" : "):") << std::endl; fulltext_log_assert_to_stream(os, rb); log_contexts(os); testCaseData.addFailure(rb.m_decomp.c_str(), assertString(rb.m_at), os.str()); } void log_message(const MessageData&) override {} void test_case_skipped(const TestCaseData&) override {} void log_contexts(std::ostringstream& s) { int num_contexts = get_num_active_contexts(); if(num_contexts) { auto contexts = get_active_contexts(); s << " logged: "; for(int i = 0; i < num_contexts; ++i) { s << (i == 0 ? "" : " "); contexts[i]->stringify(&s); s << std::endl; } } } }; DOCTEST_REGISTER_REPORTER("junit", 0, JUnitReporter); struct Whitespace { int nrSpaces; explicit Whitespace(int nr) : nrSpaces(nr) {} }; std::ostream& operator<<(std::ostream& out, const Whitespace& ws) { if(ws.nrSpaces != 0) out << std::setw(ws.nrSpaces) << ' '; return out; } struct ConsoleReporter : public IReporter { std::ostream& s; bool hasLoggedCurrentTestStart; std::vector subcasesStack; size_t currentSubcaseLevel; std::mutex mutex; // caching pointers/references to objects of these types - safe to do const ContextOptions& opt; const TestCaseData* tc; ConsoleReporter(const ContextOptions& co) : s(*co.cout) , opt(co) {} ConsoleReporter(const ContextOptions& co, std::ostream& ostr) : s(ostr) , opt(co) {} // ========================================================================================= // WHAT FOLLOWS ARE HELPERS USED BY THE OVERRIDES OF THE VIRTUAL METHODS OF THE INTERFACE // ========================================================================================= void separator_to_stream() { s << Color::Yellow << "===============================================================================" "\n"; } const char* getSuccessOrFailString(bool success, assertType::Enum at, const char* success_str) { if(success) return success_str; return failureString(at); } Color::Enum getSuccessOrFailColor(bool success, assertType::Enum at) { return success ? Color::BrightGreen : (at & assertType::is_warn) ? Color::Yellow : Color::Red; } void successOrFailColoredStringToStream(bool success, assertType::Enum at, const char* success_str = "SUCCESS") { s << getSuccessOrFailColor(success, at) << getSuccessOrFailString(success, at, success_str) << ": "; } void log_contexts() { int num_contexts = get_num_active_contexts(); if(num_contexts) { auto contexts = get_active_contexts(); s << Color::None << " logged: "; for(int i = 0; i < num_contexts; ++i) { s << (i == 0 ? "" : " "); contexts[i]->stringify(&s); s << "\n"; } } s << "\n"; } // this was requested to be made virtual so users could override it virtual void file_line_to_stream(const char* file, int line, const char* tail = "") { s << Color::LightGrey << skipPathFromFilename(file) << (opt.gnu_file_line ? ":" : "(") << (opt.no_line_numbers ? 0 : line) // 0 or the real num depending on the option << (opt.gnu_file_line ? ":" : "):") << tail; } void logTestStart() { if(hasLoggedCurrentTestStart) return; separator_to_stream(); file_line_to_stream(tc->m_file.c_str(), tc->m_line, "\n"); if(tc->m_description) s << Color::Yellow << "DESCRIPTION: " << Color::None << tc->m_description << "\n"; if(tc->m_test_suite && tc->m_test_suite[0] != '\0') s << Color::Yellow << "TEST SUITE: " << Color::None << tc->m_test_suite << "\n"; if(strncmp(tc->m_name, " Scenario:", 11) != 0) s << Color::Yellow << "TEST CASE: "; s << Color::None << tc->m_name << "\n"; for(size_t i = 0; i < currentSubcaseLevel; ++i) { if(subcasesStack[i].m_name[0] != '\0') s << " " << subcasesStack[i].m_name << "\n"; } if(currentSubcaseLevel != subcasesStack.size()) { s << Color::Yellow << "\nDEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE):\n" << Color::None; for(size_t i = 0; i < subcasesStack.size(); ++i) { if(subcasesStack[i].m_name[0] != '\0') s << " " << subcasesStack[i].m_name << "\n"; } } s << "\n"; hasLoggedCurrentTestStart = true; } void printVersion() { if(opt.no_version == false) s << Color::Cyan << "[doctest] " << Color::None << "doctest version is \"" << DOCTEST_VERSION_STR << "\"\n"; } void printIntro() { if(opt.no_intro == false) { printVersion(); s << Color::Cyan << "[doctest] " << Color::None << "run with \"--" DOCTEST_OPTIONS_PREFIX_DISPLAY "help\" for options\n"; } } void printHelp() { int sizePrefixDisplay = static_cast(strlen(DOCTEST_OPTIONS_PREFIX_DISPLAY)); printVersion(); // clang-format off s << Color::Cyan << "[doctest]\n" << Color::None; s << Color::Cyan << "[doctest] " << Color::None; s << "boolean values: \"1/on/yes/true\" or \"0/off/no/false\"\n"; s << Color::Cyan << "[doctest] " << Color::None; s << "filter values: \"str1,str2,str3\" (comma separated strings)\n"; s << Color::Cyan << "[doctest]\n" << Color::None; s << Color::Cyan << "[doctest] " << Color::None; s << "filters use wildcards for matching strings\n"; s << Color::Cyan << "[doctest] " << Color::None; s << "something passes a filter if any of the strings in a filter matches\n"; #ifndef DOCTEST_CONFIG_NO_UNPREFIXED_OPTIONS s << Color::Cyan << "[doctest]\n" << Color::None; s << Color::Cyan << "[doctest] " << Color::None; s << "ALL FLAGS, OPTIONS AND FILTERS ALSO AVAILABLE WITH A \"" DOCTEST_CONFIG_OPTIONS_PREFIX "\" PREFIX!!!\n"; #endif s << Color::Cyan << "[doctest]\n" << Color::None; s << Color::Cyan << "[doctest] " << Color::None; s << "Query flags - the program quits after them. Available:\n\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "?, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "help, -" DOCTEST_OPTIONS_PREFIX_DISPLAY "h " << Whitespace(sizePrefixDisplay*0) << "prints this message\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "v, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "version " << Whitespace(sizePrefixDisplay*1) << "prints the version\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "c, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "count " << Whitespace(sizePrefixDisplay*1) << "prints the number of matching tests\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "ltc, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "list-test-cases " << Whitespace(sizePrefixDisplay*1) << "lists all matching tests by name\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "lts, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "list-test-suites " << Whitespace(sizePrefixDisplay*1) << "lists all matching test suites\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "lr, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "list-reporters " << Whitespace(sizePrefixDisplay*1) << "lists all registered reporters\n\n"; // ================================================================================== << 79 s << Color::Cyan << "[doctest] " << Color::None; s << "The available / options/filters are:\n\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "tc, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "test-case= " << Whitespace(sizePrefixDisplay*1) << "filters tests by their name\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "tce, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "test-case-exclude= " << Whitespace(sizePrefixDisplay*1) << "filters OUT tests by their name\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "sf, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "source-file= " << Whitespace(sizePrefixDisplay*1) << "filters tests by their file\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "sfe, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "source-file-exclude= " << Whitespace(sizePrefixDisplay*1) << "filters OUT tests by their file\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "ts, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "test-suite= " << Whitespace(sizePrefixDisplay*1) << "filters tests by their test suite\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "tse, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "test-suite-exclude= " << Whitespace(sizePrefixDisplay*1) << "filters OUT tests by their test suite\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "sc, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "subcase= " << Whitespace(sizePrefixDisplay*1) << "filters subcases by their name\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "sce, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "subcase-exclude= " << Whitespace(sizePrefixDisplay*1) << "filters OUT subcases by their name\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "r, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "reporters= " << Whitespace(sizePrefixDisplay*1) << "reporters to use (console is default)\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "o, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "out= " << Whitespace(sizePrefixDisplay*1) << "output filename\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "ob, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "order-by= " << Whitespace(sizePrefixDisplay*1) << "how the tests should be ordered\n"; s << Whitespace(sizePrefixDisplay*3) << " - [file/suite/name/rand/none]\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "rs, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "rand-seed= " << Whitespace(sizePrefixDisplay*1) << "seed for random ordering\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "f, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "first= " << Whitespace(sizePrefixDisplay*1) << "the first test passing the filters to\n"; s << Whitespace(sizePrefixDisplay*3) << " execute - for range-based execution\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "l, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "last= " << Whitespace(sizePrefixDisplay*1) << "the last test passing the filters to\n"; s << Whitespace(sizePrefixDisplay*3) << " execute - for range-based execution\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "aa, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "abort-after= " << Whitespace(sizePrefixDisplay*1) << "stop after failed assertions\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "scfl,--" DOCTEST_OPTIONS_PREFIX_DISPLAY "subcase-filter-levels= " << Whitespace(sizePrefixDisplay*1) << "apply filters for the first levels\n"; s << Color::Cyan << "\n[doctest] " << Color::None; s << "Bool options - can be used like flags and true is assumed. Available:\n\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "s, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "success= " << Whitespace(sizePrefixDisplay*1) << "include successful assertions in output\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "cs, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "case-sensitive= " << Whitespace(sizePrefixDisplay*1) << "filters being treated as case sensitive\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "e, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "exit= " << Whitespace(sizePrefixDisplay*1) << "exits after the tests finish\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "d, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "duration= " << Whitespace(sizePrefixDisplay*1) << "prints the time duration of each test\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "m, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "minimal= " << Whitespace(sizePrefixDisplay*1) << "minimal console output (only failures)\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "q, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "quiet= " << Whitespace(sizePrefixDisplay*1) << "no console output\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "nt, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "no-throw= " << Whitespace(sizePrefixDisplay*1) << "skips exceptions-related assert checks\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "ne, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "no-exitcode= " << Whitespace(sizePrefixDisplay*1) << "returns (or exits) always with success\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "nr, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "no-run= " << Whitespace(sizePrefixDisplay*1) << "skips all runtime doctest operations\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "ni, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "no-intro= " << Whitespace(sizePrefixDisplay*1) << "omit the framework intro in the output\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "nv, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "no-version= " << Whitespace(sizePrefixDisplay*1) << "omit the framework version in the output\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "nc, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "no-colors= " << Whitespace(sizePrefixDisplay*1) << "disables colors in output\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "fc, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "force-colors= " << Whitespace(sizePrefixDisplay*1) << "use colors even when not in a tty\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "nb, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "no-breaks= " << Whitespace(sizePrefixDisplay*1) << "disables breakpoints in debuggers\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "ns, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "no-skip= " << Whitespace(sizePrefixDisplay*1) << "don't skip test cases marked as skip\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "gfl, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "gnu-file-line= " << Whitespace(sizePrefixDisplay*1) << ":n: vs (n): for line numbers in output\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "npf, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "no-path-filenames= " << Whitespace(sizePrefixDisplay*1) << "only filenames and no paths in output\n"; s << " -" DOCTEST_OPTIONS_PREFIX_DISPLAY "nln, --" DOCTEST_OPTIONS_PREFIX_DISPLAY "no-line-numbers= " << Whitespace(sizePrefixDisplay*1) << "0 instead of real line numbers in output\n"; // ================================================================================== << 79 // clang-format on s << Color::Cyan << "\n[doctest] " << Color::None; s << "for more information visit the project documentation\n\n"; } void printRegisteredReporters() { printVersion(); auto printReporters = [this] (const reporterMap& reporters, const char* type) { if(reporters.size()) { s << Color::Cyan << "[doctest] " << Color::None << "listing all registered " << type << "\n"; for(auto& curr : reporters) s << "priority: " << std::setw(5) << curr.first.first << " name: " << curr.first.second << "\n"; } }; printReporters(getListeners(), "listeners"); printReporters(getReporters(), "reporters"); } // ========================================================================================= // WHAT FOLLOWS ARE OVERRIDES OF THE VIRTUAL METHODS OF THE REPORTER INTERFACE // ========================================================================================= void report_query(const QueryData& in) override { if(opt.version) { printVersion(); } else if(opt.help) { printHelp(); } else if(opt.list_reporters) { printRegisteredReporters(); } else if(opt.count || opt.list_test_cases) { if(opt.list_test_cases) { s << Color::Cyan << "[doctest] " << Color::None << "listing all test case names\n"; separator_to_stream(); } for(unsigned i = 0; i < in.num_data; ++i) s << Color::None << in.data[i]->m_name << "\n"; separator_to_stream(); s << Color::Cyan << "[doctest] " << Color::None << "unskipped test cases passing the current filters: " << g_cs->numTestCasesPassingFilters << "\n"; } else if(opt.list_test_suites) { s << Color::Cyan << "[doctest] " << Color::None << "listing all test suites\n"; separator_to_stream(); for(unsigned i = 0; i < in.num_data; ++i) s << Color::None << in.data[i]->m_test_suite << "\n"; separator_to_stream(); s << Color::Cyan << "[doctest] " << Color::None << "unskipped test cases passing the current filters: " << g_cs->numTestCasesPassingFilters << "\n"; s << Color::Cyan << "[doctest] " << Color::None << "test suites with unskipped test cases passing the current filters: " << g_cs->numTestSuitesPassingFilters << "\n"; } } void test_run_start() override { if(!opt.minimal) printIntro(); } void test_run_end(const TestRunStats& p) override { if(opt.minimal && p.numTestCasesFailed == 0) return; separator_to_stream(); s << std::dec; auto totwidth = int(std::ceil(log10((std::max(p.numTestCasesPassingFilters, static_cast(p.numAsserts))) + 1))); auto passwidth = int(std::ceil(log10((std::max(p.numTestCasesPassingFilters - p.numTestCasesFailed, static_cast(p.numAsserts - p.numAssertsFailed))) + 1))); auto failwidth = int(std::ceil(log10((std::max(p.numTestCasesFailed, static_cast(p.numAssertsFailed))) + 1))); const bool anythingFailed = p.numTestCasesFailed > 0 || p.numAssertsFailed > 0; s << Color::Cyan << "[doctest] " << Color::None << "test cases: " << std::setw(totwidth) << p.numTestCasesPassingFilters << " | " << ((p.numTestCasesPassingFilters == 0 || anythingFailed) ? Color::None : Color::Green) << std::setw(passwidth) << p.numTestCasesPassingFilters - p.numTestCasesFailed << " passed" << Color::None << " | " << (p.numTestCasesFailed > 0 ? Color::Red : Color::None) << std::setw(failwidth) << p.numTestCasesFailed << " failed" << Color::None << " |"; if(opt.no_skipped_summary == false) { const int numSkipped = p.numTestCases - p.numTestCasesPassingFilters; s << " " << (numSkipped == 0 ? Color::None : Color::Yellow) << numSkipped << " skipped" << Color::None; } s << "\n"; s << Color::Cyan << "[doctest] " << Color::None << "assertions: " << std::setw(totwidth) << p.numAsserts << " | " << ((p.numAsserts == 0 || anythingFailed) ? Color::None : Color::Green) << std::setw(passwidth) << (p.numAsserts - p.numAssertsFailed) << " passed" << Color::None << " | " << (p.numAssertsFailed > 0 ? Color::Red : Color::None) << std::setw(failwidth) << p.numAssertsFailed << " failed" << Color::None << " |\n"; s << Color::Cyan << "[doctest] " << Color::None << "Status: " << (p.numTestCasesFailed > 0 ? Color::Red : Color::Green) << ((p.numTestCasesFailed > 0) ? "FAILURE!" : "SUCCESS!") << Color::None << std::endl; } void test_case_start(const TestCaseData& in) override { hasLoggedCurrentTestStart = false; tc = ∈ subcasesStack.clear(); currentSubcaseLevel = 0; } void test_case_reenter(const TestCaseData&) override { subcasesStack.clear(); } void test_case_end(const CurrentTestCaseStats& st) override { if(tc->m_no_output) return; // log the preamble of the test case only if there is something // else to print - something other than that an assert has failed if(opt.duration || (st.failure_flags && st.failure_flags != TestCaseFailureReason::AssertFailure)) logTestStart(); if(opt.duration) s << Color::None << std::setprecision(6) << std::fixed << st.seconds << " s: " << tc->m_name << "\n"; if(st.failure_flags & TestCaseFailureReason::Timeout) s << Color::Red << "Test case exceeded time limit of " << std::setprecision(6) << std::fixed << tc->m_timeout << "!\n"; if(st.failure_flags & TestCaseFailureReason::ShouldHaveFailedButDidnt) { s << Color::Red << "Should have failed but didn't! Marking it as failed!\n"; } else if(st.failure_flags & TestCaseFailureReason::ShouldHaveFailedAndDid) { s << Color::Yellow << "Failed as expected so marking it as not failed\n"; } else if(st.failure_flags & TestCaseFailureReason::CouldHaveFailedAndDid) { s << Color::Yellow << "Allowed to fail so marking it as not failed\n"; } else if(st.failure_flags & TestCaseFailureReason::DidntFailExactlyNumTimes) { s << Color::Red << "Didn't fail exactly " << tc->m_expected_failures << " times so marking it as failed!\n"; } else if(st.failure_flags & TestCaseFailureReason::FailedExactlyNumTimes) { s << Color::Yellow << "Failed exactly " << tc->m_expected_failures << " times as expected so marking it as not failed!\n"; } if(st.failure_flags & TestCaseFailureReason::TooManyFailedAsserts) { s << Color::Red << "Aborting - too many failed asserts!\n"; } s << Color::None; // lgtm [cpp/useless-expression] } void test_case_exception(const TestCaseException& e) override { std::lock_guard lock(mutex); if(tc->m_no_output) return; logTestStart(); file_line_to_stream(tc->m_file.c_str(), tc->m_line, " "); successOrFailColoredStringToStream(false, e.is_crash ? assertType::is_require : assertType::is_check); s << Color::Red << (e.is_crash ? "test case CRASHED: " : "test case THREW exception: ") << Color::Cyan << e.error_string << "\n"; int num_stringified_contexts = get_num_stringified_contexts(); if(num_stringified_contexts) { auto stringified_contexts = get_stringified_contexts(); s << Color::None << " logged: "; for(int i = num_stringified_contexts; i > 0; --i) { s << (i == num_stringified_contexts ? "" : " ") << stringified_contexts[i - 1] << "\n"; } } s << "\n" << Color::None; } void subcase_start(const SubcaseSignature& subc) override { subcasesStack.push_back(subc); ++currentSubcaseLevel; hasLoggedCurrentTestStart = false; } void subcase_end() override { --currentSubcaseLevel; hasLoggedCurrentTestStart = false; } void log_assert(const AssertData& rb) override { if((!rb.m_failed && !opt.success) || tc->m_no_output) return; std::lock_guard lock(mutex); logTestStart(); file_line_to_stream(rb.m_file, rb.m_line, " "); successOrFailColoredStringToStream(!rb.m_failed, rb.m_at); fulltext_log_assert_to_stream(s, rb); log_contexts(); } void log_message(const MessageData& mb) override { if(tc->m_no_output) return; std::lock_guard lock(mutex); logTestStart(); file_line_to_stream(mb.m_file, mb.m_line, " "); s << getSuccessOrFailColor(false, mb.m_severity) << getSuccessOrFailString(mb.m_severity & assertType::is_warn, mb.m_severity, "MESSAGE") << ": "; s << Color::None << mb.m_string << "\n"; log_contexts(); } void test_case_skipped(const TestCaseData&) override {} }; DOCTEST_REGISTER_REPORTER("console", 0, ConsoleReporter); #ifdef DOCTEST_PLATFORM_WINDOWS struct DebugOutputWindowReporter : public ConsoleReporter { DOCTEST_THREAD_LOCAL static std::ostringstream oss; DebugOutputWindowReporter(const ContextOptions& co) : ConsoleReporter(co, oss) {} #define DOCTEST_DEBUG_OUTPUT_REPORTER_OVERRIDE(func, type, arg) \ void func(type arg) override { \ bool with_col = g_no_colors; \ g_no_colors = false; \ ConsoleReporter::func(arg); \ if(oss.tellp() != std::streampos{}) { \ DOCTEST_OUTPUT_DEBUG_STRING(oss.str().c_str()); \ oss.str(""); \ } \ g_no_colors = with_col; \ } DOCTEST_DEBUG_OUTPUT_REPORTER_OVERRIDE(test_run_start, DOCTEST_EMPTY, DOCTEST_EMPTY) DOCTEST_DEBUG_OUTPUT_REPORTER_OVERRIDE(test_run_end, const TestRunStats&, in) DOCTEST_DEBUG_OUTPUT_REPORTER_OVERRIDE(test_case_start, const TestCaseData&, in) DOCTEST_DEBUG_OUTPUT_REPORTER_OVERRIDE(test_case_reenter, const TestCaseData&, in) DOCTEST_DEBUG_OUTPUT_REPORTER_OVERRIDE(test_case_end, const CurrentTestCaseStats&, in) DOCTEST_DEBUG_OUTPUT_REPORTER_OVERRIDE(test_case_exception, const TestCaseException&, in) DOCTEST_DEBUG_OUTPUT_REPORTER_OVERRIDE(subcase_start, const SubcaseSignature&, in) DOCTEST_DEBUG_OUTPUT_REPORTER_OVERRIDE(subcase_end, DOCTEST_EMPTY, DOCTEST_EMPTY) DOCTEST_DEBUG_OUTPUT_REPORTER_OVERRIDE(log_assert, const AssertData&, in) DOCTEST_DEBUG_OUTPUT_REPORTER_OVERRIDE(log_message, const MessageData&, in) DOCTEST_DEBUG_OUTPUT_REPORTER_OVERRIDE(test_case_skipped, const TestCaseData&, in) }; DOCTEST_THREAD_LOCAL std::ostringstream DebugOutputWindowReporter::oss; #endif // DOCTEST_PLATFORM_WINDOWS // the implementation of parseOption() bool parseOptionImpl(int argc, const char* const* argv, const char* pattern, String* value) { // going from the end to the beginning and stopping on the first occurrence from the end for(int i = argc; i > 0; --i) { auto index = i - 1; auto temp = std::strstr(argv[index], pattern); if(temp && (value || strlen(temp) == strlen(pattern))) { //!OCLINT prefer early exits and continue // eliminate matches in which the chars before the option are not '-' bool noBadCharsFound = true; auto curr = argv[index]; while(curr != temp) { if(*curr++ != '-') { noBadCharsFound = false; break; } } if(noBadCharsFound && argv[index][0] == '-') { if(value) { // parsing the value of an option temp += strlen(pattern); const unsigned len = strlen(temp); if(len) { *value = temp; return true; } } else { // just a flag - no value return true; } } } } return false; } // parses an option and returns the string after the '=' character bool parseOption(int argc, const char* const* argv, const char* pattern, String* value = nullptr, const String& defaultVal = String()) { if(value) *value = defaultVal; #ifndef DOCTEST_CONFIG_NO_UNPREFIXED_OPTIONS // offset (normally 3 for "dt-") to skip prefix if(parseOptionImpl(argc, argv, pattern + strlen(DOCTEST_CONFIG_OPTIONS_PREFIX), value)) return true; #endif // DOCTEST_CONFIG_NO_UNPREFIXED_OPTIONS return parseOptionImpl(argc, argv, pattern, value); } // locates a flag on the command line bool parseFlag(int argc, const char* const* argv, const char* pattern) { return parseOption(argc, argv, pattern); } // parses a comma separated list of words after a pattern in one of the arguments in argv bool parseCommaSepArgs(int argc, const char* const* argv, const char* pattern, std::vector& res) { String filtersString; if(parseOption(argc, argv, pattern, &filtersString)) { // tokenize with "," as a separator, unless escaped with backslash std::ostringstream s; auto flush = [&s, &res]() { auto string = s.str(); if(string.size() > 0) { res.push_back(string.c_str()); } s.str(""); }; bool seenBackslash = false; const char* current = filtersString.c_str(); const char* end = current + strlen(current); while(current != end) { char character = *current++; if(seenBackslash) { seenBackslash = false; if(character == ',') { s.put(','); continue; } s.put('\\'); } if(character == '\\') { seenBackslash = true; } else if(character == ',') { flush(); } else { s.put(character); } } if(seenBackslash) { s.put('\\'); } flush(); return true; } return false; } enum optionType { option_bool, option_int }; // parses an int/bool option from the command line bool parseIntOption(int argc, const char* const* argv, const char* pattern, optionType type, int& res) { String parsedValue; if(!parseOption(argc, argv, pattern, &parsedValue)) return false; if(type == 0) { // boolean const char positive[][5] = {"1", "true", "on", "yes"}; // 5 - strlen("true") + 1 const char negative[][6] = {"0", "false", "off", "no"}; // 6 - strlen("false") + 1 // if the value matches any of the positive/negative possibilities for(unsigned i = 0; i < 4; i++) { if(parsedValue.compare(positive[i], true) == 0) { res = 1; //!OCLINT parameter reassignment return true; } if(parsedValue.compare(negative[i], true) == 0) { res = 0; //!OCLINT parameter reassignment return true; } } } else { // integer // TODO: change this to use std::stoi or something else! currently it uses undefined behavior - assumes '0' on failed parse... int theInt = std::atoi(parsedValue.c_str()); // NOLINT if(theInt != 0) { res = theInt; //!OCLINT parameter reassignment return true; } } return false; } } // namespace Context::Context(int argc, const char* const* argv) : p(new detail::ContextState) { parseArgs(argc, argv, true); if(argc) p->binary_name = argv[0]; } Context::~Context() { if(g_cs == p) g_cs = nullptr; delete p; } void Context::applyCommandLine(int argc, const char* const* argv) { parseArgs(argc, argv); if(argc) p->binary_name = argv[0]; } // parses args void Context::parseArgs(int argc, const char* const* argv, bool withDefaults) { using namespace detail; // clang-format off parseCommaSepArgs(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "source-file=", p->filters[0]); parseCommaSepArgs(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "sf=", p->filters[0]); parseCommaSepArgs(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "source-file-exclude=",p->filters[1]); parseCommaSepArgs(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "sfe=", p->filters[1]); parseCommaSepArgs(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "test-suite=", p->filters[2]); parseCommaSepArgs(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "ts=", p->filters[2]); parseCommaSepArgs(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "test-suite-exclude=", p->filters[3]); parseCommaSepArgs(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "tse=", p->filters[3]); parseCommaSepArgs(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "test-case=", p->filters[4]); parseCommaSepArgs(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "tc=", p->filters[4]); parseCommaSepArgs(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "test-case-exclude=", p->filters[5]); parseCommaSepArgs(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "tce=", p->filters[5]); parseCommaSepArgs(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "subcase=", p->filters[6]); parseCommaSepArgs(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "sc=", p->filters[6]); parseCommaSepArgs(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "subcase-exclude=", p->filters[7]); parseCommaSepArgs(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "sce=", p->filters[7]); parseCommaSepArgs(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "reporters=", p->filters[8]); parseCommaSepArgs(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "r=", p->filters[8]); // clang-format on int intRes = 0; String strRes; #define DOCTEST_PARSE_AS_BOOL_OR_FLAG(name, sname, var, default) \ if(parseIntOption(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX name "=", option_bool, intRes) || \ parseIntOption(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX sname "=", option_bool, intRes)) \ p->var = static_cast(intRes); \ else if(parseFlag(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX name) || \ parseFlag(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX sname)) \ p->var = true; \ else if(withDefaults) \ p->var = default #define DOCTEST_PARSE_INT_OPTION(name, sname, var, default) \ if(parseIntOption(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX name "=", option_int, intRes) || \ parseIntOption(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX sname "=", option_int, intRes)) \ p->var = intRes; \ else if(withDefaults) \ p->var = default #define DOCTEST_PARSE_STR_OPTION(name, sname, var, default) \ if(parseOption(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX name "=", &strRes, default) || \ parseOption(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX sname "=", &strRes, default) || \ withDefaults) \ p->var = strRes // clang-format off DOCTEST_PARSE_STR_OPTION("out", "o", out, ""); DOCTEST_PARSE_STR_OPTION("order-by", "ob", order_by, "file"); DOCTEST_PARSE_INT_OPTION("rand-seed", "rs", rand_seed, 0); DOCTEST_PARSE_INT_OPTION("first", "f", first, 0); DOCTEST_PARSE_INT_OPTION("last", "l", last, UINT_MAX); DOCTEST_PARSE_INT_OPTION("abort-after", "aa", abort_after, 0); DOCTEST_PARSE_INT_OPTION("subcase-filter-levels", "scfl", subcase_filter_levels, INT_MAX); DOCTEST_PARSE_AS_BOOL_OR_FLAG("success", "s", success, false); DOCTEST_PARSE_AS_BOOL_OR_FLAG("case-sensitive", "cs", case_sensitive, false); DOCTEST_PARSE_AS_BOOL_OR_FLAG("exit", "e", exit, false); DOCTEST_PARSE_AS_BOOL_OR_FLAG("duration", "d", duration, false); DOCTEST_PARSE_AS_BOOL_OR_FLAG("minimal", "m", minimal, false); DOCTEST_PARSE_AS_BOOL_OR_FLAG("quiet", "q", quiet, false); DOCTEST_PARSE_AS_BOOL_OR_FLAG("no-throw", "nt", no_throw, false); DOCTEST_PARSE_AS_BOOL_OR_FLAG("no-exitcode", "ne", no_exitcode, false); DOCTEST_PARSE_AS_BOOL_OR_FLAG("no-run", "nr", no_run, false); DOCTEST_PARSE_AS_BOOL_OR_FLAG("no-intro", "ni", no_intro, false); DOCTEST_PARSE_AS_BOOL_OR_FLAG("no-version", "nv", no_version, false); DOCTEST_PARSE_AS_BOOL_OR_FLAG("no-colors", "nc", no_colors, false); DOCTEST_PARSE_AS_BOOL_OR_FLAG("force-colors", "fc", force_colors, false); DOCTEST_PARSE_AS_BOOL_OR_FLAG("no-breaks", "nb", no_breaks, false); DOCTEST_PARSE_AS_BOOL_OR_FLAG("no-skip", "ns", no_skip, false); DOCTEST_PARSE_AS_BOOL_OR_FLAG("gnu-file-line", "gfl", gnu_file_line, !bool(DOCTEST_MSVC)); DOCTEST_PARSE_AS_BOOL_OR_FLAG("no-path-filenames", "npf", no_path_in_filenames, false); DOCTEST_PARSE_AS_BOOL_OR_FLAG("no-line-numbers", "nln", no_line_numbers, false); DOCTEST_PARSE_AS_BOOL_OR_FLAG("no-debug-output", "ndo", no_debug_output, false); DOCTEST_PARSE_AS_BOOL_OR_FLAG("no-skipped-summary", "nss", no_skipped_summary, false); DOCTEST_PARSE_AS_BOOL_OR_FLAG("no-time-in-output", "ntio", no_time_in_output, false); // clang-format on if(withDefaults) { p->help = false; p->version = false; p->count = false; p->list_test_cases = false; p->list_test_suites = false; p->list_reporters = false; } if(parseFlag(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "help") || parseFlag(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "h") || parseFlag(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "?")) { p->help = true; p->exit = true; } if(parseFlag(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "version") || parseFlag(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "v")) { p->version = true; p->exit = true; } if(parseFlag(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "count") || parseFlag(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "c")) { p->count = true; p->exit = true; } if(parseFlag(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "list-test-cases") || parseFlag(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "ltc")) { p->list_test_cases = true; p->exit = true; } if(parseFlag(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "list-test-suites") || parseFlag(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "lts")) { p->list_test_suites = true; p->exit = true; } if(parseFlag(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "list-reporters") || parseFlag(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX "lr")) { p->list_reporters = true; p->exit = true; } } // allows the user to add procedurally to the filters from the command line void Context::addFilter(const char* filter, const char* value) { setOption(filter, value); } // allows the user to clear all filters from the command line void Context::clearFilters() { for(auto& curr : p->filters) curr.clear(); } // allows the user to override procedurally the bool options from the command line void Context::setOption(const char* option, bool value) { setOption(option, value ? "true" : "false"); } // allows the user to override procedurally the int options from the command line void Context::setOption(const char* option, int value) { setOption(option, toString(value).c_str()); // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) } // allows the user to override procedurally the string options from the command line void Context::setOption(const char* option, const char* value) { auto argv = String("-") + option + "=" + value; auto lvalue = argv.c_str(); parseArgs(1, &lvalue); } // users should query this in their main() and exit the program if true bool Context::shouldExit() { return p->exit; } void Context::setAsDefaultForAssertsOutOfTestCases() { g_cs = p; } void Context::setAssertHandler(detail::assert_handler ah) { p->ah = ah; } void Context::setCout(std::ostream* out) { p->cout = out; } static class DiscardOStream : public std::ostream { private: class : public std::streambuf { private: // allowing some buffering decreases the amount of calls to overflow char buf[1024]; protected: std::streamsize xsputn(const char_type*, std::streamsize count) override { return count; } int_type overflow(int_type ch) override { setp(std::begin(buf), std::end(buf)); return traits_type::not_eof(ch); } } discardBuf; public: DiscardOStream() : std::ostream(&discardBuf) {} } discardOut; // the main function that does all the filtering and test running int Context::run() { using namespace detail; // save the old context state in case such was setup - for using asserts out of a testing context auto old_cs = g_cs; // this is the current contest g_cs = p; is_running_in_test = true; g_no_colors = p->no_colors; p->resetRunData(); std::fstream fstr; if(p->cout == nullptr) { if(p->quiet) { p->cout = &discardOut; } else if(p->out.size()) { // to a file if specified fstr.open(p->out.c_str(), std::fstream::out); p->cout = &fstr; } else { // stdout by default p->cout = &std::cout; } } FatalConditionHandler::allocateAltStackMem(); auto cleanup_and_return = [&]() { FatalConditionHandler::freeAltStackMem(); if(fstr.is_open()) fstr.close(); // restore context g_cs = old_cs; is_running_in_test = false; // we have to free the reporters which were allocated when the run started for(auto& curr : p->reporters_currently_used) delete curr; p->reporters_currently_used.clear(); if(p->numTestCasesFailed && !p->no_exitcode) return EXIT_FAILURE; return EXIT_SUCCESS; }; // setup default reporter if none is given through the command line if(p->filters[8].empty()) p->filters[8].push_back("console"); // check to see if any of the registered reporters has been selected for(auto& curr : getReporters()) { if(matchesAny(curr.first.second.c_str(), p->filters[8], false, p->case_sensitive)) p->reporters_currently_used.push_back(curr.second(*g_cs)); } // TODO: check if there is nothing in reporters_currently_used // prepend all listeners for(auto& curr : getListeners()) p->reporters_currently_used.insert(p->reporters_currently_used.begin(), curr.second(*g_cs)); #ifdef DOCTEST_PLATFORM_WINDOWS if(isDebuggerActive() && p->no_debug_output == false) p->reporters_currently_used.push_back(new DebugOutputWindowReporter(*g_cs)); #endif // DOCTEST_PLATFORM_WINDOWS // handle version, help and no_run if(p->no_run || p->version || p->help || p->list_reporters) { DOCTEST_ITERATE_THROUGH_REPORTERS(report_query, QueryData()); return cleanup_and_return(); } std::vector testArray; for(auto& curr : getRegisteredTests()) testArray.push_back(&curr); p->numTestCases = testArray.size(); // sort the collected records if(!testArray.empty()) { if(p->order_by.compare("file", true) == 0) { std::sort(testArray.begin(), testArray.end(), fileOrderComparator); } else if(p->order_by.compare("suite", true) == 0) { std::sort(testArray.begin(), testArray.end(), suiteOrderComparator); } else if(p->order_by.compare("name", true) == 0) { std::sort(testArray.begin(), testArray.end(), nameOrderComparator); } else if(p->order_by.compare("rand", true) == 0) { std::srand(p->rand_seed); // random_shuffle implementation const auto first = &testArray[0]; for(size_t i = testArray.size() - 1; i > 0; --i) { int idxToSwap = std::rand() % (i + 1); // NOLINT const auto temp = first[i]; first[i] = first[idxToSwap]; first[idxToSwap] = temp; } } else if(p->order_by.compare("none", true) == 0) { // means no sorting - beneficial for death tests which call into the executable // with a specific test case in mind - we don't want to slow down the startup times } } std::set testSuitesPassingFilt; bool query_mode = p->count || p->list_test_cases || p->list_test_suites; std::vector queryResults; if(!query_mode) DOCTEST_ITERATE_THROUGH_REPORTERS(test_run_start, DOCTEST_EMPTY); // invoke the registered functions if they match the filter criteria (or just count them) for(auto& curr : testArray) { const auto& tc = *curr; bool skip_me = false; if(tc.m_skip && !p->no_skip) skip_me = true; if(!matchesAny(tc.m_file.c_str(), p->filters[0], true, p->case_sensitive)) skip_me = true; if(matchesAny(tc.m_file.c_str(), p->filters[1], false, p->case_sensitive)) skip_me = true; if(!matchesAny(tc.m_test_suite, p->filters[2], true, p->case_sensitive)) skip_me = true; if(matchesAny(tc.m_test_suite, p->filters[3], false, p->case_sensitive)) skip_me = true; if(!matchesAny(tc.m_name, p->filters[4], true, p->case_sensitive)) skip_me = true; if(matchesAny(tc.m_name, p->filters[5], false, p->case_sensitive)) skip_me = true; if(!skip_me) p->numTestCasesPassingFilters++; // skip the test if it is not in the execution range if((p->last < p->numTestCasesPassingFilters && p->first <= p->last) || (p->first > p->numTestCasesPassingFilters)) skip_me = true; if(skip_me) { if(!query_mode) DOCTEST_ITERATE_THROUGH_REPORTERS(test_case_skipped, tc); continue; } // do not execute the test if we are to only count the number of filter passing tests if(p->count) continue; // print the name of the test and don't execute it if(p->list_test_cases) { queryResults.push_back(&tc); continue; } // print the name of the test suite if not done already and don't execute it if(p->list_test_suites) { if((testSuitesPassingFilt.count(tc.m_test_suite) == 0) && tc.m_test_suite[0] != '\0') { queryResults.push_back(&tc); testSuitesPassingFilt.insert(tc.m_test_suite); p->numTestSuitesPassingFilters++; } continue; } // execute the test if it passes all the filtering { p->currentTest = &tc; p->failure_flags = TestCaseFailureReason::None; p->seconds = 0; // reset atomic counters p->numAssertsFailedCurrentTest_atomic = 0; p->numAssertsCurrentTest_atomic = 0; p->subcasesPassed.clear(); DOCTEST_ITERATE_THROUGH_REPORTERS(test_case_start, tc); p->timer.start(); bool run_test = true; do { // reset some of the fields for subcases (except for the set of fully passed ones) p->should_reenter = false; p->subcasesCurrentMaxLevel = 0; p->subcasesStack.clear(); p->shouldLogCurrentException = true; // reset stuff for logging with INFO() p->stringifiedContexts.clear(); #ifndef DOCTEST_CONFIG_NO_EXCEPTIONS try { #endif // DOCTEST_CONFIG_NO_EXCEPTIONS // MSVC 2015 diagnoses fatalConditionHandler as unused (because reset() is a static method) DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(4101) // unreferenced local variable FatalConditionHandler fatalConditionHandler; // Handle signals // execute the test tc.m_test(); fatalConditionHandler.reset(); DOCTEST_MSVC_SUPPRESS_WARNING_POP #ifndef DOCTEST_CONFIG_NO_EXCEPTIONS } catch(const TestFailureException&) { p->failure_flags |= TestCaseFailureReason::AssertFailure; } catch(...) { DOCTEST_ITERATE_THROUGH_REPORTERS(test_case_exception, {translateActiveException(), false}); p->failure_flags |= TestCaseFailureReason::Exception; } #endif // DOCTEST_CONFIG_NO_EXCEPTIONS // exit this loop if enough assertions have failed - even if there are more subcases if(p->abort_after > 0 && p->numAssertsFailed + p->numAssertsFailedCurrentTest_atomic >= p->abort_after) { run_test = false; p->failure_flags |= TestCaseFailureReason::TooManyFailedAsserts; } if(p->should_reenter && run_test) DOCTEST_ITERATE_THROUGH_REPORTERS(test_case_reenter, tc); if(!p->should_reenter) run_test = false; } while(run_test); p->finalizeTestCaseData(); DOCTEST_ITERATE_THROUGH_REPORTERS(test_case_end, *g_cs); p->currentTest = nullptr; // stop executing tests if enough assertions have failed if(p->abort_after > 0 && p->numAssertsFailed >= p->abort_after) break; } } if(!query_mode) { DOCTEST_ITERATE_THROUGH_REPORTERS(test_run_end, *g_cs); } else { QueryData qdata; qdata.run_stats = g_cs; qdata.data = queryResults.data(); qdata.num_data = unsigned(queryResults.size()); DOCTEST_ITERATE_THROUGH_REPORTERS(report_query, qdata); } return cleanup_and_return(); } IReporter::~IReporter() = default; int IReporter::get_num_active_contexts() { return detail::g_infoContexts.size(); } const IContextScope* const* IReporter::get_active_contexts() { return get_num_active_contexts() ? &detail::g_infoContexts[0] : nullptr; } int IReporter::get_num_stringified_contexts() { return detail::g_cs->stringifiedContexts.size(); } const String* IReporter::get_stringified_contexts() { return get_num_stringified_contexts() ? &detail::g_cs->stringifiedContexts[0] : nullptr; } namespace detail { void registerReporterImpl(const char* name, int priority, reporterCreatorFunc c, bool isReporter) { if(isReporter) getReporters().insert(reporterMap::value_type(reporterMap::key_type(priority, name), c)); else getListeners().insert(reporterMap::value_type(reporterMap::key_type(priority, name), c)); } } // namespace detail } // namespace doctest #endif // DOCTEST_CONFIG_DISABLE #ifdef DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(4007) // 'function' : must be 'attribute' - see issue #182 int main(int argc, char** argv) { return doctest::Context(argc, argv).run(); } DOCTEST_MSVC_SUPPRESS_WARNING_POP #endif // DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN DOCTEST_CLANG_SUPPRESS_WARNING_POP DOCTEST_MSVC_SUPPRESS_WARNING_POP DOCTEST_GCC_SUPPRESS_WARNING_POP DOCTEST_SUPPRESS_COMMON_WARNINGS_POP #endif // DOCTEST_LIBRARY_IMPLEMENTATION #endif // DOCTEST_CONFIG_IMPLEMENT lfortran-0.63.0/src/tests/doctest.cpp0000664000175000017500000000044615174404631017726 0ustar alastairalastair// Uncomment the following line to stop catching exceptions and segfaults, thus // allowing to use gdb to figure out where the code fails (also put this line // into every test at the top): //#define DOCTEST_CONFIG_NO_EXCEPTIONS #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include "doctest.h" lfortran-0.63.0/src/tests/CMakeLists.txt0000664000175000017500000000011615174404631020307 0ustar alastairalastairadd_library(doctest STATIC doctest.cpp) add_library(p::doctest ALIAS doctest) lfortran-0.63.0/src/bin/0000775000175000017500000000000015174404631015157 5ustar alastairalastairlfortran-0.63.0/src/bin/semantic_highlighter.h0000664000175000017500000000106715174404631021515 0ustar alastairalastair#pragma once #include #include #include #include namespace LCompilers::LanguageServerProtocol { extern const std::regex RE_FORTRAN_IDENTIFIER; extern const std::regex RE_FORTRAN_KEYWORD; struct FortranToken { std::size_t position; std::size_t length; SemanticTokenTypes type; std::vector modifiers; }; auto semantic_tokenize(const std::string &text) -> std::vector; } // namespace LCompilers::LanguageServerProtocol lfortran-0.63.0/src/bin/lfortran_accessor.cpp0000664000175000017500000002661115174404631021402 0ustar alastairalastair#include #include #include #include #include #include #include #include #include #include namespace LCompilers::LLanguageServer { auto LFortranAccessor::showErrors( const std::string &filename, const std::string &text, CompilerOptions &compiler_options ) -> std::vector { std::unique_lock lock(mutex); LCompilers::FortranEvaluator fe(compiler_options); LCompilers::LocationManager lm; { LCompilers::LocationManager::FileLocations fl; fl.in_filename = filename; lm.files.push_back(fl); lm.file_ends.push_back(text.size()); } LCompilers::diag::Diagnostics diagnostics; { LCompilers::Result result = fe.get_asr2(text, lm, diagnostics); } std::vector diag_lists; diag_lists.reserve(diagnostics.diagnostics.size()); LCompilers::error_highlight h; for (auto &d : diagnostics.diagnostics) { if (!compiler_options.show_warnings && d.level != LCompilers::diag::Level::Error) { continue; } h.message = d.message; h.severity = d.level; for (auto label : d.labels) { for (auto span : label.spans) { uint32_t first_line; uint32_t first_column; uint32_t last_line; uint32_t last_column; std::string filename; lm.pos_to_linecol(span.loc.first, first_line, first_column, filename); lm.pos_to_linecol(span.loc.last, last_line, last_column, filename); h.first_column = first_column; h.last_column = last_column; h.first_line = first_line; h.last_line = last_line; h.filename = filename; diag_lists.push_back(h); } } } return diag_lists; } auto LFortranAccessor::lookupName( const std::string &filename, const std::string &text, CompilerOptions &compiler_options ) -> std::vector { std::unique_lock lock(mutex); LCompilers::FortranEvaluator fe(compiler_options); std::vector symbol_lists; LCompilers::LocationManager lm; { LCompilers::LocationManager::FileLocations fl; fl.in_filename = filename; lm.files.push_back(fl); lm.file_ends.push_back(text.size()); } { LCompilers::diag::Diagnostics diagnostics; LCompilers::Result x = fe.get_asr2(text, lm, diagnostics); if (x.ok) { // populate_symbol_lists(x.result, lm, symbol_lists); uint16_t l = std::stoi(compiler_options.line); uint16_t c = std::stoi(compiler_options.column); uint64_t input_pos = lm.linecol_to_pos(l, c); if (c > 0 && input_pos > 0 && !is_id_chr(text[input_pos]) && is_id_chr(text[input_pos - 1])) { // input_pos is to the right of the word boundary --input_pos; } uint64_t output_pos = lm.input_to_output_pos(input_pos, false); LCompilers::ASR::asr_t* asr = fe.handle_lookup_name(x.result, output_pos); if (ASR::is_a(*asr)) { ASR::symbol_t* s = ASR::down_cast(asr); std::string symbol_name = ASRUtils::symbol_name( s ); LCompilers::document_symbols &loc = symbol_lists.emplace_back(); loc.symbol_name = symbol_name; lm.pos_to_linecol( lm.output_to_input_pos(asr->loc.first, false), loc.first_line, loc.first_column, loc.filename ); lm.pos_to_linecol( lm.output_to_input_pos(asr->loc.last, true), loc.last_line, loc.last_column, loc.filename ); loc.symbol_type = s->type; } } } return symbol_lists; } auto LFortranAccessor::previewSymbol( const std::string &filename, const std::string &text, CompilerOptions &compiler_options ) -> std::vector> { std::unique_lock lock(mutex); LCompilers::FortranEvaluator fe(compiler_options); std::vector> symbol_lists; LCompilers::LocationManager lm; { LCompilers::LocationManager::FileLocations fl; fl.in_filename = filename; lm.files.push_back(fl); lm.file_ends.push_back(text.size()); } { LCompilers::diag::Diagnostics diagnostics; LCompilers::Result x = fe.get_asr2(text, lm, diagnostics); if (x.ok) { // populate_symbol_lists(x.result, lm, symbol_lists); uint16_t l = std::stoi(compiler_options.line); uint16_t c = std::stoi(compiler_options.column); uint64_t input_pos = lm.linecol_to_pos(l, c); if (c > 0 && input_pos > 0 && !is_id_chr(text[input_pos]) && is_id_chr(text[input_pos - 1])) { // input_pos is to the right of the word boundary --input_pos; } uint64_t output_pos = lm.input_to_output_pos(input_pos, false); LCompilers::ASR::asr_t* asr = fe.handle_lookup_name(x.result, output_pos); if (ASR::is_a(*asr)) { std::pair &pair = symbol_lists.emplace_back(); ASR::symbol_t* s = ASR::down_cast(asr); std::string symbol_name = ASRUtils::symbol_name( s ); LCompilers::document_symbols &loc = pair.first; loc.symbol_name = symbol_name; lm.pos_to_linecol( lm.output_to_input_pos(asr->loc.first, false), loc.first_line, loc.first_column, loc.filename ); lm.pos_to_linecol( lm.output_to_input_pos(asr->loc.last, true), loc.last_line, loc.last_column, loc.filename ); loc.symbol_type = s->type; pair.second = ASRUtils::symbol_to_str_fortran(*s, true); } } } return symbol_lists; } auto LFortranAccessor::getAllOccurrences( const std::string &filename, const std::string &text, CompilerOptions &compiler_options ) -> std::vector { std::unique_lock lock(mutex); LCompilers::FortranEvaluator fe(compiler_options); std::vector symbol_lists; LCompilers::LocationManager lm; { LCompilers::LocationManager::FileLocations fl; fl.in_filename = filename; lm.files.push_back(fl); lm.file_ends.push_back(text.size()); } { LCompilers::diag::Diagnostics diagnostics; LCompilers::Result x = fe.get_asr2(text, lm, diagnostics); if (x.ok) { // populate_symbol_lists(x.result, lm, symbol_lists); uint16_t l = std::stoi(compiler_options.line); uint16_t c = std::stoi(compiler_options.column); uint64_t input_pos = lm.linecol_to_pos(l, c); uint64_t output_pos = lm.input_to_output_pos(input_pos, false); LCompilers::ASR::asr_t* asr = fe.handle_lookup_name(x.result, output_pos); LCompilers::document_symbols loc; if (ASR::is_a(*asr)) { ASR::symbol_t* s = ASR::down_cast(asr); std::string symbol_name = ASRUtils::symbol_name( s ); LCompilers::LFortran::OccurenceCollector occ(symbol_name, symbol_lists, lm); occ.visit_TranslationUnit(*x.result); } } } return symbol_lists; } auto LFortranAccessor::format( const std::string &filename, const std::string &text, CompilerOptions &compiler_options, bool color, int indent, bool indent_unit ) -> LCompilers::Result { std::unique_lock lock(mutex); LCompilers::FortranEvaluator fe(compiler_options); LCompilers::LocationManager lm; LCompilers::diag::Diagnostics diagnostics; { LCompilers::LocationManager::FileLocations fl; fl.in_filename = filename; lm.files.push_back(fl); lm.file_ends.push_back(text.size()); } LCompilers::Result r = fe.get_ast2(text, lm, diagnostics); std::cerr << diagnostics.render(lm, compiler_options); if (!r.ok) { LCOMPILERS_ASSERT(diagnostics.has_error()) return LCompilers::Error(); } LCompilers::LFortran::AST::TranslationUnit_t* ast = r.result; // AST -> Source std::string source = LCompilers::LFortran::ast_to_src(*ast, color, indent, indent_unit); return source; } auto LFortranAccessor::getSymbols( const std::string &filename, const std::string &text, CompilerOptions &compiler_options ) -> std::vector { std::unique_lock lock(mutex); LCompilers::FortranEvaluator fe(compiler_options); std::vector symbol_lists; LCompilers::LocationManager lm; { LCompilers::LocationManager::FileLocations fl; fl.in_filename = filename; lm.files.push_back(fl); lm.file_ends.push_back(text.size()); } { LCompilers::diag::Diagnostics diagnostics; LCompilers::Result x = fe.get_asr2(text, lm, diagnostics); if (x.ok) { populateSymbolLists(x.result, lm, symbol_lists, -1); } } return symbol_lists; } } // namespace LCompilers::LLanguageServer lfortran-0.63.0/src/bin/tpl/0000775000175000017500000000000015174404631015756 5ustar alastairalastairlfortran-0.63.0/src/bin/tpl/whereami/0000775000175000017500000000000015174404631017557 5ustar alastairalastairlfortran-0.63.0/src/bin/tpl/whereami/whereami.h0000664000175000017500000000374115174404631021536 0ustar alastairalastair// (‑â—‑â—)> dual licensed under the WTFPL v2 and MIT licenses // without any warranty. // by Gregory Pakosz (@gpakosz) // https://github.com/gpakosz/whereami #ifndef WHEREAMI_H #define WHEREAMI_H #ifdef __cplusplus extern "C" { #endif #ifndef WAI_FUNCSPEC #define WAI_FUNCSPEC #endif #ifndef WAI_PREFIX #define WAI_PREFIX(function) wai_##function #endif /** * Returns the path to the current executable. * * Usage: * - first call `int length = wai_getExecutablePath(NULL, 0, NULL);` to * retrieve the length of the path * - allocate the destination buffer with `path = (char*)malloc(length + 1);` * - call `wai_getExecutablePath(path, length, NULL)` again to retrieve the * path * - add a terminal NUL character with `path[length] = '\0';` * * @param out destination buffer, optional * @param capacity destination buffer capacity * @param dirname_length optional recipient for the length of the dirname part * of the path. * * @return the length of the executable path on success (without a terminal NUL * character), otherwise `-1` */ WAI_FUNCSPEC int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length); /** * Returns the path to the current module * * Usage: * - first call `int length = wai_getModulePath(NULL, 0, NULL);` to retrieve * the length of the path * - allocate the destination buffer with `path = (char*)malloc(length + 1);` * - call `wai_getModulePath(path, length, NULL)` again to retrieve the path * - add a terminal NUL character with `path[length] = '\0';` * * @param out destination buffer, optional * @param capacity destination buffer capacity * @param dirname_length optional recipient for the length of the dirname part * of the path. * * @return the length of the module path on success (without a terminal NUL * character), otherwise `-1` */ WAI_FUNCSPEC int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length); #ifdef __cplusplus } #endif #endif // #ifndef WHEREAMI_H lfortran-0.63.0/src/bin/tpl/whereami/whereami.cpp0000664000175000017500000003771515174404631022101 0ustar alastairalastair// (‑â—‑â—)> dual licensed under the WTFPL v2 and MIT licenses // without any warranty. // by Gregory Pakosz (@gpakosz) // https://github.com/gpakosz/whereami // in case you want to #include "whereami.c" in a larger compilation unit #if !defined(WHEREAMI_H) #include "whereami.h" #endif #ifdef __cplusplus extern "C" { #endif #if defined(__linux__) || defined(__CYGWIN__) #undef _DEFAULT_SOURCE #define _DEFAULT_SOURCE #elif defined(__APPLE__) #undef _DARWIN_C_SOURCE #define _DARWIN_C_SOURCE #define _DARWIN_BETTER_REALPATH #endif #if !defined(WAI_MALLOC) || !defined(WAI_FREE) || !defined(WAI_REALLOC) #include #endif #if !defined(WAI_MALLOC) #define WAI_MALLOC(size) malloc(size) #endif #if !defined(WAI_FREE) #define WAI_FREE(p) free(p) #endif #if !defined(WAI_REALLOC) #define WAI_REALLOC(p, size) realloc(p, size) #endif #ifndef WAI_NOINLINE #if defined(_MSC_VER) #define WAI_NOINLINE __declspec(noinline) #elif defined(__GNUC__) #define WAI_NOINLINE __attribute__((noinline)) #else #error unsupported compiler #endif #endif #if defined(_MSC_VER) #define WAI_RETURN_ADDRESS() _ReturnAddress() #elif defined(__GNUC__) #define WAI_RETURN_ADDRESS() __builtin_extract_return_addr(__builtin_return_address(0)) #else #error unsupported compiler #endif #if defined(_WIN32) #ifndef NOMINMAX #define NOMINMAX #endif // NOMINMAX #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #if defined(_MSC_VER) #pragma warning(push, 3) #endif #include #include #if defined(_MSC_VER) #pragma warning(pop) #endif #include static int WAI_PREFIX(getModulePath_)(HMODULE module, char* out, int capacity, int* dirname_length) { wchar_t buffer1[MAX_PATH]; wchar_t buffer2[MAX_PATH]; wchar_t* path = NULL; int length = -1; bool ok; for (ok = false; !ok; ok = true) { DWORD size; int length_, length__; size = GetModuleFileNameW(module, buffer1, sizeof(buffer1) / sizeof(buffer1[0])); if (size == 0) break; else if (size == (DWORD)(sizeof(buffer1) / sizeof(buffer1[0]))) { DWORD size_ = size; do { wchar_t* path_; path_ = (wchar_t*)WAI_REALLOC(path, sizeof(wchar_t) * size_ * 2); if (!path_) break; size_ *= 2; path = path_; size = GetModuleFileNameW(module, path, size_); } while (size == size_); if (size == size_) break; } else path = buffer1; if (!_wfullpath(buffer2, path, MAX_PATH)) break; length_ = (int)wcslen(buffer2); length__ = WideCharToMultiByte(CP_UTF8, 0, buffer2, length_ , out, capacity, NULL, NULL); if (length__ == 0) length__ = WideCharToMultiByte(CP_UTF8, 0, buffer2, length_, NULL, 0, NULL, NULL); if (length__ == 0) break; if (length__ <= capacity && dirname_length) { int i; for (i = length__ - 1; i >= 0; --i) { if (out[i] == '\\') { *dirname_length = i; break; } } } length = length__; } if (path != buffer1) WAI_FREE(path); return ok ? length : -1; } WAI_NOINLINE WAI_FUNCSPEC int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length) { return WAI_PREFIX(getModulePath_)(NULL, out, capacity, dirname_length); } WAI_NOINLINE WAI_FUNCSPEC int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length) { HMODULE module; int length = -1; #if defined(_MSC_VER) #pragma warning(push) #pragma warning(disable: 4054) #endif if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCTSTR)WAI_RETURN_ADDRESS(), &module)) #if defined(_MSC_VER) #pragma warning(pop) #endif { length = WAI_PREFIX(getModulePath_)(module, out, capacity, dirname_length); } return length; } #elif defined(__linux__) || defined(__CYGWIN__) || defined(__sun) || defined(WAI_USE_PROC_SELF_EXE) #include #include #include #if defined(__linux__) //#include #define PATH_MAX 16384 #else #include #endif #ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS #endif #include #include #if !defined(WAI_PROC_SELF_EXE) #if defined(__sun) #define WAI_PROC_SELF_EXE "/proc/self/path/a.out" #else #define WAI_PROC_SELF_EXE "/proc/self/exe" #endif #endif WAI_FUNCSPEC int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length) { char buffer[PATH_MAX]; char* resolved = NULL; int length = -1; bool ok; for (ok = false; !ok; ok = true) { resolved = realpath(WAI_PROC_SELF_EXE, buffer); if (!resolved) break; length = (int)strlen(resolved); if (length <= capacity) { memcpy(out, resolved, length); if (dirname_length) { int i; for (i = length - 1; i >= 0; --i) { if (out[i] == '/') { *dirname_length = i; break; } } } } } return ok ? length : -1; } #if !defined(WAI_PROC_SELF_MAPS_RETRY) #define WAI_PROC_SELF_MAPS_RETRY 5 #endif #if !defined(WAI_PROC_SELF_MAPS) #if defined(__sun) #define WAI_PROC_SELF_MAPS "/proc/self/map" #else #define WAI_PROC_SELF_MAPS "/proc/self/maps" #endif #endif #if defined(__ANDROID__) || defined(ANDROID) #include #include #include #endif #include WAI_NOINLINE WAI_FUNCSPEC int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length) { int length = -1; FILE* maps = NULL; for (int r = 0; r < WAI_PROC_SELF_MAPS_RETRY; ++r) { maps = fopen(WAI_PROC_SELF_MAPS, "r"); if (!maps) break; for (;;) { char buffer[PATH_MAX < 1024 ? 1024 : PATH_MAX]; uint64_t low, high; char perms[5]; uint64_t offset; uint32_t major, minor; char path[PATH_MAX]; uint32_t inode; if (!fgets(buffer, sizeof(buffer), maps)) break; if (sscanf(buffer, "%" PRIx64 "-%" PRIx64 " %s %" PRIx64 " %x:%x %u %s\n", &low, &high, perms, &offset, &major, &minor, &inode, path) == 8) { uint64_t addr = (uintptr_t)WAI_RETURN_ADDRESS(); if (low <= addr && addr <= high) { char* resolved; resolved = realpath(path, buffer); if (!resolved) break; length = (int)strlen(resolved); #if defined(__ANDROID__) || defined(ANDROID) if (length > 4 &&buffer[length - 1] == 'k' &&buffer[length - 2] == 'p' &&buffer[length - 3] == 'a' &&buffer[length - 4] == '.') { int fd = open(path, O_RDONLY); if (fd == -1) { length = -1; // retry break; } char* begin = (char*)mmap(0, offset, PROT_READ, MAP_SHARED, fd, 0); if (begin == MAP_FAILED) { close(fd); length = -1; // retry break; } char* p = begin + offset - 30; // minimum size of local file header while (p >= begin) // scan backwards { if (*((uint32_t*)p) == 0x04034b50UL) // local file header signature found { uint16_t length_ = *((uint16_t*)(p + 26)); if (length + 2 + length_ < (int)sizeof(buffer)) { memcpy(&buffer[length], "!/", 2); memcpy(&buffer[length + 2], p + 30, length_); length += 2 + length_; } break; } --p; } munmap(begin, offset); close(fd); } #endif if (length <= capacity) { memcpy(out, resolved, length); if (dirname_length) { int i; for (i = length - 1; i >= 0; --i) { if (out[i] == '/') { *dirname_length = i; break; } } } } break; } } } fclose(maps); maps = NULL; if (length != -1) break; } return length; } #elif defined(__APPLE__) #include #include #include #include #include #include WAI_FUNCSPEC int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length) { char buffer1[PATH_MAX]; char buffer2[PATH_MAX]; char* path = buffer1; char* resolved = NULL; int length = -1; bool ok; for (ok = false; !ok; ok = true) { uint32_t size = (uint32_t)sizeof(buffer1); if (_NSGetExecutablePath(path, &size) == -1) { path = (char*)WAI_MALLOC(size); if (!_NSGetExecutablePath(path, &size)) break; } resolved = realpath(path, buffer2); if (!resolved) break; length = (int)strlen(resolved); if (length <= capacity) { memcpy(out, resolved, length); if (dirname_length) { int i; for (i = length - 1; i >= 0; --i) { if (out[i] == '/') { *dirname_length = i; break; } } } } } if (path != buffer1) WAI_FREE(path); return ok ? length : -1; } WAI_NOINLINE WAI_FUNCSPEC int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length) { char buffer[PATH_MAX]; char* resolved = NULL; int length = -1; for(;;) { Dl_info info; if (dladdr(WAI_RETURN_ADDRESS(), &info)) { resolved = realpath(info.dli_fname, buffer); if (!resolved) break; length = (int)strlen(resolved); if (length <= capacity) { memcpy(out, resolved, length); if (dirname_length) { int i; for (i = length - 1; i >= 0; --i) { if (out[i] == '/') { *dirname_length = i; break; } } } } } break; } return length; } #elif defined(__QNXNTO__) #include #include #include #include #include #include #if !defined(WAI_PROC_SELF_EXE) #define WAI_PROC_SELF_EXE "/proc/self/exefile" #endif WAI_FUNCSPEC int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length) { char buffer1[PATH_MAX]; char buffer2[PATH_MAX]; char* resolved = NULL; FILE* self_exe = NULL; int length = -1; bool ok; for (ok = false; !ok; ok = true) { self_exe = fopen(WAI_PROC_SELF_EXE, "r"); if (!self_exe) break; if (!fgets(buffer1, sizeof(buffer1), self_exe)) break; resolved = realpath(buffer1, buffer2); if (!resolved) break; length = (int)strlen(resolved); if (length <= capacity) { memcpy(out, resolved, length); if (dirname_length) { int i; for (i = length - 1; i >= 0; --i) { if (out[i] == '/') { *dirname_length = i; break; } } } } } fclose(self_exe); return ok ? length : -1; } WAI_FUNCSPEC int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length) { char buffer[PATH_MAX]; char* resolved = NULL; int length = -1; for(;;) { Dl_info info; if (dladdr(WAI_RETURN_ADDRESS(), &info)) { resolved = realpath(info.dli_fname, buffer); if (!resolved) break; length = (int)strlen(resolved); if (length <= capacity) { memcpy(out, resolved, length); if (dirname_length) { int i; for (i = length - 1; i >= 0; --i) { if (out[i] == '/') { *dirname_length = i; break; } } } } } break; } return length; } #elif defined(__DragonFly__) || defined(__FreeBSD__) || \ defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) #include #include #include #include #include #include #include #if defined(__OpenBSD__) #include WAI_FUNCSPEC int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length) { char buffer1[4096]; char buffer2[PATH_MAX]; char buffer3[PATH_MAX]; char** argv = (char**)buffer1; char* resolved = NULL; int length = -1; bool ok; for (ok = false; !ok; ok = true) { int mib[4] = { CTL_KERN, KERN_PROC_ARGS, getpid(), KERN_PROC_ARGV }; size_t size; if (sysctl(mib, 4, NULL, &size, NULL, 0) != 0) break; if (size > sizeof(buffer1)) { argv = (char**)WAI_MALLOC(size); if (!argv) break; } if (sysctl(mib, 4, argv, &size, NULL, 0) != 0) break; if (strchr(argv[0], '/')) { resolved = realpath(argv[0], buffer2); if (!resolved) break; } else { const char* PATH = getenv("PATH"); if (!PATH) break; size_t argv0_length = strlen(argv[0]); const char* begin = PATH; while (1) { const char* separator = strchr(begin, ':'); const char* end = separator ? separator : begin + strlen(begin); if (end - begin > 0) { if (*(end -1) == '/') --end; if (((end - begin) + 1 + argv0_length + 1) <= sizeof(buffer2)) { memcpy(buffer2, begin, end - begin); buffer2[end - begin] = '/'; memcpy(buffer2 + (end - begin) + 1, argv[0], argv0_length + 1); resolved = realpath(buffer2, buffer3); if (resolved) break; } } if (!separator) break; begin = ++separator; } if (!resolved) break; } length = (int)strlen(resolved); if (length <= capacity) { memcpy(out, resolved, length); if (dirname_length) { int i; for (i = length - 1; i >= 0; --i) { if (out[i] == '/') { *dirname_length = i; break; } } } } } if (argv != (char**)buffer1) WAI_FREE(argv); return ok ? length : -1; } #else WAI_FUNCSPEC int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length) { char buffer1[PATH_MAX]; char buffer2[PATH_MAX]; char* path = buffer1; char* resolved = NULL; int length = -1; bool ok; for (ok = false; !ok; ok = true) { #if defined(__NetBSD__) int mib[4] = { CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME }; #else int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; #endif size_t size = sizeof(buffer1); if (sysctl(mib, 4, path, &size, NULL, 0) != 0) break; resolved = realpath(path, buffer2); if (!resolved) break; length = (int)strlen(resolved); if (length <= capacity) { memcpy(out, resolved, length); if (dirname_length) { int i; for (i = length - 1; i >= 0; --i) { if (out[i] == '/') { *dirname_length = i; break; } } } } } return ok ? length : -1; } #endif WAI_NOINLINE WAI_FUNCSPEC int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length) { char buffer[PATH_MAX]; char* resolved = NULL; int length = -1; for(;;) { Dl_info info; if (dladdr(WAI_RETURN_ADDRESS(), &info)) { resolved = realpath(info.dli_fname, buffer); if (!resolved) break; length = (int)strlen(resolved); if (length <= capacity) { memcpy(out, resolved, length); if (dirname_length) { int i; for (i = length - 1; i >= 0; --i) { if (out[i] == '/') { *dirname_length = i; break; } } } } } break; } return length; } #else #error unsupported platform #endif #ifdef __cplusplus } #endif lfortran-0.63.0/src/bin/tpl/cpp-terminal/0000775000175000017500000000000015174404631020351 5ustar alastairalastairlfortran-0.63.0/src/bin/tpl/cpp-terminal/terminal.h0000664000175000017500000005615115174404631022345 0ustar alastairalastair#ifndef TERMINAL_H #define TERMINAL_H /* This file is all platform independent, it contains the logic to build * the features that users need in a terminal application. * * The ANSI escape sequences used here are supported by all terminals (Linux, * macOS, Windows). All the functionality here must work on all platforms. The * Windows terminal is probably the most limiting, and so we restrict to the * capabilities that it supports, as documented at: * * https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences */ #include #include #include #include #include #include #define CTRL_KEY(k) (char)(((unsigned char)(k) & 0x1f)) #define ALT_KEY(k) (char)(((unsigned char)(k) + 0x80)) namespace Term { enum class style { reset = 0, bold = 1, dim = 2, italic = 3, underline = 4, blink = 5, rblink = 6, reversed = 7, conceal = 8, crossed = 9 }; enum class fg { black = 30, red = 31, green = 32, yellow = 33, blue = 34, magenta = 35, cyan = 36, gray = 37, reset = 39 }; enum class bg { black = 40, red = 41, green = 42, yellow = 43, blue = 44, magenta = 45, cyan = 46, gray = 47, reset = 49 }; enum class fgB { black = 90, red = 91, green = 92, yellow = 93, blue = 94, magenta = 95, cyan = 96, gray = 97 }; enum class bgB { black = 100, red = 101, green = 102, yellow = 103, blue = 104, magenta = 105, cyan = 106, gray = 107 }; template std::string color(T const value) { return "\033[" + std::to_string(static_cast(value)) + "m"; } inline std::string cursor_off() { return "\x1b[?25l"; } inline std::string cursor_on() { return "\x1b[?25h"; } // If an attempt is made to move the cursor out of the window, the result is // undefined. // TODO: switch col/row inline std::string move_cursor(size_t row, size_t col) { return "\x1b[" + std::to_string(row) + ";" + std::to_string(col) + "H"; } // If an attempt is made to move the cursor to the right of the right margin, // the cursor stops at the right margin. inline std::string move_cursor_right(int col) { return "\x1b[" + std::to_string(col) + "C"; } // If an attempt is made to move the cursor below the bottom margin, the cursor // stops at the bottom margin. inline std::string move_cursor_down(int row) { return "\x1b[" + std::to_string(row) + "B"; } inline std::string cursor_position_report() { return "\x1b[6n"; } inline std::string erase_to_eol() { return "\x1b[K"; } enum Key { BACKSPACE = 1000, ENTER, ALT_ENTER, TAB, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, ARROW_DOWN, CTRL_UP, CTRL_DOWN, CTRL_RIGHT, CTRL_LEFT, NUMERIC_5, DEL, HOME, INSERT, END, PAGE_UP, PAGE_DOWN, ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, }; class Terminal: public BaseTerminal { bool restore_screen_; public: Terminal(bool enable_keyboard=false, bool disable_ctrl_c=true) : BaseTerminal(enable_keyboard, disable_ctrl_c), restore_screen_{false} {} virtual ~Terminal() { restore_screen(); } void restore_screen() { if (restore_screen_) { write("\033[?1049l"); // restore screen write("\033" "8"); // restore current cursor position restore_screen_ = false; } } void save_screen() { restore_screen_ = true; write("\033" "7"); // save current cursor position write("\033[?1049h"); // save screen } inline void write(const std::string& s) const { std::cout << s << std::flush; } // Waits for a key press, translates escape codes int read_key() const { int key; while ((key = read_key0()) == 0) { std::this_thread::sleep_for(std::chrono::milliseconds(10)); } return key; } // If there was a key press, returns the translated key from escape codes, // otherwise returns 0. If the escape code is not supported, returns a // negative number. int read_key0() const { char c; if (!read_raw(&c)) return 0; if (c == '\x1b') { char seq[4]; if (!read_raw(&seq[0])) return Key::ESC; if (!read_raw(&seq[1])) { if (seq[0] >= 'a' && seq[0] <= 'z') { // gnome-term, Windows Console return ALT_KEY(seq[0]); } if (seq[0] == '\x0d') { // gnome-term return Key::ALT_ENTER; } return -1; } if (seq[0] == '[') { if (seq[1] >= '0' && seq[1] <= '9') { if (!read_raw(&seq[2])) { return -2; } if (seq[2] == '~') { switch (seq[1]) { case '1': return Key::HOME; case '2': return Key::INSERT; case '3': return Key::DEL; case '4': return Key::END; case '5': return Key::PAGE_UP; case '6': return Key::PAGE_DOWN; case '7': return Key::HOME; case '8': return Key::END; } } else if (seq[2] == ';') { if (seq[1] == '1') { if (!read_raw(&seq[2])) { return -10; } if (!read_raw(&seq[3])) { return -11; } if (seq[2] == '5') { switch (seq[3]) { case 'A': return Key::CTRL_UP; case 'B': return Key::CTRL_DOWN; case 'C': return Key::CTRL_RIGHT; case 'D': return Key::CTRL_LEFT; } } return -12; } } else { if (seq[2] >= '0' && seq[2] <= '9') { if (!read_raw(&seq[3])) { return -3; } if (seq[3] == '~') { if (seq[1] == '1') { switch (seq[2]) { case '5': return Key::F5; case '7': return Key::F6; case '8': return Key::F7; case '9': return Key::F8; } } else if (seq[1] == '2') { switch (seq[2]) { case '0': return Key::F9; case '1': return Key::F10; case '3': return Key::F11; case '4': return Key::F12; } } } } } } else { switch (seq[1]) { case 'A': return Key::ARROW_UP; case 'B': return Key::ARROW_DOWN; case 'C': return Key::ARROW_RIGHT; case 'D': return Key::ARROW_LEFT; case 'E': return Key::NUMERIC_5; case 'H': return Key::HOME; case 'F': return Key::END; } } } else if (seq[0] == 'O') { switch (seq[1]) { case 'F': return Key::END; case 'H': return Key::HOME; case 'P': return Key::F1; case 'Q': return Key::F2; case 'R': return Key::F3; case 'S': return Key::F4; } } //std::cout << "Unsupported escape sequence:" << std::endl; //std::cout << seq[0] << seq[1] << seq[2] << seq[3] << std::endl; return -4; } else { switch (c) { case '\x09': // TAB return Key::TAB; case '\x0a': // LF return Key::ENTER; case '\x0d': // CR return Key::ENTER; case '\x7f': // DEL return Key::BACKSPACE; } if (c == '\xc3') { if (!read_raw(&c)) { return -8; } else { if (c >= '\xa1' && c <= '\xba') { // xterm return ALT_KEY(c+'a'-'\xa1'); } return -9; } } else if (c == '\xc2') { if (!read_raw(&c)) { return -10; } else { if (c == '\x8d') { // xterm return Key::ALT_ENTER; } return -11; } } return c; } } // TODO: switch rows, cols void get_cursor_position(int& rows, int& cols) const { char buf[32]; unsigned int i = 0; write(cursor_position_report()); while (i < sizeof(buf) - 1) { while (!read_raw(&buf[i])) { }; if (buf[i] == 'R') break; i++; } buf[i] = '\0'; if (i < 5) { throw std::runtime_error("get_cursor_position(): too short response"); } // Find the result in the response, drop the rest: i = 0; while (i < sizeof(buf) - 1 - 5) { if (buf[i] == '\x1b' && buf[i+1] == '[') { if (sscanf(&buf[i+2], "%d;%d", &rows, &cols) == 2) { return; } else { throw std::runtime_error("get_cursor_position(): result could not be parsed"); } } if (buf[i] == '\0') break; i++; } throw std::runtime_error("get_cursor_position(): result not found in the response"); } // This function takes about 23ms, so it should only be used as a fallback void get_term_size_slow(int& rows, int& cols) const { struct CursorOff { const Terminal& term; CursorOff(const Terminal& term) : term{ term } { term.write(cursor_off()); } ~CursorOff() { term.write(cursor_on()); } }; CursorOff cursor_off(*this); int old_row, old_col; get_cursor_position(old_row, old_col); write(move_cursor_right(999) + move_cursor_down(999)); get_cursor_position(rows, cols); write(move_cursor(old_row, old_col)); } }; /*----------------------------------------------------------------------------*/ #define UTF8_ACCEPT 0 #define UTF8_REJECT 0xf static inline uint8_t utf8_decode_step(uint8_t state, uint8_t octet, uint32_t *cpp) { static const uint32_t utf8_classtab[0x10] = { 0x88888888UL,0x88888888UL,0x99999999UL,0x99999999UL, 0xaaaaaaaaUL,0xaaaaaaaaUL,0xaaaaaaaaUL,0xaaaaaaaaUL, 0x222222ffUL,0x22222222UL,0x22222222UL,0x22222222UL, 0x3333333bUL,0x33433333UL,0xfff5666cUL,0xffffffffUL, }; static const uint32_t utf8_statetab[0x10] = { 0xfffffff0UL,0xffffffffUL,0xfffffff1UL,0xfffffff3UL, 0xfffffff4UL,0xfffffff7UL,0xfffffff6UL,0xffffffffUL, 0x33f11f0fUL,0xf3311f0fUL,0xf33f110fUL,0xfffffff2UL, 0xfffffff5UL,0xffffffffUL,0xffffffffUL,0xffffffffUL, }; const uint8_t reject = (state >> 3), nonascii = (octet >> 7); const uint8_t class_ = (!nonascii? 0 : (0xf & (utf8_classtab[(octet >> 3) & 0xf] >> (4 * (octet & 7))))); *cpp = (state == UTF8_ACCEPT ? (octet & (0xffU >> class_)) : ((octet & 0x3fU) | (*cpp << 6))); return (reject? 0xf : (0xf & (utf8_statetab[class_] >> (4 * (state & 7))))); } /*----------------------------------------------------------------------------*/ inline void codepoint_to_utf8(std::string &s, char32_t c) { if (c > 0x0010FFFF) { throw std::runtime_error("Invalid UTF32 codepoint."); } char bytes[4]; int nbytes = 1; char32_t d = c; if (c >= 0x10000) { nbytes++; bytes[3] = ((d | 0x80) & 0xBF); d >>= 6; } if (c >= 0x800) { nbytes++; bytes[2] = ((d | 0x80) & 0xBF); d >>= 6; } if (c >= 0x80) { nbytes++; bytes[1] = ((d | 0x80) & 0xBF); d >>= 6; } static const unsigned char mask[4] = {0x00, 0xC0, 0xE0, 0xF0}; bytes[0] = static_cast(d | mask[nbytes-1]); s.append(bytes, nbytes); } /*----------------------------------------------------------------------------*/ // Converts an UTF8 string to UTF32. inline std::u32string utf8_to_utf32(const std::string &s) { uint32_t codepoint; uint8_t state=UTF8_ACCEPT; std::u32string r; for (size_t i=0; i < s.size(); i++) { state = utf8_decode_step(state, s[i], &codepoint); if (state == UTF8_ACCEPT) { r.push_back(codepoint); } if (state == UTF8_REJECT) { throw std::runtime_error("Invalid byte in UTF8 encoded string"); } } if (state != UTF8_ACCEPT) { throw std::runtime_error("Expected more bytes in UTF8 encoded string"); } return r; } // Converts an UTF32 string to UTF8. inline std::string utf32_to_utf8(const std::u32string &s) { std::string r; for (size_t i=0; i < s.size(); i++) { codepoint_to_utf8(r, s[i]); } return r; } // TODO: // * Rename Window to Screen, as it really is a model of the terminal screen, // and should only be used once per application. If an application has windows, // those should be built on top, and they should render to Screen. // * Remember cursor position also (and if it is on or off) // * Implement screen diffing (taking another Window instance as an argument in // render()) /* Represents a rectangular window, as a 2D array of characters and their * attributes. The render method can convert this internal representation to a * string that when printed will show the Window on the screen. * * Note: the characters are represented by char32_t, representing their UTF-32 * code point. The natural way to represent a character in a terminal would be * a "unicode grapheme cluster", but due to a lack of a good library for C++ * that could handle those, we simply use a Unicode code point as a character. */ class Window { private: size_t w, h; // width and height of the window size_t cursor_x, cursor_y; // current cursor position std::vector chars; // the characters in row first order std::vector m_fg; std::vector m_bg; std::vector lfortran-0.63.0/build_release.sh0000775000175000017500000000107415174404631016760 0ustar alastairalastair#!/usr/bin/env bash set -e set -x cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_FLAGS_RELEASE="-Wall -Wextra -O3 -funroll-loops -DNDEBUG" \ -DWITH_LLVM=yes \ -DWITH_LSP=yes \ -DLFORTRAN_BUILD_ALL=yes \ -DWITH_STACKTRACE=no \ -DWITH_RUNTIME_STACKTRACE=yes \ -DUSE_DYNAMIC_ZSTD=no \ -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX=`pwd`/inst \ -DCMAKE_INSTALL_LIBDIR=share/lfortran/lib \ -DCMAKE_EXPORT_COMPILE_COMMANDS=yes \ -G Ninja \ . cmake --build . --target install lfortran-0.63.0/doc/0000775000175000017500000000000015174404631014365 5ustar alastairalastairlfortran-0.63.0/doc/intl.py0000664000175000017500000000400015174404631015677 0ustar alastairalastair""" Script for conveniently updating the translation files. Run this script with: .. code:: python3 intl.py You can also pass the language code as an argument: .. code:: python3 intl.py de Do not pass the default language code as an argument. """ import json import sys import subprocess from pathlib import Path from typing import List root = Path(__file__).parent """ Make sure to run this script from the root of the documenation repository. """ all_languages: List[str] """ List of currently supported languages, taken from ``doc/src/_static/languages.json``. To support a new language add its `language code`_ to the list. .. _language code: https://www.sphinx-doc.org/en/master/usage/configuration.html#intl-options """ with open(root / "src" / "_static" / "languages.json") as fd: all_languages = list(json.load(fd).values()) def intl_gettext() -> None: """ Update the ``gettext`` translation files. """ subprocess.run( ["sphinx-build", "-b", "gettext", str(root / "src"), str(root / "_gettext")], cwd=root, ) def intl_update(language: str) -> None: """ Update a translation file. Parameters ---------- language : str Language to update. """ subprocess.run( [ "sphinx-intl", "update", "-l", language, "-d", str(root / "locale"), "-p", str(root / "_gettext"), ], cwd=root, ) def intl_all(languages: List[str]) -> None: """ Update all translation files. Parameters ---------- languages : List[str] List of languages to update. """ intl_gettext() intl_update(",".join(languages)) if __name__ == "__main__": languages = sys.argv[1:] if len(sys.argv) > 1 else all_languages[1:] intl_all(languages) print() print("Please commit the changes to the translation files if necessary.") print() print(f" git add \"{root / 'locale'}\"") print() lfortran-0.63.0/doc/src/0000775000175000017500000000000015174404631015154 5ustar alastairalastairlfortran-0.63.0/doc/src/language.md0000664000175000017500000000405415174404631017264 0ustar alastairalastair# Fortran Language ## Background and Motivation Fortran was designed from the ground up to naturally and simply translate mathematics to code that compiles and runs at maximum speed. And being specifically targeted for such fundamentally computational tasks, it contains a broad range of key functionality within the language itself, standard across all platforms, with no need for external libraries that may or may not be well optimized or maintained, at present or down the road. Some highlights: * Multidimensional arrays which can be allocated and indexed as the math/science dictates (not restricted to start at 0 or 1) and can be sliced as desired (as, e.g., in MATLAB); * Operators which operate naturally upon the aforementioned arrays/matrices, as they do scalars; * Complex numbers; * Special functions; * Structures and pointers for more general data representation. Because the essentials are contained in the language itself, it is simple to read and write, without need of choosing from among or deciphering a proliferation of external classes to do the same thing. And because the essentials are self-contained, compilers can provide detailed compile-time (e.g., argument mismatch) and run-time (e.g., memory access) checks, as well as highly optimized executables, directly from natural, readable code without need of extensive optimization heroics by the developer. See our blog posts for more information: * [Why We Created LFortran](https://lfortran.org/blog/2019/04/why-we-created-lfortran/) * [Why to Use Fortran For New Projects](https://lfortran.org/blog/2019/05/why-to-use-fortran-for-new-projects/) ## How to Learn Fortran Fortran is relatively quick to learn because it is so much simpler and smaller than C/C++ (in practice, that is, with all needed libraries included). If you are interested in learning more, please see our webpage at [fortran90.org] with recommended practices for writing code, side by side comparison with Python/NumPy, links to other online Fortran resources and books, and an FAQ. [fortran90.org]: https://www.fortran90.org/ lfortran-0.63.0/doc/src/llvm_utils.md0000664000175000017500000000560115174404631017672 0ustar alastairalastair# LLVMFinalize Class ## Brief - Finalizes symbol-table's variables. - It's used right after inserting return or end block of an ASR construct (program, function, block, etc.) ## How To Use ? - Create an instance by using the exposed constructor. - Call the only exposed member function `finalize_symtab()` with the desired symbol table to finalize. - Use it after declaring the return block OR the end block of the construct you're freeing the symbol table of. - Notice it doesn't work with module's symbol table. ## Design Flow Global variables aren't finalized; They live till program ends anyway so we don't care much about them. The Class has a main finalizer function `finalize()` that either dispatches to `finalize_allocatable()` or `finalize_type()` #### Main Finalizers - `finalize_allocatable()` : It finalizes the type first by calling `finalize_type()` that consequently dispatches to the actual finalizer function based on the type of couse. Next, It frees the allocated memory (due to the nature of the `allocatable` attribute for sure). **Example**: `type(t), allocatable :: n` - Calls `finalize()` -> `finalize_allocatable()` -> `finalize_type()` -> `free_allocatable()` - `finalize_type()` This disptaches to one of following : `finalize_scalars()`, `finalize_struct()`, `finalize_string()`,`finalize_array()`, `finalize_list()`, `finalize_set()` ,`finalize_dict()` ,`finalize_tuple()`, `finalize_union()` Each one of those is responsible of finalizing the type it's named after. **Example**: `type(t), allocatable :: n` `finalize_struct()` once works on that `t` type, it will loop on each and every variable (struct member) and free it using `finalize()`. ## Examples #### `type(t), alloatable :: t_arr(:)` - `finalize()` --> Dispatches to `finalize_allocatable()` - `finalize_allocatable()` --> Calls `finalize_type()` - `finalize_type()` --> Calls `finalize_array()` - `finalize_array()` --> Finalizes internals elements and other info (if any is heap allocated). Let's see how. - `finalize_array()` --> Calls utility `finalize_array_data()` to free array's elements as different array types require different handling, they don't go and just call `finalize` on the type of array. - `finalize_array_data()` --> Loops on the array size to get each and every struct `t` . - `finalize_array_data()` --> Calls `finalize_struct()` on each element. - `finalize_struct()` --> Loops on each and every element attempting to finalize each memeber within the struct by its own finalizer based on the struct member type using `finalize_type()` - `finalize_array()` --> Calls `free_array_ptr_to_consecutive_data()` this is responsible of freeing consecutively allocated memory of the array. - `finalize_allocatable()`--> Calls `free_allocatable_ptr()` which should have the logic if allocatable arrays need a finalization (They physical array type).lfortran-0.63.0/doc/src/installation.md0000664000175000017500000003005115174404631020176 0ustar alastairalastair# Installation All the instructions below work on Linux, macOS and Windows. ## Binaries The recommended way to install LFortran is using Conda. Install Conda for example by installing the [Miniconda](https://conda.io/en/latest/miniconda.html) installation by following instructions there for your platform. Then create a new environment (you can choose any name, here we chose `lf`) and activate it: ```bash conda create -n lf conda activate lf ``` Then install LFortran by: ```bash conda install lfortran -c conda-forge ``` Now the `lf` environment has the `lfortran` compiler available, you can start the interactive prompt by executing `lfortran`, or see the command line options using `lfortran -h`. ### Note about Conda Installation When installing LFortran using Conda, multiple copies of the `lfortran` executable may be present in different locations (for example, in the package cache). Only the executable inside the active Conda environment should be used. After activating a conda environment, the correct executable is typically located at: `$CONDA_PREFIX/bin/lfortran` To verify which executable is being used, activate a conda environment and run: `which lfortran` Other copies located in package directories may not run correctly and can be ignored. The Jupyter kernel is automatically installed by the above command, so after installing Jupyter itself: ```bash conda install jupyter -c conda-forge ``` You can create a Fortran based Jupyter notebook by executing: ```bash jupyter notebook ``` and selecting `New->Fortran`. ## Build From a Source Tarball This method is the recommended method if you just want to install LFortran, either yourself or in a package manager (Spack, Conda, Debian, etc.). The source tarball has all the generated files included and has minimal dependencies. The source tarball of LFortran depends on: * Python * cmake * LLVM 10-19 * zstd-static * zlib First we have to install dependencies, for example using Conda: ```bash conda create -n lf python cmake llvmdev zstd-static zlib conda activate lf ``` On a Linux system, we additionally need to install `libunwind`: ```bash conda install libunwind ``` Then download a tarball from [https://lfortran.org/download/](https://lfortran.org/download/), e.g.: ```bash wget https://github.com/lfortran/lfortran/releases/download/v0.42.0/lfortran-0.42.0.tar.gz tar xzf lfortran-0.42.0.tar.gz cd lfortran-0.42.0 ``` And build: ```bash cmake -DWITH_LLVM=yes -DCMAKE_INSTALL_PREFIX=`pwd`/inst . make -j8 make install ``` This will install `lfortran` into `inst/bin`. It assumes that c++ and cc are available, which on Linux are typically the GNU C++/C compilers. ## Build From Git We assume you have C++ compilers installed, as well as `git` and `wget`. In Ubuntu, you can also install `binutils-dev` for stacktraces. If you do not have Conda installed, you can do so on Linux (and similarly on other platforms): ```bash wget --no-check-certificate https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh bash miniconda.sh -b -p $HOME/conda_root export PATH="$HOME/conda_root/bin:$PATH" ``` Clone the LFortran git repository: ``` git clone https://github.com/lfortran/lfortran.git cd lfortran ``` Then prepare the environment: ```bash conda env create -f environment_linux.yml conda activate lf ``` Generate files that are needed for the build (this step depends on `re2c`, `bison` and `python`): ```bash ./build0.sh ``` Now you can use our script `./build1.sh` to build in Debug mode: ```bash ./build1.sh ``` and can use `ninja` to rebuild. To do a clean rebuild, you can use: ```bash # NOTE: the below git command deletes all untracked files git clean -dfx # reset repository to a clean state by removing artifacts generated during the build process ./build0.sh ./build1.sh ``` Run an interactive prompt: ```bash ./src/bin/lfortran ``` See [how to run tests](#Tests) to make sure all tests pass ## Build from Git on Windows with Visual Studio Install Visual Studio (MSVC), for example the version 2022, you can download the Community version for free from: https://visualstudio.microsoft.com/downloads/. Install miniforge using the Windows installer from https://github.com/conda-forge/miniforge. Launch the Miniforge Prompt from the Desktop. In the shell, initialize the MSVC compiler using: ``` call "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd" -arch=x64 ``` You can optionally test that MSVC works by: ``` cl /? link /? ``` Both commands must print help (several pages). Now you can download and build LFortran: ``` git clone https://github.com/lfortran/lfortran.git cd lfortran conda env create -f environment_win.yml conda activate lf build0.bat build1.bat ``` If everything compiled, then you can use LFortran as follows: ``` inst\bin\lfortran examples/expr2.f90 expr2.exe inst\bin\lfortran ``` And so on. Note: LFortran currently uses the MSVC's linker program (`link`), which is only available when the MSVC bat script above is ran. If you forget to activate it, LFortran's linking will fail. Note: the miniforge shell seems to be running some version of `git-bash` (although it is `cmd.exe`), which has some unix-like filesystem mounted in `/usr` and several commands available such as `ls`, `which`, `git`, `vim`. For this reason the Conda build `environment_win.yml` contains everything needed, including `git`. ## Build from Git on Windows with WSL * In windows search "turn windows features on or off". * Tick Windows subsystem for Linux. * Press OK and restart computer. * Go to Microsoft store and download Ubuntu (20.04 or 22.04 or 24.04), and launch it. * Now setup LFortran by running the following commands. ```bash wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -O miniconda.sh bash miniconda.sh -b -p $HOME/conda_root echo "export PATH=$HOME/conda_root/bin:$PATH" >> ~/.bashrc ``` * After that restart the Ubuntu terminal. * Now clone the LFortran git repository (you should clone it inside a linux owned directory like `~` or any of its sub-directories). ```bash cd ~ git clone https://github.com/lfortran/lfortran.git cd lfortran ``` * Run the following ```bash conda env create -f environment_linux.yml conda init bash ``` * Restart Ubuntu terminal again ```bash conda activate lf sudo apt update sudo apt-get install build-essential sudo apt-get install zlib1g-dev libzstd-dev sudo apt install clang ``` * Run the following commands ```bash conda activate lf ./build0.sh cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_LLVM=yes -DCMAKE_INSTALL_PREFIX=`pwd`/inst . make -j8 ``` * If everything compiles, you can use LFortran as follows ```bash ./src/bin/lfortran ./examples/expr2.f90 ./expr2.out ``` * Run an interactive prompt ```bash ./src/bin/lfortran ``` See [how to run tests](#Tests) to make sure all tests pass ## Enabling the Jupyter Kernel To install the Jupyter kernel, install the following Conda packages also: ``` conda install xeus=5.1.0 xeus-zmq=3.0.0 nlohmann_json ``` and enable the kernel by `-DWITH_XEUS=yes` and install into `$CONDA_PREFIX`. For example: ``` cmake \ -DCMAKE_BUILD_TYPE=Debug \ -DWITH_LLVM=yes \ -DWITH_XEUS=yes \ -DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX="$CONDA_PREFIX" \ . cmake --build . -j4 --target install ``` To use it, install Jupyter (`conda install jupyter`) and test that the LFortran kernel was found: ``` jupyter kernelspec list --json ``` Then launch a Jupyter notebook as follows: ``` jupyter notebook ``` Click `New->Fortran`. To launch a terminal jupyter LFortran console: ``` jupyter console --kernel=fortran ``` ## Build From Git with Nix There's a provided Nix shell for making a consistent build environment with the exact same dependency versions across users. ### Using the Environment Enter the development environment: ```bash nix develop ./ci/nix ``` To change the compilation environment from `gcc` (default) to `clang`: ```bash nix develop ./ci/nix#clangOnly ``` Depending on your system configuration, you might have to run `nix develop` with the following extra nix features explicitly enabled: ```bash nix --extra-experimental-features "flakes nix-command" develop ./ci/nix ``` ### Building the Code The build steps are the same as when building from git: ```bash ./build0.sh ./build1.sh ``` As of 2025-11-10, the environment passes the CI tests, provided you tell it where to install the Jupyter kernel: ```bash LFORTRAN_CMAKE_GENERATOR=Ninja CONDA_PREFIX=$(pwd) JUPYTER_PATH=$(pwd)/share/jupyter bash ci/build.sh ``` (take note that the Nix shell does not use conda) Give the same `JUPYTER_PATH` when running `jupyter notebook` / `jupyter lab` to use the same jupyter kernel. ## Note About Dependencies End users (and distributions) are encouraged to use the tarball from [https://lfortran.org/download/](https://lfortran.org/download/), which only depends on LLVM, CMake and a C++ compiler. The tarball is generated automatically by our CI (continuous integration) and contains some autogenerated files: the parser, the AST and ASR nodes, which is generated by an ASDL translator (requires Python). The instructions from git are to be used when developing LFortran itself. ## Note for users who do not use Conda Following are the dependencies necessary for installing this repository in development mode, - [Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz) - [LLVM - 11.0.1](https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.1/llvm-11.0.1.src.tar.xz) - [re2c - 2.0.3](https://re2c.org/install/install.html) - [binutils - 2.31.90](ftp://sourceware.org/pub/binutils/snapshots/binutils-2.31.90.tar.xz) - Make sure that you should enable the required options related to this dependency to build the dynamic libraries (the ones ending with `.so`). ## Stacktraces LFortran can print stacktraces when there is an unhandled exception, as well as on any compiler error with the `--show-stacktrace` option. This is very helpful for developing the compiler itself to see where in LFortran the problem is. The stacktrace support is turned off by default, to enable it, compile LFortran with the `-DWITH_STACKTRACE=yes` cmake option after installing the prerequisites on each platform per the instructions below. ### LLVM In all platforms having LLVM, stacktraces can be shown with LLVM, so no additional prerequisites are required. If LLVM is not available, you can use the following instructions, depending on your platform. ### Ubuntu In Ubuntu, `apt install binutils-dev`. ### macOS If you use the default Clang compiler on macOS, then the stacktraces should just work on both Intel and M1 based macOS (the CMake build system automatically invokes the `dsymtuil` tool and our Python scripts to store the debug information, see `src/bin/CMakeLists.txt` for more details). If it does not work, please report a bug. If you do not like the default way, an alternative is to use bintutils. For that, first install [Spack](https://spack.io/), then: ```bash spack install binutils spack find -p binutils ``` The last command will show a full path to the installed `binutils` package. Add this path to your shell config file, e.g.: ```bash export CMAKE_PREFIX_PATH_LFORTRAN=/Users/ondrej/repos/spack/opt/spack/darwin-catalina-broadwell/apple-clang-11.0.0/binutils-2.36.1-wy6osfm6bp2323g3jpv2sjuttthwx3gd ``` and compile LFortran with the `-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX"` cmake option. The `$CONDA_PREFIX` is there if you install some other dependencies (such as `llvm`) using Conda, otherwise you can remove it. ## Tests #### Run tests: ```bash ctest ./run_tests.py ``` #### Update test references: ```bash ./run_tests.py -u ``` #### Run integration tests ```bash cd integration_tests ./run_tests.py ``` #### Speed up integration tests on macOS Integration tests run slowly because Apple checks the hash of each executable online before running. You can turn off that feature in the Privacy tab of the Security and Privacy item of System Preferences > Developer Tools > Terminal.app > "allow the apps below to run software locally that does not meet the system's security policy." lfortran-0.63.0/doc/src/conf.py0000664000175000017500000000307715174404631016462 0ustar alastairalastairimport json from pathlib import Path root = Path(__file__).parent with open(root / "_static" / "languages.json", "r", encoding="utf-8") as fd: all_languages = json.load(fd) if "language" not in globals(): language = "en" project = "LFortran" author = f"{project} contributors" copyright = f"2022 {author}" extensions = [ "myst_parser", "nbsphinx", "sphinx_copybutton", ] myst_enable_extensions = [ "dollarmath", ] html_theme = "sphinx_material" html_title = project html_logo = "_static/img/lfortran-logo.svg" html_favicon = html_logo html_css_files = ["css/custom.css", "css/ansi.css"] html_static_path = ["_static"] html_show_sourcelink = False html_theme_options = { "nav_title": f"{project} Documentation", "base_url": f"https://docs.lfortran.org/{language}/", "repo_name": project, "color_primary": "amber", "color_accent": "orange", "repo_url": "https://github.com/lfortran/lfortran", "nav_links": [ dict(href="installation", internal=True, title="Getting started"), dict(href="progress", internal=True, title="LFortran Development Status"), dict(href="design", internal=True, title="Developers's Guide"), dict(href="intrinsics/array", internal=True, title="Intrinsics"), ], "version_info": { lang: f"/../{code}/" for lang, code in all_languages.items() }, "globaltoc_depth": 2, } html_sidebars = { "**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"] } templates_path = ["_templates"] locale_dirs = ["../locale"] gettext_compact = "docs" lfortran-0.63.0/doc/src/_static/0000775000175000017500000000000015174404631016602 5ustar alastairalastairlfortran-0.63.0/doc/src/_static/img/0000775000175000017500000000000015174404631017356 5ustar alastairalastairlfortran-0.63.0/doc/src/_static/img/lfortran-logo.svg0000664000175000017500000001155515174404631022673 0ustar alastairalastair lfortran-0.63.0/doc/src/_static/css/0000775000175000017500000000000015174404631017372 5ustar alastairalastairlfortran-0.63.0/doc/src/_static/css/custom.css0000664000175000017500000000022315174404631021413 0ustar alastairalastair.md-header { color: #000; font-weight: 700; } .md-tabs { color: #000; } .md-hero { color: #000; } .dropdown-content { color: #000; } lfortran-0.63.0/doc/src/_static/css/ansi.css0000664000175000017500000000547115174404631021045 0ustar alastairalastair.output_text pre { font-size: 12px; line-height: 14px; background-color: #000000; color: #FFFFFF; padding: 2px; } /* CSS font colors for translated ANSI escape sequences */ /* The color values are a mix of http://www.xcolors.net/dl/baskerville-ivorylight and http://www.xcolors.net/dl/euphrasia */ .ansi-black-fg { color: #3E424D; } .ansi-black-bg { background-color: #3E424D; } .ansi-black-intense-fg { color: #282C36; } .ansi-black-intense-bg { background-color: #282C36; } .ansi-red-fg { color: #E75C58; } .ansi-red-bg { background-color: #E75C58; } .ansi-red-intense-fg { color: #B22B31; } .ansi-red-intense-bg { background-color: #B22B31; } .ansi-green-fg { color: #4E9A06; } .ansi-green-bg { background-color: #00A250; } .ansi-green-intense-fg { color: #8AE234; } .ansi-green-intense-bg { background-color: #007427; } .ansi-yellow-fg { color: #DDB62B; } .ansi-yellow-bg { background-color: #DDB62B; } .ansi-yellow-intense-fg { color: #B27D12; } .ansi-yellow-intense-bg { background-color: #B27D12; } .ansi-blue-fg { color: #208FFB; } .ansi-blue-bg { background-color: #208FFB; } .ansi-blue-intense-fg { color: #729FCF; } .ansi-blue-intense-bg { background-color: #0065CA; } .ansi-magenta-fg { color: #D160C4; } .ansi-magenta-bg { background-color: #D160C4; } .ansi-magenta-intense-fg { color: #A03196; } .ansi-magenta-intense-bg { background-color: #A03196; } .ansi-cyan-fg { color: #60C6C8; } .ansi-cyan-bg { background-color: #60C6C8; } .ansi-cyan-intense-fg { color: #258F8F; } .ansi-cyan-intense-bg { background-color: #258F8F; } .ansi-white-fg { color: #C5C1B4; } .ansi-white-bg { background-color: #C5C1B4; } .ansi-white-intense-fg { color: #A1A6B2; } .ansi-white-intense-bg { background-color: #A1A6B2; } .ansi-default-inverse-fg { color: #FFFFFF; } .ansi-default-inverse-bg { background-color: #000000; } .ansi-bold { font-weight: bold; } .ansi-underline { text-decoration: underline; } /* The following styles are deprecated an will be removed in a future version */ .ansibold { font-weight: bold; } .ansi-inverse { outline: 0.5px dotted; } /* use dark versions for foreground, to improve visibility */ .ansiblack { color: black; } .ansired { color: darkred; } .ansigreen { color: darkgreen; } .ansiyellow { color: #c4a000; } .ansiblue { color: darkblue; } .ansipurple { color: darkviolet; } .ansicyan { color: steelblue; } .ansigray { color: gray; } /* and light for background, for the same reason */ .ansibgblack { background-color: black; } .ansibgred { background-color: red; } .ansibggreen { background-color: green; } .ansibgyellow { background-color: yellow; } .ansibgblue { background-color: blue; } .ansibgpurple { background-color: magenta; } .ansibgcyan { background-color: cyan; } .ansibggray { background-color: gray; } lfortran-0.63.0/doc/src/_static/languages.json0000664000175000017500000000036315174404631021445 0ustar alastairalastair{ "English": "en", "Bengali": "bn", "Czech": "cs", "German": "de", "Spanish": "es", "French": "fr", "Japanese": "ja", "Dutch": "nl", "Polish": "pl", "Portuguese": "pt", "Russian": "ru", "Chinese": "zh_CN" } lfortran-0.63.0/doc/src/passes/0000775000175000017500000000000015174404631016452 5ustar alastairalastairlfortran-0.63.0/doc/src/passes/subroutine_from_function.md0000664000175000017500000000650215174404631024126 0ustar alastairalastair### Class `AllocateVarBasedOnFuncCall` ======== What Is It Doing? ======== It allocates a Var based on the return type of a FunctionCall. ======== Why This Class? ======== While we're using the return type of the functionCall we might face FunctionParam nodes OR We might face already replaced FunctionParam nodes. The problem : That FuncParam node could be a functionCall node. If we allocate using the return type rightaway without creating temporary to hold the functionCall result, We'll end up double calling the function. one for the allocate statement and one for the passed argument. Another Problem : Having a functionCall (argument) inplace of a functionParam but the functionCall got replaced into a temporary variable, hence we got Revaluate and replace that old functionCall with the temporary -- otherwise we'll double call the function also. How to fix that ?? Use the Function's return type (the one that has FunctionParam nodes) and start traversing through the type node attempting to replace functionCalls with temporaries inplace of the FunctinonParam and also the FunctionCall argument Note : We're attempting to create temporaries for functionCalls -- We rely on the fact that we're applying this whole pass logic in depth first manner -- making us creating temporaries for simple functionCalls. NO AGGREGATE RETURNS ======== Example ======== ```.f90 function foo(x) result (r) integer :: x character(len=x) :: r end function print *, foo(f()) ! ASSUME `f()` returns an integer ``` WITHOUT THIS CLASS : ```.f90 allocate(character(len=f()) :: return_slot) ! DOUBLE EVALUATION OF `f()` call foo(f(), return_slot) print *, return_slot ``` WITH THIS CLASS : ```.f90 temp_var = f() allocate(character(len=funcCall_temp_var) :: return_slot) call foo(temp_var, return_slot) print *, return_slot ``` ======== How It Works? ======== 1. We use entry static function `Allocate()` to prevent using other functions by mistake. 2. Pass to it Var to allocate + FunctionCall we're allocating against its return type + Other helper members. 3. We get function return type (the one with FunctionParams). 4. We call the replacer on the type. 5. The replacer replaces FunctionParam nodes with arguments in the functionCall. 6. FunctionCalls arguments are replaced with temporaries in both FunctionParam site and also the functionCall's argument site. 7. Any other argument expression is just used normally. 8. Then we insert an allocate statement (the main purpose of this class) --- ### Class `CreateFunctionFromSubroutine` ================= What Is It Doing? ================= This pass transforms functions that return aggregate types (like arrays, structs, strings, etc.) into subroutines. ================= How It works? ================= 1. It visits only Function nodes in the ASR tree. 2. We use `handle_fn_return_var()` to identify whether this function needs transformation or not. 3. `is_aggregate_or_array_or_nonPrimitive_type()` have the roles on which we decide. 4. If transformation is needed, We transform function's member `return_var` into intentOUT argument and we nullify the member. 5. We also store the original return type in a map for later use. lfortran-0.63.0/doc/src/developer_tutorial.ipynb0000664000175000017500000000655615174404631022143 0ustar alastairalastair{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Developer Tutorial\n", "\n", "This is a tutorial for anybody who wants to either develop LFortran or build\n", "tools on top.\n", "\n", "## Introduction\n", "\n", "LFortran is structured around two independent modules, AST and ASR, both of\n", "which are standalone (completely independent of the rest of LFortran) and users\n", "are encouraged to use them independently for other applications and build tools\n", "on top:\n", "\n", "* Abstract Syntax Tree (AST): Represents any Fortran\n", " source code, strictly based on syntax, no semantic is included. The AST\n", " module can convert itself to Fortran source code.\n", "\n", "* Abstract Semantic Representation (ASR): Represents a\n", " valid Fortran source code, all semantic is included. Invalid Fortran code is\n", " not allowed (an error will be given). The ASR module can convert itself to an\n", " AST.\n", "\n", "## Abstract Syntax Tree (AST)\n", "\n", "Fortran source code can be parsed into an AST using the `src_to_ast()`\n", "function:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "integer function f(a, b) result(r)\n", "integer, intent(in) :: a, b\n", "r = a + b\n", "end function" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can pretty print it using the `%%showast` magic:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": true }, "outputs": [], "source": [ "%%showast\n", "integer function f(a, b) result(r)\n", "integer, intent(in) :: a, b\n", "r = a + b\n", "end function" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can convert AST to Fortran source code using `%%showfmt`:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%showfmt\n", "integer function f(a, b) result(r)\n", "integer, intent(in) :: a, b\n", "r = a + b\n", "end function" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "All AST nodes and their arguments are described in\n", "[AST.asdl](https://github.com/lfortran/lfortran/blob/master/grammar/AST.asdl).\n", "\n", "## Abstract Semantic Representation (ASR)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can pretty print using the `%%showasr` magic:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%showasr\n", "integer function f2(a, b) result(r)\n", "integer, intent(in) :: a, b\n", "r = a + b\n", "end function" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "All ASR nodes and their arguments are described in\n", "[ASR.asdl](https://github.com/lfortran/lfortran/blob/master/src/libasr/ASR.asdl)." ] } ], "metadata": { "kernelspec": { "display_name": "Fortran", "language": "fortran", "name": "fortran" }, "language_info": { "file_extension": ".f90", "mimetype": "text/x-fortran", "name": "fortran", "version": "2018" } }, "nbformat": 4, "nbformat_minor": 2 } lfortran-0.63.0/doc/src/index.md0000664000175000017500000001564315174404631016616 0ustar alastairalastair# LFortran Documentation LFortran is a modern open-source (BSD licensed) interactive Fortran compiler built on top of LLVM. It can execute user's code interactively to allow exploratory work (much like Python, MATLAB or Julia) as well as compile to binaries with the goal to run user's code on modern architectures such as multi-core CPUs and GPUs. Website: [https://lfortran.org/](https://lfortran.org/) Main repository: [https://github.com/lfortran/lfortran](https://github.com/lfortran/lfortran) Try online using Binder: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb%2Flfortran-binder/master?filepath=Demo.ipynb) ## Feature Highlights LFortran is in development, there are features that work today, and there are features that are being implemented. You can also check out the [Development Status](progress.md) section for more information on features being supported and being worked on. ### Works today * **Interactive, Jupyter support** LFortran can be used from Jupyter as a Fortran kernel, allowing a Python/Julia style rapid prototyping and exploratory workflow (see the [static](https://nbviewer.jupyter.org/gist/certik/f1d28a486510810d824869ab0c491b1c) or [interactive](https://mybinder.org/v2/gl/lfortran%2Fweb%2Flfortran-binder/master?filepath=Demo.ipynb) example notebook). Or it can be used from the command-line in an interactive prompt (REPL). * **Clean, modular design, usable as a library** LFortran is structured around two independent modules, AST and ASR, both of which are standalone (completely independent of the rest of LFortran) and users are encouraged to use them independently for other applications and build tools on top. See the [Design](design.md) and [Developer Tutorial](developer_tutorial.md) documents for more details. * **Interoperation with GFortran** LFortran can parse GFortran module files into an ASR and generate a Fortran wrapper that can be compiled with any Fortran compiler and linked with the original GFortran compiled module. * **Create executables** It can create executables just like other Fortran compilers. * **Runs on Linux, Mac and Windows** All three platforms are regularly tested by our CI. ### Planned These features are under development, there is a link to the corresponding issue so that you can track the progress by following it. * **Native interoperation with other languages (and other Fortran compilers)** It can automatically call code written in other languages (such as C or Python) just by using the `use` statement, see [#44](https://gitlab.com/lfortran/lfortran/issues/44). It understands other Fortran compilers module files (one can just "use" them) and their ABI to link correctly (GFortran is supported, other compilers are planned, see [#56](https://gitlab.com/lfortran/lfortran/issues/56)), which allows to use LFortran with production codes today. * **Modern hardware support** Thanks to LLVM, the goal of LFortran is to run on modern hardware and take advantage of native Fortran language constructs (such as `do concurrent`) to run on multi-core CPUs and GPUs, see [#57](https://gitlab.com/lfortran/lfortran/issues/57). * **Full Fortran 2018 support** Currently only a subset of Fortran is implemented, but the goal is to have a full implementation of the latest Fortran 2018 standard, see [#58](https://gitlab.com/lfortran/lfortran/issues/58). Please vote on issues in our [issue tracker](https://gitlab.com/lfortran/lfortran/issues) that you want us to prioritize (feel free to create new ones if we are missing anything). ## Roadmap Here is our roadmap how to get all the planned features above implemented: 1. Port code generation to use ASR and pass all the current tests ([#74](https://gitlab.com/lfortran/lfortran/issues/74)). Remove the old code generation and old semantics, that used to annotate the AST tree, which was messy. 2. Get GFortran module files working with `use` module, both assumed-size and assumed-shape arrays ([#52](https://gitlab.com/lfortran/lfortran/issues/52)). This will allow right away to use production codes with LFortran. 3. Do these at the same time: a) Implement more Fortran features, until eventually full Fortran 2018 is supported ([#58](https://gitlab.com/lfortran/lfortran/issues/58)). b) Gradually move to C++ for robustness and speed ([#70](https://gitlab.com/lfortran/lfortran/issues/70)). The Python API will not change (or only minimally), so the user experience from Python will not change. c) Implement all the other cool features: `use` module for C and Python and automatic wrappers ([#44](https://gitlab.com/lfortran/lfortran/issues/44)), modern hardware support ([#57](https://gitlab.com/lfortran/lfortran/issues/57)), generating an older standard of Fortran ([#72](https://gitlab.com/lfortran/lfortran/issues/72)), Fortran doctest feature ([#73](https://gitlab.com/lfortran/lfortran/issues/73)), SymPy integration ([#71](https://gitlab.com/lfortran/lfortran/issues/71)), language service for IDEs ([#12](https://gitlab.com/lfortran/lfortran/issues/12)), and other ideas ([#29](https://gitlab.com/lfortran/lfortran/issues/29)). The step 1. is an internal refactoring that will not take long. The step 2. will allow LFortran to be used interactively with production codes right away (the production code will get compiled with GFortran, then one "uses" any module in LFortran and functions/subroutines can be interactively called, the module itself can use any GFortran supported feature, but the API must fit into the subset that LFortran understands --- for large number of applications simple functions/subroutines with array arguments are enough). This will make LFortran usable for first users and one can always use GFortran temporarily until LFortran supports the given feature. We expect to be finished with the step 2. by the end of summer 2019, hopefully sooner. Finally the step 3. will improve LFortran overall, allowing the first users to contribute back, growing the community and making LFortran gradually useful for more and more people. ```{toctree} :caption: Getting started :hidden: installation language usage ``` ```{toctree} :caption: LFortran Development Status :hidden: progress ``` ```{toctree} :caption: Developer's Guide :hidden: design developer_tutorial ast_and_asr contributing ``` ```{toctree} :caption: LFortran Intrinsics :hidden: intrinsics/array intrinsics/bit intrinsics/character intrinsics/kind-type intrinsics/mathematical intrinsics/numeric intrinsics/misc ``` ```{toctree} :caption: LFortran ASR Nodes :hidden: asr/asr_nodes/cast_kind_nodes/cast_kind.md asr/asr_nodes/expression_nodes/expression_nodes.md asr/asr_nodes/kinds_nodes/kinds.md asr/asr_nodes/statement_nodes/statement_nodes.md asr/asr_nodes/symbol_nodes/symbol_nodes.md asr/asr_nodes/type_nodes/ttype.md asr/asr_nodes/omp_nodes/omp_nodes.md ``` lfortran-0.63.0/doc/src/asr/0000775000175000017500000000000015174404631015741 5ustar alastairalastairlfortran-0.63.0/doc/src/asr/programming_generics.md0000664000175000017500000002350315174404631022467 0ustar alastairalastair# Programming with Generics in LFortran In this page we will explore how to write generics in LFortran. ## Prerequisite Variables inside of a generic function are typed with a *deferred types*. For example, we may want to define a function that calculate the sum of a generic array which can take any number type. Using a deferred type `T`, we may want to declare the following generic function: ```fortran function array_sum(arr) result(r) type(T), intent(in) :: arr(:) type(T) :: r r = set_to_zero() do i = 1, n ! uses a function instead of + because T ! can be any type, even a derived type r = add_element(arr(i), r) end do end function ``` As we can see here, we need to define the functions associated with the deferred type `T`. To do so in LFortran, we use *requirements* to define both deferred types and their associated functions. ```fortran requirement number_type(T, add_element, set_to_zero) type, deferred :: T function add_element(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function function set_to_zero() result(z) type(T) :: z end function end requirement ``` ## Defining and Using a Generic Function Having defined the necessary requirement to use the deferred type `T`, we can proceed to define our generic array sum. LFortran provides two different ways to write and instantiate generic functions: 1. With a template 2. Without a template (simpler syntax) ### With Template **Defining a generic function** A template works as a closure for a generic function. A template takes as parameters symbols that would replace the generic symbols inside a generic function. ```fortran template array_t(T, add_element, set_to_zero) ... public :: array_sum contains function array_sum(arr) result(r) type(T), intent(in) :: arr(:) type(T) :: r integer :: n, i n = size(arr) r = set_to_zero(0) if (n > 0) then r = arr(1) do i = 2, n res = add_element(r, arr(i)) end do end if end function end template ``` Then to connect the parameters with the functions defined in the requirement, we use a `require` statement. ```fortran template array_t(T, add_element, set_to_zero) require :: number_type(T, add_element, set_to_zero) public :: array_sum contains function array_sum(arr) result(r) type(T), intent(in) :: arr(:) type(T) :: r integer :: n, i n = size(arr) r = set_to_zero(0) if (n > 0) then r = arr(1) do i = 2, n res = add_element(r, arr(i)) end do end if end function end template ``` `require :: number_type(T, add_element, set_to_zero)` sets the type signature for the parameters within the scope of the template. This makes it possible for the LFortran compiler to type check the computations associated with the deferred type `T`. A template can also contains multiple functions that may depend on each other. ```fortran template array_t(T, add_element, set_to_zero) require :: number_type(T, add_element, set_to_zero) public :: array_sum contains function array_sum(arr) result(r) type(T), intent(in) :: arr(:) type(T) :: r integer :: n, i n = size(arr) r = set_to_zero(0) if (n > 0) then r = arr(1) do i = 2, n res = add_element(r, arr(i)) end do end if end function function array_avg(arr) result(r) type(T), intent(in) :: arr(:) type(T) :: s s = array_sum(arr) ... end function end template ``` **Using a generic function** To use a generic function we first need to instantiate (replace) the generic symbols inside a template with symbols with concrete types. The instantiation is done through the `instantiate` statement. For example, if we want to instantiate 'array_sum' with integer types, the instantiation would be as follows: ```fortran instantiate array_t(integer, add_element_integer, set_to_zero_integer), & only: array_sum_integer => array_sum ``` First we pass the concrete symbols to the template in the form of a template call `array_t(integer, add_element_integer, set_to_zero_integer)`. We are replacing the deferred type `T` with a concrete type `integer`, `add_element` with a function that computes addition between two integers `add_element_integer`, and `set_to_zero` with a function that returns a zero integer value `set_to_zero_integer`. These functions would have to be defined prior to the instantiation for them to be passed as symbol arguments to a template: ```fortran function add_element_integer(x, y) result(z) integer, intent(in) :: x, y integer :: z z = x + y end function function set_to_zero_integer() result(z) integer :: z z = 0 end function ``` After `only: ` we decide which function inside in the template we want to instantiate, in this case `array_sum`, and give the new instantiated function a new name `array_sum_integer`. After instantiation, we can then use the instantiated function similar to ordinary functions: ```fortran integer :: arr(10), sum sum = array_sum_integer(arr) ``` The main benefit of generics is reuse. We can have different instantiations for different types using the same template. For example we can instantiate both integer and real `array_sum`: ```fortran ! instantiation with integer type instantiate array_t(integer, add_element_integer, set_to_zero_integer), & only: array_sum_integer => array_sum ! instantiation with real type instantiate array_t(real, add_element_real, set_to_zero_real), & only: array_sum_real => array_sum ``` Also, because a template may contain multiple generic functions, a single instantiation can be used to instantiate multiple functions: ```fortran instantiate array_t(integer, add_element_integer, set_to_zero_integer), & only: array_sum_integer => array_sum, array_avg_integer => array_avg instantiate array_t(real, add_element_real, set_to_zero_real), & only: array_sum_real => array_sum, array_avg_real => array_avg ``` ### Without Template The template notation can be cumbersome for defining a single generic function. To alleviate this, LFortran also supports a simpler syntax for declaring generic functions without having to declare an enclosing template. For example, our running `array_sum` example can be written as follows in the simpler syntax: ```fortran function generic_sum {T, add_element, set_to_zero} (arr) result(r) require :: number_type(T, add_element, set_to_zero) type(T), intent(in) :: arr(:) type(T) :: r integer :: n, i n = size(arr) r = set_to_zero(0) if (n > 0) then r = arr(1) do i = 2, n res = add_element(r, arr(i)) end do end if end function ``` The first difference is that the template parameters are now included as the function's generic symbol parameters enclosed by braces `{T, add_element, set_to_zero}`. Since we still need to identify these generic symbols a requirement, the require statement is moved into the generic function itself. The rest of the function is the same as the generic function inside the template. This is merely a syntax sugar for the original templated function. Inside the compiler this generic function is treated as the following template: ```fortran template generic_sum(T, add_element, set_to_zero) require :: number_type(T, add_element, set_to_zero) public :: generic_sum contains function generic_sum(arr) result(r) type(T), intent(in) :: arr(:) type(T) :: r integer :: n, i n = size(arr) r = set_to_zero(0) if (n > 0) then r = arr(1) do i = 2, n res = add_element(r, arr(i)) end do end if end function end template ``` The instantiation is also made simpler by having the instantiation and function call together: ```fortran integer :: arr(10), sum sum = array_sum{integer, add_element_integer, set_to_zero_integer}(arr) ``` ### Further Simplifying Instantiations **Passing operator instead of functions** So far to replace the generic addition `add_element` we have used a concrete function `add_element_integer`. To simplify this, it is possible to just pass `operator(+)` without having to define a function separately: ```fortran instantiate array_t(integer, operator(+), set_to_zero_integer), & only: array_sum_integer => array_sum ``` **Skipping function instantiation names** Generic functions can also be instantiated without having to rename each function one-by-one. Suppose we want to instantiate every generic functions inside the template `array_t`, we can shorten the instantiation into: ```fortran instantiate array_t(integer, operator(+), set_to_zero_integer) ``` Doing so would generate the function `array_sum` and `array_avg` without any renaming. ## Generic Derived Types LFortran also supports generic derived types. Let's say we want a generic tuple. We can define a derived type for tuples as usual inside a template: ```fortran template derived_type_t(T) ! for brevity we have the deferred type ! declared directly inside the template type, deferred :: T public :: tuple type :: tuple type(T) :: fst type(T) :: snd end type end template ``` We can also define generic functions accessing this generic tuple as: ```fortran template derived_type_t(T) type, deferred :: T public :: tuple type :: tuple type(T) :: fst type(T) :: snd end type contains function get_fst(p) result(r) type(tuple), intent(in) :: p type(t) :: r r = p%fst end function function get_snd(p) result(r) type(tuple), intent(in) :: p type(t) :: r r = p%snd end function end template ``` The instantiation for derived types are also similar to generic functions. If we want an integer tuple type and its functions, then we can instantiate `derived_type_t` as: ```fortran instantiate derived_type_t(integer), only: & tuple_int => tuple, get_fst_int => get_fst, get_snd_int => get_snd ``` ## See Also * [Generics](generics.md), for details about the generics implementation and its related ASR.lfortran-0.63.0/doc/src/asr/asr.md0000664000175000017500000002440715174404631017057 0ustar alastairalastair# Abstract Semantic Representation (ASR) The aim of ASR is to represent all semantics in a non-redundant way, and that has all the semantic information available locally, so that the backend can do a single pass over ASR and have all the information at hand to generate code. ASR is always semantically valid Fortran code. It is as far from the original Fortran language code as possible (i.e. everything is explicitly figured out, all semantic information gathered and readily available locally from each ASR node), while ensuring no semantic information was lost (no lowering was done), so one can still generate Fortran code from ASR that will be logically equivalent to the original code. ASR can be used to do Fortran-level transformations (such as optimizations). ## Abstract Syntax Description Language (ASDL) Abstract Syntax Description Language describes the abstract syntax of the compiler IRs and other tree-like data structures. IRs described with ASDL are converted into an implementation automatically by tools. Tools generate the data structure definitions for a target language, pickling functions, and other codes. ASDL consists of three fundamental constructs: ***types, constructors***, and ***productions***. Let's take an example of a node from [ASR.asdl](https://github.com/lfortran/lfortran/blob/main/src/libasr/ASR.asdl): ```asdl symbol = Program(symbol_table symtab, identifier name, identifier* dependencies, stmt* body) | Module(symbol_table symtab, identifier name, identifier* dependencies, bool loaded_from_mod, bool intrinsic) | Function(symbol_table symtab, identifier name, ttype function_signature, identifier* dependencies, expr* args, stmt* body, expr? return_var, access access, bool deterministic, bool side_effect_free, string? module_file) ``` #### Types The **types** are required to begin with a lowercase. ASDL's builtin types are: - identifier - int (signed integers of infinite precision) - string We extend these by: - bool (.true. / .false.) - float (floating point number of infinite precision) - symbol_table (scoped Symbol Table implementation) - node (any ASR node) > ***Note***: symbol_table contains `identifier` -> `symbol` mappings In the above example, `symbol_table`, `identifier`, `stmt`, `bool`, etc are types. #### Constructors The **constructors** names must begin with an upper case. In above example has three constructors, `Program`, `Module`, and `Function`, where the Program constructor has four fields whose values are of type `symbol_table`, `identifier`, `identifier*`, and `stmt*`. These are, basically, subtrees. ## Symbol type Each symbol has either `symtab` (local symbol table) or `parent_symtab` (where this symbol is stored). One can get to parent_symtab via symtab, so only one is present. Each symbol has a `name` for easy lookup of the name of the symbol when only having a pointer to it. `abi=Source` means the symbol's implementation is included (full ASR), otherwise, it is external (interface ASR, such as procedure interface). `SubroutineCall`/`FunctionCall` stores the actual final resolved subroutine or function (`name` member). They also store the original symbol (`original_name`), which can be one of: `null`, `GenericProcedure` or `ExternalSymbol`. ### Call argument intent contract For call nodes (`SubroutineCall` / `FunctionCall`), actual argument expressions must satisfy the dummy argument intent: - `intent(in)`: any expression is allowed. - `intent(out)` / `intent(inout)`: actual argument must be writable (a variable expression, or a cast wrapper such as `Cast`, `ArrayPhysicalCast`, `StringPhysicalCast` around writable storage). - `intent(unspecified)`: any expression is allowed at the call site. Whether the callee writes through the argument is runtime-dependent. When a module is compiled, it is parsed into full ASR, an object file is produced, and the full ASR (abi=Source, "body" is non-empty) is transformed into interface ASR (abi=LFortran, "body" is empty). Both interface and full ASR are saved into the mod file. When a module is used, it is first looked up in the symbol table (as either full or interface ASR) and used if it is present. Otherwise, a mod file is found on the disk, loaded (as either full or interface ASR for LFortran's mod file, depending on LFortran's compiler options; or for GFortran's mod file, the corresponding interface ASR is constructed with abi=GFortran) and used. After the ASR is loaded, the symbols that are used are represented as ExternalSymbols in the current scope of the symbol table. ExternalSymbol represents symbols that cannot be looked up in the current scoped symbol table. As an example, if a variable is defined in a module, but used in a nested subroutine, that is not an external symbol because it can be resolved in the current symbol table (nested subroutine) by following the parents. However, if a symbol is used from a different module, then it is an external symbol because the usual symbol resolution by going to the parents will not find the definition. The `module_name` member is the name of the module the symbol is in, and the `scope_names` is a list of names if the symbol is in a nested symbol table. For example, if it is a local variable in a function `f` that is nested in function `g`, then `scope_names=[g, f]`. REPL: each cell is parsed into full ASR, compiled + executed, and the full ASR is transformed into interface ASR (abi=LFortran) and kept in the symbol table. A new cell starts with an empty symbol table, whose parent symbol table is the previous cell. That allows function/declaration shadowing. ## ABI Type ```asdl abi -- External ABI = Source -- No Unspecified | LFortranModule -- Yes LFortran | GFortranModule -- Yes GFortran | BindC -- Yes C | BindPython -- Yes Python | BindJS -- Yes Javascript | Interactive -- Yes Unspecified | Intrinsic -- Yes Unspecified ``` - **External Yes**: the symbol's implementation is not part of ASR; the symbol is just an interface (e.g., subroutine/function interface, or variable marked as external, not allocated by this ASR). - **External No**: the symbol's implementation is part of ASR (e.g., subroutine/function body is included, variables must be allocated). - **abi=Source**: The symbol's implementation is included in ASR, and the backend is free to use any ABI it wants (it might also decide to inline or eliminate the code in optimizations). - **abi=LFortranModule/GFortranModule/BindC**: the symbol's implementation is stored as machine code in some object file that must be linked in. It uses the specified ABI (one of the LFortran modules, GFortran module, or C ABI). An interface that uses `iso_c_binding` and `bind(c)` is represented using abi=BindC. - **abi=BindPython**: the symbol's implementation is stored in text format in the user source code file. The symbol is executed using the CPython interpreter. LPython manages the conversion of arguments to be passed to such symbols and also converts the return values from such symbols. - **abi=BindJS**: the symbol's implementation is available with Javascript. This abi type is to be mainly used with the WASM Backend. - **abi=Interactive**: the symbol's implementation has been provided by the previous REPL execution (e.g., if LLVM backend is used for the interactive mode, the previous execution generated machine code for this symbol's implementation that was loaded into memory). Note: this option might be converted/eliminated to just use LFortran ABI in the future. - **abi=Intrinsic**: the symbol's implementation is implicitly provided by the language itself as an intrinsic function. That means the backend is free to implement it in any way it wants. The function does not have a body, it is just an interface. ## Short notes on ASR nodes ### Stmt nodes 1. **ExplicitDeallocate**: It deallocates if allocated otherwise throws a runtime error. 2. **ImplicitDeallocate**: It deallocates if allocated otherwise does nothing. 3. **GoTo**: It points to a GoToTarget with the corresponding target_id within the same procedure. We currently use `int` IDs to link GoTo with GoToTarget to avoid issues with serialization. 4. **GoToTarget**: An empty statement, a target of zero or more GoTo statements the `id` is only unique within a procedure. ### Expr nodes 1. **Cast**: It changes the value (the bits) of the `arg`. 2. **ArrayPhysicalCast**: This ArrayPhysicalCast we only change the physical type, the logical type does not change > Note: the "new" physical type here will also be part of the "type" member This allows to represent any combination, but we'll only support a few; at least we need: Maybe it's easier to add an enumeration here: - Descriptor -> Pointer - Pointer -> Descriptor - CompileTimeFixedSizeArray -> Pointer - CompileTimeFixedSizeArray -> Descriptor - Descriptor -> NumPy - NumPy -> Descriptor - ISODescriptor -> Descriptor - Descriptor -> ISODescriptor ### Ttype nodes ```asdl ttype = Integer(int kind) | UnsignedInteger(int kind) | Real(int kind) | ... ``` **`len`** in Character: - $>=0$ ... the length of the string, known at compile time - $-1$ ... character( * ), i.e., inferred at runtime - $-2$ ... character(:), allocatable (possibly we might use -1 for that also) - $-3$ ... character(n+3), i.e., a runtime expression stored in `len_expr` **`kind`**: The `kind` member selects the kind of a given type. We currently support the following: - Integer kinds: 1 (i8), 2 (i16), 4 (i32), 8 (i64) - Real kinds: 4 (f32), 8 (f64) - Complex kinds: 4 (c32), 8 (c64) - Character kinds: 1 (utf8 string) - Logical kinds: 1, 2, 4: (boolean represented by 1, 2, 4 bytes; the default kind is 4, just like the default integer kind, consistent with Python and Fortran: in Python, "Booleans in Python are implemented as a subclass of integers"; in Fortran the "default logical kind has the same storage size as the default integer"; we currently use kind=4 as default integer, so we also use kind=4 for the default logical.) ### String format kind ```asdl string_format_kind = FormatFortran -- "(f8.3,i4.2)", a, b | FormatC -- "%f: %d", a, b | FormatPythonPercent -- "%f: %d" % (a, b) | FormatPythonFString -- f"{a}: {b}" | FormatPythonFormat -- "{}: {}".format(a, b) ``` lfortran-0.63.0/doc/src/asr/asr_nodes/0000775000175000017500000000000015174404631017716 5ustar alastairalastairlfortran-0.63.0/doc/src/asr/asr_nodes/symbol_nodes/0000775000175000017500000000000015174404631022413 5ustar alastairalastairlfortran-0.63.0/doc/src/asr/asr_nodes/symbol_nodes/StructMethodDeclaration.md0000664000175000017500000001017715174404631027536 0ustar alastairalastair# StructMethodDeclaration StructMethodDeclaration is a **symbol** node representing a type-bound procedure declaration inside a derived type's `contains` section. ## Declaration ### Syntax ``` StructMethodDeclaration(symbol_table parent_symtab, identifier name, identifier? self_argument, identifier proc_name, symbol proc, abi abi, bool is_deferred, bool is_nopass) ``` ### Arguments `parent_symtab` the symbol table of the parent struct (derived type) `name` the binding name (the name used after `%` in a method call) `self_argument` identifies which dummy argument of the bound procedure receives the passed object: - `nullptr` — the passed object goes to the first dummy argument (default when `pass` is used without a name, or when neither `pass` nor `nopass` is specified) - a name (e.g. `"pt"`) — the passed object goes to the dummy argument with that name, which may be at any position in the argument list (from `pass(pt)`) `proc_name` the name of the actual procedure being bound `proc` the symbol of the bound procedure (a `Function`) `abi` abi such as: `Source`, `Interface`, `BindC` `is_deferred` if true, this is a `deferred` binding (the procedure has no implementation in this type and must be overridden in extending types) `is_nopass` if true, no object is passed implicitly when the procedure is called through this binding. When false, the object is passed as the argument identified by `self_argument` ### Return values None. ## Description A `StructMethodDeclaration` represents a type-bound procedure — a procedure declared in a derived type's `contains` section. It binds a name (the binding name) to an actual procedure, with optional pass/nopass semantics controlling how the invoking object is passed. ### Pass/NoPass Semantics In Fortran, type-bound procedures can control whether and how the invoking object is passed as an argument: ```fortran type :: point real :: x, y contains ! Default: pass on first argument (self_argument = null, is_nopass = false) procedure :: move => point_move ! Explicit pass on first argument (same as default) procedure, pass :: translate => point_translate ! Pass on a named argument (self_argument = "pt", is_nopass = false) procedure, pass(pt) :: scale => point_scale ! No pass: no implicit object argument (is_nopass = true) procedure, nopass :: create => point_create end type ``` When `is_nopass` is false, calling `obj%method(args)` implicitly inserts `obj` as an argument at the position determined by `self_argument`: - If `self_argument` is null: `obj` becomes the first argument - If `self_argument` is `"pt"`: `obj` is inserted at the position of the dummy argument named `"pt"` in the procedure's argument list When `is_nopass` is true, calling `obj%method(args)` passes `args` directly without inserting the object. ### Relationship to Variable Procedure pointer *components* (declared in the data section of a derived type, not in `contains`) are represented as [Variable](Variable.md) nodes with `pass_attr` and `self_argument` fields that serve the same purpose as `is_nopass` and `self_argument` in `StructMethodDeclaration`. ```fortran type :: calculator contains ! This is a StructMethodDeclaration procedure :: compute => compute_impl ! This is a Variable with type FunctionType (procedure pointer component) procedure(iface), nopass, pointer :: helper => null() end type ``` ## Examples ```fortran module shapes type :: circle real :: radius contains procedure :: area => circle_area end type contains function circle_area(self) result(a) class(circle), intent(in) :: self real :: a a = 3.14159 * self%radius**2 end function end module ``` In the ASR for type `circle`, the symbol table contains a `StructMethodDeclaration`: ``` area: (StructMethodDeclaration area -- binding name () -- self_argument (null = first arg) circle_area -- proc_name circle_area -- proc (symbol) Source -- abi .false. -- is_deferred .false. -- is_nopass ) ``` ## See Also [Variable](Variable.md) lfortran-0.63.0/doc/src/asr/asr_nodes/symbol_nodes/symbol.md0000664000175000017500000011502115174404631024242 0ustar alastairalastair# symbol A textual denotation having special meaning to the compiler. The value can be determined from the text of the basic *symbol*. ## Declaration ### Syntax ```fortran symbol = Program(symbol_table symtab, identifier name, identifier* dependencies, stmt* body) | Module(symbol_table symtab, identifier name, identifier* dependencies, bool loaded_from_mod, bool intrinsic) | Function(symbol_table symtab, identifier name, expr* args, stmt* body, expr? return_var, abi abi, access access, deftype deftype, string? bindc_name, bool elemental, bool pure, bool module, bool inline, bool static, ttype* type_params, symbol* restrictions, bool is_restriction) | GenericProcedure(symbol_table parent_symtab, identifier name, symbol* procs, access access) | CustomOperator(symbol_table parent_symtab, identifier name, symbol* procs, access access) | ExternalSymbol(symbol_table parent_symtab, identifier name, symbol external, identifier module_name, identifier* scope_names, identifier original_name, access access) | StructType(symbol_table symtab, identifier name, identifier* members, abi abi, access access, symbol? parent) | EnumType(symbol_table symtab, identifier name, identifier* members, abi abi, access access, enumtype enum_value_type, ttype type, symbol? parent) | Union(symbol_table symtab, identifier name, identifier* members, abi abi, access access, symbol? parent) | Variable(symbol_table parent_symtab, identifier name, intent intent, expr? symbolic_value, expr? value, storage_type storage, ttype type, abi abi, access access, presence presence, bool value_attr) | ClassType(symbol_table symtab, identifier name, abi abi, access access) | StructMethodDeclaration(symbol_table parent_symtab, identifier name, identifier? self_argument, identifier proc_name, symbol proc, abi abi) | AssociateBlock(symbol_table symtab, identifier name, stmt* body) | Block(symbol_table symtab, identifier name, stmt* body) | Requirement(symbol_table symtab, identifier name, identifier* args, require_instantiation* requires) | Template(symbol_table symtab, identifier name, identifier* args, require_instantiation* requires) ``` ### Arguments | Argument Name | Denotes | |----------------------------|----------------------------| | `symtab` |local symbol table | | `name` |symbol name for easy lookup | | `dependencies` |dependencies of symbol | | `body` |statement body | | `loaded_from_mod` |boolean value if loaded from mode | | `intrinsic` |boolean value if intrinsic | | `args` |arguments of expression | | `abi` |source | | `original_name` |original symbol | | `parent_symtab` |where symbol is stored | | `scope_names` |list of names if the symbol is in a nested symbol table | | `storage_type` | Default/Save/Parameter/Allocatable | | `access` | Public/Private | | `intent` |Local/In/Out/InOut/ReturnVar/Unspecified| | `deftype` |Implementation/Interface| | `presence` |Required/Optional| | `self_argument` |the argument which contains the object calling the class procedure | | `requires` |assigning types to requirement or template arguments | ### Return values None. ## Description Each symbol has either `symtab` (local symbol table) or `parent_symtab` (where this symbol is stored). One can get to parent_symtab via symtab, so only one is present. Each symbol has a `name` for easy lookup of the name of the symbol when only having a pointer to it. abi=Source means the symbol's implementation is included (full ASR), otherwise it is external (interface ASR, such as procedure interface). SubroutineCall/FunctionCall store the actual final resolved subroutine or function (`name` member). They also store the original symbol (`original_name`), which can be one of: null, GenericProcedure or ExternalSymbol. When a module is compiled, it is parsed into full ASR, an object file is produced, the full ASR (abi=Source, "body" is non-empty) is transformed into interface ASR (abi=LFortran, "body" is empty). Both interface and full ASR is saved into the mod file. When a module is used, it is first looked up in the symbol table (as either full or interface ASR) and used if it is present. Otherwise a mod file is found on the disk, loaded (as either full or interface ASR for LFortran's mod file, depending on LFortran's compiler options; or for GFortran's mod file the corresponding interface ASR is constructed with abi=GFortran) and used. After the ASR is loaded, the symbols that are used are represented as ExternalSymbols in the current scope of the symbol table. ExternalSymbol represents symbols that cannot be looked up in the current scoped symbol table. As an example, if a variable is defined in a module, but used in a nested subroutine, that is not an external symbol because it can be resolved in the current symbol table (nested subroutine) by following the parents. However if a symbol is used from a different module, then it is an external symbol, because usual symbol resolution by going to the parents will not find the definition. The `module_name` member is the name of the module the symbol is in, the `scope_names` is a list of names if the symbol is in a nested symbol table. For example if it is a local variable in a function `f` that is nested in function `g`, then `scope_names=[g, f]`. REPL: each cell is parsed into full ASR, compiled + executed, the full ASR is transformed into interface ASR (abi=LFortran) and kept in the symbol table. A new cell starts with an empty symbol table, whose parent symbol table is the previous cell. That allows function / declaration shadowing. Symbols in LFortran are: 1. Program 2. Module 3. Function 4. GenericProcedure 5. CustomOperator 6. ExternalSymbol 7. DerivedType 8. Variable 9. ClassType 10. StructMethodDeclaration 11. AssociateBlock 12. Block 13. Requirement 14. Template ## Types Special meaning textual denotations. ## Examples Example of function: ```fortran integer function a() end ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { a: (Variable 2 a ReturnVar () () Default (Integer 4 []) Source Public Required .false. ) }) a [] [] (Var 2 a) Source Public Implementation () .false. .false. .false. .false. .false. [] [] .false. ) }) [] ) ``` Example of GenericProcedure: ```fortran module stdlib_quadrature_simps interface simps38_weights module procedure simps38_weights_dp end interface simps38_weights contains function simps38_weights_dp(x) result(w) real(8), intent(in) :: x(4) real(8) :: w(size(x)) end function simps38_weights_dp subroutine simps38_weights_dp_use(x1) real(8), intent(in) :: x1(4) print *, simps38_weights(x1) end subroutine simps38_weights_dp_use end module program stdlib_quadrature use stdlib_quadrature_simps, only: simps38_weights_dp implicit none real(8) :: x1(4) print *, simps38_weights_dp(x1) end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { stdlib_quadrature: (Program (SymbolTable 5 { simps38_weights_dp: (ExternalSymbol 5 simps38_weights_dp 2 simps38_weights_dp stdlib_quadrature_simps [] simps38_weights_dp Public ), x1: (Variable 5 x1 Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false. ) }) stdlib_quadrature [stdlib_quadrature_simps] [(Print () [(FunctionCall 5 simps38_weights_dp () [((Var 5 x1))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) () () )] () () )] ), stdlib_quadrature_simps: (Module (SymbolTable 2 { simps38_weights: (GenericProcedure 2 simps38_weights [2 simps38_weights_dp] Public ), simps38_weights_dp: (Function (SymbolTable 3 { w: (Variable 3 w ReturnVar () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false. ), x: (Variable 3 x In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false. ) }) simps38_weights_dp [(Var 3 x)] [] (Var 3 w) Source Public Implementation () .false. .false. .false. .false. .false. [] [] .false. ), simps38_weights_dp_use: (Function (SymbolTable 4 { x1: (Variable 4 x1 In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false. ) }) simps38_weights_dp_use [(Var 4 x1)] [(Print () [(FunctionCall 2 simps38_weights_dp 2 simps38_weights [((Var 4 x1))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) () () )] () () )] () Source Public Implementation () .false. .false. .false. .false. .false. [] [] .false. ) }) stdlib_quadrature_simps [] .false. .false. ) }) [] ) ``` Example of Module and CustomOperator: ```fortran module stdlib_string_type type :: string_type sequence private character(len=:), allocatable :: raw end type string_type interface write(formatted) module procedure :: write_formatted end interface interface read(formatted) module procedure :: read_formatted end interface contains subroutine write_formatted(string, unit, iotype, v_list, iostat, iomsg) type(string_type), intent(in) :: string integer, intent(in) :: unit character(len=*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg end subroutine write_formatted subroutine read_formatted(string, unit, iotype, v_list, iostat, iomsg) type(string_type), intent(inout) :: string integer, intent(in) :: unit character(len=*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg character(len=:), allocatable :: line end subroutine read_formatted end module program string_14 end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { stdlib_string_type: (Module (SymbolTable 2 { formatted: (CustomOperator 2 formatted [2 read_formatted] Public ), read_formatted: (Function (SymbolTable 5 { iomsg: (Variable 5 iomsg InOut () () Default (Character 1 -1 () []) Source Private Required .false. ), iostat: (Variable 5 iostat Out () () Default (Integer 4 []) Source Private Required .false. ), iotype: (Variable 5 iotype In () () Default (Character 1 -1 () []) Source Private Required .false. ), line: (Variable 5 line Local () () Allocatable (Character 1 -2 () []) Source Private Required .false. ), string: (Variable 5 string InOut () () Default (Struct 2 string_type [] ) Source Private Required .false. ), unit: (Variable 5 unit In () () Default (Integer 4 []) Source Private Required .false. ), v_list: (Variable 5 v_list In () () Default (Integer 4 [(() ())]) Source Private Required .false. ) }) read_formatted [(Var 5 string) (Var 5 unit) (Var 5 iotype) (Var 5 v_list) (Var 5 iostat) (Var 5 iomsg)] [(ImplicitDeallocate [5 line] )] () Source Private Implementation () .false. .false. .false. .false. .false. [] [] .false. ), string_type: (StructType (SymbolTable 3 { raw: (Variable 3 raw Local () () Allocatable (Character 1 -2 () []) Source Private Required .false. ) }) string_type [raw] Source Private () ), write_formatted: (Function (SymbolTable 4 { iomsg: (Variable 4 iomsg InOut () () Default (Character 1 -1 () []) Source Private Required .false. ), iostat: (Variable 4 iostat Out () () Default (Integer 4 []) Source Private Required .false. ), iotype: (Variable 4 iotype In () () Default (Character 1 -1 () []) Source Private Required .false. ), string: (Variable 4 string In () () Default (Struct 2 string_type [] ) Source Private Required .false. ), unit: (Variable 4 unit In () () Default (Integer 4 []) Source Private Required .false. ), v_list: (Variable 4 v_list In () () Default (Integer 4 [(() ())]) Source Private Required .false. ) }) write_formatted [(Var 4 string) (Var 4 unit) (Var 4 iotype) (Var 4 v_list) (Var 4 iostat) (Var 4 iomsg)] [] () Source Private Implementation () .false. .false. .false. .false. .false. [] [] .false. ) }) stdlib_string_type [] .false. .false. ), string_14: (Program (SymbolTable 6 { }) string_14 [] [] ) }) [] ) ``` Example of StructMethodDeclaration: ```fortran module bitset type, abstract :: bitset_type private integer(8) :: num_bits contains procedure(all_abstract), deferred, pass(self) :: all end type bitset_type abstract interface elemental function all_abstract( self ) result(all) import :: bitset_type logical :: all class(bitset_type), intent(in) :: self end function all_abstract end interface end module program debug implicit none end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { bitset: (Module (SymbolTable 2 { all_abstract: (Function (SymbolTable 4 { all: (Variable 4 all ReturnVar () () Default (Logical 4 []) Source Private Required .false. ), self: (Variable 4 self In () () Default (Class 2 bitset_type [] ) Source Private Required .false. ) }) all_abstract [(Var 4 self)] [] (Var 4 all) Source Private Interface () .true. .false. .false. .false. .false. [] [] .false. ), bitset_type: (StructType (SymbolTable 3 { all: (StructMethodDeclaration 3 all all_abstract 2 all_abstract Source ), num_bits: (Variable 3 num_bits Local () () Default (Integer 8 []) Source Private Required .false. ) }) bitset_type [num_bits] Source Private () ) }) bitset [] .false. .false. ), debug: (Program (SymbolTable 5 { }) debug [] [] ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/symbol_nodes/ExternalSymbol.md0000664000175000017500000001066215174404631025712 0ustar alastairalastair# ExternalSymbol The **ExternalSymbol** is a `symbol` node that represents a symbol declared in another module. ## Declaration ### Syntax ```fortran ExternalSymbol(symbol_table parent_symtab, identifier name, symbol external, identifier module_name, identifier* scope_names, identifier original_name, access access) ``` ### Arguments | Argument Name | Denotes | |----------------------------|----------------------------| | `parent_symtab` | the parent symbol table that contains the external symbol | | `name` | the name of the external symbol in the current symbol table | | `external` | pointer to the actual symbol definition | | `module_name` | the name of the module the symbol is in | | `scope_names` | a list of names if the symbol is in a nested symbol table. For example if it is a local variable in a function `f` that is nested in function `g`, then `scope_names=[g, f]` | | `original_name` | the name of the symbol in the external symbol table | | `access` | access type `Public/Private` | ### Return values None. ## Description ExternalSymbol represents symbols that cannot be looked up in the current scoped symbol table. As an example, if a variable is defined in a module, but used in a nested subroutine, that is not an external symbol because it can be resolved in the current symbol table (nested subroutine) by following the parents. However if a symbol is used from a different module, then it is an external symbol, because usual symbol resolution by going to the parents will not find the definition. The `ExternalSymbol` is the only way to reference a symbol that cannot be accessed in the scoped symbol table by visiting the parents. There is a special handling for it in the serialization and deserialization: the `external` member is not serialized (since it is a pointer) and in deserialization the pointer is reconstructed from the `original_name` and `scope_names`. The `scope_names` contains the names of the external symbol table starting from the top how to get to the symbol. This approach allows to reference any nested symbol (such as a local variable in a function in a module). However, we might later change the design to only allow referencing top level module entities. One can think of the `ExternalSymbol` as the "import" statement in Python, or the "use" statement in Fortran. ## Types ## Examples ```fortran module module_num integer :: my_num = 5 end module program main use module_num print *, my_num end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 3 { my_num: (ExternalSymbol 3 my_num 2 my_num module_num [] my_num Public ) }) main [module_num] [(Print () [(Var 3 my_num)] () () )] ), module_num: (Module (SymbolTable 2 { my_num: (Variable 2 my_num [] Local (IntegerConstant 5 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false. ) }) module_num [] .false. .false. ) }) [] ) ``` ## See Also [symbol](symbol.md). lfortran-0.63.0/doc/src/asr/asr_nodes/symbol_nodes/Template.md0000664000175000017500000002444415174404631024520 0ustar alastairalastair# Template A **Template** is a `symbol` node for declaring generic functions. ## Declaration ### Syntax ```fortran Template(symbol_table symtab, identifier name, identifier* args, require_instantiation* requires) ``` ### Arguments | Argument Name | Denotes | |----------------------------|----------------------------| | `symtab` | symbol table of the template | | `name` | name of the template | | `args` | symbol names inside the template | | `require_instantiation` | instantiating argument types through require calls | ### Return values ## Description Generic functions are declared within the scope of a template. In the example below, a generic n-times multiplication is implemented in a template. A template can contain multiple generic functions that depend on one another. `name` denotes the name of the template. Template names are needed for specifying which generic functions will be used in the program. In the example below, the `name` of the template is `derive_semigroup`. `args` denotes the parameters of the template. The parameters of a template represent the generic elements that need to be instantiated with concrete types and functions so that the generic functions inside the template can be used during run-time. A warning is generated if there is no corresponding symbol found in the template's `symtab` for a given parameter. In the example below, the parameters '(T, op)' make up the `args` of the `derive_semigroup` template. `require_instantiation` (`Require` statements) are calls to requiremens that replace the types of the arguments with the corresponding parameters' types in the requirement. In the generic function `stimes` below, `a` is a variable with a generic type and `op` is a function utilizing such generic variable. To assign types to both, the statement `require :: semigroup(T, op)` maps the typing for `T` and `op` according to its signature in the `semigroup`. ## Types ## Examples LFortran: ```fortran module semigroup_m requirement semigroup(T, op) ... end requirement template derive_semigroup(T, op) require :: semigroup(T, op) contains elemental function stimes(n, a) result(res) integer, intent(in) :: n type(T), intent(in) :: a type(T) :: res integer :: i res = a do i = 2, n res = op(res, a) end do end function end template end semigroup ``` ASR: ``` semigroup_m: (Module (SymbolTable 2 { derive_semigroup: (Template (SymbolTable 5 { op: (Function (SymbolTable 6 { combined: (Variable 6 combined [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. ), x: (Variable 6 x [] In () () Default (TypeParameter t ) () Source Public Required .false. ), y: (Variable 6 y [] In () () Default (TypeParameter t ) () Source Public Required .false. ) }) op (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 6 x) (Var 6 y)] [] (Var 6 combined) Public .false. .false. () ), stimes: (Function (SymbolTable 7 { a: (Variable 7 a [] In () () Default (TypeParameter t ) () Source Public Required .false. ), i: (Variable 7 i [] Local () () Default (Integer 4) () Source Public Required .false. ), n: (Variable 7 n [] In () () Default (Integer 4) () Source Public Required .false. ), res: (Variable 7 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. ) }) stimes (FunctionType [(Integer 4) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [op] [(Var 7 n) (Var 7 a)] [(Assignment (Var 7 res) (Var 7 a) () ) (DoLoop () ((Var 7 i) (IntegerConstant 2 (Integer 4)) (Var 7 n) ()) [(Assignment (Var 7 res) (FunctionCall 5 op () [((Var 7 res)) ((Var 7 a))] (TypeParameter t ) () () ) () )] )] (Var 7 res) Public .false. .false. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Public Required .false. ) }) derive_semigroup [t op] [(Require semigroup [t op] )] ), ... (semigroup requirement's tree) }) semigroup_m [semigroup_m] .false. .false. ) ``` ## See Also * [Symbols](symbol.md) * [Requirement](Requirement.md) * [Generics](../../generics.md)lfortran-0.63.0/doc/src/asr/asr_nodes/symbol_nodes/Block.md0000664000175000017500000001132215174404631023766 0ustar alastairalastair# Block The **Block** is a `symbol` node that represents a scoped list of statements (block). ## Declaration ### Syntax ``` Block(symbol_table symtab, identifier name, stmt* body) ``` ### Arguments | Argument Name | Denotes | |-----------------|--------------------------------------------------| | `parent_symtab` | the parent symbol table that contains the block | | `name` | the name of the block in the parent symbol table | | `body` | the list of statements in the block | ### Return values None. ## Description The Block node represents a scoped list of statements. In C one uses `{}` to represent a block, in Fortran one uses `block` / `end block`. The Block contains its own symbol table and can contain variable declarations that are local to the block. The Block itself is part of a symbol table and one uses the BlockCall `stmt` node to call (enter) the block from a list of statements. A `BlockCall` is different from a `FunctionCall` in the sense that it does not expect/accept any arguments. Also, the statements inside a `Block` can access the variables in the parent/caller scope, unlike `Function` where statements cannot access variables of the caller scope. ## Types ## Examples An example in C is: ```c { int i = 5; print("%d\n", i); } ``` An example in Fortran is: ```fortran program test_block integer :: i i = 5 block integer :: j j = i + 1 print *, i, j end block end program ``` ASR: ```clojure (TranslationUnit (SymbolTable 1 { test_block: (Program (SymbolTable 2 { block: (Block (SymbolTable 3 { j: (Variable 3 j [] Local () () Default (Integer 4 []) Source Public Required .false. ) }) block [(= (Var 3 j) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ) () ) (Print () [(Var 2 i) (Var 3 j)] () () )] ), i: (Variable 2 i [] Local () () Default (Integer 4 []) Source Public Required .false. ) }) test_block [] [(= (Var 2 i) (IntegerConstant 5 (Integer 4 [])) () ) (BlockCall -1 2 block )] ) }) [] ) ``` ## See Also [symbol](symbol.md). lfortran-0.63.0/doc/src/asr/asr_nodes/symbol_nodes/symbol_nodes.md0000664000175000017500000000022015174404631025424 0ustar alastairalastair# ASR Symbol Nodes ```{toctree} --- maxdepth: 1 --- Block.md ExternalSymbol.md Variable.md program.md Requirement.md Template.md symbol.md ``` lfortran-0.63.0/doc/src/asr/asr_nodes/symbol_nodes/Variable.md0000664000175000017500000002140515174404631024464 0ustar alastairalastair# Variable Variable is a **symbol** node representing a variable declaration. ## Declaration ### Syntax ``` Variable(symbol_table parent_symtab, identifier name, identifier* dependencies, intent intent, expr? symbolic_value, expr? value, storage_type storage, ttype type, symbol? type_declaration, abi abi, access access, presence presence, bool value_attr, bool target_attr, bool contiguous_attr, string? bindc_name, bool is_volatile, bool is_protected, pass_attr pass_attr, identifier? self_argument, int corank) ``` ### Arguments `parent_symtab` integer id of the parent symbol table that contains the variable `name` the name of the variable `dependencies` other symbols that this variable depends on; must all be defined in the `parent_symtab` `intent` specifies intent (Local, `intent(in)`, `intent(inout)`, etc.) `symbolic_value` the optional symbolic expression to initialize the variable (e.g. `2+3+4+x`), this value must be compile time, but it is not necessarily a constant (e.g., can contain binary operations, other variables, etc.) `value` the optional constant expression holding the compile time value (e.g. `5`, or `5.5`), it is a compile time constant. `storage` whether `Save`, `Parameter`, `Allocatable` `type` the ttype of the variable `type_declaration` null for primitive types; for composite types that are declared elsewhere in the program (struct, function, enum) it points to the symbol that declares the type `abi` abi such as: `Source`, `Interface`, `BindC` `access` visibility: `Public`, `Private` `presence` for parameters: `Required` or `Optional` `value_attr` if true, this parameter has a `value` attribute set `target_attr` if true, this variable has the `target` attribute `contiguous_attr` if true, this variable has the `contiguous` attribute `bindc_name` optional C binding name from `bind(c, name="...")` `is_volatile` if true, this variable has the `volatile` attribute `is_protected` if true, this variable has the `protected` attribute `pass_attr` determines whether this variable is a procedure pointer component with pass/nopass semantics. A three-valued enum: - `NotMethod` — this is not a type-bound procedure pointer (default for all regular variables, standalone procedure pointers, and non-procedure variables) - `Pass` — this is a procedure pointer component inside a derived type with pass semantics: the object through which it is called is implicitly passed as an argument at the position identified by `self_argument` - `NoPass` — this is a procedure pointer component inside a derived type with nopass semantics: no object is passed implicitly `self_argument` only meaningful when `pass_attr` is `Pass`. Identifies which dummy argument of the procedure interface receives the passed object: - `nullptr` — the passed object goes to the first dummy argument (default) - a name (e.g. `"pt"`) — the passed object goes to the dummy argument with that name, which may be at any position in the argument list `corank` the number of codimensions for coarray variables (0 for non-coarrays). When non-zero, indicates that this variable is a coarray and specifies how many coarray indices (image selectors) are required in `CoarrayRef` expressions to reference it across images. For example, `integer :: x[*]` has `corank=1`, while `integer :: y(10)[*,*]` has `corank=2`. ### Return values None. ## Description A `Variable` node represents a declaration of any variable in the program. It contains information about the type, visibility, compile-time value, etc. The type of the variable can be any of the primitive types like integer, real, complex, pointers, arrays. In such cases, the `type_declaration` member of the `Variable` is null. `Variable` might also have a non-primitive type like `StructType`, or types for classes, enums, and function pointers. Such types are not declared inline to the `Variable` node itself. In such cases, the `type_declaration` member of `Variable` points to the symbol containing the declaration of the type. ### Procedure Pointer Components When a derived type declares a procedure pointer component, that component is represented as a `Variable` whose `type` is a `FunctionType` (possibly wrapped in a `Pointer`). The `pass_attr` and `self_argument` fields distinguish three cases: ```fortran type :: mytype ! NotMethod, self_argument=null: plain procedure pointer, no pass/nopass attribute procedure(iface), pointer :: op => null() ! NoPass, self_argument=null: explicitly no implicit self procedure(iface), nopass, pointer :: action => null() ! Pass, self_argument=null: self is passed as the first argument (default position) procedure(iface), pass, pointer :: scale => null() ! Pass, self_argument="self": self is passed at the position of dummy arg "self" procedure(iface), pass(self), pointer :: combine => null() end type ``` For type-bound procedures declared with `contains` (not procedure pointer components), see [StructMethodDeclaration](StructMethodDeclaration.md). ### Coarray Variables In Fortran, coarrays enable data access and communication across multiple images (processes/threads) in a parallel program. A coarray variable has codimensions declared with the `[...]` notation: ```fortran integer :: scalar_coarray[*] ! rank 0, corank 1 integer :: array_coarray(10)[*] ! rank 1, corank 1 integer :: matrix[*,*] ! rank 0, corank 2 integer :: scalar_not_coarray ! rank 0, corank 0 integer :: array_not_coarray(10) ! rank 1, corank 0 ``` The `corank` field of a `Variable` node indicates how many codimensions the variable has. For non-coarray variables, `corank` is 0. When accessing coarray elements in expressions, the number of coindices in a `CoarrayRef` node must match the variable's `corank`. `Variable` represents declarations of variables. `Var` nodes represent instances of variables in code. To represent the use of a variable in an expression, employ the ASR `expr Var` node. To reference a coarray with explicit image selectors, use the `CoarrayRef` node. ## Examples ```fortran program expr2 integer :: x x = (2+3)*5 print *, x end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { expr2: (Program (SymbolTable 2 { x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false. () ) }) expr2 [] [(= (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 5 (Integer 4 [])) ) Mul (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant 25 (Integer 4 [])) ) () ) (Print () [(Var 2 x)] () () )] ) }) [] ) ``` ## Coarray Example ```fortran program coarray_test implicit none integer :: x[*] x = 42 if (this_image() == 1) then print *, x[2] ! Access x on image 2 end if end program coarray_test ``` ASR (simplified): ```fortran (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false. 1 ! corank = 1 (this is a coarray with one codimension) ) ``` In the assignment `x[2] = ...`, the coarray reference is represented as: ```fortran (CoarrayRef (Var 2 x) [(array_index (left (IntegerConstant 2)) (right ()) (step ()))] (Integer 4 []) () ) ``` The `corank=1` in the Variable declaration matches the single coindex `[2]` in the `CoarrayRef` expression. ## See Also [Var](../expression_nodes/Var.md), [CoarrayRef](../expression_nodes/CoarrayRef.md), [StructMethodDeclaration](StructMethodDeclaration.md) lfortran-0.63.0/doc/src/asr/asr_nodes/symbol_nodes/Requirement.md0000664000175000017500000001545315174404631025245 0ustar alastairalastair# Requirement A **Requirement** is a `symbol` node for declaring generic types and operations associated with the types. ## Declaration ### Syntax ```fortran Requirement(symbol_table symtab, identifier name, identifier* args, require_instantiation* requires) ``` ### Arguments | Argument Name | Denotes | |----------------------------|----------------------------| | `symtab` | symbol table of the requirement | | `name` | name of the requirement | | `args` | symbol names inside the requirement | | `require_instantiation` | instantiating argument types through require calls | ### Return values N/A ## Description Generic types and their abstract methods (whose implementation are not yet known) are needed during implementation of generic functions. Requirements fills the hole here by declaring (adhoc) generic types and their associated methods. Requirements are analoguos to *typeclasses* in Haskell and *traits* in Rust. `name` denotes the name of the requirement. In the example below, the `name` of the requirements are `semigroup` and `monoid`. `args` denotes the parameters of the requirement. A warning is generated if there is no corresponding symbol found in the requirement's `symtab` for a given paramater. In the example below, the parameters `(T, op)` make up the `args` of the `semigroup` requirement. `symtab` denotes the symbol table of the requirement. It contains generic types, represented by variables typed with `TypeParameter`, and *abstract* functions whose signatures may contain generic types. An error is generated if a symbol found in the `symtab` but not declared in `args`. In the example below, `semigroup`'s `symtab` contains the variable `T` with type `TypeParameter T` and the function `op` with type `TypeParameter T x TypeParameter T -> TypeParameter T`. `require_instantiation` (`Require` statements) are calls to requirements that replace the types of the arguments with the corresponding parameters' types in the requirement. As an example the requirement `monoid` below reuses `semigroup` through `require :: semigroup(S, combine)`. Although `S` and `combine` are not declared as symbols inside `monoid`, this statement maps the typing for both `S` and `combine` with the parameter `T` and `op` in `semigroup` that defines `S` as a type parameter. As a result, `type(S)` is a valid type in `monoid` and two methods `combine` and `empty` are associated with it. ## Types ## Examples LFortran: ```fortran module semigroup_m requirement semigroup(T, op) type, deferred :: T function op(x,y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement requirement monoid(S, combine, empty) require :: semigroup(S, combine) pure function empty() type(S) :: empty end function end requirement end module ``` ASR: ``` semigroup_m: (Module (SymbolTable 2 { semigroup: (Requirement (SymbolTable 3 { op: (Function (SymbolTable 4 { x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Public Required .false. ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Public Required .false. ), z: (Variable 4 z [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. ) }) op (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 z) Public .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Public Required .false. ) }) semigroup [t op] [] ) }) semigroup_m [] .false. .false. ) ``` ## See Also * [Symbols](symbol.md) * [Template](Template.md) * [Generics](../../generics.md)lfortran-0.63.0/doc/src/asr/asr_nodes/symbol_nodes/program.md0000664000175000017500000000467515174404631024420 0ustar alastairalastair# Program Program symbol, a **symbol** node. ## Declaration ### Syntax ```fortran Program(symbol_table symtab, identifier name, identifier* dependencies, stmt* body) ``` ### Arguments `symtab` the symbol table of the program. `name` the name of the program. `dependencies` the module names that the program depends on. `body` the list of statements that the program contains. ### Return values None. ## Description ASR pass transforms (in-place) the ASR tree and wraps all global statements and expressions into a program. ## Types ## Examples ```fortran program expr2 integer :: x x = (2+3)*5 print *, x end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { expr2: (Program (SymbolTable 2 { x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false. ) }) expr2 [] [(= (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 5 (Integer 4 [])) ) Mul (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant 25 (Integer 4 [])) ) () ) (Print () [(Var 2 x)] () () )] ) }) [] ) ``` ## See Also [Module](Module.md), [Function](Function.md). lfortran-0.63.0/doc/src/asr/asr_nodes/omp_nodes/0000775000175000017500000000000015174404631021701 5ustar alastairalastairlfortran-0.63.0/doc/src/asr/asr_nodes/omp_nodes/omp_region_type.md0000664000175000017500000000367015174404631025430 0ustar alastairalastair # omp_region_type The ``omp_region_type`` enumeration defines the types of OpenMP regions supported in the Abstract Semantic Representation (ASR). ## Declaration ### Syntax ``` omp_region_type = Parallel | Do | ParallelDo | Sections | Section | ParallelSections | Critical | Atomic | Barrier | Single | Master | Task | Taskwait | Taskloop | Simd | Teams | Distribute | TeamsDistribute | DistributeParallelDo | Target | TargetData ``` ### Arguments None. ### Return values None. ## Description ``omp_region_type`` specifies the category of an OpenMP directive within an ``OMPRegion`` node. Each value corresponds to a specific OpenMP construct, such as parallel execution (``Parallel``), loop distribution (``Distribute``), or device offloading (``Target``). This enumeration enables the ASR to represent diverse OpenMP behaviors, facilitating lowering to appropriate runtime calls. ## Types An enumeration with the following values: - ``Parallel``: Parallel region. - ``Do``: Loop construct. - ``ParallelDo``: Combined parallel loop. - ``Sections``: Sections construct. - ``Section``: Single section within sections. - ``ParallelSections``: Combined parallel sections. - ``Critical``: Critical section. - ``Atomic``: Atomic update. - ``Barrier``: Synchronization barrier. - ``Single``: Single execution. - ``Master``: Master thread execution. - ``Task``: Task construct. - ``Taskwait``: Task synchronization. - ``Taskloop``: Task loop. - ``Teams``: Teams construct. - ``Distribute``: Distribute construct. - ``TeamsDistribute``: Combined teams distribute. - ``DistributeParallelDo``: Combined distribute parallel loop. - ``Target``: Target offloading. ## See OpenMp Documentation to understand each of the constructs with examples - [OpenMP API 6.0 Specification Guide](https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-6-0.pdf) - [OpenMP API 6.0 Reference Guide](https://www.openmp.org/wp-content/uploads/OpenMP-RefGuide-6.0-OMP60SC24-web.pdf)lfortran-0.63.0/doc/src/asr/asr_nodes/omp_nodes/omp_nodes.md0000664000175000017500000000013315174404631024203 0ustar alastairalastair# ASR OpenMp Nodes ```{toctree} --- maxdepth: 1 --- omp_clauses.md omp_region_type.md ``` lfortran-0.63.0/doc/src/asr/asr_nodes/omp_nodes/omp_clauses.md0000664000175000017500000000556115174404631024544 0ustar alastairalastair# omp_clause The ``omp_clause`` union represents OpenMP clauses that modify the behavior of an ``OMPRegion`` directive. ## Declaration ### Syntax ``` omp_clause = OMPPrivate(expr* vars) | OMPShared(expr* vars) | OMPFirstPrivate(expr* vars) | OMPReduction(reduction_op operator, expr* vars) | OMPCollapse(expr count) | OMPNumThreads(expr num_threads) | OMPSchedule(schedule_type kind, expr? chunk_size) | OMPNumTeams(expr num_teams) | OMPThreadLimit(expr thread_limit) | OMPMap(map_type type, expr* vars) ``` ### Arguments | Clause Type | Arguments | |-----------------------|---------------------------------------------------| | `OMPPrivate` | `vars`: List of variables to privatize. | | `OMPShared` | `vars`: List of variables to share. | | `OMPFirstPrivate` | `vars`: List of variables to first-privatize. | | `OMPReduction` | `operator`: Reduction operator (e.g., ReduceAdd). `vars`: List of variables for reduction. | | `OMPCollapse` | `count`: Number of loops to collapse. | | `OMPNumThreads` | `num_threads`: Number of threads. | | `OMPSchedule` | `kind`: Schedule type (e.g., Static). `chunk_size`: Optional chunk size expression. | | `OMPNumTeams` | `num_teams`: Number of teams. | | `OMPThreadLimit` | `thread_limit`: Thread limit per team. | | `OMPMap` | `type`: Mapping type (e.g., ToFrom). `vars`: List of variables to map. | ### Return values None. ## Description ``omp_clause`` defines modifiers for OpenMP regions in the Abstract Semantic Representation (ASR). Clauses control aspects like data scoping (e.g., ``OMPPrivate``, ``OMPShared``), reductions (``OMPReduction``), loop scheduling (``OMPSchedule``), team configuration (``OMPNumTeams``), and device data mapping (``OMPMap``). These clauses are attached to ``OMPRegion`` nodes to specify runtime behavior during execution. ## More enums - ``map_type``: Enumeration for mapping directions in ``OMPMap``. - ``To``: Map data to device. - ``From``: Map data from device. - ``ToFrom``: Map data to and from device. - ``Alloc``: Allocate on device. - ``Release``: Release from device. - ``Delete``: Delete from device. - ``schedule_type``: Enumeration for loop scheduling in ``OMPSchedule``. - ``Static``: Static scheduling. - ``Dynamic``: Dynamic scheduling. - ``Guided``: Guided scheduling. - ``Auto``: Compiler-decided scheduling. - ``Runtime``: Runtime-decided scheduling. ## See OpenMp Documentation to understand each of the constructs with examples - [OpenMP API 6.0 Specification Guide](https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-6-0.pdf) - [OpenMP API 6.0 Reference Guide](https://www.openmp.org/wp-content/uploads/OpenMP-RefGuide-6.0-OMP60SC24-web.pdf)lfortran-0.63.0/doc/src/asr/asr_nodes/helper_nodes/0000775000175000017500000000000015174404631022365 5ustar alastairalastairlfortran-0.63.0/doc/src/asr/asr_nodes/helper_nodes/alloc_arg.md0000664000175000017500000000343115174404631024633 0ustar alastairalastair# alloc_arg An **allocation argument** used inside the `Allocate` and `ReAlloc` statement. ## Declaration ### Syntax ```fortran alloc_arg(expr a, dimension* dims, expr? len_expr, symbol? sym_subclass, ttype? type) ``` ### Arguments Input arguments of `a`, `dims`, optional `len_expr`, optional `sym_subclass`, and optional `type`. `a` contains the variable to be allocated. `dims` contains a list of dimension bounds in the form of tuples `(lower, upper)` representing shape. `len_expr` is an optional expression specifying length, used for character and derived types. `sym_subclass` is an optional symbol representing subclass type for polymorphic allocation. `type` is an optional type that specifies the target type of allocation. ### Return values None. ## Description **alloc_arg** specifies one element in the `Allocate` statement. It defines what variable to allocate, with what dimensions, type, subclass, and optional length parameters. It is used only as part of the `Allocate` and `ReAlloc` node. ## Types The variable `a` must be allocatable. Dimensions must be valid integer expressions. Optional fields may be used for polymorphic or character allocations. ## Examples Following example code allocates a memory block of size 3: ```fortran program allocate_mem real, allocatable :: a(:) allocate(a(3)) end program ``` ASR (portion corresponding to `alloc_arg`): ``` ((Var 2 a) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] () () ()) ``` ```fortran type :: base integer :: x end type type, extends(base) :: derived real :: y end type class(base), allocatable :: obj allocate(derived :: obj) ``` ``` ((Var 2 obj) [] () 2 derived (StructType [] [] .true. 2 derived )) ``` ## See Also [Allocate](#allocate) lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/0000775000175000017500000000000015174404631023305 5ustar alastairalastairlfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/RealCompare.md0000664000175000017500000000263615174404631026030 0ustar alastairalastair# RealCompare Real comparison `expr` ASR node. ## Declaration ### Syntax ```fortran RealCompare(expr left, cmpop op, expr right, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`left` | left side of the comparison operand | |`right` | right side of the comparison operand | |`op` | comparison operator | |`type` | table entry type | |`value`| expression value| ### Return values The return value is the expression that the RealCompare represents. ## Description **RealCompare** represents real floating point comparison operation. Comparison operation can be: 1. Less than 2. Greater than 3. Less than or equal to 4. Greater than or equal to 5. Equal to ## Types Only accepts real constants, real exponents, floating point values. ## Examples ```fortran 2.1 > 1. ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(RealCompare (RealConstant 2.100000 (Real 4 []) ) Gt (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []) ) ) (Logical 4 []) (LogicalConstant .true. (Logical 4 []) ) )] ) ``` ## See Also [IntegerCompare](IntegerCompare.md) lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/LogicalConstant.md0000664000175000017500000000211115174404631026706 0ustar alastairalastair# LogicalConstant Logical literal constant, an `expr` node. ## Declaration ### Syntax ```fortran LogicalConstant(bool value, ttype type) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `value` | value of boolean | | `type` | tabel entry type | ### Return values The return value is the expression that the LogicalConstant represents. ## Description **LogicalConstant** represents logical constant, is either logical value true or false. The only logical constants are `.TRUE` and `.FALSE`. The period delimiters are necessary. The value must be in the uses 4 bytes of storage. ## Types Only accepts TRUE or FAlSe values. ## Examples ```fortran .TRUE. .FALSE. ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(LogicalConstant .true. (Logical 4 []) ) (LogicalConstant .false. (Logical 4 []) )] ) ``` ## See Also [IntegerConstant](IntegerConstant.md), [ComplexConstant](ComplexConstant.md), [RealConstant](RealConstant.md) lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/LogicalBinOp.md0000664000175000017500000000412015174404631026126 0ustar alastairalastair# LogicalBinOp Logical Binary Operation expression type. An **expr** node. ## Declaration ### Syntax ```fortran LogicalBinOp(expr left, binop op, expr right, ttype type, expr? value) ``` ### Arguments `left` and `right` represent expression on the left and right side of operator `op`. `type` represents table entry type and `value` represents expression. ### Return values The return value is the expression that the LogicalBinOp represents. ## Description **LogicalBinOp** represents logical binary operation expression type. It is an ASR expr node. ASR has multiple binary expression types, for example: for Integer, real, complex, and logical. The binary operations accept two arguments of the same type. ## Types Only accepts `.TRUE.` and `.FALSE.` ## Examples ```fortran bgt(10, 4) .neqv. .true. ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { bgt: (ExternalSymbol 1 bgt 3 bgt lfortran_intrinsic_bit [] bgt Private ), bgt@bgt32: (ExternalSymbol 1 bgt@bgt32 3 bgt32 lfortran_intrinsic_bit [] bgt32 Private ), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_bit: (IntrinsicModule lfortran_intrinsic_bit) }) [(LogicalBinOp (FunctionCall 1 bgt@bgt32 1 bgt [((IntegerConstant 10 (Integer 4 []))) ((IntegerConstant 4 (Integer 4 [])))] (Logical 4 []) () () ) NEqv (LogicalConstant .true. (Logical 4 []) ) (Logical 4 []) () )] ) ``` ## See Also [IntegerBinOp](IntegerBinOp.md), [ComplexBinOp](ComplexBinOp.md), [RealBinOp](RealBinOp.md) lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/IntegerBitNot.md0000664000175000017500000000253215174404631026346 0ustar alastairalastair# IntegerBitNot Not conversion of integer bits, a `expr` node. ## Declaration ### Syntax ```fortran IntegerBitNot(expr arg, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`arg`| expression arguments | |`type`| table entry type | |`value`|expression value | ### Return values The return value is the expression that the IntegerBitNot represents. ## Description **IntegerBitNot** represents integer binary not operation. It is used when flipping bits of integer from `1` to `0` or `0` to `1`. ## Types Only accepts integers. ## Examples ```fortran not(1) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_bit: (IntrinsicModule lfortran_intrinsic_bit), not: (ExternalSymbol 1 not 3 not lfortran_intrinsic_bit [] not Private ) }) [(IntegerBitNot (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -2 (Integer 4 [])) )] ) ``` ## See Also [LogicalNot](logicalnot.md) lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/NamedExpr.md0000664000175000017500000000050515174404631025512 0ustar alastairalastair# NamedExpr ## Declaration ### Syntax ```fortran NamedExpr(expr target, expr value, ttype type) ``` ### Arguments ### Return values The return value is the expression that the NamedExpr represents. ## Description **NamedExpr** represents ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/BitCast.md0000664000175000017500000000255615174404631025170 0ustar alastairalastair# BitCast Cast bits to 1 or 0. ## Declaration ### Syntax ```fortran BitCast(expr source, expr mold, expr? size, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `source`| source expression | |`mold` | mold expression | |`size` | size of expression | |`type` | table entry type | |`value`| expression value | ### Return values The return value is the expression that the BitCast represents. ## Description **BitCast** represents casting bits to 0 or 1. ## Types Only accepts integers. ## Examples ```fortran integer :: x = 21432 print *, transfer(x, 1.0) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { x: (Variable 1 x Local (IntegerConstant 21432 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false. ) }) [(Print () [(BitCast (Var 1 x) (RealConstant 1.000000 (Real 4 []) ) () (Real 4 []) () )] () () )] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/ArrayBound.md0000664000175000017500000000374315174404631025704 0ustar alastairalastair# ArrayBound Array upper and lower bound. ## Declaration ### Syntax ```fortran ArrayBound(expr v, expr? dim, ttype type, arraybound bound, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`v`| expression | |`dim`| dimension | |`type` | table entry type | |`bound` | array bound | |`value` | expression value | ### Return values The return value is the expression that the ArrayBound represents. ## Description **ArrayBound** represents bounds of array. It can be upper or lower bound. ## Types Only accepts integers. ## Examples ```fortran integer :: a(2:5, 3:9, 7) print *, lbound(a, 1), lbound(a, 2), lbound(a, 3) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { a: (Variable 1 a Local () () Default (Integer 4 [((IntegerConstant 2 (Integer 4 [])) (IntegerConstant 4 (Integer 4 []))) ((IntegerConstant 3 (Integer 4 [])) (IntegerConstant 7 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 7 (Integer 4 [])))]) Source Public Required .false. ) }) [(Print () [(ArrayBound (Var 1 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound () ) (ArrayBound (Var 1 a) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound () ) (ArrayBound (Var 1 a) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound () )] () () )] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/ComplexBinOp.md0000664000175000017500000000362015174404631026167 0ustar alastairalastair# ComplexBinOp Complex Binary Operation expression type. An **expr** node. ## Declaration ### Syntax ```fortran ComplexBinOp(expr left, binop op, expr right, ttype type, expr? value) ``` ### Arguments `left` and `right` represent expression on the left and right side of operator `op`. `type` represents table entry type and `value` represents expression. ### Return values The return value is the expression that the ComplexBinOp represents. ## Description **ComplexBinOp** represents complex binary operation expression type. It is an ASR expr node. ASR has multiple binary expression types, for example: for Integer, real, complex, and logical. The binary operations accept two arguments of the same type. ## Types Only accepts real constants, real exponents, floating point values, integer, as real and imaginary part of the complex constant. ## Examples ```fortran (2.1, 3.1) + 5.1 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(ComplexBinOp (ComplexConstructor (RealConstant 2.100000 (Real 4 []) ) (RealConstant 3.100000 (Real 4 []) ) (Complex 4 []) (ComplexConstant 2.100000 3.100000 (Complex 4 []) ) ) Add (Cast (RealConstant 5.100000 (Real 4 []) ) RealToComplex (Complex 4 []) (ComplexConstant 5.100000 0.000000 (Complex 4 []) ) ) (Complex 4 []) (ComplexConstant 7.200000 3.100000 (Complex 4 []) ) )] ) ``` ## See Also [IntegerBinOp](IntegerBinOp.md), [RealBinOp](RealBinOp.md), [LogicalBinOp](LogicalBinOp.md) lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/ArrayReshape.md0000664000175000017500000000516615174404631026225 0ustar alastairalastair# ArrayReshape Function to reshape an array. ## Declaration ### Syntax ```fortran ArrayReshape(expr array, expr shape, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`array` | array expression | |`shape` | integer value and an array of rank one, positive or zero | |`type` | table entry type | |`value`| expression value| ### Return values The return value is the expression that the ArrayReshape represents. ## Description **ArrayReshape** reshape an array. If necessary, the new array may be padded with elements from PAD or permuted as defined by ORDER. ## Types Only accepts integers. ## Examples ```fortran real(8), intent(in) :: a(:, :) real(8) :: b(256) integer :: newshape(1) newshape(1) = 256 b = reshape(a, newshape) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { a: (Variable 1 a In () () Default (Real 8 [(() ()) (() ())]) Source Public Required .false. ), b: (Variable 1 b Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) Source Public Required .false. ), newshape: (Variable 1 newshape Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false. ) }) [(= (ArrayItem (Var 1 newshape) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) () ) (IntegerConstant 256 (Integer 4 [])) () ) (= (Var 1 b) (ArrayReshape (Var 1 a) (Var 1 newshape) (Real 8 [(() ())]) () ) () )] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/expression_nodes.md0000664000175000017500000000110615174404631027214 0ustar alastairalastair# ASR Expression Nodes ```{toctree} --- maxdepth: 1 --- ArrayBound ArrayConstant ArrayItem ArrayMatMul ArrayPack ArrayReshape ArraySection ArraySize ArrayTranspose BitCast Cast ComplexBinOp ComplexCompare ComplexConstant ComplexConstructor ComplexUnaryMinus DerivedTypeConstructor FunctionCall IfExp ichar implieddoloop IntegerBOZ IntegerBinOp IntegerBitNot IntegerCompare IntegerConstant IntegerUnaryMinus IntrinsicFunction LogicalBinOp LogicalCompare LogicalConstant RealBinOp RealCompare RealConstant RealUnaryMinus StringCompare StringConcat StringConstant TypeInquiry Var ``` lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/DerivedTypeConstructor.md0000664000175000017500000000071015174404631030317 0ustar alastairalastair# DerivedTypeConstructor ## Declaration ### Syntax ```fortran ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | | | ### Return values The return value is the expression that the DerivedTypeConstructor represents. ## Description **DerivedTypeConstructor** represents Derived Type Constructor expression. ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/StringCompare.md0000664000175000017500000000234215174404631026405 0ustar alastairalastair# StringCompare String comparison. ## Declaration ### Syntax ```fortran StringCompare(expr left, cmpop op, expr right, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`left` | left side of comparison operator | |`right` | right side of comparison operator | |`type` | table entry type | | `value` | expression value| |`op` | operand | ### Return values The return value is the expression that the StringCompare represents. ## Description **StringCompare** represents string comparison expression type. Comparisons are: 1. lexicographically less than, or less than equal to 2. lexicographically greater than, or greater than or equal to 3. Equal to 4. Not equal to ## Types Only accepts strings. ## Examples ```fortran "aaa" > "bbb" ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(StringCompare (StringConstant "aaa" (Character 1 3 () []) ) Gt (StringConstant "bbb" (Character 1 3 () []) ) (Logical 4 []) (LogicalConstant .false. (Logical 4 []) ) )] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/ComplexCompare.md0000664000175000017500000000324215174404631026546 0ustar alastairalastair# ComplexCompare Complex comparison `expr` ASR node. ## Declaration ### Syntax ```fortran ComplexCompare(expr left, cmpop op, expr right, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`left` | left side of the comparison operand | |`right` | right side of the comparison operand | |`op` | comparison operator | |`type` | table entry type | |`value`| expression value| ### Return values The return value is the expression that the ComplexCompare represents. ## Description **ComplexCompare** represents complex comparison operation. Comparison operation can be: 1. Less than 2. Greater than 3. Less than or equal to 4. Greater than or equal to 5. Equal to ## Types Only accepts integers, real constants, real exponents, floating point values as real and imaginary part of complex constant. ## Examples ```fortran (2.1, 1.1) /= 2 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(ComplexCompare (ComplexConstructor (RealConstant 2.100000 (Real 4 []) ) (RealConstant 1.100000 (Real 4 []) ) (Complex 4 []) (ComplexConstant 2.100000 1.100000 (Complex 4 []) ) ) NotEq (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToComplex (Complex 4 []) () ) (Logical 4 []) () )] ) ``` ## See Also [IntegerCompare](IntegerCompare.md), [RealCompare](RealCompare.md) lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/ArrayPhysicalCast.md0000664000175000017500000002023515174404631027217 0ustar alastairalastair# Array Physical Cast Casts array from one physical type to another. ## Declaration ### Syntax ```ASDL ArrayPhysicalCast(expr arg, array_physical_type old, array_physical_type new, ttype type, expr? value) ``` > array_physical_type = DescriptorArray | PointerArray | UnboundedPointerArray | FixedSizeArray | StringArraySinglePointer | NumPyArray | ISODescriptorArray | SIMDArray | AssumedRankArrays ### Arguments | Argument Name | Argument Description | | ------------- | --------------------------------------------------------------------------------------------------------------------------- | | `arg` | Array expression argument | | `old` | Current physical array type of the array expression `arg`.
**Possible values** : `PointerArray`, `DescriptorArray`, etc | | `new` | The target physical array type to cast to.
**Possible values** : `PointerArray`, `DescriptorArray`, etc | | `type` | Type of expression (It's always an array with physical type equivalent to `new` ArrayPhysicalType) | | `value` | The type of the expression. It is always an array type corresponding to the new ArrayPhysicalType. | ### Return values The return value is an array expression in the _new_ physical type. It's a message to the back end to know which physical type to use on this array expression. ## Description **ArrayPhysicalCast** casts the physical type from one array type to another. It dispatches a message to the backend to cast the physical type of the passed array expression from one type to another, so we can do some runtime array operations like **assignment**, **slicing**, **printing** and **comparing** with no issues. ### Physical Types **PointerArray** : The size is not known at compile time, but we know an expression for it at runtime. This type is used for `bind(c)`; represented by just a pointer, the compiler knows expressions dimensions at compile time. We know the expression for all dimensions. The expression can contain runtime parameters. It is represented by just a pointer. The compiler knows the dimensions at compile time, but they are not stored at runtime explicitly. You can call size(A), the compiler will determine the size expression at compile time (using runtime variables). Any PointerArray can be cast to a DescriptorArray and DescriptorArray can in general be used without any additional code/logic in all places where PointerArray is used. The other direction is more complicated: It is possible to cast a DescriptorArray to a PointerArray, but sometimes a temporary copy is needed unless the DescriptorArray was contiguous. Also in order to obtain expressions for the dimensions, one often requires to create a temporary and then use ArraySize on the temporary as dimension expressions for the PointerArray. ```fortran subroutine f(n, m, A) bind(c) integer, intent(in) :: n, m real, intent(in) :: A(n, m) end subroutine ``` ```fortran subroutine f(n, m, A) integer, intent(in) :: n, m real, intent(in) :: A(n, 2*m) end subroutine ``` Note: this is currently PointerArray, but it could also be FixedSizeArray. ```fortran subroutine f(A) real, intent(in) :: A(10, 20) end subroutine ``` LHS is PointerArray (can also be FixedSizeArray), RHS is FixedSizeArray ```fortran real :: x(3), a, b, c x = [a, b, c] ! LHS is PointerArray/FixedSizeArray, RHS is FixedSizeArray ArrayConstructor ``` **FixedSizeArray**: The size is known at compile time. The array elements are either runtime (expressions) or compile time. Any FixedSizeArray can be cast to PointerArray, and PointerArray can in general be used in all places where FixedSizeArray is used (but not vice versa). The advantage of FixedSizeArray is that the size is known at compile time and it is enforced at the type level, so if both PointerArray adn FixedSizeArray can be used, we generally prefer to use FixedSizeArray. By knowing the size at compile time, the backend has the option to represent the array as a struct of a known number of elements, and even pass this struct by value. The PointerArray on the other hand can naturally only be passed as a pointer, because the size is not known at compile time. We enforce FixedSizeArray over PointerArray in the following cases: * Both ArrayConstant and ArrayConstructor should always be FixedSizeArray. In other cases we currently allow both. Maybe in the future we can restrict things more. Examples of what can be a FixedSizeArray type: ```fortran program main real :: A(10, 20) end program ``` ```fortran subroutine f(A) real, intent(in) :: A(10, 20) end subroutine ``` ```fortran real :: x(3), a, b, c x = [1, 2, 3] ! LHS is FixedSizeArray, RHS is FixedSizeArray (ArrayConstant) x = [a, b, c] ! LHS is FixedSizeArray, RHS is FixedSizeArray (ArrayConstructor) ``` In the above currently only the ArrayConstant/Constructor is enforced, the other cases can also be a PointerArray, and usually it is. **DescriptorArray**: Array is represented by an array descriptor (struct that contains the pointer to data, dimensions, strides, etc.) ```fortran subroutine f(A) real, intent(in) :: A(:,:) end subroutine ``` ```fortran subroutine f() real, pointer :: A(:, :) end subroutine ``` ```fortran real, allocatable :: x(:) real :: a, b, c allocate(x(3)) x = [a, b, c] ! LHS is DescriptorArray, RHS is FixedSizeArray (ArrayConstructor) x = [1, 2, 3] ! LHS is DescriptorArray, RHS is FixedSizeArray (ArrayConstant) ``` **UnboundedPointerArray**: Used for `A(*)`. Represented by just a pointer. The compiler does *not* know the size of the array at compile time, and there is no information about it at runtime. So you cannot call size(A). The `A(*)` usage deprecated, one should use either `A(:)` or `A(n)`. The compiler can check this in Debug mode by passing the expression for the dimension as an argument (the NAG compiler does this, for example). ```fortran subroutine f(n, A) integer, intent(in) :: n real, intent(in) :: A(n, *) ! print *, size(A) ! Not allowed, does not compile end subroutine ``` **CharacterArraySinglePointer** ``` subroutine f(s) character(len=*), intent(in) :: s end subroutine ``` **NumPyArray**: This is using NumPy array descriptor, mostly for LPython, but can be used by any compiler (LFortran can use this in the future for `bind(python)` functions). It is used for easy interoperability with NumPy. An array with this physical type can be accepted from Python and no conversion is needed, the descriptor is used as is. **ISODescriptorArray**: This is Fortran 2018 ISO array descriptor, as described in the standard. Used for C interoperability. It is for being able to pass `DescriptorArray` arrays (`A(:)`) into C. The `DescriptorArray` is LCompilers specific, while `ISODescriptorArray` is standardized, so we must cast one to the other to make it work. ```fortran subroutine f(A) bind(c) real, intent(in) :: A(:,:) end subroutine ``` **SIMDArray**: Used for arrays that are represented by a SIMD vector in the hardware, or maps directly into a vector register. LFortran provides a `simd` attribute (extension), or one can also use a pragma. ```fortran subroutine f() real, simd :: A(64) end subroutine ``` **AssumedRankArrays**: Usedf for writing procedures that can accept arrays of any rank without creating multiple procedure overloads. They can only be used as dummy arguments in procedures and cannot be declared as local variables or function results. The rank of an assumed rank array is not known at compile-time and is determined at runtime from desriptor of the array which is used in the function/subroutine call. Only a limited set of operations are allowed on assumed-rank arrays, such as `rank`, `shape`, `size`, `lbound`, `ubound` where the results of the operation can be completely determined from the array descriptor. Other operations and functions can be performed by using the `select_rank` construct to handle different ranks explicitly. ```fortran subroutine f(x) integer :: a(..) end subroutine ``` Here, the `(..)` represents that the array `a` is an assumed-rank array. lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/IntegerBOZ.md0000664000175000017500000000225415174404631025602 0ustar alastairalastair# IntegerBOZ Integer typeless constants, Binary, Octal, and Hexadecimal. ## Declaration ### Syntax ```fortran IntegerBOZ(int v, integerboz intboz_type, ttype? type) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `v` | integer value | | `intboz_type` | integerboz = Binary | Hex | Octal | | `type` | table entry type | ### Return values The return value is the expression that the IntegerBOZ represents. ## Description **IntegerBOZ** represents integer **B**inary **O**ctal **H/Z**exadecimal constants. These are typeless numeric constants as their expressions assume data types based on how they are used. These constants are enclosed a string of appropriate digits in apostrophes and prefix it with the letter B, O, X, or Z. ## Types Only accepts integers and real. ## Examples ```fortran B'0001000' O'777' Z'FFF99A' ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(IntegerBOZ 8 Binary () ) (IntegerBOZ 511 Octal () ) (IntegerBOZ 16775578 Hex () )] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/RealBinOp.md0000664000175000017500000000306115174404631025442 0ustar alastairalastair# RealBinOp Real Binary Operation expression type. An **expr** node. ## Declaration ### Syntax ```fortran RealBinOp(expr left, binop op, expr right, ttype type, expr? value) ``` ### Arguments `left` and `right` represent expression on the left and right side of operator `op`. `type` represents table entry type and `value` represents expression. ### Return values The return value is the expression that the RealBinOp represents. ## Description **RealBinOp** represents real binary operation expression type. It is an ASR expr node. ASR has multiple binary expression types, for example: for Integer, real, complex, and logical. The binary operations accept two arguments of the same type. ## Types Only accepts real constants, real exponents, floating point values. ## Examples ```fortran (2.1+3.1)*5.1 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(RealBinOp (RealBinOp (RealConstant 2.100000 (Real 4 []) ) Add (RealConstant 3.100000 (Real 4 []) ) (Real 4 []) (RealConstant 5.200000 (Real 4 []) ) ) Mul (RealConstant 5.100000 (Real 4 []) ) (Real 4 []) (RealConstant 26.520000 (Real 4 []) ) )] ) ``` ## See Also [IntegerBinOp](IntegerBinOp.md), [ComplexBinOp](ComplexBinOp.md), [LogicalBinOp](LogicalBinOp.md) lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/IntegerCompare.md0000664000175000017500000000220315174404631026530 0ustar alastairalastair# IntegerCompare Integer comparison `expr` ASR node. ## Declaration ### Syntax ```fortran IntegerCompare(expr left, cmpop op, expr right, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`left` | left side of the comparison operand | |`right` | right side of the comparison operand | |`op` | comparison operator | |`type` | table entry type | |`value`| expression value| ### Return values The return value is the expression that the IntegerCompare represents. ## Description **IntegerCompare** represents integer comparison operation. Comparison operation can be: 1. Less than 2. Greater than 3. Less than or equal to 4. Greater than or equal to 5. Equal to ## Types Only accepts integers. ## Examples ```fortran 2 > 1 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(IntegerCompare (IntegerConstant 2 (Integer 4 [])) Gt (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []) ) )] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/ichar.md0000664000175000017500000000234115174404631024715 0ustar alastairalastair# Ichar Integer code for character. ## Declaration ### Syntax ```fortran Ichar(expr arg, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`arg`| expression argument | |`type` | table entry type| |`value`| value of expression | ### Return values The return value is the expression that the Ichar represents. ## Description **Ichar** represents integer code for character. ## Types Only accepts characters. ## Examples ```fortran integer :: i i = ichar(' ') ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { i: (Variable 1 i Local () () Default (Integer 4 []) Source Public Required .false. ) }) [(= (Var 1 i) (Ichar (StringConstant " " (Character 1 1 () []) ) (Integer 4 []) (IntegerConstant 32 (Integer 4 [])) ) () )] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/RealUnaryMinus.md0000664000175000017500000000211415174404631026543 0ustar alastairalastair# RealUnaryMinus Floating point unary minus operator as the second operand of binary arithmetic operators, a `expr` node. ## Declaration ### Syntax ```fortran RealUnaryMinus(expr arg, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`arg` | expression arguments | |`type`| table entry type | |`value`| expression value| ### Return values The return value is the expression that the RealUnaryMinus represents. ## Description **RealUnaryMinus** represents real unary minus operand of binary arithmetic operators, to be used without parantheses. Example : `a = b.x * -c.x` ## Types Only accepts floating point values, exponents. ## Examples ```fortran -1.2 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(RealUnaryMinus (RealConstant 1.200000 (Real 4 []) ) (Real 4 []) (RealConstant -1.200000 (Real 4 []) ) )] ) ``` ## See Also [IntegerUnaryMinus](IntegerUnaryMinus.md) lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/IfExp.md0000664000175000017500000000254015174404631024643 0ustar alastairalastair# IfExp If Expression, a `expr` ASR node. ## Declaration ### Syntax ```fortran IfExp(expr test, expr body, expr orelse, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |--|--| | `test`| expression to be tested | | `body`| 0 or more statements or constructs to be executed inside `if` | | `orelse` | construct to be executed if `if` fails | | `type` | table entry type | | `value` | expression | ### Return values The return value is the expression that the IfExp represents. ## Description **IfExp** represents If expression type. More information on `if` can be found in [if](../statement_nodes/if.md). ## Types Not applicable. ## Examples Following example code creates LFortran expression from ASR's `IntegerBinOp`: ```fortran program if if(1) error stop end ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { if: (Program (SymbolTable 2 { }) if [] [(If (IntegerConstant 1 (Integer 4 [])) [(ErrorStop () )] [] )] ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/ArrayItem.md0000664000175000017500000000331315174404631025524 0ustar alastairalastair# ArrayItem Array item, value stored at each index. ## Declaration ### Syntax ```fortran ArrayItem(expr v, array_index* args, ttype type, arraystorage storage_format, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`v` | expression | |`args` | array indeces | |`type` | table entry type | |`storage_format` | array storage format | |`value` | expression value | ### Return values The return value is the expression that the ArrayItem represents. ## Description **ArrayItem** represents Array Item. ## Types Only accepts array indexes. ## Examples ```fortran integer :: a(2) a(0) = 0 a(1) = 1 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { a: (Variable 1 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false. ) }) [(= (ArrayItem (Var 1 a) [(() (IntegerConstant 0 (Integer 4 [])) ())] (Integer 4 []) () ) (IntegerConstant 0 (Integer 4 [])) () ) (= (ArrayItem (Var 1 a) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) () ) (IntegerConstant 1 (Integer 4 [])) () )] ) ``` ## See Also [ArrayConstant](ArrayConstant.md) lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/CoarrayRef.md0000664000175000017500000000674015174404631025673 0ustar alastairalastair````markdown # CoarrayRef Coarray reference with image selectors. ## Declaration ### Syntax ``` CoarrayRef(expr var, array_index* coindices, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`var` | base variable or array reference expression (e.g., `x` or `x(i,j)`) | |`coindices` | coarray image selectors from `[...]` notation; array of `array_index` | |`type` | the result type of the coarray reference (same as element type of `var`) | |`value` | optional compile-time constant value (usually `nullptr`) | ### Return values The return value is the expression representing the coarray reference. ## Description **CoarrayRef** represents a reference to a coarray element with explicit image selectors. In Fortran, coarrays enable single-sided communication and data access across multiple images (processes/instances). The `CoarrayRef` node captures both the base data reference and the image indices that specify which images the data is being accessed from. The `coindices` field preserves the full list of coarray subscripts from the source code, enabling backends to: - Validate that the number of coindices matches the variable's corank - Generate appropriate runtime calls (e.g., MPI for distributed computing) - Implement single-image or multi-image execution strategies ## Semantic Properties - The base variable (`var`) must have `corank > 0` (be a coarray) - Number of `coindices` must equal the variable's `corank` - In single-image mode, coindices are typically ignored and the reference resolves to `var` - In multi-image mode, coindices determine which image(s) are accessed ## Types Accepts any expression that is a coarray (variable, struct member, or array reference). ## Examples ### Single Coindex ```fortran integer :: x[*] x[1] = 5 ! Access element on image 1 ``` ASR (simplified): ``` CoarrayRef( var = Var(x), coindices = [array_index(left=IntegerConstant(1), right=nullptr, step=nullptr)], type = Integer(4), value = nullptr ) ``` ### Array Coarray with Multiple Coindices ```fortran integer :: y(10)[*,*] ! 2D array with corank 2 y(2)[3,4] = 42 ! Access y(2) on image at position (3,4) ``` ASR (simplified): ``` CoarrayRef( var = ArrayItem( v = Var(y), args = [array_index(left=IntegerConstant(2))], type = Integer(4) ), coindices = [ array_index(left=IntegerConstant(3)), array_index(left=IntegerConstant(4)) ], type = Integer(4), value = nullptr ) ``` ### Struct Member Coarray ```fortran type :: mytype integer :: data[*] end type type(mytype) :: obj obj%data[2] = 10 ``` ASR (simplified): ``` CoarrayRef( var = StructInstanceMember(v=Var(obj), m=data, type=Integer(4)), coindices = [array_index(left=IntegerConstant(2))], type = Integer(4), value = nullptr ) ``` ## Backend Lowering ### Single-Image Mode (Current Default) In single-image execution, coindices are semantically validated but typically ignored during code generation, as all accesses are local to the current image. ### Multi-Image Mode (Future) Backends will use coindices to generate remote memory access operations via: - MPI (distributed computing) - Shared memory access (OpenMP, UPC-like) - Custom CAF (Coarray Fortran) runtime ## Related Nodes - `Variable` - tracks `corank` field to validate coindex count - `ArrayItem` - for indexing into array elements - `ArraySection` - for array slices - `Var` - for simple variable references ```` lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/ArrayRank.md0000664000175000017500000000304215174404631025520 0ustar alastairalastair# ArrayRank Rank of array. ## Declaration ### Syntax ```fortran ArrayRank(expr v, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`v` | expression | |`type` | table entry type | |`value` | expression value | ### Return values The return value is the expression that the ArrayRank represents. ## Description **ArrayRank** represents the rank (number of dimensions) of an array expression. - At *compile-time*, the rank is determined from the declared shape of the array. It can be used for all arrays except assumed-rank arrays where the rank is determined at runtime. It is stored in the `value` argument of the ASR Node. - At *runtime*, the rank is determined for assumed-rank arrays (`dimension(..)`) where the rank is not known at compile-time. It is determined at runtime using the descriptor of the array. ## Usage ## Compile-Time Usage ```fortran integer :: a(3) integer :: r r = rank(a) ``` ASR Node for the above example: ```clojure (ArrayRank (Var 2 a) (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) ``` Here the `value` argument of the ASR Node is `1` because the rank of array `a` is known at compile-time and it is `1`. ## Runtime Usage ```fortran integer :: a(..) integer :: r r = rank(a) ``` ASR Node for the above example: ```clojure (ArrayRank (Var 2 a) (Integer 4) () ) ``` Here the `value` argument of the ASR Node is empty because the rank of array `a` is not known at compile-time and it will be determined at runtime. lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/StringConcat.md0000664000175000017500000000210615174404631026224 0ustar alastairalastair# StringConcat String concatenation, an `expr` node. ## Declaration ### Syntax ```fortran StringConcat(expr left, expr right, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`left` | left string | |`right` | right string | |`type` | table entry type | |`value`| expression value | ### Return values The return value is the expression that the StringConcat represents. ## Description **StringConcat** represents string concatenation. Two strings can be combined one after the other using this node. ## Types Only accepts strings. ## Examples ```fortran "left"//"right" ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(StringConcat (StringConstant "left" (Character 1 4 () []) ) (StringConstant "right" (Character 1 5 () []) ) (Character 1 9 () []) (StringConstant "leftright" (Character 1 9 () []) ) )] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/IntegerBinOp.md0000664000175000017500000000312415174404631026154 0ustar alastairalastair# IntegerBinOp Integer Binary Operation expression type. An **expr** node. ## Declaration ### Syntax ```fortran IntegerBinOp(expr left, binop op, expr right, ttype type, expr? value) ``` ### Arguments `left` and `right` represent expression on the left and right side of operator `op`. `type` represents table entry type and `value` represents expression. ### Return values The return value is the expression that the IntegerBinOp represents. ## Description **IntegerBinOp** represents integer binary operation expression type. It is an ASR expr node. ASR has multiple binary expression types, for example: for Integer, real, complex, and logical. If an binary expression is applying binary operator on integer operands, `IntegerBinOp` is called which then creates LFortran expression `EXPR` using, `ASR::make_IntegerBinOp_t` method call. The binary operations accept two arguments of the same type. **IntegerBinOp** only accepts integers. ## Types Only accepts integers. ## Examples Following example code creates LFortran expression from ASR's `IntegerBinOp`: ```fortran (2+3)*5 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 5 (Integer 4 [])) ) Mul (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant 25 (Integer 4 [])) )] ) ``` ## See Also [RealBinOp](), [ComplexBinOp](), [LogicalBinOp]() lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/IntegerConstant.md0000664000175000017500000000245015174404631026737 0ustar alastairalastair# IntegerConstant Integer literal constant, an `expr` node. ## Declaration ### Syntax ```fortran IntegerConstant(int n, ttype type) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `n` | value of integer | | `type` | tabel entry type | ### Return values The return value is the expression that the IntegerConstant represents. ## Description **IntegerConstant** represents integer constant which consists of a optional plus or minus sign, followed by a string of decimal digits. No other characters are allowed except, a space. If no sign is present, the constant is assumed to be non negative. The value must be in the `INTEGER*4` range (-2147483648, 2147483647). If `INTEGER*8` range is (-9223372036854775808,9223372036854775807). ## Types Only accepts integers. ## Examples ```fortran +199 29002 -2147483648 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(IntegerConstant 199 (Integer 4 [])) (IntegerConstant 29002 (Integer 4 [])) (IntegerUnaryMinus (IntegerConstant 2147483648 (Integer 4 [])) (Integer 4 []) (IntegerConstant -2147483648 (Integer 4 [])) )] ) ``` ## See Also [RealConstant](RealConstant.md), [ComplexConstant](ComplexConstant.md). lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/ComplexConstant.md0000664000175000017500000000306015174404631026747 0ustar alastairalastair# ComplexConstant Complex literal constant, an `expr` node. ## Declaration ### Syntax ```fortran ComplexConstant(floar re, float im, ttype type) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `re` | value of real part | | `im` | value of imaginary part | | `type` | tabel entry type | ### Return values The return value is the expression that the ComplexConstant represents. ## Description **ComplexConstant** represents complex constant which consists of a optional imaginary part. Both real and imaginary part can have integer or floating point values, followed by a string of decimal digits, before or after decimal point. If no sign is present, the constant is assumed to be non negative. The value must be in the `Complex*8` range, uses 8 bytes of storage. The constants are separated by a comma, and the pair is enclosed in parentheses. The first constant is the real part, and the second is the imaginary part. ## Types Only accepts complex contants. ## Examples ```fortran (1.0, 2.1) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(ComplexConstructor (RealConstant 1.000000 (Real 4 []) ) (RealConstant 2.100000 (Real 4 []) ) (Complex 4 []) (ComplexConstant 1.000000 2.100000 (Complex 4 []) ) )] ) ``` ## See Also [IntegerConstant](IntegerConstant.md), [RealConstant](RealConstant.md). lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/IntegerUnaryMinus.md0000664000175000017500000000170715174404631027264 0ustar alastairalastair# IntegerUnaryMinus Uniry minus operator as the second operand of binary arithmetic operators, a `expr` node. ## Declaration ### Syntax ```fortran IntegerUnaryMinus(expr arg, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`arg` | expression arguments | |`type`| table entry type | |`value`| expression value| ### Return values The return value is the expression that the IntegerUnaryMinus represents. ## Description **IntegerUnaryMinus** represents integer unary minus operand of binary arithmetic operators, to be used without parantheses. Example : `a = b * -c` ## Types Only accepts integers. ## Examples ```fortran -1 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 [])) )] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/StringPhysicalCast.md0000664000175000017500000001326015174404631027407 0ustar alastairalastair# String Physical Cast Cast string physical type from [`DescriptorString`](../type_nodes/StringPhysicalType.md) to [`PointerString`](../type_nodes/StringPhysicalType.md) and vice versa ## Declaration ### Syntax ```ASDL StringPhysicalCast(expr arg, string_physical_type old, string_physical_type new, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | | ------------- | --------------------------------------------------------------------------------------------------------------------------- | | `arg` | String expression argument | | `old` | Current physical string type of the string expression `arg`.
**Possible values** : `DescriptorString`, `PointerString`. | | `new` | The target physical string type to cast to.
**Possible values** : `DescriptorString`, `PointerString`. | | `type` | Type of expression (It's always a string with physical type equivalent to `new` StringPhysicalType) | | `value` | The type of the expression. It is always a string type corresponding to the new StringPhysicalType. | ### Return values The return value is a string expression in the _new_ physical type. It's a message to the back end to know which physical type to use on this string expression. ## Description **StringPhysicalCast** casts the physical type from [`DescriptorString`](../type_nodes/StringPhysicalType.md) to [`PointerString`](../type_nodes/StringPhysicalType.md) and vice versa. It dispatches a message to the backend to cast the physical type of the passed string expression from one type to another, so we can do some runtime string operations like **assignment**, **slicing**, **printing** and **comparing** with no issues when using the *DescriptorString* `{char* data, int64 size, int64 capacity}` and also to keep using it and utilizing the size and capacity members when needed. **The intention behind casting from [`DescriptorString`](../type_nodes/StringPhysicalType.md) to [`PointerString`](../type_nodes/StringPhysicalType.md) :** - The intention is to tell the back end to operate on pointerString `char*`instead of the whole descriptorString llvm struct`{char* data, int64 size, int64 capacity}` - This happens by fetching `char* data` from the LLVM descriptor - **NOTE** : This kind of casting is widely used in the code base as most of the runtime operations use `char*` and don't need to utilize `size` and `capacity` member of the LLVM **The intention behind casting from [`PointerString`](../type_nodes/StringPhysicalType.md) to [`DescriptorString`](../type_nodes/StringPhysicalType.md):**\ - The intention is to tell the back end to operate on the whole descriptorString llvm struct`{char* data, int64 size, int64 capacity}` instead of pointerString `char*` - This happens by creating an LLVM struct (which represents the descriptorString) called `casted_string_ptr_to_desc` then we just make its internal `char*` point to the passed pointerString arg, and then we fill `size` and `capacity` with `-1` value to be an indication later for any function that utilizes these 2 values - telling it that this string is casted and it's originally a pointer (fixed memory location) and don't extend it. - **NOTE** : This isn't widely used in the code base unless we're dealing with some LHS-RHS kinda of operations on strings, that's where we make the two sides have equal physical string types *like function-argument passing*. apart from that, it makes our life easier when implementing LHS-RHS string expression visitors just be knowing a small fact that the internals of this LHS-RHS string expression are of descriptorString physical type. ## Types Only accepts strings. ## Examples ``` Fortran program main character(:),allocatable :: char_dynamic character(20):: char_fixed = "Hello World" char_dynamic = char_fixed char_fixed = char_dynamic print *, char_dynamic allocate(character(3) :: char_dynamic) end program main ``` ASR: ```Clojure (Assignment ; here we store char_fixed content into char_dynamic ; So We convert the physical type of rhs to the physical type of lhs by ; creating a StringPhysicalCast node. (Var 2 char_dynamic) (StringPhysicalCast (Var 2 char_fixed) PointerString DescriptorString (Allocatable (Character 1 20 () DescriptorString) ) () ) () ) (Assignment ;; Here happens the opposite ;; here we store char_dynamic content into char_fixed ;; To create a clean assignment in the back end we had to convert ;; the RHS side to the physical type of the LHS (Var 2 char_fixed) (StringPhysicalCast (Var 2 char_dynamic) DescriptorString PointerString (Allocatable (Character 1 -2 () PointerString) ) () ) () ) (Print (StringFormat () ;; StringFormat uses a runtime function to do handle the formatting ;; which means it operates on char* and doesn't utilized size or ;; capacity. This forces us to convert to pointerString. [(StringPhysicalCast (Var 2 char_dynamic) DescriptorString PointerString (Allocatable (Character 1 -2 () PointerString) ) () )] FormatFortran (Character -1 0 () PointerString) () ) ) ;; allocate utilizes size and capacity, so we don't cast here. (Allocate [((Var 2 char_dynamic) [] (IntegerConstant 3 (Integer 4) Decimal) ())] () () () ) ``` ## See Also [`PointerString`](../type_nodes/../type_nodes/StringPhysicalType.md), [`DescriptorString`](../type_nodes/../type_nodes/StringPhysicalType.md) lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/FunctionCall.md0000664000175000017500000001021115174404631026203 0ustar alastairalastair# FunctionCall Function Call expression type. ## Declaration ### Syntax ```fortran FunctionCall(symbol name, symbol? original_name, call_arg* args, ttype type, expr? value, expr? dt) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `name` | symbol name | | `original_name`| original name of the symbol | | `args` | arguments of the called function | | `type` | table entry type | | `value` | expression value | | `dt` | If non-null, this is a method call on the object given by `dt`. If null, this is a regular (non-method) function call. | ### Return values The return value is the expression that the `FunctionCall` represents. ## Description **FunctionCall** represents function call expression. ## Types Not applicable. ## Examples ```fortran program intrinsics integer, dimension(-1:1, -1:2) :: a print *, shape(a) ! (/ 3, 4 /) print *, size(shape(42)) ! (/ /) end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { intrinsics: (Program (SymbolTable 2 { a: (Variable 2 a Local () () Default (Integer 4 [((IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 [])) ) (IntegerConstant 3 (Integer 4 []))) ((IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 [])) ) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false. ), shape: (ExternalSymbol 2 shape 4 shape lfortran_intrinsic_builtin [] shape Private ) }) intrinsics [] [(Print () [(FunctionCall 2 shape () [((Var 2 a))] (Integer 4 []) () () )] () () ) (Print () [(ArraySize (FunctionCall 2 shape () [((IntegerConstant 42 (Integer 4 [])))] (Integer 4 []) () () ) () (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) )] () () )] ), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/ArraySection.md0000664000175000017500000000433215174404631026234 0ustar alastairalastair# ArraySection Section of Array. ## Declaration ### Syntax ```fortran ArraySection(expr v, array_index* args, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`v` | expression | |`args` | array index arguments | |`type` | table entry type | |`value` | expression value | ### Return values The return value is the expression that the ArraySection represents. ## Description **ArraySection** represents section of the array. ## Types Only accepts section of arrays. ## Examples ```fortran integer, dimension(3) :: x x(0) = 0 x(1) = 1 x(2) = 2 print *, x(1:) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { x: (Variable 1 x Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false. ) }) [(= (ArrayItem (Var 1 x) [(() (IntegerConstant 0 (Integer 4 [])) ())] (Integer 4 []) () ) (IntegerConstant 0 (Integer 4 [])) () ) (= (ArrayItem (Var 1 x) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) () ) (IntegerConstant 1 (Integer 4 [])) () ) (= (ArrayItem (Var 1 x) [(() (IntegerConstant 2 (Integer 4 [])) ())] (Integer 4 []) () ) (IntegerConstant 2 (Integer 4 [])) () ) (Print () [(ArraySection (Var 1 x) [((IntegerConstant 1 (Integer 4 [])) () (IntegerConstant 1 (Integer 4 [])))] (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) () )] () () )] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/ArrayMatMul.md0000664000175000017500000000531515174404631026031 0ustar alastairalastair# ArrayMatMul Array matrix multiplication. ## Declaration ### Syntax ```fortran ArrayMatMul(expr matrix_a, expr matrix_b, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`matrix_a` | matrix first | |`matrix_b` | second matrix | |`type` | table entry type | |`value | expression value |` ### Return values The return value is the expression that the ArrayMatMul represents. ## Description **ArrayMatMul** represents array matrix multiplication. ## Types Only accepts integers. ## Examples ```fortran integer :: a(3, 4) real :: b(4, 3), cmat(3, 3) cmat = matmul(a, b) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { a: (Variable 1 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false. ), b: (Variable 1 b Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false. ), cmat: (Variable 1 cmat Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false. ) }) [(= (Var 1 cmat) (ArrayMatMul (Var 1 a) (Var 1 b) (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) () ) () )] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/ArrayPack.md0000664000175000017500000000617515174404631025515 0ustar alastairalastair# ArrayPack Pack an array into an array of rank one. ## Declaration ### Syntax ```fortran ArrayPack(expr array, expr mask, expr? vector, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`array` | expression array | |`mask` | array mask | |`vector` | vector expression | |`type` | table entry type | |`value`| expression value | ### Return values The return value is the expression that the ArrayPack represents. ## Description **ArrayPack** stores the elements of array in an array or rank one. The beginning of the resulting array is made up of elements whose MASK equals TRUE. Afterwards, positions are filled with elements taken from VECTOR. The result is an array of rank one and the same type as that of ARRAY. If VECTOR is present, the result size is that of VECTOR, the number of TRUE values in MASK otherwise. ## Types Only accepts integers. ## Examples ```fortran integer :: m(6), p(2) m = [ 1, 0, 0, 0, 5, 0 ] p = pack(m, m /= 0) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { m: (Variable 1 m Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 6 (Integer 4 [])))]) Source Public Required .false. ), p: (Variable 1 p Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false. ) }) [(= (Var 1 m) (ArrayConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 0 (Integer 4 [])) (IntegerConstant 0 (Integer 4 [])) (IntegerConstant 0 (Integer 4 [])) (IntegerConstant 5 (Integer 4 [])) (IntegerConstant 0 (Integer 4 []))] (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 6 (Integer 4 [])))]) ) () ) (= (Var 1 p) (ArrayPack (Var 1 m) (IntegerCompare (Var 1 m) NotEq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ) () (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (ArraySize (IntegerCompare (Var 1 m) NotEq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ) () (Integer 4 []) () ))]) () ) () )] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/IntrinsicFunction.md0000664000175000017500000000744215174404631027306 0ustar alastairalastair# IntrinsicFunction An intrinsic function. An **expr** node. ## Declaration ### Syntax ``` IntrinsicFunction(expr* args, int intrinsic_id, int overload_id, ttype type, expr? value) ``` ### Arguments * `args` represents all arguments passed to the function * `intrinsic_id` is the unique ID of the generic intrinsic function * `overload_id` is the ID of the signature within the given generic function * `type` represents the type of the output * `value` is an optional compile time value ### Return values The return value is the expression that the `IntrinsicFunction` represents. ## Description **IntrinsicFunction** represents an intrinsic function (such as `Abs`, `Modulo`, `Sin`, `Cos`, `LegendreP`, `FlipSign`, ...) that either the backend or the middle-end (optimizer) needs to have some special logic for. Typically a math function, but does not have to be. IntrinsicFunction is both side-effect-free (no writes to global variables) and deterministic (no reads from global variables). They can be used inside parallel code and cached. There are two kinds: * `elemental`: the function is defined as a scalar function and it can be vectorized over any argument(s). Examples: `Sin`, `Cos`, `LegendreP`, `Abs` * `non-elemental`: it accepts arrays as arguments and the function cannot be defined as a scalar function. Examples: `Sum`, `Any`, `MinLoc` The `intrinsic_id` determines the generic function uniquely (`Sin` and `Abs` have different number, but `IntegerAbs` and `RealAbs` share the number) and `overload_id` uniquely determines the signature starting from 0 for each generic function (e.g., `IntegerAbs`, `RealAbs` and `ComplexAbs` can have `overload_id` equal to 0, 1 and 2, and `RealSin`, `ComplexSin` can be 0, 1). Backend use cases: Some architectures have special hardware instructions for operations like Sqrt or Sin and if they are faster than a software implementation, the backend will use it. This includes the `FlipSign` function which is our own "special function" that the optimizer emits for certain conditional floating point operations, and the backend emits an efficient bit manipulation implementation for architectures that support it. Middle-end use cases: the middle-end can use the high level semantics to simplify, such as `sin(e)**2 + cos(e)**2 -> 1`, or it could approximate expressions like `if (abs(sin(x) - 0.5) < 0.3)` with a lower accuracy version of `sin`. We provide ASR -> ASR lowering transformations that substitute the given intrinsic function with an ASR implementation using more primitive ASR nodes, typically implemented in the surface language (say a `sin` implementation using argument reduction and a polynomial fit, or a `sqrt` implementation using a general power formula `x**(0.5)`, or `LegendreP(2,x)` implementation using a formula `(3*x**2-1)/2`). This design also makes it possible to allow selecting using command line options how certain intrinsic functions should be implemented, for example if trigonometric functions should be implemented using our own fast implementation, `libm` accurate implementation, we could also call into other libraries. These choices should happen at the ASR level, and then the result further optimized (such as inlined) as needed. ## Types The argument types in `args` have the types of the corresponding signature as determined by `intrinsic_id`. For example `IntegerAbs` accepts an integer, but `RealAbs` accepts a real. ## Examples The following example code creates `IntrinsicFunction` ASR node: ```fortran sin(0.5) ``` ASR: ``` (TranslationUnit (SymbolTable 1 { }) [(IntrinsicFunction [(RealConstant 0.500000 (Real 4 []) )] 0 0 (Real 4 []) (RealConstant 0.479426 (Real 4 [])) )] ) ``` ## See Also [FunctionCall](FunctionCall.md) lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/TypeInquiry.md0000664000175000017500000000453215174404631026135 0ustar alastairalastair# TypeInquiry An **expr** node, which is used to represent the `Inquiry` intrinsic function whose value is computed based on the argument type. ## Declaration ### Syntax ```fortran TypeInquiry(int inquiry_id, ttype arg_type, expr? arg, ttype type, expr value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `inquiry_id` | Function unique ID | | `arg_type` | argument type | | `arg` | argument passed | | `type` | output type | | `value` | compile time value | ### Return value The return value is the expression that the TypeInquiry represents. ## Description **TypeInquiry** is used to represent the `Inquiry` function. This node accepts exactly one `ttype` as it's only argument (`arg_type`), and it returns a value depending on `inquiry_id` of `ttype` `type`. Since the type `arg_type` is known at compile time, also the compile time value is always present in `value`. There is an optional argument `arg` that specifies the variable used in the frontend language (used in LFortran, but not present in LPython/NumPy). Here a list of inquiry_id that we support so far | Inquiry function | Output | Output type | |------------------|--------------------------|-------------| | `Epsilon` | smallest number E | `arg_type` | | `Huge` | largest number | `arg_type` | | `Precision` | decimal precision | `int32` | | `Radix` | base of a numeric model | `int32` | | `Range` | decimal exponent range | `int32` | | `Rank` | rank of a data object | `int32` | | `Tiny` | smallest positive number | `arg_type` | > Note: All the functions output are computed based on the `arg_type` ## Types The `arg_type` and `type` vary for each inquiry_id signature. The output is either the default integer or the same as the argument type. ## Examples The following example code creates `TypeInquiry` ASR node: ```fortran print *, tiny(5.0) ``` ASR: ```clojure (Print [(TypeInquiry Tiny (Real 4) (RealConstant 5.000000 (Real 4) ) (Real 4) (RealConstant 0.000000 (Real 4) ) )] () () ) ``` ## See Also [IntrinsicFunction](IntrinsicFunction.md) lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/ComplexUnaryMinus.md0000664000175000017500000000257315174404631027300 0ustar alastairalastair# ComplexUnaryMinus Complex unary minus operator as the second operand of binary arithmetic operators, a `expr` node. ## Declaration ### Syntax ```fortran ComplexUnaryMinus(expr arg, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`arg` | expression arguments | |`type`| table entry type | |`value`| expression value| ### Return values The return value is the expression that the ComplexUnaryMinus represents. ## Description **ComplexUnaryMinus** represents complex unary minus operand of binary arithmetic operators, to be used without parantheses. Example : `z = -a + ic` ## Types Only accepts floating point values, exponents, integers. ## Examples ```fortran (-1.2, 3) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(ComplexConstructor (RealUnaryMinus (RealConstant 1.200000 (Real 4 []) ) (Real 4 []) (RealConstant -1.200000 (Real 4 []) ) ) (IntegerConstant 3 (Integer 4 [])) (Complex 4 []) (ComplexConstant -1.200000 3.000000 (Complex 4 []) ) )] ) ``` ## See Also [IntegerUnaryMinus](IntegerUnaryMinus.md), [RealUnaryMinus](RealUnaryMinus.md) lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/ArrayConstant.md0000664000175000017500000000402515174404631026420 0ustar alastairalastair# ArrayConstant Array constant. ## Declaration ### Syntax ```fortran ArrayConstant(expr* args, ttype type, arraystorage storage_format) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`args` | expression arguments | |`type` | table entry type | |`storage_format` | array storage format | ### Return values The return value is the expression that the Array Constant represents. ## Description **ArrayConstant** represents array constant. Array can be one or multi dimensional. The dimension of an array may be specified by a type specification statement `DIMENSION`. The value of the individual array elements of the array A may be initialized to the values 1, 2, 3, ..., 10. The assignment of the values of one array to another is allowed provided that both arrays in question have the same physical dimension. An array may be allocatable, i.e., it may be assigned memory storage during execution. ## Types Only accepts integers, floating points as values of array indexes. ## Examples ```fortran integer :: m(4) m = [ 1, 0, 0, 2 ] ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { m: (Variable 1 m Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false. ) }) [(= (Var 1 m) (ArrayConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 0 (Integer 4 [])) (IntegerConstant 0 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))] (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) ) () )] ) ``` ## See Also [IntegerConstant](IntegerConstant.md) lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/StringConstant.md0000664000175000017500000000167315174404631026616 0ustar alastairalastair# StringConstant A string of characters enclosed in apostrophes or quotes, an `expr` node. ## Declaration ### Syntax ```fortran StringConstant(string s, ttype type) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`s` | value of string | | `type` | table entry type | ### Return values The return value is the expression that the StringConstant represents. ## Description **StringConstant** represents string constant. Each character string constant appearing outside a DATA statement is followed by a null character to ease communication with C routines. ## Types Only accepts 1 or more characters. ## Examples ```fortran "string" ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(StringConstant "string" (Character 1 6 () []) )] ) ``` ## See Also [IntegerConstant](IntegerConstant.md), [RealConstant](RealConstant.md) lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/Cast.md0000664000175000017500000000536615174404631024533 0ustar alastairalastair# Cast Cast to different type and/or kind. ## Declaration ### Syntax ```fortran Cast(expr arg, cast_kind kind, ttype type, expr? value, expr? dest) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `arg`| expression argument | |`kind` | cast to kind | |`type` | table entry type | |`value`| expression value | |`dest`| use to get struct symbol of destination struct type | ### Return values The return value is the expression that the Cast represents. ## Description **Cast** represents cast to different type and/or kind. ## Types Only accepts integer, real. ## Examples ```fortran real :: r integer :: i r = 1. * 2 i = 1. * 2 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { i: (Variable 1 i Local () () Default (Integer 4 []) Source Public Required .false. ), r: (Variable 1 r Local () () Default (Real 4 []) Source Public Required .false. ) }) [(= (Var 1 r) (RealBinOp (RealConstant 1.000000 (Real 4 []) ) Mul (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []) ) ) (Real 4 []) (RealConstant 2.000000 (Real 4 []) ) ) () ) (= (Var 1 i) (Cast (RealBinOp (RealConstant 1.000000 (Real 4 []) ) Mul (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []) ) ) (Real 4 []) (RealConstant 2.000000 (Real 4 []) ) ) RealToInteger (Integer 4 []) (IntegerConstant 2 (Integer 4 [])) ) () )] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/Var.md0000664000175000017500000000767115174404631024372 0ustar alastairalastair# Var **Var** is an expression node that represents a reference to a declared variable, function, enum, etc. ## Declaration ### Syntax ```fortran Var(symbol v) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `v` | symbol name | ### Return values The return value is the expression that the Var represents. ## Description `Var` represents a declaration when used within an expression. Every declaration is represented in the symbol table, for example: * `integer :: x`: here `x` is represented by `Variable`, which has `type` as an "Integer" type, `type_declaration` is empty * `procedure(fn) :: x`: here `x` is represented by `Variable`, which has `type` as a "FunctionType" type, and `type_declaration` as a "Function" symbol representing the interface declaration "fn" * `function my_fn(...) ... end function`: represented by `Function` When these are to be used in an expression, one uses `Var` which points to one of these. For example, if we have a declaration `integer :: x`, then the assignment `x = 5` is represented as `(Assignment (Var 2 x) (IntegerConstant 5 (Integer 4 [])) ())`. Here `Var` points to the `Variable` symbol in the symbol table. See below for a full example. Another example: if `procedure(fn), pointer :: f`, then `f => myf` is represented by `(Associate (Var 2 f) (Var 2 myf))`, where `myf` is a `Function`. Most often `Var` points to a `Variable`. For referencing functions it points to `Function`. For enums it points to `Enum`. These can be hidden behind `ExternalSymbol`. It cannot point to any other symbol. ## Types `Var`'s argument `v` can point to the following symbols (and nothing else): * `Variable` (for expressions like `2*x+5` where `x` is a variable) * `Function` (for expressions like `myf`, where `myf` is a user defined function, such as passing it as a callback argument to a function call `call f(myf)`, or assigning to a pointer procedure variable `f => myf`) * `Enum` * `ExternalSymbol` (the above symbols can be behind an `ExternalSymbol` if they are declared in another module) ## Examples ```fortran program test_var integer :: x x = 5 print *, 3*x+5 end program ``` ASR: ``` (TranslationUnit (SymbolTable 1 { test_var: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4 []) Source Public Required .false. ) }) test_var [] [(= (Var 2 x) (IntegerConstant 5 (Integer 4 [])) () ) (Print () [(IntegerBinOp (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (Var 2 x) (Integer 4 []) () ) Add (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) () )] () () )] ) }) [] ) ``` ## See Also [Variable](../symbol_nodes/Variable.md) lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/RealConstant.md0000664000175000017500000000256315174404631026232 0ustar alastairalastair# RealConstant Real literal constant, an `expr` node. ## Declaration ### Syntax ```fortran RealConstant(floar r, ttype type) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `r` | value of real | | `type` | tabel entry type | ### Return values The return value is the expression that the RealConstant represents. ## Description **RealConstant** represents real constant which consists of a optional plus or minus sign, followed by a string of decimal digits, before or after decimal point. If no sign is present, the constant is assumed to be non negative. The value must be in the `REAL*4` range, uses 4 bytes of storage. It can have a decimal point or an exponent. ## Types Only accepts real constant, real exponent, floating point values. ## Examples ```fortran +199. -1.2 1.6E12 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(RealConstant 199.000000 (Real 4 []) ) (RealUnaryMinus (RealConstant 1.200000 (Real 4 []) ) (Real 4 []) (RealConstant -1.200000 (Real 4 []) ) ) (RealConstant 1600000000000.000000 (Real 4 []) )] ) ``` ## See Also [IntegerConstant](IntegerConstant.md), [ComplexConstant](ComplexConstant.md). lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/ArrayTranspose.md0000664000175000017500000000432015174404631026603 0ustar alastairalastair# ArrayTranspose Array or matrix transpose. ## Declaration ### Syntax ```fortran ArrayTranspose(expr matrix, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`matrix` | expression array, single or multi dimensional, square matrix | |`type` | table entry type | |`value` | expression value | ### Return values The return value is the expression that the ArrayTranspose represents. ## Description **ArrayTranspose** represents transpose of square matrix, where row are stored in column values and column values are store in rows. ## Types Only accepts integers. ## Examples ```fortran integer :: a(3, 4), b(4, 3) b = transpose(a) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { a: (Variable 1 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false. ), b: (Variable 1 b Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false. ) }) [(= (Var 1 b) (ArrayTranspose (Var 1 a) (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) () ) () )] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/implieddoloop.md0000664000175000017500000001057115174404631026473 0ustar alastairalastair# ImpliedDoLoop Implied Do Loop expression. ## Declaration ### Syntax ```fortran ImpliedDoLoop(expr* values, expr var, expr start, expr end, expr? increment, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `values` | expression value | | `var` | expression variables | | `start` | expression start | | `end` | expression end | | `increment | expression increment | | `type` | table entry type | | `value` | expression value | ### Return values The return value is the expression that the Implied Do Loop represents. ## Description **ImpliedDoLoop** represents implied do loop expression. The simples and most efficient way to read or write all elements of an array is to put its name, unsubscripted, in the data-transfer list. An `ImpliedDoLoop` allows the elements to be transferred selectively or in some non-standard order. The rules for an implied-DO are similar to that of an ordinary DO-loop but the loop forms a single item in the data-transfer list. ## Types Not applicable. ## Examples ```fortran program implied_do_loop integer :: j integer :: a(10)=(/(j,j=1,10)/) print*, (a(j),j=1,10) end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { intrinsics: (Program (SymbolTable 2 { a: (Variable 2 a Local () () Default (Integer 4 [((IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 [])) ) (IntegerConstant 3 (Integer 4 []))) ((IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 [])) ) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false. ), shape: (ExternalSymbol 2 shape 4 shape lfortran_intrinsic_builtin [] shape Private ) }) intrinsics [] [(Print () [(FunctionCall 2 shape () [((Var 2 a))] (Integer 4 []) () () )] () () ) (Print () [(ArraySize (FunctionCall 2 shape () [((IntegerConstant 42 (Integer 4 [])))] (Integer 4 []) () () ) () (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) )] () () )] ), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/ArraySize.md0000664000175000017500000000324615174404631025545 0ustar alastairalastair# ArraySize Size of array. ## Declaration ### Syntax ```fortran ArraySize(expr v, expr? dim, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`v` | expression | |`dim` | expression dimension | |`type` | table entry type | |`value` | expression value | ### Return values The return value is the expression that the ArraySize represents. ## Description **ArraySize** represents size of array. ## Types Only accepts integers. ## Examples ```fortran integer :: a(3) integer(8) :: size_a8 size_a8 = size(a, kind=8) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { a: (Variable 1 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false. ), size_a8: (Variable 1 size_a8 Local () () Default (Integer 8 []) Source Public Required .false. ) }) [(= (Var 1 size_a8) (ArraySize (Var 1 a) () (Integer 8 []) (IntegerConstant 3 (Integer 8 [])) ) () )] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/LogicalCompare.md0000664000175000017500000000236715174404631026520 0ustar alastairalastair# LogicalCompare Logical comparison `expr` ASR node. ## Declaration ### Syntax ```fortran LogicalCompare(expr left, cmpop op, expr right, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`left` | left side of the comparison operand | |`right` | right side of the comparison operand | |`op` | comparison operator | |`type` | table entry type | |`value`| expression value| ### Return values The return value is the expression that the LogicalCompare represents. ## Description **LogicalCompare** represents logical comparison operation. Comparison operation can be: 1. Equal to or not equal to `.TRUE.` 2. Equal to or not equal to `.FALSE.` ## Types Only accepts `.TRUE`, `.FALSE`. ## Examples ```fortran .FALSE. == .TRUE. ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(LogicalCompare (LogicalConstant .false. (Logical 4 []) ) Eq (LogicalConstant .true. (Logical 4 []) ) (Logical 4 []) (LogicalConstant .false. (Logical 4 []) ) )] ) ``` ## See Also [IntegerCompare](IntegerCompare.md) lfortran-0.63.0/doc/src/asr/asr_nodes/expression_nodes/ComplexConstructor.md0000664000175000017500000001131115174404631027501 0ustar alastairalastair# ComplexConstructor Complex constructor expression. ## Declaration ### Syntax ```fortran ComplexConstructor(expr re, expr im, ttype type, expr? value) ``` ### Arguments | Argument name | Argument Description | | --------------|----------------------| | `re` | real expression | | `im` | imaginary expression | | `ttype` | table entry type | | `value` | expression value | ### Return values The return value is the expression that the ComplexConstructor represents. ## Description **ComplexConstructor** represents constructor of complex type. A complex literal constant is a complex constructor where each expression if a pair of initialisation expressions. ## Types Only accepts complex and real types. The imaginary part can be 0 or can have value. ## Examples ```fortran program complex integer :: i = 42 real :: x = 3.14 complex :: z1, z2 z1 = cmplx(i, x) print *, z1, cmplx(x, kind=8) z2 = cmplx(z2, kind=8) end program complex ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { complex: (Program (SymbolTable 2 { i: (Variable 2 i Local (IntegerConstant 42 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false. ), x: (Variable 2 x Local (RealConstant 3.140000 (Real 4 []) ) () Save (Real 4 []) Source Public Required .false. ), z1: (Variable 2 z1 Local () () Default (Complex 4 []) Source Public Required .false. ), z2: (Variable 2 z2 Local () () Default (Complex 4 []) Source Public Required .false. ) }) complex [] [(= (Var 2 z1) (ComplexConstructor (Var 2 i) (Var 2 x) (Complex 4 []) () ) () ) (Print () [(Var 2 z1) (ComplexConstructor (Var 2 x) (RealConstant 0.000000 (Real 8 []) ) (Complex 8 []) () )] () () ) (= (Var 2 z2) (Var 2 z2) () )] ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/cast_kind_nodes/0000775000175000017500000000000015174404631023045 5ustar alastairalastairlfortran-0.63.0/doc/src/asr/asr_nodes/cast_kind_nodes/cast_kind.md0000664000175000017500000005321315174404631025332 0ustar alastairalastair# cast_kind Cast Kind nodes or cast kind types. ## Declaration ### Syntax ``` cast_kind = RealToInteger | IntegerToReal | LogicalToReal | RealToReal | IntegerToInteger | RealToComplex | IntegerToComplex | IntegerToLogical | RealToLogical | CharacterToLogical | CharacterToInteger | CharacterToList | ComplexToLogical | ComplexToComplex | ComplexToReal | ComplexToInteger | LogicalToInteger | RealToCharacter | IntegerToCharacter | LogicalToCharacter | ClassToStruct | ClassToClass ``` ### Arguments None. ### Return values None. ## Description **cast_kind** nodes or cast kind types denotes kinds to typecast one idenfier to another. `cast_kind` denotes the types supported for cast in LFortran. ## Types It denotes all types supported in LFortran, which are: 1. `RealToInteger` denotes `cast_kind` of `real` to `integer` type. 2. `IntegerToReal` denotes `cast_kind` of `integer` to `real` type. 3. `LogicalToReal` denotes `cast_kind` of `logical` to `real` type. 4. `RealToReal` denotes `cast_kind` of `Real` to `Real`. 5. `IntegerToInteger` denotes `cast_kind` of `integer` to `integer`. 6. `RealToComplex` denotes `cast_kind` of `Real` to `complex`. 7. `IntegerToComplex` denotes `cast_kind` of `integer` to `complex`. 8. `IntegerToLogical` denotes `cast_kind` of `integer` to `logical`. 9. `RealToLogical` denotes `cast_kind` of `real` to `logical`. 10. `CharacterToLogical` denotes `cast_kind` of `character` to `logical`. 11. `CharacterToInteger` denotes `cast_kind` of `character` to `integer`. 12. `CharacterToList` denotes `cast_kind` of `character` to `list`. 13. `ComplexToLogical` denotes `cast_kind` of `complex` to `logical`. 14. `ComplexToComplex` denotes `cast_kind` of `complex` to `complex`. 15. `ComplexToReal` denotes `cast_kind` of `complex` to `real`. 16. `ComplexToInteger` denotes `cast_kind` of `complex` to `integer`. 17. `LogicalToInteger` denotes `cast_kind` of `logical` to `integer`. 18. `RealToCharacter` denotes `cast_kind` of `real` to `character`. 19. `IntegerToCharacter` denotes `cast_kind` of `integer` to `character`. 20. `LogicalToCharacter` denotes `cast_kind` of `logical` to `character`. ## Examples Example for `RealToInteger`: ```fortran program types_03 implicit none real :: r integer :: i r = 1.5 print *, r i = r print *, i end program ``` ASR: ``` (TranslationUnit (SymbolTable 1 { types_03: (Program (SymbolTable 2 { i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false. ), r: (Variable 2 r Local () () Default (Real 4 []) Source Public Required .false. ) }) types_03 [] [(= (Var 2 r) (RealConstant 1.500000 (Real 4 []) ) () ) (Print () [(Var 2 r)] () () ) (= (Var 2 i) (Cast (Var 2 r) RealToInteger (Integer 4 []) () ) () ) (Print () [(Var 2 i)] () () )] ) }) [] ) ``` Example for `IntegerToReal`: ```fortran program types_02 implicit none real :: r integer :: i i = 1 r = 1 r = i end program ``` ASR: ``` (TranslationUnit (SymbolTable 1 { types_02: (Program (SymbolTable 2 { i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false. ), r: (Variable 2 r Local () () Default (Real 4 []) Source Public Required .false. ) }) types_02 [] [(= (Var 2 i) (IntegerConstant 1 (Integer 4 [])) () ) (= (Var 2 r) (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []) ) ) () ) (= (Var 2 r) (Cast (Var 2 i) IntegerToReal (Real 4 []) () ) () )] ) }) [] ) ``` Example of `RealToReal`: ```fortran program types_01 implicit none real :: r r = 1.0 r = 1.5 r = 1. r = float(2) r = dble(3) end program ``` ASR: ``` (TranslationUnit (SymbolTable 1 { types_01: (Program (SymbolTable 2 { r: (Variable 2 r Local () () Default (Real 4 []) Source Public Required .false. ) }) types_01 [] [(= (Var 2 r) (RealConstant 1.000000 (Real 4 []) ) () ) (= (Var 2 r) (RealConstant 1.500000 (Real 4 []) ) () ) (= (Var 2 r) (RealConstant 1.000000 (Real 4 []) ) () ) (= (Var 2 r) (Cast (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 []) (RealConstant 2.000000 (Real 8 []) ) ) RealToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []) ) ) () ) (= (Var 2 r) (Cast (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToReal (Real 8 []) (RealConstant 3.000000 (Real 8 []) ) ) RealToReal (Real 4 []) (RealConstant 3.000000 (Real 4 []) ) ) () )] ) }) [] ) ``` Example of `IntegerToLogical`: ```fortran program logical4 ! this program checks logical operators implicit none ! variable declaration logical :: a, b, c ! assigning values a = 2 b = -1 c = 0 print *, a, b, c end program logical4 ``` ASR: ``` (TranslationUnit (SymbolTable 1 { logical4: (Program (SymbolTable 2 { a: (Variable 2 a Local () () Default (Logical 4 []) Source Public Required .false. ), b: (Variable 2 b Local () () Default (Logical 4 []) Source Public Required .false. ), c: (Variable 2 c Local () () Default (Logical 4 []) Source Public Required .false. ) }) logical4 [] [(= (Var 2 a) (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToLogical (Logical 4 []) () ) () ) (= (Var 2 b) (Cast (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 [])) ) IntegerToLogical (Logical 4 []) () ) () ) (= (Var 2 c) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToLogical (Logical 4 []) () ) () ) (Print () [(Var 2 a) (Var 2 b) (Var 2 c)] () () )] ) }) [] ) ``` Example of `ComplexToComplex`: ```fortran program complex_dp complex(4) :: zero complex(8) :: v complex :: x zero = 0.0_4 v = (1.05_4, 1.05_4) x = (1.05_4, 1.05_8) print *, v, x, zero end program ``` ASR: ``` (TranslationUnit (SymbolTable 1 { complex_dp: (Program (SymbolTable 2 { v: (Variable 2 v Local () () Default (Complex 8 []) Source Public Required .false. ), x: (Variable 2 x Local () () Default (Complex 4 []) Source Public Required .false. ), zero: (Variable 2 zero Local () () Default (Complex 4 []) Source Public Required .false. ) }) complex_dp [] [(= (Var 2 zero) (Cast (RealConstant 0.000000 (Real 4 []) ) RealToComplex (Complex 4 []) (ComplexConstant 0.000000 0.000000 (Complex 4 []) ) ) () ) (= (Var 2 v) (Cast (ComplexConstructor (RealConstant 1.050000 (Real 4 []) ) (RealConstant 1.050000 (Real 4 []) ) (Complex 4 []) (ComplexConstant 1.050000 1.050000 (Complex 4 []) ) ) ComplexToComplex (Complex 8 []) () ) () ) (= (Var 2 x) (Cast (ComplexConstructor (RealConstant 1.050000 (Real 4 []) ) (RealConstant 1.050000 (Real 8 []) ) (Complex 8 []) (ComplexConstant 1.050000 1.050000 (Complex 8 []) ) ) ComplexToComplex (Complex 4 []) () ) () ) (Print () [(Var 2 v) (Var 2 x) (Var 2 zero)] () () )] ) }) [] ) ``` Example of `ClassToStruct/ClassToClass`: ```fortran select type(var) type is (base) print *, var%x class is (derived) print *, var%y end select ``` ASR: ``` ~select_type_block_: (Block (SymbolTable 5 { 1_base_x: (ExternalSymbol 5 1_base_x 3 x base [] x Public ) }) ~select_type_block_ [(Print (StringFormat () [(StructInstanceMember (Cast (Var 2 var) ClassToStruct (StructType [(Integer 4)] [] .true. .false. ) () (Var 2 base) ) 5 1_base_x (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), ~select_type_block_1: (Block (SymbolTable 6 { 1_derived_y: (ExternalSymbol 6 1_derived_y 4 y derived [] y Public ) }) ~select_type_block_1 [(Print (StringFormat () [(StructInstanceMember (Cast (Var 2 var) ClassToClass (StructType [(Integer 4)] [] .false. .false. ) () (Var 2 derived) ) 6 1_derived_y (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/0000775000175000017500000000000015174404631023112 5ustar alastairalastairlfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/assignment.md0000664000175000017500000003035015174404631025605 0ustar alastairalastair# Assignment Assignment statement, a **statement (stmt)** node. ## Declaration ### Syntax ```fortran Assignment(expr target, expr value, stmt? overloaded, bool realloc_lhs, bool move_allocation) ``` ### Arguments `target` contains expression target. `value` expressions giving the value to be assigned. `overloaded` denotes if overloaded. `realloc_lhs` denotes if target has to be reallocated to the size of value before the assignment. `move_allocation` denotes if this is a move assignment for allocatable arrays. ### Return values None. ## Description **assignment** statement assigns a value to a variable, substring, array element, record, or record field. The value can be a constant or the result of an expression. The kinds of assignment statements: are arithmetic, logical, character, and record assignments. If realloc_lhs is true then before the assignment the target is reallocated to the size of the value. move_allocation must only be true if both target and value are allocatable arrays of DescriptorArray physical type. The data pointer of value's descriptor is copied to the target's descriptor. And rest of the fields of value's descriptor are copied into target's descriptor. After the move, the data pointer of value's descriptor is set to null. ## Types Numeric type, a name of a variable, array element, or record field. Arithmentic expression, chracter constant, or a logical expression. ## Examples ```fortran module overload_assignment_m implicit none private public assignment (=) interface assignment (=) module procedure logical_gets_integer end interface contains subroutine logical_gets_integer(tf, i) logical, intent (out) :: tf integer, intent (in) :: i tf = (i == 0) end subroutine subroutine logical_gets_integer_use(tf, i) logical, intent (out) :: tf integer, intent (in) :: i tf = i end subroutine end module program main use overload_assignment_m, only: assignment(=) implicit none logical :: tf tf = 0 print *, "tf=0:", tf ! Yields: T tf = 1 print *, "tf=1:", tf ! Yields: F end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 5 { logical_gets_integer@~assign: (ExternalSymbol 5 logical_gets_integer@~assign 2 logical_gets_integer overload_assignment_m [] logical_gets_integer Private ), tf: (Variable 5 tf Local () () Default (Logical 4 []) Source Private Required .false. ), ~assign: (ExternalSymbol 5 ~assign 2 ~assign overload_assignment_m [] ~assign Private ) }) main [overload_assignment_m] [(= (Var 5 tf) (IntegerConstant 0 (Integer 4 [])) (SubroutineCall 5 logical_gets_integer@~assign 5 ~assign [((Var 5 tf)) ((IntegerConstant 0 (Integer 4 [])))] () ) ) (Print () [(StringConstant "tf=0:" (Character 1 5 () []) ) (Var 5 tf)] () () ) (= (Var 5 tf) (IntegerConstant 1 (Integer 4 [])) (SubroutineCall 5 logical_gets_integer@~assign 5 ~assign [((Var 5 tf)) ((IntegerConstant 1 (Integer 4 [])))] () ) ) (Print () [(StringConstant "tf=1:" (Character 1 5 () []) ) (Var 5 tf)] () () )] ), overload_assignment_m: (Module (SymbolTable 2 { logical_gets_integer: (Function (SymbolTable 3 { i: (Variable 3 i In () () Default (Integer 4 []) Source Private Required .false. ), tf: (Variable 3 tf Out () () Default (Logical 4 []) Source Private Required .false. ) }) logical_gets_integer [(Var 3 tf) (Var 3 i)] [(= (Var 3 tf) (IntegerCompare (Var 3 i) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ) () )] () Source Private Implementation () .false. .false. .false. .false. .false. [] [] .false. ), logical_gets_integer_use: (Function (SymbolTable 4 { i: (Variable 4 i In () () Default (Integer 4 []) Source Private Required .false. ), tf: (Variable 4 tf Out () () Default (Logical 4 []) Source Private Required .false. ) }) logical_gets_integer_use [(Var 4 tf) (Var 4 i)] [(= (Var 4 tf) (Var 4 i) (SubroutineCall 2 logical_gets_integer 2 ~assign [((Var 4 tf)) ((Var 4 i))] () ) )] () Source Private Implementation () .false. .false. .false. .false. .false. [] [] .false. ), ~assign: (CustomOperator 2 ~assign [2 logical_gets_integer] Public ) }) overload_assignment_m [] .false. .false. ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/fileclose.md0000664000175000017500000000320415174404631025400 0ustar alastairalastair# FileClose Close a file or disconnect a unit. ## Declaration ### Syntax ```fortran FileClose(int label, expr? unit, expr? iostat, expr? iomsg, expr? err, expr? status) ``` ### Arguments | Argument | Type | Description | | :--- | :--- | :--- | | `label` | `int` | Statement label. | | `unit` | `expr?` | Integer expression specifying the unit number to be closed. | | `iostat` | `expr?` | See [FileOpen mode behavior](fileopen.md#mode-behavior-brief) (`iostat` and `iomsg`). | | `iomsg` | `expr?` | See [FileOpen mode behavior](fileopen.md#mode-behavior-brief) (`iostat` and `iomsg`). | | `err` | `expr?` | Statement label to branch to if an error occurs. | | `status` | `expr?` | Character expression specifying the status of the file after closing (`'KEEP'` or `'DELETE'`). | ### Return values None. ## Description The `FileClose` node represents the Fortran `CLOSE` statement, which is used to disconnect an external file from a unit. ### Specifier behavior (brief) - `unit`: - Identifies the connected unit to close. - `status`: - `KEEP`: keep the file after closing. - `DELETE`: delete the file when closing. ```fortran close(unit=10, status='delete') ``` - `err`: - Statement label to branch to if an error occurs during close. ```fortran integer :: ios close(unit=10, iostat=ios, err=100) 100 continue ``` - `iostat` and `iomsg`: - See [FileOpen mode behavior](fileopen.md#mode-behavior-brief) (`iostat` and `iomsg`). ## Examples ```fortran close(10) ``` ASR: ``` (FileClose 0 (IntegerConstant 10 (Integer 4 [])) () () () () ) ``` ## See Also [FileOpen](fileopen.md) lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/whileloop.md0000664000175000017500000001134315174404631025440 0ustar alastairalastair# While Loop While statement of `do while` loop, a `stmt` node. ## Declaration ### Syntax ```fortran WhileLoop(expr test, stmt* body) ``` ### Arguments `test` contains expression to be tested. `body` contains 0 or more statements or constructs. ### Return values None. ## Description **While** statement of `do while` loop constitues `test` expression to be evaulated at each run on the `while` statement, and after first run. Execution proceeds as: 1. The specified expression is evaluated. 2. If the value of the expression is true, the statements in the range of the `DO WHILE` loop are executed. 3. If the value of the expression is false, control is transferred to the statement following the `DO WHILE` loop. ## Types Expression and pointer to body of the `DO WHILE loop`. ## Examples ```fortran program while implicit none integer :: i, j i = 1 j = 0 do while (i < 11) j = j + i i = i + 1 end do if (j /= 55) error stop if (i /= 11) error stop end ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { while_01: (Program (SymbolTable 2 { i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false. ), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false. ) }) while_01 [] [(= (Var 2 i) (IntegerConstant 1 (Integer 4 [])) () ) (= (Var 2 j) (IntegerConstant 0 (Integer 4 [])) () ) (WhileLoop (IntegerCompare (Var 2 i) Lt (IntegerConstant 11 (Integer 4 [])) (Logical 4 []) () ) [(= (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4 []) () ) () ) (= (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ) () )] ) (If (IntegerCompare (Var 2 j) NotEq (IntegerConstant 55 (Integer 4 [])) (Logical 4 []) () ) [(ErrorStop () )] [] ) (If (IntegerCompare (Var 2 i) NotEq (IntegerConstant 11 (Integer 4 [])) (Logical 4 []) () ) [(ErrorStop () )] [] )] ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/dictinsert.md0000664000175000017500000000036715174404631025612 0ustar alastairalastair# DictInsert ## Declaration ### Syntax ```fortran DictInsert(expr a, expr key, expr value) ``` ### Arguments ### Return values None. ## Description **DictInsert** ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/assign.md0000664000175000017500000000626515174404631024731 0ustar alastairalastair# Assign Assign function, a **statement (stmt)** node. ## Declaration ### Syntax ```fortran Assign(int label, identifier variable) ``` ### Arguments `label` contains statement label. `variable` contains integer variable. ### Return values None. ## Description **assign** statement assigns a statement label to a variable. The label is the label of an executable statement or a FORMAT statement. The integer variable, once assigned a statement label, can be reassigned the same statement label, a different label, or an integer. ## Types ## Examples ```fortran program assign integer :: x real :: y 10 format('(i3)') assign 10 to x 20 assign 10 to x ASSIGN 10 TO x 30 ASSIGN 10 TO y ! An integer variable is required in this context. end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { assign: (Program (SymbolTable 2 { x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false. ), y: (Variable 2 y Local () () Default (Real 4 []) Source Public Required .false. ) }) assign [] [(GoToTarget 10 10 ) (= (Var 2 x) (IntegerConstant 10 (Integer 4 [])) () ) (GoToTarget 20 20 ) (= (Var 2 x) (IntegerConstant 10 (Integer 4 [])) () ) (= (Var 2 x) (IntegerConstant 10 (Integer 4 [])) () ) (GoToTarget 30 30 ) (= (Var 2 y) (IntegerConstant 10 (Integer 4 [])) () )] ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/listinsert.md0000664000175000017500000000036515174404631025640 0ustar alastairalastair# ListInsert ## Declaration ### Syntax ```fortran ListInsert(expr a, expr pos, expr ele) ``` ### Arguments ### Return values None. ## Description **ListInsert** ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/explicitdeallocate.md0000664000175000017500000000116715174404631027300 0ustar alastairalastair# ExplicitDeallocate Deallocates if allocated otherwise throws a runtime error, a `stmt` ASR node. ## Declaration ### Syntax ```fortran ExplicitDeallocate(symbol* vars) ``` ### Arguments `vars` contains pointer target. ### Return values None. ## Description **ExplicitDeallocate** frees the storage allocated for allocatable variables and nonprocedure pointer targets. It also disassociates pointer. It is done by `Deallocate()` statement. If not allocated, it throws a runtime error. ## Types Name of variable, must be a pointer or allocatable variable. ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/goto.md0000664000175000017500000000262015174404631024404 0ustar alastairalastair# GoTo Branches to a statement label, a statement node. ## Declaration ### Syntax ```fortran GoTo(int target_id, identifier name) ``` ### Arguments `target_id` contains `int` IDs to link `GoTo` with GoToTarget. `name` contains the identifier name. ### Return values None. ## Description **GoTo** statement points to a GoToTarget with the corresponding `target_id` within the same procedure. We currently use `int` IDs to link GoTo with GoToTarget to avoid issues with serialization. ## Types Integer or `target_id` and a valid identifier name. ## Examples ```fortran program goto implicit none integer :: a a = 5 go to 1 1 print *, a end program ``` ASR: ```fortran (TranslationUnit [(Program goto_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () None ) [] [(a [] [] () None ())] () )] [(= 0 a 5 () ) (GoTo 0 () 1 [] () ) (Print 1 () [a] () )] [] )] ) ``` ## See Also [GoToTarget](gototarget.md) lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/filewrite.md0000664000175000017500000000530515174404631025431 0ustar alastairalastair# FileWrite Write data to a file. ## Declaration ### Syntax ```fortran FileWrite(int label, expr? unit, expr? iomsg, expr? iostat, expr? id, expr* values, expr? separator, expr? end, stmt? overloaded, bool is_formatted, symbol? nml, expr? rec, expr? pos) ``` ### Arguments | Argument | Type | Description | | :--- | :--- | :--- | | `label` | `int` | Statement label. | | `unit` | `expr?` | Integer expression specifying the unit number. | | `iomsg` | `expr?` | See [FileOpen mode behavior](fileopen.md#mode-behavior-brief) (`iostat` and `iomsg`). | | `iostat` | `expr?` | See [FileOpen mode behavior](fileopen.md#mode-behavior-brief) (`iostat` and `iomsg`). | | `id` | `expr?` | Integer expression for asynchronous I/O. | | `values` | `expr*` | List of expressions to write. | | `separator` | `expr?` | Separator expression. | | `end` | `expr?` | End of line expression. | | `overloaded` | `stmt?` | Overloaded statement (if any). | | `is_formatted` | `bool` | Whether the write is formatted. | | `nml` | `symbol?` | Namelist symbol (if using namelist I/O). | | `rec` | `expr?` | Record number for direct access I/O. | | `pos` | `expr?` | Integer expression for file position (stream I/O). | ### Return values None. ## Description The `FileWrite` node represents the Fortran `WRITE` statement, which is used to transfer data from the items in the output list or a namelist group to an external file or an internal file. ### Specifier behavior (brief) - `unit`: - Selects the external unit (or internal file expression) used as the write target. - `values`: - Output list of expressions/items written by the statement. - `id`: - Associates the statement with an asynchronous transfer identifier. - `rec`: - Record number for direct-access I/O writes. ```fortran write(unit=20, rec=5) row ``` - `pos`: - Sets/uses stream file position for stream access writes. - `nml`: - Namelist group symbol when the write is namelist-driven. ```fortran write(unit=30, nml=config) ``` - `separator` and `end`: - Optional output formatting controls used by lowered/internal write forms. - `is_formatted`: - Internal ASR flag indicating whether this write is treated as formatted transfer. - `overloaded`: - Internal lowered statement used when WRITE resolves through an overloaded procedure. - `iostat` and `iomsg`: - See [FileOpen mode behavior](fileopen.md#mode-behavior-brief) (`iostat` and `iomsg`). ## Examples ```fortran write(10, *) a, b ``` ASR: ``` (FileWrite 0 (IntegerConstant 10 (Integer 4 [])) () () () [(Var 2 a) (Var 2 b)] () () () .true. () () () ) ``` ## See Also [FileRead](fileread.md), [FileOpen](fileopen.md) lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/doconcurrentloop.md0000664000175000017500000003244715174404631027045 0ustar alastairalastair# DoConcurrentLoop DoConcurrentLoop specifies that there are no data dependencies between the iterations of a DO loop. ## Declaration ### Syntax ```fortran DoConcurrentLoop(do_loop_head head, expr* shared, expr* local, stmt* body) ``` ### Arguments `head` contains do loop concurrent header. `shared` contains a list of variables that are shared amongst all threads `local` contains a list of variables that are local to each thread `body` contains loop body. ### Return values None. ## Description **DoConcurrentLoop** specifies that there are no data dependencies between the iterations of a DO loop. Within the body of a `DoConcurrent` loop the program must adhere to a the list of restrictions specified on its use of Fortran language features. Actions that can't be executed in parallel or that don't allow all iterations to execute are prohibited, like: - Control flow statements which prevents the loop nest from executing all its iterations. - Image control statements, like `STOP`, `SYNC`, `ALLOCATE/DEALLOCATE`. `OMPPragma` is converted to `DoConcurrentLoop` in the AST->ASR phase. ## Types Accessible global identifier and a sequence of zero or more statements or construct that make the `DO` range. ## Examples ```fortran program doconcurrentloop implicit none real, dimension(10) :: a real :: sum integer :: N, i N = size(a) sum = 0 do concurrent (i = 1:N) a(i) = a(i-1) + 5 end do call arraySum(a, sum) contains subroutine arraySum(a, sum) real, intent(in) :: a(:) real, intent(out) :: sum do concurrent (i = 1:N) reduce(+: s) sum = sum + a(i) end do end subroutine end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { doconcurrentloop: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4)) (IntegerConstant 10 (Integer 4)))] FixedSizeArray ) () Source Public Required .false. ), arraysum: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. ), sum: (Variable 3 sum [] Out () () Default (Real 4) () Source Public Required .false. ) }) arraysum (FunctionType [(Array (Real 4) [(() ())] DescriptorArray ) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 sum)] [(DoConcurrentLoop ((Var 2 i) (IntegerConstant 1 (Integer 4)) (Var 2 n) ()) [] [] [(Assignment (Var 3 sum) (RealBinOp (Var 3 sum) Add (ArrayItem (Var 3 a) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (Real 4) () ) () )] )] () Public .false. .false. () ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. ), n: (Variable 2 n [] Local () () Default (Integer 4) () Source Public Required .false. ), sum: (Variable 2 sum [] Local () () Default (Real 4) () Source Public Required .false. ) }) doconcurrentloop [] [(Assignment (Var 2 n) (ArraySize (Var 2 a) () (Integer 4) (IntegerConstant 10 (Integer 4)) ) () ) (Assignment (Var 2 sum) (Cast (IntegerConstant 0 (Integer 4)) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) ) () ) (DoConcurrentLoop ((Var 2 i) (IntegerConstant 1 (Integer 4)) (Var 2 n) ()) [] [] [(Assignment (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (RealBinOp (ArrayItem (Var 2 a) [(() (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4)) (Integer 4) () ) ())] (Real 4) ColMajor () ) Add (Cast (IntegerConstant 5 (Integer 4)) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (Real 4) () ) () )] ) (SubroutineCall 2 arraysum () [((ArrayPhysicalCast (Var 2 a) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4)) (IntegerConstant 10 (Integer 4)))] DescriptorArray ) () )) ((Var 2 sum))] () )] ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/errorstop.md0000664000175000017500000000540115174404631025473 0ustar alastairalastair# ErrorStop Error termination, a statement node. ## Declaration ### Syntax ```fortran ErrorStop(expr? code) ``` ### Arguments `code` is an integer or default character constant expression and has the same meaning as for the `stop` statement. ### Return values May or may not return an error code. ## Description **ErrorStop** for error termination, happens otherwise on input/output, allocation or other such forms. It is useful for stopping all running images or processes. ## Types Name of variable, must be a pointer or allocatable variable. ## Examples ```fortran program errorstop implicit none integer :: i i = 0 do i = 1, 2 print i end do if (i /= 2) error stop print *, i end ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { errorstop: (Program (SymbolTable 2 { i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false. ) }) errorstop [] [(= (Var 2 i) (IntegerConstant 0 (Integer 4 [])) () ) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(Print (Var 2 i) [] () () )] ) (If (IntegerCompare (Var 2 i) NotEq (IntegerConstant 2 (Integer 4 [])) (Logical 4 []) () ) [(ErrorStop () )] [] ) (Print () [(Var 2 i)] () () )] ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/ifarithmetic.md0000664000175000017500000001514615174404631026113 0ustar alastairalastair# IfArithmetic The arithmetic `IF` statement branches to one of three specified statements, depending on the value of an arithmetic expression. ## Declaration ### Syntax ```fortran IfArithmetic(expr test, int lt_label, int eq_label, int gt_label) ``` ### Arguments `test` contains conditional expression to be evaluated. `lt_label` contains `eq_label` contains `gt_label` contains ### Return values None. ## Description **IfArithmetic** is the arithmetic `if` statement which branches to one of three specified statements, depending on the value of an arithmetic expression. ## Types `test` can be arithmetic expression of type integer, real, double precision, or quadruple precision. The other three lables are labels of executable statements. ## Examples ```fortran program ifarithmetic integer :: i i = 5 if (i == 5) print *, 'correct' if (i == 6) print *, 'incorrect' i = -2 40 i = i + 1 if (i) 50, 60, 70 50 print *, 'i < 0' go to 40 60 print *, 'i == 0' go to 40 70 print *, 'i > 0' end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { if1: (Program (SymbolTable 2 { i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false. ) }) if1 [] [(= (Var 2 i) (IntegerConstant 5 (Integer 4 [])) () ) (If (IntegerCompare (Var 2 i) Eq (IntegerConstant 5 (Integer 4 [])) (Logical 4 []) () ) [(Print () [(StringConstant "correct" (Character 1 7 () []) )] () () )] [] ) (If (IntegerCompare (Var 2 i) Eq (IntegerConstant 6 (Integer 4 [])) (Logical 4 []) () ) [(Print () [(StringConstant "incorrect" (Character 1 9 () []) )] () () )] [] ) (= (Var 2 i) (IntegerUnaryMinus (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) (IntegerConstant -2 (Integer 4 [])) ) () ) (GoToTarget 40 40 ) (= (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ) () ) (If (IntegerCompare (Var 2 i) Lt (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ) [(GoTo 50 50 )] [(If (IntegerCompare (Var 2 i) Gt (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ) [(GoTo 70 70 )] [(GoTo 60 60 )] )] ) (GoToTarget 50 50 ) (Print () [(StringConstant "i < 0" (Character 1 5 () []) )] () () ) (GoTo 40 40 ) (GoToTarget 60 60 ) (Print () [(StringConstant "i == 0" (Character 1 6 () []) )] () () ) (GoTo 40 40 ) (GoToTarget 70 70 ) (Print () [(StringConstant "i > 0" (Character 1 5 () []) )] () () )] ) }) [] ) ``` ## See Also [If](if.md) lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/filerewind.md0000664000175000017500000000241315174404631025564 0ustar alastairalastair# FileRewind Position a file at its beginning. ## Declaration ### Syntax ```fortran FileRewind(int label, expr? unit, expr? iostat, expr? err, expr? iomsg) ``` ### Arguments | Argument | Type | Description | | :--- | :--- | :--- | | `label` | `int` | Statement label. | | `unit` | `expr?` | Integer expression specifying the unit number. | | `iostat` | `expr?` | See [FileOpen mode behavior](fileopen.md#mode-behavior-brief) (`iostat` and `iomsg`). | | `err` | `expr?` | Statement label for error branching. | | `iomsg` | `expr?` | See [FileOpen mode behavior](fileopen.md#mode-behavior-brief) (`iostat` and `iomsg`). | ### Return values None. ## Description The `FileRewind` node represents the Fortran `REWIND` statement, which positions the specified file at its initial point. ### Specifier behavior (brief) - `unit`: - Identifies the connected unit to rewind. - `iostat` and `iomsg`: - See [FileOpen mode behavior](fileopen.md#mode-behavior-brief) (`iostat` and `iomsg`). - `err`: - Statement label to branch to if an error occurs during rewind. ## Examples ```fortran rewind(10) ``` ASR: ``` (FileRewind 0 (IntegerConstant 10 (Integer 4 [])) () () () ) ``` ## See Also [FileBackspace](filebackspace.md), [FileEndfile](fileendfile.md) lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/filebackspace.md0000664000175000017500000000161115174404631026207 0ustar alastairalastair# FileBackspace Position a file before the preceding record. ## Declaration ### Syntax ```fortran FileBackspace(int label, expr? unit, expr? iostat, expr? err) ``` ### Arguments | Argument | Type | Description | | :--- | :--- | :--- | | `label` | `int` | Statement label. | | `unit` | `expr?` | Integer expression specifying the unit number. | | `iostat` | `expr?` | See [FileOpen mode behavior](fileopen.md#mode-behavior-brief) (`iostat` and `iomsg`). | | `err` | `expr?` | Statement label for error branching. | ### Return values None. ## Description The `FileBackspace` node represents the Fortran `BACKSPACE` statement, which positions the specified file before the preceding record. ## Examples ```fortran backspace(10) ``` ASR: ``` (FileBackspace 0 (IntegerConstant 10 (Integer 4 [])) () () ) ``` ## See Also [FileRewind](filerewind.md), [FileEndfile](fileendfile.md) lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/fileopen.md0000664000175000017500000001722615174404631025245 0ustar alastairalastair# FileOpen Open a file or connect a unit to a file. ## Declaration ### Syntax ```fortran FileOpen(int label, expr? newunit, expr? filename, expr? status, expr? form, expr? access, expr? iostat, expr? iomsg, expr? action, expr? delim, expr? recl, expr? position, expr? blank, expr? encoding, expr? sign, expr? decimal, expr? round, expr? pad) ``` ### Arguments | Argument | Type | Description | | :--- | :--- | :--- | | `label` | `int` | Statement label. | | `newunit` | `expr?` | Integer variable that will receive the unit number assigned by the system. | | `filename` | `expr?` | Character expression specifying the name of the file to be opened. | | `status` | `expr?` | Character expression specifying the status of the file (`'OLD'`, `'NEW'`, `'SCRATCH'`, `'REPLACE'`, or `'UNKNOWN'`). | | `form` | `expr?` | Character expression specifying whether the file is connected for `'FORMATTED'` or `'UNFORMATTED'` I/O. | | `access` | `expr?` | Character expression specifying the access method (`'SEQUENTIAL'`, `'DIRECT'`, or `'STREAM'`). | | `iostat` | `expr?` | Integer variable that will receive the status of the I/O operation. | | `iomsg` | `expr?` | Character variable that will receive an error message if an error occurs. | | `action` | `expr?` | Character expression specifying the allowed actions (`'READ'`, `'WRITE'`, or `'READWRITE'`). | | `delim` | `expr?` | Character expression specifying the delimiter used for list-directed or namelist output (`'APOSTROPHE'`, `'QUOTE'`, or `'NONE'`). | | `recl` | `expr?` | Integer expression specifying the record length for the file. | | `position` | `expr?` | Character expression specifying the file position (`'ASIS'`, `'REWIND'`, or `'APPEND'`). | | `blank` | `expr?` | Character expression specifying how blanks in numeric fields are interpreted (`'NULL'` or `'ZERO'`). | | `encoding` | `expr?` | Character expression specifying the encoding of the file (`'UTF-8'` or `'DEFAULT'`). | | `sign` | `expr?` | Character expression specifying the sign mode for formatted output (`'PLUS'`, `'SUPPRESS'`, or `'PROCESSOR_DEFINED'`). | | `decimal` | `expr?` | Character expression specifying the decimal mode for formatted I/O (`'COMMA'` or `'POINT'`). | | `round` | `expr?` | Character expression specifying the rounding mode for formatted output (`'UP'`, `'DOWN'`, `'ZERO'`, `'NEAREST'`, `'COMPATIBLE'`, or `'PROCESSOR_DEFINED'`). | | `pad` | `expr?` | Character expression specifying the padding mode for formatted input (`'YES'` or `'NO'`). | ### Return values None. ## Description The `FileOpen` node represents the Fortran `OPEN` statement, which is used to connect an external file to a unit, create a new file and connect it to a unit, or change certain specifiers of a connection between a file and a unit. ### Mode behavior (brief) - `newunit`: - If `newunit` is present, the system will select an available unit number and return it in `newunit`. - If `newunit` is not present, the unit number must be specified in the `filename` argument. - `label`: - Statement label for branching on error. - `iostat` and `iomsg`: - `iostat` receives a processor-dependent status code for the I/O statement. - A value of `0` indicates success; nonzero values indicate error or end conditions. - `iomsg` receives a processor-provided diagnostic message when a nonzero `iostat` condition is reported. ```fortran integer :: ios character(len=256) :: msg open(unit=10, file="data.txt", status="old", iostat=ios, iomsg=msg) ``` - `status`: - `OLD`: file must already exist. - `NEW`: file must not exist. - `SCRATCH`: connect to a temporary unnamed file (typically deleted on close). - `REPLACE`: replace if exists, otherwise create. - `UNKNOWN`: processor/runtime chooses behavior when file existence is unknown. ```fortran open(unit=10, file="out.txt", status="replace") ``` - `form`: - `FORMATTED`: text I/O. - `UNFORMATTED`: binary-like record I/O. ```fortran open(unit=20, file="data.bin", form="unformatted") ``` - `access`: - `SEQUENTIAL`: read/write in order. - `DIRECT`: fixed-length records (`recl=` needed). - `STREAM`: byte stream (no record boundaries). ```fortran open(unit=30, file="tbl.dat", access="direct", recl=128) ``` - `action`: - `READ`, `WRITE`, `READWRITE` control permitted operations. ```fortran open(unit=40, file="in.txt", action="read") ``` - `delim` (list-directed/namelist output): - `QUOTE`: uses `"text"`. - `APOSTROPHE`: uses `'text'`. - `NONE`: no delimiters around character values. ```fortran open(unit=41, file="out.txt", delim="quote") ``` - `position`: - `REWIND`: start of file. - `APPEND`: end of file. - `ASIS`: keep current position. ```fortran open(unit=50, file="log.txt", position="append") ``` - `blank` (formatted numeric input): - `NULL`: ignore embedded blanks in numeric input fields. - `ZERO`: interpret embedded blanks as zeros. ```fortran open(unit=51, file="nums.txt", blank="zero") ``` - `encoding`: - `UTF-8`: UTF-8 encoded text stream. - `DEFAULT`: processor default encoding. ```fortran open(unit=52, file="utf8.txt", encoding="utf-8") ``` - `sign` (formatted numeric output): - `PLUS`: always print sign for positive and negative values. - Example effect: `+3`, `-3` - `SUPPRESS`: do not print `+` for positive values; still print `-` for negatives. - Example effect: `3`, `-3` - `PROCESSOR_DEFINED`: use compiler/runtime default sign behavior. ```fortran open(unit=53, file="nums.txt", sign="plus") ! write(53,'(F5.1)') 3.0 -> " +3.0" ! write(53,'(F5.1)') -3.0 -> " -3.0" ``` - `decimal` (formatted I/O): - `POINT`: decimal point, e.g., `3.14`. - `COMMA`: decimal comma, e.g., `3,14`. ```fortran open(unit=54, file="nums.txt", decimal="comma") ``` - `round` (formatted output rounding mode): - `UP`: round away from zero at halfway and above. - Example effect (`1.26` to one decimal): `1.3` - `DOWN`: round toward zero. - Example effect (`1.26` to one decimal): `1.2` - `ZERO`: round toward zero (same direction idea as `DOWN` for many cases). - Example effect (`-1.26` to one decimal): `-1.2` - `NEAREST`: round to nearest representable result. - `COMPATIBLE`: round in a processor-compatible mode. - `PROCESSOR_DEFINED`: compiler/runtime default rounding mode. ```fortran open(unit=55, file="nums.txt", round="down") ! write(55,'(F4.1)') 1.26 -> "1.2" ``` - `pad` (formatted input only): - `YES`: if a read needs more characters than remain in the record, missing characters are treated as blanks. - `NO`: no blank padding; attempting to read past record end can raise an end-of-record condition. ```fortran ! File line is only: "12" open(unit=60, file="nums.txt", form="formatted", pad="yes") read(60, '(A4)') s ! s becomes "12 " (padded with blanks) ``` ```fortran ! Same file line: "12" open(unit=61, file="nums.txt", form="formatted", pad="no") read(61, '(A4)') s ! no padding; read can hit end-of-record ``` - `recl`: - For `DIRECT` access, specifies the record length in file storage units (processor dependent). - Required when `access="DIRECT"`. ```fortran open(unit=70, file="data.dat", access="direct", recl=256) ``` ## Examples ```fortran open(unit=10, file="test.txt", status="old") ``` ASR: ``` (FileOpen 0 () (StringConstant "test.txt") (StringConstant "old") () () () () () () () () () () () () () () ) ``` ## See Also [FileClose](fileclose.md), [FileInquire](fileinquire.md) lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/nullify.md0000664000175000017500000000650715174404631025126 0ustar alastairalastair# Nullify Disassociates a pointer from a target, a `stmt` node. ## Declaration ### Syntax ```fortran Nullify(symbol* vars) ``` ### Arguments `vars` contains pointer object to symbol variables. ### Return values None. ## Description **Nullify** disassociates a pointer from a target. The initial disassociation status of a pointer is undefined. It is used to `NULLIFY` to initialize an undefined pointer, giving it disassociated status. ## Types ## Examples ```fortran program nullify implicit none integer, pointer :: p1, p2 integer, target :: t1 p1=>t1 p2=>t1 p1 = 1 nullify(p1, p2) end ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { nullify: (Program (SymbolTable 2 { p1: (Variable 2 p1 Local () () Default (Pointer (Integer 4 []) ) Source Public Required .false. ), p2: (Variable 2 p2 Local () () Default (Pointer (Integer 4 []) ) Source Public Required .false. ), t1: (Variable 2 t1 Local () () Default (Integer 4 []) Source Public Required .false. ) }) nullify [] [(=> (Var 2 p1) (Var 2 t1) ) (=> (Var 2 p2) (Var 2 t1) ) (= (Var 2 p1) (IntegerConstant 1 (Integer 4 [])) () ) (Nullify [2 p1 2 p2] )] ) }) [] ) ``` ## See Also [Flush](flush.md) lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/where.md0000664000175000017500000000175615174404631024557 0ustar alastairalastair# Where Where, masks the evaluation of expression and assignments of values in array assignment statements, a `stmt` node. ## Declaration ### Syntax ```fortran Where(expr test, stmt* body, stmt* orelse) ``` ### Arguments `test` contains condition or expression to be tested. `body` contains statement body. `orelse` contains the else condition if `where` is not true or served. ### Return values None. ## Description **Where** statement masks the evaluation of expression and assignments of values in array assignment statements. It does this according to the value of logical array expression. If the `where` statement is not the first statement of `where` construct, it can be used as the terminal statement of a `do` or `do while` construct. ## Types Not applicable. ## Examples ```fortran program main real :: x(10) x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] where (x/=5) x = 32.0 elsewhere x = 0.0 end where print *, x end program ``` ASR: ```fortran ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/fileinquire.md0000664000175000017500000002030615174404631025751 0ustar alastairalastair# FileInquire Inquire about file properties. ## Declaration ### Syntax ```fortran FileInquire(int label, expr? unit, expr? file, expr? iostat, expr? err, expr? exist, expr? opened, expr? number, expr? named, expr? name, expr? access, expr? sequential, expr? direct, expr? form, expr? formatted, expr? unformatted, expr? recl, expr? nextrec, expr? blank, expr? position, expr? action, expr? read, expr? write, expr? readwrite, expr? delim, expr? pad, expr? flen, expr? blocksize, expr? convert, expr? carriagecontrol, expr? size, expr? pos, expr? iolength, expr* iolength_vars, expr? decimal, expr? sign, expr? encoding, expr? stream, expr? iomsg, expr? round, expr? pending, expr? asynchronous) ``` ### Arguments For details on the arguments, see [FileOpen](fileopen.md#arguments). The `FileInquire` node shares many of the same arguments as `FileOpen`, but they are all optional and used to receive information about the file or unit rather than to specify properties for opening a file. | Argument | Type | Description | | :--- | :--- | :--- | | `label` | `int` | Statement label. See [FileOpen](fileopen.md#arguments). | | `unit` | `expr?` | Integer expression specifying the unit number. | | `file` | `expr?` | Character expression specifying the file name. | | `iostat` | `expr?` | See [FileOpen mode behavior](fileopen.md#mode-behavior-brief) (`iostat` and `iomsg`). | | `err` | `expr?` | Statement label for error branching. | | `exist` | `expr?` | Logical variable to receive existence state. | | `opened` | `expr?` | Logical variable to receive connection state. | | `number` | `expr?` | Integer variable to receive unit number. | | `named` | `expr?` | Logical variable to receive whether file has a name. | | `name` | `expr?` | Character variable to receive file name. | | `access` | `expr?` | See [FileOpen arguments](fileopen.md#arguments) (`access`). | | `sequential` | `expr?` | Character variable to receive whether sequential access is allowed. | | `direct` | `expr?` | Character variable to receive whether direct access is allowed. | | `form` | `expr?` | See [FileOpen arguments](fileopen.md#arguments) (`form`). | | `formatted` | `expr?` | Character variable to receive whether formatted I/O is allowed. | | `unformatted` | `expr?` | Character variable to receive whether unformatted I/O is allowed. | | `recl` | `expr?` | See [FileOpen arguments](fileopen.md#arguments) (`recl`). | | `nextrec` | `expr?` | Integer variable to receive next record number. | | `blank` | `expr?` | See [FileOpen arguments](fileopen.md#arguments) (`blank`). | | `position` | `expr?` | See [FileOpen arguments](fileopen.md#arguments) (`position`). | | `action` | `expr?` | See [FileOpen arguments](fileopen.md#arguments) (`action`). | | `read` | `expr?` | Character variable to receive whether reading is allowed. | | `write` | `expr?` | Character variable to receive whether writing is allowed. | | `readwrite` | `expr?` | Character variable to receive whether reading/writing is allowed. | | `delim` | `expr?` | See [FileOpen arguments](fileopen.md#arguments) (`delim`). | | `pad` | `expr?` | See [FileOpen arguments](fileopen.md#arguments) (`pad`). | | `flen` | `expr?` | Integer variable to receive file length. | | `blocksize` | `expr?` | Integer variable to receive block size. | | `convert` | `expr?` | Character variable to receive conversion mode. | | `carriagecontrol`| `expr?` | Character variable to receive carriage control mode. | | `size` | `expr?` | Integer variable to receive file size. | | `pos` | `expr?` | Integer variable to receive file position. | | `iolength` | `expr?` | Integer variable to receive I/O list length. | | `iolength_vars` | `expr*` | List of variables for IOLENGTH inquiry. | | `decimal` | `expr?` | See [FileOpen arguments](fileopen.md#arguments) (`decimal`). | | `sign` | `expr?` | See [FileOpen arguments](fileopen.md#arguments) (`sign`). | | `encoding` | `expr?` | See [FileOpen arguments](fileopen.md#arguments) (`encoding`). | | `stream` | `expr?` | Character variable to receive whether stream access is allowed. | | `iomsg` | `expr?` | See [FileOpen mode behavior](fileopen.md#mode-behavior-brief) (`iostat` and `iomsg`). | | `round` | `expr?` | See [FileOpen arguments](fileopen.md#arguments) (`round`). | | `pending` | `expr?` | Logical variable to receive whether an asynchronous transfer is pending for the unit. | | `asynchronous` | `expr?` | Character variable to receive asynchronous capability/mode information for the connection. | ### Return values None. ## Description The `FileInquire` node represents the Fortran `INQUIRE` statement, which is used to inquire about the properties of a particular file or of the connection to a particular unit. ### Specifier behavior (brief) - `unit` and `file`: - Select inquiry target by connected unit (`unit=`) or by file path (`file=`). - In practice, one target selector is typically used per inquiry. - `iostat` and `iomsg`: - See [FileOpen mode behavior](fileopen.md#mode-behavior-brief) (`iostat` and `iomsg`). - `access`, `form`, `recl`, `blank`, `position`, `action`, `delim`, `pad`, `decimal`, `sign`, `encoding`, `round`: - These report connection modes using the same value families documented for OPEN. - See [FileOpen mode behavior](fileopen.md#mode-behavior-brief). - `exist`: - Returns whether the file exists. - Typical values: `.true.` / `.false.`. ```fortran logical :: ex inquire(file="data.txt", exist=ex) ``` - `opened`: - Returns whether the file or unit is currently connected. ```fortran logical :: is_open inquire(unit=10, opened=is_open) ``` - `number`: - Returns the connected unit number (if one exists for the file inquiry). - `named` and `name`: - `named` indicates whether the connected file has a name. - `name` returns that file name when available. ```fortran logical :: has_name character(len=256) :: fname inquire(unit=10, named=has_name, name=fname) ``` - `sequential`, `direct`, `stream`: - Return whether each access form is allowed for the connection. - Common processor values are character results like `"YES"`, `"NO"`, or `"UNKNOWN"`. - `formatted`, `unformatted`: - Return whether formatted or unformatted transfer is allowed. - Common processor values are character results like `"YES"`, `"NO"`, or `"UNKNOWN"`. - `read`, `write`, `readwrite`: - Return whether corresponding data transfer modes are permitted. - Common processor values are character results like `"YES"`, `"NO"`, or `"UNKNOWN"`. - `pending` and `asynchronous`: - `pending` reports whether an asynchronous I/O operation is currently pending. - `asynchronous` reports asynchronous I/O mode/capability for the connection (for example values similar to `"YES"`, `"NO"`, or `"UNKNOWN"`). - `nextrec`: - For direct-access connections, returns the next record number for sequential processing. - `size` and `pos`: - `size` returns file size in file storage units (processor dependent). - `pos` returns current file position for stream access. - `flen` and `blocksize`: - Return processor-dependent file length and block size information when available. - `convert`: - Returns processor/runtime data conversion mode for the connection. - `carriagecontrol`: - Returns carriage control mode for formatted records, when supported by the processor. - `iolength` and `iolength_vars`: - `iolength` requests inquiry-by-I/O-list mode. - `iolength_vars` is the I/O list used to compute transfer length, and no other INQUIRE specifiers are allowed at the same time. ```fortran integer :: n, i real :: x inquire(iolength=n) i, x ``` - `err`: - Label to branch to if an error occurs during the inquiry. ```fortran integer :: ios inquire(unit=10, iostat=ios, err=100, opened=is_open) 100 continue ``` ## Examples ```fortran inquire(unit=10, opened=is_open) ``` ASR: ``` (FileInquire 0 (IntegerConstant 10 (Integer 4 [])) () () () () (Var 2 is_open) () () () () () () () () () () () () () () () () () () () () () () () () () () [] () () () () () () () () ) ``` ## See Also [FileOpen](fileopen.md) lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/selectrank.md0000664000175000017500000000346115174404631025573 0ustar alastairalastair# SelectRank Select Rank statement, a `stmt` node. ## Declaration ### Syntax ```fortran SelectRank(identifier? name, expr selector, rank_stmt* body, stmt* default) ``` ### Arguments `name` is an optional construct name for the select rank construct. When present, it allows `exit` statements to reference this construct by name (e.g., `exit my_rank`). This corresponds to the Fortran named construct syntax `my_rank: select rank(x)`. `selector` contains the expression whose rank is tested. `body` contains 0 or more rank statement branches. `default` contains 0 or more statements executed when no rank branch matches (corresponds to `rank default`). ### Return values None. ## Description **SelectRank** executes different blocks of code depending on the rank of an assumed-rank array argument. The selector must be an assumed-rank (`dimension(..)`) dummy argument. Each `rank_stmt` branch specifies either a particular integer rank (`rank(N)`) or the unranked case (`rank(*)`). If the actual rank matches, the corresponding block is executed. If no branch matches and a `default` block is present, that block is executed instead. Named select rank constructs (using the `name` field) allow an `exit` statement inside the body to transfer control out of the construct, e.g.: ```fortran rank_loop: select rank(x) rank(1) if (some_condition) exit rank_loop rank(2) ... end select rank_loop ``` ## Types Optional identifier, expression, and pointers to rank statement branches and default body. ## Examples ```fortran subroutine foo(input) class(*), dimension(..), intent(in) :: input rank_select: select rank(input) rank(1) select type(input) type is(real) exit rank_select end select end select rank_select end subroutine ``` ## See Also [Select](select.md) lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/allocate.md0000664000175000017500000000440415174404631025222 0ustar alastairalastair# Allocate Allocate an allocatable variable. ## Declaration ### Syntax ```fortran Allocate(alloc_arg* args, expr? stat, expr? errmsg, expr? source) ``` ### Arguments Input argument of `args`, `stat` of type expression, `errmsg` of type expression, and `source` of type expression. `args` contains the arrays to be allocated. `stat` is a variable to receive the status integer (success/failure). `errmsg` is variable to receive error message. `source` contains the source location. `source` will not do a copy, it will only use it for a runtime decision how to allocate. ### Return values None. ## Description **allocate** allocates all arrays in `args` to the sizes specified in the `alloc_arg`. ## Types Only accepts integer whole number value, that can be allocated on available heap memory. ## Examples Following example code allocates a memory block of size 2: ```fortran program allocate_mem real, allocatable :: a(:) allocate(a(3)) end program ``` ASR: ``` (TranslationUnit (SymbolTable 1 { allocate_mem: (Program (SymbolTable 2 { a: (Variable 2 a Local () () Allocatable (Real 4 [(() ())]) Source Public Required .false. ) }) allocate_mem [] [(Allocate [(2 a [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))])] () () () ) (ImplicitDeallocate [2 a] )] ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/gototarget.md0000664000175000017500000000717015174404631025620 0ustar alastairalastair# GoToTarget A target of zero or more GoTo statements, a stmt node. ## Declaration ### Syntax ```fortran GoToTarget(int id, identifier name) ``` ### Arguments `id` contains target unique id within a procedure. `name` contins identifier name. ### Return values None. ## Description **GoToTarget** is an empty statement, a target of zero or more GoTo statements. The `id` is only unique within a procedure. ## Types Integer for `id` and name of the identifier. ## Examples ```fortran program gototarget 1000 if (0<1) assign 15 to k 100 goto k 15 print *, "run" end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Optional .false. ) }) main [] [(GoToTarget 1000 1000 ) (If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Lt (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []) ) ) [(= (Var 2 k) (IntegerConstant 15 (Integer 4 [])) () )] [] ) (GoToTarget 100 100 ) (Select (Var 2 k) [(CaseStmt [(IntegerConstant 100 (Integer 4 []))] [(GoTo 100 100 )] ) (CaseStmt [(IntegerConstant 1000 (Integer 4 []))] [(GoTo 1000 1000 )] ) (CaseStmt [(IntegerConstant 15 (Integer 4 []))] [(GoTo 15 15 )] )] [] ) (GoToTarget 15 15 ) (Print () [(StringConstant "run" (Character 1 3 () []) )] () () )] ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/blockcall.md0000664000175000017500000002027615174404631025371 0ustar alastairalastair# BlockCall Call to block symbol, a `stmt` node. ## Declaration ### Syntax ```fortran BlockCall(int label, symbol m) ``` ### Arguments `label` contains integer value of a label. `m` points to the Block symbol to call. ### Return values None. ## Description **BlockCall** signifies the block symbol call. The Block represents a scoped collection of statements and its own symbol table. The Block itself is part of a symbol table, and the BlockCall node is used to call it in order to execute the statements inside the block i.e., once the control reaches the `BlockCall` only then the statements inside the block it refers to are executed. Find more information on [block](../symbol_nodes/symbol.md). ## Types `label` must be of type integer. `m` must be of type symbol. ## Examples ```fortran program block integer :: a a = 10 1 loop: block integer :: b a = a + 5 if (a == 15) go to 1 b = a / 2 call square(b) end block loop end program block subroutine square(b) integer :: b, result result = b * b if (result /= 100) error stop print *, result end subroutine square ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { block: (Program (SymbolTable 2 { a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false. ), block: (Block (SymbolTable 4 { b: (Variable 4 b Local () () Default (Integer 4 []) Source Public Required .false. ) }) block [(= (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) () ) () ) (If (IntegerCompare (Var 2 a) Eq (IntegerConstant 15 (Integer 4 [])) (Logical 4 []) () ) [(GoTo 1 1 )] [] ) (= (Var 4 b) (IntegerBinOp (Var 2 a) Div (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) () ) () ) (SubroutineCall 1 square () [((Var 4 b))] () )] ) }) block [] [(= (Var 2 a) (IntegerConstant 10 (Integer 4 [])) () ) (GoToTarget 1 1 ) (BlockCall -1 2 block )] ), square: (Function (SymbolTable 3 { b: (Variable 3 b Unspecified () () Default (Integer 4 []) Source Public Required .false. ), result: (Variable 3 result Local () () Default (Integer 4 []) Source Public Required .false. ) }) square [(Var 3 b)] [(= (Var 3 result) (IntegerBinOp (Var 3 b) Mul (Var 3 b) (Integer 4 []) () ) () ) (If (IntegerCompare (Var 3 result) NotEq (IntegerConstant 100 (Integer 4 [])) (Logical 4 []) () ) [(ErrorStop () )] [] ) (Print () [(Var 3 result)] () () )] () Source Public Implementation () .false. .false. .false. .false. .false. [] [] .false. ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/cptrtopointer.md0000664000175000017500000001530315174404631026352 0ustar alastairalastair# CPtrToPointer Associtates a data pointer with the target of a C pointer and specifies its shape, a `stmt` node. ## Declaration ### Syntax ```fortran CPtrToPointer(expr cptr, expr ptr, expr? shape) ``` ### Arguments `cptr` contains the C address of an interoperable data entity, or the result of a reference to function `C_LOC` with a noninteroperable argument. If the value of `cptr` is the C address of a Fortran varible, it must have the `TARGET` attribute. `ptr` contains data pointer. If it is an array, `shape` must be specified. `shape` is of type integer and rank one. Its size equals the rank of `ptr`. ### Return values None. ## Description **CPtrToPointer** is the statement node for conversion from C pointer to data pointer. If the `ptr` is an array, it has the shape specified by `shape` and each lower bound is 1. ## Types `cptr` and `ptr` should be of type pointer holding an address. `shape` must be of type integer. ## Examples ```fortran program bindc use iso_c_binding, only: c_loc, c_ptr, c_f_pointer type(c_ptr) :: queries integer :: idx = 1 integer(2), pointer :: x integer(2), target :: y call c_f_pointer(queries, x) print *, c_loc(x), queries x => y print *, c_loc(x), c_loc(y) end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { bindc: (Program (SymbolTable 2 { c_f_pointer: (ExternalSymbol 2 c_f_pointer 4 c_f_pointer lfortran_intrinsic_iso_c_binding [] c_f_pointer Public ), c_loc: (ExternalSymbol 2 c_loc 4 c_loc lfortran_intrinsic_iso_c_binding [] c_loc Public ), c_ptr: (ExternalSymbol 2 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), idx: (Variable 2 idx Local (IntegerConstant 1 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false. ), queries: (Variable 2 queries Local () () Default (CPtr) Source Public Required .false. ), x: (Variable 2 x Local () () Default (Pointer (Integer 2 []) ) Source Public Required .false. ), y: (Variable 2 y Local () () Default (Integer 2 []) Source Public Required .false. ) }) bindc [iso_c_binding] [(CPtrToPointer (Var 2 queries) (Var 2 x) () ) (Print () [(PointerToCPtr (Var 2 x) (CPtr) () ) (Var 2 queries)] () () ) (=> (Var 2 x) (Var 2 y) ) (Print () [(PointerToCPtr (Var 2 x) (CPtr) () ) (PointerToCPtr (GetPointer (Var 2 y) (Pointer (Integer 2 []) ) () ) (CPtr) () )] () () )] ), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/assert.md0000664000175000017500000000162315174404631024737 0ustar alastairalastair# Assert Test for condition or expression to be true, a stmt node. ## Declaration ### Syntax ```fortran Assert(expr test, expr? msg) ``` ### Arguments `test` contains the expression or condition to be tested for true. `msg` contains the error message if the condition tested is not true and assert fails. ### Return values None. ## Description **Assert** statement consists of the `assert` keyword, the expression or conditoon to test, and an optional message. The condtion or expression being tested is always true. If the assertion expression or conditoon is true, nothing happens and the program unit continues to normal executions otherwise the program unit is halted and aborted at `assert` statement, when it fails. ## Types Expression for condtion and message to be printed. ## Examples ```fortran program assert implicit none ASSERT(.true.) end program ``` ASR: ```fortran ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/print.md0000664000175000017500000000556115174404631024577 0ustar alastairalastair# Print Print statement, a stmt node. ## Declaration ### Syntax ```fortran Print(expr? fmt, expr* values, expr? separator, expr? end) ``` ### Arguments `fmt` contains format identifier `values` contains pointer to values of expression. `separator` contains separator for expressions. `end` contains end of expressions. ### Return values None. ## Description **Print** statement writes from a list to `stdout`. `fmt` the format identifier can be: - An asterist (\*), which indicates list-directed I/O. - The lable of a `FORMAT` statement that appears in the same program unit. - An integer variable name that has been assigned the label of a `FORMAT` statement that appears in the same program unit. - A character expression or interger array that specifies the format string. ## Types format indetifier and expressions. ## Examples ```fortran program print implicit none real :: pi pi = 3.141592 print "(f6.3)", pi print *, pi print 10 10 format(3x, "print") end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { print1: (Program (SymbolTable 2 { pi: (Variable 2 pi Local () () Default (Real 4 []) Source Public Required .false. ) }) print1 [] [(= (Var 2 pi) (RealConstant 3.141592 (Real 4 []) ) () ) (Print (StringConstant "(f6.3)" (Character 1 6 () []) ) [(Var 2 pi)] () () ) (Print () [(Var 2 pi)] () () ) (Print (IntegerConstant 10 (Integer 4 [])) [] () () ) (GoToTarget 10 10 )] ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/exit.md0000664000175000017500000000530415174404631024407 0ustar alastairalastair# Exit Immediate termination of the program with status, a statement node. ## Declaration ### Syntax ```fortran Exit() ``` ### Arguments None. ### Return values `STATUS` is passed to the parent process or calling process on exit. ## Description **Exit** causes immediate termination of the program with status. If status is omitted it returns the canonical `succes` for the system. It is useful for exit from loops or process. ## Types Not applicable. ## Examples ```fortran program exit implicit none integer :: i i = 1 do i = i + 1 if (i == 10) exit end do end program exit ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { doloop_08: (Program (SymbolTable 2 { i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false. ) }) doloop_08 [] [(= (Var 2 i) (IntegerConstant 1 (Integer 4 [])) () ) (WhileLoop (LogicalConstant .true. (Logical 4 []) ) [(= (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ) () ) (If (IntegerCompare (Var 2 i) Eq (IntegerConstant 3 (Integer 4 [])) (Logical 4 []) () ) [(Exit)] [] )] )] ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/select.md0000664000175000017500000000037115174404631024714 0ustar alastairalastair# Select ## Declaration ### Syntax ```fortran Select(expr test, case_stmt* body, stmt* default) ``` ### Arguments ### Return values None. ## Description **Select** ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/associate.md0000664000175000017500000002053415174404631025413 0ustar alastairalastair# Associate Associate statement, a **statement (stmt)** node. ## Declaration ### Syntax ```fortran Associate(expr target, expr value) ``` ### Arguments `target` contains expression target. `value` contains expression value. ### Return values None. ## Description **associate** statement creates an association between an idetifier and a variable, or the value of an expression, during the execution of that comstruct. The idetifier specified becomes an associating entity. The name of the associating entity is an associate name. ## Types Identifier and variable. ## Examples ```fortran module stdlib_string_type contains elemental subroutine unused_dummy_argument(dummy) class(*), intent(in) :: dummy associate(dummy => dummy); end associate end subroutine unused_dummy_argument subroutine read_formatted(v_list) integer, intent(in) :: v_list(:) call unused_dummy_argument(v_list) end subroutine end module ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { stdlib_string_type: (Module (SymbolTable 2 { read_formatted: (Function (SymbolTable 5 { v_list: (Variable 5 v_list In () () Default (Integer 4 [(() ())]) Source Public Required .false. ) }) read_formatted [(Var 5 v_list)] [(SubroutineCall 2 unused_dummy_argument () [((Var 5 v_list))] () )] () Source Public Implementation () .false. .false. .false. .false. .false. [] [] .false. ), unused_dummy_argument: (Function (SymbolTable 3 { associate_block: (AssociateBlock (SymbolTable 6 { dummy: (Variable 6 dummy Local () () Default (Pointer (Class 3 ~unlimited_polymorphic_type [] ) ) Source Private Required .false. ) }) associate_block [(=> (Var 6 dummy) (Var 3 dummy) )] ), dummy: (Variable 3 dummy In () () Default (Class 3 ~unlimited_polymorphic_type [] ) Source Public Required .false. ), ~unlimited_polymorphic_type: (StructType (SymbolTable 4 { }) ~unlimited_polymorphic_type [] Source Public () ) }) unused_dummy_argument [(Var 3 dummy)] [(AssociateBlockCall 3 associate_block )] () Source Public Implementation () .false. .false. .false. .false. .false. [] [] .false. ) }) stdlib_string_type [] .false. .false. ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/fileread.md0000664000175000017500000000703115174404631025210 0ustar alastairalastair# FileRead Read data from a file. ## Declaration ### Syntax ```fortran FileRead(int label, expr? unit, expr? fmt, expr? iomsg, expr? iostat, expr? advance, expr? size, expr? id, expr? pos, expr* values, stmt? overloaded, bool is_formatted, symbol? nml, expr? rec, expr? pad) ``` ### Arguments | Argument | Type | Description | | :--- | :--- | :--- | | `label` | `int` | Statement label. | | `unit` | `expr?` | Integer expression specifying the unit number. | | `fmt` | `expr?` | Format specification. | | `iomsg` | `expr?` | See [FileOpen mode behavior](fileopen.md#mode-behavior-brief) (`iostat` and `iomsg`). | | `iostat` | `expr?` | See [FileOpen mode behavior](fileopen.md#mode-behavior-brief) (`iostat` and `iomsg`). | | `advance` | `expr?` | Character expression (`'YES'` or `'NO'`) for non-advancing I/O. | | `size` | `expr?` | Integer variable to receive the number of characters read. | | `id` | `expr?` | Integer expression for asynchronous I/O. | | `pos` | `expr?` | Integer expression for file position (stream I/O). | | `values` | `expr*` | List of variables to read into. | | `overloaded` | `stmt?` | Overloaded statement (if any). | | `is_formatted` | `bool` | Whether the read is formatted. | | `nml` | `symbol?` | Namelist symbol (if using namelist I/O). | | `rec` | `expr?` | Record number for direct access I/O. | | `pad` | `expr?` | Character expression for padding mode. For details, see [FileOpen](fileopen.md#arguments). | ### Return values None. ## Description The `FileRead` node represents the Fortran `READ` statement, which is used to transfer data from an external file or an internal file to the items in the input list or a namelist group. ### Specifier behavior (brief) - `unit`: - Selects the external unit (or internal file expression) used as the read source. - `fmt`: - Selects formatted input interpretation. - Typical forms include explicit format strings and list-directed input (`*`). ```fortran read(10, '(I5,1X,F8.3)') i, x read(10, *) i, x ``` - `advance` (formatted sequential I/O): - `YES`: normal advancing read (default behavior). - `NO`: non-advancing read; the file position stays on the current record. ```fortran read(10, '(A)', advance='no', size=n) chunk ``` - `size`: - Receives the number of characters transferred in a non-advancing formatted read. - `id`: - Associates the statement with an asynchronous transfer identifier. - `pos`: - Sets/uses stream file position for stream access reads. - `rec`: - Record number for direct-access I/O. ```fortran read(unit=20, rec=5) row ``` - `values`: - Input list of variables/items populated by the read. - `is_formatted`: - Internal ASR flag indicating whether this read is treated as formatted transfer. - `overloaded`: - Internal lowered statement used when READ resolves through an overloaded procedure. - `nml`: - Namelist group symbol when the read is namelist-driven. ```fortran read(unit=30, nml=config) ``` - `pad`: - Uses OPEN-compatible padding mode semantics for formatted input. - See [FileOpen mode behavior](fileopen.md#mode-behavior-brief). - `iostat` and `iomsg`: - See [FileOpen mode behavior](fileopen.md#mode-behavior-brief) (`iostat` and `iomsg`). ## Examples ```fortran read(10, *) a, b ``` ASR: ``` (FileRead 0 (IntegerConstant 10 (Integer 4 [])) () () () () () () () [(Var 2 a) (Var 2 b)] () .true. () () () ) ``` ## See Also [FileWrite](filewrite.md), [FileOpen](fileopen.md) lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/listremove.md0000664000175000017500000000035215174404631025625 0ustar alastairalastair# ListRemove ## Declaration ### Syntax ```fortran ListRemove(expr a, expr ele) ``` ### Arguments ### Return values None. ## Description **ListRemove** ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/stop.md0000664000175000017500000000516115174404631024424 0ustar alastairalastair# Stop To terminate execution of the program. ## Declaration ### Syntax ```fortran Stop(expr? code) ``` ### Arguments `code` contains string of less than or equal to 5 digits or a character constant. ### Return values None. ## Description **Stop** statement terminates execution of the program. The argument `code` is displayed when the program stops. If nothing is specified, no message is displayed. ## Types Expression for optional `code` input parameter. ## Examples ```fortran program stop implicit none integer :: x x = (2+3)*5 if (x == 25) stop end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { stop: (Program (SymbolTable 2 { x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false. ) }) stop [] [(= (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 5 (Integer 4 [])) ) Mul (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant 25 (Integer 4 [])) ) () ) (If (IntegerCompare (Var 2 x) Eq (IntegerConstant 25 (Integer 4 [])) (Logical 4 []) () ) [(Stop () )] [] )] ) }) [] ) ``` ## See Also [Return](return.md) lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/forallsingle.md0000664000175000017500000000603315174404631026117 0ustar alastairalastair# ForAllSingle For array assignments, a statement node. ## Declaration ### Syntax ```fortran ForAllSingle(do_loop_head head, stmt assign_stmt) ``` ### Arguments `head` contains do loop head. `assign_stmt` contains assignment statement. ### Return values None. ## Description **ForAllSingle** is for array assginment. It - can access unusual sections, - can use indices in RHS expression - can use indirection (vector subscripting). ## Types Array or vector. ## Examples ```fortran program forall_01 implicit none integer :: ivec(3), i forall(i=1:3) ivec(i)=i print *,ivec end program forall_01 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { forall_01: (Program (SymbolTable 2 { i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false. ), ivec: (Variable 2 ivec Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false. ) }) forall_01 [] [(ForAllSingle ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])) ()) (= (ArrayItem (Var 2 ivec) [(() (Var 2 i) ())] (Integer 4 []) ColMajor () ) (Var 2 i) () ) ) (Print () [(Var 2 ivec)] () () )] ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/fileendfile.md0000664000175000017500000000155315174404631025706 0ustar alastairalastair# FileEndfile Write an end-of-file record. ## Declaration ### Syntax ```fortran FileEndfile(int label, expr? unit, expr? iostat, expr? err) ``` ### Arguments | Argument | Type | Description | | :--- | :--- | :--- | | `label` | `int` | Statement label. | | `unit` | `expr?` | Integer expression specifying the unit number. | | `iostat` | `expr?` | See [FileOpen mode behavior](fileopen.md#mode-behavior-brief) (`iostat` and `iomsg`). | | `err` | `expr?` | Statement label for error branching. | ### Return values None. ## Description The `FileEndfile` node represents the Fortran `ENDFILE` statement, which writes an end-of-file record to the specified file. ## Examples ```fortran endfile(10) ``` ASR: ``` (FileEndfile 0 (IntegerConstant 10 (Integer 4 [])) () () ) ``` ## See Also [FileRewind](filerewind.md), [FileBackspace](filebackspace.md) lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/listappend.md0000664000175000017500000000041415174404631025576 0ustar alastairalastair# ListAppend Append to list, a `stmt` node. ## Declaration ### Syntax ```fortran ListAppend(expr a, expr ele) ``` ### Arguments ### Return values None. ## Description **ListAppend** ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/implicitdeallocate.md0000664000175000017500000000121715174404631027265 0ustar alastairalastair# ImplicitDeallocate Deallocates if allocated otherwise does nothing, a `stmt` ASR node. ## Declaration ### Syntax ```fortran ImplicitDeallocate(symbol* vars) ``` ### Arguments `vars` contains pointer target. ### Return values None. ## Description **ImplicitDeallocate** frees the storage allocated for allocatable variables and nonprocedure pointer targets. It also disassociates pointer. It is done by `Deallocate()` statement. If not allocated, it does nothing. ## Types Name of variable, must be a pointer or allocatable variable. ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also [explicitdeallocate](explicitdeallocate.md) lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/listclear.md0000664000175000017500000000033515174404631025417 0ustar alastairalastair# ListClear ## Declaration ### Syntax ```fortran ListClear(expr a) ``` ### Arguments ### Return values None. ## Description **ListClear** ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/if.md0000664000175000017500000000407115174404631024034 0ustar alastairalastair# If Conditionally executes on block of statements depending on the evaluation of a logical expression, a `stmt` node. ## Declaration ### Syntax ```fortran If(expr test, stmt* body, stmt* orelse) ``` ### Arguments `test` contains statement or condition to be tested. `body` contains block of 0 or more statements to be executed as per evaluation of `test`. `orelse` contains pointer target to `else` block. ### Return values None. ## Description **If** conditionally executes one block of constructs or statements depending on the evaluation of a logical expression. If a construct name is specfied at the beginning of an `IF THEN` statement, the same name must appear in the corresponding `END IF` statement. If a construct name is specified on an `ELSE IF` or `ELSE` statement, the same name must appear in the corresponding `IF THEN` and `END IF` statements. Depending on the evaluation of the logical expression, one block or no block is executed. The logical expressions are evaluated in the order in which they appear, until a true value is found or an `ELSE` or `END IF` statement is encountered. Once a true value is found or an `ELSE` statement is encountered, the block immediately following it is executed and the construct execution terminates. ## Types expression and block of statements, including a pointer. ## Examples ```fortran program if implicit none if (.false.) error stop end ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { if_01: (Program (SymbolTable 2 { }) if_01 [] [(If (LogicalConstant .false. (Logical 4 []) ) [(ErrorStop () )] [] )] ) }) [] ) ``` ## See Also [IfArithmetic](ifarithmetic.md) lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/return.md0000664000175000017500000000431715174404631024760 0ustar alastairalastair# Return Return statement to return control to the calling program unit, a stmt node. ## Declaration ### Syntax ```fortran Return() ``` ### Arguments None. ### Return values None. ## Description **Return** statement returns control to the calling program unit. Execution of `RETURN` statement terminates the reference of a function or subroutine. ## Types None. ## Examples ```fortran subroutine example (s) character s* "32" write (*,*) s return end ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { example: (Function (SymbolTable 2 { s: (Variable 2 s Unspecified (StringConstant "32" (Character 1 2 () []) ) () Save (Character 1 1 () []) Source Public Required .false. ) }) example [(Var 2 s)] [(FileWrite 0 () () () () () [(Var 2 s)] () () ) (Return)] () Source Public Implementation () .false. .false. .false. .false. .false. [] [] .false. ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/subroutinecall.md0000664000175000017500000001204715174404631026473 0ustar alastairalastair# SubroutineCall SubroutineCall/FunctionCall to store the actual final resolved subroutine or function (`name`) member, a `stmt` node. ## Declaration ### Syntax ```fortran SubroutineCall(symbol name, symbol? original_name, call_arg* args, expr? dt, bool strict_bounds_checking) ``` ### Arguments `name` contains symbol name. `original_name` contains name present in program unit. `args` contains arguments passed to subroutine call. `dt` is set if and only if this is a method call (i.e., a call through a derived type instance such as `obj%method(args)`). When `dt` is non-null, it holds the expression for the object whose method is being called. When `dt` is null, this is a regular subroutine call. `strict_bounds_checking` indicates if this SubroutineCall was a FunctionCall before getting converted by subroutine_from_function pass, if it was then we need to do strict_bounds_checking for the return argument. ### Return values None. ## Description **SubroutineCall** stores the actual final resolved subroutine or function (`name` member). They also store the original symbol (`original_name`), which can be one of null, GenericProcedure or ExternalSymbol. ## Types Not Applicable. ## Examples ```fortran program Subroutine_Call implicit none integer(4) :: from, to from = 10 to = 4 call mvbits(from, 2, 2, to, 0) if (from /= 10) error stop end ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_bit: (IntrinsicModule lfortran_intrinsic_bit), subroutine_call: (Program (SymbolTable 2 { from: (Variable 2 from Local () () Default (Integer 4 []) Source Public Required .false. ), mvbits: (ExternalSymbol 2 mvbits 4 mvbits lfortran_intrinsic_bit [] mvbits Private ), mvbits@mvbits32: (ExternalSymbol 2 mvbits@mvbits32 4 mvbits32 lfortran_intrinsic_bit [] mvbits32 Private ), to: (Variable 2 to Local () () Default (Integer 4 []) Source Public Required .false. ) }) subroutine_call [] [(= (Var 2 from) (IntegerConstant 10 (Integer 4 [])) () ) (= (Var 2 to) (IntegerConstant 4 (Integer 4 [])) () ) (SubroutineCall 2 mvbits@mvbits32 2 mvbits [((Var 2 from)) ((IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 2 (Integer 4 []))) ((Var 2 to)) ((IntegerConstant 0 (Integer 4 [])))] () ) (If (IntegerCompare (Var 2 from) NotEq (IntegerConstant 10 (Integer 4 [])) (Logical 4 []) () ) [(ErrorStop () )] [] )] ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/setremove.md0000664000175000017500000000035015174404631025443 0ustar alastairalastair# SetRemove ## Declaration ### Syntax ```fortran SetRemove(expr a, expr ele) ``` ### Arguments ### Return values None. ## Description **SetRemove** ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/flush.md0000664000175000017500000002131015174404631024552 0ustar alastairalastair# Flush Flushes Fortran unit currently open for output, a `stmt` node. ## Declaration ### Syntax ```fortran Flush(int label, expr unit, expr? err, expr? iomsg, expr? iostat) ``` ### Arguments `label` contains label of the branch target statement that receives control if an error occurs. `unit` contains external unit specifier. `err` contains error message. `iomsg` contains an explanatory message if an I/O error occurs. `iostat` contains return value of the operation, the status code. ### Return values None. ## Description **Flush** statement makes the data written to a file or i/o unit to become available to other processes or causes data written to a file outside of Fortran to be accessible to a READ statement. ## Types ## Examples ```fortran program rewind_inquire_flush implicit none integer :: ios, len, a, b character :: fm logical :: ext rewind(unit=9, iostat=ios, err=10) inquire (file='file_b', exist=ext) inquire (4, form=fm, iostat=ios, err=20) inquire (iolength=len) a, b 10 print *, "err rewind" 20 print *, "err inquire" end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { rewind_inquire_flush: (Program (SymbolTable 2 { a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false. ), b: (Variable 2 b Local () () Default (Integer 4 []) Source Public Required .false. ), ext: (Variable 2 ext Local () () Default (Logical 4 []) Source Public Required .false. ), fm: (Variable 2 fm Local () () Default (Character 1 1 () []) Source Public Required .false. ), ios: (Variable 2 ios Local () () Default (Integer 4 []) Source Public Required .false. ), len: (Variable 2 len Local () () Default (Integer 4 []) Source Public Required .false. ) }) rewind_inquire_flush [] [(FileRewind 0 (IntegerConstant 9 (Integer 4 [])) (Var 2 ios) (IntegerConstant 10 (Integer 4 [])) ) (FileInquire 0 () (StringConstant "file_b" (Character 1 6 () []) ) () () (Var 2 ext) () () () () () () () () () () () () () () () () () () () () () () () () () ) (FileInquire 0 (IntegerConstant 4 (Integer 4 [])) () (Var 2 ios) (IntegerConstant 20 (Integer 4 [])) () () () () () () () () (Var 2 fm) () () () () () () () () () () () () () () () () () ) (FileInquire 0 () () () () () () () () () () () () () () () () () () () () () () () () () () () () () (Var 2 len) ) (GoToTarget 10 10 ) (Print () [(StringConstant "err rewind" (Character 1 10 () []) )] () () ) (GoToTarget 20 20 ) (Print () [(StringConstant "err inquire" (Character 1 11 () []) )] () () )] ) }) [] ) ``` ## See Also [Nullify](nullify.md) lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/ompregion.md0000664000175000017500000000651015174404631025435 0ustar alastairalastair# OMPRegion The OMPRegion node represents an OpenMP region directive and its enclosed statements. ## Declaration ### Syntax ``` OMPRegion(omp_region_type region, omp_clause* clauses, stmt* body) ``` ### Arguments | Argument name | Argument Description | |---------------|----------------------| | `region` | The type of OpenMP region (e.g., Parallel, Target, Teams). | | `clauses` | A list of OpenMP clauses associated with the region. | | `body` | A list of statements enclosed within the OpenMP region. | ### Return values None. ## Description OMPRegion encapsulates OpenMP directives and their associated constructs in the Abstract Semantic Representation (ASR). It supports various OpenMP region types, such as Parallel, Do, ParallelDo, Sections, Single, Master, Task, Teams, Distribute, Target, and others. Each region can include clauses like private, shared, reduction, map, schedule, num_threads, and num_teams to specify behavior such as data sharing, loop scheduling, or device offloading. The node decouples OpenMP pragmas from general loop constructs, enabling targeted lowering to runtime libraries like libgomp for parallel execution. ## Types The `region` field uses the `omp_region_type` enumeration, which includes values like Parallel, Target, Teams, and ParallelDo. Clauses are represented by the `omp_clause` union, supporting types such as OMPPrivate, OMPShared, OMPReduction, OMPMap (with map_type like To, From, ToFrom), and OMPSchedule (with schedule_type like Static, Dynamic, Runtime). The body consists of ASR statement nodes. ## Examples ```fortran program openmp_52 use omp_lib implicit none integer, parameter :: N = 100, init=0 integer :: a(N), i, total a = 1 ! Initialize all elements to 1 !$omp parallel shared(a, total) private(i) total = init ! Initialize total to 0 !$omp barrier !$omp do do i = 1, N !$omp critical total = total + a(i) !$omp end critical end do !$omp end do !$omp end parallel print *, "Total sum:", total if (total /= N) error stop "Incorrect sum" end program openmp_52 ``` ASR: ```clojure (OMPRegion Parallel [(OMPShared [(Var 2 a) (Var 2 total)] ) (OMPPrivate [(Var 2 i)] )] [(Assignment (Var 2 total) (Var 2 init) () .false. ) (OMPRegion Barrier [] [] ) (OMPRegion Do [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 n) ()) [(OMPRegion Critical [] [(Assignment (Var 2 total) (IntegerBinOp (Var 2 total) Add (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Integer 4) () ) () .false. )] )] [] )] )] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/doloop.md0000664000175000017500000001107215174404631024731 0ustar alastairalastair# DoLoop The `DO` statement to repeatedly execute a set of statements. ## Declaration ### Syntax ```fortran DoLoop(do_loop_head head, stmt* body) ``` ### Arguments `head` contains do loop header or loop control. `body` contains do loop statements. ### Return values None. ## Description **DoLoop** statement nodes repeatedly executes a set of statements. A labeled `DO` loop consists of the following: - `DO` statement - Set of executable statements i.e., body of the `do` loop - Terminal statement, like `CONTINUE` statement The `DO` variable must not be modified in any way within the range of the `DO` loop. Control must not jump into the range of a `DO` loop from outside its range. After the terminal statement of a `DO` loop is executed, the following steps are performned: - The value of the `DO` variable, if any, is incremented. - The iteration count of the loop statement is decremented by one. - The iteration count of condition is tested. ## Types Accessible global identifier and a sequence of zero or more statements or construst that make the `DO` range. ## Examples ```fortran program doloop implicit none integer :: i, j j = 0 do i = 1, 10 if (i == 2) cycle j = j + i end do if (j /= 53) error stop print *, j end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { doloop_03: (Program (SymbolTable 2 { i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false. ), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false. ) }) doloop_03 [] [(= (Var 2 j) (IntegerConstant 0 (Integer 4 [])) () ) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])) ()) [(If (IntegerCompare (Var 2 i) Eq (IntegerConstant 2 (Integer 4 [])) (Logical 4 []) () ) [(Cycle)] [] ) (= (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4 []) () ) () )] ) (If (IntegerCompare (Var 2 j) NotEq (IntegerConstant 53 (Integer 4 [])) (Logical 4 []) () ) [(ErrorStop () )] [] ) (Print () [(Var 2 j)] () () )] ) }) [] ) ``` ## See Also [doconcurrentloop](doconcurrentloop.md) lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/setinsert.md0000664000175000017500000000035015174404631025452 0ustar alastairalastair# SetInsert ## Declaration ### Syntax ```fortran SetInsert(expr a, expr ele) ``` ### Arguments ### Return values None. ## Description **SetInsert** ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/associateblockcall.md0000664000175000017500000002020415174404631027254 0ustar alastairalastair# AssociateBlockCall Associate statements' blocks' call, a `stmt` node. ## Declaration ### Syntax ```fortran AssociateBlockCall(symbol m) ``` ### Arguments `m` contains symbol. ### Return values None. ## Description **AssociateBlockCall** statement is for the call to the associate block. For more information see [associate](associate.md). ## Types ## Examples ```fortran module stdlib_string_type contains elemental subroutine unused_dummy_argument(dummy) class(*), intent(in) :: dummy associate(dummy => dummy); end associate end subroutine unused_dummy_argument subroutine read_formatted(v_list) integer, intent(in) :: v_list(:) call unused_dummy_argument(v_list) end subroutine end module ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { stdlib_string_type: (Module (SymbolTable 2 { read_formatted: (Function (SymbolTable 5 { v_list: (Variable 5 v_list In () () Default (Integer 4 [(() ())]) Source Public Required .false. ) }) read_formatted [(Var 5 v_list)] [(SubroutineCall 2 unused_dummy_argument () [((Var 5 v_list))] () )] () Source Public Implementation () .false. .false. .false. .false. .false. [] [] .false. ), unused_dummy_argument: (Function (SymbolTable 3 { associate_block: (AssociateBlock (SymbolTable 6 { dummy: (Variable 6 dummy Local () () Default (Pointer (Class 3 ~unlimited_polymorphic_type [] ) ) Source Private Required .false. ) }) associate_block [(=> (Var 6 dummy) (Var 3 dummy) )] ), dummy: (Variable 3 dummy In () () Default (Class 3 ~unlimited_polymorphic_type [] ) Source Public Required .false. ), ~unlimited_polymorphic_type: (StructType (SymbolTable 4 { }) ~unlimited_polymorphic_type [] Source Public () ) }) unused_dummy_argument [(Var 3 dummy)] [(AssociateBlockCall 3 associate_block )] () Source Public Implementation () .false. .false. .false. .false. .false. [] [] .false. ) }) stdlib_string_type [] .false. .false. ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/cycle.md0000664000175000017500000000734715174404631024546 0ustar alastairalastair# Cycle Cycle function, a **statement (stmt)** node. ## Declaration ### Syntax ```fortran Cycle() ``` ### Arguments None. ### Return values None. ## Description **cycle** skips whatever is left of the loop and goes into the next cycle. ## Types Not applicable. ## Examples ```fortran program doloop_03 implicit none integer :: i, j j = 0 do i = 1, 10 if (i == 2) cycle j = j + i end do if (j /= 53) error stop print *, j end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { doloop_03: (Program (SymbolTable 2 { i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false. ), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false. ) }) doloop_03 [] [(= (Var 2 j) (IntegerConstant 0 (Integer 4 [])) () ) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])) ()) [(If (IntegerCompare (Var 2 i) Eq (IntegerConstant 2 (Integer 4 [])) (Logical 4 []) () ) [(Cycle)] [] ) (= (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4 []) () ) () )] ) (If (IntegerCompare (Var 2 j) NotEq (IntegerConstant 53 (Integer 4 [])) (Logical 4 []) () ) [(ErrorStop () )] [] ) (Print () [(Var 2 j)] () () )] ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/statement_nodes/statement_nodes.md0000664000175000017500000000071315174404631026631 0ustar alastairalastair# ASR Statement Nodes ```{toctree} --- maxdepth: 1 --- allocate.md assert.md assign.md assignment.md associate.md associateblockcall.md blockcall.md cptrtopointer.md cycle.md doconcurrentloop.md doloop.md errorstop.md exit.md explicitdeallocate.md flush.md forallsingle.md goto.md gototarget.md if.md ifarithmetic.md implicitdeallocate.md nullify.md ompregion.md print.md return.md select.md selectrank.md stop.md subroutinecall.md where.md whileloop.md ``` lfortran-0.63.0/doc/src/asr/asr_nodes/type_nodes/0000775000175000017500000000000015174404631022067 5ustar alastairalastairlfortran-0.63.0/doc/src/asr/asr_nodes/type_nodes/ttype.md0000664000175000017500000002176315174404631023567 0ustar alastairalastair# ttype Type nodes. ## Declaration ### Syntax ```fortran ttype = Integer(int kind, dimension* dims) | Real(int kind, dimension* dims) | Complex(int kind, dimension* dims) | Character(int kind, int len, expr? len_expr, dimension* dims) | Logical(int kind, dimension* dims) | Set(ttype type) | List(ttype type) | Tuple(ttype* type) | Struct(symbol derived_type, dimension* dims) | Enum(symbol enum_type, dimension *dims) | UnionType(symbol union_type, dimension *dims) | Class(symbol class_type, dimension* dims) | Dict(ttype key_type, ttype value_type) | Pointer(ttype type) | CPtr() | TypeParameter(identifier param, dimension* dims) ``` ### Arguments `kind` member selects the kind of a given type. `dims` denotes dimension descriptor. `expr` denotes expression. `len` denotes length of variable allowed. `derived_type` denotes derived type of class. `derived_type` must point to a symbol with a symbol table. `enum_type` denotes enumeration type. `union_type` denotes union type. `class_type` denotes class type. `key_type` denotes key type in dictonary type. `value_type` denotes value type in dictionary type. `param` denotes identifier or variable's. ### Return values None. ## Description `ttype` denotes type of variables supported by LFortran. It consists of: 1. `Integer` denotes integer type. 2. `Real` denotes real type. 3. `Complex` denotes complex type. 4. `Character` denotes character type. 5. `Logical` denotes logical type. 6. `Set` denotes set type. 7. `List` denotes list type. 8. `Tuple` denotes tuple type. 9. `Struct` denotes structure type. 10. `Enum` denotes enumeration type. 11. `UnionType` denotes union type. 12. `Class` denotes class type. 13. `Dict` denotes dictionary type. 14. `Pointer` denotes Pointer type. 15. `CPtr` denotes C pointer type. 16. `TypeParameter` denotes type of parameter. ## Types **ttype** defines types of variables or identifiers supported by LFortran. ## Examples Example for `integer`: ```fortran integer(8) :: x x = 6 x ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { x: (Variable 1 x Local () () Default (Integer 8 []) Source Public Required .false. ) }) [(= (Var 1 x) (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToInteger (Integer 8 []) (IntegerConstant 6 (Integer 8 [])) ) () ) (Var 1 x)] ) ``` Example for `derived_type`: ```fortran program t01_derived_type implicit none type type_A integer :: i real :: r end type type(type_A) :: A A%i = 5 A%r = 5.5 end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { t01_derived_type: (Program (SymbolTable 2 { a: (Variable 2 a Local () () Default (Struct 2 type_a [] ) Source Public Required .false. ), type_a: (StructType (SymbolTable 3 { i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false. ), r: (Variable 3 r Local () () Default (Real 4 []) Source Public Required .false. ) }) type_a [i r] Source Public () ) }) t01_derived_type [] [(= (StructInstanceMember (Var 2 a) 3 i (Integer 4 []) () ) (IntegerConstant 5 (Integer 4 [])) () ) (= (StructInstanceMember (Var 2 a) 3 r (Real 4 []) () ) (RealConstant 5.500000 (Real 4 []) ) () )] ) }) [] ) ``` Example for `complex`: ```fortran program complex1 complex :: x x = (3.0, 4.0) end program ``` ASR: ``` (TranslationUnit (SymbolTable 1 { complex1: (Program (SymbolTable 2 { x: (Variable 2 x Local () () Default (Complex 4 []) Source Public Required .false. ) }) complex1 [] [(= (Var 2 x) (ComplexConstructor (RealConstant 3.000000 (Real 4 []) ) (RealConstant 4.000000 (Real 4 []) ) (Complex 4 []) (ComplexConstant 3.000000 4.000000 (Complex 4 []) ) ) () )] ) }) [] ) ``` Example for `dimension`: ```fortran integer :: x dimension x(3) ``` ASR: ``` (TranslationUnit (SymbolTable 1 { x: (Variable 1 x Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false. ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/asr_nodes/type_nodes/StringPhysicalType.md0000664000175000017500000000577115174404631026230 0ustar alastairalastair# String Physical Type ## Types ```ASDL string_physical_type = PointerString | DescriptorString ``` ## Description - **PointerString :** - It's the normal C `char*`. The memory for it gets allocated by the runtime `lfortran_str_copy()`. - PointerString can't be an `allocatable` unless it's an allocatable-array or string [casted](../expression_nodes/StringPhysicalCast.md) from `descriptorString` to `pointerString` so it remains to be identified as an allocatable variable in the whole code base, like avoiding some semantic errors when you use the string with some intrinsic function that requires the string to be an allocatable. - **DescriptorString :** - It's an LLVM struct to hold information about data, size and capacity. - It's represented in LLVM IR as : `{char*, int64, int64}`. The benefit from having `size` and `capacity` is that it gives us the ability to have dynamic string that's not computationally expensive, just like `std::string` (`std::vector`) in c++. So the key points are: - `size` avoids calling `strlen` when we want to know the size of a string. - `capacity` gives us the flexibility of extending the string without losing performance by doubling the memory location every time we run out of allocated memory space. - DescriptorString must always be an allocatable. ## Usage - **DescriptorString** DescriptorString is used only with allocatable strings. ```Fortran character(:) , allocatable:: chr ``` ```Clojure (Variable 2 chr [] Local () () Default (Allocatable (Character 1 -2 () DescriptorString) ; Notice the physical type. ) () Source Public Required .false. ) ``` ``` Fortran character(5) :: chr character(:),allocatable :: chr_RHS chr_RHS = chr ! Cast RHS from PointerString --> DescriptorString ``` ``` Clojure (Assignment (Var 2 chr_rhs) (StringPhysicalCast (Var 2 chr) PointerString DescriptorString (Allocatable (Character 1 5 () DescriptorString) ; Notice Physical type ) () ) () ) ``` - **PointerString** It could be used with allocatable strings and non-allocatable strings. - non-allocatable + pointerString --> fixed-size string and literal string ```Fortran character(5) :: chr chr = "Hello" ``` ``` Clojure chr: (Variable 2 chr [] Local () () Default (Character 1 5 () PointerString) ; Notice The Physical Type. () Source Public Required .false. ) (Assignment (Var 2 chr) (StringConstant "Hello" (Character 1 5 () PointerString) ; Notice The Physical Type ) () ) ``` - allocatable + pointerString --> When string casted from descriptorString to pointerString. ```Fortran character(5) :: chr character(:), allocatable :: chr_RHS chr = chr_RHS ! Cast RHS from DescriptorString to PointerString ``` ``` Clojure (Assignment (Var 2 chr) (StringPhysicalCast (Var 2 chr_rhs) DescriptorString PointerString (Allocatable (Character 1 -2 () PointerString) ; Notice alloctable pointerString. ) () ) () ) ``` ### See Also [stringPhysicalCast](../expression_nodes/StringPhysicalCast.md) lfortran-0.63.0/doc/src/asr/asr_nodes/kinds_nodes/0000775000175000017500000000000015174404631022216 5ustar alastairalastairlfortran-0.63.0/doc/src/asr/asr_nodes/kinds_nodes/kinds.md0000664000175000017500000001423015174404631023650 0ustar alastairalastair# kinds The `kind` member selects the kind of a given type. ## Declaration ### Syntax ```fortran Integer Real Complex Character Logical kind ``` ### Arguments None. ### Return values None. ## Description **kind** denotes the kind of a given type. LFortran supports the following: 1. Integer kinds: 1 (i8), 2 (i16), 4 (i32), 8 (i64) 2. Real kinds: 4 (f32), 8 (f64) 3. Complex kinds: 4 (c32), 8 (c64) 4. Character kinds: 1 (utf8 string) 5. Logical kinds: 1, 2, 4: (boolean represented by 1, 2, 4 bytes; the default kind is 4, just like the default integer kind, consistent with Python and Fortran: in Python "Booleans in Python are implemented as a subclass of integers", in Fortran the "default logical kind has the same storage size as the default integer"; we currently use kind=4 as default integer, so we also use kind=4 for the default logical.) ## Types LFortan supports the following types: 1. Integer kinds 2. Real kinds 3. Complex kinds 4. Character kinds 5. Logical kinds ## Examples ```fortran program const_kind_01 integer, parameter :: sp = 4, dp = 8 real(sp), parameter :: r1 = 1.0_sp real(dp), parameter :: r2 = 1.0_dp real :: r3 r3 = 1.0_sp r3 = 1.0_dp print *, sp, dp, r1, r2, r3 end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { const_kind_01: (Program (SymbolTable 2 { dp: (Variable 2 dp Local (IntegerConstant 8 (Integer 4 [])) (IntegerConstant 8 (Integer 4 [])) Parameter (Integer 4 []) Source Public Required .false. ), r1: (Variable 2 r1 Local (RealConstant 1.000000 (Real 4 []) ) (RealConstant 1.000000 (Real 4 []) ) Parameter (Real 4 []) Source Public Required .false. ), r2: (Variable 2 r2 Local (RealConstant 1.000000 (Real 8 []) ) (RealConstant 1.000000 (Real 8 []) ) Parameter (Real 8 []) Source Public Required .false. ), r3: (Variable 2 r3 Local () () Default (Real 4 []) Source Public Required .false. ), sp: (Variable 2 sp Local (IntegerConstant 4 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) Parameter (Integer 4 []) Source Public Required .false. ) }) const_kind_01 [] [(= (Var 2 r3) (RealConstant 1.000000 (Real 4 []) ) () ) (= (Var 2 r3) (Cast (RealConstant 1.000000 (Real 8 []) ) RealToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []) ) ) () ) (Print () [(Var 2 sp) (Var 2 dp) (Var 2 r1) (Var 2 r2) (Var 2 r3)] () () )] ) }) [] ) ``` ## See Also lfortran-0.63.0/doc/src/asr/generics.md0000664000175000017500000002525415174404631020072 0ustar alastairalastair# Generics From a high-level perspective generics are supported in LFortran by three main elements: 1. **Requirements** declaring deferred types and their abstract functions 2. **Templates** implementing generic symbols (functions, subroutines, derived types) using deferred types and abstract functions described by requirements 3. **Instantiations** by passing concrete types and functions into templates ## Requirements Requirements declare deferred types (generic types) and its associated functions, similar to *typeclasses* in Haskell and *traits* in Rust. For example, the signature for a generic monoid of any type can be represented by the following requirement: ```fortran requirement monoid(T, op) ! declaring a deferred type (generic type) type, deferred :: T ! declaring a function associated with the deferred type function op(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function function empty() result(z) type(T) :: z end function end requirement ``` The `monoid` requirement declares a deferred type `T` and two functions,`op` that takes arguments of type `T` and return a value with the same type `T` and `empty` that returns a value of type `T`. The deferred type `T` is internally interpreted as a variable `T` typed as `TypeParameter T` (for brevity we will write it just as `T`). Functions declared in requirements are abstract (without function body). On ASR level, the requirement is represented by the symbol [`Requirement`](asr_nodes/symbol_nodes/Requirement.md). ASR for requirements are built during symbol table visit in the function `visit_Requirement`. `monoid`'s symbol table would contain a variable `T` with the type `T`, a function `op` with the type `T * T -> T`, and a function `empty` with the type `() -> T`. A requirement is checked to see if all the parameters have a corresponding symbol declared inside of it. A warning is generated if a parameter is declared but no symbol is found with the same name. On its own, a requirement does not do any computation. It is also not compiled into the target language when the ASR is compiled. ## Templates Templates take the role of a scope for generic functions. A template uses generic types and its associated type signatures obtained from requirements to check generic operations. As a running example, we will consider a generic function for n-times multiplication for argument of any type. This function can be represented as: ```fortran module generics_example ! same requirement as before requirement monoid(T, op, empty) ... end requirement ! the template starts from here template array_t(S, op_temp, empty_temp) require :: monoid(S, op_temp, empty_temp) contains ! below is the generic function function array_sum(arr) result(r) type(S), intent(in) :: arr(:) type(S) :: r integer :: n, i n = size(arr) r = empty_temp(0) if (n > 0) then r = arr(1) do i = 2, n res = op_temp(r, arr(i)) end do end if end function end template end module ``` The template `array_t` contains the generic function `array_sum` that takes an array `arr` of type `S`. The template later on will be added to the parent symbol table as a `Template` symbol with the name `array_t`. Typing context has to be obtained to type the parameter `arr` and the addition operation `op_temp(r, arr(i))`. Such typing context can be made available within the scope of the template by using a requirement. Here, the `Require` statement `require :: monoid(S, op_temp, empty_temp)` builds the types of the template's parameters `S`, `op_temp`, and `empty_temp` based on the types of the symbols in `monoid`. This corresponds to the `visit_UnitRequire` that can be found in `visit_Template` during symbol table visit. Calling a require statement copies the symbols from the requiremement and replaces their names with the argument names given by the require statement. In this case, the symbol `T`, `op`, and `empty` from the requirement `monoid` are replaced by `S`, `op_temp`, and `empty_temp` that are passed as arguments. This replacement is done by the function `rename_symbol`. Eventually the require statement adds into `array_t`'s symbol table two symbols, `S` as a variable with type `S`, `op_temp` and `empty_temp` as functions with types `S * S -> S` and `() -> S` based on `monoid`'s symbol table. Symbol table visit checks the variable declarations in `array_sum`. Since `S` is available in the symbol table now, both variables `arr` and `r` can be typed. Later during body visit, with type `S`, `op_temp`, and `empty_temp` in the symbol table, the function call `op_temp(r, arr(i))` in `array_sum` would be checked in the same way as non-generic functions. ASR representation of templates are also not compiled into the target language. ## Instantiations Generic functions need to be instantiated with concrete types and functions to be used in run-time. The process of instantiation replaces the generic types in the function definition with concrete types (such as `integer`, `real`) and replace the abstract functions with implemented functions. The generic function described in the previous section can be instantiated as a function that computes array sum by the following instantiation: ```fortran module functions public :: add_integer, empty_integer contains function add_integer(x, y) integer, intent(in) :: x, y integer :: add_integer add_integer = x + y end function function empty_integer() integer :: empty_integer empty_integer = 0 end function end module program instantiate_template use functions, only: add_integer, empty_integer instantiate array_t(integer, add_integer, empty_integer), & only: array_sum_integer => array_sum ! function argument for basic arithmetic operations can be replaced with an operator instantiate array_t(integer, operator(+), empty_integer), & only: array_sum_integer => array_sum ! eliding function renaming would instantiating all generic functions with the same name instantiate array_t(integer, operator(+), empty_integer) end program ``` This instantiation statement ``` instantiate array_t(integer, add_integer, empty_integer), only: array_sum_integer => array_sum ``` passes the type `integer`, an integer addition function `add_integer`, and a function describing empty integer value `empty_integer` as arguments to template `array_t`, then instantiates the function `array_sum` as a new function named `array_sum_integer`. This instantiation wants to replace `S` in `array_t` with the type `integer`, `op_temp` function calls with `add_integer` function calls, and `empty_temp` function calls with `empty_integer` function calls. ### Type Checking Before a function is generated on ASR level by an instantiation, the compiler checks the consistency of its type substitution based on the given symbol arguments. Currently there is no notion of subtyping in LFortran, so checking is limited to exact type checks. This is done by tracking the type substitutions made by the symbol arguments and rejecting any contradicting type subsitutition. Checking is done during symbol table visit in `visit_Instantiate`. We will explain this in detail through the instantiation example above. The first argument `integer` substitutes the type parameter `S` in template `array_t` (maps `S` to `integer`). The second argument `add_integer` substitutes the type `S * S -> S` of `op_temp` with `integer * integer -> integer` (checks `S` substitution). This is allowed because the function argument gives a consistent substitution with the previous argument. If it passes the type checks, the instantiated function would be generated as a function on ASR level. Successfully checked symbol arguments are put inside the variable `type_subs` for type substitution (`S` to `integer`) and `symbol_subs` for function substitution (`op_temp` to `add_integer`). Now, suppose that we have the following instantiation where instead of `integer`, we pass `real` as an argument: ``` instantiate array_t(real, add_integer, empty_integer), only: array_sum_integer => array_sum ``` Here, the first type argument maps `S` to `real` but the second function argument maps `S` to `integer`, resulting in a contradiction. Hence ending in a type error. This check is tracked by the two variables `type_subs` and `symbol_subs`. Function arguments are checked by the function `check_restriction` during symbol table visit. **Handling Operator Arguments** Instantiations can be made simpler for basic binary operations (addition, multiplication, etc.) by passing `operator()` instead of pre-defined functions. If the type substitution tracked by `type_subs` is consistent for a binary arithmetic operation, then a function is implicitly generated as a function argument. From the example before, we will have a function that is equivalent to the following LFortran function generated implicitly: ```fortran function ~add_intrinsic(arg0, arg1) result(ret) integer, intent(in) :: arg0, arg1 integer :: ret ret = arg0 + arg1 end function ``` ### ASR Generation Instantiating the function as a function on the ASR level is simply a symbol replacement process. The generation process is split into two, generating the function signature during symbol table visit and generating the function body during body visit. The whole generation is not done during body visit because derived types generated from a template may be used to type variable declarations. During symbol table visit, after checking arguments and placing the symbol substitution into `type_subs` and `symbol_subs`, the instantiated function is added into the symbol table and its signature is built by the function `instantiate_symbol` where the deferred types are replaced with concrete types. For the example above, a function equivalent to the following is generated: ```fortran elemental function array_sum_integer(arr) result(res) integer, intent(in) :: arr(:) ! type replaced integer :: r ! type replaced integer :: n, i end function ``` The substitution in `type_subs` and `symbol_subs` are preserved and then passed to the body visitor. During body visit, the body of the instantiated function is built in `visit_Instantiate` by the function `instantiate_body`, replacing any abstract functions with concrete functions: ```fortran function array_sum_integer(n, a) result(res) integer, intent(in) :: arr(:) integer :: r integer :: n, i n = size(arr) r = empty_integer(0) ! function call replaced if (n > 0) then r = arr(1) do i = 2, n res = add_integer(r, arr(i)) ! function call replaced end do end if end do end function ``` ## See Also * [Programming With Generics](programming_generics.md), for simpler explaining about using generics in LFortranlfortran-0.63.0/doc/src/design.md0000664000175000017500000002565315174404631016762 0ustar alastairalastair# LFortran Design ## High Level Overview LFortran is structured around two independent modules, AST and ASR, both of which are standalone (completely independent of the rest of LFortran) and users are encouraged to use them independently for other applications and build tools on top: * Abstract Syntax Tree (AST), module `lfortran.ast`: Represents any Fortran source code, strictly based on syntax, no semantic is included. The AST module can convert itself to Fortran source code. * Abstract Semantic Representation (ASR), module `lfortran.asr`: Represents a valid Fortran source code, all semantic is included. Invalid Fortran code is not allowed (an error will be given). The ASR module can convert itself to an AST. The LFortran compiler is then composed of the following independent stages: * Parsing: converts Fortran source code to an AST * Semantic: converts an AST to an ASR * High level optimizations: optimize ASR to a possibly faster/simpler ASR (things like inlining functions, eliminating redundant expressions or statements, etc.) * LLVM IR code generation and lower level optimizations: converts an ASR to an LLVM IR. This stage also does all other optimizations that do not produce an ASR, but still make sense to do before passing to LLVM IR. * Machine code generation: LLVM then does all its optimizations and generates machine code (such as a binary executable, a library, an object file, or it is loaded and executed using JIT as part of the interactive LFortran session or in a Jupyter kernel). LFortran is structured as a library, and so one can for example use the parser to obtain an AST and do something with it, or one can then use the semantic analyzer to obtain ASR and do something with it. One can generate the ASR directly (e.g., from SymPy) and then either convert to AST and to a Fortran source code, or use LFortran to compile it to machine code directly. In other words, one can use LFortran to easily convert between the three equivalent representations: * Fortran source code * Abstract Syntax Tree (AST) * Abstract Semantic Representation (ASR) They are all equivalent in the following sense: * Any ASR can always be converted to an equivalent AST * Any AST can always be converted to an equivalent Fortran source code * Any Fortran source code can always be either converted to an equivalent AST or one gets a syntax error * Any AST can always be either converted to an equivalent ASR or one gets a semantic error So when a conversion can be done, they are equivalent, and the conversion can always be done unless the code is invalid. ## ASR Design Details The ASR is designed to have the following features: * ASR is still semantically equivalent to the original Fortran code (it did not lose any semantic information). ASR can be converted to AST, and AST to Fortran source code which is functionally equivalent to the original. * ASR is as simple as possible: it does not contain any information that could not be inferred from ASR. * The ASR C++ classes (down the road) are designed similarly to SymEngine: they are constructed once and after that they are immutable. The constructor checks in Debug more that all the requirements are met (e.g., that all Variables in a Function have a dummy argument set, that explicit-shape arrays are not allocatable and all other Fortran requirements to make it a valid code), but in Release mode it quickly constructs the class without checks. Then there are builder classes that construct the ASR C++ classes to meet requirements (checked in Debug mode) and the builder gives an error message if a code is not a valid Fortran code, and if it doesn't give an error message, then the ASR C++ classes are constructed correctly. Thus by construction, the ASR classes always contain valid Fortran code and the rest of LFortran can depend on it. ## Compilation Modes We support two compilation modes: 1. Monolithic Compilation Mode: The standard compilation mode. In this mode, LFortran produces empty object files (`.o` files) with `-c` flag (the only reason to produce those is to satisfy existing build systems that typically expect `.o` files to be created). The object code is generated only when main program is encountered: all modules are loaded from `.mod` files and everything compiled and linked at once. When a module is compiled, only a `.mod` file is generated with full code. For files with global procedures, LFortran identifies those automatically and sets `generate_code_for_global_procedures` compiler option to `true` (not exposed to user), which then generates object code only for global procedures (you must thus link these generated `.o` object files with the main program), and rest of the modules are serialized to `.mod` files which do not contain global procedure. 2. Separate Compilation Mode: This mode is enabled with `--separate-compilation` flag. In this mode, LFortran generates full code for each file into object files (`.o` files) with full symbol information. This is usually the default mode used by most other Fortran compilers. We create object code, and we still create `.mod` files for modules and they contain everything just like for direct mode but when any `.mod` file is loaded, we change all symbols to `ExternalUndefined` ABI. We don't change the ABI for `bind(c)` (since those are undefined already in object code, the user is responsible to provide an implementation at link time). Note: **_If you enable separate compilation mode, you have to enable it for all the files._** ## Notes: Information that is lost when parsing source to AST: whitespace, multiline/single line if statement distinction, case sensitivity of keywords. Information that is lost when going from AST to ASR: detailed syntax how variables were defined and the order of type attributes (whether array dimension is using the `dimension` attribute, or parentheses at the variable; or how many variables there are per declaration line or their order), as ASR only represents the aggregated type information in the symbol table. ASR is the simplest way to generate Fortran code, as one does not have to worry about the detailed syntax (as in AST) about how and where things are declared. One specifies the symbol table for a module, then for each symbol (functions, global variables, types, ...) one specifies the local variables and if this is an interface then one needs to specify where one can find an implementation, otherwise a body is supplied with statements, those nodes are almost the same as in AST, except that each variable is just a reference to a symbol in the symbol table (so by construction one cannot have undefined variables). The symbol table for each node such as Function or Module also references its parent (for example a function references a module, a module references the global scope). The ASR can be directly converted to an AST without gathering any other information. And the AST directly to Fortran source code. The ASR is always representing a semantically valid Fortran code. This is enforced by checks in the ASR C++ constructors (in Debug build). When an ASR is used, one can assume it is valid. ## Fortran 2008 Fortran 2008 [standard](https://j3-fortran.org/doc/year/10/10-007.pdf) chapter 2 "Fortran concepts" specifies that Fortran code is a collection of _program units_ (either all in one file, or in separate files), where each _program unit_ is one of: * main program * module or submodule * function or subroutine Note: It can also be a _block data_ program unit, that is used to provide initial values for data objects in named _common blocks_, but we do not recommend the use of _common blocks_ (use modules instead). ## LFortran Extension We extend the Fortran language by introducing a _global scope_, which is not only the list of _program units_ (as in F2008) but can also include statements, declarations, use statements and expressions. We define _global scope_ as a collection of the following items: * main program * module or submodule * function or subroutine * use statement * declaration * statement * expression In addition, if a variable is not defined in an assignment statement (such as `x = 5+3`) then the type of the variable is inferred from the right hand side (e.g., `x` in `x = 5+3` would be of type `integer`, and `y` in `y = 5._dp` would be of type `real(dp)`). This rule only applies at the top level of _global scope_. Types must be fully specified inside main programs, modules, functions and subroutines, just like in F2008. The _global scope_ has its own symbol table. The main program and module/submodule do not see any symbols from this symbol table. But functions, subroutines, statements and expressions at the top level of _global scope_ use and operate on this symbol table. The _global scope_ has the following symbols predefined in the symbol table: * the usual standard set of Fortran functions (such as `size`, `sin`, `cos`, ...) * the `dp` double precision symbol, so that one can use `5._dp` for double precision. Each item in the _global scope_ is interpreted as follows: main program is compiled into an executable with the same name and executed; modules, functions and subroutines are compiled and loaded; use statement and declaration adds those symbols with the proper type into the _global scope_ symbol table, but do not generate any code; statement is wrapped into an anonymous subroutine with no arguments, compiled, loaded and executed; expression is wrapped into an anonymous function with no arguments returning the expression, compiled, loaded, executed and the return value is returned to the user. The _global scope_ is always interpreted, item by item, per the previous paragraph. It is meant to allow interactive usage, experimentations and writing simple scripts. Code in _global scope_ must be interpreted using `lfortran`. For more complex (production) code it is recommended to turn it into modules and programs (by wrapping loose statements into subroutines or functions and by adding type declarations) and compile it with `lfortran` or any other Fortran compiler. Here are some examples of valid code in _global scope_: ### Example 1 ```fortran a = 5 print *, a ``` ### Example 2 ```fortran a = 5 subroutine p() print *, a end subroutine call p() ``` ### Example 3 ```fortran module a implicit none integer :: i end module use a, only: i i = 5 ``` ### Example 4 ```fortran x = [1, 2, 3] y = [1, 2, 1] call plot(x, y, "o-") ``` ## Design Considerations The LFortran extension of Fortran was chosen in a way so as to minimize the number of changes. In particular, only the top level of the _global scope_ has relaxed some of the Fortran rules (such as making specifying types optional) so as to allow simple and quick interactive usage, but inside functions, subroutines, modules or programs this relaxation does not apply. The number of changes were kept to minimum in order to make it straightforward to turn code at _global scope_ into standard compliant Fortran code using programs and modules, so that it can be compiled by any Fortran compiler. lfortran-0.63.0/doc/src/array_of_special_types.md0000664000175000017500000000432315174404631022226 0ustar alastairalastair # 1. Arrays of normal types Normal Types : Integers, Floats, Complex, Compound-Types (C Structs) These are arrays of types that doesn't require further care beyond allocating the consecutive memory, No special handling required, No additional information maintainted. ### Example #1 : (DescriptorArray (integer 4)) `{ i32*, i32, %dimension_descriptor*, i1, i32 }` We just allocate the required memory => (4bytes * size), and store in first element of that descriptor. # 2. Arrays of special types Special Types (so far) : Class, DescriptorStrings These are arrays that looks like array of normal type but behave differently. For types (class, descriptorString), We only allocate the structure of these types once and insert it into array normally, then we allocate consecutive memory for the actual useful type. ### Example #1 : (DescriptorArray (class)) -- not unlimited polymorphic `Array => { Class*, i32, %dimension_descriptor*, i1, i32 }` `Class => {Vtable*, underlying_struct*}` **Allocation:** We just allocate single **Class** once the array variable (llvm SSA) is initiated and just insert there to hold the class info later. Once allocation happens, We allocate consecutive memory for the underlying struct (array_size * struct_alloc_size), and store it into array's class `underlying_struct*`. **Fetching An Element:** Fetch the struct by indexing on array's-class-2nd-member, and create a class view (SSA) to hold the struct along with the corresponding VTable. ### Example #2 : (DescriptorArray (descriptorString)) `Array => { descriptorString*, i32, %dimension_descriptor*, i1, i32 }` `descriptorString => {i8*, i64}` **Allocation:** We just allocate single **descriptorString** once the array variable (llvm SSA) is initiated and just insert there to hold the string acutal memory and length later. If length is fixed we set it once variable initiated, otherwise we just set length on allocation. Once allocation happens, We allocate consectuive memory for the strings (array_size * length), and insert it into array's descriptorString `i8*` + Set length. **Fetching An Element:** Fetch the string by indexing on array's-descriptorString-1st-member, and create a string view (SSA) to hold the string along with the length. lfortran-0.63.0/doc/src/string_allocation.md0000664000175000017500000000543115174404631021214 0ustar alastairalastair# String Allocation In LFortran ### Note : This taking in consideration the LLVM backend only. *** ### General Rules : - Allocation with length=`0` (`allocate(character(0) :: str)`) is fine, and string is considered **allocated** even when the length=`0`. - We make sure to follow this statement when allocating strings -> `MAX(alloc_len, 1)`; That makes sure that the preceding point is valid and working properly. - Allocation with length<`0` (`allocate(character(-1) :: str)`) isn't tolerated in LFortran, It raises error on both compile-time and run-time. - Copying from unallocated string (`str1 = str2`) isn't tolerated and raises run-time error. We don't know how to determine the **allocation** state of the LHS so we don't tolerate that case; In addition, Fortran standards don't allow referencing non-allocated variables. ## Explicit Allocation **Example** : ```fortran allocate(character(10) :: STR) ! 1 allocate(character(0) :: STR) ! 2 allocate(character(-10) :: STR) ! 3 allocate(character(N) :: STR) ! 4 ``` 1 - Allocates `str` with compile-time value `10`, hence we evaluate `len = max(10, 1)` then we end up inserting this call `malloc(10)`. 2 - Allocates `str` with compile-time value `0`, hence we evaluate `len = max(0, 1)` at compile-time, we end up inserting this call at runtime `malloc(1)`. 3 - Allocates `str` with compile-time value `-10`, hence we raise an error at compile-time. 4 - Allocates `str` with run-time value `N`, hence we insert call `lfortran_string_malloc(N)` ## Runtime Function `lfortran_string_malloc()` #### It makes sure to do the same things we do when the length is compile-time value. - Raises runtime error when `length < 0`. - Makes sure to set length at minimum of length `1` --> `malloc(MAX(length, 1))`, To handle case of `allocate(character(0) :: str)` properly. ## Copying #### Copying from string into another requires automatic allocation or reallocation (reallocation is on by default). **Example** (realloc): ```fortran character(:), allocatable :: STR character(:), allocatable :: STR_2 STR = "HelloWorld" ! 1 STR = "BYE" ! 2 STR = STR_2 ! 3 ``` 1 - Allocates memory equal to `rhs_len` --> `malloc(MAX(1, rhs_len))` 2 - Calls `realloc` at runtime with length of minimum 1 --> `realloc(lhs_data_ptr, MAX(rhs_len, 1))` 3 - Raises error as it copies from unallocated string. **Example** (malloc): ```fortran character(10), allocatable :: STR character(:) , allocatable :: STR_2 STR = "HelloWorld" ! 1 STR = "BYE" ! 2 STR = STR_2 ! 3 ``` 1 - Calls `malloc` at runtime with length of minimum 1 --> `malloc(MAX(lhs_len, 1))`. 2 - Copies from RHS into LHS + pads LHS. No need for `malloc()` or `realloc` calls as the LHS is already allocated and its length is fixed. 3 - Raises error as it copies from unallocated string. lfortran-0.63.0/doc/src/usage.md0000664000175000017500000002306015174404631016603 0ustar alastairalastair# LFortran User Guide ## About LFortran LFortran's goal is an implementation of the latest Fortran standard (currently F2018) with some added extensions. It works on Linux, macOS, most BSDs and on Windows. The LFortran compiler consists of the following components: * The LFortran compiler itself. * A runtime library supporting language elements and intrinsic functions. * Several module definitions which define the external environment and supply particular details about the computer running the program. * The capability to read additional module definitions which define the interfaces to external libraries such as OpenMPI. * Generation of executable code with the LLVM compiler infrastructure. * Generation of C, C++, WebAssembly or Julia code. * Interactive usage via LLVM JIT * Source file formatting (`lfortran fmt`). ## Standards The LFortran compiler is currently in the alpha stage and is actively under development. It is designed to support the following Fortran standards and modes: Supported Standards: * ISO Fortran 2023 (`--std=f23`): Partial support for the latest Fortran 2023 features. Use this option to enable conformance to Fortran 2023 where supported. * Legacy Mode (`--std=legacy`): Allows compilation of older Fortran codebases that use non-standard or deprecated syntax. * LFortran Mode (`--std=lf`): Default mode focusing on modern Fortran features, including experimental extensions beyond the current standards. ## Extensions The extensions are currently in development and are planned to include: * Global Scope (statements outside of a program block). * Interactive Fortran (in alpha). * Jupyter integration. * Support for GPUs and other accelerators. * Type inference (`:=` operator and `--infer` mode). ### Type Inference with `:=` **Experimental, subject to change.** The `:=` operator declares a new variable whose type is inferred from the right-hand side. It is closely inspired by Go's short variable declaration (`:=`), where it is the dominant way to declare local variables. The rationale is the same: when the right-hand side already communicates the type, repeating it on the left is redundant noise. `:=` makes declarations visible at a glance without requiring the programmer to spell out types that the compiler can deduce. `:=` is not standard Fortran syntax. It is an LFortran-specific extension, and the compiler emits a warning on each use to make this clear. The `--infer` flag suppresses the warning. ```fortran x := 42 ! integer y := 3.14d0 ! real(8) z := (1.0d0, 2.0d0) ! complex(8) vals := [1, 2, 3] ! integer, dimension(3) p := point_t(0.0, 0.0) ! type(point_t) ``` #### Rules `:=` always declares a new variable. It never assigns to an existing one. ```fortran x := 5 x = 10 ! ok: plain assignment to existing variable x := 10 ! error: x is already declared in this scope ``` ```fortran integer :: x x := 5 ! error: x is already declared ``` Inner blocks may shadow outer variables: ```fortran x := 5 block x := "hello" ! ok: new x in inner scope end block ! outer x is still integer 5 ``` Supported right-hand sides: integer, real, complex, logical, character scalars; fixed-size arrays when dimensions are compile-time constants; derived types via structure constructors or typed expressions. The inferred kind matches the expression (`3.14d0` produces `real(8)`). #### Guidance Use `:=` when the type is evident from the right-hand side: ```fortran cfg := load_config("input.nml") origin := point_t(0.0, 0.0) coeffs := [1.0d0, 0.5d0, 0.25d0] ``` Use explicit declarations when the type matters for clarity or safety: ```fortran real(dp) :: result result = compute(data) ! reader sees the type; catches signature changes integer :: i, n ! simple counters are clearer with explicit types ``` #### `--infer` mode `--infer` enables a second, more permissive form of inference: the first plain `=` to an undeclared name declares it, like a scripting language. This is intended for interactive and notebook use. | Feature | Syntax | Declares | Intended for | |---------|--------|----------|--------------| | `:=` | `x := expr` | Always | Production code | | `--infer` | `x = expr` | On first use | Interactive / notebooks | `:=` works independently of `--infer`. When both are active, either form declares, but `:=` makes the intent explicit. ## Interactive Compiler LFortran supports an interactive mode; just run the `lfortran` command to start it. ## Invoking LFortran The LFortran compiler supports numerous command-line flags to select compilation options, output options, link options and so on. ### Compiler information * `--print-targets`, Print the registered CPU targets * `--version`, Show the current version ### Source code format * `--fixed-form`, Parse the file assuming Fortran 66 format (6 spaces) * `--fixed-form-infer`, Use heuristics to infer if a file is in fixed form ### Source code processing * `--cpp`, Enable C preprocessing * `-E`, Preprocess only; do not compile, assemble or link ### Other inputs * `-D =` Define a macro (or 1 if omitted) * `-I `, Include path for `include` statements * `-L `, Library path for shared libraries * `-l `, Link library naming a linkable shared library ### Compiler feature selections * `--fast`, Best performance (disable strict standard compliance) * `--implicit-argument-casting`, Allow implicit argument casting * `--implicit-interface`, Allow implicit interface * `--implicit-typing`, Allow implicit typing * `--openmp`, Enable OpenMP * `--print-leading-space`, Print leading white space if format is unspecified * `--realloc-lhs-arrays`, Reallocate left hand side automatically for arrays * `--disable-realloc-lhs-arrays`, Disables reallocating left hand side automatically for arrays * `--target `, Generate code for the given target * `--backend` flag is used to specify the target backend for code generation in LFortran. The supported backends are: - `llvm`: The most advanced and default backend, used for generating LLVM IR or machine code through LLVM. - `wasm`: For generating `Webassembly` via our custom `wasm` backend. - `c`: For generating C code. - `cpp`: For generating C++ code (requires the Kokkos library). - `x86`: For generating x86 machine code directly (without LLVM). - `fortran`: For generating Fortran code. - `julia`: For generating Julia code. ### Compiler text outputs * `--error-format `, Control how errors are produced (human, short) * `--no-error-banner`, Turn off error banner * `--no-warnings`, Turn off all warnings * `-S`, Emit assembly, do not assemble or link * `--time-report`, Show compilation time report * `-v`, Be more verbose ### Compiler binary outputs * `-c`, Compile and assemble, do not link * `--separate-compilation`, Generate object code into .o files * `-J `, Where to save mod files * `-o `, Specify the file to place the compiler's output into * `--static`, Create a static executable ### Compiler debugging A number of command-line options select various text outputs useful for debugging the compiler. See `lfortran --help` for a list. ## Examples The following commands and code demonstrate basic operation of the compiler. ``` lfortran helloworld.f90 Hello World! lfortran -o hw helloworld.f90 ./hw Hello World! cat helloworld.f90 program hello_world implicit none write (*, *) 'Hello World!' end program hello_world ``` Here is a simple example with a module: ``` lfortran -c varray.f90 lfortran usev.f90 sum is 7.20000000e+01 cat varray.f90 module varray integer :: nsize end module varray cat usev.f90 program usev use varray real, allocatable, dimension(:) :: A integer :: i nsize = 8 allocate(A(nsize)) do i = 1, nsize A(i) = 2.0*i end do print *, " sum is ", (A(1)+A(nsize))*nsize/2.0 deallocate(A) end program usev ``` The compile command for the module requires `-c` to avoid automatic running of the code. ## Formatting Fortran source files The `lfortran` compiler will automatically format source files with the `fmt` option. You can select auto-indent for modules, and in-place update of the Fortran source file with the `-i` option (use with caution!). ``` lfortran fmt varray.f90 module varray integer :: nsize real, allocatable, dimension(:) :: A end module varray ``` Or add spaces and indentation as follows: ``` lfortran fmt --spaces 4 --indent-unit varray.f90 module varray integer :: nsize real, allocatable, dimension(:) :: A end module varray ``` ## Selecting the C Compiler By default LFortran uses the `clang` compiler. On some systems the compiler has a version number or spelling difference. The compiler can be changed with the `LFORTRAN_CC` symbol: ``` unset LFORTRAN_CC lfortran hw.f90 Hello World! export LFORTRAN_CC=gcc lfortran hw.f90 Hello World! export LFORTRAN_CC=clang-14 lfortran hw.f90 sh: clang-14: not found ...(further error messages)... ``` ## Differences from other compilers GNU, Intel and LLVM Fortran use "standard" Fortran carriage control where the first character of each output line controls a conceptual "line printer". A space " " means single-space, a zero "0" means double-space and one "1" means form-feed before printing. This is obsolete and LFortran omits this unless `--print-leading-space` is selected at compile-time. There is currently no way to specify detailed compiler options to Clang such as `-O3` or `-flto` (optimization and link-time optimization). GNU extension declarations `real*8 xvalue` are accepted but deprecated. This was never standard-conforming Fortran; it is an old IBM extension that predates Fortran-77. lfortran-0.63.0/doc/src/intrinsics/0000775000175000017500000000000015174404631017341 5ustar alastairalastairlfortran-0.63.0/doc/src/intrinsics/misc/0000775000175000017500000000000015174404631020274 5ustar alastairalastairlfortran-0.63.0/doc/src/intrinsics/misc/cpu_time.md0000664000175000017500000000223515174404631022425 0ustar alastairalastair# cpu_time(x): CPU Elapsed Time CPU elapsed time in seconds. ## Declaration ### Syntax ```fortran retval = cpu_time(x) pure subroutine cpu_time(x) ``` ### Arguments `x` the input value should be of type real with `intent(out)`. ### Return values None. ## Description **cpu_time(time)** returns a real value representing the elapsed CPU time in seconds. If tine source is available, time will be reported with microsecond resolution. If no time source is available, TIME is set to -1.0. This is useful for testing segments of code to determine computation time. For `cpu_time(time)` the absolute value is meaningless, only differences between subsequent calls to this subroutine, as shown in the example below, should be used. ## Types Supported input parameter types is real with `intent(out)`. ```fortran pure subroutine cpu_time(t) real(dp), intent(out) :: t call c_cpu_time(t) end subroutine ``` ## Examples ```fortran program intrinsics_cpu_time implicit none real(dp) :: t1, t2 call cpu_time(t1) print *, "Some computation" call cpu_time(t2) print *, "Total time: ", t2-t1 end program ``` **Result:** ``` Some computation 20 ``` ## See Also lfortran-0.63.0/doc/src/intrinsics/misc/new_line.md0000664000175000017500000000157215174404631022423 0ustar alastairalastair# new_line(x): New Line Character New line character. ## Declaration ### Syntax ```fortran retval = new_line(x) function new_line(c) ``` ### Arguments The input parameter `x` must be of type character. It can be a scalar or an array. ### Return values The return value is a character of length one with the new line character appended of the same kind as of `x`. ## Description **new_line(x)** returns the new line character. The return value is the ASCII newline character. ## Types Supported input parameter types is character. ```fortran function new_line(c) result(r) character(len=1), intent(in) :: c character(len=1) :: r end function ``` ## Examples ```fortran program intrinsics_new_line implicit none print *, 'This is record 1.'//new_line('A')//'This is record 2.' end program ``` **Result:** ``` This is record 1.A This is record 2. ``` ## See Also None. lfortran-0.63.0/doc/src/intrinsics/misc/date_and_time.md0000664000175000017500000000451715174404631023402 0ustar alastairalastair# date_and_time([date, time, zone, values]): Date and Time Date and time subroutine. ## Declaration ### Syntax ```fortran call date_and_time([date, time, zone, values]) subroutine date_and_time(date, time, zone, values) ``` ### Arguments `date` the input value of character type, which has length 8 or larger. It is of default kind. It is `intent(out)` and has form `ccyymmdd`. `time` the input value of character type, which has length 10 or larger. It is of default kind. It is `intent(out)` and has form `hhmmss.sss`. `zone` the input value of character type, which has length 5 or larger. It is of default kind. It is `intent(out)` and has from `(+-)hhmm`, representing the difference with respect to Coordinates Universal Time (UTC). Unavailable time and date parameters return blanks. `values` the input value of integer type, 8 bits. It is `intent(out)`. It provides the following: - `value(1)`: The year. - `value(2)`: The month. - `value(3)`: The day of the month. - `value(4)`: Time difference with UTC in minutes. - `value(5)`: The hour of the day. - `value(6)`: The minutes of the hour. - `value(7)`: The seconds of the minutes. - `value(8)`: The milliseconds of the second. ### Return values None. ## Description **date_and_time([date, time, zone, values])** reports the corresponding date and time information from the real time system clock. `date`, `time`, `zone`, `values` represents date, time, zone, and values as decribed in arguments above. Unavailable or errorneous date and time parameters return blanks. ## Types Supported input parameter types is real with `intent(out)`. ```fortran subroutine date_and_time(date, time, zone, values) character(len=*), intent(out), optional :: date, time, zone integer, intent(out), optional :: values(8) end subroutine ``` ## Examples ```fortran program intrinsics_date_and_time implicit none character(len=8) :: date character(len=10) :: time character(len=5) :: zone integer,dimension(8) :: values ! using keyword arguments call date_and_time(date,time,zone,values) call date_and_time(date=date,zone=zone) call date_and_time(time=time) call date_and_time(values=values) print '(a,2x,a,2x,a)', date, time, zone print '(8i5)', values end program ``` **Result:** ``` 20220812 075654.679 +0000 2022 8 12 0 7 56 54 679 ``` ## See Also [cpu_time](cpu_time.md). lfortran-0.63.0/doc/src/intrinsics/misc/command_argument_count.md0000664000175000017500000000124715174404631025352 0ustar alastairalastair# command_argument_count(): Number of Command Line Arguments Get number of command line arguments. ## Declaration ### Syntax ```fortran retval = command_argument_count() function command_argument_count() ``` ### Arguments None. ### Return values The return value is of integer type and of default kind. ## Description **command_argument_count()** returns the number of arguments passed on the command line when the named program was invoked. ## Types Any. ## Examples ```fortran program intrinsics_command_argument_count implicit none print *, command_argument_count() end program ``` **Result:** ``` intrinsics_command_argument_count a b 2 ``` ## See Also lfortran-0.63.0/doc/src/intrinsics/numeric.md0000664000175000017500000000041115174404631021321 0ustar alastairalastair# Numeric Intrinsic Functions ```{toctree} numeric/abs numeric/aimag numeric/aint numeric/anint numeric/ceiling numeric/cmplx numeric/conjg numeric/digits numeric/dim numeric/epsilon numeric/erf numeric/erfc numeric/exp numeric/floor numeric/gamma numeric/mod ``` lfortran-0.63.0/doc/src/intrinsics/character.md0000664000175000017500000000022615174404631021617 0ustar alastairalastair# Character Intrinsic Functions ```{toctree} character/achar character/adjustl character/adjustr character/char character/lge character/len_trim ``` lfortran-0.63.0/doc/src/intrinsics/numeric/0000775000175000017500000000000015174404631021003 5ustar alastairalastairlfortran-0.63.0/doc/src/intrinsics/numeric/anint.md0000664000175000017500000000202015174404631022430 0ustar alastairalastair# anint(x, [kind]): Round to Nearest Whole Number Round to nearest whole number. ## Declaration ### Syntax ```fortran retval = anint(x, [kind]) elemental real function anint(x, [kind]) ``` ### Arguments `x` the input value must be of type real. `kind` the optional input parameter initialises the kind of the result. ### Return values The return value is of type integer(kind) if kind is passed as input parameter. If not, default kind real is returned. The return value is equal to rounded whole number. ## Description **anint(x)** calculates rounded value of input parameter `x`. If `x` is less than or equal to 0 i.e., if `x` is negative or 0, `anint(x)` returns `aint(x - 0.5)`. If `x` is greater than 0, `anint(x)` returns `aint(x + 0.5)`. The optional parameter `kind` specifies the kind of the result. ## Types Supported argument types is real. ## Examples ```fortran program intrinsics_anint print *, anint(2.6) print *, anint(-2.6) end program ``` **Result:** ``` 3.0 -3.0 ``` ## See Also [aint](aint.md). lfortran-0.63.0/doc/src/intrinsics/numeric/exp.md0000664000175000017500000000203515174404631022121 0ustar alastairalastair# exp(x): Exponential Exponential function. ## Declaration ### Syntax ```fortran retval = exp(x) elemental real function exp(x) ``` ### Arguments `x` the input value must be of type real or complex. ### Return values The return value is of same type as of the input argument, `x`. ## Description **exp(x)** computes the base $e$ exponential of `x`, i.e., $e^x$. If `x` is of type complex, its imaginary part is considered as a value in radians. ## Types Supported argument types is real and complex. ```fortran interface exp module procedure sexp, dexp, cexp, zexp end interface contains elemental real(sp) function sexp(x) real(sp), intent(in) :: x end function elemental real(dp) function dexp(x) real(dp), intent(in) :: x end function elemental complex(sp) function cexp(x) complex(sp), intent(in) :: x end function elemental complex(dp) function zexp(x) complex(dp), intent(in) :: x end function ``` ## Examples ```fortran program intrinsics_exp print *, exp(0.5) end program ``` **Result:** ``` 1.64872 ``` ## See Also lfortran-0.63.0/doc/src/intrinsics/numeric/aimag.md0000664000175000017500000000206115174404631022402 0ustar alastairalastair# aimag(x): Imaginary Part Imaginary part of complex number. ## Declaration ### Syntax ```fortran retval = aimag(x) elemental real(sp) function aimag(x) elemental real(dp) function aimag(x) ``` ### Arguments `x` the input value must be of complex type. ### Return values The return value is imaginary part of type real and kind same as of `x`. ## Description **aimag(x)** returns the imaginary part of the input complex argument `x`. For `x` complex input value, the result is calculated using mathematical formula: $x + iy$ $i$ the imaginary part is the result. ## Types Supported argument types are complex. ```fortran interface aimag module procedure saimag, daimag end interface contains elemental real(sp) function saimag(x) complex(sp), intent(in) :: x end function elemental real(dp) function daimag(x) complex(dp), intent(in) :: x end function ``` ## Examples ```fortran program intrinsics_aimag implicit none print *, aimag(1.0, -3.0) end program ``` **Result:** ``` -3.0 ``` ## See Also [ceiling](ceiling.md), [floor](floor.md). lfortran-0.63.0/doc/src/intrinsics/numeric/abs.md0000664000175000017500000000311615174404631022073 0ustar alastairalastair# abs(x): Absolute Value Absolute value. ## Declaration ### Syntax ```fortran retval = abs(x) elemental integer function iabs(x) elemental real(sp) function abs(x) ``` ### Arguments `x` the input value, can be integer, real, or complex. ### Return values The return value is of type and kind same as of `x`. For complex input value, return value is real. ## Description **abs(x)** calculates and returns absolute value of `x`. Result is calculated using mathematical formula: $|x|$ If `x` is complex, the result is calculated using mathematical formula: $\sqrt{(x^2 + y^2)}$ ## Types Supported argument types are real and integer. ```fortran interface mod module procedure iabs, i8abs, i16abs, i64abs, sabs, dabs, cabs, zabs end interface contains elemental integer(i16) function i16abs(x) integer(i16), intent(in) :: x end function elemental integer(i8) function i8abs(x) integer(i8), intent(in) :: x end function elemental integer function iabs(x) integer, intent(in) :: x end function elemental integer function i64abs(x) integer(i64), intent(in) :: x end function elemental real(sp) function sabs(x) real(sp), intent(in) :: x end function elemental real(dp) function dabs(x) real(dp), intent(in) :: x end function elemental real(sp) function cabs(x) complex(sp), intent(in) :: x end function elemental real(dp) function zabs(x) complex(dp), intent(in) :: x end function ``` ## Examples ```fortran program intrinsics_abs implicit none print *, abs(1.5) print *, abs(-1.5) end program ``` **Result:** ``` 1.5 1.5 ``` ## See Also [ceiling](ceiling.md), [floor](floor.md). lfortran-0.63.0/doc/src/intrinsics/numeric/epsilon.md0000664000175000017500000000152215174404631022776 0ustar alastairalastair# epsilon(x): Epsilon Epsilon function. ## Declaration ### Syntax ```fortran retval = epsilon(x) elemental real function epsilon(x) ``` ### Arguments `x` the input value must be of type real. ### Return values The return value is of same type as of the input argument. ## Description **epsilon(x)** computes the smallest number $\epsilon$ of the same kind as `x` following: $1 + \epsilon > 1$ ## Types Supported argument types is real. ```fortran interface epsilon module procedure sepsilon, depsilon end interface contains elemental real(sp) function sepsilon(x) real(sp), intent(in) :: x end function elemental real(dp) function depsilon(x) real(dp), intent(in) :: x end function ``` ## Examples ```fortran program intrinsics_epsilon print *, epsilon(3.143) end program ``` **Result:** ``` 1.19209290E-07 ``` ## See Also lfortran-0.63.0/doc/src/intrinsics/numeric/erfc.md0000664000175000017500000000214615174404631022247 0ustar alastairalastair# erfc(x): Complementary Error Complementary error function. ## Declaration ### Syntax ```fortran retval = erfc(x) elemental real function erfc(x) ``` ### Arguments `x` the input value must be of type real. ### Return values The return value is of type real and of the same kind as of the input parameter `x`. `erfc(x)` returns $1 - erf(x)$. ## Description **erf(x)** computes the error function of `x`. The result lies in the range: $0 \leq erf (x) \leq 2$ It is calculated using: $\frac{2}{\sqrt\pi}\int_{x}^{\infty}e^{-t^2}dt$ It is used in instances when the large loss of relative accuracy occurs if `erf(x)` is called for large `x` and the result is subtracted from 1. ## Types Supported argument types is real. ```fortran interface erfc module procedure serfc, derfc end interface contains elemental real(sp) function serfc(x) real(sp), intent(in) :: x end function elemental real(dp) function derfc(x) real(dp), intent(in) :: x end function ``` ## Examples ```fortran program intrinsics_erfc print *, erfc(1.0) end program ``` **Result:** ``` 0.1572992057 ``` ## See Also [erf](erf.md). lfortran-0.63.0/doc/src/intrinsics/numeric/dim.md0000664000175000017500000000117615174404631022103 0ustar alastairalastair# dim(x, y): Positive Difference or 0 Positive difference or 0. ## Declaration ### Syntax ```fortran retval = dim(x, y) ``` ### Arguments `x` the input value must be of type real or integer. `y` the input value must of of the same type and kind as of `x`. ### Return values The return value is of type integer or real. ## Description **dim(x)** computes the difference $x - y$, if the result is positive, otherwise returns 0. ## Types Supported argument types are real and integer. ## Examples ```fortran program intrinsics_dim print *, dim(2, 3) print *, dim(3, 2) end program ``` **Result:** ``` 0 1 ``` ## See Also lfortran-0.63.0/doc/src/intrinsics/numeric/floor.md0000664000175000017500000000310215174404631022442 0ustar alastairalastair# floor(x, kind): Integer Floor Integer floor function. ## Declaration ### Syntax ```fortran retval = floor(x) elemental integer function floor(x, kind) ``` ### Arguments `x` the input value must be of type real. `kind` the optional input parameter must be a scalar integer constant expression. ### Return values The return value is of type integer(kind) if kind is passed as input parameter. If not, default kind integer is returned. The return value is equal to or nearest greatest integer less than or equal to `x`. ## Description **floor(x)** returns the greatest integer less than or equal to x. It returns an integer value unless spefically specified using second optional paramter. ## Types Supported argument types is real. ```fortran interface floor module procedure sfloor_i32, sfloor_i64, dfloor_i32, dfloor_i64 end interface contains elemental integer(i32) function sfloor_i32(x, kind) real(sp), intent(in) :: x integer(i32), intent(in) :: kind end function elemental integer(i64) function sfloor_i64(x, kind) real(sp), intent(in) :: x integer(i64), intent(in) :: kind end function elemental integer(i32) function dfloor_i32(x, kind) real(dp), intent(in) :: x integer(i32), intent(in) :: kind end function elemental integer(i64) function dfloor_i64(x, kind) real(dp), intent(in) :: x integer(i64), intent(in) :: kind end function ``` ## Examples ```fortran program intrinsics_floor implicit none real, parameter :: x = 3.1 print *, floor(x) print *, floor(-3.1) end program ``` **Result:** ``` 3 -4 ``` ## See Also [ceiling](ceiling.md), [mod](mod.md). lfortran-0.63.0/doc/src/intrinsics/numeric/cmplx.md0000664000175000017500000000325115174404631022451 0ustar alastairalastair# cmplx(x [, [, kind]]): Convert to Complex Conversion to complex type. ## Declaration ### Syntax ```fortran retval = cmplx(x, y) #define CMPLX(x, y) ``` `cmplx(x, y)` is one of the intrinsic present in ASR. ### Arguments `x` the input value must be of integer, real, or complex. `y` the optional input value must be of type integer or real. It should be only present in case `x` is not complex. `kind` the optional input value of integer expression type for initialisation indicating the kind parameter of the result. ### Return values The return value is of complex type, with a kind defined by input `kind` type specified. If the `kind` is not specified, the return value is of default `kind` `complex` type. ## Description **cmplx(x, [, y [, kind]])** converts the input value to complex representation: `x` to real component of complex number. if `y` is present, it is converted to the imaginary component. If `y` is not present, the imaginary component is set to 0.0. If `x` is complex then `y` must not be present. For `x` complex input value, the result is calculated using mathematical formula: $x + iy$ $i$ the imaginary part is the result. ## Types Supported argument types are integer, real, or complex. ```c #define _Imaginary_I (I) #define CMPLX(x, y) ((double complex)((double)(x) + _Imaginary_I * (double)(y))) #define CMPLXF(x, y) ((float complex)((float)(x) + _Imaginary_I * (float)(y))) #define CMPLXL(x, y) ((long double complex)((long double)(x) + \ _Imaginary_I * (long double)(y))) ``` ## Examples ```fortran program intrinsics_cmplx implicit none print *, cmplx(1.0, -3.0) end program ``` **Result:** ``` 1 - 3i ``` ## See Also lfortran-0.63.0/doc/src/intrinsics/numeric/conjg.md0000664000175000017500000000163515174404631022432 0ustar alastairalastair# conjg(x): Complex Conjugate Complex conjugate function. ## Declaration ### Syntax ```fortran retval = conjg(x) function conjgz32(x) function conjgz64(x) ``` ### Arguments `x` the input value must be of type complex. ### Return values The return value is of complex type. ## Description **conjg(x)** converts the input value `x` to its conjugate. For `x` complex input value, the result is calculated using mathematical formula: $x + iy$ converted to $x - iy$ $i$ the imaginary part is the result. ## Types Supported argument types is complex. ```fortran interface conjg module procedure conjgz32, conjgz64 end interface contains function conjgz32(x) complex(sp) :: x end function function conjgz64(x) complex(dp) :: x end function ``` ## Examples ```fortran program intrinsics_conjg implicit none print *, conjg((1.0, -3.0)) end program ``` **Result:** ``` 1 + 3i ``` ## See Also lfortran-0.63.0/doc/src/intrinsics/numeric/ceiling.md0000664000175000017500000000167215174404631022745 0ustar alastairalastair# ceiling(x): Integer Ceiling Integer ceiling function ## Declaration ### Syntax ```fortran retval = ceiling(x) elemental integer function ceiling(x) ``` ### Arguments The input value `x` may be of type real or integer. ### Return values The return value is of type integer and nearest greater integer. ## Description **ceiling(x)** returns the least integer greater than or equal to `x`. ## Types Supported input parameter types are integer and real. ```fortran interface ceiling module procedure sceiling, dceiling end interface contains elemental integer function sceiling(x) real(sp), intent(in) :: x end function elemental integer function dceiling(x) real(dp), intent(in) :: x end function ``` ## Examples ```fortran program intrinsics_ceiling implicit none real :: x = 63.29 print *, ceiling(x) print *, ceiling(-63.29) end program ``` **Result:** ``` 64 -63 ``` ## See Also [floor](floor.md), [mod](mod.md). lfortran-0.63.0/doc/src/intrinsics/numeric/erf.md0000664000175000017500000000160715174404631022105 0ustar alastairalastair# erf(x): Error Error function. ## Declaration ### Syntax ```fortran retval = erf(x) elemental real function erf(x) ``` ### Arguments `x` the input value must be of type real. ### Return values The return value is of type real and of the same kind as of the input parameter `x`. ## Description **erf(x)** computes the error function of `x`. The result lies in the range: $-1 \leq erf (x) \leq 1$ It is calculated using: $\frac{2}{\sqrt\pi}\int_0^xe^{-t^2}dt$ ## Types Supported argument types is real. ```fortran interface erf module procedure serf, derf end interface contains elemental real(sp) function serf(x) real(sp), intent(in) :: x end function elemental real(dp) function derf(x) real(dp), intent(in) :: x end function ``` ## Examples ```fortran program intrinsics_erf print *, erf(0.5) end program ``` **Result:** ``` 0.520499877 ``` ## See Also [erfc](erfc.md). lfortran-0.63.0/doc/src/intrinsics/numeric/aint.md0000664000175000017500000000176015174404631022264 0ustar alastairalastair# aint(x, [kind]): Truncate to a Whole Number Truncate to a whole number. ## Declaration ### Syntax ```fortran retval = aint(x, [kind]) elemental real function aint(x, [kind]) ``` ### Arguments `x` the input value must be of type real. `kind` the optional input parameter initialises the kind of the result. ### Return values The return value is of type integer(kind) if kind is passed as input parameter. If not, default kind real is returned. The return value is equal to or nearest largest whole number greater than or equal to `x` not exceeding its magnitude. ## Description **aint(x)** returns the nearest largest whole number greater than or equal to `x` not exceeding input value's magnitude. The optional parameter `kind` specifies the kind of the result. ## Types Supported argument types is real. ## Examples ```fortran program intrinsics_aint print *, aint(3.1) print *, floor(-3.1) end program ``` **Result:** ``` 3 -3 ``` ## See Also [ceiling](ceiling.md), [mod](mod.md). lfortran-0.63.0/doc/src/intrinsics/numeric/gamma.md0000664000175000017500000000217315174404631022412 0ustar alastairalastair# gamma(x): Gamma Gamma function. ## Declaration ### Syntax ```fortran retval = gamma(x) elemental real function gamma(x) ``` ### Arguments `x` the input value must be of type real. It should not be zero or a negative integer. ### Return values The return value is of same type and kind as of `x`. ## Description **gamma(x)** computes $\gamma(x)$. For positive, integer value of `x`, the Gamma function simplifies to factorial function: $\gamma(x) = (x-1)!$ In general, if $x > 0$: $\gamma(x) = \int_{0}^{\infty} e^{-t} dt$ and if $-n-1 < x < -n$ where n is an integer >= 0: $\gamma(x) = \int_{0}^{\infty}(e ^{-t} - \sum\limits_{k=0}^n \frac{(-t)^k}{k!} dt)$ ## Types Supported argument types is real. ```fortran interface gamma module procedure sgamma, dgamma end interface contains elemental real(sp) function sgamma(x) real(sp), intent(in) :: x end function elemental real(dp) function dgamma(x) real(dp), intent(in) :: x end function ``` ## Examples ```fortran program intrinsics_gamma print *, gamma(0.5) print *, gamma(1.0) end program ``` **Result:** ``` 1.77245 1.000 ``` ## See Also [epsilon](epsilon.md) lfortran-0.63.0/doc/src/intrinsics/numeric/mod.md0000664000175000017500000000330315174404631022103 0ustar alastairalastair# mod(x, y): Modulus Modulus or remainder function. ## Declaration ### Syntax ```fortran retval = mod(x, y) elemental integer function imod(x, y) elemental real(sp) function mod(x, y) ``` ### Arguments `x` the input value, can be integer or real. `y` second input parameter should be same type and kind as `x` and not equal to 0. ### Return values The return value is of type and kind same as of `x`. The result is calculated using mathematical modulo or remainder as: `x - INT (x / y) * y`. If `y` is 0, the result is undefined like `any integer value / 0`. ## Description **mod(x, y)** calculates and returns modulo or remainder when `x` is divided by `y`. The result is calculated using `x - INT(x / y) * y` i.e., result is remainder when first argument is mathematically divided by second argument. The return value should be less than `y`. ## Types Supported argument types are real and integer. ```fortran interface mod module procedure i8mod, i16mod, imod, i64mod, smod, dmod end interface contains elemental integer(i16) function i16mod(x, y) integer(i16), intent(in) :: x, y end function elemental integer(i8) function i8mod(x, y) integer(i8), intent(in) :: x, y end function elemental integer function imod(x, y) integer, intent(in) :: x, y end function elemental integer function i64mod(x, y) integer(i64), intent(in) :: x, y end function elemental real(sp) function smod(x, y) real(sp), intent(in) :: x, y end function elemental real(dp) function dmod(x, y) real(dp), intent(in) :: x, y end function ``` ## Examples ```fortran program intrinsics_mod implicit none print *, mod(-5, 3) end program ``` **Result:** ``` -2 ``` ## See Also [ceiling](ceiling.md), [floor](floor.md). lfortran-0.63.0/doc/src/intrinsics/numeric/digits.md0000664000175000017500000000106615174404631022613 0ustar alastairalastair# digits(x): Significant Binary Digits Significant binary digits. ## Declaration ### Syntax ```fortran retval = digits(x) ``` ### Arguments `x` the input value must be of type real or integer. ### Return values The return value is of type integer. ## Description **digits(x)** returns the number of significant binary digits of the internal mopdel representation of `x`. ## Types Supported argument types are real and integer. ## Examples ```fortran program intrinsics_digits print *, digits(3.1) end program ``` **Result:** ``` 24 ``` ## See Also lfortran-0.63.0/doc/src/intrinsics/misc.md0000664000175000017500000000020115174404631020607 0ustar alastairalastair# Miscellaneous Intrinsic Functions ```{toctree} misc/command_argument_count misc/cpu_time misc/date_and_time misc/new_line ``` lfortran-0.63.0/doc/src/intrinsics/kind-type.md0000664000175000017500000000010115174404631021557 0ustar alastairalastair# Kind Type Intrinsic Functions ```{toctree} kind-type/kind ``` lfortran-0.63.0/doc/src/intrinsics/character/0000775000175000017500000000000015174404631021275 5ustar alastairalastairlfortran-0.63.0/doc/src/intrinsics/character/char.md0000664000175000017500000000226715174404631022543 0ustar alastairalastair# char(x, [, kind]): Integer to Character Integer to character conversion. ## Declaration ### Syntax ```fortran retval = char(x) character function char(x) ``` ### Arguments `x`: the input value of integer type. `kind`: an optional input value of type integer constant expression for initialization. This indicates the kind parameter of the result. ### Return value The return value is of type character of length 1. The return value is of kind `kind` if optional input value is passed, otherwise the kind is default kind. ## Description **char(x)** returns the character represented by the ASCII character set at `x` position. If `x` is outside the ASCII character set integer value, i.e., if `x` is not represented in the ASCII character set, the return value is undefined. It is a runtime builtin function. ## Types Supported argument type is integer. ```fortran interface character function char(x) integer, intent(in) :: x end function end interface ``` ## Examples ```fortran program intrinsics_char implicit none character :: L = char(76) print *, L end program ``` **Result:** ``` L ``` ## See Also [achar](achar.md), [iachar](iachar.md), [ichar](ichar.md) lfortran-0.63.0/doc/src/intrinsics/character/lge.md0000664000175000017500000000255315174404631022373 0ustar alastairalastair# lge(x, y): Lexically Greater or Equal Lexically greater than or equal. ## Declaration ### Syntax ```fortran retval = lge(x, y) function lge(x, y) ``` ### Arguments `x` input value of type character. `y` input value of type character. `x` and `y` can be seen as string A and string B. ### Return values The return value is of logical `true` or `false` type. `True` if `x` string is lexically greater than or equal to `y`. `False` if they are not. ## Description **lge(x, y)** determines if input string `x` is lexically greater than or equal to input string `y`. The two strings in comparison are interpreted as containing ASCII character codes. ## Types Argument types should be of type character literal. ```fortran module lfortran_intrinsic_string use, intrinsic :: iso_fortran_env, only: i64 => int64 implicit none interface repeat module procedure repeati32, repeati64 end interface contains function lge(x, y) result(r) character(len=*),intent(in) :: x character(len=*),intent(in) :: y logical :: r end function ``` ## Examples ```fortran program intrinsics_lge implicit none character(len = 10) :: s1 = 'abcde' character(len = 10) :: s2 = 'xyz' character(len = 10) :: s3 = 'AB' character(len = 10) :: s4 = 'AAB' print *, lge(s1, s2) end program ``` **Result:** ``` false true ``` ## See Also [len_trim](len_trim.md). lfortran-0.63.0/doc/src/intrinsics/character/len_trim.md0000664000175000017500000000174515174404631023437 0ustar alastairalastair# len_trim(string): Length Ignoring Trailing Blanks Length of a character string ignoring trailing blank character(s). ## Declaration ### Syntax ```fortran retval = len_trim(string) integer elemental function len_trim(string) ``` ### Arguments `string` the input value of character type. ### Return value The return value is of type unsigned integer. ## Description **len_trim(string)** returns the length of the character argument without including trailing blank character(s). ## Types Supported argument type is character scalar. ```fortran interface repeat module procedure repeati32, repeati64 end interface contains integer elemental function len_trim(string) character(len=*), intent(in) :: string end function ``` ## Examples ```fortran program intrinsics_len_trim implicit none character(*), parameter :: s1 = " A B " integer:: retval retval = len_trim(s1) print *, retval end program ``` **Result:** ``` 4 ``` ## See Also [lge](lge.md). lfortran-0.63.0/doc/src/intrinsics/character/adjustl.md0000664000175000017500000000171615174404631023272 0ustar alastairalastair# adjustl(string): Left Adjust String Left adjust a string. ## Declaration ### Syntax ```fortran retval = adjustl(string) elemental function adjustl(string) ``` ### Arguments `string`: the input value must be of character type. ### Return value The return value is of type character and of the same kind as of input value `string`, with leading spaces removed and same number of spaces appended. ## Description **adjustl(string)** adjusts input string by removing any leading spaces and appending same number of spaces. ## Types Supported argument type is character. ```fortran interface repeat module procedure repeati32, repeati64 end interface contains function adjustl(string) character(len=*), intent(in) :: string end function ``` ## Examples ```fortran program intrinsics_adjustl implicit none character(*), parameter :: s1 = " A B " print *, adjustl(s1) end program ``` **Result:** ``` A B ``` ## See Also [lge](lge.md). lfortran-0.63.0/doc/src/intrinsics/character/adjustr.md0000664000175000017500000000177715174404631023307 0ustar alastairalastair# adjustr(string): Right Adjust String Right adjust a string. ## Declaration ### Syntax ```fortran retval = adjustr(string) elemental function adjustr(string) ``` ### Arguments `string`: the input value must be of character type. ### Return value The return value is of type character and of the same kind as of input value `string`, with trailing spaces removed and same number of spaces added at the start. ## Description **adjustr(string)** adjusts input string by removing any trailing spaces and adding same number of spaces at the start of the input string. ## Types Supported argument type is character. ```fortran interface repeat module procedure repeati32, repeati64 end interface contains function adjustr(string) character(len=*), intent(in) :: string end function ``` ## Examples ```fortran program intrinsics_adjustr implicit none character(*), parameter :: s1 = "A B " print *, adjustr(s1) end program ``` **Result:** ``` A B ``` ## See Also [adjustl](adjustl.md). lfortran-0.63.0/doc/src/intrinsics/character/achar.md0000664000175000017500000000232615174404631022700 0ustar alastairalastair# achar(x, kind): To Character in ASCII set. Character represented by in the ASCII character set. ## Declaration ### Syntax ```fortran retval = achar(x, kind) character(len=1) elemental function achar(x, kind) ``` ### Arguments `x`: the input value of integer type. `kind`: an optional input value of type integer constant expression for initialization. ### Return value The return value is of type character of length 1. The return value is of kind `kind` if optional input value is passed, otherwise the kind is default kind. ## Description **achar(x, kind)** returns the character represented by the ASCII character set at `x` position. If `x` is outside the ASCII character set integer value, i.e., if `x` is not represented in the ASCII character set, the return value is undefined. It is a runtime builtin function. ## Types Supported argument type is integer. ```fortran interface character(len=1) function achar(x, kind) integer, intent(in) :: x integer, optional :: kind end function end interface ``` ## Examples ```fortran program intrinsics_achar implicit none character :: exclamation = achar(33) print *, exclamation end program ``` **Result:** ``` ! ``` ## See Also [lge](lge.md). lfortran-0.63.0/doc/src/intrinsics/array.md0000664000175000017500000000012615174404631021000 0ustar alastairalastair# Array Intrinsic Functions ```{toctree} array/allocated array/cshift array/size ``` lfortran-0.63.0/doc/src/intrinsics/mathematical.md0000664000175000017500000000031515174404631022313 0ustar alastairalastair# Mathematical Intrinsic Functions ```{toctree} mathematical/acos mathematical/acosh mathematical/asin mathematical/asinh mathematical/atan mathematical/atan2 mathematical/atanh mathematical/fraction ``` lfortran-0.63.0/doc/src/intrinsics/kind-type/0000775000175000017500000000000015174404631021245 5ustar alastairalastairlfortran-0.63.0/doc/src/intrinsics/kind-type/kind.md0000664000175000017500000000225715174404631022522 0ustar alastairalastair# kind(x): Kind of an Entity Kind of an entity. ## Declaration ### Syntax ```fortran retval = kind(x) integer function kind(x) ``` ### Arguments `x` the input value, can be logical, integer, real, complex, or character. It may be a scalar or array valued i.e., any intrinsic type. ### Return values The return value is of integer type and of default integer kind. ## Description **kind(x)** returns the kind parameter of the input argument `x`. ## Types Supported argument types are logical, integer, real, complex, or character. ```fortran module lfortran_intrinsic_kind implicit none contains integer function kind(x) result(r) logical(4), intent(in) :: x r = 4 end function integer function skind(x) result(r) real(4), intent(in) :: x r = 4 end function integer function dkind(x) result(r) real(8), intent(in) :: x r = 8 end function integer function lkind(x) result(r) logical(4), intent(in) :: x r = 4 end function end module ``` ## Examples ```fortran program intrinsics_kind use lfortran_intrinsic_kind, only: kind implicit none logical :: l4d logical(4) :: l4 print *, kind(l4d) print *, kind(l4) end program ``` **Result:** ``` 4 4 ``` ## See Also None. lfortran-0.63.0/doc/src/intrinsics/mathematical/0000775000175000017500000000000015174404631021772 5ustar alastairalastairlfortran-0.63.0/doc/src/intrinsics/mathematical/atan2.md0000664000175000017500000000341315174404631023322 0ustar alastairalastair# atan2(y, x): ArcTangent Arctangent function or inverse tangent function. ## Declaration ### Syntax ```fortran retval = atan2(y, x) elemental real(p) function atan2(y, x) ``` ### Arguments `y` the input value is the imaginary part of the complex expression $x + iy$ `x` the input value, must be real part of the complex expression. ### Return values The returned value has the kind and TYPE as of the input value `y`. The principal value of the argument function of the complex expression $x + iy$ is returned. ## Description **atan2(y, x)** computes the principal value of the argument function of the complex expression $x + iy$. This is used to transform from cartesian into polar coordinates and allows to determine the angle in the correct quadrant. It is also represented as: $tan^{-1}(\frac{y}{x})$ If `x` is nonzero, the result lies in the range: $-\pi <= atan(x) <= \pi$ The sign is positive if `y` is positive. If `y` is zero and `x` is strictly positive, then the result is 0. If `x` is negative and `y` is positive zero, then the result is $\pi$. If `x` is negative and `y` is negative zero, then the result is $-\pi$. If `x` is zero, then the magnitude of the result is $\frac{\pi}{2}$. If `y` is negative real zero, the result is $\frac{-\pi}{2}$. ## Types Supported argument type is real. ```fortran interface atan2 module procedure satan2, datan2 end interface contains interface elemental real(sp) function satan2(y, x) real(sp), intent(in) :: y, x end function elemental real(dp) function datan2(y, x) real(dp), intent(in) :: y, x end function end interface ``` ## Examples ```fortran program intrinsics_atan2 implicit none print *, atan2(2.679676, 1.0) end program ``` **Result**: ``` 0.699521642 ``` ## See Also lfortran-0.63.0/doc/src/intrinsics/mathematical/atan.md0000664000175000017500000000316515174404631023244 0ustar alastairalastair# atan(x): Trigonometric ArcTangent Trigonometric arctangent (inverse arctangent) function. ## Declaration ### Syntax ```fortran retval = atan(x) elemental real(p) function atan(x) elemental complex(p) function atan(x) ``` ### Arguments `x` the input value, can be real or complex; less than or equal to 1. ### Return values The returned value has the kind of the input value and TYPE may be real or complex. ## Description **atan(x)** computes the arctangent of the argument **x**. The arc tangent is the inverse function of the arctangent function. It is commonly used in trigonometry to find the angle when the lengths of the opposite side of a right triangle and base are known, i.e., perpendicular and base length. ## Types Supported argument types float, double, complex float, complex double. ```fortran interface atan module procedure satan, datan, catan, zatan end interface contains interface elemental real(sp) function satan(x) real(sp), intent(in) :: x end function elemental real(dp) function datan(x) real(dp), intent(in) :: x end function elemental complex(sp) function catan(x) complex(sp), intent(in) :: x end function elemental complex(dp) function zatan(x) complex(dp), intent(in) :: x end function end interface ``` ## Examples ```fortran program intrinsics_atan implicit none integer, parameter :: arg_x = kind(0.0) real(arg_x) :: x1 real :: retval_x real :: arg_x retval_x = atan(0.84147098) print *, ret_val_x retval_x = atan(x1) print *, ret_val_x end program ``` **Result**: ``` 0.699521642 0.699521642 ``` ## See Also [asin](asin.md), [acos](acos.md). lfortran-0.63.0/doc/src/intrinsics/mathematical/acos.md0000664000175000017500000000311315174404631023237 0ustar alastairalastair# acos(x): Trigonometric Arc Cosine Trigonometric arc cosine (inverse cosine) function. ## Declaration ### Syntax ```fortran retval = acos(x) elemental real(p) function acos(x) elemental complex(p) function acos(x) ``` ### Arguments `x` the input value, can be real or complex; less than or equal to 1. ### Return values The returned value has the kind of the input value and TYPE may be real or complex. ## Description **acos(x)** computes the arcsine of the argument **x**. The arc cosine is the inverse function of the cosine function. It is commonly used in trigonometry to find the angle when the lengths of the hypotenuse and the base side of a right triangle are known. ## Types Supported argument types float, double, complex float, complex double. ```fortran interface acos module procedure sacos, dacos, cacos, zacos end interface contains interface elemental real(sp) function sacos(x) real(sp), intent(in) :: x end function elemental real(dp) function dacos(x) real(dp), intent(in) :: x end function elemental complex(sp) function cacos(x) complex(sp), intent(in) :: x end function elemental complex(dp) function zacos(x) complex(dp), intent(in) :: x end function end interface ``` ## Examples ```fortran program intrinsics_acos implicit none integer, parameter :: arg_x = kind(0.0) real(arg_x) :: x1 real :: retval_x real :: arg_x retval_x = acos(0.84147098) print *, ret_val_x retval_x = acos(x1) print *, ret_val_x end program ``` **Result**: ``` 0.570796336 0.570796336 ``` ## See Also [asin](asin.md), [atan](atan.md). lfortran-0.63.0/doc/src/intrinsics/mathematical/fraction.md0000664000175000017500000000141715174404631024124 0ustar alastairalastair# fraction(x): Fractional Part in Model Representation Fractional part of the model representation. ## Declaration ### Syntax ```fortran retval = fraction(x) elemental real(p) function fraction(x) ``` ### Arguments `x` the input value, must be real. ### Return values The returned value has the kind of the input value. The fractional part of the model representation of the input value is returned. ## Description **fraction(x)** computes the fractional part of the model representation of **x**. It is calculated using: $x * {radix(x)}^{(-exponent(x))}$ ## Types Supported argument type is real. ## Examples ```fortran program intrinsics_fraction implicit none real :: x = 3.0 print *, fraction(x) end program ``` **Result**: ``` 0.75 ``` ## See Also lfortran-0.63.0/doc/src/intrinsics/mathematical/acosh.md0000664000175000017500000000334115174404631023412 0ustar alastairalastair# acosh(x): Inverse Hyperbolic Cosine Inverse hyperbolic cosine function. ## Declaration ### Syntax ```fortran retval = acosh(x) elemental real(p) function acosh(x) elemental complex(p) function acosh(x) ``` ### Arguments `x` the input value, can be real with value greater than or equal to 1 or of type complex. ### Return values The returned value has the kind of the input value and TYPE may be real or complex. ## Description **acosh(x)** computes the inverse hyperbolic cosine function of **x**. The result type and kind are the same as input value `x`. If the result is complex, the real part is non-negative, and the imaginary part is expressed in radians and lients in the range $-\pi <= img (acosh(x)) <= \pi$ For real values $x$ in the domain $x > 1$, the inverse hyperbolic cosine satisifies: $cosh^{-1}(x) = \log(x + \sqrt{(x^2 - 1)})$ For complex numbers $x = x + iy$, as well as real values in the domain $-\infty < z <= 1$, the call $acosh(z)$ returns complex results. ## Types Supported argument types float, double, complex float, complex double. ```fortran interface acosh module procedure sacosh, dacosh, cacosh, zacosh end interface contains interface elemental real(sp) function sacosh(x) real(sp), intent(in) :: x end function elemental real(dp) function dacosh(x) real(dp), intent(in) :: x end function elemental complex(sp) function cacosh(x) complex(sp), intent(in) :: x end function elemental complex(dp) function zacosh(x) complex(dp), intent(in) :: x end function end interface ``` ## Examples ```fortran program intrinsics_acosh implicit none print *, acosh(1.0) end program ``` **Result**: ``` 0.0 ``` ## See Also [asinh](asinh.md), [atanh](atanh.md). lfortran-0.63.0/doc/src/intrinsics/mathematical/atanh.md0000664000175000017500000000302715174404631023411 0ustar alastairalastair# atanh(x): Inverse Hyperbolic Tangent Inverse hyperbolic tangent function. ## Declaration ### Syntax ```fortran retval = atanh(x) elemental real(p) function atanh(x) elemental complex(p) function atanh(x) ``` ### Arguments `x` the input value, can be real with value greater than or equal to 1 or of type complex. ### Return values The returned value has the kind of the input value and TYPE may be real or complex. ## Description **atanh(x)** computes the inverse hyperbolic tangent function of **x**. The result type and kind are the same as input value `x`. If the result is complex, the imaginary part is expressed in radians and lies in the range $\frac{-\pi}{2} <= aimag (atanh(x)) <= \frac{\pi}{2}$ If the result is real, it lies in the range $-1.0 < atanh(x) < 1.0$ ## Types Supported argument types float, double, complex float, complex double. ```fortran interface atanh module procedure satanh, datanh, catanh, zatanh end interface contains interface elemental real(sp) function satanh(x) real(sp), intent(in) :: x end function elemental real(dp) function datanh(x) real(dp), intent(in) :: x end function elemental complex(sp) function catanh(x) complex(sp), intent(in) :: x end function elemental complex(dp) function zatanh(x) complex(dp), intent(in) :: x end function end interface ``` ## Examples ```fortran program intrinsics_atanh implicit none print *, atanh(0.0) end program ``` **Result**: ``` 0.0 ``` ## See Also [asinh](asinh.md), [acosh](acosh.md). lfortran-0.63.0/doc/src/intrinsics/mathematical/asin.md0000664000175000017500000000311615174404631023247 0ustar alastairalastair# asin(x): Trigonometric Arcsine Trigonometric arcsine function. ## Declaration ### Syntax ```fortran retval = asin(x) elemental real(p) function asin(x) elemental complex(p) function asin(x) ``` ### Arguments `x` the input value, can be real or complex; less than or equal to 1. ### Return values The returned value has the kind of the input value and TYPE may be real or complex. ## Description **asin(x)** computes the arcsine of the argument **x**. The arcsine is the inverse function of the sine function. It is commonly used in trigonometry to find the angle when the lengths of the hypotenuse and the opposite side of a right triangle are known. ## Types Supported argument types float, double, complex float, complex double. ```fortran interface asin module procedure sasin, dasin, casin, zasin end interface contains interface elemental real(sp) function sasin(x) real(sp), intent(in) :: x end function elemental real(dp) function dasin(x) real(dp), intent(in) :: x end function elemental complex(sp) function casin(x) complex(sp), intent(in) :: x end function elemental complex(dp) function zasin(x) complex(dp), intent(in) :: x end function end interface ``` ## Examples ```fortran program intrinsics_asin implicit none integer, parameter :: arg_x = kind(0.0) real(arg_x) :: x1 real :: retval_x real :: arg_x retval_x = asin(0.84147098) print *, ret_val_x retval_x = asin(x1) print *, ret_val_x end program ``` **Result**: ``` 0.99999 0.99999 ``` ## See Also [acos](acos.md), [atan](atan.md). lfortran-0.63.0/doc/src/intrinsics/mathematical/asinh.md0000664000175000017500000000277115174404631023425 0ustar alastairalastair# asinh(x): Inverse Hyperbolic Arcsine Inverse hyperbolic arcsine function. ## Declaration ### Syntax ```fortran retval = asinh(x) elemental real(p) function asinh(x) elemental complex(p) function asinh(x) ``` ### Arguments `x` the input value, can be real with value greater than or equal to 1 or of type complex. ### Return values The returned value has the kind of the input value and TYPE may be real or complex. ## Description **asinh(x)** computes the inverse hyperbolic arcsine function of **x**. The result type and kind are the same as input value `x`. If the result is complex, the real part is non-negative, and the imaginary part is expressed in radians and lies in the range $\frac{-\pi}{2} <= aimag (asinh(x)) <= \frac{\pi}{2}$ ## Types Supported argument types float, double, complex float, complex double. ```fortran interface asinh module procedure sasinh, dasinh, casinh, zasinh end interface contains interface elemental real(sp) function sasinh(x) real(sp), intent(in) :: x end function elemental real(dp) function dasinh(x) real(dp), intent(in) :: x end function elemental complex(sp) function casinh(x) complex(sp), intent(in) :: x end function elemental complex(dp) function zasinh(x) complex(dp), intent(in) :: x end function end interface ``` ## Examples ```fortran program intrinsics_asinh implicit none print *, asinh(1.0) end program ``` **Result**: ``` -0.88137 ``` ## See Also [acosh](acosh.md), [atanh](atanh.md). lfortran-0.63.0/doc/src/intrinsics/bit/0000775000175000017500000000000015174404631020117 5ustar alastairalastairlfortran-0.63.0/doc/src/intrinsics/bit/bgt.md0000664000175000017500000000177015174404631021222 0ustar alastairalastair# bgt(x, y): Bitwise Greater Than Bitwise greater than. ## Declaration ### Syntax ```fortran retval = bgt(x, y); elemental logical function bgt(x, y) ``` ### Arguments `x` and `y` are integer input values. Both input values are of same kind. ### Return values The return value is of type logical and of the default kind. ## Description `bgt(x, y)` calculates if one integer input values is bitwise greater than the other. ## Types Supported input types is integer of 32 bit and 64 bit size. ``` interface bgt module procedure bgt32, bgt64 end interface contains interface elemental logical function bgt32(x, y) integer(int32), intent(in) :: x, y end function elemental logical function bgt64(x, y) integer(int64), intent(in) :: x, y end function end interface ``` ## Examples ```fortran program intrinsics_bgt implicit none print *, bgt(10, 4) print *, bgt(10, -4) end program ``` **Result:** ``` true false ``` ## See Also [bge](bge.md), [ble](ble.md), [blt](blt.md). lfortran-0.63.0/doc/src/intrinsics/bit/btest.md0000664000175000017500000000227515174404631021570 0ustar alastairalastair# btest(x, pos): Bit Test at Position Bit test. ## Declaration ### Syntax ```fortran retval = btest(x, pos); elemental logical function btest(x, pos) ``` ### Arguments `x` and `pos` are integer input values. Both input values are of same kind. `pos` represents position in `x`. ### Return values The return value is of type logical. ## Description `btest(x, pos)` calculates if `pos` bit in input integer value `x` is set. The counting of the bits starts at 0, at least significant bit (LSB) i.e., the rightmost bit in `x`. If `pos` less than 0 or greater than `bit_size()`, `btest(x, pos)` errors with not allowed message. ## Types Supported input types is integer of 32 bit and 64 bit size. ``` interface btest module procedure btest32, btest64 end interface contains interface elemental logical function btest32(x, pos) integer(int32), intent(in) :: x integer, intent(in) :: pos end function elemental logical function btest64(x, pos) integer(int64), intent(in) :: x integer, intent(in) :: pos end function end interface ``` ## Examples ```fortran program intrinsics_btest implicit none print *, btest(2, 0) end program ``` **Result:** ``` false ``` ## See Also lfortran-0.63.0/doc/src/intrinsics/bit/shiftr.md0000664000175000017500000000307715174404631021747 0ustar alastairalastair# shiftr(x, shift): Shift Right Logical shift right function. ## Declaration ### Syntax ```fortran retval = shiftr(int(number), 31); integer(int32) function shiftri32(i, shift) ``` ### Arguments `x` is an integer input value. `shift` an unsigned integer value less than or equal to the bit size of `x`. The possible values are 7, 31, and 63. ### Return values The return value is of type integer and of the same kind as `x`. ## Description **shiftr(x, shift)** logically right shifts `x` by `shift` number of bits. `shiftr` shifts from MSB(**M**ost **S**ignificant **B**it) to LSB(**L**east **S**ignificant **B**it). Bits shifted from the right end i.e., LSB bits are lost. Zeroes are appended to the opposite left end. ## Types Supported types in unsigned integer value `x` and unsigned integer value `shift` from (7, 31, 63) less than or equal to bit size of `x`. ``` interface shiftr module procedure shiftri8, shiftri32, shiftri64 end interface contains interface integer(int8) function shiftri8(i, shift) result(r) integer(int8), intent(in) :: i integer :: shift end function integer(int32) function shiftri32(i, shift) result(r) integer(int32) :: i integer :: shift end function integer(int64) function shiftri64(i, shift) result(r) integer(int64) :: i integer :: shift end function end interface ``` ## Examples ```fortran program intrinsics_shiftr implicit none integer, parameter :: x = kind(4) integer :: retval retval = shiftr(int(x), 7) print *, retval end program ``` **Result:** ``` 2 ``` ## See Also [shiftl](shiftl.md). lfortran-0.63.0/doc/src/intrinsics/bit/ble.md0000664000175000017500000000204215174404631021201 0ustar alastairalastair# bge(x, y): Bitwise Less or Equal Bitwise less than or equal to. ## Declaration ### Syntax ```fortran retval = ble(x, y); elemental logical function ble(x, y) ``` ### Arguments `x` and `y` are integer input values. Both input values are of same kind. ### Return values The return value is of type logical and of the default kind. ## Description `ble(x, y)` calculates if one integer input values is bitwise less than or equal to other. ## Types Supported input types is integer of 32 bit and 64 bit size. ``` interface ble module procedure ble32, ble64 end interface contains interface elemental logical function ble32(x, y) integer(int32), intent(in) :: x, y end function elemental logical function ble64(x, y) integer(int64), intent(in) :: x, y end function end interface ``` ## Examples ```fortran program intrinsics_ble implicit none print *, ble(10, 4) print *, ble(10, -4) print *, ble(10, 10) end program ``` **Result:** ``` false true true ``` ## See Also [bgt](bgt.md), [bge](bge.md), [blt](blt.md). lfortran-0.63.0/doc/src/intrinsics/bit/bit_size.md0000664000175000017500000000134715174404631022256 0ustar alastairalastair# bit_size(x): Bit Size Bit size. ## Declaration ### Syntax ```fortran retval = bit_size(x); elemental logical function bit_size(x) ``` ### Arguments `x` is integer input value. ### Return values The return value is of type integer. ## Description `bit_size(x)` calculates the number of bits including sign bit of binary representation of `x`. ## Types Supported input types is integer. ``` module lfortran_intrinsic_builtin implicit none contains interface integer function bit_size(x) integer, intent(in) :: x end function end interface ``` ## Examples ```fortran program intrinsics_bit_size implicit none print *, bit_size(123) print *, bit_size(-1) end program ``` **Result:** ``` 32 32 ``` ## See Also lfortran-0.63.0/doc/src/intrinsics/bit/blt.md0000664000175000017500000000175715174404631021234 0ustar alastairalastair# blt(x, y): Bitwise Less Than Bitwise less than. ## Declaration ### Syntax ```fortran retval = blt(x, y); elemental logical function btt(x, y) ``` ### Arguments `x` and `y` are integer input values. Both input values are of same kind. ### Return values The return value is of type logical and of the default kind. ## Description `blt(x, y)` calculates if one integer input values is bitwise less than the other. ## Types Supported input types is integer of 32 bit and 64 bit size. ``` interface blt module procedure blt32, blt64 end interface contains interface elemental logical function blt32(x, y) integer(int32), intent(in) :: x, y end function elemental logical function blt64(x, y) integer(int64), intent(in) :: x, y end function end interface ``` ## Examples ```fortran program intrinsics_blt implicit none print *, blt(10, 4) print *, blt(10, -4) end program ``` **Result:** ``` false true ``` ## See Also [bge](bge.md), [ble](ble.md), [bgt](bgt.md). lfortran-0.63.0/doc/src/intrinsics/bit/shiftl.md0000664000175000017500000000307415174404631021736 0ustar alastairalastair# shiftl(x, shift): Shift Left Logical shift left function. ## Declaration ### Syntax ```fortran retval = shiftl(int(number), 31); integer(int32) function shiftli32(i, shift) ``` ### Arguments `x` is an integer input value. `shift` an unsigned integer value less than or equal to the bit size of `x`. The possible values are 7, 31, and 63. ### Return values The return value is of type integer and of the same kind as `x`. ## Description **shiftl(x, shift)** logically left shifts `x` by `shift` number of bits. `shiftl` shifts from LSB(**L**east **S**ignificant **B**it) to MSB(**M**ost **S**ignificant **B**it). Bits shifted from the left end i.e., MSB bits are lost. Zeroes are appended to the opposite right end. ## Types Supported types in unsigned integer value `x` and unsigned integer value `shift` from (7, 31, 63) less than or equal to bit size of `x`. ``` interface shiftl module procedure shiftli8, shiftli32, shiftli64 end interface contains interface integer(int8) function shiftli8(i, shift) result(r) integer(int8), intent(in) :: i integer :: shift end function integer(int32) function shiftli32(i, shift) result(r) integer(int32) :: i integer :: shift end function integer(int64) function shiftli64(i, shift) result(r) integer(int64) :: i integer :: shift end function end interface ``` ## Examples ```fortran program intrinsics_shiftl implicit none integer, parameter :: x = kind(2) integer :: retval retval = shiftl(int(x), 7) print *, retval end program ``` **Result:** ``` 4 ``` ## See Also [shiftr](shiftr.md). lfortran-0.63.0/doc/src/intrinsics/bit/bge.md0000664000175000017500000000205515174404631021200 0ustar alastairalastair# bge(x, y): Bitwise Greater or Equal Bitwise greater than or equal to. ## Declaration ### Syntax ```fortran retval = bge(x, y); elemental logical function bge(x, y) ``` ### Arguments `x` and `y` are integer input values. Both input values are of same kind. ### Return values The return value is of type logical and of the default kind. ## Description `bge(x, y)` calculates if two integer input values is bitwise greater than or equal to another. ## Types Supported input types is integer of 32 bit and 64 bit size. ``` interface bge module procedure bge32, bge64 end interface contains interface elemental logical function bge32(x, y) integer(int32), intent(in) :: x, y end function elemental logical function bge64(x, y) integer(int64), intent(in) :: x, y end function end interface ``` ## Examples ```fortran program intrinsics_bge implicit none print *, bge(10, 4) print *, bge(10, -4) print *, bge(10, 10) end program ``` **Result:** ``` true false true ``` ## See Also [bgt](bgt.md), [ble](ble.md), [blt](blt.md). lfortran-0.63.0/doc/src/intrinsics/array/0000775000175000017500000000000015174404631020457 5ustar alastairalastairlfortran-0.63.0/doc/src/intrinsics/array/allocated.md0000664000175000017500000000172615174404631022737 0ustar alastairalastair# allocated(x): Status Check Logical status of an allocatable integer. ## Declaration ### Syntax ```fortran retval = allocated(x) logical function allocated(x) ``` ### Arguments `x` is an integer input parameter. ### Return values The return value is a logical scalar with the default logical kind type parameter. ## Description `allocated(x)` checks the allocation status of a integer input parameter. It returns a logical value as `TRUE` if the input argument `x` is allocated, `FALSE` otherwise. ## Types Supported argument type is integer. ```fortran module lfortran_intrinsic_builtin implicit none interface logical function allocated(x) integer, intent(in) :: x(:) end function end interface end module ``` ## Examples ```fortran program intrinsics_allocated implicit none integer :: i = 1 real(1), allocatable :: x(:) if (.not. allocated(x)) allocate(x(i)) print *, allocated(i) end program ``` **Result**: ``` TRUE ``` ## See Also lfortran-0.63.0/doc/src/intrinsics/array/size.md0000664000175000017500000000170615174404631021757 0ustar alastairalastair# size(x): Size of Array Returns the size of an array `x`. ## Declaration ### Syntax ```fortran retval = size(A[, dim[, kind]]) integer function size(x) ``` ### Arguments `A` the input array of any type or rank. `dim` optional dimension, if present, `size` returns the size of this dimension. `kind` optional the kind of the return value. ### Return values `n` the size of an array (integer). ## Description The `size` intrinsic function returns the size of an array. It returns the product of all dimensions, unless the `dim` argument is specified, in which case it only returns the size of this particular dimension. The `kind` argument can be used to specify the integer kind of the result. ## Types Supported argument type is integer. ## Examples ```fortran program intrinsics_size implicit none real :: A(3, 4) print *, size(A) print *, size(A, 2) end program ``` **Result**: ``` 12 4 ``` ## See Also [shape](), [reshape](). lfortran-0.63.0/doc/src/intrinsics/array/cshift.md0000664000175000017500000000242615174404631022265 0ustar alastairalastair# cshift(A, shift [, dim]): Circular Shift Circular shift elements of an array. ## Declaration ### Syntax ```fortran retval = cshift(A, shift [, dim]) integer function cshift(A, shift, [, dim]) ``` ### Arguments `A` the input array of any type or rank. `shift` the input value of integer type. `dim` optional dimension, if present, `cshift` returns the result of this dimension. ### Return values The return value is of input array type and rank as the `A` array input argument. ## Description **cshift(A, shift [, dim])** performs a circular shift on elements of `A` array along the dimension of `dim`. Default value of `dim` is 1, used when `dim` is not passed. If the rank of array is 1, then all elements of array are shifted by `shift` places. If rank is greater than one, then all complexte rank one sections of array along the given dimension are shifted. Elements shifted out one end of each rank one section are shifted back in the other end. ## Types Supported argument type is array for `A` and integer for `shift` and `dim`. ## Examples ```fortran program intrinsics_cshift implicit none integer, dimension(5):: a = [1, 2, 3, 4, 5] print '(5i3)', a a = cshift(a, shift = 2) print *, size(A, 2) end program ``` **Result**: ``` 1, 2, 3 4, 5, 1 ``` ## See Also lfortran-0.63.0/doc/src/intrinsics/bit.md0000664000175000017500000000017115174404631020440 0ustar alastairalastair# Bit Intrinsic Functions ```{toctree} bit/bge bit/bgt bit/bit_size bit/ble bit/blt bit/btest bit/shiftl bit/shiftr ``` lfortran-0.63.0/doc/src/javascripts/0000775000175000017500000000000015174404631017505 5ustar alastairalastairlfortran-0.63.0/doc/src/javascripts/mathjax.js0000664000175000017500000000045415174404631021502 0ustar alastairalastairwindow.MathJax = { tex: { inlineMath: [["\\(", "\\)"]], displayMath: [["\\[", "\\]"]], processEscapes: true, processEnvironments: true }, options: { ignoreHtmlClass: ".*|", processHtmlClass: "arithmatex" } }; document$.subscribe(() => { MathJax.typesetPromise() }) lfortran-0.63.0/doc/src/llvm/0000775000175000017500000000000015174404631016126 5ustar alastairalastairlfortran-0.63.0/doc/src/llvm/array_descriptor.md0000664000175000017500000000301115174404631022017 0ustar alastairalastair# Array Descriptor in LLVM IR In Fortran, arrays whose shape cannot be fully determined at compile time are represented at runtime using array descriptors. An array descriptor encapsulates both a pointer to the underlying data buffer and the metadata required to interpret the array (such as dimensions, strides, and bounds). --- ## Array Descriptor Struct The LLVM IR representation of an array descriptor: ```llvm %array = type { i32*, i32, %dimension_descriptor*, i1, i32 } ``` ## Field Descriptors | Field Name | Type | Description | |------------|------|-------------| | `data_pointer` | `i32*` | Pointer to the beginning of the raw array data | | `base_offset` | `i32` | Offset from the data_pointer to the logical first element of the array | | `dimension_descriptor` | `%dimension_descriptor*` | Pointer to a contiguous block of `N` dimension descriptors structs, where N is the array rank| | `is_pointer` | `i1` | Indicates whether this is a Fortran pointer array | | `rank` | `i32` | The number of dimensions in the array (Rank)| ## Dimension Descriptor Struct Each dimension of the array has an associated dimension descriptor: ```llvm %dimension_descriptor = type { i32, i32, i32 } ``` ## Field Descriptors | Field Name | Type | Description | |------------|------|-------------| | `stride` | `i32` | The offset between consecutive values along this dimension | | `lower_bound` | `i32` | The Lower bound of the dimension | | `size` | `i32` | The extent of the dimension (number of elements along this axis) | lfortran-0.63.0/doc/src/ast_and_asr.ipynb0000664000175000017500000000663015174404631020502 0ustar alastairalastair{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Difference between an AST and ASR\n", "\n", "Let us take a simple Fortran code:\n", "```fortran\n", "integer function f(a, b) result(r)\n", "integer, intent(in) :: a, b\n", "integer :: c, d\n", "c = a + b - d\n", "r = c * a\n", "end function\n", "```\n", "and look at what the AST and ASR look like.\n", "\n", "## AST" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%showast\n", "integer function f(a, b) result(r)\n", "integer, intent(in) :: a, b\n", "integer :: c, d\n", "c = a + b - d\n", "r = c * a\n", "end function" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The AST does not have any semantic information, but has nodes to represent declarations such as `integer, intent(in) :: a`. Variables such as `a` are represented by a `Name` node, and are not connected to their declarations yet.\n", "\n", "The AST can also be exported in JSON, including source file name, line and column information: `lfortran example.f90 --show-ast --json`" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## ASR" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%showasr\n", "integer function f(a, b) result(r)\n", "integer, intent(in) :: a, b\n", "integer :: c, d\n", "c = a + b - d\n", "r = c * a\n", "end function" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The ASR has all the semantic information (types, etc.), nodes like `Function` have a symbol table and do not have any declaration nodes. Variables are simply pointers to the symbol table.\n", "\n", "The ASR can also be exported in JSON, including source file name, line and column information: `lfortran example.f90 --show-asr --json`\n", "\n", "## Discussion\n", "\n", "The above was a simple example. Things get more apparent for more complicated examples, such as:\n", "```fortran\n", "integer function f2b(a) result(r)\n", "use gfort_interop, only: c_desc1_int32\n", "integer, intent(in) :: a(:)\n", "interface\n", " integer function f2b_c_wrapper(a) bind(c, name=\"__mod1_MOD_f2b\")\n", " use gfort_interop, only: c_desc1_t\n", " type(c_desc1_t), intent(in) :: a\n", " end function\n", "end interface\n", "r = f2b_c_wrapper(c_desc1_int32(a))\n", "end function\n", "```\n", "AST must represent all the `use` statements and the `interface` block, and keep things semantically consistent.\n", "\n", "ASR, on the other hand, keeps track of the `c_desc1_int32`, `c_desc1_t` and `f2b_c_wrapper` in the symbol table and it knows they are defined in the `gfort_interop` module, and so ASR does not have any of these declaration nodes.\n", "\n", "When converting from ASR to AST, LFortran will create all the appropriate AST declaration nodes automatically and correctly." ] } ], "metadata": { "kernelspec": { "display_name": "Fortran", "language": "fortran", "name": "fortran" }, "language_info": { "file_extension": ".f90", "mimetype": "text/x-fortran", "name": "fortran", "version": "2018" } }, "nbformat": 4, "nbformat_minor": 2 } lfortran-0.63.0/doc/src/contributing.md0000664000175000017500000002010115174404631020177 0ustar alastairalastair# Contributing We welcome contributions from anyone, even if you are new to open source. It might sound daunting to contribute to a compiler at first, but please do, it is not complicated. We will help you with any technical issues and help improve your contribution so that it can be merged. ## Basic Setup To contribute, make sure your set up: * Your username + email * Your `~/.gitconfig` * Your shell prompt to display the current branch name ### Fork LFortran Step 1. Create a fork of the [project repository](https://github.com/lfortran/lfortran) Step 2. Set up your [SSH key](https://docs.github.com/en/authentication/connecting-to-github-with-ssh) with GitHub Step 3. Clone the project repository from GitHub and set up your remote repository ``` git clone https://github.com/lfortran/lfortran.git cd lfortran git remote add REMOTE_NAME git@github.com:YOUR_GITHUB_ID/lfortran.git ``` :fontawesome-solid-edit: `REMOTE_NAME` is the name of your remote repository and could be any name you like, for example your first name. :fontawesome-solid-edit: `YOUR_GITHUB_ID` is your user ID on GitHub and should be part of your account path. You can use `git remote -v` to check if the new remote is set up correctly. ### Send a New Merge Request Step 1. Create a new branch ``` git checkout -b fix1 ``` Step 2. Make changes in relevant file(s) Step 3. Commit the changes: ``` git add FILE1 (FILE2 ...) git commit -m "YOUR_COMMIT_MESSAGE" ``` [Here](https://chris.beams.io/posts/git-commit/) are some great tips on writing good commit messages. Step 4. Check to ensure that your changes look good ``` git log --pretty=oneline --graph --decorate --all ``` Step 5. Send the merge request ``` git push REMOTE_NAME fix1 ``` The command will push the new branch `fix1` into your remote repository `REMOTE_NAME` that you created earlier. Additionally, it will also display a link that you can click on to open the new merge request. After clicking on the link, write a title and a concise description then click the "Create" button. Yay you are now all set. ### How to Fix Things: A Tutorial Here’s a tutorial video that explains LFortran's design and how to fix bugs: [Watch here](https://www.youtube.com/watch?v=yuYsyM08bss). ## Add New Features The example below shows the steps it would take to create a caret binary operator **^** which computes the average value of the two operands. ### Create New Token(s) We extend the *tokenizer.re* as well as *parser.yy* to add the new token **^**. We also tell LFortran how to print the new token in *parser.cpp*. :fontawesome-solid-code: *src/lfortran/parser/tokenizer.re* ``` // "^" { RET(TK_CARET) } ``` :fontawesome-solid-code: *src/lfortran/parser/parser.yy* ``` %token TK_CARET "^" ``` :fontawesome-solid-code: *src/lfortran/parser/parser.cpp* ``` std:string token2text(const int token) { switch (token) { T(TK_CARET, "^") } } ``` The added code is tested with `lfortran --show-tokens examples2/expr2.f90` ### Parse the New Token Now we have to parse the new operator. We add it to the AST by extending the BinOp with a caret operator and modifying the *AST.asdl* file. Then we add it in *parse.yy* to properly parse and generate the new AST in *semantics.h*.Finally we extend *pickle.cpp* so that the new operator can print itself. :fontawesome-solid-code:*grammar/AST.asdl* ``` operator = Add | Sub | Mul | Div | Pow | Caret ``` :fontawesome-solid-code:*src/lfortran/parser/parser.yy* ``` %left "^" expr : id { $$=$1; } | expr "^" expr { $$ = CARET($1, $3, @$); } ``` :fontawesome-solid-code:*src/lfortran/parser/semantics.h* ``` #define CARET(x,y,l) make_BinOp_t(p.m_a, l, EXPR(x), operatorType::Caret, EXPR(y)) ``` :fontawesome-solid-code:*src/lfortran/pickle.cpp* ``` std::string op2str(const operatorType type) { switch (type) { case (operatorType::Caret) : return "^"; } // now the caret operator can print itself } ``` The section is tested with `lfortran --show-ast examples/expr2.f90` ### Implement the Semantics of the New Token We first extend the ASR in *ASR.asdl* and add ^ as a BinOp operator option. :fontawesome-solid-code:*src/libasr/ASR.asdl* ``` binop = Add | Sub | Mul | Div | Pow | Caret ``` :fontawesome-solid-code:*src/lfortran/semantics/ast_common_visitor.h* ``` namespace LFortran { class CommonVisitorMethods { public: inline static void visit_BinOp(Allocator &al, const AST::BinOp_t &x, ASR::expr_t *&left, ASR::expr_t *&right, ASR::asr_t *&asr) { ASR::binopType op; switch (x.m_op) { case (AST::Caret): op = ASR::Caret; break; } if (LFortran::ASRUtils::expr_value(left) != nullptr && LFortran::ASRUtils::expr_value(right) != nullptr) { if (ASR::is_a(*dest_type)) { int64_t left_value = ASR::down_cast( LFortran::ASRUtils::expr_value(left)) ->m_n; int64_t right_value = ASR::down_cast( LFortran::ASRUtils::expr_value(right)) ->m_n; int64_t result; switch (op) { case (ASR::Caret): result = (left_value + right_value)/2; break; } } } } } } ``` Then we transform it from AST to ASR by extending *src/lfortran/semantics/ast_common_visitor.h*. We also add it into compile time evaluation triggered by expressions such as `e = (2+3)^5` which is evaluated at compile time. An expression such as `e = x^5` is evaluated at run time only. The section is tested with `lfortran --show-asr examples/expr2.f90` ### Implement the New Token in LLVM To implement in LLVM, we extend the BinOp translation by handling the new operator. We first add the two numbers then divide by two. :fontawesome-solid-code:*src/lfortran/codegen/asr_to_llvm.cpp* ``` void visit_BinOp(const ASR::BinOp_t &x) { if (x.m_value) { this->visit_expr_wrapper(x.m_value, true); return; } this->visit_expr_wrapper(x.m_left, true); llvm::Value *left_val = tmp; this->visit_expr_wrapper(x.m_right, true); llvm::Value *right_val = tmp; if (x.m_type->type == ASR::ttypeType::Integer || x.m_type->type == ASR::ttypeType::IntegerPointer) { switch (x.m_op) { case ASR::binopType::Caret: { tmp = builder->CreateAdd(left_val, right_val); llvm::Value *two = llvm::ConstantInt::get(context, llvm::APInt(32, 2, true)); tmp = builder->CreateUDiv(tmp, two); break; }; } } } ``` The section is tested with `lfortran --show-llvm examples/expr2.f90` Now when LLVM works, we can test the final executable by: ``` lfortran examples/expr2.f90 ./a.out ``` And it should print 6. It also works interactively: ``` $ lfortran Interactive Fortran. Experimental prototype, not ready for end users. * Use Ctrl-D to exit * Use Enter to submit * Use Alt-Enter or Ctrl-N to make a new line - Editing (Keys: Left, Right, Home, End, Backspace, Delete) - History (Keys: Up, Down) >>> 4^8 1,4 ] 6 >>> integer :: x 1,13 ] >>> x = 4 1,6 ] >>> x^8 1,4 ] 6 ``` ## Reach Out If you have any questions or need help, please ask as at our [mailinglist](https://groups.io/g/lfortran) or a [chat](https://lfortran.zulipchat.com/). Please note that all participants of this project are expected to follow our Code of Conduct. By participating in this project you agree to abide by its terms. See [CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/blob/main/CODE_OF_CONDUCT.md). By submitting a PR you agree to license your contribution under the LFortran's BSD [license](https://github.com/lfortran/lfortran/blob/main/LICENSE) unless explicitly noted otherwise. lfortran-0.63.0/doc/src/progress.md0000664000175000017500000005264115174404631017352 0ustar alastairalastair# LFortran Development Status This page documents what Fortran features are supported by LFortran. For each feature we list a short description, the filename with the test and current status for each parts of the compiler: * AST: The code can be parsed to AST (`lfortran --show-ast test.f90`) * ASR: The code can be transformed to ASR (`lfortran --show-asr test.f90`) * LLVM: LFortran can generate LLVM IR (`lfortran --show-llvm test.f90`) * BIN: The LLVM IR can compile to a binary * RUN: The binary runs without errors If all are green it means the feature fully works and you can use it in your codes. Otherwise you can see what the status is of each feature. This page is generated automatically using the [Compiler Tester](https://gitlab.com/lfortran/compiler_tester) repository which contains all the Fortran tests and scripts to run LFortran to produce the tables below. We are looking for contributors to contribute more tests. Our goal is to have a comprehensive Fortran testsuite that can be used to test any Fortran compiler. Testing the LFortran compiler version: ```console $ lfortran --version LFortran version: 0.12.0-491-gaf48ff273 Platform: macOS Default target: x86_64-apple-darwin20.3.0 ``` # Topics ## Full programs that compute something interesting ### Basic Numerics Directory: `tests/programs/numerics` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `Pure Fortran sin(x) implementation` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_sin_implementation.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/programs/numerics/t01_sin_implementation.f90) | ## Modules ### Basic Usage Directory: `tests/modules/basic` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `Basic modules` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/basic/t01.f90) | ### Module Functions and Subroutines Directory: `tests/modules/procedures` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `Module functions` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t01.f90) | | `Module subroutines` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t02.f90) | | `Nested subroutines` | ✅ | ✅ | ✅ | ✅ | ✅ | [t03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t03.f90) | ## Expressions ### Arithmetic Operations Directory: `tests/expressions/arit` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `+,-,*,/,**` | ✅ | ✅ | ✅ | ✅ | ✅ | [basic_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/arit/basic_operations.f90) | ### Integers Directory: `tests/expressions/integers` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `integers` | ✅ | ✅ | ✅ | ✅ | ✅ | [integer_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/integer_kind.f90) | | `relational operations` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_rel_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/t01_rel_operations.f90) | | `logical operations` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_logical_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/t02_logical_operations.f90) | ### Real Numbers Directory: `tests/expressions/reals` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `single/double reals` | ✅ | ✅ | ✅ | ✅ | ✅ | [real_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/real_kind.f90) | | `defined operator` | ✅ | ⌠| ⌠| ⌠| ⌠| [t01_def_op.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/t01_def_op.f90) | ### Complex Numbers Directory: `tests/expressions/complex` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [complex_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/complex/complex_kind.f90) | ### Strings Directory: `tests/expressions/character` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `character` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_character.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t01_character.f90) | | `string concatenation` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_concat_operation.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t02_concat_operation.f90) | ### Derived Types Directory: `tests/expressions/derived_type` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `basic derived types` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_derived_type.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/derived_type/t01_derived_type.f90) | ## Statements ### Allocate Statement Directory: `tests/statements/allocate` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `allocate statement` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/allocate/t01.f90) | ### Block Statement Directory: `tests/statements/block` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `block statement` | ✅ | ⌠| ⌠| ⌠| ⌠| [t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/block/t01.f90) | ### Goto Statement Directory: `tests/statements/goto` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `computed go-to statement` | ✅ | ⌠| ⌠| ⌠| ⌠| [t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t01.f90) | | `go-to statement` | ✅ | ⌠| ⌠| ⌠| ⌠| [t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t02.f90) | ### If Statement Directory: `tests/statements/if` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `Test .false.` | ✅ | ✅ | ✅ | ✅ | ✅ | [if_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_01.f90) | | `single line if statement` | ✅ | ✅ | ✅ | ✅ | ✅ | [if_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_02.f90) | | `multi line if statement` | ✅ | ✅ | ✅ | ✅ | ✅ | [if_03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_03.f90) | | `nested if statements` | ✅ | ✅ | ✅ | ✅ | ✅ | [if_04.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_04.f90) | ### While Statement Directory: `tests/statements/while` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `Simple while loops` | ✅ | ✅ | ✅ | ✅ | ✅ | [while_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_01.f90) | | `exit / cycle in while loops` | ✅ | ✅ | ✅ | ✅ | ✅ | [while_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_02.f90) | ### Print Statement Directory: `tests/statements/print` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `Basic print` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/print/t01.f90) | ### Open, Read, Write, Close Statement Directory: `tests/statements/file_io` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `open/read/write/close` | ✅ | ✅ | ⌠| ⌠| ⌠| [t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/file_io/t01.f90) | ## Intrinsic Functions ### abs Directory: `tests/intrinsic/abs` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ⌠| ⌠| ⌠| ⌠| [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ⌠| ⌠| ⌠| [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t03_array1d_real.f90) | ### exp Directory: `tests/intrinsic/exp` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ⌠| ⌠| ⌠| [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t03_array1d_real.f90) | ### log Directory: `tests/intrinsic/log` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ⌠| ⌠| ⌠| [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t03_array1d_real.f90) | ### sqrt Directory: `tests/intrinsic/sqrt` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ⌠| ⌠| ⌠| ⌠| [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ⌠| ⌠| ⌠| [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t03_array1d_real.f90) | ### sin Directory: `tests/intrinsic/sin` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ⌠| ⌠| ⌠| ⌠| [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ⌠| ⌠| ⌠| [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t03_array1d_real.f90) | ### cos Directory: `tests/intrinsic/cos` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ⌠| ⌠| ⌠| [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t03_array1d_real.f90) | ### tan Directory: `tests/intrinsic/tan` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ⌠| ⌠| ⌠| [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t03_array1d_real.f90) | ### sinh Directory: `tests/intrinsic/sinh` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ⌠| ⌠| ⌠| [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t03_array1d_real.f90) | ### cosh Directory: `tests/intrinsic/cosh` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ⌠| ⌠| ⌠| [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t03_array1d_real.f90) | ### tanh Directory: `tests/intrinsic/tanh` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ⌠| ⌠| ⌠| [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t03_array1d_real.f90) | ### asin Directory: `tests/intrinsic/asin` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ⌠| ⌠| ⌠| [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t03_array1d_real.f90) | ### acos Directory: `tests/intrinsic/acos` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ⌠| ⌠| ⌠| [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t03_array1d_real.f90) | ### atan Directory: `tests/intrinsic/atan` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ⌠| ⌠| ⌠| [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t03_array1d_real.f90) | ### modulo Directory: `tests/intrinsic/modulo` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ⌠| ⌠| ⌠| ⌠| [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/modulo/t01_scalar_real.f90) | | `array 1D single/double real` | ✅ | ✅ | ⌠| ⌠| ⌠| [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/modulo/t03_array1d_real.f90) | ### mod Directory: `tests/intrinsic/mod` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ⌠| ⌠| ⌠| ⌠| [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/mod/t01_scalar_real.f90) | | `array 1D single/double real` | ✅ | ⌠| ⌠| ⌠| ⌠| [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/mod/t03_array1d_real.f90) | ### min Directory: `tests/intrinsic/min` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ⌠| ⌠| ⌠| [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/min/t01_scalar_real.f90) | ### max Directory: `tests/intrinsic/max` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ⌠| ⌠| ⌠| [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/max/t01_scalar_real.f90) | ### int Directory: `tests/intrinsic/int` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ⌠| ⌠| ⌠| ⌠| [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/int/t01_scalar_real.f90) | ### real Directory: `tests/intrinsic/real` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/real/t01_scalar_real.f90) | ### floor Directory: `tests/intrinsic/floor` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ⌠| ⌠| ⌠| ⌠| [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/floor/t01_scalar_real.f90) | ### nint Directory: `tests/intrinsic/nint` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ⌠| ⌠| ⌠| ⌠| [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/nint/t01_scalar_real.f90) | lfortran-0.63.0/doc/environment.yml0000664000175000017500000000046015174404631017454 0ustar alastairalastairname: lfortran_docs channels: - conda-forge dependencies: - lfortran=0.18.0 - myst-parser=0.18.1 - nbsphinx=0.8.10 - sphinx=5.3.0 - sphinx-intl=2.0.1 - sphinx-copybutton=0.5.0 - pip=22.3.1 - lxml=4.9.1 - unidecode=1.3.6 - python-slugify=7.0.0 - pip: - sphinx-material==0.0.35 lfortran-0.63.0/doc/README.md0000664000175000017500000000420015174404631015640 0ustar alastairalastair# Documentation The documentation for LFortran is built with sphinx ## Installing dependencies To build the documentation you will need the following dependencies - [sphinx-build](https://www.sphinx-doc.org) for building the pages - [sphinx-intl](https://www.sphinx-doc.org/en/master/usage/advanced/intl.html) for translations - [sphinx-material](https://bashtage.github.io/sphinx-material/) for the page theme - [sphinx-copybutton](https://sphinx-copybutton.readthedocs.io/en/latest/) to allow copying of code-blocks - [myst-parser](https://myst-parser.readthedocs.io/en/latest/) for markdown support - [nbsphinx](https://nbsphinx.readthedocs.io/en/latest/) for converting notebooks - LFortran with jupyter kernel for the notebook conversion You can install all required dependencies using the mamba package manager as shown in the next section. ## Building the documentation First create and load the Conda environment: ```console cd doc mamba env create -f environment.yml conda activate lfortran_docs ``` To build the documentation run the `build.py` script: ``` python build.py ``` To view the rendered pages start a http server: ``` python -m http.server -d site ``` And go to: http://localhost:8000/en/ You can also pass the language as an argument to only build part of the site ``` python build.py en de ``` ## Updating the documentation To update the documentation edit the markdown files in the `doc/src` directory. If you add new files in Markdown (`md`) or Notebook (`ipynb`) format, make sure to include them in a _toctree_ directive. To update the translation files after an addition to the docs, run ``` python intl.py ``` New translations can be added in `doc/src/_static/languages.json`. Make sure the default language (English) is always first. ## Translating the documentation Translations can be contributed via [weblate](https://hosted.weblate.org/projects/fortran-lang/lfortran-docs/). [![Translation status](https://hosted.weblate.org/widgets/fortran-lang/-/lfortran-docs/horizontal-auto.svg)](https://hosted.weblate.org/engage/fortran-lang/) The documentation can also be translated by editing the _po_-files in `doc/locale`. lfortran-0.63.0/doc/man/0000775000175000017500000000000015174404631015140 5ustar alastairalastairlfortran-0.63.0/doc/man/lfortran.md0000664000175000017500000001172115174404631017313 0ustar alastairalastair# NAME LFortran - modern interactive LLVM-based Fortran compiler # SYNOPSIS lfortran [OPTIONS] [files...] [SUBCOMMAND] # DESCRIPTION LFortran is a modern interactive Fortran compiler based on LLVM. # OPTIONS - `-h, --help`: Print this help message and exit - `-S`: Emit assembly, do not assemble or link - `-c`: Compile and assemble, do not link - `-o TEXT`: Specify the file to place the compiler's output into - `-v`: Be more verbose - `-E`: Preprocess only; do not compile, assemble, or link - `-l TEXT ...`: Link library option - `-L TEXT ...`: Library path option - `-I TEXT ...`: Include path - `-J TEXT`: Where to save mod files - `-g`: Compile with debugging information - `-D TEXT ...`: Define `=` (or 1 if `` omitted) - `--version`: Display compiler version information - `-W TEXT ...`: Linker flags - `-f TEXT ...`: All `-f*` flags (only -fPIC supported for now) - `--cpp`: Enable C preprocessing - `--fixed-form`: Use fixed form Fortran source parsing - `--fixed-form-infer`: Use heuristics to infer if a file is in fixed form - `--no-prescan`: Turn off prescan - `--show-prescan`: Show tokens for the given file and exit - `--show-tokens`: Show tokens for the given file and exit - `--show-ast`: Show AST for the given file and exit - `--show-asr`: Show ASR for the given file and exit - `--with-intrinsic-mods`: Show intrinsic modules in ASR - `--show-ast-f90`: Show Fortran from AST for the given file and exit - `--no-color`: Turn off colored AST/ASR - `--no-indent`: Turn off Indented print ASR/AST - `--tree`: Tree structure print ASR/AST - `--json`: Print ASR/AST Json format - `--clojure`: Print ASR in clojure format - `--no-loc`: Skip location information in ASR/AST Json format - `--visualize`: Print ASR/AST Visualization - `--pass TEXT`: Apply the ASR pass and show ASR (implies --show-asr) - `--skip-pass TEXT`: Skip an ASR pass in the default pipeline - `--show-llvm`: Show LLVM IR for the given file and exit - `--show-cpp`: Show C++ translation source for the given file and exit - `--show-c`: Show C translation source for the given file and exit - `--show-asm`: Show assembly for the given file and exit - `--show-wat`: Show WAT (WebAssembly Text Format) and exit - `--show-julia`: Show Julia translation source for the given file and exit - `--show-fortran`: Show Fortran translation source for the given file and exit - `--show-stacktrace`: Show internal stacktrace on compiler errors - `--symtab-only`: Only create symbol tables in ASR (skip executable stmt) - `--time-report`: Show compilation time report - `--static`: Create a static executable - `--no-warnings`: Turn off all warnings - `--no-style-suggestions`: Turn off style suggestions - `--no-error-banner`: Turn off error banner - `--continue-compilation`: Collect error messages and continue compilation after encountering semantic errors - `--error-format TEXT=human`: Control how errors are produced (human, short) - `--backend TEXT=llvm`: Select a backend (llvm, cpp, x86, wasm, fortran) - `--openmp`: Enable OpenMP - `--separate-compilation`: Generate object code into .o files - `--rtlib`: Include the full runtime library in the LLVM output - `--use-loop-variable-after-loop`: Allow using loop variable after the loop - `--fast`: Best performance (disable strict standard compliance) - `--link-with-gcc`: Calls GCC for linking instead of clang - `--target TEXT`: Generate code for the given target - `--print-targets`: Print the registered targets - `--implicit-typing`: Allow implicit typing - `--implicit-interface`: Allow implicit interface - `--implicit-argument-casting`: Allow implicit argument casting - `--print-leading-space`: Print leading white space if format is unspecified - `--interactive-parse`: Use interactive parse - `--verbose`: Print debugging statements - `--dump-all-passes`: Apply all the passes and dump the ASR into a file - `--dump-all-passes-fortran`: Apply all passes and dump the ASR after each pass into a Fortran file - `--cumulative`: Apply all the passes cumulatively till the given pass - `--realloc-lhs-arrays`: Reallocate left hand side automatically for arrays - `--disable-realloc-lhs-arrays`: Disables reallocating left hand side automatically for arrays - `--module-mangling`: Mangles the module name - `--global-mangling`: Mangles all the global symbols - `--intrinsic-mangling`: Mangles all the intrinsic symbols - `--all-mangling`: Mangles all possible symbols - `--bindc-mangling`: Mangles functions with ABI bind(c) - `--apply-fortran-mangling`: Mangle symbols with Fortran supported syntax - `--mangle-underscore`: Mangles with underscore - `--legacy-array-sections`: Enables passing array items as sections if required - `--ignore-pragma`: Ignores all the pragmas - `--stack-arrays`: Allocate memory for arrays on stack # SUBCOMMANDS - `fmt`: Format Fortran source files. - `kernel`: Run in Jupyter kernel mode. - `mod`: Fortran mod file utilities. - `pywrap`: Python wrapper generator # SEE ALSO For more information, visit the official LFortran documentation at https://docs.lfortran.org/. lfortran-0.63.0/doc/man/CMakeLists.txt0000664000175000017500000000150015174404631017674 0ustar alastairalastair# in tarball if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/lfortran.1) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/lfortran.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) # in git repo elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/lfortran.md) find_program(PANDOC_EXECUTABLE NAMES pandoc) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(PANDOC REQUIRED_VARS PANDOC_EXECUTABLE) if(PANDOC_FOUND) add_custom_command(OUTPUT lfortran.1 COMMAND ${PANDOC_EXECUTABLE} --standalone --to man ${CMAKE_CURRENT_SOURCE_DIR}/lfortran.md -o lfortran.1 COMMENT "Building lfortran manpage" DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lfortran.md) add_custom_target(manpage ALL DEPENDS lfortran.1) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lfortran.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) endif() endif() lfortran-0.63.0/doc/locale/0000775000175000017500000000000015174404631015624 5ustar alastairalastairlfortran-0.63.0/doc/locale/cs/0000775000175000017500000000000015174404631016231 5ustar alastairalastairlfortran-0.63.0/doc/locale/cs/LC_MESSAGES/0000775000175000017500000000000015174404631020016 5ustar alastairalastairlfortran-0.63.0/doc/locale/cs/LC_MESSAGES/docs.po0000664000175000017500000042654715174404631021330 0ustar alastairalastair# SOME DESCRIPTIVE TITLE. # Copyright (C) 2022 LFortran contributors # This file is distributed under the same license as the LFortran package. # FIRST AUTHOR , 2022. # msgid "" 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: OndÅ™ej ÄŒertík \n" "Language-Team: Czech \n" "Language: cs\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" "X-Generator: Weblate 4.14-dev\n" "Generated-By: Babel 2.10.3\n" #: ../../doc/src/ast_and_asr.ipynb:9 msgid "Difference between an AST and ASR" msgstr "Rozdíly mezi AST a ASR" #: ../../doc/src/ast_and_asr.ipynb:11 msgid "Let us take a simple Fortran code:" msgstr "VezmÄ›me tento jednoduchý zdrojový kód ve Fortranu:" #: ../../doc/src/ast_and_asr.ipynb:22 msgid "and look at how the AST and ASR looks like." msgstr "a podívejme se jak AST a ASR vypadá." #: ../../doc/src/ast_and_asr.ipynb:25 ../../doc/src/progress.md msgid "AST" msgstr "AST" #: ../../doc/src/ast_and_asr.ipynb:76 msgid "" "The AST does not have any semantic information, but has nodes to " "represent declarations such as ``integer, intent(in) :: a``. Variables " "such as ``a`` are represented by a ``Name`` node, and are not connected " "to their declarations yet." msgstr "" "AST nemá žádné semantické informace, ale má uzly které reprezentují " "deklarace jako ``integer, intent(in) :: a``. PromÄ›nné jako ``a`` jsou " "reprezentovány uzlem ``Name`` a nejsou jeÅ¡tÄ› propojeny se svými deklaracemi." #: ../../doc/src/ast_and_asr.ipynb:88 ../../doc/src/progress.md msgid "ASR" msgstr "ASR" #: ../../doc/src/ast_and_asr.ipynb:139 msgid "" "The ASR has all the semantic information (types, etc.), nodes like " "``Function`` have a symbol table and do not have any declaration nodes. " "Variables are simply pointers to the symbol table." msgstr "" "ASR má vÅ¡echny semantické informace (typy, atd.), uzly jako ``Function`` " "mají tabulku symbolů a nemají uzly s deklaracemi. PromÄ›nné jsou přímo " "ukazatelé do tabulky symbolů." #: ../../doc/src/ast_and_asr.ipynb:142 msgid "Discussion" msgstr "Diskuze" #: ../../doc/src/ast_and_asr.ipynb:144 msgid "" "The above was a simple example. Things get more apparent for more " "complicated examples, such as:" msgstr "" "NahoÅ™e byl jednoduchý příklad. VÄ›ci budou jasnÄ›jší když si rozebereme " "komplikovanÄ›jší problémy, jako například:" #: ../../doc/src/ast_and_asr.ipynb:160 msgid "" "AST must represent all the ``use`` statements and the ``interface`` " "block, and keep things semantically consistent." msgstr "" "AST musí reprezentovat vÅ¡echny ``use`` řádky a ``interface`` blok a ASR uzly " "musí být semanticky konzistentní." #: ../../doc/src/ast_and_asr.ipynb:162 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" " are defined in the ``gfort_interop`` module, and so ASR does not have " "any of these declaration nodes." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:164 msgid "" "When converting from ASR to AST, LFortran will create all the appropriate" " AST declaration nodes automatically and correctly." msgstr "" #: ../../doc/src/contributing.md:1 msgid "Contributing" msgstr "" #: ../../doc/src/contributing.md:3 msgid "" "We welcome contributions from anyone, even if you are new to open source." " It might sound daunting to contribute to a compiler at first, but please" " do, it is not complicated. We will help you with any technical issues " "and help improve your contribution so that it can be merged." msgstr "" #: ../../doc/src/contributing.md:8 msgid "Basic Setup" msgstr "Základní instalace" #: ../../doc/src/contributing.md:10 msgid "To contribute, make sure your set up:" msgstr "Abyste mohli pÅ™ispÄ›t, ujistÄ›te se, že jste nainstalovali:" #: ../../doc/src/contributing.md:12 msgid "Your username + email" msgstr "VaÅ¡e uživatelské jméno + email" #: ../../doc/src/contributing.md:13 msgid "Your `~/.gitconfig`" msgstr "Váš `~/.gitconfig`" #: ../../doc/src/contributing.md:14 msgid "Your shell prompt to display the current branch name" msgstr "Váš terminál aby zobrazil aktuální název vÄ›tve" #: ../../doc/src/contributing.md:16 msgid "Fork LFortran" msgstr "" #: ../../doc/src/contributing.md:18 msgid "" "Step 1. Create a fork of the [project " "repository](https://github.com/lfortran/lfortran)" msgstr "" #: ../../doc/src/contributing.md:20 msgid "" "Step 2. Set up your [SSH key](https://docs.github.com/en/authentication" "/connecting-to-github-with-ssh) with GitHub" msgstr "" #: ../../doc/src/contributing.md:22 msgid "" "Step 3. Clone the project repository from GitHub and set up your remote " "repository" msgstr "" #: ../../doc/src/contributing.md:29 msgid "" ":fontawesome-solid-edit: `REMOTE_NAME` is the name of your remote " "repository and could be any name you like, for example your first name." msgstr "" #: ../../doc/src/contributing.md:31 msgid "" ":fontawesome-solid-edit: `YOUR_GITHUB_ID` is your user ID on GitHub and " "should be part of your account path." msgstr "" #: ../../doc/src/contributing.md:33 msgid "" "You can use `git remote -v` to check if the new remote is set up " "correctly." msgstr "" #: ../../doc/src/contributing.md:35 msgid "Send a New Merge Request" msgstr "" #: ../../doc/src/contributing.md:37 msgid "Step 1. Create a new branch" msgstr "" #: ../../doc/src/contributing.md:42 msgid "Step 2. Make changes in relevant file(s)" msgstr "" #: ../../doc/src/contributing.md:44 msgid "Step 3. Commit the changes:" msgstr "" #: ../../doc/src/contributing.md:51 msgid "" "[Here](https://chris.beams.io/posts/git-commit/) are some great tips on " "writing good commit messages." msgstr "" #: ../../doc/src/contributing.md:53 msgid "Step 4. Check to ensure that your changes look good" msgstr "" #: ../../doc/src/contributing.md:58 msgid "Step 5. Send the merge request" msgstr "" #: ../../doc/src/contributing.md:64 msgid "" "The command will push the new branch `fix1` into your remote repository " "`REMOTE_NAME` that you created earlier. Additionally, it will also " "display a link that you can click on to open the new merge request. After" " clicking on the link, write a title and a concise description then click" " the \"Create\" button. Yay you are now all set." msgstr "" #: ../../doc/src/contributing.md:66 msgid "Add New Features" msgstr "" #: ../../doc/src/contributing.md:68 msgid "" "The example below shows the steps it would take to create a caret binary " "operator **^** which computes the average value of the two operands." msgstr "" #: ../../doc/src/contributing.md:70 msgid "Create New Token(s)" msgstr "" #: ../../doc/src/contributing.md:72 msgid "" "We extend the *tokenizer.re* as well as *parser.yy* to add the new token " "**^**. We also tell LFortran how to print the new token in *parser.cpp*." msgstr "" #: ../../doc/src/contributing.md:75 msgid ":fontawesome-solid-code: *src/lfortran/parser/tokenizer.re*" msgstr "" #: ../../doc/src/contributing.md:80 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.yy*" msgstr "" #: ../../doc/src/contributing.md:85 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.cpp*" msgstr "" #: ../../doc/src/contributing.md:94 msgid "The added code is tested with `lfortran --show-tokens examples2/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:96 msgid "Parse the New Token" msgstr "" #: ../../doc/src/contributing.md:98 msgid "" "Now we have to parse the new operator. We add it to the AST by extending " "the BinOp with a caret operator and modifying the *AST.asdl* file. Then " "we add it in *parse.yy* to properly parse and generate the new AST in " "*semantics.h*.Finally we extend *pickle.cpp* so that the new operator can" " print itself." msgstr "" #: ../../doc/src/contributing.md:102 msgid ":fontawesome-solid-code:*grammar/AST.asdl*" msgstr "" #: ../../doc/src/contributing.md:107 msgid ":fontawesome-solid-code:*src/lfortran/parser/parser.yy*" msgstr "" #: ../../doc/src/contributing.md:116 msgid ":fontawesome-solid-code:*src/lfortran/parser/semantics.h*" msgstr "" #: ../../doc/src/contributing.md:121 msgid ":fontawesome-solid-code:*src/lfortran/pickle.cpp*" msgstr "" #: ../../doc/src/contributing.md:132 msgid "The section is tested with `lfortran --show-ast examples/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:134 msgid "Implement the Semantics of the New Token" msgstr "" #: ../../doc/src/contributing.md:136 msgid "" "We first extend the ASR in *ASR.asdl* and add ^ as a BinOp operator " "option." msgstr "" #: ../../doc/src/contributing.md:138 msgid ":fontawesome-solid-code:*src/libasr/ASR.asdl*" msgstr "" #: ../../doc/src/contributing.md:142 msgid ":fontawesome-solid-code:*src/lfortran/semantics/ast_common_visitor.h*" msgstr "" #: ../../doc/src/contributing.md:179 msgid "" "Then we transform it from AST to ASR by extending " "*src/lfortran/semantics/ast_common_visitor.h*." msgstr "" #: ../../doc/src/contributing.md:181 msgid "" "We also add it into compile time evaluation triggered by expressions such" " as `e = (2+3)^5` which is evaluated at compile time. An expression such " "as `e = x^5` is evaluated at run time only." msgstr "" #: ../../doc/src/contributing.md:183 msgid "The section is tested with `lfortran --show-asr examples/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:184 msgid "Implement the New Token in LLVM" msgstr "" #: ../../doc/src/contributing.md:186 msgid "" "To implement in LLVM, we extend the BinOp translation by handling the new" " operator. We first add the two numbers then divide by two. :fontawesome-" "solid-code:*src/lfortran/codegen/asr_to_llvm.cpp*" msgstr "" #: ../../doc/src/contributing.md:217 msgid "The section is tested with `lfortran --show-llvm examples/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:219 msgid "Now when LLVM works, we can test the final executable by:" msgstr "" #: ../../doc/src/contributing.md:224 msgid "And it should print 6." msgstr "" #: ../../doc/src/contributing.md:226 msgid "It also works interactively:" msgstr "" #: ../../doc/src/contributing.md:242 msgid "Reach Out" msgstr "" #: ../../doc/src/contributing.md:244 msgid "" "If you have any questions or need help, please ask as at our " "[mailinglist](https://groups.io/g/lfortran) or a " "[chat](https://lfortran.zulipchat.com/)." msgstr "" #: ../../doc/src/contributing.md:248 msgid "" "Please note that all participants of this project are expected to follow " "our Code of Conduct. By participating in this project you agree to abide " "by its terms. See " "[CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/blob/main/CODE_OF_CONDUCT.md)." msgstr "" #: ../../doc/src/contributing.md:252 msgid "" "By submitting a PR you agree to license your contribution under the " "LFortran's BSD " "[license](https://github.com/lfortran/lfortran/blob/main/LICENSE) unless " "explicitly noted otherwise." msgstr "" #: ../../doc/src/design.md:1 msgid "LFortran Design" msgstr "" #: ../../doc/src/design.md:3 msgid "High Level Overview" msgstr "" #: ../../doc/src/design.md:5 ../../doc/src/developer_tutorial.ipynb:16 msgid "" "LFortran is structured around two independent modules, AST and ASR, both " "of which are standalone (completely independent of the rest of LFortran) " "and users are encouraged to use them independently for other applications" " and build tools on top:" msgstr "" #: ../../doc/src/design.md:10 msgid "" "Abstract Syntax Tree (AST), module `lfortran.ast`: Represents any Fortran" " source code, strictly based on syntax, no semantic is included. The AST " "module can convert itself to Fortran source code." msgstr "" #: ../../doc/src/design.md:14 msgid "" "Abstract Semantic Representation (ASR), module `lfortran.asr`: Represents" " a valid Fortran source code, all semantic is included. Invalid Fortran " "code is not allowed (an error will be given). The ASR module can convert " "itself to an AST." msgstr "" #: ../../doc/src/design.md:19 msgid "" "The LFortran compiler is then composed of the following independent " "stages:" msgstr "" #: ../../doc/src/design.md:21 msgid "Parsing: converts Fortran source code to an AST" msgstr "" #: ../../doc/src/design.md:22 msgid "Semantic: converts an AST to an ASR" msgstr "" #: ../../doc/src/design.md:23 msgid "" "High level optimizations: optimize ASR to a possibly faster/simpler ASR " "(things like inlining functions, eliminating redundant expressions or " "statements, etc.)" msgstr "" #: ../../doc/src/design.md:26 msgid "" "LLVM IR code generation and lower level optimizations: converts an ASR to" " an LLVM IR. This stage also does all other optimizations that do not " "produce an ASR, but still make sense to do before passing to LLVM IR." msgstr "" #: ../../doc/src/design.md:29 msgid "" "Machine code generation: LLVM then does all its optimizations and " "generates machine code (such as a binary executable, a library, an object" " file, or it is loaded and executed using JIT as part of the interactive " "LFortran session or in a Jupyter kernel)." msgstr "" #: ../../doc/src/design.md:34 msgid "" "LFortran is structured as a library, and so one can for example use the " "parser to obtain an AST and do something with it, or one can then use the" " semantic analyzer to obtain ASR and do something with it. One can " "generate the ASR directly (e.g., from SymPy) and then either convert to " "AST and to a Fortran source code, or use LFortran to compile it to " "machine code directly. In other words, one can use LFortran to easily " "convert between the three equivalent representations:" msgstr "" #: ../../doc/src/design.md:42 msgid "Fortran source code" msgstr "" #: ../../doc/src/design.md:43 ../../doc/src/developer_tutorial.ipynb:23 msgid "Abstract Syntax Tree (AST)" msgstr "" #: ../../doc/src/design.md:44 ../../doc/src/developer_tutorial.ipynb:159 msgid "Abstract Semantic Representation (ASR)" msgstr "" #: ../../doc/src/design.md:46 msgid "They are all equivalent in the following sense:" msgstr "" #: ../../doc/src/design.md:48 msgid "Any ASR can always be converted to an equivalent AST" msgstr "" #: ../../doc/src/design.md:49 msgid "Any AST can always be converted to an equivalent Fortran source code" msgstr "" #: ../../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 "" #: ../../doc/src/design.md:52 msgid "" "Any AST can always be either converted to an equivalent ASR or one gets a" " semantic error" msgstr "" #: ../../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 "" #: ../../doc/src/design.md:58 msgid "ASR Design Details" msgstr "" #: ../../doc/src/design.md:60 msgid "The ASR is designed to have the following features:" msgstr "" #: ../../doc/src/design.md:62 msgid "" "ASR is still semantically equivalent to the original Fortran code (it did" " not lose any semantic information). ASR can be converted to AST, and AST" " to Fortran source code which is functionally equivalent to the original." msgstr "" #: ../../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 "" #: ../../doc/src/design.md:69 msgid "" "The ASR C++ classes (down the road) are designed similarly to SymEngine: " "they are constructed once and after that they are immutable. The " "constructor checks in Debug more that all the requirements are met (e.g.," " that all Variables in a Function have a dummy argument set, that " "explicit-shape arrays are not allocatable and all other Fortran " "requirements to make it a valid code), but in Release mode it quickly " "constructs the class without checks. Then there are builder classes that " "construct the ASR C++ classes to meet requirements (checked in Debug " "mode) and the builder gives an error message if a code is not a valid " "Fortran code, and if it doesn't give an error message, then the ASR C++ " "classes are constructed correctly. Thus by construction, the ASR classes " "always contain valid Fortran code and the rest of LFortran can depend on " "it." msgstr "" #: ../../doc/src/design.md:82 msgid "Notes:" msgstr "" #: ../../doc/src/design.md:84 msgid "" "Information that is lost when parsing source to AST: whitespace, " "multiline/single line if statement distinction, case sensitivity of " "keywords." msgstr "" #: ../../doc/src/design.md:87 msgid "" "Information that is lost when going from AST to ASR: detailed syntax how " "variables were defined and the order of type attributes (whether array " "dimension is using the `dimension` attribute, or parentheses at the " "variable; or how many variables there are per declaration line or their " "order), as ASR only represents the aggregated type information in the " "symbol table." msgstr "" #: ../../doc/src/design.md:90 msgid "" "ASR is the simplest way to generate Fortran code, as one does not have to" " worry about the detailed syntax (as in AST) about how and where things " "are declared. One specifies the symbol table for a module, then for each " "symbol (functions, global variables, types, ...) one specifies the local " "variables and if this is an interface then one needs to specify where one" " can find an implementation, otherwise a body is supplied with " "statements, those nodes are almost the same as in AST, except that each " "variable is just a reference to a symbol in the symbol table (so by " "construction one cannot have undefined variables). The symbol table for " "each node such as Function or Module also references its parent (for " "example a function references a module, a module references the global " "scope)." msgstr "" #: ../../doc/src/design.md:102 msgid "" "The ASR can be directly converted to an AST without gathering any other " "information. And the AST directly to Fortran source code." msgstr "" #: ../../doc/src/design.md:105 msgid "" "The ASR is always representing a semantically valid Fortran code. This " "is enforced by checks in the ASR C++ constructors (in Debug build). When " "an ASR is used, one can assume it is valid." msgstr "" #: ../../doc/src/design.md:109 msgid "Fortran 2008" msgstr "" #: ../../doc/src/design.md:111 msgid "" "Fortran 2008 [standard](https://j3-fortran.org/doc/year/10/10-007.pdf) " "chapter 2 \"Fortran concepts\" specifies that Fortran code is a " "collection of _program units_ (either all in one file, or in separate " "files), where each _program unit_ is one of:" msgstr "" #: ../../doc/src/design.md:116 ../../doc/src/design.md:131 msgid "main program" msgstr "" #: ../../doc/src/design.md:117 ../../doc/src/design.md:132 msgid "module or submodule" msgstr "" #: ../../doc/src/design.md:118 ../../doc/src/design.md:133 msgid "function or subroutine" msgstr "" #: ../../doc/src/design.md:120 msgid "" "Note: It can also be a _block data_ program unit, that is used to provide" " initial values for data objects in named _common blocks_, but we do not " "recommend the use of _common blocks_ (use modules instead)." msgstr "" #: ../../doc/src/design.md:124 msgid "LFortran Extension" msgstr "" #: ../../doc/src/design.md:126 msgid "" "We extend the Fortran language by introducing a _global scope_, which is " "not only the list of _program units_ (as in F2008) but can also include " "statements, declarations, use statements and expressions. We define " "_global scope_ as a collection of the following items:" msgstr "" #: ../../doc/src/design.md:134 msgid "use statement" msgstr "" #: ../../doc/src/design.md:135 msgid "declaration" msgstr "" #: ../../doc/src/design.md:136 msgid "statement" msgstr "" #: ../../doc/src/design.md:137 msgid "expression" msgstr "" #: ../../doc/src/design.md:139 msgid "" "In addition, if a variable is not defined in an assignment statement " "(such as `x = 5+3`) then the type of the variable is inferred from the " "right hand side (e.g., `x` in `x = 5+3` would be of type `integer`, and " "`y` in `y = 5._dp` would be of type `real(dp)`). This rule only applies " "at the top level of _global scope_. Types must be fully specified inside " "main programs, modules, functions and subroutines, just like in F2008." msgstr "" #: ../../doc/src/design.md:146 msgid "" "The _global scope_ has its own symbol table. The main program and " "module/submodule do not see any symbols from this symbol table. But " "functions, subroutines, statements and expressions at the top level of " "_global scope_ use and operate on this symbol table." msgstr "" #: ../../doc/src/design.md:151 msgid "" "The _global scope_ has the following symbols predefined in the symbol " "table:" msgstr "" #: ../../doc/src/design.md:153 msgid "" "the usual standard set of Fortran functions (such as `size`, `sin`, " "`cos`, ...)" msgstr "" #: ../../doc/src/design.md:155 msgid "" "the `dp` double precision symbol, so that one can use `5._dp` for double " "precision." msgstr "" #: ../../doc/src/design.md:158 msgid "" "Each item in the _global scope_ is interpreted as follows: main program " "is compiled into an executable with the same name and executed; modules, " "functions and subroutines are compiled and loaded; use statement and " "declaration adds those symbols with the proper type into the _global " "scope_ symbol table, but do not generate any code; statement is wrapped " "into an anonymous subroutine with no arguments, compiled, loaded and " "executed; expression is wrapped into an anonymous function with no " "arguments returning the expression, compiled, loaded, executed and the " "return value is returned to the user." msgstr "" #: ../../doc/src/design.md:168 msgid "" "The _global scope_ is always interpreted, item by item, per the previous " "paragraph. It is meant to allow interactive usage, experimentations and " "writing simple scripts. Code in _global scope_ must be interpreted using " "`lfortran`. For more complex (production) code it is recommended to turn " "it into modules and programs (by wrapping loose statements into " "subroutines or functions and by adding type declarations) and compile it " "with `lfortran` or any other Fortran compiler." msgstr "" #: ../../doc/src/design.md:176 msgid "Here are some examples of valid code in _global scope_:" msgstr "" #: ../../doc/src/design.md:178 msgid "Example 1" msgstr "" #: ../../doc/src/design.md:185 msgid "Example 2" msgstr "" #: ../../doc/src/design.md:197 msgid "Example 3" msgstr "" #: ../../doc/src/design.md:209 msgid "Example 4" msgstr "" #: ../../doc/src/design.md:217 msgid "Design Considerations" msgstr "" #: ../../doc/src/design.md:219 msgid "" "The LFortran extension of Fortran was chosen in a way so as to minimize " "the number of changes. In particular, only the top level of the _global " "scope_ has relaxed some of the Fortran rules (such as making specifying " "types optional) so as to allow simple and quick interactive usage, but " "inside functions, subroutines, modules or programs this relaxation does " "not apply." msgstr "" #: ../../doc/src/design.md:225 msgid "" "The number of changes were kept to minimum in order to make it " "straightforward to turn code at _global scope_ into standard compliant " "Fortran code using programs and modules, so that it can be compiled by " "any Fortran compiler." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:9 msgid "Developer Tutorial" msgstr "" #: ../../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 "" #: ../../doc/src/developer_tutorial.ipynb:14 msgid "Introduction" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:18 msgid "" "Abstract Syntax Tree (AST): Represents any Fortran source code, strictly " "based on syntax, no semantic is included. The AST module can convert " "itself to Fortran source code." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:20 msgid "" "Abstract Semantic Representation (ASR): Represents a valid Fortran source" " code, all semantic is included. Invalid Fortran code is not allowed (an " "error will be given). The ASR module can convert itself to an AST." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:25 msgid "" "Fortran source code can be parsed into an AST using the ``src_to_ast()`` " "function:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:49 #, python-format msgid "We can pretty print it using the ``%%showast`` magic:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:98 #, python-format msgid "We can convert AST to Fortran source code using ``%%showfmt``:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:156 msgid "" "All AST nodes and their arguments are described in `AST.asdl " "`__." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:170 #, python-format msgid "We can pretty print using the ``%%showasr`` magic:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:219 msgid "" "All ASR nodes and their arguments are described in `ASR.asdl " "`__." msgstr "" #: ../../doc/src/index.md:134 msgid "Getting started" msgstr "ZaÄínáme" #: ../../doc/src/index.md:141 ../../doc/src/progress.md:1 msgid "LFortran Development Status" msgstr "" #: ../../doc/src/index.md:147 msgid "Developer's Guide" msgstr "" #: ../../doc/src/index.md:156 msgid "LFortran Intrinsics" msgstr "" #: ../../doc/src/index.md:1 msgid "LFortran Documentation" msgstr "" #: ../../doc/src/index.md:3 msgid "" "LFortran is a modern open-source (BSD licensed) interactive Fortran " "compiler built on top of LLVM. It can execute user's code interactively " "to allow exploratory work (much like Python, MATLAB or Julia) as well as " "compile to binaries with the goal to run user's code on modern " "architectures such as multi-core CPUs and GPUs." msgstr "" #: ../../doc/src/index.md:9 #, python-format msgid "" "Website: [https://lfortran.org/](https://lfortran.org/) Main " "repository: " "[https://github.com/lfortran/lfortran](https://github.com/lfortran/lfortran)" " Try online using Binder: " "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb)" msgstr "" #: ../../doc/src/index.md:9 msgid "Binder" msgstr "" #: ../../doc/src/index.md:16 msgid "Feature Highlights" msgstr "" #: ../../doc/src/index.md:18 msgid "" "LFortran is in development, there are features that work today, and there" " are features that are being implemented. You can also check out the " "[Development Status](progress.md) section for more information on " "features being supported and being worked on." msgstr "" #: ../../doc/src/index.md:21 msgid "Works today" msgstr "Funguje dnes" #: ../../doc/src/index.md:23 #, python-format msgid "" "**Interactive, Jupyter support** LFortran can be used from Jupyter as a" " Fortran kernel, allowing a Python/Julia style rapid prototyping and " "exploratory workflow (see the " "[static](https://nbviewer.jupyter.org/gist/certik/f1d28a486510810d824869ab0c491b1c)" " or [interactive](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb) example notebook). Or " "it can be used from the command-line in an interactive prompt (REPL)." msgstr "" #: ../../doc/src/index.md:32 msgid "" "**Clean, modular design, usable as a library** LFortran is structured " "around two independent modules, AST and ASR, both of which are " "standalone (completely independent of the rest of LFortran) and users " "are encouraged to use them independently for other applications and " "build tools on top. See the [Design](design.md) and [Developer " "Tutorial](developer_tutorial.md) documents for more details." msgstr "" #: ../../doc/src/index.md:39 msgid "" "**Interoperation with GFortran** LFortran can parse GFortran module " "files into an ASR and generate a Fortran wrapper that can be compiled " "with any Fortran compiler and linked with the original GFortran " "compiled module." msgstr "" #: ../../doc/src/index.md:44 msgid "" "**Create executables** It can create executables just like other " "Fortran compilers." msgstr "" #: ../../doc/src/index.md:47 msgid "" "**Runs on Linux, Mac and Windows** All three platforms are regularly " "tested by our CI." msgstr "" #: ../../doc/src/index.md:51 msgid "Planned" msgstr "Plánováno" #: ../../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 "" #: ../../doc/src/index.md:56 msgid "" "**Native interoperation with other languages (and other Fortran " "compilers)** It can automatically call code written in other languages " "(such as C or Python) just by using the `use` statement, see " "[#44](https://gitlab.com/lfortran/lfortran/issues/44). It understands " "other Fortran compilers module files (one can just \"use\" them) and " "their ABI to link correctly (GFortran is supported, other compilers are" " planned, see [#56](https://gitlab.com/lfortran/lfortran/issues/56)), " "which allows to use LFortran with production codes today." msgstr "" #: ../../doc/src/index.md:65 msgid "" "**Modern hardware support** Thanks to LLVM, the goal of LFortran is to " "run on modern hardware and take advantage of native Fortran language " "constructs (such as `do concurrent`) to run on multi-core CPUs and " "GPUs, see [#57](https://gitlab.com/lfortran/lfortran/issues/57)." msgstr "" #: ../../doc/src/index.md:71 msgid "" "**Full Fortran 2018 support** Currently only a subset of Fortran is " "implemented, but the goal is to have a full implementation of the " "latest Fortran 2018 standard, see " "[#58](https://gitlab.com/lfortran/lfortran/issues/58)." msgstr "" #: ../../doc/src/index.md:77 msgid "" "Please vote on issues in our [issue " "tracker](https://gitlab.com/lfortran/lfortran/issues) that you want us to" " prioritize (feel free to create new ones if we are missing anything)." msgstr "" #: ../../doc/src/index.md:81 msgid "Roadmap" msgstr "" #: ../../doc/src/index.md:83 msgid "Here is our roadmap how to get all the planned features above implemented:" msgstr "" #: ../../doc/src/index.md:85 msgid "" "Port code generation to use ASR and pass all the current tests " "([#74](https://gitlab.com/lfortran/lfortran/issues/74)). Remove the old " "code generation and old semantics, that used to annotate the AST tree, " "which was messy." msgstr "" #: ../../doc/src/index.md:89 msgid "" "Get GFortran module files working with `use` module, both assumed-size " "and assumed-shape arrays " "([#52](https://gitlab.com/lfortran/lfortran/issues/52)). This will allow " "right away to use production codes with LFortran." msgstr "" #: ../../doc/src/index.md:93 msgid "Do these at the same time:" msgstr "" #: ../../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 "" #: ../../doc/src/index.md:98 msgid "" "b) Gradually move to C++ for robustness and speed " "([#70](https://gitlab.com/lfortran/lfortran/issues/70)). The Python API " "will not change (or only minimally), so the user experience from Python " "will not change." msgstr "" #: ../../doc/src/index.md:103 msgid "" "c) Implement all the other cool features: `use` module for C and Python " "and automatic wrappers " "([#44](https://gitlab.com/lfortran/lfortran/issues/44)), modern hardware" " support ([#57](https://gitlab.com/lfortran/lfortran/issues/57)), " "generating an older standard of Fortran " "([#72](https://gitlab.com/lfortran/lfortran/issues/72)), Fortran doctest" " feature ([#73](https://gitlab.com/lfortran/lfortran/issues/73)), SymPy" " integration ([#71](https://gitlab.com/lfortran/lfortran/issues/71)), " "language service for IDEs " "([#12](https://gitlab.com/lfortran/lfortran/issues/12)), and other ideas" " ([#29](https://gitlab.com/lfortran/lfortran/issues/29))." msgstr "" #: ../../doc/src/index.md:118 msgid "The step 1. is an internal refactoring that will not take long." msgstr "" #: ../../doc/src/index.md:120 msgid "" "The step 2. will allow LFortran to be used interactively with production " "codes right away (the production code will get compiled with GFortran, " "then one \"uses\" any module in LFortran and functions/subroutines can be" " interactively called, the module itself can use any GFortran supported " "feature, but the API must fit into the subset that LFortran understands " "--- for large number of applications simple functions/subroutines with " "array arguments are enough). This will make LFortran usable for first " "users and one can always use GFortran temporarily until LFortran supports" " the given feature. We expect to be finished with the step 2. by the end " "of summer 2019, hopefully sooner." msgstr "" #: ../../doc/src/index.md:130 msgid "" "Finally the step 3. will improve LFortran overall, allowing the first " "users to contribute back, growing the community and making LFortran " "gradually useful for more and more people." msgstr "" #: ../../doc/src/installation.md:1 msgid "Installation" msgstr "" #: ../../doc/src/installation.md:3 msgid "All the instructions below work on Linux, macOS and Windows." msgstr "" #: ../../doc/src/installation.md:5 msgid "Binaries" msgstr "" #: ../../doc/src/installation.md:7 msgid "" "The recommended way to install LFortran is using Conda. Install Conda for" " example by installing the " "[Miniconda](https://conda.io/en/latest/miniconda.html) installation by " "following instructions there for your platform. Then create a new " "environment (you can choose any name, here we chose `lf`) and activate " "it:" msgstr "" #: ../../doc/src/installation.md:16 msgid "Then install LFortran by:" msgstr "" #: ../../doc/src/installation.md:20 msgid "" "Now the `lf` environment has the `lfortran` compiler available, you can " "start the interactive prompt by executing `lfortran`, or see the command " "line options using `lfortran -h`." msgstr "" #: ../../doc/src/installation.md:24 msgid "" "The Jupyter kernel is automatically installed by the above command, so " "after installing Jupyter itself:" msgstr "" #: ../../doc/src/installation.md:28 msgid "You can create a Fortran based Jupyter notebook by executing:" msgstr "" #: ../../doc/src/installation.md:32 msgid "and selecting `New->Fortran`." msgstr "" #: ../../doc/src/installation.md:35 msgid "Build From a Source Tarball" msgstr "" #: ../../doc/src/installation.md:37 msgid "" "This method is the recommended method if you just want to install " "LFortran, either yourself or in a package manager (Spack, Conda, Debian, " "etc.). The source tarball has all the generated files included and has " "minimal dependencies." msgstr "" #: ../../doc/src/installation.md:39 msgid "First we have to install dependencies, for example using Conda:" msgstr "" #: ../../doc/src/installation.md:44 msgid "" "Then download a tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), e.g.:" msgstr "" #: ../../doc/src/installation.md:52 msgid "And build:" msgstr "" #: ../../doc/src/installation.md:58 msgid "This will install the `lfortran` into the `inst/bin`." msgstr "" #: ../../doc/src/installation.md:60 msgid "Build From Git" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/installation.md:72 msgid "Then prepare the environment:" msgstr "" #: ../../doc/src/installation.md:77 msgid "Clone the LFortran git repository:" msgstr "" #: ../../doc/src/installation.md:82 msgid "" "Generate files that are needed for the build (this step depends on " "`re2c`, `bison` and `python`):" msgstr "" #: ../../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 "" #: ../../doc/src/installation.md:92 msgid "Run tests:" msgstr "" #: ../../doc/src/installation.md:97 msgid "Run an interactive prompt:" msgstr "" #: ../../doc/src/installation.md:102 msgid "Build from Git on Windows with Visual Studio" msgstr "" #: ../../doc/src/installation.md:104 msgid "" "Install Visual Studio (MSVC), for example the version 2022, you can " "download the Community version for free from: " "https://visualstudio.microsoft.com/downloads/." msgstr "" #: ../../doc/src/installation.md:107 msgid "" "Install miniforge using the Windows installer from https://github.com" "/conda-forge/miniforge." msgstr "" #: ../../doc/src/installation.md:109 msgid "Launch the Miniforge Prompt from the Desktop." msgstr "" #: ../../doc/src/installation.md:111 msgid "In the shell, initialize the MSVC compiler using:" msgstr "" #: ../../doc/src/installation.md:117 msgid "You can optionally test that MSVC works by:" msgstr "" #: ../../doc/src/installation.md:122 msgid "Both commands must print help (several pages)." msgstr "" #: ../../doc/src/installation.md:124 msgid "Now you can download and build LFortran:" msgstr "" #: ../../doc/src/installation.md:134 msgid "If everything compiled, then you can use LFortran as follows:" msgstr "" #: ../../doc/src/installation.md:140 msgid "And so on." msgstr "" #: ../../doc/src/installation.md:142 msgid "" "Note: LFortran currently uses the MSVC's linker program (`link`), which " "is only available when the MSVC bat script above is ran. If you forget to" " activate it, LFortran's linking will fail." msgstr "" #: ../../doc/src/installation.md:146 msgid "" "Note: the miniforge shell seems to be running some version of `git-bash` " "(although it is `cmd.exe`), which has some unix-like filesystem mounted " "in `/usr` and several commands available such as `ls`, `which`, `git`, " "`vim`. For this reason the Conda build `environment_win.yml` contains " "everything needed, including `git`." msgstr "" #: ../../doc/src/installation.md:152 msgid "Build from Git on Windows with WSL" msgstr "" #: ../../doc/src/installation.md:153 msgid "In windows search \"turn windows features on or off\"." msgstr "" #: ../../doc/src/installation.md:154 msgid "Tick Windows subsystem for Linux." msgstr "" #: ../../doc/src/installation.md:155 msgid "Press OK and restart computer." msgstr "" #: ../../doc/src/installation.md:156 msgid "Go to Microsoft store and download Ubuntu 20.04, and launch it." msgstr "" #: ../../doc/src/installation.md:157 msgid "Run the following commands." msgstr "" #: ../../doc/src/installation.md:164 msgid "Now do the following to configure the path" msgstr "" #: ../../doc/src/installation.md:168 msgid "Then go to the bottom of the file and paste the following" msgstr "" #: ../../doc/src/installation.md:172 msgid "Then press ctrl + O (save), Enter (confirm), ctrl + X (exit)" msgstr "" #: ../../doc/src/installation.md:173 msgid "After that restart Ubuntu" msgstr "" #: ../../doc/src/installation.md:174 msgid "Run the following" msgstr "" #: ../../doc/src/installation.md:179 msgid "Restart Ubuntu again" msgstr "" #: ../../doc/src/installation.md:187 msgid "" "You can change the directory to a Windows location using `cd /mnt/[drive " "letter]/[windows location]`." msgstr "" #: ../../doc/src/installation.md:188 msgid "e.g. `cd mnt/c/Users/name/source/repos/`" msgstr "" #: ../../doc/src/installation.md:190 msgid "Now clone the LFortran git repository" msgstr "" #: ../../doc/src/installation.md:196 msgid "Run the following commands" msgstr "" #: ../../doc/src/installation.md:204 msgid "If everything compiles, you can use LFortran as follows" msgstr "" #: ../../doc/src/installation.md:210 msgid "Run an interactive prompt" msgstr "" #: ../../doc/src/installation.md:215 msgid "Run tests" msgstr "" #: ../../doc/src/installation.md:221 msgid "Enabling the Jupyter Kernel" msgstr "" #: ../../doc/src/installation.md:223 msgid "To install the Jupyter kernel, install the following Conda packages also:" msgstr "" #: ../../doc/src/installation.md:227 msgid "" "and enable the kernel by `-DWITH_XEUS=yes` and install into " "`$CONDA_PREFIX`. For example:" msgstr "" #: ../../doc/src/installation.md:239 msgid "" "To use it, install Jupyter (`conda install jupyter`) and test that the " "LFortran kernel was found:" msgstr "" #: ../../doc/src/installation.md:244 msgid "Then launch a Jupyter notebook as follows:" msgstr "" #: ../../doc/src/installation.md:248 msgid "Click `New->Fortran`. To launch a terminal jupyter LFortran console:" msgstr "" #: ../../doc/src/installation.md:254 msgid "Build From Git with Nix" msgstr "" #: ../../doc/src/installation.md:256 msgid "" "One of the ways to ensure exact environment and dependencies is with " "`nix`. This will ensure that system dependencies do not interfere with " "the development environment. If you want, you can report bugs in a `nix-" "shell` environment to make it easier for others to reproduce." msgstr "" #: ../../doc/src/installation.md:258 msgid "With Root" msgstr "" #: ../../doc/src/installation.md:260 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 "" #: ../../doc/src/installation.md:264 msgid "Without Root" msgstr "" #: ../../doc/src/installation.md:266 msgid "" "If you would like to not provide `nix` with root access to your machine, " "on Linux distributions we can use [nix-" "portable](https://github.com/DavHau/nix-portable)." msgstr "" #: ../../doc/src/installation.md:270 msgid "" "Now just prepend all `nix-shell` commands with `NP_RUNTIME=bwrap ./nix-" "portable `. So:" msgstr "" #: ../../doc/src/installation.md:278 msgid "Development" msgstr "" #: ../../doc/src/installation.md:280 msgid "Now we can enter the development environment:" msgstr "" #: ../../doc/src/installation.md:284 msgid "" "The `--pure` flag ensures no system dependencies are used in the " "environment." msgstr "" #: ../../doc/src/installation.md:286 msgid "The build steps are the same as with the `ci`:" msgstr "" #: ../../doc/src/installation.md:292 msgid "" "To change the compilation environment from `gcc` (default) to `clang` we " "can use `--argstr`:" msgstr "" #: ../../doc/src/installation.md:297 msgid "Note About Dependencies" msgstr "" #: ../../doc/src/installation.md:299 msgid "" "End users (and distributions) are encouraged to use the tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), which " "only depends on LLVM, CMake and a C++ compiler." msgstr "" #: ../../doc/src/installation.md:303 msgid "" "The tarball is generated automatically by our CI (continuous integration)" " and contains some autogenerated files: the parser, the AST and ASR " "nodes, which is generated by an ASDL translator (requires Python)." msgstr "" #: ../../doc/src/installation.md:307 msgid "The instructions from git are to be used when developing LFortran itself." msgstr "" #: ../../doc/src/installation.md:309 msgid "Note for users who do not use Conda" msgstr "" #: ../../doc/src/installation.md:311 msgid "" "Following are the dependencies necessary for installing this repository " "in development mode," msgstr "" #: ../../doc/src/installation.md:314 msgid "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" msgstr "" #: ../../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 "" #: ../../doc/src/installation.md:316 msgid "[re2c - 2.0.3](https://re2c.org/install/install.html)" msgstr "" #: ../../doc/src/installation.md:317 msgid "" "[binutils - " "2.31.90](ftp://sourceware.org/pub/binutils/snapshots/binutils-2.31.90.tar.xz)" " - Make sure that you should enable the required options related to this " "dependency to build the dynamic libraries (the ones ending with `.so`)." msgstr "" #: ../../doc/src/installation.md:319 msgid "Stacktraces" msgstr "" #: ../../doc/src/installation.md:321 msgid "" "LFortran can print stacktraces when there is an unhandled exception, as " "well as on any compiler error with the `--show-stacktrace` option. This " "is very helpful for developing the compiler itself to see where in " "LFortran the problem is. The stacktrace support is turned off by default," " to enable it, compile LFortran with the `-DWITH_STACKTRACE=yes` cmake " "option after installing the prerequisites on each platform per the " "instructions below." msgstr "" #: ../../doc/src/installation.md:328 msgid "Ubuntu" msgstr "" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." msgstr "" #: ../../doc/src/installation.md:332 msgid "macOS" msgstr "" #: ../../doc/src/installation.md:334 msgid "" "If you use the default Clang compiler on macOS, then the stacktraces " "should just work on both Intel and M1 based macOS (the CMake build system" " automatically invokes the `dsymtuil` tool and our Python scripts to " "store the debug information, see `src/bin/CMakeLists.txt` for more " "details). If it does not work, please report a bug." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/installation.md:352 msgid "" "and compile LFortran with the " "`-DCMAKE_PREFIX_PATH=\"$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX\"` cmake" " option. The `$CONDA_PREFIX` is there if you install some other " "dependencies (such as `llvm`) using Conda, otherwise you can remove it." msgstr "" #: ../../doc/src/intrinsics/array.md:1 msgid "Array Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:1 msgid "allocated(x): Status Check" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:3 msgid "Logical status of an allocatable integer." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:5 #: ../../doc/src/intrinsics/array/cshift.md:5 #: ../../doc/src/intrinsics/array/size.md:5 #: ../../doc/src/intrinsics/bit/bge.md:5 ../../doc/src/intrinsics/bit/bgt.md:5 #: ../../doc/src/intrinsics/bit/bit_size.md:5 #: ../../doc/src/intrinsics/bit/ble.md:5 ../../doc/src/intrinsics/bit/blt.md:5 #: ../../doc/src/intrinsics/bit/btest.md:5 #: ../../doc/src/intrinsics/bit/shiftl.md:5 #: ../../doc/src/intrinsics/bit/shiftr.md:5 #: ../../doc/src/intrinsics/character/achar.md:5 #: ../../doc/src/intrinsics/character/adjustl.md:5 #: ../../doc/src/intrinsics/character/adjustr.md:5 #: ../../doc/src/intrinsics/character/char.md:5 #: ../../doc/src/intrinsics/character/len_trim.md:5 #: ../../doc/src/intrinsics/character/lge.md:5 #: ../../doc/src/intrinsics/kind-type/kind.md:5 #: ../../doc/src/intrinsics/mathematical/acos.md:5 #: ../../doc/src/intrinsics/mathematical/acosh.md:5 #: ../../doc/src/intrinsics/mathematical/asin.md:5 #: ../../doc/src/intrinsics/mathematical/asinh.md:5 #: ../../doc/src/intrinsics/mathematical/atan.md:5 #: ../../doc/src/intrinsics/mathematical/atan2.md:5 #: ../../doc/src/intrinsics/mathematical/atanh.md:5 #: ../../doc/src/intrinsics/mathematical/fraction.md:5 #: ../../doc/src/intrinsics/misc/command_argument_count.md:5 #: ../../doc/src/intrinsics/misc/cpu_time.md:5 #: ../../doc/src/intrinsics/misc/date_and_time.md:5 #: ../../doc/src/intrinsics/misc/new_line.md:5 #: ../../doc/src/intrinsics/numeric/abs.md:5 #: ../../doc/src/intrinsics/numeric/aimag.md:5 #: ../../doc/src/intrinsics/numeric/aint.md:5 #: ../../doc/src/intrinsics/numeric/anint.md:5 #: ../../doc/src/intrinsics/numeric/ceiling.md:5 #: ../../doc/src/intrinsics/numeric/cmplx.md:5 #: ../../doc/src/intrinsics/numeric/conjg.md:5 #: ../../doc/src/intrinsics/numeric/digits.md:5 #: ../../doc/src/intrinsics/numeric/dim.md:5 #: ../../doc/src/intrinsics/numeric/epsilon.md:5 #: ../../doc/src/intrinsics/numeric/erf.md:5 #: ../../doc/src/intrinsics/numeric/erfc.md:5 #: ../../doc/src/intrinsics/numeric/exp.md:5 #: ../../doc/src/intrinsics/numeric/floor.md:5 #: ../../doc/src/intrinsics/numeric/gamma.md:5 #: ../../doc/src/intrinsics/numeric/mod.md:5 msgid "Declaration" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:7 #: ../../doc/src/intrinsics/array/cshift.md:7 #: ../../doc/src/intrinsics/array/size.md:7 #: ../../doc/src/intrinsics/bit/bge.md:7 ../../doc/src/intrinsics/bit/bgt.md:7 #: ../../doc/src/intrinsics/bit/bit_size.md:7 #: ../../doc/src/intrinsics/bit/ble.md:7 ../../doc/src/intrinsics/bit/blt.md:7 #: ../../doc/src/intrinsics/bit/btest.md:7 #: ../../doc/src/intrinsics/bit/shiftl.md:7 #: ../../doc/src/intrinsics/bit/shiftr.md:7 #: ../../doc/src/intrinsics/character/achar.md:7 #: ../../doc/src/intrinsics/character/adjustl.md:7 #: ../../doc/src/intrinsics/character/adjustr.md:7 #: ../../doc/src/intrinsics/character/char.md:7 #: ../../doc/src/intrinsics/character/len_trim.md:7 #: ../../doc/src/intrinsics/character/lge.md:8 #: ../../doc/src/intrinsics/kind-type/kind.md:7 #: ../../doc/src/intrinsics/mathematical/acos.md:7 #: ../../doc/src/intrinsics/mathematical/acosh.md:7 #: ../../doc/src/intrinsics/mathematical/asin.md:7 #: ../../doc/src/intrinsics/mathematical/asinh.md:7 #: ../../doc/src/intrinsics/mathematical/atan.md:7 #: ../../doc/src/intrinsics/mathematical/atan2.md:7 #: ../../doc/src/intrinsics/mathematical/atanh.md:7 #: ../../doc/src/intrinsics/mathematical/fraction.md:7 #: ../../doc/src/intrinsics/misc/command_argument_count.md:7 #: ../../doc/src/intrinsics/misc/cpu_time.md:7 #: ../../doc/src/intrinsics/misc/date_and_time.md:7 #: ../../doc/src/intrinsics/misc/new_line.md:7 #: ../../doc/src/intrinsics/numeric/abs.md:7 #: ../../doc/src/intrinsics/numeric/aimag.md:7 #: ../../doc/src/intrinsics/numeric/aint.md:7 #: ../../doc/src/intrinsics/numeric/anint.md:7 #: ../../doc/src/intrinsics/numeric/ceiling.md:7 #: ../../doc/src/intrinsics/numeric/cmplx.md:7 #: ../../doc/src/intrinsics/numeric/conjg.md:7 #: ../../doc/src/intrinsics/numeric/digits.md:7 #: ../../doc/src/intrinsics/numeric/dim.md:7 #: ../../doc/src/intrinsics/numeric/epsilon.md:7 #: ../../doc/src/intrinsics/numeric/erf.md:7 #: ../../doc/src/intrinsics/numeric/erfc.md:7 #: ../../doc/src/intrinsics/numeric/exp.md:7 #: ../../doc/src/intrinsics/numeric/floor.md:7 #: ../../doc/src/intrinsics/numeric/gamma.md:7 #: ../../doc/src/intrinsics/numeric/mod.md:7 msgid "Syntax" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:14 #: ../../doc/src/intrinsics/array/cshift.md:14 #: ../../doc/src/intrinsics/array/size.md:14 #: ../../doc/src/intrinsics/bit/bge.md:14 #: ../../doc/src/intrinsics/bit/bgt.md:14 #: ../../doc/src/intrinsics/bit/bit_size.md:14 #: ../../doc/src/intrinsics/bit/ble.md:14 #: ../../doc/src/intrinsics/bit/blt.md:14 #: ../../doc/src/intrinsics/bit/btest.md:14 #: ../../doc/src/intrinsics/bit/shiftl.md:14 #: ../../doc/src/intrinsics/bit/shiftr.md:14 #: ../../doc/src/intrinsics/character/achar.md:14 #: ../../doc/src/intrinsics/character/adjustl.md:14 #: ../../doc/src/intrinsics/character/adjustr.md:14 #: ../../doc/src/intrinsics/character/char.md:14 #: ../../doc/src/intrinsics/character/len_trim.md:14 #: ../../doc/src/intrinsics/character/lge.md:15 #: ../../doc/src/intrinsics/kind-type/kind.md:14 #: ../../doc/src/intrinsics/mathematical/acos.md:14 #: ../../doc/src/intrinsics/mathematical/acosh.md:14 #: ../../doc/src/intrinsics/mathematical/asin.md:14 #: ../../doc/src/intrinsics/mathematical/asinh.md:14 #: ../../doc/src/intrinsics/mathematical/atan.md:14 #: ../../doc/src/intrinsics/mathematical/atan2.md:13 #: ../../doc/src/intrinsics/mathematical/atanh.md:14 #: ../../doc/src/intrinsics/mathematical/fraction.md:13 #: ../../doc/src/intrinsics/misc/command_argument_count.md:14 #: ../../doc/src/intrinsics/misc/cpu_time.md:14 #: ../../doc/src/intrinsics/misc/date_and_time.md:14 #: ../../doc/src/intrinsics/misc/new_line.md:14 #: ../../doc/src/intrinsics/numeric/abs.md:15 #: ../../doc/src/intrinsics/numeric/aimag.md:15 #: ../../doc/src/intrinsics/numeric/aint.md:14 #: ../../doc/src/intrinsics/numeric/anint.md:14 #: ../../doc/src/intrinsics/numeric/ceiling.md:14 #: ../../doc/src/intrinsics/numeric/cmplx.md:16 #: ../../doc/src/intrinsics/numeric/conjg.md:15 #: ../../doc/src/intrinsics/numeric/digits.md:13 #: ../../doc/src/intrinsics/numeric/dim.md:13 #: ../../doc/src/intrinsics/numeric/epsilon.md:14 #: ../../doc/src/intrinsics/numeric/erf.md:14 #: ../../doc/src/intrinsics/numeric/erfc.md:14 #: ../../doc/src/intrinsics/numeric/exp.md:14 #: ../../doc/src/intrinsics/numeric/floor.md:14 #: ../../doc/src/intrinsics/numeric/gamma.md:14 #: ../../doc/src/intrinsics/numeric/mod.md:15 msgid "Arguments" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:16 msgid "`x` is an integer input parameter." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:18 #: ../../doc/src/intrinsics/array/cshift.md:22 #: ../../doc/src/intrinsics/array/size.md:22 #: ../../doc/src/intrinsics/bit/bge.md:18 #: ../../doc/src/intrinsics/bit/bgt.md:18 #: ../../doc/src/intrinsics/bit/bit_size.md:18 #: ../../doc/src/intrinsics/bit/ble.md:18 #: ../../doc/src/intrinsics/bit/blt.md:18 #: ../../doc/src/intrinsics/bit/btest.md:19 #: ../../doc/src/intrinsics/bit/shiftl.md:21 #: ../../doc/src/intrinsics/bit/shiftr.md:21 #: ../../doc/src/intrinsics/character/lge.md:23 #: ../../doc/src/intrinsics/kind-type/kind.md:19 #: ../../doc/src/intrinsics/mathematical/acos.md:18 #: ../../doc/src/intrinsics/mathematical/acosh.md:19 #: ../../doc/src/intrinsics/mathematical/asin.md:18 #: ../../doc/src/intrinsics/mathematical/asinh.md:19 #: ../../doc/src/intrinsics/mathematical/atan.md:18 #: ../../doc/src/intrinsics/mathematical/atan2.md:21 #: ../../doc/src/intrinsics/mathematical/atanh.md:19 #: ../../doc/src/intrinsics/mathematical/fraction.md:17 #: ../../doc/src/intrinsics/misc/command_argument_count.md:18 #: ../../doc/src/intrinsics/misc/cpu_time.md:18 #: ../../doc/src/intrinsics/misc/date_and_time.md:39 #: ../../doc/src/intrinsics/misc/new_line.md:19 #: ../../doc/src/intrinsics/numeric/abs.md:19 #: ../../doc/src/intrinsics/numeric/aimag.md:19 #: ../../doc/src/intrinsics/numeric/aint.md:20 #: ../../doc/src/intrinsics/numeric/anint.md:20 #: ../../doc/src/intrinsics/numeric/ceiling.md:18 #: ../../doc/src/intrinsics/numeric/cmplx.md:24 #: ../../doc/src/intrinsics/numeric/conjg.md:19 #: ../../doc/src/intrinsics/numeric/digits.md:17 #: ../../doc/src/intrinsics/numeric/dim.md:18 #: ../../doc/src/intrinsics/numeric/epsilon.md:18 #: ../../doc/src/intrinsics/numeric/erf.md:18 #: ../../doc/src/intrinsics/numeric/erfc.md:18 #: ../../doc/src/intrinsics/numeric/exp.md:18 #: ../../doc/src/intrinsics/numeric/floor.md:20 #: ../../doc/src/intrinsics/numeric/gamma.md:19 #: ../../doc/src/intrinsics/numeric/mod.md:22 msgid "Return values" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:20 msgid "" "The return value is a logical scalar with the default logical kind type " "parameter." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:23 #: ../../doc/src/intrinsics/array/cshift.md:26 #: ../../doc/src/intrinsics/array/size.md:26 #: ../../doc/src/intrinsics/bit/bge.md:22 #: ../../doc/src/intrinsics/bit/bgt.md:22 #: ../../doc/src/intrinsics/bit/bit_size.md:22 #: ../../doc/src/intrinsics/bit/ble.md:22 #: ../../doc/src/intrinsics/bit/blt.md:22 #: ../../doc/src/intrinsics/bit/btest.md:23 #: ../../doc/src/intrinsics/bit/shiftl.md:25 #: ../../doc/src/intrinsics/bit/shiftr.md:25 #: ../../doc/src/intrinsics/character/achar.md:27 #: ../../doc/src/intrinsics/character/adjustl.md:23 #: ../../doc/src/intrinsics/character/adjustr.md:24 #: ../../doc/src/intrinsics/character/char.md:28 #: ../../doc/src/intrinsics/character/len_trim.md:22 #: ../../doc/src/intrinsics/character/lge.md:31 #: ../../doc/src/intrinsics/kind-type/kind.md:23 #: ../../doc/src/intrinsics/mathematical/acos.md:23 #: ../../doc/src/intrinsics/mathematical/acosh.md:24 #: ../../doc/src/intrinsics/mathematical/asin.md:23 #: ../../doc/src/intrinsics/mathematical/asinh.md:24 #: ../../doc/src/intrinsics/mathematical/atan.md:23 #: ../../doc/src/intrinsics/mathematical/atan2.md:27 #: ../../doc/src/intrinsics/mathematical/atanh.md:24 #: ../../doc/src/intrinsics/mathematical/fraction.md:22 #: ../../doc/src/intrinsics/misc/command_argument_count.md:22 #: ../../doc/src/intrinsics/misc/cpu_time.md:22 #: ../../doc/src/intrinsics/misc/date_and_time.md:43 #: ../../doc/src/intrinsics/misc/new_line.md:24 #: ../../doc/src/intrinsics/numeric/abs.md:24 #: ../../doc/src/intrinsics/numeric/aimag.md:23 #: ../../doc/src/intrinsics/numeric/aint.md:28 #: ../../doc/src/intrinsics/numeric/anint.md:27 #: ../../doc/src/intrinsics/numeric/ceiling.md:22 #: ../../doc/src/intrinsics/numeric/cmplx.md:30 #: ../../doc/src/intrinsics/numeric/conjg.md:23 #: ../../doc/src/intrinsics/numeric/digits.md:21 #: ../../doc/src/intrinsics/numeric/dim.md:22 #: ../../doc/src/intrinsics/numeric/epsilon.md:22 #: ../../doc/src/intrinsics/numeric/erf.md:23 #: ../../doc/src/intrinsics/numeric/erfc.md:23 #: ../../doc/src/intrinsics/numeric/exp.md:22 #: ../../doc/src/intrinsics/numeric/floor.md:28 #: ../../doc/src/intrinsics/numeric/gamma.md:23 #: ../../doc/src/intrinsics/numeric/mod.md:31 ../../doc/src/progress.md msgid "Description" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:25 msgid "" "`allocated(x)` checks the allocation status of a integer input parameter." " It returns a logical value as `TRUE` if the input argument `x` is " "allocated, `FALSE` otherwise." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:29 #: ../../doc/src/intrinsics/array/cshift.md:39 #: ../../doc/src/intrinsics/array/size.md:33 #: ../../doc/src/intrinsics/bit/bge.md:27 #: ../../doc/src/intrinsics/bit/bgt.md:27 #: ../../doc/src/intrinsics/bit/bit_size.md:27 #: ../../doc/src/intrinsics/bit/ble.md:27 #: ../../doc/src/intrinsics/bit/blt.md:27 #: ../../doc/src/intrinsics/bit/btest.md:32 #: ../../doc/src/intrinsics/bit/shiftl.md:32 #: ../../doc/src/intrinsics/bit/shiftr.md:32 #: ../../doc/src/intrinsics/character/achar.md:37 #: ../../doc/src/intrinsics/character/adjustl.md:28 #: ../../doc/src/intrinsics/character/adjustr.md:29 #: ../../doc/src/intrinsics/character/char.md:38 #: ../../doc/src/intrinsics/character/len_trim.md:27 #: ../../doc/src/intrinsics/character/lge.md:37 #: ../../doc/src/intrinsics/kind-type/kind.md:27 #: ../../doc/src/intrinsics/mathematical/acos.md:31 #: ../../doc/src/intrinsics/mathematical/acosh.md:43 #: ../../doc/src/intrinsics/mathematical/asin.md:31 #: ../../doc/src/intrinsics/mathematical/asinh.md:35 #: ../../doc/src/intrinsics/mathematical/atan.md:31 #: ../../doc/src/intrinsics/mathematical/atan2.md:53 #: ../../doc/src/intrinsics/mathematical/atanh.md:39 #: ../../doc/src/intrinsics/mathematical/fraction.md:30 #: ../../doc/src/intrinsics/misc/command_argument_count.md:27 #: ../../doc/src/intrinsics/misc/cpu_time.md:33 #: ../../doc/src/intrinsics/misc/date_and_time.md:53 #: ../../doc/src/intrinsics/misc/new_line.md:29 #: ../../doc/src/intrinsics/numeric/abs.md:35 #: ../../doc/src/intrinsics/numeric/aimag.md:33 #: ../../doc/src/intrinsics/numeric/aint.md:35 #: ../../doc/src/intrinsics/numeric/anint.md:38 #: ../../doc/src/intrinsics/numeric/ceiling.md:26 #: ../../doc/src/intrinsics/numeric/cmplx.md:47 #: ../../doc/src/intrinsics/numeric/conjg.md:33 #: ../../doc/src/intrinsics/numeric/digits.md:26 #: ../../doc/src/intrinsics/numeric/dim.md:27 #: ../../doc/src/intrinsics/numeric/epsilon.md:29 #: ../../doc/src/intrinsics/numeric/erf.md:33 #: ../../doc/src/intrinsics/numeric/erfc.md:36 #: ../../doc/src/intrinsics/numeric/exp.md:29 #: ../../doc/src/intrinsics/numeric/floor.md:33 #: ../../doc/src/intrinsics/numeric/gamma.md:38 #: ../../doc/src/intrinsics/numeric/mod.md:43 msgid "Types" 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 "" #: ../../doc/src/intrinsics/array/allocated.md:46 #: ../../doc/src/intrinsics/array/cshift.md:43 #: ../../doc/src/intrinsics/array/size.md:37 #: ../../doc/src/intrinsics/bit/bge.md:49 #: ../../doc/src/intrinsics/bit/bgt.md:49 #: ../../doc/src/intrinsics/bit/bit_size.md:44 #: ../../doc/src/intrinsics/bit/ble.md:49 #: ../../doc/src/intrinsics/bit/blt.md:49 #: ../../doc/src/intrinsics/bit/btest.md:56 #: ../../doc/src/intrinsics/bit/shiftl.md:62 #: ../../doc/src/intrinsics/bit/shiftr.md:62 #: ../../doc/src/intrinsics/character/achar.md:53 #: ../../doc/src/intrinsics/character/adjustl.md:45 #: ../../doc/src/intrinsics/character/adjustr.md:46 #: ../../doc/src/intrinsics/character/char.md:53 #: ../../doc/src/intrinsics/character/len_trim.md:44 #: ../../doc/src/intrinsics/character/lge.md:59 #: ../../doc/src/intrinsics/kind-type/kind.md:59 #: ../../doc/src/intrinsics/mathematical/acos.md:60 #: ../../doc/src/intrinsics/mathematical/acosh.md:72 #: ../../doc/src/intrinsics/mathematical/asin.md:60 #: ../../doc/src/intrinsics/mathematical/asinh.md:64 #: ../../doc/src/intrinsics/mathematical/atan.md:60 #: ../../doc/src/intrinsics/mathematical/atan2.md:75 #: ../../doc/src/intrinsics/mathematical/atanh.md:68 #: ../../doc/src/intrinsics/mathematical/fraction.md:34 #: ../../doc/src/intrinsics/misc/command_argument_count.md:31 #: ../../doc/src/intrinsics/misc/cpu_time.md:44 #: ../../doc/src/intrinsics/misc/date_and_time.md:64 #: ../../doc/src/intrinsics/misc/new_line.md:40 #: ../../doc/src/intrinsics/numeric/abs.md:79 #: ../../doc/src/intrinsics/numeric/aimag.md:53 #: ../../doc/src/intrinsics/numeric/aint.md:39 #: ../../doc/src/intrinsics/numeric/anint.md:42 #: ../../doc/src/intrinsics/numeric/ceiling.md:46 #: ../../doc/src/intrinsics/numeric/cmplx.md:59 #: ../../doc/src/intrinsics/numeric/conjg.md:53 #: ../../doc/src/intrinsics/numeric/digits.md:30 #: ../../doc/src/intrinsics/numeric/dim.md:31 #: ../../doc/src/intrinsics/numeric/epsilon.md:49 #: ../../doc/src/intrinsics/numeric/erf.md:53 #: ../../doc/src/intrinsics/numeric/erfc.md:56 #: ../../doc/src/intrinsics/numeric/exp.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:65 #: ../../doc/src/intrinsics/numeric/gamma.md:58 #: ../../doc/src/intrinsics/numeric/mod.md:80 msgid "Examples" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:59 #: ../../doc/src/intrinsics/array/cshift.md:55 #: ../../doc/src/intrinsics/array/size.md:48 #: ../../doc/src/intrinsics/mathematical/acos.md:76 #: ../../doc/src/intrinsics/mathematical/acosh.md:81 #: ../../doc/src/intrinsics/mathematical/asin.md:76 #: ../../doc/src/intrinsics/mathematical/asinh.md:73 #: ../../doc/src/intrinsics/mathematical/atan.md:76 #: ../../doc/src/intrinsics/mathematical/atan2.md:84 #: ../../doc/src/intrinsics/mathematical/atanh.md:77 #: ../../doc/src/intrinsics/mathematical/fraction.md:44 msgid "**Result**:" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:65 #: ../../doc/src/intrinsics/array/cshift.md:62 #: ../../doc/src/intrinsics/array/size.md:55 #: ../../doc/src/intrinsics/bit/bge.md:68 #: ../../doc/src/intrinsics/bit/bgt.md:66 #: ../../doc/src/intrinsics/bit/bit_size.md:61 #: ../../doc/src/intrinsics/bit/ble.md:68 #: ../../doc/src/intrinsics/bit/blt.md:66 #: ../../doc/src/intrinsics/bit/btest.md:71 #: ../../doc/src/intrinsics/bit/shiftl.md:80 #: ../../doc/src/intrinsics/bit/shiftr.md:80 #: ../../doc/src/intrinsics/character/achar.md:69 #: ../../doc/src/intrinsics/character/adjustl.md:62 #: ../../doc/src/intrinsics/character/adjustr.md:63 #: ../../doc/src/intrinsics/character/char.md:69 #: ../../doc/src/intrinsics/character/len_trim.md:63 #: ../../doc/src/intrinsics/character/lge.md:79 #: ../../doc/src/intrinsics/kind-type/kind.md:79 #: ../../doc/src/intrinsics/mathematical/acos.md:82 #: ../../doc/src/intrinsics/mathematical/acosh.md:86 #: ../../doc/src/intrinsics/mathematical/asin.md:82 #: ../../doc/src/intrinsics/mathematical/asinh.md:78 #: ../../doc/src/intrinsics/mathematical/atan.md:82 #: ../../doc/src/intrinsics/mathematical/atan2.md:90 #: ../../doc/src/intrinsics/mathematical/atanh.md:82 #: ../../doc/src/intrinsics/mathematical/fraction.md:50 #: ../../doc/src/intrinsics/misc/command_argument_count.md:47 #: ../../doc/src/intrinsics/misc/cpu_time.md:64 #: ../../doc/src/intrinsics/misc/date_and_time.md:90 #: ../../doc/src/intrinsics/misc/new_line.md:56 #: ../../doc/src/intrinsics/numeric/abs.md:96 #: ../../doc/src/intrinsics/numeric/aimag.md:68 #: ../../doc/src/intrinsics/numeric/aint.md:55 #: ../../doc/src/intrinsics/numeric/anint.md:58 #: ../../doc/src/intrinsics/numeric/ceiling.md:64 #: ../../doc/src/intrinsics/numeric/cmplx.md:74 #: ../../doc/src/intrinsics/numeric/conjg.md:68 #: ../../doc/src/intrinsics/numeric/digits.md:44 #: ../../doc/src/intrinsics/numeric/dim.md:47 #: ../../doc/src/intrinsics/numeric/epsilon.md:63 #: ../../doc/src/intrinsics/numeric/erf.md:67 #: ../../doc/src/intrinsics/numeric/erfc.md:70 #: ../../doc/src/intrinsics/numeric/exp.md:71 #: ../../doc/src/intrinsics/numeric/floor.md:83 #: ../../doc/src/intrinsics/numeric/gamma.md:74 #: ../../doc/src/intrinsics/numeric/mod.md:95 msgid "See Also" msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:1 msgid "cshift(A, shift [, dim]): Circular Shift" msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:3 msgid "Circular shift elements of an array." 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 "" #: ../../doc/src/intrinsics/array/cshift.md:18 msgid "`shift` the input value of integer type." msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:20 msgid "" "`dim` optional dimension, if present, `cshift` returns the result of this" " dimension." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/array/cshift.md:28 msgid "" "**cshift(A, shift [, dim])** performs a circular shift on elements of `A`" " array along the dimension of `dim`. Default value of `dim` is 1, used " "when `dim` is not passed." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/array/cshift.md:41 msgid "" "Supported argument type is array for `A` and integer for `shift` and " "`dim`." msgstr "" #: ../../doc/src/intrinsics/array/size.md:1 msgid "size(x): Size of Array" msgstr "" #: ../../doc/src/intrinsics/array/size.md:3 msgid "Returns the size of an array `x`." msgstr "" #: ../../doc/src/intrinsics/array/size.md:18 msgid "" "`dim` optional dimension, if present, `size` returns the size of this " "dimension." msgstr "" #: ../../doc/src/intrinsics/array/size.md:20 msgid "`kind` optional the kind of the return value." msgstr "" #: ../../doc/src/intrinsics/array/size.md:24 msgid "`n` the size of an array (integer)." msgstr "" #: ../../doc/src/intrinsics/array/size.md:28 msgid "" "The `size` intrinsic function returns the size of an array. It returns " "the product of all dimensions, unless the `dim` argument is specified, in" " which case it only returns the size of this particular dimension. The " "`kind` argument can be used to specify the integer kind of the result." msgstr "" #: ../../doc/src/intrinsics/array/size.md:57 msgid "[shape](), [reshape]()." msgstr "" #: ../../doc/src/intrinsics/bit.md:1 msgid "Bit Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:1 msgid "bge(x, y): Bitwise Greater or Equal" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:3 msgid "Bitwise greater than or equal to." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/bge.md:29 #: ../../doc/src/intrinsics/bit/bgt.md:29 #: ../../doc/src/intrinsics/bit/ble.md:29 #: ../../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 "" #: ../../doc/src/intrinsics/bit/bge.md:60 #: ../../doc/src/intrinsics/bit/bgt.md:59 #: ../../doc/src/intrinsics/bit/bit_size.md:54 #: ../../doc/src/intrinsics/bit/ble.md:60 #: ../../doc/src/intrinsics/bit/blt.md:59 #: ../../doc/src/intrinsics/bit/btest.md:65 #: ../../doc/src/intrinsics/bit/shiftl.md:74 #: ../../doc/src/intrinsics/bit/shiftr.md:74 #: ../../doc/src/intrinsics/character/achar.md:63 #: ../../doc/src/intrinsics/character/adjustl.md:56 #: ../../doc/src/intrinsics/character/adjustr.md:57 #: ../../doc/src/intrinsics/character/char.md:63 #: ../../doc/src/intrinsics/character/len_trim.md:57 #: ../../doc/src/intrinsics/character/lge.md:72 #: ../../doc/src/intrinsics/kind-type/kind.md:72 #: ../../doc/src/intrinsics/misc/command_argument_count.md:40 #: ../../doc/src/intrinsics/misc/cpu_time.md:57 #: ../../doc/src/intrinsics/misc/date_and_time.md:83 #: ../../doc/src/intrinsics/misc/new_line.md:49 #: ../../doc/src/intrinsics/numeric/abs.md:89 #: ../../doc/src/intrinsics/numeric/aimag.md:62 #: ../../doc/src/intrinsics/numeric/aint.md:48 #: ../../doc/src/intrinsics/numeric/anint.md:51 #: ../../doc/src/intrinsics/numeric/ceiling.md:57 #: ../../doc/src/intrinsics/numeric/cmplx.md:68 #: ../../doc/src/intrinsics/numeric/conjg.md:62 #: ../../doc/src/intrinsics/numeric/digits.md:38 #: ../../doc/src/intrinsics/numeric/dim.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:57 #: ../../doc/src/intrinsics/numeric/erf.md:61 #: ../../doc/src/intrinsics/numeric/erfc.md:64 #: ../../doc/src/intrinsics/numeric/exp.md:65 #: ../../doc/src/intrinsics/numeric/floor.md:76 #: ../../doc/src/intrinsics/numeric/gamma.md:67 #: ../../doc/src/intrinsics/numeric/mod.md:89 msgid "**Result:**" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:70 msgid "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/bgt.md:1 msgid "bgt(x, y): Bitwise Greater Than" msgstr "" #: ../../doc/src/intrinsics/bit/bgt.md:3 msgid "Bitwise greater than." 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 "" #: ../../doc/src/intrinsics/bit/bgt.md:68 msgid "[bge](bge.md), [ble](ble.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:1 msgid "bit_size(x): Bit Size" msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:3 msgid "Bit size." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:16 msgid "`x` is integer input value." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:20 #: ../../doc/src/intrinsics/numeric/digits.md:19 msgid "The return value is of type integer." 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 "" #: ../../doc/src/intrinsics/bit/bit_size.md:29 msgid "Supported input types is integer." msgstr "" #: ../../doc/src/intrinsics/bit/ble.md:1 msgid "bge(x, y): Bitwise Less or Equal" msgstr "" #: ../../doc/src/intrinsics/bit/ble.md:3 msgid "Bitwise less than or equal to." 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 "" #: ../../doc/src/intrinsics/bit/ble.md:70 msgid "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:1 msgid "blt(x, y): Bitwise Less Than" msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:3 msgid "Bitwise less than." 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 "" #: ../../doc/src/intrinsics/bit/blt.md:68 msgid "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:1 msgid "btest(x, pos): Bit Test at Position" msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:3 msgid "Bit test." 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 "" #: ../../doc/src/intrinsics/bit/btest.md:21 msgid "The return value is of type logical." msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:25 msgid "" "`btest(x, pos)` calculates if `pos` bit in input integer value `x` is " "set. The counting of the bits starts at 0, at least significant bit (LSB)" " i.e., the rightmost bit in `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:1 msgid "shiftl(x, shift): Shift Left" msgstr "" #: ../../doc/src/intrinsics/bit/shiftl.md:3 msgid "Logical shift left function." msgstr "" #: ../../doc/src/intrinsics/bit/shiftl.md:16 #: ../../doc/src/intrinsics/bit/shiftr.md:16 msgid "`x` is an integer input value." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:27 msgid "" "**shiftl(x, shift)** logically left shifts `x` by `shift` number of bits." " `shiftl` shifts from LSB(**L**east **S**ignificant **B**it) to " "MSB(**M**ost **S**ignificant **B**it). Bits shifted from the left end " "i.e., MSB bits are lost. Zeroes are appended to the opposite right end." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:82 msgid "[shiftr](shiftr.md)." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:1 msgid "shiftr(x, shift): Shift Right" msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:3 msgid "Logical shift right function." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:27 msgid "" "**shiftr(x, shift)** logically right shifts `x` by `shift` number of " "bits. `shiftr` shifts from MSB(**M**ost **S**ignificant **B**it) to " "LSB(**L**east **S**ignificant **B**it). Bits shifted from the right end " "i.e., LSB bits are lost. Zeroes are appended to the opposite left end." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:82 msgid "[shiftl](shiftl.md)." msgstr "" #: ../../doc/src/intrinsics/character.md:1 msgid "Character Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/character/achar.md:1 msgid "achar(x, kind): To Character in ASCII set." msgstr "" #: ../../doc/src/intrinsics/character/achar.md:3 msgid "Character represented by in the ASCII character set." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/character/achar.md:20 #: ../../doc/src/intrinsics/character/adjustl.md:18 #: ../../doc/src/intrinsics/character/adjustr.md:18 #: ../../doc/src/intrinsics/character/char.md:21 #: ../../doc/src/intrinsics/character/len_trim.md:18 msgid "Return value" 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/achar.md:29 msgid "" "**achar(x, kind)** returns the character represented by the ASCII " "character set at `x` position." msgstr "" #: ../../doc/src/intrinsics/character/achar.md:32 #: ../../doc/src/intrinsics/character/char.md:33 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 "" #: ../../doc/src/intrinsics/character/achar.md:35 #: ../../doc/src/intrinsics/character/char.md:36 msgid "It is a runtime builtin function." 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 "" #: ../../doc/src/intrinsics/character/adjustl.md:1 msgid "adjustl(string): Left Adjust String" msgstr "" #: ../../doc/src/intrinsics/character/adjustl.md:3 msgid "Left adjust a string." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/adjustl.md:30 #: ../../doc/src/intrinsics/character/adjustr.md:31 msgid "Supported argument type is character." msgstr "" #: ../../doc/src/intrinsics/character/adjustr.md:1 msgid "adjustr(string): Right Adjust String" msgstr "" #: ../../doc/src/intrinsics/character/adjustr.md:3 msgid "Right adjust a string." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/adjustr.md:65 msgid "[adjustl](adjustl.md)." msgstr "" #: ../../doc/src/intrinsics/character/char.md:1 msgid "char(x, [, kind]): Integer to Character" msgstr "" #: ../../doc/src/intrinsics/character/char.md:3 msgid "Integer to character conversion." msgstr "" #: ../../doc/src/intrinsics/character/char.md:16 msgid "`x`: the input value of integer type." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/character/char.md:30 msgid "" "**char(x)** returns the character represented by the ASCII character set " "at `x` position." msgstr "" #: ../../doc/src/intrinsics/character/char.md:71 msgid "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:1 msgid "len_trim(string): Length Ignoring Trailing Blanks" msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:3 msgid "Length of a character string ignoring trailing blank character(s)." msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:16 msgid "`string` the input value of character type." msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:20 msgid "The return value is of type unsigned integer." 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 "" #: ../../doc/src/intrinsics/character/len_trim.md:29 msgid "Supported argument type is character scalar." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:1 msgid "lge(x, y): Lexically Greater or Equal" msgstr "" #: ../../doc/src/intrinsics/character/lge.md:3 msgid "Lexically greater than or equal." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:17 msgid "`x` input value of type character." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:19 msgid "`y` input value of type character." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:21 msgid "`x` and `y` can be seen as string A and string B." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:25 msgid "The return value is of logical `true` or `false` type." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:27 msgid "`True` if `x` string is lexically greater than or equal to `y`." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:29 msgid "`False` if they are not." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:33 msgid "" "**lge(x, y)** determines if input string `x` is lexically greater than or" " equal to input string `y`. The two strings in comparison are interpreted" " as containing ASCII character codes." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:39 msgid "Argument types should be of type character literal." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:81 msgid "[len_trim](len_trim.md)." msgstr "" #: ../../doc/src/intrinsics/kind-type.md:1 msgid "Kind Type Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:1 msgid "kind(x): Kind of an Entity" msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:3 msgid "Kind of an entity." 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 "" #: ../../doc/src/intrinsics/kind-type/kind.md:21 msgid "The return value is of integer type and of default integer kind." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:25 msgid "**kind(x)** returns the kind parameter of the input argument `x`." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:29 msgid "" "Supported argument types are logical, integer, real, complex, or " "character." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:81 #: ../../doc/src/intrinsics/misc/command_argument_count.md:16 #: ../../doc/src/intrinsics/misc/cpu_time.md:20 #: ../../doc/src/intrinsics/misc/date_and_time.md:41 #: ../../doc/src/intrinsics/misc/new_line.md:58 msgid "None." msgstr "" #: ../../doc/src/intrinsics/mathematical.md:1 msgid "Mathematical Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:1 msgid "acos(x): Trigonometric Arc Cosine" msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:3 msgid "Trigonometric arc cosine (inverse cosine) function." 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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:20 #: ../../doc/src/intrinsics/mathematical/acosh.md:21 #: ../../doc/src/intrinsics/mathematical/asin.md:20 #: ../../doc/src/intrinsics/mathematical/asinh.md:21 #: ../../doc/src/intrinsics/mathematical/atan.md:20 #: ../../doc/src/intrinsics/mathematical/atanh.md:21 msgid "" "The returned value has the kind of the input value and TYPE may be real " "or complex." msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:25 msgid "**acos(x)** computes the arcsine of the argument **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:33 #: ../../doc/src/intrinsics/mathematical/acosh.md:45 #: ../../doc/src/intrinsics/mathematical/asin.md:33 #: ../../doc/src/intrinsics/mathematical/asinh.md:37 #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:84 msgid "[asin](asin.md), [atan](atan.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:1 msgid "acosh(x): Inverse Hyperbolic Cosine" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:3 msgid "Inverse hyperbolic cosine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:16 #: ../../doc/src/intrinsics/mathematical/asinh.md:16 #: ../../doc/src/intrinsics/mathematical/atanh.md:16 msgid "" "`x` the input value, can be real with value greater than or equal to 1 or" " of type complex." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:26 msgid "**acosh(x)** computes the inverse hyperbolic cosine function of **x**." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acosh.md:33 msgid "$-\\pi <= img (acosh(x)) <= \\pi$" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:35 msgid "" "For real values $x$ in the domain $x > 1$, the inverse hyperbolic cosine " "satisifies:" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:38 msgid "$cosh^{-1}(x) = \\log(x + \\sqrt{(x^2 - 1)})$" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acosh.md:88 msgid "[asinh](asinh.md), [atanh](atanh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:1 msgid "asin(x): Trigonometric Arcsine" msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:3 msgid "Trigonometric arcsine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:25 msgid "**asin(x)** computes the arcsine of the argument **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/asin.md:84 msgid "[acos](acos.md), [atan](atan.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:1 msgid "asinh(x): Inverse Hyperbolic Arcsine" msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:3 msgid "Inverse hyperbolic arcsine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:26 msgid "**asinh(x)** computes the inverse hyperbolic arcsine function of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/asinh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (asinh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:80 msgid "[acosh](acosh.md), [atanh](atanh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:1 msgid "atan(x): Trigonometric ArcTangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:3 msgid "Trigonometric arctangent (inverse arctangent) function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:25 msgid "**atan(x)** computes the arctangent of the argument **x**." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:27 msgid "" "The arc tangent is the inverse function of the arctangent function. It is" " commonly used in trigonometry to find the angle when the lengths of the " "opposite side of a right triangle and base are known, i.e., perpendicular" " and base length." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:84 msgid "[asin](asin.md), [acos](acos.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:1 msgid "atan2(y, x): ArcTangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:3 msgid "Arctangent function or inverse tangent function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:15 msgid "`y` the input value is the imaginary part of the complex expression" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atan2.md:19 msgid "`x` the input value, must be real part of the complex expression." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atan2.md:29 msgid "" "**atan2(y, x)** computes the principal value of the argument function of " "the complex expression $x + iy$. This is used to transform from cartesian" " into polar coordinates and allows to determine the angle in the correct " "quadrant." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:33 msgid "It is also represented as:" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:35 msgid "$tan^{-1}(\\frac{y}{x})$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:37 msgid "If `x` is nonzero, the result lies in the range:" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:39 msgid "$-\\pi <= atan(x) <= \\pi$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:41 msgid "The sign is positive if `y` is positive." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:43 msgid "If `y` is zero and `x` is strictly positive, then the result is 0." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:45 msgid "If `x` is negative and `y` is positive zero, then the result is $\\pi$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:47 msgid "If `x` is negative and `y` is negative zero, then the result is $-\\pi$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:49 msgid "If `x` is zero, then the magnitude of the result is $\\frac{\\pi}{2}$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:51 msgid "If `y` is negative real zero, the result is $\\frac{-\\pi}{2}$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:55 #: ../../doc/src/intrinsics/mathematical/fraction.md:32 msgid "Supported argument type is real." msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:1 msgid "atanh(x): Inverse Hyperbolic Tangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:3 msgid "Inverse hyperbolic tangent function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:26 msgid "**atanh(x)** computes the inverse hyperbolic tangent function of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atanh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (atanh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:35 msgid "If the result is real, it lies in the range" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:37 msgid "$-1.0 < atanh(x) < 1.0$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:84 msgid "[asinh](asinh.md), [acosh](acosh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:1 msgid "fraction(x): Fractional Part in Model Representation" msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:3 msgid "Fractional part of the model representation." msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:15 msgid "`x` the input value, must be real." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/fraction.md:24 msgid "" "**fraction(x)** computes the fractional part of the model representation " "of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/fraction.md:28 msgid "$x * {radix(x)}^{(-exponent(x))}$" msgstr "" #: ../../doc/src/intrinsics/misc.md:1 msgid "Miscellaneous Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:1 msgid "command_argument_count(): Number of Command Line Arguments" msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:3 msgid "Get number of command line arguments." msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:20 msgid "The return value is of integer type and of default kind." 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 "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:29 msgid "Any." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:1 msgid "cpu_time(x): CPU Elapsed Time" msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:3 msgid "CPU elapsed time in seconds." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:16 msgid "`x` the input value should be of type real with `intent(out)`." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:24 msgid "" "**cpu_time(time)** returns a real value representing the elapsed CPU time" " in seconds. If tine source is available, time will be reported with " "microsecond resolution. If no time source is available, TIME is set to " "-1.0." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:28 msgid "This is useful for testing segments of code to determine computation time." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:1 msgid "date_and_time([date, time, zone, values]): Date and Time" msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:3 msgid "Date and time subroutine." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:22 msgid "" "`zone` the input value of character type, which has length 5 or larger. " "It is of default kind. It is `intent(out)` and has from `(+-)hhmm`, " "representing the difference with respect to Coordinates Universal Time " "(UTC). Unavailable time and date parameters return blanks." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:30 msgid "`value(1)`: The year." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:31 msgid "`value(2)`: The month." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:32 msgid "`value(3)`: The day of the month." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:33 msgid "`value(4)`: Time difference with UTC in minutes." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:34 msgid "`value(5)`: The hour of the day." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:35 msgid "`value(6)`: The minutes of the hour." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:36 msgid "`value(7)`: The seconds of the minutes." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:37 msgid "`value(8)`: The milliseconds of the second." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:51 msgid "Unavailable or errorneous date and time parameters return blanks." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:92 msgid "[cpu_time](cpu_time.md)." msgstr "" #: ../../doc/src/intrinsics/misc/new_line.md:1 msgid "new_line(x): New Line Character" msgstr "" #: ../../doc/src/intrinsics/misc/new_line.md:3 msgid "New line character." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/new_line.md:31 msgid "Supported input parameter types is character." msgstr "" #: ../../doc/src/intrinsics/numeric.md:1 msgid "Numeric Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:1 msgid "abs(x): Absolute Value" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:3 msgid "Absolute value." msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:17 msgid "`x` the input value, can be integer, real, or complex." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/abs.md:26 msgid "" "**abs(x)** calculates and returns absolute value of `x`. Result is " "calculated using mathematical formula:" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:29 msgid "$|x|$" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:31 msgid "If `x` is complex, the result is calculated using mathematical formula:" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:33 msgid "$\\sqrt{(x^2 + y^2)}$" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aimag.md:1 msgid "aimag(x): Imaginary Part" msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:3 msgid "Imaginary part of complex number." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:17 msgid "`x` the input value must be of complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:21 msgid "The return value is imaginary part of type real and kind same as of `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:25 msgid "**aimag(x)** returns the imaginary part of the input complex argument `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:27 #: ../../doc/src/intrinsics/numeric/cmplx.md:41 #: ../../doc/src/intrinsics/numeric/conjg.md:27 msgid "" "For `x` complex input value, the result is calculated using mathematical " "formula:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aimag.md:35 msgid "Supported argument types are complex." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:1 msgid "aint(x, [kind]): Truncate to a Whole Number" msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:3 msgid "Truncate to a whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:16 #: ../../doc/src/intrinsics/numeric/anint.md:16 #: ../../doc/src/intrinsics/numeric/epsilon.md:16 #: ../../doc/src/intrinsics/numeric/erf.md:16 #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aint.md:37 #: ../../doc/src/intrinsics/numeric/anint.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:31 #: ../../doc/src/intrinsics/numeric/erf.md:35 #: ../../doc/src/intrinsics/numeric/erfc.md:38 #: ../../doc/src/intrinsics/numeric/floor.md:35 #: ../../doc/src/intrinsics/numeric/gamma.md:40 msgid "Supported argument types is real." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:85 msgid "[ceiling](ceiling.md), [mod](mod.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:1 msgid "anint(x, [kind]): Round to Nearest Whole Number" msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:3 msgid "Round to nearest whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:25 msgid "The return value is equal to rounded whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:29 msgid "**anint(x)** calculates rounded value of input parameter `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/anint.md:34 msgid "If `x` is greater than 0, `anint(x)` returns `aint(x + 0.5)`." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:60 msgid "[aint](aint.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:1 msgid "ceiling(x): Integer Ceiling" msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:3 msgid "Integer ceiling function" msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:16 msgid "The input value `x` may be of type real or integer." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:20 msgid "The return value is of type integer and nearest greater integer." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:24 msgid "**ceiling(x)** returns the least integer greater than or equal to `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:28 msgid "Supported input parameter types are integer and real." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:66 msgid "[floor](floor.md), [mod](mod.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:1 msgid "cmplx(x [, [, kind]]): Convert to Complex" msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:3 msgid "Conversion to complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:14 msgid "`cmplx(x, y)` is one of the intrinsic present in ASR." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:18 msgid "" "`x` the input value must be of integer, real, or complex. `y` the " "optional input value must be of type integer or real. It should be only " "present in case `x` is not complex. `kind` the optional input value of " "integer expression type for initialisation indicating the kind parameter " "of the result." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/cmplx.md:32 msgid "" "**cmplx(x, [, y [, kind]])** converts the input value to complex " "representation:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/cmplx.md:37 msgid "If `y` is not present, the imaginary component is set to 0.0." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:39 msgid "If `x` is complex then `y` must not be present." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:49 msgid "Supported argument types are integer, real, or complex." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:1 msgid "conjg(x): Complex Conjugate" msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:3 msgid "Complex conjugate function." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:17 msgid "`x` the input value must be of type complex." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:21 msgid "The return value is of complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:25 msgid "**conjg(x)** converts the input value `x` to its conjugate." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:29 msgid "$x + iy$ converted to $x - iy$" msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:35 msgid "Supported argument types is complex." msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:1 msgid "digits(x): Significant Binary Digits" msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:3 msgid "Significant binary digits." msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:15 msgid "`x` the input value must be of type real or integer." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/dim.md:1 msgid "dim(x, y): Positive Difference or 0" msgstr "" #: ../../doc/src/intrinsics/numeric/dim.md:3 msgid "Positive difference or 0." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/dim.md:20 msgid "The return value is of type integer or real." 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 "" #: ../../doc/src/intrinsics/numeric/epsilon.md:1 msgid "epsilon(x): Epsilon" msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:3 msgid "Epsilon function." msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:20 msgid "The return value is of same type as of the input argument." msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:24 msgid "" "**epsilon(x)** computes the smallest number $\\epsilon$ of the same kind " "as `x` following:" msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:27 msgid "$1 + \\epsilon > 1$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:1 msgid "erf(x): Error" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:3 msgid "Error function." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/erf.md:27 msgid "$-1 \\leq erf (x) \\leq 1$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_0^xe^{-t^2}dt$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:69 msgid "[erfc](erfc.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:1 msgid "erfc(x): Complementary Error" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:3 msgid "Complementary error function." 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 "" #: ../../doc/src/intrinsics/numeric/erfc.md:27 msgid "$0 \\leq erf (x) \\leq 2$" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_{x}^{\\infty}e^{-t^2}dt$" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/erfc.md:72 msgid "[erf](erf.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:1 msgid "exp(x): Exponential" msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:3 msgid "Exponential function." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:16 msgid "`x` the input value must be of type real or complex." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:20 msgid "The return value is of same type as of the input argument, `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:24 msgid "**exp(x)** computes the base $e$ exponential of `x`, i.e., $e^x$." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/exp.md:31 msgid "Supported argument types is real and complex." msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:1 msgid "floor(x, kind): Integer Floor" msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:3 msgid "Integer floor function." msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:18 msgid "" "`kind` the optional input parameter must be a scalar integer constant " "expression." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:1 msgid "gamma(x): Gamma" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:3 msgid "Gamma function." 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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:21 msgid "The return value is of same type and kind as of `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:28 msgid "$\\gamma(x) = (x-1)!$" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:30 msgid "In general, if $x > 0$:" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:32 msgid "$\\gamma(x) = \\int_{0}^{\\infty} e^{-t} dt$" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:34 msgid "and if $-n-1 < x < -n$ where n is an integer >= 0:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:76 msgid "[epsilon](epsilon.md)" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:1 msgid "mod(x, y): Modulus" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:3 msgid "Modulus or remainder function." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:17 msgid "`x` the input value, can be integer or real." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/mod.md:27 msgid "`x - INT (x / y) * y`." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:29 msgid "If `y` is 0, the result is undefined like `any integer value / 0`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/mod.md:36 msgid "`x - INT(x / y) * y`" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:38 msgid "" "i.e., result is remainder when first argument is mathematically divided " "by second argument." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:41 msgid "The return value should be less than `y`." msgstr "" #: ../../doc/src/language.md:1 msgid "Fortran Language" msgstr "" #: ../../doc/src/language.md:3 msgid "Background and Motivation" msgstr "" #: ../../doc/src/language.md:5 msgid "" "Fortran was designed from the ground up to naturally and simply translate" " mathematics to code that compiles and runs at maximum speed. And being " "specifically targeted for such fundamentally computational tasks, it " "contains a broad range of key functionality within the language itself, " "standard across all platforms, with no need for external libraries that " "may or may not be well optimized or maintained, at present or down the " "road." msgstr "" #: ../../doc/src/language.md:12 msgid "Some highlights:" 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 "" #: ../../doc/src/language.md:17 msgid "" "Operators which operate naturally upon the aforementioned " "arrays/matrices, as they do scalars;" msgstr "" #: ../../doc/src/language.md:19 msgid "Complex numbers;" msgstr "" #: ../../doc/src/language.md:20 msgid "Special functions;" msgstr "" #: ../../doc/src/language.md:21 msgid "Structures and pointers for more general data representation." msgstr "" #: ../../doc/src/language.md:23 msgid "" "Because the essentials are contained in the language itself, it is simple" " to read and write, without need of choosing from among or deciphering a " "proliferation of external classes to do the same thing. And because the " "essentials are self-contained, compilers can provide detailed compile-" "time (e.g., argument mismatch) and run-time (e.g., memory access) checks," " as well as highly optimized executables, directly from natural, readable" " code without need of extensive optimization heroics by the developer." msgstr "" #: ../../doc/src/language.md:31 msgid "See our blog posts for more information:" msgstr "" #: ../../doc/src/language.md:33 msgid "" "[Why We Created LFortran](https://lfortran.org/blog/2019/04/why-we-" "created-lfortran/)" msgstr "" #: ../../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 "" #: ../../doc/src/language.md:36 msgid "How to Learn Fortran" msgstr "" #: ../../doc/src/language.md:38 msgid "" "Fortran is relatively quick to learn because it is so much simpler and " "smaller than C/C++ (in practice, that is, with all needed libraries " "included). If you are interested in learning more, please see our webpage" " at [fortran90.org] with recommended practices for writing code, side by " "side comparison with Python/NumPy, links to other online Fortran " "resources and books, and an FAQ." msgstr "" #: ../../doc/src/progress.md:3 msgid "" "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:" msgstr "" #: ../../doc/src/progress.md:7 msgid "AST: The code can be parsed to AST (`lfortran --show-ast test.f90`)" msgstr "" #: ../../doc/src/progress.md:8 msgid "ASR: The code can be transformed to ASR (`lfortran --show-asr test.f90`)" msgstr "" #: ../../doc/src/progress.md:9 msgid "LLVM: LFortran can generate LLVM IR (`lfortran --show-llvm test.f90`)" msgstr "" #: ../../doc/src/progress.md:10 msgid "BIN: The LLVM IR can compile to a binary" msgstr "" #: ../../doc/src/progress.md:11 msgid "RUN: The binary runs without errors" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:16 msgid "" "This page is generated automatically using the [Compiler " "Tester](https://gitlab.com/lfortran/compiler_tester) repository which " "contains all the Fortran tests and scripts to run LFortran to produce the" " tables below. We are looking for contributors to contribute more tests. " "Our goal is to have a comprehensive Fortran testsuite that can be used to" " test any Fortran compiler." msgstr "" #: ../../doc/src/progress.md:23 msgid "Testing the LFortran compiler version:" msgstr "" #: ../../doc/src/progress.md:32 msgid "Topics" msgstr "" #: ../../doc/src/progress.md:34 msgid "Full programs that compute something interesting" msgstr "" #: ../../doc/src/progress.md:36 msgid "Basic Numerics" msgstr "" #: ../../doc/src/progress.md:38 msgid "Directory: `tests/programs/numerics`" msgstr "" #: ../../doc/src/progress.md msgid "LLVM" msgstr "" #: ../../doc/src/progress.md msgid "BIN" msgstr "" #: ../../doc/src/progress.md msgid "RUN" msgstr "" #: ../../doc/src/progress.md msgid "Filename" msgstr "" #: ../../doc/src/progress.md msgid "`Pure Fortran sin(x) implementation`" msgstr "" #: ../../doc/src/progress.md msgid "✅" 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 "" #: ../../doc/src/progress.md:45 msgid "Modules" msgstr "" #: ../../doc/src/progress.md:47 msgid "Basic Usage" msgstr "" #: ../../doc/src/progress.md:49 msgid "Directory: `tests/modules/basic`" msgstr "" #: ../../doc/src/progress.md msgid "`Basic modules`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/basic/t01.f90)" msgstr "" #: ../../doc/src/progress.md:56 msgid "Module Functions and Subroutines" msgstr "" #: ../../doc/src/progress.md:58 msgid "Directory: `tests/modules/procedures`" msgstr "" #: ../../doc/src/progress.md msgid "`Module functions`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`Module subroutines`" msgstr "" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t02.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`Nested subroutines`" msgstr "" #: ../../doc/src/progress.md msgid "[t03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t03.f90)" msgstr "" #: ../../doc/src/progress.md:67 msgid "Expressions" msgstr "" #: ../../doc/src/progress.md:69 msgid "Arithmetic Operations" msgstr "" #: ../../doc/src/progress.md:71 msgid "Directory: `tests/expressions/arit`" msgstr "" #: ../../doc/src/progress.md msgid "`+,-,*,/,**`" msgstr "" #: ../../doc/src/progress.md msgid "[basic_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/arit/basic_operations.f90)" msgstr "" #: ../../doc/src/progress.md:78 msgid "Integers" msgstr "" #: ../../doc/src/progress.md:80 msgid "Directory: `tests/expressions/integers`" msgstr "" #: ../../doc/src/progress.md msgid "`integers`" msgstr "" #: ../../doc/src/progress.md msgid "[integer_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/integer_kind.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`relational operations`" 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 "" #: ../../doc/src/progress.md msgid "`logical operations`" 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 "" #: ../../doc/src/progress.md:89 msgid "Real Numbers" msgstr "" #: ../../doc/src/progress.md:91 msgid "Directory: `tests/expressions/reals`" msgstr "" #: ../../doc/src/progress.md msgid "`single/double reals`" msgstr "" #: ../../doc/src/progress.md msgid "[real_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/real_kind.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`defined operator`" msgstr "" #: ../../doc/src/progress.md msgid "âŒ" 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 "" #: ../../doc/src/progress.md:99 msgid "Complex Numbers" msgstr "" #: ../../doc/src/progress.md:101 msgid "Directory: `tests/expressions/complex`" msgstr "" #: ../../doc/src/progress.md msgid "`single/double complex`" msgstr "" #: ../../doc/src/progress.md msgid "[complex_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/complex/complex_kind.f90)" msgstr "" #: ../../doc/src/progress.md:108 msgid "Strings" msgstr "" #: ../../doc/src/progress.md:110 msgid "Directory: `tests/expressions/character`" msgstr "" #: ../../doc/src/progress.md msgid "`character`" msgstr "" #: ../../doc/src/progress.md msgid "[t01_character.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t01_character.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`string concatenation`" 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 "" #: ../../doc/src/progress.md:118 msgid "Derived Types" msgstr "" #: ../../doc/src/progress.md:120 msgid "Directory: `tests/expressions/derived_type`" msgstr "" #: ../../doc/src/progress.md msgid "`basic derived types`" 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 "" #: ../../doc/src/progress.md:127 msgid "Statements" msgstr "" #: ../../doc/src/progress.md:129 msgid "Allocate Statement" msgstr "" #: ../../doc/src/progress.md:131 msgid "Directory: `tests/statements/allocate`" msgstr "" #: ../../doc/src/progress.md msgid "`allocate statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/allocate/t01.f90)" msgstr "" #: ../../doc/src/progress.md:138 msgid "Block Statement" msgstr "" #: ../../doc/src/progress.md:140 msgid "Directory: `tests/statements/block`" msgstr "" #: ../../doc/src/progress.md msgid "`block statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/block/t01.f90)" msgstr "" #: ../../doc/src/progress.md:147 msgid "Goto Statement" msgstr "" #: ../../doc/src/progress.md:149 msgid "Directory: `tests/statements/goto`" msgstr "" #: ../../doc/src/progress.md msgid "`computed go-to statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`go-to statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t02.f90)" msgstr "" #: ../../doc/src/progress.md:157 msgid "If Statement" msgstr "" #: ../../doc/src/progress.md:159 msgid "Directory: `tests/statements/if`" msgstr "" #: ../../doc/src/progress.md msgid "`Test .false.`" msgstr "" #: ../../doc/src/progress.md msgid "[if_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`single line if statement`" msgstr "" #: ../../doc/src/progress.md msgid "[if_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_02.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`multi line if statement`" msgstr "" #: ../../doc/src/progress.md msgid "[if_03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_03.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`nested if statements`" msgstr "" #: ../../doc/src/progress.md msgid "[if_04.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_04.f90)" msgstr "" #: ../../doc/src/progress.md:169 msgid "While Statement" msgstr "" #: ../../doc/src/progress.md:171 msgid "Directory: `tests/statements/while`" msgstr "" #: ../../doc/src/progress.md msgid "`Simple while loops`" msgstr "" #: ../../doc/src/progress.md msgid "[while_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`exit / cycle in while loops`" msgstr "" #: ../../doc/src/progress.md msgid "[while_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_02.f90)" msgstr "" #: ../../doc/src/progress.md:179 msgid "Print Statement" msgstr "" #: ../../doc/src/progress.md:181 msgid "Directory: `tests/statements/print`" msgstr "" #: ../../doc/src/progress.md msgid "`Basic print`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/print/t01.f90)" msgstr "" #: ../../doc/src/progress.md:188 msgid "Open, Read, Write, Close Statement" msgstr "" #: ../../doc/src/progress.md:190 msgid "Directory: `tests/statements/file_io`" msgstr "" #: ../../doc/src/progress.md msgid "`open/read/write/close`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/file_io/t01.f90)" msgstr "" #: ../../doc/src/progress.md:197 msgid "Intrinsic Functions" msgstr "" #: ../../doc/src/progress.md:199 msgid "abs" msgstr "" #: ../../doc/src/progress.md:201 msgid "Directory: `tests/intrinsic/abs`" msgstr "" #: ../../doc/src/progress.md msgid "`scalar single/double real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md msgid "`scalar single/double complex`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md msgid "`array 1D single/double real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:210 msgid "exp" msgstr "" #: ../../doc/src/progress.md:212 msgid "Directory: `tests/intrinsic/exp`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:221 msgid "log" msgstr "" #: ../../doc/src/progress.md:223 msgid "Directory: `tests/intrinsic/log`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:232 msgid "sqrt" msgstr "" #: ../../doc/src/progress.md:234 msgid "Directory: `tests/intrinsic/sqrt`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:243 msgid "sin" msgstr "" #: ../../doc/src/progress.md:245 msgid "Directory: `tests/intrinsic/sin`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:254 msgid "cos" msgstr "" #: ../../doc/src/progress.md:256 msgid "Directory: `tests/intrinsic/cos`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:265 msgid "tan" msgstr "" #: ../../doc/src/progress.md:267 msgid "Directory: `tests/intrinsic/tan`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:276 msgid "sinh" msgstr "" #: ../../doc/src/progress.md:278 msgid "Directory: `tests/intrinsic/sinh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:287 msgid "cosh" msgstr "" #: ../../doc/src/progress.md:289 msgid "Directory: `tests/intrinsic/cosh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:298 msgid "tanh" msgstr "" #: ../../doc/src/progress.md:300 msgid "Directory: `tests/intrinsic/tanh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:309 msgid "asin" msgstr "" #: ../../doc/src/progress.md:311 msgid "Directory: `tests/intrinsic/asin`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:320 msgid "acos" msgstr "" #: ../../doc/src/progress.md:322 msgid "Directory: `tests/intrinsic/acos`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:331 msgid "atan" msgstr "" #: ../../doc/src/progress.md:333 msgid "Directory: `tests/intrinsic/atan`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:342 msgid "modulo" msgstr "" #: ../../doc/src/progress.md:344 msgid "Directory: `tests/intrinsic/modulo`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:352 msgid "mod" msgstr "" #: ../../doc/src/progress.md:354 msgid "Directory: `tests/intrinsic/mod`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:362 msgid "min" msgstr "" #: ../../doc/src/progress.md:364 msgid "Directory: `tests/intrinsic/min`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:371 msgid "max" msgstr "" #: ../../doc/src/progress.md:373 msgid "Directory: `tests/intrinsic/max`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:380 msgid "int" msgstr "" #: ../../doc/src/progress.md:382 msgid "Directory: `tests/intrinsic/int`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:389 msgid "real" msgstr "" #: ../../doc/src/progress.md:391 msgid "Directory: `tests/intrinsic/real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:398 msgid "floor" msgstr "" #: ../../doc/src/progress.md:400 msgid "Directory: `tests/intrinsic/floor`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:407 msgid "nint" msgstr "" #: ../../doc/src/progress.md:409 msgid "Directory: `tests/intrinsic/nint`" 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 "" lfortran-0.63.0/doc/locale/fr/0000775000175000017500000000000015174404631016233 5ustar alastairalastairlfortran-0.63.0/doc/locale/fr/LC_MESSAGES/0000775000175000017500000000000015174404631020020 5ustar alastairalastairlfortran-0.63.0/doc/locale/fr/LC_MESSAGES/docs.po0000664000175000017500000042456215174404631021325 0ustar alastairalastair# SOME DESCRIPTIVE TITLE. # Copyright (C) 2022 LFortran contributors # This file is distributed under the same license as the LFortran package. # FIRST AUTHOR , 2022. # msgid "" msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" "PO-Revision-Date: 2023-05-25 20:20+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.18-dev\n" "Generated-By: Babel 2.10.3\n" #: ../../doc/src/ast_and_asr.ipynb:9 msgid "Difference between an AST and ASR" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:11 msgid "Let us take a simple Fortran code:" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:22 msgid "and look at how the AST and ASR looks like." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:25 ../../doc/src/progress.md msgid "AST" msgstr "AST" #: ../../doc/src/ast_and_asr.ipynb:76 msgid "" "The AST does not have any semantic information, but has nodes to " "represent declarations such as ``integer, intent(in) :: a``. Variables " "such as ``a`` are represented by a ``Name`` node, and are not connected " "to their declarations yet." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:88 ../../doc/src/progress.md msgid "ASR" msgstr "ASR" #: ../../doc/src/ast_and_asr.ipynb:139 msgid "" "The ASR has all the semantic information (types, etc.), nodes like " "``Function`` have a symbol table and do not have any declaration nodes. " "Variables are simply pointers to the symbol table." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:142 msgid "Discussion" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:144 msgid "" "The above was a simple example. Things get more apparent for more " "complicated examples, such as:" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:160 msgid "" "AST must represent all the ``use`` statements and the ``interface`` " "block, and keep things semantically consistent." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:162 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" " are defined in the ``gfort_interop`` module, and so ASR does not have " "any of these declaration nodes." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:164 msgid "" "When converting from ASR to AST, LFortran will create all the appropriate" " AST declaration nodes automatically and correctly." msgstr "" #: ../../doc/src/contributing.md:1 msgid "Contributing" msgstr "" #: ../../doc/src/contributing.md:3 msgid "" "We welcome contributions from anyone, even if you are new to open source." " It might sound daunting to contribute to a compiler at first, but please" " do, it is not complicated. We will help you with any technical issues " "and help improve your contribution so that it can be merged." msgstr "" #: ../../doc/src/contributing.md:8 msgid "Basic Setup" msgstr "" #: ../../doc/src/contributing.md:10 msgid "To contribute, make sure your set up:" msgstr "" #: ../../doc/src/contributing.md:12 msgid "Your username + email" msgstr "" #: ../../doc/src/contributing.md:13 msgid "Your `~/.gitconfig`" msgstr "" #: ../../doc/src/contributing.md:14 msgid "Your shell prompt to display the current branch name" msgstr "" #: ../../doc/src/contributing.md:16 msgid "Fork LFortran" msgstr "" #: ../../doc/src/contributing.md:18 msgid "" "Step 1. Create a fork of the [project " "repository](https://github.com/lfortran/lfortran)" msgstr "" #: ../../doc/src/contributing.md:20 msgid "" "Step 2. Set up your [SSH key](https://docs.github.com/en/authentication" "/connecting-to-github-with-ssh) with GitHub" msgstr "" #: ../../doc/src/contributing.md:22 msgid "" "Step 3. Clone the project repository from GitHub and set up your remote " "repository" msgstr "" #: ../../doc/src/contributing.md:29 msgid "" ":fontawesome-solid-edit: `REMOTE_NAME` is the name of your remote " "repository and could be any name you like, for example your first name." msgstr "" #: ../../doc/src/contributing.md:31 msgid "" ":fontawesome-solid-edit: `YOUR_GITHUB_ID` is your user ID on GitHub and " "should be part of your account path." msgstr "" #: ../../doc/src/contributing.md:33 msgid "" "You can use `git remote -v` to check if the new remote is set up " "correctly." msgstr "" #: ../../doc/src/contributing.md:35 msgid "Send a New Merge Request" msgstr "" #: ../../doc/src/contributing.md:37 msgid "Step 1. Create a new branch" msgstr "" #: ../../doc/src/contributing.md:42 msgid "Step 2. Make changes in relevant file(s)" msgstr "" #: ../../doc/src/contributing.md:44 msgid "Step 3. Commit the changes:" msgstr "" #: ../../doc/src/contributing.md:51 msgid "" "[Here](https://chris.beams.io/posts/git-commit/) are some great tips on " "writing good commit messages." msgstr "" #: ../../doc/src/contributing.md:53 msgid "Step 4. Check to ensure that your changes look good" msgstr "" #: ../../doc/src/contributing.md:58 msgid "Step 5. Send the merge request" msgstr "" #: ../../doc/src/contributing.md:64 msgid "" "The command will push the new branch `fix1` into your remote repository " "`REMOTE_NAME` that you created earlier. Additionally, it will also " "display a link that you can click on to open the new merge request. After" " clicking on the link, write a title and a concise description then click" " the \"Create\" button. Yay you are now all set." msgstr "" #: ../../doc/src/contributing.md:66 msgid "Add New Features" msgstr "" #: ../../doc/src/contributing.md:68 msgid "" "The example below shows the steps it would take to create a caret binary " "operator **^** which computes the average value of the two operands." msgstr "" #: ../../doc/src/contributing.md:70 msgid "Create New Token(s)" msgstr "" #: ../../doc/src/contributing.md:72 msgid "" "We extend the *tokenizer.re* as well as *parser.yy* to add the new token " "**^**. We also tell LFortran how to print the new token in *parser.cpp*." msgstr "" #: ../../doc/src/contributing.md:75 msgid ":fontawesome-solid-code: *src/lfortran/parser/tokenizer.re*" msgstr "" #: ../../doc/src/contributing.md:80 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.yy*" msgstr "" #: ../../doc/src/contributing.md:85 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.cpp*" msgstr "" #: ../../doc/src/contributing.md:94 msgid "The added code is tested with `lfortran --show-tokens examples2/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:96 msgid "Parse the New Token" msgstr "" #: ../../doc/src/contributing.md:98 msgid "" "Now we have to parse the new operator. We add it to the AST by extending " "the BinOp with a caret operator and modifying the *AST.asdl* file. Then " "we add it in *parse.yy* to properly parse and generate the new AST in " "*semantics.h*.Finally we extend *pickle.cpp* so that the new operator can" " print itself." msgstr "" #: ../../doc/src/contributing.md:102 msgid ":fontawesome-solid-code:*grammar/AST.asdl*" msgstr "" #: ../../doc/src/contributing.md:107 msgid ":fontawesome-solid-code:*src/lfortran/parser/parser.yy*" msgstr "" #: ../../doc/src/contributing.md:116 msgid ":fontawesome-solid-code:*src/lfortran/parser/semantics.h*" msgstr "" #: ../../doc/src/contributing.md:121 msgid ":fontawesome-solid-code:*src/lfortran/pickle.cpp*" msgstr "" #: ../../doc/src/contributing.md:132 msgid "The section is tested with `lfortran --show-ast examples/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:134 msgid "Implement the Semantics of the New Token" msgstr "" #: ../../doc/src/contributing.md:136 msgid "" "We first extend the ASR in *ASR.asdl* and add ^ as a BinOp operator " "option." msgstr "" #: ../../doc/src/contributing.md:138 msgid ":fontawesome-solid-code:*src/libasr/ASR.asdl*" msgstr "" #: ../../doc/src/contributing.md:142 msgid ":fontawesome-solid-code:*src/lfortran/semantics/ast_common_visitor.h*" msgstr "" #: ../../doc/src/contributing.md:179 msgid "" "Then we transform it from AST to ASR by extending " "*src/lfortran/semantics/ast_common_visitor.h*." msgstr "" #: ../../doc/src/contributing.md:181 msgid "" "We also add it into compile time evaluation triggered by expressions such" " as `e = (2+3)^5` which is evaluated at compile time. An expression such " "as `e = x^5` is evaluated at run time only." msgstr "" #: ../../doc/src/contributing.md:183 msgid "The section is tested with `lfortran --show-asr examples/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:184 msgid "Implement the New Token in LLVM" msgstr "" #: ../../doc/src/contributing.md:186 msgid "" "To implement in LLVM, we extend the BinOp translation by handling the new" " operator. We first add the two numbers then divide by two. :fontawesome-" "solid-code:*src/lfortran/codegen/asr_to_llvm.cpp*" msgstr "" #: ../../doc/src/contributing.md:217 msgid "The section is tested with `lfortran --show-llvm examples/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:219 msgid "Now when LLVM works, we can test the final executable by:" msgstr "" #: ../../doc/src/contributing.md:224 msgid "And it should print 6." msgstr "" #: ../../doc/src/contributing.md:226 msgid "It also works interactively:" msgstr "" #: ../../doc/src/contributing.md:242 msgid "Reach Out" msgstr "" #: ../../doc/src/contributing.md:244 msgid "" "If you have any questions or need help, please ask as at our " "[mailinglist](https://groups.io/g/lfortran) or a " "[chat](https://lfortran.zulipchat.com/)." msgstr "" #: ../../doc/src/contributing.md:248 msgid "" "Please note that all participants of this project are expected to follow " "our Code of Conduct. By participating in this project you agree to abide " "by its terms. See " "[CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/blob/main/CODE_OF_CONDUCT.md)." msgstr "" #: ../../doc/src/contributing.md:252 msgid "" "By submitting a PR you agree to license your contribution under the " "LFortran's BSD " "[license](https://github.com/lfortran/lfortran/blob/main/LICENSE) unless " "explicitly noted otherwise." msgstr "" #: ../../doc/src/design.md:1 msgid "LFortran Design" msgstr "" #: ../../doc/src/design.md:3 msgid "High Level Overview" msgstr "" #: ../../doc/src/design.md:5 ../../doc/src/developer_tutorial.ipynb:16 msgid "" "LFortran is structured around two independent modules, AST and ASR, both " "of which are standalone (completely independent of the rest of LFortran) " "and users are encouraged to use them independently for other applications" " and build tools on top:" msgstr "" #: ../../doc/src/design.md:10 msgid "" "Abstract Syntax Tree (AST), module `lfortran.ast`: Represents any Fortran" " source code, strictly based on syntax, no semantic is included. The AST " "module can convert itself to Fortran source code." msgstr "" #: ../../doc/src/design.md:14 msgid "" "Abstract Semantic Representation (ASR), module `lfortran.asr`: Represents" " a valid Fortran source code, all semantic is included. Invalid Fortran " "code is not allowed (an error will be given). The ASR module can convert " "itself to an AST." msgstr "" #: ../../doc/src/design.md:19 msgid "" "The LFortran compiler is then composed of the following independent " "stages:" msgstr "" #: ../../doc/src/design.md:21 msgid "Parsing: converts Fortran source code to an AST" msgstr "" #: ../../doc/src/design.md:22 msgid "Semantic: converts an AST to an ASR" msgstr "" #: ../../doc/src/design.md:23 msgid "" "High level optimizations: optimize ASR to a possibly faster/simpler ASR " "(things like inlining functions, eliminating redundant expressions or " "statements, etc.)" msgstr "" #: ../../doc/src/design.md:26 msgid "" "LLVM IR code generation and lower level optimizations: converts an ASR to" " an LLVM IR. This stage also does all other optimizations that do not " "produce an ASR, but still make sense to do before passing to LLVM IR." msgstr "" #: ../../doc/src/design.md:29 msgid "" "Machine code generation: LLVM then does all its optimizations and " "generates machine code (such as a binary executable, a library, an object" " file, or it is loaded and executed using JIT as part of the interactive " "LFortran session or in a Jupyter kernel)." msgstr "" #: ../../doc/src/design.md:34 msgid "" "LFortran is structured as a library, and so one can for example use the " "parser to obtain an AST and do something with it, or one can then use the" " semantic analyzer to obtain ASR and do something with it. One can " "generate the ASR directly (e.g., from SymPy) and then either convert to " "AST and to a Fortran source code, or use LFortran to compile it to " "machine code directly. In other words, one can use LFortran to easily " "convert between the three equivalent representations:" msgstr "" #: ../../doc/src/design.md:42 msgid "Fortran source code" msgstr "" #: ../../doc/src/design.md:43 ../../doc/src/developer_tutorial.ipynb:23 msgid "Abstract Syntax Tree (AST)" msgstr "" #: ../../doc/src/design.md:44 ../../doc/src/developer_tutorial.ipynb:159 msgid "Abstract Semantic Representation (ASR)" msgstr "" #: ../../doc/src/design.md:46 msgid "They are all equivalent in the following sense:" msgstr "" #: ../../doc/src/design.md:48 msgid "Any ASR can always be converted to an equivalent AST" msgstr "" #: ../../doc/src/design.md:49 msgid "Any AST can always be converted to an equivalent Fortran source code" msgstr "" #: ../../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 "" #: ../../doc/src/design.md:52 msgid "" "Any AST can always be either converted to an equivalent ASR or one gets a" " semantic error" msgstr "" #: ../../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 "" #: ../../doc/src/design.md:58 msgid "ASR Design Details" msgstr "" #: ../../doc/src/design.md:60 msgid "The ASR is designed to have the following features:" msgstr "" #: ../../doc/src/design.md:62 msgid "" "ASR is still semantically equivalent to the original Fortran code (it did" " not lose any semantic information). ASR can be converted to AST, and AST" " to Fortran source code which is functionally equivalent to the original." msgstr "" #: ../../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 "" #: ../../doc/src/design.md:69 msgid "" "The ASR C++ classes (down the road) are designed similarly to SymEngine: " "they are constructed once and after that they are immutable. The " "constructor checks in Debug more that all the requirements are met (e.g.," " that all Variables in a Function have a dummy argument set, that " "explicit-shape arrays are not allocatable and all other Fortran " "requirements to make it a valid code), but in Release mode it quickly " "constructs the class without checks. Then there are builder classes that " "construct the ASR C++ classes to meet requirements (checked in Debug " "mode) and the builder gives an error message if a code is not a valid " "Fortran code, and if it doesn't give an error message, then the ASR C++ " "classes are constructed correctly. Thus by construction, the ASR classes " "always contain valid Fortran code and the rest of LFortran can depend on " "it." msgstr "" #: ../../doc/src/design.md:82 msgid "Notes:" msgstr "" #: ../../doc/src/design.md:84 msgid "" "Information that is lost when parsing source to AST: whitespace, " "multiline/single line if statement distinction, case sensitivity of " "keywords." msgstr "" #: ../../doc/src/design.md:87 msgid "" "Information that is lost when going from AST to ASR: detailed syntax how " "variables were defined and the order of type attributes (whether array " "dimension is using the `dimension` attribute, or parentheses at the " "variable; or how many variables there are per declaration line or their " "order), as ASR only represents the aggregated type information in the " "symbol table." msgstr "" #: ../../doc/src/design.md:90 msgid "" "ASR is the simplest way to generate Fortran code, as one does not have to" " worry about the detailed syntax (as in AST) about how and where things " "are declared. One specifies the symbol table for a module, then for each " "symbol (functions, global variables, types, ...) one specifies the local " "variables and if this is an interface then one needs to specify where one" " can find an implementation, otherwise a body is supplied with " "statements, those nodes are almost the same as in AST, except that each " "variable is just a reference to a symbol in the symbol table (so by " "construction one cannot have undefined variables). The symbol table for " "each node such as Function or Module also references its parent (for " "example a function references a module, a module references the global " "scope)." msgstr "" #: ../../doc/src/design.md:102 msgid "" "The ASR can be directly converted to an AST without gathering any other " "information. And the AST directly to Fortran source code." msgstr "" #: ../../doc/src/design.md:105 msgid "" "The ASR is always representing a semantically valid Fortran code. This " "is enforced by checks in the ASR C++ constructors (in Debug build). When " "an ASR is used, one can assume it is valid." msgstr "" #: ../../doc/src/design.md:109 msgid "Fortran 2008" msgstr "" #: ../../doc/src/design.md:111 msgid "" "Fortran 2008 [standard](https://j3-fortran.org/doc/year/10/10-007.pdf) " "chapter 2 \"Fortran concepts\" specifies that Fortran code is a " "collection of _program units_ (either all in one file, or in separate " "files), where each _program unit_ is one of:" msgstr "" #: ../../doc/src/design.md:116 ../../doc/src/design.md:131 msgid "main program" msgstr "" #: ../../doc/src/design.md:117 ../../doc/src/design.md:132 msgid "module or submodule" msgstr "" #: ../../doc/src/design.md:118 ../../doc/src/design.md:133 msgid "function or subroutine" msgstr "" #: ../../doc/src/design.md:120 msgid "" "Note: It can also be a _block data_ program unit, that is used to provide" " initial values for data objects in named _common blocks_, but we do not " "recommend the use of _common blocks_ (use modules instead)." msgstr "" #: ../../doc/src/design.md:124 msgid "LFortran Extension" msgstr "" #: ../../doc/src/design.md:126 msgid "" "We extend the Fortran language by introducing a _global scope_, which is " "not only the list of _program units_ (as in F2008) but can also include " "statements, declarations, use statements and expressions. We define " "_global scope_ as a collection of the following items:" msgstr "" #: ../../doc/src/design.md:134 msgid "use statement" msgstr "" #: ../../doc/src/design.md:135 msgid "declaration" msgstr "" #: ../../doc/src/design.md:136 msgid "statement" msgstr "" #: ../../doc/src/design.md:137 msgid "expression" msgstr "" #: ../../doc/src/design.md:139 msgid "" "In addition, if a variable is not defined in an assignment statement " "(such as `x = 5+3`) then the type of the variable is inferred from the " "right hand side (e.g., `x` in `x = 5+3` would be of type `integer`, and " "`y` in `y = 5._dp` would be of type `real(dp)`). This rule only applies " "at the top level of _global scope_. Types must be fully specified inside " "main programs, modules, functions and subroutines, just like in F2008." msgstr "" #: ../../doc/src/design.md:146 msgid "" "The _global scope_ has its own symbol table. The main program and " "module/submodule do not see any symbols from this symbol table. But " "functions, subroutines, statements and expressions at the top level of " "_global scope_ use and operate on this symbol table." msgstr "" #: ../../doc/src/design.md:151 msgid "" "The _global scope_ has the following symbols predefined in the symbol " "table:" msgstr "" #: ../../doc/src/design.md:153 msgid "" "the usual standard set of Fortran functions (such as `size`, `sin`, " "`cos`, ...)" msgstr "" #: ../../doc/src/design.md:155 msgid "" "the `dp` double precision symbol, so that one can use `5._dp` for double " "precision." msgstr "" #: ../../doc/src/design.md:158 msgid "" "Each item in the _global scope_ is interpreted as follows: main program " "is compiled into an executable with the same name and executed; modules, " "functions and subroutines are compiled and loaded; use statement and " "declaration adds those symbols with the proper type into the _global " "scope_ symbol table, but do not generate any code; statement is wrapped " "into an anonymous subroutine with no arguments, compiled, loaded and " "executed; expression is wrapped into an anonymous function with no " "arguments returning the expression, compiled, loaded, executed and the " "return value is returned to the user." msgstr "" #: ../../doc/src/design.md:168 msgid "" "The _global scope_ is always interpreted, item by item, per the previous " "paragraph. It is meant to allow interactive usage, experimentations and " "writing simple scripts. Code in _global scope_ must be interpreted using " "`lfortran`. For more complex (production) code it is recommended to turn " "it into modules and programs (by wrapping loose statements into " "subroutines or functions and by adding type declarations) and compile it " "with `lfortran` or any other Fortran compiler." msgstr "" #: ../../doc/src/design.md:176 msgid "Here are some examples of valid code in _global scope_:" msgstr "" #: ../../doc/src/design.md:178 msgid "Example 1" msgstr "" #: ../../doc/src/design.md:185 msgid "Example 2" msgstr "" #: ../../doc/src/design.md:197 msgid "Example 3" msgstr "" #: ../../doc/src/design.md:209 msgid "Example 4" msgstr "" #: ../../doc/src/design.md:217 msgid "Design Considerations" msgstr "" #: ../../doc/src/design.md:219 msgid "" "The LFortran extension of Fortran was chosen in a way so as to minimize " "the number of changes. In particular, only the top level of the _global " "scope_ has relaxed some of the Fortran rules (such as making specifying " "types optional) so as to allow simple and quick interactive usage, but " "inside functions, subroutines, modules or programs this relaxation does " "not apply." msgstr "" #: ../../doc/src/design.md:225 msgid "" "The number of changes were kept to minimum in order to make it " "straightforward to turn code at _global scope_ into standard compliant " "Fortran code using programs and modules, so that it can be compiled by " "any Fortran compiler." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:9 msgid "Developer Tutorial" msgstr "" #: ../../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 "" #: ../../doc/src/developer_tutorial.ipynb:14 msgid "Introduction" msgstr "Introduction" #: ../../doc/src/developer_tutorial.ipynb:18 msgid "" "Abstract Syntax Tree (AST): Represents any Fortran source code, strictly " "based on syntax, no semantic is included. The AST module can convert " "itself to Fortran source code." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:20 msgid "" "Abstract Semantic Representation (ASR): Represents a valid Fortran source" " code, all semantic is included. Invalid Fortran code is not allowed (an " "error will be given). The ASR module can convert itself to an AST." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:25 msgid "" "Fortran source code can be parsed into an AST using the ``src_to_ast()`` " "function:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:49 #, python-format msgid "We can pretty print it using the ``%%showast`` magic:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:98 #, python-format msgid "We can convert AST to Fortran source code using ``%%showfmt``:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:156 msgid "" "All AST nodes and their arguments are described in `AST.asdl " "`__." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:170 #, python-format msgid "We can pretty print using the ``%%showasr`` magic:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:219 msgid "" "All ASR nodes and their arguments are described in `ASR.asdl " "`__." msgstr "" #: ../../doc/src/index.md:134 msgid "Getting started" msgstr "Se lancer !" #: ../../doc/src/index.md:141 ../../doc/src/progress.md:1 msgid "LFortran Development Status" msgstr "" #: ../../doc/src/index.md:147 msgid "Developer's Guide" msgstr "" #: ../../doc/src/index.md:156 msgid "LFortran Intrinsics" msgstr "" #: ../../doc/src/index.md:1 msgid "LFortran Documentation" msgstr "" #: ../../doc/src/index.md:3 msgid "" "LFortran is a modern open-source (BSD licensed) interactive Fortran " "compiler built on top of LLVM. It can execute user's code interactively " "to allow exploratory work (much like Python, MATLAB or Julia) as well as " "compile to binaries with the goal to run user's code on modern " "architectures such as multi-core CPUs and GPUs." msgstr "" #: ../../doc/src/index.md:9 #, python-format msgid "" "Website: [https://lfortran.org/](https://lfortran.org/) Main " "repository: " "[https://github.com/lfortran/lfortran](https://github.com/lfortran/lfortran)" " Try online using Binder: " "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb)" msgstr "" #: ../../doc/src/index.md:9 msgid "Binder" msgstr "" #: ../../doc/src/index.md:16 msgid "Feature Highlights" msgstr "" #: ../../doc/src/index.md:18 msgid "" "LFortran is in development, there are features that work today, and there" " are features that are being implemented. You can also check out the " "[Development Status](progress.md) section for more information on " "features being supported and being worked on." msgstr "" #: ../../doc/src/index.md:21 msgid "Works today" msgstr "" #: ../../doc/src/index.md:23 #, python-format msgid "" "**Interactive, Jupyter support** LFortran can be used from Jupyter as a" " Fortran kernel, allowing a Python/Julia style rapid prototyping and " "exploratory workflow (see the " "[static](https://nbviewer.jupyter.org/gist/certik/f1d28a486510810d824869ab0c491b1c)" " or [interactive](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb) example notebook). Or " "it can be used from the command-line in an interactive prompt (REPL)." msgstr "" #: ../../doc/src/index.md:32 msgid "" "**Clean, modular design, usable as a library** LFortran is structured " "around two independent modules, AST and ASR, both of which are " "standalone (completely independent of the rest of LFortran) and users " "are encouraged to use them independently for other applications and " "build tools on top. See the [Design](design.md) and [Developer " "Tutorial](developer_tutorial.md) documents for more details." msgstr "" #: ../../doc/src/index.md:39 msgid "" "**Interoperation with GFortran** LFortran can parse GFortran module " "files into an ASR and generate a Fortran wrapper that can be compiled " "with any Fortran compiler and linked with the original GFortran " "compiled module." msgstr "" #: ../../doc/src/index.md:44 msgid "" "**Create executables** It can create executables just like other " "Fortran compilers." msgstr "" #: ../../doc/src/index.md:47 msgid "" "**Runs on Linux, Mac and Windows** All three platforms are regularly " "tested by our CI." msgstr "" #: ../../doc/src/index.md:51 msgid "Planned" msgstr "" #: ../../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 "" #: ../../doc/src/index.md:56 msgid "" "**Native interoperation with other languages (and other Fortran " "compilers)** It can automatically call code written in other languages " "(such as C or Python) just by using the `use` statement, see " "[#44](https://gitlab.com/lfortran/lfortran/issues/44). It understands " "other Fortran compilers module files (one can just \"use\" them) and " "their ABI to link correctly (GFortran is supported, other compilers are" " planned, see [#56](https://gitlab.com/lfortran/lfortran/issues/56)), " "which allows to use LFortran with production codes today." msgstr "" #: ../../doc/src/index.md:65 msgid "" "**Modern hardware support** Thanks to LLVM, the goal of LFortran is to " "run on modern hardware and take advantage of native Fortran language " "constructs (such as `do concurrent`) to run on multi-core CPUs and " "GPUs, see [#57](https://gitlab.com/lfortran/lfortran/issues/57)." msgstr "" #: ../../doc/src/index.md:71 msgid "" "**Full Fortran 2018 support** Currently only a subset of Fortran is " "implemented, but the goal is to have a full implementation of the " "latest Fortran 2018 standard, see " "[#58](https://gitlab.com/lfortran/lfortran/issues/58)." msgstr "" #: ../../doc/src/index.md:77 msgid "" "Please vote on issues in our [issue " "tracker](https://gitlab.com/lfortran/lfortran/issues) that you want us to" " prioritize (feel free to create new ones if we are missing anything)." msgstr "" #: ../../doc/src/index.md:81 msgid "Roadmap" msgstr "" #: ../../doc/src/index.md:83 msgid "Here is our roadmap how to get all the planned features above implemented:" msgstr "" #: ../../doc/src/index.md:85 msgid "" "Port code generation to use ASR and pass all the current tests " "([#74](https://gitlab.com/lfortran/lfortran/issues/74)). Remove the old " "code generation and old semantics, that used to annotate the AST tree, " "which was messy." msgstr "" #: ../../doc/src/index.md:89 msgid "" "Get GFortran module files working with `use` module, both assumed-size " "and assumed-shape arrays " "([#52](https://gitlab.com/lfortran/lfortran/issues/52)). This will allow " "right away to use production codes with LFortran." msgstr "" #: ../../doc/src/index.md:93 msgid "Do these at the same time:" msgstr "" #: ../../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 "" #: ../../doc/src/index.md:98 msgid "" "b) Gradually move to C++ for robustness and speed " "([#70](https://gitlab.com/lfortran/lfortran/issues/70)). The Python API " "will not change (or only minimally), so the user experience from Python " "will not change." msgstr "" #: ../../doc/src/index.md:103 msgid "" "c) Implement all the other cool features: `use` module for C and Python " "and automatic wrappers " "([#44](https://gitlab.com/lfortran/lfortran/issues/44)), modern hardware" " support ([#57](https://gitlab.com/lfortran/lfortran/issues/57)), " "generating an older standard of Fortran " "([#72](https://gitlab.com/lfortran/lfortran/issues/72)), Fortran doctest" " feature ([#73](https://gitlab.com/lfortran/lfortran/issues/73)), SymPy" " integration ([#71](https://gitlab.com/lfortran/lfortran/issues/71)), " "language service for IDEs " "([#12](https://gitlab.com/lfortran/lfortran/issues/12)), and other ideas" " ([#29](https://gitlab.com/lfortran/lfortran/issues/29))." msgstr "" #: ../../doc/src/index.md:118 msgid "The step 1. is an internal refactoring that will not take long." msgstr "" #: ../../doc/src/index.md:120 msgid "" "The step 2. will allow LFortran to be used interactively with production " "codes right away (the production code will get compiled with GFortran, " "then one \"uses\" any module in LFortran and functions/subroutines can be" " interactively called, the module itself can use any GFortran supported " "feature, but the API must fit into the subset that LFortran understands " "--- for large number of applications simple functions/subroutines with " "array arguments are enough). This will make LFortran usable for first " "users and one can always use GFortran temporarily until LFortran supports" " the given feature. We expect to be finished with the step 2. by the end " "of summer 2019, hopefully sooner." msgstr "" #: ../../doc/src/index.md:130 msgid "" "Finally the step 3. will improve LFortran overall, allowing the first " "users to contribute back, growing the community and making LFortran " "gradually useful for more and more people." msgstr "" #: ../../doc/src/installation.md:1 msgid "Installation" msgstr "Installation" #: ../../doc/src/installation.md:3 msgid "All the instructions below work on Linux, macOS and Windows." msgstr "" #: ../../doc/src/installation.md:5 msgid "Binaries" msgstr "" #: ../../doc/src/installation.md:7 msgid "" "The recommended way to install LFortran is using Conda. Install Conda for" " example by installing the " "[Miniconda](https://conda.io/en/latest/miniconda.html) installation by " "following instructions there for your platform. Then create a new " "environment (you can choose any name, here we chose `lf`) and activate " "it:" msgstr "" #: ../../doc/src/installation.md:16 msgid "Then install LFortran by:" msgstr "" #: ../../doc/src/installation.md:20 msgid "" "Now the `lf` environment has the `lfortran` compiler available, you can " "start the interactive prompt by executing `lfortran`, or see the command " "line options using `lfortran -h`." msgstr "" #: ../../doc/src/installation.md:24 msgid "" "The Jupyter kernel is automatically installed by the above command, so " "after installing Jupyter itself:" msgstr "" #: ../../doc/src/installation.md:28 msgid "You can create a Fortran based Jupyter notebook by executing:" msgstr "" #: ../../doc/src/installation.md:32 msgid "and selecting `New->Fortran`." msgstr "" #: ../../doc/src/installation.md:35 msgid "Build From a Source Tarball" msgstr "" #: ../../doc/src/installation.md:37 msgid "" "This method is the recommended method if you just want to install " "LFortran, either yourself or in a package manager (Spack, Conda, Debian, " "etc.). The source tarball has all the generated files included and has " "minimal dependencies." msgstr "" #: ../../doc/src/installation.md:39 msgid "First we have to install dependencies, for example using Conda:" msgstr "" #: ../../doc/src/installation.md:44 msgid "" "Then download a tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), e.g.:" msgstr "" #: ../../doc/src/installation.md:52 msgid "And build:" msgstr "" #: ../../doc/src/installation.md:58 msgid "This will install the `lfortran` into the `inst/bin`." msgstr "" #: ../../doc/src/installation.md:60 msgid "Build From Git" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/installation.md:72 msgid "Then prepare the environment:" msgstr "" #: ../../doc/src/installation.md:77 msgid "Clone the LFortran git repository:" msgstr "" #: ../../doc/src/installation.md:82 msgid "" "Generate files that are needed for the build (this step depends on " "`re2c`, `bison` and `python`):" msgstr "" #: ../../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 "" #: ../../doc/src/installation.md:92 msgid "Run tests:" msgstr "" #: ../../doc/src/installation.md:97 msgid "Run an interactive prompt:" msgstr "" #: ../../doc/src/installation.md:102 msgid "Build from Git on Windows with Visual Studio" msgstr "" #: ../../doc/src/installation.md:104 msgid "" "Install Visual Studio (MSVC), for example the version 2022, you can " "download the Community version for free from: " "https://visualstudio.microsoft.com/downloads/." msgstr "" #: ../../doc/src/installation.md:107 msgid "" "Install miniforge using the Windows installer from https://github.com" "/conda-forge/miniforge." msgstr "" #: ../../doc/src/installation.md:109 msgid "Launch the Miniforge Prompt from the Desktop." msgstr "" #: ../../doc/src/installation.md:111 msgid "In the shell, initialize the MSVC compiler using:" msgstr "" #: ../../doc/src/installation.md:117 msgid "You can optionally test that MSVC works by:" msgstr "" #: ../../doc/src/installation.md:122 msgid "Both commands must print help (several pages)." msgstr "" #: ../../doc/src/installation.md:124 msgid "Now you can download and build LFortran:" msgstr "" #: ../../doc/src/installation.md:134 msgid "If everything compiled, then you can use LFortran as follows:" msgstr "" #: ../../doc/src/installation.md:140 msgid "And so on." msgstr "" #: ../../doc/src/installation.md:142 msgid "" "Note: LFortran currently uses the MSVC's linker program (`link`), which " "is only available when the MSVC bat script above is ran. If you forget to" " activate it, LFortran's linking will fail." msgstr "" #: ../../doc/src/installation.md:146 msgid "" "Note: the miniforge shell seems to be running some version of `git-bash` " "(although it is `cmd.exe`), which has some unix-like filesystem mounted " "in `/usr` and several commands available such as `ls`, `which`, `git`, " "`vim`. For this reason the Conda build `environment_win.yml` contains " "everything needed, including `git`." msgstr "" #: ../../doc/src/installation.md:152 msgid "Build from Git on Windows with WSL" msgstr "" #: ../../doc/src/installation.md:153 msgid "In windows search \"turn windows features on or off\"." msgstr "" #: ../../doc/src/installation.md:154 msgid "Tick Windows subsystem for Linux." msgstr "" #: ../../doc/src/installation.md:155 msgid "Press OK and restart computer." msgstr "" #: ../../doc/src/installation.md:156 msgid "Go to Microsoft store and download Ubuntu 20.04, and launch it." msgstr "" #: ../../doc/src/installation.md:157 msgid "Run the following commands." msgstr "" #: ../../doc/src/installation.md:164 msgid "Now do the following to configure the path" msgstr "" #: ../../doc/src/installation.md:168 msgid "Then go to the bottom of the file and paste the following" msgstr "" #: ../../doc/src/installation.md:172 msgid "Then press ctrl + O (save), Enter (confirm), ctrl + X (exit)" msgstr "" #: ../../doc/src/installation.md:173 msgid "After that restart Ubuntu" msgstr "" #: ../../doc/src/installation.md:174 msgid "Run the following" msgstr "" #: ../../doc/src/installation.md:179 msgid "Restart Ubuntu again" msgstr "" #: ../../doc/src/installation.md:187 msgid "" "You can change the directory to a Windows location using `cd /mnt/[drive " "letter]/[windows location]`." msgstr "" #: ../../doc/src/installation.md:188 msgid "e.g. `cd mnt/c/Users/name/source/repos/`" msgstr "" #: ../../doc/src/installation.md:190 msgid "Now clone the LFortran git repository" msgstr "" #: ../../doc/src/installation.md:196 msgid "Run the following commands" msgstr "" #: ../../doc/src/installation.md:204 msgid "If everything compiles, you can use LFortran as follows" msgstr "" #: ../../doc/src/installation.md:210 msgid "Run an interactive prompt" msgstr "" #: ../../doc/src/installation.md:215 msgid "Run tests" msgstr "" #: ../../doc/src/installation.md:221 msgid "Enabling the Jupyter Kernel" msgstr "" #: ../../doc/src/installation.md:223 msgid "To install the Jupyter kernel, install the following Conda packages also:" msgstr "" #: ../../doc/src/installation.md:227 msgid "" "and enable the kernel by `-DWITH_XEUS=yes` and install into " "`$CONDA_PREFIX`. For example:" msgstr "" #: ../../doc/src/installation.md:239 msgid "" "To use it, install Jupyter (`conda install jupyter`) and test that the " "LFortran kernel was found:" msgstr "" #: ../../doc/src/installation.md:244 msgid "Then launch a Jupyter notebook as follows:" msgstr "" #: ../../doc/src/installation.md:248 msgid "Click `New->Fortran`. To launch a terminal jupyter LFortran console:" msgstr "" #: ../../doc/src/installation.md:254 msgid "Build From Git with Nix" msgstr "" #: ../../doc/src/installation.md:256 msgid "" "One of the ways to ensure exact environment and dependencies is with " "`nix`. This will ensure that system dependencies do not interfere with " "the development environment. If you want, you can report bugs in a `nix-" "shell` environment to make it easier for others to reproduce." msgstr "" #: ../../doc/src/installation.md:258 msgid "With Root" msgstr "" #: ../../doc/src/installation.md:260 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 "" #: ../../doc/src/installation.md:264 msgid "Without Root" msgstr "" #: ../../doc/src/installation.md:266 msgid "" "If you would like to not provide `nix` with root access to your machine, " "on Linux distributions we can use [nix-" "portable](https://github.com/DavHau/nix-portable)." msgstr "" #: ../../doc/src/installation.md:270 msgid "" "Now just prepend all `nix-shell` commands with `NP_RUNTIME=bwrap ./nix-" "portable `. So:" msgstr "" #: ../../doc/src/installation.md:278 msgid "Development" msgstr "" #: ../../doc/src/installation.md:280 msgid "Now we can enter the development environment:" msgstr "" #: ../../doc/src/installation.md:284 msgid "" "The `--pure` flag ensures no system dependencies are used in the " "environment." msgstr "" #: ../../doc/src/installation.md:286 msgid "The build steps are the same as with the `ci`:" msgstr "" #: ../../doc/src/installation.md:292 msgid "" "To change the compilation environment from `gcc` (default) to `clang` we " "can use `--argstr`:" msgstr "" #: ../../doc/src/installation.md:297 msgid "Note About Dependencies" msgstr "" #: ../../doc/src/installation.md:299 msgid "" "End users (and distributions) are encouraged to use the tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), which " "only depends on LLVM, CMake and a C++ compiler." msgstr "" #: ../../doc/src/installation.md:303 msgid "" "The tarball is generated automatically by our CI (continuous integration)" " and contains some autogenerated files: the parser, the AST and ASR " "nodes, which is generated by an ASDL translator (requires Python)." msgstr "" #: ../../doc/src/installation.md:307 msgid "The instructions from git are to be used when developing LFortran itself." msgstr "" #: ../../doc/src/installation.md:309 msgid "Note for users who do not use Conda" msgstr "" #: ../../doc/src/installation.md:311 msgid "" "Following are the dependencies necessary for installing this repository " "in development mode," msgstr "" #: ../../doc/src/installation.md:314 msgid "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" msgstr "" #: ../../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 "" #: ../../doc/src/installation.md:316 msgid "[re2c - 2.0.3](https://re2c.org/install/install.html)" msgstr "" #: ../../doc/src/installation.md:317 msgid "" "[binutils - " "2.31.90](ftp://sourceware.org/pub/binutils/snapshots/binutils-2.31.90.tar.xz)" " - Make sure that you should enable the required options related to this " "dependency to build the dynamic libraries (the ones ending with `.so`)." msgstr "" #: ../../doc/src/installation.md:319 msgid "Stacktraces" msgstr "" #: ../../doc/src/installation.md:321 msgid "" "LFortran can print stacktraces when there is an unhandled exception, as " "well as on any compiler error with the `--show-stacktrace` option. This " "is very helpful for developing the compiler itself to see where in " "LFortran the problem is. The stacktrace support is turned off by default," " to enable it, compile LFortran with the `-DWITH_STACKTRACE=yes` cmake " "option after installing the prerequisites on each platform per the " "instructions below." msgstr "" #: ../../doc/src/installation.md:328 msgid "Ubuntu" msgstr "Ubuntu" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." msgstr "" #: ../../doc/src/installation.md:332 msgid "macOS" msgstr "" #: ../../doc/src/installation.md:334 msgid "" "If you use the default Clang compiler on macOS, then the stacktraces " "should just work on both Intel and M1 based macOS (the CMake build system" " automatically invokes the `dsymtuil` tool and our Python scripts to " "store the debug information, see `src/bin/CMakeLists.txt` for more " "details). If it does not work, please report a bug." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/installation.md:352 msgid "" "and compile LFortran with the " "`-DCMAKE_PREFIX_PATH=\"$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX\"` cmake" " option. The `$CONDA_PREFIX` is there if you install some other " "dependencies (such as `llvm`) using Conda, otherwise you can remove it." msgstr "" #: ../../doc/src/intrinsics/array.md:1 msgid "Array Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:1 msgid "allocated(x): Status Check" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:3 msgid "Logical status of an allocatable integer." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:5 #: ../../doc/src/intrinsics/array/cshift.md:5 #: ../../doc/src/intrinsics/array/size.md:5 #: ../../doc/src/intrinsics/bit/bge.md:5 ../../doc/src/intrinsics/bit/bgt.md:5 #: ../../doc/src/intrinsics/bit/bit_size.md:5 #: ../../doc/src/intrinsics/bit/ble.md:5 ../../doc/src/intrinsics/bit/blt.md:5 #: ../../doc/src/intrinsics/bit/btest.md:5 #: ../../doc/src/intrinsics/bit/shiftl.md:5 #: ../../doc/src/intrinsics/bit/shiftr.md:5 #: ../../doc/src/intrinsics/character/achar.md:5 #: ../../doc/src/intrinsics/character/adjustl.md:5 #: ../../doc/src/intrinsics/character/adjustr.md:5 #: ../../doc/src/intrinsics/character/char.md:5 #: ../../doc/src/intrinsics/character/len_trim.md:5 #: ../../doc/src/intrinsics/character/lge.md:5 #: ../../doc/src/intrinsics/kind-type/kind.md:5 #: ../../doc/src/intrinsics/mathematical/acos.md:5 #: ../../doc/src/intrinsics/mathematical/acosh.md:5 #: ../../doc/src/intrinsics/mathematical/asin.md:5 #: ../../doc/src/intrinsics/mathematical/asinh.md:5 #: ../../doc/src/intrinsics/mathematical/atan.md:5 #: ../../doc/src/intrinsics/mathematical/atan2.md:5 #: ../../doc/src/intrinsics/mathematical/atanh.md:5 #: ../../doc/src/intrinsics/mathematical/fraction.md:5 #: ../../doc/src/intrinsics/misc/command_argument_count.md:5 #: ../../doc/src/intrinsics/misc/cpu_time.md:5 #: ../../doc/src/intrinsics/misc/date_and_time.md:5 #: ../../doc/src/intrinsics/misc/new_line.md:5 #: ../../doc/src/intrinsics/numeric/abs.md:5 #: ../../doc/src/intrinsics/numeric/aimag.md:5 #: ../../doc/src/intrinsics/numeric/aint.md:5 #: ../../doc/src/intrinsics/numeric/anint.md:5 #: ../../doc/src/intrinsics/numeric/ceiling.md:5 #: ../../doc/src/intrinsics/numeric/cmplx.md:5 #: ../../doc/src/intrinsics/numeric/conjg.md:5 #: ../../doc/src/intrinsics/numeric/digits.md:5 #: ../../doc/src/intrinsics/numeric/dim.md:5 #: ../../doc/src/intrinsics/numeric/epsilon.md:5 #: ../../doc/src/intrinsics/numeric/erf.md:5 #: ../../doc/src/intrinsics/numeric/erfc.md:5 #: ../../doc/src/intrinsics/numeric/exp.md:5 #: ../../doc/src/intrinsics/numeric/floor.md:5 #: ../../doc/src/intrinsics/numeric/gamma.md:5 #: ../../doc/src/intrinsics/numeric/mod.md:5 msgid "Declaration" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:7 #: ../../doc/src/intrinsics/array/cshift.md:7 #: ../../doc/src/intrinsics/array/size.md:7 #: ../../doc/src/intrinsics/bit/bge.md:7 ../../doc/src/intrinsics/bit/bgt.md:7 #: ../../doc/src/intrinsics/bit/bit_size.md:7 #: ../../doc/src/intrinsics/bit/ble.md:7 ../../doc/src/intrinsics/bit/blt.md:7 #: ../../doc/src/intrinsics/bit/btest.md:7 #: ../../doc/src/intrinsics/bit/shiftl.md:7 #: ../../doc/src/intrinsics/bit/shiftr.md:7 #: ../../doc/src/intrinsics/character/achar.md:7 #: ../../doc/src/intrinsics/character/adjustl.md:7 #: ../../doc/src/intrinsics/character/adjustr.md:7 #: ../../doc/src/intrinsics/character/char.md:7 #: ../../doc/src/intrinsics/character/len_trim.md:7 #: ../../doc/src/intrinsics/character/lge.md:8 #: ../../doc/src/intrinsics/kind-type/kind.md:7 #: ../../doc/src/intrinsics/mathematical/acos.md:7 #: ../../doc/src/intrinsics/mathematical/acosh.md:7 #: ../../doc/src/intrinsics/mathematical/asin.md:7 #: ../../doc/src/intrinsics/mathematical/asinh.md:7 #: ../../doc/src/intrinsics/mathematical/atan.md:7 #: ../../doc/src/intrinsics/mathematical/atan2.md:7 #: ../../doc/src/intrinsics/mathematical/atanh.md:7 #: ../../doc/src/intrinsics/mathematical/fraction.md:7 #: ../../doc/src/intrinsics/misc/command_argument_count.md:7 #: ../../doc/src/intrinsics/misc/cpu_time.md:7 #: ../../doc/src/intrinsics/misc/date_and_time.md:7 #: ../../doc/src/intrinsics/misc/new_line.md:7 #: ../../doc/src/intrinsics/numeric/abs.md:7 #: ../../doc/src/intrinsics/numeric/aimag.md:7 #: ../../doc/src/intrinsics/numeric/aint.md:7 #: ../../doc/src/intrinsics/numeric/anint.md:7 #: ../../doc/src/intrinsics/numeric/ceiling.md:7 #: ../../doc/src/intrinsics/numeric/cmplx.md:7 #: ../../doc/src/intrinsics/numeric/conjg.md:7 #: ../../doc/src/intrinsics/numeric/digits.md:7 #: ../../doc/src/intrinsics/numeric/dim.md:7 #: ../../doc/src/intrinsics/numeric/epsilon.md:7 #: ../../doc/src/intrinsics/numeric/erf.md:7 #: ../../doc/src/intrinsics/numeric/erfc.md:7 #: ../../doc/src/intrinsics/numeric/exp.md:7 #: ../../doc/src/intrinsics/numeric/floor.md:7 #: ../../doc/src/intrinsics/numeric/gamma.md:7 #: ../../doc/src/intrinsics/numeric/mod.md:7 msgid "Syntax" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:14 #: ../../doc/src/intrinsics/array/cshift.md:14 #: ../../doc/src/intrinsics/array/size.md:14 #: ../../doc/src/intrinsics/bit/bge.md:14 #: ../../doc/src/intrinsics/bit/bgt.md:14 #: ../../doc/src/intrinsics/bit/bit_size.md:14 #: ../../doc/src/intrinsics/bit/ble.md:14 #: ../../doc/src/intrinsics/bit/blt.md:14 #: ../../doc/src/intrinsics/bit/btest.md:14 #: ../../doc/src/intrinsics/bit/shiftl.md:14 #: ../../doc/src/intrinsics/bit/shiftr.md:14 #: ../../doc/src/intrinsics/character/achar.md:14 #: ../../doc/src/intrinsics/character/adjustl.md:14 #: ../../doc/src/intrinsics/character/adjustr.md:14 #: ../../doc/src/intrinsics/character/char.md:14 #: ../../doc/src/intrinsics/character/len_trim.md:14 #: ../../doc/src/intrinsics/character/lge.md:15 #: ../../doc/src/intrinsics/kind-type/kind.md:14 #: ../../doc/src/intrinsics/mathematical/acos.md:14 #: ../../doc/src/intrinsics/mathematical/acosh.md:14 #: ../../doc/src/intrinsics/mathematical/asin.md:14 #: ../../doc/src/intrinsics/mathematical/asinh.md:14 #: ../../doc/src/intrinsics/mathematical/atan.md:14 #: ../../doc/src/intrinsics/mathematical/atan2.md:13 #: ../../doc/src/intrinsics/mathematical/atanh.md:14 #: ../../doc/src/intrinsics/mathematical/fraction.md:13 #: ../../doc/src/intrinsics/misc/command_argument_count.md:14 #: ../../doc/src/intrinsics/misc/cpu_time.md:14 #: ../../doc/src/intrinsics/misc/date_and_time.md:14 #: ../../doc/src/intrinsics/misc/new_line.md:14 #: ../../doc/src/intrinsics/numeric/abs.md:15 #: ../../doc/src/intrinsics/numeric/aimag.md:15 #: ../../doc/src/intrinsics/numeric/aint.md:14 #: ../../doc/src/intrinsics/numeric/anint.md:14 #: ../../doc/src/intrinsics/numeric/ceiling.md:14 #: ../../doc/src/intrinsics/numeric/cmplx.md:16 #: ../../doc/src/intrinsics/numeric/conjg.md:15 #: ../../doc/src/intrinsics/numeric/digits.md:13 #: ../../doc/src/intrinsics/numeric/dim.md:13 #: ../../doc/src/intrinsics/numeric/epsilon.md:14 #: ../../doc/src/intrinsics/numeric/erf.md:14 #: ../../doc/src/intrinsics/numeric/erfc.md:14 #: ../../doc/src/intrinsics/numeric/exp.md:14 #: ../../doc/src/intrinsics/numeric/floor.md:14 #: ../../doc/src/intrinsics/numeric/gamma.md:14 #: ../../doc/src/intrinsics/numeric/mod.md:15 msgid "Arguments" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:16 msgid "`x` is an integer input parameter." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:18 #: ../../doc/src/intrinsics/array/cshift.md:22 #: ../../doc/src/intrinsics/array/size.md:22 #: ../../doc/src/intrinsics/bit/bge.md:18 #: ../../doc/src/intrinsics/bit/bgt.md:18 #: ../../doc/src/intrinsics/bit/bit_size.md:18 #: ../../doc/src/intrinsics/bit/ble.md:18 #: ../../doc/src/intrinsics/bit/blt.md:18 #: ../../doc/src/intrinsics/bit/btest.md:19 #: ../../doc/src/intrinsics/bit/shiftl.md:21 #: ../../doc/src/intrinsics/bit/shiftr.md:21 #: ../../doc/src/intrinsics/character/lge.md:23 #: ../../doc/src/intrinsics/kind-type/kind.md:19 #: ../../doc/src/intrinsics/mathematical/acos.md:18 #: ../../doc/src/intrinsics/mathematical/acosh.md:19 #: ../../doc/src/intrinsics/mathematical/asin.md:18 #: ../../doc/src/intrinsics/mathematical/asinh.md:19 #: ../../doc/src/intrinsics/mathematical/atan.md:18 #: ../../doc/src/intrinsics/mathematical/atan2.md:21 #: ../../doc/src/intrinsics/mathematical/atanh.md:19 #: ../../doc/src/intrinsics/mathematical/fraction.md:17 #: ../../doc/src/intrinsics/misc/command_argument_count.md:18 #: ../../doc/src/intrinsics/misc/cpu_time.md:18 #: ../../doc/src/intrinsics/misc/date_and_time.md:39 #: ../../doc/src/intrinsics/misc/new_line.md:19 #: ../../doc/src/intrinsics/numeric/abs.md:19 #: ../../doc/src/intrinsics/numeric/aimag.md:19 #: ../../doc/src/intrinsics/numeric/aint.md:20 #: ../../doc/src/intrinsics/numeric/anint.md:20 #: ../../doc/src/intrinsics/numeric/ceiling.md:18 #: ../../doc/src/intrinsics/numeric/cmplx.md:24 #: ../../doc/src/intrinsics/numeric/conjg.md:19 #: ../../doc/src/intrinsics/numeric/digits.md:17 #: ../../doc/src/intrinsics/numeric/dim.md:18 #: ../../doc/src/intrinsics/numeric/epsilon.md:18 #: ../../doc/src/intrinsics/numeric/erf.md:18 #: ../../doc/src/intrinsics/numeric/erfc.md:18 #: ../../doc/src/intrinsics/numeric/exp.md:18 #: ../../doc/src/intrinsics/numeric/floor.md:20 #: ../../doc/src/intrinsics/numeric/gamma.md:19 #: ../../doc/src/intrinsics/numeric/mod.md:22 msgid "Return values" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:20 msgid "" "The return value is a logical scalar with the default logical kind type " "parameter." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:23 #: ../../doc/src/intrinsics/array/cshift.md:26 #: ../../doc/src/intrinsics/array/size.md:26 #: ../../doc/src/intrinsics/bit/bge.md:22 #: ../../doc/src/intrinsics/bit/bgt.md:22 #: ../../doc/src/intrinsics/bit/bit_size.md:22 #: ../../doc/src/intrinsics/bit/ble.md:22 #: ../../doc/src/intrinsics/bit/blt.md:22 #: ../../doc/src/intrinsics/bit/btest.md:23 #: ../../doc/src/intrinsics/bit/shiftl.md:25 #: ../../doc/src/intrinsics/bit/shiftr.md:25 #: ../../doc/src/intrinsics/character/achar.md:27 #: ../../doc/src/intrinsics/character/adjustl.md:23 #: ../../doc/src/intrinsics/character/adjustr.md:24 #: ../../doc/src/intrinsics/character/char.md:28 #: ../../doc/src/intrinsics/character/len_trim.md:22 #: ../../doc/src/intrinsics/character/lge.md:31 #: ../../doc/src/intrinsics/kind-type/kind.md:23 #: ../../doc/src/intrinsics/mathematical/acos.md:23 #: ../../doc/src/intrinsics/mathematical/acosh.md:24 #: ../../doc/src/intrinsics/mathematical/asin.md:23 #: ../../doc/src/intrinsics/mathematical/asinh.md:24 #: ../../doc/src/intrinsics/mathematical/atan.md:23 #: ../../doc/src/intrinsics/mathematical/atan2.md:27 #: ../../doc/src/intrinsics/mathematical/atanh.md:24 #: ../../doc/src/intrinsics/mathematical/fraction.md:22 #: ../../doc/src/intrinsics/misc/command_argument_count.md:22 #: ../../doc/src/intrinsics/misc/cpu_time.md:22 #: ../../doc/src/intrinsics/misc/date_and_time.md:43 #: ../../doc/src/intrinsics/misc/new_line.md:24 #: ../../doc/src/intrinsics/numeric/abs.md:24 #: ../../doc/src/intrinsics/numeric/aimag.md:23 #: ../../doc/src/intrinsics/numeric/aint.md:28 #: ../../doc/src/intrinsics/numeric/anint.md:27 #: ../../doc/src/intrinsics/numeric/ceiling.md:22 #: ../../doc/src/intrinsics/numeric/cmplx.md:30 #: ../../doc/src/intrinsics/numeric/conjg.md:23 #: ../../doc/src/intrinsics/numeric/digits.md:21 #: ../../doc/src/intrinsics/numeric/dim.md:22 #: ../../doc/src/intrinsics/numeric/epsilon.md:22 #: ../../doc/src/intrinsics/numeric/erf.md:23 #: ../../doc/src/intrinsics/numeric/erfc.md:23 #: ../../doc/src/intrinsics/numeric/exp.md:22 #: ../../doc/src/intrinsics/numeric/floor.md:28 #: ../../doc/src/intrinsics/numeric/gamma.md:23 #: ../../doc/src/intrinsics/numeric/mod.md:31 ../../doc/src/progress.md msgid "Description" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:25 msgid "" "`allocated(x)` checks the allocation status of a integer input parameter." " It returns a logical value as `TRUE` if the input argument `x` is " "allocated, `FALSE` otherwise." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:29 #: ../../doc/src/intrinsics/array/cshift.md:39 #: ../../doc/src/intrinsics/array/size.md:33 #: ../../doc/src/intrinsics/bit/bge.md:27 #: ../../doc/src/intrinsics/bit/bgt.md:27 #: ../../doc/src/intrinsics/bit/bit_size.md:27 #: ../../doc/src/intrinsics/bit/ble.md:27 #: ../../doc/src/intrinsics/bit/blt.md:27 #: ../../doc/src/intrinsics/bit/btest.md:32 #: ../../doc/src/intrinsics/bit/shiftl.md:32 #: ../../doc/src/intrinsics/bit/shiftr.md:32 #: ../../doc/src/intrinsics/character/achar.md:37 #: ../../doc/src/intrinsics/character/adjustl.md:28 #: ../../doc/src/intrinsics/character/adjustr.md:29 #: ../../doc/src/intrinsics/character/char.md:38 #: ../../doc/src/intrinsics/character/len_trim.md:27 #: ../../doc/src/intrinsics/character/lge.md:37 #: ../../doc/src/intrinsics/kind-type/kind.md:27 #: ../../doc/src/intrinsics/mathematical/acos.md:31 #: ../../doc/src/intrinsics/mathematical/acosh.md:43 #: ../../doc/src/intrinsics/mathematical/asin.md:31 #: ../../doc/src/intrinsics/mathematical/asinh.md:35 #: ../../doc/src/intrinsics/mathematical/atan.md:31 #: ../../doc/src/intrinsics/mathematical/atan2.md:53 #: ../../doc/src/intrinsics/mathematical/atanh.md:39 #: ../../doc/src/intrinsics/mathematical/fraction.md:30 #: ../../doc/src/intrinsics/misc/command_argument_count.md:27 #: ../../doc/src/intrinsics/misc/cpu_time.md:33 #: ../../doc/src/intrinsics/misc/date_and_time.md:53 #: ../../doc/src/intrinsics/misc/new_line.md:29 #: ../../doc/src/intrinsics/numeric/abs.md:35 #: ../../doc/src/intrinsics/numeric/aimag.md:33 #: ../../doc/src/intrinsics/numeric/aint.md:35 #: ../../doc/src/intrinsics/numeric/anint.md:38 #: ../../doc/src/intrinsics/numeric/ceiling.md:26 #: ../../doc/src/intrinsics/numeric/cmplx.md:47 #: ../../doc/src/intrinsics/numeric/conjg.md:33 #: ../../doc/src/intrinsics/numeric/digits.md:26 #: ../../doc/src/intrinsics/numeric/dim.md:27 #: ../../doc/src/intrinsics/numeric/epsilon.md:29 #: ../../doc/src/intrinsics/numeric/erf.md:33 #: ../../doc/src/intrinsics/numeric/erfc.md:36 #: ../../doc/src/intrinsics/numeric/exp.md:29 #: ../../doc/src/intrinsics/numeric/floor.md:33 #: ../../doc/src/intrinsics/numeric/gamma.md:38 #: ../../doc/src/intrinsics/numeric/mod.md:43 msgid "Types" 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 "" #: ../../doc/src/intrinsics/array/allocated.md:46 #: ../../doc/src/intrinsics/array/cshift.md:43 #: ../../doc/src/intrinsics/array/size.md:37 #: ../../doc/src/intrinsics/bit/bge.md:49 #: ../../doc/src/intrinsics/bit/bgt.md:49 #: ../../doc/src/intrinsics/bit/bit_size.md:44 #: ../../doc/src/intrinsics/bit/ble.md:49 #: ../../doc/src/intrinsics/bit/blt.md:49 #: ../../doc/src/intrinsics/bit/btest.md:56 #: ../../doc/src/intrinsics/bit/shiftl.md:62 #: ../../doc/src/intrinsics/bit/shiftr.md:62 #: ../../doc/src/intrinsics/character/achar.md:53 #: ../../doc/src/intrinsics/character/adjustl.md:45 #: ../../doc/src/intrinsics/character/adjustr.md:46 #: ../../doc/src/intrinsics/character/char.md:53 #: ../../doc/src/intrinsics/character/len_trim.md:44 #: ../../doc/src/intrinsics/character/lge.md:59 #: ../../doc/src/intrinsics/kind-type/kind.md:59 #: ../../doc/src/intrinsics/mathematical/acos.md:60 #: ../../doc/src/intrinsics/mathematical/acosh.md:72 #: ../../doc/src/intrinsics/mathematical/asin.md:60 #: ../../doc/src/intrinsics/mathematical/asinh.md:64 #: ../../doc/src/intrinsics/mathematical/atan.md:60 #: ../../doc/src/intrinsics/mathematical/atan2.md:75 #: ../../doc/src/intrinsics/mathematical/atanh.md:68 #: ../../doc/src/intrinsics/mathematical/fraction.md:34 #: ../../doc/src/intrinsics/misc/command_argument_count.md:31 #: ../../doc/src/intrinsics/misc/cpu_time.md:44 #: ../../doc/src/intrinsics/misc/date_and_time.md:64 #: ../../doc/src/intrinsics/misc/new_line.md:40 #: ../../doc/src/intrinsics/numeric/abs.md:79 #: ../../doc/src/intrinsics/numeric/aimag.md:53 #: ../../doc/src/intrinsics/numeric/aint.md:39 #: ../../doc/src/intrinsics/numeric/anint.md:42 #: ../../doc/src/intrinsics/numeric/ceiling.md:46 #: ../../doc/src/intrinsics/numeric/cmplx.md:59 #: ../../doc/src/intrinsics/numeric/conjg.md:53 #: ../../doc/src/intrinsics/numeric/digits.md:30 #: ../../doc/src/intrinsics/numeric/dim.md:31 #: ../../doc/src/intrinsics/numeric/epsilon.md:49 #: ../../doc/src/intrinsics/numeric/erf.md:53 #: ../../doc/src/intrinsics/numeric/erfc.md:56 #: ../../doc/src/intrinsics/numeric/exp.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:65 #: ../../doc/src/intrinsics/numeric/gamma.md:58 #: ../../doc/src/intrinsics/numeric/mod.md:80 msgid "Examples" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:59 #: ../../doc/src/intrinsics/array/cshift.md:55 #: ../../doc/src/intrinsics/array/size.md:48 #: ../../doc/src/intrinsics/mathematical/acos.md:76 #: ../../doc/src/intrinsics/mathematical/acosh.md:81 #: ../../doc/src/intrinsics/mathematical/asin.md:76 #: ../../doc/src/intrinsics/mathematical/asinh.md:73 #: ../../doc/src/intrinsics/mathematical/atan.md:76 #: ../../doc/src/intrinsics/mathematical/atan2.md:84 #: ../../doc/src/intrinsics/mathematical/atanh.md:77 #: ../../doc/src/intrinsics/mathematical/fraction.md:44 msgid "**Result**:" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:65 #: ../../doc/src/intrinsics/array/cshift.md:62 #: ../../doc/src/intrinsics/array/size.md:55 #: ../../doc/src/intrinsics/bit/bge.md:68 #: ../../doc/src/intrinsics/bit/bgt.md:66 #: ../../doc/src/intrinsics/bit/bit_size.md:61 #: ../../doc/src/intrinsics/bit/ble.md:68 #: ../../doc/src/intrinsics/bit/blt.md:66 #: ../../doc/src/intrinsics/bit/btest.md:71 #: ../../doc/src/intrinsics/bit/shiftl.md:80 #: ../../doc/src/intrinsics/bit/shiftr.md:80 #: ../../doc/src/intrinsics/character/achar.md:69 #: ../../doc/src/intrinsics/character/adjustl.md:62 #: ../../doc/src/intrinsics/character/adjustr.md:63 #: ../../doc/src/intrinsics/character/char.md:69 #: ../../doc/src/intrinsics/character/len_trim.md:63 #: ../../doc/src/intrinsics/character/lge.md:79 #: ../../doc/src/intrinsics/kind-type/kind.md:79 #: ../../doc/src/intrinsics/mathematical/acos.md:82 #: ../../doc/src/intrinsics/mathematical/acosh.md:86 #: ../../doc/src/intrinsics/mathematical/asin.md:82 #: ../../doc/src/intrinsics/mathematical/asinh.md:78 #: ../../doc/src/intrinsics/mathematical/atan.md:82 #: ../../doc/src/intrinsics/mathematical/atan2.md:90 #: ../../doc/src/intrinsics/mathematical/atanh.md:82 #: ../../doc/src/intrinsics/mathematical/fraction.md:50 #: ../../doc/src/intrinsics/misc/command_argument_count.md:47 #: ../../doc/src/intrinsics/misc/cpu_time.md:64 #: ../../doc/src/intrinsics/misc/date_and_time.md:90 #: ../../doc/src/intrinsics/misc/new_line.md:56 #: ../../doc/src/intrinsics/numeric/abs.md:96 #: ../../doc/src/intrinsics/numeric/aimag.md:68 #: ../../doc/src/intrinsics/numeric/aint.md:55 #: ../../doc/src/intrinsics/numeric/anint.md:58 #: ../../doc/src/intrinsics/numeric/ceiling.md:64 #: ../../doc/src/intrinsics/numeric/cmplx.md:74 #: ../../doc/src/intrinsics/numeric/conjg.md:68 #: ../../doc/src/intrinsics/numeric/digits.md:44 #: ../../doc/src/intrinsics/numeric/dim.md:47 #: ../../doc/src/intrinsics/numeric/epsilon.md:63 #: ../../doc/src/intrinsics/numeric/erf.md:67 #: ../../doc/src/intrinsics/numeric/erfc.md:70 #: ../../doc/src/intrinsics/numeric/exp.md:71 #: ../../doc/src/intrinsics/numeric/floor.md:83 #: ../../doc/src/intrinsics/numeric/gamma.md:74 #: ../../doc/src/intrinsics/numeric/mod.md:95 msgid "See Also" msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:1 msgid "cshift(A, shift [, dim]): Circular Shift" msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:3 msgid "Circular shift elements of an array." 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 "" #: ../../doc/src/intrinsics/array/cshift.md:18 msgid "`shift` the input value of integer type." msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:20 msgid "" "`dim` optional dimension, if present, `cshift` returns the result of this" " dimension." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/array/cshift.md:28 msgid "" "**cshift(A, shift [, dim])** performs a circular shift on elements of `A`" " array along the dimension of `dim`. Default value of `dim` is 1, used " "when `dim` is not passed." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/array/cshift.md:41 msgid "" "Supported argument type is array for `A` and integer for `shift` and " "`dim`." msgstr "" #: ../../doc/src/intrinsics/array/size.md:1 msgid "size(x): Size of Array" msgstr "" #: ../../doc/src/intrinsics/array/size.md:3 msgid "Returns the size of an array `x`." msgstr "" #: ../../doc/src/intrinsics/array/size.md:18 msgid "" "`dim` optional dimension, if present, `size` returns the size of this " "dimension." msgstr "" #: ../../doc/src/intrinsics/array/size.md:20 msgid "`kind` optional the kind of the return value." msgstr "" #: ../../doc/src/intrinsics/array/size.md:24 msgid "`n` the size of an array (integer)." msgstr "" #: ../../doc/src/intrinsics/array/size.md:28 msgid "" "The `size` intrinsic function returns the size of an array. It returns " "the product of all dimensions, unless the `dim` argument is specified, in" " which case it only returns the size of this particular dimension. The " "`kind` argument can be used to specify the integer kind of the result." msgstr "" #: ../../doc/src/intrinsics/array/size.md:57 msgid "[shape](), [reshape]()." msgstr "" #: ../../doc/src/intrinsics/bit.md:1 msgid "Bit Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:1 msgid "bge(x, y): Bitwise Greater or Equal" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:3 msgid "Bitwise greater than or equal to." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/bge.md:29 #: ../../doc/src/intrinsics/bit/bgt.md:29 #: ../../doc/src/intrinsics/bit/ble.md:29 #: ../../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 "" #: ../../doc/src/intrinsics/bit/bge.md:60 #: ../../doc/src/intrinsics/bit/bgt.md:59 #: ../../doc/src/intrinsics/bit/bit_size.md:54 #: ../../doc/src/intrinsics/bit/ble.md:60 #: ../../doc/src/intrinsics/bit/blt.md:59 #: ../../doc/src/intrinsics/bit/btest.md:65 #: ../../doc/src/intrinsics/bit/shiftl.md:74 #: ../../doc/src/intrinsics/bit/shiftr.md:74 #: ../../doc/src/intrinsics/character/achar.md:63 #: ../../doc/src/intrinsics/character/adjustl.md:56 #: ../../doc/src/intrinsics/character/adjustr.md:57 #: ../../doc/src/intrinsics/character/char.md:63 #: ../../doc/src/intrinsics/character/len_trim.md:57 #: ../../doc/src/intrinsics/character/lge.md:72 #: ../../doc/src/intrinsics/kind-type/kind.md:72 #: ../../doc/src/intrinsics/misc/command_argument_count.md:40 #: ../../doc/src/intrinsics/misc/cpu_time.md:57 #: ../../doc/src/intrinsics/misc/date_and_time.md:83 #: ../../doc/src/intrinsics/misc/new_line.md:49 #: ../../doc/src/intrinsics/numeric/abs.md:89 #: ../../doc/src/intrinsics/numeric/aimag.md:62 #: ../../doc/src/intrinsics/numeric/aint.md:48 #: ../../doc/src/intrinsics/numeric/anint.md:51 #: ../../doc/src/intrinsics/numeric/ceiling.md:57 #: ../../doc/src/intrinsics/numeric/cmplx.md:68 #: ../../doc/src/intrinsics/numeric/conjg.md:62 #: ../../doc/src/intrinsics/numeric/digits.md:38 #: ../../doc/src/intrinsics/numeric/dim.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:57 #: ../../doc/src/intrinsics/numeric/erf.md:61 #: ../../doc/src/intrinsics/numeric/erfc.md:64 #: ../../doc/src/intrinsics/numeric/exp.md:65 #: ../../doc/src/intrinsics/numeric/floor.md:76 #: ../../doc/src/intrinsics/numeric/gamma.md:67 #: ../../doc/src/intrinsics/numeric/mod.md:89 msgid "**Result:**" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:70 msgid "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/bgt.md:1 msgid "bgt(x, y): Bitwise Greater Than" msgstr "" #: ../../doc/src/intrinsics/bit/bgt.md:3 msgid "Bitwise greater than." 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 "" #: ../../doc/src/intrinsics/bit/bgt.md:68 msgid "[bge](bge.md), [ble](ble.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:1 msgid "bit_size(x): Bit Size" msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:3 msgid "Bit size." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:16 msgid "`x` is integer input value." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:20 #: ../../doc/src/intrinsics/numeric/digits.md:19 msgid "The return value is of type integer." 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 "" #: ../../doc/src/intrinsics/bit/bit_size.md:29 msgid "Supported input types is integer." msgstr "" #: ../../doc/src/intrinsics/bit/ble.md:1 msgid "bge(x, y): Bitwise Less or Equal" msgstr "" #: ../../doc/src/intrinsics/bit/ble.md:3 msgid "Bitwise less than or equal to." 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 "" #: ../../doc/src/intrinsics/bit/ble.md:70 msgid "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:1 msgid "blt(x, y): Bitwise Less Than" msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:3 msgid "Bitwise less than." 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 "" #: ../../doc/src/intrinsics/bit/blt.md:68 msgid "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:1 msgid "btest(x, pos): Bit Test at Position" msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:3 msgid "Bit test." 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 "" #: ../../doc/src/intrinsics/bit/btest.md:21 msgid "The return value is of type logical." msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:25 msgid "" "`btest(x, pos)` calculates if `pos` bit in input integer value `x` is " "set. The counting of the bits starts at 0, at least significant bit (LSB)" " i.e., the rightmost bit in `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:1 msgid "shiftl(x, shift): Shift Left" msgstr "" #: ../../doc/src/intrinsics/bit/shiftl.md:3 msgid "Logical shift left function." msgstr "" #: ../../doc/src/intrinsics/bit/shiftl.md:16 #: ../../doc/src/intrinsics/bit/shiftr.md:16 msgid "`x` is an integer input value." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:27 msgid "" "**shiftl(x, shift)** logically left shifts `x` by `shift` number of bits." " `shiftl` shifts from LSB(**L**east **S**ignificant **B**it) to " "MSB(**M**ost **S**ignificant **B**it). Bits shifted from the left end " "i.e., MSB bits are lost. Zeroes are appended to the opposite right end." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:82 msgid "[shiftr](shiftr.md)." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:1 msgid "shiftr(x, shift): Shift Right" msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:3 msgid "Logical shift right function." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:27 msgid "" "**shiftr(x, shift)** logically right shifts `x` by `shift` number of " "bits. `shiftr` shifts from MSB(**M**ost **S**ignificant **B**it) to " "LSB(**L**east **S**ignificant **B**it). Bits shifted from the right end " "i.e., LSB bits are lost. Zeroes are appended to the opposite left end." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:82 msgid "[shiftl](shiftl.md)." msgstr "" #: ../../doc/src/intrinsics/character.md:1 msgid "Character Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/character/achar.md:1 msgid "achar(x, kind): To Character in ASCII set." msgstr "" #: ../../doc/src/intrinsics/character/achar.md:3 msgid "Character represented by in the ASCII character set." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/character/achar.md:20 #: ../../doc/src/intrinsics/character/adjustl.md:18 #: ../../doc/src/intrinsics/character/adjustr.md:18 #: ../../doc/src/intrinsics/character/char.md:21 #: ../../doc/src/intrinsics/character/len_trim.md:18 msgid "Return value" 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/achar.md:29 msgid "" "**achar(x, kind)** returns the character represented by the ASCII " "character set at `x` position." msgstr "" #: ../../doc/src/intrinsics/character/achar.md:32 #: ../../doc/src/intrinsics/character/char.md:33 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 "" #: ../../doc/src/intrinsics/character/achar.md:35 #: ../../doc/src/intrinsics/character/char.md:36 msgid "It is a runtime builtin function." 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 "" #: ../../doc/src/intrinsics/character/adjustl.md:1 msgid "adjustl(string): Left Adjust String" msgstr "" #: ../../doc/src/intrinsics/character/adjustl.md:3 msgid "Left adjust a string." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/adjustl.md:30 #: ../../doc/src/intrinsics/character/adjustr.md:31 msgid "Supported argument type is character." msgstr "" #: ../../doc/src/intrinsics/character/adjustr.md:1 msgid "adjustr(string): Right Adjust String" msgstr "" #: ../../doc/src/intrinsics/character/adjustr.md:3 msgid "Right adjust a string." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/adjustr.md:65 msgid "[adjustl](adjustl.md)." msgstr "" #: ../../doc/src/intrinsics/character/char.md:1 msgid "char(x, [, kind]): Integer to Character" msgstr "" #: ../../doc/src/intrinsics/character/char.md:3 msgid "Integer to character conversion." msgstr "" #: ../../doc/src/intrinsics/character/char.md:16 msgid "`x`: the input value of integer type." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/character/char.md:30 msgid "" "**char(x)** returns the character represented by the ASCII character set " "at `x` position." msgstr "" #: ../../doc/src/intrinsics/character/char.md:71 msgid "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:1 msgid "len_trim(string): Length Ignoring Trailing Blanks" msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:3 msgid "Length of a character string ignoring trailing blank character(s)." msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:16 msgid "`string` the input value of character type." msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:20 msgid "The return value is of type unsigned integer." 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 "" #: ../../doc/src/intrinsics/character/len_trim.md:29 msgid "Supported argument type is character scalar." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:1 msgid "lge(x, y): Lexically Greater or Equal" msgstr "" #: ../../doc/src/intrinsics/character/lge.md:3 msgid "Lexically greater than or equal." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:17 msgid "`x` input value of type character." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:19 msgid "`y` input value of type character." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:21 msgid "`x` and `y` can be seen as string A and string B." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:25 msgid "The return value is of logical `true` or `false` type." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:27 msgid "`True` if `x` string is lexically greater than or equal to `y`." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:29 msgid "`False` if they are not." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:33 msgid "" "**lge(x, y)** determines if input string `x` is lexically greater than or" " equal to input string `y`. The two strings in comparison are interpreted" " as containing ASCII character codes." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:39 msgid "Argument types should be of type character literal." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:81 msgid "[len_trim](len_trim.md)." msgstr "" #: ../../doc/src/intrinsics/kind-type.md:1 msgid "Kind Type Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:1 msgid "kind(x): Kind of an Entity" msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:3 msgid "Kind of an entity." 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 "" #: ../../doc/src/intrinsics/kind-type/kind.md:21 msgid "The return value is of integer type and of default integer kind." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:25 msgid "**kind(x)** returns the kind parameter of the input argument `x`." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:29 msgid "" "Supported argument types are logical, integer, real, complex, or " "character." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:81 #: ../../doc/src/intrinsics/misc/command_argument_count.md:16 #: ../../doc/src/intrinsics/misc/cpu_time.md:20 #: ../../doc/src/intrinsics/misc/date_and_time.md:41 #: ../../doc/src/intrinsics/misc/new_line.md:58 msgid "None." msgstr "" #: ../../doc/src/intrinsics/mathematical.md:1 msgid "Mathematical Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:1 msgid "acos(x): Trigonometric Arc Cosine" msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:3 msgid "Trigonometric arc cosine (inverse cosine) function." 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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:20 #: ../../doc/src/intrinsics/mathematical/acosh.md:21 #: ../../doc/src/intrinsics/mathematical/asin.md:20 #: ../../doc/src/intrinsics/mathematical/asinh.md:21 #: ../../doc/src/intrinsics/mathematical/atan.md:20 #: ../../doc/src/intrinsics/mathematical/atanh.md:21 msgid "" "The returned value has the kind of the input value and TYPE may be real " "or complex." msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:25 msgid "**acos(x)** computes the arcsine of the argument **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:33 #: ../../doc/src/intrinsics/mathematical/acosh.md:45 #: ../../doc/src/intrinsics/mathematical/asin.md:33 #: ../../doc/src/intrinsics/mathematical/asinh.md:37 #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:84 msgid "[asin](asin.md), [atan](atan.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:1 msgid "acosh(x): Inverse Hyperbolic Cosine" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:3 msgid "Inverse hyperbolic cosine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:16 #: ../../doc/src/intrinsics/mathematical/asinh.md:16 #: ../../doc/src/intrinsics/mathematical/atanh.md:16 msgid "" "`x` the input value, can be real with value greater than or equal to 1 or" " of type complex." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:26 msgid "**acosh(x)** computes the inverse hyperbolic cosine function of **x**." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acosh.md:33 msgid "$-\\pi <= img (acosh(x)) <= \\pi$" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:35 msgid "" "For real values $x$ in the domain $x > 1$, the inverse hyperbolic cosine " "satisifies:" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:38 msgid "$cosh^{-1}(x) = \\log(x + \\sqrt{(x^2 - 1)})$" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acosh.md:88 msgid "[asinh](asinh.md), [atanh](atanh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:1 msgid "asin(x): Trigonometric Arcsine" msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:3 msgid "Trigonometric arcsine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:25 msgid "**asin(x)** computes the arcsine of the argument **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/asin.md:84 msgid "[acos](acos.md), [atan](atan.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:1 msgid "asinh(x): Inverse Hyperbolic Arcsine" msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:3 msgid "Inverse hyperbolic arcsine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:26 msgid "**asinh(x)** computes the inverse hyperbolic arcsine function of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/asinh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (asinh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:80 msgid "[acosh](acosh.md), [atanh](atanh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:1 msgid "atan(x): Trigonometric ArcTangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:3 msgid "Trigonometric arctangent (inverse arctangent) function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:25 msgid "**atan(x)** computes the arctangent of the argument **x**." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:27 msgid "" "The arc tangent is the inverse function of the arctangent function. It is" " commonly used in trigonometry to find the angle when the lengths of the " "opposite side of a right triangle and base are known, i.e., perpendicular" " and base length." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:84 msgid "[asin](asin.md), [acos](acos.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:1 msgid "atan2(y, x): ArcTangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:3 msgid "Arctangent function or inverse tangent function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:15 msgid "`y` the input value is the imaginary part of the complex expression" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atan2.md:19 msgid "`x` the input value, must be real part of the complex expression." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atan2.md:29 msgid "" "**atan2(y, x)** computes the principal value of the argument function of " "the complex expression $x + iy$. This is used to transform from cartesian" " into polar coordinates and allows to determine the angle in the correct " "quadrant." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:33 msgid "It is also represented as:" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:35 msgid "$tan^{-1}(\\frac{y}{x})$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:37 msgid "If `x` is nonzero, the result lies in the range:" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:39 msgid "$-\\pi <= atan(x) <= \\pi$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:41 msgid "The sign is positive if `y` is positive." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:43 msgid "If `y` is zero and `x` is strictly positive, then the result is 0." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:45 msgid "If `x` is negative and `y` is positive zero, then the result is $\\pi$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:47 msgid "If `x` is negative and `y` is negative zero, then the result is $-\\pi$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:49 msgid "If `x` is zero, then the magnitude of the result is $\\frac{\\pi}{2}$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:51 msgid "If `y` is negative real zero, the result is $\\frac{-\\pi}{2}$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:55 #: ../../doc/src/intrinsics/mathematical/fraction.md:32 msgid "Supported argument type is real." msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:1 msgid "atanh(x): Inverse Hyperbolic Tangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:3 msgid "Inverse hyperbolic tangent function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:26 msgid "**atanh(x)** computes the inverse hyperbolic tangent function of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atanh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (atanh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:35 msgid "If the result is real, it lies in the range" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:37 msgid "$-1.0 < atanh(x) < 1.0$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:84 msgid "[asinh](asinh.md), [acosh](acosh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:1 msgid "fraction(x): Fractional Part in Model Representation" msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:3 msgid "Fractional part of the model representation." msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:15 msgid "`x` the input value, must be real." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/fraction.md:24 msgid "" "**fraction(x)** computes the fractional part of the model representation " "of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/fraction.md:28 msgid "$x * {radix(x)}^{(-exponent(x))}$" msgstr "" #: ../../doc/src/intrinsics/misc.md:1 msgid "Miscellaneous Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:1 msgid "command_argument_count(): Number of Command Line Arguments" msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:3 msgid "Get number of command line arguments." msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:20 msgid "The return value is of integer type and of default kind." 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 "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:29 msgid "Any." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:1 msgid "cpu_time(x): CPU Elapsed Time" msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:3 msgid "CPU elapsed time in seconds." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:16 msgid "`x` the input value should be of type real with `intent(out)`." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:24 msgid "" "**cpu_time(time)** returns a real value representing the elapsed CPU time" " in seconds. If tine source is available, time will be reported with " "microsecond resolution. If no time source is available, TIME is set to " "-1.0." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:28 msgid "This is useful for testing segments of code to determine computation time." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:1 msgid "date_and_time([date, time, zone, values]): Date and Time" msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:3 msgid "Date and time subroutine." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:22 msgid "" "`zone` the input value of character type, which has length 5 or larger. " "It is of default kind. It is `intent(out)` and has from `(+-)hhmm`, " "representing the difference with respect to Coordinates Universal Time " "(UTC). Unavailable time and date parameters return blanks." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:30 msgid "`value(1)`: The year." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:31 msgid "`value(2)`: The month." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:32 msgid "`value(3)`: The day of the month." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:33 msgid "`value(4)`: Time difference with UTC in minutes." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:34 msgid "`value(5)`: The hour of the day." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:35 msgid "`value(6)`: The minutes of the hour." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:36 msgid "`value(7)`: The seconds of the minutes." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:37 msgid "`value(8)`: The milliseconds of the second." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:51 msgid "Unavailable or errorneous date and time parameters return blanks." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:92 msgid "[cpu_time](cpu_time.md)." msgstr "" #: ../../doc/src/intrinsics/misc/new_line.md:1 msgid "new_line(x): New Line Character" msgstr "" #: ../../doc/src/intrinsics/misc/new_line.md:3 msgid "New line character." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/new_line.md:31 msgid "Supported input parameter types is character." msgstr "" #: ../../doc/src/intrinsics/numeric.md:1 msgid "Numeric Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:1 msgid "abs(x): Absolute Value" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:3 msgid "Absolute value." msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:17 msgid "`x` the input value, can be integer, real, or complex." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/abs.md:26 msgid "" "**abs(x)** calculates and returns absolute value of `x`. Result is " "calculated using mathematical formula:" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:29 msgid "$|x|$" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:31 msgid "If `x` is complex, the result is calculated using mathematical formula:" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:33 msgid "$\\sqrt{(x^2 + y^2)}$" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aimag.md:1 msgid "aimag(x): Imaginary Part" msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:3 msgid "Imaginary part of complex number." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:17 msgid "`x` the input value must be of complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:21 msgid "The return value is imaginary part of type real and kind same as of `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:25 msgid "**aimag(x)** returns the imaginary part of the input complex argument `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:27 #: ../../doc/src/intrinsics/numeric/cmplx.md:41 #: ../../doc/src/intrinsics/numeric/conjg.md:27 msgid "" "For `x` complex input value, the result is calculated using mathematical " "formula:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aimag.md:35 msgid "Supported argument types are complex." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:1 msgid "aint(x, [kind]): Truncate to a Whole Number" msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:3 msgid "Truncate to a whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:16 #: ../../doc/src/intrinsics/numeric/anint.md:16 #: ../../doc/src/intrinsics/numeric/epsilon.md:16 #: ../../doc/src/intrinsics/numeric/erf.md:16 #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aint.md:37 #: ../../doc/src/intrinsics/numeric/anint.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:31 #: ../../doc/src/intrinsics/numeric/erf.md:35 #: ../../doc/src/intrinsics/numeric/erfc.md:38 #: ../../doc/src/intrinsics/numeric/floor.md:35 #: ../../doc/src/intrinsics/numeric/gamma.md:40 msgid "Supported argument types is real." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:85 msgid "[ceiling](ceiling.md), [mod](mod.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:1 msgid "anint(x, [kind]): Round to Nearest Whole Number" msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:3 msgid "Round to nearest whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:25 msgid "The return value is equal to rounded whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:29 msgid "**anint(x)** calculates rounded value of input parameter `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/anint.md:34 msgid "If `x` is greater than 0, `anint(x)` returns `aint(x + 0.5)`." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:60 msgid "[aint](aint.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:1 msgid "ceiling(x): Integer Ceiling" msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:3 msgid "Integer ceiling function" msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:16 msgid "The input value `x` may be of type real or integer." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:20 msgid "The return value is of type integer and nearest greater integer." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:24 msgid "**ceiling(x)** returns the least integer greater than or equal to `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:28 msgid "Supported input parameter types are integer and real." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:66 msgid "[floor](floor.md), [mod](mod.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:1 msgid "cmplx(x [, [, kind]]): Convert to Complex" msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:3 msgid "Conversion to complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:14 msgid "`cmplx(x, y)` is one of the intrinsic present in ASR." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:18 msgid "" "`x` the input value must be of integer, real, or complex. `y` the " "optional input value must be of type integer or real. It should be only " "present in case `x` is not complex. `kind` the optional input value of " "integer expression type for initialisation indicating the kind parameter " "of the result." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/cmplx.md:32 msgid "" "**cmplx(x, [, y [, kind]])** converts the input value to complex " "representation:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/cmplx.md:37 msgid "If `y` is not present, the imaginary component is set to 0.0." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:39 msgid "If `x` is complex then `y` must not be present." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:49 msgid "Supported argument types are integer, real, or complex." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:1 msgid "conjg(x): Complex Conjugate" msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:3 msgid "Complex conjugate function." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:17 msgid "`x` the input value must be of type complex." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:21 msgid "The return value is of complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:25 msgid "**conjg(x)** converts the input value `x` to its conjugate." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:29 msgid "$x + iy$ converted to $x - iy$" msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:35 msgid "Supported argument types is complex." msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:1 msgid "digits(x): Significant Binary Digits" msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:3 msgid "Significant binary digits." msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:15 msgid "`x` the input value must be of type real or integer." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/dim.md:1 msgid "dim(x, y): Positive Difference or 0" msgstr "" #: ../../doc/src/intrinsics/numeric/dim.md:3 msgid "Positive difference or 0." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/dim.md:20 msgid "The return value is of type integer or real." 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 "" #: ../../doc/src/intrinsics/numeric/epsilon.md:1 msgid "epsilon(x): Epsilon" msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:3 msgid "Epsilon function." msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:20 msgid "The return value is of same type as of the input argument." msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:24 msgid "" "**epsilon(x)** computes the smallest number $\\epsilon$ of the same kind " "as `x` following:" msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:27 msgid "$1 + \\epsilon > 1$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:1 msgid "erf(x): Error" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:3 msgid "Error function." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/erf.md:27 msgid "$-1 \\leq erf (x) \\leq 1$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_0^xe^{-t^2}dt$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:69 msgid "[erfc](erfc.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:1 msgid "erfc(x): Complementary Error" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:3 msgid "Complementary error function." 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 "" #: ../../doc/src/intrinsics/numeric/erfc.md:27 msgid "$0 \\leq erf (x) \\leq 2$" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_{x}^{\\infty}e^{-t^2}dt$" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/erfc.md:72 msgid "[erf](erf.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:1 msgid "exp(x): Exponential" msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:3 msgid "Exponential function." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:16 msgid "`x` the input value must be of type real or complex." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:20 msgid "The return value is of same type as of the input argument, `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:24 msgid "**exp(x)** computes the base $e$ exponential of `x`, i.e., $e^x$." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/exp.md:31 msgid "Supported argument types is real and complex." msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:1 msgid "floor(x, kind): Integer Floor" msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:3 msgid "Integer floor function." msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:18 msgid "" "`kind` the optional input parameter must be a scalar integer constant " "expression." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:1 msgid "gamma(x): Gamma" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:3 msgid "Gamma function." 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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:21 msgid "The return value is of same type and kind as of `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:28 msgid "$\\gamma(x) = (x-1)!$" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:30 msgid "In general, if $x > 0$:" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:32 msgid "$\\gamma(x) = \\int_{0}^{\\infty} e^{-t} dt$" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:34 msgid "and if $-n-1 < x < -n$ where n is an integer >= 0:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:76 msgid "[epsilon](epsilon.md)" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:1 msgid "mod(x, y): Modulus" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:3 msgid "Modulus or remainder function." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:17 msgid "`x` the input value, can be integer or real." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/mod.md:27 msgid "`x - INT (x / y) * y`." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:29 msgid "If `y` is 0, the result is undefined like `any integer value / 0`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/mod.md:36 msgid "`x - INT(x / y) * y`" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:38 msgid "" "i.e., result is remainder when first argument is mathematically divided " "by second argument." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:41 msgid "The return value should be less than `y`." msgstr "" #: ../../doc/src/language.md:1 msgid "Fortran Language" msgstr "" #: ../../doc/src/language.md:3 msgid "Background and Motivation" msgstr "" #: ../../doc/src/language.md:5 msgid "" "Fortran was designed from the ground up to naturally and simply translate" " mathematics to code that compiles and runs at maximum speed. And being " "specifically targeted for such fundamentally computational tasks, it " "contains a broad range of key functionality within the language itself, " "standard across all platforms, with no need for external libraries that " "may or may not be well optimized or maintained, at present or down the " "road." msgstr "" #: ../../doc/src/language.md:12 msgid "Some highlights:" 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 "" #: ../../doc/src/language.md:17 msgid "" "Operators which operate naturally upon the aforementioned " "arrays/matrices, as they do scalars;" msgstr "" #: ../../doc/src/language.md:19 msgid "Complex numbers;" msgstr "" #: ../../doc/src/language.md:20 msgid "Special functions;" msgstr "" #: ../../doc/src/language.md:21 msgid "Structures and pointers for more general data representation." msgstr "" #: ../../doc/src/language.md:23 msgid "" "Because the essentials are contained in the language itself, it is simple" " to read and write, without need of choosing from among or deciphering a " "proliferation of external classes to do the same thing. And because the " "essentials are self-contained, compilers can provide detailed compile-" "time (e.g., argument mismatch) and run-time (e.g., memory access) checks," " as well as highly optimized executables, directly from natural, readable" " code without need of extensive optimization heroics by the developer." msgstr "" #: ../../doc/src/language.md:31 msgid "See our blog posts for more information:" msgstr "" #: ../../doc/src/language.md:33 msgid "" "[Why We Created LFortran](https://lfortran.org/blog/2019/04/why-we-" "created-lfortran/)" msgstr "" #: ../../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 "" #: ../../doc/src/language.md:36 msgid "How to Learn Fortran" msgstr "" #: ../../doc/src/language.md:38 msgid "" "Fortran is relatively quick to learn because it is so much simpler and " "smaller than C/C++ (in practice, that is, with all needed libraries " "included). If you are interested in learning more, please see our webpage" " at [fortran90.org] with recommended practices for writing code, side by " "side comparison with Python/NumPy, links to other online Fortran " "resources and books, and an FAQ." msgstr "" #: ../../doc/src/progress.md:3 msgid "" "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:" msgstr "" #: ../../doc/src/progress.md:7 msgid "AST: The code can be parsed to AST (`lfortran --show-ast test.f90`)" msgstr "" #: ../../doc/src/progress.md:8 msgid "ASR: The code can be transformed to ASR (`lfortran --show-asr test.f90`)" msgstr "" #: ../../doc/src/progress.md:9 msgid "LLVM: LFortran can generate LLVM IR (`lfortran --show-llvm test.f90`)" msgstr "" #: ../../doc/src/progress.md:10 msgid "BIN: The LLVM IR can compile to a binary" msgstr "" #: ../../doc/src/progress.md:11 msgid "RUN: The binary runs without errors" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:16 msgid "" "This page is generated automatically using the [Compiler " "Tester](https://gitlab.com/lfortran/compiler_tester) repository which " "contains all the Fortran tests and scripts to run LFortran to produce the" " tables below. We are looking for contributors to contribute more tests. " "Our goal is to have a comprehensive Fortran testsuite that can be used to" " test any Fortran compiler." msgstr "" #: ../../doc/src/progress.md:23 msgid "Testing the LFortran compiler version:" msgstr "" #: ../../doc/src/progress.md:32 msgid "Topics" msgstr "" #: ../../doc/src/progress.md:34 msgid "Full programs that compute something interesting" msgstr "" #: ../../doc/src/progress.md:36 msgid "Basic Numerics" msgstr "" #: ../../doc/src/progress.md:38 msgid "Directory: `tests/programs/numerics`" msgstr "" #: ../../doc/src/progress.md msgid "LLVM" msgstr "LLVM" #: ../../doc/src/progress.md msgid "BIN" msgstr "" #: ../../doc/src/progress.md msgid "RUN" msgstr "" #: ../../doc/src/progress.md msgid "Filename" msgstr "" #: ../../doc/src/progress.md msgid "`Pure Fortran sin(x) implementation`" msgstr "" #: ../../doc/src/progress.md msgid "✅" 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 "" #: ../../doc/src/progress.md:45 msgid "Modules" msgstr "" #: ../../doc/src/progress.md:47 msgid "Basic Usage" msgstr "" #: ../../doc/src/progress.md:49 msgid "Directory: `tests/modules/basic`" msgstr "" #: ../../doc/src/progress.md msgid "`Basic modules`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/basic/t01.f90)" msgstr "" #: ../../doc/src/progress.md:56 msgid "Module Functions and Subroutines" msgstr "" #: ../../doc/src/progress.md:58 msgid "Directory: `tests/modules/procedures`" msgstr "" #: ../../doc/src/progress.md msgid "`Module functions`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`Module subroutines`" msgstr "" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t02.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`Nested subroutines`" msgstr "" #: ../../doc/src/progress.md msgid "[t03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t03.f90)" msgstr "" #: ../../doc/src/progress.md:67 msgid "Expressions" msgstr "" #: ../../doc/src/progress.md:69 msgid "Arithmetic Operations" msgstr "" #: ../../doc/src/progress.md:71 msgid "Directory: `tests/expressions/arit`" msgstr "" #: ../../doc/src/progress.md msgid "`+,-,*,/,**`" msgstr "" #: ../../doc/src/progress.md msgid "[basic_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/arit/basic_operations.f90)" msgstr "" #: ../../doc/src/progress.md:78 msgid "Integers" msgstr "" #: ../../doc/src/progress.md:80 msgid "Directory: `tests/expressions/integers`" msgstr "" #: ../../doc/src/progress.md msgid "`integers`" msgstr "" #: ../../doc/src/progress.md msgid "[integer_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/integer_kind.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`relational operations`" 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 "" #: ../../doc/src/progress.md msgid "`logical operations`" 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 "" #: ../../doc/src/progress.md:89 msgid "Real Numbers" msgstr "" #: ../../doc/src/progress.md:91 msgid "Directory: `tests/expressions/reals`" msgstr "" #: ../../doc/src/progress.md msgid "`single/double reals`" msgstr "" #: ../../doc/src/progress.md msgid "[real_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/real_kind.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`defined operator`" msgstr "" #: ../../doc/src/progress.md msgid "âŒ" 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 "" #: ../../doc/src/progress.md:99 msgid "Complex Numbers" msgstr "" #: ../../doc/src/progress.md:101 msgid "Directory: `tests/expressions/complex`" msgstr "" #: ../../doc/src/progress.md msgid "`single/double complex`" msgstr "" #: ../../doc/src/progress.md msgid "[complex_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/complex/complex_kind.f90)" msgstr "" #: ../../doc/src/progress.md:108 msgid "Strings" msgstr "" #: ../../doc/src/progress.md:110 msgid "Directory: `tests/expressions/character`" msgstr "" #: ../../doc/src/progress.md msgid "`character`" msgstr "" #: ../../doc/src/progress.md msgid "[t01_character.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t01_character.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`string concatenation`" 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 "" #: ../../doc/src/progress.md:118 msgid "Derived Types" msgstr "" #: ../../doc/src/progress.md:120 msgid "Directory: `tests/expressions/derived_type`" msgstr "" #: ../../doc/src/progress.md msgid "`basic derived types`" 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 "" #: ../../doc/src/progress.md:127 msgid "Statements" msgstr "" #: ../../doc/src/progress.md:129 msgid "Allocate Statement" msgstr "" #: ../../doc/src/progress.md:131 msgid "Directory: `tests/statements/allocate`" msgstr "" #: ../../doc/src/progress.md msgid "`allocate statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/allocate/t01.f90)" msgstr "" #: ../../doc/src/progress.md:138 msgid "Block Statement" msgstr "" #: ../../doc/src/progress.md:140 msgid "Directory: `tests/statements/block`" msgstr "" #: ../../doc/src/progress.md msgid "`block statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/block/t01.f90)" msgstr "" #: ../../doc/src/progress.md:147 msgid "Goto Statement" msgstr "" #: ../../doc/src/progress.md:149 msgid "Directory: `tests/statements/goto`" msgstr "" #: ../../doc/src/progress.md msgid "`computed go-to statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`go-to statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t02.f90)" msgstr "" #: ../../doc/src/progress.md:157 msgid "If Statement" msgstr "" #: ../../doc/src/progress.md:159 msgid "Directory: `tests/statements/if`" msgstr "" #: ../../doc/src/progress.md msgid "`Test .false.`" msgstr "" #: ../../doc/src/progress.md msgid "[if_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`single line if statement`" msgstr "" #: ../../doc/src/progress.md msgid "[if_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_02.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`multi line if statement`" msgstr "" #: ../../doc/src/progress.md msgid "[if_03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_03.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`nested if statements`" msgstr "" #: ../../doc/src/progress.md msgid "[if_04.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_04.f90)" msgstr "" #: ../../doc/src/progress.md:169 msgid "While Statement" msgstr "" #: ../../doc/src/progress.md:171 msgid "Directory: `tests/statements/while`" msgstr "" #: ../../doc/src/progress.md msgid "`Simple while loops`" msgstr "" #: ../../doc/src/progress.md msgid "[while_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`exit / cycle in while loops`" msgstr "" #: ../../doc/src/progress.md msgid "[while_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_02.f90)" msgstr "" #: ../../doc/src/progress.md:179 msgid "Print Statement" msgstr "" #: ../../doc/src/progress.md:181 msgid "Directory: `tests/statements/print`" msgstr "" #: ../../doc/src/progress.md msgid "`Basic print`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/print/t01.f90)" msgstr "" #: ../../doc/src/progress.md:188 msgid "Open, Read, Write, Close Statement" msgstr "" #: ../../doc/src/progress.md:190 msgid "Directory: `tests/statements/file_io`" msgstr "" #: ../../doc/src/progress.md msgid "`open/read/write/close`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/file_io/t01.f90)" msgstr "" #: ../../doc/src/progress.md:197 msgid "Intrinsic Functions" msgstr "" #: ../../doc/src/progress.md:199 msgid "abs" msgstr "" #: ../../doc/src/progress.md:201 msgid "Directory: `tests/intrinsic/abs`" msgstr "" #: ../../doc/src/progress.md msgid "`scalar single/double real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md msgid "`scalar single/double complex`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md msgid "`array 1D single/double real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:210 msgid "exp" msgstr "" #: ../../doc/src/progress.md:212 msgid "Directory: `tests/intrinsic/exp`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:221 msgid "log" msgstr "" #: ../../doc/src/progress.md:223 msgid "Directory: `tests/intrinsic/log`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:232 msgid "sqrt" msgstr "" #: ../../doc/src/progress.md:234 msgid "Directory: `tests/intrinsic/sqrt`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:243 msgid "sin" msgstr "" #: ../../doc/src/progress.md:245 msgid "Directory: `tests/intrinsic/sin`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:254 msgid "cos" msgstr "" #: ../../doc/src/progress.md:256 msgid "Directory: `tests/intrinsic/cos`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:265 msgid "tan" msgstr "" #: ../../doc/src/progress.md:267 msgid "Directory: `tests/intrinsic/tan`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:276 msgid "sinh" msgstr "" #: ../../doc/src/progress.md:278 msgid "Directory: `tests/intrinsic/sinh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:287 msgid "cosh" msgstr "" #: ../../doc/src/progress.md:289 msgid "Directory: `tests/intrinsic/cosh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:298 msgid "tanh" msgstr "" #: ../../doc/src/progress.md:300 msgid "Directory: `tests/intrinsic/tanh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:309 msgid "asin" msgstr "" #: ../../doc/src/progress.md:311 msgid "Directory: `tests/intrinsic/asin`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:320 msgid "acos" msgstr "" #: ../../doc/src/progress.md:322 msgid "Directory: `tests/intrinsic/acos`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:331 msgid "atan" msgstr "" #: ../../doc/src/progress.md:333 msgid "Directory: `tests/intrinsic/atan`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:342 msgid "modulo" msgstr "" #: ../../doc/src/progress.md:344 msgid "Directory: `tests/intrinsic/modulo`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:352 msgid "mod" msgstr "" #: ../../doc/src/progress.md:354 msgid "Directory: `tests/intrinsic/mod`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:362 msgid "min" msgstr "" #: ../../doc/src/progress.md:364 msgid "Directory: `tests/intrinsic/min`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:371 msgid "max" msgstr "" #: ../../doc/src/progress.md:373 msgid "Directory: `tests/intrinsic/max`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:380 msgid "int" msgstr "" #: ../../doc/src/progress.md:382 msgid "Directory: `tests/intrinsic/int`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:389 msgid "real" msgstr "" #: ../../doc/src/progress.md:391 msgid "Directory: `tests/intrinsic/real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:398 msgid "floor" msgstr "" #: ../../doc/src/progress.md:400 msgid "Directory: `tests/intrinsic/floor`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:407 msgid "nint" msgstr "" #: ../../doc/src/progress.md:409 msgid "Directory: `tests/intrinsic/nint`" 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 "" lfortran-0.63.0/doc/locale/zh_CN/0000775000175000017500000000000015174404631016625 5ustar alastairalastairlfortran-0.63.0/doc/locale/zh_CN/LC_MESSAGES/0000775000175000017500000000000015174404631020412 5ustar alastairalastairlfortran-0.63.0/doc/locale/zh_CN/LC_MESSAGES/docs.po0000664000175000017500000061341015174404631021707 0ustar alastairalastair# SOME DESCRIPTIVE TITLE. # Copyright (C) 2022 LFortran contributors # This file is distributed under the same license as the LFortran package. # FIRST AUTHOR , 2022. # msgid "" 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-10-17 00:56+0000\n" "Last-Translator: Euler-37 <1943133009@qq.com>\n" "Language-Team: Chinese (Simplified) \n" "Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Weblate 4.15-dev\n" "Generated-By: Babel 2.10.3\n" #: ../../doc/src/ast_and_asr.ipynb:9 msgid "Difference between an AST and ASR" msgstr "AST å’Œ ASR 之间的区别" #: ../../doc/src/ast_and_asr.ipynb:11 msgid "Let us take a simple Fortran code:" msgstr "让我们看一个简å•çš„ Fortran 代ç ï¼š" #: ../../doc/src/ast_and_asr.ipynb:22 msgid "and look at how the AST and ASR looks like." msgstr "看看 AST å’Œ ASR 的样å­ã€‚" #: ../../doc/src/ast_and_asr.ipynb:25 ../../doc/src/progress.md msgid "AST" msgstr "AST" #: ../../doc/src/ast_and_asr.ipynb:76 msgid "" "The AST does not have any semantic information, but has nodes to " "represent declarations such as ``integer, intent(in) :: a``. Variables " "such as ``a`` are represented by a ``Name`` node, and are not connected " "to their declarations yet." msgstr "" "AST 没有任何语义信æ¯ï¼Œä½†å…·æœ‰è¡¨ç¤ºå£°æ˜Žçš„节点,例如 ``integer, intent(in) :: " "a``。诸如 ``a`` 之类的å˜é‡ç”± ``Name`` 节点表示,并且尚未连接到它们的声明。" #: ../../doc/src/ast_and_asr.ipynb:88 ../../doc/src/progress.md msgid "ASR" msgstr "ASR" #: ../../doc/src/ast_and_asr.ipynb:139 msgid "" "The ASR has all the semantic information (types, etc.), nodes like " "``Function`` have a symbol table and do not have any declaration nodes. " "Variables are simply pointers to the symbol table." msgstr "ASR 有所有的语义信æ¯ï¼ˆç±»åž‹ç­‰ï¼‰ï¼Œåƒ ``Function`` " "这样的节点有一个符å·è¡¨ï¼Œæ²¡æœ‰ä»»ä½•声明节点。å˜é‡åªæ˜¯æŒ‡å‘符å·è¡¨çš„æŒ‡é’ˆã€‚" #: ../../doc/src/ast_and_asr.ipynb:142 msgid "Discussion" msgstr "讨论" #: ../../doc/src/ast_and_asr.ipynb:144 msgid "" "The above was a simple example. Things get more apparent for more " "complicated examples, such as:" msgstr "ä¸Šé¢æ˜¯ä¸€ä¸ªç®€å•的例å­ã€‚å¯¹äºŽæ›´å¤æ‚的示例,事情å˜å¾—更加明显,例如:" #: ../../doc/src/ast_and_asr.ipynb:160 msgid "" "AST must represent all the ``use`` statements and the ``interface`` " "block, and keep things semantically consistent." msgstr "AST 必须代表所有的 ``use`` 语å¥å’Œ ``interface`` å—ï¼Œå¹¶ä¿æŒè¯­ä¹‰ä¸€è‡´ã€‚" #: ../../doc/src/ast_and_asr.ipynb:162 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" " are defined in the ``gfort_interop`` module, and so ASR does not have " "any of these declaration nodes." msgstr "" "å¦ä¸€æ–¹é¢ï¼ŒASR 跟踪符å·è¡¨ä¸­çš„ ``c_desc1_int32``ã€``c_desc1_t`` å’Œ " "``f2b_c_wrapper``,并且知é“它们是在 ``gfort_interop`` 模å—中定义的,因此 ASR " "没有任何这些声明节点。" #: ../../doc/src/ast_and_asr.ipynb:164 msgid "" "When converting from ASR to AST, LFortran will create all the appropriate" " AST declaration nodes automatically and correctly." msgstr "从 ASR 转æ¢ä¸º AST 时,LFortran 将自动且正确地创建所有适当的 AST 声明节点。" #: ../../doc/src/contributing.md:1 msgid "Contributing" msgstr "贡献" #: ../../doc/src/contributing.md:3 msgid "" "We welcome contributions from anyone, even if you are new to open source." " It might sound daunting to contribute to a compiler at first, but please" " do, it is not complicated. We will help you with any technical issues " "and help improve your contribution so that it can be merged." msgstr "" "我们欢迎任何人的贡献,å³ä½¿ä½ æ˜¯å¼€æºæ–°æ‰‹ã€‚èµ·åˆä¸ºç¼–译器åšè´¡çŒ®å¯èƒ½å¬èµ·æ¥ä»¤äººç”Ÿç•" ",但å¯ä»¥å°è¯•去åšï¼Œè¿™å¹¶ä¸å¤æ‚。我们将帮助你解决任何技术问题并帮助改进你的贡献" ",以便将其åˆå¹¶ã€‚" #: ../../doc/src/contributing.md:8 msgid "Basic Setup" msgstr "基本设置" #: ../../doc/src/contributing.md:10 msgid "To contribute, make sure your set up:" msgstr "è¦åšå‡ºè´¡çŒ®ï¼Œè¯·ç¡®ä¿ä½ çš„设置:" #: ../../doc/src/contributing.md:12 msgid "Your username + email" msgstr "你的用户å + 电å­é‚®ä»¶" #: ../../doc/src/contributing.md:13 msgid "Your `~/.gitconfig`" msgstr "ä½ çš„ `~/.gitconfig`" #: ../../doc/src/contributing.md:14 msgid "Your shell prompt to display the current branch name" msgstr "ä½ çš„ shell æç¤ºæ˜¾ç¤ºå½“å‰åˆ†æ”¯åç§°" #: ../../doc/src/contributing.md:16 msgid "Fork LFortran" msgstr "拉å–åˆ†å‰ LFortran" #: ../../doc/src/contributing.md:18 msgid "" "Step 1. Create a fork of the [project " "repository](https://github.com/lfortran/lfortran)" msgstr "步骤 1. 创建 [项目存储库](https://github.com/lfortran/lfortran) 的分支" #: ../../doc/src/contributing.md:20 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/" "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 克隆项目存储库并设置你的远程存储库" #: ../../doc/src/contributing.md:29 msgid "" ":fontawesome-solid-edit: `REMOTE_NAME` is the name of your remote " "repository and could be any name you like, for example your first name." msgstr ":fontawesome-solid-edit: `REMOTE_NAME` " "是你的远程仓库的å字,å¯ä»¥æ˜¯ä½ å–œæ¬¢çš„任何å字,例如你的å字。" #: ../../doc/src/contributing.md:31 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ï¼Œåº”è¯¥æ˜¯ä½ å¸æˆ·è·¯å¾„的一部分。" #: ../../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` æ£€æŸ¥æ–°è¿œç¨‹åœ°å€æ˜¯å¦è®¾ç½®æ­£ç¡®ã€‚" #: ../../doc/src/contributing.md:35 msgid "Send a New Merge Request" msgstr "å‘逿–°çš„åˆå¹¶è¯·æ±‚" #: ../../doc/src/contributing.md:37 msgid "Step 1. Create a new branch" msgstr "步骤 1. 创建一个新分支" #: ../../doc/src/contributing.md:42 msgid "Step 2. Make changes in relevant file(s)" msgstr "步骤 2. 更改相关文件" #: ../../doc/src/contributing.md:44 msgid "Step 3. Commit the changes:" msgstr "步骤 3. æäº¤æ›´æ”¹ï¼š" #: ../../doc/src/contributing.md:51 msgid "" "[Here](https://chris.beams.io/posts/git-commit/) are some great tips on " "writing good commit messages." 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 步:检查以确ä¿ä½ çš„æ›´æ”¹çœ‹èµ·æ¥ä¸é”™" #: ../../doc/src/contributing.md:58 msgid "Step 5. Send the merge request" msgstr "步骤 5. å‘é€åˆå¹¶è¯·æ±‚" #: ../../doc/src/contributing.md:64 msgid "" "The command will push the new branch `fix1` into your remote repository " "`REMOTE_NAME` that you created earlier. Additionally, it will also " "display a link that you can click on to open the new merge request. After" " clicking on the link, write a title and a concise description then click" " the \"Create\" button. Yay you are now all set." msgstr "" "该命令会将新分支 `fix1` 推é€åˆ°æ‚¨ä¹‹å‰åˆ›å»ºçš„远程存储库 `REMOTE_NAME` 中。此外," "它还将显示一个链接,你å¯ä»¥å•击该链接以打开新的åˆå¹¶è¯·æ±‚。å•击链接åŽï¼Œå†™ä¸‹æ ‡é¢˜" "和简明æè¿°ï¼Œç„¶åŽå•击 `创建` 按钮。是的,你现在一切就绪。" #: ../../doc/src/contributing.md:66 msgid "Add New Features" msgstr "添加新功能" #: ../../doc/src/contributing.md:68 msgid "" "The example below shows the steps it would take to create a caret binary " "operator **^** which computes the average value of the two operands." msgstr "下é¢çš„示例显示了创建æ’入符å·äºŒå…ƒè¿ç®—符 **^** " "所需的步骤,该è¿ç®—符计算两个æ“作数的平å‡å€¼ã€‚" #: ../../doc/src/contributing.md:70 msgid "Create New Token(s)" msgstr "创建新令牌" #: ../../doc/src/contributing.md:72 msgid "" "We extend the *tokenizer.re* as well as *parser.yy* to add the new token " "**^**. We also tell LFortran how to print the new token in *parser.cpp*." msgstr "" "我们扩展了 *tokenizer.re* å’Œ *parser.yy* 以添加新的令牌 **^**。我们还告诉 " "LFortran 如何在 *parser.cpp* ä¸­æ‰“å°æ–°æ ‡è®°ã€‚" #: ../../doc/src/contributing.md:75 msgid ":fontawesome-solid-code: *src/lfortran/parser/tokenizer.re*" msgstr ":fontawesome-solid-code: *src/lfortran/parser/tokenizer.re*" #: ../../doc/src/contributing.md:80 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.yy*" msgstr ":fontawesome-solid-code: *src/lfortran/parser/parser.yy*" #: ../../doc/src/contributing.md:85 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.cpp*" msgstr ":fontawesome-solid-code: *src/lfortran/parser/parser.cpp*" #: ../../doc/src/contributing.md:94 msgid "The added code is tested with `lfortran --show-tokens examples2/expr2.f90`" msgstr "添加的代ç ä½¿ç”¨ `lfortran --show-tokens examples2/expr2.f90` 进行测试" #: ../../doc/src/contributing.md:96 msgid "Parse the New Token" msgstr "è§£æžæ–°ä»¤ç‰Œ" #: ../../doc/src/contributing.md:98 msgid "" "Now we have to parse the new operator. We add it to the AST by extending " "the BinOp with a caret operator and modifying the *AST.asdl* file. Then " "we add it in *parse.yy* to properly parse and generate the new AST in " "*semantics.h*.Finally we extend *pickle.cpp* so that the new operator can" " print itself." msgstr "" "çŽ°åœ¨æˆ‘ä»¬å¿…é¡»è§£æž new è¿ç®—符。我们通过使用æ’入符è¿ç®—符扩展 BinOp 并修改 *AST." "asdl* 文件将其添加到 ASTã€‚ç„¶åŽæˆ‘们将它添加到 *parse.yy* 中以正确解æžå¹¶åœ¨ " "*semantics.h* ä¸­ç”Ÿæˆæ–°çš„ ASTã€‚æœ€åŽæˆ‘们扩展 *pickle.cpp* " "以便新的æ“作符å¯ä»¥æ‰“å°è‡ªå·±ã€‚" #: ../../doc/src/contributing.md:102 msgid ":fontawesome-solid-code:*grammar/AST.asdl*" msgstr ":fontawesome-solid-code:*grammar/AST.asdl*" #: ../../doc/src/contributing.md:107 msgid ":fontawesome-solid-code:*src/lfortran/parser/parser.yy*" msgstr ":fontawesome-solid-code:*src/lfortran/parser/parser.yy*" #: ../../doc/src/contributing.md:116 msgid ":fontawesome-solid-code:*src/lfortran/parser/semantics.h*" msgstr ":fontawesome-solid-code:*src/lfortran/parser/semantics.h*" #: ../../doc/src/contributing.md:121 msgid ":fontawesome-solid-code:*src/lfortran/pickle.cpp*" msgstr ":fontawesome-solid-code:*src/lfortran/pickle.cpp*" #: ../../doc/src/contributing.md:132 msgid "The section is tested with `lfortran --show-ast examples/expr2.f90`" msgstr "该部分使用 `lfortran --show-ast examples/expr2.f90` 进行测试" #: ../../doc/src/contributing.md:134 msgid "Implement the Semantics of the New Token" msgstr "实现新令牌的语义" #: ../../doc/src/contributing.md:136 msgid "" "We first extend the ASR in *ASR.asdl* and add ^ as a BinOp operator " "option." msgstr "我们首先在 *ASR.asdl* 中扩展 ASR,并添加 ^ 作为 BinOp è¿ç®—符选项。" #: ../../doc/src/contributing.md:138 msgid ":fontawesome-solid-code:*src/libasr/ASR.asdl*" msgstr ":fontawesome-solid-code:*src/libasr/ASR.asdl*" #: ../../doc/src/contributing.md:142 msgid ":fontawesome-solid-code:*src/lfortran/semantics/ast_common_visitor.h*" msgstr ":fontawesome-solid-code:*src/lfortran/semantics/ast_common_visitor.h*" #: ../../doc/src/contributing.md:179 msgid "" "Then we transform it from AST to ASR by extending " "*src/lfortran/semantics/ast_common_visitor.h*." msgstr "ç„¶åŽæˆ‘们通过扩展 *src/lfortran/semantics/ast_common_visitor.h* 将其从 AST " "转æ¢ä¸º ASR。" #: ../../doc/src/contributing.md:181 msgid "" "We also add it into compile time evaluation triggered by expressions such" " as `e = (2+3)^5` which is evaluated at compile time. An expression such " "as `e = x^5` is evaluated at run time only." msgstr "" "我们还将它添加到由表达å¼è§¦å‘的编译时评估中,例如在编译时评估的 `e = " "(2+3)^5`。诸如`e = x^5`之类的表达å¼ä»…在è¿è¡Œæ—¶è¿›è¡Œè¯„估。" #: ../../doc/src/contributing.md:183 msgid "The section is tested with `lfortran --show-asr examples/expr2.f90`" msgstr "该部分使用 `lfortran --show-asr examples/expr2.f90` 进行测试" #: ../../doc/src/contributing.md:184 msgid "Implement the New Token in LLVM" msgstr "在 LLVM 中实现新令牌" #: ../../doc/src/contributing.md:186 msgid "" "To implement in LLVM, we extend the BinOp translation by handling the new" " operator. We first add the two numbers then divide by two. :fontawesome-" "solid-code:*src/lfortran/codegen/asr_to_llvm.cpp*" msgstr "" "为了在 LLVM ä¸­å®žçŽ°ï¼Œæˆ‘ä»¬é€šè¿‡å¤„ç† new è¿ç®—ç¬¦æ¥æ‰©å±• BinOp " "转æ¢ã€‚我们首先将两个数字相加,然åŽé™¤ä»¥ 2。 :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 "该部分使用 `lfortran --show-llvm examples/expr2.f90` 进行测试" #: ../../doc/src/contributing.md:219 msgid "Now when LLVM works, we can test the final executable by:" msgstr "现在当 LLVM 工作时,我们å¯ä»¥é€šè¿‡ä»¥ä¸‹æ–¹å¼æµ‹è¯•æœ€ç»ˆçš„å¯æ‰§è¡Œæ–‡ä»¶ï¼š" #: ../../doc/src/contributing.md:224 msgid "And it should print 6." msgstr "å®ƒåº”è¯¥æ‰“å° 6。" #: ../../doc/src/contributing.md:226 msgid "It also works interactively:" msgstr "它还å¯ä»¥äº¤äº’工作:" #: ../../doc/src/contributing.md:242 msgid "Reach Out" msgstr "得到" #: ../../doc/src/contributing.md:244 msgid "" "If you have any questions or need help, please ask as at our " "[mailinglist](https://groups.io/g/lfortran) or a " "[chat](https://lfortran.zulipchat.com/)." msgstr "" "如果你有任何问题或需è¦å¸®åŠ©ï¼Œè¯·é€šè¿‡æˆ‘ä»¬çš„ [mailinglist](https://groups.io/g/" "lfortran) 或 [chat](https://lfortran.zulipchat.com/) æé—®ã€‚" #: ../../doc/src/contributing.md:248 msgid "" "Please note that all participants of this project are expected to follow " "our Code of Conduct. By participating in this project you agree to abide " "by its terms. See " "[CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/blob/main/CODE_OF_CONDUCT.md)." msgstr "" "请注æ„,该项目的所有å‚与者都应éµå®ˆæˆ‘们的行为准则。å‚与本项目å³è¡¨ç¤ºä½ åŒæ„éµå®ˆ" "å…¶æ¡æ¬¾ã€‚请å‚阅 [CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/" "blob/main/CODE_OF_CONDUCT.md)。" #: ../../doc/src/contributing.md:252 msgid "" "By submitting a PR you agree to license your contribution under the " "LFortran's BSD " "[license](https://github.com/lfortran/lfortran/blob/main/LICENSE) unless " "explicitly noted otherwise." msgstr "" "通过æäº¤ PRï¼Œä½ åŒæ„æ ¹æ® LFortran çš„ BSD [许å¯](https://github.com/lfortran/" "lfortran/blob/main/LICENSE) 许å¯ä½ çš„贡献,除éžå¦æœ‰æ˜Žç¡®è¯´æ˜Žã€‚" #: ../../doc/src/design.md:1 msgid "LFortran Design" msgstr "LFortran Design" #: ../../doc/src/design.md:3 msgid "High Level Overview" msgstr "高级概述" #: ../../doc/src/design.md:5 ../../doc/src/developer_tutorial.ipynb:16 msgid "" "LFortran is structured around two independent modules, AST and ASR, both " "of which are standalone (completely independent of the rest of LFortran) " "and users are encouraged to use them independently for other applications" " and build tools on top:" msgstr "" "LFortran å›´ç»•ä¸¤ä¸ªç‹¬ç«‹çš„æ¨¡å— AST å’Œ ASR 构建,这两个模å—都是独立的(" "完全独立于 LFortran " "的其余部分),鼓励用户将它们独立用于其他应用程åºå¹¶åœ¨å…¶ä¸Šæž„建工具:" #: ../../doc/src/design.md:10 msgid "" "Abstract Syntax Tree (AST), module `lfortran.ast`: Represents any Fortran" " source code, strictly based on syntax, no semantic is included. The AST " "module can convert itself to Fortran source code." msgstr "" "抽象语法树 (AST)ï¼Œæ¨¡å— `lfortran.ast`:表示任何 Fortran " "æºä»£ç ï¼Œä¸¥æ ¼åŸºäºŽè¯­æ³•,ä¸åŒ…å«è¯­ä¹‰ã€‚ AST 模å—å¯ä»¥å°†è‡ªèº«è½¬æ¢ä¸º Fortran æºä»£ç ã€‚" #: ../../doc/src/design.md:14 msgid "" "Abstract Semantic Representation (ASR), module `lfortran.asr`: Represents" " a valid Fortran source code, all semantic is included. Invalid Fortran " "code is not allowed (an error will be given). The ASR module can convert " "itself to an AST." msgstr "" "抽象语义表示 (ASR)ï¼Œæ¨¡å— `lfortran.asr`:表示有效的 Fortran " "æºä»£ç ï¼ŒåŒ…括所有语义。ä¸å…许使用无效的 Fortran 代ç ï¼ˆå°†ç»™å‡ºé”™è¯¯ï¼‰ã€‚ ASR " "模å—å¯ä»¥å°†è‡ªèº«è½¬æ¢ä¸º AST。" #: ../../doc/src/design.md:19 msgid "" "The LFortran compiler is then composed of the following independent " "stages:" msgstr "LFortran 编译器由以下独立阶段组æˆï¼š" #: ../../doc/src/design.md:21 msgid "Parsing: converts Fortran source code to an AST" msgstr "è§£æžï¼šå°† Fortran æºä»£ç è½¬æ¢ä¸º AST" #: ../../doc/src/design.md:22 msgid "Semantic: converts an AST to an ASR" msgstr "语义:将 AST 转æ¢ä¸º ASR" #: ../../doc/src/design.md:23 msgid "" "High level optimizations: optimize ASR to a possibly faster/simpler ASR " "(things like inlining functions, eliminating redundant expressions or " "statements, etc.)" msgstr "高级优化:将 ASR 优化为å¯èƒ½æ›´å¿«/更简å•çš„ " "ASR(内è”å‡½æ•°ã€æ¶ˆé™¤å†—ä½™è¡¨è¾¾å¼æˆ–语å¥ç­‰ï¼‰" #: ../../doc/src/design.md:26 msgid "" "LLVM IR code generation and lower level optimizations: converts an ASR to" " an LLVM IR. This stage also does all other optimizations that do not " "produce an ASR, but still make sense to do before passing to LLVM IR." msgstr "" "LLVM IR 代ç ç”Ÿæˆå’Œè¾ƒä½Žçº§åˆ«çš„优化:将 ASR 转æ¢ä¸º LLVM IR。" "此阶段还执行所有其他ä¸äº§ç”Ÿ ASR,但在传递给 LLVM IR 之å‰ä»ç„¶æœ‰æ„义的优化。" #: ../../doc/src/design.md:29 msgid "" "Machine code generation: LLVM then does all its optimizations and " "generates machine code (such as a binary executable, a library, an object" " file, or it is loaded and executed using JIT as part of the interactive " "LFortran session or in a Jupyter kernel)." msgstr "" "机器代ç ç”Ÿæˆï¼šLLVM " "ç„¶åŽè¿›è¡Œæ‰€æœ‰ä¼˜åŒ–å¹¶ç”Ÿæˆæœºå™¨ä»£ç ï¼ˆä¾‹å¦‚äºŒè¿›åˆ¶å¯æ‰§è¡Œæ–‡ä»¶ã€åº“ã€ç›®æ ‡æ–‡ä»¶ï¼Œæˆ–者使用 " "JIT ä½œä¸ºäº¤äº’å¼ LFortran 会è¯çš„一部分或在 Jupyter 内核中加载和执行)。" #: ../../doc/src/design.md:34 msgid "" "LFortran is structured as a library, and so one can for example use the " "parser to obtain an AST and do something with it, or one can then use the" " semantic analyzer to obtain ASR and do something with it. One can " "generate the ASR directly (e.g., from SymPy) and then either convert to " "AST and to a Fortran source code, or use LFortran to compile it to " "machine code directly. In other words, one can use LFortran to easily " "convert between the three equivalent representations:" msgstr "" "LFortran 被构造为一个库,因此å¯ä»¥ä½¿ç”¨è§£æžå™¨èŽ·å– AST 并对其进行处ç†ï¼Œ" "或者然åŽå¯ä»¥ä½¿ç”¨è¯­ä¹‰åˆ†æžå™¨èŽ·å– ASR 并对其进行处ç†ã€‚å¯ä»¥ç›´æŽ¥ç”Ÿæˆ ASR(例如," "从 SymPy),然åŽè½¬æ¢ä¸º AST å’Œ Fortran æºä»£ç ï¼Œæˆ–者使用 LFortran " "直接将其编译为机器代ç ã€‚æ¢å¥è¯è¯´ï¼Œå¯ä»¥ä½¿ç”¨ LFortran " "在三ç§ç­‰æ•ˆè¡¨ç¤ºä¹‹é—´è½»æ¾è½¬æ¢ï¼š" #: ../../doc/src/design.md:42 msgid "Fortran source code" msgstr "Fortran æºä»£ç " #: ../../doc/src/design.md:43 ../../doc/src/developer_tutorial.ipynb:23 msgid "Abstract Syntax Tree (AST)" msgstr "抽象语法树 (AST)" #: ../../doc/src/design.md:44 ../../doc/src/developer_tutorial.ipynb:159 msgid "Abstract Semantic Representation (ASR)" msgstr "抽象语义表示 (ASR)" #: ../../doc/src/design.md:46 msgid "They are all equivalent in the following sense:" msgstr "它们在以下æ„义上都是等价的:" #: ../../doc/src/design.md:48 msgid "Any ASR can always be converted to an equivalent AST" msgstr "任何 ASR 始终å¯ä»¥è½¬æ¢ä¸ºç­‰æ•ˆçš„ AST" #: ../../doc/src/design.md:49 msgid "Any AST can always be converted to an equivalent Fortran source code" msgstr "任何 AST 始终å¯ä»¥è½¬æ¢ä¸ºç­‰æ•ˆçš„ Fortran æºä»£ç " #: ../../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 "任何 Fortran æºä»£ç æ€»æ˜¯å¯ä»¥è½¬æ¢ä¸ºç­‰æ•ˆçš„ AST 或出现语法错误" #: ../../doc/src/design.md:52 msgid "" "Any AST can always be either converted to an equivalent ASR or one gets a" " semantic error" msgstr "任何 AST 总是å¯ä»¥è½¬æ¢ä¸ºç­‰æ•ˆçš„ ASR 或者出现语义错误" #: ../../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 "因此,当å¯ä»¥è¿›è¡Œè½¬æ¢æ—¶ï¼Œå®ƒä»¬æ˜¯ç­‰æ•ˆçš„,并且除éžä»£ç æ— æ•ˆï¼Œå¦åˆ™å§‹ç»ˆå¯ä»¥è¿›è¡Œè½¬æ¢" "。" #: ../../doc/src/design.md:58 msgid "ASR Design Details" msgstr "ASR 设计细节" #: ../../doc/src/design.md:60 msgid "The ASR is designed to have the following features:" msgstr "ASR 旨在具有以下功能:" #: ../../doc/src/design.md:62 msgid "" "ASR is still semantically equivalent to the original Fortran code (it did" " not lose any semantic information). ASR can be converted to AST, and AST" " to Fortran source code which is functionally equivalent to the original." msgstr "" "ASR 在语义上ä»ç„¶ç­‰åŒäºŽåŽŸå§‹ Fortran 代ç ï¼ˆå®ƒæ²¡æœ‰ä¸¢å¤±ä»»ä½•语义信æ¯ï¼‰ã€‚ ASR " "å¯ä»¥è½¬æ¢ä¸º AST,AST å¯ä»¥è½¬æ¢ä¸º Fortran æºä»£ç ï¼Œåœ¨åŠŸèƒ½ä¸Šä¸ŽåŽŸå§‹ä»£ç ç›¸åŒã€‚" #: ../../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 "ASR å°½å¯èƒ½ç®€å•:它ä¸åŒ…å«ä»»ä½•无法从 ASR 推断出的信æ¯ã€‚" #: ../../doc/src/design.md:69 msgid "" "The ASR C++ classes (down the road) are designed similarly to SymEngine: " "they are constructed once and after that they are immutable. The " "constructor checks in Debug more that all the requirements are met (e.g.," " that all Variables in a Function have a dummy argument set, that " "explicit-shape arrays are not allocatable and all other Fortran " "requirements to make it a valid code), but in Release mode it quickly " "constructs the class without checks. Then there are builder classes that " "construct the ASR C++ classes to meet requirements (checked in Debug " "mode) and the builder gives an error message if a code is not a valid " "Fortran code, and if it doesn't give an error message, then the ASR C++ " "classes are constructed correctly. Thus by construction, the ASR classes " "always contain valid Fortran code and the rest of LFortran can depend on " "it." msgstr "" "ASR C++ 类(未æ¥ï¼‰çš„设计类似于 " "SymEngine:它们被构造一次,之åŽå®ƒä»¬æ˜¯ä¸å¯å˜çš„。构造函数在 Debug " "ä¸­æ£€æŸ¥æ˜¯å¦æ»¡è¶³æ‰€æœ‰è¦æ±‚(例如,函数中的所有å˜é‡éƒ½æœ‰ä¸€ä¸ªè™šæ‹Ÿå‚数集," "显å¼å½¢çŠ¶æ•°ç»„ä¸å¯åˆ†é…ä»¥åŠæ‰€æœ‰å…¶ä»– Fortran " "è¦æ±‚使其æˆä¸ºæœ‰æ•ˆä»£ç ï¼‰ï¼Œä½†åœ¨å‘布模å¼å®ƒæ— éœ€æ£€æŸ¥å³å¯å¿«é€Ÿæž„å»ºç±»ã€‚ç„¶åŽæ˜¯æž„建 ASR " "C++ ç±»ä»¥æ»¡è¶³è¦æ±‚的构建器类(在调试模å¼ä¸‹æ£€æŸ¥ï¼‰ï¼Œå¦‚果代ç ä¸æ˜¯æœ‰æ•ˆçš„ Fortran " "代ç ï¼Œæž„建器会给出错误消æ¯ï¼Œå¦‚果它没有给出错误消æ¯ï¼Œåˆ™ ASR C++ " "类构造正确。因此,通过构造,ASR ç±»æ€»æ˜¯åŒ…å«æœ‰æ•ˆçš„ Fortran 代ç ï¼Œè€Œ LFortran " "的其余部分å¯ä»¥ä¾èµ–它。" #: ../../doc/src/design.md:82 msgid "Notes:" msgstr "注æ„:" #: ../../doc/src/design.md:84 msgid "" "Information that is lost when parsing source to AST: whitespace, " "multiline/single line if statement distinction, case sensitivity of " "keywords." msgstr "å°†æºè§£æžä¸º AST 时丢失的信æ¯ï¼šç©ºæ ¼ã€å¤šè¡Œ/å•行 if " "语å¥åŒºåˆ†ã€å…³é”®å­—的区分大å°å†™ã€‚" #: ../../doc/src/design.md:87 msgid "" "Information that is lost when going from AST to ASR: detailed syntax how " "variables were defined and the order of type attributes (whether array " "dimension is using the `dimension` attribute, or parentheses at the " "variable; or how many variables there are per declaration line or their " "order), as ASR only represents the aggregated type information in the " "symbol table." msgstr "" "从 AST 到 ASR 时丢失的信æ¯ï¼šå¦‚何定义å˜é‡çš„详细语法以åŠç±»åž‹å±žæ€§çš„顺åºï¼ˆ" "数组维度是å¦ä½¿ç”¨ `dimension` " "属性,或å˜é‡å¤„的括å·ï¼›æˆ–æ¯ä¸ªå£°æ˜Žè¡Œæœ‰å¤šå°‘个å˜é‡æˆ–它们的顺åºï¼‰ï¼Œå› ä¸º ASR " "仅表示符å·è¡¨ä¸­çš„èšåˆç±»åž‹ä¿¡æ¯ã€‚" #: ../../doc/src/design.md:90 msgid "" "ASR is the simplest way to generate Fortran code, as one does not have to" " worry about the detailed syntax (as in AST) about how and where things " "are declared. One specifies the symbol table for a module, then for each " "symbol (functions, global variables, types, ...) one specifies the local " "variables and if this is an interface then one needs to specify where one" " can find an implementation, otherwise a body is supplied with " "statements, those nodes are almost the same as in AST, except that each " "variable is just a reference to a symbol in the symbol table (so by " "construction one cannot have undefined variables). The symbol table for " "each node such as Function or Module also references its parent (for " "example a function references a module, a module references the global " "scope)." msgstr "" "ASR æ˜¯ç”Ÿæˆ Fortran " "代ç çš„æœ€ç®€å•方法,因为ä¸å¿…担心关于如何以åŠåœ¨ä½•处声明事物的详细语法(如在 AST " "ä¸­ï¼‰ã€‚ä¸€ä¸ªä¸ºæ¨¡å—æŒ‡å®šç¬¦å·è¡¨ï¼Œç„¶åŽä¸ºæ¯ä¸ªç¬¦å·ï¼ˆå‡½æ•°ã€å…¨å±€å˜é‡ã€ç±»åž‹â€¦â€¦ï¼‰æŒ‡å®šå±€éƒ¨" "å˜é‡ï¼Œå¦‚果这是一个接å£ï¼Œåˆ™éœ€è¦æŒ‡å®šåœ¨å“ªé‡Œå¯ä»¥æ‰¾åˆ°å®žçŽ°ï¼Œå¦åˆ™ä¸ºbody æä¾›äº†è¯­å¥ï¼Œ" "这些节点与 AST 中的几乎相åŒï¼Œé™¤äº†æ¯ä¸ªå˜é‡åªæ˜¯å¯¹ç¬¦å·è¡¨ä¸­çš„符å·çš„引用(因此通过" "构造一个ä¸èƒ½æœ‰æœªå®šä¹‰çš„å˜é‡ï¼‰ã€‚æ¯ä¸ªèŠ‚ç‚¹ï¼ˆä¾‹å¦‚ Function 或 " "Module)的符å·è¡¨ä¹Ÿå¼•用其父节点(例如,函数引用模å—,模å—引用全局作用域)。" #: ../../doc/src/design.md:102 msgid "" "The ASR can be directly converted to an AST without gathering any other " "information. And the AST directly to Fortran source code." msgstr "ASR å¯ä»¥ç›´æŽ¥è½¬æ¢ä¸º AST,而无需收集任何其他信æ¯ã€‚而AST直接转为Fortranæºä»£ç ã€‚" #: ../../doc/src/design.md:105 msgid "" "The ASR is always representing a semantically valid Fortran code. This " "is enforced by checks in the ASR C++ constructors (in Debug build). When " "an ASR is used, one can assume it is valid." msgstr "" "ASR 始终表示语义上有效的 Fortran 代ç ã€‚这是通过检查 ASR C++ " "构造函数(在调试版本中)æ¥å¼ºåˆ¶æ‰§è¡Œçš„。当使用 ASR 时,å¯ä»¥å‡å®šå®ƒæ˜¯æœ‰æ•ˆçš„。" #: ../../doc/src/design.md:109 msgid "Fortran 2008" msgstr "Fortran 2008" #: ../../doc/src/design.md:111 msgid "" "Fortran 2008 [standard](https://j3-fortran.org/doc/year/10/10-007.pdf) " "chapter 2 \"Fortran concepts\" specifies that Fortran code is a " "collection of _program units_ (either all in one file, or in separate " "files), where each _program unit_ is one of:" msgstr "" "Fortran 2008 [标准](https://j3-fortran.org/doc/year/10/10-007.pdf) 第 2 章“" "Fortran æ¦‚å¿µâ€æŒ‡å®š Fortran ä»£ç æ˜¯_程åºå•å…ƒ_的集åˆï¼ˆå…¨éƒ¨åœ¨ä¸€ä¸ªæ–‡ä»¶ä¸­ï¼‰ " ",或在å•独的文件中),其中æ¯ä¸ª _程åºå•å…ƒ_ 是以下之一:" #: ../../doc/src/design.md:116 ../../doc/src/design.md:131 msgid "main program" msgstr "主程åº" #: ../../doc/src/design.md:117 ../../doc/src/design.md:132 msgid "module or submodule" msgstr "æ¨¡å—æˆ–å­æ¨¡å—" #: ../../doc/src/design.md:118 ../../doc/src/design.md:133 msgid "function or subroutine" msgstr "函数或å­ç¨‹åº" #: ../../doc/src/design.md:120 msgid "" "Note: It can also be a _block data_ program unit, that is used to provide" " initial values for data objects in named _common blocks_, but we do not " "recommend the use of _common blocks_ (use modules instead)." msgstr "" "注æ„:它也å¯ä»¥æ˜¯_block data_程åºå•元,用于为命åçš„_common " "blocks_中的数æ®å¯¹è±¡æä¾›åˆå§‹å€¼ï¼Œä½†æˆ‘们ä¸å»ºè®®ä½¿ç”¨_common blocks_(改用模å—)。" #: ../../doc/src/design.md:124 msgid "LFortran Extension" msgstr "LFortran 扩展" #: ../../doc/src/design.md:126 msgid "" "We extend the Fortran language by introducing a _global scope_, which is " "not only the list of _program units_ (as in F2008) but can also include " "statements, declarations, use statements and expressions. We define " "_global scope_ as a collection of the following items:" msgstr "" "我们通过引入_全局作用域_æ¥æ‰©å±• Fortran 语言,它ä¸ä»…是_程åºå•å…ƒ_列表(如 " "F2008 中),还å¯ä»¥åŒ…括语å¥ã€å£°æ˜Žã€ä½¿ç”¨è¯­å¥å’Œè¡¨è¾¾å¼ã€‚我们将_全局作用域_定义为" "以下项目的集åˆï¼š" #: ../../doc/src/design.md:134 msgid "use statement" msgstr "使用声明" #: ../../doc/src/design.md:135 msgid "declaration" msgstr "声明" #: ../../doc/src/design.md:136 msgid "statement" msgstr "声明" #: ../../doc/src/design.md:137 msgid "expression" msgstr "表达" #: ../../doc/src/design.md:139 msgid "" "In addition, if a variable is not defined in an assignment statement " "(such as `x = 5+3`) then the type of the variable is inferred from the " "right hand side (e.g., `x` in `x = 5+3` would be of type `integer`, and " "`y` in `y = 5._dp` would be of type `real(dp)`). This rule only applies " "at the top level of _global scope_. Types must be fully specified inside " "main programs, modules, functions and subroutines, just like in F2008." msgstr "" "此外,如果å˜é‡æ²¡æœ‰åœ¨èµ‹å€¼è¯­å¥ä¸­å®šä¹‰ï¼ˆä¾‹å¦‚`x = " "5+3`),则从å³ä¾§æŽ¨æ–­å˜é‡çš„类型(例如,`x` in `x = 5+3 ` 将是 `integer` 类型," "而 `y = 5._dp` 中的 `y` 将是 `real(dp)` 类型)。此规则仅适用于 _全局作用域_ " "的顶层。类型必须在主程åºã€æ¨¡å—ã€å‡½æ•°å’Œå­ç¨‹åºä¸­å®Œå…¨æŒ‡å®šï¼Œå°±åƒåœ¨ F2008 中一样。" #: ../../doc/src/design.md:146 msgid "" "The _global scope_ has its own symbol table. The main program and " "module/submodule do not see any symbols from this symbol table. But " "functions, subroutines, statements and expressions at the top level of " "_global scope_ use and operate on this symbol table." msgstr "" "_全局作用域_ 有自己的符å·è¡¨ã€‚主程åºå’Œæ¨¡å—/å­æ¨¡å—看ä¸åˆ°æ­¤ç¬¦å·è¡¨ä¸­çš„任何符å·ã€‚" "但是_全局作用域_顶层的函数ã€å­ä¾‹ç¨‹ã€è¯­å¥å’Œè¡¨è¾¾å¼ä½¿ç”¨å’Œæ“作这个符å·è¡¨ã€‚" #: ../../doc/src/design.md:151 msgid "" "The _global scope_ has the following symbols predefined in the symbol " "table:" msgstr "_全局作用域_ 在符å·è¡¨ä¸­é¢„定义了以下符å·ï¼š" #: ../../doc/src/design.md:153 msgid "" "the usual standard set of Fortran functions (such as `size`, `sin`, " "`cos`, ...)" msgstr "通常的标准 Fortran 函数集(例如 `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 "`dp` åŒç²¾åº¦ç¬¦å·ï¼Œå› æ­¤å¯ä»¥ä½¿ç”¨ `5._dp` 表示åŒç²¾åº¦ã€‚" #: ../../doc/src/design.md:158 msgid "" "Each item in the _global scope_ is interpreted as follows: main program " "is compiled into an executable with the same name and executed; modules, " "functions and subroutines are compiled and loaded; use statement and " "declaration adds those symbols with the proper type into the _global " "scope_ symbol table, but do not generate any code; statement is wrapped " "into an anonymous subroutine with no arguments, compiled, loaded and " "executed; expression is wrapped into an anonymous function with no " "arguments returning the expression, compiled, loaded, executed and the " "return value is returned to the user." msgstr "" "_全局作用域_中的æ¯ä¸€é¡¹è§£é‡Šå¦‚下:主程åºç¼–译æˆåŒå坿‰§è¡Œæ–‡ä»¶å¹¶æ‰§è¡Œï¼›ç¼–译和加载" "模å—ã€å‡½æ•°å’Œå­ç¨‹åºï¼› use 语å¥å’Œå£°æ˜Žå°†é‚£äº›å…·æœ‰æ­£ç¡®ç±»åž‹çš„ç¬¦å·æ·»åŠ åˆ°_全局作用域_" "符å·è¡¨ä¸­ï¼Œä½†ä¸ç”Ÿæˆä»»ä½•代ç ï¼›è¯­å¥è¢«åŒ…è£…åˆ°ä¸€ä¸ªæ²¡æœ‰å‚æ•°çš„匿åå­ä¾‹ç¨‹ä¸­ï¼Œç¼–译ã€åŠ " "载和执行;表达å¼è¢«åŒ…装到一个匿åå‡½æ•°ä¸­ï¼Œæ²¡æœ‰å‚æ•°è¿”回表达å¼ï¼Œç¼–译ã€åŠ è½½ã€æ‰§è¡Œ" "并将返回值返回给用户。" #: ../../doc/src/design.md:168 msgid "" "The _global scope_ is always interpreted, item by item, per the previous " "paragraph. It is meant to allow interactive usage, experimentations and " "writing simple scripts. Code in _global scope_ must be interpreted using " "`lfortran`. For more complex (production) code it is recommended to turn " "it into modules and programs (by wrapping loose statements into " "subroutines or functions and by adding type declarations) and compile it " "with `lfortran` or any other Fortran compiler." msgstr "" "_全局作用域_ " "总是按照上一段é€é¡¹è§£é‡Šã€‚它旨在å…许交互å¼ä½¿ç”¨ã€å®žéªŒå’Œç¼–写简å•的脚本。 " "_全局作用域_ 中的代ç å¿…须使用 `lfortran` è§£é‡Šã€‚å¯¹äºŽæ›´å¤æ‚的(生产)代ç ï¼Œå»ºè®®" "将其转æ¢ä¸ºæ¨¡å—和程åºï¼ˆé€šè¿‡å°†æ¾æ•£çš„语å¥åŒ…装æˆå­ä¾‹ç¨‹æˆ–函数并添加类型声明)" "并使用 `lfortran` 或任何其他 Fortran 编译器对其进行编译。" #: ../../doc/src/design.md:176 msgid "Here are some examples of valid code in _global scope_:" msgstr "以下是 _全局作用域_ 中的一些有效代ç ç¤ºä¾‹ï¼š" #: ../../doc/src/design.md:178 msgid "Example 1" msgstr "示例 1" #: ../../doc/src/design.md:185 msgid "Example 2" msgstr "示例 2" #: ../../doc/src/design.md:197 msgid "Example 3" msgstr "示例 3" #: ../../doc/src/design.md:209 msgid "Example 4" msgstr "示例 4" #: ../../doc/src/design.md:217 msgid "Design Considerations" msgstr "设计注æ„事项" #: ../../doc/src/design.md:219 msgid "" "The LFortran extension of Fortran was chosen in a way so as to minimize " "the number of changes. In particular, only the top level of the _global " "scope_ has relaxed some of the Fortran rules (such as making specifying " "types optional) so as to allow simple and quick interactive usage, but " "inside functions, subroutines, modules or programs this relaxation does " "not apply." msgstr "" "选择 Fortran çš„ LFortran 扩展是为了尽é‡å‡å°‘更改的数é‡ã€‚特别是," "åªæœ‰_全局作用域_的顶层放宽了一些 Fortran 规则(例如使指定类型å¯é€‰ï¼‰ä»¥å…许简å•" "快速的交互使用,但在函数ã€å­ä¾‹ç¨‹ã€æ¨¡å—或程åºå†…éƒ¨ï¼Œè¿™ç§æ”¾å®½å¹¶ä¸é€‚用." #: ../../doc/src/design.md:225 msgid "" "The number of changes were kept to minimum in order to make it " "straightforward to turn code at _global scope_ into standard compliant " "Fortran code using programs and modules, so that it can be compiled by " "any Fortran compiler." msgstr "" "更改的数é‡ä¿æŒåœ¨æœ€ä½Žé™åº¦ï¼Œ" "以便使用程åºå’Œæ¨¡å—å°†_全局作用域_中的代ç ç›´æŽ¥è½¬æ¢ä¸ºç¬¦åˆæ ‡å‡†çš„ Fortran 代ç ï¼Œ" "以便任何 Fortran 编译器都å¯ä»¥ç¼–译它。" #: ../../doc/src/developer_tutorial.ipynb:9 msgid "Developer Tutorial" msgstr "å¼€å‘者教程" #: ../../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 "这是任何想è¦å¼€å‘ LFortran 或构建工具的人的教程。" #: ../../doc/src/developer_tutorial.ipynb:14 msgid "Introduction" msgstr "入门" #: ../../doc/src/developer_tutorial.ipynb:18 msgid "" "Abstract Syntax Tree (AST): Represents any Fortran source code, strictly " "based on syntax, no semantic is included. The AST module can convert " "itself to Fortran source code." msgstr "抽象语法树 (AST):表示任何 Fortran æºä»£ç ï¼Œä¸¥æ ¼åŸºäºŽè¯­æ³•,ä¸åŒ…å«è¯­ä¹‰ã€‚ AST " "模å—å¯ä»¥å°†è‡ªèº«è½¬æ¢ä¸º Fortran æºä»£ç ã€‚" #: ../../doc/src/developer_tutorial.ipynb:20 msgid "" "Abstract Semantic Representation (ASR): Represents a valid Fortran source" " code, all semantic is included. Invalid Fortran code is not allowed (an " "error will be given). The ASR module can convert itself to an AST." msgstr "" "抽象语义表示 (ASR):表示有效的 Fortran æºä»£ç ï¼ŒåŒ…括所有语义。" "ä¸å…许使用无效的 Fortran 代ç ï¼ˆå°†ç»™å‡ºé”™è¯¯ï¼‰ã€‚ ASR 模å—å¯ä»¥å°†è‡ªèº«è½¬æ¢ä¸º AST。" #: ../../doc/src/developer_tutorial.ipynb:25 msgid "" "Fortran source code can be parsed into an AST using the ``src_to_ast()`` " "function:" msgstr "Fortran æºä»£ç å¯ä»¥ä½¿ç”¨ ``src_to_ast()`` 函数解æžä¸º AST:" #: ../../doc/src/developer_tutorial.ipynb:49 #, python-format msgid "We can pretty print it using the ``%%showast`` magic:" msgstr "我们å¯ä»¥ä½¿ç”¨ ``%%showast`` 魔法漂亮地打å°å®ƒï¼š" #: ../../doc/src/developer_tutorial.ipynb:98 #, python-format msgid "We can convert AST to Fortran source code using ``%%showfmt``:" msgstr "我们å¯ä»¥ä½¿ç”¨ ``%%showfmt`` å°† AST 转æ¢ä¸º Fortran æºä»£ç ï¼š" #: ../../doc/src/developer_tutorial.ipynb:156 msgid "" "All AST nodes and their arguments are described in `AST.asdl " "`__." msgstr "" "所有 AST 节点åŠå…¶å‚数都在 `AST.asdl `__ 中æè¿°ã€‚" #: ../../doc/src/developer_tutorial.ipynb:170 #, python-format msgid "We can pretty print using the ``%%showasr`` magic:" msgstr "我们å¯ä»¥ä½¿ç”¨ ``%%showasr`` 魔法进行漂亮的打å°ï¼š" #: ../../doc/src/developer_tutorial.ipynb:219 msgid "" "All ASR nodes and their arguments are described in `ASR.asdl " "`__." msgstr "" "所有 ASR 节点åŠå…¶å‚数都在 `ASR.asdl `__ 中æè¿°ã€‚" #: ../../doc/src/index.md:134 msgid "Getting started" msgstr "开始" #: ../../doc/src/index.md:141 ../../doc/src/progress.md:1 msgid "LFortran Development Status" msgstr "LFortran å¼€å‘现状" #: ../../doc/src/index.md:147 msgid "Developer's Guide" msgstr "å¼€å‘者指å—" #: ../../doc/src/index.md:156 msgid "LFortran Intrinsics" msgstr "LFortran 内置函数" #: ../../doc/src/index.md:1 msgid "LFortran Documentation" msgstr "LFortran 文档" #: ../../doc/src/index.md:3 msgid "" "LFortran is a modern open-source (BSD licensed) interactive Fortran " "compiler built on top of LLVM. It can execute user's code interactively " "to allow exploratory work (much like Python, MATLAB or Julia) as well as " "compile to binaries with the goal to run user's code on modern " "architectures such as multi-core CPUs and GPUs." msgstr "" "LFortran 是建立在 LLVM 之上的现代开æºï¼ˆBSD 许å¯ï¼‰äº¤äº’å¼ Fortran " "编译器。它å¯ä»¥äº¤äº’地执行用户代ç ä»¥å…è®¸æŽ¢ç´¢æ€§å·¥ä½œï¼ˆå¾ˆåƒ Pythonã€MATLAB 或 " "Julia),也å¯ä»¥ç¼–译为二进制文件,目标是在多核 CPU å’Œ GPU " "等现代架构上è¿è¡Œç”¨æˆ·ä»£ç ã€‚" #: ../../doc/src/index.md:9 #, python-format msgid "" "Website: [https://lfortran.org/](https://lfortran.org/) Main " "repository: " "[https://github.com/lfortran/lfortran](https://github.com/lfortran/lfortran)" " Try online using Binder: " "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb)" 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/" "master?filepath=Demo.ipynb)" #: ../../doc/src/index.md:9 msgid "Binder" msgstr "Binder" #: ../../doc/src/index.md:16 msgid "Feature Highlights" msgstr "功能亮点" #: ../../doc/src/index.md:18 msgid "" "LFortran is in development, there are features that work today, and there" " are features that are being implemented. You can also check out the " "[Development Status](progress.md) section for more information on " "features being supported and being worked on." msgstr "" "LFortran 正在开å‘中,有些功能现在å¯ä»¥ä½¿ç”¨ï¼Œæœ‰äº›åŠŸèƒ½æ­£åœ¨å®žçŽ°ä¸­ã€‚ä½ è¿˜å¯ä»¥æŸ¥çœ‹ [" "Development Status](progress.md) " "部分,了解有关被支æŒå’Œæ­£åœ¨å¼€å‘的功能的更多信æ¯ã€‚" #: ../../doc/src/index.md:21 msgid "Works today" msgstr "现有功能" #: ../../doc/src/index.md:23 #, python-format msgid "" "**Interactive, Jupyter support** LFortran can be used from Jupyter as a" " Fortran kernel, allowing a Python/Julia style rapid prototyping and " "exploratory workflow (see the " "[static](https://nbviewer.jupyter.org/gist/certik/f1d28a486510810d824869ab0c491b1c)" " or [interactive](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb) example notebook). Or " "it can be used from the command-line in an interactive prompt (REPL)." msgstr "" "**交互å¼ï¼Œ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))。或者," "它å¯ä»¥åœ¨äº¤äº’å¼æç¤º (REPL) 中的命令行中使用。" #: ../../doc/src/index.md:32 msgid "" "**Clean, modular design, usable as a library** LFortran is structured " "around two independent modules, AST and ASR, both of which are " "standalone (completely independent of the rest of LFortran) and users " "are encouraged to use them independently for other applications and " "build tools on top. See the [Design](design.md) and [Developer " "Tutorial](developer_tutorial.md) documents for more details." msgstr "" "**简æ´ã€æ¨¡å—化设计,å¯ç”¨ä½œåº“**:LFortran å›´ç»•ä¸¤ä¸ªç‹¬ç«‹æ¨¡å— AST å’Œ ASR " "构建,这两个模å—都是独立的(完全独立于 LFortran 的其余部分),鼓励用户将它们" "独立用于其他应用程åºå¹¶åœ¨ä¸Šé¢æž„建工具。有关详细信æ¯ï¼Œè¯·å‚阅 [Design](design." "md) å’Œ [Developer Tutorial](developer_tutorial.md) 文档。" #: ../../doc/src/index.md:39 msgid "" "**Interoperation with GFortran** LFortran can parse GFortran module " "files into an ASR and generate a Fortran wrapper that can be compiled " "with any Fortran compiler and linked with the original GFortran " "compiled module." msgstr "" "**与 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 ç¼–è¯‘å™¨ä¸€æ ·åˆ›å»ºå¯æ‰§è¡Œæ–‡ä»¶ã€‚" #: ../../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 定期测试。" #: ../../doc/src/index.md:51 msgid "Planned" msgstr "计划" #: ../../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 "已计划这些功能正在开å‘中,有对应议题的链接,方便大家关注跟踪进度。" #: ../../doc/src/index.md:56 msgid "" "**Native interoperation with other languages (and other Fortran " "compilers)** It can automatically call code written in other languages " "(such as C or Python) just by using the `use` statement, see " "[#44](https://gitlab.com/lfortran/lfortran/issues/44). It understands " "other Fortran compilers module files (one can just \"use\" them) and " "their ABI to link correctly (GFortran is supported, other compilers are" " planned, see [#56](https://gitlab.com/lfortran/lfortran/issues/56)), " "which allows to use LFortran with production codes today." msgstr "" "**与其他语言(以åŠå…¶ä»– Fortran 编译器)的原生互æ“作**:åªéœ€ä½¿ç”¨ `use` " "语å¥å³å¯è‡ªåŠ¨è°ƒç”¨å…¶ä»–è¯­è¨€ï¼ˆå¦‚ C 或 Python)编写的代ç ï¼Œå‚è§ " "[#44](https://gitlab.com/lfortran/lfortran/issues/44)。它ç†è§£å…¶ä»– Fortran " "ç¼–è¯‘å™¨æ¨¡å—æ–‡ä»¶ï¼ˆå¯ä»¥`use`它们)åŠå…¶ ABI ä»¥æ­£ç¡®é“¾æŽ¥ï¼ˆæ”¯æŒ " "GFortran,计划使用其它编译器,请å‚阅 [#56](https://gitlab.com/lfortran/" "lfortran/问题/56)),它å…许将 LFortran 与如今的生产代ç ä¸€èµ·ä½¿ç”¨ã€‚" #: ../../doc/src/index.md:65 msgid "" "**Modern hardware support** Thanks to LLVM, the goal of LFortran is to " "run on modern hardware and take advantage of native Fortran language " "constructs (such as `do concurrent`) to run on multi-core CPUs and " "GPUs, see [#57](https://gitlab.com/lfortran/lfortran/issues/57)." msgstr "" "**现代硬件支æŒ**:得益于 LLVM,LFortran 的目标是在现代硬件上è¿è¡Œï¼Œå¹¶åˆ©ç”¨åŽŸç”Ÿ " "Fortran 语言结构(例如 `do concurrent`)在多核 CPU å’Œ GPU 上è¿è¡Œï¼Œè¯·å‚阅 [# " "57](https://gitlab.com/lfortran/lfortran/issues/57)。" #: ../../doc/src/index.md:71 msgid "" "**Full Fortran 2018 support** Currently only a subset of Fortran is " "implemented, but the goal is to have a full implementation of the " "latest Fortran 2018 standard, see " "[#58](https://gitlab.com/lfortran/lfortran/issues/58)." msgstr "" "**完整的 Fortran 2018 支æŒ**:目å‰åªå®žçŽ°äº† Fortran 的一个å­é›†ï¼Œ" "但目标是完整实现最新的 Fortran 2018 标准,请å‚阅 [#58](https://gitlab.com/" "lfortran/lfortran/issue/58)。" #: ../../doc/src/index.md:77 msgid "" "Please vote on issues in our [issue " "tracker](https://gitlab.com/lfortran/lfortran/issues) that you want us to" " prioritize (feel free to create new ones if we are missing anything)." msgstr "" "请在我们的 [议题跟踪器](https://gitlab.com/lfortran/lfortran/issues) 中对你希" "æœ›æˆ‘ä»¬ä¼˜å…ˆè€ƒè™‘çš„é—®é¢˜è¿›è¡ŒæŠ•ç¥¨ï¼ˆå¦‚æžœæˆ‘ä»¬é—æ¼ä»»ä½•å†…å®¹ï¼Œè¯·éšæ—¶åˆ›å»ºæ–°é—®é¢˜ï¼‰ã€‚" #: ../../doc/src/index.md:81 msgid "Roadmap" msgstr "路线图" #: ../../doc/src/index.md:83 msgid "Here is our roadmap how to get all the planned features above implemented:" msgstr "以下是我们如何实现上述所有计划功能的路线图:" #: ../../doc/src/index.md:85 msgid "" "Port code generation to use ASR and pass all the current tests " "([#74](https://gitlab.com/lfortran/lfortran/issues/74)). Remove the old " "code generation and old semantics, that used to annotate the AST tree, " "which was messy." msgstr "" "端å£ä»£ç ç”Ÿæˆä»¥ä½¿ç”¨ ASR å¹¶é€šè¿‡æ‰€æœ‰å½“å‰æµ‹è¯• ([#74](https://gitlab.com/lfortran/" "lfortran/issues/74))。删除用于注释 AST 树的旧代ç ç”Ÿæˆå’Œæ—§è¯­ä¹‰ï¼Œè¿™å¾ˆæ··ä¹±ã€‚" #: ../../doc/src/index.md:89 msgid "" "Get GFortran module files working with `use` module, both assumed-size " "and assumed-shape arrays " "([#52](https://gitlab.com/lfortran/lfortran/issues/52)). This will allow " "right away to use production codes with LFortran." msgstr "" "获å–使用 `use` 模å—çš„ GFortran æ¨¡å—æ–‡ä»¶ï¼ŒåŒ…括å‡å®šå¤§å°å’Œå‡å®šå½¢çŠ¶æ•°ç»„ " "([#52](https://gitlab.com/lfortran/lfortran/issues/52))。" "这将å…许立å³å°†ç”Ÿäº§ä»£ç ä¸Ž LFortran 一起使用。" #: ../../doc/src/index.md:93 msgid "Do these at the same time:" msgstr "åŒæ—¶åšè¿™äº›ï¼š" #: ../../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) 实现更多 Fortran 功能,直到最终支æŒå®Œæ•´çš„ Fortran 2018 " "([#58](https://gitlab.com/lfortran/lfortran/issues/58))。" #: ../../doc/src/index.md:98 msgid "" "b) Gradually move to C++ for robustness and speed " "([#70](https://gitlab.com/lfortran/lfortran/issues/70)). The Python API " "will not change (or only minimally), so the user experience from Python " "will not change." msgstr "" "b) 逿¸è½¬å‘ C++ ä»¥èŽ·å¾—ç¨³å¥æ€§å’Œé€Ÿåº¦ï¼ˆ[#70](https://gitlab.com/lfortran/" "lfortran/issues/70))。 Python API ä¸ä¼šæ”¹å˜ï¼ˆæˆ–åªæœ‰å¾ˆå°çš„æ”¹å˜ï¼‰ï¼Œå› æ­¤ Python " "的用户体验ä¸ä¼šæ”¹å˜ã€‚" #: ../../doc/src/index.md:103 msgid "" "c) Implement all the other cool features: `use` module for C and Python " "and automatic wrappers " "([#44](https://gitlab.com/lfortran/lfortran/issues/44)), modern hardware" " support ([#57](https://gitlab.com/lfortran/lfortran/issues/57)), " "generating an older standard of Fortran " "([#72](https://gitlab.com/lfortran/lfortran/issues/72)), Fortran doctest" " feature ([#73](https://gitlab.com/lfortran/lfortran/issues/73)), SymPy" " integration ([#71](https://gitlab.com/lfortran/lfortran/issues/71)), " "language service for IDEs " "([#12](https://gitlab.com/lfortran/lfortran/issues/12)), and other ideas" " ([#29](https://gitlab.com/lfortran/lfortran/issues/29))." 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))。" #: ../../doc/src/index.md:118 msgid "The step 1. is an internal refactoring that will not take long." msgstr "第 1 æ­¥æ˜¯å†…éƒ¨é‡æž„,ä¸ä¼šèŠ±è´¹å¾ˆé•¿æ—¶é—´ã€‚" #: ../../doc/src/index.md:120 msgid "" "The step 2. will allow LFortran to be used interactively with production " "codes right away (the production code will get compiled with GFortran, " "then one \"uses\" any module in LFortran and functions/subroutines can be" " interactively called, the module itself can use any GFortran supported " "feature, but the API must fit into the subset that LFortran understands " "--- for large number of applications simple functions/subroutines with " "array arguments are enough). This will make LFortran usable for first " "users and one can always use GFortran temporarily until LFortran supports" " the given feature. We expect to be finished with the step 2. by the end " "of summer 2019, hopefully sooner." msgstr "" "第 2 步将å…许 LFortran ç«‹å³ä¸Žç”Ÿäº§ä»£ç äº¤äº’使用(生产代ç å°†ä½¿ç”¨ GFortran " "编译,然åŽâ€œä½¿ç”¨â€ LFortran 中的任何模å—,并且å¯ä»¥äº¤äº’调用函数/å­ä¾‹ç¨‹ï¼Œ" "æ¨¡å—æœ¬èº«å¯ä»¥ä½¿ç”¨ä»»ä½• GFortran 支æŒçš„功能,但 API å¿…é¡»é€‚åˆ LFortran " "ç†è§£çš„å­é›† —— 对于大é‡åº”用程åºï¼Œå¸¦æœ‰æ•°ç»„傿•°çš„简å•函数/å­ä¾‹ç¨‹å°±è¶³å¤Ÿäº†ï¼‰ã€‚" "这将使 LFortran å¯ä¾›ç¬¬ä¸€æ‰¹ç”¨æˆ·ä½¿ç”¨ï¼Œå¹¶ä¸”在 LFortran 支æŒç»™å®šåŠŸèƒ½ä¹‹å‰ï¼Œ" "始终å¯ä»¥ä¸´æ—¶ä½¿ç”¨ GFortran。我们预计在 2019 年夿œ«å®Œæˆç¬¬ 2 步,希望能更快。" #: ../../doc/src/index.md:130 msgid "" "Finally the step 3. will improve LFortran overall, allowing the first " "users to contribute back, growing the community and making LFortran " "gradually useful for more and more people." msgstr "最åŽï¼Œç¬¬ 3 步将整体改进 LFortran,å…许第一批用户回馈,å‘展社区并使 LFortran " "逿¸å¯¹è¶Šæ¥è¶Šå¤šçš„人有用。" #: ../../doc/src/installation.md:1 msgid "Installation" msgstr "安装" #: ../../doc/src/installation.md:3 msgid "All the instructions below work on Linux, macOS and Windows." msgstr "以下所有说明适用于 Linuxã€macOS å’Œ Windows。" #: ../../doc/src/installation.md:5 msgid "Binaries" msgstr "二进制文件" #: ../../doc/src/installation.md:7 msgid "" "The recommended way to install LFortran is using Conda. Install Conda for" " example by installing the " "[Miniconda](https://conda.io/en/latest/miniconda.html) installation by " "following instructions there for your platform. Then create a new " "environment (you can choose any name, here we chose `lf`) and activate " "it:" msgstr "" "安装 LFortran çš„æŽ¨èæ–¹æ³•是使用 Conda。例如,按照你的平å°çš„说明安装 " "[Miniconda](https://conda.io/en/latest/miniconda.html),安装 " "Conda。然åŽåˆ›å»ºä¸€ä¸ªæ–°çŽ¯å¢ƒï¼ˆä½ å¯ä»¥é€‰æ‹©ä»»ä½•å称,这里我们选择了`lf`)并激活它:" #: ../../doc/src/installation.md:16 msgid "Then install LFortran by:" msgstr "ç„¶åŽé€šè¿‡ä»¥ä¸‹æ–¹å¼å®‰è£… LFortran:" #: ../../doc/src/installation.md:20 msgid "" "Now the `lf` environment has the `lfortran` compiler available, you can " "start the interactive prompt by executing `lfortran`, or see the command " "line options using `lfortran -h`." msgstr "" "现在 `lf` 环境有 `lfortran` 编译器å¯ç”¨ï¼Œä½ å¯ä»¥é€šè¿‡æ‰§è¡Œ `lfortran` " "å¯åŠ¨äº¤äº’å¼æç¤ºï¼Œæˆ–ä½¿ç”¨ `lfortran -h` 查看命令行选项。" #: ../../doc/src/installation.md:24 msgid "" "The Jupyter kernel is automatically installed by the above command, so " "after installing Jupyter itself:" msgstr "Jupyter 内核是通过上é¢çš„命令自动安装的,所以在安装 Jupyter 本身之åŽï¼š" #: ../../doc/src/installation.md:28 msgid "You can create a Fortran based Jupyter notebook by executing:" msgstr "ä½ å¯ä»¥é€šè¿‡æ‰§è¡Œä»¥ä¸‹å‘½ä»¤æ¥åˆ›å»ºåŸºäºŽ Fortran çš„ Jupyter 笔记本:" #: ../../doc/src/installation.md:32 msgid "and selecting `New->Fortran`." msgstr "并选择 `New->Fortran`。" #: ../../doc/src/installation.md:35 msgid "Build From a Source Tarball" msgstr "从æºä»£ç æž„建" #: ../../doc/src/installation.md:37 msgid "" "This method is the recommended method if you just want to install " "LFortran, either yourself or in a package manager (Spack, Conda, Debian, " "etc.). The source tarball has all the generated files included and has " "minimal dependencies." msgstr "" "å¦‚æžœä½ åªæƒ³è‡ªå·±æˆ–在包管ç†å™¨ï¼ˆSpackã€Condaã€Debian 等)中安装 " "LFortran,建议使用此方法。æºä»£ç åŒ…嫿‰€æœ‰ç”Ÿæˆçš„æ–‡ä»¶ï¼Œå¹¶ä¸”具有最å°çš„ä¾èµ–关系。" #: ../../doc/src/installation.md:39 msgid "First we have to install dependencies, for example using Conda:" msgstr "首先,我们必须安装ä¾èµ–项,例如使用 Conda:" #: ../../doc/src/installation.md:44 msgid "" "Then download a tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), e.g.:" msgstr "" "ç„¶åŽä»Ž [https://lfortran.org/download/](https://lfortran.org/download/) " "下载æºä»£ç ï¼Œä¾‹å¦‚:" #: ../../doc/src/installation.md:52 msgid "And build:" msgstr "并构建:" #: ../../doc/src/installation.md:58 msgid "This will install the `lfortran` into the `inst/bin`." msgstr "这会将 `lfortran` 安装到 `inst/bin` 中。" #: ../../doc/src/installation.md:60 msgid "Build From Git" msgstr "从 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 "" "我们å‡è®¾ä½ å®‰è£…了 C++ ç¼–è¯‘å™¨ï¼Œä»¥åŠ `git` å’Œ `wget`。在 Ubuntu 中,你还å¯ä»¥ä¸º " "stacktraces 安装 `binutils-dev`。" #: ../../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 "如果你没有安装 Conda,你å¯ä»¥åœ¨ Linux 上安装(在其他平å°ä¸Šç±»ä¼¼ï¼‰ï¼š" #: ../../doc/src/installation.md:72 msgid "Then prepare the environment:" msgstr "ç„¶åŽå‡†å¤‡çŽ¯å¢ƒï¼š" #: ../../doc/src/installation.md:77 msgid "Clone the LFortran git repository:" msgstr "克隆 LFortran git 存储库:" #: ../../doc/src/installation.md:82 msgid "" "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 模å¼ä¸‹æž„建:" #: ../../doc/src/installation.md:92 msgid "Run tests:" msgstr "è¿è¡Œæµ‹è¯•:" #: ../../doc/src/installation.md:97 msgid "Run an interactive prompt:" msgstr "è¿è¡Œäº¤äº’å¼æç¤ºç¬¦:" #: ../../doc/src/installation.md:102 msgid "Build from Git on Windows with Visual Studio" msgstr "在 Windows 上使用 Visual Studio 从 Git 构建" #: ../../doc/src/installation.md:104 msgid "" "Install Visual Studio (MSVC), for example the version 2022, you can " "download the Community version for free from: " "https://visualstudio.microsoft.com/downloads/." msgstr "" "安装 Visual Studio (MSVC),例如 2022 " "版本,å¯ä»¥å…费下载社区版本: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 "" "使用æ¥è‡ª https://github.com/conda-forge/miniforge çš„ Windows 安装程åºå®‰è£… " "miniforge。" #: ../../doc/src/installation.md:109 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 编译器:" #: ../../doc/src/installation.md:117 msgid "You can optionally test that MSVC works by:" msgstr "ä½ å¯ä»¥é€‰æ‹©é€šè¿‡ä»¥ä¸‹æ–¹å¼æµ‹è¯• MSVC 是å¦å·¥ä½œ:" #: ../../doc/src/installation.md:122 msgid "Both commands must print help (several pages)." msgstr "这两个命令都必须打å°å¸®åŠ©ä¿¡æ¯ï¼ˆè‹¥å¹²é¡µï¼‰ã€‚" #: ../../doc/src/installation.md:124 msgid "Now you can download and build LFortran:" msgstr "现在你å¯ä»¥ä¸‹è½½å¹¶å»ºç«‹ LFortran:" #: ../../doc/src/installation.md:134 msgid "If everything compiled, then you can use LFortran as follows:" msgstr "如果一切都编译好了,那么你就å¯ä»¥ä½¿ç”¨ LFortran,如下所示:" #: ../../doc/src/installation.md:140 msgid "And so on." msgstr "等等 。" #: ../../doc/src/installation.md:142 msgid "" "Note: LFortran currently uses the MSVC's linker program (`link`), which " "is only available when the MSVC bat script above is ran. If you forget to" " activate it, LFortran's linking will fail." msgstr "" "注æ„:LFortran ç›®å‰ä½¿ç”¨ MSVC 的链接器程åºï¼ˆ`link`ï¼‰ï¼Œåªæœ‰åœ¨è¿è¡Œä¸Šé¢çš„ MSVC " "bat 脚本时æ‰èƒ½ä½¿ç”¨ã€‚如果你忘记激活它,LFortran 的链接就会失败。" #: ../../doc/src/installation.md:146 msgid "" "Note: the miniforge shell seems to be running some version of `git-bash` " "(although it is `cmd.exe`), which has some unix-like filesystem mounted " "in `/usr` and several commands available such as `ls`, `which`, `git`, " "`vim`. For this reason the Conda build `environment_win.yml` contains " "everything needed, including `git`." msgstr "" "注æ„: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 构建" #: ../../doc/src/installation.md:153 msgid "In windows search \"turn windows features on or off\"." msgstr "在 Windows 中æœç´¢â€œæ‰“开或关闭 Windows 功能â€ã€‚" #: ../../doc/src/installation.md:154 msgid "Tick Windows subsystem for Linux." msgstr "标记适用于Linux çš„ Windows å­ç³»ç»Ÿã€‚" #: ../../doc/src/installation.md:155 msgid "Press OK and restart computer." msgstr "按“确定â€å¹¶é‡æ–°å¯åŠ¨è®¡ç®—æœºã€‚" #: ../../doc/src/installation.md:156 msgid "Go to Microsoft store and download Ubuntu 20.04, and launch it." msgstr "到微软商店下载 Ubuntu 20.04,并å¯åŠ¨å®ƒã€‚" #: ../../doc/src/installation.md:157 msgid "Run the following commands." msgstr "è¿è¡Œä¸‹åˆ—程åºè¯­å¥ã€‚" #: ../../doc/src/installation.md:164 msgid "Now do the following to configure the path" msgstr "现在åšä»¥ä¸‹å·¥ä½œæ¥é…置路径" #: ../../doc/src/installation.md:168 msgid "Then go to the bottom of the file and paste the following" msgstr "ç„¶åŽè½¬åˆ°æ–‡ä»¶åº•部,粘贴以下内容" #: ../../doc/src/installation.md:172 msgid "Then press ctrl + O (save), Enter (confirm), ctrl + X (exit)" msgstr "ç„¶åŽæŒ‰ ctrl + O(ä¿å­˜ï¼‰ï¼ŒEnter(确认),ctrl + X(退出)" #: ../../doc/src/installation.md:173 msgid "After that restart Ubuntu" msgstr "之åŽï¼Œé‡æ–°å¯åЍ Ubuntu" #: ../../doc/src/installation.md:174 msgid "Run the following" msgstr "è¿è¡Œä»¥ä¸‹å†…容" #: ../../doc/src/installation.md:179 msgid "Restart Ubuntu again" 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 " "ä½ç½®ã€‚" #: ../../doc/src/installation.md:188 msgid "e.g. `cd mnt/c/Users/name/source/repos/`" msgstr "例如:`cd mnt/c/Users/name/source/repos/`" #: ../../doc/src/installation.md:190 msgid "Now clone the LFortran git repository" msgstr "现在克隆 LFortran çš„ git 仓库" #: ../../doc/src/installation.md:196 msgid "Run the following commands" msgstr "è¿è¡Œä»¥ä¸‹å‘½ä»¤" #: ../../doc/src/installation.md:204 msgid "If everything compiles, you can use LFortran as follows" msgstr "如果一切都能编译,你å¯ä»¥ä½¿ç”¨ LFortran,如下所示" #: ../../doc/src/installation.md:210 msgid "Run an interactive prompt" msgstr "è¿è¡Œäº¤äº’å¼æç¤ºç¬¦" #: ../../doc/src/installation.md:215 msgid "Run tests" msgstr "è¿è¡Œæµ‹è¯•" #: ../../doc/src/installation.md:221 msgid "Enabling the Jupyter Kernel" msgstr "å¯ç”¨ Jupyter 内核" #: ../../doc/src/installation.md:223 msgid "To install the Jupyter kernel, install the following Conda packages also:" 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`。比如:" #: ../../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 " "内核:" #: ../../doc/src/installation.md:244 msgid "Then launch a Jupyter notebook as follows:" msgstr "ç„¶åŽå¯åЍ Jupyter notebook,如下所示:" #: ../../doc/src/installation.md:248 msgid "Click `New->Fortran`. To launch a terminal jupyter LFortran console:" msgstr "å•击 `New - > Fortran`。å¯åЍ jupyter LFortran 终端控制å°ï¼š" #: ../../doc/src/installation.md:254 msgid "Build From Git with Nix" msgstr "使用 Nix 从 Git 构建" #: ../../doc/src/installation.md:256 msgid "" "One of the ways to ensure exact environment and dependencies is with " "`nix`. This will ensure that system dependencies do not interfere with " "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,以方便别人å¤åˆ¶ã€‚" #: ../../doc/src/installation.md:258 msgid "With Root" msgstr "带有 root æƒé™" #: ../../doc/src/installation.md:260 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)的机器上工作:" #: ../../doc/src/installation.md:264 msgid "Without Root" msgstr "ä¸å¸¦æœ‰ root æƒé™" #: ../../doc/src/installation.md:266 msgid "" "If you would like to not provide `nix` with root access to your machine, " "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).。" #: ../../doc/src/installation.md:270 msgid "" "Now just prepend all `nix-shell` commands with `NP_RUNTIME=bwrap ./nix-" "portable `. So:" msgstr "现在åªè¦åœ¨æ‰€æœ‰ `nix-shell `命令å‰åŠ ä¸Š `NP_RUNTIME=bwrap . /nix-" "portable`。所以:" #: ../../doc/src/installation.md:278 msgid "Development" msgstr "å¼€å‘" #: ../../doc/src/installation.md:280 msgid "Now we can enter the development environment:" msgstr "现在进入开å‘环境:" #: ../../doc/src/installation.md:284 msgid "" "The `--pure` flag ensures no system dependencies are used in the " "environment." msgstr "`--pure` 标志确ä¿åœ¨çŽ¯å¢ƒä¸­ä¸ä½¿ç”¨ç³»ç»Ÿä¾èµ–。" #: ../../doc/src/installation.md:286 msgid "The build steps are the same as with the `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`:" #: ../../doc/src/installation.md:297 msgid "Note About Dependencies" msgstr "关于ä¾èµ–性的说明" #: ../../doc/src/installation.md:299 msgid "" "End users (and distributions) are encouraged to use the tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), which " "only depends on LLVM, CMake and a C++ compiler." msgstr "" "我们鼓励终端用户(和å‘行版)使用æ¥è‡ª [https://lfortran.org/download/" "](https://lfortran.org/download/" ")çš„tarball,它åªä¾èµ–于LLVMã€CMakeå’ŒC++编译器。" #: ../../doc/src/installation.md:303 msgid "" "The tarball is generated automatically by our CI (continuous integration)" " and contains some autogenerated files: the parser, the AST and ASR " "nodes, which is generated by an ASDL translator (requires Python)." msgstr "" "这个 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 的指令。" #: ../../doc/src/installation.md:309 msgid "Note for users who do not use Conda" msgstr "ä¸ä½¿ç”¨ Conda 的用户注æ„" #: ../../doc/src/installation.md:311 msgid "" "Following are the dependencies necessary for installing this repository " "in development mode," msgstr "ä»¥ä¸‹æ˜¯åœ¨å¼€å‘æ¨¡å¼ä¸‹å®‰è£…此版本库的必è¦ä¾èµ–," #: ../../doc/src/installation.md:314 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 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 "[re2c - 2.0.3](https://re2c.org/install/install.html)" #: ../../doc/src/installation.md:317 msgid "" "[binutils - " "2.31.90](ftp://sourceware.org/pub/binutils/snapshots/binutils-2.31.90.tar.xz)" " - Make sure that you should enable the required options related to this " "dependency to build the dynamic libraries (the ones ending with `.so`)." msgstr "" "[binutils - 2.31.90](ftp://sourceware.org/pub/binutils/snapshots/binutils-2." "31.90.tar.xz) —— ç¡®ä¿ä½ åº”该å¯ç”¨ä¸Žæ­¤ä¾èµ–关系相关的必è¦é€‰é¡¹æ¥æž„建动æ€åº“(以 `." "so` 结尾的库)。" #: ../../doc/src/installation.md:319 msgid "Stacktraces" msgstr "堆栈跟踪" #: ../../doc/src/installation.md:321 msgid "" "LFortran can print stacktraces when there is an unhandled exception, as " "well as on any compiler error with the `--show-stacktrace` option. This " "is very helpful for developing the compiler itself to see where in " "LFortran the problem is. The stacktrace support is turned off by default," " to enable it, compile LFortran with the `-DWITH_STACKTRACE=yes` cmake " "option after installing the prerequisites on each platform per the " "instructions below." msgstr "" "LFortran å¯ä»¥åœ¨å‡ºçŽ°æœªå¤„ç†çš„异常时打å°å †æ ˆè·Ÿè¸ªï¼Œä¹Ÿå¯ä»¥åœ¨ä»»ä½•编译器错误时使用 " "`--show-stacktrace` 选项。这对开å‘编译器本身很有帮助,å¯ä»¥çœ‹åˆ° LFortran 中的" "é—®é¢˜æ‰€åœ¨ã€‚é»˜è®¤æƒ…å†µä¸‹ï¼Œå †æ ˆè·Ÿè¸ªæ”¯æŒæ˜¯å…³é—­çš„,è¦å¯ç”¨å®ƒï¼Œéœ€è¦åœ¨æ¯ä¸ªå¹³å°ä¸ŠæŒ‰ç…§ä¸‹" "é¢çš„说明安装先决æ¡ä»¶åŽï¼Œç”¨`-DWITH_STACKTRACE=yes` cmake 选项编译 LFortran。" #: ../../doc/src/installation.md:328 msgid "Ubuntu" msgstr "Ubuntu" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." msgstr "在 Ubuntu 系统,`apt install binutils-dev`。" #: ../../doc/src/installation.md:332 msgid "macOS" msgstr "macOS" #: ../../doc/src/installation.md:334 msgid "" "If you use the default Clang compiler on macOS, then the stacktraces " "should just work on both Intel and M1 based macOS (the CMake build system" " automatically invokes the `dsymtuil` tool and our Python scripts to " "store the debug information, see `src/bin/CMakeLists.txt` for more " "details). If it does not work, please report a bug." msgstr "" "如果你在 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](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` 软件包的完整路径。把这个路径添加到你的 " "shell é…置文件中,例如:" #: ../../doc/src/installation.md:352 msgid "" "and compile LFortran with the " "`-DCMAKE_PREFIX_PATH=\"$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX\"` cmake" " option. The `$CONDA_PREFIX` is there if you install some other " "dependencies (such as `llvm`) using Conda, otherwise you can remove it." msgstr "" "并使用 `-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 "数组内置函数" #: ../../doc/src/intrinsics/array/allocated.md:1 msgid "allocated(x): Status Check" msgstr "allocated(x)ï¼šçŠ¶æ€æ£€æŸ¥" #: ../../doc/src/intrinsics/array/allocated.md:3 msgid "Logical status of an allocatable integer." msgstr "å¯åˆ†é…整数的逻辑状æ€ã€‚" #: ../../doc/src/intrinsics/array/allocated.md:5 #: ../../doc/src/intrinsics/array/cshift.md:5 #: ../../doc/src/intrinsics/array/size.md:5 #: ../../doc/src/intrinsics/bit/bge.md:5 ../../doc/src/intrinsics/bit/bgt.md:5 #: ../../doc/src/intrinsics/bit/bit_size.md:5 #: ../../doc/src/intrinsics/bit/ble.md:5 ../../doc/src/intrinsics/bit/blt.md:5 #: ../../doc/src/intrinsics/bit/btest.md:5 #: ../../doc/src/intrinsics/bit/shiftl.md:5 #: ../../doc/src/intrinsics/bit/shiftr.md:5 #: ../../doc/src/intrinsics/character/achar.md:5 #: ../../doc/src/intrinsics/character/adjustl.md:5 #: ../../doc/src/intrinsics/character/adjustr.md:5 #: ../../doc/src/intrinsics/character/char.md:5 #: ../../doc/src/intrinsics/character/len_trim.md:5 #: ../../doc/src/intrinsics/character/lge.md:5 #: ../../doc/src/intrinsics/kind-type/kind.md:5 #: ../../doc/src/intrinsics/mathematical/acos.md:5 #: ../../doc/src/intrinsics/mathematical/acosh.md:5 #: ../../doc/src/intrinsics/mathematical/asin.md:5 #: ../../doc/src/intrinsics/mathematical/asinh.md:5 #: ../../doc/src/intrinsics/mathematical/atan.md:5 #: ../../doc/src/intrinsics/mathematical/atan2.md:5 #: ../../doc/src/intrinsics/mathematical/atanh.md:5 #: ../../doc/src/intrinsics/mathematical/fraction.md:5 #: ../../doc/src/intrinsics/misc/command_argument_count.md:5 #: ../../doc/src/intrinsics/misc/cpu_time.md:5 #: ../../doc/src/intrinsics/misc/date_and_time.md:5 #: ../../doc/src/intrinsics/misc/new_line.md:5 #: ../../doc/src/intrinsics/numeric/abs.md:5 #: ../../doc/src/intrinsics/numeric/aimag.md:5 #: ../../doc/src/intrinsics/numeric/aint.md:5 #: ../../doc/src/intrinsics/numeric/anint.md:5 #: ../../doc/src/intrinsics/numeric/ceiling.md:5 #: ../../doc/src/intrinsics/numeric/cmplx.md:5 #: ../../doc/src/intrinsics/numeric/conjg.md:5 #: ../../doc/src/intrinsics/numeric/digits.md:5 #: ../../doc/src/intrinsics/numeric/dim.md:5 #: ../../doc/src/intrinsics/numeric/epsilon.md:5 #: ../../doc/src/intrinsics/numeric/erf.md:5 #: ../../doc/src/intrinsics/numeric/erfc.md:5 #: ../../doc/src/intrinsics/numeric/exp.md:5 #: ../../doc/src/intrinsics/numeric/floor.md:5 #: ../../doc/src/intrinsics/numeric/gamma.md:5 #: ../../doc/src/intrinsics/numeric/mod.md:5 msgid "Declaration" msgstr "声明" #: ../../doc/src/intrinsics/array/allocated.md:7 #: ../../doc/src/intrinsics/array/cshift.md:7 #: ../../doc/src/intrinsics/array/size.md:7 #: ../../doc/src/intrinsics/bit/bge.md:7 ../../doc/src/intrinsics/bit/bgt.md:7 #: ../../doc/src/intrinsics/bit/bit_size.md:7 #: ../../doc/src/intrinsics/bit/ble.md:7 ../../doc/src/intrinsics/bit/blt.md:7 #: ../../doc/src/intrinsics/bit/btest.md:7 #: ../../doc/src/intrinsics/bit/shiftl.md:7 #: ../../doc/src/intrinsics/bit/shiftr.md:7 #: ../../doc/src/intrinsics/character/achar.md:7 #: ../../doc/src/intrinsics/character/adjustl.md:7 #: ../../doc/src/intrinsics/character/adjustr.md:7 #: ../../doc/src/intrinsics/character/char.md:7 #: ../../doc/src/intrinsics/character/len_trim.md:7 #: ../../doc/src/intrinsics/character/lge.md:8 #: ../../doc/src/intrinsics/kind-type/kind.md:7 #: ../../doc/src/intrinsics/mathematical/acos.md:7 #: ../../doc/src/intrinsics/mathematical/acosh.md:7 #: ../../doc/src/intrinsics/mathematical/asin.md:7 #: ../../doc/src/intrinsics/mathematical/asinh.md:7 #: ../../doc/src/intrinsics/mathematical/atan.md:7 #: ../../doc/src/intrinsics/mathematical/atan2.md:7 #: ../../doc/src/intrinsics/mathematical/atanh.md:7 #: ../../doc/src/intrinsics/mathematical/fraction.md:7 #: ../../doc/src/intrinsics/misc/command_argument_count.md:7 #: ../../doc/src/intrinsics/misc/cpu_time.md:7 #: ../../doc/src/intrinsics/misc/date_and_time.md:7 #: ../../doc/src/intrinsics/misc/new_line.md:7 #: ../../doc/src/intrinsics/numeric/abs.md:7 #: ../../doc/src/intrinsics/numeric/aimag.md:7 #: ../../doc/src/intrinsics/numeric/aint.md:7 #: ../../doc/src/intrinsics/numeric/anint.md:7 #: ../../doc/src/intrinsics/numeric/ceiling.md:7 #: ../../doc/src/intrinsics/numeric/cmplx.md:7 #: ../../doc/src/intrinsics/numeric/conjg.md:7 #: ../../doc/src/intrinsics/numeric/digits.md:7 #: ../../doc/src/intrinsics/numeric/dim.md:7 #: ../../doc/src/intrinsics/numeric/epsilon.md:7 #: ../../doc/src/intrinsics/numeric/erf.md:7 #: ../../doc/src/intrinsics/numeric/erfc.md:7 #: ../../doc/src/intrinsics/numeric/exp.md:7 #: ../../doc/src/intrinsics/numeric/floor.md:7 #: ../../doc/src/intrinsics/numeric/gamma.md:7 #: ../../doc/src/intrinsics/numeric/mod.md:7 msgid "Syntax" msgstr "语法" #: ../../doc/src/intrinsics/array/allocated.md:14 #: ../../doc/src/intrinsics/array/cshift.md:14 #: ../../doc/src/intrinsics/array/size.md:14 #: ../../doc/src/intrinsics/bit/bge.md:14 #: ../../doc/src/intrinsics/bit/bgt.md:14 #: ../../doc/src/intrinsics/bit/bit_size.md:14 #: ../../doc/src/intrinsics/bit/ble.md:14 #: ../../doc/src/intrinsics/bit/blt.md:14 #: ../../doc/src/intrinsics/bit/btest.md:14 #: ../../doc/src/intrinsics/bit/shiftl.md:14 #: ../../doc/src/intrinsics/bit/shiftr.md:14 #: ../../doc/src/intrinsics/character/achar.md:14 #: ../../doc/src/intrinsics/character/adjustl.md:14 #: ../../doc/src/intrinsics/character/adjustr.md:14 #: ../../doc/src/intrinsics/character/char.md:14 #: ../../doc/src/intrinsics/character/len_trim.md:14 #: ../../doc/src/intrinsics/character/lge.md:15 #: ../../doc/src/intrinsics/kind-type/kind.md:14 #: ../../doc/src/intrinsics/mathematical/acos.md:14 #: ../../doc/src/intrinsics/mathematical/acosh.md:14 #: ../../doc/src/intrinsics/mathematical/asin.md:14 #: ../../doc/src/intrinsics/mathematical/asinh.md:14 #: ../../doc/src/intrinsics/mathematical/atan.md:14 #: ../../doc/src/intrinsics/mathematical/atan2.md:13 #: ../../doc/src/intrinsics/mathematical/atanh.md:14 #: ../../doc/src/intrinsics/mathematical/fraction.md:13 #: ../../doc/src/intrinsics/misc/command_argument_count.md:14 #: ../../doc/src/intrinsics/misc/cpu_time.md:14 #: ../../doc/src/intrinsics/misc/date_and_time.md:14 #: ../../doc/src/intrinsics/misc/new_line.md:14 #: ../../doc/src/intrinsics/numeric/abs.md:15 #: ../../doc/src/intrinsics/numeric/aimag.md:15 #: ../../doc/src/intrinsics/numeric/aint.md:14 #: ../../doc/src/intrinsics/numeric/anint.md:14 #: ../../doc/src/intrinsics/numeric/ceiling.md:14 #: ../../doc/src/intrinsics/numeric/cmplx.md:16 #: ../../doc/src/intrinsics/numeric/conjg.md:15 #: ../../doc/src/intrinsics/numeric/digits.md:13 #: ../../doc/src/intrinsics/numeric/dim.md:13 #: ../../doc/src/intrinsics/numeric/epsilon.md:14 #: ../../doc/src/intrinsics/numeric/erf.md:14 #: ../../doc/src/intrinsics/numeric/erfc.md:14 #: ../../doc/src/intrinsics/numeric/exp.md:14 #: ../../doc/src/intrinsics/numeric/floor.md:14 #: ../../doc/src/intrinsics/numeric/gamma.md:14 #: ../../doc/src/intrinsics/numeric/mod.md:15 msgid "Arguments" msgstr "傿•°" #: ../../doc/src/intrinsics/array/allocated.md:16 msgid "`x` is an integer input parameter." msgstr "`x` æ˜¯ä¸€ä¸ªæ•´æ•°è¾“å…¥å‚æ•°ã€‚" #: ../../doc/src/intrinsics/array/allocated.md:18 #: ../../doc/src/intrinsics/array/cshift.md:22 #: ../../doc/src/intrinsics/array/size.md:22 #: ../../doc/src/intrinsics/bit/bge.md:18 #: ../../doc/src/intrinsics/bit/bgt.md:18 #: ../../doc/src/intrinsics/bit/bit_size.md:18 #: ../../doc/src/intrinsics/bit/ble.md:18 #: ../../doc/src/intrinsics/bit/blt.md:18 #: ../../doc/src/intrinsics/bit/btest.md:19 #: ../../doc/src/intrinsics/bit/shiftl.md:21 #: ../../doc/src/intrinsics/bit/shiftr.md:21 #: ../../doc/src/intrinsics/character/lge.md:23 #: ../../doc/src/intrinsics/kind-type/kind.md:19 #: ../../doc/src/intrinsics/mathematical/acos.md:18 #: ../../doc/src/intrinsics/mathematical/acosh.md:19 #: ../../doc/src/intrinsics/mathematical/asin.md:18 #: ../../doc/src/intrinsics/mathematical/asinh.md:19 #: ../../doc/src/intrinsics/mathematical/atan.md:18 #: ../../doc/src/intrinsics/mathematical/atan2.md:21 #: ../../doc/src/intrinsics/mathematical/atanh.md:19 #: ../../doc/src/intrinsics/mathematical/fraction.md:17 #: ../../doc/src/intrinsics/misc/command_argument_count.md:18 #: ../../doc/src/intrinsics/misc/cpu_time.md:18 #: ../../doc/src/intrinsics/misc/date_and_time.md:39 #: ../../doc/src/intrinsics/misc/new_line.md:19 #: ../../doc/src/intrinsics/numeric/abs.md:19 #: ../../doc/src/intrinsics/numeric/aimag.md:19 #: ../../doc/src/intrinsics/numeric/aint.md:20 #: ../../doc/src/intrinsics/numeric/anint.md:20 #: ../../doc/src/intrinsics/numeric/ceiling.md:18 #: ../../doc/src/intrinsics/numeric/cmplx.md:24 #: ../../doc/src/intrinsics/numeric/conjg.md:19 #: ../../doc/src/intrinsics/numeric/digits.md:17 #: ../../doc/src/intrinsics/numeric/dim.md:18 #: ../../doc/src/intrinsics/numeric/epsilon.md:18 #: ../../doc/src/intrinsics/numeric/erf.md:18 #: ../../doc/src/intrinsics/numeric/erfc.md:18 #: ../../doc/src/intrinsics/numeric/exp.md:18 #: ../../doc/src/intrinsics/numeric/floor.md:20 #: ../../doc/src/intrinsics/numeric/gamma.md:19 #: ../../doc/src/intrinsics/numeric/mod.md:22 msgid "Return values" msgstr "返回值" #: ../../doc/src/intrinsics/array/allocated.md:20 msgid "" "The return value is a logical scalar with the default logical kind type " "parameter." msgstr "返回值是具有默认逻辑ç§ç±»ç±»åž‹å‚数的逻辑标é‡ã€‚" #: ../../doc/src/intrinsics/array/allocated.md:23 #: ../../doc/src/intrinsics/array/cshift.md:26 #: ../../doc/src/intrinsics/array/size.md:26 #: ../../doc/src/intrinsics/bit/bge.md:22 #: ../../doc/src/intrinsics/bit/bgt.md:22 #: ../../doc/src/intrinsics/bit/bit_size.md:22 #: ../../doc/src/intrinsics/bit/ble.md:22 #: ../../doc/src/intrinsics/bit/blt.md:22 #: ../../doc/src/intrinsics/bit/btest.md:23 #: ../../doc/src/intrinsics/bit/shiftl.md:25 #: ../../doc/src/intrinsics/bit/shiftr.md:25 #: ../../doc/src/intrinsics/character/achar.md:27 #: ../../doc/src/intrinsics/character/adjustl.md:23 #: ../../doc/src/intrinsics/character/adjustr.md:24 #: ../../doc/src/intrinsics/character/char.md:28 #: ../../doc/src/intrinsics/character/len_trim.md:22 #: ../../doc/src/intrinsics/character/lge.md:31 #: ../../doc/src/intrinsics/kind-type/kind.md:23 #: ../../doc/src/intrinsics/mathematical/acos.md:23 #: ../../doc/src/intrinsics/mathematical/acosh.md:24 #: ../../doc/src/intrinsics/mathematical/asin.md:23 #: ../../doc/src/intrinsics/mathematical/asinh.md:24 #: ../../doc/src/intrinsics/mathematical/atan.md:23 #: ../../doc/src/intrinsics/mathematical/atan2.md:27 #: ../../doc/src/intrinsics/mathematical/atanh.md:24 #: ../../doc/src/intrinsics/mathematical/fraction.md:22 #: ../../doc/src/intrinsics/misc/command_argument_count.md:22 #: ../../doc/src/intrinsics/misc/cpu_time.md:22 #: ../../doc/src/intrinsics/misc/date_and_time.md:43 #: ../../doc/src/intrinsics/misc/new_line.md:24 #: ../../doc/src/intrinsics/numeric/abs.md:24 #: ../../doc/src/intrinsics/numeric/aimag.md:23 #: ../../doc/src/intrinsics/numeric/aint.md:28 #: ../../doc/src/intrinsics/numeric/anint.md:27 #: ../../doc/src/intrinsics/numeric/ceiling.md:22 #: ../../doc/src/intrinsics/numeric/cmplx.md:30 #: ../../doc/src/intrinsics/numeric/conjg.md:23 #: ../../doc/src/intrinsics/numeric/digits.md:21 #: ../../doc/src/intrinsics/numeric/dim.md:22 #: ../../doc/src/intrinsics/numeric/epsilon.md:22 #: ../../doc/src/intrinsics/numeric/erf.md:23 #: ../../doc/src/intrinsics/numeric/erfc.md:23 #: ../../doc/src/intrinsics/numeric/exp.md:22 #: ../../doc/src/intrinsics/numeric/floor.md:28 #: ../../doc/src/intrinsics/numeric/gamma.md:23 #: ../../doc/src/intrinsics/numeric/mod.md:31 ../../doc/src/progress.md msgid "Description" msgstr "æè¿°" #: ../../doc/src/intrinsics/array/allocated.md:25 msgid "" "`allocated(x)` checks the allocation status of a integer input parameter." " It returns a logical value as `TRUE` if the input argument `x` is " "allocated, `FALSE` otherwise." msgstr "`allocated(x)` æ£€æŸ¥æ•´æ•°è¾“å…¥å‚æ•°çš„分é…状æ€ã€‚ " "如果分é…äº†è¾“å…¥å‚æ•°`x`,则返回逻辑值`TRUE`,å¦åˆ™è¿”回`FALSE`。" #: ../../doc/src/intrinsics/array/allocated.md:29 #: ../../doc/src/intrinsics/array/cshift.md:39 #: ../../doc/src/intrinsics/array/size.md:33 #: ../../doc/src/intrinsics/bit/bge.md:27 #: ../../doc/src/intrinsics/bit/bgt.md:27 #: ../../doc/src/intrinsics/bit/bit_size.md:27 #: ../../doc/src/intrinsics/bit/ble.md:27 #: ../../doc/src/intrinsics/bit/blt.md:27 #: ../../doc/src/intrinsics/bit/btest.md:32 #: ../../doc/src/intrinsics/bit/shiftl.md:32 #: ../../doc/src/intrinsics/bit/shiftr.md:32 #: ../../doc/src/intrinsics/character/achar.md:37 #: ../../doc/src/intrinsics/character/adjustl.md:28 #: ../../doc/src/intrinsics/character/adjustr.md:29 #: ../../doc/src/intrinsics/character/char.md:38 #: ../../doc/src/intrinsics/character/len_trim.md:27 #: ../../doc/src/intrinsics/character/lge.md:37 #: ../../doc/src/intrinsics/kind-type/kind.md:27 #: ../../doc/src/intrinsics/mathematical/acos.md:31 #: ../../doc/src/intrinsics/mathematical/acosh.md:43 #: ../../doc/src/intrinsics/mathematical/asin.md:31 #: ../../doc/src/intrinsics/mathematical/asinh.md:35 #: ../../doc/src/intrinsics/mathematical/atan.md:31 #: ../../doc/src/intrinsics/mathematical/atan2.md:53 #: ../../doc/src/intrinsics/mathematical/atanh.md:39 #: ../../doc/src/intrinsics/mathematical/fraction.md:30 #: ../../doc/src/intrinsics/misc/command_argument_count.md:27 #: ../../doc/src/intrinsics/misc/cpu_time.md:33 #: ../../doc/src/intrinsics/misc/date_and_time.md:53 #: ../../doc/src/intrinsics/misc/new_line.md:29 #: ../../doc/src/intrinsics/numeric/abs.md:35 #: ../../doc/src/intrinsics/numeric/aimag.md:33 #: ../../doc/src/intrinsics/numeric/aint.md:35 #: ../../doc/src/intrinsics/numeric/anint.md:38 #: ../../doc/src/intrinsics/numeric/ceiling.md:26 #: ../../doc/src/intrinsics/numeric/cmplx.md:47 #: ../../doc/src/intrinsics/numeric/conjg.md:33 #: ../../doc/src/intrinsics/numeric/digits.md:26 #: ../../doc/src/intrinsics/numeric/dim.md:27 #: ../../doc/src/intrinsics/numeric/epsilon.md:29 #: ../../doc/src/intrinsics/numeric/erf.md:33 #: ../../doc/src/intrinsics/numeric/erfc.md:36 #: ../../doc/src/intrinsics/numeric/exp.md:29 #: ../../doc/src/intrinsics/numeric/floor.md:33 #: ../../doc/src/intrinsics/numeric/gamma.md:38 #: ../../doc/src/intrinsics/numeric/mod.md:43 msgid "Types" 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 "支æŒçš„傿•°ç±»åž‹æ˜¯æ•´åž‹ã€‚" #: ../../doc/src/intrinsics/array/allocated.md:46 #: ../../doc/src/intrinsics/array/cshift.md:43 #: ../../doc/src/intrinsics/array/size.md:37 #: ../../doc/src/intrinsics/bit/bge.md:49 #: ../../doc/src/intrinsics/bit/bgt.md:49 #: ../../doc/src/intrinsics/bit/bit_size.md:44 #: ../../doc/src/intrinsics/bit/ble.md:49 #: ../../doc/src/intrinsics/bit/blt.md:49 #: ../../doc/src/intrinsics/bit/btest.md:56 #: ../../doc/src/intrinsics/bit/shiftl.md:62 #: ../../doc/src/intrinsics/bit/shiftr.md:62 #: ../../doc/src/intrinsics/character/achar.md:53 #: ../../doc/src/intrinsics/character/adjustl.md:45 #: ../../doc/src/intrinsics/character/adjustr.md:46 #: ../../doc/src/intrinsics/character/char.md:53 #: ../../doc/src/intrinsics/character/len_trim.md:44 #: ../../doc/src/intrinsics/character/lge.md:59 #: ../../doc/src/intrinsics/kind-type/kind.md:59 #: ../../doc/src/intrinsics/mathematical/acos.md:60 #: ../../doc/src/intrinsics/mathematical/acosh.md:72 #: ../../doc/src/intrinsics/mathematical/asin.md:60 #: ../../doc/src/intrinsics/mathematical/asinh.md:64 #: ../../doc/src/intrinsics/mathematical/atan.md:60 #: ../../doc/src/intrinsics/mathematical/atan2.md:75 #: ../../doc/src/intrinsics/mathematical/atanh.md:68 #: ../../doc/src/intrinsics/mathematical/fraction.md:34 #: ../../doc/src/intrinsics/misc/command_argument_count.md:31 #: ../../doc/src/intrinsics/misc/cpu_time.md:44 #: ../../doc/src/intrinsics/misc/date_and_time.md:64 #: ../../doc/src/intrinsics/misc/new_line.md:40 #: ../../doc/src/intrinsics/numeric/abs.md:79 #: ../../doc/src/intrinsics/numeric/aimag.md:53 #: ../../doc/src/intrinsics/numeric/aint.md:39 #: ../../doc/src/intrinsics/numeric/anint.md:42 #: ../../doc/src/intrinsics/numeric/ceiling.md:46 #: ../../doc/src/intrinsics/numeric/cmplx.md:59 #: ../../doc/src/intrinsics/numeric/conjg.md:53 #: ../../doc/src/intrinsics/numeric/digits.md:30 #: ../../doc/src/intrinsics/numeric/dim.md:31 #: ../../doc/src/intrinsics/numeric/epsilon.md:49 #: ../../doc/src/intrinsics/numeric/erf.md:53 #: ../../doc/src/intrinsics/numeric/erfc.md:56 #: ../../doc/src/intrinsics/numeric/exp.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:65 #: ../../doc/src/intrinsics/numeric/gamma.md:58 #: ../../doc/src/intrinsics/numeric/mod.md:80 msgid "Examples" msgstr "示例" #: ../../doc/src/intrinsics/array/allocated.md:59 #: ../../doc/src/intrinsics/array/cshift.md:55 #: ../../doc/src/intrinsics/array/size.md:48 #: ../../doc/src/intrinsics/mathematical/acos.md:76 #: ../../doc/src/intrinsics/mathematical/acosh.md:81 #: ../../doc/src/intrinsics/mathematical/asin.md:76 #: ../../doc/src/intrinsics/mathematical/asinh.md:73 #: ../../doc/src/intrinsics/mathematical/atan.md:76 #: ../../doc/src/intrinsics/mathematical/atan2.md:84 #: ../../doc/src/intrinsics/mathematical/atanh.md:77 #: ../../doc/src/intrinsics/mathematical/fraction.md:44 msgid "**Result**:" msgstr "**结果**:" #: ../../doc/src/intrinsics/array/allocated.md:65 #: ../../doc/src/intrinsics/array/cshift.md:62 #: ../../doc/src/intrinsics/array/size.md:55 #: ../../doc/src/intrinsics/bit/bge.md:68 #: ../../doc/src/intrinsics/bit/bgt.md:66 #: ../../doc/src/intrinsics/bit/bit_size.md:61 #: ../../doc/src/intrinsics/bit/ble.md:68 #: ../../doc/src/intrinsics/bit/blt.md:66 #: ../../doc/src/intrinsics/bit/btest.md:71 #: ../../doc/src/intrinsics/bit/shiftl.md:80 #: ../../doc/src/intrinsics/bit/shiftr.md:80 #: ../../doc/src/intrinsics/character/achar.md:69 #: ../../doc/src/intrinsics/character/adjustl.md:62 #: ../../doc/src/intrinsics/character/adjustr.md:63 #: ../../doc/src/intrinsics/character/char.md:69 #: ../../doc/src/intrinsics/character/len_trim.md:63 #: ../../doc/src/intrinsics/character/lge.md:79 #: ../../doc/src/intrinsics/kind-type/kind.md:79 #: ../../doc/src/intrinsics/mathematical/acos.md:82 #: ../../doc/src/intrinsics/mathematical/acosh.md:86 #: ../../doc/src/intrinsics/mathematical/asin.md:82 #: ../../doc/src/intrinsics/mathematical/asinh.md:78 #: ../../doc/src/intrinsics/mathematical/atan.md:82 #: ../../doc/src/intrinsics/mathematical/atan2.md:90 #: ../../doc/src/intrinsics/mathematical/atanh.md:82 #: ../../doc/src/intrinsics/mathematical/fraction.md:50 #: ../../doc/src/intrinsics/misc/command_argument_count.md:47 #: ../../doc/src/intrinsics/misc/cpu_time.md:64 #: ../../doc/src/intrinsics/misc/date_and_time.md:90 #: ../../doc/src/intrinsics/misc/new_line.md:56 #: ../../doc/src/intrinsics/numeric/abs.md:96 #: ../../doc/src/intrinsics/numeric/aimag.md:68 #: ../../doc/src/intrinsics/numeric/aint.md:55 #: ../../doc/src/intrinsics/numeric/anint.md:58 #: ../../doc/src/intrinsics/numeric/ceiling.md:64 #: ../../doc/src/intrinsics/numeric/cmplx.md:74 #: ../../doc/src/intrinsics/numeric/conjg.md:68 #: ../../doc/src/intrinsics/numeric/digits.md:44 #: ../../doc/src/intrinsics/numeric/dim.md:47 #: ../../doc/src/intrinsics/numeric/epsilon.md:63 #: ../../doc/src/intrinsics/numeric/erf.md:67 #: ../../doc/src/intrinsics/numeric/erfc.md:70 #: ../../doc/src/intrinsics/numeric/exp.md:71 #: ../../doc/src/intrinsics/numeric/floor.md:83 #: ../../doc/src/intrinsics/numeric/gamma.md:74 #: ../../doc/src/intrinsics/numeric/mod.md:95 msgid "See Also" msgstr "也å¯ä»¥çœ‹çœ‹" #: ../../doc/src/intrinsics/array/cshift.md:1 msgid "cshift(A, shift [, dim]): Circular Shift" msgstr "cshift(A, shift [, dim]):循环移ä½" #: ../../doc/src/intrinsics/array/cshift.md:3 msgid "Circular shift elements of an array." 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 "`A` 为任何类型或维度的输入数组。" #: ../../doc/src/intrinsics/array/cshift.md:18 msgid "`shift` the input value of integer type." msgstr "`shift` 为整型类型的输入值。" #: ../../doc/src/intrinsics/array/cshift.md:20 msgid "" "`dim` optional dimension, if present, `cshift` returns the result of this" " dimension." 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 "è¿”å›žå€¼ä¸Žæ•°ç»„è¾“å…¥å‚æ•° `A` 的类型与维度相åŒã€‚" #: ../../doc/src/intrinsics/array/cshift.md:28 msgid "" "**cshift(A, shift [, dim])** performs a circular shift on elements of `A`" " array along the dimension of `dim`. Default value of `dim` is 1, used " "when `dim` is not passed." 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 "如果数组的维度数为 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 "元素从æ¯ä¸€åˆ—的一端移出,在å¦ä¸€ç«¯ç§»å›žã€‚" #: ../../doc/src/intrinsics/array/cshift.md:41 msgid "" "Supported argument type is array for `A` and integer for `shift` and " "`dim`." msgstr "支æŒçš„傿•°ç±»åž‹æ˜¯ `A` 的数组和 `shift` å’Œ `dim` 的整数。" #: ../../doc/src/intrinsics/array/size.md:1 msgid "size(x): Size of Array" msgstr "size(x):数组大å°" #: ../../doc/src/intrinsics/array/size.md:3 msgid "Returns the size of an array `x`." msgstr "返回数组 `x` 的大å°ã€‚" #: ../../doc/src/intrinsics/array/size.md:18 msgid "" "`dim` optional dimension, if present, `size` returns the size of this " "dimension." msgstr "`dim` å¯é€‰ç»´åº¦ï¼Œå¦‚果存在,`size` 返回此维度的大å°ã€‚" #: ../../doc/src/intrinsics/array/size.md:20 msgid "`kind` optional the kind of the return value." msgstr "`kind` å¯é€‰è¿”回值的ç§ç±»ã€‚" #: ../../doc/src/intrinsics/array/size.md:24 msgid "`n` the size of an array (integer)." msgstr "`n` 数组的大å°ï¼ˆæ•´åž‹ï¼‰ã€‚" #: ../../doc/src/intrinsics/array/size.md:28 msgid "" "The `size` intrinsic function returns the size of an array. It returns " "the product of all dimensions, unless the `dim` argument is specified, in" " which case it only returns the size of this particular dimension. The " "`kind` argument can be used to specify the integer kind of the result." msgstr "" "`size` 内部函数返回数组的大å°ã€‚å®ƒè¿”å›žæ‰€æœ‰ç»´åº¦çš„ä¹˜ç§¯ï¼Œé™¤éžæŒ‡å®šäº† `dim` " "傿•°ï¼Œåœ¨è¿™ç§æƒ…况下,它åªè¿”回这个特定维度的大å°ã€‚ `kind` " "傿•°å¯ç”¨äºŽæŒ‡å®šç»“果的整数类型。" #: ../../doc/src/intrinsics/array/size.md:57 msgid "[shape](), [reshape]()." msgstr "[shape](),[reshape]()。" #: ../../doc/src/intrinsics/bit.md:1 msgid "Bit Intrinsic Functions" msgstr "使“作内置函数" #: ../../doc/src/intrinsics/bit/bge.md:1 msgid "bge(x, y): Bitwise Greater or Equal" msgstr "bge(x, y):按ä½å¤§äºŽæˆ–等于" #: ../../doc/src/intrinsics/bit/bge.md:3 msgid "Bitwise greater than or equal to." 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 "`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 "返回值是逻辑类型和默认类型。" #: ../../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)` è®¡ç®—ä¸¤ä¸ªæ•´æ•°è¾“å…¥å€¼æ˜¯å¦æŒ‰ä½å¤§äºŽæˆ–等于å¦ä¸€ä¸ªã€‚" #: ../../doc/src/intrinsics/bit/bge.md:29 #: ../../doc/src/intrinsics/bit/bgt.md:29 #: ../../doc/src/intrinsics/bit/ble.md:29 #: ../../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 "支æŒçš„输入类型是 32 ä½å’Œ 64 ä½å¤§å°çš„æ•´æ•°ã€‚" #: ../../doc/src/intrinsics/bit/bge.md:60 #: ../../doc/src/intrinsics/bit/bgt.md:59 #: ../../doc/src/intrinsics/bit/bit_size.md:54 #: ../../doc/src/intrinsics/bit/ble.md:60 #: ../../doc/src/intrinsics/bit/blt.md:59 #: ../../doc/src/intrinsics/bit/btest.md:65 #: ../../doc/src/intrinsics/bit/shiftl.md:74 #: ../../doc/src/intrinsics/bit/shiftr.md:74 #: ../../doc/src/intrinsics/character/achar.md:63 #: ../../doc/src/intrinsics/character/adjustl.md:56 #: ../../doc/src/intrinsics/character/adjustr.md:57 #: ../../doc/src/intrinsics/character/char.md:63 #: ../../doc/src/intrinsics/character/len_trim.md:57 #: ../../doc/src/intrinsics/character/lge.md:72 #: ../../doc/src/intrinsics/kind-type/kind.md:72 #: ../../doc/src/intrinsics/misc/command_argument_count.md:40 #: ../../doc/src/intrinsics/misc/cpu_time.md:57 #: ../../doc/src/intrinsics/misc/date_and_time.md:83 #: ../../doc/src/intrinsics/misc/new_line.md:49 #: ../../doc/src/intrinsics/numeric/abs.md:89 #: ../../doc/src/intrinsics/numeric/aimag.md:62 #: ../../doc/src/intrinsics/numeric/aint.md:48 #: ../../doc/src/intrinsics/numeric/anint.md:51 #: ../../doc/src/intrinsics/numeric/ceiling.md:57 #: ../../doc/src/intrinsics/numeric/cmplx.md:68 #: ../../doc/src/intrinsics/numeric/conjg.md:62 #: ../../doc/src/intrinsics/numeric/digits.md:38 #: ../../doc/src/intrinsics/numeric/dim.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:57 #: ../../doc/src/intrinsics/numeric/erf.md:61 #: ../../doc/src/intrinsics/numeric/erfc.md:64 #: ../../doc/src/intrinsics/numeric/exp.md:65 #: ../../doc/src/intrinsics/numeric/floor.md:76 #: ../../doc/src/intrinsics/numeric/gamma.md:67 #: ../../doc/src/intrinsics/numeric/mod.md:89 msgid "**Result:**" msgstr "**结果:**" #: ../../doc/src/intrinsics/bit/bge.md:70 msgid "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." 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 "bgt(x, y):按ä½å¤§äºŽ" #: ../../doc/src/intrinsics/bit/bgt.md:3 msgid "Bitwise greater than." 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 "`bgt(x, y)` è®¡ç®—ä¸€ä¸ªæ•´æ•°è¾“å…¥å€¼æ˜¯å¦æŒ‰ä½å¤§äºŽå¦ä¸€ä¸ªã€‚" #: ../../doc/src/intrinsics/bit/bgt.md:68 msgid "[bge](bge.md), [ble](ble.md), [blt](blt.md)." 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 "bit_size(x): ä½å¤§å°" #: ../../doc/src/intrinsics/bit/bit_size.md:3 msgid "Bit size." msgstr "ä½å¤§å°ã€‚" #: ../../doc/src/intrinsics/bit/bit_size.md:16 msgid "`x` is integer input value." 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 "返回值是整数类型。" #: ../../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)` 计算 `x` 的二进制表示的包括符å·ä½åœ¨å†…çš„ä½æ•°ã€‚" #: ../../doc/src/intrinsics/bit/bit_size.md:29 msgid "Supported input types is integer." msgstr "支æŒçš„输入类型是整数。" #: ../../doc/src/intrinsics/bit/ble.md:1 msgid "bge(x, y): Bitwise Less or Equal" msgstr "bge(x, y):按ä½å°äºŽæˆ–等于" #: ../../doc/src/intrinsics/bit/ble.md:3 msgid "Bitwise less than or equal to." 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 "`ble(x, y)` è®¡ç®—ä¸€ä¸ªæ•´æ•°è¾“å…¥å€¼æ˜¯å¦æŒ‰ä½å°äºŽæˆ–等于å¦ä¸€ä¸ªã€‚" #: ../../doc/src/intrinsics/bit/ble.md:70 msgid "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." 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 "blt(x, y):按ä½å°äºŽ" #: ../../doc/src/intrinsics/bit/blt.md:3 msgid "Bitwise less than." 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 "`blt(x, y)` è®¡ç®—ä¸€ä¸ªæ•´æ•°è¾“å…¥å€¼æ˜¯å¦æŒ‰ä½å°äºŽå¦ä¸€ä¸ªã€‚" #: ../../doc/src/intrinsics/bit/blt.md:68 msgid "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." 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 "btest(x, pos):ä½ç½®ä½æµ‹è¯•" #: ../../doc/src/intrinsics/bit/btest.md:3 msgid "Bit test." 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 "`x` å’Œ `pos` 是整数输入值。 两个输入值是åŒä¸€ç§ç±»åž‹ã€‚ `pos` 表示在 `x` " "中的ä½ç½®ã€‚" #: ../../doc/src/intrinsics/bit/btest.md:21 msgid "The return value is of type logical." msgstr "返回值是逻辑类型。" #: ../../doc/src/intrinsics/bit/btest.md:25 msgid "" "`btest(x, pos)` calculates if `pos` bit in input integer value `x` is " "set. The counting of the bits starts at 0, at least significant bit (LSB)" " i.e., the rightmost bit in `x`." 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 "如果 `pos` å°äºŽ 0 或大于 `bit_size()`,则 `btest(x, pos)` " "错误并显示ä¸å…许的消æ¯ã€‚" #: ../../doc/src/intrinsics/bit/shiftl.md:1 msgid "shiftl(x, shift): Shift Left" msgstr "shiftl(x, shift):左移" #: ../../doc/src/intrinsics/bit/shiftl.md:3 msgid "Logical shift left function." msgstr "逻辑左移函数。" #: ../../doc/src/intrinsics/bit/shiftl.md:16 #: ../../doc/src/intrinsics/bit/shiftr.md:16 msgid "`x` is an integer input value." 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 "`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 "返回值是整数类型,与 `x` 类型相åŒã€‚" #: ../../doc/src/intrinsics/bit/shiftl.md:27 msgid "" "**shiftl(x, shift)** logically left shifts `x` by `shift` number of bits." " `shiftl` shifts from LSB(**L**east **S**ignificant **B**it) to " "MSB(**M**ost **S**ignificant **B**it). Bits shifted from the left end " "i.e., MSB bits are lost. Zeroes are appended to the opposite right end." 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 "æ— ç¬¦å·æ•´æ•°å€¼`x`å’Œæ— ç¬¦å·æ•´æ•°å€¼`shift`中支æŒçš„类型(7ã€31ã€63)å°äºŽæˆ–等于`x`çš„" "ä½å¤§å°ã€‚" #: ../../doc/src/intrinsics/bit/shiftl.md:82 msgid "[shiftr](shiftr.md)." msgstr "[shiftr](shiftr.md)。" #: ../../doc/src/intrinsics/bit/shiftr.md:1 msgid "shiftr(x, shift): Shift Right" msgstr "shiftr(x, shift):å³ç§»" #: ../../doc/src/intrinsics/bit/shiftr.md:3 msgid "Logical shift right function." msgstr "逻辑å³ç§»åŠŸèƒ½ã€‚" #: ../../doc/src/intrinsics/bit/shiftr.md:27 msgid "" "**shiftr(x, shift)** logically right shifts `x` by `shift` number of " "bits. `shiftr` shifts from MSB(**M**ost **S**ignificant **B**it) to " "LSB(**L**east **S**ignificant **B**it). Bits shifted from the right end " "i.e., LSB bits are lost. Zeroes are appended to the opposite left end." 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 "[shiftl](shiftl.md)。" #: ../../doc/src/intrinsics/character.md:1 msgid "Character Intrinsic Functions" msgstr "字符内置函数" #: ../../doc/src/intrinsics/character/achar.md:1 msgid "achar(x, kind): To Character in ASCII set." msgstr "achar(x, kind): ASCII 集中的字符。" #: ../../doc/src/intrinsics/character/achar.md:3 msgid "Character represented by in the ASCII character set." 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 "`x`:整数类型的输入值。 `kind`:用于åˆå§‹åŒ–的整数常é‡è¡¨è¾¾å¼ç±»åž‹çš„å¯é€‰è¾“入值。" #: ../../doc/src/intrinsics/character/achar.md:20 #: ../../doc/src/intrinsics/character/adjustl.md:18 #: ../../doc/src/intrinsics/character/adjustr.md:18 #: ../../doc/src/intrinsics/character/char.md:21 #: ../../doc/src/intrinsics/character/len_trim.md:18 msgid "Return value" 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 "返回值是长度为 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 "如果传入å¯é€‰è¾“入值,则返回值为 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 "**achar(x, kind)** 返回由 ASCII 字符集在 `x` ä½ç½®è¡¨ç¤ºçš„字符。" #: ../../doc/src/intrinsics/character/achar.md:32 #: ../../doc/src/intrinsics/character/char.md:33 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 "如果 `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 "它是一个è¿è¡Œæ—¶å†…置函数。" #: ../../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 "[lge](lge.md)." #: ../../doc/src/intrinsics/character/adjustl.md:1 msgid "adjustl(string): Left Adjust String" msgstr "adjustl(string): 左调整字符串" #: ../../doc/src/intrinsics/character/adjustl.md:3 msgid "Left adjust a string." 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 "`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 "返回值是字符类型,与输入值`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 "**adjustl(string)** " "通过删除任何å‰å¯¼ç©ºæ ¼å¹¶é™„åŠ ç›¸åŒæ•°é‡çš„空格æ¥è°ƒæ•´è¾“入字符串。" #: ../../doc/src/intrinsics/character/adjustl.md:30 #: ../../doc/src/intrinsics/character/adjustr.md:31 msgid "Supported argument type is character." msgstr "支æŒçš„傿•°ç±»åž‹æ˜¯å­—符。" #: ../../doc/src/intrinsics/character/adjustr.md:1 msgid "adjustr(string): Right Adjust String" msgstr "调整器(字符串):å³è°ƒæ•´å­—符串" #: ../../doc/src/intrinsics/character/adjustr.md:3 msgid "Right adjust a string." 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 "返回值是字符类型,与输入值`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 "**adjustr(string)** " "通过删除任何尾éšç©ºæ ¼å¹¶åœ¨è¾“å…¥å­—ç¬¦ä¸²çš„å¼€å¤´æ·»åŠ ç›¸åŒæ•°é‡çš„空格æ¥è°ƒæ•´è¾“入字符串。" #: ../../doc/src/intrinsics/character/adjustr.md:65 msgid "[adjustl](adjustl.md)." msgstr "[adjustl](adjustl.md)。" #: ../../doc/src/intrinsics/character/char.md:1 msgid "char(x, [, kind]): Integer to Character" msgstr "char(x, [, kind]):整数到字符" #: ../../doc/src/intrinsics/character/char.md:3 msgid "Integer to character conversion." msgstr "整数到字符的转æ¢ã€‚" #: ../../doc/src/intrinsics/character/char.md:16 msgid "`x`: the input value of integer type." 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 "`kind`:用于åˆå§‹åŒ–的整数常é‡è¡¨è¾¾å¼ç±»åž‹çš„å¯é€‰è¾“入值。 这表示结果的ç§ç±»å‚数。" #: ../../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)** 返回由 ASCII 字符集在 `x` ä½ç½®è¡¨ç¤ºçš„字符。" #: ../../doc/src/intrinsics/character/char.md:71 msgid "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" 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 "len_trim(string): 忽略尾éšç©ºæ ¼çš„长度" #: ../../doc/src/intrinsics/character/len_trim.md:3 msgid "Length of a character string ignoring trailing blank character(s)." msgstr "忽略尾éšç©ºç™½å­—符的字符串长度。" #: ../../doc/src/intrinsics/character/len_trim.md:16 msgid "`string` the input value of character type." msgstr "`string` 字符类型的输入值。" #: ../../doc/src/intrinsics/character/len_trim.md:20 msgid "The return value is of type unsigned integer." 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 "**len_trim(string)** è¿”å›žå­—ç¬¦å‚æ•°çš„长度,ä¸åŒ…括尾éšç©ºç™½å­—符。" #: ../../doc/src/intrinsics/character/len_trim.md:29 msgid "Supported argument type is character scalar." msgstr "支æŒçš„傿•°ç±»åž‹æ˜¯å­—符标é‡ã€‚" #: ../../doc/src/intrinsics/character/lge.md:1 msgid "lge(x, y): Lexically Greater or Equal" msgstr "lge(x, y)ï¼šè¯æ³•上大于或等于" #: ../../doc/src/intrinsics/character/lge.md:3 msgid "Lexically greater than or equal." msgstr "è¯æ³•上大于或等于。" #: ../../doc/src/intrinsics/character/lge.md:17 msgid "`x` input value of type character." msgstr "`x` 类型字符的输入值。" #: ../../doc/src/intrinsics/character/lge.md:19 msgid "`y` input value of type character." msgstr "`y` 类型字符的输入值。" #: ../../doc/src/intrinsics/character/lge.md:21 msgid "`x` and `y` can be seen as string A and string B." msgstr "`x` å’Œ `y` å¯ä»¥çœ‹ä½œæ˜¯å­—符串 A 和字符串 B。" #: ../../doc/src/intrinsics/character/lge.md:25 msgid "The return value is of logical `true` or `false` type." msgstr "返回值是逻辑 `true` 或 `false` 类型。" #: ../../doc/src/intrinsics/character/lge.md:27 msgid "`True` if `x` string is lexically greater than or equal to `y`." msgstr "如果 `x` å­—ç¬¦ä¸²åœ¨è¯æ³•上大于或等于 `y`,则为 `True`。" #: ../../doc/src/intrinsics/character/lge.md:29 msgid "`False` if they are not." msgstr "å¦‚æžœä¸æ˜¯ï¼Œåˆ™ä¸º`False`。" #: ../../doc/src/intrinsics/character/lge.md:33 msgid "" "**lge(x, y)** determines if input string `x` is lexically greater than or" " equal to input string `y`. The two strings in comparison are interpreted" " as containing ASCII character codes." msgstr "" "**lge(x, y)** 确定输入字符串 `x` åœ¨è¯æ³•上是å¦å¤§äºŽæˆ–等于输入字符串 `y`。 " "æ¯”è¾ƒçš„ä¸¤ä¸ªå­—ç¬¦ä¸²è¢«è§£é‡Šä¸ºåŒ…å« ASCII 字符代ç ã€‚" #: ../../doc/src/intrinsics/character/lge.md:39 msgid "Argument types should be of type character literal." msgstr "傿•°ç±»åž‹åº”该是字符文字类型。" #: ../../doc/src/intrinsics/character/lge.md:81 msgid "[len_trim](len_trim.md)." msgstr "[len_trim](len_trim.md)." #: ../../doc/src/intrinsics/kind-type.md:1 msgid "Kind Type Intrinsic Functions" msgstr "ç§ç±»ç±»åž‹å†…置函数" #: ../../doc/src/intrinsics/kind-type/kind.md:1 msgid "kind(x): Kind of an Entity" msgstr "kind(x):实体的ç§ç±»" #: ../../doc/src/intrinsics/kind-type/kind.md:3 msgid "Kind of an entity." 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 "`x` 输入值,å¯ä»¥æ˜¯é€»è¾‘ã€æ•´æ•°ã€å®žæ•°ã€å¤æ•°æˆ–字符。 " "它å¯ä»¥æ˜¯æ ‡é‡æˆ–数组值,å³ä»»ä½•内在类型。" #: ../../doc/src/intrinsics/kind-type/kind.md:21 msgid "The return value is of integer type and of default integer kind." msgstr "返回值是整数类型和默认整数类型。" #: ../../doc/src/intrinsics/kind-type/kind.md:25 msgid "**kind(x)** returns the kind parameter of the input argument `x`." msgstr "**kind(x)** è¿”å›žè¾“å…¥å‚æ•° `x` çš„ç§ç±»å‚数。" #: ../../doc/src/intrinsics/kind-type/kind.md:29 msgid "" "Supported argument types are logical, integer, real, complex, or " "character." msgstr "支æŒçš„傿•°ç±»åž‹æ˜¯é€»è¾‘ã€æ•´æ•°ã€å®žæ•°ã€å¤æ•°æˆ–字符。" #: ../../doc/src/intrinsics/kind-type/kind.md:81 #: ../../doc/src/intrinsics/misc/command_argument_count.md:16 #: ../../doc/src/intrinsics/misc/cpu_time.md:20 #: ../../doc/src/intrinsics/misc/date_and_time.md:41 #: ../../doc/src/intrinsics/misc/new_line.md:58 msgid "None." msgstr "无。" #: ../../doc/src/intrinsics/mathematical.md:1 msgid "Mathematical Intrinsic Functions" msgstr "数学内置函数" #: ../../doc/src/intrinsics/mathematical/acos.md:1 msgid "acos(x): Trigonometric Arc Cosine" msgstr "acos(x):三角å余弦" #: ../../doc/src/intrinsics/mathematical/acos.md:3 msgid "Trigonometric arc cosine (inverse cosine) function." 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 "`x` 输入值,å¯ä»¥æ˜¯å®žæ•°æˆ–夿•°ï¼› å°äºŽæˆ–等于 1。" #: ../../doc/src/intrinsics/mathematical/acos.md:20 #: ../../doc/src/intrinsics/mathematical/acosh.md:21 #: ../../doc/src/intrinsics/mathematical/asin.md:20 #: ../../doc/src/intrinsics/mathematical/asinh.md:21 #: ../../doc/src/intrinsics/mathematical/atan.md:20 #: ../../doc/src/intrinsics/mathematical/atanh.md:21 msgid "" "The returned value has the kind of the input value and TYPE may be real " "or complex." msgstr "返回值具有输入值的ç§ç±»ï¼ŒTYPE å¯èƒ½æ˜¯å®žæ•°æˆ–夿•°ã€‚" #: ../../doc/src/intrinsics/mathematical/acos.md:25 msgid "**acos(x)** computes the arcsine of the argument **x**." 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 "å余弦是余弦函数的å函数。 " "当已知直角三角形的斜边和底边的长度时,它通常用于三角学中以找到角度。" #: ../../doc/src/intrinsics/mathematical/acos.md:33 #: ../../doc/src/intrinsics/mathematical/acosh.md:45 #: ../../doc/src/intrinsics/mathematical/asin.md:33 #: ../../doc/src/intrinsics/mathematical/asinh.md:37 #: ../../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 "支æŒçš„傿•°ç±»åž‹ floatã€doubleã€complex floatã€complex double。" #: ../../doc/src/intrinsics/mathematical/acos.md:84 msgid "[asin](asin.md), [atan](atan.md)." msgstr "[asin](asin.md),[atan](atan.md)。" #: ../../doc/src/intrinsics/mathematical/acosh.md:1 msgid "acosh(x): Inverse Hyperbolic Cosine" msgstr "acosh(x):ååŒæ›²ä½™å¼¦" #: ../../doc/src/intrinsics/mathematical/acosh.md:3 msgid "Inverse hyperbolic cosine function." msgstr "ååŒæ›²ä½™å¼¦å‡½æ•°ã€‚" #: ../../doc/src/intrinsics/mathematical/acosh.md:16 #: ../../doc/src/intrinsics/mathematical/asinh.md:16 #: ../../doc/src/intrinsics/mathematical/atanh.md:16 msgid "" "`x` the input value, can be real with value greater than or equal to 1 or" " of type complex." msgstr "`x` 输入值,å¯ä»¥æ˜¯å¤§äºŽæˆ–等于 1 的实数,也å¯ä»¥æ˜¯å¤æ•°ç±»åž‹ã€‚" #: ../../doc/src/intrinsics/mathematical/acosh.md:26 msgid "**acosh(x)** computes the inverse hyperbolic cosine function of **x**." 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 "结果类型和ç§ç±»ä¸Žè¾“入值`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 "å¦‚æžœç»“æžœä¸ºå¤æ•°ï¼Œåˆ™å®žéƒ¨ä¸ºéžè´Ÿæ•°ï¼Œè™šéƒ¨ä»¥å¼§åº¦å’ŒèŒƒå›´å†…çš„ lients 表示" #: ../../doc/src/intrinsics/mathematical/acosh.md:33 msgid "$-\\pi <= img (acosh(x)) <= \\pi$" 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 "对于域 $x > 1$ 中的实数值 $x$,ååŒæ›²ä½™å¼¦æ»¡è¶³ï¼š" #: ../../doc/src/intrinsics/mathematical/acosh.md:38 msgid "$cosh^{-1}(x) = \\log(x + \\sqrt{(x^2 - 1)})$" 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 "å¯¹äºŽå¤æ•° $x = x + iy$,以åŠåŸŸ $-\\infty < z <= 1$ 中的实数值,调用 $acosh(z)$" " è¿”å›žå¤æ•°ç»“果。" #: ../../doc/src/intrinsics/mathematical/acosh.md:88 msgid "[asinh](asinh.md), [atanh](atanh.md)." msgstr "[asinh](asinh.md),[atanh](atanh.md)。" #: ../../doc/src/intrinsics/mathematical/asin.md:1 msgid "asin(x): Trigonometric Arcsine" msgstr "asin(x)ï¼šä¸‰è§’åæ­£å¼¦" #: ../../doc/src/intrinsics/mathematical/asin.md:3 msgid "Trigonometric arcsine function." msgstr "ä¸‰è§’åæ­£å¼¦å‡½æ•°ã€‚" #: ../../doc/src/intrinsics/mathematical/asin.md:25 msgid "**asin(x)** computes the arcsine of the argument **x**." 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 "åæ­£å¼¦æ˜¯æ­£å¼¦å‡½æ•°çš„å函数。 " "当已知直角三角形的斜边和对边的长度时,它通常用于三角学中以找到角度。" #: ../../doc/src/intrinsics/mathematical/asin.md:84 msgid "[acos](acos.md), [atan](atan.md)." msgstr "[acos](acos.md), [atan](atan.md)." #: ../../doc/src/intrinsics/mathematical/asinh.md:1 msgid "asinh(x): Inverse Hyperbolic Arcsine" msgstr "asinh(x):ååŒæ›²å正弦" #: ../../doc/src/intrinsics/mathematical/asinh.md:3 msgid "Inverse hyperbolic arcsine function." msgstr "ååŒæ›²å正弦函数。" #: ../../doc/src/intrinsics/mathematical/asinh.md:26 msgid "**asinh(x)** computes the inverse hyperbolic arcsine function of **x**." 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 "å¦‚æžœç»“æžœä¸ºå¤æ•°ï¼Œåˆ™å®žéƒ¨ä¸ºéžè´Ÿæ•°ï¼Œè™šéƒ¨ä»¥å¼§åº¦è¡¨ç¤ºï¼Œä½äºŽèŒƒå›´å†…" #: ../../doc/src/intrinsics/mathematical/asinh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (asinh(x)) <= \\frac{\\pi}{2}$" 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 "[acosh](acosh.md), [atanh](atanh.md)." #: ../../doc/src/intrinsics/mathematical/atan.md:1 msgid "atan(x): Trigonometric ArcTangent" msgstr "atan(x):三角函数 ArcTangent" #: ../../doc/src/intrinsics/mathematical/atan.md:3 msgid "Trigonometric arctangent (inverse arctangent) function." msgstr "ä¸‰è§’åæ­£åˆ‡ï¼ˆå正切)函数。" #: ../../doc/src/intrinsics/mathematical/atan.md:25 msgid "**atan(x)** computes the arctangent of the argument **x**." msgstr "**atan(x)** è®¡ç®—å‚æ•° **x** çš„åæ­£åˆ‡ã€‚" #: ../../doc/src/intrinsics/mathematical/atan.md:27 msgid "" "The arc tangent is the inverse function of the arctangent function. It is" " commonly used in trigonometry to find the angle when the lengths of the " "opposite side of a right triangle and base are known, i.e., perpendicular" " and base length." msgstr "åæ­£åˆ‡æ˜¯å正切函数的å函数。 当直角三角形的对边和底边的长度已知时,å³åž‚直和底" "边长度,它通常用于三角学中找到角度。" #: ../../doc/src/intrinsics/mathematical/atan.md:84 msgid "[asin](asin.md), [acos](acos.md)." msgstr "[asin](asin.md), [acos](acos.md)." #: ../../doc/src/intrinsics/mathematical/atan2.md:1 msgid "atan2(y, x): ArcTangent" msgstr "atan2(y, x)ï¼šåæ­£åˆ‡" #: ../../doc/src/intrinsics/mathematical/atan2.md:3 msgid "Arctangent function or inverse tangent function." msgstr "åæ­£åˆ‡å‡½æ•°æˆ–åæ­£åˆ‡å‡½æ•°ã€‚" #: ../../doc/src/intrinsics/mathematical/atan2.md:15 msgid "`y` the input value is the imaginary part of the complex expression" 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 "$x + iy$" #: ../../doc/src/intrinsics/mathematical/atan2.md:19 msgid "`x` the input value, must be real part of the complex expression." 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 "返回值具有与输入值 `y` 相åŒçš„ç§ç±»å’Œç±»åž‹ã€‚ è¿”å›žå¤æ‚è¡¨è¾¾å¼ $x + iy$ " "çš„å‚æ•°å‡½æ•°çš„主值。" #: ../../doc/src/intrinsics/mathematical/atan2.md:29 msgid "" "**atan2(y, x)** computes the principal value of the argument function of " "the complex expression $x + iy$. This is used to transform from cartesian" " into polar coordinates and allows to determine the angle in the correct " "quadrant." msgstr "" "**atan2(y, x)** è®¡ç®—å¤æ•°è¡¨è¾¾å¼ $x + iy$ çš„å‚æ•°å‡½æ•°çš„主值。 " "这用于从笛å¡å°”åæ ‡è½¬æ¢ä¸ºæžå标,并å…许确定正确象é™ä¸­çš„角度。" #: ../../doc/src/intrinsics/mathematical/atan2.md:33 msgid "It is also represented as:" msgstr "它也表示为:" #: ../../doc/src/intrinsics/mathematical/atan2.md:35 msgid "$tan^{-1}(\\frac{y}{x})$" 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 "如果 `x` ä¸ä¸ºé›¶ï¼Œåˆ™ç»“æžœä½äºŽä»¥ä¸‹èŒƒå›´å†…:" #: ../../doc/src/intrinsics/mathematical/atan2.md:39 msgid "$-\\pi <= atan(x) <= \\pi$" msgstr "$-\\pi <= atan(x) <= \\pi$" #: ../../doc/src/intrinsics/mathematical/atan2.md:41 msgid "The sign is positive if `y` is positive." 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 "如果 `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 "如果 `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 "如果 `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 "如果 `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 "如果 `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 "支æŒçš„傿•°ç±»åž‹æ˜¯å®žæ•°ã€‚" #: ../../doc/src/intrinsics/mathematical/atanh.md:1 msgid "atanh(x): Inverse Hyperbolic Tangent" msgstr "atanh(x):ååŒæ›²æ­£åˆ‡" #: ../../doc/src/intrinsics/mathematical/atanh.md:3 msgid "Inverse hyperbolic tangent function." msgstr "ååŒæ›²æ­£åˆ‡å‡½æ•°ã€‚" #: ../../doc/src/intrinsics/mathematical/atanh.md:26 msgid "**atanh(x)** computes the inverse hyperbolic tangent function of **x**." 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 "å¦‚æžœç»“æžœä¸ºå¤æ•°ï¼Œåˆ™è™šéƒ¨ä»¥å¼§åº¦è¡¨ç¤ºï¼Œä½äºŽèŒƒå›´å†…" #: ../../doc/src/intrinsics/mathematical/atanh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (atanh(x)) <= \\frac{\\pi}{2}$" 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 "如果结果是实数,它ä½äºŽèŒƒå›´å†…" #: ../../doc/src/intrinsics/mathematical/atanh.md:37 msgid "$-1.0 < atanh(x) < 1.0$" msgstr "$-1.0 < atanh(x) < 1.0$" #: ../../doc/src/intrinsics/mathematical/atanh.md:84 msgid "[asinh](asinh.md), [acosh](acosh.md)." msgstr "[asinh](asinh.md),[acosh](acosh.md)。" #: ../../doc/src/intrinsics/mathematical/fraction.md:1 msgid "fraction(x): Fractional Part in Model Representation" msgstr "fraction(x)ï¼šæ¨¡åž‹è¡¨ç¤ºä¸­çš„å°æ•°éƒ¨åˆ†" #: ../../doc/src/intrinsics/mathematical/fraction.md:3 msgid "Fractional part of the model representation." msgstr "æ¨¡åž‹è¡¨ç¤ºçš„å°æ•°éƒ¨åˆ†ã€‚" #: ../../doc/src/intrinsics/mathematical/fraction.md:15 msgid "`x` the input value, must be real." 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 "返回值具有输入值的ç§ç±»ã€‚ è¿”å›žè¾“å…¥å€¼çš„æ¨¡åž‹è¡¨ç¤ºçš„å°æ•°éƒ¨åˆ†ã€‚" #: ../../doc/src/intrinsics/mathematical/fraction.md:24 msgid "" "**fraction(x)** computes the fractional part of the model representation " "of **x**." 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 "它是使用以下方法计算的:" #: ../../doc/src/intrinsics/mathematical/fraction.md:28 msgid "$x * {radix(x)}^{(-exponent(x))}$" msgstr "$x * {radix(x)}^{(-exponent(x))}$" #: ../../doc/src/intrinsics/misc.md:1 msgid "Miscellaneous Intrinsic Functions" msgstr "其他内置函数" #: ../../doc/src/intrinsics/misc/command_argument_count.md:1 msgid "command_argument_count(): Number of Command Line Arguments" msgstr "command_argument_count()ï¼šå‘½ä»¤è¡Œå‚æ•°çš„æ•°é‡" #: ../../doc/src/intrinsics/misc/command_argument_count.md:3 msgid "Get number of command line arguments." msgstr "获å–å‘½ä»¤è¡Œå‚æ•°çš„æ•°é‡ã€‚" #: ../../doc/src/intrinsics/misc/command_argument_count.md:20 msgid "The return value is of integer type and of default kind." 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 "**command_argument_count()** è¿”å›žè°ƒç”¨æŒ‡å®šç¨‹åºæ—¶åœ¨å‘½ä»¤è¡Œä¸Šä¼ é€’çš„å‚æ•°æ•°é‡ã€‚" #: ../../doc/src/intrinsics/misc/command_argument_count.md:29 msgid "Any." msgstr "ä»»æ„。" #: ../../doc/src/intrinsics/misc/cpu_time.md:1 msgid "cpu_time(x): CPU Elapsed Time" msgstr "cpu_time(x):CPU è¿è¡Œæ—¶é—´" #: ../../doc/src/intrinsics/misc/cpu_time.md:3 msgid "CPU elapsed time in seconds." msgstr "CPU è¿è¡Œæ—¶é—´ï¼ˆä»¥ç§’为å•ä½ï¼‰ã€‚" #: ../../doc/src/intrinsics/misc/cpu_time.md:16 msgid "`x` the input value should be of type real with `intent(out)`." msgstr "`x` 输入值应该是带有 `intent(out)` 的实数类型。" #: ../../doc/src/intrinsics/misc/cpu_time.md:24 msgid "" "**cpu_time(time)** returns a real value representing the elapsed CPU time" " in seconds. If tine source is available, time will be reported with " "microsecond resolution. If no time source is available, TIME is set to " "-1.0." 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 "è¿™å¯¹äºŽæµ‹è¯•ä»£ç æ®µä»¥ç¡®å®šè®¡ç®—时间很有用。" #: ../../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 "`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 "支æŒçš„è¾“å…¥å‚æ•°ç±»åž‹ä¸º `intent(out)` 和实数。" #: ../../doc/src/intrinsics/misc/date_and_time.md:1 msgid "date_and_time([date, time, zone, values]): Date and Time" msgstr "date_and_time([date, time, zone, values]):日期和时间" #: ../../doc/src/intrinsics/misc/date_and_time.md:3 msgid "Date and time subroutine." 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 "" "`zone` the input value of character type, which has length 5 or larger. " "It is of default kind. It is `intent(out)` and has from `(+-)hhmm`, " "representing the difference with respect to Coordinates Universal Time " "(UTC). Unavailable time and date parameters return blanks." 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 "`values`整数类型的输入值,8ä½ã€‚ 它是`intent(out)`。 它æä¾›ä»¥ä¸‹å†…容:" #: ../../doc/src/intrinsics/misc/date_and_time.md:30 msgid "`value(1)`: The year." msgstr "`value(1)`:年份。" #: ../../doc/src/intrinsics/misc/date_and_time.md:31 msgid "`value(2)`: The month." msgstr "`value(2)`:月份。" #: ../../doc/src/intrinsics/misc/date_and_time.md:32 msgid "`value(3)`: The day of the month." msgstr "`value(3)`:一个月中的哪一天。" #: ../../doc/src/intrinsics/misc/date_and_time.md:33 msgid "`value(4)`: Time difference with UTC in minutes." msgstr "`value(4)`:与 UTC 的时差,以分钟为å•ä½ã€‚" #: ../../doc/src/intrinsics/misc/date_and_time.md:34 msgid "`value(5)`: The hour of the day." msgstr "`value(5)`ï¼šä¸€å¤©ä¸­çš„å°æ—¶ã€‚" #: ../../doc/src/intrinsics/misc/date_and_time.md:35 msgid "`value(6)`: The minutes of the hour." msgstr "`value(6)`ï¼šå°æ—¶çš„分钟数。" #: ../../doc/src/intrinsics/misc/date_and_time.md:36 msgid "`value(7)`: The seconds of the minutes." msgstr "`value(7)`:分钟的秒数。" #: ../../doc/src/intrinsics/misc/date_and_time.md:37 msgid "`value(8)`: The milliseconds of the second." 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 "**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 "`date`ã€`time`ã€`zone`ã€`values` è¡¨ç¤ºæ—¥æœŸã€æ—¶é—´ã€åŒºåŸŸå’Œå€¼ï¼Œå¦‚ä¸Šè¿°å‚æ•°ä¸­æ‰€è¿°ã€‚" #: ../../doc/src/intrinsics/misc/date_and_time.md:51 msgid "Unavailable or errorneous date and time parameters return blanks." msgstr "ä¸å¯ç”¨æˆ–é”™è¯¯çš„æ—¥æœŸå’Œæ—¶é—´å‚æ•°è¿”回空白。" #: ../../doc/src/intrinsics/misc/date_and_time.md:92 msgid "[cpu_time](cpu_time.md)." msgstr "[cpu_time](cpu_time.md)。" #: ../../doc/src/intrinsics/misc/new_line.md:1 msgid "new_line(x): New Line Character" msgstr "new_line(x):æ¢è¡Œç¬¦" #: ../../doc/src/intrinsics/misc/new_line.md:3 msgid "New line character." 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 "è¾“å…¥å‚æ•° `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 "返回值是一个长度为 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 "**new_line(x)** 返回æ¢è¡Œç¬¦ã€‚ 返回值是 ASCII æ¢è¡Œç¬¦ã€‚" #: ../../doc/src/intrinsics/misc/new_line.md:31 msgid "Supported input parameter types is character." msgstr "支æŒçš„è¾“å…¥å‚æ•°ç±»åž‹æ˜¯å­—符。" #: ../../doc/src/intrinsics/numeric.md:1 msgid "Numeric Intrinsic Functions" msgstr "数值内置函数" #: ../../doc/src/intrinsics/numeric/abs.md:1 msgid "abs(x): Absolute Value" msgstr "abs(x):ç»å¯¹å€¼" #: ../../doc/src/intrinsics/numeric/abs.md:3 msgid "Absolute value." msgstr "ç»å¯¹å€¼ã€‚" #: ../../doc/src/intrinsics/numeric/abs.md:17 msgid "`x` the input value, can be integer, real, or complex." 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 "返回值的类型和ç§ç±»ä¸Ž `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 "**abs(x)** 计算并返回 `x` çš„ç»å¯¹å€¼ã€‚ 结果使用数学公å¼è®¡ç®—:" #: ../../doc/src/intrinsics/numeric/abs.md:29 msgid "$|x|$" msgstr "$|x|$" #: ../../doc/src/intrinsics/numeric/abs.md:31 msgid "If `x` is complex, the result is calculated using mathematical formula:" msgstr "如果 `x` æ˜¯å¤æ•°ï¼Œåˆ™ä½¿ç”¨æ•°å­¦å…¬å¼è®¡ç®—结果:" #: ../../doc/src/intrinsics/numeric/abs.md:33 msgid "$\\sqrt{(x^2 + y^2)}$" 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 "支æŒçš„傿•°ç±»åž‹æ˜¯å®žæ•°å’Œæ•´æ•°ã€‚" #: ../../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 "[ceiling](ceiling.md),[floor](floor.md)。" #: ../../doc/src/intrinsics/numeric/aimag.md:1 msgid "aimag(x): Imaginary Part" msgstr "aimag(x):虚部" #: ../../doc/src/intrinsics/numeric/aimag.md:3 msgid "Imaginary part of complex number." msgstr "夿•°çš„虚部。" #: ../../doc/src/intrinsics/numeric/aimag.md:17 msgid "`x` the input value must be of complex type." 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 "返回值是类型为实数的虚数部分,ç§ç±»ä¸Ž`x` 相åŒã€‚" #: ../../doc/src/intrinsics/numeric/aimag.md:25 msgid "**aimag(x)** returns the imaginary part of the input complex argument `x`." msgstr "**aimag(x)** 返回输入å¤å‚æ•° `x` 的虚部。" #: ../../doc/src/intrinsics/numeric/aimag.md:27 #: ../../doc/src/intrinsics/numeric/cmplx.md:41 #: ../../doc/src/intrinsics/numeric/conjg.md:27 msgid "" "For `x` complex input value, the result is calculated using mathematical " "formula:" 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 "$i$ 虚部是结果。" #: ../../doc/src/intrinsics/numeric/aimag.md:35 msgid "Supported argument types are complex." msgstr "支æŒçš„傿•°ç±»åž‹å¾ˆå¤æ‚。" #: ../../doc/src/intrinsics/numeric/aint.md:1 msgid "aint(x, [kind]): Truncate to a Whole Number" msgstr "aint(x, [kind]):截断为整数" #: ../../doc/src/intrinsics/numeric/aint.md:3 msgid "Truncate to a whole number." msgstr "截断到一个整数。" #: ../../doc/src/intrinsics/numeric/aint.md:16 #: ../../doc/src/intrinsics/numeric/anint.md:16 #: ../../doc/src/intrinsics/numeric/epsilon.md:16 #: ../../doc/src/intrinsics/numeric/erf.md:16 #: ../../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 "`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 "`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 "如果 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 "返回值等于或最接近大于或等于 `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 "**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 "å¯é€‰å‚æ•° `kind` ,指定结果的ç§ç±»ã€‚" #: ../../doc/src/intrinsics/numeric/aint.md:37 #: ../../doc/src/intrinsics/numeric/anint.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:31 #: ../../doc/src/intrinsics/numeric/erf.md:35 #: ../../doc/src/intrinsics/numeric/erfc.md:38 #: ../../doc/src/intrinsics/numeric/floor.md:35 #: ../../doc/src/intrinsics/numeric/gamma.md:40 msgid "Supported argument types is real." msgstr "支æŒçš„傿•°ç±»åž‹æ˜¯å®žæ•°ã€‚" #: ../../doc/src/intrinsics/numeric/aint.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:85 msgid "[ceiling](ceiling.md), [mod](mod.md)." msgstr "[ceiling](ceiling.md), [mod](mod.md)." #: ../../doc/src/intrinsics/numeric/anint.md:1 msgid "anint(x, [kind]): Round to Nearest Whole Number" msgstr "anint(x, [kind]):四èˆäº”入到最近的整数" #: ../../doc/src/intrinsics/numeric/anint.md:3 msgid "Round to nearest whole number." msgstr "å››èˆäº”入到最近的整数。" #: ../../doc/src/intrinsics/numeric/anint.md:25 msgid "The return value is equal to rounded whole number." msgstr "返回值等于四èˆäº”入的整数。" #: ../../doc/src/intrinsics/numeric/anint.md:29 msgid "**anint(x)** calculates rounded value of input parameter `x`." 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 "如果`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 "如果`x` 大于0,`anint(x)` 返回`aint(x + 0.5)` 。" #: ../../doc/src/intrinsics/numeric/anint.md:60 msgid "[aint](aint.md)." msgstr "[aint](aint.md)。" #: ../../doc/src/intrinsics/numeric/ceiling.md:1 msgid "ceiling(x): Integer Ceiling" msgstr "ceiling(x)ï¼šè¿›ä¸€å–æ•´" #: ../../doc/src/intrinsics/numeric/ceiling.md:3 msgid "Integer ceiling function" msgstr "è¿›ä¸€å–æ•´å‡½æ•°" #: ../../doc/src/intrinsics/numeric/ceiling.md:16 msgid "The input value `x` may be of type real or integer." msgstr "输入值 `x` å¯ä»¥æ˜¯å®žæ•°æˆ–整数类型。" #: ../../doc/src/intrinsics/numeric/ceiling.md:20 msgid "The return value is of type integer and nearest greater integer." msgstr "返回值是整数类型和最接近它的更大整数。" #: ../../doc/src/intrinsics/numeric/ceiling.md:24 msgid "**ceiling(x)** returns the least integer greater than or equal to `x`." msgstr "**ceiling(x)** 返回大于或等于 `x` çš„æœ€å°æ•´æ•°ã€‚" #: ../../doc/src/intrinsics/numeric/ceiling.md:28 msgid "Supported input parameter types are integer and real." msgstr "支æŒçš„è¾“å…¥å‚æ•°ç±»åž‹æ˜¯æ•´æ•°å’Œå®žæ•°ã€‚" #: ../../doc/src/intrinsics/numeric/ceiling.md:66 msgid "[floor](floor.md), [mod](mod.md)." msgstr "[floor](floor.md),[mod](mod.md)。" #: ../../doc/src/intrinsics/numeric/cmplx.md:1 msgid "cmplx(x [, [, kind]]): Convert to Complex" msgstr "cmplx(x [, [, kind]]):转æ¢ä¸ºå¤æ•°" #: ../../doc/src/intrinsics/numeric/cmplx.md:3 msgid "Conversion to complex type." msgstr "转æ¢ä¸ºå¤æ•°ç±»åž‹ã€‚" #: ../../doc/src/intrinsics/numeric/cmplx.md:14 msgid "`cmplx(x, y)` is one of the intrinsic present in ASR." msgstr "`cmplx(x, y)` 是 ASR 中的内置函数之一。" #: ../../doc/src/intrinsics/numeric/cmplx.md:18 msgid "" "`x` the input value must be of integer, real, or complex. `y` the " "optional input value must be of type integer or real. It should be only " "present in case `x` is not complex. `kind` the optional input value of " "integer expression type for initialisation indicating the kind parameter " "of the result." 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 "è¿”å›žå€¼æ˜¯å¤æ•°ç±»åž‹ï¼Œç±»åž‹ç”±æŒ‡å®šçš„输入`kind`类型定义。如果未指定 `kind`," "则返回值为默认 `kind` `complex` 类型。" #: ../../doc/src/intrinsics/numeric/cmplx.md:32 msgid "" "**cmplx(x, [, y [, kind]])** converts the input value to complex " "representation:" 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 "`x` ä¸ºå¤æ•°çš„实部。如果 `y` 存在,则将其转æ¢ä¸ºè™šéƒ¨ã€‚" #: ../../doc/src/intrinsics/numeric/cmplx.md:37 msgid "If `y` is not present, the imaginary component is set to 0.0." msgstr "如果 `y` ä¸å­˜åœ¨ï¼Œåˆ™è™šéƒ¨è®¾ç½®ä¸º 0.0。" #: ../../doc/src/intrinsics/numeric/cmplx.md:39 msgid "If `x` is complex then `y` must not be present." msgstr "如果 `x` æ˜¯å¤æ•°ï¼Œåˆ™ `y` ä¸èƒ½å‡ºçŽ°ã€‚" #: ../../doc/src/intrinsics/numeric/cmplx.md:49 msgid "Supported argument types are integer, real, or complex." msgstr "支æŒçš„傿•°ç±»åž‹æ˜¯æ•´æ•°ã€å®žæ•°æˆ–夿•°ã€‚" #: ../../doc/src/intrinsics/numeric/conjg.md:1 msgid "conjg(x): Complex Conjugate" msgstr "conjg(x):å¤å…±è½­" #: ../../doc/src/intrinsics/numeric/conjg.md:3 msgid "Complex conjugate function." msgstr "å¤å…±è½­å‡½æ•°ã€‚" #: ../../doc/src/intrinsics/numeric/conjg.md:17 msgid "`x` the input value must be of type complex." msgstr "`x` è¾“å…¥å€¼å¿…é¡»æ˜¯å¤æ•°ç±»åž‹ã€‚" #: ../../doc/src/intrinsics/numeric/conjg.md:21 msgid "The return value is of complex type." msgstr "è¿”å›žå€¼æ˜¯å¤æ•°ç±»åž‹ã€‚" #: ../../doc/src/intrinsics/numeric/conjg.md:25 msgid "**conjg(x)** converts the input value `x` to its conjugate." msgstr "**conjg(x)** 将输入值 `x` 转æ¢ä¸ºå…¶å¤æ•°å…±è½­ã€‚" #: ../../doc/src/intrinsics/numeric/conjg.md:29 msgid "$x + iy$ converted to $x - iy$" msgstr "$x + iy$ 转æ¢ä¸º $x - iy$" #: ../../doc/src/intrinsics/numeric/conjg.md:35 msgid "Supported argument types is complex." msgstr "支æŒçš„傿•°ç±»åž‹æ˜¯å¤æ•°ã€‚" #: ../../doc/src/intrinsics/numeric/digits.md:1 msgid "digits(x): Significant Binary Digits" msgstr "digits(x):有效二进制数字" #: ../../doc/src/intrinsics/numeric/digits.md:3 msgid "Significant binary digits." msgstr "有效的二进制数字。" #: ../../doc/src/intrinsics/numeric/digits.md:15 msgid "`x` the input value must be of type real or integer." 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 "**digits(x)** 返回 `x` çš„å†…éƒ¨æ¨¡åž‹è¡¨ç¤ºçš„æœ‰æ•ˆäºŒè¿›åˆ¶ä½æ•°ã€‚" #: ../../doc/src/intrinsics/numeric/dim.md:1 msgid "dim(x, y): Positive Difference or 0" msgstr "dim(x, y):正差或 0" #: ../../doc/src/intrinsics/numeric/dim.md:3 msgid "Positive difference or 0." 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 "`x` 输入值必须是实数或整数类型。 `y` 输入值的类型和ç§ç±»å¿…须与 `x` 相åŒã€‚" #: ../../doc/src/intrinsics/numeric/dim.md:20 msgid "The return value is of type integer or real." 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 "**dim(x)** 计算 $x - y$ 的差值,如果结果为正,å¦åˆ™è¿”回 0。" #: ../../doc/src/intrinsics/numeric/epsilon.md:1 msgid "epsilon(x): Epsilon" msgstr "epsilon(x):ε å°é‡" #: ../../doc/src/intrinsics/numeric/epsilon.md:3 msgid "Epsilon function." msgstr "Epsilon 函数。" #: ../../doc/src/intrinsics/numeric/epsilon.md:20 msgid "The return value is of same type as of the input argument." msgstr "è¿”å›žå€¼ä¸Žè¾“å…¥å‚æ•°çš„类型相åŒã€‚" #: ../../doc/src/intrinsics/numeric/epsilon.md:24 msgid "" "**epsilon(x)** computes the smallest number $\\epsilon$ of the same kind " "as `x` following:" msgstr "**epsilon(x)** 计算与 `x` 相åŒç±»åž‹çš„æœ€å°æ•° $\\epsilon$,如下所示:" #: ../../doc/src/intrinsics/numeric/epsilon.md:27 msgid "$1 + \\epsilon > 1$" msgstr "$1 + \\epsilon > 1$" #: ../../doc/src/intrinsics/numeric/erf.md:1 msgid "erf(x): Error" msgstr "erf(x):误差函数" #: ../../doc/src/intrinsics/numeric/erf.md:3 msgid "Error function." 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 "返回值是 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 "**erf(x)** 计算 `x` 的误差函数。结果ä½äºŽä»¥ä¸‹èŒƒå›´å†…:" #: ../../doc/src/intrinsics/numeric/erf.md:27 msgid "$-1 \\leq erf (x) \\leq 1$" 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 "$\\frac{2}{\\sqrt\\pi}\\int_0^xe^{-t^2}dt$" #: ../../doc/src/intrinsics/numeric/erf.md:69 msgid "[erfc](erfc.md)." msgstr "[erfc](erfc.md)." #: ../../doc/src/intrinsics/numeric/erfc.md:1 msgid "erfc(x): Complementary Error" msgstr "erfc(x):互补误差" #: ../../doc/src/intrinsics/numeric/erfc.md:3 msgid "Complementary error function." 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 "返回值是 real ç±»åž‹ï¼Œä¸Žè¾“å…¥å‚æ•° `x` 的类型相åŒã€‚ `erfc(x)` 返回 $1 - erf(x)$。" #: ../../doc/src/intrinsics/numeric/erfc.md:27 msgid "$0 \\leq erf (x) \\leq 2$" 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 "$\\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 "它用于在相对精度æŸå¤±è¾ƒå¤§çš„æƒ…况下,如果为较大的 `x` 调用 `erf(x)` 并且从 1 " "中å‡åŽ»ç»“æžœã€‚" #: ../../doc/src/intrinsics/numeric/erfc.md:72 msgid "[erf](erf.md)." msgstr "[erf](erf.md)." #: ../../doc/src/intrinsics/numeric/exp.md:1 msgid "exp(x): Exponential" msgstr "exp(x):指数函数" #: ../../doc/src/intrinsics/numeric/exp.md:3 msgid "Exponential function." msgstr "指数函数。" #: ../../doc/src/intrinsics/numeric/exp.md:16 msgid "`x` the input value must be of type real or complex." msgstr "`x` è¾“å…¥å€¼å¿…é¡»æ˜¯å®žæ•°æˆ–å¤æ•°ç±»åž‹ã€‚" #: ../../doc/src/intrinsics/numeric/exp.md:20 msgid "The return value is of same type as of the input argument, `x`." msgstr "è¿”å›žå€¼ä¸Žè¾“å…¥å‚æ•° `x` 的类型相åŒã€‚" #: ../../doc/src/intrinsics/numeric/exp.md:24 msgid "**exp(x)** computes the base $e$ exponential of `x`, i.e., $e^x$." 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 "如果 `x` æ˜¯å¤æ•°ç±»åž‹ï¼Œå®ƒçš„虚部被认为是弧度值。" #: ../../doc/src/intrinsics/numeric/exp.md:31 msgid "Supported argument types is real and complex." msgstr "支æŒçš„傿•°ç±»åž‹æ˜¯å®žæ•°æˆ–夿•°ã€‚" #: ../../doc/src/intrinsics/numeric/floor.md:1 msgid "floor(x, kind): Integer Floor" msgstr "floor(x, kind)ï¼šåŽ»ä¸€å–æ•´" #: ../../doc/src/intrinsics/numeric/floor.md:3 msgid "Integer floor function." msgstr "åŽ»ä¸€å–æ•´å‡½æ•°ã€‚" #: ../../doc/src/intrinsics/numeric/floor.md:18 msgid "" "`kind` the optional input parameter must be a scalar integer constant " "expression." 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 "如果 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 "返回值等于或最接近å°äºŽæˆ–等于 `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 "**floor(x)** 返回å°äºŽæˆ–等于 x " "的最大整数。它返回一个整数值,除éžä½¿ç”¨ç¬¬äºŒä¸ªå¯é€‰å‚数特别指定。" #: ../../doc/src/intrinsics/numeric/gamma.md:1 msgid "gamma(x): Gamma" msgstr "gamma(x):伽马函数" #: ../../doc/src/intrinsics/numeric/gamma.md:3 msgid "Gamma function." 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 "`x` 输入值必须是实数类型。它ä¸åº”为零或负整数。" #: ../../doc/src/intrinsics/numeric/gamma.md:21 msgid "The return value is of same type and kind as of `x`." 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 "**gamma(x)** 计算 $\\gamma(x)$。对于 `x` 的正整数值,Gamma " "函数简化为阶乘函数:" #: ../../doc/src/intrinsics/numeric/gamma.md:28 msgid "$\\gamma(x) = (x-1)!$" msgstr "$\\gamma(x) = (x-1)!$" #: ../../doc/src/intrinsics/numeric/gamma.md:30 msgid "In general, if $x > 0$:" msgstr "一般æ¥è¯´ï¼Œå¦‚æžœ $x > 0$:" #: ../../doc/src/intrinsics/numeric/gamma.md:32 msgid "$\\gamma(x) = \\int_{0}^{\\infty} e^{-t} dt$" 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 "如果 $-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 "[epsilon](epsilon.md)" #: ../../doc/src/intrinsics/numeric/mod.md:1 msgid "mod(x, y): Modulus" msgstr "mod(x, y):模数" #: ../../doc/src/intrinsics/numeric/mod.md:3 msgid "Modulus or remainder function." msgstr "模数或余数函数。" #: ../../doc/src/intrinsics/numeric/mod.md:17 msgid "`x` the input value, can be integer or real." 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 "`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 "返回值的类型和ç§ç±»ä¸Ž `x` 相åŒã€‚结果使用数学模或余数计算为:" #: ../../doc/src/intrinsics/numeric/mod.md:27 msgid "`x - INT (x / y) * y`." 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 "如果 `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 "**mod(x, y)** 当 `x` 除以 `y` 时计算并返回模数或余数。结果计算使用" #: ../../doc/src/intrinsics/numeric/mod.md:36 msgid "`x - INT(x / y) * y`" 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 "å³ï¼Œå½“ç¬¬ä¸€ä¸ªå‚æ•°åœ¨æ•°å­¦ä¸Šé™¤ä»¥ç¬¬äºŒä¸ªå‚数时,结果是余数。" #: ../../doc/src/intrinsics/numeric/mod.md:41 msgid "The return value should be less than `y`." msgstr "返回值应该å°äºŽ`y`。" #: ../../doc/src/language.md:1 msgid "Fortran Language" msgstr "Fortran 语言" #: ../../doc/src/language.md:3 msgid "Background and Motivation" msgstr "背景和动机" #: ../../doc/src/language.md:5 msgid "" "Fortran was designed from the ground up to naturally and simply translate" " mathematics to code that compiles and runs at maximum speed. And being " "specifically targeted for such fundamentally computational tasks, it " "contains a broad range of key functionality within the language itself, " "standard across all platforms, with no need for external libraries that " "may or may not be well optimized or maintained, at present or down the " "road." msgstr "" "Fortran 的设计从一开始就自然而简å•地将数学转æ¢ä¸ºä»¥æœ€é«˜é€Ÿåº¦ç¼–译和è¿è¡Œçš„代ç ã€‚" "并且专门针对此类基本计算任务,它在语言本身中包å«å¹¿æ³›çš„关键功能,在所有平å°ä¸Š" "都是标准的,ä¸éœ€è¦ç›®å‰æˆ–未æ¥å¯èƒ½ä¼šæˆ–å¯èƒ½ä¸ä¼šå¾—到很好优化或维护的外部库路。" #: ../../doc/src/language.md:12 msgid "Some highlights:" 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 "多维数组,å¯ä»¥æ ¹æ®æ•°å­¦/ç§‘å­¦çš„è¦æ±‚进行分é…和索引(ä¸é™äºŽä»Ž 0 或 1 " "开始),并且å¯ä»¥æ ¹æ®éœ€è¦è¿›è¡Œåˆ‡ç‰‡ï¼ˆä¾‹å¦‚,在 MATLAB 中);" #: ../../doc/src/language.md:17 msgid "" "Operators which operate naturally upon the aforementioned " "arrays/matrices, as they do scalars;" msgstr "åƒå¯¹æ ‡é‡ä¸€æ ·è‡ªç„¶åœ°å¯¹ä¸Šè¿°æ•°ç»„/矩阵进行æ“作的è¿ç®—符;" #: ../../doc/src/language.md:19 msgid "Complex numbers;" msgstr "夿•°ï¼›" #: ../../doc/src/language.md:20 msgid "Special functions;" msgstr "特殊函数;" #: ../../doc/src/language.md:21 msgid "Structures and pointers for more general data representation." msgstr "用于更通用数æ®è¡¨ç¤ºçš„结构和指针。" #: ../../doc/src/language.md:23 msgid "" "Because the essentials are contained in the language itself, it is simple" " to read and write, without need of choosing from among or deciphering a " "proliferation of external classes to do the same thing. And because the " "essentials are self-contained, compilers can provide detailed compile-" "time (e.g., argument mismatch) and run-time (e.g., memory access) checks," " as well as highly optimized executables, directly from natural, readable" " code without need of extensive optimization heroics by the developer." msgstr "" "因为基本内容包å«åœ¨è¯­è¨€æœ¬èº«ä¸­ï¼Œæ‰€ä»¥é˜…读和编写都很简å•,无需从大é‡çš„外部类中进" "行选择或破译æ¥åšåŒæ ·çš„事情。由于这些è¦ç´ æ˜¯è‡ªåŒ…å«çš„,编译器å¯ä»¥ç›´æŽ¥ä»Žè‡ªç„¶ã€å¯" "读的代ç ä¸­æä¾›è¯¦ç»†çš„ç¼–è¯‘æ—¶ï¼ˆä¾‹å¦‚ï¼Œå‚æ•°ä¸åŒ¹é…)和è¿è¡Œæ—¶ï¼ˆä¾‹å¦‚,内存访问)检查" ",以åŠé«˜åº¦ä¼˜åŒ–çš„å¯æ‰§è¡Œæ–‡ä»¶ã€‚å¼€å‘人员的广泛优化英雄。" #: ../../doc/src/language.md:31 msgid "See our blog posts for more information:" 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 "如何学习 Fortran" #: ../../doc/src/language.md:38 msgid "" "Fortran is relatively quick to learn because it is so much simpler and " "smaller than C/C++ (in practice, that is, with all needed libraries " "included). If you are interested in learning more, please see our webpage" " at [fortran90.org] with recommended practices for writing code, side by " "side comparison with Python/NumPy, links to other online Fortran " "resources and books, and an FAQ." msgstr "" "Fortran 学习起æ¥ç›¸å¯¹è¾ƒå¿«ï¼Œå› ä¸ºå®ƒæ¯” C/C++ " "简å•得多,也更å°ï¼ˆå®žé™…上,包括所有需è¦çš„库)。如果你有兴趣了解更多信æ¯ï¼Œ" "请å‚阅我们的网页 [fortran90.org],其中包å«ç¼–写代ç çš„æŽ¨èåšæ³•ã€ä¸Ž Python/" "NumPy 的并排比较ã€å…¶ä»–在线 Fortran 资æºå’Œä¹¦ç±çš„链接以åŠå¸¸è§é—®é¢˜è§£ç­”。" #: ../../doc/src/progress.md:3 msgid "" "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:" msgstr "" "此页é¢è®°å½•了 LFortran 支æŒçš„ Fortran 功能。对于æ¯ä¸ªç‰¹æ€§ï¼Œæˆ‘们列出了一个简短的" "æè¿°ï¼Œä»¥åŠç¼–译器æ¯ä¸ªéƒ¨åˆ†çš„æµ‹è¯•和当å‰çжæ€çš„æ–‡ä»¶å:" #: ../../doc/src/progress.md:7 msgid "AST: The code can be parsed to AST (`lfortran --show-ast test.f90`)" 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 "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 "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 "BIN:LLVM IR å¯ä»¥ç¼–译为二进制文件" #: ../../doc/src/progress.md:11 msgid "RUN: The binary runs without errors" 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 "如果全部为绿色,则表示该功能完全有效,你å¯ä»¥åœ¨ä»£ç ä¸­ä½¿ç”¨å®ƒã€‚å¦åˆ™ï¼Œä½ å¯ä»¥æŸ¥çœ‹" "æ¯ä¸ªåŠŸèƒ½çš„çŠ¶æ€ã€‚" #: ../../doc/src/progress.md:16 msgid "" "This page is generated automatically using the [Compiler " "Tester](https://gitlab.com/lfortran/compiler_tester) repository which " "contains all the Fortran tests and scripts to run LFortran to produce the" " tables below. We are looking for contributors to contribute more tests. " "Our goal is to have a comprehensive Fortran testsuite that can be used to" " test any Fortran compiler." 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 "测试 LFortran 编译器版本:" #: ../../doc/src/progress.md:32 msgid "Topics" msgstr "è¯é¢˜" #: ../../doc/src/progress.md:34 msgid "Full programs that compute something interesting" msgstr "计算有趣事物的完整程åº" #: ../../doc/src/progress.md:36 msgid "Basic Numerics" msgstr "基本数值" #: ../../doc/src/progress.md:38 msgid "Directory: `tests/programs/numerics`" msgstr "路径:`tests/programs/numerics`" #: ../../doc/src/progress.md msgid "LLVM" msgstr "LLVM" #: ../../doc/src/progress.md msgid "BIN" msgstr "BIN" #: ../../doc/src/progress.md msgid "RUN" msgstr "RUN" #: ../../doc/src/progress.md msgid "Filename" msgstr "文件å" #: ../../doc/src/progress.md msgid "`Pure Fortran sin(x) implementation`" msgstr "`纯 Fortran sin(x) 实现`" #: ../../doc/src/progress.md msgid "✅" 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 "模å—" #: ../../doc/src/progress.md:47 msgid "Basic Usage" msgstr "基本用法" #: ../../doc/src/progress.md:49 msgid "Directory: `tests/modules/basic`" msgstr "路径:`tests/modules/basic`" #: ../../doc/src/progress.md msgid "`Basic modules`" 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 "模å—函数和å­ç¨‹åº" #: ../../doc/src/progress.md:58 msgid "Directory: `tests/modules/procedures`" msgstr "路径:`tests/modules/procedures`" #: ../../doc/src/progress.md msgid "`Module functions`" 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 "`模å—å­ç¨‹åº`" #: ../../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 "`嵌套å­ç¨‹åº`" #: ../../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 "表达å¼" #: ../../doc/src/progress.md:69 msgid "Arithmetic Operations" msgstr "算术è¿ç®—" #: ../../doc/src/progress.md:71 msgid "Directory: `tests/expressions/arit`" msgstr "路径:`tests/expressions/arit`" #: ../../doc/src/progress.md msgid "`+,-,*,/,**`" 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 "æ•´åž‹" #: ../../doc/src/progress.md:80 msgid "Directory: `tests/expressions/integers`" msgstr "路径:`tests/expressions/integers`" #: ../../doc/src/progress.md msgid "`integers`" 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 "`关系è¿ç®—`" #: ../../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 "`逻辑è¿ç®—`" #: ../../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 "实数" #: ../../doc/src/progress.md:91 msgid "Directory: `tests/expressions/reals`" msgstr "路径:`tests/expressions/reals`" #: ../../doc/src/progress.md msgid "`single/double reals`" 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 "`定义的è¿ç®—符`" #: ../../doc/src/progress.md msgid "âŒ" 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 "夿•°" #: ../../doc/src/progress.md:101 msgid "Directory: `tests/expressions/complex`" msgstr "路径:`tests/expressions/complex`" #: ../../doc/src/progress.md msgid "`single/double complex`" 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 "字符串" #: ../../doc/src/progress.md:110 msgid "Directory: `tests/expressions/character`" msgstr "路径:`tests/expressions/character`" #: ../../doc/src/progress.md msgid "`character`" 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 "`字符串连接`" #: ../../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 "派生类型" #: ../../doc/src/progress.md:120 msgid "Directory: `tests/expressions/derived_type`" msgstr "路径:`tests/expressions/derived_type`" #: ../../doc/src/progress.md msgid "`basic derived types`" 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 "声明" #: ../../doc/src/progress.md:129 msgid "Allocate Statement" msgstr "分é…语å¥" #: ../../doc/src/progress.md:131 msgid "Directory: `tests/statements/allocate`" msgstr "路径:`tests/statements/allocate`" #: ../../doc/src/progress.md msgid "`allocate statement`" 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 "å—语å¥" #: ../../doc/src/progress.md:140 msgid "Directory: `tests/statements/block`" msgstr "路径:`tests/statements/block`" #: ../../doc/src/progress.md msgid "`block statement`" 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 "转到语å¥" #: ../../doc/src/progress.md:149 msgid "Directory: `tests/statements/goto`" msgstr "路径:`tests/statements/goto`" #: ../../doc/src/progress.md msgid "`computed go-to statement`" 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 "`首选声明`" #: ../../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 "如果语å¥" #: ../../doc/src/progress.md:159 msgid "Directory: `tests/statements/if`" msgstr "路径:`tests/statements/if`" #: ../../doc/src/progress.md msgid "`Test .false.`" 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 "`å•行 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 "`多行 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 "`嵌套的 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 "While 语å¥" #: ../../doc/src/progress.md:171 msgid "Directory: `tests/statements/while`" msgstr "路径:`tests/statements/while`" #: ../../doc/src/progress.md msgid "`Simple while loops`" 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 "`从 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 "Print 声明" #: ../../doc/src/progress.md:181 msgid "Directory: `tests/statements/print`" msgstr "路径:`tests/statements/print`" #: ../../doc/src/progress.md msgid "`Basic print`" 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 "Openã€Readã€Writeã€Close语å¥" #: ../../doc/src/progress.md:190 msgid "Directory: `tests/statements/file_io`" msgstr "路径:`tests/statements/file_io`" #: ../../doc/src/progress.md msgid "`open/read/write/close`" 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 "内置函数" #: ../../doc/src/progress.md:199 msgid "abs" msgstr "abs" #: ../../doc/src/progress.md:201 msgid "Directory: `tests/intrinsic/abs`" msgstr "路径:`tests/intrinsic/abs`" #: ../../doc/src/progress.md msgid "`scalar single/double real`" 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 "`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 "`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 "exp" #: ../../doc/src/progress.md:212 msgid "Directory: `tests/intrinsic/exp`" 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 "log" #: ../../doc/src/progress.md:223 msgid "Directory: `tests/intrinsic/log`" 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 "sqrt" #: ../../doc/src/progress.md:234 msgid "Directory: `tests/intrinsic/sqrt`" 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 "sin" #: ../../doc/src/progress.md:245 msgid "Directory: `tests/intrinsic/sin`" 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 "cos" #: ../../doc/src/progress.md:256 msgid "Directory: `tests/intrinsic/cos`" 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 "tan" #: ../../doc/src/progress.md:267 msgid "Directory: `tests/intrinsic/tan`" 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 "sinh" #: ../../doc/src/progress.md:278 msgid "Directory: `tests/intrinsic/sinh`" 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 "cosh" #: ../../doc/src/progress.md:289 msgid "Directory: `tests/intrinsic/cosh`" 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 "tanh" #: ../../doc/src/progress.md:300 msgid "Directory: `tests/intrinsic/tanh`" 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" msgstr "asin" #: ../../doc/src/progress.md:311 msgid "Directory: `tests/intrinsic/asin`" 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" msgstr "acos" #: ../../doc/src/progress.md:322 msgid "Directory: `tests/intrinsic/acos`" 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 "atan" #: ../../doc/src/progress.md:333 msgid "Directory: `tests/intrinsic/atan`" 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 "modulo" #: ../../doc/src/progress.md:344 msgid "Directory: `tests/intrinsic/modulo`" 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 "mod" #: ../../doc/src/progress.md:354 msgid "Directory: `tests/intrinsic/mod`" 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 "min" #: ../../doc/src/progress.md:364 msgid "Directory: `tests/intrinsic/min`" 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 "max" #: ../../doc/src/progress.md:373 msgid "Directory: `tests/intrinsic/max`" 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 "int" #: ../../doc/src/progress.md:382 msgid "Directory: `tests/intrinsic/int`" 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 "real" #: ../../doc/src/progress.md:391 msgid "Directory: `tests/intrinsic/real`" 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 "floor" #: ../../doc/src/progress.md:400 msgid "Directory: `tests/intrinsic/floor`" 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 "nint" #: ../../doc/src/progress.md:409 msgid "Directory: `tests/intrinsic/nint`" msgstr "路径:`tests/intrinsic/nint`" #: ../../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 "" "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" "master/tests/intrinsic/nint/t01_scalar_real.f90)" lfortran-0.63.0/doc/locale/ja/0000775000175000017500000000000015174404631016216 5ustar alastairalastairlfortran-0.63.0/doc/locale/ja/LC_MESSAGES/0000775000175000017500000000000015174404631020003 5ustar alastairalastairlfortran-0.63.0/doc/locale/ja/LC_MESSAGES/docs.po0000664000175000017500000042424715174404631021310 0ustar alastairalastair# SOME DESCRIPTIVE TITLE. # Copyright (C) 2022 LFortran contributors # This file is distributed under the same license as the LFortran package. # FIRST AUTHOR , 2022. # #, fuzzy msgid "" msgstr "" "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" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.10.3\n" #: ../../doc/src/ast_and_asr.ipynb:9 msgid "Difference between an AST and ASR" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:11 msgid "Let us take a simple Fortran code:" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:22 msgid "and look at how the AST and ASR looks like." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:25 ../../doc/src/progress.md msgid "AST" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:76 msgid "" "The AST does not have any semantic information, but has nodes to " "represent declarations such as ``integer, intent(in) :: a``. Variables " "such as ``a`` are represented by a ``Name`` node, and are not connected " "to their declarations yet." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:88 ../../doc/src/progress.md msgid "ASR" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:139 msgid "" "The ASR has all the semantic information (types, etc.), nodes like " "``Function`` have a symbol table and do not have any declaration nodes. " "Variables are simply pointers to the symbol table." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:142 msgid "Discussion" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:144 msgid "" "The above was a simple example. Things get more apparent for more " "complicated examples, such as:" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:160 msgid "" "AST must represent all the ``use`` statements and the ``interface`` " "block, and keep things semantically consistent." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:162 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" " are defined in the ``gfort_interop`` module, and so ASR does not have " "any of these declaration nodes." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:164 msgid "" "When converting from ASR to AST, LFortran will create all the appropriate" " AST declaration nodes automatically and correctly." msgstr "" #: ../../doc/src/contributing.md:1 msgid "Contributing" msgstr "" #: ../../doc/src/contributing.md:3 msgid "" "We welcome contributions from anyone, even if you are new to open source." " It might sound daunting to contribute to a compiler at first, but please" " do, it is not complicated. We will help you with any technical issues " "and help improve your contribution so that it can be merged." msgstr "" #: ../../doc/src/contributing.md:8 msgid "Basic Setup" msgstr "" #: ../../doc/src/contributing.md:10 msgid "To contribute, make sure your set up:" msgstr "" #: ../../doc/src/contributing.md:12 msgid "Your username + email" msgstr "" #: ../../doc/src/contributing.md:13 msgid "Your `~/.gitconfig`" msgstr "" #: ../../doc/src/contributing.md:14 msgid "Your shell prompt to display the current branch name" msgstr "" #: ../../doc/src/contributing.md:16 msgid "Fork LFortran" msgstr "" #: ../../doc/src/contributing.md:18 msgid "" "Step 1. Create a fork of the [project " "repository](https://github.com/lfortran/lfortran)" msgstr "" #: ../../doc/src/contributing.md:20 msgid "" "Step 2. Set up your [SSH key](https://docs.github.com/en/authentication" "/connecting-to-github-with-ssh) with GitHub" msgstr "" #: ../../doc/src/contributing.md:22 msgid "" "Step 3. Clone the project repository from GitHub and set up your remote " "repository" msgstr "" #: ../../doc/src/contributing.md:29 msgid "" ":fontawesome-solid-edit: `REMOTE_NAME` is the name of your remote " "repository and could be any name you like, for example your first name." msgstr "" #: ../../doc/src/contributing.md:31 msgid "" ":fontawesome-solid-edit: `YOUR_GITHUB_ID` is your user ID on GitHub and " "should be part of your account path." msgstr "" #: ../../doc/src/contributing.md:33 msgid "" "You can use `git remote -v` to check if the new remote is set up " "correctly." msgstr "" #: ../../doc/src/contributing.md:35 msgid "Send a New Merge Request" msgstr "" #: ../../doc/src/contributing.md:37 msgid "Step 1. Create a new branch" msgstr "" #: ../../doc/src/contributing.md:42 msgid "Step 2. Make changes in relevant file(s)" msgstr "" #: ../../doc/src/contributing.md:44 msgid "Step 3. Commit the changes:" msgstr "" #: ../../doc/src/contributing.md:51 msgid "" "[Here](https://chris.beams.io/posts/git-commit/) are some great tips on " "writing good commit messages." msgstr "" #: ../../doc/src/contributing.md:53 msgid "Step 4. Check to ensure that your changes look good" msgstr "" #: ../../doc/src/contributing.md:58 msgid "Step 5. Send the merge request" msgstr "" #: ../../doc/src/contributing.md:64 msgid "" "The command will push the new branch `fix1` into your remote repository " "`REMOTE_NAME` that you created earlier. Additionally, it will also " "display a link that you can click on to open the new merge request. After" " clicking on the link, write a title and a concise description then click" " the \"Create\" button. Yay you are now all set." msgstr "" #: ../../doc/src/contributing.md:66 msgid "Add New Features" msgstr "" #: ../../doc/src/contributing.md:68 msgid "" "The example below shows the steps it would take to create a caret binary " "operator **^** which computes the average value of the two operands." msgstr "" #: ../../doc/src/contributing.md:70 msgid "Create New Token(s)" msgstr "" #: ../../doc/src/contributing.md:72 msgid "" "We extend the *tokenizer.re* as well as *parser.yy* to add the new token " "**^**. We also tell LFortran how to print the new token in *parser.cpp*." msgstr "" #: ../../doc/src/contributing.md:75 msgid ":fontawesome-solid-code: *src/lfortran/parser/tokenizer.re*" msgstr "" #: ../../doc/src/contributing.md:80 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.yy*" msgstr "" #: ../../doc/src/contributing.md:85 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.cpp*" msgstr "" #: ../../doc/src/contributing.md:94 msgid "The added code is tested with `lfortran --show-tokens examples2/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:96 msgid "Parse the New Token" msgstr "" #: ../../doc/src/contributing.md:98 msgid "" "Now we have to parse the new operator. We add it to the AST by extending " "the BinOp with a caret operator and modifying the *AST.asdl* file. Then " "we add it in *parse.yy* to properly parse and generate the new AST in " "*semantics.h*.Finally we extend *pickle.cpp* so that the new operator can" " print itself." msgstr "" #: ../../doc/src/contributing.md:102 msgid ":fontawesome-solid-code:*grammar/AST.asdl*" msgstr "" #: ../../doc/src/contributing.md:107 msgid ":fontawesome-solid-code:*src/lfortran/parser/parser.yy*" msgstr "" #: ../../doc/src/contributing.md:116 msgid ":fontawesome-solid-code:*src/lfortran/parser/semantics.h*" msgstr "" #: ../../doc/src/contributing.md:121 msgid ":fontawesome-solid-code:*src/lfortran/pickle.cpp*" msgstr "" #: ../../doc/src/contributing.md:132 msgid "The section is tested with `lfortran --show-ast examples/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:134 msgid "Implement the Semantics of the New Token" msgstr "" #: ../../doc/src/contributing.md:136 msgid "" "We first extend the ASR in *ASR.asdl* and add ^ as a BinOp operator " "option." msgstr "" #: ../../doc/src/contributing.md:138 msgid ":fontawesome-solid-code:*src/libasr/ASR.asdl*" msgstr "" #: ../../doc/src/contributing.md:142 msgid ":fontawesome-solid-code:*src/lfortran/semantics/ast_common_visitor.h*" msgstr "" #: ../../doc/src/contributing.md:179 msgid "" "Then we transform it from AST to ASR by extending " "*src/lfortran/semantics/ast_common_visitor.h*." msgstr "" #: ../../doc/src/contributing.md:181 msgid "" "We also add it into compile time evaluation triggered by expressions such" " as `e = (2+3)^5` which is evaluated at compile time. An expression such " "as `e = x^5` is evaluated at run time only." msgstr "" #: ../../doc/src/contributing.md:183 msgid "The section is tested with `lfortran --show-asr examples/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:184 msgid "Implement the New Token in LLVM" msgstr "" #: ../../doc/src/contributing.md:186 msgid "" "To implement in LLVM, we extend the BinOp translation by handling the new" " operator. We first add the two numbers then divide by two. :fontawesome-" "solid-code:*src/lfortran/codegen/asr_to_llvm.cpp*" msgstr "" #: ../../doc/src/contributing.md:217 msgid "The section is tested with `lfortran --show-llvm examples/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:219 msgid "Now when LLVM works, we can test the final executable by:" msgstr "" #: ../../doc/src/contributing.md:224 msgid "And it should print 6." msgstr "" #: ../../doc/src/contributing.md:226 msgid "It also works interactively:" msgstr "" #: ../../doc/src/contributing.md:242 msgid "Reach Out" msgstr "" #: ../../doc/src/contributing.md:244 msgid "" "If you have any questions or need help, please ask as at our " "[mailinglist](https://groups.io/g/lfortran) or a " "[chat](https://lfortran.zulipchat.com/)." msgstr "" #: ../../doc/src/contributing.md:248 msgid "" "Please note that all participants of this project are expected to follow " "our Code of Conduct. By participating in this project you agree to abide " "by its terms. See " "[CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/blob/main/CODE_OF_CONDUCT.md)." msgstr "" #: ../../doc/src/contributing.md:252 msgid "" "By submitting a PR you agree to license your contribution under the " "LFortran's BSD " "[license](https://github.com/lfortran/lfortran/blob/main/LICENSE) unless " "explicitly noted otherwise." msgstr "" #: ../../doc/src/design.md:1 msgid "LFortran Design" msgstr "" #: ../../doc/src/design.md:3 msgid "High Level Overview" msgstr "" #: ../../doc/src/design.md:5 ../../doc/src/developer_tutorial.ipynb:16 msgid "" "LFortran is structured around two independent modules, AST and ASR, both " "of which are standalone (completely independent of the rest of LFortran) " "and users are encouraged to use them independently for other applications" " and build tools on top:" msgstr "" #: ../../doc/src/design.md:10 msgid "" "Abstract Syntax Tree (AST), module `lfortran.ast`: Represents any Fortran" " source code, strictly based on syntax, no semantic is included. The AST " "module can convert itself to Fortran source code." msgstr "" #: ../../doc/src/design.md:14 msgid "" "Abstract Semantic Representation (ASR), module `lfortran.asr`: Represents" " a valid Fortran source code, all semantic is included. Invalid Fortran " "code is not allowed (an error will be given). The ASR module can convert " "itself to an AST." msgstr "" #: ../../doc/src/design.md:19 msgid "" "The LFortran compiler is then composed of the following independent " "stages:" msgstr "" #: ../../doc/src/design.md:21 msgid "Parsing: converts Fortran source code to an AST" msgstr "" #: ../../doc/src/design.md:22 msgid "Semantic: converts an AST to an ASR" msgstr "" #: ../../doc/src/design.md:23 msgid "" "High level optimizations: optimize ASR to a possibly faster/simpler ASR " "(things like inlining functions, eliminating redundant expressions or " "statements, etc.)" msgstr "" #: ../../doc/src/design.md:26 msgid "" "LLVM IR code generation and lower level optimizations: converts an ASR to" " an LLVM IR. This stage also does all other optimizations that do not " "produce an ASR, but still make sense to do before passing to LLVM IR." msgstr "" #: ../../doc/src/design.md:29 msgid "" "Machine code generation: LLVM then does all its optimizations and " "generates machine code (such as a binary executable, a library, an object" " file, or it is loaded and executed using JIT as part of the interactive " "LFortran session or in a Jupyter kernel)." msgstr "" #: ../../doc/src/design.md:34 msgid "" "LFortran is structured as a library, and so one can for example use the " "parser to obtain an AST and do something with it, or one can then use the" " semantic analyzer to obtain ASR and do something with it. One can " "generate the ASR directly (e.g., from SymPy) and then either convert to " "AST and to a Fortran source code, or use LFortran to compile it to " "machine code directly. In other words, one can use LFortran to easily " "convert between the three equivalent representations:" msgstr "" #: ../../doc/src/design.md:42 msgid "Fortran source code" msgstr "" #: ../../doc/src/design.md:43 ../../doc/src/developer_tutorial.ipynb:23 msgid "Abstract Syntax Tree (AST)" msgstr "" #: ../../doc/src/design.md:44 ../../doc/src/developer_tutorial.ipynb:159 msgid "Abstract Semantic Representation (ASR)" msgstr "" #: ../../doc/src/design.md:46 msgid "They are all equivalent in the following sense:" msgstr "" #: ../../doc/src/design.md:48 msgid "Any ASR can always be converted to an equivalent AST" msgstr "" #: ../../doc/src/design.md:49 msgid "Any AST can always be converted to an equivalent Fortran source code" msgstr "" #: ../../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 "" #: ../../doc/src/design.md:52 msgid "" "Any AST can always be either converted to an equivalent ASR or one gets a" " semantic error" msgstr "" #: ../../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 "" #: ../../doc/src/design.md:58 msgid "ASR Design Details" msgstr "" #: ../../doc/src/design.md:60 msgid "The ASR is designed to have the following features:" msgstr "" #: ../../doc/src/design.md:62 msgid "" "ASR is still semantically equivalent to the original Fortran code (it did" " not lose any semantic information). ASR can be converted to AST, and AST" " to Fortran source code which is functionally equivalent to the original." msgstr "" #: ../../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 "" #: ../../doc/src/design.md:69 msgid "" "The ASR C++ classes (down the road) are designed similarly to SymEngine: " "they are constructed once and after that they are immutable. The " "constructor checks in Debug more that all the requirements are met (e.g.," " that all Variables in a Function have a dummy argument set, that " "explicit-shape arrays are not allocatable and all other Fortran " "requirements to make it a valid code), but in Release mode it quickly " "constructs the class without checks. Then there are builder classes that " "construct the ASR C++ classes to meet requirements (checked in Debug " "mode) and the builder gives an error message if a code is not a valid " "Fortran code, and if it doesn't give an error message, then the ASR C++ " "classes are constructed correctly. Thus by construction, the ASR classes " "always contain valid Fortran code and the rest of LFortran can depend on " "it." msgstr "" #: ../../doc/src/design.md:82 msgid "Notes:" msgstr "" #: ../../doc/src/design.md:84 msgid "" "Information that is lost when parsing source to AST: whitespace, " "multiline/single line if statement distinction, case sensitivity of " "keywords." msgstr "" #: ../../doc/src/design.md:87 msgid "" "Information that is lost when going from AST to ASR: detailed syntax how " "variables were defined and the order of type attributes (whether array " "dimension is using the `dimension` attribute, or parentheses at the " "variable; or how many variables there are per declaration line or their " "order), as ASR only represents the aggregated type information in the " "symbol table." msgstr "" #: ../../doc/src/design.md:90 msgid "" "ASR is the simplest way to generate Fortran code, as one does not have to" " worry about the detailed syntax (as in AST) about how and where things " "are declared. One specifies the symbol table for a module, then for each " "symbol (functions, global variables, types, ...) one specifies the local " "variables and if this is an interface then one needs to specify where one" " can find an implementation, otherwise a body is supplied with " "statements, those nodes are almost the same as in AST, except that each " "variable is just a reference to a symbol in the symbol table (so by " "construction one cannot have undefined variables). The symbol table for " "each node such as Function or Module also references its parent (for " "example a function references a module, a module references the global " "scope)." msgstr "" #: ../../doc/src/design.md:102 msgid "" "The ASR can be directly converted to an AST without gathering any other " "information. And the AST directly to Fortran source code." msgstr "" #: ../../doc/src/design.md:105 msgid "" "The ASR is always representing a semantically valid Fortran code. This " "is enforced by checks in the ASR C++ constructors (in Debug build). When " "an ASR is used, one can assume it is valid." msgstr "" #: ../../doc/src/design.md:109 msgid "Fortran 2008" msgstr "" #: ../../doc/src/design.md:111 msgid "" "Fortran 2008 [standard](https://j3-fortran.org/doc/year/10/10-007.pdf) " "chapter 2 \"Fortran concepts\" specifies that Fortran code is a " "collection of _program units_ (either all in one file, or in separate " "files), where each _program unit_ is one of:" msgstr "" #: ../../doc/src/design.md:116 ../../doc/src/design.md:131 msgid "main program" msgstr "" #: ../../doc/src/design.md:117 ../../doc/src/design.md:132 msgid "module or submodule" msgstr "" #: ../../doc/src/design.md:118 ../../doc/src/design.md:133 msgid "function or subroutine" msgstr "" #: ../../doc/src/design.md:120 msgid "" "Note: It can also be a _block data_ program unit, that is used to provide" " initial values for data objects in named _common blocks_, but we do not " "recommend the use of _common blocks_ (use modules instead)." msgstr "" #: ../../doc/src/design.md:124 msgid "LFortran Extension" msgstr "" #: ../../doc/src/design.md:126 msgid "" "We extend the Fortran language by introducing a _global scope_, which is " "not only the list of _program units_ (as in F2008) but can also include " "statements, declarations, use statements and expressions. We define " "_global scope_ as a collection of the following items:" msgstr "" #: ../../doc/src/design.md:134 msgid "use statement" msgstr "" #: ../../doc/src/design.md:135 msgid "declaration" msgstr "" #: ../../doc/src/design.md:136 msgid "statement" msgstr "" #: ../../doc/src/design.md:137 msgid "expression" msgstr "" #: ../../doc/src/design.md:139 msgid "" "In addition, if a variable is not defined in an assignment statement " "(such as `x = 5+3`) then the type of the variable is inferred from the " "right hand side (e.g., `x` in `x = 5+3` would be of type `integer`, and " "`y` in `y = 5._dp` would be of type `real(dp)`). This rule only applies " "at the top level of _global scope_. Types must be fully specified inside " "main programs, modules, functions and subroutines, just like in F2008." msgstr "" #: ../../doc/src/design.md:146 msgid "" "The _global scope_ has its own symbol table. The main program and " "module/submodule do not see any symbols from this symbol table. But " "functions, subroutines, statements and expressions at the top level of " "_global scope_ use and operate on this symbol table." msgstr "" #: ../../doc/src/design.md:151 msgid "" "The _global scope_ has the following symbols predefined in the symbol " "table:" msgstr "" #: ../../doc/src/design.md:153 msgid "" "the usual standard set of Fortran functions (such as `size`, `sin`, " "`cos`, ...)" msgstr "" #: ../../doc/src/design.md:155 msgid "" "the `dp` double precision symbol, so that one can use `5._dp` for double " "precision." msgstr "" #: ../../doc/src/design.md:158 msgid "" "Each item in the _global scope_ is interpreted as follows: main program " "is compiled into an executable with the same name and executed; modules, " "functions and subroutines are compiled and loaded; use statement and " "declaration adds those symbols with the proper type into the _global " "scope_ symbol table, but do not generate any code; statement is wrapped " "into an anonymous subroutine with no arguments, compiled, loaded and " "executed; expression is wrapped into an anonymous function with no " "arguments returning the expression, compiled, loaded, executed and the " "return value is returned to the user." msgstr "" #: ../../doc/src/design.md:168 msgid "" "The _global scope_ is always interpreted, item by item, per the previous " "paragraph. It is meant to allow interactive usage, experimentations and " "writing simple scripts. Code in _global scope_ must be interpreted using " "`lfortran`. For more complex (production) code it is recommended to turn " "it into modules and programs (by wrapping loose statements into " "subroutines or functions and by adding type declarations) and compile it " "with `lfortran` or any other Fortran compiler." msgstr "" #: ../../doc/src/design.md:176 msgid "Here are some examples of valid code in _global scope_:" msgstr "" #: ../../doc/src/design.md:178 msgid "Example 1" msgstr "" #: ../../doc/src/design.md:185 msgid "Example 2" msgstr "" #: ../../doc/src/design.md:197 msgid "Example 3" msgstr "" #: ../../doc/src/design.md:209 msgid "Example 4" msgstr "" #: ../../doc/src/design.md:217 msgid "Design Considerations" msgstr "" #: ../../doc/src/design.md:219 msgid "" "The LFortran extension of Fortran was chosen in a way so as to minimize " "the number of changes. In particular, only the top level of the _global " "scope_ has relaxed some of the Fortran rules (such as making specifying " "types optional) so as to allow simple and quick interactive usage, but " "inside functions, subroutines, modules or programs this relaxation does " "not apply." msgstr "" #: ../../doc/src/design.md:225 msgid "" "The number of changes were kept to minimum in order to make it " "straightforward to turn code at _global scope_ into standard compliant " "Fortran code using programs and modules, so that it can be compiled by " "any Fortran compiler." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:9 msgid "Developer Tutorial" msgstr "" #: ../../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 "" #: ../../doc/src/developer_tutorial.ipynb:14 msgid "Introduction" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:18 msgid "" "Abstract Syntax Tree (AST): Represents any Fortran source code, strictly " "based on syntax, no semantic is included. The AST module can convert " "itself to Fortran source code." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:20 msgid "" "Abstract Semantic Representation (ASR): Represents a valid Fortran source" " code, all semantic is included. Invalid Fortran code is not allowed (an " "error will be given). The ASR module can convert itself to an AST." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:25 msgid "" "Fortran source code can be parsed into an AST using the ``src_to_ast()`` " "function:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:49 #, python-format msgid "We can pretty print it using the ``%%showast`` magic:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:98 #, python-format msgid "We can convert AST to Fortran source code using ``%%showfmt``:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:156 msgid "" "All AST nodes and their arguments are described in `AST.asdl " "`__." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:170 #, python-format msgid "We can pretty print using the ``%%showasr`` magic:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:219 msgid "" "All ASR nodes and their arguments are described in `ASR.asdl " "`__." msgstr "" #: ../../doc/src/index.md:134 msgid "Getting started" msgstr "" #: ../../doc/src/index.md:141 ../../doc/src/progress.md:1 msgid "LFortran Development Status" msgstr "" #: ../../doc/src/index.md:147 msgid "Developer's Guide" msgstr "" #: ../../doc/src/index.md:156 msgid "LFortran Intrinsics" msgstr "" #: ../../doc/src/index.md:1 msgid "LFortran Documentation" msgstr "" #: ../../doc/src/index.md:3 msgid "" "LFortran is a modern open-source (BSD licensed) interactive Fortran " "compiler built on top of LLVM. It can execute user's code interactively " "to allow exploratory work (much like Python, MATLAB or Julia) as well as " "compile to binaries with the goal to run user's code on modern " "architectures such as multi-core CPUs and GPUs." msgstr "" #: ../../doc/src/index.md:9 #, python-format msgid "" "Website: [https://lfortran.org/](https://lfortran.org/) Main " "repository: " "[https://github.com/lfortran/lfortran](https://github.com/lfortran/lfortran)" " Try online using Binder: " "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb)" msgstr "" #: ../../doc/src/index.md:9 msgid "Binder" msgstr "" #: ../../doc/src/index.md:16 msgid "Feature Highlights" msgstr "" #: ../../doc/src/index.md:18 msgid "" "LFortran is in development, there are features that work today, and there" " are features that are being implemented. You can also check out the " "[Development Status](progress.md) section for more information on " "features being supported and being worked on." msgstr "" #: ../../doc/src/index.md:21 msgid "Works today" msgstr "" #: ../../doc/src/index.md:23 #, python-format msgid "" "**Interactive, Jupyter support** LFortran can be used from Jupyter as a" " Fortran kernel, allowing a Python/Julia style rapid prototyping and " "exploratory workflow (see the " "[static](https://nbviewer.jupyter.org/gist/certik/f1d28a486510810d824869ab0c491b1c)" " or [interactive](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb) example notebook). Or " "it can be used from the command-line in an interactive prompt (REPL)." msgstr "" #: ../../doc/src/index.md:32 msgid "" "**Clean, modular design, usable as a library** LFortran is structured " "around two independent modules, AST and ASR, both of which are " "standalone (completely independent of the rest of LFortran) and users " "are encouraged to use them independently for other applications and " "build tools on top. See the [Design](design.md) and [Developer " "Tutorial](developer_tutorial.md) documents for more details." msgstr "" #: ../../doc/src/index.md:39 msgid "" "**Interoperation with GFortran** LFortran can parse GFortran module " "files into an ASR and generate a Fortran wrapper that can be compiled " "with any Fortran compiler and linked with the original GFortran " "compiled module." msgstr "" #: ../../doc/src/index.md:44 msgid "" "**Create executables** It can create executables just like other " "Fortran compilers." msgstr "" #: ../../doc/src/index.md:47 msgid "" "**Runs on Linux, Mac and Windows** All three platforms are regularly " "tested by our CI." msgstr "" #: ../../doc/src/index.md:51 msgid "Planned" msgstr "" #: ../../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 "" #: ../../doc/src/index.md:56 msgid "" "**Native interoperation with other languages (and other Fortran " "compilers)** It can automatically call code written in other languages " "(such as C or Python) just by using the `use` statement, see " "[#44](https://gitlab.com/lfortran/lfortran/issues/44). It understands " "other Fortran compilers module files (one can just \"use\" them) and " "their ABI to link correctly (GFortran is supported, other compilers are" " planned, see [#56](https://gitlab.com/lfortran/lfortran/issues/56)), " "which allows to use LFortran with production codes today." msgstr "" #: ../../doc/src/index.md:65 msgid "" "**Modern hardware support** Thanks to LLVM, the goal of LFortran is to " "run on modern hardware and take advantage of native Fortran language " "constructs (such as `do concurrent`) to run on multi-core CPUs and " "GPUs, see [#57](https://gitlab.com/lfortran/lfortran/issues/57)." msgstr "" #: ../../doc/src/index.md:71 msgid "" "**Full Fortran 2018 support** Currently only a subset of Fortran is " "implemented, but the goal is to have a full implementation of the " "latest Fortran 2018 standard, see " "[#58](https://gitlab.com/lfortran/lfortran/issues/58)." msgstr "" #: ../../doc/src/index.md:77 msgid "" "Please vote on issues in our [issue " "tracker](https://gitlab.com/lfortran/lfortran/issues) that you want us to" " prioritize (feel free to create new ones if we are missing anything)." msgstr "" #: ../../doc/src/index.md:81 msgid "Roadmap" msgstr "" #: ../../doc/src/index.md:83 msgid "Here is our roadmap how to get all the planned features above implemented:" msgstr "" #: ../../doc/src/index.md:85 msgid "" "Port code generation to use ASR and pass all the current tests " "([#74](https://gitlab.com/lfortran/lfortran/issues/74)). Remove the old " "code generation and old semantics, that used to annotate the AST tree, " "which was messy." msgstr "" #: ../../doc/src/index.md:89 msgid "" "Get GFortran module files working with `use` module, both assumed-size " "and assumed-shape arrays " "([#52](https://gitlab.com/lfortran/lfortran/issues/52)). This will allow " "right away to use production codes with LFortran." msgstr "" #: ../../doc/src/index.md:93 msgid "Do these at the same time:" msgstr "" #: ../../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 "" #: ../../doc/src/index.md:98 msgid "" "b) Gradually move to C++ for robustness and speed " "([#70](https://gitlab.com/lfortran/lfortran/issues/70)). The Python API " "will not change (or only minimally), so the user experience from Python " "will not change." msgstr "" #: ../../doc/src/index.md:103 msgid "" "c) Implement all the other cool features: `use` module for C and Python " "and automatic wrappers " "([#44](https://gitlab.com/lfortran/lfortran/issues/44)), modern hardware" " support ([#57](https://gitlab.com/lfortran/lfortran/issues/57)), " "generating an older standard of Fortran " "([#72](https://gitlab.com/lfortran/lfortran/issues/72)), Fortran doctest" " feature ([#73](https://gitlab.com/lfortran/lfortran/issues/73)), SymPy" " integration ([#71](https://gitlab.com/lfortran/lfortran/issues/71)), " "language service for IDEs " "([#12](https://gitlab.com/lfortran/lfortran/issues/12)), and other ideas" " ([#29](https://gitlab.com/lfortran/lfortran/issues/29))." msgstr "" #: ../../doc/src/index.md:118 msgid "The step 1. is an internal refactoring that will not take long." msgstr "" #: ../../doc/src/index.md:120 msgid "" "The step 2. will allow LFortran to be used interactively with production " "codes right away (the production code will get compiled with GFortran, " "then one \"uses\" any module in LFortran and functions/subroutines can be" " interactively called, the module itself can use any GFortran supported " "feature, but the API must fit into the subset that LFortran understands " "--- for large number of applications simple functions/subroutines with " "array arguments are enough). This will make LFortran usable for first " "users and one can always use GFortran temporarily until LFortran supports" " the given feature. We expect to be finished with the step 2. by the end " "of summer 2019, hopefully sooner." msgstr "" #: ../../doc/src/index.md:130 msgid "" "Finally the step 3. will improve LFortran overall, allowing the first " "users to contribute back, growing the community and making LFortran " "gradually useful for more and more people." msgstr "" #: ../../doc/src/installation.md:1 msgid "Installation" msgstr "" #: ../../doc/src/installation.md:3 msgid "All the instructions below work on Linux, macOS and Windows." msgstr "" #: ../../doc/src/installation.md:5 msgid "Binaries" msgstr "" #: ../../doc/src/installation.md:7 msgid "" "The recommended way to install LFortran is using Conda. Install Conda for" " example by installing the " "[Miniconda](https://conda.io/en/latest/miniconda.html) installation by " "following instructions there for your platform. Then create a new " "environment (you can choose any name, here we chose `lf`) and activate " "it:" msgstr "" #: ../../doc/src/installation.md:16 msgid "Then install LFortran by:" msgstr "" #: ../../doc/src/installation.md:20 msgid "" "Now the `lf` environment has the `lfortran` compiler available, you can " "start the interactive prompt by executing `lfortran`, or see the command " "line options using `lfortran -h`." msgstr "" #: ../../doc/src/installation.md:24 msgid "" "The Jupyter kernel is automatically installed by the above command, so " "after installing Jupyter itself:" msgstr "" #: ../../doc/src/installation.md:28 msgid "You can create a Fortran based Jupyter notebook by executing:" msgstr "" #: ../../doc/src/installation.md:32 msgid "and selecting `New->Fortran`." msgstr "" #: ../../doc/src/installation.md:35 msgid "Build From a Source Tarball" msgstr "" #: ../../doc/src/installation.md:37 msgid "" "This method is the recommended method if you just want to install " "LFortran, either yourself or in a package manager (Spack, Conda, Debian, " "etc.). The source tarball has all the generated files included and has " "minimal dependencies." msgstr "" #: ../../doc/src/installation.md:39 msgid "First we have to install dependencies, for example using Conda:" msgstr "" #: ../../doc/src/installation.md:44 msgid "" "Then download a tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), e.g.:" msgstr "" #: ../../doc/src/installation.md:52 msgid "And build:" msgstr "" #: ../../doc/src/installation.md:58 msgid "This will install the `lfortran` into the `inst/bin`." msgstr "" #: ../../doc/src/installation.md:60 msgid "Build From Git" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/installation.md:72 msgid "Then prepare the environment:" msgstr "" #: ../../doc/src/installation.md:77 msgid "Clone the LFortran git repository:" msgstr "" #: ../../doc/src/installation.md:82 msgid "" "Generate files that are needed for the build (this step depends on " "`re2c`, `bison` and `python`):" msgstr "" #: ../../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 "" #: ../../doc/src/installation.md:92 msgid "Run tests:" msgstr "" #: ../../doc/src/installation.md:97 msgid "Run an interactive prompt:" msgstr "" #: ../../doc/src/installation.md:102 msgid "Build from Git on Windows with Visual Studio" msgstr "" #: ../../doc/src/installation.md:104 msgid "" "Install Visual Studio (MSVC), for example the version 2022, you can " "download the Community version for free from: " "https://visualstudio.microsoft.com/downloads/." msgstr "" #: ../../doc/src/installation.md:107 msgid "" "Install miniforge using the Windows installer from https://github.com" "/conda-forge/miniforge." msgstr "" #: ../../doc/src/installation.md:109 msgid "Launch the Miniforge Prompt from the Desktop." msgstr "" #: ../../doc/src/installation.md:111 msgid "In the shell, initialize the MSVC compiler using:" msgstr "" #: ../../doc/src/installation.md:117 msgid "You can optionally test that MSVC works by:" msgstr "" #: ../../doc/src/installation.md:122 msgid "Both commands must print help (several pages)." msgstr "" #: ../../doc/src/installation.md:124 msgid "Now you can download and build LFortran:" msgstr "" #: ../../doc/src/installation.md:134 msgid "If everything compiled, then you can use LFortran as follows:" msgstr "" #: ../../doc/src/installation.md:140 msgid "And so on." msgstr "" #: ../../doc/src/installation.md:142 msgid "" "Note: LFortran currently uses the MSVC's linker program (`link`), which " "is only available when the MSVC bat script above is ran. If you forget to" " activate it, LFortran's linking will fail." msgstr "" #: ../../doc/src/installation.md:146 msgid "" "Note: the miniforge shell seems to be running some version of `git-bash` " "(although it is `cmd.exe`), which has some unix-like filesystem mounted " "in `/usr` and several commands available such as `ls`, `which`, `git`, " "`vim`. For this reason the Conda build `environment_win.yml` contains " "everything needed, including `git`." msgstr "" #: ../../doc/src/installation.md:152 msgid "Build from Git on Windows with WSL" msgstr "" #: ../../doc/src/installation.md:153 msgid "In windows search \"turn windows features on or off\"." msgstr "" #: ../../doc/src/installation.md:154 msgid "Tick Windows subsystem for Linux." msgstr "" #: ../../doc/src/installation.md:155 msgid "Press OK and restart computer." msgstr "" #: ../../doc/src/installation.md:156 msgid "Go to Microsoft store and download Ubuntu 20.04, and launch it." msgstr "" #: ../../doc/src/installation.md:157 msgid "Run the following commands." msgstr "" #: ../../doc/src/installation.md:164 msgid "Now do the following to configure the path" msgstr "" #: ../../doc/src/installation.md:168 msgid "Then go to the bottom of the file and paste the following" msgstr "" #: ../../doc/src/installation.md:172 msgid "Then press ctrl + O (save), Enter (confirm), ctrl + X (exit)" msgstr "" #: ../../doc/src/installation.md:173 msgid "After that restart Ubuntu" msgstr "" #: ../../doc/src/installation.md:174 msgid "Run the following" msgstr "" #: ../../doc/src/installation.md:179 msgid "Restart Ubuntu again" msgstr "" #: ../../doc/src/installation.md:187 msgid "" "You can change the directory to a Windows location using `cd /mnt/[drive " "letter]/[windows location]`." msgstr "" #: ../../doc/src/installation.md:188 msgid "e.g. `cd mnt/c/Users/name/source/repos/`" msgstr "" #: ../../doc/src/installation.md:190 msgid "Now clone the LFortran git repository" msgstr "" #: ../../doc/src/installation.md:196 msgid "Run the following commands" msgstr "" #: ../../doc/src/installation.md:204 msgid "If everything compiles, you can use LFortran as follows" msgstr "" #: ../../doc/src/installation.md:210 msgid "Run an interactive prompt" msgstr "" #: ../../doc/src/installation.md:215 msgid "Run tests" msgstr "" #: ../../doc/src/installation.md:221 msgid "Enabling the Jupyter Kernel" msgstr "" #: ../../doc/src/installation.md:223 msgid "To install the Jupyter kernel, install the following Conda packages also:" msgstr "" #: ../../doc/src/installation.md:227 msgid "" "and enable the kernel by `-DWITH_XEUS=yes` and install into " "`$CONDA_PREFIX`. For example:" msgstr "" #: ../../doc/src/installation.md:239 msgid "" "To use it, install Jupyter (`conda install jupyter`) and test that the " "LFortran kernel was found:" msgstr "" #: ../../doc/src/installation.md:244 msgid "Then launch a Jupyter notebook as follows:" msgstr "" #: ../../doc/src/installation.md:248 msgid "Click `New->Fortran`. To launch a terminal jupyter LFortran console:" msgstr "" #: ../../doc/src/installation.md:254 msgid "Build From Git with Nix" msgstr "" #: ../../doc/src/installation.md:256 msgid "" "One of the ways to ensure exact environment and dependencies is with " "`nix`. This will ensure that system dependencies do not interfere with " "the development environment. If you want, you can report bugs in a `nix-" "shell` environment to make it easier for others to reproduce." msgstr "" #: ../../doc/src/installation.md:258 msgid "With Root" msgstr "" #: ../../doc/src/installation.md:260 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 "" #: ../../doc/src/installation.md:264 msgid "Without Root" msgstr "" #: ../../doc/src/installation.md:266 msgid "" "If you would like to not provide `nix` with root access to your machine, " "on Linux distributions we can use [nix-" "portable](https://github.com/DavHau/nix-portable)." msgstr "" #: ../../doc/src/installation.md:270 msgid "" "Now just prepend all `nix-shell` commands with `NP_RUNTIME=bwrap ./nix-" "portable `. So:" msgstr "" #: ../../doc/src/installation.md:278 msgid "Development" msgstr "" #: ../../doc/src/installation.md:280 msgid "Now we can enter the development environment:" msgstr "" #: ../../doc/src/installation.md:284 msgid "" "The `--pure` flag ensures no system dependencies are used in the " "environment." msgstr "" #: ../../doc/src/installation.md:286 msgid "The build steps are the same as with the `ci`:" msgstr "" #: ../../doc/src/installation.md:292 msgid "" "To change the compilation environment from `gcc` (default) to `clang` we " "can use `--argstr`:" msgstr "" #: ../../doc/src/installation.md:297 msgid "Note About Dependencies" msgstr "" #: ../../doc/src/installation.md:299 msgid "" "End users (and distributions) are encouraged to use the tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), which " "only depends on LLVM, CMake and a C++ compiler." msgstr "" #: ../../doc/src/installation.md:303 msgid "" "The tarball is generated automatically by our CI (continuous integration)" " and contains some autogenerated files: the parser, the AST and ASR " "nodes, which is generated by an ASDL translator (requires Python)." msgstr "" #: ../../doc/src/installation.md:307 msgid "The instructions from git are to be used when developing LFortran itself." msgstr "" #: ../../doc/src/installation.md:309 msgid "Note for users who do not use Conda" msgstr "" #: ../../doc/src/installation.md:311 msgid "" "Following are the dependencies necessary for installing this repository " "in development mode," msgstr "" #: ../../doc/src/installation.md:314 msgid "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" msgstr "" #: ../../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 "" #: ../../doc/src/installation.md:316 msgid "[re2c - 2.0.3](https://re2c.org/install/install.html)" msgstr "" #: ../../doc/src/installation.md:317 msgid "" "[binutils - " "2.31.90](ftp://sourceware.org/pub/binutils/snapshots/binutils-2.31.90.tar.xz)" " - Make sure that you should enable the required options related to this " "dependency to build the dynamic libraries (the ones ending with `.so`)." msgstr "" #: ../../doc/src/installation.md:319 msgid "Stacktraces" msgstr "" #: ../../doc/src/installation.md:321 msgid "" "LFortran can print stacktraces when there is an unhandled exception, as " "well as on any compiler error with the `--show-stacktrace` option. This " "is very helpful for developing the compiler itself to see where in " "LFortran the problem is. The stacktrace support is turned off by default," " to enable it, compile LFortran with the `-DWITH_STACKTRACE=yes` cmake " "option after installing the prerequisites on each platform per the " "instructions below." msgstr "" #: ../../doc/src/installation.md:328 msgid "Ubuntu" msgstr "" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." msgstr "" #: ../../doc/src/installation.md:332 msgid "macOS" msgstr "" #: ../../doc/src/installation.md:334 msgid "" "If you use the default Clang compiler on macOS, then the stacktraces " "should just work on both Intel and M1 based macOS (the CMake build system" " automatically invokes the `dsymtuil` tool and our Python scripts to " "store the debug information, see `src/bin/CMakeLists.txt` for more " "details). If it does not work, please report a bug." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/installation.md:352 msgid "" "and compile LFortran with the " "`-DCMAKE_PREFIX_PATH=\"$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX\"` cmake" " option. The `$CONDA_PREFIX` is there if you install some other " "dependencies (such as `llvm`) using Conda, otherwise you can remove it." msgstr "" #: ../../doc/src/intrinsics/array.md:1 msgid "Array Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:1 msgid "allocated(x): Status Check" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:3 msgid "Logical status of an allocatable integer." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:5 #: ../../doc/src/intrinsics/array/cshift.md:5 #: ../../doc/src/intrinsics/array/size.md:5 #: ../../doc/src/intrinsics/bit/bge.md:5 ../../doc/src/intrinsics/bit/bgt.md:5 #: ../../doc/src/intrinsics/bit/bit_size.md:5 #: ../../doc/src/intrinsics/bit/ble.md:5 ../../doc/src/intrinsics/bit/blt.md:5 #: ../../doc/src/intrinsics/bit/btest.md:5 #: ../../doc/src/intrinsics/bit/shiftl.md:5 #: ../../doc/src/intrinsics/bit/shiftr.md:5 #: ../../doc/src/intrinsics/character/achar.md:5 #: ../../doc/src/intrinsics/character/adjustl.md:5 #: ../../doc/src/intrinsics/character/adjustr.md:5 #: ../../doc/src/intrinsics/character/char.md:5 #: ../../doc/src/intrinsics/character/len_trim.md:5 #: ../../doc/src/intrinsics/character/lge.md:5 #: ../../doc/src/intrinsics/kind-type/kind.md:5 #: ../../doc/src/intrinsics/mathematical/acos.md:5 #: ../../doc/src/intrinsics/mathematical/acosh.md:5 #: ../../doc/src/intrinsics/mathematical/asin.md:5 #: ../../doc/src/intrinsics/mathematical/asinh.md:5 #: ../../doc/src/intrinsics/mathematical/atan.md:5 #: ../../doc/src/intrinsics/mathematical/atan2.md:5 #: ../../doc/src/intrinsics/mathematical/atanh.md:5 #: ../../doc/src/intrinsics/mathematical/fraction.md:5 #: ../../doc/src/intrinsics/misc/command_argument_count.md:5 #: ../../doc/src/intrinsics/misc/cpu_time.md:5 #: ../../doc/src/intrinsics/misc/date_and_time.md:5 #: ../../doc/src/intrinsics/misc/new_line.md:5 #: ../../doc/src/intrinsics/numeric/abs.md:5 #: ../../doc/src/intrinsics/numeric/aimag.md:5 #: ../../doc/src/intrinsics/numeric/aint.md:5 #: ../../doc/src/intrinsics/numeric/anint.md:5 #: ../../doc/src/intrinsics/numeric/ceiling.md:5 #: ../../doc/src/intrinsics/numeric/cmplx.md:5 #: ../../doc/src/intrinsics/numeric/conjg.md:5 #: ../../doc/src/intrinsics/numeric/digits.md:5 #: ../../doc/src/intrinsics/numeric/dim.md:5 #: ../../doc/src/intrinsics/numeric/epsilon.md:5 #: ../../doc/src/intrinsics/numeric/erf.md:5 #: ../../doc/src/intrinsics/numeric/erfc.md:5 #: ../../doc/src/intrinsics/numeric/exp.md:5 #: ../../doc/src/intrinsics/numeric/floor.md:5 #: ../../doc/src/intrinsics/numeric/gamma.md:5 #: ../../doc/src/intrinsics/numeric/mod.md:5 msgid "Declaration" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:7 #: ../../doc/src/intrinsics/array/cshift.md:7 #: ../../doc/src/intrinsics/array/size.md:7 #: ../../doc/src/intrinsics/bit/bge.md:7 ../../doc/src/intrinsics/bit/bgt.md:7 #: ../../doc/src/intrinsics/bit/bit_size.md:7 #: ../../doc/src/intrinsics/bit/ble.md:7 ../../doc/src/intrinsics/bit/blt.md:7 #: ../../doc/src/intrinsics/bit/btest.md:7 #: ../../doc/src/intrinsics/bit/shiftl.md:7 #: ../../doc/src/intrinsics/bit/shiftr.md:7 #: ../../doc/src/intrinsics/character/achar.md:7 #: ../../doc/src/intrinsics/character/adjustl.md:7 #: ../../doc/src/intrinsics/character/adjustr.md:7 #: ../../doc/src/intrinsics/character/char.md:7 #: ../../doc/src/intrinsics/character/len_trim.md:7 #: ../../doc/src/intrinsics/character/lge.md:8 #: ../../doc/src/intrinsics/kind-type/kind.md:7 #: ../../doc/src/intrinsics/mathematical/acos.md:7 #: ../../doc/src/intrinsics/mathematical/acosh.md:7 #: ../../doc/src/intrinsics/mathematical/asin.md:7 #: ../../doc/src/intrinsics/mathematical/asinh.md:7 #: ../../doc/src/intrinsics/mathematical/atan.md:7 #: ../../doc/src/intrinsics/mathematical/atan2.md:7 #: ../../doc/src/intrinsics/mathematical/atanh.md:7 #: ../../doc/src/intrinsics/mathematical/fraction.md:7 #: ../../doc/src/intrinsics/misc/command_argument_count.md:7 #: ../../doc/src/intrinsics/misc/cpu_time.md:7 #: ../../doc/src/intrinsics/misc/date_and_time.md:7 #: ../../doc/src/intrinsics/misc/new_line.md:7 #: ../../doc/src/intrinsics/numeric/abs.md:7 #: ../../doc/src/intrinsics/numeric/aimag.md:7 #: ../../doc/src/intrinsics/numeric/aint.md:7 #: ../../doc/src/intrinsics/numeric/anint.md:7 #: ../../doc/src/intrinsics/numeric/ceiling.md:7 #: ../../doc/src/intrinsics/numeric/cmplx.md:7 #: ../../doc/src/intrinsics/numeric/conjg.md:7 #: ../../doc/src/intrinsics/numeric/digits.md:7 #: ../../doc/src/intrinsics/numeric/dim.md:7 #: ../../doc/src/intrinsics/numeric/epsilon.md:7 #: ../../doc/src/intrinsics/numeric/erf.md:7 #: ../../doc/src/intrinsics/numeric/erfc.md:7 #: ../../doc/src/intrinsics/numeric/exp.md:7 #: ../../doc/src/intrinsics/numeric/floor.md:7 #: ../../doc/src/intrinsics/numeric/gamma.md:7 #: ../../doc/src/intrinsics/numeric/mod.md:7 msgid "Syntax" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:14 #: ../../doc/src/intrinsics/array/cshift.md:14 #: ../../doc/src/intrinsics/array/size.md:14 #: ../../doc/src/intrinsics/bit/bge.md:14 #: ../../doc/src/intrinsics/bit/bgt.md:14 #: ../../doc/src/intrinsics/bit/bit_size.md:14 #: ../../doc/src/intrinsics/bit/ble.md:14 #: ../../doc/src/intrinsics/bit/blt.md:14 #: ../../doc/src/intrinsics/bit/btest.md:14 #: ../../doc/src/intrinsics/bit/shiftl.md:14 #: ../../doc/src/intrinsics/bit/shiftr.md:14 #: ../../doc/src/intrinsics/character/achar.md:14 #: ../../doc/src/intrinsics/character/adjustl.md:14 #: ../../doc/src/intrinsics/character/adjustr.md:14 #: ../../doc/src/intrinsics/character/char.md:14 #: ../../doc/src/intrinsics/character/len_trim.md:14 #: ../../doc/src/intrinsics/character/lge.md:15 #: ../../doc/src/intrinsics/kind-type/kind.md:14 #: ../../doc/src/intrinsics/mathematical/acos.md:14 #: ../../doc/src/intrinsics/mathematical/acosh.md:14 #: ../../doc/src/intrinsics/mathematical/asin.md:14 #: ../../doc/src/intrinsics/mathematical/asinh.md:14 #: ../../doc/src/intrinsics/mathematical/atan.md:14 #: ../../doc/src/intrinsics/mathematical/atan2.md:13 #: ../../doc/src/intrinsics/mathematical/atanh.md:14 #: ../../doc/src/intrinsics/mathematical/fraction.md:13 #: ../../doc/src/intrinsics/misc/command_argument_count.md:14 #: ../../doc/src/intrinsics/misc/cpu_time.md:14 #: ../../doc/src/intrinsics/misc/date_and_time.md:14 #: ../../doc/src/intrinsics/misc/new_line.md:14 #: ../../doc/src/intrinsics/numeric/abs.md:15 #: ../../doc/src/intrinsics/numeric/aimag.md:15 #: ../../doc/src/intrinsics/numeric/aint.md:14 #: ../../doc/src/intrinsics/numeric/anint.md:14 #: ../../doc/src/intrinsics/numeric/ceiling.md:14 #: ../../doc/src/intrinsics/numeric/cmplx.md:16 #: ../../doc/src/intrinsics/numeric/conjg.md:15 #: ../../doc/src/intrinsics/numeric/digits.md:13 #: ../../doc/src/intrinsics/numeric/dim.md:13 #: ../../doc/src/intrinsics/numeric/epsilon.md:14 #: ../../doc/src/intrinsics/numeric/erf.md:14 #: ../../doc/src/intrinsics/numeric/erfc.md:14 #: ../../doc/src/intrinsics/numeric/exp.md:14 #: ../../doc/src/intrinsics/numeric/floor.md:14 #: ../../doc/src/intrinsics/numeric/gamma.md:14 #: ../../doc/src/intrinsics/numeric/mod.md:15 msgid "Arguments" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:16 msgid "`x` is an integer input parameter." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:18 #: ../../doc/src/intrinsics/array/cshift.md:22 #: ../../doc/src/intrinsics/array/size.md:22 #: ../../doc/src/intrinsics/bit/bge.md:18 #: ../../doc/src/intrinsics/bit/bgt.md:18 #: ../../doc/src/intrinsics/bit/bit_size.md:18 #: ../../doc/src/intrinsics/bit/ble.md:18 #: ../../doc/src/intrinsics/bit/blt.md:18 #: ../../doc/src/intrinsics/bit/btest.md:19 #: ../../doc/src/intrinsics/bit/shiftl.md:21 #: ../../doc/src/intrinsics/bit/shiftr.md:21 #: ../../doc/src/intrinsics/character/lge.md:23 #: ../../doc/src/intrinsics/kind-type/kind.md:19 #: ../../doc/src/intrinsics/mathematical/acos.md:18 #: ../../doc/src/intrinsics/mathematical/acosh.md:19 #: ../../doc/src/intrinsics/mathematical/asin.md:18 #: ../../doc/src/intrinsics/mathematical/asinh.md:19 #: ../../doc/src/intrinsics/mathematical/atan.md:18 #: ../../doc/src/intrinsics/mathematical/atan2.md:21 #: ../../doc/src/intrinsics/mathematical/atanh.md:19 #: ../../doc/src/intrinsics/mathematical/fraction.md:17 #: ../../doc/src/intrinsics/misc/command_argument_count.md:18 #: ../../doc/src/intrinsics/misc/cpu_time.md:18 #: ../../doc/src/intrinsics/misc/date_and_time.md:39 #: ../../doc/src/intrinsics/misc/new_line.md:19 #: ../../doc/src/intrinsics/numeric/abs.md:19 #: ../../doc/src/intrinsics/numeric/aimag.md:19 #: ../../doc/src/intrinsics/numeric/aint.md:20 #: ../../doc/src/intrinsics/numeric/anint.md:20 #: ../../doc/src/intrinsics/numeric/ceiling.md:18 #: ../../doc/src/intrinsics/numeric/cmplx.md:24 #: ../../doc/src/intrinsics/numeric/conjg.md:19 #: ../../doc/src/intrinsics/numeric/digits.md:17 #: ../../doc/src/intrinsics/numeric/dim.md:18 #: ../../doc/src/intrinsics/numeric/epsilon.md:18 #: ../../doc/src/intrinsics/numeric/erf.md:18 #: ../../doc/src/intrinsics/numeric/erfc.md:18 #: ../../doc/src/intrinsics/numeric/exp.md:18 #: ../../doc/src/intrinsics/numeric/floor.md:20 #: ../../doc/src/intrinsics/numeric/gamma.md:19 #: ../../doc/src/intrinsics/numeric/mod.md:22 msgid "Return values" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:20 msgid "" "The return value is a logical scalar with the default logical kind type " "parameter." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:23 #: ../../doc/src/intrinsics/array/cshift.md:26 #: ../../doc/src/intrinsics/array/size.md:26 #: ../../doc/src/intrinsics/bit/bge.md:22 #: ../../doc/src/intrinsics/bit/bgt.md:22 #: ../../doc/src/intrinsics/bit/bit_size.md:22 #: ../../doc/src/intrinsics/bit/ble.md:22 #: ../../doc/src/intrinsics/bit/blt.md:22 #: ../../doc/src/intrinsics/bit/btest.md:23 #: ../../doc/src/intrinsics/bit/shiftl.md:25 #: ../../doc/src/intrinsics/bit/shiftr.md:25 #: ../../doc/src/intrinsics/character/achar.md:27 #: ../../doc/src/intrinsics/character/adjustl.md:23 #: ../../doc/src/intrinsics/character/adjustr.md:24 #: ../../doc/src/intrinsics/character/char.md:28 #: ../../doc/src/intrinsics/character/len_trim.md:22 #: ../../doc/src/intrinsics/character/lge.md:31 #: ../../doc/src/intrinsics/kind-type/kind.md:23 #: ../../doc/src/intrinsics/mathematical/acos.md:23 #: ../../doc/src/intrinsics/mathematical/acosh.md:24 #: ../../doc/src/intrinsics/mathematical/asin.md:23 #: ../../doc/src/intrinsics/mathematical/asinh.md:24 #: ../../doc/src/intrinsics/mathematical/atan.md:23 #: ../../doc/src/intrinsics/mathematical/atan2.md:27 #: ../../doc/src/intrinsics/mathematical/atanh.md:24 #: ../../doc/src/intrinsics/mathematical/fraction.md:22 #: ../../doc/src/intrinsics/misc/command_argument_count.md:22 #: ../../doc/src/intrinsics/misc/cpu_time.md:22 #: ../../doc/src/intrinsics/misc/date_and_time.md:43 #: ../../doc/src/intrinsics/misc/new_line.md:24 #: ../../doc/src/intrinsics/numeric/abs.md:24 #: ../../doc/src/intrinsics/numeric/aimag.md:23 #: ../../doc/src/intrinsics/numeric/aint.md:28 #: ../../doc/src/intrinsics/numeric/anint.md:27 #: ../../doc/src/intrinsics/numeric/ceiling.md:22 #: ../../doc/src/intrinsics/numeric/cmplx.md:30 #: ../../doc/src/intrinsics/numeric/conjg.md:23 #: ../../doc/src/intrinsics/numeric/digits.md:21 #: ../../doc/src/intrinsics/numeric/dim.md:22 #: ../../doc/src/intrinsics/numeric/epsilon.md:22 #: ../../doc/src/intrinsics/numeric/erf.md:23 #: ../../doc/src/intrinsics/numeric/erfc.md:23 #: ../../doc/src/intrinsics/numeric/exp.md:22 #: ../../doc/src/intrinsics/numeric/floor.md:28 #: ../../doc/src/intrinsics/numeric/gamma.md:23 #: ../../doc/src/intrinsics/numeric/mod.md:31 ../../doc/src/progress.md msgid "Description" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:25 msgid "" "`allocated(x)` checks the allocation status of a integer input parameter." " It returns a logical value as `TRUE` if the input argument `x` is " "allocated, `FALSE` otherwise." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:29 #: ../../doc/src/intrinsics/array/cshift.md:39 #: ../../doc/src/intrinsics/array/size.md:33 #: ../../doc/src/intrinsics/bit/bge.md:27 #: ../../doc/src/intrinsics/bit/bgt.md:27 #: ../../doc/src/intrinsics/bit/bit_size.md:27 #: ../../doc/src/intrinsics/bit/ble.md:27 #: ../../doc/src/intrinsics/bit/blt.md:27 #: ../../doc/src/intrinsics/bit/btest.md:32 #: ../../doc/src/intrinsics/bit/shiftl.md:32 #: ../../doc/src/intrinsics/bit/shiftr.md:32 #: ../../doc/src/intrinsics/character/achar.md:37 #: ../../doc/src/intrinsics/character/adjustl.md:28 #: ../../doc/src/intrinsics/character/adjustr.md:29 #: ../../doc/src/intrinsics/character/char.md:38 #: ../../doc/src/intrinsics/character/len_trim.md:27 #: ../../doc/src/intrinsics/character/lge.md:37 #: ../../doc/src/intrinsics/kind-type/kind.md:27 #: ../../doc/src/intrinsics/mathematical/acos.md:31 #: ../../doc/src/intrinsics/mathematical/acosh.md:43 #: ../../doc/src/intrinsics/mathematical/asin.md:31 #: ../../doc/src/intrinsics/mathematical/asinh.md:35 #: ../../doc/src/intrinsics/mathematical/atan.md:31 #: ../../doc/src/intrinsics/mathematical/atan2.md:53 #: ../../doc/src/intrinsics/mathematical/atanh.md:39 #: ../../doc/src/intrinsics/mathematical/fraction.md:30 #: ../../doc/src/intrinsics/misc/command_argument_count.md:27 #: ../../doc/src/intrinsics/misc/cpu_time.md:33 #: ../../doc/src/intrinsics/misc/date_and_time.md:53 #: ../../doc/src/intrinsics/misc/new_line.md:29 #: ../../doc/src/intrinsics/numeric/abs.md:35 #: ../../doc/src/intrinsics/numeric/aimag.md:33 #: ../../doc/src/intrinsics/numeric/aint.md:35 #: ../../doc/src/intrinsics/numeric/anint.md:38 #: ../../doc/src/intrinsics/numeric/ceiling.md:26 #: ../../doc/src/intrinsics/numeric/cmplx.md:47 #: ../../doc/src/intrinsics/numeric/conjg.md:33 #: ../../doc/src/intrinsics/numeric/digits.md:26 #: ../../doc/src/intrinsics/numeric/dim.md:27 #: ../../doc/src/intrinsics/numeric/epsilon.md:29 #: ../../doc/src/intrinsics/numeric/erf.md:33 #: ../../doc/src/intrinsics/numeric/erfc.md:36 #: ../../doc/src/intrinsics/numeric/exp.md:29 #: ../../doc/src/intrinsics/numeric/floor.md:33 #: ../../doc/src/intrinsics/numeric/gamma.md:38 #: ../../doc/src/intrinsics/numeric/mod.md:43 msgid "Types" 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 "" #: ../../doc/src/intrinsics/array/allocated.md:46 #: ../../doc/src/intrinsics/array/cshift.md:43 #: ../../doc/src/intrinsics/array/size.md:37 #: ../../doc/src/intrinsics/bit/bge.md:49 #: ../../doc/src/intrinsics/bit/bgt.md:49 #: ../../doc/src/intrinsics/bit/bit_size.md:44 #: ../../doc/src/intrinsics/bit/ble.md:49 #: ../../doc/src/intrinsics/bit/blt.md:49 #: ../../doc/src/intrinsics/bit/btest.md:56 #: ../../doc/src/intrinsics/bit/shiftl.md:62 #: ../../doc/src/intrinsics/bit/shiftr.md:62 #: ../../doc/src/intrinsics/character/achar.md:53 #: ../../doc/src/intrinsics/character/adjustl.md:45 #: ../../doc/src/intrinsics/character/adjustr.md:46 #: ../../doc/src/intrinsics/character/char.md:53 #: ../../doc/src/intrinsics/character/len_trim.md:44 #: ../../doc/src/intrinsics/character/lge.md:59 #: ../../doc/src/intrinsics/kind-type/kind.md:59 #: ../../doc/src/intrinsics/mathematical/acos.md:60 #: ../../doc/src/intrinsics/mathematical/acosh.md:72 #: ../../doc/src/intrinsics/mathematical/asin.md:60 #: ../../doc/src/intrinsics/mathematical/asinh.md:64 #: ../../doc/src/intrinsics/mathematical/atan.md:60 #: ../../doc/src/intrinsics/mathematical/atan2.md:75 #: ../../doc/src/intrinsics/mathematical/atanh.md:68 #: ../../doc/src/intrinsics/mathematical/fraction.md:34 #: ../../doc/src/intrinsics/misc/command_argument_count.md:31 #: ../../doc/src/intrinsics/misc/cpu_time.md:44 #: ../../doc/src/intrinsics/misc/date_and_time.md:64 #: ../../doc/src/intrinsics/misc/new_line.md:40 #: ../../doc/src/intrinsics/numeric/abs.md:79 #: ../../doc/src/intrinsics/numeric/aimag.md:53 #: ../../doc/src/intrinsics/numeric/aint.md:39 #: ../../doc/src/intrinsics/numeric/anint.md:42 #: ../../doc/src/intrinsics/numeric/ceiling.md:46 #: ../../doc/src/intrinsics/numeric/cmplx.md:59 #: ../../doc/src/intrinsics/numeric/conjg.md:53 #: ../../doc/src/intrinsics/numeric/digits.md:30 #: ../../doc/src/intrinsics/numeric/dim.md:31 #: ../../doc/src/intrinsics/numeric/epsilon.md:49 #: ../../doc/src/intrinsics/numeric/erf.md:53 #: ../../doc/src/intrinsics/numeric/erfc.md:56 #: ../../doc/src/intrinsics/numeric/exp.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:65 #: ../../doc/src/intrinsics/numeric/gamma.md:58 #: ../../doc/src/intrinsics/numeric/mod.md:80 msgid "Examples" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:59 #: ../../doc/src/intrinsics/array/cshift.md:55 #: ../../doc/src/intrinsics/array/size.md:48 #: ../../doc/src/intrinsics/mathematical/acos.md:76 #: ../../doc/src/intrinsics/mathematical/acosh.md:81 #: ../../doc/src/intrinsics/mathematical/asin.md:76 #: ../../doc/src/intrinsics/mathematical/asinh.md:73 #: ../../doc/src/intrinsics/mathematical/atan.md:76 #: ../../doc/src/intrinsics/mathematical/atan2.md:84 #: ../../doc/src/intrinsics/mathematical/atanh.md:77 #: ../../doc/src/intrinsics/mathematical/fraction.md:44 msgid "**Result**:" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:65 #: ../../doc/src/intrinsics/array/cshift.md:62 #: ../../doc/src/intrinsics/array/size.md:55 #: ../../doc/src/intrinsics/bit/bge.md:68 #: ../../doc/src/intrinsics/bit/bgt.md:66 #: ../../doc/src/intrinsics/bit/bit_size.md:61 #: ../../doc/src/intrinsics/bit/ble.md:68 #: ../../doc/src/intrinsics/bit/blt.md:66 #: ../../doc/src/intrinsics/bit/btest.md:71 #: ../../doc/src/intrinsics/bit/shiftl.md:80 #: ../../doc/src/intrinsics/bit/shiftr.md:80 #: ../../doc/src/intrinsics/character/achar.md:69 #: ../../doc/src/intrinsics/character/adjustl.md:62 #: ../../doc/src/intrinsics/character/adjustr.md:63 #: ../../doc/src/intrinsics/character/char.md:69 #: ../../doc/src/intrinsics/character/len_trim.md:63 #: ../../doc/src/intrinsics/character/lge.md:79 #: ../../doc/src/intrinsics/kind-type/kind.md:79 #: ../../doc/src/intrinsics/mathematical/acos.md:82 #: ../../doc/src/intrinsics/mathematical/acosh.md:86 #: ../../doc/src/intrinsics/mathematical/asin.md:82 #: ../../doc/src/intrinsics/mathematical/asinh.md:78 #: ../../doc/src/intrinsics/mathematical/atan.md:82 #: ../../doc/src/intrinsics/mathematical/atan2.md:90 #: ../../doc/src/intrinsics/mathematical/atanh.md:82 #: ../../doc/src/intrinsics/mathematical/fraction.md:50 #: ../../doc/src/intrinsics/misc/command_argument_count.md:47 #: ../../doc/src/intrinsics/misc/cpu_time.md:64 #: ../../doc/src/intrinsics/misc/date_and_time.md:90 #: ../../doc/src/intrinsics/misc/new_line.md:56 #: ../../doc/src/intrinsics/numeric/abs.md:96 #: ../../doc/src/intrinsics/numeric/aimag.md:68 #: ../../doc/src/intrinsics/numeric/aint.md:55 #: ../../doc/src/intrinsics/numeric/anint.md:58 #: ../../doc/src/intrinsics/numeric/ceiling.md:64 #: ../../doc/src/intrinsics/numeric/cmplx.md:74 #: ../../doc/src/intrinsics/numeric/conjg.md:68 #: ../../doc/src/intrinsics/numeric/digits.md:44 #: ../../doc/src/intrinsics/numeric/dim.md:47 #: ../../doc/src/intrinsics/numeric/epsilon.md:63 #: ../../doc/src/intrinsics/numeric/erf.md:67 #: ../../doc/src/intrinsics/numeric/erfc.md:70 #: ../../doc/src/intrinsics/numeric/exp.md:71 #: ../../doc/src/intrinsics/numeric/floor.md:83 #: ../../doc/src/intrinsics/numeric/gamma.md:74 #: ../../doc/src/intrinsics/numeric/mod.md:95 msgid "See Also" msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:1 msgid "cshift(A, shift [, dim]): Circular Shift" msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:3 msgid "Circular shift elements of an array." 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 "" #: ../../doc/src/intrinsics/array/cshift.md:18 msgid "`shift` the input value of integer type." msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:20 msgid "" "`dim` optional dimension, if present, `cshift` returns the result of this" " dimension." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/array/cshift.md:28 msgid "" "**cshift(A, shift [, dim])** performs a circular shift on elements of `A`" " array along the dimension of `dim`. Default value of `dim` is 1, used " "when `dim` is not passed." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/array/cshift.md:41 msgid "" "Supported argument type is array for `A` and integer for `shift` and " "`dim`." msgstr "" #: ../../doc/src/intrinsics/array/size.md:1 msgid "size(x): Size of Array" msgstr "" #: ../../doc/src/intrinsics/array/size.md:3 msgid "Returns the size of an array `x`." msgstr "" #: ../../doc/src/intrinsics/array/size.md:18 msgid "" "`dim` optional dimension, if present, `size` returns the size of this " "dimension." msgstr "" #: ../../doc/src/intrinsics/array/size.md:20 msgid "`kind` optional the kind of the return value." msgstr "" #: ../../doc/src/intrinsics/array/size.md:24 msgid "`n` the size of an array (integer)." msgstr "" #: ../../doc/src/intrinsics/array/size.md:28 msgid "" "The `size` intrinsic function returns the size of an array. It returns " "the product of all dimensions, unless the `dim` argument is specified, in" " which case it only returns the size of this particular dimension. The " "`kind` argument can be used to specify the integer kind of the result." msgstr "" #: ../../doc/src/intrinsics/array/size.md:57 msgid "[shape](), [reshape]()." msgstr "" #: ../../doc/src/intrinsics/bit.md:1 msgid "Bit Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:1 msgid "bge(x, y): Bitwise Greater or Equal" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:3 msgid "Bitwise greater than or equal to." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/bge.md:29 #: ../../doc/src/intrinsics/bit/bgt.md:29 #: ../../doc/src/intrinsics/bit/ble.md:29 #: ../../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 "" #: ../../doc/src/intrinsics/bit/bge.md:60 #: ../../doc/src/intrinsics/bit/bgt.md:59 #: ../../doc/src/intrinsics/bit/bit_size.md:54 #: ../../doc/src/intrinsics/bit/ble.md:60 #: ../../doc/src/intrinsics/bit/blt.md:59 #: ../../doc/src/intrinsics/bit/btest.md:65 #: ../../doc/src/intrinsics/bit/shiftl.md:74 #: ../../doc/src/intrinsics/bit/shiftr.md:74 #: ../../doc/src/intrinsics/character/achar.md:63 #: ../../doc/src/intrinsics/character/adjustl.md:56 #: ../../doc/src/intrinsics/character/adjustr.md:57 #: ../../doc/src/intrinsics/character/char.md:63 #: ../../doc/src/intrinsics/character/len_trim.md:57 #: ../../doc/src/intrinsics/character/lge.md:72 #: ../../doc/src/intrinsics/kind-type/kind.md:72 #: ../../doc/src/intrinsics/misc/command_argument_count.md:40 #: ../../doc/src/intrinsics/misc/cpu_time.md:57 #: ../../doc/src/intrinsics/misc/date_and_time.md:83 #: ../../doc/src/intrinsics/misc/new_line.md:49 #: ../../doc/src/intrinsics/numeric/abs.md:89 #: ../../doc/src/intrinsics/numeric/aimag.md:62 #: ../../doc/src/intrinsics/numeric/aint.md:48 #: ../../doc/src/intrinsics/numeric/anint.md:51 #: ../../doc/src/intrinsics/numeric/ceiling.md:57 #: ../../doc/src/intrinsics/numeric/cmplx.md:68 #: ../../doc/src/intrinsics/numeric/conjg.md:62 #: ../../doc/src/intrinsics/numeric/digits.md:38 #: ../../doc/src/intrinsics/numeric/dim.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:57 #: ../../doc/src/intrinsics/numeric/erf.md:61 #: ../../doc/src/intrinsics/numeric/erfc.md:64 #: ../../doc/src/intrinsics/numeric/exp.md:65 #: ../../doc/src/intrinsics/numeric/floor.md:76 #: ../../doc/src/intrinsics/numeric/gamma.md:67 #: ../../doc/src/intrinsics/numeric/mod.md:89 msgid "**Result:**" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:70 msgid "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/bgt.md:1 msgid "bgt(x, y): Bitwise Greater Than" msgstr "" #: ../../doc/src/intrinsics/bit/bgt.md:3 msgid "Bitwise greater than." 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 "" #: ../../doc/src/intrinsics/bit/bgt.md:68 msgid "[bge](bge.md), [ble](ble.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:1 msgid "bit_size(x): Bit Size" msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:3 msgid "Bit size." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:16 msgid "`x` is integer input value." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:20 #: ../../doc/src/intrinsics/numeric/digits.md:19 msgid "The return value is of type integer." 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 "" #: ../../doc/src/intrinsics/bit/bit_size.md:29 msgid "Supported input types is integer." msgstr "" #: ../../doc/src/intrinsics/bit/ble.md:1 msgid "bge(x, y): Bitwise Less or Equal" msgstr "" #: ../../doc/src/intrinsics/bit/ble.md:3 msgid "Bitwise less than or equal to." 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 "" #: ../../doc/src/intrinsics/bit/ble.md:70 msgid "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:1 msgid "blt(x, y): Bitwise Less Than" msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:3 msgid "Bitwise less than." 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 "" #: ../../doc/src/intrinsics/bit/blt.md:68 msgid "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:1 msgid "btest(x, pos): Bit Test at Position" msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:3 msgid "Bit test." 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 "" #: ../../doc/src/intrinsics/bit/btest.md:21 msgid "The return value is of type logical." msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:25 msgid "" "`btest(x, pos)` calculates if `pos` bit in input integer value `x` is " "set. The counting of the bits starts at 0, at least significant bit (LSB)" " i.e., the rightmost bit in `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:1 msgid "shiftl(x, shift): Shift Left" msgstr "" #: ../../doc/src/intrinsics/bit/shiftl.md:3 msgid "Logical shift left function." msgstr "" #: ../../doc/src/intrinsics/bit/shiftl.md:16 #: ../../doc/src/intrinsics/bit/shiftr.md:16 msgid "`x` is an integer input value." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:27 msgid "" "**shiftl(x, shift)** logically left shifts `x` by `shift` number of bits." " `shiftl` shifts from LSB(**L**east **S**ignificant **B**it) to " "MSB(**M**ost **S**ignificant **B**it). Bits shifted from the left end " "i.e., MSB bits are lost. Zeroes are appended to the opposite right end." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:82 msgid "[shiftr](shiftr.md)." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:1 msgid "shiftr(x, shift): Shift Right" msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:3 msgid "Logical shift right function." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:27 msgid "" "**shiftr(x, shift)** logically right shifts `x` by `shift` number of " "bits. `shiftr` shifts from MSB(**M**ost **S**ignificant **B**it) to " "LSB(**L**east **S**ignificant **B**it). Bits shifted from the right end " "i.e., LSB bits are lost. Zeroes are appended to the opposite left end." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:82 msgid "[shiftl](shiftl.md)." msgstr "" #: ../../doc/src/intrinsics/character.md:1 msgid "Character Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/character/achar.md:1 msgid "achar(x, kind): To Character in ASCII set." msgstr "" #: ../../doc/src/intrinsics/character/achar.md:3 msgid "Character represented by in the ASCII character set." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/character/achar.md:20 #: ../../doc/src/intrinsics/character/adjustl.md:18 #: ../../doc/src/intrinsics/character/adjustr.md:18 #: ../../doc/src/intrinsics/character/char.md:21 #: ../../doc/src/intrinsics/character/len_trim.md:18 msgid "Return value" 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/achar.md:29 msgid "" "**achar(x, kind)** returns the character represented by the ASCII " "character set at `x` position." msgstr "" #: ../../doc/src/intrinsics/character/achar.md:32 #: ../../doc/src/intrinsics/character/char.md:33 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 "" #: ../../doc/src/intrinsics/character/achar.md:35 #: ../../doc/src/intrinsics/character/char.md:36 msgid "It is a runtime builtin function." 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 "" #: ../../doc/src/intrinsics/character/adjustl.md:1 msgid "adjustl(string): Left Adjust String" msgstr "" #: ../../doc/src/intrinsics/character/adjustl.md:3 msgid "Left adjust a string." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/adjustl.md:30 #: ../../doc/src/intrinsics/character/adjustr.md:31 msgid "Supported argument type is character." msgstr "" #: ../../doc/src/intrinsics/character/adjustr.md:1 msgid "adjustr(string): Right Adjust String" msgstr "" #: ../../doc/src/intrinsics/character/adjustr.md:3 msgid "Right adjust a string." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/adjustr.md:65 msgid "[adjustl](adjustl.md)." msgstr "" #: ../../doc/src/intrinsics/character/char.md:1 msgid "char(x, [, kind]): Integer to Character" msgstr "" #: ../../doc/src/intrinsics/character/char.md:3 msgid "Integer to character conversion." msgstr "" #: ../../doc/src/intrinsics/character/char.md:16 msgid "`x`: the input value of integer type." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/character/char.md:30 msgid "" "**char(x)** returns the character represented by the ASCII character set " "at `x` position." msgstr "" #: ../../doc/src/intrinsics/character/char.md:71 msgid "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:1 msgid "len_trim(string): Length Ignoring Trailing Blanks" msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:3 msgid "Length of a character string ignoring trailing blank character(s)." msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:16 msgid "`string` the input value of character type." msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:20 msgid "The return value is of type unsigned integer." 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 "" #: ../../doc/src/intrinsics/character/len_trim.md:29 msgid "Supported argument type is character scalar." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:1 msgid "lge(x, y): Lexically Greater or Equal" msgstr "" #: ../../doc/src/intrinsics/character/lge.md:3 msgid "Lexically greater than or equal." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:17 msgid "`x` input value of type character." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:19 msgid "`y` input value of type character." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:21 msgid "`x` and `y` can be seen as string A and string B." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:25 msgid "The return value is of logical `true` or `false` type." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:27 msgid "`True` if `x` string is lexically greater than or equal to `y`." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:29 msgid "`False` if they are not." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:33 msgid "" "**lge(x, y)** determines if input string `x` is lexically greater than or" " equal to input string `y`. The two strings in comparison are interpreted" " as containing ASCII character codes." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:39 msgid "Argument types should be of type character literal." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:81 msgid "[len_trim](len_trim.md)." msgstr "" #: ../../doc/src/intrinsics/kind-type.md:1 msgid "Kind Type Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:1 msgid "kind(x): Kind of an Entity" msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:3 msgid "Kind of an entity." 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 "" #: ../../doc/src/intrinsics/kind-type/kind.md:21 msgid "The return value is of integer type and of default integer kind." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:25 msgid "**kind(x)** returns the kind parameter of the input argument `x`." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:29 msgid "" "Supported argument types are logical, integer, real, complex, or " "character." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:81 #: ../../doc/src/intrinsics/misc/command_argument_count.md:16 #: ../../doc/src/intrinsics/misc/cpu_time.md:20 #: ../../doc/src/intrinsics/misc/date_and_time.md:41 #: ../../doc/src/intrinsics/misc/new_line.md:58 msgid "None." msgstr "" #: ../../doc/src/intrinsics/mathematical.md:1 msgid "Mathematical Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:1 msgid "acos(x): Trigonometric Arc Cosine" msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:3 msgid "Trigonometric arc cosine (inverse cosine) function." 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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:20 #: ../../doc/src/intrinsics/mathematical/acosh.md:21 #: ../../doc/src/intrinsics/mathematical/asin.md:20 #: ../../doc/src/intrinsics/mathematical/asinh.md:21 #: ../../doc/src/intrinsics/mathematical/atan.md:20 #: ../../doc/src/intrinsics/mathematical/atanh.md:21 msgid "" "The returned value has the kind of the input value and TYPE may be real " "or complex." msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:25 msgid "**acos(x)** computes the arcsine of the argument **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:33 #: ../../doc/src/intrinsics/mathematical/acosh.md:45 #: ../../doc/src/intrinsics/mathematical/asin.md:33 #: ../../doc/src/intrinsics/mathematical/asinh.md:37 #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:84 msgid "[asin](asin.md), [atan](atan.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:1 msgid "acosh(x): Inverse Hyperbolic Cosine" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:3 msgid "Inverse hyperbolic cosine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:16 #: ../../doc/src/intrinsics/mathematical/asinh.md:16 #: ../../doc/src/intrinsics/mathematical/atanh.md:16 msgid "" "`x` the input value, can be real with value greater than or equal to 1 or" " of type complex." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:26 msgid "**acosh(x)** computes the inverse hyperbolic cosine function of **x**." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acosh.md:33 msgid "$-\\pi <= img (acosh(x)) <= \\pi$" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:35 msgid "" "For real values $x$ in the domain $x > 1$, the inverse hyperbolic cosine " "satisifies:" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:38 msgid "$cosh^{-1}(x) = \\log(x + \\sqrt{(x^2 - 1)})$" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acosh.md:88 msgid "[asinh](asinh.md), [atanh](atanh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:1 msgid "asin(x): Trigonometric Arcsine" msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:3 msgid "Trigonometric arcsine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:25 msgid "**asin(x)** computes the arcsine of the argument **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/asin.md:84 msgid "[acos](acos.md), [atan](atan.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:1 msgid "asinh(x): Inverse Hyperbolic Arcsine" msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:3 msgid "Inverse hyperbolic arcsine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:26 msgid "**asinh(x)** computes the inverse hyperbolic arcsine function of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/asinh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (asinh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:80 msgid "[acosh](acosh.md), [atanh](atanh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:1 msgid "atan(x): Trigonometric ArcTangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:3 msgid "Trigonometric arctangent (inverse arctangent) function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:25 msgid "**atan(x)** computes the arctangent of the argument **x**." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:27 msgid "" "The arc tangent is the inverse function of the arctangent function. It is" " commonly used in trigonometry to find the angle when the lengths of the " "opposite side of a right triangle and base are known, i.e., perpendicular" " and base length." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:84 msgid "[asin](asin.md), [acos](acos.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:1 msgid "atan2(y, x): ArcTangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:3 msgid "Arctangent function or inverse tangent function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:15 msgid "`y` the input value is the imaginary part of the complex expression" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atan2.md:19 msgid "`x` the input value, must be real part of the complex expression." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atan2.md:29 msgid "" "**atan2(y, x)** computes the principal value of the argument function of " "the complex expression $x + iy$. This is used to transform from cartesian" " into polar coordinates and allows to determine the angle in the correct " "quadrant." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:33 msgid "It is also represented as:" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:35 msgid "$tan^{-1}(\\frac{y}{x})$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:37 msgid "If `x` is nonzero, the result lies in the range:" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:39 msgid "$-\\pi <= atan(x) <= \\pi$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:41 msgid "The sign is positive if `y` is positive." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:43 msgid "If `y` is zero and `x` is strictly positive, then the result is 0." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:45 msgid "If `x` is negative and `y` is positive zero, then the result is $\\pi$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:47 msgid "If `x` is negative and `y` is negative zero, then the result is $-\\pi$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:49 msgid "If `x` is zero, then the magnitude of the result is $\\frac{\\pi}{2}$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:51 msgid "If `y` is negative real zero, the result is $\\frac{-\\pi}{2}$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:55 #: ../../doc/src/intrinsics/mathematical/fraction.md:32 msgid "Supported argument type is real." msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:1 msgid "atanh(x): Inverse Hyperbolic Tangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:3 msgid "Inverse hyperbolic tangent function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:26 msgid "**atanh(x)** computes the inverse hyperbolic tangent function of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atanh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (atanh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:35 msgid "If the result is real, it lies in the range" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:37 msgid "$-1.0 < atanh(x) < 1.0$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:84 msgid "[asinh](asinh.md), [acosh](acosh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:1 msgid "fraction(x): Fractional Part in Model Representation" msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:3 msgid "Fractional part of the model representation." msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:15 msgid "`x` the input value, must be real." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/fraction.md:24 msgid "" "**fraction(x)** computes the fractional part of the model representation " "of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/fraction.md:28 msgid "$x * {radix(x)}^{(-exponent(x))}$" msgstr "" #: ../../doc/src/intrinsics/misc.md:1 msgid "Miscellaneous Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:1 msgid "command_argument_count(): Number of Command Line Arguments" msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:3 msgid "Get number of command line arguments." msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:20 msgid "The return value is of integer type and of default kind." 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 "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:29 msgid "Any." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:1 msgid "cpu_time(x): CPU Elapsed Time" msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:3 msgid "CPU elapsed time in seconds." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:16 msgid "`x` the input value should be of type real with `intent(out)`." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:24 msgid "" "**cpu_time(time)** returns a real value representing the elapsed CPU time" " in seconds. If tine source is available, time will be reported with " "microsecond resolution. If no time source is available, TIME is set to " "-1.0." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:28 msgid "This is useful for testing segments of code to determine computation time." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:1 msgid "date_and_time([date, time, zone, values]): Date and Time" msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:3 msgid "Date and time subroutine." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:22 msgid "" "`zone` the input value of character type, which has length 5 or larger. " "It is of default kind. It is `intent(out)` and has from `(+-)hhmm`, " "representing the difference with respect to Coordinates Universal Time " "(UTC). Unavailable time and date parameters return blanks." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:30 msgid "`value(1)`: The year." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:31 msgid "`value(2)`: The month." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:32 msgid "`value(3)`: The day of the month." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:33 msgid "`value(4)`: Time difference with UTC in minutes." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:34 msgid "`value(5)`: The hour of the day." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:35 msgid "`value(6)`: The minutes of the hour." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:36 msgid "`value(7)`: The seconds of the minutes." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:37 msgid "`value(8)`: The milliseconds of the second." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:51 msgid "Unavailable or errorneous date and time parameters return blanks." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:92 msgid "[cpu_time](cpu_time.md)." msgstr "" #: ../../doc/src/intrinsics/misc/new_line.md:1 msgid "new_line(x): New Line Character" msgstr "" #: ../../doc/src/intrinsics/misc/new_line.md:3 msgid "New line character." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/new_line.md:31 msgid "Supported input parameter types is character." msgstr "" #: ../../doc/src/intrinsics/numeric.md:1 msgid "Numeric Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:1 msgid "abs(x): Absolute Value" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:3 msgid "Absolute value." msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:17 msgid "`x` the input value, can be integer, real, or complex." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/abs.md:26 msgid "" "**abs(x)** calculates and returns absolute value of `x`. Result is " "calculated using mathematical formula:" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:29 msgid "$|x|$" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:31 msgid "If `x` is complex, the result is calculated using mathematical formula:" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:33 msgid "$\\sqrt{(x^2 + y^2)}$" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aimag.md:1 msgid "aimag(x): Imaginary Part" msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:3 msgid "Imaginary part of complex number." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:17 msgid "`x` the input value must be of complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:21 msgid "The return value is imaginary part of type real and kind same as of `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:25 msgid "**aimag(x)** returns the imaginary part of the input complex argument `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:27 #: ../../doc/src/intrinsics/numeric/cmplx.md:41 #: ../../doc/src/intrinsics/numeric/conjg.md:27 msgid "" "For `x` complex input value, the result is calculated using mathematical " "formula:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aimag.md:35 msgid "Supported argument types are complex." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:1 msgid "aint(x, [kind]): Truncate to a Whole Number" msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:3 msgid "Truncate to a whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:16 #: ../../doc/src/intrinsics/numeric/anint.md:16 #: ../../doc/src/intrinsics/numeric/epsilon.md:16 #: ../../doc/src/intrinsics/numeric/erf.md:16 #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aint.md:37 #: ../../doc/src/intrinsics/numeric/anint.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:31 #: ../../doc/src/intrinsics/numeric/erf.md:35 #: ../../doc/src/intrinsics/numeric/erfc.md:38 #: ../../doc/src/intrinsics/numeric/floor.md:35 #: ../../doc/src/intrinsics/numeric/gamma.md:40 msgid "Supported argument types is real." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:85 msgid "[ceiling](ceiling.md), [mod](mod.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:1 msgid "anint(x, [kind]): Round to Nearest Whole Number" msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:3 msgid "Round to nearest whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:25 msgid "The return value is equal to rounded whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:29 msgid "**anint(x)** calculates rounded value of input parameter `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/anint.md:34 msgid "If `x` is greater than 0, `anint(x)` returns `aint(x + 0.5)`." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:60 msgid "[aint](aint.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:1 msgid "ceiling(x): Integer Ceiling" msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:3 msgid "Integer ceiling function" msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:16 msgid "The input value `x` may be of type real or integer." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:20 msgid "The return value is of type integer and nearest greater integer." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:24 msgid "**ceiling(x)** returns the least integer greater than or equal to `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:28 msgid "Supported input parameter types are integer and real." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:66 msgid "[floor](floor.md), [mod](mod.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:1 msgid "cmplx(x [, [, kind]]): Convert to Complex" msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:3 msgid "Conversion to complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:14 msgid "`cmplx(x, y)` is one of the intrinsic present in ASR." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:18 msgid "" "`x` the input value must be of integer, real, or complex. `y` the " "optional input value must be of type integer or real. It should be only " "present in case `x` is not complex. `kind` the optional input value of " "integer expression type for initialisation indicating the kind parameter " "of the result." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/cmplx.md:32 msgid "" "**cmplx(x, [, y [, kind]])** converts the input value to complex " "representation:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/cmplx.md:37 msgid "If `y` is not present, the imaginary component is set to 0.0." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:39 msgid "If `x` is complex then `y` must not be present." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:49 msgid "Supported argument types are integer, real, or complex." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:1 msgid "conjg(x): Complex Conjugate" msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:3 msgid "Complex conjugate function." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:17 msgid "`x` the input value must be of type complex." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:21 msgid "The return value is of complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:25 msgid "**conjg(x)** converts the input value `x` to its conjugate." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:29 msgid "$x + iy$ converted to $x - iy$" msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:35 msgid "Supported argument types is complex." msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:1 msgid "digits(x): Significant Binary Digits" msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:3 msgid "Significant binary digits." msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:15 msgid "`x` the input value must be of type real or integer." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/dim.md:1 msgid "dim(x, y): Positive Difference or 0" msgstr "" #: ../../doc/src/intrinsics/numeric/dim.md:3 msgid "Positive difference or 0." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/dim.md:20 msgid "The return value is of type integer or real." 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 "" #: ../../doc/src/intrinsics/numeric/epsilon.md:1 msgid "epsilon(x): Epsilon" msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:3 msgid "Epsilon function." msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:20 msgid "The return value is of same type as of the input argument." msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:24 msgid "" "**epsilon(x)** computes the smallest number $\\epsilon$ of the same kind " "as `x` following:" msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:27 msgid "$1 + \\epsilon > 1$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:1 msgid "erf(x): Error" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:3 msgid "Error function." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/erf.md:27 msgid "$-1 \\leq erf (x) \\leq 1$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_0^xe^{-t^2}dt$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:69 msgid "[erfc](erfc.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:1 msgid "erfc(x): Complementary Error" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:3 msgid "Complementary error function." 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 "" #: ../../doc/src/intrinsics/numeric/erfc.md:27 msgid "$0 \\leq erf (x) \\leq 2$" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_{x}^{\\infty}e^{-t^2}dt$" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/erfc.md:72 msgid "[erf](erf.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:1 msgid "exp(x): Exponential" msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:3 msgid "Exponential function." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:16 msgid "`x` the input value must be of type real or complex." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:20 msgid "The return value is of same type as of the input argument, `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:24 msgid "**exp(x)** computes the base $e$ exponential of `x`, i.e., $e^x$." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/exp.md:31 msgid "Supported argument types is real and complex." msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:1 msgid "floor(x, kind): Integer Floor" msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:3 msgid "Integer floor function." msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:18 msgid "" "`kind` the optional input parameter must be a scalar integer constant " "expression." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:1 msgid "gamma(x): Gamma" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:3 msgid "Gamma function." 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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:21 msgid "The return value is of same type and kind as of `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:28 msgid "$\\gamma(x) = (x-1)!$" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:30 msgid "In general, if $x > 0$:" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:32 msgid "$\\gamma(x) = \\int_{0}^{\\infty} e^{-t} dt$" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:34 msgid "and if $-n-1 < x < -n$ where n is an integer >= 0:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:76 msgid "[epsilon](epsilon.md)" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:1 msgid "mod(x, y): Modulus" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:3 msgid "Modulus or remainder function." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:17 msgid "`x` the input value, can be integer or real." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/mod.md:27 msgid "`x - INT (x / y) * y`." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:29 msgid "If `y` is 0, the result is undefined like `any integer value / 0`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/mod.md:36 msgid "`x - INT(x / y) * y`" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:38 msgid "" "i.e., result is remainder when first argument is mathematically divided " "by second argument." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:41 msgid "The return value should be less than `y`." msgstr "" #: ../../doc/src/language.md:1 msgid "Fortran Language" msgstr "" #: ../../doc/src/language.md:3 msgid "Background and Motivation" msgstr "" #: ../../doc/src/language.md:5 msgid "" "Fortran was designed from the ground up to naturally and simply translate" " mathematics to code that compiles and runs at maximum speed. And being " "specifically targeted for such fundamentally computational tasks, it " "contains a broad range of key functionality within the language itself, " "standard across all platforms, with no need for external libraries that " "may or may not be well optimized or maintained, at present or down the " "road." msgstr "" #: ../../doc/src/language.md:12 msgid "Some highlights:" 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 "" #: ../../doc/src/language.md:17 msgid "" "Operators which operate naturally upon the aforementioned " "arrays/matrices, as they do scalars;" msgstr "" #: ../../doc/src/language.md:19 msgid "Complex numbers;" msgstr "" #: ../../doc/src/language.md:20 msgid "Special functions;" msgstr "" #: ../../doc/src/language.md:21 msgid "Structures and pointers for more general data representation." msgstr "" #: ../../doc/src/language.md:23 msgid "" "Because the essentials are contained in the language itself, it is simple" " to read and write, without need of choosing from among or deciphering a " "proliferation of external classes to do the same thing. And because the " "essentials are self-contained, compilers can provide detailed compile-" "time (e.g., argument mismatch) and run-time (e.g., memory access) checks," " as well as highly optimized executables, directly from natural, readable" " code without need of extensive optimization heroics by the developer." msgstr "" #: ../../doc/src/language.md:31 msgid "See our blog posts for more information:" msgstr "" #: ../../doc/src/language.md:33 msgid "" "[Why We Created LFortran](https://lfortran.org/blog/2019/04/why-we-" "created-lfortran/)" msgstr "" #: ../../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 "" #: ../../doc/src/language.md:36 msgid "How to Learn Fortran" msgstr "" #: ../../doc/src/language.md:38 msgid "" "Fortran is relatively quick to learn because it is so much simpler and " "smaller than C/C++ (in practice, that is, with all needed libraries " "included). If you are interested in learning more, please see our webpage" " at [fortran90.org] with recommended practices for writing code, side by " "side comparison with Python/NumPy, links to other online Fortran " "resources and books, and an FAQ." msgstr "" #: ../../doc/src/progress.md:3 msgid "" "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:" msgstr "" #: ../../doc/src/progress.md:7 msgid "AST: The code can be parsed to AST (`lfortran --show-ast test.f90`)" msgstr "" #: ../../doc/src/progress.md:8 msgid "ASR: The code can be transformed to ASR (`lfortran --show-asr test.f90`)" msgstr "" #: ../../doc/src/progress.md:9 msgid "LLVM: LFortran can generate LLVM IR (`lfortran --show-llvm test.f90`)" msgstr "" #: ../../doc/src/progress.md:10 msgid "BIN: The LLVM IR can compile to a binary" msgstr "" #: ../../doc/src/progress.md:11 msgid "RUN: The binary runs without errors" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:16 msgid "" "This page is generated automatically using the [Compiler " "Tester](https://gitlab.com/lfortran/compiler_tester) repository which " "contains all the Fortran tests and scripts to run LFortran to produce the" " tables below. We are looking for contributors to contribute more tests. " "Our goal is to have a comprehensive Fortran testsuite that can be used to" " test any Fortran compiler." msgstr "" #: ../../doc/src/progress.md:23 msgid "Testing the LFortran compiler version:" msgstr "" #: ../../doc/src/progress.md:32 msgid "Topics" msgstr "" #: ../../doc/src/progress.md:34 msgid "Full programs that compute something interesting" msgstr "" #: ../../doc/src/progress.md:36 msgid "Basic Numerics" msgstr "" #: ../../doc/src/progress.md:38 msgid "Directory: `tests/programs/numerics`" msgstr "" #: ../../doc/src/progress.md msgid "LLVM" msgstr "" #: ../../doc/src/progress.md msgid "BIN" msgstr "" #: ../../doc/src/progress.md msgid "RUN" msgstr "" #: ../../doc/src/progress.md msgid "Filename" msgstr "" #: ../../doc/src/progress.md msgid "`Pure Fortran sin(x) implementation`" msgstr "" #: ../../doc/src/progress.md msgid "✅" 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 "" #: ../../doc/src/progress.md:45 msgid "Modules" msgstr "" #: ../../doc/src/progress.md:47 msgid "Basic Usage" msgstr "" #: ../../doc/src/progress.md:49 msgid "Directory: `tests/modules/basic`" msgstr "" #: ../../doc/src/progress.md msgid "`Basic modules`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/basic/t01.f90)" msgstr "" #: ../../doc/src/progress.md:56 msgid "Module Functions and Subroutines" msgstr "" #: ../../doc/src/progress.md:58 msgid "Directory: `tests/modules/procedures`" msgstr "" #: ../../doc/src/progress.md msgid "`Module functions`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`Module subroutines`" msgstr "" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t02.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`Nested subroutines`" msgstr "" #: ../../doc/src/progress.md msgid "[t03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t03.f90)" msgstr "" #: ../../doc/src/progress.md:67 msgid "Expressions" msgstr "" #: ../../doc/src/progress.md:69 msgid "Arithmetic Operations" msgstr "" #: ../../doc/src/progress.md:71 msgid "Directory: `tests/expressions/arit`" msgstr "" #: ../../doc/src/progress.md msgid "`+,-,*,/,**`" msgstr "" #: ../../doc/src/progress.md msgid "[basic_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/arit/basic_operations.f90)" msgstr "" #: ../../doc/src/progress.md:78 msgid "Integers" msgstr "" #: ../../doc/src/progress.md:80 msgid "Directory: `tests/expressions/integers`" msgstr "" #: ../../doc/src/progress.md msgid "`integers`" msgstr "" #: ../../doc/src/progress.md msgid "[integer_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/integer_kind.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`relational operations`" 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 "" #: ../../doc/src/progress.md msgid "`logical operations`" 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 "" #: ../../doc/src/progress.md:89 msgid "Real Numbers" msgstr "" #: ../../doc/src/progress.md:91 msgid "Directory: `tests/expressions/reals`" msgstr "" #: ../../doc/src/progress.md msgid "`single/double reals`" msgstr "" #: ../../doc/src/progress.md msgid "[real_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/real_kind.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`defined operator`" msgstr "" #: ../../doc/src/progress.md msgid "âŒ" 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 "" #: ../../doc/src/progress.md:99 msgid "Complex Numbers" msgstr "" #: ../../doc/src/progress.md:101 msgid "Directory: `tests/expressions/complex`" msgstr "" #: ../../doc/src/progress.md msgid "`single/double complex`" msgstr "" #: ../../doc/src/progress.md msgid "[complex_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/complex/complex_kind.f90)" msgstr "" #: ../../doc/src/progress.md:108 msgid "Strings" msgstr "" #: ../../doc/src/progress.md:110 msgid "Directory: `tests/expressions/character`" msgstr "" #: ../../doc/src/progress.md msgid "`character`" msgstr "" #: ../../doc/src/progress.md msgid "[t01_character.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t01_character.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`string concatenation`" 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 "" #: ../../doc/src/progress.md:118 msgid "Derived Types" msgstr "" #: ../../doc/src/progress.md:120 msgid "Directory: `tests/expressions/derived_type`" msgstr "" #: ../../doc/src/progress.md msgid "`basic derived types`" 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 "" #: ../../doc/src/progress.md:127 msgid "Statements" msgstr "" #: ../../doc/src/progress.md:129 msgid "Allocate Statement" msgstr "" #: ../../doc/src/progress.md:131 msgid "Directory: `tests/statements/allocate`" msgstr "" #: ../../doc/src/progress.md msgid "`allocate statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/allocate/t01.f90)" msgstr "" #: ../../doc/src/progress.md:138 msgid "Block Statement" msgstr "" #: ../../doc/src/progress.md:140 msgid "Directory: `tests/statements/block`" msgstr "" #: ../../doc/src/progress.md msgid "`block statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/block/t01.f90)" msgstr "" #: ../../doc/src/progress.md:147 msgid "Goto Statement" msgstr "" #: ../../doc/src/progress.md:149 msgid "Directory: `tests/statements/goto`" msgstr "" #: ../../doc/src/progress.md msgid "`computed go-to statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`go-to statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t02.f90)" msgstr "" #: ../../doc/src/progress.md:157 msgid "If Statement" msgstr "" #: ../../doc/src/progress.md:159 msgid "Directory: `tests/statements/if`" msgstr "" #: ../../doc/src/progress.md msgid "`Test .false.`" msgstr "" #: ../../doc/src/progress.md msgid "[if_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`single line if statement`" msgstr "" #: ../../doc/src/progress.md msgid "[if_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_02.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`multi line if statement`" msgstr "" #: ../../doc/src/progress.md msgid "[if_03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_03.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`nested if statements`" msgstr "" #: ../../doc/src/progress.md msgid "[if_04.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_04.f90)" msgstr "" #: ../../doc/src/progress.md:169 msgid "While Statement" msgstr "" #: ../../doc/src/progress.md:171 msgid "Directory: `tests/statements/while`" msgstr "" #: ../../doc/src/progress.md msgid "`Simple while loops`" msgstr "" #: ../../doc/src/progress.md msgid "[while_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`exit / cycle in while loops`" msgstr "" #: ../../doc/src/progress.md msgid "[while_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_02.f90)" msgstr "" #: ../../doc/src/progress.md:179 msgid "Print Statement" msgstr "" #: ../../doc/src/progress.md:181 msgid "Directory: `tests/statements/print`" msgstr "" #: ../../doc/src/progress.md msgid "`Basic print`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/print/t01.f90)" msgstr "" #: ../../doc/src/progress.md:188 msgid "Open, Read, Write, Close Statement" msgstr "" #: ../../doc/src/progress.md:190 msgid "Directory: `tests/statements/file_io`" msgstr "" #: ../../doc/src/progress.md msgid "`open/read/write/close`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/file_io/t01.f90)" msgstr "" #: ../../doc/src/progress.md:197 msgid "Intrinsic Functions" msgstr "" #: ../../doc/src/progress.md:199 msgid "abs" msgstr "" #: ../../doc/src/progress.md:201 msgid "Directory: `tests/intrinsic/abs`" msgstr "" #: ../../doc/src/progress.md msgid "`scalar single/double real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md msgid "`scalar single/double complex`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md msgid "`array 1D single/double real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:210 msgid "exp" msgstr "" #: ../../doc/src/progress.md:212 msgid "Directory: `tests/intrinsic/exp`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:221 msgid "log" msgstr "" #: ../../doc/src/progress.md:223 msgid "Directory: `tests/intrinsic/log`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:232 msgid "sqrt" msgstr "" #: ../../doc/src/progress.md:234 msgid "Directory: `tests/intrinsic/sqrt`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:243 msgid "sin" msgstr "" #: ../../doc/src/progress.md:245 msgid "Directory: `tests/intrinsic/sin`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:254 msgid "cos" msgstr "" #: ../../doc/src/progress.md:256 msgid "Directory: `tests/intrinsic/cos`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:265 msgid "tan" msgstr "" #: ../../doc/src/progress.md:267 msgid "Directory: `tests/intrinsic/tan`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:276 msgid "sinh" msgstr "" #: ../../doc/src/progress.md:278 msgid "Directory: `tests/intrinsic/sinh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:287 msgid "cosh" msgstr "" #: ../../doc/src/progress.md:289 msgid "Directory: `tests/intrinsic/cosh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:298 msgid "tanh" msgstr "" #: ../../doc/src/progress.md:300 msgid "Directory: `tests/intrinsic/tanh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:309 msgid "asin" msgstr "" #: ../../doc/src/progress.md:311 msgid "Directory: `tests/intrinsic/asin`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:320 msgid "acos" msgstr "" #: ../../doc/src/progress.md:322 msgid "Directory: `tests/intrinsic/acos`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:331 msgid "atan" msgstr "" #: ../../doc/src/progress.md:333 msgid "Directory: `tests/intrinsic/atan`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:342 msgid "modulo" msgstr "" #: ../../doc/src/progress.md:344 msgid "Directory: `tests/intrinsic/modulo`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:352 msgid "mod" msgstr "" #: ../../doc/src/progress.md:354 msgid "Directory: `tests/intrinsic/mod`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:362 msgid "min" msgstr "" #: ../../doc/src/progress.md:364 msgid "Directory: `tests/intrinsic/min`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:371 msgid "max" msgstr "" #: ../../doc/src/progress.md:373 msgid "Directory: `tests/intrinsic/max`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:380 msgid "int" msgstr "" #: ../../doc/src/progress.md:382 msgid "Directory: `tests/intrinsic/int`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:389 msgid "real" msgstr "" #: ../../doc/src/progress.md:391 msgid "Directory: `tests/intrinsic/real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:398 msgid "floor" msgstr "" #: ../../doc/src/progress.md:400 msgid "Directory: `tests/intrinsic/floor`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:407 msgid "nint" msgstr "" #: ../../doc/src/progress.md:409 msgid "Directory: `tests/intrinsic/nint`" 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 "" lfortran-0.63.0/doc/locale/bn/0000775000175000017500000000000015174404631016223 5ustar alastairalastairlfortran-0.63.0/doc/locale/bn/LC_MESSAGES/0000775000175000017500000000000015174404631020010 5ustar alastairalastairlfortran-0.63.0/doc/locale/bn/LC_MESSAGES/docs.po0000664000175000017500000042424715174404631021315 0ustar alastairalastair# SOME DESCRIPTIVE TITLE. # Copyright (C) 2022 LFortran contributors # This file is distributed under the same license as the LFortran package. # FIRST AUTHOR , 2022. # #, fuzzy msgid "" msgstr "" "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" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.10.3\n" #: ../../doc/src/ast_and_asr.ipynb:9 msgid "Difference between an AST and ASR" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:11 msgid "Let us take a simple Fortran code:" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:22 msgid "and look at how the AST and ASR looks like." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:25 ../../doc/src/progress.md msgid "AST" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:76 msgid "" "The AST does not have any semantic information, but has nodes to " "represent declarations such as ``integer, intent(in) :: a``. Variables " "such as ``a`` are represented by a ``Name`` node, and are not connected " "to their declarations yet." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:88 ../../doc/src/progress.md msgid "ASR" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:139 msgid "" "The ASR has all the semantic information (types, etc.), nodes like " "``Function`` have a symbol table and do not have any declaration nodes. " "Variables are simply pointers to the symbol table." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:142 msgid "Discussion" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:144 msgid "" "The above was a simple example. Things get more apparent for more " "complicated examples, such as:" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:160 msgid "" "AST must represent all the ``use`` statements and the ``interface`` " "block, and keep things semantically consistent." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:162 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" " are defined in the ``gfort_interop`` module, and so ASR does not have " "any of these declaration nodes." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:164 msgid "" "When converting from ASR to AST, LFortran will create all the appropriate" " AST declaration nodes automatically and correctly." msgstr "" #: ../../doc/src/contributing.md:1 msgid "Contributing" msgstr "" #: ../../doc/src/contributing.md:3 msgid "" "We welcome contributions from anyone, even if you are new to open source." " It might sound daunting to contribute to a compiler at first, but please" " do, it is not complicated. We will help you with any technical issues " "and help improve your contribution so that it can be merged." msgstr "" #: ../../doc/src/contributing.md:8 msgid "Basic Setup" msgstr "" #: ../../doc/src/contributing.md:10 msgid "To contribute, make sure your set up:" msgstr "" #: ../../doc/src/contributing.md:12 msgid "Your username + email" msgstr "" #: ../../doc/src/contributing.md:13 msgid "Your `~/.gitconfig`" msgstr "" #: ../../doc/src/contributing.md:14 msgid "Your shell prompt to display the current branch name" msgstr "" #: ../../doc/src/contributing.md:16 msgid "Fork LFortran" msgstr "" #: ../../doc/src/contributing.md:18 msgid "" "Step 1. Create a fork of the [project " "repository](https://github.com/lfortran/lfortran)" msgstr "" #: ../../doc/src/contributing.md:20 msgid "" "Step 2. Set up your [SSH key](https://docs.github.com/en/authentication" "/connecting-to-github-with-ssh) with GitHub" msgstr "" #: ../../doc/src/contributing.md:22 msgid "" "Step 3. Clone the project repository from GitHub and set up your remote " "repository" msgstr "" #: ../../doc/src/contributing.md:29 msgid "" ":fontawesome-solid-edit: `REMOTE_NAME` is the name of your remote " "repository and could be any name you like, for example your first name." msgstr "" #: ../../doc/src/contributing.md:31 msgid "" ":fontawesome-solid-edit: `YOUR_GITHUB_ID` is your user ID on GitHub and " "should be part of your account path." msgstr "" #: ../../doc/src/contributing.md:33 msgid "" "You can use `git remote -v` to check if the new remote is set up " "correctly." msgstr "" #: ../../doc/src/contributing.md:35 msgid "Send a New Merge Request" msgstr "" #: ../../doc/src/contributing.md:37 msgid "Step 1. Create a new branch" msgstr "" #: ../../doc/src/contributing.md:42 msgid "Step 2. Make changes in relevant file(s)" msgstr "" #: ../../doc/src/contributing.md:44 msgid "Step 3. Commit the changes:" msgstr "" #: ../../doc/src/contributing.md:51 msgid "" "[Here](https://chris.beams.io/posts/git-commit/) are some great tips on " "writing good commit messages." msgstr "" #: ../../doc/src/contributing.md:53 msgid "Step 4. Check to ensure that your changes look good" msgstr "" #: ../../doc/src/contributing.md:58 msgid "Step 5. Send the merge request" msgstr "" #: ../../doc/src/contributing.md:64 msgid "" "The command will push the new branch `fix1` into your remote repository " "`REMOTE_NAME` that you created earlier. Additionally, it will also " "display a link that you can click on to open the new merge request. After" " clicking on the link, write a title and a concise description then click" " the \"Create\" button. Yay you are now all set." msgstr "" #: ../../doc/src/contributing.md:66 msgid "Add New Features" msgstr "" #: ../../doc/src/contributing.md:68 msgid "" "The example below shows the steps it would take to create a caret binary " "operator **^** which computes the average value of the two operands." msgstr "" #: ../../doc/src/contributing.md:70 msgid "Create New Token(s)" msgstr "" #: ../../doc/src/contributing.md:72 msgid "" "We extend the *tokenizer.re* as well as *parser.yy* to add the new token " "**^**. We also tell LFortran how to print the new token in *parser.cpp*." msgstr "" #: ../../doc/src/contributing.md:75 msgid ":fontawesome-solid-code: *src/lfortran/parser/tokenizer.re*" msgstr "" #: ../../doc/src/contributing.md:80 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.yy*" msgstr "" #: ../../doc/src/contributing.md:85 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.cpp*" msgstr "" #: ../../doc/src/contributing.md:94 msgid "The added code is tested with `lfortran --show-tokens examples2/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:96 msgid "Parse the New Token" msgstr "" #: ../../doc/src/contributing.md:98 msgid "" "Now we have to parse the new operator. We add it to the AST by extending " "the BinOp with a caret operator and modifying the *AST.asdl* file. Then " "we add it in *parse.yy* to properly parse and generate the new AST in " "*semantics.h*.Finally we extend *pickle.cpp* so that the new operator can" " print itself." msgstr "" #: ../../doc/src/contributing.md:102 msgid ":fontawesome-solid-code:*grammar/AST.asdl*" msgstr "" #: ../../doc/src/contributing.md:107 msgid ":fontawesome-solid-code:*src/lfortran/parser/parser.yy*" msgstr "" #: ../../doc/src/contributing.md:116 msgid ":fontawesome-solid-code:*src/lfortran/parser/semantics.h*" msgstr "" #: ../../doc/src/contributing.md:121 msgid ":fontawesome-solid-code:*src/lfortran/pickle.cpp*" msgstr "" #: ../../doc/src/contributing.md:132 msgid "The section is tested with `lfortran --show-ast examples/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:134 msgid "Implement the Semantics of the New Token" msgstr "" #: ../../doc/src/contributing.md:136 msgid "" "We first extend the ASR in *ASR.asdl* and add ^ as a BinOp operator " "option." msgstr "" #: ../../doc/src/contributing.md:138 msgid ":fontawesome-solid-code:*src/libasr/ASR.asdl*" msgstr "" #: ../../doc/src/contributing.md:142 msgid ":fontawesome-solid-code:*src/lfortran/semantics/ast_common_visitor.h*" msgstr "" #: ../../doc/src/contributing.md:179 msgid "" "Then we transform it from AST to ASR by extending " "*src/lfortran/semantics/ast_common_visitor.h*." msgstr "" #: ../../doc/src/contributing.md:181 msgid "" "We also add it into compile time evaluation triggered by expressions such" " as `e = (2+3)^5` which is evaluated at compile time. An expression such " "as `e = x^5` is evaluated at run time only." msgstr "" #: ../../doc/src/contributing.md:183 msgid "The section is tested with `lfortran --show-asr examples/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:184 msgid "Implement the New Token in LLVM" msgstr "" #: ../../doc/src/contributing.md:186 msgid "" "To implement in LLVM, we extend the BinOp translation by handling the new" " operator. We first add the two numbers then divide by two. :fontawesome-" "solid-code:*src/lfortran/codegen/asr_to_llvm.cpp*" msgstr "" #: ../../doc/src/contributing.md:217 msgid "The section is tested with `lfortran --show-llvm examples/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:219 msgid "Now when LLVM works, we can test the final executable by:" msgstr "" #: ../../doc/src/contributing.md:224 msgid "And it should print 6." msgstr "" #: ../../doc/src/contributing.md:226 msgid "It also works interactively:" msgstr "" #: ../../doc/src/contributing.md:242 msgid "Reach Out" msgstr "" #: ../../doc/src/contributing.md:244 msgid "" "If you have any questions or need help, please ask as at our " "[mailinglist](https://groups.io/g/lfortran) or a " "[chat](https://lfortran.zulipchat.com/)." msgstr "" #: ../../doc/src/contributing.md:248 msgid "" "Please note that all participants of this project are expected to follow " "our Code of Conduct. By participating in this project you agree to abide " "by its terms. See " "[CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/blob/main/CODE_OF_CONDUCT.md)." msgstr "" #: ../../doc/src/contributing.md:252 msgid "" "By submitting a PR you agree to license your contribution under the " "LFortran's BSD " "[license](https://github.com/lfortran/lfortran/blob/main/LICENSE) unless " "explicitly noted otherwise." msgstr "" #: ../../doc/src/design.md:1 msgid "LFortran Design" msgstr "" #: ../../doc/src/design.md:3 msgid "High Level Overview" msgstr "" #: ../../doc/src/design.md:5 ../../doc/src/developer_tutorial.ipynb:16 msgid "" "LFortran is structured around two independent modules, AST and ASR, both " "of which are standalone (completely independent of the rest of LFortran) " "and users are encouraged to use them independently for other applications" " and build tools on top:" msgstr "" #: ../../doc/src/design.md:10 msgid "" "Abstract Syntax Tree (AST), module `lfortran.ast`: Represents any Fortran" " source code, strictly based on syntax, no semantic is included. The AST " "module can convert itself to Fortran source code." msgstr "" #: ../../doc/src/design.md:14 msgid "" "Abstract Semantic Representation (ASR), module `lfortran.asr`: Represents" " a valid Fortran source code, all semantic is included. Invalid Fortran " "code is not allowed (an error will be given). The ASR module can convert " "itself to an AST." msgstr "" #: ../../doc/src/design.md:19 msgid "" "The LFortran compiler is then composed of the following independent " "stages:" msgstr "" #: ../../doc/src/design.md:21 msgid "Parsing: converts Fortran source code to an AST" msgstr "" #: ../../doc/src/design.md:22 msgid "Semantic: converts an AST to an ASR" msgstr "" #: ../../doc/src/design.md:23 msgid "" "High level optimizations: optimize ASR to a possibly faster/simpler ASR " "(things like inlining functions, eliminating redundant expressions or " "statements, etc.)" msgstr "" #: ../../doc/src/design.md:26 msgid "" "LLVM IR code generation and lower level optimizations: converts an ASR to" " an LLVM IR. This stage also does all other optimizations that do not " "produce an ASR, but still make sense to do before passing to LLVM IR." msgstr "" #: ../../doc/src/design.md:29 msgid "" "Machine code generation: LLVM then does all its optimizations and " "generates machine code (such as a binary executable, a library, an object" " file, or it is loaded and executed using JIT as part of the interactive " "LFortran session or in a Jupyter kernel)." msgstr "" #: ../../doc/src/design.md:34 msgid "" "LFortran is structured as a library, and so one can for example use the " "parser to obtain an AST and do something with it, or one can then use the" " semantic analyzer to obtain ASR and do something with it. One can " "generate the ASR directly (e.g., from SymPy) and then either convert to " "AST and to a Fortran source code, or use LFortran to compile it to " "machine code directly. In other words, one can use LFortran to easily " "convert between the three equivalent representations:" msgstr "" #: ../../doc/src/design.md:42 msgid "Fortran source code" msgstr "" #: ../../doc/src/design.md:43 ../../doc/src/developer_tutorial.ipynb:23 msgid "Abstract Syntax Tree (AST)" msgstr "" #: ../../doc/src/design.md:44 ../../doc/src/developer_tutorial.ipynb:159 msgid "Abstract Semantic Representation (ASR)" msgstr "" #: ../../doc/src/design.md:46 msgid "They are all equivalent in the following sense:" msgstr "" #: ../../doc/src/design.md:48 msgid "Any ASR can always be converted to an equivalent AST" msgstr "" #: ../../doc/src/design.md:49 msgid "Any AST can always be converted to an equivalent Fortran source code" msgstr "" #: ../../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 "" #: ../../doc/src/design.md:52 msgid "" "Any AST can always be either converted to an equivalent ASR or one gets a" " semantic error" msgstr "" #: ../../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 "" #: ../../doc/src/design.md:58 msgid "ASR Design Details" msgstr "" #: ../../doc/src/design.md:60 msgid "The ASR is designed to have the following features:" msgstr "" #: ../../doc/src/design.md:62 msgid "" "ASR is still semantically equivalent to the original Fortran code (it did" " not lose any semantic information). ASR can be converted to AST, and AST" " to Fortran source code which is functionally equivalent to the original." msgstr "" #: ../../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 "" #: ../../doc/src/design.md:69 msgid "" "The ASR C++ classes (down the road) are designed similarly to SymEngine: " "they are constructed once and after that they are immutable. The " "constructor checks in Debug more that all the requirements are met (e.g.," " that all Variables in a Function have a dummy argument set, that " "explicit-shape arrays are not allocatable and all other Fortran " "requirements to make it a valid code), but in Release mode it quickly " "constructs the class without checks. Then there are builder classes that " "construct the ASR C++ classes to meet requirements (checked in Debug " "mode) and the builder gives an error message if a code is not a valid " "Fortran code, and if it doesn't give an error message, then the ASR C++ " "classes are constructed correctly. Thus by construction, the ASR classes " "always contain valid Fortran code and the rest of LFortran can depend on " "it." msgstr "" #: ../../doc/src/design.md:82 msgid "Notes:" msgstr "" #: ../../doc/src/design.md:84 msgid "" "Information that is lost when parsing source to AST: whitespace, " "multiline/single line if statement distinction, case sensitivity of " "keywords." msgstr "" #: ../../doc/src/design.md:87 msgid "" "Information that is lost when going from AST to ASR: detailed syntax how " "variables were defined and the order of type attributes (whether array " "dimension is using the `dimension` attribute, or parentheses at the " "variable; or how many variables there are per declaration line or their " "order), as ASR only represents the aggregated type information in the " "symbol table." msgstr "" #: ../../doc/src/design.md:90 msgid "" "ASR is the simplest way to generate Fortran code, as one does not have to" " worry about the detailed syntax (as in AST) about how and where things " "are declared. One specifies the symbol table for a module, then for each " "symbol (functions, global variables, types, ...) one specifies the local " "variables and if this is an interface then one needs to specify where one" " can find an implementation, otherwise a body is supplied with " "statements, those nodes are almost the same as in AST, except that each " "variable is just a reference to a symbol in the symbol table (so by " "construction one cannot have undefined variables). The symbol table for " "each node such as Function or Module also references its parent (for " "example a function references a module, a module references the global " "scope)." msgstr "" #: ../../doc/src/design.md:102 msgid "" "The ASR can be directly converted to an AST without gathering any other " "information. And the AST directly to Fortran source code." msgstr "" #: ../../doc/src/design.md:105 msgid "" "The ASR is always representing a semantically valid Fortran code. This " "is enforced by checks in the ASR C++ constructors (in Debug build). When " "an ASR is used, one can assume it is valid." msgstr "" #: ../../doc/src/design.md:109 msgid "Fortran 2008" msgstr "" #: ../../doc/src/design.md:111 msgid "" "Fortran 2008 [standard](https://j3-fortran.org/doc/year/10/10-007.pdf) " "chapter 2 \"Fortran concepts\" specifies that Fortran code is a " "collection of _program units_ (either all in one file, or in separate " "files), where each _program unit_ is one of:" msgstr "" #: ../../doc/src/design.md:116 ../../doc/src/design.md:131 msgid "main program" msgstr "" #: ../../doc/src/design.md:117 ../../doc/src/design.md:132 msgid "module or submodule" msgstr "" #: ../../doc/src/design.md:118 ../../doc/src/design.md:133 msgid "function or subroutine" msgstr "" #: ../../doc/src/design.md:120 msgid "" "Note: It can also be a _block data_ program unit, that is used to provide" " initial values for data objects in named _common blocks_, but we do not " "recommend the use of _common blocks_ (use modules instead)." msgstr "" #: ../../doc/src/design.md:124 msgid "LFortran Extension" msgstr "" #: ../../doc/src/design.md:126 msgid "" "We extend the Fortran language by introducing a _global scope_, which is " "not only the list of _program units_ (as in F2008) but can also include " "statements, declarations, use statements and expressions. We define " "_global scope_ as a collection of the following items:" msgstr "" #: ../../doc/src/design.md:134 msgid "use statement" msgstr "" #: ../../doc/src/design.md:135 msgid "declaration" msgstr "" #: ../../doc/src/design.md:136 msgid "statement" msgstr "" #: ../../doc/src/design.md:137 msgid "expression" msgstr "" #: ../../doc/src/design.md:139 msgid "" "In addition, if a variable is not defined in an assignment statement " "(such as `x = 5+3`) then the type of the variable is inferred from the " "right hand side (e.g., `x` in `x = 5+3` would be of type `integer`, and " "`y` in `y = 5._dp` would be of type `real(dp)`). This rule only applies " "at the top level of _global scope_. Types must be fully specified inside " "main programs, modules, functions and subroutines, just like in F2008." msgstr "" #: ../../doc/src/design.md:146 msgid "" "The _global scope_ has its own symbol table. The main program and " "module/submodule do not see any symbols from this symbol table. But " "functions, subroutines, statements and expressions at the top level of " "_global scope_ use and operate on this symbol table." msgstr "" #: ../../doc/src/design.md:151 msgid "" "The _global scope_ has the following symbols predefined in the symbol " "table:" msgstr "" #: ../../doc/src/design.md:153 msgid "" "the usual standard set of Fortran functions (such as `size`, `sin`, " "`cos`, ...)" msgstr "" #: ../../doc/src/design.md:155 msgid "" "the `dp` double precision symbol, so that one can use `5._dp` for double " "precision." msgstr "" #: ../../doc/src/design.md:158 msgid "" "Each item in the _global scope_ is interpreted as follows: main program " "is compiled into an executable with the same name and executed; modules, " "functions and subroutines are compiled and loaded; use statement and " "declaration adds those symbols with the proper type into the _global " "scope_ symbol table, but do not generate any code; statement is wrapped " "into an anonymous subroutine with no arguments, compiled, loaded and " "executed; expression is wrapped into an anonymous function with no " "arguments returning the expression, compiled, loaded, executed and the " "return value is returned to the user." msgstr "" #: ../../doc/src/design.md:168 msgid "" "The _global scope_ is always interpreted, item by item, per the previous " "paragraph. It is meant to allow interactive usage, experimentations and " "writing simple scripts. Code in _global scope_ must be interpreted using " "`lfortran`. For more complex (production) code it is recommended to turn " "it into modules and programs (by wrapping loose statements into " "subroutines or functions and by adding type declarations) and compile it " "with `lfortran` or any other Fortran compiler." msgstr "" #: ../../doc/src/design.md:176 msgid "Here are some examples of valid code in _global scope_:" msgstr "" #: ../../doc/src/design.md:178 msgid "Example 1" msgstr "" #: ../../doc/src/design.md:185 msgid "Example 2" msgstr "" #: ../../doc/src/design.md:197 msgid "Example 3" msgstr "" #: ../../doc/src/design.md:209 msgid "Example 4" msgstr "" #: ../../doc/src/design.md:217 msgid "Design Considerations" msgstr "" #: ../../doc/src/design.md:219 msgid "" "The LFortran extension of Fortran was chosen in a way so as to minimize " "the number of changes. In particular, only the top level of the _global " "scope_ has relaxed some of the Fortran rules (such as making specifying " "types optional) so as to allow simple and quick interactive usage, but " "inside functions, subroutines, modules or programs this relaxation does " "not apply." msgstr "" #: ../../doc/src/design.md:225 msgid "" "The number of changes were kept to minimum in order to make it " "straightforward to turn code at _global scope_ into standard compliant " "Fortran code using programs and modules, so that it can be compiled by " "any Fortran compiler." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:9 msgid "Developer Tutorial" msgstr "" #: ../../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 "" #: ../../doc/src/developer_tutorial.ipynb:14 msgid "Introduction" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:18 msgid "" "Abstract Syntax Tree (AST): Represents any Fortran source code, strictly " "based on syntax, no semantic is included. The AST module can convert " "itself to Fortran source code." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:20 msgid "" "Abstract Semantic Representation (ASR): Represents a valid Fortran source" " code, all semantic is included. Invalid Fortran code is not allowed (an " "error will be given). The ASR module can convert itself to an AST." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:25 msgid "" "Fortran source code can be parsed into an AST using the ``src_to_ast()`` " "function:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:49 #, python-format msgid "We can pretty print it using the ``%%showast`` magic:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:98 #, python-format msgid "We can convert AST to Fortran source code using ``%%showfmt``:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:156 msgid "" "All AST nodes and their arguments are described in `AST.asdl " "`__." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:170 #, python-format msgid "We can pretty print using the ``%%showasr`` magic:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:219 msgid "" "All ASR nodes and their arguments are described in `ASR.asdl " "`__." msgstr "" #: ../../doc/src/index.md:134 msgid "Getting started" msgstr "" #: ../../doc/src/index.md:141 ../../doc/src/progress.md:1 msgid "LFortran Development Status" msgstr "" #: ../../doc/src/index.md:147 msgid "Developer's Guide" msgstr "" #: ../../doc/src/index.md:156 msgid "LFortran Intrinsics" msgstr "" #: ../../doc/src/index.md:1 msgid "LFortran Documentation" msgstr "" #: ../../doc/src/index.md:3 msgid "" "LFortran is a modern open-source (BSD licensed) interactive Fortran " "compiler built on top of LLVM. It can execute user's code interactively " "to allow exploratory work (much like Python, MATLAB or Julia) as well as " "compile to binaries with the goal to run user's code on modern " "architectures such as multi-core CPUs and GPUs." msgstr "" #: ../../doc/src/index.md:9 #, python-format msgid "" "Website: [https://lfortran.org/](https://lfortran.org/) Main " "repository: " "[https://github.com/lfortran/lfortran](https://github.com/lfortran/lfortran)" " Try online using Binder: " "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb)" msgstr "" #: ../../doc/src/index.md:9 msgid "Binder" msgstr "" #: ../../doc/src/index.md:16 msgid "Feature Highlights" msgstr "" #: ../../doc/src/index.md:18 msgid "" "LFortran is in development, there are features that work today, and there" " are features that are being implemented. You can also check out the " "[Development Status](progress.md) section for more information on " "features being supported and being worked on." msgstr "" #: ../../doc/src/index.md:21 msgid "Works today" msgstr "" #: ../../doc/src/index.md:23 #, python-format msgid "" "**Interactive, Jupyter support** LFortran can be used from Jupyter as a" " Fortran kernel, allowing a Python/Julia style rapid prototyping and " "exploratory workflow (see the " "[static](https://nbviewer.jupyter.org/gist/certik/f1d28a486510810d824869ab0c491b1c)" " or [interactive](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb) example notebook). Or " "it can be used from the command-line in an interactive prompt (REPL)." msgstr "" #: ../../doc/src/index.md:32 msgid "" "**Clean, modular design, usable as a library** LFortran is structured " "around two independent modules, AST and ASR, both of which are " "standalone (completely independent of the rest of LFortran) and users " "are encouraged to use them independently for other applications and " "build tools on top. See the [Design](design.md) and [Developer " "Tutorial](developer_tutorial.md) documents for more details." msgstr "" #: ../../doc/src/index.md:39 msgid "" "**Interoperation with GFortran** LFortran can parse GFortran module " "files into an ASR and generate a Fortran wrapper that can be compiled " "with any Fortran compiler and linked with the original GFortran " "compiled module." msgstr "" #: ../../doc/src/index.md:44 msgid "" "**Create executables** It can create executables just like other " "Fortran compilers." msgstr "" #: ../../doc/src/index.md:47 msgid "" "**Runs on Linux, Mac and Windows** All three platforms are regularly " "tested by our CI." msgstr "" #: ../../doc/src/index.md:51 msgid "Planned" msgstr "" #: ../../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 "" #: ../../doc/src/index.md:56 msgid "" "**Native interoperation with other languages (and other Fortran " "compilers)** It can automatically call code written in other languages " "(such as C or Python) just by using the `use` statement, see " "[#44](https://gitlab.com/lfortran/lfortran/issues/44). It understands " "other Fortran compilers module files (one can just \"use\" them) and " "their ABI to link correctly (GFortran is supported, other compilers are" " planned, see [#56](https://gitlab.com/lfortran/lfortran/issues/56)), " "which allows to use LFortran with production codes today." msgstr "" #: ../../doc/src/index.md:65 msgid "" "**Modern hardware support** Thanks to LLVM, the goal of LFortran is to " "run on modern hardware and take advantage of native Fortran language " "constructs (such as `do concurrent`) to run on multi-core CPUs and " "GPUs, see [#57](https://gitlab.com/lfortran/lfortran/issues/57)." msgstr "" #: ../../doc/src/index.md:71 msgid "" "**Full Fortran 2018 support** Currently only a subset of Fortran is " "implemented, but the goal is to have a full implementation of the " "latest Fortran 2018 standard, see " "[#58](https://gitlab.com/lfortran/lfortran/issues/58)." msgstr "" #: ../../doc/src/index.md:77 msgid "" "Please vote on issues in our [issue " "tracker](https://gitlab.com/lfortran/lfortran/issues) that you want us to" " prioritize (feel free to create new ones if we are missing anything)." msgstr "" #: ../../doc/src/index.md:81 msgid "Roadmap" msgstr "" #: ../../doc/src/index.md:83 msgid "Here is our roadmap how to get all the planned features above implemented:" msgstr "" #: ../../doc/src/index.md:85 msgid "" "Port code generation to use ASR and pass all the current tests " "([#74](https://gitlab.com/lfortran/lfortran/issues/74)). Remove the old " "code generation and old semantics, that used to annotate the AST tree, " "which was messy." msgstr "" #: ../../doc/src/index.md:89 msgid "" "Get GFortran module files working with `use` module, both assumed-size " "and assumed-shape arrays " "([#52](https://gitlab.com/lfortran/lfortran/issues/52)). This will allow " "right away to use production codes with LFortran." msgstr "" #: ../../doc/src/index.md:93 msgid "Do these at the same time:" msgstr "" #: ../../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 "" #: ../../doc/src/index.md:98 msgid "" "b) Gradually move to C++ for robustness and speed " "([#70](https://gitlab.com/lfortran/lfortran/issues/70)). The Python API " "will not change (or only minimally), so the user experience from Python " "will not change." msgstr "" #: ../../doc/src/index.md:103 msgid "" "c) Implement all the other cool features: `use` module for C and Python " "and automatic wrappers " "([#44](https://gitlab.com/lfortran/lfortran/issues/44)), modern hardware" " support ([#57](https://gitlab.com/lfortran/lfortran/issues/57)), " "generating an older standard of Fortran " "([#72](https://gitlab.com/lfortran/lfortran/issues/72)), Fortran doctest" " feature ([#73](https://gitlab.com/lfortran/lfortran/issues/73)), SymPy" " integration ([#71](https://gitlab.com/lfortran/lfortran/issues/71)), " "language service for IDEs " "([#12](https://gitlab.com/lfortran/lfortran/issues/12)), and other ideas" " ([#29](https://gitlab.com/lfortran/lfortran/issues/29))." msgstr "" #: ../../doc/src/index.md:118 msgid "The step 1. is an internal refactoring that will not take long." msgstr "" #: ../../doc/src/index.md:120 msgid "" "The step 2. will allow LFortran to be used interactively with production " "codes right away (the production code will get compiled with GFortran, " "then one \"uses\" any module in LFortran and functions/subroutines can be" " interactively called, the module itself can use any GFortran supported " "feature, but the API must fit into the subset that LFortran understands " "--- for large number of applications simple functions/subroutines with " "array arguments are enough). This will make LFortran usable for first " "users and one can always use GFortran temporarily until LFortran supports" " the given feature. We expect to be finished with the step 2. by the end " "of summer 2019, hopefully sooner." msgstr "" #: ../../doc/src/index.md:130 msgid "" "Finally the step 3. will improve LFortran overall, allowing the first " "users to contribute back, growing the community and making LFortran " "gradually useful for more and more people." msgstr "" #: ../../doc/src/installation.md:1 msgid "Installation" msgstr "" #: ../../doc/src/installation.md:3 msgid "All the instructions below work on Linux, macOS and Windows." msgstr "" #: ../../doc/src/installation.md:5 msgid "Binaries" msgstr "" #: ../../doc/src/installation.md:7 msgid "" "The recommended way to install LFortran is using Conda. Install Conda for" " example by installing the " "[Miniconda](https://conda.io/en/latest/miniconda.html) installation by " "following instructions there for your platform. Then create a new " "environment (you can choose any name, here we chose `lf`) and activate " "it:" msgstr "" #: ../../doc/src/installation.md:16 msgid "Then install LFortran by:" msgstr "" #: ../../doc/src/installation.md:20 msgid "" "Now the `lf` environment has the `lfortran` compiler available, you can " "start the interactive prompt by executing `lfortran`, or see the command " "line options using `lfortran -h`." msgstr "" #: ../../doc/src/installation.md:24 msgid "" "The Jupyter kernel is automatically installed by the above command, so " "after installing Jupyter itself:" msgstr "" #: ../../doc/src/installation.md:28 msgid "You can create a Fortran based Jupyter notebook by executing:" msgstr "" #: ../../doc/src/installation.md:32 msgid "and selecting `New->Fortran`." msgstr "" #: ../../doc/src/installation.md:35 msgid "Build From a Source Tarball" msgstr "" #: ../../doc/src/installation.md:37 msgid "" "This method is the recommended method if you just want to install " "LFortran, either yourself or in a package manager (Spack, Conda, Debian, " "etc.). The source tarball has all the generated files included and has " "minimal dependencies." msgstr "" #: ../../doc/src/installation.md:39 msgid "First we have to install dependencies, for example using Conda:" msgstr "" #: ../../doc/src/installation.md:44 msgid "" "Then download a tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), e.g.:" msgstr "" #: ../../doc/src/installation.md:52 msgid "And build:" msgstr "" #: ../../doc/src/installation.md:58 msgid "This will install the `lfortran` into the `inst/bin`." msgstr "" #: ../../doc/src/installation.md:60 msgid "Build From Git" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/installation.md:72 msgid "Then prepare the environment:" msgstr "" #: ../../doc/src/installation.md:77 msgid "Clone the LFortran git repository:" msgstr "" #: ../../doc/src/installation.md:82 msgid "" "Generate files that are needed for the build (this step depends on " "`re2c`, `bison` and `python`):" msgstr "" #: ../../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 "" #: ../../doc/src/installation.md:92 msgid "Run tests:" msgstr "" #: ../../doc/src/installation.md:97 msgid "Run an interactive prompt:" msgstr "" #: ../../doc/src/installation.md:102 msgid "Build from Git on Windows with Visual Studio" msgstr "" #: ../../doc/src/installation.md:104 msgid "" "Install Visual Studio (MSVC), for example the version 2022, you can " "download the Community version for free from: " "https://visualstudio.microsoft.com/downloads/." msgstr "" #: ../../doc/src/installation.md:107 msgid "" "Install miniforge using the Windows installer from https://github.com" "/conda-forge/miniforge." msgstr "" #: ../../doc/src/installation.md:109 msgid "Launch the Miniforge Prompt from the Desktop." msgstr "" #: ../../doc/src/installation.md:111 msgid "In the shell, initialize the MSVC compiler using:" msgstr "" #: ../../doc/src/installation.md:117 msgid "You can optionally test that MSVC works by:" msgstr "" #: ../../doc/src/installation.md:122 msgid "Both commands must print help (several pages)." msgstr "" #: ../../doc/src/installation.md:124 msgid "Now you can download and build LFortran:" msgstr "" #: ../../doc/src/installation.md:134 msgid "If everything compiled, then you can use LFortran as follows:" msgstr "" #: ../../doc/src/installation.md:140 msgid "And so on." msgstr "" #: ../../doc/src/installation.md:142 msgid "" "Note: LFortran currently uses the MSVC's linker program (`link`), which " "is only available when the MSVC bat script above is ran. If you forget to" " activate it, LFortran's linking will fail." msgstr "" #: ../../doc/src/installation.md:146 msgid "" "Note: the miniforge shell seems to be running some version of `git-bash` " "(although it is `cmd.exe`), which has some unix-like filesystem mounted " "in `/usr` and several commands available such as `ls`, `which`, `git`, " "`vim`. For this reason the Conda build `environment_win.yml` contains " "everything needed, including `git`." msgstr "" #: ../../doc/src/installation.md:152 msgid "Build from Git on Windows with WSL" msgstr "" #: ../../doc/src/installation.md:153 msgid "In windows search \"turn windows features on or off\"." msgstr "" #: ../../doc/src/installation.md:154 msgid "Tick Windows subsystem for Linux." msgstr "" #: ../../doc/src/installation.md:155 msgid "Press OK and restart computer." msgstr "" #: ../../doc/src/installation.md:156 msgid "Go to Microsoft store and download Ubuntu 20.04, and launch it." msgstr "" #: ../../doc/src/installation.md:157 msgid "Run the following commands." msgstr "" #: ../../doc/src/installation.md:164 msgid "Now do the following to configure the path" msgstr "" #: ../../doc/src/installation.md:168 msgid "Then go to the bottom of the file and paste the following" msgstr "" #: ../../doc/src/installation.md:172 msgid "Then press ctrl + O (save), Enter (confirm), ctrl + X (exit)" msgstr "" #: ../../doc/src/installation.md:173 msgid "After that restart Ubuntu" msgstr "" #: ../../doc/src/installation.md:174 msgid "Run the following" msgstr "" #: ../../doc/src/installation.md:179 msgid "Restart Ubuntu again" msgstr "" #: ../../doc/src/installation.md:187 msgid "" "You can change the directory to a Windows location using `cd /mnt/[drive " "letter]/[windows location]`." msgstr "" #: ../../doc/src/installation.md:188 msgid "e.g. `cd mnt/c/Users/name/source/repos/`" msgstr "" #: ../../doc/src/installation.md:190 msgid "Now clone the LFortran git repository" msgstr "" #: ../../doc/src/installation.md:196 msgid "Run the following commands" msgstr "" #: ../../doc/src/installation.md:204 msgid "If everything compiles, you can use LFortran as follows" msgstr "" #: ../../doc/src/installation.md:210 msgid "Run an interactive prompt" msgstr "" #: ../../doc/src/installation.md:215 msgid "Run tests" msgstr "" #: ../../doc/src/installation.md:221 msgid "Enabling the Jupyter Kernel" msgstr "" #: ../../doc/src/installation.md:223 msgid "To install the Jupyter kernel, install the following Conda packages also:" msgstr "" #: ../../doc/src/installation.md:227 msgid "" "and enable the kernel by `-DWITH_XEUS=yes` and install into " "`$CONDA_PREFIX`. For example:" msgstr "" #: ../../doc/src/installation.md:239 msgid "" "To use it, install Jupyter (`conda install jupyter`) and test that the " "LFortran kernel was found:" msgstr "" #: ../../doc/src/installation.md:244 msgid "Then launch a Jupyter notebook as follows:" msgstr "" #: ../../doc/src/installation.md:248 msgid "Click `New->Fortran`. To launch a terminal jupyter LFortran console:" msgstr "" #: ../../doc/src/installation.md:254 msgid "Build From Git with Nix" msgstr "" #: ../../doc/src/installation.md:256 msgid "" "One of the ways to ensure exact environment and dependencies is with " "`nix`. This will ensure that system dependencies do not interfere with " "the development environment. If you want, you can report bugs in a `nix-" "shell` environment to make it easier for others to reproduce." msgstr "" #: ../../doc/src/installation.md:258 msgid "With Root" msgstr "" #: ../../doc/src/installation.md:260 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 "" #: ../../doc/src/installation.md:264 msgid "Without Root" msgstr "" #: ../../doc/src/installation.md:266 msgid "" "If you would like to not provide `nix` with root access to your machine, " "on Linux distributions we can use [nix-" "portable](https://github.com/DavHau/nix-portable)." msgstr "" #: ../../doc/src/installation.md:270 msgid "" "Now just prepend all `nix-shell` commands with `NP_RUNTIME=bwrap ./nix-" "portable `. So:" msgstr "" #: ../../doc/src/installation.md:278 msgid "Development" msgstr "" #: ../../doc/src/installation.md:280 msgid "Now we can enter the development environment:" msgstr "" #: ../../doc/src/installation.md:284 msgid "" "The `--pure` flag ensures no system dependencies are used in the " "environment." msgstr "" #: ../../doc/src/installation.md:286 msgid "The build steps are the same as with the `ci`:" msgstr "" #: ../../doc/src/installation.md:292 msgid "" "To change the compilation environment from `gcc` (default) to `clang` we " "can use `--argstr`:" msgstr "" #: ../../doc/src/installation.md:297 msgid "Note About Dependencies" msgstr "" #: ../../doc/src/installation.md:299 msgid "" "End users (and distributions) are encouraged to use the tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), which " "only depends on LLVM, CMake and a C++ compiler." msgstr "" #: ../../doc/src/installation.md:303 msgid "" "The tarball is generated automatically by our CI (continuous integration)" " and contains some autogenerated files: the parser, the AST and ASR " "nodes, which is generated by an ASDL translator (requires Python)." msgstr "" #: ../../doc/src/installation.md:307 msgid "The instructions from git are to be used when developing LFortran itself." msgstr "" #: ../../doc/src/installation.md:309 msgid "Note for users who do not use Conda" msgstr "" #: ../../doc/src/installation.md:311 msgid "" "Following are the dependencies necessary for installing this repository " "in development mode," msgstr "" #: ../../doc/src/installation.md:314 msgid "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" msgstr "" #: ../../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 "" #: ../../doc/src/installation.md:316 msgid "[re2c - 2.0.3](https://re2c.org/install/install.html)" msgstr "" #: ../../doc/src/installation.md:317 msgid "" "[binutils - " "2.31.90](ftp://sourceware.org/pub/binutils/snapshots/binutils-2.31.90.tar.xz)" " - Make sure that you should enable the required options related to this " "dependency to build the dynamic libraries (the ones ending with `.so`)." msgstr "" #: ../../doc/src/installation.md:319 msgid "Stacktraces" msgstr "" #: ../../doc/src/installation.md:321 msgid "" "LFortran can print stacktraces when there is an unhandled exception, as " "well as on any compiler error with the `--show-stacktrace` option. This " "is very helpful for developing the compiler itself to see where in " "LFortran the problem is. The stacktrace support is turned off by default," " to enable it, compile LFortran with the `-DWITH_STACKTRACE=yes` cmake " "option after installing the prerequisites on each platform per the " "instructions below." msgstr "" #: ../../doc/src/installation.md:328 msgid "Ubuntu" msgstr "" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." msgstr "" #: ../../doc/src/installation.md:332 msgid "macOS" msgstr "" #: ../../doc/src/installation.md:334 msgid "" "If you use the default Clang compiler on macOS, then the stacktraces " "should just work on both Intel and M1 based macOS (the CMake build system" " automatically invokes the `dsymtuil` tool and our Python scripts to " "store the debug information, see `src/bin/CMakeLists.txt` for more " "details). If it does not work, please report a bug." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/installation.md:352 msgid "" "and compile LFortran with the " "`-DCMAKE_PREFIX_PATH=\"$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX\"` cmake" " option. The `$CONDA_PREFIX` is there if you install some other " "dependencies (such as `llvm`) using Conda, otherwise you can remove it." msgstr "" #: ../../doc/src/intrinsics/array.md:1 msgid "Array Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:1 msgid "allocated(x): Status Check" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:3 msgid "Logical status of an allocatable integer." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:5 #: ../../doc/src/intrinsics/array/cshift.md:5 #: ../../doc/src/intrinsics/array/size.md:5 #: ../../doc/src/intrinsics/bit/bge.md:5 ../../doc/src/intrinsics/bit/bgt.md:5 #: ../../doc/src/intrinsics/bit/bit_size.md:5 #: ../../doc/src/intrinsics/bit/ble.md:5 ../../doc/src/intrinsics/bit/blt.md:5 #: ../../doc/src/intrinsics/bit/btest.md:5 #: ../../doc/src/intrinsics/bit/shiftl.md:5 #: ../../doc/src/intrinsics/bit/shiftr.md:5 #: ../../doc/src/intrinsics/character/achar.md:5 #: ../../doc/src/intrinsics/character/adjustl.md:5 #: ../../doc/src/intrinsics/character/adjustr.md:5 #: ../../doc/src/intrinsics/character/char.md:5 #: ../../doc/src/intrinsics/character/len_trim.md:5 #: ../../doc/src/intrinsics/character/lge.md:5 #: ../../doc/src/intrinsics/kind-type/kind.md:5 #: ../../doc/src/intrinsics/mathematical/acos.md:5 #: ../../doc/src/intrinsics/mathematical/acosh.md:5 #: ../../doc/src/intrinsics/mathematical/asin.md:5 #: ../../doc/src/intrinsics/mathematical/asinh.md:5 #: ../../doc/src/intrinsics/mathematical/atan.md:5 #: ../../doc/src/intrinsics/mathematical/atan2.md:5 #: ../../doc/src/intrinsics/mathematical/atanh.md:5 #: ../../doc/src/intrinsics/mathematical/fraction.md:5 #: ../../doc/src/intrinsics/misc/command_argument_count.md:5 #: ../../doc/src/intrinsics/misc/cpu_time.md:5 #: ../../doc/src/intrinsics/misc/date_and_time.md:5 #: ../../doc/src/intrinsics/misc/new_line.md:5 #: ../../doc/src/intrinsics/numeric/abs.md:5 #: ../../doc/src/intrinsics/numeric/aimag.md:5 #: ../../doc/src/intrinsics/numeric/aint.md:5 #: ../../doc/src/intrinsics/numeric/anint.md:5 #: ../../doc/src/intrinsics/numeric/ceiling.md:5 #: ../../doc/src/intrinsics/numeric/cmplx.md:5 #: ../../doc/src/intrinsics/numeric/conjg.md:5 #: ../../doc/src/intrinsics/numeric/digits.md:5 #: ../../doc/src/intrinsics/numeric/dim.md:5 #: ../../doc/src/intrinsics/numeric/epsilon.md:5 #: ../../doc/src/intrinsics/numeric/erf.md:5 #: ../../doc/src/intrinsics/numeric/erfc.md:5 #: ../../doc/src/intrinsics/numeric/exp.md:5 #: ../../doc/src/intrinsics/numeric/floor.md:5 #: ../../doc/src/intrinsics/numeric/gamma.md:5 #: ../../doc/src/intrinsics/numeric/mod.md:5 msgid "Declaration" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:7 #: ../../doc/src/intrinsics/array/cshift.md:7 #: ../../doc/src/intrinsics/array/size.md:7 #: ../../doc/src/intrinsics/bit/bge.md:7 ../../doc/src/intrinsics/bit/bgt.md:7 #: ../../doc/src/intrinsics/bit/bit_size.md:7 #: ../../doc/src/intrinsics/bit/ble.md:7 ../../doc/src/intrinsics/bit/blt.md:7 #: ../../doc/src/intrinsics/bit/btest.md:7 #: ../../doc/src/intrinsics/bit/shiftl.md:7 #: ../../doc/src/intrinsics/bit/shiftr.md:7 #: ../../doc/src/intrinsics/character/achar.md:7 #: ../../doc/src/intrinsics/character/adjustl.md:7 #: ../../doc/src/intrinsics/character/adjustr.md:7 #: ../../doc/src/intrinsics/character/char.md:7 #: ../../doc/src/intrinsics/character/len_trim.md:7 #: ../../doc/src/intrinsics/character/lge.md:8 #: ../../doc/src/intrinsics/kind-type/kind.md:7 #: ../../doc/src/intrinsics/mathematical/acos.md:7 #: ../../doc/src/intrinsics/mathematical/acosh.md:7 #: ../../doc/src/intrinsics/mathematical/asin.md:7 #: ../../doc/src/intrinsics/mathematical/asinh.md:7 #: ../../doc/src/intrinsics/mathematical/atan.md:7 #: ../../doc/src/intrinsics/mathematical/atan2.md:7 #: ../../doc/src/intrinsics/mathematical/atanh.md:7 #: ../../doc/src/intrinsics/mathematical/fraction.md:7 #: ../../doc/src/intrinsics/misc/command_argument_count.md:7 #: ../../doc/src/intrinsics/misc/cpu_time.md:7 #: ../../doc/src/intrinsics/misc/date_and_time.md:7 #: ../../doc/src/intrinsics/misc/new_line.md:7 #: ../../doc/src/intrinsics/numeric/abs.md:7 #: ../../doc/src/intrinsics/numeric/aimag.md:7 #: ../../doc/src/intrinsics/numeric/aint.md:7 #: ../../doc/src/intrinsics/numeric/anint.md:7 #: ../../doc/src/intrinsics/numeric/ceiling.md:7 #: ../../doc/src/intrinsics/numeric/cmplx.md:7 #: ../../doc/src/intrinsics/numeric/conjg.md:7 #: ../../doc/src/intrinsics/numeric/digits.md:7 #: ../../doc/src/intrinsics/numeric/dim.md:7 #: ../../doc/src/intrinsics/numeric/epsilon.md:7 #: ../../doc/src/intrinsics/numeric/erf.md:7 #: ../../doc/src/intrinsics/numeric/erfc.md:7 #: ../../doc/src/intrinsics/numeric/exp.md:7 #: ../../doc/src/intrinsics/numeric/floor.md:7 #: ../../doc/src/intrinsics/numeric/gamma.md:7 #: ../../doc/src/intrinsics/numeric/mod.md:7 msgid "Syntax" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:14 #: ../../doc/src/intrinsics/array/cshift.md:14 #: ../../doc/src/intrinsics/array/size.md:14 #: ../../doc/src/intrinsics/bit/bge.md:14 #: ../../doc/src/intrinsics/bit/bgt.md:14 #: ../../doc/src/intrinsics/bit/bit_size.md:14 #: ../../doc/src/intrinsics/bit/ble.md:14 #: ../../doc/src/intrinsics/bit/blt.md:14 #: ../../doc/src/intrinsics/bit/btest.md:14 #: ../../doc/src/intrinsics/bit/shiftl.md:14 #: ../../doc/src/intrinsics/bit/shiftr.md:14 #: ../../doc/src/intrinsics/character/achar.md:14 #: ../../doc/src/intrinsics/character/adjustl.md:14 #: ../../doc/src/intrinsics/character/adjustr.md:14 #: ../../doc/src/intrinsics/character/char.md:14 #: ../../doc/src/intrinsics/character/len_trim.md:14 #: ../../doc/src/intrinsics/character/lge.md:15 #: ../../doc/src/intrinsics/kind-type/kind.md:14 #: ../../doc/src/intrinsics/mathematical/acos.md:14 #: ../../doc/src/intrinsics/mathematical/acosh.md:14 #: ../../doc/src/intrinsics/mathematical/asin.md:14 #: ../../doc/src/intrinsics/mathematical/asinh.md:14 #: ../../doc/src/intrinsics/mathematical/atan.md:14 #: ../../doc/src/intrinsics/mathematical/atan2.md:13 #: ../../doc/src/intrinsics/mathematical/atanh.md:14 #: ../../doc/src/intrinsics/mathematical/fraction.md:13 #: ../../doc/src/intrinsics/misc/command_argument_count.md:14 #: ../../doc/src/intrinsics/misc/cpu_time.md:14 #: ../../doc/src/intrinsics/misc/date_and_time.md:14 #: ../../doc/src/intrinsics/misc/new_line.md:14 #: ../../doc/src/intrinsics/numeric/abs.md:15 #: ../../doc/src/intrinsics/numeric/aimag.md:15 #: ../../doc/src/intrinsics/numeric/aint.md:14 #: ../../doc/src/intrinsics/numeric/anint.md:14 #: ../../doc/src/intrinsics/numeric/ceiling.md:14 #: ../../doc/src/intrinsics/numeric/cmplx.md:16 #: ../../doc/src/intrinsics/numeric/conjg.md:15 #: ../../doc/src/intrinsics/numeric/digits.md:13 #: ../../doc/src/intrinsics/numeric/dim.md:13 #: ../../doc/src/intrinsics/numeric/epsilon.md:14 #: ../../doc/src/intrinsics/numeric/erf.md:14 #: ../../doc/src/intrinsics/numeric/erfc.md:14 #: ../../doc/src/intrinsics/numeric/exp.md:14 #: ../../doc/src/intrinsics/numeric/floor.md:14 #: ../../doc/src/intrinsics/numeric/gamma.md:14 #: ../../doc/src/intrinsics/numeric/mod.md:15 msgid "Arguments" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:16 msgid "`x` is an integer input parameter." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:18 #: ../../doc/src/intrinsics/array/cshift.md:22 #: ../../doc/src/intrinsics/array/size.md:22 #: ../../doc/src/intrinsics/bit/bge.md:18 #: ../../doc/src/intrinsics/bit/bgt.md:18 #: ../../doc/src/intrinsics/bit/bit_size.md:18 #: ../../doc/src/intrinsics/bit/ble.md:18 #: ../../doc/src/intrinsics/bit/blt.md:18 #: ../../doc/src/intrinsics/bit/btest.md:19 #: ../../doc/src/intrinsics/bit/shiftl.md:21 #: ../../doc/src/intrinsics/bit/shiftr.md:21 #: ../../doc/src/intrinsics/character/lge.md:23 #: ../../doc/src/intrinsics/kind-type/kind.md:19 #: ../../doc/src/intrinsics/mathematical/acos.md:18 #: ../../doc/src/intrinsics/mathematical/acosh.md:19 #: ../../doc/src/intrinsics/mathematical/asin.md:18 #: ../../doc/src/intrinsics/mathematical/asinh.md:19 #: ../../doc/src/intrinsics/mathematical/atan.md:18 #: ../../doc/src/intrinsics/mathematical/atan2.md:21 #: ../../doc/src/intrinsics/mathematical/atanh.md:19 #: ../../doc/src/intrinsics/mathematical/fraction.md:17 #: ../../doc/src/intrinsics/misc/command_argument_count.md:18 #: ../../doc/src/intrinsics/misc/cpu_time.md:18 #: ../../doc/src/intrinsics/misc/date_and_time.md:39 #: ../../doc/src/intrinsics/misc/new_line.md:19 #: ../../doc/src/intrinsics/numeric/abs.md:19 #: ../../doc/src/intrinsics/numeric/aimag.md:19 #: ../../doc/src/intrinsics/numeric/aint.md:20 #: ../../doc/src/intrinsics/numeric/anint.md:20 #: ../../doc/src/intrinsics/numeric/ceiling.md:18 #: ../../doc/src/intrinsics/numeric/cmplx.md:24 #: ../../doc/src/intrinsics/numeric/conjg.md:19 #: ../../doc/src/intrinsics/numeric/digits.md:17 #: ../../doc/src/intrinsics/numeric/dim.md:18 #: ../../doc/src/intrinsics/numeric/epsilon.md:18 #: ../../doc/src/intrinsics/numeric/erf.md:18 #: ../../doc/src/intrinsics/numeric/erfc.md:18 #: ../../doc/src/intrinsics/numeric/exp.md:18 #: ../../doc/src/intrinsics/numeric/floor.md:20 #: ../../doc/src/intrinsics/numeric/gamma.md:19 #: ../../doc/src/intrinsics/numeric/mod.md:22 msgid "Return values" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:20 msgid "" "The return value is a logical scalar with the default logical kind type " "parameter." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:23 #: ../../doc/src/intrinsics/array/cshift.md:26 #: ../../doc/src/intrinsics/array/size.md:26 #: ../../doc/src/intrinsics/bit/bge.md:22 #: ../../doc/src/intrinsics/bit/bgt.md:22 #: ../../doc/src/intrinsics/bit/bit_size.md:22 #: ../../doc/src/intrinsics/bit/ble.md:22 #: ../../doc/src/intrinsics/bit/blt.md:22 #: ../../doc/src/intrinsics/bit/btest.md:23 #: ../../doc/src/intrinsics/bit/shiftl.md:25 #: ../../doc/src/intrinsics/bit/shiftr.md:25 #: ../../doc/src/intrinsics/character/achar.md:27 #: ../../doc/src/intrinsics/character/adjustl.md:23 #: ../../doc/src/intrinsics/character/adjustr.md:24 #: ../../doc/src/intrinsics/character/char.md:28 #: ../../doc/src/intrinsics/character/len_trim.md:22 #: ../../doc/src/intrinsics/character/lge.md:31 #: ../../doc/src/intrinsics/kind-type/kind.md:23 #: ../../doc/src/intrinsics/mathematical/acos.md:23 #: ../../doc/src/intrinsics/mathematical/acosh.md:24 #: ../../doc/src/intrinsics/mathematical/asin.md:23 #: ../../doc/src/intrinsics/mathematical/asinh.md:24 #: ../../doc/src/intrinsics/mathematical/atan.md:23 #: ../../doc/src/intrinsics/mathematical/atan2.md:27 #: ../../doc/src/intrinsics/mathematical/atanh.md:24 #: ../../doc/src/intrinsics/mathematical/fraction.md:22 #: ../../doc/src/intrinsics/misc/command_argument_count.md:22 #: ../../doc/src/intrinsics/misc/cpu_time.md:22 #: ../../doc/src/intrinsics/misc/date_and_time.md:43 #: ../../doc/src/intrinsics/misc/new_line.md:24 #: ../../doc/src/intrinsics/numeric/abs.md:24 #: ../../doc/src/intrinsics/numeric/aimag.md:23 #: ../../doc/src/intrinsics/numeric/aint.md:28 #: ../../doc/src/intrinsics/numeric/anint.md:27 #: ../../doc/src/intrinsics/numeric/ceiling.md:22 #: ../../doc/src/intrinsics/numeric/cmplx.md:30 #: ../../doc/src/intrinsics/numeric/conjg.md:23 #: ../../doc/src/intrinsics/numeric/digits.md:21 #: ../../doc/src/intrinsics/numeric/dim.md:22 #: ../../doc/src/intrinsics/numeric/epsilon.md:22 #: ../../doc/src/intrinsics/numeric/erf.md:23 #: ../../doc/src/intrinsics/numeric/erfc.md:23 #: ../../doc/src/intrinsics/numeric/exp.md:22 #: ../../doc/src/intrinsics/numeric/floor.md:28 #: ../../doc/src/intrinsics/numeric/gamma.md:23 #: ../../doc/src/intrinsics/numeric/mod.md:31 ../../doc/src/progress.md msgid "Description" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:25 msgid "" "`allocated(x)` checks the allocation status of a integer input parameter." " It returns a logical value as `TRUE` if the input argument `x` is " "allocated, `FALSE` otherwise." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:29 #: ../../doc/src/intrinsics/array/cshift.md:39 #: ../../doc/src/intrinsics/array/size.md:33 #: ../../doc/src/intrinsics/bit/bge.md:27 #: ../../doc/src/intrinsics/bit/bgt.md:27 #: ../../doc/src/intrinsics/bit/bit_size.md:27 #: ../../doc/src/intrinsics/bit/ble.md:27 #: ../../doc/src/intrinsics/bit/blt.md:27 #: ../../doc/src/intrinsics/bit/btest.md:32 #: ../../doc/src/intrinsics/bit/shiftl.md:32 #: ../../doc/src/intrinsics/bit/shiftr.md:32 #: ../../doc/src/intrinsics/character/achar.md:37 #: ../../doc/src/intrinsics/character/adjustl.md:28 #: ../../doc/src/intrinsics/character/adjustr.md:29 #: ../../doc/src/intrinsics/character/char.md:38 #: ../../doc/src/intrinsics/character/len_trim.md:27 #: ../../doc/src/intrinsics/character/lge.md:37 #: ../../doc/src/intrinsics/kind-type/kind.md:27 #: ../../doc/src/intrinsics/mathematical/acos.md:31 #: ../../doc/src/intrinsics/mathematical/acosh.md:43 #: ../../doc/src/intrinsics/mathematical/asin.md:31 #: ../../doc/src/intrinsics/mathematical/asinh.md:35 #: ../../doc/src/intrinsics/mathematical/atan.md:31 #: ../../doc/src/intrinsics/mathematical/atan2.md:53 #: ../../doc/src/intrinsics/mathematical/atanh.md:39 #: ../../doc/src/intrinsics/mathematical/fraction.md:30 #: ../../doc/src/intrinsics/misc/command_argument_count.md:27 #: ../../doc/src/intrinsics/misc/cpu_time.md:33 #: ../../doc/src/intrinsics/misc/date_and_time.md:53 #: ../../doc/src/intrinsics/misc/new_line.md:29 #: ../../doc/src/intrinsics/numeric/abs.md:35 #: ../../doc/src/intrinsics/numeric/aimag.md:33 #: ../../doc/src/intrinsics/numeric/aint.md:35 #: ../../doc/src/intrinsics/numeric/anint.md:38 #: ../../doc/src/intrinsics/numeric/ceiling.md:26 #: ../../doc/src/intrinsics/numeric/cmplx.md:47 #: ../../doc/src/intrinsics/numeric/conjg.md:33 #: ../../doc/src/intrinsics/numeric/digits.md:26 #: ../../doc/src/intrinsics/numeric/dim.md:27 #: ../../doc/src/intrinsics/numeric/epsilon.md:29 #: ../../doc/src/intrinsics/numeric/erf.md:33 #: ../../doc/src/intrinsics/numeric/erfc.md:36 #: ../../doc/src/intrinsics/numeric/exp.md:29 #: ../../doc/src/intrinsics/numeric/floor.md:33 #: ../../doc/src/intrinsics/numeric/gamma.md:38 #: ../../doc/src/intrinsics/numeric/mod.md:43 msgid "Types" 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 "" #: ../../doc/src/intrinsics/array/allocated.md:46 #: ../../doc/src/intrinsics/array/cshift.md:43 #: ../../doc/src/intrinsics/array/size.md:37 #: ../../doc/src/intrinsics/bit/bge.md:49 #: ../../doc/src/intrinsics/bit/bgt.md:49 #: ../../doc/src/intrinsics/bit/bit_size.md:44 #: ../../doc/src/intrinsics/bit/ble.md:49 #: ../../doc/src/intrinsics/bit/blt.md:49 #: ../../doc/src/intrinsics/bit/btest.md:56 #: ../../doc/src/intrinsics/bit/shiftl.md:62 #: ../../doc/src/intrinsics/bit/shiftr.md:62 #: ../../doc/src/intrinsics/character/achar.md:53 #: ../../doc/src/intrinsics/character/adjustl.md:45 #: ../../doc/src/intrinsics/character/adjustr.md:46 #: ../../doc/src/intrinsics/character/char.md:53 #: ../../doc/src/intrinsics/character/len_trim.md:44 #: ../../doc/src/intrinsics/character/lge.md:59 #: ../../doc/src/intrinsics/kind-type/kind.md:59 #: ../../doc/src/intrinsics/mathematical/acos.md:60 #: ../../doc/src/intrinsics/mathematical/acosh.md:72 #: ../../doc/src/intrinsics/mathematical/asin.md:60 #: ../../doc/src/intrinsics/mathematical/asinh.md:64 #: ../../doc/src/intrinsics/mathematical/atan.md:60 #: ../../doc/src/intrinsics/mathematical/atan2.md:75 #: ../../doc/src/intrinsics/mathematical/atanh.md:68 #: ../../doc/src/intrinsics/mathematical/fraction.md:34 #: ../../doc/src/intrinsics/misc/command_argument_count.md:31 #: ../../doc/src/intrinsics/misc/cpu_time.md:44 #: ../../doc/src/intrinsics/misc/date_and_time.md:64 #: ../../doc/src/intrinsics/misc/new_line.md:40 #: ../../doc/src/intrinsics/numeric/abs.md:79 #: ../../doc/src/intrinsics/numeric/aimag.md:53 #: ../../doc/src/intrinsics/numeric/aint.md:39 #: ../../doc/src/intrinsics/numeric/anint.md:42 #: ../../doc/src/intrinsics/numeric/ceiling.md:46 #: ../../doc/src/intrinsics/numeric/cmplx.md:59 #: ../../doc/src/intrinsics/numeric/conjg.md:53 #: ../../doc/src/intrinsics/numeric/digits.md:30 #: ../../doc/src/intrinsics/numeric/dim.md:31 #: ../../doc/src/intrinsics/numeric/epsilon.md:49 #: ../../doc/src/intrinsics/numeric/erf.md:53 #: ../../doc/src/intrinsics/numeric/erfc.md:56 #: ../../doc/src/intrinsics/numeric/exp.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:65 #: ../../doc/src/intrinsics/numeric/gamma.md:58 #: ../../doc/src/intrinsics/numeric/mod.md:80 msgid "Examples" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:59 #: ../../doc/src/intrinsics/array/cshift.md:55 #: ../../doc/src/intrinsics/array/size.md:48 #: ../../doc/src/intrinsics/mathematical/acos.md:76 #: ../../doc/src/intrinsics/mathematical/acosh.md:81 #: ../../doc/src/intrinsics/mathematical/asin.md:76 #: ../../doc/src/intrinsics/mathematical/asinh.md:73 #: ../../doc/src/intrinsics/mathematical/atan.md:76 #: ../../doc/src/intrinsics/mathematical/atan2.md:84 #: ../../doc/src/intrinsics/mathematical/atanh.md:77 #: ../../doc/src/intrinsics/mathematical/fraction.md:44 msgid "**Result**:" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:65 #: ../../doc/src/intrinsics/array/cshift.md:62 #: ../../doc/src/intrinsics/array/size.md:55 #: ../../doc/src/intrinsics/bit/bge.md:68 #: ../../doc/src/intrinsics/bit/bgt.md:66 #: ../../doc/src/intrinsics/bit/bit_size.md:61 #: ../../doc/src/intrinsics/bit/ble.md:68 #: ../../doc/src/intrinsics/bit/blt.md:66 #: ../../doc/src/intrinsics/bit/btest.md:71 #: ../../doc/src/intrinsics/bit/shiftl.md:80 #: ../../doc/src/intrinsics/bit/shiftr.md:80 #: ../../doc/src/intrinsics/character/achar.md:69 #: ../../doc/src/intrinsics/character/adjustl.md:62 #: ../../doc/src/intrinsics/character/adjustr.md:63 #: ../../doc/src/intrinsics/character/char.md:69 #: ../../doc/src/intrinsics/character/len_trim.md:63 #: ../../doc/src/intrinsics/character/lge.md:79 #: ../../doc/src/intrinsics/kind-type/kind.md:79 #: ../../doc/src/intrinsics/mathematical/acos.md:82 #: ../../doc/src/intrinsics/mathematical/acosh.md:86 #: ../../doc/src/intrinsics/mathematical/asin.md:82 #: ../../doc/src/intrinsics/mathematical/asinh.md:78 #: ../../doc/src/intrinsics/mathematical/atan.md:82 #: ../../doc/src/intrinsics/mathematical/atan2.md:90 #: ../../doc/src/intrinsics/mathematical/atanh.md:82 #: ../../doc/src/intrinsics/mathematical/fraction.md:50 #: ../../doc/src/intrinsics/misc/command_argument_count.md:47 #: ../../doc/src/intrinsics/misc/cpu_time.md:64 #: ../../doc/src/intrinsics/misc/date_and_time.md:90 #: ../../doc/src/intrinsics/misc/new_line.md:56 #: ../../doc/src/intrinsics/numeric/abs.md:96 #: ../../doc/src/intrinsics/numeric/aimag.md:68 #: ../../doc/src/intrinsics/numeric/aint.md:55 #: ../../doc/src/intrinsics/numeric/anint.md:58 #: ../../doc/src/intrinsics/numeric/ceiling.md:64 #: ../../doc/src/intrinsics/numeric/cmplx.md:74 #: ../../doc/src/intrinsics/numeric/conjg.md:68 #: ../../doc/src/intrinsics/numeric/digits.md:44 #: ../../doc/src/intrinsics/numeric/dim.md:47 #: ../../doc/src/intrinsics/numeric/epsilon.md:63 #: ../../doc/src/intrinsics/numeric/erf.md:67 #: ../../doc/src/intrinsics/numeric/erfc.md:70 #: ../../doc/src/intrinsics/numeric/exp.md:71 #: ../../doc/src/intrinsics/numeric/floor.md:83 #: ../../doc/src/intrinsics/numeric/gamma.md:74 #: ../../doc/src/intrinsics/numeric/mod.md:95 msgid "See Also" msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:1 msgid "cshift(A, shift [, dim]): Circular Shift" msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:3 msgid "Circular shift elements of an array." 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 "" #: ../../doc/src/intrinsics/array/cshift.md:18 msgid "`shift` the input value of integer type." msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:20 msgid "" "`dim` optional dimension, if present, `cshift` returns the result of this" " dimension." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/array/cshift.md:28 msgid "" "**cshift(A, shift [, dim])** performs a circular shift on elements of `A`" " array along the dimension of `dim`. Default value of `dim` is 1, used " "when `dim` is not passed." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/array/cshift.md:41 msgid "" "Supported argument type is array for `A` and integer for `shift` and " "`dim`." msgstr "" #: ../../doc/src/intrinsics/array/size.md:1 msgid "size(x): Size of Array" msgstr "" #: ../../doc/src/intrinsics/array/size.md:3 msgid "Returns the size of an array `x`." msgstr "" #: ../../doc/src/intrinsics/array/size.md:18 msgid "" "`dim` optional dimension, if present, `size` returns the size of this " "dimension." msgstr "" #: ../../doc/src/intrinsics/array/size.md:20 msgid "`kind` optional the kind of the return value." msgstr "" #: ../../doc/src/intrinsics/array/size.md:24 msgid "`n` the size of an array (integer)." msgstr "" #: ../../doc/src/intrinsics/array/size.md:28 msgid "" "The `size` intrinsic function returns the size of an array. It returns " "the product of all dimensions, unless the `dim` argument is specified, in" " which case it only returns the size of this particular dimension. The " "`kind` argument can be used to specify the integer kind of the result." msgstr "" #: ../../doc/src/intrinsics/array/size.md:57 msgid "[shape](), [reshape]()." msgstr "" #: ../../doc/src/intrinsics/bit.md:1 msgid "Bit Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:1 msgid "bge(x, y): Bitwise Greater or Equal" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:3 msgid "Bitwise greater than or equal to." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/bge.md:29 #: ../../doc/src/intrinsics/bit/bgt.md:29 #: ../../doc/src/intrinsics/bit/ble.md:29 #: ../../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 "" #: ../../doc/src/intrinsics/bit/bge.md:60 #: ../../doc/src/intrinsics/bit/bgt.md:59 #: ../../doc/src/intrinsics/bit/bit_size.md:54 #: ../../doc/src/intrinsics/bit/ble.md:60 #: ../../doc/src/intrinsics/bit/blt.md:59 #: ../../doc/src/intrinsics/bit/btest.md:65 #: ../../doc/src/intrinsics/bit/shiftl.md:74 #: ../../doc/src/intrinsics/bit/shiftr.md:74 #: ../../doc/src/intrinsics/character/achar.md:63 #: ../../doc/src/intrinsics/character/adjustl.md:56 #: ../../doc/src/intrinsics/character/adjustr.md:57 #: ../../doc/src/intrinsics/character/char.md:63 #: ../../doc/src/intrinsics/character/len_trim.md:57 #: ../../doc/src/intrinsics/character/lge.md:72 #: ../../doc/src/intrinsics/kind-type/kind.md:72 #: ../../doc/src/intrinsics/misc/command_argument_count.md:40 #: ../../doc/src/intrinsics/misc/cpu_time.md:57 #: ../../doc/src/intrinsics/misc/date_and_time.md:83 #: ../../doc/src/intrinsics/misc/new_line.md:49 #: ../../doc/src/intrinsics/numeric/abs.md:89 #: ../../doc/src/intrinsics/numeric/aimag.md:62 #: ../../doc/src/intrinsics/numeric/aint.md:48 #: ../../doc/src/intrinsics/numeric/anint.md:51 #: ../../doc/src/intrinsics/numeric/ceiling.md:57 #: ../../doc/src/intrinsics/numeric/cmplx.md:68 #: ../../doc/src/intrinsics/numeric/conjg.md:62 #: ../../doc/src/intrinsics/numeric/digits.md:38 #: ../../doc/src/intrinsics/numeric/dim.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:57 #: ../../doc/src/intrinsics/numeric/erf.md:61 #: ../../doc/src/intrinsics/numeric/erfc.md:64 #: ../../doc/src/intrinsics/numeric/exp.md:65 #: ../../doc/src/intrinsics/numeric/floor.md:76 #: ../../doc/src/intrinsics/numeric/gamma.md:67 #: ../../doc/src/intrinsics/numeric/mod.md:89 msgid "**Result:**" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:70 msgid "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/bgt.md:1 msgid "bgt(x, y): Bitwise Greater Than" msgstr "" #: ../../doc/src/intrinsics/bit/bgt.md:3 msgid "Bitwise greater than." 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 "" #: ../../doc/src/intrinsics/bit/bgt.md:68 msgid "[bge](bge.md), [ble](ble.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:1 msgid "bit_size(x): Bit Size" msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:3 msgid "Bit size." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:16 msgid "`x` is integer input value." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:20 #: ../../doc/src/intrinsics/numeric/digits.md:19 msgid "The return value is of type integer." 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 "" #: ../../doc/src/intrinsics/bit/bit_size.md:29 msgid "Supported input types is integer." msgstr "" #: ../../doc/src/intrinsics/bit/ble.md:1 msgid "bge(x, y): Bitwise Less or Equal" msgstr "" #: ../../doc/src/intrinsics/bit/ble.md:3 msgid "Bitwise less than or equal to." 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 "" #: ../../doc/src/intrinsics/bit/ble.md:70 msgid "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:1 msgid "blt(x, y): Bitwise Less Than" msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:3 msgid "Bitwise less than." 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 "" #: ../../doc/src/intrinsics/bit/blt.md:68 msgid "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:1 msgid "btest(x, pos): Bit Test at Position" msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:3 msgid "Bit test." 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 "" #: ../../doc/src/intrinsics/bit/btest.md:21 msgid "The return value is of type logical." msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:25 msgid "" "`btest(x, pos)` calculates if `pos` bit in input integer value `x` is " "set. The counting of the bits starts at 0, at least significant bit (LSB)" " i.e., the rightmost bit in `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:1 msgid "shiftl(x, shift): Shift Left" msgstr "" #: ../../doc/src/intrinsics/bit/shiftl.md:3 msgid "Logical shift left function." msgstr "" #: ../../doc/src/intrinsics/bit/shiftl.md:16 #: ../../doc/src/intrinsics/bit/shiftr.md:16 msgid "`x` is an integer input value." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:27 msgid "" "**shiftl(x, shift)** logically left shifts `x` by `shift` number of bits." " `shiftl` shifts from LSB(**L**east **S**ignificant **B**it) to " "MSB(**M**ost **S**ignificant **B**it). Bits shifted from the left end " "i.e., MSB bits are lost. Zeroes are appended to the opposite right end." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:82 msgid "[shiftr](shiftr.md)." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:1 msgid "shiftr(x, shift): Shift Right" msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:3 msgid "Logical shift right function." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:27 msgid "" "**shiftr(x, shift)** logically right shifts `x` by `shift` number of " "bits. `shiftr` shifts from MSB(**M**ost **S**ignificant **B**it) to " "LSB(**L**east **S**ignificant **B**it). Bits shifted from the right end " "i.e., LSB bits are lost. Zeroes are appended to the opposite left end." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:82 msgid "[shiftl](shiftl.md)." msgstr "" #: ../../doc/src/intrinsics/character.md:1 msgid "Character Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/character/achar.md:1 msgid "achar(x, kind): To Character in ASCII set." msgstr "" #: ../../doc/src/intrinsics/character/achar.md:3 msgid "Character represented by in the ASCII character set." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/character/achar.md:20 #: ../../doc/src/intrinsics/character/adjustl.md:18 #: ../../doc/src/intrinsics/character/adjustr.md:18 #: ../../doc/src/intrinsics/character/char.md:21 #: ../../doc/src/intrinsics/character/len_trim.md:18 msgid "Return value" 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/achar.md:29 msgid "" "**achar(x, kind)** returns the character represented by the ASCII " "character set at `x` position." msgstr "" #: ../../doc/src/intrinsics/character/achar.md:32 #: ../../doc/src/intrinsics/character/char.md:33 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 "" #: ../../doc/src/intrinsics/character/achar.md:35 #: ../../doc/src/intrinsics/character/char.md:36 msgid "It is a runtime builtin function." 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 "" #: ../../doc/src/intrinsics/character/adjustl.md:1 msgid "adjustl(string): Left Adjust String" msgstr "" #: ../../doc/src/intrinsics/character/adjustl.md:3 msgid "Left adjust a string." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/adjustl.md:30 #: ../../doc/src/intrinsics/character/adjustr.md:31 msgid "Supported argument type is character." msgstr "" #: ../../doc/src/intrinsics/character/adjustr.md:1 msgid "adjustr(string): Right Adjust String" msgstr "" #: ../../doc/src/intrinsics/character/adjustr.md:3 msgid "Right adjust a string." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/adjustr.md:65 msgid "[adjustl](adjustl.md)." msgstr "" #: ../../doc/src/intrinsics/character/char.md:1 msgid "char(x, [, kind]): Integer to Character" msgstr "" #: ../../doc/src/intrinsics/character/char.md:3 msgid "Integer to character conversion." msgstr "" #: ../../doc/src/intrinsics/character/char.md:16 msgid "`x`: the input value of integer type." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/character/char.md:30 msgid "" "**char(x)** returns the character represented by the ASCII character set " "at `x` position." msgstr "" #: ../../doc/src/intrinsics/character/char.md:71 msgid "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:1 msgid "len_trim(string): Length Ignoring Trailing Blanks" msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:3 msgid "Length of a character string ignoring trailing blank character(s)." msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:16 msgid "`string` the input value of character type." msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:20 msgid "The return value is of type unsigned integer." 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 "" #: ../../doc/src/intrinsics/character/len_trim.md:29 msgid "Supported argument type is character scalar." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:1 msgid "lge(x, y): Lexically Greater or Equal" msgstr "" #: ../../doc/src/intrinsics/character/lge.md:3 msgid "Lexically greater than or equal." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:17 msgid "`x` input value of type character." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:19 msgid "`y` input value of type character." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:21 msgid "`x` and `y` can be seen as string A and string B." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:25 msgid "The return value is of logical `true` or `false` type." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:27 msgid "`True` if `x` string is lexically greater than or equal to `y`." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:29 msgid "`False` if they are not." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:33 msgid "" "**lge(x, y)** determines if input string `x` is lexically greater than or" " equal to input string `y`. The two strings in comparison are interpreted" " as containing ASCII character codes." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:39 msgid "Argument types should be of type character literal." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:81 msgid "[len_trim](len_trim.md)." msgstr "" #: ../../doc/src/intrinsics/kind-type.md:1 msgid "Kind Type Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:1 msgid "kind(x): Kind of an Entity" msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:3 msgid "Kind of an entity." 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 "" #: ../../doc/src/intrinsics/kind-type/kind.md:21 msgid "The return value is of integer type and of default integer kind." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:25 msgid "**kind(x)** returns the kind parameter of the input argument `x`." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:29 msgid "" "Supported argument types are logical, integer, real, complex, or " "character." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:81 #: ../../doc/src/intrinsics/misc/command_argument_count.md:16 #: ../../doc/src/intrinsics/misc/cpu_time.md:20 #: ../../doc/src/intrinsics/misc/date_and_time.md:41 #: ../../doc/src/intrinsics/misc/new_line.md:58 msgid "None." msgstr "" #: ../../doc/src/intrinsics/mathematical.md:1 msgid "Mathematical Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:1 msgid "acos(x): Trigonometric Arc Cosine" msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:3 msgid "Trigonometric arc cosine (inverse cosine) function." 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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:20 #: ../../doc/src/intrinsics/mathematical/acosh.md:21 #: ../../doc/src/intrinsics/mathematical/asin.md:20 #: ../../doc/src/intrinsics/mathematical/asinh.md:21 #: ../../doc/src/intrinsics/mathematical/atan.md:20 #: ../../doc/src/intrinsics/mathematical/atanh.md:21 msgid "" "The returned value has the kind of the input value and TYPE may be real " "or complex." msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:25 msgid "**acos(x)** computes the arcsine of the argument **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:33 #: ../../doc/src/intrinsics/mathematical/acosh.md:45 #: ../../doc/src/intrinsics/mathematical/asin.md:33 #: ../../doc/src/intrinsics/mathematical/asinh.md:37 #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:84 msgid "[asin](asin.md), [atan](atan.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:1 msgid "acosh(x): Inverse Hyperbolic Cosine" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:3 msgid "Inverse hyperbolic cosine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:16 #: ../../doc/src/intrinsics/mathematical/asinh.md:16 #: ../../doc/src/intrinsics/mathematical/atanh.md:16 msgid "" "`x` the input value, can be real with value greater than or equal to 1 or" " of type complex." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:26 msgid "**acosh(x)** computes the inverse hyperbolic cosine function of **x**." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acosh.md:33 msgid "$-\\pi <= img (acosh(x)) <= \\pi$" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:35 msgid "" "For real values $x$ in the domain $x > 1$, the inverse hyperbolic cosine " "satisifies:" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:38 msgid "$cosh^{-1}(x) = \\log(x + \\sqrt{(x^2 - 1)})$" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acosh.md:88 msgid "[asinh](asinh.md), [atanh](atanh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:1 msgid "asin(x): Trigonometric Arcsine" msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:3 msgid "Trigonometric arcsine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:25 msgid "**asin(x)** computes the arcsine of the argument **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/asin.md:84 msgid "[acos](acos.md), [atan](atan.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:1 msgid "asinh(x): Inverse Hyperbolic Arcsine" msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:3 msgid "Inverse hyperbolic arcsine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:26 msgid "**asinh(x)** computes the inverse hyperbolic arcsine function of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/asinh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (asinh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:80 msgid "[acosh](acosh.md), [atanh](atanh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:1 msgid "atan(x): Trigonometric ArcTangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:3 msgid "Trigonometric arctangent (inverse arctangent) function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:25 msgid "**atan(x)** computes the arctangent of the argument **x**." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:27 msgid "" "The arc tangent is the inverse function of the arctangent function. It is" " commonly used in trigonometry to find the angle when the lengths of the " "opposite side of a right triangle and base are known, i.e., perpendicular" " and base length." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:84 msgid "[asin](asin.md), [acos](acos.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:1 msgid "atan2(y, x): ArcTangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:3 msgid "Arctangent function or inverse tangent function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:15 msgid "`y` the input value is the imaginary part of the complex expression" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atan2.md:19 msgid "`x` the input value, must be real part of the complex expression." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atan2.md:29 msgid "" "**atan2(y, x)** computes the principal value of the argument function of " "the complex expression $x + iy$. This is used to transform from cartesian" " into polar coordinates and allows to determine the angle in the correct " "quadrant." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:33 msgid "It is also represented as:" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:35 msgid "$tan^{-1}(\\frac{y}{x})$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:37 msgid "If `x` is nonzero, the result lies in the range:" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:39 msgid "$-\\pi <= atan(x) <= \\pi$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:41 msgid "The sign is positive if `y` is positive." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:43 msgid "If `y` is zero and `x` is strictly positive, then the result is 0." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:45 msgid "If `x` is negative and `y` is positive zero, then the result is $\\pi$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:47 msgid "If `x` is negative and `y` is negative zero, then the result is $-\\pi$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:49 msgid "If `x` is zero, then the magnitude of the result is $\\frac{\\pi}{2}$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:51 msgid "If `y` is negative real zero, the result is $\\frac{-\\pi}{2}$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:55 #: ../../doc/src/intrinsics/mathematical/fraction.md:32 msgid "Supported argument type is real." msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:1 msgid "atanh(x): Inverse Hyperbolic Tangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:3 msgid "Inverse hyperbolic tangent function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:26 msgid "**atanh(x)** computes the inverse hyperbolic tangent function of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atanh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (atanh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:35 msgid "If the result is real, it lies in the range" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:37 msgid "$-1.0 < atanh(x) < 1.0$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:84 msgid "[asinh](asinh.md), [acosh](acosh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:1 msgid "fraction(x): Fractional Part in Model Representation" msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:3 msgid "Fractional part of the model representation." msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:15 msgid "`x` the input value, must be real." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/fraction.md:24 msgid "" "**fraction(x)** computes the fractional part of the model representation " "of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/fraction.md:28 msgid "$x * {radix(x)}^{(-exponent(x))}$" msgstr "" #: ../../doc/src/intrinsics/misc.md:1 msgid "Miscellaneous Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:1 msgid "command_argument_count(): Number of Command Line Arguments" msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:3 msgid "Get number of command line arguments." msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:20 msgid "The return value is of integer type and of default kind." 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 "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:29 msgid "Any." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:1 msgid "cpu_time(x): CPU Elapsed Time" msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:3 msgid "CPU elapsed time in seconds." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:16 msgid "`x` the input value should be of type real with `intent(out)`." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:24 msgid "" "**cpu_time(time)** returns a real value representing the elapsed CPU time" " in seconds. If tine source is available, time will be reported with " "microsecond resolution. If no time source is available, TIME is set to " "-1.0." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:28 msgid "This is useful for testing segments of code to determine computation time." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:1 msgid "date_and_time([date, time, zone, values]): Date and Time" msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:3 msgid "Date and time subroutine." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:22 msgid "" "`zone` the input value of character type, which has length 5 or larger. " "It is of default kind. It is `intent(out)` and has from `(+-)hhmm`, " "representing the difference with respect to Coordinates Universal Time " "(UTC). Unavailable time and date parameters return blanks." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:30 msgid "`value(1)`: The year." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:31 msgid "`value(2)`: The month." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:32 msgid "`value(3)`: The day of the month." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:33 msgid "`value(4)`: Time difference with UTC in minutes." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:34 msgid "`value(5)`: The hour of the day." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:35 msgid "`value(6)`: The minutes of the hour." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:36 msgid "`value(7)`: The seconds of the minutes." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:37 msgid "`value(8)`: The milliseconds of the second." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:51 msgid "Unavailable or errorneous date and time parameters return blanks." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:92 msgid "[cpu_time](cpu_time.md)." msgstr "" #: ../../doc/src/intrinsics/misc/new_line.md:1 msgid "new_line(x): New Line Character" msgstr "" #: ../../doc/src/intrinsics/misc/new_line.md:3 msgid "New line character." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/new_line.md:31 msgid "Supported input parameter types is character." msgstr "" #: ../../doc/src/intrinsics/numeric.md:1 msgid "Numeric Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:1 msgid "abs(x): Absolute Value" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:3 msgid "Absolute value." msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:17 msgid "`x` the input value, can be integer, real, or complex." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/abs.md:26 msgid "" "**abs(x)** calculates and returns absolute value of `x`. Result is " "calculated using mathematical formula:" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:29 msgid "$|x|$" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:31 msgid "If `x` is complex, the result is calculated using mathematical formula:" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:33 msgid "$\\sqrt{(x^2 + y^2)}$" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aimag.md:1 msgid "aimag(x): Imaginary Part" msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:3 msgid "Imaginary part of complex number." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:17 msgid "`x` the input value must be of complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:21 msgid "The return value is imaginary part of type real and kind same as of `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:25 msgid "**aimag(x)** returns the imaginary part of the input complex argument `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:27 #: ../../doc/src/intrinsics/numeric/cmplx.md:41 #: ../../doc/src/intrinsics/numeric/conjg.md:27 msgid "" "For `x` complex input value, the result is calculated using mathematical " "formula:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aimag.md:35 msgid "Supported argument types are complex." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:1 msgid "aint(x, [kind]): Truncate to a Whole Number" msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:3 msgid "Truncate to a whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:16 #: ../../doc/src/intrinsics/numeric/anint.md:16 #: ../../doc/src/intrinsics/numeric/epsilon.md:16 #: ../../doc/src/intrinsics/numeric/erf.md:16 #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aint.md:37 #: ../../doc/src/intrinsics/numeric/anint.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:31 #: ../../doc/src/intrinsics/numeric/erf.md:35 #: ../../doc/src/intrinsics/numeric/erfc.md:38 #: ../../doc/src/intrinsics/numeric/floor.md:35 #: ../../doc/src/intrinsics/numeric/gamma.md:40 msgid "Supported argument types is real." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:85 msgid "[ceiling](ceiling.md), [mod](mod.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:1 msgid "anint(x, [kind]): Round to Nearest Whole Number" msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:3 msgid "Round to nearest whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:25 msgid "The return value is equal to rounded whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:29 msgid "**anint(x)** calculates rounded value of input parameter `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/anint.md:34 msgid "If `x` is greater than 0, `anint(x)` returns `aint(x + 0.5)`." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:60 msgid "[aint](aint.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:1 msgid "ceiling(x): Integer Ceiling" msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:3 msgid "Integer ceiling function" msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:16 msgid "The input value `x` may be of type real or integer." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:20 msgid "The return value is of type integer and nearest greater integer." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:24 msgid "**ceiling(x)** returns the least integer greater than or equal to `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:28 msgid "Supported input parameter types are integer and real." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:66 msgid "[floor](floor.md), [mod](mod.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:1 msgid "cmplx(x [, [, kind]]): Convert to Complex" msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:3 msgid "Conversion to complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:14 msgid "`cmplx(x, y)` is one of the intrinsic present in ASR." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:18 msgid "" "`x` the input value must be of integer, real, or complex. `y` the " "optional input value must be of type integer or real. It should be only " "present in case `x` is not complex. `kind` the optional input value of " "integer expression type for initialisation indicating the kind parameter " "of the result." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/cmplx.md:32 msgid "" "**cmplx(x, [, y [, kind]])** converts the input value to complex " "representation:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/cmplx.md:37 msgid "If `y` is not present, the imaginary component is set to 0.0." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:39 msgid "If `x` is complex then `y` must not be present." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:49 msgid "Supported argument types are integer, real, or complex." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:1 msgid "conjg(x): Complex Conjugate" msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:3 msgid "Complex conjugate function." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:17 msgid "`x` the input value must be of type complex." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:21 msgid "The return value is of complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:25 msgid "**conjg(x)** converts the input value `x` to its conjugate." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:29 msgid "$x + iy$ converted to $x - iy$" msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:35 msgid "Supported argument types is complex." msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:1 msgid "digits(x): Significant Binary Digits" msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:3 msgid "Significant binary digits." msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:15 msgid "`x` the input value must be of type real or integer." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/dim.md:1 msgid "dim(x, y): Positive Difference or 0" msgstr "" #: ../../doc/src/intrinsics/numeric/dim.md:3 msgid "Positive difference or 0." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/dim.md:20 msgid "The return value is of type integer or real." 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 "" #: ../../doc/src/intrinsics/numeric/epsilon.md:1 msgid "epsilon(x): Epsilon" msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:3 msgid "Epsilon function." msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:20 msgid "The return value is of same type as of the input argument." msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:24 msgid "" "**epsilon(x)** computes the smallest number $\\epsilon$ of the same kind " "as `x` following:" msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:27 msgid "$1 + \\epsilon > 1$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:1 msgid "erf(x): Error" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:3 msgid "Error function." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/erf.md:27 msgid "$-1 \\leq erf (x) \\leq 1$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_0^xe^{-t^2}dt$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:69 msgid "[erfc](erfc.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:1 msgid "erfc(x): Complementary Error" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:3 msgid "Complementary error function." 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 "" #: ../../doc/src/intrinsics/numeric/erfc.md:27 msgid "$0 \\leq erf (x) \\leq 2$" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_{x}^{\\infty}e^{-t^2}dt$" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/erfc.md:72 msgid "[erf](erf.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:1 msgid "exp(x): Exponential" msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:3 msgid "Exponential function." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:16 msgid "`x` the input value must be of type real or complex." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:20 msgid "The return value is of same type as of the input argument, `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:24 msgid "**exp(x)** computes the base $e$ exponential of `x`, i.e., $e^x$." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/exp.md:31 msgid "Supported argument types is real and complex." msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:1 msgid "floor(x, kind): Integer Floor" msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:3 msgid "Integer floor function." msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:18 msgid "" "`kind` the optional input parameter must be a scalar integer constant " "expression." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:1 msgid "gamma(x): Gamma" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:3 msgid "Gamma function." 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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:21 msgid "The return value is of same type and kind as of `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:28 msgid "$\\gamma(x) = (x-1)!$" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:30 msgid "In general, if $x > 0$:" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:32 msgid "$\\gamma(x) = \\int_{0}^{\\infty} e^{-t} dt$" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:34 msgid "and if $-n-1 < x < -n$ where n is an integer >= 0:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:76 msgid "[epsilon](epsilon.md)" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:1 msgid "mod(x, y): Modulus" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:3 msgid "Modulus or remainder function." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:17 msgid "`x` the input value, can be integer or real." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/mod.md:27 msgid "`x - INT (x / y) * y`." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:29 msgid "If `y` is 0, the result is undefined like `any integer value / 0`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/mod.md:36 msgid "`x - INT(x / y) * y`" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:38 msgid "" "i.e., result is remainder when first argument is mathematically divided " "by second argument." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:41 msgid "The return value should be less than `y`." msgstr "" #: ../../doc/src/language.md:1 msgid "Fortran Language" msgstr "" #: ../../doc/src/language.md:3 msgid "Background and Motivation" msgstr "" #: ../../doc/src/language.md:5 msgid "" "Fortran was designed from the ground up to naturally and simply translate" " mathematics to code that compiles and runs at maximum speed. And being " "specifically targeted for such fundamentally computational tasks, it " "contains a broad range of key functionality within the language itself, " "standard across all platforms, with no need for external libraries that " "may or may not be well optimized or maintained, at present or down the " "road." msgstr "" #: ../../doc/src/language.md:12 msgid "Some highlights:" 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 "" #: ../../doc/src/language.md:17 msgid "" "Operators which operate naturally upon the aforementioned " "arrays/matrices, as they do scalars;" msgstr "" #: ../../doc/src/language.md:19 msgid "Complex numbers;" msgstr "" #: ../../doc/src/language.md:20 msgid "Special functions;" msgstr "" #: ../../doc/src/language.md:21 msgid "Structures and pointers for more general data representation." msgstr "" #: ../../doc/src/language.md:23 msgid "" "Because the essentials are contained in the language itself, it is simple" " to read and write, without need of choosing from among or deciphering a " "proliferation of external classes to do the same thing. And because the " "essentials are self-contained, compilers can provide detailed compile-" "time (e.g., argument mismatch) and run-time (e.g., memory access) checks," " as well as highly optimized executables, directly from natural, readable" " code without need of extensive optimization heroics by the developer." msgstr "" #: ../../doc/src/language.md:31 msgid "See our blog posts for more information:" msgstr "" #: ../../doc/src/language.md:33 msgid "" "[Why We Created LFortran](https://lfortran.org/blog/2019/04/why-we-" "created-lfortran/)" msgstr "" #: ../../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 "" #: ../../doc/src/language.md:36 msgid "How to Learn Fortran" msgstr "" #: ../../doc/src/language.md:38 msgid "" "Fortran is relatively quick to learn because it is so much simpler and " "smaller than C/C++ (in practice, that is, with all needed libraries " "included). If you are interested in learning more, please see our webpage" " at [fortran90.org] with recommended practices for writing code, side by " "side comparison with Python/NumPy, links to other online Fortran " "resources and books, and an FAQ." msgstr "" #: ../../doc/src/progress.md:3 msgid "" "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:" msgstr "" #: ../../doc/src/progress.md:7 msgid "AST: The code can be parsed to AST (`lfortran --show-ast test.f90`)" msgstr "" #: ../../doc/src/progress.md:8 msgid "ASR: The code can be transformed to ASR (`lfortran --show-asr test.f90`)" msgstr "" #: ../../doc/src/progress.md:9 msgid "LLVM: LFortran can generate LLVM IR (`lfortran --show-llvm test.f90`)" msgstr "" #: ../../doc/src/progress.md:10 msgid "BIN: The LLVM IR can compile to a binary" msgstr "" #: ../../doc/src/progress.md:11 msgid "RUN: The binary runs without errors" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:16 msgid "" "This page is generated automatically using the [Compiler " "Tester](https://gitlab.com/lfortran/compiler_tester) repository which " "contains all the Fortran tests and scripts to run LFortran to produce the" " tables below. We are looking for contributors to contribute more tests. " "Our goal is to have a comprehensive Fortran testsuite that can be used to" " test any Fortran compiler." msgstr "" #: ../../doc/src/progress.md:23 msgid "Testing the LFortran compiler version:" msgstr "" #: ../../doc/src/progress.md:32 msgid "Topics" msgstr "" #: ../../doc/src/progress.md:34 msgid "Full programs that compute something interesting" msgstr "" #: ../../doc/src/progress.md:36 msgid "Basic Numerics" msgstr "" #: ../../doc/src/progress.md:38 msgid "Directory: `tests/programs/numerics`" msgstr "" #: ../../doc/src/progress.md msgid "LLVM" msgstr "" #: ../../doc/src/progress.md msgid "BIN" msgstr "" #: ../../doc/src/progress.md msgid "RUN" msgstr "" #: ../../doc/src/progress.md msgid "Filename" msgstr "" #: ../../doc/src/progress.md msgid "`Pure Fortran sin(x) implementation`" msgstr "" #: ../../doc/src/progress.md msgid "✅" 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 "" #: ../../doc/src/progress.md:45 msgid "Modules" msgstr "" #: ../../doc/src/progress.md:47 msgid "Basic Usage" msgstr "" #: ../../doc/src/progress.md:49 msgid "Directory: `tests/modules/basic`" msgstr "" #: ../../doc/src/progress.md msgid "`Basic modules`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/basic/t01.f90)" msgstr "" #: ../../doc/src/progress.md:56 msgid "Module Functions and Subroutines" msgstr "" #: ../../doc/src/progress.md:58 msgid "Directory: `tests/modules/procedures`" msgstr "" #: ../../doc/src/progress.md msgid "`Module functions`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`Module subroutines`" msgstr "" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t02.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`Nested subroutines`" msgstr "" #: ../../doc/src/progress.md msgid "[t03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t03.f90)" msgstr "" #: ../../doc/src/progress.md:67 msgid "Expressions" msgstr "" #: ../../doc/src/progress.md:69 msgid "Arithmetic Operations" msgstr "" #: ../../doc/src/progress.md:71 msgid "Directory: `tests/expressions/arit`" msgstr "" #: ../../doc/src/progress.md msgid "`+,-,*,/,**`" msgstr "" #: ../../doc/src/progress.md msgid "[basic_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/arit/basic_operations.f90)" msgstr "" #: ../../doc/src/progress.md:78 msgid "Integers" msgstr "" #: ../../doc/src/progress.md:80 msgid "Directory: `tests/expressions/integers`" msgstr "" #: ../../doc/src/progress.md msgid "`integers`" msgstr "" #: ../../doc/src/progress.md msgid "[integer_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/integer_kind.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`relational operations`" 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 "" #: ../../doc/src/progress.md msgid "`logical operations`" 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 "" #: ../../doc/src/progress.md:89 msgid "Real Numbers" msgstr "" #: ../../doc/src/progress.md:91 msgid "Directory: `tests/expressions/reals`" msgstr "" #: ../../doc/src/progress.md msgid "`single/double reals`" msgstr "" #: ../../doc/src/progress.md msgid "[real_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/real_kind.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`defined operator`" msgstr "" #: ../../doc/src/progress.md msgid "âŒ" 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 "" #: ../../doc/src/progress.md:99 msgid "Complex Numbers" msgstr "" #: ../../doc/src/progress.md:101 msgid "Directory: `tests/expressions/complex`" msgstr "" #: ../../doc/src/progress.md msgid "`single/double complex`" msgstr "" #: ../../doc/src/progress.md msgid "[complex_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/complex/complex_kind.f90)" msgstr "" #: ../../doc/src/progress.md:108 msgid "Strings" msgstr "" #: ../../doc/src/progress.md:110 msgid "Directory: `tests/expressions/character`" msgstr "" #: ../../doc/src/progress.md msgid "`character`" msgstr "" #: ../../doc/src/progress.md msgid "[t01_character.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t01_character.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`string concatenation`" 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 "" #: ../../doc/src/progress.md:118 msgid "Derived Types" msgstr "" #: ../../doc/src/progress.md:120 msgid "Directory: `tests/expressions/derived_type`" msgstr "" #: ../../doc/src/progress.md msgid "`basic derived types`" 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 "" #: ../../doc/src/progress.md:127 msgid "Statements" msgstr "" #: ../../doc/src/progress.md:129 msgid "Allocate Statement" msgstr "" #: ../../doc/src/progress.md:131 msgid "Directory: `tests/statements/allocate`" msgstr "" #: ../../doc/src/progress.md msgid "`allocate statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/allocate/t01.f90)" msgstr "" #: ../../doc/src/progress.md:138 msgid "Block Statement" msgstr "" #: ../../doc/src/progress.md:140 msgid "Directory: `tests/statements/block`" msgstr "" #: ../../doc/src/progress.md msgid "`block statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/block/t01.f90)" msgstr "" #: ../../doc/src/progress.md:147 msgid "Goto Statement" msgstr "" #: ../../doc/src/progress.md:149 msgid "Directory: `tests/statements/goto`" msgstr "" #: ../../doc/src/progress.md msgid "`computed go-to statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`go-to statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t02.f90)" msgstr "" #: ../../doc/src/progress.md:157 msgid "If Statement" msgstr "" #: ../../doc/src/progress.md:159 msgid "Directory: `tests/statements/if`" msgstr "" #: ../../doc/src/progress.md msgid "`Test .false.`" msgstr "" #: ../../doc/src/progress.md msgid "[if_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`single line if statement`" msgstr "" #: ../../doc/src/progress.md msgid "[if_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_02.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`multi line if statement`" msgstr "" #: ../../doc/src/progress.md msgid "[if_03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_03.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`nested if statements`" msgstr "" #: ../../doc/src/progress.md msgid "[if_04.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_04.f90)" msgstr "" #: ../../doc/src/progress.md:169 msgid "While Statement" msgstr "" #: ../../doc/src/progress.md:171 msgid "Directory: `tests/statements/while`" msgstr "" #: ../../doc/src/progress.md msgid "`Simple while loops`" msgstr "" #: ../../doc/src/progress.md msgid "[while_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`exit / cycle in while loops`" msgstr "" #: ../../doc/src/progress.md msgid "[while_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_02.f90)" msgstr "" #: ../../doc/src/progress.md:179 msgid "Print Statement" msgstr "" #: ../../doc/src/progress.md:181 msgid "Directory: `tests/statements/print`" msgstr "" #: ../../doc/src/progress.md msgid "`Basic print`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/print/t01.f90)" msgstr "" #: ../../doc/src/progress.md:188 msgid "Open, Read, Write, Close Statement" msgstr "" #: ../../doc/src/progress.md:190 msgid "Directory: `tests/statements/file_io`" msgstr "" #: ../../doc/src/progress.md msgid "`open/read/write/close`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/file_io/t01.f90)" msgstr "" #: ../../doc/src/progress.md:197 msgid "Intrinsic Functions" msgstr "" #: ../../doc/src/progress.md:199 msgid "abs" msgstr "" #: ../../doc/src/progress.md:201 msgid "Directory: `tests/intrinsic/abs`" msgstr "" #: ../../doc/src/progress.md msgid "`scalar single/double real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md msgid "`scalar single/double complex`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md msgid "`array 1D single/double real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:210 msgid "exp" msgstr "" #: ../../doc/src/progress.md:212 msgid "Directory: `tests/intrinsic/exp`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:221 msgid "log" msgstr "" #: ../../doc/src/progress.md:223 msgid "Directory: `tests/intrinsic/log`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:232 msgid "sqrt" msgstr "" #: ../../doc/src/progress.md:234 msgid "Directory: `tests/intrinsic/sqrt`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:243 msgid "sin" msgstr "" #: ../../doc/src/progress.md:245 msgid "Directory: `tests/intrinsic/sin`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:254 msgid "cos" msgstr "" #: ../../doc/src/progress.md:256 msgid "Directory: `tests/intrinsic/cos`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:265 msgid "tan" msgstr "" #: ../../doc/src/progress.md:267 msgid "Directory: `tests/intrinsic/tan`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:276 msgid "sinh" msgstr "" #: ../../doc/src/progress.md:278 msgid "Directory: `tests/intrinsic/sinh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:287 msgid "cosh" msgstr "" #: ../../doc/src/progress.md:289 msgid "Directory: `tests/intrinsic/cosh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:298 msgid "tanh" msgstr "" #: ../../doc/src/progress.md:300 msgid "Directory: `tests/intrinsic/tanh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:309 msgid "asin" msgstr "" #: ../../doc/src/progress.md:311 msgid "Directory: `tests/intrinsic/asin`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:320 msgid "acos" msgstr "" #: ../../doc/src/progress.md:322 msgid "Directory: `tests/intrinsic/acos`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:331 msgid "atan" msgstr "" #: ../../doc/src/progress.md:333 msgid "Directory: `tests/intrinsic/atan`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:342 msgid "modulo" msgstr "" #: ../../doc/src/progress.md:344 msgid "Directory: `tests/intrinsic/modulo`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:352 msgid "mod" msgstr "" #: ../../doc/src/progress.md:354 msgid "Directory: `tests/intrinsic/mod`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:362 msgid "min" msgstr "" #: ../../doc/src/progress.md:364 msgid "Directory: `tests/intrinsic/min`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:371 msgid "max" msgstr "" #: ../../doc/src/progress.md:373 msgid "Directory: `tests/intrinsic/max`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:380 msgid "int" msgstr "" #: ../../doc/src/progress.md:382 msgid "Directory: `tests/intrinsic/int`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:389 msgid "real" msgstr "" #: ../../doc/src/progress.md:391 msgid "Directory: `tests/intrinsic/real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:398 msgid "floor" msgstr "" #: ../../doc/src/progress.md:400 msgid "Directory: `tests/intrinsic/floor`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:407 msgid "nint" msgstr "" #: ../../doc/src/progress.md:409 msgid "Directory: `tests/intrinsic/nint`" 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 "" lfortran-0.63.0/doc/locale/pl/0000775000175000017500000000000015174404631016237 5ustar alastairalastairlfortran-0.63.0/doc/locale/pl/LC_MESSAGES/0000775000175000017500000000000015174404631020024 5ustar alastairalastairlfortran-0.63.0/doc/locale/pl/LC_MESSAGES/docs.po0000664000175000017500000042460515174404631021327 0ustar alastairalastair# SOME DESCRIPTIVE TITLE. # Copyright (C) 2022 LFortran contributors # This file is distributed under the same license as the LFortran package. # FIRST AUTHOR , 2022. # msgid "" msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" "PO-Revision-Date: 2023-09-20 14:01+0000\n" "Last-Translator: Dominik GÄ™gotek \n" "Language-Team: Polish \n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2;\n" "X-Generator: Weblate 5.1-dev\n" "Generated-By: Babel 2.10.3\n" #: ../../doc/src/ast_and_asr.ipynb:9 msgid "Difference between an AST and ASR" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:11 msgid "Let us take a simple Fortran code:" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:22 msgid "and look at how the AST and ASR looks like." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:25 ../../doc/src/progress.md msgid "AST" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:76 msgid "" "The AST does not have any semantic information, but has nodes to " "represent declarations such as ``integer, intent(in) :: a``. Variables " "such as ``a`` are represented by a ``Name`` node, and are not connected " "to their declarations yet." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:88 ../../doc/src/progress.md msgid "ASR" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:139 msgid "" "The ASR has all the semantic information (types, etc.), nodes like " "``Function`` have a symbol table and do not have any declaration nodes. " "Variables are simply pointers to the symbol table." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:142 msgid "Discussion" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:144 msgid "" "The above was a simple example. Things get more apparent for more " "complicated examples, such as:" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:160 msgid "" "AST must represent all the ``use`` statements and the ``interface`` " "block, and keep things semantically consistent." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:162 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" " are defined in the ``gfort_interop`` module, and so ASR does not have " "any of these declaration nodes." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:164 msgid "" "When converting from ASR to AST, LFortran will create all the appropriate" " AST declaration nodes automatically and correctly." msgstr "" #: ../../doc/src/contributing.md:1 msgid "Contributing" msgstr "" #: ../../doc/src/contributing.md:3 msgid "" "We welcome contributions from anyone, even if you are new to open source." " It might sound daunting to contribute to a compiler at first, but please" " do, it is not complicated. We will help you with any technical issues " "and help improve your contribution so that it can be merged." msgstr "" #: ../../doc/src/contributing.md:8 msgid "Basic Setup" msgstr "" #: ../../doc/src/contributing.md:10 msgid "To contribute, make sure your set up:" msgstr "" #: ../../doc/src/contributing.md:12 msgid "Your username + email" msgstr "" #: ../../doc/src/contributing.md:13 msgid "Your `~/.gitconfig`" msgstr "" #: ../../doc/src/contributing.md:14 msgid "Your shell prompt to display the current branch name" msgstr "" #: ../../doc/src/contributing.md:16 msgid "Fork LFortran" msgstr "" #: ../../doc/src/contributing.md:18 msgid "" "Step 1. Create a fork of the [project " "repository](https://github.com/lfortran/lfortran)" msgstr "" #: ../../doc/src/contributing.md:20 msgid "" "Step 2. Set up your [SSH key](https://docs.github.com/en/authentication" "/connecting-to-github-with-ssh) with GitHub" msgstr "" #: ../../doc/src/contributing.md:22 msgid "" "Step 3. Clone the project repository from GitHub and set up your remote " "repository" msgstr "" #: ../../doc/src/contributing.md:29 msgid "" ":fontawesome-solid-edit: `REMOTE_NAME` is the name of your remote " "repository and could be any name you like, for example your first name." msgstr "" #: ../../doc/src/contributing.md:31 msgid "" ":fontawesome-solid-edit: `YOUR_GITHUB_ID` is your user ID on GitHub and " "should be part of your account path." msgstr "" #: ../../doc/src/contributing.md:33 msgid "" "You can use `git remote -v` to check if the new remote is set up " "correctly." msgstr "" #: ../../doc/src/contributing.md:35 msgid "Send a New Merge Request" msgstr "" #: ../../doc/src/contributing.md:37 msgid "Step 1. Create a new branch" msgstr "" #: ../../doc/src/contributing.md:42 msgid "Step 2. Make changes in relevant file(s)" msgstr "" #: ../../doc/src/contributing.md:44 msgid "Step 3. Commit the changes:" msgstr "" #: ../../doc/src/contributing.md:51 msgid "" "[Here](https://chris.beams.io/posts/git-commit/) are some great tips on " "writing good commit messages." msgstr "" #: ../../doc/src/contributing.md:53 msgid "Step 4. Check to ensure that your changes look good" msgstr "" #: ../../doc/src/contributing.md:58 msgid "Step 5. Send the merge request" msgstr "" #: ../../doc/src/contributing.md:64 msgid "" "The command will push the new branch `fix1` into your remote repository " "`REMOTE_NAME` that you created earlier. Additionally, it will also " "display a link that you can click on to open the new merge request. After" " clicking on the link, write a title and a concise description then click" " the \"Create\" button. Yay you are now all set." msgstr "" #: ../../doc/src/contributing.md:66 msgid "Add New Features" msgstr "" #: ../../doc/src/contributing.md:68 msgid "" "The example below shows the steps it would take to create a caret binary " "operator **^** which computes the average value of the two operands." msgstr "" #: ../../doc/src/contributing.md:70 msgid "Create New Token(s)" msgstr "" #: ../../doc/src/contributing.md:72 msgid "" "We extend the *tokenizer.re* as well as *parser.yy* to add the new token " "**^**. We also tell LFortran how to print the new token in *parser.cpp*." msgstr "" #: ../../doc/src/contributing.md:75 msgid ":fontawesome-solid-code: *src/lfortran/parser/tokenizer.re*" msgstr "" #: ../../doc/src/contributing.md:80 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.yy*" msgstr "" #: ../../doc/src/contributing.md:85 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.cpp*" msgstr "" #: ../../doc/src/contributing.md:94 msgid "The added code is tested with `lfortran --show-tokens examples2/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:96 msgid "Parse the New Token" msgstr "" #: ../../doc/src/contributing.md:98 msgid "" "Now we have to parse the new operator. We add it to the AST by extending " "the BinOp with a caret operator and modifying the *AST.asdl* file. Then " "we add it in *parse.yy* to properly parse and generate the new AST in " "*semantics.h*.Finally we extend *pickle.cpp* so that the new operator can" " print itself." msgstr "" #: ../../doc/src/contributing.md:102 msgid ":fontawesome-solid-code:*grammar/AST.asdl*" msgstr "" #: ../../doc/src/contributing.md:107 msgid ":fontawesome-solid-code:*src/lfortran/parser/parser.yy*" msgstr "" #: ../../doc/src/contributing.md:116 msgid ":fontawesome-solid-code:*src/lfortran/parser/semantics.h*" msgstr "" #: ../../doc/src/contributing.md:121 msgid ":fontawesome-solid-code:*src/lfortran/pickle.cpp*" msgstr "" #: ../../doc/src/contributing.md:132 msgid "The section is tested with `lfortran --show-ast examples/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:134 msgid "Implement the Semantics of the New Token" msgstr "" #: ../../doc/src/contributing.md:136 msgid "" "We first extend the ASR in *ASR.asdl* and add ^ as a BinOp operator " "option." msgstr "" #: ../../doc/src/contributing.md:138 msgid ":fontawesome-solid-code:*src/libasr/ASR.asdl*" msgstr "" #: ../../doc/src/contributing.md:142 msgid ":fontawesome-solid-code:*src/lfortran/semantics/ast_common_visitor.h*" msgstr "" #: ../../doc/src/contributing.md:179 msgid "" "Then we transform it from AST to ASR by extending " "*src/lfortran/semantics/ast_common_visitor.h*." msgstr "" #: ../../doc/src/contributing.md:181 msgid "" "We also add it into compile time evaluation triggered by expressions such" " as `e = (2+3)^5` which is evaluated at compile time. An expression such " "as `e = x^5` is evaluated at run time only." msgstr "" #: ../../doc/src/contributing.md:183 msgid "The section is tested with `lfortran --show-asr examples/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:184 msgid "Implement the New Token in LLVM" msgstr "" #: ../../doc/src/contributing.md:186 msgid "" "To implement in LLVM, we extend the BinOp translation by handling the new" " operator. We first add the two numbers then divide by two. :fontawesome-" "solid-code:*src/lfortran/codegen/asr_to_llvm.cpp*" msgstr "" #: ../../doc/src/contributing.md:217 msgid "The section is tested with `lfortran --show-llvm examples/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:219 msgid "Now when LLVM works, we can test the final executable by:" msgstr "" #: ../../doc/src/contributing.md:224 msgid "And it should print 6." msgstr "" #: ../../doc/src/contributing.md:226 msgid "It also works interactively:" msgstr "" #: ../../doc/src/contributing.md:242 msgid "Reach Out" msgstr "" #: ../../doc/src/contributing.md:244 msgid "" "If you have any questions or need help, please ask as at our " "[mailinglist](https://groups.io/g/lfortran) or a " "[chat](https://lfortran.zulipchat.com/)." msgstr "" #: ../../doc/src/contributing.md:248 msgid "" "Please note that all participants of this project are expected to follow " "our Code of Conduct. By participating in this project you agree to abide " "by its terms. See " "[CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/blob/main/CODE_OF_CONDUCT.md)." msgstr "" #: ../../doc/src/contributing.md:252 msgid "" "By submitting a PR you agree to license your contribution under the " "LFortran's BSD " "[license](https://github.com/lfortran/lfortran/blob/main/LICENSE) unless " "explicitly noted otherwise." msgstr "" #: ../../doc/src/design.md:1 msgid "LFortran Design" msgstr "" #: ../../doc/src/design.md:3 msgid "High Level Overview" msgstr "" #: ../../doc/src/design.md:5 ../../doc/src/developer_tutorial.ipynb:16 msgid "" "LFortran is structured around two independent modules, AST and ASR, both " "of which are standalone (completely independent of the rest of LFortran) " "and users are encouraged to use them independently for other applications" " and build tools on top:" msgstr "" #: ../../doc/src/design.md:10 msgid "" "Abstract Syntax Tree (AST), module `lfortran.ast`: Represents any Fortran" " source code, strictly based on syntax, no semantic is included. The AST " "module can convert itself to Fortran source code." msgstr "" #: ../../doc/src/design.md:14 msgid "" "Abstract Semantic Representation (ASR), module `lfortran.asr`: Represents" " a valid Fortran source code, all semantic is included. Invalid Fortran " "code is not allowed (an error will be given). The ASR module can convert " "itself to an AST." msgstr "" #: ../../doc/src/design.md:19 msgid "" "The LFortran compiler is then composed of the following independent " "stages:" msgstr "" #: ../../doc/src/design.md:21 msgid "Parsing: converts Fortran source code to an AST" msgstr "" #: ../../doc/src/design.md:22 msgid "Semantic: converts an AST to an ASR" msgstr "" #: ../../doc/src/design.md:23 msgid "" "High level optimizations: optimize ASR to a possibly faster/simpler ASR " "(things like inlining functions, eliminating redundant expressions or " "statements, etc.)" msgstr "" #: ../../doc/src/design.md:26 msgid "" "LLVM IR code generation and lower level optimizations: converts an ASR to" " an LLVM IR. This stage also does all other optimizations that do not " "produce an ASR, but still make sense to do before passing to LLVM IR." msgstr "" #: ../../doc/src/design.md:29 msgid "" "Machine code generation: LLVM then does all its optimizations and " "generates machine code (such as a binary executable, a library, an object" " file, or it is loaded and executed using JIT as part of the interactive " "LFortran session or in a Jupyter kernel)." msgstr "" #: ../../doc/src/design.md:34 msgid "" "LFortran is structured as a library, and so one can for example use the " "parser to obtain an AST and do something with it, or one can then use the" " semantic analyzer to obtain ASR and do something with it. One can " "generate the ASR directly (e.g., from SymPy) and then either convert to " "AST and to a Fortran source code, or use LFortran to compile it to " "machine code directly. In other words, one can use LFortran to easily " "convert between the three equivalent representations:" msgstr "" #: ../../doc/src/design.md:42 msgid "Fortran source code" msgstr "" #: ../../doc/src/design.md:43 ../../doc/src/developer_tutorial.ipynb:23 msgid "Abstract Syntax Tree (AST)" msgstr "" #: ../../doc/src/design.md:44 ../../doc/src/developer_tutorial.ipynb:159 msgid "Abstract Semantic Representation (ASR)" msgstr "" #: ../../doc/src/design.md:46 msgid "They are all equivalent in the following sense:" msgstr "" #: ../../doc/src/design.md:48 msgid "Any ASR can always be converted to an equivalent AST" msgstr "" #: ../../doc/src/design.md:49 msgid "Any AST can always be converted to an equivalent Fortran source code" msgstr "" #: ../../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 "" #: ../../doc/src/design.md:52 msgid "" "Any AST can always be either converted to an equivalent ASR or one gets a" " semantic error" msgstr "" #: ../../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 "" #: ../../doc/src/design.md:58 msgid "ASR Design Details" msgstr "" #: ../../doc/src/design.md:60 msgid "The ASR is designed to have the following features:" msgstr "" #: ../../doc/src/design.md:62 msgid "" "ASR is still semantically equivalent to the original Fortran code (it did" " not lose any semantic information). ASR can be converted to AST, and AST" " to Fortran source code which is functionally equivalent to the original." msgstr "" #: ../../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 "" #: ../../doc/src/design.md:69 msgid "" "The ASR C++ classes (down the road) are designed similarly to SymEngine: " "they are constructed once and after that they are immutable. The " "constructor checks in Debug more that all the requirements are met (e.g.," " that all Variables in a Function have a dummy argument set, that " "explicit-shape arrays are not allocatable and all other Fortran " "requirements to make it a valid code), but in Release mode it quickly " "constructs the class without checks. Then there are builder classes that " "construct the ASR C++ classes to meet requirements (checked in Debug " "mode) and the builder gives an error message if a code is not a valid " "Fortran code, and if it doesn't give an error message, then the ASR C++ " "classes are constructed correctly. Thus by construction, the ASR classes " "always contain valid Fortran code and the rest of LFortran can depend on " "it." msgstr "" #: ../../doc/src/design.md:82 msgid "Notes:" msgstr "" #: ../../doc/src/design.md:84 msgid "" "Information that is lost when parsing source to AST: whitespace, " "multiline/single line if statement distinction, case sensitivity of " "keywords." msgstr "" #: ../../doc/src/design.md:87 msgid "" "Information that is lost when going from AST to ASR: detailed syntax how " "variables were defined and the order of type attributes (whether array " "dimension is using the `dimension` attribute, or parentheses at the " "variable; or how many variables there are per declaration line or their " "order), as ASR only represents the aggregated type information in the " "symbol table." msgstr "" #: ../../doc/src/design.md:90 msgid "" "ASR is the simplest way to generate Fortran code, as one does not have to" " worry about the detailed syntax (as in AST) about how and where things " "are declared. One specifies the symbol table for a module, then for each " "symbol (functions, global variables, types, ...) one specifies the local " "variables and if this is an interface then one needs to specify where one" " can find an implementation, otherwise a body is supplied with " "statements, those nodes are almost the same as in AST, except that each " "variable is just a reference to a symbol in the symbol table (so by " "construction one cannot have undefined variables). The symbol table for " "each node such as Function or Module also references its parent (for " "example a function references a module, a module references the global " "scope)." msgstr "" #: ../../doc/src/design.md:102 msgid "" "The ASR can be directly converted to an AST without gathering any other " "information. And the AST directly to Fortran source code." msgstr "" #: ../../doc/src/design.md:105 msgid "" "The ASR is always representing a semantically valid Fortran code. This " "is enforced by checks in the ASR C++ constructors (in Debug build). When " "an ASR is used, one can assume it is valid." msgstr "" #: ../../doc/src/design.md:109 msgid "Fortran 2008" msgstr "" #: ../../doc/src/design.md:111 msgid "" "Fortran 2008 [standard](https://j3-fortran.org/doc/year/10/10-007.pdf) " "chapter 2 \"Fortran concepts\" specifies that Fortran code is a " "collection of _program units_ (either all in one file, or in separate " "files), where each _program unit_ is one of:" msgstr "" #: ../../doc/src/design.md:116 ../../doc/src/design.md:131 msgid "main program" msgstr "" #: ../../doc/src/design.md:117 ../../doc/src/design.md:132 msgid "module or submodule" msgstr "" #: ../../doc/src/design.md:118 ../../doc/src/design.md:133 msgid "function or subroutine" msgstr "" #: ../../doc/src/design.md:120 msgid "" "Note: It can also be a _block data_ program unit, that is used to provide" " initial values for data objects in named _common blocks_, but we do not " "recommend the use of _common blocks_ (use modules instead)." msgstr "" #: ../../doc/src/design.md:124 msgid "LFortran Extension" msgstr "" #: ../../doc/src/design.md:126 msgid "" "We extend the Fortran language by introducing a _global scope_, which is " "not only the list of _program units_ (as in F2008) but can also include " "statements, declarations, use statements and expressions. We define " "_global scope_ as a collection of the following items:" msgstr "" #: ../../doc/src/design.md:134 msgid "use statement" msgstr "" #: ../../doc/src/design.md:135 msgid "declaration" msgstr "" #: ../../doc/src/design.md:136 msgid "statement" msgstr "" #: ../../doc/src/design.md:137 msgid "expression" msgstr "" #: ../../doc/src/design.md:139 msgid "" "In addition, if a variable is not defined in an assignment statement " "(such as `x = 5+3`) then the type of the variable is inferred from the " "right hand side (e.g., `x` in `x = 5+3` would be of type `integer`, and " "`y` in `y = 5._dp` would be of type `real(dp)`). This rule only applies " "at the top level of _global scope_. Types must be fully specified inside " "main programs, modules, functions and subroutines, just like in F2008." msgstr "" #: ../../doc/src/design.md:146 msgid "" "The _global scope_ has its own symbol table. The main program and " "module/submodule do not see any symbols from this symbol table. But " "functions, subroutines, statements and expressions at the top level of " "_global scope_ use and operate on this symbol table." msgstr "" #: ../../doc/src/design.md:151 msgid "" "The _global scope_ has the following symbols predefined in the symbol " "table:" msgstr "" #: ../../doc/src/design.md:153 msgid "" "the usual standard set of Fortran functions (such as `size`, `sin`, " "`cos`, ...)" msgstr "" #: ../../doc/src/design.md:155 msgid "" "the `dp` double precision symbol, so that one can use `5._dp` for double " "precision." msgstr "" #: ../../doc/src/design.md:158 msgid "" "Each item in the _global scope_ is interpreted as follows: main program " "is compiled into an executable with the same name and executed; modules, " "functions and subroutines are compiled and loaded; use statement and " "declaration adds those symbols with the proper type into the _global " "scope_ symbol table, but do not generate any code; statement is wrapped " "into an anonymous subroutine with no arguments, compiled, loaded and " "executed; expression is wrapped into an anonymous function with no " "arguments returning the expression, compiled, loaded, executed and the " "return value is returned to the user." msgstr "" #: ../../doc/src/design.md:168 msgid "" "The _global scope_ is always interpreted, item by item, per the previous " "paragraph. It is meant to allow interactive usage, experimentations and " "writing simple scripts. Code in _global scope_ must be interpreted using " "`lfortran`. For more complex (production) code it is recommended to turn " "it into modules and programs (by wrapping loose statements into " "subroutines or functions and by adding type declarations) and compile it " "with `lfortran` or any other Fortran compiler." msgstr "" #: ../../doc/src/design.md:176 msgid "Here are some examples of valid code in _global scope_:" msgstr "" #: ../../doc/src/design.md:178 msgid "Example 1" msgstr "" #: ../../doc/src/design.md:185 msgid "Example 2" msgstr "" #: ../../doc/src/design.md:197 msgid "Example 3" msgstr "" #: ../../doc/src/design.md:209 msgid "Example 4" msgstr "" #: ../../doc/src/design.md:217 msgid "Design Considerations" msgstr "" #: ../../doc/src/design.md:219 msgid "" "The LFortran extension of Fortran was chosen in a way so as to minimize " "the number of changes. In particular, only the top level of the _global " "scope_ has relaxed some of the Fortran rules (such as making specifying " "types optional) so as to allow simple and quick interactive usage, but " "inside functions, subroutines, modules or programs this relaxation does " "not apply." msgstr "" #: ../../doc/src/design.md:225 msgid "" "The number of changes were kept to minimum in order to make it " "straightforward to turn code at _global scope_ into standard compliant " "Fortran code using programs and modules, so that it can be compiled by " "any Fortran compiler." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:9 msgid "Developer Tutorial" msgstr "" #: ../../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 "" #: ../../doc/src/developer_tutorial.ipynb:14 msgid "Introduction" msgstr "WstÄ™p" #: ../../doc/src/developer_tutorial.ipynb:18 msgid "" "Abstract Syntax Tree (AST): Represents any Fortran source code, strictly " "based on syntax, no semantic is included. The AST module can convert " "itself to Fortran source code." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:20 msgid "" "Abstract Semantic Representation (ASR): Represents a valid Fortran source" " code, all semantic is included. Invalid Fortran code is not allowed (an " "error will be given). The ASR module can convert itself to an AST." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:25 msgid "" "Fortran source code can be parsed into an AST using the ``src_to_ast()`` " "function:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:49 #, python-format msgid "We can pretty print it using the ``%%showast`` magic:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:98 #, python-format msgid "We can convert AST to Fortran source code using ``%%showfmt``:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:156 msgid "" "All AST nodes and their arguments are described in `AST.asdl " "`__." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:170 #, python-format msgid "We can pretty print using the ``%%showasr`` magic:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:219 msgid "" "All ASR nodes and their arguments are described in `ASR.asdl " "`__." msgstr "" #: ../../doc/src/index.md:134 msgid "Getting started" msgstr "" #: ../../doc/src/index.md:141 ../../doc/src/progress.md:1 msgid "LFortran Development Status" msgstr "" #: ../../doc/src/index.md:147 msgid "Developer's Guide" msgstr "" #: ../../doc/src/index.md:156 msgid "LFortran Intrinsics" msgstr "" #: ../../doc/src/index.md:1 msgid "LFortran Documentation" msgstr "" #: ../../doc/src/index.md:3 msgid "" "LFortran is a modern open-source (BSD licensed) interactive Fortran " "compiler built on top of LLVM. It can execute user's code interactively " "to allow exploratory work (much like Python, MATLAB or Julia) as well as " "compile to binaries with the goal to run user's code on modern " "architectures such as multi-core CPUs and GPUs." msgstr "" #: ../../doc/src/index.md:9 #, python-format msgid "" "Website: [https://lfortran.org/](https://lfortran.org/) Main " "repository: " "[https://github.com/lfortran/lfortran](https://github.com/lfortran/lfortran)" " Try online using Binder: " "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb)" msgstr "" #: ../../doc/src/index.md:9 msgid "Binder" msgstr "" #: ../../doc/src/index.md:16 msgid "Feature Highlights" msgstr "" #: ../../doc/src/index.md:18 msgid "" "LFortran is in development, there are features that work today, and there" " are features that are being implemented. You can also check out the " "[Development Status](progress.md) section for more information on " "features being supported and being worked on." msgstr "" #: ../../doc/src/index.md:21 msgid "Works today" msgstr "" #: ../../doc/src/index.md:23 #, python-format msgid "" "**Interactive, Jupyter support** LFortran can be used from Jupyter as a" " Fortran kernel, allowing a Python/Julia style rapid prototyping and " "exploratory workflow (see the " "[static](https://nbviewer.jupyter.org/gist/certik/f1d28a486510810d824869ab0c491b1c)" " or [interactive](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb) example notebook). Or " "it can be used from the command-line in an interactive prompt (REPL)." msgstr "" #: ../../doc/src/index.md:32 msgid "" "**Clean, modular design, usable as a library** LFortran is structured " "around two independent modules, AST and ASR, both of which are " "standalone (completely independent of the rest of LFortran) and users " "are encouraged to use them independently for other applications and " "build tools on top. See the [Design](design.md) and [Developer " "Tutorial](developer_tutorial.md) documents for more details." msgstr "" #: ../../doc/src/index.md:39 msgid "" "**Interoperation with GFortran** LFortran can parse GFortran module " "files into an ASR and generate a Fortran wrapper that can be compiled " "with any Fortran compiler and linked with the original GFortran " "compiled module." msgstr "" #: ../../doc/src/index.md:44 msgid "" "**Create executables** It can create executables just like other " "Fortran compilers." msgstr "" #: ../../doc/src/index.md:47 msgid "" "**Runs on Linux, Mac and Windows** All three platforms are regularly " "tested by our CI." msgstr "" #: ../../doc/src/index.md:51 msgid "Planned" msgstr "" #: ../../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 "" #: ../../doc/src/index.md:56 msgid "" "**Native interoperation with other languages (and other Fortran " "compilers)** It can automatically call code written in other languages " "(such as C or Python) just by using the `use` statement, see " "[#44](https://gitlab.com/lfortran/lfortran/issues/44). It understands " "other Fortran compilers module files (one can just \"use\" them) and " "their ABI to link correctly (GFortran is supported, other compilers are" " planned, see [#56](https://gitlab.com/lfortran/lfortran/issues/56)), " "which allows to use LFortran with production codes today." msgstr "" #: ../../doc/src/index.md:65 msgid "" "**Modern hardware support** Thanks to LLVM, the goal of LFortran is to " "run on modern hardware and take advantage of native Fortran language " "constructs (such as `do concurrent`) to run on multi-core CPUs and " "GPUs, see [#57](https://gitlab.com/lfortran/lfortran/issues/57)." msgstr "" #: ../../doc/src/index.md:71 msgid "" "**Full Fortran 2018 support** Currently only a subset of Fortran is " "implemented, but the goal is to have a full implementation of the " "latest Fortran 2018 standard, see " "[#58](https://gitlab.com/lfortran/lfortran/issues/58)." msgstr "" #: ../../doc/src/index.md:77 msgid "" "Please vote on issues in our [issue " "tracker](https://gitlab.com/lfortran/lfortran/issues) that you want us to" " prioritize (feel free to create new ones if we are missing anything)." msgstr "" #: ../../doc/src/index.md:81 msgid "Roadmap" msgstr "" #: ../../doc/src/index.md:83 msgid "Here is our roadmap how to get all the planned features above implemented:" msgstr "" #: ../../doc/src/index.md:85 msgid "" "Port code generation to use ASR and pass all the current tests " "([#74](https://gitlab.com/lfortran/lfortran/issues/74)). Remove the old " "code generation and old semantics, that used to annotate the AST tree, " "which was messy." msgstr "" #: ../../doc/src/index.md:89 msgid "" "Get GFortran module files working with `use` module, both assumed-size " "and assumed-shape arrays " "([#52](https://gitlab.com/lfortran/lfortran/issues/52)). This will allow " "right away to use production codes with LFortran." msgstr "" #: ../../doc/src/index.md:93 msgid "Do these at the same time:" msgstr "" #: ../../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 "" #: ../../doc/src/index.md:98 msgid "" "b) Gradually move to C++ for robustness and speed " "([#70](https://gitlab.com/lfortran/lfortran/issues/70)). The Python API " "will not change (or only minimally), so the user experience from Python " "will not change." msgstr "" #: ../../doc/src/index.md:103 msgid "" "c) Implement all the other cool features: `use` module for C and Python " "and automatic wrappers " "([#44](https://gitlab.com/lfortran/lfortran/issues/44)), modern hardware" " support ([#57](https://gitlab.com/lfortran/lfortran/issues/57)), " "generating an older standard of Fortran " "([#72](https://gitlab.com/lfortran/lfortran/issues/72)), Fortran doctest" " feature ([#73](https://gitlab.com/lfortran/lfortran/issues/73)), SymPy" " integration ([#71](https://gitlab.com/lfortran/lfortran/issues/71)), " "language service for IDEs " "([#12](https://gitlab.com/lfortran/lfortran/issues/12)), and other ideas" " ([#29](https://gitlab.com/lfortran/lfortran/issues/29))." msgstr "" #: ../../doc/src/index.md:118 msgid "The step 1. is an internal refactoring that will not take long." msgstr "" #: ../../doc/src/index.md:120 msgid "" "The step 2. will allow LFortran to be used interactively with production " "codes right away (the production code will get compiled with GFortran, " "then one \"uses\" any module in LFortran and functions/subroutines can be" " interactively called, the module itself can use any GFortran supported " "feature, but the API must fit into the subset that LFortran understands " "--- for large number of applications simple functions/subroutines with " "array arguments are enough). This will make LFortran usable for first " "users and one can always use GFortran temporarily until LFortran supports" " the given feature. We expect to be finished with the step 2. by the end " "of summer 2019, hopefully sooner." msgstr "" #: ../../doc/src/index.md:130 msgid "" "Finally the step 3. will improve LFortran overall, allowing the first " "users to contribute back, growing the community and making LFortran " "gradually useful for more and more people." msgstr "" #: ../../doc/src/installation.md:1 msgid "Installation" msgstr "" #: ../../doc/src/installation.md:3 msgid "All the instructions below work on Linux, macOS and Windows." msgstr "" #: ../../doc/src/installation.md:5 msgid "Binaries" msgstr "" #: ../../doc/src/installation.md:7 msgid "" "The recommended way to install LFortran is using Conda. Install Conda for" " example by installing the " "[Miniconda](https://conda.io/en/latest/miniconda.html) installation by " "following instructions there for your platform. Then create a new " "environment (you can choose any name, here we chose `lf`) and activate " "it:" msgstr "" #: ../../doc/src/installation.md:16 msgid "Then install LFortran by:" msgstr "" #: ../../doc/src/installation.md:20 msgid "" "Now the `lf` environment has the `lfortran` compiler available, you can " "start the interactive prompt by executing `lfortran`, or see the command " "line options using `lfortran -h`." msgstr "" #: ../../doc/src/installation.md:24 msgid "" "The Jupyter kernel is automatically installed by the above command, so " "after installing Jupyter itself:" msgstr "" #: ../../doc/src/installation.md:28 msgid "You can create a Fortran based Jupyter notebook by executing:" msgstr "" #: ../../doc/src/installation.md:32 msgid "and selecting `New->Fortran`." msgstr "" #: ../../doc/src/installation.md:35 msgid "Build From a Source Tarball" msgstr "" #: ../../doc/src/installation.md:37 msgid "" "This method is the recommended method if you just want to install " "LFortran, either yourself or in a package manager (Spack, Conda, Debian, " "etc.). The source tarball has all the generated files included and has " "minimal dependencies." msgstr "" #: ../../doc/src/installation.md:39 msgid "First we have to install dependencies, for example using Conda:" msgstr "" #: ../../doc/src/installation.md:44 msgid "" "Then download a tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), e.g.:" msgstr "" #: ../../doc/src/installation.md:52 msgid "And build:" msgstr "" #: ../../doc/src/installation.md:58 msgid "This will install the `lfortran` into the `inst/bin`." msgstr "" #: ../../doc/src/installation.md:60 msgid "Build From Git" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/installation.md:72 msgid "Then prepare the environment:" msgstr "" #: ../../doc/src/installation.md:77 msgid "Clone the LFortran git repository:" msgstr "" #: ../../doc/src/installation.md:82 msgid "" "Generate files that are needed for the build (this step depends on " "`re2c`, `bison` and `python`):" msgstr "" #: ../../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 "" #: ../../doc/src/installation.md:92 msgid "Run tests:" msgstr "" #: ../../doc/src/installation.md:97 msgid "Run an interactive prompt:" msgstr "" #: ../../doc/src/installation.md:102 msgid "Build from Git on Windows with Visual Studio" msgstr "" #: ../../doc/src/installation.md:104 msgid "" "Install Visual Studio (MSVC), for example the version 2022, you can " "download the Community version for free from: " "https://visualstudio.microsoft.com/downloads/." msgstr "" #: ../../doc/src/installation.md:107 msgid "" "Install miniforge using the Windows installer from https://github.com" "/conda-forge/miniforge." msgstr "" #: ../../doc/src/installation.md:109 msgid "Launch the Miniforge Prompt from the Desktop." msgstr "" #: ../../doc/src/installation.md:111 msgid "In the shell, initialize the MSVC compiler using:" msgstr "" #: ../../doc/src/installation.md:117 msgid "You can optionally test that MSVC works by:" msgstr "" #: ../../doc/src/installation.md:122 msgid "Both commands must print help (several pages)." msgstr "" #: ../../doc/src/installation.md:124 msgid "Now you can download and build LFortran:" msgstr "" #: ../../doc/src/installation.md:134 msgid "If everything compiled, then you can use LFortran as follows:" msgstr "" #: ../../doc/src/installation.md:140 msgid "And so on." msgstr "" #: ../../doc/src/installation.md:142 msgid "" "Note: LFortran currently uses the MSVC's linker program (`link`), which " "is only available when the MSVC bat script above is ran. If you forget to" " activate it, LFortran's linking will fail." msgstr "" #: ../../doc/src/installation.md:146 msgid "" "Note: the miniforge shell seems to be running some version of `git-bash` " "(although it is `cmd.exe`), which has some unix-like filesystem mounted " "in `/usr` and several commands available such as `ls`, `which`, `git`, " "`vim`. For this reason the Conda build `environment_win.yml` contains " "everything needed, including `git`." msgstr "" #: ../../doc/src/installation.md:152 msgid "Build from Git on Windows with WSL" msgstr "" #: ../../doc/src/installation.md:153 msgid "In windows search \"turn windows features on or off\"." msgstr "" #: ../../doc/src/installation.md:154 msgid "Tick Windows subsystem for Linux." msgstr "" #: ../../doc/src/installation.md:155 msgid "Press OK and restart computer." msgstr "" #: ../../doc/src/installation.md:156 msgid "Go to Microsoft store and download Ubuntu 20.04, and launch it." msgstr "" #: ../../doc/src/installation.md:157 msgid "Run the following commands." msgstr "" #: ../../doc/src/installation.md:164 msgid "Now do the following to configure the path" msgstr "" #: ../../doc/src/installation.md:168 msgid "Then go to the bottom of the file and paste the following" msgstr "" #: ../../doc/src/installation.md:172 msgid "Then press ctrl + O (save), Enter (confirm), ctrl + X (exit)" msgstr "" #: ../../doc/src/installation.md:173 msgid "After that restart Ubuntu" msgstr "" #: ../../doc/src/installation.md:174 msgid "Run the following" msgstr "" #: ../../doc/src/installation.md:179 msgid "Restart Ubuntu again" msgstr "" #: ../../doc/src/installation.md:187 msgid "" "You can change the directory to a Windows location using `cd /mnt/[drive " "letter]/[windows location]`." msgstr "" #: ../../doc/src/installation.md:188 msgid "e.g. `cd mnt/c/Users/name/source/repos/`" msgstr "" #: ../../doc/src/installation.md:190 msgid "Now clone the LFortran git repository" msgstr "" #: ../../doc/src/installation.md:196 msgid "Run the following commands" msgstr "" #: ../../doc/src/installation.md:204 msgid "If everything compiles, you can use LFortran as follows" msgstr "" #: ../../doc/src/installation.md:210 msgid "Run an interactive prompt" msgstr "" #: ../../doc/src/installation.md:215 msgid "Run tests" msgstr "" #: ../../doc/src/installation.md:221 msgid "Enabling the Jupyter Kernel" msgstr "" #: ../../doc/src/installation.md:223 msgid "To install the Jupyter kernel, install the following Conda packages also:" msgstr "" #: ../../doc/src/installation.md:227 msgid "" "and enable the kernel by `-DWITH_XEUS=yes` and install into " "`$CONDA_PREFIX`. For example:" msgstr "" #: ../../doc/src/installation.md:239 msgid "" "To use it, install Jupyter (`conda install jupyter`) and test that the " "LFortran kernel was found:" msgstr "" #: ../../doc/src/installation.md:244 msgid "Then launch a Jupyter notebook as follows:" msgstr "" #: ../../doc/src/installation.md:248 msgid "Click `New->Fortran`. To launch a terminal jupyter LFortran console:" msgstr "" #: ../../doc/src/installation.md:254 msgid "Build From Git with Nix" msgstr "" #: ../../doc/src/installation.md:256 msgid "" "One of the ways to ensure exact environment and dependencies is with " "`nix`. This will ensure that system dependencies do not interfere with " "the development environment. If you want, you can report bugs in a `nix-" "shell` environment to make it easier for others to reproduce." msgstr "" #: ../../doc/src/installation.md:258 msgid "With Root" msgstr "" #: ../../doc/src/installation.md:260 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 "" #: ../../doc/src/installation.md:264 msgid "Without Root" msgstr "" #: ../../doc/src/installation.md:266 msgid "" "If you would like to not provide `nix` with root access to your machine, " "on Linux distributions we can use [nix-" "portable](https://github.com/DavHau/nix-portable)." msgstr "" #: ../../doc/src/installation.md:270 msgid "" "Now just prepend all `nix-shell` commands with `NP_RUNTIME=bwrap ./nix-" "portable `. So:" msgstr "" #: ../../doc/src/installation.md:278 msgid "Development" msgstr "" #: ../../doc/src/installation.md:280 msgid "Now we can enter the development environment:" msgstr "" #: ../../doc/src/installation.md:284 msgid "" "The `--pure` flag ensures no system dependencies are used in the " "environment." msgstr "" #: ../../doc/src/installation.md:286 msgid "The build steps are the same as with the `ci`:" msgstr "" #: ../../doc/src/installation.md:292 msgid "" "To change the compilation environment from `gcc` (default) to `clang` we " "can use `--argstr`:" msgstr "" #: ../../doc/src/installation.md:297 msgid "Note About Dependencies" msgstr "" #: ../../doc/src/installation.md:299 msgid "" "End users (and distributions) are encouraged to use the tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), which " "only depends on LLVM, CMake and a C++ compiler." msgstr "" #: ../../doc/src/installation.md:303 msgid "" "The tarball is generated automatically by our CI (continuous integration)" " and contains some autogenerated files: the parser, the AST and ASR " "nodes, which is generated by an ASDL translator (requires Python)." msgstr "" #: ../../doc/src/installation.md:307 msgid "The instructions from git are to be used when developing LFortran itself." msgstr "" #: ../../doc/src/installation.md:309 msgid "Note for users who do not use Conda" msgstr "" #: ../../doc/src/installation.md:311 msgid "" "Following are the dependencies necessary for installing this repository " "in development mode," msgstr "" #: ../../doc/src/installation.md:314 msgid "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" msgstr "" #: ../../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 "" #: ../../doc/src/installation.md:316 msgid "[re2c - 2.0.3](https://re2c.org/install/install.html)" msgstr "" #: ../../doc/src/installation.md:317 msgid "" "[binutils - " "2.31.90](ftp://sourceware.org/pub/binutils/snapshots/binutils-2.31.90.tar.xz)" " - Make sure that you should enable the required options related to this " "dependency to build the dynamic libraries (the ones ending with `.so`)." msgstr "" #: ../../doc/src/installation.md:319 msgid "Stacktraces" msgstr "" #: ../../doc/src/installation.md:321 msgid "" "LFortran can print stacktraces when there is an unhandled exception, as " "well as on any compiler error with the `--show-stacktrace` option. This " "is very helpful for developing the compiler itself to see where in " "LFortran the problem is. The stacktrace support is turned off by default," " to enable it, compile LFortran with the `-DWITH_STACKTRACE=yes` cmake " "option after installing the prerequisites on each platform per the " "instructions below." msgstr "" #: ../../doc/src/installation.md:328 msgid "Ubuntu" msgstr "" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." msgstr "" #: ../../doc/src/installation.md:332 msgid "macOS" msgstr "" #: ../../doc/src/installation.md:334 msgid "" "If you use the default Clang compiler on macOS, then the stacktraces " "should just work on both Intel and M1 based macOS (the CMake build system" " automatically invokes the `dsymtuil` tool and our Python scripts to " "store the debug information, see `src/bin/CMakeLists.txt` for more " "details). If it does not work, please report a bug." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/installation.md:352 msgid "" "and compile LFortran with the " "`-DCMAKE_PREFIX_PATH=\"$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX\"` cmake" " option. The `$CONDA_PREFIX` is there if you install some other " "dependencies (such as `llvm`) using Conda, otherwise you can remove it." msgstr "" #: ../../doc/src/intrinsics/array.md:1 msgid "Array Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:1 msgid "allocated(x): Status Check" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:3 msgid "Logical status of an allocatable integer." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:5 #: ../../doc/src/intrinsics/array/cshift.md:5 #: ../../doc/src/intrinsics/array/size.md:5 #: ../../doc/src/intrinsics/bit/bge.md:5 ../../doc/src/intrinsics/bit/bgt.md:5 #: ../../doc/src/intrinsics/bit/bit_size.md:5 #: ../../doc/src/intrinsics/bit/ble.md:5 ../../doc/src/intrinsics/bit/blt.md:5 #: ../../doc/src/intrinsics/bit/btest.md:5 #: ../../doc/src/intrinsics/bit/shiftl.md:5 #: ../../doc/src/intrinsics/bit/shiftr.md:5 #: ../../doc/src/intrinsics/character/achar.md:5 #: ../../doc/src/intrinsics/character/adjustl.md:5 #: ../../doc/src/intrinsics/character/adjustr.md:5 #: ../../doc/src/intrinsics/character/char.md:5 #: ../../doc/src/intrinsics/character/len_trim.md:5 #: ../../doc/src/intrinsics/character/lge.md:5 #: ../../doc/src/intrinsics/kind-type/kind.md:5 #: ../../doc/src/intrinsics/mathematical/acos.md:5 #: ../../doc/src/intrinsics/mathematical/acosh.md:5 #: ../../doc/src/intrinsics/mathematical/asin.md:5 #: ../../doc/src/intrinsics/mathematical/asinh.md:5 #: ../../doc/src/intrinsics/mathematical/atan.md:5 #: ../../doc/src/intrinsics/mathematical/atan2.md:5 #: ../../doc/src/intrinsics/mathematical/atanh.md:5 #: ../../doc/src/intrinsics/mathematical/fraction.md:5 #: ../../doc/src/intrinsics/misc/command_argument_count.md:5 #: ../../doc/src/intrinsics/misc/cpu_time.md:5 #: ../../doc/src/intrinsics/misc/date_and_time.md:5 #: ../../doc/src/intrinsics/misc/new_line.md:5 #: ../../doc/src/intrinsics/numeric/abs.md:5 #: ../../doc/src/intrinsics/numeric/aimag.md:5 #: ../../doc/src/intrinsics/numeric/aint.md:5 #: ../../doc/src/intrinsics/numeric/anint.md:5 #: ../../doc/src/intrinsics/numeric/ceiling.md:5 #: ../../doc/src/intrinsics/numeric/cmplx.md:5 #: ../../doc/src/intrinsics/numeric/conjg.md:5 #: ../../doc/src/intrinsics/numeric/digits.md:5 #: ../../doc/src/intrinsics/numeric/dim.md:5 #: ../../doc/src/intrinsics/numeric/epsilon.md:5 #: ../../doc/src/intrinsics/numeric/erf.md:5 #: ../../doc/src/intrinsics/numeric/erfc.md:5 #: ../../doc/src/intrinsics/numeric/exp.md:5 #: ../../doc/src/intrinsics/numeric/floor.md:5 #: ../../doc/src/intrinsics/numeric/gamma.md:5 #: ../../doc/src/intrinsics/numeric/mod.md:5 msgid "Declaration" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:7 #: ../../doc/src/intrinsics/array/cshift.md:7 #: ../../doc/src/intrinsics/array/size.md:7 #: ../../doc/src/intrinsics/bit/bge.md:7 ../../doc/src/intrinsics/bit/bgt.md:7 #: ../../doc/src/intrinsics/bit/bit_size.md:7 #: ../../doc/src/intrinsics/bit/ble.md:7 ../../doc/src/intrinsics/bit/blt.md:7 #: ../../doc/src/intrinsics/bit/btest.md:7 #: ../../doc/src/intrinsics/bit/shiftl.md:7 #: ../../doc/src/intrinsics/bit/shiftr.md:7 #: ../../doc/src/intrinsics/character/achar.md:7 #: ../../doc/src/intrinsics/character/adjustl.md:7 #: ../../doc/src/intrinsics/character/adjustr.md:7 #: ../../doc/src/intrinsics/character/char.md:7 #: ../../doc/src/intrinsics/character/len_trim.md:7 #: ../../doc/src/intrinsics/character/lge.md:8 #: ../../doc/src/intrinsics/kind-type/kind.md:7 #: ../../doc/src/intrinsics/mathematical/acos.md:7 #: ../../doc/src/intrinsics/mathematical/acosh.md:7 #: ../../doc/src/intrinsics/mathematical/asin.md:7 #: ../../doc/src/intrinsics/mathematical/asinh.md:7 #: ../../doc/src/intrinsics/mathematical/atan.md:7 #: ../../doc/src/intrinsics/mathematical/atan2.md:7 #: ../../doc/src/intrinsics/mathematical/atanh.md:7 #: ../../doc/src/intrinsics/mathematical/fraction.md:7 #: ../../doc/src/intrinsics/misc/command_argument_count.md:7 #: ../../doc/src/intrinsics/misc/cpu_time.md:7 #: ../../doc/src/intrinsics/misc/date_and_time.md:7 #: ../../doc/src/intrinsics/misc/new_line.md:7 #: ../../doc/src/intrinsics/numeric/abs.md:7 #: ../../doc/src/intrinsics/numeric/aimag.md:7 #: ../../doc/src/intrinsics/numeric/aint.md:7 #: ../../doc/src/intrinsics/numeric/anint.md:7 #: ../../doc/src/intrinsics/numeric/ceiling.md:7 #: ../../doc/src/intrinsics/numeric/cmplx.md:7 #: ../../doc/src/intrinsics/numeric/conjg.md:7 #: ../../doc/src/intrinsics/numeric/digits.md:7 #: ../../doc/src/intrinsics/numeric/dim.md:7 #: ../../doc/src/intrinsics/numeric/epsilon.md:7 #: ../../doc/src/intrinsics/numeric/erf.md:7 #: ../../doc/src/intrinsics/numeric/erfc.md:7 #: ../../doc/src/intrinsics/numeric/exp.md:7 #: ../../doc/src/intrinsics/numeric/floor.md:7 #: ../../doc/src/intrinsics/numeric/gamma.md:7 #: ../../doc/src/intrinsics/numeric/mod.md:7 msgid "Syntax" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:14 #: ../../doc/src/intrinsics/array/cshift.md:14 #: ../../doc/src/intrinsics/array/size.md:14 #: ../../doc/src/intrinsics/bit/bge.md:14 #: ../../doc/src/intrinsics/bit/bgt.md:14 #: ../../doc/src/intrinsics/bit/bit_size.md:14 #: ../../doc/src/intrinsics/bit/ble.md:14 #: ../../doc/src/intrinsics/bit/blt.md:14 #: ../../doc/src/intrinsics/bit/btest.md:14 #: ../../doc/src/intrinsics/bit/shiftl.md:14 #: ../../doc/src/intrinsics/bit/shiftr.md:14 #: ../../doc/src/intrinsics/character/achar.md:14 #: ../../doc/src/intrinsics/character/adjustl.md:14 #: ../../doc/src/intrinsics/character/adjustr.md:14 #: ../../doc/src/intrinsics/character/char.md:14 #: ../../doc/src/intrinsics/character/len_trim.md:14 #: ../../doc/src/intrinsics/character/lge.md:15 #: ../../doc/src/intrinsics/kind-type/kind.md:14 #: ../../doc/src/intrinsics/mathematical/acos.md:14 #: ../../doc/src/intrinsics/mathematical/acosh.md:14 #: ../../doc/src/intrinsics/mathematical/asin.md:14 #: ../../doc/src/intrinsics/mathematical/asinh.md:14 #: ../../doc/src/intrinsics/mathematical/atan.md:14 #: ../../doc/src/intrinsics/mathematical/atan2.md:13 #: ../../doc/src/intrinsics/mathematical/atanh.md:14 #: ../../doc/src/intrinsics/mathematical/fraction.md:13 #: ../../doc/src/intrinsics/misc/command_argument_count.md:14 #: ../../doc/src/intrinsics/misc/cpu_time.md:14 #: ../../doc/src/intrinsics/misc/date_and_time.md:14 #: ../../doc/src/intrinsics/misc/new_line.md:14 #: ../../doc/src/intrinsics/numeric/abs.md:15 #: ../../doc/src/intrinsics/numeric/aimag.md:15 #: ../../doc/src/intrinsics/numeric/aint.md:14 #: ../../doc/src/intrinsics/numeric/anint.md:14 #: ../../doc/src/intrinsics/numeric/ceiling.md:14 #: ../../doc/src/intrinsics/numeric/cmplx.md:16 #: ../../doc/src/intrinsics/numeric/conjg.md:15 #: ../../doc/src/intrinsics/numeric/digits.md:13 #: ../../doc/src/intrinsics/numeric/dim.md:13 #: ../../doc/src/intrinsics/numeric/epsilon.md:14 #: ../../doc/src/intrinsics/numeric/erf.md:14 #: ../../doc/src/intrinsics/numeric/erfc.md:14 #: ../../doc/src/intrinsics/numeric/exp.md:14 #: ../../doc/src/intrinsics/numeric/floor.md:14 #: ../../doc/src/intrinsics/numeric/gamma.md:14 #: ../../doc/src/intrinsics/numeric/mod.md:15 msgid "Arguments" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:16 msgid "`x` is an integer input parameter." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:18 #: ../../doc/src/intrinsics/array/cshift.md:22 #: ../../doc/src/intrinsics/array/size.md:22 #: ../../doc/src/intrinsics/bit/bge.md:18 #: ../../doc/src/intrinsics/bit/bgt.md:18 #: ../../doc/src/intrinsics/bit/bit_size.md:18 #: ../../doc/src/intrinsics/bit/ble.md:18 #: ../../doc/src/intrinsics/bit/blt.md:18 #: ../../doc/src/intrinsics/bit/btest.md:19 #: ../../doc/src/intrinsics/bit/shiftl.md:21 #: ../../doc/src/intrinsics/bit/shiftr.md:21 #: ../../doc/src/intrinsics/character/lge.md:23 #: ../../doc/src/intrinsics/kind-type/kind.md:19 #: ../../doc/src/intrinsics/mathematical/acos.md:18 #: ../../doc/src/intrinsics/mathematical/acosh.md:19 #: ../../doc/src/intrinsics/mathematical/asin.md:18 #: ../../doc/src/intrinsics/mathematical/asinh.md:19 #: ../../doc/src/intrinsics/mathematical/atan.md:18 #: ../../doc/src/intrinsics/mathematical/atan2.md:21 #: ../../doc/src/intrinsics/mathematical/atanh.md:19 #: ../../doc/src/intrinsics/mathematical/fraction.md:17 #: ../../doc/src/intrinsics/misc/command_argument_count.md:18 #: ../../doc/src/intrinsics/misc/cpu_time.md:18 #: ../../doc/src/intrinsics/misc/date_and_time.md:39 #: ../../doc/src/intrinsics/misc/new_line.md:19 #: ../../doc/src/intrinsics/numeric/abs.md:19 #: ../../doc/src/intrinsics/numeric/aimag.md:19 #: ../../doc/src/intrinsics/numeric/aint.md:20 #: ../../doc/src/intrinsics/numeric/anint.md:20 #: ../../doc/src/intrinsics/numeric/ceiling.md:18 #: ../../doc/src/intrinsics/numeric/cmplx.md:24 #: ../../doc/src/intrinsics/numeric/conjg.md:19 #: ../../doc/src/intrinsics/numeric/digits.md:17 #: ../../doc/src/intrinsics/numeric/dim.md:18 #: ../../doc/src/intrinsics/numeric/epsilon.md:18 #: ../../doc/src/intrinsics/numeric/erf.md:18 #: ../../doc/src/intrinsics/numeric/erfc.md:18 #: ../../doc/src/intrinsics/numeric/exp.md:18 #: ../../doc/src/intrinsics/numeric/floor.md:20 #: ../../doc/src/intrinsics/numeric/gamma.md:19 #: ../../doc/src/intrinsics/numeric/mod.md:22 msgid "Return values" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:20 msgid "" "The return value is a logical scalar with the default logical kind type " "parameter." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:23 #: ../../doc/src/intrinsics/array/cshift.md:26 #: ../../doc/src/intrinsics/array/size.md:26 #: ../../doc/src/intrinsics/bit/bge.md:22 #: ../../doc/src/intrinsics/bit/bgt.md:22 #: ../../doc/src/intrinsics/bit/bit_size.md:22 #: ../../doc/src/intrinsics/bit/ble.md:22 #: ../../doc/src/intrinsics/bit/blt.md:22 #: ../../doc/src/intrinsics/bit/btest.md:23 #: ../../doc/src/intrinsics/bit/shiftl.md:25 #: ../../doc/src/intrinsics/bit/shiftr.md:25 #: ../../doc/src/intrinsics/character/achar.md:27 #: ../../doc/src/intrinsics/character/adjustl.md:23 #: ../../doc/src/intrinsics/character/adjustr.md:24 #: ../../doc/src/intrinsics/character/char.md:28 #: ../../doc/src/intrinsics/character/len_trim.md:22 #: ../../doc/src/intrinsics/character/lge.md:31 #: ../../doc/src/intrinsics/kind-type/kind.md:23 #: ../../doc/src/intrinsics/mathematical/acos.md:23 #: ../../doc/src/intrinsics/mathematical/acosh.md:24 #: ../../doc/src/intrinsics/mathematical/asin.md:23 #: ../../doc/src/intrinsics/mathematical/asinh.md:24 #: ../../doc/src/intrinsics/mathematical/atan.md:23 #: ../../doc/src/intrinsics/mathematical/atan2.md:27 #: ../../doc/src/intrinsics/mathematical/atanh.md:24 #: ../../doc/src/intrinsics/mathematical/fraction.md:22 #: ../../doc/src/intrinsics/misc/command_argument_count.md:22 #: ../../doc/src/intrinsics/misc/cpu_time.md:22 #: ../../doc/src/intrinsics/misc/date_and_time.md:43 #: ../../doc/src/intrinsics/misc/new_line.md:24 #: ../../doc/src/intrinsics/numeric/abs.md:24 #: ../../doc/src/intrinsics/numeric/aimag.md:23 #: ../../doc/src/intrinsics/numeric/aint.md:28 #: ../../doc/src/intrinsics/numeric/anint.md:27 #: ../../doc/src/intrinsics/numeric/ceiling.md:22 #: ../../doc/src/intrinsics/numeric/cmplx.md:30 #: ../../doc/src/intrinsics/numeric/conjg.md:23 #: ../../doc/src/intrinsics/numeric/digits.md:21 #: ../../doc/src/intrinsics/numeric/dim.md:22 #: ../../doc/src/intrinsics/numeric/epsilon.md:22 #: ../../doc/src/intrinsics/numeric/erf.md:23 #: ../../doc/src/intrinsics/numeric/erfc.md:23 #: ../../doc/src/intrinsics/numeric/exp.md:22 #: ../../doc/src/intrinsics/numeric/floor.md:28 #: ../../doc/src/intrinsics/numeric/gamma.md:23 #: ../../doc/src/intrinsics/numeric/mod.md:31 ../../doc/src/progress.md msgid "Description" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:25 msgid "" "`allocated(x)` checks the allocation status of a integer input parameter." " It returns a logical value as `TRUE` if the input argument `x` is " "allocated, `FALSE` otherwise." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:29 #: ../../doc/src/intrinsics/array/cshift.md:39 #: ../../doc/src/intrinsics/array/size.md:33 #: ../../doc/src/intrinsics/bit/bge.md:27 #: ../../doc/src/intrinsics/bit/bgt.md:27 #: ../../doc/src/intrinsics/bit/bit_size.md:27 #: ../../doc/src/intrinsics/bit/ble.md:27 #: ../../doc/src/intrinsics/bit/blt.md:27 #: ../../doc/src/intrinsics/bit/btest.md:32 #: ../../doc/src/intrinsics/bit/shiftl.md:32 #: ../../doc/src/intrinsics/bit/shiftr.md:32 #: ../../doc/src/intrinsics/character/achar.md:37 #: ../../doc/src/intrinsics/character/adjustl.md:28 #: ../../doc/src/intrinsics/character/adjustr.md:29 #: ../../doc/src/intrinsics/character/char.md:38 #: ../../doc/src/intrinsics/character/len_trim.md:27 #: ../../doc/src/intrinsics/character/lge.md:37 #: ../../doc/src/intrinsics/kind-type/kind.md:27 #: ../../doc/src/intrinsics/mathematical/acos.md:31 #: ../../doc/src/intrinsics/mathematical/acosh.md:43 #: ../../doc/src/intrinsics/mathematical/asin.md:31 #: ../../doc/src/intrinsics/mathematical/asinh.md:35 #: ../../doc/src/intrinsics/mathematical/atan.md:31 #: ../../doc/src/intrinsics/mathematical/atan2.md:53 #: ../../doc/src/intrinsics/mathematical/atanh.md:39 #: ../../doc/src/intrinsics/mathematical/fraction.md:30 #: ../../doc/src/intrinsics/misc/command_argument_count.md:27 #: ../../doc/src/intrinsics/misc/cpu_time.md:33 #: ../../doc/src/intrinsics/misc/date_and_time.md:53 #: ../../doc/src/intrinsics/misc/new_line.md:29 #: ../../doc/src/intrinsics/numeric/abs.md:35 #: ../../doc/src/intrinsics/numeric/aimag.md:33 #: ../../doc/src/intrinsics/numeric/aint.md:35 #: ../../doc/src/intrinsics/numeric/anint.md:38 #: ../../doc/src/intrinsics/numeric/ceiling.md:26 #: ../../doc/src/intrinsics/numeric/cmplx.md:47 #: ../../doc/src/intrinsics/numeric/conjg.md:33 #: ../../doc/src/intrinsics/numeric/digits.md:26 #: ../../doc/src/intrinsics/numeric/dim.md:27 #: ../../doc/src/intrinsics/numeric/epsilon.md:29 #: ../../doc/src/intrinsics/numeric/erf.md:33 #: ../../doc/src/intrinsics/numeric/erfc.md:36 #: ../../doc/src/intrinsics/numeric/exp.md:29 #: ../../doc/src/intrinsics/numeric/floor.md:33 #: ../../doc/src/intrinsics/numeric/gamma.md:38 #: ../../doc/src/intrinsics/numeric/mod.md:43 msgid "Types" 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 "" #: ../../doc/src/intrinsics/array/allocated.md:46 #: ../../doc/src/intrinsics/array/cshift.md:43 #: ../../doc/src/intrinsics/array/size.md:37 #: ../../doc/src/intrinsics/bit/bge.md:49 #: ../../doc/src/intrinsics/bit/bgt.md:49 #: ../../doc/src/intrinsics/bit/bit_size.md:44 #: ../../doc/src/intrinsics/bit/ble.md:49 #: ../../doc/src/intrinsics/bit/blt.md:49 #: ../../doc/src/intrinsics/bit/btest.md:56 #: ../../doc/src/intrinsics/bit/shiftl.md:62 #: ../../doc/src/intrinsics/bit/shiftr.md:62 #: ../../doc/src/intrinsics/character/achar.md:53 #: ../../doc/src/intrinsics/character/adjustl.md:45 #: ../../doc/src/intrinsics/character/adjustr.md:46 #: ../../doc/src/intrinsics/character/char.md:53 #: ../../doc/src/intrinsics/character/len_trim.md:44 #: ../../doc/src/intrinsics/character/lge.md:59 #: ../../doc/src/intrinsics/kind-type/kind.md:59 #: ../../doc/src/intrinsics/mathematical/acos.md:60 #: ../../doc/src/intrinsics/mathematical/acosh.md:72 #: ../../doc/src/intrinsics/mathematical/asin.md:60 #: ../../doc/src/intrinsics/mathematical/asinh.md:64 #: ../../doc/src/intrinsics/mathematical/atan.md:60 #: ../../doc/src/intrinsics/mathematical/atan2.md:75 #: ../../doc/src/intrinsics/mathematical/atanh.md:68 #: ../../doc/src/intrinsics/mathematical/fraction.md:34 #: ../../doc/src/intrinsics/misc/command_argument_count.md:31 #: ../../doc/src/intrinsics/misc/cpu_time.md:44 #: ../../doc/src/intrinsics/misc/date_and_time.md:64 #: ../../doc/src/intrinsics/misc/new_line.md:40 #: ../../doc/src/intrinsics/numeric/abs.md:79 #: ../../doc/src/intrinsics/numeric/aimag.md:53 #: ../../doc/src/intrinsics/numeric/aint.md:39 #: ../../doc/src/intrinsics/numeric/anint.md:42 #: ../../doc/src/intrinsics/numeric/ceiling.md:46 #: ../../doc/src/intrinsics/numeric/cmplx.md:59 #: ../../doc/src/intrinsics/numeric/conjg.md:53 #: ../../doc/src/intrinsics/numeric/digits.md:30 #: ../../doc/src/intrinsics/numeric/dim.md:31 #: ../../doc/src/intrinsics/numeric/epsilon.md:49 #: ../../doc/src/intrinsics/numeric/erf.md:53 #: ../../doc/src/intrinsics/numeric/erfc.md:56 #: ../../doc/src/intrinsics/numeric/exp.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:65 #: ../../doc/src/intrinsics/numeric/gamma.md:58 #: ../../doc/src/intrinsics/numeric/mod.md:80 msgid "Examples" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:59 #: ../../doc/src/intrinsics/array/cshift.md:55 #: ../../doc/src/intrinsics/array/size.md:48 #: ../../doc/src/intrinsics/mathematical/acos.md:76 #: ../../doc/src/intrinsics/mathematical/acosh.md:81 #: ../../doc/src/intrinsics/mathematical/asin.md:76 #: ../../doc/src/intrinsics/mathematical/asinh.md:73 #: ../../doc/src/intrinsics/mathematical/atan.md:76 #: ../../doc/src/intrinsics/mathematical/atan2.md:84 #: ../../doc/src/intrinsics/mathematical/atanh.md:77 #: ../../doc/src/intrinsics/mathematical/fraction.md:44 msgid "**Result**:" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:65 #: ../../doc/src/intrinsics/array/cshift.md:62 #: ../../doc/src/intrinsics/array/size.md:55 #: ../../doc/src/intrinsics/bit/bge.md:68 #: ../../doc/src/intrinsics/bit/bgt.md:66 #: ../../doc/src/intrinsics/bit/bit_size.md:61 #: ../../doc/src/intrinsics/bit/ble.md:68 #: ../../doc/src/intrinsics/bit/blt.md:66 #: ../../doc/src/intrinsics/bit/btest.md:71 #: ../../doc/src/intrinsics/bit/shiftl.md:80 #: ../../doc/src/intrinsics/bit/shiftr.md:80 #: ../../doc/src/intrinsics/character/achar.md:69 #: ../../doc/src/intrinsics/character/adjustl.md:62 #: ../../doc/src/intrinsics/character/adjustr.md:63 #: ../../doc/src/intrinsics/character/char.md:69 #: ../../doc/src/intrinsics/character/len_trim.md:63 #: ../../doc/src/intrinsics/character/lge.md:79 #: ../../doc/src/intrinsics/kind-type/kind.md:79 #: ../../doc/src/intrinsics/mathematical/acos.md:82 #: ../../doc/src/intrinsics/mathematical/acosh.md:86 #: ../../doc/src/intrinsics/mathematical/asin.md:82 #: ../../doc/src/intrinsics/mathematical/asinh.md:78 #: ../../doc/src/intrinsics/mathematical/atan.md:82 #: ../../doc/src/intrinsics/mathematical/atan2.md:90 #: ../../doc/src/intrinsics/mathematical/atanh.md:82 #: ../../doc/src/intrinsics/mathematical/fraction.md:50 #: ../../doc/src/intrinsics/misc/command_argument_count.md:47 #: ../../doc/src/intrinsics/misc/cpu_time.md:64 #: ../../doc/src/intrinsics/misc/date_and_time.md:90 #: ../../doc/src/intrinsics/misc/new_line.md:56 #: ../../doc/src/intrinsics/numeric/abs.md:96 #: ../../doc/src/intrinsics/numeric/aimag.md:68 #: ../../doc/src/intrinsics/numeric/aint.md:55 #: ../../doc/src/intrinsics/numeric/anint.md:58 #: ../../doc/src/intrinsics/numeric/ceiling.md:64 #: ../../doc/src/intrinsics/numeric/cmplx.md:74 #: ../../doc/src/intrinsics/numeric/conjg.md:68 #: ../../doc/src/intrinsics/numeric/digits.md:44 #: ../../doc/src/intrinsics/numeric/dim.md:47 #: ../../doc/src/intrinsics/numeric/epsilon.md:63 #: ../../doc/src/intrinsics/numeric/erf.md:67 #: ../../doc/src/intrinsics/numeric/erfc.md:70 #: ../../doc/src/intrinsics/numeric/exp.md:71 #: ../../doc/src/intrinsics/numeric/floor.md:83 #: ../../doc/src/intrinsics/numeric/gamma.md:74 #: ../../doc/src/intrinsics/numeric/mod.md:95 msgid "See Also" msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:1 msgid "cshift(A, shift [, dim]): Circular Shift" msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:3 msgid "Circular shift elements of an array." 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 "" #: ../../doc/src/intrinsics/array/cshift.md:18 msgid "`shift` the input value of integer type." msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:20 msgid "" "`dim` optional dimension, if present, `cshift` returns the result of this" " dimension." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/array/cshift.md:28 msgid "" "**cshift(A, shift [, dim])** performs a circular shift on elements of `A`" " array along the dimension of `dim`. Default value of `dim` is 1, used " "when `dim` is not passed." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/array/cshift.md:41 msgid "" "Supported argument type is array for `A` and integer for `shift` and " "`dim`." msgstr "" #: ../../doc/src/intrinsics/array/size.md:1 msgid "size(x): Size of Array" msgstr "" #: ../../doc/src/intrinsics/array/size.md:3 msgid "Returns the size of an array `x`." msgstr "" #: ../../doc/src/intrinsics/array/size.md:18 msgid "" "`dim` optional dimension, if present, `size` returns the size of this " "dimension." msgstr "" #: ../../doc/src/intrinsics/array/size.md:20 msgid "`kind` optional the kind of the return value." msgstr "" #: ../../doc/src/intrinsics/array/size.md:24 msgid "`n` the size of an array (integer)." msgstr "" #: ../../doc/src/intrinsics/array/size.md:28 msgid "" "The `size` intrinsic function returns the size of an array. It returns " "the product of all dimensions, unless the `dim` argument is specified, in" " which case it only returns the size of this particular dimension. The " "`kind` argument can be used to specify the integer kind of the result." msgstr "" #: ../../doc/src/intrinsics/array/size.md:57 msgid "[shape](), [reshape]()." msgstr "" #: ../../doc/src/intrinsics/bit.md:1 msgid "Bit Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:1 msgid "bge(x, y): Bitwise Greater or Equal" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:3 msgid "Bitwise greater than or equal to." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/bge.md:29 #: ../../doc/src/intrinsics/bit/bgt.md:29 #: ../../doc/src/intrinsics/bit/ble.md:29 #: ../../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 "" #: ../../doc/src/intrinsics/bit/bge.md:60 #: ../../doc/src/intrinsics/bit/bgt.md:59 #: ../../doc/src/intrinsics/bit/bit_size.md:54 #: ../../doc/src/intrinsics/bit/ble.md:60 #: ../../doc/src/intrinsics/bit/blt.md:59 #: ../../doc/src/intrinsics/bit/btest.md:65 #: ../../doc/src/intrinsics/bit/shiftl.md:74 #: ../../doc/src/intrinsics/bit/shiftr.md:74 #: ../../doc/src/intrinsics/character/achar.md:63 #: ../../doc/src/intrinsics/character/adjustl.md:56 #: ../../doc/src/intrinsics/character/adjustr.md:57 #: ../../doc/src/intrinsics/character/char.md:63 #: ../../doc/src/intrinsics/character/len_trim.md:57 #: ../../doc/src/intrinsics/character/lge.md:72 #: ../../doc/src/intrinsics/kind-type/kind.md:72 #: ../../doc/src/intrinsics/misc/command_argument_count.md:40 #: ../../doc/src/intrinsics/misc/cpu_time.md:57 #: ../../doc/src/intrinsics/misc/date_and_time.md:83 #: ../../doc/src/intrinsics/misc/new_line.md:49 #: ../../doc/src/intrinsics/numeric/abs.md:89 #: ../../doc/src/intrinsics/numeric/aimag.md:62 #: ../../doc/src/intrinsics/numeric/aint.md:48 #: ../../doc/src/intrinsics/numeric/anint.md:51 #: ../../doc/src/intrinsics/numeric/ceiling.md:57 #: ../../doc/src/intrinsics/numeric/cmplx.md:68 #: ../../doc/src/intrinsics/numeric/conjg.md:62 #: ../../doc/src/intrinsics/numeric/digits.md:38 #: ../../doc/src/intrinsics/numeric/dim.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:57 #: ../../doc/src/intrinsics/numeric/erf.md:61 #: ../../doc/src/intrinsics/numeric/erfc.md:64 #: ../../doc/src/intrinsics/numeric/exp.md:65 #: ../../doc/src/intrinsics/numeric/floor.md:76 #: ../../doc/src/intrinsics/numeric/gamma.md:67 #: ../../doc/src/intrinsics/numeric/mod.md:89 msgid "**Result:**" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:70 msgid "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/bgt.md:1 msgid "bgt(x, y): Bitwise Greater Than" msgstr "" #: ../../doc/src/intrinsics/bit/bgt.md:3 msgid "Bitwise greater than." 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 "" #: ../../doc/src/intrinsics/bit/bgt.md:68 msgid "[bge](bge.md), [ble](ble.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:1 msgid "bit_size(x): Bit Size" msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:3 msgid "Bit size." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:16 msgid "`x` is integer input value." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:20 #: ../../doc/src/intrinsics/numeric/digits.md:19 msgid "The return value is of type integer." 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 "" #: ../../doc/src/intrinsics/bit/bit_size.md:29 msgid "Supported input types is integer." msgstr "" #: ../../doc/src/intrinsics/bit/ble.md:1 msgid "bge(x, y): Bitwise Less or Equal" msgstr "" #: ../../doc/src/intrinsics/bit/ble.md:3 msgid "Bitwise less than or equal to." 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 "" #: ../../doc/src/intrinsics/bit/ble.md:70 msgid "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:1 msgid "blt(x, y): Bitwise Less Than" msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:3 msgid "Bitwise less than." 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 "" #: ../../doc/src/intrinsics/bit/blt.md:68 msgid "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:1 msgid "btest(x, pos): Bit Test at Position" msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:3 msgid "Bit test." 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 "" #: ../../doc/src/intrinsics/bit/btest.md:21 msgid "The return value is of type logical." msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:25 msgid "" "`btest(x, pos)` calculates if `pos` bit in input integer value `x` is " "set. The counting of the bits starts at 0, at least significant bit (LSB)" " i.e., the rightmost bit in `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:1 msgid "shiftl(x, shift): Shift Left" msgstr "" #: ../../doc/src/intrinsics/bit/shiftl.md:3 msgid "Logical shift left function." msgstr "" #: ../../doc/src/intrinsics/bit/shiftl.md:16 #: ../../doc/src/intrinsics/bit/shiftr.md:16 msgid "`x` is an integer input value." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:27 msgid "" "**shiftl(x, shift)** logically left shifts `x` by `shift` number of bits." " `shiftl` shifts from LSB(**L**east **S**ignificant **B**it) to " "MSB(**M**ost **S**ignificant **B**it). Bits shifted from the left end " "i.e., MSB bits are lost. Zeroes are appended to the opposite right end." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:82 msgid "[shiftr](shiftr.md)." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:1 msgid "shiftr(x, shift): Shift Right" msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:3 msgid "Logical shift right function." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:27 msgid "" "**shiftr(x, shift)** logically right shifts `x` by `shift` number of " "bits. `shiftr` shifts from MSB(**M**ost **S**ignificant **B**it) to " "LSB(**L**east **S**ignificant **B**it). Bits shifted from the right end " "i.e., LSB bits are lost. Zeroes are appended to the opposite left end." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:82 msgid "[shiftl](shiftl.md)." msgstr "" #: ../../doc/src/intrinsics/character.md:1 msgid "Character Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/character/achar.md:1 msgid "achar(x, kind): To Character in ASCII set." msgstr "" #: ../../doc/src/intrinsics/character/achar.md:3 msgid "Character represented by in the ASCII character set." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/character/achar.md:20 #: ../../doc/src/intrinsics/character/adjustl.md:18 #: ../../doc/src/intrinsics/character/adjustr.md:18 #: ../../doc/src/intrinsics/character/char.md:21 #: ../../doc/src/intrinsics/character/len_trim.md:18 msgid "Return value" 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/achar.md:29 msgid "" "**achar(x, kind)** returns the character represented by the ASCII " "character set at `x` position." msgstr "" #: ../../doc/src/intrinsics/character/achar.md:32 #: ../../doc/src/intrinsics/character/char.md:33 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 "" #: ../../doc/src/intrinsics/character/achar.md:35 #: ../../doc/src/intrinsics/character/char.md:36 msgid "It is a runtime builtin function." 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 "" #: ../../doc/src/intrinsics/character/adjustl.md:1 msgid "adjustl(string): Left Adjust String" msgstr "" #: ../../doc/src/intrinsics/character/adjustl.md:3 msgid "Left adjust a string." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/adjustl.md:30 #: ../../doc/src/intrinsics/character/adjustr.md:31 msgid "Supported argument type is character." msgstr "" #: ../../doc/src/intrinsics/character/adjustr.md:1 msgid "adjustr(string): Right Adjust String" msgstr "" #: ../../doc/src/intrinsics/character/adjustr.md:3 msgid "Right adjust a string." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/adjustr.md:65 msgid "[adjustl](adjustl.md)." msgstr "" #: ../../doc/src/intrinsics/character/char.md:1 msgid "char(x, [, kind]): Integer to Character" msgstr "" #: ../../doc/src/intrinsics/character/char.md:3 msgid "Integer to character conversion." msgstr "" #: ../../doc/src/intrinsics/character/char.md:16 msgid "`x`: the input value of integer type." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/character/char.md:30 msgid "" "**char(x)** returns the character represented by the ASCII character set " "at `x` position." msgstr "" #: ../../doc/src/intrinsics/character/char.md:71 msgid "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:1 msgid "len_trim(string): Length Ignoring Trailing Blanks" msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:3 msgid "Length of a character string ignoring trailing blank character(s)." msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:16 msgid "`string` the input value of character type." msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:20 msgid "The return value is of type unsigned integer." 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 "" #: ../../doc/src/intrinsics/character/len_trim.md:29 msgid "Supported argument type is character scalar." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:1 msgid "lge(x, y): Lexically Greater or Equal" msgstr "" #: ../../doc/src/intrinsics/character/lge.md:3 msgid "Lexically greater than or equal." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:17 msgid "`x` input value of type character." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:19 msgid "`y` input value of type character." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:21 msgid "`x` and `y` can be seen as string A and string B." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:25 msgid "The return value is of logical `true` or `false` type." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:27 msgid "`True` if `x` string is lexically greater than or equal to `y`." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:29 msgid "`False` if they are not." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:33 msgid "" "**lge(x, y)** determines if input string `x` is lexically greater than or" " equal to input string `y`. The two strings in comparison are interpreted" " as containing ASCII character codes." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:39 msgid "Argument types should be of type character literal." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:81 msgid "[len_trim](len_trim.md)." msgstr "" #: ../../doc/src/intrinsics/kind-type.md:1 msgid "Kind Type Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:1 msgid "kind(x): Kind of an Entity" msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:3 msgid "Kind of an entity." 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 "" #: ../../doc/src/intrinsics/kind-type/kind.md:21 msgid "The return value is of integer type and of default integer kind." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:25 msgid "**kind(x)** returns the kind parameter of the input argument `x`." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:29 msgid "" "Supported argument types are logical, integer, real, complex, or " "character." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:81 #: ../../doc/src/intrinsics/misc/command_argument_count.md:16 #: ../../doc/src/intrinsics/misc/cpu_time.md:20 #: ../../doc/src/intrinsics/misc/date_and_time.md:41 #: ../../doc/src/intrinsics/misc/new_line.md:58 msgid "None." msgstr "" #: ../../doc/src/intrinsics/mathematical.md:1 msgid "Mathematical Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:1 msgid "acos(x): Trigonometric Arc Cosine" msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:3 msgid "Trigonometric arc cosine (inverse cosine) function." 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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:20 #: ../../doc/src/intrinsics/mathematical/acosh.md:21 #: ../../doc/src/intrinsics/mathematical/asin.md:20 #: ../../doc/src/intrinsics/mathematical/asinh.md:21 #: ../../doc/src/intrinsics/mathematical/atan.md:20 #: ../../doc/src/intrinsics/mathematical/atanh.md:21 msgid "" "The returned value has the kind of the input value and TYPE may be real " "or complex." msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:25 msgid "**acos(x)** computes the arcsine of the argument **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:33 #: ../../doc/src/intrinsics/mathematical/acosh.md:45 #: ../../doc/src/intrinsics/mathematical/asin.md:33 #: ../../doc/src/intrinsics/mathematical/asinh.md:37 #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:84 msgid "[asin](asin.md), [atan](atan.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:1 msgid "acosh(x): Inverse Hyperbolic Cosine" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:3 msgid "Inverse hyperbolic cosine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:16 #: ../../doc/src/intrinsics/mathematical/asinh.md:16 #: ../../doc/src/intrinsics/mathematical/atanh.md:16 msgid "" "`x` the input value, can be real with value greater than or equal to 1 or" " of type complex." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:26 msgid "**acosh(x)** computes the inverse hyperbolic cosine function of **x**." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acosh.md:33 msgid "$-\\pi <= img (acosh(x)) <= \\pi$" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:35 msgid "" "For real values $x$ in the domain $x > 1$, the inverse hyperbolic cosine " "satisifies:" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:38 msgid "$cosh^{-1}(x) = \\log(x + \\sqrt{(x^2 - 1)})$" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acosh.md:88 msgid "[asinh](asinh.md), [atanh](atanh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:1 msgid "asin(x): Trigonometric Arcsine" msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:3 msgid "Trigonometric arcsine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:25 msgid "**asin(x)** computes the arcsine of the argument **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/asin.md:84 msgid "[acos](acos.md), [atan](atan.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:1 msgid "asinh(x): Inverse Hyperbolic Arcsine" msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:3 msgid "Inverse hyperbolic arcsine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:26 msgid "**asinh(x)** computes the inverse hyperbolic arcsine function of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/asinh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (asinh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:80 msgid "[acosh](acosh.md), [atanh](atanh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:1 msgid "atan(x): Trigonometric ArcTangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:3 msgid "Trigonometric arctangent (inverse arctangent) function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:25 msgid "**atan(x)** computes the arctangent of the argument **x**." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:27 msgid "" "The arc tangent is the inverse function of the arctangent function. It is" " commonly used in trigonometry to find the angle when the lengths of the " "opposite side of a right triangle and base are known, i.e., perpendicular" " and base length." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:84 msgid "[asin](asin.md), [acos](acos.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:1 msgid "atan2(y, x): ArcTangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:3 msgid "Arctangent function or inverse tangent function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:15 msgid "`y` the input value is the imaginary part of the complex expression" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atan2.md:19 msgid "`x` the input value, must be real part of the complex expression." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atan2.md:29 msgid "" "**atan2(y, x)** computes the principal value of the argument function of " "the complex expression $x + iy$. This is used to transform from cartesian" " into polar coordinates and allows to determine the angle in the correct " "quadrant." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:33 msgid "It is also represented as:" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:35 msgid "$tan^{-1}(\\frac{y}{x})$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:37 msgid "If `x` is nonzero, the result lies in the range:" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:39 msgid "$-\\pi <= atan(x) <= \\pi$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:41 msgid "The sign is positive if `y` is positive." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:43 msgid "If `y` is zero and `x` is strictly positive, then the result is 0." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:45 msgid "If `x` is negative and `y` is positive zero, then the result is $\\pi$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:47 msgid "If `x` is negative and `y` is negative zero, then the result is $-\\pi$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:49 msgid "If `x` is zero, then the magnitude of the result is $\\frac{\\pi}{2}$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:51 msgid "If `y` is negative real zero, the result is $\\frac{-\\pi}{2}$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:55 #: ../../doc/src/intrinsics/mathematical/fraction.md:32 msgid "Supported argument type is real." msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:1 msgid "atanh(x): Inverse Hyperbolic Tangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:3 msgid "Inverse hyperbolic tangent function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:26 msgid "**atanh(x)** computes the inverse hyperbolic tangent function of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atanh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (atanh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:35 msgid "If the result is real, it lies in the range" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:37 msgid "$-1.0 < atanh(x) < 1.0$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:84 msgid "[asinh](asinh.md), [acosh](acosh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:1 msgid "fraction(x): Fractional Part in Model Representation" msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:3 msgid "Fractional part of the model representation." msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:15 msgid "`x` the input value, must be real." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/fraction.md:24 msgid "" "**fraction(x)** computes the fractional part of the model representation " "of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/fraction.md:28 msgid "$x * {radix(x)}^{(-exponent(x))}$" msgstr "" #: ../../doc/src/intrinsics/misc.md:1 msgid "Miscellaneous Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:1 msgid "command_argument_count(): Number of Command Line Arguments" msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:3 msgid "Get number of command line arguments." msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:20 msgid "The return value is of integer type and of default kind." 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 "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:29 msgid "Any." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:1 msgid "cpu_time(x): CPU Elapsed Time" msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:3 msgid "CPU elapsed time in seconds." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:16 msgid "`x` the input value should be of type real with `intent(out)`." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:24 msgid "" "**cpu_time(time)** returns a real value representing the elapsed CPU time" " in seconds. If tine source is available, time will be reported with " "microsecond resolution. If no time source is available, TIME is set to " "-1.0." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:28 msgid "This is useful for testing segments of code to determine computation time." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:1 msgid "date_and_time([date, time, zone, values]): Date and Time" msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:3 msgid "Date and time subroutine." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:22 msgid "" "`zone` the input value of character type, which has length 5 or larger. " "It is of default kind. It is `intent(out)` and has from `(+-)hhmm`, " "representing the difference with respect to Coordinates Universal Time " "(UTC). Unavailable time and date parameters return blanks." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:30 msgid "`value(1)`: The year." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:31 msgid "`value(2)`: The month." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:32 msgid "`value(3)`: The day of the month." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:33 msgid "`value(4)`: Time difference with UTC in minutes." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:34 msgid "`value(5)`: The hour of the day." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:35 msgid "`value(6)`: The minutes of the hour." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:36 msgid "`value(7)`: The seconds of the minutes." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:37 msgid "`value(8)`: The milliseconds of the second." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:51 msgid "Unavailable or errorneous date and time parameters return blanks." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:92 msgid "[cpu_time](cpu_time.md)." msgstr "" #: ../../doc/src/intrinsics/misc/new_line.md:1 msgid "new_line(x): New Line Character" msgstr "" #: ../../doc/src/intrinsics/misc/new_line.md:3 msgid "New line character." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/new_line.md:31 msgid "Supported input parameter types is character." msgstr "" #: ../../doc/src/intrinsics/numeric.md:1 msgid "Numeric Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:1 msgid "abs(x): Absolute Value" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:3 msgid "Absolute value." msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:17 msgid "`x` the input value, can be integer, real, or complex." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/abs.md:26 msgid "" "**abs(x)** calculates and returns absolute value of `x`. Result is " "calculated using mathematical formula:" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:29 msgid "$|x|$" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:31 msgid "If `x` is complex, the result is calculated using mathematical formula:" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:33 msgid "$\\sqrt{(x^2 + y^2)}$" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aimag.md:1 msgid "aimag(x): Imaginary Part" msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:3 msgid "Imaginary part of complex number." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:17 msgid "`x` the input value must be of complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:21 msgid "The return value is imaginary part of type real and kind same as of `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:25 msgid "**aimag(x)** returns the imaginary part of the input complex argument `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:27 #: ../../doc/src/intrinsics/numeric/cmplx.md:41 #: ../../doc/src/intrinsics/numeric/conjg.md:27 msgid "" "For `x` complex input value, the result is calculated using mathematical " "formula:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aimag.md:35 msgid "Supported argument types are complex." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:1 msgid "aint(x, [kind]): Truncate to a Whole Number" msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:3 msgid "Truncate to a whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:16 #: ../../doc/src/intrinsics/numeric/anint.md:16 #: ../../doc/src/intrinsics/numeric/epsilon.md:16 #: ../../doc/src/intrinsics/numeric/erf.md:16 #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aint.md:37 #: ../../doc/src/intrinsics/numeric/anint.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:31 #: ../../doc/src/intrinsics/numeric/erf.md:35 #: ../../doc/src/intrinsics/numeric/erfc.md:38 #: ../../doc/src/intrinsics/numeric/floor.md:35 #: ../../doc/src/intrinsics/numeric/gamma.md:40 msgid "Supported argument types is real." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:85 msgid "[ceiling](ceiling.md), [mod](mod.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:1 msgid "anint(x, [kind]): Round to Nearest Whole Number" msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:3 msgid "Round to nearest whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:25 msgid "The return value is equal to rounded whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:29 msgid "**anint(x)** calculates rounded value of input parameter `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/anint.md:34 msgid "If `x` is greater than 0, `anint(x)` returns `aint(x + 0.5)`." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:60 msgid "[aint](aint.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:1 msgid "ceiling(x): Integer Ceiling" msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:3 msgid "Integer ceiling function" msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:16 msgid "The input value `x` may be of type real or integer." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:20 msgid "The return value is of type integer and nearest greater integer." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:24 msgid "**ceiling(x)** returns the least integer greater than or equal to `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:28 msgid "Supported input parameter types are integer and real." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:66 msgid "[floor](floor.md), [mod](mod.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:1 msgid "cmplx(x [, [, kind]]): Convert to Complex" msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:3 msgid "Conversion to complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:14 msgid "`cmplx(x, y)` is one of the intrinsic present in ASR." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:18 msgid "" "`x` the input value must be of integer, real, or complex. `y` the " "optional input value must be of type integer or real. It should be only " "present in case `x` is not complex. `kind` the optional input value of " "integer expression type for initialisation indicating the kind parameter " "of the result." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/cmplx.md:32 msgid "" "**cmplx(x, [, y [, kind]])** converts the input value to complex " "representation:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/cmplx.md:37 msgid "If `y` is not present, the imaginary component is set to 0.0." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:39 msgid "If `x` is complex then `y` must not be present." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:49 msgid "Supported argument types are integer, real, or complex." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:1 msgid "conjg(x): Complex Conjugate" msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:3 msgid "Complex conjugate function." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:17 msgid "`x` the input value must be of type complex." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:21 msgid "The return value is of complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:25 msgid "**conjg(x)** converts the input value `x` to its conjugate." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:29 msgid "$x + iy$ converted to $x - iy$" msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:35 msgid "Supported argument types is complex." msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:1 msgid "digits(x): Significant Binary Digits" msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:3 msgid "Significant binary digits." msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:15 msgid "`x` the input value must be of type real or integer." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/dim.md:1 msgid "dim(x, y): Positive Difference or 0" msgstr "" #: ../../doc/src/intrinsics/numeric/dim.md:3 msgid "Positive difference or 0." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/dim.md:20 msgid "The return value is of type integer or real." 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 "" #: ../../doc/src/intrinsics/numeric/epsilon.md:1 msgid "epsilon(x): Epsilon" msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:3 msgid "Epsilon function." msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:20 msgid "The return value is of same type as of the input argument." msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:24 msgid "" "**epsilon(x)** computes the smallest number $\\epsilon$ of the same kind " "as `x` following:" msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:27 msgid "$1 + \\epsilon > 1$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:1 msgid "erf(x): Error" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:3 msgid "Error function." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/erf.md:27 msgid "$-1 \\leq erf (x) \\leq 1$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_0^xe^{-t^2}dt$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:69 msgid "[erfc](erfc.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:1 msgid "erfc(x): Complementary Error" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:3 msgid "Complementary error function." 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 "" #: ../../doc/src/intrinsics/numeric/erfc.md:27 msgid "$0 \\leq erf (x) \\leq 2$" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_{x}^{\\infty}e^{-t^2}dt$" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/erfc.md:72 msgid "[erf](erf.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:1 msgid "exp(x): Exponential" msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:3 msgid "Exponential function." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:16 msgid "`x` the input value must be of type real or complex." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:20 msgid "The return value is of same type as of the input argument, `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:24 msgid "**exp(x)** computes the base $e$ exponential of `x`, i.e., $e^x$." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/exp.md:31 msgid "Supported argument types is real and complex." msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:1 msgid "floor(x, kind): Integer Floor" msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:3 msgid "Integer floor function." msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:18 msgid "" "`kind` the optional input parameter must be a scalar integer constant " "expression." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:1 msgid "gamma(x): Gamma" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:3 msgid "Gamma function." 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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:21 msgid "The return value is of same type and kind as of `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:28 msgid "$\\gamma(x) = (x-1)!$" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:30 msgid "In general, if $x > 0$:" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:32 msgid "$\\gamma(x) = \\int_{0}^{\\infty} e^{-t} dt$" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:34 msgid "and if $-n-1 < x < -n$ where n is an integer >= 0:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:76 msgid "[epsilon](epsilon.md)" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:1 msgid "mod(x, y): Modulus" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:3 msgid "Modulus or remainder function." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:17 msgid "`x` the input value, can be integer or real." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/mod.md:27 msgid "`x - INT (x / y) * y`." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:29 msgid "If `y` is 0, the result is undefined like `any integer value / 0`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/mod.md:36 msgid "`x - INT(x / y) * y`" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:38 msgid "" "i.e., result is remainder when first argument is mathematically divided " "by second argument." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:41 msgid "The return value should be less than `y`." msgstr "" #: ../../doc/src/language.md:1 msgid "Fortran Language" msgstr "" #: ../../doc/src/language.md:3 msgid "Background and Motivation" msgstr "" #: ../../doc/src/language.md:5 msgid "" "Fortran was designed from the ground up to naturally and simply translate" " mathematics to code that compiles and runs at maximum speed. And being " "specifically targeted for such fundamentally computational tasks, it " "contains a broad range of key functionality within the language itself, " "standard across all platforms, with no need for external libraries that " "may or may not be well optimized or maintained, at present or down the " "road." msgstr "" #: ../../doc/src/language.md:12 msgid "Some highlights:" 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 "" #: ../../doc/src/language.md:17 msgid "" "Operators which operate naturally upon the aforementioned " "arrays/matrices, as they do scalars;" msgstr "" #: ../../doc/src/language.md:19 msgid "Complex numbers;" msgstr "" #: ../../doc/src/language.md:20 msgid "Special functions;" msgstr "" #: ../../doc/src/language.md:21 msgid "Structures and pointers for more general data representation." msgstr "" #: ../../doc/src/language.md:23 msgid "" "Because the essentials are contained in the language itself, it is simple" " to read and write, without need of choosing from among or deciphering a " "proliferation of external classes to do the same thing. And because the " "essentials are self-contained, compilers can provide detailed compile-" "time (e.g., argument mismatch) and run-time (e.g., memory access) checks," " as well as highly optimized executables, directly from natural, readable" " code without need of extensive optimization heroics by the developer." msgstr "" #: ../../doc/src/language.md:31 msgid "See our blog posts for more information:" msgstr "" #: ../../doc/src/language.md:33 msgid "" "[Why We Created LFortran](https://lfortran.org/blog/2019/04/why-we-" "created-lfortran/)" msgstr "" #: ../../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 "" #: ../../doc/src/language.md:36 msgid "How to Learn Fortran" msgstr "" #: ../../doc/src/language.md:38 msgid "" "Fortran is relatively quick to learn because it is so much simpler and " "smaller than C/C++ (in practice, that is, with all needed libraries " "included). If you are interested in learning more, please see our webpage" " at [fortran90.org] with recommended practices for writing code, side by " "side comparison with Python/NumPy, links to other online Fortran " "resources and books, and an FAQ." msgstr "" #: ../../doc/src/progress.md:3 msgid "" "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:" msgstr "" #: ../../doc/src/progress.md:7 msgid "AST: The code can be parsed to AST (`lfortran --show-ast test.f90`)" msgstr "" #: ../../doc/src/progress.md:8 msgid "ASR: The code can be transformed to ASR (`lfortran --show-asr test.f90`)" msgstr "" #: ../../doc/src/progress.md:9 msgid "LLVM: LFortran can generate LLVM IR (`lfortran --show-llvm test.f90`)" msgstr "" #: ../../doc/src/progress.md:10 msgid "BIN: The LLVM IR can compile to a binary" msgstr "" #: ../../doc/src/progress.md:11 msgid "RUN: The binary runs without errors" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:16 msgid "" "This page is generated automatically using the [Compiler " "Tester](https://gitlab.com/lfortran/compiler_tester) repository which " "contains all the Fortran tests and scripts to run LFortran to produce the" " tables below. We are looking for contributors to contribute more tests. " "Our goal is to have a comprehensive Fortran testsuite that can be used to" " test any Fortran compiler." msgstr "" #: ../../doc/src/progress.md:23 msgid "Testing the LFortran compiler version:" msgstr "" #: ../../doc/src/progress.md:32 msgid "Topics" msgstr "" #: ../../doc/src/progress.md:34 msgid "Full programs that compute something interesting" msgstr "" #: ../../doc/src/progress.md:36 msgid "Basic Numerics" msgstr "" #: ../../doc/src/progress.md:38 msgid "Directory: `tests/programs/numerics`" msgstr "" #: ../../doc/src/progress.md msgid "LLVM" msgstr "" #: ../../doc/src/progress.md msgid "BIN" msgstr "" #: ../../doc/src/progress.md msgid "RUN" msgstr "" #: ../../doc/src/progress.md msgid "Filename" msgstr "" #: ../../doc/src/progress.md msgid "`Pure Fortran sin(x) implementation`" msgstr "" #: ../../doc/src/progress.md msgid "✅" 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 "" #: ../../doc/src/progress.md:45 msgid "Modules" msgstr "" #: ../../doc/src/progress.md:47 msgid "Basic Usage" msgstr "" #: ../../doc/src/progress.md:49 msgid "Directory: `tests/modules/basic`" msgstr "" #: ../../doc/src/progress.md msgid "`Basic modules`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/basic/t01.f90)" msgstr "" #: ../../doc/src/progress.md:56 msgid "Module Functions and Subroutines" msgstr "" #: ../../doc/src/progress.md:58 msgid "Directory: `tests/modules/procedures`" msgstr "" #: ../../doc/src/progress.md msgid "`Module functions`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`Module subroutines`" msgstr "" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t02.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`Nested subroutines`" msgstr "" #: ../../doc/src/progress.md msgid "[t03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t03.f90)" msgstr "" #: ../../doc/src/progress.md:67 msgid "Expressions" msgstr "" #: ../../doc/src/progress.md:69 msgid "Arithmetic Operations" msgstr "" #: ../../doc/src/progress.md:71 msgid "Directory: `tests/expressions/arit`" msgstr "" #: ../../doc/src/progress.md msgid "`+,-,*,/,**`" msgstr "" #: ../../doc/src/progress.md msgid "[basic_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/arit/basic_operations.f90)" msgstr "" #: ../../doc/src/progress.md:78 msgid "Integers" msgstr "" #: ../../doc/src/progress.md:80 msgid "Directory: `tests/expressions/integers`" msgstr "" #: ../../doc/src/progress.md msgid "`integers`" msgstr "" #: ../../doc/src/progress.md msgid "[integer_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/integer_kind.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`relational operations`" 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 "" #: ../../doc/src/progress.md msgid "`logical operations`" 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 "" #: ../../doc/src/progress.md:89 msgid "Real Numbers" msgstr "" #: ../../doc/src/progress.md:91 msgid "Directory: `tests/expressions/reals`" msgstr "" #: ../../doc/src/progress.md msgid "`single/double reals`" msgstr "" #: ../../doc/src/progress.md msgid "[real_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/real_kind.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`defined operator`" msgstr "" #: ../../doc/src/progress.md msgid "âŒ" 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 "" #: ../../doc/src/progress.md:99 msgid "Complex Numbers" msgstr "" #: ../../doc/src/progress.md:101 msgid "Directory: `tests/expressions/complex`" msgstr "" #: ../../doc/src/progress.md msgid "`single/double complex`" msgstr "" #: ../../doc/src/progress.md msgid "[complex_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/complex/complex_kind.f90)" msgstr "" #: ../../doc/src/progress.md:108 msgid "Strings" msgstr "" #: ../../doc/src/progress.md:110 msgid "Directory: `tests/expressions/character`" msgstr "" #: ../../doc/src/progress.md msgid "`character`" msgstr "" #: ../../doc/src/progress.md msgid "[t01_character.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t01_character.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`string concatenation`" 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 "" #: ../../doc/src/progress.md:118 msgid "Derived Types" msgstr "" #: ../../doc/src/progress.md:120 msgid "Directory: `tests/expressions/derived_type`" msgstr "" #: ../../doc/src/progress.md msgid "`basic derived types`" 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 "" #: ../../doc/src/progress.md:127 msgid "Statements" msgstr "" #: ../../doc/src/progress.md:129 msgid "Allocate Statement" msgstr "" #: ../../doc/src/progress.md:131 msgid "Directory: `tests/statements/allocate`" msgstr "" #: ../../doc/src/progress.md msgid "`allocate statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/allocate/t01.f90)" msgstr "" #: ../../doc/src/progress.md:138 msgid "Block Statement" msgstr "" #: ../../doc/src/progress.md:140 msgid "Directory: `tests/statements/block`" msgstr "" #: ../../doc/src/progress.md msgid "`block statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/block/t01.f90)" msgstr "" #: ../../doc/src/progress.md:147 msgid "Goto Statement" msgstr "" #: ../../doc/src/progress.md:149 msgid "Directory: `tests/statements/goto`" msgstr "" #: ../../doc/src/progress.md msgid "`computed go-to statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`go-to statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t02.f90)" msgstr "" #: ../../doc/src/progress.md:157 msgid "If Statement" msgstr "" #: ../../doc/src/progress.md:159 msgid "Directory: `tests/statements/if`" msgstr "" #: ../../doc/src/progress.md msgid "`Test .false.`" msgstr "" #: ../../doc/src/progress.md msgid "[if_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`single line if statement`" msgstr "" #: ../../doc/src/progress.md msgid "[if_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_02.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`multi line if statement`" msgstr "" #: ../../doc/src/progress.md msgid "[if_03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_03.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`nested if statements`" msgstr "" #: ../../doc/src/progress.md msgid "[if_04.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_04.f90)" msgstr "" #: ../../doc/src/progress.md:169 msgid "While Statement" msgstr "" #: ../../doc/src/progress.md:171 msgid "Directory: `tests/statements/while`" msgstr "" #: ../../doc/src/progress.md msgid "`Simple while loops`" msgstr "" #: ../../doc/src/progress.md msgid "[while_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`exit / cycle in while loops`" msgstr "" #: ../../doc/src/progress.md msgid "[while_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_02.f90)" msgstr "" #: ../../doc/src/progress.md:179 msgid "Print Statement" msgstr "" #: ../../doc/src/progress.md:181 msgid "Directory: `tests/statements/print`" msgstr "" #: ../../doc/src/progress.md msgid "`Basic print`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/print/t01.f90)" msgstr "" #: ../../doc/src/progress.md:188 msgid "Open, Read, Write, Close Statement" msgstr "" #: ../../doc/src/progress.md:190 msgid "Directory: `tests/statements/file_io`" msgstr "" #: ../../doc/src/progress.md msgid "`open/read/write/close`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/file_io/t01.f90)" msgstr "" #: ../../doc/src/progress.md:197 msgid "Intrinsic Functions" msgstr "" #: ../../doc/src/progress.md:199 msgid "abs" msgstr "" #: ../../doc/src/progress.md:201 msgid "Directory: `tests/intrinsic/abs`" msgstr "" #: ../../doc/src/progress.md msgid "`scalar single/double real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md msgid "`scalar single/double complex`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md msgid "`array 1D single/double real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:210 msgid "exp" msgstr "" #: ../../doc/src/progress.md:212 msgid "Directory: `tests/intrinsic/exp`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:221 msgid "log" msgstr "" #: ../../doc/src/progress.md:223 msgid "Directory: `tests/intrinsic/log`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:232 msgid "sqrt" msgstr "" #: ../../doc/src/progress.md:234 msgid "Directory: `tests/intrinsic/sqrt`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:243 msgid "sin" msgstr "" #: ../../doc/src/progress.md:245 msgid "Directory: `tests/intrinsic/sin`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:254 msgid "cos" msgstr "" #: ../../doc/src/progress.md:256 msgid "Directory: `tests/intrinsic/cos`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:265 msgid "tan" msgstr "" #: ../../doc/src/progress.md:267 msgid "Directory: `tests/intrinsic/tan`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:276 msgid "sinh" msgstr "" #: ../../doc/src/progress.md:278 msgid "Directory: `tests/intrinsic/sinh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:287 msgid "cosh" msgstr "" #: ../../doc/src/progress.md:289 msgid "Directory: `tests/intrinsic/cosh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:298 msgid "tanh" msgstr "" #: ../../doc/src/progress.md:300 msgid "Directory: `tests/intrinsic/tanh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:309 msgid "asin" msgstr "" #: ../../doc/src/progress.md:311 msgid "Directory: `tests/intrinsic/asin`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:320 msgid "acos" msgstr "" #: ../../doc/src/progress.md:322 msgid "Directory: `tests/intrinsic/acos`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:331 msgid "atan" msgstr "" #: ../../doc/src/progress.md:333 msgid "Directory: `tests/intrinsic/atan`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:342 msgid "modulo" msgstr "" #: ../../doc/src/progress.md:344 msgid "Directory: `tests/intrinsic/modulo`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:352 msgid "mod" msgstr "" #: ../../doc/src/progress.md:354 msgid "Directory: `tests/intrinsic/mod`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:362 msgid "min" msgstr "" #: ../../doc/src/progress.md:364 msgid "Directory: `tests/intrinsic/min`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:371 msgid "max" msgstr "" #: ../../doc/src/progress.md:373 msgid "Directory: `tests/intrinsic/max`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:380 msgid "int" msgstr "" #: ../../doc/src/progress.md:382 msgid "Directory: `tests/intrinsic/int`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:389 msgid "real" msgstr "" #: ../../doc/src/progress.md:391 msgid "Directory: `tests/intrinsic/real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:398 msgid "floor" msgstr "" #: ../../doc/src/progress.md:400 msgid "Directory: `tests/intrinsic/floor`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:407 msgid "nint" msgstr "" #: ../../doc/src/progress.md:409 msgid "Directory: `tests/intrinsic/nint`" 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 "" lfortran-0.63.0/doc/locale/de/0000775000175000017500000000000015174404631016214 5ustar alastairalastairlfortran-0.63.0/doc/locale/de/LC_MESSAGES/0000775000175000017500000000000015174404631020001 5ustar alastairalastairlfortran-0.63.0/doc/locale/de/LC_MESSAGES/docs.po0000664000175000017500000046667115174404631021315 0ustar alastairalastair# SOME DESCRIPTIVE TITLE. # Copyright (C) 2022 LFortran contributors # This file is distributed under the same license as the LFortran package. # FIRST AUTHOR , 2022. # msgid "" msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" "PO-Revision-Date: 2023-01-17 10:51+0000\n" "Last-Translator: Carl \n" "Language-Team: German \n" "Language: de\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.15.1-dev\n" "Generated-By: Babel 2.10.3\n" #: ../../doc/src/ast_and_asr.ipynb:9 msgid "Difference between an AST and ASR" msgstr "Unterschied zwischen AST und ASR" #: ../../doc/src/ast_and_asr.ipynb:11 msgid "Let us take a simple Fortran code:" msgstr "Nehmen wir einen einfachen Fortran-Code:" #: ../../doc/src/ast_and_asr.ipynb:22 msgid "and look at how the AST and ASR looks like." msgstr "und sehen uns an, wie der AST und die ASR aussehen." #: ../../doc/src/ast_and_asr.ipynb:25 ../../doc/src/progress.md msgid "AST" msgstr "AST" #: ../../doc/src/ast_and_asr.ipynb:76 msgid "" "The AST does not have any semantic information, but has nodes to " "represent declarations such as ``integer, intent(in) :: a``. Variables " "such as ``a`` are represented by a ``Name`` node, and are not connected " "to their declarations yet." msgstr "" "Der AST enthält keine semantischen Informationen, hat aber Knoten zur " "Darstellung von Deklarationen wie ``integer, intent(in) :: a``. Variablen " "wie ``a`` werden durch einen ``Name`` Knoten dargestellt und sind noch nicht " "mit ihren Deklarationen verbunden." #: ../../doc/src/ast_and_asr.ipynb:88 ../../doc/src/progress.md msgid "ASR" msgstr "ASR" #: ../../doc/src/ast_and_asr.ipynb:139 msgid "" "The ASR has all the semantic information (types, etc.), nodes like " "``Function`` have a symbol table and do not have any declaration nodes. " "Variables are simply pointers to the symbol table." msgstr "" "Die ASR enthält alle semantischen Informationen (Typen usw.), Knoten wie " "``Function`` haben eine Symboltabelle und keine Deklarationsknoten. " "Variablen sind einfach Zeiger auf die Symboltabelle." #: ../../doc/src/ast_and_asr.ipynb:142 msgid "Discussion" msgstr "Diskussion" #: ../../doc/src/ast_and_asr.ipynb:144 msgid "" "The above was a simple example. Things get more apparent for more " "complicated examples, such as:" msgstr "" "Das obige Beispiel war ein einfaches. Bei komplizierteren Beispielen, wie z. " "B. dem folgenden, werden die Dinge deutlicher:" #: ../../doc/src/ast_and_asr.ipynb:160 msgid "" "AST must represent all the ``use`` statements and the ``interface`` " "block, and keep things semantically consistent." msgstr "" "AST muss alle ``use`` Anweisungen und den ``interface`` Block repräsentieren " "und die Dinge semantisch konsistent halten." #: ../../doc/src/ast_and_asr.ipynb:162 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" " are defined in the ``gfort_interop`` module, and so ASR does not have " "any of these declaration nodes." msgstr "" "ASR hingegen verfolgt die ``c_desc1_int32``, ``c_desc1_t`` und " "``f2b_c_wrapper`` in der Symboltabelle und weiß, dass sie im Modul " "``gfort_interop`` definiert sind, so dass ASR keinen dieser " "Deklarationsknoten hat." #: ../../doc/src/ast_and_asr.ipynb:164 msgid "" "When converting from ASR to AST, LFortran will create all the appropriate" " AST declaration nodes automatically and correctly." msgstr "" "Bei der Konvertierung von ASR nach AST erstellt LFortran alle entsprechenden " "AST-Deklarationsknoten automatisch und korrekt." #: ../../doc/src/contributing.md:1 msgid "Contributing" msgstr "Beitragen" #: ../../doc/src/contributing.md:3 msgid "" "We welcome contributions from anyone, even if you are new to open source." " It might sound daunting to contribute to a compiler at first, but please" " do, it is not complicated. We will help you with any technical issues " "and help improve your contribution so that it can be merged." msgstr "" "Wir freuen uns über Beiträge von jedem, auch wenn du neu im Bereich Open " "Source bist. Es mag zunächst entmutigend klingen, zu einem Compiler " "beizutragen, aber tu es einfach, denn es ist nicht so kompliziert, wie es " "aussieht. Wir werden bei allen technischen Problemen helfen und deinen " "Beitrag verbessern, damit er eingefügt werden kann." #: ../../doc/src/contributing.md:8 msgid "Basic Setup" msgstr "Grundeinstellung" #: ../../doc/src/contributing.md:10 msgid "To contribute, make sure your set up:" msgstr "Um Beizutragen solltest du folgendes vorbereitet haben:" #: ../../doc/src/contributing.md:12 msgid "Your username + email" msgstr "Dein Benutzername + E-Mail" #: ../../doc/src/contributing.md:13 msgid "Your `~/.gitconfig`" msgstr "Deine `~/.gitconfig`" #: ../../doc/src/contributing.md:14 msgid "Your shell prompt to display the current branch name" msgstr "Deine Shell Eingabe sollte den aktuellen Branch Namen anzeigen" #: ../../doc/src/contributing.md:16 msgid "Fork LFortran" msgstr "LFortran abspalten" #: ../../doc/src/contributing.md:18 msgid "" "Step 1. Create a fork of the [project " "repository](https://github.com/lfortran/lfortran)" msgstr "" "Schritt 1. Erstelle einen Fork des [Projekt Repositorys](https://github.com/" "lfortran/lfortran)" #: ../../doc/src/contributing.md:20 msgid "" "Step 2. Set up your [SSH key](https://docs.github.com/en/authentication" "/connecting-to-github-with-ssh) with GitHub" msgstr "" "Schritt 2: Richte deinen [SSH key](https://docs.github.com/en/authentication/" "connecting-to-github-with-ssh) mit GitHub ein" #: ../../doc/src/contributing.md:22 msgid "" "Step 3. Clone the project repository from GitHub and set up your remote " "repository" msgstr "" "Schritt 3: Klone das Projekt Repository von GitHub und richte dein Remote-" "Repository ein" #: ../../doc/src/contributing.md:29 msgid "" ":fontawesome-solid-edit: `REMOTE_NAME` is the name of your remote " "repository and could be any name you like, for example your first name." msgstr "" ":fontawesome-solid-edit: `REMOTE_NAME` ist der Name deines Remote-" "Repositorys und kann prinzipiell beliebig sein, beispielsweise dein Vorname." #: ../../doc/src/contributing.md:31 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` ist deine Nutzer-ID auf GitHub und " "sollte Teil deines Accountpfades sein." #: ../../doc/src/contributing.md:33 msgid "" "You can use `git remote -v` to check if the new remote is set up " "correctly." msgstr "" "Du kannst `git remote -v` verwenden um zu überprüfen ob der neue Remote " "korrekt eingerichtet ist." #: ../../doc/src/contributing.md:35 msgid "Send a New Merge Request" msgstr "Sende einen neuen Merge request" #: ../../doc/src/contributing.md:37 msgid "Step 1. Create a new branch" msgstr "Schritt 1. Erstellen Sie einen neuen Zweig" #: ../../doc/src/contributing.md:42 msgid "Step 2. Make changes in relevant file(s)" msgstr "Schritt 2. Nehmen Sie Änderungen in der/den betreffenden Datei(en) vor" #: ../../doc/src/contributing.md:44 msgid "Step 3. Commit the changes:" msgstr "Schritt 3: Committe deine Änderungen:" #: ../../doc/src/contributing.md:51 msgid "" "[Here](https://chris.beams.io/posts/git-commit/) are some great tips on " "writing good commit messages." msgstr "" "[Hier](https://chris.beams.io/posts/git-commit/) gibt es sehr hilfreiche " "Tipps zum Schreiben guter Commit-Messages." #: ../../doc/src/contributing.md:53 msgid "Step 4. Check to ensure that your changes look good" msgstr "Schritt 4: Überprüfe, dass deine Änderungen gut aussehen" #: ../../doc/src/contributing.md:58 msgid "Step 5. Send the merge request" msgstr "Schritt 5: Sende den merge-request" #: ../../doc/src/contributing.md:64 msgid "" "The command will push the new branch `fix1` into your remote repository " "`REMOTE_NAME` that you created earlier. Additionally, it will also " "display a link that you can click on to open the new merge request. After" " clicking on the link, write a title and a concise description then click" " the \"Create\" button. Yay you are now all set." msgstr "" "Der Befehl pushed den neuen Branch `fix1` in dein remote Repository " "`REMOTE_NAME`, welches du zuvor erstellt hast. Zusätzlich wird ein Link " "angezeigt, welcher geklickt werden kann um einen neuen merge request zu " "starten. Nach dem Klicken, schreibe einen Titel und eine kurze Beschreibung, " "anschließend klicke auf den \"Create\"-Button. Du bist nun fertig." #: ../../doc/src/contributing.md:66 msgid "Add New Features" msgstr "Neue Funktionen hinzufügen" #: ../../doc/src/contributing.md:68 msgid "" "The example below shows the steps it would take to create a caret binary " "operator **^** which computes the average value of the two operands." msgstr "" "Das folgende Beispiel zeigt die Schritte die erforderlich sind um den " "binären Operator **^** zu erstellen, welcher den Mittelwert der beiden " "Operanden berechnet." #: ../../doc/src/contributing.md:70 msgid "Create New Token(s)" msgstr "Neue(s) Token erstellen" #: ../../doc/src/contributing.md:72 msgid "" "We extend the *tokenizer.re* as well as *parser.yy* to add the new token " "**^**. We also tell LFortran how to print the new token in *parser.cpp*." msgstr "" "Wir erweitern den *tokenizer.re* und den *parser.yy* um den Token **^**. Wir " "werden außerdem LFortran in *parser.cpp* sagen, wie der neue Token " "ausgegeben werden soll." #: ../../doc/src/contributing.md:75 msgid ":fontawesome-solid-code: *src/lfortran/parser/tokenizer.re*" msgstr ":fontawesome-solid-code: *src/lfortran/parser/tokenizer.re*" #: ../../doc/src/contributing.md:80 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.yy*" msgstr ":fontawesome-solid-code: *src/lfortran/parser/parser.yy*" #: ../../doc/src/contributing.md:85 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.cpp*" msgstr ":fontawesome-solid-code: *src/lfortran/parser/parser.cpp*" #: ../../doc/src/contributing.md:94 msgid "The added code is tested with `lfortran --show-tokens examples2/expr2.f90`" msgstr "" "Der hinzugefügte Code wird mit `lfortran --show-tokens examples2/expr2.f90` " "getestet" #: ../../doc/src/contributing.md:96 msgid "Parse the New Token" msgstr "Parsen des neuen Tokens" #: ../../doc/src/contributing.md:98 msgid "" "Now we have to parse the new operator. We add it to the AST by extending " "the BinOp with a caret operator and modifying the *AST.asdl* file. Then " "we add it in *parse.yy* to properly parse and generate the new AST in " "*semantics.h*.Finally we extend *pickle.cpp* so that the new operator can" " print itself." msgstr "" "Nun muss der neue Operator geparsed werden. Wir fügen ihn zum AST hinzu, " "indem wir den BinOp um den Caret-Operator erweitern und die *AST.asdl* -" "Datei anpassen. Anschließend fügen wir ihn in *parse.yy* hinzu um den neuen " "AST in *semantics.h* richtig zu parsen und zu generieren. Abschließend " "erweitern wir *pickle.cpp*, sodass der neue Operator sich selbst ausgeben " "kann." #: ../../doc/src/contributing.md:102 msgid ":fontawesome-solid-code:*grammar/AST.asdl*" msgstr ":fontawesome-solid-code:*grammar/AST.asdl*" #: ../../doc/src/contributing.md:107 msgid ":fontawesome-solid-code:*src/lfortran/parser/parser.yy*" msgstr ":fontawesome-solid-code:*src/lfortran/parser/parser.yy*" #: ../../doc/src/contributing.md:116 msgid ":fontawesome-solid-code:*src/lfortran/parser/semantics.h*" msgstr ":fontawesome-solid-code:*src/lfortran/parser/semantics.h*" #: ../../doc/src/contributing.md:121 msgid ":fontawesome-solid-code:*src/lfortran/pickle.cpp*" msgstr ":fontawesome-solid-code:*src/lfortran/pickle.cpp*" #: ../../doc/src/contributing.md:132 msgid "The section is tested with `lfortran --show-ast examples/expr2.f90`" msgstr "" "Der Abschnitt lässt sich mit `lfortran --show-ast examples/expr2.f90` testen" #: ../../doc/src/contributing.md:134 msgid "Implement the Semantics of the New Token" msgstr "Implementieren der Semantik des neuen Tokens" #: ../../doc/src/contributing.md:136 msgid "" "We first extend the ASR in *ASR.asdl* and add ^ as a BinOp operator " "option." msgstr "" "Zuerst erweitern wir den ASR in *ASR.asdl* und fügen ^ als eine BinOp-" "operator Option hinzu." #: ../../doc/src/contributing.md:138 msgid ":fontawesome-solid-code:*src/libasr/ASR.asdl*" msgstr ":fontawesome-solid-code:*src/libasr/ASR.asdl*" #: ../../doc/src/contributing.md:142 msgid ":fontawesome-solid-code:*src/lfortran/semantics/ast_common_visitor.h*" msgstr ":fontawesome-solid-code:*src/lfortran/semantics/ast_common_visitor.h*" #: ../../doc/src/contributing.md:179 msgid "" "Then we transform it from AST to ASR by extending " "*src/lfortran/semantics/ast_common_visitor.h*." msgstr "" "Anschließend wandeln wir ihn vom AST zum ASR um, indem wir *src/lfortran/" "semantics/ast_common_visitor.h* ergänzen." #: ../../doc/src/contributing.md:181 msgid "" "We also add it into compile time evaluation triggered by expressions such" " as `e = (2+3)^5` which is evaluated at compile time. An expression such " "as `e = x^5` is evaluated at run time only." msgstr "" "Zusätzlich fügen wir ihn in die \"Compile time evaluation\" hinzu, die durch " "Ausdrücke wie z.B. `e = (2+3)^5` ausgelöst wird. Ein Ausdruck wie " "beispielsweise `e = x^5` wird nur zur Laufzeit evaluiert." #: ../../doc/src/contributing.md:183 msgid "The section is tested with `lfortran --show-asr examples/expr2.f90`" msgstr "" "Dieser Abschnitt lässt sich mit `lfortran --show-asr examples/expr2.f90` " "testen" #: ../../doc/src/contributing.md:184 msgid "Implement the New Token in LLVM" msgstr "Implementierung des neuen Tokens in LLVM" #: ../../doc/src/contributing.md:186 msgid "" "To implement in LLVM, we extend the BinOp translation by handling the new" " operator. We first add the two numbers then divide by two. :fontawesome-" "solid-code:*src/lfortran/codegen/asr_to_llvm.cpp*" msgstr "" "Zur Implementierung in LLVM erweitern wir die BinOp-Übersetzung um die " "Verarbeitung des neuen Operators. Wir addieren im ersten Schritt die beiden " "Zahlen und dividieren diese anschließend durch zwei. :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 "" "Dieser Abschnitt lässt sich mit `lfortran --show-llvm examples/expr2.f90` " "testen" #: ../../doc/src/contributing.md:219 msgid "Now when LLVM works, we can test the final executable by:" msgstr "" "Wenn LLVM nun funktioniert, können wir die endgültige ausführbare Datei " "testen, indem wir:" #: ../../doc/src/contributing.md:224 msgid "And it should print 6." msgstr "Und es sollte 6 ausgegeben werden." #: ../../doc/src/contributing.md:226 msgid "It also works interactively:" msgstr "Es funktioniert auch interaktiv:" #: ../../doc/src/contributing.md:242 msgid "Reach Out" msgstr "Kontakt aufnehmen" #: ../../doc/src/contributing.md:244 msgid "" "If you have any questions or need help, please ask as at our " "[mailinglist](https://groups.io/g/lfortran) or a " "[chat](https://lfortran.zulipchat.com/)." msgstr "" "Wenn du Fragen hast oder Hilfe brauchst, wende dich bitte an unsere " "[Mailinglist](https://groups.io/g/lfortran) oder and den " "[Chat](https://lfortran.zulipchat.com/)." #: ../../doc/src/contributing.md:248 msgid "" "Please note that all participants of this project are expected to follow " "our Code of Conduct. By participating in this project you agree to abide " "by its terms. See " "[CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/blob/main/CODE_OF_CONDUCT.md)." msgstr "" "Bitte beachte, dass von allen Teilnehmern an diesem Projekt erwartet wird, " "dass sie unseren Verhaltenskodex befolgen. Mit der Teilnahme an diesem " "Projekt erklärst du dich damit einverstanden, diese Bedingungen einzuhalten. " "Siehe [CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/blob/main/" "CODE_OF_CONDUCT.md)." #: ../../doc/src/contributing.md:252 msgid "" "By submitting a PR you agree to license your contribution under the " "LFortran's BSD " "[license](https://github.com/lfortran/lfortran/blob/main/LICENSE) unless " "explicitly noted otherwise." msgstr "" "Durch das Einreichen eines Beitrags stimmst du der Lizenzierung deines " "Beitrags unter LFortrans BSD [Lizenz](https://github.com/lfortran/lfortran/" "blob/main/LICENSE) zu, es sei denn, es ist ausdrücklich anders vermerkt." #: ../../doc/src/design.md:1 msgid "LFortran Design" msgstr "LFortran-Design" #: ../../doc/src/design.md:3 msgid "High Level Overview" msgstr "Allgemeine Übersicht" #: ../../doc/src/design.md:5 ../../doc/src/developer_tutorial.ipynb:16 msgid "" "LFortran is structured around two independent modules, AST and ASR, both " "of which are standalone (completely independent of the rest of LFortran) " "and users are encouraged to use them independently for other applications" " and build tools on top:" msgstr "" "LFortran ist um zwei unabhängige Module herum aufgebaut, AST und ASR, die " "beide eigenständig sind (völlig unabhängig vom Rest von LFortran), und die " "Benutzer werden ermutigt, sie unabhängig für andere Anwendungen zu verwenden " "und darauf aufbauende Werkzeuge zu erstellen:" #: ../../doc/src/design.md:10 msgid "" "Abstract Syntax Tree (AST), module `lfortran.ast`: Represents any Fortran" " source code, strictly based on syntax, no semantic is included. The AST " "module can convert itself to Fortran source code." msgstr "" "Abstrakter Syntaxbaum (abstract syntax tree, AST), Modul `lfortran.ast`: " "Stellt einen beliebigen Fortran-Quellcode dar, der ausschließlich auf der " "Syntax basiert und keine Semantik enthält. Das AST-Modul kann sich selbst in " "Fortran-Quellcode umwandeln." #: ../../doc/src/design.md:14 msgid "" "Abstract Semantic Representation (ASR), module `lfortran.asr`: Represents" " a valid Fortran source code, all semantic is included. Invalid Fortran " "code is not allowed (an error will be given). The ASR module can convert " "itself to an AST." msgstr "" "Abstrakte semantische Repräsentation (abstract semantic representation, ASR)" ", Modul `lfortran.asr`: Stellt einen gültigen Fortran-Quellcode dar, die " "gesamte Semantik ist enthalten. Ungültiger Fortran-Code ist nicht erlaubt (" "es wird ein Fehler ausgegeben). Das ASR-Modul kann sich selbst in einen AST " "umwandeln." #: ../../doc/src/design.md:19 msgid "" "The LFortran compiler is then composed of the following independent " "stages:" msgstr "" "Der LFortran-Compiler setzt sich dann aus den folgenden unabhängigen Stufen " "zusammen:" #: ../../doc/src/design.md:21 msgid "Parsing: converts Fortran source code to an AST" msgstr "Parsing: Konvertiert Fortran-Quellcode in einen AST" #: ../../doc/src/design.md:22 msgid "Semantic: converts an AST to an ASR" msgstr "Semantisch: wandelt einen AST in eine ASR um" #: ../../doc/src/design.md:23 msgid "" "High level optimizations: optimize ASR to a possibly faster/simpler ASR " "(things like inlining functions, eliminating redundant expressions or " "statements, etc.)" msgstr "" "Optimierungen auf hoher Ebene: Optimierung der ASR zu einer möglicherweise " "schnelleren/einfacheren ASR (z. B. Inlining von Funktionen, Beseitigung " "redundanter Ausdrücke oder Anweisungen usw.)" #: ../../doc/src/design.md:26 msgid "" "LLVM IR code generation and lower level optimizations: converts an ASR to" " an LLVM IR. This stage also does all other optimizations that do not " "produce an ASR, but still make sense to do before passing to LLVM IR." msgstr "" "LLVM IR-Code-Generierung und Optimierungen auf niedrigerer Ebene: wandelt " "eine ASR in eine LLVM IR um. In dieser Phase werden auch alle anderen " "Optimierungen durchgeführt, die keine ASR erzeugen, aber dennoch sinnvoll " "sind, bevor sie an LLVM IR übergeben werden." #: ../../doc/src/design.md:29 msgid "" "Machine code generation: LLVM then does all its optimizations and " "generates machine code (such as a binary executable, a library, an object" " file, or it is loaded and executed using JIT as part of the interactive " "LFortran session or in a Jupyter kernel)." msgstr "" "Erzeugung von Maschinencode: LLVM führt dann alle Optimierungen durch und " "generiert Maschinencode (z. B. eine binäre ausführbare Datei, eine " "Bibliothek, eine Objektdatei, oder sie wird geladen und mit JIT als Teil der " "interaktiven LFortran-Sitzung oder in einem Jupyter-Kernel ausgeführt)." #: ../../doc/src/design.md:34 msgid "" "LFortran is structured as a library, and so one can for example use the " "parser to obtain an AST and do something with it, or one can then use the" " semantic analyzer to obtain ASR and do something with it. One can " "generate the ASR directly (e.g., from SymPy) and then either convert to " "AST and to a Fortran source code, or use LFortran to compile it to " "machine code directly. In other words, one can use LFortran to easily " "convert between the three equivalent representations:" msgstr "" "LFortran ist als Bibliothek strukturiert, und so kann man zum Beispiel den " "Parser verwenden, um einen AST zu erhalten und etwas damit zu tun, oder man " "kann dann den semantischen Analysator verwenden, um ASR zu erhalten und " "etwas damit zu tun. Man kann die ASR direkt generieren (z.B. aus SymPy) und " "dann entweder in AST und in einen Fortran-Quellcode konvertieren oder " "LFortran verwenden, um sie direkt in Maschinencode zu kompilieren. Mit " "anderen Worten, man kann LFortran verwenden, um einfach zwischen den drei " "äquivalenten Darstellungen zu konvertieren:" #: ../../doc/src/design.md:42 msgid "Fortran source code" msgstr "Fortran-Quellcode" #: ../../doc/src/design.md:43 ../../doc/src/developer_tutorial.ipynb:23 msgid "Abstract Syntax Tree (AST)" msgstr "Abstrakter Syntaxbaum (AST)" #: ../../doc/src/design.md:44 ../../doc/src/developer_tutorial.ipynb:159 msgid "Abstract Semantic Representation (ASR)" msgstr "Abstrakte semantische Repräsentation (ASR)" #: ../../doc/src/design.md:46 msgid "They are all equivalent in the following sense:" msgstr "Sie sind alle im folgenden Sinne gleichwertig:" #: ../../doc/src/design.md:48 msgid "Any ASR can always be converted to an equivalent AST" msgstr "Jeder ASR kann jederzeit in einen entsprechenden AST umgewandelt werden" #: ../../doc/src/design.md:49 msgid "Any AST can always be converted to an equivalent Fortran source code" msgstr "" "Jeder AST kann jederzeit in einen entsprechenden Fortran-Quellcode " "konvertiert werden" #: ../../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 "" "Jeglicher Fortran-Quellcode kann immer entweder in einen äquivalenten AST " "konvertiert werden oder man bekommt einen Syntaxfehler" #: ../../doc/src/design.md:52 msgid "" "Any AST can always be either converted to an equivalent ASR or one gets a" " semantic error" msgstr "" "Jeder AST kann immer entweder in einen äquivalenten ASR umgewandelt werden " "oder man erhält einen semantischen Fehler" #: ../../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 "" "Wenn also eine Konvertierung möglich ist, sind sie gleichwertig, und die " "Konvertierung kann immer durchgeführt werden, es sei denn, der Code ist " "ungültig." #: ../../doc/src/design.md:58 msgid "ASR Design Details" msgstr "Details zum ASR-Design" #: ../../doc/src/design.md:60 msgid "The ASR is designed to have the following features:" msgstr "Die ASR ist mit den folgenden Merkmalen ausgestattet:" #: ../../doc/src/design.md:62 msgid "" "ASR is still semantically equivalent to the original Fortran code (it did" " not lose any semantic information). ASR can be converted to AST, and AST" " to Fortran source code which is functionally equivalent to the original." msgstr "" "ASR ist immer noch semantisch äquivalent zum ursprünglichen Fortran-Code (" "und hat keine semantischen Informationen verloren). ASR kann in AST und AST " "in Fortran-Quellcode konvertiert werden, welcher funktional dem Original " "entspricht." #: ../../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 "" "Die ASR ist so einfach wie möglich: sie enthält keine Informationen, die " "nicht aus der ASR abgeleitet werden könnten." #: ../../doc/src/design.md:69 msgid "" "The ASR C++ classes (down the road) are designed similarly to SymEngine: " "they are constructed once and after that they are immutable. The " "constructor checks in Debug more that all the requirements are met (e.g.," " that all Variables in a Function have a dummy argument set, that " "explicit-shape arrays are not allocatable and all other Fortran " "requirements to make it a valid code), but in Release mode it quickly " "constructs the class without checks. Then there are builder classes that " "construct the ASR C++ classes to meet requirements (checked in Debug " "mode) and the builder gives an error message if a code is not a valid " "Fortran code, and if it doesn't give an error message, then the ASR C++ " "classes are constructed correctly. Thus by construction, the ASR classes " "always contain valid Fortran code and the rest of LFortran can depend on " "it." msgstr "" "Die ASR C++-Klassen (in Zukunft) sind ähnlich wie die SymEngine konzipiert: " "Sie werden einmal konstruiert und sind danach unveränderlich. Der " "Konstruktor prüft im Debug-Modus eher, ob alle Anforderungen erfüllt sind (" "z.B., dass alle Variablen in einer Funktion ein Dummy-Argument haben, dass " "explizite Arrays nicht zuweisbar sind und alle anderen Fortran-" "Anforderungen, um es zu einem gültigen Code zu machen), aber im Release-" "Modus konstruiert er die Klasse schnell und ohne Prüfungen. Dann gibt es " "Builder-Klassen, die die ASR-C++-Klassen so konstruieren, dass sie die " "Anforderungen erfüllen (die im Debug-Modus überprüft werden), und der " "Builder gibt eine Fehlermeldung aus, wenn ein Code kein gültiger Fortran-" "Code ist, und wenn er keine Fehlermeldung ausgibt, dann sind die ASR-C++-" "Klassen korrekt konstruiert. Somit enthalten die ASR-Klassen " "konstruktionsbedingt immer gültigen Fortran-Code und der Rest von LFortran " "kann davon abhängen." #: ../../doc/src/design.md:82 msgid "Notes:" msgstr "Anmerkungen:" #: ../../doc/src/design.md:84 msgid "" "Information that is lost when parsing source to AST: whitespace, " "multiline/single line if statement distinction, case sensitivity of " "keywords." msgstr "" "Informationen, die beim Parsen des Quelltextes in den AST verloren gehen: " "Leerzeichen, Unterscheidung zwischen mehrzeiligen und einzeiligen if-" "Anweisungen, Groß- und Kleinschreibung von Schlüsselwörtern." #: ../../doc/src/design.md:87 msgid "" "Information that is lost when going from AST to ASR: detailed syntax how " "variables were defined and the order of type attributes (whether array " "dimension is using the `dimension` attribute, or parentheses at the " "variable; or how many variables there are per declaration line or their " "order), as ASR only represents the aggregated type information in the " "symbol table." msgstr "" "Informationen, die beim Übergang von AST zu ASR verloren gehen: detaillierte " "Syntax, wie Variablen definiert wurden, und die Reihenfolge der Typattribute " "(ob die Arraydimension das Attribut `dimension` oder Klammern bei der " "Variablen verwendet; oder wie viele Variablen es pro Deklarationszeile gibt " "oder ihre Reihenfolge), da ASR nur die aggregierten Typinformationen in der " "Symboltabelle darstellt." #: ../../doc/src/design.md:90 msgid "" "ASR is the simplest way to generate Fortran code, as one does not have to" " worry about the detailed syntax (as in AST) about how and where things " "are declared. One specifies the symbol table for a module, then for each " "symbol (functions, global variables, types, ...) one specifies the local " "variables and if this is an interface then one needs to specify where one" " can find an implementation, otherwise a body is supplied with " "statements, those nodes are almost the same as in AST, except that each " "variable is just a reference to a symbol in the symbol table (so by " "construction one cannot have undefined variables). The symbol table for " "each node such as Function or Module also references its parent (for " "example a function references a module, a module references the global " "scope)." msgstr "" "ASR ist der einfachste Weg, Fortran-Code zu erzeugen, da man sich nicht um " "die detaillierte Syntax (wie in AST) kümmern muss, wie und wo Dinge " "deklariert werden. Man spezifiziert die Symboltabelle für ein Modul, dann " "gibt man für jedes Symbol (Funktionen, globale Variablen, Typen, ...) die " "lokalen Variablen an, und wenn es sich um ein Interface handelt, muss man " "angeben, wo man eine Implementierung finden kann, andernfalls wird ein Body " "mit Statements bereitgestellt, diese Knoten sind fast die gleichen wie in " "AST, außer dass jede Variable nur ein Verweis auf ein Symbol in der " "Symboltabelle ist (also kann man konstruktionsbedingt keine undefinierten " "Variablen haben). Die Symboltabelle für jeden Knoten, wie z. B. Funktion " "oder Modul, verweist auch auf seine Eltern (z. B. verweist eine Funktion auf " "ein Modul, ein Modul auf den globalen Bereich)." #: ../../doc/src/design.md:102 msgid "" "The ASR can be directly converted to an AST without gathering any other " "information. And the AST directly to Fortran source code." msgstr "" "Der ASR kann direkt in einen AST umgewandelt werden, ohne dass weitere " "Informationen erfasst werden müssen. Und der AST direkt in Fortran-Quellcode." #: ../../doc/src/design.md:105 msgid "" "The ASR is always representing a semantically valid Fortran code. This " "is enforced by checks in the ASR C++ constructors (in Debug build). When " "an ASR is used, one can assume it is valid." msgstr "" "Die ASR stellt immer einen semantisch gültigen Fortran-Code dar. Dies wird " "durch Überprüfungen in den ASR-C++-Konstruktoren (im Debug-Build) erzwungen. " "Wenn eine ASR eingesetzt wird, kann man davon ausgehen, dass sie gültig ist." #: ../../doc/src/design.md:109 msgid "Fortran 2008" msgstr "Fortran 2008" #: ../../doc/src/design.md:111 msgid "" "Fortran 2008 [standard](https://j3-fortran.org/doc/year/10/10-007.pdf) " "chapter 2 \"Fortran concepts\" specifies that Fortran code is a " "collection of _program units_ (either all in one file, or in separate " "files), where each _program unit_ is one of:" msgstr "" "Fortran 2008 [Standard](https://j3-fortran.org/doc/year/10/10-007.pdf) " "Kapitel 2 \"Fortran concepts\" left fest, dass Fortran Code eine Sammlung " "aus _program units_ ist. (entweder alle in einer Datei oder in separaten " "Dateien), wobei jede _program unit_ eine der folgenden ist:" #: ../../doc/src/design.md:116 ../../doc/src/design.md:131 msgid "main program" msgstr "Hauptprogramm (main program)" #: ../../doc/src/design.md:117 ../../doc/src/design.md:132 msgid "module or submodule" msgstr "Modul oder Submodul" #: ../../doc/src/design.md:118 ../../doc/src/design.md:133 msgid "function or subroutine" msgstr "Funktion oder Subroutine" #: ../../doc/src/design.md:120 msgid "" "Note: It can also be a _block data_ program unit, that is used to provide" " initial values for data objects in named _common blocks_, but we do not " "recommend the use of _common blocks_ (use modules instead)." msgstr "" "Beachte: Es kann auch eine _block data_-Programmeinheit sein, die verwendet " "wird, um Anfangswerte für Datenobjekte in benannten _common blocks_ " "bereitzustellen, aber wir empfehlen die Verwendung von _common blocks_ nicht " "(verwende stattdessen Module)." #: ../../doc/src/design.md:124 msgid "LFortran Extension" msgstr "LFortran-Erweiterung" #: ../../doc/src/design.md:126 msgid "" "We extend the Fortran language by introducing a _global scope_, which is " "not only the list of _program units_ (as in F2008) but can also include " "statements, declarations, use statements and expressions. We define " "_global scope_ as a collection of the following items:" msgstr "" "Wir erweitern die Fortran-Sprache, indem wir einen _global scope_, welcher " "nicht nur die Liste der _program units_ (wie in F2008) ist, sondern auch " "include-Anweisungen, Deklarationen, use-Anweisungen und Ausdrücke enthalten " "kann.Wir definieren den _global scope_ als eine Sammlung der folgenden " "Elemente:" #: ../../doc/src/design.md:134 msgid "use statement" msgstr "use Statement" #: ../../doc/src/design.md:135 msgid "declaration" msgstr "Deklarationen (declaration)" #: ../../doc/src/design.md:136 msgid "statement" msgstr "Anweisung (statement)" #: ../../doc/src/design.md:137 msgid "expression" msgstr "Ausdruck (expression)" #: ../../doc/src/design.md:139 msgid "" "In addition, if a variable is not defined in an assignment statement " "(such as `x = 5+3`) then the type of the variable is inferred from the " "right hand side (e.g., `x` in `x = 5+3` would be of type `integer`, and " "`y` in `y = 5._dp` would be of type `real(dp)`). This rule only applies " "at the top level of _global scope_. Types must be fully specified inside " "main programs, modules, functions and subroutines, just like in F2008." msgstr "" "Zusätzlich wird, wenn eine Variable in einer Zuweisung (wie beispielsweise `" "x = 5+3`) nicht definiert ist, der Typ der Variablen aus der rechten Seite " "abgeleitet (z. B. wäre `x` in `x = 5+3` vom Typ `integer` und `y` in `y = 5." "_dp` vom Typ `real(dp)`). Diese Regel gilt nur auf der obersten Ebene des " "_global scope_. Innerhalb von Hauptprogrammen, Modulen, Funktionen und " "Unterprogrammen müssen die Typen vollständig angegeben werden, genau wie in " "F2008." #: ../../doc/src/design.md:146 msgid "" "The _global scope_ has its own symbol table. The main program and " "module/submodule do not see any symbols from this symbol table. But " "functions, subroutines, statements and expressions at the top level of " "_global scope_ use and operate on this symbol table." msgstr "" "Der _global scope_ hat seine eigene Symboltabelle. Das Hauptprogramm und das " "Modul/Submodul sehen keine Symbole aus dieser Symboltabelle. Aber " "Funktionen, Unterprogramme, Anweisungen und Ausdrücke auf der obersten Ebene " "des _global scope_ verwenden und operieren mit dieser Symboltabelle." #: ../../doc/src/design.md:151 msgid "" "The _global scope_ has the following symbols predefined in the symbol " "table:" msgstr "" "Für den _global scope_ sind die folgenden Symbole in der Symboltabelle " "vordefiniert:" #: ../../doc/src/design.md:153 msgid "" "the usual standard set of Fortran functions (such as `size`, `sin`, " "`cos`, ...)" msgstr "" "den üblichen Standardsatz von Fortran-Funktionen (wie `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 "" "das Symbol `dp` für doppelte Genauigkeit, so dass man `5._dp` für doppelte " "Genauigkeit verwenden kann." #: ../../doc/src/design.md:158 msgid "" "Each item in the _global scope_ is interpreted as follows: main program " "is compiled into an executable with the same name and executed; modules, " "functions and subroutines are compiled and loaded; use statement and " "declaration adds those symbols with the proper type into the _global " "scope_ symbol table, but do not generate any code; statement is wrapped " "into an anonymous subroutine with no arguments, compiled, loaded and " "executed; expression is wrapped into an anonymous function with no " "arguments returning the expression, compiled, loaded, executed and the " "return value is returned to the user." msgstr "" "Jedes Element im _global scope_ wird wie folgt interpretiert: Das " "Hauptprogramm wird in eine ausführbare Datei mit demselben Namen kompiliert " "und ausgeführt; Module, Funktionen und Unterprogramme werden kompiliert und " "geladen; use-Anweisungen und Deklarationen fügen die Symbole mit dem " "richtigen Typ in die Symboltabelle des _global scope_ ein, erzeugen aber " "keinen Code; Anweisungen werden in eine anonyme Unterroutine ohne Argumente " "übertragen, kompiliert, geladen und ausgeführt; Ausdrücke werden in eine " "anonyme Funktion, die den ursprünglichen Ausdruck zurückgibt, ohne Argumente " "übertragen kompiliert, geladen, ausgeführt und der Rückgabewert wird an den " "Benutzer zurückgegeben." #: ../../doc/src/design.md:168 msgid "" "The _global scope_ is always interpreted, item by item, per the previous " "paragraph. It is meant to allow interactive usage, experimentations and " "writing simple scripts. Code in _global scope_ must be interpreted using " "`lfortran`. For more complex (production) code it is recommended to turn " "it into modules and programs (by wrapping loose statements into " "subroutines or functions and by adding type declarations) and compile it " "with `lfortran` or any other Fortran compiler." msgstr "" "Der _global scope_ wird immer Element für Element interpretiert, wie im " "vorherigen Absatz beschrieben. Er ist dazu gedacht, interaktive Nutzung, " "Experimente und das Schreiben einfacher Skripte zu ermöglichen. Code im " "_global scope_ muss mit `lfortran` interpretiert werden. Für komplexeren " "(produktiven) Code wird empfohlen, ihn in Module und Programme umzuwandeln (" "indem man lose Anweisungen in Unterprogramme oder Funktionen umwandelt und " "Typdeklarationen hinzufügt) und ihn mit `lfortran` oder einem anderen " "Fortran-Compiler zu kompilieren." #: ../../doc/src/design.md:176 msgid "Here are some examples of valid code in _global scope_:" msgstr "Hier sind einige Beispiele für gültigen Code im _global scope_:" #: ../../doc/src/design.md:178 msgid "Example 1" msgstr "Beispiel 1" #: ../../doc/src/design.md:185 msgid "Example 2" msgstr "Beispiel 2" #: ../../doc/src/design.md:197 msgid "Example 3" msgstr "Beispiel 3" #: ../../doc/src/design.md:209 msgid "Example 4" msgstr "Beispiel 4" #: ../../doc/src/design.md:217 msgid "Design Considerations" msgstr "Design Entscheidungen" #: ../../doc/src/design.md:219 msgid "" "The LFortran extension of Fortran was chosen in a way so as to minimize " "the number of changes. In particular, only the top level of the _global " "scope_ has relaxed some of the Fortran rules (such as making specifying " "types optional) so as to allow simple and quick interactive usage, but " "inside functions, subroutines, modules or programs this relaxation does " "not apply." msgstr "" "Die LFortran-Erweiterung von Fortran wurde so gewählt, dass die Zahl der " "Änderungen möglichst gering ist. Insbesondere wurden nur auf der obersten " "Ebene des _global scope_ einige der Fortran-Regeln gelockert (z.B. die " "optionale Angabe von Typen), um eine einfache und schnelle interaktive " "Nutzung zu ermöglichen." #: ../../doc/src/design.md:225 msgid "" "The number of changes were kept to minimum in order to make it " "straightforward to turn code at _global scope_ into standard compliant " "Fortran code using programs and modules, so that it can be compiled by " "any Fortran compiler." msgstr "" "Die Anzahl der Änderungen wurde so gering wie möglich gehalten, um die " "Umwandlung von _global scope_-Code in standardkonformen Fortran-Code mit " "Hilfe von Programmen und Modulen so einfach wie möglich zu gestalten, so " "dass er von jedem Fortran-Compiler kompiliert werden kann." #: ../../doc/src/developer_tutorial.ipynb:9 msgid "Developer Tutorial" msgstr "Tutorial für Entwickler" #: ../../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 "" "Dies ist ein Tutorial für alle, die entweder LFortran entwickeln oder darauf " "aufbauende Werkzeuge erstellen wollen." #: ../../doc/src/developer_tutorial.ipynb:14 msgid "Introduction" msgstr "Einführung" #: ../../doc/src/developer_tutorial.ipynb:18 msgid "" "Abstract Syntax Tree (AST): Represents any Fortran source code, strictly " "based on syntax, no semantic is included. The AST module can convert " "itself to Fortran source code." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:20 msgid "" "Abstract Semantic Representation (ASR): Represents a valid Fortran source" " code, all semantic is included. Invalid Fortran code is not allowed (an " "error will be given). The ASR module can convert itself to an AST." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:25 msgid "" "Fortran source code can be parsed into an AST using the ``src_to_ast()`` " "function:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:49 #, python-format msgid "We can pretty print it using the ``%%showast`` magic:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:98 #, python-format msgid "We can convert AST to Fortran source code using ``%%showfmt``:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:156 msgid "" "All AST nodes and their arguments are described in `AST.asdl " "`__." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:170 #, python-format msgid "We can pretty print using the ``%%showasr`` magic:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:219 msgid "" "All ASR nodes and their arguments are described in `ASR.asdl " "`__." msgstr "" #: ../../doc/src/index.md:134 msgid "Getting started" msgstr "Erste Schritte" #: ../../doc/src/index.md:141 ../../doc/src/progress.md:1 msgid "LFortran Development Status" msgstr "" #: ../../doc/src/index.md:147 msgid "Developer's Guide" msgstr "" #: ../../doc/src/index.md:156 msgid "LFortran Intrinsics" msgstr "" #: ../../doc/src/index.md:1 msgid "LFortran Documentation" msgstr "" #: ../../doc/src/index.md:3 msgid "" "LFortran is a modern open-source (BSD licensed) interactive Fortran " "compiler built on top of LLVM. It can execute user's code interactively " "to allow exploratory work (much like Python, MATLAB or Julia) as well as " "compile to binaries with the goal to run user's code on modern " "architectures such as multi-core CPUs and GPUs." msgstr "" #: ../../doc/src/index.md:9 #, python-format msgid "" "Website: [https://lfortran.org/](https://lfortran.org/) Main " "repository: " "[https://github.com/lfortran/lfortran](https://github.com/lfortran/lfortran)" " Try online using Binder: " "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb)" msgstr "" #: ../../doc/src/index.md:9 msgid "Binder" msgstr "" #: ../../doc/src/index.md:16 msgid "Feature Highlights" msgstr "" #: ../../doc/src/index.md:18 msgid "" "LFortran is in development, there are features that work today, and there" " are features that are being implemented. You can also check out the " "[Development Status](progress.md) section for more information on " "features being supported and being worked on." msgstr "" #: ../../doc/src/index.md:21 msgid "Works today" msgstr "" #: ../../doc/src/index.md:23 #, python-format msgid "" "**Interactive, Jupyter support** LFortran can be used from Jupyter as a" " Fortran kernel, allowing a Python/Julia style rapid prototyping and " "exploratory workflow (see the " "[static](https://nbviewer.jupyter.org/gist/certik/f1d28a486510810d824869ab0c491b1c)" " or [interactive](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb) example notebook). Or " "it can be used from the command-line in an interactive prompt (REPL)." msgstr "" #: ../../doc/src/index.md:32 msgid "" "**Clean, modular design, usable as a library** LFortran is structured " "around two independent modules, AST and ASR, both of which are " "standalone (completely independent of the rest of LFortran) and users " "are encouraged to use them independently for other applications and " "build tools on top. See the [Design](design.md) and [Developer " "Tutorial](developer_tutorial.md) documents for more details." msgstr "" #: ../../doc/src/index.md:39 msgid "" "**Interoperation with GFortran** LFortran can parse GFortran module " "files into an ASR and generate a Fortran wrapper that can be compiled " "with any Fortran compiler and linked with the original GFortran " "compiled module." msgstr "" #: ../../doc/src/index.md:44 msgid "" "**Create executables** It can create executables just like other " "Fortran compilers." msgstr "" #: ../../doc/src/index.md:47 msgid "" "**Runs on Linux, Mac and Windows** All three platforms are regularly " "tested by our CI." msgstr "" #: ../../doc/src/index.md:51 msgid "Planned" msgstr "" #: ../../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 "" #: ../../doc/src/index.md:56 msgid "" "**Native interoperation with other languages (and other Fortran " "compilers)** It can automatically call code written in other languages " "(such as C or Python) just by using the `use` statement, see " "[#44](https://gitlab.com/lfortran/lfortran/issues/44). It understands " "other Fortran compilers module files (one can just \"use\" them) and " "their ABI to link correctly (GFortran is supported, other compilers are" " planned, see [#56](https://gitlab.com/lfortran/lfortran/issues/56)), " "which allows to use LFortran with production codes today." msgstr "" #: ../../doc/src/index.md:65 msgid "" "**Modern hardware support** Thanks to LLVM, the goal of LFortran is to " "run on modern hardware and take advantage of native Fortran language " "constructs (such as `do concurrent`) to run on multi-core CPUs and " "GPUs, see [#57](https://gitlab.com/lfortran/lfortran/issues/57)." msgstr "" #: ../../doc/src/index.md:71 msgid "" "**Full Fortran 2018 support** Currently only a subset of Fortran is " "implemented, but the goal is to have a full implementation of the " "latest Fortran 2018 standard, see " "[#58](https://gitlab.com/lfortran/lfortran/issues/58)." msgstr "" #: ../../doc/src/index.md:77 msgid "" "Please vote on issues in our [issue " "tracker](https://gitlab.com/lfortran/lfortran/issues) that you want us to" " prioritize (feel free to create new ones if we are missing anything)." msgstr "" #: ../../doc/src/index.md:81 msgid "Roadmap" msgstr "" #: ../../doc/src/index.md:83 msgid "Here is our roadmap how to get all the planned features above implemented:" msgstr "" #: ../../doc/src/index.md:85 msgid "" "Port code generation to use ASR and pass all the current tests " "([#74](https://gitlab.com/lfortran/lfortran/issues/74)). Remove the old " "code generation and old semantics, that used to annotate the AST tree, " "which was messy." msgstr "" #: ../../doc/src/index.md:89 msgid "" "Get GFortran module files working with `use` module, both assumed-size " "and assumed-shape arrays " "([#52](https://gitlab.com/lfortran/lfortran/issues/52)). This will allow " "right away to use production codes with LFortran." msgstr "" #: ../../doc/src/index.md:93 msgid "Do these at the same time:" msgstr "" #: ../../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 "" #: ../../doc/src/index.md:98 msgid "" "b) Gradually move to C++ for robustness and speed " "([#70](https://gitlab.com/lfortran/lfortran/issues/70)). The Python API " "will not change (or only minimally), so the user experience from Python " "will not change." msgstr "" #: ../../doc/src/index.md:103 msgid "" "c) Implement all the other cool features: `use` module for C and Python " "and automatic wrappers " "([#44](https://gitlab.com/lfortran/lfortran/issues/44)), modern hardware" " support ([#57](https://gitlab.com/lfortran/lfortran/issues/57)), " "generating an older standard of Fortran " "([#72](https://gitlab.com/lfortran/lfortran/issues/72)), Fortran doctest" " feature ([#73](https://gitlab.com/lfortran/lfortran/issues/73)), SymPy" " integration ([#71](https://gitlab.com/lfortran/lfortran/issues/71)), " "language service for IDEs " "([#12](https://gitlab.com/lfortran/lfortran/issues/12)), and other ideas" " ([#29](https://gitlab.com/lfortran/lfortran/issues/29))." msgstr "" #: ../../doc/src/index.md:118 msgid "The step 1. is an internal refactoring that will not take long." msgstr "" #: ../../doc/src/index.md:120 msgid "" "The step 2. will allow LFortran to be used interactively with production " "codes right away (the production code will get compiled with GFortran, " "then one \"uses\" any module in LFortran and functions/subroutines can be" " interactively called, the module itself can use any GFortran supported " "feature, but the API must fit into the subset that LFortran understands " "--- for large number of applications simple functions/subroutines with " "array arguments are enough). This will make LFortran usable for first " "users and one can always use GFortran temporarily until LFortran supports" " the given feature. We expect to be finished with the step 2. by the end " "of summer 2019, hopefully sooner." msgstr "" #: ../../doc/src/index.md:130 msgid "" "Finally the step 3. will improve LFortran overall, allowing the first " "users to contribute back, growing the community and making LFortran " "gradually useful for more and more people." msgstr "" #: ../../doc/src/installation.md:1 msgid "Installation" msgstr "" #: ../../doc/src/installation.md:3 msgid "All the instructions below work on Linux, macOS and Windows." msgstr "" #: ../../doc/src/installation.md:5 msgid "Binaries" msgstr "" #: ../../doc/src/installation.md:7 msgid "" "The recommended way to install LFortran is using Conda. Install Conda for" " example by installing the " "[Miniconda](https://conda.io/en/latest/miniconda.html) installation by " "following instructions there for your platform. Then create a new " "environment (you can choose any name, here we chose `lf`) and activate " "it:" msgstr "" #: ../../doc/src/installation.md:16 msgid "Then install LFortran by:" msgstr "" #: ../../doc/src/installation.md:20 msgid "" "Now the `lf` environment has the `lfortran` compiler available, you can " "start the interactive prompt by executing `lfortran`, or see the command " "line options using `lfortran -h`." msgstr "" #: ../../doc/src/installation.md:24 msgid "" "The Jupyter kernel is automatically installed by the above command, so " "after installing Jupyter itself:" msgstr "" #: ../../doc/src/installation.md:28 msgid "You can create a Fortran based Jupyter notebook by executing:" msgstr "" #: ../../doc/src/installation.md:32 msgid "and selecting `New->Fortran`." msgstr "" #: ../../doc/src/installation.md:35 msgid "Build From a Source Tarball" msgstr "" #: ../../doc/src/installation.md:37 msgid "" "This method is the recommended method if you just want to install " "LFortran, either yourself or in a package manager (Spack, Conda, Debian, " "etc.). The source tarball has all the generated files included and has " "minimal dependencies." msgstr "" #: ../../doc/src/installation.md:39 msgid "First we have to install dependencies, for example using Conda:" msgstr "" #: ../../doc/src/installation.md:44 msgid "" "Then download a tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), e.g.:" msgstr "" #: ../../doc/src/installation.md:52 msgid "And build:" msgstr "" #: ../../doc/src/installation.md:58 msgid "This will install the `lfortran` into the `inst/bin`." msgstr "" #: ../../doc/src/installation.md:60 msgid "Build From Git" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/installation.md:72 msgid "Then prepare the environment:" msgstr "" #: ../../doc/src/installation.md:77 msgid "Clone the LFortran git repository:" msgstr "" #: ../../doc/src/installation.md:82 msgid "" "Generate files that are needed for the build (this step depends on " "`re2c`, `bison` and `python`):" msgstr "" #: ../../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 "" #: ../../doc/src/installation.md:92 msgid "Run tests:" msgstr "" #: ../../doc/src/installation.md:97 msgid "Run an interactive prompt:" msgstr "" #: ../../doc/src/installation.md:102 msgid "Build from Git on Windows with Visual Studio" msgstr "" #: ../../doc/src/installation.md:104 msgid "" "Install Visual Studio (MSVC), for example the version 2022, you can " "download the Community version for free from: " "https://visualstudio.microsoft.com/downloads/." msgstr "" #: ../../doc/src/installation.md:107 msgid "" "Install miniforge using the Windows installer from https://github.com" "/conda-forge/miniforge." msgstr "" #: ../../doc/src/installation.md:109 msgid "Launch the Miniforge Prompt from the Desktop." msgstr "" #: ../../doc/src/installation.md:111 msgid "In the shell, initialize the MSVC compiler using:" msgstr "" #: ../../doc/src/installation.md:117 msgid "You can optionally test that MSVC works by:" msgstr "" #: ../../doc/src/installation.md:122 msgid "Both commands must print help (several pages)." msgstr "" #: ../../doc/src/installation.md:124 msgid "Now you can download and build LFortran:" msgstr "" #: ../../doc/src/installation.md:134 msgid "If everything compiled, then you can use LFortran as follows:" msgstr "" #: ../../doc/src/installation.md:140 msgid "And so on." msgstr "" #: ../../doc/src/installation.md:142 msgid "" "Note: LFortran currently uses the MSVC's linker program (`link`), which " "is only available when the MSVC bat script above is ran. If you forget to" " activate it, LFortran's linking will fail." msgstr "" #: ../../doc/src/installation.md:146 msgid "" "Note: the miniforge shell seems to be running some version of `git-bash` " "(although it is `cmd.exe`), which has some unix-like filesystem mounted " "in `/usr` and several commands available such as `ls`, `which`, `git`, " "`vim`. For this reason the Conda build `environment_win.yml` contains " "everything needed, including `git`." msgstr "" #: ../../doc/src/installation.md:152 msgid "Build from Git on Windows with WSL" msgstr "" #: ../../doc/src/installation.md:153 msgid "In windows search \"turn windows features on or off\"." msgstr "" #: ../../doc/src/installation.md:154 msgid "Tick Windows subsystem for Linux." msgstr "" #: ../../doc/src/installation.md:155 msgid "Press OK and restart computer." msgstr "" #: ../../doc/src/installation.md:156 msgid "Go to Microsoft store and download Ubuntu 20.04, and launch it." msgstr "" #: ../../doc/src/installation.md:157 msgid "Run the following commands." msgstr "" #: ../../doc/src/installation.md:164 msgid "Now do the following to configure the path" msgstr "" #: ../../doc/src/installation.md:168 msgid "Then go to the bottom of the file and paste the following" msgstr "" #: ../../doc/src/installation.md:172 msgid "Then press ctrl + O (save), Enter (confirm), ctrl + X (exit)" msgstr "" #: ../../doc/src/installation.md:173 msgid "After that restart Ubuntu" msgstr "" #: ../../doc/src/installation.md:174 msgid "Run the following" msgstr "" #: ../../doc/src/installation.md:179 msgid "Restart Ubuntu again" msgstr "" #: ../../doc/src/installation.md:187 msgid "" "You can change the directory to a Windows location using `cd /mnt/[drive " "letter]/[windows location]`." msgstr "" #: ../../doc/src/installation.md:188 msgid "e.g. `cd mnt/c/Users/name/source/repos/`" msgstr "" #: ../../doc/src/installation.md:190 msgid "Now clone the LFortran git repository" msgstr "" #: ../../doc/src/installation.md:196 msgid "Run the following commands" msgstr "" #: ../../doc/src/installation.md:204 msgid "If everything compiles, you can use LFortran as follows" msgstr "" #: ../../doc/src/installation.md:210 msgid "Run an interactive prompt" msgstr "" #: ../../doc/src/installation.md:215 msgid "Run tests" msgstr "" #: ../../doc/src/installation.md:221 msgid "Enabling the Jupyter Kernel" msgstr "" #: ../../doc/src/installation.md:223 msgid "To install the Jupyter kernel, install the following Conda packages also:" msgstr "" #: ../../doc/src/installation.md:227 msgid "" "and enable the kernel by `-DWITH_XEUS=yes` and install into " "`$CONDA_PREFIX`. For example:" msgstr "" #: ../../doc/src/installation.md:239 msgid "" "To use it, install Jupyter (`conda install jupyter`) and test that the " "LFortran kernel was found:" msgstr "" #: ../../doc/src/installation.md:244 msgid "Then launch a Jupyter notebook as follows:" msgstr "" #: ../../doc/src/installation.md:248 msgid "Click `New->Fortran`. To launch a terminal jupyter LFortran console:" msgstr "" #: ../../doc/src/installation.md:254 msgid "Build From Git with Nix" msgstr "" #: ../../doc/src/installation.md:256 msgid "" "One of the ways to ensure exact environment and dependencies is with " "`nix`. This will ensure that system dependencies do not interfere with " "the development environment. If you want, you can report bugs in a `nix-" "shell` environment to make it easier for others to reproduce." msgstr "" #: ../../doc/src/installation.md:258 msgid "With Root" msgstr "" #: ../../doc/src/installation.md:260 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 "" #: ../../doc/src/installation.md:264 msgid "Without Root" msgstr "" #: ../../doc/src/installation.md:266 msgid "" "If you would like to not provide `nix` with root access to your machine, " "on Linux distributions we can use [nix-" "portable](https://github.com/DavHau/nix-portable)." msgstr "" #: ../../doc/src/installation.md:270 msgid "" "Now just prepend all `nix-shell` commands with `NP_RUNTIME=bwrap ./nix-" "portable `. So:" msgstr "" #: ../../doc/src/installation.md:278 msgid "Development" msgstr "" #: ../../doc/src/installation.md:280 msgid "Now we can enter the development environment:" msgstr "" #: ../../doc/src/installation.md:284 msgid "" "The `--pure` flag ensures no system dependencies are used in the " "environment." msgstr "" #: ../../doc/src/installation.md:286 msgid "The build steps are the same as with the `ci`:" msgstr "" #: ../../doc/src/installation.md:292 msgid "" "To change the compilation environment from `gcc` (default) to `clang` we " "can use `--argstr`:" msgstr "" #: ../../doc/src/installation.md:297 msgid "Note About Dependencies" msgstr "" #: ../../doc/src/installation.md:299 msgid "" "End users (and distributions) are encouraged to use the tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), which " "only depends on LLVM, CMake and a C++ compiler." msgstr "" #: ../../doc/src/installation.md:303 msgid "" "The tarball is generated automatically by our CI (continuous integration)" " and contains some autogenerated files: the parser, the AST and ASR " "nodes, which is generated by an ASDL translator (requires Python)." msgstr "" #: ../../doc/src/installation.md:307 msgid "The instructions from git are to be used when developing LFortran itself." msgstr "" #: ../../doc/src/installation.md:309 msgid "Note for users who do not use Conda" msgstr "" #: ../../doc/src/installation.md:311 msgid "" "Following are the dependencies necessary for installing this repository " "in development mode," msgstr "" #: ../../doc/src/installation.md:314 msgid "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" msgstr "" #: ../../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 "" #: ../../doc/src/installation.md:316 msgid "[re2c - 2.0.3](https://re2c.org/install/install.html)" msgstr "" #: ../../doc/src/installation.md:317 msgid "" "[binutils - " "2.31.90](ftp://sourceware.org/pub/binutils/snapshots/binutils-2.31.90.tar.xz)" " - Make sure that you should enable the required options related to this " "dependency to build the dynamic libraries (the ones ending with `.so`)." msgstr "" #: ../../doc/src/installation.md:319 msgid "Stacktraces" msgstr "" #: ../../doc/src/installation.md:321 msgid "" "LFortran can print stacktraces when there is an unhandled exception, as " "well as on any compiler error with the `--show-stacktrace` option. This " "is very helpful for developing the compiler itself to see where in " "LFortran the problem is. The stacktrace support is turned off by default," " to enable it, compile LFortran with the `-DWITH_STACKTRACE=yes` cmake " "option after installing the prerequisites on each platform per the " "instructions below." msgstr "" #: ../../doc/src/installation.md:328 msgid "Ubuntu" msgstr "Ubuntu" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." msgstr "" #: ../../doc/src/installation.md:332 msgid "macOS" msgstr "" #: ../../doc/src/installation.md:334 msgid "" "If you use the default Clang compiler on macOS, then the stacktraces " "should just work on both Intel and M1 based macOS (the CMake build system" " automatically invokes the `dsymtuil` tool and our Python scripts to " "store the debug information, see `src/bin/CMakeLists.txt` for more " "details). If it does not work, please report a bug." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/installation.md:352 msgid "" "and compile LFortran with the " "`-DCMAKE_PREFIX_PATH=\"$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX\"` cmake" " option. The `$CONDA_PREFIX` is there if you install some other " "dependencies (such as `llvm`) using Conda, otherwise you can remove it." msgstr "" #: ../../doc/src/intrinsics/array.md:1 msgid "Array Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:1 msgid "allocated(x): Status Check" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:3 msgid "Logical status of an allocatable integer." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:5 #: ../../doc/src/intrinsics/array/cshift.md:5 #: ../../doc/src/intrinsics/array/size.md:5 #: ../../doc/src/intrinsics/bit/bge.md:5 ../../doc/src/intrinsics/bit/bgt.md:5 #: ../../doc/src/intrinsics/bit/bit_size.md:5 #: ../../doc/src/intrinsics/bit/ble.md:5 ../../doc/src/intrinsics/bit/blt.md:5 #: ../../doc/src/intrinsics/bit/btest.md:5 #: ../../doc/src/intrinsics/bit/shiftl.md:5 #: ../../doc/src/intrinsics/bit/shiftr.md:5 #: ../../doc/src/intrinsics/character/achar.md:5 #: ../../doc/src/intrinsics/character/adjustl.md:5 #: ../../doc/src/intrinsics/character/adjustr.md:5 #: ../../doc/src/intrinsics/character/char.md:5 #: ../../doc/src/intrinsics/character/len_trim.md:5 #: ../../doc/src/intrinsics/character/lge.md:5 #: ../../doc/src/intrinsics/kind-type/kind.md:5 #: ../../doc/src/intrinsics/mathematical/acos.md:5 #: ../../doc/src/intrinsics/mathematical/acosh.md:5 #: ../../doc/src/intrinsics/mathematical/asin.md:5 #: ../../doc/src/intrinsics/mathematical/asinh.md:5 #: ../../doc/src/intrinsics/mathematical/atan.md:5 #: ../../doc/src/intrinsics/mathematical/atan2.md:5 #: ../../doc/src/intrinsics/mathematical/atanh.md:5 #: ../../doc/src/intrinsics/mathematical/fraction.md:5 #: ../../doc/src/intrinsics/misc/command_argument_count.md:5 #: ../../doc/src/intrinsics/misc/cpu_time.md:5 #: ../../doc/src/intrinsics/misc/date_and_time.md:5 #: ../../doc/src/intrinsics/misc/new_line.md:5 #: ../../doc/src/intrinsics/numeric/abs.md:5 #: ../../doc/src/intrinsics/numeric/aimag.md:5 #: ../../doc/src/intrinsics/numeric/aint.md:5 #: ../../doc/src/intrinsics/numeric/anint.md:5 #: ../../doc/src/intrinsics/numeric/ceiling.md:5 #: ../../doc/src/intrinsics/numeric/cmplx.md:5 #: ../../doc/src/intrinsics/numeric/conjg.md:5 #: ../../doc/src/intrinsics/numeric/digits.md:5 #: ../../doc/src/intrinsics/numeric/dim.md:5 #: ../../doc/src/intrinsics/numeric/epsilon.md:5 #: ../../doc/src/intrinsics/numeric/erf.md:5 #: ../../doc/src/intrinsics/numeric/erfc.md:5 #: ../../doc/src/intrinsics/numeric/exp.md:5 #: ../../doc/src/intrinsics/numeric/floor.md:5 #: ../../doc/src/intrinsics/numeric/gamma.md:5 #: ../../doc/src/intrinsics/numeric/mod.md:5 msgid "Declaration" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:7 #: ../../doc/src/intrinsics/array/cshift.md:7 #: ../../doc/src/intrinsics/array/size.md:7 #: ../../doc/src/intrinsics/bit/bge.md:7 ../../doc/src/intrinsics/bit/bgt.md:7 #: ../../doc/src/intrinsics/bit/bit_size.md:7 #: ../../doc/src/intrinsics/bit/ble.md:7 ../../doc/src/intrinsics/bit/blt.md:7 #: ../../doc/src/intrinsics/bit/btest.md:7 #: ../../doc/src/intrinsics/bit/shiftl.md:7 #: ../../doc/src/intrinsics/bit/shiftr.md:7 #: ../../doc/src/intrinsics/character/achar.md:7 #: ../../doc/src/intrinsics/character/adjustl.md:7 #: ../../doc/src/intrinsics/character/adjustr.md:7 #: ../../doc/src/intrinsics/character/char.md:7 #: ../../doc/src/intrinsics/character/len_trim.md:7 #: ../../doc/src/intrinsics/character/lge.md:8 #: ../../doc/src/intrinsics/kind-type/kind.md:7 #: ../../doc/src/intrinsics/mathematical/acos.md:7 #: ../../doc/src/intrinsics/mathematical/acosh.md:7 #: ../../doc/src/intrinsics/mathematical/asin.md:7 #: ../../doc/src/intrinsics/mathematical/asinh.md:7 #: ../../doc/src/intrinsics/mathematical/atan.md:7 #: ../../doc/src/intrinsics/mathematical/atan2.md:7 #: ../../doc/src/intrinsics/mathematical/atanh.md:7 #: ../../doc/src/intrinsics/mathematical/fraction.md:7 #: ../../doc/src/intrinsics/misc/command_argument_count.md:7 #: ../../doc/src/intrinsics/misc/cpu_time.md:7 #: ../../doc/src/intrinsics/misc/date_and_time.md:7 #: ../../doc/src/intrinsics/misc/new_line.md:7 #: ../../doc/src/intrinsics/numeric/abs.md:7 #: ../../doc/src/intrinsics/numeric/aimag.md:7 #: ../../doc/src/intrinsics/numeric/aint.md:7 #: ../../doc/src/intrinsics/numeric/anint.md:7 #: ../../doc/src/intrinsics/numeric/ceiling.md:7 #: ../../doc/src/intrinsics/numeric/cmplx.md:7 #: ../../doc/src/intrinsics/numeric/conjg.md:7 #: ../../doc/src/intrinsics/numeric/digits.md:7 #: ../../doc/src/intrinsics/numeric/dim.md:7 #: ../../doc/src/intrinsics/numeric/epsilon.md:7 #: ../../doc/src/intrinsics/numeric/erf.md:7 #: ../../doc/src/intrinsics/numeric/erfc.md:7 #: ../../doc/src/intrinsics/numeric/exp.md:7 #: ../../doc/src/intrinsics/numeric/floor.md:7 #: ../../doc/src/intrinsics/numeric/gamma.md:7 #: ../../doc/src/intrinsics/numeric/mod.md:7 msgid "Syntax" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:14 #: ../../doc/src/intrinsics/array/cshift.md:14 #: ../../doc/src/intrinsics/array/size.md:14 #: ../../doc/src/intrinsics/bit/bge.md:14 #: ../../doc/src/intrinsics/bit/bgt.md:14 #: ../../doc/src/intrinsics/bit/bit_size.md:14 #: ../../doc/src/intrinsics/bit/ble.md:14 #: ../../doc/src/intrinsics/bit/blt.md:14 #: ../../doc/src/intrinsics/bit/btest.md:14 #: ../../doc/src/intrinsics/bit/shiftl.md:14 #: ../../doc/src/intrinsics/bit/shiftr.md:14 #: ../../doc/src/intrinsics/character/achar.md:14 #: ../../doc/src/intrinsics/character/adjustl.md:14 #: ../../doc/src/intrinsics/character/adjustr.md:14 #: ../../doc/src/intrinsics/character/char.md:14 #: ../../doc/src/intrinsics/character/len_trim.md:14 #: ../../doc/src/intrinsics/character/lge.md:15 #: ../../doc/src/intrinsics/kind-type/kind.md:14 #: ../../doc/src/intrinsics/mathematical/acos.md:14 #: ../../doc/src/intrinsics/mathematical/acosh.md:14 #: ../../doc/src/intrinsics/mathematical/asin.md:14 #: ../../doc/src/intrinsics/mathematical/asinh.md:14 #: ../../doc/src/intrinsics/mathematical/atan.md:14 #: ../../doc/src/intrinsics/mathematical/atan2.md:13 #: ../../doc/src/intrinsics/mathematical/atanh.md:14 #: ../../doc/src/intrinsics/mathematical/fraction.md:13 #: ../../doc/src/intrinsics/misc/command_argument_count.md:14 #: ../../doc/src/intrinsics/misc/cpu_time.md:14 #: ../../doc/src/intrinsics/misc/date_and_time.md:14 #: ../../doc/src/intrinsics/misc/new_line.md:14 #: ../../doc/src/intrinsics/numeric/abs.md:15 #: ../../doc/src/intrinsics/numeric/aimag.md:15 #: ../../doc/src/intrinsics/numeric/aint.md:14 #: ../../doc/src/intrinsics/numeric/anint.md:14 #: ../../doc/src/intrinsics/numeric/ceiling.md:14 #: ../../doc/src/intrinsics/numeric/cmplx.md:16 #: ../../doc/src/intrinsics/numeric/conjg.md:15 #: ../../doc/src/intrinsics/numeric/digits.md:13 #: ../../doc/src/intrinsics/numeric/dim.md:13 #: ../../doc/src/intrinsics/numeric/epsilon.md:14 #: ../../doc/src/intrinsics/numeric/erf.md:14 #: ../../doc/src/intrinsics/numeric/erfc.md:14 #: ../../doc/src/intrinsics/numeric/exp.md:14 #: ../../doc/src/intrinsics/numeric/floor.md:14 #: ../../doc/src/intrinsics/numeric/gamma.md:14 #: ../../doc/src/intrinsics/numeric/mod.md:15 msgid "Arguments" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:16 msgid "`x` is an integer input parameter." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:18 #: ../../doc/src/intrinsics/array/cshift.md:22 #: ../../doc/src/intrinsics/array/size.md:22 #: ../../doc/src/intrinsics/bit/bge.md:18 #: ../../doc/src/intrinsics/bit/bgt.md:18 #: ../../doc/src/intrinsics/bit/bit_size.md:18 #: ../../doc/src/intrinsics/bit/ble.md:18 #: ../../doc/src/intrinsics/bit/blt.md:18 #: ../../doc/src/intrinsics/bit/btest.md:19 #: ../../doc/src/intrinsics/bit/shiftl.md:21 #: ../../doc/src/intrinsics/bit/shiftr.md:21 #: ../../doc/src/intrinsics/character/lge.md:23 #: ../../doc/src/intrinsics/kind-type/kind.md:19 #: ../../doc/src/intrinsics/mathematical/acos.md:18 #: ../../doc/src/intrinsics/mathematical/acosh.md:19 #: ../../doc/src/intrinsics/mathematical/asin.md:18 #: ../../doc/src/intrinsics/mathematical/asinh.md:19 #: ../../doc/src/intrinsics/mathematical/atan.md:18 #: ../../doc/src/intrinsics/mathematical/atan2.md:21 #: ../../doc/src/intrinsics/mathematical/atanh.md:19 #: ../../doc/src/intrinsics/mathematical/fraction.md:17 #: ../../doc/src/intrinsics/misc/command_argument_count.md:18 #: ../../doc/src/intrinsics/misc/cpu_time.md:18 #: ../../doc/src/intrinsics/misc/date_and_time.md:39 #: ../../doc/src/intrinsics/misc/new_line.md:19 #: ../../doc/src/intrinsics/numeric/abs.md:19 #: ../../doc/src/intrinsics/numeric/aimag.md:19 #: ../../doc/src/intrinsics/numeric/aint.md:20 #: ../../doc/src/intrinsics/numeric/anint.md:20 #: ../../doc/src/intrinsics/numeric/ceiling.md:18 #: ../../doc/src/intrinsics/numeric/cmplx.md:24 #: ../../doc/src/intrinsics/numeric/conjg.md:19 #: ../../doc/src/intrinsics/numeric/digits.md:17 #: ../../doc/src/intrinsics/numeric/dim.md:18 #: ../../doc/src/intrinsics/numeric/epsilon.md:18 #: ../../doc/src/intrinsics/numeric/erf.md:18 #: ../../doc/src/intrinsics/numeric/erfc.md:18 #: ../../doc/src/intrinsics/numeric/exp.md:18 #: ../../doc/src/intrinsics/numeric/floor.md:20 #: ../../doc/src/intrinsics/numeric/gamma.md:19 #: ../../doc/src/intrinsics/numeric/mod.md:22 msgid "Return values" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:20 msgid "" "The return value is a logical scalar with the default logical kind type " "parameter." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:23 #: ../../doc/src/intrinsics/array/cshift.md:26 #: ../../doc/src/intrinsics/array/size.md:26 #: ../../doc/src/intrinsics/bit/bge.md:22 #: ../../doc/src/intrinsics/bit/bgt.md:22 #: ../../doc/src/intrinsics/bit/bit_size.md:22 #: ../../doc/src/intrinsics/bit/ble.md:22 #: ../../doc/src/intrinsics/bit/blt.md:22 #: ../../doc/src/intrinsics/bit/btest.md:23 #: ../../doc/src/intrinsics/bit/shiftl.md:25 #: ../../doc/src/intrinsics/bit/shiftr.md:25 #: ../../doc/src/intrinsics/character/achar.md:27 #: ../../doc/src/intrinsics/character/adjustl.md:23 #: ../../doc/src/intrinsics/character/adjustr.md:24 #: ../../doc/src/intrinsics/character/char.md:28 #: ../../doc/src/intrinsics/character/len_trim.md:22 #: ../../doc/src/intrinsics/character/lge.md:31 #: ../../doc/src/intrinsics/kind-type/kind.md:23 #: ../../doc/src/intrinsics/mathematical/acos.md:23 #: ../../doc/src/intrinsics/mathematical/acosh.md:24 #: ../../doc/src/intrinsics/mathematical/asin.md:23 #: ../../doc/src/intrinsics/mathematical/asinh.md:24 #: ../../doc/src/intrinsics/mathematical/atan.md:23 #: ../../doc/src/intrinsics/mathematical/atan2.md:27 #: ../../doc/src/intrinsics/mathematical/atanh.md:24 #: ../../doc/src/intrinsics/mathematical/fraction.md:22 #: ../../doc/src/intrinsics/misc/command_argument_count.md:22 #: ../../doc/src/intrinsics/misc/cpu_time.md:22 #: ../../doc/src/intrinsics/misc/date_and_time.md:43 #: ../../doc/src/intrinsics/misc/new_line.md:24 #: ../../doc/src/intrinsics/numeric/abs.md:24 #: ../../doc/src/intrinsics/numeric/aimag.md:23 #: ../../doc/src/intrinsics/numeric/aint.md:28 #: ../../doc/src/intrinsics/numeric/anint.md:27 #: ../../doc/src/intrinsics/numeric/ceiling.md:22 #: ../../doc/src/intrinsics/numeric/cmplx.md:30 #: ../../doc/src/intrinsics/numeric/conjg.md:23 #: ../../doc/src/intrinsics/numeric/digits.md:21 #: ../../doc/src/intrinsics/numeric/dim.md:22 #: ../../doc/src/intrinsics/numeric/epsilon.md:22 #: ../../doc/src/intrinsics/numeric/erf.md:23 #: ../../doc/src/intrinsics/numeric/erfc.md:23 #: ../../doc/src/intrinsics/numeric/exp.md:22 #: ../../doc/src/intrinsics/numeric/floor.md:28 #: ../../doc/src/intrinsics/numeric/gamma.md:23 #: ../../doc/src/intrinsics/numeric/mod.md:31 ../../doc/src/progress.md msgid "Description" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:25 msgid "" "`allocated(x)` checks the allocation status of a integer input parameter." " It returns a logical value as `TRUE` if the input argument `x` is " "allocated, `FALSE` otherwise." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:29 #: ../../doc/src/intrinsics/array/cshift.md:39 #: ../../doc/src/intrinsics/array/size.md:33 #: ../../doc/src/intrinsics/bit/bge.md:27 #: ../../doc/src/intrinsics/bit/bgt.md:27 #: ../../doc/src/intrinsics/bit/bit_size.md:27 #: ../../doc/src/intrinsics/bit/ble.md:27 #: ../../doc/src/intrinsics/bit/blt.md:27 #: ../../doc/src/intrinsics/bit/btest.md:32 #: ../../doc/src/intrinsics/bit/shiftl.md:32 #: ../../doc/src/intrinsics/bit/shiftr.md:32 #: ../../doc/src/intrinsics/character/achar.md:37 #: ../../doc/src/intrinsics/character/adjustl.md:28 #: ../../doc/src/intrinsics/character/adjustr.md:29 #: ../../doc/src/intrinsics/character/char.md:38 #: ../../doc/src/intrinsics/character/len_trim.md:27 #: ../../doc/src/intrinsics/character/lge.md:37 #: ../../doc/src/intrinsics/kind-type/kind.md:27 #: ../../doc/src/intrinsics/mathematical/acos.md:31 #: ../../doc/src/intrinsics/mathematical/acosh.md:43 #: ../../doc/src/intrinsics/mathematical/asin.md:31 #: ../../doc/src/intrinsics/mathematical/asinh.md:35 #: ../../doc/src/intrinsics/mathematical/atan.md:31 #: ../../doc/src/intrinsics/mathematical/atan2.md:53 #: ../../doc/src/intrinsics/mathematical/atanh.md:39 #: ../../doc/src/intrinsics/mathematical/fraction.md:30 #: ../../doc/src/intrinsics/misc/command_argument_count.md:27 #: ../../doc/src/intrinsics/misc/cpu_time.md:33 #: ../../doc/src/intrinsics/misc/date_and_time.md:53 #: ../../doc/src/intrinsics/misc/new_line.md:29 #: ../../doc/src/intrinsics/numeric/abs.md:35 #: ../../doc/src/intrinsics/numeric/aimag.md:33 #: ../../doc/src/intrinsics/numeric/aint.md:35 #: ../../doc/src/intrinsics/numeric/anint.md:38 #: ../../doc/src/intrinsics/numeric/ceiling.md:26 #: ../../doc/src/intrinsics/numeric/cmplx.md:47 #: ../../doc/src/intrinsics/numeric/conjg.md:33 #: ../../doc/src/intrinsics/numeric/digits.md:26 #: ../../doc/src/intrinsics/numeric/dim.md:27 #: ../../doc/src/intrinsics/numeric/epsilon.md:29 #: ../../doc/src/intrinsics/numeric/erf.md:33 #: ../../doc/src/intrinsics/numeric/erfc.md:36 #: ../../doc/src/intrinsics/numeric/exp.md:29 #: ../../doc/src/intrinsics/numeric/floor.md:33 #: ../../doc/src/intrinsics/numeric/gamma.md:38 #: ../../doc/src/intrinsics/numeric/mod.md:43 msgid "Types" 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 "" #: ../../doc/src/intrinsics/array/allocated.md:46 #: ../../doc/src/intrinsics/array/cshift.md:43 #: ../../doc/src/intrinsics/array/size.md:37 #: ../../doc/src/intrinsics/bit/bge.md:49 #: ../../doc/src/intrinsics/bit/bgt.md:49 #: ../../doc/src/intrinsics/bit/bit_size.md:44 #: ../../doc/src/intrinsics/bit/ble.md:49 #: ../../doc/src/intrinsics/bit/blt.md:49 #: ../../doc/src/intrinsics/bit/btest.md:56 #: ../../doc/src/intrinsics/bit/shiftl.md:62 #: ../../doc/src/intrinsics/bit/shiftr.md:62 #: ../../doc/src/intrinsics/character/achar.md:53 #: ../../doc/src/intrinsics/character/adjustl.md:45 #: ../../doc/src/intrinsics/character/adjustr.md:46 #: ../../doc/src/intrinsics/character/char.md:53 #: ../../doc/src/intrinsics/character/len_trim.md:44 #: ../../doc/src/intrinsics/character/lge.md:59 #: ../../doc/src/intrinsics/kind-type/kind.md:59 #: ../../doc/src/intrinsics/mathematical/acos.md:60 #: ../../doc/src/intrinsics/mathematical/acosh.md:72 #: ../../doc/src/intrinsics/mathematical/asin.md:60 #: ../../doc/src/intrinsics/mathematical/asinh.md:64 #: ../../doc/src/intrinsics/mathematical/atan.md:60 #: ../../doc/src/intrinsics/mathematical/atan2.md:75 #: ../../doc/src/intrinsics/mathematical/atanh.md:68 #: ../../doc/src/intrinsics/mathematical/fraction.md:34 #: ../../doc/src/intrinsics/misc/command_argument_count.md:31 #: ../../doc/src/intrinsics/misc/cpu_time.md:44 #: ../../doc/src/intrinsics/misc/date_and_time.md:64 #: ../../doc/src/intrinsics/misc/new_line.md:40 #: ../../doc/src/intrinsics/numeric/abs.md:79 #: ../../doc/src/intrinsics/numeric/aimag.md:53 #: ../../doc/src/intrinsics/numeric/aint.md:39 #: ../../doc/src/intrinsics/numeric/anint.md:42 #: ../../doc/src/intrinsics/numeric/ceiling.md:46 #: ../../doc/src/intrinsics/numeric/cmplx.md:59 #: ../../doc/src/intrinsics/numeric/conjg.md:53 #: ../../doc/src/intrinsics/numeric/digits.md:30 #: ../../doc/src/intrinsics/numeric/dim.md:31 #: ../../doc/src/intrinsics/numeric/epsilon.md:49 #: ../../doc/src/intrinsics/numeric/erf.md:53 #: ../../doc/src/intrinsics/numeric/erfc.md:56 #: ../../doc/src/intrinsics/numeric/exp.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:65 #: ../../doc/src/intrinsics/numeric/gamma.md:58 #: ../../doc/src/intrinsics/numeric/mod.md:80 msgid "Examples" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:59 #: ../../doc/src/intrinsics/array/cshift.md:55 #: ../../doc/src/intrinsics/array/size.md:48 #: ../../doc/src/intrinsics/mathematical/acos.md:76 #: ../../doc/src/intrinsics/mathematical/acosh.md:81 #: ../../doc/src/intrinsics/mathematical/asin.md:76 #: ../../doc/src/intrinsics/mathematical/asinh.md:73 #: ../../doc/src/intrinsics/mathematical/atan.md:76 #: ../../doc/src/intrinsics/mathematical/atan2.md:84 #: ../../doc/src/intrinsics/mathematical/atanh.md:77 #: ../../doc/src/intrinsics/mathematical/fraction.md:44 msgid "**Result**:" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:65 #: ../../doc/src/intrinsics/array/cshift.md:62 #: ../../doc/src/intrinsics/array/size.md:55 #: ../../doc/src/intrinsics/bit/bge.md:68 #: ../../doc/src/intrinsics/bit/bgt.md:66 #: ../../doc/src/intrinsics/bit/bit_size.md:61 #: ../../doc/src/intrinsics/bit/ble.md:68 #: ../../doc/src/intrinsics/bit/blt.md:66 #: ../../doc/src/intrinsics/bit/btest.md:71 #: ../../doc/src/intrinsics/bit/shiftl.md:80 #: ../../doc/src/intrinsics/bit/shiftr.md:80 #: ../../doc/src/intrinsics/character/achar.md:69 #: ../../doc/src/intrinsics/character/adjustl.md:62 #: ../../doc/src/intrinsics/character/adjustr.md:63 #: ../../doc/src/intrinsics/character/char.md:69 #: ../../doc/src/intrinsics/character/len_trim.md:63 #: ../../doc/src/intrinsics/character/lge.md:79 #: ../../doc/src/intrinsics/kind-type/kind.md:79 #: ../../doc/src/intrinsics/mathematical/acos.md:82 #: ../../doc/src/intrinsics/mathematical/acosh.md:86 #: ../../doc/src/intrinsics/mathematical/asin.md:82 #: ../../doc/src/intrinsics/mathematical/asinh.md:78 #: ../../doc/src/intrinsics/mathematical/atan.md:82 #: ../../doc/src/intrinsics/mathematical/atan2.md:90 #: ../../doc/src/intrinsics/mathematical/atanh.md:82 #: ../../doc/src/intrinsics/mathematical/fraction.md:50 #: ../../doc/src/intrinsics/misc/command_argument_count.md:47 #: ../../doc/src/intrinsics/misc/cpu_time.md:64 #: ../../doc/src/intrinsics/misc/date_and_time.md:90 #: ../../doc/src/intrinsics/misc/new_line.md:56 #: ../../doc/src/intrinsics/numeric/abs.md:96 #: ../../doc/src/intrinsics/numeric/aimag.md:68 #: ../../doc/src/intrinsics/numeric/aint.md:55 #: ../../doc/src/intrinsics/numeric/anint.md:58 #: ../../doc/src/intrinsics/numeric/ceiling.md:64 #: ../../doc/src/intrinsics/numeric/cmplx.md:74 #: ../../doc/src/intrinsics/numeric/conjg.md:68 #: ../../doc/src/intrinsics/numeric/digits.md:44 #: ../../doc/src/intrinsics/numeric/dim.md:47 #: ../../doc/src/intrinsics/numeric/epsilon.md:63 #: ../../doc/src/intrinsics/numeric/erf.md:67 #: ../../doc/src/intrinsics/numeric/erfc.md:70 #: ../../doc/src/intrinsics/numeric/exp.md:71 #: ../../doc/src/intrinsics/numeric/floor.md:83 #: ../../doc/src/intrinsics/numeric/gamma.md:74 #: ../../doc/src/intrinsics/numeric/mod.md:95 msgid "See Also" msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:1 msgid "cshift(A, shift [, dim]): Circular Shift" msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:3 msgid "Circular shift elements of an array." 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 "" #: ../../doc/src/intrinsics/array/cshift.md:18 msgid "`shift` the input value of integer type." msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:20 msgid "" "`dim` optional dimension, if present, `cshift` returns the result of this" " dimension." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/array/cshift.md:28 msgid "" "**cshift(A, shift [, dim])** performs a circular shift on elements of `A`" " array along the dimension of `dim`. Default value of `dim` is 1, used " "when `dim` is not passed." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/array/cshift.md:41 msgid "" "Supported argument type is array for `A` and integer for `shift` and " "`dim`." msgstr "" #: ../../doc/src/intrinsics/array/size.md:1 msgid "size(x): Size of Array" msgstr "" #: ../../doc/src/intrinsics/array/size.md:3 msgid "Returns the size of an array `x`." msgstr "" #: ../../doc/src/intrinsics/array/size.md:18 msgid "" "`dim` optional dimension, if present, `size` returns the size of this " "dimension." msgstr "" #: ../../doc/src/intrinsics/array/size.md:20 msgid "`kind` optional the kind of the return value." msgstr "" #: ../../doc/src/intrinsics/array/size.md:24 msgid "`n` the size of an array (integer)." msgstr "" #: ../../doc/src/intrinsics/array/size.md:28 msgid "" "The `size` intrinsic function returns the size of an array. It returns " "the product of all dimensions, unless the `dim` argument is specified, in" " which case it only returns the size of this particular dimension. The " "`kind` argument can be used to specify the integer kind of the result." msgstr "" #: ../../doc/src/intrinsics/array/size.md:57 msgid "[shape](), [reshape]()." msgstr "" #: ../../doc/src/intrinsics/bit.md:1 msgid "Bit Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:1 msgid "bge(x, y): Bitwise Greater or Equal" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:3 msgid "Bitwise greater than or equal to." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/bge.md:29 #: ../../doc/src/intrinsics/bit/bgt.md:29 #: ../../doc/src/intrinsics/bit/ble.md:29 #: ../../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 "" #: ../../doc/src/intrinsics/bit/bge.md:60 #: ../../doc/src/intrinsics/bit/bgt.md:59 #: ../../doc/src/intrinsics/bit/bit_size.md:54 #: ../../doc/src/intrinsics/bit/ble.md:60 #: ../../doc/src/intrinsics/bit/blt.md:59 #: ../../doc/src/intrinsics/bit/btest.md:65 #: ../../doc/src/intrinsics/bit/shiftl.md:74 #: ../../doc/src/intrinsics/bit/shiftr.md:74 #: ../../doc/src/intrinsics/character/achar.md:63 #: ../../doc/src/intrinsics/character/adjustl.md:56 #: ../../doc/src/intrinsics/character/adjustr.md:57 #: ../../doc/src/intrinsics/character/char.md:63 #: ../../doc/src/intrinsics/character/len_trim.md:57 #: ../../doc/src/intrinsics/character/lge.md:72 #: ../../doc/src/intrinsics/kind-type/kind.md:72 #: ../../doc/src/intrinsics/misc/command_argument_count.md:40 #: ../../doc/src/intrinsics/misc/cpu_time.md:57 #: ../../doc/src/intrinsics/misc/date_and_time.md:83 #: ../../doc/src/intrinsics/misc/new_line.md:49 #: ../../doc/src/intrinsics/numeric/abs.md:89 #: ../../doc/src/intrinsics/numeric/aimag.md:62 #: ../../doc/src/intrinsics/numeric/aint.md:48 #: ../../doc/src/intrinsics/numeric/anint.md:51 #: ../../doc/src/intrinsics/numeric/ceiling.md:57 #: ../../doc/src/intrinsics/numeric/cmplx.md:68 #: ../../doc/src/intrinsics/numeric/conjg.md:62 #: ../../doc/src/intrinsics/numeric/digits.md:38 #: ../../doc/src/intrinsics/numeric/dim.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:57 #: ../../doc/src/intrinsics/numeric/erf.md:61 #: ../../doc/src/intrinsics/numeric/erfc.md:64 #: ../../doc/src/intrinsics/numeric/exp.md:65 #: ../../doc/src/intrinsics/numeric/floor.md:76 #: ../../doc/src/intrinsics/numeric/gamma.md:67 #: ../../doc/src/intrinsics/numeric/mod.md:89 msgid "**Result:**" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:70 msgid "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/bgt.md:1 msgid "bgt(x, y): Bitwise Greater Than" msgstr "" #: ../../doc/src/intrinsics/bit/bgt.md:3 msgid "Bitwise greater than." 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 "" #: ../../doc/src/intrinsics/bit/bgt.md:68 msgid "[bge](bge.md), [ble](ble.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:1 msgid "bit_size(x): Bit Size" msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:3 msgid "Bit size." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:16 msgid "`x` is integer input value." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:20 #: ../../doc/src/intrinsics/numeric/digits.md:19 msgid "The return value is of type integer." 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 "" #: ../../doc/src/intrinsics/bit/bit_size.md:29 msgid "Supported input types is integer." msgstr "" #: ../../doc/src/intrinsics/bit/ble.md:1 msgid "bge(x, y): Bitwise Less or Equal" msgstr "" #: ../../doc/src/intrinsics/bit/ble.md:3 msgid "Bitwise less than or equal to." 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 "" #: ../../doc/src/intrinsics/bit/ble.md:70 msgid "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:1 msgid "blt(x, y): Bitwise Less Than" msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:3 msgid "Bitwise less than." 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 "" #: ../../doc/src/intrinsics/bit/blt.md:68 msgid "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:1 msgid "btest(x, pos): Bit Test at Position" msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:3 msgid "Bit test." 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 "" #: ../../doc/src/intrinsics/bit/btest.md:21 msgid "The return value is of type logical." msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:25 msgid "" "`btest(x, pos)` calculates if `pos` bit in input integer value `x` is " "set. The counting of the bits starts at 0, at least significant bit (LSB)" " i.e., the rightmost bit in `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:1 msgid "shiftl(x, shift): Shift Left" msgstr "" #: ../../doc/src/intrinsics/bit/shiftl.md:3 msgid "Logical shift left function." msgstr "" #: ../../doc/src/intrinsics/bit/shiftl.md:16 #: ../../doc/src/intrinsics/bit/shiftr.md:16 msgid "`x` is an integer input value." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:27 msgid "" "**shiftl(x, shift)** logically left shifts `x` by `shift` number of bits." " `shiftl` shifts from LSB(**L**east **S**ignificant **B**it) to " "MSB(**M**ost **S**ignificant **B**it). Bits shifted from the left end " "i.e., MSB bits are lost. Zeroes are appended to the opposite right end." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:82 msgid "[shiftr](shiftr.md)." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:1 msgid "shiftr(x, shift): Shift Right" msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:3 msgid "Logical shift right function." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:27 msgid "" "**shiftr(x, shift)** logically right shifts `x` by `shift` number of " "bits. `shiftr` shifts from MSB(**M**ost **S**ignificant **B**it) to " "LSB(**L**east **S**ignificant **B**it). Bits shifted from the right end " "i.e., LSB bits are lost. Zeroes are appended to the opposite left end." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:82 msgid "[shiftl](shiftl.md)." msgstr "" #: ../../doc/src/intrinsics/character.md:1 msgid "Character Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/character/achar.md:1 msgid "achar(x, kind): To Character in ASCII set." msgstr "" #: ../../doc/src/intrinsics/character/achar.md:3 msgid "Character represented by in the ASCII character set." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/character/achar.md:20 #: ../../doc/src/intrinsics/character/adjustl.md:18 #: ../../doc/src/intrinsics/character/adjustr.md:18 #: ../../doc/src/intrinsics/character/char.md:21 #: ../../doc/src/intrinsics/character/len_trim.md:18 msgid "Return value" 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/achar.md:29 msgid "" "**achar(x, kind)** returns the character represented by the ASCII " "character set at `x` position." msgstr "" #: ../../doc/src/intrinsics/character/achar.md:32 #: ../../doc/src/intrinsics/character/char.md:33 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 "" #: ../../doc/src/intrinsics/character/achar.md:35 #: ../../doc/src/intrinsics/character/char.md:36 msgid "It is a runtime builtin function." 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 "" #: ../../doc/src/intrinsics/character/adjustl.md:1 msgid "adjustl(string): Left Adjust String" msgstr "" #: ../../doc/src/intrinsics/character/adjustl.md:3 msgid "Left adjust a string." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/adjustl.md:30 #: ../../doc/src/intrinsics/character/adjustr.md:31 msgid "Supported argument type is character." msgstr "" #: ../../doc/src/intrinsics/character/adjustr.md:1 msgid "adjustr(string): Right Adjust String" msgstr "" #: ../../doc/src/intrinsics/character/adjustr.md:3 msgid "Right adjust a string." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/adjustr.md:65 msgid "[adjustl](adjustl.md)." msgstr "" #: ../../doc/src/intrinsics/character/char.md:1 msgid "char(x, [, kind]): Integer to Character" msgstr "" #: ../../doc/src/intrinsics/character/char.md:3 msgid "Integer to character conversion." msgstr "" #: ../../doc/src/intrinsics/character/char.md:16 msgid "`x`: the input value of integer type." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/character/char.md:30 msgid "" "**char(x)** returns the character represented by the ASCII character set " "at `x` position." msgstr "" #: ../../doc/src/intrinsics/character/char.md:71 msgid "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:1 msgid "len_trim(string): Length Ignoring Trailing Blanks" msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:3 msgid "Length of a character string ignoring trailing blank character(s)." msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:16 msgid "`string` the input value of character type." msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:20 msgid "The return value is of type unsigned integer." 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 "" #: ../../doc/src/intrinsics/character/len_trim.md:29 msgid "Supported argument type is character scalar." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:1 msgid "lge(x, y): Lexically Greater or Equal" msgstr "" #: ../../doc/src/intrinsics/character/lge.md:3 msgid "Lexically greater than or equal." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:17 msgid "`x` input value of type character." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:19 msgid "`y` input value of type character." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:21 msgid "`x` and `y` can be seen as string A and string B." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:25 msgid "The return value is of logical `true` or `false` type." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:27 msgid "`True` if `x` string is lexically greater than or equal to `y`." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:29 msgid "`False` if they are not." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:33 msgid "" "**lge(x, y)** determines if input string `x` is lexically greater than or" " equal to input string `y`. The two strings in comparison are interpreted" " as containing ASCII character codes." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:39 msgid "Argument types should be of type character literal." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:81 msgid "[len_trim](len_trim.md)." msgstr "" #: ../../doc/src/intrinsics/kind-type.md:1 msgid "Kind Type Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:1 msgid "kind(x): Kind of an Entity" msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:3 msgid "Kind of an entity." 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 "" #: ../../doc/src/intrinsics/kind-type/kind.md:21 msgid "The return value is of integer type and of default integer kind." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:25 msgid "**kind(x)** returns the kind parameter of the input argument `x`." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:29 msgid "" "Supported argument types are logical, integer, real, complex, or " "character." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:81 #: ../../doc/src/intrinsics/misc/command_argument_count.md:16 #: ../../doc/src/intrinsics/misc/cpu_time.md:20 #: ../../doc/src/intrinsics/misc/date_and_time.md:41 #: ../../doc/src/intrinsics/misc/new_line.md:58 msgid "None." msgstr "" #: ../../doc/src/intrinsics/mathematical.md:1 msgid "Mathematical Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:1 msgid "acos(x): Trigonometric Arc Cosine" msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:3 msgid "Trigonometric arc cosine (inverse cosine) function." 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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:20 #: ../../doc/src/intrinsics/mathematical/acosh.md:21 #: ../../doc/src/intrinsics/mathematical/asin.md:20 #: ../../doc/src/intrinsics/mathematical/asinh.md:21 #: ../../doc/src/intrinsics/mathematical/atan.md:20 #: ../../doc/src/intrinsics/mathematical/atanh.md:21 msgid "" "The returned value has the kind of the input value and TYPE may be real " "or complex." msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:25 msgid "**acos(x)** computes the arcsine of the argument **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:33 #: ../../doc/src/intrinsics/mathematical/acosh.md:45 #: ../../doc/src/intrinsics/mathematical/asin.md:33 #: ../../doc/src/intrinsics/mathematical/asinh.md:37 #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:84 msgid "[asin](asin.md), [atan](atan.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:1 msgid "acosh(x): Inverse Hyperbolic Cosine" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:3 msgid "Inverse hyperbolic cosine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:16 #: ../../doc/src/intrinsics/mathematical/asinh.md:16 #: ../../doc/src/intrinsics/mathematical/atanh.md:16 msgid "" "`x` the input value, can be real with value greater than or equal to 1 or" " of type complex." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:26 msgid "**acosh(x)** computes the inverse hyperbolic cosine function of **x**." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acosh.md:33 msgid "$-\\pi <= img (acosh(x)) <= \\pi$" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:35 msgid "" "For real values $x$ in the domain $x > 1$, the inverse hyperbolic cosine " "satisifies:" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:38 msgid "$cosh^{-1}(x) = \\log(x + \\sqrt{(x^2 - 1)})$" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acosh.md:88 msgid "[asinh](asinh.md), [atanh](atanh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:1 msgid "asin(x): Trigonometric Arcsine" msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:3 msgid "Trigonometric arcsine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:25 msgid "**asin(x)** computes the arcsine of the argument **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/asin.md:84 msgid "[acos](acos.md), [atan](atan.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:1 msgid "asinh(x): Inverse Hyperbolic Arcsine" msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:3 msgid "Inverse hyperbolic arcsine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:26 msgid "**asinh(x)** computes the inverse hyperbolic arcsine function of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/asinh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (asinh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:80 msgid "[acosh](acosh.md), [atanh](atanh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:1 msgid "atan(x): Trigonometric ArcTangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:3 msgid "Trigonometric arctangent (inverse arctangent) function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:25 msgid "**atan(x)** computes the arctangent of the argument **x**." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:27 msgid "" "The arc tangent is the inverse function of the arctangent function. It is" " commonly used in trigonometry to find the angle when the lengths of the " "opposite side of a right triangle and base are known, i.e., perpendicular" " and base length." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:84 msgid "[asin](asin.md), [acos](acos.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:1 msgid "atan2(y, x): ArcTangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:3 msgid "Arctangent function or inverse tangent function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:15 msgid "`y` the input value is the imaginary part of the complex expression" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atan2.md:19 msgid "`x` the input value, must be real part of the complex expression." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atan2.md:29 msgid "" "**atan2(y, x)** computes the principal value of the argument function of " "the complex expression $x + iy$. This is used to transform from cartesian" " into polar coordinates and allows to determine the angle in the correct " "quadrant." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:33 msgid "It is also represented as:" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:35 msgid "$tan^{-1}(\\frac{y}{x})$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:37 msgid "If `x` is nonzero, the result lies in the range:" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:39 msgid "$-\\pi <= atan(x) <= \\pi$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:41 msgid "The sign is positive if `y` is positive." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:43 msgid "If `y` is zero and `x` is strictly positive, then the result is 0." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:45 msgid "If `x` is negative and `y` is positive zero, then the result is $\\pi$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:47 msgid "If `x` is negative and `y` is negative zero, then the result is $-\\pi$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:49 msgid "If `x` is zero, then the magnitude of the result is $\\frac{\\pi}{2}$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:51 msgid "If `y` is negative real zero, the result is $\\frac{-\\pi}{2}$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:55 #: ../../doc/src/intrinsics/mathematical/fraction.md:32 msgid "Supported argument type is real." msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:1 msgid "atanh(x): Inverse Hyperbolic Tangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:3 msgid "Inverse hyperbolic tangent function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:26 msgid "**atanh(x)** computes the inverse hyperbolic tangent function of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atanh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (atanh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:35 msgid "If the result is real, it lies in the range" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:37 msgid "$-1.0 < atanh(x) < 1.0$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:84 msgid "[asinh](asinh.md), [acosh](acosh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:1 msgid "fraction(x): Fractional Part in Model Representation" msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:3 msgid "Fractional part of the model representation." msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:15 msgid "`x` the input value, must be real." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/fraction.md:24 msgid "" "**fraction(x)** computes the fractional part of the model representation " "of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/fraction.md:28 msgid "$x * {radix(x)}^{(-exponent(x))}$" msgstr "" #: ../../doc/src/intrinsics/misc.md:1 msgid "Miscellaneous Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:1 msgid "command_argument_count(): Number of Command Line Arguments" msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:3 msgid "Get number of command line arguments." msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:20 msgid "The return value is of integer type and of default kind." 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 "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:29 msgid "Any." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:1 msgid "cpu_time(x): CPU Elapsed Time" msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:3 msgid "CPU elapsed time in seconds." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:16 msgid "`x` the input value should be of type real with `intent(out)`." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:24 msgid "" "**cpu_time(time)** returns a real value representing the elapsed CPU time" " in seconds. If tine source is available, time will be reported with " "microsecond resolution. If no time source is available, TIME is set to " "-1.0." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:28 msgid "This is useful for testing segments of code to determine computation time." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:1 msgid "date_and_time([date, time, zone, values]): Date and Time" msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:3 msgid "Date and time subroutine." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:22 msgid "" "`zone` the input value of character type, which has length 5 or larger. " "It is of default kind. It is `intent(out)` and has from `(+-)hhmm`, " "representing the difference with respect to Coordinates Universal Time " "(UTC). Unavailable time and date parameters return blanks." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:30 msgid "`value(1)`: The year." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:31 msgid "`value(2)`: The month." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:32 msgid "`value(3)`: The day of the month." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:33 msgid "`value(4)`: Time difference with UTC in minutes." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:34 msgid "`value(5)`: The hour of the day." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:35 msgid "`value(6)`: The minutes of the hour." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:36 msgid "`value(7)`: The seconds of the minutes." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:37 msgid "`value(8)`: The milliseconds of the second." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:51 msgid "Unavailable or errorneous date and time parameters return blanks." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:92 msgid "[cpu_time](cpu_time.md)." msgstr "" #: ../../doc/src/intrinsics/misc/new_line.md:1 msgid "new_line(x): New Line Character" msgstr "" #: ../../doc/src/intrinsics/misc/new_line.md:3 msgid "New line character." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/new_line.md:31 msgid "Supported input parameter types is character." msgstr "" #: ../../doc/src/intrinsics/numeric.md:1 msgid "Numeric Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:1 msgid "abs(x): Absolute Value" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:3 msgid "Absolute value." msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:17 msgid "`x` the input value, can be integer, real, or complex." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/abs.md:26 msgid "" "**abs(x)** calculates and returns absolute value of `x`. Result is " "calculated using mathematical formula:" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:29 msgid "$|x|$" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:31 msgid "If `x` is complex, the result is calculated using mathematical formula:" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:33 msgid "$\\sqrt{(x^2 + y^2)}$" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aimag.md:1 msgid "aimag(x): Imaginary Part" msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:3 msgid "Imaginary part of complex number." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:17 msgid "`x` the input value must be of complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:21 msgid "The return value is imaginary part of type real and kind same as of `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:25 msgid "**aimag(x)** returns the imaginary part of the input complex argument `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:27 #: ../../doc/src/intrinsics/numeric/cmplx.md:41 #: ../../doc/src/intrinsics/numeric/conjg.md:27 msgid "" "For `x` complex input value, the result is calculated using mathematical " "formula:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aimag.md:35 msgid "Supported argument types are complex." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:1 msgid "aint(x, [kind]): Truncate to a Whole Number" msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:3 msgid "Truncate to a whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:16 #: ../../doc/src/intrinsics/numeric/anint.md:16 #: ../../doc/src/intrinsics/numeric/epsilon.md:16 #: ../../doc/src/intrinsics/numeric/erf.md:16 #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aint.md:37 #: ../../doc/src/intrinsics/numeric/anint.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:31 #: ../../doc/src/intrinsics/numeric/erf.md:35 #: ../../doc/src/intrinsics/numeric/erfc.md:38 #: ../../doc/src/intrinsics/numeric/floor.md:35 #: ../../doc/src/intrinsics/numeric/gamma.md:40 msgid "Supported argument types is real." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:85 msgid "[ceiling](ceiling.md), [mod](mod.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:1 msgid "anint(x, [kind]): Round to Nearest Whole Number" msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:3 msgid "Round to nearest whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:25 msgid "The return value is equal to rounded whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:29 msgid "**anint(x)** calculates rounded value of input parameter `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/anint.md:34 msgid "If `x` is greater than 0, `anint(x)` returns `aint(x + 0.5)`." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:60 msgid "[aint](aint.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:1 msgid "ceiling(x): Integer Ceiling" msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:3 msgid "Integer ceiling function" msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:16 msgid "The input value `x` may be of type real or integer." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:20 msgid "The return value is of type integer and nearest greater integer." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:24 msgid "**ceiling(x)** returns the least integer greater than or equal to `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:28 msgid "Supported input parameter types are integer and real." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:66 msgid "[floor](floor.md), [mod](mod.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:1 msgid "cmplx(x [, [, kind]]): Convert to Complex" msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:3 msgid "Conversion to complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:14 msgid "`cmplx(x, y)` is one of the intrinsic present in ASR." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:18 msgid "" "`x` the input value must be of integer, real, or complex. `y` the " "optional input value must be of type integer or real. It should be only " "present in case `x` is not complex. `kind` the optional input value of " "integer expression type for initialisation indicating the kind parameter " "of the result." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/cmplx.md:32 msgid "" "**cmplx(x, [, y [, kind]])** converts the input value to complex " "representation:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/cmplx.md:37 msgid "If `y` is not present, the imaginary component is set to 0.0." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:39 msgid "If `x` is complex then `y` must not be present." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:49 msgid "Supported argument types are integer, real, or complex." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:1 msgid "conjg(x): Complex Conjugate" msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:3 msgid "Complex conjugate function." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:17 msgid "`x` the input value must be of type complex." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:21 msgid "The return value is of complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:25 msgid "**conjg(x)** converts the input value `x` to its conjugate." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:29 msgid "$x + iy$ converted to $x - iy$" msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:35 msgid "Supported argument types is complex." msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:1 msgid "digits(x): Significant Binary Digits" msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:3 msgid "Significant binary digits." msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:15 msgid "`x` the input value must be of type real or integer." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/dim.md:1 msgid "dim(x, y): Positive Difference or 0" msgstr "" #: ../../doc/src/intrinsics/numeric/dim.md:3 msgid "Positive difference or 0." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/dim.md:20 msgid "The return value is of type integer or real." 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 "" #: ../../doc/src/intrinsics/numeric/epsilon.md:1 msgid "epsilon(x): Epsilon" msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:3 msgid "Epsilon function." msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:20 msgid "The return value is of same type as of the input argument." msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:24 msgid "" "**epsilon(x)** computes the smallest number $\\epsilon$ of the same kind " "as `x` following:" msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:27 msgid "$1 + \\epsilon > 1$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:1 msgid "erf(x): Error" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:3 msgid "Error function." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/erf.md:27 msgid "$-1 \\leq erf (x) \\leq 1$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_0^xe^{-t^2}dt$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:69 msgid "[erfc](erfc.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:1 msgid "erfc(x): Complementary Error" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:3 msgid "Complementary error function." 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 "" #: ../../doc/src/intrinsics/numeric/erfc.md:27 msgid "$0 \\leq erf (x) \\leq 2$" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_{x}^{\\infty}e^{-t^2}dt$" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/erfc.md:72 msgid "[erf](erf.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:1 msgid "exp(x): Exponential" msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:3 msgid "Exponential function." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:16 msgid "`x` the input value must be of type real or complex." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:20 msgid "The return value is of same type as of the input argument, `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:24 msgid "**exp(x)** computes the base $e$ exponential of `x`, i.e., $e^x$." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/exp.md:31 msgid "Supported argument types is real and complex." msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:1 msgid "floor(x, kind): Integer Floor" msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:3 msgid "Integer floor function." msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:18 msgid "" "`kind` the optional input parameter must be a scalar integer constant " "expression." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:1 msgid "gamma(x): Gamma" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:3 msgid "Gamma function." 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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:21 msgid "The return value is of same type and kind as of `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:28 msgid "$\\gamma(x) = (x-1)!$" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:30 msgid "In general, if $x > 0$:" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:32 msgid "$\\gamma(x) = \\int_{0}^{\\infty} e^{-t} dt$" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:34 msgid "and if $-n-1 < x < -n$ where n is an integer >= 0:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:76 msgid "[epsilon](epsilon.md)" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:1 msgid "mod(x, y): Modulus" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:3 msgid "Modulus or remainder function." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:17 msgid "`x` the input value, can be integer or real." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/mod.md:27 msgid "`x - INT (x / y) * y`." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:29 msgid "If `y` is 0, the result is undefined like `any integer value / 0`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/mod.md:36 msgid "`x - INT(x / y) * y`" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:38 msgid "" "i.e., result is remainder when first argument is mathematically divided " "by second argument." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:41 msgid "The return value should be less than `y`." msgstr "" #: ../../doc/src/language.md:1 msgid "Fortran Language" msgstr "" #: ../../doc/src/language.md:3 msgid "Background and Motivation" msgstr "" #: ../../doc/src/language.md:5 msgid "" "Fortran was designed from the ground up to naturally and simply translate" " mathematics to code that compiles and runs at maximum speed. And being " "specifically targeted for such fundamentally computational tasks, it " "contains a broad range of key functionality within the language itself, " "standard across all platforms, with no need for external libraries that " "may or may not be well optimized or maintained, at present or down the " "road." msgstr "" #: ../../doc/src/language.md:12 msgid "Some highlights:" 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 "" #: ../../doc/src/language.md:17 msgid "" "Operators which operate naturally upon the aforementioned " "arrays/matrices, as they do scalars;" msgstr "" #: ../../doc/src/language.md:19 msgid "Complex numbers;" msgstr "" #: ../../doc/src/language.md:20 msgid "Special functions;" msgstr "" #: ../../doc/src/language.md:21 msgid "Structures and pointers for more general data representation." msgstr "" #: ../../doc/src/language.md:23 msgid "" "Because the essentials are contained in the language itself, it is simple" " to read and write, without need of choosing from among or deciphering a " "proliferation of external classes to do the same thing. And because the " "essentials are self-contained, compilers can provide detailed compile-" "time (e.g., argument mismatch) and run-time (e.g., memory access) checks," " as well as highly optimized executables, directly from natural, readable" " code without need of extensive optimization heroics by the developer." msgstr "" #: ../../doc/src/language.md:31 msgid "See our blog posts for more information:" msgstr "" #: ../../doc/src/language.md:33 msgid "" "[Why We Created LFortran](https://lfortran.org/blog/2019/04/why-we-" "created-lfortran/)" msgstr "" #: ../../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 "" #: ../../doc/src/language.md:36 msgid "How to Learn Fortran" msgstr "" #: ../../doc/src/language.md:38 msgid "" "Fortran is relatively quick to learn because it is so much simpler and " "smaller than C/C++ (in practice, that is, with all needed libraries " "included). If you are interested in learning more, please see our webpage" " at [fortran90.org] with recommended practices for writing code, side by " "side comparison with Python/NumPy, links to other online Fortran " "resources and books, and an FAQ." msgstr "" #: ../../doc/src/progress.md:3 msgid "" "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:" msgstr "" #: ../../doc/src/progress.md:7 msgid "AST: The code can be parsed to AST (`lfortran --show-ast test.f90`)" msgstr "" #: ../../doc/src/progress.md:8 msgid "ASR: The code can be transformed to ASR (`lfortran --show-asr test.f90`)" msgstr "" #: ../../doc/src/progress.md:9 msgid "LLVM: LFortran can generate LLVM IR (`lfortran --show-llvm test.f90`)" msgstr "" #: ../../doc/src/progress.md:10 msgid "BIN: The LLVM IR can compile to a binary" msgstr "" #: ../../doc/src/progress.md:11 msgid "RUN: The binary runs without errors" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:16 msgid "" "This page is generated automatically using the [Compiler " "Tester](https://gitlab.com/lfortran/compiler_tester) repository which " "contains all the Fortran tests and scripts to run LFortran to produce the" " tables below. We are looking for contributors to contribute more tests. " "Our goal is to have a comprehensive Fortran testsuite that can be used to" " test any Fortran compiler." msgstr "" #: ../../doc/src/progress.md:23 msgid "Testing the LFortran compiler version:" msgstr "" #: ../../doc/src/progress.md:32 msgid "Topics" msgstr "" #: ../../doc/src/progress.md:34 msgid "Full programs that compute something interesting" msgstr "" #: ../../doc/src/progress.md:36 msgid "Basic Numerics" msgstr "" #: ../../doc/src/progress.md:38 msgid "Directory: `tests/programs/numerics`" msgstr "" #: ../../doc/src/progress.md msgid "LLVM" msgstr "LLVM" #: ../../doc/src/progress.md msgid "BIN" msgstr "" #: ../../doc/src/progress.md msgid "RUN" msgstr "" #: ../../doc/src/progress.md msgid "Filename" msgstr "" #: ../../doc/src/progress.md msgid "`Pure Fortran sin(x) implementation`" msgstr "" #: ../../doc/src/progress.md msgid "✅" 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 "" #: ../../doc/src/progress.md:45 msgid "Modules" msgstr "" #: ../../doc/src/progress.md:47 msgid "Basic Usage" msgstr "" #: ../../doc/src/progress.md:49 msgid "Directory: `tests/modules/basic`" msgstr "" #: ../../doc/src/progress.md msgid "`Basic modules`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/basic/t01.f90)" msgstr "" #: ../../doc/src/progress.md:56 msgid "Module Functions and Subroutines" msgstr "" #: ../../doc/src/progress.md:58 msgid "Directory: `tests/modules/procedures`" msgstr "" #: ../../doc/src/progress.md msgid "`Module functions`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`Module subroutines`" msgstr "" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t02.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`Nested subroutines`" msgstr "" #: ../../doc/src/progress.md msgid "[t03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t03.f90)" msgstr "" #: ../../doc/src/progress.md:67 msgid "Expressions" msgstr "" #: ../../doc/src/progress.md:69 msgid "Arithmetic Operations" msgstr "" #: ../../doc/src/progress.md:71 msgid "Directory: `tests/expressions/arit`" msgstr "" #: ../../doc/src/progress.md msgid "`+,-,*,/,**`" msgstr "" #: ../../doc/src/progress.md msgid "[basic_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/arit/basic_operations.f90)" msgstr "" #: ../../doc/src/progress.md:78 msgid "Integers" msgstr "" #: ../../doc/src/progress.md:80 msgid "Directory: `tests/expressions/integers`" msgstr "" #: ../../doc/src/progress.md msgid "`integers`" msgstr "" #: ../../doc/src/progress.md msgid "[integer_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/integer_kind.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`relational operations`" 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 "" #: ../../doc/src/progress.md msgid "`logical operations`" 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 "" #: ../../doc/src/progress.md:89 msgid "Real Numbers" msgstr "" #: ../../doc/src/progress.md:91 msgid "Directory: `tests/expressions/reals`" msgstr "" #: ../../doc/src/progress.md msgid "`single/double reals`" msgstr "" #: ../../doc/src/progress.md msgid "[real_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/real_kind.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`defined operator`" msgstr "" #: ../../doc/src/progress.md msgid "âŒ" 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 "" #: ../../doc/src/progress.md:99 msgid "Complex Numbers" msgstr "" #: ../../doc/src/progress.md:101 msgid "Directory: `tests/expressions/complex`" msgstr "" #: ../../doc/src/progress.md msgid "`single/double complex`" msgstr "" #: ../../doc/src/progress.md msgid "[complex_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/complex/complex_kind.f90)" msgstr "" #: ../../doc/src/progress.md:108 msgid "Strings" msgstr "" #: ../../doc/src/progress.md:110 msgid "Directory: `tests/expressions/character`" msgstr "" #: ../../doc/src/progress.md msgid "`character`" msgstr "" #: ../../doc/src/progress.md msgid "[t01_character.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t01_character.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`string concatenation`" 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 "" #: ../../doc/src/progress.md:118 msgid "Derived Types" msgstr "" #: ../../doc/src/progress.md:120 msgid "Directory: `tests/expressions/derived_type`" msgstr "" #: ../../doc/src/progress.md msgid "`basic derived types`" 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 "" #: ../../doc/src/progress.md:127 msgid "Statements" msgstr "" #: ../../doc/src/progress.md:129 msgid "Allocate Statement" msgstr "" #: ../../doc/src/progress.md:131 msgid "Directory: `tests/statements/allocate`" msgstr "" #: ../../doc/src/progress.md msgid "`allocate statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/allocate/t01.f90)" msgstr "" #: ../../doc/src/progress.md:138 msgid "Block Statement" msgstr "" #: ../../doc/src/progress.md:140 msgid "Directory: `tests/statements/block`" msgstr "" #: ../../doc/src/progress.md msgid "`block statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/block/t01.f90)" msgstr "" #: ../../doc/src/progress.md:147 msgid "Goto Statement" msgstr "" #: ../../doc/src/progress.md:149 msgid "Directory: `tests/statements/goto`" msgstr "" #: ../../doc/src/progress.md msgid "`computed go-to statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`go-to statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t02.f90)" msgstr "" #: ../../doc/src/progress.md:157 msgid "If Statement" msgstr "" #: ../../doc/src/progress.md:159 msgid "Directory: `tests/statements/if`" msgstr "" #: ../../doc/src/progress.md msgid "`Test .false.`" msgstr "" #: ../../doc/src/progress.md msgid "[if_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`single line if statement`" msgstr "" #: ../../doc/src/progress.md msgid "[if_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_02.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`multi line if statement`" msgstr "" #: ../../doc/src/progress.md msgid "[if_03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_03.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`nested if statements`" msgstr "" #: ../../doc/src/progress.md msgid "[if_04.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_04.f90)" msgstr "" #: ../../doc/src/progress.md:169 msgid "While Statement" msgstr "" #: ../../doc/src/progress.md:171 msgid "Directory: `tests/statements/while`" msgstr "" #: ../../doc/src/progress.md msgid "`Simple while loops`" msgstr "" #: ../../doc/src/progress.md msgid "[while_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`exit / cycle in while loops`" msgstr "" #: ../../doc/src/progress.md msgid "[while_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_02.f90)" msgstr "" #: ../../doc/src/progress.md:179 msgid "Print Statement" msgstr "" #: ../../doc/src/progress.md:181 msgid "Directory: `tests/statements/print`" msgstr "" #: ../../doc/src/progress.md msgid "`Basic print`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/print/t01.f90)" msgstr "" #: ../../doc/src/progress.md:188 msgid "Open, Read, Write, Close Statement" msgstr "" #: ../../doc/src/progress.md:190 msgid "Directory: `tests/statements/file_io`" msgstr "" #: ../../doc/src/progress.md msgid "`open/read/write/close`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/file_io/t01.f90)" msgstr "" #: ../../doc/src/progress.md:197 msgid "Intrinsic Functions" msgstr "" #: ../../doc/src/progress.md:199 msgid "abs" msgstr "" #: ../../doc/src/progress.md:201 msgid "Directory: `tests/intrinsic/abs`" msgstr "" #: ../../doc/src/progress.md msgid "`scalar single/double real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md msgid "`scalar single/double complex`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md msgid "`array 1D single/double real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:210 msgid "exp" msgstr "" #: ../../doc/src/progress.md:212 msgid "Directory: `tests/intrinsic/exp`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:221 msgid "log" msgstr "" #: ../../doc/src/progress.md:223 msgid "Directory: `tests/intrinsic/log`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:232 msgid "sqrt" msgstr "" #: ../../doc/src/progress.md:234 msgid "Directory: `tests/intrinsic/sqrt`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:243 msgid "sin" msgstr "" #: ../../doc/src/progress.md:245 msgid "Directory: `tests/intrinsic/sin`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:254 msgid "cos" msgstr "" #: ../../doc/src/progress.md:256 msgid "Directory: `tests/intrinsic/cos`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:265 msgid "tan" msgstr "" #: ../../doc/src/progress.md:267 msgid "Directory: `tests/intrinsic/tan`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:276 msgid "sinh" msgstr "" #: ../../doc/src/progress.md:278 msgid "Directory: `tests/intrinsic/sinh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:287 msgid "cosh" msgstr "" #: ../../doc/src/progress.md:289 msgid "Directory: `tests/intrinsic/cosh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:298 msgid "tanh" msgstr "" #: ../../doc/src/progress.md:300 msgid "Directory: `tests/intrinsic/tanh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:309 msgid "asin" msgstr "" #: ../../doc/src/progress.md:311 msgid "Directory: `tests/intrinsic/asin`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:320 msgid "acos" msgstr "" #: ../../doc/src/progress.md:322 msgid "Directory: `tests/intrinsic/acos`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:331 msgid "atan" msgstr "" #: ../../doc/src/progress.md:333 msgid "Directory: `tests/intrinsic/atan`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:342 msgid "modulo" msgstr "" #: ../../doc/src/progress.md:344 msgid "Directory: `tests/intrinsic/modulo`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:352 msgid "mod" msgstr "" #: ../../doc/src/progress.md:354 msgid "Directory: `tests/intrinsic/mod`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:362 msgid "min" msgstr "" #: ../../doc/src/progress.md:364 msgid "Directory: `tests/intrinsic/min`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:371 msgid "max" msgstr "" #: ../../doc/src/progress.md:373 msgid "Directory: `tests/intrinsic/max`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:380 msgid "int" msgstr "" #: ../../doc/src/progress.md:382 msgid "Directory: `tests/intrinsic/int`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:389 msgid "real" msgstr "" #: ../../doc/src/progress.md:391 msgid "Directory: `tests/intrinsic/real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:398 msgid "floor" msgstr "" #: ../../doc/src/progress.md:400 msgid "Directory: `tests/intrinsic/floor`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:407 msgid "nint" msgstr "" #: ../../doc/src/progress.md:409 msgid "Directory: `tests/intrinsic/nint`" 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 "" lfortran-0.63.0/doc/locale/nl/0000775000175000017500000000000015174404631016235 5ustar alastairalastairlfortran-0.63.0/doc/locale/nl/LC_MESSAGES/0000775000175000017500000000000015174404631020022 5ustar alastairalastairlfortran-0.63.0/doc/locale/nl/LC_MESSAGES/docs.po0000664000175000017500000042424715174404631021327 0ustar alastairalastair# SOME DESCRIPTIVE TITLE. # Copyright (C) 2022 LFortran contributors # This file is distributed under the same license as the LFortran package. # FIRST AUTHOR , 2022. # #, fuzzy msgid "" msgstr "" "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" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.10.3\n" #: ../../doc/src/ast_and_asr.ipynb:9 msgid "Difference between an AST and ASR" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:11 msgid "Let us take a simple Fortran code:" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:22 msgid "and look at how the AST and ASR looks like." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:25 ../../doc/src/progress.md msgid "AST" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:76 msgid "" "The AST does not have any semantic information, but has nodes to " "represent declarations such as ``integer, intent(in) :: a``. Variables " "such as ``a`` are represented by a ``Name`` node, and are not connected " "to their declarations yet." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:88 ../../doc/src/progress.md msgid "ASR" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:139 msgid "" "The ASR has all the semantic information (types, etc.), nodes like " "``Function`` have a symbol table and do not have any declaration nodes. " "Variables are simply pointers to the symbol table." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:142 msgid "Discussion" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:144 msgid "" "The above was a simple example. Things get more apparent for more " "complicated examples, such as:" msgstr "" #: ../../doc/src/ast_and_asr.ipynb:160 msgid "" "AST must represent all the ``use`` statements and the ``interface`` " "block, and keep things semantically consistent." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:162 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" " are defined in the ``gfort_interop`` module, and so ASR does not have " "any of these declaration nodes." msgstr "" #: ../../doc/src/ast_and_asr.ipynb:164 msgid "" "When converting from ASR to AST, LFortran will create all the appropriate" " AST declaration nodes automatically and correctly." msgstr "" #: ../../doc/src/contributing.md:1 msgid "Contributing" msgstr "" #: ../../doc/src/contributing.md:3 msgid "" "We welcome contributions from anyone, even if you are new to open source." " It might sound daunting to contribute to a compiler at first, but please" " do, it is not complicated. We will help you with any technical issues " "and help improve your contribution so that it can be merged." msgstr "" #: ../../doc/src/contributing.md:8 msgid "Basic Setup" msgstr "" #: ../../doc/src/contributing.md:10 msgid "To contribute, make sure your set up:" msgstr "" #: ../../doc/src/contributing.md:12 msgid "Your username + email" msgstr "" #: ../../doc/src/contributing.md:13 msgid "Your `~/.gitconfig`" msgstr "" #: ../../doc/src/contributing.md:14 msgid "Your shell prompt to display the current branch name" msgstr "" #: ../../doc/src/contributing.md:16 msgid "Fork LFortran" msgstr "" #: ../../doc/src/contributing.md:18 msgid "" "Step 1. Create a fork of the [project " "repository](https://github.com/lfortran/lfortran)" msgstr "" #: ../../doc/src/contributing.md:20 msgid "" "Step 2. Set up your [SSH key](https://docs.github.com/en/authentication" "/connecting-to-github-with-ssh) with GitHub" msgstr "" #: ../../doc/src/contributing.md:22 msgid "" "Step 3. Clone the project repository from GitHub and set up your remote " "repository" msgstr "" #: ../../doc/src/contributing.md:29 msgid "" ":fontawesome-solid-edit: `REMOTE_NAME` is the name of your remote " "repository and could be any name you like, for example your first name." msgstr "" #: ../../doc/src/contributing.md:31 msgid "" ":fontawesome-solid-edit: `YOUR_GITHUB_ID` is your user ID on GitHub and " "should be part of your account path." msgstr "" #: ../../doc/src/contributing.md:33 msgid "" "You can use `git remote -v` to check if the new remote is set up " "correctly." msgstr "" #: ../../doc/src/contributing.md:35 msgid "Send a New Merge Request" msgstr "" #: ../../doc/src/contributing.md:37 msgid "Step 1. Create a new branch" msgstr "" #: ../../doc/src/contributing.md:42 msgid "Step 2. Make changes in relevant file(s)" msgstr "" #: ../../doc/src/contributing.md:44 msgid "Step 3. Commit the changes:" msgstr "" #: ../../doc/src/contributing.md:51 msgid "" "[Here](https://chris.beams.io/posts/git-commit/) are some great tips on " "writing good commit messages." msgstr "" #: ../../doc/src/contributing.md:53 msgid "Step 4. Check to ensure that your changes look good" msgstr "" #: ../../doc/src/contributing.md:58 msgid "Step 5. Send the merge request" msgstr "" #: ../../doc/src/contributing.md:64 msgid "" "The command will push the new branch `fix1` into your remote repository " "`REMOTE_NAME` that you created earlier. Additionally, it will also " "display a link that you can click on to open the new merge request. After" " clicking on the link, write a title and a concise description then click" " the \"Create\" button. Yay you are now all set." msgstr "" #: ../../doc/src/contributing.md:66 msgid "Add New Features" msgstr "" #: ../../doc/src/contributing.md:68 msgid "" "The example below shows the steps it would take to create a caret binary " "operator **^** which computes the average value of the two operands." msgstr "" #: ../../doc/src/contributing.md:70 msgid "Create New Token(s)" msgstr "" #: ../../doc/src/contributing.md:72 msgid "" "We extend the *tokenizer.re* as well as *parser.yy* to add the new token " "**^**. We also tell LFortran how to print the new token in *parser.cpp*." msgstr "" #: ../../doc/src/contributing.md:75 msgid ":fontawesome-solid-code: *src/lfortran/parser/tokenizer.re*" msgstr "" #: ../../doc/src/contributing.md:80 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.yy*" msgstr "" #: ../../doc/src/contributing.md:85 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.cpp*" msgstr "" #: ../../doc/src/contributing.md:94 msgid "The added code is tested with `lfortran --show-tokens examples2/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:96 msgid "Parse the New Token" msgstr "" #: ../../doc/src/contributing.md:98 msgid "" "Now we have to parse the new operator. We add it to the AST by extending " "the BinOp with a caret operator and modifying the *AST.asdl* file. Then " "we add it in *parse.yy* to properly parse and generate the new AST in " "*semantics.h*.Finally we extend *pickle.cpp* so that the new operator can" " print itself." msgstr "" #: ../../doc/src/contributing.md:102 msgid ":fontawesome-solid-code:*grammar/AST.asdl*" msgstr "" #: ../../doc/src/contributing.md:107 msgid ":fontawesome-solid-code:*src/lfortran/parser/parser.yy*" msgstr "" #: ../../doc/src/contributing.md:116 msgid ":fontawesome-solid-code:*src/lfortran/parser/semantics.h*" msgstr "" #: ../../doc/src/contributing.md:121 msgid ":fontawesome-solid-code:*src/lfortran/pickle.cpp*" msgstr "" #: ../../doc/src/contributing.md:132 msgid "The section is tested with `lfortran --show-ast examples/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:134 msgid "Implement the Semantics of the New Token" msgstr "" #: ../../doc/src/contributing.md:136 msgid "" "We first extend the ASR in *ASR.asdl* and add ^ as a BinOp operator " "option." msgstr "" #: ../../doc/src/contributing.md:138 msgid ":fontawesome-solid-code:*src/libasr/ASR.asdl*" msgstr "" #: ../../doc/src/contributing.md:142 msgid ":fontawesome-solid-code:*src/lfortran/semantics/ast_common_visitor.h*" msgstr "" #: ../../doc/src/contributing.md:179 msgid "" "Then we transform it from AST to ASR by extending " "*src/lfortran/semantics/ast_common_visitor.h*." msgstr "" #: ../../doc/src/contributing.md:181 msgid "" "We also add it into compile time evaluation triggered by expressions such" " as `e = (2+3)^5` which is evaluated at compile time. An expression such " "as `e = x^5` is evaluated at run time only." msgstr "" #: ../../doc/src/contributing.md:183 msgid "The section is tested with `lfortran --show-asr examples/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:184 msgid "Implement the New Token in LLVM" msgstr "" #: ../../doc/src/contributing.md:186 msgid "" "To implement in LLVM, we extend the BinOp translation by handling the new" " operator. We first add the two numbers then divide by two. :fontawesome-" "solid-code:*src/lfortran/codegen/asr_to_llvm.cpp*" msgstr "" #: ../../doc/src/contributing.md:217 msgid "The section is tested with `lfortran --show-llvm examples/expr2.f90`" msgstr "" #: ../../doc/src/contributing.md:219 msgid "Now when LLVM works, we can test the final executable by:" msgstr "" #: ../../doc/src/contributing.md:224 msgid "And it should print 6." msgstr "" #: ../../doc/src/contributing.md:226 msgid "It also works interactively:" msgstr "" #: ../../doc/src/contributing.md:242 msgid "Reach Out" msgstr "" #: ../../doc/src/contributing.md:244 msgid "" "If you have any questions or need help, please ask as at our " "[mailinglist](https://groups.io/g/lfortran) or a " "[chat](https://lfortran.zulipchat.com/)." msgstr "" #: ../../doc/src/contributing.md:248 msgid "" "Please note that all participants of this project are expected to follow " "our Code of Conduct. By participating in this project you agree to abide " "by its terms. See " "[CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/blob/main/CODE_OF_CONDUCT.md)." msgstr "" #: ../../doc/src/contributing.md:252 msgid "" "By submitting a PR you agree to license your contribution under the " "LFortran's BSD " "[license](https://github.com/lfortran/lfortran/blob/main/LICENSE) unless " "explicitly noted otherwise." msgstr "" #: ../../doc/src/design.md:1 msgid "LFortran Design" msgstr "" #: ../../doc/src/design.md:3 msgid "High Level Overview" msgstr "" #: ../../doc/src/design.md:5 ../../doc/src/developer_tutorial.ipynb:16 msgid "" "LFortran is structured around two independent modules, AST and ASR, both " "of which are standalone (completely independent of the rest of LFortran) " "and users are encouraged to use them independently for other applications" " and build tools on top:" msgstr "" #: ../../doc/src/design.md:10 msgid "" "Abstract Syntax Tree (AST), module `lfortran.ast`: Represents any Fortran" " source code, strictly based on syntax, no semantic is included. The AST " "module can convert itself to Fortran source code." msgstr "" #: ../../doc/src/design.md:14 msgid "" "Abstract Semantic Representation (ASR), module `lfortran.asr`: Represents" " a valid Fortran source code, all semantic is included. Invalid Fortran " "code is not allowed (an error will be given). The ASR module can convert " "itself to an AST." msgstr "" #: ../../doc/src/design.md:19 msgid "" "The LFortran compiler is then composed of the following independent " "stages:" msgstr "" #: ../../doc/src/design.md:21 msgid "Parsing: converts Fortran source code to an AST" msgstr "" #: ../../doc/src/design.md:22 msgid "Semantic: converts an AST to an ASR" msgstr "" #: ../../doc/src/design.md:23 msgid "" "High level optimizations: optimize ASR to a possibly faster/simpler ASR " "(things like inlining functions, eliminating redundant expressions or " "statements, etc.)" msgstr "" #: ../../doc/src/design.md:26 msgid "" "LLVM IR code generation and lower level optimizations: converts an ASR to" " an LLVM IR. This stage also does all other optimizations that do not " "produce an ASR, but still make sense to do before passing to LLVM IR." msgstr "" #: ../../doc/src/design.md:29 msgid "" "Machine code generation: LLVM then does all its optimizations and " "generates machine code (such as a binary executable, a library, an object" " file, or it is loaded and executed using JIT as part of the interactive " "LFortran session or in a Jupyter kernel)." msgstr "" #: ../../doc/src/design.md:34 msgid "" "LFortran is structured as a library, and so one can for example use the " "parser to obtain an AST and do something with it, or one can then use the" " semantic analyzer to obtain ASR and do something with it. One can " "generate the ASR directly (e.g., from SymPy) and then either convert to " "AST and to a Fortran source code, or use LFortran to compile it to " "machine code directly. In other words, one can use LFortran to easily " "convert between the three equivalent representations:" msgstr "" #: ../../doc/src/design.md:42 msgid "Fortran source code" msgstr "" #: ../../doc/src/design.md:43 ../../doc/src/developer_tutorial.ipynb:23 msgid "Abstract Syntax Tree (AST)" msgstr "" #: ../../doc/src/design.md:44 ../../doc/src/developer_tutorial.ipynb:159 msgid "Abstract Semantic Representation (ASR)" msgstr "" #: ../../doc/src/design.md:46 msgid "They are all equivalent in the following sense:" msgstr "" #: ../../doc/src/design.md:48 msgid "Any ASR can always be converted to an equivalent AST" msgstr "" #: ../../doc/src/design.md:49 msgid "Any AST can always be converted to an equivalent Fortran source code" msgstr "" #: ../../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 "" #: ../../doc/src/design.md:52 msgid "" "Any AST can always be either converted to an equivalent ASR or one gets a" " semantic error" msgstr "" #: ../../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 "" #: ../../doc/src/design.md:58 msgid "ASR Design Details" msgstr "" #: ../../doc/src/design.md:60 msgid "The ASR is designed to have the following features:" msgstr "" #: ../../doc/src/design.md:62 msgid "" "ASR is still semantically equivalent to the original Fortran code (it did" " not lose any semantic information). ASR can be converted to AST, and AST" " to Fortran source code which is functionally equivalent to the original." msgstr "" #: ../../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 "" #: ../../doc/src/design.md:69 msgid "" "The ASR C++ classes (down the road) are designed similarly to SymEngine: " "they are constructed once and after that they are immutable. The " "constructor checks in Debug more that all the requirements are met (e.g.," " that all Variables in a Function have a dummy argument set, that " "explicit-shape arrays are not allocatable and all other Fortran " "requirements to make it a valid code), but in Release mode it quickly " "constructs the class without checks. Then there are builder classes that " "construct the ASR C++ classes to meet requirements (checked in Debug " "mode) and the builder gives an error message if a code is not a valid " "Fortran code, and if it doesn't give an error message, then the ASR C++ " "classes are constructed correctly. Thus by construction, the ASR classes " "always contain valid Fortran code and the rest of LFortran can depend on " "it." msgstr "" #: ../../doc/src/design.md:82 msgid "Notes:" msgstr "" #: ../../doc/src/design.md:84 msgid "" "Information that is lost when parsing source to AST: whitespace, " "multiline/single line if statement distinction, case sensitivity of " "keywords." msgstr "" #: ../../doc/src/design.md:87 msgid "" "Information that is lost when going from AST to ASR: detailed syntax how " "variables were defined and the order of type attributes (whether array " "dimension is using the `dimension` attribute, or parentheses at the " "variable; or how many variables there are per declaration line or their " "order), as ASR only represents the aggregated type information in the " "symbol table." msgstr "" #: ../../doc/src/design.md:90 msgid "" "ASR is the simplest way to generate Fortran code, as one does not have to" " worry about the detailed syntax (as in AST) about how and where things " "are declared. One specifies the symbol table for a module, then for each " "symbol (functions, global variables, types, ...) one specifies the local " "variables and if this is an interface then one needs to specify where one" " can find an implementation, otherwise a body is supplied with " "statements, those nodes are almost the same as in AST, except that each " "variable is just a reference to a symbol in the symbol table (so by " "construction one cannot have undefined variables). The symbol table for " "each node such as Function or Module also references its parent (for " "example a function references a module, a module references the global " "scope)." msgstr "" #: ../../doc/src/design.md:102 msgid "" "The ASR can be directly converted to an AST without gathering any other " "information. And the AST directly to Fortran source code." msgstr "" #: ../../doc/src/design.md:105 msgid "" "The ASR is always representing a semantically valid Fortran code. This " "is enforced by checks in the ASR C++ constructors (in Debug build). When " "an ASR is used, one can assume it is valid." msgstr "" #: ../../doc/src/design.md:109 msgid "Fortran 2008" msgstr "" #: ../../doc/src/design.md:111 msgid "" "Fortran 2008 [standard](https://j3-fortran.org/doc/year/10/10-007.pdf) " "chapter 2 \"Fortran concepts\" specifies that Fortran code is a " "collection of _program units_ (either all in one file, or in separate " "files), where each _program unit_ is one of:" msgstr "" #: ../../doc/src/design.md:116 ../../doc/src/design.md:131 msgid "main program" msgstr "" #: ../../doc/src/design.md:117 ../../doc/src/design.md:132 msgid "module or submodule" msgstr "" #: ../../doc/src/design.md:118 ../../doc/src/design.md:133 msgid "function or subroutine" msgstr "" #: ../../doc/src/design.md:120 msgid "" "Note: It can also be a _block data_ program unit, that is used to provide" " initial values for data objects in named _common blocks_, but we do not " "recommend the use of _common blocks_ (use modules instead)." msgstr "" #: ../../doc/src/design.md:124 msgid "LFortran Extension" msgstr "" #: ../../doc/src/design.md:126 msgid "" "We extend the Fortran language by introducing a _global scope_, which is " "not only the list of _program units_ (as in F2008) but can also include " "statements, declarations, use statements and expressions. We define " "_global scope_ as a collection of the following items:" msgstr "" #: ../../doc/src/design.md:134 msgid "use statement" msgstr "" #: ../../doc/src/design.md:135 msgid "declaration" msgstr "" #: ../../doc/src/design.md:136 msgid "statement" msgstr "" #: ../../doc/src/design.md:137 msgid "expression" msgstr "" #: ../../doc/src/design.md:139 msgid "" "In addition, if a variable is not defined in an assignment statement " "(such as `x = 5+3`) then the type of the variable is inferred from the " "right hand side (e.g., `x` in `x = 5+3` would be of type `integer`, and " "`y` in `y = 5._dp` would be of type `real(dp)`). This rule only applies " "at the top level of _global scope_. Types must be fully specified inside " "main programs, modules, functions and subroutines, just like in F2008." msgstr "" #: ../../doc/src/design.md:146 msgid "" "The _global scope_ has its own symbol table. The main program and " "module/submodule do not see any symbols from this symbol table. But " "functions, subroutines, statements and expressions at the top level of " "_global scope_ use and operate on this symbol table." msgstr "" #: ../../doc/src/design.md:151 msgid "" "The _global scope_ has the following symbols predefined in the symbol " "table:" msgstr "" #: ../../doc/src/design.md:153 msgid "" "the usual standard set of Fortran functions (such as `size`, `sin`, " "`cos`, ...)" msgstr "" #: ../../doc/src/design.md:155 msgid "" "the `dp` double precision symbol, so that one can use `5._dp` for double " "precision." msgstr "" #: ../../doc/src/design.md:158 msgid "" "Each item in the _global scope_ is interpreted as follows: main program " "is compiled into an executable with the same name and executed; modules, " "functions and subroutines are compiled and loaded; use statement and " "declaration adds those symbols with the proper type into the _global " "scope_ symbol table, but do not generate any code; statement is wrapped " "into an anonymous subroutine with no arguments, compiled, loaded and " "executed; expression is wrapped into an anonymous function with no " "arguments returning the expression, compiled, loaded, executed and the " "return value is returned to the user." msgstr "" #: ../../doc/src/design.md:168 msgid "" "The _global scope_ is always interpreted, item by item, per the previous " "paragraph. It is meant to allow interactive usage, experimentations and " "writing simple scripts. Code in _global scope_ must be interpreted using " "`lfortran`. For more complex (production) code it is recommended to turn " "it into modules and programs (by wrapping loose statements into " "subroutines or functions and by adding type declarations) and compile it " "with `lfortran` or any other Fortran compiler." msgstr "" #: ../../doc/src/design.md:176 msgid "Here are some examples of valid code in _global scope_:" msgstr "" #: ../../doc/src/design.md:178 msgid "Example 1" msgstr "" #: ../../doc/src/design.md:185 msgid "Example 2" msgstr "" #: ../../doc/src/design.md:197 msgid "Example 3" msgstr "" #: ../../doc/src/design.md:209 msgid "Example 4" msgstr "" #: ../../doc/src/design.md:217 msgid "Design Considerations" msgstr "" #: ../../doc/src/design.md:219 msgid "" "The LFortran extension of Fortran was chosen in a way so as to minimize " "the number of changes. In particular, only the top level of the _global " "scope_ has relaxed some of the Fortran rules (such as making specifying " "types optional) so as to allow simple and quick interactive usage, but " "inside functions, subroutines, modules or programs this relaxation does " "not apply." msgstr "" #: ../../doc/src/design.md:225 msgid "" "The number of changes were kept to minimum in order to make it " "straightforward to turn code at _global scope_ into standard compliant " "Fortran code using programs and modules, so that it can be compiled by " "any Fortran compiler." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:9 msgid "Developer Tutorial" msgstr "" #: ../../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 "" #: ../../doc/src/developer_tutorial.ipynb:14 msgid "Introduction" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:18 msgid "" "Abstract Syntax Tree (AST): Represents any Fortran source code, strictly " "based on syntax, no semantic is included. The AST module can convert " "itself to Fortran source code." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:20 msgid "" "Abstract Semantic Representation (ASR): Represents a valid Fortran source" " code, all semantic is included. Invalid Fortran code is not allowed (an " "error will be given). The ASR module can convert itself to an AST." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:25 msgid "" "Fortran source code can be parsed into an AST using the ``src_to_ast()`` " "function:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:49 #, python-format msgid "We can pretty print it using the ``%%showast`` magic:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:98 #, python-format msgid "We can convert AST to Fortran source code using ``%%showfmt``:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:156 msgid "" "All AST nodes and their arguments are described in `AST.asdl " "`__." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:170 #, python-format msgid "We can pretty print using the ``%%showasr`` magic:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:219 msgid "" "All ASR nodes and their arguments are described in `ASR.asdl " "`__." msgstr "" #: ../../doc/src/index.md:134 msgid "Getting started" msgstr "" #: ../../doc/src/index.md:141 ../../doc/src/progress.md:1 msgid "LFortran Development Status" msgstr "" #: ../../doc/src/index.md:147 msgid "Developer's Guide" msgstr "" #: ../../doc/src/index.md:156 msgid "LFortran Intrinsics" msgstr "" #: ../../doc/src/index.md:1 msgid "LFortran Documentation" msgstr "" #: ../../doc/src/index.md:3 msgid "" "LFortran is a modern open-source (BSD licensed) interactive Fortran " "compiler built on top of LLVM. It can execute user's code interactively " "to allow exploratory work (much like Python, MATLAB or Julia) as well as " "compile to binaries with the goal to run user's code on modern " "architectures such as multi-core CPUs and GPUs." msgstr "" #: ../../doc/src/index.md:9 #, python-format msgid "" "Website: [https://lfortran.org/](https://lfortran.org/) Main " "repository: " "[https://github.com/lfortran/lfortran](https://github.com/lfortran/lfortran)" " Try online using Binder: " "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb)" msgstr "" #: ../../doc/src/index.md:9 msgid "Binder" msgstr "" #: ../../doc/src/index.md:16 msgid "Feature Highlights" msgstr "" #: ../../doc/src/index.md:18 msgid "" "LFortran is in development, there are features that work today, and there" " are features that are being implemented. You can also check out the " "[Development Status](progress.md) section for more information on " "features being supported and being worked on." msgstr "" #: ../../doc/src/index.md:21 msgid "Works today" msgstr "" #: ../../doc/src/index.md:23 #, python-format msgid "" "**Interactive, Jupyter support** LFortran can be used from Jupyter as a" " Fortran kernel, allowing a Python/Julia style rapid prototyping and " "exploratory workflow (see the " "[static](https://nbviewer.jupyter.org/gist/certik/f1d28a486510810d824869ab0c491b1c)" " or [interactive](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb) example notebook). Or " "it can be used from the command-line in an interactive prompt (REPL)." msgstr "" #: ../../doc/src/index.md:32 msgid "" "**Clean, modular design, usable as a library** LFortran is structured " "around two independent modules, AST and ASR, both of which are " "standalone (completely independent of the rest of LFortran) and users " "are encouraged to use them independently for other applications and " "build tools on top. See the [Design](design.md) and [Developer " "Tutorial](developer_tutorial.md) documents for more details." msgstr "" #: ../../doc/src/index.md:39 msgid "" "**Interoperation with GFortran** LFortran can parse GFortran module " "files into an ASR and generate a Fortran wrapper that can be compiled " "with any Fortran compiler and linked with the original GFortran " "compiled module." msgstr "" #: ../../doc/src/index.md:44 msgid "" "**Create executables** It can create executables just like other " "Fortran compilers." msgstr "" #: ../../doc/src/index.md:47 msgid "" "**Runs on Linux, Mac and Windows** All three platforms are regularly " "tested by our CI." msgstr "" #: ../../doc/src/index.md:51 msgid "Planned" msgstr "" #: ../../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 "" #: ../../doc/src/index.md:56 msgid "" "**Native interoperation with other languages (and other Fortran " "compilers)** It can automatically call code written in other languages " "(such as C or Python) just by using the `use` statement, see " "[#44](https://gitlab.com/lfortran/lfortran/issues/44). It understands " "other Fortran compilers module files (one can just \"use\" them) and " "their ABI to link correctly (GFortran is supported, other compilers are" " planned, see [#56](https://gitlab.com/lfortran/lfortran/issues/56)), " "which allows to use LFortran with production codes today." msgstr "" #: ../../doc/src/index.md:65 msgid "" "**Modern hardware support** Thanks to LLVM, the goal of LFortran is to " "run on modern hardware and take advantage of native Fortran language " "constructs (such as `do concurrent`) to run on multi-core CPUs and " "GPUs, see [#57](https://gitlab.com/lfortran/lfortran/issues/57)." msgstr "" #: ../../doc/src/index.md:71 msgid "" "**Full Fortran 2018 support** Currently only a subset of Fortran is " "implemented, but the goal is to have a full implementation of the " "latest Fortran 2018 standard, see " "[#58](https://gitlab.com/lfortran/lfortran/issues/58)." msgstr "" #: ../../doc/src/index.md:77 msgid "" "Please vote on issues in our [issue " "tracker](https://gitlab.com/lfortran/lfortran/issues) that you want us to" " prioritize (feel free to create new ones if we are missing anything)." msgstr "" #: ../../doc/src/index.md:81 msgid "Roadmap" msgstr "" #: ../../doc/src/index.md:83 msgid "Here is our roadmap how to get all the planned features above implemented:" msgstr "" #: ../../doc/src/index.md:85 msgid "" "Port code generation to use ASR and pass all the current tests " "([#74](https://gitlab.com/lfortran/lfortran/issues/74)). Remove the old " "code generation and old semantics, that used to annotate the AST tree, " "which was messy." msgstr "" #: ../../doc/src/index.md:89 msgid "" "Get GFortran module files working with `use` module, both assumed-size " "and assumed-shape arrays " "([#52](https://gitlab.com/lfortran/lfortran/issues/52)). This will allow " "right away to use production codes with LFortran." msgstr "" #: ../../doc/src/index.md:93 msgid "Do these at the same time:" msgstr "" #: ../../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 "" #: ../../doc/src/index.md:98 msgid "" "b) Gradually move to C++ for robustness and speed " "([#70](https://gitlab.com/lfortran/lfortran/issues/70)). The Python API " "will not change (or only minimally), so the user experience from Python " "will not change." msgstr "" #: ../../doc/src/index.md:103 msgid "" "c) Implement all the other cool features: `use` module for C and Python " "and automatic wrappers " "([#44](https://gitlab.com/lfortran/lfortran/issues/44)), modern hardware" " support ([#57](https://gitlab.com/lfortran/lfortran/issues/57)), " "generating an older standard of Fortran " "([#72](https://gitlab.com/lfortran/lfortran/issues/72)), Fortran doctest" " feature ([#73](https://gitlab.com/lfortran/lfortran/issues/73)), SymPy" " integration ([#71](https://gitlab.com/lfortran/lfortran/issues/71)), " "language service for IDEs " "([#12](https://gitlab.com/lfortran/lfortran/issues/12)), and other ideas" " ([#29](https://gitlab.com/lfortran/lfortran/issues/29))." msgstr "" #: ../../doc/src/index.md:118 msgid "The step 1. is an internal refactoring that will not take long." msgstr "" #: ../../doc/src/index.md:120 msgid "" "The step 2. will allow LFortran to be used interactively with production " "codes right away (the production code will get compiled with GFortran, " "then one \"uses\" any module in LFortran and functions/subroutines can be" " interactively called, the module itself can use any GFortran supported " "feature, but the API must fit into the subset that LFortran understands " "--- for large number of applications simple functions/subroutines with " "array arguments are enough). This will make LFortran usable for first " "users and one can always use GFortran temporarily until LFortran supports" " the given feature. We expect to be finished with the step 2. by the end " "of summer 2019, hopefully sooner." msgstr "" #: ../../doc/src/index.md:130 msgid "" "Finally the step 3. will improve LFortran overall, allowing the first " "users to contribute back, growing the community and making LFortran " "gradually useful for more and more people." msgstr "" #: ../../doc/src/installation.md:1 msgid "Installation" msgstr "" #: ../../doc/src/installation.md:3 msgid "All the instructions below work on Linux, macOS and Windows." msgstr "" #: ../../doc/src/installation.md:5 msgid "Binaries" msgstr "" #: ../../doc/src/installation.md:7 msgid "" "The recommended way to install LFortran is using Conda. Install Conda for" " example by installing the " "[Miniconda](https://conda.io/en/latest/miniconda.html) installation by " "following instructions there for your platform. Then create a new " "environment (you can choose any name, here we chose `lf`) and activate " "it:" msgstr "" #: ../../doc/src/installation.md:16 msgid "Then install LFortran by:" msgstr "" #: ../../doc/src/installation.md:20 msgid "" "Now the `lf` environment has the `lfortran` compiler available, you can " "start the interactive prompt by executing `lfortran`, or see the command " "line options using `lfortran -h`." msgstr "" #: ../../doc/src/installation.md:24 msgid "" "The Jupyter kernel is automatically installed by the above command, so " "after installing Jupyter itself:" msgstr "" #: ../../doc/src/installation.md:28 msgid "You can create a Fortran based Jupyter notebook by executing:" msgstr "" #: ../../doc/src/installation.md:32 msgid "and selecting `New->Fortran`." msgstr "" #: ../../doc/src/installation.md:35 msgid "Build From a Source Tarball" msgstr "" #: ../../doc/src/installation.md:37 msgid "" "This method is the recommended method if you just want to install " "LFortran, either yourself or in a package manager (Spack, Conda, Debian, " "etc.). The source tarball has all the generated files included and has " "minimal dependencies." msgstr "" #: ../../doc/src/installation.md:39 msgid "First we have to install dependencies, for example using Conda:" msgstr "" #: ../../doc/src/installation.md:44 msgid "" "Then download a tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), e.g.:" msgstr "" #: ../../doc/src/installation.md:52 msgid "And build:" msgstr "" #: ../../doc/src/installation.md:58 msgid "This will install the `lfortran` into the `inst/bin`." msgstr "" #: ../../doc/src/installation.md:60 msgid "Build From Git" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/installation.md:72 msgid "Then prepare the environment:" msgstr "" #: ../../doc/src/installation.md:77 msgid "Clone the LFortran git repository:" msgstr "" #: ../../doc/src/installation.md:82 msgid "" "Generate files that are needed for the build (this step depends on " "`re2c`, `bison` and `python`):" msgstr "" #: ../../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 "" #: ../../doc/src/installation.md:92 msgid "Run tests:" msgstr "" #: ../../doc/src/installation.md:97 msgid "Run an interactive prompt:" msgstr "" #: ../../doc/src/installation.md:102 msgid "Build from Git on Windows with Visual Studio" msgstr "" #: ../../doc/src/installation.md:104 msgid "" "Install Visual Studio (MSVC), for example the version 2022, you can " "download the Community version for free from: " "https://visualstudio.microsoft.com/downloads/." msgstr "" #: ../../doc/src/installation.md:107 msgid "" "Install miniforge using the Windows installer from https://github.com" "/conda-forge/miniforge." msgstr "" #: ../../doc/src/installation.md:109 msgid "Launch the Miniforge Prompt from the Desktop." msgstr "" #: ../../doc/src/installation.md:111 msgid "In the shell, initialize the MSVC compiler using:" msgstr "" #: ../../doc/src/installation.md:117 msgid "You can optionally test that MSVC works by:" msgstr "" #: ../../doc/src/installation.md:122 msgid "Both commands must print help (several pages)." msgstr "" #: ../../doc/src/installation.md:124 msgid "Now you can download and build LFortran:" msgstr "" #: ../../doc/src/installation.md:134 msgid "If everything compiled, then you can use LFortran as follows:" msgstr "" #: ../../doc/src/installation.md:140 msgid "And so on." msgstr "" #: ../../doc/src/installation.md:142 msgid "" "Note: LFortran currently uses the MSVC's linker program (`link`), which " "is only available when the MSVC bat script above is ran. If you forget to" " activate it, LFortran's linking will fail." msgstr "" #: ../../doc/src/installation.md:146 msgid "" "Note: the miniforge shell seems to be running some version of `git-bash` " "(although it is `cmd.exe`), which has some unix-like filesystem mounted " "in `/usr` and several commands available such as `ls`, `which`, `git`, " "`vim`. For this reason the Conda build `environment_win.yml` contains " "everything needed, including `git`." msgstr "" #: ../../doc/src/installation.md:152 msgid "Build from Git on Windows with WSL" msgstr "" #: ../../doc/src/installation.md:153 msgid "In windows search \"turn windows features on or off\"." msgstr "" #: ../../doc/src/installation.md:154 msgid "Tick Windows subsystem for Linux." msgstr "" #: ../../doc/src/installation.md:155 msgid "Press OK and restart computer." msgstr "" #: ../../doc/src/installation.md:156 msgid "Go to Microsoft store and download Ubuntu 20.04, and launch it." msgstr "" #: ../../doc/src/installation.md:157 msgid "Run the following commands." msgstr "" #: ../../doc/src/installation.md:164 msgid "Now do the following to configure the path" msgstr "" #: ../../doc/src/installation.md:168 msgid "Then go to the bottom of the file and paste the following" msgstr "" #: ../../doc/src/installation.md:172 msgid "Then press ctrl + O (save), Enter (confirm), ctrl + X (exit)" msgstr "" #: ../../doc/src/installation.md:173 msgid "After that restart Ubuntu" msgstr "" #: ../../doc/src/installation.md:174 msgid "Run the following" msgstr "" #: ../../doc/src/installation.md:179 msgid "Restart Ubuntu again" msgstr "" #: ../../doc/src/installation.md:187 msgid "" "You can change the directory to a Windows location using `cd /mnt/[drive " "letter]/[windows location]`." msgstr "" #: ../../doc/src/installation.md:188 msgid "e.g. `cd mnt/c/Users/name/source/repos/`" msgstr "" #: ../../doc/src/installation.md:190 msgid "Now clone the LFortran git repository" msgstr "" #: ../../doc/src/installation.md:196 msgid "Run the following commands" msgstr "" #: ../../doc/src/installation.md:204 msgid "If everything compiles, you can use LFortran as follows" msgstr "" #: ../../doc/src/installation.md:210 msgid "Run an interactive prompt" msgstr "" #: ../../doc/src/installation.md:215 msgid "Run tests" msgstr "" #: ../../doc/src/installation.md:221 msgid "Enabling the Jupyter Kernel" msgstr "" #: ../../doc/src/installation.md:223 msgid "To install the Jupyter kernel, install the following Conda packages also:" msgstr "" #: ../../doc/src/installation.md:227 msgid "" "and enable the kernel by `-DWITH_XEUS=yes` and install into " "`$CONDA_PREFIX`. For example:" msgstr "" #: ../../doc/src/installation.md:239 msgid "" "To use it, install Jupyter (`conda install jupyter`) and test that the " "LFortran kernel was found:" msgstr "" #: ../../doc/src/installation.md:244 msgid "Then launch a Jupyter notebook as follows:" msgstr "" #: ../../doc/src/installation.md:248 msgid "Click `New->Fortran`. To launch a terminal jupyter LFortran console:" msgstr "" #: ../../doc/src/installation.md:254 msgid "Build From Git with Nix" msgstr "" #: ../../doc/src/installation.md:256 msgid "" "One of the ways to ensure exact environment and dependencies is with " "`nix`. This will ensure that system dependencies do not interfere with " "the development environment. If you want, you can report bugs in a `nix-" "shell` environment to make it easier for others to reproduce." msgstr "" #: ../../doc/src/installation.md:258 msgid "With Root" msgstr "" #: ../../doc/src/installation.md:260 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 "" #: ../../doc/src/installation.md:264 msgid "Without Root" msgstr "" #: ../../doc/src/installation.md:266 msgid "" "If you would like to not provide `nix` with root access to your machine, " "on Linux distributions we can use [nix-" "portable](https://github.com/DavHau/nix-portable)." msgstr "" #: ../../doc/src/installation.md:270 msgid "" "Now just prepend all `nix-shell` commands with `NP_RUNTIME=bwrap ./nix-" "portable `. So:" msgstr "" #: ../../doc/src/installation.md:278 msgid "Development" msgstr "" #: ../../doc/src/installation.md:280 msgid "Now we can enter the development environment:" msgstr "" #: ../../doc/src/installation.md:284 msgid "" "The `--pure` flag ensures no system dependencies are used in the " "environment." msgstr "" #: ../../doc/src/installation.md:286 msgid "The build steps are the same as with the `ci`:" msgstr "" #: ../../doc/src/installation.md:292 msgid "" "To change the compilation environment from `gcc` (default) to `clang` we " "can use `--argstr`:" msgstr "" #: ../../doc/src/installation.md:297 msgid "Note About Dependencies" msgstr "" #: ../../doc/src/installation.md:299 msgid "" "End users (and distributions) are encouraged to use the tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), which " "only depends on LLVM, CMake and a C++ compiler." msgstr "" #: ../../doc/src/installation.md:303 msgid "" "The tarball is generated automatically by our CI (continuous integration)" " and contains some autogenerated files: the parser, the AST and ASR " "nodes, which is generated by an ASDL translator (requires Python)." msgstr "" #: ../../doc/src/installation.md:307 msgid "The instructions from git are to be used when developing LFortran itself." msgstr "" #: ../../doc/src/installation.md:309 msgid "Note for users who do not use Conda" msgstr "" #: ../../doc/src/installation.md:311 msgid "" "Following are the dependencies necessary for installing this repository " "in development mode," msgstr "" #: ../../doc/src/installation.md:314 msgid "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" msgstr "" #: ../../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 "" #: ../../doc/src/installation.md:316 msgid "[re2c - 2.0.3](https://re2c.org/install/install.html)" msgstr "" #: ../../doc/src/installation.md:317 msgid "" "[binutils - " "2.31.90](ftp://sourceware.org/pub/binutils/snapshots/binutils-2.31.90.tar.xz)" " - Make sure that you should enable the required options related to this " "dependency to build the dynamic libraries (the ones ending with `.so`)." msgstr "" #: ../../doc/src/installation.md:319 msgid "Stacktraces" msgstr "" #: ../../doc/src/installation.md:321 msgid "" "LFortran can print stacktraces when there is an unhandled exception, as " "well as on any compiler error with the `--show-stacktrace` option. This " "is very helpful for developing the compiler itself to see where in " "LFortran the problem is. The stacktrace support is turned off by default," " to enable it, compile LFortran with the `-DWITH_STACKTRACE=yes` cmake " "option after installing the prerequisites on each platform per the " "instructions below." msgstr "" #: ../../doc/src/installation.md:328 msgid "Ubuntu" msgstr "" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." msgstr "" #: ../../doc/src/installation.md:332 msgid "macOS" msgstr "" #: ../../doc/src/installation.md:334 msgid "" "If you use the default Clang compiler on macOS, then the stacktraces " "should just work on both Intel and M1 based macOS (the CMake build system" " automatically invokes the `dsymtuil` tool and our Python scripts to " "store the debug information, see `src/bin/CMakeLists.txt` for more " "details). If it does not work, please report a bug." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/installation.md:352 msgid "" "and compile LFortran with the " "`-DCMAKE_PREFIX_PATH=\"$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX\"` cmake" " option. The `$CONDA_PREFIX` is there if you install some other " "dependencies (such as `llvm`) using Conda, otherwise you can remove it." msgstr "" #: ../../doc/src/intrinsics/array.md:1 msgid "Array Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:1 msgid "allocated(x): Status Check" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:3 msgid "Logical status of an allocatable integer." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:5 #: ../../doc/src/intrinsics/array/cshift.md:5 #: ../../doc/src/intrinsics/array/size.md:5 #: ../../doc/src/intrinsics/bit/bge.md:5 ../../doc/src/intrinsics/bit/bgt.md:5 #: ../../doc/src/intrinsics/bit/bit_size.md:5 #: ../../doc/src/intrinsics/bit/ble.md:5 ../../doc/src/intrinsics/bit/blt.md:5 #: ../../doc/src/intrinsics/bit/btest.md:5 #: ../../doc/src/intrinsics/bit/shiftl.md:5 #: ../../doc/src/intrinsics/bit/shiftr.md:5 #: ../../doc/src/intrinsics/character/achar.md:5 #: ../../doc/src/intrinsics/character/adjustl.md:5 #: ../../doc/src/intrinsics/character/adjustr.md:5 #: ../../doc/src/intrinsics/character/char.md:5 #: ../../doc/src/intrinsics/character/len_trim.md:5 #: ../../doc/src/intrinsics/character/lge.md:5 #: ../../doc/src/intrinsics/kind-type/kind.md:5 #: ../../doc/src/intrinsics/mathematical/acos.md:5 #: ../../doc/src/intrinsics/mathematical/acosh.md:5 #: ../../doc/src/intrinsics/mathematical/asin.md:5 #: ../../doc/src/intrinsics/mathematical/asinh.md:5 #: ../../doc/src/intrinsics/mathematical/atan.md:5 #: ../../doc/src/intrinsics/mathematical/atan2.md:5 #: ../../doc/src/intrinsics/mathematical/atanh.md:5 #: ../../doc/src/intrinsics/mathematical/fraction.md:5 #: ../../doc/src/intrinsics/misc/command_argument_count.md:5 #: ../../doc/src/intrinsics/misc/cpu_time.md:5 #: ../../doc/src/intrinsics/misc/date_and_time.md:5 #: ../../doc/src/intrinsics/misc/new_line.md:5 #: ../../doc/src/intrinsics/numeric/abs.md:5 #: ../../doc/src/intrinsics/numeric/aimag.md:5 #: ../../doc/src/intrinsics/numeric/aint.md:5 #: ../../doc/src/intrinsics/numeric/anint.md:5 #: ../../doc/src/intrinsics/numeric/ceiling.md:5 #: ../../doc/src/intrinsics/numeric/cmplx.md:5 #: ../../doc/src/intrinsics/numeric/conjg.md:5 #: ../../doc/src/intrinsics/numeric/digits.md:5 #: ../../doc/src/intrinsics/numeric/dim.md:5 #: ../../doc/src/intrinsics/numeric/epsilon.md:5 #: ../../doc/src/intrinsics/numeric/erf.md:5 #: ../../doc/src/intrinsics/numeric/erfc.md:5 #: ../../doc/src/intrinsics/numeric/exp.md:5 #: ../../doc/src/intrinsics/numeric/floor.md:5 #: ../../doc/src/intrinsics/numeric/gamma.md:5 #: ../../doc/src/intrinsics/numeric/mod.md:5 msgid "Declaration" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:7 #: ../../doc/src/intrinsics/array/cshift.md:7 #: ../../doc/src/intrinsics/array/size.md:7 #: ../../doc/src/intrinsics/bit/bge.md:7 ../../doc/src/intrinsics/bit/bgt.md:7 #: ../../doc/src/intrinsics/bit/bit_size.md:7 #: ../../doc/src/intrinsics/bit/ble.md:7 ../../doc/src/intrinsics/bit/blt.md:7 #: ../../doc/src/intrinsics/bit/btest.md:7 #: ../../doc/src/intrinsics/bit/shiftl.md:7 #: ../../doc/src/intrinsics/bit/shiftr.md:7 #: ../../doc/src/intrinsics/character/achar.md:7 #: ../../doc/src/intrinsics/character/adjustl.md:7 #: ../../doc/src/intrinsics/character/adjustr.md:7 #: ../../doc/src/intrinsics/character/char.md:7 #: ../../doc/src/intrinsics/character/len_trim.md:7 #: ../../doc/src/intrinsics/character/lge.md:8 #: ../../doc/src/intrinsics/kind-type/kind.md:7 #: ../../doc/src/intrinsics/mathematical/acos.md:7 #: ../../doc/src/intrinsics/mathematical/acosh.md:7 #: ../../doc/src/intrinsics/mathematical/asin.md:7 #: ../../doc/src/intrinsics/mathematical/asinh.md:7 #: ../../doc/src/intrinsics/mathematical/atan.md:7 #: ../../doc/src/intrinsics/mathematical/atan2.md:7 #: ../../doc/src/intrinsics/mathematical/atanh.md:7 #: ../../doc/src/intrinsics/mathematical/fraction.md:7 #: ../../doc/src/intrinsics/misc/command_argument_count.md:7 #: ../../doc/src/intrinsics/misc/cpu_time.md:7 #: ../../doc/src/intrinsics/misc/date_and_time.md:7 #: ../../doc/src/intrinsics/misc/new_line.md:7 #: ../../doc/src/intrinsics/numeric/abs.md:7 #: ../../doc/src/intrinsics/numeric/aimag.md:7 #: ../../doc/src/intrinsics/numeric/aint.md:7 #: ../../doc/src/intrinsics/numeric/anint.md:7 #: ../../doc/src/intrinsics/numeric/ceiling.md:7 #: ../../doc/src/intrinsics/numeric/cmplx.md:7 #: ../../doc/src/intrinsics/numeric/conjg.md:7 #: ../../doc/src/intrinsics/numeric/digits.md:7 #: ../../doc/src/intrinsics/numeric/dim.md:7 #: ../../doc/src/intrinsics/numeric/epsilon.md:7 #: ../../doc/src/intrinsics/numeric/erf.md:7 #: ../../doc/src/intrinsics/numeric/erfc.md:7 #: ../../doc/src/intrinsics/numeric/exp.md:7 #: ../../doc/src/intrinsics/numeric/floor.md:7 #: ../../doc/src/intrinsics/numeric/gamma.md:7 #: ../../doc/src/intrinsics/numeric/mod.md:7 msgid "Syntax" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:14 #: ../../doc/src/intrinsics/array/cshift.md:14 #: ../../doc/src/intrinsics/array/size.md:14 #: ../../doc/src/intrinsics/bit/bge.md:14 #: ../../doc/src/intrinsics/bit/bgt.md:14 #: ../../doc/src/intrinsics/bit/bit_size.md:14 #: ../../doc/src/intrinsics/bit/ble.md:14 #: ../../doc/src/intrinsics/bit/blt.md:14 #: ../../doc/src/intrinsics/bit/btest.md:14 #: ../../doc/src/intrinsics/bit/shiftl.md:14 #: ../../doc/src/intrinsics/bit/shiftr.md:14 #: ../../doc/src/intrinsics/character/achar.md:14 #: ../../doc/src/intrinsics/character/adjustl.md:14 #: ../../doc/src/intrinsics/character/adjustr.md:14 #: ../../doc/src/intrinsics/character/char.md:14 #: ../../doc/src/intrinsics/character/len_trim.md:14 #: ../../doc/src/intrinsics/character/lge.md:15 #: ../../doc/src/intrinsics/kind-type/kind.md:14 #: ../../doc/src/intrinsics/mathematical/acos.md:14 #: ../../doc/src/intrinsics/mathematical/acosh.md:14 #: ../../doc/src/intrinsics/mathematical/asin.md:14 #: ../../doc/src/intrinsics/mathematical/asinh.md:14 #: ../../doc/src/intrinsics/mathematical/atan.md:14 #: ../../doc/src/intrinsics/mathematical/atan2.md:13 #: ../../doc/src/intrinsics/mathematical/atanh.md:14 #: ../../doc/src/intrinsics/mathematical/fraction.md:13 #: ../../doc/src/intrinsics/misc/command_argument_count.md:14 #: ../../doc/src/intrinsics/misc/cpu_time.md:14 #: ../../doc/src/intrinsics/misc/date_and_time.md:14 #: ../../doc/src/intrinsics/misc/new_line.md:14 #: ../../doc/src/intrinsics/numeric/abs.md:15 #: ../../doc/src/intrinsics/numeric/aimag.md:15 #: ../../doc/src/intrinsics/numeric/aint.md:14 #: ../../doc/src/intrinsics/numeric/anint.md:14 #: ../../doc/src/intrinsics/numeric/ceiling.md:14 #: ../../doc/src/intrinsics/numeric/cmplx.md:16 #: ../../doc/src/intrinsics/numeric/conjg.md:15 #: ../../doc/src/intrinsics/numeric/digits.md:13 #: ../../doc/src/intrinsics/numeric/dim.md:13 #: ../../doc/src/intrinsics/numeric/epsilon.md:14 #: ../../doc/src/intrinsics/numeric/erf.md:14 #: ../../doc/src/intrinsics/numeric/erfc.md:14 #: ../../doc/src/intrinsics/numeric/exp.md:14 #: ../../doc/src/intrinsics/numeric/floor.md:14 #: ../../doc/src/intrinsics/numeric/gamma.md:14 #: ../../doc/src/intrinsics/numeric/mod.md:15 msgid "Arguments" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:16 msgid "`x` is an integer input parameter." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:18 #: ../../doc/src/intrinsics/array/cshift.md:22 #: ../../doc/src/intrinsics/array/size.md:22 #: ../../doc/src/intrinsics/bit/bge.md:18 #: ../../doc/src/intrinsics/bit/bgt.md:18 #: ../../doc/src/intrinsics/bit/bit_size.md:18 #: ../../doc/src/intrinsics/bit/ble.md:18 #: ../../doc/src/intrinsics/bit/blt.md:18 #: ../../doc/src/intrinsics/bit/btest.md:19 #: ../../doc/src/intrinsics/bit/shiftl.md:21 #: ../../doc/src/intrinsics/bit/shiftr.md:21 #: ../../doc/src/intrinsics/character/lge.md:23 #: ../../doc/src/intrinsics/kind-type/kind.md:19 #: ../../doc/src/intrinsics/mathematical/acos.md:18 #: ../../doc/src/intrinsics/mathematical/acosh.md:19 #: ../../doc/src/intrinsics/mathematical/asin.md:18 #: ../../doc/src/intrinsics/mathematical/asinh.md:19 #: ../../doc/src/intrinsics/mathematical/atan.md:18 #: ../../doc/src/intrinsics/mathematical/atan2.md:21 #: ../../doc/src/intrinsics/mathematical/atanh.md:19 #: ../../doc/src/intrinsics/mathematical/fraction.md:17 #: ../../doc/src/intrinsics/misc/command_argument_count.md:18 #: ../../doc/src/intrinsics/misc/cpu_time.md:18 #: ../../doc/src/intrinsics/misc/date_and_time.md:39 #: ../../doc/src/intrinsics/misc/new_line.md:19 #: ../../doc/src/intrinsics/numeric/abs.md:19 #: ../../doc/src/intrinsics/numeric/aimag.md:19 #: ../../doc/src/intrinsics/numeric/aint.md:20 #: ../../doc/src/intrinsics/numeric/anint.md:20 #: ../../doc/src/intrinsics/numeric/ceiling.md:18 #: ../../doc/src/intrinsics/numeric/cmplx.md:24 #: ../../doc/src/intrinsics/numeric/conjg.md:19 #: ../../doc/src/intrinsics/numeric/digits.md:17 #: ../../doc/src/intrinsics/numeric/dim.md:18 #: ../../doc/src/intrinsics/numeric/epsilon.md:18 #: ../../doc/src/intrinsics/numeric/erf.md:18 #: ../../doc/src/intrinsics/numeric/erfc.md:18 #: ../../doc/src/intrinsics/numeric/exp.md:18 #: ../../doc/src/intrinsics/numeric/floor.md:20 #: ../../doc/src/intrinsics/numeric/gamma.md:19 #: ../../doc/src/intrinsics/numeric/mod.md:22 msgid "Return values" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:20 msgid "" "The return value is a logical scalar with the default logical kind type " "parameter." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:23 #: ../../doc/src/intrinsics/array/cshift.md:26 #: ../../doc/src/intrinsics/array/size.md:26 #: ../../doc/src/intrinsics/bit/bge.md:22 #: ../../doc/src/intrinsics/bit/bgt.md:22 #: ../../doc/src/intrinsics/bit/bit_size.md:22 #: ../../doc/src/intrinsics/bit/ble.md:22 #: ../../doc/src/intrinsics/bit/blt.md:22 #: ../../doc/src/intrinsics/bit/btest.md:23 #: ../../doc/src/intrinsics/bit/shiftl.md:25 #: ../../doc/src/intrinsics/bit/shiftr.md:25 #: ../../doc/src/intrinsics/character/achar.md:27 #: ../../doc/src/intrinsics/character/adjustl.md:23 #: ../../doc/src/intrinsics/character/adjustr.md:24 #: ../../doc/src/intrinsics/character/char.md:28 #: ../../doc/src/intrinsics/character/len_trim.md:22 #: ../../doc/src/intrinsics/character/lge.md:31 #: ../../doc/src/intrinsics/kind-type/kind.md:23 #: ../../doc/src/intrinsics/mathematical/acos.md:23 #: ../../doc/src/intrinsics/mathematical/acosh.md:24 #: ../../doc/src/intrinsics/mathematical/asin.md:23 #: ../../doc/src/intrinsics/mathematical/asinh.md:24 #: ../../doc/src/intrinsics/mathematical/atan.md:23 #: ../../doc/src/intrinsics/mathematical/atan2.md:27 #: ../../doc/src/intrinsics/mathematical/atanh.md:24 #: ../../doc/src/intrinsics/mathematical/fraction.md:22 #: ../../doc/src/intrinsics/misc/command_argument_count.md:22 #: ../../doc/src/intrinsics/misc/cpu_time.md:22 #: ../../doc/src/intrinsics/misc/date_and_time.md:43 #: ../../doc/src/intrinsics/misc/new_line.md:24 #: ../../doc/src/intrinsics/numeric/abs.md:24 #: ../../doc/src/intrinsics/numeric/aimag.md:23 #: ../../doc/src/intrinsics/numeric/aint.md:28 #: ../../doc/src/intrinsics/numeric/anint.md:27 #: ../../doc/src/intrinsics/numeric/ceiling.md:22 #: ../../doc/src/intrinsics/numeric/cmplx.md:30 #: ../../doc/src/intrinsics/numeric/conjg.md:23 #: ../../doc/src/intrinsics/numeric/digits.md:21 #: ../../doc/src/intrinsics/numeric/dim.md:22 #: ../../doc/src/intrinsics/numeric/epsilon.md:22 #: ../../doc/src/intrinsics/numeric/erf.md:23 #: ../../doc/src/intrinsics/numeric/erfc.md:23 #: ../../doc/src/intrinsics/numeric/exp.md:22 #: ../../doc/src/intrinsics/numeric/floor.md:28 #: ../../doc/src/intrinsics/numeric/gamma.md:23 #: ../../doc/src/intrinsics/numeric/mod.md:31 ../../doc/src/progress.md msgid "Description" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:25 msgid "" "`allocated(x)` checks the allocation status of a integer input parameter." " It returns a logical value as `TRUE` if the input argument `x` is " "allocated, `FALSE` otherwise." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:29 #: ../../doc/src/intrinsics/array/cshift.md:39 #: ../../doc/src/intrinsics/array/size.md:33 #: ../../doc/src/intrinsics/bit/bge.md:27 #: ../../doc/src/intrinsics/bit/bgt.md:27 #: ../../doc/src/intrinsics/bit/bit_size.md:27 #: ../../doc/src/intrinsics/bit/ble.md:27 #: ../../doc/src/intrinsics/bit/blt.md:27 #: ../../doc/src/intrinsics/bit/btest.md:32 #: ../../doc/src/intrinsics/bit/shiftl.md:32 #: ../../doc/src/intrinsics/bit/shiftr.md:32 #: ../../doc/src/intrinsics/character/achar.md:37 #: ../../doc/src/intrinsics/character/adjustl.md:28 #: ../../doc/src/intrinsics/character/adjustr.md:29 #: ../../doc/src/intrinsics/character/char.md:38 #: ../../doc/src/intrinsics/character/len_trim.md:27 #: ../../doc/src/intrinsics/character/lge.md:37 #: ../../doc/src/intrinsics/kind-type/kind.md:27 #: ../../doc/src/intrinsics/mathematical/acos.md:31 #: ../../doc/src/intrinsics/mathematical/acosh.md:43 #: ../../doc/src/intrinsics/mathematical/asin.md:31 #: ../../doc/src/intrinsics/mathematical/asinh.md:35 #: ../../doc/src/intrinsics/mathematical/atan.md:31 #: ../../doc/src/intrinsics/mathematical/atan2.md:53 #: ../../doc/src/intrinsics/mathematical/atanh.md:39 #: ../../doc/src/intrinsics/mathematical/fraction.md:30 #: ../../doc/src/intrinsics/misc/command_argument_count.md:27 #: ../../doc/src/intrinsics/misc/cpu_time.md:33 #: ../../doc/src/intrinsics/misc/date_and_time.md:53 #: ../../doc/src/intrinsics/misc/new_line.md:29 #: ../../doc/src/intrinsics/numeric/abs.md:35 #: ../../doc/src/intrinsics/numeric/aimag.md:33 #: ../../doc/src/intrinsics/numeric/aint.md:35 #: ../../doc/src/intrinsics/numeric/anint.md:38 #: ../../doc/src/intrinsics/numeric/ceiling.md:26 #: ../../doc/src/intrinsics/numeric/cmplx.md:47 #: ../../doc/src/intrinsics/numeric/conjg.md:33 #: ../../doc/src/intrinsics/numeric/digits.md:26 #: ../../doc/src/intrinsics/numeric/dim.md:27 #: ../../doc/src/intrinsics/numeric/epsilon.md:29 #: ../../doc/src/intrinsics/numeric/erf.md:33 #: ../../doc/src/intrinsics/numeric/erfc.md:36 #: ../../doc/src/intrinsics/numeric/exp.md:29 #: ../../doc/src/intrinsics/numeric/floor.md:33 #: ../../doc/src/intrinsics/numeric/gamma.md:38 #: ../../doc/src/intrinsics/numeric/mod.md:43 msgid "Types" 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 "" #: ../../doc/src/intrinsics/array/allocated.md:46 #: ../../doc/src/intrinsics/array/cshift.md:43 #: ../../doc/src/intrinsics/array/size.md:37 #: ../../doc/src/intrinsics/bit/bge.md:49 #: ../../doc/src/intrinsics/bit/bgt.md:49 #: ../../doc/src/intrinsics/bit/bit_size.md:44 #: ../../doc/src/intrinsics/bit/ble.md:49 #: ../../doc/src/intrinsics/bit/blt.md:49 #: ../../doc/src/intrinsics/bit/btest.md:56 #: ../../doc/src/intrinsics/bit/shiftl.md:62 #: ../../doc/src/intrinsics/bit/shiftr.md:62 #: ../../doc/src/intrinsics/character/achar.md:53 #: ../../doc/src/intrinsics/character/adjustl.md:45 #: ../../doc/src/intrinsics/character/adjustr.md:46 #: ../../doc/src/intrinsics/character/char.md:53 #: ../../doc/src/intrinsics/character/len_trim.md:44 #: ../../doc/src/intrinsics/character/lge.md:59 #: ../../doc/src/intrinsics/kind-type/kind.md:59 #: ../../doc/src/intrinsics/mathematical/acos.md:60 #: ../../doc/src/intrinsics/mathematical/acosh.md:72 #: ../../doc/src/intrinsics/mathematical/asin.md:60 #: ../../doc/src/intrinsics/mathematical/asinh.md:64 #: ../../doc/src/intrinsics/mathematical/atan.md:60 #: ../../doc/src/intrinsics/mathematical/atan2.md:75 #: ../../doc/src/intrinsics/mathematical/atanh.md:68 #: ../../doc/src/intrinsics/mathematical/fraction.md:34 #: ../../doc/src/intrinsics/misc/command_argument_count.md:31 #: ../../doc/src/intrinsics/misc/cpu_time.md:44 #: ../../doc/src/intrinsics/misc/date_and_time.md:64 #: ../../doc/src/intrinsics/misc/new_line.md:40 #: ../../doc/src/intrinsics/numeric/abs.md:79 #: ../../doc/src/intrinsics/numeric/aimag.md:53 #: ../../doc/src/intrinsics/numeric/aint.md:39 #: ../../doc/src/intrinsics/numeric/anint.md:42 #: ../../doc/src/intrinsics/numeric/ceiling.md:46 #: ../../doc/src/intrinsics/numeric/cmplx.md:59 #: ../../doc/src/intrinsics/numeric/conjg.md:53 #: ../../doc/src/intrinsics/numeric/digits.md:30 #: ../../doc/src/intrinsics/numeric/dim.md:31 #: ../../doc/src/intrinsics/numeric/epsilon.md:49 #: ../../doc/src/intrinsics/numeric/erf.md:53 #: ../../doc/src/intrinsics/numeric/erfc.md:56 #: ../../doc/src/intrinsics/numeric/exp.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:65 #: ../../doc/src/intrinsics/numeric/gamma.md:58 #: ../../doc/src/intrinsics/numeric/mod.md:80 msgid "Examples" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:59 #: ../../doc/src/intrinsics/array/cshift.md:55 #: ../../doc/src/intrinsics/array/size.md:48 #: ../../doc/src/intrinsics/mathematical/acos.md:76 #: ../../doc/src/intrinsics/mathematical/acosh.md:81 #: ../../doc/src/intrinsics/mathematical/asin.md:76 #: ../../doc/src/intrinsics/mathematical/asinh.md:73 #: ../../doc/src/intrinsics/mathematical/atan.md:76 #: ../../doc/src/intrinsics/mathematical/atan2.md:84 #: ../../doc/src/intrinsics/mathematical/atanh.md:77 #: ../../doc/src/intrinsics/mathematical/fraction.md:44 msgid "**Result**:" msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:65 #: ../../doc/src/intrinsics/array/cshift.md:62 #: ../../doc/src/intrinsics/array/size.md:55 #: ../../doc/src/intrinsics/bit/bge.md:68 #: ../../doc/src/intrinsics/bit/bgt.md:66 #: ../../doc/src/intrinsics/bit/bit_size.md:61 #: ../../doc/src/intrinsics/bit/ble.md:68 #: ../../doc/src/intrinsics/bit/blt.md:66 #: ../../doc/src/intrinsics/bit/btest.md:71 #: ../../doc/src/intrinsics/bit/shiftl.md:80 #: ../../doc/src/intrinsics/bit/shiftr.md:80 #: ../../doc/src/intrinsics/character/achar.md:69 #: ../../doc/src/intrinsics/character/adjustl.md:62 #: ../../doc/src/intrinsics/character/adjustr.md:63 #: ../../doc/src/intrinsics/character/char.md:69 #: ../../doc/src/intrinsics/character/len_trim.md:63 #: ../../doc/src/intrinsics/character/lge.md:79 #: ../../doc/src/intrinsics/kind-type/kind.md:79 #: ../../doc/src/intrinsics/mathematical/acos.md:82 #: ../../doc/src/intrinsics/mathematical/acosh.md:86 #: ../../doc/src/intrinsics/mathematical/asin.md:82 #: ../../doc/src/intrinsics/mathematical/asinh.md:78 #: ../../doc/src/intrinsics/mathematical/atan.md:82 #: ../../doc/src/intrinsics/mathematical/atan2.md:90 #: ../../doc/src/intrinsics/mathematical/atanh.md:82 #: ../../doc/src/intrinsics/mathematical/fraction.md:50 #: ../../doc/src/intrinsics/misc/command_argument_count.md:47 #: ../../doc/src/intrinsics/misc/cpu_time.md:64 #: ../../doc/src/intrinsics/misc/date_and_time.md:90 #: ../../doc/src/intrinsics/misc/new_line.md:56 #: ../../doc/src/intrinsics/numeric/abs.md:96 #: ../../doc/src/intrinsics/numeric/aimag.md:68 #: ../../doc/src/intrinsics/numeric/aint.md:55 #: ../../doc/src/intrinsics/numeric/anint.md:58 #: ../../doc/src/intrinsics/numeric/ceiling.md:64 #: ../../doc/src/intrinsics/numeric/cmplx.md:74 #: ../../doc/src/intrinsics/numeric/conjg.md:68 #: ../../doc/src/intrinsics/numeric/digits.md:44 #: ../../doc/src/intrinsics/numeric/dim.md:47 #: ../../doc/src/intrinsics/numeric/epsilon.md:63 #: ../../doc/src/intrinsics/numeric/erf.md:67 #: ../../doc/src/intrinsics/numeric/erfc.md:70 #: ../../doc/src/intrinsics/numeric/exp.md:71 #: ../../doc/src/intrinsics/numeric/floor.md:83 #: ../../doc/src/intrinsics/numeric/gamma.md:74 #: ../../doc/src/intrinsics/numeric/mod.md:95 msgid "See Also" msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:1 msgid "cshift(A, shift [, dim]): Circular Shift" msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:3 msgid "Circular shift elements of an array." 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 "" #: ../../doc/src/intrinsics/array/cshift.md:18 msgid "`shift` the input value of integer type." msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:20 msgid "" "`dim` optional dimension, if present, `cshift` returns the result of this" " dimension." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/array/cshift.md:28 msgid "" "**cshift(A, shift [, dim])** performs a circular shift on elements of `A`" " array along the dimension of `dim`. Default value of `dim` is 1, used " "when `dim` is not passed." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/array/cshift.md:41 msgid "" "Supported argument type is array for `A` and integer for `shift` and " "`dim`." msgstr "" #: ../../doc/src/intrinsics/array/size.md:1 msgid "size(x): Size of Array" msgstr "" #: ../../doc/src/intrinsics/array/size.md:3 msgid "Returns the size of an array `x`." msgstr "" #: ../../doc/src/intrinsics/array/size.md:18 msgid "" "`dim` optional dimension, if present, `size` returns the size of this " "dimension." msgstr "" #: ../../doc/src/intrinsics/array/size.md:20 msgid "`kind` optional the kind of the return value." msgstr "" #: ../../doc/src/intrinsics/array/size.md:24 msgid "`n` the size of an array (integer)." msgstr "" #: ../../doc/src/intrinsics/array/size.md:28 msgid "" "The `size` intrinsic function returns the size of an array. It returns " "the product of all dimensions, unless the `dim` argument is specified, in" " which case it only returns the size of this particular dimension. The " "`kind` argument can be used to specify the integer kind of the result." msgstr "" #: ../../doc/src/intrinsics/array/size.md:57 msgid "[shape](), [reshape]()." msgstr "" #: ../../doc/src/intrinsics/bit.md:1 msgid "Bit Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:1 msgid "bge(x, y): Bitwise Greater or Equal" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:3 msgid "Bitwise greater than or equal to." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/bge.md:29 #: ../../doc/src/intrinsics/bit/bgt.md:29 #: ../../doc/src/intrinsics/bit/ble.md:29 #: ../../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 "" #: ../../doc/src/intrinsics/bit/bge.md:60 #: ../../doc/src/intrinsics/bit/bgt.md:59 #: ../../doc/src/intrinsics/bit/bit_size.md:54 #: ../../doc/src/intrinsics/bit/ble.md:60 #: ../../doc/src/intrinsics/bit/blt.md:59 #: ../../doc/src/intrinsics/bit/btest.md:65 #: ../../doc/src/intrinsics/bit/shiftl.md:74 #: ../../doc/src/intrinsics/bit/shiftr.md:74 #: ../../doc/src/intrinsics/character/achar.md:63 #: ../../doc/src/intrinsics/character/adjustl.md:56 #: ../../doc/src/intrinsics/character/adjustr.md:57 #: ../../doc/src/intrinsics/character/char.md:63 #: ../../doc/src/intrinsics/character/len_trim.md:57 #: ../../doc/src/intrinsics/character/lge.md:72 #: ../../doc/src/intrinsics/kind-type/kind.md:72 #: ../../doc/src/intrinsics/misc/command_argument_count.md:40 #: ../../doc/src/intrinsics/misc/cpu_time.md:57 #: ../../doc/src/intrinsics/misc/date_and_time.md:83 #: ../../doc/src/intrinsics/misc/new_line.md:49 #: ../../doc/src/intrinsics/numeric/abs.md:89 #: ../../doc/src/intrinsics/numeric/aimag.md:62 #: ../../doc/src/intrinsics/numeric/aint.md:48 #: ../../doc/src/intrinsics/numeric/anint.md:51 #: ../../doc/src/intrinsics/numeric/ceiling.md:57 #: ../../doc/src/intrinsics/numeric/cmplx.md:68 #: ../../doc/src/intrinsics/numeric/conjg.md:62 #: ../../doc/src/intrinsics/numeric/digits.md:38 #: ../../doc/src/intrinsics/numeric/dim.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:57 #: ../../doc/src/intrinsics/numeric/erf.md:61 #: ../../doc/src/intrinsics/numeric/erfc.md:64 #: ../../doc/src/intrinsics/numeric/exp.md:65 #: ../../doc/src/intrinsics/numeric/floor.md:76 #: ../../doc/src/intrinsics/numeric/gamma.md:67 #: ../../doc/src/intrinsics/numeric/mod.md:89 msgid "**Result:**" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:70 msgid "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/bgt.md:1 msgid "bgt(x, y): Bitwise Greater Than" msgstr "" #: ../../doc/src/intrinsics/bit/bgt.md:3 msgid "Bitwise greater than." 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 "" #: ../../doc/src/intrinsics/bit/bgt.md:68 msgid "[bge](bge.md), [ble](ble.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:1 msgid "bit_size(x): Bit Size" msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:3 msgid "Bit size." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:16 msgid "`x` is integer input value." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:20 #: ../../doc/src/intrinsics/numeric/digits.md:19 msgid "The return value is of type integer." 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 "" #: ../../doc/src/intrinsics/bit/bit_size.md:29 msgid "Supported input types is integer." msgstr "" #: ../../doc/src/intrinsics/bit/ble.md:1 msgid "bge(x, y): Bitwise Less or Equal" msgstr "" #: ../../doc/src/intrinsics/bit/ble.md:3 msgid "Bitwise less than or equal to." 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 "" #: ../../doc/src/intrinsics/bit/ble.md:70 msgid "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:1 msgid "blt(x, y): Bitwise Less Than" msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:3 msgid "Bitwise less than." 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 "" #: ../../doc/src/intrinsics/bit/blt.md:68 msgid "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:1 msgid "btest(x, pos): Bit Test at Position" msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:3 msgid "Bit test." 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 "" #: ../../doc/src/intrinsics/bit/btest.md:21 msgid "The return value is of type logical." msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:25 msgid "" "`btest(x, pos)` calculates if `pos` bit in input integer value `x` is " "set. The counting of the bits starts at 0, at least significant bit (LSB)" " i.e., the rightmost bit in `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:1 msgid "shiftl(x, shift): Shift Left" msgstr "" #: ../../doc/src/intrinsics/bit/shiftl.md:3 msgid "Logical shift left function." msgstr "" #: ../../doc/src/intrinsics/bit/shiftl.md:16 #: ../../doc/src/intrinsics/bit/shiftr.md:16 msgid "`x` is an integer input value." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:27 msgid "" "**shiftl(x, shift)** logically left shifts `x` by `shift` number of bits." " `shiftl` shifts from LSB(**L**east **S**ignificant **B**it) to " "MSB(**M**ost **S**ignificant **B**it). Bits shifted from the left end " "i.e., MSB bits are lost. Zeroes are appended to the opposite right end." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:82 msgid "[shiftr](shiftr.md)." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:1 msgid "shiftr(x, shift): Shift Right" msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:3 msgid "Logical shift right function." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:27 msgid "" "**shiftr(x, shift)** logically right shifts `x` by `shift` number of " "bits. `shiftr` shifts from MSB(**M**ost **S**ignificant **B**it) to " "LSB(**L**east **S**ignificant **B**it). Bits shifted from the right end " "i.e., LSB bits are lost. Zeroes are appended to the opposite left end." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:82 msgid "[shiftl](shiftl.md)." msgstr "" #: ../../doc/src/intrinsics/character.md:1 msgid "Character Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/character/achar.md:1 msgid "achar(x, kind): To Character in ASCII set." msgstr "" #: ../../doc/src/intrinsics/character/achar.md:3 msgid "Character represented by in the ASCII character set." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/character/achar.md:20 #: ../../doc/src/intrinsics/character/adjustl.md:18 #: ../../doc/src/intrinsics/character/adjustr.md:18 #: ../../doc/src/intrinsics/character/char.md:21 #: ../../doc/src/intrinsics/character/len_trim.md:18 msgid "Return value" 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/achar.md:29 msgid "" "**achar(x, kind)** returns the character represented by the ASCII " "character set at `x` position." msgstr "" #: ../../doc/src/intrinsics/character/achar.md:32 #: ../../doc/src/intrinsics/character/char.md:33 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 "" #: ../../doc/src/intrinsics/character/achar.md:35 #: ../../doc/src/intrinsics/character/char.md:36 msgid "It is a runtime builtin function." 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 "" #: ../../doc/src/intrinsics/character/adjustl.md:1 msgid "adjustl(string): Left Adjust String" msgstr "" #: ../../doc/src/intrinsics/character/adjustl.md:3 msgid "Left adjust a string." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/adjustl.md:30 #: ../../doc/src/intrinsics/character/adjustr.md:31 msgid "Supported argument type is character." msgstr "" #: ../../doc/src/intrinsics/character/adjustr.md:1 msgid "adjustr(string): Right Adjust String" msgstr "" #: ../../doc/src/intrinsics/character/adjustr.md:3 msgid "Right adjust a string." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/adjustr.md:65 msgid "[adjustl](adjustl.md)." msgstr "" #: ../../doc/src/intrinsics/character/char.md:1 msgid "char(x, [, kind]): Integer to Character" msgstr "" #: ../../doc/src/intrinsics/character/char.md:3 msgid "Integer to character conversion." msgstr "" #: ../../doc/src/intrinsics/character/char.md:16 msgid "`x`: the input value of integer type." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/character/char.md:30 msgid "" "**char(x)** returns the character represented by the ASCII character set " "at `x` position." msgstr "" #: ../../doc/src/intrinsics/character/char.md:71 msgid "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:1 msgid "len_trim(string): Length Ignoring Trailing Blanks" msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:3 msgid "Length of a character string ignoring trailing blank character(s)." msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:16 msgid "`string` the input value of character type." msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:20 msgid "The return value is of type unsigned integer." 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 "" #: ../../doc/src/intrinsics/character/len_trim.md:29 msgid "Supported argument type is character scalar." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:1 msgid "lge(x, y): Lexically Greater or Equal" msgstr "" #: ../../doc/src/intrinsics/character/lge.md:3 msgid "Lexically greater than or equal." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:17 msgid "`x` input value of type character." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:19 msgid "`y` input value of type character." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:21 msgid "`x` and `y` can be seen as string A and string B." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:25 msgid "The return value is of logical `true` or `false` type." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:27 msgid "`True` if `x` string is lexically greater than or equal to `y`." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:29 msgid "`False` if they are not." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:33 msgid "" "**lge(x, y)** determines if input string `x` is lexically greater than or" " equal to input string `y`. The two strings in comparison are interpreted" " as containing ASCII character codes." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:39 msgid "Argument types should be of type character literal." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:81 msgid "[len_trim](len_trim.md)." msgstr "" #: ../../doc/src/intrinsics/kind-type.md:1 msgid "Kind Type Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:1 msgid "kind(x): Kind of an Entity" msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:3 msgid "Kind of an entity." 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 "" #: ../../doc/src/intrinsics/kind-type/kind.md:21 msgid "The return value is of integer type and of default integer kind." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:25 msgid "**kind(x)** returns the kind parameter of the input argument `x`." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:29 msgid "" "Supported argument types are logical, integer, real, complex, or " "character." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:81 #: ../../doc/src/intrinsics/misc/command_argument_count.md:16 #: ../../doc/src/intrinsics/misc/cpu_time.md:20 #: ../../doc/src/intrinsics/misc/date_and_time.md:41 #: ../../doc/src/intrinsics/misc/new_line.md:58 msgid "None." msgstr "" #: ../../doc/src/intrinsics/mathematical.md:1 msgid "Mathematical Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:1 msgid "acos(x): Trigonometric Arc Cosine" msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:3 msgid "Trigonometric arc cosine (inverse cosine) function." 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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:20 #: ../../doc/src/intrinsics/mathematical/acosh.md:21 #: ../../doc/src/intrinsics/mathematical/asin.md:20 #: ../../doc/src/intrinsics/mathematical/asinh.md:21 #: ../../doc/src/intrinsics/mathematical/atan.md:20 #: ../../doc/src/intrinsics/mathematical/atanh.md:21 msgid "" "The returned value has the kind of the input value and TYPE may be real " "or complex." msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:25 msgid "**acos(x)** computes the arcsine of the argument **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:33 #: ../../doc/src/intrinsics/mathematical/acosh.md:45 #: ../../doc/src/intrinsics/mathematical/asin.md:33 #: ../../doc/src/intrinsics/mathematical/asinh.md:37 #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:84 msgid "[asin](asin.md), [atan](atan.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:1 msgid "acosh(x): Inverse Hyperbolic Cosine" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:3 msgid "Inverse hyperbolic cosine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:16 #: ../../doc/src/intrinsics/mathematical/asinh.md:16 #: ../../doc/src/intrinsics/mathematical/atanh.md:16 msgid "" "`x` the input value, can be real with value greater than or equal to 1 or" " of type complex." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:26 msgid "**acosh(x)** computes the inverse hyperbolic cosine function of **x**." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acosh.md:33 msgid "$-\\pi <= img (acosh(x)) <= \\pi$" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:35 msgid "" "For real values $x$ in the domain $x > 1$, the inverse hyperbolic cosine " "satisifies:" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:38 msgid "$cosh^{-1}(x) = \\log(x + \\sqrt{(x^2 - 1)})$" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acosh.md:88 msgid "[asinh](asinh.md), [atanh](atanh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:1 msgid "asin(x): Trigonometric Arcsine" msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:3 msgid "Trigonometric arcsine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:25 msgid "**asin(x)** computes the arcsine of the argument **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/asin.md:84 msgid "[acos](acos.md), [atan](atan.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:1 msgid "asinh(x): Inverse Hyperbolic Arcsine" msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:3 msgid "Inverse hyperbolic arcsine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:26 msgid "**asinh(x)** computes the inverse hyperbolic arcsine function of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/asinh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (asinh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:80 msgid "[acosh](acosh.md), [atanh](atanh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:1 msgid "atan(x): Trigonometric ArcTangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:3 msgid "Trigonometric arctangent (inverse arctangent) function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:25 msgid "**atan(x)** computes the arctangent of the argument **x**." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:27 msgid "" "The arc tangent is the inverse function of the arctangent function. It is" " commonly used in trigonometry to find the angle when the lengths of the " "opposite side of a right triangle and base are known, i.e., perpendicular" " and base length." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:84 msgid "[asin](asin.md), [acos](acos.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:1 msgid "atan2(y, x): ArcTangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:3 msgid "Arctangent function or inverse tangent function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:15 msgid "`y` the input value is the imaginary part of the complex expression" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atan2.md:19 msgid "`x` the input value, must be real part of the complex expression." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atan2.md:29 msgid "" "**atan2(y, x)** computes the principal value of the argument function of " "the complex expression $x + iy$. This is used to transform from cartesian" " into polar coordinates and allows to determine the angle in the correct " "quadrant." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:33 msgid "It is also represented as:" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:35 msgid "$tan^{-1}(\\frac{y}{x})$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:37 msgid "If `x` is nonzero, the result lies in the range:" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:39 msgid "$-\\pi <= atan(x) <= \\pi$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:41 msgid "The sign is positive if `y` is positive." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:43 msgid "If `y` is zero and `x` is strictly positive, then the result is 0." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:45 msgid "If `x` is negative and `y` is positive zero, then the result is $\\pi$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:47 msgid "If `x` is negative and `y` is negative zero, then the result is $-\\pi$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:49 msgid "If `x` is zero, then the magnitude of the result is $\\frac{\\pi}{2}$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:51 msgid "If `y` is negative real zero, the result is $\\frac{-\\pi}{2}$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:55 #: ../../doc/src/intrinsics/mathematical/fraction.md:32 msgid "Supported argument type is real." msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:1 msgid "atanh(x): Inverse Hyperbolic Tangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:3 msgid "Inverse hyperbolic tangent function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:26 msgid "**atanh(x)** computes the inverse hyperbolic tangent function of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atanh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (atanh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:35 msgid "If the result is real, it lies in the range" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:37 msgid "$-1.0 < atanh(x) < 1.0$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:84 msgid "[asinh](asinh.md), [acosh](acosh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:1 msgid "fraction(x): Fractional Part in Model Representation" msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:3 msgid "Fractional part of the model representation." msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:15 msgid "`x` the input value, must be real." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/fraction.md:24 msgid "" "**fraction(x)** computes the fractional part of the model representation " "of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/fraction.md:28 msgid "$x * {radix(x)}^{(-exponent(x))}$" msgstr "" #: ../../doc/src/intrinsics/misc.md:1 msgid "Miscellaneous Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:1 msgid "command_argument_count(): Number of Command Line Arguments" msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:3 msgid "Get number of command line arguments." msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:20 msgid "The return value is of integer type and of default kind." 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 "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:29 msgid "Any." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:1 msgid "cpu_time(x): CPU Elapsed Time" msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:3 msgid "CPU elapsed time in seconds." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:16 msgid "`x` the input value should be of type real with `intent(out)`." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:24 msgid "" "**cpu_time(time)** returns a real value representing the elapsed CPU time" " in seconds. If tine source is available, time will be reported with " "microsecond resolution. If no time source is available, TIME is set to " "-1.0." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:28 msgid "This is useful for testing segments of code to determine computation time." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:1 msgid "date_and_time([date, time, zone, values]): Date and Time" msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:3 msgid "Date and time subroutine." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:22 msgid "" "`zone` the input value of character type, which has length 5 or larger. " "It is of default kind. It is `intent(out)` and has from `(+-)hhmm`, " "representing the difference with respect to Coordinates Universal Time " "(UTC). Unavailable time and date parameters return blanks." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:30 msgid "`value(1)`: The year." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:31 msgid "`value(2)`: The month." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:32 msgid "`value(3)`: The day of the month." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:33 msgid "`value(4)`: Time difference with UTC in minutes." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:34 msgid "`value(5)`: The hour of the day." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:35 msgid "`value(6)`: The minutes of the hour." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:36 msgid "`value(7)`: The seconds of the minutes." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:37 msgid "`value(8)`: The milliseconds of the second." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:51 msgid "Unavailable or errorneous date and time parameters return blanks." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:92 msgid "[cpu_time](cpu_time.md)." msgstr "" #: ../../doc/src/intrinsics/misc/new_line.md:1 msgid "new_line(x): New Line Character" msgstr "" #: ../../doc/src/intrinsics/misc/new_line.md:3 msgid "New line character." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/new_line.md:31 msgid "Supported input parameter types is character." msgstr "" #: ../../doc/src/intrinsics/numeric.md:1 msgid "Numeric Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:1 msgid "abs(x): Absolute Value" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:3 msgid "Absolute value." msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:17 msgid "`x` the input value, can be integer, real, or complex." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/abs.md:26 msgid "" "**abs(x)** calculates and returns absolute value of `x`. Result is " "calculated using mathematical formula:" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:29 msgid "$|x|$" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:31 msgid "If `x` is complex, the result is calculated using mathematical formula:" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:33 msgid "$\\sqrt{(x^2 + y^2)}$" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aimag.md:1 msgid "aimag(x): Imaginary Part" msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:3 msgid "Imaginary part of complex number." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:17 msgid "`x` the input value must be of complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:21 msgid "The return value is imaginary part of type real and kind same as of `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:25 msgid "**aimag(x)** returns the imaginary part of the input complex argument `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:27 #: ../../doc/src/intrinsics/numeric/cmplx.md:41 #: ../../doc/src/intrinsics/numeric/conjg.md:27 msgid "" "For `x` complex input value, the result is calculated using mathematical " "formula:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aimag.md:35 msgid "Supported argument types are complex." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:1 msgid "aint(x, [kind]): Truncate to a Whole Number" msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:3 msgid "Truncate to a whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:16 #: ../../doc/src/intrinsics/numeric/anint.md:16 #: ../../doc/src/intrinsics/numeric/epsilon.md:16 #: ../../doc/src/intrinsics/numeric/erf.md:16 #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aint.md:37 #: ../../doc/src/intrinsics/numeric/anint.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:31 #: ../../doc/src/intrinsics/numeric/erf.md:35 #: ../../doc/src/intrinsics/numeric/erfc.md:38 #: ../../doc/src/intrinsics/numeric/floor.md:35 #: ../../doc/src/intrinsics/numeric/gamma.md:40 msgid "Supported argument types is real." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:85 msgid "[ceiling](ceiling.md), [mod](mod.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:1 msgid "anint(x, [kind]): Round to Nearest Whole Number" msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:3 msgid "Round to nearest whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:25 msgid "The return value is equal to rounded whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:29 msgid "**anint(x)** calculates rounded value of input parameter `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/anint.md:34 msgid "If `x` is greater than 0, `anint(x)` returns `aint(x + 0.5)`." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:60 msgid "[aint](aint.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:1 msgid "ceiling(x): Integer Ceiling" msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:3 msgid "Integer ceiling function" msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:16 msgid "The input value `x` may be of type real or integer." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:20 msgid "The return value is of type integer and nearest greater integer." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:24 msgid "**ceiling(x)** returns the least integer greater than or equal to `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:28 msgid "Supported input parameter types are integer and real." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:66 msgid "[floor](floor.md), [mod](mod.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:1 msgid "cmplx(x [, [, kind]]): Convert to Complex" msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:3 msgid "Conversion to complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:14 msgid "`cmplx(x, y)` is one of the intrinsic present in ASR." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:18 msgid "" "`x` the input value must be of integer, real, or complex. `y` the " "optional input value must be of type integer or real. It should be only " "present in case `x` is not complex. `kind` the optional input value of " "integer expression type for initialisation indicating the kind parameter " "of the result." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/cmplx.md:32 msgid "" "**cmplx(x, [, y [, kind]])** converts the input value to complex " "representation:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/cmplx.md:37 msgid "If `y` is not present, the imaginary component is set to 0.0." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:39 msgid "If `x` is complex then `y` must not be present." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:49 msgid "Supported argument types are integer, real, or complex." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:1 msgid "conjg(x): Complex Conjugate" msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:3 msgid "Complex conjugate function." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:17 msgid "`x` the input value must be of type complex." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:21 msgid "The return value is of complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:25 msgid "**conjg(x)** converts the input value `x` to its conjugate." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:29 msgid "$x + iy$ converted to $x - iy$" msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:35 msgid "Supported argument types is complex." msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:1 msgid "digits(x): Significant Binary Digits" msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:3 msgid "Significant binary digits." msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:15 msgid "`x` the input value must be of type real or integer." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/dim.md:1 msgid "dim(x, y): Positive Difference or 0" msgstr "" #: ../../doc/src/intrinsics/numeric/dim.md:3 msgid "Positive difference or 0." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/dim.md:20 msgid "The return value is of type integer or real." 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 "" #: ../../doc/src/intrinsics/numeric/epsilon.md:1 msgid "epsilon(x): Epsilon" msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:3 msgid "Epsilon function." msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:20 msgid "The return value is of same type as of the input argument." msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:24 msgid "" "**epsilon(x)** computes the smallest number $\\epsilon$ of the same kind " "as `x` following:" msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:27 msgid "$1 + \\epsilon > 1$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:1 msgid "erf(x): Error" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:3 msgid "Error function." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/erf.md:27 msgid "$-1 \\leq erf (x) \\leq 1$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_0^xe^{-t^2}dt$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:69 msgid "[erfc](erfc.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:1 msgid "erfc(x): Complementary Error" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:3 msgid "Complementary error function." 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 "" #: ../../doc/src/intrinsics/numeric/erfc.md:27 msgid "$0 \\leq erf (x) \\leq 2$" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_{x}^{\\infty}e^{-t^2}dt$" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/erfc.md:72 msgid "[erf](erf.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:1 msgid "exp(x): Exponential" msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:3 msgid "Exponential function." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:16 msgid "`x` the input value must be of type real or complex." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:20 msgid "The return value is of same type as of the input argument, `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:24 msgid "**exp(x)** computes the base $e$ exponential of `x`, i.e., $e^x$." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/exp.md:31 msgid "Supported argument types is real and complex." msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:1 msgid "floor(x, kind): Integer Floor" msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:3 msgid "Integer floor function." msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:18 msgid "" "`kind` the optional input parameter must be a scalar integer constant " "expression." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:1 msgid "gamma(x): Gamma" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:3 msgid "Gamma function." 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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:21 msgid "The return value is of same type and kind as of `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:28 msgid "$\\gamma(x) = (x-1)!$" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:30 msgid "In general, if $x > 0$:" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:32 msgid "$\\gamma(x) = \\int_{0}^{\\infty} e^{-t} dt$" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:34 msgid "and if $-n-1 < x < -n$ where n is an integer >= 0:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:76 msgid "[epsilon](epsilon.md)" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:1 msgid "mod(x, y): Modulus" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:3 msgid "Modulus or remainder function." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:17 msgid "`x` the input value, can be integer or real." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/mod.md:27 msgid "`x - INT (x / y) * y`." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:29 msgid "If `y` is 0, the result is undefined like `any integer value / 0`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/mod.md:36 msgid "`x - INT(x / y) * y`" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:38 msgid "" "i.e., result is remainder when first argument is mathematically divided " "by second argument." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:41 msgid "The return value should be less than `y`." msgstr "" #: ../../doc/src/language.md:1 msgid "Fortran Language" msgstr "" #: ../../doc/src/language.md:3 msgid "Background and Motivation" msgstr "" #: ../../doc/src/language.md:5 msgid "" "Fortran was designed from the ground up to naturally and simply translate" " mathematics to code that compiles and runs at maximum speed. And being " "specifically targeted for such fundamentally computational tasks, it " "contains a broad range of key functionality within the language itself, " "standard across all platforms, with no need for external libraries that " "may or may not be well optimized or maintained, at present or down the " "road." msgstr "" #: ../../doc/src/language.md:12 msgid "Some highlights:" 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 "" #: ../../doc/src/language.md:17 msgid "" "Operators which operate naturally upon the aforementioned " "arrays/matrices, as they do scalars;" msgstr "" #: ../../doc/src/language.md:19 msgid "Complex numbers;" msgstr "" #: ../../doc/src/language.md:20 msgid "Special functions;" msgstr "" #: ../../doc/src/language.md:21 msgid "Structures and pointers for more general data representation." msgstr "" #: ../../doc/src/language.md:23 msgid "" "Because the essentials are contained in the language itself, it is simple" " to read and write, without need of choosing from among or deciphering a " "proliferation of external classes to do the same thing. And because the " "essentials are self-contained, compilers can provide detailed compile-" "time (e.g., argument mismatch) and run-time (e.g., memory access) checks," " as well as highly optimized executables, directly from natural, readable" " code without need of extensive optimization heroics by the developer." msgstr "" #: ../../doc/src/language.md:31 msgid "See our blog posts for more information:" msgstr "" #: ../../doc/src/language.md:33 msgid "" "[Why We Created LFortran](https://lfortran.org/blog/2019/04/why-we-" "created-lfortran/)" msgstr "" #: ../../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 "" #: ../../doc/src/language.md:36 msgid "How to Learn Fortran" msgstr "" #: ../../doc/src/language.md:38 msgid "" "Fortran is relatively quick to learn because it is so much simpler and " "smaller than C/C++ (in practice, that is, with all needed libraries " "included). If you are interested in learning more, please see our webpage" " at [fortran90.org] with recommended practices for writing code, side by " "side comparison with Python/NumPy, links to other online Fortran " "resources and books, and an FAQ." msgstr "" #: ../../doc/src/progress.md:3 msgid "" "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:" msgstr "" #: ../../doc/src/progress.md:7 msgid "AST: The code can be parsed to AST (`lfortran --show-ast test.f90`)" msgstr "" #: ../../doc/src/progress.md:8 msgid "ASR: The code can be transformed to ASR (`lfortran --show-asr test.f90`)" msgstr "" #: ../../doc/src/progress.md:9 msgid "LLVM: LFortran can generate LLVM IR (`lfortran --show-llvm test.f90`)" msgstr "" #: ../../doc/src/progress.md:10 msgid "BIN: The LLVM IR can compile to a binary" msgstr "" #: ../../doc/src/progress.md:11 msgid "RUN: The binary runs without errors" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:16 msgid "" "This page is generated automatically using the [Compiler " "Tester](https://gitlab.com/lfortran/compiler_tester) repository which " "contains all the Fortran tests and scripts to run LFortran to produce the" " tables below. We are looking for contributors to contribute more tests. " "Our goal is to have a comprehensive Fortran testsuite that can be used to" " test any Fortran compiler." msgstr "" #: ../../doc/src/progress.md:23 msgid "Testing the LFortran compiler version:" msgstr "" #: ../../doc/src/progress.md:32 msgid "Topics" msgstr "" #: ../../doc/src/progress.md:34 msgid "Full programs that compute something interesting" msgstr "" #: ../../doc/src/progress.md:36 msgid "Basic Numerics" msgstr "" #: ../../doc/src/progress.md:38 msgid "Directory: `tests/programs/numerics`" msgstr "" #: ../../doc/src/progress.md msgid "LLVM" msgstr "" #: ../../doc/src/progress.md msgid "BIN" msgstr "" #: ../../doc/src/progress.md msgid "RUN" msgstr "" #: ../../doc/src/progress.md msgid "Filename" msgstr "" #: ../../doc/src/progress.md msgid "`Pure Fortran sin(x) implementation`" msgstr "" #: ../../doc/src/progress.md msgid "✅" 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 "" #: ../../doc/src/progress.md:45 msgid "Modules" msgstr "" #: ../../doc/src/progress.md:47 msgid "Basic Usage" msgstr "" #: ../../doc/src/progress.md:49 msgid "Directory: `tests/modules/basic`" msgstr "" #: ../../doc/src/progress.md msgid "`Basic modules`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/basic/t01.f90)" msgstr "" #: ../../doc/src/progress.md:56 msgid "Module Functions and Subroutines" msgstr "" #: ../../doc/src/progress.md:58 msgid "Directory: `tests/modules/procedures`" msgstr "" #: ../../doc/src/progress.md msgid "`Module functions`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`Module subroutines`" msgstr "" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t02.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`Nested subroutines`" msgstr "" #: ../../doc/src/progress.md msgid "[t03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t03.f90)" msgstr "" #: ../../doc/src/progress.md:67 msgid "Expressions" msgstr "" #: ../../doc/src/progress.md:69 msgid "Arithmetic Operations" msgstr "" #: ../../doc/src/progress.md:71 msgid "Directory: `tests/expressions/arit`" msgstr "" #: ../../doc/src/progress.md msgid "`+,-,*,/,**`" msgstr "" #: ../../doc/src/progress.md msgid "[basic_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/arit/basic_operations.f90)" msgstr "" #: ../../doc/src/progress.md:78 msgid "Integers" msgstr "" #: ../../doc/src/progress.md:80 msgid "Directory: `tests/expressions/integers`" msgstr "" #: ../../doc/src/progress.md msgid "`integers`" msgstr "" #: ../../doc/src/progress.md msgid "[integer_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/integer_kind.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`relational operations`" 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 "" #: ../../doc/src/progress.md msgid "`logical operations`" 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 "" #: ../../doc/src/progress.md:89 msgid "Real Numbers" msgstr "" #: ../../doc/src/progress.md:91 msgid "Directory: `tests/expressions/reals`" msgstr "" #: ../../doc/src/progress.md msgid "`single/double reals`" msgstr "" #: ../../doc/src/progress.md msgid "[real_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/real_kind.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`defined operator`" msgstr "" #: ../../doc/src/progress.md msgid "âŒ" 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 "" #: ../../doc/src/progress.md:99 msgid "Complex Numbers" msgstr "" #: ../../doc/src/progress.md:101 msgid "Directory: `tests/expressions/complex`" msgstr "" #: ../../doc/src/progress.md msgid "`single/double complex`" msgstr "" #: ../../doc/src/progress.md msgid "[complex_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/complex/complex_kind.f90)" msgstr "" #: ../../doc/src/progress.md:108 msgid "Strings" msgstr "" #: ../../doc/src/progress.md:110 msgid "Directory: `tests/expressions/character`" msgstr "" #: ../../doc/src/progress.md msgid "`character`" msgstr "" #: ../../doc/src/progress.md msgid "[t01_character.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t01_character.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`string concatenation`" 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 "" #: ../../doc/src/progress.md:118 msgid "Derived Types" msgstr "" #: ../../doc/src/progress.md:120 msgid "Directory: `tests/expressions/derived_type`" msgstr "" #: ../../doc/src/progress.md msgid "`basic derived types`" 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 "" #: ../../doc/src/progress.md:127 msgid "Statements" msgstr "" #: ../../doc/src/progress.md:129 msgid "Allocate Statement" msgstr "" #: ../../doc/src/progress.md:131 msgid "Directory: `tests/statements/allocate`" msgstr "" #: ../../doc/src/progress.md msgid "`allocate statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/allocate/t01.f90)" msgstr "" #: ../../doc/src/progress.md:138 msgid "Block Statement" msgstr "" #: ../../doc/src/progress.md:140 msgid "Directory: `tests/statements/block`" msgstr "" #: ../../doc/src/progress.md msgid "`block statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/block/t01.f90)" msgstr "" #: ../../doc/src/progress.md:147 msgid "Goto Statement" msgstr "" #: ../../doc/src/progress.md:149 msgid "Directory: `tests/statements/goto`" msgstr "" #: ../../doc/src/progress.md msgid "`computed go-to statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`go-to statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t02.f90)" msgstr "" #: ../../doc/src/progress.md:157 msgid "If Statement" msgstr "" #: ../../doc/src/progress.md:159 msgid "Directory: `tests/statements/if`" msgstr "" #: ../../doc/src/progress.md msgid "`Test .false.`" msgstr "" #: ../../doc/src/progress.md msgid "[if_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`single line if statement`" msgstr "" #: ../../doc/src/progress.md msgid "[if_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_02.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`multi line if statement`" msgstr "" #: ../../doc/src/progress.md msgid "[if_03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_03.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`nested if statements`" msgstr "" #: ../../doc/src/progress.md msgid "[if_04.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_04.f90)" msgstr "" #: ../../doc/src/progress.md:169 msgid "While Statement" msgstr "" #: ../../doc/src/progress.md:171 msgid "Directory: `tests/statements/while`" msgstr "" #: ../../doc/src/progress.md msgid "`Simple while loops`" msgstr "" #: ../../doc/src/progress.md msgid "[while_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`exit / cycle in while loops`" msgstr "" #: ../../doc/src/progress.md msgid "[while_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_02.f90)" msgstr "" #: ../../doc/src/progress.md:179 msgid "Print Statement" msgstr "" #: ../../doc/src/progress.md:181 msgid "Directory: `tests/statements/print`" msgstr "" #: ../../doc/src/progress.md msgid "`Basic print`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/print/t01.f90)" msgstr "" #: ../../doc/src/progress.md:188 msgid "Open, Read, Write, Close Statement" msgstr "" #: ../../doc/src/progress.md:190 msgid "Directory: `tests/statements/file_io`" msgstr "" #: ../../doc/src/progress.md msgid "`open/read/write/close`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/file_io/t01.f90)" msgstr "" #: ../../doc/src/progress.md:197 msgid "Intrinsic Functions" msgstr "" #: ../../doc/src/progress.md:199 msgid "abs" msgstr "" #: ../../doc/src/progress.md:201 msgid "Directory: `tests/intrinsic/abs`" msgstr "" #: ../../doc/src/progress.md msgid "`scalar single/double real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md msgid "`scalar single/double complex`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md msgid "`array 1D single/double real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:210 msgid "exp" msgstr "" #: ../../doc/src/progress.md:212 msgid "Directory: `tests/intrinsic/exp`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:221 msgid "log" msgstr "" #: ../../doc/src/progress.md:223 msgid "Directory: `tests/intrinsic/log`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:232 msgid "sqrt" msgstr "" #: ../../doc/src/progress.md:234 msgid "Directory: `tests/intrinsic/sqrt`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:243 msgid "sin" msgstr "" #: ../../doc/src/progress.md:245 msgid "Directory: `tests/intrinsic/sin`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:254 msgid "cos" msgstr "" #: ../../doc/src/progress.md:256 msgid "Directory: `tests/intrinsic/cos`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:265 msgid "tan" msgstr "" #: ../../doc/src/progress.md:267 msgid "Directory: `tests/intrinsic/tan`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:276 msgid "sinh" msgstr "" #: ../../doc/src/progress.md:278 msgid "Directory: `tests/intrinsic/sinh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:287 msgid "cosh" msgstr "" #: ../../doc/src/progress.md:289 msgid "Directory: `tests/intrinsic/cosh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:298 msgid "tanh" msgstr "" #: ../../doc/src/progress.md:300 msgid "Directory: `tests/intrinsic/tanh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:309 msgid "asin" msgstr "" #: ../../doc/src/progress.md:311 msgid "Directory: `tests/intrinsic/asin`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:320 msgid "acos" msgstr "" #: ../../doc/src/progress.md:322 msgid "Directory: `tests/intrinsic/acos`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:331 msgid "atan" msgstr "" #: ../../doc/src/progress.md:333 msgid "Directory: `tests/intrinsic/atan`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:342 msgid "modulo" msgstr "" #: ../../doc/src/progress.md:344 msgid "Directory: `tests/intrinsic/modulo`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:352 msgid "mod" msgstr "" #: ../../doc/src/progress.md:354 msgid "Directory: `tests/intrinsic/mod`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:362 msgid "min" msgstr "" #: ../../doc/src/progress.md:364 msgid "Directory: `tests/intrinsic/min`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:371 msgid "max" msgstr "" #: ../../doc/src/progress.md:373 msgid "Directory: `tests/intrinsic/max`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:380 msgid "int" msgstr "" #: ../../doc/src/progress.md:382 msgid "Directory: `tests/intrinsic/int`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:389 msgid "real" msgstr "" #: ../../doc/src/progress.md:391 msgid "Directory: `tests/intrinsic/real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:398 msgid "floor" msgstr "" #: ../../doc/src/progress.md:400 msgid "Directory: `tests/intrinsic/floor`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:407 msgid "nint" msgstr "" #: ../../doc/src/progress.md:409 msgid "Directory: `tests/intrinsic/nint`" 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 "" lfortran-0.63.0/doc/locale/es/0000775000175000017500000000000015174404631016233 5ustar alastairalastairlfortran-0.63.0/doc/locale/es/LC_MESSAGES/0000775000175000017500000000000015174404631020020 5ustar alastairalastairlfortran-0.63.0/doc/locale/es/LC_MESSAGES/docs.po0000664000175000017500000054657015174404631021331 0ustar alastairalastair# SOME DESCRIPTIVE TITLE. # Copyright (C) 2022 LFortran contributors # This file is distributed under the same license as the LFortran package. # FIRST AUTHOR , 2022. # msgid "" 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-09-12 14:18+0000\n" "Last-Translator: Asdrubal Lozada-Blanco \n" "Language-Team: Spanish \n" "Language: es\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 msgid "Difference between an AST and ASR" msgstr "Diferencias entre un AST y una ASR" #: ../../doc/src/ast_and_asr.ipynb:11 msgid "Let us take a simple Fortran code:" msgstr "Tomemos un código Fortran simple:" #: ../../doc/src/ast_and_asr.ipynb:22 msgid "and look at how the AST and ASR looks like." msgstr "y verifiquemos en que se parecen AST y ASR." #: ../../doc/src/ast_and_asr.ipynb:25 ../../doc/src/progress.md msgid "AST" msgstr "AST" #: ../../doc/src/ast_and_asr.ipynb:76 msgid "" "The AST does not have any semantic information, but has nodes to " "represent declarations such as ``integer, intent(in) :: a``. Variables " "such as ``a`` are represented by a ``Name`` node, and are not connected " "to their declarations yet." msgstr "" "El AST no tiene información semántica, pero tiene nodos para representar " "declaraciones tales como ``integer, intent(in) :: a``. Variables tales como " "``a`` son representadas por un nodo ``Name`` , y aún no están conectadas a " "sus declaraciones." #: ../../doc/src/ast_and_asr.ipynb:88 ../../doc/src/progress.md msgid "ASR" msgstr "ASR" #: ../../doc/src/ast_and_asr.ipynb:139 msgid "" "The ASR has all the semantic information (types, etc.), nodes like " "``Function`` have a symbol table and do not have any declaration nodes. " "Variables are simply pointers to the symbol table." msgstr "" "La ASR tiene toda la información semántica (tipos, etc.), nodos como " "``Function`` tienen una tabla de símbolos y no tienen ningún nodo de " "declaración. Variables son únicamente punteros para la tabla de símbolos." #: ../../doc/src/ast_and_asr.ipynb:142 msgid "Discussion" msgstr "Discusión" #: ../../doc/src/ast_and_asr.ipynb:144 msgid "" "The above was a simple example. Things get more apparent for more " "complicated examples, such as:" msgstr "" "El anterior fué un ejemplo simple. Las cosas se vuelven mas evidentes para " "ejemplos más complicados, tales como:" #: ../../doc/src/ast_and_asr.ipynb:160 msgid "" "AST must represent all the ``use`` statements and the ``interface`` " "block, and keep things semantically consistent." msgstr "" "AST puede representar todos las declaraciones ``use`` y el bloque " "``interface``, y mantiene las cosas semánticamente consistentes." #: ../../doc/src/ast_and_asr.ipynb:162 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" " are defined in the ``gfort_interop`` module, and so ASR does not have " "any of these declaration nodes." msgstr "" "ASR, por otro lado, realiza un seguimiento de ``c_desc1_int32``, " "``c_desc1_t`` y ``f2b_c_wrapper`` en la tabla de símbolos y sabe que están " "definidos en el módulo ``gfort_interop``, y así ASR no tiene ninguno de " "estos nodos de declaración." #: ../../doc/src/ast_and_asr.ipynb:164 msgid "" "When converting from ASR to AST, LFortran will create all the appropriate" " AST declaration nodes automatically and correctly." msgstr "" "Al convertir de ASR a AST, LFortran creará automática y correctamente todos " "los nodos de declaración AST apropiados." #: ../../doc/src/contributing.md:1 msgid "Contributing" msgstr "Contribuyendo" #: ../../doc/src/contributing.md:3 msgid "" "We welcome contributions from anyone, even if you are new to open source." " It might sound daunting to contribute to a compiler at first, but please" " do, it is not complicated. We will help you with any technical issues " "and help improve your contribution so that it can be merged." msgstr "" "Damos la bienvenida a todas las contribuciones, aún si usted es nuevo en " "código abierto. Al principio, puede parecer abrumador contribuir a un " "compilador, pero hágalo, no es complicado. Ayudaremos con cualquier problema " "técnico, así como a mejorar su contribución para que esta pueda integrarse." #: ../../doc/src/contributing.md:8 msgid "Basic Setup" msgstr "Configuración básica" #: ../../doc/src/contributing.md:10 msgid "To contribute, make sure your set up:" msgstr "Para contribuir, asegúrese de configurar:" #: ../../doc/src/contributing.md:12 msgid "Your username + email" msgstr "Su nombre de usuario + correo electrónico" #: ../../doc/src/contributing.md:13 msgid "Your `~/.gitconfig`" msgstr "Su `~/.gitconfig`" #: ../../doc/src/contributing.md:14 msgid "Your shell prompt to display the current branch name" msgstr "Su indicador de interfaz para mostrar el nombre de la rama actual" #: ../../doc/src/contributing.md:16 msgid "Fork LFortran" msgstr "Bifurcar LFortran" #: ../../doc/src/contributing.md:18 msgid "" "Step 1. Create a fork of the [project " "repository](https://github.com/lfortran/lfortran)" msgstr "" "Paso 1. Crear una bifurcación del [repositorio del proyecto](https://github." "com/lfortran/lfortran)" #: ../../doc/src/contributing.md:20 msgid "" "Step 2. Set up your [SSH key](https://docs.github.com/en/authentication" "/connecting-to-github-with-ssh) with GitHub" msgstr "" "Paso 2. Configure su [clave SSH](https://docs.github.com/en/authentication/" "connecting-to-github-with-ssh) con GitHub" #: ../../doc/src/contributing.md:22 msgid "" "Step 3. Clone the project repository from GitHub and set up your remote " "repository" msgstr "" "Paso 3. Clone el repositório del proyecto desde Github y configure su " "repositório remoto" #: ../../doc/src/contributing.md:29 msgid "" ":fontawesome-solid-edit: `REMOTE_NAME` is the name of your remote " "repository and could be any name you like, for example your first name." msgstr "" ":fontawesome-solid-edit: `REMOTE_NAME` es el nombre de su repositório remoto " "y puede ser cualquier nombre de su elección, por ejemplo su primer nombre." #: ../../doc/src/contributing.md:31 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` es su identificador de usuario en " "Github y debe ser parte de la ruta de su cuenta." #: ../../doc/src/contributing.md:33 msgid "" "You can use `git remote -v` to check if the new remote is set up " "correctly." msgstr "" "Usted puede usar `git remote -v` para verificar si el nuevo enlace remoto " "está correctamente configurado." #: ../../doc/src/contributing.md:35 msgid "Send a New Merge Request" msgstr "Enviar una nueva solicitud de fusión" #: ../../doc/src/contributing.md:37 msgid "Step 1. Create a new branch" msgstr "Paso 1. Crear una nueva rama" #: ../../doc/src/contributing.md:42 msgid "Step 2. Make changes in relevant file(s)" msgstr "Paso 2. Realizar cambios en archivos relevantes" #: ../../doc/src/contributing.md:44 msgid "Step 3. Commit the changes:" msgstr "Paso 3. Confirmar los cambios:" #: ../../doc/src/contributing.md:51 msgid "" "[Here](https://chris.beams.io/posts/git-commit/) are some great tips on " "writing good commit messages." msgstr "" "[Aquí](https://chris.beams.io/posts/git-commit/) algunos consejos sobre como " "escribir buenos mensajes de confirmación." #: ../../doc/src/contributing.md:53 msgid "Step 4. Check to ensure that your changes look good" msgstr "Paso 4. Verifique que sus cambios se vean bien" #: ../../doc/src/contributing.md:58 msgid "Step 5. Send the merge request" msgstr "Paso 5. Enviar la solicitud de fusión" #: ../../doc/src/contributing.md:64 msgid "" "The command will push the new branch `fix1` into your remote repository " "`REMOTE_NAME` that you created earlier. Additionally, it will also " "display a link that you can click on to open the new merge request. After" " clicking on the link, write a title and a concise description then click" " the \"Create\" button. Yay you are now all set." msgstr "" "El comando insertará la nueva rama `fix1` en su repositorio remoto " "`REMOTE_NAME` que creó anteriormente. Además, también mostrará un enlace en " "el que puede hacer clic para abrir la nueva solicitud de fusión. Después de " "hacer clic en el enlace, escriba un título y una descripción concisa y luego " "haga clic en el botón \"Create\". Sí, ya está todo listo." #: ../../doc/src/contributing.md:66 msgid "Add New Features" msgstr "Adicionar nuevas características" #: ../../doc/src/contributing.md:68 msgid "" "The example below shows the steps it would take to create a caret binary " "operator **^** which computes the average value of the two operands." msgstr "" "El siguiente ejemplo muestra los pasos necesarios para crear un operador " "binario de intercalación **^** que calcula el valor promedio de los dos " "operandos." #: ../../doc/src/contributing.md:70 msgid "Create New Token(s)" msgstr "Crear un nuevo identificador" #: ../../doc/src/contributing.md:72 msgid "" "We extend the *tokenizer.re* as well as *parser.yy* to add the new token " "**^**. We also tell LFortran how to print the new token in *parser.cpp*." msgstr "" "Extendemos el *tokenizer.re* así como el *parser.yy* para adcionar el nuevo " "indentificador **^**. También le decimos a LFortran como imprimir el nuevo " "identificador en *parser.cpp*." #: ../../doc/src/contributing.md:75 msgid ":fontawesome-solid-code: *src/lfortran/parser/tokenizer.re*" msgstr ":fontawesome-solid-code: *src/lfortran/parser/tokenizer.re*" #: ../../doc/src/contributing.md:80 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.yy*" msgstr ":fontawesome-solid-code: *src/lfortran/parser/parser.yy*" #: ../../doc/src/contributing.md:85 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.cpp*" msgstr ":fontawesome-solid-code: *src/lfortran/parser/parser.cpp*" #: ../../doc/src/contributing.md:94 msgid "The added code is tested with `lfortran --show-tokens examples2/expr2.f90`" msgstr "" "El código adicionado es evaluado con `lfortran --show-tokens examples2/expr2." "f90`" #: ../../doc/src/contributing.md:96 msgid "Parse the New Token" msgstr "Analizar el nuevo identificador" #: ../../doc/src/contributing.md:98 msgid "" "Now we have to parse the new operator. We add it to the AST by extending " "the BinOp with a caret operator and modifying the *AST.asdl* file. Then " "we add it in *parse.yy* to properly parse and generate the new AST in " "*semantics.h*.Finally we extend *pickle.cpp* so that the new operator can" " print itself." msgstr "" "Ahora tenemos que analizar el nuevo operador. Lo agregamos al AST " "extendiendo BinOp con un operador de intercalación y modificando el archivo " "*AST.asdl*. Luego lo agregamos en *parse.yy* para analizar correctamente y " "generar el nuevo AST en *semantics.h*. Finalmente, extendemos *pickle.cpp* " "para que el nuevo operador pueda imprimirse solo." #: ../../doc/src/contributing.md:102 msgid ":fontawesome-solid-code:*grammar/AST.asdl*" msgstr ":fontawesome-solid-code:*grammar/AST.asdl*" #: ../../doc/src/contributing.md:107 msgid ":fontawesome-solid-code:*src/lfortran/parser/parser.yy*" msgstr ":fontawesome-solid-code:*src/lfortran/parser/parser.yy*" #: ../../doc/src/contributing.md:116 msgid ":fontawesome-solid-code:*src/lfortran/parser/semantics.h*" msgstr ":fontawesome-solid-code:*src/lfortran/parser/semantics.h*" #: ../../doc/src/contributing.md:121 msgid ":fontawesome-solid-code:*src/lfortran/pickle.cpp*" msgstr ":fontawesome-solid-code:*src/lfortran/pickle.cpp*" #: ../../doc/src/contributing.md:132 msgid "The section is tested with `lfortran --show-ast examples/expr2.f90`" msgstr "La sección es evaluada con `lfortran --show-ast examples/expr2.f90`" #: ../../doc/src/contributing.md:134 msgid "Implement the Semantics of the New Token" msgstr "Implementar todas las semánticas del nuevo identificador" #: ../../doc/src/contributing.md:136 msgid "" "We first extend the ASR in *ASR.asdl* and add ^ as a BinOp operator " "option." msgstr "" "Primero extendemos el ASR en *ASR.asdl* y adicionamos ^ como una opción del " "operador BinOp." #: ../../doc/src/contributing.md:138 msgid ":fontawesome-solid-code:*src/libasr/ASR.asdl*" msgstr ":fontawesome-solid-code:*src/libasr/ASR.asdl*" #: ../../doc/src/contributing.md:142 msgid ":fontawesome-solid-code:*src/lfortran/semantics/ast_common_visitor.h*" msgstr ":fontawesome-solid-code:*src/lfortran/semantics/ast_common_visitor.h*" #: ../../doc/src/contributing.md:179 msgid "" "Then we transform it from AST to ASR by extending " "*src/lfortran/semantics/ast_common_visitor.h*." msgstr "" "Después lo transformamos desde AST para ASR extendiendo *src/lfortran/" "semantics/ast_common_visitor.h*." #: ../../doc/src/contributing.md:181 msgid "" "We also add it into compile time evaluation triggered by expressions such" " as `e = (2+3)^5` which is evaluated at compile time. An expression such " "as `e = x^5` is evaluated at run time only." msgstr "" "También lo agregamos a la evaluación en tiempo de compilación desencadenada " "por expresiones como `e = (2+3)^5`, que se evalúa en tiempo de compilación. " "Una expresión como `e = x^5` se evalúa solo en tiempo de ejecución." #: ../../doc/src/contributing.md:183 msgid "The section is tested with `lfortran --show-asr examples/expr2.f90`" msgstr "La sección es evaluada con `lfortran --show-asr examples/expr2.f90`" #: ../../doc/src/contributing.md:184 msgid "Implement the New Token in LLVM" msgstr "Implementando el nuevo identificador en LLVM" #: ../../doc/src/contributing.md:186 msgid "" "To implement in LLVM, we extend the BinOp translation by handling the new" " operator. We first add the two numbers then divide by two. :fontawesome-" "solid-code:*src/lfortran/codegen/asr_to_llvm.cpp*" msgstr "" "Para implementar en LLVM, extendemos la traducción de BinOp manejando el " "nuevo operador. Primero sumamos los dos números y luego dividimos por dos. " ":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 "La sección es evaluada con `lfortran --show-llvm examples/expr2.f90`" #: ../../doc/src/contributing.md:219 msgid "Now when LLVM works, we can test the final executable by:" msgstr "Ahora, cuando LLVM funciona, podemos probar el ejecutable final:" #: ../../doc/src/contributing.md:224 msgid "And it should print 6." msgstr "Y debería imprimir 6." #: ../../doc/src/contributing.md:226 msgid "It also works interactively:" msgstr "También funciona de forma interactiva:" #: ../../doc/src/contributing.md:242 msgid "Reach Out" msgstr "Alcanzar" #: ../../doc/src/contributing.md:244 msgid "" "If you have any questions or need help, please ask as at our " "[mailinglist](https://groups.io/g/lfortran) or a " "[chat](https://lfortran.zulipchat.com/)." msgstr "" "Si tiene alguna pregunta o necesita ayuda, pregunte en nuestra [lista de " "correo](https://groups.io/g/lfortran) o un [chat](https://lfortran.zulipchat." "com/)." #: ../../doc/src/contributing.md:248 msgid "" "Please note that all participants of this project are expected to follow " "our Code of Conduct. By participating in this project you agree to abide " "by its terms. See " "[CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/blob/main/CODE_OF_CONDUCT.md)." msgstr "" "Tenga en cuenta que se espera que todos los participantes de este proyecto " "sigan nuestro Código de conducta. Al participar en este proyecto, usted " "acepta cumplir con sus términos. Ver [CODE_OF_CONDUCT.md](https://github.com/" "lfortran/lfortran/blob/main/CODE_OF_CONDUCT.md)." #: ../../doc/src/contributing.md:252 msgid "" "By submitting a PR you agree to license your contribution under the " "LFortran's BSD " "[license](https://github.com/lfortran/lfortran/blob/main/LICENSE) unless " "explicitly noted otherwise." msgstr "" "Al enviar un PR, acepta licenciar su contribución bajo la " "[licencia](https://github.com/lfortran/lfortran/blob/main/LICENSE) BSD de " "LFortran, a menos que se indique explícitamente lo contrario." #: ../../doc/src/design.md:1 msgid "LFortran Design" msgstr "Diseño de LFortran" #: ../../doc/src/design.md:3 msgid "High Level Overview" msgstr "Descripción general de alto nivel" #: ../../doc/src/design.md:5 ../../doc/src/developer_tutorial.ipynb:16 msgid "" "LFortran is structured around two independent modules, AST and ASR, both " "of which are standalone (completely independent of the rest of LFortran) " "and users are encouraged to use them independently for other applications" " and build tools on top:" msgstr "" "LFortran está estructurado en torno a dos módulos independientes, AST y ASR, " "los cuales son independientes (completamente independientes del resto de " "LFortran) y se anima a los usuarios a usarlos de forma independiente para " "otras aplicaciones y crear herramientas en la parte superior:" #: ../../doc/src/design.md:10 msgid "" "Abstract Syntax Tree (AST), module `lfortran.ast`: Represents any Fortran" " source code, strictly based on syntax, no semantic is included. The AST " "module can convert itself to Fortran source code." msgstr "" "Ãrbol de sintaxis abstracta (AST), módulo `lfortran.ast`: representa " "cualquier código fuente de Fortran, basado estrictamente en la sintaxis, no " "se incluye semántica. El módulo AST puede convertirse en código fuente de " "Fortran." #: ../../doc/src/design.md:14 msgid "" "Abstract Semantic Representation (ASR), module `lfortran.asr`: Represents" " a valid Fortran source code, all semantic is included. Invalid Fortran " "code is not allowed (an error will be given). The ASR module can convert " "itself to an AST." msgstr "" "Representación semántica abstracta (ASR), módulo `lfortran.asr`: Representa " "un código fuente de Fortran válido, se incluye toda la semántica. No se " "permite el código Fortran no válido (se dará un error). El módulo ASR puede " "convertirse en un AST." #: ../../doc/src/design.md:19 msgid "" "The LFortran compiler is then composed of the following independent " "stages:" msgstr "" "El compilador LFortran está compuesto por las siguientes etapas " "independientes:" #: ../../doc/src/design.md:21 msgid "Parsing: converts Fortran source code to an AST" msgstr "Análisis: convierte el código fuente de Fortran en un AST" #: ../../doc/src/design.md:22 msgid "Semantic: converts an AST to an ASR" msgstr "Semántica: Convertir un AST para un ASR" #: ../../doc/src/design.md:23 msgid "" "High level optimizations: optimize ASR to a possibly faster/simpler ASR " "(things like inlining functions, eliminating redundant expressions or " "statements, etc.)" msgstr "" "Optimización de alto nivel: optimizar ASR para un ASR posiblemente mas " "simple y mas rápido (cosas como alinear funciones, eliminar expresiones o " "declaraciones redundantes, etc.)" #: ../../doc/src/design.md:26 msgid "" "LLVM IR code generation and lower level optimizations: converts an ASR to" " an LLVM IR. This stage also does all other optimizations that do not " "produce an ASR, but still make sense to do before passing to LLVM IR." msgstr "" "Generación de código LLVM IR y optimizaciones de nivel inferior: convierte " "un ASR en un LLVM IR. Esta etapa también realiza todas las demás " "optimizaciones que no producen un ASR, pero que aún tiene sentido antes de " "pasar a LLVM IR." #: ../../doc/src/design.md:29 msgid "" "Machine code generation: LLVM then does all its optimizations and " "generates machine code (such as a binary executable, a library, an object" " file, or it is loaded and executed using JIT as part of the interactive " "LFortran session or in a Jupyter kernel)." msgstr "" "Generación de código de máquina: LLVM luego realiza todas sus optimizaciones " "y genera código de máquina (como un ejecutable binario, una biblioteca, un " "archivo de objeto, o se carga y ejecuta usando JIT como parte de la sesión " "interactiva de LFortran o en un núcleo de Jupyter)." #: ../../doc/src/design.md:34 msgid "" "LFortran is structured as a library, and so one can for example use the " "parser to obtain an AST and do something with it, or one can then use the" " semantic analyzer to obtain ASR and do something with it. One can " "generate the ASR directly (e.g., from SymPy) and then either convert to " "AST and to a Fortran source code, or use LFortran to compile it to " "machine code directly. In other words, one can use LFortran to easily " "convert between the three equivalent representations:" msgstr "" "LFortran está estructurado como una biblioteca, por lo que, por ejemplo, se " "puede usar el analizador para obtener un AST y hacer algo con él, o se puede " "usar el analizador semántico para obtener ASR y hacer algo con él. Uno puede " "generar la ASR directamente (por ejemplo, desde SymPy) y luego convertirlo a " "AST y a un código fuente de Fortran, o usar LFortran para compilarlo en " "código de máquina directamente. En otras palabras, uno puede usar LFortran " "para convertir fácilmente entre las tres representaciones equivalentes:" #: ../../doc/src/design.md:42 msgid "Fortran source code" msgstr "Código fuente de Fortran" #: ../../doc/src/design.md:43 ../../doc/src/developer_tutorial.ipynb:23 msgid "Abstract Syntax Tree (AST)" msgstr "Ãrbol de sintaxis abstracta (AST)" #: ../../doc/src/design.md:44 ../../doc/src/developer_tutorial.ipynb:159 msgid "Abstract Semantic Representation (ASR)" msgstr "Representación semántica abstracta (ASR)" #: ../../doc/src/design.md:46 msgid "They are all equivalent in the following sense:" msgstr "Estos son todos equivalentes en el siguiente sentido:" #: ../../doc/src/design.md:48 msgid "Any ASR can always be converted to an equivalent AST" msgstr "Cualquier ASR puede siempre ser convertido a un AST equivalente" #: ../../doc/src/design.md:49 msgid "Any AST can always be converted to an equivalent Fortran source code" msgstr "" "Cualquier AST puede ser siempre convertido a un código fuente 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 "" "Cualquier código fuente de Fortran siempre se puede convertir a un AST " "equivalente o se obtiene un error de sintaxis" #: ../../doc/src/design.md:52 msgid "" "Any AST can always be either converted to an equivalent ASR or one gets a" " semantic error" msgstr "" "Cualquier AST siempre se puede convertir a un ASR equivalente o se obtiene " "un error semántico" #: ../../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 "" "Así, cuando se puede realizar una conversión estos son equivalentes, y la " "conversión siempre se puede realizar a menos que el código no sea válido." #: ../../doc/src/design.md:58 msgid "ASR Design Details" msgstr "Detalles de diseño de una ASR" #: ../../doc/src/design.md:60 msgid "The ASR is designed to have the following features:" msgstr "Una ASR está diseñada para tener las características siguientes:" #: ../../doc/src/design.md:62 msgid "" "ASR is still semantically equivalent to the original Fortran code (it did" " not lose any semantic information). ASR can be converted to AST, and AST" " to Fortran source code which is functionally equivalent to the original." msgstr "" "Una ASR sigue siendo semánticamente equivalente al código Fortran original (" "esta no pierde información semántica). Una ASR puede ser convertida a un " "AST, y un AST a un código fuente Fortran que es funcionalmente equivalente " "al 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 "" "Una ASR es lo más simple posible: no contiene ninguna información que no " "pueda deducirse de una ASR." #: ../../doc/src/design.md:69 msgid "" "The ASR C++ classes (down the road) are designed similarly to SymEngine: " "they are constructed once and after that they are immutable. The " "constructor checks in Debug more that all the requirements are met (e.g.," " that all Variables in a Function have a dummy argument set, that " "explicit-shape arrays are not allocatable and all other Fortran " "requirements to make it a valid code), but in Release mode it quickly " "constructs the class without checks. Then there are builder classes that " "construct the ASR C++ classes to meet requirements (checked in Debug " "mode) and the builder gives an error message if a code is not a valid " "Fortran code, and if it doesn't give an error message, then the ASR C++ " "classes are constructed correctly. Thus by construction, the ASR classes " "always contain valid Fortran code and the rest of LFortran can depend on " "it." msgstr "" "Las clases ASR C++ (en el futuro) están diseñadas de manera similar a " "SymEngine: se construyen una vez y luego son inmutables. El constructor " "verifica en modo depuración que se cumplan todos los requisitos (por " "ejemplo, que todas las variables en una función tengan un conjunto de " "argumentos ficticios, que las matrices de forma explícita no se puedan " "asignar y todos los demás requisitos de Fortran para que sea un código " "válido), pero en modo de lanzamiento, construye rápidamente la clase sin " "controles. Luego, hay clases de constructores que construyen las clases ASR " "C++ para cumplir con los requisitos (verificados en el modo de depuración) y " "el constructor da un mensaje de error si un código no es un código Fortran " "válido, y si no da un mensaje de error, entonces las clases ASR C++ están " "construidas correctamente. Así, por construcción, las clases ASR siempre " "contienen código Fortran válido y el resto de LFortran puede depender de él." #: ../../doc/src/design.md:82 msgid "Notes:" msgstr "Notas:" #: ../../doc/src/design.md:84 msgid "" "Information that is lost when parsing source to AST: whitespace, " "multiline/single line if statement distinction, case sensitivity of " "keywords." msgstr "" "Información que se pierde al analizar la fuente en un AST: espacios en " "blanco, distinción de declaración if de varias líneas/una sola línea, " "distinción entre mayúsculas y minúsculas de palabras clave." #: ../../doc/src/design.md:87 msgid "" "Information that is lost when going from AST to ASR: detailed syntax how " "variables were defined and the order of type attributes (whether array " "dimension is using the `dimension` attribute, or parentheses at the " "variable; or how many variables there are per declaration line or their " "order), as ASR only represents the aggregated type information in the " "symbol table." msgstr "" "Información que se pierde al pasar de un AST a una ASR: sintaxis detallada, " "cómo se definieron las variables y el orden de los atributos de tipo (si la " "dimensión de matriz usa el atributo `dimensión` o paréntesis en la variable, " "o cuántas variables hay por línea de declaración o su orden), ya que una ASR " "solo representa la información de tipo agregada en la tabla de símbolos." #: ../../doc/src/design.md:90 msgid "" "ASR is the simplest way to generate Fortran code, as one does not have to" " worry about the detailed syntax (as in AST) about how and where things " "are declared. One specifies the symbol table for a module, then for each " "symbol (functions, global variables, types, ...) one specifies the local " "variables and if this is an interface then one needs to specify where one" " can find an implementation, otherwise a body is supplied with " "statements, those nodes are almost the same as in AST, except that each " "variable is just a reference to a symbol in the symbol table (so by " "construction one cannot have undefined variables). The symbol table for " "each node such as Function or Module also references its parent (for " "example a function references a module, a module references the global " "scope)." msgstr "" "Una ASR es la forma más sencilla de generar código Fortran, ya que uno no " "tiene que preocuparse por la sintaxis detallada (como en un AST) sobre cómo " "y dónde se declaran las cosas. Uno especifica la tabla de símbolos para un " "módulo, luego para cada símbolo (funciones, variables globales, tipos, ...) " "uno especifica las variables locales y si se trata de una interfaz, entonces " "uno necesita especificar dónde puede encontrar una implementación, de lo " "contrario un cuerpo se suministra con declaraciones, esos nodos son casi los " "mismos que en un AST, excepto que cada variable es solo una referencia a un " "símbolo en la tabla de símbolos (por lo que, por construcción, uno no puede " "tener variables indefinidas). La tabla de símbolos para cada nodo, como " "Función o Módulo, también hace referencia a su padre (por ejemplo, una " "función hace referencia a un módulo, un módulo hace referencia al ámbito " "global)." #: ../../doc/src/design.md:102 msgid "" "The ASR can be directly converted to an AST without gathering any other " "information. And the AST directly to Fortran source code." msgstr "" "Una ASR se puede convertir directamente en un AST sin recopilar ninguna otra " "información. Y un AST directamente al código fuente de Fortran." #: ../../doc/src/design.md:105 msgid "" "The ASR is always representing a semantically valid Fortran code. This " "is enforced by checks in the ASR C++ constructors (in Debug build). When " "an ASR is used, one can assume it is valid." msgstr "" "Una ASR siempre representa un código Fortran semánticamente válido. Esto se " "aplica mediante comprobaciones en los constructores de una ASR C++ (en la " "compilación de depuración). Cuando se utiliza una ASR, se puede suponer que " "es válido." #: ../../doc/src/design.md:109 msgid "Fortran 2008" msgstr "Fortran 2008" #: ../../doc/src/design.md:111 msgid "" "Fortran 2008 [standard](https://j3-fortran.org/doc/year/10/10-007.pdf) " "chapter 2 \"Fortran concepts\" specifies that Fortran code is a " "collection of _program units_ (either all in one file, or in separate " "files), where each _program unit_ is one of:" msgstr "" "Fortran 2008 [estándar](https://j3-fortran.org/doc/year/10/10-007.pdf) " "capítulo 2 \"Conceptos de Fortran\" especifica que el código Fortran es una " "colección de _unidades de programa_ (ya sea todo en un archivo , o en " "archivos separados), donde cada _unidad de programa_ es una de:" #: ../../doc/src/design.md:116 ../../doc/src/design.md:131 msgid "main program" msgstr "programa principal" #: ../../doc/src/design.md:117 ../../doc/src/design.md:132 msgid "module or submodule" msgstr "módulo o submódulo" #: ../../doc/src/design.md:118 ../../doc/src/design.md:133 msgid "function or subroutine" msgstr "función o subrutina" #: ../../doc/src/design.md:120 msgid "" "Note: It can also be a _block data_ program unit, that is used to provide" " initial values for data objects in named _common blocks_, but we do not " "recommend the use of _common blocks_ (use modules instead)." 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 "Extensión LFortran" #: ../../doc/src/design.md:126 msgid "" "We extend the Fortran language by introducing a _global scope_, which is " "not only the list of _program units_ (as in F2008) but can also include " "statements, declarations, use statements and expressions. We define " "_global scope_ as a collection of the following items:" 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 "declaración de uso" #: ../../doc/src/design.md:135 msgid "declaration" msgstr "declaración" #: ../../doc/src/design.md:136 msgid "statement" msgstr "declaración" #: ../../doc/src/design.md:137 msgid "expression" msgstr "expresión" #: ../../doc/src/design.md:139 msgid "" "In addition, if a variable is not defined in an assignment statement " "(such as `x = 5+3`) then the type of the variable is inferred from the " "right hand side (e.g., `x` in `x = 5+3` would be of type `integer`, and " "`y` in `y = 5._dp` would be of type `real(dp)`). This rule only applies " "at the top level of _global scope_. Types must be fully specified inside " "main programs, modules, functions and subroutines, just like in F2008." 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 "" "The _global scope_ has its own symbol table. The main program and " "module/submodule do not see any symbols from this symbol table. But " "functions, subroutines, statements and expressions at the top level of " "_global scope_ use and operate on this symbol table." 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 "" "Each item in the _global scope_ is interpreted as follows: main program " "is compiled into an executable with the same name and executed; modules, " "functions and subroutines are compiled and loaded; use statement and " "declaration adds those symbols with the proper type into the _global " "scope_ symbol table, but do not generate any code; statement is wrapped " "into an anonymous subroutine with no arguments, compiled, loaded and " "executed; expression is wrapped into an anonymous function with no " "arguments returning the expression, compiled, loaded, executed and the " "return value is returned to the user." 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 "" "The _global scope_ is always interpreted, item by item, per the previous " "paragraph. It is meant to allow interactive usage, experimentations and " "writing simple scripts. Code in _global scope_ must be interpreted using " "`lfortran`. For more complex (production) code it is recommended to turn " "it into modules and programs (by wrapping loose statements into " "subroutines or functions and by adding type declarations) and compile it " "with `lfortran` or any other Fortran compiler." 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 "Aquí algunos ejemplos de código válidos en _alcance global_:" #: ../../doc/src/design.md:178 msgid "Example 1" msgstr "Ejemplo 1" #: ../../doc/src/design.md:185 msgid "Example 2" msgstr "Ejemplo 2" #: ../../doc/src/design.md:197 msgid "Example 3" msgstr "Ejemplo 3" #: ../../doc/src/design.md:209 msgid "Example 4" msgstr "Ejemplo 4" #: ../../doc/src/design.md:217 msgid "Design Considerations" msgstr "Consideraciones de diseño" #: ../../doc/src/design.md:219 msgid "" "The LFortran extension of Fortran was chosen in a way so as to minimize " "the number of changes. In particular, only the top level of the _global " "scope_ has relaxed some of the Fortran rules (such as making specifying " "types optional) so as to allow simple and quick interactive usage, but " "inside functions, subroutines, modules or programs this relaxation does " "not apply." 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 "" "The number of changes were kept to minimum in order to make it " "straightforward to turn code at _global scope_ into standard compliant " "Fortran code using programs and modules, so that it can be compiled by " "any Fortran compiler." 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 "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 "Introducción" #: ../../doc/src/developer_tutorial.ipynb:18 msgid "" "Abstract Syntax Tree (AST): Represents any Fortran source code, strictly " "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 "" "Abstract Semantic Representation (ASR): Represents a valid Fortran source" " code, all semantic is included. Invalid Fortran code is not allowed (an " "error will be given). The ASR module can convert itself to an AST." 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 "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 "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 "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 "Primeros pasos" #: ../../doc/src/index.md:141 ../../doc/src/progress.md:1 msgid "LFortran Development Status" msgstr "Estado del desarrollo de LFortran" #: ../../doc/src/index.md:147 msgid "Developer's Guide" msgstr "Guía del desarrollador" #: ../../doc/src/index.md:156 msgid "LFortran Intrinsics" msgstr "Intrínsecos de LFortran" #: ../../doc/src/index.md:1 msgid "LFortran Documentation" msgstr "Documentación de LFortran" #: ../../doc/src/index.md:3 msgid "" "LFortran is a modern open-source (BSD licensed) interactive Fortran " "compiler built on top of LLVM. It can execute user's code interactively " "to allow exploratory work (much like Python, MATLAB or Julia) as well as " "compile to binaries with the goal to run user's code on modern " "architectures such as multi-core CPUs and GPUs." 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 msgid "" "Website: [https://lfortran.org/](https://lfortran.org/) Main " "repository: " "[https://github.com/lfortran/lfortran](https://github.com/lfortran/lfortran)" " Try online using Binder: " "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb)" 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" msgstr "" #: ../../doc/src/index.md:16 msgid "Feature Highlights" msgstr "Características destacadas" #: ../../doc/src/index.md:18 msgid "" "LFortran is in development, there are features that work today, and there" " are features that are being implemented. You can also check out the " "[Development Status](progress.md) section for more information on " "features being supported and being worked on." 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 "Trabajando actualmente" #: ../../doc/src/index.md:23 #, python-format msgid "" "**Interactive, Jupyter support** LFortran can be used from Jupyter as a" " Fortran kernel, allowing a Python/Julia style rapid prototyping and " "exploratory workflow (see the " "[static](https://nbviewer.jupyter.org/gist/certik/f1d28a486510810d824869ab0c491b1c)" " or [interactive](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb) example notebook). Or " "it can be used from the command-line in an interactive prompt (REPL)." 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 "" "**Clean, modular design, usable as a library** LFortran is structured " "around two independent modules, AST and ASR, both of which are " "standalone (completely independent of the rest of LFortran) and users " "are encouraged to use them independently for other applications and " "build tools on top. See the [Design](design.md) and [Developer " "Tutorial](developer_tutorial.md) documents for more details." 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 "" "**Interoperation with GFortran** LFortran can parse GFortran module " "files into an ASR and generate a Fortran wrapper that can be compiled " "with any Fortran compiler and linked with the original GFortran " "compiled module." 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 "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 "" "**Native interoperation with other languages (and other Fortran " "compilers)** It can automatically call code written in other languages " "(such as C or Python) just by using the `use` statement, see " "[#44](https://gitlab.com/lfortran/lfortran/issues/44). It understands " "other Fortran compilers module files (one can just \"use\" them) and " "their ABI to link correctly (GFortran is supported, other compilers are" " planned, see [#56](https://gitlab.com/lfortran/lfortran/issues/56)), " "which allows to use LFortran with production codes today." 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 "" "**Modern hardware support** Thanks to LLVM, the goal of LFortran is to " "run on modern hardware and take advantage of native Fortran language " "constructs (such as `do concurrent`) to run on multi-core CPUs and " "GPUs, see [#57](https://gitlab.com/lfortran/lfortran/issues/57)." 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 "" "**Full Fortran 2018 support** Currently only a subset of Fortran is " "implemented, but the goal is to have a full implementation of the " "latest Fortran 2018 standard, see " "[#58](https://gitlab.com/lfortran/lfortran/issues/58)." 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 "" "Please vote on issues in our [issue " "tracker](https://gitlab.com/lfortran/lfortran/issues) that you want us to" " prioritize (feel free to create new ones if we are missing anything)." 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 "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 "" "Port code generation to use ASR and pass all the current tests " "([#74](https://gitlab.com/lfortran/lfortran/issues/74)). Remove the old " "code generation and old semantics, that used to annotate the AST tree, " "which was messy." 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 "" "Get GFortran module files working with `use` module, both assumed-size " "and assumed-shape arrays " "([#52](https://gitlab.com/lfortran/lfortran/issues/52)). This will allow " "right away to use production codes with LFortran." 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 "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 "" "b) Gradually move to C++ for robustness and speed " "([#70](https://gitlab.com/lfortran/lfortran/issues/70)). The Python API " "will not change (or only minimally), so the user experience from Python " "will not change." 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 "" "c) Implement all the other cool features: `use` module for C and Python " "and automatic wrappers " "([#44](https://gitlab.com/lfortran/lfortran/issues/44)), modern hardware" " support ([#57](https://gitlab.com/lfortran/lfortran/issues/57)), " "generating an older standard of Fortran " "([#72](https://gitlab.com/lfortran/lfortran/issues/72)), Fortran doctest" " feature ([#73](https://gitlab.com/lfortran/lfortran/issues/73)), SymPy" " integration ([#71](https://gitlab.com/lfortran/lfortran/issues/71)), " "language service for IDEs " "([#12](https://gitlab.com/lfortran/lfortran/issues/12)), and other ideas" " ([#29](https://gitlab.com/lfortran/lfortran/issues/29))." 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 "El paso 1. es una restauración interna que no llevará mucho tiempo." #: ../../doc/src/index.md:120 msgid "" "The step 2. will allow LFortran to be used interactively with production " "codes right away (the production code will get compiled with GFortran, " "then one \"uses\" any module in LFortran and functions/subroutines can be" " interactively called, the module itself can use any GFortran supported " "feature, but the API must fit into the subset that LFortran understands " "--- for large number of applications simple functions/subroutines with " "array arguments are enough). This will make LFortran usable for first " "users and one can always use GFortran temporarily until LFortran supports" " the given feature. We expect to be finished with the step 2. by the end " "of summer 2019, hopefully sooner." 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 "" "Finally the step 3. will improve LFortran overall, allowing the first " "users to contribute back, growing the community and making LFortran " "gradually useful for more and more people." 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 "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 "Binarios" #: ../../doc/src/installation.md:7 msgid "" "The recommended way to install LFortran is using Conda. Install Conda for" " example by installing the " "[Miniconda](https://conda.io/en/latest/miniconda.html) installation by " "following instructions there for your platform. Then create a new " "environment (you can choose any name, here we chose `lf`) and activate " "it:" 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 "Luego instale LFortran haciendo:" #: ../../doc/src/installation.md:20 msgid "" "Now the `lf` environment has the `lfortran` compiler available, you can " "start the interactive prompt by executing `lfortran`, or see the command " "line options using `lfortran -h`." 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 "Puede crear un cuaderno Jupyter basado en Fortran ejecutando:" #: ../../doc/src/installation.md:32 msgid "and selecting `New->Fortran`." msgstr "y seleccionando `New->Fortran`." #: ../../doc/src/installation.md:35 msgid "Build From a Source Tarball" msgstr "Construir desde una fuente de archivo tar" #: ../../doc/src/installation.md:37 msgid "" "This method is the recommended method if you just want to install " "LFortran, either yourself or in a package manager (Spack, Conda, Debian, " "etc.). The source tarball has all the generated files included and has " "minimal dependencies." 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 "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 "Y construir:" #: ../../doc/src/installation.md:58 msgid "This will install the `lfortran` into the `inst/bin`." msgstr "Esto instalará `lfortran` en `inst/bin`." #: ../../doc/src/installation.md:60 msgid "Build From Git" 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 "Luego prepara el ambiente:" #: ../../doc/src/installation.md:77 msgid "Clone the LFortran git repository:" 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 "Ejecutar pruebas:" #: ../../doc/src/installation.md:97 msgid "Run an interactive prompt:" msgstr "Ejecute un aviso interactivo:" #: ../../doc/src/installation.md:102 msgid "Build from Git on Windows with Visual Studio" msgstr "Cree desde Git en Windows con Visual Studio" #: ../../doc/src/installation.md:104 msgid "" "Install Visual Studio (MSVC), for example the version 2022, you can " "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 "Inicie el indicador de Miniforge desde el escritorio." #: ../../doc/src/installation.md:111 msgid "In the shell, initialize the MSVC compiler using:" msgstr "En la interfaz, inicialice el compilador MSVC usando:" #: ../../doc/src/installation.md:117 msgid "You can optionally test that MSVC works by:" msgstr "Opcionalmente, puede probar que MSVC funciona:" #: ../../doc/src/installation.md:122 msgid "Both commands must print help (several pages)." msgstr "Ambos comandos deben imprimir ayuda (varias páginas)." #: ../../doc/src/installation.md:124 msgid "Now you can download and build LFortran:" msgstr "Ahora puede descargar y compilar LFortran:" #: ../../doc/src/installation.md:134 msgid "If everything compiled, then you can use LFortran as follows:" msgstr "Si todo está compilado, puede usar LFortran de la siguiente manera:" #: ../../doc/src/installation.md:140 msgid "And so on." msgstr "Y así." #: ../../doc/src/installation.md:142 msgid "" "Note: LFortran currently uses the MSVC's linker program (`link`), which " "is only available when the MSVC bat script above is ran. If you forget to" " activate it, LFortran's linking will fail." 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 "" "Note: the miniforge shell seems to be running some version of `git-bash` " "(although it is `cmd.exe`), which has some unix-like filesystem mounted " "in `/usr` and several commands available such as `ls`, `which`, `git`, " "`vim`. For this reason the Conda build `environment_win.yml` contains " "everything needed, including `git`." 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 "Construya desde Git en Windows con WSL" #: ../../doc/src/installation.md:153 msgid "In windows search \"turn windows features on or off\"." msgstr "" #: ../../doc/src/installation.md:154 msgid "Tick Windows subsystem for Linux." msgstr "Marque el subsistema de Windows para Linux." #: ../../doc/src/installation.md:155 msgid "Press OK and restart computer." 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 "Vaya a la tienda de Microsoft, descargue Ubuntu 20.04 y ejecútelo." #: ../../doc/src/installation.md:157 msgid "Run the following commands." msgstr "Ejecute los siguientes comandos." #: ../../doc/src/installation.md:164 msgid "Now do the following to configure the path" 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 "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 "Luego presione ctrl + O (guardar), Enter (confirmar), ctrl + X (salir)" #: ../../doc/src/installation.md:173 msgid "After that restart Ubuntu" msgstr "Después de eso, reinicie Ubuntu" #: ../../doc/src/installation.md:174 msgid "Run the following" msgstr "Ejecute lo siguiente" #: ../../doc/src/installation.md:179 msgid "Restart Ubuntu again" 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 "p.ej. `cd mnt/c/Users/name/source/repos/`" #: ../../doc/src/installation.md:190 msgid "Now clone the LFortran git repository" msgstr "Ahora clone el repositorio LFortran git" #: ../../doc/src/installation.md:196 msgid "Run the following commands" msgstr "Ejecute los siguientes comandos" #: ../../doc/src/installation.md:204 msgid "If everything compiles, you can use LFortran as follows" msgstr "Si todo se compila, puede usar LFortran de la siguiente manera" #: ../../doc/src/installation.md:210 msgid "Run an interactive prompt" msgstr "Ejecutar un aviso interactivo" #: ../../doc/src/installation.md:215 msgid "Run tests" msgstr "Ejecutar pruebas" #: ../../doc/src/installation.md:221 msgid "Enabling the Jupyter Kernel" 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 "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 "Construir desde Git con Nix" #: ../../doc/src/installation.md:256 msgid "" "One of the ways to ensure exact environment and dependencies is with " "`nix`. This will ensure that system dependencies do not interfere with " "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" msgstr "" #: ../../doc/src/installation.md:260 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 "" "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" msgstr "" #: ../../doc/src/installation.md:266 msgid "" "If you would like to not provide `nix` with root access to your machine, " "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 "Desarrollo" #: ../../doc/src/installation.md:280 msgid "Now we can enter the development environment:" 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 "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 "Nota sobre las dependencias" #: ../../doc/src/installation.md:299 msgid "" "End users (and distributions) are encouraged to use the tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), which " "only depends on LLVM, CMake and a C++ compiler." 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 "" "The tarball is generated automatically by our CI (continuous integration)" " and contains some autogenerated files: the parser, the AST and ASR " "nodes, which is generated by an ASDL translator (requires Python)." 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 "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 "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 "[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 "[re2c - 2.0.3](https://re2c.org/install/install.html)" #: ../../doc/src/installation.md:317 msgid "" "[binutils - " "2.31.90](ftp://sourceware.org/pub/binutils/snapshots/binutils-2.31.90.tar.xz)" " - Make sure that you should enable the required options related to this " "dependency to build the dynamic libraries (the ones ending with `.so`)." 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" msgstr "" #: ../../doc/src/installation.md:321 msgid "" "LFortran can print stacktraces when there is an unhandled exception, as " "well as on any compiler error with the `--show-stacktrace` option. This " "is very helpful for developing the compiler itself to see where in " "LFortran the problem is. The stacktrace support is turned off by default," " to enable it, compile LFortran with the `-DWITH_STACKTRACE=yes` cmake " "option after installing the prerequisites on each platform per the " "instructions below." 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 "Ubuntu" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." msgstr "En Ubuntu, `apt install binutils-dev`." #: ../../doc/src/installation.md:332 msgid "macOS" msgstr "macOS" #: ../../doc/src/installation.md:334 msgid "" "If you use the default Clang compiler on macOS, then the stacktraces " "should just work on both Intel and M1 based macOS (the CMake build system" " automatically invokes the `dsymtuil` tool and our Python scripts to " "store the debug information, see `src/bin/CMakeLists.txt` for more " "details). If it does not work, please report a bug." 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 "" "and compile LFortran with the " "`-DCMAKE_PREFIX_PATH=\"$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX\"` cmake" " option. The `$CONDA_PREFIX` is there if you install some other " "dependencies (such as `llvm`) using Conda, otherwise you can remove it." 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 "Funciones intrínsecas de matriz" #: ../../doc/src/intrinsics/array/allocated.md:1 msgid "allocated(x): Status Check" msgstr "allocated(x): verificación de estado" #: ../../doc/src/intrinsics/array/allocated.md:3 msgid "Logical status of an allocatable integer." msgstr "Estado lógico de un entero asignable." #: ../../doc/src/intrinsics/array/allocated.md:5 #: ../../doc/src/intrinsics/array/cshift.md:5 #: ../../doc/src/intrinsics/array/size.md:5 #: ../../doc/src/intrinsics/bit/bge.md:5 ../../doc/src/intrinsics/bit/bgt.md:5 #: ../../doc/src/intrinsics/bit/bit_size.md:5 #: ../../doc/src/intrinsics/bit/ble.md:5 ../../doc/src/intrinsics/bit/blt.md:5 #: ../../doc/src/intrinsics/bit/btest.md:5 #: ../../doc/src/intrinsics/bit/shiftl.md:5 #: ../../doc/src/intrinsics/bit/shiftr.md:5 #: ../../doc/src/intrinsics/character/achar.md:5 #: ../../doc/src/intrinsics/character/adjustl.md:5 #: ../../doc/src/intrinsics/character/adjustr.md:5 #: ../../doc/src/intrinsics/character/char.md:5 #: ../../doc/src/intrinsics/character/len_trim.md:5 #: ../../doc/src/intrinsics/character/lge.md:5 #: ../../doc/src/intrinsics/kind-type/kind.md:5 #: ../../doc/src/intrinsics/mathematical/acos.md:5 #: ../../doc/src/intrinsics/mathematical/acosh.md:5 #: ../../doc/src/intrinsics/mathematical/asin.md:5 #: ../../doc/src/intrinsics/mathematical/asinh.md:5 #: ../../doc/src/intrinsics/mathematical/atan.md:5 #: ../../doc/src/intrinsics/mathematical/atan2.md:5 #: ../../doc/src/intrinsics/mathematical/atanh.md:5 #: ../../doc/src/intrinsics/mathematical/fraction.md:5 #: ../../doc/src/intrinsics/misc/command_argument_count.md:5 #: ../../doc/src/intrinsics/misc/cpu_time.md:5 #: ../../doc/src/intrinsics/misc/date_and_time.md:5 #: ../../doc/src/intrinsics/misc/new_line.md:5 #: ../../doc/src/intrinsics/numeric/abs.md:5 #: ../../doc/src/intrinsics/numeric/aimag.md:5 #: ../../doc/src/intrinsics/numeric/aint.md:5 #: ../../doc/src/intrinsics/numeric/anint.md:5 #: ../../doc/src/intrinsics/numeric/ceiling.md:5 #: ../../doc/src/intrinsics/numeric/cmplx.md:5 #: ../../doc/src/intrinsics/numeric/conjg.md:5 #: ../../doc/src/intrinsics/numeric/digits.md:5 #: ../../doc/src/intrinsics/numeric/dim.md:5 #: ../../doc/src/intrinsics/numeric/epsilon.md:5 #: ../../doc/src/intrinsics/numeric/erf.md:5 #: ../../doc/src/intrinsics/numeric/erfc.md:5 #: ../../doc/src/intrinsics/numeric/exp.md:5 #: ../../doc/src/intrinsics/numeric/floor.md:5 #: ../../doc/src/intrinsics/numeric/gamma.md:5 #: ../../doc/src/intrinsics/numeric/mod.md:5 msgid "Declaration" msgstr "Declaración" #: ../../doc/src/intrinsics/array/allocated.md:7 #: ../../doc/src/intrinsics/array/cshift.md:7 #: ../../doc/src/intrinsics/array/size.md:7 #: ../../doc/src/intrinsics/bit/bge.md:7 ../../doc/src/intrinsics/bit/bgt.md:7 #: ../../doc/src/intrinsics/bit/bit_size.md:7 #: ../../doc/src/intrinsics/bit/ble.md:7 ../../doc/src/intrinsics/bit/blt.md:7 #: ../../doc/src/intrinsics/bit/btest.md:7 #: ../../doc/src/intrinsics/bit/shiftl.md:7 #: ../../doc/src/intrinsics/bit/shiftr.md:7 #: ../../doc/src/intrinsics/character/achar.md:7 #: ../../doc/src/intrinsics/character/adjustl.md:7 #: ../../doc/src/intrinsics/character/adjustr.md:7 #: ../../doc/src/intrinsics/character/char.md:7 #: ../../doc/src/intrinsics/character/len_trim.md:7 #: ../../doc/src/intrinsics/character/lge.md:8 #: ../../doc/src/intrinsics/kind-type/kind.md:7 #: ../../doc/src/intrinsics/mathematical/acos.md:7 #: ../../doc/src/intrinsics/mathematical/acosh.md:7 #: ../../doc/src/intrinsics/mathematical/asin.md:7 #: ../../doc/src/intrinsics/mathematical/asinh.md:7 #: ../../doc/src/intrinsics/mathematical/atan.md:7 #: ../../doc/src/intrinsics/mathematical/atan2.md:7 #: ../../doc/src/intrinsics/mathematical/atanh.md:7 #: ../../doc/src/intrinsics/mathematical/fraction.md:7 #: ../../doc/src/intrinsics/misc/command_argument_count.md:7 #: ../../doc/src/intrinsics/misc/cpu_time.md:7 #: ../../doc/src/intrinsics/misc/date_and_time.md:7 #: ../../doc/src/intrinsics/misc/new_line.md:7 #: ../../doc/src/intrinsics/numeric/abs.md:7 #: ../../doc/src/intrinsics/numeric/aimag.md:7 #: ../../doc/src/intrinsics/numeric/aint.md:7 #: ../../doc/src/intrinsics/numeric/anint.md:7 #: ../../doc/src/intrinsics/numeric/ceiling.md:7 #: ../../doc/src/intrinsics/numeric/cmplx.md:7 #: ../../doc/src/intrinsics/numeric/conjg.md:7 #: ../../doc/src/intrinsics/numeric/digits.md:7 #: ../../doc/src/intrinsics/numeric/dim.md:7 #: ../../doc/src/intrinsics/numeric/epsilon.md:7 #: ../../doc/src/intrinsics/numeric/erf.md:7 #: ../../doc/src/intrinsics/numeric/erfc.md:7 #: ../../doc/src/intrinsics/numeric/exp.md:7 #: ../../doc/src/intrinsics/numeric/floor.md:7 #: ../../doc/src/intrinsics/numeric/gamma.md:7 #: ../../doc/src/intrinsics/numeric/mod.md:7 msgid "Syntax" msgstr "Sintaxis" #: ../../doc/src/intrinsics/array/allocated.md:14 #: ../../doc/src/intrinsics/array/cshift.md:14 #: ../../doc/src/intrinsics/array/size.md:14 #: ../../doc/src/intrinsics/bit/bge.md:14 #: ../../doc/src/intrinsics/bit/bgt.md:14 #: ../../doc/src/intrinsics/bit/bit_size.md:14 #: ../../doc/src/intrinsics/bit/ble.md:14 #: ../../doc/src/intrinsics/bit/blt.md:14 #: ../../doc/src/intrinsics/bit/btest.md:14 #: ../../doc/src/intrinsics/bit/shiftl.md:14 #: ../../doc/src/intrinsics/bit/shiftr.md:14 #: ../../doc/src/intrinsics/character/achar.md:14 #: ../../doc/src/intrinsics/character/adjustl.md:14 #: ../../doc/src/intrinsics/character/adjustr.md:14 #: ../../doc/src/intrinsics/character/char.md:14 #: ../../doc/src/intrinsics/character/len_trim.md:14 #: ../../doc/src/intrinsics/character/lge.md:15 #: ../../doc/src/intrinsics/kind-type/kind.md:14 #: ../../doc/src/intrinsics/mathematical/acos.md:14 #: ../../doc/src/intrinsics/mathematical/acosh.md:14 #: ../../doc/src/intrinsics/mathematical/asin.md:14 #: ../../doc/src/intrinsics/mathematical/asinh.md:14 #: ../../doc/src/intrinsics/mathematical/atan.md:14 #: ../../doc/src/intrinsics/mathematical/atan2.md:13 #: ../../doc/src/intrinsics/mathematical/atanh.md:14 #: ../../doc/src/intrinsics/mathematical/fraction.md:13 #: ../../doc/src/intrinsics/misc/command_argument_count.md:14 #: ../../doc/src/intrinsics/misc/cpu_time.md:14 #: ../../doc/src/intrinsics/misc/date_and_time.md:14 #: ../../doc/src/intrinsics/misc/new_line.md:14 #: ../../doc/src/intrinsics/numeric/abs.md:15 #: ../../doc/src/intrinsics/numeric/aimag.md:15 #: ../../doc/src/intrinsics/numeric/aint.md:14 #: ../../doc/src/intrinsics/numeric/anint.md:14 #: ../../doc/src/intrinsics/numeric/ceiling.md:14 #: ../../doc/src/intrinsics/numeric/cmplx.md:16 #: ../../doc/src/intrinsics/numeric/conjg.md:15 #: ../../doc/src/intrinsics/numeric/digits.md:13 #: ../../doc/src/intrinsics/numeric/dim.md:13 #: ../../doc/src/intrinsics/numeric/epsilon.md:14 #: ../../doc/src/intrinsics/numeric/erf.md:14 #: ../../doc/src/intrinsics/numeric/erfc.md:14 #: ../../doc/src/intrinsics/numeric/exp.md:14 #: ../../doc/src/intrinsics/numeric/floor.md:14 #: ../../doc/src/intrinsics/numeric/gamma.md:14 #: ../../doc/src/intrinsics/numeric/mod.md:15 msgid "Arguments" msgstr "Argumentos" #: ../../doc/src/intrinsics/array/allocated.md:16 msgid "`x` is an integer input parameter." msgstr "`x` es un parámetro de entrada entero." #: ../../doc/src/intrinsics/array/allocated.md:18 #: ../../doc/src/intrinsics/array/cshift.md:22 #: ../../doc/src/intrinsics/array/size.md:22 #: ../../doc/src/intrinsics/bit/bge.md:18 #: ../../doc/src/intrinsics/bit/bgt.md:18 #: ../../doc/src/intrinsics/bit/bit_size.md:18 #: ../../doc/src/intrinsics/bit/ble.md:18 #: ../../doc/src/intrinsics/bit/blt.md:18 #: ../../doc/src/intrinsics/bit/btest.md:19 #: ../../doc/src/intrinsics/bit/shiftl.md:21 #: ../../doc/src/intrinsics/bit/shiftr.md:21 #: ../../doc/src/intrinsics/character/lge.md:23 #: ../../doc/src/intrinsics/kind-type/kind.md:19 #: ../../doc/src/intrinsics/mathematical/acos.md:18 #: ../../doc/src/intrinsics/mathematical/acosh.md:19 #: ../../doc/src/intrinsics/mathematical/asin.md:18 #: ../../doc/src/intrinsics/mathematical/asinh.md:19 #: ../../doc/src/intrinsics/mathematical/atan.md:18 #: ../../doc/src/intrinsics/mathematical/atan2.md:21 #: ../../doc/src/intrinsics/mathematical/atanh.md:19 #: ../../doc/src/intrinsics/mathematical/fraction.md:17 #: ../../doc/src/intrinsics/misc/command_argument_count.md:18 #: ../../doc/src/intrinsics/misc/cpu_time.md:18 #: ../../doc/src/intrinsics/misc/date_and_time.md:39 #: ../../doc/src/intrinsics/misc/new_line.md:19 #: ../../doc/src/intrinsics/numeric/abs.md:19 #: ../../doc/src/intrinsics/numeric/aimag.md:19 #: ../../doc/src/intrinsics/numeric/aint.md:20 #: ../../doc/src/intrinsics/numeric/anint.md:20 #: ../../doc/src/intrinsics/numeric/ceiling.md:18 #: ../../doc/src/intrinsics/numeric/cmplx.md:24 #: ../../doc/src/intrinsics/numeric/conjg.md:19 #: ../../doc/src/intrinsics/numeric/digits.md:17 #: ../../doc/src/intrinsics/numeric/dim.md:18 #: ../../doc/src/intrinsics/numeric/epsilon.md:18 #: ../../doc/src/intrinsics/numeric/erf.md:18 #: ../../doc/src/intrinsics/numeric/erfc.md:18 #: ../../doc/src/intrinsics/numeric/exp.md:18 #: ../../doc/src/intrinsics/numeric/floor.md:20 #: ../../doc/src/intrinsics/numeric/gamma.md:19 #: ../../doc/src/intrinsics/numeric/mod.md:22 msgid "Return values" 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 #: ../../doc/src/intrinsics/array/size.md:26 #: ../../doc/src/intrinsics/bit/bge.md:22 #: ../../doc/src/intrinsics/bit/bgt.md:22 #: ../../doc/src/intrinsics/bit/bit_size.md:22 #: ../../doc/src/intrinsics/bit/ble.md:22 #: ../../doc/src/intrinsics/bit/blt.md:22 #: ../../doc/src/intrinsics/bit/btest.md:23 #: ../../doc/src/intrinsics/bit/shiftl.md:25 #: ../../doc/src/intrinsics/bit/shiftr.md:25 #: ../../doc/src/intrinsics/character/achar.md:27 #: ../../doc/src/intrinsics/character/adjustl.md:23 #: ../../doc/src/intrinsics/character/adjustr.md:24 #: ../../doc/src/intrinsics/character/char.md:28 #: ../../doc/src/intrinsics/character/len_trim.md:22 #: ../../doc/src/intrinsics/character/lge.md:31 #: ../../doc/src/intrinsics/kind-type/kind.md:23 #: ../../doc/src/intrinsics/mathematical/acos.md:23 #: ../../doc/src/intrinsics/mathematical/acosh.md:24 #: ../../doc/src/intrinsics/mathematical/asin.md:23 #: ../../doc/src/intrinsics/mathematical/asinh.md:24 #: ../../doc/src/intrinsics/mathematical/atan.md:23 #: ../../doc/src/intrinsics/mathematical/atan2.md:27 #: ../../doc/src/intrinsics/mathematical/atanh.md:24 #: ../../doc/src/intrinsics/mathematical/fraction.md:22 #: ../../doc/src/intrinsics/misc/command_argument_count.md:22 #: ../../doc/src/intrinsics/misc/cpu_time.md:22 #: ../../doc/src/intrinsics/misc/date_and_time.md:43 #: ../../doc/src/intrinsics/misc/new_line.md:24 #: ../../doc/src/intrinsics/numeric/abs.md:24 #: ../../doc/src/intrinsics/numeric/aimag.md:23 #: ../../doc/src/intrinsics/numeric/aint.md:28 #: ../../doc/src/intrinsics/numeric/anint.md:27 #: ../../doc/src/intrinsics/numeric/ceiling.md:22 #: ../../doc/src/intrinsics/numeric/cmplx.md:30 #: ../../doc/src/intrinsics/numeric/conjg.md:23 #: ../../doc/src/intrinsics/numeric/digits.md:21 #: ../../doc/src/intrinsics/numeric/dim.md:22 #: ../../doc/src/intrinsics/numeric/epsilon.md:22 #: ../../doc/src/intrinsics/numeric/erf.md:23 #: ../../doc/src/intrinsics/numeric/erfc.md:23 #: ../../doc/src/intrinsics/numeric/exp.md:22 #: ../../doc/src/intrinsics/numeric/floor.md:28 #: ../../doc/src/intrinsics/numeric/gamma.md:23 #: ../../doc/src/intrinsics/numeric/mod.md:31 ../../doc/src/progress.md msgid "Description" msgstr "Descripción" #: ../../doc/src/intrinsics/array/allocated.md:25 msgid "" "`allocated(x)` checks the allocation status of a integer input parameter." " It returns a logical value as `TRUE` if the input argument `x` is " "allocated, `FALSE` otherwise." 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 #: ../../doc/src/intrinsics/array/size.md:33 #: ../../doc/src/intrinsics/bit/bge.md:27 #: ../../doc/src/intrinsics/bit/bgt.md:27 #: ../../doc/src/intrinsics/bit/bit_size.md:27 #: ../../doc/src/intrinsics/bit/ble.md:27 #: ../../doc/src/intrinsics/bit/blt.md:27 #: ../../doc/src/intrinsics/bit/btest.md:32 #: ../../doc/src/intrinsics/bit/shiftl.md:32 #: ../../doc/src/intrinsics/bit/shiftr.md:32 #: ../../doc/src/intrinsics/character/achar.md:37 #: ../../doc/src/intrinsics/character/adjustl.md:28 #: ../../doc/src/intrinsics/character/adjustr.md:29 #: ../../doc/src/intrinsics/character/char.md:38 #: ../../doc/src/intrinsics/character/len_trim.md:27 #: ../../doc/src/intrinsics/character/lge.md:37 #: ../../doc/src/intrinsics/kind-type/kind.md:27 #: ../../doc/src/intrinsics/mathematical/acos.md:31 #: ../../doc/src/intrinsics/mathematical/acosh.md:43 #: ../../doc/src/intrinsics/mathematical/asin.md:31 #: ../../doc/src/intrinsics/mathematical/asinh.md:35 #: ../../doc/src/intrinsics/mathematical/atan.md:31 #: ../../doc/src/intrinsics/mathematical/atan2.md:53 #: ../../doc/src/intrinsics/mathematical/atanh.md:39 #: ../../doc/src/intrinsics/mathematical/fraction.md:30 #: ../../doc/src/intrinsics/misc/command_argument_count.md:27 #: ../../doc/src/intrinsics/misc/cpu_time.md:33 #: ../../doc/src/intrinsics/misc/date_and_time.md:53 #: ../../doc/src/intrinsics/misc/new_line.md:29 #: ../../doc/src/intrinsics/numeric/abs.md:35 #: ../../doc/src/intrinsics/numeric/aimag.md:33 #: ../../doc/src/intrinsics/numeric/aint.md:35 #: ../../doc/src/intrinsics/numeric/anint.md:38 #: ../../doc/src/intrinsics/numeric/ceiling.md:26 #: ../../doc/src/intrinsics/numeric/cmplx.md:47 #: ../../doc/src/intrinsics/numeric/conjg.md:33 #: ../../doc/src/intrinsics/numeric/digits.md:26 #: ../../doc/src/intrinsics/numeric/dim.md:27 #: ../../doc/src/intrinsics/numeric/epsilon.md:29 #: ../../doc/src/intrinsics/numeric/erf.md:33 #: ../../doc/src/intrinsics/numeric/erfc.md:36 #: ../../doc/src/intrinsics/numeric/exp.md:29 #: ../../doc/src/intrinsics/numeric/floor.md:33 #: ../../doc/src/intrinsics/numeric/gamma.md:38 #: ../../doc/src/intrinsics/numeric/mod.md:43 msgid "Types" 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 "El tipo de argumento admitido es entero." #: ../../doc/src/intrinsics/array/allocated.md:46 #: ../../doc/src/intrinsics/array/cshift.md:43 #: ../../doc/src/intrinsics/array/size.md:37 #: ../../doc/src/intrinsics/bit/bge.md:49 #: ../../doc/src/intrinsics/bit/bgt.md:49 #: ../../doc/src/intrinsics/bit/bit_size.md:44 #: ../../doc/src/intrinsics/bit/ble.md:49 #: ../../doc/src/intrinsics/bit/blt.md:49 #: ../../doc/src/intrinsics/bit/btest.md:56 #: ../../doc/src/intrinsics/bit/shiftl.md:62 #: ../../doc/src/intrinsics/bit/shiftr.md:62 #: ../../doc/src/intrinsics/character/achar.md:53 #: ../../doc/src/intrinsics/character/adjustl.md:45 #: ../../doc/src/intrinsics/character/adjustr.md:46 #: ../../doc/src/intrinsics/character/char.md:53 #: ../../doc/src/intrinsics/character/len_trim.md:44 #: ../../doc/src/intrinsics/character/lge.md:59 #: ../../doc/src/intrinsics/kind-type/kind.md:59 #: ../../doc/src/intrinsics/mathematical/acos.md:60 #: ../../doc/src/intrinsics/mathematical/acosh.md:72 #: ../../doc/src/intrinsics/mathematical/asin.md:60 #: ../../doc/src/intrinsics/mathematical/asinh.md:64 #: ../../doc/src/intrinsics/mathematical/atan.md:60 #: ../../doc/src/intrinsics/mathematical/atan2.md:75 #: ../../doc/src/intrinsics/mathematical/atanh.md:68 #: ../../doc/src/intrinsics/mathematical/fraction.md:34 #: ../../doc/src/intrinsics/misc/command_argument_count.md:31 #: ../../doc/src/intrinsics/misc/cpu_time.md:44 #: ../../doc/src/intrinsics/misc/date_and_time.md:64 #: ../../doc/src/intrinsics/misc/new_line.md:40 #: ../../doc/src/intrinsics/numeric/abs.md:79 #: ../../doc/src/intrinsics/numeric/aimag.md:53 #: ../../doc/src/intrinsics/numeric/aint.md:39 #: ../../doc/src/intrinsics/numeric/anint.md:42 #: ../../doc/src/intrinsics/numeric/ceiling.md:46 #: ../../doc/src/intrinsics/numeric/cmplx.md:59 #: ../../doc/src/intrinsics/numeric/conjg.md:53 #: ../../doc/src/intrinsics/numeric/digits.md:30 #: ../../doc/src/intrinsics/numeric/dim.md:31 #: ../../doc/src/intrinsics/numeric/epsilon.md:49 #: ../../doc/src/intrinsics/numeric/erf.md:53 #: ../../doc/src/intrinsics/numeric/erfc.md:56 #: ../../doc/src/intrinsics/numeric/exp.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:65 #: ../../doc/src/intrinsics/numeric/gamma.md:58 #: ../../doc/src/intrinsics/numeric/mod.md:80 msgid "Examples" msgstr "Ejemplos" #: ../../doc/src/intrinsics/array/allocated.md:59 #: ../../doc/src/intrinsics/array/cshift.md:55 #: ../../doc/src/intrinsics/array/size.md:48 #: ../../doc/src/intrinsics/mathematical/acos.md:76 #: ../../doc/src/intrinsics/mathematical/acosh.md:81 #: ../../doc/src/intrinsics/mathematical/asin.md:76 #: ../../doc/src/intrinsics/mathematical/asinh.md:73 #: ../../doc/src/intrinsics/mathematical/atan.md:76 #: ../../doc/src/intrinsics/mathematical/atan2.md:84 #: ../../doc/src/intrinsics/mathematical/atanh.md:77 #: ../../doc/src/intrinsics/mathematical/fraction.md:44 msgid "**Result**:" msgstr "**Result**:" #: ../../doc/src/intrinsics/array/allocated.md:65 #: ../../doc/src/intrinsics/array/cshift.md:62 #: ../../doc/src/intrinsics/array/size.md:55 #: ../../doc/src/intrinsics/bit/bge.md:68 #: ../../doc/src/intrinsics/bit/bgt.md:66 #: ../../doc/src/intrinsics/bit/bit_size.md:61 #: ../../doc/src/intrinsics/bit/ble.md:68 #: ../../doc/src/intrinsics/bit/blt.md:66 #: ../../doc/src/intrinsics/bit/btest.md:71 #: ../../doc/src/intrinsics/bit/shiftl.md:80 #: ../../doc/src/intrinsics/bit/shiftr.md:80 #: ../../doc/src/intrinsics/character/achar.md:69 #: ../../doc/src/intrinsics/character/adjustl.md:62 #: ../../doc/src/intrinsics/character/adjustr.md:63 #: ../../doc/src/intrinsics/character/char.md:69 #: ../../doc/src/intrinsics/character/len_trim.md:63 #: ../../doc/src/intrinsics/character/lge.md:79 #: ../../doc/src/intrinsics/kind-type/kind.md:79 #: ../../doc/src/intrinsics/mathematical/acos.md:82 #: ../../doc/src/intrinsics/mathematical/acosh.md:86 #: ../../doc/src/intrinsics/mathematical/asin.md:82 #: ../../doc/src/intrinsics/mathematical/asinh.md:78 #: ../../doc/src/intrinsics/mathematical/atan.md:82 #: ../../doc/src/intrinsics/mathematical/atan2.md:90 #: ../../doc/src/intrinsics/mathematical/atanh.md:82 #: ../../doc/src/intrinsics/mathematical/fraction.md:50 #: ../../doc/src/intrinsics/misc/command_argument_count.md:47 #: ../../doc/src/intrinsics/misc/cpu_time.md:64 #: ../../doc/src/intrinsics/misc/date_and_time.md:90 #: ../../doc/src/intrinsics/misc/new_line.md:56 #: ../../doc/src/intrinsics/numeric/abs.md:96 #: ../../doc/src/intrinsics/numeric/aimag.md:68 #: ../../doc/src/intrinsics/numeric/aint.md:55 #: ../../doc/src/intrinsics/numeric/anint.md:58 #: ../../doc/src/intrinsics/numeric/ceiling.md:64 #: ../../doc/src/intrinsics/numeric/cmplx.md:74 #: ../../doc/src/intrinsics/numeric/conjg.md:68 #: ../../doc/src/intrinsics/numeric/digits.md:44 #: ../../doc/src/intrinsics/numeric/dim.md:47 #: ../../doc/src/intrinsics/numeric/epsilon.md:63 #: ../../doc/src/intrinsics/numeric/erf.md:67 #: ../../doc/src/intrinsics/numeric/erfc.md:70 #: ../../doc/src/intrinsics/numeric/exp.md:71 #: ../../doc/src/intrinsics/numeric/floor.md:83 #: ../../doc/src/intrinsics/numeric/gamma.md:74 #: ../../doc/src/intrinsics/numeric/mod.md:95 msgid "See Also" msgstr "Ver también" #: ../../doc/src/intrinsics/array/cshift.md:1 msgid "cshift(A, shift [, dim]): Circular Shift" msgstr "cshift(A, shift [, dim]): Desplazamiento circular" #: ../../doc/src/intrinsics/array/cshift.md:3 msgid "Circular shift elements of an array." 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 "`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 "`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 "" "**cshift(A, shift [, dim])** performs a circular shift on elements of `A`" " array along the dimension of `dim`. Default value of `dim` is 1, used " "when `dim` is not passed." 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 "" "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 "" "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 "size(x): tamaño de la matriz" #: ../../doc/src/intrinsics/array/size.md:3 msgid "Returns the size of an array `x`." 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 "`kind` opcional el tipo del valor de retorno." #: ../../doc/src/intrinsics/array/size.md:24 msgid "`n` the size of an array (integer)." msgstr "`n` el tamaño de una matriz (entero)." #: ../../doc/src/intrinsics/array/size.md:28 msgid "" "The `size` intrinsic function returns the size of an array. It returns " "the product of all dimensions, unless the `dim` argument is specified, in" " which case it only returns the size of this particular dimension. The " "`kind` argument can be used to specify the integer kind of the result." 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 "[shape](), [reshape]()." #: ../../doc/src/intrinsics/bit.md:1 msgid "Bit Intrinsic Functions" msgstr "Funciones intrínsecas de bits" #: ../../doc/src/intrinsics/bit/bge.md:1 msgid "bge(x, y): Bitwise Greater or Equal" 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 "Bit a bit mayor o igual que." #: ../../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 "" "`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 "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 #: ../../doc/src/intrinsics/bit/ble.md:29 #: ../../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 "" "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 #: ../../doc/src/intrinsics/bit/bit_size.md:54 #: ../../doc/src/intrinsics/bit/ble.md:60 #: ../../doc/src/intrinsics/bit/blt.md:59 #: ../../doc/src/intrinsics/bit/btest.md:65 #: ../../doc/src/intrinsics/bit/shiftl.md:74 #: ../../doc/src/intrinsics/bit/shiftr.md:74 #: ../../doc/src/intrinsics/character/achar.md:63 #: ../../doc/src/intrinsics/character/adjustl.md:56 #: ../../doc/src/intrinsics/character/adjustr.md:57 #: ../../doc/src/intrinsics/character/char.md:63 #: ../../doc/src/intrinsics/character/len_trim.md:57 #: ../../doc/src/intrinsics/character/lge.md:72 #: ../../doc/src/intrinsics/kind-type/kind.md:72 #: ../../doc/src/intrinsics/misc/command_argument_count.md:40 #: ../../doc/src/intrinsics/misc/cpu_time.md:57 #: ../../doc/src/intrinsics/misc/date_and_time.md:83 #: ../../doc/src/intrinsics/misc/new_line.md:49 #: ../../doc/src/intrinsics/numeric/abs.md:89 #: ../../doc/src/intrinsics/numeric/aimag.md:62 #: ../../doc/src/intrinsics/numeric/aint.md:48 #: ../../doc/src/intrinsics/numeric/anint.md:51 #: ../../doc/src/intrinsics/numeric/ceiling.md:57 #: ../../doc/src/intrinsics/numeric/cmplx.md:68 #: ../../doc/src/intrinsics/numeric/conjg.md:62 #: ../../doc/src/intrinsics/numeric/digits.md:38 #: ../../doc/src/intrinsics/numeric/dim.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:57 #: ../../doc/src/intrinsics/numeric/erf.md:61 #: ../../doc/src/intrinsics/numeric/erfc.md:64 #: ../../doc/src/intrinsics/numeric/exp.md:65 #: ../../doc/src/intrinsics/numeric/floor.md:76 #: ../../doc/src/intrinsics/numeric/gamma.md:67 #: ../../doc/src/intrinsics/numeric/mod.md:89 msgid "**Result:**" msgstr "**Result:**" #: ../../doc/src/intrinsics/bit/bge.md:70 msgid "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." 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 "bgt(x, y): bit a bit mayor que" #: ../../doc/src/intrinsics/bit/bgt.md:3 msgid "Bitwise greater than." 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 "[bge](bge.md), [ble](ble.md), [blt](blt.md)." #: ../../doc/src/intrinsics/bit/bit_size.md:1 msgid "bit_size(x): Bit Size" msgstr "bit_size(x): tamaño de bit" #: ../../doc/src/intrinsics/bit/bit_size.md:3 msgid "Bit size." msgstr "Tamaño de bits." #: ../../doc/src/intrinsics/bit/bit_size.md:16 msgid "`x` is integer input value." 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 "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 "Los tipos de entrada admitidos son enteros." #: ../../doc/src/intrinsics/bit/ble.md:1 msgid "bge(x, y): Bitwise Less or Equal" 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 "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 "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." #: ../../doc/src/intrinsics/bit/blt.md:1 msgid "blt(x, y): Bitwise Less Than" msgstr "blt(x, y): bit a bit menor que" #: ../../doc/src/intrinsics/bit/blt.md:3 msgid "Bitwise less than." 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 "[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 "btest(x, pos): Prueba de bits en la posición" #: ../../doc/src/intrinsics/bit/btest.md:3 msgid "Bit test." 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 "El valor de retorno es de tipo lógico." #: ../../doc/src/intrinsics/bit/btest.md:25 msgid "" "`btest(x, pos)` calculates if `pos` bit in input integer value `x` is " "set. The counting of the bits starts at 0, at least significant bit (LSB)" " i.e., the rightmost bit in `x`." 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 "shiftl(x, shift): Desplazamiento a la izquierda" #: ../../doc/src/intrinsics/bit/shiftl.md:3 msgid "Logical shift left function." 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 "`x` es un valor de entrada entero." #: ../../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 "" "`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 "El valor devuelto es de tipo entero y del mismo tipo que `x`." #: ../../doc/src/intrinsics/bit/shiftl.md:27 msgid "" "**shiftl(x, shift)** logically left shifts `x` by `shift` number of bits." " `shiftl` shifts from LSB(**L**east **S**ignificant **B**it) to " "MSB(**M**ost **S**ignificant **B**it). Bits shifted from the left end " "i.e., MSB bits are lost. Zeroes are appended to the opposite right end." 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 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 "[shiftr](shiftr.md)." #: ../../doc/src/intrinsics/bit/shiftr.md:1 msgid "shiftr(x, shift): Shift Right" msgstr "shiftr(x, shift): Desplazamiento a la derecha" #: ../../doc/src/intrinsics/bit/shiftr.md:3 msgid "Logical shift right function." msgstr "Función de desplazamiento lógico a la derecha." #: ../../doc/src/intrinsics/bit/shiftr.md:27 msgid "" "**shiftr(x, shift)** logically right shifts `x` by `shift` number of " "bits. `shiftr` shifts from MSB(**M**ost **S**ignificant **B**it) to " "LSB(**L**east **S**ignificant **B**it). Bits shifted from the right end " "i.e., LSB bits are lost. Zeroes are appended to the opposite left end." 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 "[shiftl](shiftl.md)." #: ../../doc/src/intrinsics/character.md:1 msgid "Character Intrinsic Functions" msgstr "Funciones intrínsecas de carácter" #: ../../doc/src/intrinsics/character/achar.md:1 msgid "achar(x, kind): To Character in ASCII set." 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 "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 #: ../../doc/src/intrinsics/character/adjustr.md:18 #: ../../doc/src/intrinsics/character/char.md:21 #: ../../doc/src/intrinsics/character/len_trim.md:18 msgid "Return value" 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 "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 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 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 "" "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 "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 "[lge](lge.md)." #: ../../doc/src/intrinsics/character/adjustl.md:1 msgid "adjustl(string): Left Adjust String" msgstr "adjustl(string): ajuste de cadena a izquierda" #: ../../doc/src/intrinsics/character/adjustl.md:3 msgid "Left adjust a string." 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 "`string`: el valor de entrada debe ser de tipo carácter." #: ../../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 "" "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 "El tipo de argumento admitido es el carácter." #: ../../doc/src/intrinsics/character/adjustr.md:1 msgid "adjustr(string): Right Adjust String" msgstr "adjustr(cadena): Cadena ajustada a la derecha" #: ../../doc/src/intrinsics/character/adjustr.md:3 msgid "Right adjust a string." msgstr "Ajuste a la derecha una cadena." #: ../../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 "" "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 "[adjustl](adjustl.md)." #: ../../doc/src/intrinsics/character/char.md:1 msgid "char(x, [, kind]): Integer to Character" msgstr "char(x, [, kind]): Transforma entero en carácter" #: ../../doc/src/intrinsics/character/char.md:3 msgid "Integer to character conversion." msgstr "Conversión de entero a carácter." #: ../../doc/src/intrinsics/character/char.md:16 msgid "`x`: the input value of integer type." 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 "[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 "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 "`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 "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 "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 "lge(x, y): léxicamente mayor o igual" #: ../../doc/src/intrinsics/character/lge.md:3 msgid "Lexically greater than or equal." msgstr "Léxicamente mayor que o igual." #: ../../doc/src/intrinsics/character/lge.md:17 msgid "`x` input value of type character." msgstr "`x` valor de entrada de tipo carácter." #: ../../doc/src/intrinsics/character/lge.md:19 msgid "`y` input value of type character." msgstr "`y` valor de entrada de tipo carácter." #: ../../doc/src/intrinsics/character/lge.md:21 msgid "`x` and `y` can be seen as string A and string B." msgstr "`x`e `y` pueden ser vistos como la cadena A y la cadena B." #: ../../doc/src/intrinsics/character/lge.md:25 msgid "The return value is of logical `true` or `false` type." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:27 msgid "`True` if `x` string is lexically greater than or equal to `y`." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:29 msgid "`False` if they are not." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:33 msgid "" "**lge(x, y)** determines if input string `x` is lexically greater than or" " equal to input string `y`. The two strings in comparison are interpreted" " as containing ASCII character codes." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:39 msgid "Argument types should be of type character literal." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:81 msgid "[len_trim](len_trim.md)." msgstr "" #: ../../doc/src/intrinsics/kind-type.md:1 msgid "Kind Type Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:1 msgid "kind(x): Kind of an Entity" msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:3 msgid "Kind of an entity." 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 "" #: ../../doc/src/intrinsics/kind-type/kind.md:21 msgid "The return value is of integer type and of default integer kind." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:25 msgid "**kind(x)** returns the kind parameter of the input argument `x`." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:29 msgid "" "Supported argument types are logical, integer, real, complex, or " "character." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:81 #: ../../doc/src/intrinsics/misc/command_argument_count.md:16 #: ../../doc/src/intrinsics/misc/cpu_time.md:20 #: ../../doc/src/intrinsics/misc/date_and_time.md:41 #: ../../doc/src/intrinsics/misc/new_line.md:58 msgid "None." msgstr "" #: ../../doc/src/intrinsics/mathematical.md:1 msgid "Mathematical Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:1 msgid "acos(x): Trigonometric Arc Cosine" msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:3 msgid "Trigonometric arc cosine (inverse cosine) function." 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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:20 #: ../../doc/src/intrinsics/mathematical/acosh.md:21 #: ../../doc/src/intrinsics/mathematical/asin.md:20 #: ../../doc/src/intrinsics/mathematical/asinh.md:21 #: ../../doc/src/intrinsics/mathematical/atan.md:20 #: ../../doc/src/intrinsics/mathematical/atanh.md:21 msgid "" "The returned value has the kind of the input value and TYPE may be real " "or complex." msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:25 msgid "**acos(x)** computes the arcsine of the argument **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:33 #: ../../doc/src/intrinsics/mathematical/acosh.md:45 #: ../../doc/src/intrinsics/mathematical/asin.md:33 #: ../../doc/src/intrinsics/mathematical/asinh.md:37 #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:84 msgid "[asin](asin.md), [atan](atan.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:1 msgid "acosh(x): Inverse Hyperbolic Cosine" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:3 msgid "Inverse hyperbolic cosine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:16 #: ../../doc/src/intrinsics/mathematical/asinh.md:16 #: ../../doc/src/intrinsics/mathematical/atanh.md:16 msgid "" "`x` the input value, can be real with value greater than or equal to 1 or" " of type complex." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:26 msgid "**acosh(x)** computes the inverse hyperbolic cosine function of **x**." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acosh.md:33 msgid "$-\\pi <= img (acosh(x)) <= \\pi$" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:35 msgid "" "For real values $x$ in the domain $x > 1$, the inverse hyperbolic cosine " "satisifies:" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:38 msgid "$cosh^{-1}(x) = \\log(x + \\sqrt{(x^2 - 1)})$" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acosh.md:88 msgid "[asinh](asinh.md), [atanh](atanh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:1 msgid "asin(x): Trigonometric Arcsine" msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:3 msgid "Trigonometric arcsine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:25 msgid "**asin(x)** computes the arcsine of the argument **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/asin.md:84 msgid "[acos](acos.md), [atan](atan.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:1 msgid "asinh(x): Inverse Hyperbolic Arcsine" msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:3 msgid "Inverse hyperbolic arcsine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:26 msgid "**asinh(x)** computes the inverse hyperbolic arcsine function of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/asinh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (asinh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:80 msgid "[acosh](acosh.md), [atanh](atanh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:1 msgid "atan(x): Trigonometric ArcTangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:3 msgid "Trigonometric arctangent (inverse arctangent) function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:25 msgid "**atan(x)** computes the arctangent of the argument **x**." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:27 msgid "" "The arc tangent is the inverse function of the arctangent function. It is" " commonly used in trigonometry to find the angle when the lengths of the " "opposite side of a right triangle and base are known, i.e., perpendicular" " and base length." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:84 msgid "[asin](asin.md), [acos](acos.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:1 msgid "atan2(y, x): ArcTangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:3 msgid "Arctangent function or inverse tangent function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:15 msgid "`y` the input value is the imaginary part of the complex expression" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atan2.md:19 msgid "`x` the input value, must be real part of the complex expression." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atan2.md:29 msgid "" "**atan2(y, x)** computes the principal value of the argument function of " "the complex expression $x + iy$. This is used to transform from cartesian" " into polar coordinates and allows to determine the angle in the correct " "quadrant." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:33 msgid "It is also represented as:" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:35 msgid "$tan^{-1}(\\frac{y}{x})$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:37 msgid "If `x` is nonzero, the result lies in the range:" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:39 msgid "$-\\pi <= atan(x) <= \\pi$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:41 msgid "The sign is positive if `y` is positive." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:43 msgid "If `y` is zero and `x` is strictly positive, then the result is 0." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:45 msgid "If `x` is negative and `y` is positive zero, then the result is $\\pi$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:47 msgid "If `x` is negative and `y` is negative zero, then the result is $-\\pi$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:49 msgid "If `x` is zero, then the magnitude of the result is $\\frac{\\pi}{2}$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:51 msgid "If `y` is negative real zero, the result is $\\frac{-\\pi}{2}$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:55 #: ../../doc/src/intrinsics/mathematical/fraction.md:32 msgid "Supported argument type is real." msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:1 msgid "atanh(x): Inverse Hyperbolic Tangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:3 msgid "Inverse hyperbolic tangent function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:26 msgid "**atanh(x)** computes the inverse hyperbolic tangent function of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atanh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (atanh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:35 msgid "If the result is real, it lies in the range" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:37 msgid "$-1.0 < atanh(x) < 1.0$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:84 msgid "[asinh](asinh.md), [acosh](acosh.md)." msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:1 msgid "fraction(x): Fractional Part in Model Representation" msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:3 msgid "Fractional part of the model representation." msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:15 msgid "`x` the input value, must be real." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/fraction.md:24 msgid "" "**fraction(x)** computes the fractional part of the model representation " "of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/fraction.md:28 msgid "$x * {radix(x)}^{(-exponent(x))}$" msgstr "" #: ../../doc/src/intrinsics/misc.md:1 msgid "Miscellaneous Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:1 msgid "command_argument_count(): Number of Command Line Arguments" msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:3 msgid "Get number of command line arguments." msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:20 msgid "The return value is of integer type and of default kind." 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 "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:29 msgid "Any." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:1 msgid "cpu_time(x): CPU Elapsed Time" msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:3 msgid "CPU elapsed time in seconds." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:16 msgid "`x` the input value should be of type real with `intent(out)`." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:24 msgid "" "**cpu_time(time)** returns a real value representing the elapsed CPU time" " in seconds. If tine source is available, time will be reported with " "microsecond resolution. If no time source is available, TIME is set to " "-1.0." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:28 msgid "This is useful for testing segments of code to determine computation time." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:1 msgid "date_and_time([date, time, zone, values]): Date and Time" msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:3 msgid "Date and time subroutine." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:22 msgid "" "`zone` the input value of character type, which has length 5 or larger. " "It is of default kind. It is `intent(out)` and has from `(+-)hhmm`, " "representing the difference with respect to Coordinates Universal Time " "(UTC). Unavailable time and date parameters return blanks." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:30 msgid "`value(1)`: The year." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:31 msgid "`value(2)`: The month." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:32 msgid "`value(3)`: The day of the month." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:33 msgid "`value(4)`: Time difference with UTC in minutes." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:34 msgid "`value(5)`: The hour of the day." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:35 msgid "`value(6)`: The minutes of the hour." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:36 msgid "`value(7)`: The seconds of the minutes." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:37 msgid "`value(8)`: The milliseconds of the second." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:51 msgid "Unavailable or errorneous date and time parameters return blanks." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:92 msgid "[cpu_time](cpu_time.md)." msgstr "" #: ../../doc/src/intrinsics/misc/new_line.md:1 msgid "new_line(x): New Line Character" msgstr "" #: ../../doc/src/intrinsics/misc/new_line.md:3 msgid "New line character." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/new_line.md:31 msgid "Supported input parameter types is character." msgstr "" #: ../../doc/src/intrinsics/numeric.md:1 msgid "Numeric Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:1 msgid "abs(x): Absolute Value" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:3 msgid "Absolute value." msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:17 msgid "`x` the input value, can be integer, real, or complex." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/abs.md:26 msgid "" "**abs(x)** calculates and returns absolute value of `x`. Result is " "calculated using mathematical formula:" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:29 msgid "$|x|$" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:31 msgid "If `x` is complex, the result is calculated using mathematical formula:" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:33 msgid "$\\sqrt{(x^2 + y^2)}$" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aimag.md:1 msgid "aimag(x): Imaginary Part" msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:3 msgid "Imaginary part of complex number." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:17 msgid "`x` the input value must be of complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:21 msgid "The return value is imaginary part of type real and kind same as of `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:25 msgid "**aimag(x)** returns the imaginary part of the input complex argument `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:27 #: ../../doc/src/intrinsics/numeric/cmplx.md:41 #: ../../doc/src/intrinsics/numeric/conjg.md:27 msgid "" "For `x` complex input value, the result is calculated using mathematical " "formula:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aimag.md:35 msgid "Supported argument types are complex." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:1 msgid "aint(x, [kind]): Truncate to a Whole Number" msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:3 msgid "Truncate to a whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:16 #: ../../doc/src/intrinsics/numeric/anint.md:16 #: ../../doc/src/intrinsics/numeric/epsilon.md:16 #: ../../doc/src/intrinsics/numeric/erf.md:16 #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aint.md:37 #: ../../doc/src/intrinsics/numeric/anint.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:31 #: ../../doc/src/intrinsics/numeric/erf.md:35 #: ../../doc/src/intrinsics/numeric/erfc.md:38 #: ../../doc/src/intrinsics/numeric/floor.md:35 #: ../../doc/src/intrinsics/numeric/gamma.md:40 msgid "Supported argument types is real." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:85 msgid "[ceiling](ceiling.md), [mod](mod.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:1 msgid "anint(x, [kind]): Round to Nearest Whole Number" msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:3 msgid "Round to nearest whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:25 msgid "The return value is equal to rounded whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:29 msgid "**anint(x)** calculates rounded value of input parameter `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/anint.md:34 msgid "If `x` is greater than 0, `anint(x)` returns `aint(x + 0.5)`." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:60 msgid "[aint](aint.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:1 msgid "ceiling(x): Integer Ceiling" msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:3 msgid "Integer ceiling function" msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:16 msgid "The input value `x` may be of type real or integer." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:20 msgid "The return value is of type integer and nearest greater integer." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:24 msgid "**ceiling(x)** returns the least integer greater than or equal to `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:28 msgid "Supported input parameter types are integer and real." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:66 msgid "[floor](floor.md), [mod](mod.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:1 msgid "cmplx(x [, [, kind]]): Convert to Complex" msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:3 msgid "Conversion to complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:14 msgid "`cmplx(x, y)` is one of the intrinsic present in ASR." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:18 msgid "" "`x` the input value must be of integer, real, or complex. `y` the " "optional input value must be of type integer or real. It should be only " "present in case `x` is not complex. `kind` the optional input value of " "integer expression type for initialisation indicating the kind parameter " "of the result." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/cmplx.md:32 msgid "" "**cmplx(x, [, y [, kind]])** converts the input value to complex " "representation:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/cmplx.md:37 msgid "If `y` is not present, the imaginary component is set to 0.0." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:39 msgid "If `x` is complex then `y` must not be present." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:49 msgid "Supported argument types are integer, real, or complex." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:1 msgid "conjg(x): Complex Conjugate" msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:3 msgid "Complex conjugate function." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:17 msgid "`x` the input value must be of type complex." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:21 msgid "The return value is of complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:25 msgid "**conjg(x)** converts the input value `x` to its conjugate." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:29 msgid "$x + iy$ converted to $x - iy$" msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:35 msgid "Supported argument types is complex." msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:1 msgid "digits(x): Significant Binary Digits" msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:3 msgid "Significant binary digits." msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:15 msgid "`x` the input value must be of type real or integer." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/dim.md:1 msgid "dim(x, y): Positive Difference or 0" msgstr "" #: ../../doc/src/intrinsics/numeric/dim.md:3 msgid "Positive difference or 0." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/dim.md:20 msgid "The return value is of type integer or real." 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 "" #: ../../doc/src/intrinsics/numeric/epsilon.md:1 msgid "epsilon(x): Epsilon" msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:3 msgid "Epsilon function." msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:20 msgid "The return value is of same type as of the input argument." msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:24 msgid "" "**epsilon(x)** computes the smallest number $\\epsilon$ of the same kind " "as `x` following:" msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:27 msgid "$1 + \\epsilon > 1$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:1 msgid "erf(x): Error" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:3 msgid "Error function." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/erf.md:27 msgid "$-1 \\leq erf (x) \\leq 1$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_0^xe^{-t^2}dt$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:69 msgid "[erfc](erfc.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:1 msgid "erfc(x): Complementary Error" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:3 msgid "Complementary error function." 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 "" #: ../../doc/src/intrinsics/numeric/erfc.md:27 msgid "$0 \\leq erf (x) \\leq 2$" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_{x}^{\\infty}e^{-t^2}dt$" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/erfc.md:72 msgid "[erf](erf.md)." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:1 msgid "exp(x): Exponential" msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:3 msgid "Exponential function." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:16 msgid "`x` the input value must be of type real or complex." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:20 msgid "The return value is of same type as of the input argument, `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:24 msgid "**exp(x)** computes the base $e$ exponential of `x`, i.e., $e^x$." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/exp.md:31 msgid "Supported argument types is real and complex." msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:1 msgid "floor(x, kind): Integer Floor" msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:3 msgid "Integer floor function." msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:18 msgid "" "`kind` the optional input parameter must be a scalar integer constant " "expression." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:1 msgid "gamma(x): Gamma" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:3 msgid "Gamma function." 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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:21 msgid "The return value is of same type and kind as of `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:28 msgid "$\\gamma(x) = (x-1)!$" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:30 msgid "In general, if $x > 0$:" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:32 msgid "$\\gamma(x) = \\int_{0}^{\\infty} e^{-t} dt$" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:34 msgid "and if $-n-1 < x < -n$ where n is an integer >= 0:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:76 msgid "[epsilon](epsilon.md)" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:1 msgid "mod(x, y): Modulus" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:3 msgid "Modulus or remainder function." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:17 msgid "`x` the input value, can be integer or real." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/mod.md:27 msgid "`x - INT (x / y) * y`." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:29 msgid "If `y` is 0, the result is undefined like `any integer value / 0`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/mod.md:36 msgid "`x - INT(x / y) * y`" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:38 msgid "" "i.e., result is remainder when first argument is mathematically divided " "by second argument." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:41 msgid "The return value should be less than `y`." msgstr "" #: ../../doc/src/language.md:1 msgid "Fortran Language" msgstr "" #: ../../doc/src/language.md:3 msgid "Background and Motivation" msgstr "" #: ../../doc/src/language.md:5 msgid "" "Fortran was designed from the ground up to naturally and simply translate" " mathematics to code that compiles and runs at maximum speed. And being " "specifically targeted for such fundamentally computational tasks, it " "contains a broad range of key functionality within the language itself, " "standard across all platforms, with no need for external libraries that " "may or may not be well optimized or maintained, at present or down the " "road." msgstr "" #: ../../doc/src/language.md:12 msgid "Some highlights:" 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 "" #: ../../doc/src/language.md:17 msgid "" "Operators which operate naturally upon the aforementioned " "arrays/matrices, as they do scalars;" msgstr "" #: ../../doc/src/language.md:19 msgid "Complex numbers;" msgstr "" #: ../../doc/src/language.md:20 msgid "Special functions;" msgstr "" #: ../../doc/src/language.md:21 msgid "Structures and pointers for more general data representation." msgstr "" #: ../../doc/src/language.md:23 msgid "" "Because the essentials are contained in the language itself, it is simple" " to read and write, without need of choosing from among or deciphering a " "proliferation of external classes to do the same thing. And because the " "essentials are self-contained, compilers can provide detailed compile-" "time (e.g., argument mismatch) and run-time (e.g., memory access) checks," " as well as highly optimized executables, directly from natural, readable" " code without need of extensive optimization heroics by the developer." msgstr "" #: ../../doc/src/language.md:31 msgid "See our blog posts for more information:" msgstr "" #: ../../doc/src/language.md:33 msgid "" "[Why We Created LFortran](https://lfortran.org/blog/2019/04/why-we-" "created-lfortran/)" msgstr "" #: ../../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 "" #: ../../doc/src/language.md:36 msgid "How to Learn Fortran" msgstr "" #: ../../doc/src/language.md:38 msgid "" "Fortran is relatively quick to learn because it is so much simpler and " "smaller than C/C++ (in practice, that is, with all needed libraries " "included). If you are interested in learning more, please see our webpage" " at [fortran90.org] with recommended practices for writing code, side by " "side comparison with Python/NumPy, links to other online Fortran " "resources and books, and an FAQ." msgstr "" #: ../../doc/src/progress.md:3 msgid "" "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:" msgstr "" #: ../../doc/src/progress.md:7 msgid "AST: The code can be parsed to AST (`lfortran --show-ast test.f90`)" msgstr "" #: ../../doc/src/progress.md:8 msgid "ASR: The code can be transformed to ASR (`lfortran --show-asr test.f90`)" msgstr "" #: ../../doc/src/progress.md:9 msgid "LLVM: LFortran can generate LLVM IR (`lfortran --show-llvm test.f90`)" msgstr "" #: ../../doc/src/progress.md:10 msgid "BIN: The LLVM IR can compile to a binary" msgstr "" #: ../../doc/src/progress.md:11 msgid "RUN: The binary runs without errors" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:16 msgid "" "This page is generated automatically using the [Compiler " "Tester](https://gitlab.com/lfortran/compiler_tester) repository which " "contains all the Fortran tests and scripts to run LFortran to produce the" " tables below. We are looking for contributors to contribute more tests. " "Our goal is to have a comprehensive Fortran testsuite that can be used to" " test any Fortran compiler." msgstr "" #: ../../doc/src/progress.md:23 msgid "Testing the LFortran compiler version:" msgstr "" #: ../../doc/src/progress.md:32 msgid "Topics" msgstr "" #: ../../doc/src/progress.md:34 msgid "Full programs that compute something interesting" msgstr "" #: ../../doc/src/progress.md:36 msgid "Basic Numerics" msgstr "" #: ../../doc/src/progress.md:38 msgid "Directory: `tests/programs/numerics`" msgstr "" #: ../../doc/src/progress.md msgid "LLVM" msgstr "" #: ../../doc/src/progress.md msgid "BIN" msgstr "" #: ../../doc/src/progress.md msgid "RUN" msgstr "" #: ../../doc/src/progress.md msgid "Filename" msgstr "" #: ../../doc/src/progress.md msgid "`Pure Fortran sin(x) implementation`" msgstr "" #: ../../doc/src/progress.md msgid "✅" 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 "" #: ../../doc/src/progress.md:45 msgid "Modules" msgstr "" #: ../../doc/src/progress.md:47 msgid "Basic Usage" msgstr "" #: ../../doc/src/progress.md:49 msgid "Directory: `tests/modules/basic`" msgstr "" #: ../../doc/src/progress.md msgid "`Basic modules`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/basic/t01.f90)" msgstr "" #: ../../doc/src/progress.md:56 msgid "Module Functions and Subroutines" msgstr "" #: ../../doc/src/progress.md:58 msgid "Directory: `tests/modules/procedures`" msgstr "" #: ../../doc/src/progress.md msgid "`Module functions`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`Module subroutines`" msgstr "" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t02.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`Nested subroutines`" msgstr "" #: ../../doc/src/progress.md msgid "[t03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t03.f90)" msgstr "" #: ../../doc/src/progress.md:67 msgid "Expressions" msgstr "" #: ../../doc/src/progress.md:69 msgid "Arithmetic Operations" msgstr "" #: ../../doc/src/progress.md:71 msgid "Directory: `tests/expressions/arit`" msgstr "" #: ../../doc/src/progress.md msgid "`+,-,*,/,**`" msgstr "" #: ../../doc/src/progress.md msgid "[basic_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/arit/basic_operations.f90)" msgstr "" #: ../../doc/src/progress.md:78 msgid "Integers" msgstr "" #: ../../doc/src/progress.md:80 msgid "Directory: `tests/expressions/integers`" msgstr "" #: ../../doc/src/progress.md msgid "`integers`" msgstr "" #: ../../doc/src/progress.md msgid "[integer_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/integer_kind.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`relational operations`" 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 "" #: ../../doc/src/progress.md msgid "`logical operations`" 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 "" #: ../../doc/src/progress.md:89 msgid "Real Numbers" msgstr "" #: ../../doc/src/progress.md:91 msgid "Directory: `tests/expressions/reals`" msgstr "" #: ../../doc/src/progress.md msgid "`single/double reals`" msgstr "" #: ../../doc/src/progress.md msgid "[real_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/real_kind.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`defined operator`" msgstr "" #: ../../doc/src/progress.md msgid "âŒ" 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 "" #: ../../doc/src/progress.md:99 msgid "Complex Numbers" msgstr "" #: ../../doc/src/progress.md:101 msgid "Directory: `tests/expressions/complex`" msgstr "" #: ../../doc/src/progress.md msgid "`single/double complex`" msgstr "" #: ../../doc/src/progress.md msgid "[complex_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/complex/complex_kind.f90)" msgstr "" #: ../../doc/src/progress.md:108 msgid "Strings" msgstr "" #: ../../doc/src/progress.md:110 msgid "Directory: `tests/expressions/character`" msgstr "" #: ../../doc/src/progress.md msgid "`character`" msgstr "" #: ../../doc/src/progress.md msgid "[t01_character.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t01_character.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`string concatenation`" 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 "" #: ../../doc/src/progress.md:118 msgid "Derived Types" msgstr "" #: ../../doc/src/progress.md:120 msgid "Directory: `tests/expressions/derived_type`" msgstr "" #: ../../doc/src/progress.md msgid "`basic derived types`" 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 "" #: ../../doc/src/progress.md:127 msgid "Statements" msgstr "" #: ../../doc/src/progress.md:129 msgid "Allocate Statement" msgstr "" #: ../../doc/src/progress.md:131 msgid "Directory: `tests/statements/allocate`" msgstr "" #: ../../doc/src/progress.md msgid "`allocate statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/allocate/t01.f90)" msgstr "" #: ../../doc/src/progress.md:138 msgid "Block Statement" msgstr "" #: ../../doc/src/progress.md:140 msgid "Directory: `tests/statements/block`" msgstr "" #: ../../doc/src/progress.md msgid "`block statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/block/t01.f90)" msgstr "" #: ../../doc/src/progress.md:147 msgid "Goto Statement" msgstr "" #: ../../doc/src/progress.md:149 msgid "Directory: `tests/statements/goto`" msgstr "" #: ../../doc/src/progress.md msgid "`computed go-to statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`go-to statement`" msgstr "" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t02.f90)" msgstr "" #: ../../doc/src/progress.md:157 msgid "If Statement" msgstr "" #: ../../doc/src/progress.md:159 msgid "Directory: `tests/statements/if`" msgstr "" #: ../../doc/src/progress.md msgid "`Test .false.`" msgstr "" #: ../../doc/src/progress.md msgid "[if_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`single line if statement`" msgstr "" #: ../../doc/src/progress.md msgid "[if_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_02.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`multi line if statement`" msgstr "" #: ../../doc/src/progress.md msgid "[if_03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_03.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`nested if statements`" msgstr "" #: ../../doc/src/progress.md msgid "[if_04.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_04.f90)" msgstr "" #: ../../doc/src/progress.md:169 msgid "While Statement" msgstr "" #: ../../doc/src/progress.md:171 msgid "Directory: `tests/statements/while`" msgstr "" #: ../../doc/src/progress.md msgid "`Simple while loops`" msgstr "" #: ../../doc/src/progress.md msgid "[while_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_01.f90)" msgstr "" #: ../../doc/src/progress.md msgid "`exit / cycle in while loops`" msgstr "" #: ../../doc/src/progress.md msgid "[while_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_02.f90)" msgstr "" #: ../../doc/src/progress.md:179 msgid "Print Statement" msgstr "" #: ../../doc/src/progress.md:181 msgid "Directory: `tests/statements/print`" msgstr "" #: ../../doc/src/progress.md msgid "`Basic print`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/print/t01.f90)" msgstr "" #: ../../doc/src/progress.md:188 msgid "Open, Read, Write, Close Statement" msgstr "" #: ../../doc/src/progress.md:190 msgid "Directory: `tests/statements/file_io`" msgstr "" #: ../../doc/src/progress.md msgid "`open/read/write/close`" msgstr "" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/file_io/t01.f90)" msgstr "" #: ../../doc/src/progress.md:197 msgid "Intrinsic Functions" msgstr "" #: ../../doc/src/progress.md:199 msgid "abs" msgstr "" #: ../../doc/src/progress.md:201 msgid "Directory: `tests/intrinsic/abs`" msgstr "" #: ../../doc/src/progress.md msgid "`scalar single/double real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md msgid "`scalar single/double complex`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md msgid "`array 1D single/double real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:210 msgid "exp" msgstr "" #: ../../doc/src/progress.md:212 msgid "Directory: `tests/intrinsic/exp`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:221 msgid "log" msgstr "" #: ../../doc/src/progress.md:223 msgid "Directory: `tests/intrinsic/log`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:232 msgid "sqrt" msgstr "" #: ../../doc/src/progress.md:234 msgid "Directory: `tests/intrinsic/sqrt`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:243 msgid "sin" msgstr "" #: ../../doc/src/progress.md:245 msgid "Directory: `tests/intrinsic/sin`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:254 msgid "cos" msgstr "" #: ../../doc/src/progress.md:256 msgid "Directory: `tests/intrinsic/cos`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:265 msgid "tan" msgstr "" #: ../../doc/src/progress.md:267 msgid "Directory: `tests/intrinsic/tan`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:276 msgid "sinh" msgstr "" #: ../../doc/src/progress.md:278 msgid "Directory: `tests/intrinsic/sinh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:287 msgid "cosh" msgstr "" #: ../../doc/src/progress.md:289 msgid "Directory: `tests/intrinsic/cosh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:298 msgid "tanh" msgstr "" #: ../../doc/src/progress.md:300 msgid "Directory: `tests/intrinsic/tanh`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:309 msgid "asin" msgstr "" #: ../../doc/src/progress.md:311 msgid "Directory: `tests/intrinsic/asin`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:320 msgid "acos" msgstr "" #: ../../doc/src/progress.md:322 msgid "Directory: `tests/intrinsic/acos`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:331 msgid "atan" msgstr "" #: ../../doc/src/progress.md:333 msgid "Directory: `tests/intrinsic/atan`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:342 msgid "modulo" msgstr "" #: ../../doc/src/progress.md:344 msgid "Directory: `tests/intrinsic/modulo`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:352 msgid "mod" msgstr "" #: ../../doc/src/progress.md:354 msgid "Directory: `tests/intrinsic/mod`" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/progress.md:362 msgid "min" msgstr "" #: ../../doc/src/progress.md:364 msgid "Directory: `tests/intrinsic/min`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:371 msgid "max" msgstr "" #: ../../doc/src/progress.md:373 msgid "Directory: `tests/intrinsic/max`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:380 msgid "int" msgstr "" #: ../../doc/src/progress.md:382 msgid "Directory: `tests/intrinsic/int`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:389 msgid "real" msgstr "" #: ../../doc/src/progress.md:391 msgid "Directory: `tests/intrinsic/real`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:398 msgid "floor" msgstr "" #: ../../doc/src/progress.md:400 msgid "Directory: `tests/intrinsic/floor`" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:407 msgid "nint" msgstr "" #: ../../doc/src/progress.md:409 msgid "Directory: `tests/intrinsic/nint`" 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 "" lfortran-0.63.0/doc/locale/ru/0000775000175000017500000000000015174404631016252 5ustar alastairalastairlfortran-0.63.0/doc/locale/ru/LC_MESSAGES/0000775000175000017500000000000015174404631020037 5ustar alastairalastairlfortran-0.63.0/doc/locale/ru/LC_MESSAGES/docs.po0000664000175000017500000040204315174404631021332 0ustar alastairalastair# SOME DESCRIPTIVE TITLE. # Copyright (C) 2022 LFortran contributors # This file is distributed under the same license as the LFortran package. # FIRST AUTHOR , 2022. # msgid "" msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-19 12:04+0200\n" "PO-Revision-Date: 2022-10-07 22:24+0000\n" "Last-Translator: Sergey Torokhov \n" "Language-Team: Russian \n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" "X-Generator: Weblate 4.14.1\n" "Generated-By: Babel 2.10.3\n" #: ../src/ast_and_asr.ipynb:9 msgid "Difference between an AST and ASR" msgstr "" #: ../src/ast_and_asr.ipynb:11 msgid "Let us take a simple Fortran code:" msgstr "" #: ../src/ast_and_asr.ipynb:22 msgid "and look at how the AST and ASR looks like." msgstr "" #: ../src/ast_and_asr.ipynb:25 ../src/progress.md msgid "AST" msgstr "" #: ../src/ast_and_asr.ipynb:76 msgid "" "The AST does not have any semantic information, but has nodes to " "represent declarations such as ``integer, intent(in) :: a``. Variables " "such as ``a`` are represented by a ``Name`` node, and are not connected " "to their declarations yet." msgstr "" #: ../src/ast_and_asr.ipynb:88 ../src/progress.md msgid "ASR" msgstr "" #: ../src/ast_and_asr.ipynb:139 msgid "" "The ASR has all the semantic information (types, etc.), nodes like " "``Function`` have a symbol table and do not have any declaration nodes. " "Variables are simply pointers to the symbol table." msgstr "" #: ../src/ast_and_asr.ipynb:142 msgid "Discussion" msgstr "" #: ../src/ast_and_asr.ipynb:144 msgid "" "The above was a simple example. Things get more apparent for more " "complicated examples, such as:" msgstr "" #: ../src/ast_and_asr.ipynb:160 msgid "" "AST must represent all the ``use`` statements and the ``interface`` " "block, and keep things semantically consistent." msgstr "" #: ../src/ast_and_asr.ipynb:162 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" " are defined in the ``gfort_interop`` module, and so ASR does not have " "any of these declaration nodes." msgstr "" #: ../src/ast_and_asr.ipynb:164 msgid "" "When converting from ASR to AST, LFortran will create all the appropriate" " AST declaration nodes automatically and correctly." msgstr "" #: ../src/contributing.md:1 msgid "Contributing" msgstr "" #: ../src/contributing.md:3 msgid "" "We welcome contributions from anyone, even if you are new to open source." " It might sound daunting to contribute to a compiler at first, but please" " do, it is not complicated. We will help you with any technical issues " "and help improve your contribution so that it can be merged." msgstr "" #: ../src/contributing.md:8 msgid "Basic Setup" msgstr "" #: ../src/contributing.md:10 msgid "To contribute, make sure your set up:" msgstr "" #: ../src/contributing.md:12 msgid "Your username + email" msgstr "" #: ../src/contributing.md:13 msgid "Your `~/.gitconfig`" msgstr "" #: ../src/contributing.md:14 msgid "Your shell prompt to display the current branch name" msgstr "" #: ../src/contributing.md:16 msgid "Fork LFortran" msgstr "" #: ../src/contributing.md:18 msgid "" "Step 1. Create a fork of the [project " "repository](https://github.com/lfortran/lfortran)" msgstr "" #: ../src/contributing.md:20 msgid "" "Step 2. Set up your [SSH key](https://docs.github.com/en/authentication" "/connecting-to-github-with-ssh) with GitHub" msgstr "" #: ../src/contributing.md:22 msgid "" "Step 3. Clone the project repository from GitHub and set up your remote " "repository" msgstr "" #: ../src/contributing.md:29 msgid "" ":fontawesome-solid-edit: `REMOTE_NAME` is the name of your remote " "repository and could be any name you like, for example your first name." msgstr "" #: ../src/contributing.md:31 msgid "" ":fontawesome-solid-edit: `YOUR_GITHUB_ID` is your user ID on GitHub and " "should be part of your account path." msgstr "" #: ../src/contributing.md:33 msgid "" "You can use `git remote -v` to check if the new remote is set up " "correctly." msgstr "" #: ../src/contributing.md:35 msgid "Send a New Merge Request" msgstr "" #: ../src/contributing.md:37 msgid "Step 1. Create a new branch" msgstr "" #: ../src/contributing.md:42 msgid "Step 2. Make changes in relevant file(s)" msgstr "" #: ../src/contributing.md:44 msgid "Step 3. Commit the changes:" msgstr "" #: ../src/contributing.md:51 msgid "" "[Here](https://chris.beams.io/posts/git-commit/) are some great tips on " "writing good commit messages." msgstr "" #: ../src/contributing.md:53 msgid "Step 4. Check to ensure that your changes look good" msgstr "" #: ../src/contributing.md:58 msgid "Step 5. Send the merge request" msgstr "" #: ../src/contributing.md:64 msgid "" "The command will push the new branch `fix1` into your remote repository " "`REMOTE_NAME` that you created earlier. Additionally, it will also " "display a link that you can click on to open the new merge request. After" " clicking on the link, write a title and a concise description then click" " the \"Create\" button. Yay you are now all set." msgstr "" #: ../src/contributing.md:66 msgid "Add New Features" msgstr "" #: ../src/contributing.md:68 msgid "" "The example below shows the steps it would take to create a caret binary " "operator **^** which computes the average value of the two operands." msgstr "" #: ../src/contributing.md:70 msgid "Create New Token(s)" msgstr "" #: ../src/contributing.md:72 msgid "" "We extend the *tokenizer.re* as well as *parser.yy* to add the new token " "**^**. We also tell LFortran how to print the new token in *parser.cpp*." msgstr "" #: ../src/contributing.md:75 msgid ":fontawesome-solid-code: *src/lfortran/parser/tokenizer.re*" msgstr "" #: ../src/contributing.md:80 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.yy*" msgstr "" #: ../src/contributing.md:85 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.cpp*" msgstr "" #: ../src/contributing.md:94 msgid "The added code is tested with `lfortran --show-tokens examples2/expr2.f90`" msgstr "" #: ../src/contributing.md:96 msgid "Parse the New Token" msgstr "" #: ../src/contributing.md:98 msgid "" "Now we have to parse the new operator. We add it to the AST by extending " "the BinOp with a caret operator and modifying the *AST.asdl* file. Then " "we add it in *parse.yy* to properly parse and generate the new AST in " "*semantics.h*.Finally we extend *pickle.cpp* so that the new operator can" " print itself." msgstr "" #: ../src/contributing.md:102 msgid ":fontawesome-solid-code:*grammar/AST.asdl*" msgstr "" #: ../src/contributing.md:107 msgid ":fontawesome-solid-code:*src/lfortran/parser/parser.yy*" msgstr "" #: ../src/contributing.md:116 msgid ":fontawesome-solid-code:*src/lfortran/parser/semantics.h*" msgstr "" #: ../src/contributing.md:121 msgid ":fontawesome-solid-code:*src/lfortran/pickle.cpp*" msgstr "" #: ../src/contributing.md:132 msgid "The section is tested with `lfortran --show-ast examples/expr2.f90`" msgstr "" #: ../src/contributing.md:134 msgid "Implement the Semantics of the New Token" msgstr "" #: ../src/contributing.md:136 msgid "" "We first extend the ASR in *ASR.asdl* and add ^ as a BinOp operator " "option." msgstr "" #: ../src/contributing.md:138 msgid ":fontawesome-solid-code:*src/libasr/ASR.asdl*" msgstr "" #: ../src/contributing.md:142 msgid ":fontawesome-solid-code:*src/lfortran/semantics/ast_common_visitor.h*" msgstr "" #: ../src/contributing.md:179 msgid "" "Then we transform it from AST to ASR by extending " "*src/lfortran/semantics/ast_common_visitor.h*." msgstr "" #: ../src/contributing.md:181 msgid "" "We also add it into compile time evaluation triggered by expressions such" " as `e = (2+3)^5` which is evaluated at compile time. An expression such " "as `e = x^5` is evaluated at run time only." msgstr "" #: ../src/contributing.md:183 msgid "The section is tested with `lfortran --show-asr examples/expr2.f90`" msgstr "" #: ../src/contributing.md:184 msgid "Implement the New Token in LLVM" msgstr "" #: ../src/contributing.md:186 msgid "" "To implement in LLVM, we extend the BinOp translation by handling the new" " operator. We first add the two numbers then divide by two. :fontawesome-" "solid-code:*src/lfortran/codegen/asr_to_llvm.cpp*" msgstr "" #: ../src/contributing.md:217 msgid "The section is tested with `lfortran --show-llvm examples/expr2.f90`" msgstr "" #: ../src/contributing.md:219 msgid "Now when LLVM works, we can test the final executable by:" msgstr "" #: ../src/contributing.md:224 msgid "And it should print 6." msgstr "" #: ../src/contributing.md:226 msgid "It also works interactively:" msgstr "" #: ../src/contributing.md:242 msgid "Reach Out" msgstr "" #: ../src/contributing.md:244 msgid "" "If you have any questions or need help, please ask as at our " "[mailinglist](https://groups.io/g/lfortran) or a " "[chat](https://lfortran.zulipchat.com/)." msgstr "" #: ../src/contributing.md:248 msgid "" "Please note that all participants of this project are expected to follow " "our Code of Conduct. By participating in this project you agree to abide " "by its terms. See " "[CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/blob/main/CODE_OF_CONDUCT.md)." msgstr "" #: ../src/contributing.md:252 msgid "" "By submitting a PR you agree to license your contribution under the " "LFortran's BSD " "[license](https://github.com/lfortran/lfortran/blob/main/LICENSE) unless " "explicitly noted otherwise." msgstr "" #: ../src/design.md:1 msgid "LFortran Design" msgstr "" #: ../src/design.md:3 msgid "High Level Overview" msgstr "" #: ../src/design.md:5 ../src/developer_tutorial.ipynb:16 msgid "" "LFortran is structured around two independent modules, AST and ASR, both " "of which are standalone (completely independent of the rest of LFortran) " "and users are encouraged to use them independently for other applications" " and build tools on top:" msgstr "" #: ../src/design.md:10 msgid "" "Abstract Syntax Tree (AST), module `lfortran.ast`: Represents any Fortran" " source code, strictly based on syntax, no semantic is included. The AST " "module can convert itself to Fortran source code." msgstr "" #: ../src/design.md:14 msgid "" "Abstract Semantic Representation (ASR), module `lfortran.asr`: Represents" " a valid Fortran source code, all semantic is included. Invalid Fortran " "code is not allowed (an error will be given). The ASR module can convert " "itself to an AST." msgstr "" #: ../src/design.md:19 msgid "" "The LFortran compiler is then composed of the following independent " "stages:" msgstr "" #: ../src/design.md:21 msgid "Parsing: converts Fortran source code to an AST" msgstr "" #: ../src/design.md:22 msgid "Semantic: converts an AST to an ASR" msgstr "" #: ../src/design.md:23 msgid "" "High level optimizations: optimize ASR to a possibly faster/simpler ASR " "(things like inlining functions, eliminating redundant expressions or " "statements, etc.)" msgstr "" #: ../src/design.md:26 msgid "" "LLVM IR code generation and lower level optimizations: converts an ASR to" " an LLVM IR. This stage also does all other optimizations that do not " "produce an ASR, but still make sense to do before passing to LLVM IR." msgstr "" #: ../src/design.md:29 msgid "" "Machine code generation: LLVM then does all its optimizations and " "generates machine code (such as a binary executable, a library, an object" " file, or it is loaded and executed using JIT as part of the interactive " "LFortran session or in a Jupyter kernel)." msgstr "" #: ../src/design.md:34 msgid "" "LFortran is structured as a library, and so one can for example use the " "parser to obtain an AST and do something with it, or one can then use the" " semantic analyzer to obtain ASR and do something with it. One can " "generate the ASR directly (e.g., from SymPy) and then either convert to " "AST and to a Fortran source code, or use LFortran to compile it to " "machine code directly. In other words, one can use LFortran to easily " "convert between the three equivalent representations:" msgstr "" #: ../src/design.md:42 msgid "Fortran source code" msgstr "" #: ../src/design.md:43 ../src/developer_tutorial.ipynb:23 msgid "Abstract Syntax Tree (AST)" msgstr "" #: ../src/design.md:44 ../src/developer_tutorial.ipynb:159 msgid "Abstract Semantic Representation (ASR)" msgstr "" #: ../src/design.md:46 msgid "They are all equivalent in the following sense:" msgstr "" #: ../src/design.md:48 msgid "Any ASR can always be converted to an equivalent AST" msgstr "" #: ../src/design.md:49 msgid "Any AST can always be converted to an equivalent Fortran source code" msgstr "" #: ../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 "" #: ../src/design.md:52 msgid "" "Any AST can always be either converted to an equivalent ASR or one gets a" " semantic error" msgstr "" #: ../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 "" #: ../src/design.md:58 msgid "ASR Design Details" msgstr "" #: ../src/design.md:60 msgid "The ASR is designed to have the following features:" msgstr "" #: ../src/design.md:62 msgid "" "ASR is still semantically equivalent to the original Fortran code (it did" " not lose any semantic information). ASR can be converted to AST, and AST" " to Fortran source code which is functionally equivalent to the original." msgstr "" #: ../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 "" #: ../src/design.md:69 msgid "" "The ASR C++ classes (down the road) are designed similarly to SymEngine: " "they are constructed once and after that they are immutable. The " "constructor checks in Debug more that all the requirements are met (e.g.," " that all Variables in a Function have a dummy argument set, that " "explicit-shape arrays are not allocatable and all other Fortran " "requirements to make it a valid code), but in Release mode it quickly " "constructs the class without checks. Then there are builder classes that " "construct the ASR C++ classes to meet requirements (checked in Debug " "mode) and the builder gives an error message if a code is not a valid " "Fortran code, and if it doesn't give an error message, then the ASR C++ " "classes are constructed correctly. Thus by construction, the ASR classes " "always contain valid Fortran code and the rest of LFortran can depend on " "it." msgstr "" #: ../src/design.md:82 msgid "Notes:" msgstr "ПримечаниÑ:" #: ../src/design.md:84 msgid "" "Information that is lost when parsing source to AST: whitespace, " "multiline/single line if statement distinction, case sensitivity of " "keywords." msgstr "" #: ../src/design.md:87 msgid "" "Information that is lost when going from AST to ASR: detailed syntax how " "variables were defined and the order of type attributes (whether array " "dimension is using the `dimension` attribute, or parentheses at the " "variable; or how many variables there are per declaration line or their " "order), as ASR only represents the aggregated type information in the " "symbol table." msgstr "" #: ../src/design.md:90 msgid "" "ASR is the simplest way to generate Fortran code, as one does not have to" " worry about the detailed syntax (as in AST) about how and where things " "are declared. One specifies the symbol table for a module, then for each " "symbol (functions, global variables, types, ...) one specifies the local " "variables and if this is an interface then one needs to specify where one" " can find an implementation, otherwise a body is supplied with " "statements, those nodes are almost the same as in AST, except that each " "variable is just a reference to a symbol in the symbol table (so by " "construction one cannot have undefined variables). The symbol table for " "each node such as Function or Module also references its parent (for " "example a function references a module, a module references the global " "scope)." msgstr "" #: ../src/design.md:102 msgid "" "The ASR can be directly converted to an AST without gathering any other " "information. And the AST directly to Fortran source code." msgstr "" #: ../src/design.md:105 msgid "" "The ASR is always representing a semantically valid Fortran code. This " "is enforced by checks in the ASR C++ constructors (in Debug build). When " "an ASR is used, one can assume it is valid." msgstr "" #: ../src/design.md:109 msgid "Fortran 2008" msgstr "" #: ../src/design.md:111 msgid "" "Fortran 2008 [standard](https://j3-fortran.org/doc/year/10/10-007.pdf) " "chapter 2 \"Fortran concepts\" specifies that Fortran code is a " "collection of _program units_ (either all in one file, or in separate " "files), where each _program unit_ is one of:" msgstr "" #: ../src/design.md:116 ../src/design.md:131 msgid "main program" msgstr "" #: ../src/design.md:117 ../src/design.md:132 msgid "module or submodule" msgstr "" #: ../src/design.md:118 ../src/design.md:133 msgid "function or subroutine" msgstr "" #: ../src/design.md:120 msgid "" "Note: It can also be a _block data_ program unit, that is used to provide" " initial values for data objects in named _common blocks_, but we do not " "recommend the use of _common blocks_ (use modules instead)." msgstr "" #: ../src/design.md:124 msgid "LFortran Extension" msgstr "" #: ../src/design.md:126 msgid "" "We extend the Fortran language by introducing a _global scope_, which is " "not only the list of _program units_ (as in F2008) but can also include " "statements, declarations, use statements and expressions. We define " "_global scope_ as a collection of the following items:" msgstr "" #: ../src/design.md:134 msgid "use statement" msgstr "" #: ../src/design.md:135 msgid "declaration" msgstr "" #: ../src/design.md:136 msgid "statement" msgstr "" #: ../src/design.md:137 msgid "expression" msgstr "" #: ../src/design.md:139 msgid "" "In addition, if a variable is not defined in an assignment statement " "(such as `x = 5+3`) then the type of the variable is inferred from the " "right hand side (e.g., `x` in `x = 5+3` would be of type `integer`, and " "`y` in `y = 5._dp` would be of type `real(dp)`). This rule only applies " "at the top level of _global scope_. Types must be fully specified inside " "main programs, modules, functions and subroutines, just like in F2008." msgstr "" #: ../src/design.md:146 msgid "" "The _global scope_ has its own symbol table. The main program and " "module/submodule do not see any symbols from this symbol table. But " "functions, subroutines, statements and expressions at the top level of " "_global scope_ use and operate on this symbol table." msgstr "" #: ../src/design.md:151 msgid "" "The _global scope_ has the following symbols predefined in the symbol " "table:" msgstr "" #: ../src/design.md:153 msgid "" "the usual standard set of Fortran functions (such as `size`, `sin`, " "`cos`, ...)" msgstr "" #: ../src/design.md:155 msgid "" "the `dp` double precision symbol, so that one can use `5._dp` for double " "precision." msgstr "" #: ../src/design.md:158 msgid "" "Each item in the _global scope_ is interpreted as follows: main program " "is compiled into an executable with the same name and executed; modules, " "functions and subroutines are compiled and loaded; use statement and " "declaration adds those symbols with the proper type into the _global " "scope_ symbol table, but do not generate any code; statement is wrapped " "into an anonymous subroutine with no arguments, compiled, loaded and " "executed; expression is wrapped into an anonymous function with no " "arguments returning the expression, compiled, loaded, executed and the " "return value is returned to the user." msgstr "" #: ../src/design.md:168 msgid "" "The _global scope_ is always interpreted, item by item, per the previous " "paragraph. It is meant to allow interactive usage, experimentations and " "writing simple scripts. Code in _global scope_ must be interpreted using " "`lfortran`. For more complex (production) code it is recommended to turn " "it into modules and programs (by wrapping loose statements into " "subroutines or functions and by adding type declarations) and compile it " "with `lfortran` or any other Fortran compiler." msgstr "" #: ../src/design.md:176 msgid "Here are some examples of valid code in _global scope_:" msgstr "" #: ../src/design.md:178 msgid "Example 1" msgstr "" #: ../src/design.md:185 msgid "Example 2" msgstr "" #: ../src/design.md:197 msgid "Example 3" msgstr "" #: ../src/design.md:209 msgid "Example 4" msgstr "" #: ../src/design.md:217 msgid "Design Considerations" msgstr "" #: ../src/design.md:219 msgid "" "The LFortran extension of Fortran was chosen in a way so as to minimize " "the number of changes. In particular, only the top level of the _global " "scope_ has relaxed some of the Fortran rules (such as making specifying " "types optional) so as to allow simple and quick interactive usage, but " "inside functions, subroutines, modules or programs this relaxation does " "not apply." msgstr "" #: ../src/design.md:225 msgid "" "The number of changes were kept to minimum in order to make it " "straightforward to turn code at _global scope_ into standard compliant " "Fortran code using programs and modules, so that it can be compiled by " "any Fortran compiler." msgstr "" #: ../src/developer_tutorial.ipynb:9 msgid "Developer Tutorial" msgstr "" #: ../src/developer_tutorial.ipynb:11 msgid "" "This is a tutorial for anybody who wants to either develop LFortran or " "build tools on top." msgstr "" #: ../src/developer_tutorial.ipynb:14 msgid "Introduction" msgstr "" #: ../src/developer_tutorial.ipynb:18 msgid "" "Abstract Syntax Tree (AST): Represents any Fortran source code, strictly " "based on syntax, no semantic is included. The AST module can convert " "itself to Fortran source code." msgstr "" #: ../src/developer_tutorial.ipynb:20 msgid "" "Abstract Semantic Representation (ASR): Represents a valid Fortran source" " code, all semantic is included. Invalid Fortran code is not allowed (an " "error will be given). The ASR module can convert itself to an AST." msgstr "" #: ../src/developer_tutorial.ipynb:25 msgid "" "Fortran source code can be parsed into an AST using the ``src_to_ast()`` " "function:" msgstr "" #: ../src/developer_tutorial.ipynb:49 #, python-format msgid "We can pretty print it using the ``%%showast`` magic:" msgstr "" #: ../src/developer_tutorial.ipynb:98 #, python-format msgid "We can convert AST to Fortran source code using ``%%showfmt``:" msgstr "" #: ../src/developer_tutorial.ipynb:156 msgid "" "All AST nodes and their arguments are described in `AST.asdl " "`__." msgstr "" #: ../src/developer_tutorial.ipynb:170 #, python-format msgid "We can pretty print using the ``%%showasr`` magic:" msgstr "" #: ../src/developer_tutorial.ipynb:219 msgid "" "All ASR nodes and their arguments are described in `ASR.asdl " "`__." msgstr "" #: ../src/index.md:134 msgid "Getting started" msgstr "Первые шаги" #: ../src/index.md:141 ../src/progress.md:1 msgid "LFortran Development Status" msgstr "" #: ../src/index.md:147 msgid "Developer's Guide" msgstr "" #: ../src/index.md:156 msgid "LFortran Intrinsics" msgstr "" #: ../src/index.md:1 msgid "LFortran Documentation" msgstr "" #: ../src/index.md:3 msgid "" "LFortran is a modern open-source (BSD licensed) interactive Fortran " "compiler built on top of LLVM. It can execute user's code interactively " "to allow exploratory work (much like Python, MATLAB or Julia) as well as " "compile to binaries with the goal to run user's code on modern " "architectures such as multi-core CPUs and GPUs." msgstr "" #: ../src/index.md:9 #, python-format msgid "" "Website: [https://lfortran.org/](https://lfortran.org/) Main " "repository: " "[https://github.com/lfortran/lfortran](https://github.com/lfortran/lfortran)" " Try online using Binder: " "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb)" msgstr "" #: ../src/index.md:9 msgid "Binder" msgstr "" #: ../src/index.md:16 msgid "Feature Highlights" msgstr "" #: ../src/index.md:18 msgid "" "LFortran is in development, there are features that work today, and there" " are features that are being implemented. You can also check out the " "[Development Status](progress.md) section for more information on " "features being supported and being worked on." msgstr "" #: ../src/index.md:21 msgid "Works today" msgstr "" #: ../src/index.md:23 #, python-format msgid "" "**Interactive, Jupyter support** LFortran can be used from Jupyter as a" " Fortran kernel, allowing a Python/Julia style rapid prototyping and " "exploratory workflow (see the " "[static](https://nbviewer.jupyter.org/gist/certik/f1d28a486510810d824869ab0c491b1c)" " or [interactive](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb) example notebook). Or " "it can be used from the command-line in an interactive prompt (REPL)." msgstr "" #: ../src/index.md:32 msgid "" "**Clean, modular design, usable as a library** LFortran is structured " "around two independent modules, AST and ASR, both of which are " "standalone (completely independent of the rest of LFortran) and users " "are encouraged to use them independently for other applications and " "build tools on top. See the [Design](design.md) and [Developer " "Tutorial](developer_tutorial.md) documents for more details." msgstr "" #: ../src/index.md:39 msgid "" "**Interoperation with GFortran** LFortran can parse GFortran module " "files into an ASR and generate a Fortran wrapper that can be compiled " "with any Fortran compiler and linked with the original GFortran " "compiled module." msgstr "" #: ../src/index.md:44 msgid "" "**Create executables** It can create executables just like other " "Fortran compilers." msgstr "" #: ../src/index.md:47 msgid "" "**Runs on Linux, Mac and Windows** All three platforms are regularly " "tested by our CI." msgstr "" #: ../src/index.md:51 msgid "Planned" msgstr "" #: ../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 "" #: ../src/index.md:56 msgid "" "**Native interoperation with other languages (and other Fortran " "compilers)** It can automatically call code written in other languages " "(such as C or Python) just by using the `use` statement, see " "[#44](https://gitlab.com/lfortran/lfortran/issues/44). It understands " "other Fortran compilers module files (one can just \"use\" them) and " "their ABI to link correctly (GFortran is supported, other compilers are" " planned, see [#56](https://gitlab.com/lfortran/lfortran/issues/56)), " "which allows to use LFortran with production codes today." msgstr "" #: ../src/index.md:65 msgid "" "**Modern hardware support** Thanks to LLVM, the goal of LFortran is to " "run on modern hardware and take advantage of native Fortran language " "constructs (such as `do concurrent`) to run on multi-core CPUs and " "GPUs, see [#57](https://gitlab.com/lfortran/lfortran/issues/57)." msgstr "" #: ../src/index.md:71 msgid "" "**Full Fortran 2018 support** Currently only a subset of Fortran is " "implemented, but the goal is to have a full implementation of the " "latest Fortran 2018 standard, see " "[#58](https://gitlab.com/lfortran/lfortran/issues/58)." msgstr "" #: ../src/index.md:77 msgid "" "Please vote on issues in our [issue " "tracker](https://gitlab.com/lfortran/lfortran/issues) that you want us to" " prioritize (feel free to create new ones if we are missing anything)." msgstr "" #: ../src/index.md:81 msgid "Roadmap" msgstr "" #: ../src/index.md:83 msgid "Here is our roadmap how to get all the planned features above implemented:" msgstr "" #: ../src/index.md:85 msgid "" "Port code generation to use ASR and pass all the current tests " "([#74](https://gitlab.com/lfortran/lfortran/issues/74)). Remove the old " "code generation and old semantics, that used to annotate the AST tree, " "which was messy." msgstr "" #: ../src/index.md:89 msgid "" "Get GFortran module files working with `use` module, both assumed-size " "and assumed-shape arrays " "([#52](https://gitlab.com/lfortran/lfortran/issues/52)). This will allow " "right away to use production codes with LFortran." msgstr "" #: ../src/index.md:93 msgid "Do these at the same time:" msgstr "" #: ../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 "" #: ../src/index.md:98 msgid "" "b) Gradually move to C++ for robustness and speed " "([#70](https://gitlab.com/lfortran/lfortran/issues/70)). The Python API " "will not change (or only minimally), so the user experience from Python " "will not change." msgstr "" #: ../src/index.md:103 msgid "" "c) Implement all the other cool features: `use` module for C and Python " "and automatic wrappers " "([#44](https://gitlab.com/lfortran/lfortran/issues/44)), modern hardware" " support ([#57](https://gitlab.com/lfortran/lfortran/issues/57)), " "generating an older standard of Fortran " "([#72](https://gitlab.com/lfortran/lfortran/issues/72)), Fortran doctest" " feature ([#73](https://gitlab.com/lfortran/lfortran/issues/73)), SymPy" " integration ([#71](https://gitlab.com/lfortran/lfortran/issues/71)), " "language service for IDEs " "([#12](https://gitlab.com/lfortran/lfortran/issues/12)), and other ideas" " ([#29](https://gitlab.com/lfortran/lfortran/issues/29))." msgstr "" #: ../src/index.md:118 msgid "The step 1. is an internal refactoring that will not take long." msgstr "" #: ../src/index.md:120 msgid "" "The step 2. will allow LFortran to be used interactively with production " "codes right away (the production code will get compiled with GFortran, " "then one \"uses\" any module in LFortran and functions/subroutines can be" " interactively called, the module itself can use any GFortran supported " "feature, but the API must fit into the subset that LFortran understands " "--- for large number of applications simple functions/subroutines with " "array arguments are enough). This will make LFortran usable for first " "users and one can always use GFortran temporarily until LFortran supports" " the given feature. We expect to be finished with the step 2. by the end " "of summer 2019, hopefully sooner." msgstr "" #: ../src/index.md:130 msgid "" "Finally the step 3. will improve LFortran overall, allowing the first " "users to contribute back, growing the community and making LFortran " "gradually useful for more and more people." msgstr "" #: ../src/installation.md:1 msgid "Installation" msgstr "" #: ../src/installation.md:3 msgid "All the instructions below work on Linux, macOS and Windows." msgstr "" #: ../src/installation.md:5 msgid "Binaries" msgstr "Готовые бинарные Ñборки" #: ../src/installation.md:7 msgid "" "The recommended way to install LFortran is using Conda. Install Conda for" " example by installing the " "[Miniconda](https://conda.io/en/latest/miniconda.html) installation by " "following instructions there for your platform. Then create a new " "environment (you can choose any name, here we chose `lf`) and activate " "it:" msgstr "" #: ../src/installation.md:16 msgid "Then install LFortran by:" msgstr "" #: ../src/installation.md:20 msgid "" "Now the `lf` environment has the `lfortran` compiler available, you can " "start the interactive prompt by executing `lfortran`, or see the command " "line options using `lfortran -h`." msgstr "" #: ../src/installation.md:24 msgid "" "The Jupyter kernel is automatically installed by the above command, so " "after installing Jupyter itself:" msgstr "" #: ../src/installation.md:28 msgid "You can create a Fortran based Jupyter notebook by executing:" msgstr "" #: ../src/installation.md:32 msgid "and selecting `New->Fortran`." msgstr "" #: ../src/installation.md:35 msgid "Build From a Source Tarball" msgstr "" #: ../src/installation.md:37 msgid "" "This method is the recommended method if you just want to install " "LFortran, either yourself or in a package manager (Spack, Conda, Debian, " "etc.). The source tarball has all the generated files included and has " "minimal dependencies." msgstr "" #: ../src/installation.md:39 msgid "First we have to install dependencies, for example using Conda:" msgstr "" #: ../src/installation.md:44 msgid "" "Then download a tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), e.g.:" msgstr "" #: ../src/installation.md:52 msgid "And build:" msgstr "" #: ../src/installation.md:58 msgid "This will install the `lfortran` into the `inst/bin`." msgstr "" #: ../src/installation.md:60 msgid "Build From Git" msgstr "" #: ../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 "" #: ../src/installation.md:65 msgid "" "If you do not have Conda installed, you can do so on Linux (and similarly" " on other platforms):" msgstr "" #: ../src/installation.md:72 msgid "Then prepare the environment:" msgstr "" #: ../src/installation.md:77 msgid "Clone the LFortran git repository:" msgstr "" #: ../src/installation.md:82 msgid "" "Generate files that are needed for the build (this step depends on " "`re2c`, `bison` and `python`):" msgstr "" #: ../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 "" #: ../src/installation.md:92 msgid "Run tests:" msgstr "" #: ../src/installation.md:97 msgid "Run an interactive prompt:" msgstr "" #: ../src/installation.md:102 msgid "Build from Git on Windows with Visual Studio" msgstr "" #: ../src/installation.md:104 msgid "" "Install Visual Studio (MSVC), for example the version 2022, you can " "download the Community version for free from: " "https://visualstudio.microsoft.com/downloads/." msgstr "" #: ../src/installation.md:107 msgid "" "Install miniforge using the Windows installer from https://github.com" "/conda-forge/miniforge." msgstr "" #: ../src/installation.md:109 msgid "Launch the Miniforge Prompt from the Desktop." msgstr "" #: ../src/installation.md:111 msgid "In the shell, initialize the MSVC compiler using:" msgstr "" #: ../src/installation.md:117 msgid "You can optionally test that MSVC works by:" msgstr "" #: ../src/installation.md:122 msgid "Both commands must print help (several pages)." msgstr "" #: ../src/installation.md:124 msgid "Now you can download and build LFortran:" msgstr "" #: ../src/installation.md:134 msgid "If everything compiled, then you can use LFortran as follows:" msgstr "" #: ../src/installation.md:140 msgid "And so on." msgstr "" #: ../src/installation.md:142 msgid "" "Note: LFortran currently uses the MSVC's linker program (`link`), which " "is only available when the MSVC bat script above is ran. If you forget to" " activate it, LFortran's linking will fail." msgstr "" #: ../src/installation.md:146 msgid "" "Note: the miniforge shell seems to be running some version of `git-bash` " "(although it is `cmd.exe`), which has some unix-like filesystem mounted " "in `/usr` and several commands available such as `ls`, `which`, `git`, " "`vim`. For this reason the Conda build `environment_win.yml` contains " "everything needed, including `git`." msgstr "" #: ../src/installation.md:152 msgid "Build from Git on Windows with WSL" msgstr "" #: ../src/installation.md:153 msgid "In windows search \"turn windows features on or off\"." msgstr "" #: ../src/installation.md:154 msgid "Tick Windows subsystem for Linux." msgstr "" #: ../src/installation.md:155 msgid "Press OK and restart computer." msgstr "" #: ../src/installation.md:156 msgid "Go to Microsoft store and download Ubuntu 20.04, and launch it." msgstr "" #: ../src/installation.md:157 msgid "Run the following commands." msgstr "" #: ../src/installation.md:164 msgid "Now do the following to configure the path" msgstr "" #: ../src/installation.md:168 msgid "Then go to the bottom of the file and paste the following" msgstr "" #: ../src/installation.md:172 msgid "Then press ctrl + O (save), Enter (confirm), ctrl + X (exit)" msgstr "" #: ../src/installation.md:173 msgid "After that restart Ubuntu" msgstr "" #: ../src/installation.md:174 msgid "Run the following" msgstr "" #: ../src/installation.md:179 msgid "Restart Ubuntu again" msgstr "" #: ../src/installation.md:187 msgid "" "You can change the directory to a Windows location using `cd /mnt/[drive " "letter]/[windows location]`." msgstr "" #: ../src/installation.md:188 msgid "e.g. `cd mnt/c/Users/name/source/repos/`" msgstr "" #: ../src/installation.md:190 msgid "Now clone the LFortran git repository" msgstr "" #: ../src/installation.md:196 msgid "Run the following commands" msgstr "" #: ../src/installation.md:204 msgid "If everything compiles, you can use LFortran as follows" msgstr "" #: ../src/installation.md:210 msgid "Run an interactive prompt" msgstr "" #: ../src/installation.md:215 msgid "Run tests" msgstr "" #: ../src/installation.md:221 msgid "Enabling the Jupyter Kernel" msgstr "" #: ../src/installation.md:223 msgid "To install the Jupyter kernel, install the following Conda packages also:" msgstr "" #: ../src/installation.md:227 msgid "" "and enable the kernel by `-DWITH_XEUS=yes` and install into " "`$CONDA_PREFIX`. For example:" msgstr "" #: ../src/installation.md:239 msgid "" "To use it, install Jupyter (`conda install jupyter`) and test that the " "LFortran kernel was found:" msgstr "" #: ../src/installation.md:244 msgid "Then launch a Jupyter notebook as follows:" msgstr "" #: ../src/installation.md:248 msgid "Click `New->Fortran`. To launch a terminal jupyter LFortran console:" msgstr "" #: ../src/installation.md:254 msgid "Build From Git with Nix" msgstr "" #: ../src/installation.md:256 msgid "" "One of the ways to ensure exact environment and dependencies is with " "`nix`. This will ensure that system dependencies do not interfere with " "the development environment. If you want, you can report bugs in a `nix-" "shell` environment to make it easier for others to reproduce." msgstr "" #: ../src/installation.md:258 msgid "With Root" msgstr "" #: ../src/installation.md:260 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 "" #: ../src/installation.md:264 msgid "Without Root" msgstr "" #: ../src/installation.md:266 msgid "" "If you would like to not provide `nix` with root access to your machine, " "on Linux distributions we can use [nix-" "portable](https://github.com/DavHau/nix-portable)." msgstr "" #: ../src/installation.md:270 msgid "" "Now just prepend all `nix-shell` commands with `NP_RUNTIME=bwrap ./nix-" "portable `. So:" msgstr "" #: ../src/installation.md:278 msgid "Development" msgstr "" #: ../src/installation.md:280 msgid "Now we can enter the development environment:" msgstr "" #: ../src/installation.md:284 msgid "" "The `--pure` flag ensures no system dependencies are used in the " "environment." msgstr "" #: ../src/installation.md:286 msgid "The build steps are the same as with the `ci`:" msgstr "" #: ../src/installation.md:292 msgid "" "To change the compilation environment from `gcc` (default) to `clang` we " "can use `--argstr`:" msgstr "" #: ../src/installation.md:297 msgid "Note About Dependencies" msgstr "" #: ../src/installation.md:299 msgid "" "End users (and distributions) are encouraged to use the tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), which " "only depends on LLVM, CMake and a C++ compiler." msgstr "" #: ../src/installation.md:303 msgid "" "The tarball is generated automatically by our CI (continuous integration)" " and contains some autogenerated files: the parser, the AST and ASR " "nodes, which is generated by an ASDL translator (requires Python)." msgstr "" #: ../src/installation.md:307 msgid "The instructions from git are to be used when developing LFortran itself." msgstr "" #: ../src/installation.md:309 msgid "Note for users who do not use Conda" msgstr "" #: ../src/installation.md:311 msgid "" "Following are the dependencies necessary for installing this repository " "in development mode," msgstr "" #: ../src/installation.md:314 msgid "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" msgstr "" #: ../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 "" #: ../src/installation.md:316 msgid "[re2c - 2.0.3](https://re2c.org/install/install.html)" msgstr "" #: ../src/installation.md:317 msgid "" "[binutils - " "2.31.90](ftp://sourceware.org/pub/binutils/snapshots/binutils-2.31.90.tar.xz)" " - Make sure that you should enable the required options related to this " "dependency to build the dynamic libraries (the ones ending with `.so`)." msgstr "" #: ../src/installation.md:319 msgid "Stacktraces" msgstr "" #: ../src/installation.md:321 msgid "" "LFortran can print stacktraces when there is an unhandled exception, as " "well as on any compiler error with the `--show-stacktrace` option. This " "is very helpful for developing the compiler itself to see where in " "LFortran the problem is. The stacktrace support is turned off by default," " to enable it, compile LFortran with the `-DWITH_STACKTRACE=yes` cmake " "option after installing the prerequisites on each platform per the " "instructions below." msgstr "" #: ../src/installation.md:328 msgid "Ubuntu" msgstr "" #: ../src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." msgstr "" #: ../src/installation.md:332 msgid "macOS" msgstr "" #: ../src/installation.md:334 msgid "" "If you use the default Clang compiler on macOS, then the stacktraces " "should just work on both Intel and M1 based macOS (the CMake build system" " automatically invokes the `dsymtuil` tool and our Python scripts to " "store the debug information, see `src/bin/CMakeLists.txt` for more " "details). If it does not work, please report a bug." msgstr "" #: ../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 "" #: ../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 "" #: ../src/installation.md:352 msgid "" "and compile LFortran with the " "`-DCMAKE_PREFIX_PATH=\"$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX\"` cmake" " option. The `$CONDA_PREFIX` is there if you install some other " "dependencies (such as `llvm`) using Conda, otherwise you can remove it." msgstr "" #: ../src/intrinsics/array.md:1 msgid "Array Intrinsic Functions" msgstr "" #: ../src/intrinsics/array/allocated.md:1 msgid "allocated(x): Status Check" msgstr "" #: ../src/intrinsics/array/allocated.md:3 msgid "Logical status of an allocatable integer." msgstr "" #: ../src/intrinsics/array/allocated.md:5 ../src/intrinsics/array/cshift.md:5 #: ../src/intrinsics/array/size.md:5 ../src/intrinsics/bit/bge.md:5 #: ../src/intrinsics/bit/bgt.md:5 ../src/intrinsics/bit/bit_size.md:5 #: ../src/intrinsics/bit/ble.md:5 ../src/intrinsics/bit/blt.md:5 #: ../src/intrinsics/bit/btest.md:5 ../src/intrinsics/bit/shiftl.md:5 #: ../src/intrinsics/bit/shiftr.md:5 ../src/intrinsics/character/achar.md:5 #: ../src/intrinsics/character/adjustl.md:5 #: ../src/intrinsics/character/adjustr.md:5 #: ../src/intrinsics/character/char.md:5 #: ../src/intrinsics/character/len_trim.md:5 #: ../src/intrinsics/character/lge.md:5 ../src/intrinsics/kind-type/kind.md:5 #: ../src/intrinsics/mathematical/acos.md:5 #: ../src/intrinsics/mathematical/acosh.md:5 #: ../src/intrinsics/mathematical/asin.md:5 #: ../src/intrinsics/mathematical/asinh.md:5 #: ../src/intrinsics/mathematical/atan.md:5 #: ../src/intrinsics/mathematical/atan2.md:5 #: ../src/intrinsics/mathematical/atanh.md:5 #: ../src/intrinsics/mathematical/fraction.md:5 #: ../src/intrinsics/misc/command_argument_count.md:5 #: ../src/intrinsics/misc/cpu_time.md:5 #: ../src/intrinsics/misc/date_and_time.md:5 #: ../src/intrinsics/misc/new_line.md:5 ../src/intrinsics/numeric/abs.md:5 #: ../src/intrinsics/numeric/aimag.md:5 ../src/intrinsics/numeric/aint.md:5 #: ../src/intrinsics/numeric/anint.md:5 ../src/intrinsics/numeric/ceiling.md:5 #: ../src/intrinsics/numeric/cmplx.md:5 ../src/intrinsics/numeric/conjg.md:5 #: ../src/intrinsics/numeric/digits.md:5 ../src/intrinsics/numeric/dim.md:5 #: ../src/intrinsics/numeric/epsilon.md:5 ../src/intrinsics/numeric/erf.md:5 #: ../src/intrinsics/numeric/erfc.md:5 ../src/intrinsics/numeric/exp.md:5 #: ../src/intrinsics/numeric/floor.md:5 ../src/intrinsics/numeric/gamma.md:5 #: ../src/intrinsics/numeric/mod.md:5 msgid "Declaration" msgstr "" #: ../src/intrinsics/array/allocated.md:7 ../src/intrinsics/array/cshift.md:7 #: ../src/intrinsics/array/size.md:7 ../src/intrinsics/bit/bge.md:7 #: ../src/intrinsics/bit/bgt.md:7 ../src/intrinsics/bit/bit_size.md:7 #: ../src/intrinsics/bit/ble.md:7 ../src/intrinsics/bit/blt.md:7 #: ../src/intrinsics/bit/btest.md:7 ../src/intrinsics/bit/shiftl.md:7 #: ../src/intrinsics/bit/shiftr.md:7 ../src/intrinsics/character/achar.md:7 #: ../src/intrinsics/character/adjustl.md:7 #: ../src/intrinsics/character/adjustr.md:7 #: ../src/intrinsics/character/char.md:7 #: ../src/intrinsics/character/len_trim.md:7 #: ../src/intrinsics/character/lge.md:8 ../src/intrinsics/kind-type/kind.md:7 #: ../src/intrinsics/mathematical/acos.md:7 #: ../src/intrinsics/mathematical/acosh.md:7 #: ../src/intrinsics/mathematical/asin.md:7 #: ../src/intrinsics/mathematical/asinh.md:7 #: ../src/intrinsics/mathematical/atan.md:7 #: ../src/intrinsics/mathematical/atan2.md:7 #: ../src/intrinsics/mathematical/atanh.md:7 #: ../src/intrinsics/mathematical/fraction.md:7 #: ../src/intrinsics/misc/command_argument_count.md:7 #: ../src/intrinsics/misc/cpu_time.md:7 #: ../src/intrinsics/misc/date_and_time.md:7 #: ../src/intrinsics/misc/new_line.md:7 ../src/intrinsics/numeric/abs.md:7 #: ../src/intrinsics/numeric/aimag.md:7 ../src/intrinsics/numeric/aint.md:7 #: ../src/intrinsics/numeric/anint.md:7 ../src/intrinsics/numeric/ceiling.md:7 #: ../src/intrinsics/numeric/cmplx.md:7 ../src/intrinsics/numeric/conjg.md:7 #: ../src/intrinsics/numeric/digits.md:7 ../src/intrinsics/numeric/dim.md:7 #: ../src/intrinsics/numeric/epsilon.md:7 ../src/intrinsics/numeric/erf.md:7 #: ../src/intrinsics/numeric/erfc.md:7 ../src/intrinsics/numeric/exp.md:7 #: ../src/intrinsics/numeric/floor.md:7 ../src/intrinsics/numeric/gamma.md:7 #: ../src/intrinsics/numeric/mod.md:7 msgid "Syntax" msgstr "" #: ../src/intrinsics/array/allocated.md:14 ../src/intrinsics/array/cshift.md:14 #: ../src/intrinsics/array/size.md:14 ../src/intrinsics/bit/bge.md:14 #: ../src/intrinsics/bit/bgt.md:14 ../src/intrinsics/bit/bit_size.md:14 #: ../src/intrinsics/bit/ble.md:14 ../src/intrinsics/bit/blt.md:14 #: ../src/intrinsics/bit/btest.md:14 ../src/intrinsics/bit/shiftl.md:14 #: ../src/intrinsics/bit/shiftr.md:14 ../src/intrinsics/character/achar.md:14 #: ../src/intrinsics/character/adjustl.md:14 #: ../src/intrinsics/character/adjustr.md:14 #: ../src/intrinsics/character/char.md:14 #: ../src/intrinsics/character/len_trim.md:14 #: ../src/intrinsics/character/lge.md:15 ../src/intrinsics/kind-type/kind.md:14 #: ../src/intrinsics/mathematical/acos.md:14 #: ../src/intrinsics/mathematical/acosh.md:14 #: ../src/intrinsics/mathematical/asin.md:14 #: ../src/intrinsics/mathematical/asinh.md:14 #: ../src/intrinsics/mathematical/atan.md:14 #: ../src/intrinsics/mathematical/atan2.md:13 #: ../src/intrinsics/mathematical/atanh.md:14 #: ../src/intrinsics/mathematical/fraction.md:13 #: ../src/intrinsics/misc/command_argument_count.md:14 #: ../src/intrinsics/misc/cpu_time.md:14 #: ../src/intrinsics/misc/date_and_time.md:14 #: ../src/intrinsics/misc/new_line.md:14 ../src/intrinsics/numeric/abs.md:15 #: ../src/intrinsics/numeric/aimag.md:15 ../src/intrinsics/numeric/aint.md:14 #: ../src/intrinsics/numeric/anint.md:14 #: ../src/intrinsics/numeric/ceiling.md:14 #: ../src/intrinsics/numeric/cmplx.md:16 ../src/intrinsics/numeric/conjg.md:15 #: ../src/intrinsics/numeric/digits.md:13 ../src/intrinsics/numeric/dim.md:13 #: ../src/intrinsics/numeric/epsilon.md:14 ../src/intrinsics/numeric/erf.md:14 #: ../src/intrinsics/numeric/erfc.md:14 ../src/intrinsics/numeric/exp.md:14 #: ../src/intrinsics/numeric/floor.md:14 ../src/intrinsics/numeric/gamma.md:14 #: ../src/intrinsics/numeric/mod.md:15 msgid "Arguments" msgstr "" #: ../src/intrinsics/array/allocated.md:16 msgid "`x` is an integer input parameter." msgstr "" #: ../src/intrinsics/array/allocated.md:18 ../src/intrinsics/array/cshift.md:22 #: ../src/intrinsics/array/size.md:22 ../src/intrinsics/bit/bge.md:18 #: ../src/intrinsics/bit/bgt.md:18 ../src/intrinsics/bit/bit_size.md:18 #: ../src/intrinsics/bit/ble.md:18 ../src/intrinsics/bit/blt.md:18 #: ../src/intrinsics/bit/btest.md:19 ../src/intrinsics/bit/shiftl.md:21 #: ../src/intrinsics/bit/shiftr.md:21 ../src/intrinsics/character/lge.md:23 #: ../src/intrinsics/kind-type/kind.md:19 #: ../src/intrinsics/mathematical/acos.md:18 #: ../src/intrinsics/mathematical/acosh.md:19 #: ../src/intrinsics/mathematical/asin.md:18 #: ../src/intrinsics/mathematical/asinh.md:19 #: ../src/intrinsics/mathematical/atan.md:18 #: ../src/intrinsics/mathematical/atan2.md:21 #: ../src/intrinsics/mathematical/atanh.md:19 #: ../src/intrinsics/mathematical/fraction.md:17 #: ../src/intrinsics/misc/command_argument_count.md:18 #: ../src/intrinsics/misc/cpu_time.md:18 #: ../src/intrinsics/misc/date_and_time.md:39 #: ../src/intrinsics/misc/new_line.md:19 ../src/intrinsics/numeric/abs.md:19 #: ../src/intrinsics/numeric/aimag.md:19 ../src/intrinsics/numeric/aint.md:20 #: ../src/intrinsics/numeric/anint.md:20 #: ../src/intrinsics/numeric/ceiling.md:18 #: ../src/intrinsics/numeric/cmplx.md:24 ../src/intrinsics/numeric/conjg.md:19 #: ../src/intrinsics/numeric/digits.md:17 ../src/intrinsics/numeric/dim.md:18 #: ../src/intrinsics/numeric/epsilon.md:18 ../src/intrinsics/numeric/erf.md:18 #: ../src/intrinsics/numeric/erfc.md:18 ../src/intrinsics/numeric/exp.md:18 #: ../src/intrinsics/numeric/floor.md:20 ../src/intrinsics/numeric/gamma.md:19 #: ../src/intrinsics/numeric/mod.md:22 msgid "Return values" msgstr "" #: ../src/intrinsics/array/allocated.md:20 msgid "" "The return value is a logical scalar with the default logical kind type " "parameter." msgstr "" #: ../src/intrinsics/array/allocated.md:23 ../src/intrinsics/array/cshift.md:26 #: ../src/intrinsics/array/size.md:26 ../src/intrinsics/bit/bge.md:22 #: ../src/intrinsics/bit/bgt.md:22 ../src/intrinsics/bit/bit_size.md:22 #: ../src/intrinsics/bit/ble.md:22 ../src/intrinsics/bit/blt.md:22 #: ../src/intrinsics/bit/btest.md:23 ../src/intrinsics/bit/shiftl.md:25 #: ../src/intrinsics/bit/shiftr.md:25 ../src/intrinsics/character/achar.md:27 #: ../src/intrinsics/character/adjustl.md:23 #: ../src/intrinsics/character/adjustr.md:24 #: ../src/intrinsics/character/char.md:28 #: ../src/intrinsics/character/len_trim.md:22 #: ../src/intrinsics/character/lge.md:31 ../src/intrinsics/kind-type/kind.md:23 #: ../src/intrinsics/mathematical/acos.md:23 #: ../src/intrinsics/mathematical/acosh.md:24 #: ../src/intrinsics/mathematical/asin.md:23 #: ../src/intrinsics/mathematical/asinh.md:24 #: ../src/intrinsics/mathematical/atan.md:23 #: ../src/intrinsics/mathematical/atan2.md:27 #: ../src/intrinsics/mathematical/atanh.md:24 #: ../src/intrinsics/mathematical/fraction.md:22 #: ../src/intrinsics/misc/command_argument_count.md:22 #: ../src/intrinsics/misc/cpu_time.md:22 #: ../src/intrinsics/misc/date_and_time.md:43 #: ../src/intrinsics/misc/new_line.md:24 ../src/intrinsics/numeric/abs.md:24 #: ../src/intrinsics/numeric/aimag.md:23 ../src/intrinsics/numeric/aint.md:28 #: ../src/intrinsics/numeric/anint.md:27 #: ../src/intrinsics/numeric/ceiling.md:22 #: ../src/intrinsics/numeric/cmplx.md:30 ../src/intrinsics/numeric/conjg.md:23 #: ../src/intrinsics/numeric/digits.md:21 ../src/intrinsics/numeric/dim.md:22 #: ../src/intrinsics/numeric/epsilon.md:22 ../src/intrinsics/numeric/erf.md:23 #: ../src/intrinsics/numeric/erfc.md:23 ../src/intrinsics/numeric/exp.md:22 #: ../src/intrinsics/numeric/floor.md:28 ../src/intrinsics/numeric/gamma.md:23 #: ../src/intrinsics/numeric/mod.md:31 ../src/progress.md msgid "Description" msgstr "ОпиÑание" #: ../src/intrinsics/array/allocated.md:25 msgid "" "`allocated(x)` checks the allocation status of a integer input parameter." " It returns a logical value as `TRUE` if the input argument `x` is " "allocated, `FALSE` otherwise." msgstr "" #: ../src/intrinsics/array/allocated.md:29 ../src/intrinsics/array/cshift.md:39 #: ../src/intrinsics/array/size.md:33 ../src/intrinsics/bit/bge.md:27 #: ../src/intrinsics/bit/bgt.md:27 ../src/intrinsics/bit/bit_size.md:27 #: ../src/intrinsics/bit/ble.md:27 ../src/intrinsics/bit/blt.md:27 #: ../src/intrinsics/bit/btest.md:32 ../src/intrinsics/bit/shiftl.md:32 #: ../src/intrinsics/bit/shiftr.md:32 ../src/intrinsics/character/achar.md:37 #: ../src/intrinsics/character/adjustl.md:28 #: ../src/intrinsics/character/adjustr.md:29 #: ../src/intrinsics/character/char.md:38 #: ../src/intrinsics/character/len_trim.md:27 #: ../src/intrinsics/character/lge.md:37 ../src/intrinsics/kind-type/kind.md:27 #: ../src/intrinsics/mathematical/acos.md:31 #: ../src/intrinsics/mathematical/acosh.md:43 #: ../src/intrinsics/mathematical/asin.md:31 #: ../src/intrinsics/mathematical/asinh.md:35 #: ../src/intrinsics/mathematical/atan.md:31 #: ../src/intrinsics/mathematical/atan2.md:53 #: ../src/intrinsics/mathematical/atanh.md:39 #: ../src/intrinsics/mathematical/fraction.md:30 #: ../src/intrinsics/misc/command_argument_count.md:27 #: ../src/intrinsics/misc/cpu_time.md:33 #: ../src/intrinsics/misc/date_and_time.md:53 #: ../src/intrinsics/misc/new_line.md:29 ../src/intrinsics/numeric/abs.md:35 #: ../src/intrinsics/numeric/aimag.md:33 ../src/intrinsics/numeric/aint.md:35 #: ../src/intrinsics/numeric/anint.md:38 #: ../src/intrinsics/numeric/ceiling.md:26 #: ../src/intrinsics/numeric/cmplx.md:47 ../src/intrinsics/numeric/conjg.md:33 #: ../src/intrinsics/numeric/digits.md:26 ../src/intrinsics/numeric/dim.md:27 #: ../src/intrinsics/numeric/epsilon.md:29 ../src/intrinsics/numeric/erf.md:33 #: ../src/intrinsics/numeric/erfc.md:36 ../src/intrinsics/numeric/exp.md:29 #: ../src/intrinsics/numeric/floor.md:33 ../src/intrinsics/numeric/gamma.md:38 #: ../src/intrinsics/numeric/mod.md:43 msgid "Types" msgstr "" #: ../src/intrinsics/array/allocated.md:31 ../src/intrinsics/array/size.md:35 #: ../src/intrinsics/character/achar.md:39 #: ../src/intrinsics/character/char.md:40 msgid "Supported argument type is integer." msgstr "" #: ../src/intrinsics/array/allocated.md:46 ../src/intrinsics/array/cshift.md:43 #: ../src/intrinsics/array/size.md:37 ../src/intrinsics/bit/bge.md:49 #: ../src/intrinsics/bit/bgt.md:49 ../src/intrinsics/bit/bit_size.md:44 #: ../src/intrinsics/bit/ble.md:49 ../src/intrinsics/bit/blt.md:49 #: ../src/intrinsics/bit/btest.md:56 ../src/intrinsics/bit/shiftl.md:62 #: ../src/intrinsics/bit/shiftr.md:62 ../src/intrinsics/character/achar.md:53 #: ../src/intrinsics/character/adjustl.md:45 #: ../src/intrinsics/character/adjustr.md:46 #: ../src/intrinsics/character/char.md:53 #: ../src/intrinsics/character/len_trim.md:44 #: ../src/intrinsics/character/lge.md:59 ../src/intrinsics/kind-type/kind.md:59 #: ../src/intrinsics/mathematical/acos.md:60 #: ../src/intrinsics/mathematical/acosh.md:72 #: ../src/intrinsics/mathematical/asin.md:60 #: ../src/intrinsics/mathematical/asinh.md:64 #: ../src/intrinsics/mathematical/atan.md:60 #: ../src/intrinsics/mathematical/atan2.md:75 #: ../src/intrinsics/mathematical/atanh.md:68 #: ../src/intrinsics/mathematical/fraction.md:34 #: ../src/intrinsics/misc/command_argument_count.md:31 #: ../src/intrinsics/misc/cpu_time.md:44 #: ../src/intrinsics/misc/date_and_time.md:64 #: ../src/intrinsics/misc/new_line.md:40 ../src/intrinsics/numeric/abs.md:79 #: ../src/intrinsics/numeric/aimag.md:53 ../src/intrinsics/numeric/aint.md:39 #: ../src/intrinsics/numeric/anint.md:42 #: ../src/intrinsics/numeric/ceiling.md:46 #: ../src/intrinsics/numeric/cmplx.md:59 ../src/intrinsics/numeric/conjg.md:53 #: ../src/intrinsics/numeric/digits.md:30 ../src/intrinsics/numeric/dim.md:31 #: ../src/intrinsics/numeric/epsilon.md:49 ../src/intrinsics/numeric/erf.md:53 #: ../src/intrinsics/numeric/erfc.md:56 ../src/intrinsics/numeric/exp.md:57 #: ../src/intrinsics/numeric/floor.md:65 ../src/intrinsics/numeric/gamma.md:58 #: ../src/intrinsics/numeric/mod.md:80 msgid "Examples" msgstr "" #: ../src/intrinsics/array/allocated.md:59 ../src/intrinsics/array/cshift.md:55 #: ../src/intrinsics/array/size.md:48 ../src/intrinsics/mathematical/acos.md:76 #: ../src/intrinsics/mathematical/acosh.md:81 #: ../src/intrinsics/mathematical/asin.md:76 #: ../src/intrinsics/mathematical/asinh.md:73 #: ../src/intrinsics/mathematical/atan.md:76 #: ../src/intrinsics/mathematical/atan2.md:84 #: ../src/intrinsics/mathematical/atanh.md:77 #: ../src/intrinsics/mathematical/fraction.md:44 msgid "**Result**:" msgstr "" #: ../src/intrinsics/array/allocated.md:65 ../src/intrinsics/array/cshift.md:62 #: ../src/intrinsics/array/size.md:55 ../src/intrinsics/bit/bge.md:68 #: ../src/intrinsics/bit/bgt.md:66 ../src/intrinsics/bit/bit_size.md:61 #: ../src/intrinsics/bit/ble.md:68 ../src/intrinsics/bit/blt.md:66 #: ../src/intrinsics/bit/btest.md:71 ../src/intrinsics/bit/shiftl.md:80 #: ../src/intrinsics/bit/shiftr.md:80 ../src/intrinsics/character/achar.md:69 #: ../src/intrinsics/character/adjustl.md:62 #: ../src/intrinsics/character/adjustr.md:63 #: ../src/intrinsics/character/char.md:69 #: ../src/intrinsics/character/len_trim.md:63 #: ../src/intrinsics/character/lge.md:79 ../src/intrinsics/kind-type/kind.md:79 #: ../src/intrinsics/mathematical/acos.md:82 #: ../src/intrinsics/mathematical/acosh.md:86 #: ../src/intrinsics/mathematical/asin.md:82 #: ../src/intrinsics/mathematical/asinh.md:78 #: ../src/intrinsics/mathematical/atan.md:82 #: ../src/intrinsics/mathematical/atan2.md:90 #: ../src/intrinsics/mathematical/atanh.md:82 #: ../src/intrinsics/mathematical/fraction.md:50 #: ../src/intrinsics/misc/command_argument_count.md:47 #: ../src/intrinsics/misc/cpu_time.md:64 #: ../src/intrinsics/misc/date_and_time.md:90 #: ../src/intrinsics/misc/new_line.md:56 ../src/intrinsics/numeric/abs.md:96 #: ../src/intrinsics/numeric/aimag.md:68 ../src/intrinsics/numeric/aint.md:55 #: ../src/intrinsics/numeric/anint.md:58 #: ../src/intrinsics/numeric/ceiling.md:64 #: ../src/intrinsics/numeric/cmplx.md:74 ../src/intrinsics/numeric/conjg.md:68 #: ../src/intrinsics/numeric/digits.md:44 ../src/intrinsics/numeric/dim.md:47 #: ../src/intrinsics/numeric/epsilon.md:63 ../src/intrinsics/numeric/erf.md:67 #: ../src/intrinsics/numeric/erfc.md:70 ../src/intrinsics/numeric/exp.md:71 #: ../src/intrinsics/numeric/floor.md:83 ../src/intrinsics/numeric/gamma.md:74 #: ../src/intrinsics/numeric/mod.md:95 msgid "See Also" msgstr "" #: ../src/intrinsics/array/cshift.md:1 msgid "cshift(A, shift [, dim]): Circular Shift" msgstr "" #: ../src/intrinsics/array/cshift.md:3 msgid "Circular shift elements of an array." msgstr "" #: ../src/intrinsics/array/cshift.md:16 ../src/intrinsics/array/size.md:16 msgid "`A` the input array of any type or rank." msgstr "" #: ../src/intrinsics/array/cshift.md:18 msgid "`shift` the input value of integer type." msgstr "" #: ../src/intrinsics/array/cshift.md:20 msgid "" "`dim` optional dimension, if present, `cshift` returns the result of this" " dimension." msgstr "" #: ../src/intrinsics/array/cshift.md:24 msgid "" "The return value is of input array type and rank as the `A` array input " "argument." msgstr "" #: ../src/intrinsics/array/cshift.md:28 msgid "" "**cshift(A, shift [, dim])** performs a circular shift on elements of `A`" " array along the dimension of `dim`. Default value of `dim` is 1, used " "when `dim` is not passed." msgstr "" #: ../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 "" #: ../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 "" #: ../src/intrinsics/array/cshift.md:41 msgid "" "Supported argument type is array for `A` and integer for `shift` and " "`dim`." msgstr "" #: ../src/intrinsics/array/size.md:1 msgid "size(x): Size of Array" msgstr "" #: ../src/intrinsics/array/size.md:3 msgid "Returns the size of an array `x`." msgstr "" #: ../src/intrinsics/array/size.md:18 msgid "" "`dim` optional dimension, if present, `size` returns the size of this " "dimension." msgstr "" #: ../src/intrinsics/array/size.md:20 msgid "`kind` optional the kind of the return value." msgstr "" #: ../src/intrinsics/array/size.md:24 msgid "`n` the size of an array (integer)." msgstr "" #: ../src/intrinsics/array/size.md:28 msgid "" "The `size` intrinsic function returns the size of an array. It returns " "the product of all dimensions, unless the `dim` argument is specified, in" " which case it only returns the size of this particular dimension. The " "`kind` argument can be used to specify the integer kind of the result." msgstr "" #: ../src/intrinsics/array/size.md:57 msgid "[shape](), [reshape]()." msgstr "" #: ../src/intrinsics/bit.md:1 msgid "Bit Intrinsic Functions" msgstr "" #: ../src/intrinsics/bit/bge.md:1 msgid "bge(x, y): Bitwise Greater or Equal" msgstr "" #: ../src/intrinsics/bit/bge.md:3 msgid "Bitwise greater than or equal to." msgstr "" #: ../src/intrinsics/bit/bge.md:16 ../src/intrinsics/bit/bgt.md:16 #: ../src/intrinsics/bit/ble.md:16 ../src/intrinsics/bit/blt.md:16 msgid "`x` and `y` are integer input values. Both input values are of same kind." msgstr "" #: ../src/intrinsics/bit/bge.md:20 ../src/intrinsics/bit/bgt.md:20 #: ../src/intrinsics/bit/ble.md:20 ../src/intrinsics/bit/blt.md:20 msgid "The return value is of type logical and of the default kind." msgstr "" #: ../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 "" #: ../src/intrinsics/bit/bge.md:29 ../src/intrinsics/bit/bgt.md:29 #: ../src/intrinsics/bit/ble.md:29 ../src/intrinsics/bit/blt.md:29 #: ../src/intrinsics/bit/btest.md:34 msgid "Supported input types is integer of 32 bit and 64 bit size." msgstr "" #: ../src/intrinsics/bit/bge.md:60 ../src/intrinsics/bit/bgt.md:59 #: ../src/intrinsics/bit/bit_size.md:54 ../src/intrinsics/bit/ble.md:60 #: ../src/intrinsics/bit/blt.md:59 ../src/intrinsics/bit/btest.md:65 #: ../src/intrinsics/bit/shiftl.md:74 ../src/intrinsics/bit/shiftr.md:74 #: ../src/intrinsics/character/achar.md:63 #: ../src/intrinsics/character/adjustl.md:56 #: ../src/intrinsics/character/adjustr.md:57 #: ../src/intrinsics/character/char.md:63 #: ../src/intrinsics/character/len_trim.md:57 #: ../src/intrinsics/character/lge.md:72 ../src/intrinsics/kind-type/kind.md:72 #: ../src/intrinsics/misc/command_argument_count.md:40 #: ../src/intrinsics/misc/cpu_time.md:57 #: ../src/intrinsics/misc/date_and_time.md:83 #: ../src/intrinsics/misc/new_line.md:49 ../src/intrinsics/numeric/abs.md:89 #: ../src/intrinsics/numeric/aimag.md:62 ../src/intrinsics/numeric/aint.md:48 #: ../src/intrinsics/numeric/anint.md:51 #: ../src/intrinsics/numeric/ceiling.md:57 #: ../src/intrinsics/numeric/cmplx.md:68 ../src/intrinsics/numeric/conjg.md:62 #: ../src/intrinsics/numeric/digits.md:38 ../src/intrinsics/numeric/dim.md:40 #: ../src/intrinsics/numeric/epsilon.md:57 ../src/intrinsics/numeric/erf.md:61 #: ../src/intrinsics/numeric/erfc.md:64 ../src/intrinsics/numeric/exp.md:65 #: ../src/intrinsics/numeric/floor.md:76 ../src/intrinsics/numeric/gamma.md:67 #: ../src/intrinsics/numeric/mod.md:89 msgid "**Result:**" msgstr "" #: ../src/intrinsics/bit/bge.md:70 msgid "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." msgstr "" #: ../src/intrinsics/bit/bgt.md:1 msgid "bgt(x, y): Bitwise Greater Than" msgstr "" #: ../src/intrinsics/bit/bgt.md:3 msgid "Bitwise greater than." msgstr "" #: ../src/intrinsics/bit/bgt.md:24 msgid "" "`bgt(x, y)` calculates if one integer input values is bitwise greater " "than the other." msgstr "" #: ../src/intrinsics/bit/bgt.md:68 msgid "[bge](bge.md), [ble](ble.md), [blt](blt.md)." msgstr "" #: ../src/intrinsics/bit/bit_size.md:1 msgid "bit_size(x): Bit Size" msgstr "" #: ../src/intrinsics/bit/bit_size.md:3 msgid "Bit size." msgstr "" #: ../src/intrinsics/bit/bit_size.md:16 msgid "`x` is integer input value." msgstr "" #: ../src/intrinsics/bit/bit_size.md:20 ../src/intrinsics/numeric/digits.md:19 msgid "The return value is of type integer." msgstr "" #: ../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 "" #: ../src/intrinsics/bit/bit_size.md:29 msgid "Supported input types is integer." msgstr "" #: ../src/intrinsics/bit/ble.md:1 msgid "bge(x, y): Bitwise Less or Equal" msgstr "" #: ../src/intrinsics/bit/ble.md:3 msgid "Bitwise less than or equal to." msgstr "" #: ../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 "" #: ../src/intrinsics/bit/ble.md:70 msgid "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." msgstr "" #: ../src/intrinsics/bit/blt.md:1 msgid "blt(x, y): Bitwise Less Than" msgstr "" #: ../src/intrinsics/bit/blt.md:3 msgid "Bitwise less than." msgstr "" #: ../src/intrinsics/bit/blt.md:24 msgid "" "`blt(x, y)` calculates if one integer input values is bitwise less than " "the other." msgstr "" #: ../src/intrinsics/bit/blt.md:68 msgid "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." msgstr "" #: ../src/intrinsics/bit/btest.md:1 msgid "btest(x, pos): Bit Test at Position" msgstr "" #: ../src/intrinsics/bit/btest.md:3 msgid "Bit test." msgstr "" #: ../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 "" #: ../src/intrinsics/bit/btest.md:21 msgid "The return value is of type logical." msgstr "" #: ../src/intrinsics/bit/btest.md:25 msgid "" "`btest(x, pos)` calculates if `pos` bit in input integer value `x` is " "set. The counting of the bits starts at 0, at least significant bit (LSB)" " i.e., the rightmost bit in `x`." msgstr "" #: ../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 "" #: ../src/intrinsics/bit/shiftl.md:1 msgid "shiftl(x, shift): Shift Left" msgstr "" #: ../src/intrinsics/bit/shiftl.md:3 msgid "Logical shift left function." msgstr "" #: ../src/intrinsics/bit/shiftl.md:16 ../src/intrinsics/bit/shiftr.md:16 msgid "`x` is an integer input value." msgstr "" #: ../src/intrinsics/bit/shiftl.md:18 ../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 "" #: ../src/intrinsics/bit/shiftl.md:23 ../src/intrinsics/bit/shiftr.md:23 msgid "The return value is of type integer and of the same kind as `x`." msgstr "" #: ../src/intrinsics/bit/shiftl.md:27 msgid "" "**shiftl(x, shift)** logically left shifts `x` by `shift` number of bits." " `shiftl` shifts from LSB(**L**east **S**ignificant **B**it) to " "MSB(**M**ost **S**ignificant **B**it). Bits shifted from the left end " "i.e., MSB bits are lost. Zeroes are appended to the opposite right end." msgstr "" #: ../src/intrinsics/bit/shiftl.md:34 ../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 "" #: ../src/intrinsics/bit/shiftl.md:82 msgid "[shiftr](shiftr.md)." msgstr "" #: ../src/intrinsics/bit/shiftr.md:1 msgid "shiftr(x, shift): Shift Right" msgstr "" #: ../src/intrinsics/bit/shiftr.md:3 msgid "Logical shift right function." msgstr "" #: ../src/intrinsics/bit/shiftr.md:27 msgid "" "**shiftr(x, shift)** logically right shifts `x` by `shift` number of " "bits. `shiftr` shifts from MSB(**M**ost **S**ignificant **B**it) to " "LSB(**L**east **S**ignificant **B**it). Bits shifted from the right end " "i.e., LSB bits are lost. Zeroes are appended to the opposite left end." msgstr "" #: ../src/intrinsics/bit/shiftr.md:82 msgid "[shiftl](shiftl.md)." msgstr "" #: ../src/intrinsics/character.md:1 msgid "Character Intrinsic Functions" msgstr "" #: ../src/intrinsics/character/achar.md:1 msgid "achar(x, kind): To Character in ASCII set." msgstr "" #: ../src/intrinsics/character/achar.md:3 msgid "Character represented by in the ASCII character set." msgstr "" #: ../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 "" #: ../src/intrinsics/character/achar.md:20 #: ../src/intrinsics/character/adjustl.md:18 #: ../src/intrinsics/character/adjustr.md:18 #: ../src/intrinsics/character/char.md:21 #: ../src/intrinsics/character/len_trim.md:18 msgid "Return value" msgstr "" #: ../src/intrinsics/character/achar.md:22 #: ../src/intrinsics/character/char.md:23 msgid "The return value is of type character of length 1." msgstr "" #: ../src/intrinsics/character/achar.md:24 #: ../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 "" #: ../src/intrinsics/character/achar.md:29 msgid "" "**achar(x, kind)** returns the character represented by the ASCII " "character set at `x` position." msgstr "" #: ../src/intrinsics/character/achar.md:32 #: ../src/intrinsics/character/char.md:33 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 "" #: ../src/intrinsics/character/achar.md:35 #: ../src/intrinsics/character/char.md:36 msgid "It is a runtime builtin function." msgstr "" #: ../src/intrinsics/character/achar.md:71 #: ../src/intrinsics/character/adjustl.md:64 #: ../src/intrinsics/character/len_trim.md:65 msgid "[lge](lge.md)." msgstr "" #: ../src/intrinsics/character/adjustl.md:1 msgid "adjustl(string): Left Adjust String" msgstr "" #: ../src/intrinsics/character/adjustl.md:3 msgid "Left adjust a string." msgstr "" #: ../src/intrinsics/character/adjustl.md:16 #: ../src/intrinsics/character/adjustr.md:16 msgid "`string`: the input value must be of character type." msgstr "" #: ../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 "" #: ../src/intrinsics/character/adjustl.md:25 msgid "" "**adjustl(string)** adjusts input string by removing any leading spaces " "and appending same number of spaces." msgstr "" #: ../src/intrinsics/character/adjustl.md:30 #: ../src/intrinsics/character/adjustr.md:31 msgid "Supported argument type is character." msgstr "" #: ../src/intrinsics/character/adjustr.md:1 msgid "adjustr(string): Right Adjust String" msgstr "" #: ../src/intrinsics/character/adjustr.md:3 msgid "Right adjust a string." msgstr "" #: ../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 "" #: ../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 "" #: ../src/intrinsics/character/adjustr.md:65 msgid "[adjustl](adjustl.md)." msgstr "" #: ../src/intrinsics/character/char.md:1 msgid "char(x, [, kind]): Integer to Character" msgstr "" #: ../src/intrinsics/character/char.md:3 msgid "Integer to character conversion." msgstr "" #: ../src/intrinsics/character/char.md:16 msgid "`x`: the input value of integer type." msgstr "" #: ../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 "" #: ../src/intrinsics/character/char.md:30 msgid "" "**char(x)** returns the character represented by the ASCII character set " "at `x` position." msgstr "" #: ../src/intrinsics/character/char.md:71 msgid "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" msgstr "" #: ../src/intrinsics/character/len_trim.md:1 msgid "len_trim(string): Length Ignoring Trailing Blanks" msgstr "" #: ../src/intrinsics/character/len_trim.md:3 msgid "Length of a character string ignoring trailing blank character(s)." msgstr "" #: ../src/intrinsics/character/len_trim.md:16 msgid "`string` the input value of character type." msgstr "" #: ../src/intrinsics/character/len_trim.md:20 msgid "The return value is of type unsigned integer." msgstr "" #: ../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 "" #: ../src/intrinsics/character/len_trim.md:29 msgid "Supported argument type is character scalar." msgstr "" #: ../src/intrinsics/character/lge.md:1 msgid "lge(x, y): Lexically Greater or Equal" msgstr "" #: ../src/intrinsics/character/lge.md:3 msgid "Lexically greater than or equal." msgstr "" #: ../src/intrinsics/character/lge.md:17 msgid "`x` input value of type character." msgstr "" #: ../src/intrinsics/character/lge.md:19 msgid "`y` input value of type character." msgstr "" #: ../src/intrinsics/character/lge.md:21 msgid "`x` and `y` can be seen as string A and string B." msgstr "" #: ../src/intrinsics/character/lge.md:25 msgid "The return value is of logical `true` or `false` type." msgstr "" #: ../src/intrinsics/character/lge.md:27 msgid "`True` if `x` string is lexically greater than or equal to `y`." msgstr "" #: ../src/intrinsics/character/lge.md:29 msgid "`False` if they are not." msgstr "" #: ../src/intrinsics/character/lge.md:33 msgid "" "**lge(x, y)** determines if input string `x` is lexically greater than or" " equal to input string `y`. The two strings in comparison are interpreted" " as containing ASCII character codes." msgstr "" #: ../src/intrinsics/character/lge.md:39 msgid "Argument types should be of type character literal." msgstr "" #: ../src/intrinsics/character/lge.md:81 msgid "[len_trim](len_trim.md)." msgstr "" #: ../src/intrinsics/kind-type.md:1 msgid "Kind Type Intrinsic Functions" msgstr "" #: ../src/intrinsics/kind-type/kind.md:1 msgid "kind(x): Kind of an Entity" msgstr "" #: ../src/intrinsics/kind-type/kind.md:3 msgid "Kind of an entity." msgstr "" #: ../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 "" #: ../src/intrinsics/kind-type/kind.md:21 msgid "The return value is of integer type and of default integer kind." msgstr "" #: ../src/intrinsics/kind-type/kind.md:25 msgid "**kind(x)** returns the kind parameter of the input argument `x`." msgstr "" #: ../src/intrinsics/kind-type/kind.md:29 msgid "" "Supported argument types are logical, integer, real, complex, or " "character." msgstr "" #: ../src/intrinsics/kind-type/kind.md:81 #: ../src/intrinsics/misc/command_argument_count.md:16 #: ../src/intrinsics/misc/cpu_time.md:20 #: ../src/intrinsics/misc/date_and_time.md:41 #: ../src/intrinsics/misc/new_line.md:58 msgid "None." msgstr "" #: ../src/intrinsics/mathematical.md:1 msgid "Mathematical Intrinsic Functions" msgstr "" #: ../src/intrinsics/mathematical/acos.md:1 msgid "acos(x): Trigonometric Arc Cosine" msgstr "" #: ../src/intrinsics/mathematical/acos.md:3 msgid "Trigonometric arc cosine (inverse cosine) function." msgstr "" #: ../src/intrinsics/mathematical/acos.md:16 #: ../src/intrinsics/mathematical/asin.md:16 #: ../src/intrinsics/mathematical/atan.md:16 msgid "`x` the input value, can be real or complex; less than or equal to 1." msgstr "" #: ../src/intrinsics/mathematical/acos.md:20 #: ../src/intrinsics/mathematical/acosh.md:21 #: ../src/intrinsics/mathematical/asin.md:20 #: ../src/intrinsics/mathematical/asinh.md:21 #: ../src/intrinsics/mathematical/atan.md:20 #: ../src/intrinsics/mathematical/atanh.md:21 msgid "" "The returned value has the kind of the input value and TYPE may be real " "or complex." msgstr "" #: ../src/intrinsics/mathematical/acos.md:25 msgid "**acos(x)** computes the arcsine of the argument **x**." msgstr "" #: ../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 "" #: ../src/intrinsics/mathematical/acos.md:33 #: ../src/intrinsics/mathematical/acosh.md:45 #: ../src/intrinsics/mathematical/asin.md:33 #: ../src/intrinsics/mathematical/asinh.md:37 #: ../src/intrinsics/mathematical/atan.md:33 #: ../src/intrinsics/mathematical/atanh.md:41 msgid "Supported argument types float, double, complex float, complex double." msgstr "" #: ../src/intrinsics/mathematical/acos.md:84 msgid "[asin](asin.md), [atan](atan.md)." msgstr "" #: ../src/intrinsics/mathematical/acosh.md:1 msgid "acosh(x): Inverse Hyperbolic Cosine" msgstr "" #: ../src/intrinsics/mathematical/acosh.md:3 msgid "Inverse hyperbolic cosine function." msgstr "" #: ../src/intrinsics/mathematical/acosh.md:16 #: ../src/intrinsics/mathematical/asinh.md:16 #: ../src/intrinsics/mathematical/atanh.md:16 msgid "" "`x` the input value, can be real with value greater than or equal to 1 or" " of type complex." msgstr "" #: ../src/intrinsics/mathematical/acosh.md:26 msgid "**acosh(x)** computes the inverse hyperbolic cosine function of **x**." msgstr "" #: ../src/intrinsics/mathematical/acosh.md:28 #: ../src/intrinsics/mathematical/asinh.md:28 #: ../src/intrinsics/mathematical/atanh.md:28 msgid "The result type and kind are the same as input value `x`." msgstr "" #: ../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 "" #: ../src/intrinsics/mathematical/acosh.md:33 msgid "$-\\pi <= img (acosh(x)) <= \\pi$" msgstr "" #: ../src/intrinsics/mathematical/acosh.md:35 msgid "" "For real values $x$ in the domain $x > 1$, the inverse hyperbolic cosine " "satisifies:" msgstr "" #: ../src/intrinsics/mathematical/acosh.md:38 msgid "$cosh^{-1}(x) = \\log(x + \\sqrt{(x^2 - 1)})$" msgstr "" #: ../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 "" #: ../src/intrinsics/mathematical/acosh.md:88 msgid "[asinh](asinh.md), [atanh](atanh.md)." msgstr "" #: ../src/intrinsics/mathematical/asin.md:1 msgid "asin(x): Trigonometric Arcsine" msgstr "" #: ../src/intrinsics/mathematical/asin.md:3 msgid "Trigonometric arcsine function." msgstr "" #: ../src/intrinsics/mathematical/asin.md:25 msgid "**asin(x)** computes the arcsine of the argument **x**." msgstr "" #: ../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 "" #: ../src/intrinsics/mathematical/asin.md:84 msgid "[acos](acos.md), [atan](atan.md)." msgstr "" #: ../src/intrinsics/mathematical/asinh.md:1 msgid "asinh(x): Inverse Hyperbolic Arcsine" msgstr "" #: ../src/intrinsics/mathematical/asinh.md:3 msgid "Inverse hyperbolic arcsine function." msgstr "" #: ../src/intrinsics/mathematical/asinh.md:26 msgid "**asinh(x)** computes the inverse hyperbolic arcsine function of **x**." msgstr "" #: ../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 "" #: ../src/intrinsics/mathematical/asinh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (asinh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../src/intrinsics/mathematical/asinh.md:80 msgid "[acosh](acosh.md), [atanh](atanh.md)." msgstr "" #: ../src/intrinsics/mathematical/atan.md:1 msgid "atan(x): Trigonometric ArcTangent" msgstr "" #: ../src/intrinsics/mathematical/atan.md:3 msgid "Trigonometric arctangent (inverse arctangent) function." msgstr "" #: ../src/intrinsics/mathematical/atan.md:25 msgid "**atan(x)** computes the arctangent of the argument **x**." msgstr "" #: ../src/intrinsics/mathematical/atan.md:27 msgid "" "The arc tangent is the inverse function of the arctangent function. It is" " commonly used in trigonometry to find the angle when the lengths of the " "opposite side of a right triangle and base are known, i.e., perpendicular" " and base length." msgstr "" #: ../src/intrinsics/mathematical/atan.md:84 msgid "[asin](asin.md), [acos](acos.md)." msgstr "" #: ../src/intrinsics/mathematical/atan2.md:1 msgid "atan2(y, x): ArcTangent" msgstr "" #: ../src/intrinsics/mathematical/atan2.md:3 msgid "Arctangent function or inverse tangent function." msgstr "" #: ../src/intrinsics/mathematical/atan2.md:15 msgid "`y` the input value is the imaginary part of the complex expression" msgstr "" #: ../src/intrinsics/mathematical/atan2.md:17 #: ../src/intrinsics/numeric/aimag.md:29 ../src/intrinsics/numeric/cmplx.md:43 msgid "$x + iy$" msgstr "" #: ../src/intrinsics/mathematical/atan2.md:19 msgid "`x` the input value, must be real part of the complex expression." msgstr "" #: ../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 "" #: ../src/intrinsics/mathematical/atan2.md:29 msgid "" "**atan2(y, x)** computes the principal value of the argument function of " "the complex expression $x + iy$. This is used to transform from cartesian" " into polar coordinates and allows to determine the angle in the correct " "quadrant." msgstr "" #: ../src/intrinsics/mathematical/atan2.md:33 msgid "It is also represented as:" msgstr "" #: ../src/intrinsics/mathematical/atan2.md:35 msgid "$tan^{-1}(\\frac{y}{x})$" msgstr "" #: ../src/intrinsics/mathematical/atan2.md:37 msgid "If `x` is nonzero, the result lies in the range:" msgstr "" #: ../src/intrinsics/mathematical/atan2.md:39 msgid "$-\\pi <= atan(x) <= \\pi$" msgstr "" #: ../src/intrinsics/mathematical/atan2.md:41 msgid "The sign is positive if `y` is positive." msgstr "" #: ../src/intrinsics/mathematical/atan2.md:43 msgid "If `y` is zero and `x` is strictly positive, then the result is 0." msgstr "" #: ../src/intrinsics/mathematical/atan2.md:45 msgid "If `x` is negative and `y` is positive zero, then the result is $\\pi$." msgstr "" #: ../src/intrinsics/mathematical/atan2.md:47 msgid "If `x` is negative and `y` is negative zero, then the result is $-\\pi$." msgstr "" #: ../src/intrinsics/mathematical/atan2.md:49 msgid "If `x` is zero, then the magnitude of the result is $\\frac{\\pi}{2}$." msgstr "" #: ../src/intrinsics/mathematical/atan2.md:51 msgid "If `y` is negative real zero, the result is $\\frac{-\\pi}{2}$." msgstr "" #: ../src/intrinsics/mathematical/atan2.md:55 #: ../src/intrinsics/mathematical/fraction.md:32 msgid "Supported argument type is real." msgstr "" #: ../src/intrinsics/mathematical/atanh.md:1 msgid "atanh(x): Inverse Hyperbolic Tangent" msgstr "" #: ../src/intrinsics/mathematical/atanh.md:3 msgid "Inverse hyperbolic tangent function." msgstr "" #: ../src/intrinsics/mathematical/atanh.md:26 msgid "**atanh(x)** computes the inverse hyperbolic tangent function of **x**." msgstr "" #: ../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 "" #: ../src/intrinsics/mathematical/atanh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (atanh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../src/intrinsics/mathematical/atanh.md:35 msgid "If the result is real, it lies in the range" msgstr "" #: ../src/intrinsics/mathematical/atanh.md:37 msgid "$-1.0 < atanh(x) < 1.0$" msgstr "" #: ../src/intrinsics/mathematical/atanh.md:84 msgid "[asinh](asinh.md), [acosh](acosh.md)." msgstr "" #: ../src/intrinsics/mathematical/fraction.md:1 msgid "fraction(x): Fractional Part in Model Representation" msgstr "" #: ../src/intrinsics/mathematical/fraction.md:3 msgid "Fractional part of the model representation." msgstr "" #: ../src/intrinsics/mathematical/fraction.md:15 msgid "`x` the input value, must be real." msgstr "" #: ../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 "" #: ../src/intrinsics/mathematical/fraction.md:24 msgid "" "**fraction(x)** computes the fractional part of the model representation " "of **x**." msgstr "" #: ../src/intrinsics/mathematical/fraction.md:26 #: ../src/intrinsics/numeric/erf.md:29 ../src/intrinsics/numeric/erfc.md:29 msgid "It is calculated using:" msgstr "" #: ../src/intrinsics/mathematical/fraction.md:28 msgid "$x * {radix(x)}^{(-exponent(x))}$" msgstr "" #: ../src/intrinsics/misc.md:1 msgid "Miscellaneous Intrinsic Functions" msgstr "" #: ../src/intrinsics/misc/command_argument_count.md:1 msgid "command_argument_count(): Number of Command Line Arguments" msgstr "" #: ../src/intrinsics/misc/command_argument_count.md:3 msgid "Get number of command line arguments." msgstr "" #: ../src/intrinsics/misc/command_argument_count.md:20 msgid "The return value is of integer type and of default kind." msgstr "" #: ../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 "" #: ../src/intrinsics/misc/command_argument_count.md:29 msgid "Any." msgstr "" #: ../src/intrinsics/misc/cpu_time.md:1 msgid "cpu_time(x): CPU Elapsed Time" msgstr "" #: ../src/intrinsics/misc/cpu_time.md:3 msgid "CPU elapsed time in seconds." msgstr "" #: ../src/intrinsics/misc/cpu_time.md:16 msgid "`x` the input value should be of type real with `intent(out)`." msgstr "" #: ../src/intrinsics/misc/cpu_time.md:24 msgid "" "**cpu_time(time)** returns a real value representing the elapsed CPU time" " in seconds. If tine source is available, time will be reported with " "microsecond resolution. If no time source is available, TIME is set to " "-1.0." msgstr "" #: ../src/intrinsics/misc/cpu_time.md:28 msgid "This is useful for testing segments of code to determine computation time." msgstr "" #: ../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 "" #: ../src/intrinsics/misc/cpu_time.md:35 #: ../src/intrinsics/misc/date_and_time.md:55 msgid "Supported input parameter types is real with `intent(out)`." msgstr "" #: ../src/intrinsics/misc/date_and_time.md:1 msgid "date_and_time([date, time, zone, values]): Date and Time" msgstr "" #: ../src/intrinsics/misc/date_and_time.md:3 msgid "Date and time subroutine." msgstr "" #: ../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 "" #: ../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 "" #: ../src/intrinsics/misc/date_and_time.md:22 msgid "" "`zone` the input value of character type, which has length 5 or larger. " "It is of default kind. It is `intent(out)` and has from `(+-)hhmm`, " "representing the difference with respect to Coordinates Universal Time " "(UTC). Unavailable time and date parameters return blanks." msgstr "" #: ../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 "" #: ../src/intrinsics/misc/date_and_time.md:30 msgid "`value(1)`: The year." msgstr "" #: ../src/intrinsics/misc/date_and_time.md:31 msgid "`value(2)`: The month." msgstr "" #: ../src/intrinsics/misc/date_and_time.md:32 msgid "`value(3)`: The day of the month." msgstr "" #: ../src/intrinsics/misc/date_and_time.md:33 msgid "`value(4)`: Time difference with UTC in minutes." msgstr "" #: ../src/intrinsics/misc/date_and_time.md:34 msgid "`value(5)`: The hour of the day." msgstr "" #: ../src/intrinsics/misc/date_and_time.md:35 msgid "`value(6)`: The minutes of the hour." msgstr "" #: ../src/intrinsics/misc/date_and_time.md:36 msgid "`value(7)`: The seconds of the minutes." msgstr "" #: ../src/intrinsics/misc/date_and_time.md:37 msgid "`value(8)`: The milliseconds of the second." msgstr "" #: ../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 "" #: ../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 "" #: ../src/intrinsics/misc/date_and_time.md:51 msgid "Unavailable or errorneous date and time parameters return blanks." msgstr "" #: ../src/intrinsics/misc/date_and_time.md:92 msgid "[cpu_time](cpu_time.md)." msgstr "" #: ../src/intrinsics/misc/new_line.md:1 msgid "new_line(x): New Line Character" msgstr "" #: ../src/intrinsics/misc/new_line.md:3 msgid "New line character." msgstr "" #: ../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 "" #: ../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 "" #: ../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 "" #: ../src/intrinsics/misc/new_line.md:31 msgid "Supported input parameter types is character." msgstr "" #: ../src/intrinsics/numeric.md:1 msgid "Numeric Intrinsic Functions" msgstr "" #: ../src/intrinsics/numeric/abs.md:1 msgid "abs(x): Absolute Value" msgstr "" #: ../src/intrinsics/numeric/abs.md:3 msgid "Absolute value." msgstr "" #: ../src/intrinsics/numeric/abs.md:17 msgid "`x` the input value, can be integer, real, or complex." msgstr "" #: ../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 "" #: ../src/intrinsics/numeric/abs.md:26 msgid "" "**abs(x)** calculates and returns absolute value of `x`. Result is " "calculated using mathematical formula:" msgstr "" #: ../src/intrinsics/numeric/abs.md:29 msgid "$|x|$" msgstr "" #: ../src/intrinsics/numeric/abs.md:31 msgid "If `x` is complex, the result is calculated using mathematical formula:" msgstr "" #: ../src/intrinsics/numeric/abs.md:33 msgid "$\\sqrt{(x^2 + y^2)}$" msgstr "" #: ../src/intrinsics/numeric/abs.md:37 ../src/intrinsics/numeric/digits.md:28 #: ../src/intrinsics/numeric/dim.md:29 ../src/intrinsics/numeric/mod.md:45 msgid "Supported argument types are real and integer." msgstr "" #: ../src/intrinsics/numeric/abs.md:98 ../src/intrinsics/numeric/aimag.md:70 #: ../src/intrinsics/numeric/mod.md:97 msgid "[ceiling](ceiling.md), [floor](floor.md)." msgstr "" #: ../src/intrinsics/numeric/aimag.md:1 msgid "aimag(x): Imaginary Part" msgstr "" #: ../src/intrinsics/numeric/aimag.md:3 msgid "Imaginary part of complex number." msgstr "" #: ../src/intrinsics/numeric/aimag.md:17 msgid "`x` the input value must be of complex type." msgstr "" #: ../src/intrinsics/numeric/aimag.md:21 msgid "The return value is imaginary part of type real and kind same as of `x`." msgstr "" #: ../src/intrinsics/numeric/aimag.md:25 msgid "**aimag(x)** returns the imaginary part of the input complex argument `x`." msgstr "" #: ../src/intrinsics/numeric/aimag.md:27 ../src/intrinsics/numeric/cmplx.md:41 #: ../src/intrinsics/numeric/conjg.md:27 msgid "" "For `x` complex input value, the result is calculated using mathematical " "formula:" msgstr "" #: ../src/intrinsics/numeric/aimag.md:31 ../src/intrinsics/numeric/cmplx.md:45 #: ../src/intrinsics/numeric/conjg.md:31 msgid "$i$ the imaginary part is the result." msgstr "" #: ../src/intrinsics/numeric/aimag.md:35 msgid "Supported argument types are complex." msgstr "" #: ../src/intrinsics/numeric/aint.md:1 msgid "aint(x, [kind]): Truncate to a Whole Number" msgstr "" #: ../src/intrinsics/numeric/aint.md:3 msgid "Truncate to a whole number." msgstr "" #: ../src/intrinsics/numeric/aint.md:16 ../src/intrinsics/numeric/anint.md:16 #: ../src/intrinsics/numeric/epsilon.md:16 ../src/intrinsics/numeric/erf.md:16 #: ../src/intrinsics/numeric/erfc.md:16 ../src/intrinsics/numeric/floor.md:16 msgid "`x` the input value must be of type real." msgstr "" #: ../src/intrinsics/numeric/aint.md:18 ../src/intrinsics/numeric/anint.md:18 msgid "`kind` the optional input parameter initialises the kind of the result." msgstr "" #: ../src/intrinsics/numeric/aint.md:22 ../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 "" #: ../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 "" #: ../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 "" #: ../src/intrinsics/numeric/aint.md:33 ../src/intrinsics/numeric/anint.md:36 msgid "The optional parameter `kind` specifies the kind of the result." msgstr "" #: ../src/intrinsics/numeric/aint.md:37 ../src/intrinsics/numeric/anint.md:40 #: ../src/intrinsics/numeric/epsilon.md:31 ../src/intrinsics/numeric/erf.md:35 #: ../src/intrinsics/numeric/erfc.md:38 ../src/intrinsics/numeric/floor.md:35 #: ../src/intrinsics/numeric/gamma.md:40 msgid "Supported argument types is real." msgstr "" #: ../src/intrinsics/numeric/aint.md:57 ../src/intrinsics/numeric/floor.md:85 msgid "[ceiling](ceiling.md), [mod](mod.md)." msgstr "" #: ../src/intrinsics/numeric/anint.md:1 msgid "anint(x, [kind]): Round to Nearest Whole Number" msgstr "" #: ../src/intrinsics/numeric/anint.md:3 msgid "Round to nearest whole number." msgstr "" #: ../src/intrinsics/numeric/anint.md:25 msgid "The return value is equal to rounded whole number." msgstr "" #: ../src/intrinsics/numeric/anint.md:29 msgid "**anint(x)** calculates rounded value of input parameter `x`." msgstr "" #: ../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 "" #: ../src/intrinsics/numeric/anint.md:34 msgid "If `x` is greater than 0, `anint(x)` returns `aint(x + 0.5)`." msgstr "" #: ../src/intrinsics/numeric/anint.md:60 msgid "[aint](aint.md)." msgstr "" #: ../src/intrinsics/numeric/ceiling.md:1 msgid "ceiling(x): Integer Ceiling" msgstr "" #: ../src/intrinsics/numeric/ceiling.md:3 msgid "Integer ceiling function" msgstr "" #: ../src/intrinsics/numeric/ceiling.md:16 msgid "The input value `x` may be of type real or integer." msgstr "" #: ../src/intrinsics/numeric/ceiling.md:20 msgid "The return value is of type integer and nearest greater integer." msgstr "" #: ../src/intrinsics/numeric/ceiling.md:24 msgid "**ceiling(x)** returns the least integer greater than or equal to `x`." msgstr "" #: ../src/intrinsics/numeric/ceiling.md:28 msgid "Supported input parameter types are integer and real." msgstr "" #: ../src/intrinsics/numeric/ceiling.md:66 msgid "[floor](floor.md), [mod](mod.md)." msgstr "" #: ../src/intrinsics/numeric/cmplx.md:1 msgid "cmplx(x [, [, kind]]): Convert to Complex" msgstr "" #: ../src/intrinsics/numeric/cmplx.md:3 msgid "Conversion to complex type." msgstr "" #: ../src/intrinsics/numeric/cmplx.md:14 msgid "`cmplx(x, y)` is one of the intrinsic present in ASR." msgstr "" #: ../src/intrinsics/numeric/cmplx.md:18 msgid "" "`x` the input value must be of integer, real, or complex. `y` the " "optional input value must be of type integer or real. It should be only " "present in case `x` is not complex. `kind` the optional input value of " "integer expression type for initialisation indicating the kind parameter " "of the result." msgstr "" #: ../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 "" #: ../src/intrinsics/numeric/cmplx.md:32 msgid "" "**cmplx(x, [, y [, kind]])** converts the input value to complex " "representation:" msgstr "" #: ../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 "" #: ../src/intrinsics/numeric/cmplx.md:37 msgid "If `y` is not present, the imaginary component is set to 0.0." msgstr "" #: ../src/intrinsics/numeric/cmplx.md:39 msgid "If `x` is complex then `y` must not be present." msgstr "" #: ../src/intrinsics/numeric/cmplx.md:49 msgid "Supported argument types are integer, real, or complex." msgstr "" #: ../src/intrinsics/numeric/conjg.md:1 msgid "conjg(x): Complex Conjugate" msgstr "" #: ../src/intrinsics/numeric/conjg.md:3 msgid "Complex conjugate function." msgstr "" #: ../src/intrinsics/numeric/conjg.md:17 msgid "`x` the input value must be of type complex." msgstr "" #: ../src/intrinsics/numeric/conjg.md:21 msgid "The return value is of complex type." msgstr "" #: ../src/intrinsics/numeric/conjg.md:25 msgid "**conjg(x)** converts the input value `x` to its conjugate." msgstr "" #: ../src/intrinsics/numeric/conjg.md:29 msgid "$x + iy$ converted to $x - iy$" msgstr "" #: ../src/intrinsics/numeric/conjg.md:35 msgid "Supported argument types is complex." msgstr "" #: ../src/intrinsics/numeric/digits.md:1 msgid "digits(x): Significant Binary Digits" msgstr "" #: ../src/intrinsics/numeric/digits.md:3 msgid "Significant binary digits." msgstr "" #: ../src/intrinsics/numeric/digits.md:15 msgid "`x` the input value must be of type real or integer." msgstr "" #: ../src/intrinsics/numeric/digits.md:23 msgid "" "**digits(x)** returns the number of significant binary digits of the " "internal mopdel representation of `x`." msgstr "" #: ../src/intrinsics/numeric/dim.md:1 msgid "dim(x, y): Positive Difference or 0" msgstr "" #: ../src/intrinsics/numeric/dim.md:3 msgid "Positive difference or 0." msgstr "" #: ../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 "" #: ../src/intrinsics/numeric/dim.md:20 msgid "The return value is of type integer or real." msgstr "" #: ../src/intrinsics/numeric/dim.md:24 msgid "" "**dim(x)** computes the difference $x - y$, if the result is positive, " "otherwise returns 0." msgstr "" #: ../src/intrinsics/numeric/epsilon.md:1 msgid "epsilon(x): Epsilon" msgstr "" #: ../src/intrinsics/numeric/epsilon.md:3 msgid "Epsilon function." msgstr "" #: ../src/intrinsics/numeric/epsilon.md:20 msgid "The return value is of same type as of the input argument." msgstr "" #: ../src/intrinsics/numeric/epsilon.md:24 msgid "" "**epsilon(x)** computes the smallest number $\\epsilon$ of the same kind " "as `x` following:" msgstr "" #: ../src/intrinsics/numeric/epsilon.md:27 msgid "$1 + \\epsilon > 1$" msgstr "" #: ../src/intrinsics/numeric/erf.md:1 msgid "erf(x): Error" msgstr "" #: ../src/intrinsics/numeric/erf.md:3 msgid "Error function." msgstr "" #: ../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 "" #: ../src/intrinsics/numeric/erf.md:25 ../src/intrinsics/numeric/erfc.md:25 msgid "" "**erf(x)** computes the error function of `x`. The result lies in the " "range:" msgstr "" #: ../src/intrinsics/numeric/erf.md:27 msgid "$-1 \\leq erf (x) \\leq 1$" msgstr "" #: ../src/intrinsics/numeric/erf.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_0^xe^{-t^2}dt$" msgstr "" #: ../src/intrinsics/numeric/erf.md:69 msgid "[erfc](erfc.md)." msgstr "" #: ../src/intrinsics/numeric/erfc.md:1 msgid "erfc(x): Complementary Error" msgstr "" #: ../src/intrinsics/numeric/erfc.md:3 msgid "Complementary error function." msgstr "" #: ../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 "" #: ../src/intrinsics/numeric/erfc.md:27 msgid "$0 \\leq erf (x) \\leq 2$" msgstr "" #: ../src/intrinsics/numeric/erfc.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_{x}^{\\infty}e^{-t^2}dt$" msgstr "" #: ../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 "" #: ../src/intrinsics/numeric/erfc.md:72 msgid "[erf](erf.md)." msgstr "" #: ../src/intrinsics/numeric/exp.md:1 msgid "exp(x): Exponential" msgstr "" #: ../src/intrinsics/numeric/exp.md:3 msgid "Exponential function." msgstr "" #: ../src/intrinsics/numeric/exp.md:16 msgid "`x` the input value must be of type real or complex." msgstr "" #: ../src/intrinsics/numeric/exp.md:20 msgid "The return value is of same type as of the input argument, `x`." msgstr "" #: ../src/intrinsics/numeric/exp.md:24 msgid "**exp(x)** computes the base $e$ exponential of `x`, i.e., $e^x$." msgstr "" #: ../src/intrinsics/numeric/exp.md:26 msgid "" "If `x` is of type complex, its imaginary part is considered as a value in" " radians." msgstr "" #: ../src/intrinsics/numeric/exp.md:31 msgid "Supported argument types is real and complex." msgstr "" #: ../src/intrinsics/numeric/floor.md:1 msgid "floor(x, kind): Integer Floor" msgstr "" #: ../src/intrinsics/numeric/floor.md:3 msgid "Integer floor function." msgstr "" #: ../src/intrinsics/numeric/floor.md:18 msgid "" "`kind` the optional input parameter must be a scalar integer constant " "expression." msgstr "" #: ../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 "" #: ../src/intrinsics/numeric/floor.md:25 msgid "" "The return value is equal to or nearest greatest integer less than or " "equal to `x`." msgstr "" #: ../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 "" #: ../src/intrinsics/numeric/gamma.md:1 msgid "gamma(x): Gamma" msgstr "" #: ../src/intrinsics/numeric/gamma.md:3 msgid "Gamma function." msgstr "" #: ../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 "" #: ../src/intrinsics/numeric/gamma.md:21 msgid "The return value is of same type and kind as of `x`." msgstr "" #: ../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 "" #: ../src/intrinsics/numeric/gamma.md:28 msgid "$\\gamma(x) = (x-1)!$" msgstr "" #: ../src/intrinsics/numeric/gamma.md:30 msgid "In general, if $x > 0$:" msgstr "" #: ../src/intrinsics/numeric/gamma.md:32 msgid "$\\gamma(x) = \\int_{0}^{\\infty} e^{-t} dt$" msgstr "" #: ../src/intrinsics/numeric/gamma.md:34 msgid "and if $-n-1 < x < -n$ where n is an integer >= 0:" msgstr "" #: ../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 "" #: ../src/intrinsics/numeric/gamma.md:76 msgid "[epsilon](epsilon.md)" msgstr "" #: ../src/intrinsics/numeric/mod.md:1 msgid "mod(x, y): Modulus" msgstr "" #: ../src/intrinsics/numeric/mod.md:3 msgid "Modulus or remainder function." msgstr "" #: ../src/intrinsics/numeric/mod.md:17 msgid "`x` the input value, can be integer or real." msgstr "" #: ../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 "" #: ../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 "" #: ../src/intrinsics/numeric/mod.md:27 msgid "`x - INT (x / y) * y`." msgstr "" #: ../src/intrinsics/numeric/mod.md:29 msgid "If `y` is 0, the result is undefined like `any integer value / 0`." msgstr "" #: ../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 "" #: ../src/intrinsics/numeric/mod.md:36 msgid "`x - INT(x / y) * y`" msgstr "" #: ../src/intrinsics/numeric/mod.md:38 msgid "" "i.e., result is remainder when first argument is mathematically divided " "by second argument." msgstr "" #: ../src/intrinsics/numeric/mod.md:41 msgid "The return value should be less than `y`." msgstr "" #: ../src/language.md:1 msgid "Fortran Language" msgstr "" #: ../src/language.md:3 msgid "Background and Motivation" msgstr "" #: ../src/language.md:5 msgid "" "Fortran was designed from the ground up to naturally and simply translate" " mathematics to code that compiles and runs at maximum speed. And being " "specifically targeted for such fundamentally computational tasks, it " "contains a broad range of key functionality within the language itself, " "standard across all platforms, with no need for external libraries that " "may or may not be well optimized or maintained, at present or down the " "road." msgstr "" #: ../src/language.md:12 msgid "Some highlights:" msgstr "" #: ../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 "" #: ../src/language.md:17 msgid "" "Operators which operate naturally upon the aforementioned " "arrays/matrices, as they do scalars;" msgstr "" #: ../src/language.md:19 msgid "Complex numbers;" msgstr "" #: ../src/language.md:20 msgid "Special functions;" msgstr "" #: ../src/language.md:21 msgid "Structures and pointers for more general data representation." msgstr "" #: ../src/language.md:23 msgid "" "Because the essentials are contained in the language itself, it is simple" " to read and write, without need of choosing from among or deciphering a " "proliferation of external classes to do the same thing. And because the " "essentials are self-contained, compilers can provide detailed compile-" "time (e.g., argument mismatch) and run-time (e.g., memory access) checks," " as well as highly optimized executables, directly from natural, readable" " code without need of extensive optimization heroics by the developer." msgstr "" #: ../src/language.md:31 msgid "See our blog posts for more information:" msgstr "" #: ../src/language.md:33 msgid "" "[Why We Created LFortran](https://lfortran.org/blog/2019/04/why-we-" "created-lfortran/)" msgstr "" #: ../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 "" #: ../src/language.md:36 msgid "How to Learn Fortran" msgstr "" #: ../src/language.md:38 msgid "" "Fortran is relatively quick to learn because it is so much simpler and " "smaller than C/C++ (in practice, that is, with all needed libraries " "included). If you are interested in learning more, please see our webpage" " at [fortran90.org] with recommended practices for writing code, side by " "side comparison with Python/NumPy, links to other online Fortran " "resources and books, and an FAQ." msgstr "" #: ../src/progress.md:3 msgid "" "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:" msgstr "" #: ../src/progress.md:7 msgid "AST: The code can be parsed to AST (`lfortran --show-ast test.f90`)" msgstr "" #: ../src/progress.md:8 msgid "ASR: The code can be transformed to ASR (`lfortran --show-asr test.f90`)" msgstr "" #: ../src/progress.md:9 msgid "LLVM: LFortran can generate LLVM IR (`lfortran --show-llvm test.f90`)" msgstr "" #: ../src/progress.md:10 msgid "BIN: The LLVM IR can compile to a binary" msgstr "" #: ../src/progress.md:11 msgid "RUN: The binary runs without errors" msgstr "" #: ../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 "" #: ../src/progress.md:16 msgid "" "This page is generated automatically using the [Compiler " "Tester](https://gitlab.com/lfortran/compiler_tester) repository which " "contains all the Fortran tests and scripts to run LFortran to produce the" " tables below. We are looking for contributors to contribute more tests. " "Our goal is to have a comprehensive Fortran testsuite that can be used to" " test any Fortran compiler." msgstr "" #: ../src/progress.md:23 msgid "Testing the LFortran compiler version:" msgstr "" #: ../src/progress.md:32 msgid "Topics" msgstr "" #: ../src/progress.md:34 msgid "Full programs that compute something interesting" msgstr "" #: ../src/progress.md:36 msgid "Basic Numerics" msgstr "" #: ../src/progress.md:38 msgid "Directory: `tests/programs/numerics`" msgstr "" #: ../src/progress.md msgid "LLVM" msgstr "" #: ../src/progress.md msgid "BIN" msgstr "" #: ../src/progress.md msgid "RUN" msgstr "" #: ../src/progress.md msgid "Filename" msgstr "" #: ../src/progress.md msgid "`Pure Fortran sin(x) implementation`" msgstr "" #: ../src/progress.md msgid "✅" msgstr "" #: ../src/progress.md msgid "[t01_sin_implementation.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/programs/numerics/t01_sin_implementation.f90)" msgstr "" #: ../src/progress.md:45 msgid "Modules" msgstr "Модули" #: ../src/progress.md:47 msgid "Basic Usage" msgstr "" #: ../src/progress.md:49 msgid "Directory: `tests/modules/basic`" msgstr "" #: ../src/progress.md msgid "`Basic modules`" msgstr "" #: ../src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/basic/t01.f90)" msgstr "" #: ../src/progress.md:56 msgid "Module Functions and Subroutines" msgstr "" #: ../src/progress.md:58 msgid "Directory: `tests/modules/procedures`" msgstr "" #: ../src/progress.md msgid "`Module functions`" msgstr "" #: ../src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t01.f90)" msgstr "" #: ../src/progress.md msgid "`Module subroutines`" msgstr "" #: ../src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t02.f90)" msgstr "" #: ../src/progress.md msgid "`Nested subroutines`" msgstr "" #: ../src/progress.md msgid "[t03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t03.f90)" msgstr "" #: ../src/progress.md:67 msgid "Expressions" msgstr "ВыражениÑ" #: ../src/progress.md:69 msgid "Arithmetic Operations" msgstr "" #: ../src/progress.md:71 msgid "Directory: `tests/expressions/arit`" msgstr "" #: ../src/progress.md msgid "`+,-,*,/,**`" msgstr "" #: ../src/progress.md msgid "[basic_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/arit/basic_operations.f90)" msgstr "" #: ../src/progress.md:78 msgid "Integers" msgstr "" #: ../src/progress.md:80 msgid "Directory: `tests/expressions/integers`" msgstr "" #: ../src/progress.md msgid "`integers`" msgstr "" #: ../src/progress.md msgid "[integer_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/integer_kind.f90)" msgstr "" #: ../src/progress.md msgid "`relational operations`" msgstr "" #: ../src/progress.md msgid "[t01_rel_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/t01_rel_operations.f90)" msgstr "" #: ../src/progress.md msgid "`logical operations`" msgstr "" #: ../src/progress.md msgid "[t02_logical_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/t02_logical_operations.f90)" msgstr "" #: ../src/progress.md:89 msgid "Real Numbers" msgstr "" #: ../src/progress.md:91 msgid "Directory: `tests/expressions/reals`" msgstr "" #: ../src/progress.md msgid "`single/double reals`" msgstr "" #: ../src/progress.md msgid "[real_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/real_kind.f90)" msgstr "" #: ../src/progress.md msgid "`defined operator`" msgstr "" #: ../src/progress.md msgid "âŒ" msgstr "" #: ../src/progress.md msgid "[t01_def_op.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/t01_def_op.f90)" msgstr "" #: ../src/progress.md:99 msgid "Complex Numbers" msgstr "" #: ../src/progress.md:101 msgid "Directory: `tests/expressions/complex`" msgstr "" #: ../src/progress.md msgid "`single/double complex`" msgstr "" #: ../src/progress.md msgid "[complex_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/complex/complex_kind.f90)" msgstr "" #: ../src/progress.md:108 msgid "Strings" msgstr "" #: ../src/progress.md:110 msgid "Directory: `tests/expressions/character`" msgstr "" #: ../src/progress.md msgid "`character`" msgstr "" #: ../src/progress.md msgid "[t01_character.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t01_character.f90)" msgstr "" #: ../src/progress.md msgid "`string concatenation`" msgstr "" #: ../src/progress.md msgid "[t02_concat_operation.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t02_concat_operation.f90)" msgstr "" #: ../src/progress.md:118 msgid "Derived Types" msgstr "Производные типы данных" #: ../src/progress.md:120 msgid "Directory: `tests/expressions/derived_type`" msgstr "" #: ../src/progress.md msgid "`basic derived types`" msgstr "" #: ../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 "" #: ../src/progress.md:127 msgid "Statements" msgstr "" #: ../src/progress.md:129 msgid "Allocate Statement" msgstr "" #: ../src/progress.md:131 msgid "Directory: `tests/statements/allocate`" msgstr "" #: ../src/progress.md msgid "`allocate statement`" msgstr "" #: ../src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/allocate/t01.f90)" msgstr "" #: ../src/progress.md:138 msgid "Block Statement" msgstr "" #: ../src/progress.md:140 msgid "Directory: `tests/statements/block`" msgstr "" #: ../src/progress.md msgid "`block statement`" msgstr "" #: ../src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/block/t01.f90)" msgstr "" #: ../src/progress.md:147 msgid "Goto Statement" msgstr "" #: ../src/progress.md:149 msgid "Directory: `tests/statements/goto`" msgstr "" #: ../src/progress.md msgid "`computed go-to statement`" msgstr "" #: ../src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t01.f90)" msgstr "" #: ../src/progress.md msgid "`go-to statement`" msgstr "" #: ../src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t02.f90)" msgstr "" #: ../src/progress.md:157 msgid "If Statement" msgstr "" #: ../src/progress.md:159 msgid "Directory: `tests/statements/if`" msgstr "" #: ../src/progress.md msgid "`Test .false.`" msgstr "" #: ../src/progress.md msgid "[if_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_01.f90)" msgstr "" #: ../src/progress.md msgid "`single line if statement`" msgstr "" #: ../src/progress.md msgid "[if_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_02.f90)" msgstr "" #: ../src/progress.md msgid "`multi line if statement`" msgstr "" #: ../src/progress.md msgid "[if_03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_03.f90)" msgstr "" #: ../src/progress.md msgid "`nested if statements`" msgstr "" #: ../src/progress.md msgid "[if_04.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_04.f90)" msgstr "" #: ../src/progress.md:169 msgid "While Statement" msgstr "" #: ../src/progress.md:171 msgid "Directory: `tests/statements/while`" msgstr "" #: ../src/progress.md msgid "`Simple while loops`" msgstr "" #: ../src/progress.md msgid "[while_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_01.f90)" msgstr "" #: ../src/progress.md msgid "`exit / cycle in while loops`" msgstr "" #: ../src/progress.md msgid "[while_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_02.f90)" msgstr "" #: ../src/progress.md:179 msgid "Print Statement" msgstr "" #: ../src/progress.md:181 msgid "Directory: `tests/statements/print`" msgstr "" #: ../src/progress.md msgid "`Basic print`" msgstr "" #: ../src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/print/t01.f90)" msgstr "" #: ../src/progress.md:188 msgid "Open, Read, Write, Close Statement" msgstr "" #: ../src/progress.md:190 msgid "Directory: `tests/statements/file_io`" msgstr "" #: ../src/progress.md msgid "`open/read/write/close`" msgstr "" #: ../src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/file_io/t01.f90)" msgstr "" #: ../src/progress.md:197 msgid "Intrinsic Functions" msgstr "" #: ../src/progress.md:199 msgid "abs" msgstr "" #: ../src/progress.md:201 msgid "Directory: `tests/intrinsic/abs`" msgstr "" #: ../src/progress.md msgid "`scalar single/double real`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md msgid "`scalar single/double complex`" msgstr "" #: ../src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t02_scalar_complex.f90)" msgstr "" #: ../src/progress.md msgid "`array 1D single/double real`" msgstr "" #: ../src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t03_array1d_real.f90)" msgstr "" #: ../src/progress.md:210 msgid "exp" msgstr "" #: ../src/progress.md:212 msgid "Directory: `tests/intrinsic/exp`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t02_scalar_complex.f90)" msgstr "" #: ../src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t03_array1d_real.f90)" msgstr "" #: ../src/progress.md:221 msgid "log" msgstr "" #: ../src/progress.md:223 msgid "Directory: `tests/intrinsic/log`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t02_scalar_complex.f90)" msgstr "" #: ../src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t03_array1d_real.f90)" msgstr "" #: ../src/progress.md:232 msgid "sqrt" msgstr "" #: ../src/progress.md:234 msgid "Directory: `tests/intrinsic/sqrt`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t02_scalar_complex.f90)" msgstr "" #: ../src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t03_array1d_real.f90)" msgstr "" #: ../src/progress.md:243 msgid "sin" msgstr "" #: ../src/progress.md:245 msgid "Directory: `tests/intrinsic/sin`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t02_scalar_complex.f90)" msgstr "" #: ../src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t03_array1d_real.f90)" msgstr "" #: ../src/progress.md:254 msgid "cos" msgstr "" #: ../src/progress.md:256 msgid "Directory: `tests/intrinsic/cos`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t02_scalar_complex.f90)" msgstr "" #: ../src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t03_array1d_real.f90)" msgstr "" #: ../src/progress.md:265 msgid "tan" msgstr "" #: ../src/progress.md:267 msgid "Directory: `tests/intrinsic/tan`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t02_scalar_complex.f90)" msgstr "" #: ../src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t03_array1d_real.f90)" msgstr "" #: ../src/progress.md:276 msgid "sinh" msgstr "" #: ../src/progress.md:278 msgid "Directory: `tests/intrinsic/sinh`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t02_scalar_complex.f90)" msgstr "" #: ../src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t03_array1d_real.f90)" msgstr "" #: ../src/progress.md:287 msgid "cosh" msgstr "" #: ../src/progress.md:289 msgid "Directory: `tests/intrinsic/cosh`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t02_scalar_complex.f90)" msgstr "" #: ../src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t03_array1d_real.f90)" msgstr "" #: ../src/progress.md:298 msgid "tanh" msgstr "" #: ../src/progress.md:300 msgid "Directory: `tests/intrinsic/tanh`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t02_scalar_complex.f90)" msgstr "" #: ../src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t03_array1d_real.f90)" msgstr "" #: ../src/progress.md:309 msgid "asin" msgstr "" #: ../src/progress.md:311 msgid "Directory: `tests/intrinsic/asin`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t02_scalar_complex.f90)" msgstr "" #: ../src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t03_array1d_real.f90)" msgstr "" #: ../src/progress.md:320 msgid "acos" msgstr "" #: ../src/progress.md:322 msgid "Directory: `tests/intrinsic/acos`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t02_scalar_complex.f90)" msgstr "" #: ../src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t03_array1d_real.f90)" msgstr "" #: ../src/progress.md:331 msgid "atan" msgstr "" #: ../src/progress.md:333 msgid "Directory: `tests/intrinsic/atan`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t02_scalar_complex.f90)" msgstr "" #: ../src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t03_array1d_real.f90)" msgstr "" #: ../src/progress.md:342 msgid "modulo" msgstr "" #: ../src/progress.md:344 msgid "Directory: `tests/intrinsic/modulo`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/modulo/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/modulo/t03_array1d_real.f90)" msgstr "" #: ../src/progress.md:352 msgid "mod" msgstr "" #: ../src/progress.md:354 msgid "Directory: `tests/intrinsic/mod`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/mod/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/mod/t03_array1d_real.f90)" msgstr "" #: ../src/progress.md:362 msgid "min" msgstr "" #: ../src/progress.md:364 msgid "Directory: `tests/intrinsic/min`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/min/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md:371 msgid "max" msgstr "" #: ../src/progress.md:373 msgid "Directory: `tests/intrinsic/max`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/max/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md:380 msgid "int" msgstr "" #: ../src/progress.md:382 msgid "Directory: `tests/intrinsic/int`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/int/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md:389 msgid "real" msgstr "" #: ../src/progress.md:391 msgid "Directory: `tests/intrinsic/real`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/real/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md:398 msgid "floor" msgstr "" #: ../src/progress.md:400 msgid "Directory: `tests/intrinsic/floor`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/floor/t01_scalar_real.f90)" msgstr "" #: ../src/progress.md:407 msgid "nint" msgstr "" #: ../src/progress.md:409 msgid "Directory: `tests/intrinsic/nint`" msgstr "" #: ../src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/nint/t01_scalar_real.f90)" msgstr "" lfortran-0.63.0/doc/locale/pt/0000775000175000017500000000000015174404631016247 5ustar alastairalastairlfortran-0.63.0/doc/locale/pt/LC_MESSAGES/0000775000175000017500000000000015174404631020034 5ustar alastairalastairlfortran-0.63.0/doc/locale/pt/LC_MESSAGES/docs.po0000664000175000017500000050601715174404631021335 0ustar alastairalastair# SOME DESCRIPTIVE TITLE. # Copyright (C) 2022 LFortran contributors # This file is distributed under the same license as the LFortran package. # FIRST AUTHOR , 2022. # msgid "" msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" "PO-Revision-Date: 2023-01-12 15:52+0000\n" "Last-Translator: ssantos \n" "Language-Team: Portuguese \n" "Language: pt\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.15.1-dev\n" "Generated-By: Babel 2.10.3\n" #: ../../doc/src/ast_and_asr.ipynb:9 msgid "Difference between an AST and ASR" msgstr "Diferenças entre uma AST e uma ASR" #: ../../doc/src/ast_and_asr.ipynb:11 msgid "Let us take a simple Fortran code:" msgstr "Tomemos um simples código Fortran:" #: ../../doc/src/ast_and_asr.ipynb:22 msgid "and look at how the AST and ASR looks like." msgstr "e veja como são a AST e a ASR." #: ../../doc/src/ast_and_asr.ipynb:25 ../../doc/src/progress.md msgid "AST" msgstr "AST" #: ../../doc/src/ast_and_asr.ipynb:76 msgid "" "The AST does not have any semantic information, but has nodes to " "represent declarations such as ``integer, intent(in) :: a``. Variables " "such as ``a`` are represented by a ``Name`` node, and are not connected " "to their declarations yet." msgstr "" "A AST não possui nenhuma informação semântica, mas sim \"nós\" que " "representam declarações do tipo ``integer, intent(in) :: a``. Variáveis como " "``a`` são representadas pelo nó ``Name`` e ainda não estão conectadas às " "suas declarações." #: ../../doc/src/ast_and_asr.ipynb:88 ../../doc/src/progress.md msgid "ASR" msgstr "ASR" #: ../../doc/src/ast_and_asr.ipynb:139 msgid "" "The ASR has all the semantic information (types, etc.), nodes like " "``Function`` have a symbol table and do not have any declaration nodes. " "Variables are simply pointers to the symbol table." msgstr "" "Uma ASR possui toda a informação semântica (tipos, etc.), nós do tipo " "``Function`` possuem uma tabela de símbolos e não tem nenhuma nó de " "declaração. Variáveis são simplesmente ponteiros para a tabela de símbolos." #: ../../doc/src/ast_and_asr.ipynb:142 msgid "Discussion" msgstr "Discussão" #: ../../doc/src/ast_and_asr.ipynb:144 msgid "" "The above was a simple example. Things get more apparent for more " "complicated examples, such as:" msgstr "" "O exemplo acima foi simples. As coisas ficam mais evidentes para exemplos " "mais complicados, como:" #: ../../doc/src/ast_and_asr.ipynb:160 msgid "" "AST must represent all the ``use`` statements and the ``interface`` " "block, and keep things semantically consistent." msgstr "" "As AST devem representar todos os comandos ``use`` e blocos de ``interface``" ", bem como manter as coisas semanticamente consistentes." #: ../../doc/src/ast_and_asr.ipynb:162 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" " are defined in the ``gfort_interop`` module, and so ASR does not have " "any of these declaration nodes." msgstr "" "As ASR, por outro lado, devem manter os registros de ``c_desc1_int32``, " "``c_desc1_t`` e ``f2b_c_wrapper`` na tabela de símbolos e sabe que eles " "foram definidos no módulo ``gfort_interop`` e portanto a ASR não possui " "nenhuma desses nós de declaração." #: ../../doc/src/ast_and_asr.ipynb:164 msgid "" "When converting from ASR to AST, LFortran will create all the appropriate" " AST declaration nodes automatically and correctly." msgstr "" "Ao converter uma ASR em uma AST, o LFortran criará todos os nós de " "declaração da AST apropriados de forma automática e correta." #: ../../doc/src/contributing.md:1 msgid "Contributing" msgstr "Contribuindo" #: ../../doc/src/contributing.md:3 msgid "" "We welcome contributions from anyone, even if you are new to open source." " It might sound daunting to contribute to a compiler at first, but please" " do, it is not complicated. We will help you with any technical issues " "and help improve your contribution so that it can be merged." msgstr "" "Aceitamos contribuições de qualquer pessoa, mesmo se você é novo(a) ao mundo " "do código fonte aberto. Pode parecer assustador contribuir com um compilador " "logo no início, mas por favor o faça, não é complicado. Vamos te ajudar com " "qualquer problema técnico e ajudar com sua contribuição até que esta seja " "implementada." #: ../../doc/src/contributing.md:8 msgid "Basic Setup" msgstr "Configuração Básica" #: ../../doc/src/contributing.md:10 msgid "To contribute, make sure your set up:" msgstr "Para contribuir, certifique-se de sua configuração:" #: ../../doc/src/contributing.md:12 msgid "Your username + email" msgstr "Seu nome de usuário + e-mail" #: ../../doc/src/contributing.md:13 msgid "Your `~/.gitconfig`" msgstr "Seu `~/.gitconfig`" #: ../../doc/src/contributing.md:14 msgid "Your shell prompt to display the current branch name" msgstr "Seu prompt de shell para exibir o nome atual do branch" #: ../../doc/src/contributing.md:16 msgid "Fork LFortran" msgstr "Fork o LFortran" #: ../../doc/src/contributing.md:18 msgid "" "Step 1. Create a fork of the [project " "repository](https://github.com/lfortran/lfortran)" msgstr "" "Passo 1. Crie um fork do [repositório do projeto](https://github.com/" "lfortran/lfortran)" #: ../../doc/src/contributing.md:20 msgid "" "Step 2. Set up your [SSH key](https://docs.github.com/en/authentication" "/connecting-to-github-with-ssh) with GitHub" msgstr "" "Passo 2. Configure sua [chave SSH](https://docs.github.com/en/authentication/" "connecting-to-github-with-ssh) no GitHub" #: ../../doc/src/contributing.md:22 msgid "" "Step 3. Clone the project repository from GitHub and set up your remote " "repository" msgstr "" "Passo 3. Clone o repositório do projeto a partir do GitHub e configure seu " "repositório remoto" #: ../../doc/src/contributing.md:29 msgid "" ":fontawesome-solid-edit: `REMOTE_NAME` is the name of your remote " "repository and could be any name you like, for example your first name." msgstr "" ":fontawesome-solid-edit: `REMOTE_NAME` é o nome do seu repositório remoto e " "pode ser qualquer nome que você queira, por exemplo seu primeiro nome." #: ../../doc/src/contributing.md:31 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` é a sua identificação de usuário " "no GitHub e deve ser parte do caminho da sua conta." #: ../../doc/src/contributing.md:33 msgid "" "You can use `git remote -v` to check if the new remote is set up " "correctly." msgstr "" "Você pode usar `git remote -v`para checar se o novo repositório está " "configurado corretamente." #: ../../doc/src/contributing.md:35 msgid "Send a New Merge Request" msgstr "Envie uma nova requisição de Merge" #: ../../doc/src/contributing.md:37 msgid "Step 1. Create a new branch" msgstr "Passo 1. Crie um novo ramo" #: ../../doc/src/contributing.md:42 msgid "Step 2. Make changes in relevant file(s)" msgstr "Passo 3. Faça mudanças no(s) ficheiro(s) relevante(s)" #: ../../doc/src/contributing.md:44 msgid "Step 3. Commit the changes:" msgstr "Passo 3. Realize o commit de suas mudanças:" #: ../../doc/src/contributing.md:51 msgid "" "[Here](https://chris.beams.io/posts/git-commit/) are some great tips on " "writing good commit messages." msgstr "" "[Veja aqui](https://chris.beams.io/posts/git-commit/) algumas dicas " "excelentes sobre como escrever boas mensagens de commit." #: ../../doc/src/contributing.md:53 msgid "Step 4. Check to ensure that your changes look good" msgstr "Passo 4. Se assegure de que suas mudanças estão boas" #: ../../doc/src/contributing.md:58 msgid "Step 5. Send the merge request" msgstr "Passo 5. Envie o pedido de merge" #: ../../doc/src/contributing.md:64 msgid "" "The command will push the new branch `fix1` into your remote repository " "`REMOTE_NAME` that you created earlier. Additionally, it will also " "display a link that you can click on to open the new merge request. After" " clicking on the link, write a title and a concise description then click" " the \"Create\" button. Yay you are now all set." msgstr "" "O comando irá enviar o novo ramo `fix1` para o seu repositório remoto " "`REMOTE_NAME` que você criou anteriormente. Além disso, será mostrado um " "link que você pode clicar para abrir o novo pedido de merge. Após clicar no " "link, escreva um título com uma descrição breve e clique em no botão \"Create" "\". Uhull! Agora está tudo pronto." #: ../../doc/src/contributing.md:66 msgid "Add New Features" msgstr "Adicionar Novos Recursos" #: ../../doc/src/contributing.md:68 msgid "" "The example below shows the steps it would take to create a caret binary " "operator **^** which computes the average value of the two operands." msgstr "" "O exemplo abaixo mostra os passos que seriam necessários para criar o " "operador binário **^** que calcula o valor médio dos dois operandos." #: ../../doc/src/contributing.md:70 msgid "Create New Token(s)" msgstr "Crie Novos Tokens" #: ../../doc/src/contributing.md:72 msgid "" "We extend the *tokenizer.re* as well as *parser.yy* to add the new token " "**^**. We also tell LFortran how to print the new token in *parser.cpp*." msgstr "" "Estendemos o *tokenizer.re* bem como o *parser.yy* de modo a adicionar o " "novo token **^**. Também dizemos ao LFortran como ele deve mostrar na tela o " "novo token no arquivo *parser.cpp*." #: ../../doc/src/contributing.md:75 msgid ":fontawesome-solid-code: *src/lfortran/parser/tokenizer.re*" msgstr ":fontawesome-solid-code: *src/lfortran/parser/tokenizer.re*" #: ../../doc/src/contributing.md:80 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.yy*" msgstr ":fontawesome-solid-code: *src/lfortran/parser/parser.yy*" #: ../../doc/src/contributing.md:85 msgid ":fontawesome-solid-code: *src/lfortran/parser/parser.cpp*" msgstr ":fontawesome-solid-code: *src/lfortran/parser/parser.cpp*" #: ../../doc/src/contributing.md:94 msgid "The added code is tested with `lfortran --show-tokens examples2/expr2.f90`" msgstr "" "O código adicionado é testado com o comando `lfortran --show-tokens " "examples2/expr2.f90`" #: ../../doc/src/contributing.md:96 msgid "Parse the New Token" msgstr "Realize o Parsing do Novo Token" #: ../../doc/src/contributing.md:98 msgid "" "Now we have to parse the new operator. We add it to the AST by extending " "the BinOp with a caret operator and modifying the *AST.asdl* file. Then " "we add it in *parse.yy* to properly parse and generate the new AST in " "*semantics.h*.Finally we extend *pickle.cpp* so that the new operator can" " print itself." msgstr "" "Agora temos que fazer o parsing do novo operador. Adicionamo-lo à AST ao " "extender o BinOp com o operador \"chapéu\" ao modificar o ficheiro *AST.asdl*" ". Então, colocamos-o no *parse.yy* para realizar o parsing apropriadamente e " "gerar a nova AST em *semantics.h*. Por fim, estendemos o ficheiro *pickle." "cpp* para que o novo operador possa ser mostrado." #: ../../doc/src/contributing.md:102 msgid ":fontawesome-solid-code:*grammar/AST.asdl*" msgstr ":fontawesome-solid-code:*grammar/AST.asdl*" #: ../../doc/src/contributing.md:107 msgid ":fontawesome-solid-code:*src/lfortran/parser/parser.yy*" msgstr ":fontawesome-solid-code:*src/lfortran/parser/parser.yy*" #: ../../doc/src/contributing.md:116 msgid ":fontawesome-solid-code:*src/lfortran/parser/semantics.h*" msgstr ":fontawesome-solid-code:*src/lfortran/parser/semantics.h*" #: ../../doc/src/contributing.md:121 msgid ":fontawesome-solid-code:*src/lfortran/pickle.cpp*" msgstr ":fontawesome-solid-code:*src/lfortran/pickle.cpp*" #: ../../doc/src/contributing.md:132 msgid "The section is tested with `lfortran --show-ast examples/expr2.f90`" msgstr "" "Esta seção é testada usando o comando `lfortran --show-ast examples/expr2." "f90`" #: ../../doc/src/contributing.md:134 msgid "Implement the Semantics of the New Token" msgstr "Implementar a Semântica do Novo Token" #: ../../doc/src/contributing.md:136 msgid "" "We first extend the ASR in *ASR.asdl* and add ^ as a BinOp operator " "option." msgstr "" "Primeiro estendemos a ASR em *ASR.asdl* e adicionamos o \"^\" como um " "operador do tipo BinOp." #: ../../doc/src/contributing.md:138 msgid ":fontawesome-solid-code:*src/libasr/ASR.asdl*" msgstr ":fontawesome-solid-code:*src/libasr/ASR.asdl*" #: ../../doc/src/contributing.md:142 msgid ":fontawesome-solid-code:*src/lfortran/semantics/ast_common_visitor.h*" msgstr ":fontawesome-solid-code:*src/lfortran/semantics/ast_common_visitor.h*" #: ../../doc/src/contributing.md:179 msgid "" "Then we transform it from AST to ASR by extending " "*src/lfortran/semantics/ast_common_visitor.h*." msgstr "" "Então, transformamos da AST para a ASR editando o arquivo *src/lfortran/" "semantics/ast_common_visitor.h*." #: ../../doc/src/contributing.md:181 msgid "" "We also add it into compile time evaluation triggered by expressions such" " as `e = (2+3)^5` which is evaluated at compile time. An expression such " "as `e = x^5` is evaluated at run time only." msgstr "" "Também o adicionamos para avaliação de expressões em tempo de compilação " "como `e = (2+3)^5` que é calculado em tempo de compilação. Uma expressão " "como `e = x^5` é calculada apenas em tempo de execução." #: ../../doc/src/contributing.md:183 msgid "The section is tested with `lfortran --show-asr examples/expr2.f90`" 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 "Implemente o Novo Token no LLVM" #: ../../doc/src/contributing.md:186 msgid "" "To implement in LLVM, we extend the BinOp translation by handling the new" " operator. We first add the two numbers then divide by two. :fontawesome-" "solid-code:*src/lfortran/codegen/asr_to_llvm.cpp*" 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 "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 "O que deve mostrar na tela 6." #: ../../doc/src/contributing.md:226 msgid "It also works interactively:" msgstr "Também funciona interativamente:" #: ../../doc/src/contributing.md:242 msgid "Reach Out" msgstr "Entre em contato" #: ../../doc/src/contributing.md:244 msgid "" "If you have any questions or need help, please ask as at our " "[mailinglist](https://groups.io/g/lfortran) or a " "[chat](https://lfortran.zulipchat.com/)." 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 "" "Please note that all participants of this project are expected to follow " "our Code of Conduct. By participating in this project you agree to abide " "by its terms. See " "[CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/blob/main/CODE_OF_CONDUCT.md)." 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 "" "By submitting a PR you agree to license your contribution under the " "LFortran's BSD " "[license](https://github.com/lfortran/lfortran/blob/main/LICENSE) unless " "explicitly noted otherwise." 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 "Design do LFortran" #: ../../doc/src/design.md:3 msgid "High Level Overview" msgstr "Visão Geral de Alto Nível" #: ../../doc/src/design.md:5 ../../doc/src/developer_tutorial.ipynb:16 msgid "" "LFortran is structured around two independent modules, AST and ASR, both " "of which are standalone (completely independent of the rest of LFortran) " "and users are encouraged to use them independently for other applications" " and build tools on top:" 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 "" "Abstract Syntax Tree (AST), module `lfortran.ast`: Represents any Fortran" " source code, strictly based on syntax, no semantic is included. The AST " "module can convert itself to Fortran source code." 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 "" "Abstract Semantic Representation (ASR), module `lfortran.asr`: Represents" " a valid Fortran source code, all semantic is included. Invalid Fortran " "code is not allowed (an error will be given). The ASR module can convert " "itself to an AST." 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 "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 "Semântica: converte uma AST em uma ASR" #: ../../doc/src/design.md:23 msgid "" "High level optimizations: optimize ASR to a possibly faster/simpler ASR " "(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 "" "LLVM IR code generation and lower level optimizations: converts an ASR to" " an LLVM IR. This stage also does all other optimizations that do not " "produce an ASR, but still make sense to do before passing to LLVM IR." 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 "" "Machine code generation: LLVM then does all its optimizations and " "generates machine code (such as a binary executable, a library, an object" " file, or it is loaded and executed using JIT as part of the interactive " "LFortran session or in a Jupyter kernel)." 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 ficheiro 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 "" "LFortran is structured as a library, and so one can for example use the " "parser to obtain an AST and do something with it, or one can then use the" " semantic analyzer to obtain ASR and do something with it. One can " "generate the ASR directly (e.g., from SymPy) and then either convert to " "AST and to a Fortran source code, or use LFortran to compile it to " "machine code directly. In other words, one can use LFortran to easily " "convert between the three equivalent representations:" 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 "Código-fonte em Fortran" #: ../../doc/src/design.md:43 ../../doc/src/developer_tutorial.ipynb:23 msgid "Abstract Syntax Tree (AST)" msgstr "Ãrvore de Sintaxe Abstrata (AST)" #: ../../doc/src/design.md:44 ../../doc/src/developer_tutorial.ipynb:159 msgid "Abstract Semantic Representation (ASR)" msgstr "Representação Semântica Abstrata (ASR)" #: ../../doc/src/design.md:46 msgid "They are all equivalent in the following sense:" 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 "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 "Detalhes do design da ASR" #: ../../doc/src/design.md:60 msgid "The ASR is designed to have the following features:" msgstr "A ASR foi imaginada para ter os seguintes recursos:" #: ../../doc/src/design.md:62 msgid "" "ASR is still semantically equivalent to the original Fortran code (it did" " not lose any semantic information). ASR can be converted to AST, and AST" " to Fortran source code which is functionally equivalent to the original." 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 "" "The ASR C++ classes (down the road) are designed similarly to SymEngine: " "they are constructed once and after that they are immutable. The " "constructor checks in Debug more that all the requirements are met (e.g.," " that all Variables in a Function have a dummy argument set, that " "explicit-shape arrays are not allocatable and all other Fortran " "requirements to make it a valid code), but in Release mode it quickly " "constructs the class without checks. Then there are builder classes that " "construct the ASR C++ classes to meet requirements (checked in Debug " "mode) and the builder gives an error message if a code is not a valid " "Fortran code, and if it doesn't give an error message, then the ASR C++ " "classes are constructed correctly. Thus by construction, the ASR classes " "always contain valid Fortran code and the rest of LFortran can depend on " "it." msgstr "" #: ../../doc/src/design.md:82 msgid "Notes:" msgstr "Notas:" #: ../../doc/src/design.md:84 msgid "" "Information that is lost when parsing source to AST: whitespace, " "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 "" "Information that is lost when going from AST to ASR: detailed syntax how " "variables were defined and the order of type attributes (whether array " "dimension is using the `dimension` attribute, or parentheses at the " "variable; or how many variables there are per declaration line or their " "order), as ASR only represents the aggregated type information in the " "symbol table." 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 "" "ASR is the simplest way to generate Fortran code, as one does not have to" " worry about the detailed syntax (as in AST) about how and where things " "are declared. One specifies the symbol table for a module, then for each " "symbol (functions, global variables, types, ...) one specifies the local " "variables and if this is an interface then one needs to specify where one" " can find an implementation, otherwise a body is supplied with " "statements, those nodes are almost the same as in AST, except that each " "variable is just a reference to a symbol in the symbol table (so by " "construction one cannot have undefined variables). The symbol table for " "each node such as Function or Module also references its parent (for " "example a function references a module, a module references the global " "scope)." msgstr "" #: ../../doc/src/design.md:102 msgid "" "The ASR can be directly converted to an AST without gathering any other " "information. And the AST directly to Fortran source code." msgstr "" #: ../../doc/src/design.md:105 msgid "" "The ASR is always representing a semantically valid Fortran code. This " "is enforced by checks in the ASR C++ constructors (in Debug build). When " "an ASR is used, one can assume it is valid." msgstr "" #: ../../doc/src/design.md:109 msgid "Fortran 2008" msgstr "Fortran 2008" #: ../../doc/src/design.md:111 msgid "" "Fortran 2008 [standard](https://j3-fortran.org/doc/year/10/10-007.pdf) " "chapter 2 \"Fortran concepts\" specifies that Fortran code is a " "collection of _program units_ (either all in one file, or in separate " "files), where each _program unit_ is one of:" msgstr "" #: ../../doc/src/design.md:116 ../../doc/src/design.md:131 msgid "main program" msgstr "Programa principal" #: ../../doc/src/design.md:117 ../../doc/src/design.md:132 msgid "module or submodule" msgstr "módulo ou submódulo" #: ../../doc/src/design.md:118 ../../doc/src/design.md:133 msgid "function or subroutine" msgstr "função ou sub-rotina" #: ../../doc/src/design.md:120 msgid "" "Note: It can also be a _block data_ program unit, that is used to provide" " initial values for data objects in named _common blocks_, but we do not " "recommend the use of _common blocks_ (use modules instead)." msgstr "" #: ../../doc/src/design.md:124 msgid "LFortran Extension" msgstr "Extensão do LFortran" #: ../../doc/src/design.md:126 msgid "" "We extend the Fortran language by introducing a _global scope_, which is " "not only the list of _program units_ (as in F2008) but can also include " "statements, declarations, use statements and expressions. We define " "_global scope_ as a collection of the following items:" msgstr "" #: ../../doc/src/design.md:134 msgid "use statement" msgstr "comando use" #: ../../doc/src/design.md:135 msgid "declaration" msgstr "declaração" #: ../../doc/src/design.md:136 msgid "statement" msgstr "comando" #: ../../doc/src/design.md:137 msgid "expression" msgstr "expressão" #: ../../doc/src/design.md:139 msgid "" "In addition, if a variable is not defined in an assignment statement " "(such as `x = 5+3`) then the type of the variable is inferred from the " "right hand side (e.g., `x` in `x = 5+3` would be of type `integer`, and " "`y` in `y = 5._dp` would be of type `real(dp)`). This rule only applies " "at the top level of _global scope_. Types must be fully specified inside " "main programs, modules, functions and subroutines, just like in F2008." msgstr "" #: ../../doc/src/design.md:146 msgid "" "The _global scope_ has its own symbol table. The main program and " "module/submodule do not see any symbols from this symbol table. But " "functions, subroutines, statements and expressions at the top level of " "_global scope_ use and operate on this symbol table." msgstr "" #: ../../doc/src/design.md:151 msgid "" "The _global scope_ has the following symbols predefined in the symbol " "table:" msgstr "" #: ../../doc/src/design.md:153 msgid "" "the usual standard set of Fortran functions (such as `size`, `sin`, " "`cos`, ...)" msgstr "" #: ../../doc/src/design.md:155 msgid "" "the `dp` double precision symbol, so that one can use `5._dp` for double " "precision." msgstr "" #: ../../doc/src/design.md:158 msgid "" "Each item in the _global scope_ is interpreted as follows: main program " "is compiled into an executable with the same name and executed; modules, " "functions and subroutines are compiled and loaded; use statement and " "declaration adds those symbols with the proper type into the _global " "scope_ symbol table, but do not generate any code; statement is wrapped " "into an anonymous subroutine with no arguments, compiled, loaded and " "executed; expression is wrapped into an anonymous function with no " "arguments returning the expression, compiled, loaded, executed and the " "return value is returned to the user." msgstr "" #: ../../doc/src/design.md:168 msgid "" "The _global scope_ is always interpreted, item by item, per the previous " "paragraph. It is meant to allow interactive usage, experimentations and " "writing simple scripts. Code in _global scope_ must be interpreted using " "`lfortran`. For more complex (production) code it is recommended to turn " "it into modules and programs (by wrapping loose statements into " "subroutines or functions and by adding type declarations) and compile it " "with `lfortran` or any other Fortran compiler." msgstr "" #: ../../doc/src/design.md:176 msgid "Here are some examples of valid code in _global scope_:" msgstr "" #: ../../doc/src/design.md:178 msgid "Example 1" msgstr "Exemplo 1" #: ../../doc/src/design.md:185 msgid "Example 2" msgstr "Exemplo 2" #: ../../doc/src/design.md:197 msgid "Example 3" msgstr "Exemplo 3" #: ../../doc/src/design.md:209 msgid "Example 4" msgstr "Exemplo 4" #: ../../doc/src/design.md:217 msgid "Design Considerations" msgstr "Considerações de Design" #: ../../doc/src/design.md:219 msgid "" "The LFortran extension of Fortran was chosen in a way so as to minimize " "the number of changes. In particular, only the top level of the _global " "scope_ has relaxed some of the Fortran rules (such as making specifying " "types optional) so as to allow simple and quick interactive usage, but " "inside functions, subroutines, modules or programs this relaxation does " "not apply." msgstr "" #: ../../doc/src/design.md:225 msgid "" "The number of changes were kept to minimum in order to make it " "straightforward to turn code at _global scope_ into standard compliant " "Fortran code using programs and modules, so that it can be compiled by " "any Fortran compiler." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:9 msgid "Developer Tutorial" msgstr "Tutorial de Desenvolvedor" #: ../../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 "" #: ../../doc/src/developer_tutorial.ipynb:14 msgid "Introduction" msgstr "Introdução" #: ../../doc/src/developer_tutorial.ipynb:18 msgid "" "Abstract Syntax Tree (AST): Represents any Fortran source code, strictly " "based on syntax, no semantic is included. The AST module can convert " "itself to Fortran source code." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:20 msgid "" "Abstract Semantic Representation (ASR): Represents a valid Fortran source" " code, all semantic is included. Invalid Fortran code is not allowed (an " "error will be given). The ASR module can convert itself to an AST." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:25 msgid "" "Fortran source code can be parsed into an AST using the ``src_to_ast()`` " "function:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:49 #, python-format msgid "We can pretty print it using the ``%%showast`` magic:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:98 #, python-format msgid "We can convert AST to Fortran source code using ``%%showfmt``:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:156 msgid "" "All AST nodes and their arguments are described in `AST.asdl " "`__." msgstr "" #: ../../doc/src/developer_tutorial.ipynb:170 #, python-format msgid "We can pretty print using the ``%%showasr`` magic:" msgstr "" #: ../../doc/src/developer_tutorial.ipynb:219 msgid "" "All ASR nodes and their arguments are described in `ASR.asdl " "`__." msgstr "" #: ../../doc/src/index.md:134 msgid "Getting started" msgstr "Começando" #: ../../doc/src/index.md:141 ../../doc/src/progress.md:1 msgid "LFortran Development Status" msgstr "Progresso no Desenvolvimento do LFortran" #: ../../doc/src/index.md:147 msgid "Developer's Guide" msgstr "Guia do Desenvolvedor" #: ../../doc/src/index.md:156 msgid "LFortran Intrinsics" msgstr "Funções Intrínsecas do LFortran" #: ../../doc/src/index.md:1 msgid "LFortran Documentation" msgstr "Documentação do LFortran" #: ../../doc/src/index.md:3 msgid "" "LFortran is a modern open-source (BSD licensed) interactive Fortran " "compiler built on top of LLVM. It can execute user's code interactively " "to allow exploratory work (much like Python, MATLAB or Julia) as well as " "compile to binaries with the goal to run user's code on modern " "architectures such as multi-core CPUs and GPUs." msgstr "" #: ../../doc/src/index.md:9 #, python-format msgid "" "Website: [https://lfortran.org/](https://lfortran.org/) Main " "repository: " "[https://github.com/lfortran/lfortran](https://github.com/lfortran/lfortran)" " Try online using Binder: " "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb)" msgstr "" #: ../../doc/src/index.md:9 msgid "Binder" msgstr "Binder" #: ../../doc/src/index.md:16 msgid "Feature Highlights" msgstr "Recursos em Destaque" #: ../../doc/src/index.md:18 msgid "" "LFortran is in development, there are features that work today, and there" " are features that are being implemented. You can also check out the " "[Development Status](progress.md) section for more information on " "features being supported and being worked on." msgstr "" #: ../../doc/src/index.md:21 msgid "Works today" msgstr "Funciona atualmente" #: ../../doc/src/index.md:23 #, python-format msgid "" "**Interactive, Jupyter support** LFortran can be used from Jupyter as a" " Fortran kernel, allowing a Python/Julia style rapid prototyping and " "exploratory workflow (see the " "[static](https://nbviewer.jupyter.org/gist/certik/f1d28a486510810d824869ab0c491b1c)" " or [interactive](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb) example notebook). Or " "it can be used from the command-line in an interactive prompt (REPL)." msgstr "" #: ../../doc/src/index.md:32 msgid "" "**Clean, modular design, usable as a library** LFortran is structured " "around two independent modules, AST and ASR, both of which are " "standalone (completely independent of the rest of LFortran) and users " "are encouraged to use them independently for other applications and " "build tools on top. See the [Design](design.md) and [Developer " "Tutorial](developer_tutorial.md) documents for more details." msgstr "" #: ../../doc/src/index.md:39 msgid "" "**Interoperation with GFortran** LFortran can parse GFortran module " "files into an ASR and generate a Fortran wrapper that can be compiled " "with any Fortran compiler and linked with the original GFortran " "compiled module." msgstr "" #: ../../doc/src/index.md:44 msgid "" "**Create executables** It can create executables just like other " "Fortran compilers." msgstr "" #: ../../doc/src/index.md:47 msgid "" "**Runs on Linux, Mac and Windows** All three platforms are regularly " "tested by our CI." msgstr "" #: ../../doc/src/index.md:51 msgid "Planned" msgstr "Planejado" #: ../../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 "" #: ../../doc/src/index.md:56 msgid "" "**Native interoperation with other languages (and other Fortran " "compilers)** It can automatically call code written in other languages " "(such as C or Python) just by using the `use` statement, see " "[#44](https://gitlab.com/lfortran/lfortran/issues/44). It understands " "other Fortran compilers module files (one can just \"use\" them) and " "their ABI to link correctly (GFortran is supported, other compilers are" " planned, see [#56](https://gitlab.com/lfortran/lfortran/issues/56)), " "which allows to use LFortran with production codes today." msgstr "" #: ../../doc/src/index.md:65 msgid "" "**Modern hardware support** Thanks to LLVM, the goal of LFortran is to " "run on modern hardware and take advantage of native Fortran language " "constructs (such as `do concurrent`) to run on multi-core CPUs and " "GPUs, see [#57](https://gitlab.com/lfortran/lfortran/issues/57)." msgstr "" #: ../../doc/src/index.md:71 msgid "" "**Full Fortran 2018 support** Currently only a subset of Fortran is " "implemented, but the goal is to have a full implementation of the " "latest Fortran 2018 standard, see " "[#58](https://gitlab.com/lfortran/lfortran/issues/58)." msgstr "" #: ../../doc/src/index.md:77 msgid "" "Please vote on issues in our [issue " "tracker](https://gitlab.com/lfortran/lfortran/issues) that you want us to" " prioritize (feel free to create new ones if we are missing anything)." msgstr "" #: ../../doc/src/index.md:81 #, fuzzy msgid "Roadmap" msgstr "Guia dos planos" #: ../../doc/src/index.md:83 msgid "Here is our roadmap how to get all the planned features above implemented:" msgstr "" #: ../../doc/src/index.md:85 msgid "" "Port code generation to use ASR and pass all the current tests " "([#74](https://gitlab.com/lfortran/lfortran/issues/74)). Remove the old " "code generation and old semantics, that used to annotate the AST tree, " "which was messy." msgstr "" #: ../../doc/src/index.md:89 msgid "" "Get GFortran module files working with `use` module, both assumed-size " "and assumed-shape arrays " "([#52](https://gitlab.com/lfortran/lfortran/issues/52)). This will allow " "right away to use production codes with LFortran." msgstr "" #: ../../doc/src/index.md:93 msgid "Do these at the same time:" msgstr "" #: ../../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 "" #: ../../doc/src/index.md:98 msgid "" "b) Gradually move to C++ for robustness and speed " "([#70](https://gitlab.com/lfortran/lfortran/issues/70)). The Python API " "will not change (or only minimally), so the user experience from Python " "will not change." msgstr "" #: ../../doc/src/index.md:103 msgid "" "c) Implement all the other cool features: `use` module for C and Python " "and automatic wrappers " "([#44](https://gitlab.com/lfortran/lfortran/issues/44)), modern hardware" " support ([#57](https://gitlab.com/lfortran/lfortran/issues/57)), " "generating an older standard of Fortran " "([#72](https://gitlab.com/lfortran/lfortran/issues/72)), Fortran doctest" " feature ([#73](https://gitlab.com/lfortran/lfortran/issues/73)), SymPy" " integration ([#71](https://gitlab.com/lfortran/lfortran/issues/71)), " "language service for IDEs " "([#12](https://gitlab.com/lfortran/lfortran/issues/12)), and other ideas" " ([#29](https://gitlab.com/lfortran/lfortran/issues/29))." msgstr "" #: ../../doc/src/index.md:118 msgid "The step 1. is an internal refactoring that will not take long." msgstr "" #: ../../doc/src/index.md:120 msgid "" "The step 2. will allow LFortran to be used interactively with production " "codes right away (the production code will get compiled with GFortran, " "then one \"uses\" any module in LFortran and functions/subroutines can be" " interactively called, the module itself can use any GFortran supported " "feature, but the API must fit into the subset that LFortran understands " "--- for large number of applications simple functions/subroutines with " "array arguments are enough). This will make LFortran usable for first " "users and one can always use GFortran temporarily until LFortran supports" " the given feature. We expect to be finished with the step 2. by the end " "of summer 2019, hopefully sooner." msgstr "" #: ../../doc/src/index.md:130 msgid "" "Finally the step 3. will improve LFortran overall, allowing the first " "users to contribute back, growing the community and making LFortran " "gradually useful for more and more people." msgstr "" #: ../../doc/src/installation.md:1 msgid "Installation" msgstr "Instalação" #: ../../doc/src/installation.md:3 msgid "All the instructions below work on Linux, macOS and Windows." msgstr "" #: ../../doc/src/installation.md:5 msgid "Binaries" msgstr "Binários" #: ../../doc/src/installation.md:7 msgid "" "The recommended way to install LFortran is using Conda. Install Conda for" " example by installing the " "[Miniconda](https://conda.io/en/latest/miniconda.html) installation by " "following instructions there for your platform. Then create a new " "environment (you can choose any name, here we chose `lf`) and activate " "it:" msgstr "" #: ../../doc/src/installation.md:16 msgid "Then install LFortran by:" msgstr "" #: ../../doc/src/installation.md:20 msgid "" "Now the `lf` environment has the `lfortran` compiler available, you can " "start the interactive prompt by executing `lfortran`, or see the command " "line options using `lfortran -h`." msgstr "" #: ../../doc/src/installation.md:24 msgid "" "The Jupyter kernel is automatically installed by the above command, so " "after installing Jupyter itself:" msgstr "" #: ../../doc/src/installation.md:28 msgid "You can create a Fortran based Jupyter notebook by executing:" msgstr "" #: ../../doc/src/installation.md:32 msgid "and selecting `New->Fortran`." msgstr "E selecionando `New->Fortran`." #: ../../doc/src/installation.md:35 msgid "Build From a Source Tarball" msgstr "" #: ../../doc/src/installation.md:37 msgid "" "This method is the recommended method if you just want to install " "LFortran, either yourself or in a package manager (Spack, Conda, Debian, " "etc.). The source tarball has all the generated files included and has " "minimal dependencies." msgstr "" #: ../../doc/src/installation.md:39 msgid "First we have to install dependencies, for example using Conda:" msgstr "" #: ../../doc/src/installation.md:44 msgid "" "Then download a tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), e.g.:" msgstr "" #: ../../doc/src/installation.md:52 msgid "And build:" msgstr "E compile:" #: ../../doc/src/installation.md:58 msgid "This will install the `lfortran` into the `inst/bin`." msgstr "" #: ../../doc/src/installation.md:60 msgid "Build From Git" msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/installation.md:72 msgid "Then prepare the environment:" msgstr "" #: ../../doc/src/installation.md:77 msgid "Clone the LFortran git repository:" msgstr "" #: ../../doc/src/installation.md:82 msgid "" "Generate files that are needed for the build (this step depends on " "`re2c`, `bison` and `python`):" msgstr "" #: ../../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 "" #: ../../doc/src/installation.md:92 msgid "Run tests:" msgstr "Rode os testes:" #: ../../doc/src/installation.md:97 msgid "Run an interactive prompt:" msgstr "" #: ../../doc/src/installation.md:102 msgid "Build from Git on Windows with Visual Studio" msgstr "" #: ../../doc/src/installation.md:104 msgid "" "Install Visual Studio (MSVC), for example the version 2022, you can " "download the Community version for free from: " "https://visualstudio.microsoft.com/downloads/." msgstr "" #: ../../doc/src/installation.md:107 msgid "" "Install miniforge using the Windows installer from https://github.com" "/conda-forge/miniforge." msgstr "" #: ../../doc/src/installation.md:109 msgid "Launch the Miniforge Prompt from the Desktop." msgstr "" #: ../../doc/src/installation.md:111 msgid "In the shell, initialize the MSVC compiler using:" msgstr "" #: ../../doc/src/installation.md:117 msgid "You can optionally test that MSVC works by:" msgstr "" #: ../../doc/src/installation.md:122 msgid "Both commands must print help (several pages)." msgstr "" #: ../../doc/src/installation.md:124 msgid "Now you can download and build LFortran:" msgstr "" #: ../../doc/src/installation.md:134 msgid "If everything compiled, then you can use LFortran as follows:" msgstr "" #: ../../doc/src/installation.md:140 msgid "And so on." msgstr "E assim por diante." #: ../../doc/src/installation.md:142 msgid "" "Note: LFortran currently uses the MSVC's linker program (`link`), which " "is only available when the MSVC bat script above is ran. If you forget to" " activate it, LFortran's linking will fail." msgstr "" #: ../../doc/src/installation.md:146 msgid "" "Note: the miniforge shell seems to be running some version of `git-bash` " "(although it is `cmd.exe`), which has some unix-like filesystem mounted " "in `/usr` and several commands available such as `ls`, `which`, `git`, " "`vim`. For this reason the Conda build `environment_win.yml` contains " "everything needed, including `git`." msgstr "" #: ../../doc/src/installation.md:152 msgid "Build from Git on Windows with WSL" msgstr "" #: ../../doc/src/installation.md:153 msgid "In windows search \"turn windows features on or off\"." msgstr "" #: ../../doc/src/installation.md:154 msgid "Tick Windows subsystem for Linux." msgstr "" #: ../../doc/src/installation.md:155 msgid "Press OK and restart computer." msgstr "" #: ../../doc/src/installation.md:156 msgid "Go to Microsoft store and download Ubuntu 20.04, and launch it." msgstr "" #: ../../doc/src/installation.md:157 msgid "Run the following commands." msgstr "" #: ../../doc/src/installation.md:164 msgid "Now do the following to configure the path" msgstr "" #: ../../doc/src/installation.md:168 msgid "Then go to the bottom of the file and paste the following" msgstr "" #: ../../doc/src/installation.md:172 msgid "Then press ctrl + O (save), Enter (confirm), ctrl + X (exit)" msgstr "" #: ../../doc/src/installation.md:173 msgid "After that restart Ubuntu" msgstr "" #: ../../doc/src/installation.md:174 msgid "Run the following" msgstr "Execute o seguinte" #: ../../doc/src/installation.md:179 msgid "Restart Ubuntu again" msgstr "Reinicie novamente o Ubuntu" #: ../../doc/src/installation.md:187 msgid "" "You can change the directory to a Windows location using `cd /mnt/[drive " "letter]/[windows location]`." msgstr "" #: ../../doc/src/installation.md:188 msgid "e.g. `cd mnt/c/Users/name/source/repos/`" msgstr "Ex: `cd mnt/c/Users/name/source/repos/`" #: ../../doc/src/installation.md:190 msgid "Now clone the LFortran git repository" msgstr "" #: ../../doc/src/installation.md:196 msgid "Run the following commands" msgstr "" #: ../../doc/src/installation.md:204 msgid "If everything compiles, you can use LFortran as follows" msgstr "" #: ../../doc/src/installation.md:210 msgid "Run an interactive prompt" msgstr "" #: ../../doc/src/installation.md:215 msgid "Run tests" msgstr "Rode os testes" #: ../../doc/src/installation.md:221 msgid "Enabling the Jupyter Kernel" msgstr "" #: ../../doc/src/installation.md:223 msgid "To install the Jupyter kernel, install the following Conda packages also:" msgstr "" #: ../../doc/src/installation.md:227 msgid "" "and enable the kernel by `-DWITH_XEUS=yes` and install into " "`$CONDA_PREFIX`. For example:" msgstr "" #: ../../doc/src/installation.md:239 msgid "" "To use it, install Jupyter (`conda install jupyter`) and test that the " "LFortran kernel was found:" msgstr "" #: ../../doc/src/installation.md:244 msgid "Then launch a Jupyter notebook as follows:" msgstr "" #: ../../doc/src/installation.md:248 msgid "Click `New->Fortran`. To launch a terminal jupyter LFortran console:" msgstr "" #: ../../doc/src/installation.md:254 msgid "Build From Git with Nix" msgstr "" #: ../../doc/src/installation.md:256 msgid "" "One of the ways to ensure exact environment and dependencies is with " "`nix`. This will ensure that system dependencies do not interfere with " "the development environment. If you want, you can report bugs in a `nix-" "shell` environment to make it easier for others to reproduce." msgstr "" #: ../../doc/src/installation.md:258 msgid "With Root" msgstr "Com Root" #: ../../doc/src/installation.md:260 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 "" #: ../../doc/src/installation.md:264 msgid "Without Root" msgstr "Sem Root" #: ../../doc/src/installation.md:266 msgid "" "If you would like to not provide `nix` with root access to your machine, " "on Linux distributions we can use [nix-" "portable](https://github.com/DavHau/nix-portable)." msgstr "" #: ../../doc/src/installation.md:270 msgid "" "Now just prepend all `nix-shell` commands with `NP_RUNTIME=bwrap ./nix-" "portable `. So:" msgstr "" #: ../../doc/src/installation.md:278 msgid "Development" msgstr "Desenvolvimento" #: ../../doc/src/installation.md:280 msgid "Now we can enter the development environment:" msgstr "" #: ../../doc/src/installation.md:284 msgid "" "The `--pure` flag ensures no system dependencies are used in the " "environment." msgstr "" #: ../../doc/src/installation.md:286 msgid "The build steps are the same as with the `ci`:" msgstr "" #: ../../doc/src/installation.md:292 msgid "" "To change the compilation environment from `gcc` (default) to `clang` we " "can use `--argstr`:" msgstr "" #: ../../doc/src/installation.md:297 msgid "Note About Dependencies" msgstr "Nota Sobre Dependências" #: ../../doc/src/installation.md:299 msgid "" "End users (and distributions) are encouraged to use the tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), which " "only depends on LLVM, CMake and a C++ compiler." msgstr "" #: ../../doc/src/installation.md:303 msgid "" "The tarball is generated automatically by our CI (continuous integration)" " and contains some autogenerated files: the parser, the AST and ASR " "nodes, which is generated by an ASDL translator (requires Python)." msgstr "" #: ../../doc/src/installation.md:307 msgid "The instructions from git are to be used when developing LFortran itself." msgstr "" #: ../../doc/src/installation.md:309 msgid "Note for users who do not use Conda" msgstr "" #: ../../doc/src/installation.md:311 msgid "" "Following are the dependencies necessary for installing this repository " "in development mode," 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)" 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 "[re2c - 2.0.3](https://re2c.org/install/install.html)" #: ../../doc/src/installation.md:317 msgid "" "[binutils - " "2.31.90](ftp://sourceware.org/pub/binutils/snapshots/binutils-2.31.90.tar.xz)" " - Make sure that you should enable the required options related to this " "dependency to build the dynamic libraries (the ones ending with `.so`)." msgstr "" #: ../../doc/src/installation.md:319 #, fuzzy msgid "Stacktraces" msgstr "Stacktraces" #: ../../doc/src/installation.md:321 msgid "" "LFortran can print stacktraces when there is an unhandled exception, as " "well as on any compiler error with the `--show-stacktrace` option. This " "is very helpful for developing the compiler itself to see where in " "LFortran the problem is. The stacktrace support is turned off by default," " to enable it, compile LFortran with the `-DWITH_STACKTRACE=yes` cmake " "option after installing the prerequisites on each platform per the " "instructions below." msgstr "" #: ../../doc/src/installation.md:328 msgid "Ubuntu" msgstr "Ubuntu" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." msgstr "" #: ../../doc/src/installation.md:332 msgid "macOS" msgstr "macOS" #: ../../doc/src/installation.md:334 msgid "" "If you use the default Clang compiler on macOS, then the stacktraces " "should just work on both Intel and M1 based macOS (the CMake build system" " automatically invokes the `dsymtuil` tool and our Python scripts to " "store the debug information, see `src/bin/CMakeLists.txt` for more " "details). If it does not work, please report a bug." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/installation.md:352 msgid "" "and compile LFortran with the " "`-DCMAKE_PREFIX_PATH=\"$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX\"` cmake" " option. The `$CONDA_PREFIX` is there if you install some other " "dependencies (such as `llvm`) using Conda, otherwise you can remove it." msgstr "" #: ../../doc/src/intrinsics/array.md:1 msgid "Array Intrinsic Functions" msgstr "Funções Intrínsecas em Arrays" #: ../../doc/src/intrinsics/array/allocated.md:1 msgid "allocated(x): Status Check" msgstr "allocated(x): Checagem de Condição" #: ../../doc/src/intrinsics/array/allocated.md:3 msgid "Logical status of an allocatable integer." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:5 #: ../../doc/src/intrinsics/array/cshift.md:5 #: ../../doc/src/intrinsics/array/size.md:5 #: ../../doc/src/intrinsics/bit/bge.md:5 ../../doc/src/intrinsics/bit/bgt.md:5 #: ../../doc/src/intrinsics/bit/bit_size.md:5 #: ../../doc/src/intrinsics/bit/ble.md:5 ../../doc/src/intrinsics/bit/blt.md:5 #: ../../doc/src/intrinsics/bit/btest.md:5 #: ../../doc/src/intrinsics/bit/shiftl.md:5 #: ../../doc/src/intrinsics/bit/shiftr.md:5 #: ../../doc/src/intrinsics/character/achar.md:5 #: ../../doc/src/intrinsics/character/adjustl.md:5 #: ../../doc/src/intrinsics/character/adjustr.md:5 #: ../../doc/src/intrinsics/character/char.md:5 #: ../../doc/src/intrinsics/character/len_trim.md:5 #: ../../doc/src/intrinsics/character/lge.md:5 #: ../../doc/src/intrinsics/kind-type/kind.md:5 #: ../../doc/src/intrinsics/mathematical/acos.md:5 #: ../../doc/src/intrinsics/mathematical/acosh.md:5 #: ../../doc/src/intrinsics/mathematical/asin.md:5 #: ../../doc/src/intrinsics/mathematical/asinh.md:5 #: ../../doc/src/intrinsics/mathematical/atan.md:5 #: ../../doc/src/intrinsics/mathematical/atan2.md:5 #: ../../doc/src/intrinsics/mathematical/atanh.md:5 #: ../../doc/src/intrinsics/mathematical/fraction.md:5 #: ../../doc/src/intrinsics/misc/command_argument_count.md:5 #: ../../doc/src/intrinsics/misc/cpu_time.md:5 #: ../../doc/src/intrinsics/misc/date_and_time.md:5 #: ../../doc/src/intrinsics/misc/new_line.md:5 #: ../../doc/src/intrinsics/numeric/abs.md:5 #: ../../doc/src/intrinsics/numeric/aimag.md:5 #: ../../doc/src/intrinsics/numeric/aint.md:5 #: ../../doc/src/intrinsics/numeric/anint.md:5 #: ../../doc/src/intrinsics/numeric/ceiling.md:5 #: ../../doc/src/intrinsics/numeric/cmplx.md:5 #: ../../doc/src/intrinsics/numeric/conjg.md:5 #: ../../doc/src/intrinsics/numeric/digits.md:5 #: ../../doc/src/intrinsics/numeric/dim.md:5 #: ../../doc/src/intrinsics/numeric/epsilon.md:5 #: ../../doc/src/intrinsics/numeric/erf.md:5 #: ../../doc/src/intrinsics/numeric/erfc.md:5 #: ../../doc/src/intrinsics/numeric/exp.md:5 #: ../../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 "Declaração" #: ../../doc/src/intrinsics/array/allocated.md:7 #: ../../doc/src/intrinsics/array/cshift.md:7 #: ../../doc/src/intrinsics/array/size.md:7 #: ../../doc/src/intrinsics/bit/bge.md:7 ../../doc/src/intrinsics/bit/bgt.md:7 #: ../../doc/src/intrinsics/bit/bit_size.md:7 #: ../../doc/src/intrinsics/bit/ble.md:7 ../../doc/src/intrinsics/bit/blt.md:7 #: ../../doc/src/intrinsics/bit/btest.md:7 #: ../../doc/src/intrinsics/bit/shiftl.md:7 #: ../../doc/src/intrinsics/bit/shiftr.md:7 #: ../../doc/src/intrinsics/character/achar.md:7 #: ../../doc/src/intrinsics/character/adjustl.md:7 #: ../../doc/src/intrinsics/character/adjustr.md:7 #: ../../doc/src/intrinsics/character/char.md:7 #: ../../doc/src/intrinsics/character/len_trim.md:7 #: ../../doc/src/intrinsics/character/lge.md:8 #: ../../doc/src/intrinsics/kind-type/kind.md:7 #: ../../doc/src/intrinsics/mathematical/acos.md:7 #: ../../doc/src/intrinsics/mathematical/acosh.md:7 #: ../../doc/src/intrinsics/mathematical/asin.md:7 #: ../../doc/src/intrinsics/mathematical/asinh.md:7 #: ../../doc/src/intrinsics/mathematical/atan.md:7 #: ../../doc/src/intrinsics/mathematical/atan2.md:7 #: ../../doc/src/intrinsics/mathematical/atanh.md:7 #: ../../doc/src/intrinsics/mathematical/fraction.md:7 #: ../../doc/src/intrinsics/misc/command_argument_count.md:7 #: ../../doc/src/intrinsics/misc/cpu_time.md:7 #: ../../doc/src/intrinsics/misc/date_and_time.md:7 #: ../../doc/src/intrinsics/misc/new_line.md:7 #: ../../doc/src/intrinsics/numeric/abs.md:7 #: ../../doc/src/intrinsics/numeric/aimag.md:7 #: ../../doc/src/intrinsics/numeric/aint.md:7 #: ../../doc/src/intrinsics/numeric/anint.md:7 #: ../../doc/src/intrinsics/numeric/ceiling.md:7 #: ../../doc/src/intrinsics/numeric/cmplx.md:7 #: ../../doc/src/intrinsics/numeric/conjg.md:7 #: ../../doc/src/intrinsics/numeric/digits.md:7 #: ../../doc/src/intrinsics/numeric/dim.md:7 #: ../../doc/src/intrinsics/numeric/epsilon.md:7 #: ../../doc/src/intrinsics/numeric/erf.md:7 #: ../../doc/src/intrinsics/numeric/erfc.md:7 #: ../../doc/src/intrinsics/numeric/exp.md:7 #: ../../doc/src/intrinsics/numeric/floor.md:7 #: ../../doc/src/intrinsics/numeric/gamma.md:7 #: ../../doc/src/intrinsics/numeric/mod.md:7 msgid "Syntax" msgstr "Sintaxe" #: ../../doc/src/intrinsics/array/allocated.md:14 #: ../../doc/src/intrinsics/array/cshift.md:14 #: ../../doc/src/intrinsics/array/size.md:14 #: ../../doc/src/intrinsics/bit/bge.md:14 #: ../../doc/src/intrinsics/bit/bgt.md:14 #: ../../doc/src/intrinsics/bit/bit_size.md:14 #: ../../doc/src/intrinsics/bit/ble.md:14 #: ../../doc/src/intrinsics/bit/blt.md:14 #: ../../doc/src/intrinsics/bit/btest.md:14 #: ../../doc/src/intrinsics/bit/shiftl.md:14 #: ../../doc/src/intrinsics/bit/shiftr.md:14 #: ../../doc/src/intrinsics/character/achar.md:14 #: ../../doc/src/intrinsics/character/adjustl.md:14 #: ../../doc/src/intrinsics/character/adjustr.md:14 #: ../../doc/src/intrinsics/character/char.md:14 #: ../../doc/src/intrinsics/character/len_trim.md:14 #: ../../doc/src/intrinsics/character/lge.md:15 #: ../../doc/src/intrinsics/kind-type/kind.md:14 #: ../../doc/src/intrinsics/mathematical/acos.md:14 #: ../../doc/src/intrinsics/mathematical/acosh.md:14 #: ../../doc/src/intrinsics/mathematical/asin.md:14 #: ../../doc/src/intrinsics/mathematical/asinh.md:14 #: ../../doc/src/intrinsics/mathematical/atan.md:14 #: ../../doc/src/intrinsics/mathematical/atan2.md:13 #: ../../doc/src/intrinsics/mathematical/atanh.md:14 #: ../../doc/src/intrinsics/mathematical/fraction.md:13 #: ../../doc/src/intrinsics/misc/command_argument_count.md:14 #: ../../doc/src/intrinsics/misc/cpu_time.md:14 #: ../../doc/src/intrinsics/misc/date_and_time.md:14 #: ../../doc/src/intrinsics/misc/new_line.md:14 #: ../../doc/src/intrinsics/numeric/abs.md:15 #: ../../doc/src/intrinsics/numeric/aimag.md:15 #: ../../doc/src/intrinsics/numeric/aint.md:14 #: ../../doc/src/intrinsics/numeric/anint.md:14 #: ../../doc/src/intrinsics/numeric/ceiling.md:14 #: ../../doc/src/intrinsics/numeric/cmplx.md:16 #: ../../doc/src/intrinsics/numeric/conjg.md:15 #: ../../doc/src/intrinsics/numeric/digits.md:13 #: ../../doc/src/intrinsics/numeric/dim.md:13 #: ../../doc/src/intrinsics/numeric/epsilon.md:14 #: ../../doc/src/intrinsics/numeric/erf.md:14 #: ../../doc/src/intrinsics/numeric/erfc.md:14 #: ../../doc/src/intrinsics/numeric/exp.md:14 #: ../../doc/src/intrinsics/numeric/floor.md:14 #: ../../doc/src/intrinsics/numeric/gamma.md:14 #: ../../doc/src/intrinsics/numeric/mod.md:15 msgid "Arguments" msgstr "Argumentos" #: ../../doc/src/intrinsics/array/allocated.md:16 msgid "`x` is an integer input parameter." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:18 #: ../../doc/src/intrinsics/array/cshift.md:22 #: ../../doc/src/intrinsics/array/size.md:22 #: ../../doc/src/intrinsics/bit/bge.md:18 #: ../../doc/src/intrinsics/bit/bgt.md:18 #: ../../doc/src/intrinsics/bit/bit_size.md:18 #: ../../doc/src/intrinsics/bit/ble.md:18 #: ../../doc/src/intrinsics/bit/blt.md:18 #: ../../doc/src/intrinsics/bit/btest.md:19 #: ../../doc/src/intrinsics/bit/shiftl.md:21 #: ../../doc/src/intrinsics/bit/shiftr.md:21 #: ../../doc/src/intrinsics/character/lge.md:23 #: ../../doc/src/intrinsics/kind-type/kind.md:19 #: ../../doc/src/intrinsics/mathematical/acos.md:18 #: ../../doc/src/intrinsics/mathematical/acosh.md:19 #: ../../doc/src/intrinsics/mathematical/asin.md:18 #: ../../doc/src/intrinsics/mathematical/asinh.md:19 #: ../../doc/src/intrinsics/mathematical/atan.md:18 #: ../../doc/src/intrinsics/mathematical/atan2.md:21 #: ../../doc/src/intrinsics/mathematical/atanh.md:19 #: ../../doc/src/intrinsics/mathematical/fraction.md:17 #: ../../doc/src/intrinsics/misc/command_argument_count.md:18 #: ../../doc/src/intrinsics/misc/cpu_time.md:18 #: ../../doc/src/intrinsics/misc/date_and_time.md:39 #: ../../doc/src/intrinsics/misc/new_line.md:19 #: ../../doc/src/intrinsics/numeric/abs.md:19 #: ../../doc/src/intrinsics/numeric/aimag.md:19 #: ../../doc/src/intrinsics/numeric/aint.md:20 #: ../../doc/src/intrinsics/numeric/anint.md:20 #: ../../doc/src/intrinsics/numeric/ceiling.md:18 #: ../../doc/src/intrinsics/numeric/cmplx.md:24 #: ../../doc/src/intrinsics/numeric/conjg.md:19 #: ../../doc/src/intrinsics/numeric/digits.md:17 #: ../../doc/src/intrinsics/numeric/dim.md:18 #: ../../doc/src/intrinsics/numeric/epsilon.md:18 #: ../../doc/src/intrinsics/numeric/erf.md:18 #: ../../doc/src/intrinsics/numeric/erfc.md:18 #: ../../doc/src/intrinsics/numeric/exp.md:18 #: ../../doc/src/intrinsics/numeric/floor.md:20 #: ../../doc/src/intrinsics/numeric/gamma.md:19 #: ../../doc/src/intrinsics/numeric/mod.md:22 msgid "Return values" msgstr "Valores de retorno" #: ../../doc/src/intrinsics/array/allocated.md:20 msgid "" "The return value is a logical scalar with the default logical kind type " "parameter." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:23 #: ../../doc/src/intrinsics/array/cshift.md:26 #: ../../doc/src/intrinsics/array/size.md:26 #: ../../doc/src/intrinsics/bit/bge.md:22 #: ../../doc/src/intrinsics/bit/bgt.md:22 #: ../../doc/src/intrinsics/bit/bit_size.md:22 #: ../../doc/src/intrinsics/bit/ble.md:22 #: ../../doc/src/intrinsics/bit/blt.md:22 #: ../../doc/src/intrinsics/bit/btest.md:23 #: ../../doc/src/intrinsics/bit/shiftl.md:25 #: ../../doc/src/intrinsics/bit/shiftr.md:25 #: ../../doc/src/intrinsics/character/achar.md:27 #: ../../doc/src/intrinsics/character/adjustl.md:23 #: ../../doc/src/intrinsics/character/adjustr.md:24 #: ../../doc/src/intrinsics/character/char.md:28 #: ../../doc/src/intrinsics/character/len_trim.md:22 #: ../../doc/src/intrinsics/character/lge.md:31 #: ../../doc/src/intrinsics/kind-type/kind.md:23 #: ../../doc/src/intrinsics/mathematical/acos.md:23 #: ../../doc/src/intrinsics/mathematical/acosh.md:24 #: ../../doc/src/intrinsics/mathematical/asin.md:23 #: ../../doc/src/intrinsics/mathematical/asinh.md:24 #: ../../doc/src/intrinsics/mathematical/atan.md:23 #: ../../doc/src/intrinsics/mathematical/atan2.md:27 #: ../../doc/src/intrinsics/mathematical/atanh.md:24 #: ../../doc/src/intrinsics/mathematical/fraction.md:22 #: ../../doc/src/intrinsics/misc/command_argument_count.md:22 #: ../../doc/src/intrinsics/misc/cpu_time.md:22 #: ../../doc/src/intrinsics/misc/date_and_time.md:43 #: ../../doc/src/intrinsics/misc/new_line.md:24 #: ../../doc/src/intrinsics/numeric/abs.md:24 #: ../../doc/src/intrinsics/numeric/aimag.md:23 #: ../../doc/src/intrinsics/numeric/aint.md:28 #: ../../doc/src/intrinsics/numeric/anint.md:27 #: ../../doc/src/intrinsics/numeric/ceiling.md:22 #: ../../doc/src/intrinsics/numeric/cmplx.md:30 #: ../../doc/src/intrinsics/numeric/conjg.md:23 #: ../../doc/src/intrinsics/numeric/digits.md:21 #: ../../doc/src/intrinsics/numeric/dim.md:22 #: ../../doc/src/intrinsics/numeric/epsilon.md:22 #: ../../doc/src/intrinsics/numeric/erf.md:23 #: ../../doc/src/intrinsics/numeric/erfc.md:23 #: ../../doc/src/intrinsics/numeric/exp.md:22 #: ../../doc/src/intrinsics/numeric/floor.md:28 #: ../../doc/src/intrinsics/numeric/gamma.md:23 #: ../../doc/src/intrinsics/numeric/mod.md:31 ../../doc/src/progress.md msgid "Description" msgstr "Descrição" #: ../../doc/src/intrinsics/array/allocated.md:25 msgid "" "`allocated(x)` checks the allocation status of a integer input parameter." " It returns a logical value as `TRUE` if the input argument `x` is " "allocated, `FALSE` otherwise." msgstr "" #: ../../doc/src/intrinsics/array/allocated.md:29 #: ../../doc/src/intrinsics/array/cshift.md:39 #: ../../doc/src/intrinsics/array/size.md:33 #: ../../doc/src/intrinsics/bit/bge.md:27 #: ../../doc/src/intrinsics/bit/bgt.md:27 #: ../../doc/src/intrinsics/bit/bit_size.md:27 #: ../../doc/src/intrinsics/bit/ble.md:27 #: ../../doc/src/intrinsics/bit/blt.md:27 #: ../../doc/src/intrinsics/bit/btest.md:32 #: ../../doc/src/intrinsics/bit/shiftl.md:32 #: ../../doc/src/intrinsics/bit/shiftr.md:32 #: ../../doc/src/intrinsics/character/achar.md:37 #: ../../doc/src/intrinsics/character/adjustl.md:28 #: ../../doc/src/intrinsics/character/adjustr.md:29 #: ../../doc/src/intrinsics/character/char.md:38 #: ../../doc/src/intrinsics/character/len_trim.md:27 #: ../../doc/src/intrinsics/character/lge.md:37 #: ../../doc/src/intrinsics/kind-type/kind.md:27 #: ../../doc/src/intrinsics/mathematical/acos.md:31 #: ../../doc/src/intrinsics/mathematical/acosh.md:43 #: ../../doc/src/intrinsics/mathematical/asin.md:31 #: ../../doc/src/intrinsics/mathematical/asinh.md:35 #: ../../doc/src/intrinsics/mathematical/atan.md:31 #: ../../doc/src/intrinsics/mathematical/atan2.md:53 #: ../../doc/src/intrinsics/mathematical/atanh.md:39 #: ../../doc/src/intrinsics/mathematical/fraction.md:30 #: ../../doc/src/intrinsics/misc/command_argument_count.md:27 #: ../../doc/src/intrinsics/misc/cpu_time.md:33 #: ../../doc/src/intrinsics/misc/date_and_time.md:53 #: ../../doc/src/intrinsics/misc/new_line.md:29 #: ../../doc/src/intrinsics/numeric/abs.md:35 #: ../../doc/src/intrinsics/numeric/aimag.md:33 #: ../../doc/src/intrinsics/numeric/aint.md:35 #: ../../doc/src/intrinsics/numeric/anint.md:38 #: ../../doc/src/intrinsics/numeric/ceiling.md:26 #: ../../doc/src/intrinsics/numeric/cmplx.md:47 #: ../../doc/src/intrinsics/numeric/conjg.md:33 #: ../../doc/src/intrinsics/numeric/digits.md:26 #: ../../doc/src/intrinsics/numeric/dim.md:27 #: ../../doc/src/intrinsics/numeric/epsilon.md:29 #: ../../doc/src/intrinsics/numeric/erf.md:33 #: ../../doc/src/intrinsics/numeric/erfc.md:36 #: ../../doc/src/intrinsics/numeric/exp.md:29 #: ../../doc/src/intrinsics/numeric/floor.md:33 #: ../../doc/src/intrinsics/numeric/gamma.md:38 #: ../../doc/src/intrinsics/numeric/mod.md:43 msgid "Types" 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 "" #: ../../doc/src/intrinsics/array/allocated.md:46 #: ../../doc/src/intrinsics/array/cshift.md:43 #: ../../doc/src/intrinsics/array/size.md:37 #: ../../doc/src/intrinsics/bit/bge.md:49 #: ../../doc/src/intrinsics/bit/bgt.md:49 #: ../../doc/src/intrinsics/bit/bit_size.md:44 #: ../../doc/src/intrinsics/bit/ble.md:49 #: ../../doc/src/intrinsics/bit/blt.md:49 #: ../../doc/src/intrinsics/bit/btest.md:56 #: ../../doc/src/intrinsics/bit/shiftl.md:62 #: ../../doc/src/intrinsics/bit/shiftr.md:62 #: ../../doc/src/intrinsics/character/achar.md:53 #: ../../doc/src/intrinsics/character/adjustl.md:45 #: ../../doc/src/intrinsics/character/adjustr.md:46 #: ../../doc/src/intrinsics/character/char.md:53 #: ../../doc/src/intrinsics/character/len_trim.md:44 #: ../../doc/src/intrinsics/character/lge.md:59 #: ../../doc/src/intrinsics/kind-type/kind.md:59 #: ../../doc/src/intrinsics/mathematical/acos.md:60 #: ../../doc/src/intrinsics/mathematical/acosh.md:72 #: ../../doc/src/intrinsics/mathematical/asin.md:60 #: ../../doc/src/intrinsics/mathematical/asinh.md:64 #: ../../doc/src/intrinsics/mathematical/atan.md:60 #: ../../doc/src/intrinsics/mathematical/atan2.md:75 #: ../../doc/src/intrinsics/mathematical/atanh.md:68 #: ../../doc/src/intrinsics/mathematical/fraction.md:34 #: ../../doc/src/intrinsics/misc/command_argument_count.md:31 #: ../../doc/src/intrinsics/misc/cpu_time.md:44 #: ../../doc/src/intrinsics/misc/date_and_time.md:64 #: ../../doc/src/intrinsics/misc/new_line.md:40 #: ../../doc/src/intrinsics/numeric/abs.md:79 #: ../../doc/src/intrinsics/numeric/aimag.md:53 #: ../../doc/src/intrinsics/numeric/aint.md:39 #: ../../doc/src/intrinsics/numeric/anint.md:42 #: ../../doc/src/intrinsics/numeric/ceiling.md:46 #: ../../doc/src/intrinsics/numeric/cmplx.md:59 #: ../../doc/src/intrinsics/numeric/conjg.md:53 #: ../../doc/src/intrinsics/numeric/digits.md:30 #: ../../doc/src/intrinsics/numeric/dim.md:31 #: ../../doc/src/intrinsics/numeric/epsilon.md:49 #: ../../doc/src/intrinsics/numeric/erf.md:53 #: ../../doc/src/intrinsics/numeric/erfc.md:56 #: ../../doc/src/intrinsics/numeric/exp.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:65 #: ../../doc/src/intrinsics/numeric/gamma.md:58 #: ../../doc/src/intrinsics/numeric/mod.md:80 msgid "Examples" msgstr "Exemplos" #: ../../doc/src/intrinsics/array/allocated.md:59 #: ../../doc/src/intrinsics/array/cshift.md:55 #: ../../doc/src/intrinsics/array/size.md:48 #: ../../doc/src/intrinsics/mathematical/acos.md:76 #: ../../doc/src/intrinsics/mathematical/acosh.md:81 #: ../../doc/src/intrinsics/mathematical/asin.md:76 #: ../../doc/src/intrinsics/mathematical/asinh.md:73 #: ../../doc/src/intrinsics/mathematical/atan.md:76 #: ../../doc/src/intrinsics/mathematical/atan2.md:84 #: ../../doc/src/intrinsics/mathematical/atanh.md:77 #: ../../doc/src/intrinsics/mathematical/fraction.md:44 msgid "**Result**:" msgstr "**Resultado**:" #: ../../doc/src/intrinsics/array/allocated.md:65 #: ../../doc/src/intrinsics/array/cshift.md:62 #: ../../doc/src/intrinsics/array/size.md:55 #: ../../doc/src/intrinsics/bit/bge.md:68 #: ../../doc/src/intrinsics/bit/bgt.md:66 #: ../../doc/src/intrinsics/bit/bit_size.md:61 #: ../../doc/src/intrinsics/bit/ble.md:68 #: ../../doc/src/intrinsics/bit/blt.md:66 #: ../../doc/src/intrinsics/bit/btest.md:71 #: ../../doc/src/intrinsics/bit/shiftl.md:80 #: ../../doc/src/intrinsics/bit/shiftr.md:80 #: ../../doc/src/intrinsics/character/achar.md:69 #: ../../doc/src/intrinsics/character/adjustl.md:62 #: ../../doc/src/intrinsics/character/adjustr.md:63 #: ../../doc/src/intrinsics/character/char.md:69 #: ../../doc/src/intrinsics/character/len_trim.md:63 #: ../../doc/src/intrinsics/character/lge.md:79 #: ../../doc/src/intrinsics/kind-type/kind.md:79 #: ../../doc/src/intrinsics/mathematical/acos.md:82 #: ../../doc/src/intrinsics/mathematical/acosh.md:86 #: ../../doc/src/intrinsics/mathematical/asin.md:82 #: ../../doc/src/intrinsics/mathematical/asinh.md:78 #: ../../doc/src/intrinsics/mathematical/atan.md:82 #: ../../doc/src/intrinsics/mathematical/atan2.md:90 #: ../../doc/src/intrinsics/mathematical/atanh.md:82 #: ../../doc/src/intrinsics/mathematical/fraction.md:50 #: ../../doc/src/intrinsics/misc/command_argument_count.md:47 #: ../../doc/src/intrinsics/misc/cpu_time.md:64 #: ../../doc/src/intrinsics/misc/date_and_time.md:90 #: ../../doc/src/intrinsics/misc/new_line.md:56 #: ../../doc/src/intrinsics/numeric/abs.md:96 #: ../../doc/src/intrinsics/numeric/aimag.md:68 #: ../../doc/src/intrinsics/numeric/aint.md:55 #: ../../doc/src/intrinsics/numeric/anint.md:58 #: ../../doc/src/intrinsics/numeric/ceiling.md:64 #: ../../doc/src/intrinsics/numeric/cmplx.md:74 #: ../../doc/src/intrinsics/numeric/conjg.md:68 #: ../../doc/src/intrinsics/numeric/digits.md:44 #: ../../doc/src/intrinsics/numeric/dim.md:47 #: ../../doc/src/intrinsics/numeric/epsilon.md:63 #: ../../doc/src/intrinsics/numeric/erf.md:67 #: ../../doc/src/intrinsics/numeric/erfc.md:70 #: ../../doc/src/intrinsics/numeric/exp.md:71 #: ../../doc/src/intrinsics/numeric/floor.md:83 #: ../../doc/src/intrinsics/numeric/gamma.md:74 #: ../../doc/src/intrinsics/numeric/mod.md:95 msgid "See Also" msgstr "Veja Também" #: ../../doc/src/intrinsics/array/cshift.md:1 msgid "cshift(A, shift [, dim]): Circular Shift" msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:3 msgid "Circular shift elements of an array." 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 "" #: ../../doc/src/intrinsics/array/cshift.md:18 msgid "`shift` the input value of integer type." msgstr "" #: ../../doc/src/intrinsics/array/cshift.md:20 msgid "" "`dim` optional dimension, if present, `cshift` returns the result of this" " dimension." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/array/cshift.md:28 msgid "" "**cshift(A, shift [, dim])** performs a circular shift on elements of `A`" " array along the dimension of `dim`. Default value of `dim` is 1, used " "when `dim` is not passed." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/array/cshift.md:41 msgid "" "Supported argument type is array for `A` and integer for `shift` and " "`dim`." msgstr "" #: ../../doc/src/intrinsics/array/size.md:1 msgid "size(x): Size of Array" msgstr "" #: ../../doc/src/intrinsics/array/size.md:3 msgid "Returns the size of an array `x`." msgstr "" #: ../../doc/src/intrinsics/array/size.md:18 msgid "" "`dim` optional dimension, if present, `size` returns the size of this " "dimension." msgstr "" #: ../../doc/src/intrinsics/array/size.md:20 msgid "`kind` optional the kind of the return value." msgstr "" #: ../../doc/src/intrinsics/array/size.md:24 msgid "`n` the size of an array (integer)." msgstr "" #: ../../doc/src/intrinsics/array/size.md:28 msgid "" "The `size` intrinsic function returns the size of an array. It returns " "the product of all dimensions, unless the `dim` argument is specified, in" " which case it only returns the size of this particular dimension. The " "`kind` argument can be used to specify the integer kind of the result." msgstr "" #: ../../doc/src/intrinsics/array/size.md:57 #, fuzzy msgid "[shape](), [reshape]()." msgstr "[shape](), [reshape]()." #: ../../doc/src/intrinsics/bit.md:1 msgid "Bit Intrinsic Functions" msgstr "Funções Intrínsecas de Bits" #: ../../doc/src/intrinsics/bit/bge.md:1 msgid "bge(x, y): Bitwise Greater or Equal" msgstr "" #: ../../doc/src/intrinsics/bit/bge.md:3 msgid "Bitwise greater than or equal to." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/bge.md:29 #: ../../doc/src/intrinsics/bit/bgt.md:29 #: ../../doc/src/intrinsics/bit/ble.md:29 #: ../../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 "" #: ../../doc/src/intrinsics/bit/bge.md:60 #: ../../doc/src/intrinsics/bit/bgt.md:59 #: ../../doc/src/intrinsics/bit/bit_size.md:54 #: ../../doc/src/intrinsics/bit/ble.md:60 #: ../../doc/src/intrinsics/bit/blt.md:59 #: ../../doc/src/intrinsics/bit/btest.md:65 #: ../../doc/src/intrinsics/bit/shiftl.md:74 #: ../../doc/src/intrinsics/bit/shiftr.md:74 #: ../../doc/src/intrinsics/character/achar.md:63 #: ../../doc/src/intrinsics/character/adjustl.md:56 #: ../../doc/src/intrinsics/character/adjustr.md:57 #: ../../doc/src/intrinsics/character/char.md:63 #: ../../doc/src/intrinsics/character/len_trim.md:57 #: ../../doc/src/intrinsics/character/lge.md:72 #: ../../doc/src/intrinsics/kind-type/kind.md:72 #: ../../doc/src/intrinsics/misc/command_argument_count.md:40 #: ../../doc/src/intrinsics/misc/cpu_time.md:57 #: ../../doc/src/intrinsics/misc/date_and_time.md:83 #: ../../doc/src/intrinsics/misc/new_line.md:49 #: ../../doc/src/intrinsics/numeric/abs.md:89 #: ../../doc/src/intrinsics/numeric/aimag.md:62 #: ../../doc/src/intrinsics/numeric/aint.md:48 #: ../../doc/src/intrinsics/numeric/anint.md:51 #: ../../doc/src/intrinsics/numeric/ceiling.md:57 #: ../../doc/src/intrinsics/numeric/cmplx.md:68 #: ../../doc/src/intrinsics/numeric/conjg.md:62 #: ../../doc/src/intrinsics/numeric/digits.md:38 #: ../../doc/src/intrinsics/numeric/dim.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:57 #: ../../doc/src/intrinsics/numeric/erf.md:61 #: ../../doc/src/intrinsics/numeric/erfc.md:64 #: ../../doc/src/intrinsics/numeric/exp.md:65 #: ../../doc/src/intrinsics/numeric/floor.md:76 #: ../../doc/src/intrinsics/numeric/gamma.md:67 #: ../../doc/src/intrinsics/numeric/mod.md:89 msgid "**Result:**" msgstr "**Resultado:**" #: ../../doc/src/intrinsics/bit/bge.md:70 #, fuzzy msgid "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." 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 "" #: ../../doc/src/intrinsics/bit/bgt.md:3 msgid "Bitwise greater than." msgstr "Maior que bit-a-bit." #: ../../doc/src/intrinsics/bit/bgt.md:24 msgid "" "`bgt(x, y)` calculates if one integer input values is bitwise greater " "than the other." msgstr "" #: ../../doc/src/intrinsics/bit/bgt.md:68 #, fuzzy msgid "[bge](bge.md), [ble](ble.md), [blt](blt.md)." 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 "bit_size(x): Tamanho em Bits" #: ../../doc/src/intrinsics/bit/bit_size.md:3 msgid "Bit size." msgstr "Bit size." #: ../../doc/src/intrinsics/bit/bit_size.md:16 msgid "`x` is integer input value." msgstr "" #: ../../doc/src/intrinsics/bit/bit_size.md:20 #: ../../doc/src/intrinsics/numeric/digits.md:19 msgid "The return value is of type integer." 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 "" #: ../../doc/src/intrinsics/bit/bit_size.md:29 msgid "Supported input types is integer." msgstr "" #: ../../doc/src/intrinsics/bit/ble.md:1 msgid "bge(x, y): Bitwise Less or Equal" msgstr "" #: ../../doc/src/intrinsics/bit/ble.md:3 msgid "Bitwise less than or equal to." 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 "" #: ../../doc/src/intrinsics/bit/ble.md:70 #, fuzzy msgid "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." 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 "" #: ../../doc/src/intrinsics/bit/blt.md:3 msgid "Bitwise less than." msgstr "Menor que bit-a-bit." #: ../../doc/src/intrinsics/bit/blt.md:24 msgid "" "`blt(x, y)` calculates if one integer input values is bitwise less than " "the other." msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:68 #, fuzzy msgid "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." 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 "" #: ../../doc/src/intrinsics/bit/btest.md:3 msgid "Bit test." msgstr "Teste de bit." #: ../../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 "" #: ../../doc/src/intrinsics/bit/btest.md:21 msgid "The return value is of type logical." msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:25 msgid "" "`btest(x, pos)` calculates if `pos` bit in input integer value `x` is " "set. The counting of the bits starts at 0, at least significant bit (LSB)" " i.e., the rightmost bit in `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:1 msgid "shiftl(x, shift): Shift Left" msgstr "" #: ../../doc/src/intrinsics/bit/shiftl.md:3 msgid "Logical shift left function." msgstr "" #: ../../doc/src/intrinsics/bit/shiftl.md:16 #: ../../doc/src/intrinsics/bit/shiftr.md:16 msgid "`x` is an integer input value." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:27 msgid "" "**shiftl(x, shift)** logically left shifts `x` by `shift` number of bits." " `shiftl` shifts from LSB(**L**east **S**ignificant **B**it) to " "MSB(**M**ost **S**ignificant **B**it). Bits shifted from the left end " "i.e., MSB bits are lost. Zeroes are appended to the opposite right end." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/bit/shiftl.md:82 #, fuzzy msgid "[shiftr](shiftr.md)." msgstr "[shiftr](shiftr.md)." #: ../../doc/src/intrinsics/bit/shiftr.md:1 msgid "shiftr(x, shift): Shift Right" msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:3 msgid "Logical shift right function." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:27 msgid "" "**shiftr(x, shift)** logically right shifts `x` by `shift` number of " "bits. `shiftr` shifts from MSB(**M**ost **S**ignificant **B**it) to " "LSB(**L**east **S**ignificant **B**it). Bits shifted from the right end " "i.e., LSB bits are lost. Zeroes are appended to the opposite left end." msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:82 #, fuzzy msgid "[shiftl](shiftl.md)." msgstr "[shiftl](shiftl.md)." #: ../../doc/src/intrinsics/character.md:1 msgid "Character Intrinsic Functions" msgstr "Funções Intrínsecas para Caracteres" #: ../../doc/src/intrinsics/character/achar.md:1 msgid "achar(x, kind): To Character in ASCII set." msgstr "" #: ../../doc/src/intrinsics/character/achar.md:3 msgid "Character represented by in the ASCII character set." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/character/achar.md:20 #: ../../doc/src/intrinsics/character/adjustl.md:18 #: ../../doc/src/intrinsics/character/adjustr.md:18 #: ../../doc/src/intrinsics/character/char.md:21 #: ../../doc/src/intrinsics/character/len_trim.md:18 msgid "Return value" msgstr "Valor de retorno" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/achar.md:29 msgid "" "**achar(x, kind)** returns the character represented by the ASCII " "character set at `x` position." msgstr "" #: ../../doc/src/intrinsics/character/achar.md:32 #: ../../doc/src/intrinsics/character/char.md:33 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 "" #: ../../doc/src/intrinsics/character/achar.md:35 #: ../../doc/src/intrinsics/character/char.md:36 msgid "It is a runtime builtin function." 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 "[lge](lge.md)." #: ../../doc/src/intrinsics/character/adjustl.md:1 msgid "adjustl(string): Left Adjust String" msgstr "" #: ../../doc/src/intrinsics/character/adjustl.md:3 msgid "Left adjust a string." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/adjustl.md:30 #: ../../doc/src/intrinsics/character/adjustr.md:31 msgid "Supported argument type is character." msgstr "" #: ../../doc/src/intrinsics/character/adjustr.md:1 msgid "adjustr(string): Right Adjust String" msgstr "" #: ../../doc/src/intrinsics/character/adjustr.md:3 msgid "Right adjust a string." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/character/adjustr.md:65 #, fuzzy msgid "[adjustl](adjustl.md)." msgstr "[adjustl](adjustl.md)." #: ../../doc/src/intrinsics/character/char.md:1 msgid "char(x, [, kind]): Integer to Character" msgstr "" #: ../../doc/src/intrinsics/character/char.md:3 msgid "Integer to character conversion." msgstr "" #: ../../doc/src/intrinsics/character/char.md:16 msgid "`x`: the input value of integer type." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/character/char.md:30 msgid "" "**char(x)** returns the character represented by the ASCII character set " "at `x` position." msgstr "" #: ../../doc/src/intrinsics/character/char.md:71 #, fuzzy msgid "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" 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 "" #: ../../doc/src/intrinsics/character/len_trim.md:3 msgid "Length of a character string ignoring trailing blank character(s)." msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:16 msgid "`string` the input value of character type." msgstr "" #: ../../doc/src/intrinsics/character/len_trim.md:20 msgid "The return value is of type unsigned integer." 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 "" #: ../../doc/src/intrinsics/character/len_trim.md:29 msgid "Supported argument type is character scalar." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:1 msgid "lge(x, y): Lexically Greater or Equal" msgstr "" #: ../../doc/src/intrinsics/character/lge.md:3 msgid "Lexically greater than or equal." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:17 msgid "`x` input value of type character." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:19 msgid "`y` input value of type character." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:21 msgid "`x` and `y` can be seen as string A and string B." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:25 msgid "The return value is of logical `true` or `false` type." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:27 msgid "`True` if `x` string is lexically greater than or equal to `y`." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:29 msgid "`False` if they are not." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:33 msgid "" "**lge(x, y)** determines if input string `x` is lexically greater than or" " equal to input string `y`. The two strings in comparison are interpreted" " as containing ASCII character codes." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:39 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 "[len_trim](len_trim.md)." #: ../../doc/src/intrinsics/kind-type.md:1 msgid "Kind Type Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:1 msgid "kind(x): Kind of an Entity" msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:3 msgid "Kind of an entity." 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 "" #: ../../doc/src/intrinsics/kind-type/kind.md:21 msgid "The return value is of integer type and of default integer kind." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:25 msgid "**kind(x)** returns the kind parameter of the input argument `x`." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:29 msgid "" "Supported argument types are logical, integer, real, complex, or " "character." msgstr "" #: ../../doc/src/intrinsics/kind-type/kind.md:81 #: ../../doc/src/intrinsics/misc/command_argument_count.md:16 #: ../../doc/src/intrinsics/misc/cpu_time.md:20 #: ../../doc/src/intrinsics/misc/date_and_time.md:41 #: ../../doc/src/intrinsics/misc/new_line.md:58 msgid "None." msgstr "Nenhum." #: ../../doc/src/intrinsics/mathematical.md:1 msgid "Mathematical Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:1 msgid "acos(x): Trigonometric Arc Cosine" msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:3 msgid "Trigonometric arc cosine (inverse cosine) function." 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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:20 #: ../../doc/src/intrinsics/mathematical/acosh.md:21 #: ../../doc/src/intrinsics/mathematical/asin.md:20 #: ../../doc/src/intrinsics/mathematical/asinh.md:21 #: ../../doc/src/intrinsics/mathematical/atan.md:20 #: ../../doc/src/intrinsics/mathematical/atanh.md:21 msgid "" "The returned value has the kind of the input value and TYPE may be real " "or complex." msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:25 msgid "**acos(x)** computes the arcsine of the argument **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:33 #: ../../doc/src/intrinsics/mathematical/acosh.md:45 #: ../../doc/src/intrinsics/mathematical/asin.md:33 #: ../../doc/src/intrinsics/mathematical/asinh.md:37 #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acos.md:84 #, fuzzy msgid "[asin](asin.md), [atan](atan.md)." msgstr "[asin](asin.md), [atan](atan.md)." #: ../../doc/src/intrinsics/mathematical/acosh.md:1 msgid "acosh(x): Inverse Hyperbolic Cosine" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:3 msgid "Inverse hyperbolic cosine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:16 #: ../../doc/src/intrinsics/mathematical/asinh.md:16 #: ../../doc/src/intrinsics/mathematical/atanh.md:16 msgid "" "`x` the input value, can be real with value greater than or equal to 1 or" " of type complex." msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:26 msgid "**acosh(x)** computes the inverse hyperbolic cosine function of **x**." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acosh.md:33 msgid "$-\\pi <= img (acosh(x)) <= \\pi$" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:35 msgid "" "For real values $x$ in the domain $x > 1$, the inverse hyperbolic cosine " "satisifies:" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:38 msgid "$cosh^{-1}(x) = \\log(x + \\sqrt{(x^2 - 1)})$" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/acosh.md:88 #, fuzzy msgid "[asinh](asinh.md), [atanh](atanh.md)." msgstr "[asinh](asinh.md), [atanh](atanh.md)." #: ../../doc/src/intrinsics/mathematical/asin.md:1 msgid "asin(x): Trigonometric Arcsine" msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:3 msgid "Trigonometric arcsine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:25 msgid "**asin(x)** computes the arcsine of the argument **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/asin.md:84 #, fuzzy msgid "[acos](acos.md), [atan](atan.md)." msgstr "[acos](acos.md), [atan](atan.md)." #: ../../doc/src/intrinsics/mathematical/asinh.md:1 msgid "asinh(x): Inverse Hyperbolic Arcsine" msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:3 msgid "Inverse hyperbolic arcsine function." msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:26 msgid "**asinh(x)** computes the inverse hyperbolic arcsine function of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/asinh.md:33 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 "[acosh](acosh.md), [atanh](atanh.md)." #: ../../doc/src/intrinsics/mathematical/atan.md:1 msgid "atan(x): Trigonometric ArcTangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:3 msgid "Trigonometric arctangent (inverse arctangent) function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:25 msgid "**atan(x)** computes the arctangent of the argument **x**." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:27 msgid "" "The arc tangent is the inverse function of the arctangent function. It is" " commonly used in trigonometry to find the angle when the lengths of the " "opposite side of a right triangle and base are known, i.e., perpendicular" " and base length." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:84 #, fuzzy msgid "[asin](asin.md), [acos](acos.md)." msgstr "[asin](asin.md), [acos](acos.md)." #: ../../doc/src/intrinsics/mathematical/atan2.md:1 msgid "atan2(y, x): ArcTangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:3 msgid "Arctangent function or inverse tangent function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:15 msgid "`y` the input value is the imaginary part of the complex expression" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atan2.md:19 msgid "`x` the input value, must be real part of the complex expression." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atan2.md:29 msgid "" "**atan2(y, x)** computes the principal value of the argument function of " "the complex expression $x + iy$. This is used to transform from cartesian" " into polar coordinates and allows to determine the angle in the correct " "quadrant." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:33 msgid "It is also represented as:" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:35 #, fuzzy msgid "$tan^{-1}(\\frac{y}{x})$" 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 "" #: ../../doc/src/intrinsics/mathematical/atan2.md:39 msgid "$-\\pi <= atan(x) <= \\pi$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:41 msgid "The sign is positive if `y` is positive." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:43 msgid "If `y` is zero and `x` is strictly positive, then the result is 0." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:45 msgid "If `x` is negative and `y` is positive zero, then the result is $\\pi$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:47 msgid "If `x` is negative and `y` is negative zero, then the result is $-\\pi$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:49 msgid "If `x` is zero, then the magnitude of the result is $\\frac{\\pi}{2}$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:51 msgid "If `y` is negative real zero, the result is $\\frac{-\\pi}{2}$." msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:55 #: ../../doc/src/intrinsics/mathematical/fraction.md:32 msgid "Supported argument type is real." msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:1 msgid "atanh(x): Inverse Hyperbolic Tangent" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:3 msgid "Inverse hyperbolic tangent function." msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:26 msgid "**atanh(x)** computes the inverse hyperbolic tangent function of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/atanh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (atanh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:35 msgid "If the result is real, it lies in the range" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:37 msgid "$-1.0 < atanh(x) < 1.0$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:84 #, fuzzy msgid "[asinh](asinh.md), [acosh](acosh.md)." msgstr "[asinh](asinh.md), [acosh](acosh.md)." #: ../../doc/src/intrinsics/mathematical/fraction.md:1 msgid "fraction(x): Fractional Part in Model Representation" msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:3 msgid "Fractional part of the model representation." msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:15 msgid "`x` the input value, must be real." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/fraction.md:24 msgid "" "**fraction(x)** computes the fractional part of the model representation " "of **x**." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/mathematical/fraction.md:28 msgid "$x * {radix(x)}^{(-exponent(x))}$" msgstr "" #: ../../doc/src/intrinsics/misc.md:1 msgid "Miscellaneous Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:1 msgid "command_argument_count(): Number of Command Line Arguments" msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:3 msgid "Get number of command line arguments." msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:20 msgid "The return value is of integer type and of default kind." 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 "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:29 msgid "Any." msgstr "Qualquer um." #: ../../doc/src/intrinsics/misc/cpu_time.md:1 msgid "cpu_time(x): CPU Elapsed Time" msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:3 msgid "CPU elapsed time in seconds." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:16 msgid "`x` the input value should be of type real with `intent(out)`." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:24 msgid "" "**cpu_time(time)** returns a real value representing the elapsed CPU time" " in seconds. If tine source is available, time will be reported with " "microsecond resolution. If no time source is available, TIME is set to " "-1.0." msgstr "" #: ../../doc/src/intrinsics/misc/cpu_time.md:28 msgid "This is useful for testing segments of code to determine computation time." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:1 msgid "date_and_time([date, time, zone, values]): Date and Time" msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:3 msgid "Date and time subroutine." 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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:22 msgid "" "`zone` the input value of character type, which has length 5 or larger. " "It is of default kind. It is `intent(out)` and has from `(+-)hhmm`, " "representing the difference with respect to Coordinates Universal Time " "(UTC). Unavailable time and date parameters return blanks." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:30 msgid "`value(1)`: The year." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:31 msgid "`value(2)`: The month." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:32 msgid "`value(3)`: The day of the month." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:33 msgid "`value(4)`: Time difference with UTC in minutes." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:34 msgid "`value(5)`: The hour of the day." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:35 msgid "`value(6)`: The minutes of the hour." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:36 msgid "`value(7)`: The seconds of the minutes." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:37 msgid "`value(8)`: The milliseconds of the second." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/date_and_time.md:51 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 "[cpu_time](cpu_time.md)." #: ../../doc/src/intrinsics/misc/new_line.md:1 msgid "new_line(x): New Line Character" msgstr "" #: ../../doc/src/intrinsics/misc/new_line.md:3 msgid "New line character." 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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/misc/new_line.md:31 msgid "Supported input parameter types is character." msgstr "" #: ../../doc/src/intrinsics/numeric.md:1 msgid "Numeric Intrinsic Functions" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:1 msgid "abs(x): Absolute Value" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:3 msgid "Absolute value." msgstr "Valor absoluto." #: ../../doc/src/intrinsics/numeric/abs.md:17 msgid "`x` the input value, can be integer, real, or complex." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/abs.md:26 msgid "" "**abs(x)** calculates and returns absolute value of `x`. Result is " "calculated using mathematical formula:" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:29 #, fuzzy msgid "$|x|$" msgstr "$|x|$" #: ../../doc/src/intrinsics/numeric/abs.md:31 msgid "If `x` is complex, the result is calculated using mathematical formula:" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:33 msgid "$\\sqrt{(x^2 + y^2)}$" msgstr "" #: ../../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 "" #: ../../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 "[ceiling](ceiling.md), [floor](floor.md)." #: ../../doc/src/intrinsics/numeric/aimag.md:1 msgid "aimag(x): Imaginary Part" msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:3 msgid "Imaginary part of complex number." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:17 msgid "`x` the input value must be of complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:21 msgid "The return value is imaginary part of type real and kind same as of `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:25 msgid "**aimag(x)** returns the imaginary part of the input complex argument `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/aimag.md:27 #: ../../doc/src/intrinsics/numeric/cmplx.md:41 #: ../../doc/src/intrinsics/numeric/conjg.md:27 msgid "" "For `x` complex input value, the result is calculated using mathematical " "formula:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aimag.md:35 msgid "Supported argument types are complex." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:1 msgid "aint(x, [kind]): Truncate to a Whole Number" msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:3 msgid "Truncate to a whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:16 #: ../../doc/src/intrinsics/numeric/anint.md:16 #: ../../doc/src/intrinsics/numeric/epsilon.md:16 #: ../../doc/src/intrinsics/numeric/erf.md:16 #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/aint.md:37 #: ../../doc/src/intrinsics/numeric/anint.md:40 #: ../../doc/src/intrinsics/numeric/epsilon.md:31 #: ../../doc/src/intrinsics/numeric/erf.md:35 #: ../../doc/src/intrinsics/numeric/erfc.md:38 #: ../../doc/src/intrinsics/numeric/floor.md:35 #: ../../doc/src/intrinsics/numeric/gamma.md:40 msgid "Supported argument types is real." msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:85 #, fuzzy msgid "[ceiling](ceiling.md), [mod](mod.md)." msgstr "[ceiling](ceiling.md), [mod](mod.md)." #: ../../doc/src/intrinsics/numeric/anint.md:1 msgid "anint(x, [kind]): Round to Nearest Whole Number" msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:3 msgid "Round to nearest whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:25 msgid "The return value is equal to rounded whole number." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:29 msgid "**anint(x)** calculates rounded value of input parameter `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/anint.md:34 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 "[aint](aint.md)." #: ../../doc/src/intrinsics/numeric/ceiling.md:1 msgid "ceiling(x): Integer Ceiling" msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:3 msgid "Integer ceiling function" msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:16 msgid "The input value `x` may be of type real or integer." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:20 msgid "The return value is of type integer and nearest greater integer." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:24 msgid "**ceiling(x)** returns the least integer greater than or equal to `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:28 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 "[floor](floor.md), [mod](mod.md)." #: ../../doc/src/intrinsics/numeric/cmplx.md:1 msgid "cmplx(x [, [, kind]]): Convert to Complex" msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:3 msgid "Conversion to complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:14 msgid "`cmplx(x, y)` is one of the intrinsic present in ASR." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:18 msgid "" "`x` the input value must be of integer, real, or complex. `y` the " "optional input value must be of type integer or real. It should be only " "present in case `x` is not complex. `kind` the optional input value of " "integer expression type for initialisation indicating the kind parameter " "of the result." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/cmplx.md:32 msgid "" "**cmplx(x, [, y [, kind]])** converts the input value to complex " "representation:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/cmplx.md:37 msgid "If `y` is not present, the imaginary component is set to 0.0." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:39 msgid "If `x` is complex then `y` must not be present." msgstr "" #: ../../doc/src/intrinsics/numeric/cmplx.md:49 msgid "Supported argument types are integer, real, or complex." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:1 msgid "conjg(x): Complex Conjugate" msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:3 msgid "Complex conjugate function." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:17 msgid "`x` the input value must be of type complex." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:21 msgid "The return value is of complex type." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:25 msgid "**conjg(x)** converts the input value `x` to its conjugate." msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:29 msgid "$x + iy$ converted to $x - iy$" msgstr "" #: ../../doc/src/intrinsics/numeric/conjg.md:35 msgid "Supported argument types is complex." msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:1 msgid "digits(x): Significant Binary Digits" msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:3 msgid "Significant binary digits." msgstr "" #: ../../doc/src/intrinsics/numeric/digits.md:15 msgid "`x` the input value must be of type real or integer." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/dim.md:1 msgid "dim(x, y): Positive Difference or 0" msgstr "" #: ../../doc/src/intrinsics/numeric/dim.md:3 msgid "Positive difference or 0." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/dim.md:20 msgid "The return value is of type integer or real." 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 "" #: ../../doc/src/intrinsics/numeric/epsilon.md:1 #, fuzzy msgid "epsilon(x): Epsilon" msgstr "epsilon(x): Epsilon" #: ../../doc/src/intrinsics/numeric/epsilon.md:3 msgid "Epsilon function." msgstr "Função Epsilon." #: ../../doc/src/intrinsics/numeric/epsilon.md:20 msgid "The return value is of same type as of the input argument." msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:24 msgid "" "**epsilon(x)** computes the smallest number $\\epsilon$ of the same kind " "as `x` following:" msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:27 msgid "$1 + \\epsilon > 1$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:1 msgid "erf(x): Error" msgstr "erf(x): Erro" #: ../../doc/src/intrinsics/numeric/erf.md:3 msgid "Error function." msgstr "Função Erro." #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/erf.md:27 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 "$\\frac{2}{\\sqrt\\pi}\\int_0^xe^{-t^2}dt$" #: ../../doc/src/intrinsics/numeric/erf.md:69 #, fuzzy msgid "[erfc](erfc.md)." msgstr "[erfc](erfc.md)." #: ../../doc/src/intrinsics/numeric/erfc.md:1 msgid "erfc(x): Complementary Error" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:3 msgid "Complementary error function." 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 "" #: ../../doc/src/intrinsics/numeric/erfc.md:27 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 "$\\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 "" #: ../../doc/src/intrinsics/numeric/erfc.md:72 #, fuzzy msgid "[erf](erf.md)." msgstr "[erf](erf.md)." #: ../../doc/src/intrinsics/numeric/exp.md:1 msgid "exp(x): Exponential" msgstr "exp(x): Exponencial" #: ../../doc/src/intrinsics/numeric/exp.md:3 msgid "Exponential function." msgstr "Função Exponencial." #: ../../doc/src/intrinsics/numeric/exp.md:16 msgid "`x` the input value must be of type real or complex." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:20 msgid "The return value is of same type as of the input argument, `x`." msgstr "" #: ../../doc/src/intrinsics/numeric/exp.md:24 msgid "**exp(x)** computes the base $e$ exponential of `x`, i.e., $e^x$." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/exp.md:31 msgid "Supported argument types is real and complex." msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:1 msgid "floor(x, kind): Integer Floor" msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:3 msgid "Integer floor function." msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:18 msgid "" "`kind` the optional input parameter must be a scalar integer constant " "expression." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:1 msgid "gamma(x): Gamma" msgstr "gamma(x): Gama" #: ../../doc/src/intrinsics/numeric/gamma.md:3 msgid "Gamma function." msgstr "Função Gama." #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:21 msgid "The return value is of same type and kind as of `x`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:28 msgid "$\\gamma(x) = (x-1)!$" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:30 msgid "In general, if $x > 0$:" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:32 msgid "$\\gamma(x) = \\int_{0}^{\\infty} e^{-t} dt$" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:34 msgid "and if $-n-1 < x < -n$ where n is an integer >= 0:" msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/gamma.md:76 #, fuzzy msgid "[epsilon](epsilon.md)" msgstr "[epsilon](epsilon.md)" #: ../../doc/src/intrinsics/numeric/mod.md:1 msgid "mod(x, y): Modulus" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:3 msgid "Modulus or remainder function." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:17 msgid "`x` the input value, can be integer or real." msgstr "" #: ../../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 "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/mod.md:27 msgid "`x - INT (x / y) * y`." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:29 msgid "If `y` is 0, the result is undefined like `any integer value / 0`." msgstr "" #: ../../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 "" #: ../../doc/src/intrinsics/numeric/mod.md:36 msgid "`x - INT(x / y) * y`" msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:38 msgid "" "i.e., result is remainder when first argument is mathematically divided " "by second argument." msgstr "" #: ../../doc/src/intrinsics/numeric/mod.md:41 msgid "The return value should be less than `y`." msgstr "" #: ../../doc/src/language.md:1 msgid "Fortran Language" msgstr "Linguagem Fortran" #: ../../doc/src/language.md:3 msgid "Background and Motivation" msgstr "" #: ../../doc/src/language.md:5 msgid "" "Fortran was designed from the ground up to naturally and simply translate" " mathematics to code that compiles and runs at maximum speed. And being " "specifically targeted for such fundamentally computational tasks, it " "contains a broad range of key functionality within the language itself, " "standard across all platforms, with no need for external libraries that " "may or may not be well optimized or maintained, at present or down the " "road." msgstr "" #: ../../doc/src/language.md:12 msgid "Some highlights:" msgstr "Alguns destaques:" #: ../../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 "" #: ../../doc/src/language.md:17 msgid "" "Operators which operate naturally upon the aforementioned " "arrays/matrices, as they do scalars;" msgstr "" #: ../../doc/src/language.md:19 msgid "Complex numbers;" msgstr "Números complexos;" #: ../../doc/src/language.md:20 msgid "Special functions;" msgstr "Funções especiais;" #: ../../doc/src/language.md:21 msgid "Structures and pointers for more general data representation." msgstr "" #: ../../doc/src/language.md:23 msgid "" "Because the essentials are contained in the language itself, it is simple" " to read and write, without need of choosing from among or deciphering a " "proliferation of external classes to do the same thing. And because the " "essentials are self-contained, compilers can provide detailed compile-" "time (e.g., argument mismatch) and run-time (e.g., memory access) checks," " as well as highly optimized executables, directly from natural, readable" " code without need of extensive optimization heroics by the developer." msgstr "" #: ../../doc/src/language.md:31 msgid "See our blog posts for more information:" msgstr "" #: ../../doc/src/language.md:33 msgid "" "[Why We Created LFortran](https://lfortran.org/blog/2019/04/why-we-" "created-lfortran/)" msgstr "" #: ../../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 "" #: ../../doc/src/language.md:36 msgid "How to Learn Fortran" msgstr "" #: ../../doc/src/language.md:38 msgid "" "Fortran is relatively quick to learn because it is so much simpler and " "smaller than C/C++ (in practice, that is, with all needed libraries " "included). If you are interested in learning more, please see our webpage" " at [fortran90.org] with recommended practices for writing code, side by " "side comparison with Python/NumPy, links to other online Fortran " "resources and books, and an FAQ." msgstr "" #: ../../doc/src/progress.md:3 msgid "" "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:" msgstr "" #: ../../doc/src/progress.md:7 msgid "AST: The code can be parsed to AST (`lfortran --show-ast test.f90`)" msgstr "" #: ../../doc/src/progress.md:8 msgid "ASR: The code can be transformed to ASR (`lfortran --show-asr test.f90`)" msgstr "" #: ../../doc/src/progress.md:9 msgid "LLVM: LFortran can generate LLVM IR (`lfortran --show-llvm test.f90`)" msgstr "" #: ../../doc/src/progress.md:10 msgid "BIN: The LLVM IR can compile to a binary" msgstr "" #: ../../doc/src/progress.md:11 msgid "RUN: The binary runs without errors" msgstr "" #: ../../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 "" #: ../../doc/src/progress.md:16 msgid "" "This page is generated automatically using the [Compiler " "Tester](https://gitlab.com/lfortran/compiler_tester) repository which " "contains all the Fortran tests and scripts to run LFortran to produce the" " tables below. We are looking for contributors to contribute more tests. " "Our goal is to have a comprehensive Fortran testsuite that can be used to" " test any Fortran compiler." msgstr "" #: ../../doc/src/progress.md:23 msgid "Testing the LFortran compiler version:" msgstr "" #: ../../doc/src/progress.md:32 msgid "Topics" msgstr "Tópicos" #: ../../doc/src/progress.md:34 msgid "Full programs that compute something interesting" msgstr "Programas completos em que fazemos cálculo de algo interessante" #: ../../doc/src/progress.md:36 msgid "Basic Numerics" msgstr "" #: ../../doc/src/progress.md:38 msgid "Directory: `tests/programs/numerics`" msgstr "Diretório: `tests/programs/numerics`" #: ../../doc/src/progress.md msgid "LLVM" msgstr "LLVM" #: ../../doc/src/progress.md #, fuzzy msgid "BIN" msgstr "BIN" #: ../../doc/src/progress.md #, fuzzy msgid "RUN" msgstr "RUN" #: ../../doc/src/progress.md msgid "Filename" msgstr "Nome do ficheiro" #: ../../doc/src/progress.md msgid "`Pure Fortran sin(x) implementation`" msgstr "`Implementação em Fortran puro de sin(x)`" #: ../../doc/src/progress.md #, fuzzy msgid "✅" 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 "Módulos" #: ../../doc/src/progress.md:47 msgid "Basic Usage" msgstr "Utilização básica" #: ../../doc/src/progress.md:49 msgid "Directory: `tests/modules/basic`" 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 "Sub-rotinas e Funções dos Módulos" #: ../../doc/src/progress.md:58 msgid "Directory: `tests/modules/procedures`" msgstr "" #: ../../doc/src/progress.md 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 "Expressões" #: ../../doc/src/progress.md:69 msgid "Arithmetic Operations" msgstr "" #: ../../doc/src/progress.md:71 msgid "Directory: `tests/expressions/arit`" msgstr "" #: ../../doc/src/progress.md #, fuzzy msgid "`+,-,*,/,**`" 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 "Inteiros" #: ../../doc/src/progress.md:80 msgid "Directory: `tests/expressions/integers`" msgstr "" #: ../../doc/src/progress.md #, fuzzy msgid "`integers`" 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" msgstr "" #: ../../doc/src/progress.md:91 msgid "Directory: `tests/expressions/reals`" msgstr "" #: ../../doc/src/progress.md 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 "âŒ" #: ../../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" msgstr "" #: ../../doc/src/progress.md:101 msgid "Directory: `tests/expressions/complex`" msgstr "" #: ../../doc/src/progress.md msgid "`single/double complex`" 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 "Cadeia de Caracteres" #: ../../doc/src/progress.md:110 msgid "Directory: `tests/expressions/character`" msgstr "Diretório: `tests/expressions/character`" #: ../../doc/src/progress.md #, fuzzy msgid "`character`" 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 "`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 "Tipos Derivados" #: ../../doc/src/progress.md:120 msgid "Directory: `tests/expressions/derived_type`" 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 "Comandos" #: ../../doc/src/progress.md:129 msgid "Allocate Statement" msgstr "Comando Allocate" #: ../../doc/src/progress.md:131 msgid "Directory: `tests/statements/allocate`" msgstr "Diretório: `tests/statements/allocate`" #: ../../doc/src/progress.md msgid "`allocate statement`" 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 "Comando Block" #: ../../doc/src/progress.md:140 msgid "Directory: `tests/statements/block`" msgstr "Diretório: `tests/statements/block`" #: ../../doc/src/progress.md msgid "`block statement`" 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 "Comando Goto" #: ../../doc/src/progress.md:149 msgid "Directory: `tests/statements/goto`" 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 "`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 "Comando if" #: ../../doc/src/progress.md:159 msgid "Directory: `tests/statements/if`" msgstr "Diretório: `tests/statements/if`" #: ../../doc/src/progress.md msgid "`Test .false.`" 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 "`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 "`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 "Comando While" #: ../../doc/src/progress.md:171 msgid "Directory: `tests/statements/while`" 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 "`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 "Comando Print" #: ../../doc/src/progress.md:181 msgid "Directory: `tests/statements/print`" msgstr "Diretório: `tests/statements/print`" #: ../../doc/src/progress.md msgid "`Basic print`" 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" msgstr "" #: ../../doc/src/progress.md:190 msgid "Directory: `tests/statements/file_io`" msgstr "Diretório: `tests/statements/file_io`" #: ../../doc/src/progress.md #, fuzzy msgid "`open/read/write/close`" 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 "Funções Intrínsecas" #: ../../doc/src/progress.md:199 msgid "abs" msgstr "abs" #: ../../doc/src/progress.md:201 msgid "Directory: `tests/intrinsic/abs`" 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 "exp" #: ../../doc/src/progress.md:212 msgid "Directory: `tests/intrinsic/exp`" 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 "log" #: ../../doc/src/progress.md:223 msgid "Directory: `tests/intrinsic/log`" 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 "sqrt" #: ../../doc/src/progress.md:234 msgid "Directory: `tests/intrinsic/sqrt`" 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 "sin" #: ../../doc/src/progress.md:245 msgid "Directory: `tests/intrinsic/sin`" 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 "cos" #: ../../doc/src/progress.md:256 msgid "Directory: `tests/intrinsic/cos`" 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 "tan" #: ../../doc/src/progress.md:267 msgid "Directory: `tests/intrinsic/tan`" 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 "sinh" #: ../../doc/src/progress.md:278 msgid "Directory: `tests/intrinsic/sinh`" 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 "cosh" #: ../../doc/src/progress.md:289 msgid "Directory: `tests/intrinsic/cosh`" 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 "tanh" #: ../../doc/src/progress.md:300 msgid "Directory: `tests/intrinsic/tanh`" 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 "asin" #: ../../doc/src/progress.md:311 msgid "Directory: `tests/intrinsic/asin`" 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 "acos" #: ../../doc/src/progress.md:322 msgid "Directory: `tests/intrinsic/acos`" 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 "atan" #: ../../doc/src/progress.md:333 msgid "Directory: `tests/intrinsic/atan`" 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 "modulo" #: ../../doc/src/progress.md:344 msgid "Directory: `tests/intrinsic/modulo`" 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 "mod" #: ../../doc/src/progress.md:354 msgid "Directory: `tests/intrinsic/mod`" 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 "min" #: ../../doc/src/progress.md:364 msgid "Directory: `tests/intrinsic/min`" 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 "max" #: ../../doc/src/progress.md:373 msgid "Directory: `tests/intrinsic/max`" 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 "int" #: ../../doc/src/progress.md:382 msgid "Directory: `tests/intrinsic/int`" 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 "real" #: ../../doc/src/progress.md:391 msgid "Directory: `tests/intrinsic/real`" 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 "floor" #: ../../doc/src/progress.md:400 msgid "Directory: `tests/intrinsic/floor`" 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 "nint" #: ../../doc/src/progress.md:409 msgid "Directory: `tests/intrinsic/nint`" 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)" lfortran-0.63.0/doc/build.py0000664000175000017500000001146215174404631016042 0ustar alastairalastair""" Script for conveniently building the documentation in all supported languages. Run this script with: .. code:: python3 build.py You can also pass the language as an argument: .. code:: python3 build.py en de The first language will be handled as the default language. """ import json import sys import subprocess from pathlib import Path from typing import List, Dict root = Path(__file__).parent """ Make sure to run this script from the root of the documentation repository. """ template = """ Page Redirection If you are not redirected automatically, follow the link. """ all_redirects = { "index.html": "{0}/", **{ f"{name}/index.html": f"../{{0}}/{name}/" for name in ( "installation", "language", "progress", "design", "developer_tutorial", "ast_and_asr", "contributing", ) }, **{ f"intrinsics/{name}/index.html": f"../../../{{0}}/intrinsics/{name}/" for name in ( "array/allocated", "array/cshift", "array/size", "bit/bge", "bit/bgt", "bit/bit_size", "bit/ble", "bit/blt", "bit/btest", "bit/shiftl", "bit/shiftr", "bit/rshift", "character/achar", "character/adjustl", "character/adjustr", "character/char", "character/lge", "character/len_trim", "kind-type/kind", "mathematical/acos", "mathematical/acosh", "mathematical/asin", "mathematical/asinh", "mathematical/atan", "mathematical/atan2", "mathematical/atanh", "mathematical/fraction", "misc/command_argument_count", "misc/cpu_time", "misc/date_and_time", "misc/new_line", "numeric/abs", "numeric/aimag", "numeric/aint", "numeric/anint", "numeric/ceiling", "numeric/cmplx", "numeric/conjg", "numeric/digits", "numeric/dim", "numeric/epsilon", "numeric/erf", "numeric/erfc", "numeric/exp", "numeric/floor", "numeric/gamma", "numeric/mod", ) }, } """ All redirects from the original site without language component. """ all_languages: List[str] """ List of currently supported languages, taken from ``doc/src/_static/languages.json``. To support a new language add its `language code`_ to the list. .. _language code: https://www.sphinx-doc.org/en/master/usage/configuration.html#intl-options """ with open(root / "src" / "_static" / "languages.json") as fd: all_languages = list(json.load(fd).values()) def build_docs(language: str) -> None: """ Build the documentation for a single language. Parameters ---------- language : str The language to build the documentation for. """ subprocess.run( [ "sphinx-build", "-b", "dirhtml", str(root / "src"), str(root / "site" / language), f"-Dlanguage={language}", ], cwd=root, check=True, ) def build_redirects(redirects: Dict[str, str], language: str) -> None: """ Build the redirects for a single language. Parameters ---------- redirects : Dict[str, str] Page redirects to build. language : str The language to build the redirects for. """ for source, target in redirects.items(): source_path = root / "site" / source redirect = template.format(target.format(language)) if not source_path.parent.exists(): source_path.parent.mkdir(parents=True) with open(source_path, "w", encoding="utf-8") as fd: fd.write(redirect) def build_all(redirects: Dict[str, str], languages: List[str]) -> None: """ Build the documentation for all languages. Parameters ---------- redirects : Dict[str, str] Page redirects to build. languages : List[str] List of languages to build the documentation for. """ for language in languages: build_docs(language) build_redirects(redirects, languages[0]) if __name__ == "__main__": languages = sys.argv[1:] if len(sys.argv) > 1 else all_languages build_all(all_redirects, languages) print() print("Preview the documentation using") print() print(f" python3 -m http.server -d \"{root / 'site'}\"") print() lfortran-0.63.0/doc/.gitignore0000664000175000017500000000002715174404631016354 0ustar alastairalastair*.mo /site/ /_gettext/ lfortran-0.63.0/run_tests.py0000775000175000017500000006145415174404631016235 0ustar alastairalastair#!/usr/bin/env python import os import subprocess as sp import sys from typing import Dict ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__))) sys.path.append(os.path.join(ROOT_DIR, "src", "libasr")) from compiler_tester.tester import color, fg, log, run_test, style, tester_main def run_cmd(cmd, cwd=None): print(f"+ {cmd}") process = sp.run(cmd, shell=True, cwd=cwd) if process.returncode != 0: print("Command failed.") exit(1) def single_test(test: Dict, verbose: bool, no_llvm: bool, skip_run_with_dbg: bool, update_reference: bool, verify_hash: bool, no_color: bool, specific_backends=None, excluded_backends=None) -> None: def is_included(backend): return test.get(backend, False) \ and (specific_backends is None or backend in specific_backends) \ and (excluded_backends is None or backend not in excluded_backends) filename = test["filename"] show_verbose = "" if not verbose else "-v" tokens = is_included("tokens") ast = is_included("ast") ast_indent = is_included("ast_indent") ast_disable_style_suggestion = is_included("ast_disable_style_suggestion") ast_json = is_included("ast_json") ast_no_prescan = is_included("ast_no_prescan") ast_f90 = is_included("ast_f90") ast_cpp = is_included("ast_cpp") ast_cpp_hip = is_included("ast_cpp_hip") ast_openmp = is_included("ast_openmp") lookup_name = is_included("lookup_name") rename_symbol = is_included("rename_symbol") line = "-1" if is_included("line"): line = str(test["line"]) column = "-1" if is_included("column"): column = str(test["column"]) asr = is_included("asr") asr_ignore_pragma = is_included("asr_ignore_pragma") asr_implicit_typing = is_included("asr_implicit_typing") asr_disable_implicit_typing = is_included("asr_disable_implicit_typing") enable_and_disable_implicit_typing = is_included("enable_and_disable_implicit_typing") asr_implicit_interface = is_included("asr_implicit_interface") asr_implicit_interface_and_typing = is_included("asr_implicit_interface_and_typing") asr_implicit_argument_casting = is_included("asr_implicit_argument_casting") enable_disable_implicit_argument_casting = is_included("enable_disable_implicit_argument_casting") asr_implicit_interface_and_typing_with_llvm = is_included("asr_implicit_interface_and_typing_with_llvm") asr_disable_warnings = is_included("asr_disable_warnings") asr_disable_style_suggestion_and_warnings = is_included("asr_disable_style_suggestion_and_warnings") asr_enable_style_suggestion = is_included("asr_enable_style_suggestion") enable_disable_style_suggestion = is_included("enable_disable_style_suggestion") continue_compilation = is_included("continue_compilation") fixed_form_cc_asr = is_included("fixed_form_cc_asr") semantics_only_cc = is_included("semantics_only_cc") show_errors = is_included("show_errors") document_symbols = is_included("document_symbols") syntax_only_cc = is_included("syntax_only_cc") show_asr_with_cc = is_included("show_asr_with_cc") asr_use_loop_variable_after_loop = is_included("asr_use_loop_variable_after_loop") asr_preprocess = is_included("asr_preprocess") asr_indent = is_included("asr_indent") asr_json = is_included("asr_json") asr_clojure = is_included("asr_clojure") asr_openmp = is_included("asr_openmp") c_target_omp = is_included("c_target_omp") c_target_cuda = is_included("c_target_cuda") asr_logical_casting = is_included("asr_logical_casting") mod_to_asr = is_included("mod_to_asr") llvm = is_included("llvm") cpp = is_included("cpp") cpp_infer = is_included("cpp_infer") c = is_included("c") is_cumulative_pass = is_included("cumulative") julia = is_included("julia") wat = is_included("wat") obj = is_included("obj") x86 = is_included("x86") fortran = is_included("fortran") bin_ = is_included("bin") fast = is_included("fast") print_leading_space = is_included("print_leading_space") interactive = is_included("interactive") options = test.get("options", "") pass_ = test.get("pass", None) extrafiles = test.get("extrafiles", "").split(",") run = test.get("run") run_with_dbg = test.get("run_with_dbg") optimization_passes = ["flip_sign", "div_to_mul", "fma", "sign_from_value", "inline_function_calls", "loop_unroll", "dead_code_removal"] if pass_ is not None: pass_list = pass_.split(",") for _pass in pass_list: _pass = _pass.rstrip(" ").lstrip(" ") if (_pass not in ["do_loops", "global_stmts", "transform_optional_argument_functions", "array_op", "select_case", "class_constructor", "implied_do_loops", "pass_array_by_data", "init_expr", "where", "nested_vars", "insert_deallocate", "openmp", "array_struct_temporary"] and _pass not in optimization_passes): raise Exception(f"Unknown pass: {_pass}") if update_reference: log.debug(f"{color(style.bold)} UPDATE TEST: {color(style.reset)} {filename}") elif verify_hash: log.debug(f"{color(style.bold)} VERIFY HASH: {color(style.reset)} {filename}") else: log.debug(f"{color(style.bold)} START TEST: {color(style.reset)} {filename}") extra_args = f"--no-error-banner {show_verbose}" if print_leading_space: extra_args += " --print-leading-space" if interactive: extra_args += " --interactive-parse" if cpp_infer: extra_args += " --cpp-infer" if line: extra_args += " --line=" + line if column: extra_args += " --column=" + column if options: extra_args += " " + options if tokens: run_test( filename, "tokens", "lfortran --no-color --show-tokens {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if ast: if filename.endswith(".f"): # Use fixed form run_test( filename, "ast", "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) else: run_test( filename, "ast", "lfortran --show-ast --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if ast_indent: run_test( filename, "ast_indent", "lfortran --show-ast --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if ast_openmp: run_test( filename, "ast_openmp", "lfortran --show-ast --no-color --openmp {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if enable_and_disable_implicit_typing: if no_llvm: log.info(f"{filename} * obj SKIPPED as requested") else: run_test(filename, "run", "lfortran --implicit-typing --disable-implicit-typing --no-color {infile}", filename, update_reference, verify_hash, extra_args) if enable_disable_implicit_argument_casting: if no_llvm: log.info(f"{filename} * obj SKIPPED as requested") else: run_test(filename, "run", "lfortran --implicit-argument-casting --disable-implicit-argument-casting --no-color {infile}", filename, update_reference, verify_hash, extra_args) if ast_json: run_test( filename, "ast_json", "lfortran --show-ast --no-indent --json {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if ast_disable_style_suggestion: run_test( filename, "ast_disable_style_suggestion", "lfortran --show-ast --no-style-suggestions --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if ast_no_prescan: # Use free form with prescan disabled run_test( filename, "ast_no_prescan", "lfortran --no-prescan --show-ast --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if ast_f90: if filename.endswith(".f"): # Use fixed form run_test( filename, "ast_f90", "lfortran --fixed-form --show-ast-f90 --no-indent --no-color {infile}", filename, update_reference, verify_hash, extra_args) else: # Use free form run_test( filename, "ast_f90", "lfortran --show-ast-f90 --no-indent --no-color {infile}", filename, update_reference, verify_hash, extra_args) if lookup_name: run_test( filename, "lookup_name", "lfortran --lookup-name --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if rename_symbol: run_test( filename, "rename_symbol", "lfortran --rename-symbol --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_disable_warnings: run_test( filename, "asr_disable_warnings", "lfortran --show-asr --no-warnings --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_disable_style_suggestion_and_warnings: run_test( filename, "asr_disable_style_suggestion_and_warnings", "lfortran --show-asr --no-style-suggestions --no-warnings --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_enable_style_suggestion: if no_llvm: log.info(f"{filename} * obj SKIPPED as requested") else: run_test( filename, "asr_enable_style_suggestion", "lfortran --std=f23 --style-suggestions --no-color {infile}", filename, update_reference, verify_hash, extra_args) if enable_disable_style_suggestion: if no_llvm: log.info(f"{filename} * obj SKIPPED as requested") else: run_test( filename, "enable_disable_style_suggestion", "lfortran --style-suggestions --no-style-suggestions --no-color {infile}", filename, update_reference, verify_hash, extra_args) if asr: # run fixed form if filename.endswith(".f"): run_test( filename, "asr", "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) else: skip_test = False for extrafile in extrafiles: extrafile_ = extrafile.rstrip().lstrip() if no_llvm and len(extrafile_) > 0: log.info(f"{filename} * asr SKIPPED because LLVM is not enabled") skip_test = True break if len(extrafile_) > 0: extrafile_ = os.path.join("tests", extrafile_) modfile = extrafile_[:-4] + ".mod" if not os.path.exists(modfile): run_cmd("lfortran -c {}".format(extrafile_)) if not skip_test: run_test( filename, "asr", "lfortran --show-asr --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if pass_ is not None: if fast: cmd = "lfortran --pass=" + pass_ + \ " --show-asr --no-color --fast {infile} -o {outfile}" else: cmd = "lfortran --pass=" + pass_ + \ " --show-asr --no-color {infile} -o {outfile}" pass_ = pass_.replace(",", "_") run_test(filename, "pass_{}".format(pass_), cmd, filename, update_reference, verify_hash, extra_args) pass_ = None if asr_implicit_interface_and_typing: # run fixed form if filename.endswith(".f"): run_test( filename, "asr", "lfortran --fixed-form --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) else: run_test( filename, "asr", "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_use_loop_variable_after_loop: run_test( filename, "asr", "lfortran --show-asr --use-loop-variable-after-loop --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_implicit_argument_casting: run_test( filename, "asr", "lfortran --show-asr --implicit-argument-casting --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_implicit_interface_and_typing_with_llvm: if no_llvm: log.info(f"{filename} * llvm SKIPPED as requested") else: run_test( filename, "llvm", "lfortran --show-llvm --implicit-typing --implicit-interface {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if semantics_only_cc: run_test(filename, "asr", "lfortran --semantics-only --continue-compilation --no-color {infile}", filename, update_reference, verify_hash, extra_args) if document_symbols: skip_test = False for extrafile in extrafiles: extrafile_ = extrafile.rstrip().lstrip() if no_llvm and len(extrafile_) > 0: log.info(f"{filename} * asr SKIPPED because LLVM is not enabled") skip_test = True break if len(extrafile_) > 0: extrafile_ = os.path.join("tests", extrafile_) modfile = extrafile_[:-4] + ".mod" if not os.path.exists(modfile): run_cmd("lfortran -c {}".format(extrafile_)) if not skip_test: run_test(filename, "asr", "lfortran --show-document-symbols --no-color {infile}", filename, update_reference, verify_hash, extra_args) if show_errors: run_test(filename, "asr", "lfortran --show-errors --continue-compilation --no-color {infile}", filename, update_reference, verify_hash, extra_args) if syntax_only_cc: run_test(filename, "ast", "lfortran --continue-compilation --show-ast --no-color {infile}", filename, update_reference, verify_hash, extra_args) if show_asr_with_cc: run_test(filename, "asr", "lfortran --continue-compilation --show-asr --no-color {infile}", filename, update_reference, verify_hash, extra_args) if continue_compilation: if no_llvm: log.info(f"{filename} * obj SKIPPED as requested") else: run_test(filename, "run", "lfortran --continue-compilation --no-color {infile}", filename, update_reference, verify_hash, extra_args) if fixed_form_cc_asr: run_test( filename, "asr", "lfortran --fixed-form --continue-compilation --show-asr --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_implicit_typing: run_test( filename, "asr", "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_disable_implicit_typing: if no_llvm: log.info(f"{filename} * llvm SKIPPED as requested") run_test( filename, "asr", "lfortran --std=f23 --show-asr --disable-implicit-typing --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_implicit_interface: if filename.endswith(".f"): run_test( filename, "asr", "lfortran --fixed-form --implicit-interface --show-asr --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) else: run_test( filename, "asr", "lfortran --show-asr --implicit-interface --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_preprocess: run_test( filename, "asr_preprocess", "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_indent: run_test( filename, "asr_indent", "lfortran --show-asr --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_json: run_test( filename, "asr_json", "lfortran --show-asr --no-indent --json {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_clojure: run_test( filename, "asr_clojure", "lfortran --show-asr --no-color --no-indent --clojure {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_openmp: run_test( filename, "asr_openmp", "lfortran --show-asr --no-color --openmp {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if c_target_omp: run_test( filename, "c_target_omp", "lfortran --show-c --openmp {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if c_target_cuda: run_test( filename, "c_target_cuda", "lfortran --show-c --openmp --target-offload {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_logical_casting: run_test( filename, "asr_logical_casting", "lfortran --show-asr --logical-casting --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if mod_to_asr: run_test( filename, "mod_to_asr", "lfortran mod --show-asr --no-indent --no-color {infile}", filename, update_reference, verify_hash) if asr_ignore_pragma: run_test( filename, "asr_ignore_pragma", "lfortran --ignore-pragma --show-asr --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if pass_ is not None: cmd = "lfortran " if is_cumulative_pass: cmd += "--cumulative " cmd += "--pass=" + pass_ + \ " --show-asr --no-color {infile} -o {outfile}" pass_ = pass_.replace(",", "_") run_test(filename, "pass_{}".format(pass_), cmd, filename, update_reference, verify_hash, extra_args) if llvm: if no_llvm: log.info(f"{filename} * llvm SKIPPED as requested") else: run_test( filename, "llvm", "lfortran --no-color --show-llvm {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if cpp: run_test(filename, "cpp", "lfortran --no-color --show-cpp {infile}", filename, update_reference, verify_hash, extra_args) if obj: if no_llvm: log.info(f"{filename} * obj SKIPPED as requested") else: run_test( filename, "obj", "lfortran --no-color -c {infile} -o output.o", filename, update_reference, verify_hash, extra_args) if c: run_test(filename, "c", "lfortran --no-color --show-c {infile}", filename, update_reference, verify_hash, extra_args) if julia: run_test(filename, "julia", "lfortran --no-color --show-julia {infile}", filename, update_reference, verify_hash, extra_args) if wat: run_test(filename, "wat", "lfortran --no-color --show-wat {infile}", filename, update_reference, verify_hash, extra_args) if x86: run_test( filename, "x86", "lfortran --no-color --backend=x86 {infile} -o output", filename, update_reference, verify_hash, extra_args) if fortran: run_test( filename, "fortran", "lfortran --show-fortran --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if bin_: run_test(filename, "bin", "lfortran --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if run: if no_llvm: log.info(f"{filename} * obj SKIPPED as requested") else: run_test(filename, "run", "lfortran --no-color {infile}", filename, update_reference, verify_hash, extra_args) if run_with_dbg: if skip_run_with_dbg: log.info(f"{filename} * run_with_dbg SKIPPED as requested") else: run_test( filename, "run_dbg", "lfortran {infile} -g --no-color", filename, update_reference, verify_hash, extra_args) if __name__ == "__main__": tester_main("LFortran", single_test) lfortran-0.63.0/build1.bat0000664000175000017500000000045415174404631015473 0ustar alastairalastaircmake ^ -DCMAKE_BUILD_TYPE=Release ^ -DWITH_LLVM=yes ^ -DLFORTRAN_BUILD_ALL=yes ^ -DWITH_STACKTRACE=no ^ -DCMAKE_PREFIX_PATH="%CONDA_PREFIX%" ^ -DCMAKE_INSTALL_PREFIX=%cd%/inst ^ -DCMAKE_EXPORT_COMPILE_COMMANDS=yes ^ . cmake --build . --config Release --target installlfortran-0.63.0/CLAUDE.md0000777000175000017500000000000015174404631016375 2AGENTS.mdustar alastairalastairlfortran-0.63.0/bench.sh0000775000175000017500000000212215174404631015233 0ustar alastairalastair#!/usr/bin/env bash # # Compile the latest master and a given PR in Release mode from scratch. # # Install the usual `lf` environment, and also `mamba install zlib fmt`. # # Example: # # ./bench.sh 448 # bench/main/src/bin/parse # bench/pr/src/bin/parse # bench/main/src/bin/parse2 # bench/pr/src/bin/parse2 set -ex PR=$1 if [[ $PR == "" ]]; then echo "Specify the PR number as an argument" exit 1 fi echo "Benchmarking the latest master against the PR !$1" rm -rf bench mkdir bench cd bench git clone https://github.com/lfortran/lfortran cd lfortran ./build0.sh cd .. mkdir main cd main #cmake -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DWITH_FMT=yes -DCMAKE_CXX_FLAGS_RELEASE="-Wall -Wextra -O3 -funroll-loops -DNDEBUG" ../lfortran cmake -DWITH_FMT=yes ../lfortran make -j cd .. cd lfortran git clean -dfx git fetch origin pull/$PR/head:pr-origin-$PR git checkout pr-origin-$PR ./build0.sh cd .. mkdir pr cd pr #cmake -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DWITH_FMT=yes -DCMAKE_CXX_FLAGS_RELEASE="-Wall -Wextra -O3 -funroll-loops -DNDEBUG" ../lfortran cmake -DWITH_FMT=yes ../lfortran make -j cd .. lfortran-0.63.0/grammar/0000775000175000017500000000000015174404631015246 5ustar alastairalastairlfortran-0.63.0/grammar/AST.asdl0000664000175000017500000004520215174404631016545 0ustar alastairalastair-- This is an Abstract Syntax Description Lanuguage (ASDL) that describes the -- Fortran's Abstract Syntax Tree (AST). See [1] for a short background -- information and motivation and see the paper [2] for a detailed motivation, -- explanation and specification of the language. See [3] for further examples -- of ASDL usage in a real compiler. -- -- [1] https://eli.thegreenplace.net/2014/06/04/using-asdl-to-describe-asts-in-compilers/ -- [2] Wang, D. C., Appel, A. W., Korn, J. L., & Serra, C. S. (1997). The Zephyr Abstract Syntax Description Language. USENIX Conference on Domain-Specific Languages, (October), 213–228. -- [3] https://arxiv.org/abs/cs/9810013 -- -- ASDL's builtin types are: -- * identifier -- * int (signed integers of infinite precision) -- * string -- We extend these by: -- * node (any ASDL node) -- * bool -- -- Specific tools may choose to produce language interfaces that represent -- these types and the ASDL tree in a language specific way (e.g. use finite -- precision integers and signal an error otherwise). -- -- At the AST level we strictly only represent local syntax (no semantics). That -- way each syntax construct is parsed locally, no need to do any non-local -- lookups to figure out what AST node to construct. That is the job of the AST -- to ASR conversion to do non-local lookups to figure out what is what (i.e., -- disambiguate) and report any errors. module AST { unit = TranslationUnit(node* items) mod = Module(identifier name, trivia? trivia, unit_decl1* use, implicit_statement* implicit, unit_decl2* decl, stmt* body, program_unit* contains, location start_name, location end_name) | Submodule(identifier id, identifier? parent_name, identifier name, trivia? trivia, unit_decl1* use, implicit_statement* implicit, unit_decl2* decl, stmt* body, program_unit* contains, location start_name, location end_name) | BlockData(identifier? name, trivia? trivia, unit_decl1* use, implicit_statement* implicit, unit_decl2* decl, stmt* body) | Program(identifier name, trivia? trivia, unit_decl1* use, implicit_statement* implicit, unit_decl2* decl, stmt* body, program_unit* contains, location start_name, location end_name) program_unit = Subroutine(identifier name, arg* args, decl_attribute* attributes, bind? bind, trivia? trivia, unit_decl1* use, import_statement* import, implicit_statement* implicit, unit_decl2* decl, stmt* body, program_unit* contains, identifier* temp_args, location start_name, location end_name) | Procedure(identifier name, arg* args, decl_attribute* attributes, trivia? trivia, unit_decl1* use, import_statement* import, implicit_statement* implicit, unit_decl2* decl, stmt* body, program_unit* contains) | Function(identifier name, arg* args, decl_attribute* attributes, expr? return_var, bind? bind, trivia? trivia, unit_decl1* use, import_statement* import, implicit_statement* implicit, unit_decl2* decl, stmt* body, program_unit* contains, identifier* temp_args, location start_name, location end_name) unit_decl1 = Use(decl_attribute* nature, identifier module, use_symbol* symbols, bool only_present, trivia? trivia) unit_decl2 = Declaration(decl_attribute? vartype, decl_attribute* attributes, var_sym* syms, trivia? trivia) | DeclarationPragma(pragma_type type, string text, trivia? trivia) | Interface(interface_header header, trivia? trivia, interface_item* items) | DerivedType(identifier name, identifier* namelist, trivia? trivia, decl_attribute* attrtype, unit_decl2* items, procedure_decl* contains) | Template(identifier name, identifier* namelist, unit_decl2* decl, program_unit* contains) | Enum(decl_attribute* attr, trivia? trivia, unit_decl2* items) | Instantiate(identifier name, decl_attribute* args, use_symbol* symbols) | Requirement(identifier name, identifier* namelist, unit_decl2* decl, program_unit* funcs) | Require(unit_require* reqs) | Union(identifier name, trivia? trivia, decl_attribute* attrtype, unit_decl2* items) interface_header = InterfaceHeader() | InterfaceHeaderName(identifier name) | InterfaceHeaderAssignment() | InterfaceHeaderOperator(intrinsicop op) | InterfaceHeaderDefinedOperator(string operator_name) | AbstractInterfaceHeader() | InterfaceHeaderWrite(identifier id) | InterfaceHeaderRead(identifier id) interface_item = InterfaceProc(program_unit proc) | InterfaceModuleProcedure(identifier* names, decl_attribute* attributes, trivia? trivia) import_statement = Import(identifier* symbols, import_modifier mod, trivia? trivia) import_modifier = ImportDefault | ImportOnly | ImportNone | ImportAll implicit_statement = ImplicitNone(implicit_none_spec* specs, trivia? trivia) | Implicit(implicit_spec* specs, trivia? trivia) implicit_spec = ImplicitSpec(decl_attribute type, letter_spec* specs) implicit_none_spec = ImplicitNoneExternal(int dummy) | ImplicitNoneType() letter_spec = LetterSpec(identifier? start, identifier end) stmt -- Single-line statements (each has a `label`): = Allocate(int label, fnarg* args, keyword* keywords, trivia? trivia) | Assign(int label, int assign_label, identifier variable, trivia? trivia) | Assignment(int label, expr target, expr value, trivia? trivia) | InferAssignment(int label, expr target, expr value, trivia? trivia) | Associate(int label, expr target, expr value, trivia? trivia) | Backspace(int label, expr* args, keyword* kwargs, trivia? trivia) | Close(int label, expr* args, keyword* kwargs, trivia? trivia) | Continue(int label, trivia? trivia) | Cycle(int label, identifier? stmt_name, trivia? trivia) | Deallocate(int label, fnarg* args, keyword* keywords, trivia? trivia) | Endfile(int label, expr* args, keyword* kwargs, trivia? trivia) | Entry(int label, identifier name, arg* args, expr? return_var, bind? bind, trivia? trivia) | ErrorStop(int label, expr? code, expr? quiet, trivia? trivia) | EventPost(int label, expr variable, event_attribute* stat, trivia? trivia) | EventWait(int label, expr variable, event_attribute* spec, trivia? trivia) | Exit(int label, identifier? stmt_name, trivia? trivia) | Flush(int label, expr* args, keyword* kwargs, trivia? trivia) | ForAllSingle(int label, identifier? stmt_name, concurrent_control *control, expr? mask, stmt assign, trivia? trivia) | Format(int label, string fmt, trivia? trivia) | DataStmt(int label, data_stmt_set* items, trivia? trivia) | FormTeam(int label, expr team_number, identifier team_var, event_attribute* sync_stat, trivia? trivia) | GoTo(int label, identifier? int_var, expr? goto_label, expr* labels, trivia? trivia) | Include(int label, string filename, trivia? trivia) | Inquire(int label, expr* args, keyword* kwargs, expr* values, trivia? trivia) | Nullify(int label, expr* args, keyword* kwargs, trivia? trivia) | Open(int label, expr* args, keyword* kwargs, trivia? trivia) | Return(int label, expr? value, trivia? trivia) | Pragma(int label, pragma_type type, bool end, string construct_name, expr* clauses, trivia? trivia) | Print(int label, expr? fmt, expr* values, trivia? trivia) | Read(int label, expr? format, argstar* args, kw_argstar* kwargs, expr* values, trivia? trivia) | Rewind(int label, expr* args, keyword* kwargs, trivia? trivia) | Stop(int label, expr? code, expr? quiet, trivia? trivia) | SubroutineCall(int label, identifier name, struct_member* member, fnarg* args, keyword* keywords, decl_attribute* temp_args, trivia? trivia) | SyncAll(int label, event_attribute* stat, trivia? trivia) | SyncImages(int label, expr? image_set, symbol sym, event_attribute* stat, trivia? trivia) | SyncMemory(int label, event_attribute* stat, trivia? trivia) | SyncTeam(int label, expr value, event_attribute* stat, trivia? trivia) | Write(int label, argstar* args, kw_argstar* kwargs, expr* values, trivia? trivia) -- Multi-line statements (each has a `label` and `stmt_name`): | AssociateBlock(int label, identifier? stmt_name, var_sym* syms, stmt* body, trivia? t_inside, trivia? trivia) | Block(int label, identifier? stmt_name, unit_decl1* use, import_statement* import,unit_decl2* decl, stmt* body, trivia? t_inside, trivia? trivia) | ChangeTeam(int label, identifier? stmt_name, expr team_value, team_attribute* coarray_assoc, event_attribute* sync, stmt* body, trivia? t_inside, trivia? trivia, event_attribute* sync_stat) | Critical(int label, identifier? stmt_name, event_attribute* sync_stat, stmt* body, trivia? t_inside, trivia? trivia) | DoConcurrentLoop(int label, identifier? stmt_name, concurrent_control *control, expr? mask, concurrent_locality* locality, stmt* body, trivia? t_inside, trivia? trivia) | DoLoop(int label, identifier? stmt_name, int do_label, identifier? var, expr? start, expr? end, expr? increment, stmt* body, trivia? t_inside, trivia? trivia, location var_loc) | ForAll(int label, identifier? stmt_name, concurrent_control *control, expr? mask, concurrent_locality* locality, stmt* body, trivia? t_inside, trivia? trivia) | If(int label, identifier? stmt_name, expr test, stmt* body, stmt* orelse, trivia? if_trivia, trivia? else_trivia, trivia? trivia) | IfArithmetic(int label, identifier? stmt_name, expr test, int lt_label, int eq_label, int gt_label, trivia? trivia) | Select(int label, identifier? stmt_name, expr test, case_stmt* body, trivia? t_inside, trivia? trivia) | SelectRank(int label, identifier? stmt_name, identifier? assoc_name, expr selector, rank_stmt* body, trivia? t_inside, trivia? trivia) | SelectType(int label, identifier? stmt_name, identifier? assoc_name, expr selector, type_stmt* body, trivia? t_inside, trivia? trivia) | Where(int label, identifier? stmt_name, expr test, stmt* body, stmt* orelse, trivia? t_inside, trivia? trivia) | WhileLoop(int label, identifier? stmt_name, expr test, stmt* body, trivia? t_inside, trivia? trivia) expr = BoolOp(expr left, boolop op, expr right) | BinOp(expr left, operator op, expr right) | DefBinOp(expr left, string op, expr right) | StrOp(expr left, stroperator op, expr right) | UnaryOp(unaryop op, expr operand) | DefUnaryOp(string op, expr operand) | Compare(expr left, cmpop op, expr right) | FuncCallOrArray(identifier func, struct_member* member, fnarg* args, keyword* keywords, fnarg* subargs, decl_attribute* temp_args) | CoarrayRef(identifier name, struct_member* member, fnarg* args, keyword* fnkw, coarrayarg* coargs, keyword* cokw) | ArrayInitializer(decl_attribute? vartype, identifier? classtype, expr* args) | ImpliedDoLoop(expr* values, identifier var, expr start, expr end, expr? increment) | Num(int n, string? kind) | Real(string n) | Complex(expr re, expr im) | String(string s, string? kind) | Substring(string s, fnarg* args) | BOZ(string s) | Name(identifier id, struct_member* member) | Logical(bool value, string? kind) | DataImpliedDo(expr* object_list, decl_attribute? type, identifier var, expr start, expr end, expr? increment) | Parenthesis(expr operand) -- All statement nodes have an optional trivia?, here is the meaning: -- nullptr ... Equivalent to \n (the statement ends with \n) -- Meaning of trivia_node (in both `inside` and `after`): -- Comment ...... Comment followed by \n (previous line must be ended) -- EOLComment ... Ends the current line with a comment followed by \n -- EndOfLine .... Ends the current line with \n -- Semicolon .... ";" (just one character, does not end the line) -- The trivia starts with an open line, must be first ended by either -- EOLComment or EndOfLine. trivia = TriviaNode(trivia_node* inside, trivia_node* after) trivia_node = Comment(string comment) | EOLComment(string comment) | EndOfLine() | Semicolon() boolop = And | Or | Xor | Eqv | NEqv operator = Add | Sub | Mul | Div | Pow stroperator = Concat unaryop = Invert | Not | UAdd | USub cmpop = Eq | NotEq | Lt | LtE | Gt | GtE intrinsicop = AND | OR | XOR | EQV | NEQV | PLUS | MINUS | STAR | DIV | POW | NOT | EQ | NOTEQ | LT | LTE | GT | GTE | CONCAT procedure_decl = DerivedTypeProc(identifier? name, decl_attribute* attr, use_symbol* symbols, trivia? trivia) | GenericOperator(decl_attribute* attr, intrinsicop op, identifier* names, trivia? trivia) | GenericDefinedOperator(decl_attribute* attr, string optype, identifier* names, trivia? trivia) | GenericAssignment(decl_attribute* attr, identifier* names, trivia? trivia) | GenericName(decl_attribute* attr, identifier name, identifier* names, trivia? trivia) | GenericWrite(decl_attribute* attr, identifier id, identifier* names, trivia? trivia) | GenericRead(decl_attribute* attr, identifier id, identifier* names, trivia? trivia) | FinalName(identifier name, trivia? trivia) | Private(trivia? trivia) decl_attribute = AttrBind(bind bind) | AttrDimension(dimension* dim) | AttrCodimension(codimension* codim) | AttrCommon(common_block* blks) | AttrEquivalence(equi* args) | AttrExtends(identifier name) | AttrIntent(attr_intent intent) | AttrNamelist(identifier name) | AttrPass(identifier? name) | SimpleAttribute(simple_attribute attr) | AttrType(decl_type type, kind_item* kind, decl_attribute? attr, identifier? name, symbol sym) | AttrTypeList(decl_type type, decl_attribute* attr) | AttrAssignment() | AttrIntrinsicOperator(intrinsicop op) | AttrDefinedOperator(string op_name) simple_attribute = AttrAbstract | AttrAllocatable | AttrAsynchronous | AttrContiguous | AttrDeferred | AttrElemental | AttrEnumerator | AttrExternal | AttrImpure | AttrIntrinsic | AttrKind | AttrLen | AttrModule | AttrNoPass | AttrNonDeferred | AttrNon_Intrinsic | AttrOptional | AttrParameter | AttrPointer | AttrPrivate | AttrProtected | AttrPublic | AttrPure | AttrRecursive | AttrNonRecursive | AttrSave | AttrSequence | AttrTarget | AttrValue | AttrVolatile attr_intent = In | Out | InOut decl_type = TypeClass | TypeCharacter | TypeComplex | TypeDoublePrecision | TypeDoubleComplex | TypeInteger | TypeLogical | TypeProcedure | TypeReal | TypeType | TypeList | TypeSet | TypeDict | TypeTuple event_attribute = AttrStat(identifier variable) | AttrErrmsg(identifier variable) | AttrNewIndex(expr value) | AttrEventWaitKwArg(identifier id, expr value) team_attribute = CoarrayAssociation(expr coarray, expr selector) var_sym = (identifier? name, dimension* dim, codimension* codim, expr? length, expr? initializer, symbol sym, decl_attribute? spec) common_block = (identifier? name, var_sym* objects) kind_item = (identifier? id, expr? value, kind_item_type type) kind_item_type = Star | Colon | Value dimension = (expr? start, expr? end, dimension_type end_star) dimension_type = DimensionExpr | DimensionStar | AssumedRank codimension = (expr? start, expr? end, codimension_type end_star) codimension_type = CodimensionExpr | CodimensionStar symbol = None | Arrow | Equal | Asterisk | DoubleAsterisk | Slash | SlashInit equi = (expr* set_list) -- Encoding of an array dimension declaration: -- start end end_star -- Declaration: -- X(n) 1 n Expr # Note: X(n) is equivalent to X(1:n) -- X(:) () () Expr -- X(a:) a () Expr -- X(:b) () b Expr -- X(a:b) a b Expr -- X(*) () () Star -- X(a:*) a () Star -- Null for `expr` means it's a star kw_argstar = (identifier arg, expr? value) argstar = (expr? value) -- The identifier is wrapped up in a product type so that location information -- is included: -- Null for `arg` means, it's a star arg = (identifier? arg) -- Encoding of array elements and sections in fnarg: -- start end step label -- element: -- X(i) () i () 0 -- X(*10) () () () 10 -- section: -- X(:) () () 1 0 -- X(a:) a () 1 0 -- X(:b) () b 1 0 -- X(a:b) a b 1 0 -- X(::c) () () c 0 -- X(a::c) a () c 0 -- X(:b:c) () b c 0 -- X(a:b:c) a b c 0 -- fnarg = (expr? start, expr? end, expr? step, int label) coarrayarg = (expr? start, expr? end, expr? step, codimension_type star) keyword = (identifier arg, expr value) struct_member = (identifier name, fnarg* args) bind = Bind(expr* args, keyword* kwargs) array_index = ArrayIndex(expr? left, expr? right, expr? step) case_stmt = CaseStmt(case_cond* test, trivia? trivia, stmt* body) | CaseStmt_Default(trivia? trivia, stmt* body) case_cond = CaseCondExpr(expr cond) | CaseCondRange(expr? start, expr? end) rank_stmt = RankExpr(expr value, trivia? trivia, stmt* body) | RankStar(trivia? trivia, stmt* body) | RankDefault(trivia? trivia, stmt* body) type_stmt = TypeStmtName(identifier? name, trivia? trivia, stmt* body) | TypeStmtType(decl_attribute? vartype, trivia? trivia, stmt* body) | ClassStmt(identifier? id, trivia? trivia, stmt* body) | ClassDefault(trivia? trivia, stmt* body) use_symbol = UseSymbol(identifier remote_sym, identifier? local_rename) | UseAssignment() | IntrinsicOperator(intrinsicop op) | DefinedOperator(string opName) | RenameOperator(string local_defop, string use_defop) | UseWrite(identifier id) | UseRead(identifier id) concurrent_control = ConcurrentControl(identifier? var, expr? start, expr? end, expr? increment) concurrent_locality = ConcurrentLocal(identifier *vars) | ConcurrentLocalInit(identifier *vars) | ConcurrentShared(identifier *vars) | ConcurrentDefault() | ConcurrentReduce(reduce_op op, identifier *vars) reduce_op = ReduceAdd | ReduceSub | ReduceMul | ReduceMIN | ReduceMAX data_stmt_set = DataStmtSet(expr* object, expr* value) pragma_type = LFortranPragma | OMPPragma unit_require = UnitRequire(identifier name, decl_attribute* namelist) } lfortran-0.63.0/.vscode/0000775000175000017500000000000015174404631015161 5ustar alastairalastairlfortran-0.63.0/.vscode/launch.json0000664000175000017500000000170715174404631017333 0ustar alastairalastair{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 // use gdb in linux and lldb in mac "version": "0.2.0", "configurations": [ { "name": "(lldb) Launch", "type": "lldb", "request": "launch", "program": "${workspaceFolder}/src/bin/lfortran", "args": ["examples/expr2.f90"], "cwd": "${workspaceFolder}" }, { "name": "(lldb-mi) Launch", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/src/bin/lfortran", "args": ["examples/expr2.f90"], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": false, "MIMode": "lldb" }, ] } lfortran-0.63.0/README.md0000664000175000017500000000416515174404631015105 0ustar alastairalastair# LFortran [![project chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://lfortran.zulipchat.com/) LFortran is a modern open-source (BSD licensed) interactive Fortran compiler built on top of LLVM. It can execute user's code interactively to allow exploratory work (much like Python, MATLAB or Julia) as well as compile to binaries with the goal to run user's code on modern architectures such as multi-core CPUs and GPUs. Website: https://lfortran.org/ Try online: https://dev.lfortran.org/ # Documentation All documentation, installation instructions, motivation, design, ... is available at: https://docs.lfortran.org/ Which is generated using the files in the `doc` directory. # Development We welcome all contributions. The main development repository is at GitHub: https://github.com/lfortran/lfortran Please send Pull Requests (PRs) and open issues there. See the [CONTRIBUTING](CONTRIBUTING.md) document for more information. Main mailinglist: https://groups.io/g/lfortran You can also chat with us on Zulip ([![project chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://lfortran.zulipchat.com/)). Note: We moved to the above GitHub repository from GitLab on July 18, 2022. # Donations You can support LFortran's development by donating to NumFOCUS or Open Collective as well as GitHub Sponsors: * https://numfocus.org/donate-to-lfortran * https://opencollective.com/lfortran * https://github.com/sponsors/lfortran All donations will be used strictly to fund LFortran development, by supporting tasks such as paying developers to implement features, sprints, improved documentation, fixing bugs, etc. The donations to LFortran are managed by the NumFOCUS foundation. NumFOCUS is a 501(c)3 non-profit foundation, so if you are subject to US Tax law, your contributions will be tax-deductible. If you want to discuss another way to fund or help with the development, feel free to contact OndÅ™ej ÄŒertík (ondrej@certik.us). # Star History [![Star History Chart](https://api.star-history.com/svg?repos=lfortran/lfortran&type=Date)](https://star-history.com/#lfortran/lfortran&Date) lfortran-0.63.0/build_to_wasm.sh0000775000175000017500000000164515174404631017015 0ustar alastairalastair#!/usr/bin/env bash set -ex cmake \ -DCMAKE_BUILD_TYPE=Release \ -DWITH_LLVM=yes \ -DLFORTRAN_BUILD_ALL=yes \ -DWITH_STACKTRACE=no \ -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX=`pwd`/inst \ -DCMAKE_EXPORT_COMPILE_COMMANDS=yes \ . cmake --build . -j16 --target install mkdir -p src/bin/asset_dir cp src/runtime/*.mod src/bin/asset_dir git clean -dfx -e src/bin/asset_dir emcmake cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_FLAGS_DEBUG="-Wall -Wextra -fexceptions" \ -DCMAKE_CXX_FLAGS_RELEASE="-Wall -Wextra -fexceptions" \ -DWITH_LLVM=no \ -DLFORTRAN_BUILD_ALL=yes \ -DLFORTRAN_BUILD_TO_WASM=yes \ -DWITH_STACKTRACE=no \ -DWITH_LSP=no \ -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX=`pwd`/inst \ -DCMAKE_EXPORT_COMPILE_COMMANDS=yes \ . cmake --build . -j16 lfortran-0.63.0/.mailmap0000664000175000017500000001736715174404631015257 0ustar alastairalastair# The "Name " on the left is the desired name and email Gagandeep Singh czgdp1807 Gagandeep Singh ਗਗਨਦੀਪ ਸਿੰਘ (Gagandeep Singh) Gagandeep Singh ਗਗਨਦੀਪ ਸਿੰਘ Dominic Poerio dvp Dominic Poerio Dominic Poerio Himanshu Pandey hp77 Himanshu Pandey hp77 Thirumalai Shaktivel Thirumalai-Shaktivel Thirumalai Shaktivel Thirumalai Shaktivel Thirumalai Shaktivel Thirumalai Shaktivel <74826228+Thirumalai-Shaktivel@users.noreply.github.com> Andrew Best Andrew Mengjia Lyu mengjia.lyu OndÅ™ej ÄŒertík Ondrej Certik OndÅ™ej ÄŒertík Ondrej Certik Ubaid Shaikh Shaikh Ubaid Ubaid Shaikh Ubaid Smit Lunagariya Smit-create Zihua Wu Gabriel Wu Zihua Wu Zihua Wu Pranav Goswami Pranav <85227306+Pranavchiku@users.noreply.github.com> Pranav Goswami Pranavchiku Pranav Goswami pranavchiku Pranav Goswami Co-authored-by: Pranav Goswami Giannis Nikiteas gnikit Oshanath Rajawasam oshanath Emilio Gonzalez Emilio å·¦å¿—åŽ (Zuo Zhihua) zoziha å·¦å¿—åŽ (Zuo Zhihua) å·¦å¿—åŽ Akarshit Verma akarshitkverma meow464 meow464 <70211708+meow464@users.noreply.github.com> Luthfan Anshar Lubis Lubis Julian Hofer Hofer-Julian Julian Hofer Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com> Rohit Goswami Rohit Goswami Rohit Goswami Rohit Goswami <308505-HaoZeke@users.noreply.gitlab.com> Konrad Handrick Konrad Handrick Harshita Kalani HarshitaKalani Harshita Kalani Harshita Kalani <95532771+HarshitaKalani@users.noreply.github.com> Harris M. Snyder Harris Snyder Jacob Marks Jacob Marks Sebastian Ehlert Sebastian Ehlert <2684096-awvwgk@users.noreply.gitlab.com> Sebastian Ehlert Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com> Aarush Bhat sloorush Benson Muite Benson Muite Felix Wang topazus Felix Wang Felix <77263945+topazus@users.noreply.github.com> Sarthak Gupta gptsarthak John Shimanek <42622333+shimanek@users.noreply.github.com> shimanek <42622333+shimanek@users.noreply.github.com> Brian Beckman rebcabin Carl Burkert Carl Sergey Fedorov barracuda156 Jinang Shah Jinang Shah <165902846+jinangshah21@users.noreply.github.com> Jinang Shah jinangshah21 Harshil Shah HarshilShah1804 Assem Medhat Assem Ansh Mehta AnshMehta1 Akram Hany Akram Hany <109467185+akramhany@users.noreply.github.com> Akram Hany akramhany Swaminath Shiju swamishiju Parth Mistry parth121101 Parth Mistry parth121101 <96720723+parth121101@users.noreply.github.com> Atharva Waghmare opixdown Atharva Waghmare opixdown <102764510+opixdown@users.noreply.github.com> Yash Nagda Yash Yash Nagda Yash Yash Nagda Yash Nagda <79076376+YashNagda17@users.noreply.github.com> Christopher Albert Christopher Albert Gauravsingh Sisodia Gauravsingh Sisodia <65955464+xaerru@users.noreply.github.com> Aditya Trivedi Aditya Trivedi <120598696+adit4443ya@users.noreply.github.com> Dylon Edwards Dylon Edwards Jatin Agarwal <23110147@iitgn.ac.in> Jatinagarwal24 <23110147@iitgn.ac.in> Jatin Agarwal <23110147@iitgn.ac.in> Jatinagarwal24 <167195254+Jatinagarwal24@users.noreply.github.com> Jaysukh Makvana Jaysukh-409 Jainam Shah Jainam-not-a-robot Jainam Shah Shah Jainam Nehal Anas Khan Anas Kishan Ved Kishan-Ved Devesh Acharya <143060274+Th3C0d3Mast3r@users.noreply.github.com> Devesh A <143060274+Th3C0d3Mast3r@users.noreply.github.com> Rahul Purmani rahulrangers Rahul Purmani rahulrangers <127782777+rahulrangers@users.noreply.github.com> Hitesh Ghanchi Hitesh Nayan Kute Nayan-Kute21 Nayan Kute Nayan-Kute21 <154470012+Nayan-Kute21@users.noreply.github.com> Prasham Vipul Prabhakar Baitato Prasham Vipul Prabhakar Prasham Vipul Prabhakar <85821070+Baitato@users.noreply.github.com> Amrita Kumari Mishra Amrita kumari mishra Dileep Gampala DileepGampala2005 Dileep Gampala Dileep Leon Degel Koehn Leon-Degel-Koehn Sarah Fatima <142889410+sarahfatima1205@users.noreply.github.com> sarahfatima1205 <142889410+sarahfatima1205@users.noreply.github.com> Mohit Dhingra <154071159+mohitdhingra22@users.noreply.github.com> mxyd <154071159+mohitdhingra22@users.noreply.github.com> Abhro <5664668+abhro@users.noreply.github.com> abhro <5664668+abhro@users.noreply.github.com> lfortran-0.63.0/CONTRIBUTING.md0000664000175000017500000000355315174404631016057 0ustar alastairalastair## Contributing We welcome contributions from anyone, even if you are new to open source. It might sound daunting to contribute to a compiler at first, but please do, it is not complicated. We will help you with any technical issues and help improve your contribution so that it can be merged. ### Getting Started To contribute, follow these steps: 1. **Fork the Repository** Fork the [LFortran repository](https://github.com/lfortran/lfortran) to your GitHub account. 2. **Clone Your Fork** Clone your forked repository to your local machine: ``` git clone https://github.com//lfortran.git cd lfortran ``` 3. **Add the Upstream Repository** Add the original LFortran repository as the upstream remote. ``` git remote add upstream https://github.com/lfortran/lfortran.git git fetch upstream --tags ``` 4. **Install Dependencies and Build the Project** Follow the [installation guide](https://docs.lfortran.org/en/installation/#build-from-git) to set up the required dependencies and build the project. 5. **Make Changes and Submit Your Contribution** Create a branch for your changes and make the necessary edits. When ready, push your changes to your fork and submit a Pull Request (PR) against our repository at: https://github.com/lfortran/lfortran. ### Communication If you have any questions or need help, please ask as at our [mailinglist](https://groups.io/g/lfortran) or a [chat](https://lfortran.zulipchat.com/). ### Code of Conduct Please note that all participants of this project are expected to follow our Code of Conduct. By participating in this project you agree to abide by its terms. See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md). ### Licensing By submitting a PR you agree to license your contribution under the LFortran's BSD [license](LICENSE) unless explicitly noted otherwise. lfortran-0.63.0/build0_win.xsh0000664000175000017500000000123015174404631016374 0ustar alastairalastair#!/usr/bin/env xonsh #bash ci/version.sh version=$(git describe --tags --dirty).strip()[1:] echo @(version) > version python src/libasr/asdl_cpp.py grammar/AST.asdl src/lfortran/ast.h python src/libasr/asdl_cpp.py src/libasr/ASR.asdl src/libasr/asr.h pushd src/lfortran/parser && re2c -W -b tokenizer.re -o tokenizer.cpp && popd pushd src/lfortran/parser && re2c -W -b preprocessor.re -o preprocessor.cpp && popd pushd src/lfortran/parser && bison -Wall -d parser.yy && popd python src/libasr/wasm_instructions_visitor.py python src/server/generator/generate_lsp_code.py --schema src/server/generator/metaModel.json --target-language c++ --output-dir src/server lfortran-0.63.0/AGENTS.md0000664000175000017500000002307215174404631015127 0ustar alastairalastair# Repository Guidelines This file is for LLM agents and new contributors to have a single point of detailed reference how to contribute to the project. ## Project Structure & Module Organization - `src/`: core sources - `libasr/`: ASR + utilities, passes, verification, backends - `lfortran/`: parser, semantics, drivers - `runtime/`: Fortran runtime (built via CMake) - `server/`: language server - `tests/`, `integration_tests/`: unit/E2E suites - `doc/`: docs & manpages (site generated from here) - `examples/`, `grammar/`, `cmake/`, `ci/`, `share/`: supporting assets ## Prerequisites - Tools: CMake (>=3.10), Ninja, Git, Python (>=3.8), GCC/Clang/MSVC. - Generators: re2c, bison (needed for build0/codegen). - Libraries: zlib; optional: LLVM dev, libunwind, RapidJSON, fmt, xeus/xeus-zmq, Pandoc. ## Build, Test, and Development Commands - Typical dev config (Ninja + LLVM) is specified in `./build1.sh`: - `cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DWITH_LLVM=ON -DWITH_STACKTRACE=yes` - `cmake --build build -j` - Release build: `cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_LLVM=ON` - Tests: `./run_tests.py &> log` (reference tests); `cd integration_tests && ./run_tests.py -j16 &> log` (integration tests) **IMPORTANT**: always redirect test output to a log file and then examine the log file. Do NOT run tests using the style like `./run_tests.py | tail` because if you need more output than the `tail` provides, you have to rerun them and that is very expensive, the tests can run several minutes. Instead, run tests only once, redirect to a log file and then examine the log file. ## Quick Smoke Test - We usually build with LLVM enabled (`-DWITH_LLVM=ON`). - AST/ASR (no LLVM): `build/src/bin/lfortran --show-ast examples/expr2.f90` - Run program (LLVM): `build/src/bin/lfortran examples/expr2.f90 && ./a.out` ## Architecture & Scope - AST (syntax) ↔ ASR (semantic, valid-only). See `doc/src/design.md`. - Pipeline: parse → semantics → ASR passes → codegen (LLVM/C/C++/x86/WASM). - Prefer `src/libasr/pass` and existing utils; avoid duplicate helpers/APIs. - Type coercion and casting belong in AST→ASR (semantics). Insert explicit Cast nodes in ASR. The LLVM/codegen backend must never infer or fix types — it should only lower what ASR gives it. If codegen needs a type workaround, the bug is upstream. - libasr is frontend-independent. Never reference `_lfortran` or any frontend-specific names in libasr code. Use enums or structured types, not string comparisons. ## Git Remotes & Issues - Upstream: `lfortran/lfortran` on GitHub (canonical repo and issues). - Fork workflow: fork the upstream lfortran/lfortran repository to your own username, then push PRs as branches into your fork and send a PR from there. Never push branches to upstream. ## Coding Style & Naming Conventions - C/C++: C++17; follow the existing formatting in the file to be consistent; use 4 spaces for indentation - Names: lower_snake_case files; concise CMake target names. - No commented-out code. - No new C/C++ macros. Use constexpr, templates, or inline functions. - Error messages: lowercase, show explicit kinds (e.g., integer(4) vs integer(8)), never expose internal ASR node names to users. ## Testing Guidelines - Full coverage required: every behavior change must come with tests that fail before your change and pass after. Do not merge without a full local pass of unit and integration suites. ### Test Placement Decision Tree - If the test compiles and runs end-to-end → integration test (preferred). - If the test checks a compile-time error → `tests/errors/continue_compilation_1.f90` (append at end to minimize diff). - If the test cannot compile end-to-end yet → reference test in `tests/tests.toml` (promote to integration test once it compiles). - Every new test file MUST be registered in `CMakeLists.txt` or `tests.toml`. An unregistered test is dead code. ### Integration Tests (`integration_tests/`) - Purpose: build-and-run end-to-end programs across backends/configurations via CMake/CTest. - Add a `.f90` program under `integration_tests/` and register it in `integration_tests/CMakeLists.txt` using the `RUN(...)` macro (labels like `gfortran`, `llvm`, `cpp`, etc.). - See `integration_tests/CMakeLists.txt` (search for `macro(RUN` and existing `RUN(NAME ...)` entries). - Avoid custom generation; place real sources in the tree and check them in. - Search for similar tests and use similar name convention (e.g., `intrinsic_name_NN.f90`, `derived_type_feature_NN.f90`) - Prefer integration tests; all new tests should be integration tests. - Ensure integration tests pass locally: `cd integration_tests && ./run_tests.py -j16 &> log`. - Add checks for correct results inside the `.f90` file using `if (i /= 4) error stop`-style idioms. - Always label new tests with at least `gfortran` (to ensure the code compiles with GFortran and does not rely on any LFortran-specific behavior) and `llvm` (to test with LFortran's default LLVM backend). - When fixing a bug, add an integration test that reproduces the failure and now compiles/runs successfully. - CI‑parity (recommended): run with the same env and scripts CI uses - Use micromamba with `ci/environment.yml` to match toolchain (LLVM, etc.). - Set env like CI and call the same helper scripts: - `export LFORTRAN_CMAKE_GENERATOR=Ninja` - `export ENABLE_RUNTIME_STACKTRACE=yes` (Linux/macOS) - Build: `bash ci/build.sh` - Quick integration run (LLVM): - `bash ci/test.sh` (runs a CMake+CTest LLVM pass and runner passes) - or: `cd integration_tests && ./run_tests.py -b llvm && ./run_tests.py -b llvm -f -nf16 &> log` - GFortran pass: `cd integration_tests && ./run_tests.py -b gfortran &> log` - Other backends as in CI: - `./run_tests.py -b llvm2 llvm_rtlib llvm_nopragma &> log && ./run_tests.py -b llvm2 llvm_rtlib llvm_nopragma -f &> log` - `./run_tests.py -b cpp c c_nopragma &> log` and `-f` - `./run_tests.py -b wasm &> log` and `-f` - `./run_tests.py -b llvm_omp &> log` / `target_offload` / `fortran -j1` - Minimal local (without micromamba): - Build: `cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DWITH_LLVM=ON -DWITH_RUNTIME_STACKTRACE=yes` - Run: `cd integration_tests && ./run_tests.py -b llvm &> log && ./run_tests.py -b llvm -f -nf16 &> log` - If builds fail with messages about missing debug info: - Install LLVM tools so `llvm-dwarfdump` is available (e.g., `sudo pacman -S llvm`, `apt install llvm`, or `conda install -c conda-forge llvm-tools`). - Rebuild with runtime stacktraces if needed: `cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DWITH_LLVM=ON -DWITH_RUNTIME_STACKTRACE=yes -DWITH_UNWIND=ON` - More details: `integration_tests/run_tests.py &> log` (CLI flags and supported backends). ### Unit/Reference Tests (`tests/`) - Use only when an integration test is not yet feasible (e.g., feature doesn’t compile end‑to‑end). Prefer integration tests for all new work. - If possible, still add a test under `integration_tests/`, but only register `gfortran` (not `llvm`), then register this test in `tests/tests.toml` with the needed outputs (`ast`, `asr`, `llvm`, `run`, etc.). Use `.f90` or `.f` (fixed-form auto-handled). Only if that cannot be done, add a new test into `tests/`. - See `tests/tests.toml` for examples; reference outputs live under `tests/reference/`. - Multi-file modules: set `extrafiles = "mod1.f90,mod2.f90"`. - Run locally: `./run_tests.py -j16 &> log` (use `-s` to debug). - Update references only when outputs intentionally change: `./run_tests.py -t path/to/test -u -s`. - Error messages: add to `tests/errors/continue_compilation_1.f90` and update references. - If your integration test does not compile yet, temporarily validate the change by adding a reference test that checks AST/ASR construction (enable `asr = true` and/or `ast = true` in `tests/tests.toml`). Promote it to an integration test once end‑to‑end compilation succeeds. ### Local Troubleshooting - Modfile version mismatch: if you see "Incompatible format: LFortran Modfile...", clean and recompile (`ninja clean && ninja`) Ensure the current `build/src/bin` is first on `PATH` when running tests. ### Common Commands - Run all tests: `ctest` and `./run_tests.py -j16 &> log` - Run a specific test: `./run_tests.py -t pattern -s &> log` ## References - Developer docs: `doc/src/installation.md` (Tests) and `doc/src/progress.md` (workflow). - Online docs: https://docs.lfortran.org/en/installation/ (Tests: run, update, integration). - CI examples: `.github/workflows/Quick-Checks-CI.yml` and `ci/test.sh`. ## Commit & Pull Request Guidelines - Commits: small, single-topic, imperative (e.g., "fix: handle BOZ constants"). - One bug = one MRE = one PR. Do not bundle unrelated fixes. - Never mix refactoring or formatting with bug fixes. Send those separately. - Every fix PR must demonstrate: test fails on main, test passes on branch. If you cannot find such a test, the fix is not understood well enough. - Once a PR is in review, merge upstream into it (do not rebase) — rebasing forces complete re-review. - PRs target `upstream/main`; reference issues (`fixes #123`), explain rationale. - Include test evidence (commands + summary); ensure CI passes. - Do not commit generated artifacts, large binaries, or local configs. - Use Draft PRs while iterating; click “Ready for review†only when satisfied. - Use plain Markdown in PR descriptions (no escaped `\n`). Keep it clean, minimal, and follow simple headings (Summary, Scope, Verification, Rationale). - Before marking ready: ensure all local tests pass (unit + integration) and include evidence. lfortran-0.63.0/test_lfortran_cmdline0000775000175000017500000000362015174404631020130 0ustar alastairalastair#!/usr/bin/env bash set -e set -x CC=clang if [[ $1 == "" ]]; then echo "Test local lfortran" PATH="$(pwd):$PATH" FC=lfortran elif [[ $1 == "gfortran" ]]; then echo "Test installed gfortran" FC=gfortran elif [[ $1 == "lfortran" ]]; then echo "Test installed lfortran" FC=lfortran else echo "Invalid option" exit 1 fi f=`pwd`/examples/expr2.f90 f1=`pwd`/tests/unordered_linking.f90 add_c=`pwd`/tests/add.c if [[ "$(uname)" == "Linux" ]]; then ASM_PATTERN="movq\|movl\|retq" else ASM_PATTERN="mov\|sp" fi cd $(mktemp -d) $FC $f -o a.out [ -f "a.out" ] [ -x "a.out" ] ./a.out cd $(mktemp -d) $FC -c $f [ -f "expr2.o" ] [ ! -x "expr2.o" ] $FC -o expr2 expr2.o [ -f "expr2" ] [ -x "expr2" ] ./expr2 cd $(mktemp -d) $FC -o xx1 -c $f [ -f "xx1" ] [ ! -x "xx1" ] $FC -o expr2 xx1 [ -f "expr2" ] [ -x "expr2" ] ./expr2 cd $(mktemp -d) $FC -o xx1 $f [ -f "xx1" ] [ -x "xx1" ] ./xx1 cd $(mktemp -d) $FC -S $f [ -f "expr2.s" ] grep $ASM_PATTERN expr2.s cd $(mktemp -d) $FC -S -c $f [ -f "expr2.s" ] grep $ASM_PATTERN expr2.s cd $(mktemp -d) $FC -S -o xx1 $f [ -f "xx1" ] grep $ASM_PATTERN xx1 cd $(mktemp -d) $FC -S -o xx1 -c $f [ -f "xx1" ] grep $ASM_PATTERN xx1 cd $(mktemp -d) echo "Testing multiple file orders" $CC -c $add_c -o add.o $FC $f1 add.o -o a.out [ -f "a.out" ] [ -x "a.out" ] ./a.out echo "Reverse the order of f1 and add.o" $CC -c $add_c -o add.o $FC add.o $f1 -o a.out [ -f "a.out" ] [ -x "a.out" ] ./a.out echo "Compile and run f1 and add_c together" $FC $f1 $add_c -o a.out [ -f "a.out" ] [ -x "a.out" ] ./a.out cd $(mktemp -d) cd $(mktemp -d) echo "Testing incorrect usage" ! $FC nonexistentfile.f90 # ensure this fails cd $(mktemp -d) $FC -c $f1 [ -f "unordered_linking.o" ] [ ! -x "unordered_linking.o" ] cd $(mktemp -d) echo "Testing invalid command-line usage" ! $FC -invalidflag $f1 2>&1 | grep "unrecognized command line option" echo "All tests succeeded" lfortran-0.63.0/.clang-format0000664000175000017500000000314015174404631016171 0ustar alastairalastairBasedOnStyle: Mozilla AccessModifierOffset: '-4' AlignAfterOpenBracket: Align AlignEscapedNewlinesLeft: 'false' AllowAllParametersOfDeclarationOnNextLine: 'true' AllowShortBlocksOnASingleLine: 'false' AllowShortCaseLabelsOnASingleLine: 'false' AllowShortFunctionsOnASingleLine: 'false' AllowShortIfStatementsOnASingleLine: 'false' AllowShortLoopsOnASingleLine: 'false' AlwaysBreakTemplateDeclarations: 'true' SpaceAfterTemplateKeyword: 'true' BreakBeforeBinaryOperators: All BreakBeforeBraces: Linux BreakBeforeTernaryOperators: 'true' BreakConstructorInitializersBeforeComma: 'true' BreakStringLiterals: 'false' ColumnLimit: '100' ConstructorInitializerAllOnOneLineOrOnePerLine: 'false' ConstructorInitializerIndentWidth: '4' ContinuationIndentWidth: '4' Cpp11BracedListStyle: 'false' DerivePointerAlignment: 'false' DisableFormat: 'false' ExperimentalAutoDetectBinPacking: 'true' IndentCaseLabels: 'true' IndentWidth: '4' IndentWrappedFunctionNames: 'false' JavaScriptQuotes: Single KeepEmptyLinesAtTheStartOfBlocks: 'false' Language: Cpp MaxEmptyLinesToKeep: '2' NamespaceIndentation: Inner ObjCBlockIndentWidth: '4' ObjCSpaceAfterProperty: 'false' ObjCSpaceBeforeProtocolList: 'false' PointerAlignment: Left ReflowComments: 'true' SortIncludes: 'false' SpaceAfterCStyleCast: 'true' SpaceBeforeAssignmentOperators: 'true' SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: 'false' SpacesBeforeTrailingComments: '2' SpacesInAngles: 'false' SpacesInCStyleCastParentheses: 'false' SpacesInContainerLiterals: 'false' SpacesInParentheses: 'false' SpacesInSquareBrackets: 'false' Standard: c++17 TabWidth: '4' UseTab: Never lfortran-0.63.0/build0.sh0000775000175000017500000000226715174404631015345 0ustar alastairalastair#!/usr/bin/env bash set -e set -x RE2C=${RE2C:-re2c} BISON=${BISON:-bison} # Generate the `version` file ci/version.sh # Generate a Fortran AST from AST.asdl (C++) python src/libasr/asdl_cpp.py grammar/AST.asdl src/lfortran/ast.h # Generate a Fortran ASR from ASR.asdl (C++) python src/libasr/asdl_cpp.py src/libasr/ASR.asdl src/libasr/asr.h # Generate a wasm_visitor.h from src/libasr/wasm_instructions.txt (C++) python src/libasr/wasm_instructions_visitor.py # Generate the intrinsic_function_registry_util.h (C++) python src/libasr/intrinsic_func_registry_util_gen.py # Generate the tokenizer and parser (cd src/lfortran && ${RE2C} -W -b parser/tokenizer.re -o parser/tokenizer.cpp) (cd src/lfortran && ${RE2C} -W -b parser/preprocessor.re -o parser/preprocessor.cpp) # Use `-r all` in Bison for detailed report. Turned off by default to avoid a # Bison timeout issue with it. (cd src/lfortran/parser && ${BISON} -Wall -d parser.yy) # Generate the LSP sources python src/server/generator/generate_lsp_code.py --schema src/server/generator/metaModel.json --target-language c++ --output-dir src/server grep -n "'" src/lfortran/parser/parser.yy && echo "Single quote not allowed" && exit 1 echo "OK" lfortran-0.63.0/environment_win.yml0000664000175000017500000000042315174404631017563 0ustar alastairalastairname: lf channels: - conda-forge dependencies: - llvmdev=11.1.0 - toml - pytest - jupyter - xeus=5.1.0 - xeus-zmq=3.0.0 - nlohmann_json=3.11.3 - jupyter_kernel_test - xonsh=0.16.0 - re2c - numpy - ninja - m2-bison=3.0.4 - git - cmake - zlib lfortran-0.63.0/Dockerfile0000664000175000017500000000173615174404631015621 0ustar alastairalastairFROM ubuntu:22.04 AS build USER root RUN apt-get update && \ apt-get install -y curl git build-essential binutils-dev zlib1g-dev clang libunwind-dev && \ rm -rf /var/lib/apt/lists/* # fix version of miniforge to 24.11.0-0 as that fixes the version of mamba RUN curl -L -O "https://github.com/conda-forge/miniforge/releases/download/24.11.0-0/Miniforge3-$(uname)-$(uname -m).sh" RUN bash Miniforge3-$(uname)-$(uname -m).sh -b RUN /root/miniforge3/bin/mamba init bash WORKDIR /lfortran_build COPY . . RUN /root/miniforge3/bin/mamba env create -f environment_linux.yml -y SHELL ["/root/miniforge3/bin/mamba", "run", "-n", "lf", "/bin/bash", "-c"] RUN ./build_release.sh RUN ctest RUN LFORTRAN_TEST_ENV_VAR='STATUS OK!' python integration_tests/run_tests.py RUN python run_tests.py FROM ubuntu:22.04 AS app RUN apt-get update && \ apt-get install -y --no-install-recommends binutils clang && \ rm -rf /var/lib/apt/lists/* COPY --from=build /lfortran_build/inst /app lfortran-0.63.0/spack.yaml0000664000175000017500000000101315174404631015600 0ustar alastairalastair# This is a Spack Environment file. # # It describes a set of packages to be installed, along with # configuration settings. # # Activate it with: # # spack env activate . # # The first time you need to build all the packages in it: # # spack install # # Then build LFortran as usual: # # ./build0.sh # ./build1.sh # # And everything should be automatically found. spack: # add package specs to the `specs` list specs: [python@3, cmake, llvm@14.0.0, py-toml@0.10.2, re2c@2.2, bison@3.4.2] view: true lfortran-0.63.0/.gitignore0000664000175000017500000001047015174404631015612 0ustar alastairalastair# LFortran src/bin/lfortran src/bin/parse src/bin/parse2 src/bin/parse3 src/lfortran/parser/parser.output tests/output src/lfortran/tests/test_asm src/lfortran/tests/test_ast src/lfortran/tests/test_asr src/lfortran/tests/test_llvm src/lfortran/tests/test_parse src/lfortran/tests/test_pickle src/lfortran/tests/test_stacktrace* src/lfortran/tests/test_serialization* src/lfortran/tests/test_cwrapper src/lfortran/tests/test_serialization src/lfortran/tests/test_lfortran src/lfortran/tests/write32 src/lfortran/tests/write32.asm src/lfortran/tests/subroutines32 src/lfortran/tests/subroutines_args32 src/lfortran/tests/print32 src/lfortran/tests/print_integer src/lfortran/tests/cmp32 src/lfortran/tests/x src/lfortran/tests/ref_pickle.txt.new src/server/lsp_language_server.cpp src/server/lsp_language_server.h src/server/lsp_specification.cpp src/server/lsp_specification.h src/server/lsp_transformer.cpp src/server/lsp_transformer.h **/*.log .#* *.sw? expr2 lfortran-*-dirty/ # fortran_parser build-gfortran build-lfort ## CMake CMakeCache.txt CMakeFiles/ Makefile CTestTestfile.cmake cmake_install.cmake install_manifest.txt Testing/Temporary CPackConfig.cmake CPackSourceConfig.cmake _CPack_Packages /CMakeSettings.json .cmake ## Pixi .pixi/ ## libraries *.a *.a.* *.so *.so.* *.s *.ll *.dylib *.dSYM ## Generated files version lfortran/ast/ast.py lfortran/asr/asr.py lfortran/parser/fortran.tokens lfortran/parser/fortran.interp lfortran/parser/fortranLexer.py lfortran/parser/fortranLexer.tokens lfortran/parser/fortranLexer.interp lfortran/parser/fortranParser.py lfortran/parser/fortranVisitor.py src/lfortran/parser/parser.tab.cc src/lfortran/parser/parser.tab.hh src/lfortran/parser/tokenizer.cpp src/lfortran/parser/preprocessor.cpp src/lfortran/ast.h src/lfortran/asr.h src/libasr/asr.h src/libasr/ast.h src/libasr/asr_base_visitor.h src/libasr/asr_deserialization_visitor.h src/libasr/asr_expr_base_replacer_visitor.h src/libasr/asr_expr_call_replacer_visitor.h src/libasr/asr_expr_stmt_duplicator_visitor.h src/libasr/asr_expr_type_visitor.h src/libasr/asr_expr_value_visitor.h src/libasr/asr_json_visitor.h src/libasr/asr_lookup_name_visitor.h src/libasr/asr_pass_walk_visitor.h src/libasr/asr_pickle_visitor.h src/libasr/asr_serialization_visitor.h src/libasr/asr_stmt_base_replacer_visitor.h src/libasr/asr_tree_visitor.h src/libasr/asr_walk_visitor.h src/libasr/wasm_visitor.h src/libasr/pass/intrinsic_function_registry_util.h src/lfortran/config.h src/libasr/config.h share/jupyter/kernels/fortran/kernel.json share/jupyter/kernels/fortran/logo-svg.svg src/runtime/*.o.empty.c src/runtime/tests/test_abs src/runtime/tests/test_bit src/runtime/tests/test_cos src/runtime/tests/test_hyperbolics src/runtime/tests/test_iso_c_binding src/runtime/tests/test_iso_fortran_env src/runtime/tests/test_kind src/runtime/tests/test_sin src/runtime/tests/test_sin2 src/runtime/tests/test_strings src/runtime/tests/test_tan integration_tests/test-* src/runtime/*.stamp input.txt input inst/ src/libasr/libasr.a.* *.html *.o.tmp.c *.o.tmp.cpp *.tmp.f90 *.clj pass_*.f90 pass_json_*.json pass_tree_*.txt *_lines.txt *_ldd.txt *_lines.dat.txt ### https://raw.github.com/github/gitignore/218a941be92679ce67d0484547e3e142b2f5f6f0/Global/macOS.gitignore # General .DS_Store .AppleDouble .LSOverride # Icon must end with two \r Icon # Thumbnails ._* # Files that might appear in the root of a volume .DocumentRevisions-V100 .fseventsd .Spotlight-V100 .TemporaryItems .Trashes .VolumeIcon.icns .com.apple.timemachine.donotpresent # Directories potentially created on remote AFP share .AppleDB .AppleDesktop Network Trash Folder Temporary Items .apdisk # Python ## Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class ## C extensions *.so ## Distribution / packaging .Python build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ *.egg-info/ .installed.cfg *.egg *.dat *.mod MANIFEST ## PyTest .pytest_cache/ ## Jupyter *-checkpoint.ipynb ## Editor Files .vscode/ .vs/ *~ ## Build Files */bin/lfortran output *.o *.out *.mod *.smod *.js *.wasm *.data /.ccls-cache/ .cache/ ext/ extsrc/ tmp/ tmpdebug/ gentests/ *.tlog *.filters *.obj *.exe *.exp *.lib *.vcxproj *.recipe *.sln *.dll ## Ninja build.ninja .ninja_deps .ninja_log /compile_commands.json ## Docs doc/man/lfortran.1 !doc/src/javascripts/*.js !pass_array_by_data_*.f90 lfortran-0.63.0/environment_linux.yml0000664000175000017500000000075715174404631020137 0ustar alastairalastairname: lf channels: - conda-forge dependencies: - llvmdev=11 # Enable for OpenMP: #- llvm-openmp=11 - toml=0.10.2 - pytest=8.3.4 - jupyter=1.1.1 - xeus=5.1.0 - xeus-zmq=3.0.0 - nlohmann_json=3.11.3 - jupyter_kernel_test - xonsh=0.16.0 - re2c=4.0.1 - numpy=2.2.0 - bison=3.4 - rapidjson=1.1.0 - ninja=1.11.1 - zlib=1.3.1 - zstd-static=1.5.6 - cmake=3.29.1 - make=4.3 # install libunwind if building with llvmdev > 11 only on Linux # - libunwind=1.7.2 lfortran-0.63.0/.gitattributes0000664000175000017500000000007115174404631016511 0ustar alastairalastair*.sh text eol=lf tests/**/*.f90 -text tests/**/*.f -text lfortran-0.63.0/LICENSE0000664000175000017500000005047215174404631014635 0ustar alastairalastairBSD 3-Clause License Copyright (c) 2019-2020, Triad National Security, LLC. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- This program was produced under U.S. Government contract 89233218CNA000001 for Los Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC for the U.S. Department of Energy/National Nuclear Security Administration. All rights in the program are reserved by Triad National Security, LLC, and the U.S. Department of Energy/National Nuclear Security Administration. The Government is granted for itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide license in this material to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. -------------------------------------------------------------------------------- The file src/libasr/codegen/KaleidoscopeJIT.h is available under the Apache 2.0 License with LLVM exception Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---- LLVM Exceptions to the Apache 2.0 License ---- As an exception, if, as a result of your compiling your source code, portions of this Software are embedded into an Object form of such source code, you may redistribute such embedded portions in such Object form without complying with the conditions of Sections 4(a), 4(b) and 4(d) of the License. In addition, if you combine or link compiled forms of this Software with software that is licensed under the GPLv2 ("Combined Software") and if a court of competent jurisdiction determines that the patent provision (Section 3), the indemnity provision (Section 9) or other Section of the License conflicts with the conditions of the GPLv2, you may retroactively and prospectively choose to deem waived or otherwise exclude such Section(s) of the License, but only in their entirety and only with respect to the Combined Software. ============================================================================== Software from third parties included in the LLVM Project: ============================================================================== The LLVM Project contains third party software which is under different license terms. All such code will be identified clearly using at least one of two mechanisms: 1) It will be in a separate directory tree with its own `LICENSE.txt` or `LICENSE` file at the top containing the specific license and restrictions which apply to that software, or 2) It will contain specific license and restriction terms at the top of every file. ============================================================================== Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy): ============================================================================== University of Illinois/NCSA Open Source License Copyright (c) 2003-2019 University of Illinois at Urbana-Champaign. All rights reserved. Developed by: LLVM Team University of Illinois at Urbana-Champaign http://llvm.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal with the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimers in the documentation and/or other materials provided with the distribution. * Neither the names of the LLVM Team, University of Illinois at Urbana-Champaign, nor the names of its contributors may be used to endorse or promote products derived from this Software without specific prior written permission. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. -------------------------------------------------------------------------------- The file src/tests/doctest.h is available under the MIT License The MIT License (MIT) Copyright (c) 2016-2023 Viktor Kirilov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- The files src/bin/tpl/whereami/whereami.cpp and src/bin/tpl/whereami/whereami.h are available under the MIT License or the WTF License Copyright Gregory Pakosz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2004 Sam Hocevar Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed. DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO. 1. Bla bla bla 2. Montesqieu et camembert, vive la France, zut alors! -------------------------------------------------------------------------------- WTFPLv2 is very permissive, see http://www.wtfpl.net/faq/ However, if this WTFPLV2 is REALLY a blocker and is the reason you can't use this project, contact me and I'll dual license it. lfortran-0.63.0/cmake/0000775000175000017500000000000015174404631014700 5ustar alastairalastairlfortran-0.63.0/cmake/UserOverride.cmake0000664000175000017500000000222315174404631020317 0ustar alastairalastair# This overrides the default CMake Debug and Release compiler options. # The user can still specify different options by setting the # CMAKE_CXX_FLAGS_[RELEASE,DEBUG] variables (on the command line or in the # CMakeList.txt). This files serves as better CMake defaults and should only be # modified if the default values are to be changed. Project specific compiler # flags should be set in the CMakeList.txt by setting the CMAKE_CXX_FLAGS_* # variables. if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # g++ set(common "-Wall -Wextra") set(CMAKE_CXX_FLAGS_RELEASE_INIT "${common} -O3 -funroll-loops -DNDEBUG") set(CMAKE_CXX_FLAGS_DEBUG_INIT "${common} -g -ggdb") elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") # icpc set(common "-Wall") set(CMAKE_CXX_FLAGS_RELEASE_INIT "${common} -xHOST -O3") set(CMAKE_CXX_FLAGS_DEBUG_INIT "${common} -g -O0") elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang) # clang set(common "-Wall -Wextra") set(CMAKE_CXX_FLAGS_RELEASE_INIT "${common} -O3 -funroll-loops -DNDEBUG") set(CMAKE_CXX_FLAGS_DEBUG_INIT "${common} -g -ggdb") elseif (CMAKE_CXX_COMPILER_ID STREQUAL "PGI") # pgcpp endif () lfortran-0.63.0/cmake/FindLFortranZLIB.cmake0000664000175000017500000000261415174404631020716 0ustar alastairalastair# FindLFortranZLIB.cmake # Finds the ZLIB compression library for LFortran # # Respects the USE_DYNAMIC_ZLIB variable: # OFF (default): Search for static libraries first (.a, .lib) # ON: Search for dynamic libraries first (.so, .dylib, .dll), then static # # If USE_DYNAMIC_ZLIB is OFF but no static library is available, fall back to # a default search so builds work on systems that do not ship static zlib. # Backup the original value of the requested library suffixes set(_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) if (USE_DYNAMIC_ZLIB) if(WIN32) set(CMAKE_FIND_LIBRARY_SUFFIXES .dll .lib .a) elseif(APPLE) set(CMAKE_FIND_LIBRARY_SUFFIXES .dylib .so .a .lib) else() set(CMAKE_FIND_LIBRARY_SUFFIXES .so .a .lib) endif() else() # Prefer static libraries first set(CMAKE_FIND_LIBRARY_SUFFIXES .a .lib) endif() find_package(ZLIB QUIET) # Reset the library suffixes to the original value set(CMAKE_FIND_LIBRARY_SUFFIXES ${_CMAKE_FIND_LIBRARY_SUFFIXES}) # Unset the temporary to not pollute the global namespace unset(_CMAKE_FIND_LIBRARY_SUFFIXES) if (NOT ZLIB_FOUND OR NOT ZLIB_LIBRARY) unset(ZLIB_FOUND) unset(ZLIB_LIBRARY CACHE) unset(ZLIB_LIBRARIES CACHE) find_package(ZLIB REQUIRED) endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LFortranZLIB DEFAULT_MSG ZLIB_LIBRARY ZLIB_INCLUDE_DIRS) lfortran-0.63.0/cmake/FindLFortranZSTD.cmake0000664000175000017500000000374315174404631020746 0ustar alastairalastair# FindLFortranZSTD.cmake # Finds the ZSTD compression library for LFortran # # Respects the USE_DYNAMIC_ZSTD variable: # OFF (default): Search for static libraries only (.a, .lib) # ON: Search for dynamic libraries first (.so, .dylib, .dll), then static # Backup the original value of the requested library suffixes set(_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) if (USE_DYNAMIC_ZSTD) # Search dynamic library first, then static one if(WIN32) set(CMAKE_FIND_LIBRARY_SUFFIXES .dll .lib .a) elseif(APPLE) set(CMAKE_FIND_LIBRARY_SUFFIXES .dylib .so .a .lib) else() set(CMAKE_FIND_LIBRARY_SUFFIXES .so .a .lib) endif() else() # Static libraries end with .a on Unix and .lib on Windows set(CMAKE_FIND_LIBRARY_SUFFIXES .a .lib) endif() find_path(zstd_INCLUDE_DIR zstd.h) find_library(zstd_LIBRARY zstd) # Reset the library suffixes to the original value set(CMAKE_FIND_LIBRARY_SUFFIXES ${_CMAKE_FIND_LIBRARY_SUFFIXES}) # Unset the temporary to not pollute the global namespace unset(_CMAKE_FIND_LIBRARY_SUFFIXES) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LFortranZSTD DEFAULT_MSG zstd_LIBRARY zstd_INCLUDE_DIR) # We found the static or dynamic ZSTD library and then we set this target which # LLVM CMake uses to find the "shared" library. Then ZSTD gets linked # statically or dynamically with LFortran and everything works. This is # dependent on LLVM's CMake. If it changes, we also have to change the handling # here. add_library(zstd::libzstd_shared INTERFACE IMPORTED) set_property(TARGET zstd::libzstd_shared PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${zstd_INCLUDE_DIR}) set_property(TARGET zstd::libzstd_shared PROPERTY INTERFACE_LINK_LIBRARIES ${zstd_LIBRARY}) add_library(zstd::libzstd INTERFACE IMPORTED) set_property(TARGET zstd::libzstd PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${zstd_INCLUDE_DIR}) set_property(TARGET zstd::libzstd PROPERTY INTERFACE_LINK_LIBRARIES ${zstd_LIBRARY}) lfortran-0.63.0/cmake/FindBFD.cmake0000664000175000017500000000074615174404631017105 0ustar alastairalastairfind_path(BFD_INCLUDE_DIR bfd.h) find_library(BFD_LIBRARY bfd) #find_library(IBERTY_LIBRARY iberty) #find_library(Z_LIBRARY z) #find_library(DL_LIBRARY dl) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(BFD DEFAULT_MSG BFD_INCLUDE_DIR BFD_LIBRARY) add_library(p::bfd INTERFACE IMPORTED) set_property(TARGET p::bfd PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${BFD_INCLUDE_DIR}) set_property(TARGET p::bfd PROPERTY INTERFACE_LINK_LIBRARIES ${BFD_LIBRARY}) lfortran-0.63.0/cmake/FindLINKH.cmake0000664000175000017500000000042615174404631017352 0ustar alastairalastairfind_path(LINK_INCLUDE_DIR link.h) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LINKH DEFAULT_MSG LINK_INCLUDE_DIR) add_library(p::link INTERFACE IMPORTED) set_property(TARGET p::link PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${LINK_INCLUDE_DIR}) lfortran-0.63.0/cmake/postinstall/0000775000175000017500000000000015174404631017254 5ustar alastairalastairlfortran-0.63.0/cmake/postinstall/BuildRuntime.cmake0000664000175000017500000000054215174404631022662 0ustar alastairalastairexecute_process( COMMAND "${CMAKE_COMMAND}" --install "${CMAKE_BINARY_DIR}/src/runtime" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/src/runtime" RESULT_VARIABLE STATUS_BUILD COMMAND_ECHO STDOUT) if (STATUS_BUILD AND NOT STATUS_BUILD EQUAL 0) message(FATAL_ERROR "cmake failed with status: ${STATUS_BUILD}") else() message(STATUS "Done.") endif() lfortran-0.63.0/cmake/postinstall/CMakeLists.txt0000664000175000017500000000011315174404631022007 0ustar alastairalastairinstall(SCRIPT "${CMAKE_SOURCE_DIR}/cmake/postinstall/BuildRuntime.cmake") lfortran-0.63.0/cmake/FindLIBUNWIND.cmake0000664000175000017500000000071515174404631020041 0ustar alastairalastairfind_path(LIBUNWIND_INCLUDE_DIR libunwind.h) find_library(LIBUNWIND_LIBRARY unwind) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LIBUNWIND DEFAULT_MSG LIBUNWIND_INCLUDE_DIR LIBUNWIND_LIBRARY) add_library(p::libunwind INTERFACE IMPORTED) set_property(TARGET p::libunwind PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${LIBUNWIND_INCLUDE_DIR}) set_property(TARGET p::libunwind PROPERTY INTERFACE_LINK_LIBRARIES ${LIBUNWIND_LIBRARY})lfortran-0.63.0/cmake/FindMACHO.cmake0000664000175000017500000000044215174404631017332 0ustar alastairalastairfind_path(MACHO_INCLUDE_DIR mach-o/dyld.h) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(MACHO DEFAULT_MSG MACHO_INCLUDE_DIR) add_library(p::macho INTERFACE IMPORTED) set_property(TARGET p::macho PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${MACHO_INCLUDE_DIR}) lfortran-0.63.0/cmake/FindRapidJSON.cmake0000664000175000017500000000046315174404631020237 0ustar alastairalastairfind_path(RAPIDJSON_HEADER rapidjson/rapidjson.h) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(RapidJSON DEFAULT_MSG RAPIDJSON_HEADER) add_library(p::rapidjson INTERFACE IMPORTED) set_property(TARGET p::rapidjson PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${RAPIDJSON_HEADER}) lfortran-0.63.0/examples/0000775000175000017500000000000015174404631015436 5ustar alastairalastairlfortran-0.63.0/examples/project2/0000775000175000017500000000000015174404631017166 5ustar alastairalastairlfortran-0.63.0/examples/project2/README.md0000664000175000017500000000010515174404631020441 0ustar alastairalastairTo compile with C++: FC=lfortran FFLAGS="--backend=cpp" cmake . lfortran-0.63.0/examples/project2/CMakeLists.txt0000664000175000017500000000060415174404631021726 0ustar alastairalastaircmake_minimum_required(VERSION 3.5 FATAL_ERROR) project(project2 C Fortran) if(CMAKE_VERSION VERSION_LESS 3.31.4) # CMake 3.31.0 through 3.31.3 hard-coded this flag. # It does not work with modules, so remove it. string(REPLACE "--generate-object-code" "" CMAKE_Fortran_COMPILE_OBJECT "${CMAKE_Fortran_COMPILE_OBJECT}") endif() add_executable(doconcurrent doconcurrent.f90 ) lfortran-0.63.0/examples/project2/doconcurrent.f900000664000175000017500000000100215174404631022204 0ustar alastairalastairprogram doconcurrent implicit none real, dimension(10000) :: a, b, c real :: scalar integer :: i, nsize scalar = 10 nsize = size(a) do concurrent (i = 1:nsize) a(i) = 5 b(i) = 5 end do call triad(a, b, scalar, c) print *, "End Stream Triad" contains subroutine triad(a, b, scalar, c) real, intent(in) :: a(:), b(:), scalar real, intent(out) :: c(:) integer :: N, i N = size(a) do concurrent (i = 1:N) c(i) = a(i) + scalar * b(i) end do end subroutine end program lfortran-0.63.0/examples/asr.f900000664000175000017500000000012615174404631016542 0ustar alastairalastairinteger function f(a, b) result(r) integer, intent(in) :: a, b r = a + b end function lfortran-0.63.0/examples/cmdline.f900000664000175000017500000000114215174404631017367 0ustar alastairalastairprogram cmdline integer, parameter :: dp = kind(0.d0) integer :: x character(len=32) :: arg real :: err if (command_argument_count() /= 1) error stop "Must provide exactly 1 argument" call get_command_argument(1, arg) print *, "Got argument:", arg read(arg,*) x print *, "Converted value:", x print *, "sin(x) = ", sin(real(x, dp)) print *, "sin(1) = ", sin(1._dp) err = abs(sin(real(x, dp)) - 8.41470984807896505e-01_dp) print *, "err =", err if (err > 1e-12) then print *, "Make sure you call cmdline with the argument: 1" error stop "The sin(x) does not agree with the reference" end if end program lfortran-0.63.0/examples/expr2.f900000664000175000017500000000011715174404631017015 0ustar alastairalastairprogram expr2 implicit none integer :: x x = (2+3)*5 print *, x end program lfortran-0.63.0/examples/project3/0000775000175000017500000000000015174404631017167 5ustar alastairalastairlfortran-0.63.0/examples/project3/b.f900000664000175000017500000000006415174404631017730 0ustar alastairalastairsubroutine sub print *, "success" end subroutine lfortran-0.63.0/examples/project3/a.f900000664000175000017500000000021115174404631017721 0ustar alastairalastairprogram main implicit none interface subroutine sub end subroutine sub end interface CALL sub end program main lfortran-0.63.0/examples/project3/README.md0000664000175000017500000000030715174404631020446 0ustar alastairalastairTo generate build files: FC=lfortran cmake . To choose a backend: FC=lfortran FFLAGS="--backend=cpp" cmake . FC=lfortran FFLAGS="--backend=llvm" cmake . To build: cmake --build .lfortran-0.63.0/examples/project3/CMakeLists.txt0000664000175000017500000000057715174404631021740 0ustar alastairalastaircmake_minimum_required(VERSION 3.5 FATAL_ERROR) project(project1 C Fortran) if(CMAKE_VERSION VERSION_LESS 3.31.4) # CMake 3.31.0 through 3.31.3 hard-coded this flag. # It does not work with modules, so remove it. string(REPLACE "--generate-object-code" "" CMAKE_Fortran_COMPILE_OBJECT "${CMAKE_Fortran_COMPILE_OBJECT}") endif() add_executable(project3 a.f90 b.f90 ) lfortran-0.63.0/examples/project1/0000775000175000017500000000000015174404631017165 5ustar alastairalastairlfortran-0.63.0/examples/project1/b.f900000664000175000017500000000014715174404631017730 0ustar alastairalastairmodule b implicit none private public g contains integer function g() g = 5 end function end module lfortran-0.63.0/examples/project1/a.f900000664000175000017500000000047315174404631017731 0ustar alastairalastairmodule a use b, only: g implicit none private public f, fib contains integer function f() f = 3 + g() end function subroutine fib(n) integer, intent(in) :: n integer :: i, a, b, c a = 1 b = 1 do i = 1, n-2 c = a+b print *, "Fibonacci: ", i, " ", c a = b; b = c; end do end subroutine end module lfortran-0.63.0/examples/project1/project1.f900000664000175000017500000000015715174404631021237 0ustar alastairalastairprogram project1 use a, only: f, fib implicit none if (f() /= 8) error stop call fib(10) print *, "OK" end lfortran-0.63.0/examples/project1/README.md0000664000175000017500000000025115174404631020442 0ustar alastairalastairTo compile with LFortran: FC=lfortran cmake . To choose a backend: FC=lfortran FFLAGS="--backend=cpp" cmake . FC=lfortran FFLAGS="--backend=llvm" cmake . lfortran-0.63.0/examples/project1/CMakeLists.txt0000664000175000017500000000062015174404631021723 0ustar alastairalastaircmake_minimum_required(VERSION 3.5 FATAL_ERROR) project(project1 C Fortran) if(CMAKE_VERSION VERSION_LESS 3.31.4) # CMake 3.31.0 through 3.31.3 hard-coded this flag. # It does not work with modules, so remove it. string(REPLACE "--generate-object-code" "" CMAKE_Fortran_COMPILE_OBJECT "${CMAKE_Fortran_COMPILE_OBJECT}") endif() add_executable(project1 project1.f90 a.f90 b.f90 ) lfortran-0.63.0/examples/chat_01.f900000664000175000017500000000174715174404631017206 0ustar alastairalastairprogram chat_01 implicit none integer :: choice character(len = 10) :: name print *, "Please enter your name:" read(*, *) name print *, "---------WELCOME TO CHAT_01---------" do while (.true.) print *, "Please pick an option:" print *, "1) Say Hi" print *, "2) Say Hello" print *, "3) Say Good Morning" print *, "4) Say Happy Birthday" print *, "5) Exit the chat" print *, "" print *, "Enter your choice:" read(*, *) choice if (choice == 1) then print *, "Hi "//name else if (choice == 2) then print *, "Hello "//name else if (choice == 3) then print *, "Good Morning "//name else if (choice == 4) then print *, "Happy Birthday "//name//"!" else if (choice == 5) then exit else print *, "Wrong choice. Try again..." end if print *, "" end do end program lfortran-0.63.0/ci/0000775000175000017500000000000015174404631014213 5ustar alastairalastairlfortran-0.63.0/ci/upload_tarball_to_release.sh0000775000175000017500000000120515174404631021737 0ustar alastairalastair#!/usr/bin/env bash set -ex lfortran_version=$(> ~/.ssh/known_hosts eval "$(ssh-agent -s)" set +x if [[ "${SSH_PRIVATE_KEY_MIRROR}" == "" ]]; then echo "Error: SSH_PRIVATE_KEY_MIRROR is empty." exit 1 fi # Generate the private/public key pair using: # # ssh-keygen -f deploy_key -N "" # # then set the $SSH_PRIVATE_KEY_MIRROR environment variable in the GitLab-CI to # the base64 encoded private key: # # cat deploy_key | base64 -w0 # # and add the public key `deploy_key.pub` into the target git repository (with # write permissions). ssh-add <(echo "$SSH_PRIVATE_KEY_MIRROR" | base64 -d) set -x pwd git show-ref git remote -v git push git@github.com:lfortran/lfortran.git +origin/master:master --tags lfortran-0.63.0/ci/wasm_builds_update_json.py0000664000175000017500000000346215174404631021476 0ustar alastairalastairimport datetime from json import load, dump import os import shutil import sys dest_dir = sys.argv[1] version = sys.argv[2] lfortran_commit_sha = sys.argv[3] # Retention policy MAX_DEV_BUILDS = 10 # Keep only the latest 10 debug builds # Release builds have no limit (keep all) filename = "data.json" if os.path.exists(filename): d = load(open(filename)) else: d = {"dev": [], "release": []} # Add new entry entry = { "url": "https://lfortran.github.io/wasm_builds/%s/%s" % \ (dest_dir, lfortran_commit_sha), "version": version, "lfortran_commit_sha": lfortran_commit_sha, "created": str(datetime.datetime.now()) } d[dest_dir].insert(0, entry) # Apply retention policy for dev builds if dest_dir == "dev" and len(d[dest_dir]) > MAX_DEV_BUILDS: print(f"Applying retention policy: keeping only {MAX_DEV_BUILDS} latest dev builds") # Get builds to remove (everything after the first MAX_DEV_BUILDS entries) builds_to_remove = d[dest_dir][MAX_DEV_BUILDS:] # Remove old build directories for build in builds_to_remove: build_sha = build["lfortran_commit_sha"] build_path = os.path.join(dest_dir, build_sha) if os.path.exists(build_path): print(f"Removing old build directory: {build_path}") shutil.rmtree(build_path) else: print(f"Build directory not found (already removed?): {build_path}") # Keep only the latest MAX_DEV_BUILDS entries in JSON d[dest_dir] = d[dest_dir][:MAX_DEV_BUILDS] print(f"Kept {len(d[dest_dir])} dev builds in data.json") elif dest_dir == "release": print(f"Release build: no retention limit (keeping all {len(d[dest_dir])} builds)") print("Saving to %s." % filename) with open(filename, "w") as f: dump(d, f, indent=4, ensure_ascii=False, sort_keys=True) lfortran-0.63.0/ci/test_fortran_kernel.py0000664000175000017500000000121415174404631020635 0ustar alastairalastairimport unittest import jupyter_kernel_test as jkt class IRKernelTests(jkt.KernelTests): kernel_name = "fortran" language_name = "fortran" file_extension = ".f90" code_hello_world = 'print *, "hello, world"' #code_stderr = "1x" #complete_code_samples = ['1', 'print *, "hello, world"', # "integer :: i"] #incomplete_code_samples = ["subroutine f("] #code_generate_error = "1x" code_execute_result = [ {'code': "1+2+3", 'result': "6"}, {'code': "1+2", 'result': "3"}, {'code': "integer :: x; x = 5; x*2", 'result': "10"}, ] if __name__ == '__main__': unittest.main() lfortran-0.63.0/ci/test_lsp.sh0000664000175000017500000000125715174404631016411 0ustar alastairalastair#!/usr/bin/env shell # This is a cross-platform `shell` script. set -ex echo "Running SHELL" src/bin/lfortran --version cmake --version if [[ $WIN != "1" ]]; then pip install src/server/tests tests/server # NOTE: If you want to print all the messages, even on success, then disable # `--capture` as follows: # -------------------------------------------------------------------------- # pytest -vv --showlocals --capture=no --timeout=10 tests/server timeout -k 10 60s pytest -vv --showlocals --timeout=10 --execution-strategy="concurrent" tests/server timeout -k 10 60s pytest -vv --showlocals --timeout=10 --execution-strategy="parallel" tests/server fi lfortran-0.63.0/ci/test_without_llvm_backend.sh0000664000175000017500000000064715174404631022021 0ustar alastairalastair#!/usr/bin/env shell # This is a cross-platform `shell` script. set -ex # TODO: this file has been ported from a xonsh file, hence # we need to re-check the below FIXME # FIXME: Using the below flag generates many warnings. # os.environ['CXXFLAGS'] = "-Werror" ./build0.sh cmake -DWITH_LSP=yes -DWITH_JSON=yes -DCMAKE_BUILD_TYPE=Debug . make -j16 ctest --output-on-failure ./run_tests.py --no-llvm --skip-run-with-dbg lfortran-0.63.0/ci/environment_docs_linux.yml0000664000175000017500000000104215174404631021526 0ustar alastairalastairname: lf channels: - conda-forge dependencies: - llvmdev=11.1.0 - toml=0.10.2 - pytest=8.1.1 - jupyter=1.0.0 - xeus=5.1.0 - xeus-zmq=3.0.0 - nlohmann_json=3.11.3 - jupyter_kernel_test=0.7.0 - re2c=3.1 - numpy=1.26.4 - bison=3.4 - rapidjson=1.1.0 - ninja=1.11.1 - python=3.10 - nbsphinx=0.8.9 - myst-parser=0.18.0 - sphinx=4.5.0 - sphinx-copybutton=0.5.0 - lxml=4.9.2 - pip=23.0.1 - unidecode=1.3.6 - text-unidecode=1.3 - python-slugify=8.0.1 - cmake=3.29.1 - pip: - sphinx-material==0.0.35 lfortran-0.63.0/ci/version.sh0000775000175000017500000000070515174404631016241 0ustar alastairalastair#!/usr/bin/env bash # This script extracts the project's current version from git using # `git describe`, which determines the version based on the latest tag, such as: # # $ git describe --tags --dirty # v0.6.0-37-g3878937f-dirty # # Each tag starts with "v", so we strip the "v", and the final version becomes: # # 0.6.0-37-g3878937f-dirty # set -ex version=$(git describe --tags --dirty) version="${version:1}" echo $version > version lfortran-0.63.0/ci/upload_docs.sh0000775000175000017500000000264015174404631017050 0ustar alastairalastair#!/usr/bin/env bash set -e set -x git_ref=${GITHUB_REF} if [[ $git_ref != "refs/heads/main" ]]; then # Development version dest_branch=${git_ref} deploy_repo="git@gitlab.com:lfortran/web/docs.lfortran.org-testing.git" else # Release version dest_branch="master" deploy_repo="git@github.com:lfortran/docs.lfortran.org.git" fi mkdir ~/.ssh chmod 700 ~/.ssh ssh-keyscan gitlab.com >> ~/.ssh/known_hosts ssh-keyscan github.com >> ~/.ssh/known_hosts eval "$(ssh-agent -s)" set +x if [[ "${SSH_PRIVATE_KEY_DOCS}" == "" ]]; then echo "Note: SSH_PRIVATE_KEY_DOCS is empty, skipping..." exit 0 fi # Generate the private/public key pair using: # # ssh-keygen -f deploy_key -N "" # # then set the $SSH_PRIVATE_KEY_DOCS environment variable in the GitLab-CI to # the base64 encoded private key: # # cat deploy_key | base64 -w0 # # and add the public key `deploy_key.pub` into the target git repository (with # write permissions). ssh-add <(echo "$SSH_PRIVATE_KEY_DOCS" | base64 -d) set -x D=`pwd` mkdir $HOME/repos cd $HOME/repos git clone ${deploy_repo} docs-deploy cd docs-deploy rm -rf docs mkdir docs echo "docs.lfortran.org" > docs/CNAME touch docs/.nojekyll cp -r $D/site/* docs/ git config user.name "Deploy" git config user.email "noreply@deploy" COMMIT_MESSAGE="Deploying on $(date "+%Y-%m-%d %H:%M:%S")" git add docs git commit -m "${COMMIT_MESSAGE}" git push origin +master:$dest_branch lfortran-0.63.0/ci/environment.yml0000664000175000017500000000062415174404631017304 0ustar alastairalastairname: lf channels: - conda-forge dependencies: - python=3.10 - toml=0.10.2 - pytest=8.1.1 - jupyter=1.0.0 - nbconvert=7.4.0 - xeus=5.1.0 - xeus-zmq=3.0.0 - nlohmann_json=3.11.3 - jupyter_kernel_test=0.7.0 - re2c=3.1 - numpy=1.26.4 - ninja=1.11.1 - rapidjson=1.1.0 - cmake=3.29.1 - shell=0.2.0 # - m4=1.4.19 [not win] # - bison=3.4 [not win] # - m2-bison=3.4 [win] lfortran-0.63.0/ci/test.sh0000664000175000017500000000545715174404631015541 0ustar alastairalastair#!/usr/bin/env shell # This is a cross-platform `shell` script. set -ex echo "Running SHELL" # Run some simple compilation tests, works everywhere: src/bin/lfortran --version # Compile and link separately src/bin/lfortran -c examples/expr2.f90 -o expr2.o src/bin/lfortran -o expr2 expr2.o ./expr2 # Compile C and Fortran src/bin/lfortran -c integration_tests/modules_15b.f90 -o modules_15b.o src/bin/lfortran -c integration_tests/modules_15.f90 -o modules_15.o if [[ $WIN == "1" ]]; then # Windows cl /MD /c integration_tests/modules_15c.c /Fomodules_15c.o elif [[ $MACOS == "1" ]]; then # macOS clang -c integration_tests/modules_15c.c -o modules_15c.o else # Linux gcc -c integration_tests/modules_15c.c -o modules_15c.o fi src/bin/lfortran modules_15.o modules_15b.o modules_15c.o -o modules_15 ./modules_15 # Compile and link in one step src/bin/lfortran integration_tests/intrinsics_04s.f90 -o intrinsics_04s ./intrinsics_04s src/bin/lfortran integration_tests/intrinsics_04.f90 -o intrinsics_04 ./intrinsics_04 # Run all tests (does not work on Windows yet): cmake --version if [[ $WIN != "1" ]]; then # using debugging option i.e. `-x` causes incorrect assignment set +x if [[ $MACOS == "1" ]]; then # macOS ARM64 runners have 3 cores; higher parallelism overwhelms them NPROC=3 else # this works fine on Linux NPROC=$(nproc) fi # we turn on the debugging again set -x echo "NPROC: ${NPROC}" if [[ $LFORTRAN_LLVM_VERSION == "11" ]]; then ./run_tests.py fi cd integration_tests mkdir build-lfortran-llvm cd build-lfortran-llvm FC="../../src/bin/lfortran" cmake -DLFORTRAN_BACKEND=llvm -DCURRENT_BINARY_DIR=. .. make -j${NPROC} ctest -L llvm -j${NPROC} cd .. ./run_tests.py -b llvm llvm2 llvm_rtlib llvm_nopragma llvm_integer_8 llvmImplicit -j${NPROC} if [[ $MACOS != "1" ]]; then ./run_tests.py -b llvm -sc -j${NPROC} ./run_tests.py -b llvm2 llvm_rtlib llvm_nopragma llvm_integer_8 -f -j${NPROC} fi if [[ $LFORTRAN_LLVM_VERSION == "11" ]]; then if [[ $MACOS != "1" ]]; then ./run_tests.py -b llvm llvmImplicit -f -nf16 -j${NPROC} fi else if [[ $MACOS != "1" ]]; then ./run_tests.py -b llvm llvmImplicit -f -j${NPROC} fi fi ./run_tests.py -b llvm_submodule -j${NPROC} if [[ $MACOS != "1" ]]; then ./run_tests.py -b llvm_submodule -sc -j${NPROC} fi ./run_tests.py -b llvm --detect-leaks cd .. pip install src/server/tests tests/server # NOTE: `--full-trace` tends to print excessively long stack traces. Please # re-enable it if needed: # pytest -vv --showlocals --full-trace --capture=no --timeout=5 tests/server # pytest -vv --showlocals --capture=no --timeout=5 tests/server fi lfortran-0.63.0/ci/generate_lalr1_patch.py0000775000175000017500000000302515174404631020634 0ustar alastairalastair#!/usr/bin/env python3 """ This script generates the parser.yy.patch that makes the GLR parser a LALR(1) parser. Usage: ci/generate_lalr1_patch.py """ import subprocess # Check if git diff shows any changes using return code result = subprocess.run(['git', 'diff'], capture_output=True, text=True) if result.returncode != 0: print("Git diff shows changes. Please commit the changes first.") exit(1) # Define file paths file_path = 'src/lfortran/parser/parser.yy' patch_path = 'ci/parser.yy.patch' # Read the file with open(file_path, 'r') as f: lines = f.readlines() # Modify id section for j in range(len(lines) - 1): if lines[j].strip() == 'id' and \ ': TK_NAME { $$ = SYMBOL($1, @$); }' in lines[j+1]: # Delete all subsequent | KW_* lines until ; k = j + 2 while k < len(lines) and lines[k].strip() != ';': stripped_line = lines[k].strip() if not stripped_line.startswith('| KW'): raise ValueError(f"Unexpected line in id section: {stripped_line}") del lines[k] # No k += 1, as del shifts the list break # Write modified lines back to the file with open(file_path, 'w') as f: f.writelines(lines) # Generate the patch using git diff with open(patch_path, 'w') as patch_file: subprocess.run(['git', 'diff', '--', file_path], stdout=patch_file, check=True) # Restore the original file to remove changes subprocess.run(['git', 'restore', file_path], check=True) print(f"Patch generated and saved to {patch_path}") lfortran-0.63.0/ci/azure_mirror.sh0000775000175000017500000000160715174404631017276 0ustar alastairalastair#!/usr/bin/env bash set -e set -x mkdir ~/.ssh chmod 700 ~/.ssh ssh-keyscan ssh.dev.azure.com >> ~/.ssh/known_hosts eval "$(ssh-agent -s)" set +x if [[ "${SSH_PRIVATE_KEY_AZURE}" == "" ]]; then echo "Error: SSH_PRIVATE_KEY_AZURE is empty." exit 1 fi # Generate the private/public key pair using: # # ssh-keygen -f deploy_key -N "" # # then set the $SSH_PRIVATE_KEY_AZURE environment variable in the GitLab-CI to # the base64 encoded private key: # # cat deploy_key | base64 -w0 # # and add the public key `deploy_key.pub` into the target git repository (with # write permissions). ssh-add <(echo "$SSH_PRIVATE_KEY_AZURE" | base64 -d) set -x pwd bname="branch-$CI_COMMIT_REF_NAME" git branch -D ${bname} || echo ok git checkout $CI_COMMIT_SHA git checkout -b ${bname} git show-ref git remote -v git push git@ssh.dev.azure.com:v3/lfortran/lfortran/lfortran +${bname}:${bname} --tags lfortran-0.63.0/ci/tarball_update_json.py0000664000175000017500000000122015174404631020574 0ustar alastairalastairimport datetime from json import load, dump import os import sys dest_dir = sys.argv[1] version = sys.argv[2] lfortran_commit_sha = sys.argv[3] filename = "data.json" if os.path.exists(filename): d = load(open(filename)) else: d = {"dev": [], "release": []} entry = { "url": "https://lfortran.github.io/tarballs/%s/lfortran-%s.tar.gz" % \ (dest_dir, version), "version": version, "lfortran_commit_sha": lfortran_commit_sha, "created": str(datetime.datetime.now()) } d[dest_dir].append(entry) print("Saving to %s." % filename) with open(filename, "w") as f: dump(d, f, indent=4, ensure_ascii=False, sort_keys=True) lfortran-0.63.0/ci/parser.yy.patch0000664000175000017500000001701415174404631017173 0ustar alastairalastairdiff --git a/src/lfortran/parser/parser.yy b/src/lfortran/parser/parser.yy index 300dbffdb..79dbf0b14 100644 --- a/src/lfortran/parser/parser.yy +++ b/src/lfortran/parser/parser.yy @@ -2550,177 +2550,4 @@ id_opt id : TK_NAME { $$ = SYMBOL($1, @$); } - | KW_ABSTRACT { $$ = SYMBOL($1, @$); } - | KW_ALL { $$ = SYMBOL($1, @$); } - | KW_ALLOCATABLE { $$ = SYMBOL($1, @$); } - | KW_ALLOCATE { $$ = SYMBOL($1, @$); } - | KW_ASSIGN { $$ = SYMBOL($1, @$); } - | KW_ASSIGNMENT { $$ = SYMBOL($1, @$); } - | KW_ASSOCIATE { $$ = SYMBOL($1, @$); } - | KW_ASYNCHRONOUS { $$ = SYMBOL($1, @$); } - | KW_BACKSPACE { $$ = SYMBOL($1, @$); } - | KW_BIND { $$ = SYMBOL($1, @$); } - | KW_BLOCK { $$ = SYMBOL($1, @$); } - | KW_CALL { $$ = SYMBOL($1, @$); } - | KW_CASE { $$ = SYMBOL($1, @$); } - | KW_CHANGE { $$ = SYMBOL($1, @$); } - | KW_CHARACTER { $$ = SYMBOL($1, @$); } - | KW_CLASS { $$ = SYMBOL($1, @$); } - | KW_CLOSE { $$ = SYMBOL($1, @$); } - | KW_CODIMENSION { $$ = SYMBOL($1, @$); } - | KW_COMMON { $$ = SYMBOL($1, @$); } - | KW_COMPLEX { $$ = SYMBOL($1, @$); } - | KW_CONCURRENT { $$ = SYMBOL($1, @$); } - | KW_CONTAINS { $$ = SYMBOL($1, @$); } - | KW_CONTIGUOUS { $$ = SYMBOL($1, @$); } - | KW_CONTINUE { $$ = SYMBOL($1, @$); } - | KW_CRITICAL { $$ = SYMBOL($1, @$); } - | KW_CYCLE { $$ = SYMBOL($1, @$); } - | KW_DATA { $$ = SYMBOL($1, @$); } - | KW_DEALLOCATE { $$ = SYMBOL($1, @$); } - | KW_DEFAULT { $$ = SYMBOL($1, @$); } - | KW_DEFERRED { $$ = SYMBOL($1, @$); } - | KW_DIMENSION { $$ = SYMBOL($1, @$); } - | KW_DO { $$ = SYMBOL($1, @$); } - | KW_DOWHILE { $$ = SYMBOL($1, @$); } - | KW_DOUBLE { $$ = SYMBOL($1, @$); } - | KW_DOUBLE_PRECISION { $$ = SYMBOL($1, @$); } - | KW_DOUBLE_COMPLEX { $$ = SYMBOL($1, @$); } - | KW_ELEMENTAL { $$ = SYMBOL($1, @$); } - | KW_ELSE { $$ = SYMBOL($1, @$); } - | KW_ELSEIF { $$ = SYMBOL($1, @$); } - | KW_ELSEWHERE { $$ = SYMBOL($1, @$); } - | KW_END { $$ = SYMBOL($1, @$); } - | KW_ENDDO { $$ = SYMBOL($1, @$); } - | KW_ENDIF { $$ = SYMBOL($1, @$); } - | KW_ENDINTERFACE { $$ = SYMBOL($1, @$); } - | KW_ENDTYPE { $$ = SYMBOL($1, @$); } - | KW_ENDPROGRAM { $$ = SYMBOL($1, @$); } - | KW_ENDMODULE { $$ = SYMBOL($1, @$); } - | KW_ENDSUBMODULE { $$ = SYMBOL($1, @$); } - | KW_ENDBLOCK { $$ = SYMBOL($1, @$); } - | KW_ENDBLOCKDATA { $$ = SYMBOL($1, @$); } - | KW_ENDSUBROUTINE { $$ = SYMBOL($1, @$); } - | KW_ENDFUNCTION { $$ = SYMBOL($1, @$); } - | KW_ENDPROCEDURE { $$ = SYMBOL($1, @$); } - | KW_ENDENUM { $$ = SYMBOL($1, @$); } - | KW_ENDSELECT { $$ = SYMBOL($1, @$); } - | KW_ENDASSOCIATE { $$ = SYMBOL($1, @$); } - | KW_ENDFORALL { $$ = SYMBOL($1, @$); } - | KW_ENDWHERE { $$ = SYMBOL($1, @$); } - | KW_ENDCRITICAL { $$ = SYMBOL($1, @$); } - | KW_ENDFILE { $$ = SYMBOL($1, @$); } - | KW_ENTRY { $$ = SYMBOL($1, @$); } - | KW_ENUM { $$ = SYMBOL($1, @$); } - | KW_ENUMERATOR { $$ = SYMBOL($1, @$); } - | KW_EQUIVALENCE { $$ = SYMBOL($1, @$); } - | KW_ERRMSG { $$ = SYMBOL($1, @$); } - | KW_ERROR { $$ = SYMBOL($1, @$); } - | KW_EVENT { $$ = SYMBOL($1, @$); } - | KW_EXIT { $$ = SYMBOL($1, @$); } - | KW_EXTENDS { $$ = SYMBOL($1, @$); } - | KW_EXTERNAL { $$ = SYMBOL($1, @$); } - | KW_FILE { $$ = SYMBOL($1, @$); } - | KW_FINAL { $$ = SYMBOL($1, @$); } - | KW_FLUSH { $$ = SYMBOL($1, @$); } - | KW_FORALL { $$ = SYMBOL($1, @$); } - | KW_FORMATTED { $$ = SYMBOL($1, @$); } - | KW_FORM { $$ = SYMBOL($1, @$); } - | KW_FORM_TEAM { $$ = SYMBOL($1, @$); } - | KW_FUNCTION { $$ = SYMBOL($1, @$); } - | KW_GENERIC { $$ = SYMBOL($1, @$); } - | KW_GO { $$ = SYMBOL($1, @$); } - | KW_GOTO { $$ = SYMBOL($1, @$); } - | KW_IF { $$ = SYMBOL($1, @$); } - | KW_IMAGES { $$ = SYMBOL($1, @$); } - | KW_IMPLICIT { $$ = SYMBOL($1, @$); } - | KW_IMPORT { $$ = SYMBOL($1, @$); } - | KW_IMPURE { $$ = SYMBOL($1, @$); } - | KW_IN { $$ = SYMBOL($1, @$); } - | KW_INCLUDE { $$ = SYMBOL($1, @$); } - | KW_INOUT { $$ = SYMBOL($1, @$); } - | KW_INQUIRE { $$ = SYMBOL($1, @$); } - | KW_INSTANTIATE { $$ = SYMBOL($1, @$); } - | KW_INTEGER { $$ = SYMBOL($1, @$); } - | KW_INTENT { $$ = SYMBOL($1, @$); } - | KW_INTERFACE { $$ = SYMBOL($1, @$); } - | KW_INTRINSIC { $$ = SYMBOL($1, @$); } - | KW_IS { $$ = SYMBOL($1, @$); } - | KW_KIND { $$ = SYMBOL($1, @$); } - | KW_LEN { $$ = SYMBOL($1, @$); } - | KW_LOCAL { $$ = SYMBOL($1, @$); } - | KW_LOCAL_INIT { $$ = SYMBOL($1, @$); } - | KW_LOGICAL { $$ = SYMBOL($1, @$); } - | KW_MEMORY { $$ = SYMBOL($1, @$); } - | KW_MODULE { $$ = SYMBOL($1, @$); } - | KW_MOLD { $$ = SYMBOL($1, @$); } - | KW_NAME { $$ = SYMBOL($1, @$); } - | KW_NAMELIST { $$ = SYMBOL($1, @$); } - | KW_NEW_INDEX { $$ = SYMBOL($1, @$); } - | KW_NOPASS { $$ = SYMBOL($1, @$); } - | KW_NON_INTRINSIC { $$ = SYMBOL($1, @$); } - | KW_NON_OVERRIDABLE { $$ = SYMBOL($1, @$); } - | KW_NON_RECURSIVE { $$ = SYMBOL($1, @$); } - | KW_NONE { $$ = SYMBOL($1, @$); } - | KW_NULLIFY { $$ = SYMBOL($1, @$); } - | KW_ONLY { $$ = SYMBOL($1, @$); } - | KW_OPEN { $$ = SYMBOL($1, @$); } - | KW_OPERATOR { $$ = SYMBOL($1, @$); } - | KW_OPTIONAL { $$ = SYMBOL($1, @$); } - | KW_OUT { $$ = SYMBOL($1, @$); } - | KW_PARAMETER { $$ = SYMBOL($1, @$); } - | KW_PASS { $$ = SYMBOL($1, @$); } - | KW_POINTER { $$ = SYMBOL($1, @$); } - | KW_POST { $$ = SYMBOL($1, @$); } - | KW_PRECISION { $$ = SYMBOL($1, @$); } - | KW_PRINT { $$ = SYMBOL($1, @$); } - | KW_PRIVATE { $$ = SYMBOL($1, @$); } - | KW_PROCEDURE { $$ = SYMBOL($1, @$); } - | KW_PROGRAM { $$ = SYMBOL($1, @$); } - | KW_PROTECTED { $$ = SYMBOL($1, @$); } - | KW_PUBLIC { $$ = SYMBOL($1, @$); } - | KW_PURE { $$ = SYMBOL($1, @$); } - | KW_QUIET { $$ = SYMBOL($1, @$); } - | KW_RANK { $$ = SYMBOL($1, @$); } - | KW_READ { $$ = SYMBOL($1, @$); } - | KW_REAL { $$ = SYMBOL($1, @$); } - | KW_RECURSIVE { $$ = SYMBOL($1, @$); } - | KW_REDUCE { $$ = SYMBOL($1, @$); } - | KW_REQUIREMENT { $$ = SYMBOL($1, @$); } - | KW_REQUIRE { $$ = SYMBOL($1, @$); } - | KW_RESULT { $$ = SYMBOL($1, @$); } - | KW_RETURN { $$ = SYMBOL($1, @$); } - | KW_REWIND { $$ = SYMBOL($1, @$); } - | KW_SAVE { $$ = SYMBOL($1, @$); } - | KW_SELECT { $$ = SYMBOL($1, @$); } - | KW_SELECT_CASE { $$ = SYMBOL($1, @$); } - | KW_SELECT_RANK { $$ = SYMBOL($1, @$); } - | KW_SELECT_TYPE { $$ = SYMBOL($1, @$); } - | KW_SEQUENCE { $$ = SYMBOL($1, @$); } - | KW_SHARED { $$ = SYMBOL($1, @$); } - | KW_SOURCE { $$ = SYMBOL($1, @$); } - | KW_STAT { $$ = SYMBOL($1, @$); } - | KW_STOP { $$ = SYMBOL($1, @$); } - | KW_SUBMODULE { $$ = SYMBOL($1, @$); } - | KW_SUBROUTINE { $$ = SYMBOL($1, @$); } - | KW_SYNC { $$ = SYMBOL($1, @$); } - | KW_TARGET { $$ = SYMBOL($1, @$); } - | KW_TEAM { $$ = SYMBOL($1, @$); } - | KW_TEAM_NUMBER { $$ = SYMBOL($1, @$); } - | KW_TEMPLATE { $$ = SYMBOL($1, @$); } - | KW_THEN { $$ = SYMBOL($1, @$); } - | KW_TO { $$ = SYMBOL($1, @$); } - | KW_TYPE { $$ = SYMBOL($1, @$); } - | KW_UNFORMATTED { $$ = SYMBOL($1, @$); } - | KW_USE { $$ = SYMBOL($1, @$); } - | KW_VALUE { $$ = SYMBOL($1, @$); } - | KW_VOLATILE { $$ = SYMBOL($1, @$); } - | KW_WAIT { $$ = SYMBOL($1, @$); } - | KW_WHERE { $$ = SYMBOL($1, @$); } - | KW_WHILE { $$ = SYMBOL($1, @$); } - | KW_WRITE { $$ = SYMBOL($1, @$); } - | KW_LIST { $$ = SYMBOL($1, @$); } - | KW_SET { $$ = SYMBOL($1, @$); } - | KW_DICT { $$ = SYMBOL($1, @$); } - | KW_TUPLE { $$ = SYMBOL($1, @$); } ; lfortran-0.63.0/ci/environment_linux_llvm.yml0000664000175000017500000000045015174404631021552 0ustar alastairalastairname: lf channels: - conda-forge dependencies: - toml=0.10.2 - pytest=8.1.1 - jupyter=1.0.0 - xeus=5.1.0 - xeus-zmq=3.0.0 - nlohmann_json=3.11.3 - jupyter_kernel_test=0.7.0 - re2c=3.1 - numpy=1.26.4 - bison=3.4 - rapidjson=1.1.0 - ninja=1.11.1 - zlib - cmake=3.29.1 lfortran-0.63.0/ci/test_third_party_codes.sh0000775000175000017500000006153315174404631021327 0ustar alastairalastair#!/bin/bash set -ex # Exit immediately on any error # Default to gfortran if FC is not set : "${FC:=gfortran}" : "${LFORTRAN_LAPACK_TEST_MODE:=full}" LAPACK_TEST_MODE="$LFORTRAN_LAPACK_TEST_MODE" # Color definitions for pretty output GREEN='\033[0;32m' BLUE='\033[1;34m' YELLOW='\033[1;33m' NC='\033[0m' # No Color # Helper functions for logging print_usage() { cat <] EOF } print_section() { echo -e "\n${BLUE}===============================" echo -e "$1" echo -e "===============================${NC}\n" } print_subsection() { echo -e "${YELLOW}→ $1${NC}" } print_success() { echo -e "${GREEN}✔ $1${NC}" } run_test() { print_subsection "Running: $1" ./$1 print_success "Success: $1" } time_section() { local LABEL="$1" local BLOCK="$2" local START=$(date +%s) print_section "$LABEL" eval "$BLOCK" local END=$(date +%s) print_subsection "â± Duration: $((END - START)) seconds" } while [[ $# -gt 0 ]]; do case "$1" in --lapack-mode) if [[ $# -lt 2 ]]; then echo "ERROR: --lapack-mode requires a value" print_usage exit 1 fi LAPACK_TEST_MODE="$2" shift 2 ;; --lapack-mode=*) LAPACK_TEST_MODE="${1#*=}" shift ;; -h|--help) print_usage exit 0 ;; *) echo "ERROR: unknown option: $1" print_usage exit 1 ;; esac done if [[ "$LAPACK_TEST_MODE" != "smoke" && "$LAPACK_TEST_MODE" != "full" ]]; then echo "ERROR: invalid LAPACK test mode '$LAPACK_TEST_MODE' (expected 'smoke' or 'full')" exit 1 fi # Setup a temporary workspace TMP_DIR=$(mktemp -d) cd "$TMP_DIR" if [[ "$(uname)" == "Darwin" ]]; then time_section "🧪 Testing caffeine" ' which lfortran lfortran --version # Install pixi (needed to drive gasnet and caffeine builds) if ! command -v pixi >/dev/null 2>&1; then curl -fsSL https://pixi.sh/install.sh | bash export PATH="$HOME/.pixi/bin:$PATH" fi pixi --version # Build GASNet first (caffeine depends on it) git clone -b build https://github.com/certik/gasnet.git cd gasnet git checkout 2949970115991c3eb71ba7c16edc87807d687e97 pixi install pixi r build pixi r install cd .. # Now build and test caffeine with LFortran git clone -b build4 https://github.com/certik/caffeine.git cd caffeine git checkout 50f6ae6 pixi r -e lfortran test print_success "Done with caffeine" cd .. rm -rf caffeine gasnet ' fi time_section "🧪 Testing assert" ' git clone https://github.com/pranavchiku/assert.git cd assert export PATH="$(pwd)/../src/bin:$PATH" micromamba install -c conda-forge fpm=0.12.0 # To debug https://github.com/lfortran/lfortran/issues/7732: which fpm realpath $(which fpm) ls -l $(dirname $(realpath $(which fpm)))/../lib ls -l $CONDA_PREFIX/lib fpm --version git checkout -t origin/fix-test git checkout 535434d2f44508aa06231c6c2fe95f9e11292769 git clean -dfx fpm build --compiler=$FC --flag "--cpp" --verbose fpm test --compiler=$FC --flag "--cpp" git clean -dfx print_subsection "Testing with assertions enabled" fpm test --compiler=$FC --verbose --flag '--cpp -DASSERTIONS -DASSERT_PARALLEL_CALLBACKS' cd ../ rm -rf assert ' time_section "🧪 Testing splpak" ' git clone https://github.com/Pranavchiku/splpak.git cd splpak export PATH="$(pwd)/../src/bin:$PATH" micromamba install -c conda-forge fpm # To debug https://github.com/lfortran/lfortran/issues/7732: which fpm realpath $(which fpm) ls -l $(dirname $(realpath $(which fpm)))/../lib ls -l $CONDA_PREFIX/lib fpm --version git checkout lf-2 git checkout 460bd22f4ac716e5266412e8ed35ce07aa664f08 git clean -dfx fpm build --compiler=$FC --profile release --flag "--cpp -DREAL32 --no-fast-math" --verbose fpm test --compiler=$FC --profile release --flag "--cpp -DREAL32 --no-fast-math" cd ../ rm -rf splpak ' time_section "🧪 Testing neural-fortran" ' git clone https://github.com/modern-fortran/neural-fortran cd neural-fortran export PATH="$(pwd)/../src/bin:$PATH" micromamba install -c conda-forge fpm git checkout 5e4940ff2850c9b039f8dd77982715bced8f3ce5 fpm test --compiler=lfortran --flag --cpp --flag --separate-compilation --flag --realloc-lhs-arrays print_success "Done with neural-fortran" cd .. ' time_section "🧪 Testing Fiats" ' git clone https://github.com/BerkeleyLab/fiats cd fiats export PATH="$(pwd)/../src/bin:$PATH" micromamba install -c conda-forge fpm git checkout 0a2ff33cf8c06c6379d8e8883e846577a29f2f5e fpm test --compiler=lfortran --flag --cpp --flag --separate-compilation --flag --realloc-lhs-arrays if [[ "$(uname)" == "Darwin" ]]; then rm -rf build git fetch https://github.com/certik/fiats lf1 git checkout f5d91ae48c01297a7fb183957654a73721ad4520 fpm test --compiler=lfortran --flag --cpp --flag --separate-compilation --flag --realloc-lhs-arrays --flag "--gpu=metal" fi print_success "Done with Fiats" cd .. ' time_section "🧪 Testing smart-pointers" ' git clone https://github.com/certik/smart-pointers.git cd smart-pointers export PATH="$(pwd)/../src/bin:$PATH" micromamba install -c conda-forge fpm git checkout -t origin/lf2 git checkout 95de5105c6a469b64feb39e999567f5e2fcdd033 fpm test --compiler=lfortran --flag --cpp --flag --realloc-lhs-arrays rm -rf build fpm test --compiler=lfortran --flag --cpp --flag --separate-compilation --flag --realloc-lhs-arrays print_success "Done with smart-pointers" cd .. ' time_section "🧪 Testing Formal" ' git clone https://github.com/certik/formal.git cd formal export PATH="$(pwd)/../src/bin:$PATH" micromamba install -c conda-forge fpm git checkout -t origin/lf1 git checkout 671ab24c3d639b1a2fedd27f727e96dadf404c5c fpm test --compiler=lfortran --flag --cpp --flag --realloc-lhs-arrays rm -rf build fpm test --compiler=lfortran --flag --cpp --flag --separate-compilation --flag --realloc-lhs-arrays print_success "Done with Formal" cd .. ' time_section "🧪 Testing Julienne" ' git clone https://github.com/BerkeleyLab/julienne.git cd julienne export PATH="$(pwd)/../src/bin:$PATH" micromamba install -c conda-forge fpm git checkout a75b5a831e303315304db52ec9dd70c9badc08cd fpm test --compiler=lfortran --flag --cpp --flag --separate-compilation --flag --realloc-lhs-arrays print_success "Done with Julienne" cd .. ' time_section "🧪 Testing fortran-regex" ' git clone https://github.com/perazz/fortran-regex.git cd fortran-regex export PATH="$(pwd)/../src/bin:$PATH" micromamba install -c conda-forge fpm git checkout 96ab33fe003862a28cec91ddd170ac0e86c26c87 fpm --compiler=$FC build fpm --compiler=$FC test print_success "Done with fortran-regex" cd .. ' time_section "🧪 Testing fortran-shlex" ' git clone https://github.com/perazz/fortran-shlex.git cd fortran-shlex export PATH="$(pwd)/../src/bin:$PATH" micromamba install -c conda-forge fpm git checkout e20b6f86c82e33fae78b54b074bab5369efde6a3 fpm --compiler=$FC build --flag "--realloc-lhs-arrays" fpm --compiler=$FC test --flag "--realloc-lhs-arrays" print_success "Done with fortran-shlex" cd .. ' time_section "🧪 Testing toml-f" ' git clone https://github.com/toml-f/toml-f.git cd toml-f export PATH="$(pwd)/../src/bin:$PATH" micromamba install -c conda-forge fpm git checkout 27abd768e79c7c790ffa58fe5ccfb105ba00883d fpm --compiler=$FC build --flag "--cpp --realloc-lhs-arrays" fpm --compiler=$FC test --flag "--cpp --realloc-lhs-arrays" print_success "Done with toml-f" cd .. ' time_section "🧪 Testing jonquil" ' git clone https://github.com/jinangshah21/jonquil.git cd jonquil export PATH="$(pwd)/../src/bin:$PATH" git checkout lf-7 micromamba install -c conda-forge fpm git checkout 8aad5a901810bd669e851eead633c0df2bb7b423 fpm --compiler=$FC test --flag "--cpp --realloc-lhs-arrays --use-loop-variable-after-loop" print_success "Done with jonquil" cd .. ' time_section "🧪 Testing M_CLI2" ' git clone https://github.com/jinangshah21/M_CLI2.git cd M_CLI2 export PATH="$(pwd)/../src/bin:$PATH" git checkout lf-9 micromamba install -c conda-forge fpm git checkout 108f0b5598df2bd8ec7a2dffe56017d58520fdfc fpm --compiler=$FC build --flag "--realloc-lhs-arrays" fpm --compiler=$FC test --flag "--realloc-lhs-arrays" print_success "Done with M_CLI2" cd .. ' if [[ "$(uname)" != "Darwin" ]]; then time_section "🧪 Testing fortran_mpi" ' git clone https://github.com/lfortran/fortran_mpi.git cd fortran_mpi export PATH="$(pwd)/../src/bin:$PATH" export OMPI_MCA_btl_tcp_if_include=lo0 git checkout 31033d3c8af32c4c99fac803c161e6731bc39a78 git clean -fdx cd tests/ FC="$FC --cpp" ./run_tests.sh print_success "Done with fortran_mpi" cd ../../ rm -rf fortran_mpi ' time_section "🧪 Compiling POT3D with fortran_mpi" ' git clone https://github.com/parth121101/pot3d.git cd pot3d git checkout -t origin/lf_hdf5_fortranMPI_namelist_global_workarounds git checkout 380669edd3a5947985674a51e0d65482d6fe68b3 git clone https://github.com/lfortran/fortran_mpi cd fortran_mpi git checkout 31033d3c8af32c4c99fac803c161e6731bc39a78 cp src/mpi.f90 ../src/ cp src/mpi_c_bindings.f90 ../src/ cp src/mpi_constants.c ../src/ cd .. print_subsection "Building with default flags (compile-only)" cd src if [[ "$(uname)" == "Linux" ]]; then CC=gcc else CC=clang fi $CC -I$CONDA_PREFIX/include -c mpi_constants.c $FC --cpp -DOPEN_MPI=yes -c mpi_c_bindings.f90 $FC --cpp -DOPEN_MPI=yes -c mpi.f90 $FC --cpp -DOPEN_MPI=yes -c psi_io.f90 --no-style-suggestions --no-warnings $FC --cpp -DOPEN_MPI=yes -c --implicit-interface pot3d.F90 --no-style-suggestions --no-warnings $FC --cpp -DOPEN_MPI=yes mpi_constants.o mpi_c_bindings.o mpi.o psi_io.o pot3d.o -o pot3d -L$CONDA_PREFIX/lib -lmpi -Wl,-rpath,$CONDA_PREFIX/lib cd .. print_success "Done with POT3D (compile-only)" cd .. rm -rf pot3d ' ########################## # Section 2: FPM ########################## time_section "🧪 Testing FPM" ' git clone https://github.com/fortran-lang/fpm.git cd fpm export PATH="$(pwd)/../src/bin:$PATH" git checkout main micromamba install -c conda-forge fpm git checkout d0f89957541bdcc354da8e11422f5efcf9fedd0e fpm --compiler=$FC build --flag "--cpp --realloc-lhs-arrays --use-loop-variable-after-loop" fpm --compiler=$FC test --flag "--cpp --realloc-lhs-arrays --use-loop-variable-after-loop" print_success "Done with FPM" cd .. ' ########################## # Section 3: Fortran-Primes ########################## time_section "🧪 Testing Fortran-Primes" ' git clone https://github.com/jinangshah21/fortran-primes.git cd fortran-primes git checkout -t origin/lf-3 git checkout 923b468f79eee1ff07b77d9def67249f4d2efa21 print_subsection "Building and running Fortran-Primes" FC=$FC ./build_and_run.sh print_success "Done with Fortran-Primes" cd .. rm -rf fortran-primes ' ######################################## # Section 4: Numerical Methods Fortran # ######################################## time_section "🧪 Testing Numerical Methods Fortran" ' git clone https://github.com/Pranavchiku/numerical-methods-fortran.git cd numerical-methods-fortran git checkout -t origin/lf6 git checkout a252989e64b3f8d5d2f930dca18411c104ea85f8 print_subsection "Building project" FC="$FC --no-array-bounds-checking --realloc-lhs-arrays" make run_test test_fix_point.exe run_test test_integrate_one.exe run_test test_linear.exe run_test test_newton.exe run_test test_ode.exe run_test test_probability_distribution.exe run_test test_sde.exe run_test plot_bogdanov_takens.exe run_test plot_bruinsma.exe run_test plot_fun1.exe run_test plot_lorenz.exe run_test plot_lotka_volterra1.exe run_test plot_lotka_volterra2.exe run_test plot_pendulum.exe run_test plot_transes_iso.exe print_success "Done with Numerical Methods Fortran" cd .. rm -rf numerical-methods-fortran ' ####################### # Section 5: PRIMA # ####################### time_section "🧪 Compiling PRIMA" ' git clone https://github.com/Pranavchiku/prima.git cd prima git checkout -t origin/lf-prima-12 git checkout e681eea9b3f27930c50cffd14dd566b39f01c642 git clean -dfx # OS-specific env if [[ "$RUNNER_OS" == "macos-latest" ]]; then export LFORTRAN_RUNNER_OS="macos" elif [[ "$RUNNER_OS" == "ubuntu-latest" ]]; then export LFORTRAN_RUNNER_OS="linux" fi print_subsection "Building PRIMA (compile-only)" FC="$FC --cpp" cmake -S . -B build \ -DCMAKE_INSTALL_PREFIX=$(pwd)/install \ -DCMAKE_Fortran_FLAGS="" \ -DCMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS="" \ -DCMAKE_MACOSX_RPATH=OFF \ -DCMAKE_SKIP_INSTALL_RPATH=ON \ -DCMAKE_SKIP_RPATH=ON cmake --build build --target install print_success "Done with PRIMA" cd .. ' ########################## # Section 7: Modern Minpack ########################## time_section "🧪 Testing Modern Minpack (Fortran-Lang)" ' git clone https://github.com/fortran-lang/minpack modern_minpack_01 cd modern_minpack_01 git checkout c0b5aea9fcd2b83865af921a7a7e881904f8d3c2 $FC ./src/minpack.f90 -c --legacy-array-sections $FC ./examples/example_hybrd.f90 --legacy-array-sections $FC ./examples/example_hybrd1.f90 --legacy-array-sections $FC ./examples/example_lmdif1.f90 --legacy-array-sections $FC ./examples/example_lmder1.f90 --legacy-array-sections ' time_section "🧪 Testing Modern Minpack (Result Check)" ' git clone https://github.com/Pranavchiku/modern_minpack.git modern_minpack_02 cd modern_minpack_02 git checkout -t origin/w5 git checkout fcde66ca86348eb0c4012dbdf0f4d8dba61261d8 $FC ./src/minpack.f90 -c --legacy-array-sections $FC ./examples/example_hybrd.f90 --legacy-array-sections $FC ./examples/example_hybrd1.f90 --legacy-array-sections $FC ./examples/example_lmdif1.f90 --legacy-array-sections $FC ./examples/example_lmder1.f90 --legacy-array-sections ' ########################## # Section 8: dftatom ########################## time_section "🧪 Testing dftatom" ' git clone https://github.com/certik/dftatom.git cd dftatom git checkout 9b678177f67e350b8a32e08cb61f51e6e708e87a make -f Makefile.manual F90=$FC F90FLAGS=-I../../src make -f Makefile.manual quicktest ' ########################## # Section 8.1: featom (build-only) ########################## time_section "🧪 Building featom (build-only)" ' git clone https://github.com/atomic-solvers/featom cd featom git checkout 87872a3266ceeee61a7244e6ecd134dc3bda790f micromamba install -c conda-forge fpm libblas liblapack export LIBRARY_PATH="$CONDA_PREFIX/lib:${LIBRARY_PATH:-}" # Build-only smoke test for now; runtime tests can be added later. FPM_FFLAGS="--cpp --realloc-lhs-arrays --mangle-underscore-external" LFORTRAN_LINKER=gcc fpm build --compiler=lfortran print_success "Done with featom (build-only)" cd .. rm -rf featom ' ########################## # Section 9: fastGPT ########################## time_section "🧪 Testing fastGPT" ' git clone https://github.com/certik/fastGPT.git cd fastGPT git clean -dfx git checkout -t origin/namelist git checkout d3eef520c1be8e2db98a3c2189740af1ae7c3e06 curl -f -L -o model.dat \ https://github.com/certik/fastGPT/releases/download/v1.0.0/model_fastgpt_124M_v1.dat echo "11f6f018794924986b2fdccfbe8294233bb5e8ba28d40ae971dec3adbdc81ad7 model.dat" | shasum -a 256 --check mkdir lf cd lf FC="$FC --realloc-lhs-arrays" CMAKE_PREFIX_PATH=$CONDA_PREFIX cmake -DFASTGPT_BLAS=OpenBLAS -DCMAKE_BUILD_TYPE=Debug .. make VERBOSE=1 ln -s ../model.dat . ./gpt2 ./test_basic_input ./test_more_inputs cd .. rm -rf fastGPT/ ' ########################## # Section 10: stdlib ########################## time_section "🧪 Testing stdlib" ' git clone https://github.com/czgdp1807/stdlib.git cd stdlib export PATH="$(pwd)/../../src/bin:$PATH" git checkout lf-21 git checkout 176c7a28bbc7a8a9b63441f7dfa980aeafbddd0f micromamba install -c conda-forge fypp git clean -fdx FC=$FC cmake . -DTEST_DRIVE_BUILD_TESTING=OFF -DBUILD_EXAMPLE=ON -DCMAKE_Fortran_COMPILER_WORKS=TRUE -DCMAKE_Fortran_FLAGS="--cpp --realloc-lhs-arrays" make -j8 ctest ' ########################## # Section 11: SNAP ########################## time_section "🧪 Testing SNAP" ' git clone https://github.com/certik/SNAP.git cd SNAP git checkout lf11 git checkout 169a9216f2c922e94065a519efbb0a6c8b55149e cd ./src make -j8 FORTRAN=$FC FFLAGS= MPI=no OPENMP=no ./gsnap ../qasnap/sample/inp out ' ########################## # Section 13: LAPACK ########################## time_section "🧪 Testing LAPACK" ' micromamba install -y -n lf cmake=3.31.2 # bump-up CMAKE export PATH="$(pwd)/../src/bin:$PATH" git clone https://github.com/gxyd/lapack.git cd lapack git fetch origin lf_07 git checkout lf_07 git checkout 9d9e48987ca109d46b92d515b59cb591fab9859a cd build ./build_lf.sh micromamba install -y -n lf cmake=3.29.1 # Restore CMAKE ' ########################## # Section 14: Reference-LAPACK Full Test Suite (32-bit and 64-bit integers) ########################## time_section "🧪 Testing Reference-LAPACK v3.12.1 Full Test Suite" ' print_subsection "LAPACK test mode: ${LAPACK_TEST_MODE}" export PATH="$(pwd)/../src/bin:$PATH" git clone --depth 1 --branch v3.12.1 https://github.com/Reference-LAPACK/lapack.git lapack-testing cd lapack-testing # Patch to skip FortranCInterface_VERIFY (requires mixed Fortran/C linking) sed -i "/FortranCInterface_VERIFY/d" LAPACKE/include/CMakeLists.txt # Patch dgd.in to use custom seed that avoids FMA-sensitive ill-conditioned matrix # See: https://github.com/Reference-LAPACK/lapack/issues/1186 sed -i "s/^0 Code to interpret the seed$/2 Code to interpret the seed\n1234 5678 9012 3456/" TESTING/dgd.in # CMake < 3.31 needs CMAKE_Fortran_PREPROCESS_SOURCE for LFortran CMAKE_VERSION=$(cmake --version | head -1 | grep -oE "[0-9]+\.[0-9]+") TOOLCHAIN_OPT="" if [ "$(printf "%s\n3.31" "$CMAKE_VERSION" | sort -V | head -1)" != "3.31" ]; then echo "set(CMAKE_Fortran_PREPROCESS_SOURCE \" -E > \")" > lfortran.cmake TOOLCHAIN_OPT="-DCMAKE_TOOLCHAIN_FILE=lfortran.cmake" fi # Helper function to run a single LAPACK test and check results run_lapack_test() { local TEST_EXE="$1" local INPUT_FILE="$2" local TEST_NAME="$3" print_subsection "Running $TEST_NAME" set +e timeout 300 ./bin/$TEST_EXE < ../TESTING/$INPUT_FILE 2>&1 | tee ${TEST_EXE}_${INPUT_FILE%.in}.out exit_code=$? set -e if [ "$exit_code" -ne 0 ] && [ "$exit_code" -ne 124 ]; then echo "ERROR: $TEST_NAME exited with code $exit_code" exit 1 fi if grep -qE "failed to pass the threshold" ${TEST_EXE}_${INPUT_FILE%.in}.out; then echo "ERROR: threshold failures in $TEST_NAME" grep "failed to pass the threshold" ${TEST_EXE}_${INPUT_FILE%.in}.out | head -20 exit 1 fi if grep -E "[1-9][0-9]* error messages recorded" ${TEST_EXE}_${INPUT_FILE%.in}.out; then echo "ERROR: error messages recorded in $TEST_NAME" exit 1 fi print_success "$TEST_NAME passed" } # Function to run the full LAPACK test suite run_lapack_full_test_suite() { local MODE="$1" # empty or "(ILP64)" # === LINEAR EQUATION TESTS === print_section "Linear Equation Tests ${MODE}" run_lapack_test xlintsts stest.in "Single Real Linear Equations ${MODE}" run_lapack_test xlintstd dtest.in "Double Real Linear Equations ${MODE}" run_lapack_test xlintstc ctest.in "Single Complex Linear Equations ${MODE}" run_lapack_test xlintstz ztest.in "Double Complex Linear Equations ${MODE}" run_lapack_test xlintstrfs stest_rfp.in "Single Real RFP Linear Equations ${MODE}" run_lapack_test xlintstrfd dtest_rfp.in "Double Real RFP Linear Equations ${MODE}" run_lapack_test xlintstrfc ctest_rfp.in "Single Complex RFP Linear Equations ${MODE}" run_lapack_test xlintstrfz ztest_rfp.in "Double Complex RFP Linear Equations ${MODE}" # === MIXED PRECISION LINEAR EQUATION TESTS === print_section "Mixed Precision Linear Equation Tests ${MODE}" run_lapack_test xlintstds dstest.in "Double-Single Mixed Precision ${MODE}" run_lapack_test xlintstzc zctest.in "Double-Single Complex Mixed Precision ${MODE}" # === EIGENVALUE TESTS === print_section "Eigenvalue Tests ${MODE}" # Single Real Eigenvalue Tests for input in nep sep se2 svd sec sed sgg sgd ssb ssg sbal sbak sgbal sgbak sbb glm gqr gsv csd lse sdmd; do if [ -f "../TESTING/${input}.in" ]; then run_lapack_test xeigtsts ${input}.in "Single Real Eigenvalue: ${input} ${MODE}" fi done # Double Real Eigenvalue Tests for input in nep sep se2 svd dec ded dgg dgd dsb dsg dbal dbak dgbal dgbak dbb glm gqr gsv csd lse ddmd; do if [ -f "../TESTING/${input}.in" ]; then run_lapack_test xeigtstd ${input}.in "Double Real Eigenvalue: ${input} ${MODE}" fi done # Single Complex Eigenvalue Tests for input in nep sep se2 svd cec ced cgg cgd csb csg cbal cbak cgbal cgbak cbb glm gqr gsv csd lse cdmd; do if [ -f "../TESTING/${input}.in" ]; then run_lapack_test xeigtstc ${input}.in "Single Complex Eigenvalue: ${input} ${MODE}" fi done # Double Complex Eigenvalue Tests for input in nep sep se2 svd zec zed zgg zgd zsb zsg zbal zbak zgbal zgbak zbb glm gqr gsv csd lse zdmd; do if [ -f "../TESTING/${input}.in" ]; then run_lapack_test xeigtstz ${input}.in "Double Complex Eigenvalue: ${input} ${MODE}" fi done print_success "All LAPACK tests passed ${MODE}" } # Function to run a reduced smoke test suite run_lapack_smoke_test_suite() { local MODE="$1" # empty or "(ILP64)" print_section "LAPACK Smoke Tests ${MODE}" run_lapack_test xlintsts stest.in "Smoke Single Real Linear Equations ${MODE}" run_lapack_test xlintstd dtest.in "Smoke Double Real Linear Equations ${MODE}" run_lapack_test xlintstz ztest.in "Smoke Double Complex Linear Equations ${MODE}" if [ -f "../TESTING/nep.in" ]; then run_lapack_test xeigtstd nep.in "Smoke Double Real Eigenvalue: nep ${MODE}" fi print_success "LAPACK smoke tests passed ${MODE}" } run_lapack_selected_test_suite() { local MODE="$1" if [ "$LAPACK_TEST_MODE" = "smoke" ]; then run_lapack_smoke_test_suite "$MODE" else run_lapack_full_test_suite "$MODE" fi } # ======================================================================= # Build and test with 32-bit integers (standard mode) # ======================================================================= print_section "Building LAPACK with 32-bit integers" cmake -S . -B build -G Ninja \ $TOOLCHAIN_OPT \ -DCMAKE_Fortran_COMPILER=lfortran \ -DCMAKE_Fortran_FLAGS="--fixed-form-infer --implicit-interface --implicit-typing --legacy-array-sections --separate-compilation --use-loop-variable-after-loop" \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_INDEX64=OFF \ -DBUILD_INDEX64_EXT_API=OFF \ -DBUILD_COMPLEX=ON \ -DBUILD_COMPLEX16=ON \ -DBUILD_TESTING=ON cmake --build build -j8 cd build run_lapack_selected_test_suite "" cd .. # ======================================================================= # Build and test with 64-bit integers (ILP64 mode) # ======================================================================= if [ "$LAPACK_TEST_MODE" = "full" ]; then print_section "Building LAPACK with 64-bit integers (ILP64)" rm -rf build cmake -S . -B build -G Ninja \ $TOOLCHAIN_OPT \ -DCMAKE_Fortran_COMPILER=lfortran \ -DCMAKE_Fortran_FLAGS="--fixed-form-infer --implicit-interface --implicit-typing --legacy-array-sections --separate-compilation --use-loop-variable-after-loop -fdefault-integer-8" \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_INDEX64=ON \ -DBUILD_INDEX64_EXT_API=OFF \ -DBUILD_COMPLEX=ON \ -DBUILD_COMPLEX16=ON \ -DBUILD_TESTING=ON cmake --build build -j8 cd build run_lapack_selected_test_suite "(ILP64)" cd .. else print_section "Skipping ILP64 LAPACK build in smoke mode" fi cd .. ' fi ################################## # Final Summary and Cleanup ################################## print_section "✅ All Third Party Code Tests Completed Successfully" # Optional cleanup # cd ../.. # rm -rf "$TMP_DIR" lfortran-0.63.0/ci/grammar_conflicts.sh0000775000175000017500000001006615174404631020247 0ustar alastairalastair#!/usr/bin/env bash # # Check for Essential Conflicts in Bison Grammar # # We parse Fortran using a GLR parser that has non-essential conflicts caused # by the keyword/id ambiguity, but no essential conflicts (any other conflict). # # Non-essential conflict: We define a non-essential conflict as one that is # caused by the keywords (`KW_*`) in the `id` rule conflicting with other # rules. A non-essential conflict disappears when we remove those keywords from # the `id` rule. These conflicts cannot actually cause an ambiguity in the # Fortran grammar due to the way it is carefully constructed/defined: one can # always determine from the context if a given name is a user-defined name or a # keyword in some Fortran construct. However to make this determination one has # to understand the context (the grammar is not context free). # # Essential conflict: We define an essential conflict as such conflict that # does not disappear when when we remove the keywords from the `id` rule. The # full Fortran grammar does not have any such conflicts. We thus enforce in our # Bison implementation that we do not have any essential conflicts either. # # Motivation: the keyword/id ambiguity cannot be avoided in Fortran and must be # either handled by a strong tokenizer that parses the source code using # a recursive descent parser to fully disambiguate a keyword and an id and then # the Bison parser can be LALR(1). Or by having a simple tokenizer that # tokenizes names as `KW_*` tokens if they match any kwyword and an `TK_NAME` # otherwise, and then in the Bison grammar we have a rule that `id` is either # `TK_NAME` or any `KW_*`. This broad rule however causes up to 500 conflicts # (total of shift/reduce and reduce/reduce) in the full grammar (we call these # conflicts non-essential), and the grammar is thus not LALR(1) anymore, and we # have to use the GLR parser. However, these non-essential conflicts cannot # make the GLR parser to return "ambiguous syntax" error, since Fortran code # can always be disambiguated from the full context, so the GLR parser always # recovers. On the other hand, any essential conflict will cause true ambiguity # in the grammar that is there even if keywords are disambiguated, and thus can # make the GLR parser to fail on valid code. The other motivation is that # essential conflicts can easily make the GLR grammar to have thousands of # conflicts, making the GLR parser very slow. By ensuring that all our # conflicts are non-essential, the GLR grammar executes quickly, because all # concurrent parsers are short lived due to the nature of these non-essential # conflicts and the Fortran grammar guarantees that all these parser will # merge. An essential conflict could make a concurrent parser to run long, and # it is not guaranteed by the Fortran grammar that they will all merge. The # third motivation is to keep the door open to use LALR(1) grammar and a strong # tokenizer in the future: this script is ensuring that we can always convert # our GLR grammar to an LALR(1) grammar with no conflicts, that would require a # strong tokenizer to disambiguate the `TK_NAME` and `KW_*` tokens. That way we # are maintaining a full conflict-free LALR(1) Fortran grammar as a foundation, # and then we have options how to implement the id/keyword ambiguity resolution # on top, currently we do it using a GLR grammar. # # How we test: To test for essential conflicts, we remove all non-essential # conflicts as follows: this test patches the parser.yy to remove all `KW_*` # keywords from the `id` rule. Then we remove the `%glr-parser` line (which # makes Bison treat the parser as LALR(1)) and change the `%expect` lines to # expect 0 conflicts. We run Bison and ensure it gives no errors. This ensures # there are no essential conflicts in the GLR grammar. set -ex patch -p1 < ci/parser.yy.patch sed -i '/^%expect-rr/d' src/lfortran/parser/parser.yy sed -i 's/^%expect .*/%expect 0/' src/lfortran/parser/parser.yy sed -i '/^%glr-parser/d' src/lfortran/parser/parser.yy (cd src/lfortran/parser && bison -Wall -d parser.yy) echo "Patched grammar is LALR(1), no essential conflicts in GLR." lfortran-0.63.0/ci/create_source_tarball.sh0000775000175000017500000000022115174404631021071 0ustar alastairalastair#!/usr/bin/env bash set -ex lfortran_version=$1 export dest=lfortran-$lfortran_version bash -x -o errexit ci/create_source_tarball0.sh "$dest" lfortran-0.63.0/ci/nix/0000775000175000017500000000000015174404631015011 5ustar alastairalastairlfortran-0.63.0/ci/nix/flake.nix0000664000175000017500000001074015174404631016615 0ustar alastairalastair{ description = "LFortran devShell"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; outputs = { self, nixpkgs }: let # TODO: add and test more platforms systems = [ "x86_64-linux" ]; forEachSystem = f: builtins.listToAttrs (map (system: { name = system; value = { default = f system false; clangOnly = f system true; }; }) systems); in { devShells = forEachSystem (system: clangOnly: let pkgs = import nixpkgs { inherit system; }; llvmVersion = "20"; pythonVersion = "313"; llvmPkgs = pkgs.buildPackages."llvmPackages_${llvmVersion}"; myStdenv = if clangOnly then llvmPkgs.stdenv else pkgs.gcc15Stdenv; myBinutils = if clangOnly then llvmPkgs.bintools else pkgs.binutils; mkShellNewEnv = pkgs.mkShell.override { stdenv = myStdenv; }; # We need version 3.4 specifically, see: # https://lfortran.zulipchat.com/#narrow/channel/197339-General/topic/Building.20Lfortran/near/479058294 # TODO: get bison building under clang (use myStdenv) (if at all possible) bison_3_4 = pkgs.gcc15Stdenv.mkDerivation rec { pname = "bison"; version = "3.4.2"; src = pkgs.fetchurl { url = "mirror://gnu/bison/${pname}-${version}.tar.xz"; sha256 = "sha256-J9BVNGmXNdxp6GrdW4CNbLNZAK0/1j+oLj62RDNqv6A="; }; nativeBuildInputs = with pkgs; [ m4 flex perl ]; propagatedBuildInputs = with pkgs; [ m4 ]; configureFlags = [ "--disable-dependency-tracking" ]; doCheck = false; doInstallCheck = true; }; # Probably too niche to be in nixpkgs jupyter_kernel_test = pkgs."python${pythonVersion}Packages".buildPythonPackage rec { pname = "jupyter_kernel_test"; version = "0.7.0"; format = "pyproject"; src = pkgs.fetchPypi { inherit pname version; sha256 = "sha256-B4tv5/dw3RZPlUm916NVZjIlo/+bD3V1rVRtJyOexgk="; }; nativeBuildInputs = with pkgs."python${pythonVersion}Packages"; [ hatchling jsonschema jupyter-client ]; }; # nixpkgs version is 1.3.0, i.e. too old for us # this is largely copied from nixpkgs: xeus_zmq_3_0 = llvmPkgs.stdenv.mkDerivation rec { pname = "xeus-zmq"; version = "3.0.0"; src = pkgs.fetchFromGitHub { owner = "jupyter-xeus"; repo = "xeus-zmq"; rev = "${version}"; hash = "sha256-J9an+D1FLw99uJPCuux4YNRFcBMh24N3+GDoS/G/U28="; }; nativeBuildInputs = with pkgs; [ cmake ]; buildInputs = with pkgs; [ cppzmq libuuid openssl xeus xtl zeromq ]; propagatedBuildInputs = with pkgs; [ nlohmann_json ]; }; in mkShellNewEnv ({ buildInputs = with pkgs; [ pkgs."llvm_${llvmVersion}" pkgs."lld_${llvmVersion}" myBinutils (pkgs."python${pythonVersion}".withPackages (python-pkgs: [ python-pkgs.pytest python-pkgs.toml python-pkgs.numpy python-pkgs.jupyter jupyter_kernel_test ])) xonsh cmake ninja ccache kokkos git re2c bison_3_4 pkgs.pkgsStatic.zlib pkgs.pkgsStatic.zstd xz libbfd libunwind rapidjson libxml2 libuuid openssl pandoc xeus xeus_zmq_3_0 nlohmann_json clang # gcc env fails tests without clang available bashInteractive which gfortran valgrind gdb fmt ]; shellHook = '' set -x echo "LFortran devShell ready, software versions:" c++ --version bison --version llvm-config --version re2c --version ${ if clangOnly then "ld.lld --version" else "ld --version" } set +x ''; }) ); }; } lfortran-0.63.0/ci/nix/flake.lock0000664000175000017500000000106415174404631016746 0ustar alastairalastair{ "nodes": { "nixpkgs": { "locked": { "lastModified": 1762756533, "narHash": "sha256-HiRDeUOD1VLklHeOmaKDzf+8Hb7vSWPVFcWwaTrpm+U=", "owner": "NixOS", "repo": "nixpkgs", "rev": "c2448301fb856e351aab33e64c33a3fc8bcf637d", "type": "github" }, "original": { "owner": "NixOS", "ref": "nixos-25.05", "repo": "nixpkgs", "type": "github" } }, "root": { "inputs": { "nixpkgs": "nixpkgs" } } }, "root": "root", "version": 7 } lfortran-0.63.0/ci/environment_linux.yml0000664000175000017500000000061315174404631020521 0ustar alastairalastairname: lf channels: - conda-forge dependencies: - llvmdev=11.1.0 - toml=0.10.2 - pytest=8.1.1 - jupyter=1.0.0 - xeus=5.1.0 - xeus-zmq=3.0.0 - nlohmann_json=3.11.3 - jupyter_kernel_test=0.7.0 - re2c=3.1 - numpy=1.26.4 - bison=3.4 - rapidjson=1.1.0 - ninja=1.11.1 - pandoc=3.1.13 - kokkos=4.4.01 - cmake=3.29.1 - zlib=1.3.1 - zstd-static=1.5.6 - shell=0.2.0 lfortran-0.63.0/ci/test_cpp_version.sh0000664000175000017500000000132515174404631020136 0ustar alastairalastair#!/usr/bin/env shell # This is a cross-platform `shell` script. set -ex # TODO: this file has been ported from a xonsh file, hence # we need to re-check the below FIXME # FIXME: Using the below flag generates many warnings. # os.environ['CXXFLAGS'] = "-Werror" echo "CONDA_PREFIX=$CONDA_PREFIX" ./build0.sh cmake -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$PWD -DCMAKE_BUILD_TYPE=Debug -DWITH_JSON=yes -DWITH_BENCHMARKS=yes . cmake --build . --target install -j16 ctest --output-on-failure ./src/bin/parse echo "Testing libasr - CPP" mkdir build cd build cp -r ../src/libasr . cd libasr cmake -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$PWD -DCMAKE_BUILD_TYPE=Debug . cmake --build . -j16 lfortran-0.63.0/ci/upload_lfortran_wasm.sh0000775000175000017500000000613515174404631021001 0ustar alastairalastair#!/usr/bin/env bash set -e set -x deploy_repo_pull="https://github.com/lfortran/wasm_builds.git" deploy_repo_push="git@github.com:lfortran/wasm_builds.git" git_hash=$(git rev-parse --short "$GITHUB_SHA") git_ref=${GITHUB_REF} # Determine dest_dir based on git ref # - Main branch pushes go to "dev" (debug builds) # - Tags starting with 'v' go to "release" (release builds) if [[ ${git_ref} == "refs/heads/main" ]]; then dest_dir="dev" echo "Main branch detected: using dest_dir=${dest_dir}" elif [[ ${git_ref:0:11} == "refs/tags/v" ]]; then dest_dir="release" echo "Release tag detected: using dest_dir=${dest_dir}" else # We are either on a non-main branch or tagged with a tag that does # not start with v*. We run the script for testing but do not upload. dest_dir="release" echo "Not a main branch, not tagged with v*, using dest_dir=${dest_dir} for testing..." fi lfortran_version=$(> ~/.ssh/known_hosts eval "$(ssh-agent -s)" D=`pwd` mkdir $HOME/repos cd $HOME/repos git clone ${deploy_repo_pull} wasm_builds mkdir -p wasm_builds/docs/${dest_dir}/${git_hash} cd wasm_builds/docs cp $D/src/bin/lfortran.js ${dest_dir}/${git_hash}/lfortran.js cp $D/src/bin/lfortran.wasm ${dest_dir}/${git_hash}/lfortran.wasm cp $D/src/bin/lfortran.data ${dest_dir}/${git_hash}/lfortran.data echo "$git_hash" > ${dest_dir}/latest_commit # overwrite the file instead of appending to it python $D/ci/wasm_builds_update_json.py ${dest_dir} ${lfortran_version} ${git_hash} # Move back to wasm_builds/ directory to perform git operations # This ensures docs/ remains as a subdirectory in the committed structure cd .. # Wipe git history to keep repository size small # This ensures only one commit exists, making old builds unreachable for GitHub GC echo "Wiping git history and creating fresh orphaned commit..." rm -rf .git git init -b main git config user.name "Deploy" git config user.email "noreply@deploylfortran.com" COMMIT_MESSAGE="Deploy ${dest_dir} build ${git_hash} on $(date "+%Y-%m-%d %H:%M:%S")" git add . git commit -m "${COMMIT_MESSAGE}" git show HEAD -p --stat dest_commit=$(git show HEAD -s --format=%H) if [[ ${git_ref} == "refs/heads/main" ]]; then echo "The pipeline was triggered from the main branch" else if [[ ${git_ref:0:11} == "refs/tags/v" ]]; then echo "The pipeline was triggered from a tag 'v*'" else # We are either on a non-main branch, or tagged with a tag that does # not start with v*. We skip the upload. echo "Not a main branch, not tagged with v*, skipping..." exit 0 fi fi set +x if [[ "${SSH_PRIVATE_KEY_WASM_BUILDS}" == "" ]]; then echo "Note: SSH_PRIVATE_KEY_WASM_BUILDS is empty, skipping..." exit 0 fi ssh-add <(echo "$SSH_PRIVATE_KEY_WASM_BUILDS" | base64 -d) set -x # Force push since we're creating a fresh orphaned commit each time # This keeps the repository at exactly one reachable commit git push --force ${deploy_repo_push} main:main echo "New orphaned commit force-pushed at:" echo "https://github.com/lfortran/wasm_builds/commit/${dest_commit}" lfortran-0.63.0/ci/build.sh0000775000175000017500000000654715174404631015665 0ustar alastairalastair#!/usr/bin/env shell set -ex echo "Running SHELL" echo "CONDA_PREFIX=$CONDA_PREFIX" llvm-config --components # Generate the `version` file bash ci/version.sh # Generate a Fortran AST from AST.asdl (C++) python src/libasr/asdl_cpp.py grammar/AST.asdl src/lfortran/ast.h # Generate a Fortran ASR from ASR.asdl (C++) python src/libasr/asdl_cpp.py src/libasr/ASR.asdl src/libasr/asr.h # Generate a wasm_visitor.h from src/libasr/wasm_instructions.txt (C++) python src/libasr/wasm_instructions_visitor.py # Generate the intrinsic_function_registry_util.h (C++) python src/libasr/intrinsic_func_registry_util_gen.py # Generate the tokenizer and parser echo $(pwd) cd src/lfortran/parser && re2c -W -b tokenizer.re -o tokenizer.cpp && cd ../../.. cd src/lfortran/parser && re2c -W -b preprocessor.re -o preprocessor.cpp && cd ../../.. cd src/lfortran/parser && bison -Wall -d parser.yy && cd ../../.. # Generate the LSP sources python src/server/generator/generate_lsp_code.py --schema src/server/generator/metaModel.json --target-language c++ --output-dir src/server pandoc --standalone --to man doc/man/lfortran.md -o doc/man/lfortran.1 # using debugging option i.e. `-x` causes a bug with `cat` command here, # and hence we turned off command tracing set +x lfortran_version=$(cat version) # we re-enable command tracing set -x bash ci/create_source_tarball.sh "$lfortran_version" tar xzf dist/lfortran-$lfortran_version.tar.gz cd lfortran-$lfortran_version mkdir test-bld cd test-bld # Note: we have to build in Release mode on Windows, because `llvmdev` is # compiled in Release mode and we get link failures if we mix and match build # modes: if [[ $WIN == "1" ]]; then # Windows BUILD_TYPE="Release" else # Linux or macOS BUILD_TYPE="Debug" fi cmake -G$LFORTRAN_CMAKE_GENERATOR -DCMAKE_VERBOSE_MAKEFILE=ON -DWITH_LSP=yes -DWITH_LLVM=yes -DWITH_XEUS=yes -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWITH_RUNTIME_STACKTRACE=$ENABLE_RUNTIME_STACKTRACE -DWITH_INTERNAL_ALLOC_CHECK=yes .. cmake --build . --target install ./src/lfortran/tests/test_lfortran ./src/bin/lfortran < ../src/bin/example_input.txt ctest --output-on-failure cpack -V cd ../.. jupyter kernelspec list --json #python ci/test_fortran_kernel.py -v # cd share/lfortran/nb jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=120 --output Demo1_out.ipynb Demo1.ipynb jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=120 --output Demo2_out.ipynb Demo2.ipynb cat Demo1_out.ipynb jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=120 --output "Hello World_out.ipynb" "Hello World.ipynb" jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=120 --output "Operators Control Flow_out.ipynb" "Operators Control Flow.ipynb" jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=120 --output Variables_out.ipynb Variables.ipynb cd ../../.. if [[ $WIN == "1" ]]; then # Windows cp lfortran-$lfortran_version/test-bld/src/bin/lfortran.exe src/bin cp lfortran-$lfortran_version/test-bld/src/runtime/legacy/lfortran_runtime* src/runtime/ else # Linux or macOS cp lfortran-$lfortran_version/test-bld/src/bin/lfortran src/bin cp lfortran-$lfortran_version/test-bld/src/runtime/liblfortran_runtime* src/runtime/ fi cp lfortran-$lfortran_version/test-bld/src/runtime/*.mod src/runtime/ lfortran-0.63.0/ci/azure_status.sh0000775000175000017500000000151215174404631017302 0ustar alastairalastair#!/usr/bin/env bash set -ex if [[ "$1" == "running" ]]; then status="running" else if [[ "${AGENT_JOBSTATUS}" == "Succeeded" ]]; then status="success" else status="failed" fi fi project_id=4494718 # lfortran/lfortran curl --request POST --header "PRIVATE-TOKEN: ${TOKEN_STATUS}" "https://gitlab.com/api/v4/projects/${project_id}/statuses/${COMMIT_ID}?state=${status}&name=AzurePipelines&target_url=https%3A%2F%2Fdev.azure.com%2Flfortran%2Flfortran%2F_build%2Fresults%3FbuildId%3D${BUILD_ID}" project_id=8213176 # certik/lfortran curl --request POST --header "PRIVATE-TOKEN: ${TOKEN_STATUS}" "https://gitlab.com/api/v4/projects/${project_id}/statuses/${COMMIT_ID}?state=${status}&name=AzurePipelines&target_url=https%3A%2F%2Fdev.azure.com%2Flfortran%2Flfortran%2F_build%2Fresults%3FbuildId%3D${BUILD_ID}" lfortran-0.63.0/CMakeLists.txt0000664000175000017500000004130015174404631016356 0ustar alastairalastaircmake_minimum_required(VERSION 3.10 FATAL_ERROR) set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_SOURCE_DIR}/cmake/UserOverride.cmake) # We don't execute this if we have a tarball if (LFORTRAN_BUILD_ALL) find_program(RE2C re2c REQUIRED) find_program(BISON bison REQUIRED) find_program(BASH_BIN bash REQUIRED) execute_process(COMMAND "env" "RE2C=${RE2C}" "BISON=${BISON}" "${BASH_BIN}" "-e" "build0.sh" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} RESULT_VARIABLE _BUILD0_EXIT) if (NOT _BUILD0_EXIT EQUAL 0) message(FATAL_ERROR "Running build0.sh failed (see error above)") endif () endif() file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/version" LFORTRAN_VERSION) string(REGEX MATCH "^[^-]*" LFORTRAN_NO_TAG_VERSION ${LFORTRAN_VERSION}) project(lfortran VERSION ${LFORTRAN_NO_TAG_VERSION} DESCRIPTION "A modern open-source interactive Fortran compiler" HOMEPAGE_URL "https://lfortran.org/" LANGUAGES C CXX) set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type (Debug, Release)" FORCE) endif () # xeus does use `dynamic_cast` and thus needs rtti (otherwise it segfaults) if (NOT WITH_XEUS) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(LFORTRAN_CXX_NO_RTTI_FLAG "-fno-rtti") elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang) set(LFORTRAN_CXX_NO_RTTI_FLAG "-fno-rtti") elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(LFORTRAN_CXX_NO_RTTI_FLAG "/GR-") endif () endif(NOT WITH_XEUS) if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /bigobj") endif () # For CMAKE_INSTALL_BINDIR: include(GNUInstallDirs) # create CMAKE_INSTALL_LIBDIR_RELATIVE, LIBDIR relative to BINDIR file(RELATIVE_PATH CMAKE_INSTALL_LIBDIR_RELATIVE ${CMAKE_INSTALL_FULL_BINDIR} ${CMAKE_INSTALL_FULL_LIBDIR}) # create CMAKE_INSTALL_INCLUDEDIR_RELATIVE, INCLUDEDIR relative to BINDIR file(RELATIVE_PATH CMAKE_INSTALL_INCLUDEDIR_RELATIVE ${CMAKE_INSTALL_FULL_BINDIR} ${CMAKE_INSTALL_FULL_INCLUDEDIR}) # Build a CPack driven installer package # # To build a binary package: # # cpack # if(NOT WIN32) include(InstallRequiredSystemLibraries) endif() set(CPACK_GENERATOR "TBZ2") set(CPACK_STRIP_FILES YES) set(CPACK_PACKAGE_FILE_NAME lfortran-${LFORTRAN_VERSION}-${CMAKE_SYSTEM_NAME}) include(CPack) # So that CPACK_PACKAGE_FILE_NAME prints the correct value below set(CPACK_PACKAGE_FILE_NAME lfortran-${LFORTRAN_VERSION}-${CMAKE_SYSTEM_NAME}) if (NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard" FORCE) endif () set(CMAKE_POSITION_INDEPENDENT_CODE ON) if (CMAKE_BUILD_TYPE STREQUAL "Debug") # In Debug mode we enable assertions set(WITH_LFORTRAN_ASSERT_DEFAULT yes) else() set(WITH_LFORTRAN_ASSERT_DEFAULT no) endif() # LFORTRAN_ASSERT set(WITH_LFORTRAN_ASSERT ${WITH_LFORTRAN_ASSERT_DEFAULT} CACHE BOOL "Enable LFORTRAN_ASSERT macro") # LFORTRAN_STATIC_BIN set(LFORTRAN_STATIC_BIN no CACHE BOOL "Build LFortran as a static binary") # WITH_LFORTRAN_BINARY_MODFILES set(WITH_LFORTRAN_BINARY_MODFILES YES CACHE BOOL "Use binary modfiles") set(WITH_RUNTIME_LIBRARY YES CACHE BOOL "Compile and install the runtime library") set(WITH_WHEREAMI yes CACHE BOOL "Include whereami.cpp") set(WITH_ZLIB yes CACHE BOOL "Compile with ZLIB Library") set(WITH_LCOMPILERS_FAST_ALLOC yes CACHE BOOL "Compile with fast allocator") set(WITH_CCACHE no CACHE BOOL "Build with ccache support") # Build to wasm set(LFORTRAN_BUILD_TO_WASM no CACHE BOOL "Compile LFortran To WASM") if (LFORTRAN_BUILD_TO_WASM) set(HAVE_BUILD_TO_WASM yes) SET(WITH_WHEREAMI no) SET(WITH_ZLIB no) SET(WITH_RUNTIME_LIBRARY no) SET(WITH_LCOMPILERS_FAST_ALLOC no) add_definitions("-DHAVE_BUILD_TO_WASM=1") endif() if (WITH_WHEREAMI) add_definitions("-DHAVE_WHEREAMI=1") endif() if (WITH_ZLIB) add_definitions("-DHAVE_ZLIB=1") # Find ZLIB with our custom finder before including LLVM since the finder for LLVM # might search for ZLIB again and find the shared libraries instead of the static ones set(USE_DYNAMIC_ZLIB no CACHE BOOL "Use dynamic ZLIB library (default: static)") find_package(LFortranZLIB REQUIRED) endif() if (WITH_LCOMPILERS_FAST_ALLOC) add_definitions("-DLCOMPILERS_FAST_ALLOC=1") endif() if (WITH_CCACHE) find_program(CCACHE_PROGRAM ccache REQUIRED) set(CMAKE_C_COMPILER_LAUNCHER ccache) set(CMAKE_CXX_COMPILER_LAUNCHER ccache) endif() # LLVM set(WITH_LLVM no CACHE BOOL "Build with LLVM support") set(WITH_TARGET_AARCH64 no CACHE BOOL "Enable target AARCH64") set(WITH_TARGET_X86 no CACHE BOOL "Enable target X86") set(WITH_TARGET_WASM no CACHE BOOL "Enable target WebAssembly") set(WITH_MLIR no CACHE BOOL "Build with MLIR support") # Stacktrace set(WITH_UNWIND no CACHE BOOL "Build with unwind support") set(WITH_BFD no CACHE BOOL "Build with BFD support") set(WITH_DWARFDUMP no CACHE BOOL "Build with dwarfdump support") set(WITH_LINKH no CACHE BOOL "Build with link.h support") set(WITH_MACHO no CACHE BOOL "Build with mach-o support") set(WITH_INTERNAL_ALLOC_CHECK no CACHE BOOL "Enable internal allocation leak detector") if (WITH_INTERNAL_ALLOC_CHECK) set(HAVE_INTERNAL_ALLOC_CHECK yes) endif() set(WITH_STACKTRACE no CACHE BOOL "Build with stacktrace support (requires binutils-dev)") set(WITH_LLVM_STACKTRACE no CACHE BOOL "Build with LLVM stacktrace support") if (WITH_STACKTRACE) set(WITH_UNWIND yes) if (APPLE) set(WITH_MACHO yes) if (NOT WITH_BFD) set(WITH_DWARFDUMP yes) endif() else() set(WITH_LINKH yes) if (NOT WITH_BFD) set(WITH_LLVM_STACKTRACE yes) endif() endif() set(HAVE_LFORTRAN_STACKTRACE yes) endif() if (WITH_RUNTIME_STACKTRACE) set(WITH_UNWIND yes) if (APPLE) set(WITH_MACHO yes) else() set(WITH_LINKH yes) endif() set(HAVE_RUNTIME_STACKTRACE yes) endif() if (WITH_BFD) find_package(BFD REQUIRED) set(HAVE_LFORTRAN_BFD yes) endif() if (WITH_LLVM_STACKTRACE) set(HAVE_LFORTRAN_LLVM_STACKTRACE yes) endif() if (WITH_DWARFDUMP) set(HAVE_LFORTRAN_DWARFDUMP yes) endif() if (WITH_LINKH) find_package(LINKH REQUIRED) set(HAVE_LFORTRAN_LINK yes) endif() if (WITH_MACHO) find_package(MACHO REQUIRED) set(HAVE_LFORTRAN_MACHO yes) endif() if (WITH_UNWIND) set(HAVE_LFORTRAN_UNWIND yes) endif() if (WITH_LLVM) set(WITH_ZSTD yes CACHE BOOL "Detect (and require) libzstd for LLVM") set(USE_DYNAMIC_ZSTD no CACHE BOOL "Use dynamic ZSTD library (default: static)") if(WITH_ZSTD) find_package(LFortranZSTD REQUIRED) endif() set(LFORTRAN_LLVM_COMPONENTS core support mcjit orcjit native asmparser asmprinter) if (WITH_LLVM_STACKTRACE) list(APPEND LFORTRAN_LLVM_COMPONENTS symbolize object) endif() find_package(LLVM REQUIRED) message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") # LLVM 8 needs the ipo library for PassManagerBuilder if (LLVM_VERSION_MAJOR LESS 9) list(APPEND LFORTRAN_LLVM_COMPONENTS ipo) endif() # Always enable the native target if ("${LLVM_NATIVE_ARCH}" STREQUAL "AArch64") set(WITH_TARGET_AARCH64 yes) endif() if ("${LLVM_NATIVE_ARCH}" STREQUAL "X86") set(WITH_TARGET_X86 yes) endif() if (WITH_TARGET_AARCH64) if (NOT ("${LLVM_TARGETS_TO_BUILD}" MATCHES "AArch64")) message(FATAL_ERROR "The selected LLVM library doesn't have support for AArch64 targets") endif() list(APPEND LFORTRAN_LLVM_COMPONENTS aarch64info aarch64utils aarch64desc aarch64asmparser aarch64codegen aarch64disassembler) add_definitions("-DHAVE_TARGET_AARCH64=1") endif() if (WITH_TARGET_X86) if (NOT ("${LLVM_TARGETS_TO_BUILD}" MATCHES "X86")) message(FATAL_ERROR "The selected LLVM library doesn't have support for X86 targets") endif() list(APPEND LFORTRAN_LLVM_COMPONENTS x86info x86desc x86codegen x86asmparser x86disassembler) add_definitions("-DHAVE_TARGET_X86=1") endif() if (WITH_TARGET_WASM) if (NOT ("${LLVM_TARGETS_TO_BUILD}" MATCHES "WebAssembly")) message(FATAL_ERROR "The selected LLVM library doesn't have support for WebAssembly targets") endif() list(APPEND LFORTRAN_LLVM_COMPONENTS webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo) add_definitions("-DHAVE_TARGET_WASM=1") endif() if (TARGET LLVMCore) # If `LLVMCore` target is present, then LLVM is distributed as separate # libraries and llvm_map_components_to_libnames() should work: llvm_map_components_to_libnames(llvm_libs ${LFORTRAN_LLVM_COMPONENTS}) else() # Workaround for https://github.com/llvm/llvm-project/issues/34593 # If LLVM is distributed as a single library (the LLVMCore target is # missing), we set `llvm_libs` to "LLVM" which links against the single # `libLLVM.so` shared library. set(llvm_libs "LLVM") endif() unset(LFORTRAN_LLVM_COMPONENTS) if (WITH_MLIR) add_library(p::mlir INTERFACE IMPORTED) find_package(MLIR REQUIRED CONFIG) set(mlir_libs MLIRIR MLIRLLVMToLLVMIRTranslation MLIRBuiltinToLLVMIRTranslation MLIRLLVMDialect MLIROpenMPToLLVMIRTranslation MLIROpenMPDialect ) set_property(TARGET p::mlir PROPERTY INTERFACE_LINK_LIBRARIES ${mlir_libs}) set(HAVE_LFORTRAN_MLIR yes) endif() add_library(p::llvm INTERFACE IMPORTED) set_property(TARGET p::llvm PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${LLVM_INCLUDE_DIRS}) #set_property(TARGET p::llvm PROPERTY INTERFACE_COMPILE_DEFINITIONS # ${LLVM_DEFINITIONS}) #set_property(TARGET p::llvm PROPERTY INTERFACE_COMPILE_OPTIONS # ${LLVM_DEFINITIONS}) set_property(TARGET p::llvm PROPERTY INTERFACE_COMPILE_OPTIONS $<$:${LFORTRAN_CXX_NO_RTTI_FLAG}>) set_property(TARGET p::llvm PROPERTY INTERFACE_LINK_LIBRARIES ${llvm_libs}) if (MSVC) # LLVM on Windows appends zlib shared library and we must provide # a path to find it: get_filename_component(mypath ${ZLIB_LIBRARY} DIRECTORY) target_link_directories(p::llvm BEFORE INTERFACE ${mypath}) message(STATUS "ZLIB LIBRARY PATH: ${mypath}") endif() set(HAVE_LFORTRAN_LLVM yes) if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND LLVM_VERSION_MAJOR GREATER_EQUAL 12) set(WITH_LIBUNWIND_FORCE yes) endif() endif() # XEUS (Fortran kernel) set(WITH_XEUS no CACHE BOOL "Build with XEUS support") if (WITH_XEUS) find_package(xeus 5.1.0 REQUIRED) find_package(xeus-zmq 3.0.0 REQUIRED) set(HAVE_LFORTRAN_XEUS yes) # Generate kernel.json with correct paths configure_file ( "${CMAKE_CURRENT_SOURCE_DIR}/share/jupyter/kernels/fortran/kernel.json.in" "${CMAKE_CURRENT_BINARY_DIR}/share/jupyter/kernels/fortran/kernel.json" ) # Generate logo-svg.svg with correct paths configure_file ( "${CMAKE_CURRENT_SOURCE_DIR}/share/jupyter/kernels/fortran/lfortran-logo.svg" "${CMAKE_CURRENT_BINARY_DIR}/share/jupyter/kernels/fortran/logo-svg.svg" ) # Configuration and data directories for Jupyter and LFortran set(XJUPYTER_DATA_DIR "share/jupyter" CACHE STRING "Jupyter data directory") # Install Jupyter kernelspecs set(XEUS_CALCSPEC_DIR ${CMAKE_CURRENT_BINARY_DIR}/share/jupyter/kernels) install(DIRECTORY ${XEUS_CALCSPEC_DIR} DESTINATION ${XJUPYTER_DATA_DIR} PATTERN "*.in" EXCLUDE) endif() # JSON OR LSP (`conda install rapidjson`) set(WITH_JSON no CACHE BOOL "Build with JSON support") set(WITH_LSP no CACHE BOOL "Build with LSP support") if (WITH_JSON) find_package(RapidJSON REQUIRED) set(HAVE_LFORTRAN_RAPIDJSON yes) endif() set(HAVE_LFORTRAN_DEMANGLE yes CACHE BOOL "Build with C++ name demangling support (cxxabi.h)") if (MSVC) # MSVC doesn't have cxxabi.h set(HAVE_LFORTRAN_DEMANGLE no) endif() # fmt (`conda install fmt`) set(WITH_FMT no CACHE BOOL "Build with `fmt` support") if (WITH_FMT) find_package(fmt) endif() set(WITH_BENCHMARKS no CACHE BOOL "Build benchmarks") set(WITH_LIBUNWIND no CACHE BOOL "Build with libunwind (required libunwind-dev)") if (WITH_LIBUNWIND_FORCE) set(WITH_LIBUNWIND yes) endif() if (WITH_LIBUNWIND) find_package(LIBUNWIND REQUIRED) endif() set(WITH_KOKKOS no CACHE BOOL "Detect Kokkos location for cpp backend") if (WITH_KOKKOS) find_package(Kokkos) if(TARGET Kokkos::kokkoscore) get_target_property(KOKKOS_INCLUDEDIR Kokkos::kokkoscore INTERFACE_INCLUDE_DIRECTORIES) get_target_property(KOKKOS_LIBRARY Kokkos::kokkoscore LOCATION) get_filename_component(KOKKOS_LIBDIR "${KOKKOS_LIBRARY}" DIRECTORY) endif() endif() enable_testing() message("\n") message("Configuration results") message("---------------------") message("LFORTRAN_VERSION: ${LFORTRAN_VERSION}") message("CPACK_PACKAGE_FILE_NAME: ${CPACK_PACKAGE_FILE_NAME}") message("C compiler : ${CMAKE_C_COMPILER}") message("C++ compiler : ${CMAKE_CXX_COMPILER}") message("Build type: ${CMAKE_BUILD_TYPE}") string(TOUPPER "${CMAKE_BUILD_TYPE}" BTYPE) message("C compiler flags : ${CMAKE_C_FLAGS_${BTYPE}}") message("C++ compiler flags : ${CMAKE_CXX_FLAGS_${BTYPE}}") message("Installation prefix: ${CMAKE_INSTALL_PREFIX}") message("WITH_LFORTRAN_ASSERT: ${WITH_LFORTRAN_ASSERT}") message("LFORTRAN_STATIC_BIN: ${LFORTRAN_STATIC_BIN}") message("LFORTRAN_BUILD_TO_WASM: ${LFORTRAN_BUILD_TO_WASM}") message("WITH_STACKTRACE: ${WITH_STACKTRACE}") message("WITH_RUNTIME_STACKTRACE: ${WITH_RUNTIME_STACKTRACE}") message("WITH_INTERNAL_ALLOC_CHECK: ${WITH_INTERNAL_ALLOC_CHECK}") message("WITH_UNWIND: ${WITH_UNWIND}") message("WITH_LIBUNWIND: ${WITH_LIBUNWIND}") message("WITH_BFD: ${WITH_BFD}") message("WITH_LLVM_STACKTRACE: ${WITH_LLVM_STACKTRACE}") message("WITH_DWARFDUMP: ${WITH_DWARFDUMP}") message("WITH_LINKH: ${WITH_LINKH}") message("WITH_MACHO: ${WITH_MACHO}") message("HAVE_LFORTRAN_DEMANGLE: ${HAVE_LFORTRAN_DEMANGLE}") message("WITH_LLVM: ${WITH_LLVM}") message("WITH_ZSTD: ${WITH_ZSTD}") message("USE_DYNAMIC_ZSTD: ${USE_DYNAMIC_ZSTD}") message("WITH_MLIR: ${WITH_MLIR}") message("WITH_XEUS: ${WITH_XEUS}") message("WITH_JSON: ${WITH_JSON}") message("WITH_LSP: ${WITH_LSP}") message("WITH_FMT: ${WITH_FMT}") message("WITH_BENCHMARKS: ${WITH_BENCHMARKS}") message("WITH_LFORTRAN_BINARY_MODFILES: ${WITH_LFORTRAN_BINARY_MODFILES}") message("WITH_RUNTIME_LIBRARY: ${WITH_RUNTIME_LIBRARY}") message("WITH_WHEREAMI: ${WITH_WHEREAMI}") message("WITH_ZLIB: ${WITH_ZLIB}") message("USE_DYNAMIC_ZLIB: ${USE_DYNAMIC_ZLIB}") message("WITH_TARGET_AARCH64: ${WITH_TARGET_AARCH64}") message("WITH_TARGET_X86: ${WITH_TARGET_X86}") message("WITH_TARGET_WASM: ${WITH_TARGET_WASM}") message("WITH_KOKKOS: ${WITH_KOKKOS}") message("WITH_CCACHE: ${WITH_CCACHE}") message("CXXFLAGS: ${CMAKE_CXX_FLAGS}") message("CFLAGS: ${CMAKE_C_FLAGS}") add_subdirectory(src) add_subdirectory(doc/man) if(LFORTRAN_BUILD_TO_WASM) set(WITH_RUNTIME_LIBRARY No) endif() if (WITH_RUNTIME_LIBRARY) if(WIN32) set(LFORTRAN_PATH "${CMAKE_BINARY_DIR}/src/bin/lfortran.exe") else() set(LFORTRAN_PATH "${CMAKE_BINARY_DIR}/src/bin/lfortran") endif() add_custom_target(configure_runtime ALL COMMAND "${CMAKE_COMMAND}" "-G" "${CMAKE_GENERATOR}" "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" "-DCMAKE_PREFIX_PATH=\"${CMAKE_PREFIX_PATH}\"" "-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}" # "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DCMAKE_Fortran_COMPILER=${LFORTRAN_PATH}" "-DLFORTRAN_NESTED_BUILD=yes" "${CMAKE_SOURCE_DIR}/src/runtime/" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/src/runtime") add_dependencies(configure_runtime lfortran) add_custom_target(build_runtime ALL COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}/src/runtime" -j1 WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/src/runtime") add_dependencies(build_runtime configure_runtime) # This is called after lfortran has been installed # For more info https://stackoverflow.com/a/29979349/16568788 add_subdirectory(cmake/postinstall) install(CODE "set(CMAKE_COMMAND \"${CMAKE_COMMAND}\")") # install(CODE "set(CMAKE_VERBOSE_MAKEFILE \"${CMAKE_VERBOSE_MAKEFILE}\")") install(CODE "set(CMAKE_SOURCE_DIR \"${CMAKE_SOURCE_DIR}\")") install(CODE "set(CMAKE_BINARY_DIR \"${CMAKE_BINARY_DIR}\")") endif() lfortran-0.63.0/.github/0000775000175000017500000000000015174404631015160 5ustar alastairalastairlfortran-0.63.0/.github/workflows/0000775000175000017500000000000015174404631017215 5ustar alastairalastairlfortran-0.63.0/.github/workflows/Clean-Cache-CI.yml0000664000175000017500000000161115174404631022253 0ustar alastairalastairname: Cleanup caches by a branch on: pull_request: types: - closed jobs: cleanup: runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@v6 - name: Cleanup run: | gh extension install actions/gh-actions-cache REPO=${{ github.repository }} BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge" echo "Fetching list of cache key" cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 ) ## Setting this to not fail the workflow while deleting cache keys. set +e echo "Deleting caches..." for cacheKey in $cacheKeysForPR do gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm done echo "Done" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} lfortran-0.63.0/.github/workflows/Quick-Checks-CI.yml0000664000175000017500000003621515174404631022512 0ustar alastairalastairname: Quick checks on: push: branches: - main tags: - 'v*' pull_request: branches: - main # For a PR #7488 against main branch, the `group` will become: CI-{{ 7488 || github.sha }} # which eventually evaluates to: CI-7488 and 'sha' isn't used. # NOTE: `||` acts as a logical OR and a default operator both, # see: https://docs.github.com/en/actions/learn-github-actions/expressions#operators. # When it isn't a PR against main but instead a commit pushed (or merged) to main, then `group` will # evaluate to `${{ github.sha }}` but "cancel-in-progress" evaluates to false, so the CI on main # will run in a new group `${{ github.sha }}`, but no previous CI will be cancelled on main concurrency: group: ${{ github.workflow }}-${{ github.event.number || github.sha }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} env: MACOSX_DEPLOYMENT_TARGET: 15.0 jobs: Build: name: LFortran CI (OS=${{ matrix.os }}, LLVM=${{ matrix.llvm-version }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: include: - os: macos-latest llvm-version: "11" - os: macos-latest llvm-version: "21" - os: ubuntu-latest llvm-version: "11" - os: ubuntu-latest llvm-version: "21" - os: windows-2025 llvm-version: "11" steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: mamba-org/setup-micromamba@v2.0.2 with: micromamba-version: '2.0.4-0' environment-file: ci/environment.yml create-args: >- llvmdev=${{ matrix.llvm-version }} - name: Install Windows Packages if: contains(matrix.os, 'windows') shell: bash -e -l {0} run: | micromamba install m2-bison=3.0.4 m2-filesystem cmake=3.21.1 zstd-static=1.5.5 zlib=1.2.13 - name: Install Linux / macOS Packages if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') shell: bash -e -l {0} run: | micromamba install bison=3.4 openblas=0.3.21 llvm-openmp=14.0.4 zlib=1.3.1 llvmdev=${{ matrix.llvm-version }} if [[ "${{ matrix.os }}" == *ubuntu* ]]; then micromamba install openmpi=5.0.6=hb85ec53_102 elif [[ "${{ matrix.os }}" == *macos* ]]; then micromamba install openmpi=5.0.6=h31ce4ef_102 fi if [[ "${{ matrix.llvm-version }}" == "11" ]]; then micromamba install zstd-static=1.5.6 nodejs=18.20.4 kokkos=4.4.01 elif [[ "${{ matrix.llvm-version }}" == "21" ]]; then micromamba install zstd-static=1.5.7 fi if [[ "${{ matrix.os }}" == *ubuntu* && "${{ matrix.llvm-version }}" != "11" ]]; then micromamba install libunwind=1.7.2 fi if [[ "${{ matrix.os }}" == *ubuntu* && "${{ matrix.llvm-version }}" == "11" ]]; then micromamba install pandoc=3.1.13 fi - uses: hendrikmuhs/ccache-action@main with: key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.llvm-version }} - name: Setup Platform shell: bash -e -l {0} run: | echo "LFORTRAN_CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV echo "CMAKE_C_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV echo "CMAKE_CXX_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV echo "ENABLE_RUNTIME_STACKTRACE=yes" >> $GITHUB_ENV # we need to run this only once for debugging purpose - name: Print github concurrent group name shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '21') run: | echo "Concurrency Group: ${{ github.workflow }}-${{ github.event.number || github.sha }}" echo "Cancel-in-progress: ${{ github.event_name == 'pull_request' }}" - name: Build (Linux / macOS) shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') run: | export CXXFLAGS="-Werror -D_GLIBCXX_ASSERTIONS -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG" export CFLAGS="-Werror -D_GLIBCXX_ASSERTIONS -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG" export WIN=0 shell ci/build.sh - name: Build (Windows) if: contains(matrix.os, 'windows') shell: cmd run: | set MAMBA_INSTALL_LOCN=C:\\Users\runneradmin\micromamba call %MAMBA_INSTALL_LOCN%\Scripts\activate.bat call micromamba activate lf set LFORTRAN_CMAKE_GENERATOR=Ninja set WIN=1 set MACOS=0 set ENABLE_RUNTIME_STACKTRACE=no call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" set CC=cl.exe set CXX=cl.exe set "PATH=%PATH:C:\mingw64\bin;=%" shell ci\build.sh - name: Test (Linux / macOS) shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') run: | case "$OSTYPE" in darwin*) export MACOS=1;; *) export MACOS=0;; esac export LFORTRAN_LLVM_VERSION=${{ matrix.llvm-version }} export LFORTRAN_TEST_ENV_VAR='STATUS OK!' shell ci/test.sh - name: Test LFortran's Command Line Interface (Linux / macOS) shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') run: | ./test_lfortran_cmdline - name: Test with specific Fortran standard shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') run: | cd ./integration_tests case "$OSTYPE" in darwin*) J_FLAG="-j3";; *) J_FLAG="";; esac ./run_tests.py -b llvm --std=f23 $J_FLAG if [[ "$OSTYPE" != darwin* ]]; then ./run_tests.py -b llvm -f --std=f23 -nf16 $J_FLAG fi - name: Test Metal GPU backend (macOS) shell: bash -e -l {0} if: contains(matrix.os, 'macos') run: | cd ./integration_tests ./run_tests.py -b metal -j3 - name: Test (Windows) if: contains(matrix.os, 'windows') shell: cmd run: | set MAMBA_INSTALL_LOCN=C:\\Users\runneradmin\micromamba call %MAMBA_INSTALL_LOCN%\Scripts\activate.bat call micromamba activate lf set LFORTRAN_CMAKE_GENERATOR=Ninja set WIN=1 set MACOS=0 set ENABLE_RUNTIME_STACKTRACE=no call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" set CC=cl.exe set CXX=cl.exe set "PATH=%PATH:C:\mingw64\bin;=%" shell ci\test.sh - name: Install Timeout (macOS) shell: bash -e -l {0} if: contains(matrix.os, 'macos') run: brew install coreutils # ~/.bash_logout wanted to run `/usr/bin/clear_console -q` while exiting # login shells which frequently erred on ubuntu-latest since the shell was # not run interactively. - name: Disable ~/.bash_logout (Linux) shell: bash -e {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: mv -v ~/.bash_logout ~/.bash_logout.bak - name: LSP Test (Linux / macOS) shell: bash -e -l {0} if: (contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')) && contains(matrix.llvm-version, '11') timeout-minutes: 5 env: EXIT_SUCCESS: 0 EXIT_TIMEOUT: 124 EXIT_KILL: 137 MAX_ATTEMPTS: 3 SIGTERM_TIMEOUT: 60s SIGKILL_TIMEOUT: 10s PYTEST_TIMEOUT: 10 run: | set -ex pip install src/server/tests tests/server timeout -k $SIGKILL_TIMEOUT $SIGTERM_TIMEOUT \ pytest -vv \ --showlocals \ --timeout=$PYTEST_TIMEOUT \ --execution-strategy="concurrent" \ tests/server set +e for (( ATTEMPT = 1; ATTEMPT <= MAX_ATTEMPTS; ATTEMPT++ )); do echo "Attempt $ATTEMPT of $MAX_ATTEMPTS" timeout -k $SIGKILL_TIMEOUT $SIGTERM_TIMEOUT \ pytest -vv \ --showlocals \ --timeout=$PYTEST_TIMEOUT \ --execution-strategy="parallel" \ tests/server EXIT_CODE=$? if [ $EXIT_CODE -eq $EXIT_SUCCESS ]; then break fi echo "Command failed with exit code: $EXIT_CODE" 1>&2 done set -e exit $EXIT_CODE - name: Test GFortran, Debug Build, Fortran, OpenMP, C/C++ backend, Upload Tarball, CPP Build, WASM - Test integration_tests with GFortran shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | cd integration_tests ./run_tests.py -b gfortran - name: Test GFortran, Debug Build, Fortran, OpenMP, C/C++ backend, Upload Tarball, CPP Build, WASM - Test Debug Build Linux shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | ctest ./run_tests.py ./run_tests.py -vh cd integration_tests ./run_tests.py -m ./run_tests.py -b llvm ./run_tests.py -b llvm -f -nf16 ./run_tests.py -b llvm_single_invocation - name: Test GFortran, Debug Build, Fortran, OpenMP, C/C++ backend, Upload Tarball, CPP Build, WASM - Test OpenMP shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | cd integration_tests ./run_tests.py -b llvm_omp - name: Test GFortran, Debug Build, Fortran, OpenMP, C/C++ backend, Upload Tarball, CPP Build, WASM - Test Target Offload shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | cd integration_tests ./run_tests.py -b target_offload - name: Test GFortran, Debug Build, Fortran, OpenMP, C/C++ backend, Upload Tarball, CPP Build, WASM - Test Fortran Backend shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | cd integration_tests ./run_tests.py -b fortran -j1 ./run_tests.py -b fortran -f -j1 - name: Test GFortran, Debug Build, Fortran, OpenMP, C/C++ backend, Upload Tarball, CPP Build, WASM - Test C/C++ Backend shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | mkdir build-kokkos cd build-kokkos wget https://github.com/kokkos/kokkos/archive/3.1.01.tar.gz tar xaf 3.1.01.tar.gz cd kokkos-3.1.01 mkdir build cd build export LFORTRAN_KOKKOS_DIR=$HOME/ext/kokkos cmake -DCMAKE_INSTALL_PREFIX=$LFORTRAN_KOKKOS_DIR -DKokkos_ENABLE_OPENMP=On -DKokkos_ARCH_HSW=On .. make make install cd ../../.. cd integration_tests ./run_tests.py -b cpp c c_nopragma ./run_tests.py -b cpp c c_nopragma -f - name: Test GFortran, Debug Build, Fortran, OpenMP, C/C++ backend, Upload Tarball, CPP Build, WASM - Test CPP shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | shell ci/test_cpp_version.sh - name: Test GFortran, Debug Build, Fortran, OpenMP, C/C++ backend, Upload Tarball, CPP Build, WASM - Show Node Info shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | set -ex which node node --version - name: Test GFortran, Debug Build, Fortran, OpenMP, C/C++ backend, Upload Tarball, CPP Build, WASM - Test WASM backend shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | cd integration_tests ./run_tests.py -b wasm ./run_tests.py -b wasm -f - name: Check Bison Grammar for Essential Conflicts if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '21') shell: bash -e -l {0} run: | ./ci/grammar_conflicts.sh # Run last. Script checks out to first commit in PR history - name: Check for Added Binary Files shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '21') run: | python3 check_binary_file_in_git_history.py build_to_wasm_and_upload: name: Build LFortran to WASM and Upload runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: mamba-org/setup-micromamba@v2.0.2 with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux.yml create-args: >- python=3.10 - uses: hendrikmuhs/ccache-action@main with: variant: sccache key: ${{ github.job }}-${{ matrix.os }} - name : Remove existing node shell: bash -e -l {0} run : | which node node -v sudo rm -rf /usr/local/bin/node /usr/local/bin/npm - name: Setup Emscripten SDK shell: bash -l {0} run: | set -ex mkdir -p $HOME/ext cd $HOME/ext curl -o emsdk.tar.gz -L https://github.com/emscripten-core/emsdk/archive/refs/tags/4.0.13.tar.gz tar -xvf emsdk.tar.gz mv emsdk-4.0.13 emsdk export EMSDK_PATH=$HOME/ext/emsdk echo $EMSDK_PATH cd $EMSDK_PATH ./emsdk install 3.1.35 ./emsdk activate 3.1.35 ./emsdk install node-18.20.3-64bit ./emsdk activate node-18.20.3-64bit - name: Show Emscripten and Node Info shell: bash -l {0} run: | set -ex # Activate PATH and other environment variables in the current terminal source $HOME/ext/emsdk/emsdk_env.sh emcc -v em++ -v which node node -v - name: Build to WASM shell: bash -l {0} run: | set -ex source $HOME/ext/emsdk/emsdk_env.sh # Activate Emscripten ./build_to_wasm.sh - name: Test built lfortran.wasm shell: bash -l {0} run: | set -ex source $HOME/ext/emsdk/emsdk_env.sh # Activate Emscripten which node node -v node src/lfortran/tests/test_lfortran.js - name: Upload to wasm_builds shell: bash -l {0} run: | ci/upload_lfortran_wasm.sh env: SSH_PRIVATE_KEY_WASM_BUILDS: ${{ secrets.SSH_PRIVATE_KEY_WASM_BUILDS }} lfortran-0.63.0/.github/workflows/Exhaustive-Checks-CI.yml0000664000175000017500000005636315174404631023571 0ustar alastairalastairname: Exhaustive checks on: push: branches: - main tags: - 'v*' pull_request: types: [labeled, unlabeled, synchronize] branches: - main # For a PR #7488 against main branch, the `group` will become: CI-{{ 7488 || github.sha }} # which eventually evaluates to: CI-7488 and 'sha' isn't used. # NOTE: `||` acts as a logical OR and a default operator both, # see: https://docs.github.com/en/actions/learn-github-actions/expressions#operators. # When it isn't a PR against main but instead a commit pushed (or merged) to main, then `group` will # evaluate to `${{ github.sha }}` but "cancel-in-progress" evaluates to false, so the CI on main # will run in a new group `${{ github.sha }}`, but no previous CI will be cancelled on main concurrency: group: ${{ github.workflow }}-${{ github.event.number || github.sha }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} env: MACOSX_DEPLOYMENT_TARGET: 15.0 jobs: debug_outOfSource: name: Check Out-of-Source Debug build runs-on: ubuntu-latest # Run on push to main, or when the PR has the label at the time of the event if: >- ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Tests::Run-Exhaustive')) }} steps: - uses: actions/checkout@v6 with: fetch-depth: 0 path: src - uses: mamba-org/setup-micromamba@v1.8.0 with: micromamba-version: '1.5.10-0' environment-file: src/ci/environment_linux.yml create-args: >- python=3.10 - uses: hendrikmuhs/ccache-action@main with: variant: sccache key: ${{ github.job }}-${{ matrix.os }} - name: Build Linux shell: bash -e -l {0} run: | ( cd src && ./build0.sh ) export CXXFLAGS="-Werror -D_GLIBCXX_ASSERTIONS" cmake -S src -B builddir -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_FLAGS_RELEASE="-Wall -Wextra -O3 -funroll-loops -DNDEBUG" \ -DWITH_LLVM=yes \ -DWITH_LSP=yes \ -DWITH_KOKKOS=yes \ -DLFORTRAN_BUILD_ALL=yes \ -DWITH_STACKTRACE=no \ -DWITH_RUNTIME_STACKTRACE=yes \ -DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX=`pwd`/inst \ -DCMAKE_C_COMPILER_LAUNCHER=sccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache cmake --build builddir -j16 --target install - name: Test Linux shell: bash -e -l {0} run: ctest --output-on-failure working-directory: builddir - name: Test Moved Installation shell: bash -e -l {0} run: | mv inst inst.moved cp src/examples/expr2.f90 expr2.F90 rm -rf src inst.moved/bin/lfortran expr2.F90 -o expr2 ./expr2 inst.moved/bin/lfortran --backend=c expr2.F90 -o expr2b ./expr2b inst.moved/bin/lfortran --openmp --backend=cpp expr2.F90 -o expr2c ./expr2c release: name: Check Release build runs-on: ubuntu-latest # Run on push to main, or only when the specific label is modified on a PR if: >- ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Tests::Run-Exhaustive')) }} steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: mamba-org/setup-micromamba@v2.0.2 with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux.yml create-args: >- python=3.10 - uses: hendrikmuhs/ccache-action@main with: variant: sccache key: ${{ github.job }}-${{ matrix.os }} - name: Build Linux shell: bash -e -l {0} run: | ./build0.sh export CXXFLAGS="-Werror" export CFLAGS="-Werror" cmake . -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -DWITH_LLVM=yes \ -DWITH_LSP=yes \ -DLFORTRAN_BUILD_ALL=yes \ -DWITH_STACKTRACE=no \ -DWITH_RUNTIME_STACKTRACE=yes \ -DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX=`pwd`/inst \ -DCMAKE_INSTALL_BINDIR=bin/tastic \ -DCMAKE_INSTALL_LIBDIR=oh/my/sweet/lib \ -DCMAKE_INSTALL_INCLUDEDIR=incl/O/Matic \ -DCMAKE_INSTALL_MANDIR=man/O/man \ -DCMAKE_C_COMPILER_LAUNCHER=sccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache cmake --build . -j16 --target install - name: Test Linux shell: bash -e -l {0} run: | ctest ./run_tests.py ./run_tests.py -vh cd integration_tests ./run_tests.py -m ./run_tests.py -b llvm ./run_tests.py -b llvm -f -nf16 - name: Test Installation shell: bash -e -l {0} run: | test -x inst/bin/tastic/lfortran test -f inst/oh/my/sweet/lib/liblfortran_runtime_static.a test -f inst/oh/my/sweet/lib/liblfortran_runtime.so test -f inst/incl/O/Matic/lfortran/impure/lfortran_intrinsics.h test -f inst/man/O/man/man1/lfortran.1 # Commented out to save CI runners: # test-pixi: # name: Pixi Build (${{ matrix.os }}) # runs-on: ${{ matrix.os }} # strategy: # fail-fast: false # matrix: # os: ["ubuntu-latest"] # steps: # - uses: actions/checkout@v6 # with: # fetch-depth: 0 # - uses: prefix-dev/setup-pixi@v0.8.1 # with: # pixi-version: v0.37.0 # cache: true # - name: LLVM 10 # run: | # pixi run -e llvm10 build # pixi run start --version # pixi run ctest # pixi run integration_tests # pixi run clean # - name: LLVM 11 # run: | # pixi run -e llvm11 build # pixi run start --version # pixi run ctest # pixi run tests # Only run for LLVM 11 # pixi run integration_tests # pixi run clean # - name: LLVM 19 # run: | # pixi run -e llvm19 build # pixi run start --version # pixi run ctest # pixi run integration_tests # pixi run clean test_llvm: name: Test LLVM ${{ matrix.llvm-version }} (${{ matrix.os }}) runs-on: ${{ matrix.os }} # Run on push to main, or only when the specific label is modified on a PR if: >- ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Tests::Run-Exhaustive')) }} strategy: fail-fast: false matrix: # this is only run on ubuntu intentionally (except macOS LLVM 22) os: ["ubuntu-latest"] # Note: The LLVM 11 test is redundant, since it is already tested by # most other tests (since LLVM 11 is our default version), but we have # it here as well for consistency, and that way other tests can freely # switch to other versions as needed. We test all versions here in # exactly the same manner, to ensure that users can just change the # `llvmdev` version in their conda environment and everything will just # work. llvm-version: ["8", "10", "11", "15", "17", "18", "19", "21", "22"] python-version: ["3.10"] include: - os: macos-latest llvm-version: "22" python-version: "3.10" steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: mamba-org/setup-micromamba@v2.0.2 if: contains(matrix.llvm-version, '19') with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux_llvm.yml create-args: >- python=${{ matrix.python-version }} llvmdev=${{ matrix.llvm-version }} bison=3.4 openblas=0.3.21 llvm-openmp=14.0.4 make=4.3 nodejs=18.20.4 openmpi=5.0.6=hb85ec53_102 xonsh=0.16.0 zlib=1.3.1 zstd-static=1.5.6 - uses: mamba-org/setup-micromamba@v2.0.2 if: contains(matrix.llvm-version, '10') with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux_llvm.yml create-args: >- python=${{ matrix.python-version }} llvmdev=${{ matrix.llvm-version }} bison=3.4 openblas=0.3.21 llvm-openmp=14.0.4 make=4.3 nodejs=18.20.2 openmpi=5.0.6=hb85ec53_102 zlib=1.3.1 zstd-static=1.5.6 xonsh=0.16.0 - uses: mamba-org/setup-micromamba@v2.0.2 if: contains(matrix.llvm-version, '18') with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux_llvm.yml create-args: >- python=${{ matrix.python-version }} llvmdev=${{ matrix.llvm-version }} bison=3.4 openblas=0.3.21 llvm-openmp=14.0.4 make=4.3 xonsh=0.16.0 zlib=1.3.1 zstd-static=1.5.6 openmpi=5.0.6=hb85ec53_102 - uses: mamba-org/setup-micromamba@v2.0.2 if: contains(matrix.llvm-version, '20') with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux_llvm.yml create-args: >- python=${{ matrix.python-version }} llvmdev=${{ matrix.llvm-version }} bison=3.4 openblas=0.3.21 llvm-openmp=14.0.4 make=4.3 openmpi=5.0.6=hb85ec53_102 xonsh=0.16.0 zlib=1.3.1 zstd-static=1.5.7 - uses: mamba-org/setup-micromamba@v2.0.2 if: contains(matrix.llvm-version, '21') with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux_llvm.yml create-args: >- llvmdev=21.1.0 python=${{ matrix.python-version }} bison=3.4 openblas=0.3.21 llvm-openmp=14.0.4 make=4.3 openmpi=5.0.6=hb85ec53_102 - uses: mamba-org/setup-micromamba@v2.0.2 if: contains(matrix.llvm-version, '22') && contains(matrix.os, 'ubuntu') with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux_llvm.yml create-args: >- python=${{ matrix.python-version }} llvmdev=${{ matrix.llvm-version }} bison=3.4 openblas=0.3.21 llvm-openmp=14.0.4 make=4.3 openmpi=5.0.10 binutils=2.45.1 zstd-static=1.5.7 - uses: mamba-org/setup-micromamba@v2.0.2 if: contains(matrix.os, 'macos') with: micromamba-version: '2.0.4-0' environment-file: ci/environment.yml create-args: >- llvmdev=${{ matrix.llvm-version }} bison=3.4 openblas=0.3.21 llvm-openmp=14.0.4 make=4.3 openmpi=5.0.10 zstd-static=1.5.7 - uses: mamba-org/setup-micromamba@v2.0.2 if: contains(matrix.llvm-version, '12') with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux_llvm.yml create-args: >- python=${{ matrix.python-version }} llvmdev=${{ matrix.llvm-version }} bison=3.4 openblas=0.3.21 llvm-openmp=14.0.4 make=4.3 openmpi=5.0.3 - uses: mamba-org/setup-micromamba@v2.0.2 if: ${{! ( contains(matrix.llvm-version, '10') || contains(matrix.llvm-version, '12') || contains(matrix.llvm-version, '18') || contains(matrix.llvm-version, '19') || contains(matrix.llvm-version, '20') || contains(matrix.llvm-version, '21') || contains(matrix.llvm-version, '22') )}} with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux_llvm.yml create-args: >- python=${{ matrix.python-version }} llvmdev=${{ matrix.llvm-version }} bison=3.4 openblas=0.3.21 llvm-openmp=14.0.4 make=4.3 openmpi=5.0.6=hb85ec53_102 - uses: hendrikmuhs/ccache-action@main with: variant: sccache key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.llvm-version }} - name: Install libunwind if: matrix.llvm-version > 11 && contains(matrix.os, 'ubuntu') run: micromamba install -y -n lf libunwind=1.7.2 - name: Setup WASI SDK if: contains(matrix.llvm-version, '10') || contains(matrix.llvm-version, '19') shell: bash -e -l {0} run: | mkdir -p $HOME/ext cd $HOME/ext curl -o wasi-sdk.tar.gz -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-21/wasi-sdk-21.0-linux.tar.gz tar -xvf wasi-sdk.tar.gz mv wasi-sdk-21.0 wasi-sdk export WASI_SDK_PATH=$HOME/ext/wasi-sdk echo $WASI_SDK_PATH $WASI_SDK_PATH/bin/clang --version - name: Install wasmtime if: contains(matrix.llvm-version, '10') || contains(matrix.llvm-version, '19') shell: bash -e -l {0} run: | cd $HOME curl -o wasmtime.tar.gz -L https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-x86_64-linux.tar.xz tar -xvf wasmtime.tar.gz export PATH=$HOME/wasmtime-v19.0.2-x86_64-linux:$PATH wasmtime --version - name: Setup Emscripten SDK if: contains(matrix.llvm-version, '10') || contains(matrix.llvm-version, '19') shell: bash -e -l {0} run: | mkdir -p $HOME/ext cd $HOME/ext curl -o emsdk.tar.gz -L https://github.com/emscripten-core/emsdk/archive/refs/tags/4.0.13.tar.gz tar -xvf emsdk.tar.gz mv emsdk-4.0.13 emsdk export EMSDK_PATH=$HOME/ext/emsdk echo $EMSDK_PATH cd $EMSDK_PATH ./emsdk install 3.1.35 ./emsdk activate 3.1.35 - name: Build Linux ( WASM ) if: contains(matrix.llvm-version, '10') || contains(matrix.llvm-version, '19') shell: bash -e -l {0} run: | export WASI_SDK_PATH=$HOME/ext/wasi-sdk export EMSDK_PATH=$HOME/ext/emsdk export CXXFLAGS="-Werror -D_GLIBCXX_ASSERTIONS" ./build0.sh cmake . -GNinja \ -DCMAKE_BUILD_TYPE=Debug \ -DWITH_LLVM=yes \ -DWITH_LSP=yes \ -DWITH_TARGET_WASM=yes \ -DLFORTRAN_BUILD_ALL=yes \ -DWITH_STACKTRACE=no \ -DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX=`pwd`/inst \ -DCMAKE_C_COMPILER_LAUNCHER=sccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache cmake --build . -j16 --target install - name: Test Linux ( WASM ) if: contains(matrix.llvm-version, '19') shell: bash -e -l {0} run: | export WASI_SDK_PATH=$HOME/ext/wasi-sdk export EMSDK_PATH=$HOME/ext/emsdk export PATH=$HOME/wasmtime-v19.0.2-x86_64-linux:$PATH export WASMTIME_NEW_CLI=0 cd integration_tests ./run_tests.py -b llvm_wasm llvm_wasm_emcc - name: Build if: ${{! (contains(matrix.llvm-version, '10') || contains(matrix.llvm-version, '19'))}} shell: bash -e -l {0} run: | ./build0.sh cmake . -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_FLAGS_RELEASE="-Wall -Wextra -O3 -funroll-loops -DNDEBUG" \ -DWITH_LLVM=yes \ -DWITH_LSP=yes \ -DLFORTRAN_BUILD_ALL=yes \ -DWITH_STACKTRACE=no \ -DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX=`pwd`/inst \ -DCMAKE_C_COMPILER_LAUNCHER=sccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache cmake --build . -j16 --target install - name: Test third party codes shell: bash -e -x -l {0} if: ${{! (matrix.llvm-version == '7') }} run: | export PATH="$(pwd)/src/bin:$PATH" LAPACK_MODE="smoke" if [[ "${{ matrix.llvm-version }}" == "11" || "${{ matrix.llvm-version }}" == "21" ]]; then LAPACK_MODE="full" fi echo "Running LAPACK third-party mode: ${LAPACK_MODE}" RUNNER_OS="${{matrix.os}}" FC=lfortran ci/test_third_party_codes.sh --lapack-mode "${LAPACK_MODE}" upload_tarball: name: Upload Tarball runs-on: ubuntu-latest # Run on push to main, or only when the specific label is modified on a PR if: >- ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Tests::Run-Exhaustive')) }} steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: mamba-org/setup-micromamba@v2.0.2 with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux.yml create-args: >- python=3.10 - name: Upload Tarball shell: bash -e -l {0} run: | ./build0.sh lfortran_version=$(- ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Tests::Run-Exhaustive')) }} steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: mamba-org/setup-micromamba@v2.0.2 with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux.yml create-args: >- python=3.10 - name: Test shell: bash -e -l {0} run: | shell ci/test_without_llvm_backend.sh test_mlir: name: Test MLIR backend runs-on: ubuntu-latest # Run on push to main, or only when the specific label is modified on a PR if: >- ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Tests::Run-Exhaustive')) }} steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: mamba-org/setup-micromamba@v2.0.2 with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux_llvm.yml create-args: >- python=3.10 mlir=19.1.6 llvm=19.1.6 llvm-openmp=19.1.6 libunwind=1.7.2 - uses: hendrikmuhs/ccache-action@main with: variant: sccache key: ${{ github.job }}-${{ matrix.os }} - name: Build Linux shell: bash -e -l {0} run: | ./build0.sh cmake . -GNinja \ -DCMAKE_BUILD_TYPE=Debug \ -DWITH_LLVM=yes \ -DWITH_LSP=yes \ -DWITH_MLIR=yes \ -DLFORTRAN_BUILD_ALL=yes \ -DWITH_STACKTRACE=no \ -DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX=`pwd`/inst \ -DCMAKE_C_COMPILER_LAUNCHER=sccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache cmake --build . -j16 --target install - name: Test Linux shell: bash -e -l {0} run: | cd integration_tests ./run_tests.py -b mlir mlir_omp mlir_llvm_omp -j1 upload_docs: name: Documentation runs-on: ubuntu-latest # Run on push to main, or only when the specific label is modified on a PR if: >- ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Tests::Run-Exhaustive')) }} steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: mamba-org/setup-micromamba@v2.0.2 with: micromamba-version: '2.0.4-0' environment-file: ci/environment_docs_linux.yml - uses: hendrikmuhs/ccache-action@main with: variant: sccache key: ${{ github.job }}-${{ matrix.os }} - name: Build Kernel shell: bash -e -l {0} run: | ./build0.sh export CXXFLAGS="-Werror -D_GLIBCXX_ASSERTIONS" cmake . -GNinja \ -DCMAKE_BUILD_TYPE=Debug \ -DWITH_LLVM=yes \ -DWITH_LSP=yes \ -DWITH_XEUS=yes \ -DCMAKE_PREFIX_PATH=$CONDA_PREFIX \ -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ -DCMAKE_C_COMPILER_LAUNCHER=sccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ninja install ctest --output-on-failure jupyter kernelspec list --json - name: Build Docs shell: bash -e -l {0} working-directory: doc run: | $(command -v python) build.py - name: Upload Docs shell: bash -e -l {0} working-directory: doc run: | ../ci/upload_docs.sh env: SSH_PRIVATE_KEY_DOCS: ${{ secrets.SSH_PRIVATE_KEY_DOCS }} build-and-push-image: runs-on: ubuntu-latest # Run on push to main, or only when the specific label is modified on a PR if: >- ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Tests::Run-Exhaustive')) }} permissions: contents: read packages: write env: REGISTRY: ghcr.io USER: lfortran PROJECT: lfortran steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - name: Log in to the Container registry if: ${{ github.event_name == 'push' }} uses: docker/login-action@v4 with: registry: ${{ env.REGISTRY }} username: ${{ env.USER }} password: ${{ secrets.GITHUB_TOKEN }} - name: Determine image tags id: image-tags run: | TAGS="${{ env.REGISTRY }}/${{ env.USER }}/${{ env.PROJECT }}:latest" if [[ "${{ github.ref }}" == refs/tags/v* ]]; then VERSION="${{ github.ref_name }}" TAGS="$TAGS,${{ env.REGISTRY }}/${{ env.USER }}/${{ env.PROJECT }}:${VERSION}" fi echo "tags=$TAGS" >> "$GITHUB_OUTPUT" - name: Build and push uses: docker/build-push-action@v7 with: context: . push: ${{ github.event_name == 'push' }} tags: ${{ steps.image-tags.outputs.tags }} lfortran-0.63.0/.github/FUNDING.yml0000664000175000017500000000021615174404631016774 0ustar alastairalastair# These are supported funding model platforms github: lfortran open_collective: lfortran custom: ['https://numfocus.org/donate-to-lfortran'] lfortran-0.63.0/.github/dependabot.yml0000664000175000017500000000015615174404631020012 0ustar alastairalastairversion: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" lfortran-0.63.0/check_binary_file_in_git_history.py0000664000175000017500000000644015174404631022730 0ustar alastairalastairimport subprocess # Open file_path, Read it with mode 'r' which expects a utf-8 encode. # If the file is binary it'd conflict with # text mode 'r', leading to raised error `UnicodeDecodeError`. def is_file_binary(file_path: str) -> bool: try: with open(file_path, 'r') as fp: fp.read(16) return False except UnicodeDecodeError: return True # Get all commit hashes difference between `origin/main` and current `HEAD` def get_commit_hash_differences() -> list : # Run command `git rev-list origin/main..HEAD` # Use `subporcess.PIPE` as the output buffer to fetch the list of commit hashes completedProcess_object = subprocess.run(["git" ,"rev-list" ,"origin/main..HEAD"], stdout=subprocess.PIPE , text=True) # Create list out of the resulting commit hases. commit_hashes_listed : list = completedProcess_object.stdout.split("\n") if(commit_hashes_listed[-1] == ""): commit_hashes_listed.remove("") # Remove trailing empty string. print("number of commits from current PR branch against origin/main is :", len(commit_hashes_listed)) print (completedProcess_object.stdout) # print the whole string of commit hashes. return commit_hashes_listed # Fetch all files pathes that has beend changed from current `HEAD` against `origin/main`. def get_changed_files() -> list : # Run command `git diff --name-only origin/main --diff-filter=d` # Notice we filter out the deleted files. completedProcess_object = subprocess.run(["git","diff","--name-only","origin/main", "--diff-filter=d"], stdout=subprocess.PIPE, text=True) file_paths : list = completedProcess_object.stdout.split("\n") if(file_paths[-1] == ""): file_paths.remove("") # Remove trailing empty string. return file_paths def run_test() : commit_hashes_list = get_commit_hash_differences() # Run git `checkout` to each commit_hash between `origin/main` --> `HEAD` for commit_hash in commit_hashes_list: subprocess.run(["git","checkout",commit_hash], stdout=subprocess.PIPE,stderr=subprocess.PIPE,text=True) print("checked out to commit --> ",commit_hash) file_paths : list = get_changed_files() # fetch changed files from current-checkout-to commit. for file_path in file_paths: if (is_file_binary(file_path)): print("FAIL --- binary file detected") print(f"Binary File Name : ({file_path}) In Commit : ({commit_hash})") raise SystemExit(1) print("OK --- no binary file found") print("\n--------------------------------------------------\n") print("CLEAN : No binary file found in any commit in this PR") print("\n--------------------------------------------------\n") if(len(commit_hashes_list) > 0): print("==> Checking out to latest commit in the PR branch") print("==> Commit hash :", commit_hashes_list[0]) subprocess.run(["git","checkout",commit_hashes_list[0]], stdout=subprocess.PIPE, stderr=subprocess.PIPE,text=True) print("\n--------------------------------------------------\n") print("DONE") run_test()